_G = window["_G"] || {}; if (!_G.IG) { _G.IG = "3139594c979f425da0ec4c81a6a587371" || Msn.track.trackInfo.userStatic.clientRequestId(); } _G.lsUrl = "/fd/ls/l?IG=" + _G.IG;;var _w=window,_d=document,sb_ie=window.ActiveXObject!==undefined,sb_i6=sb_ie&&!_w.XMLHttpRequest,_ge=function(n){return _d.getElementById(n)},_qs=function(n,t){return t=typeof t=="undefined"?_d:t,t.querySelector?t.querySelector(n):null},sb_st=function(n,t){return setTimeout(n,t)},sb_rst=sb_st,sb_ct=function(n){clearTimeout(n)},sb_gt=function(){return(new Date).getTime()},sj_gx=function(){return sb_i6?new ActiveXObject("MSXML2.XMLHTTP"):new XMLHttpRequest};_w.sj_ce=function(n,t,i){var r=_d.createElement(n);return t&&(r.id=t),i&&(r.className=i),r};_w.sj_cook={get:function(n,t){var i=_d.cookie.match(new RegExp("\\b"+n+"=[^;]+")),r;return t&&i?(r=i[0].match(new RegExp("\\b"+t+"=([^&]*)")),r?r[1]:null):i?i[0]:null}};_w.sk_merge||(_w.sk_merge=function(n){_d.cookie=n});function sj_be(n,t,i,r){if((n==_w||n==_d.body)&&t=="load"&&"undefined"!=typeof _d.readyState&&"complete"===_d.readyState){i();return}n.addEventListener?n.addEventListener(t,i,r):n.attachEvent?n.attachEvent("on"+t,i):n["on"+t]=i}function sj_ue(n,t,i,r){n.removeEventListener?n.removeEventListener(t,i,r):n.detachEvent?n.detachEvent("on"+t,i):n["on"+t]=null}function sj_ev(n){return sb_ie?event:n}function sj_et(n){return sb_ie?event.srcElement:n.target}function sj_pd(n){n&&n.preventDefault?n.preventDefault():event.returnValue=!1}function sj_sp(n){n&&n.stopPropagation?n.stopPropagation():event.cancelBubble=!0}function sj_ic(n){var t=sj_ce("style");_d.getElementsByTagName("head")[0].appendChild(t);t.textContent!==undefined?t.textContent=n:t.styleSheet.cssText=n}var Bing;(function(n){var t;(function(){var t=function(){function n(){this._hash={}}return n.prototype.register=function(n){return this._hash[n]||(this._hash[n]=[])},n.prototype.fire=function(n){for(var t,u,i,f=[],r=1;r0&&(n.className+=" ");n.className+=t}}function k(n,t){return n?n.replace(o,function(n,i){return t[i]}):n}function d(n,t){var i=t.replace(/\s+$/g,"");return t[t.length-1]==" "&&n.length>0&&ut(t,i,n[0])?i:t}function f(n,t){if(!n||!t||t===n)return!1;while(n&&t!==n)n=n.parentElement;return t==n}function g(n,t,i){var u=e.exec(t);if(!u||!u[1])throw new Error("Given text format doesn't contain link markup");r(i,u[1]);r(n,sa_loc.SearchRemoved);n.innerHTML=n.innerHTML.replace("%e"+i.innerHTML+"%E",rt(i))}function nt(n,t,i,r){var u,f;return i===void 0&&(i=null),r===void 0&&(r=!1),u=_d.createElement("span"),u.textContent=t,u.style.visibility="hidden",i&&(u.style.fontSize=i),r&&(u.style.fontWeight="bold"),n.appendChild(u),f=u.offsetWidth,n.removeChild(u),f}function tt(n,t,i){try{return n()}catch(r){return i&&i(),t}}function it(n){return n?"Bearer "+n:""}function rt(n){var t=sj_ce("div");return t.appendChild(n),t.innerHTML}function ut(n,t,i){return n==i.substr(0,n.length)||t==i}function t(n){var t=Math.abs(Math.floor(n));return(t<10?"0":"")+t}function ft(){var n=new Date,i=-n.getTimezoneOffset(),r=i>=0?"+":"-";return n.getFullYear()+"-"+t(n.getMonth()+1)+"-"+t(n.getDate())+"T"+t(n.getHours())+":"+t(n.getMinutes())+":"+t(n.getSeconds())+"."+t(n.getMilliseconds())+r+t(i/60)+":"+t(i%60)}function et(t,i,r,u){var e,f;if(!t||!i||!r)return"";e=encodeURIComponent(i);f={triggeringMode:"Explicit",intent:r};u&&(f.entityId=u);var s=JSON.stringify(f),h=encodeURIComponent(s),o=n.formatString(t.bfbSearchUrl,[e,h,t.bfbfrmcde]);return _G&&_G.IG?o+"&cvid="+encodeURIComponent(_G.IG):o}var i="textContent",u="innerText",e=/%e([^%]+)%E/,o=/{([0-9]+)}/g;n.GetTextContent=s;n.SetTextContent=r;n.GetComputedStyle=h;n.GetQueryStringParam=c;n.SetSelectionRange=l;n.RewriteAttribsToProps=a;n.GetMouseCoords=v;n.MouseEnterLeave=y;n.getCursorPosition=p;n.RemoveClassName=w;n.AddClassName=b;n.formatString=k;n.TrimmedQueryFromSuggestions=d;n.isChildOf=f;n.SetTextContentWithLink=g;n.CalcWidth=nt;n.safeExecute=tt;n.getBearerTokenHeader=it;n.getDateWithTimezone=ft;n.buildBfbSearchUrl=et})(t=n.Utils||(n.Utils={}))})(t=n.AS||(n.AS={}))})(Bing||(Bing={}));var Bing;(function(n){var t;(function(n){var t=function(){function n(){this._eventRegistry=[]}return n.prototype.registerEvents=function(n){this._eventRegistry.push(n)},n.prototype.raiseEvent=function(n){for(var i,r,f,u=[],t=1;t0&&(this.msbNtpKeyStrokeMaxRetry--,this.raiseEvent(21))),s=function(t,f){var h=n.BingAtWorkTemplateManager.generateHtml(e.config,t,u,e.config.isMsbInline),s;t.length&&(e.config.isEdgeNtp?e.raiseEvent(9,u,r):(e._instrumentation&&e._instrumentation.instrumentResponseReceived(i.BingAtWork,r,o),e._bingAtWorkWebTelemetry&&e._bingAtWorkWebTelemetry.logPerf("BAWSuggestions")));e._instrumentation&&e._instrumentation.instrumentDataSource(i.BingAtWork,t,r,f);e.canvas.render(h,e.currentQuery,r,i.BingAtWork);h&&(!e.config.isEdgeNtp&&e._instrumentation&&e._instrumentation.updateRendered(r),e._bingAtWorkWebTelemetry&&(s=n.BingAtWorkTemplateManager.getTenantConfig(),e._bingAtWorkWebTelemetry.setContext({traceId:f.TraceID,tenantName:s?s.displayName:"",tenantId:e.config.bawTenantId}),t.forEach(function(n){e._bingAtWorkWebTelemetry.logShown(n.id)})))},this._bingAtWorkSuggestionsParser.parse(u,t,r,s)))},s.prototype.getAllSuggestionInstUrl=function(n,t){for(var u,f,o=this.getInstrumentationKeys(t),i=[],r=0,e=o;r-1&&this._instrumentation.finalizeKeystroke(this._requestSequence)},s.prototype.fetch=function(n){this.finalizeKeystroke();this._requestSequence++;this._instrumentation&&this._instrumentation.beginRequest(this._requestSequence);this.fetchWeb(n,this._requestSequence,!1);this.config.msbqc&&this.isMsbCachingBundleReady?this.fetchMsb(n,this._requestSequence):this.config.msbqc||this.fetchBingAtWork(n,this._requestSequence);this.config.msbSusE&&this.fetchSubstrate(n,this._requestSequence)},s.prototype.fetchSubstrate=function(t,i){if(this._substrateDataProvider&&this.currentQuery.length>=this.config.bawminqlen){var r=n.BingAtWorkTemplateManager.getTenantConfig();r&&r.displayName&&this._substrateDataProvider.fetch(t,i,!1)}},s.prototype.fetchBingAtWork=function(t,i){if(this._bingAtWorkDataProvider&&this.currentQuery.length>=this.config.bawminqlen){var r=n.BingAtWorkTemplateManager.getTenantConfig();r&&r.displayName?(this.addBawPayload(t),this._bingAtWorkDataProvider.fetch(t,i,!1)):this.config.isEdgeNtp&&this.msbNtpKeyStrokeMaxRetry>0&&(this.msbNtpKeyStrokeMaxRetry--,this.raiseEvent(21))}},s.prototype.fetchMsb=function(t,i){if(this._msbDataProvider&&this.currentQuery.length>=this.config.bawminqlen){var r=n.BingAtWorkTemplateManager.getTenantConfig();r&&r.displayName&&this._msbDataProvider.fetch(t,i)}},s.prototype.addBawPayload=function(n){var r=this.config.bawmax,t,i;this._isBawPayloadAdded?this._bingAtWorkDataProvider.addPostValue("Query",n):(t=["Bookmark","Qna","Building"],this.config.msbSusR||t.push("Person"),i={count:r,domains:t,query:n,conversationId:_G.IG},this._bingAtWorkDataProvider.addBody(i))},s.prototype.onSearchBoxFocusWithRetry=function(n,t,i,r){var u=this;if(t!==this.currentQuery){r&&r();return}this.canvas.searchBoxHasFocus()?i():n<5&&sb_st(function(){u.onSearchBoxFocusWithRetry(n+1,t,i,r)},15)},s.prototype.fetchWeb=function(n,i,r){this._dataProvider.addParam(t.CursorPosition,this._cursorPosition.toString());var u=this._container.parentNode.offsetWidth.toString();this.config.cors?this._dataProvider.addParam("contentWidth",u):this._dataProvider.addHeader("X-Autosuggest-ContentWidth",u);this._receivedAtLeastOnceValidResponse||this._dataProvider.addParam(t.Css,"1");this.config.ezis&&this._originalQuery===n&&this._requestSequence==0&&this._dataProvider.addParam(t.ZeroInputSerp,"1");this.config.pc&&this._dataProvider.addParam("pubcode",this.config.pc);this._dataProvider.fetch(n,i,!0);this.raiseEvent(7,this.currentQuery,i);r||sj_evt.fire("AS.RequestSent",this.currentQuery)},s.prototype.registerAjaxSerpUnloadEvent=function(){var n=this,t=function(i){var u=i&&i[1];u&&u.isInstantRequest||(n._isDisposed=!0,sj_evt.unbind(r,t),n.raiseEvent(17),n.clearEvents())};sj_evt.bind(r,t,!1)},s.prototype.setRawQuery=function(n){this.canvas.updateRawQuery(n)},s.prototype.setQuery=function(n){(this.currentQuery=n,typeof n!="undefined"&&(n.length!=0||this.config.fetchOnEmpty))&&this.fetch(n)},s.prototype.pretechQuery=function(n){this.fetchWeb(n,0,!0)},s.ScopeExtensions=[],s}(n.EventRegisterer);n.WebCore=s})(t=n.AS||(n.AS={}))})(Bing||(Bing={}));var __extends=this&&this.__extends||function(){var n=function(t,i){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])},n(t,i)};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),Bing;(function(n){var t;(function(n){var u=AutoSuggest.Service.QueryParams,t="sa_errorCnt",i=function(){function n(){this._callParams={};this._callHeaders={};this._callBody={}}return n.prototype.fetchUrl=function(){},n.prototype.init=function(n,t,i){this._config=n;this._baseUrl=t;this._callbackFunc=i},n.prototype.addParam=function(n,t){this._callParams[n]=t},n.prototype.addHeader=function(n,t){if(this._config.cors)throw"Custom headers are not allowed for cross domain calls";this._callHeaders[n]=t},n.prototype.addPostValue=function(n,t){this._callBody[n]=t},n.prototype.addBody=function(n){this._callBody=n},n.prototype.fetch=function(n,t,i){this._requestSequence=t;var r=this.getFinalFetchUrl(n);this.fetchUrl(r,n,t,i)},n.prototype.getBaseUrl=function(){return this._baseUrl},n.prototype.isPostCall=function(){return this._callBody&&typeof this._callBody=="object"&&Object.keys(this._callBody).length>0},n.prototype.getFinalFetchUrl=function(n){var i=decodeURIComponent(this.getBaseUrl())+encodeURIComponent(n),t;this.addParam(u.ConversationId,_G.IG);for(t in this._callParams)i+="&"+t+"="+this._callParams[t];return this._callParams={},i},n}(),r;n.DataProviderBase=i;r=function(i){function r(){return i!==null&&i.apply(this,arguments)||this}return __extends(r,i),r.prototype.fetchUrl=function(i,r,u,f){var o=this,e=sj_gx(),s,h;e.open(this.isPostCall()?"POST":"GET",i,!0);for(s in this._callHeaders)e.setRequestHeader(s,this._callHeaders[s]);this._callHeaders={};e.onreadystatechange=function(){var s,n,h;e.readyState==4&&(e.onreadystatechange=function(){},s=void 0,n=e.status,n==200?s=e.responseText:_w[t]&&(n==0||(n/100|0)==4||(n/100|0)==5)&&(s=_w[t]),h=null,f&&(!o._config.cors||o._config.rbhc)&&e.getResponseHeader&&(h=e.getResponseHeader("X-BingQF-BLIS")),o._callbackFunc(s,u,r,i,h,n))};e.withCredentials!==undefined&&(e.withCredentials=!0);this.isPostCall()?(h=n.Utils.safeExecute(function(){return JSON.stringify(o._callBody)},""),e.send(h)):e.send()},r}(i);n.DataProvider=r})(t=n.AS||(n.AS={}))})(Bing||(Bing={}));0;var __extends=this&&this.__extends||function(){var n=function(t,i){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])},n(t,i)};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),Bing;(function(n){var t;(function(n){var o=["MD"],s=["CustomSearch"],h=["previousSibling","nextSibling"],c=["lastChild","firstChild"],r="sa_hv",u=/(\s|^)sa_hv/g,i="data-sugcont",f=n.Utils,t=AutoSuggest.Service.SuggestionAttributes,e=[n.DataSources.BingAtWork,n.DataSources.Substrate,n.DataSources.MicrosoftSearchInBing,n.DataSources.MicrosoftSearchInBingCached],l=function(l){function a(){var n=l.call(this)||this;return n.currentSuggestionList=[],n._ie9orLower=sb_ie&&!_w.atob,n._currentRequestSequence=-1,n._suggestionsQueue={},n}return __extends(a,l),a.prototype.init=function(t,i,r,u){this.autoSuggestInstance=t;this.config=i;this.container=r;this._searchBox=u;this._asContainer=_ge(i.c||"sw_as");var f=new n.EventRegistration(this);f.add(17,this.clearEvents);this.autoSuggestInstance.registerEvents(f)},a.prototype.render=function(t,i,r,u){var a,o,p,k,c,v,l,d,y,w,g,b;for(r>this._currentRequestSequence&&(this._suggestionsQueue={},this._currentQuery=i,this._currentRequestSequence=r),this._suggestionsQueue[u]={suggestions:t,rendered:!1,dataSource:u},a=0;a'+f.suggestions+"<\/div>"),k=this.createDivFromAjaxResponse(f.suggestions),h[0]==f.dataSource&&(this.container.innerHTML="",this.currentSuggestionList=[],this._currentSuggestion=null,this.selectedSuggestion=null,this._searchBox.removeAttribute("aria-activedescendant")),c=void 0,v=this.container.getElementsByTagName("UL"),l=0;l0)this.config.bi&&(d={currentQuery:i,suggestionElements:s,requestSequence:r},sj_evt.fire("AS.SuggestionsRendered",d));else for(y=0,w=h;y0&&this.raiseEvent(10,i,s,r,this.container,f.dataSource);h[h.length-1]==f.dataSource&&this.currentSuggestionList.length==0&&this.raiseEvent(11,i)}}},a.prototype.updateRawQuery=function(n){this._rawQuery=n},a.prototype.buildSuggestions=function(n){var o,s,e,r,h,u,c;if(this._suggestionsContainer=_ge(this.config.slid),this._nextWordRawQuerySize=null,this._largestSuggestion=0,this._nextWordRawQuerySize=1e4,this.containsNextWord=!1,this._suggestionsContainer)for(o=this._suggestionsContainer.getElementsByTagName("li"),s=this.currentSuggestionList.length,e=s;e-1&&(this.containsNextWord=!0,this.config.nwRz&&(u=r.textContent||r.innerText,u&&(c=r.query.replace(u,""),u.length>this._largestSuggestion&&c.length<=this._nextWordRawQuerySize&&(this._largestSuggestion=u.length,this._nextWordRawQuerySize=c.length,this.largestNextWordElement=r))));this.currentSuggestionList.push(r.query);this.decorateSuggestion(r,++s);n.push(r)}},a.prototype.isSuggestionTypeInstrumentationDisabled=function(n){for(var r,t=0,i=o;t-1},a.prototype.cancelEventBubbling=function(n){n=sj_ev(n);sj_sp(n)},a.prototype.highlightSuggestion=function(n){this.unHighlightSuggestionHandler();this._currentSuggestion=n;this.addHighlightClassName(this._currentSuggestion);this._currentSuggestion!=n&&this.addHighlightClassName(n);this._searchBox.setAttribute("aria-activedescendant",n.id);n.setAttribute("aria-selected","true")},a.prototype.unHighlightSuggestionHandler=function(){this._currentSuggestion&&(this.removeHighlightClassName(this._currentSuggestion),this._currentSuggestion.removeAttribute("aria-selected"),this._currentSuggestion=null)},a.prototype.clearSelectedSuggestion=function(){this.setSearchValue();this.unHighlightSuggestionHandler();this._searchBox.removeAttribute("aria-activedescendant")},a.prototype.addHighlightClassName=function(n){u.test(n.className)||(n.className+=" "+r)},a.prototype.removeHighlightClassName=function(n){f.RemoveClassName(n,u)},a.prototype.onMouseDownSuggestion=function(n,t){n=sj_ev(n);var i=n.button;i==2?(this.cancelEventBubbling(n),sj_pd(n)):t.url&&(this.clickedSuggestion=t)},a.prototype.onMouseUpSuggestion=function(n,t){this.clickedSuggestion&&this.clickedSuggestion==t&&(n=sj_ev(n),this.config.ifrpop?this.raiseEvent(23,t,!1,this.config.linkTarget):this.config.clickIco&&this.isClickOnElementWithClass(n,"as_icon")?this.raiseEvent(20,t,sj_et(n)):(this.setSearchValue(this.clickedSuggestion),sj_evt.fire("AS.Navigate",t,"mouseup"),this.raiseEvent(4,t,!1,this.config.linkTarget)),this.clickedSuggestion=null)},a.prototype.searchBoxHasFocus=function(){return _d.activeElement==this._searchBox},a.prototype.setSearchValue=function(n){this.raiseEvent(19,this.selectedSuggestion,n);this.selectedSuggestion=n;var t=this._currentQuery;this.config.trimwsnr&&this._rawQuery&&this._rawQuery[this._rawQuery.length-1]==" "&&(t=t+" ");this.raiseEvent(12,n?n.query:t)},a.prototype.getCssHolder=function(){var n=_ge("ajaxStyles");return n||(n=sj_ce("div"),n.id="ajaxStyles",sj_b.insertBefore(n,sj_b.firstChild)),n},a.prototype.insertScriptIntoDom=function(n){var r=this,t=sj_ce("script"),i;t.type=n.type;i=n.getAttribute("src");i?t.setAttribute("src",i):(t.setAttribute("data-bing-script","1"),t.text=n.innerHTML);n.parentNode.removeChild(n);this._asContainer.appendChild(t);sb_st(function(){r._asContainer.contains(t)&&r._asContainer.removeChild(t)},1)},a.prototype.insertStyleIntoDom=function(t){this._ie9orLower?(sj_ic(t.innerHTML),t.parentNode.removeChild(t)):(t.setAttribute("data-rms","1"),this.autoSuggestInstance.config.bi&&n.Utils.AddClassName(t,"bi_preserve"),this.getCssHolder().appendChild(t))},a.prototype.createDivFromAjaxResponse=function(n){if(!n)return undefined;var t=sj_ce("div");return t.innerHTML=n,t},a.prototype.insertAjaxResponseDivIntoDom=function(n,t,i){var u,f,r;if(t){for(u=_d.createDocumentFragment(),f=t.childNodes;f.length;){r=f[0];switch(r.tagName){case"SCRIPT":this.insertScriptIntoDom(r);break;case"STYLE":this.insertStyleIntoDom(r);break;default:i===null||i>0?(u.appendChild(r),i!=null&&i--):t.removeChild(r)}}n.appendChild(u)}},a}(n.EventRegisterer);n.Canvas=l})(t=n.AS||(n.AS={}))})(Bing||(Bing={}));var Bing;(function(n){var t;(function(n){var t="sa_nw",i=/(\s|^)sa_nw/g,r=function(){function r(t,i,r){this.config=t;this._container=i;this._canvas=r;this._isRtl=n.Utils.GetComputedStyle(sj_b).direction=="rtl";this._isRtl&&this._container.setAttribute("dir","rtl");this._searchBoxElem=_ge(t.i);this._outerContainer=sj_ce("div","","sa_as");this._outerContainer.setAttribute("data-priority","2");this.hide();this._container.appendChild(this._outerContainer)}return r.prototype.getSuggestionsDrawer=function(){return this._outerContainer},r.prototype.show=function(){this._outerContainer.style.display="block"},r.prototype.hide=function(){this._outerContainer.style.display="none"},r.prototype.update=function(){var f,e,r=n.Utils.GetComputedStyle(this._container.parentNode),s,h;if(this.config.eNw&&this.config.nwRz&&this._canvas.containsNextWord&&this._canvas.largestNextWordElement){this.setMargins(0,0);s=n.Utils.GetComputedStyle(this._searchBoxElem);n.Utils.AddClassName(this._outerContainer,t);h=this._outerContainer.style.display;this.setCanvasVisibility("hidden","block");var u=this._canvas.largestNextWordElement,c=n.Utils.GetTextContent(u),o=this.getFirstChild(u),l=u.query.replace(c,""),a=o&&o.innerHTML.indexOf("")>-1,v=n.Utils.CalcWidth(u,o&&o.textContent||c,null,a),y=n.Utils.CalcWidth(u,l,s.fontSize);f=y+4;e=this._outerContainer.offsetWidth-f-v-this.getNwExtraSz(u)-4;this.setCanvasVisibility("",h)}else n.Utils.RemoveClassName(this._outerContainer,i),this._isRtl?(e=(this.toFloat(r.paddingRight)+this.toFloat(r.borderRightWidth))*-1,f=this.toFloat(r.borderLeftWidth)-this.toFloat(r.paddingLeft)):(f=(this.toFloat(r.paddingLeft)+this.toFloat(r.borderLeftWidth))*-1,e=this.toFloat(r.borderRightWidth)-this.toFloat(r.paddingRight));this.setMargins(f,e);this._searchBoxElem!=null&&this._searchBoxElem.dir.length>0&&(this._outerContainer.dir=this._searchBoxElem.dir)},r.prototype.toFloat=function(n){var t=parseFloat(n);return isNaN(t)?0:t},r.prototype.setCanvasVisibility=function(n,t){this._outerContainer.style.visibility=n;this._outerContainer.style.display=t},r.prototype.setMargins=function(n,t){this._container.style.marginLeft=n+"px";this._container.style.marginRight=t+"px"},r.prototype.getFirstChild=function(n){return n&&n.childNodes&&n.childNodes.length>0&&n.childNodes[0]},r.prototype.getNwExtraSz=function(t){var r=this.getFirstChild(t),i;return r?(i=n.Utils.GetComputedStyle(r),this.toFloat(i.marginLeft)*2+this.toFloat(i.borderLeft)+this.toFloat(i.borderRight)):0},r}();n.Layout=r})(t=n.AS||(n.AS={}))})(Bing||(Bing={}));var __extends=this&&this.__extends||function(){var n=function(t,i){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])},n(t,i)};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),Bing;(function(n){var t;(function(n){function r(n){return typeof n=="number"?n:'"'+n.replace(/"/g,'\\"')+'"'}var u="SRCHHPGUSR",f="AS",e=4,t="AS.CurrentImpressionQuerySelected",i=sb_ie&&sb_de.style.opacity===undefined,o=function(o){function s(t,i){var r=o.call(this)||this,u,f,e;for(r.config=t,r.autosuggest=i,r._pollInterval=0,r._pendingRequestCount=0,r._bRequeryOnTextChange=!0,r._hiddenFields=[],r._lastQuery="",r._lastRawQuery="",r._trimRegex=new RegExp("^\\s*","g"),r._removeSpacesRegex=new RegExp("\\s+","g"),r._lastTextChanged="",r._textChangeSequence=0,r.searchBoxTouchAction=function(){r.config.handleDuplicateFetch&&r._lastClickQuery==r.getCurrentQuery(!0)||(_d.activeElement!==r.searchBox&&r.searchBox.focus(),r.onSearchBoxClick(),r._lastClickQuery=r.getCurrentQuery(!0))},r.searchBoxClickAction=function(){r._lastClickQuery!=r.getCurrentQuery(!0)&&(r.searchBox.focus(),r.config.handleDuplicateFetch&&(r._lastClickQuery=r.getCurrentQuery(!0)),r.onSearchBoxClick());r.config.handleDuplicateFetch||(r._lastClickQuery=null)},r.onSubmit=function(n){var i,t;if(r.cancelDefaultHandler(n),r.isEmptyQuery()){i=_w._H&&_w._H.sbeb;i&&sb_st(function(){return r.hideDropDown(2)},5);return}sb_st(function(){return r.hideDropDown(2)},5);t=r.autosuggest.canvas.selectedSuggestion;sj_evt.fire("AS.Navigate",t,"submit");t?r.navigate(t,!0,r.config.linkTarget):r.submitForm(!0)},r.onSearchBoxKeyDown=function(t){var i=t.keyCode;switch(i){case 27:r.isQueryGhosted()||(r.hideDropDown(1),r.cancelDefaultHandler(t));break;case 38:r._isLayoutVisible&&(r.autosuggest.canvas.selectItem(0),r.cancelDefaultHandler(t));break;case 40:r._isLayoutVisible?r.autosuggest.canvas.selectItem(1):r.config.fetchOnDownArrowKey&&r.fetchForCurrentQuery();break;case 9:r.isQueryGhosted()||(r.config.removeSuggUrl?sb_st(function(){var t=_d.activeElement;t!=r.searchBox&&(n.Utils.isChildOf(t,r.autosuggest.canvas.container)?r.autosuggest.canvas.clearSelectedSuggestion():r.hideDropDownOnFocusChange())},0):r.hideDropDownOnFocusChange())}},r.onSearchBoxClick=function(){r._isLayoutVisible||r.fetchForCurrentQuery()},r.hideDropDownOnFocusChange=function(n){r.hideDropDown(1,n)},r.onTextInput=function(){var n=r.searchBox.value;r.triggerTextChangedEvent(n)},r.raiseEvent(5,t),u=0,f=s.ScopeExtensions;u0&&(this.searchForm=u[0],f=this.searchForm.getElementsByClassName("b_searchbox"),f&&f.length>0&&(this.searchBox=f[0])))):(this.searchForm=_ge(this.config.f),this.searchBox=_ge(this.config.i)),this.searchForm.form&&(this.config.fc=this.searchForm.form.value),this._currentImpressionQuery=this.searchBox.value,r=this.getContainer(),sj_be(r,"mousedown",function(n){return sj_sp(n)}),r.style.display="block",this.layout=this._layout=new n.Layout(this.config,r,this.autosuggest.canvas),this.layout.update(),this.registerUIElement(r),this.registerUIElement(this.searchBox),o=_ge("sb_form_go"),o&&this.registerUIElement(o),this._pollInterval=this.config.d,this._pollThrottlingEnabled=this.config.t,s=this._layout.getSuggestionsDrawer(),this.autosuggest.init(this.config,s,this.searchBox),this._lastQuery=this.getQueryToFetch(),this.searchBox.setAttribute("aria-autocomplete","both"),this.searchBox.setAttribute("aria-controls","sw_as"),this.searchBox.setAttribute("aria-owns","sw_as"),i=new n.EventRegistration(this),i.add(8,this.handleResponseReceived),i.add(11,this.startNoMatchTimeout),i.add(10,this.showDropDown),i.add(12,this.onUpdateText),i.add(13,this.onUpdateTextAndRequery),i.add(14,this.onUpdateGhostedText),i.add(4,this.navigate),i.add(17,this.dispose),this.autosuggest.registerEvents(i),this.bindEvents(sj_be,sj_evt.bind),this.pollForQueryChange(),this.raiseEvent(6,this))},s.prototype.setData=function(n){this.autosuggest.setData(n)},s.prototype.getCurrentImpressionQuery=function(){return this._currentImpressionQuery},s.prototype.isDisabled=function(){return!this.config.pv&&sj_cook.get(u,f)=="0"},s.prototype.registerUIElement=function(n){sj_be(n,"touchend",sj_sp);sj_be(n,"click",sj_sp)},s.prototype.addHiddenField=function(n,t){var i=sj_ce("input");return i.id="sa_"+n,i.name=n,i.value=t,i.type="hidden",this.searchForm.appendChild(i),this.config.sbt&&this._hiddenFields.push(i),i},s.prototype.cancelDefaultHandler=function(n){sj_sp(n);sj_pd(n)},s.prototype.show=function(){this.config.handleDuplicateFetch&&this._lastClickQuery!=this.getCurrentQuery(!0)&&(this._lastClickQuery=this.getCurrentQuery(!0));this.onSearchBoxClick()},s.prototype.getCursorPosition=function(){return n.Utils.getCursorPosition(this.searchBox,!0)},s.prototype.makeAutoSuggestGPingCall=function(n){var t=_ge(n.replace("&","")),e;if(t&&document.images){var f=t.getAttribute("h"),u=void 0,i={a:[],add:function(n,t){this.a.push(r(n)+":"+r(t))},get:function(){return this.a.length?"&PR={"+this.a.join(",")+"}":""}};i.add("i",this.autosuggest.canvas.clickedSuggestion?t.it||"m":"k");this.autosuggest.ghostInstValue&&i.add("ghc",this.autosuggest.ghostInstValue);t.panel&&i.add("et",sb_gt()-t.panel.ot);u=this.autosuggest.data&&this.autosuggest.data.Inst?this.autosuggest.data.Inst.IG:null;u&&f&&(e=new Image,e.src=_G.gpUrl+"IG="+u+"&"+f+i.get())}return!0},s.prototype.navigate=function(n,t,i){var u=this,r;sb_st(function(){return u.hideDropDown(2)},5);this.makeAutoSuggestGPingCall(n.id);r=n.query;r!=undefined&&this.updateSearchBoxValue(r);this.config.sbt&&n.addInst&&!n.nav?this.submitForm(t,n.url):this.navigateToUrl(n,t,i)},s.prototype.submitForm=function(n,i){var e,c,r,u,s,h,f;if(this.config.sbt){for(e=void 0;e=this._hiddenFields.shift();)this.searchForm.removeChild(e);this._hiddenFields=[]}if(n&&(this.raiseEvent(15),this.config.bi&&this._currentImpressionQuery===this.searchBox.value)){sj_evt.fire(t);return}this._instrumentationData=this.autosuggest.getAllSuggestionInstObject(null,n);c=this.getCustomUrlParams(i);r=_ge("sa_ghc");r&&r.parentNode.removeChild(r);for(var l=0,o=void 0,a=[this._instrumentationData,c];o=a[l++];)for(u in o)r=_ge("sa_"+u),s=o[u],r?r.value=s:this.addHiddenField(u,s);this.autosuggest.ghostInstValue=0;n||sj_evt.fire("onSearch",this.searchForm);this.makeSearchboxGPingCall();this.fireEvt?(h=this.searchForm.getAttribute("action"),i&&this.searchForm.setAttribute("action",i),this.searchForm.submit(),this.firePartnerEvents(n),h&&this.searchForm.setAttribute("action",h)):_w._H&&_w._H.ajax&&_w.sj_isAjax&&n||this.searchForm.submit();this.fireEvt&&(this.autosuggest.canvas.selectedSuggestion=null,this.autosuggest.ghostInstValue=0,f=_ge("sa_ghc"),!this._instrumentationData.ghc&&f&&f.parentNode.removeChild(f))},s.prototype.makeSearchboxGPingCall=function(){var t=this.searchForm.getAttributeNode("onsubmit"),n;t&&_w.si_T&&(n=t.value.match(/si_T\('(.*)'\)/),n&&n[1]&&_w.si_T(n[1]))},s.prototype.isMsbSuggestion=function(n){return n=="Bookmark"||n=="Building"||n=="Person"||n=="Qna"||n=="Acronym"},s.prototype.navigateToUrl=function(i,r,u){if(i.stype==n.BingAtWorkDataTypes.Bookmarks)this.autosuggest.onBfbNavigateCallback(i.id);else if(i.stype==n.BingAtWorkDataTypes.People)if(this.config.msbSusR)this.autosuggest.onSubstrateNavigateCallback(i.id);else this.autosuggest.onBfbNavigateCallback(i.id);else if(this.isMsbSuggestion(i.stype))this.autosuggest.onBfbNavigateCallback(i.id);if(this.searchForm.onsubmit)this.searchForm.onsubmit(null);if(this.firePartnerEvents(r),this.config.bi&&this._currentImpressionQuery===i.query){sj_evt.fire(t);return}var f=i.url+(i.addInst?this.autosuggest.getAllSuggestionInstUrl():"");f=this.addExtraQueryStrings(f);i.nav&&!n.Utils.GetQueryStringParam(f,"form")&&(f=this.addFormCode(f));u?_w.open(f,u):typeof sj_lc!="undefined"?sj_lc(f):_w.location.href=f},s.prototype.firePartnerEvents=function(n){!n&&this.fireEvt&&this.fireEvt(this.searchForm,"ASSugClicked")},s.prototype.getCustomUrlParams=function(n){var r={},t;if(n)for(var i=void 0,f=/\+/g,e=/([^&=]+)=?([^&]*)/g,u=function(n){return decodeURIComponent(n.replace(f," "))},o=n.substring(n.indexOf("?")+1);i=e.exec(o);)t=u(i[1]).toLowerCase(),t!=="q"&&t!=="form"&&(r[t]=u(i[2]));return r},s.prototype.bindEvents=function(n,t){var i=this,r;n(sj_b,"click",this.hideDropDownOnFocusChange);n(sj_b,"touchend",this.hideDropDownOnFocusChange);n(this.searchForm,"submit",this.onSubmit);n(this.searchBox,"keydown",this.onSearchBoxKeyDown);"ontouchend"in _w&&n(this.searchBox,"touchend",this.searchBoxTouchAction);n(this.searchBox,"click",this.searchBoxClickAction);this.fireEvt&&n(_w,"blur",this.hideDropDownOnFocusChange);r=function(){t("focusChange",function(n){return i.focusChange(n)});t("hideDrawer",function(){return i.hideDropDown(3)})};r();this.config.bi&&t("ajax.load",function(n){var t=n&&n[1];t&&t.isInstantRequest&&(i._currentImpressionQuery=t.query||i.searchBox.value,i.pollForQueryChange(),r())});"oninput"in this.searchBox&&n(this.searchBox,"input",this.onTextInput)},s.prototype.fetchForCurrentQuery=function(){(this._noResultsTimeout&&sb_ct(this._noResultsTimeout),this._bDisabled)||(this._lastQuery=null,this.fetchSuggestions(this.getQueryToFetch(),this.getCurrentQuery(!0)))},s.prototype.showDropDown=function(){this.addAccessibilityAttributes();this._layout.update();this._isLayoutVisible||(sj_evt.fire("focusChange",this.searchBox),this._layout.show(),this._isLayoutVisible=!0,sb_i6&&sj_evt.fire("autosuggestShown",this.searchBox),sj_evt.fire("onPopTR"))},s.prototype.hideDropDown=function(n,t){n!=0&&(this._lastClickQuery=null);this._isLayoutVisible&&(this._layout.hide(),this._isLayoutVisible=!1,n!=0&&(this._lastQuery=this.getQueryToFetch()),this.raiseEvent(16),this.autosuggest.finalizeKeystroke(),t&&this.config.hdm&&sj_pd(t),_w._H&&sj_evt.fire("ASHide"),this.autosuggest.setQuery(undefined));sj_evt.fire("autosuggestHide",this.searchBox,n)},s.prototype.focusChange=function(n){n[1]!==this.searchBox&&this.hideDropDown(1)},s.prototype.startNoMatchTimeout=function(){var n=this;this._noResultsTimeout=sb_st(function(){return n.hideDropDown(0)},50)},s.prototype.onUpdateText=function(n){this.getCurrentQuery()!=n&&(this._bRequeryOnTextChange=!1);this.updateSearchBoxValue(n)},s.prototype.updateSearchBoxValue=function(t,r){var u=r?t+r:t,f;this._autoCompletedPrefixLength=r?t.length:null;u!==null&&(this.searchBox.value=u,i||this.searchBox.setAttribute("value",u),f=u.length,f&&this.getCurrentQuery()!=t&&n.Utils.SetSelectionRange(this.searchBox,f,f),t&&t!=this._lastTextChanged&&this.triggerTextChangedEvent(t))},s.prototype.onUpdateTextAndRequery=function(t,i){if(this._bRequeryOnTextChange=!0,this.updateSearchBoxValue(t),!i){var r=t.length;this.searchBox.focus();n.Utils.SetSelectionRange(this.searchBox,r,r)}},s.prototype.onUpdateGhostedText=function(n,t,i){this._bRequeryOnTextChange=i===undefined?!0:i;this.updateSearchBoxValue(n,t)},s.prototype.triggerTextChangedEvent=function(n){this._lastTextChanged=n;this.autosuggest.raiseTextChanged(n,++this._textChangeSequence)},s.prototype.pollForQueryChange=function(){var u=this,t,n,r;this._bDisabled||(t=this.getCurrentQuery(!0),this._lastRawQuery!=t&&(this.autosuggest.setRawQuery(t),this._lastRawQuery=t,this.config.bi&&sj_evt.fire("AS.RawQueryChanged"),n=this.getQueryToFetch(),this._lastQuery==n&&this._bRequeryOnTextChange||i||this.searchBox.setAttribute("value",n),n!=this._lastQuery&&(this._bRequeryOnTextChange&&!this.suppressRequestForQuery?this.fetchSuggestions(n,t):this.suppressRequestForQuery&&this.config.eNw&&this._bRequeryOnTextChange?this.hideDropDown(4):this._bRequeryOnTextChange||(this._bRequeryOnTextChange=!0),this._lastQuery=n)),r=this._pollInterval,this._pollThrottlingEnabled&&(r*=1<=0?(i=n.indexOf("&",t),i>=0?"&"+n.substr(t,i-t):"&"+n.substr(t)):""},s.prototype.checkMonitr=function(n){var t=n.indexOf("form=monitr");return t>=0?"&"+n.substr(t,11):""},s.prototype.addExtraQueryStrings=function(n){if(this.config.pv){var t=document.URL.indexOf("pubcode"),i=document.URL.substr(t+8,32);return n+"&pubcode="+i+"&pubexp=1&msbqf=false"+this.getPartnerCode(document.URL)+this.checkMonitr(document.URL)}return n},s.prototype.addFormCode=function(n){return n+"&form="+this.searchForm.form.defaultValue},s.prototype.getLastRequestedQuery=function(){return this._lastQuery},s.prototype.notifyDeleteHistory=function(n){this.raiseEvent(22,n)},s.prototype.dispose=function(){this.clearEvents();this.bindEvents(sj_ue,sj_evt.unbind);sb_ct(this._noResultsTimeout)},s.prototype.isEmptyQuery=function(){var n=_ge("sb_form_q");return n&&!n.getAttribute("value")},s.prototype.addAccessibilityAttributes=function(){var n=this.getContainer();n&&(n.setAttribute("role","combobox"),n.setAttribute("aria-label",sa_loc.Suggestions))},s.prototype.getContainer=function(){return _ge(this.config.c||"sw_as")},s.ScopeExtensions=[],s}(n.EventRegisterer);n.SearchForm=o})(t=n.AS||(n.AS={}))})(Bing||(Bing={}));var Bing;(function(n){var t;(function(n){var t=navigator.userAgent.toLowerCase().indexOf("firefox")>-1,i=function(){function i(){this._imeInProgress=!1}return i.prototype.init=function(t){if(t.config.eHC){var i=new n.EventRegistration(this);i.add(6,this.onSearchFormInitialized);t.registerEvents(i)}this._instantEnabled=!!t.config.bi},i.prototype.onSearchFormInitialized=function(i){var r=this,u=i.autosuggest,e;u.ghostInstValue=0;var c=function(){return u.ghostInstValue=2},l=function(){u.ghostInstValue==0&&(u.ghostInstValue=1)},f=i.searchBox,s=function(t,i){return n.Utils.SetSelectionRange(f,t,i)};this.isCursorPositionAtTheEnd=function(){return i.getCursorPosition()==r.getPartialQuery().length};this.getSearchBoxValue=function(){return f.value};this.getPartialQuery=function(){return i.getCurrentQuery(!0)};this.getGhostedQuery=function(){return i.isQueryGhosted()?r.getSearchBoxValue():null};this.getCurrentImpressionQuery=i.getCurrentImpressionQuery;this.resetGhosting=function(n,t,i){if(u.raiseUpdateGhostedText(null,null,n),t){var f=r.getSearchBoxValue().length;s(f,f)}i&&c()};this.removeGhosting=function(n){n?u.raiseUpdateTextAndRequery(r.getPartialQuery()):u.raiseUpdateText(r.getPartialQuery())};this.setGhostValue=function(n,t){t?(u.raiseUpdateGhostedText(n,t),s(n.length,(n+t).length),l()):u.raiseUpdateTextAndRequery(n)};var a=function(n){return r.handleSearchBoxKeyPress(n)},v=function(n){return r.handleSearchBoxKeyDown(n)},y=function(){return r.handleSearchBoxMouseDown()},p=function(){return r.removeGhosting(!1)},w=function(){return r.handleCompositionStart()},b=function(){return function(){return r.handleCompositionEnd()}},k=function(n){return r.handleSearchBoxKeyUp(n)},h=function(n,i){n(f,"keypress",a);n(f,"keydown",v);n(f,"mousedown",y);i("onFeedbackStarting",p);t?(n(f,"compositionstart",w),n(f,"compositionend",b)):n(f,"keyup",k)},o=new n.EventRegistration(this);o.add(10,this.handleSuggestionsRendered);o.add(17,function(){return h(sj_ue,sj_evt.unbind)});u.registerEvents(o);e=new n.EventRegistration(this);e.add(15,function(){r.getGhostedQuery()&&r.resetGhosting(!1,!0,!0)});e.add(16,this.onDropDownHidden);i.registerEvents(e);h(sj_be,sj_evt.bind)},i.prototype.onDropDownHidden=function(){var n=this.getGhostedQuery();n&&(this._instantEnabled?this.getCurrentImpressionQuery()===n&&this.resetGhosting(!1,!0,!0):this.removeGhosting(!1))},i.prototype.handleCompositionStart=function(){this._imeInProgress=!0},i.prototype.handleCompositionEnd=function(){this._imeInProgress&&(this._imeInProgress=!1,this.resetGhosting(!0,!1,!1),this._pendingGhostFirstSuggestion&&sb_st(this._pendingGhostFirstSuggestion,0))},i.prototype.ghostFirstSuggestion=function(n,t,i){var r,u,f,e,o;if((this._pendingGhostFirstSuggestion=null,n&&t==n.toLowerCase())&&this._lastKeyDown!=46&&this._lastKeyDown!=8&&this.isCursorPositionAtTheEnd()){for(u=0,f=i;un.length?(o=r.slice(n.length),this.setGhostValue(n,o)):this.getGhostedQuery()&&this.removeGhosting(!0)}},i.prototype.handleSuggestionsRendered=function(t,i,r,u,f){var o=this,e;f==n.DataSources.Web&&(e=this.getPartialQuery(),this._imeInProgress?this._pendingGhostFirstSuggestion=function(){return o.ghostFirstSuggestion(e,t,i)}:this.ghostFirstSuggestion(e,t,i))},i.prototype.handleSearchBoxKeyDown=function(n){var r=this,i=this._lastKeyDown=n.keyCode,u;if(n.ctrlKey&&i==90){sj_pd(n);return}(t||this._imeInProgress||i!=229||this.handleCompositionStart(),!this._imeInProgress&&this.getGhostedQuery()&&i!=38&&i!=40)&&(i==13?this.resetGhosting(!1,!0,!0):i==37||i==33||n.shiftKey&&i==39?this.resetGhosting(!1,!1,!0):i==35||i==34||i==39||n.ctrlKey&&i==65?this.resetGhosting(!0,!1,!0):i==9?(this.resetGhosting(!0,!0,!0),sj_pd(n)):i==27||n.ctrlKey&&i==8?(this.removeGhosting(!0),sj_pd(n)):i==46||i==8||n.ctrlKey&&i==88?this.resetGhosting(!0,!1,!1):n.ctrlKey&&i==86||n.shiftKey&&i==45?this.removeGhosting(!0):(u=this.getSearchBoxValue().toLowerCase(),sb_st(function(){u!=r.getSearchBoxValue().toLowerCase()&&r.resetGhosting(!0,!1,!1)},0)))},i.prototype.handleSearchBoxKeyUp=function(n){var t=n.keyCode;this._imeInProgress&&(t==13||t==27||t==8||t==37||t==39)&&this.handleCompositionEnd()},i.prototype.handleSearchBoxKeyPress=function(n){var t=this.getGhostedQuery();if(t){var i=n.char?n.char:String.fromCharCode(n.charCode?n.charCode:n.keyCode),r=this.getPartialQuery(),u=t.slice(r.length);u.charAt(0)==i.toLowerCase()&&(this.setGhostValue(r+i,u.slice(1)),sj_pd(n))}},i.prototype.handleSearchBoxMouseDown=function(){this.getGhostedQuery()&&this.resetGhosting(!1,!1,!0)},i}();n.SearchForm.ScopeExtensions.push(new i)})(t=n.AS||(n.AS={}))})(Bing||(Bing={}));var Bing;(function(n){var t;(function(n){var t=function(){function t(){}return t.prototype.getCallbacks=function(){var t=new n.EventRegistration(this);return t.add(11,this.onNoResults),t.add(10,this.onSuggestionsRendered),t},t.prototype.set=function(n){this._data=n;this._data.currentQuery.length<=1&&(this._lastQueryWithNoResults=null)},t.prototype.match=function(){return this._lastQueryWithNoResults&&this._data.currentQuery.substr(0,this._lastQueryWithNoResults.length)==this._lastQueryWithNoResults},t.prototype.onNoResults=function(n){this._lastQueryWithNoResults=n},t.prototype.onSuggestionsRendered=function(t,i,r,u,f){f==n.DataSources.Web&&(this._lastQueryWithNoResults=null)},t}(),i=function(){function t(n){this._searchFormInstance=n;this._exceededNextWordLimit=!1}return t.prototype.getCallbacks=function(){return new n.EventRegistration(this)},t.prototype.set=function(){var t=this._searchFormInstance.getCurrentQuery(),i=this._searchFormInstance.searchBox.offsetWidth,r=n.Utils.CalcWidth(this._searchFormInstance.searchForm,t),u=r/i;this._exceededNextWordLimit=u>.7},t.prototype.match=function(){return this._exceededNextWordLimit},t}(),r=function(){function r(){this._rules=[]}return r.prototype.init=function(t){var i=new n.EventRegistration(this);i.add(6,this.onSearchFormInitialized);t.registerEvents(i)},r.prototype.onSearchFormInitialized=function(n){this._searchFormInstance=n;this.addRules();this.addCallbacks()},r.prototype.addRules=function(){var n=this._searchFormInstance.config;n.eNw&&n.nwLim&&this._rules.push(new i(this._searchFormInstance));n.suppnores&&this._rules.push(new t(n))},r.prototype.addCallbacks=function(){var o=this._rules.length,i,r,t,u,e,f;if(o)for(i=this._searchFormInstance.autosuggest,r=new n.EventRegistration(this),r.add(18,this.onTextChanged),i.registerEvents(r),t=0,u=this._rules;t1)for(n=0,t=this._rules;n