search(t);return n>-1?1e3-n:0})(e,n):e=>(0,tj.dt)(e,t);return(0,tL.d)(e,e=>{let t=`${e.number} ${e.title.trim().toLowerCase()}`,n=r(t);return n>0?{score:n,text:t}:null},tj.UD)})(e.suggestions,t).slice(0,5),icons:e.icons}}function rh(e,t,n,r=""){(0,rd.XX)((0,rd.qy)`
    <ul
      role="listbox"
      class="suggester-container suggester suggestions list-style-none position-absolute"
      data-query="${r}"
    >
      ${e.map(e=>{let t=e.type in n?(0,T.B)(document,n[e.type]):"";return(0,rd.qy)`
      <li class="markdown-title" role="option" id="suggester-issue-${e.id}" data-value="${e.number}">
        <span class="d-inline-block mr-1">${t}</span>
        <small>#${e.number}</small> ${(0,rd._3)(e.title)}
      </li>
    `})}
    </ul>
  `,t)}function rf(e){let t=e.detail;if("#"!==t.key)return;let n=t.item.getAttribute("data-value");t.value=`#${n}`}function rp(e){let{key:t,provide:n,text:r}=e.detail;if("#"!==t)return;if("#"===r)return void rg(e.target);let i=e.target;n(ry(i.getAttribute("data-issue-url"),r,i))}function rg(e){if(!e)return;let t=e.closest("text-expander");t&&"dismiss"in t&&"function"==typeof t.dismiss&&t.dismiss()}function rb(e){rg(e.target)}function rv(e){let{key:t}=e;0>["ArrowRight","ArrowLeft"].indexOf(t)||rg(e.target)}async function ry(e,t,n){let r=await rE(e,t,n),i=document.createElement("div");return rh(r.matches,i,r.icons,t),{fragment:i.firstElementChild,matched:r.matches.length>0}}(0,b.lB)("text-expander[data-issue-url]",{subscribe:e=>{let t=[(0,P.Rt)(e,"text-expander-change",rp),(0,P.Rt)(e,"text-expander-value",rf),(0,P.Rt)(e,"keydown",rv),(0,P.Rt)(e,"click",rb)];return(0,P.Zz)(...t)}});let rw=new Set,rS=new Map;async function rE(e,t,n){let r=await rL(e),i=rm(r,t);if(t.length<3||r.suggestions.length<1e3)return i;let a=t.slice(0,3);(0,ei.G7)("repository_suggester_elastic_search")&&Number.isFinite(Number(t))&&(a=t);let o=rS.get(a);if(o)return rm(o,t);if(!rw.has(a)){rw.add(a);let r=rA(e,a,n);if(0===i.matches.length)return rm(await r,t)}return rm(r,t)}async function rA(e,t,n){let r=new URL(e,window.location.origin);r.searchParams.set("q",t);let i=await rj(r.toString());if(rS.set(t,i),rw.delete(t),rS.size>5){let e=rS.size-5;for(let t of Array.from(rS.keys()).slice(0,e))rS.delete(t)}let a=n?.querySelector("ul.suggestions"),o=a?.getAttribute("data-query");if(a&&o?.startsWith(t)){let e=n?.querySelector("[aria-activedescendant]")?.getAttribute("aria-activedescendant"),t=document.createElement("div"),r=rm(i,o);if(rh(r.matches,t,r.icons),e)for(let n of t.querySelectorAll(`#${e}`))n.setAttribute("aria-selected","true");let s=t.firstElementChild;a.replaceChildren(...s.children)}return i}async function rj(e){let t=await self.fetch(e,{headers:{...(0,_.kt)(),Accept:"application/json"}});if(!t.ok){let e=Error(),n=t.statusText?` ${t.statusText}`:"";throw e.message=`HTTP ${t.status}${n}`,e}return t.json()}let rL=(0,e$.A)(rj);function rC(e){let t=e.detail;if("@"!==t.key)return;let n=t.item.getAttribute("data-value");t.value=`@${n}`}function rk(e){let{key:t,provide:n,text:r}=e.detail;"@"!==t||r?.split(" ").length>1||n(rT(e.target.getAttribute("data-mention-url"),r))}async function rT(e,t){let n=await rq(e),r=document.createElement("div"),i=(function(e,t){if(!t)return e;let n=function(e){if(!e)return()=>2;let t=e.toLowerCase().split("");return(n,r)=>{if(!n)return 0;let i=function(e,t){let n,r,i,a,o=function(e,t){let n=0,r=[];for(;(n=e.indexOf(t,n))>-1;)r.push(n++);return r}(e,t[0]);if(0===o.length)return null;if(1===t.length)return[o[0],1,[]];for(r=0,a=null,i=o.length;r<i;r++){let i=o[r];if(!(n=function(e,t,n){let r=n,i=[];for(let n=1;n<t.length;n+=1){if(-1===(r=e.indexOf(t[n],r)))return;i.push(r++)}return i}(e,t,i+1)))continue;let s=n[n.length-1]-i;(!a||s<a[1])&&(a=[i,s,n])}return a}(n,t);if(!i)return 0;let a=e.length/i[1]/(i[0]/2+1);return r?a+1:a}}(t);return(0,tL.d)(e,e=>{let t=e.description?`${e.name} ${e.description}`.trim().toLowerCase():`${e.login} ${e.name}`.trim().toLowerCase(),r=n(t,e.participant);return r>0?{score:r,text:t}:null},tj.UD)})(n,t).slice(0,5);return(0,rd.XX)((0,rd.qy)`
    <ul role="listbox" class="suggester-container suggester suggestions list-style-none position-absolute">
      ${i.map(e=>{let t="user"===e.type?e.login:e.name,n="user"===e.type?e.name:e.description;return(0,rd.qy)`
      <li role="option" id="suggester-${e.id}-${e.type}-${t}" data-value="${t}">
        <span>${t}</span>
        <small>${n}</small>
      </li>
    `})}
    </ul>
  `,r),{fragment:r.firstElementChild,matched:i.length>0}}(0,b.lB)("text-expander[data-mention-url]",{subscribe:e=>(0,P.Zz)((0,P.Rt)(e,"text-expander-change",rk),(0,P.Rt)(e,"text-expander-value",rC))});let rq=(0,e$.A)(async function(e){let t=await self.fetch(e,{headers:{...(0,_.kt)(),Accept:"application/json"}});if(!t.ok){let e=Error(),n=t.statusText?` ${t.statusText}`:"";throw e.message=`HTTP ${t.status}${n}`,e}return t.json()});(0,p.on)("change","input.js-survey-contact-checkbox",function(e){let t=e.currentTarget,n=t.closest(".js-survey-question-form").querySelector(".js-survey-contact-checkbox-hidden");t.checked?n.setAttribute("disabled","true"):n.removeAttribute("disabled")}),(0,p.on)("details-menu-selected",".js-sync-select-menu-text",function(e){let t=document.querySelector(".js-sync-select-menu-button");t.textContent=e.detail.relatedTarget.querySelector("span[data-menu-button-text]").textContent,t.focus()},{capture:!0}),(0,p.on)("click",'tab-container [role="tab"]',function(e){let{currentTarget:t}=e,n=t.closest("tab-container").querySelector(".js-filterable-field, [data-filter-placeholder-input]");if(n instanceof HTMLInputElement){let e=t.getAttribute("data-filter-placeholder");e&&n.setAttribute("placeholder",e),n.focus()}}),(0,p.on)("tab-container-changed","tab-container",function(e){let t=e.detail.relatedTarget;if(!t)return;let n=t.getAttribute("data-fragment-url"),r=t.querySelector("include-fragment");n&&r&&!r.hasAttribute("src")&&(r.src=n)}),n(91277);var r_=n(95493);async function rx(e){var t;let n=e.currentTarget;if((t=n).getAttribute("data-hovercard-url")&&t.closest("[data-team-hovercards-enabled]"))return void n.classList.remove("tooltipped");let r=n.getAttribute("data-url");if(!r)return;let i=await fetch(r,{headers:{Accept:"application/json"}});if(!i.ok)return;let a=await i.json(),o=n.getAttribute("data-id"),s=document.querySelectorAll(`.js-team-mention[data-id='${o}']`);for(let e of s)e.removeAttribute("data-url");try{0===a.total?a.members.push("This team has no members"):a.total>a.members.length&&a.members.push(`${a.total-a.members.length} more`),rM(s,function(e){if("ListFormat"in Intl)return new Intl.ListFormat().format(e);if(0===e.length)return"";{if(1===e.length)return e[0];if(2===e.length)return e.join(" and ");let t=e[e.length-1];return e.slice(0,-1).concat(`and ${t}`).join(", ")}}(a.members))}catch(t){let e=t.response?t.response.status:500;rM(s,n.getAttribute(404===e?"data-permission-text":"data-error-text"))}}function rM(e,t){for(let n of e)n instanceof HTMLElement&&(n.setAttribute("aria-label",t),n.classList.add("tooltipped","tooltipped-s","tooltipped-multiline"))}function rH(e){if(function(e){let t;try{t=new URL(e.url)}catch{return!0}return t.host!==window.location.host}(e))return;let t=function(){let e=document.querySelector(".js-timeline-marker");return null!=e?e.getAttribute("data-last-modified"):null}();t&&e.headers.set("X-Timeline-Last-Modified",t)}function rI(){let e=rW();if(!e||document.querySelector(".js-pull-discussion-timeline"))return;let t=document.getElementById(e);t&&rD(t)}function rP(e=!0){let t=rW();if(!t)return;let n=document.getElementById(t);if(n)rD(n);else{var r;if(function(e){let t=rB(e,".js-comment-container");return!!t&&((0,eY.d)(t),!0)}(r=t)||rR(r,".js-thread-hidden-comment-ids")||rR(r,".js-review-hidden-comment-ids"))return;let n=document.querySelector("#js-timeline-progressive-loader");n&&e&&rF(t,n)}}function rR(e,t){let n=rB(e,t);return!!n&&(n.addEventListener("page:loaded",function(){rP()}),n.querySelector("button[type=submit]").click(),!0)}function rB(e,t){for(let n of document.querySelectorAll(t)){let t=n.getAttribute("data-hidden-comment-ids");if(t){let r=t.split(","),i=e.match(/\d+/g)?.[0];if(i&&r.includes(i))return n}}return null}async function r$(){return Promise.all(Array.from(document.querySelectorAll(".js-comment-body video")).map(e=>new Promise(t=>{if(e.readyState>=e.HAVE_METADATA)t(e);else{let n=setTimeout(()=>t(e),5e3),r=()=>{clearTimeout(n),t(e)};e.addEventListener("loadeddata",()=>{e.readyState>=e.HAVE_METADATA&&r()}),e.addEventListener("error",()=>r())}})))}async function rO(){return Promise.all(Array.from(document.querySelectorAll(".js-comment-body img")).map(e=>{new Promise(t=>{if(e.complete)t(e);else{let n=setTimeout(()=>t(e),5e3),r=()=>{clearTimeout(n),t(e)};e.addEventListener("load",()=>r()),e.addEventListener("error",()=>r())}})}))}async function rN(){return Promise.all([r$(),rO()])}async function rD(e){await rN(),function(e){let t=e.closest("details, .js-details-container");t&&("DETAILS"===t.nodeName?t.setAttribute("open","open"):(0,eJ.Z)(t)||(0,eJ.kn)(t))}(e);let t=e.querySelector(`[href='#${e.id}']`);if((0,tV.Rt)(e),t){let e=t.getAttribute("data-turbo");t.setAttribute("data-turbo","false"),setTimeout(()=>{t.click()},0),null===e?t.removeAttribute("data-turbo"):t.setAttribute("data-turbo",e)}}async function rF(e,t){let n;if(!t)return;let r=t.getAttribute("data-timeline-item-src");if(!r)return;let i=new URL(r,window.location.origin),a=new URLSearchParams(i.search.slice(1));a.append("anchor",e),i.search=a.toString();try{n=await (0,tn.Ts)(document,i.toString())}catch{return}let o=n.querySelector(".js-timeline-item");if(!o)return;let s=o.getAttribute("data-gid");if(!s)return;let l=document.querySelector(`.js-timeline-item[data-gid='${s}']`);if(l)l.replaceWith(o),rP(!1);else{let e=document.getElementById("js-progressive-timeline-item-container");e&&e.replaceWith(n),rP(!1)}}function rW(){return window.location.hash.slice(1)}document.addEventListener("keydown",e=>{if("Escape"!==e.key||e.target!==document.body)return;let t=document.querySelector(".js-targetable-element:target");t&&(0,r_._H)(t,()=>{(0,q.K3)()})}),document.addEventListener("click",e=>{let t=document.querySelector(".js-targetable-element:target");!(!t||e.target instanceof HTMLAnchorElement)&&e.target instanceof HTMLElement&&(t.contains(e.target)||(0,r_._H)(t,()=>{(0,q.K3)()}))}),n(74868),(0,b.lB)(".js-team-mention",function(e){e.addEventListener("mouseenter",rx)}),(0,g.JW)(".js-needs-timeline-marker-header",function(e,t,n){rH(n)}),(0,p.on)("deprecatedAjaxSend","[data-remote]",function(e){let{request:t}=e.detail;rH(t)}),(0,eX.A)(function(){rP()}),(0,b.lB)(".js-timeline-progressive-focus-container",rI),window.addEventListener("sticky-header-rendered",()=>{rI()}),(0,b.lB)(".js-inline-comments-container",function(e){let t=rW();if(!t