PageSourceSearch

https://developer.metamask.io/assets/index-B78AHscB.js

js metamask.io collected 2026-09-24 08:24:45 UTC 19,006 bytes, 2 lines download raw bytes

1import{d as I,h as q,a0 as Y,c as l,F as j,r as O,v as y,u as J,s as T,o as s,g as H,au as P,j as F,aw as B,_ as E,w as o,e as r,i as v,t as f,a as i,k as a,aO as K,aP as Q,aQ as W,aR as X,aS as Z,aT as ee,aq as M,aU as te,aH as _,b as k,U as $,ap as C,f as b,m as re,aA as N,J as ie,aJ as se}from"./index-BBdDAQgV.js";import{_ as oe}from"./Alerts.vue_vue_type_script_setup_true_lang-CAz_62AX.js";import{_ as ae}from"./Dropdown.vue_vue_type_script_setup_true_lang-C7Xrgdmb.js";import{T as L}from"./TextField-B7ZAUKVj.js";import{k as ne}from"./Avatar.esm-DeUPZ-Mb.js";import{w as le}from"./Badge.esm-DbOlSwai.js";import{w as de}from"./Checkbox.esm-VY16LjB0.js";import{p as pe}from"./Divider.esm-CpL8GpCB.js";import{N as me}from"./Icon.vue_vue_type_script_setup_true_lang-mnkpFxjS-C7PHkd59.js";import{_ as R}from"./Button.vue_vue_type_script_setup_true_lang-BJSYMRCO.js";import{_ as fe}from"./Popover.vue_vue_type_script_setup_true_lang-DUMejfyh.js";import{T as ue}from"./TransitionPopup-DVXUDrlX.js";import{g as ce}from"./color-C6f32606.js";import{D as ve}from"./Modal.esm-CFcVeQDN.js";import{c as S,s as he,r as ge,u as we}from"./index-BcuQvbXW.js";import"./Alerts.esm-C8fGOz05.js";import"./_plugin-vue_export-helper-CHgC5LLL-lGy7RumW.js";import"./Button.esm-qsGG769Z.js";import"./floating-ui.dom-DdpXSCBY.js";import"./TextField.esm-DO7-J262.js";import"./index-BsQ31CDu.js";const ke=I({__name:"CheckboxGroup",props:{items:{default:()=>[]},modelValue:{default:()=>[]},disabledAll:{type:Boolean,default:!1},labelPlacement:{default:"right"},row:{type:Boolean,default:!1},classes:{default:()=>({})},checkboxClasses:{default:()=>({})}},emits:["onChange","update:modelValue"],setup(e,{emit:t}){const d=q(e.modelValue),c=t,w=H(()=>new Set(d.value)),V=(m,u)=>{!m&&w.value.has(u)?w.value.delete(u):w.value.add(u),d.value=[...w.value],c("update:modelValue",d.value),c("onChange",d.value)};return Y(()=>e.modelValue,()=>{d.value=[...e.modelValue]}),(m,u)=>(s(),l("div",{class:T(["flex flex-col gap-3",{"!flex-row !gap-4":e.row},e.classes?.container]),"data-testid":"checkbox-group-root"},[(s(!0),l(j,null,O(e.items,(n,h)=>(s(),y(J(de),{id:n.id,key:n.id,label:n.label,value:n.value,description:n.description,checked:d.value?.includes(n.value),disabled:e.disabledAll||n.disabled,"label-placement":e.labelPlacement,"tab-index":h,classes:{...e.checkboxClasses},onOnChange:V},null,8,["id","label","value","description","checked","disabled","label-placement","tab-index","classes"]))),128))],2))}}),be=I({name:"ArchiveVerifier",components:{Button:R,Modal:ve,TextField:L},props:{isArchiveVerifier:{type:Boolean,default:!1},verifier:{type:Object,default:()=>({})},teamName:{type:String,default:void 0}},emits:["closeDialog"],data:()=>({sendingForm:!1,verifierId:"",error:"",v$:we()}),validations(){return{verifierId:{required:S.withMessage("This field is required",ge),sameAs:S.withMessage("Please type the verifier identifier correctly",he(this.verifier.verifier_id))}}},methods:{onClose(){this.$emit("closeDialog"),this.error="",this.verifierId="",this.v$.verifierId.$reset()},async archiveVerifier(){if(await this.v$.verifierId.$validate())try{this.sendingForm=!0,await P.archiveLegacyVerifier({verifierId:this.verifier.verifier_id,network:this.verifier.network,teamId:this.verifier.team_id}),F.setToastMessage({message:"Verifier archived successfully",type:B.SUCCESS}),this.onClose()}catch(t){this.error=`Fail to archive verifier: ${t.message}`}finally{this.sendingForm=!1}}}}),ye={class:"text-sm mb-2 text-app-gray-900"},Ve={class:"font-medium"},xe={class:"mt-5"};function $e(e,t,d,c,w,V){const m=a("TextField"),u=a("Button"),n=a("Modal");return s(),y(n,{open:e.isArchiveVerifier,border:!1,width:"default",classes:{modalContent:"max-md:!h-auto",header:"!border-b !border-app-gray-200"},"backdrop-close":!1,onOnClose:e.onClose},{header:o(()=>[...t[2]||(t[2]=[r("div",{class:"text-xl font-semibold capitalize text-app-gray-900 dark:text-app-white"},"Archive Verifier?",-1)])]),body:o(()=>[r("div",null,[t[6]||(t[6]=r("div",{class:"mb-6 text-base text-app-gray-500"}," This verifier's details will be changed to read-only and will no longer be editable by anyone unless restored. You may restore it back anytime to make changes. ",-1)),r("div",ye,[t[3]||(t[3]=v(" Please type ",-1)),r("span",Ve,'"'+f(e.verifier.verifier_id)+'"',1),t[4]||(t[4]=v(" to confirm. ",-1))]),i(m,{modelValue:e.verifierId,"onUpdate:modelValue":t[0]||(t[0]=h=>e.verifierId=h),"aria-label":'Please type "{{ verifier.verifier_id }}" to confirm.',error:e.v$.verifierId.$error||!!e.error,"helper-text":e.v$.verifierId.$error?e.v$.verifierId.$errors[0].$message:e.error,onInput:t[1]||(t[1]=h=>e.v$.verifierId.$validate())},null,8,["modelValue","error","helper-text"]),r("div",xe,[i(u,{classes:{container:"!bg-app-error"},"aria-label":"Archive Project",disabled:e.sendingForm,loading:e.sendingForm,block:"",onClick:e.archiveVerifier},{default:o(()=>[...t[5]||(t[5]=[v(" I understand, archive this verifier ",-1)])]),_:1},8,["disabled","loading","onClick"])])])]),_:1},8,["open","onOnClose"])}const Ce=E(be,[["render",$e]]),je=I({name:"VerifierItem",components:{Avatar:ne,Badge:le,Button:R,CheckboxGroup:ke,Divider:pe,Icon:me,ArchiveVerifier:Ce,TransitionPopup:ue,Popover:fe},props:{verifier:{type:Object,default:()=>({})},teamName:{type:String,default:""},disabled:{type:Boolean,default:!1}},data:()=>({showVerifierOptions:!1,isArchiveVerifier:!1,showMoveOptions:!1,linkedProjectIds:[],mov
1ingVerifier:!1,error:"",showMore:!1}),computed:{verifierRoute(){return`/organization/${this.teamName}/verifiers/${encodeURIComponent(this.verifier.verifier_id)}?network=${this.verifier.network}`},projects(){return(M.projectsGetter(this.verifier.team_id)||[]).filter(t=>t.network===this.verifier.network).map(t=>({label:t.name,value:t.project_id,id:t.ID.toString()}))},networkDisplay(){const e=_.find(t=>t.id===this.verifier.network);return e?e.name:this.verifier.network},networkDescription(){return this.verifier.network===te?"On average it will take up to 2 days to process this":" On average it will take up to 30 minutes to process this"},linkedProjects(){const e=this.verifier.linked_projects?this.verifier.linked_projects.split(","):[],t=[];for(let d=0;d<e.length;d+=1){const c=M.projectGetter(this.verifier.team_id,e[d]);Object.keys(c??{}).length>0&&t.push(c.name)}return t}},watch:{showVerifierOptions(e){e?document.addEventListener("click",this.handleClickOutside):document.removeEventListener("click",this.handleClickOutside)},async showMoveOptions(e){e?(this.linkedProjectIds=this.verifier.linked_projects?this.verifier.linked_projects.split(","):[],document.addEventListener("click",this.handleClickOutside)):document.removeEventListener("click",this.handleClickOutside)}},methods:{handleClickOutside(e){this.$refs.verifierAction&&!this.$refs.verifierAction.contains(e.target)&&(this.showVerifierOptions=!1),this.$refs.linkedProjectAction&&!this.$refs.linkedProjectAction.contains(e.target)&&(this.showMoveOptions=!1)},format(e){return new Date(e).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})},typeDisplayName(e){return e===ee?"aggregate":e},statusColor(e){switch(e){case Z:return"success";case X:case W:case Q:return"warning";case K:return"danger";default:return}},async moveToProject(){try{this.error="",this.movingVerifier=!0,await P.moveVerifierToProject({verifierId:this.verifier.verifier_id,network:this.verifier.network,teamId:this.verifier.team_id,projectIds:this.linkedProjectIds}),this.showMoveOptions=!1,this.showVerifierOptions=!1,F.setToastMessage({message:"Verifier moved successfully",type:B.SUCCESS})}catch(e){this.error=`Error: ${e.message}`}finally{this.movingVerifier=!1}},openDetails(){this.$router.push(this.verifierRoute)},colorByProjectName(e){return ce(e)},showMoreProjects(){this.showMore=!0}}}),Pe={class:"p-4 text-sm font-normal text-app-gray-500"},Ie={class:"p-4"},Ae={class:"flex items-center gap-2 text-base font-medium text-app-gray-700"},Te={key:0},Oe={class:"p-4 text-sm font-normal text-app-gray-500 capitalize"},Ee={class:"p-4 text-sm font-medium text-app-gray-500 capitalize"},De={class:"p-4 w-[300px] relative"},Me={key:0,class:"w-fit"},Ne={class:"px-2 py-2 text-app-white text-sm text-center font-medium w-max max-w-[250px]"},Se={class:"p-4"},Fe={key:0,class:"font-bold"},Be={key:1,class:"flex flex-wrap"},_e={class:"px-2 py-2 text-app-white text-sm text-center font-medium w-max max-w-[250px]"},Le={class:"!-ml-1"},Re={class:"px-2 py-2 text-app-white text-sm text-center font-medium w-max max-w-[250px]"},ze={class:"absolute top-[44px] border border-app-gray-100 right-4 m-0 bg-app-white dark:bg-app-dark-surface1 w-[195px] shadow-md rounded-lg z-10"},Ue={key:0,class:"text-app-red-500 text-sm mt-5"},Ge={key:2};function qe(e,t,d,c,w,V){const m=a("Icon"),u=a("Badge"),n=a("Popover"),h=a("Avatar"),A=a("CheckboxGroup"),g=a("Button"),x=a("TransitionPopup"),z=a("router-link"),U=a("Divider"),G=a("ArchiveVerifier");return s(),l(j,null,[r("tr",{class:"bg-app-white dark:bg-app-dark-surface1 border-b border-app-gray-200 hover:bg-app-gray-50 dark:hover:bg-app-dark-surface3 hover:cursor-pointer",onClick:t[9]||(t[9]=(...p)=>e.openDetails&&e.openDetails(...p))},[r("td",Pe,f(e.format(e.verifier.CreatedAt)),1),r("td",Ie,[r("div",Ae,[r("span",null,f(e.verifier.verifier_id),1),e.linkedProjects.length===0?(s(),l("div",Te,[i(m,{name:"exclamation-circle-solid-icon",class:"text-app-error"})])):k("",!0)])]),r("td",Oe,f(e.typeDisplayName(e.verifier.verifier_type)),1),r("td",Ee,f(e.networkDisplay),1),r("td",De,[e.verifier.status==="Processing"?(s(),l("div",Me,[i(n,{position:"top","is-dark":""},{"popover-content":o(()=>[r("div",Ne,f(e.networkDescription),1)]),default:o(()=>[i(u,{variant:e.statusColor(e.verifier.status)},{default:o(()=>[v(f(e.verifier.status),1)]),_:1},8,["variant"])]),_:1})])):(s(),y(u,{key:1,variant:e.statusColor(e.verifier.status)},{default:o(()=>[v(f(e.verifier.status),1)]),_:1},8,["variant"]))]),r("td",Se,[e.linkedProjects.length===0?(s(),l("div",Fe,"-")):(s(),l("div",Be,[(s(!0),l(j,null,O(e.linkedProjects,(p,D)=>$((s(),l("div",{key:D,class:"!-ml-1"},[i(n,{position:"top","is-dark":""},{"popover-content":o(()=>[r("div",_e,f(p),1)]),default:o(()=>[i(h,{size:"xs",border:!0,class:T(["capitalize text-app-white",`!bg-[${e.colorByProjectName(p)}]`])},{default:o(()=>[v(f(p[0]),1)]),_:2},1032,["class"])]),_:2},1024)])),[[C,D<=3||e.showMore]])),128)),$(r("div",Le,[i(n,{position:"top","is-dark":""},{"popover-content":o(()=>[r("div",Re,f(`Show more ${e.linkedProjects.length-4} projects`),1)]),default:o(()=>[i(h,{size:"xs",border:!0,class:"text-xs capitalize text-app-white !bg-[black]",onClick:b(e.showMoreProjects,["stop","prevent"])},{default:o(()=>[v(f(`+${e.linkedProjects.length-4}`),1)]),_:1},8,["onClick"])]),_:1})],512),[[C,e.linkedProjects.length>4&&!e.showMore]])]))]),r("td",{ref:"verifierAction",class:"p-4 text-base font-semibold text-app-gray-700 relative","aria-hidden":"",onClick:t[8]||(t[8]=b(p=>e.showVerifierOptions=!1,["stop"]))},[i(m,{name:"dots-horizontal-icon",class:"cursor-pointer","aria-hidden":"",onClick:t[0]||(t[0]=b(p=>e.showVerifierOptions=!e.showVerifierOptions,["stop"]))}),i(x,{onTrigger:t[7]||(t[7]=p=>e.showVerifierOptions=!1)},{default:o(()=>[$(r("ul",ze,[!e.disabled&&e.projects.length===0?(s(),y(n,{key:0,position:"left","is-dark":""},{"popover-content":o(()=>[...t[12]||(t[12]=[r("div",{class:"text-sm sm:text-base font-normal text-app-white w-max max-w-[250px] p-4"}," A project with the same environment needs to exist to move this verifier ",-1)])]),default:o(()=>[r("li",{class:"text-sm font-medium text-app-gray-300 flex items-center py-3 px-4 gap-2 cursor-pointer","aria-hidden":"",onClick:t[1]||(t[1]=b(p=>e.showMoveOptions=!e.showMoveOptions,["stop"]))},[i(m,{name:"inbox-in-solid-icon"}),t[11]||(t[11]=r("span",null,"Move to Project",-1))])]),_:1})):k("",!0),!e.disabled&&e.projects.length>0?(s(),l("li",{key:1,class:"text-sm font-medium text-app-gray-500 flex items-center py-3 px-4 gap-2 cursor-pointer hover:bg-app-gray-100 dark:hover:bg-app-dark-surface2 hover:text-app-gray-900","aria-hidden":"",onClick:t[5]||(t[5]=b(p=>e.showMoveOptions=!e.showMoveOptions,["stop"]))},[i(m,{name:"inbox-in-solid-icon"}),t[14]||(t[14]=r("span",null,"Move to Project",-1)),i(x,{onTrigger:t[4]||(t[4]=p=>e.showMoveOptions=!1)},{default:o(()=>[$(r("div",{ref:"linkedProjectAction",class:"absolute border border-app-gray-100 left-[-204px] p-4 top-3 m-0 bg-app-white dark:bg-app-dark-surface1 w-[195px] shadow-md rounded-lg z-10",onClick:t[3]||(t[3]=b(()=>{},["stop"]))},[r("div",null,[i(A,{modelValue:e.linkedProjectIds,"onUpdate:modelValue":t[2]||(t[2]=p=>e.linkedProjectIds=p),class:T(["overflow-y-auto",e.projects.length>5?"h-[100px]":"h-auto"]),items:e.projects},null,8,["modelValue","class","items"]),e.error?(s(),l("div",Ue,f(e.error),1)):k("",!0),i(g,{class:"ml-auto mt-4",size:"xs",block:"",variant:"secondary",disabled:e.movingVerifier,loading:e.movingVerifier,onClick:e.moveToProject},{default:o(()=>[i(m,{name:"inbox-in-solid-icon",class:"mr-2"}),t[13]||(t[13]=v(" Move Verifier ",-1))]),_:1},8,["disabled","loading","onClick"])])],512),[[C,e.showMoveOptions]])]),_:1})])):k("",!0),r("li",null,[i(z,{to:e.verifierRoute,"aria-label":`link to ${e.verifier.verifier_id}`,class:"text-sm font-medium text-app-gray-500 flex items-center py-3 px-4 gap-2 cursor-pointer hover:bg-app-gray-100 dark:hover:bg-app-dark-surface2 hover:text-app-gray-900"},{default:o(()=>[i(m,{name:"information-circle-solid-icon"}
1),t[15]||(t[15]=r("span",null,"View Details",-1))]),_:1},8,["to","aria-label"])]),e.disabled?k("",!0):(s(),l("div",Ge,[i(U,{class:"mx-0"}),r("li",{class:"text-sm font-medium text-app-error flex items-center gap-2 py-3 px-4 cursor-pointer hover:bg-app-gray-100 dark:hover:bg-app-dark-surface2","aria-hidden":"",onClick:t[6]||(t[6]=p=>e.isArchiveVerifier=!0)},[i(m,{name:"archive-solid-icon"}),t[16]||(t[16]=r("span",null,"Archive Verifier",-1))])]))],512),[[C,e.showVerifierOptions]])]),_:1})],512)]),i(G,{verifier:e.verifier,"is-archive-verifier":e.isArchiveVerifier,onCloseDialog:t[10]||(t[10]=p=>e.isArchiveVerifier=!1)},null,8,["verifier","is-archive-verifier"])],64)}const Ye=E(je,[["render",qe]]),Je=I({name:"Verifiers",components:{Alerts:oe,Dropdown:ae,Loader:re,TextField:L,VerifierItem:Ye},props:{teamName:{type:String,required:!0}},data:()=>({networkFilter:"all",statusFilter:"all",search:""}),computed:{networks(){const e=_.filter(t=>t.value!==se).map(t=>({name:t.name,value:t.value}));return[{name:"All",value:"all"},...e]},networkDisplay(){return this.networkFilter.split("_").join(" ")},verifiers(){return P.legacyVerifiersGetter(this.selectedTeam.id)||[]},loadingVerifiers(){return!P.legacyVerifiersGetter(this.selectedTeam.id)},existingVerifiers(){return this.verifiers.filter(e=>!e.DeletedAt)},unlinkedVerifiers(){return this.existingVerifiers.filter(e=>!e.linked_projects)},filteredVerifiers(){return this.existingVerifiers.filter(e=>{const t=this.networkFilter==="all"?!0:e.network===this.networkFilter,d=this.statusFilter==="all"?!0:e.status===this.statusFilter,c=this.search===""?!0:e.verifier_id.toLowerCase().includes(this.search.toLowerCase());return d&&t&&c})},archivedVerifiers(){return this.verifiers.filter(e=>e.DeletedAt)},selectedTeam(){return ie.selectedTeamGetter(this.teamName)},hasEditPermission(){return this.teamName?[N.owner,N.admin].includes(this.selectedTeam.role):!0}}}),He={class:"w-full pb-8"},Ke={class:"w-full bg-app-white dark:bg-app-dark-surface1 p-5"},Qe={class:"flex flex-col sm:flex-row gap-2 justify-between"},We={class:"w-full sm:w-1/2"},Xe={class:"max-sm:w-full flex gap-2"},Ze={class:"relative max-lg:overflow-x-auto overflow-y-auto table-container"},et={key:0,class:"flex-grow flex items-center justify-center mt-36"},tt={key:1,class:"!w-full text-sm text-left text-app-gray-500 dark:text-app-gray-400"},rt={key:2};function it(e,t,d,c,w,V){const m=a("Alerts"),u=a("TextField"),n=a("Dropdown"),h=a("Loader"),A=a("VerifierItem");return s(),l("div",He,[r("div",Ke,[e.unlinkedVerifiers.length>0?(s(),y(m,{key:0,variant:"danger",classes:{heading:"max-sm:text-sm max-sm:font-semibold",message:"max-sm:text-xs"},class:"mt-4","show-icon":"",heading:"Action Needed: Move Verifiers to Projects"},{alertMessage:o(()=>[...t[3]||(t[3]=[r("div",null,[r("div",{class:"mt-2 text-sm font-normal max-sm:text-xs"},[v(" Move your verifiers to their respective projects by "),r("b",null,"31 October 2023"),v(" in order for verifiers to work. All verifiers without projects will be removed. ")]),r("div",{class:"mt-1 text-sm font-normal max-sm:text-xs"},"You need a project with the same environment to move a verifier.")],-1)])]),_:1})):k("",!0),t[4]||(t[4]=r("h1",{class:"text-2xl font-semibold mt-5 text-app-gray-900 mb-4"},"Existing Verifiers",-1)),r("div",Qe,[r("div",We,[i(u,{modelValue:e.search,"onUpdate:modelValue":t[0]||(t[0]=g=>e.search=g),placeholder:"Search for verifiers","trailing-icon":"search-solid-icon"},null,8,["modelValue"])]),r("div",Xe,[i(n,{modelValue:e.networkFilter,"onUpdate:modelValue":t[1]||(t[1]=g=>e.networkFilter=g),label:`Environment : ${e.networkDisplay}`,class:"w-full sm:w-max member-dropdown",items:e.networks,"button-props":{variant:"secondary",class:"max-sm:w-full"},classes:{dropdownBtn:"!border-app-gray-200 !text-app-gray-900 capitalize"}},null,8,["modelValue","label","items"]),i(n,{modelValue:e.statusFilter,"onUpdate:modelValue":t[2]||(t[2]=g=>e.statusFilter=g),label:`Status : ${e.statusFilter}`,class:"w-full sm:w-max member-dropdown",items:[{name:"Status: All",value:"all"},{name:"Live",value:"Live"},{name:"Processing",value:"Processing"},{name:"Rejected",value:"Rejected"}],"button-props":{variant:"secondary",class:"max-sm:w-full"},classes:{dropdownBtn:"!border-app-gray-200 !text-app-gray-900 capitalize",menuContainer:"sm:!w-36"}},null,8,["modelValue","label"])])])]),r("div",Ze,[e.loadingVerifiers?(s(),l("div",et,[i(h)])):(s(),l("table",tt,[t[5]||(t[5]=r("thead",{class:"text-xs font-semibold capitalize bg-app-gray-50 dark:bg-app-dark-surface3 border-y border-app-gray-200"},[r("tr",null,[r("th",{scope:"col",class:"p-4 text-app-gray-500 w-[170px]"},"DATE CREATED"),r("th",{scope:"col",class:"p-4 text-app-gray-500"},"VERIFIER IDENTIFIER"),r("th",{scope:"col",class:"p-4 text-app-gray-500"},"TYPE"),r("th",{scope:"col",class:"p-4 text-app-gray-500"},"ENVIRONMENT"),r("th",{scope:"col",class:"p-4 text-app-gray-500"},"STATUS"),r("th",{scope:"col",class:"p-4 text-app-gray-500"},"PROJECTS"),r("th",{scope:"col",class:"p-4 text-app-gray-500"})])],-1)),r("tbody",null,[(s(!0),l(j,null,O(e.filteredVerifiers,(g,x)=>(s(),y(A,{key:x,verifier:g,"team-name":e.teamName,disabled:!e.hasEditPermission},null,8,["verifier","team-name","disabled"]))),128))])])),e.filteredVerifiers.length===0?(s(),l("div",rt,[...t[6]||(t[6]=[r("div",{class:"font-normal py-2 mt-3 text-center"},"No verifiers found",-1)])])):k("",!0)])])}const Ct=E(Je,[["render",it],["__scopeId","data-v-5532433a"]]);export{Ct as default};
2//# sourceMappingURL=index-B78AHscB.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.