1import{_ as y}from"./DDFF2FyD.js";import{_ as x}from"./D2gdOVh4.js";import{r as w,w as k,c as n,a as s,b as u,d as V,j as C,u as o,F as N,e as R,k as _,g as r,o as l,l as F,ad as P,t as A,s as B}from"#entry";import{u as S}from"./Bszxb-LH.js";import{u as j}from"./D92MQeL0.js";import{u as L}from"./lomDe3sa.js";import"./D92Y8eVZ.js";const T={class:"dashboard-body mt30"},D={class:"dashboard-box mt30 custom-card-form"},E={class:"custom-card-header d-flex align-items-center justify-content-between"},M={class:"add-new-btn"},U={class:"custom-card-body"},G={class:"row gy-4 mt-1"},I={class:"row gy-4 mt-1"},O={class:"form-group"},$=["id","value"],q=["for"],z={key:0},H={class:"custom-card-footer"},J={class:"form-group d-flex justify-content-end align-items-center g30"},K=["disabled"],Q={key:0,class:"fas fa-spinner fa-spin me-1"},as={__name:"create",async setup(W){let i,m;const t=S({name:"",selectedPermissions:[]}),c=w([]),{useOnlyFetch:f}=j();[i,m]=k(()=>f("/manage-permissions",{method:"get",onResponse:({response:d})=>{c.value=d._data}})),await i,m();const{toastSuccess:p}=L(),b=async()=>{await t.submit("/manage-roles").then(d=>{t.reset(),t.clear(),p("Role Created successfully."),B("/dashboard/manage-role")})};return(d,e)=>{const g=y,v=x;return l(),n("div",T,[s("div",D,[s("div",E,[e[3]||(e[3]=s("div",{class:"table-heading"},[s("h5",null,"Create a New Role")],-1)),s("div",M,[u(g,{to:{name:"dashboard-manage-role"},class:"gradient-btn"},{default:V(()=>[...e[2]||(e[2]=[s("i",{class:"fas fa-list"},null,-1),r(" Role List ",-1)])]),_:1})])]),e[8]||(e[8]=s("div",{class:"card-line"},null,-1)),s("form",{onSubmit:C(b,["prevent"])},[s("div",U,[s("div",G,[u(v,{col:"col-md-12",modelValue:o(t).name,"onUpdate:modelValue":e[0]||(e[0]=a=>o(t).name=a),error:o(t).errors.get("name"),label:"Role Name",placeholder:"Enter role name"},null,8,["modelValue","error"]),e[4]||(e[4]=s("div",{class:"table-heading mt-20"},[s("h5",null,"Assign Permission")],-1))]),s("div",I,[(l(!0),n(N,null,R(o(c),a=>(l(),n("div",{key:a.id,class:"col-sm-6 col-lg-3 col-md-4"},[s("div",O,[F(s("input",{type:"checkbox",id:a.id,class:"checkBox","onUpdate:modelValue":e[1]||(e[1]=h=>o(t).selectedPermissions=h),value:a.id},null,8,$),[[P,o(t).selectedPermissions]]),s("label",{for:a.id},[r(A(a.name)+" ",1),o(t).selectedPermissions.includes(a.id)?(l(),n("span",z,[...e[5]||(e[5]=[s("i",{class:"fa-solid fa-check"},null,-1)])])):_("",!0)],8,q)])]))),128))]),e[7]||(e[7]=s("div",{class:"card-line"},null,-1)),s("div",H,[s("div",J,[s("button",{type:"submit",disabled:o(t).busy,class:"gradient-btn"},[o(t).busy?(l(),n("i",Q)):_("",!0),e[6]||(e[6]=r(" Create Role ",-1))],8,K)])])])],32)])])}}};export{as as default};
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.