import e from"postcss-value-parser";function onCSSDeclaration(o,r,s){const a=o.prop.toLowerCase().match(t)[1];let n;try{n=e(o.value)}catch(e){o.warn(r,`Failed to parse value '${o.value}'. Leaving the original value intact.`)}if(void 0===n)return;let l=[];l=n.nodes.length?n.nodes.filter((e=>"word"===e.type||"function"===e.type)).map((t=>e.stringify(t))):[e.stringify(n)],o.cloneBefore({prop:`align-${a}`,value:l[0]}),o.cloneBefore({prop:`justify-${a}`,value:l[1]||l[0]}),s.preserve||o.remove()}const t=/^place-(content|items|self)/,creator=e=>{const o=Object.assign({preserve:!0},e);return{postcssPlugin:"postcss-place",Declaration:(e,{result:r})=>{t.test(e.prop.toLowerCase())&&onCSSDeclaration(e,r,o)}}};creator.postcss=!0;export{creator as default};
