"use strict";var e=require("postcss-value-parser");function hasFallback(e){const r=e.parent;if(!r)return!1;const s=e.prop.toLowerCase(),t=r.index(e);for(let e=0;e<t;e++){const t=r.nodes[e];if("decl"===t.type&&t.prop.toLowerCase()===s)return!0}return!1}const r=/rebeccapurple/i,s=/^rebeccapurple$/i,creator=t=>{const o=Object.assign({preserve:!1},t);return{postcssPlugin:"postcss-color-rebeccapurple",Declaration(t){if(!r.test(t.value))return;if(hasFallback(t))return;const c=e(t.value);c.walk((e=>{"word"===e.type&&s.test(e.value)&&(e.value="#639")}));const a=String(c);a!==t.value&&(t.cloneBefore({value:a}),o.preserve||t.remove())}}};creator.postcss=!0,module.exports=creator;
