import{j as i,d as p,r as w,b3 as C,ak as b}from"./index-BGoV7aa6.js";import{a as x}from"./useNetworkAcls-Cr7WQaRO.js";const j=({project:e,setSelectedAcls:a,selectedAcls:n,id:c="network-acl-selector",inheritedAcls:t,help:f,canSelectManualAcls:u=!0})=>{const{data:m=[]}=x(e),d=(o,s)=>o.map(l=>({label:s!=null&&s.includes(l)?`${l} (from network)`:l,value:l})),r=m.length>0,v=()=>{if(!u)return"-";if(!r)return"No ACLs available";if(r)return"Select ACLs"};return i.jsx(p.MultiSelect,{items:d(m.map(o=>o.name),t),disabled:!r||!u,selectedItems:d(n),variant:r?"condensed":"search",placeholder:v(),onItemsUpdate:o=>{a(o.map(s=>s.value))},showDropdownFooter:!1,id:c,disabledItems:t==null?void 0:t.map(o=>({label:o,value:o})),help:f})},N=e=>!!localStorage.getItem(`yamlNotificationClosed${e}`),k=e=>{localStorage.setItem(`yamlNotificationClosed${e}`,"yes")},E=({entity:e,docPath:a})=>{const[n,c]=w.useState(N(e));if(n)return null;const t=()=>{k(e),c(!0),setTimeout(()=>{window.dispatchEvent(new Event("resize"))},250)};return i.jsxs(p.Notification,{severity:"information",title:"YAML Configuration",onDismiss:t,actions:[i.jsxs(C,{docPath:a,children:["Learn more about ",b(e,2)]},"learn-more-link")],children:["This is the YAML representation of the ",e,"."]})};export{j as N,E as Y};
