{type:"func", params:[{name:"rec"}], body:{type:"block", exprs:[{type:"if", cond:{type:"not", operand:{type:"dotCall", target:{type:"var", name:"has"}, args:[{type:"var", name:"rec"}, {type:"literal", val:"dis"}]}}, ifExpr:{type:"block", exprs:[{type:"throw", expr:{type:"literal", val:"Must have a 'dis' tag"}}]}, elseExpr:{type:"if", cond:{type:"not", operand:{type:"dotCall", target:{type:"var", name:"has"}, args:[{type:"var", name:"rec"}, {type:"literal", val:"ruleFilter"}]}}, ifExpr:{type:"block", exprs:[{type:"throw", expr:{type:"literal", val:"Must have a 'ruleFilter' tag"}}]}, elseExpr:{type:"if", cond:{type:"not", operand:{type:"dotCall", target:{type:"var", name:"has"}, args:[{type:"var", name:"rec"}, {type:"literal", val:"targetFilter"}]}}, ifExpr:{type:"block", exprs:[{type:"throw", expr:{type:"literal", val:"Must have a 'targetFilter' tag"}}]}, elseExpr:{type:"if", cond:{type:"not", operand:{type:"dotCall", target:{type:"var", name:"has"}, args:[{type:"var", name:"rec"}, {type:"literal", val:"usernames"}]}}, ifExpr:{type:"block", exprs:[{type:"throw", expr:{type:"literal", val:"Must have a 'usernames' tag"}}]}}}}}, {type:"if", cond:{type:"not", operand:{type:"dotCall", target:{type:"var", name:"isStr"}, args:[{type:"trapCall", target:{type:"var", name:"trap"}, args:[{type:"var", name:"rec"}, {type:"literal", val:"dis"}]}]}}, ifExpr:{type:"block", exprs:[{type:"throw", expr:{type:"literal", val:"'dis' tag must be a string"}}]}, elseExpr:{type:"if", cond:{type:"not", operand:{type:"dotCall", target:{type:"var", name:"isStr"}, args:[{type:"trapCall", target:{type:"var", name:"trap"}, args:[{type:"var", name:"rec"}, {type:"literal", val:"ruleFilter"}]}]}}, ifExpr:{type:"block", exprs:[{type:"throw", expr:{type:"literal", val:"'ruleFilter' tag must be a string"}}]}, elseExpr:{type:"if", cond:{type:"not", operand:{type:"dotCall", target:{type:"var", name:"isStr"}, args:[{type:"trapCall", target:{type:"var", name:"trap"}, args:[{type:"var", name:"rec"}, {type:"literal", val:"targetFilter"}]}]}}, ifExpr:{type:"block", exprs:[{type:"throw", expr:{type:"literal", val:"'targetFilter' tag must be a string"}}]}, elseExpr:{type:"if", cond:{type:"not", operand:{type:"dotCall", target:{type:"var", name:"isStr"}, args:[{type:"trapCall", target:{type:"var", name:"trap"}, args:[{type:"var", name:"rec"}, {type:"literal", val:"usernames"}]}]}}, ifExpr:{type:"block", exprs:[{type:"throw", expr:{type:"literal", val:"'usernames' tag must be a string"}}]}}}}}, {type:"if", cond:{type:"dotCall", target:{type:"var", name:"isEmpty"}, args:[{type:"dotCall", target:{type:"var", name:"trim"}, args:[{type:"trapCall", target:{type:"var", name:"trap"}, args:[{type:"var", name:"rec"}, {type:"literal", val:"dis"}]}]}]}, ifExpr:{type:"block", exprs:[{type:"throw", expr:{type:"literal", val:"'dis' tag must not be blank"}}]}, elseExpr:{type:"if", cond:{type:"dotCall", target:{type:"var", name:"isEmpty"}, args:[{type:"dotCall", target:{type:"var", name:"trim"}, args:[{type:"trapCall", target:{type:"var", name:"trap"}, args:[{type:"var", name:"rec"}, {type:"literal", val:"ruleFilter"}]}]}]}, ifExpr:{type:"block", exprs:[{type:"throw", expr:{type:"literal", val:"'ruleFilter' tag must not be blank"}}]}, elseExpr:{type:"if", cond:{type:"dotCall", target:{type:"var", name:"isEmpty"}, args:[{type:"dotCall", target:{type:"var", name:"trim"}, args:[{type:"trapCall", target:{type:"var", name:"trap"}, args:[{type:"var", name:"rec"}, {type:"literal", val:"targetFilter"}]}]}]}, ifExpr:{type:"block", exprs:[{type:"throw", expr:{type:"literal", val:"'targetFilter' tag must not be blank"}}]}, elseExpr:{type:"if", cond:{type:"dotCall", target:{type:"var", name:"isEmpty"}, args:[{type:"dotCall", target:{type:"var", name:"trim"}, args:[{type:"trapCall", target:{type:"var", name:"trap"}, args:[{type:"var", name:"rec"}, {type:"literal", val:"usernames"}]}]}]}, ifExpr:{type:"block", exprs:[{type:"throw", expr:{type:"literal", val:"'usernames' tag must not be blank"}}]}}}}}, {type:"try", tryExpr:{type:"block", exprs:[{type:"call", target:{type:"var", name:"parseFilter"}, args:[{type:"trapCall", target:{type:"var", name:"trap"}, args:[{type:"var", name:"rec"}, {type:"literal", val:"ruleFilter"}]}]}]}, catchExpr:{type:"block", exprs:[{type:"throw", expr:{type:"literal", val:"Invalid ruleFilter"}}]}}, {type:"try", tryExpr:{type:"block", exprs:[{type:"call", target:{type:"var", name:"parseFilter"}, args:[{type:"trapCall", target:{type:"var", name:"trap"}, args:[{type:"var", name:"rec"}, {type:"literal", val:"targetFilter"}]}]}]}, catchExpr:{type:"block", exprs:[{type:"throw", expr:{type:"literal", val:"Invalid targetFilter"}}]}}, {type:"def", name:"rules", val:{type:"call", target:{type:"var", name:"readAll"}, args:[{type:"call", target:{type:"var", name:"parseFilter"}, args:[{type:"trapCall", target:{type:"var", name:"trap"}, args:[{type:"var", name:"rec"}, {type:"literal", val:"ruleFilter"}]}]}]}}, {type:"if", cond:{type:"dotCall", target:{type:"var", name:"isEmpty"}, args:[{type:"var", name:"rules"}]}, ifExpr:{type:"block", exprs:[{type:"throw", expr:{type:"literal", val:"No rules match the rule filter"}}]}, elseExpr:{type:"block", exprs:[{type:"if", cond:{type:"not", operand:{type:"dotCall", target:{type:"var", name:"all"}, args:[{type:"var", name:"rules"}, {type:"func", params:[{name:"r"}], body:{type:"dotCall", target:{type:"var", name:"has"}, args:[{type:"var", name:"r"}, {type:"literal", val:"rule"}]}}]}}, ifExpr:{type:"block", exprs:[{type:"throw", expr:{type:"literal", val:"Rule filter is returning records which are not rules"}}]}}]}}, {type:"def", name:"targets", val:{type:"call", target:{type:"var", name:"readAll"}, args:[{type:"call", target:{type:"var", name:"parseFilter"}, args:[{type:"trapCall", target:{type:"var", name:"trap"}, args:[{type:"var", name:"rec"}, {type:"literal", val:"targetFilter"}]}]}]}}, {type:"if", cond:{type:"dotCall", target:{type:"var", name:"isEmpty"}, args:[{type:"var", name:"targets"}]}, ifExpr:{type:"block", exprs:[{type:"throw", expr:{type:"literal", val:"No targets match the target filter"}}]}}, {type:"def", name:"usernames", val:{type:"dotCall", target:{type:"var", name:"findAll"}, args:[{type:"dotCall", target:{type:"var", name:"map"}, args:[{type:"dotCall", target:{type:"var", name:"split"}, args:[{type:"trapCall", target:{type:"var", name:"trap"}, args:[{type:"var", name:"rec"}, {type:"literal", val:"usernames"}]}, {type:"literal", val:","}]}, {type:"func", params:[{name:"u"}], body:{type:"dotCall", target:{type:"var", name:"trim"}, args:[{type:"var", name:"u"}]}}]}, {type:"func", params:[{name:"u"}], body:{type:"not", operand:{type:"dotCall", target:{type:"var", name:"isEmpty"}, args:[{type:"var", name:"u"}]}}}]}}, {type:"if", cond:{type:"dotCall", target:{type:"var", name:"isEmpty"}, args:[{type:"var", name:"usernames"}]}, ifExpr:{type:"block", exprs:[{type:"throw", expr:{type:"literal", val:"No usernames were found in the 'usernames' tag"}}]}}, {type:"dotCall", target:{type:"var", name:"each"}, args:[{type:"var", name:"usernames"}, {type:"func", params:[{name:"username"}], body:{type:"block", exprs:[{type:"try", tryExpr:{type:"block", exprs:[{type:"def", name:"user", val:{type:"call", target:{type:"var", name:"userRead"}, args:[{type:"call", target:{type:"var", name:"parseFilter"}, args:[{type:"add", lhs:{type:"literal", val:"username == "}, rhs:{type:"dotCall", target:{type:"var", name:"toAxonCode"}, args:[{type:"var", name:"username"}]}}]}]}}]}, catchExpr:{type:"block", exprs:[{type:"throw", expr:{type:"add", lhs:{type:"add", lhs:{type:"literal", val:"Invalid username '"}, rhs:{type:"var", name:"username"}}, rhs:{type:"literal", val:"'"}}}]}}]}}]}, {type:"dotCall", target:{type:"var", name:"each"}, args:[{type:"var", name:"usernames"}, {type:"func", params:[{name:"username"}], body:{type:"block", exprs:[{type:"def", name:"user", val:{type:"call", target:{type:"var", name:"userRead"}, args:[{type:"call", target:{type:"var", name:"parseFilter"}, args:[{type:"add", lhs:{type:"literal", val:"username == "}, rhs:{type:"dotCall", target:{type:"var", name:"toAxonCode"}, args:[{type:"var", name:"username"}]}}]}]}}, {type:"if", cond:{type:"not", operand:{type:"dotCall", target:{type:"var", name:"has"}, args:[{type:"var", name:"user"}, {type:"literal", val:"email"}]}}, ifExpr:{type:"block", exprs:[{type:"throw", expr:{type:"add", lhs:{type:"add", lhs:{type:"literal", val:"User "}, rhs:{type:"var", name:"username"}}, rhs:{type:"literal", val:" has no 'email' tag"}}}]}, elseExpr:{type:"block", exprs:[{type:"if", cond:{type:"not", operand:{type:"dotCall", target:{type:"var", name:"isStr"}, args:[{type:"trapCall", target:{type:"var", name:"trap"}, args:[{type:"var", name:"user"}, {type:"literal", val:"email"}]}]}}, ifExpr:{type:"block", exprs:[{type:"throw", expr:{type:"add", lhs:{type:"add", lhs:{type:"literal", val:"'email' tag for user "}, rhs:{type:"var", name:"username"}}, rhs:{type:"literal", val:" is not a string"}}}]}}]}}]}}]}]}}