import e from"postcss-value-parser";function onCSSDeclaration(o,r,s){const n=o.prop.toLowerCase().match(t)?.[1];if(!n)return;let a;try{a=e(o.value)}catch(e){o.warn(r,`Failed to parse value '${o.value}'. Leaving the original value intact.`)}if(void 0===a)return;let l=[];l=a.nodes.length?a.nodes.filter((e=>"word"===e.type||"function"===e.type)).map((t=>e.stringify(t))):[e.stringify(a.nodes)],o.cloneBefore({prop:`align-${n}`,value:l[0]}),o.cloneBefore({prop:`justify-${n}`,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};
