import e from"postcss-value-parser";import{hasFallback as o}from"@csstools/utilities";const t=["woff","truetype","opentype","woff2","embedded-opentype","collection","svg"],creator=r=>{const s="preserve"in Object(r)&&Boolean(r?.preserve);return{postcssPlugin:"postcss-font-format-keywords",Declaration(r){if("src"!==r.prop.toLowerCase())return;if(!r.value.toLowerCase().includes("format("))return;if(o(r))return;const a=r.parent;if(!a||"atrule"!==a.type)return;if("font-face"!==a.name.toLowerCase())return;const n=e(r.value);n.walk(o=>{"function"===o.type&&"format"===o.value.toLowerCase()&&o.nodes.forEach(o=>{"word"===o.type&&t.includes(o.value.toLowerCase())&&(o.value=e.stringify({type:"string",value:o.value,quote:'"'}))})}),n.toString()!==r.value&&(r.cloneBefore({value:n.toString()}),s||r.remove())}}};creator.postcss=!0;export{creator as default,creator as"module.exports"};
