"use strict";(self.webpackChunk=self.webpackChunk||[]).push([["scoped-access-token-selector"],{"./web_src/js/components/ScopedAccessTokenSelector.vue":function(L,l,o){o.d(l,{default:function(){return k}});var e=o("./node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js"),t=o("./node_modules/@vue/shared/dist/shared.esm-bundler.js"),r=o("./web_src/js/utils/dom.ts");const i=["for"],a={class:"gitea-select"},d=["id"],p={value:""},m=["value"],_=["value"];var v=(0,e.pM)({__name:"ScopedAccessTokenSelector",props:{isAdmin:{type:Boolean},noAccessLabel:{},readLabel:{},writeLabel:{}},setup(b){const f=b,h=(0,e.EW)(()=>{const s=["activitypub"];return f.isAdmin&&s.push("admin"),s.push("issue","misc","notification","organization","package","repository","user"),s});(0,e.sV)(()=>{document.querySelector("#scoped-access-submit").addEventListener("click",u)}),(0,e.hi)(()=>{document.querySelector("#scoped-access-submit").removeEventListener("click",u)});function u(s){s.preventDefault();const n=document.querySelector("#scoped-access-warning");for(const c of document.querySelectorAll(".access-token-select"))if(c.value){(0,r.y9)(n),document.querySelector("#scoped-access-form").submit();return}(0,r.fi)(n)}return(s,n)=>((0,e.uX)(!0),(0,e.CE)(e.FK,null,(0,e.pI)(h.value,c=>((0,e.uX)(),(0,e.CE)("div",{key:c,class:"field tw-pl-1 tw-pb-1 access-token-category"},[(0,e.Lk)("label",{class:"category-label",for:"access-token-scope-"+c},(0,t.v_)(c),9,i),(0,e.Lk)("div",a,[(0,e.Lk)("select",{class:"ui selection access-token-select",name:"scope",id:"access-token-scope-"+c},[(0,e.Lk)("option",p,(0,t.v_)(s.noAccessLabel),1),(0,e.Lk)("option",{value:"read:"+c},(0,t.v_)(s.readLabel),9,m),(0,e.Lk)("option",{value:"write:"+c},(0,t.v_)(s.writeLabel),9,_)],8,d)])]))),128))}}),k=v}}]);
