{"version":3,"sources":["../../src/index.ts","../../src/primitives.ts","../../src/AnimatedStyle.ts","../../src/AnimatedTransform.ts"],"sourcesContent":["import { StyleSheet } from 'react-native'\nimport { createHost, AnimatedObject } from '@react-spring/animated'\nimport {\n  is,\n  Globals,\n  createStringInterpolator,\n  colors,\n} from '@react-spring/shared'\nimport { primitives } from './primitives'\nimport { WithAnimated } from './animated'\nimport { AnimatedStyle } from './AnimatedStyle'\n\nGlobals.assign({\n  batchedUpdates: require('react-native').unstable_batchedUpdates,\n  createStringInterpolator,\n  colors,\n})\n\nconst host = createHost(primitives, {\n  applyAnimatedValues(instance, props) {\n    if (is.und(props.children) && instance.setNativeProps) {\n      instance.setNativeProps(props)\n      return true\n    }\n    return false\n  },\n  createAnimatedStyle(styles) {\n    styles = StyleSheet.flatten(styles)\n    if (is.obj(styles.shadowOffset)) {\n      styles.shadowOffset = new AnimatedObject(styles.shadowOffset)\n    }\n    return new AnimatedStyle(styles)\n  },\n})\n\nexport const animated = host.animated as WithAnimated\nexport { animated as a }\n\nexport * from './animated'\nexport * from '@react-spring/core'\n","import {\n  Text,\n  View,\n  Image,\n  ImageProps,\n  ViewProps,\n  TextProps,\n} from 'react-native'\nimport { ComponentClass, ReactNode } from 'react'\n\nexport const primitives = {\n  View: View as ComponentClass<ViewProps & { children?: ReactNode }>,\n  Text: Text as ComponentClass<TextProps & { children?: ReactNode }>,\n  Image: Image as ComponentClass<ImageProps>,\n}\n","import { AnimatedObject } from '@react-spring/animated'\nimport { AnimatedTransform } from './AnimatedTransform'\n\ntype Style = object & { transform?: any }\n\nexport class AnimatedStyle extends AnimatedObject {\n  constructor(style: Style) {\n    super(style)\n  }\n\n  setValue(style: Style) {\n    super.setValue(\n      style && style.transform\n        ? { ...style, transform: new AnimatedTransform(style.transform) }\n        : style\n    )\n  }\n}\n","import { each, eachProp, getFluidValue } from '@react-spring/shared'\nimport { Animated, AnimatedValue, AnimatedObject } from '@react-spring/animated'\n\ntype Transform = { [key: string]: string | number | Animated }\n\ntype Source = Transform[]\n\nexport class AnimatedTransform extends AnimatedObject {\n  protected declare source: Source\n  constructor(source: Source) {\n    super(source)\n  }\n\n  getValue() {\n    return this.source\n      ? this.source.map(source => {\n          const transform: any = {}\n          eachProp(source, (source, key) => {\n            transform[key] = getFluidValue(source)\n          })\n          return transform\n        })\n      : []\n  }\n\n  setValue(source: Source) {\n    this.source = source\n    this.payload = this._makePayload(source)\n  }\n\n  protected _makePayload(source: Source) {\n    if (!source) return []\n    const payload = new Set<AnimatedValue>()\n    each(source, transform => eachProp(transform, this._addToPayload, payload))\n    return Array.from(payload)\n  }\n}\n"],"mappings":"2dAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,OAAAE,EAAA,aAAAA,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAA2B,wBAC3BC,EAA2C,kCAC3CC,EAKO,gCCPP,IAAAC,EAOO,wBAGMC,EAAa,CACxB,KAAM,OACN,KAAM,OACN,MAAO,OACT,ECdA,IAAAC,EAA+B,kCCA/B,IAAAC,EAA8C,gCAC9CC,EAAwD,kCAM3CC,EAAN,cAAgC,gBAAe,CAEpD,YAAYC,EAAgB,CAC1B,MAAMA,CAAM,CACd,CAEA,UAAW,CACT,OAAO,KAAK,OACR,KAAK,OAAO,IAAIA,GAAU,CACxB,IAAMC,EAAiB,CAAC,EACxB,qBAASD,EAAQ,CAACA,EAAQE,IAAQ,CAChCD,EAAUC,CAAG,KAAI,iBAAcF,CAAM,CACvC,CAAC,EACMC,CACT,CAAC,EACD,CAAC,CACP,CAEA,SAASD,EAAgB,CACvB,KAAK,OAASA,EACd,KAAK,QAAU,KAAK,aAAaA,CAAM,CACzC,CAEU,aAAaA,EAAgB,CACrC,GAAI,CAACA,EAAQ,MAAO,CAAC,EACrB,IAAMG,EAAU,IAAI,IACpB,iBAAKH,EAAQC,MAAa,YAASA,EAAW,KAAK,cAAeE,CAAO,CAAC,EACnE,MAAM,KAAKA,CAAO,CAC3B,CACF,ED/BO,IAAMC,EAAN,cAA4B,gBAAe,CAChD,YAAYC,EAAc,CACxB,MAAMA,CAAK,CACb,CAEA,SAASA,EAAc,CACrB,MAAM,SACJA,GAASA,EAAM,UACX,CAAE,GAAGA,EAAO,UAAW,IAAIC,EAAkBD,EAAM,SAAS,CAAE,EAC9DA,CACN,CACF,CACF,EFsBAE,EAAAC,EAAc,8BAvCd,gBAYA,UAAQ,OAAO,CACb,eAAgB,QAAQ,cAAc,EAAE,wBACxC,oDACA,eACF,CAAC,EAED,IAAMC,KAAO,cAAWC,EAAY,CAClC,oBAAoBC,EAAUC,EAAO,CACnC,OAAI,KAAG,IAAIA,EAAM,QAAQ,GAAKD,EAAS,gBACrCA,EAAS,eAAeC,CAAK,EACtB,IAEF,EACT,EACA,oBAAoBC,EAAQ,CAC1B,OAAAA,EAAS,aAAW,QAAQA,CAAM,EAC9B,KAAG,IAAIA,EAAO,YAAY,IAC5BA,EAAO,aAAe,IAAI,iBAAeA,EAAO,YAAY,GAEvD,IAAIC,EAAcD,CAAM,CACjC,CACF,CAAC,EAEYE,EAAWN,EAAK","names":["src_exports","__export","animated","__toCommonJS","import_react_native","import_animated","import_shared","import_react_native","primitives","import_animated","import_shared","import_animated","AnimatedTransform","source","transform","key","payload","AnimatedStyle","style","AnimatedTransform","__reExport","src_exports","host","primitives","instance","props","styles","AnimatedStyle","animated"]}