{
  "version": 3,
  "sources": ["../../src/utils/color-values.js"],
  "sourcesContent": ["/**\n * Extracts the palette slug from a style value for any preset type, supporting\n * both the user preset format and the theme CSS-variable format:\n *\n * - User format:  `var:preset|<type>|slug`\n * - Theme format: `var(--wp--preset--<type>--slug)`\n *\n * Returns `undefined` for plain values, non-strings, or any other\n * unrecognised format.\n *\n * @param {*}                  rawValue Raw style value stored in the style object.\n * @param {'color'|'gradient'} type     Preset type, e.g. `'color'` or `'gradient'`.\n * @return {string|undefined} The palette slug, or undefined.\n */\nexport function extractPresetSlug( rawValue, type ) {\n\tif ( typeof rawValue !== 'string' ) {\n\t\treturn undefined;\n\t}\n\tconst userPrefix = `var:preset|${ type }|`;\n\tif ( rawValue.startsWith( userPrefix ) ) {\n\t\treturn rawValue.slice( userPrefix.length );\n\t}\n\tconst cssVarPrefix = `--wp--preset--${ type }--`;\n\tconst themeFormatMatch = rawValue.match(\n\t\tnew RegExp( `^var\\\\(${ cssVarPrefix }([^)]+)\\\\)$` )\n\t);\n\treturn themeFormatMatch?.[ 1 ];\n}\n"],
  "mappings": ";AAcO,SAAS,kBAAmB,UAAU,MAAO;AACnD,MAAK,OAAO,aAAa,UAAW;AACnC,WAAO;AAAA,EACR;AACA,QAAM,aAAa,cAAe,IAAK;AACvC,MAAK,SAAS,WAAY,UAAW,GAAI;AACxC,WAAO,SAAS,MAAO,WAAW,MAAO;AAAA,EAC1C;AACA,QAAM,eAAe,iBAAkB,IAAK;AAC5C,QAAM,mBAAmB,SAAS;AAAA,IACjC,IAAI,OAAQ,UAAW,YAAa,aAAc;AAAA,EACnD;AACA,SAAO,mBAAoB,CAAE;AAC9B;",
  "names": []
}
