1import{T as C,q as V,o as d,f as $,g as h,a as s,t as n,j as f,h as b,u as m,i as j,k as B,n as N,c,e as x,F as _,w as S,s as z}from"./app-aac69b09.js";import F from"./App-f05946c4.js";import{F as M}from"./FormInput-f8357eea.js";import"./Sidebar-b4f7d4c1.js";import"./Menu-851a3e7b.js";import"./ProfileModal-3ee70226.js";import"./FormPhoneInput-cc03fc34.js";import"./FormSelect-354c04f0.js";import"./hidden-1b89de74.js";import"./use-text-value-e57c466b.js";import"./transition-7eda090c.js";import"./LangToggle-9d812314.js";import"./adminLogoMediaUrl-db5c489e.js";import"./MobileSidebar-da41193a.js";import"./useRtl-88190dc3.js";const U={class:"bg-white md:bg-inherit pt-0 px-4 md:pt-8 md:p-8 rounded-[5px] text-[#000] overflow-y-scroll"},E={class:"md:flex justify-between hidden"},O={class:"text-xl mb-1"},Z={class:"mb-6 flex items-center text-sm leading-6 text-gray-600"},P={class:"ml-1 mt-1"},A={class:"sm:flex border-b py-5"},D={class:"sm:w-[40%] mb-1"},T={class:"text-sm text-gray-500 tracking-[0px]"},W={class:"sm:w-[60%] sm:flex space-x-6"},q={class:"sm:w-[80%]"},I={class:"flex py-5"},L={class:"hidden sm:block w-[40%] mb-1"},G={class:"text-sm text-gray-500 tracking-[0px]"},H={class:"flex text-xs mt-2"},J={class:"sm:w-[60%] flex space-x-6"},K={class:"sm:w-[80%]"},Q={class:"text-sm"},R={class:"grid grid-cols-2 sm:grid-cols-3 mt-2"},X={class:"flex h-6 items-center mr-2"},Y=["onUpdate:modelValue","id","name"],ss={class:"text-sm leading-6"},es=["for"],ts={class:"py-6"},os={type:"submit",class:"float-right flex items-center space-x-4 rounded-md bg-black px-3 py-2 text-sm text-white shadow-sm hover:bg-slate-600 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600"},vs={__name:"Show",props:{title:String,role:Object,modules:Object,permissions:Object},setup(v){var u;const a=v,i=C({name:(u=a.role)==null?void 0:u.name,permissions:Object.fromEntries(a.modules.map(e=>[e.name,{}]))}),g=e=>e?e.split(",").map(t=>t.trim()).filter(Boolean):[],p=e=>e.split("_").map(l=>l.charAt(0).toUpperCase()+l.slice(1)).join(" "),w=()=>{a.modules.forEach(e=>{const t=e.name;a.permissions.filter(l=>l.module===t).forEach(l=>{const r=(l.action||"").trim();i.permissions[t]||(i.permissions[t]={}),i.permissions[t][r]=!0})})},k=async()=>{const e=a.role?window.location.pathname:"/admin/team/roles";i[a.role?"put":"post"](e,{preserveScroll:!0})};return V(()=>{w()}),(e,t)=>(d(),$(F,null,{default:h(()=>[s("div",U,[s("div",E,[s("div",null,[s("h1",O,n(e.$t("Create role")),1),s("p",Z,[t[2]||(t[2]=s("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24"},[s("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 11v5m0 5a9 9 0 1 1 0-18a9 9 0 0 1 0 18Zm.05-13v.1h-.1V8h.1Z"})],-1)),s("span",P,n(e.$t("Create roles for administrative users")),1)])]),s("div",null,[f(m(j),{href:"/admin/team/roles",class:"rounded-md bg-indigo-600 px-3 py-2 text-sm text-white shadow-sm hover:bg-indigo-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600"},{default:h(()=>[b(n(e.$t("Back")),1)]),_:1})])]),s("form",{onSubmit:t[1]||(t[1]=B(o=>k(),["prevent"])),class:"bg-white md:border py-5 px-5 rounded-[0.5rem]"},[s("div",A,[s("div",D,[s("h1",T,n(e.$t("Name")),1)]),s("div",W,[s("div",q,[f(M,{modelValue:m(i).name,"onUpdate:modelValue":t[0]||(t[0]=o=>m(i).name=o),type:"text",error:m(i).errors.name,class:N("w-full"),labelClass:"mb-0"},null,8,["modelValue","error"])])])]),s("div",I,[s("div",L,[s("h1",G,n(e.$t("Permissions")),1),s("span",H,[t[3]||(t[3]=s("svg",{xmlns:"http://www.w3.org/2000/svg",width:"15",height:"15",viewBox:"0 0 24 24"},[s("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 11v5m0 5a9 9 0 1 1 0-18a9 9 0 0 1 0 18Zm.05-13v.1h-.1V8h.1Z"})],-1)),b(" "+n(e.$t("Choose the appropriate permissions for this role")),1)])]),s("div",J,[s("div",K,[(d(!0),c(_,null,x(a.modules,(o,l)=>(d(),c("div",{class:"mb-4",key:l},[s("label",Q,n(e.$t(p(o.name))),1),s("div",R,[(d(!0),c(_,null,x(g(o.actions),r=>(d(),c("div",{key:r,class:"relative flex mb-2"},[s("div",X,[S(s("input",{"onUpdate:modelValue":y=>m(i).permissions[o.name][r]=y,id:"permission["+o.name+"|"+r+"]",name:"permission["+o.name+"|"+r+"]",type:"checkbox",class:"h-4 w-4 roun
1ded border-gray-300 text-indigo-600 focus:ring-indigo-600"},null,8,Y),[[z,m(i).permissions[o.name][r]]])]),s("div",ss,[s("label",{for:"permission["+o.name+"|"+r+"]",class:"font-medium text-gray-900"},n(e.$t(p(r))),9,es)])]))),128))])]))),128))])])]),s("div",ts,[s("button",os,n(e.$t("Save")),1)])],32)])]),_:1}))}};export{vs 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.