/*
 * 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-tsx-wctag-nested";const DESCRIPTION="The following JET components cannot be nested: <oj-data-grid>, <oj-list-view>, <oj-table>, <oj-tree-view>, <oj-stream-list>, and <oj-waterfall-layout>";const SHORT_DESCRIPTION="Cannot nest <oj-data-grid>, <oj-list-view>, <oj-table>, <oj-tree-view>, <oj-stream-list>, and <oj-waterfall-layout>";const COMP_LIST=["oj-list-view","oj-table","oj-stream-list","oj-waterfall-layout","oj-tree-view","oj-data-grid"];const BODY="body";const OJ_SELECT_SINGLE="oj-select-single";class Rule{getName(){return RULENAME}getDescription(){return DESCRIPTION}getShortDescription(){return SHORT_DESCRIPTION}register(regCtx){this._metaLib=regCtx.utils.metaLib;return{TsxWebComponent:this._onWC}}_onWC(ruleCtx,tsxComp){var tagName,ar,issue,i;tagName=tsxComp.name;if(COMP_LIST.includes(tagName)){ar=tsxComp.elemStack;for(i=ar.length-1;i>=0;i--){let entryName=ar[i].name;if(entryName===OJ_SELECT_SINGLE||this._metaLib.isInterfaceImplemented(tagName,"SelectSingleElement")){break}if(entryName===tagName){issue=new ruleCtx.Issue(`Nesting of <${tagName}> is not supported`);ruleCtx.reporter.addIssue(issue,ruleCtx);break}else if(entryName===BODY){break}}}}};module.exports=Rule;