vue-carousel-3d
Version:
Beautiful, flexible and touch supported 3D Carousel for Vue.js
20 lines • 159 kB
JavaScript
System.register(["./vendor.js","./frameworks.js"],(function(e,t){"use strict";var n,o,s,r,i,a,c,l,u,d,m,f,p,h,g,b,v,w,y,j,L,E,T,k,x,S,A,M,H,q,C,_,$,I,D,P,R,N,F,B,O,U,z,W,V,K,J,X,G,Y,Q,Z,ee,te,ne,oe,se,re,ie,ae,ce,le,ue,de,me,fe,pe,he,ge,be,ve,we,ye,je,Le,Ee,Te,ke,xe,Se,Ae,Me,He,qe,Ce,_e,$e,Ie,De,Pe,Re,Ne,Fe,Be,Oe,Ue,ze,We,Ve,Ke,Je,Xe,Ge,Ye,Qe,Ze,et,tt,nt,ot,st,rt,it,at,ct,lt,ut,dt,mt,ft,pt,ht,gt,bt,vt,wt,yt,jt,Lt,Et,Tt,kt,xt,St,At,Mt,Ht,qt,Ct,_t,$t,It;return{setters:[function(e){n=e._,o=e.w,s=e.y,r=e.x,i=e.g,a=e.b,c=e.I,l=e.E,u=e.a,d=e.r,m=e.c,f=e.f,p=e.o,h=e.B,g=e.d,b=e.F,v=e.q,w=e.G,y=e.H,j=e.J,L=e.K,E=e.R,T=e.A,k=e.n,x=e.L,S=e.v,A=e.M,M=e.N,H=e.h,q=e.O,C=e.P,_=e.Q,$=e.U,I=e.V,D=e.W,P=e.X,R=e.Y,N=e.Z,F=e.$,B=e.a0,O=e.a1,U=e.a2,z=e.e,W=e.i,V=e.a3,K=e.a4,J=e.a5,X=e.a6,G=e.a7},function(e){Y=e.a9,Q=e.f,Z=e.H,ee=e.V,te=e.ai,ne=e.O,oe=e.w,se=e.l,re=e.o,ie=e.ak,ae=e.a,ce=e.r,le=e.M,ue=e.q,de=e.an,me=e.ao,fe=e.ap,pe=e.aq,he=e.ar,ge=e.L,be=e.K,ve=e.c,we=e.as,ye=e.at,je=e.u,Le=e.au,Ee=e.af,Te=e.b,ke=e.I,xe=e.D,Se=e.av,Ae=e.aw,Me=e.k,He=e.m,qe=e.ag,Ce=e.ah,_e=e.ax,$e=e.N,Ie=e.ay,De=e.az,Pe=e.aA,Re=e.T,Ne=e.d,Fe=e.g,Be=e.W,Oe=e.aB,Ue=e.aC,ze=e.aD,We=e.aE,Ve=e.aF,Ke=e.aG,Je=e.aH,Xe=e.aI,Ge=e.aJ,Ye=e.aK,Qe=e.aL,Ze=e.aM,et=e.aN,tt=e.aO,nt=e.aP,ot=e.Q,st=e.aQ,rt=e.aR,it=e.t,at=e.aS,ct=e.aT,lt=e.aU,ut=e.aV,dt=e.aW,mt=e.am,ft=e.aX,pt=e.p,ht=e.aY,gt=e.aZ,bt=e.a_,vt=e.a$,wt=e.ac,yt=e.b0,jt=e.b1,Lt=e.b2,Et=e.b3,Tt=e.ae,kt=e.b4,xt=e.G,St=e.b5,At=e.F,Mt=e.b6,Ht=e.b7,qt=e.b8,Ct=e.B,_t=e.b9,$t=e.ba,It=e.a6}],execute:function(){let e=class EmojiPickerElement extends HTMLElement{open(){var e;this.hidden=!1,null===(e=this.filterInput)||void 0===e||e.focus(),document.addEventListener("keydown",Pt),document.addEventListener("click",Rt)}close(){this.hidden=!0,document.removeEventListener("keydown",Pt),document.removeEventListener("click",Rt)}disonnectedCallback(){document.removeEventListener("keydown",Pt)}reset(){const e=this.querySelector(".js-original-emoji-category"),t=this.querySelector(".js-original-emoji-category-tab"),n=this.querySelector('[role="tablist"] [role="tab"][aria-selected="true"]'),o=Dt(this),s=this.querySelector(".js-originally-selected-emoji");if(s){const e=this.querySelector(".selected-emoji");e&&e.classList.remove("selected-emoji"),s.classList.add("selected-emoji")}null==n||n.removeAttribute("aria-selected"),null==e||e.setAttribute("aria-selected","true"),o.hidden=!0,t.hidden=!1,this.clear()}clear(){this.filterInput&&(this.filterInput.value=""),this.emojiList.setAttribute("value",""),this.filterTabButton.hidden=!0}filter(e){const t=e.currentTarget;this.emojiList.setAttribute("value",t.value);const n=this.querySelector('[role="tablist"] [role="tab"][aria-selected="true"]');if(n.hasAttribute("data-emoji-picker-filter-tab-button")||n.classList.add("emoji-picker-prior-selected-tab-button"),t.value){this.filterTabButton.hidden=!1,"true"===this.filterTabButton.getAttribute("aria-selected")||(this.filterTabButton.click(),t.focus())}else{this.filterTabButton.hidden=!0;const e=this.querySelector(".emoji-picker-prior-selected-tab-button");e&&e.click()}}onFuzzyListSorted(e){const t=Number(e.detail)>0;this.noResults.hidden=t,this.emojiList.hidden=!t,this.resultsHeader.hidden=!t}};function Dt(e){const t=e.querySelectorAll('[role="tablist"] [role="tab"]'),n=e.querySelector('[role="tablist"] [role="tab"][aria-selected="true"]');return e.querySelectorAll('[role="tabpanel"]')[Array.from(t).indexOf(n)]}function Pt(e){if(!(e.target instanceof HTMLElement))return;const t=e.target.closest(".js-emoji-picker");if(t&&t instanceof HTMLElement&&!t.hidden)switch(e.key){case"ArrowRight":case"ArrowLeft":case"ArrowUp":case"ArrowDown":e.preventDefault(),function(e,t){const n=Dt(e),o=Array.from(n.querySelectorAll(".js-emoji-button")),s=n.querySelector(".selected-emoji.js-emoji-button"),r=function(e){let t,n=0;const o=e[0].getBoundingClientRect().top;for(const s of e){if(t=s.getBoundingClientRect(),o<t.top)break;n+=1}return n}(o),i=function(e,t){const n=[[]];let o=0;for(let s=0;s<e.length;s++){const r=e[s];s>0&&s%t==0&&(o+=1,n.push([])),n[o].push(r)}return n}(o,r);let a=0,c=0;if(s){const e=function(e,t){let n=0,o=0,s=[],r=-1;for(let i=0;i<e.length;i++){if(s=e[i],r=s.indexOf(t),r>-1){o=r;break}n+=1}return{row:n,col:o}}(i,s);switch(a=e.row,c=e.col,s.classList.remove("selected-emoji"),t){case"ArrowRight":c+=1;break;case"ArrowDown":a+=1;break;case"ArrowLeft":c-=1;break;case"ArrowUp":a-=1}}const l=i.length-1,u=c>i[l].length-1,d=a===l;a<0?(a=l,u&&(a-=1)):(a>l||d&&u&&"ArrowDown"===t)&&(a=0);const m=i[a].length-1;c<0?c=m:c>m&&(c=0);const f=i[a][c];f.classList.add("selected-emoji"),f.focus()}(t,e.key)}}function Rt(e){let t=e.target;"closest"in t||(t=t.parentNode);const n=t.closest("emoji-picker");for(const o of document.querySelectorAll("emoji-picker"))o!==n&&o.close()}n([o],e.prototype,"emojiList",void 0),n([o],e.prototype,"filterTabButton",void 0),n([o],e.prototype,"noResults",void 0),n([o],e.prototype,"resultsHeader",void 0),n([o],e.prototype,"filterInput",void 0),e=n([s],e);let Nt=class GitCloneHelpElement extends HTMLElement{updateURL(e){const t=e.currentTarget,n=t.getAttribute("data-url")||"";if(this.helpField.value=n,t.matches(".js-git-protocol-clone-url"))for(const o of this.helpTexts)o.textContent=n;for(const o of this.cloneURLButtons)o.classList.remove("selected");t.classList.add("selected")}};n([o],Nt.prototype,"helpField",void 0),n([r],Nt.prototype,"helpTexts",void 0),n([r],Nt.prototype,"cloneURLButtons",void 0),Nt=n([s],Nt);const Ft=new IntersectionObserver(e=>{for(const t of e){const e=(t.target.getAttribute("toggle-class")||"").split(" ");0!==e.length&&(t.isIntersecting&&t.intersectionRatio>=t.target.intersectionRatio?t.target.classList.add(...e):t.target.classList.remove(...e))}},{root:null,rootMargin:"0px",threshold:[.1,.2,.3,.4,.5]});class InViewportElement extends HTMLElement{connectedCallback(){Ft.observe(this)}get intersectionRatio(){return(Number(this.getAttribute("threshold"))||10)/100}}window.customElements.get("in-viewport")||(window.InViewportElement=InViewportElement,window.customElements.define("in-viewport",InViewportElement));let Bt=class NotificationIndicatorElement extends HTMLElement{constructor(){super(),this.addEventListener("socket:message",this.update.bind(this))}update(e){const t=e.detail.data;this.link.setAttribute("aria-label",t.aria_label),this.link.setAttribute("data-ga-click",t.ga_click),this.modifier.setAttribute("class",t.span_class)}};n([o],Bt.prototype,"link",void 0),n([o],Bt.prototype,"modifier",void 0),Bt=n([s],Bt);let Ot=class NotificationsListSubscriptionFormElement extends HTMLElement{async submitForm(e){let t;e.preventDefault(),Y();try{t=await Q(this.form.action,{method:this.form.method,body:new FormData(this.form)})}catch(n){return void Z()}this.applyInputsCheckedPropertiesToAttributesForNextFormReset(),this.detailsDialog.toggle(!1),this.updateSocialCount(t.count)}applyInputsCheckedPropertiesToAttributesForNextFormReset(){for(const e of[...this.subscriptionRadios,...this.threadTypeCheckboxes])e.toggleAttribute("checked",e.checked)}resetForm(){this.form.reset()}updateSocialCount(e){this.socialCount&&(this.socialCount.textContent=e)}changeSubscription(e){const t="custom"===e.target.value;for(const n of this.threadTypeCheckboxes)n.checked=t}changeThreadTypes(){let e;e=this.threadTypeCheckboxes.some(e=>e.checked)?this.querySelector('input[name="do"][value="custom"]'):this.querySelector('input[name="do"][value="included"]'),e&&(e.checked=!0)}};n([o],Ot.prototype,"form",void 0),n([o],Ot.prototype,"detailsDialog",void 0),n([o],Ot.prototype,"socialCount",void 0),n([r],Ot.prototype,"subscriptionRadios",void 0),n([r],Ot.prototype,"threadTypeCheckboxes",void 0),Ot=n([s],Ot);class PasswordStrengthElement extends HTMLElement{connectedCallback(){this.addEventListener("input",Ut)}disconnectedCallback(){this.removeEventListener("input",Ut)}}function Ut(e){const t=e.currentTarget;if(!(t instanceof PasswordStrengthElement))return;const n=e.target;if(!(n instanceof HTMLInputElement))return;const o=n.form;if(!(o instanceof HTMLFormElement))return;const s=function(e,t){const n={valid:!1,hasMinimumCharacterCount:e.length>=t.minimumCharacterCount,hasMinimumPassphraseLength:0!==t.passphraseLength&&e.length>=t.passphraseLength,hasLowerCase:/[a-z]/.test(e),hasNumber:/\d/.test(e)};return n.valid=n.hasMinimumPassphraseLength||n.hasMinimumCharacterCount&&n.hasLowerCase&&n.hasNumber,n}(n.value,{minimumCharacterCount:Number(i(t,"minimum-character-count")),passphraseLength:Number(t.getAttribute("passphrase-length"))});if(s.valid){n.setCustomValidity("");const e=t.querySelector("dl.form-group");e&&(e.classList.remove("errored"),e.classList.add("successed"))}else n.setCustomValidity(i(t,"invalid-message"));!function(e,t){const n=e.querySelector("[data-more-than-n-chars]"),o=a(e,"[data-min-chars]"),s=a(e,"[data-number-requirement]"),r=a(e,"[data-letter-requirement]"),c=i(e,"error-class").split(" ").filter(e=>e.length>0),l=i(e,"pass-class").split(" ").filter(e=>e.length>0);for(const i of[n,o,s,r])null==i||i.classList.remove(...c,...l);if(t.hasMinimumPassphraseLength&&n)n.classList.add(...l);else if(t.valid)o.classList.add(...l),s.classList.add(...l),r.classList.add(...l);else{const e=t.hasMinimumCharacterCount?l:c,i=t.hasNumber?l:c,a=t.hasLowerCase?l:c;null==n||n.classList.add(...c),o.classList.add(...e),s.classList.add(...i),r.classList.add(...a)}}(t,s),ee(o)}window.customElements.get("password-strength")||(window.PasswordStrengthElement=PasswordStrengthElement,window.customElements.define("password-strength",PasswordStrengthElement));class PollIncludeFragmentElement extends c{async fetch(e,t=1e3){const n=await super.fetch(e);return 202===n.status?(await new Promise(e=>setTimeout(e,t)),this.fetch(e,1.5*t)):n}}window.customElements.get("poll-include-fragment")||(window.PollIncludeFragmentElement=PollIncludeFragmentElement,window.customElements.define("poll-include-fragment",PollIncludeFragmentElement));class PreciseTimeAgoElement extends l{connectedCallback(){zt.push(this),Wt||(Vt(),Wt=window.setInterval(Vt,1e3))}disconnectedCallback(){const e=zt.indexOf(this);-1!==e&&zt.splice(e,1),zt.length||(window.clearInterval(Wt),Wt=void 0)}getFormattedDate(){const e=this.date;if(!e)return;const t=(new Date).getTime()-e.getTime(),n=Math.floor(t/1e3),o=Math.floor(n/60),s=Math.floor(o/60),r=Math.floor(s/24),i=n-60*o,a=o-60*s;return o<1?`${n}s`:s<1?`${o}m ${i}s`:r<1?`${s}h ${a}m ${i}s`:`${r}d ${s-24*r}h ${a}m ${i}s`}}const zt=[];let Wt;function Vt(){for(const e of zt)e.textContent=e.getFormattedDate()||""}window.customElements.get("precise-time-ago")||(window.PreciseTimeAgoElement=PreciseTimeAgoElement,window.customElements.define("precise-time-ago",PreciseTimeAgoElement));function Kt(){try{return(window.localStorage.getItem("dismissed_prompts")||"").split(",")}catch(e){return[]}}let Jt=class SignupPromptElement extends HTMLElement{get promptType(){return this.getAttribute("data-prompt")||""}connectedCallback(){this.hidden=Kt().includes(this.promptType)}dismiss(){try{const e=Kt().concat(this.promptType||[]);window.localStorage.setItem("dismissed_prompts",e.join(","))}catch(e){}finally{this.hidden=!0}}};Jt=n([s],Jt),u("deprecatedAjaxSend","[data-remote]",(function(e){e.currentTarget===e.target&&(e.defaultPrevented||e.currentTarget.classList.add("loading"))})),u("deprecatedAjaxComplete","[data-remote]",(function(e){e.currentTarget===e.target&&e.currentTarget.classList.remove("loading")})),d("form.js-ajax-pagination, .js-ajax-pagination form",(async function(e,t){const n=m(e,".js-ajax-pagination");let o;try{o=await t.html()}catch(s){if(s.response&&404===s.response.status)return void n.remove();throw s}n.replaceWith(o.html),f(e,"page:loaded")}));const Xt=new WeakMap;function Gt(e,t){var n,o,s,r,i,a;t.classList.remove("is-loading","successed","errored","warn"),e.classList.remove("is-autocheck-loading","is-autocheck-successful","is-autocheck-errored");const c=t.querySelector("p.note");if(c){const e=Xt.get(c);e&&(c.innerHTML=e)}"DL"===t.tagName?(null===(n=t.querySelector("dd.error"))||void 0===n||n.remove(),null===(o=t.querySelector("dd.warning"))||void 0===o||o.remove(),null===(s=t.querySelector("dd.success"))||void 0===s||s.remove()):(null===(r=t.querySelector("div.error"))||void 0===r||r.remove(),null===(i=t.querySelector("div.warning"))||void 0===i||i.remove(),null===(a=t.querySelector("div.success"))||void 0===a||a.remove())}function Yt(e){const t=e.closest("form");if(!t)return;const n=t.querySelector(".js-auto-complete-button");n instanceof HTMLButtonElement&&(n.disabled=!e.value)}p("auto-check",(function(e){const t=e.querySelector("input");if(!t)return;const n=t.closest(".form-group")||e,o=t.form;let s;function r(){return s||(s=`input-check-${(1e4*Math.random()).toFixed(0)}`),s}const i=t.getAttribute("aria-describedby");t.addEventListener("focusout:delay",()=>{t.setAttribute("aria-describedby",[s,i].join(" "))});const a=n.querySelector("p.note");a&&(a.id||(a.id=r()),Xt.set(a,a.innerHTML)),e.addEventListener("loadstart",()=>{Gt(t,n),n.classList.add("is-loading"),t.classList.add("is-autocheck-loading"),ee(o)}),e.addEventListener("loadend",()=>{n.classList.remove("is-loading"),t.classList.remove("is-autocheck-loading")}),t.addEventListener("auto-check-success",async e=>{t.classList.add("is-autocheck-successful"),n.classList.add("successed"),ee(o);const{response:s}=e.detail;if(!s)return;const i=await s.text();if(i){if(a instanceof HTMLElement)a.innerHTML=i,te(a);else{const e=200===s.status,o="DL"===n.tagName?"dd":"div",a=document.createElement(o);a.id=r(),a.classList.add(e?"success":"warning"),a.innerHTML=i,n.append(a),n.classList.add(e?"successed":"warn"),te(a),e&&(a.hidden=document.activeElement!==t)}f(t,"auto-check-message-updated")}}),t.addEventListener("auto-check-error",async e=>{t.classList.add("is-autocheck-errored"),n.classList.add("errored"),ee(o);const{response:s}=e.detail;if(!s)return;const i=await s.text();if(a instanceof HTMLElement)a.innerHTML=i||"Something went wrong",te(a);else{const e="DL"===n.tagName?"dd":"div",t=document.createElement(e);t.id=r(),t.classList.add("error"),t.innerHTML=i||"Something went wrong",n.append(t),te(t)}}),t.addEventListener("input",()=>{t.removeAttribute("aria-describedby"),t.value||Gt(t,n)}),t.addEventListener("blur",()=>{const e=n.querySelector(".success");e&&(e.hidden=!0)}),t.addEventListener("focus",()=>{const e=n.querySelector(".success");e&&(e.hidden=!1)}),o.addEventListener("reset",()=>{Gt(t,n)})})),p("auto-complete",(function(e){e.addEventListener("loadstart",()=>e.classList.add("is-auto-complete-loading")),e.addEventListener("loadend",()=>e.classList.remove("is-auto-complete-loading"))})),p("auto-complete",{constructor:h,initialize:Yt}),u("auto-complete-change","auto-complete",(function(e){Yt(e.currentTarget)}));let Qt=null;function Zt(e){const t=e.target;if(!(t instanceof HTMLInputElement||t instanceof HTMLSelectElement))return;const n=t.form;ce(n)}u("submit","[data-autosearch-results-container]",(async function(e){const t=e.currentTarget;if(!(t instanceof HTMLFormElement))return;e.preventDefault(),null==Qt||Qt.abort(),t.classList.add("is-sending");const n=new URL(t.action,window.location.origin),o=t.method,s=ne(t);let r=null;"get"===o?n.search=s:r=new FormData(t);const{signal:i}=Qt=new AbortController,a=new Request(n.toString(),{method:o,body:r,signal:i,headers:{Accept:"text/html","X-Requested-With":"XMLHttpRequest"}});let c;try{c=await fetch(a)}catch(d){}if(t.classList.remove("is-sending"),!c||!c.ok||i.aborted)return;const l=t.getAttribute("data-autosearch-results-container"),u=l?document.getElementById(l):null;u&&(u.innerHTML="",u.appendChild(oe(document,await c.text()))),se(null,"",`?${s}`)})),re("input[data-autoselect], textarea[data-autoselect]",(async function(e){await ie(),e.select()})),u("change","form[data-autosubmit]",(function(e){const t=e.currentTarget;ce(t)})),u("change","input[data-autosubmit], select[data-autosubmit]",Zt);const en=g(Zt,300);async function tn(e){const t=e.getAttribute("data-url")||"";if(await async function(e){const t=e;if(!t)return!1;try{const e=await fetch(t,{headers:{Accept:"application/json"}});return!!e.ok&&(await e.json()).has_gravatar}catch(n){return!1}}(t)){const t=e.getAttribute("data-gravatar-text");null!=t&&(e.textContent=t)}}p("input[data-throttled-autosubmit]",{subscribe:e=>ae(e,"input",en)}),p(".js-detect-gravatar",(function(e){tn(e)})),le(".js-csv-filter-field",(function(e){const t=e.target.value.toLowerCase();for(const n of document.querySelectorAll(".js-csv-data tbody tr"))n instanceof HTMLElement&&n.textContent&&(n.hidden=!!t&&!n.textContent.toLowerCase().includes(t))}));let nn=!1;function on(e,t){return document.querySelector(`#${e}LC${t}`)}function sn({blobRange:e,anchorPrefix:t}){if(0!==document.querySelectorAll(".js-file-line").length&&(function(){for(const e of document.querySelectorAll(".js-file-line.highlighted"))e.classList.remove("highlighted");for(const e of document.querySelectorAll(".js-file-line .highlighted")){const t=m(e,".js-file-line");e.replaceWith(...e.childNodes),t.normalize()}}(),e))if(null===e.start.column||null===e.end.column)for(let n=e.start.line;n<=e.end.line;n+=1){const e=on(t,n);e&&e.classList.add("highlighted")}else if(e.start.line===e.end.line&&null!=e.start.column&&null!=e.end.column){const n=pe(e,e=>on(t,e));if(n){const e=document.createElement("span");e.classList.add("highlighted"),he(n,e)}}}function rn(){const e=de(window.location.hash);sn(e),function(){const e=document.querySelector(".js-file-line-actions");if(!e)return;const t=document.querySelectorAll(".js-file-line.highlighted"),n=t[0];if(n){!function(e){const t=[];for(const o of e)t.push(o.textContent);const n=document.getElementById("js-copy-lines");if(n instanceof b){n.textContent=`Copy ${1===e.length?"line":"lines"}`,n.value=t.join("\n");const o=`Blob, copyLines, numLines:${e.length.toString()}`;n.setAttribute("data-ga-click",o)}}(t),function(e){const t=document.getElementById("js-view-git-blame");if(!t)return;t.setAttribute("data-ga-click",`Blob, viewGitBlame, numLines:${e.toString()}`)}(t.length);const o=function(e){const t=document.querySelector(".js-permalink-shortcut");if(t instanceof HTMLAnchorElement){const n=`${t.href}${window.location.hash}`,o=document.getElementById("js-copy-permalink");if(o instanceof b){o.value=n;const t=`Blob, copyPermalink, numLines:${e.toString()}`;o.setAttribute("data-ga-click",t)}return n}}(t.length);o&&function(e,t){const n=document.getElementById("js-new-issue");if(n instanceof HTMLAnchorElement){if(!n.href)return;const o=new URL(n.href,window.location.origin),s=new URLSearchParams(o.search.slice(1));s.set("permalink",e),o.search=s.toString(),n.href=o.toString(),n.setAttribute("data-ga-click",`Blob, newIssue, numLines:${t.toString()}`)}}(o,t.length),e.style.top=`${n.offsetTop-2}px`,e.classList.remove("d-none")}else e.classList.add("d-none")}();const{blobRange:t,anchorPrefix:n}=e,o=t&&on(n,t.start.line);if(!nn&&o){o.scrollIntoView(),m(o,".blob-wrapper, .js-blob-wrapper").scrollLeft=0}nn=!1}ue((function(){if(document.querySelector(".js-file-line-container")){setTimeout(rn,0);const e=window.location.hash;for(const t of document.querySelectorAll(".js-update-url-with-hash"))if(t instanceof HTMLAnchorElement)t.hash=e;else if(t instanceof HTMLFormElement){const n=new URL(t.action,window.location.origin);n.hash=e,t.action=n.toString()}}})),u("click",".js-line-number",(function(e){const t=de(e.currentTarget.id),{blobRange:n}=t,o=me(window.location.hash);o&&e.shiftKey&&(t.blobRange={start:o.start,end:n.end}),function(e){const t=window.scrollY;nn=!0,e(),window.scrollTo(0,t)}(()=>{window.location.hash=fe(t)})})),u("submit",".js-jump-to-line-form",(function(e){const t=e.currentTarget.querySelector(".js-jump-to-line-field").value.replace(/[^\d-]/g,"").split("-").map(e=>parseInt(e,10)).filter(e=>e>0).sort((e,t)=>e-t);t.length&&(window.location.hash=`L${t.join("-L")}`),e.preventDefault()}));let an,cn=null;function ln(e){const t=document.querySelector(".js-membership-tabs");if(t){const n=e.querySelectorAll(".js-bulk-actions-toggle:checked");t.classList.toggle("d-none",n.length>0)}}u("change",".js-bulk-actions-toggle",(function(e){const t=e.currentTarget,n=m(t,".js-bulk-actions-container");f(n,"bulk-actions:update")})),u("bulk-actions:update",".js-bulk-actions-container",g((async function(e){const t=e.target;if(!(t instanceof HTMLElement))return;const n=a(t,".js-bulk-actions"),o=!!t.querySelector(".js-bulk-actions-toggle:checked");null==cn||cn.abort();const{signal:s}=cn=new AbortController;let r="";try{const e=await fetch(function(e){const t=new URL(i(e,"data-bulk-actions-url"),window.location.origin),n=new URLSearchParams(t.search.slice(1)),o=e.getAttribute("data-bulk-actions-parameter"),s=v(e,".js-bulk-actions-toggle:checked",HTMLInputElement);if(o){const e=s.map(e=>i(m(e,".js-bulk-actions-item"),"data-bulk-actions-id")).sort();for(const t of e)n.append(`${o}[]`,t)}else for(const r of s.sort((e,t)=>e.value>t.value?1:-1))n.append(r.name,r.value);return t.search=n.toString(),t.toString()}(t),{signal:s,headers:{"X-Requested-With":"XMLHttpRequest"}});if(!e.ok)return;r=await e.text()}catch(c){}s.aborted||r&&(o?(ln(t),n.innerHTML=r):(n.innerHTML=r,ln(t)),f(t,"bulk-actions:updated"))}),100)),(async()=>{await ge;const e=function(e){try{return JSON.parse(window.localStorage.getItem(e)||"{}")}catch(t){return{}}}("bundle-urls")||{},t=function(){const e={};for(const t of document.getElementsByTagName("script")){const n=t.src.match(/\/([\w-]+)-[0-9a-f]{32,}\.js$/);n&&(e[`${n[1]}.js`]=t.src)}for(const t of document.getElementsByTagName("link")){const n=t.href.match(/\/([\w-]+)-[0-9a-f]{32,}\.css$/);n&&(e[`${n[1]}.css`]=t.href)}return e}();!function(e,t){try{window.localStorage.setItem(e,JSON.stringify(t))}catch(n){}}("bundle-urls",t);const n=Object.keys(t).filter(n=>{const o=t[n];return e[n]!==o});n.length&&be({downloadedBundles:n})})();let un=!1;function dn(){an=document.activeElement,document.body&&document.body.classList.toggle("intent-mouse",un)}function mn(e){e.preventDefault(),e.stopPropagation()}document.addEventListener("mousedown",(function(){un=!0,an===document.activeElement&&dn()}),{capture:!0}),document.addEventListener("keydown",(function(){un=!1}),{capture:!0}),document.addEventListener("focusin",dn,{capture:!0}),p("a.btn.disabled",{subscribe:e=>ae(e,"click",mn)}),async function(){await ve,w()}(),p(".js-check-all-container",{constructor:HTMLElement,subscribe:y});function fn(e){const t=e.querySelector(".js-clipboard-clippy-icon"),n=e.querySelector(".js-clipboard-check-icon");e.classList.toggle("ClipboardButton--success"),t&&t.classList.toggle("d-none"),n&&n.classList.toggle("d-none")}function pn(e){const t=e.querySelectorAll(".js-toggle-hidden");for(const o of t)o.hidden=!o.hidden;const n=e.querySelectorAll(".js-toggle-disabled");for(const o of n)o.getAttribute("aria-disabled")?o.removeAttribute("aria-disabled"):o.setAttribute("aria-disabled","true")}u("clipboard-copy","[data-copy-feedback]",e=>{const t=e.currentTarget,n=i(t,"data-copy-feedback"),o=t.getAttribute("aria-label"),s=t.getAttribute("data-tooltip-direction")||"s";t.setAttribute("aria-label",n),t.classList.add("tooltipped",`tooltipped-${s}`),t instanceof HTMLElement&&(te(t),setTimeout(()=>{o?t.setAttribute("aria-label",o):t.removeAttribute("aria-label"),t.classList.remove("tooltipped",`tooltipped-${s}`)},2e3))}),u("clipboard-copy",".js-clipboard-copy",(function({currentTarget:e}){e instanceof HTMLElement&&(fn(e),setTimeout(fn,2e3,e))})),u("submit",".js-toggle-hidden-codespace-form",(function(e){pn(e.currentTarget)})),u("submit","form.js-codespaces-delete-form",(async function(e){e.preventDefault();const t=e.currentTarget;try{const e=await fetch(t.action,{method:t.method,body:new FormData(t),headers:{Accept:"text/fragment+html","X-Requested-With":"XMLHttpRequest"}});if(e.ok){const n=oe(document,await e.text());(function(e){return e.closest("[data-replace-remote-form-target]")})(t).replaceWith(n)}else{if(401!==e.status)throw new Error(`Unexpected response: ${e.statusText}`);t.submit()}}finally{pn(t)}}));let hn=class ExportBranchElement extends HTMLElement{constructor(){super(...arguments),this.abortPoll=null}connectedCallback(){this.abortPoll=new AbortController,this.loadingIndicator.hidden||this.startPoll()}disconnectedCallback(){var e;null===(e=this.abortPoll)||void 0===e||e.abort()}async exportBranch(e){e.preventDefault(),(await fetch(this.form.action,{method:this.form.method,body:new FormData(this.form),headers:{Accept:"text/fragment+html","X-Requested-With":"XMLHttpRequest"}})).ok&&(this.form.hidden=!0,this.loadingIndicator.hidden=!1,this.startPoll())}async startPoll(){const e=this.getAttribute("data-exported-codespace-url")||"",t=await this.poll(e);if(t)if(t.ok)this.loadingIndicator.hidden=!0,this.viewBranchLink.hidden=!1;else{const e=this.getAttribute("data-export-error-redirect-url")||"";window.location.href=e}}async poll(e,t=1e3){var n,o;if(null===(n=this.abortPoll)||void 0===n?void 0:n.signal.aborted)return;const s=await fetch(e,{signal:null===(o=this.abortPoll)||void 0===o?void 0:o.signal});return 202===s.status?(await new Promise(e=>setTimeout(e,t)),this.poll(e,1.5*t)):s}};n([o],hn.prototype,"form",void 0),n([o],hn.prototype,"loadingIndicator",void 0),n([o],hn.prototype,"viewBranchLink",void 0),hn=n([s],hn),u("submit",".js-prefetch-codespace-location",(async function(e){const t=e.currentTarget,n=t.querySelector('[name="codespace[location]"]');if(""!==n.value)return;e.preventDefault();const o=t.querySelector("button[type=submit]");o instanceof HTMLInputElement&&(o.disabled=!0);const s=t.getAttribute("data-codespace-locations-url");if(!s)return;const r=await async function(e){const t=await Q(e);if(t)return t.current}(s);r&&(n.value=r),t.submit()}));const gn={}.hasOwnProperty,bn={host:"",type:"page_view",dimensions:{},measures:{},context:{},actor:{},image:new Image,performance:{},expectedPerformanceTimingKeys:["connectEnd","connectStart","domComplete","domContentLoadedEventEnd","domContentLoadedEventStart","domInteractive","domLoading","domainLookupEnd","domainLookupStart","fetchStart","loadEventEnd","loadEventStart","navigationStart","redirectEnd","redirectStart","requestStart","responseEnd","responseStart","secureConnectionStart","unloadEventEnd","unloadEventStart"],recordPageView(){return this.applyMetaTags(),null!=this.app&&(null==this.host?(console&&console.warn&&console.warn("Host not set, you are doing something wrong"),!1):(this.image.src=this._src(),this._clearPerformance(),!0))},setHost(e){this.host=e},setApp(e){this.app=e},setDimensions(e){this.dimensions=e},addDimensions(e){let t;null==this.dimensions&&(this.dimensions={});const n=[];for(t in e){if(!gn.call(e,t))continue;const o=e[t];n.push(this.dimensions[t]=o)}return n},setMeasures(e){this.measures=e},addMeasures(e){let t;null==this.measures&&(this.measures={});const n=[];for(t in e){if(!gn.call(e,t))continue;const o=e[t];n.push(this.measures[t]=o)}return n},setContext(e){this.context=e},addContext(e){let t;null==this.context&&(this.context={});const n=[];for(t in e){if(!gn.call(e,t))continue;const o=e[t];n.push(this.context[t]=o)}return n},setActor(e){this.actor=e},push(e){return this.applyCall(e)},enablePerformance(){this.performance=this._performanceTiming()},_recordSrc(e,t,n,o){return`//${this.host}/${this.app}/${e}?${this._queryString(t,n,o)}`},_src(){return`//${this.host}/${this.app}/${this.type}?${this._queryString()}`},_queryString(e,t,n){let o,s;const r=this._params(),i=[];for(o in r)s=r[o],i.push(`dimensions[${o}]=${s}`);return i.push(this._encodeObject("dimensions",Object.assign({},this.dimensions,e))),i.push(this._encodeObject("measures",Object.assign({},this.measures,t))),null!=this.performance&&i.push(this._encodeObject("measures",{performance_timing:String(this.performance)})),i.push(this._encodeObject("context",Object.assign({},this.context,n))),i.push(this._actor()),i.push(this._encodeObject("dimensions",{cid:this._clientId()})),i.join("&")},_clearPerformance(){this.performance=null},_performanceTiming(){if(null==window.performance||null==window.performance.timing||null==window.performance.timing.navigationStart)return null;const e=this.expectedPerformanceTimingKeys.reduce((e,t)=>{const n=window.performance.timing[t];return e[t]="number"==typeof n?n:0,e},{}),t=[],n=e.navigationStart;for(const o in e){const s=e[o],r=0===s?null:s-n;t.push(r)}return`1-${t.join("-")}`},_params(){return{page:this._encode(this._page()),title:this._encode(this._title()),referrer:this._encode(this._referrer()),user_agent:this._encode(this._agent()),screen_resolution:this._encode(this._screenResolution()),pixel_ratio:this._encode(this._pixelRatio()),browser_resolution:this._encode(this._browserResolution()),tz_seconds:this._encode(this._tzSeconds()),timestamp:(new Date).getTime()}},_page(){try{const e=document.querySelector("meta[name=octolytics-location]");return e instanceof HTMLMetaElement?document.location.origin+e.content:document.location.href}catch(e){}},_title(){try{return document.title}catch(e){}},_referrer(){let e="";try{e=window.top.document.referrer}catch(t){if(window.parent)try{e=window.parent.document.referrer}catch(t){}}return""===e&&(e=document.referrer),e},_agent(){try{return navigator.userAgent}catch(e){}},_screenResolution(){try{return`${screen.width}x${screen.height}`}catch(e){return"unknown"}},_pixelRatio:()=>window.devicePixelRatio,_browserResolution(){let e=0,t=0;try{return"number"==typeof window.innerWidth?(t=window.innerWidth,e=window.innerHeight):null!=document.documentElement&&null!=document.documentElement.clientWidth?(t=document.documentElement.clientWidth,e=document.documentElement.clientHeight):null!=document.body&&null!=document.body.clientWidth&&(t=document.body.clientWidth,e=document.body.clientHeight),`${t}x${e}`}catch(n){return"unknown"}},_tzSeconds(){try{return-60*(new Date).getTimezoneOffset()}catch(e){return""}},_encodeObject(e,t){const n=[];if(Array.isArray(t))for(const o of t)n.push(this._encodeObject(`${e}[]`,o));else if("object"==typeof t)for(const o in t)n.push(this._encodeObject(`${e}[${o}]`,t[o]));else n.push(`${e}=${this._encode(t)}`);return n.join("&")},_actor(){let e,t,n;const o=[],s=this.actor;for(t in s){const r=s[t],i=`dimensions[actor_${t}]`;if(Array.isArray(r))for(e=0,n=r.length;e<n;e++){const t=r[e];o.push(`${i}[]=${this._encode(t)}`)}else o.push(`${i}=${this._encode(r)}`)}return o.join("&")},_clientId(){let e=we();return""===e&&(e=ye()),e},_encode:e=>null!=e?window.encodeURIComponent(e):"",applyQueuedCalls(e){const t=[];for(const n of e)t.push(this.applyCall(n));return t},applyCall(e){const t=e[0],n=e.slice(1);return"function"==typeof this[t]?this[t](...n):console&&console.warn&&console.warn(`${t} is not a valid method`)},applyMetaTags(){const e=this.loadMetaTags();return e.host&&this.setHost(e.host),e.app&&this.setApp(e.app),this._objectIsEmpty(e.actor)||this.setActor(e.actor),this.addDimensions(e.dimensions),this.addMeasures(e.measures),this.addContext(e.context)},loadMetaTags(){let e,t;const n={dimensions:{},measures:{},context:{},actor:{}},o=document.getElementsByTagName("meta");for(e=0,t=o.length;e<t;e++){const t=o[e];if(t.name&&t.content){const e=t.name.match(this.octolyticsMetaTagName);if(e)switch(e[1]){case"host":n.host=t.content;break;case"app-id":case"app":n.app=t.content;break;case"dimension":this._addField(n.dimensions,e[2],t);break;case"measure":this._addField(n.measures,e[2],t);break;case"context":this._addField(n.context,e[2],t);break;case"actor":this._addField(n.actor,e[2],t)}}}const s=document.querySelector("meta[name=visitor-payload]");if(s instanceof HTMLMetaElement){const e=JSON.parse(atob(s.content));this.addDimensions(e)}return n},_addField(e,t,n){e[t]=n.content},_objectIsEmpty(e){let t;for(t in e)if(gn.call(e,t))return!1;return!0},octolyticsMetaTagName:/^octolytics-(host|app-id|app|dimension|measure|context|actor)-?(.*)/};if(window._octo){if(window._octo.slice){const e=window._octo.slice(0);window._octo=bn,window._octo.applyQueuedCalls(e)}}else window._octo=bn;function vn(e,t){const n=e.closest(".js-write-bucket");n&&n.classList.toggle("focused",t)}function wn(e){const t=e.currentTarget;t instanceof Element&&vn(t,!1)}d(".js-new-comment-form",(async function(e,t){let n;!function(e){const t=e.querySelector(".js-comment-form-error");t instanceof HTMLElement&&(t.hidden=!0)}(e);try{n=await t.json()}catch(r){!function(e,t){let n="You can't comment at this time";if(t.response&&422===t.response.status){const e=t.response.json;e.errors&&(n+=` — your comment ${e.errors.join(", ")}`)}n+=". ";const o=e.querySelector(".js-comment-form-error");o instanceof HTMLElement&&(o.textContent=n,o.hidden=!1)}(e,r)}if(!n)return;e.reset();for(const i of v(e,".js-resettable-field",HTMLInputElement))je(i,i.getAttribute("data-reset-value")||"");const o=e.querySelector(".js-write-tab");o instanceof HTMLElement&&o.click();const s=n.json.updateContent;for(const i in s){const e=s[i],t=document.querySelector(i);t instanceof HTMLElement?Le(t,e):console.warn(`couldn't find ${i} for immediate update`)}})),u("click",".js-comment-edit-button",(function(e){const t=m(e.currentTarget,".js-comment");t.classList.add("is-comment-editing"),a(t,".js-write-tab").click();const n=a(t,".js-comment-field");n.focus(),f(n,"change");const o=e.currentTarget.closest(".js-dropdown-details");o&&o.removeAttribute("open")})),u("click",".js-comment-hide-button",(function(e){const t=m(e.currentTarget,".js-comment").querySelector(".js-minimize-comment");t&&t.classList.remove("d-none");const n=e.currentTarget.closest(".js-dropdown-details");n&&n.removeAttribute("open")})),u("click",".js-comment-hide-minimize-form",(function(e){m(e.currentTarget,".js-minimize-comment").classList.add("d-none")})),u("click",".js-comment-cancel-button",(function(e){const t=m(e.currentTarget,"form",HTMLFormElement),n=i(e.currentTarget,"data-confirm-text");if(Ee(t)&&!confirm(n))return!1;for(const s of t.querySelectorAll("input, textarea")){const e=s;e.value=e.defaultValue,e.classList.contains("session-resumable-canceled")&&(e.classList.add("js-session-resumable"),e.classList.remove("session-resumable-canceled"))}const o=e.currentTarget.closest(".js-comment");o&&o.classList.remove("is-comment-editing")})),u("click",".js-cancel-issue-edit",(function(e){const t=m(e.currentTarget,".js-details-container");a(t,".js-comment-form-error").hidden=!0})),d(".js-comment-delete, .js-comment .js-comment-update, .js-issue-update, .js-comment-minimize, .js-comment-unminimize",(function(e,t,n){const o=m(e,".js-comment");o.classList.add("is-comment-loading");const s=o.getAttribute("data-body-version");s&&n.headers.set("X-Body-Version",s)})),d(".js-comment .js-comment-update",(async function(e,t){let n;const o=m(e,".js-comment"),s=o.querySelector(".js-comment-update-error");s instanceof HTMLElement&&(s.hidden=!0);try{n=await t.json()}catch(l){if(422!==l.response.status)throw l;{const e=JSON.parse(l.response.text);if(e.errors)return void(s instanceof HTMLElement&&(s.textContent=`There was an error posting your comment: ${e.errors.join(", ")}`,s.hidden=!1))}}if(!n)return;const r=n.json,i=o.querySelector(".js-comment-body");i&&r.body&&(i.innerHTML=r.body),o.setAttribute("data-body-version",r.newBodyVersion);const a=o.querySelector(".js-body-version");a instanceof HTMLInputElement&&(a.value=r.newBodyVersion);for(const u of o.querySelectorAll("input, textarea")){const e=u;e.defaultValue=e.value}o.classList.remove("is-comment-stale","is-comment-editing");const c=o.querySelector(".js-comment-edit-history");if(c){const e=await Te(document,r.editUrl);c.innerHTML="",c.append(e)}})),d(".js-comment .js-comment-delete, .js-comment .js-comment-update, .js-comment-minimize, .js-comment-unminimize",(async function(e,t){const n=m(e,".js-comment");try{await t.text()}catch(o){if(422!==o.response.status)throw o;{let e;try{e=JSON.parse(o.response.text)}catch(s){}e&&e.stale&&n.classList.add("is-comment-stale")}}n.classList.remove("is-comment-loading")})),d(".js-discussion-comment-unminimize, .js-discussion-comment-minimize",(async function(e,t){const n=m(e,".js-discussion-comment"),o=n.querySelector(".js-discussion-comment-error");o&&(o.hidden=!0);try{const e=await t.html();n.replaceWith(e.html)}catch(s){if(!(s.response.status>=400&&s.response.status<500))throw s;if(s.response.html){const e=i(a(s.response.html,".js-discussion-comment"),"data-error");o instanceof HTMLElement&&(o.textContent=e,o.hidden=!1)}}})),d(".js-comment-delete",(async function(e,t){await t.json();let n=e.closest(".js-comment-delete-container");n||(n=e.closest(".js-comment-container")||e.closest(".js-line-comments"),n&&1!==n.querySelectorAll(".js-comment").length&&(n=m(e,".js-comment"))),n.remove()})),d(".js-issue-update",(async function(e,t){var n,o,s;const r=m(e,".js-details-container"),i=a(r,".js-comment-form-error");let c;try{c=await t.json()}catch(u){i.textContent=(null===(s=null===(o=null===(n=u.response)||void 0===n?void 0:n.json)||void 0===o?void 0:o.errors)||void 0===s?void 0:s[0])||"Something went wrong. Please try again.",i.hidden=!1}if(!c)return;r.classList.remove("open"),i.hidden=!0;const l=c.json;if(null!=l.issue_title){a(r,".js-issue-title").textContent=l.issue_title;const e=r.closest(".js-issues-results");if(e){if(e.querySelector(".js-merge-pr.is-merging")){const t=e.querySelector(".js-merge-pull-request textarea");t instanceof HTMLTextAreaElement&&t.value===t.defaultValue&&(t.value=t.defaultValue=l.issue_title)}else if(e.querySelector(".js-merge-pr.is-squashing")){const t=e.querySelector(".js-merge-pull-request .js-merge-title");t instanceof HTMLInputElement&&t.value===t.defaultValue&&(t.value=t.defaultValue=l.default_squash_commit_title)}const t=e.querySelector("button[value=merge]");t&&t.setAttribute("data-input-message-value",l.issue_title);const n=e.querySelector("button[value=squash]");n&&n.setAttribute("data-input-title-value",l.default_squash_commit_title)}}document.title=l.page_title;for(const a of e.elements)(a instanceof HTMLInputElement||a instanceof HTMLTextAreaElement)&&(a.defaultValue=a.value)})),d(".js-comment-minimize",(async function(e,t){await t.json();const n=m(e,".js-comment"),o=n.querySelector(".js-minimize-comment");if(o&&o.classList.contains("js-update-minimized-content")){const t=e.querySelector("input[type=submit], button[type=submit]");t&&t.classList.add("disabled");const o=n.closest(".js-comment-container");o&&await ke(o)}else{o&&o.classList.add("d-none");const t=m(e,".unminimized-comment");t.classList.add("d-none"),t.classList.remove("js-comment");const n=m(e,".js-minimizable-comment-group").querySelector(".minimized-comment");n&&n.classList.remove("d-none"),n&&n.classList.add("js-comment")}})),d(".js-comment-unminimize",(async function(e,t){await t.json();const n=m(e,".js-minimizable-comment-group"),o=n.querySelector(".unminimized-comment"),s=n.querySelector(".minimized-comment");if(o)o.classList.remove("d-none"),o.classList.add("js-comment"),s&&s.classList.add("d-none"),s&&s.classList.remove("js-comment");else{if(s){const e=s.querySelector(".timeline-comment-actions");e&&e.classList.add("d-none"),s.classList.remove("js-comment")}const e=m(n,".js-comment-container");await ke(e)}})),u("details-menu-select",".js-comment-edit-history-menu",e=>{const t=e.detail.relatedTarget.getAttribute("data-edit-history-url");if(!t)return;e.preventDefault();const n=Te(document,t);xe({content:n,dialogClass:"Box-overlay--wide"})},{capture:!0}),re(".js-comment-field",(function(e){vn(e,!0),e.addEventListener("blur",wn,{once:!0})}));class PNGScanner{constructor(e){this.dataview=new DataView(e),this.pos=0}static fromFile(e){return new Promise((function(t,n){const o=new FileReader;o.onload=function(){t(new PNGScanner(o.result))},o.onerror=function(){n(o.error)},o.readAsArrayBuffer(e)}))}advance(e){this.pos+=e}readInt(e){const t=this,n=function(){switch(e){case 1:return t.dataview.getUint8(t.pos);case 2:return t.dataview.getUint16(t.pos);case 4:return t.dataview.getUint32(t.pos);default:throw new Error("bytes parameter must be 1, 2 or 4")}}();return this.advance(e),n}readChar(){return this.readInt(1)}readShort(){return this.readInt(2)}readLong(){return this.readInt(4)}readString(e){const t=[];for(let n=0;n<e;n++)t.push(String.fromCharCode(this.readChar()));return t.join("")}scan(e){if(2303741511!==this.readLong())throw new Error("invalid PNG");for(this.advance(4);;){const t=this.readLong(),n=this.readString(4),o=this.pos+t+4;if(!1===e.call(this,n,t)||"IEND"===n)break;this.pos=o}}}function yn(e){return`${e.isImage()?"!":""}[Uploading ${e.file.name}…]()`}p(".js-paste-markdown",{constructor:HTMLElement,subscribe:j});function jn(e){const t=m(e,".js-previewable-comment-form"),n=e.classList.contains("js-preview-tab");if(n){const e=a(t,".js-write-bucket"),n=a(t,".js-preview-body");e.clientHeight>0&&(n.style.minHeight=`${e.clientHeight}px`)}t.classList.toggle("preview-selected",n),t.classList.toggle("write-selected",!n);const o=a(t,'.tabnav-tab.selected, .tabnav-tab[aria-selected="true"]');o.setAttribute("aria-selected","false"),o.classList.remove("selected"),e.classList.add("selected"),e.setAttribute("aria-selected","true");const s=a(t,".js-write-tab");return n?s.setAttribute("data-hotkey","Control+P,Meta+Shift+p"):s.removeAttribute("data-hotkey"),t}function Ln(e){var t,n,o,s,r,i,c,l,u;const d=a(e,".js-comment-field",HTMLTextAreaElement).value,f=null===(t=e.querySelector(".js-path"))||void 0===t?void 0:t.value,p=null===(n=e.querySelector(".js-line-number"))||void 0===n?void 0:n.value,h=null===(o=e.querySelector(".js-start-line-number"))||void 0===o?void 0:o.value,g=null===(s=e.querySelector(".js-side"))||void 0===s?void 0:s.value,b=null===(r=e.querySelector(".js-start-side"))||void 0===r?void 0:r.value,v=null===(i=e.querySelector(".js-start-commit-oid"))||void 0===i?void 0:i.value,w=null===(c=e.querySelector(".js-end-commit-oid"))||void 0===c?void 0:c.value,y=null===(l=e.querySelector(".js-base-commit-oid"))||void 0===l?void 0:l.value,j=null===(u=e.querySelector(".js-comment-id"))||void 0===u?void 0:u.value,L=new FormData;return L.append("text",d),L.append("authenticity_token",function(e){const t=e.querySelector(".js-data-preview-url-csrf"),n=m(e,"form",HTMLFormElement).elements.namedItem("authenticity_token");if(t instanceof HTMLInputElement)return t.value;if(n instanceof HTMLInputElement)return n.value;throw new Error("Comment preview authenticity token not found")}(e)),f&&L.append("path",f),p&&L.append("line_number",p),h&&L.append("start_line_number",h),g&&L.append("side",g),b&&L.append("start_side",b),v&&L.append("start_commit_oid",v),w&&L.append("end_commit_oid",w),y&&L.append("base_commit_oid",y),j&&L.append("comment_id",j),L}function En(e){const t=i(e,"data-preview-url"),n=Ln(e);return f(e,"preview:setup",{data:n}),Tn(t,n)}u("upload:setup",".js-upload-markdown-image",(function(e){const t=a(e.currentTarget,".js-comment-field",HTMLTextAreaElement);t.setCustomValidity("uploading"),Se(t,`${yn(e.detail.attachment)}\n`)})),u("upload:complete",".js-upload-markdown-image",(async function(e){const{attachment:t}=e.detail,n=a(e.currentTarget,".js-comment-field",HTMLTextAreaElement),o=t.isImage()?await async function(e){const t=await async function(e){var t;const n={width:0,height:0,ppi:0};try{return null!==(t=await async function(e){if("image/png"!==e.type)return null;const t=e.slice(0,10240,e.type),n=await PNGScanner.fromFile(t),o={width:0,height:0,ppi:1};return n.scan((function(e){switch(e){case"IHDR":return o.width=this.readLong(),o.height=this.readLong(),!0;case"pHYs":{const e=this.readLong(),t=this.readLong();let n;return 1===this.readChar()&&(n=.0254),n&&(o.ppi=Math.round((e+t)/2*n)),!1}case"IDAT":return!1}return!0})),o}(e))&&void 0!==t?t:n}catch(o){return n}}(e.file),n=(s=e.file.name,function(e){return e.replace(/[[\]\\"<>&]/g,".").replace(/\.{2,}/g,".").replace(/^\.|\.$/gi,"")}(s).replace(/\.[^.]+$/,"").replace(/\./g," ")),o=e.href;var s;if(144===t.ppi){return`<img width="${Math.round(t.width/2)}" alt="${n}" src="${o}">`}return``}(t):function(e){return`[${e.file.name}](${e.href})`}(t);n.setCustomValidity(""),Ae(n,yn(t),o)})),u("upload:error",".js-upload-markdown-image",(function(e){const t=a(e.currentTarget,".js-comment-field",HTMLTextAreaElement),n=yn(e.detail.attachment);t.setCustomValidity(""),Ae(t,n,"")})),u("upload:invalid",".js-upload-markdown-image",(function(e){const t=a(e.currentTarget,".js-comment-field",HTMLTextAreaElement),n=yn(e.detail.attachment);t.setCustomValidity(""),Ae(t,n,"")})),u("click",".js-write-tab",(function(e){const t=e.currentTarget,n=m(t,".js-previewable-comment-form");if(n instanceof L)return void setTimeout(()=>{a(n,".js-comment-field").focus()});const o=jn(t);setTimeout(()=>{a(o,".js-comment-field").focus()});const s=n.querySelector("markdown-toolbar");s instanceof HTMLElement&&(s.hidden=!1)})),u("click",".js-preview-tab",(function(e){const t=e.currentTarget,n=m(t,".js-previewable-comment-form");if(n instanceof L)return;const o=jn(t);setTimeout(()=>{xn(o)});const s=n.querySelector("markdown-toolbar");s instanceof HTMLElement&&(s.hidden=!0),e.stopPropagation(),e.preventDefault()})),u("tab-container-change",".js-previewable-comment-form",(function(e){const t=e.detail.relatedTarget.classList.contains("js-preview-panel"),n=e.currentTarget,o=a(n,".js-write-tab");if(t){const e=a(n,".js-write-bucket"),t=a(n,".js-preview-body");!t.hasAttribute("data-skip-sizing")&&e.clientHeight>0&&(t.style.minHeight=`${e.clientHeight}px`),o.setAttribute("data-hotkey","Control+P,Meta+Shift+p"),xn(n);const s=n.querySelector("markdown-toolbar");s instanceof HTMLElement&&(s.hidden=!0)}else{o.removeAttribute("data-hotkey");const e=n.querySelector("markdown-toolbar");e instanceof HTMLElement&&(e.hidden=!1)}n.classList.toggle("preview-selected",t),n.classList.toggle("write-selected",!t)})),u("preview:render",".js-previewable-comment-form",(function(e){const t=jn(a(e.target,".js-preview-tab"));setTimeout(()=>{xn(t);const e=t.querySelector("markdown-toolbar");e instanceof HTMLElement&&(e.hidden=!0)})}));const Tn=He((async function(e,t){null==kn||kn.abort();const{signal:n}=kn=new AbortController,o=await fetch(e,{method:"post",body:t,signal:n});if(!o.ok)throw new Error("something went wrong");return o.text()}),{hash:function(e,t){const n=[...t.entries()].toString();return`${e}:${n}`}});let kn=null;async function xn(e){const t=a(e,".comment-body");t.innerHTML="<p>Loading preview…</p>";try{const n=await En(e);t.innerHTML=n||"<p>Nothing to preview</p>"}catch(n){"AbortError"!==n.name&&(t.innerHTML="<p>Error rendering preview</p>")}}p(".js-preview-tab",(function(e){e.addEventListener("mouseenter",async()=>{const t=m(e,".js-previewable-comment-form");try{await En(t)}catch(n){}})})),Me("keydown",".js-comment-field",(function(e){const t=e.target;if((e.ctrlKey||e.metaKey)&&e.shiftKey&&"P"===e.key.toUpperCase()){const n=m(t,".js-previewable-comment-form");n.classList.contains("write-selected")&&(n instanceof L?a(n,".js-preview-tab").click():(t.blur(),n.dispatchEvent(new CustomEvent("preview:render",{bubbles:!0,cancelable:!1}))),e.preventDefault(),e.stopImmediatePropagation())}}));const Sn=/^(\+1|-1|:\+1?|:-1?)$/;function An(e){const t=e.target,n=t.value,o=t.closest(".js-reaction-suggestion");if(o)if((e=>{let t=!1;for(const n of e.split("\n")){const e=n.trim();if(e&&!e.startsWith(">")){if(t&&!1===Sn.test(e))return!1;!t&&Sn.test(e)&&(t=!0)}}return t})(n)){o.classList.remove("hide-reaction-suggestion"),o.classList.add("reaction-suggestion");const e=i(o,"data-reaction-markup");o.setAttribute("data-reaction-suggestion-message",e)}else Mn(o)}function Mn(e){e.classList.remove("reaction-suggestion"),e.classList.add("hide-reaction-suggestion"),e.removeAttribute("data-reaction-suggestion-message")}var Hn,qn;u("focusout","#new_comment_field",(function(e){const t=e.currentTarget.closest(".js-reaction-suggestion");t&&Mn(t)})),u("focusin","#new_comment_field",(function(e){An(e)})),Me("keyup","#new_comment_field",(function(e){An(e)})),u("navigation:keydown",".js-commits-list-item",(function(e){e.target instanceof Element&&"c"===e.detail.hotkey&&a(e.target,".js-navigation-open").click()})),document.addEventListener("click",(function(e){if(!(e.target instanceof Element))return;const t=e.target.closest("a[data-confirm], input[type=submit][data-confirm], input[type=checkbox][data-confirm], button[data-confirm]");if(!t)return;const n=t.getAttribute("data-confirm");n&&(t instanceof HTMLInputElement&&t.hasAttribute("data-confirm-checked")&&!t.checked||confirm(n)||(e.stopImmediatePropagation(),e.preventDefault()))}),!0),le(".js-company-name-input",(function(e){const t=e.target,n=t.form,o=n.querySelectorAll(".js-company-name-text");if(0===o.length)return;const s=n.querySelector(".js-corp-tos-link"),r=n.querySelector(".js-tos-link");r&&(r.classList.add("d-none"),r.setAttribute("aria-hidden","true"),s&&(s.classList.remove("d-none"),s.setAttribute("aria-hidden","false")));for(const a of o)if(t.value){if(a.hasAttribute("data-wording")){const e=i(a,"data-wording");a.textContent=` ${e} ${t.value}`}else a.textContent=t.value}else a.textContent=""})),p(".js-company-owned:not(:checked)",{constructor:HTMLInputElement,add(e){const t=e.form,n=a(t,".js-company-name-input",HTMLInputElement),o=a(document,".js-company-name-text"),s=a(document,".js-corp-tos-link"),r=a(document,".js-tos-link");e.getAttribute("data-optional")&&n.removeAttribute("required"),je(n,""),r.classList.remove("d-none"),r.setAttribute("aria-hidden","false"),s.classList.add("d-none"),s.setAttribute("aria-hidden","true"),o.textContent=""}}),p(".js-company-owned:checked",{constructor:HTMLInputElement,add(e){const t=e.form.querySelector(".js-company-name-input");t&&(t.setAttribute("required",""),f(t,"focus"),f(t,"input"))}}),p(".js-company-owned-autoselect",{constructor:HTMLInputElement,add(e){const t=e;function n(){if(t.checked&&t.form){const e=a(t.form,".js-company-owned",HTMLInputElement);je(e,!0)}}t.addEventListener("change",n),n()}}),function(e){e.Accept="accepted",e.Reject="rejected"}(Hn||(Hn={})),function(e){e.Analytics="analytics"}(qn||(qn={}));const Cn=(new Date).getTime(),_n=new Date(Cn+31536e6).toUTCString();function $n(){const e=document.querySelector("meta[name=cookie-consent-required]"),t=document.querySelector(".js-cookie-consent-banner");if("true"===(null==e?void 0:e.content)&&t){const e=qe("cookie-preferences");if(!e.length||e[0].value.includes(`${qn.Analytics}:${Hn.Reject}`))return!1}return!0}function In(){!function(){const e=document.querySelector(".js-cookie-consent-banner");e&&(e.classList.remove("hx_cookie-banner--show","hx_cookie-banner--expand","hx_cookie-banner--collapse"),e.classList.add("hx_cookie-banner--hide"),setTimeout((function(){e.hidden=!0,e.classList.remove("hx_cookie-banner--hide")}),300))}(),function(){const e=document.querySelector(".js-cookie-consent-preferences-link-container");e&&(e.hidden=!1)}()}function Dn(e){const t=document.querySelector(".js-cookie-consent-banner"),n=document.querySelector(".js-main-cookie-banner"),o=document.querySelector(".js-cookie-details");t&&n&&o&&(e?($n()?Pn(!0):qe("cookie-preferences").length&&Pn(!1),o.hidden=!e,n.hidden=e,t.classList.remove("hx_cookie-banner--collapse","hx_cookie-banner--show"),t.classList.add("hx_cookie-banner--expand")):(n.hidden=e,o.hidden=!e,t.classList.replace("hx_cookie-banner--expand","hx_cookie-banner--collapse")))}function Pn(e){const t=document.querySelector(".js-accept-analytics-cookies"),n=document.querySelector(".js-reject-analytics-cookies");t&&n&&(t.classList.toggle("selected",e),n.classList.toggle("selected",!e));const o=document.querySelector(".js-save-cookie-preferences");o&&(o.disabled=!1)}function Rn(e){let t;if(qe("cookie-preferences").length){t=qe("cookie-preferences")[0].value;const n=new RegExp(`${qn.Analytics}:(${Hn.Accept}|${Hn.Reject})`);t=t.replace(n,`${qn.Analytics}:${e}`)}else t=`${qn.Analytics}:${e}`;return t}function Nn(){const e=["__utma","__utmb","__utmc","__utmt","__utmv","__utmz","_ga","_gat","_gid"],t=document.querySelector("meta[name=cookie-consent-required]");if("true"===(null==t?void 0:t.content))for(const n of e)Ce(n)}function Fn(){const e=document.querySelector("meta[name=google-analytics]"),t=document.querySelector("meta[name=cookie-consent-required]");"true"===(null==t?void 0:t.content)&&e instanceof HTMLMetaElement&&(window[`ga-disable-${e.content}`]=!0),Nn()}function Bn(){window.location.reload()}!async function(){await ve,$n()||Nn()}(),p(".js-cookie-consent-banner",{constructor:HTMLElement,initialize(e){const t=document.querySelector("meta[name=cookie-consent-required]");qe("cookie-preferences").length||"true"!==(null==t?void 0:t.content)||(e.hidden=!1,e.classList.add("hx_cookie-banner--show"))}}),p(".js-cookie-consent-preferences-link-container",{constructor:HTMLElement,initialize(e){const t=document.querySelector("meta[name=cookie-consent-required]");qe("cookie-preferences").length&&"true"===(null==t?void 0:t.content)&&(e.hidden=!1)}}),u("click",".js-cookie-consent-more-info",(function(){Dn(!0)})),u("click",".js-cookie-consent-less-info",(function(){Dn(!1)})),u("click",".js-accept-analytics-cookies",(function(){Pn(!0)})),u("click",".js-reject-analytics-cookies",(function(){Pn(!1)})),u("click",".js-cookie-consent-accept-all",(function(){_e("cookie-preferences",Rn(Hn.Accept),_n),In(),Bn()})),u("click",".js-cookie-consent-reject-all",(function(){_e("cookie-preferences",Rn(Hn.Reject),_n),In(),Fn()})),u("click",".js-save-cookie-preferences",(function(){var e;(null===(e=document.querySelector(".js-accept-analytics-cookies"))||void 0===e?void 0:e.classList.contains("selected"))?(_e("cookie-preferences",Rn(Hn.Accept),_n),Bn()):(_e("cookie-preferences",Rn(Hn.Reject),_n),Fn()),In()})),u("click",".js-cookie-consent-preferences-link",(function(e){const t=document.querySelector(".js-cookie-consent-banner"),n=document.querySelector(".js-cookie-consent-more-info");t&&n&&(t.hidden=!1,Dn(!0)),e.preventDefault()}));let On=null;function Un({currentTarget:e}){const t=e;if(t.hasAttribute("open")){const e=t.querySelector("[autofocus]");e&&e.focus()}else{const e=t.querySelector("summary");e&&e.focus()}}function zn({currentTarget:e}){const t=e;t.hasAttribute("open")?(On&&On!==t&&On.removeAttribute("open"),On=t):t===On&&(On=null)}function Wn({currentTarget:e}){if(!(e instanceof Element))return;const t=m(e,"details"),n=i(t,"data-deferred-details-content-url");t.removeAttribute("data-deferred-details-content-url"),a(t,"include-fragment, poll-include-fragment",c).src=n}async function Vn({currentTarget:e}){const t=e,n=t.hasAttribute("open");f(t,n?"menu:activate":"menu:deactivate"),await ie(),f(t,n?"menu:activated":"menu:deactivated")}document.addEventListener("keydown",(function(e){!e.defaultPrevented&&"Escape"===e.key&&On&&On.removeAttribute("open")})),p(".js-dropdown-details",{subscribe:e=>$e(ae(e,"toggle",zn),ae(e,"toggle",Un))}),p("[data-deferred-details-content-url]:not([data-details-no-preload-on-hover])",{subscribe:e=>{const t=a(e,"summary");return ae(t,"mouseenter",Wn)}}),p("[data-deferred-details-content-url]",{subscribe:e=>ae(e,"toggle",Wn)}),u("click","[data-toggle-for]",(function(e){const t=e.currentTarget.getAttribute("data-toggle-for")||"",n=document.getElementById(t);n&&(n.hasAttribute("open")?n.removeAttribute("open"):n.setAttribute("open","open"))})),ue((function({target:e}){if(!e||e.closest("summary"))return;let t=e.parentElement;for(;t;)t=t.closest("details"),t&&(t.hasAttribute("open")||t.setAttribute("open",""),t=t.parentElement)})),p("details.select-menu details-menu include-fragment",(function(e){const t=e.closest("details");t&&(e.addEventListener("loadstart",(function(){t.classList.add("is-loading"),t.classList.remove("has-error")})),e.addEventListener("error",(function(){t.classList.add("has-error")})),e.addEventListener("loadend",(function(){t.classList.remove("is-loading");const e=t.querySelector(".js-filterable-field");e&&f(e,"filterable:change")})))})),p("details details-menu .js-filterable-field",{constructor:HTMLInputElement,add(e){const t=m(e,"details");t.addEventListener("toggle",(function(){t.hasAttribute("open")||(e.value="",f(e,"filterable:change"))}))}}),p("details-menu[role=menu] [role=menu]",e=>{const t=e.closest("details-menu[role]");t&&t!==e&&t.removeAttribute("role")}),p("details details-menu remote-input input",{constructor:HTMLInputElement,add(e){const t=m(e,"details");t.addEventListener("toggle",(function(){t.hasAttribute("open")||(e.value="")}))}}),p("form details-menu",e=>{const t=m(e,"form");t.addEventListener("reset",()=>{setTimeout(()=>function(e){const t=e.querySelectorAll("details-menu [role=menuitemradio] input[type=radio]:checked");for(const n of t)f(n,"change")}(t),0)})}),Me("keypress","details-menu .js-filterable-field, details-menu filter-input input",e=>{if("Enter"===e.key){const t=e.currentTarget,n=m(t,"details-menu").querySelector('[role^="menuitem"]:not([hidden])');n instanceof HTMLElement&&n.click(),e.preventDefault()}}),u("details-menu-selected","details-menu",e=>{const t=e.currentTarget.querySelector(".js-filterable-field");t instanceof HTMLInputElement&&t.value&&t.focus()},{capture:!0}),u("details-menu-selected","[data-menu-input]",e=>{if(!(e.target instanceof Element))return;const t=i(e.target,"data-menu-input"),n=document.getElementById(t);(n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement)&&(n.value=e.detail.relatedTarget.value)},{capture:!0}),p("details-menu remote-input",{constructor:E,initialize(e){const t=document.getElementById(e.getAttribute("aria-owns")||"");if(!t)return;let n=null;e.addEventListener("load",()=>{n=document.activeElement&&t.contains(document.activeElement)&&document.activeElement.id?document.activeElement.id:null}),e.addEventListener("loadend",()=>{if(n){const o=t.querySelector(`#${n}`)||t.querySelector('[role^="menu"]');o instanceof HTMLElement?o.focus():e.input&&e.input.focus()}})}}),u("details-menu-selected","details-menu[data-menu-max-options]",e=>{const t=+i(e.currentTarget,"data-menu-max-options")===e.currentTarget.querySelectorAll('[role="menuitemcheckbox"][aria-checked="true"]').length;a(e.currentTarget,"[data-menu-max-options-warning]").hidden=!t;for(const n of v(e.currentTarget,'[role="menuitemcheckbox"] input',HTMLInputElement))n.disabled=t&&!n.checked},{capture:!0}),p("details > details-menu",{subscribe(e){const t=m(e,"details");return ae(t,"toggle",Vn)}});const Kn=new WeakMap,Jn=["input[type=submit][data-disable-with]","button[data-disable-with]"].join(", ");function Xn(e,t){e instanceof HTMLInputElement?e.value=t:e.innerHTML=t}function Gn(e){for(const t of e.querySelectorAll(Jn)){const n=Kn.get(t);null!=n&&(Xn(t,n),t.hasAttribute("data-disable-invalid")&&!e.checkValidity()||(t.disabled=!1),Kn.delete(t))}}function Yn(e){return Array.from(e.types).indexOf("Files")>=0}u("submit","form",(function(e){for(const n of e.currentTarget.querySelectorAll(Jn)){Kn.set(n,(t=n)instanceof HTMLInputElement?t.value||"Submit":t.innerHTML||"");const e=n.getAttribute("data-disable-with");e&&Xn(n,e),n.disabled=!0}var t}),{capture:!0}),u("deprecatedAjaxComplete","form",(function({currentTarget:e,target:t}){e===t&&Gn(e)})),T(Gn),p(".js-document-dropzone",{constructor:HTMLElement,add(e){document.body.addEventListener("dragstart",so),document.body.addEventListener("dragend",ro),document.body.addEventListener("dragenter",Zn),document.body.addEventListener("dragover",Zn),document.body.addEventListener("dragleave",eo),e.addEventListener("drop",to)},remove(e){document.body.removeEventListener("dragstart",so),document.body.removeEventListener("dragend",ro),document.body.removeEventListener("dragenter",Zn),document.body.removeEventListener("dragover",Zn),document.body.removeEventListener("dragleave",eo),e.removeEventListener("drop",to)}});let Qn=null;function Zn(e){if(oo)return;const t=e.currentTarget;Qn&&window.clearTimeout(Qn),Qn=window.setTimeout(()=>t.classList.remove("dragover"),200);const n=e.dataTransfer;n&&Yn(n)&&(n.dropEffect="copy",t.classList.add("dragover"),e.stopPropagation(),e.preventDefault())}function eo(e){if(e.target instanceof Element&&e.target.classList.contains("js-document-dropzone")){e.currentTarget.classList.remove("dragover")}}function to(e){const t=e.currentTarget;t.classList.remove("dragover"),document.body.classList.remove("dragover");const n=e.dataTransfer;n&&Yn(n)&&(f(t,"document:drop",{transfer:n}),e.stopPropagation(),e.preventDefault())}let no,oo=!1;function so(){oo=!0}function ro(){oo=!1}function io(e,t){const n=document.querySelector('.js-site-favicon[type="image/svg+xml"]'),o=document.querySelector('.js-site-favicon[type="image/png"]');t||(t="light");const s="light"===t?"":"-dark";if(n&&o)if(null==no&&(no=n.href),e){e=`${e=e.substr(0,e.lastIndexOf("."))}${s}.svg`,n.href=e;const t=n.href.substr(0,n.href.lastIndexOf("."));o.href=`${t}.png`}else{const e=n.href.indexOf("-dark.svg"),t=n.href.substr(0,-1!==e?e:n.href.lastIndexOf("."));n.href=`${t}${s}.svg`,o.href=`${t}${s}.png`}}function ao(){return window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches}u("submit","form.js-encrypt-submit",(async function(e){const n=e.currentTarget;if(e.defaultPrevented||!n.checkValidity())return;const o=k(n,"secret_value",HTMLTextAreaElement);if(o.disabled=!0,!o.value)return;e.preventDefault();const s=function(e){const t=atob(e).split("").map(e=>e.charCodeAt(0));return Uint8Array.from(t)}(i(n,"data-public-key"));k(n,"encrypted_value").value=function(e){let t="";for(const n of e)t+=String.fromCharCode(n);return btoa(t)}(await async function(e,n){const o=(new TextEncoder).encode(n),{seal:s}=await t.import("./tweetsodium.js");return s(o,e)}(s,o.value)),n.submit()})),p("[data-favicon-override]",{add(e){const t=i(e,"data-favicon-override");setTimeout(()=>io(t,ao()?"dark":"light"))},remove(){null!=no&&io(no,ao()?"dark":"light")}}),ao()&&io(void 0,"dark"),window.matchMedia("(prefers-color-scheme: dark)").addListener(()=>{io(void 0,ao()?"dark":"light")}),p(".js-feature-preview-indicator-container",e=>{!async function(e){const t=i(e,"data-feature-preview-indicator-src"),n=await async function(e){try{const t=await fetch(e,{headers:{Accept:"application/json"}});return!!t.ok&&(await t.json()).show_indicator}catch(t){return!1}}(t),o=e.querySelectorAll(".js-feature-preview-indicator");for(const s of o)s.hidden=!n}(e)}),u("click","[data-feature-preview-trigger-url]",async e=>{const t=e.currentTarget,n=i(t,"data-feature-preview-trigger-url"),o=await xe({content:Te(document,n),dialogClass:"feature-preview-dialog"}),s=i(t,"data-feature-preview-close-details"),r=i(t,"data-feature-preview-close-hmac");o.addEventListener("dialog:remove",()=>{be({hydroEventPayload:s,hydroEventHmac:r},!0)});const a=v(document,".js-feature-preview-indicator");for(const i of a)i.hidden=!0}),d(".js-feature-preview-unenroll",async(e,t)=>{await t.text();const n=a(e,".js-feature-preview-slug",HTMLInputElement).value;f(e,`feature-preview-unenroll:${n}`)}),d(".js-feature-preview-enroll",async(e,t)=>{await t.text();const n=a(e,".js-feature-preview-slug",HTMLInputElement).value;f(e,`feature-preview-enroll:${n}`)});class AttachmentUpload{constructor(e,t){this.attachment=e,this.policy=t}async process(e){const t=new Headers(this.policy.header||{}),n=new XMLHttpRequest;n.open("POST",this.policy.upload_url,!0);for(const[o,s]of t)n.setRequestHeader(o,s);n.onloadstart=()=>{e.attachmentUploadDidStart(this.attachment,this.policy)},n.upload.onprogress=t=>{if(t.lengthComputable){const n=Math.round(t.loaded/t.total*100);e.attachmentUploadDidProgress(this.attachment,n)}},await function(e,t){return new Promise((n,o)=>{e.onload=()=>n(e),e.onerror=o,e.send(t)})}(n,function(e,t){const n=new FormData;t.same_origin&&n.append("authenticity_token",t.upload_authenticity_token);for(const o in t.form)n.append(o,t.form[o]);return n.append("file",e.file),n}(this.attachment,this.policy)),204===n.status?(co(this.policy),e.attachmentUploadDidComplete(this.attachment,this.policy,{})):201===n.status?(co(this.policy),e.attachmentUploadDidComplete(this.attachment,this.policy,JSON.parse(n.responseText))):e.attachmentUploadDidError(this.attachment,{status:n.status,body:n.responseText})}}function co(e){const t="string"==typeof e.asset_upload_url?e.asset_upload_url:null,n="string"==typeof e.asset_upload_authenticity_token?e.asset_upload_authenticity_token:null;if(!t||!n)return;const o=new FormData;o.append("authenticity_token",n),fetch(t,{method:"PUT",body:o,credentials:"same-origin",headers:{Accept:"application/json","X-Requested-With":"XMLHttpRequest"}})}async function lo(e,t){const n=function(e,t){return{attachmentUploadDidStart(n,o){n.saving(0),po(t,"is-uploading"),f(t,"upload:start",{batch:e,attachment:n,policy:o})},attachmentUploadDidProgress(n,o){n.saving(o),f(t,"upload:progress",{batch:e,attachment:n})},attachmentUploadDidComplete(n,o,s){n.saved(function(e,t){const n=(null==e.id?null:String(e.id))||(null==t.asset.id?null:String(t.asset.id)),o=("string"==typeof e.href?e.href:null)||("string"==typeof t.asset.href?t.asset.href:null);return{id:n,href:o,name:t.asset.name}}(s,o)),f(t,"upload:complete",{batch:e,attachment:n}),po(t,"is-default")},attachmentUploadDidError(n,o){f(t,"upload:error",{batch:e,attachment:n});const s=mo(o);po(t,s)}}}(e,t);for(const s of e.attachments){const r=await uo(e,s,t);if(!r)return;try{const e=new AttachmentUpload(s,r);await e.process(n)}catch(o){return f(t,"upload:error",{batch:e,attachment:s}),void po(t,"is-failed")}}}async function uo(e,t,n){const o=function(e,t){const n=a(t,".js-data-upload-policy-url-csrf",HTMLInputElement).value,o=t.getAttribute("data-upload-repository-id"),s=e.file,r=new FormData;r.append("name",s.name),r.append("size",String(s.size)),r.append("content_type",s.type),r.append("authenticity_token",n),o&&r.append("repository_id",o);e.directory&&r.append("directory",e.directory);return r}(t,n),s=[];f(n,"upload:setup",{batch:e,attachment:t,form:o,preprocess:s});try{await Promise.all(s);const r=await fetch(function(e,t){return new Request(i(t,"data-upload-policy-url"),{method:"POST",body:e,credentials:"same-origin",headers:{Accept:"application/json","X-Requested-With":"XMLHttpRequest"}})}(o,n));if(r.ok)return await r.json();f(n,"upload:invalid",{batch:e,attachment:t});const a=await r.text();po(n,mo({status:r.status,body:a},t.file))}catch(r){f(n,"upload:invalid",{batch:e,attachment:t}),po(n,"is-failed")}return null}function mo(e,t){if(400===e.status)return"is-bad-file";if(422!==e.status)return"is-failed";const n=JSON.parse(e.body);if(!n||!n.errors)return"is-failed";for(const o of n.errors)switch(o.field){case"size":{const e=t?t.size:null;return null!=e&&0===e?"is-empty":"is-too-big"}case"file_count":return"is-too-many";case"width":case"height":return"is-bad-dimensions";case"name":return"already_exists"===o.code?"is-duplicate-filename":"is-bad-file";case"content_type":return"is-bad-file";case"uploader_id":return"is-bad-permissions";case"repository_id":return"is-repository-required";case"format":return"is-bad-format"}return"is-failed"}const fo=["is-default","is-uploading","is-bad-file","is-duplicate-filename","is-too-big","is-too-many","is-hidden-file","is-failed","is-bad-dimensions","is-empty","is-bad-permissions","is-repository-required","is-bad-format"];function po(e,t){e.classList.remove(...fo),e.classList.add(t)}class Batch{constructor(e){this.attachments=e,this.size=this.attachments.length,this.total=ho(this.attachments,e=>e.file.size)}percent(){const e=ho(this.attachments,e=>e.file.size*e.percent/100);return Math.round(e/this.total*100)}uploaded(){return ho(this.attachments,e=>e.isSaved()?1:0)}isFinished(){return this.attachments.every(e=>e.isSaved())}}function ho(e,t){return e.reduce((e,n)=>e+t(n),0)}p("file-attachment[hover]",{add(e){e.classList.add("dragover")},remove(e){e.classList.remove("dragover")}}),u("file-attachment-accept","file-attachment",(function(e){const{attachments:t}=e.detail;0===t.length&&(po(e.currentTarget,"is-hidden-file"),e.preventDefault())})),u("file-attachment-accepted","file-attachment",(function(e){const{attachments:t}=e.detail;lo(new Batch(t),e.currentTarget)}));let go=0;function bo(e){return Array.from(e.types).indexOf("Files")>=0}function vo(e){const t=e.dataTransfer;t&&bo(t)&&e.preventDefault()}function wo(e){const t=e.dataTransfer;t&&bo(t)&&e.preventDefault()}function yo({currentTarget:e}){po(a(e,"file-attachment"),"is-default")}function jo(e,t,n,o={}){var s;const r=null!==(s=o.limit)&&void 0!==s?s:1/0;let i=0;for(const a of e.children){const e=n(a,t);null==e||(e&&i<r?(i++,Lo(a,!0)):Lo(a,!1))}return i}function Lo(e,t){e.style.display=t?"":"none",e.hidden=!t}p("file-attachment",{add(e){0==go++&&(document.addEventListener("drop",vo),document.addEventListener("dragover",wo));const t=e.closest("form");t&&t.addEventListener("reset",yo)},remove(e){0==--go&&(document.removeEventListener("drop",vo),document.removeEventListener("dragover",wo));const t=e.closest("form");t&&t.removeEventListener("reset",yo)}}),u("filter-input-updated","filter-input",e=>{const t=e.currentTarget.input;if(!document.activeElement||document.activeElement!==t)return;const{count:n,total:o}=e.detail;Ie(`Found ${n} out of ${o} ${1===o?"item":"items"}`)}),u("toggle","details",e=>{setTimeout(()=>function(e){const t=e.querySelector("filter-input");t&&!e.hasAttribute("open")&&t.reset()}(e.target),0)},{capture:!0}),u("tab-container-changed","tab-container",e=>{if(!(e.target instanceof HTMLElement))return;const{relatedTarget:t}=e.detail,n=e.target.querySelector("filter-input");n instanceof x&&n.setAttribute("aria-owns",t.id)},{capture:!0});const Eo=new WeakMap;const To=new WeakMap,ko=new WeakMap;async function xo(e,t,n){ko.set(e,t),await Re();const o=To.get(e)||async function(e){const t=await Ne(i(e,"data-filterable-src"),{headers:{Accept:"application/json"}});return await t.json()}(e);To.has(e)||To.set(e,o);const s=await o;if(ko.get(e)!==t)return-1;const r=n.limit,c=a(e,"template",HTMLTemplateElement),l={};for(const i of v(e,"input[type=hidden]",HTMLInputElement))l[`${i.name}${i.value}`]=i;let u=c.nextElementSibling;for(;u;){const e=u;u=e.nextElementSibling,e instanceof HTMLElement&&("true"===e.getAttribute("aria-checked")||e.classList.contains("select-menu-divider"))?e.hidden=!0:e.remove()}let d=0,m=document.createDocumentFragment();const f=e.querySelector(".js-divider-suggestions"),p=e.querySelector(".js-divider-rest");function h(e){const n=!(null!=r&&d>=r)&&function(e){return`${e.login} ${e.name}`.toLowerCase().trim()}(e).indexOf(t)>=0;if(n||e.selected){const t=function(e,t,n){if(null!=e.element)return e.element;const o=t.content.cloneNode(!0),s=a(o,"input[type=checkbox], input[type=radio]",HTMLInputElement);e.type&&(s.name=`reviewer_${e.type}_ids[]`);s.value=e.id;const r=`${s.name}${e.id}`;let i=e.selected;n[r]&&(i=!0,n[r].remove(),delete n[r]);const c=a(o,"[role^=menuitem]");i&&(c.setAttribute("aria-checked","true"),s.checked=!0);e.disabled&&c.setAttribute("aria-disabled","true");const l=o.querySelector(".js-username");l&&(l.textContent=e.login);const u=o.querySelector(".js-description");u&&(u.textContent=e.name);const d=o.querySelector(".js-extended-description");d&&(e.description?d.textContent=e.description:d.remove());const m=a(o,".js-avatar",HTMLImageElement);return m.className=`${m.className} ${e.class}`,m.src=e.avatar,e.element=c,e.element}(e,c,l);t.hidden=!n,n&&d++,m.appendChild(t)}}if(f&&s.suggestions){for(const e of s.suggestions)h(e);m.childNodes.length&&(f.after(m),f.hidden=0===d,m=document.createDocumentFragment())}const g=d;for(const i of s.users)h(i);return e.append(m),p&&(p.hidden=d===g||0===g),d}async function So(e,t){const n=parseInt(e.getAttribute("data-filterable-limit"),10)||null;let o=0;switch(e.getAttribute("data-filterable-type")){case"fuzzy":{const s=t.toLowerCase();o=function(e,t,n){const o=t.toLowerCase(),s=n.limit;let r=Eo.get(e);const i=e.querySelector('input[type="radio"]:checked'),a=Array.from(e.children);r||(r=Array.from(e.children),Eo.set(e,r));for(const p of a)e.removeChild(p),p instanceof HTMLElement&&(p.style.display="");const c=o?De(r,n.sortKey,Pe):r,l=null==s?c:c.slice(0,s),u=l.length,d=document.createDocumentFragment();for(const p of l)d.appendChild(p);let m=!1;if(i instanceof HTMLInputElement)for(const p of d.querySelectorAll('input[type="radio"]:checked'))p instanceof HTMLInputElement&&p.value!==i.value&&(p.checked=!1,m=!0);e.appendChild(d),i&&m&&i.dispatchEvent(new Event("change",{bubbles:!0}));const f=e.querySelectorAll(".js-divider");for(const p of f)p.classList.toggle("d-none",Boolean(o&&o.trim().length>0));return u}(e,t,{limit:n,sortKey:e=>{const t=(n=e).hasAttribute("data-filter-value")?n.getAttribute("data-filter-value").toLowerCase().trim():n.textContent.toLowerCase().trim();var n;const o=Oe(t,s);return o>0?{score:o,text:t}:null}});break}case"substring":o=jo(e,t.toLowerCase(),Mo,{limit:n});break;case"substring-memory":o=await xo(e,t,{limit:n});break;default:o=jo(e,t.toLowerCase(),Ao,{limit:n})}return e.classList.toggle("filterable-active",t.length>0),e.classList.toggle("filterable-empty",0===o),o}function Ao(e,t){return e.textContent.toLowerCase().trim().startsWith(t)}function Mo(e,t){if(e.classList.contains("select-menu-no-results"))return null;return(e.querySelector("[data-filterable-item-text]")||e).textContent.toLowerCase().trim().includes(t)}p(".js-filterable-field",{constructor:HTMLInputElement,initialize(e){e.autocomplete||(e.autocomplete="off");let t=e.value;async function n(e){t!==e.value&&(t=e.value,await ie(),f(e,"filterable:change"))}async function o(){t=e.value,await ie(),f(e,"filterable:change")}return{add(e){e.addEventListener("focus",o),Fe(e,n),document.activeElement===e&&o()},remove(e){e.removeEventListener("focus",o),Be(e,n)}}}}),u("filterable:change",".js-filterable-field",(async function(e){const t=e.currentTarget,n=t.value.trim().toLowerCase(),o=document.querySelectorAll(`[data-filterable-for="${t.id}"]`);for(const s of o){const e=await So(s,n);if(-1===e)return;document.activeElement&&t===document.activeElement&&Ie(`${e} results found.`),s.dispatchEvent(new CustomEvent("filterable:change",{bubbles:!0,cancelable:!1,detail:{inputField:t}}))}})),u("filterable:change","details-menu .select-menu-list",(function(e){const t=e.currentTarget,n=t.querySelector(".js-new-item-form");n&&function(e,t,n){const o=n.length>0&&!function(e,t){for(const n of e.querySelectorAll("[data-menu-button-text]")){if(n.textContent.toLowerCase().trim()===t.toLowerCase())return!0}return!1}(e,n);if(e.classList.toggle("is-showing-new-item-form",o),!o)return;a(t,".js-new-item-name").textContent=n;const s=t.querySelector(".js-new-item-value");(s instanceof HTMLInputElement||s instanceof HTMLButtonElement)&&(s.value=n)}(t,n,e.detail.inputField.value)})),p("tab-container .select-menu-list .filterable-empty, details-menu .select-menu-list .filterable-empty",{add(e){m(e,".select-menu-list").classList.add("filterable-empty")},remove(e){m(e,".select-menu-list").classList.remove("filterable-empty")}});const Ho=navigator.userAgent.match(/Firefox\/(\d+)/);function qo(e){return"ArrowDown"===e.key||"ArrowUp"===e.key}function Co(e){const t=m(e,"label");t.hasAttribute("data-role")||t.setAttribute("data-role",i(t,"role")),t.setAttribute("role",i(t,"data-role")),e.removeAttribute("role")}function _o(){Ue(document)&&ze(document)}Ho&&Number(Ho[1])<76&&(p('details-menu label[tabindex][role^="menuitem"]',e=>{const t=e.querySelector("input");if(!t)return;const n=e.classList.contains("select-menu-item"),o=t.classList.contains("d-none"),s=n||o||t.hidden;n&&t.classList.add("d-block"),o&&t.classList.remove("d-none"),s&&(t.classList.add("sr-only"),t.hidden=!1),e.removeAttribute("tabindex")}),u("focus",'details-menu label[role="menuitemradio"] input, details-menu label[role="menuitemcheckbox"] input',e=>{const t=m(e.currentTarget,"label");t.classList.contains("select-menu-item")&&t.classList.add("navigation-focus"),t.classList.contains("SelectMenu-item")&&t.classList.add("hx_menuitem--focus"),t.classList.contains("dropdown-item")&&t.classList.add("hx_menuitem--focus"),e.currentTarget.addEventListener("blur",()=>{t.classList.contains("select-menu-item")&&t.classList.remove("navigation-focus"),t.classList.contains("SelectMenu-item")&&t.classList.remove("hx_menuitem--focus"),t.classList.contains("dropdown-item")&&t.classList.remove("hx_menuitem--focus")},{once:!0})},{capture:!0}),Me("keydown",'details-menu label[role="menuitemradio"] input, details-menu label[role="menuitemcheckbox"] input',(async function(e){if(qo(e))e.currentTarget instanceof Element&&function(e){const t=m(e,"label");t.hasAttribute("data-role")||t.setAttribute("data-role",i(t,"role"));e.setAttribute("role",i(t,"data-role")),t.removeAttribute("role")}(e.currentTarget);else if("Enter"===e.key){const t=e.currentTarget;e.preventDefault(),await ie(),t instanceof HTMLInputElement&&t.click()}})),u("blur",'details-menu label input[role="menuitemradio"], details-menu label input[role="menuitemcheckbox"]',e=>{Co(e.currentTarget)},{capture:!0}),Me("keyup",'details-menu label[role="menuitemradio"] input, details-menu label[role="menuitemcheckbox"] input',e=>{qo(e)&&e.currentTarget instanceof Element&&Co(e.currentTarget)})),ue(_o),u("click",'a[href^="#"]',(function(e){const{currentTarget:t}=e;t instanceof HTMLAnchorElement&&setTimeout(_o,0)})),u("click",".js-flash-close",(function(e){const t=e.currentTarget.closest(".flash-messages");e.currentTarget.closest(".flash").remove(),t&&!t.querySelector(".flash")&&t.remove()}));const $o=["flash-notice","flash-error","flash-message","flash-warn"];p("template.js-flash-template",{constructor:HTMLTemplateElement,add(e){!function(e){for(const{key:n,value:o}of $o.flatMap(qe)){let s;Ce(n);try{s=atob(decodeURIComponent(o))}catch(t){continue}e.after(new S(e,{className:n,message:s}))}}(e)}});const Io=new WeakMap;function Do(e){e instanceof CustomEvent&&Ie(`${e.detail} results found.`)}function Po(){Ke(Je()),Xe(Ge());const e=document.querySelector("meta[name=analytics-ec-payload]");e instanceof HTMLMetaElement&&Ro(e.content);const t=Ye("ga-deferred");t&&(Ro(t),Qe("ga-deferred"));for(const n of v(document,"meta.js-ga-set",HTMLMetaElement))Ze(n.name,n.content)}function Ro(e){if(e)for(const t of JSON.parse(e))window.ga.apply(null,t)}function No(){for(const e of document.querySelectorAll("meta[name=analytics-virtual-pageview]"))e instanceof HTMLMetaElement&&et(e.content,{title:""});et()}function Fo(e){const[t,n,o,s]=e.trim().split(/\s*,\s*/);return s?{category:t,action:n,label:o,value:Number(s)}:{category:t,action:n,label:o}}document.addEventListener("focus",(function(e){const t=e.target;t instanceof Element&&!Io.get(t)&&(f(t,"focusin:delay"),Io.set(t,!0))}),{capture:!0}),document.addEventListener("blur",(function(e){setTimeout((function(){const t=e.target;t instanceof Element&&t!==document.activeElement&&(f(t,"focusout:delay"),Io.delete(t))}),200)}),{capture:!0}),d(".js-form-toggle-target",(async function(e,t){await t.text();const n=m(e,".js-form-toggle-container");a(n,".js-form-toggle-target[hidden]").hidden=!1,e.hidden=!0})),p("fuzzy-list",{constructor:We,subscribe:e=>ae(e,"fuzzy-list-sorted",Do)}),u("click",".email-hidden-toggle",(function(e){const t=e.currentTarget.nextElementSibling;t instanceof HTMLElement&&(t.style.display="",t.classList.toggle("expanded"),e.preventDefault())})),Ve("octolyticsPlugin",(function(e){const t=e.get("sendHitTask");e.set("sendHitTask",(function(e){if(t(e),"event"===e.get("hitType")&&window._octo&&""!==window._octo.host){const t=`//${window._octo.host}/collect`,n=new Blob([e.get("hitPayload")],{type:"application/x-www-form-urlencoded"});navigator.sendBeacon&&navigator.sendBeacon(t,n)}}))}));const Bo=document.querySelector("meta[name=google-analytics]");Bo instanceof HTMLMetaElement&&$n()&&(tt(Bo.content,"auto"),nt("octolyticsPlugin"),nt("ec"),Po()),async function(){await ve,No()}(),document.addEventListener("pjax:complete",()=>{setTimeout(()=>{Po(),No()},20)},!1),p("[data-ga-load]",(function(e){const t=Fo(e.getAttribute("data-ga-load")||"");t.interactive=!1,ot(t)})),p("meta[name=analytics-event]",{constructor:HTMLMetaElement,initialize(e){const t=Fo(e.content);t.interactive=!1,ot(t)}}),u("click","[data-ga-click]",(function(e){Ro(e.currentTarget.getAttribute("data-ga-ec")||"");const t=Fo(e.currentTarget.getAttribute("data-ga-click")||"");ot(t)}),{capture:!0}),u("click","[data-ga-deferred]",(function(e){st("ga-deferred",e.currentTarget.getAttribute("data-ga-deferred")||"")}),{capture:!0}),u("change","[data-ga-change]",(function(e){Ro(e.currentTarget.getAttribute("data-ga-ec")||"");const t=Fo(e.currentTarget.getAttribute("data-ga-change")||"");ot(t)}),{capture:!0}),u("click",".js-skip-to-content",(function(e){const t=document.getElementById("start-of-content");if(t){const e=t.nextElementSibling;e instanceof HTMLElement&&(e.setAttribute("tabindex","-1"),e.focus())}e.preventDefault()}));const Oo="ontouchstart"in document;for(const t of document.querySelectorAll(".HeaderMenu-details"))t.addEventListener("toggle",zo),Oo||(t.addEventListener("mouseover",Wo),t.addEventListener("mouseleave",Wo));let Uo=!1;function zo(e){if(!Uo){Uo=!0;for(const t of document.querySelectorAll(".HeaderMenu-details"))t!==e.currentTarget&&t.removeAttribute("open");setTimeout(()=>Uo=!1)}}function Wo(e){const{currentTarget:t}=e;t instanceof HTMLElement&&window.innerWidth>1012&&("mouseover"===e.type&&e instanceof MouseEvent?e.target instanceof Node&&e.relatedTarget instanceof Node&&t.contains(e.target)&&!t.contains(e.relatedTarget)&&t.setAttribute("open",""):t.removeAttribute("open"))}function Vo(e){const t=v(document,".js-hook-event-checkbox",HTMLInputElement);for(const n of t)n.checked=n.matches(e)}p(".js-hook-url-field",{constructor:HTMLInputElement,add(e){function t(){const t=e.form;if(!t)return;let n;try{n=new URL(e.value)}catch(i){}const o=t.querySelector(".js-invalid-url-notice");o instanceof HTMLElement&&(o.hidden=!!(""===e.value||n&&/^https?:/.test(n.protocol)));const s=t.querySelector(".js-insecure-url-notice");s instanceof HTMLElement&&n&&e.value&&(s.hidden=/^https:$/.test(n.protocol));const r=t.querySelector(".js-ssl-hook-fields");r instanceof HTMLElement&&(r.hidden=!(n&&"https:"===n.protocol))}Fe(e,t),t()}}),u("change",".js-hook-event-choice",(function(e){const t=e.currentTarget,n=t.checked&&"custom"===t.value,o=t.closest(".js-hook-events-field");if(o&&o.classList.toggle("is-custom",n),t.checked)if(n){a(document,".js-hook-wildcard-event",HTMLInputElement).checked=!1}else"push"===t.value?Vo('[value="push"]'):"all"===t.value&&Vo(".js-hook-wildcard-event")})),u("details:toggled",".js-hook-secret",(function(e){const t=e.currentTarget,n=a(t,".hook-secret-field > input[type=text]",HTMLInputElement);t.classList.contains("open")&&n.focus()})),u("click",".js-hook-deliveries-pagination-button",(async function(e){const t=e.currentTarget;t.disabled=!0;const n=t.parentElement,o=i(t,"data-url");n.before(await Te(document,o)),n.remove()})),d(".js-redeliver-hook-form",(async function(e,t){let n;try{n=await t.html()}catch(o){return void e.classList.add("failed")}a(document,".js-hook-deliveries-container").replaceWith(n.html)})),d(".js-test-hook-form",(async function(e,t){const n=a(document,".js-test-hook-message");n.classList.remove("error","success");try{await t.text()}catch(o){n.classList.add("error");const e=a(n,".js-test-hook-message-errors");if(null!=o.response){const t=await o.response.json();e.textContent=t.errors}else e.textContent=e.getAttribute("data-network-error-message")||"";return}n.classList.add("success")})),p("[data-hotkey]",{constructor:HTMLElement,add(e){A(e)},remove(e){M(e)}});const Ko=document.querySelector(".js-hovercard-content"),Jo=He(Te);let Xo,Go,Yo=null,Qo=0;function Zo(e){return"Popover-message--"+e}function es(){Ko instanceof HTMLElement&&(Ko.style.display="none",Ko.children[0].innerHTML="",Yo=null,Xo=null)}function ts(e){const{width:t,height:n}=Ko.getBoundingClientRect(),{left:o,top:s,height:r,width:i}=function(e){const t=e.getClientRects();let n=t[0]||{top:0,left:0,height:0,width:0};for(const o of t)if(o.left<Qo&&o.right>Qo){n=o;break}return n}(e),a=s>n;if(e.classList.contains("js-hovercard-left")){const e=s+r/2;return{containerTop:a?e-n+17+8:e-17-8,containerLeft:o-t-12,contentClassSuffix:a?"right-bottom":"right-top"}}{const e=window.innerWidth-o>t,c=o+i/2;return{containerTop:a?s-n-12:s+r+12,containerLeft:e?c-24:c-t+24,contentClassSuffix:a?e?"bottom-left":"bottom-right":e?"top-left":"top-right"}}}function ns(e,t){if(!(Ko instanceof HTMLElement))return;const n=Ko.children[0];n.innerHTML="";const o=document.createElement("div");for(const s of e.children)o.appendChild(s.cloneNode(!0));n.appendChild(o),function(e,t){if(!(Ko instanceof HTMLElement))return;Ko.style.visibility="hidden",Ko.style.display="block",t.classList.remove(Zo("bottom-left"),Zo("bottom-right"),Zo("right-top"),Zo("right-bottom"),Zo("top-left"),Zo("top-right"));const{containerTop:n,containerLeft:o,contentClassSuffix:s}=ts(e);t.classList.add(Zo(s)),Ko.style.top=`${n+window.pageYOffset}px`,Ko.style.left=`${o+window.pageXOffset}px`,function(e,t){const n=e.getAttribute("data-hovercard-z-index-override");t.style.zIndex=n||"100"}(e,Ko),Ko.style.visibility=""}(t,n),function(e){setTimeout(()=>{if(document.body&&document.body.contains(e)){const t=e.querySelector("[data-hovercard-tracking]");if(t){const e=t.getAttribute("data-hovercard-tracking");if(e){const t={event_type:"user-hovercard-load"};t.dimensions=JSON.parse(e),rt(t)}}const n=e.querySelector("[data-hydro-view]");n instanceof HTMLElement&&it(n)}},500)}(o),Ko.style.display="block"}function os(e){const t=e.getAttribute("data-hovercard-url");if(t){const n=function(e){const t=e.closest("[data-hovercard-subject-tag]");if(t)return t.getAttribute("data-hovercard-subject-tag");const n=document.head&&document.head.querySelector('meta[name="hovercard-subject-tag"]');return n?n.getAttribute("content"):null}(e);if(n){const e=new URL(t,window.location.origin),o=new URLSearchParams(e.search.slice(1));return o.append("subject",n),o.append("current_path",window.location.pathname+window.location.search),e.search=o.toString(),e.toString()}return t}return""}function ss(e){!async function(e,t){const n=e.currentTarget;if(e instanceof MouseEvent&&(Qo=e.clientX),!(n instanceof Element))return;if(Xo===n)return;if(n.closest(".js-hovercard-content"))return;if(!function(e){const t=e.getAttribute("data-hovercard-type");return"pull_request"===t||"issue"===t?!!e.closest("[data-issue-and-pr-hovercards-enabled]"):"team"===t?!!e.closest("[data-team-hovercards-enabled]"):"repository"===t?!!e.closest("[data-repository-hovercards-enabled]"):"commit"===t?!!e.closest("[data-commit-hovercards-enabled]"):"project"===t?!!e.closest("[data-project-hovercards-enabled]"):"discussion"===t?!!e.closest("[data-discussion-hovercards-enabled]"):"acv_badge"!==t||!!e.closest("[data-acv-badge-hovercards-enabled]")}(n))return;es(),Xo=n,Yo=document.activeElement;const o=os(n);let s;try{const e=new Promise(e=>window.setTimeout(e,t,0));s=await Jo(document,o),await e}catch(r){const e=r.response;if(e&&404===e.status){const e="Hovercard is unavailable";n.setAttribute("aria-label",e),n.classList.add("tooltipped","tooltipped-ne")}else if(e&&410===e.status){const t=await e.clone().json();n.setAttribute("aria-label",t.message),n.classList.add("tooltipped","tooltipped-ne")}return}n===Xo&&(ns(s,n),e instanceof KeyboardEvent&&Ko instanceof HTMLElement&&Ko.focus())}(e,250)}function rs(e){if(Xo){if(e instanceof MouseEvent&&e.relatedTarget instanceof HTMLElement){const t=e.relatedTarget;if(t.closest(".js-hovercard-content")||t.closest("[data-hovercard-url]"))return}else e instanceof KeyboardEvent&&Yo instanceof HTMLElement&&Yo.focus();es()}}function is(e){const t=Xo;Go=window.setTimeout(()=>{Xo===t&&rs(e)},100)}function as(e){if(e instanceof KeyboardEvent)switch(e.key){case"Escape":rs(e)}}function cs(){Go&&clearTimeout(Go)}function ls(e,t){const n=e.currentTarget;if(n instanceof Element){for(const e of n.querySelectorAll("[data-show-on-error]"))e instanceof HTMLElement&&(e.hidden=!t);for(const e of n.querySelectorAll("[data-hide-on-error]"))e instanceof HTMLElement&&(e.hidden=t)}}function us(e){ls(e,!1)}function ds(e){ls(e,!0)}function ms(){t.import("./jump-to.js")}Ko&&(p("[data-hovercard-url]",{subscribe:e=>$e(ae(e,"mouseover",ss),ae(e,"mouseleave",is),ae(e,"keyup",as))}),p("[data-hovercard-url]",{remove(e){Xo===e&&es()}}),p(".js-hovercard-content",{subscribe:e=>$e(ae(e,"mouseover",cs),ae(e,"mouseleave",rs),ae(e,"keyup",as))}),p(".js-hovercard-include-fragment",{constructor:HTMLTemplateElement,add(e){Xo&&ns(e.content,Xo)}}),u("menu:activated","details",es),window.addEventListener("statechange",es)),u("click","[data-hydro-click]",(function(e){const t=e.currentTarget,n=t.getAttribute("data-hydro-click")||"",o=t.getAttribute("data-hydro-click-hmac")||"",s=t.getAttribute("data-hydro-client-context")||"";at(n,o,s)})),u("click","[data-optimizely-hydro-click]",(function(e){const t=e.currentTarget,n=t.getAttribute("data-optimizely-hydro-click")||"",o=t.getAttribute("data-optimizely-hydro-click-hmac")||"";at(n,o,"")})),d(".js-immediate-updates",(async function(e,t){let n;try{n=(await t.json()).json.updateContent}catch(o){o.response.json&&(n=o.response.json.updateContent)}if(n)for(const s in n){const e=n[s],t=document.querySelector(s);t instanceof HTMLElement&&Le(t,e)}})),p("include-fragment, poll-include-fragment",{subscribe:e=>$e(ae(e,"error",ds),ae(e,"loadstart",us))}),u("click","include-fragment button[data-retry-button]",({currentTarget:e})=>{const t=m(e,"include-fragment",window.IncludeFragmentElement),n=t.src;t.src="",t.src=n}),u("click",".js-timeout-flash-close",(function(e){e.target instanceof HTMLElement&&(m(e.target,".js-interactive-component-timeout").hidden=!0)})),u("click",".js-interactive-component-button",(function(e){const t=e.target;if(t instanceof HTMLButtonElement){const e=t.querySelector(".js-loading-spinner");e instanceof HTMLElement&&(e.hidden=!1)}})),d(".js-interactive-component-form",(async function(e,t){const n=a(e,".js-interactive-component-timeout"),o=m(e,".js-component-container");if(n){n.hidden=!0;const t=v(o,".js-interactive-component-button",HTMLButtonElement);for(const e of t)e.disabled=!0;const s=parseInt(i(e,"data-timeout"));setTimeout(()=>{if(n){n.hidden=!1;const e=v(o,".js-interactive-component-button[disabled]",HTMLButtonElement);for(const t of e){t.disabled=!1;const e=t.querySelector(".loading-spinner");e instanceof HTMLElement&&(e.hidden=!0)}}},s)}await t.text()})),p("[data-indeterminate]",{constructor:HTMLInputElement,initialize(e){e.indeterminate=!0}}),p(".js-jump-to-field",{constructor:HTMLInputElement,add(e){e.addEventListener("focusin",ms,{once:!0}),ct(window.location.pathname)}}),p(".js-header-global-search",{constructor:HTMLElement,add(e){const t=a(e,"#header-global-search-input",HTMLInputElement),n=a(e,".js-global-search-clear-button",HTMLButtonElement);function o(){t.value="",t.focus()}document.addEventListener("pjax:complete",e=>{var n;const o=null===(n=e.currentTarget.querySelector(".menu-item.selected"))||void 0===n?void 0:n.getAttribute("href");if(o){const e=new URL(o,window.location.origin).searchParams,n=e.get("type"),s=e.get("q")||"";t.value=`${n?`search:${n} `:""}${s}`}}),n.addEventListener("click",o),t.addEventListener("focusin",()=>{n.removeEventListener("click",o),ms()},{once:!0}),ct(window.location.pathname)}});let fs=!1;async function ps(){if(fs)return;fs=!0;const e={contexts:a(document,"meta[name=github-keyboard-shortcuts]",HTMLMetaElement).content},t=`/site/keyboard_shortcuts?${new URLSearchParams(e).toString()}`;(await xe({content:Te(document,t),dialogClass:"hx_Box--overlay--wide"})).addEventListener("dialog:remove",(function(){fs=!1}),{once:!0})}function hs(e){const t=e.currentTarget;if(!(t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement))return;const n=parseInt(t.getAttribute("data-input-max-length")||"",10),o=parseInt(t.getAttribute("data-warning-length")||"",10)||5,s=t.value.replace(/(\r\n|\n|\r)/g,"\r\n");let r=n-s.length;if(r<=0){let e=s.substr(0,n);e.endsWith("\r")?(e=e.substr(0,n-1),r=1):r=0,t.value=e}const c=i(t,"data-warning-text"),l=m(t,".js-length-limited-input-container"),u=a(l,".js-length-limited-input-warning");r<=o?(u.textContent=c.replace(new RegExp("{{remaining}}","g"),`${r}`),u.classList.remove("d-none")):(u.textContent="",u.classList.add("d-none"))}u("click",".js-keyboard-shortcuts",ps),document.addEventListener("keydown",e=>{e.target instanceof Node&<(e.target)||"?"===H(e)&&ps()}),p(".js-modifier-key",{constructor:HTMLElement,add(e){if(/Macintosh/.test(navigator.userAgent)){let t=e.textContent;t&&(t=t.replace(/ctrl/,"⌘"),t=t.replace(/alt/,"⌥"),e.textContent=t)}}}),p(".js-modifier-label-key",{add(e){if(/Macintosh/.test(navigator.userAgent)){let t=i(e,"aria-label");t=t.replace(/ctrl\+/,"cmd-"),t=t.replace(/alt\+/,"option-"),e.setAttribute("aria-label",t)}}}),p(".js-length-limited-input",{add(e){e.addEventListener("input",hs),e.addEventListener("change",hs)},remove(e){e.removeEventListener("input",hs),e.removeEventListener("change",hs)}}),p("link[rel=prefetch-viewed]",{initialize(){window.requestIdleCallback(()=>{fetch(location.href,{method:"HEAD",credentials:"same-origin",headers:{Purpose:"prefetch-viewed"}})})}}),u("click",".js-member-search-filter",(function(e){e.preventDefault();const t=i(e.currentTarget,"data-filter"),n=m(e.currentTarget,"[data-filter-on]"),o=i(n,"data-filter-on"),s=a(document,".js-member-filter-field",HTMLInputElement),r=s.value,c=new RegExp(`${o}:(?:[a-z]|_|((').*(')))+`),l=r.toString().trim().replace(c,"");s.value=`${l} ${t}`.replace(/\s\s/," ").trim(),s.focus(),f(s,"input")})),u("submit",".js-mobile-preference-form",({currentTarget:e})=>{a(e,".js-mobile-preference-anchor-field",HTMLInputElement).value=window.location.hash.substr(1)}),u("auto-check-success",".js-new-organization-name",(function(e){const t=e.target,n=m(t,"dd").querySelector(".js-field-hint-name");n&&(n.textContent=t.value)})),d(".js-notice-dismiss",(async function(e,t){await t.text(),m(e,".js-notice").remove()})),async function(){await ge,window._octo&&(window._octo.push(["enablePerformance"]),window._octo.push(["recordPageView"]))}(),p(".js-octo-ga-id",e=>{window.ga(t=>{t&&e.setAttribute("content",t.get("clientId"))})}),p(".js-octo-ga-id-input",e=>{window.ga(t=>{t&&e.setAttribute("value",t.get("clientId"))})}),document.addEventListener("pjax:complete",(function(){window._octo&&window._octo.push(["recordPageView"])})),u("click",".js-permalink-shortcut",(function(e){const t=e.currentTarget;try{se(null,"",t.href+window.location.hash)}catch(n){window.location.href=t.href+window.location.hash}e.preventDefault()})),d(".js-permission-menu-form",(async function(e,t){const n=a(e,".js-permission-success"),o=a(e,".js-permission-error");let s;n.hidden=!0,o.hidden=!0,e.classList.add("is-loading");try{s=await t.json()}catch(i){return e.classList.remove("is-loading"),void(o.hidden=!1)}e.classList.remove("is-loading"),n.hidden=!1;const r=e.closest(".js-org-repo");if(r){const e=s.json;r.classList.toggle("with-higher-access",e.members_with_higher_access)}})),async function(){await ve;const e=document.querySelector(".js-pjax-loader-bar");if(!e)return;const t=e.firstElementChild;if(!(t instanceof HTMLElement))return;let n=0,o=null,s=null;function r(e){t instanceof HTMLElement&&(0===e&&(null==s&&(s=getComputedStyle(t).transition),t.style.transition="none"),n=e,t.style.width=`${n}%`,0===e&&(t.clientWidth,t.style.transition=s||""))}function i(){0===n&&(n=12),r(Math.min(n+3,95)),o=window.setTimeout(i,500)}document.addEventListener("pjax:start",(function(){r(0),e&&e.classList.add("is-loading"),o=window.setTimeout(i,0)})),document.addEventListener("pjax:end",(function(){o&&clearTimeout(o),r(100),e&&e.classList.remove("is-loading")}))}();let gs=null;"getEntriesByName"in window.performance&&(document.addEventListener("pjax:start",(function(e){e instanceof CustomEvent&&e.detail&&e.detail.url&&(window.performance.mark("pjax_start"),gs=e.detail.url)})),document.addEventListener("pjax:end",(async function(){if(await ie(),!window.performance.getEntriesByName("pjax_start").length)return;window.performance.mark("pjax_end"),window.performance.measure("last_pjax_request","pjax_start","pjax_end");const e=window.performance.getEntriesByName("last_pjax_request").pop(),t=e?e.duration:null;t&&(gs&&be({requestUrl:gs,pjaxDuration:Math.round(t)}),window.performance.clearMarks("pjax_start"),window.performance.clearMarks("pjax_end"),window.performance.clearMeasures("last_pjax_request"))}))),document.addEventListener("pjax:click",(function(e){if(window.onbeforeunload)return e.preventDefault()}));let bs=null;function vs(e,t){return e.split("/",3).join("/")===t.split("/",3).join("/")}function ws(e){if(e instanceof window.Window)return"window";if(e instanceof window.Document)return"#document";const t=[e.nodeName.toLowerCase()],n=e.id;if(n&&t.push(`#${n}`),"function"==typeof e.getAttribute&&e.getAttribute("class")){const n=(e.getAttribute("class")||"").trim().split(/\s+/).join(".");n&&t.push(`.${n}`)}return t.join("")}function ys(e,t){const n=e.closest("[data-pjax-container]");if(!n)throw new Error(`no pjax container for ${function(e){const t=[];let n=e;for(;n&&(t.push(ws(n)),!(n instanceof window.Window))&&9!==n.nodeType&&!n.id;){if(n.parentNode instanceof Document){t.push("#document");break}if(!(n.parentNode instanceof HTMLElement))break;n=n.parentNode}return t.reverse().join(" > ")}(e)}`);const o=function(e){if(e.id)return`#${e.id}`;throw new Error("pjax container has no id")}(n),s=new URL(e.href,window.location.origin),r=new URLSearchParams(s.search.slice(1));return r.append("_pjax",encodeURIComponent(o)),s.search=r.toString(),Ne(s.href,{headers:Object.assign({Accept:"text/html","X-PJAX":"true","X-PJAX-Container":o},t&&t.headers)})}function js(e){return null==e.getAttribute("data-pjax-preserve-scroll")&&0}function Ls(e){let t=e;for(;t;){const e=t.getAttribute("data-pjax");if(e&&"true"!==e)return document.querySelector(e);t=t.parentElement&&t.parentElement.closest("[data-pjax]")}return e.closest("[data-pjax-container]")}function Es(e){return e.href.replace(/#.*/,"")}u("pjax:click",".js-pjax-capture-input",(function(){bs=function(e){const t=e.createElement("textarea");return t.style.position="fixed",t.style.top="0",t.style.left="0",t.style.opacity="0",e.body.appendChild(t),t.focus(),()=>(t.blur(),t.remove(),t.value)}(document)})),u("pjax:end","#js-repo-pjax-container",(function(){if(bs){const e=bs(),t=document.querySelector(".js-pjax-restore-captured-input");t instanceof HTMLInputElement&&e&&je(t,e),bs=null}})),u("pjax:click","#js-repo-pjax-container a[href]",(function(e){const t=e.currentTarget.pathname;vs(t,location.pathname)?function(e){const t=e.split("/")[3];return["commit","commits","community","issues","packages","projects","releases","security","tags","wiki"].includes(t)&&vs(e,location.pathname)}(t)&&e.preventDefault():e.preventDefault()})),u("pjax:click",".js-comment-body",(function(e){const t=e.target;t instanceof HTMLAnchorElement&&"files"===t.pathname.split("/")[3]&&e.preventDefault()})),u("pjax:click",".js-pjax-history-navigate",(function(e){e.currentTarget instanceof HTMLAnchorElement&&(e.currentTarget.href===ut()?(history.back(),e.detail.relatedEvent.preventDefault(),e.preventDefault()):e.currentTarget.href===dt()&&(history.forward(),e.detail.relatedEvent.preventDefault(),e.preventDefault()))})),p("[data-pjax-container] link[rel=pjax-prefetch]",{constructor:HTMLLinkElement,initialize(e){const t=ys(e,{headers:{Purpose:"prefetch"}});mt("JS_HTTP_CACHE_HEADERS")||ft(e,t)}}),u("click","[data-pjax] a, a[data-pjax]",(function(e){const t=e.currentTarget;if(t instanceof HTMLAnchorElement){if(null!=t.getAttribute("data-skip-pjax"))return;if(null!=t.getAttribute("data-remote"))return;const n=Ls(t);n&&function(e,t){const n=e.currentTarget;if(0!==e.button||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return;if(location.protocol!==n.protocol||location.hostname!==n.hostname)return;if(n.href.indexOf("#")>-1&&Es(n)===Es(location))return;if(e.defaultPrevented)return;const o=Object.assign({url:n.href,target:n},t),s=new CustomEvent("pjax:click",{bubbles:!0,cancelable:!0,detail:{options:o,relatedEvent:e}});n.dispatchEvent(s)&&(pt(o),e.preventDefault(),n.dispatchEvent(new CustomEvent("pjax:clicked",{bubbles:!0,cancelable:!0,detail:{options:o}})))}(e,{container:n,scrollTo:js(t)})}})),u("change","select[data-pjax]",(function(e){const t=e.currentTarget,n=Ls(t);n&&pt({url:t.value,container:n})})),u("submit","form[data-pjax]",(function(e){const t=e.currentTarget,n=Ls(t);if(!n)return;const o=js(t),s={type:(t.method||"GET").toUpperCase(),url:t.action,target:t,scrollTo:o,container:n};if("GET"===s.type){if(t.querySelector("input[type=file]"))return;const e=function(e){const t=document.createElement("a");return t.href=e,t}(s.url);e.search+=(e.search?"&":"")+ne(t),s.url=e.toString()}else s.data=new FormData(t);pt(s),e.preventDefault()})),p("body.js-print-popup",()=>{window.print(),setTimeout(window.close,1e3)}),p("poll-include-fragment[data-redirect-url]",(function(e){const t=e.getAttribute("data-redirect-url");e.addEventListener("load",(function(){window.location.href=t}))})),p("poll-include-fragment[data-reload]",(function(e){e.addEventListener("load",(function(){window.location.reload()}))}));let Ts=!1,ks=0;const xs=Date.now();function Ss(e){var t;const n=function(e){return q(e.stack||"").map(e=>({filename:e.file||"",function:String(e.methodName),lineno:(e.lineNumber||0).toString(),colno:(e.column||0).toString()}))}(e),o=null!==(t=e.framesToPop)&&void 0!==t?t:0;return 0===o?n:n.slice(o)}const As=/(chrome|moz|safari)-extension:\/\//;function Ms(){var e,t;const n=null===(t=null===(e=document.head)||void 0===e?void 0:e.querySelector('meta[name="user-login"]'))||void 0===t?void 0:t.content;if(n)return n;const o=we();return o?`anonymous-${o}`:null}let Hs=!1;window.addEventListener("pageshow",()=>Hs=!1),window.addEventListener("pagehide",()=>Hs=!0);const qs=document.querySelector("meta[name=js-proxy-site-detection-payload]"),Cs=document.querySelector("meta[name=expected-hostname]");if(qs instanceof HTMLMetaElement&&Cs instanceof HTMLMetaElement&&ht(document)){const e={url:window.location.href,expectedHostname:Cs.content,documentHostname:document.location.hostname,proxyPayload:qs.content},t=new Error,n={};n.$__=btoa(JSON.stringify(e)),function(e,t={}){!async function(e){var t,n;if(!(!Hs&&!Ts&&ks<10&&"function"==typeof Blob&&"undefined"!=typeof Intl&&"undefined"!=typeof MutationObserver&&"undefined"!=typeof URLSearchParams&&"undefined"!=typeof WebSocket&&"undefined"!=typeof IntersectionObserver&&"undefined"!=typeof AbortController&&"entries"in FormData.prototype&&"toggleAttribute"in Element.prototype)||ht(document))return;const o=null===(n=null===(t=document.head)||void 0===t?void 0:t.querySelector('meta[name="browser-errors-url"]'))||void 0===n?void 0:n.content;if(!o)return;if(s=e.error.stacktrace,s.some(e=>As.test(e.filename)||As.test(e.function)))return void(Ts=!0);var s;ks++;try{await fetch(o,{method:"post",body:JSON.stringify(e)})}catch(r){}}(function(e,t={}){return Object.assign({error:e,sanitizedUrl:Je()||window.location.href,readyState:document.readyState,referrer:document.referrer,timeSinceLoad:Math.round(Date.now()-xs),user:Ms()||void 0},t)}(function(e){return{type:e.name,value:e.message,stacktrace:Ss(e)}}(e),t))}(t,n)}function _s(e){return"DIV"===e.nodeName&&e.classList.contains("highlight")}Me("keydown",".js-quick-submit",(function(e){!function(e){const t=e.target;if((e.ctrlKey||e.metaKey)&&"Enter"===e.key){const n=t.form,o=n.querySelector("input[type=submit], button[type=submit]");if(e.shiftKey){const e=n.querySelector(".js-quick-submit-alternative");(e instanceof HTMLInputElement||e instanceof HTMLButtonElement)&&!e.disabled&&ce(n,e)}else(o instanceof HTMLInputElement||o instanceof HTMLButtonElement)&&o.disabled||ce(n);e.preventDefault()}}(e)})),p(".js-quote-selection-container",{subscribe:e=>C(e,{quoteMarkdown:e.hasAttribute("data-quote-markdown"),scopeSelector:e.getAttribute("data-quote-markdown")||"",copyMarkdown:!1})}),document.addEventListener("quote-selection-markdown",(function(e){const t=e.detail,{fragment:n,range:o,unwrap:s}=t,r=o.startContainer.parentElement,i=r&&r.closest("pre");if(i instanceof HTMLElement&&!s){const e=i.parentElement;if(e&&_s(e)){const t=document.createElement("div");t.className=e.className,t.appendChild(n),n.appendChild(t)}}!function(e){const t=document.createNodeIterator(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>e.nodeName in $s&&function(e){return"IMG"===e.nodeName||null!=e.firstChild}(e)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}),n=[];let o=t.nextNode();for(;o;)o instanceof HTMLElement&&n.push(o),o=t.nextNode();n.reverse();for(const s of n)s.replaceWith($s[s.nodeName](s))}(n)}));const $s={PRE(e){const t=e.parentElement;if(t&&_s(t)){const n=t.className.match(/highlight-source-(\S+)/),o=n?n[1]:"",s=(e.textContent||"").replace(/\n+$/,"");e.textContent=`\`\`\`${o}\n${s}\n\`\`\``,e.append("\n\n")}return e},A(e){const t=e.textContent||"";return e.classList.contains("user-mention")||e.classList.contains("team-mention")?t:e.classList.contains("issue-link")&&/^#\d+$/.test(t)?t:e},IMG(e){const t=e.getAttribute("alt");return t&&e.classList.contains("emoji")?t:e},DIV(e){if(e.classList.contains("js-suggested-changes-blob"))e.remove();else if(e.classList.contains("blob-wrapper-embedded")){const t=e.parentElement,n=a(t,"a[href]",HTMLAnchorElement),o=document.createElement("p");o.textContent=n.href,t.replaceWith(o)}return e}};let Is,Ds;function Ps(e){const t=e.target,n=i(t,"data-reaction-label"),o=m(t,".js-add-reaction-popover"),s=a(o,".js-reaction-description");s.hasAttribute("data-default-text")||s.setAttribute("data-default-text",s.textContent||""),s.textContent=n}function Rs(e){const t=m(e.target,".js-add-reaction-popover"),n=a(t,".js-reaction-description"),o=n.getAttribute("data-default-text");o&&(n.textContent=o)}u("click",".js-comment-quote-reply",(function({currentTarget:e}){const t=m(e,".js-comment"),n=a(t,".js-comment-body");if(Ds&&"Range"===Ds.type&&n.contains(Ds.anchorNode))I(Ds.text,Ds.range);else{const e=window.getSelection();e.removeAllRanges(),e.selectAllChildren(n),I(e.toString(),e.getRangeAt(0))}})),document.addEventListener("selectionchange",g((function(){const e=window.getSelection();let t;try{t=e.getRangeAt(0)}catch(n){return void(Is=null)}Is={type:e.type,anchorNode:e.anchorNode,text:e.toString(),range:t}}),100)),document.addEventListener("toggle",(function(e){const t=e.target;if(!(t instanceof Element&&t.hasAttribute("open")))return;Ds=Is;const n=t.querySelector(".js-comment-quote-reply.d-none");if(!n)return;const o=_(t);o&&(o.querySelector(".js-inline-comment-form-container")||$(o))&&n.classList.remove("d-none")}),{capture:!0}),d(".js-pick-reaction",(async function(e,t){const n=await t.json(),o=m(e,".js-comment"),s=a(o,".js-reactions-container"),r=a(o,".js-comment-header-reaction-button"),i=oe(document,n.json.reactions_container.trim()),c=oe(document,n.json.comment_header_reaction_button.trim());s.replaceWith(i),r.replaceWith(c),o.classList.remove("is-reacting")})),u("toggle",".js-reaction-popover-container",(function(e){const t=e.currentTarget.hasAttribute("open");for(const n of v(e.target,".js-reaction-option-item"))t?(n.addEventListener("mouseenter",Ps),n.addEventListener("mouseleave",Rs)):(n.removeEventListener("mouseenter",Ps),n.removeEventListener("mouseleave",Rs));m(e.target,".js-comment").classList.toggle("is-reacting",t)}),{capture:!0}),u("click",["form button:not([type])","form button[type=submit]","form input[type=submit]"].join(", "),(function(e){const t=e.currentTarget;t.form&&!e.defaultPrevented&>(t)})),d("form[data-remote]",(function(e,t,n){"json"===e.getAttribute("data-type")&&n.headers.set("Accept","application/json"),f(e,"deprecatedAjaxSend",{request:n}),t.text().catch(e=>{if(e.response)return e.response;throw e}).then(t=>{t.status<300?f(e,"deprecatedAjaxSuccess"):f(e,"deprecatedAjaxError",{error:t.statusText,status:t.status,text:t.text})},t=>{f(e,"deprecatedAjaxError",{error:t.message,status:0,text:null})}).then(()=>{f(e,"deprecatedAjaxComplete")})})),u("deprecatedAjaxComplete","form",(function({currentTarget:e}){const t=bt(e);t&&t.remove()})),T(e=>{const t=bt(e);t&&t.remove()}),D(Re);let Ns=class RemotePaginationElement extends HTMLElement{constructor(){super(...arguments),this.loaderWasFocused=!1}connectedCallback(){this.setPaginationUrl(this.list)}get hasNextPage(){return!this.form.hidden}loadNextPage(){this.hasNextPage&&ce(this.form)}get disabled(){return this.submitButton.hasAttribute("aria-disabled")}set disabled(e){e?this.submitButton.setAttribute("aria-disabled","true"):this.submitButton.removeAttribute("aria-disabled"),this.submitButton.classList.toggle("disabled",e)}loadstart(e){e.target.addEventListener("focus",()=>{this.loaderWasFocused=!0},{once:!0}),e.target.addEventListener("include-fragment-replaced",()=>{var e;this.setPaginationUrl(this.list),this.loaderWasFocused&&(null===(e=this.focusMarkers.pop())||void 0===e||e.focus()),this.loaderWasFocused=!1},{once:!0})}async submit(e){var t;if(e.preventDefault(),this.disabled)return;let n;this.disabled=!0;try{const e=await fetch(this.form.action);if(!e.ok)return;n=await e.text()}catch(s){return}const o=oe(document,n);this.setPaginationUrl(o),this.list.append(o),null===(t=this.focusMarkers.pop())||void 0===t||t.focus(),this.disabled=!1,this.dispatchEvent(new CustomEvent("remote-pagination-load"))}setPaginationUrl(e){const t=e.querySelector("[data-pagination-src]");if(!t)return;const n=t.getAttribute("data-pagination-src");n?(this.form.action=n,this.form.hidden=!1):this.form.hidden=!0}};n([o],Ns.prototype,"form",void 0),n([o],Ns.prototype,"list",void 0),n([r],Ns.prototype,"focusMarkers",void 0),n([o],Ns.prototype,"submitButton",void 0),Ns=n([s],Ns),p(".has-removed-contents",(function(){let e;return{add(t){e=Array.from(t.childNodes);for(const o of e)t.removeChild(o);const n=t.closest("form");n&&f(n,"change")},remove(t){for(const o of e)t.appendChild(o);const n=t.closest("form");n&&f(n,"change")}}})),d("form[data-replace-remote-form]",(async function(e,t){e.classList.remove("is-error"),e.classList.add("is-loading");try{let n=e;const o=await t.html(),s=e.closest("[data-replace-remote-form-target]");if(s){const e=s.getAttribute("data-replace-remote-form-target");n=e?document.getElementById(e):s}n.replaceWith(o.html)}catch(n){e.classList.remove("is-loading"),e.classList.add("is-error")}}));const Fs=new WeakMap;function Bs(e,t){e.style.visibility=t?"hidden":"";const n=i(e,"data-tab-item");a(document,`[data-menu-item=${n}]`).hidden=!t}function Os(e,t){const n=a(e,".js-responsive-underlinenav-overflow");let o=!1;for(const s of t){const t=vt(s,e);if(t){const r=e.offsetWidth-(t.left+s.offsetWidth)<=n.offsetWidth;Bs(s,r),o=o||r}}n.style.visibility=o?"":"hidden"}function Us(e){const t=e||window.location,n=document.head&&document.head.querySelector("meta[name=session-resume-id]");return n instanceof HTMLMetaElement&&n.content||t.pathname}u("click",".js-markdown-link-button",(async function({currentTarget:e}){const t=a(document,".js-markdown-link-dialog",HTMLTemplateElement).content.cloneNode(!0);if(!(t instanceof DocumentFragment))return;const n=await xe({content:t});var o;e instanceof HTMLElement&&Fs.set(n,(o=e,m(o,"markdown-toolbar",P).field).selectionEnd)})),u("click",".js-markdown-link-insert",({currentTarget:e})=>{const t=m(e,"details-dialog"),n=a(document,`#${i(e,"data-for-textarea")}`,HTMLTextAreaElement),o=Fs.get(t)||0,s=a(t,"#js-dialog-link-href",HTMLInputElement).value,r=`[${a(t,"#js-dialog-link-text",HTMLInputElement).value}](${s}) `,c=n.value.slice(0,o),l=n.value.slice(o);n.value=c+r+l,n.focus(),n.selectionStart=n.selectionEnd=o+r.length}),p(".js-responsive-underlinenav",{constructor:HTMLElement,subscribe:e=>{const t=e.querySelectorAll(".js-responsive-underlinenav-item");return async function(e,t){await ge,Os(e,t)}(e,t),ae(window,"resize",()=>Os(e,t))}}),u("details-menu-select",".js-saved-reply-menu",(function(e){if(!(e.target instanceof Element))return;const t=e.detail.relatedTarget.querySelector(".js-saved-reply-body");if(!t)return;const n=(t.textContent||"").trim(),o=m(e.target,".js-previewable-comment-form"),s=a(o,"textarea.js-comment-field",HTMLTextAreaElement);Se(s,n),setTimeout(()=>s.focus(),0)}),{capture:!0}),Me("keydown",".js-saved-reply-shortcut-comment-field",(function(e){if("Control+."===H(e)){const t=m(e.target,".js-previewable-comment-form");a(t,".js-saved-reply-container").setAttribute("open",""),e.preventDefault(),ot({category:"Markdown Toolbar",action:"shortcut",label:"saved reply"})}})),Me("keydown",".js-saved-reply-filter-input",(function(e){if(/^Control\+[1-9]$/.test(H(e))){const t=m(e.target,".js-saved-reply-container").querySelectorAll('[role="menuitem"]'),n=Number(e.key),o=t[n-1];o instanceof HTMLElement&&(o.click(),e.preventDefault(),ot({category:"Saved Replies",action:"shortcut",label:`saved reply number ${n}`}))}})),p(".js-highlight-code-snippet-columns",(function(e){const t=function(e){const t=parseInt(i(e,"data-start-line")),n=parseInt(i(e,"data-end-line")),o=parseInt(i(e,"data-start-column")),s=parseInt(i(e,"data-end-column"));return t!==n?null:t===n&&o===s?null:{start:{line:t,column:o},end:{line:n,column:0!==s?s:null}}}(e);null!==t&&function(e,t){const n=pe(e,e=>function(e,t){return e.querySelector(`#LC${t}`)}(t,e));if(n){const e=document.createElement("span");e.classList.add("bg-yellow-3"),he(n,e)}}(t,e)})),u("click",".js-segmented-nav-button",(function(e){e.preventDefault();const t=e.currentTarget,n=i(t,"data-selected-tab"),o=m(t,".js-segmented-nav"),s=o.parentElement;for(const r of v(o,".js-segmented-nav-button"))r.classList.remove("selected");t.classList.add("selected");for(const r of v(s,".js-selected-nav-tab"))r.parentElement===s&&r.classList.remove("active");a(document,`.${n}`).classList.add("active")})),window.addEventListener("submit",R,{capture:!0}),window.addEventListener("pageshow",(function(){N(Us())})),window.addEventListener("pjax:end",(function(){N(Us())})),window.addEventListener("pagehide",(function(){F(Us(),{selector:".js-session-resumable"})})),window.addEventListener("pjax:beforeReplace",(function(e){const t=e.detail.previousState,n=t?t.url:null;if(n)F(Us(new URL(n,window.location.origin)),{selector:".js-session-resumable"});else{const e=new Error("pjax:beforeReplace event.detail.previousState.url is undefined");setTimeout((function(){throw e}))}})),document.addEventListener("pjax:end",(function(){const e=document.querySelector('meta[name="selected-link"]'),t=e&&e.getAttribute("value");if(t)for(const n of document.querySelectorAll(".js-sidenav-container-pjax .js-selected-navigation-item")){const e=(n.getAttribute("data-selected-links")||"").split(" ").indexOf(t)>=0;n.classList.toggle("selected",e)}}));const zs=["notification_referrer_id","notifications_before","notifications_after","notifications_query"];function Ws(e,t=null){return e.has("notification_referrer_id")?(function(e,t){const n=Vs(t);if(!n)return;const o={pathname:n};for(const s of zs){const t=e.get(s);t&&(o[s]=t)}st("notification_shelf",JSON.stringify(o))}(e,t),function(e){for(const t of zs)e.delete(t);return e}(e)):null}function Vs(e){const t=(e=e||window.location.pathname).match(/^(\/[^/]+\/[^/]+\/pull\/[^/]+)/);return t?t[0]:null}async function Ks(e){try{await e.text()}catch(t){}}function Js(e,t){if(function(e){return!!e.closest(".js-jump-to-field")}(e))return;const n=a(document,".js-site-search-form",HTMLFormElement);let o,s;a(document,".js-site-search").classList.toggle("scoped-search",t),t?(o=i(n,"data-scoped-search-url"),s=i(e,"data-scoped-placeholder")):(o=i(n,"data-unscoped-search-url"),s=i(e,"data-unscoped-placeholder")),n.setAttribute("action",o),e.setAttribute("placeholder",s)}!async function(){d(".js-notification-shelf .js-notification-action form",(async function(e,t){if(e.hasAttribute("data-redirect-to-inbox-on-submit")){await Ks(t);const e=a(document,".js-notifications-back-to-inbox",HTMLAnchorElement);e&&e.click()}else wt(e,e),await Ks(t)}))}(),function(){const e=function(){const e=Ws(new URLSearchParams(window.location.search));if(e){const t=new URL(window.location.href,window.location.origin);return t.search=e.toString(),t.toString()}}();e&&se(null,"",e)}(),p(".js-notification-shelf-include-fragment",(function(e){if(!(e instanceof c))return;const t=function(e=null){const t=Vs(e);if(!t)return Qe("notification_shelf"),null;try{const e=Ye("notification_shelf");if(!e)return null;const n=JSON.parse(e);if(!n||!n.pathname)throw new Error("Must have a pathname");if(n.pathname!==t)throw new Error("Stored pathname does not match current pathname.");const o={};for(const t of zs)o[t]=n[t];return o}catch(n){return Qe("notification_shelf"),null}}();if(!t)return;const n=e.getAttribute("data-base-src");if(!n)return;const o=new URL(n,window.location.origin),s=new URLSearchParams(o.search);for(const[r,i]of Object.entries(t))"string"==typeof i&&s.set(r,i);o.search=s.toString(),e.setAttribute("src",o.toString())})),Me("keyup",".js-site-search-field",(function(e){const t=e.target,n=0===t.value.length;n&&"Backspace"===e.key&&t.classList.contains("is-clearable")&&Js(t,!1),n&&"Escape"===e.key&&Js(t,!0),t.classList.toggle("is-clearable",n)})),re(".js-site-search-focus",(function(e){const t=m(e,".js-chromeless-input-container");t.classList.add("focus"),e.addEventListener("blur",(function n(){t.classList.remove("focus"),0===e.value.length&&e.classList.contains("js-site-search-field")&&Js(e,!0),e.removeEventListener("blur",n)}))})),u("submit",".js-site-search-form",(function(e){if(!(e.target instanceof Element))return;a(e.target,".js-site-search-type-field",HTMLInputElement).value=new URLSearchParams(window.location.search).get("type")||""})),p("textarea.js-size-to-fit",{constructor:HTMLTextAreaElement,subscribe:B}),u("click",".js-smoothscroll-anchor",(function(e){const t=e.currentTarget;if(!(t instanceof HTMLAnchorElement))return;const n=yt(document,t.hash);n&&(n.scrollIntoView({behavior:"smooth"}),e.preventDefault())})),d(".js-social-form",(async function(e,t){const n=await t.json(),o=m(e,".js-social-container");for(const s of o.querySelectorAll(".js-social-count"))s.textContent=n.json.count}));class SubscriptionSet{constructor(){this.subscriptions=new O,this.signatures=new Map}add(...e){const t=[];for(const{subscriber:n,topic:o}of e)this.subscriptions.has(o.name)||(t.push(o),this.signatures.set(o.name,o)),this.subscriptions.set(o.name,n);return t}delete(...e){const t=[];for(const{subscriber:n,topic:o}of e){this.subscriptions.delete(o.name,n)&&!this.subscriptions.has(o.name)&&(t.push(o),this.signatures.delete(o.name))}return t}drain(...e){const t=[];for(const n of e)for(const e of this.subscriptions.drain(n)){const n=this.signatures.get(e);this.signatures.delete(e),t.push(n)}return t}topics(){return this.signatures.values()}topic(e){return this.signatures.get(e)||null}subscribers(e){return this.subscriptions.get(e).values()}}class Topic{constructor(e,t){this.name=e,this.signed=t,this.offset=""}static parse(e){const[t,n]=e.split("--");if(!t||!n)return null;const o=JSON.parse(atob(t));return o.c&&o.t?new Topic(o.c,e):null}}class AliveSession{constructor(e,t,n,o){this.subscriptions=new SubscriptionSet,this.state="online",this.retrying=null,this.refreshUrl=t,this.notify=o,this.shared=n,this.socket=this.connect(e)}subscribe(e){const t=this.subscriptions.add(...e);this.sendSubscribe(t)}unsubscribe(e){const t=this.subscriptions.delete(...e);this.sendUnsubscribe(t)}unsubscribeAll(...e){const t=this.subscriptions.drain(...e);this.sendUnsubscribe(t)}online(){var e;this.state="online",null===(e=this.retrying)||void 0===e||e.abort(),this.socket.open()}offline(){var e;this.state="offline",null===(e=this.retrying)||void 0===e||e.abort(),this.socket.close()}socketDidOpen(){this.sendSubscribe(this.subscriptions.topics())}socketDidClose(){}socketDidFinish(){"offline"!==this.state&&this.reconnect()}socketDidReceiveMessage(e,t){const n=JSON.parse(t);switch(n.e){case"ack":this.handleAck(n);break;case"msg":this.handleMessage(n)}}handleAck(e){for(const t of this.subscriptions.topics())t.offset=e.off}handleMessage(e){const t=e.ch,n=this.subscriptions.topic(t);n&&(n.offset=e.off,e.data.wait||(e.data.wait=0),this.notify(this.subscriptions.subscribers(t),t,e.data))}async reconnect(){if(!this.retrying)try{this.retrying=new AbortController;const e=()=>async function(e){const t=await async function(e){const t=await fetch(e,{headers:{Accept:"application/json"}});if(t.ok)return t.json();throw new Error("fetch error")}(e);return t.url&&t.token?async function(e,t){const n=await fetch(e,{method:"POST",mode:"same-origin",headers:{"Scoped-CSRF-Token":t}});if(n.ok)return n.text();throw new Error("fetch error")}(t.url,t.token):null}(this.refreshUrl),t=await jt(e,1/0,6e4,this.retrying.signal);t&&(this.socket=this.connect(t))}catch(e){if("AbortError"!==e.name)throw e}finally{this.retrying=null}}connect(e){const t=new URL(e,self.location.origin);t.searchParams.set("shared",this.shared.toString());const n=new U(t.toString(),this,{timeout:4e3,attempts:7});return n.open(),n}sendSubscribe(e){const t=Array.from(e,e=>[e.signed,e.offset]);for(const n of Lt(t,25))this.socket.send(JSON.stringify({subscribe:Object.fromEntries(n)}))}sendUnsubscribe(e){const t=Array.from(e,e=>e.signed);for(const n of Lt(t,25))this.socket.send(JSON.stringify({unsubscribe:n}))}}function Xs(e){return(e.getAttribute("data-channel")||"").trim().split(/\s+/).map(Topic.parse).filter(Gs)}function Gs(e){return null!=e}function Ys(e,t,n){for(const o of e)o.dispatchEvent(new CustomEvent("socket:message",{bubbles:!1,cancelable:!1,detail:{name:t,data:n}}))}class AliveSessionProxy{constructor(e,t,n){this.subscriptions=new SubscriptionSet,this.notify=n,this.worker=new SharedWorker("/socket-worker.js","socket-worker-v7"),this.worker.port.onmessage=({data:e})=>this.receive(e),this.worker.port.postMessage({connect:{url:e,refreshUrl:t}})}subscribe(e){const t=this.subscriptions.add(...e);t.length&&this.worker.port.postMessage({subscribe:t})}unsubscribeAll(...e){const t=this.subscriptions.drain(...e);t.length&&this.worker.port.postMessage({unsubscribe:t})}online(){this.worker.port.postMessage({online:!0})}offline(){this.worker.port.postMessage({online:!1})}hangup(){this.worker.port.postMessage({hangup:!0})}receive(e){const{name:t,data:n}=e;this.notify(this.subscriptions.subscribers(t),t,n)}}function Qs(){const e=null!==(n=null===(t=document.head.querySelector("link[rel=shared-web-socket]"))||void 0===t?void 0:t.href)&&void 0!==n?n:null;var t,n;if(!e)return;const o=function(){var e,t;return null!==(t=null===(e=document.head.querySelector("link[rel=shared-web-socket]"))||void 0===e?void 0:e.getAttribute("data-refresh-url"))&&void 0!==t?t:null}();if(!o)return;const s="SharedWorker"in window?new AliveSessionProxy(e,o,Ys):new AliveSession(e,o,!1,Ys),r=Et(e=>s.subscribe(e.flat())),i=Et(e=>s.unsubscribeAll(...e));p(".js-socket-channel[data-channel]",{add:e=>r(function(e){return Xs(e).map(t=>({subscriber:e,topic:t}))}(e)),remove:e=>i(e)}),window.addEventListener("online",()=>s.online()),window.addEventListener("offline",()=>s.offline()),window.addEventListener("unload",()=>{"hangup"in s&&s.hangup()})}(async()=>{await ve,Qs()})();const Zs=new Map;function er(e,t){const n=[];for(const o of e){const e=Zs.get(o.name);e&&e.arrived>t&&n.push(e)}return n}function tr(e){const t=a(document,".js-stale-session-flash"),n=a(t,".js-stale-session-flash-signed-in"),o=a(t,".js-stale-session-flash-signed-out");t.hidden=!1,n.hidden="false"===e,o.hidden="true"===e,window.addEventListener("popstate",(function(e){e.state&&null!=e.state.container&&location.reload()})),document.addEventListener("submit",(function(e){e.preventDefault()}))}let nr;if(document.addEventListener("socket:message",(function(e){const{name:t,data:n,cached:o}=e.detail;if(o)return;const s={name:t,data:Object.assign({},n),arrived:Date.now()};s.data.wait=0,Zs.set(t,s)}),{capture:!0}),document.addEventListener("pjax:popstate",(function(e){const t=e.target,n=e.detail.cachedAt;n&&setTimeout(()=>function(e,t){for(const n of e.querySelectorAll(".js-socket-channel[data-channel]"))for(const e of er(Xs(n),t))n.dispatchEvent(new CustomEvent("socket:message",{bubbles:!1,cancelable:!1,detail:{name:e.name,data:e.data,cached:!0}}))}(t,n))})),p("form.js-auto-replay-enforced-sso-request",{constructor:HTMLFormElement,initialize(e){ce(e)}}),"function"==typeof BroadcastChannel)try{nr=new BroadcastChannel("stale-session"),nr.onmessage=e=>{"string"==typeof e.data&&tr(e.data)}}catch(li){}if(!nr){let e=!1;nr={postMessage(t){e=!0;try{window.localStorage.setItem("logged-in",t)}finally{e=!1}}},window.addEventListener("storage",(function(t){if(!e&&t.storageArea===window.localStorage&&"logged-in"===t.key)try{"true"!==t.newValue&&"false"!==t.newValue||tr(t.newValue)}finally{window.localStorage.removeItem(t.key)}}))}const or=document.querySelector(".js-stale-session-flash[data-signedin]");if(or){const e=or.getAttribute("data-signedin")||"";nr.postMessage(e)}async function sr(e){const t=e.currentTarget;if(!(t instanceof HTMLElement))return;const n=t.getAttribute("data-sudo-required");n&&(e.stopPropagation(),e.preventDefault(),await Tt(n)&&(t.removeAttribute("data-sudo-required"),t instanceof HTMLFormElement?ce(t):t.click()))}u("click","button[data-sudo-required], summary[data-sudo-required]",sr),p("form[data-sudo-required]",{constructor:HTMLFormElement,subscribe:e=>ae(e,"submit",sr)});const rr={"actor:":"ul.js-user-suggestions","user:":"ul.js-user-suggestions","operation:":"ul.js-operation-suggestions","org:":"ul.js-org-suggestions","action:":"ul.js-action-suggestions","repo:":"ul.js-repo-suggestions","country:":"ul.js-country-suggestions"};function ir(e){const t=e.detail;if(!lr(t.key))return;const n=i(t.item,"data-value");t.value=`${t.key}${n}`}function ar(e){const{key:t,provide:n,text:o}=e.detail;if(!lr(t))return;const s=e.target;n(async function(e,t,n){const o=(await ur(e)).querySelector(function(e){const t=rr[e];if(!t)throw new Error(`Unknown audit log expander key: ${e}`);return t}(t));if(!o)return{matched:!1};const s=function(e,t){const n=t.toLowerCase();return n?De(e,e=>{const t=e.textContent.toLowerCase().trim(),o=Oe(t,n);return o>0?{score:o,text:t}:null},Pe):e}(cr(o),n).slice(0,5),r=o.cloneNode(!1);r.innerHTML="";for(const i of s)r.append(i);return{fragment:r,matched:s.length>0}}(i(s,"data-audit-url"),t,o))}p("text-expander[data-audit-url]",{subscribe:e=>$e(ae(e,"text-expander-change",ar),ae(e,"text-expander-value",ir))});const cr=He(e=>[...e.children],{hash:e=>e.className});function lr(e){return Object.getOwnPropertyNames(rr).includes(e)}const ur=He((async function(e){const t=await Te(document,e),n=document.createElement("div");return n.append(t),n}));function dr(e){const t=e.detail;":"===t.key&&(t.value=function(e){if(e.hasAttribute("data-use-colon-emoji"))return e.getAttribute("data-value");const t=e.firstElementChild;return t&&"G-EMOJI"===t.tagName&&!t.firstElementChild?t.textContent:e.getAttribute("data-value")}(t.item))}function mr(e){const{key:t,provide:n,text:o}=e.detail;if(":"!==t)return;const s=e.target;n(async function(e,t){const[n,o]=await fr(e),s=function(e,t){const n=` ${t.toLowerCase().replace(/_/g," ")}`;return De(e,e=>{const t=e.getAttribute("data-emoji-name"),o=function(e,t){const n=e.indexOf(t);return n>-1?1e3-n:0}(function(e){return` ${e.getAttribute("data-text").trim().toLowerCase().replace(/_/g," ")}`}(e),n);return o>0?{score:o,text:t}:null},Pe)}(o,t).slice(0,5);n.innerHTML="";for(const r of s)n.append(r);return{fragment:n,matched:s.length>0}}(i(s,"data-emoji-url"),o))}p("text-expander[data-emoji-url]",{subscribe:e=>$e(ae(e,"text-expander-change",mr),ae(e,"text-expander-value",dr))});const fr=He((async function(e){const t=(await Te(document,e)).firstElementChild;return[t,[...t.children]]}));function pr(e){const t=e.detail;if("#"!==t.key)return;const n=i(t.item,"data-value");t.value=`#${n}`}function hr(e){const{key:t,provide:n,text:o}=e.detail;if("#"!==t)return;const s=e.target;n(async function(e,t){const n=await gr(e),o=document.createElement("div"),s=function(e,t){if(!t)return e;const n=new RegExp(`\\b${o=t,o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}`);var o;const s=/^\d+$/.test(t)?e=>function(e,t){const n=e.search(t);return n>-1?1e3-n:0}(e,n):e=>Oe(e,t);return De(e,e=>{const t=function(e){return`${e.number} ${e.title.trim().toLowerCase()}`}(e),n=s(t);return n>0?{score:n,text:t}:null},Pe)}(n.suggestions,t).slice(0,5);return function(e,t,n){const o=e=>{const t=e.type in n?oe(document,n[e.type]):"";return W`
<li role="option" id="suggester-issue-${e.id}" data-value="${e.number}">
<span class="d-inline-block mr-1">${t}</span> <small>#${e.number}</small> ${e.title}
</li>
`};z(W`
<ul role="listbox" class="suggester-container suggester suggestions list-style-none position-absolute">
${e.map(o)}
</ul>
`,t)}(s,o,n.icons),{fragment:o.firstElementChild,matched:s.length>0}}(i(s,"data-issue-url"),o))}p("text-expander[data-issue-url]",{subscribe:e=>$e(ae(e,"text-expander-change",hr),ae(e,"text-expander-value",pr))});const gr=He(Q);function br(e,t){if(!t)return e;const n=function(e){if(!e)return()=>2;const t=e.toLowerCase().split("");return n=>{if(!n)return 0;const o=function(e,t){let n,o,s,r;const i=function(e,t){let n=0;const o=[];for(;(n=e.indexOf(t,n))>-1;)o.push(n++);return o}(e,t[0]);if(0===i.length)return null;if(1===t.length)return[i[0],1,[]];for(r=null,o=0,s=i.length;o<s;o++){const s=i[o];if(!(n=vr(e,t,s+1)))continue;const a=n[n.length-1]-s;(!r||a<r[1])&&(r=[s,a,n])}return r}(n,t);return o?e.length/o[1]/(o[0]/2+1):0}}(t);return De(e,e=>{const t=function(e){return e.description?`${e.name} ${e.description}`.trim().toLowerCase():`${e.login} ${e.name}`.trim().toLowerCase()}(e),o=n(t);return o>0?{score:o,text:t}:null},Pe)}function vr(e,t,n){let o=n;const s=[];for(let r=1;r<t.length;r+=1){if(o=e.indexOf(t[r],o),-1===o)return;s.push(o++)}return s}function wr(e){const t=e.detail;if("@"!==t.key)return;const n=i(t.item,"data-value");t.value=`@${n}`}function yr(e){const{key:t,provide:n,text:o}=e.detail;if("@"!==t)return;const s=e.target;n(async function(e,t){const n=await jr(e),o=document.createElement("div"),s=br(n,t).slice(0,5);return function(e,t){const n=e=>{const t="user"===e.type?e.login:e.name,n="user"===e.type?e.name:e.description;return W`
<li role="option" id="suggester-${e.id}-${e.type}-${t}" data-value="${t}">
<span>${t}</span>
<small>${n}</small>
</li>
`};z(W`
<ul role="listbox" class="suggester-container suggester suggestions list-style-none position-absolute">
${e.map(n)}
</ul>
`,t)}(s,o),{fragment:o.firstElementChild,matched:s.length>0}}(i(s,"data-mention-url"),o))}p("text-expander[data-mention-url]",{subscribe:e=>$e(ae(e,"text-expander-change",yr),ae(e,"text-expander-value",wr))});const jr=He(Q);async function Lr(e){const{key:t,item:n}=e.detail;if("/"!==t)return;const o=n.getAttribute("data-value");if(!o)return;const s=e.currentTarget;kt(o,s)}function Er(e){const{key:t,provide:n,text:o}=e.detail;if("/"!==t)return;const s=e.target;n(async function(e,t){const[n,o]=await Tr(e),s=function(e,t){const n=t.toLowerCase().trim();return n?De(e,e=>{const t=(e.getAttribute("data-text")||"").trim().toLowerCase(),o=Oe(t,n);return o>0?{score:o,text:t}:null},Pe):e}(o,t).slice(0,5);n.innerHTML="";for(const r of s)n.append(r);return{fragment:n,matched:s.length>0}}(i(s,"data-slash-command-url"),o))}p("text-expander[data-slash-command-url]",{subscribe:e=>$e(ae(e,"text-expander-change",Er),ae(e,"text-expander-value",Lr))});const Tr=He((async function(e){const t=(await Te(document,e)).firstElementChild;return[t,[...t.children]]}));u("change","input.js-survey-radio",(function({currentTarget:e}){!function(e,t){const n=m(e,".js-survey-question-form"),o=a(n,"input.js-survey-other-text",HTMLInputElement),s=t&&!n.classList.contains("is-other-selected");n.classList.toggle("is-other-selected",s),o.hidden=!t,s?(o.required=!0,o.focus()):o.required=!1,f(o,"change")}(e,e.classList.contains("js-survey-radio-other"))})),u("change","input.js-survey-contact-checkbox",(function(e){const t=e.currentTarget,n=m(t,".js-survey-question-form"),o=a(n,".js-survey-contact-checkbox-hidden");t.checked?o.setAttribute("disabled","true"):o.removeAttribute("disabled")})),u("details-menu-selected",".js-sync-select-menu-text",(function(e){const t=a(document,".js-sync-select-menu-button"),n=a(e.detail.relatedTarget,"span[data-menu-button-text]").textContent;t.textContent=n,t.focus()}),{capture:!0}),u("click",'tab-container [role="tab"]',(function(e){const{currentTarget:t}=e,n=m(t,"tab-container").querySelector(".js-filterable-field, [data-filter-placeholder-input]");if(n instanceof HTMLInputElement){const e=t.getAttribute("data-filter-placeholder");e&&n.setAttribute("placeholder",e),n.focus()}})),u("tab-container-changed","tab-container",(function(e){const t=e.detail.relatedTarget,n=t.getAttribute("data-fragment-url"),o=t.querySelector("include-fragment");n&&o&&!o.hasAttribute("src")&&(o.src=n)}));class TagInput{constructor(e){this.container=e.container,this.selections=e.selections,this.inputWrap=e.inputWrap,this.input=e.input,this.tagTemplate=e.tagTemplate,this.form=this.input.form,this.autoComplete=e.autoComplete}setup(){this.container.addEventListener("click",e=>{e.target.closest(".js-remove")?this.removeTag(e):this.onFocus()}),this.input.addEventListener("focus",this.onFocus.bind(this)),this.input.addEventListener("blur",this.onBlur.bind(this)),this.input.addEventListener("keydown",this.onKeyDown.bind(this)),this.form.addEventListener("submit",this.onSubmit.bind(this)),this.autoComplete.addEventListener("auto-complete-change",()=>{this.selectTag(this.autoComplete.value)})}onFocus(){this.inputWrap.classList.add("focus"),this.input!==document.activeElement&&this.input.focus()}onBlur(){this.inputWrap.classList.remove("focus"),this.autoComplete.open||this.onSubmit()}onSubmit(){this.input.value&&(this.selectTag(this.input.value),this.autoComplete.open=!1)}onKeyDown(e){switch(H(e)){case"Backspace":this.onBackspace();break;case"Enter":case"Tab":this.taggifyValueWhenSuggesterHidden(e);break;case",":case" ":this.taggifyValue(e)}}taggifyValueWhenSuggesterHidden(e){!this.autoComplete.open&&this.input.value&&(e.preventDefault(),this.selectTag(this.input.value))}taggifyValue(e){this.input.value&&(e.preventDefault(),this.selectTag(this.input.value),this.autoComplete.open=!1)}selectTag(e){const t=this.normalizeTag(e),n=this.selectedTags();t&&n.indexOf(t)<0&&(this.selections.appendChild(this.templateTag(t)),this.input.value="",f(this.form,"tags:changed"))}removeTag(e){const t=e.target;e.preventDefault(),m(t,".js-tag-input-tag").remove(),f(this.form,"tags:changed")}templateTag(e){const t=this.tagTemplate.cloneNode(!0);return a(t,"input",HTMLInputElement).value=e,a(t,".js-placeholder-tag-name").replaceWith(e),t.classList.remove("d-none","js-template"),t}normalizeTag(e){return e.toLowerCase().trim().replace(/[\s,']+/g,"-")}onBackspace(){if(!this.input.value){const e=this.selections.querySelector("li:last-child .js-remove");e instanceof HTMLElement&&e.click()}}selectedTags(){const e=v(this.selections,"input",HTMLInputElement);return Array.from(e).map(e=>e.value).filter(e=>e.length>0)}}async function kr(e){const t=e.currentTarget;if(function(e){return!!e.getAttribute("data-hovercard-url")&&!!e.closest("[data-team-hovercards-enabled]")}(t))return void t.classList.remove("tooltipped");const n=t.getAttribute("data-url");if(!n)return;const o=await fetch(n,{headers:{Accept:"application/json"}});if(!o.ok)return;const s=await o.json(),r=i(t,"data-id"),a=document.querySelectorAll(`.js-team-mention[data-id='${r}']`);for(const i of a)i.removeAttribute("data-url");try{0===s.total?s.members.push("This team has no members"):s.total>s.members.length&&s.members.push(`${s.total-s.members.length} more`),xr(a,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 ");{const t=e[e.length-1];return e.slice(0,-1).concat(`and ${t}`).join(", ")}}(s.members))}catch(c){const e=c.response?c.response.status:500;xr(a,i(t,404===e?"data-permission-text":"data-error-text"))}}function xr(e,t){for(const n of e)n instanceof HTMLElement&&(n.setAttribute("aria-label",t),n.classList.add("tooltipped","tooltipped-s","tooltipped-multiline"))}function Sr(e){if(function(e){let t;try{t=new URL(e.url)}catch(n){return!0}return t.host!==window.location.host}(e)||function(e){return/[?&]_pjax=/.test(e.url)}(e))return;const t=function(){const 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 Ar(e){!function(e){const t=e.closest("details, .js-details-container");if(!t)return;"DETAILS"===t.nodeName?t.setAttribute("open","open"):St(t)||At(t)}(e);const t=e.querySelector(`[href='#${e.id}']`);t&&t.click()}function Mr(){return window.location.hash.slice(1)}function Hr(e){const{name:t,value:n}=e,o={name:window.location.href};switch(t){case"CLS":o.cls=n;break;case"FCP":o.fcp=n;break;case"FID":o.fid=n;break;case"LCP":o.lcp=n;break;case"TTFB":o.ttfb=n}be({webVitalTimings:[o]})}p(".js-tag-input-container",{constructor:HTMLElement,initialize(e){new TagInput({container:e,inputWrap:a(e,".js-tag-input-wrapper"),input:a(e,'input[type="text"], input:not([type])',HTMLInputElement),selections:a(e,".js-tag-input-selected-tags"),tagTemplate:a(e,".js-template"),autoComplete:a(e,"auto-complete",h)}).setup()}}),document.addEventListener("keydown",e=>{if("Escape"!==e.key)return;if(e.target!==document.body)return;const t=document.querySelector(".js-targetable-element:target");t&&xt(t,()=>{window.location.hash="",window.history.replaceState(null,"",window.location.pathname+window.location.search)})}),document.addEventListener("click",e=>{const t=document.querySelector(".js-targetable-element:target");t&&(e.target instanceof HTMLAnchorElement||e.target instanceof HTMLElement&&(t.contains(e.target)||xt(t,()=>{window.location.hash="",window.history.replaceState(null,"",window.location.pathname+window.location.search)})))}),p(".js-team-mention",(function(e){e.addEventListener("mouseenter",kr)})),d(".js-needs-timeline-marker-header",(function(e,t,n){Sr(n)})),u("deprecatedAjaxSend","[data-remote]",(function(e){const{request:t}=e.detail;Sr(t)})),ue((function({target:e}){const t=Mr();t&&!e&&async function(e){const t=document.getElementById("js-timeline-progressive-loader");if(!t)return;const n=t.getAttribute("data-timeline-item-src");if(!n)return;const o=new URL(n,window.location.origin),s=new URLSearchParams(o.search.slice(1));let r;s.append("anchor",e),o.search=s.toString();try{r=await Te(document,o.toString())}catch(u){return}const i=r.querySelector(".js-timeline-item");if(!i)return;const a=i.getAttribute("data-gid");if(!a)return;const c=document.querySelector(`.js-timeline-item[data-gid='${a}']`),l=document.querySelector(".js-timeline-scoping-menu .js-full-timeline-select");if(c){c.replaceWith(i);const t=document.getElementById(e);t&&Ar(t)}else if(l)l.click();else{const t=document.getElementById("js-progressive-timeline-item-container");t&&t.replaceWith(r);const n=document.getElementById(e);n&&Ar(n)}}(t)})),p(".js-timeline-progressive-focus-container",(function(e){const t=Mr();if(!t)return;const n=document.getElementById(t);n&&e.contains(n)&&Ar(n)})),p(".js-discussion",(function(){let e=new WeakSet;function t(){e=new WeakSet(document.querySelectorAll(".js-timeline-item"))}t(),document.addEventListener("pjax:end",t),p(".js-timeline-item",t=>{t instanceof HTMLElement&&(e.has(t)||te(t))})})),async function(){if(!(window.performance&&window.performance.timing&&window.performance.getEntriesByType))return;await ge,await new Promise(e=>setTimeout(e));const e=window.performance.getEntriesByType("resource");e.length&&be({resourceTimings:e});const t=window.performance.getEntriesByType("navigation");t.length&&be({navigationTimings:t})}(),V(Hr),K(Hr),J(Hr),X(Hr),G(Hr),u("click",".js-toggler-container .js-toggler-target",(function(e){if(0!==e.button)return;const t=e.currentTarget.closest(".js-toggler-container");t&&t.classList.toggle("on")})),d(".js-toggler-container",async(e,t)=>{e.classList.remove("success","error"),e.classList.add("loading");try{await t.text(),e.classList.add("success")}catch(n){e.classList.add("error")}finally{e.classList.remove("loading")}}),window.requestIdleCallback(()=>{const e=Mt();e&&_e("tz",encodeURIComponent(e))});let qr=0;const Cr="IntersectionObserver"in window?new IntersectionObserver((function(e){for(const t of e)t.isIntersecting&&_r(t.target)}),{root:null,rootMargin:"0px",threshold:1}):null;function _r(e){e.classList.remove("js-unread-item","unread-item")}p(".js-unread-item",{constructor:HTMLElement,add(e){qr++,Cr&&Cr.observe(e)},remove(e){qr--,Cr&&Cr.unobserve(e),0===qr&&function(){if(!document.hasFocus())return;const e=document.querySelector(".js-timeline-marker-form");e&&e instanceof HTMLFormElement&&ce(e)}()}}),p(".js-discussion[data-channel-target]",{subscribe:e=>ae(e,"socket:message",(function(e){const t=e.target,n=e.detail.data;if(t.getAttribute("data-channel-target")===n.gid)for(const o of document.querySelectorAll(".js-unread-item"))_r(o)}))});let $r=0;const Ir=/^\(\d+\)\s+/;function Dr(){const e=$r?`(${$r}) `:"";document.title.match(Ir)?document.title=document.title.replace(Ir,e):document.title=`${e}${document.title}`}p(".js-unread-item",{add(){$r++,Dr()},remove(){$r--,Dr()}}),p(".js-socket-channel.js-updatable-content",{subscribe:e=>ae(e,"socket:message",(function(e){const{gid:t,wait:n}=e.detail.data,o=e.target,s=t?function(e,t){if(e.getAttribute("data-gid")===t)return e;for(const n of e.querySelectorAll("[data-url][data-gid]"))if(n.getAttribute("data-gid")===t)return n;return null}(o,t):o;s&&setTimeout(ke,n||0,s)}))}),window.addEventListener("beforeunload",(function(){if(Object.keys(Ht).length>0){const e=history.state||{};e.staleRecords=Ht,se(e,"",location.href)}}));try{!async function(){if(history.state&&history.state.staleRecords){await ve;for(const e in history.state.staleRecords)for(const t of document.querySelectorAll(`.js-updatable-content [data-url='${e}'], .js-updatable-content[data-url='${e}']`)){const n=history.state.staleRecords[e];t instanceof HTMLElement&&Le(t,n,!0)}se(null,"",location.href)}}()}catch(li){}function Pr(){if(document.querySelector(":target"))return;const e=qt(location.hash).toLowerCase(),t=Ct(document,`user-content-${e}`);t&&t.scrollIntoView()}async function Rr(e){const n=e.currentTarget,{init:o}=await t.import("./user-status-submit.js");o(n)}function Nr(e){const t=e.currentTarget;Ee(t)?function(e){const t=e.getAttribute("data-warn-unsaved-changes")||"Changes you made may not be saved.";window.onbeforeunload=function(e){return e.returnValue=t,t}}(t):Fr()}function Fr(){window.onbeforeunload=null}function Br({currentTarget:e}){e.hasAttribute("open")||Fr()}function Or(e){const t=e.currentTarget;if(!t.closest("details[open]"))return;let n=!0;const o=v(t,"form[data-warn-unsaved-changes]",HTMLFormElement);for(const s of o)if(Ee(s)){const e=i(s,"data-warn-unsaved-changes");n=confirm(e);break}n||e.preventDefault()}function Ur(e){e.target.classList.remove("will-transition-once")}async function zr(e){const t=e.currentTarget,n=t.getAttribute("data-url");if(!n||function(e){switch(e.getAttribute("data-hovercard-type")){case"issue":case"pull_request":return!!e.closest("[data-issue-and-pr-hovercards-enabled]");case"discussion":return!!e.closest("[data-discussion-hovercards-enabled]");default:return!1}}(t))return;const o=t.getAttribute("data-id")||"",s=t.textContent,r=document.querySelectorAll(`.js-issue-link[data-id='${o}']`);for(const a of r)a.removeAttribute("data-url");try{Wr(r,`${s}, ${(await Q(n)).title}`)}catch(i){const e=(null!=i.response?i.response.status:void 0)||500;Wr(r,(()=>{switch(e){case 404:return t.getAttribute("data-permission-text");default:return t.getAttribute("data-error-text")}})()||"")}}function Wr(e,t){for(const n of e)n instanceof HTMLElement&&(n.classList.add("tooltipped","tooltipped-ne"),n.setAttribute("aria-label",t))}async function Vr(){return(await t.import("./randomColor.js")).default()}function Kr(e,t){const n=function(e){const t="string"==typeof e?parseInt(e.replace("#",""),16):e;return+((299*(t>>16&255)+587*(t>>8&255)+114*(255&t))/1e3/255).toFixed(2)}(t);null!=n&&(n<=.55?(e.classList.remove("text-gray-dark"),e.classList.add("text-white")):(e.classList.remove("text-white"),e.classList.add("text-gray-dark")))}function Jr(e,t){let n=t;"#"!==n.charAt(0)&&(n=`#${n}`),e.style.backgroundColor=n;const o=e.querySelector(".js-new-label-color-icon");o&&Kr(o,t)}function Xr(e,t){e.blur();const n=m(e,"form"),o=a(n,".js-new-label-color-input",HTMLInputElement);je(o,t),Jr(a(n,".js-new-label-color",HTMLButtonElement),t)}function Gr(e,t,n){const o=t.querySelector(e);o&&(n?function(e,t){m(e,".js-label-error-container").classList.add("errored"),e.textContent=t,e.hidden=!1}(o,n[0]):function(e){m(e,".js-label-error-container").classList.remove("errored"),e.hidden=!0}(o))}function Yr(e,t){Gr(".js-label-name-error",e,t.name),Gr(".js-label-description-error",e,t.description),Gr(".js-label-color-error",e,t.color)}function Qr(e){Gr(".js-label-name-error",e,null),Gr(".js-label-description-error",e,null),Gr(".js-label-color-error",e,null)}async function Zr(e){const t=e.closest(".js-label-preview-container");if(!t)return;const n=m(e,".js-label-form",HTMLFormElement),o=n.querySelector(".js-new-label-error"),s=n.getAttribute("data-label-id"),r=a(t,".js-label-preview",HTMLElement),c=function(e,t){let n=a(e,".js-new-label-name-input",HTMLInputElement).value.trim();return n.length<1&&(n=i(t,"data-default-name")),n}(n,r),l=function(e){const t=a(e,".js-new-label-color-input",HTMLInputElement);return t.checkValidity()?t.value.trim().replace(/^#/,""):"ededed"}(n),u=function(e){let t=null;const n=e.querySelector(".js-new-label-description-input");return n instanceof HTMLInputElement&&n.value.trim().length>0&&(t=n.value.trim()),t}(n),d=function(e,t,n,o,s){const r=new URL(`${e}${encodeURIComponent(t)}`,window.location.origin),i=new URLSearchParams(r.search.slice(1));return i.append("color",n),o&&i.append("description",o),s&&i.append("id",s),r.search=i.toString(),r.toString()}(i(r,"data-url-template"),c,l,u,s);if(t.hasAttribute("data-last-preview-url")){if(d===i(t,"data-last-preview-url"))return}let f;try{f=await Te(document,d)}catch(p){const e=await p.response.json();return Yr(n,e),void(o&&(o.textContent=e.message,o.hidden=!1))}o&&(o.textContent="",o.hidden=!0),Qr(n),r.innerHTML="",r.appendChild(f),t.setAttribute("data-last-preview-url",d)}function ei(e,t){m(e,".js-details-container").classList.toggle("is-empty",t)}function ti(e){const t=a(document,".js-labels-count"),n=Number(t.textContent)+e;t.textContent=n.toString();const o=a(document,".js-labels-label");return o.textContent=o.getAttribute(1===n?"data-singular-string":"data-plural-string"),n}async function ni(e){const t=e.querySelector(".js-new-label-name-input");if(!t)return;const n=a(e,".js-new-label-color-input",HTMLInputElement);let o=await Vr();if(n.value.length>0)for(;n.value===o;)o=await Vr();n.value=o;const s=a(e,".js-new-label-color",HTMLButtonElement);Jr(s,o);const r=a(document,".js-new-label-name").textContent;je(t,r),_t(t),Zr(s)}u("upload:setup",".js-upload-avatar-image",(function(e){const{form:t}=e.detail,n=e.currentTarget.getAttribute("data-alambic-organization"),o=e.currentTarget.getAttribute("data-alambic-owner-type"),s=e.currentTarget.getAttribute("data-alambic-owner-id");n&&t.append("organization_id",n),o&&t.append("owner_type",o),s&&t.append("owner_id",s)})),u("upload:complete",".js-upload-avatar-image",(function(e){const{attachment:t}=e.detail,n=`/settings/avatars/${t.id}`;xe({content:Te(document,n)})})),window.addEventListener("hashchange",Pr),document.addEventListener("pjax:success",Pr),async function(){await ve,Pr()}(),u("click","a[href]",(function(e){const{currentTarget:t}=e;t instanceof HTMLAnchorElement&&t.href===location.href&&location.hash.length>1&&setTimeout((function(){e.defaultPrevented||Pr()}))})),p(".js-user-status-container",{subscribe:e=>ae(e,"click",Rr,{once:!0})}),p("[data-warn-unsaved-changes]",{add(e){e.addEventListener("input",Nr),e.addEventListener("change",Nr),e.addEventListener("submit",Fr);const t=e.closest("details-dialog");t&&(m(t,"details").addEventListener("toggle",Br),t.addEventListener("details-dialog-close",Or))},remove(e){e.removeEventListener("input",Nr),e.removeEventListener("change",Nr),e.removeEventListener("submit",Fr);const t=e.closest("details-dialog");t&&(m(t,"details").removeEventListener("toggle",Br),t.removeEventListener("details-dialog-close",Or),Fr())}}),p(".will-transition-once",{constructor:HTMLElement,subscribe:e=>ae(e,"transitionend",Ur)}),u("click",".js-video-play, .js-video-close",(function(e){e.preventDefault();const t=e.currentTarget,n=t.classList.contains("js-video-play"),o=m(t,".js-video-container"),s=a(o,".js-video-iframe",HTMLIFrameElement),r=document.querySelector(".js-video-bg");n?s.src=s.getAttribute("data-src")||"":s.removeAttribute("src"),o.classList.toggle("is-expanded",n),null!=r&&r.classList.toggle("is-expanded",n),function(e,t=0){const n=e.getBoundingClientRect(),o=n.top-t,s=n.bottom-window.innerHeight+t;o<0?window.scrollBy(0,o):s>0&&window.scrollBy(0,s)}(s,20)})),p(".js-issue-link",{subscribe:e=>ae(e,"mouseenter",zr)}),le(".js-label-filter-field",(function(e){const t=e.target,n=m(t,"details-menu").querySelector(".js-new-label-name");if(!n)return;const o=t.value.trim();n.textContent=o})),u("filterable:change",".js-filterable-issue-labels",(function(e){const t=m(e.currentTarget,"details-menu"),n=t.querySelector(".js-add-label-button");if(!n)return;const o=e.detail.inputField.value.trim().toLowerCase(),s=v(t,'input[name="issue[labels][]"]').some(e=>(e.getAttribute("data-label-name")||"").toLowerCase()===o);n.hidden=0===o.length||s})),re(".js-new-label-color-input",(function(e){const t=m(e,"form"),n=a(t,".js-new-label-swatches");n.hidden=!1,e.addEventListener("blur",(function(){n.hidden=!0}),{once:!0})})),le(".js-new-label-color-input",(function(e){const t=e.target;let n=t.value.trim();if(!(n.length<1))if(0!==n.indexOf("#")&&(n=`#${n}`,t.value=n),t.checkValidity()){t.classList.remove("text-red");const e=m(t,"form");Jr(a(e,".js-new-label-color",HTMLButtonElement),n)}else t.classList.add("text-red")})),Me("keyup",".js-new-label-color-input",(function(e){const t=e.target;let n=t.value.trim();if(0!==n.indexOf("#")&&(n=`#${n}`,t.value=n),t.checkValidity()){const e=m(t,"form");Jr(a(e,".js-new-label-color",HTMLButtonElement),n)}f(t,"change",!1),Qr(m(t,"form",HTMLFormElement))})),Me("keyup",".js-new-label-description-input",(function(e){Qr(e.target.form)})),Me("keyup",".js-new-label-color-input",(function(e){Qr(e.target.form)})),u("click",".js-new-label-color",(async function(e){const t=e.currentTarget;Xr(t,await Vr()),Zr(t)})),u("mousedown",".js-new-label-color-swatch",(function(e){const t=e.currentTarget;Xr(t,i(t,"data-color")),Zr(t),m(t,".js-new-label-swatches").hidden=!0})),u("toggle",".js-new-label-modal",(function(e){e.target.hasAttribute("open")&&ni(e.target)}),{capture:!0}),d(".js-new-label-modal-form",(async function(e,t){const n=a(e,".js-new-label-error");let o;try{o=await t.html()}catch(c){const e=c.response.json;n.textContent=e.message,n.hidden=!1}if(!o)return;n.hidden=!0,a(document,".js-new-label-modal").removeAttribute("open");const s=a(document,".js-filterable-issue-labels"),r=o.html.querySelector("input");s.prepend(o.html),r&&r.dispatchEvent(new Event("change",{bubbles:!0}));const i=a(document,".js-label-filter-field",HTMLInputElement);i.value=i.defaultValue,i.focus()})),u("click",".js-edit-label-cancel",(function(e){const t=m(e.target,"form",HTMLFormElement);Qr(t),t.reset();const n=a(t,".js-new-label-color-input",HTMLInputElement),o=n.value;a(t,".js-new-label-color",HTMLButtonElement).style.backgroundColor=o,$t(t),Zr(n);const s=e.currentTarget.closest(".js-labels-list-item");if(s){a(s,".js-update-label",HTMLElement).classList.add("d-none");const e=s.querySelector(".js-label-preview");if(e){e.classList.add("d-none"),a(s,".js-label-link",HTMLElement).classList.remove("d-none")}const t=v(s,".js-hide-on-label-edit",HTMLElement);for(const n of t)n.hidden=!n.hidden}})),d(".js-update-label",(async function(e,t){let n;try{n=await t.html()}catch(o){return void Yr(e,o.response.json)}Qr(e),m(e,".js-labels-list-item").replaceWith(n.html)})),d(".js-create-label",(async function(e,t){let n;try{n=await t.html()}catch(s){return void Yr(e,s.response.json)}e.reset(),Qr(e),a(document,".js-label-list").prepend(n.html),ti(1),ei(e,!1),Xr(a(e,".js-new-label-color",HTMLButtonElement),await Vr()),Zr(a(e,".js-new-label-name-input",HTMLInputElement)),$t(e);const o=e.closest(".js-details-container");o instanceof HTMLElement&&At(o)})),u("click",".js-details-target-new-label",(function(){const e=a(document,".js-create-label");a(e,".js-new-label-name-input",HTMLInputElement).focus()})),u("click",".js-edit-label",(function(e){const t=m(e.currentTarget,".js-labels-list-item"),n=a(t,".js-update-label",HTMLElement);n.classList.remove("d-none"),a(n,".js-new-label-name-input",HTMLInputElement).focus();const o=t.querySelector(".js-label-preview");if(o){o.classList.remove("d-none"),a(t,".js-label-link",HTMLElement).classList.add("d-none")}const s=v(t,".js-hide-on-label-edit",HTMLElement);for(const r of s)r.hidden=!r.hidden})),d(".js-delete-label",(async function(e,t){const n=m(e,".js-labels-list-item");a(n,".js-label-delete-spinner").hidden=!1,await t.text(),ei(e,0===ti(-1)),n.remove()}));const oi=g((function(e){Zr(e.target)}),500);function si(){const e=a(document,".js-reveal-custom-thread-settings",HTMLInputElement).checked,t=!document.querySelector(".js-custom-thread-notification-option:checked"),n=a(document,".js-custom-thread-settings"),o=a(document,"[data-custom-option-required-text]",HTMLInputElement),s=e&&t?i(o,"data-custom-option-required-text"):"";o.setCustomValidity(s),n.hidden=!e}function ri(e){e instanceof HTMLFormElement?ce(e):ai(e)}function ii(e){const t=e.currentTarget;ri(t.closest(".js-issue-sidebar-form")||t.querySelector(".js-issue-sidebar-form"))}async function ai(e,t="post",n){const o=function(e){const t=m(e,"form",HTMLFormElement),n=new FormData(t).entries(),o=new FormData;for(const[s,r]of n)e.contains(ci(t,s,r.toString()))&&o.append(s,r);return o}(e);n&&o.append(n.name,n.value);const s=i(e,"data-url");if(!s)return;const r=a(e,".js-data-url-csrf",HTMLInputElement),c=await(await Ne(s,{method:t,body:o,mode:"same-origin",headers:{"Scoped-CSRF-Token":r.value}})).text();!function(e,t){e.replaceWith(oe(document,t))}(m(e,".js-discussion-sidebar-item"),c)}function ci(e,t,n){for(const o of e.elements)if((o instanceof HTMLInputElement||o instanceof HTMLTextAreaElement||o instanceof HTMLButtonElement)&&o.name===t&&o.value===n)return o;return null}u("suggester:complete",".js-new-label-name-input",oi),le(".js-new-label-name-input",oi),le(".js-new-label-description-input",oi),le(".js-new-label-color-input",oi),Me("keypress",".js-new-label-name-input",(function(e){const t=e.target,n=parseInt(t.getAttribute("data-maxlength"));It(t.value)>=n&&e.preventDefault()})),u("click",".js-issues-label-select-menu-item",(function(e){e.altKey&&(e.preventDefault(),e.stopPropagation(),window.location.href=i(e.currentTarget,"data-excluded-url"))})),Me("keydown",".js-issues-label-select-menu-item",(function(e){if("Enter"!==e.key)return;if(!e.altKey)return;const t=e.currentTarget;e.preventDefault(),e.stopPropagation(),t instanceof HTMLAnchorElement&&(window.location.href=i(t,"data-excluded-url"))})),u("click",".js-open-label-creation-modal",(async function(e){e.stopImmediatePropagation(),ni(await xe({content:a(document,".js-label-creation-template",HTMLTemplateElement).content.cloneNode(!0),detailsClass:"js-new-label-modal"}))}),{capture:!0}),u("change",".js-thread-notification-setting",si),u("change",".js-custom-thread-notification-option",si),u("reset",".js-custom-thread-settings-form",si),u("details-menu-selected",".js-discussion-sidebar-menu",(function(e){const t=e.detail.relatedTarget,n=e.currentTarget,o=t.closest(".js-issue-sidebar-form"),s=n.hasAttribute("data-multiple");if(t.hasAttribute("data-clear-assignees")){const e=v(n,'input[name="issue[user_assignee_ids][]"]:checked',HTMLInputElement);for(const t of e)t.disabled=!1,t.checked=!1;ri(o)}else s?m(n,"details").addEventListener("toggle",ii,{once:!0}):ri(o)}),{capture:!0}),d(".js-issue-sidebar-form",(async function(e,t){const n=await t.html();m(e,".js-discussion-sidebar-item").replaceWith(n.html)})),u("click","div.js-issue-sidebar-form .js-suggested-reviewer",(function(e){const t=e.currentTarget;ai(m(t,".js-issue-sidebar-form"),"post",{name:t.name,value:t.value}),e.preventDefault()})),u("click","div.js-issue-sidebar-form .js-issue-assign-self",(function(e){const t=e.currentTarget;ai(m(t,".js-issue-sidebar-form"),"post",{name:t.name,value:t.value}),e.preventDefault()})),u("click",".js-issue-unassign-self",(function(e){ai(m(e.currentTarget,".js-issue-sidebar-form"),"delete"),e.preventDefault()})),d(".js-pages-preview-toggle-form",(async function(e,t){const n=await t.json();a(e,"button.btn").textContent=n.json.new_button_value})),u("change",".js-project-menu-checkbox",(function(e){const t=e.currentTarget,n=m(t,".js-project-menu-container");for(const o of v(n,".js-project-menu-checkbox",HTMLInputElement))if(o!==t&&o.name===t.name){o.checked=t.checked;const e=o.closest(".js-navigation-item");e&&e.classList.toggle("selected",t.checked);const n=o.closest("label[aria-checked]");n&&n.setAttribute("aria-checked",t.checked.toString())}})),u("click","div.js-project-column-menu-container .js-project-column-menu-item button",(async function(e){const t=e.currentTarget;!function(e){const t=m(e,".js-project-column-menu-dropdown"),n=a(t,".js-project-column-menu-summary"),o=i(e,"data-column-name");n.textContent=o}(t);const n=i(t,"data-url"),o=a(t.parentElement,".js-data-url-csrf",HTMLInputElement),s=i(t,"data-card-id"),r=new FormData;r.append("card_id",s),r.append("use_automation_prioritization","true"),e.preventDefault(),await Ne(n,{method:"PUT",mode:"same-origin",body:r,headers:{"Scoped-CSRF-Token":o.value}});const c=document.activeElement,l=m(t,".js-project-column-menu-dropdown");if(c&&l.contains(c))try{c.blur()}catch(u){}})),u("click",".js-prompt-dismiss",(function(e){m(e.currentTarget,".js-prompt").remove()})),u("click",".js-convert-to-draft",(function(e){const t=i(e.currentTarget,"data-url"),n=a(e.currentTarget.parentElement,".js-data-url-csrf",HTMLInputElement);Ne(t,{method:"POST",mode:"same-origin",headers:{"Scoped-CSRF-Token":n.value}})}))}}}));
//# sourceMappingURL=behaviors-bootstrap-779f70fd.js.map