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