performance.mark("js-parse-end:70206-9f6e8f36ba3e113d.js"); "use strict";(globalThis.webpackChunk_github_ui_github_ui=globalThis.webpackChunk_github_ui_github_ui||[]).push([["70206"],{91707(t,e,i){i.r(e),i.d(e,{Attachment:()=>n,default:()=>m});class n{constructor(t,e){this.file=t,this.directory=e,this.state="pending",this.id=null,this.href=null,this.name=null,this.percent=0}static traverse(t,e){var i,a;return i=t,e&&(a=i).items&&Array.from(a.items).some(t=>{let e=t.webkitGetAsEntry&&t.webkitGetAsEntry();return e&&e.isDirectory})?s("",Array.from(i.items).map(t=>t.webkitGetAsEntry()).filter(t=>null!=t)):Promise.resolve(r(Array.from(i.files||[])).map(t=>new n(t)))}static from(t){let e=[];for(let i of t)if(i instanceof File)e.push(new n(i));else if(i instanceof n)e.push(i);else throw Error("Unexpected type");return e}get fullPath(){return this.directory?`${this.directory}/${this.file.name}`:this.file.name}isImage(){return["image/gif","image/png","image/jpg","image/jpeg","image/svg+xml"].indexOf(this.file.type)>-1}isVideo(){return["video/mp4","video/quicktime"].indexOf(this.file.type)>-1}saving(t){if("pending"!==this.state&&"saving"!==this.state)throw Error(`Unexpected transition from ${this.state} to saving`);this.state="saving",this.percent=t}saved(t){var e,i,n;if("pending"!==this.state&&"saving"!==this.state)throw Error(`Unexpected transition from ${this.state} to saved`);this.state="saved",this.id=null!=(e=null==t?void 0:t.id)?e:null,this.href=null!=(i=null==t?void 0:t.href)?i:null,this.name=null!=(n=null==t?void 0:t.name)?n:null}isPending(){return"pending"===this.state}isSaving(){return"saving"===this.state}isSaved(){return"saved"===this.state}}function r(t){return Array.from(t).filter(t=>!t.name.startsWith("."))}async function s(t,e){let i=[];for(let a of r(e))if(a.isDirectory)i.push(...await s(a.fullPath,await function(t){return new Promise(function(e,i){let n=[],r=t.createReader(),s=()=>{r.readEntries(t=>{t.length>0?(n.push(...t),s()):e(n)},i)};s()})}(a)));else{let e=await function(t){return new Promise(function(e,i){t.file(e,i)})}(a);i.push(new n(e,t))}return i}class a extends HTMLElement{connectedCallback(){this.addEventListener("dragenter",u),this.addEventListener("dragover",u),this.addEventListener("dragleave",c),this.addEventListener("drop",h),this.addEventListener("paste",f),this.addEventListener("change",p)}disconnectedCallback(){this.removeEventListener("dragenter",u),this.removeEventListener("dragover",u),this.removeEventListener("dragleave",c),this.removeEventListener("drop",h),this.removeEventListener("paste",f),this.removeEventListener("change",p)}get directory(){return this.hasAttribute("directory")}set directory(t){t?this.setAttribute("directory",""):this.removeAttribute("directory")}async attach(t){let e=t instanceof DataTransfer?await n.traverse(t,this.directory):n.from(t);this.dispatchEvent(new CustomEvent("file-attachment-accept",{bubbles:!0,cancelable:!0,detail:{attachments:e}}))&&e.length&&this.dispatchEvent(new CustomEvent("file-attachment-accepted",{bubbles:!0,detail:{attachments:e}}))}}function o(t){return Array.from(t.types).indexOf("Files")>=0}let l=null;function u(t){let e=t.currentTarget;l&&clearTimeout(l),l=window.setTimeout(()=>e.removeAttribute("hover"),200);let i=t.dataTransfer;i&&o(i)&&(i.dropEffect="copy",e.setAttribute("hover",""),t.preventDefault())}function c(t){t.dataTransfer&&(t.dataTransfer.dropEffect="none"),t.currentTarget.removeAttribute("hover"),t.stopPropagation(),t.preventDefault()}function h(t){let e=t.currentTarget;if(!(e instanceof a))return;e.removeAttribute("hover");let i=t.dataTransfer;i&&o(i)&&(e.attach(i),t.stopPropagation(),t.preventDefault())}let d=/^image\/(gif|png|jpeg)$/;function f(t){if(!t.clipboardData||!t.clipboardData.items)return;let e=t.currentTarget;if(!(e instanceof a))return;let i=function(t){for(let e of t)if("file"===e.kind&&d.test(e.type))return e.getAsFile();return null}(t.clipboardData.items);i&&(e.attach([i]),t.preventDefault())}function p(t){let e=t.currentTarget;if(!(e instanceof a))return;let i=t.target;if(!(i instanceof HTMLInputElement))return;let n=e.getAttribute("input");if(n&&i.id!==n)return;let r=i.files;r&&0!==r.length&&(e.attach(r),i.value="")}window.customElements.get("file-attachment")||(window.FileAttachmentElement=a,window.customElements.define("file-attachment",a));let m=a},45062(t,e,i){i.d(e,{s:()=>r});var n=i(70170);function r(t=0,e={}){return(i,r,s)=>{if(!s||"function"!=typeof s.value)throw Error("debounce can only decorate functions");let a=s.value;s.value=(0,n.s)(a,t,e),Object.defineProperty(i,r,s)}}},35908(t,e,i){i.d(e,{A:()=>n});class n{constructor(t,e,{tabInsertsSuggestions:i,firstOptionSelectionMode:n,scrollIntoViewOptions:r}={}){this.input=t,this.list=e,this.tabInsertsSuggestions=null==i||i,this.firstOptionSelectionMode=null!=n?n:"none",this.scrollIntoViewOptions=null!=r?r:{block:"nearest",inline:"nearest"},this.isComposing=!1,e.id||(e.id=`combobox-${Math.random().toString().slice(2,6)}`),this.ctrlBindings=!!navigator.userAgent.match(/Macintosh/),this.keyboardEventHandler=t=>(function(t,e){if(!t.shiftKey&&!t.metaKey&&!t.altKey&&(e.ctrlBindings||!t.ctrlKey)&&!e.isComposing)switch(t.key){case"Enter":s(e.input,e.list)&&t.preventDefault();break;case"Tab":e.tabInsertsSuggestions&&s(e.input,e.list)&&t.preventDefault();break;case"Escape":e.clearSelection();break;case"ArrowDown":e.navigate(1),t.preventDefault();break;case"ArrowUp":e.navigate(-1),t.preventDefault();break;case"n":e.ctrlBindings&&t.ctrlKey&&(e.navigate(1),t.preventDefault());break;case"p":e.ctrlBindings&&t.ctrlKey&&(e.navigate(-1),t.preventDefault());break;default:if(t.ctrlKey)break;e.resetSelection()}})(t,this),this.compositionEventHandler=t=>{var e,i;return e=t,i=this,void(i.isComposing="compositionstart"===e.type,document.getElementById(i.input.getAttribute("aria-controls")||"")&&i.clearSelection())},this.inputHandler=this.clearSelection.bind(this),t.setAttribute("role","combobox"),t.setAttribute("aria-controls",e.id),t.setAttribute("aria-expanded","false"),t.setAttribute("aria-autocomplete","list"),t.setAttribute("aria-haspopup","listbox")}destroy(){this.clearSelection(),this.stop(),this.input.removeAttribute("role"),this.input.removeAttribute("aria-controls"),this.input.removeAttribute("aria-expanded"),this.input.removeAttribute("aria-autocomplete"),this.input.removeAttribute("aria-haspopup")}start(){this.input.setAttribute("aria-expanded","true"),this.input.addEventListener("compositionstart",this.compositionEventHandler),this.input.addEventListener("compositionend",this.compositionEventHandler),this.input.addEventListener("input",this.inputHandler),this.input.addEventListener("keydown",this.keyboardEventHandler),this.list.addEventListener("click",r),this.resetSelection()}stop(){this.clearSelection(),this.input.setAttribute("aria-expanded","false"),this.input.removeEventListener("compositionstart",this.compositionEventHandler),this.input.removeEventListener("compositionend",this.compositionEventHandler),this.input.removeEventListener("input",this.inputHandler),this.input.removeEventListener("keydown",this.keyboardEventHandler),this.list.removeEventListener("click",r)}indicateDefaultOption(){var t;"active"===this.firstOptionSelectionMode?null==(t=Array.from(this.list.querySelectorAll('[role="option"]:not([aria-disabled="true"])')).filter(a)[0])||t.setAttribute("data-combobox-option-default","true"):"selected"===this.firstOptionSelectionMode&&this.navigate(1)}navigate(t=1){let e=Array.from(this.list.querySelectorAll('[aria-selected="true"]')).filter(a)[0],i=Array.from(this.list.querySelectorAll('[role="option"]')).filter(a),n=i.indexOf(e);if(n===i.length-1&&1===t||0===n&&-1===t){this.clearSelection(),this.input.focus();return}let r=1===t?0:i.length-1;if(e&&n>=0){let e=n+t;e>=0&&e0||t.offsetHeight>0)}},50515(t,e,i){i.d(e,{JC:()=>A,KK:()=>d,Vy:()=>l,ai:()=>E,rd:()=>f});class n{constructor(t){this.children=[],this.parent=t}delete(t){let e=this.children.indexOf(t);return -1!==e&&(this.children=this.children.slice(0,e).concat(this.children.slice(e+1)),0===this.children.length&&this.parent.delete(this),!0)}add(t){return this.children.push(t),this}}class r{constructor(t){this.parent=null,this.children={},this.parent=t||null}get(t){return this.children[t]}insert(t){let e=this;for(let i=0;i","\xbf":"?"},a={"`":"~",1:"!",2:"@",3:"#",4:"$",5:"%",6:"^",7:"&",8:"*",9:"(",0:")","-":"_","=":"+","[":"{","]":"}","\\":"|",";":":","'":'"',",":"<",".":">","/":"?",q:"Q",w:"W",e:"E",r:"R",t:"T",y:"Y",u:"U",i:"I",o:"O",p:"P",a:"A",s:"S",d:"D",f:"F",g:"G",h:"H",j:"J",k:"K",l:"L",z:"Z",x:"X",c:"C",v:"V",b:"B",n:"N",m:"M"},o={" ":"Space","+":"Plus"};function l(t,e=navigator.platform){var i,n,r;let{ctrlKey:c,altKey:d,metaKey:f,shiftKey:p,key:m}=t,v=[];for(let[t,e]of[c,d,f,p].entries())e&&v.push(u[t]);if(!u.includes(m)){let t=v.includes("Alt")&&h.test(e)&&null!=(i=s[m])?i:m,l=v.includes("Shift")&&h.test(e)&&null!=(n=a[t])?n:t,u=null!=(r=o[l])?r:l;v.push(u)}return v.join("+")}let u=["Control","Alt","Meta","Shift"];function c(t,e){let i,n,r;{var s,a,o,l=(s=t,a=e,n="u"this.reset(),d.CHORD_TIMEOUT)}}function f(t){return t.split(" ").map(t=>c(t)).join(" ")}function p(t){if(!(t instanceof HTMLElement))return!1;let e=t.nodeName.toLowerCase(),i=(t.getAttribute("type")||"").toLowerCase();return"select"===e||"textarea"===e||"input"===e&&"submit"!==i&&"reset"!==i&&"checkbox"!==i&&"radio"!==i&&"file"!==i||t.isContentEditable}d.CHORD_TIMEOUT=1500;let m=new r,v=new WeakMap,g=m,b=new d({onReset(){g=m}});function y(t){if(t.defaultPrevented||!(t.target instanceof Node))return;if(p(t.target)){let e=t.target;if(!e.id||!e.ownerDocument.querySelector(`[data-hotkey-scope="${e.id}"]`))return}let e=g.get(l(t));if(!e)return void b.reset();if(b.registerKeypress(t),g=e,e instanceof n){let n,r=t.target,s=!1,a=p(r);for(let t=e.children.length-1;t>=0;t-=1){let i=(n=e.children[t]).getAttribute("data-hotkey-scope");if(!a&&!i||a&&r.id===i){s=!0;break}}if(n&&s){var i;let e;i=n,e=new CustomEvent("hotkey-fire",{cancelable:!0,detail:{path:b.path}}),i.dispatchEvent(e)&&(p(i)?i.focus():i.click()),t.preventDefault()}b.reset()}}function E(t,e){0===Object.keys(m.children).length&&document.addEventListener("keydown",y);let i=(function(t){let e=[],i=[""],n=!1;for(let r=0;rt.map(t=>c(t)).filter(t=>""!==t)).filter(t=>t.length>0)})(e||t.getAttribute("data-hotkey")||"").map(e=>m.insert(e).add(t));v.set(t,i)}function A(t){let e=v.get(t);if(e&&e.length)for(let i of e)i&&i.delete(t);0===Object.keys(m.children).length&&document.removeEventListener("keydown",y)}}}]); //# sourceMappingURL=70206-9f6e8f36ba3e113d-7c202fc27342f175.js.map