/* Minification failed. Returning unminified contents.
(6,60359-60360): run-time error JS1195: Expected expression: )
(6,60361-60362): run-time error JS1195: Expected expression: >
(6,60373-60374): run-time error JS1195: Expected expression: )
(6,60376-60377): run-time error JS1003: Expected ':': )
(6,60399-60400): run-time error JS1004: Expected ';': :
(6,60434-60435): run-time error JS1004: Expected ';': {
(6,61044-61045): run-time error JS1195: Expected expression: ,
(6,61081-61082): run-time error JS1195: Expected expression: )
(6,61082-61083): run-time error JS1004: Expected ';': {
(6,61587-61588): run-time error JS1195: Expected expression: ,
(6,61640-61641): run-time error JS1004: Expected ';': {
(6,61661-61662): run-time error JS1195: Expected expression: ,
(6,61752-61753): run-time error JS1004: Expected ';': {
(6,62252-62253): run-time error JS1195: Expected expression: ,
(6,62305-62306): run-time error JS1004: Expected ';': {
(6,62681-62682): run-time error JS1195: Expected expression: ,
(6,62752-62753): run-time error JS1004: Expected ';': {
(6,62859-62860): run-time error JS1195: Expected expression: ,
(6,62929-62930): run-time error JS1004: Expected ';': {
(6,63037-63038): run-time error JS1195: Expected expression: ,
(6,63129-63130): run-time error JS1004: Expected ';': {
(6,63934-63935): run-time error JS1195: Expected expression: ,
(6,64034-64035): run-time error JS1004: Expected ';': {
(6,64237-64238): run-time error JS1195: Expected expression: ,
(6,64345-64346): run-time error JS1004: Expected ';': {
(6,64532-64533): run-time error JS1195: Expected expression: ,
(6,64645-64646): run-time error JS1004: Expected ';': {
(6,64760-64761): run-time error JS1195: Expected expression: ,
(6,64847-64848): run-time error JS1004: Expected ';': {
(6,65605-65606): run-time error JS1195: Expected expression: ,
(6,65691-65692): run-time error JS1004: Expected ';': {
(6,65984-65985): run-time error JS1195: Expected expression: ,
(6,66103-66104): run-time error JS1004: Expected ';': {
(6,67155-67156): run-time error JS1195: Expected expression: ,
(6,67254-67255): run-time error JS1004: Expected ';': {
(6,67418-67419): run-time error JS1195: Expected expression: ,
(6,67455-67456): run-time error JS1004: Expected ';': {
(6,67876-67877): run-time error JS1195: Expected expression: ,
(6,67900-67901): run-time error JS1197: Too many errors. The file might not be a JavaScript file: :
 */
!function WP$Common$SelectableViewBinder$definition(){var e=function WP$Common$SelectableViewBinder(e,t,s,n){var a=new Array("click");Array.isArray(n)||(n=[n]);for(var r=0;r<n.length;r++)a.push(n[r]);this.WP$Common$ViewBinder(a,[e]),this._statePropertyName=e,this._selected=t,this._unselected=s};e.prototype={_statePropertyName:null,_selected:null,_unselected:null,_onPropertyChanged:function(e,t){t.from===this._selected?this._setBoundElementUnselected(e):t.to===this._selected&&this._setBoundElementSelected(e)},_onSyncModelToDOM:function(e){e[this._statePropertyName]===this._selected?this._setBoundElementSelected(e):this._setBoundElementUnselected(e)},_setBoundElementSelected:function(e){var t=this.getBoundElements(e);t.safeAttr("aria-pressed")?(t.addClass("selected"),t.hasClass("noAria")||t.safeAttr("aria-pressed","true")):(t.addClass("selected"),t.hasClass("noAria")||t.safeAttr("aria-selected","true"))},_setBoundElementUnselected:function(e){var t=this.getBoundElements(e);t.safeAttr("aria-pressed")?(t.removeClass("selected"),t.hasClass("noAria")||t.safeAttr("aria-pressed","false")):(t.removeClass("selected"),t.hasClass("noAria")||t.safeAttr("aria-selected","false"))},_onDomEvent:function(e,t,s){var n;(n=e[this._statePropertyName])===this._selected?e.setProperty(this._statePropertyName,this._unselected):n===this._unselected&&e.setProperty(this._statePropertyName,this._selected),s.preventDefault()}},$$WP.Common=$$WP.Common||{},$$WP.Common.SelectableViewBinder=e,e.extend($$WP.Common.ViewBinder,"WP$Common$SelectableViewBinder")}(),$$WP.Debug.UnitTest=$$WP.Debug.UnitTest||{},$$WP.Debug.UnitTest.tests=$$WP.Debug.UnitTest.tests||[],$$WP.Debug.UnitTest.tests.push((function UnitTests$Common$SelectableViewBinder(e){$$WP.Debug.UnitTest.assert}));;
/*! Copyright 2016 Epic Systems Corporation */
!function WP$Common$MyChartUser$definition(){var t=$$WP.Common.ModelCollection,e=function WP$Common$MyChartUser(t){this.WP$Common$Model(t),this.WprId||0===this.WprId||$$WP.Debug.logError("A MyChart user was created from a raw object that did not contain a WPR ID: "+JSON.stringify(t))},r=[{propertyNames:"WprId",storeAs:"single"}],o=[];e.prototype={s_dataMembers:["WprId","FullName","EptId"],WprId:null,FullName:null,EptId:null,IsSelf:!1,Selected:!0},e.convertRawMyChartUsers=function WP$Common$MyChartUser$convertRawMyChartUsers(t,r){var o,n,s,$;if($=[],Array.isArray(t))for(o=0;o<t.length;o++)"object"==typeof(n=t[o])&&void 0!==n.WprId&&(null===(s=r.getFromIndex("WprId",n.WprId))&&((s=new e(n)).IsSelf=0===o,r.add(s)),$.push(s));return $},e.createMyChartUsersCollection=function(){return new t(r,o)},$$WP.Common=$$WP.Common||{},$$WP.Common.MyChartUser=e,e.extend($$WP.Common.Model,"WP$Common$MyChartUser")}(),$$WP.Debug.UnitTest=$$WP.Debug.UnitTest||{},$$WP.Debug.UnitTest.tests=$$WP.Debug.UnitTest.tests||[],$$WP.Debug.UnitTest.tests.push((function UnitTests$MyChartUser(t){$$WP.Debug.UnitTest.assert}));;
/*! Copyright (c) Epic Systems Corporation 2017-2018 */
$$WPUtil.guaranteeExistence($$WP,"Community.Components"),$$WP.Community.Components.CommunityPopupComponent=function WP$Community$Components$CommunityPopupComponent(n,o){this.Components$TemplateComponent(n),this.template=null!=o?o:$$WP.Templates.Community.CommunityPopup},$$WP.Community.Components.CommunityPopupComponent.extend("Components.TemplateComponent");;
function expandSection(e){var t=$afe.select("#"+e),i=$afe.select("[data-expand-button="+e+"]"),n=i.safeAttr("data-scroll-into-view"),r=null;i.safeAttr("aria-expanded",!0),i.safeAttr("data-expand-state","expanded"),n&&(r=function(){t[0].getBoundingClientRect().bottom-window.innerHeight>0&&t[0].scrollIntoView(!1)}),t.slideDown({progress:r})}function collapseSection(e){var t;$afe.select("#"+e).slideUp(""),(t=$afe.select("[data-expand-button="+e+"]")).safeAttr("aria-expanded",!1),t.safeAttr("data-expand-state","collapsed")}function toggleSection(e){$afe.select("#"+e).is(":hidden")?expandSection(e):collapseSection(e)}!function WP$Community$Controller$definition(){var e,t=1,i=2,n=3,r=4,o=5,a=6,s=7,l=8,c=9,d=1,u=2,g=3,m=1,h=2,p=3,C=4,y=5,_=6,k=7,O=8,f=9,P="",L="2",S="8",T="9",I=1,A=2,b=1,W=2,R=3,v=10,M=11,E=12,w=20,U=30,z=31,F="no_code",x="token_failed",N="demographic_fetch_failed",D="demographic_match_failed",H="CE",j="LinkedOrg",B="FHIR",q="UnknownEpic",G=1,Q=3,V=4,K=function WP$Community$CommunityController(e,d,u,g,m,h,p,C,$,y,_){var k;if(this.WP$Controllers$Controller(),this.proxify("_successGetOrganizationList","_errorGetOrganizationList","_getOrganizationList","clickLink","_loadConfirm","clickChildOrgs","goToTop","_clickLinkCallback","CreateLinkToOrganizationWithPopup","clickUnlink","_clickUnlinkCallback","clickLoginBottomButtons","clickSignup","_clickSignupCallback","clickJump","clickAuth","clickVerifyAnswer","clickNotMe","clickCancel","_successVerifyAccount","showSuccessAndDisposePopup","disposePopup","disposePopupCallback","maskOrUnmaskAnswerField","clickUpdateFHIR","clickConfirmUpdateFHIR","clickLinkFHIR","connectFHIR","_successGetFhirRedirectUrl","clickUnlinkFHIR","clickConfirmUnlinkFHIR","clickRemindUpdateFHIR","reloadAfterCancel","continueFHIRQueryString","_createTokenExchangePopup","_createFHIRUpdatePopup","_getFhirCloseButtonText","_getRefreshStatus","_handleLoadStatus","_getUpdateStatusDisplayModel","_getFeatureDisplayModel","_successUpdateFHIRAccount","_forceStopFhirLoadStatus","_disposeFhirUpdatePopup","closeFhirUpdatePopup","_successReminderToggled","_renderFhirOrgPopup","_renderFhirOrgPage","_getDXRLinkedOrganizations","_filterDXRLinkedOrganizations","sortDXROrg","_updateAnotherOrganization","_getCurrentLoadingOrgList","_successGetCurrentLoadingOrgList","_replaceLoadingText","_updateDxrOrgModels","_manualTokenExchangeSucceed","giveConsent","_errorGiveConsent","_successGiveConsent","clickConsentLink","autoQuery","_errorAutoQuery","_successAutoQuery","_completeUpdate","_completeUnlink","_successClickConnectEpic","_errorCreateLink","_errorVerifyAccount","_errorClickNotMe","_errorClickUnlink","_errorUpdateFhir","_errorAcceptFhirConsent","_errorGetChildrenOrganizations","_errorGetCurrentLoadingOrgList","_errorDismissOrg","_handleLoginAjaxResponse","_errorClickConnectEpic","_successGetChildrenOrganizations","renderChildOrgList","CreateLinkToOrganization","organizationSearchOnInput","_displayAndHighlightSearchResults","_organizationSearchSuccessOrError","_renderInProgressOrganizations","_renderInsuranceOrganizations","_renderKnownOrganizations","_renderCentralOrganization","_renderNearbyOrganizations","_renderLinkedOrganizations","_renderManagePageContent","_renderLoginPageContent","_renderStaticManagePageContent","_tryRenderManagePageContent","_buildActivityIconModel","_getKnownCEOrganizations","_getLinkedOrganizations","_filterLinkedOrganizations","_hasNonDXRLinkedOrganization","_getAutoQueryCount","_displayLoadingPopup","removeQueryStringFromBrowser","_groupLinkedOrganizations","_getManuallyUpdateOrgs","_getPeriodicallyUpdateOrgs","_getAutomaticallyUpdateOrgs","closeWebView","handleMobileBackButton","clickConnectEpic","continueCELinking","_successContinueCELinking","_errorContinueCELinking","toLinkedTab","toDiscoverTab","dismissOrganization","_dismissOrganizationCallback","_successDismissOrg"),d)this._isIntegrated=d;else{switch(e){case"Login":this._Mode=t,this._renderLoginPageContent();break;case"Manage":this._Mode=i,this._isProxyContext=u,this._isCentralCardEnabled=g,this._isCentralLinked=m,this._isAdminLoginFromHyperspace=$,this._isPICELDisabled=C,this._hideSSNWhenTyping=_,this._subjectName=h,this._removeHyperlink=p,this._renderStaticManagePageContent();break;case"Allergies":this._Mode=n;break;case"HealthIssues":this._Mode=r;break;case"Medications":this._Mode=o;break;case"PastVisits":this._Mode=a;break;case"TestResults":this._Mode=s;break;case"UpdateOrg":this._Mode=l;break;case"HealthSummary":this._Mode=c}if(this._isAdminLoginFromHyperspace)return $afe.select("div#loading").hide(),void $afe.select("div#community_container").show();this._Mode!==t&&(this._getOrganizationList(),this._linkedFhirOrgId=decodeURIComponent($$WPUtil.queryString("linkedFhirOrgId")),this._userClickedOrgId=this._linkedFhirOrgId),this._Mode!==t&&this._Mode!==i||((k=$afe.select("#community_container")).on("click","input.org-link",this.clickLink),k.on("click","a.childorg-link",this.clickChildOrgs),k.on("click","input.org-unlink",this.clickUnlink),k.on("click","input.fhir-unlink",this.clickUnlinkFHIR),k.on("click","input.fhir-update",this.clickUpdateFHIR),k.on("click",".toggleReminder",this.clickRemindUpdateFHIR),k.on("click",".org-signup.button",this.clickSignup),k.on("click",".org-auth.button",this.clickAuth),k.on("click",".org-jump.button",this.clickJump),k.on("click",".central-signup.button",this.clickCentralSignup),k.on("click","#consent_button",this.giveConsent),k.on("click","#show_consent",this.clickConsentLink),k.on("click","#continueButton",this.clickLoginBottomButtons),k.on("click","#goToManageButton",this.clickLoginBottomButtons),k.on("input","#orgSearch",this.organizationSearchOnInput),k.on("click",".connectFHIR",this.clickLinkFHIR),k.on("click",".connectKnownEpic",this.clickConnectEpic),k.on("click",".connectUnknownEpic",this.clickConnectEpic),k.on("click","#clear-search-button",this.clearCurrentSearch),k.on("click","#BackToTopLink",this.goToTop),k.on("click","#toLinked",this.toLinkedTab),k.on("click","#toDiscover",this.toDiscoverTab),k.on("touchend","#orgSearch",this.scrollToSearchForMobile),k.on("touchstart",this.unFocusSearchInput),k.on("click",".dismiss",this.dismissOrganization)),this._Mode!==t&&this._Mode!==i&&this._Mode!==l&&((k=$afe.select(".RefreshBannerSection")).on("click",".RefreshBannerButton",this._getCurrentLoadingOrgList),k.on("click",".LoadingBannerButton",this.hideLoadingBanner)),this._useMobileJumpURL=y}},Y={_Mode:0,_popupComponent:null,_userClickedOrgId:"",_userClickedOrgName:"",_linkedFhirOrgId:null,_userClickedAction:0,_orgListObj:null,_autoQueryListObj:null,_inProgressListObj:null,_spotlightOrganizations:null,_callback:null,_isIntegrated:!1,_isConsentNeeded:!1,_searchQueryMostRecentRequest:0,_searchQueryLastDisplayedRequest:0,_searchQuery:"",_mostRecentSearchResults:null,_isFhirUpdatePopupShowing:!1,_isTokenExchangePopupShowing:!1,_wasFhirUpdatePopupClosed:!1,_fhirUpdateComplete:!1,_ceOptOut:!1,_isProxyContext:!1,_isCentralCardEnabled:!1,_isCentralLinked:!1,_hideSSNWhenTyping:!1,_isAdminLoginFromHyperspace:!1,_subjectName:"",_userCanSearch:!1,_fhirUpdateFrequency:"",_fhirSessionThrottlingTime:"",_closeFHIRUpdateHandlerAdded:!1,_isSelfVerified:!0,_useMobileJumpURL:!1,_forwardedLinks:{},_homeOrgName:"",clickChildOrgs:function WP$Community$CommunityController$clickChildOrgs(e){var t;if(e){var i=$afe.jq(e.currentTarget);t=i.data("orgid"),this._userClickedOrgId=i.data("parentorgid"),this._userClickedOrgName=i.data("orgname"),this.getChildrenOrganizationList(t)}},organizationSearchOnInput:function WP$Community$CommunityController$organizationSearchOnInput(e){var t,i=e.target.value;this._searchQuery!==i&&(t="1"===$$WPUtil.queryString("showDXROrgInMO"),this._searchQueryMostRecentRequest++,this._searchQuery=i,i.length>0?($afe.select(".organizationSearchIcon").addClass("loading"),$afe.select(".organizationSearchIcon").removeClass("close"),$.ajax({url:makeLink("Community/Shared/SearchOrganizations"),type:"POST",cache:!1,data:{query:i,showDXROrgInMO:t},dataType:"json",error:this._organizationSearchSuccessOrError.bind(this,this._searchQueryMostRecentRequest,{error:!0}),success:this._organizationSearchSuccessOrError.bind(this,this._searchQueryMostRecentRequest)})):this._organizationSearchSuccessOrError(this._searchQueryMostRecentRequest,null))},_organizationSearchSuccessOrError:function WP$Community$CommunityController$_organizationSearchSuccessOrError(e,t){this._mostRecentSearchResults=t,e<this._searchQueryLastDisplayedRequest||(this._searchQueryLastDisplayedRequest=e,e===this._searchQueryMostRecentRequest&&($afe.select(".organizationSearchIcon").removeClass("loading"),this._searchQuery?$afe.select(".organizationSearchIcon").addClass("close"):$afe.select(".organizationSearchIcon").removeClass("close"),$afe.select("#searchResultsPoliteRegion").empty(),t&&$afe.select("#searchResultsPoliteRegion").safeAppend($afe.renderTemplate($$WP.Templates.Community.OrganizationSearchResultsPoliteRegion,t))),this._displayAndHighlightSearchResults())},_displayAndHighlightSearchResults:function WP$Community$CommunityController$_displayAndHighlightSearchResults(){var e,t,i,n=this._searchQuery,r=this._mostRecentSearchResults;if(r){if(!r.error)for(i=0;i<r.Results.length;i++)(e=r.Results[i]).EpicStatus?(e.Type=q,e.ShowCEOptOutErrorMsg=this._ceOptOut):e.Type=B,this._orgListObj[e.OrganizationId]&&(t=this._orgListObj[e.OrganizationId],this._orgListObj[e.OrganizationId].Accept?(e.Type=j,e.ShowCEOptOutErrorMsg=!1,e.ShouldDisableLink=t.ShouldDisableLink):this._orgListObj[e.OrganizationId].LinkType!==d||t.CanCreateCELink||(e.Type=this._isExternalLink(t)?q:H,e.HasChildOrgs=t.HasChildOrgs,e.CELocationId=e.ChildId,e.LinkType=t.LinkType,e.LastEncounterDetail=t.LastEncounterDetail,e.IsDisabled=t.IsDisabled,e.TermsAndConditionsUrl=t.TermsAndConditionsUrl,e.ProxyTermsAndConditionsUrl=t.ProxyTermsAndConditionsUrl,e.FromSearch=!0,e.ShowCEOptOutErrorMsg=!1,e.ShouldDisableLink=t.ShouldDisableLink,e.IsInvalidCeLink=t.IsInvalidCeLink,e.InvalidLinkReason=t.InvalidLinkReason,e.InvalidLinkRetryDate=t.InvalidLinkRetryDate,e.LinkErrorCode=t.LinkErrorCode,t.RelatedOrganizations&&t.RelatedOrganizations.ChildrenOrganaizationList&&(e.RelatedOrganizations={},e.RelatedOrganizations.ChildrenOrganaizationList=[{OrganizationName:t.OrganizationName,LogoUrl:t.LogoUrl}].concat(t.RelatedOrganizations.ChildrenOrganaizationList),e.RelatedOrganizations.ChildrenOrganaizationList=e.RelatedOrganizations.ChildrenOrganaizationList.filter(this._hasDifferentName.bind(this,e))))),e.uniqueId=this._getUniqueNumber();$afe.select("#searchResultsNormalRegion").empty(),$afe.select("#searchResultsNormalRegion").safeAppend($afe.renderTemplate($$WP.Templates.Community.OrganizationSearchResults,r)),$afe.select("#spotlight").hide(),this._highlightSearchResults(n)}else $afe.select("#spotlight").show(),$afe.select("#searchResultsPoliteRegion").empty(),$afe.select("#searchResultsNormalRegion").empty()},_hasDifferentName:function WP$Community$CommunityController$_hasDifferentName(e,t){return e.OrganizationName!==t.OrganizationName},_highlightSearchResults:function WP$Community$CommunityController$_highlightSearchResults(e){var t=this._removeDiacritics,i=t(e).toLowerCase().split(/\W+/g).filter((function(e){return e.length}));$afe.select("#searchResults .organizationName, #searchResults .popupOrganizationChildName, #searchResults .popupOrganizationLocation").each((function(e,n){var r,o,a,s,l,c=n.innerText,d=t(c).toLowerCase(),u=[];for(r=0;r<i.length;r++)for(o=i[r],a=d.indexOf(o);-1!==a;)u.push({start:a,end:a+o.length}),a=d.indexOf(o,a+1);for(u.sort((function(e,t){return e.start-t.start})),r=0;r<u.length-1;)u[r+1].start<=u[r].end?(u[r].end=Math.max(u[r].end,u[r+1].end),u.splice(r+1,1)):r++;if(u.length>0)for(n.innerHTML="",n.appendChild(document.createTextNode(c.substring(0,u[0].start))),r=0;r<u.length;r++)(s=document.createElement("mark")).innerText=c.substring(u[r].start,u[r].end),n.appendChild(s),l=r<u.length-1?u[r+1].start:c.length,n.appendChild(document.createTextNode(c.substring(u[r].end,l)))}))},_removeDiacritics:function WP$Community$CommunityController$_removeDiacritics(e){return"function"==typeof e.normalize?e.normalize("NFD").replace(/[\u0300-\u036f]/g,""):e},clickLink:function WP$Community$CommunityController$clickLink(e){var t=$afe.jq(e.target).data("id"),i=$afe.jq(e.target).data("payvider");""!=t?this.CreateLinkToOrganizationWithPopup(t,i):$$WP.Debug.logError("no organization ID found")},CreateLinkToOrganizationWithPopup:function(e,t){var i=this._orgListObj[e];if(this._userClickedOrgId=e,this._userClickedOrgName=i.OrganizationName,i.PayerOrgDetails&&i.PayerOrgDetails.IsPayvider&&i.PayerOrgDetails.PayerCvgName){var n,r;t?($$WP.Strings.addMnemonic("@MYCHART@ORGANIZATIONNAME@",i.PayerOrgDetails.PayerCvgName,"","Community.OrganizationList"),$$WP.Strings.addMnemonic("@MYCHART@OTHERORGANIZATIONNAME@",i.OrganizationName,"","Community.OrganizationList")):($$WP.Strings.addMnemonic("@MYCHART@ORGANIZATIONNAME@",i.OrganizationName,"","Community.OrganizationList"),$$WP.Strings.addMnemonic("@MYCHART@OTHERORGANIZATIONNAME@",i.PayerOrgDetails.PayerCvgName,"","Community.OrganizationList")),n=$$WP.Strings.get("ConfirmLinkPayvider","Community.OrganizationList"),r=$$WP.Strings.get("ConfirmLinkPayviderHeader","Community.OrganizationList"),$$WP.Strings.removeMnemonic("@MYCHART@ORGANIZATIONNAME@","Community.OrganizationList"),$$WP.Strings.removeMnemonic("@MYCHART@OTHERORGANIZATIONNAME@","Community.OrganizationList");var o=[new $$WPComp.ComplexObjects.Button($$WP.Strings.get("LinkAccount","Community.OrganizationList"),null,"completeworkflow","ok"),new $$WPComp.ComplexObjects.Button($$WP.Strings.get("PopupGoBackButton","Community.OrganizationList"),null,"continue secondary","cancel")];$$WPUtil.quickMessageBox(n,r,o,this._clickLinkCallback,[e,t,i],null,!1)}else this._isExternalLink(i)?this.popupConnectEpic(e,this._userClickedOrgName):this.CreateLinkToOrganization(e,"","","",t)},_clickLinkCallback:function _clickLinkCallback(e,t,i,n){"toolbarok"===n&&(this._isExternalLink(i)?this.popupConnectEpic(e,this._userClickedOrgName):this.CreateLinkToOrganization(e,"","","",t))},CreateLinkToOrganization:function(e,t,i,n,r){this._callback={Success:t,Failure:i,NotMyAccount:n},this._userClickedOrgId=e,this._userClickedAction=m,this._displayLoadingPopup($$WP.Strings.get("ConnectingMessage","Community.Shared")),$.ajax({url:makeLink("Community/Shared/AcceptOrganizationConsent"),type:"POST",cache:!1,data:{organizationId:e,controllerType:this._Mode,isIntegrated:this._isIntegrated,isPayvider:r},dataType:"json",error:this._errorCreateLink,success:this._loadConfirm})},_errorCreateLink:function Epic$PatientAccess$Controllers$CommunityController$_errorCreateLink(e){var t;if(null!==this._orgListObj?t=this._orgListObj[this._userClickedOrgId].OrganizationName:null!==e&&null!==e.OrgLink&&void 0!==e.OrgLink&&(t=e.OrgLink.OrganizationName),e.IsRemoteAuthNeeded)this.RedirectToLinkMyAccountsHelper(!0);else{var i=this._getErrorTextFromResponse(e,$$WP.Strings.get("ErrorOccurredText","Community.Manage"),t),n=$$WP.Strings.get("LinkAccountErrorTitle","Community.Manage");this._displayError(i,n)}},_loadConfirm:function Epic$PatientAccess$Controllers$CommunityController$_loadConfirm(e){var t;e.Success?(void 0!==e.OrgLink&&null!==e.OrgLink&&(this._isIntegrated||(this._orgListObj[this._userClickedOrgId]=e.OrgLink,this._orgListObj[this._userClickedOrgId].IsLast=this._userClickedOrgId===this.getLastOrganizationId())),void 0!==e.Data&&null!==e.Data?(t={Questions:e.Data.ValidationData.Questions,Organization:e.Data.Organization,PayerOrgDetails:e.OrgLink.PayerOrgDetails,IsPayvider:e.IsPayvider},$afe.select(".loadingStatus").text($$WP.Strings.get("ConnectingMessage","Community.Shared")),$afe.select("#externalLoadingIndicator").removeClass("hidden"),$afe.jq(window).trigger("popupResize"),$afe.select(".loadingExt ").addClass("CEbigloading"),$afe.select(".loadingContainer").addClass("loaded"),$afe.select(".loadingExt").removeClass("loading").addClass("loaded").on("transitionend transitionEnd",$.proxy(this.showChallengeQuestionContent,this,t))):this._completeUpdate({Success:!0,OrgLink:e.OrgLink,LinkReferral:e.LinkReferral})):this._errorCreateLink(e)},showChallengeQuestionContent:function Epic$PatientAccess$Controllers$CommunityController$_showChallengeQuestionContent(e){var t;$afe.select("#externalLoadingIndicator").addClass("hidden"),this.disposePopup(!1),t=new $$WP.Community.Components.CommunityPopupComponent({IsClosable:!0,SupressTitle:!1,TitleText:$$WP.Strings.get("ChallengeQuestionPopupTitle","Community.Shared")}),this._popupComponent=t,$$WPUtil.quickPopup(t,{Size:$$WPContain.Popup.SizeEnum.MEDIUM,Class:"contentpopup",positioningFunction:$$WPContain.Positions.InsideCentered,HasBackButton:!1}),this._popupComponent.setData(e),$afe.select("#verifyAnswer").on("click",this.clickVerifyAnswer),$afe.select("#notMe").on("click",this.clickNotMe),$afe.select("#cancelVerify").on("click",this.clickCancel),$afe.select("#ChallengeQuestion").on("change",this.maskOrUnmaskAnswerField),this.maskOrUnmaskAnswerField(),$afe.select("#AnswerField"),$afe.select("#challengeQuestions").removeClass("hidden"),$$WP.FormValidation.checkIfFormIsValid($afe.select("#challengeQuestionsForm"),!0),this._popupComponent.ContainerComponent.setFocus(),this._popupComponent.$container.trigger("resize")},clickVerifyAnswer:function WP$Community$CommunityController$clickVerifyAnswer(e){var t,i,n;e&&(t=$afe.select("#OrgIdHiddenSpan").safeAttr("value"),i=$afe.select("#ChallengeQuestion").val(),n=$afe.select("#AnswerField").val(),$$WPUtil.ShowAjaxSpinner($afe.select("#communityPopupLoading").find(".ajaxspinner")),$.ajax({url:makeLink("Community/Shared/ConfirmOrganizationLink"),type:"POST",cache:!1,data:{organizationId:t,identifier:i,answer:n,controllerType:this._Mode},dataType:"json",error:this._errorVerifyAccount,success:this._successVerifyAccount}),e.preventDefault())},_errorVerifyAccount:function Epic$PatientAccess$Controllers$CommunityController$_errorVerifyAccount(e){var t=this._orgListObj[this._userClickedOrgId].OrganizationName,i=this._getErrorTextFromResponse(e,$$WP.Strings.get("ValidationGenericErrorText","Community.Manage"),t),n=$$WP.Strings.get("LinkAccountErrorTitle","Community.Manage");this._displayErrorPopup(i,n)},_successVerifyAccount:function Epic$PatientAccess$Controllers$CommunityController$_successVerifyAccount(e){var t;if($$WPUtil.HideAjaxSpinner($afe.select("#communityPopupLoading .ajaxspinner")),e.Success)if(this._isIntegrated||(this._orgListObj[this._userClickedOrgId]=e.OrgLink,this._orgListObj[this._userClickedOrgId].IsLast=this._userClickedOrgId===this.getLastOrganizationId()),e.Disabled)this._isIntegrated?this._errorVerifyAccount(e):($afe.select("#alertSpan").removeClass("hidden"),$afe.select("#alertSpan").focus(),$afe.select(".messagedisplay").addClass("hidden"),$afe.select("#ChallengeQuestion").safeAttr("disabled",!0).safeAttr("aria-disabled",!0),$afe.select("#AnswerField").safeAttr("disabled",!0).safeAttr("aria-disabled",!0),$afe.select("#verifyAnswer").safeAttr("disabled",!0).safeAttr("aria-disabled",!0),(t=this._orgListObj[this._userClickedOrgId]).IsDisabled=!0,this._renderSingleCEOrgBottom(t),$$WP.FormValidation.checkIfFormIsValid($afe.select("#challengeQuestionsForm"),!0));else if(e.IsAnswerFormatInvalid){if($afe.select("#ChallengeQuestion").val()===T)$$WP.FormValidation.addValidationError($afe.select("#AnswerField"),"Last4NationalIDInvalidLengthErrorMessage")}else e.AnswerIsCorrect?(this.disposePopup(!1),this._displayLoadingPopup($$WP.Strings.get("ConnectingMessage","Community.Shared")),this._completeUpdate({Success:!0,OrgLink:e.OrgLink,LinkReferral:e.LinkReferral})):$$WP.FormValidation.addValidationError($afe.select("#AnswerField"),void 0,$$WP.Strings.get("IncorrectAnswer","Community.Shared"));else this._errorVerifyAccount(e)},clickNotMe:function WP$Community$CommunityController$clickNotMe(e){var t;e&&(this._userClickedAction=p,t=$afe.select("#OrgIdHiddenSpan").safeAttr("value"),this.disposePopup(!1),this._displayLoadingPopup($$WP.Strings.get("NotMyAccount","Community.Shared")),$$WPUtil.ShowAjaxSpinner($afe.select("#communityPopupLoading").find(".ajaxspinner")),$.ajax({url:makeLink("Community/Shared/InvalidateOrganizationLink"),type:"POST",cache:!1,data:{organizationId:t},dataType:"json",error:this._errorClickNotMe,success:this._completeUpdate}))},_errorClickNotMe:function WP$Community$CommunityController$_errorClickNotMe(e){var t=this._orgListObj[this._userClickedOrgId].OrganizationName,i=this._getErrorTextFromResponse(e,$$WP.Strings.get("ErrorOccurredText","Community.Manage"),t),n=$$WP.Strings.get("DismissAccountErrorTitle","Community.Manage");this._displayErrorPopup(i,n)},clickCancel:function WP$Community$CommunityController$clickCancel(e){e&&(this._callback=null,this.disposePopup(!1))},clickUnlink:function WP$Community$CommunityController$clickUnlink(e){var t=$afe.jq(e.target).data("id");if(""!=t){var i=$afe.jq(e.target).data("payer"),n=this._orgListObj[t];if(1==n.IdentityRelationship||2==n.IdentityRelationship){$$WP.Strings.addMnemonic("@MYCHART@ORGANIZATIONNAME@",n.OrganizationName,"","Community.OrganizationList"),o=n.IsMyChartCentral?$$WP.Strings.get("ConfirmUnlinkCentralIdP","Community.OrganizationList"):$$WP.Strings.get("ConfirmUnlinkOnCentralIdP","Community.OrganizationList"),a=$$WP.Strings.get("ConfirmUnlinkCentralIdPHeader","Community.OrganizationList"),$$WP.Strings.removeMnemonic("@MYCHART@ORGANIZATIONNAME@","Community.OrganizationList");var r=[new $$WPComp.ComplexObjects.Button($$WP.Strings.get("PopupGoBackButton","Community.OrganizationList"),null,"continue secondary","cancel"),new $$WPComp.ComplexObjects.Button($$WP.Strings.get("UnlinkAccount","Community.OrganizationList"),null,"inlinedelete","ok")];$$WPUtil.quickMessageBox(o,a,r,this._clickUnlinkCallback,[t],null,!1)}else if(n.PayerOrgDetails&&n.PayerOrgDetails.IsPayvider&&n.PayerOrgDetails.PayerCvgName){var o,a;i?($$WP.Strings.addMnemonic("@MYCHART@ORGANIZATIONNAME@",n.PayerOrgDetails.PayerCvgName,"","Community.OrganizationList"),$$WP.Strings.addMnemonic("@MYCHART@OTHERORGANIZATIONNAME@",n.OrganizationName,"","Community.OrganizationList")):($$WP.Strings.addMnemonic("@MYCHART@ORGANIZATIONNAME@",n.OrganizationName,"","Community.OrganizationList"),$$WP.Strings.addMnemonic("@MYCHART@OTHERORGANIZATIONNAME@",n.PayerOrgDetails.PayerCvgName,"","Community.OrganizationList")),o=$$WP.Strings.get("ConfirmUnlinkPayvider","Community.OrganizationList"),a=$$WP.Strings.get("ConfirmUnlinkPayviderHeader","Community.OrganizationList"),$$WP.Strings.removeMnemonic("@MYCHART@ORGANIZATIONNAME@","Community.OrganizationList"),$$WP.Strings.removeMnemonic("@MYCHART@OTHERORGANIZATIONNAME@","Community.OrganizationList");r=[new $$WPComp.ComplexObjects.Button($$WP.Strings.get("UnlinkAccount","Community.OrganizationList"),null,"inlinedelete","ok"),new $$WPComp.ComplexObjects.Button($$WP.Strings.get("PopupGoBackButton","Community.OrganizationList"),null,"continue secondary","cancel")];$$WPUtil.quickMessageBox(o,a,r,this._clickUnlinkCallback,[t],null,!1)}else this._clickUnlinkCallback(t,"toolbarok")}else $$WP.Debug.logError("no organization ID found")},_clickUnlinkCallback:function _clickUnlinkCallback(e,t){"toolbarok"===t&&(this._userClickedOrgId=e,this._userClickedAction=h,this._displayLoadingPopup($$WP.Strings.get("UnlinkingMessage","Community.Shared")),$.ajax({url:makeLink("Community/Shared/DeclineOrganizationConsent"),type:"POST",cache:!1,data:{organizationId:e},dataType:"json",error:this._errorClickUnlink,success:this._completeUnlink}))},_errorClickUnlink:function WP$Community$CommunityController$_errorClickUnlink(e){var t=this._getErrorTextFromResponse(e,$$WP.Strings.get("ErrorOccurredText","Community.Manage")),i=$$WP.Strings.get("UnlinkAccountErrorTitle","Community.Manage");this._displayErrorPopup(t,i)},_manualTokenExchangeSucceed:function manualTokenExchangeSucceed(e){null!=e&&e.Success?(this._createTokenExchangePopup(),this._wasFhirUpdatePopupClosed=!1,this._getRefreshStatus(!0)):this._errorUpdateFhir(e)},_errorUpdateFhir:function WP$Community$CommunityController$_errorUpdateFhir(e){var t=this._getErrorTextFromResponse(e,$$WP.Strings.get("ErrorOccurredText","Community.Manage")),i=$$WP.Strings.get("UpdateAccountErrorTitle","Community.Manage");this._displayErrorPopup(t,i)},clickUpdateFHIR:function clickUpdateFHIR(e){var n,r,o,a;if(e&&e.target){if(n=$afe.jq(e.target).data("id"),r={Organization:this._orgListObj[n],IsUpdate:!0},this._userClickedAction=_,this._userClickedOrgId=n,r.Organization.HasValidRefreshToken)return this._linkedFhirOrgId=n,$.ajax({url:makeLink("Community/UpdateData/ManualWithRefreshToken"),type:"POST",cache:!1,data:{organizationId:n},dataType:"json",error:this._errorUpdateFhir,success:this._manualTokenExchangeSucceed}),r.Organization.CurrentlyLoadingDxrData=!0,void this._renderLinkedOrganizations();if(this._Mode!==t&&this._Mode!==i)return void this.clickConfirmUpdateFHIR(e);o={SupressTitle:!1,IsClosable:!0,TitleText:$$WP.Strings.get("UpdateFHIRAccountTitle","Community.Shared")},a=new $$WP.Community.Components.CommunityPopupComponent(o),this._popupComponent=a,$$WPUtil.quickPopup(a,{Size:$$WPContain.Popup.SizeEnum.MEDIUM,Class:"contentpopup noOverflow",positioningFunction:$$WPContain.Positions.InsideCentered,HasBackButton:!1}),this._popupComponent.setData(r),$afe.select("#oAuthDescription").removeClass("hidden"),$afe.select("#connectFHIR").on("click",this.clickConfirmUpdateFHIR),$afe.select("#cancelFHIR").on("click",this.clickCancel),this._popupComponent.$container.trigger("resize"),a.ContainerComponent.setFocus()}},clickConfirmUpdateFHIR:function clickConfirmUpdateFHIR(e){var t;e&&e.target&&(this.disposePopup(!1),t=this._orgListObj[this._userClickedOrgId].OrganizationId,this.connectFHIR(t,!0))},clickLinkFHIR:function clickLinkFHIR(e){var t;e&&e.target&&(t=e.target.dataset.id,this._userClickedAction=y,this._userClickedOrgName=e.target.dataset.orgname,this.connectFHIR(t,!1))},connectFHIR:function connectFHIR(e,t){var i,n=this;this._displayLoadingPopup($$WP.Strings.get("ConnectingMessage","Community.Shared")),i=!$$WP.Utilities.UI.IsMobile||"1"===$$WPUtil.queryString("showDXROrgInMO"),getCSRFTokenAsQS((function(){$.ajax({url:makeLink("Community/Shared/AcceptFHIRConsent"),type:"POST",cache:!1,data:{encryptedOrgId:e,controllerType:n._Mode,showDXR:i,fromActivity:$$WPUtil.queryString("from"),isUpdate:t},dataType:"json",error:n._errorAcceptFhirConsent,success:n._successGetFhirRedirectUrl})}))},_errorAcceptFhirConsent:function Epic$PatientAccess$Controllers$CommunityController$_errorAcceptFhirConsent(e){var t=this._userClickedOrgName,i=this._getErrorTextFromResponse(e,$$WP.Strings.get("ErrorOccurredText","Community.Manage"),t),n=this._getFhirErrorTitle(this._userClickedAction);this._displayError(i,n),this._userClickedOrgName=""},_successGetFhirRedirectUrl:function Epic$PatientAccess$Controllers$CommunityController$_successGetFhirRedirectUrl(e){e.Success?window.top.location=e.RedirectURL:this._errorAcceptFhirConsent(e)},clickUnlinkFHIR:function WP$Community$CommunityController$clickUnlinkFHIR(e){var t,i,n,r;e&&(n=$afe.jq(e.target).data("id"),this._userClickedOrgId=n,this._userClickedAction=k,(t={}).SupressTitle=!1,t.IsClosable=!0,t.TitleText=$$WP.Strings.get("UnlinkFHIRAccountTitle","Community.Shared"),i=new $$WP.Community.Components.CommunityPopupComponent(t),this._popupComponent=i,$$WPUtil.quickPopup(i,{Size:$$WPContain.Popup.SizeEnum.MEDIUM,Class:"contentpopup noOverflow",positioningFunction:$$WPContain.Positions.InsideCentered,HasBackButton:!1}),r={Organization:this._orgListObj[n]},this._popupComponent.setData(r),$afe.select("#oAuthUnLink").removeClass("hidden"),$afe.select("#unlinkFHIR").on("click",this.clickConfirmUnlinkFHIR),$afe.select("#cancelFHIRAgain").on("click",this.clickCancel),this._popupComponent.$container.trigger("resize"),i.ContainerComponent.setFocus())},clickConfirmUnlinkFHIR:function WP$Community$CommunityController$clickConfirmUnlinkFHIR(e){e&&(null!==this._popupComponent&&($afe.select("#oAuthUnLink").addClass("hidden"),$afe.select(".loadingStatus").text($$WP.Strings.get("UnlinkingMessage","Community.Shared")),$afe.select(".loadingExt ").addClass("CEbigloading"),$afe.select("#externalLoadingIndicator").removeClass("hidden")),$$WP.CommunityUtilities.clearCommunityLinksSessionStatus(),$.ajax({url:makeLink("Community/Shared/DeclineOrganizationConsent"),type:"POST",cache:!1,data:{organizationId:this._userClickedOrgId},dataType:"json",error:this._errorClickUnlink,success:this._completeUnlink}))},clickRemindUpdateFHIR:function clickRemindUpdateFHIR(e){e&&(orgId=$afe.jq(e.target).data("id"),isChecked=e.target.checked,$.ajax({url:makeLink("Community/Shared/ToggleRemindMeToUpdate"),type:"POST",cache:!1,data:{organizationId:orgId,remindToUpdate:isChecked},dataType:"json",success:this._successReminderToggled,error:$.proxy((function clickRemindUpdateFhir$ajaxError(){this._displayErrorAndRollbackCheck(orgId)}),this)}))},_successReminderToggled:function WP$Community$CommunityController$_successReminderToggled(e){if(e.Success){var t=$afe.select(".FhirOrgPopup").length>0,i=$afe.select("#btnRemindUpdate_"+e.OrgId),n=$afe.select("#reminderFeedback_"+e.OrgId);n.empty(),n.css("display","inline-block"),n.append("<img src='"+makeStaticLink("images/circle_check_icon.svg")+'\' class="infoIcon" alt="">'),i.is(":checked")?n.append($$WP.Strings.get("EnableReminderSuccess","Community.OrganizationList")):n.append($$WP.Strings.get("DisableReminderSuccess","Community.OrganizationList")),t&&(this._closeFHIRUpdateHandlerAdded=!0)}else this._displayErrorAndRollbackCheck(e.OrgId)},_displayErrorAndRollbackCheck:function _displayErrorAndRollbackCheck(e){var t=$afe.select("#btnRemindUpdate_"+e),i=!t.is(":checked");t.prop("checked",i);var n=$$WP.Strings.get("ErrorOccurredText","Community.Manage"),r=this._getReminderErrorTitle(!i);this._displayErrorPopup(n,r)},_getReminderErrorTitle:function WP$Community$CommunityController$_getReminderErrorTitle(e){return e?$$WP.Strings.get("ReminderOnErrorTitle","Community.Manage"):$$WP.Strings.get("ReminderOffErrorTitle","Community.Manage")},dismissOrganization:function WP$Community$CommunityController$dismissOrganization(e){var t,i,n=$afe.jq(e.target).data("id"),r=$afe.jq(e.target).data("payer"),o=this._orgListObj[n];r&&o.PayerOrgDetails&&o.PayerOrgDetails.PayerCvgName?$$WP.Strings.addMnemonic("@MYCHART@ORGANIZATIONNAME@",o.PayerOrgDetails.PayerCvgName,"","Community.OrganizationList"):$$WP.Strings.addMnemonic("@MYCHART@ORGANIZATIONNAME@",o.OrganizationName,"","Community.OrganizationList"),o.PayerOrgDetails&&o.PayerOrgDetails.IsPayvider?(r?$$WP.Strings.addMnemonic("@MYCHART@OTHERORGANIZATIONNAME@",o.OrganizationName,"","Community.OrganizationList"):$$WP.Strings.addMnemonic("@MYCHART@OTHERORGANIZATIONNAME@",o.PayerOrgDetails.PayerCvgName,"","Community.OrganizationList"),t=$$WP.Strings.get("ConfirmDismissPayviderOrg","Community.OrganizationList"),i=$$WP.Strings.get("ConfirmDismissPayviderHeader","Community.OrganizationList")):(t=$$WP.Strings.get("ConfirmDismissOrg","Community.OrganizationList"),i=$$WP.Strings.get("ConfirmDismissHeader","Community.OrganizationList")),$$WP.Strings.removeMnemonic("@MYCHART@ORGANIZATIONNAME@","Community.OrganizationList");var a=[new $$WPComp.ComplexObjects.Button($$WP.Strings.get("ConfirmDismissButton","Community.OrganizationList"),null,"continue","ok"),new $$WPComp.ComplexObjects.Button($$WP.Strings.get("PopupGoBackButton","Community.OrganizationList"),null,"continue secondary","cancel")];i=HTMLUnencode(i),$$WPUtil.quickMessageBox(t,i,a,this._dismissOrganizationCallback,[n],null,!1)},_dismissOrganizationCallback:function WP$Community$CommunityController$dismissOrganizationCallback(e,t){"toolbarok"===t&&$.ajax({url:makeLink("Community/Shared/DismissOrganization"),type:"POST",cache:!1,data:{encryptedOrgId:e},dataType:"json",error:this._errorDismissOrg,success:this._successDismissOrg})},_errorDismissOrg:function WP$Community$CommunityController$_errorDismissOrg(e){var t=this._getErrorTextFromResponse(e,$$WP.Strings.get("ErrorOccurredText","Community.Manage")),i=$$WP.Strings.get("DismissAccountErrorTitle","Community.Manage");this._displayErrorPopup(t,i)},_successDismissOrg:function WP$Community$CommunityController$_successDismissOrg(e){!0===e.Success?(this._orgListObj[e.OrgID]=e.OrgLink,this.renderOrganizationList()):this._errorDismissOrg()},clickLoginBottomButtons:function WP$Community$CommunityController$clickUnlink(e){var t,i;e&&e.target&&(t="goToManageButton"===$afe.jq(e.target).safeAttr("id"),i=$afe.select("#dontShowAgain").prop("checked"),$.ajax({url:makeLink("Community/Login/FinishOrganizationLinking"),type:"POST",cache:!1,data:{askLater:!i,goToManagePage:t},dataType:"json",error:this._handleLoginAjaxResponse,success:this._handleLoginAjaxResponse}))},_handleLoginAjaxResponse:function WP$Community$CommunityController$_handleLoginAjaxResponse(e){var t;t=e&&e.redirectURL?e.redirectURL:$afe.select("span#redirectURL").data("url")?$afe.select("span#redirectURL").data("url"):makeLink("inside.asp"),$$WP.Utilities.UI.IsMobile&&(-1===t.indexOf("?")?t+="?nextstep=false":t+="&nextstep=false",e&&!e.goToManagePage&&(t+="&moworkflow=completeandclose")),$$WP.Utilities.TryRedirect(t)},clickSignup:function WP$Community$CommunityController$clickSignup(e){if(e){var t=$afe.jq(e.target).data("id"),i=$afe.jq(e.target).data("payvider"),n=this._orgListObj[t];if(n.PayerOrgDetails&&n.PayerOrgDetails.IsPayvider&&n.PayerOrgDetails.PayerCvgName){var r,o;i?($$WP.Strings.addMnemonic("@MYCHART@ORGANIZATIONNAME@",n.PayerOrgDetails.PayerCvgName,"","Community.OrganizationList"),$$WP.Strings.addMnemonic("@MYCHART@OTHERORGANIZATIONNAME@",n.OrganizationName,"","Community.OrganizationList")):($$WP.Strings.addMnemonic("@MYCHART@ORGANIZATIONNAME@",n.OrganizationName,"","Community.OrganizationList"),$$WP.Strings.addMnemonic("@MYCHART@OTHERORGANIZATIONNAME@",n.PayerOrgDetails.PayerCvgName,"","Community.OrganizationList")),r=$$WP.Strings.get("ConfirmActivatePayvider","Community.OrganizationList"),o=$$WP.Strings.get("ConfirmActivatePayviderHeader","Community.OrganizationList"),$$WP.Strings.removeMnemonic("@MYCHART@ORGANIZATIONNAME@","Community.OrganizationList"),$$WP.Strings.removeMnemonic("@MYCHART@OTHERORGANIZATIONNAME@","Community.OrganizationList");var a=[new $$WPComp.ComplexObjects.Button($$WP.Strings.get("ActivateAccountButton","Community.OrganizationList"),null,"completeworkflow","ok"),new $$WPComp.ComplexObjects.Button($$WP.Strings.get("PopupGoBackButton","Community.OrganizationList"),null,"continue secondary","cancel")];$$WPUtil.quickMessageBox(r,o,a,this._clickSignupCallback,[t,i],null,!1)}else this._clickSignupCallback(t,!1,"toolbarok")}},_clickSignupCallback:function _clickSignupCallback(e,t,i){if("toolbarok"===i){this._userClickedOrgId=e,this._userClickedAction=C;var n=this._orgListObj[e];n.IncompleteH2GSetup||$$WP.Utilities.UI.IsMobile&&"1"!==$$WPUtil.queryString("canLaunchLinkInBrowser")?$$WP.CommunityUtilities.ShowSignUpNotAllowedMessage(n):(this.addLinkedTabToQueryParams(),$$WP.CommunityUtilities.openDeepLink("",n,{isPayvider:t},$$WP.CommunityUtilities.openDeepLinkType.InNewTabNoDataTile,null,null,"",!0))}},clickAuth:function WP$Community$CommunityController$clickAuth(e){var t;if(e){t=$afe.jq(e.target).data("id"),this._userClickedOrgId=t,this._userClickedAction=f;var i="app/link-my-accounts/e-sign-document?dxoIdExt="+t;document.location.search.substring(1).split("&").forEach((function(e,t){"canLaunchLinkInBrowser=1"===e&&(i+="&canLaunchLinkInBrowser=1")})),$$WPUtil.TryRedirect(makeLink(i))}},clickCentralSignup:function WP$Community$CommunityController$clickSignup(e){$$WP.Utilities.TryRedirect(makeLink($$WP.Utilities.UI.IsMobile?"epichttp://app/welcome-wizard/signup-jump?backTo=lma":"app/welcome-wizard/signup-jump?backTo=lma"))},clickJump:function WP$Community$CommunityController$clickSignup(e){if(e){var t=$afe.jq(e.target).data("payvider"),i=$afe.jq(e.target).data("id");this._userClickedOrgId=i,this._userClickedAction=O;var n=this._orgListObj[i];n.IncompleteH2GSetup||1!=n.UserMyChartStatus||($$WP.Utilities.UI.IsMobile&&this._useMobileJumpURL?t?$$WP.Utilities.TryRedirect("epichttp://home?h2g_org_id="+i+"&isPayviderPayer=true"):$$WP.Utilities.TryRedirect("epichttp://home?h2g_org_id="+i):$$WP.CommunityUtilities.openDeepLink("",n,{isPayvider:t},$$WP.CommunityUtilities.openDeepLinkType.InNewTab))}},addLinkedTabToQueryParams:function(){var e;"linked"!==$$WPUtil.queryString("tab")&&void 0!==window.history&&void 0!==window.history.replaceState&&(-1!==(e=window.location.search).indexOf("?")?window.history.replaceState({},document.title,e+"&tab=linked"):window.history.replaceState({},document.title,e+"?tab=linked")),$$WPUtil.parseQueryString(window.location.search)},popupConnectEpic:function(e,t){if(""!=e&&""!=t){this._displayLoadingPopup($$WP.Strings.get("ConnectingMessage","Community.Shared"));var i=!$$WP.Utilities.UI.IsMobile||"1"===$$WPUtil.queryString("showDXROrgInMO");$.ajax({url:makeLink("Community/Shared/InitiateCELink"),type:"POST",cache:!1,data:{externalOrgID:e,showDXR:i,externalOrgName:t},dataType:"json",error:this._errorClickConnectEpic,success:this._successClickConnectEpic})}else{var n=$$WP.Strings.get("ErrorOccurredText","Community.Manage"),r=$$WP.Strings.get("LinkAccountErrorTitle","Community.Manage");this._displayErrorPopup(n,r)}},clickConnectEpic:function WP$Community$CommunityController$clickConnectEpic(e){var t,i=!$$WP.Utilities.UI.IsMobile||"1"===$$WPUtil.queryString("showDXROrgInMO");if(e&&e.currentTarget&&e.currentTarget.dataset)if(e.currentTarget.dataset.id&&""!==e.currentTarget.dataset.id)""===(t=e.currentTarget.dataset.child)&&(t=e.currentTarget.dataset.id),this._userClickedOrgName=e.currentTarget.dataset.orgname,this._displayLoadingPopup($$WP.Strings.get("ConnectingMessage","Community.Shared")),$.ajax({url:makeLink("Community/Shared/InitiateCELink"),type:"POST",cache:!1,data:{externalOrgID:t,showDXR:i,externalOrgName:this._userClickedOrgName},dataType:"json",error:this._errorClickConnectEpic,success:this._successClickConnectEpic});else{n=$$WP.Strings.get("ErrorOccurredText","Community.Manage"),r=$$WP.Strings.get("LinkAccountErrorTitle","Community.Manage");this._displayErrorPopup(n,r)}else{var n=$$WP.Strings.get("ErrorOccurredText","Community.Manage"),r=$$WP.Strings.get("LinkAccountErrorTitle","Community.Manage");this._displayErrorPopup(n,r)}},_errorClickConnectEpic:function Epic$PatientAccess$Controllers$CommunityController$_errorClickConnectEpic(e){$$WP.Strings.addMnemonic("@MYCHART@ORGANIZATIONNAME@",this._userClickedOrgName,!1,"Community.Manage");var t=$$WP.Strings.get("PicelJumpErrorText","Community.Manage"),i=this._getErrorTextFromResponse(e,t);$$WP.Strings.removeMnemonic("@MYCHART@ORGANIZATIONNAME@","Community.Manage");var n=$$WP.Strings.get("LinkAccountErrorTitle","Community.Manage");this._displayError(i,n),this._userClickedOrgName=""},_successClickConnectEpic:function Epic$PatientAccess$Controllers$CommunityController$_successClickConnectEpic(e){var t,i,n,r;!0===e.Success?(t=e.RedirectURL,i=e.Token,n=e.LocalHSI,hideCentral=e.HideCentralOnRemote,r=e.UseTwoFactorAuth?t:t+"home/logout?postloginmode=linkauth&token="+i+"&hsi="+n,hideCentral&&(r=r+"&hideCentral="+hideCentral),window.top.location=makeLink(r)):this._errorClickConnectEpic(e)},continueCELinking:function Epic$PatientAccess$Controllers$CommunityController$continueCELinking(){var e,t;if(e=$$WPUtil.queryString("token1"),t=$$WPUtil.queryString("token2"),""===e||""===t){this.removeQueryStringFromBrowser();var i=$$WP.Strings.get("PicelMissingTokenErrorText","Community.Manage"),n=$$WP.Strings.get("LinkAccountErrorTitle","Community.Manage");this._displayErrorPopup(i,n)}else e=decodeURIComponent(e),t=decodeURIComponent(t),this._displayLoadingPopup($$WP.Strings.get("ConnectingMessage","Community.Shared")),$.ajax({url:makeLink("Community/Manage/AutoLinkH2G"),type:"POST",cache:!1,data:{token1:e,token2:t},dataType:"json",error:this._errorContinueCELinking,success:this._successContinueCELinking})},_successContinueCELinking:function WP$Community$CommunityController$_successContinueCELinking(e){null!==e&&e.Success?(this.removeQueryStringFromBrowser(),this.showSuccessAndDisposePopup(),this._userClickedOrgId=e.OrgID,e.OrgLink.HasForwardedLinks=e.LinkReferral&&e.LinkReferral.ForwardedLinks.length>0,this._orgListObj[this._userClickedOrgId]=e.OrgLink,e.OrgLink.successLinked=!0,this.renderOrganizationList(),null!==e.LinkReferral&&this._addForwardedLinksForOrg(e.LinkReferral),$$WP.ProxySwitch.Controllers.ProxySelectorController.getProxySelectorController().retry(),e.NavigateToLinkedTabAfterPICEL&&showTabbedSection("tab_topic_linked")):this._errorContinueCELinking(e)},_errorContinueCELinking:function WP$Community$CommunityController$_errorContinueCELinking(e){this.removeQueryStringFromBrowser();var t=this._getErrorTextFromResponse(e,$$WP.Strings.get("ErrorOccurredText","Community.Manage"),e.ExternalOrgName),i=$$WP.Strings.get("LinkAccountErrorTitle","Community.Manage");this._displayError(t,i)},autoQuery:function WP$Community$CommunityController$autoQuery(e){var t;t=this,void 0!==e&&""!==e&&null!==e&&$.ajax({url:makeLink("Community/Shared/GetUpdatedCommunityLink"),type:"POST",cache:!1,data:{controllerType:t._Mode,organizationId:e},dataType:"json",error:t._errorAutoQuery.bind(this,e),success:t._successAutoQuery.bind(this,e)})},_errorAutoQuery:function WP$Community$CommunityController$_errorAutoQuery(e){$afe.select(".skeleton").first().remove(),delete this._autoQueryListObj[e]},_successAutoQuery:function WP$Community$CommunityController$_successAutoQuery(e,t){var i;t.Success?((i=t.OrgLink).uniqueId=this._getUniqueNumber(),i.StartExpanded=!0,i.CanCreateCELink||this._isExternalLink(i)?i.Type=q:i.Type=H,this._orgListObj[i.OrganizationId]=i,delete this._autoQueryListObj[i.OrganizationId],1===this._getKnownCEOrganizations().length?(this._renderInsuranceOrganizations(),this._renderCentralOrganization(),this._renderKnownOrganizations()):$afe.select(".skeleton").first().replaceWith($afe.renderTemplate($$WP.Templates.Community.DiscoverableOrganizationTop,i))):this._errorAutoQuery(e)},_successCallback:function(e){this._callback&&this._callback.Success&&this._callback.Success(e),this._callback=null},_failureCallback:function(){this._callback&&this._callback.Failure&&this._callback.Failure(),this._callback=null},_notMyAccountCallback:function(){this._callback&&this._callback.NotMyAccount&&this._callback.NotMyAccount(),this._callback=null},continueFHIRQueryString:function continueFHIRQueryString(){var e,t,i=this;t=$$WPUtil.queryString("action"),this._userClickedAction="1"===t?_:y,e="true"===$$WPUtil.queryString("fhirupdated"),this._linkedFhirOrgId&&!e&&("1"===$$WPUtil.queryString("isLiveFhir")?this._displayLoadingPopup($$WP.Strings.get("ConnectingMessage","Community.Shared"),$$WP.Strings.get("PopupTitle","Community.FHIRUpdate")):this._createTokenExchangePopup(),this.addNewQueryString("fhirupdated=true"),getCSRFTokenAsQS((function(){$.ajax({url:makeLink("Community/Shared/UpdateFHIROrganization"),type:"POST",cache:!1,data:{organizationId:i._linkedFhirOrgId},dataType:"json",error:i._forceStopFhirLoadStatus,success:i._successUpdateFHIRAccount})})),this._getRefreshStatus())},_getRefreshStatus:function WP$Community$CommunityController$_getRefreshStatus(){var e=this;getCSRFTokenAsQS((function(){$.ajax({url:makeLink("Loading/GetFhirLoadStatus"),type:"POST",cache:!1,data:{orgId:e._linkedFhirOrgId},dataType:"json",error:e._disposeFhirUpdatePopup,success:e._handleLoadStatus})}))},_handleLoadStatus:function WP$Community$CommunityController$_handleLoadStatus(e){var t,n,r,o,a,s="",c=!1;if(e&&e.OrgLink&&(a=e.OrgLink)&&(this._orgListObj[a.OrganizationId]=a,this._checkOrgGroupBelonging(a)&&0!==$afe.select(".orgsLinked>[data-id='"+a.OrganizationId+"']").length||!e.OrgLink.Accept||this._Mode!==i&&this._Mode!==l||this.renderOrganizationList()),!this._wasFhirUpdatePopupClosed){if(!e||!e.Success||!e.status)return e&&e.LinkErrorCode&&this._orgListObj[this._userClickedOrgId]&&(this._orgListObj[this._userClickedOrgId].LinkErrorCode=e.LinkErrorCode),void this._disposeFhirUpdatePopup(e.LinkErrorCode);if((t=e.status).IsDXROrg){if(t.PreLoadingSuccessful&&(t.LoadInProgress||t.IsFinished)){for(n in this._isFhirUpdatePopupShowing||this._createFHIRUpdatePopup(t),t.IsFinished||(s=t.FeaturesToLoad[t.FeaturesToLoad.length-1]),t.FeaturesLoaded)(r=t.FeaturesLoaded[n])!==s&&($afe.select("#loading_"+r).addClass("hidden"),$afe.select("#finished_"+r).removeClass("hidden"),$afe.select("#success_"+r).removeClass("hidden"));for(n in t.FeaturesWithErrors)c=!0,(r=t.FeaturesWithErrors[n])!==s&&($afe.select("#loading_"+r).addClass("hidden"),$afe.select("#finished_"+r).removeClass("hidden"),$afe.select("#error_"+r).removeClass("hidden"),$afe.select("#errorMessage_"+r).removeClass("hidden"))}t.IsFinished?(this._fhirUpdateComplete=!0,$afe.select("#loadingDisclaimer").addClass("hidden"),$afe.select("#updateLoadingTitle").addClass("hidden"),$afe.select("#updateCompleteTitle").removeClass("hidden"),$afe.select("#completeAnimationGif").safeAttr("src",makeStaticLink("images/H2Gicons/successAnimation.gif")),this._Mode!==i&&this._Mode!==l||(this._replaceLoadingText(c),this._orgListObj[this._userClickedOrgId].IsWithinThrottlingTime&&($container=$afe.select(".orgsLinked>[data-id='"+this._linkedFhirOrgId+"']").find(".fhir-update"),$$WP.Strings.addMnemonic("@MYCHART@FHIRUPDATETHROTTLINGTIME@",this._fhirSessionThrottlingTime,"","Community.OrganizationList"),o=$$WP.Strings.get("FhirIsInThrottlingTimeHoverText","Community.OrganizationList"),$container.prop("disabled",!0),$container.prop("title",o),$$WP.Strings.removeMnemonic("@MYCHART@FHIRUPDATETHROTTLINGTIME@","Community.OrganizationList"))),this._orgListObj[this._userClickedOrgId].FhirUpdateFinishedSeen=!0):setTimeout($.proxy(this._getRefreshStatus,this),500)}}},_checkOrgGroupBelonging:function(e){var t,i;return null!=(t=$afe.select(".orgsLinked>[data-id='"+e.OrganizationId+"']")[0])&&(i=t.parentNode.firstChild.id,!e.HasValidRefreshToken||"PeriodicallyUpdate_Header"==i)},_createTokenExchangePopup:function(){var e,n,r,o;o=this._Mode!==i&&this._Mode!==t&&this._Mode!==l,(0===$afe.select(".loadingStatus").length||o)&&((e={}).SupressTitle=!1,e.IsClosable=!1,this._userClickedAction===y?e.TitleText=$$WP.Strings.get("ConnectAccountPopupTitle","Community.FHIRUpdate"):this._userClickedAction===_&&(e.TitleText=$$WP.Strings.get("PopupTitle","Community.FHIRUpdate")),n=new $$WP.Community.Components.CommunityPopupComponent(e,$$WP.Templates.Community.FHIRUpdatePopup),this._popupComponent=n,(r={}).CloseButtonText=this._getFhirCloseButtonText(),this._popupComponent.setData(r),$$WPUtil.quickPopup(n,{Size:$$WPContain.Popup.SizeEnum.MEDIUM,Class:"contentpopup",positioningFunction:$$WPContain.Positions.InsideCentered,HasBackButton:!1}),$afe.select(".updateTitleContainer").addClass("withLoadingIndicator"),$afe.select(".loadingExt").addClass("CEbigloading"),this._isTokenExchangePopupShowing=!0,$afe.select("#updateClose").click(this.closeFhirUpdatePopup),this._popupComponent.$container.trigger("resize"),this._popupComponent.ContainerComponent.setFocus())},_createFHIRUpdatePopup:function WP$Community$CommunityController$createFHIRUpdatePopup(e){if(!this._isFhirUpdatePopupShowing&&e){var n=this._getUpdateStatusDisplayModel(e);$afe.select("#popupContent").empty().safeAppend($afe.renderTemplate($$WP.Templates.Community.FHIRUpdatePopup,n)),$afe.select("#externalLoadingIndicator").addClass("hidden"),$afe.select(".updateTitleContainer").removeClass("withLoadingIndicator"),$afe.select("#updateLoadingTitle").removeClass("hidden"),$afe.select("#featuresLoading").removeClass("hidden"),this._isFhirUpdatePopupShowing=!0,$afe.select("#updateClose").click(this.closeFhirUpdatePopup),this._Mode!==i&&this._Mode!==t&&this._Mode!==l&&(dxrOrgs=this._getDXRLinkedOrganizations(),dxrOrgs.length>1&&($afe.select("#updateAnotherOrg").removeClass("hidden"),$afe.select("#updateAnotherOrg").click(this._updateAnotherOrganization),$afe.select("#updateClose").removeClass("otherbutton"),$afe.select("#updateClose").addClass("reverseNewWorkflow"))),this._popupComponent.$container.trigger("resize"),this._popupComponent.ContainerComponent.setFocus()}},_getFhirCloseButtonText:function(){return this._Mode===l||this._Mode===i&&$$WP.Utilities.UI.IsMobile?CloseButtonText=$$WP.Strings.get("MobileCloseButton","Community.FHIRUpdate"):CloseButtonText=$$WP.Strings.get("CloseButton","Community.FHIRUpdate")},_getUpdateStatusDisplayModel:function WP$Community$CommunityController$_getUpdateStatusDisplayModel(e){var t,i,n={};if(!e||!e.FeaturesToLoad)return n;for(t in n.CloseButtonText=this._getFhirCloseButtonText(),1===e.FeaturesToLoad.length?i="col-12":2===e.FeaturesToLoad.length&&(i="col-6"),n.features=[],e.FeaturesToLoad)n.features.push(this._getFeatureDisplayModel(e.FeaturesToLoad[t],i));return n},_getFeatureDisplayModel:function WP$Community$CommunityController$_getFeatureDisplayModel(e,t){var i={},n=$$WP.Strings.getNamespace("Community.Manage");switch(i.featureValue=e,i.widthOverride=t,e){case 9:i.text=n.getKeyedString("ActivityIconTitles","0"),i.iconUrl="images/"+n.getKeyedString("ActivityIconImageTitles","0").trim();break;case 37:i.text=n.getKeyedString("ActivityIconTitles","2"),i.iconUrl="images/"+n.getKeyedString("ActivityIconImageTitles","2").trim();break;case 52:i.text=n.getKeyedString("ActivityIconTitles","3"),i.iconUrl="images/"+n.getKeyedString("ActivityIconImageTitles","3").trim();break;case 70:i.text=$$WP.Strings.get("PastVisitsFeatureName","Community.FHIRUpdate"),i.iconUrl="images/"+n.getKeyedString("ActivityIconImageTitles","6").trim();break;case 47:i.text=n.getKeyedString("ActivityIconTitles","5"),i.iconUrl="images/"+n.getKeyedString("ActivityIconImageTitles","5").trim()}return i.iconUrl=makeStaticLink(i.iconUrl),i},_replaceLoadingText:function WP$Community$CommunityController$_replaceLoadingText(e){var t,i,n="";(orgObj=this._orgListObj[this._userClickedOrgId],orgObj.CurrentlyLoadingDxrData=!1,e?(t=this._getErrorText(orgObj.LinkErrorCode,$$WP.Strings.get("ErrorUpdatingLabel","Community.OrganizationList")),n="attention",orgObj.ErrorLoadingDxrData=!0):orgObj.IsWithinThrottlingTime?($$WP.Strings.addMnemonic("@MYCHART@FHIRUPDATETHROTTLINGTIME@",this._fhirSessionThrottlingTime,"","Community.OrganizationList"),t=$$WP.Strings.get("FhirIsInThrottlingTimeMessage","Community.OrganizationList"),$$WP.Strings.removeMnemonic("@MYCHART@FHIRUPDATETHROTTLINGTIME@","Community.OrganizationList")):($$WP.Strings.addMnemonic("@MYCHART@LastAccessTokenDateTime@",this._orgListObj[this._userClickedOrgId].LastAccessTokenDateTime,"","Community.OrganizationList"),t=$$WP.Strings.get("InformationUpToDateAsOfLabel","Community.OrganizationList"),$$WP.Strings.removeMnemonic("@MYCHART@LastAccessTokenDateTime@","Community.OrganizationList")),this._orgListObj[this._userClickedOrgId]=orgObj,(i=$afe.select(".orgsLinked>[data-id='"+this._linkedFhirOrgId+"']")).find(".orgUpdateTime").text(t).addClass(n),i.find(".fhir-update").prop("disabled",!1).safeAttr("value",$$WP.Strings.get("UpdateAccount","Community.OrganizationList")),e)&&(i.find(".orgUpdateTime").prepend('<img src="" class="infoIcon" alt="" />'),i.find(".infoIcon").safeAttr("src",makeStaticLink("images/toast_warning_icon.png")))},_getErrorTextFromResponse:function Epic$PatientAccess$Controllers$CommunityController$_getErrorTextFromResponse(e,t,i){return e&&e.Error?this._getErrorText(e.Error,t,i):t},_getErrorText:function _getErrorText(e,t,i){var n;switch(e){case b:n=this._ensureOrgName("CeOptOutErrorText","Community.Manage",i);break;case R:n=this._ensureOrgName("NoDemographicMatchErrorText","Community.Manage",i);break;case W:n=this._ensureOrgName("CeLinkFailedErrorText","Community.Manage",i);break;case M:n=this._ensureOrgName("AccountDisabledErrorMsg","Community.OrganizationList",i);break;case E:n=this._ensureOrgName("UserIneligible","Community.OrganizationList",i);break;case v:n=this._ensureOrgName("FailedLinkErrorText","Community.Manage",i);break;case U:n=this._ensureOrgName("ForwardedCeLinkFailedErrorText","Community.Manage",i);break;case z:n=this._ensureOrgName("FailedForwardedLinkErrorText","Community.Manage",i);break;case w:n=this._ensureOrgName("MissingUrlErrorText","Community.Manage",i);break;case F:n=$$WP.Strings.get("NoAuthErrorText","Community.OrganizationList");break;case x:n=$$WP.Strings.get("TokenFailedErrorText","Community.OrganizationList");break;case N:n=$$WP.Strings.get("DemographicFetchFailedErrorText","Community.OrganizationList");break;case D:n=$$WP.Strings.get("DemographicMatchFailedErrorText","Community.OrganizationList");break;default:n=t}return n},_ensureOrgName:function _ensureOrgName(e,t,i){var n;return $$WPUtil.IsNullOrEmpty(i)?n=$$WP.Strings.get("ErrorOccurredText","Community.Manage"):($$WP.Strings.addMnemonic("@MYCHART@ORGANIZATIONNAME@",i,!1,t),n=$$WP.Strings.get(e,t),$$WP.Strings.removeMnemonic("@MYCHART@ORGANIZATIONNAME@",t)),n},_getFhirErrorTitle:function WP$Community$CommunityController$_getFhirErrorTitle(e){return e===y?$$WP.Strings.get("LinkAccountErrorTitle","Community.Manage"):$$WP.Strings.get("UpdateAccountErrorTitle","Community.Manage")},_forceStopFhirLoadStatus:function WP$Community$CommunityController$_forceStopFhirLoadStatus(){var e=this;getCSRFTokenAsQS((function(){$.ajax({url:makeLink("Community/Shared/ForceStopFhirLoadStatus"),type:"POST",cache:!1,data:{orgId:e._linkedFhirOrgId},dataType:"json",error:e._disposeFhirUpdatePopup})}))},_disposeFhirUpdatePopup:function WP$Community$CommunityController$_disposeFhirUpdatePopup(e){if(this._isTokenExchangePopupShowing||this._isFhirUpdatePopupShowing||0!==$afe.select(".loadingStatus").length){this.disposePopup("",!0);var t=this._getFhirErrorTitle(this._userClickedAction),n=this._getErrorText(e,$$WP.Strings.get("ErrorOccurredText","Community.Manage"));this._displayErrorPopup(n,t)}this._Mode!==i&&this._Mode!==l||this._replaceLoadingText(!0),this._renderLinkedOrganizations()},_successUpdateFHIRAccount:function Epic$PatientAccess$Controllers$CommunityController$_successUpdateFHIRAccount(e){if(e.Success)e.IsLiveFhir||this._fhirUpdateComplete||(e.FhirOrg.CurrentlyLoadingDxrData=!0),e.IsFromNewOrg?this._userClickedAction=y:this._userClickedAction=_,e.IsLiveFhir&&(this.showSuccessAndDisposePopup(),this._orgListObj[this._userClickedOrgId]=e.FhirOrg,this.renderOrganizationList());else if(e.IsLiveFhir){this.disposePopup(null,!0);var t=this._getFhirErrorTitle(this._userClickedAction),i=$$WP.Strings.get("ErrorOccurredText","Community.Manage");this._displayErrorPopup(i,t)}else this._forceStopFhirLoadStatus()},addNewQueryString:function Epic$PatientAccess$Controllers$CommunityController$addQueryString(e){var t;e&&void 0!==window.history&&void 0!==window.history.replaceState&&(-1!==(t=window.location.search).indexOf("?")?window.history.replaceState({},document.title,t+"&"+e):window.history.replaceState({},document.title,t+"?"+e)),$$WPUtil.parseQueryString(window.location.search)},_completeUpdate:function Epic$PatientAccess$Controllers$CommunityController$_completeUpdate(e){var t;if($$WPUtil.HideAjaxSpinner($afe.select(".ajaxspinner")),e.Success)if(this.showSuccessAndDisposePopup(),this._isIntegrated)this._userClickedAction===p?this._notMyAccountCallback():this._successCallback(e.OrgLink);else if(this._userClickedAction===p)this._orgListObj[this._userClickedOrgId].IsDisabled=!0,this._orgListObj[this._userClickedOrgId].ShowDismissOption=!1,this._renderSingleCEOrgBottom(this._orgListObj[this._userClickedOrgId]);else{for(t in e.OrgLink.HasForwardedLinks=e.LinkReferral&&e.LinkReferral.ForwardedLinks.length>0,this._orgListObj[e.OrgLink.OrganizationId]=e.OrgLink,this._renderJustLinkedOrganization(e.OrgLink),this._addForwardedLinksForOrg(e.LinkReferral),this._renderLinkedOrganizations(),this._forwardedLinks){this._forwardedLinks[t].informLinkSuccessful(e.OrgLink.OrganizationId)}$$WP.ProxySwitch.Controllers.ProxySelectorController.getProxySelectorController().retry()}else this._errorClickNotMe()},_completeUnlink:function Epic$PatientAccess$Controllers$CommunityController$_completeUnlink(e){if($$WPUtil.HideAjaxSpinner($afe.select(".ajaxspinner")),e.Success){this.showSuccessAndDisposePopup(),this._userClickedAction===k?this._orgListObj[this._userClickedOrgId].UserActionStatus=k:(this._orgListObj[this._userClickedOrgId].UserActionStatus=h,this._orgListObj[this._userClickedOrgId].HasForwardedLinks=!1,this._forwardedLinks[this._userClickedOrgId]&&delete this._forwardedLinks[this._userClickedOrgId]),this._orgListObj[this._userClickedOrgId].Accept=!1,this._orgListObj[this._userClickedOrgId].H2GRemoteAuthLinkWorkflow=G;var t=$afe.select(".orgsLinked>[data-id='"+this._userClickedOrgId+"']");if(t.empty(),t.safeAttr("aria-live","polite"),this._orgListObj[this._userClickedOrgId].PayerOrgDetails&&this._orgListObj[this._userClickedOrgId].PayerOrgDetails.IsPayvider){var i=$afe.select(".orgsLinked>[data-id='"+this._userClickedOrgId+"_Payvider']");i.empty(),i.safeAttr("aria-live","polite");var n={IsPayviderPayerContext:!0,org:this._orgListObj[this._userClickedOrgId]};i.safeAppend($afe.renderTemplate($$WP.Templates.Community.RecentUnlinkedCEOrg,n))}n={org:this._orgListObj[this._userClickedOrgId]};t.safeAppend($afe.renderTemplate($$WP.Templates.Community.RecentUnlinkedCEOrg,n)),this._renderInsuranceOrganizations(),this._renderCentralOrganization(),this._renderKnownOrganizations(),this.clearCurrentSearch(),$$WP.ProxySwitch.Controllers.ProxySelectorController.getProxySelectorController().retry()}else this._errorClickUnlink(e)},clearCurrentSearch:function Epic$PatientAccess$Controllers$CommunityController$_clearCurrentSearch(e){$afe.select("#orgSearch").val(""),$afe.select("#orgSearch").trigger("input"),e&&"clear-search-button"===e.target.id&&$afe.select("#orgSearch").focus()},goToTop:function WP$Community$CommunityController$goToTop(e){$afe.select("#orgSearch").focus()},_displayError:function Epic$PatientAccess$Controllers$CommunityController$_displayError(e,t){var i=$afe.select("#externalLoadingIndicator"),n=$afe.select(".loadingExt");i.hasClass("loaded")||(i.removeClass("hidden"),$afe.jq(window).trigger("popupResize"),$afe.select(".loadingContainer").addClass("loaded")),n.hasClass("loaded")?(n.addClass("loadingerror"),this._displayErrorPopup(e,t)):n.removeClass("loading").addClass("loadingerror").on("transitionend transitionEnd",$.proxy(this._displayErrorPopup,this,e,t))},_displayErrorPopup:function Epic$PatientAccess$Controllers$CommunityController$_displayErrorPopup(e,t){var i,n;this.disposePopup(!0),i={ToolbarButtons:[{Text:$$WP.Strings.get("OKButton","Community.Manage"),Class:"otherbutton"}],TitleText:t,Html:e,IsClosable:!0,callback:function(){}},n=new $$WPComp.ConfirmComponent(i,{Size:$$WP.Containers.Popup.SizeEnum.SMALL}),$$WPUtil.quickPopup(n)},RedirectToLinkMyAccountsHelper:function Epic$PatientAccess$Controllers$CommunityControllers$RedirectToLinkMyAccountsHelper(e){var t,i,n=$$WP.Strings.get("Continue","community.externaljump"),r=$$WP.Strings.get("cancel","community.externaljump");if(e){t=$$WP.Strings.get("externalLinkNeedsLinkMyAccountErrorTitle","community.externaljump"),i=$$WP.Strings.get("externalLinkNeedsLinkMyAccountErrorBody","community.externaljump");var o=$afe.select("#externalLoadingIndicator"),a=$afe.select(".loadingExt");o.hasClass("loaded")||(o.removeClass("hidden"),$afe.jq(window).trigger("popupResize"),$afe.select(".loadingContainer").addClass("loaded")),a.hasClass("loaded")?(a.addClass("loadingerror"),this._displayRedirectToLinkMyAccountPopup(t,i,n,r)):a.removeClass("loading").addClass("loadingerror").on("transitionend transitionEnd",$.proxy(this._displayRedirectToLinkMyAccountPopup,this,t,i,n,r))}},_displayRedirectToLinkMyAccountPopup:function Epic$PatientAccess$Controllers$CommunityController$_displayRedirectToLinkMyAccountPopup(e,t,i,n){this.disposePopup(!0);var r={TitleText:e,Message:t,callback:function(e){"toolbarcontinue"===e&&$$WPUtil.TryRedirect(makeLink("Community/Manage"))},IsClosable:!0,ToolbarButtons:[new $$WPComp.ComplexObjects.Button(i,null,"continue","continue"),new $$WPComp.ComplexObjects.Button(n,null,"previousstep","cancel")]},o=new $$WPComp.MessageComponent(r),a={Size:$$WPContain.Popup.SizeEnum.SMALL,Class:"sm-autosizedpopup externalJumpRequestPopup Popup"};$$WPUtil.quickPopup(o,a),setTimeout((()=>{o.focus()}),0)},_displayLoadingPopup:function _displayLoadingPopup(e,t){var i,n,r;0===$afe.select(".loadingStatus").length&&(r=$$WPContain.Popup.SizeEnum.SMALL,i={SupressTitle:!0,IsClosable:!1,TitleText:t},n=new $$WP.Community.Components.CommunityPopupComponent(i),this._popupComponent=n,$$WPUtil.quickPopup(n,{Size:r,Class:"contentpopup noOverflow",positioningFunction:$$WPContain.Positions.InsideCentered,HasBackButton:!1}),$afe.select(".loadingStatus").text(e),$afe.select(".loadingExt").addClass("CEbigloading"),$afe.select("#externalLoadingIndicator").removeClass("hidden"),this._popupComponent.$container.trigger("resize"),this._popupComponent.ContainerComponent.setFocus())},showSuccessAndDisposePopup:function(){null!==this._popupComponent&&($afe.select(".loadingExt").addClass("loading").removeClass("loaded"),$afe.select(".loadingContainer").addClass("loading").removeClass("loaded"),$afe.select("#challengeQuestions").addClass("hidden"),$afe.select("#externalLoadingIndicator").removeClass("hidden"),$afe.jq(window).trigger("popupResize"),$afe.select(".loadingContainer").addClass("loaded"),$afe.select(".loadingExt").removeClass("loading").addClass("loaded").on("transitionend transitionEnd",this.disposePopup))},disposePopupCallback:function disposePopupCallback(){this.disposePopup()},disposePopup:function Epic$PatientAccess$Controllers$CommunityController$disposePopup(e,n){null!==this._popupComponent&&(this._popupComponent.dispose(),this._popupComponent=null,(this._isTokenExchangePopupShowing||this._isFhirUpdatePopupShowing)&&(this._isTokenExchangePopupShowing=!1,this._isFhirUpdatePopupShowing=!1,this._wasFhirUpdatePopupClosed=!0,this.removeQueryStringFromBrowser(),this._Mode===c&&this.addNewQueryString("mode=snapshot"),!n&&this._fhirUpdateComplete&&this._Mode!==i&&this._Mode!==t&&this._Mode!==l&&location.reload()),this._isIntegrated&&e&&this._failureCallback())},closeFhirUpdatePopup:function closeFhirUpdatePopup(){var e,t=this;null!=t._orgListObj[t._userClickedOrgId]&&(e=t._orgListObj[t._userClickedOrgId].FhirUpdateFinishedSeen),getCSRFTokenAsQS((function(){$.ajax({url:makeLink("Community/Shared/UpdateInProgressNotSeenStatus"),type:"POST",cache:!1,data:{orgId:t._linkedFhirOrgId,inProgressOrgNotSeen:!e},dataType:"json",error:t.disposePopupCallback,success:t.disposePopupCallback})}))},disableSubmit:function WP$Community$CommunityController$diableSubmit(){$afe.select('div.formcontents input[type="button"]').prop("disabled",!0).safeAttr("aria-disabled","true")},enableSubmit:function WP$Community$CommunityController$enableSubmit(){$afe.select('div.formcontents input[type="button"]').prop("disabled",!1).safeAttr("aria-disabled","false")},maskOrUnmaskAnswerField:function WP$Community$CommunityController$maskOrUnmaskAnswerField(){var e,t;switch(t=(e=$afe.select("#ChallengeQuestion").val())===T&&this._hideSSNWhenTyping?"password":"text",$afe.select("#AnswerField").val(""),$afe.select("#AnswerField").removeClass("invalid"),$afe.select("#AnswerField_message").empty(),e===P?$afe.select("#AnswerField").safeAttr("disabled",!0):$afe.select("#AnswerField").safeAttr("disabled",!1),$$WP.FormValidation.initializeDOMSubtree($afe.select("#challengeQuestionsForm")),$afe.select("#AnswerField").prop("type",t),e){case L:case S:$afe.select("#AnswerField").safeAttr("data-validation-settings",'{"required":true, "isEmail":true}');break;case T:$afe.select("#AnswerField").safeAttr("data-validation-settings",'{"required":true, "maxLength":4}');break;default:$afe.select("#AnswerField").safeAttr("data-validation-settings",'{"required":true}')}},getChildrenOrganizationList:function WP$Community$CommunityController$getChilrenOrganizationList(e){$.ajax({url:makeLink("Community/Shared/LoadChildrenOrganizations"),type:"POST",cache:!1,data:{organizationID:e},error:this._errorGetChildrenOrganizations,success:this._successGetChildrenOrganizations})},_errorGetChildrenOrganizations:function Epic$Community$CommunityController$_errorGetChildrenrganizations(e){var t=this._getErrorTextFromResponse(e,$$WP.Strings.get("ErrorOccurredText","Community.Manage")),i=$$WP.Strings.get("LoadOrgsErrorTitle","Community.Manage");this._displayErrorPopup(t,i)},_successGetChildrenOrganizations:function Epic$Community$CommunityController$_successGetChildrenOrganizations(e){this.renderChildOrgList(e.childrenOrgs.ChildrenOrganaizationList,e.childrenOrgs.ChildrenOrganaizationList.length)},renderChildOrgList:function Epic$Community$CommunityController$renderChildOrgList(e,t){var i,n,r,o,a,s,l;i=null!=t&&""!==t&&t>0?t:0,$$WPUtil.IsNullOrEmpty(this._userClickedOrgName)?(l=this._orgListObj[this._userClickedOrgId],$$WPUtil.IsNullOrEmpty(l)||(o=l.OrganizationName)):o=this._userClickedOrgName,(n={}).SupressTitle=!0,n.IsClosable=!0,n.TitleText=$$WP.Strings.get("ChildOrganizationPopupTitle","Community.OrganizationList"),r=new $$WP.Community.Components.CommunityPopupComponent(n,$$WP.Templates.Community.ChildOrganizationsPopup),this._popupComponent=r,a={ChildOrgList:e,Count:i,ParentOrg:o},this._popupComponent.setData(a),s=isDataTile(),$$WPUtil.quickPopup(r,{Class:"Popup childOrgPopup",Size:$$WPContain.Popup.SizeEnum.MEDIUM,positioningFunction:$$WPContain.Positions.InsideNearTop,HasBackButton:s}),r.ContainerComponent.setFocus()},_getOrganizationList:function WP$Community$CommunityController$_getOrganizationList(){var e="1"===$$WPUtil.queryString("showDXROrgInMO"),t=this;getCSRFTokenAsQS((function(){$.ajax({url:makeLink("Community/Shared/LoadCommunityLinks"),type:"POST",cache:!1,data:{controllerType:t._Mode,showDXROrgInMO:e},error:t._errorGetOrganizationList,success:t._successGetOrganizationList})}))},_successGetOrganizationList:function Epic$PatientAccess$Controllers$CommunityController$_successGetOrganizationList(e){if(null===this._orgListObj||void 0===this._orgListObj||0===Object.keys(this._orgListObj).length?this._orgListObj=e.OrgList:$.extend(this._orgListObj,e.OrgList),this._Mode===i||this._Mode===t){this._inProgressListObj=e.InProgressList,this._autoQueryListObj=e.AutoQueryList,this._isConsentNeeded=e.IsConsentNeeded,this._ceOptOut=e.CEOptOut,this._fhirUpdateFrequency=e.FhirUpdateFrequency,this._fhirSessionThrottlingTime=e.FhirSessionThrottlingTime,this._homeOrgName=e.HomeOrgName,this._spotlightOrganizations=e.Spotlight,this._isSelfVerified=e.IsSelfVerified;var n=e.ForwardedLinks;e.ForwardedLinks&&e.ForwardedLinks.forEach($.proxy((function(e){this._orgListObj[e.ForwardingOrgId].HasForwardedLinks=!0}),this)),this._tryRenderManagePageContent(e),n&&n.forEach($.proxy(this._addForwardedLinksForOrg,this)),this._isSelfVerified||this._updateUnverifiedPatientUI()}else this._Mode===l&&this._getCurrentLoadingOrgList(),this._Mode===c&&this._showRefreshBanner()&&$afe.select("#refresh-banner-container").removeClass("hidden"),this.continueFHIRQueryString()},_updateUnverifiedPatientUI:function WP$Community$CommunityController$__updateUnverifiedPatientUI(){showTabbedSection("tab_topic_linked"),$afe.select("#topic_discover").empty().safeAppend($afe.renderTemplate($$WP.Templates.Community.ManagePageUnverifiedView,{}))},_addForwardedLinksForOrg:function(e){var t,n,r,o,a;this._Mode!==i||this._isIntegrated||(t=e.ForwardingOrgId,n=$afe.select("[data-org-bottom-id='"+t+"']"),r={OnSuccessCallback:$.proxy(this._onForwardedLinkSuccess,this),InProgressCallback:$.proxy(this._onForwardedLinkInProgress,this),OnFailedCallback:$.proxy(this._onForwardedLinkFailed,this)},o=$.proxy(this._getErrorText,this),a=new $$WP.Community.LinkForwardController(n,e,r,o),this._forwardedLinks[t]=a)},_onForwardedLinkSuccess:function _onForwardedLinkSuccess(e){e.forEach($.proxy(this._updateSingleForwardedLink,this)),this._renderLinkedOrganizations(),$$WP.ProxySwitch.Controllers.ProxySelectorController.getProxySelectorController().retry()},_updateSingleForwardedLink:function _updateSingleForwardedLink(e){var t=this._orgListObj[e.OrganizationId],i=null!=t;this._orgListObj[e.OrganizationId]=e,i&&this._renderJustLinkedOrganization(e)},_onForwardedLinkInProgress:function _onForwardedLinkInProgress(e){this._setDisabledOnLinkButton(e,!0)},_onForwardedLinkFailed:function _onForwardedLinkFailed(e){e.forEach($.proxy((function(e){this._setDisabledOnLinkButton(e,!1)}),this))},_setDisabledOnLinkButton:function _setDisabledOnLinkButton(e,t){this._orgListObj[e]&&$afe.select(":input[data-id='"+e+"']").safeAttr("disabled",t)},_errorGetOrganizationList:function WP$Community$CommunityController$__errorGetOrganizationList(){var e,n;switch(this._Mode){case t:$afe.onDocumentReady((function(){window.location=$afe.select("span#redirectURL").data("url")}));break;case i:setTimeout((function(){$afe.select("div#loading").hide(),e=$$WP.SimpleTemplates.Span({class:"nodata"},$$WP.Strings.get("GenericError","Community.Manage")),(n=$afe.select("div#community_container")).empty(),n.safeAppend(e),n.slideDown(200)}),500)}},_showRefreshBanner:function WP$Community$CommunityController$showRefreshBanner(){var e;if(!(e=this._getDXRLinkedOrganizations()))return!1;for(index in e)if(e[index].ShowInRefreshBanner)return!0;return!1},_buildActivityIconModel:function(){var e=$$WP.Strings.getNamespace("Community.Manage");return[{title:e.getKeyedString("ActivityIconTitles","0"),image:"images/"+e.getKeyedString("ActivityIconImageTitles","0").trim()},{title:e.getKeyedString("ActivityIconTitles","1"),image:"images/"+e.getKeyedString("ActivityIconImageTitles","1").trim()},{title:e.getKeyedString("ActivityIconTitles","2"),image:"images/"+e.getKeyedString("ActivityIconImageTitles","2").trim()},{title:e.getKeyedString("ActivityIconTitles","8"),image:"images/"+e.getKeyedString("ActivityIconImageTitles","8").trim()},{title:e.getKeyedString("ActivityIconTitles","3"),image:"images/"+e.getKeyedString("ActivityIconImageTitles","3").trim()},{title:e.getKeyedString("ActivityIconTitles","4"),image:"images/"+e.getKeyedString("ActivityIconImageTitles","4").trim()},{title:e.getKeyedString("ActivityIconTitles","5"),image:"images/"+e.getKeyedString("ActivityIconImageTitles","5").trim()},{title:e.getKeyedString("ActivityIconTitles","6"),image:"images/"+e.getKeyedString("ActivityIconImageTitles","6").trim()}]},_renderLoginPageContent:function(){var e=$afe.select("div#community_container"),t=this._buildActivityIconModel(),i=$afe.renderTemplate($$WP.Templates.Community.CommunityLoginView,{ActivityIcons:t,expanded:!0,hideExpandCollapseButton:!0});e.hide(),e.empty(),e.safeAppend(i),$afe.select("div#loading").hide(),e.show()},_renderStaticManagePageContent:function(){var e=$afe.select("div#community_container"),t=this._buildActivityIconModel(),i=$afe.renderTemplate($$WP.Templates.Community.CommunityLinksView,{ActivityIcons:t,From:$$WPUtil.queryString("from"),IsProxyContext:this._isProxyContext,isCentralCardEnabled:this._isCentralCardEnabled,isCentralLinked:this._isCentralLinked,IsAdminLoginFromHyperspace:this._isAdminLoginFromHyperspace,RemoveHyperlink:this._removeHyperlink,SubjectName:this._subjectName});e.empty().safeAppend(i),"linked"!==$$WPUtil.queryString("tab")||this._isProxyContext||this._isAdminLoginFromHyperspace||$$WP.Utilities.UI.OnUIFrameworkLoaded($.proxy(showTabbedSection,this,"tab_topic_linked"))},_tryRenderManagePageContent:function(e){$$WP.Utilities.UI.OnUIFrameworkLoaded($.proxy(this._renderManagePageContent,this,e))},_renderManagePageContent:function(e){var t,i,n,r=$afe.select("div#community_container");for(t in this._isPICELDisabled&&(i=$afe.renderTemplate($$WP.Templates.Core.Banner,{BannerType:"informationalType",HeaderText:$$WP.Strings.get("LocalPICELDisabledHeader","Community.Manage"),DetailText:$$WP.Strings.get("LocalPICELDisabledBody","Community.Manage")}),$afe.select("#picel-disabled-banner").empty().safeAppend(i)),e.HasSearchableOrgs||0!==this._getKnownCEOrganizations().length||0!==this._getAutoQueryCount()||this._isConsentNeeded||0!==this._spotlightOrganizations.length||$afe.select("#noOrganizations").show(),this._userCanSearch=e.HasSearchableOrgs,e.HasSearchableOrgs&&$afe.select("#organizationSearchContainer").show(),this.renderOrganizationList(),$afe.select("div#loading").hide(),r.show(),this._autoQueryListObj)this.autoQuery(this._autoQueryListObj[t].OrganizationId);this.updateImagePlaceholders(r),$afe.jq(window).trigger("resize"),"1"===$$WPUtil.queryString("celink")?(this._userClickedAction=m,this.continueCELinking()):this.continueFHIRQueryString();var o=0,a=[];function insuranceHowToVideoCallback(e){null!==e.Url&&a.push(e),addVideos()}function insuranceHowToVideoFailureCallback(){addVideos()}function addVideos(){if(1==o){if(a.length>0){var e={VideoCard:"LinkMyAccounts"};e.Videos=a,new $$WP.UI.VideoController($afe.select("#video-card-container-sidebar"),e,0,1),new $$WP.UI.VideoController($afe.select("#video-card-container-header"),e,1)}}else o++}new $$WP.UI.VideoViewModel("LinkMyAccounts",null,(function linkMyAccountsVideoCallback(e){null!==e.Url&&a.push(e),addVideos()})),$.ajax({url:makeLink("Community/Shared/UserHasLinkWithPayer"),type:"POST",cache:!1,data:{},dataType:"json",success:function userHasLinkWithPayerSuccess(e){e.userHasLinkWithPayer?new $$WP.UI.VideoViewModel("InsuranceHowTo",null,insuranceHowToVideoCallback,insuranceHowToVideoFailureCallback):addVideos()},error:insuranceHowToVideoFailureCallback}),null!=(n=this._handleQueryString())&&n in this._orgListObj&&this.CreateLinkToOrganizationWithPopup(n)},renderOrganizationList:function Epic$PatientAccess$Controllers$CommunityController$renderOrgnizationList(){this._renderLinkedOrganizations(),this._Mode===i&&(this._renderInProgressOrganizations(),this._renderInsuranceOrganizations(),this._renderCentralOrganization(),this._renderKnownOrganizations(),this._renderNearbyOrganizations(),this._renderUpdatedSearchResultsIfNeeded()),$afe.jq(window).trigger("resize"),$$WP.Utilities.UI.IsMobile&&$$WP.Utilities.Mobile&&$$WP.Utilities.Mobile.Optimization.CommunityLinks()},_renderLinkedOrganizations:function(){var e=this._Mode===i?0:1,t=1===e?this._getDXRLinkedOrganizations():this._getLinkedOrganizations(),n={organizationList:t,isProxyContext:this._isProxyContext,isCentralCardEnabled:this._isCentralCardEnabled,isCentralLinked:this._isCentralLinked,subjectName:this._subjectName,removeHyperlink:this._removeHyperlink,fhirSessionThrottlingTime:this._fhirSessionThrottlingTime,isSelfVerified:this._isSelfVerified,inlineUpdate:e};$$WP.Strings.addMnemonic("@MYCHART@HOMEORGANIZATIONNAME@",this._homeOrgName,"","Community.OrganizationList");var r=$afe.renderTemplate($$WP.Templates.Community.OrganizationList,n);if($$WP.Strings.removeMnemonic("@MYCHART@HOMEORGANIZATIONNAME@","Community.OrganizationList"),$afe.select("#organizationList").empty().safeAppend(r),e&&$$WP.Utilities.UI.IsMobile){var o=$afe.select("#orgsLinked");o.on("click",".toggleReminder",this.clickRemindUpdateFHIR),o.on("click","input.fhir-update",this.clickUpdateFHIR)}t&&t.length>0&&this._isProxyContext&&$afe.select("#proxyContextInfo").removeClass("hidden"),$$WP.Utilities.UI.IsMobile&&"1"!==$$WPUtil.queryString("canLaunchLinkInBrowser")&&$afe.select(".org-jump.button").hide()},_getCurrentLoadingOrgList:function(){if(this._Mode!==l&&$$WP.Utilities.UI.IsMobile)$$WP.Utilities.TryRedirect(makeLink("Community/UpdateData"));else{var e,t,i=this._getDXRLinkedOrganizations(),n="",r=this;for(t in i)e=i[t],n=n+"^"+e.OrganizationId;getCSRFTokenAsQS((function(){$.ajax({url:makeLink("Community/Shared/GetCurrentLoadingOrgList"),type:"POST",cache:!1,data:{orgIds:n,controllerType:r._Mode},dataType:"json",error:r._errorGetCurrentLoadingOrgList,success:r._successGetCurrentLoadingOrgList})}))}},_errorGetCurrentLoadingOrgList:function WP$Community$CommunityController$_errorGetCurrentLoadingOrgList(){var e=$$WP.Strings.get("ErrorOccurredText","Community.Manage"),t=$$WP.Strings.get("UpdateAccountErrorTitle","Community.Manage");this._displayErrorPopup(e,t)},_successGetCurrentLoadingOrgList:function(e){var t,i;for(t=0;t<e.errorOrgList.length;t++)i=e.errorOrgList[t],this._orgListObj[i]&&(this._orgListObj[i].LinkErrorCode=e.errorCodes[i]);this._Mode===l?this._renderFhirOrgPage(e.loadingOrgList,e.errorOrgList):this._renderFhirOrgPopup(e.loadingOrgList,e.errorOrgList)},_renderFhirOrgPage:function(e,t){var i=0,n=1,r=this._getDXRLinkedOrganizations();this._updateDxrOrgModels(r,e,t),this._hasNonDXRLinkedOrganization()&&(i=1),"1"!==$$WPUtil.queryString("canShowLinkMyAccountsJump")&&(n=0),$afe.select("#organization_container").empty().safeAppend($afe.renderTemplate($$WP.Templates.Community.OrganizationList,{organizationList:r,inlineUpdate:1,showDisclaimer:i,epichttplink:"epichttp://communitymanage?tab=linked",showLinkMyAccountsJump:n}));var o=$afe.select("#orgsLinked");o.on("click",".toggleReminder",this.clickRemindUpdateFHIR),o.on("click","input.fhir-update",this.clickUpdateFHIR)},_updateAnotherOrganization:function(){this.disposePopup("",!0),this._getCurrentLoadingOrgList()},_renderFhirOrgPopup:function(e,t){var i,n,r,o,a=0;if(!$afe.select(".FhirOrgPopup").length)if(i=this._getDXRLinkedOrganizations()){this._updateDxrOrgModels(i,e,t),(n={}).SupressTitle=!0,n.IsClosable=!0,n.TitleText=$$WP.Strings.get("UpdateFHIROrgTitle","Community.Shared"),r=new $$WP.Community.Components.CommunityPopupComponent(n,$$WP.Templates.Community.OrganizationList),this._hasNonDXRLinkedOrganization()&&(a=1),this._popupComponent=r,o={organizationList:i,inlineUpdate:1,showDisclaimer:a},this._popupComponent.setData(o),$$WPUtil.quickPopup(r,{Class:"Popup noOverflow FhirOrgPopup",Size:$$WPContain.Popup.SizeEnum.MEDIUM,positioningFunction:$$WPContain.Positions.InsideCentered,OnCloseCallback:this.reloadAfterCancel}),r.ContainerComponent.setFocus();var s=$afe.select("#orgsLinked");s.on("click",".toggleReminder",this.clickRemindUpdateFHIR),s.on("click","input.fhir-update",this.clickUpdateFHIR)}else{var l=$$WP.Strings.get("ErrorOccurredText","Community.Manage"),c=$$WP.Strings.get("UpdateAccountErrorTitle","Community.Manage");this._displayErrorPopup(l,c)}},reloadAfterCancel:function reloadAfterCancel(){this._closeFHIRUpdateHandlerAdded&&location.reload()},_updateDxrOrgModels:function(e,t,i){var n,r;for(n in e)r=e[n],t.indexOf(r.OrganizationId)>-1?(r.CurrentlyLoadingDxrData=!0,r.ErrorLoadingDxrData=!1):i.indexOf(r.OrganizationId)>-1?(r.CurrentlyLoadingDxrData=!1,r.ErrorLoadingDxrData=!0):(r.CurrentlyLoadingDxrData=!1,r.ErrorLoadingDxrData=!1)},_renderInsuranceOrganizations:function(){var e=this,t=this._getKnownCEOrganizations(),i=this._getUniqueNumber,n=this._userCanSearch,r=t.filter((function(e){return e.PayerOrgDetails.IsPayer}));r.forEach((function(t){t.Type=e._isExternalLink(t)?q:H,t.ShowCEOptOutErrorMsg=this._ceOptOut,t.uniqueId=i(),t.StartExpanded=!0,t.ShowDismissOption=n,t.IsPayviderPayerContext=!0}));var o={Results:r,isConsentNeeded:this._isConsentNeeded};$afe.select("#insuranceSpotlight").empty().safeAppend($afe.renderTemplate($$WP.Templates.Community.InsuranceOrganizationList,o)),this._renderForwardedLinks()},_renderKnownOrganizations:function(){var e=this._getAutoQueryCount(),t=this._getKnownCEOrganizations(),i=this._getUniqueNumber,n=this._userCanSearch,r=(t=t.filter((function(e){return(!e.PayerOrgDetails.IsPayer||e.PayerOrgDetails.IsPayvider)&&!e.IsMyChartCentral})),this);t.sort(this.sortKnownOrg),t.forEach((function(e){e.LinkType===d?(null!=e.NewSubjectList&&e.NewSubjectList.length>0&&r._processNewSubjects(e),e.HasForwardedLinks?e.Type=j:e.CanCreateCELink||r._isExternalLink(e)?e.Type=q:e.Type=H,e.ShowCEOptOutErrorMsg=this._ceOptOut):e.Type=B,e.uniqueId=i(),e.StartExpanded=!0,e.ShowDismissOption=n,e.IsPayviderPayerContext=!1}));var o={Results:t,skeletonCount:e,isConsentNeeded:this._isConsentNeeded};$afe.select("#ceSpotlight").empty().safeAppend($afe.renderTemplate($$WP.Templates.Community.UnlinkedOrganizationList,o)),this._renderForwardedLinks()},_renderCentralOrganization:function(){var e=this,t=this._getKnownCEOrganizations(),i=this._getUniqueNumber;(t=t.filter((function(e){return e.IsMyChartCentral}))).forEach((function(t){t.Type=e._isExternalLink(t)?q:H,t.uniqueId=i(),t.StartExpanded=!0,t.ShowDismissOption=!1,t.IsPayviderPayerContext=!1}));var n={Results:t,isConsentNeeded:!1};$afe.select("#centralSpotlight").empty().safeAppend($afe.renderTemplate($$WP.Templates.Community.CentralOrganization,n))},_renderNearbyOrganizations:function(){var e=this._getUniqueNumber;this._spotlightOrganizations.forEach((function(t){t.EpicStatus?(t.Type=q,t.ShowCEOptOutErrorMsg=this._ceOptOut):t.Type=B,t.uniqueId=e()})),$afe.select("#fhirSpotlight").empty().safeAppend($afe.renderTemplate($$WP.Templates.Community.NearbyOrganizationSpotlight,{Spotlight:this._spotlightOrganizations}))},_renderUpdatedSearchResultsIfNeeded:function(){var e,t=this._userClickedAction,i=this._userClickedOrgId;if(t===m){$afe.select("[data-org-top-id='"+i+"'] .fullyLinked").show(),(e=$afe.select("[data-org-bottom-id='"+i+"'] .orgBottomRow")).empty();var n=this._orgListObj[i];null!=n.NewSubjectList&&n.NewSubjectList.length>0&&this._processNewSubjects(n),e.safeAppend($afe.renderTemplate($$WP.Templates.Community.RecentCEOrgBottom,n))}},_renderInProgressOrganizations:function(){var e=this._getInProgressFhirOrganizations();if(e&&0!=e.length){var t=this._getUniqueNumber;e.sort(this.sortDXROrg),e.forEach((function(e){e.uniqueId=t()}));var i={organizationList:e};$afe.select("#fhirLoading").empty().safeAppend($afe.renderTemplate($$WP.Templates.Community.InProgressOrganizationList,i))}},_renderForwardedLinks:function _renderForwardedLinks(){var e,t;for(e in this._forwardedLinks)(t=this._forwardedLinks[e]).render($afe.select("[data-org-bottom-id='"+t.ForwardingOrg+"']"))},_renderJustLinkedOrganization:function(e){null!=e.NewSubjectList&&e.NewSubjectList.length>0&&this._processNewSubjects(e);var t=e.OrganizationId,i=$afe.select("[data-org-bottom-id='"+t+"'] .orgBottomRow");$afe.select("[data-org-top-id='"+t+"'] .fullyLinked").removeClass("jqHidden"),i.empty(),i.safeAppend($afe.renderTemplate($$WP.Templates.Community.RecentCEOrgBottom,e))},_renderSingleCEOrgBottom:function(e){var t=$afe.select("[data-org-bottom-id='"+e.OrganizationId+"'][data-payer=false] .orgBottomRow"),i=$afe.select("[data-org-bottom-id='"+e.OrganizationId+"'][data-payer=true] .orgBottomRow");t.empty(),i.empty(),t.append($afe.renderTemplate($$WP.Templates.Community.CEOrgBottom,e)),i.append($afe.renderTemplate($$WP.Templates.Community.CEInsuranceOrgBottom,e))},_processNewSubjects:function(e){if($$WP.Utilities.UI.IsMobile&&"1"!==$$WP.Utilities.queryString("mobileHasDynamicAccessList"))e.NewSubjectList=[];else for(var t=0;t<e.NewSubjectList.length;t++)e.NewSubjectList[t].FirstLetter=e.NewSubjectList[t].DisplayName.substring(0,1)},_getLinkedOrganizations:function(){var e=this._orgListObj,t=Object.keys(e).map((function(t){return e[t]})).filter(this._filterLinkedOrganizations);return 0==t.length?null:this._groupLinkedOrganizations(t)},_groupLinkedOrganizations:function(e){var t=new Array(3),i=0;return $$WP.Strings.addMnemonic("@MYCHART@FHIRUPDATEFREQUENCY@",this._fhirUpdateFrequency,"","Community.Shared"),i=this._saveGroupToArray(e.filter(this._getManuallyUpdateOrgs),t,i,this._manualUpdateGroupKey()),i=this._saveGroupToArray(e.filter(this._getPeriodicallyUpdateOrgs),t,i,this._periodicallyUpdateGroupKey()),i=this._saveGroupToArray(e.filter(this._getAutomaticallyUpdateOrgs),t,i,this._automaticallyUpdateGroupKey()),$$WP.Strings.removeMnemonic("@MYCHART@FHIRUPDATEFREQUENCY@","Community.Shared"),t},_manualUpdateGroupKey:function(){return"ManuallyUpdate"},_periodicallyUpdateGroupKey:function(){return"PeriodicallyUpdate"},_automaticallyUpdateGroupKey:function(){return"AutomaticallyUpdate"},_saveGroupToArray:function(e,t,i,n){return 0==e.length?i:(t[i]=e.sort(this.sortOrg),n==this._periodicallyUpdateGroupKey()?this._fhirUpdateFrequency<2?t[i].header=$$WP.Strings.get(n+"HeaderTextSingular","Community.Shared"):t[i].header=$$WP.Strings.get(n+"HeaderTextPlural","Community.Shared"):t[i].header=$$WP.Strings.get(n+"HeaderText","Community.Shared"),t[i].key=n,++i)},_getManuallyUpdateOrgs:function(e){return 3==e.LinkType&&0==e.HasValidRefreshToken},_getPeriodicallyUpdateOrgs:function(e){return 3==e.LinkType&&1==e.HasValidRefreshToken},_getAutomaticallyUpdateOrgs:function(e){return 1==e.LinkType||2==e.LinkType},_filterLinkedOrganizations:function(e){return(!$$WP.Utilities.UI.IsMobile||"1"===$$WPUtil.queryString("showDXROrgInMO")||!e.LinkType||e.LinkType!==g)&&(2!==e.LinkType&&1!==e.LinkType||(e.DisplayAutoRefresh=!0),e.Accept)},_getDXRLinkedOrganizations:function(){var e=this._orgListObj;return e?Object.keys(e).map((function(t){return e[t]})).filter(this._filterDXRLinkedOrganizations).sort(this.sortDXROrg):""},_filterDXRLinkedOrganizations:function(e){return e.Accept&&e.LinkType===g&&e.ShowInRefreshBanner},_hasNonDXRLinkedOrganization:function(){var e,t=this._orgListObj;if(!t)return!1;e=Object.keys(t).map((function(e){return t[e]})).filter(this._filterLinkedOrganizations);for(var i=0;i<e.length;i++)if(e[i].LinkType===d||e[i].LinkType===u)return!0;return!1},_getKnownCEOrganizations:function(){var e=this._orgListObj;return Object.keys(e).map((function(t){return e[t]})).filter(this._shouldDisplay)},_shouldDisplay:function(e){var t=!$$WP.Utilities.UI.IsMobile||"1"===$$WPUtil.queryString("showDXROrgInMO");switch(e.HiddenFromMyChart){case I:case A:return!1}return!(!t&&e.LinkType&&e.LinkType===g)&&((!e.Accept||e.successLinked||e.HasForwardedLinks)&&!e.IsInvalidCeLink)},_isExternalLink:function(e){return e.H2GRemoteAuthLinkWorkflow==V||e.H2GRemoteAuthLinkWorkflow==Q},_getInProgressFhirOrganizations:function(){var e=this._inProgressListObj;return Object.keys(e).map((function(t){return e[t]})).filter(this._filterInProgressOrganizations)},_filterInProgressOrganizations:function(e){return!($$WP.Utilities.UI.IsMobile&&"1"!==$$WPUtil.queryString("showDXROrgInMO")&&e.LinkType&&e.LinkType===g)&&(e.LinkType!==d&&e.InProgressOrgNotSeen)},_handleQueryString:function(){var e;return""===(e=$$WPUtil.queryString("link"))?null:(this.removeQueryStringFromBrowser(),e)},_getUniqueNumber:(e=0,function getAndIncrement(){return e++}),_getAutoQueryCount:function(){var e=0;return this._autoQueryListObj&&"object"==typeof this._autoQueryListObj&&(e=Object.keys(this._autoQueryListObj).length),e},sortOrg:function(e,t){return e.IsMyChartCentral||t.IsMyChartCentral?e.IsMyChartCentral?-1:1:e.LinkType===t.LinkType||e.LinkType!==g&&t.LinkType!==g?e.ShowSignup!==t.ShowSignup?e.ShowSignup?-1:1:0:e.LinkType===g?-1:1},sortKnownOrg:function(e,t){return e.HasForwardedLinks!==t.HasForwardedLinks&&(e.HasForwardedLinks||t.HasForwardedLinks)?t.HasForwardedLinks?1:-1:e.ShouldDisableLink!==t.ShouldDisableLink?t.ShouldDisableLink?-1:1:"number"==typeof e.LinkType&&"number"==typeof t.LinkType?e.LinkType-t.LinkType:0},sortDXROrg:function(e,t){var i=new Date(e.LastAccessTokenDateTime),n=new Date(t.LastAccessTokenDateTime);if(i!==n){if(i>n)return 1;if(i<n)return-1}return 0},removeQueryStringFromBrowser:function Epic$PatientAccess$Controllers$CommunityController$removeQueryStringFromBrowser(){window.location.search.substring(1).length&&void 0!==window.history&&void 0!==window.history.pushState&&window.history.pushState({},document.title,window.location.pathname)},giveConsent:function WP$Community$CommunityController$giveConsent(){var e;this._isConsentNeeded=!1,(e=this).disableSubmit(),$afe.select("#show_consent").hide(),$$WPUtil.ShowAjaxSpinner($afe.select("#proxyConsentAlert .ajaxspinner")),$.ajax({url:makeLink("Community/Shared/QueryCommunityLinks"),type:"POST",cache:!1,data:{controllerType:e._Mode},error:e._errorGiveConsent,success:e._successGiveConsent})},_errorGiveConsent:function WP$Community$CommunityController$_errorGiveConsent(){$afe.select("#proxyConsentAlert").hide(),this.enableSubmit(this);var e=$$WP.Strings.get("ErrorOccurredText","Community.Manage"),t=$$WP.Strings.get("LoadOrgsErrorTitle","Community.Manage");this._displayErrorPopup(e,t)},_successGiveConsent:function WP$Community$CommunityController$_successGiveConsent(e){var t,i,n;var r=!1;if(e.OrgList&&Object.keys(e.OrgList).length>0)if(0===this._getKnownCEOrganizations().length)this._orgListObj=$.extend(this._orgListObj,e.OrgList),this._getKnownCEOrganizations().length>0&&(this._renderInsuranceOrganizations(),this._renderCentralOrganization(),this._renderKnownOrganizations(),r=!0);else for(i in $.extend(this._orgListObj,e.OrgList),e.OrgList)(t=e.OrgList[i]).uniqueId=this._getUniqueNumber(),t.StartExpanded=!0,t.ShowDismissOption=this._userCanSearch,t.CanCreateCELink||this._isExternalLink(t)?t.Type=q:t.Type=H,this._orgListObj[i]=t,this._shouldDisplay(t)&&($afe.select("#ceSpotlight").safeAppend($afe.renderTemplate($$WP.Templates.Community.DiscoverableOrganizationTop,t)),this._renderInsuranceOrganizations(),this._renderCentralOrganization(),this._renderKnownOrganizations(),r=!0);r?((n=this._spotlightOrganizations.filter((function(t){return void 0===e.OrgList[t.OrganizationId]}))).length<this._spotlightOrganizations.length&&(this._spotlightOrganizations=n,this._renderNearbyOrganizations()),$afe.select("#proxyConsentAlert").remove()):($afe.select("#proxyConsentAlert").text($$WP.Strings.get("NoOrganizationsFoundFromDemographicsSearch","Community.Shared")),$afe.select("#proxyConsentAlert").addClass("no-additional-orgs-found")),this.enableSubmit(this)},getLastOrganizationId:function WP$Community$CommunityController$getLastOrganizationId(){var e,t;return(e=$afe.select("div.organization")).length>0&&(t=e.last().safeAttr("id")),void 0!==t&&(t=t.slice(13)),t},clickConsentLink:function WP$Community$CommunityController$clickConsentLink(){$.proxy(this.giveConsent(),this)},updateImagePlaceholders:function WP$Community$CommunityController$updateImagePlaceholders(e){var t,i,n;for(t=$afe.jq(e).find(".org_col_logo img"),n=0;n<t.length;n++)(i=$afe.jq(t[n])).on("load",void i.addClass("icon")),i.safeAttr("src",i.data("url"))},handleMobileBackButton:function WP$Community$CommunityController$handleMobileBackButton(){"true"===$$WPUtil.queryString("backToPrevPage")?$$WPUtil.queryString("from")?$$WP.Utilities.TryRedirect(makeLink("inside.asp")+"?mode="+$$WPUtil.queryString("from")):window.history.back():this.closeWebView()},closeWebView:function WP$Community$CommunityController$closeWebView(){$$WP.Utilities.TryRedirect(makeLink("inside.asp?moworkflow=completeandclose"))},toLinkedTab:function WP$CommunityCommunityController$toLinkedTab(){showTabbedSection("tab_topic_linked"),window.scrollTo(0,0)},toDiscoverTab:function WP$CommunityCommunityController$toLinkedTab(){showTabbedSection("tab_topic_discover"),window.scrollTo(0,0)},scrollToSearchForMobile:function WP$CommunityCommunityController$scrollToSearchForMobile(){$afe.select("#orgSearch")[0].getBoundingClientRect().top/window.innerHeight>.33&&$("html, body").animate({scrollTop:$("#orgSearch").offset().top-.2*window.innerHeight},500)},unFocusSearchInput:function WP$CommunityCommunityController$unFocusSearchInput(e){"orgSearch"!==e.target.id&&"orgSearch"===document.activeElement.id&&$("#orgSearch").blur()},hideLoadingBanner:function WP$CommunityController$hideLoadingBanner(){$afe.select("#LoadingBanner").addClass("hidden")}};K.prototype=Y,$$WP.Community=$$WP.Community||{},$$WP.Community.CommunityController=K,K.extend($$WP.Controllers.Controller,"WP$Community$CommunityController")}(),$afe.select("body").on("click","[data-expand-button],[data-expand-clickable-row]",(function handleClick(e){toggleSection(e.currentTarget.dataset.expandButton||e.currentTarget.dataset.expandClickableRow),e.stopPropagation()}));;
/*! Copyright Epic Systems Corporation 2018 */
!function WP$Scheduling$Alert$definition(){var n={};n.AlertTypeEnum={SolutionIsOnMultipleDates:1,SolutionIsInMultipleLocations:2},$$WP.Scheduling=$$WP.Scheduling||{},$$WP.Scheduling.Alert=n}();;
/*! Copyright Epic Systems Corporation 2019 */
!function WP$Scheduling$AnonymousSettings$definition(){var e=$$WP.Common.ModelCollection,n=function WP$Scheduling$SchedulingOverride(e){this.WP$Common$Model(e)};n.prototype={s_dataMembers:["AdultWorkflowEnabled","ProxyWorkflowEnabled","SchedulingForSomeoneElse","DisableScheduleAsGuest"],AdultWorkflowEnabled:!1,ProxyWorkflowEnabled:!1,SchedulingForSomeoneElse:!1,DisableScheduleAsGuest:!1},n.createAnonymousSettingsCollection=function WP$Scheduling$AnonymousSettings$createAnonymousSettingsCollection(){return new e},$$WP.Scheduling=$$WP.Scheduling||{},$$WP.Scheduling.AnonymousSettings=n,n.extend($$WP.Common.Model,"WP$Scheduling$AnonymousSettings")}();;
!function WP$Scheduling$Appointment$definition(){var e={Default:0,StandardLqf:1,DepartmentOverrideLqf:2},t=function WP$Scheduling$Appointment(t){this.WP$Common$Model(t),this.Providers=$$WP.Scheduling.Provider.createProviderCollection(),this.TeamProviderDepartmentPairs=new $$WP.Common.ModelCollection,this.Locations=$$WP.Scheduling.Location.createLocationCollection(),this.Lqfs=new $$WP.Common.ModelCollection,this.VisitTypeSource=e.Default};t.prototype={s_dataMembers:["VisitType","VisitTypeSource","Providers","Locations","SchedulingOverride","Lqfs","OriginalVisitTypeId","IsLqfChainStopped","Orders","AppointmentRequestIds","AddToWaitList","SearchStartDte","SelectedTelehealthMode","HasTelehealthToggles","HasUsedTelehealthToggles","HasViewedTieredSchedulingOption","IsUsingTieredData","HasAlreadyLoadedTieredSchedulingSlots"],VisitType:null,VisitTypeSource:null,PanelId:"",BundleId:"",Providers:null,IsProviderAnyOptionSelected:!1,Locations:null,IsLocationAnyOptionSelected:!1,IsOnlyLocationAnyOptionSelected:!1,ProviderDepartmentPairs:[],Slot:null,SchedulingOverride:null,Lqfs:null,OriginalVisitTypeId:"",IsLqfChainStopped:!1,TicketId:"",AppointmentRequestIds:[],Orders:[],RescheduleDat:"",AddToWaitList:!1,SearchStartDte:"",SelectedTelehealthMode:null,HasTelehealthToggles:!1,HasUsedTelehealthToggles:!1,AccessCode:"",CanSkipLicensureCheck:!1,HasViewedTieredSchedulingOption:!1,IsUsingTieredData:!1,HasAlreadyLoadedTieredSchedulingSlots:!1,getSelectedDepartmentsCollection:function WP$Scheduling$Appointment$getSelectedDepartmentsCollection(){var e,t,i,l,s,n;for(i=$$WP.Scheduling.Department.createDepartmentsCollection(),l=this.Locations.toArray(),e=0;e<l.length;e++)for(s=l[e],t=0;t<s.Departments.length;t++)n=s.Departments[t],i.contains(n)||i.add(n);return i},isVideoVisit:function WP$Scheduling$Appointment$isVideoVisit(){var e=!1,t=this.SelectedTelehealthMode;return null!==this.VisitType&&(e=t&&0!==t?t===VisitType.TelehealthModeEnum.Video:!(this.VisitType.AllowedTelehealthModes&&this.VisitType.AllowedTelehealthModes.length>0)&&this.VisitType.isVideoVisit()),e},hasSwitchedVisitType:function WP$Scheduling$Appointment$hasSwitchedVisitType(){var e,t=0;if($$WPUtil.IsNullOrEmpty(this.Lqfs))return!1;for(e=this.Lqfs.Models,t=0;t<e.length;t++)if(!$$WPUtil.IsNullOrEmpty(e[t].Result)&&!$$WPUtil.IsNullOrEmpty(e[t].Result.VisitTypeId))return!0;return!1},isTelephoneVisit:function WP$Scheduling$Appointment$isTelephoneVisit(){var e=!1,t=this.SelectedTelehealthMode;return null!==this.VisitType&&(e=t&&0!==t?t===VisitType.TelehealthModeEnum.Telephone:!(this.VisitType.AllowedTelehealthModes&&this.VisitType.AllowedTelehealthModes.length>0)&&this.VisitType.isTelephoneVisit()),e},hasALocationSelected:function WP$Scheduling$Appointment$hasALocationSelected(){return this.Locations.size()>0},hasAValidLocation:function WP$Scheduling$Appointment$hasAValidLocation(){for(var e=this.Locations.toArray(),t=0;t<e.length;t++)if(!$$WP.Scheduling.Location.isLocationPlaceholder(e[t]))return!0;return!1},hasAProviderSelected:function WP$Scheduling$Appointment$hasAProviderSelected(){return this.Providers.size()>0},hasASlotSelected:function WP$Scheduling$Appointment$hasASlotSelected(){return!!this.Slot},hasASlotReserved:function WP$Scheduling$Appointment$hasASlotReserved(){return!!this.Slot&&(!$$WPUtil.IsNullOrEmpty(this.Slot.ReservationKey)||this.Slot.IsIneligibleForReservation)},setVisitTypeWithSource:function WP$Scheduling$Appointment$setVisitTypeWithSource(e,t,i){this.setProperty("VisitTypeSource",t),this.setProperty("PanelId",i),this.setProperty("VisitType",e)},clearProviderSelections:function WP$Scheduling$Appointment$clearProviderSelections(){this.Providers.empty(),this.setProperty("IsProviderAnyOptionSelected",!1)},clearLocationSelections:function WP$Scheduling$Appointment$clearLocationSelections(){this.Locations.empty(),this.setProperty("IsLocationAnyOptionSelected",!1),this.setProperty("IsOnlyLocationAnyOptionSelected",!1)},toRawRequestObject:function WP$Scheduling$Appointment$toRawRequestObject(){return{VisitTypeId:this.VisitType?this.VisitType.ID:null,PanelId:this.PanelId?this.PanelId:null,BundleId:this.BundleId?this.BundleId:null,RescheduleDat:this.RescheduleDat?this.RescheduleDat:null,TicketId:this.TicketId?this.TicketId:null,AppointmentRequestIds:this.AppointmentRequestIds,ProviderDepartmentPairs:this.__providerDepartmentPairsToRawRequestObject(),Slot:this.Slot?this.Slot.toRawRequestObject():"",OrderIds:this.ordersToRawRequestObject(this.Orders),LqfIds:this.SchedulingOverride?this.SchedulingOverride.LqfIds:[],PatientAnswerIds:this.SchedulingOverride?this.SchedulingOverride.HqaIds:[],OriginalVisitTypeId:this.OriginalVisitTypeId?this.OriginalVisitTypeId:null,AddToWaitList:!!this.AddToWaitList||null,SearchStartDte:this.SearchStartDte,SelectedTelehealthMode:this.SelectedTelehealthMode,HasTelehealthToggles:!!this.HasTelehealthToggles||null,HasUsedTelehealthToggles:!!this.HasUsedTelehealthToggles||null,AccessCode:this.AccessCode?this.AccessCode:null,CanSkipLicensureCheck:this.CanSkipLicensureCheck,InitialPoolLine:this.VisitType?this.VisitType.PoolLine:null,MaxPoolLine:this.VisitType?this.VisitType.MaxPoolLine:null,MaxPoolTier:this.VisitType?this.VisitType.MaxPoolTier:null}},__providerDepartmentPairsToRawRequestObject:function WP$Scheduling$Appointment$__providerDepartmentPairsToRawRequestObject(){for(var e=[],t=0;t<this.ProviderDepartmentPairs.length;t++)e.push(this.ProviderDepartmentPairs[t].toRawRequestObject());return e},ordersToRawRequestObject:function WP$Scheduling$Appointment$ordersToRawRequestObject(e){for(var t=[],i=0;i<e.length;i++)t.push(e[i].ID);return t},isAppointmentInPerson:function WP$Scheduling$Appointment$isAppointmentInPerson(){var e=this.VisitType;return $$WPUtil.IsNullOrEmpty(this.SelectedTelehealthMode)&&!$$WPUtil.IsNullOrEmpty(e)&&e.isInPerson()||!$$WPUtil.IsNullOrEmpty(this.SelectedTelehealthMode)&&VisitType.isInPersonTelehealthMode(this.SelectedTelehealthMode)},getAllowedTelehealthModes:function WP$Scheduling$Appointment$getAllowedTelehealthModes(){var e,t=[];return null===this.VisitType?[]:(t=this.VisitType.AllowedTelehealthModes,!this.isVideoDisabledForAllProvDeptPairs()||$$WPUtil.IsNullOrEmpty(t)||(e=t.indexOf(VisitType.TelehealthModeEnum.Video))>-1&&t.splice(e,1),t)},isVideoDisabledForAllProvDeptPairs:function WP$Scheduling$Appointment$isVideoDisabledForAllProvDeptPairs(){var e,t=this.ReasonForVisit,i=null;if(!$$WPUtil.IsNullOrEmpty(t)&&(i=t.DirectProviderDepartmentPairs,!$$WPUtil.IsNullOrEmpty(i)))for(e=0;e<i.length;e++)if(i[e].CanScheduleTelemedicine)return!1;return!0},initializeTelehealthModeFromVisitType:function WP$Scheduling$Appointment$initializeTelehealthModeFromVisitType(){var e,t=0;if(this.VisitType)if(this.setProperty("HasUsedTelehealthToggles",!1),e=this.VisitType.AllowedTelehealthModes,this.isVideoDisabledForAllProvDeptPairs()&&this.VisitType.DefaultTelehealthMode===VisitType.TelehealthModeEnum.Video){if(e.length>0)for(t=0;t<e.length;t++)if(e[t]!==VisitType.TelehealthModeEnum.Video)return void this.setProperty("SelectedTelehealthMode",e[t])}else this.setProperty("SelectedTelehealthMode",this.VisitType.DefaultTelehealthMode)},trySetTelehealthMode:function WP$Scheduling$Appointment$trySetTelehealthMode(e,t){$$WPUtil.IsNullOrEmpty(e)||this.getAllowedTelehealthModes().indexOf(e)>-1&&(this.setProperty("SelectedTelehealthMode",e),t&&this.setProperty("HasUsedTelehealthToggles",!0))},getAppointmentDisplayName:function WP$Scheduling$Appointment$getAppointmentDisplayName(){var e;return $$WPUtil.IsNullOrEmpty(this.VisitType)?"":(e=this.VisitType.TelehealthModeDisplayNames[this.SelectedTelehealthMode],$$WPUtil.IsNullOrEmpty(e)?this.VisitType.DisplayName:e)},areLocationsGrouped:function WP$Scheduling$Appointment$areLocationsGrouped(){var e=this.Locations.toArray()[0];return!!e&&!e.IsSingleDepartment}},t.VisitTypeSourceEnum=e,$$WP.Scheduling=$$WP.Scheduling||{},$$WP.Scheduling.Appointment=t,t.extend($$WP.Common.Model,"WP$Scheduling$Appointment")}();;
!function WP$Scheduling$AppointmentBuilder$definition(){var t=$$WP.Scheduling.Appointment,e={NotDefined:0,SameDay:1,Earliest:2},n=function WP$Scheduling$AppointmentBuilder(t){this.WP$Common$Model(t),this.Appointments=new $$WP.Common.ModelCollection(null,["VisitType","IsUsingTieredData"]),this.Appointments.add(new $$WP.Scheduling.Appointment),this.SearchPriority=e.NotDefined},o={s_dataMembers:["ReasonForVisit","Specialty","Appointments","UseInsuranceForVisit","UseTeams","OnDemandReasonForVisitValue","SchedulingComments","PatientLocation","PatientSublocation","TopicIds","SchedGrouperIds","TicketName","RelatedAppointments","PatientInstruction","HasFutureAppointment","DidUseProviderFilters","DidUsePatientAgeFilter","CompletedInsuranceVerificationStep","CompletedDemographicVerificationStep","OnDemandReasonForVisitLine","IsLoadingTieredData","ReplacedAllOriginalProviders","SearchPriority"],ReasonForVisit:null,Specialty:null,Appointments:null,UseInsuranceForVisit:"",UseTeams:!1,OnDemandReasonForVisitValue:"",OnDemandReasonForVisitLine:"",PatientLocation:null,PatientSublocation:null,CampaignId:"",TopicIds:"",SchedGrouperIds:null,LinkSource:"",ReferringPage:"",SchedulingComments:"",RequestReason:"",RescheduleReason:"",SaveAsFavorite:!1,AreProvidersFilteredBySlotStep:!1,TicketName:"",RelatedAppointments:null,PatientInstruction:"",HasFutureAppointment:!1,GeolocationFilterMethod:null,DidContinueFromSoftStop:!1,DidRequestFromHardStop:!1,CountOfFailedAttemptsToReviewSlot:null,IsUsingProviderDropdown:!1,IsSlotSelectionBlocked:!1,HasConfirmedPatientLocation:!1,CanSearchAllLicensedVideoProviders:!1,CanSkipPatientLocationStep:!1,CanUpdateAvailableProviders:!1,DidUseProviderFilters:!1,DidUsePatientAgeFilter:!1,IsSlotStepMultiApptPreGrouped:!1,AvailableLocations:null,DidIncludeAdditionalProvidersInSearch:!1,DidScheduleWithAddedProvider:!1,OriginallySelectedProviders:null,CompletedInsuranceVerificationStep:!1,CompletedDemographicVerificationStep:!1,HasFatalGeolocationError:!1,UserEnteredZip:"",UserEnteredZipCoordinates:{},IsPersonalInfoCollectionComplete:!1,IsInsuranceCollectionComplete:!1,HasDuplicateRecord:!1,TermIds:[],ClientIANATimeZone:Intl.DateTimeFormat().resolvedOptions().timeZone,HasPendingDecisionTree:!1,IsPatientLocationRuleRunning:!1,RequestPreferences:null,HasResetLocations:!1,ChiefComplaintId:"",ChiefComplaintName:"",HasResetProviders:!1,IsLoadingTieredData:!1,ReplacedAllOriginalProviders:!1,SearchPriority:e.NotDefined,OriginalReasonForVisit:null,numAppointments:function WP$Scheduling$AppointmentBuilder$numAppointments(){return this.Appointments.size()},getAppointment:function WP$Scheduling$AppointmentBuilder$getAppointment(t){return this.Appointments.Models[t]},getFirstAppointment:function WP$Scheduling$AppointmentBuilder$getFirstAppointment(){return this.getAppointment(this.getFirstAppointmentIndex())},getFirstAppointmentIndex:function WP$Scheduling$AppointmentBuilder$getFirstAppointmentIndex(){var t=this.__getAppointmentSlotsArray(),e=null,n=0,i=-1;if(0===t.length)i=0;else for(t.sort($$WP.Scheduling.Slot.slotSortFunction),n=0;n<this.numAppointments();n++)e=this.getAppointment(n),t[0]===e.Slot&&(i=n);return i},getFirstApptWithUnselectedSlot:function WP$Scheduling$AppointmentBuilder$getFirstApptWithUnselectedSlot(){var t=null,e=this.getActiveApptIndex();return null===e||(t=this.getAppointment(e)).Slot?null:t},getActiveApptIndex:function WP$Scheduling$AppointmentBuilder$getActiveApptIndex(){var t=null,e=0;for(e=0;e<this.numAppointments();e++)if(!(t=this.getAppointment(e)).Slot||!1===t.Slot.IsApptSrchHeld)return e;return e>0&&(e-=1),e},getBundleID:function WP$Scheduling$AppointmentBuilder$getBundleID(){var t=null,e=0;for(e=0;e<this.numAppointments();e++)if(null!==(t=this.getAppointment(e)).BundleId)return t.BundleId;return null},getTotalLengthInMinutes:function WP$Scheduling$AppointmentBuilder$getTotalLengthInMinutes(){var t=0,e=this.getFirstAppointment(),n=null,i=null,o=null,l=0,s=[],r=null;if(1===this.numAppointments())e.Slot&&(t=e.Slot.LengthInMinutes);else{for(n=e.Slot.DateTimeUtc,s=this.__getAppointmentSlotsArray(),l=0;l<s.length;l++)r=s[l],(i=new Date(r.DateTimeUtc.getTime())).setMinutes(i.getMinutes()+r.LengthInMinutes),(null===o||i>o)&&(o=i);null!==n&&null!==o&&(t=Math.floor((o-n)/6e4))}return t},showAsMultipleVisits:function WP$Scheduling$AppointmentBuilder$showAsMultipleVisits(t){var e=!1,n=null,i="",o="",l=null;return this.numAppointments()<2?e=!1:(i=(n=this.getAppointment(0)).PanelId,o=n.BundleId,$$WPUtil.IsNullOrEmpty(i)?e=!!$$WPUtil.IsNullOrEmpty(o)||this.__showMultiVisitAsMultipleVisits():(l=t.getFromIndex("ID",i),e=this.__showMultiVisitAsMultipleVisits(l))),e},__showMultiVisitAsMultipleVisits:function WP$Scheduling$AppointmentBuilder$__showMultiVisitAsMultipleVisits(t){var e,n=this.__getAppointmentSlotsArray(),i=$$WP.Scheduling.Slot.areAllSlotsOnTheSameDay(n);return t&&(e=t.ShowPanelAsMultipleVisits),e||!i},__getAppointmentSlotsArray:function WP$Scheduling$AppointmentBuilder$__getAppointmentSlotsArray(){var t=[],e=null,n=0;for(n=0;n<this.numAppointments();n++)(e=this.getAppointment(n).Slot)&&t.push(e);return t},allAppointmentsHaveAVisitTypeSpecified:function WP$Scheduling$AppointmentBuilder$allAppointmentsHaveAVisitTypeSpecified(){var t=0,e=!0;for(t=0;t<this.numAppointments();t++)e=e&&!!this.getAppointment(t).VisitType;return e},allAppointmentsHaveALocationSelected:function WP$Scheduling$AppointmentBuilder$allAppointmentsHaveALocationSelected(){var t=0,e=!0;for(t=0;t<this.numAppointments();t++)e=e&&this.getAppointment(t).hasALocationSelected();return e},allAppointmentsHaveAProviderSelected:function WP$Scheduling$AppointmentBuilder$allAppointmentsHaveAProviderSelected(){var t=0,e=!0;for(t=0;t<this.numAppointments();t++)e=e&&this.getAppointment(t).hasAProviderSelected();return e},allAppointmentsHaveASlotSelected:function WP$Scheduling$AppointmentBuilder$allAppointmentsHaveASlotSelected(){var t=0,e=!0;for(t=0;t<this.numAppointments();t++)e=e&&this.getAppointment(t).hasASlotSelected();return e},allAppointmentsHaveASlotReserved:function WP$Scheduling$AppointmentBuilder$allAppointmentsHaveASlotReserved(){var t=0,e=!0;for(t=0;t<this.numAppointments();t++)e=e&&this.getAppointment(t).hasASlotReserved();return e},deselectSlotAndAllFollowingSlots:function WP$Scheduling$AppointmentBuilder$deselectSlotAndAllFollowingSlots(t){var e=0;for(e=t;e<this.numAppointments();e++)this.deselectAppointmentSlot(e)},deselectAllSlots:function WP$Scheduling$AppointmentBuilder$deselectAllSlots(){var t=0,e=this.numAppointments();for(t=0;t<e;t++)this.deselectAppointmentSlot(t),t>1&&(this.getAppointment(t).IsUsingTieredData=!1)},deselectAppointmentSlot:function WP$Scheduling$AppointmentBuilder$deselectAppointmentSlot(t){var e=null;(e=this.getAppointment(t)).Slot&&e.setProperty("Slot",null)},unholdSelectedSlots:function WP$Scheduling$AppointmentBuilder$unholdSelectedSlots(){this.__setSelectedSlotsAsHeld(!1)},holdSelectedSlots:function WP$Scheduling$AppointmentBuilder$holdSelectedSlots(){this.__setSelectedSlotsAsHeld(!0)},hasMultipleInPersonLocations:function WP$Scheduling$AppointmentBuilder$hasMultipleInPersonLocations(){for(i=0;i<this.Appointments.Models.length;i++)if(appointment=this.getAppointment(i),appointmentVisitType=appointment.VisitType,appointmentVisitType&&appointment.isAppointmentInPerson()&&this.AvailableLocations[i].length>1)return!0;return!1},hasAppointmentThatAllowsProviderSelection:function WP$Scheduling$AppointmentBuilder$hasMultipleInPersonLocations(){var t=this.numAppointments();for(i=0;i<t;i++)if(appointment=this.getAppointment(i),$$WP.Scheduling.Workflow.allowProviderSelectForAppointment(this,appointment))return!0;return!1},__setSelectedSlotsAsHeld:function WP$Scheduling$AppointmentBuilder$__setSelectedSlotsAsHeld(t){var e=null,n=0;for(n=0;n<this.numAppointments();n++)null!==(e=this.getAppointment(n)).Slot&&(e.Slot.IsApptSrchHeld=t)},setTelehealthModesForSelectedSlots:function WP$Scheduling$AppointmentBuilder$setTelehealthModesForSelectedSlots(){var t=null,e=0;for(e=0;e<this.numAppointments();e++)null!==(t=this.getAppointment(e)).Slot&&t.setProperty("SelectedTelehealthMode",t.Slot.TelehealthMode)},isContainingSelectedSlots:function WP$Scheduling$AppointmentBuilder$isContainingSelectedSlots(){var t=0;for(t=0;t<this.numAppointments();t++)if(null!==this.getAppointment(t).Slot)return!0;return!1},updateAppointmentsCollectionForReasonForVisit:function WP$Scheduling$AppointmentBuilder$updateAppointmentsCollectionForReasonForVisit(t,e,n,i){this.Appointments.openChangeBatch(),this.__populateAppointmentsCollectionFromReasonForVisit(t,e),this.__applyWorkflowFlagsToAppointments(n),this.Appointments.closeChangeBatch();var o=!!t&&t.IsOtherRfv;n&&i&&!this.HasPendingDecisionTree&&!o&&this.evaluatePatientLocationRule(n)},recalculateDepartmentGrouperAddresses:function WP$Scheduling$AppointmentBuilder$recalculateDepartmentGrouperAddresses(t){var e=0,n=0;for(n=0;n<this.AvailableLocations.length;n++)for(e=0;e<this.AvailableLocations[n].length;e++){var i=this.AvailableLocations[n][e];i.Address=$$WP.Scheduling.Location.getLocationAddressFromDepartments(i,t)}},__populateAppointmentsCollectionFromReasonForVisit:function WP$Scheduling$AppointmentBuilder$__populateAppointmentsCollectionFromReasonForVisit(t,e){var n,i=0,o=0,l=null,s=null,r=null;if((n=t.DefaultVisitType)&&t.IsMultipleAppointments)for(i=t.ApptComponents.length,o=0;o<i;o++)s=(l=t.ApptComponents[o]).DefaultVisitType,o===this.numAppointments()&&this.Appointments.add(new $$WP.Scheduling.Appointment),(r=this.getAppointment(o)).setVisitTypeWithSource(s,e,n.ID),r.ReasonForVisit=l,r.AccessCode=t.AccessCode,r.initializeTelehealthModeFromVisitType();else i=1,(r=this.getAppointment(0)).setVisitTypeWithSource(n,e,""),r.ReasonForVisit=t,r.AccessCode=t.AccessCode,r.initializeTelehealthModeFromVisitType();this.__trimAppointments(i),this.__populateHasTelehealthToggles()},evaluatePatientLocationRule:function WP$Scheduling$AppointmentBuilder$evaluatePatientLocationRule(t){var e,n={};for(e=0;e<this.numAppointments();e++)this.getAppointment(e).setProperty("CanSkipLicensureCheck",!1);this.setProperty("IsPatientLocationRuleRunning",!0),n.workflow=t.toRawRequestObject(),n.appointmentBuilder=this.toRawRequestObject(),$.ajax({url:makeLink($$WPSchedulingUtil.GetEndpointUrl("EvaluatePatientLocationRule",t)),type:"POST",context:this,data:$$WPUtil.postify(n),success:this.__onPatientLocationRuleResultReceived})},__onPatientLocationRuleResultReceived:function WP$Scheduling$AppointmentBuilder$__onPatientLocationRuleResultReceived(t){var e;if(!$$WPUtil.IsNullOrEmpty(t.CanSkipLicensureCheckForApptIndex)){for(e=0;e<this.numAppointments();e++)this.getAppointment(e).setProperty("CanSkipLicensureCheck",t.CanSkipLicensureCheckForApptIndex[e]);this.canSkipLicensureForAllVideoVisits()&&this.setProperty("CanSkipPatientLocationStep",!0)}this.setProperty("IsPatientLocationRuleRunning",!1)},canSkipLicensureForAllVideoVisits:function WP$Scheduling$AppointmentBuilder$canSkipLicensureForAllVideoVisits(){var t,e;for(e=0;e<this.numAppointments();e++)if((t=this.getAppointment(e)).isVideoVisit()&&!t.CanSkipLicensureCheck)return!1;return!0},__trimAppointments:function WP$Scheduling$AppointmentBuilder$__trimAppointments(t){var e=[],n=0;if(this.numAppointments()>t){for(n=t;n<this.numAppointments();n++)e.push(this.getAppointment(n));this.Appointments.removeRange(e)}},__populateHasTelehealthToggles:function WP$Scheduling$AppointmentBuilder$__populateHasTelehealthToggles(){var t=null,e=null,n=this.numAppointments();this.IsSlotStepMultiApptPreGrouped&&(t=this.__getIntersectionOfMultiApptTelehealthModes());for(var i=0;i<n;i++)e=this.getAppointment(i),this.IsSlotStepMultiApptPreGrouped||(t=e.getAllowedTelehealthModes()),null!==t?e.setProperty("HasTelehealthToggles",t.length>1):e.setProperty("HasTelehealthToggles",!1)},__applyWorkflowFlagsToAppointments:function WP$Scheduling$AppointmentBuilder$__applyWorkflowFlagsToAppointments(t){var e=0,n=null,i="",o=!1,l=null;if(t)for($$WPUtil.IsNullOrEmpty(t.SchedulingControllerParams.mode)?$$WPUtil.IsNullOrEmpty(t.SchedulingControllerParams.slotuid)||(preselectedSlot=$$WP.Scheduling.Solution.createSolutionFromUid(t.SchedulingControllerParams.slotuid).Slots[0],preselectedSlot&&(i=preselectedSlot.TelehealthMode)):(i=parseInt(t.SchedulingControllerParams.mode,10),o="1"===t.SchedulingControllerParams.ismodeused),e=0;e<this.numAppointments();e++)switch((n=this.getAppointment(e)).trySetTelehealthMode(i,o),t.Type){case $$WP.Scheduling.Workflow.WorkflowTypesEnum.DecisionTreeNode:n.SchedulingOverride=$$WP.Scheduling.SchedulingOverride.getDecisionTreeNodeWorkflowOverride(t.SchedulingDataPool.SchedulingOverrides,t.DecisionTreeNodeId,t.DecisionTreeNodeCsn);break;case $$WP.Scheduling.Workflow.WorkflowTypesEnum.Ticket:n.TicketId=t.TicketInfo.TicketId,t.TicketInfo.BundleId&&(n.PanelId="",n.BundleId=t.TicketInfo.BundleId),n.AppointmentRequestIds=n.ReasonForVisit.AppointmentRequestIds,n.Orders=t.TicketInfo.Orders,$$WPUtil.IsNullOrEmpty(t.TicketInfo.RelatedAppointments)||(this.TicketName=t.TicketInfo.DisplayName,this.RelatedAppointments=t.TicketInfo.RelatedAppointments,this.HasFutureAppointment=t.TicketInfo.HasFutureAppointment,this.PatientInstruction=t.TicketInfo.PatientInstruction);break;case $$WP.Scheduling.Workflow.WorkflowTypesEnum.Reschedule:$$WPUtil.IsNullOrEmpty(t.OriginalAppointmentInfo.BundleId)||(n.PanelId="",n.BundleId=t.OriginalAppointmentInfo.BundleId,0!==n.ReasonForVisit.AppointmentRequestIds.length&&(n.AppointmentRequestIds=n.ReasonForVisit.AppointmentRequestIds)),l=this.getOriginalAppointment(n,t.OriginalAppointmentInfo),n.RescheduleDat=l.Dat,$$WPUtil.IsNullOrEmpty(l.RelatedAppointments)||(this.TicketName=l.TicketName,this.RelatedAppointments=l.RelatedAppointments,this.HasFutureAppointment=l.HasFutureAppointment,this.PatientInstruction=l.PatientInstruction)}},getOriginalAppointment:function WP$Scheduling$AppointmentBuilder$getOriginalAppointment(t,e){var n=null;return e&&(t.AppointmentRequestIds.length>0&&(n=this.__getOriginalApptFromRequests(t,e.OriginalAppointments)),n||(n=this.__getOriginalAppointmentFromDat(e.Dat,e.OriginalAppointments))),n},__getOriginalApptFromRequests:function WP$Scheduling$AppointmentBuilder$__getOriginalApptFromRequests(t,e){for(var n=null,i=0;i<e.length;i++)if(n=e[i],$$WPSchedulingUtil.DoAllArraysContainTheSameValues([n.AppointmentRequestIds,t.AppointmentRequestIds]))return n;return null},__getOriginalAppointmentFromDat:function WP$Scheduling$AppointmentBuilder$__getOriginalAppointmentFromDat(t,e){var n=0;for(n=0;n<e.length;n++)if(e[n].Dat===t)return e[n];return null},resetAppointmentsCollection:function WP$Scheduling$AppointmentBuilder$resetAppointmentCollection(){var e=0,n=this.Appointments.toArray(),i=[],o=null;for(e=0;e<n.length;e++)(o=n[e]).setProperty("VisitType",null),o.setProperty("VisitTypeSource",t.VisitTypeSourceEnum.Default),e>0&&i.push(o);this.Appointments.removeRange(i),this.setProperty("SchedGrouperIds",null)},toRawRequestObject:function WP$Scheduling$AppointmentBuilder$toRawRequestObject(){var t=null;return this.ReasonForVisit&&(t=this.ReasonForVisit.Id,$$WPUtil.IsNullOrEmpty(this.ReasonForVisit.LineInWDF15000)||(t=this.ReasonForVisit.LineInWDF15000)),{Appointments:this.__appointmentsToRawRequestObject(),ReasonForVisitLine:t,ReasonForVisitValue:this.ReasonForVisit?this.ReasonForVisit.CategoryValue:null,ReasonForVisitAllowProviderSelection:this.ReasonForVisit?this.ReasonForVisit.AllowProviderSelect:null,UseInsuranceForVisit:this.UseInsuranceForVisit,OnDemandReasonForVisitValue:this.OnDemandReasonForVisitValue?this.OnDemandReasonForVisitValue:null,OnDemandReasonForVisitLine:this.OnDemandReasonForVisitLine?this.OnDemandReasonForVisitLine:null,PatientLocationId:this.__canSendPatientLocation()?this.PatientLocation.Id:null,PatientSublocationId:this.__canSendPatientSublocation()?this.PatientSublocation.Id:null,CampaignId:this.CampaignId?this.CampaignId:null,TopicIds:this.TopicIds&&this.TopicIds.length>0?this.TopicIds:null,SchedGrouperIds:this.SchedGrouperIds?this.SchedGrouperIds:null,LinkSource:$$WPSchedulingUtil.NullifyIfFalsy(this.LinkSource),ReferringPage:$$WPSchedulingUtil.NullifyIfFalsy(this.ReferringPage),TermIds:this.TermIds&&this.TermIds.length>0?this.TermIds:null,SchedulingComments:this.SchedulingComments?this.SchedulingComments:null,RescheduleReason:this.RescheduleReason?this.RescheduleReason:null,RequestReason:this.RequestReason?this.RequestReason:null,SaveAsFavorite:!!this.SaveAsFavorite||null,SpecialtyId:this.Specialty?this.Specialty.Id:null,DidContinueFromSoftStop:!!this.DidContinueFromSoftStop||null,DidRequestFromHardStop:!!this.DidRequestFromHardStop||null,SchedulingPhone:this.getSchedulingPhone(),DidUseProviderFilters:!!this.DidUseProviderFilters||null,DidUsePatientAgeFilter:!!this.DidUsePatientAgeFilter||null,DidIncludeAdditionalProvidersInSearch:!!this.DidIncludeAdditionalProvidersInSearch||null,DidScheduleWithAddedProvider:!!this.DidScheduleWithAddedProvider||null,CompletedInsuranceVerificationStep:!!this.CompletedInsuranceVerificationStep||null,CompletedDemographicVerificationStep:!!this.CompletedDemographicVerificationStep||null,ClientIANATimeZone:this.ClientIANATimeZone?this.ClientIANATimeZone:null,RequestPreferences:$$WPSchedulingUtil.NullifyIfFalsy(this.RequestPreferences),ChiefComplaintId:this.ChiefComplaintId?this.ChiefComplaintId:null,ChiefComplaintName:this.ChiefComplaintName?this.ChiefComplaintName:null,SearchPriority:this.SearchPriority?this.SearchPriority:null}},__canSendPatientLocation:function WP$Scheduling$AppointmentBuilder$__canSendPatientLocation(){return!!this.PatientLocation&&this.__canSendPatientLocationOrSublocation()},__canSendPatientLocationOrSublocation:function WP$Scheduling$AppointmentBuilder$__canSendPatientLocationorSublocation(){return!$$WPUtil.IsNullOrEmpty(this.OnDemandReasonForVisitValue)||!this.canSkipLicensureForAllVideoVisits()&&(this.hasVideoVisit()&&this.hasProvidersWithTelehealthLocations())},__canSendPatientSublocation:function WP$Scheduling$AppointmentBuilder$__canSendPatientSublocation(){return!!this.PatientSublocation&&this.__canSendPatientLocationOrSublocation()},hasVideoVisit:function WP$Scheduling$AppointmentBuilder$hasVideoVisit(){for(var t=0;t<this.numAppointments();t++)if(this.getAppointment(t).isVideoVisit())return!0;return!1},hasVirtualVisit:function WP$Scheduling$AppointmentBuilder$hasVirtualVisit(){for(var t=0;t<this.numAppointments();t++)if(!this.getAppointment(t).isAppointmentInPerson())return!0;return!1},hasVideoVisitLicensedProviders:function WP$Scheduling$AppointmentBuilder$hasVideoVisitLicensedProviders(){for(var t=!0,e=null,n=0;n<this.numAppointments();n++)(e=this.getAppointment(n)).isVideoVisit()&&(t=t&&!!this.PatientLocation&&$$WP.Scheduling.TelehealthFilters.HasAtLeastOnePairLicensedInLocation(e.ProviderDepartmentPairs,this.PatientLocation,this.PatientSublocation));return t},hasProvidersWithTelehealthLocations:function WP$Scheduling$AppointmentBuilder$hasProvidersWithTelehealthLocations(){var t=0;if(!this.getReasonForVisit())return!1;if(this.ReasonForVisit.IsMultipleAppointments){if(this.IsSlotStepMultiApptPreGrouped){for(t=0;t<this.ReasonForVisit.ApptComponents.length;t++)if(this.ReasonForVisit.ApptComponents[t].hasProvidersWithTelehealthLocations())return!0}else if(t=this.getActiveApptIndex(),this.ReasonForVisit.ApptComponents[t].hasProvidersWithTelehealthLocations())return!0;return!1}return this.ReasonForVisit.hasProvidersWithTelehealthLocations()},getSchedulingPhone:function WP$Scheduling$SlotStepController$getSchedulingPhone(){var t;try{t=this.getFirstAppointment().ProviderDepartmentPairs[0].Department}catch(e){t=null}return t?t.PhoneNumber:null},toSparseRawRequestObject:function WP$Scheduling$SlotStepController$toSparseRawRequestObject(){var t=this.toRawRequestObject(),e=null,n=null;return t.Appointments.forEach((function(t){e=t.Slot.ProviderId,n=t.Slot.DepartmentId;var i=[];t.ProviderDepartmentPairs.forEach((function(o,l){o.ProviderId===e&&o.DepartmentId===n&&i.push(t.ProviderDepartmentPairs[l])})),t.ProviderDepartmentPairs=i})),t},__appointmentsToRawRequestObject:function WP$Scheduling$AppointmentBuilder$__appointmentsToRawRequestObject(){for(var t=this.Appointments.toArray(),e=[],n=0;n<t.length;n++)e.push(t[n].toRawRequestObject());return e},getReasonForVisit:function WP$Scheduling$AppointmentBuilder$getReasonForVisit(){return this.ReasonForVisit},getSpecialty:function WP$Scheduling$AppointmentBuilder$getSpecialty(){return this.Specialty},getAppointmentProviders:function WP$Scheduling$AppointmentBuilder$getAppointmentProviders(t){return this.getAppointment(t).Providers.Models},getAppointmentLocations:function WP$Scheduling$AppointmentBuilder$getAppointmentLocations(t){return this.getAppointment(t).Locations.Models},getAppointmentLqfs:function WP$Scheduling$AppointmentBuilder$getAppointmentLqfs(t){return this.getAppointment(t).Lqfs.Models},getAppointmentSlots:function WP$Scheduling$AppointmentBuilder$getAppointmentSlots(t){var e,n=[];return(e=this.getAppointment(t)).Slot&&n.push(e.Slot),n},getBundleId:function WP$Scheduling$AppointmentBuilder$getBundleId(t){var e;return null===(e=this.getAppointment(t))?null:e.BundleId},isSelectedTelehealthModeSameForAppts:function WP$Scheduling$AppointmentBuilder$isSelectedTelehealthModeSameForAppts(){var t=0,e=0,n=0;for(this.numAppointments()>0&&0===(e=this.getFirstAppointment().SelectedTelehealthMode)&&(e=1),t=0;t<this.numAppointments();t++)if(0===(n=this.getAppointment(t).SelectedTelehealthMode)&&(n=1),e!==n)return!1;return!0},getAllowedTelehealthModes:function WP$Scheduling$AppointmentBuilder$getAllowedTelehealthModes(){var t=[],e=0;return this.numAppointments()>0&&(this.IsSlotStepMultiApptPreGrouped?t=this.__getIntersectionOfMultiApptTelehealthModes():(e=this.getActiveApptIndex(),t=this.getAppointment(e).getAllowedTelehealthModes())),t},__getIntersectionOfMultiApptTelehealthModes:function WP$Scheduling$AppointmentBuilder$__getIntersectionOfMultiApptTelehealthModes(){var t,e,n=this.numAppointments(),i=[];for(e=0;e<n;e++)t=this.getAppointment(e),i.push(t.getAllowedTelehealthModes());return $$WPSchedulingUtil.GetIntersectionOfArrays(i)},getDefaultTelehealthMode:function WP$Scheduling$AppointmentBuilder$getDefaultTelehealthMode(){var t,e,i,o=this.numAppointments();if(0!==o){if(i=this.getActiveApptIndex(),t=this.getAppointment(i).VisitType.DefaultTelehealthMode,n.IsSlotStepMultiApptPreGrouped())for(e=0;e<o;e++)if(t!==this.getAppointment(e).VisitType.DefaultTelehealthMode){t=null;break}return t}},__getAppointmentAvailableDepartmentIds:function WP$Scheduling$AppointmentBuilder$__getAppointmentAvailableDepartmentIds(t){return this.AvailableLocations[t].flatMap((function(t){return t.DepartmentIds}))},getSchedulingInstructions:function WP$Scheduling$AppointmentBuilder$getSchedulingInstructions(t,e){var n,i=[],o=null,l=0,s=null,r=[],p=[],u=!1;for(o=this.PatientInstruction,$$WPUtil.IsNullOrEmpty(o)||(o=o.replace(/(\r\n|\r|\n)/g,"<br>"),i.push(o)),n=this.numAppointments(),l=0;l<n;l++)n>1&&(u=!0),s=this.getAppointment(l),$$WPUtil.IsNullOrEmpty(s.PanelId)?selectedVisitType=s.VisitType:selectedVisitType=t.getFromIndex("ID",s.PanelId),this.__getApptSchedulingInstructions(s,selectedVisitType,u,i,r,p,e);return i},__getApptSchedulingInstructions:function WP$Scheduling$AppointmentBuilder$__getApptSchedulingInstructions(t,e,n,i,o,l,s){var r=null,p="",u=t.SelectedTelehealthMode;!0===n&&(p=$$WPSchedulingUtil.GetVisitDisplayName(t,s.TicketInfo,u)),$$WPUtil.IsNullOrEmpty(e.SchedulingInstructions)||0!==e.SchedulingInstructions.join("").length&&-1===o.indexOf(e)&&(i.length>0&&i.push(""),!0===n&$$WPUtil.IsNullOrEmpty(t.PanelId)&&(i.push(p+":"),n=!1),i.push.apply(i,e.SchedulingInstructions),o.push(e)),t.Lqfs.size()>0&&(r=t.Lqfs.toArray()[t.Lqfs.toArray().length-1])&&r.Result&&!$$WPUtil.IsNullOrEmpty(r.Result.Instructions)&&-1===l.indexOf(r)&&(i.length>0&&i.push(""),!0===n&$$WPUtil.IsNullOrEmpty(t.PanelId)&&(i.push(p+":"),n=!1),i.push(r.Result.Instructions),l.push(r)),s.TicketInfo&&s.TicketInfo.AppointmentRequests&&s.TicketInfo.AppointmentRequests.length>0&&!$$WPUtil.IsNullOrEmpty(s.TicketInfo.AppointmentRequests[0].OrderLqfInstructionsHtml)&&(i.length>0&&i.push(""),!0===n&$$WPUtil.IsNullOrEmpty(t.PanelId)&&(i.push(p+":"),n=!1),i.push(s.TicketInfo.AppointmentRequests[0].OrderLqfInstructionsHtml))},hasAllSameSingleLocationSelected:function WP$Scheduling$AppointmentBuilder$hasAllSameSingleLocationSelected(){var t=null,e=[],n=null,i=null,o=0;for(o=0;o<this.numAppointments();o++){if((e=(i=this.getAppointment(o)).Locations.toArray()).length<1)return!1;if(t=t?n:e[0],n=e[0],e.length>1||n.Id!==t.Id)return!1;if(i.VisitType.isVideoVisit())return!1}return!0},hasAllSameSlotDepartmentsSelected:function WP$Scheduling$AppointmentBuilder$hasAllSameSlotDepartmentsSelected(){var t=null,e=null,n=null,i=null,o=0;for(o=0;o<this.numAppointments();o++){if(null===(e=(i=this.getAppointment(o)).Slot?i.Slot.DepartmentId:null))return!1;if(t=t?n:e,(n=e)!==t)return!1}return!0}};n.prototype=o,n.SearchPriorityEnum=e,$$WP.Scheduling=$$WP.Scheduling||{},$$WP.Scheduling.AppointmentBuilder=n,n.extend($$WP.Common.Model,"WP$Scheduling$AppointmentBuilder")}();;
!function WP$Geo$Coordinates$definition(){var o=function WP$Geo$Coordinates(o){this.WP$Common$Model(o)};o.prototype={s_dataMembers:["Latitude","Longitude"],Latitude:null,Longitude:null,areCoordinatesValid:function areCoordinatesValid(){return!(!this.Latitude||!this.Longitude)&&(!isNaN(this.Latitude)&&!isNaN(this.Longitude))}},$$WP.Geo=$$WP.Geo||{},$$WP.Geo.Coordinates=o,o.extend($$WP.Common.Model,"WP$Geo$Coordinates")}();;
!function WP$Scheduling$Department$definition(){var e=$$WP.Geo.Coordinates,t=$$WP.Common.ModelCollection,n=function WP$Scheduling$Department(e){this.WP$Common$Model(e),this.ID||0===this.ID||$$WP.Debug.logError("A department was created from a raw object that did not contain an ID: "+JSON.stringify(e))},r=[{propertyNames:"ID",storeAs:"single"},{propertyNames:"SpecialtyGroupId",storeAs:"array"}];n.prototype={s_dataMembers:["ID","Name","Address","PhoneNumber","OverridePhoneNumber","IsUsingOverridePhoneNumber","TimeZone","FromMinutesOffset","FromDaysOffset","ToDaysOffset","LookbackDays","AllowTeamScheduling","DistanceFromHome","SpecialtyGroupId","IsEnabledForNewProviderWorkflow","AllowAppointmentRequest"],ID:null,Name:null,Address:null,Coordinates:null,PhoneNumber:null,OverridePhoneNumber:null,IsUsingOverridePhoneNumber:!1,TimeZone:null,FromMinutesOffset:null,FromDaysOffset:null,ToDaysOffset:null,LookbackDays:0,AllowTeamScheduling:null,DistanceFromHome:null,SpecialtyGroupId:null,Specialty:null,IsEnabledForNewProviderWorkflow:!1,AllowAppointmentRequest:!1},n.convertRawDepartments=function WP$Scheduling$Department$convertRawDepartments(t,r){var o,s,i,l;if(l=[],Array.isArray(t))for(o=0;o<t.length;o++)"object"==typeof(s=t[o])&&void 0!==s.ID&&(null===(i=r.getFromIndex("ID",s.ID))&&((i=new n(s)).Coordinates=new e(s.Coordinates),r.add(i)),l.push(i));return l},n.isOtherDepartmentId=function WP$Scheduling$Department$isOtherDepartmentId(e){return"-1"===e},n.dereferenceIds=function WP$Scheduling$Department$dereferenceIds(e,t){var n,r;for(n=0;n<e.size();n++)(r=e.Models[n]).Specialty=t.getFromIndex("Id",r.SpecialtyGroupId)},n.createDepartmentsCollection=function(){return new t(r)},$$WP.Scheduling=$$WP.Scheduling||{},$$WP.Scheduling.Department=n,n.extend($$WP.Common.Model,"WP$Scheduling$Department")}(),$$WP.Debug.UnitTest=$$WP.Debug.UnitTest||{},$$WP.Debug.UnitTest.tests=$$WP.Debug.UnitTest.tests||[],$$WP.Debug.UnitTest.tests.push((function UnitTests$Department(e){$$WP.Debug.UnitTest.assert}));;
!function WP$Scheduling$Provider$definition(){var e=$$WP.Common.ModelCollection,r=function WP$Scheduling$Provider(e){this.WP$Common$Model(e),c!==i.LastNameFirst||$$WP.Utilities.IsNullOrEmpty(this.NameLastFirst)?this.ListDisplayName=this.Name:this.ListDisplayName=this.NameLastFirst,this.State=t.Unselected,this.TeamOriginProviders=[],this.TeamProviderDepartmentPairs=[],$$WP.Utilities.UI.IsMobile&&!$$WPUtil.IsNullOrEmpty(this.WebPageUrl)&&(this.WebPageUrl=addQueryStringToUrl(this.WebPageUrl,"providerbio","true"),0==this.WebPageUrl.indexOf("app/providers/details")&&(this.WebPageUrl="epichttp://"+this.WebPageUrl+"&isIdEncrypted=1")),this.PatientAge=[]},t={Selected:0,Unselected:1},i={ExternalName:1,LastNameFirst:2},n={Name:"Name",NameLastFirst:"NameLastFirst",ListDisplayName:"ListDisplayName"},s=function WP$Scheduling$Providers$mergeFromRawProvider(e,r){r.ID===e.ID&&(r.TeamProviders=e.TeamProviders)},a=function WP$Scheduling$Provider$s_createOtherProviderObject(){return new r({ID:"-1",Name:$$WP.Strings.getNamespace("Scheduling").getString("OtherProviderHeader"),OtherOption:!0,Specialties:[{TitleUtf8:$$WP.Strings.getNamespace("Scheduling").getString("OtherProviderDescription")}],IsStandardProvider:!1,TeamProviders:[],IsPCP:!1})},o=function WP$Scheduling$Provider$s_createOtherDepartmentObject(){return new $$WP.Scheduling.Department({ID:"-1",Name:$$WP.Strings.getNamespace("Scheduling").getString("OtherLocationHeader")})},d=function WP$Scheduling$Provider$s_createOtherLocationObject(e,r){var t=$$WP.Scheduling.Location.OtherLocationEnum,i=r?t.Grouped:t.Ungrouped,n=new $$WP.Scheduling.Location(i,"","","","",[e.ID]);return n.Departments=[e],n.OtherOption=!0,n.IsSingleDepartment=!r,n.Name=$$WP.Strings.getNamespace("Scheduling").getString("OtherLocationHeader"),n},l=function WP$Scheduling$Provider$sortProvidersPair(e,r,t){return e.OtherOption?1:r.OtherOption||e.AnyOption?-1:r.AnyOption?1:e.IsPCP&&!r.IsPCP?-1:r.IsPCP&&!e.IsPCP?1:e[t].toUpperCase()<r[t].toUpperCase()?-1:e[t].toUpperCase()>r[t].toUpperCase()?1:0},P=[{propertyNames:"State",storeAs:"set"},{propertyNames:"ID",storeAs:"single"},{propertyNames:"IsStandardProvider",storeAs:"array"}],u=["State","ViewState"],c=null;r.prototype={s_dataMembers:["ID","Name","NameLastFirst","PcpType","Specialties","PhotoUrl","IsStandardProvider","PhotoClass","TeamProviders","TeamProviderDepartmentPairs","IsPCP","OtherOption","AnyOption","AllowedTelemedicineLocations","WebPageUrl","Languages","Gender","Credentials","ClinicalInterests","PatientAge","IsInNetwork","IsManuallyDeselected"],ID:"",Name:"",NameLastFirst:"",ListDisplayName:"",PcpType:null,Specialties:null,PhotoUrl:null,IsStandardProvider:null,PhotoClass:"",ViewState:null,State:null,StandardDepartments:null,TeamProviders:null,TeamProviderDepartmentPairs:null,IsPCP:null,TeamOriginProviders:null,OtherOption:!1,AutoSelectedForHiddenStep:!1,AnyOption:!1,AllowedTelemedicineLocations:"",WebPageUrl:"",LqfProviderAction:null,Languages:null,Gender:"",Credentials:"",ClinicalInterests:null,PatientAge:[],IsInNetwork:!1,IsManuallyDeselected:!1,toRawRequestObject:function WP$Scheduling$Provider$toRawRequestObject(){var e=[],r=0,t=null;for(r=0;r<this.TeamProviders.length;r++)t=new $$WP.Scheduling.ProviderDepartmentPair(this.TeamProviders[r]),e.push(t.toRawRequestObject());return{Name:this.Name,NameLastFirst:this.NameLastFirst,BioSlug:this.BioSlug,BioId:this.BioId,PcpType:this.PcpType,SpecialtyIds:this.SpecialtyIds,Specialties:this.Specialties,PhotoUrl:this.PhotoUrl,WebPageUrl:this.WebPageUrl,AllowedTelemedicineLocations:this.AllowedTelemedicineLocations,PhotoClass:this.PhotoClass,IsStandardProvider:this.IsStandardProvider,IsPCP:this.IsPCP,TeamProviders:e,Languages:this.Languages,Gender:this.Gender,Credentials:this.Credentials,ClinicalInterests:this.ClinicalInterests}}},r.convertRawProviders=function WP$Scheduling$Provider$convertRawProviders(e,t,i){var n,a,o,d;if(i&&(c=i),!e)return[];if(d=[],Array.isArray(e))for(n=0;n<e.length;n++)"object"==typeof(a=e[n])&&void 0!==a.ID&&(null===(o=t.getFromIndex("ID",a.ID))?(o=new r(a),t.add(o)):s(a,o),d.push(o));return o=new r({ID:"-2",Name:$$WP.Strings.getNamespace("Scheduling").getString("AnyProviderHeader"),Specialties:[{TitleUtf8:$$WP.Strings.getNamespace("Scheduling").getString("AnyProviderDescription")}],AnyOption:!0,TeamProviders:[],IsPCP:!1}),t.getFromIndex("ID","-2")||t.add(o),d.push(o),d},r.createProviderCollection=function WP$Scheduling$Provider$createProviderCollection(){return new e(P,u)},r.StatesEnum=t,r.dereferenceIds=function WP$Scheduling$Provider$dereferenceIds(e,r,t){var i=0,n=0,s=null,a=null,o=null,d=null,l="";for(i=0;i<e.size();i++)if(null!==(s=e.Models[i]).TeamProviders)for($$WP.Scheduling.ProviderDepartmentPair.convertRawProviderDepartmentPairs(s.TeamProviders,t),n=0;n<s.TeamProviders.length;n++)l=(d=s.TeamProviders[n]).ProviderId+"^"+d.DepartmentId,null===(a=t.getFromIndex("Id",l))&&(a=new $$WP.Scheduling.ProviderDepartmentPair(s.TeamProviders[n]),$$WP.Scheduling.providerDepartmentPairs.add(providerDepartmentPair)),s.TeamProviderDepartmentPairs.push(a),$$WP.Scheduling.ProviderDepartmentPair.dereferenceIdsOnPair(a,e,r),(o=a.Provider).TeamOriginProviders.some((function(e){}))||o.TeamOriginProviders.push(s)},r.addOtherOption=function WP$Scheduling$Provider$addOtherOption(e,r,t,i,n,s){var l=null,P=null,u=null,c=null,m=0,$=null,g=$$WP.Scheduling.Location.OtherLocationEnum;for((l=e.getFromIndex("ID","-1"))||(l=a(),e.add(l)),(P=r.getFromIndex("ID","-1"))||(P=o(),r.add(P)),t.getFromIndex("Id",g.Grouped)||(u=d(P,!0),t.add(u)),t.getFromIndex("Id",g.Ungrouped)||(c=d(P,!1),t.add(c)),m=0;m<n.Models.length;m++)$=n.Models[m],$$WP.Scheduling.ReasonForVisit.addOtherProviderDepartmentObject($,s,i,l),$$WP.Scheduling.ReasonForVisit.addOtherProviderOtherDepartmentObject($,i,l,P)},r.removeAnyProviderOption=function WP$Scheduling$Provider$removeAnyProviderOption(e){e.getFromIndex("ID","-2")&&e.remove(e.getFromIndex("ID","-2"))},r.sortProviders=function WP$Scheduling$Provider$sortProviders(e,r){return l(e,r,n.Name)},r.sortProvidersByLastName=function WP$Scheduling$Provider$sortProviders(e,r){return l(e,r,n.NameLastFirst)},r.sortProvidersByListDisplayName=function WP$Scheduling$Provider$sortProviders(e,r){return l(e,r,n.ListDisplayName)},r.sortProviderPair=l,r.NameDisplayFormatEnum=i,r.SortMethodEnum=n,r.LqfActionEnum={Added:1,Removed:2},$$WP.Scheduling=$$WP.Scheduling||{},$$WP.Scheduling.Provider=r,r.extend($$WP.Common.Model,"WP$Scheduling$Provider")}(),$$WP.Debug.UnitTest=$$WP.Debug.UnitTest||{},$$WP.Debug.UnitTest.tests=$$WP.Debug.UnitTest.tests||[],$$WP.Debug.UnitTest.tests.push((function UnitTests$Provider(e){$$WP.Debug.UnitTest.assert}));;
!function WP$Scheduling$Location$definition(){var e=$$WP.Geo.Coordinates,t=$$WP.Common.ModelCollection,n=$$WP.Scheduling.Department,o=function WP$Scheduling$Location(t,n,o,r,a,s){this.WP$Common$Model(),this.Id=t,this.Name=n,this.Address=o,this.Coordinates=new e(r),this.DistanceFromHome=a,this.DepartmentIds=s.slice(),this.Departments=[],this.State=i.Unselected},i={Selected:0,Unselected:1},r={Alphabetically:0,ByDistance:1},a={Grouped:"-2",Ungrouped:"-3"},s=function WP$Scheduling$Location$convertRawLocations(e,t,n){var i,r,a,s,u,m,g;if(u=[],Array.isArray(e)){for(i=0;i<e.length;i++)if("object"==typeof(a=e[i])&&void 0!==a.ID){if(null===(s=t.getFromIndex("Id",a.ID))){for(s=new o(a.ID,a.Name,a.Address,a.Coordinates,a.DistanceFromHome,a.DepartmentIds),r=0;r<s.DepartmentIds.length;r++)null!==(m=n.getFromIndex("ID",s.DepartmentIds[r]))&&s.Departments.push(m);s.IsSingleDepartment=!1,I(s)||(s.Address=$(s)),c(s)||(s.Coordinates=p(s)),l(s)||(s.DistanceFromHome=D(s)),t.add(s)}else for(r=0;r<a.DepartmentIds.length;r++)g=a.DepartmentIds[r],s.DepartmentIds.includes(g)||(m=n.getFromIndex("ID",g),s.DepartmentIds.push(g),s.Departments.push(m));u.push(s)}u=u.concat(d(t,n)),departments=n.getIndex("ID")}return(s=new o("-1",$$WP.Strings.getNamespace("Scheduling").getString("AnyLocationHeader"),[$$WP.Strings.getNamespace("Scheduling").getString("AnyLocationDescription")],{},null,[])).IsAnyOption=!0,t.getFromIndex("Id","-1")||t.add(s),u.push(s),u},d=function WP$Scheduling$Location$convertRawLocationsToSingleDepartmentGroupings(e,t){var i,r,a,s=[];for(id in i=t.getIndex("ID"))n.isOtherDepartmentId(id)||(a="DEP^"+i[id].ID,null===(r=e.getFromIndex("Id",a))&&((r=new o(a,i[id].Name,i[id].Address,i[id].Coordinates,i[id].DistanceFromHome,[id])).IsSingleDepartment=!0,department=t.getFromIndex("ID",id),r.Departments.push(department),e.add(r)),s.push(r));return s},c=function WP$Scheduling$Location$doesLocationHaveCoordinates(e){return!!e.Coordinates&&e.Coordinates.areCoordinatesValid()},l=function WP$Scheduling$Location$doesLocationHaveDistanceFromHome(e){return null!==e.DistanceFromHome},u=function WP$Scheduling$Location$doesLocationHaveDistanceToUser(e){return void 0!==e.DistanceToUser&&null!==e.DistanceToUser},$=function WP$Scheduling$Location$getLocationAddressFromDepartments(e,t){var n=null,o=e.Departments.slice();if(t){n=$$WP.Scheduling.ReasonForVisit.getDepartmentIdMap(t);for(var i=0;i<o.length;i++)n&&!n.has(o[i].ID)&&(o.splice(i,1),i--)}for(i=1;i<o.length;i++)if((!n||n.has(o[i].ID))&&o[i-1].Address.toString().toLowerCase()!==o[i].Address.toString().toLowerCase())return null;return o.length>0?o[0].Address:""},m=function WP$Scheduling$SlotStepController$getGroupedLocationThatContainsDepartment(e,t){var n,o=0,i=t.toArray();for(o=0;o<i.length;o++)if(!(n=i[o]).IsSingleDepartment&&"-1"!==n.Id&&-1!==n.Departments.indexOf(e))return n},g=function WP$Scheduling$SlotStepController$getUngroupedLocationThatContainsDepartment(e,t){var n="DEP^"+e.ID;return t.getFromIndex("Id",n)},p=function WP$Scheduling$Location$getAverageDepartmentCoordinates(t){for(var n=0,o=0,i=0,r=0;r<t.Departments.length;r++){var a=t.Departments[r];c(a)&&(o+=a.Coordinates.Latitude,i+=a.Coordinates.Longitude,n++)}return 0===n?new e(null,null):new e({Latitude:o/n,Longitude:i/n})},D=function WP$Scheduling$Location$getAverageDistanceFromHome(e){for(var t=0,n=0,o=null,i=0;i<e.Departments.length;i++)null!==(o=e.Departments[i]).DistanceFromHome&&(n+=o.DistanceFromHome,t++);return 0===t?null:n/t},h=function WP$Scheduling$Location$sortLocationPairByDistance(e,t){var n=P(e,t);if(0!==n)return n;if(!u(e)&&!u(t))return f(e,t);if(!u(e))return 1;if(!u(t))return-1;var o=e.DistanceToUser,i=t.DistanceToUser;return o<i?-1:o>i?1:f(e,t)},I=function WP$Scheduling$Location$hasLocationAddress(e){return null!==e.Address&&void 0!==e.Address&&0!==e.Address.length},L=[{propertyNames:"State",storeAs:"set"},{propertyNames:"Id",storeAs:"single"}],S=["State","ViewState","DistanceToUser"],f=function WP$Scheduling$Location$s__sortLocationPairAlpabetically(e,t){var n=P(e,t);return 0!==n?n:e.Name.localeCompare(t.Name)},P=function WP$Scheduling$Location$s__checkForPlaceholderLocations(e,t){return e.IsAnyOption||t.IsAnyOption||e.OtherOption||t.OtherOption?e.IsAnyOption?-1:t.IsAnyOption||e.OtherOption?1:t.OtherOption?-1:0:0};o.prototype={Id:null,Name:null,Address:null,Coordinates:null,DistanceToUser:null,DepartmentIds:null,Departments:null,IsSingleDepartment:!1,ViewState:null,State:null,IsAnyOption:!1,OtherOption:!1,IsIncludedByFilter:!1,DistanceFromHome:null,getNonprefixedId:function WP$Scheduling$Location$getNonprefixedId(){return 0===this.Id.indexOf("DEP^")?this.Id.substring(4):this.Id}},o.areAllDepartmentsGrouped=function WP$Scheduling$Location$areAllDepartmentsGrouped(e,t){var n,o,i,r,a,s;for(s in o=t.getIndex("ID"),r={},i=e.getIndex("Id"))if(!i[s].IsSingleDepartment)for(n=0;n<i[s].Departments.length;n++)r[i[s].Departments[n].ID]=!0;for(s in a=!0,o)if(!r[s]){a=!1;break}return a},o.convertRawLocations=s,o.convertRawLocationsToSingleDepartmentGroupings=d,o.convertAdditionalRawLocations=function WP$Scheduling$Location$convertAdditionalRawLocations(e,t,n,o){return o?s(e,t,n):d(t,n)},o.createLocationCollection=function WP$Scheduling$Location$createLocationCollection(){return new t(L,S)},o.getLocationFromDepartment=function WP$Scheduling$Location$getLocationFromDepartment(e,t,n){return n?m(e,t):g(e,t)},o.doesLocationHaveCoordinates=c,o.doesLocationHaveDistanceFromHome=l,o.sortLocations=function WP$Scheduling$Location$sortLocations(e,t){if(t===r.Alphabetically||t===r.ByDistance)switch(t){case r.Alphabetically:return e.sort(f);case r.ByDistance:return e.sort(h)}},o.doesLocationHaveDistanceToUser=u,o.doLocationsHaveSameRoundedDistanceToUser=function WP$Scheduling$Location$doLocationsHaveSameDistanceToUser(e,t){return!u(e)&&!u(t)||!!u(e)&&(!!u(t)&&e.DistanceToUser.toFixed(1)===t.DistanceToUser.toFixed(1))},o.getAverageDepartmentCoordinates=p,o.getAverageDistanceFromHome=D,o.getLocationAddressFromDepartments=$,o.sortLocationPairByDistance=h,o.hasLocationAddress=I,o.isLocationPlaceholder=function WP$Scheduling$isLocationPlaceholder$(e){return e.Id===a.Grouped&&e.Id===a.Ungrouped},o.SortMethodEnum=r,o.StatesEnum=i,o.OtherLocationEnum=a,$$WP.Scheduling.Location=o,o.extend($$WP.Common.Model,"WP$Scheduling$Location")}(),$$WP.Debug.UnitTest=$$WP.Debug.UnitTest||{},$$WP.Debug.UnitTest.tests=$$WP.Debug.UnitTest.tests||[],$$WP.Debug.UnitTest.tests.push((function UnitTests$Location(e){$$WP.Debug.UnitTest.assert}));;
!function WP$Scheduling$Specialty$definition(){var e=$$WP.Common.ModelCollection,t=function WP$Scheduling$Specialty(e){this.WP$Common$Model(e),this.ViewState=l.Unselected,this.IsSvgSprite=this.PhotoUrl&&this.PhotoUrl.indexOf(".svg#")>0},l={Selected:0,Unselected:1},a=[{propertyNames:"Id",storeAs:"single"},{propertyNames:"ViewState",storeAs:"single"},{propertyNames:"StandardSpecialtyValue",storeAs:"array"}],n=["State","ViewState"],i=[{propertyName:"ViewState",value:l.Selected,bumpToValue:l.Unselected}];t.prototype={s_dataMembers:["Id","Name","Header","HelpText","PhotoUrl","StandardSpecialtyValue"],Id:null,Name:null,Header:null,Description:null,HelpText:null,PhotoUrl:null,IsSvgSprite:!1,State:null,ViewState:null,IsDataLoaded:!1,StandardSpecialtyValue:null},t.convertRawSpecialties=function WP$Scheduling$Specialty$convertRawSpecialties(e,l){var a,n,i,s;if(s=[],Array.isArray(e))for(a=0;a<e.length;a++)"object"==typeof(n=e[a])&&void 0!==n.Id&&(null===(i=l.getFromIndex("Id",n.Id))&&(i=new t(n),l.add(i)),s.push(i));return s},t.createSpecialtiesCollection=function(){return new e(a,n,i)},t.sortSpecialties=function(e,t){return e.Name.toUpperCase()<t.Name.toUpperCase()?-1:e.Name.toUpperCase()>t.Name.toUpperCase()?1:0},t.StatesEnum=l,$$WP.Scheduling=$$WP.Scheduling||{},$$WP.Scheduling.Specialty=t,t.extend($$WP.Common.Model,"WP$Scheduling$Specialty")}(),$$WP.Debug.UnitTest=$$WP.Debug.UnitTest||{},$$WP.Debug.UnitTest.tests=$$WP.Debug.UnitTest.tests||[],$$WP.Debug.UnitTest.tests.push((function UnitTests$Specialty(e){$$WP.Debug.UnitTest.assert}));;
/*! Copyright Epic Systems Corporation 2017 */
!function WP$Scheduling$TelehealthLocation$definition(){var e=$$WP.Common.ModelCollection,t=function WP$Scheduling$TelehealthLocation(e,t,n,a){this.WP$Common$Model(),this.Id=e,this.Name=t,this.State=n||o.Unselected,this.SelectedByDefault=a,this.SubLocations=[]},o={Selected:0,Unselected:1,SelectedUnavailable:2},n="fakelocation",a=function WP$Scheduling$TelehealthLocation$createTelehealthLocationCollection(){return new e(l,c)},i=function WP$Scheduling$TelehealthLocation$convertRawTelehealthLocations(e,l,c){var h,s,u,r=!1,d=[];if(Array.isArray(e)){if(e=e.sort((function(e,t){return e.Title>t.Title?1:e.Title<t.Title?-1:0})),c){for(h=0;h<e.length&&!r;h++)s=e[h],r=r||s.SelectedByDefault;u=new t(n,$$WP.Strings.get("SelectLocationDefault","ondemandtelehealth"),o.Unselected,!r),l.add(u),d.push(u)}for(h=0;h<e.length;h++){var S,$;s=e[h],$=c?"TelehealthStateNameOverride":"TelehealthCountryNameOverride",S=$$WP.Strings.get($+"_"+s.Number,"OnDemandTelehealth")||s.Title,null===(u=l.getFromIndex("Id",s.Number))&&(u=new t(s.Number,S,o.Unselected,s.SelectedByDefault),s.SubLocations&&!c&&(u.SubLocations=a(),s.SubLocations.length>0&&i(s.SubLocations,u.SubLocations,!0)),l.add(u),d.push(u))}}return d},l=[{propertyNames:"State",storeAs:"set"},{propertyNames:"Id",storeAs:"single"}],c=["State","LocationName"];t.prototype={Id:null,Name:null,SubLocations:e,LocationName:null,SelectedByDefault:!1,setLocationName:function WP$Scheduling$TelehealthLocation$setLocationName(){var e="",o=this.SubLocations.getFirstInIndex("State",t.StatesEnum.Selected);e=o?o.Name:this.Name,this.setProperty("LocationName",e)}},t.createTelehealthLocationCollection=a,t.convertRawTelehealthLocations=i,t.checkRoutingDestinationForLocation=function WP$Scheduling$TelehealthLocation$checkRoutingDestinationForLocation(e,t,o,n,a,i,l){$.ajax({url:makeLink("TelemedicineHome/ValidateMessageDestination"),type:"POST",dataType:"JSON",success:$.proxy(l,this),data:"location="+encodeURIComponent(e)+"&sublocation="+encodeURIComponent(t)+"&reasonForVisit="+encodeURIComponent(o)+"&workflow=2&isAnonymous="+(a?"1":"0")+"&isGuest="+(i?"1":"0")+"&rfvLine="+n})},t.StatesEnum=o,t.FakeLocationId=n,$$WP.Scheduling=$$WP.Scheduling||{},$$WP.Scheduling.TelehealthLocation=t,t.extend($$WP.Common.Model,"WP$Scheduling$TelehealthLocation")}();;
!function WP$Scheduling$TelehealthData$definition(){var e=function WP$Scheduling$TelehealthData(){this.WP$Common$Model(),this.initializeSelectedPlatform()},t={s_dataMembers:["IsXOrgEnabled","IsHardwareTestComplete","QuickScheduleSlot","SelectedWorkflow","ParentWorkflow","IsOrgSelectionComplete","QuickScheduleSlotIndex","HadConnectionFailure","TelehealthLoaded","ShouldShowHardwareTest","ShouldShowMobileInfo","ShouldShowMobileHardwareImage","ShowPlatformToggle","TelehealthSelectedPlatform","TelehealthSelectedPlatformString","Provider","UseInsuranceForVisit","ReviewApptCalledOnOrgStep","IsSelectedOrgLocal"],TelehealthLoaded:!1,IsXOrgEnabled:!1,IsHardwareTestComplete:!1,SelectedWorkflow:null,ParentWorkflow:null,QuickScheduleSlot:null,QuickScheduleSlotIndex:-1,NotificationSettings:null,NotificationSelection:null,ShouldSaveNotifications:!1,IsOrgSelectionComplete:!1,HadConnectionFailure:!1,ShouldShowHardwareTest:!1,ShouldShowMobileInfo:!1,ShouldShowMobileHardwareImage:!1,ShowPlatformToggle:!1,TelehealthSelectedPlatform:null,TelehealthSelectedPlatformString:null,AutoSelectedWorkflow:null,Provider:null,UseInsuranceForVisit:"",ReviewApptCalledOnOrgStep:!1,IsSelectedOrgLocal:!1,resetData:function WP$Scheduling$TelehealthData$resetData(){this.setProperty("IsHardwareTestComplete",!1),this.setProperty("QuickScheduleSlot",null),this.setProperty("QuickScheduleSlotIndex",-1),null===this.AutoSelectedWorkflow&&this.setProperty("SelectedWorkflow",null),this.setProperty("NotificationSelection",null),this.setProperty("ShouldSaveNotifications",null),this.setProperty("HadConnectionFailure",!1),this.setProperty("IsOrgSelectionComplete",!1),this.setProperty("TelehealthSelectedPlatformString",null),this.setProperty("Provider",null),this.setProperty("UseInsuranceForVisit",""),this.setProperty("ReviewApptCalledOnOrgStep",!1),this.setProperty("IsSelectedOrgLocal",!1),this.initializeSelectedPlatform()},initializeSelectedPlatform:function WP$Scheduling$TelehealthData$initializeSelectedPlatform(){WP.DOM.Browser.isMobile||$$WP.Utilities.UI.IsMobile?this.setProperty("TelehealthSelectedPlatform","2"):this.setProperty("TelehealthSelectedPlatform",null)},autoSelectQueueing:function WP$Scheduling$TelehealthData$autoSelectQueueing(){this.setProperty("SelectedWorkflow",e.TelehealthWorkflow.Queueing),this.setProperty("AutoSelectedWorkflow",e.TelehealthWorkflow.Queueing)},toRawRequestObject:function WP$Scheduling$TelehealthData$toRawRequestObject(e,t,l){var o=null;return this.QuickScheduleSlot&&(o=this.QuickScheduleSlot.toRawRequestObject(),l&&(o.Provider=l.toRawRequestObject())),{SelectedWorkflow:this.SelectedWorkflow,QuickScheduleSlot:o,TelehealthNotificationSettings:this.TelehealthNotificationSettings,Provider:this.QuickScheduleSlot&&l?l.toRawRequestObject():null,RootDecisionTreeID:e.rootDecisionTreeID,DecisionTreeAnswerID:e.decisionTreeAnswerID,DecisionTreeNodeID:e.decisionTreeNodeID,DecisionTreeNodeCSN:e.decisionTreeNodeCSN,ParentWorkflow:e.parentWorkflow,IsFromSelfTriageLandingPage:e.isFromSelfTriageLandingPage,HasMatchingRecord:t}}};e.TelehealthWorkflow={Queueing:0,QuickSchedule:1,SlotSelection:2};e.prototype=t,$$WP.Scheduling=$$WP.Scheduling||{},$$WP.Scheduling.TelehealthData=e,e.extend($$WP.Common.Model,"WP$Scheduling$TelehealthData")}();;
!function WP$Scheduling$TelehealthFilters$definition(){var e=function WP$Scheduling$TelehealthFilters(){};function compare(e,t){return e===t?0:e<t?-1:1}function lowerThanLowest(e,t,l,n){if(null===t)return!1;if(null===l)return!1;if(typeof e!=typeof t)return!1;if(null===e)return!0;var r=l(t),i=l(e),a=r<i;return r===i?n.hasTie=!0:a&&(n.hasTie=!1),a}e.FindNotableOrganizations=function WP$Scheduling$TelehealthFilters$FindNotableOrganizations(e){var t=null,l=null,n=null,r={hasTie:!1},i={hasTie:!1},a=!0;e.length<=1&&(a=!1);for(var o=0;o<e.length;o++){var s=e[o];s.IsLocal&&(t=s),s.BestValue&&(s.BestValue=!1),s.ShortestWait&&(s.ShortestWait=!1),lowerThanLowest(l,s,$$WP.Scheduling.TelehealthOrganization.GetOrgEstimatedCost,r)&&(l=s),lowerThanLowest(n,s,$$WP.Scheduling.TelehealthOrganization.GetOrgWaitTimeBucket,i)&&(n=s)}return a&&(l&&!r.hasTie&&(l.BestValue=!0),n&&!i.hasTie&&(n.ShortestWait=!0)),{localOrg:t,smallestCostOrg:l,shortestWaitOrg:n}},e.BuildTelehealthOrganizationArray=function WP$Scheduling$TelehealthFilters$BuildTelehealthOrganizationArray(t,l,n,r){var i,a=[],o=t.TelehealthLocations.getFirstInIndex("State",$$WP.Scheduling.TelehealthLocation.StatesEnum.Selected);o&&(i=o.SubLocations.getFirstInIndex("State",$$WP.Scheduling.TelehealthLocation.StatesEnum.Selected));for(var s=t.TelehealthData.TelehealthSelectedPlatform,h=0;h<t.TelehealthOrganizations.size();h++){var c=t.TelehealthOrganizations.Models[h];c&&(c.ContainsPreferredPlatform(s)&&(c.IsLocal&&!r||o&&c.IsLocal&&!e.IsInLicensedLocation(c.AllowedLocationsString,o,i)||(t.IsAdminLoginFromHyperspace&&!c.IsLocal&&c.setProperty("Disabled",!0),a.push(c))))}return e.DoSortAndFilter(a,l)};var t={Web:"1",Mobile:"2"},l=[],n={};if($$WP&&$$WP.Strings){$$WP.Strings.setDefaultNamespace("ondemandtelehealth");var r={Value:t.Mobile,Label:$$WP.Strings.getForTemplate("TelehealthMobileDevice"),Title:$$WP.Strings.getForTemplate("TelehealthMobileDeviceTooltip")};if(WP.DOM.Browser.isMobile)var a={Value:t.Web,Label:$$WP.Strings.getForTemplate("TelehealthMobileBrowser"),Title:$$WP.Strings.getForTemplate("TelehealthMobileBrowserTooltip")};else a={Value:t.Web,Label:$$WP.Strings.getForTemplate("TelehealthWebBrowser"),Title:$$WP.Strings.getForTemplate("TelehealthWebBrowserTooltip")};$$WP.Strings.clearDefaultNamespace(),l.push(a,r),n[t.Web]=a,n[t.Mobile]=r}e.GetPlatformString=function WP$Scheduling$TelehealthFilters$GetPlatformString(e){if(e){var t=n[e];if(t)return t.Label}return""};var o="time",s="cost",h="suggested",c=[];$$WP&&$$WP.Strings&&($$WP.Strings.setDefaultNamespace("ondemandtelehealth"),c=[{Value:h,Label:$$WP.Strings.getForTemplate("TelehealthSuggestedLabel"),Title:$$WP.Strings.getForTemplate("TelehealthSuggestedTitle")},{Value:o,Label:$$WP.Strings.getForTemplate("TelehealthShortestWaitLabel"),Title:$$WP.Strings.getForTemplate("TelehealthShortestWaitTitle")},{Value:s,Label:$$WP.Strings.getForTemplate("TelehealthLowestCostLabel"),Title:$$WP.Strings.getForTemplate("TelehealthLowestCostTitle")}],$$WP.Strings.clearDefaultNamespace()),e.DoSortAndFilter=function WP$Scheduling$TelehealthFilters$DoSortAndFilter(e,t){switch(t){case o:e.sort((function(e,t){return compare(e.GetWaitTime(),t.GetWaitTime())}));break;case s:e.sort((function(e,t){return compare(e.GetEstimatedCost(),t.GetEstimatedCost())}));break;case h:e.sort((function(e,t){if(e.IsLocal&&!t.IsLocal)return-1;if(t.IsLocal&&!e.IsLocal)return 1;var l=compare(e.IsUnconnected(),t.IsUnconnected());if(l)return l;var n=compare(e.GetWaitTimeBucket(),t.GetWaitTimeBucket());return n||compare(e.GetEstimatedCost(),t.GetEstimatedCost())}))}return e.splice(6,e.length),e};var u=function WP$Scheduling$TelehealthFilters$hasAllowedPlatform(e,t){return null!==e&&-1!==(e+"|").indexOf("|"+t+"|")};e.HasAtLeastOnePairLicensedInLocation=function WP$Scheduling$TelehealthFilters$HasAtLeastOnePairLicensedInLocation(t,l,n){var r,i;for(r=0;r<t.length;r++)if((i=t[r]).CanScheduleTelemedicine&&e.IsPairLicensedInLocation(i,l,n))return!0;return!1},e.GetPairsLicensedInLocation=function WP$Scheduling$TelehealthFilters$GetPairsLicensedInLocation(t,l,n){return t.filter((function(t){return e.IsPairLicensedInLocation(t,l,n)}))},e.IsPairLicensedInLocation=function WP$Scheduling$TelehealthFilters$IsPairLicensedInLocation(t,l,n){var r=t.Provider;return null===l||(!!$$WPUtil.IsNullOrEmpty(r.AllowedTelemedicineLocations)||e.IsProviderEnabledAtLocation(r,l,n))},e.IsInLicensedLocation=function WP$Scheduling$TelehealthFilters$IsInLicensedLocation(e,t,l,n,r){var i;null===e&&(e="");var a=function WP$Scheduling$TelehealthFilters$getMatchingLocationPair(e,t){var l,n;l=e.split(";");for(var r=0;r<l.length;r+=1)if((n=l[r].split(":"))[0].split("^")[0]===t.Id)return n;return null}(e,t);if(null===a)return!1;if(i=a[0].split("^")[1],!r&&(void 0===i||0===i.length))return!1;if(!l)return!(void 0!==n&&!r)||u(i,n);var o=a[1];if(0===o.length)return!0;var s=","+o+",",h=-1!==s.indexOf(","+l.Id+",")||-1!==s.indexOf(","+l.Id+"^");return h&&void 0!==n&&!r?(i=function WP$Scheduling$TelehealthFilters$getAllowedPlatformFromSublocations(e,t){for(var l=e.split(","),n=0;n<l.length;n++){var r=l[n].split("^");if(r[0]===t.Id)return r[1]}return null}(o,l),u(i,n)):h},e.IsRFVEnabledForPlatformAtLocation=function WP$Telehealth$TelehealthFilters$IsRFVEnabledForPlatformAtLocation(t,l,n,r,i){return(t.EnabledForQuickSchedule||e.IsInLicensedLocation(t.AllowedTelemedicineLocations,n,r,l))&&(e.IsRFVEnabledForQuickSchedule(t,l)||e.IsRFVEnabledForOnDemand(t,l,i))},e.IsRFVEnabledForPlatform=function WP$Telehealth$TelehealthFilters$IsRFVEnabledForPlatform(t,l,n){return e.IsRFVEnabledForQuickSchedule(t,l)||e.IsRFVEnabledForOnDemand(t,l,n)},e.IsRFVEnabledForQuickSchedule=function WP$Telehealth$TelehealthFilters$IsRFVEnabledForQuickSchedule(e,t){return e&&e.EnabledForQuickSchedule&&$$WP.Scheduling.TelehealthFilters.ContainsPreferredPlatform(e.AvailablePlatformsForLocalQuickSchedule,t)},e.IsProviderEnabledAtLocation=function WP$Telehealth$TelehealthFilters$IsProviderEnabledAtLocation(t,l,n){var r=t.AllowedTelemedicineLocations;return e.IsInLicensedLocation(r,l,n,null,!0)},e.FilterRFVsByLicensure=function WP$Telehealth$TelehealthFilters$FilterRFVsByLicensure(e){var t,l=[];for(i=0;i<e.length;i++)(t=e[i]).IsNotAvailableForPatientsLocation||l.push(t);return l},e.IsRFVInLicensedLocationForQuickSchedule=function WP$Telehealth$TelehealthFilters$IsRFVInLicensedLocationForQuickSchedule(t,l,n){if(null===t.DefaultVisitType)return!1;var r=t.AllProviderDepartmentPairs;return e.AreProvidersLicensedAtLocation(r,l,n)},e.AreProvidersLicensedAtLocation=function WP$Telehealth$TelehealthFilters$AreProvidersLicensedAtLocation(t,l,n){if(null===t||null===l)return!1;var r=!1;if(Array.isArray(t)&&t.length>0)for(j=0;j<t.length;j++){var i=t[j];if(e.IsProviderEnabledAtLocation(i.Provider,l,n)){r=!0;break}}return r},e.IsRFVEnabledForOnDemand=function WP$Telehealth$TelehealthFilters$IsRFVEnabledForOnDemand(e,t,l){return e&&e.EnabledForOnDemandVideoVisits&&(e.ExternallyAvailableForTelehealth&&l||e.InternallyAvailableForTelehealth&&$$WP.Scheduling.TelehealthFilters.ContainsPreferredPlatform(e.AvailablePlatformsForLocalOnDemand,t))},e.ContainsPreferredPlatform=function WP$Scheduling$TelehealthFilters$ContainsPreferredPlatform(e,t){return!!e&&e.indexOf(","+t+",")>-1};var d=function WP$Scheduling$TelehealthFilters$C(e){return e&&e.length>0};e.DoesRFVHaveAnyAvailablePlatforms=function WP$Scheduling$TelehealthFilters$DoesRFVHaveAnyAvailablePlatforms(e){return d(e.AvailablePlatformsForLocalQuickSchedule)||d(e.AvailablePlatformsForLocalOnDemand)},e.GetDuplicateLinePriority=function WP$Telehealth$TelehealthFilters$IsRFVInLicensedLocationForQuickSchedule(t,l,n){var r=!!t.InternallyAvailableForTelehealth&&(t.EnabledForOnDemandVideoVisits&&e.IsInLicensedLocation(t.OnDemandOrganization.AllowedLocationsString,l,n,null,!0)),i=t.EnabledForQuickSchedule&&e.IsRFVInLicensedLocationForQuickSchedule(t,l,n);return r&&i?4:r?3:i?2:1},e.Filters=c,e.PlatformFilters=l,e.PlatformFilterValueEnum=t,$$WP.Scheduling=$$WP.Scheduling||{},$$WP.Scheduling.TelehealthFilters=e}();;
/*! Copyright Epic Systems Corporation 2017 */
!function WP$Scheduling$TelehealthNotificationSelection$definition(){var e=function WP$Scheduling$TelehealthNotificationSelection(e,i,n,t){this.WP$Common$Model(),this.SendSMS=e,this.SendEmail=i,this.PhoneNumber=n,this.EmailAddress=t};e.prototype={SendSMS:!1,SendEmail:!1,PhoneNumber:null,EmailAddress:null},$$WP.Scheduling.TelehealthNotificationSelection=e,e.extend($$WP.Common.Model,"WP$Scheduling$TelehealthNotificationSelection")}();;
/*! Copyright Epic Systems Corporation 2017 */
!function WP$Scheduling$TelehealthNotificationSettings$definition(){var i=function WP$Scheduling$TelehealthNotificationSettings(i,t,n,o,e,l,h,a,s,S){this.WP$Common$Model(),this.ShowEmailOption=i,this.ShowSMSOption=t,this.CheckSMSOption=o,this.CheckEmailOption=n,this.PhoneNumber=e,this.EmailAddress=l,this.IsPushNotificationEnabled=h,this.CallToAction=a,this.TermsLink=s,this.PrivacyLink=S};i.prototype={s_dataMembers:["ShowEmailOption","ShowSMSOption","CheckEmailOption","CheckSMSOption","EmailAddress","PhoneNumber","IsPushNotificationEnabled","CallToAction","TermsLink","PrivacyLink"],ShowEmailOption:!1,ShowSMSOption:!1,CheckEmailOption:!1,CheckSMSOption:!1,EmailAddress:null,PhoneNumber:null,IsPushNotificationEnabled:!1,CallToAction:null,TermsLink:null,PrivacyLink:null},$$WP.Scheduling.TelehealthNotificationSettings=i,i.extend($$WP.Common.Model,"WP$Scheduling$TelehealthNotificationSettings")}();;
/*! Copyright Epic Systems Corporation 2017 */
!function WP$Scheduling$TelehealthOrganization$definition(){var e=5,t=$$WP.Common.ModelCollection,i={Selected:0,Unselected:1,SelectedUnavailable:2,SelectionMade:3},n=function WP$Scheduling$TelehealthOrganization$GetOrgEstimatedCost(e){return null!==e.MaxCost?e.MaxCost:1/0},s=function WP$Scheduling$TelehealthOrganization$GetOrgWaitTime(e){return e.EstimatedWaitTime?e.EstimatedWaitTime:1/0},a=function WP$Scheduling$TelehealthOrganization$GetOrgWaitTimeBucket(e){return e.EstimatedWaitTime?BucketByMinutes(e.EstimatedWaitTime):1/0},BucketByMinutes=function(t){var i;return(i=5*Math.floor(t/5))<e?i=5*Math.floor((e-1)/5):t%5!=0&&(i+=5),i};function BucketByHour(e){return Math.floor(e/60)}function WaitTimeString(e,t){$$WP.Strings.addMnemonic("@MYCHART@WaitTime@",t,!1,"ondemandtelehealth");var i=$$WP.Strings.get(e,"ondemandtelehealth");return $$WP.Strings.removeMnemonic("@MYCHART@WaitTime@"),i}function WaitHoursMinutesString(e,t,i){$$WP.Strings.addMnemonic("@MYCHART@WaitHours@",t,!1,"ondemandtelehealth"),$$WP.Strings.addMnemonic("@MYCHART@WaitMinutes@",i,!1,"ondemandtelehealth");var n=$$WP.Strings.get(e,"ondemandtelehealth");return $$WP.Strings.removeMnemonic("@MYCHART@WaitHours@"),$$WP.Strings.removeMnemonic("@MYCHART@WaitMinutes@"),n}var o=function WP$Scheduling$TelehealthOrganization(t){this.WP$Common$Model(t),this.State=i.Unselected,0===this.EstimatedWaitTime&&(this.EstimatedWaitTime=e-1),this._processWaitTime()},r=[{propertyNames:"State",storeAs:"set"},{propertyNames:"OrganizationId",storeAs:"single"}],u=["State","NeedsH2GConsent","HasPatientAccess","Disabled"],l=[{propertyName:"State",value:i.Selected,bumpToValue:i.Unselected}];o.prototype={s_dataMembers:["OrganizationId","OrganizationName","LogoUrl","IsLocal","EstimatedWaitTime","CostDisplayString","AllowedLocationsString","EstimatedWaitTimeDisplayString","MaxCost","ShortestWait","Suggested","BestValue","Disabled","ShowDisclaimer","ShowCostComparisons","TermsAndConditionsUrl","ProxyTermsAndConditionsUrl","NeedsH2GConsent","HasPatientAccess","AvailablePlatformsString","ODVVHideCost","ODVVHideWait","CrossOrgShowCost","ReceivingOrgDxo"],TermsAndConditionsUrl:null,ProxyTermsAndConditionsUrl:null,NeedsH2GConsent:!1,HasPatientAccess:!1,OrganizationId:null,OrganizationName:null,LogoUrl:null,IsLocal:null,EstimatedWaitTime:null,CostDisplayString:null,Disabled:!1,State:null,MaxCost:null,AllowedLocationsString:"",AvailablePlatformsString:"",ODVVHideCost:!1,ODVVHideWait:!1,CrossOrgShowCost:!1,ReceivingOrgDxo:null,EstimatedWaitTimeDisplayString:null,ShortestWait:!1,BestValue:!1,Suggested:!1,ShowDisclaimer:!1,ShowCostComparisons:!1,_processWaitTime:function WP$Scheduling$TelehealthOrganization$_processWaitTime(){if(null===this.EstimatedWaitTime||void 0===this.EstimatedWaitTime)this.EstimatedWaitTimeDisplayString=$$WP.Strings.get("WaitTimeNotAvailable","ondemandtelehealth");else if(this.EstimatedWaitTime<e)this.EstimatedWaitTimeDisplayString=WaitTimeString("WaitTimeSoon",this.EstimatedWaitTime);else if(this.EstimatedWaitTime<60)this.EstimatedWaitTimeDisplayString=WaitTimeString("WaitTimeMinutes",BucketByMinutes(this.EstimatedWaitTime));else if(this.EstimatedWaitTime>=60){var t=BucketByHour(this.EstimatedWaitTime),i=BucketByMinutes(this.EstimatedWaitTime-60*t);this.EstimatedWaitTimeDisplayString=1===t?0===i?WaitTimeString("WaitTimeHour",t):WaitHoursMinutesString("WaitTimeHourAndMinutes",t,i):0===i?WaitTimeString("WaitTimeHours",t):WaitHoursMinutesString("WaitTimeHoursAndMinutes",t,i)}},GetEstimatedCost:function WP$Scheduling$TelehealthOrganization$GetEstimatedCost(){return n(this)},GetWaitTime:function WP$Scheduling$TelehealthOrganization$GetWaitTime(){return s(this)},GetWaitTimeBucket:function WP$Scheduling$TelehealthOrganization$GetWaitTimeBucket(){return a(this)},IsUnconnected:function WP$Scheduling$TelehealthOrganization$IsUnconnected(){return this.NeedsH2GConsent?1:0},ConsentCaptured:function WP$Scheduling$TelehealthOrganization$ConsentCaptured(){return!this.NeedsH2GConsent},IsInLicensedLocation:function WP$Scheduling$ReasonForVisitStepController$IsInLicensedLocation(e,t){return $$WP.Scheduling.TelehealthFilters.IsInLicensedLocation(this.AllowedLocationsString,e,t)},ContainsPreferredPlatform:function WP$Scheduling$ReasonForVisitStepController$ContainsPreferredPlatform(e){return $$WP.Scheduling.TelehealthFilters.ContainsPreferredPlatform(this.AvailablePlatformsString,e)}},o.createTelehealthOrganizationCollection=function WP$Scheduling$TelehealthOrganization$createTelehealthOrganizationCollection(){return new t(r,u,l)},o.convertRawTelehealthOrganizations=function WP$Scheduling$TelehealthOrganization$convertRawTelehealthOrganizations(e,t){var i,n=[];if(Array.isArray(e))for(var s=0;s<e.length;s++)i=new o(e[s]),t.add(i),n.push(i);return n},o.StatesEnum=i,o.GetOrgEstimatedCost=n,o.GetOrgWaitTimeBucket=a,o.GetOrgWaitTime=s,o.BucketByMinutes=BucketByMinutes,$$WP.Scheduling=$$WP.Scheduling||{},$$WP.Scheduling.TelehealthOrganization=o,o.extend($$WP.Common.Model,"WP$Scheduling$TelehealthOrganization"),$$WP.Debug.UnitTest=$$WP.Debug.UnitTest||{},$$WP.Debug.UnitTest.tests=$$WP.Debug.UnitTest.tests||[],$$WP.Debug.UnitTest.tests.push((function UnitTests$TelehealthOrganization$bucketByMinutes(){var t=$$WP.Debug.UnitTest.assert;e=5,t(0===BucketByMinutes(0),"0 minutes bucketed wrong by minutes (MIN: 5)"),t(0===BucketByMinutes(1),"1 minutes bucketed wrong by minutes (MIN: 5)"),t(5===BucketByMinutes(5),"5 minutes bucketed wrong by minutes (MIN: 5)"),t(10===BucketByMinutes(6),"6 minutes bucketed wrong by minutes (MIN: 5)"),t(10===BucketByMinutes(10),"10 minutes bucketed wrong by minutes (MIN: 5)"),t(15===BucketByMinutes(11),"15 minutes bucketed wrong by minutes (MIN: 5)"),t(60===BucketByMinutes(60),"60 minutes bucketed wrong by minutes (MIN: 5)"),e=25,t(20===BucketByMinutes(0),"0 minutes bucketed wrong by minutes (MIN: 25)"),t(20===BucketByMinutes(1),"1 minutes bucketed wrong by minutes (MIN: 25)"),t(20===BucketByMinutes(5),"5 minutes bucketed wrong by minutes (MIN: 25)"),t(20===BucketByMinutes(6),"6 minutes bucketed wrong by minutes (MIN: 25)"),t(20===BucketByMinutes(10),"10 minutes bucketed wrong by minutes (MIN: 25)"),t(20===BucketByMinutes(11),"15 minutes bucketed wrong by minutes (MIN: 25)"),t(20===BucketByMinutes(20),"20 minutes bucketed wrong by minutes (MIN: 25)"),t(20===BucketByMinutes(24),"24 minutes bucketed wrong by minutes (MIN: 25)"),t(25===BucketByMinutes(25),"25 minutes bucketed wrong by minutes (MIN: 25)"),t(60===BucketByMinutes(60),"60 minutes bucketed wrong by minutes (MIN: 25)"),e=5})),$$WP.Debug.UnitTest.tests.push((function UnitTests$TelehealthOrganization$bucketByHour(){var e=$$WP.Debug.UnitTest.assert;e(0===BucketByHour(0),"0 minutes bucketed wrong by hours"),e(0===BucketByHour(30),"30 minutes bucketed wrong by hours"),e(1===BucketByHour(60),"60 minutes bucketed wrong by hours"),e(1===BucketByHour(65),"65 minutes bucketed wrong by hours"),e(1===BucketByHour(75),"75 minutes bucketed wrong by hours"),e(1===BucketByHour(90),"90 minutes bucketed wrong by hours"),e(1===BucketByHour(105),"105 minutes bucketed wrong by hours"),e(2===BucketByHour(120),"120 minutes bucketed wrong by hours")}))}();;
!function WP$Scheduling$TelehealthOrganizationLoader$definition(){var e=makeLink("Scheduling/SelectRFV"),n=function WP$Scheduling$TelehealthOrganizationLoader(e){this.WP$BaseObject(),this._organizationCollection=e};n.prototype={_organizationCollection:null,_request:null,LoadOrganizations:function WP$Scheduling$TelehealthOrganizationLoader$LoadOrganizations(n,a,l,i){this.CancelRequest(),n.ExternallyAvailableForTelehealth?this._request=$.post({url:e,data:{rfvId:n.OnDemandRFV,locationId:a.Id,sublocationId:l?l.Id:"",isAvailableLocally:n.InternallyAvailableForTelehealth,lineInWDF40040:n.LineInWDF40040},cache:!1,async:!0,success:$.proxy((function(e,n,a){null!==this._request&&(this._request=null,e(a,n))}),this,i,n),failure:function(){}}):i([],n)},CancelRequest:function WP$Scheduling$TelehealthOrganizationLoader$CancelRequest(){this._request=null}},$$WP.Scheduling.TelehealthOrganizationLoader=n,n.extend($$WP.BaseObject,"WP$Scheduling$TelehealthOrganizationLoader")}();;
!function WP$Scheduling$ReasonForVisit$definition(){var e=$$WP.Common.ModelCollection,t=$$WP.Scheduling.TelehealthOrganization,i=function WP$Scheduling$ReasonForVisit(e){this.WP$Common$Model(e),this.DirectProviderDepartmentPairs=[],this.RequestProviderDepartmentPairs=[],this.ApptComponents=[],this.AppointmentComponentIds=[],l(this),this.EnabledForOnDemandVideoVisits||this.EnabledForQuickSchedule?this.HelpText=$$WP.Strings.get("OnDemandReasonForVisitDescription_"+this.OnDemandRFV,"OnDemandTelehealth"):this.HelpText=$$WP.Strings.get("ReasonForVisitDescription_"+this.CategoryValue,"Scheduling"),this.State=n.Unselected,t&&this.OnDemandOrganization&&(this.OnDemandOrganization=new t(this.OnDemandOrganization))},r={s_dataMembers:["Id","CategoryValue","Title","IsOtherRfv","OnDemandRFV","CanDirectSchedule","CanRequest","CanRequestWithoutOverrides","AllowProviderSelect","DefaultVisitTypeId","ReasonForVisitFirst","ProviderFirst","AllProviderDepartmentPairs","ProviderIds","ProviderDisplayString","NumberOfAvailableProviders","DepartmentIds","LocationDisplayString","NumberOfAvailableLocations","DirectProviderDepartmentPairIDs","RequestProviderDepartmentPairIDs","RawApptComponents","ApptComponents","AppointmentComponentIds","ApptComponentItems","PhotoUrl","PhotoFileName","SortOrder","EnabledForOnDemandVideoVisits","ScheduledTelemedicineVendorId","OnDemandTelemedicineVendorId","TelemedicineHardwareTestFdiId","UseDeepLinkForHardwareTest","TelemedicineMobileHardwareTestFdiId","EnabledForQuickSchedule","LineInWDF15000","TelemedicineVisitTypeId","InitiallyHidden","AllowedTelemedicineLocations","InternallyAvailableForTelehealth","ExternallyAvailableForTelehealth","OnDemandOrganization","OnDemandSlot","AvailablePlatformsForLocalOnDemand","AvailablePlatformsForLocalQuickSchedule","IsNotAvailableForPatientsLocation","AppointmentRequestIds","SpecialtyGroupId","AccessCode","AccessCodeFirstName","IsDemographicAuthRequired","IsPlaceholder","Description","HasIncompleteSchedulingData","ExpectedPatientType","LineInWDF40040"],Id:null,CategoryValue:null,Title:null,SoloTitle:null,IsOtherRfv:!1,OnDemandRFV:null,CanDirectSchedule:null,CanRequest:null,CanRequestWithoutOverrides:null,DefaultVisitTypeId:null,DefaultVisitType:null,AllowProviderSelect:null,ReasonForVisitFirst:null,ProviderFirst:null,AllProviderDepartmentPairs:[],ProviderIds:[],ProviderDisplayString:"",NumberOfAvailableProviders:0,DepartmentIds:[],LocationDisplayString:"",NumberOfAvailableLocations:0,DirectProviderDepartmentPairIDs:[],DirectProviderDepartmentPairs:[],RequestProviderDepartmentPairIDs:[],RequestProviderDepartmentPairs:[],IsMultipleAppointments:!1,RawApptComponents:[],ApptComponents:[],AppointmentComponentIds:[],ApptComponentItems:[],PhotoUrl:null,PhotoFileName:null,SortOrder:null,State:null,ViewState:null,HelpText:null,SoloHelpText:null,EnabledForOnDemandVideoVisits:null,OnDemandTelemedicineVendorId:null,ScheduledTelemedicineVendorId:null,TelemedicineHardwareTestFdiId:null,UseDeepLinkForHardwareTest:null,TelemedicineMobileHardwareTestFdiId:null,TelemedicineVisitTypeId:null,EnabledForQuickSchedule:null,LineInWDF40040:null,AllowedTelemedicineLocations:null,LineInWDF15000:null,InitiallyHidden:null,OnDemandOrganization:null,OnDemandSlot:null,InternallyAvailableForTelehealth:!1,ExternallyAvailableForTelehealth:!1,AvailablePlatformsForLocalQuickSchedule:null,AvailablePlatformsForLocalOnDemand:null,IsNotAvailableForPatientsLocation:!1,AppointmentRequestIds:[],SpecialtyGroupId:null,AccessCode:"",AccessCodeFirstName:"",IsDemographicAuthRequired:!1,IsPlaceholder:!1,Description:"",HasIncompleteSchedulingData:!1,ExpectedPatientType:0,hasMultipleProviders:function WP$Scheduling$ReasonForVisit$hasMultipleProviders(){var e=0,t=[],i=null;if(!this.IsMultipleAppointments)return this.__hasUniqueProviders(this.AllProviderDepartmentPairs,t);for(e=0;e<this.ApptComponents.length;e++)if(i=this.ApptComponents[e],this.__hasUniqueProviders(i.AllProviderDepartmentPairs,t))return!0;return!1},__hasUniqueProviders:function WP$Scheduling$ReasonForVisit$__hasUniqueProviders(e,t){var i=0,r=null,n=e.length;for(i=0;i<n;i++)if(r=e[i].Provider,-1===t.indexOf(r)&&t.push(r),t.length>1)return!0;return!1},hasProvidersWithTelehealthLocations:function WP$Scheduling$ReasonForVisit$hasProvidersWithTelehealthLocations(){for(var e=null,t=null,i=0;i<this.DirectProviderDepartmentPairs.length;i++)if((t=this.DirectProviderDepartmentPairs[i]).CanScheduleTelemedicine&&(e=t.Provider,!$$WPUtil.IsNullOrEmpty(e.AllowedTelemedicineLocations)))return!0;return!1},hasMultipleDepartments:function WP$Scheduling$ReasonForVisit$hasMultipleDepartments(){var e=0,t=[],i=null;if(!this.IsMultipleAppointments)return this.__hasUniqueDepartments(this.AllProviderDepartmentPairs,t);for(e=0;e<this.ApptComponents.length;e++)if(i=this.ApptComponents[e],this.__hasUniqueDepartments(i.AllProviderDepartmentPairs,t))return!0;return!1},__hasUniqueDepartments:function WP$Scheduling$ReasonForVisit$__hasUniqueDepartments(e,t){var i=0,r=null,n=e.length;for(i=0;i<n;i++)if(r=e[i].Department,-1===t.indexOf(r)&&t.push(r),t.length>1)return!0;return!1},toRawRequestObject:function WP$Scheduling$ReasonForVisit$toRawRequestObject(){var e=[],t=0,i=null;if(this.RawApptComponents)for(t=0;t<this.RawApptComponents.length;t++)i=this.RawApptComponents[t],e.push(i.toRawRequestObject());return{Id:this.Id,CategoryValue:this.CategoryValue,Title:this.Title,DisplayName:this.DisplayName,CanDirectSchedule:this.CanDirectSchedule,CanRequest:this.CanRequest,CanRequestWithoutOverrides:this.CanRequestWithoutOverrides,DefaultVisitTypeId:this.DefaultVisitTypeId,AllowProviderSelect:this.AllowProviderSelect,ReasonForVisitFirst:this.ReasonForVisitFirst,ProviderFirst:this.ProviderFirst,providerIds:this.providerIds,providerDisplayString:this.providerDisplayString,numberOfAvailableProviders:this.numberOfAvailableProviders,departmentIds:this.departmentIds,locationDisplayString:this.locationDisplayString,numberOfAvailableLocations:this.numberOfAvailableLocations,DirectProviderDepartmentPairIDs:this.DirectProviderDepartmentPairIDs,RequestProviderDepartmentPairIDs:this.RequestProviderDepartmentPairIDs,RawApptComponents:e,ApptComponentItems:this.ApptComponentItems,PhotoUrl:this.PhotoUrl,PhotoFileName:this.PhotoFileName,SortOrder:this.SortOrder,AppointmentRequestIds:this.AppointmentRequestIds,AccessCode:this.AccessCode,AccessCodeFirstName:this.AccessCodeFirstName,IsDemographicAuthRequired:this.IsDemographicAuthRequired,SpecialtyGroupId:this.SpecialtyGroupId,EnabledForOnDemandVideoVisits:this.EnabledForOnDemandVideoVisits,TelemedicineVendorId:this.TelemedicineVendorId,TelemedicineVisitTypeId:this.TelemedicineVisitTypeId,ScheduledTelemedicineVendorId:this.ScheduledTelemedicineVendorId,OnDemandTelemedicineVendorId:this.OnDemandTelemedicineVendorId,TelemedicineHardwareTestFdiId:this.TelemedicineHardwareTestFdiId,UseDeepLinkForHardwareTest:this.UseDeepLinkForHardwareTest,TelemedicineMobileHardwareTestFdiId:this.TelemedicineMobileHardwareTestFdiId,EnabledForQuickSchedule:this.EnabledForQuickSchedule,AllowedTelemedicineLocations:this.AllowedTelemedicineLocations,AvailablePlatformsForLocalQuickSchedule:this.AvailablePlatformsForLocalQuickSchedule,AvailablePlatformsForLocalOnDemand:this.AvailablePlatformsForLocalOnDemand,InternallyAvailableForTelehealth:this.InternallyAvailableForTelehealth,ExternallyAvailableForTelehealth:this.ExternallyAvailableForTelehealth,OnDemandRFV:this.OnDemandRFV,OnDemandOrganization:this.OnDemandOrganization,OnDemandSlot:this.OnDemandSlot,LineInWDF15000:this.LineInWDF15000,LineInWDF40040:this.LineInWDF40040,InitiallyHidden:this.InitiallyHidden,Description:this.Description,IconCategoryId:this.IconCategoryId,CustomImage:this.CustomImage,HasIncompleteSchedulingData:this.HasIncompleteSchedulingData,ExpectedPatientType:this.ExpectedPatientType,HasPool:this.HasPool,Pool:this.Pool,IconImageUrl:this.IconImageUrl,IsPlaceholder:this.IsPlaceholder}}},n={Selected:0,Unselected:1},o=function WP$Scheduling$ReasonForVisit$s_populateProviderDepartmentPairsArray(e,t,i,r){var n,o=null,a=null;for(e.length=0,n=0;n<t.length;n++)o=t[n],null!==(a=i.getFromIndex("Id",o))&&(e.push(a),-1===r.indexOf(a)&&r.push(a))},a=function WP$Scheduling$ReasonForVisit$dereferenceReasonForVisit(e,t,i){var r,n=[];for(e.DefaultVisitType=t.getFromIndex("ID",e.DefaultVisitTypeId),o(e.DirectProviderDepartmentPairs,e.DirectProviderDepartmentPairIDs,i,n),o(e.RequestProviderDepartmentPairs,e.RequestProviderDepartmentPairIDs,i,n),e.AllProviderDepartmentPairs=n,r=0;r<e.ApptComponents.length;r++)a(e.ApptComponents[r],t,i)},s=function WP$Scheduling$ReasonForVisit$sortReasons(e,t){return e.IsOtherRfv||$$WPUtil.IsNullOrEmpty(e.SortOrder)?1:t.IsOtherRfv||$$WPUtil.IsNullOrEmpty(t.SortOrder)?-1:e.SortOrder-t.SortOrder},l=function WP$Scheduling$ReasonForVisit$s_constructApptComponents(e){var t,r=null;if(null!==e.RawApptComponents)for(e.IsMultipleAppointments=!0,t=0;t<e.RawApptComponents.length;t++)r=new i(e.RawApptComponents[t]),e.ApptComponents[t]=r,e.AppointmentComponentIds[t]=r.Id;else e.ApptComponents=[],e.AppointmentComponentIds=[]},d=function WP$Scheduling$ReasonForVisit$s_getOtherVisitType(e){var t=null;return(t=e.getFromIndex("ID","-1"))||(t=new $$WP.Scheduling.VisitType({ID:"-1",DisplayName:"",DefaultTelehealthMode:$$WP.Scheduling.VisitType.TelehealthModeEnum.InPerson,AllowedTelehealthModes:[],AllowProviderSelect:!0,AllowedProviderDepartmentPairs:[]}),e.add(t)),t},p=[{propertyNames:"Id",storeAs:"single"},{propertyNames:"State",storeAs:"set"},{propertyNames:"CategoryValue",storeAs:"array"},{propertyNames:"CanDirectSchedule",storeAs:"array"},{propertyNames:"CanRequest",storeAs:"array"},{propertyNames:"AllowProviderSelect",storeAs:"array"},{propertyNames:"ReasonForVisitFirst",storeAs:"array"},{propertyNames:"ProviderFirst",storeAs:"array"},{propertyNames:"InitiallyHidden",storeAs:"array"},{propertyNames:"SpecialtyGroupId",storeAs:"array"}],u=["State","ViewState"],h=[{propertyName:"State",value:n.Selected,bumpToValue:n.Unselected}];i.prototype=r,i.StatesEnum=n,i.PatientTypeEnum={Unknown:0,NewPatient:1,EstablishedPatient:2,Both:3},i.dereferenceReasonForVisit=a,i.dereferenceIds=function WP$Scheduling$ReasonForVisit$dereferenceIds(e,t,i){var r,n;for(r=0;r<e.size();r++)n=e.Models[r],a(n,t,i)},i.convertRawReasonsForVisit=function WP$Scheduling$ReasonForVisit$convertRawReasonsForVisit(e,t){var r,n,o,a=[];if(Array.isArray(e)){for(t.openChangeBatch(),r=0;r<e.length;r++)"object"==typeof(n=e[r])&&void 0!==n.Id&&(null!==(o=t.getFromIndex("Id",n.Id))&&t.remove(o),o=new i(n),t.add(o),a.push(o));t.closeChangeBatch()}return a},i.createReasonForVisitCollection=function WP$Scheduling$ReasonForVisit$createReasonForVisitCollection(){return new e(p,u,h)},i.sortReasons=s,i.sortReasonsForOnDemand=function WP$Scheduling$ReasonForVisit$sortReasonsForOnDemand(e,t){return e.EnabledForOnDemandVideoVisits!==t.EnabledForOnDemandVideoVisits?e.EnabledForOnDemandVideoVisits?-1:1:s(e,t)},i.addOtherOption=function WP$Scheduling$ReasonForVisit$addOtherOption(e,t,r,n,o){var a,s=null,l=0,p=null;for(a=d(r),(s=new i({Id:"-1",CategoryValue:"-1",Title:$$WP.Strings.get("OtherReasonForVisitTitle","Scheduling"),OnDemandRFV:!1,CanDirectSchedule:!1,CanRequest:!0,CanRequestWithoutOverrides:!0,AllowProviderSelect:!0,DefaultVisitTypeId:a.ID,ReasonForVisitFirst:!0,ProviderFirst:!0,RequestProviderDepartmentPairs:[],RequestProviderDepartmentPairIDs:[],DirectProviderDepartmentPairs:[],DirectProviderDepartmentPairIDs:[],AllProviderDepartmentPairs:[],RawApptComponents:null,PhotoUrl:n,PhotoFileName:o})).DefaultVisitType=a,s.HelpText=$$WP.Strings.get("OtherReasonForVisitDescription","Scheduling"),s.Description=s.HelpText,s.IsOtherRfv=!0,r.add(a),t.add(s),l=0;l<e.Models.length;l++)(p=e.Models[l]).CanRequest&&p.Provider.IsStandardProvider&&(s.AllProviderDepartmentPairs.push(p),s.RequestProviderDepartmentPairs.push(p),s.RequestProviderDepartmentPairIDs.push(p.Id),canAddOtherReasonForVisit=!0)},i.tryUpdateOtherOption=function WP$Scheduling$ReasonForVisit$tryUpdateOtherOption(e,t){var i,r,n=null;!(i=e.getFromIndex("CategoryValue","-1"))||i.length<1||(n=i[0],r=d(t),n.Id="-1",n.DefaultVisitType=r,n.Title=$$WP.Strings.get("OtherReasonForVisitTitle","Scheduling"),n.HelpText=$$WP.Strings.get("OtherReasonForVisitDescription","Scheduling"),n.SoloTitle=$$WP.Strings.get("OtherReasonForVisitSoloTitle","Scheduling"),n.SoloHelpText=$$WP.Strings.get("OtherReasonForVisitSoloDescription","Scheduling"),n.IsOtherRfv=!0,e.remove(n),e.add(n))},i.addOtherProviderDepartmentObject=function WP$Scheduling$ReasonForVisit$addOtherProviderDepartmentObject(e,t,i,r){var n,o=null,a=null,s=null,l=[];if(!e.DefaultVisitType.IsAdvanced){for(n=0;n<e.AllProviderDepartmentPairs.length;n++)a=e.AllProviderDepartmentPairs[n].Department,-1===l.indexOf(a)&&a.AllowAppointmentRequest&&(null!==(o=t.getFromIndex("Id",e.CategoryValue+"^"+a.ID))&&null!==o.CanRequest?o.CanRequest&&l.push(a):e.CanRequest&&l.push(a));for(n=0;n<l.length;n++)s=$$WP.Scheduling.ProviderDepartmentPair.addProviderDepartmentPair(i,r,l[n]),-1===e.AllProviderDepartmentPairs.indexOf(s)&&e.AllProviderDepartmentPairs.push(s),-1===e.RequestProviderDepartmentPairs.indexOf(s)&&e.RequestProviderDepartmentPairs.push(s)}},i.addOtherProviderOtherDepartmentObject=function WP$Scheduling$ReasonForVisit$addOtherProviderOtherDepartmentObject(e,t,i,r){var n=null;e.DefaultVisitType.IsAdvanced||e.CanRequestWithoutOverrides&&(n=$$WP.Scheduling.ProviderDepartmentPair.addProviderDepartmentPair(t,i,r),-1===e.AllProviderDepartmentPairs.indexOf(n)&&e.AllProviderDepartmentPairs.push(n),-1===e.RequestProviderDepartmentPairIDs.indexOf(n.Id)&&e.RequestProviderDepartmentPairIDs.push(n.Id),-1===e.RequestProviderDepartmentPairs.indexOf(n)&&e.RequestProviderDepartmentPairs.push(n))},i.getDepartmentIdMap=function WP$Scheduling$ReasonForVisit$getDepartmentIdMap(e){var t=0,i=0,r=new Map;if(e.ApptComponents.length>0)for(i=0;i<e.ApptComponents.length;i++)for(t=0;t<e.ApptComponents[i].AllProviderDepartmentPairs.length;t++){var n=(!!(o=e.ApptComponents[i].AllProviderDepartmentPairs[t])&&o.Department).ID;r.set(n,1)}else for(t=0;t<e.AllProviderDepartmentPairs.length;t++){var o;n=(!!(o=e.AllProviderDepartmentPairs[t])&&o.Department).ID;r.set(n,1)}return r},$$WP.Scheduling=$$WP.Scheduling||{},$$WP.Scheduling.ReasonForVisit=i,i.extend($$WP.Common.Model,"WP$Scheduling$ReasonForVisit")}();;
/*! Copyright Epic Systems Corporation 2018 */
$$WP=$$WP||{},$$WP.Geo=$$WP.Geo||{},$$WP.Geo.Coordinates=$$WP.Geo.Coordinates||{},$$WP.Geo.Coordinates.Helpers={getCoordinatesFromBrowser:function WP$Geo$Coordinates$Helpers$getCoordinatesFromBrowser(e,o,r){var t=$$WP.Geo.Coordinates.Helpers.ErrorCodes,a=$$WP.Geo.Coordinates.Helpers.ErrorMessages;"function"==typeof e&&"function"==typeof o||$$WP.Debug.logError("One or both callbacks are not a function."),navigator.geolocation?navigator.geolocation.getCurrentPosition((function successHandler(o){e(o.coords.latitude,o.coords.longitude,{timeout:r})}),(function errorHandler(e){switch(e.code){case e.PERMISSION_DENIED:o(t.PERMISSION_DENIED,a[t.PERMISSION_DENIED]);break;case e.POSITION_UNAVAILABLE:o(t.POSITION_UNAVAILABLE,a[t.POSITION_UNAVAILABLE]);break;case e.TIMEOUT:o(t.TIMEOUT,a[t.TIMEOUT]);break;case e.UNKNOWN_ERROR:o(t.UNKNOWN_ERROR,a[t.UNKNOWN_ERROR])}})):o(t.GEOLOCATION_NOT_SUPPORTED,a[t.GEOLOCATION_NOT_SUPPORTED])},lookUpCoordinatesFromDatabase:function WP$Geo$Coordinates$Helpers$lookUpCoordinatesFromDatabase(e,o,r){"function"==typeof o&&"function"==typeof r||$$WP.Debug.logError("One or both callbacks are not a function.");var t={successCallback:o,failureCallback:r};$.get({url:makeLink("Geo/GetCoordinatesFromDatabase"),data:{searchString:e},success:$.proxy(this._onReturnFromDatabase,t)})},ErrorCodes:{PERMISSION_DENIED:0,POSITION_UNAVAILABLE:1,TIMEOUT:2,UNKNOWN_ERROR:3,GEOLOCATION_NOT_SUPPORTED:4,DB_COULD_NOT_FIND_COORDS:5},ErrorMessages:{0:$$WP.Strings.get("PermissionDenied","Core.Geo"),1:$$WP.Strings.get("PositionUnavailable","Core.Geo"),2:$$WP.Strings.get("Timeout","Core.Geo"),3:$$WP.Strings.get("UnknownError","Core.Geo"),4:$$WP.Strings.get("GeolocationNotSupported","Core.Geo"),5:$$WP.Strings.get("DatabaseCouldNotFindCoordinates","Core.Geo")},getHaversineDistance:function WP$Geo$Coordinates$Helpers$_getHaversineDistance(e,o,r){var t,a,n;return t=new L.LatLng(e.Latitude,e.Longitude),a=new L.LatLng(o.Latitude,o.Longitude),n=t.distanceTo(a)/1e3,1===r&&(n*=.621371),n},getSimpleAverageOfCoordinates(e){var o=e.filter((e=>!!e.Latitude&&!!e.Longitude)).length;return{Latitude:e.reduce(((e,o)=>e+o.Latitude),0)/o,Longitude:e.reduce(((e,o)=>e+o.Longitude),0)/o}},_onReturnFromDatabase:function WP$Geo$Coordinates$Helpers$_onReturnFromDatabase(e){var o,r,t,a,n,s=$$WP.Geo.Coordinates.Helpers.ErrorCodes,i=$$WP.Geo.Coordinates.Helpers.ErrorMessages;o=this.successCallback,r=this.failureCallback,a=e.Latitude,n=e.Longitude,(t=e.Success)?a&&n&&t&&o(a,n):r(s.DB_COULD_NOT_FIND_COORDS,i[s.DB_COULD_NOT_FIND_COORDS])}};;
/*! Copyright 2017 Epic Systems Corporation */
!function WP$Scheduling$SearchCoordinatesPopulationMethod$definition(){var e=$$WP.Common.ModelCollection,t=$$WP.Geo.Coordinates,o=$$WP.Geo.Coordinates.Helpers,r=function WP$Scheduling$SearchCoordinatesPopulationMethod(e,t){this.WP$Common$Model(e),this.SearchCoordinates=t,this.State=s.Unselected,this.DisplayText=$$WP.Strings.get("SearchCoordinatesPopulationMethodDescription_"+this.Type,"Scheduling.OnMyWay"),this.Type===r.Types.LOOK_UP_ZIP_CODE&&(this.IsSearchable=!0,this.PlaceholderText=$$WP.Strings.get("SearchCoordinatesZipCodeInputPlaceholder","Scheduling.OnMyWay"))},a={s_dataMembers:["Type","State","DisplayText","IsSearchable","PlaceholderText","SearchCoordinates"],Type:null,State:null,DisplayText:null,IsSearchable:null,PlaceholderText:null,SearchString:null,SearchCoordinates:null,BrowserCoordinates:null,populateNewSearchCoordinates:function WP$Scheduling$SearchCoordinatesPopulationMethod$populateNewSearchCoordinates(e,t,o){var a;switch(this.Type){case r.Types.GET_FROM_BROWSER:null===this.BrowserCoordinates?this._getSearchCoordinatesFromBrowser(t,o):(a={context:this,successCallback:t,errorCallback:o},$.proxy(this._onGetCoordinatesSuccess,a)());break;case r.Types.LOOK_UP_ZIP_CODE:this.SearchString=e,this._getSearchCoordinatesFromSearchString(e,t,o);break;case r.Types.COORDINATES_NOT_REQUIRED:this._setSearchCoordinatesNotRequired(t);break;default:$$WP.Debug.logError("Invalid search coordinates population method type.")}},_getSearchCoordinatesFromBrowser:function WP$Scheduling$SearchCoordinatesPopulationMethod$_getSearchCoordinatesFromBrowser(e,t){var r={context:this,successCallback:e,errorCallback:t};o.getCoordinatesFromBrowser($.proxy(this._onGetCoordinatesSuccess,r),$.proxy(this._onGetCoordinatesFailure,r),3e4)},_getSearchCoordinatesFromSearchString:function WP$Scheduling$SearchCoordinatesPopulationMethod$_getSearchCoordinatesFromSearchString(e,t,r){var a={context:this,successCallback:t,errorCallback:r};o.lookUpCoordinatesFromDatabase(e,$.proxy(this._onGetCoordinatesSuccess,a),$.proxy(this._onGetCoordinatesFailure,a))},_onGetCoordinatesSuccess:function WP$Scheduling$SearchCoordinatesPopulationMethod$_onGetCoordinatesSuccess(e,o){var a;this.context&&(this.context.setProperty("State",s.Selected),this.context.Type===r.Types.GET_FROM_BROWSER?null===this.context.BrowserCoordinates?(this.context.SearchCoordinates.setUserCoordinates(e,o),(a=new t).setProperty("Latitude",e),a.setProperty("Longitude",o),this.context.BrowserCoordinates=a):this.context.SearchCoordinates.setUserCoordinates(this.context.BrowserCoordinates.Latitude,this.context.BrowserCoordinates.Longitude):this.context.Type===r.Types.LOOK_UP_ZIP_CODE&&this.context.SearchCoordinates.setCoordinates(e,o),this.successCallback&&"function"==typeof this.successCallback&&this.successCallback(this.context))},_onGetCoordinatesFailure:function WP$Scheduling$SearchCoordinatesPopulationMethod$_onGetCoordinatesFailure(e,t){this.context&&(this.context.setProperty("State",s.Unselected),this.context.SearchCoordinates.setError(e,t),this.errorCallback&&"function"==typeof this.errorCallback&&this.errorCallback(this.context))},_setSearchCoordinatesNotRequired:function WP$Scheduling$SearchCoordinatesPopulationMethod$_setSearchCoordinatesNotRequired(e){this.setProperty("State",s.Selected),this.SearchCoordinates.setIntentionallyEmpty(),e&&"function"==typeof e&&e(this)}},s={Unselected:0,Selected:1},n=[{propertyNames:"Type",storeAs:"single"},{propertyNames:"State",storeAs:"set"}],i=["State","SearchCoordinates"],c=[{propertyName:"State",value:s.Selected,bumpToValue:s.Unselected}];r.prototype=a,r.StatesEnum=s,r.Types={GET_FROM_BROWSER:"GETFROMBROWSER",LOOK_UP_ZIP_CODE:"LOOKUPZIPCODE",COORDINATES_NOT_REQUIRED:"COORDINATESNOTREQUIRED"},r.convertRawSearchCoordinatesPopulationMethods=function WP$Scheduling$SearchCoordinatesPopulationMethod$convertRawSearchCoordinatesPopulationMethods(e,t,o){var a,s,n,i,c;if(a=[],Array.isArray(e)){for(t.openChangeBatch(),s=0;s<e.length;s++)"object"==typeof(n=e[s])&&(i=n.Type,null===(c=t.getFromIndex("Type",i))&&(c=new r(n,o),t.add(c)),a.push(c));t.closeChangeBatch()}return a},r.createSearchCoordinatesPopulationMethodCollection=function WP$Scheduling$SearchCoordinatesPopulationMethod$createSearchCoordinatesPopulationMethodCollection(){return new e(n,i,c)},$$WP.Scheduling=$$WP.Scheduling||{},$$WP.Scheduling.SearchCoordinatesPopulationMethod=r,r.extend($$WP.Common.Model,"WP$Scheduling$SearchCoordinates")}();;
!function WP$Scheduling$OnMyWay$ChiefComplaint$definition(){var n=$$WP.Common.ModelCollection,e=function WP$Scheduling$OnMyWay$ChiefComplaint(n){this.WP$Common$Model(n)},i=[{propertyNames:"ID",storeAs:"single"}],l=[];e.prototype={s_dataMembers:["ID","DisplayName","IsOther","IsUrgent"],ID:null,DisplayName:null,IsOther:!1,IsUrgent:!1},e.convertRawChiefComplaints=function WP$Scheduling$OnMyWay$ChiefComplaint$convertRawChiefComplaints(n,i){var l=0,o=null,t=null;if(Array.isArray(n))for(l=0;l<n.length;l++)"object"==typeof(o=n[l])&&void 0!==o.ID&&(t=new e(o),i.add(t))},e.createChiefComplaintsCollection=function(){return new n(i,l)},$$WP.Scheduling=$$WP.Scheduling||{},$$WP.Scheduling.OnMyWay=$$WP.Scheduling.OnMyWay||{},$$WP.Scheduling.OnMyWay.ChiefComplaint=e,e.extend($$WP.Common.Model,"WP$Scheduling$OnMyWay$ChiefComplaint")}();;
!function WP$Scheduling$ProviderDepartmentPair$definition(){var e=$$WP.Common.ModelCollection,r=function WP$Scheduling$ProviderDepartmentPair(e){this.WP$Common$Model(e),this.Id=this.ProviderId+"^"+this.DepartmentId},t=function WP$Scheduling$ProviderDepartmentPair$mergeProviderDepartmentPairs(e,r){var t,i,n={},d=null,o=e.ProviderId+"^"+e.DepartmentId;if(r.Id===o){for(t=0;t<r.VisitTypeInformation.length;t++)n[(d=r.VisitTypeInformation[t]).VisitTypeID]=d;for(i=0;i<e.VisitTypeInformation.length;i++)null===n[(d=e.VisitTypeInformation[i]).VisitTypeID]&&r.VisitTypeInformation.push(d);e.ChildProviderIds.length>0&&e.ChildProviderIds.length!==r.ChildProviderIds.length&&(r.ChildProviderIds=e.ChildProviderIds),r.PoolLine=e.PoolLine,r.PoolTier=e.PoolTier}},i=function WP$Scheduling$ProviderDepartmentPair$dereferenceIdsOnPair(e,r,t){e.Provider=r.getFromIndex("ID",e.ProviderId),e.Department=t.getFromIndex("ID",e.DepartmentId)},n=[{propertyNames:"Id",storeAs:"single"},{propertyNames:"ProviderId",storeAs:"array"},{propertyNames:"DepartmentId",storeAs:"array"}];r.prototype={s_dataMembers:["ProviderId","DepartmentId","ChildProviderIds","IsTeamMember","CanRequest","CanScheduleTelemedicine","CanLoginToSchedule","VisitTypeInformation","IsInNetwork","PoolLine","PoolTier"],Id:"",ProviderId:"",DepartmentId:"",Provider:null,Department:null,ChildProviderIds:[],IsTeamMember:!1,CanRequest:!1,CanScheduleTelemedicine:!1,CanLoginToSchedule:!1,VisitTypeInformation:[],PatientAge:[],IsInNetwork:!1,PoolLine:null,PoolTier:null,toRawRequestObject:function WP$Scheduling$ProviderDepartmentPair$toRawRequestObject(){return{ProviderId:this.ProviderId,DepartmentId:this.DepartmentId,ChildProviderIds:this.ChildProviderIds,IsTeamMember:this.IsTeamMember,PoolLine:this.PoolLine,PoolTier:this.PoolTier}},determinePatientAge:function WP$Scheduling$ProviderDepartmentPair$determinePatientAge(e){var r=0,t=null,i=null;for(this.PatientAge=[],r=0;r<this.VisitTypeInformation.length;r++)if((t=this.VisitTypeInformation[r]).VisitTypeID===e){i=t;break}null!==i&&("0"!==i.SeesChildren&&this.addSeenPatientAge($$WP.Scheduling.FilterController.PatientAgeFilterSeesChildrenValue()),"0"!==i.SeesAdolescents&&this.addSeenPatientAge($$WP.Scheduling.FilterController.PatientAgeFilterSeesAdolescentsValue()))},addSeenPatientAge:function WP$Scheduling$ProviderDepartmentPair$addSeenPatientAge(e){-1===this.PatientAge.indexOf(e)&&this.PatientAge.push(e),-1===this.Provider.PatientAge.indexOf(e)&&this.Provider.PatientAge.push(e)},setNetworkStatusOnProvider:function WP$Scheduling$ProviderDepartmentPair$setNetworkStatusOnProvider(){this.Provider.IsInNetwork||(this.Provider.IsInNetwork=this.IsInNetwork)}},r.dereferenceIds=function WP$Scheduling$ProviderDepartmentPair$dereferenceIds(e,r,t){var n;for(n=0;n<e.size();n++)i(e.Models[n],r,t)},r.dereferenceIdsOnPair=i,r.convertRawProviderDepartmentPairs=function WP$Scheduling$ProviderDepartmentPair$convertRawProviderDepartmentPairs(e,i){var n,d,o,a,P;if(a=[],Array.isArray(e))for(n=0;n<e.length;n++)"object"==typeof(d=e[n])&&(P=d.ProviderId+"^"+d.DepartmentId,null===(o=i.getFromIndex("Id",P))?(o=new r(d),i.add(o)):t(d,o),a.push(o));return a},r.createProviderDepartmentPairsCollection=function WP$Scheduling$ProviderDepartmentPair$createProviderDepartmentPairsCollection(){return new e(n)},r.createProviderDepartmentPair=function WP$Scheduling$ProviderDepartmentPair$createProviderDepartmentPair(e,r){var t=null;return(t=new $$WP.Scheduling.ProviderDepartmentPair({ProviderId:e.ID,DepartmentId:r.ID})).Provider=e,t.Department=r,t},r.addProviderDepartmentPair=function WP$Scheduling$ProviderDepartmentPair$addProviderDepartmentPair(e,r,t){var i=null;return null===(i=e.getFromIndex("Id",r.ID+"^"+t.ID))&&((i=$$WP.Scheduling.ProviderDepartmentPair.createProviderDepartmentPair(r,t,[],[])).CanRequest=!0,e.add(i)),i},$$WP.Scheduling=$$WP.Scheduling||{},$$WP.Scheduling.ProviderDepartmentPair=r,r.extend($$WP.Common.Model,"WP$Scheduling$ProviderDepartmentPair")}(),$$WP.Debug.UnitTest=$$WP.Debug.UnitTest||{},$$WP.Debug.UnitTest.tests=$$WP.Debug.UnitTest.tests||[],$$WP.Debug.UnitTest.tests.push((function UnitTests$ProviderDepartmentPair(e){$$WP.Debug.UnitTest.assert}));;
/*! Copyright 2016-2020 Epic Systems Corporation */
!function WP$Scheduling$ReasonForVisitDepartmentOverride$definition(){var e=$$WP.Common.ModelCollection,t=function WP$Scheduling$ReasonForVisitDepartmentOverride(e){this.WP$Common$Model(e),this.Id=this.ReasonForVisitId+"^"+this.DepartmentId},r=[{propertyNames:"Id",storeAs:"single"},{propertyNames:"ReasonForVisitId",storeAs:"array"},{propertyNames:"DepartmentId",storeAs:"array"},{propertyNames:"CanDirectSchedule",storeAs:"array"},{propertyNames:"CanRequest",storeAs:"array"},{propertyNames:"VisitTypeId",storeAs:"array"}];t.prototype={s_dataMembers:["ReasonForVisitId","DepartmentId","VisitTypeId","CanDirectSchedule","CanRequest","VisitTypeId"],Id:null,ReasonForVisitId:null,DepartmentId:null,VisitTypeId:null,ReasonForVisit:null,Department:null,VisitType:null,CanDirectSchedule:null,CanRequest:null},t.dereferenceIds=function WP$Scheduling$ReasonForVisitDepartmentOverride$dereferenceIds(e,t,r,n){var i,s;for(i=0;i<e.size();i++)(s=e.Models[i]).ReasonForVisit=t.getFromIndex("Id",s.ReasonForVisitId),s.Department=r.getFromIndex("ID",s.DepartmentId),s.VisitType=n.getFromIndex("ID",s.VisitTypeId)},t.convertRawReasonForVisitDepartmentOverrides=function WP$Scheduling$ReasonForVisitDepartmentOverride$rawReasonForVisitDepartmentOverrides(e,r){var n,i,s,o,a;if(s=[],Array.isArray(e)){for(r.openChangeBatch(),n=0;n<e.length;n++)"object"==typeof(a=e[n])&&(o=a.ReasonForVisitId+"^"+a.DepartmentId,null===(i=r.getFromIndex("Id",o))&&(i=new t(a),r.add(i)),s.push(i));r.closeChangeBatch()}return s},t.createReasonForVisitDepartmentOverridesCollection=function WP$Scheduling$ReasonForVisitDepartmentOverride$createReasonForVisitDepartmentOverridesCollection(){return new e(r)},t.getOverride=function WP$Scheduling$ReasonForVisitDepartmentOverride$getOverride(e,t,r){var n=e.CategoryValue+"^"+t;return r.getFromIndex("Id",n)},$$WP.Scheduling=$$WP.Scheduling||{},$$WP.Scheduling.ReasonForVisitDepartmentOverride=t,t.extend($$WP.Common.Model,"WP$Scheduling$ReasonForVisitDepartmentOverride")}(),$$WP.Debug.UnitTest=$$WP.Debug.UnitTest||{},$$WP.Debug.UnitTest.tests=$$WP.Debug.UnitTest.tests||[],$$WP.Debug.UnitTest.tests.push((function UnitTests$ReasonForVisitDepartmentOverride(e){$$WP.Debug.UnitTest.assert}));;
!function WP$Scheduling$VisitType$definition(){var e=$$WP.Common.ModelCollection,i=$$WP.Scheduling.Appointment,t={NotDefined:0,InPerson:1,Video:2,Telephone:3,ClinicToClinicVideo:4},l=function WP$Scheduling$VisitType(e){this.WP$Common$Model(e),this.TieredProvidersCollection=$$WP.Scheduling.Provider.createProviderCollection(),this.TieredLocationsCollection=$$WP.Scheduling.Location.createLocationCollection(),this.TieredProviderDepartmentPairsCollection=$$WP.Scheduling.ProviderDepartmentPair.createProviderDepartmentPairsCollection(),this.TieredRequestProviderDepartmentPairs=[]},n={s_dataMembers:["ID","DisplayName","DefaultTelehealthMode","AllowedTelehealthModes","TelehealthModeDisplayNames","AllowProviderSelect","AllowChangeProvAndLocInResched","QuestionnaireId","DecisionTreeId","AnonymousSchedulingDecisionTreeId","SchedulingInstructions","FromMinutesOffset","FromDaysOffset","ToDaysOffset","AllowTeamScheduling","IsAdvanced","IsConditionalPanel","CanLoadMoreTiers","TierSearchRange","Tier","PoolLine","MaxPoolLine","MaxPoolTier","IsPlaceholder","CustomStepBodyKey","CustomStepHeader","CustomStepContinueButtonText","ShowPanelAsMultipleVisits","HasSeparateLocationSelectionInPanels","MenuLinkCompleteUri","DataAttributes","ShowLocationStepForTelehealthVisit","AllowProviderStepInDirectSched","HasAlreadyLoadedTieredData"],ID:null,DisplayName:null,DefaultTelehealthMode:null,AllowedTelehealthModes:null,TelehealthModeDisplayNames:null,AllowProviderSelect:null,AllowChangeProvAndLocInResched:null,QuestionnaireId:null,DecisionTreeId:null,AnonymousSchedulingDecisionTreeId:"",SchedulingInstructions:null,FromMinutesOffset:null,FromDaysOffset:null,ToDaysOffset:null,AllowTeamScheduling:null,IsAdvanced:!1,IsConditionalPanel:!1,CanLoadMoreTiers:!1,TierSearchRange:null,Tier:null,PoolLine:null,IsPlaceholder:!1,ShowLocationStepForTelehealthVisit:!1,ShowPanelAsMultipleVisits:!1,HasSeparateLocationSelectionInPanels:!1,CustomStepBodyKey:null,CustomStepHeader:null,CustomStepContinueButtonText:null,MenuLinkCompleteUri:null,DataAttributes:null,AllowProviderStepInDirectSched:!1,TieredProvidersCollection:null,TieredLocationsCollection:null,TieredDepartmentsCollection:null,TieredProviderDepartmentPairsCollection:null,TieredRequestProviderDepartmentPairs:[],HasAlreadyLoadedTieredData:!1,MaxPoolLine:null,MaxPoolTier:null,isInPerson:function WP$Scheduling$VisitType$isInPerson(){return o(this.DefaultTelehealthMode)},isVideoVisit:function WP$Scheduling$VisitType$isVideoVisit(){return this.DefaultTelehealthMode===t.Video},isTelephoneVisit:function WP$Scheduling$VisitType$isTelephoneVisit(){return this.DefaultTelehealthMode===t.Telephone},isVisitTypeMyChartLink:function WP$Scheduling$isVisitTypeMyChartLink(){return!$$WPUtil.IsNullOrEmpty(this.MenuLinkCompleteUri)},hasNonAnonymousLqf:function WP$Scheduling$VisitType$hasNonAnonymousLqf(){var e=!1;return $$WPUtil.IsNullOrEmpty(this.QuestionnaireId)||(e=!0),$$WPUtil.IsNullOrEmpty(this.DecisionTreeId)||(e=!0),e},syncTelehealthData:function WP$Scheduling$VisitType$syncTelehealthData(e){e&&(e.AllowedTelehealthModes&&(this.AllowedTelehealthModes=e.AllowedTelehealthModes),e.DefaultTelehealthMode&&(this.DefaultTelehealthMode=e.DefaultTelehealthMode))},syncPoolData:function WP$Scheduling$VisitType$syncPoolData(e){e&&(e.PoolLine&&(this.MaxPoolLine=e.PoolLine),e.Tier&&(this.MaxPoolTier=e.Tier))}},o=function WP$Scheduling$VisitType$isInPersonTelehealthMode(e){return e===t.NotDefined||e===t.InPerson||e===t.ClinicToClinicVideo},s=[{propertyNames:"ID",storeAs:"single"}];l.prototype=n,l.TelehealthModeEnum=t,l.AllowTeamSchedulingEnum={NoTeamScheduling:0,PcpOnly:1,AllProviders:2},l.convertRawVisitTypes=function WP$Scheduling$VisitType$convertRawVisitTypes(e,i){var t,n,o,s;if(s=[],Array.isArray(e))for(t=0;t<e.length;t++)"object"==typeof(n=e[t])&&void 0!==n.ID&&(null===(o=i.getFromIndex("ID",n.ID))&&(o=new l(n),i.add(o)),null!==o&&(o.syncTelehealthData(n),o.syncPoolData(n)),null!==o&&n&&n.CanLoadMoreTiers&&(o.CanLoadMoreTiers=n.CanLoadMoreTiers),s.push(o));return s},l.createVisitTypeCollection=function WP$Scheduling$VisitType$createVisitTypeCollection(){return new e(s)},l.getVisitTypeForDepartment=function WP$Scheduling$VisitType$getVisitTypeForDepartment(e,t,l){if(t.VisitTypeSource!==i.VisitTypeSourceEnum.Default||$$WPUtil.IsNullOrEmpty(e.AppointmentBuilder.ReasonForVisit)||$$WPUtil.IsNullOrEmpty(l))return t.VisitType;var n=e.ReasonForVisitDepartmentOverrides.getFromIndex("Id",e.AppointmentBuilder.ReasonForVisit.CategoryValue+"^"+l.ID),o=null;return $$WPUtil.IsNullOrEmpty(n)||(o=n.VisitType),$$WPUtil.IsNullOrEmpty(o)&&(o=t.VisitType),o},l.canStartSchedulingWhenEmpty=function WP$Scheduling$canStartSchedulingWhenEmpty(e,i,t,l){var n;return!!e.IsPlaceholder&&(n=!$$WPUtil.IsNullOrEmpty(e.AnonymousSchedulingDecisionTreeId),i||t&&l?n:e.hasNonAnonymousLqf())},l.isInPersonTelehealthMode=o,$$WP.Scheduling.VisitType=l,l.extend($$WP.Common.Model,"WP$Scheduling$VisitType")}(),$$WP.Debug.UnitTest=$$WP.Debug.UnitTest||{},$$WP.Debug.UnitTest.tests=$$WP.Debug.UnitTest.tests||[],$$WP.Debug.UnitTest.tests.push((function UnitTests$Scheduling$VisitType(e){$$WP.Debug.UnitTest.assert}));;
/*! Copyright 2016-2017 Epic Systems Corporation */
!function WP$Scheduling$VisitTypeDepartmentOverride$definition(){var e=$$WP.Common.ModelCollection,t=function WP$Scheduling$VisitTypeDepartmentOverride(e){this.WP$Common$Model(e),this.Id=this.VisitTypeId+"^"+this.DepartmentId},i=[{propertyNames:"Id",storeAs:"single"},{propertyNames:"VisitTypeId",storeAs:"array"},{propertyNames:"DepartmentId",storeAs:"array"}];t.prototype={s_dataMembers:["VisitTypeId","DepartmentId","FromMinutesOffset","FromDaysOffset","ToDaysOffset","AllowTeamScheduling"],Id:null,VisitTypeId:null,DepartmentId:null,VisitType:null,Department:null,FromMinutesOffset:null,FromDaysOffset:null,ToDaysOffset:null,AllowTeamScheduling:null},t.dereferenceIds=function WP$Scheduling$VisitTypeDepartmentOverride$dereferenceIds(e,t,i){var r,n;for(r=0;r<e.size();r++)(n=e.Models[r]).VisitType=t.getFromIndex("ID",n.VisitTypeId),n.Department=i.getFromIndex("ID",n.DepartmentId)},t.convertRawVisitTypeDepartmentOverrides=function WP$Scheduling$VisitTypeDepartmentOverride$convertRawVisitTypeDepartmentOverrides(e,i){var r,n,s,d,p;if(s=[],Array.isArray(e)){for(i.openChangeBatch(),r=0;r<e.length;r++)"object"==typeof(p=e[r])&&(d=p.VisitTypeId+"^"+p.DepartmentId,null===(n=i.getFromIndex("Id",d))&&(n=new t(p),i.add(n)),s.push(n));i.closeChangeBatch()}return s},t.createVisitTypeDepartmentOverridesCollection=function WP$Scheduling$VisitTypeDepartmentOverride$createVisitTypeDepartmentOverridesCollection(){return new e(i)},$$WP.Scheduling=$$WP.Scheduling||{},$$WP.Scheduling.VisitTypeDepartmentOverride=t,t.extend($$WP.Common.Model,"WP$Scheduling$VisitTypeDepartmentOverride")}(),$$WP.Debug.UnitTest=$$WP.Debug.UnitTest||{},$$WP.Debug.UnitTest.tests=$$WP.Debug.UnitTest.tests||[],$$WP.Debug.UnitTest.tests.push((function UnitTests$VisitTypeDepartmentOverride(e){$$WP.Debug.UnitTest.assert}));;
!function WP$Scheduling$SchedulingMenuReasonForVisit$definition(){var e=function WP$Scheduling$SchedulingMenuReasonForVisit(e){this.WP$Common$Model(e)},convertRawSchedulingMenuReasonForVisit=function(n){return new e(n)},n=[{propertyNames:"Id",storeAs:"single"}];e.prototype={s_dataMembers:["CategoryValue"],ReasonForVisitId:null,CategoryValue:null,Id:null},e.convertRawSchedulingMenuReasonsForVisit=function(e,n){var o,l,i=null,r=null,t=null;if(!Array.isArray(e))return[];for(o=0;o<e.length;o++)for(i=e[o].ReasonsForVisit,l=0;l<i.length;l++)r=i[l],t=convertRawSchedulingMenuReasonForVisit(r),n.add(t);return n},e.dereferenceIds=function(e,n){for(var o=[],l=null,i=0;i<e.Models.length;i++)l=e.Models[i],(o=n.getFromIndex("CategoryValue",l.CategoryValue))&&o.length>0?l.ReasonForVisitId=o[0].Id:l=null},e.createSchedulingMenuReasonForVisitCollection=function(){return new $$WP.Common.ModelCollection(n)},$$WP.Scheduling.SchedulingMenuReasonForVisit=e,e.extend($$WP.Common.Model,"WP$Scheduling$SchedulingMenuReasonForVisit")}();;
!function WP$Scheduling$SchedulingMenu$definition(){var e=$$WP.Scheduling.SchedulingMenuReasonForVisit,n=function WP$Scheduling$SchedulingMenu(e){this.WP$Common$Model(e),this.Submenus=[]},dereferenceSubmenus=function(e,n){for(var l=null,s=null,i=0;i<e.SubmenuIDs.length;i++)l=e.SubmenuIDs[i],s=n.getFromIndex("ID",l),e.Submenus.push(s)},convertRawSchedulingMenu=function(l){var s=new n(l),i=e.createSchedulingMenuReasonForVisitCollection();return e.convertRawSchedulingMenuReasonsForVisit([l],i),s.ReasonsForVisit=i.Models,s},l=[{propertyNames:"ID",storeAs:"single"}];n.prototype={s_dataMembers:["ID","FullDisplayNameUTF8","SubmenuIDs","DisplayNameUTF8","DescriptionUTF8","DisplayImage","DisplayImageUrl","IsRoot","SpecialtyIDs","IsSpecialty"],ID:null,FullDisplayNameUTF8:null,DisplayNameUTF8:null,DescriptionUTF8:null,DisplayImage:null,DisplayImageUrl:null,IsRoot:!1,SubmenuIDs:[],Submenus:[],SpecialtyIDs:null,ReasonsForVisit:null,ReasonsForVisitIds:[],SchedulingMenuId:null,IsSpecialty:!1},n.convertRawSchedulingMenus=function(e,n,l){var s=null,i=null;if(!Array.isArray(e))return[];for(var u=0;u<e.length;u++){s=e[u],i=convertRawSchedulingMenu(s),n.add(i);for(var o=0;o<i.ReasonsForVisit.length;o++)l.add(i.ReasonsForVisit[o])}},n.createSchedulingMenuCollection=function(){return new $$WP.Common.ModelCollection(l)},n.dereferenceIds=function(e){for(var n=null,l=null,s=null,i=0;i<e.Models.length;i++){n=e.Models[i],dereferenceSubmenus(n,e),n.ReasonsForVisitIds=[];for(var u=0;u<n.ReasonsForVisit.length;u++)(l=n.ReasonsForVisit[u]).SchedulingMenuId=n.ID,s=l.SchedulingMenuId+"^"+l.ReasonForVisitId,l.Id=s,n.ReasonsForVisitIds.push(s)}},$$WP.Scheduling.SchedulingMenu=n,n.extend($$WP.Common.Model,"WP$Scheduling$SchedulingMenu")}();;
!function WP$Scheduling$SchedulingMenuItem$definition(){var e=$$WP.Common.ModelCollection,n=function WP$Scheduling$SchedulingMenuItem(e){this.WP$Common$Model(e),this._convertEpicHttpLink()},t=[{propertyNames:"Id",storeAs:"single"}];n.prototype={s_dataMembers:["Name","Description","Icon","Link"],Name:"",Description:"",Icon:"",Link:"",_convertEpicHttpLink:function WP$Scheduling$SchedulingMenuItem$convertEpicHttpLink(){var e=this.Link;if(!$$WPUtil.IsNullOrEmpty(e)&&!$$WP.Utilities.UI.IsMobile){var n=e.split("epichttp://");n.length>1&&(n[1].toLowerCase().startsWith("http")&&(this.Link=null),this.Link=n[1])}},_resolveIconPath:function WP$Scheduling$SchedulingMenuItem$resolveIconPath(){var e=this.Icon;$$WPUtil.IsNullOrEmpty(e)||(e.startsWith("~")?this.Icon=e.substring(1):this.Icon="library.svg#"+e)}},n.createSchedulingMenuItemsCollection=function WP$Scheduling$SchedulingMenuItem$createSchedulingMenuItemsCollection(){return new e(t)},n.convertRawSchedulingMenuItems=function WP$Scheduling$SchedulingMenuItem$convertRawSchedulingMenuItems(e,t){var i,c,o,l=[];if(Array.isArray(e)){for(t.openChangeBatch(),i=0;i<e.length;i++)"object"==typeof(c=e[i])&&void 0!==c.Id&&(o=t.getFromIndex("Id",c.Id),$$WPUtil.IsNullOrEmpty(o)||t.remove(o),o=new n(c),t.add(o),l.push(o));t.closeChangeBatch()}return l},$$WP.Scheduling=$$WP.Scheduling||{},$$WP.Scheduling.SchedulingMenuItem=n,n.extend($$WP.Common.Model,"WP$Scheduling$SchedulingMenuItem")}();;
!function WP$Scheduling$Slot$definition(){var e=$$WP.Common.ModelCollection,t=$$WP.Scheduling.VisitType,i=function WP$Scheduling$Slot(e){var i,n,o,a,s;i=(new Date).getTimezoneOffset(),n=new Date(Date.UTC(1841,0,1)),this.WP$Common$Model(e),this.State=r.Unselected,this.DisplayDte=this.Dte,this.YearUtc&&this.MonthUtc&&(this.DateTimeUtc=new Date(Date.UTC(this.YearUtc,this.MonthUtc-1,this.DayUtc,this.HourUtc,this.MinuteUtc)),$$WPUtil.IsNullOrEmpty(this.TimeZoneOffsetInMinutes)||i===this.TimeZoneOffsetInMinutes||(t.isInPersonTelehealthMode(this.TelehealthMode)?this.ShowTimeZone=!0:(o=new Date(Date.UTC(this.DateTimeUtc.getFullYear(),this.DateTimeUtc.getMonth(),this.DateTimeUtc.getDate())),localDisplayDateString=o.toString(),a=!(s=e.TimeString.toLowerCase()).includes("am")&&!s.includes("pm"),this.Hour=this.DateTimeUtc.getHours(),this.Minute=this.DateTimeUtc.getMinutes(),this.EffectiveApptTime=60*(60*this.Hour+this.Minute),this.TimeString=new Date(this.DateTimeUtc).toLocaleTimeString([],{hour:"numeric",minute:"2-digit",hour12:!a}),this.DisplayDte=1+Math.floor((o-n)/864e5),this.DateString=new Date(this.DateTimeUtc).toLocaleDateString([],{weekday:"long",year:"numeric",month:"long",day:"numeric"}),this.DaysAhead=Math.abs(WP.Utils.date2dte(new Date)-WP.Utils.date2dte(this.DateTimeUtc)),this.ClientDatabaseMinuteOffset=this.TimeZoneOffsetInMinutes-i))),l[this.DisplayDte]=this.DateString},n=WP.Utils.date2dte(new Date),l={},r={Selected:0,Unselected:1},o=function WP$Scheduling$Slot$getSlotKey(e,t,i,n,l,r,o,a,s){var u;switch(u=a+"^"+(s?"1":""),e){case $$WP.Scheduling.Workflow.WorkflowTypesEnum.Ticket:return"T^"+n+"^"+u;case $$WP.Scheduling.Workflow.WorkflowTypesEnum.Reschedule:return"R^"+i+"^"+u;case $$WP.Scheduling.Workflow.WorkflowTypesEnum.DecisionTreeNode:return"DT^"+l+"^"+r+"^"+o+"^"+u;default:return t+"^"+u}},a=function WP$Scheduling$Slot$slotSortFunction(e,t){return e.DateTimeUtc-t.DateTimeUtc},s=[{propertyNames:"State",storeAs:"set"}],u=["State"],c=[{propertyName:"State",value:r.Selected,bumpToValue:r.Unselected}],h=function WP$Scheduling$Slot$s_getRawSlotFromUid(e){return JSON.parse(e)};i.prototype={s_dataMembers:["Dte","InternalStartTime","DisplayDte","DateTime","YearUtc","MonthUtc","DayUtc","HourUtc","MinuteUtc","ProviderId","DepartmentId","SlotProviderIds","VisitTypeId","TimeString","TimeZoneMarker","TimeZoneOffsetInMinutes","ShowTimeZone","TelehealthMode","LengthInMinutes","PrimaryProvLengthInMin","Hour","Minute","DaysAhead","DateString","StartTime","ArrivalTime","ArrivalDteUtc","ArrivalTimeUtc","EffectiveApptTime","IsRequest","IsAllowedDuplicate","IsDisallowedDuplicate","DuplicateEncounterDte","DuplicateVisitTypeName","ReservationExpirationTimeString","ReservationKey","IsApptSrchHeld","VisitIndex","IsPreselected","ClientDatabaseMinuteOffset"],Dte:null,InternalStartTime:null,DisplayDte:null,StartTime:null,ArrivalTime:null,ArrivalDteUtc:null,ArrivalTimeUtc:null,EffectiveApptTime:null,DateTime:null,DateTimeUtc:null,YearUtc:null,MonthUtc:null,DayUtc:null,HourUtc:null,MinuteUtc:null,ProviderId:null,DepartmentId:null,SlotProviderIds:[],VisitTypeId:null,TimeString:null,TimeZoneMarker:null,TimeZoneOffsetInMinutes:null,ShowTimeZone:!1,TelehealthMode:null,LengthInMinutes:0,PrimaryProvLengthInMin:0,Hour:null,Minute:null,State:null,DaysAhead:null,DateString:null,IsRequest:null,IsAllowedDuplicate:null,IsDisallowedDuplicate:null,DuplicateEncounterDte:0,DuplicateVisitTypeName:null,ReservationKey:null,ReservationExpirationTimeString:null,IsIneligibleForReservation:!1,IsPreselected:null,IsApptSrchHeld:null,VisitIndex:null,ClientDatabaseMinuteOffset:null,toRawRequestObject:function WP$Scheduling$Slot$toRawRequestObject(){return{VisitTypeId:this.VisitTypeId,DepartmentId:this.DepartmentId,ProviderId:this.ProviderId,SlotProviderIds:this.SlotProviderIds&&this.SlotProviderIds.length>0?this.SlotProviderIds:null,DateTime:this.DateTime,Dte:this.Dte,InternalStartTime:this.InternalStartTime,ArrivalTime:this.ArrivalTime,ArrivalDteUtc:this.ArrivalDteUtc,ArrivalTimeUtc:this.ArrivalTimeUtc,StartTime:this.StartTime,LengthInMinutes:this.LengthInMinutes,ReservationExpirationTimeString:this.ReservationExpirationTimeString,ReservationKey:this.ReservationKey?this.ReservationKey:null,TimeString:this.TimeString,DateString:this.DateString,TimeZoneMarker:this.TimeZoneMarker,PrimaryProvLengthInMin:this.PrimaryProvLengthInMin,IsApptSrchHeld:!!this.IsApptSrchHeld||null,VisitIndex:this.VisitIndex,IsPreselected:!!this.IsPreselected||null,ClientDatabaseMinuteOffset:this.ClientDatabaseMinuteOffset,IsRequest:!!this.IsRequest||null,TelehealthMode:this.TelehealthMode}}},i.Dte2Date=function WP$Scheduling$Slot$Dte2Date(e){return new Date(1841,0,e)},i.StatesEnum=r,i.Dte2DateString=l,i.createSlotCollection=function WP$Scheduling$Slot$createSlotCollection(){return new e},i.createIndexedSlotCollection=function WP$Scheduling$Slot$createIndexedSlotCollection(){return new e(s,u,c)},i.getSlotKey=o,i.getSlotKeyForBuilder=function WP$Scheduling$Slot$getSlotKeyForBuilder(e,t){var i,n,l=e.Type,r=null,a=e.RootDecisionTreeId,s=e.DecisionTreeNodeId,u=e.DecisionTreeNodeCsn,c=t.ReasonForVisit?t.ReasonForVisit.Id:"",h="",d=e.TicketInfo?e.TicketInfo.TicketId:"",S="",D=0;for(r=t.getAppointment(0),(i=t.getOriginalAppointment(r,e.OriginalAppointmentInfo))&&(h=i.Dat),n=r.Lqfs.toArray(),D=0;D<n.length;D++)S=S+","+n[D].Id;return o(l,c,h,d,a,s,u,S,!1)},i.getRequestSlotKey=function WP$Scheduling$Slot$getRequestSlotKey(e){return"REQ^"+e},i.createSlotFromUid=function WP$Scheduling$Slot$createSlotFromUid(e){var t;return t=h(e),new i(t)},i.todaysDte=n,i.areAllSlotsOnTheSameDay=function WP$Scheduling$Slot$areAllSlotsOnTheSameDay(e){var t=null,i=null,n=!1;return e.length<2?n=!0:(t=(e=e.slice().sort(a))[0],i=e[e.length-1],n=t.DisplayDte===i.DisplayDte),n},i.areAllSlotsInTheSameLocation=function WP$Scheduling$Slot$areAllSlotsInTheSameLocation(e,t,i,n){var l=0,r=0,o=null,a=null,s=[],u=!0;if(e.length>1)for(l=0;l<e.length;l++)if(r=e[l],a=t.getFromIndex("ID",r.DepartmentId),o=$$WP.Scheduling.Location.getLocationFromDepartment(a,i,n),0===s.length)s.push(o);else if(-1===s.indexOf(o)){u=!1;break}return u},i.slotSortFunction=a,$$WP.Scheduling.Slot=i,i.extend($$WP.Common.Model,"WP$Scheduling$Slot")}();;
!function WP$Scheduling$Solution$definition(){var t=$$WP.Common.ModelCollection,e=$$WP.Scheduling.Slot,o=function WP$Scheduling$Solution(t){this.WP$Common$Model(t),this.Slots=[]},i=[{propertyNames:"SlotKey",storeAs:"set"},{propertyNames:["SlotKey","ProviderId"],storeAs:"array"},{propertyNames:["SlotKey","DateKey","ProviderGroupKey","LocationGroupKey","EffectiveApptTimeKey"],storeAs:"array"},{propertyNames:["DepartmentId"],storeAs:"array"}];o.prototype={s_dataMembers:[],Slots:[],SlotKey:"",DateKey:"",ProviderGroupKey:"",LocationGroupKey:"",EffectiveApptTimeKey:"",ProviderId:"",Dte:"",DisplayDte:"",Hour:"",EffectiveApptTime:"",State:null,TimeString:"",TimeZoneMarker:"",ShowTimeZone:!1,HasMultipleSlots:!1,IsRequest:null,HasPassedFilterCheck:!1,populateWithRawSlots:function WP$Scheduling$Solution$populateWithRawSlots(t){var o=null;if(Array.isArray(t)){for(var i=0;i<t.length;i++)o=new e(t[i]),this.Slots.push(o);this.__afterSlotsAdded()}},populateWithSlotsArray:function WP$Scheduling$Solution$populateWithSlotsArray(t){Array.isArray(t)&&(this.Slots=this.Slots.concat(t),this.__afterSlotsAdded())},areAllSlotsOnTheSameDay:function WP$Scheduling$Solution$areAllSlotsOnTheSameDay(){return e.areAllSlotsOnTheSameDay(this.Slots)},areAllSlotsInTheSameLocation:function WP$Scheduling$Solution$areAllSlotsInTheSameLocation(t,o,i){return e.areAllSlotsInTheSameLocation(this.Slots,t,o,i)},__afterSlotsAdded:function WP$Scheduling$Solution$__afterSlotsAdded(){this.__copySlotPropertiesToSolution(),this.setProperty("HasMultipleSlots",this.Slots.length>1)},__copySlotPropertiesToSolution:function WP$Scheduling$Solution$__copySlotPropertiesToSolution(){var t=this.__findFirstSlot();this.setProperty("ProviderId",t.ProviderId),this.setProperty("Dte",t.Dte),this.setProperty("DisplayDte",t.DisplayDte),this.setProperty("Hour",t.Hour),this.setProperty("EffectiveApptTime",t.EffectiveApptTime),this.setProperty("TimeString",t.TimeString),this.setProperty("TimeZoneMarker",t.TimeZoneMarker),this.setProperty("ShowTimeZone",t.ShowTimeZone)},__findFirstSlot:function WP$Scheduling$Solution$__findFirstSlot(){return this.Slots.slice().sort(e.slotSortFunction)[0]}},o.StatesEnum={Selected:0,Unselected:1},o.createSolutionCollection=function WP$Scheduling$Solution$createSolutionCollection(){return new t(i)},o.createSolutionFromUid=function WP$Scheduling$Solution$createSolutionFromUid(t){var i,r=null;return r=new o,i=e.createSlotFromUid(t),r.populateWithSlotsArray([i]),r},$$WP.Scheduling=$$WP.Scheduling||{},$$WP.Scheduling.Solution=o,o.extend($$WP.Common.Model,"WP$Scheduling$Solution")}();;
!function WP$Scheduling$SlotLoader$definition(){var e,t=$$WP.Scheduling.Slot,o=$$WP.Scheduling.Solution,i=1,n=2,s=function WP$Scheduling$SlotLoader(e){this.WP$BaseObject(),this.__solutionCollection=e,this.__sendLoadRequest=$.proxy(this.__sendLoadRequest,this)};s.prototype={__solutionCollection:{},__isWaitingForLoadResults:!1,__isLoadSuccess:!1,__isLastLoadSuccess:!1,__isPatientNeedsSync:!1,__isSyncLimitReached:!1,__flushTimeoutId:null,__slotLoadStartDte:0,__workflow:null,__appointmentBuilder:null,__continueInfo:null,__useOnFileTimePreferences:!1,__slotKey:"",__numIncrementalLoadsCompleted:0,__numIncrementalDateRangeLoadsCompleted:0,__isThrottled:!1,__loadConfigId:0,initialize:function WP$Scheduling$SlotLoader$initialize(o,i,n,s){this.__isWaitingForLoadResults=!1,this.__isLoadSuccess=!1,this.__isLastLoadSuccess=!1,this.__isPatientNeedsSync=!1,this.__isSyncLimitReached=!1,this.__loadConfigId++,this.__isThrottled=!1,this.__resetSolutionCollection(),this.__slotLoadStartDte=o||t.todaysDte,this.__workflow=i,this.__appointmentBuilder=n,this.__useOnFileTimePreferences=s,this.__continueInfo=null,this.__numIncrementalLoadsCompleted=0,this.__numIncrementalDateRangeLoadsCompleted=0,this.__setSlotSearchPriority(),e=makeLink($$WPSchedulingUtil.GetEndpointUrl("GetSlots",this.__workflow)),this.__slotKey=t.getSlotKeyForBuilder(i,n)},loadNextSlots:function WP$Scheduling$SlotLoader$loadNextSlots(e){this.__isLoadSuccess=!1,this.__isLastLoadSuccess=!1,this.__hasSlotsToLoad()?this.__isWaitingForLoadResults||(this.__isWaitingForLoadResults=!0,clearTimeout(this.__flushTimeoutId),this.__flushTimeoutId=setTimeout(this.__sendLoadRequest,0,this.__buildRequest(),this.__loadConfigId,e)):setTimeout((function(){e([])}),0)},isLoading:function WP$Scheduling$SlotLoader$isLoading(){return this.__isWaitingForLoadResults},isLoadSuccess:function WP$Scheduling$SlotLoader$isLoadSuccess(){return this.__isLoadSuccess},isLastLoadSuccess:function WP$Scheduling$SlotLoader$isLastLoadSuccess(){return this.__isLastLoadSuccess},isLastLoadTemporaryFail:function WP$Scheduling$SlotLoader$isLastLoadTemporaryFail(){return this.__isPatientNeedsSync||this.__isSyncLimitReached||this.__isThrottled},hasVerboseError:function WP$Scheduling$SlotLoader$hasVerboseError(){return this.__isSyncLimitReached||this.__isThrottled},canAttemptToRecoverFromError:function WP$Scheduling$SlotLoader$canAttemptToRecoverFromError(){return this.__isThrottled},getError:function WP$Scheduling$SlotLoader$getError(e){var t={},o="",i="";return this.__isThrottled?(this.numIncrementalDateRangeLoadsCompleted()<1?(o="HighDemandFirstLoadInstructions",i="HighDemandFirstLoadDescription"):(o="HighDemandSubsequentLoadInstructions",i="HighDemandSubsequentLoadDescription"),t.Instructions=e.getString(o),t.Description=e.getString(i)):this.__isSyncLimitReached&&(t.Instructions=e.getString("SyncLimitReachedInstructions"),t.Description=e.getString("SyncLimitReachedDescription")),t},getSearchRangeStartDte:function WP$Scheduling$SlotLoader$getSearchRangeStartDte(){return this.__continueInfo?this.__continueInfo.SearchRangeStartDte:0},getSearchRangeEndDte:function WP$Scheduling$SlotLoader$getSearchRangeEndDte(){return this.__continueInfo?this.__continueInfo.SearchRangeEndDte:0},isSearchRangeEndDtePartiallyLoaded:function WP$Scheduling$SlotLoader$isSearchRangeEndDtePartiallyLoaded(){return!!this.__continueInfo&&this.__continueInfo.State===n},isStopSearch:function WP$Scheduling$SlotLoader$isStopSearch(){return this.__appointmentBuilder.SearchPriority===$$WP.Scheduling.AppointmentBuilder.SearchPriorityEnum.SameDay&&this.__appointmentBuilder.getActiveApptIndex()>0||!!this.__continueInfo&&this.__continueInfo.IsStopSearch},numIncrementalLoadsCompleted:function WP$Scheduling$SlotLoader$numIncrementalLoadsCompleted(){return this.__numIncrementalLoadsCompleted},numIncrementalDateRangeLoadsCompleted:function WP$Scheduling$SlotLoader$numIncrementalDateRangeLoadsCompleted(){return this.__numIncrementalDateRangeLoadsCompleted},loadRequestSolutions:function WP$Scheduling$SlotLoader$loadRequestSolutions(e){var i=0,n=0,s=null,r=null,l=null,a=null;for(i=0;i<e.Models.length;i++)for(s=e.Models[i],n=0;n<s.RequestProviderDepartmentPairs.length;n++)r=s.RequestProviderDepartmentPairs[n],l=new t({DepartmentId:r.DepartmentId,ProviderId:r.ProviderId,SlotProviderIds:r.ChildProviderIds,VisitTypeId:s.DefaultVisitTypeId,IsRequest:!0}),(a=new o).setProperty("SlotKey",t.getRequestSlotKey(s.Id)),a.setProperty("IsRequest",!0),a.populateWithSlotsArray([l]),this.__solutionCollection.add(a)},__resetSolutionCollection:function WP$Scheduling$SlotLoader$__resetSolutionCollection(e){var t,o=0,i=null,n=[];for(t=this.__solutionCollection.toArray(),o=0;o<t.length;o++)i=t[o],this.__isSolutionToReset(i,e)&&n.push(i);this.__solutionCollection.removeRange(n)},__setSlotSearchPriority:function WP$Scheduling$SlotLoader$__setSlotSearchPriority(){var e=!$$WPUtil.IsNullOrEmpty(this.__appointmentBuilder.getFirstAppointment().PanelId);(!$$WPUtil.IsNullOrEmpty(this.__appointmentBuilder.getFirstAppointment().BundleId)||e)&&($$WPSchedulingUtil.IsBundleForceSameDay(this.__workflow)?this.__appointmentBuilder.SearchPriority=$$WP.Scheduling.AppointmentBuilder.SearchPriorityEnum.SameDay:this.__appointmentBuilder.SearchPriority===$$WP.Scheduling.AppointmentBuilder.SearchPriorityEnum.NotDefined&&(this.__appointmentBuilder.SearchPriority=$$WP.Scheduling.AppointmentBuilder.SearchPriorityEnum.Earliest))},__isSolutionToReset:function WP$Scheduling$SlotLoader$__isSolutionToReset(e,t){return!!e&&(!(!t||!e.IsRequest)||!e.IsRequest)},__buildRequest:function WP$Scheduling$SlotLoader$__buildRequest(){return{workflow:this.__workflow.toRawRequestObject(),appointmentBuilder:this.__appointmentBuilder.toRawRequestObject(),startDte:this.__slotLoadStartDte,useSchedulingPreferences:this.__useOnFileTimePreferences,continueInfo:this.__continueInfo}},__sendLoadRequest:function WP$Scheduling$SlotLoader$__sendLoadRequest(t,o,i){var n;o===this.__loadConfigId&&(n={SlotLoader:this,Request:t,LoadConfigId:o,Callback:i},$.ajax({url:e,type:"POST",data:$$WPUtil.postify(t),cache:!1,success:$.proxy(this.__onLoad,n),error:$.proxy(this.__onLoadError,n)}))},__onLoad:function WP$Scheduling$SlotLoader$__onLoad(e){var t,i,n=null,s=0,r=0,l=null,a=null,d=[];if(n=(t=this).SlotLoader,t.LoadConfigId===n.__loadConfigId&&(n.__isWaitingForLoadResults=!1,n.__isLoadSuccess=!1,n.__isLastLoadSuccess=!1,n.__isPatientNeedsSync=!1,n.__isSyncLimitReached=!1,e)){if(i=e.Solutions,Array.isArray(i)&&(s=i.length),n.__setIsLoadSuccess(s,e.ErrorCode),n.__setContinueInfo(e.ContinueInfo),n.__isThrottled=n.__isThrottledError(e.ErrorCode),n.__isSyncLimitReached=n.__isSyncLimitReachedError(e.ErrorCode),n.__isLoadSuccess){if(s>0){for(n.__solutionCollection.openChangeBatch(),r=0;r<s;r++)(l=new o(i[r])).setProperty("SlotKey",n.__slotKey),l.setProperty("IsRequest",!1),l.populateWithRawSlots(i[r].Slots),l.setProperty("HasPassedFilterCheck",i[r].HasPassedFilterCheck),n.__solutionCollection.add(l),d.push(l);n.__solutionCollection.closeChangeBatch()}}else n.__isPatientNeedsSync=n.__isPatientNeedsSyncError(e.ErrorCode);a=t.Callback,"function"===$.type(a)&&setTimeout((function(){a(d)}),0)}},__setContinueInfo:function WP$Scheduling$SlotLoader$__setContinueInfo(e){this.__continueInfo=e,this.__numIncrementalLoadsCompleted++,e.State===i&&this.__numIncrementalDateRangeLoadsCompleted++},__setIsLoadSuccess:function WP$Scheduling$SlotLoader$__setIsLoadSuccess(e,t){this.__isLastLoadSuccess=$$WPUtil.IsNullOrEmpty(t)||e>0,this.__isLoadSuccess=this.isLastLoadSuccess()||!!this.__solutionCollection.getFirstInIndex("SlotKey",this.__slotKey)},__isPatientNeedsSyncError:function WP$Scheduling$SlotLoader$__isPatientNeedsSyncError(e){return"PatientNeedsSync"===e},__isThrottledError:function WP$Scheduling$SlotLoader$__isThrottledError(e){return"ConnectionThrottled"===e},__isSyncLimitReachedError:function WP$Scheduling$SlotLoader$__isSyncLimitReachedError(e){return"SyncLimitReached"===e},__onLoadError:function WP$Scheduling$SlotLoader$__onLoadError(){var e,t=null,o=null,i=[];t=(e=this).SlotLoader,e.LoadConfigId===t.__loadConfigId&&(t.__isWaitingForLoadResults=!1,t.__isLoadSuccess=!1,t.__isLastLoadSuccess=!1,t.__isPatientNeedsSync=!1,t.__isSyncLimitReached=!1,o=e.Callback,"function"===$.type(o)&&setTimeout((function(){o(i)}),0))},__hasSlotsToLoad:function WP$Scheduling$SlotLoader$__hasSlotsToLoad(){for(var e=this.__appointmentBuilder.Appointments.toArray(),t=0;t<e.length;t++)if(e[t].ProviderDepartmentPairs.length>0)return!0;return!1},loadOneClickTicketSlots:function WP$Scheduling$SlotLoader$loadOneClickTicketSlots(e,o){var i;i={SlotLoader:this,SlotKey:t.getSlotKey($$WP.Scheduling.Workflow.WorkflowTypesEnum.Ticket,"","",e,"","","","",!0),Callback:o},$.ajax({url:makeLink("Scheduling/GetOneClickTicketSlots"),type:"POST",data:{ticketId:e},cache:!1,success:$.proxy(this.__onOneClickSlotsLoad,i)})},__onOneClickSlotsLoad:function WP$Scheduling$SlotLoader$__onOneClickSlotsLoad(e){var t,i,n,s,r,l;for(s=(t=this).SlotLoader,i=t.SlotKey,n=t.Callback,s.__solutionCollection.openChangeBatch(),r=0;r<e.length;r++)(l=new o(e[r])).setProperty("SlotKey",i),l.setProperty("IsRequest",!1),l.populateWithRawSlots(e[r].Slots),s.__solutionCollection.add(l);s.__solutionCollection.closeChangeBatch(),"function"==typeof n&&n()}},s.LoadQuickScheduleSlots=function WP$Scheduling$SlotLoader$LoadQuickScheduleSlots(e,t,o,i,n){var s="Scheduling/GetQuickScheduleSlots";i&&(s="Scheduling/Anonymous/GetQuickScheduleSlots"),$.ajax({url:makeLink(s),type:"POST",data:{rfvId:e.LineInWDF15000,numSlots:t,workflowType:$$WP.Scheduling.Workflow.WorkflowTypesEnum.OnDemandTelehealth,isGuest:n},success:o})},$$WP.Scheduling.SlotLoader=s,s.extend($$WP.BaseObject,"WP$Scheduling$SlotLoader")}();;
/*! Copyright Epic Systems Corporation 2017-2018 */
!function WP$Scheduling$Lqf$definition(){var e=$$WP.Common.ModelCollection,n=function WP$Scheduling$Lqf(e){this.WP$Common$Model(e)},t=[{propertyNames:"Id",storeAs:"single"},{propertyNames:["Id","AppointmentIndex"],storeAs:"single"}];n.prototype={s_dataMembers:["Id","Type","Result","AppointmentIndex"],Id:null,Result:null,Type:null,SchedulingOverride:null,CompletingStep:null,AppointmentIndex:null,Reset:function WP$Scheduling$Lqf$Reset(){this.Result=null,this.CompletingStep="",this.SchedulingOverride=null,this.AppointmentIndex=""}},n.LqfTypeEnum={Questionnaire:1,DecisionTree:2},n.ReloadDynamicDataEnum={NoReload:0,FullReload:1,RfvReload:2},n.createLqfCollection=function WP$Scheduling$Lqf$createLqfCollection(){return new e(t)},$$WP.Scheduling=$$WP.Scheduling||{},$$WP.Scheduling.Lqf=n,n.extend($$WP.Common.Model,"WP$Scheduling$Lqf")}(),$$WP.Debug.UnitTest=$$WP.Debug.UnitTest||{},$$WP.Debug.UnitTest.tests=$$WP.Debug.UnitTest.tests||[],$$WP.Debug.UnitTest.tests.push((function UnitTests$Scheduling$Lqf(e){$$WP.Debug.UnitTest.assert}));;
!function WP$Scheduling$SchedulingOverride$definition(){var e=$$WP.Common.ModelCollection,i=function WP$Scheduling$SchedulingOverride(e){this.WP$Common$Model(e)};i.prototype={s_dataMembers:["LqfIds","HqaIds","DecisionTreeNodeId","DecisionTreeNodeCsn","OriginalTicketId","OriginalAppointmentRequestIds","OriginalPrcId","OriginalRfv","OriginalRfvLine","SourceOverrideDepartmentId","RootDecisionTreeId","WorkflowType","IsLoadingRemainingTiers","Tier","IsLoadingSpecificTicket","TicketKey","IsLoadingSpecificComponent","ComponentKey"],LqfIds:[],HqaIds:[],DecisionTreeNodeId:"",DecisionTreeNodeCsn:"",OriginalTicketId:"",OriginalAppointmentRequestIds:[],OriginalPrcId:"",OriginalRfv:"",OriginalRfvLine:"",SourceOverrideDepartmentId:"",RootDecisionTreeId:"",WorkflowType:"",IsLoadingRemainingTiers:!1,Tier:0,IsLoadingSpecificTicket:!1,TicketKey:"",IsLoadingSpecificComponent:!1,ComponentKey:null},i.createSchedulingOverrideCollection=function WP$Scheduling$SchedulingOverride$createSchedulingOverrideCollection(){return new e},i.getDecisionTreeNodeWorkflowOverride=function WP$Scheduling$SchedulingOverride$prepForDecisionTreeNodeWorkflow(e,n,o){var r=new i({DecisionTreeNodeId:n,DecisionTreeNodeCsn:o});return e.add(r),r},$$WP.Scheduling=$$WP.Scheduling||{},$$WP.Scheduling.SchedulingOverride=i,i.extend($$WP.Common.Model,"WP$Scheduling$SchedulingOverride")}(),$$WP.Debug.UnitTest=$$WP.Debug.UnitTest||{},$$WP.Debug.UnitTest.tests=$$WP.Debug.UnitTest.tests||[],$$WP.Debug.UnitTest.tests.push((function UnitTests$Scheduling$SchedulingOverride(e){$$WP.Debug.UnitTest.assert}));;
!function WP$Scheduling$SchedulingStep$definition(){var e=$$WP.Common.ModelCollection,t=function WP$Scheduling$SchedulingStep(e){this.WP$Common$Model(e)},n={Incomplete:0,Complete:1,NotRequired:2},i={Inactive:0,Active:1},l={ReasonForVisit:0,StandardLqf:1,Provider:2,Location:3,DepartmentLqf:4,Custom:5,Slot:6,Demographics:7,Insurance:8,Confirmation:9,Request:10,QuickSchedule:11,Stacked:12,LandingPage:13,OriginalApptInfo:14,Verification:15,TelehealthLocation:16,PlatformStep:17,TelehealthSummary:18,TelehealthOrganization:19,TelehealthAuth:20,MultiAppointment:21,Onboarding:22,Specialty:23,Reservation:24,CustomLanding:25,PersonalInfoCollection:26,JoinWaitList:27},o=["CompleteStatus","ActiveStatus"],c=function WP$Scheduling$SchedulingStep$getIsHiddenUntilActiveDefault(e){switch(e){case l.StandardLqf:case l.DepartmentLqf:return!0;default:return!1}},d=function WP$Scheduling$SchedulingStep$getIsHiddenAfterCompletionDefault(e,t){switch(e){case l.StandardLqf:case l.DepartmentLqf:break;default:return!1}switch(t){case $$WP.Scheduling.Workflow.WorkflowTypesEnum.DecisionTreeNode:case $$WP.Scheduling.Workflow.WorkflowTypesEnum.Ticket:return!0;default:return!1}},a=[{propertyNames:"ID",storeAs:"single"},{propertyNames:"ActiveStatus",storeAs:"single"},{propertyNames:"StackId",storeAs:"array"}],u=[{propertyName:"ActiveStatus",value:i.Active,bumpToValue:i.Inactive}];t.prototype={s_dataMembers:["ID","CompleteStatus","ActiveStatus","IsStacked","StackId","Type","IsReadOnly","ForceShowOnce","IsAdHoc","HostId","IsHiddenUntilActive","IsHiddenAfterCompletion"],ID:null,CompleteStatus:null,ActiveStatus:null,IsReadOnly:!1,IsHidden:!1,IsStacked:!1,StackId:null,Type:null,ForceShowOnce:null,IsAdHoc:!1,HostId:null,IsHiddenUntilActive:!1,IsHiddenAfterCompletion:!1},t.StepTypeEnum=l,t.ActiveEnum=i,t.CompleteEnum=n,t.createSchedulingStepCollection=function WP$Scheduling$SchedulingStep$createSchedulingStepCollection(){return new e(a,o,u)},t.addSchedulingStepToCollection=function WP$Scheduling$SchedulingStep$addSchedulingStepToCollection(e,l,o,a,u,s,r,S){var p,$;return null===(p=e.getFromIndex("ID",l))&&($={ID:l,CompleteStatus:s?n.Complete:n.Incomplete,ActiveStatus:i.Inactive,IsStacked:o||!1,StackId:a,IsReadOnly:s||!1,Type:u,ForceShowOnce:!1,IsAdHoc:!$$WPUtil.IsNullOrEmpty(r),HostId:r,IsHiddenUntilActive:c(u),IsHiddenAfterCompletion:d(u,S)},p=new t($),e.add(p)),p},$$WP.Scheduling.SchedulingStep=t,t.extend($$WP.Common.Model,"WP$Scheduling$SchedulingStep")}(),$$WP.Debug.UnitTest=$$WP.Debug.UnitTest||{},$$WP.Debug.UnitTest.tests=$$WP.Debug.UnitTest.tests||[],$$WP.Debug.UnitTest.tests.push((function UnitTests$Scheduling$SchedulingStep(e){$$WP.Debug.UnitTest.assert}));;
!function WP$Scheduling$SchedulingDataPool$definition(){var e={Schedulable:0,AlreadyScheduled:1,Other:2,TicketUnavailable:3},t=$$WP.Scheduling.AppointmentBuilder,i=$$WP.Scheduling.Department,n=$$WP.Scheduling.Location,o=$$WP.Scheduling.Provider,s=$$WP.Scheduling.ProviderDepartmentPair,a=$$WP.Scheduling.ReasonForVisit,r=$$WP.Scheduling.ReasonForVisitDepartmentOverride,l=$$WP.Scheduling.Solution,h=$$WP.Scheduling.Specialty,d=$$WP.Scheduling.SlotLoader,c=$$WP.Scheduling.VisitType,p=$$WP.Scheduling.VisitTypeDepartmentOverride,u=$$WP.Scheduling.Lqf,S=$$WP.Scheduling.SchedulingOverride,P=$$WP.Scheduling.TelehealthLocation,g=$$WP.Scheduling.TelehealthData,m=$$WP.Scheduling.SchedulingStep,D=$$WP.Scheduling.TelehealthOrganization,$=$$WP.Scheduling.TelehealthOrganizationLoader,v=$$WP.Scheduling.SchedulingMenu,T=$$WP.Scheduling.SchedulingMenuReasonForVisit,O=function WP$Scheduling$SchedulingDataPool(e){this.AppointmentBuilder=new t,this.Providers=o.createProviderCollection(),this.ReasonsForVisit=a.createReasonForVisitCollection(),this.Departments=i.createDepartmentsCollection(),this.Specialties=h.createSpecialtiesCollection(),this.ProviderDepartmentPairs=s.createProviderDepartmentPairsCollection(),this.ReasonForVisitDepartmentOverrides=r.createReasonForVisitDepartmentOverridesCollection(),this.Locations=n.createLocationCollection(),this.VisitTypes=c.createVisitTypeCollection(),this.VisitTypeDepartmentOverrides=p.createVisitTypeDepartmentOverridesCollection(),this.Solutions=l.createSolutionCollection(),this.SlotLoader=new d(this.Solutions),this.Lqfs=u.createLqfCollection(),this.SchedulingOverrides=S.createSchedulingOverrideCollection(),this.TelehealthLocations=P.createTelehealthLocationCollection(),this.TelehealthData=new g,this.SchedulingSteps=m.createSchedulingStepCollection(),this.TelehealthOrganizations=D.createTelehealthOrganizationCollection(),this.TelehealthOrganizationLoader=new $(this.TelehealthOrganizations),this.SchedulingMenus=v.createSchedulingMenuCollection(),this.SchedulingMenuReasonsForVisit=T.createSchedulingMenuReasonForVisitCollection(),this.OrderMap={},"object"==typeof e&&this.populateWithRawSchedulingData(e)},f={AppointmentBuilder:null,Providers:null,ReasonsForVisit:null,Locations:null,Departments:null,Specialties:null,ProviderDepartmentPairs:null,ReasonForVisitDepartmentOverrides:null,VisitTypes:null,VisitTypeDepartmentOverrides:null,Solutions:null,SlotLoader:null,ShowOtherProviderOption:!1,ShowOtherRfvOption:!1,ShowNewProviderWorkflow:!1,TelehealthLocations:null,TelehealthOrganizations:null,HomeOrganizationName:null,TelehealthOrganizationLoader:null,TelehealthData:null,Lqfs:null,SchedulingOverrides:null,SchedulingSteps:null,IsBeingRefreshed:!1,IsSchedulingCompleting:!1,HideBackNavigation:!1,BlockDemographicInsuranceVerification:!1,HasSeparateLocationSelectionInTicketBundles:!1,IsProxy:!1,ProxyContextName:null,IsAdminLoginFromHyperspace:!1,FavoriteAppointments:null,SchedulingMenus:null,SchedulingMenuReasonsForVisit:null,OrderMap:null,NumStepsReloading:0,ShowProviderFinderDefaultLink:!1,OtherRfvUrl:null,OtherRfvFilename:null,PreselectedTicketStatus:e.Schedulable,prepForWorkflow:function WP$Scheduling$SchedulingDataPool$prepForWorkflow(e,t,i,n,s,r){t=$$WPUtil.IsNullOrEmpty(t)?this.ShowOtherProviderOption:t,i=$$WPUtil.IsNullOrEmpty(i)?this.ShowOtherRfvOption:i,this.ShowOtherProviderOption=t,this.ShowOtherRfvOption=i,$$WPUtil.IsNullOrEmpty(s)||(this.OtherRfvUrl=s),$$WPUtil.IsNullOrEmpty(r)||(this.OtherRfvFilename=r),i&&!this.ReasonsForVisit.getFromIndex("Id",-1)?a.addOtherOption(this.ProviderDepartmentPairs,this.ReasonsForVisit,this.VisitTypes,this.OtherRfvUrl,this.OtherRfvFilename):a.tryUpdateOtherOption(this.ReasonsForVisit,this.VisitTypes),t&&o.addOtherOption(this.Providers,this.Departments,this.Locations,this.ProviderDepartmentPairs,this.ReasonsForVisit,this.ReasonForVisitDepartmentOverrides),n&&(this.ShowNewProviderWorkflow=!1,this.ShowProviderFinderDefaultLink=!1),this.SlotLoader.loadRequestSolutions(this.ReasonsForVisit)},prepForWorkflowAgain:function WP$Scheduling$SchedulingDataPools$prepForWorkflowAgain(){this.SlotLoader.__resetSolutionCollection(!0),this.prepForWorkflow()},populateWithRawSchedulingData:function WP$Scheduling$SchedulingDataPool$_populateWithRawSchedulingData(e){var t=null;this.FavoriteAppointments=e.FavoriteAppointments||null,e.WorkflowSettings&&(t=e.WorkflowSettings.ProviderNameDisplayFormat,this.ShowNewProviderWorkflow=e.WorkflowSettings.AllowOpenSchedulingWizard,this.HideBackNavigation=e.WorkflowSettings.HideBackNavigation,this.IsProxy=e.WorkflowSettings.IsProxy,this.ProxyContextName=e.WorkflowSettings.ProxyContextName,this.IsAdminLoginFromHyperspace=e.WorkflowSettings.IsAdminLoginFromHyperspace,this.ShowOtherProviderOption=e.WorkflowSettings.ShowOtherProviderOption,this.ShowOtherRfvOption=e.WorkflowSettings.ShowOtherRfvOption,this.ShowProviderFinderDefaultLink=e.WorkflowSettings.ShowProviderFinderDefaultLink,this.HasSeparateLocationsInTicketBundles=!!e.WorkflowSettings.HasSeparateLocationsInTicketBundles,this.HasSeparateLocationSelectionInTicketBundles=!!e.WorkflowSettings.HasSeparateLocationSelectionInTicketBundles),o.convertRawProviders(e.Providers,this.Providers,t),i.convertRawDepartments(e.Departments,this.Departments),s.convertRawProviderDepartmentPairs(e.ProviderDepartmentPairs,this.ProviderDepartmentPairs),h.convertRawSpecialties(e.Specialties,this.Specialties),c.convertRawVisitTypes(e.VisitTypes,this.VisitTypes),a.convertRawReasonsForVisit(e.ReasonsForVisit,this.ReasonsForVisit),r.convertRawReasonForVisitDepartmentOverrides(e.ReasonForVisitDepartmentOverrides,this.ReasonForVisitDepartmentOverrides),p.convertRawVisitTypeDepartmentOverrides(e.VisitTypeDepartmentOverrides,this.VisitTypeDepartmentOverrides),n.convertRawLocations(e.Locations,this.Locations,this.Departments),v.convertRawSchedulingMenus(e.SchedulingMenusViewModels,this.SchedulingMenus,this.SchedulingMenuReasonsForVisit),a.dereferenceIds(this.ReasonsForVisit,this.VisitTypes,this.ProviderDepartmentPairs),o.dereferenceIds(this.Providers,this.Departments,this.ProviderDepartmentPairs),i.dereferenceIds(this.Departments,this.Specialties),s.dereferenceIds(this.ProviderDepartmentPairs,this.Providers,this.Departments),r.dereferenceIds(this.ReasonForVisitDepartmentOverrides,this.ReasonsForVisit,this.Departments,this.VisitTypes),p.dereferenceIds(this.ReasonForVisitDepartmentOverrides,this.VisitTypes,this.Departments),T.dereferenceIds(this.SchedulingMenuReasonsForVisit,this.ReasonsForVisit),v.dereferenceIds(this.SchedulingMenus),this.OrderMap=e.OrderMap,this.PreselectedTicketStatus=e.PreselectedTicketStatus,e.OnDemandTelehealthData&&(P.convertRawTelehealthLocations(e.OnDemandTelehealthData.TelehealthLocations,this.TelehealthLocations),this.TelehealthData.TelehealthNotificationSettings=new $$WP.Scheduling.TelehealthNotificationSettings(e.OnDemandTelehealthData.ShowEmailOption,e.OnDemandTelehealthData.ShowSMSOption,e.OnDemandTelehealthData.CheckEmailOption,e.OnDemandTelehealthData.CheckSMSOption,e.OnDemandTelehealthData.PhoneNumber,e.OnDemandTelehealthData.EmailAddress,e.OnDemandTelehealthData.IsPushNotificationEnabled),this.TelehealthData.IsXOrgEnabled=e.OnDemandTelehealthData.IsXOrgEnabled,this.TelehealthData.HideInsuranceStepForXOrg=e.OnDemandTelehealthData.HideInsuranceStepForXOrg,e.WorkflowSettings&&e.WorkflowSettings.QuickScheduleStepSettings&&!0===e.WorkflowSettings.QuickScheduleStepSettings.Hide&&this.TelehealthData.autoSelectQueueing()),this.HomeOrganizationName=e.HomeOrganizationName},clearSchedulingData:function WP$Scheduling$SchedulingDataPool$clearSchedulingData(){this.Providers.empty(),this.ReasonsForVisit.empty(),this.Departments.empty(),this.ProviderDepartmentPairs.empty(),this.ReasonForVisitDepartmentOverrides.empty(),this.Locations.empty(),this.VisitTypes.empty(),this.VisitTypeDepartmentOverrides.empty()},_isSameTicket:function WP$Scheduling$SchedulingDataPool$isSameTicket(e,t){var i=[];return!(!e.TicketId||e.TicketId!==t.TicketId)||!!(e.AppointmentRequests&&t.AppointmentRequests&&e.AppointmentRequests.length>0&&t.AppointmentRequests.length>0)&&(i.push($$WP.Scheduling.Appointment.prototype.ordersToRawRequestObject(e.AppointmentRequests)),i.push($$WP.Scheduling.Appointment.prototype.ordersToRawRequestObject(t.AppointmentRequests)),$$WPSchedulingUtil.DoAllArraysContainTheSameValues(i))},populateForTicket:function WP$Scheduling$SchedulingDataPool$populateForTicket(e,t,i){var n=new O(t);p.convertRawVisitTypeDepartmentOverrides(t.VisitTypeDepartmentOverrides,this.VisitTypeDepartmentOverrides),i&&this.__updateTicketInfo(t,e),this.appendTicketToDataPool(e,n,i),this.HasSeparateLocationsInTicketBundles=t.WorkflowSettings.HasSeparateLocationsInTicketBundles,this.HasSeparateLocationSelectionInTicketBundles=t.WorkflowSettings.HasSeparateLocationSelectionInTicketBundles},__updateTicketInfo:function WP$Scheduling$SchedulingDataPool$__updateTicketInfo(e,t){for(var i=null,n=0;n<e.Tickets.length;n++)if(i=e.Tickets[n],this._isSameTicket(i,t))return t.ReasonForVisit=i.ReasonForVisit,t.DisplayName=i.DisplayName,t.Subtitle=i.Subtitle,t.CanBeSentOffers=i.CanBeSentOffers,void this.__updateTicketAppointmentRequestsInfo(i.AppointmentRequests,t.AppointmentRequests)},__updateTicketAppointmentRequestsInfo:function WP$Scheduling$SchedulingDataPool$__updateTicketAppointmentRequestsInfo(e,t){if(e&&t){var i=e.length;if(i===t.length)for(var n=0;n<i;n++)t[n].DisplayName=e[n].DisplayName}},appendTicketToDataPool:function WP$Scheduling$SchedulingDataPool$appendToTicketDataPool(e,t){var i=0,n=null;if(this.populateTicketReasonForVisit(e,t),e.ReasonForVisit.IsMultipleAppointments)for(i=0;i<e.ReasonForVisit.ApptComponents.length;i++)n=e.ReasonForVisit.ApptComponents[i],this.__populateProvDeptDataPool(n.AllProviderDepartmentPairs);else this.__populateProvDeptDataPool(e.ReasonForVisit.AllProviderDepartmentPairs);this.__tryAddAnyProviderOption(t),0===this.Locations.size()&&this.Locations.addRange(t.Locations.Models),0===this.TelehealthLocations.size()&&this.TelehealthLocations.addRange(t.TelehealthLocations.Models)},__tryAddAnyProviderOption:function WP$Scheduling$SchedulingDataPool$__tryAddAnyProviderOption(e){var t=null;this.Providers.getFromIndex("ID","-2")||(t=e.Providers.getFromIndex("ID","-2"))&&this.Providers.add(t)},__populateProvDeptDataPool:function WP$Scheduling$SchedulingDataPool$__populateProvDeptDataPool(e,t){var i=0,n=null;for(i=0;i<e.length;i++)n=e[i].Provider,this.__canAddProvider(e[i])&&(this.Providers.add(n),n.TeamProviderDepartmentPairs&&!t&&this.__populateProvDeptDataPool(n.TeamProviderDepartmentPairs,!0)),this.__canAddDepartment(e[i])&&this.Departments.add(e[i].Department)},__canAddProvider:function WP$Scheduling$SchedulingDataPool$__canAddProvider(e){return null===this.Providers.getFromIndex("ID",e.ProviderId)&&null!==e.Provider},__canAddDepartment:function WP$Scheduling$SchedulingDataPool$__canAddDepartment(e){return null===this.Departments.getFromIndex("ID",e.DepartmentId)&&null!==e.Department},populateTicketReasonForVisit:function WP$Scheduling$SchedulingDataPool$populateTicketReasonForVisit(e,t){var i,n,o,s=null;for(n=new a(e.ReasonForVisit),a.dereferenceReasonForVisit(n,t.VisitTypes,t.ProviderDepartmentPairs),o=n.DefaultVisitType,this.VisitTypes.add(o),i=0;i<n.ApptComponents.length;i++)s=n.ApptComponents[i].DefaultVisitType,this.VisitTypes.add(s);e.ReasonForVisit=n}};O.prototype=f,$$WP.Scheduling=$$WP.Scheduling||{},$$WP.Scheduling.SchedulingDataPool=O,O.extend($$WP.BaseObject,"WP$Scheduling$SchedulingDataPool"),$$WP.Scheduling.PreselectedTicketStatusEnum=e}(),$$WP.Debug.UnitTest=$$WP.Debug.UnitTest||{},$$WP.Debug.UnitTest.tests=$$WP.Debug.UnitTest.tests||[],$$WP.Debug.UnitTest.tests.push((function UnitTests$Scheduling$SchedulingDataPool(e){$$WP.Debug.UnitTest.assert}));;
!function WP$Scheduling$Workflow$definition(){var e=$$WP.Common.ModelCollection,t=$$WP.Scheduling.SchedulingDataPool,i=$$WP.Scheduling.Appointment,o=$$WP.Scheduling.VisitType,n=$$WP.Scheduling.TelehealthLocation,r=$$WP.Analytics.UserActionEvent,l={Selected:0,Unselected:1},a={Standard:0,ExistingProvider:1,NewProvider:2,Procedure:3,Ticket:4,Request:5,Reschedule:6,Repeat:7,OnDemandTelehealth:8,DecisionTreeNode:9,OnMyWay:10,EVisit:11,Widget:12,SimpleWidget:14,React:15,ProviderFinder:16},s=null,u=function WP$Scheduling$Workflow(e){var t=null;this.WP$Common$Model(e),this.State=l.Unselected,t=$$WP.Strings.getNamespace("Scheduling"),this.Name=t.getString(this.Id+"Workflow"),this.HelpText=t.getString(this.Id+"WorkflowHelpText"),s=s||t.getString("TicketDetailDelimiter")},c=[{propertyNames:"State",storeAs:"set"},{propertyNames:"Type",storeAs:"array"},{propertyNames:"IsFavorite",storeAs:"array"},{propertyNames:"Id",storeAs:"single"}],d=["State"],g=[{propertyName:"State",value:l.Selected,bumpToValue:l.Unselected}],h=function WP$Scheduling$Workflow$s_compareWorkflows(e,t){return e.ToDte===t.ToDte?0:e.ToDte<t.ToDte?-1:1},p=function WP$Scheduling$Workflow$s_createTicketWorkflow(e,i,o,n,r,l,s,c,d){var g,h=null,p=y(e);return g=WP.Utils.dte2date(e.AvailableDte),(h=new u({Id:e.TicketId,Title:F(e),Type:a.Ticket,IsTicket:!0,TicketInfo:e,ExpireDate:p,AvailableDate:formatDate(g),IsCurrentlyAvailable:new Date>g,SchedulingDataPool:new t,SchedulingControllerParams:o,IsGuest:n,RootDecisionTreeId:r,DecisionTreeAnswerId:l,DecisionTreeNodeId:s,DecisionTreeNodeCsn:c,IsFromShopperState:d})).SchedulingDataPool.populateForTicket(e,i),h.SchedulingDataPool.prepForWorkflow(h,!1,!1),h.IsPreselectedTicket=I(h,o.tktId)||I(h,o.ticketId)||I(h,o.filterTicket),h},P=function WP$Scheduling$Workflow$s_addTicketWorkflows(e,t,i,o,n,r,l,a,s){var u,c,d=null;if(null!==(d=t.Tickets))for(d.sort(h),u=0;u<d.length;u++)c=p(d[u],t,i,o,n,r,l,a,s),e.add(c)},S=function WP$Scheduling$Workflow$s_getReasonForVisitModelFromFavorite(e){var t=e.FavoriteAppointmentInfo.ReasonForVisitCategoryValue;return e.SchedulingDataPool.ReasonsForVisit.getFirstInIndex("CategoryValue",t)},f=function WP$Scheduling$Workflow$s_getWorkflowTypeForFavorite(e){var t,i,o;return t=null,i=S(e),o=function WP$Scheduling$Workflow$s_getProviderModelFromFavorite(e){var t=e.FavoriteAppointmentInfo.ProviderId;return e.SchedulingDataPool.Providers.getFromIndex("ID",t)}(e),i&&i.CanDirectSchedule?(!0,!1,u.doesRfvHaveMatchingProviderDepartmentPair(i,true,false)&&i.ReasonForVisitFirst?t=a.Procedure:e.hasProviderFirstOptions()&&o&&e.isRfvAllowedForProviderFirstInDirectScheduling(i,o)&&(t=a.ExistingProvider),t):null},$=function WP$Scheduling$Workflow$s_addNewProviderWorkflow(e,i,o,n,r,l,s){var c,d;c={Specialties:i.Specialties,WorkflowSettings:i.WorkflowSettings,OnDemandTelehealthData:i.OnDemandTelehealthData},(d=new u({Id:"NewProvider",Type:a.NewProvider,SchedulingDataPool:new t(c),IsAnonymous:n,IsGuest:r,IsFromPrelogin:l,SchedulingControllerParams:o,ServiceAreas:s})).SchedulingDataPool.prepForWorkflow(d,!1,!1),e.add(d)},W={s_dataMembers:["Id","Title","Type","IsTicket","TicketInfo","ExpireDate","IsFavorite","FavoriteAppointmentInfo","OriginalAppointmentInfo","SchedulingDataPool","RootDecisionTreeId","DecisionTreeAnswerId","DecisionTreeNodeId","DecisionTreeNodeCsn","IsCurrentlyAvailable","AvailableDate","ExpireDateString","AvailableDateString","IsAnonymous","IsGuest","IsFromPrelogin","IsFromShopperState","AnonymousSettings","SchedulingControllerParams","SecureSessionToken","BrowserId","MultiApptSlotStepStartingView","MultiApptSlotStepSelectionView","ServiceAreas","IsAuthenticatedWidget"],Id:null,Type:null,IsTicket:!1,TicketInfo:null,ExpireDate:null,ExpireDateString:null,IsCurrentlyAvailable:null,AvailableDate:null,AvailableDateString:null,IsFavorite:!1,FavoriteAppointmentInfo:null,OriginalAppointmentInfo:null,SchedulingDataPool:null,Name:null,HelpText:null,State:null,ShowSchedulingHubLink:!1,RootDecisionTreeId:null,DecisionTreeAnswerId:null,DecisionTreeNodeId:null,DecisionTreeNodeCsn:null,IsAnonymous:!1,IsGuest:!1,IsFromPrelogin:!1,IsFromShopperState:!1,AnonymousSettings:null,SchedulingControllerParams:{},SecureSessionToken:null,BrowserId:null,Title:null,MultiApptSlotStepStartingView:null,MultiApptSlotStepSelectionView:null,IsPreselectedTicket:!1,ServiceAreas:null,IsAuthenticatedWidget:!1,start:function WP$Scheduling$Workflow$start(e){var t=this.SchedulingDataPool.AppointmentBuilder;switch(e&&(t.CampaignId=e.CampaignId,t.TopicIds=e.TopicIds,t.LinkSource=e.LinkSource,t.ReferringPage=e.ReferringPage,t.TermIds=e.TermIds),this.Type){case $$WP.Scheduling.Workflow.WorkflowTypesEnum.DecisionTreeNode:t.setProperty("ReasonForVisit",this.SchedulingDataPool.ReasonsForVisit.Models[0]),t.updateAppointmentsCollectionForReasonForVisit(t.ReasonForVisit,i.VisitTypeSourceEnum.Default,this,e.HasPatientLocationRule);break;case $$WP.Scheduling.Workflow.WorkflowTypesEnum.Ticket:t.setProperty("ReasonForVisit",this.TicketInfo.ReasonForVisit),t.updateAppointmentsCollectionForReasonForVisit(this.TicketInfo.ReasonForVisit,i.VisitTypeSourceEnum.Default,this,e.HasPatientLocationRule);break;case $$WP.Scheduling.Workflow.WorkflowTypesEnum.Reschedule:$$WP.Scheduling.OriginalAppointmentInfoController.Initialize(this.OriginalAppointmentInfo.OriginalAppointments,$$WP.Scheduling.Workflow.WorkflowTypesEnum.Reschedule),this.canRescheduleFullBundle()||(t.setProperty("ReasonForVisit",this.SchedulingDataPool.ReasonsForVisit.Models[0]),t.updateAppointmentsCollectionForReasonForVisit(t.ReasonForVisit,i.VisitTypeSourceEnum.Default,this,e.HasPatientLocationRule))}this.__initializePatientLocation(e.IsPatientLocationStepRequired)},__initializePatientLocation:function WP$Scheduling$Workflow$__initializePatientLocation(e){var t=null,i=null;if(t=this.__getInitialPatientLocation()){if(t.setProperty("State",n.StatesEnum.Selected),this.SchedulingDataPool.AppointmentBuilder.setProperty("PatientLocation",t),i=this.__getInitialPatientSublocation(t)){if("fakelocation"===i.Id)return void this.SchedulingDataPool.AppointmentBuilder.setProperty("PatientLocation",null);i.setProperty("State",n.StatesEnum.Selected),this.SchedulingDataPool.AppointmentBuilder.setProperty("PatientSublocation",i)}this.SchedulingDataPool.AppointmentBuilder.PatientLocation.setLocationName(),this.__isPatientLocationStepRequired(e)||this.SchedulingDataPool.AppointmentBuilder.setProperty("HasConfirmedPatientLocation",!0)}},__isPatientLocationStepRequired:function WP$Scheduling$Workflow$__isPatientLocationStepRequired(e){var t=this.SchedulingControllerParams.islocationconfirmed;return e&&!t},__getInitialPatientLocation:function WP$Scheduling$Workflow$__getInitialPatientLocation(){var e=null;return(e=this.__tryGetQueryStringPatientLocation())||(e=this.__getDefaultPatientLocation()),e},__tryGetQueryStringPatientLocation:function WP$Scheduling$Workflow$__tryGetQueryStringPatientLocation(){var e,t=null;return e=this.SchedulingControllerParams.location,$$WPUtil.IsNullOrEmpty(e)||(t=this.SchedulingDataPool.TelehealthLocations.getFromIndex("Id",e)),t},__getDefaultPatientLocation:function WP$Scheduling$Workflow$__getDefaultPatientLocation(){var e,t=null;for(e=0;e<this.SchedulingDataPool.TelehealthLocations.size();e++)if((t=this.SchedulingDataPool.TelehealthLocations.Models[e]).SelectedByDefault)return t;return null},__getInitialPatientSublocation:function WP$Scheduling$Workflow$__getInitialPatientSublocation(e){var t=null;return(t=this.__tryGetQueryStringPatientSublocation(e))||(t=this.__getDefaultPatientSublocation(e)),t},__tryGetQueryStringPatientSublocation:function WP$Scheduling$Workflow$__tryGetQueryStringPatientSublocation(e){var t,i=null;return t=this.SchedulingControllerParams.sublocation,e&&!$$WPUtil.IsNullOrEmpty(t)&&(i=e.SubLocations.getFromIndex("Id",t)),i},__getDefaultPatientSublocation:function WP$Scheduling$Workflow$__getDefaultPatientSublocation(e){var t,i=null;for(t=0;t<e.SubLocations.size();t++)if((i=e.SubLocations.Models[t]).SelectedByDefault)return i;return null},isBundleRescheduling:function WP$Scheduling$Workflow$isBundleRescheduling(){return!!this.OriginalAppointmentInfo&&!$$WPUtil.IsNullOrEmpty(this.OriginalAppointmentInfo.BundleId)},canRescheduleFullBundle:function WP$Scheduling$Workflow$canRescheduleFullBundle(){return this.isBundleRescheduling()&&!$$WPUtil.IsNullOrEmpty(this.OriginalAppointmentInfo.BundleReasonForVisitId)&&!!this.SchedulingDataPool.ReasonsForVisit.getFromIndex("Id",this.OriginalAppointmentInfo.BundleReasonForVisitId)},ResetPatientLocationToDefault:function WP$Scheduling$SlotStepController$ResetPatientLocationToDefault(){var e=null;this.SchedulingDataPool.AppointmentBuilder.PatientLocation&&(e=this.SchedulingDataPool.AppointmentBuilder.PatientLocation.SubLocations.getFirstInIndex("State",n.StatesEnum.Selected)),e&&e.setProperty("State",n.StatesEnum.Unselected),this.SchedulingDataPool.AppointmentBuilder.setProperty("PatientLocation",null),this.SchedulingDataPool.AppointmentBuilder.setProperty("PatientSublocation",null),this.SchedulingDataPool.AppointmentBuilder.setProperty("HasConfirmedPatientLocation",null),this.__initializePatientLocation()},hasProviderFirstOptions:function WP$Scheduling$Workflow$hasProviderFirstOptions(){var e,t,i,o,n;for(e=this.SchedulingDataPool.ReasonsForVisit.Models,o=0;o<e.length;o++)if(t=e[o],v(t))for(i=t.AllProviderDepartmentPairs,n=0;n<i.length;n++)if(i[n].Provider.IsStandardProvider)return!0;return!1},hasRfvFirstOptions:function WP$Scheduling$Workflow$hasRfvFirstOptions(){var e;return e=this.SchedulingDataPool.ReasonsForVisit.getFromIndex("ReasonForVisitFirst",!0),!0,!0,u.buildReasonsForVisitNoFiltering(e,true,true).length>0},getOneClickSlots:function WP$Scheduling$Workflow$getOneClickSlots(){return[]},isRfvAllowedForProviderFirstInDirectScheduling:function WP$Scheduling$Workflow$isRfvAllowedForProviderFirstInDirectScheduling(e,t){var i;if(!e.AllowProviderSelect||!e.ProviderFirst)return!1;for(i=0;i<e.DirectProviderDepartmentPairs.length;i++)if(e.DirectProviderDepartmentPairs[i].ProviderId===t.ID)return!0;return!1},toRawRequestObject:function WP$Scheduling$Workflow$toRawRequestObject(){return{Type:this.Type,IsGuest:this.IsGuest,IsAnonymous:this.IsAnonymous,IsFromPrelogin:this.IsFromPrelogin,RescheduleDat:this.OriginalAppointmentInfo?this.OriginalAppointmentInfo.Dat:null,RootDecisionTreeId:this.RootDecisionTreeId,DecisionTreeAnswerId:this.DecisionTreeAnswerId,DecisionTreeNodeId:this.DecisionTreeNodeId,DecisionTreeNodeCsn:this.DecisionTreeNodeCsn,SchedulingControllerParams:this.SchedulingControllerParams,SecureSessionToken:this.SecureSessionToken,BrowserId:this.BrowserId,MultiApptSlotStepStartingView:this.MultiApptSlotStepStartingView,MultiApptSlotStepSelectionView:this.MultiApptSlotStepSelectionView,IsAuthenticatedWidget:this.IsAuthenticatedWidget}},getTicketExpireDateString:function WP$Scheduling$Workflow$getTicketExpireDateString(){var e="";if($$WPUtil.IsNullOrEmpty(this.ExpireDate))return"";var t=[{Name:"@MYCHART@EXPIRATIONDATE@",Value:this.ExpireDate}];return $$WPUtil.IsNullOrEmpty(this.TicketInfo.AppointmentRequests[0])||(e=this.TicketInfo.AppointmentRequests[0].OriginalStandingOccurrences),e>1?this.__getSchedulingString("MultipleAppointmentsTicketExpirationDate",t):this.__getSchedulingString("TicketExpirationDate",t)},getTicketAvailableDateString:function WP$Scheduling$Workflow$getTicketAvailableDateString(){if($$WPUtil.IsNullOrEmpty(this.AvailableDate))return"";var e=[{Name:"@MYCHART@AVAILABLEDATE@",Value:this.AvailableDate}];return this.__getSchedulingString("TicketAvailableDate",e)},getTicketKeyValueStore:function WP$Scheduling$Workflow$getTicketKeyValueStore(){var e,t;return e={},(t=D(this.TicketInfo))&&(e[t]=this.TicketInfo,e[t].IsPreselected=this.IsPreselectedTicket),e},__getSchedulingString:function WP$Scheduling$Workflow$__getSchedulingString(e,t){var i;return t.forEach((function(e){$$WP.Strings.addMnemonic(e.Name,e.Value,!1,"scheduling")}),this),i=$$WP.Strings.getForTemplate(e,"scheduling"),t.forEach((function(e){$$WP.Strings.removeMnemonic(e.Name)}),this),i},isTypeOpenSchedulingWidget:function WP$Scheduling$Workflow$isTypeOpenSchedulingWidget(){return A(this.Type)},isTypeNewProvider:function WP$Scheduling$Workflow$isTypeNewProvider(){return R(this.Type)},isTypeOpenScheduling:function WP$Scheduling$Workflow$isTypeOpenScheduling(){return E(this.Type)},isTypeUnIdentifiedSelfTriageForAll:function WP$Scheduling$Workflow$isTypeUnIdentifiedSelfTriageForAll(){return this.IsGuest&&this.IsFromShopperState},isTypeTicket:function WP$Scheduling$Workflow$isTypeTicket(){return _(this.Type)}},m=function WP$Scheduling$Workflow$__createReactWorkflow(e,i){var o;return o=new u({Id:"React",Type:a.React,SchedulingDataPool:new t(i),SchedulingControllerParams:e}),k(o.SchedulingDataPool,i.Tickets),o},k=function WP$Scheduling$Workflow$__mergeTicketDataPools(e,t){if(t){t.sort(h);for(var i=0;i<t.length;i++)e.appendTicketToDataPool(t[i],e)}},w=function WP$Scheduling$Workflow$convertRawOriginalAppointmentInfoToModel(e){var t=e,i=null,o=null,n=null,r=0;for(r=0;r<e.OriginalAppointments.length;r++)n=$$WP.Scheduling.Provider.createProviderCollection(),i=e.OriginalAppointments[r],o=new $$WP.Scheduling.Slot(i.Slot),$$WP.Scheduling.Provider.convertRawProviders(i.Providers,n),$$WP.Scheduling.Provider.removeAnyProviderOption(n),t.OriginalAppointments[r].Slot=o,t.OriginalAppointments[r].Providers=n;return t},T=function WP$Scheduling$Workflow$allowProviderSelect(e,t,i,o){return!e||i||o?!t||t.AllowProviderSelect:e.AllowProviderSelect},I=function WP$Scheduling$Workflow$__hasMatchingRequestId(e,t){var i,o;if(!e)return!1;i=(o=e.TicketInfo.AppointmentRequests).length;for(var n=0;n<i;n++)if(o[n].ID===t)return!0;return!1},v=function WP$Scheduling$Workflow$isReasonForVisitAvailableProviderFirst(e){return e.AllowProviderSelect&&e.ProviderFirst},D=function WP$Scheduling$Workflow$__getTicketId(e){if(e){if(e.AppointmentRequests&&e.AppointmentRequests.length>0)return e.AppointmentRequests[0].ID;if(e.TicketId)return e.TicketId}return""},y=function WP$Scheduling$Workflow$__getTicketExpiration(e){return e.ExpirationDte>0?formatDate(WP.Utils.dte2date(e.ExpirationDte)):null},F=function WP$Scheduling$Workflow$__getTicketTitle(e){return e.BundleId?$$WP.Strings.getNamespace("Scheduling").getString("TicketBundleTitle"):e.DisplayName},A=function WP$Scheduling$Workflow$isWorkflowTypeOpenSchedulingWidget(e){return e===a.Widget||e===a.SimpleWidget||e===a.ProviderFinder},R=function WP$Scheduling$Workflow$isWorkflowTypeNewProvider(e){return e===a.NewProvider},E=function WP$Scheduling$Workflow$isWorkflowTypeOpenScheduling(e){return e===a.NewProvider||A(e)},_=function WP$Scheduling$Workflow$isWorkflowTypeTicket(e){return e===a.Ticket};u.prototype=W,u.WorkflowTypesEnum=a,u.getWorkflowTypesEnumName=function GetWorkflowTypesEnumName(e){for(key in a)if(a[key]===e)return key},u.getPatientFacingWorkflowType=function WP$Scheduling$Workflow$getPatientFacingWorkflowType(e,t){switch(e){case a.Standard:case a.ExistingProvider:case a.NewProvider:case a.Procedure:case a.Ticket:case a.Request:case a.Reschedule:case a.Widget:case a.SimpleWidget:case a.ProviderFinder:return t?r.PatientFacingWorkflowTypeEnum.PreLoginScheduling:r.PatientFacingWorkflowTypeEnum.PostLoginScheduling;case a.OnDemandTelehealth:return r.PatientFacingWorkflowTypeEnum.OnDemandVideoVisit;case a.DecisionTreeNode:return r.PatientFacingWorkflowTypeEnum.SelfTriage;default:return null}},u.tryParseWorkflowType=function WP$Scheduling$Workflow$tryParseWorkflowType(e){if($$WPUtil.IsNullOrEmpty(e))return null;var t=e.toLowerCase();for(key in a)if(key.toLowerCase()===t)return a[key];return null},u.createWorkflowCollection=function WP$Scheduling$Workflow$createWorkflowCollection(i,o,n,r,l,s,h,p,W,k,T,I,v,D,y,F,A){var R=null,E=null,_=null,b=null,O=o.OtherRfvUrl,N=o.OtherRfvFilename;(R=new e(c,d,g)).openChangeBatch();var V=m(y,o);switch(i){case a.Ticket:P(R,o,y,I,h,p,W,k,F),V.SchedulingDataPool.prepForWorkflow(V,!1,!1,!0);break;case a.Reschedule:E=new u({Id:"Reschedule",Type:a.Reschedule,SchedulingDataPool:new t(o),OriginalAppointmentInfo:w(r),SchedulingControllerParams:y,IsGuest:I}),I||(E.ShowSchedulingHubLink=!0),E.SchedulingDataPool.prepForWorkflow(E,!1),R.add(E);break;case a.DecisionTreeNode:(E=new u({Id:"DTNode",Type:a.DecisionTreeNode,SchedulingDataPool:new t(o),IsGuest:I,IsFromShopperState:F,RootDecisionTreeId:h,DecisionTreeAnswerId:p,DecisionTreeNodeId:W,DecisionTreeNodeCsn:k,SchedulingControllerParams:y})).ShowSchedulingHubLink=!0,E.SchedulingDataPool.prepForWorkflow(E,!1,!1),R.add(E);break;case a.OnDemandTelehealth:(E=new u({Id:"OnDemandTelehealth",Type:a.OnDemandTelehealth,SchedulingDataPool:new t(o),IsAnonymous:T,IsGuest:I,IsFromPrelogin:v,AnonymousSettings:D,SchedulingControllerParams:y,RootDecisionTreeId:h,DecisionTreeAnswerId:p})).SchedulingDataPool.prepForWorkflow(E,!1,!1),R.add(E);break;case a.Request:(E=new u({Id:"Request",Type:a.Request,SchedulingDataPool:new t(o),SchedulingControllerParams:y})).SchedulingDataPool.prepForWorkflow(E),R.add(E);break;case a.Widget:(E=new u({Id:"Widget",Type:i,SchedulingDataPool:new t(o),IsAnonymous:T,IsGuest:I,IsFromPrelogin:v,SchedulingControllerParams:y,IsAuthenticatedWidget:!!y.authcode&&!$$WPUtil.IsNullOrEmpty(y.authcode)})).ShowSchedulingHubLink=!0,E.SchedulingDataPool.prepForWorkflow(E,!1,!1),R.add(E);break;case a.ProviderFinder:(E=new u({Id:"ProviderFinder",Type:i,SchedulingDataPool:new t(o),IsAnonymous:T,IsGuest:I,IsFromPrelogin:v,SchedulingControllerParams:y})).ShowSchedulingHubLink=!0,E.SchedulingDataPool.prepForWorkflow(E,!1,!1),R.add(E);break;case a.NewProvider:$(R,o,y,T,I,v,A);break;default:(_=new u({Id:"ExistingProvider",Type:a.ExistingProvider,SchedulingDataPool:new t(o),SchedulingControllerParams:y})).SchedulingDataPool.prepForWorkflow(_,l,s,!1,O,N),_.hasProviderFirstOptions()&&R.add(_),$(R,o,y,T,I,v),(b=new u({Id:"Procedure",Type:a.Procedure,SchedulingDataPool:new t(o),SchedulingControllerParams:y})).SchedulingDataPool.prepForWorkflow(b,l,s,!1,O,N),b.hasRfvFirstOptions()&&R.add(b),P(R,o,y,I),function WP$Scheduling$Workflow$s_addFavoriteAppointmentWorkflows(e,i,o,n){var r,l,a,s;if(!$$WPUtil.IsNullOrEmpty(o))for(r=0;r<o.length;r++)l=new u({Id:o[r].Csn,Type:null,IsFavorite:!0,FavoriteAppointmentInfo:o[r],SchedulingDataPool:new t(i)}),null!==(a=f(l))&&(l.Type=a,l.SchedulingDataPool.prepForWorkflow(l,n),e.add(l),s=S(l),l.FavoriteAppointmentInfo.HideProviderName=!s.AllowProviderSelect)}(R,o,n,l),V.SchedulingDataPool.prepForWorkflow(V,l,s,!1,O,N)}return R.add(V),R.closeChangeBatch(),R},u.allowProviderSelect=T,u.allowProviderSelectForAppointment=function WP$Scheduling$Workflow$allowProviderSelectForAppointment(e,t){var i=e.ReasonForVisit,o=t.VisitType,n=e.numAppointments()>1,r=t.hasSwitchedVisitType();return T(i,o,n,r)},u.getWorkflowFromType=function WP$Scheduling$Workflow$getWorkflowFromType(e,t,i){var o=null;switch(t){case u.WorkflowTypesEnum.Ticket:o=function WP$Scheduling$Workflow$__getAppointmentRequestWorkflow(e,t){var i,o=null,n=0;if($$WPUtil.IsNullOrEmpty(t)||!e)return null;if(i=e.getFromIndex("Type",u.WorkflowTypesEnum.Ticket),Array.isArray(i)){n=i.length;for(var r=0;r<n;r++)if(o=i[r],I(o,t))return o}return null}(e,i),o||$$WPUtil.IsNullOrEmpty(i)||(o=e.getFromIndex("Id",i));break;case u.WorkflowTypesEnum.ExistingProvider:o=e.getFromIndex("Id","ExistingProvider");break;case u.WorkflowTypesEnum.NewProvider:o=e.getFromIndex("Id","NewProvider");break;case u.WorkflowTypesEnum.Procedure:o=e.getFromIndex("Id","Procedure");break;case u.WorkflowTypesEnum.Request:o=e.getFromIndex("Id","Request");break;case u.WorkflowTypesEnum.ProviderFinder:o=e.getFromIndex("Id","ProviderFinder");break;case u.WorkflowTypesEnum.OnDemandTelehealth:case u.WorkflowTypesEnum.Reschedule:case u.WorkflowTypesEnum.DecisionTreeNode:case u.WorkflowTypesEnum.Widget:o=e.Models[0]}return o},u.isReasonForVisitAvailableProviderFirst=v,u.buildReasonsForVisitNoFiltering=function WP$Scheduling$Workflow$buildReasonsForVisitNoFiltering(e,t,i,o,n,r){var l,a,s;for(l=[],a=0;a<e.length;a++)(s=e[a]).ReasonForVisitFirst&&u.shouldIncludeReasonForVisit(s,t,i,o,n,r)&&l.push(s);return l.sort($$WP.Scheduling.ReasonForVisit.sortReasons),l},u.shouldIncludeReasonForVisit=function WP$Scheduling$Workflow$shouldIncludeReasonForVisit(e,t,i,n,r,l){return!(!e.DefaultVisitType||!e.DefaultVisitType.isVisitTypeMyChartLink())||!!u.isReasonForVisitEnabledForDirectOrRequest(t,i,e)&&(!!u.doesRfvHaveMatchingProviderDepartmentPair(e,t,i)||!!o.canStartSchedulingWhenEmpty(e.DefaultVisitType,n,r,l))},u.isReasonForVisitEnabledForDirectOrRequest=function WP$Scheduling$Workflow$isRfvIncludedForDirectOrRequest(e,t,i){var o=!1;return e&&(o=o||i.CanDirectSchedule),t&&(o=o||i.CanRequest),o},u.doesRfvHaveMatchingProviderDepartmentPair=function WP$Scheduling$Workflow$doesRfvHaveMatchingProviderDepartmentPair(e,t,i){var o=0,n=!0,r=null;if(e.IsMultipleAppointments){for(o=0;o<e.ApptComponents.length;o++)r=e.ApptComponents[o],n=n&&u.doesSingleOrComponentRfvHaveMatchingProviderDepartmentPair(r,t,i);return n}return u.doesSingleOrComponentRfvHaveMatchingProviderDepartmentPair(e,t,i)},u.doesSingleOrComponentRfvHaveMatchingProviderDepartmentPair=function WP$Scheduling$Workflow$doesSingleOrComponentRfvHaveMatchingProviderDepartmentPair(e,t,i){return!(!e||!e.HasIncompleteSchedulingData||!t&&!i)||(!!(t&&e.DirectProviderDepartmentPairs.length>0)||!!(i&&e.RequestProviderDepartmentPairs.length>0))},u.getThirdPartyWorkflowNameFromWorkflowType=function WP$Scheduling$Workflow$getThirdPartyWorkflowNameFromWorkflowType(e){var t=$$WP.Analytics.ThirdPartyViewEvent,i=null;switch(e){case a.ExistingProvider:i=t.SchedulingWorkflowsEnum.ProviderFirst;break;case a.Procedure:i=t.SchedulingWorkflowsEnum.ReasonForVisitFirst;break;case a.Ticket:i=t.SchedulingWorkflowsEnum.Ticket;break;case a.Request:i=t.SchedulingWorkflowsEnum.Request;break;case a.Reschedule:i=t.SchedulingWorkflowsEnum.Reschedule;break;case a.OnDemandTelehealth:i=t.SchedulingWorkflowsEnum.OnDemandTelehealth;break;case a.DecisionTreeNode:i=t.SchedulingWorkflowsEnum.DecisionTreeNode;break;case a.NewProvider:i=t.SchedulingWorkflowsEnum.NewProvider;break;case a.Widget:i=t.SchedulingWorkflowsEnum.Widget;break;case a.ProviderFinder:i=t.SchedulingWorkflowsEnum.ProviderFinder;break;default:i=null}return i},u.isWorkflowTypeOpenSchedulingWidget=A,u.isWorkflowTypeNewProvider=R,u.isWorkflowTypeOpenScheduling=E,u.StatesEnum=l,u.MultiApptSlotStepViewTypeEnum={Undefined:0,SimpleSlotsView:1,OneApptAtATimeView:2,DetailedPreGroupedView:3},$$WP.Scheduling=$$WP.Scheduling||{},$$WP.Scheduling.Workflow=u,u.extend($$WP.Common.Model,"WP$Scheduling$Workflow")}(),$$WP.Debug.UnitTest=$$WP.Debug.UnitTest||{},$$WP.Debug.UnitTest.tests=$$WP.Debug.UnitTest.tests||[],$$WP.Debug.UnitTest.tests.push((function UnitTests$Scheduling$Workflow(e){$$WP.Debug.UnitTest.assert}));;
!function WP$Scheduling$AppointmentViewModel$definition(){var e=function WP$Scheduling$AppointmentViewModel(e){this.WP$Common$Model(e)};e.prototype={s_dataMembers:["TitleHtml","Department","StartTimeString","ArrivalTimeString","LengthInMinutes","Payment","DateTimeUtc","TimeZoneMarker","ShowTimeZone","DateString","VisitType","FirstInDay","LastInDay","CanShowAppointmentTime","ProviderName","ProviderBioUrl","IsInPerson","IsVideoVisit","IsTelephoneVisit","SelectedTelehealthMode","ShowLocationStepForTelehealthVisit","DepartmentAddressDisplay","PhoneNumberDisplay"],TitleHtml:"",Department:null,StartTimeString:null,ArrivalTimeString:"",LengthInMinutes:0,Payment:null,DateTimeUtc:null,TimeZoneMarker:"",ShowTimeZone:!1,DateString:"",VisitType:null,FirstInDay:null,LastInDay:null,CanShowAppointmentTime:null,ProviderName:"",ProviderBioUrl:"",IsInPerson:!1,IsVideoVisit:!1,IsTelephoneVisit:!1,SelectedTelehealthMode:null,IsActiveAppt:!1,ShowLocationStepForTelehealthVisit:!1,DepartmentAddressDisplay:"",PhoneNumberDisplay:"",CanSkipLicensureCheck:!1,populateFromSlot:function WP$Scheduling$AppointmentViewModel$populateFromSlot(e,t,i,n,l,o){var r=!1,s=null,h=null,a=!1,p=null,m="";this.StartTimeString=e.TimeString,this.DateTimeUtc=e.DateTimeUtc,this.TimeZoneMarker=e.TimeZoneMarker,this.ShowTimeZone=e.ShowTimeZone,this.DateString=e.DateString,t&&i&&n&&(p=i.SelectedTelehealthMode,r=$$WP.Scheduling.Workflow.allowProviderSelectForAppointment(t,i),s=n.Providers.getFromIndex("ID",e.ProviderId),h=n.Departments.getFromIndex("ID",e.DepartmentId),a=!$$WPUtil.IsNullOrEmpty(s.WebPageUrl)&&!l,m=$$WPSchedulingUtil.GetVisitDisplayName(i,o.TicketInfo,p),this.TitleHtml=$$WPSchedulingUtil.ConstructAppointmentStringHtml(s,h,m,r,a),this.Department=h,this.VisitType=i.VisitType,this.ProviderName=s.Name,this.ProviderBioUrl=s.WebPageUrl,this.IsInPerson=i.isAppointmentInPerson(),this.IsVideoVisit=i.isVideoVisit(),this.IsTelephoneVisit=i.isTelephoneVisit(),this.SelectedTelehealthMode=i.SelectedTelehealthMode,this.ShowLocationStepForTelehealthVisit=i.VisitType.ShowLocationStepForTelehealthVisit,this.DepartmentAddressDisplay=$$WPSchedulingUtil.GetDisplayDepartmentAddress(h),this.PhoneNumberDisplay=$$WPSchedulingUtil.GetDisplayPhonenumber(h),this.CanSkipLicensureCheck=i.CanSkipLicensureCheck)},populateFromReviewResultAndSlot:function WP$Scheduling$AppointmentViewModel$populateFromReviewResultAndSlot(e,t){var i=e.VisitPayment,n=e.AppointmentLength,l="";i&&!$$WPUtil.IsNullOrEmpty(i.Amount)?i.IsPrepay=3===i.Type:i=null,e.CanShowAppointmentTime&&e.ArrivalTime===t.StartTime||(l=e.ArrivalTimeString),this.Payment=i,this.LengthInMinutes=n,this.ArrivalTimeString=l,this.CanShowAppointmentTime=e.CanShowAppointmentTime},populateFromEmptyAppointment:function WP$Scheduling$AppointmentViewModel$populateFromEmptyAppointment(e,t){var i,n=e.SelectedTelehealthMode;this.VisitType=e.VisitType,i=$$WPSchedulingUtil.GetVisitDisplayName(e,t.TicketInfo,n),this.TitleHtml=HTMLEncode(i)},populateFromOriginalAppointment:function WP$Scheduling$AppointmentViewModel$populateFromOriginalAppointment(e,t){var i=e.Slot,n=e.TelehealthMode,l=e.Providers.Models[0],o=e.Departments[0],r=e.VisitTypes[0],s=r.DisplayName;this.StartTimeString=i.TimeString,this.DateTimeUtc=i.DateTimeUtc,this.TimeZoneMarker=i.TimeZoneMarker,this.ShowTimeZone=i.ShowTimeZone,this.DateString=i.DateString,this.TitleHtml=$$WPSchedulingUtil.ConstructAppointmentStringHtml(l,o,s,!0,!1),this.Department=o,this.VisitType=r,l&&(this.ProviderName=l.Name,this.ProviderBioUrl=l.WebPageUrl),this.IsInPerson=n===$$WP.Scheduling.VisitType.TelehealthModeEnum.InPerson,this.IsVideoVisit=n===$$WP.Scheduling.VisitType.TelehealthModeEnum.Video,this.IsTelephoneVisit=n===$$WP.Scheduling.VisitType.TelehealthModeEnum.Telephone,this.SelectedTelehealthMode=n,this.IsActiveAppt=e.Dat===t}},$$WP.Scheduling=$$WP.Scheduling||{},$$WP.Scheduling.AppointmentViewModel=e,e.extend($$WP.Common.Model,"WP$Scheduling$AppointmentViewModel")}();;
/*! Copyright Epic Systems Corporation 2019 */
!function WP$Scheduling$SolutionViewModel$definition(){var t=function WP$Scheduling$SolutionViewModel(t){this.WP$Common$Model(t)};t.prototype={s_dataMembers:[],Appointments:[],Alerts:[],ShowAlerts:!1,ShowArrivalTime:!1,ShowDate:!1,NumAppointmentsWithPayment:0,HasPatientLocation:!1,populateFromReasonForVisit:function WP$Scheduling$SolutionViewModel$populateFromReasonForVisit(t,e,n){var i=0,o=null,l="";for(this.Appointments=[],i=0;i<t.ApptComponents.length;i++)l=$$WPSchedulingUtil.GetVisitDisplayNameFromComponent(t.ApptComponents[i],e.TicketInfo,n),o=new $$WP.Scheduling.AppointmentViewModel({TitleHtml:HTMLEncode(l)}),this.Appointments.push(o)},populateFromSolution:function WP$Scheduling$SolutionViewModel$populateFromSolution(t,e,n){var i=t.AppointmentBuilder,o=null,l=null,p=0,s=null;for(this.Appointments=[],p=0;p<i.numAppointments();p++)o=i.getAppointment(p),l=e.Slots[p],(s=new $$WP.Scheduling.AppointmentViewModel).populateFromSlot(l,i,o,t,!1,n),this.Appointments.push(s);this.Appointments.sort($$WP.Scheduling.Slot.slotSortFunction),this.__setAppointmentSequenceProperties()},populateFromReviewResult:function WP$Scheduling$SolutionViewModel$populateFromReviewResult(t,e,n){var i=t.AppointmentBuilder,o=null,l=null,p=null,s=0,u=null;for(this.Appointments=[],s=0;s<i.numAppointments();s++)o=e.Appointments[s],p=(l=i.getAppointment(s)).Slot,(u=new $$WP.Scheduling.AppointmentViewModel).populateFromSlot(p,i,l,t,!0,n),u.populateFromReviewResultAndSlot(o,p),this.Appointments.push(u);this.Appointments.sort($$WP.Scheduling.Slot.slotSortFunction),this.__setAppointmentSequenceProperties(),this.Alerts=this.__generateAlerts(t),this.ShowAlerts=this.Alerts.length>0,this.ShowArrivalTime=!0,this.NumAppointmentsWithPayment=this.__getNumberOfAppointmentsWithPayment()},populateFromOriginalAppointmentInfo:function WP$Scheduling$SolutionViewModel$populateFromOriginalAppointmentInfo(t){var e=0,n=null,i=null;this.Appointments=[];var o=t.OriginalAppointments,l=t.Dat;for(e=0;e<o.length;e++)i=o[e],(n=new $$WP.Scheduling.AppointmentViewModel).populateFromOriginalAppointment(i,l),this.Appointments.push(n);this.Appointments.sort($$WP.Scheduling.Slot.slotSortFunction),this.__setAppointmentSequenceProperties(),this.Alerts=this.__generateAlertsFromOriginalAppointments(o),this.ShowAlerts=this.Alerts.length>0,this.ShowDate=!0,this.ShowArrivalTime=!0,this.NumAppointmentsWithPayment=this.__getNumberOfAppointmentsWithPayment()},__generateAlerts:function WP$Scheduling$SolutionViewModel$__generateAlerts(t){var e=[],n=0,i=t.AppointmentBuilder,o=null,l=!0,p=[];for(n=0;n<i.numAppointments();n++)o=i.getAppointment(n),e.push(o.Slot),l=l&&o.areLocationsGrouped();return $$WP.Scheduling.Slot.areAllSlotsOnTheSameDay(e)||p.push($$WP.Scheduling.Alert.AlertTypeEnum.SolutionIsOnMultipleDates),$$WP.Scheduling.Slot.areAllSlotsInTheSameLocation(e,t.Departments,t.Locations,l)||p.push($$WP.Scheduling.Alert.AlertTypeEnum.SolutionIsInMultipleLocations),p},__generateAlertsFromOriginalAppointments:function WP$Scheduling$SolutionViewModel$__generateAlertsFromOriginalAppointments(t){var e=[],n=0,i=[],o=null,l=!0,p="";for(n=0;n<t.length;n++)o=t[n],e.push(o.Slot),$$WPUtil.IsNullOrEmpty(p)?p=o.Departments[0].ID:l=l&&o.Departments[0].ID===p;return $$WP.Scheduling.Slot.areAllSlotsOnTheSameDay(e)||i.push($$WP.Scheduling.Alert.AlertTypeEnum.SolutionIsOnMultipleDates),l||i.push($$WP.Scheduling.Alert.AlertTypeEnum.SolutionIsInMultipleLocations),i},__getNumberOfAppointmentsWithPayment:function WP$Scheduling$SolutionViewModel$__getNumberOfAppointmentsWithPayment(){var t=0,e=null,n=0;for(t=0;t<this.Appointments.length;t++)(e=this.Appointments[t]).Payment&&!$$WPUtil.IsNullOrEmpty(e.Payment.Amount)&&n++;return n},__setAppointmentSequenceProperties:function WP$Scheduling$SolutionViewModel$__setAppointmentSequenceProperties(){var t=0,e=null,n="";for(t=0;t<this.Appointments.length;t++)(e=this.Appointments[t]).LastInDay=!1,e.DateString===n?e.FirstInDay=!1:(e.FirstInDay=!0,t>0&&(this.Appointments[t-1].LastInDay=!0)),n=e.DateString}},$$WP.Scheduling=$$WP.Scheduling||{},$$WP.Scheduling.SolutionViewModel=t,t.extend($$WP.Common.Model,"WP$Scheduling$SolutionViewModel")}();;
!function WP$Scheduling$ProvidersUpdatedViewModel$definition(){var e=function WP$Scheduling$ProvidersUpdatedViewModel(){this.WP$Common$Model()};__hasAnyDifferences=function WP$Scheduling$ProvidersUpdatedHelper$__hasAnyDifferences(e){return!!e&&(!!(e.NetAdded&&Object.keys(e.NetAdded).length>0)||!!(e.NetRemoved&&Object.keys(e.NetRemoved).length>0))},__areAnyAvailableProvidersAddedByLqf=function WP$Scheduling$ProvidersUpdatedHelper$__areAnyAvailableProvidersAddedByLqf(e){var d=0,i=$$WPSchedulingUtil.BuildProvidersFiltered(!0,!1,!1,e.ReasonForVisit,[],!1);for(d=0;d<i.length;d++)if(i[d].LqfProviderAction===$$WP.Scheduling.Provider.LqfActionEnum.Added)return!0;return!1},__areAnyProvidersRemovedByLqf=function WP$Scheduling$ProvidersUpdatedHelper$__areAnyProvidersRemovedByLqf(e){var d=0;for(d=0;d<e.length;d++)if(e[d].LqfProviderAction===$$WP.Scheduling.Provider.LqfActionEnum.Removed)return!0;return!1},getAppointmentProviderLqfAction=function WP$Scheduling$ProvidersUpdatedHelper$getAppointmentProviderLqfAction(e){var d,i,r=e.AppointmentBuilder.Appointments.toArray()[0];return 0===e.Lqfs.toArray().length?AppointmentProvidersLqfActionEnum.None:(d=__areAnyAvailableProvidersAddedByLqf(r),i=__areAnyProvidersRemovedByLqf(e.Providers.toArray()),d&&!i?AppointmentProvidersLqfActionEnum.SomeAdded:!d&&i?AppointmentProvidersLqfActionEnum.SomeRemoved:d&&i?AppointmentProvidersLqfActionEnum.SomeAddedAndRemoved:AppointmentProvidersLqfActionEnum.None)},AppointmentProvidersLqfActionEnum={None:0,SomeAdded:1,SomeRemoved:2,SomeAddedAndRemoved:3},buildViewModel=function WP$Scheduling$ProvidersUpdatedViewModel$BuildViewModel(d,i,r,o,n,t){var s;return o&&__hasAnyDifferences(d)?((s=new e).__initialize(d,i,r,n,t),s):null},e.prototype={s_dataMembers:["WereAllProvidersEverReplaced","AnsweredAnyQuestions","AddedProviders","RemovedProviders","FirstAddedProvider","SecondAddedProvider","FirstRemovedProvider","SecondRemovedProvider","IsAddingMultiple","IsRemovingMultiple","NumUnshownAdded","NumUnshownRemoved","IsNumUnshownAddedCircled","IsNumUnshownRemovedCircled","AddedBlurb","RemovedBlurb","NumUnshownAddedText","NumUnshownRemovedText","CanShowAddedProviders"],WereAllProvidersEverReplaced:!1,AnsweredAnyQuestions:!1,AddedProviders:[],RemovedProviders:[],FirstAddedProvider:null,SecondAddedProvider:null,FirstRemovedProvider:null,SecondRemovedProvider:null,IsAddingMultiple:!1,IsRemovingMultiple:!1,NumUnshownAdded:0,NumUnshownRemoved:0,IsNumUnshownAddedCircled:!1,IsNumUnshownRemovedCircled:!1,AddedBlurb:"",RemovedBlurb:"",NumUnshownAddedText:"",NumUnshownRemovedText:"",Subheader:"",CanShowAddedProviders:!0,CanShowRemovedProviders:!0,__initialize:function(e,d,i,r,o){this.WereAllProvidersEverReplaced=i,this.AnsweredAnyQuestions=d,this.SchedulingStringsNamespace=$$WP.Strings.getNamespace("Scheduling"),this.__buildViewModelProviders(e),this.__buildViewModelPrimaryProviders(),this.CanShowAddedProviders=r&&this.__areProvidersShowable([this.FirstAddedProvider,this.SecondAddedProvider]),this.CanShowRemovedProviders=o&&this.__areProvidersShowable([this.FirstRemovedProvider,this.SecondRemovedProvider]),this.__buildViewModelText()},__buildViewModelText:function WP$Scheduling$ProvidersUpdatedHelper$__buildViewModelText(){this.__setMnemonics(this.SchedulingStringsNamespace),this.AddedProviders.length>0&&(this.AddedBlurb=this.__getProvidersAddedBlurb(this.AddedProviders.length)),this.RemovedProviders.length>0&&(this.RemovedBlurb=this.__getProvidersRemovedBlurb(this.RemovedProviders.length)),this.AnsweredAnyQuestions?this.Subheader=this.SchedulingStringsNamespace.getString("ProvidersUpdatedAfterQuestionsHeader"):this.Subheader=this.SchedulingStringsNamespace.getString("ProvidersUpdatedHeader"),this.__getNumOtherProvidersChangedText(),this.SchedulingStringsNamespace.clearMnemonics()},__getNumOtherProvidersChangedText:function WP$Scheduling$ProvidersUpdatedHelper$__getNumOtherProvidersChangedText(){var e=$$WP.Strings.EncodingTypes.None;this.NumUnshownAdded>0?(this.SchedulingStringsNamespace.addMnemonic("@MYCHART@NUMBEROFOTHERPROVIDERS@",this.NumUnshownAdded,e),this.NumUnshownAddedText=this.SchedulingStringsNamespace.getString("numOtherProvidersChanged")):this.NumUnshownAddedText=null,this.NumUnshownRemoved>0?(this.SchedulingStringsNamespace.addMnemonic("@MYCHART@NUMBEROFOTHERPROVIDERS@",this.NumUnshownRemoved,e),this.NumUnshownRemovedText=this.SchedulingStringsNamespace.getString("numOtherProvidersChanged")):this.NumUnshownRemovedText=null,this.SchedulingStringsNamespace.addMnemonic("@MYCHART@NUMBEROFOTHERPROVIDERS@","",e)},__getProvidersAddedBlurb:function WP$Scheduling$ProvidersUpdatedHelper$__getProvidersAddedBlurb(e){var d="Included";return this.WereAllProvidersEverReplaced&&(d="Added"),this.CanShowAddedProviders?1===e?this.SchedulingStringsNamespace.getString(d+"OneProvider"):2===e?this.SchedulingStringsNamespace.getString(d+"TwoProviders"):e>2?this.SchedulingStringsNamespace.getString(d+"ThreePlusProviders"):null:this.SchedulingStringsNamespace.getString(d+"HiddenProviders")},__getProvidersRemovedBlurb:function WP$Scheduling$ProvidersUpdatedHelper$__getProvidersRemovedBlurb(e){return this.CanShowRemovedProviders?1===e?this.SchedulingStringsNamespace.getString("RemovedOneProvider"):2===e?this.SchedulingStringsNamespace.getString("RemovedTwoProviders"):e>2?this.SchedulingStringsNamespace.getString("RemovedThreePlusProviders"):null:this.SchedulingStringsNamespace.getString("RemovedHiddenProviders")},__setMnemonics:function WP$Scheduling$ProvidersUpdatedHelper$__getMnemonics(e){var d=$$WP.Strings.EncodingTypes.None,i="INCLUDED";this.WereAllProvidersEverReplaced&&(i="ADDED"),this.AddedProviders.length>0&&(e.addMnemonic("@MYCHART@NUMBEROFOTHERS"+i+"@",this.AddedProviders.length-1,d),e.addMnemonic("@MYCHART@"+i+"PROVIDER@",this.AddedProviders[0].Name,d),e.addMnemonic("@MYCHART@"+i+"PROVIDER1@",this.AddedProviders[0].Name,d),e.addMnemonic("@MYCHART@FIRST"+i+"PROVIDER@",this.AddedProviders[0].Name,d)),this.AddedProviders.length>1&&e.addMnemonic("@MYCHART@"+i+"PROVIDER2@",this.AddedProviders[1].Name,d),this.RemovedProviders.length>0&&(e.addMnemonic("@MYCHART@NUMBEROFOTHERSREMOVED@",this.RemovedProviders.length-1,d),e.addMnemonic("@MYCHART@REMOVEDPROVIDER@",this.RemovedProviders[0].Name,d),e.addMnemonic("@MYCHART@REMOVEDPROVIDER1@",this.RemovedProviders[0].Name,d),e.addMnemonic("@MYCHART@FIRSTREMOVEDPROVIDER@",this.RemovedProviders[0].Name,d)),this.RemovedProviders.length>1&&e.addMnemonic("@MYCHART@REMOVEDPROVIDER2@",this.RemovedProviders[1].Name,d)},__buildViewModelProviders:function WP$Scheduling$ProvidersUpdatedHelper$__getProvDifferencesViewModel(e){this.AddedProviders=this.__getProvidersDisplayViewModel(e.NetAdded),this.RemovedProviders=this.__getProvidersDisplayViewModel(e.NetRemoved),this.__setProviderCountProperties()},__setProviderCountProperties:function WP$Scheduling$ProvidersUpdatedHelper$__setProviderCountProperties(){var e,d;e=this.AddedProviders.length,d=this.RemovedProviders.length,this.IsAddingMultiple=e>1,this.IsRemovingMultiple=d>1,e>2&&(this.NumUnshownAdded=e-1,this.IsNumUnshownAddedCircled=this.NumUnshownAdded<100),d>2&&(this.NumUnshownRemoved=d-1,this.IsNumUnshownRemovedCircled=this.NumUnshownRemoved<100)},__getProvidersDisplayViewModel:function WP$Scheduling$ProvidersUpdatedHelper$__getProvidersDisplayViewModel(e){var d=[],i=null;for(var r in e)i=e[r],d.push(this.__getOneProviderDisplayViewModel(i));return d},__getOneProviderDisplayViewModel:function WP$Scheduling$ProvidersUpdatedHelper$__getOneProviderDisplayViewModel(e){var d={};return d.Name=e.Name,d.PhotoClass=e.PhotoClass,d.ID=e.ID,d.PhotoUrl=e.PhotoUrl,this.__tryDefaultProviderPhoto(d),d},__tryDefaultProviderPhoto:function WP$Scheduling$ProvidersUpdatedHelper$__tryDefaultProviderPhoto(e){e.PhotoUrl||(e.PhotoUrl=makeStaticLink("images/ProxySilhouette.png"),e.PhotoClass+=" colorpreview")},__buildViewModelPrimaryProviders:function WP$Scheduling$ProvidersUpdatedHelper$__buildViewModelPrimaryProviders(){this.AddedProviders.sort($$WP.Scheduling.Provider.sortProviders),this.RemovedProviders.sort($$WP.Scheduling.Provider.sortProviders),this.AddedProviders.length>0&&(this.FirstAddedProvider=this.AddedProviders[0]),this.AddedProviders.length>1&&(this.SecondAddedProvider=this.AddedProviders[1]),this.RemovedProviders.length>0&&(this.FirstRemovedProvider=this.RemovedProviders[0]),this.RemovedProviders.length>1&&(this.SecondRemovedProvider=this.RemovedProviders[1])},__areProvidersShowable:function WP$Scheduling$ProvidersUpdatedHelper$__areProvidersShowable(e){var d=0,i=null,r=!0;for(d=0;d<e.length;d++)if((i=e[d])&&i&&""===i.Name){r=!1;break}return r}},e.buildViewModel=buildViewModel,e.getAppointmentProviderLqfAction=getAppointmentProviderLqfAction,$$WP.Scheduling=$$WP.Scheduling||{},$$WP.Scheduling.ProvidersUpdatedViewModel=e,e.extend($$WP.Common.Model,"WP$Scheduling$ProvidersUpdatedViewModel")}();;
!function WP$Scheduling$SchedulingSelectableViewBinder$definition(){var e=function WP$Scheduling$SchedulingSelectableViewBinder(e,t,i,l){this.WP$Common$SelectableViewBinder(e,t,i,l)};e.prototype={_onSyncModelToDOM:function(e){var t=this.getBoundElements(e);e[this._statePropertyName]===this._selected?(t.addClass("selected"),t.safeAttr("role","button"),t.safeAttr("aria-pressed","true")):(t.removeClass("selected"),t.closest(".autoadvance").length>0?t.removeAttr("aria-pressed").removeAttr("role"):t.safeAttr("aria-pressed")&&t.safeAttr("aria-pressed","false"))}},$$WP.Scheduling=$$WP.Scheduling||{},$$WP.Scheduling.SchedulingSelectableViewBinder=e,e.extend($$WP.Common.SelectableViewBinder,"WP$Scheduling$SchedulingSelectableViewBinder")}();;
!function ClassDefinition(){var i=$$WP.Strings.getNamespace("Core.Video"),e=function WP$UI$VideoViewModel(i,e,t,n){$$WP.Utilities.UI.IsMobile?this.Horizontal=e:this.Horizontal=1,this.VideoID=i,this.Thumbnail=this._determineVideoThumbnail(),void 0===n&&(n=function(){return!1}),this._determineVideoUrl(t,n)};e.prototype={VideoID:null,Icon:null,ThumbnailDescription:null,Title:null,Description:null,Horizontal:null,Url:null,_determineVideoThumbnail:function WP$UI$VideoViewModel$_determineVideoThumbnail(){var i;return i=this.VideoID+"Thumbnail",this.Horizontal||(i+="Mobile"),makeStaticImageLink("video/"+i+".svg")},_determineVideoTitle:function WP$UI$VideoViewModel$_determineVideoTitle(){var e;return e=this.VideoID+"Title",i.getString(e)},_determineVideoDescription:function WP$UI$VideoViewModel$_determineVideoDescription(){var e;return e=this.VideoID+"Description",i.getString(e)},_determineThumbnailDescription:function WP$UI$VideoViewModel$_determineThumbnailDescription(){var e;return e=this.VideoID+"ThumbnailDescription",i.getString(e)},_getCustomThumbnailDescription:function WP$UI$VideoViewModel$_getCustomThumbnailDescription(){return i.getString("GenericThumbnailDescription")},_determineVideoUrl:function WP$UI$VideoViewModel$_determineVideoUrl(i,e){var t=this.VideoID;this.Horizontal||(t+="Mobile"),$.ajax({url:makeLink("Video/GetVideoViewModel"),type:"POST",cache:!1,global:!1,data:{videoID:t},dataType:"json",success:function(e){this.Url=e.Url,this.Title=e.DisplayName?e.DisplayName:this._determineVideoTitle(),this.Description=e.Description?e.Description:this._determineVideoDescription(),this.ThumbnailDescription=e.DisplayName?this._getCustomThumbnailDescription():this._determineThumbnailDescription(),null!==i&&i(this)}.bind(this),error:function(){e()}})}},$$WP.UI.VideoViewModel=e,e.extend($$WP.Common.Model,"WP$UI$VideoViewModel")}();;
/*! Copyright 2022 Epic Systems Corporation */
!function WP$UI$Dropdown$definition(){var e=function WP$UI$Dropdown(e){this.WP$Common$Model(e),this.__setPlaceholderText()};e.prototype={s_dataMembers:["IdName","Label","IsMultiselect","ValidationSettings","PlaceholderText","PlaceholderValue","Options"],IdName:"",Label:"",IsMultiselect:!1,ValidationSettings:null,PlaceholderText:"",PlaceholderValue:"",Options:[],__setPlaceholderText:function WP$UI$Dropdown$__setPlaceholderText(){var e=$$WP.Strings.getNamespace("UI.Dropdown");$$WPUtil.IsNullOrEmpty(this.PlaceholderText)&&(this.IsMultiselect?this.PlaceholderText=e.getString("MultiselectPlaceholderText"):this.PlaceholderText=e.getString("PlaceholderText"))}},e.onChange=function WP$UI$Dropdown$onChange(e){var o=$afe.jq(e.currentTarget);o.find("option:selected").hasClass("placeholder")?o.addClass("placeholderSelected"):o.removeClass("placeholderSelected")},e.bindOnChange=function WP$UI$Dropdown$bindOnChange(o,n){null!==n&&"function"==typeof n||(n=e.onChange),o.on("change",n)},$$WP.UI=$$WP.UI||{},$$WP.UI.Dropdown=e,$$WP.Common&&e.extend($$WP.Common.Model,"WP$UI$Dropdown")}(),function WP$UI$DropdownOption$definition(){var e=function WP$UI$DropdownOption(e,o="Value",n="DisplayString"){e.Value=e[o],e.DisplayString=e[n],this.WP$Common$Model(e)};e.prototype={s_dataMembers:["Value","DisplayString"],Value:"",DisplayString:""},e.convertRawDropdownOptions=function WP$UI$DropdownOption$convertRawDropdownOptions(o,n="Value",t="DisplayString"){var l=[],a=0,i=null,r=null;if(Array.isArray(o))for(a=0;a<o.length;a++)"object"==typeof(i=o[a])&&void 0!==i[n]&&void 0!==i[t]&&(r=new e(i,n,t),l.push(r));return l},$$WP.UI=$$WP.UI||{},$$WP.UI.DropdownOption=e,$$WP.Common&&e.extend($$WP.Common.Model,"WP$UI$DropdownOption")}();;
/*0*/