performance.mark("js-parse-end:43055-49c1b4835651d00f.js"); "use strict";(globalThis.webpackChunk_github_ui_github_ui=globalThis.webpackChunk_github_ui_github_ui||[]).push([["43055"],{27858(e,i,s){s.d(i,{W:()=>F,B:()=>q});let t={fragment:{argumentDefinitions:n=[{defaultValue:null,kind:"LocalArgument",name:"name"},{defaultValue:null,kind:"LocalArgument",name:"owner"}],kind:"Fragment",metadata:null,name:"IssueTypeFilterProviderIssueTypeQuery",selections:[{alias:null,args:l=[{kind:"Variable",name:"name",variableName:"name"},{kind:"Variable",name:"owner",variableName:"owner"}],concreteType:"Repository",kind:"LinkedField",name:"repository",plural:!1,selections:[{alias:null,args:o=[{kind:"Literal",name:"first",value:100}],concreteType:"IssueTypeConnection",kind:"LinkedField",name:"issueTypes",plural:!1,selections:[{alias:null,args:null,concreteType:"IssueTypeEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:null,args:null,concreteType:"IssueType",kind:"LinkedField",name:"node",plural:!1,selections:[u={alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null}],storageKey:null}],storageKey:null}],storageKey:"issueTypes(first:100)"}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"IssueTypeFilterProviderIssueTypeQuery",selections:[{alias:null,args:l,concreteType:"Repository",kind:"LinkedField",name:"repository",plural:!1,selections:[{alias:null,args:o,concreteType:"IssueTypeConnection",kind:"LinkedField",name:"issueTypes",plural:!1,selections:[{alias:null,args:null,concreteType:"IssueTypeEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:null,args:null,concreteType:"IssueType",kind:"LinkedField",name:"node",plural:!1,selections:[u,p={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null}],storageKey:null}],storageKey:null}],storageKey:"issueTypes(first:100)"},p],storageKey:null}]},params:{id:"deecf4e5b9723fe1e223989471673f53",metadata:{},name:"IssueTypeFilterProviderIssueTypeQuery",operationKind:"query",text:null}};t.hash="015cbd12b22f8ce7578562a617177773";let a={fragment:{argumentDefinitions:[],kind:"Fragment",metadata:null,name:"IssueTypeFilterProviderViewerIssueTypeQuery",selections:[{alias:null,args:null,concreteType:"User",kind:"LinkedField",name:"viewer",plural:!1,selections:[c={alias:null,args:null,kind:"ScalarField",name:"suggestedIssueTypeNames",storageKey:null}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[],kind:"Operation",name:"IssueTypeFilterProviderViewerIssueTypeQuery",selections:[{alias:null,args:null,concreteType:"User",kind:"LinkedField",name:"viewer",plural:!1,selections:[c,{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null}],storageKey:null}]},params:{id:"58ebbad60258ea0c9eb795e67cc2b575",metadata:{},name:"IssueTypeFilterProviderViewerIssueTypeQuery",operationKind:"query",text:null}};a.hash="765a25834ce6bc541a1d98b6355cf514";let r={fragment:{argumentDefinitions:y=[{defaultValue:null,kind:"LocalArgument",name:"login"},{defaultValue:null,kind:"LocalArgument",name:"number"}],kind:"Fragment",metadata:null,name:"IssueTypeFilterProviderProjectIssueTypeQuery",selections:[{alias:null,args:d=[{kind:"Variable",name:"login",variableName:"login"}],concreteType:"Organization",kind:"LinkedField",name:"organization",plural:!1,selections:[{alias:null,args:m=[{kind:"Variable",name:"number",variableName:"number"}],concreteType:"ProjectV2",kind:"LinkedField",name:"projectV2",plural:!1,selections:[g={alias:null,args:null,kind:"ScalarField",name:"suggestedIssueTypeNames",storageKey:null}],storageKey:null}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:y,kind:"Operation",name:"IssueTypeFilterProviderProjectIssueTypeQuery",selections:[{alias:null,args:d,concreteType:"Organization",kind:"LinkedField",name:"organization",plural:!1,selections:[{alias:null,args:m,concreteType:"ProjectV2",kind:"LinkedField",name:"projectV2",plural:!1,selections:[g,h={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null}],storageKey:null},h],storageKey:null}]},params:{id:"4ecab7512fd17375c718ee060e7c9130",metadata:{},name:"IssueTypeFilterProviderProjectIssueTypeQuery",operationKind:"query",text:null}};r.hash="54031af5ea97af051011bdae3b3dc9af";var n,l,o,u,p,c,y,d,m,g,h,f=s(89571),k=s(18310),b=s(4069),T=s(38621),v=s(91385),S=s(18312),V=s(69487);let I=[{value:"issue",displayName:"Issue",priority:1,icon:T.IssueOpenedIcon},{value:"pr",displayName:"Pull Request",priority:2,icon:T.GitPullRequestIcon}],F={displayName:"Type",key:"type",priority:f.a6,icon:T.IssueOpenedIcon,description:"Specify the type of issue to search for"};class q extends k.kr{filterValues;relayEnvironment;repositoryScope;projectScope;owner;repo;legacy;requestVariables;requestDisposable;constructor(e,i=!1,s,t,a){super(F,{...e,filterTypes:{...e?.filterTypes,multiValue:!0}}),this.type=f.CH.Text,this.relayEnvironment=s,this.repositoryScope=t,this.projectScope=a,this.requestVariables=this.#e(),this.requestDisposable=this.#i(),this.legacy=i}async getSuggestions(e,i,s,t){let a=(0,f.DS)(i,t),r=await this.processSuggestions(e,i,this.#s.bind(this),t)||[],n=[];if((0,f.uT)(i)&&this.options.filterTypes.valueless&&!i.raw.startsWith("-")){let e=(0,f.jL)(this.displayName,this.icon);n.push(e)}if((0,f.uT)(i)&&this.options.filterTypes.hasValue&&!i.raw.startsWith("-")){let e=(0,f.Ms)(this.displayName,this.icon);n.push(e)}for(let e of r){let{value:i,displayName:s}=e,t=(0,f.I8)(i),r=!!t&&(0,v.qA)(a,t),l=!!s&&(0,v.qA)(a,s);t&&(r||l)&&(e.priority-=(0,b.dt)(a,t),n.push(e))}return n}async fetchSuggestions(e,i){if(!i)return[];try{if(this.relayEnvironment&&this.requestVariables&&this.repositoryScope){let e=await (0,S.fetchQuery)(this.relayEnvironment,t,this.requestVariables,{fetchPolicy:"store-or-network"}).toPromise(),i=e?.repository?.issueTypes?.edges||[],s=[];for(let e of i)e&&e.node&&e.node.name&&s.push({name:e.node.name});return s}if(this.relayEnvironment&&this.requestVariables&&this.projectScope){let e=await (0,S.fetchQuery)(this.relayEnvironment,r,this.requestVariables,{fetchPolicy:"store-or-network"}).toPromise(),i=e?.organization?.projectV2?.suggestedIssueTypeNames||[];return i?.map(e=>({name:e}))}if(this.relayEnvironment&&!this.projectScope&&!this.repositoryScope){let e=await (0,S.fetchQuery)(this.relayEnvironment,a,{},{fetchPolicy:"store-or-network"}).toPromise(),i=e?.viewer?.suggestedIssueTypeNames||[];return i?.map(e=>({name:e}))}}catch{}return[]}async validateFilterValue(e){try{if(this.relayEnvironment&&this.requestVariables&&this.repositoryScope){let i=await (0,S.fetchQuery)(this.relayEnvironment,t,this.requestVariables,{fetchPolicy:"store-or-network"}).toPromise(),s=i?.repository?.issueTypes?.edges||[],a=[];for(let e of s)e&&e.node&&e.node.name&&a.push({name:e.node.name});return a.find(i=>(0,f.SH)(i.name,e))}if(this.relayEnvironment&&this.requestVariables&&this.projectScope)return{name:e};if(this.relayEnvironment){let i=await (0,S.fetchQuery)(this.relayEnvironment,a,{},{fetchPolicy:"store-or-network"}).toPromise(),s=i?.viewer?.suggestedIssueTypeNames||[];return{name:s?.find(i=>(0,f.SH)(i,e))}}}catch{}return null}validateValue(e,i,s){let t=(0,f.M5)(i.value),a=this.legacy?[...I.map(({value:e})=>e),s?.name]:[s?.name];return 0!==a.length&&!!t&&!!a.find(e=>(0,f.SH)(e,t))&&{value:(0,f.$4)(t)??"",displayName:t}}async processSuggestions(e,i,s,t){if(!this.shouldGetSuggestions(i))return null;let a=(0,f.DS)(i,t),r=await this.fetchSuggestions(a,i)??[];return[...this.legacy?I.map(e=>({...e,ariaLabel:`${e.displayName}, ${this.displayName}`})):[],...r.map(i=>s(i,a,e))]}getValueRowProps(e){return{text:e.displayName??(0,f.I8)(e.value)??"",leadingVisual:(0,f.J)(e,this.icon)}}rankSuggestion(e,i){let{displayName:s}=i,t=3;return e&&s&&(t-=(0,b.dt)(e,s)),{...i,priority:t}}#s(e,i){let{name:s}=e;return this.rankSuggestion(i,{type:f.ak.Value,displayName:s,ariaLabel:`${s}, ${this.displayName}`,value:(0,f.$4)(s)??"",inlineDescription:!0,icon:this.icon})}#e(){if(this.repositoryScope){let e=this.repositoryScope.split("/");return{owner:e[0]||"",name:e[1]||""}}if(this.projectScope?.login&&this.projectScope?.projectNumber)return{login:this.projectScope.login,number:this.projectScope.projectNumber}}#i(){if(this.relayEnvironment)if(this.requestVariables&&this.repositoryScope){let e=(0,V.getRequest)(t),i=(0,V.createOperationDescriptor)(e,this.requestVariables);return this.relayEnvironment.retain(i)}else if(this.requestVariables&&this.projectScope){let e=(0,V.getRequest)(r),i=(0,V.createOperationDescriptor)(e,this.requestVariables);return this.relayEnvironment.retain(i)}else{let e=(0,V.getRequest)(a),i=(0,V.createOperationDescriptor)(e,{});return this.relayEnvironment.retain(i)}}}}}]); //# sourceMappingURL=43055-49c1b4835651d00f-9d3ff8a5620c1e9a.js.map