"use strict";(globalThis.webpackChunk=globalThis.webpackChunk||[]).push([["ui_packages_hydro-analytics_hydro-analytics_ts-ui_packages_jump-to-element_model_ts"],{56176:(e,t,n)=>{let r;function o(){if(!r)throw Error("Client env was requested before it was loaded. This likely means you are attempting to use client env at the module level in SSR, which is not supported. Please move your client env usage into a function.");return r}function a(){return r?.locale??"en-US"}function i(){return!!o().login}n.d(t,{JK:()=>a,M3:()=>i,_$:()=>o}),!function(){if("undefined"!=typeof document){let e=document.getElementById("client-env");if(e)try{r=JSON.parse(e.textContent||"")}catch(e){console.error("Error parsing client-env",e)}}}()},75028:(e,t,n)=>{n.d(t,{G:()=>o,K:()=>a});var r=n(47584);let o=r.XC?.readyState==="interactive"||r.XC?.readyState==="complete"?Promise.resolve():new Promise(e=>{r.XC?.addEventListener("DOMContentLoaded",()=>{e()})}),a=r.XC?.readyState==="complete"?Promise.resolve():new Promise(e=>{r.cg?.addEventListener("load",e)})},75632:(e,t,n)=>{n.d(t,{G7:()=>s,XY:()=>u,fQ:()=>c});var r=n(5225),o=n(56176);function a(){return new Set((0,o._$)().featureFlags.map(e=>e.toLowerCase()))}let i=n(47584).X3||function(){try{return process?.env?.STORYBOOK==="true"}catch{return!1}}()?a:(0,r.A)(a);function c(){return Array.from(i())}function s(e){return i().has(e.toLowerCase())}let u={isFeatureEnabled:s}},46988:(e,t,n)=>{let r;n.d(t,{BI:()=>m,Ti:()=>h,lA:()=>d});var o=n(70837),a=n(18679),i=n(80688),c=n(57516);let{getItem:s}=(0,i.A)("localStorage"),u="dimension_",l=["utm_source","utm_medium","utm_campaign","utm_term","utm_content","scid"];try{let e=(0,o.O)("octolytics");delete e.baseContext,r=new a.s(e)}catch{}function f(e){let t=(0,o.O)("octolytics").baseContext||{};if(t)for(let[e,n]of(delete t.app_id,delete t.event_url,delete t.host,Object.entries(t)))e.startsWith(u)&&(t[e.replace(u,"")]=n,delete t[e]);let n=document.querySelector("meta[name=visitor-payload]");for(let[e,r]of(n&&Object.assign(t,JSON.parse(atob(n.content))),new URLSearchParams(window.location.search)))l.includes(e.toLowerCase())&&(t[e]=r);return t.staff=(0,c.X)().toString(),Object.assign(t,e)}function d(e){r?.sendPageView(f(e))}function m(e,t={}){let n=document.head?.querySelector('meta[name="current-catalog-service"]')?.content,o=n?{service:n}:{};for(let[e,n]of Object.entries(t))null!=n&&(o[e]=`${n}`);r&&(f(o),r.sendEvent(e||"unknown",f(o)))}function h(e){return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,JSON.stringify(t)]))}},56366:(e,t,n)=>{n.d(t,{Av:()=>c,BM:()=>o,Gr:()=>s,HX:()=>f,M_:()=>d,RD:()=>l,rb:()=>a});var r=n(47584);let o="GraphQLTraces",a="GraphQLTracingRefresh",i=decodeURIComponent(new URLSearchParams(r.fV.search).get("disable_clusters")||"").split(",").filter(e=>""!==e);function c(e){if(!r.cg||!s()||!e)return;let t=r.cg;t&&!t[o]&&(t[o]=[]),t&&e.__trace&&(t[o].push(e.__trace),"function"==typeof t[a]&&t[a]())}function s(){let e=r.cg;return"true"===new URLSearchParams(r.fV.search).get("_tracing")||e&&void 0!==e[o]}function u(){return i.length>0}function l(e){if(!s()&&!u())return e;let t=new URL(e,r.fV.origin);return s()&&t.searchParams.set("_tracing","true"),u()&&t.searchParams.set("disable_clusters",i.join(",")),t.pathname+t.search}function f(e){return i.indexOf(e)>-1}function d(e){let t=i.indexOf(e);t>-1?i.splice(t,1):i.push(e);let n=new URLSearchParams(r.fV.search);n.set("disable_clusters",i.join(",")),r.fV.search=n.toString()}},18150:(e,t,n)=>{n.d(t,{KW:()=>d,lW:()=>c,u:()=>i});var r=n(5225),o=n(56366),a=n(16443);function i(e,t){let n=new URL(e,window.location.origin),r=new URLSearchParams(n.search.slice(1));r.set("q",t);let o=new URLSearchParams(window.location.search).get("type");return o&&r.set("type",o),n.search=r.toString(),n.toString()}function c(e,t){let n=new URL(t,window.location.origin),r=new URLSearchParams(n.search.slice(1));return r.get("q")&&r.set("q",e),n.search=r.toString(),n.toString()}let s=new Map;async function u(e,t){let n=function(e){let t=new FormData;for(let e of Object.keys((0,a.oP)()).slice(0,10))t.append("variables[pageViews][]",e);return t}(0);n.set("_method","GET");let r=[],i=new URL(e,window.location.origin);location.search.match(/_tracing=true/)&&i.searchParams.set("graphql_query_trace","true");let c=await fetch(i.href,{method:"POST",mode:"same-origin",body:n,headers:{Accept:"application/json","Scoped-CSRF-Token":t,"X-Requested-With":"XMLHttpRequest"}});if(c.ok){let e=await c.json();(0,o.Av)(e),r=function(e){if("errors"in e.data)return[];let t=1,n=[];for(let r of e.data.suggestions.nodes)null!=r&&(r.rank=t++,r.pageKey=function(e){let t;let[n,r]=e.name.split("/")||[];switch(e.type){case"Project":if(!e.owner)throw Error("Project owner is required");t=(0,a.Ti)(e.owner.name,`${e.number}`);break;case"Repository":if(!n||!r)throw Error("Repository owner and name are required");t=(0,a.g2)(n,r);break;case"Team":if(!n||!r)throw Error("Team owner and name are required");t=(0,a.$f)(n,r);break;default:throw Error(`Invalid Suggestion type: ${e.type}`)}return t}(r),"Team"===r.type&&(r.name=`@${r.name}`),n.push(r));return n}(e)}let s=document.querySelector(".js-search-commands");if(s instanceof HTMLInputElement){let e=s.value,t=[];try{t=JSON.parse(e).commands}catch{}r=r.concat(t)}return r}let l=0,f=(0,r.A)(u,{cache:s});async function d(e){let t=e.getAttribute("data-jump-to-suggestions-path");if(!t)throw Error("could not get jump to suggestions path");let n=function e(t,n){let r=t.nextElementSibling;return r instanceof HTMLElement?r.classList.contains(n)?r:e(r,n):null}(e,"js-data-jump-to-suggestions-path-csrf");return n?(Date.now()-l>5e3&&s.clear(),l=Date.now(),f(t,n.value)):[]}},16443:(e,t,n)=>{n.d(t,{$f:()=>s,D_:()=>i,Ti:()=>l,g2:()=>u,lM:()=>p,oP:()=>h});let r=/^\/orgs\/([a-z0-9-]+)\/teams\/([\w-]+)/,o=[/^\/([^/]+)\/([^/]+)\/?$/,/^\/([^/]+)\/([^/]+)\/blob/,/^\/([^/]+)\/([^/]+)\/tree/,/^\/([^/]+)\/([^/]+)\/issues/,/^\/([^/]+)\/([^/]+)\/pulls?/,/^\/([^/]+)\/([^/]+)\/pulse/],a=[["organization",/^\/orgs\/([a-z0-9-]+)\/projects\/([0-9-]+)/],["repository",/^\/([^/]+)\/([^/]+)\/projects\/([0-9-]+)/]];function i(e){let[t,n,i]=e.match(r)||[];if("string"==typeof n&&"string"==typeof i){c(s(n,i));return}for(let[t,n]of a){let r=e.match(n);if(r){let e,n;let[o,a,i,s]=r;switch(t){case"organization":e=a,n=i;break;case"repository":e=`${a}/${i}`,n=s}e&&n&&c(l(e,n));return}}for(let t of o){let n=e.match(t);if(n){let[e,t,r]=n;if("string"!=typeof t||"string"!=typeof r)return;c(u(t,r));return}}}function c(e){let t=h(),n=Math.floor(Date.now()/1e3),r=t[e]||{lastVisitedAt:n,visitCount:0};r.visitCount+=1,r.lastVisitedAt=n,t[e]=r,m(function(e){let t=Object.keys(e);if(t.length<=100)return e;let n=p(e);return Object.fromEntries(t.sort((e,t)=>n(t)-n(e)).slice(0,50).map(t=>{if(void 0===e[t])throw Error(`pageViews[${t}] is undefined`);return[t,e[t]]}))}(t))}function s(e,t){return`team:${e}/${t}`}function u(e,t){return`repository:${e}/${t}`}function l(e,t){return`project:${e}/${t}`}let f=/^(team|repository|project):[^/]+\/[^/]+(\/([^/]+))?$/,d="jump_to:page_views";function m(e){!function(e,t){try{window.localStorage.setItem(e,t)}catch{}}(d,JSON.stringify(e))}function h(){let e;let t=function(e){try{return window.localStorage.getItem(e)}catch{return null}}(d);if(!t)return{};try{e=JSON.parse(t)}catch{return m({}),{}}let n={};for(let t in e)t.match(f)&&(n[t]=e[t]);return n}let g={frequency:.6,recency:.4};function p(e){let t=function(e){let t=[...Object.values(e)].reduce((e,t)=>e+t.visitCount,0);return new Map(Object.keys(e).map(n=>{if(void 0===e[n])throw Error(`pageViews[${n}] is undefined`);return[n,e[n].visitCount/t]}))}(e),n=function(e){var t,n;let r=(t=[...Object.keys(e)],n=t=>e[t]?.lastVisitedAt||0,t.sort((e,t)=>n(e)-n(t))),o=r.length;return new Map(r.map((e,t)=>[e,(t+1)/o]))}(e);return function(e){var r,o;return r=t.get(e)||0,o=n.get(e)||0,r*g.frequency+o*g.recency}}},9080:(e,t,n)=>{n.d(t,{k:()=>i,v:()=>c});var r=n(5225),o=n(47584);let a=(0,r.A)(function(){return o.XC?.head?.querySelector('meta[name="runtime-environment"]')?.content||""}),i=(0,r.A)(function(){return"enterprise"===a()}),c="webpack"},80688:(e,t,n)=>{n.d(t,{A:()=>i,D:()=>c});var r=n(47584),o=n(57516);let a=class NoOpStorage{getItem(){return null}setItem(){}removeItem(){}clear(){}key(){return null}get length(){return 0}};function i(e,t={throwQuotaErrorsOnSet:!1},n=r.cg,c=e=>e,s=e=>e){let u;try{if(!n)throw Error();u=n[e]||new a}catch{u=new a}let{throwQuotaErrorsOnSet:l}=t;function f(e){t.sendCacheStats&&(0,o.i)({incrementKey:e})}function d(e){try{if(u.removeItem(e),t.ttl){let t=`${e}:expiry`;u.removeItem(t)}}catch{}}return{getItem:function(e,t=Date.now()){try{let n=u.getItem(e);if(!n)return null;let r=`${e}:expiry`,o=Number(u.getItem(r));if(o&&t>o)return d(e),d(r),f("SAFE_STORAGE_VALUE_EXPIRED"),null;return f("SAFE_STORAGE_VALUE_WITHIN_TTL"),c(n)}catch{return null}},setItem:function(e,n,r=Date.now()){try{if(u.setItem(e,s(n)),t.ttl){let n=`${e}:expiry`,o=r+t.ttl;u.setItem(n,o.toString())}}catch(e){if(l&&e instanceof Error&&e.message.toLowerCase().includes("quota"))throw e}},removeItem:d,clear:u.clear,key:u.key,get length(){return u.length}}}function c(e){return i(e,{throwQuotaErrorsOnSet:!1},r.cg,JSON.parse,JSON.stringify)}},47584:(e,t,n)=>{n.d(t,{KJ:()=>r.KJ,Kn:()=>o.Kn,X3:()=>r.X3,XC:()=>o.XC,cg:()=>o.cg,fV:()=>o.fV,g5:()=>r.g5});var r=n(25992),o=n(39833)},39833:(e,t,n)=>{n.d(t,{Kn:()=>i,XC:()=>o,cg:()=>a,fV:()=>c});let r="undefined"!=typeof FORCE_SERVER_ENV&&FORCE_SERVER_ENV,o="undefined"==typeof document||r?void 0:document,a="undefined"==typeof window||r?void 0:window,i="undefined"==typeof history||r?void 0:history,c="undefined"==typeof location||r?{pathname:"",origin:"",search:"",hash:"",href:""}:location},25992:(e,t,n)=>{n.d(t,{KJ:()=>a,X3:()=>o,g5:()=>i});var r=n(39833);let o=void 0===r.XC,a=!o;function i(){return!!o||!r.XC||!!(r.XC.querySelector('react-app[data-ssr="true"]')||r.XC.querySelector('react-partial[data-ssr="true"][partial-name="repos-overview"]'))}},57516:(e,t,n)=>{n.d(t,{X:()=>h,i:()=>l});var r=n(47584),o=n(75028),a=n(9080),i=n(75632),c=n(56176),s=n(70170);let u=[];function l(e,t=!1,n=.5){if(!r.X3&&!0!==(0,i.G7)("BROWSER_STATS_DISABLED")){if(n<0||n>1)throw RangeError("Sampling probability must be between 0 and 1");void 0===e.timestamp&&(e.timestamp=Date.now()),e.loggedIn=(0,c.M3)(),e.staff=h(),e.bundler=a.v,Math.random()JSON.stringify(e));for(;n.length>0;)t.push(function(e){let t=e.shift(),n=[t],r=t.length;for(;e.length>0&&r<=65536;){let t=e[0].length;if(r+t<=65536){let o=e.shift();n.push(o),r+=t}else break}return n}(n));return t}(u))!function(e,t){try{navigator.sendBeacon&&navigator.sendBeacon(e,t)}catch{}}(e,`{"stats": [${t.join(",")}] }`);u=[]}}function h(){return!!r.XC?.head?.querySelector('meta[name="user-staff"]')?.content}r.XC?.addEventListener("pagehide",m),r.XC?.addEventListener("visibilitychange",m)}}]); //# sourceMappingURL=ui_packages_hydro-analytics_hydro-analytics_ts-ui_packages_jump-to-element_model_ts-4f23997e4ea6.js.map