{"version":3,"names":["_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","call","TypeError","Number","Easing","withDelay","withSequence","withTiming","ReduceMotion","getReduceMotionFromConfig","InnerKeyframe","constructor","definitions","System","delay","delayV","delayFunction","getDelayFunction","keyframes","initialValues","parseDefinitions","callback","callbackV","animations","addAnimation","keyframePoints","length","animation","duration","easing","linear","map","keyframePoint","includes","transform","push","split","keys","forEach","transformProp","index","transformPropKey","makeKeyframeKey","parsedKeyframes","from","Error","to","styleProp","Array","isArray","transformStyle","durationV","animationKeyPoints","getAnimationDuration","currentKeyPoint","maxDuration","currentDuration","reduce","acc","addKeyPoint","_ref","filter","parseInt","sort","a","b","keyPoint","keyframe","addKeyPointWith","durationMs","delayMs","withCallback","reduceMotion","reduceMotionV","_","Keyframe"],"sources":["Keyframe.ts"],"sourcesContent":["'use strict';\nimport type { EasingFunction } from '../../Easing';\nimport { Easing } from '../../Easing';\nimport { withDelay, withSequence, withTiming } from '../../animation';\nimport type {\n AnimationFunction,\n EntryExitAnimationFunction,\n IEntryExitAnimationBuilder,\n KeyframeProps,\n StylePropsWithArrayTransform,\n} from './commonTypes';\nimport type { StyleProps } from '../../commonTypes';\nimport type { TransformArrayItem } from '../../helperTypes';\nimport { ReduceMotion } from '../../commonTypes';\nimport { getReduceMotionFromConfig } from '../../animation/util';\n\ninterface KeyframePoint {\n duration: number;\n value: number | string;\n easing?: EasingFunction;\n}\ninterface ParsedKeyframesDefinition {\n initialValues: StyleProps;\n keyframes: Record;\n}\nclass InnerKeyframe implements IEntryExitAnimationBuilder {\n durationV?: number;\n delayV?: number;\n reduceMotionV: ReduceMotion = ReduceMotion.System;\n callbackV?: (finished: boolean) => void;\n definitions: Record;\n\n /*\n Keyframe definition should be passed in the constructor as the map\n which keys are between range 0 - 100 (%) and correspond to the point in the animation progress.\n */\n constructor(definitions: Record) {\n this.definitions = definitions;\n }\n\n private parseDefinitions(): ParsedKeyframesDefinition {\n /* \n Each style property contain an array with all their key points: \n value, duration of transition to that value, and optional easing function (defaults to Linear)\n */\n const parsedKeyframes: Record = {};\n /*\n Parsing keyframes 'from' and 'to'.\n */\n if (this.definitions.from) {\n if (this.definitions['0']) {\n throw new Error(\n \"[Reanimated] You cannot provide both keyframe 0 and 'from' as they both specified initial values.\"\n );\n }\n this.definitions['0'] = this.definitions.from;\n delete this.definitions.from;\n }\n if (this.definitions.to) {\n if (this.definitions['100']) {\n throw new Error(\n \"[Reanimated] You cannot provide both keyframe 100 and 'to' as they both specified values at the end of the animation.\"\n );\n }\n this.definitions['100'] = this.definitions.to;\n delete this.definitions.to;\n }\n /* \n One of the assumptions is that keyframe 0 is required to properly set initial values.\n Every other keyframe should contain properties from the set provided as initial values.\n */\n if (!this.definitions['0']) {\n throw new Error(\n \"[Reanimated] Please provide 0 or 'from' keyframe with initial state of your object.\"\n );\n }\n const initialValues: StyleProps = this.definitions['0'] as StyleProps;\n /*\n Initialize parsedKeyframes for properties provided in initial keyframe\n */\n Object.keys(initialValues).forEach((styleProp: string) => {\n if (styleProp === 'transform') {\n if (!Array.isArray(initialValues.transform)) {\n return;\n }\n initialValues.transform.forEach((transformStyle, index) => {\n Object.keys(transformStyle).forEach((transformProp: string) => {\n parsedKeyframes[makeKeyframeKey(index, transformProp)] = [];\n });\n });\n } else {\n parsedKeyframes[styleProp] = [];\n }\n });\n\n const duration: number = this.durationV ? this.durationV : 500;\n const animationKeyPoints: Array = Array.from(\n Object.keys(this.definitions)\n );\n\n const getAnimationDuration = (\n key: string,\n currentKeyPoint: number\n ): number => {\n const maxDuration = (currentKeyPoint / 100) * duration;\n const currentDuration = parsedKeyframes[key].reduce(\n (acc: number, value: KeyframePoint) => acc + value.duration,\n 0\n );\n return maxDuration - currentDuration;\n };\n\n /* \n Other keyframes can't contain properties that were not specified in initial keyframe.\n */\n const addKeyPoint = ({\n key,\n value,\n currentKeyPoint,\n easing,\n }: {\n key: string;\n value: string | number;\n currentKeyPoint: number;\n easing?: EasingFunction;\n }): void => {\n if (!(key in parsedKeyframes)) {\n throw new Error(\n \"[Reanimated] Keyframe can contain only that set of properties that were provide with initial values (keyframe 0 or 'from')\"\n );\n }\n parsedKeyframes[key].push({\n duration: getAnimationDuration(key, currentKeyPoint),\n value,\n easing,\n });\n };\n animationKeyPoints\n .filter((value: string) => parseInt(value) !== 0)\n .sort((a: string, b: string) => parseInt(a) - parseInt(b))\n .forEach((keyPoint: string) => {\n if (parseInt(keyPoint) < 0 || parseInt(keyPoint) > 100) {\n throw new Error(\n '[Reanimated] Keyframe should be in between range 0 - 100.'\n );\n }\n const keyframe: KeyframeProps = this.definitions[keyPoint];\n const easing = keyframe.easing;\n delete keyframe.easing;\n const addKeyPointWith = (key: string, value: string | number) =>\n addKeyPoint({\n key,\n value,\n currentKeyPoint: parseInt(keyPoint),\n easing,\n });\n Object.keys(keyframe).forEach((key: string) => {\n if (key === 'transform') {\n if (!Array.isArray(keyframe.transform)) {\n return;\n }\n keyframe.transform.forEach((transformStyle, index) => {\n Object.keys(transformStyle).forEach((transformProp: string) => {\n addKeyPointWith(\n makeKeyframeKey(index, transformProp),\n transformStyle[\n transformProp as keyof typeof transformStyle\n ] as number | string // Here we assume that user has passed props of proper type.\n // I don't think it's worthwhile to check if he passed i.e. `Animated.Node`.\n );\n });\n });\n } else {\n addKeyPointWith(key, keyframe[key]);\n }\n });\n });\n return { initialValues, keyframes: parsedKeyframes };\n }\n\n duration(durationMs: number): InnerKeyframe {\n this.durationV = durationMs;\n return this;\n }\n\n delay(delayMs: number): InnerKeyframe {\n this.delayV = delayMs;\n return this;\n }\n\n withCallback(callback: (finsihed: boolean) => void): InnerKeyframe {\n this.callbackV = callback;\n return this;\n }\n\n reduceMotion(reduceMotionV: ReduceMotion): this {\n this.reduceMotionV = reduceMotionV;\n return this;\n }\n\n private getDelayFunction(): AnimationFunction {\n const delay = this.delayV;\n const reduceMotion = this.reduceMotionV;\n return delay\n ? // eslint-disable-next-line @typescript-eslint/no-shadow\n (delay, animation) => {\n 'worklet';\n return withDelay(delay, animation, reduceMotion);\n }\n : (_, animation) => {\n 'worklet';\n animation.reduceMotion = getReduceMotionFromConfig(reduceMotion);\n return animation;\n };\n }\n\n build = (): EntryExitAnimationFunction => {\n const delay = this.delayV;\n const delayFunction = this.getDelayFunction();\n const { keyframes, initialValues } = this.parseDefinitions();\n const callback = this.callbackV;\n\n return () => {\n 'worklet';\n const animations: StylePropsWithArrayTransform = {};\n\n /* \n For each style property, an animations sequence is created that corresponds with its key points.\n Transform style properties require special handling because of their nested structure.\n */\n const addAnimation = (key: string) => {\n const keyframePoints = keyframes[key];\n // in case if property was only passed as initial value\n if (keyframePoints.length === 0) {\n return;\n }\n const animation = delayFunction(\n delay,\n keyframePoints.length === 1\n ? withTiming(keyframePoints[0].value, {\n duration: keyframePoints[0].duration,\n easing: keyframePoints[0].easing\n ? keyframePoints[0].easing\n : Easing.linear,\n })\n : withSequence(\n ...keyframePoints.map((keyframePoint: KeyframePoint) =>\n withTiming(keyframePoint.value, {\n duration: keyframePoint.duration,\n easing: keyframePoint.easing\n ? keyframePoint.easing\n : Easing.linear,\n })\n )\n )\n );\n if (key.includes('transform')) {\n if (!('transform' in animations)) {\n animations.transform = [];\n }\n animations.transform!.push({\n [key.split(':')[1]]: animation,\n });\n } else {\n animations[key] = animation;\n }\n };\n Object.keys(initialValues).forEach((key: string) => {\n if (key.includes('transform')) {\n initialValues[key].forEach(\n (transformProp: Record, index: number) => {\n Object.keys(transformProp).forEach((transformPropKey: string) => {\n addAnimation(makeKeyframeKey(index, transformPropKey));\n });\n }\n );\n } else {\n addAnimation(key);\n }\n });\n return {\n animations,\n initialValues,\n callback,\n };\n };\n };\n}\n\nfunction makeKeyframeKey(index: number, transformProp: string) {\n 'worklet';\n return `${index}_transform:${transformProp}`;\n}\n\n// TODO TYPESCRIPT This is a temporary type to get rid of .d.ts file.\nexport declare class ReanimatedKeyframe {\n constructor(definitions: Record);\n duration(durationMs: number): ReanimatedKeyframe;\n delay(delayMs: number): ReanimatedKeyframe;\n reduceMotion(reduceMotionV: ReduceMotion): ReanimatedKeyframe;\n withCallback(callback: (finished: boolean) => void): ReanimatedKeyframe;\n}\n\n// TODO TYPESCRIPT This temporary cast is to get rid of .d.ts file.\nexport const Keyframe = InnerKeyframe as unknown as typeof ReanimatedKeyframe;\n"],"mappings":"AAAA,YAAY;;AAAC,SAAAA,gBAAAC,GAAA,EAAAC,GAAA,EAAAC,KAAA,IAAAD,GAAA,GAAAE,cAAA,CAAAF,GAAA,OAAAA,GAAA,IAAAD,GAAA,IAAAI,MAAA,CAAAC,cAAA,CAAAL,GAAA,EAAAC,GAAA,IAAAC,KAAA,EAAAA,KAAA,EAAAI,UAAA,QAAAC,YAAA,QAAAC,QAAA,oBAAAR,GAAA,CAAAC,GAAA,IAAAC,KAAA,WAAAF,GAAA;AAAA,SAAAG,eAAAM,GAAA,QAAAR,GAAA,GAAAS,YAAA,CAAAD,GAAA,2BAAAR,GAAA,gBAAAA,GAAA,GAAAU,MAAA,CAAAV,GAAA;AAAA,SAAAS,aAAAE,KAAA,EAAAC,IAAA,eAAAD,KAAA,iBAAAA,KAAA,kBAAAA,KAAA,MAAAE,IAAA,GAAAF,KAAA,CAAAG,MAAA,CAAAC,WAAA,OAAAF,IAAA,KAAAG,SAAA,QAAAC,GAAA,GAAAJ,IAAA,CAAAK,IAAA,CAAAP,KAAA,EAAAC,IAAA,2BAAAK,GAAA,sBAAAA,GAAA,YAAAE,SAAA,4DAAAP,IAAA,gBAAAF,MAAA,GAAAU,MAAA,EAAAT,KAAA;AAEb,SAASU,MAAM,QAAQ,cAAc;AACrC,SAASC,SAAS,EAAEC,YAAY,EAAEC,UAAU,QAAQ,iBAAiB;AAUrE,SAASC,YAAY,QAAQ,mBAAmB;AAChD,SAASC,yBAAyB,QAAQ,sBAAsB;AAWhE,MAAMC,aAAa,CAAuC;EAOxD;AACF;AACA;AACA;EACEC,WAAWA,CAACC,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