"use strict";(globalThis.webpackChunkhelphub=globalThis.webpackChunkhelphub||[]).push([[153],{11784:(e,t,r)=>{r.d(t,{F6:()=>findMatchingSupportArea,ah:()=>generateEventData,En:()=>getAriaLabel,p7:()=>getCategory,TW:()=>getContainerId,$G:()=>populateResourceData});var s=r(58254),n=r.n(s),i=r(92034),o=r.n(i);const a=JSON.parse('{"docs.github.com":"documentation","github.com/orgs/community":"community","support.github.com":"navigation","helphub.github.localhost":"navigation",".github.dev":"navigation"}'),c=JSON.parse('{"resource-tracking-container":"NONE"}'),generateEventData=(e,t={},r,s,n)=>{const i=n||{url:window.location.href,page_title:document.title,user_input:t.user_input,support_area:s||(r?findMatchingSupportArea(r):void 0),container_id:r?getContainerId(r):void 0};return{type:"v1_analytics_event",internal_type:e,source:o()(i,isUndefinedOrEmpty),resource:o()(t,isUndefinedOrEmpty)}},populateResourceData=(e,t,r,s,n)=>{"community"===r?e.community={url:t?.href,title:""}:"documentation"===r?e.documentation={url:t?.href}:("Start Copilot Chat"===s?e.type="copilot":"Start Virtual Agent"===s&&(e.type="va"),"navigation"===r||"action"===n&&s?(e.navigation={url:t?.href,label:s||void 0},e.type="navigation"):"other"===r&&(e.other={url:t?.href})),e.user_input=document.getElementById("contact_subject")?.value??""},isUndefinedOrEmpty=e=>n()(e)||""===e,getAriaLabel=e=>{if(e.hasAttribute("aria-label"))return e.getAttribute("aria-label");let t=e.parentElement;for(;t;){if("BUTTON"===t.tagName)return t.hasAttribute("aria-label")?t.getAttribute("aria-label"):null;t=t.parentElement}return null},getCategory=e=>{const t=new URL(e,window.location.origin).href.replace(/^https?:\/\//,"");return Object.entries(a).find((([e])=>t.includes(e)))?.[1]||"other"},findMatchingSupportArea=e=>{const t=c;for(;e;){const r=t[e.id];if(r)return r;e=e.parentElement}},getContainerId=e=>{for(;e;){if(e.hasAttribute("data-analytics-container-id"))return e.getAttribute("data-analytics-container-id")||void 0;if(["MAIN","HEADER","FOOTER"].includes(e.tagName))return e.tagName.toLowerCase();e=e.parentElement}}},37158:(e,t,r)=>{r.d(t,{A:()=>AnalyticImpressionEventHandler});var s=r(11784);class AnalyticImpressionEventHandler{constructor(e){this.sendEvent=void 0,this.mutation_observer=void 0,this.intersection_observer=void 0,this.eventBatch=[],this.batchInterval=2e3,this.baseSelectors="a",this.specificSelectors='[aria-label="Start Copilot Chat"], [aria-label="Start Virtual Agent"]',this.sendEvent=e,this.initializeObservers(),this.handleLinkImpressions(),this.startBatchingProcess()}initializeObservers(){this.initializeMutationObserver(),this.initializeIntersectionObserver()}initializeMutationObserver(){this.mutation_observer=new MutationObserver((e=>{e.forEach((e=>{"childList"===e.type&&this.handleLinkImpressions()}))}));this.mutation_observer.observe(document.body,{childList:!0,subtree:!0})}initializeIntersectionObserver(){this.intersection_observer=new IntersectionObserver((e=>{e.forEach((e=>{if(e.isIntersecting){const t=e.target;this.shouldTrackLink(t)&&(this.trackLinkImpression(t),this.intersection_observer.unobserve(t))}}))}),{root:null,threshold:.1})}handleLinkImpressions(){const e=`${this.baseSelectors}, ${this.specificSelectors}`;document.querySelectorAll(e).forEach((e=>this.intersection_observer.observe(e)))}shouldTrackLink(e){return!e.hasAttribute("data-impression-tracked")}trackLinkImpression(e){e.setAttribute("data-impression-tracked","true");const t=(0,s.En)(e),r=(0,s.p7)(e?.href),n=(0,s.TW)(e),i={type:r},o={url:window.location.href,page_title:document.title,container_id:n};(0,s.$G)(i,e,r,t),this.eventBatch.push((0,s.ah)("impression",i,e,"NONE",o))}trackNoticeImpression(e){const t={type:"targeted_notice",id:e};(0,s.$G)(t,null,"targeted_notice",null);const r=(0,s.ah)("impression",t,void 0,"NONE");this.sendEvent(r)}customImpression(e,t="impression",r="NONE"){(0,s.$G)(e,null,e.type||t,null);const n=(0,s.ah)(t,e,void 0,r);this.sendEvent(n)}startBatchingProcess(){setInterval((()=>{this.eventBatch.length>0&&(this.sendEvent({type:"v1_analytics_batch_event",eventBatch:this.eventBatch}),this.eventBatch=[])}),this.batchInterval)}}},66054:(e,t,r)=>{r.d(t,{F:()=>fetchEnhanced,f:()=>FetchError});const s=["delayBetweenRetries","maxRetries","suppressErrors"],n=["statusCode","retryAfter"],i=["retryAttempt","retryAttemptsMax","statusCode","retryAfter"];function _objectWithoutProperties(e,t){if(null==e)return{};var r,s,n=function _objectWithoutPropertiesLoose(e,t){if(null==e)return{};var r={};for(var s in e)if({}.hasOwnProperty.call(e,s)){if(-1!==t.indexOf(s))continue;r[s]=e[s]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s{setTimeout(t,e)}))}const o=2e3;async function fetchEnhanced(e,t={}){let{delayBetweenRetries:r=o,maxRetries:n=0,suppressErrors:i=!1}=t,a=_objectWithoutProperties(t,s);const c=n>0;for(let s=0;s<=n;s++){const t=s+1;try{const t=await window.fetch(e,a);if(t.ok)return t;const r=t.statusText||`${t.status} response from server (no body)`;throw new HTTPError(r,{statusCode:t.status,retryAfter:t.headers.get("Retry-After")||void 0})}catch(l){const e=l instanceof TypeError&&"Failed to fetch"===l.message,s=l instanceof HTTPError,o=c&&e,a=new FetchError(l.message,{retryAttempt:o?t:void 0,retryAttemptsMax:o?n:void 0,statusCode:s?l.statusCode:void 0,retryAfter:s?l.retryAfter:void 0,cause:l});if(e&&(a.message=`${a.message}; this may be due to a network error or a misconfiguration`),!o||t===n){if(i)return;throw a}r>0&&await wait(r)}}}class HTTPError extends Error{constructor(e,t){let{statusCode:r,retryAfter:s}=t;super(e,_objectWithoutProperties(t,n)),this.statusCode=void 0,this.retryAfter=void 0,Object.setPrototypeOf(this,HTTPError.prototype),this.name="HTTPError",this.statusCode=r,this.retryAfter=s}}class FetchError extends Error{constructor(e,t){let{retryAttempt:r,retryAttemptsMax:s,statusCode:n,retryAfter:o}=t;super(e,_objectWithoutProperties(t,i)),this.retryAttempt=void 0,this.retryAttemptsMax=void 0,this.statusCode=void 0,this.retryAfter=void 0,Object.setPrototypeOf(this,FetchError.prototype),this.name="FetchError",this.retryAttempt=r,this.retryAttemptsMax=s,this.statusCode=n,this.retryAfter=o}}},71661:(e,t,r)=>{r.d(t,{A:()=>AnalyticClickEventHandler});var s=r(11784);class AnalyticClickEventHandler{constructor(e){this.sendEvent=void 0,this.sendEvent=e,this.handleEvent=this.handleEvent.bind(this)}handleEvent(e){const t=e.target,r=this.getClosestLink(t),n=(0,s.En)(t);if(!r&&!n)return;const i=r?(0,s.p7)(r.href):"action",o=r?"link":"action",a=(0,s.TW)(t),c={type:i},l=t?(0,s.F6)(t):void 0,d={url:window.location.href,page_title:document.title,container_id:a,support_area:l};(0,s.$G)(c,r,i,n,o),this.sendEvent((0,s.ah)(o,c,t,l,d))}customClick(e,t="action",r="NONE"){(0,s.$G)(e,null,e.type||t,null);const n=(0,s.ah)(t,e,void 0,r);this.sendEvent(n)}getClosestLink(e){for(;e&&"A"!==e.nodeName;)e=e.parentNode;return e}}},81509:(e,t,r)=>{var s=r(92263),n=r(66054);class FullStorySyncSessionId{constructor(){this.maxChangeCount=5,this.syncInterval=4e3,this.cooldownPeriod=1e4,this.changeCount=0,this.lastFsSessionId=null,this.init()}async init(){document.addEventListener("fullStoryReady",(async()=>{await this.syncSessionId(),setInterval(this.syncSessionId.bind(this),this.syncInterval)}))}async syncSessionId(){try{const e=await(0,s.bp)("getSessionAsync",{format:"id"});if(e!==this.lastFsSessionId){if(this.changeCount++,this.changeCount>this.maxChangeCount)return void setTimeout((()=>{this.changeCount=0}),this.cooldownPeriod);await(0,n.F)("/session/fs",{method:"POST",headers:{"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest"},body:JSON.stringify({fsSessionId:e})}),this.lastFsSessionId=e}}catch(e){}}}var i=r(2543);function _classPrivateFieldLooseBase(e,t){if(!{}.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var o=0;function _classPrivateFieldLooseKey(e){return"__private_"+o+++"_"+e}var a=_classPrivateFieldLooseKey("excludedPages"),c=_classPrivateFieldLooseKey("monitoredEvents"),l=_classPrivateFieldLooseKey("updateLastActivity");class UpdateUserSession{constructor(){Object.defineProperty(this,a,{writable:!0,value:["/request/landing"]}),Object.defineProperty(this,c,{writable:!0,value:["click","keypress","submit","touchend","mousemove"]}),Object.defineProperty(this,l,{writable:!0,value:void 0}),this.DEBOUNCE_DELAY=500,this.MAX_WAIT=4e3,_classPrivateFieldLooseBase(this,a)[a].includes(window.location.pathname)||(_classPrivateFieldLooseBase(this,l)[l]=(0,i.debounce)((e=>{this.sendActivityToServer(e)}),this.DEBOUNCE_DELAY,{maxWait:this.MAX_WAIT}),this.sendActivityToServer("session_start"),this.setupEventListeners())}setupEventListeners(){_classPrivateFieldLooseBase(this,c)[c].forEach((e=>{window.addEventListener(e,(e=>_classPrivateFieldLooseBase(this,l)[l](e.type)))}));window.addEventListener("beforeunload",(()=>_classPrivateFieldLooseBase(this,l)[l].flush()));document.addEventListener("visibilitychange",(()=>{"hidden"===document.visibilityState&&_classPrivateFieldLooseBase(this,l)[l].flush()}))}sendActivityToServer(e){const t={eventType:e,timestamp:(new Date).toISOString(),currentPage:window.location.pathname||"/"},r=JSON.stringify(t);if(!navigator.sendBeacon||!navigator.sendBeacon("/session/user",r))try{(0,n.F)("/session/user",{method:"POST",headers:{"Content-Type":"application/json"},body:r,keepalive:!0})}catch(s){}}}var d=r(82801),h=r(71661),u=r(37158);const v=JSON.parse('{"/":"LANDING_PAGE","/get-started":"FEATURE_SITE","/ci-cd-devops":"FEATURE_SITE","/enterprise-and-teams":"FEATURE_SITE","/security":"FEATURE_SITE","/project-management":"FEATURE_SITE","/community":"FEATURE_SITE","/developers":"FEATURE_SITE","/collaborative-coding":"FEATURE_SITE","/success/services-catalog":"SERVICES_CATALOG","/success/enablement":"ENABLEMENT","/success/releases":"NEW_RELEASES"}'),p=JSON.parse('{"docs.github.com":"DOCUMENTATION","github.com/orgs/community":"COMMUNITY_FORUM","learninglab.github.com":"LEARNING_LAB","github.blog":"GITHUB_BLOG","githubstatus.com":"GITHUB_STATUS","support.github.com":"INTERNAL_RESOURCE","semmle.com":"SEMMLE","codeql.github.com":"CODEQL","education.github.com":"EDUCATION","github.com":"GITHUB","enterprise.github.com":"GITHUB_ENTERPRISE","github.com/enterprise/contact":"GITHUB_SALES"}');var E=0;function referral_click_event_classPrivateFieldLooseKey(e){return"__private_"+E+++"_"+e}var y=referral_click_event_classPrivateFieldLooseKey("isVersion2");class ReferralClickEventHandler{constructor(e){this.sendEvent=void 0,Object.defineProperty(this,y,{writable:!0,value:()=>"2"===document.body.getAttribute("data-layout-version")}),this.sendEvent=e,this.handleEvent=this.handleEvent.bind(this)}handleEvent(e){if(!function referral_click_event_classPrivateFieldLooseBase(e,t){if(!{}.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}(this,y)[y]())return;const t=this.getClosestLink(e.target);if(!t||this.hasDataEventAttr(t))return;const r={type:"referral_click",href:t.href,category:this.getCategory(t.href),source:v[window.location.pathname]||"SOURCE_UNKNOWN"};this.sendEvent(r)}hasDataEventAttr(e){return!!e&&e.hasAttribute("data-event-click")}getClosestLink(e){for(;e&&"A"!==e.nodeName;)e=e.parentNode;return e}getCategory(e){const t=new URL(e,window.location.origin).href.replace(/^https?:\/\//,"");for(const[r,s]of Object.entries(p))if(t.includes(r))return s;return"CATEGORY_UNKNOWN"}}const m=new d.A;!function initializeAnalytics(){new FullStorySyncSessionId,new UpdateUserSession,function registerEventHandlers(){const e=new ReferralClickEventHandler(m.sendEvent.bind(m));if(m.registerEventHandler("click",e.handleEvent.bind(e)),document.querySelector('meta[name="analytics-v2"]')){const e=new h.A(m.sendEvent.bind(m));m.registerEventHandler("click",e.handleEvent.bind(e));const t=new u.A(m.sendEvent.bind(m));m.registerEventHandler("impression",t.handleLinkImpressions.bind(t))}}()}()},82801:(e,t,r)=>{r.d(t,{A:()=>EventTracker});var s=r(66054),n=r(20181),i=r.n(n);const o=["type"];const a="/session/event";class EventTracker{registerEventHandler(e,t){const r=i()(t,500,{leading:!0,trailing:!0});document.addEventListener(e,r)}sendEvent(e){const{type:t}=e,r=function _objectWithoutProperties(e,t){if(null==e)return{};var r,s,n=function _objectWithoutPropertiesLoose(e,t){if(null==e)return{};var r={};for(var s in e)if({}.hasOwnProperty.call(e,s)){if(-1!==t.indexOf(s))continue;r[s]=e[s]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s{e.O(0,[263,935],(()=>{return t=81509,e(e.s=t);var t}));e.O()}]);