import e from"postcss-value-parser";var l=new Map([["block,flex","flex"],["block,flow","block"],["block,flow-root","flow-root"],["block,grid","grid"],["block,table","table"],["inline,block","inline-block"],["inline,flex","inline-flex"],["inline,flow","inline"],["inline,flow,list-item","inline list-item"],["inline,flow-root","inline-block"],["inline,grid","inline-grid"],["inline,ruby","ruby"],["inline,table","inline-table"],["list-item,block,flow","list-item"],["ruby-base,flow","ruby-base"],["ruby-text,flow","ruby-text"],["run-in,flow","run-in"],["table-caption,flow","table-caption"],["table-cell,flow","table-cell"]]);function transform(n){if(!n.trim())return n;const{nodes:i}=e(n);if(i.length<=1)return n;const t=i.filter(e=>"word"===e.type).map(e=>e.value.toLowerCase());if(t.length<=1)return n;const o=l.get(t.join(","));return o||n}const n=/^display$/i,i=/\b\s\b/,creator=e=>{const l=!("preserve"in Object(e))||Boolean(e?.preserve);return{postcssPlugin:"postcss-normalize-display-values",Declaration(e){if(!n.test(e.prop))return;const t=e.value;if(!t)return;if(!i.test(t))return;const o=transform(t);e.value!==o&&(e.cloneBefore({value:o}),l||e.remove())}}};creator.postcss=!0;export{creator as default};
