/*! Copyright (c) Epic Systems Corporation 2014-2018 */
var $$WPComp;void 0===$$WP.Components&&($$WP.Components={TITLEBARIDENTIFIER:"titlebar",TOOLBARIDENTIFIER:"toolbar",__Instances:[],getInstance:function WPComp$getInstance(t){return $$WPComp.__Instances[t]},isComponent:function WPComp$isComponent(t){return!(!t||isNaN(t.ComponentNumber))&&(t instanceof $$WPComp.Component||"function"==typeof t.Components$Component)},applySettings:function WPComp$applySettings(t,e){var i,n;if(i=function(t,e){e.Class&&-1===(" "+t.Class+" ").indexOf(e.Class)&&(t.Class+=" "+e.Class)},!(e=$$WPUtil.mergeObjects(t,e,!1,!0)).__prototypeProcessed){for(i(e,e._constructor.prototype),n=e._constructors.length-1;n>-1;n--)i(e,e._constructors[n].prototype);e.__prototypeProcessed=!0}},ComplexObjects:{},_Events:{_onoff:function(t,e){var i,n,s,o,a,r,l;for(i in l=t.__Events)if(n=l[i],Array.isArray(n))for(s=n.length-1;s>-1;s--){for(r in o=n[s].$listeningElement||t.$container,a="",n[s])"$listeningElement"!==r&&(a+=r+" ");"on"===e?o[e](a,"empty"===i?"":i,{},$$WPComp._Events._eventProcessor):o[e](a,"empty"===i?"":i,$$WPComp._Events._eventProcessor)}},on:function(t){$$WPComp._Events._onoff(t,"on")},off:function(t){$$WPComp._Events._onoff(t,"off")},_eventProcessor:function Behaviors$EventHandlers$_eventProcessor(t,e){var i,n,s,o,a,r;if("resize"!==t.type&&$$WPUtil.setActivity(),t.$target=$afe.jq(t.target),t.$target.hasClass("disabled"))t.preventDefault();else if(t.$dataId=t.$target.closest("[data-id]"),t.$dataId.hasClass("disabled"))t.preventDefault();else for(t.dataId=t.$dataId.safeAttr("data-id"),i=$$WPComp.getInstance($afe.jq(t.delegateTarget).closest("[data-component-id]").safeAttr("data-component-id"));i;){if(i.__Events){for(n=(s=i.__Events[""===t.handleObj.selector?"empty":t.handleObj.selector]).length-1;n>-1;n--){for(a=!1,r=0;r<s[n].$listeningElement.length;r++)if(s[n].$listeningElement.get(r)===t.delegateTarget){a=!0;break}if(a)break}if(-1!==n){if(!(o=s[n][t.type]))return;for(n=o.length-1;n>-1;n--)if(o[n].fun&&!1===o[n].fun.apply(o[n].context||i,[t,e]))return $$WPUtil.preventEvent(t),!1}}i=$$WPComp.getInstance(i.$container.parent().closest("[data-component-id]").safeAttr("data-component-id"))}}},__Server:{waitingFor:0}},($$WPComp=$$WP.Components).ComplexObjects.Image=function WPComp$CO$Image(t,e,i,n){this.Src=t,this.Class=e,this.Alt=i,this.Title=void 0===n?i:n},$$WPComp.ComplexObjects.Image.prototype={Src:"",Class:"",Alt:"",Title:""},$$WPComp.ComplexObjects.Button=function WPComp$CO$Button(t,e,i,n,s){this.Text=t,this.Image=e,this.Class=i,this.Identifier=n,null!==s&&(this.Title=s)},$$WPComp.ComplexObjects.Button.prototype={Text:"",Image:$$WPComp.ComplexObjects.Image.prototype,Class:"",Identifier:"",Title:""},$$WPComp.ComplexObjects.ButtonBar=function WPComp$CO$ButtonBar(t,e,i,n,s,o,a){this.Text=t,this.Image=e,this.Class=i,this.Buttons=n,this.Identifier=s,this.SupportsAriaLabel=o,this.AriaLabelID=a},$$WPComp.ComplexObjects.ButtonBar.prototype={Buttons:[],Identifier:"",Text:"",SupportsAriaLabel:!1,AriaLabelID:"",Image:$$WPComp.ComplexObjects.Image.prototype,Class:"",HasText:function WP$BB$HT(){return this.Text&&this.Text.toString()}},$$WPComp.Component=function WPComp$Component(t){var e;this.BaseObject(),$$WPComp.applySettings(t,this),this.ComponentNumber=$$WPComp.__Instances.length,$$WPComp.__Instances.push(this),this.Tag=this.Tag||"div",this.$container||(this.$container=$afe.jq(document.createElement(this.Tag))),this.$container.addClass(this.Class),this.$container.hasClass("Popup")||this.$container.hasClass("messageComponent")?(this.$container.safeAttr("data-component-id",String(this.ComponentNumber)),this.$scrollable=$afe.jq(document.createElement("div")).addClass("scrollable"),this.$content=$afe.jq(document.createElement("div")).addClass("content"),this.$scrollable.safeAppend(this.$content),this.$container.safeAppend(this.$scrollable)):(this.$container.safeAttr("data-component-id",String(this.ComponentNumber)),this.$content=$afe.jq(document.createElement("div")).addClass("content"),this.$container.safeAppend(this.$content)),this._visible=!0,(this.Components$Component$hide||this.hide).apply(this),!1===this.CommunicationsIndicator||$$WPComp.isComponent(this.CommunicationsIndicator)||("string"!=typeof this.CommunicationsIndicator&&(this.CommunicationsIndicator=$$WP.Strings.getForTemplate("GenericLoadingMessage","Global")),this.DataFromMultipleSources?(this.CommunicationsIndicator=new $$WPComp.InlineLoadingComponentWithSources({Data:{PrimaryMessage:this.CommunicationsIndicator},AreaName:this.AreaName,DataFromMultipleSources:!0}),this.CommunicationsIndicator.parentComponent=this):this.CommunicationsIndicator=new $$WPComp.InlineLoadingComponent({Data:{PrimaryMessage:this.CommunicationsIndicator}})),this.SupportAnimations&&$$WPBehav.AnimateHeights.add(this),this.LoadParameters&&(this.load(this.LoadParameters),delete this.LoadParameters),null!==this.Html&&void 0!==this.Html&&(this.html(this.Html),delete this.Html),""===this.TitleText&&(e=$$WP.Strings.getNamespace(this.StringsNamespace),this.TitleText=e.getStringForTemplate("Title")),this.addEventListener("click",this._componentClick)},$$WPComp.Component.prototype={MaintainFocus:!1,StringsNamespace:"Global",__Server:{waitingFor:0},CommunicationsIndicator:$$WP.Strings.getForTemplate("GenericLoadingMessage","Global"),_visible:!1,$parent:null,$toolbar:null,$title:null,$scrollable:null,ContainerComponent:null,ComponentNumber:Number,FocusOnClose:null,Tag:"div",Class:"component",ToolbarButtons:null,TitleText:"",TitleButtons:[],TitleImage:null,IsClosable:!1,SupressTitle:!1,AlwaysShowExpandIcon:!1,AlwaysShowViewMore:!1,ShowPocExpandIcon:!1,SupportAnimations:!1,$container:null,$content:null,_shownOnce:!1,_isDisposed:!1,_Title:null,AreaName:"",DataFromMultipleSources:!1,SupportsAriaLabel:!1,SupportsAriaDescription:!1,AriaDescriptionComponentNumber:-1,AriaLabelComponentNumber:-1,addEventListener:function WPComp$addListener(t,e,i,n,s){var o,a,r;for(this.isVisible()&&$$WPComp._Events.off(this),n=n||this.$container,s=s||"empty",this.__Events=this.__Events||{},this.__Events[s]=this.__Events[s]||[],r=(o=this.__Events[s]).length-1;r>-1&&!a;r--)if(n===o[r].$listeningElement){a=o[r];break}a||(a={$listeningElement:n},o.push(a)),a[t]=a[t]||[],a[t].push({fun:e,context:i}),this.isVisible()&&$$WPComp._Events.on(this)},removeEventListener:function WPComp$removeListener(t,e,i,n){var s,o,a,r,l;for(this.isVisible()&&$$WPComp._Events.off(this),i=i||this.$container,n=n||"empty",a=(s=this.__Events[n]).length-1;a>-1&&!o;a--)if(i===s[a].$listeningElement){o=s[a];break}if(o[t]){for(r=o[t].length-1;r>-1;r--)if(o[t][r].fun===e){o[t]=o[t].slice(r,r);break}if(0===o[t].length){for(l in delete o[t],r=-1,o)r++;0===r&&(this.__Events[n]=s.slice(a,a),0===this.__Events[n].length&&delete this.__Events[n])}}this.isVisible()&&$$WPComp._Events.on(this)},_componentClick:function WPComp$_click(t){return"viewmore"===t.dataId||t.dataId===$$WPComp.TITLEBARIDENTIFIER+"viewmore"?(this.showAllContentInPopup(),!1):t.dataId===$$WPComp.TITLEBARIDENTIFIER+"close"||t.dataId===$$WPComp.TOOLBARIDENTIFIER+"close"?(this.dispose(!0),!1):void 0},showAllContentInPopup:function WPComp$showAllContentInPopup(){var t,e,i;i=$$WP.Strings.getNamespace("Core.Component"),e=this.copy({SupportAnimations:!1}),t=new $$WPContain.Popup({Components:[e],TitleText:this._Title.HasText()||i.getStringForTemplate("ShowingAllContent"),positioningFunction:$$WPContain.Positions.InsideCentered,Size:$$WPContain.Popup.SizeEnum.LARGE}),e.$container.css("height","100%"),e.$container.css("max-height","100%"),e.$content.css("height","100%"),e.$content.css("max-height","100%"),e.show(),t.show()},hasTitle:function WPComp$hasTitle(){return!!this._Title&&(this.IsClosable||this._Title.HasText()||this._Title.Buttons&&this._Title.Buttons.length>0)},setTitle:function(t,e,i,n,s){var o,a=this._createButtonContent("library.svg#closepopup","");this.IsClosable="boolean"==typeof n?n:this.IsClosable&&null!==t,this.$container.removeClass("textlessTitle"),this._Title=new $$WPComp.ComplexObjects.ButtonBar(t,i,"titlebar",$$WPUtil.copyObject(e),$$WPComp.TITLEBARIDENTIFIER),this.$title&&this.$title.remove(),this.hasTitle()?(this.IsClosable&&!this._Title._addedCloseButton&&(this._Title.Buttons=this._Title.Buttons||[],o=$$WP.Strings.getNamespace("Core.Component").getStringForTemplate("ClosePopupAlt"),this._Title.Buttons.push(new $$WPComp.ComplexObjects.Button(a,null,"cancelworkflow","close",o)),this._Title._addedCloseButton=!0),s&&(this._Title.ExpandBtn=s),this._Title.HasText()?(this.SupportsAriaLabel=!0,this._Title.SupportsAriaLabel=!0,this._Title.AriaLabelID="popuplabel"+this.ComponentNumber):(this.$container.addClass("textlessTitle"),this._Title.Text=""),this.$title=$afe.renderTemplate($$WP.Templates.Core.ButtonBar,this._Title),this.$title.find(".button").removeClass("button"),this.$container.hasClass("Popup")||this.$container.hasClass("messageComponent")?this.$scrollable.safePrepend(this.$title):this.$container.safePrepend(this.$title)):this.$title=dangerou$.parseHtml("<div></div>"),this._titleSetOnce=!0},focus:function WPComp$focus(t){try{null===this.FocusOnClose&&(this.FocusOnClose=WP.DOM.Search.getFocused(document.body))}catch(t){}try{var e=(t?this.$content:this.$container).get(0);WP.DOM.Search.getNextFocusable(e).focus()}catch(t){}},html:function WPComp$html(t,e){if(null!=t){if(t instanceof Handlebars.SafeString)$$WP.Debug.logError("A Component's HTML should be a String. It's currently a Handlebars.SafeString. Setting the content anyway..."),t=t.toString();else if("string"!=typeof t)return void $$WP.Debug.logError("A Component's HTML must be a String. It's currently a(n) "+typeof t+".");if(-1!==t.search("<body")&&(t="<div class='errormessage'>"+$$WP.Strings.get("WidgetErrorMessage")+"</div>"),this.maintainFocus(e),$$WPUtil&&"function"==typeof $$WPUtil.removePopupListener&&$$WPUtil.removePopupListener(this.$content),dangerou$.setHtml(this.$content,$$WP.Strings.getNamespace().replaceMnemonics(t||"")),this.isVisible()){var i=$$WPUtil.getScrollTop();this.$container.trigger("resize"),$$WPUtil.setScrollTop(i),$$WP&&$$WP.Utilities&&$$WP.Utilities.UI&&(isDataTile()&&(this.$content.find(".cardlist.column_3").removeClass("column_3").addClass("column_2"),this.$content.find(".cardlist.column_4").removeClass("column_4").addClass("column_2")),this.$content.find(".cardlist").trigger("cardLoad"),this.$content.find(".navparent").length>0&&"function"==typeof $$WP.Utilities.UI.NavTabs&&$$WP.Utilities.UI.NavTabs({}))}$$WPUtil&&"function"==typeof $$WPUtil.addPopupListener&&$$WPUtil.addPopupListener(this.$content)}else $$WP.Debug.logError("Trying to set non-existant html in a component...")},maintainFocus:function setFocusLater(t){if(this.MaintainFocus&&$.contains(this.$content.get(0),document.activeElement)){if(this._previouslyFocused=document.activeElement,this._nextFocusSelect=null,document.activeElement.id)this._nextFocusSelect="#"+document.activeElement.id;else{if(!t)return void WP.DOM.Search.getPreviousFocusable(this.$container.get(0)).focus();this._nextFocusSelect=t}window.setTimeout((function(t){var e,i=$$WP.Components.getInstance(t);i._nextFocusSelect&&(e=i.$content.find(i._nextFocusSelect).get(0)),e||(e=i),e.focus()}),50,[this.ComponentNumber])}},dispose:function WPComp$dispose(t){if(!this._isDisposed){this.$container.hasClass("capped")&&$afe.select("#footer").removeClass("moving"),this.hide(),this.SupportAnimations&&$$WPBehav.AnimateHeights.remove(this),this.$container.empty(),this.$container.remove(),$$WPComp.__Instances[this.ComponentNumber]&&($$WPComp.__Instances[this.ComponentNumber]=null);for(var e=$$WPComp.__Instances;null===e[e.length-1];)e.pop();this._isDisposed=!0,this.ContainerComponent&&1===this.ContainerComponent._Components.length&&this.ContainerComponent.dispose()}},show:function WPComp$show(){var t,e;if(!0!==this._visible)if(this._isDisposed)console.error("Cannot shown disposed component number "+this.ComponentNumber);else{if($$WP.Debug.UpdateTopMarginForBanners(),this._visible=!0,this.$container.removeClass("hidden"),!this._shownOnce){if(this._titleSetOnce||this.setTitle(this.TitleText,this.TitleButtons,this.TitleImage,this.IsClosable),this.setToolbar(this.ToolbarButtons),0===(e=this.$container.parent()).length?this.$parent?this.$parent.safeAppend(this.$container):console.error("Cannot show component that has no $parent"):this.$parent=e,this.SupportAnimations&&0===this.$container.closest(".SupportsAnimations").length){for(t=this;t.ContainerComponent;)t=t.ContainerComponent;t.$container.addClass("SupportsAnimations")}this._shownOnce=!0}$$WPComp._Events.on(this),this.isVisible()&&(this.$container.trigger("resize"),this.$content.find(".cardlist").trigger("cardLoad"))}},hide:function WPComp$hide(){if(!1!==this._visible){this._visible=!1;var t=this.__containerTargetHeight||this.$container.outerHeight(!0);this.$container.addClass("hidden"),$$WPComp._Events.off(this),this.$container.parent().closest(".component").trigger("resize",{delta:-t})}},isVisible:function WPComp$isVisible(){return this._visible&&this.$container.parent().length>0},copy:function WPComp$copy(t){return new this._constructor(t)},capHeight:function WPComp$capHeight(t){if(!isNaN(t)&&this._visible){this.$content.css("height","auto"),t=Math.floor(t);var e,i,n,s,o,a,r,l=0;if(e=this.$title.contentHeight()+this.$title.heightPadding(),i=t-this.$container.heightPadding()-e,n=this.$content.contentHeight(),s=this.$container.children("a.viewmore"),o=$$WP.Strings.getNamespace(this.StringsNamespace),this._Title&&this._Title.Buttons)if(this.ShowPocExpandIcon)this._Title.ExpandBtn&&(r=!0);else for(a=0;a<this._Title.Buttons.length;a++)"viewmore"===this._Title.Buttons[a].Identifier&&(r=!0,l=a);n<=i?(this.AlwaysShowViewMore?(s.length||(s=$$WP.SimpleTemplates.Anchor({class:"viewmore noFadeContent","data-id":"viewmore",href:makeLink("")}),$$WP.Strings.setDisplayText(s,"ViewMoreLabel","Core.Component"),this.$container.safeAppend(s)),n+s.outerHeight(!0)>i&&(this.$content.css("height",n-s.outerHeight(!0)+"px"),s.removeClass("noFadeContent"))):s.length&&s.remove(),r&&!this.AlwaysShowExpandIcon?this.ShowPocExpandIcon?this.setTitle(this._Title.Text,this._Title.Buttons,this._Title.Image,this.IsClosable):this._Title&&this._Title.Buttons&&(this._Title.Buttons=this._Title.Buttons.slice(0,l),this.setTitle(this._Title.Text,this._Title.Buttons,this._Title.Image,this.IsClosable)):!r&&this.AlwaysShowExpandIcon&&this._Title&&(this._Title.Buttons=this._Title.Buttons||[],this.ShowPocExpandIcon?(this._Title.ExpandBtn=new $$WPComp.ComplexObjects.Button("",new $$WPComp.ComplexObjects.Image(makeStaticLink("images/widget_open.svg"),"",o.getStringForTemplate("ViewMoreLabel")),"viewmore","viewmore"),this.setTitle(this._Title.Text,this._Title.Buttons,this._Title.Image,this.IsClosable,this._Title.ExpandBtn)):(this._Title.Buttons.push(new $$WPComp.ComplexObjects.Button("",new $$WPComp.ComplexObjects.Image(makeStaticLink("images/widget_open.svg"),"",o.getStringForTemplate("ViewMoreLabel")),"viewmore","viewmore")),this.setTitle(this._Title.Text,this._Title.Buttons,this._Title.Image,this.IsClosable)))):(0===s.length&&(s=$$WP.SimpleTemplates.Anchor({class:"viewmore","data-id":"viewmore",href:makeLink("")}),$$WP.Strings.setDisplayText(s,"ViewMoreLabel",this.StringsNamespace),this.$container.safeAppend(s),r||this._Title&&(this._Title.Buttons=this._Title.Buttons||[],this.ShowPocExpandIcon?(this._Title.ExpandBtn=new $$WPComp.ComplexObjects.Button("",new $$WPComp.ComplexObjects.Image(makeStaticLink("images/widget_open.svg"),"",o.getStringForTemplate("ViewMoreLabel")),"viewmore","viewmore"),this.setTitle(this._Title.Text,this._Title.Buttons,this._Title.Image,this.IsClosable,this._Title.ExpandBtn)):(this._Title.Buttons.push(new $$WPComp.ComplexObjects.Button("",new $$WPComp.ComplexObjects.Image(makeStaticLink("images/widget_open.svg"),"",o.getStringForTemplate("ViewMoreLabel")),"viewmore","viewmore")),this.setTitle(this._Title.Text,this._Title.Buttons,this._Title.Image,this.IsClosable)),i-=this.$title.contentHeight()+this.$title.heightPadding()-e)),this.$content.css("height",i-s.outerHeight(!0)+"px"))}},setToolbar:function WPComp$setToolbar(t){this.$container.removeClass("notoolbar"),this.ToolbarButtons=$$WPUtil.copyObject(t),t&&t.length?(this.$toolbar&&this.$toolbar.remove(),this.$toolbar=$afe.renderTemplate($$WP.Templates.Core.ButtonBar,new $$WPComp.ComplexObjects.ButtonBar("",null,"toolbar",this.ToolbarButtons,$$WPComp.TOOLBARIDENTIFIER)),this.$container.safeAppend(this.$toolbar)):this.$container.addClass("notoolbar")},waitingForRequest:function WPComp$waitingForRequest(t){return"string"==typeof t?this.__Server[t]?this.__Server[t].waitingFor>0:0:this.__Server.waitingFor>0},makeRequest:function WPComp$makeRequest(t,e,i,n){var s,o,a;if(t.url)return e=e||"other",!1===i||$$WPComp.isComponent(i)||(null!=i&&!0!==i||(i=this.CommunicationsIndicator),!1===i||$$WPComp.isComponent(i)||("string"!=typeof i&&(i=$$WP.Strings.getForTemplate("GenericLoadingMessage","Global")),i=new $$WPComp.InlineLoadingComponent({Data:{PrimaryMessage:i}}))),$$WPComp.isComponent(i)&&i.refresh(),s={CommunicationsIndicator:i,Options:t=$$WPUtil.mergeObjects({type:"POST",data:{},dataType:"html",cache:!1},t,!1),success:t.success,failure:t.failure,callbackParam:n},t.success=this.__serverSuccess,t.error=this.__serverFailed,t.url=$$WPUtil.addUrlParameter(t.url,"ComponentNumber",this.ComponentNumber),this.__Server[e]=this.__Server[e]||{length:0,waitingFor:0},(o=this.__Server[e])[o.length]=s,t.context={ComponentNumber:this.ComponentNumber,Identifier:e,RequestNumber:o.length},++o.length,++o.waitingFor,this.__Server.waitingFor++,$$WPComp.isComponent(i)&&i.show(this.$container),$.ajax(t),$$WPComp.__Server.waitingFor++,(a=$$WP.Strings.getNamespace("Global")).addMnemonic("@MYCHART@UNLOADEDCOMPONENTS@",$$WPComp.__Server.waitingFor.toString()),$afe.select("#skiplink").text(a.getString("GlobalLoadingIndicator")),a.removeMnemonic("@MYCHART@UNLOADEDCOMPONENTS@"),t.context.RequestNumber},cancelRequest:function(t,e){if(this.__Server[t]){var i=this.__Server[t][e];if(i.canceled=!0,$$WPComp.isComponent(i.CommunicationsIndicator)){try{i.CommunicationsIndicator.hide(this.$container)}catch(t){}$$WPComp.__Server.waitingFor--}}},_createButtonContent:function(t,e){var i=$("<use></use>"),n=makeStaticImageLink(t);i.safeAttr("xlink:href",n);var s=$("<svg></svg>");return s.safeAttr("aria-hidden","true"),s.safeAttr("focusable","false"),s.addClass("btnImg"),s.safeAppend(i),new Handlebars.SafeString(s.prop("outerHTML")+e)},__serverSuccess:function WPBehave$Server$success(t){$$WPComp.getInstance(this.ComponentNumber).__serverCallback(this.Identifier,this.RequestNumber,t,"success")},__serverFailed:function WPBehave$Server$failure(t){$$WPComp.getInstance(this.ComponentNumber).__serverCallback(this.Identifier,this.RequestNumber,t,"failure")},__serverCallback:function WPBehave$Server$sharedCallback(t,e,i,n){var s,o;if(s=this.__Server[t][e],this.__Server[t].waitingFor--,this.__Server.waitingFor--,0===this.__Server[t].waitingFor?delete this.__Server[t]:delete this.__Server[t][e],!s.canceled){if($$WPComp.isComponent(s.CommunicationsIndicator))try{s.CommunicationsIndicator.hide(this.$container)}catch(t){}"function"==typeof s[n]?s[n].apply(this,[i,s.callbackParam]):console.error("Could not find appropriate callback for value returned by server.\nThe value returned was: "+i+".\t\nThe component number was: "+this.ComponentNumber+".\t\nIts container's class was: "+this.$container.get(0).className),$$WPComp.__Server.waitingFor--}o=$$WP.Strings.getNamespace("Global"),$$WPComp.__Server.waitingFor>0?(o.addMnemonic("@MYCHART@UNLOADEDCOMPONENTS@",$$WPComp.__Server.waitingFor.toString()),$afe.select("#skiplink").text(o.getString("GlobalLoadingIndicator")),o.removeMnemonic("@MYCHART@UNLOADEDCOMPONENTS@")):$afe.select("#skiplink").text(o.getString("SkipNavigationText"))},load:function WPComp$load(){console.error("Components must declare a load function")}},$$WPComp.Component.extend("BaseObject"));$afe.onDocumentReady((function SaveSkipNavText(){$$WP.Strings.add("SkipNavigationText",$afe.select("#skiplink").text(),"Global")}));