import{a7 as m,j as e,a8 as p,T as v,b1 as D,h as A,S as b}from"./vendor-ClLR6ncd.js";import{aM as L,q as M,aN as P,aO as y,aP as C,m as S,C as T,aQ as W,G as _,L as k,M as E,c as x,p as h}from"./index-OtVJl4GC.js";import{E as c}from"./Messages-BRmQDxrZ.js";import{W as H}from"./WarningMessage-4TK5GdCH.js";import{B as I}from"./Box-Co2WcNPC.js";import{L as w}from"./Link-BLwKPJFF.js";var u={},O=p;Object.defineProperty(u,"__esModule",{value:!0});var g=u.default=void 0,$=O(m()),N=e;g=u.default=(0,$.default)((0,N.jsx)("path",{d:"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2m-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2m3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1 1.71 0 3.1 1.39 3.1 3.1z"}),"Lock");var l={},R=p;Object.defineProperty(l,"__esModule",{value:!0});var j=l.default=void 0,q=R(m()),z=e;j=l.default=(0,q.default)((0,z.jsx)("path",{d:"m12.126 8.125 1.937-1.937 3.747 3.747-1.937 1.938zM20.71 5.63l-2.34-2.34a1 1 0 0 0-1.41 0l-1.83 1.83 3.75 3.75L20.71 7a1 1 0 0 0 0-1.37M2 5l6.63 6.63L3 17.25V21h3.75l5.63-5.62L18 21l2-2L4 3z"}),"EditOff");function Y({readable:s,writable:r,Container:i=I,containerStyle:a}){const t=T({readable:s,writable:r});return e.jsx(v,{title:t,children:e.jsxs(i,{style:a,children:[s?null:e.jsx(g,{}),r?null:e.jsx(j,{})]})})}function d({Component:s,componentProps:r,children:i,useDisableHook:a,title:t,style:n}){const o=a();return e.jsx(E,{title:o?t:void 0,children:e.jsx(s,{...r,disabled:o||r.disabled,style:{height:"100%",...n},children:i})})}function V(){return x(h.session)}function Z(s){return e.jsx(d,{...s,useDisableHook:V,title:"User misses session permission to perform the action"})}function B(){return x(h.eval)}function ee(s){return e.jsx(d,{...s,useDisableHook:B,title:"User misses eval permission to perform the action"})}function se(s){return e.jsx(d,{...s,useDisableHook:S,title:C})}function f({warningMessage:s,children:r,containerSx:i}){return e.jsxs(b,{spacing:1,alignItems:"flex-start",sx:i,children:[e.jsx(H,{variant:"h6",text:s}),r]})}function re({pageName:s,Component:r,containerSx:i}){return function(){const{title:t}=D()||{},n=s||t,o=L();return o.isLoading?null:o.isError?e.jsx(c,{error:o.error}):o.data?e.jsx(r,{}):e.jsxs(f,{warningMessage:`${n} is not available in the free hosted AllegroGraph version.`,containerSx:i,children:[e.jsx(A,{children:"If you'd like to try it out, you can download and install a free standalone AllegroGraph from our website:"}),e.jsx(w,{target:"_blank",href:"https://franz.com/agraph/downloads/?ui=new",children:"https://franz.com/agraph/downloads/?ui=new"})]})}}function G({containerSx:s,pageName:r="the page"}){const i=M();return e.jsx(f,{warningMessage:`User ${i.username} doesn't have sufficient permissions to access ${r}`,containerSx:s})}function ie(s,r,i,a){return function(){const{permissions:n}=P();return n.isLoading?null:n.isError?e.jsx(c,{error:n.error}):y(n.data,r)?e.jsx(i,{}):e.jsx(G,{pageName:s,containerSx:a})}}function te(s,r,i){return function(){const{access:t}=W(),n=r(),o=_();return t.isLoading?e.jsx(k,{}):t.isError?e.jsx(c,{error:t.error}):n?e.jsx(f,{warningMessage:i,containerSx:o}):e.jsx(s,{})}}export{ie as A,se as D,Y as L,G as N,te as W,re as a,ee as b,Z as c};
