{"version":3,"file":"resolve-hash-class-DuqLJq6S.cjs","names":[],"sources":["../src/resolve-hash-class.ts"],"sourcesContent":["import type { CSSProperties, StylesApi, TypeStylesApi } from 'typestyles';\n\n/** Styles host for the css prop / TypeStylesProvider. */\nexport type CssStylesHost = Pick<TypeStylesApi, 'hash'> | StylesApi;\n\nexport type HashClassFn = (properties: CSSProperties, label?: string) => string;\n\n/** Normalize `hash` (createTypeStyles) and `hashClass` (createStyles). */\nexport function resolveHashClass(api: CssStylesHost): HashClassFn {\n  if ('hash' in api && typeof api.hash === 'function') {\n    return (properties, label) => api.hash(properties, { label });\n  }\n  return (api as StylesApi).hashClass;\n}\n"],"mappings":";AAQA,SAAgB,iBAAiB,KAAiC;CAChE,IAAI,UAAU,OAAO,OAAO,IAAI,SAAS,YACvC,QAAQ,YAAY,UAAU,IAAI,KAAK,YAAY,EAAE,MAAM,CAAC;CAE9D,OAAQ,IAAkB;AAC5B"}