/*
 * Copyright (c) 2018, 2026, Oracle and/or its affiliates.
 * Licensed under The Universal Permissive License (UPL), Version 1.0
 * as shown at https://oss.oracle.com/licenses/upl/
 */
const RULENAME="oj-html-redwood-ojoption-disabled";const DESCRIPTION="By extending the profile 'redwood-strict', Redwood compliance is required by the Audit. Redwood "+"compliant designs do not allow individual child <oj-option> components of <oj-radioset> and <oj-checkboxset> "+"to be disabled, and should be removed.  If an option is not available for interaction by the user, it "+"should not be included in the set of options.";const SHORT_DESCRIPTION=DESCRIPTION;class Rule{getName(){return RULENAME}getDescription(){return DESCRIPTION}getShortDescription(){return SHORT_DESCRIPTION}register(){return{"<oj-checkboxset>":this._onComp,"<oj-radioset>":this._onComp}}_onComp(ruleCtx){var childs;if(childs=ruleCtx.tagNode.children){this._searchChildOptions(ruleCtx,childs)}}_searchChildOptions(ruleCtx,childs){var child,attribs,i;for(i=0;i<childs.length;i++){child=childs[i];if(child.type==="tag"&&child.name==="oj-option"){if((attribs=child.attribs)&&attribs.disabled){this._emitIssue(ruleCtx,child,attribs.disabled)}}else if(child.children&&child.children.length){this._searchChildOptions(ruleCtx,child.children)}}}_emitIssue(ruleCtx,child,attrib){var issue,pos;issue=new ruleCtx.Issue(`<oj-option> in <${ruleCtx.tagNode.name}> is disabled. Redwood compliant designs do not allow individual options to be disabled, and should be removed.`);pos=ruleCtx.utils.DomUtils.getAttribPosition(ruleCtx.data,child,"disabled");issue.setPosition(pos);ruleCtx.reporter.addIssue(issue,ruleCtx)}}module.exports=Rule;