function resizeApexWindow(){var n=$(document).width(),t;n>=992?(t=n-$(".ContentContainer").width()-$(".ContentContainer").position().left,$("li.navbar-right, div.navbar-form.navbar-right").css("right",t+"px"),$("li.navbar-right a").css("padding-right","0")):$("li.navbar-right").css("right","auto")}function sizeIntenseDebateFrame(){try{$("#iframeDebate").AutoSizeIFrame();$("#iframeDebate").off("mouseover");$("#iframeDebate").on("mouseover",function(){$(this).contents().find(".idc-r").unbind("click").bind("click",function(){$("#iframeDebate").AutoSizeIFrame({offset:200})});$(this).contents().find("#IDCPostNav, #IDCColumnEmailLabel, #IDCColumnEmailReply, #IDCommentsHeadLogin").hide()})}catch(n){}return!1}function onPageLoad(){microsoft.applications.telemetry.LogManager.initialize(_defaultAriaTenantId);defaultApexLogger=new microsoft.applications.telemetry.Logger}function onPageFocusChange(n){OneDSAnalytics.capturePageAction(null,{actionType:"O",contentTags:{event:"page-focus-changed",value:n.type}})}var lpMTagConfig,defaultApexLogger,ApexMainViewModel,apexMainViewModel,clienttelemetry_build,Microsoft,sct,microsoft;OneDSAnalytics={captureContentUpdate:function(n,t){window.analytics&&window.analytics.captureContentUpdate&&window.analytics.captureContentUpdate(n,t)},capturePageAction:function(n,t,i){if(window.analytics&&window.analytics.capturePageAction){var r=n;n&&n.length&&null==n.attributes&&(r=n[0]);window.analytics.capturePageAction(r,t,i)}},capturePageView:function(n,t){window.analytics&&window.analytics.capturePageView&&window.analytics.capturePageView(n,t)},capturePageUnload:function(n,t){window.analytics&&window.analytics.capturePageUnload&&window.analytics.capturePageUnload(n,t);OneDSAnalytics.capturePageAction(null,{actionType:"O",contentTags:{event:"unload"}})},update1DSMetaTag:function(){$('meta[name="oneds-pageUri"]').attr("content",document.location.href)},generateGuid:function(){function n(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return`${n()}${n()}-${n()}-${n()}-${n()}-${n()}${n()}${n()}`},getLastPageViewId:function(){return pageViewId="",window.analytics&&window.analytics.getWebAnalyticsExtension&&(webAnalyticsExtension=window.analytics.getWebAnalyticsExtension(),webAnalyticsExtension&&webAnalyticsExtension.id&&(pageViewId=webAnalyticsExtension.id.getLastPageViewId())),pageViewId}};ApexVideoHandler=function(){var n=!1,t=function(){$.each($(".apexEmbedPlayer iframe"),function(n,t){$(t)[0].contentWindow.postMessage('{"event":"command","func":"pauseVideo","args":""}',"*")})},i=function(){0!=n&&($(".abOverlayBox").css({display:"block",left:($(window).width()-$(".abOverlayBox").width())/2,top:($(window).height()-$(".abOverlayBox").height())/2-20+$(this).scrollTop(),position:"absolute","z-index":"2002"}),$(".abOverlayBgCover").css({display:"block",width:$(document).width(),height:$(document).height(),"z-index":"2001"}))},r=function(t){var r,e;n=!0;r=u()+145;e='<iframe id="iframeVideo" name="iframeVideo" scrolling="no" src="" width="'+(f()+50)+'"px" height="'+r+'"px" frameborder="0" style="margin-bottom: 8px;"><\/iframe>';0===$("#iframeVideo").length&&$(e).appendTo("#abOverlayVideo");$("body").width()<550?$(".abOverlayBox").css({width:360,height:310,left:5}):$(".abOverlayBox").css({width:605,height:470});window.top.$("#iframeVideo").css("visibility","visible");window.top.$("#iframeVideo").attr("src",t);i();$(".abOverlayBgCover").css({opacity:0}).animate({opacity:.6,backgroundColor:"#000"});var o=navigator.userAgent.toLowerCase(),s=o.indexOf("chrome")>-1,h=o.indexOf("safari")>-1;return(s||h)&&$("#abOverlayVideo").css("margin-top","10px"),$("span#abOverlayClose").focus(),!1},u=function(){var n=325;return $("body").width()<550&&(n=155),n},f=function(){var n=550;return $("body").width()<550&&(n=300),n},e=function(n){var s,h;$("span#abOverlayClose").data("element",n.target);var t=$(n.target).attr("videoId"),i=$(n.target).attr("op_videoId"),e=$(n.target).attr("project"),o=$(n.target).attr("language"),c=u(),l=f();return void 0===t&&(t=$(n.target).parent().attr("videoId"),i=$(n.target).parent().attr("op_videoId")),s="&random="+(new Date).getTime()+Math.floor(1e6*Math.random()),window.location.origin||(window.location.origin=window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:"")),null==e&&(e=apexMainViewModel.projectFolder()),null==o&&(o=apexMainViewModel.language()),h=window.location.origin+"/resources/neutral/ApexOnePlayerVideoHandler.htm?uuid="+t+"&opid="+i+"&prd="+e+"&mkt="+o+"&w="+l+"&h="+c+s,null!=i&&""!=i&&"OnePlayerIDValue"!=i||(h=window.location.origin+"/resources/neutral/ApexYoutubeVideoHandler.htm?uuid="+t+"&w="+l+"&h="+c+s),r(h,n.target),null==apexMainViewModel.projectFolder()&&null==apexMainViewModel.projectFolder()||ApexInstrumentHandler.LogAria("Browser",apexMainViewModel.projectFolder(),apexMainViewModel.language(),t,"","","Video",""),!1};return{DoOverlayOpen:r,DoOverlayClose:function(){"_popup_video_"==$("#railHelpInputs").attr("query")&&window.close();n=!1;$(".abOverlayBox").css("display","none");$(".abOverlayBgCover").animate({opacity:0},null,null,function(){$(this).hide()});window.top.$("#iframeVideo").css("visibility","hidden");window.top.$("#iframeVideo").attr("src","");var t=$("span#abOverlayClose").data("element");$(t).focus();$("span#abOverlayClose").data("element","")},ShowOverlay:function(){i()},ShowVideo:function(n){return e(n)},PauseEmbedVideos:t,InitEmbedVideos:function(){if(0==$(".apexEmbedPlayer").length)return!1;$(".apexEmbedPlayer iframe").attr("src","");$(".apexEmbedPlayer").on("click",function(n){var i=n.target,r=$(i).attr("op_videoId"),u,f,e;null==r||""==r||"OnePlayerIDValue"==r?(t(),u=$(i).attr("videoId"),f=($(i).attr("width"),$(i).attr("height"),"//www.youtube.com/embed/"+u+"?rel=0&amp;modestbranding=1&amp;showinfo=1&amp;controls=1&amp;autoplay=1&amp;enablejsapi=1&amp;version=3&amp;playerapiid=ytplayer"),$(i).html('<iframe src=""><\/iframe>'),$(i.children).attr({src:f,width:"100%",height:"100%"}),$(i).off("click")):(u=r,$(i).attr("width"),$(i).attr("height"),e=$(i).attr("id"),$(i.children).attr({width:"100%",height:"100%"}),function(n,t){var i={options:{autoplay:!0,mute:!1,loop:!1,market:"en-us",playFullScreen:!1},metadata:{videoId:n}};MsOnePlayer.render(t,i,function(n){n.addPlayerEventListener(function(n){console.log("player event: "+JSON.stringify(n))})})}(u,e),$(i).off("click"))});$(".apexEmbedPlayer").on("keypress",function(n){var t=n.target,i="#"+$(t).attr("id");if(13==n.which)return $(i).click(),!1})},Init:function(){$(".abLaunchVideo").off("click");$(".abLaunchVideo").on("click",function(n){return e(n)});$("div.apexContentTile span.abLaunchVideo, #abOverlayClose").off("keypress");$("div.apexContentTile span.abLaunchVideo, #abOverlayClose").on("keypress",function(n){13===n.which&&$(n.target).trigger("click")});$("a#abOverlayClose, span#abOverlayClose").off("click");$("a#abOverlayClose, span#abOverlayClose").on("click",function(){ApexVideoHandler.DoOverlayClose()});$("#abOverlayClose").off("click");$("#abOverlayClose").on("click",function(){ApexVideoHandler.DoOverlayClose()})}}}();ApexButtonHandler={Init:function(){return $("#railContent div.apexButtonLink.uberProduct").off("click"),$("#railContent div.apexButtonLink.uberProduct").on("click",function(n){var t,r,u,i,f;return(n.preventDefault&&n.preventDefault(),n.stopPropagation&&n.stopPropagation(),t=$(n.target).closest(".uberProduct"),r=$(t).attr("secretkey"),null==r)?!1:(u=$(t).attr("project"),i=$(t).attr("language"),null!=i&&i==apexMainViewModel.language()||(i=apexMainViewModel.language()),OneDSAnalytics.capturePageAction(t,{actionType:"CL",contentTags:{contentId:"apexButtonLink",contentName:r}}),OneDSAnalytics.capturePageUnload(),f="apex/"+u+"/"+i+"/"+r,document.location.hash=f,!1)}),$("#railContent div.apexButtonLink.uberResource").off("click"),$("#railContent div.apexButtonLink.uberResource").on("click",function(n){var i,r,f,u,e,t;return(n.preventDefault&&n.preventDefault(),n.stopPropagation&&n.stopPropagation(),n.preventDefault&&n.preventDefault(),n.stopPropagation&&n.stopPropagation(),i=$(n.target).closest(".uberResource"),r=$(i).attr("secretkey"),null==r)?!1:(f=r.split(":"),2==f.length?(u="https://go.microsoft.com/fwlink/?linkid="+f[1],window.open(u,"_uberResourceWindow")):(e=$(i).attr("project"),t=$(i).attr("language"),null!=t&&t==apexMainViewModel.language()||(t=apexMainViewModel.language()),u="apex/"+e+"/"+t+"/"+r,document.location.hash=u),!1)}),!1}};ApexTabHandler={Init:function(){if($("#railContent div.apexTab").length<=0)return!1;$("#railContent button.apexTabLink").off("click");$("#railContent button.apexTabLink").on("click",function(n){var t,i,r;n.preventDefault&&n.preventDefault();n.stopPropagation&&n.stopPropagation();ApexVideoHandler.PauseEmbedVideos();t=$(n.target).closest('button[class^="apexTabLink"]');$(t).siblings().removeClass("active");$(t).siblings().removeAttr("aria-current");$(t).addClass("active");$(t).attr("aria-current","tab");i=$(t).attr("tabcontentid");$(t).parent().siblings().hide();$(t).parent().siblings("#"+i).show();r=$(t).attr("tabid");OneDSAnalytics.capturePageAction($(t),{actionType:"CL",contentTags:{contentId:"Tab",contentName:r}})});var n=!1;return $("#railContent button.apexTabLink").each(function(){if($(this).hasClass("active")){var t=$(this).attr("tabcontentid");$("#railContent div.apexTab #"+t).show();n=!0}$(this).attr("data-bi-mto","")}),0==n&&($("#railContent button.apexTabLink")[0].addClass("active"),$("#railContent button.apexTabLink")[0].attr("aria-current","tab"),$("#railContent div.apexTabContent")[0].show()),!1}};ApexFeedbackHandler=function(){var n="Sorry about that",t="Thanks for the feedback!",r=function(){$("#apex-topic-feedback div:first").hasClass("mid")&&$("#apex-topic-feedback div:first").hasClass("end")||$("#apex-topic-feedback div:first").removeClass("begin").addClass("mid");$("#apex-feedback-title").html(n)},i=function(n,i,r,u,f,e,o,s){$("#apex-topic-feedback div:first").hasClass("end")||$("#apex-topic-feedback div:first").removeClass("begin").removeClass("mid").addClass("end");$("#apex-feedback-title").html(t);ApexInstrumentHandler.Feedback(n,i,r,u,f,e,o,s)};return{BindEvents:function(){$("#apex-feedback-yes").off("click");$("#apex-feedback-yes").on("click",function(){i("brwoser",apexMainViewModel.projectFolder(),apexMainViewModel.language(),apexMainViewModel.query(),"YES","NONE",apexMainViewModel.topicFileName(),"full-browser")});$("#apex-feedback-no").off("click");$("#apex-feedback-no").on("click",function(){r();$("#apex-feedback-answer-text").focus()});$("#apex-feedback-answer-button").off("click");$("#apex-feedback-answer-button").on("click",function(){i("brwoser",apexMainViewModel.projectFolder(),apexMainViewModel.language(),apexMainViewModel.query(),"NO",$.trim($("#apex-feedback-answer-text").val()),apexMainViewModel.topicFileName(),"full-browser")})},FeedbackHtml:function(){return'<div id="apex-topic-feedback" aria-live="assertive">\t<div class="begin">\t\t<div id="apex-feedback-title">Was this helpful?<\/div>\t\t<div id="apex-feedback-question">How can we improve it?<\/div>\t\t<div class="apex-feedback-button">\t\t\t<button id="apex-feedback-yes" title="yes" aria-labelledby="apex-feedback-title" type="button">Yes<\/button><button id="apex-feedback-no" title="no" aria-labelledby="apex-feedback-title" type="button">No<\/button>\t\t<\/div>\t\t<div class="apex-feedback-answer">\t\t\t<textarea id="apex-feedback-answer-text" aria-label="How can we improve it?" name="article_feedback_comment"><\/textarea>\t\t\t<button id="apex-feedback-answer-button" type="button">Submit<\/button>        <\/div > \t<\/div><\/div>'},UpdateLocStrings:function(i){try{if(null==i||null==i)return!1;void 0!==i.Submit&&$("#apex-feedback-answer-button").html(i.Submit);void 0!==i.Helpful&&$("#apex-feedback-title").html(i.Helpful);void 0!==i.Improve&&$("#apex-feedback-question").html(i.Improve);void 0!==i.Yes&&$("#apex-feedback-yes").html(i.Yes);void 0!==i.No&&$("#apex-feedback-no").html(i.No);void 0!==i.Sorry&&(n=i.Sorry);void 0!==i.Thanks&&(t=i.Thanks)}catch(n){}}}}();ApexInstrumentHandler={LogAria:function(n,t,i,r,u,f,e,o){r=null==r||""===r?"NONE":r;u=null==u||""===u?"NONE":u;f=null==f||""===f?"NONE":f.toString();e=null==e||""===e?"NONE":e;o=null==o||""===o?"NONE":o;defaultApexLogger.logEvent({name:"Help",properties:[{key:"Button_Clicked",value:"SendEvents"},{key:"Source",value:n},{key:"Project",value:t},{key:"Language",value:i},{key:"Filename",value:u},{key:"Row",value:f},{key:"Query",value:r},{key:"View",value:o},{key:"LogType",value:e},{key:"IsMobileDevice",value:_isMobileDevice},{key:"MobileDeviceModel",value:_mobileDeviceModel},{key:"MobileDeviceManufacturer",value:_mobileDeviceManufacturer},{key:"BrowserPlatform",value:_browserPlatform},{key:"BrowserName",value:_browserName},{key:"BrowswerVersion",value:_browswerVersion},{key:"UrlReferrer",value:_urlReferrer}]})},Feedback:function(n,t,i,r,u,f,e,o){r=null==r||""===r?"NONE":r;u=null==u||""===u?"NONE":u;f=null==f||""===f?"NONE":f;e=null==e||""===e?"NONE":e;o=null==o||""===o?"NONE":o;defaultApexLogger.logEvent({name:"feedback",properties:[{key:"Button_Clicked",value:"SendEvents"},{key:"Source",value:n},{key:"Project",value:t},{key:"Language",value:i},{key:"Filename",value:e},{key:"Answer",value:u},{key:"answerText",value:f},{key:"Query",value:r},{key:"View",value:o},{key:"IsMobileDevice",value:_isMobileDevice},{key:"MobileDeviceModel",value:_mobileDeviceModel},{key:"MobileDeviceManufacturer",value:_mobileDeviceManufacturer},{key:"BrowserPlatform",value:_browserPlatform},{key:"BrowserName",value:_browserName},{key:"BrowswerVersion",value:_browswerVersion},{key:"UrlReferrer",value:_urlReferrer}]})}};ApexCookieBannerHandler=function(){return{OnConsentChanged:function(){var n,i,r,f,t,u;siteConsent.getConsentFor(WcpConsent.consentCategories.Analytics)?(n=window,i=document,r="script",f="ga",n.GoogleAnalyticsObject=f,n.ga=n.ga||function(){(n.ga.q=n.ga.q||[]).push(arguments)},n.ga.l=1*new Date,t=i.createElement(r),u=i.getElementsByTagName(r)[0],t.async=1,t.src="https://www.google-analytics.com/analytics.js",u.parentNode.insertBefore(t,u),ga("create","UA-87760037-1","auto"),ga("send","pageview")):siteConsent.getConsentFor(WcpConsent.consentCategories.Analytics)||(document.cookie="_ga= ; expires = Thu, 01 Jan 1970 00:00:00 GMT",document.cookie="_gat= ; expires = Thu, 01 Jan 1970 00:00:00 GMT",document.cookie="_gid= ; expires = Thu, 01 Jan 1970 00:00:00 GMT");$("body").css("padding-top","");$("#apexbody .header").css("margin-top","")},ManageConsent:function(){siteConsent.isConsentRequired&&siteConsent.manageConsent()}}}(),function(n){n.fn.exists=function(){return 0!==this.length};n.fn.ExpanderList=function(t){var i=n(this);i.addClass("expando-list");i.children().each(function(){n(this).Expander(t)})};n.fn.Expander=function(t){var e=n.extend({},n.fn.Expander.defaults,t),r=n(this),i,u,f;r.addClass("expando");i=r.children().first();u=i.next();i.addClass("expando-head").attr("aria-expanded","false").attr("data-bi-mto","");i.wrapInner('<span class="head">');f="true"==r.attr("expanded");u.addClass("expando-body").attr("role","region");f&&0==r.prevAll(".expando").children(".expando-head-active").length?(i.addClass("expando-head-active").attr("aria-expanded","true"),u.addClass("expando-body-active")):(i.attr("aria-expanded","false"),u.hide());i.bind("mouseenter.expander",function(){n(this).addClass("expando-hover")});i.bind("mouseleave.expander",function(){n(this).removeClass("expando-hover")});i.bind("click",function(t){var r;t.preventDefault&&t.preventDefault();var i=n(this),u=n(this).next(),f=!1;null!=typeof s||null!=s||s;i.hasClass("expando-head-active")&&(f=!0);r=i.parents(".expando-list");r.exists()||(r=i.parents(".expando"));e.Multiple?f&&(u.slideUp(500),u.removeClass("expando-body-active").addClass("expando-body"),i.removeClass("expando-head-active").attr("aria-expanded","false")):(r.find(".expando-body-active").slideUp(500),r.find(".expando-body-active").removeClass("expando-body-active").addClass("expando-body"),r.find(".expando-head-active").removeClass("expando-head-active").attr("aria-expanded","false"));f||(i.addClass("expando-head-active").attr("aria-expanded","true"),u.addClass("expando-body-active"),u.slideDown(500));OneDSAnalytics.capturePageAction(this,{actionType:"CL",contentTags:{contentId:"Expander",contentName:i.text(),isExpanded:i.attr("aria-expanded")}})})};n.fn.ApexDropDown=function(){n(".apex_dropdown_content").hide();0!=n(".apex_dropdown_list_master").length?(n(".apex_dropdown_list_child").hide(),n(".apex_dropdown .apex_dropdown_list_master option[selected]").each(function(t,i){var r="#"+n(i).parent().parent().attr("id"),u=n(r+" .apex_dropdown_list_master option[selected]").attr("ddid"),f;null!=u&&(n(r+" .apex_dropdown_list_child").hide(),n(r+" .apex_dropdown_list_child[ddid="+u+"]").show(),n(r+" .apex_dropdown_content div[ddid]").hide(),n(r+" .apex_dropdown_content").show(),n(r+" .apex_dropdown_list_child[ddid="+u+"] option[selected]").attr("ddid"))&&(f=r+' .apex_dropdown_content div[ddid="'+n(r+" .apex_dropdown_list_child[ddid="+u+"] option[selected]").attr("ddid")+'"]',n(r+" .apex_dropdown_content").hide(),n(f).show(),n(n(f).parent()).show())}),n(".apex_dropdown .apex_dropdown_list_master").bind("change",function(t){var i="#"+n(t.target).parent().attr("id"),r=n(t.target.options[t.target.selectedIndex]).attr("ddid"),u,f;(n(i+" .apex_dropdown_list_child").hide(),n(i+" .apex_dropdown_list_child[ddid="+r+"]").show(),n(i+" .apex_dropdown_content div[ddid]").hide(),n(i+" .apex_dropdown_content").show(),n(i+" .apex_dropdown_list_child[ddid="+r+"] option:selected").attr("ddid"))&&(u=i+' .apex_dropdown_content div[ddid="'+n(i+" .apex_dropdown_list_child[ddid="+r+"] option:selected").attr("ddid")+'"]',n(i+" .apex_dropdown_content").hide(),n(u).show(),n(n(u).parent()).show());f=n(t.target).prevAll(".apex_dropdown_label").first().attr("value");OneDSAnalytics.capturePageAction(this,{actionType:"CL",contentTags:{contentId:"Dropdown",contentLabel:f,contentName:r}})}),n(".apex_dropdown .apex_dropdown_list_child").bind("change",function(t){var i="#"+n(t.target).parent().attr("id"),r=n(t.target.options[t.target.selectedIndex]).attr("ddid"),u,f;(n(i+" .apex_dropdown_content div[ddid]").hide(),n(i+" .apex_dropdown_content").show(),n(i+' .apex_dropdown_content div[ddid="'+r+'"]'))&&(u=i+' .apex_dropdown_content div[ddid="'+r+'"]',n(i+" .apex_dropdown_content").hide(),n(u).show(),n(n(u).parent()).show());f=n(t.target).prevAll(".apex_dropdown_label").first().attr("value");OneDSAnalytics.capturePageAction(this,{actionType:"CL",contentTags:{contentId:"Dropdown",contentLabel:f,contentName:r}})})):(n(".apex_dropdown .apex_dropdown_list option[selected]").each(function(t,i){var r="#"+n(i).parent().parent().attr("id"),u=n(r+" .apex_dropdown_list option[selected]").attr("ddid");null!=u&&(n(r+" .apex_dropdown_content div[ddid]").hide(),n(r+" .apex_dropdown_content").show(),n(r+' .apex_dropdown_content div[ddid="'+u+'"]').show())}),n(".apex_dropdown .apex_dropdown_list").bind("change",function(t){var i="#"+n(t.target).parent().attr("id"),r,u;n(i+" .apex_dropdown_content div[ddid]").hide();n(i+" .apex_dropdown_content").show();r=i+' .apex_dropdown_content div[ddid="'+n(t.target.options[t.target.selectedIndex]).attr("ddid")+'"]';n(r).show();u=n(t.target).prevAll(".apex_dropdown_label").first().attr("value");OneDSAnalytics.capturePageAction(this,{actionType:"CL",contentTags:{contentId:"Dropdown",contentLabel:u,contentName:defaultDD}})}))};n.fn.ExpanderList.defaults={Multiple:"false"}}(jQuery);ApexMainViewModel=function(){var n=this,i=-1,t=1;n.projectId=ko.observable();n.project=ko.observable();n.projectFolder=ko.observable();n.projectTitle=ko.observable();n.projectTheme=ko.observable();n.language=ko.observable();n.query=ko.observable();n.topicFileName=ko.observable();n.currentNavId=ko.observable();n.currentSubNavId=ko.observable();n.theme=ko.observable();n.errorTopic=ko.observable();n.customSearchClass=ko.observable();n.navItems=ko.observable();n.navItemsData=ko.observable();n.chosenNavId=ko.observable();n.topicData=ko.observable();n.topicFeedback=ko.observable();n.searchTopicsStack=ko.observableArray([[]]);n.searchTopics=ko.observableArray([]);n.searchTopicsHistory=ko.observableArray([]);n.continuationToken=ko.observable();n.searchVideos=ko.observableArray([]);n.termToSearch=ko.observable("");n.showSearchPanel=ko.observable(!1);n.showMoreVideo=ko.observable(!1);n.showVideoPanel=ko.observable(!1);n.clickableHeader=ko.observable(!1);n.showRelatedTopicsRight=ko.observable(!1);n.currentSupportMarket=ko.observable();n.locStrings=ko.observable();n.showNavGroupPanel=ko.observable(!1);n.showNavPanel=ko.observable(!1);n.showViewMoreButton=ko.observable(!1);n.showRelatedTopicsPanel=ko.observable(!1);n.showRightRail=ko.observable(null);n.showRelatedVideosPanel=ko.observable(!1);n.showRelatedSupportPanel=ko.observable(!1);n.relatedTopicsTitle=ko.observable("");n.relatedVideosTitle=ko.observable("");n.relatedSupportPanel=ko.observable("");n.navGroupsItem=ko.observable();n.relatedTopicsItem=ko.observable();n.relatedVideosItem=ko.observable();n.relatedVideosItem=ko.observable();n.newToProductUrl=ko.observable();n.videoDirectoryUrl=ko.observable();n.scriptVersion=ko.observable();n.coreCSSUrl=ko.observable();n.defaultUrl=ko.observable();n.defaultTopicId=ko.observable();n.projectAlias=ko.observable();n.showExternalInfoLabel=ko.observable(!1);n.anchor=ko.observable();n.nav=ko.observable();n.breadcrumbItem=ko.observable();n.showBreadcrumbItem=ko.observable();n.setViewMoreCount=function(n){var i=window.location.href,r={result:$(window).scrollTop()+"~"+t,data:n};localStorage.setItem(i,JSON.stringify(r))};n.populateUILabels=function(t){var i,r,u,f,e,o;if(null!=t&&null!=t){i=t.LocStrings.Search;r=n.projectFolder().toLowerCase()+"_Search";void 0!==t.LocStrings[r]&&(i=t.LocStrings[r]);$("#searchquery").attr("placeholder",i);try{(0!=t.LocStrings.ExternalInfoHead.length&&n.showExternalInfoLabel()?$("#externalInfoHead, #externalInfoSearchHead").html(t.LocStrings.ExternalInfoHead):$("#externalInfoHead, #externalInfoSearchHead").hide(),0!=t.LocStrings.ExternalInfoFooter.length&&n.showExternalInfoLabel()?$("#externalInfoFooter, #externalInfoSearchFooter").html(t.LocStrings.ExternalInfoFooter):$("#externalInfoFooter, #externalInfoSearchFooter").hide(),0!=t.LocStrings.SearchResultsFor.length)?(u=encodeURIComponent($("#searchquery").val()),$("#searchHeading").text(t.LocStrings.SearchResultsFor+" "+decodeURIComponent(u))):$("#searchHeading").hide()}catch(t){$("#externalInfoHead, #externalInfoSearchHead, #searchHeading").hide();$("#externalInfoFooter, #externalInfoSearchFooter").hide()}(null!=t.LocStrings.Video1&&$("#VideoLabel").html(t.LocStrings.Video1),null!=t.LocStrings.SeeMoreVideo&&$("#more-videos").html(t.LocStrings.SeeMoreVideo),0!=t.Footer.Support.Name.length&&$("#supportLabel").html(t.Footer.Support.Name),0!=t.Footer.Support.Url.length?$("#supportLabel").attr("href",t.Footer.Support.Url):$("#supportLabel").hide(),0!=t.Footer.Privacy.Url.length?($("#privacyLabel").html(t.Footer.Privacy.Name),$("#privacyLabel").attr("href",t.Footer.Privacy.Url)):$("#privacyLabel").hide(),0!=t.Footer.Legal.Url.length?($("#lagalLabel").html(t.Footer.Legal.Name),$("#lagalLabel").attr("href",t.Footer.Legal.Url)):$("#lagalLabel").hide(),0!=t.Footer.Trademarks.Url.length?($("#tradeMarkLabel").html(t.Footer.Trademarks.Name),$("#tradeMarkLabel").attr("href",t.Footer.Trademarks.Url)):$("#tradeMarkLabel").hide(),0!=t.Footer.BingYahooId.Name.length&&$("#bingYahooLabel").html(t.Footer.BingYahooId.Name),0!=t.Footer.BingYahooId.Url.length)?(f=null==n.currentSupportMarket()?"en-us":n.currentSupportMarket(),e="/#Apex/"+n.projectAlias()+"/"+n.language()+"/"+t.Footer.BingYahooId.Url+"/"+f,$("#bingYahooLabel").attr("href",e)):$("#bingYahooLabel").hide();null!=t.HeaderNavItems&&(o=t.HeaderNavItems.length,0==t.HeaderNavItems[o-1].SupportOption.URL.length?$(".supportApex").hide():$(".supportApex").show())}};n.loadMoreSearchTopics=function(i){var r,u,f,e;null!=i&&null!=i&&(r=i.continuationToken(),i.searchTopicsStack().length>0?(u=i.searchTopicsStack().pop(),f=i.searchTopics().concat(u),i.searchTopics(f),t++,n.setViewMoreCount(JSON.parse(n.searchTopicsHistory())),e=r||i.searchTopicsStack().length>0,n.showViewMoreButton(e)):i.continuationToken()&&(n.showViewMoreButton(!0),n.sendApexTokenRequest(i.project(),i.language(),i.query(),r)))};n.onEnterKeyForSearch=function(n,t){if(13===t.which)return t.target.click(),!1};n.setScrollPositionForHistory=function(){var i=1,r=window.location.href,n;try{var f=(n=JSON.parse(localStorage.getItem(r))).data,u=n.result,t=u.split("~");2==t.length&&(scrollTop=t[0],i=parseInt(t[1]));n={result:u=$(this).scrollTop()+"~"+i,data:f};localStorage.setItem(r,JSON.stringify(n))}catch(i){}};n.getToContent=function(t){$("#apex_search input#searchquery").val("");n.setScrollPositionForHistory();ApexInstrumentHandler.LogAria("Browser",n.projectFolder(),n.language(),t.SecretKey,t.Filename,t.Row,"Result","");document.location.hash=t.Href.replace("/#","");n.getWindowsOrigin()&&(window.location.href=window.location.origin+"/"+window.location.hash)};n.onEnterKeyForVideo=function(t,i){"more-videos"==i.target.id?($("#railContent .VideoRow.hide").each(function(n,t){return $(t).removeClass("hide").addClass("show"),!(n>=2)}),0==$("#railContent .VideoRow.hide").length&&$(".more-videos").hide()):n.getToVideo(t,i)};n.getToVideo=function(n,t){$(".abOverlayClose").focus();ApexVideoHandler.ShowVideo(t);$("#abOverlayClose").off("click");$("#abOverlayClose").on("click",function(){ApexVideoHandler.DoOverlayClose()})};n.getToLogData=function(t,i){var u=$(i.target.parentElement).attr("row"),r="";switch(u){case"400":r="NewToBingAds - Link";break;case"600":r="Forum - Link";break;case"700":r="Sign-In - Link";break;case"701":r="Sign-Up - Link";break;case"800":r="All Video Library - Link"}return""!=r&&ApexInstrumentHandler.LogAria(n.projectFolder(),n.projectFolder(),n.language(),r,"",u,"Page"),!0};n.setNavItem=function(n,t){var i,r;$("ul.apex-menu > li:visible").removeClass("active").removeAttr("aria-current");$("ul.apex-menu > li.dropdown").removeClass("active").removeAttr("aria-current");$("ul.apex-menu > li.dropdown > ul.dropdown-menu > li").removeClass("active").removeAttr("aria-current");try{i=$("ul.apex-menu > li:visible")[n];$(i).addClass("active").attr("aria-current","true");$("ul.apex-menu > li.active .active").removeClass("active");r=$("ul.apex-menu > li.active li")[t];$(r).addClass("active").attr("aria-current","true")}catch(n){}};n.goToNavItem=function(t,i){var r,u;if(null==t.URL){$(i.target.parentElement).addClass("active").siblings().removeClass("active");r=t.SecretKey;try{r=r.match(/ext(\d*)/)[1]}catch(t){}document.location.hash="apex/"+n.projectAlias()+"/"+n.language()+"/"+r+"/"+t.SortOrder}else $(i.target.parentElement).removeClass("active"),u=document.location.hash,window.open(t.URL),document.location.hash=u;n.getWindowsOrigin()&&(window.location.href=window.location.origin+"/"+window.location.hash)};n.goToSubNavItem=function(t,i){$(i.target).parent().parent().parent().addClass("active").siblings().removeClass("active");var r=t.SecretKey;try{r=r.match(/ext(\d*)/)[1]}catch(t){}OneDSAnalytics.capturePageAction($(i.target),{actionType:"CL",contentTags:{contentId:"Menu",contentName:r}});OneDSAnalytics.capturePageUnload();document.location.hash="apex/"+n.projectAlias()+"/"+n.language()+"/"+r+"/"+t.SortOrder;n.getWindowsOrigin()&&(window.location.href=window.location.origin+"/"+window.location.hash)};n.windowsOrigin=function(){return window.location.origin||(window.location.origin=window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:"")),window.location.origin};n.setProjectTheme=function(t,i){var r,u,f,e,o;try{r=n.projectTheme().toLowerCase();(1==$("#apex-link-css-id").length&&$("#apex-link-css-id").remove(),"metro"!=r)&&(u=n.windowsOrigin()+"/Resources/content/styles/apex."+r+".css",f=$("<link id='apex-link-css-id' rel='stylesheet' type='text/css' href='"+u+"'>"),$("head").append(f));null!=i&&null!=i||(i="main");e="apex-"+i+"-img";o="apex-"+t+"-img";$("a.navbar-brand").removeClass(e.toLowerCase());$("a.navbar-brand").addClass(o.toLowerCase())}catch(t){}};n.searchTerm=function(){var i,r;if(n.termToSearch($("input#searchquery").val()),""==n.termToSearch())return!1;OneDSAnalytics.capturePageAction($("input#searchquery"),{contentTags:{contentId:"SearchForm",contentName:n.termToSearch(),srchtype:"searchbox"}});i=n.termToSearch()+"";$("ul.ui-autocomplete").is(":visible")&&$("#apex_search input#searchquery").autocomplete("close");$(".apex-menu .active").removeClass("active");n.projectFolder();n.language();ApexInstrumentHandler.LogAria("Browser",n.projectFolder(),n.language(),n.termToSearch(),"","","Search","");i=encodeURIComponent(i);OneDSAnalytics.capturePageUnload();r=window.location.hash;document.location.hash="apex/"+n.projectAlias()+"/"+n.language()+"/"+i;n.getWindowsOrigin()&&(window.location.href=window.location.origin+"/"+window.location.hash);r!=window.location.href&&(t=1)};n.clearTerm=function(t,i){i.preventDefault&&i.preventDefault();i.stopPropagation&&i.stopPropagation();$("ul.ui-autocomplete").is(":visible")&&$("#apex_search input#searchquery").autocomplete("close");n.termToSearch("")};n.getToAnchor=function(n){var t=$("html").find(n),i;t.length>0&&(t.hasClass("expando-head")&&(t.hasClass("expando-head-active")||$(t).trigger("click")),i=t.offset().top-$(".head2").height()-80,$("html, body").stop().animate({scrollTop:i},1e3))};n.getNoEchoWizard=function(){var n=null;return $("#railContent .secret_keywords, #railContent .keywords").each(function(){var t=/ab_noID+/g.exec($(this).html());null!==t&&t.length>0&&(n=t[0])}),n};n.getWindowsOrigin=function(){return 1==$("#apexQueryParams").length&&(window.location.origin||(window.location.origin=window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:"")),!0)};n.attachCommentsService=function(){};n.displayLoadingDialog=function(){$("#railContent").empty();var n='<div style="position:absolute; top:40%; height:10em; left:40%" ><p><img src="'+ab_glb.CDNEndPoint+'/resources/rightrail/images/busy.gif?v=1.0" alt="content" width="25px" height="25px" style="vertical-align:middle"/>&nbsp;&nbsp;loading<\/p><\/div><\/body>';$("#railContent").html(n)};n.hideLoadingDialog=function(){$("#railContent").hide()};n.sendApexTokenRequest=function(i,r,u,f){var e;e={token:JSON.stringify(f),project:i,language:r,query:u};$.ajax({url:"/api/ContinuationToken",type:"GET",data:e,cache:!0,success:function(i){var r,u,f,e,o;null==i.Content&&null!==i.Topics&&i.Topics.length>0&&(r=JSON.parse(n.searchTopicsHistory()).concat(i.TopicsHistory),n.searchTopicsHistory(JSON.stringify(r)),u=n.searchTopics(),i.Topics.reverse(),f=i.Topics.pop(),e=u.concat(f),n.searchTopics(e),n.searchTopicsStack(i.Topics),n.continuationToken(i.ContinuationToken),t++,n.setViewMoreCount(r),o=null!=i.ContinuationToken||i.Topics.length.length>0,n.showViewMoreButton(o))}})};n.sendApexRequest=function(i,r,u,f,e,o){var c,s;if(t=1,$("span#abOverlayClose:visible")&&ApexVideoHandler.DoOverlayClose(),n.anchor(o),n.nav(f),null!=e&&"#"===e.substring(0,1)&&(o=e,e="",n.anchor(o)),1==$("#apexQueryParams").length&&void 0===i&&(i=$("#apexQueryParams").attr("projectId"),r=$("#apexQueryParams").attr("language"),u=$("#apexQueryParams").attr("query")),null==f&&(f=""),s=window.location.href,localStorage.getItem(s)){var l=JSON.parse(localStorage.getItem(s)),v=l.result,a=l.data,h=v.split("~");2==h.length&&(scrollTop=h[0],t=parseInt(h[1]));null!=a&&n.searchTopicsHistory(JSON.stringify(a))}c={id:i,language:r,query:u,nav:f,market:e};$("#searchHeading").html("");$("#railContentLoading").show();$.ajax({url:"/api/apexv2api",type:"GET",data:c,cache:!0,success:n.handlerApexV2ApiSuccess}).always(function(){$("#railContentLoading").hide()})};n.getApexOnDemandContent=function(n,t){if(0!=$(".ApexOndemandContent").length){var i={project:n,language:t,filename:$(".ApexOndemandContent").attr("ondemand_filename")+".htm"};$.ajax({url:"/api/apexv2api/ApexRawContent",data:i,cache:!0,success:function(n){$(".ApexOndemandContent").parent().append(n)}})}};n.redirectDocMS=function(n){if(null!=n&&null!=n.Content&&""!==n.Content.RedirectUrl){var t='<meta http-equiv="refresh" content="0; url='+n.Content.RedirectUrl+'" />';$(t).appendTo($("html head"))}};n.handlerApexV2ApiSuccess=function(r){var v,s,h,y,tt,p,c,f,w,it,rt,ut,b,k,l,o,e,d,g;n.redirectDocMS(r);var nt="-1",a=!1,u=n.anchor();if(1==$("#apexQueryParams").length&&"undefined"==typeof id&&(a=!0),v=window.location.href,s=-1,($(window).scrollTop(0),localStorage.getItem(v))&&(h=(b=JSON.parse(localStorage.getItem(v)).result).split("~"),2==h.length&&(s=h[0],t=parseInt(h[1])),s),y=!1,tt=n.projectFolder(),0==a&&(window.document.title=r.ProjectTitle),n.projectId(r.ProjectId),n.projectFolder(r.Project),n.project(r.Project.replace("_"," ")),n.projectTitle(r.ProjectTitle),n.scriptVersion(r.ScriptVersion),n.coreCSSUrl("~/Resources/content/styles/apex.core.css?v="+r.ScriptVersion),2==r.ProjectId?n.defaultUrl(""):n.defaultUrl("/#Apex/"+r.ProjectAlias+"/"+r.Language+"/"+r.DefaultTopicId+"/0"),n.defaultTopicId(r.DefaultTopicId),n.projectAlias(r.ProjectAlias),n.showSearchPanel(!1),n.clickableHeader(r.ClickableHeader),n.showRelatedTopicsRight(r.ShowRelatedTopicsRight),n.projectTheme(r.ProjectTheme),n.setProjectTheme(r.Project,tt),n.projectTheme(r.ProjectTheme),n.language(r.Language),n.query(r.Query),n.locStrings(r.LocStrings),n.showRelatedSupportPanel(!1),n.showNavGroupPanel(!0),n.showNavPanel(!0),n.showRelatedTopicsPanel(!1),n.showRightRail(null),n.showRelatedVideosPanel(!1),n.errorTopic(!1),n.customSearchClass("SearchBoxDefault"),p=r.CustomSearchTopicKeys.split(","),(p.length>0&&$.inArray(r.Query,p)>-1&&n.customSearchClass("SearchBoxCustom"),2==n.projectId()&&n.customSearchClass("SearchBoxUberHome"),null==n.navItemsData()?(n.navItemsData(r.HeaderNavItems),n.navItems(r.HeaderNavItems)):(n.navItemsData(null),n.navItems(null)),null!=r.HeaderNavItems?(n.navItemsData(r.HeaderNavItems),n.navItems(r.HeaderNavItems),n.showNavPanel(r.HeaderNavItems.length>0)):n.showNavPanel(!1),n.showVideoPanel(!1),n.newToProductUrl(null),2!=r.ProjectId&&(n.relatedSupportPanel(r.SupportRail),null!=r.SupportRail&&null!=r.SupportRail.NewToProdTopicId&&0!=r.SupportRail.NewToProdTopicId.Url.length))&&(c=null==n.currentSupportMarket()?"en-us":n.currentSupportMarket(),f="/#Apex/"+r.ProjectAlias+"/"+r.Language+"/"+r.SupportRail.NewToProdTopicId.Url+"/"+c,n.newToProductUrl(f)),w=!1,null==r.Content){if(n.topicData(null),n.topicFeedback(null),n.navGroupsItem(null),n.relatedTopicsItem(null),n.relatedVideosItem(null),n.topicFileName(null),n.customSearchClass("SearchBoxDefault"),n.breadcrumbItem(null),n.showBreadcrumbItem(!1),null!==r.Topics){null!=n.searchTopicsHistory()&&null!=n.searchTopicsHistory()&&n.searchTopicsHistory().length>0?(r.Topics=JSON.parse(n.searchTopicsHistory()),n.setViewMoreCount(r.Topics),r.Topics.reverse(),$("#apex_search input#searchquery").val(n.query())):(n.searchTopicsHistory(JSON.stringify(r.TopicsHistory)),n.setViewMoreCount(r.TopicsHistory),r.Topics.reverse());try{it=r.Topics.pop();n.searchTopics(it)}catch(r){}if(rt=t-1,r.Topics.length>0){for(e=0;e<rt;e++)ut=r.Topics.pop(),b=n.searchTopics().concat(ut),n.searchTopics(b);n.searchTopicsStack(r.Topics);n.continuationToken(r.ContinuationToken)}n.showViewMoreButton(r.ContinuationToken||r.Topics.length>0)}(null!==r.Videos&&r.Videos.length>0&&(n.showVideoPanel(!0),n.searchVideos(r.Videos),n.showMoreVideo(r.Videos.length>3)),null!=u&&null!=u&&u.length>0)&&(k=u.split(":"),2==k.length&&"#ext"==k[0]&&n.showExternalInfoLabel(!0));n.showSearchPanel(!0);$(".apex-menu").is(":hidden")&&$(".navbar-toggle").trigger("click");$(".SearchRow a.GLOSSARY_LINK").replaceWith(function(n,t){return"<span>"+t+"<\/span>"});$(window).scrollTop(s)}else{if((n.topicFeedback(null),n.topicData(r.Content.Content),window.document.title=r.Content.Title.replace(/<[^>]+>/g,""),n.showNavGroupPanel(!1),nav=r.Content.Nav,nt=r.Content.SubNav,n.topicFileName(r.Content.Filename),r.Content.Success?1==r.ShowFeedback&&r.DefaultTopicId!=r.Query&&(w=!0,n.topicFeedback(ApexFeedbackHandler.FeedbackHtml())):(n.errorTopic(!r.Content.Success),OneDSAnalytics.capturePageAction(null,{actionType:"O",contentTags:{contentId:"errorTopic",contentName:r.Query}})),$("#apex_search input#searchquery").val(""),null!=r.Content.NavGroups&&r.Content.NavGroups.length>0)&&(n.showNavGroupPanel(!0),n.showRelatedTopicsPanel(!1),n.showRightRail(null),n.showRelatedVideosPanel(!1),n.navGroupsItem(r.Content.NavGroups),n.relatedTopicsItem(null),n.relatedVideosItem(null),n.relatedTopicsTitle(""),n.relatedVideosTitle(""),l=$(".masonry-container"),l.masonry({columnWidth:".item",itemSelector:".item"}),l.masonry("destroy"),l.masonry()),null!=r.Content.BreadCrumbItems&&0!=r.Content.BreadCrumbItems.length&&r.ShowBreadCrumb?(o=r.Content.BreadCrumbItems.map(function(n){var t=Object.assign({},n);return t.Url=null!=n.SecretKey?"#apex/"+r.ProjectAlias+"/"+r.Language+"/"+n.SecretKey+"/"+r.NavItemName:"",t}),o[o.length-1].SecretKey!=r.Query&&null==r.Content.NavGroups&&o.push({Name:r.Content.Title,NameInEnglish:"",SecretKey:r.Query,Url:""}),n.breadcrumbItem(o),n.showBreadcrumbItem(!0)):(n.breadcrumbItem(null),n.showBreadcrumbItem(!1)),null!=r.Content.RelatedTopics&&r.Content.RelatedTopics.length>=0){if(n.showNavGroupPanel(!1),n.showRightRail(r.Content.IncludeRightRail&&r.Content.Success),n.showRelatedTopicsPanel(r.Content.RelatedTopics.length>0&&r.Content.Success),n.showRelatedVideosPanel(r.Content.RelatedVideos.length>0&&r.Content.Success),y=null!=r.SupportRail&&""==r.SupportRail.Forum.Url&&""==r.SupportRail.NewToProdImage.Url&&""==r.SupportRail.SignIn.Url&&""==r.SupportRail.SignUp.Url,n.showRelatedSupportPanel(!y&&r.Content.Success),n.navGroupsItem(null),n.relatedTopicsItem(r.Content.RelatedTopics),n.relatedTopicsTitle(r.Content.RelatedTopicFeature),null!=r.Content.RelatedVideos&&"https:"==window.location.protocol)for(e=0;e<r.Content.RelatedVideos.length;e++)d=r.Content.RelatedVideos[0].ThumbNail,d.toLowerCase().indexOf("http")<0&&(r.Content.RelatedVideos[0].ThumbNail=n.windowsOrigin()+d);(n.relatedVideosItem(r.Content.RelatedVideos),n.relatedVideosTitle(r.LocStrings.RelatedVideo),0!=r.SupportRail.VideoDirectoryTopicId.Url.length)?(c=null==n.currentSupportMarket()?"en-us":n.currentSupportMarket(),f="/#Apex/"+n.projectAlias()+"/"+n.language()+"/"+r.SupportRail.VideoDirectoryTopicId.Url+"/"+c,n.videoDirectoryUrl(f)):n.videoDirectoryUrl(null);showIntenseDebate=!0}null!=u&&null!=u&&u.length>0&&(g=u.split(":"),1==g.length?n.getToAnchor(u):"#ext"==g[0]&&n.showExternalInfoLabel(!0));ApexVideoHandler.Init();ApexTabHandler.Init();ApexButtonHandler.Init();ApexVideoHandler.InitEmbedVideos();$.fn.ApexDropDown();$(".GLOSSARY_LINK").tooltip({tooltipClass:"apex-tooltip"});$(".GLOSSARY_LINK").off("mouseover");$(".GLOSSARY_LINK").on("mouseover",function(n){n.preventDefault&&n.preventDefault();n.stopPropagation&&n.stopPropagation();var t=$(n.target);OneDSAnalytics.capturePageAction(t,{contentTags:{contentId:"TooltipHover",contentName:t.text()}})});$("div.zoomableImage").click(function(){$(this).toggleClass("on");$(this).children(":first").toggleClass("on")});$("img.apexImgZoomable").click(function(n){n.preventDefault&&n.preventDefault();n.stopPropagation&&n.stopPropagation();$(this).toggleClass("on");$(this).parent().toggleClass("on")});$(".expando > a > span > .expando-head-bg").each(function(){$(this).parent().after(this)})}i!=n.projectId()&&(i=n.projectId(),f="/Resources/targeted/"+("main"==n.projectFolder()?"bing_ads":n.projectFolder())+"/"+n.language()+"/apex_suggestions.json?v=1.0.0",$("#searchquery").suggestionBox({filter:!1,widthAdjustment:-8,leftOffset:0,topOffset:1}).loadSuggestions(f));n.populateUILabels(r);n.setNavItem(n.nav(),nt);$("#ab_support_chat #lpButton3").off("DOMNodeInserted");$("#ab_support_chat #lpButton3").on("DOMNodeInserted",function(n){var t=$(n.target).attr("onclick");t.indexOf("return false;")<=0&&$(n.target).attr("onclick",t+" return false;")});a&&$("[href^='#apex']").each(function(t,i){var u=$(i).attr("href"),r;n.getWindowsOrigin();r=null==document.location.origin?document.location.host:document.location.origin;$(i).attr("href",r+"/"+u)});resizeApexWindow();w&&(ApexFeedbackHandler.BindEvents(),ApexFeedbackHandler.UpdateLocStrings(r.LocStrings));$("input#searchquery").focus();setTimeout(n.getApexOnDemandContent(r.Project,r.Language),2e3);OneDSAnalytics.capturePageView({referrerUri:$('meta[name="oneds-pageUri"]').attr("content")});OneDSAnalytics.update1DSMetaTag()};Sammy(function(){this.get("#:apex/:project/:language/:query/:nav/:market/:anchor",function(){if(n.chosenNavId(this.params.nav),n.currentNavId(this.params.nav),n.showExternalInfoLabel(!1),n.searchTopicsStack(null),n.continuationToken(null),n.searchTopics(null),n.searchTopicsHistory(null),n.searchVideos(null),n.sendApexRequest(this.params.project,this.params.language,this.params.query,this.params.nav,this.params.market,this.params.anchor),null!=n.projectFolder()&&null!=n.projectFolder()){n.projectFolder();this.params.language;this.params.query;var t=this.params.anchor.split(":");2==t.length?ApexInstrumentHandler.LogAria(n.projectFolder(),n.projectFolder(),n.language(),this.params.query,"","","Page",t[1]):ApexInstrumentHandler.LogAria("Browser",n.projectFolder(),n.language(),this.params.query,"","","Anchor",t)}});this.get("#:apex/:project/:language/:query/:nav/:market",function(){var t=this.params.market;n.chosenNavId(this.params.nav);n.currentNavId(this.params.nav);n.showExternalInfoLabel(!1);n.searchTopicsStack(null);n.continuationToken(null);n.searchTopics(null);n.searchTopicsHistory(null);n.searchVideos(null);n.sendApexRequest(this.params.project,this.params.language,this.params.query,this.params.nav,t);null!=n.projectFolder()&&null!=n.projectFolder()&&ApexInstrumentHandler.LogAria("Browser",n.projectFolder(),this.params.language,this.params.query,"","","Page","")});this.get("#:apex/:project/:language/:query/:nav",function(){$(".in,.open").removeClass("in open");n.chosenNavId(this.params.nav);n.currentNavId(this.params.nav);n.showExternalInfoLabel(!1);n.searchTopicsStack(null);n.continuationToken(null);n.searchTopics(null);n.searchTopicsHistory(null);n.searchVideos(null);var t=this.params.nav.split("-"),r="",i="";2==(t=this.params.nav.split("-")).length?(r=t[1],i=t[0]):i=this.params.nav;n.sendApexRequest(this.params.project,this.params.language,this.params.query,i);null!=n.projectFolder()&&null!=n.projectFolder()&&ApexInstrumentHandler.LogAria("Browser",n.projectFolder(),this.params.language,this.params.query,"",r,"Page","")});this.get("#:apex/:project/:language/:query",function(){n.showExternalInfoLabel(!1);var t=this.params.query;5==t.length&&/^[n][0-9]{4}/.test(t)?n.termToSearch(""):n.termToSearch(t);n.searchTopicsStack(null);n.searchTopics(null);n.searchTopicsHistory(null);n.continuationToken(null);n.searchVideos(null);n.sendApexRequest(this.params.project,this.params.language,this.params.query,"")});this.get("#:apex/:project/:language",function(){n.showExternalInfoLabel(!1);var t=n.defaultTopicId();null!=t&&(5==t.length&&/^[n][0-9]{4}/.test(t)?n.termToSearch(""):n.termToSearch(t));n.searchTopicsStack(null);n.searchTopics(null);n.searchTopicsHistory(null);n.continuationToken(null);n.searchVideos(null);n.sendApexRequest(this.params.project,this.params.language,"","")});this.get("",function(){n.showExternalInfoLabel(!1);n.sendApexRequest()});this.get(/.*/,function(){})}).run()};ko.bindingHandlers.insertText={init:function(n,t){var i=document.createElement("span"),r=n.firstChild;n.insertBefore(i,r);ko.applyBindingsToNode(i,{text:t()})}};ko.bindingHandlers.executeOnEnter={init:function(n,t,i,r){var u=t();$(n).keypress(function(n){return 13!==n.which||(u.call(r),!1)})}};ko.bindingHandlers.executeOnEnterForClick={init:function(n,t){t();$(n).keypress(function(n){return 13!==n.which||($(n.target).trigger("click"),!1)})}};ko.bindingHandlers.autoComplete={init:function(n,t){var r=t(),u=r.selected,f=r.options,i=function(t,i){t.preventDefault();$(n).val(i.item.label);void 0!==i.item&&u(i.item)};$(n).autocomplete({source:f,select:function(n,t){i(n,t)},focus:function(n,t){i(n,t)},change:function(n,t){i(n,t)}})}};$(document).delegate("a","click.history-",function(n){n.isDefaultPrevented()||this.hostname==window.location.hostname&&OneDSAnalytics.capturePageUnload()});apexMainViewModel=new ApexMainViewModel;ko.applyBindings(apexMainViewModel);var apexSearchFocus=function(n){n.val()==$(n).attr("title")&&(n.val(""),n.removeClass("watermark"))},apexSearchBlur=function(n){var t=n.val();null!=t&&0!=t.length||(n.val($(n).attr("title")),n.hasClass("watermark")||n.addClass("watermark"))},keydownEscHandler=function(n){27===n.which&&"none"!==$("#apex-suggestion-box").css("display")&&($("#apex-suggestion-box").css("display","none"),$("input#searchquery").focus(),$("input#searchquery").attr("aria-activedescendant",""),$("#announce-suggestions").html(""))},apexTrapFocus=function(n,t){null!==n&&null!==t&&1==n.length&&1==t.length&&($(n).off("keydown"),$(n).on("keydown",function(i){9==(i.keyCode||i.which)&&i.shiftKey&&document.activeElement.id===$(n).attr("id")&&(i.preventDefault&&i.preventDefault(),$(t).focus())}),$(t).off("keydown"),$(t).on("keydown",function(i){9!=(i.keyCode||i.which)||i.shiftKey||(i.preventDefault&&i.preventDefault(),document.activeElement.id===$(t).attr("id")&&$(n).focus())}))},tabToSuggestions=function(){var n=$("input#searchquery"),t=$("#apex-suggestion-box");n.keydown(function(i){if(""!=n.val()&&t.is(":visible")&&9===i.which){i.preventDefault&&i.preventDefault();$("input#searchquery").blur();t.css("display","block");var r=$("#apex-suggestion-box-list li").length+" suggestions found, use tab to review";$("#announce-suggestions").html(r);$("#apex-suggestion-box-list li:first a").focus()}})};$(document).ready(function(){localStorage.clear();$(".GLOSSARY_LINK").tooltip({tooltipClass:"apex-tooltip"});$(".nav li").off("click");$(".nav li").on("click",function(n){$(".active").removeClass("active");$(this).addClass("active");n.preventDefault()});$(".more-videos").off("click");$(".more-videos").on("click",function(){$("#railContent .VideoRow.hide").each(function(n,t){return $(t).removeClass("hide").addClass("show"),!(n>=2)});0==$("#railContent .VideoRow.hide").length&&$(".more-videos").hide()});$("#apex_search input#searchsubmit").off("click");$("#apex_search input#searchsubmit").on("click",function(){$(this).hasClass("clearbutton")?($("#apex_search input#searchsubmit").removeClass("clearbutton").attr({tabindex:"-1","aria-hidden":"true"}),$("#apex_search input#searchquery").val("").focus()):apexMainViewModel.searchTerm()});$("#apex_search input#searchquery").off("input");$("#apex_search input#searchquery").on("input",function(){$("#apex_search input#searchquery").val()?$("#apex_search input#searchsubmit").addClass("clearbutton").attr({tabindex:"0","aria-hidden":"false"}):$("#apex_search input#searchsubmit").removeClass("clearbutton").attr({tabindex:"-1","aria-hidden":"true"})});$("#apex_search input#searchquery").focus(function(){tabToSuggestions()});$(document).off("keydown",keydownEscHandler);$(document).on("keydown",keydownEscHandler);$(window).resize(function(){resizeApexWindow()});WcpConsent.init("en-US","cookie-banner",function(n,t){if(null!=n)return error;siteConsent=t;siteConsent.isConsentRequired&&($("#cookie-banner #wcpConsentBannerCtrl").is(":visible")&&($("body").css("padding-top","115px"),$("#apexbody .header").css("margin-top","66px")),$("#cookieManageConsent").show())},ApexCookieBannerHandler.OnConsentChanged)});var _megaInstIdKey="mega",toggleElementDisplay=function(n){var t;"object"==typeof n?t=n.id:"string"==typeof n&&(t=n);""!=t&&null!=t&&($("#"+t).toggle(),t.indexOf(_megaInstIdKey))},toggleImg=function(n,t,i){var r=$("#"+n);if(r.length>0){var u=t.lastIndexOf("/"),f=-1!=u?t.substring(u+1,t.length):t,e=r.attr("src");r.attr("src",e.indexOf(f)>-1?i:t)}},ApexHelper=function(){return{}};!function(n){n.fn.AutoSizeIFrame=function(t){return n.fn.AutoSizeIFrame.glb.opts=n.extend({},n.fn.AutoSizeIFrame.defaults,t),n.fn.AutoSizeIFrame.glb.myThis=this,n.fn.AutoSizeIFrame.glb.resizeTimeout=null,n.fn.AutoSizeIFrame.glb.resizeCount=0,this.each(function(){var t=n(this);return void 0!==t[0].tagName&&"iframe"===t[0].tagName.toLowerCase()&&(resizeMaxTry=n.fn.AutoSizeIFrame.glb.opts.resizeMaxTry,n.fn.AutoSizeIFrame.glb.myThis.elem=t,n.fn.AutoSizeIFrame.resizeIframe(),n(elem).on("load",function(){n.fn.AutoSizeIFrame.resizeIframe(t)}),t.data("AutoSizeIFrame",n.fn.AutoSizeIFrame.glb.myThis),!0)})};var t=function(t){n.fn.AutoSizeIFrame.glb.resizeCount<=n.fn.AutoSizeIFrame.glb.opts.resizeMaxTry?(n.fn.AutoSizeIFrame.glb.resizeCount++,n.fn.AutoSizeIFrame.glb.resizeTimeout=setTimeout("$.fn.AutoSizeIFrame.resizeIframe()",n.fn.AutoSizeIFrame.glb.opts.resizeWaitTime)):(clearTimeout(n.fn.AutoSizeIFrame.glb.resizeTimeout),n.fn.AutoSizeIFrame.glb.resizeCount=0,t.height(3e3).css("height",3e3))},i=function(n){n.css("height","").removeAttr("height")};n.fn.AutoSizeIFrame.resizeIframe=function(){!function(){var r,u;try{r=n.fn.AutoSizeIFrame.glb.myThis.elem;(i(r),"200px"===r.css("height")&&i(),null!==r.get(0).contentWindow.document.body)?(u=n(r.get(0).contentWindow.document).height(),u<=200?t(r):u>200&&r.height(u).css("height",u+n.fn.AutoSizeIFrame.glb.opts.offset)):t(r)}catch(n){}}();n(".idc-r").off("click");n(".idc-r").on("click",function(){})};n.fn.AutoSizeIFrame.glb={opts:null,myThis:null,resizeTimeout:null,resizeCount:0};n.fn.AutoSizeIFrame.defaults={resizeMaxTry:5,resizeWaitTime:100,offset:0}}(jQuery),function(n){n.fn.suggestionBox=function(t){function s(){b="#";f=-1;u.find("li").removeClass("selected")}function c(){var t=o(r,"border-bottom-width")+o(r,"border-top-width"),f=o(r,"padding-bottom")+o(r,"padding-top"),n=r.offset().top;0==n&&(n=124);u.css({position:"fixed",left:r.offset().left+i.leftOffset,top:n+(r.height()+t+f+i.topOffset)})}function o(n,t){return parseInt(n.css(t).replace("px",""))}function h(){i.fadeOut?u.fadeOut():u.css("display","none");s();n("#announce-suggestions").html("No suggestions available. Suggestion list hidden.");n(".apex_search_box input#searchquery").attr("aria-expanded","false")}function d(){c();i.fadeIn?u.fadeIn():u.css("display","block");n(".apex_search_box input#searchquery").attr("aria-expanded","true")}function g(){var n=r.width()+o(r,"border-left-width")+o(r,"border-right-width")+o(r,"padding-left")+o(r,"padding-right")+i.widthAdjustment;"auto"==i.menuWidth?u.css({"min-width":n}):"constrain"==i.menuWidth&&u.css({width:n})}function nt(){var t,f,o,c,l;s();v=!1;t=i.filter?function(t){var r,u,f;return(t=t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),filterPattern=i.filterPattern.replace("{INPUT}",t),!t)?{}:(e&&e.results&&(u=new RegExp(filterPattern,"i"),r=n.grep(e.results,function(n){return u.test(n.suggestion)})),i.sort&&r.sort(i.sort),f=JSON.stringify({results:r}),n.parseJSON(f))}(r.val()):e;t&&t.results&&(f=function(t){var r='<ul id="apex-suggestion-box-list" role="listbox">',f="main"==apexMainViewModel.project()?"ads":apexMainViewModel.projectAlias(),u="main"==apexMainViewModel.project()?"bing_ads":apexMainViewModel.projectFolder();return n.each(t.results,function(t,e){if(!e.suggestion||!e.url)return!1;if(v=!0,e.attr&&n.each(e.attr,function(n,t){for(var r=Object.keys(t),i=0;i<r.length;i++)r[i],t[r[i]]}),""==e.video)r+='<li role="listitem"><span class="apex-topic"/><span><a href="/#apex/'+f+"/"+apexMainViewModel.language()+"/"+e.url+"/"+e.nav+'" id="suggestion-'+e.url+'" class="apex-suggestion-item" tabindex="0" role="option" secretkey="'+e.url+'">'+e.suggestion+"<\/a><\/span><\/li>";else{var o=e.video.split("~");r+=2==o.length&&void 0!==o[1]?'<li role="listitem"><span class="apex-video" videoid="'+o[0]+'" op_videoid="'+o[1]+'" project="'+u+'" language="'+apexMainViewModel.language()+'"/><span class="apex-video-text"><a href="#"  id="suggestion-'+e.url+'" class="apex-suggestion-item" tabindex="0" role="option" videoid="'+o[0]+'" op_videoid="'+o[1]+'" project="'+u+'" language="'+apexMainViewModel.language()+'">'+e.suggestion+"<\/a><\/span><\/li>":'<li role="listitem"><span class="apex-video" videoid="'+e.video+'" project="'+u+'" language="'+apexMainViewModel.language()+'"/><span class="apex-video-text"><a href="#" id="suggestion-'+e.url+'" class="apex-suggestion-item" tabindex="0" role="option" videoid="'+e.video+'" project="'+u+'" language="'+apexMainViewModel.language()+'">'+e.suggestion+"<\/a><\/span><\/li>"}return t!==i.results-1&&void 0}),r+="<\/ul>"}(t));y?(v?(u.html(f),n("#apex-suggestion-box-list li span[videoid], #apex-suggestion-box-list li a[videoid]").off("click"),n("#apex-suggestion-box-list li span[videoid], #apex-suggestion-box-list li a[videoid]").on("click",function(n){n.preventDefault();ApexVideoHandler.ShowVideo(n)}),g(),d(),o=n("#apex-suggestion-box-list li").length+" suggestions found, use tab to review",n("#announce-suggestions").html(o)):i.showNoSuggestionsMessage&&r.val().length>0?(g(),d(),u.html('<div id="no-suggestions">'+i.noSuggestionsMessage+"<\/div>")):h(),c=n("#apex-suggestion-box-list li:first a"),l=n("#apex-suggestion-box-list li:last a"),apexTrapFocus(c,l),n("#apex-suggestion-box-list li a").focus(function(){n("input#searchquery").attr("aria-activedescendant",n(this).attr("id"))}),n("#apex-suggestion-box-list li a").blur(function(t){setTimeout(function(){document.activeElement.className!=t.target.className&&(h(),n(".apex_search_box input#searchquery").attr("aria-activedescendant",""))},1)})):h()}function p(t){t&&t.results.length>0?(e=t instanceof Object?t:n.parseJSON(t),i.filter=!0):(e={},i.filter=!1)}var r=this,i=n.extend({topOffset:0,leftOffset:0,widthAdjustment:0,delay:400,heading:"Suggestions",results:10,fadeIn:!0,fadeOut:!1,menuWidth:"auto",showNoSuggestionsMessage:!1,noSuggestionsMessage:"No Suggestions Found",filter:!1,filterPattern:"({INPUT})",ajaxError:function(n){console.log(n)},ajaxSuccess:function(){},enterKeyAction:function(){u.css("display","none");window.location=b},paramName:"search"},t),u;n("#apex-suggestion-box").length>0&&n("#apex-suggestion-box").remove();n("body").append('<div id="apex-suggestion-box"><\/div><div id="announce-suggestions" class="screen-reader-only" aria-live="assertive" tabindex="-1" aria-hidden="true"><\/div>');r.attr("autocomplete","off");u=n("#apex-suggestion-box");c();var w,f=-1,b="#",l=!1,a=null,v=!1,y=!1,k={},e={};return u.on({mousemove:function(t){"A"===t.target.nodeName&&(f=function(t){var i=n(t.target).parent("li");return i.parent().children().index(i)}(t),l=!0)},mouseout:function(n){"A"===n.target.nodeName&&(l=!1,s())},click:function(n){"A"===n.target.nodeName&&u.css("display","none")}}),r.on({blur:function(){y=!1;l||h()},focus:function(){y=!0},keyup:function(t){38!==t.which&&40!==t.which&&27!==t.which&&13!==t.which?(i.url&&(s(),a&&clearTimeout(a)),i.url&&(k[i.paramName]=r.val(),a=setTimeout(function(){var t;t=i.url;w=r.val();n.ajax({url:t,data:k,dataType:"json",success:function(n){var t=!0,u=f;e.results&&n.results&&(t=JSON.stringify(e.results[f])!==JSON.stringify(n.results[f]));p(n);nt();u>-1&&r.val()===w&&!t&&(f=u);i.ajaxSuccess(n)},error:function(n){i.ajaxError(n)}})},i.delay)),i.filter&&nt()):13==t.which&&h()},keydown:function(n){var t;"none"!==u.css("display")&&(40==n.which&&(n.preventDefault(),t=u.find("li").size(),f===t-1?s():f++),38==n.which&&(n.preventDefault(),f>0?f--:-1==f?f=u.find("li").size()-1:s()),13===n.which&&f>-1&&(n.preventDefault(),i.enterKeyAction()),27==n.which&&(n.preventDefault(),h()))},paste:function(){setTimeout(function(){r.keyup()},200)}}),n(window).resize(function(){c()}),n(window).scroll(function(){c();var t=parseInt(n("#apex-suggestion-box").css("top"),10)-n(window).scrollTop();n("#apex-suggestion-box").css("top",t)}),{loadSuggestions:function(t){return function(t){n.ajax({url:t,dataType:"json",success:function(n){p(n)},error:function(n){console.log(n)}})}(t),this},addSuggestions:function(n){return p(n),this}}}}(jQuery);window.onload=onPageLoad;window.onfocus=onPageFocusChange;window.onblur=onPageFocusChange;window.onbeforeunload=OneDSAnalytics.capturePageUnload,function(n){n.version="2.1.3"}(clienttelemetry_build||(clienttelemetry_build={})),function(n){(function(n){var t,i;(function(n){n[n.BT_STOP=0]="BT_STOP";n[n.BT_STOP_BASE=1]="BT_STOP_BASE";n[n.BT_BOOL=2]="BT_BOOL";n[n.BT_UINT8=3]="BT_UINT8";n[n.BT_UINT16=4]="BT_UINT16";n[n.BT_UINT32=5]="BT_UINT32";n[n.BT_UINT64=6]="BT_UINT64";n[n.BT_FLOAT=7]="BT_FLOAT";n[n.BT_DOUBLE=8]="BT_DOUBLE";n[n.BT_STRING=9]="BT_STRING";n[n.BT_STRUCT=10]="BT_STRUCT";n[n.BT_LIST=11]="BT_LIST";n[n.BT_SET=12]="BT_SET";n[n.BT_MAP=13]="BT_MAP";n[n.BT_INT8=14]="BT_INT8";n[n.BT_INT16=15]="BT_INT16";n[n.BT_INT32=16]="BT_INT32";n[n.BT_INT64=17]="BT_INT64";n[n.BT_WSTRING=18]="BT_WSTRING";n[n.BT_UNAVAILABLE=127]="BT_UNAVAILABLE"})(n.BondDataType||(n.BondDataType={}));t=n.BondDataType,function(n){n[n.MARSHALED_PROTOCOL=0]="MARSHALED_PROTOCOL";n[n.MAFIA_PROTOCOL=17997]="MAFIA_PROTOCOL";n[n.COMPACT_PROTOCOL=16963]="COMPACT_PROTOCOL";n[n.JSON_PROTOCOL=21322]="JSON_PROTOCOL";n[n.PRETTY_JSON_PROTOCOL=20554]="PRETTY_JSON_PROTOCOL";n[n.SIMPLE_PROTOCOL=20563]="SIMPLE_PROTOCOL"}(n.ProtocolType||(n.ProtocolType={}));i=n.ProtocolType})(n.Bond||(n.Bond={}));var t=n.Bond}(Microsoft||(Microsoft={})),function(n){(function(n){(function(n){var i=function(){function n(){this._buffer=[]}return n.prototype.Add=function(n){for(var t=0;t<this._buffer.length;++t)if(this._buffer[t]==n)break;t==this._buffer.length&&this._buffer.push(n)},n.prototype.Count=function(){return this._buffer.length},n.prototype.GetBuffer=function(){return this._buffer},n}(),t;n.Set=i;t=function(){function n(){this._buffer=[]}return n.prototype.Add=function(n,t){this._getIndex(n)==-1&&this._buffer.push({Key:n,Value:t})},n.prototype.AddOrReplace=function(n,t){var i=this._getIndex(n);i>=0?this._buffer[i]={Key:n,Value:t}:this._buffer.push({Key:n,Value:t})},n.prototype.Remove=function(n){var t=this._getIndex(n);t>=0&&this._buffer.splice(t,1)},n.prototype.Count=function(){return this._buffer.length},n.prototype.GetBuffer=function(){return this._buffer},n.prototype._getIndex=function(n){for(var t=0,i=-1;t<this._buffer.length;++t)if(this._buffer[t].Key==n){i=t;break}return i},n}();n.Map=t})(n.Collections||(n.Collections={}));var t=n.Collections})(n.Bond||(n.Bond={}));var t=n.Bond}(Microsoft||(Microsoft={})),function(n){(function(t){var r,u,i;(function(n){var h=function(){function n(){}return n.GetBytes=function(n){for(var t,i=[],r=0;r<n.length;++r)t=n.charCodeAt(r),t<128?i.push(t):t<2048?i.push(192|t>>6,128|t&63):t<55296||t>=57344?i.push(224|t>>12,128|t>>6&63,128|t&63):(t=65536+((t&1023)<<10|n.charCodeAt(++r)&1023),i.push(240|t>>18,128|t>>12&63,128|t>>6&63,128|t&63));return i},n}(),r,u,f,e,o,s;n.Utf8=h;r=function(){function n(){}return n.GetString=function(n){for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=[],f=n.length%3,r,e=function(n){return[t.charAt(n>>18&63),t.charAt(n>>12&63),t.charAt(n>>6&63),t.charAt(n&63)].join("")},u=0,o=n.length-f;u<o;u+=3)r=(n[u]<<16)+(n[u+1]<<8)+n[u+2],i.push(e(r));switch(f){case 1:r=n[n.length-1];i.push(t.charAt(r>>2));i.push(t.charAt(r<<4&63));i.push("==");break;case 2:r=(n[n.length-2]<<8)+n[n.length-1];i.push(t.charAt(r>>10));i.push(t.charAt(r>>4&63));i.push(t.charAt(r<<2&63));i.push("=")}return i.join("")},n}();n.Base64=r;u=function(){function n(){}return n.GetBytes=function(n){for(var t=[];n&4294967168;)t.push(n&127|128),n>>>=7;return t.push(n&127),t},n}();n.Varint=u;f=function(){function n(){}return n.GetBytes=function(n){for(var t=n.low,i=n.high,r=[];i||4294967168&t;)r.push(t&127|128),t=(i&127)<<25|t>>>7,i>>>=7;return r.push(t&127),r},n}();n.Varint64=f;e=function(){function n(){}return n.GetBytes=function(n){var u,f,r;if(t.BrowserChecker.IsDataViewSupport()){for(u=new DataView(new ArrayBuffer(4)),u.setFloat32(0,n,!0),f=[],r=0;r<4;++r)f.push(u.getUint8(r));return f}return i.ConvertNumberToArray(n,!1)},n}();n.Float=e;o=function(){function n(){}return n.GetBytes=function(n){var u,f,r;if(t.BrowserChecker.IsDataViewSupport()){for(u=new DataView(new ArrayBuffer(8)),u.setFloat64(0,n,!0),f=[],r=0;r<8;++r)f.push(u.getUint8(r));return f}return i.ConvertNumberToArray(n,!0)},n}();n.Double=o;s=function(){function n(){}return n.EncodeZigzag16=function(n){return n=t.Number.ToInt16(n),n<<1^n>>15},n.EncodeZigzag32=function(n){return n=t.Number.ToInt32(n),n<<1^n>>31},n.EncodeZigzag64=function(n){var f=n.low,e=n.high,r=e<<1|f>>>31,u=f<<1,i;return e&2147483648&&(r=~r,u=~u),i=new t.UInt64("0"),i.low=u,i.high=r,i},n}();n.Zigzag=s})(t.Encoding||(t.Encoding={}));r=t.Encoding,function(r){var h=function(){function n(){}return n.GetString=function(n){for(var t,u,f,r=[],i=0;i<n.length;++i)if(t=n[i],t<=191)r.push(String.fromCharCode(t));else if(t<=223)u=n[++i],r.push(String.fromCharCode((t&31)<<6|u&63));else if(t<=239)u=n[++i],f=n[++i],r.push(String.fromCharCode((t&15)<<12|(u&63)<<6|f&63));else{var u=n[++i],f=n[++i],e=n[++i];t=(t&7)<<18|(u&63)<<12|(f&63)<<6|e&63;t-=65536;r.push(String.fromCharCode(55296|t>>10&1023));r.push(String.fromCharCode(56320|t&1023))}return r.join("")},n}(),u,f,e,o,s;r.Utf8=h;u=function(){function n(){}return n.GetBytes=function(n){for(var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=[],t=0;t<n.length;++t){var o=i.indexOf(n.charAt(t++)),f=i.indexOf(n.charAt(t++)),u=i.indexOf(n.charAt(t++)),e=i.indexOf(n.charAt(t));r.push(o<<2|f>>4);u>=0&&(r.push(f<<4&240|u>>2),e>=0&&r.push(u<<6&192|e))}return r},n}();r.Base64=u;f=function(){function t(){}return t.GetInt64=function(t){var i=new n.Bond.Int64("0"),r=this._Read(t);return i.low=r[0],r.length>1&&(i.high=r[1]),i},t.GetNumber=function(n){return this._Read(n)[0]},t._Read=function(n){for(var f=[],r=0,u=!0,i=0,t;u;)if(t=n.shift(),u=(t&128)!=0,t=t&127,i<28)r|=t<<i,i+=7;else{r|=t<<i;f.push(r);r=t>>4;i=3;break}while(u)if(t=n.shift(),u=(t&128)!=0,t=t&127,r|=t<<i,i+=7,i>=32)break;return f.push(r),f},t}();r.Varint=f;e=function(){function n(){}return n.GetNumber=function(n){var u,r;if(t.BrowserChecker.IsDataViewSupport()){for(u=new DataView(new ArrayBuffer(4)),r=0;r<4;++r)u.setUint8(r,n[r]);return u.getFloat32(0,!0)}return i.ConvertArrayToNumber(n,!1)},n}();r.Float=e;o=function(){function n(){}return n.GetNumber=function(n){var u,r;if(t.BrowserChecker.IsDataViewSupport()){for(u=new DataView(new ArrayBuffer(8)),r=0;r<8;++r)u.setUint8(r,n[r]);return u.getFloat64(0,!0)}return i.ConvertArrayToNumber(n,!0)},n}();r.Double=o;s=function(){function t(){}return t.DecodeZigzag16=function(n){return((65535&n)>>>1^-(n&1))<<16>>16},t.DecodeZigzag32=function(n){return n>>>1^-(n&1)},t.DecodeZigzag64=function(t){var f=t.high&1,u=t.high>>>1,e=t.low&1,i=t.low>>>1,r;return i=f<<31|i,e&&(i^=4294967295,u^=4294967295),r=new n.Bond.UInt64("0"),r.low=i,r.high=u,r},t}();r.Zigzag=s}(t.Decoding||(t.Decoding={}));u=t.Decoding;i=function(){function n(){}return n.ConvertNumberToArray=function(n,t){var r,h,v,f,s,e;if(!n)return t?this._doubleZero:this._floatZero;var w=t?11:8,p=t?52:23,o=(1<<w-1)-1,b=1-o,k=o,y=n<0?1:0;n=Math.abs(n);for(var c=Math.floor(n),l=n-c,a=2*(o+2)+p,u=new Array(a),i=0;i<a;)u[i++]=0;for(i=o+2;i&&c;)u[--i]=c%2,c=Math.floor(c/2);for(i=o+1;i<a-1&&l>0;)l*=2,l>=1?(u[++i]=1,--l):u[++i]=0;for(r=0;r<a&&!u[r];++r);if(h=o+1-r,v=r+p,u[v+1]){for(i=v;i>r;--i)if(u[i]=1-u[i])break;i==r&&++h}if(h>k||c)return y?t?this._doubleNegInifinity:this._floatNegInifinity:t?this._doubleInifinity:this._floatInifinity;if(h<b)return t?this._doubleZero:this._floatZero;if(t){for(f=0,i=0;i<20;++i)f=f<<1|u[++r];for(s=0;i<52;++i)s=s<<1|u[++r];return f|=h+o<<20,f=y<<31|f&2147483647,[s&255,s>>8&255,s>>16&255,s>>>24,f&255,f>>8&255,f>>16&255,f>>>24]}for(e=0,i=0;i<23;++i)e=e<<1|u[++r];return e|=h+o<<23,e=y<<31|e&2147483647,[e&255,e>>8&255,e>>16&255,e>>>24]},n.ConvertArrayToNumber=function(n,i){var c=i?11:8,l=(1<<c-1)-1,a=(n[i?7:3]&128)!=0,e=i?(n[7]&127)<<4|(n[6]&240)>>4:(n[3]&127)<<1|(n[2]&128)>>7,u,f,o,s,h,r;if(e==255)throw new t.Exception("Not a valid float/double buffer.");if(u=1,f=1,i){if(o=(n[6]&15)<<28|(n[5]&255)<<20|(n[4]&255)<<12,s=n[3]<<24|(n[2]&255)<<16|(n[1]&255)<<8|n[0]&255,!e&&!o&&!s)return 0;for(r=0;r<20;++r)f/=2,o<0&&(u+=f),o<<=1;for(r=0;r<32;++r)f/=2,s<0&&(u+=f),s<<=1}else{if(h=(n[2]&127)<<25|(n[1]&255)<<17|(n[0]&255)<<9,!e&&!h)return 0;for(r=0;r<23;++r)f/=2,h<0&&(u+=f),h<<=1}return u*=Math.pow(2,e-l),a?0-u:u},n._floatZero=[0,0,0,0],n._doubleZero=[0,0,0,0,0,0,0,0],n._floatInifinity=[0,0,128,127],n._floatNegInifinity=[0,0,128,255],n._doubleInifinity=[0,0,0,0,0,0,240,127],n._doubleNegInifinity=[0,0,0,0,0,0,240,255],n}()})(n.Bond||(n.Bond={}));var t=n.Bond}(Microsoft||(Microsoft={})),function(n){(function(n){(function(t){var i=function(){function t(){this._buffer=[]}return t.prototype.WriteByte=function(t){this._buffer.push(n.Number.ToByte(t))},t.prototype.Write=function(n,t,i){while(i--)this.WriteByte(n[t++])},t.prototype.GetBuffer=function(){return this._buffer},t}();t.MemoryStream=i})(n.IO||(n.IO={}));var t=n.IO})(n.Bond||(n.Bond={}));var t=n.Bond}(Microsoft||(Microsoft={})),function(n){(function(n){var c=function(){function n(n,t){this.Type=n;this.Id=t}return n}(),t,i,r,u,f,e,o,s,h;n.FieldTag=c;t=function(){function n(n,t){this.ElementType=n;this.Size=t}return n}();n.ContainerTag=t;i=function(){function n(n,t,i){this.KeyType=n;this.ValueType=t;this.Size=i}return n}();n.KeyValueContainerTag=i;r=function(){function n(){}return n}();n.Bonded=r;u=function(){function n(n){this.low=0;this.high=0;this.low=parseInt(n);this.low<0&&(this.high=-1)}return n.prototype.Equals=function(t){var i=new n(t);return this.low==i.low&&this.high==i.high},n}();n.Int64=u;f=function(){function n(n){this.low=0;this.high=0;this.low=parseInt(n)}return n.prototype.Equals=function(t){var i=new n(t);return this.low==i.low&&this.high==i.high},n}();n.UInt64=f;e=function(){function n(){}return n.ToByte=function(n){return this.ToUInt8(n)},n.ToInt8=function(n){var t=(n&128)<<24>>24;return n&127|t},n.ToInt16=function(n){var t=(n&32768)<<16>>16;return n&32767|t},n.ToInt32=function(n){var t=n&2147483648;return n&2147483647|t},n.ToUInt8=function(n){return n&255},n.ToUInt16=function(n){return n&65535},n.ToUInt32=function(n){return n&4294967295},n}();n.Number=e;o=function(){function n(n){this.Message=n}return n}();n.Exception=o;s=function(){function n(){}return n}();n.KeyValuePair=s;h=function(){function n(){}return n.IsDataViewSupport=function(){return typeof ArrayBuffer!="undefined"&&typeof DataView!="undefined"},n}();n.BrowserChecker=h})(n.Bond||(n.Bond={}));var t=n.Bond}(Microsoft||(Microsoft={})),function(n){(function(n){var i=function(){function t(n){this._stream=n}return t.prototype.WriteBlob=function(n){this._stream.Write(n,0,n.length)},t.prototype.WriteBool=function(n){this._stream.WriteByte(n?1:0)},t.prototype.WriteContainerBegin=function(n,t){this.WriteUInt8(t);this.WriteUInt32(n)},t.prototype.WriteMapContainerBegin=function(n,t,i){this.WriteUInt8(t);this.WriteUInt8(i);this.WriteUInt32(n)},t.prototype.WriteContainerEnd=function(){},t.prototype.WriteDouble=function(t){var i=n.Encoding.Double.GetBytes(t);this._stream.Write(i,0,i.length)},t.prototype.WriteFloat=function(t){var i=n.Encoding.Float.GetBytes(t);this._stream.Write(i,0,i.length)},t.prototype.WriteFieldBegin=function(n,t){t<=5?this._stream.WriteByte(n|t<<5):t<=255?(this._stream.WriteByte(n|192),this._stream.WriteByte(t)):(this._stream.WriteByte(n|224),this._stream.WriteByte(t),this._stream.WriteByte(t>>8))},t.prototype.WriteFieldEnd=function(){},t.prototype.WriteFieldOmitted=function(){},t.prototype.WriteInt16=function(t){t=n.Encoding.Zigzag.EncodeZigzag16(t);this.WriteUInt16(t)},t.prototype.WriteInt32=function(t){t=n.Encoding.Zigzag.EncodeZigzag32(t);this.WriteUInt32(t)},t.prototype.WriteInt64=function(t){this.WriteUInt64(n.Encoding.Zigzag.EncodeZigzag64(t))},t.prototype.WriteInt8=function(t){this._stream.WriteByte(n.Number.ToInt8(t))},t.prototype.WriteString=function(t){if(t=="")this.WriteUInt32(0);else{var i=n.Encoding.Utf8.GetBytes(t);this.WriteUInt32(i.length);this._stream.Write(i,0,i.length)}},t.prototype.WriteStructBegin=function(){},t.prototype.WriteStructEnd=function(n){this.WriteUInt8(n?1:0)},t.prototype.WriteUInt16=function(t){var i=n.Encoding.Varint.GetBytes(n.Number.ToUInt16(t));this._stream.Write(i,0,i.length)},t.prototype.WriteUInt32=function(t){var i=n.Encoding.Varint.GetBytes(n.Number.ToUInt32(t));this._stream.Write(i,0,i.length)},t.prototype.WriteUInt64=function(t){var i=n.Encoding.Varint64.GetBytes(t);this._stream.Write(i,0,i.length)},t.prototype.WriteUInt8=function(t){this._stream.WriteByte(n.Number.ToUInt8(t))},t.prototype.WriteWString=function(n){var t,i;for(this.WriteUInt32(n.length),t=0;t<n.length;++t)i=n.charCodeAt(t),this._stream.WriteByte(i),this._stream.WriteByte(i>>>8)},t}(),t;n.CompactBinaryProtocolWriter=i;t=function(){function n(){}return n}();n.CompactBinaryProtocolReader=t})(n.Bond||(n.Bond={}));var t=n.Bond}(Microsoft||(Microsoft={})),function(n){var t=function(){function n(){}return n.IsSafari=function(){return n._isSafari===null&&n._DetectBrowser(),n._isSafari},n.ajax=function(t){var i=n._createConnection(),r,u;if(!i.setRequestHeader&&t.headers){r="read-from-query-string-instead-of-headers=true";for(u in t.headers)r+="&",r+=encodeURIComponent(u),r+="=",r+=encodeURIComponent(t.headers[u]);t.url+=t.url.indexOf("?")<0?"?":"&";t.url+=r}if(i.open(t.type,t.url),i.setRequestHeader&&t.headers)for(u in t.headers)i.setRequestHeader(u,t.headers[u]);t.complete&&(i.onload=function(){typeof i.status=="undefined"&&(i.status=200);t.complete(i)},i.ontimeout=function(){typeof i.status=="undefined"&&(i.status=500);t.complete(i)},i.onerror=function(){t.complete(i)});i.send(t.data)},n.keys=function(n){var t,i;if(Object.keys)return Object.keys(n);t=[];for(i in n)n.hasOwnProperty(i)&&t.push(i);return t},n.IsUsingXDomainRequest=function(){if(n._usingXDomainRequest==null){var t=new XMLHttpRequest;n._usingXDomainRequest=typeof t.withCredentials=="undefined"&&typeof XDomainRequest!="undefined"?!0:!1}return n._usingXDomainRequest},n._createConnection=function(){var t=new XMLHttpRequest;return n.IsUsingXDomainRequest()?new XDomainRequest:t},n._DetectBrowser=function(){var t=navigator.userAgent.toLowerCase();n._isSafari=t.indexOf("safari")>=0&&t.indexOf("chrome")<0?!0:!1},n._isSafari=null,n._usingXDomainRequest=null,n}();n.Utils=t}(sct||(sct={})),function(n){(function(n){(function(n){(function(t){var i=function(){function n(){}return n.GetGuid=function(){var n=function(){return Math.floor((1+Math.random())*65536).toString(16).substring(1,5)};return[n(),n(),"-",n(),n(),"-",n(),"-",n(),n()].join("")},n.GetTimeStamp=function(){var t=(new Date).getTime(),n=new Microsoft.Bond.Int64("0");return n.low=t&4294967295,n.high=Math.floor(t/4294967296),n},n.GetTimeStampWithValue=function(n){var t=new Microsoft.Bond.Int64("0");return t.low=n&4294967295,t.high=Math.floor(n/4294967296),t},n}(),o,s,h,r,u,f,e;t.utils=i,function(n){n[n.NotSet=0]="NotSet";n[n.Event=1]="Event";n[n.PerformanceCounter=2]="PerformanceCounter";n[n.Anomaly=3]="Anomaly";n[n.Prediction=4]="Prediction";n[n.TraceLog=5]="TraceLog";n[n.EventSourceLog=6]="EventSourceLog";n[n.HttpLog=7]="HttpLog";n[n.PerformanceCounterAzure=8]="PerformanceCounterAzure";n[n.PerformanceCounterGfs=9]="PerformanceCounterGfs"}(t.RecordType||(t.RecordType={}));o=t.RecordType,function(n){n[n.NotSet=0]="NotSet";n[n.O365=1]="O365";n[n.SkypeBI=2]="SkypeBI";n[n.SkypeData=3]="SkypeData"}(t.PIIScrubber||(t.PIIScrubber={}));s=t.PIIScrubber,function(n){n[n.NotSet=0]="NotSet";n[n.DistinguishedName=1]="DistinguishedName";n[n.GenericData=2]="GenericData";n[n.IPV4Address=3]="IPV4Address";n[n.IPv6Address=4]="IPv6Address";n[n.MailSubject=5]="MailSubject";n[n.PhoneNumber=6]="PhoneNumber";n[n.QueryString=7]="QueryString";n[n.SipAddress=8]="SipAddress";n[n.SmtpAddress=9]="SmtpAddress";n[n.Identity=10]="Identity";n[n.Uri=11]="Uri";n[n.Fqdn=12]="Fqdn";n[n.IPV4AddressLegacy=13]="IPV4AddressLegacy"}(t.PIIKind||(t.PIIKind={}));h=t.PIIKind;r=function(){function n(){this.ScrubType=0;this.Kind=0;this.RawContent=""}return n.prototype.Write=function(n){this.WriteImpl(n,!1)},n.prototype.WriteImpl=function(n,t){n.WriteStructBegin(null,t);this.ScrubType!=0?(n.WriteFieldBegin(16,1,null),n.WriteInt32(this.ScrubType),n.WriteFieldEnd()):n.WriteFieldOmitted(16,1,null);this.Kind!=0?(n.WriteFieldBegin(16,2,null),n.WriteInt32(this.Kind),n.WriteFieldEnd()):n.WriteFieldOmitted(16,2,null);this.RawContent!=""?(n.WriteFieldBegin(9,3,null),n.WriteString(this.RawContent),n.WriteFieldEnd()):n.WriteFieldOmitted(9,3,null);n.WriteStructEnd(t)},n.prototype.Read=function(n){this.ReadImpl(n,!1)},n.prototype.ReadImpl=function(){},n}();t.PII=r;u=function(){function t(){this.Id=i.GetGuid();this.Timestamp=i.GetTimeStamp();this.Type="";this.EventType="";this.Extension=new Microsoft.Bond.Collections.Map;this.RecordType=0;this.PIIExtensions=new Microsoft.Bond.Collections.Map}return t.prototype.AddOrReplacePII=function(t,i,r){var u=new n.datamodels.PII;u.RawContent=i;u.Kind=r;u.ScrubType=1;this.PIIExtensions.AddOrReplace(t,u)},t.prototype.Write=function(n){this.WriteImpl(n,!1)},t.prototype.WriteImpl=function(n,t){var i,r;if(n.WriteStructBegin(null,t),this.Id!=""?(n.WriteFieldBegin(9,1,null),n.WriteString(this.Id),n.WriteFieldEnd()):n.WriteFieldOmitted(9,1,null),this.Timestamp.Equals("0")?n.WriteFieldOmitted(17,3,null):(n.WriteFieldBegin(17,3,null),n.WriteInt64(this.Timestamp),n.WriteFieldEnd()),this.Type!=""?(n.WriteFieldBegin(9,5,null),n.WriteString(this.Type),n.WriteFieldEnd()):n.WriteFieldOmitted(9,5,null),this.EventType!=""?(n.WriteFieldBegin(9,6,null),n.WriteString(this.EventType),n.WriteFieldEnd()):n.WriteFieldOmitted(9,6,null),this.Extension.Count()){for(n.WriteFieldBegin(13,13,null),n.WriteMapContainerBegin(this.Extension.Count(),9,9),i=0;i<this.Extension.GetBuffer().length;++i)n.WriteString(this.Extension.GetBuffer()[i].Key),n.WriteString(this.Extension.GetBuffer()[i].Value);n.WriteContainerEnd();n.WriteFieldEnd()}else n.WriteFieldOmitted(13,13,null);if(this.RecordType!=0?(n.WriteFieldBegin(16,24,null),n.WriteInt32(this.RecordType),n.WriteFieldEnd()):n.WriteFieldOmitted(16,24,null),this.PIIExtensions.Count()){for(n.WriteFieldBegin(13,30,null),n.WriteMapContainerBegin(this.PIIExtensions.Count(),9,10),r=0;r<this.PIIExtensions.GetBuffer().length;++r)n.WriteString(this.PIIExtensions.GetBuffer()[r].Key),this.PIIExtensions.GetBuffer()[r].Value.WriteImpl(n,!1);n.WriteContainerEnd();n.WriteFieldEnd()}else n.WriteFieldOmitted(13,30,null);n.WriteStructEnd(t)},t.prototype.Read=function(n){this.ReadImpl(n,!1)},t.prototype.ReadImpl=function(){},t}();t.Record=u;f=function(){function n(){this.Source="";this.DataPackageId="";this.Timestamp=new Microsoft.Bond.Int64("0");this.Records=[]}return n.prototype.Write=function(n){this.WriteImpl(n,!1)},n.prototype.WriteImpl=function(n,t){if(n.WriteStructBegin(null,t),this.Source!=""?(n.WriteFieldBegin(9,2,null),n.WriteString(this.Source),n.WriteFieldEnd()):n.WriteFieldOmitted(9,2,null),this.DataPackageId!=""?(n.WriteFieldBegin(9,5,null),n.WriteString(this.DataPackageId),n.WriteFieldEnd()):n.WriteFieldOmitted(9,5,null),this.Timestamp.Equals("0")?n.WriteFieldOmitted(17,6,null):(n.WriteFieldBegin(17,6,null),n.WriteInt64(this.Timestamp),n.WriteFieldEnd()),this.Records.length){n.WriteFieldBegin(11,8,null);n.WriteContainerBegin(this.Records.length,10);for(var i=0;i<this.Records.length;++i)this.Records[i].WriteImpl(n,!1);n.WriteContainerEnd();n.WriteFieldEnd()}else n.WriteFieldOmitted(11,8,null);n.WriteStructEnd(t)},n.prototype.Read=function(n){this.ReadImpl(n,!1)},n.prototype.ReadImpl=function(){},n}();t.DataPackage=f;e=function(){function n(){this.DataPackages=[];this.RequestRetryCount=0}return n.prototype.Write=function(n){this.WriteImpl(n,!1)},n.prototype.WriteImpl=function(n,t){if(n.WriteStructBegin(null,t),this.DataPackages.length){n.WriteFieldBegin(11,1,null);n.WriteContainerBegin(this.DataPackages.length,10);for(var i=0;i<this.DataPackages.length;++i)this.DataPackages[i].WriteImpl(n,!1);n.WriteContainerEnd();n.WriteFieldEnd()}else n.WriteFieldOmitted(11,1,null);this.RequestRetryCount!=0?(n.WriteFieldBegin(16,2,null),n.WriteInt32(this.RequestRetryCount),n.WriteFieldEnd()):n.WriteFieldOmitted(16,2,null);n.WriteStructEnd(t)},n.prototype.Read=function(n){this.ReadImpl(n,!1)},n.prototype.ReadImpl=function(){},n}();t.ClientToCollectorRequest=e})(n.datamodels||(n.datamodels={}));var t=n.datamodels})(n.telemetry||(n.telemetry={}));var t=n.telemetry})(n.applications||(n.applications={}));var t=n.applications}(microsoft||(microsoft={})),function(n){(function(n){(function(n){(function(t){var h,c,i,u,f,r,e,o,s;(function(n){n[n.SENT=0]="SENT";n[n.SEND_FAILED=1]="SEND_FAILED"})(t.CallbackEventType||(t.CallbackEventType={}));h=t.CallbackEventType,function(n){n[n.DATARV_ERROR_OK=0]="DATARV_ERROR_OK";n[n.DATARV_ERROR_INVALID_EVENT=1]="DATARV_ERROR_INVALID_EVENT";n[n.DATARV_ERROR_INVALID_CONFIG=2]="DATARV_ERROR_INVALID_CONFIG";n[n.DATARV_ERROR_INVALID_DEPENDENCIES=3]="DATARV_ERROR_INVALID_DEPENDENCIES";n[n.DATARV_ERROR_INVALID_STATUS=4]="DATARV_ERROR_INVALID_STATUS";n[n.DATARV_ERROR_INVALID_ARG=5]="DATARV_ERROR_INVALID_ARG"}(t.DATARV_ERROR||(t.DATARV_ERROR={}));c=t.DATARV_ERROR;i=function(){function n(n){this._errorCode=0;this._errorCode=n}return n.prototype.ErrorCode=function(){return this._errorCode},n.prototype.toString=function(){switch(this._errorCode){case 0:return"DATARV_ERROR_OK";case 1:return"Event is invalid. Either event.Id is empty, or event.Timestamp is empty, or event.EventType is empty.";case 2:return"Invalid configuration. CollectorUrl is missing.";case 3:return"DATARV_ERROR_INVALID_DEPENDENCIES";case 4:return"Telemetry Manager is not initialized.";case 5:return"TenantToken is null or empty, or events is null.";default:return"Unknown error"}},n}();t.Exception=i;u=function(){function n(){}return n}();t.TelemetryConfig=u;f=function(){function n(){}return n.CreateTelemetryManager=function(){return new o},n}();t.TelemetryManagerFactory=f;r=function(){function n(){}return n.MaxPackageSizeInBytes=function(){return 3e6},n.TimeIntervalForNextSendInMS=function(){return 2e3},n}(),function(n){n[n.Created=0]="Created";n[n.Initialized=1]="Initialized";n[n.Started=2]="Started"}(e||(e={}));o=function(){function t(){this._MaxPackageSizeInBytes=r.MaxPackageSizeInBytes();this._listeners=[];this._status=0;this._ecsClient=null;this._etag=null;this._ecsCallback=null;this._testServerResponseHook=null}return t.prototype.Initialize=function(n){if(this._status!=0)throw new i(4);if(!n||!n.collectorUrl)throw new i(2);this._config=n;this._Reset();this._status=1;n.ecsClient&&(this._Verbose("ECS object assigned. Do integration"),this._ecsClient=n.ecsClient);this._Verbose("Initialize() done")},t.prototype.AddListener=function(n){if(this._status<1)throw new i(4);this._Verbose(["AddListener(), status: ",this._status," old length: ",this._listeners.length," func: ",n].join(""));for(var t=0;t<this._listeners.length;++t)if(this._listeners[t]==n){this._Verbose("the listener has been added already, index: "+t);return}this._listeners.push(n);this._Verbose("AddListener() done, the new length: "+this._listeners.length)},t.prototype.RemoveListener=function(n){if(this._status<1)throw new i(4);this._Verbose(["RemoveListener(), status: ",this._status," old length: ",this._listeners.length," func: ",n].join(""));for(var t=0;t<this._listeners.length;++t)if(this._listeners[t]==n){this._listeners.length==1?this._listeners=[]:t==this._listeners.length-1?this._listeners.pop():this._listeners[t]=this._listeners.pop();this._Verbose(["this listener has been found, index: ",t,"new length: ",this._listeners.length].join(""));return}this._Verbose("listener isn't been found, new length"+this._listeners.length)},t.prototype.Start=function(){if(this._status<1)throw new i(4);this._Verbose(["Start(), status:",this._status,"tag:",t._tag].join(" "));this._status>=2&&this._Verbose("Start() already, ignore");this._ecsClient&&(this._ecsCallback=this._CreateEcsCallback(),this._ecsClient.AddListener(this._ecsCallback),this._etag=this._ecsClient.GetETag());++t._tag;this._status=2;this._Verbose(["Start() done, status: ",this._status,"tag: ",t._tag].join(""))},t.prototype.Stop=function(){if(this._status<1)throw new i(4);if(this._Verbose("Stop(), status: "+this._status),this._status==1){this._Verbose("Stop() already, ignore");return}this._Reset();this._status=1;this._Verbose("Stop() done, status: "+this._status)},t.prototype.SendAsync=function(n,r){if(this._status<1)throw new i(4);if(this._Verbose(["SendAsync(), status:",this._status,"tenantToken:",n,"count:",r.length].join(" ")),this._status<2)return this._Info("SendAsync(), not started, ignore, return false"),!1;if(!n||!r){this._Error("SendAsync(), tenantToken or events is null or empty");throw new i(5);}for(var u=0;u<r.length;++u)if(!r[u].Id||!t._eventTypeRegex.test(r[u].EventType)||r[u].Timestamp.Equals("0")){this._Error(["eventId:",r[u].Id,"eventType:",r[u].EventType,"timestamp high:",r[u].Timestamp.high,"timestamp low:",r[u].Timestamp.low].join(""));throw new i(1);}return this._eventsCache.AddEvents(n,r),this._Verbose(["SendAsync(), currentTimer: ",this._timer,"eventsCacheIsEmpty",this._eventsCache.IsEmpty()].join(" ")),this._eventsCache.IsEmpty()||this._timer||this._ScheduleTimer(!1),this._Verbose("SendAsync() done"),!0},t.prototype._WorkThread=function(){var e=this,n,i,f,r,u;try{if(this._Verbose("_WorkThread, status: "+this._status),this._status<2){this._Verbose("_WorkThread, status is not started, return");return}if(n=this._eventsCache.DequeuEvents(),n==null){this._Verbose("_WorkThread, No events found, return");this._CleanTimer();return}if(i=this._PackEvents(n.tenantToken,n.events),this._eventsCache.AddEvents(n.tenantToken,i.remainedEvents),this._testServerResponseHook){f=this._testServerResponseHook();setTimeout(this._SendCallback(u,n.tenantToken,i.sendEvents,f),100);return}r={type:"POST",url:this._config.collectorUrl,processData:!1,headers:{"content-type":"application/bond-compact-binary","Client-ID":"NO_AUTH"},complete:function(t){return e._SendCallback(u,n.tenantToken,i.sendEvents,t)}};sct.Utils.IsSafari()||typeof Uint8Array=="undefined"?(this._Verbose("Uint8Array is undefined, send with base64 encode."),r.data=Microsoft.Bond.Encoding.Base64.GetString(i.buffer),r.headers={"content-type":"application/bond-compact-binary","content-encoding":"base64","Client-ID":"NO_AUTH"}):(this._Verbose("Uint8Array is defined, send with binary format directly."),r.data=new Uint8Array(i.buffer));n.tenantToken&&(r.headers["x-apikey"]=n.tenantToken);u=t._tag;this._lastActiveTime=(new Date).getTime();sct.Utils.ajax(r);this._Verbose("_Workthread, send via jquery, tag: "+u)}catch(o){this._Error("_WorkThread, exception: "+o)}},t.prototype._PackEvents=function(t,i){var e,u,f,r,o;for(this._Verbose("_PackageEvents, total Count: "+i.length),e=new n.datamodels.ClientToCollectorRequest,u=new n.datamodels.DataPackage,u.Source="JS_default_source",u.DataPackageId=n.datamodels.utils.GetGuid(),u.Timestamp=n.datamodels.utils.GetTimeStamp(),r=i,i=[];;){if(u.Records=[],u.Records.push.apply(u.Records,r),e.DataPackages=[],e.DataPackages.push(u),f=this._Serialize(e),this._Verbose(["_PackageEvents, sendEvents.length:",r.length,"buffer.length:",f.length,"MaxPackageSize:",this._MaxPackageSizeInBytes].join("")),r.length==1||f.length<this._MaxPackageSizeInBytes)break;o=r.splice(0,Math.floor(r.length/2));this._Verbose("_PackageEvents, too large, package again");i.push.apply(i,r);r=o}return this._Verbose(["_PakcageEvents done, sendEventsCount:",r.length,"buffer.length:",f.length,"remained events:",i.length].join("")),{buffer:f,sendEvents:r,remainedEvents:i}},t.prototype._Serialize=function(n){var t=new Microsoft.Bond.IO.MemoryStream,i=new Microsoft.Bond.CompactBinaryProtocolWriter(t);return n.Write(i),t.GetBuffer()},t.prototype._SendCallback=function(n,i,r,u){var e,f;if(this._Verbose(["_SendCallback","tag:",n,"current tag:",t._tag,"tenantToken:",i,"events count:",r.length,"jqXHR:",u].join("")),e=u!=null&&u.status>=200&&u.status<300,this._status<2||n<t._tag){this._Verbose("_SendCallback, is not started, or tag is not the same, return");return}if(!e&&(!u||u.status&&u.status!=400)){this._Verbose("retry statusCode: "+(u?u.status:0));this._eventsCache.AddEvents(i,r);this._ScheduleTimer(!0);return}for(f=0;f<this._listeners.length;++f)this._listeners[f](e?0:1,u?u.status:0,i,r);this._eventsCache.IsEmpty()?(this._Verbose("eventsCache is empty, stop schedule"),this._CleanTimer()):(this._Verbose("eventsCache is not empty, schedule for next run"),this._ScheduleTimer(!1))},t.prototype._CleanTimer=function(){this._Verbose("_CleanTimer(), timer: "+this._timer);this._timer&&(clearTimeout(this._timer),this._timer=null)},t.prototype._ScheduleTimer=function(n){var i=this,t;if(this._Verbose("_ScheduleTimer: isRetry: "+n),this._CleanTimer(),n)this._Verbose("_ScheduleTimer, current factor: "+this._rescheduleFactor),t=Math.floor(5*this._rescheduleFactor*(1+Math.random())),this._timer=setTimeout(function(){return i._WorkThread()},t*1e3),this._Verbose("_ScheduleTimer, next try (s): "+t),this._rescheduleFactor<<=1,this._rescheduleFactor>64&&(this._rescheduleFactor=1);else{var t=0,f=(new Date).getTime(),u=f-this._lastActiveTime;t=u>r.TimeIntervalForNextSendInMS()?0:r.TimeIntervalForNextSendInMS()-u;this._timer=setTimeout(function(){return i._WorkThread()},t);this._Verbose("_ScheduleTimer, next try: "+t);this._rescheduleFactor=1}},t.prototype._Verbose=function(n){this._config.log&&this._config.log.Verbose("[TelemetryManagerImpl]: "+n)},t.prototype._Info=function(n){this._config.log&&this._config.log.Info("[TelemetryManagerImpl]: "+n)},t.prototype._Error=function(n){this._config.log&&this._config.log.Error("[TelemetryManagerImpl]: "+n)},t.prototype._Reset=function(){this._Verbose("Reset()");this._CleanTimer();this._lastActiveTime=0;this._rescheduleFactor=1;this._sendingEvents=[];this._eventsCache=new s;this._ecsClient&&(this._ecsClient.RemoveListener(this._ecsCallback),this._ecsCallback=null)},t.prototype._CreateEcsCallback=function(){var n=this;return function(t){t==0&&(n._etag=n._ecsClient.GetETag())}},t.prototype.__GetListenerArray=function(){return this._listeners},t.prototype.__GetTotalEventsCount=function(){return this._eventsCache.GetTotalEventsCount()},t.prototype.__IsScheduled=function(){return this._timer!=null},t.prototype.__ChageMaxPackageSizeInKB=function(n){this._MaxPackageSizeInBytes=n*1024},t.prototype.__SetTestServerResponseHook=function(n){this._testServerResponseHook=n},t._eventTypeRegex=/^[a-zA-Z0-9]([a-zA-Z0-9]|_){2,98}[a-zA-Z0-9]$/,t._tag=0,t}();s=function(){function n(){this._events={};this._tokens=[]}return n.prototype.AddEvents=function(n,t){t.length&&(this._events[n]||(this._events[n]=[],this._tokens.push(n)),this._events[n].push.apply(this._events[n],t))},n.prototype.IsEmpty=function(){return this._tokens.length==0},n.prototype.DequeuEvents=function(){if(this._tokens.length==0)return null;var n=this._tokens.shift(),t=this._events[n];return delete this._events[n],{tenantToken:n,events:t}},n.prototype.GetTotalEventsCount=function(){var n=0;for(var t in this._events)n+=this._events[t].length;return n},n}()})(n._sender||(n._sender={}));var t=n._sender})(n.telemetry||(n.telemetry={}));var t=n.telemetry})(n.applications||(n.applications={}));var t=n.applications}(microsoft||(microsoft={})),function(n){(function(n){(function(n){var t=n._sender.TelemetryManagerFactory.CreateTelemetryManager(),r=function(){function r(){}return r.initialize=function(n){if(!this._initialized){if(!n)throw new i(1);this._defaultToken=n;this._config.collectorUrl||(this._config.collectorUrl="https://pipe.skype.com/Collector/3.0/");t.Initialize(this._config);t.Start();this._initialized=!0}},r.addCallbackListener=function(n){this._initialized&&t.AddListener(n)},r.isInitialized=function(){return this._initialized},r.getDefaultToken=function(){return this._defaultToken},r.__setCollectorUrlToInt=function(){this._config.collectorUrl="https://pipe.int.trafficmanager.net/Collector/3.0/"},r.__backToUninitialized=function(){this._config=new n._sender.TelemetryConfig;t=n._sender.TelemetryManagerFactory.CreateTelemetryManager();this._initialized=!1},r._initialized=!1,r._defaultToken=null,r._config=new n._sender.TelemetryConfig,r}(),f,u,e,o,i;n.LogManager=r;f=function(){function f(t){this._initId=n.datamodels.utils.GetGuid();this._sequence=0;this._tenantToken=null;this._contextProperties=new u;this._tenantToken=t?t:r.getDefaultToken()}return f.prototype.logEvent=function(n){if(r.isInitialized()){if(!n.name)throw new i(2);var t=this._createEventRecord(n.name,"Custom");this._addCustomPropertiesToEvent(t,n);this._sendRecord(t)}},f.prototype.setContext=function(n,t,i){this._contextProperties.setProperty(n,t,i)},f.prototype._createEventRecord=function(t,i){var r=new n.datamodels.Record,u;return r.EventType=t.toString().toLowerCase(),r.Type=i,r.Extension.Add("EventInfo.Source","JS_default_source"),r.Extension.Add("EventInfo.InitId",this._initId),this._sequence++,r.Extension.Add("EventInfo.Sequence",this._sequence.toString()),r.Extension.Add("EventInfo.Name",t.toString().toLowerCase()),u=new Date,r.Timestamp=n.datamodels.utils.GetTimeStampWithValue(u.getTime()),r.Extension.Add("EventInfo.Time",u.toISOString()),r.Extension.Add("EventInfo.SdkVersion","ACT-JS-"+clienttelemetry_build.version),r},f.prototype._addCustomPropertiesToEvent=function(n,t){this._addEventPropertiesToEvent(n,this._contextProperties);this._addEventPropertiesToEvent(n,t)},f.prototype._addEventPropertiesToEvent=function(t,i){var r,u;if(i.timestamp&&i.timestamp>=new Date("1/1/2000").getTime()&&(t.Timestamp=n.datamodels.utils.GetTimeStampWithValue(i.timestamp),t.Extension.AddOrReplace("EventInfo.Time",new Date(i.timestamp).toISOString())),r=i.properties,r&&r.length>0)for(u=0;u<r.length;u++)r[u].key&&typeof r[u].key=="string"&&r[u].value&&typeof r[u].value=="string"&&(this._isPii(r[u].pii)?(t.AddOrReplacePII(r[u].key,r[u].value,r[u].pii),t.Extension.Remove(r[u].key)):(t.Extension.AddOrReplace(r[u].key,r[u].value),t.PIIExtensions.Remove(r[u].key)))},f.prototype._isPii=function(t){var i,r;if(t==(null||undefined||0))return!1;i=!1;for(r in n.datamodels.PIIKind)isNaN(r)||r==t&&(i=!0);return i},f.prototype._sendRecord=function(n){t.SendAsync(this._tenantToken,[n])},f}();n.Logger=f;u=function(){function n(){this.name=null;this.timestamp=null;this.properties=[]}return n.prototype.setProperty=function(t,r,u){if(!t||!n._propertyNameRegex.test(t))throw new i(3);r&&(u?this.properties.push({key:t,value:r.toString(),pii:u!=0?u:null}):this.properties.push({key:t,value:r.toString(),pii:null}))},n._propertyNameRegex=/^[a-zA-Z0-9](([a-zA-Z0-9|_|.]){0,98}[a-zA-Z0-9])?$/,n}();n.EventProperties=u;e=function(){function n(){this.key=null;this.value=null;this.pii=null}return n}();n.Property=e,function(n){n[n.INVALID_TENANT_TOKEN=1]="INVALID_TENANT_TOKEN";n[n.MISSING_EVENT_PROPERTIES_NAME=2]="MISSING_EVENT_PROPERTIES_NAME";n[n.INVALID_PROPERTY_NAME=3]="INVALID_PROPERTY_NAME"}(n.TelemetryError||(n.TelemetryError={}));o=n.TelemetryError;i=function(){function n(n){this.errorCode=null;this.errorCode=n}return n.prototype.ErrorCode=function(){return this.errorCode},n.prototype.toString=function(){switch(this.errorCode){case 1:return"Invalid tenant token";case 2:return"Eventproperties.name can not be null or empty";case 3:return"Invalid Key. Key does not conform to regular expression ^[a-zA-Z0-9]([a-zA-Z0-9]|_|.){2,198}[a-zA-Z0-9]$";default:return"Unknown error"}},n}();n.Exception=i})(n.telemetry||(n.telemetry={}));var t=n.telemetry})(n.applications||(n.applications={}));var t=n.applications}(microsoft||(microsoft={}))