{"version":3,"sources":["../src/sx.js","../src/keyframes.js","../src/createUseThemeProps.js","../src/createExtendSxProp.js","../src/useTheme.js","../src/globalCss.js"],"names":["resolveProps"],"mappings":";;;;;;;;;;;;;;;;AAAe,SAAR,EAAoB,CAAA,aAAA,EAAe,EAAE,SAAA,EAAW,OAAS,EAAA;AAC9D,EAAA,IAAI,OAAU,GAAA,EAAA;AACd,EAAA,IAAI,SAAS,EAAC;AAEd,EAAA,SAAS,UAAU,OAAS,EAAA;AAC1B,IAAA,IAAI,OAAS,EAAA;AACX,MAAA,OAAA,IAAW,GAAG,OAAO,OAAA,KAAY,QAAW,GAAA,OAAA,GAAU,QAAQ,SAAS,CAAA,CAAA,CAAA;AACvE,MAAA,MAAA,GAAS,kCACJ,MACC,CAAA,EAAA,OAAA,IAAW,OAAO,OAAY,KAAA,QAAA,GAAW,QAAQ,IAAO,GAAA,KAAA,CAAA,CAAA;AAAA;AAEhE;AAGF,EAAI,IAAA,KAAA,CAAM,OAAQ,CAAA,aAAa,CAAG,EAAA;AAChC,IAAc,aAAA,CAAA,OAAA,CAAQ,CAAC,OAAY,KAAA;AACjC,MAAA,SAAA,CAAU,OAAO,CAAA;AAAA,KAClB,CAAA;AAAA,GACI,MAAA;AACL,IAAA,SAAA,CAAU,aAAa,CAAA;AAAA;AAGzB,EAAA,MAAM,YAAY,EAAC;AAEnB,EAAA,IAAI,MAAQ,EAAA;AACV,IAAO,MAAA,CAAA,OAAA,CAAQ,MAAM,CAAA,CAAE,OAAQ,CAAA,CAAC,CAAC,WAAA,EAAa,CAAC,KAAA,EAAO,UAAU,CAAC,CAAM,KAAA;AACrE,MAAI,IAAA,OAAO,KAAU,KAAA,QAAA,IAAY,UAAY,EAAA;AAC3C,QAAU,SAAA,CAAA,CAAA,EAAA,EAAK,WAAW,CAAA,CAAE,CAAI,GAAA,KAAA;AAAA,OAC3B,MAAA;AACL,QAAA,SAAA,CAAU,CAAK,EAAA,EAAA,WAAW,CAAE,CAAA,CAAA,GAAI,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,OAAO,yBAAyB,WAAa,EAAA;AAC/C,IAAA;AAAA;AAEF,EAAA,MAAM,IAAI,KAAA;AAAA,IACR,GAAG,oBAAwB,CAAA,kPAAA;AAAA,GAC7B;AACF","file":"index.mjs","sourcesContent":["export default function sx(transformedSx, { className, style }) {\n  let sxClass = '';\n  let sxVars = {};\n\n  function iterateSx(element) {\n    if (element) {\n      sxClass += `${typeof element === 'string' ? element : element.className} `;\n      sxVars = {\n        ...sxVars,\n        ...(element && typeof element !== 'string' ? element.vars : undefined),\n      };\n    }\n  }\n\n  if (Array.isArray(transformedSx)) {\n    transformedSx.forEach((element) => {\n      iterateSx(element);\n    });\n  } else {\n    iterateSx(transformedSx);\n  }\n\n  const varStyles = {};\n\n  if (sxVars) {\n    Object.entries(sxVars).forEach(([cssVariable, [value, isUnitLess]]) => {\n      if (typeof value === 'string' || isUnitLess) {\n        varStyles[`--${cssVariable}`] = value;\n      } else {\n        varStyles[`--${cssVariable}`] = `${value}px`;\n      }\n    });\n  }\n\n  return {\n    className: `${sxClass.trim()}${className ? ` ${className}` : ''}`,\n    style: {\n      ...varStyles,\n      ...style,\n    },\n  };\n}\n","/**\n * `__wyw_dynamic_import` is a special global var that is set during the evaluation phase by wyw.\n * So during eval phase, it can happen that some code is calling the runtime function.\n * We do not want to throw error in that case as we want the evaluation to happen.\n */\nexport default function keyframes() {\n  if (typeof __wyw_dynamic_import !== 'undefined') {\n    return;\n  }\n  throw new Error(\n    `${process.env.PACKAGE_NAME}: You were trying to call \"keyframes\" function without configuring your bundler. Make sure to install the bundler specific plugin and use it. @pigment-css/vite-plugin for Vite integration or @pigment-css/nextjs-plugin for Next.js integration.`,\n  );\n}\n","import { internal_resolveProps as resolveProps } from '@mui/utils';\n\n/**\n * Runtime function for creating `useThemeProps`.\n * In the codebase, the first argument will be a string that represent the component slug (should match one of the `theme.components.*`).\n * Then, the transformation will replace the first argument with the `defaultProps` object if provided.\n */\nexport default function createUseThemeProps(nameOrDefaultProps) {\n  return function useThemeProps({ props }) {\n    if (typeof nameOrDefaultProps === 'string') {\n      // if no default props provided in the theme, return the props as is.\n      return props;\n    }\n    const defaultProps = nameOrDefaultProps;\n    // The same logic as in packages/mui-utils/src/resolveProps.ts\n    // TODO: consider reusing the logic from the utils package\n    const output = { ...props };\n\n    Object.keys(defaultProps).forEach((propName) => {\n      if (propName.toString().match(/^(components|slots)$/)) {\n        output[propName] = {\n          ...defaultProps[propName],\n          ...output[propName],\n        };\n      } else if (propName.toString().match(/^(componentsProps|slotProps)$/)) {\n        const defaultSlotProps = defaultProps[propName] || {};\n        const slotProps = props[propName];\n        output[propName] = {};\n\n        if (!slotProps || !Object.keys(slotProps)) {\n          // Reduce the iteration if the slot props is empty\n          output[propName] = defaultSlotProps;\n        } else if (!defaultSlotProps || !Object.keys(defaultSlotProps)) {\n          // Reduce the iteration if the default slot props is empty\n          output[propName] = slotProps;\n        } else {\n          output[propName] = { ...slotProps };\n          Object.keys(defaultSlotProps).forEach((slotPropName) => {\n            output[propName][slotPropName] = resolveProps(\n              defaultSlotProps[slotPropName],\n              slotProps[slotPropName],\n            );\n          });\n        }\n      } else if (output[propName] === undefined) {\n        output[propName] = defaultProps[propName];\n      }\n    });\n\n    return output;\n  };\n}\n","/**\n * Runtime function for creating `extendSxProp`.\n *\n * This is a placeholder for the runtime function for replacing the `extendSxProp` in Material UI\n * to reduce bundle size only. DO NOT use it in your codebase.\n */\nfunction extendSxProp(props) {\n  return { ...props };\n}\nexport default function createExtendSxProp() {\n  return extendSxProp;\n}\n","/**\n * `__wyw_dynamic_import` is a special global var that is set during the evaluation phase by wyw.\n * So during eval phase, it can happen that some code is calling the runtime function.\n * We do not want to throw error in that case as we want the evaluation to happen.\n */\nexport default function useTheme() {\n  if (typeof __wyw_dynamic_import !== 'undefined') {\n    return;\n  }\n  throw new Error(\n    `${process.env.PACKAGE_NAME}: You were trying to call \"useTheme\" function without configuring your bundler. Make sure to install the bundler specific plugin and use it. @pigment-css/vite-plugin for Vite integration or @pigment-css/nextjs-plugin for Next.js integration.`,\n  );\n}\n","/**\n * `__wyw_dynamic_import` is a special global var that is set during the evaluation phase by wyw.\n * So during eval phase, it can happen that some code is calling the runtime function.\n * We do not want to throw error in that case as we want the evaluation to happen.\n */\nexport default function globalCss() {\n  if (typeof __wyw_dynamic_import !== 'undefined') {\n    return;\n  }\n  throw new Error(\n    `${process.env.PACKAGE_NAME}: You were trying to call \"globalCss\" function without configuring your bundler. Make sure to install the bundler specific plugin and use it. @pigment-css/vite-plugin for Vite integration or @pigment-css/nextjs-plugin for Next.js integration.`,\n  );\n}\n"]}