import e from"../../../stylelint/lib/index.mjs";import r from"../../../../_virtual/sortNodeProperties.mjs";import{isProperty as o}from"../../utils/isProperty.mjs";import{checkOrder as t}from"./checkOrder.mjs";import{getNodeData as i}from"./getNodeData.mjs";import{createFlatOrder as s}from"./createFlatOrder.mjs";import{ruleName as m}from"./ruleName.mjs";import{messages as n}from"./messages.mjs";function d({node:d,primaryOption:p,unspecified:a,result:f,expectedOrder:c}){let l=!1;function u(r){d.nodes.filter(e=>o(e)).map(e=>i(e,c)).forEach((o,i,s)=>{if(0===i)return;const d=s[i-1],p=t({firstPropertyData:d,secondPropertyData:o,unspecified:a,allPropertiesData:s.slice(0,i)});if(!p.isCorrect){const{orderData:o}=p.secondNode;e.utils.report({message:n.expected(p.secondNode.name,p.firstNode.name,o&&o.groupName),node:p.secondNode.node,result:f,ruleName:m,fix:r})}})}u(function(){if(l)return;r(d,{order:s(p),unspecifiedPropertiesPosition:"ignore"===a?"bottom":a}),l=!0,u()})}export{d as checkNodeForOrder};