import{i as e,o as t,r as n}from"./button-DJ30HgDO.js";import{s as r}from"./chunk-EPOLDU6W-BGm2xlSj.js";import"./use-runtime-config-CkwqDzno.js";import{t as i}from"./use-api-CtLXpHJw.js";import"./user-service-BP86tdWK.js";import"./toast-context-val-mhxutRO0.js";import{t as a}from"./page-container-Bc69w3xC.js";import{g as o,h as s}from"./entity-service-CaH-DzP7.js";import"./search-input-NxGyN2TF.js";import"./icon-button-B94rCe__.js";import"./use-toast-ClFuYvU2.js";import"./input-CjHmXOIG.js";import"./grant-permission-modal-9wt78Azp.js";import{t as c}from"./entity-permissions-manager-ZitO1rzL.js";import"./use-all-users-xWwgC44i.js";import"./use-all-accounts-C0S7ZoyI.js";import"./use-all-groups-hBcU1U0V.js";var l=t(e(),1);function u({promptName:e}){let{data:t,isLoading:n,error:r,refetch:a}=i((0,l.useCallback)(t=>e===null?Promise.resolve([]):o(e,t),[e]));return{promptUserPermissions:t??[],isLoading:n,error:r,refresh:a}}function d({promptName:e}){let{data:t,isLoading:n,error:r,refetch:a}=i((0,l.useCallback)(t=>e===null?Promise.resolve([]):s(e,t),[e]));return{promptGroupPermissions:t??[],isLoading:n,error:r,refresh:a}}var f=t(n(),1);function p(){let{promptName:e}=r(),{isLoading:t,error:n,refresh:i,promptUserPermissions:o}=u({promptName:e||null}),{isLoading:s,error:l,refresh:p,promptGroupPermissions:m}=d({promptName:e||null}),h=t||s,g=n||l,_=()=>{i(),p()},v=[...o||[],...m||[]];return e?(0,f.jsx)(a,{title:`Permissions for Prompt ${e}`,children:(0,f.jsx)(c,{resourceId:e,resourceName:e,resourceType:`prompts`,permissions:v,isLoading:h,error:g,refresh:_})}):(0,f.jsx)(`div`,{children:`Prompt Name is required.`})}export{p as default};