/*
 * 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 OJ="oj-";const MSG_TEXT="unknown JET CSS selector ";function getName(){return"jet-css-ojselector"};function getShortDescription(){return"JET CSS selector must be a defined JET style"};function getDescription(){return"JET CSS selector must be a defined JET style"};function register(){return{"selector":_handleSelector}};function _handleSelector(context,selectors){var selector,part,i,j;for(i=0;i<selectors.length;i++){selector=selectors[i];for(j=0;j<selector.parts.length;j++){part=selector.parts[j];if(part.type===8){_handleParts(context,part)}}}};function _handleParts(context,part){var auditState,modifier,args,arg,mods,mod,clazz,classNoDot,comment,msg,i,j,k,p;for(i=0;i<part.modifiers.length;i++){modifier=part.modifiers[i];if(modifier.type==="class"){clazz=modifier.text;classNoDot=clazz.substring(1);if(classNoDot.startsWith(OJ)){if(!context.metaLib.isStyle(classNoDot)){msg=MSG_TEXT+clazz;issue=new context.Issue(msg,context,{line:modifier.line,col:modifier.col});context.reporter.addIssue(issue,context);continue}}}else{if(!(modifier.args&&modifier.args.length))continue;args=modifier.args;for(j=0;j<args.length;j++){arg=args[j];if(arg.type===8){if(arg.modifiers&&arg.modifiers.length){mods=arg.modifiers;for(k=0;k<mods.length;k++){mod=mods[k];if(mod.type==="class"){clazz=mod.text;classNoDot=clazz.substring(1);if(classNoDot.startsWith(OJ)){if(!context.metaLib.isStyle(classNoDot)){msg=MSG_TEXT+clazz;issue=new context.Issue(msg,context,{line:modifier.line,col:modifier.col});context.reporter.addIssue(issue,context)}}}}}}}}}};module.exports.getName=getName;module.exports.getDescription=getDescription;module.exports.getShortDescription=getShortDescription;module.exports.register=register;