{"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","ComplexAnimationBuilder","StretchInX","constructor","arguments","delayFunction","getDelayFunction","animation","config","getAnimationAndConfig","delay","getDelay","callback","callbackV","initialValues","animations","transform","scaleX","createInstance","StretchInY","scaleY","StretchOutX","StretchOutY"],"sources":["Stretch.ts"],"sourcesContent":["'use strict';\nimport type {\n IEntryExitAnimationBuilder,\n EntryExitAnimationFunction,\n} from '../animationBuilder/commonTypes';\nimport type { BaseAnimationBuilder } from '../animationBuilder';\nimport { ComplexAnimationBuilder } from '../animationBuilder';\n\n/**\n * Stretch animation on the X axis. You can modify the behavior by chaining methods like `.springify()` or `.duration(500)`.\n *\n * You pass it to the `entering` prop on [an Animated component](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/glossary#animated-component).\n *\n * @see https://docs.swmansion.com/react-native-reanimated/docs/layout-animations/entering-exiting-animations/#stretch\n */\nexport class StretchInX\n extends ComplexAnimationBuilder\n implements IEntryExitAnimationBuilder\n{\n static presetName = 'StretchInX';\n\n static createInstance(\n this: T\n ): InstanceType {\n return new StretchInX() as InstanceType;\n }\n\n build = (): EntryExitAnimationFunction => {\n const delayFunction = this.getDelayFunction();\n const [animation, config] = this.getAnimationAndConfig();\n const delay = this.getDelay();\n const callback = this.callbackV;\n const initialValues = this.initialValues;\n\n return () => {\n 'worklet';\n return {\n animations: {\n transform: [{ scaleX: delayFunction(delay, animation(1, config)) }],\n },\n initialValues: {\n transform: [{ scaleX: 0 }],\n ...initialValues,\n },\n callback,\n };\n };\n };\n}\n\n/**\n * Stretch animation on the Y axis. You can modify the behavior by chaining methods like `.springify()` or `.duration(500)`.\n *\n * You pass it to the `entering` prop on [an Animated component](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/glossary#animated-component).\n *\n * @see https://docs.swmansion.com/react-native-reanimated/docs/layout-animations/entering-exiting-animations/#stretch\n */\nexport class StretchInY\n extends ComplexAnimationBuilder\n implements IEntryExitAnimationBuilder\n{\n static presetName = 'StretchInY';\n\n static createInstance(\n this: T\n ): InstanceType {\n return new StretchInY() as InstanceType;\n }\n\n build = (): EntryExitAnimationFunction => {\n const delayFunction = this.getDelayFunction();\n const [animation, config] = this.getAnimationAndConfig();\n const delay = this.getDelay();\n const callback = this.callbackV;\n const initialValues = this.initialValues;\n\n return () => {\n 'worklet';\n return {\n animations: {\n transform: [{ scaleY: delayFunction(delay, animation(1, config)) }],\n },\n initialValues: {\n transform: [{ scaleY: 0 }],\n ...initialValues,\n },\n callback,\n };\n };\n };\n}\n\n/**\n * Stretch animation on the X axis. You can modify the behavior by chaining methods like `.springify()` or `.duration(500)`.\n *\n * You pass it to the `exiting` prop on [an Animated component](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/glossary#animated-component).\n *\n * @see https://docs.swmansion.com/react-native-reanimated/docs/layout-animations/entering-exiting-animations/#stretch\n */\nexport class StretchOutX\n extends ComplexAnimationBuilder\n implements IEntryExitAnimationBuilder\n{\n static presetName = 'StretchOutX';\n\n static createInstance(\n this: T\n ): InstanceType {\n return new StretchOutX() as InstanceType;\n }\n\n build = (): EntryExitAnimationFunction => {\n const delayFunction = this.getDelayFunction();\n const [animation, config] = this.getAnimationAndConfig();\n const delay = this.getDelay();\n const callback = this.callbackV;\n const initialValues = this.initialValues;\n\n return () => {\n 'worklet';\n return {\n animations: {\n transform: [{ scaleX: delayFunction(delay, animation(0, config)) }],\n },\n initialValues: {\n transform: [{ scaleX: 1 }],\n ...initialValues,\n },\n callback,\n };\n };\n };\n}\n\n/**\n * Stretch animation on the Y axis. You can modify the behavior by chaining methods like `.springify()` or `.duration(500)`.\n *\n * You pass it to the `exiting` prop on [an Animated component](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/glossary#animated-component).\n *\n * @see https://docs.swmansion.com/react-native-reanimated/docs/layout-animations/entering-exiting-animations/#stretch\n */\nexport class StretchOutY\n extends ComplexAnimationBuilder\n implements IEntryExitAnimationBuilder\n{\n static presetName = 'StretchOutY';\n\n static createInstance(\n this: T\n ): InstanceType {\n return new StretchOutY() as InstanceType;\n }\n\n build = (): EntryExitAnimationFunction => {\n const delayFunction = this.getDelayFunction();\n const [animation, config] = this.getAnimationAndConfig();\n const delay = this.getDelay();\n const callback = this.callbackV;\n const initialValues = this.initialValues;\n\n return () => {\n 'worklet';\n return {\n animations: {\n transform: [{ scaleY: delayFunction(delay, animation(0, config)) }],\n },\n initialValues: {\n transform: [{ scaleY: 1 }],\n ...initialValues,\n },\n callback,\n };\n };\n };\n}\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;AAMb,SAASU,uBAAuB,QAAQ,qBAAqB;;AAE7D;AACA;AACA;AACA;AACA;AACA;AACA;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