"use strict";var e=require("postcss-selector-parser");const t=e().astSync(":link").nodes[0],s=e().astSync(":visited").nodes[0],n=e().astSync("area[href]").nodes[0],o=e().astSync("[href]").nodes[0];function replaceAnyLink(e,t,s,n){const o=[],r=[];try{for(let t=0;t{const r=[];if(e.walkPseudos((e=>{if(":not"===e.value.toLowerCase())return!1;if(":any-link"!==e.value.toLowerCase()||e.nodes&&e.nodes.length)return;if(!l)return void r.push([t.clone(),s.clone()]);const c=getTagElementsNextToPseudo(e);c.includes("area")?r.push([t.clone(),s.clone(),o.clone()]):c.length?r.push([t.clone(),s.clone()]):r.push([t.clone(),s.clone(),n.clone()])})),!r.length)return;cartesianProduct(...r).forEach((t=>{const s=e.clone();s.walkPseudos((e=>{":any-link"!==e.value.toLowerCase()||e.nodes&&e.nodes.length||(insertNode(e.parent,e,t.shift()),e.remove())})),c.push(s.toString())}))})).processSync(r),c}function cartesianProduct(...e){const t=[],s=e.length-1;return function helper(n,o){for(let r=0,l=e[o].length;r=0&&("combinator"!==t.nodes[s].type&&!e.isPseudoElement(t.nodes[s].type));s--)r=s;if("tag"!==o){for(let s=c;s{const t={preserve:e?.preserve??!0,subFeatures:{areaHrefNeedsFixing:e?.subFeatures?.areaHrefNeedsFixing??!1}};return{postcssPlugin:"postcss-pseudo-class-any-link",prepare(){const e=new WeakSet;return{postcssPlugin:"postcss-pseudo-class-any-link",Rule(s,{result:n}){if(!s.selector.toLowerCase().includes(":any-link"))return;if(e.has(s))return;if((s.raws.selector&&s.raws.selector.raw||s.selector).endsWith(":"))return;replaceAnyLink(s,n,t.preserve,t.subFeatures.areaHrefNeedsFixing)&&e.add(s)}}}}};creator.postcss=!0,module.exports=creator;