import{isFunction as o}from"./guards/is-function.js";import{isVariable as c}from"./guards/is-variable.js";import{isConditionalNode as s}from"./guards/is-conditional-node.js";function i(n){const t=n.parameters;if(typeof t!="object")return;const r=t?.[0],e=t?.[1];if(!(!c(r)||typeof e!="string")&&!(r.path?.[0]!=="rbac"||r.path?.[1]!=="teams"))return e}function m(n){const t=n.parameters,r=[];for(const e of Object.values(t)){if(!o(e)||e.name!=="includes")continue;const a=i(e);a&&r.push(a)}return r}function b(n){if(!s(n))return;const t=n.attributes.primary;if(o(t)){if(t.name==="or")return m(t);if(t.name==="includes"){const r=i(t);if(r)return[r]}}}export{b as extractRbacFromCondition};
