/*
 * Copyright (c) 2018, 2025, 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-unsup-theme";const SHORT_DESCRIPTION="Some web component elements and/or their attributes may not be supported in the specified JET theme";const DESCRIPTION=SHORT_DESCRIPTION+". Refer to the JET API documentation for the version being audited. "+"The theme used by the audit can be set by the JAF configuration property 'theme'.";class Rule{getName(){return RULENAME}getDescription(){return DESCRIPTION}getShortDescription(){return SHORT_DESCRIPTION}register(regCtx){this._theme=regCtx.config.theme;this._metaLib=regCtx.utils.metaLib;return{"webcomp":this._onWebComp}}_onWebComp(ruleCtx,tag){var issue,attribs,attrib;if(!this._metaLib.isTagSupportedInTheme(tag)){issue=new ruleCtx.Issue(`<${tag}> is not supported in theme '${this._theme}'`);ruleCtx.reporter.addIssue(issue,ruleCtx)}attribs=ruleCtx.tagNode.attribs;if(attribs){for(attrib in attribs){this._fnAttrib(ruleCtx,attrib)}}}_fnAttrib(ruleCtx,attrib){if(!this._metaLib.isAttrSupportedInTheme(ruleCtx.tag,attrib)){let issue,attrPos;issue=new ruleCtx.Issue(`<${ruleCtx.tag}> attribute '${attrib}' is not supported in theme '${this._theme}'`);attrPos=ruleCtx.utils.DomUtils.getAttribPosition(ruleCtx.data,ruleCtx.node,attrib);issue.setPosition(attrPos.row,attrPos.col,attrPos.start,attrPos.end);issue.setMsgKey(RULENAME+"_1");ruleCtx.reporter.addIssue(issue,ruleCtx)}}}module.exports=Rule;