{"version":3,"file":"merge-root-slot-props-to-component-prop-4e8318ab.cjs","sources":["../../node_modules/ramda/es/mergeWithKey.js","../src/utils/merge-root-slot-props-to-component-prop.ts"],"sourcesContent":["import _curry3 from \"./internal/_curry3.js\";\nimport _has from \"./internal/_has.js\";\n/**\n * Creates a new object with the own properties of the two provided objects. If\n * a key exists in both objects, the provided function is applied to the key\n * and the values associated with the key in each object, with the result being\n * used as the value associated with the key in the returned object.\n *\n * @func\n * @memberOf R\n * @since v0.19.0\n * @category Object\n * @sig ((String, a, a) -> a) -> {a} -> {a} -> {a}\n * @param {Function} fn\n * @param {Object} l\n * @param {Object} r\n * @return {Object}\n * @see R.mergeDeepWithKey, R.merge, R.mergeWith\n * @example\n *\n *      let concatValues = (k, l, r) => k == 'values' ? R.concat(l, r) : r\n *      R.mergeWithKey(concatValues,\n *                     { a: true, thing: 'foo', values: [10, 20] },\n *                     { b: true, thing: 'bar', values: [15, 35] });\n *      //=> { a: true, b: true, thing: 'bar', values: [10, 20, 15, 35] }\n * @symb R.mergeWithKey(f, { x: 1, y: 2 }, { y: 5, z: 3 }) = { x: 1, y: f('y', 2, 5), z: 3 }\n */\n\nvar mergeWithKey =\n/*#__PURE__*/\n_curry3(function mergeWithKey(fn, l, r) {\n  var result = {};\n  var k;\n  l = l || {};\n  r = r || {};\n\n  for (k in l) {\n    if (_has(k, l)) {\n      result[k] = _has(k, r) ? fn(k, l[k], r[k]) : l[k];\n    }\n  }\n\n  for (k in r) {\n    if (_has(k, r) && !_has(k, result)) {\n      result[k] = r[k];\n    }\n  }\n\n  return result;\n});\n\nexport default mergeWithKey;","import clsx from 'clsx';\nimport { mergeWithKey } from 'ramda';\n\ntype SlotProps =\n  | {\n      root?: any;\n    }\n  | undefined;\n\ntype ComponentProps = Record<string, any>;\n\nexport function concatClassNameOrTakeRight(\n  key: string,\n  l: any,\n  r: any,\n): string | undefined {\n  if (key === 'className') {\n    return clsx(l, r);\n  }\n  return l;\n}\n\nexport const mergeRootSlotPropsToComponentProps =\n  (resolveConflict = concatClassNameOrTakeRight) =>\n  (slotProps: SlotProps, componentProps: ComponentProps) => {\n    return mergeWithKey(resolveConflict, slotProps?.root ?? {}, componentProps);\n  };\n"],"names":["mergeWithKey","_curry3","fn","l","r","result","k","_has","mergeWithKey$1","concatClassNameOrTakeRight","key","clsx","mergeRootSlotPropsToComponentProps","resolveConflict","slotProps","componentProps"],"mappings":"qGA4BA,IAAIA,EAEJC,EAAO,QAAC,SAAsBC,EAAIC,EAAGC,EAAG,CACtC,IAAIC,EAAS,CAAA,EACTC,EACJH,EAAIA,GAAK,GACTC,EAAIA,GAAK,GAET,IAAKE,KAAKH,EACJI,EAAI,KAACD,EAAGH,CAAC,IACXE,EAAOC,CAAC,EAAIC,EAAAA,KAAKD,EAAGF,CAAC,EAAIF,EAAGI,EAAGH,EAAEG,CAAC,EAAGF,EAAEE,CAAC,CAAC,EAAIH,EAAEG,CAAC,GAIpD,IAAKA,KAAKF,EACJG,EAAAA,KAAKD,EAAGF,CAAC,GAAK,CAACG,OAAKD,EAAGD,CAAM,IAC/BA,EAAOC,CAAC,EAAIF,EAAEE,CAAC,GAInB,OAAOD,CACT,CAAC,EAED,MAAAG,EAAeR,ECxCC,SAAAS,EACdC,EACAP,EACAC,EACoB,CACpB,OAAIM,IAAQ,YACHC,EAAA,KAAKR,EAAGC,CAAC,EAEXD,CACT,CAEO,MAAMS,EACX,CAACC,EAAkBJ,IACnB,CAACK,EAAsBC,IACdf,EAAaa,GAAiBC,GAAA,YAAAA,EAAW,OAAQ,CAAA,EAAIC,CAAc","x_google_ignoreList":[0]}