text: System.register(["./vendor.js","./frameworks.js"],(function(){"use strict";var e,t,n,s,r,o,a,i,c,l,d,u,p,m,f,h,g,j,y,v,b,L,w,k,S,T,q,E,M,A,H;return{setters:[function(v){e=v._,t=v.w,n=v.x,s=v.a8,r=v.y,o=v.h,a=v.f,i=v.g,c=v.o,l=v.c,d=v.a,u=v.r,p=v.b,m=v.q,f=v.L,h=v.R,g=v.C,j=v.a9,y=v.aa},function(e){v=e.b,b=e.l,L=e.d,w=e.a,k=e.r,S=e.M,T=e._,q=e.k,E=e.aE,M=e.p,A=e.U,H=e.bb}],execute:function(){let I=class BranchFilterElement extends HTMLElement{constructor(){super(...arguments),this.abortSearch=null,this.originalSelectedItem=null}submit(e){e.preventDefault()}resetField(e){if("Escape"!==o(e))return;const t=this.field.value.trim();this.field.value="",t&&this.search()}reset(){this.field.focus(),this.field.value="",a(this.field,"input")}get activeFilter(){var e;return null!==(e=this.filters.find(e=>e.classList.contains("selected")))&&void 0!==e?e:null}async search(){var e;this.originalSelectedItem||(this.originalSelectedItem=this.activeFilter);const t=this.field.value.trim().length>0,n=function(e){const t=e.form;if(e.value.trim()){const n=new URL(t.action,window.location.origin),s=new URLSearchParams(n.search.slice(1)),r=t.elements.namedItem("utf8");return r instanceof HTMLInputElement&&s.append("utf8",r.value),s.append("query",e.value),n.search=s.toString(),n.toString()}return i(t,"data-reset-url")}(this.field);this.classList.toggle("is-search-mode",t),this.classList.add("is-loading");for(const o of this.filters)o.classList.remove("selected");t?this.allFilter.classList.add("selected"):this.originalSelectedItem&&(this.originalSelectedItem.classList.add("selected"),this.originalSelectedItem=null),null===(e=this.abortSearch)||void 0===e||e.abort();const{signal:s}=this.abortSearch=new AbortController;try{const e=await v(document,n,{signal:s});b(null,"",n),this.result.innerHTML="",this.result.appendChild(e)}catch(r){}s.aborted||this.classList.remove("is-loading")}};e([t],I.prototype,"field",void 0),e([t],I.prototype,"result",void 0),e([t],I.prototype,"allFilter",void 0),e([n],I.prototype,"filters",void 0),e([s(100)],I.prototype,"search",null),I=e([r],I);let _=class BranchFilterItemElement extends HTMLElement{get branch(){return this.getAttribute("branch")}get branches(){const e=this.closest("branch-filter").querySelectorAll("branch-filter-item");return Array.from(e).filter(e=>e.branch===this.branch)}loading(e){for(const t of this.branches)t.spinner.hidden=!e,t.destroyButton&&(t.destroyButton.hidden=e)}set mode(e){for(const t of this.branches)t.classList.toggle("Details--on","restore"===e)}async restore(e){e.preventDefault(),this.loading(!0);const t=e.target;let n;try{n=await fetch(t.action,{method:t.method,body:new FormData(t),headers:{"X-Requested-With":"XMLHttpRequest"}})}catch(s){}finally{n&&n.ok||location.reload(),this.loading(!1)}this.mode="destroy"}async destroy(e){e.preventDefault(),this.loading(!0);const t=e.target;let n;try{n=await fetch(t.action,{method:t.method,body:new FormData(t),headers:{"X-Requested-With":"XMLHttpRequest"}})}catch(s){}finally{n&&n.ok||location.reload(),this.loading(!1)}this.mode="restore"}};e([t],_.prototype,"destroyButton",void 0),e([t],_.prototype,"spinner",void 0),_=e([r],_),c(".js-new-badge-autodismiss",{constructor:HTMLFormElement,add:e=>{const t=l(e,"details");t.addEventListener("toggle",()=>{t.hasAttribute("open")&&L(e.action,{method:e.method,body:new FormData(e)})})}}),c(".repository-import",{subscribe:e=>w(e,"socket:message",(function(e){const t=e.detail.data;t.redirect_to&&(document.location.href=t.redirect_to,e.stopImmediatePropagation())}))}),d("change","input.js-repository-import-lfs-opt",(function({currentTarget:e}){const t=parseInt(e.getAttribute("data-percent-used")||""),n=l(e,".js-repository-import-lfs-container"),s=e.getAttribute("data-used")||"";p(n,".js-repository-import-lfs-warn").classList.toggle("d-none",!(t>100)),p(n,".js-usage-bar").classList.toggle("exceeded",t>=100),p(n,".js-usage-bar").setAttribute("aria-label",`${t}%`),p(n,".js-repository-import-lfs-progress").style.width=`${t}%`,p(n,"span.js-usage-text").textContent=s})),u(".js-repository-import-author-form",(async function(e,t){const n=await t.html();l(e,".js-repository-import-author").replaceWith(n.html)})),d("click",".js-repository-import-projects-cancel-button",(function(){const e=p(document,".js-repository-import-projects-cancel-form",HTMLFormElement);k(e)}));let x=!1;function C(){const e=p(document,".js-repo-name");a(e,"input");const t=p(document,'.js-owner-container [aria-checked="true"]'),n="false"!==t.getAttribute("data-org-allow-public-repos"),s=p(document,".js-privacy-toggle[value=public]",HTMLInputElement);F(n,s,document.querySelector(".js-privacy-toggle-label-public"),document.querySelector(".js-public-description"),document.querySelector(".js-public-restricted-by-policy-description"));const r=function(e,t){let n=!1;const s=document.querySelectorAll(".js-new-repo-internal-visibility");for(const r of s){r.hidden=!0;const e=r.querySelector(".js-privacy-toggle[value=internal]");e instanceof HTMLInputElement&&e.checked&&(n=!0)}if(e){const s=document.querySelector(`#new-repo-internal-visibility-${e}`);if(s){s.hidden=!1;const e=s.querySelector(".js-privacy-toggle-label-internal"),r=s.querySelector(".js-internal-description"),o=s.querySelector(".js-internal-restricted-by-policy-description"),i=s.querySelector(".js-privacy-toggle[value=internal]");if(i instanceof HTMLInputElement)return"false"===t.getAttribute("data-org-allow-internal-repos")?(i.disabled=!0,e&&e.classList.add("text-gray-light"),r&&(r.hidden=!0),o&&(o.hidden=!1)):(n&&(i.checked=!0,a(i,"change")),i.disabled=!1,e&&e.classList.remove("text-gray-light"),r&&(r.hidden=!1),o&&(o.hidden=!0)),i}}return null}(t.getAttribute("data-business-id"),t),o="false"!==t.getAttribute("data-org-allow-private-repos"),i=p(document,".js-privacy-toggle[value=private]",HTMLInputElement),c=document.querySelector(".js-privacy-toggle-label-private"),l=document.querySelector(".js-private-description"),d=document.querySelector(".js-private-restricted-by-policy-description");F(o,i,c,l,d),function(){const e=document.querySelectorAll('.js-org-upgrade-link:not([hidden=""]');for(const t of e)t.hidden=!0}();const u="false"!==t.getAttribute("data-org-private-restricted-by-plan"),m=document.querySelector(".js-upgrade-private-description"),f="false"!==t.getAttribute("data-org-show-upgrade"),h=t.getAttribute("data-org-name"),g=h?document.querySelector(`a[data-upgrade-link="${h}"]`):null,j=document.querySelector(".js-ask-owner-message");o||!u?(m&&(m.hidden=!0),g&&(g.hidden=!0),j&&(j.hidden=!0)):(d&&(d.hidden=u),m&&(m.hidden=!1),g&&(g.hidden=!f),j&&(j.hidden=f));const y=t.getAttribute("data-default-new-repo-branch"),v=document.querySelector(".js-new-repo-owner-default-branch");v&&(v.textContent=y);const b=t.getAttribute("data-owner-settings-link-prefix"),L=document.querySelector(".js-new-repo-owner-settings-link-prefix");L&&(L.textContent=b);const w=t.getAttribute("data-owner-settings-url"),k=document.querySelector(".js-repo-owner-default-branch-settings-link-container"),S=document.querySelector(".js-org-repo-owner-default-branch-settings-info");if(w){const e=document.querySelector(".js-new-repo-owner-settings-link");e&&(e.href=w,k&&(k.hidden=!1)),S&&(S.hidden=!0)}else if(k&&(k.hidden=!0,S)){const e=t.hasAttribute("data-viewer-is-org-admin");S.hidden=!e}const T="true"===t.getAttribute("data-org-show-trade-controls"),q="true"===t.getAttribute("data-viewer-is-org-admin"),E="true"===t.getAttribute("data-user-show-trade-controls"),M=T&&!o,A=document.querySelector(".js-trade-controls-description"),H=document.querySelector(".js-individual-trade-controls-description");if(E||M){const e=!E&&!q&&M;d&&(d.hidden=!e),i.disabled=!0,l&&(l.hidden=!0),m&&(m.hidden=!0),g&&(g.hidden=!0),j&&(j.hidden=!0)}else A&&(A.hidden=!0),H&&(H.hidden=!0);E?(A&&(A.hidden=!0),H&&(H.hidden=!1)):M&&A&&(A.hidden=!q),function(e,t,n,s){let r=null;"private"!==e.getAttribute("data-default")||s.disabled?"internal"===e.getAttribute("data-default")&&n&&!n.disabled?r=n:t.disabled?n&&!n.disabled&&(r=n):r=t:r=s;if(!r)return;const o=t.disabled&&t.checked||s.disabled&&s.checked||n&&n.disabled&&n.checked,i=!(t.checked||n&&n.checked||s.checked);!1!==x&&!0!==o&&!0!==i||(r.checked=!0,a(r,"change"))}(t,s,r,i),function(e){for(const s of document.querySelectorAll(".js-with-permission-fields"))s.hidden=!e;for(const s of document.querySelectorAll(".js-without-permission-fields"))s.hidden=e;const t=document.querySelector(".errored"),n=document.querySelector("dl.warn");t&&(t.hidden=!e);n&&(n.hidden=!e)}("yes"===t.getAttribute("data-permission")),function(){const e=document.querySelector("#js-upgrade-container");if(!e)return;const t=p(document,"#js-payment-methods-form");e.firstElementChild&&t.appendChild(e.firstElementChild);const n=p(document,"input[name=owner]:checked",HTMLInputElement).value,s=t.querySelector(`.js-upgrade[data-login="${n}"]`);s&&e.appendChild(s)}(),R();const I=document.querySelector(".js-quick-install-container");if(I){const e=p(I,".js-quick-install-divider");e.hidden=!0;const t=p(document,"input[name=owner]:checked",HTMLInputElement).parentElement;if(t){const n=t.querySelector(".js-quick-install-list-template");if(n instanceof HTMLTemplateElement){const t=p(I,".js-account-apps");t.innerHTML="",t.append(n.content.cloneNode(!0)),n.children.length>0&&(e.hidden=!1)}}}}function F(e,t,n,s,r){e?(t.disabled=!1,n&&n.classList.remove("text-gray-light"),s&&(s.hidden=!1),r&&(r.hidden=!0)):(t.disabled=!0,n&&n.classList.add("text-gray-light"),s&&(s.hidden=!0),r&&(r.hidden=!1))}function R(e){const t=document.querySelector("#js-upgrade-container");if(!t)return;const n=t.querySelector(".js-billing-section"),s=t.querySelector(".js-confirm-upgrade-checkbox");let r=e?e.target:null;r||(r=document.querySelector(".js-privacy-toggle:checked")),"false"===r.value?(t.hidden=!1,n&&n.classList.remove("has-removed-contents"),s&&(s.checked=!0)):(t.hidden=!0,n&&n.classList.add("has-removed-contents"),s&&(s.checked=!1)),D()}function D(){const e=p(document,".js-repo-form"),t=e.querySelector(".js-repository-owner-choice:checked"),n=e.querySelector(".js-repo-name"),s=e.querySelector(".js-repo-url"),r=e.querySelector(".js-repo-gitignore"),o=e.querySelector(".js-repo-license");let a=!s||!s.classList.contains("is-autocheck-errored");if(a=a&&!!t,a&&n&&(a=n.classList.contains("is-autocheck-successful"),"private"===p(document,".js-privacy-toggle:checked",HTMLInputElement).value&&(a=a&&function(){const e=document.querySelector("#js-upgrade-container");if(!e)return!0;if(e.querySelector(".js-ofac-sanction-notice"))return!1;const t=e.querySelector(".js-confirm-upgrade-checkbox");if(t instanceof HTMLInputElement&&!t.checked)return!1;const n=e.querySelector(".js-zuora-billing-info");if(n&&n.classList.contains("d-none"))return!1;return!0}())),r&&r.checked){const t=p(e,'input[name="repository[gitignore_template]"]:checked',HTMLInputElement);a=a&&""!==t.value}if(o&&o.checked){const t=p(e,'input[name="repository[license_template]"]:checked',HTMLInputElement);a=a&&""!==t.value}p(e,"button[type=submit]",HTMLButtonElement).disabled=!a}async function $(e){const t=e.form;p(t,"#release_draft",HTMLInputElement).value="1",P(e,"saving");try{const n=await(await L(t.action,{method:t.method,body:new FormData(t),headers:{Accept:"application/json"}})).json();return P(e,"saved"),setTimeout(P,5e3,e,"default"),a(t,"release:saved",{release:n}),n}catch(n){throw P(e,"failed"),n}}function z(e){const t=l(e,".js-releases-marketplace-publish-container"),n=p(t,".js-releases-marketplace-publish-preview");e.checked?n.classList.remove("d-none"):n.classList.add("d-none")}function P(e,t){for(const n of e.querySelectorAll(".js-save-draft-button-state"))n.hidden=n.getAttribute("data-state")!==t;e.disabled="saving"===t}function U(e){const t=document.querySelector(".js-release-target-wrapper");if(null!=t){switch(e){case"valid":t.classList.add("d-none");break;case"loading":break;default:t.classList.remove("d-none")}for(const t of document.querySelectorAll(".js-tag-status-message"))t.hidden=t.getAttribute("data-state")!==e}}c("#js-upgrade-container .js-zuora-billing-info:not(.d-none)",D),c(".page-new-repo",(function(){const e=document.querySelector("#js-upgrade-container");e&&(e.hidden=!0),C();const t=p(document,".js-repo-form"),n=t.querySelector(".js-repo-url");if(n)return void n.focus();const s=t.querySelector(".js-template-repository-select");if(s)return void s.focus();const r=t.querySelector(".js-owner-select");r&&r.focus()})),d("click",".js-reponame-suggestion",(function(e){const t=p(document,".js-repo-name",HTMLInputElement);t.value=e.currentTarget.textContent,a(t,"input",!1)})),d("click",".js-privacy-toggle",(function(){x=!0})),d("change",".js-privacy-toggle",R),d("details-menu-selected",".js-owner-container",C,{capture:!0}),d("change","#js-upgrade-container input",D),S("#js-upgrade-container input",D),S(".js-owner-reponame .js-repo-name",(function(e){const t=document.querySelector(".js-personal");if(t){const n=document.querySelector(".js-owner-container input.js-repository-owner-is-viewer"),s=e.target,r=!(n&&n.checked&&n.defaultValue.toLowerCase()===s.value.toLowerCase());t.hidden=r,p(document,"#repo-name-suggestion").hidden=!r}D()})),d("auto-check-send",".js-repo-name-auto-check",(function(e){const t=e.currentTarget.form,n=p(t,"input[name=owner]:checked",HTMLInputElement).value;e.detail.body.append("owner",n)})),d("auto-check-complete","#repository_name",(function(){D()})),S(".js-repo-url",(function(e){const t=e.target;if(!(t instanceof HTMLInputElement))return;const n=t.closest(".form-group");if(!(n instanceof HTMLDListElement))return;const s=p(document,".js-insecure-url-warning"),r=p(document,".js-svn-url-error"),o=p(document,".js-git-url-error"),a=t.value.toLowerCase();s.hidden=!a.startsWith("http://"),r.hidden=!a.startsWith("svn://"),o.hidden=!a.startsWith("git://"),a.startsWith("svn://")||a.startsWith("git://")?(t.classList.add("is-autocheck-errored"),n.classList.add("errored")):(t.classList.remove("is-autocheck-errored"),n.classList.remove("errored")),D()})),d("change",".js-toggle-repo-init-setting",e=>{const t=e.currentTarget;t.checked||function(e){const t=e.closest(".js-repo-init-setting-container");t&&(p(t,".js-repo-init-setting-unchecked-menu-option",HTMLInputElement).checked=!0)}(t),D()}),d("change",".js-repo-init-setting-unchecked-menu-option",e=>{const t=e.currentTarget;t.checked&&function(e){const t=e.closest(".js-repo-init-setting-container");if(!t)return;const n=p(t,".js-toggle-repo-init-setting",HTMLInputElement);n.checked=!1,a(n,"change")}(t),D()}),d("change",".js-toggle-new-repo-default-branch-info",e=>{!function(e){const t=l(e,"form"),n=t.querySelector(".js-new-repo-default-branch-info");if(!n)return;const s=m(t,".js-toggle-new-repo-default-branch-info:checked",HTMLInputElement).length>0;n.hidden=!s}(e.currentTarget)}),d("tab-container-changed",".js-branches-tags-tabs",(async function(e){const t=e.detail.relatedTarget,n=e.currentTarget;if(!n)return;let s,r;for(const a of n.querySelectorAll("[data-controls-ref-menu-id]")){if(!(a instanceof f||a instanceof h))return;const e=i(a,"data-controls-ref-menu-id"),n=t.id===e;a.hidden=!n,n?r=a:s||(s=a.input?a.input.value:"")}const o=r&&r.input;o&&(r&&void 0!==s&&(o.value=s),o.focus())})),c(".js-pulse-contribution-data",e=>{!async function(e){const t=e.getAttribute("data-pulse-diffstat-summary-url");let n;try{t&&(n=await async function(e){return v(document,e)}(t),function(e,t){t.innerHTML="",t.appendChild(e)}(n,e))}catch(s){const t=p(e,".js-blankslate-loading"),n=p(e,".js-blankslate-error");t.classList.add("d-none"),n.classList.remove("d-none")}}(e)}),d("change",".js-releases-marketplace-publish-field",(function(e){z(e.currentTarget)})),c(".js-releases-marketplace-publish-field",(function(e){z(e)})),d("click",".js-save-draft",(function(e){$(e.currentTarget),e.preventDefault()})),d("click",".js-timeline-tags-expander",(function(e){const t=e.currentTarget;l(t,".js-timeline-tags").classList.remove("is-collapsed")})),d("release:saved",".js-release-form",(function(e){const t=e.detail.release,n=e.currentTarget,s=n.getAttribute("data-repo-url"),r=t.update_url||N("tag",s,t.tag_name);if(n.setAttribute("action",r),t.update_authenticity_token){n.querySelector("input[name=authenticity_token]").value=t.update_authenticity_token}const o=t.edit_url||N("edit",s,t.tag_name);b(T(),document.title,o);const a=document.querySelector("#delete_release_confirm form");if(a){const e=t.delete_url||N("tag",s,t.tag_name);if(a.setAttribute("action",e),t.delete_authenticity_token){p(a,"input[name=authenticity_token]",HTMLInputElement).value=t.delete_authenticity_token}}const i=n.querySelector("#release_id");if(!i.value){i.value=t.id;const e=document.createElement("input");e.type="hidden",e.name="_method",e.value="put",n.appendChild(e)}})),d("click",".js-publish-release",(function(){p(document,"#release_draft",HTMLInputElement).value="0"}));const W=new WeakMap;async function B(e){if(!e.value)return;if(e.value===W.get(e))return;U("loading"),W.set(e,e.value);const t=i(e,"data-url"),n=new URL(t,window.location.origin),s=new URLSearchParams(n.search.slice(1));s.append("tag_name",e.value),n.search=s.toString();try{const t=await(await L(n.toString(),{headers:{Accept:"application/json"}})).json();"duplicate"===t.status&&parseInt(e.getAttribute("data-existing-id"))===parseInt(t.release_id)?U("valid"):(p(document,".js-release-tag .js-edit-release-link").setAttribute("href",t.url),U(t.status))}catch(r){U("invalid")}}function N(e,t,n){return`${t}/releases/${e}/${n}`}function X(e){const t=l(e,"form",HTMLFormElement).querySelector(".js-previewable-comment-form");if(!t)return;let n=t.getAttribute("data-base-preview-url");n||(n=String(t.getAttribute("data-preview-url")),t.setAttribute("data-base-preview-url",n));const s=m(e,'input[name="release[tag_name]"], input[name="release[target_commitish]"]:checked',HTMLInputElement),r=new URL(n,window.location.origin),o=new URLSearchParams(r.search.slice(1));for(const a of s)a.value&&o.append(a.name,a.value);r.search=o.toString(),t.setAttribute("data-preview-url",r.toString())}c("input.js-release-tag-field",{constructor:HTMLInputElement,initialize(e){B(e),e.addEventListener("blur",(function(){B(e)}))}}),d("change",".js-release-tag",(function(e){X(e.currentTarget)})),c(".js-release-form .js-previewable-comment-form",(function(e){X(p(l(e,"form"),".js-release-tag"))})),d("auto-check-message-updated",".js-rename-branch-input",(function(e){!function(e){const t=l(e,".js-rename-branch-form"),n=m(t,".js-rename-branch-new-name");let s=e.value;if(s!==e.defaultValue&&""!==s){const e=t.querySelector(".js-rename-branch-autocheck-message");e&&e.hasAttribute("data-normalized-name")&&(s=i(e,"data-normalized-name"));for(const t of n)t.textContent=s}}(e.currentTarget)})),q("keydown",".js-tree-finder-field",e=>{"Escape"===e.key&&(e.preventDefault(),history.back())});c(".js-tree-finder",e=>{const t=p(e,".js-tree-finder-field",HTMLInputElement),n=p(e,".js-tree-browser-results");if(n.childElementCount>0)return;(async e=>{if(!(e instanceof E))return;const t=i(e,"data-url"),n=p(e,".js-tree-browser-result-template",HTMLTemplateElement),{paths:s}=await(await L(t)).json();e.addLazyItems(s,e=>{const t=n.content.cloneNode(!0).firstElementChild,s=p(t,".js-tree-browser-result-anchor",HTMLAnchorElement),r=p(s,".js-tree-browser-result-path"),o=new URL(s.href,window.location.origin);return o.pathname=`${o.pathname}/${encodeURI(e)}`,s.href=String(o),s.id=`entry-${Math.random().toString().substr(2,5)}`,r.textContent=e,t}),e.sort()})(e);const s=new g(t,n);s.start(),e.addEventListener("fuzzy-list-will-sort",()=>{s.stop()}),e.addEventListener("fuzzy-list-sorted",()=>{s.start(),s.navigate()})});let V=null;c(".js-pjax-files",e=>{if(!V)return void(V=window.location.pathname);const t=e.querySelector(`a[href='${V}']`);t&&setTimeout((function(){document.activeElement&&document.activeElement!==document.body||t.focus()}),200),V=window.location.pathname});let G=null;const J=new WeakMap;function K(e){e.classList.remove("is-progress-bar");const t=l(e,".js-upload-manifest-file-container");p(t,".js-upload-progress").hidden=!0,p(t,".js-upload-meter-text .js-upload-meter-filename").textContent=""}function O(e){K(e.currentTarget)}function Q(e){const t=l(e,"form",HTMLFormElement);return p(t,"#release_id",HTMLInputElement).value}d("file-attachment-accept",".js-upload-manifest-file",(function(e){const{attachments:t}=e.detail,n=parseInt(e.currentTarget.getAttribute("data-directory-upload-max-files")||"",10);t.length>n&&(e.preventDefault(),e.currentTarget.classList.add("is-too-many"))})),d("document:drop",".js-upload-manifest-tree-view",(async function(e){const{transfer:t}=e.detail,n=e.currentTarget,s=await j.traverse(t,!0),r=p(document,"#js-repo-pjax-container");r.addEventListener("pjax:success",()=>{p(r,".js-upload-manifest-file",y).attach(s)},{once:!0});const o=i(n,"data-drop-url");M({url:o,container:r})})),d("upload:setup",".js-upload-manifest-file",(async function(e){const{batch:t,form:n,preprocess:s}=e.detail,r=e.currentTarget;function o(){n.append("upload_manifest_id",J.get(r))}if(function(e,t){const n=l(e,".js-upload-manifest-file-container"),s=p(n,".js-upload-progress");s.hidden=!1,e.classList.add("is-progress-bar");const r=p(s,".js-upload-meter-text");p(r,".js-upload-meter-range-start").textContent=String(t.uploaded()+1),p(r,".js-upload-meter-range-end").textContent=String(t.size)}(r,t),J.get(r))return void o();if(G)return void s.push(G.then(o));const a=l(r,".js-upload-manifest-file-container").querySelector(".js-upload-manifest-form");G=fetch(a.action,{method:a.method,body:new FormData(a),headers:{Accept:"application/json"}});const[i,c]=function(){let e;return[new Promise(t=>{e=t}),e]}();s.push(i.then(o));const d=await G;if(!d.ok)return;const u=await d.json();p(document,".js-manifest-commit-form",HTMLFormElement).elements.namedItem("manifest_id").value=u.upload_manifest.id,J.set(r,u.upload_manifest.id),G=null,c()})),d("upload:start",".js-upload-manifest-file",(function(e){const{attachment:t,batch:n}=e.detail,s=l(e.currentTarget,".js-upload-manifest-file-container"),r=p(s,".js-upload-progress"),o=p(r,".js-upload-meter-text");p(o,".js-upload-meter-range-start").textContent=n.uploaded()+1,p(o,".js-upload-meter-filename").textContent=t.fullPath})),d("upload:complete",".js-upload-manifest-file",(function(e){const{attachment:t,batch:n}=e.detail,s=p(document,".js-manifest-commit-file-template",HTMLElement),r=p(s,".js-manifest-file-entry").cloneNode(!0);p(r,".js-filename").textContent=t.fullPath;const o=t.id;p(r,".js-remove-manifest-file-form",HTMLFormElement).elements.namedItem("file_id").value=o;const a=p(document,".js-manifest-file-list");a.hidden=!1,e.currentTarget.classList.add("is-file-list"),p(a,".js-manifest-file-list-root").appendChild(r),n.isFinished()&&K(e.currentTarget)})),d("upload:progress",".js-upload-manifest-file",(function(e){const{batch:t}=e.detail,n=l(e.currentTarget,".js-upload-manifest-file-container");p(n,".js-upload-meter").style.width=`${t.percent()}%`})),d("upload:error",".js-upload-manifest-file",O),d("upload:invalid",".js-upload-manifest-file",O),u(".js-remove-manifest-file-form",(async function(e,t){await t.html();const n=l(e,".js-manifest-file-list-root");if(l(e,".js-manifest-file-entry").remove(),!n.hasChildNodes()){l(n,".js-manifest-file-list").hidden=!0,p(document,".js-upload-manifest-file").classList.remove("is-file-list")}})),c(".js-manifest-ready-check",{initialize(e){!async function(e){const t=i(e,"data-redirect-url");try{await A(i(e,"data-poll-url")),window.location.href=t}catch(n){p(document,".js-manifest-ready-check").hidden=!0,p(document,".js-manifest-ready-check-failed").hidden=!1}}(e)}}),d("click",".js-release-remove-file",(function(e){const t=l(e.currentTarget,".js-release-file");t.classList.add("delete"),p(t,"input.destroy",HTMLInputElement).value="true"})),d("click",".js-release-undo-remove-file",(function(e){const t=l(e.currentTarget,".js-release-file");t.classList.remove("delete"),p(t,"input.destroy",HTMLInputElement).value=""}));let Y=null;function Z(e,t){t.append("release_id",Q(e));const n=m(document,".js-releases-field .js-release-file.delete .id",HTMLInputElement);if(n.length){const e=n.map(e=>e.value);t.append("deletion_candidates",e.join(","))}}d("release:saved",".js-release-form",(function(e){const t=e.currentTarget;Y=null;let n=!1;for(const r of t.querySelectorAll(".js-releases-field .js-release-file"))r.classList.contains("delete")?r.remove():r.classList.contains("js-template")||(n=!0);const s=p(t,".js-releases-field");s.classList.toggle("not-populated",!n),s.classList.toggle("is-populated",n)})),d("upload:setup",".js-upload-release-file",(function(e){const{form:t,preprocess:n}=e.detail,s=e.currentTarget;if(Q(s))return void Z(s,t);if(!Y){const e=p(document,".js-save-draft",HTMLButtonElement);Y=$(e)}const r=Z.bind(null,s,t);n.push(Y.then(r))})),d("upload:start",".js-upload-release-file",(function(e){const t=e.detail.policy;p(e.currentTarget,".js-upload-meter").classList.remove("d-none");const n=t.asset.replaced_asset;if(n)for(const s of m(document,".js-releases-field .js-release-file .id",HTMLInputElement))Number(s.value)===n&&l(s,".js-release-file").remove()})),d("upload:complete",".js-upload-release-file",(function(e){const{attachment:t}=e.detail,n=p(document,".js-releases-field"),s=p(n,".js-template").cloneNode(!0);s.classList.remove("d-none","js-template"),p(s,"input.id",HTMLInputElement).value=t.id;const r=t.name||t.href.split("/").pop();for(const a of s.querySelectorAll(".js-release-asset-filename"))a instanceof HTMLInputElement?a.value=r:a.textContent=r;const o=`(${(t.file.size/1048576).toFixed(2)} MB)`;p(s,".js-release-asset-filesize").textContent=o,n.appendChild(s),n.classList.remove("not-populated"),n.classList.add("is-populated"),p(e.currentTarget,".js-upload-meter").classList.add("d-none")})),d("upload:progress",".js-upload-release-file",(function(e){const{attachment:t}=e.detail;p(e.currentTarget,".js-upload-meter").style.width=`${t.percent}%`}));let ee=class GetRepoElement extends HTMLElement{constructor(){super(...arguments),this.shouldRefreshList=!1}showDownloadMessage(e){const t=this.findPlatform(e);t&&this.showPlatform(t)}showCodespaces(e){const t=this.findPlatform(e);t&&(this.showPlatform(t),this.loadAndUpdateContent())}refreshList(){this.shouldRefreshList&&(this.shouldRefreshList=!1,this.loadAndUpdateContent())}trackDelete(){this.shouldRefreshList=!0}hideSpinner(){this.codespaceLoadingMenu.hidden=!0}showSpinner(){this.codespaceLoadingMenu.hidden=!1}onDetailsToggle(){this.modal.hidden=!1;for(const e of this.platforms)e.hidden=!0}showPlatform(e){this.modal.hidden=!0;for(const t of this.platforms)t.getAttribute("data-platform")===e&&(t.hidden=!1)}findPlatform(e){return e.currentTarget.getAttribute("data-open-app")||H()}loadAndUpdateContent(){this.codespaceList.setAttribute("src",i(this.codespaceList,"data-src"))}};e([t],ee.prototype,"modal",void 0),e([t],ee.prototype,"codespaceLoadingMenu",void 0),e([t],ee.prototype,"codespaceList",void 0),e([n],ee.prototype,"platforms",void 0),ee=e([r],ee)}}}));
  //# sourceMappingURL=repositories-bootstrap-8eb9ed3b.js.map
  