{"ast":null,"code":"import _defineProperty2 from \"@babel/runtime/helpers/defineProperty\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nimport _classCallCheck from \"@babel/runtime/helpers/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/createClass\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/assertThisInitialized\";\nimport _inherits from \"@babel/runtime/helpers/inherits\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/getPrototypeOf\";\nvar _excluded = [\"style\"];\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty2(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n return _extends.apply(this, arguments);\n}\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}\nimport Animated from \"react-native-web/dist/exports/Animated\";\nimport Easing from \"react-native-web/dist/exports/Easing\";\nimport StyleSheet from \"react-native-web/dist/exports/StyleSheet\";\nimport View from \"react-native-web/dist/exports/View\";\nimport GenericTouchable, { TOUCHABLE_STATE } from \"./GenericTouchable\";\nimport * as React from 'react';\nimport { Component } from 'react';\nvar TouchableOpacity = function (_Component) {\n _inherits(TouchableOpacity, _Component);\n var _super = _createSuper(TouchableOpacity);\n function TouchableOpacity() {\n var _this;\n _classCallCheck(this, TouchableOpacity);\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n _this = _super.call.apply(_super, [this].concat(args));\n _defineProperty(_assertThisInitialized(_this), \"getChildStyleOpacityWithDefault\", function () {\n var childStyle = StyleSheet.flatten(_this.props.style) || {};\n return childStyle.opacity == null ? 1 : childStyle.opacity;\n });\n _defineProperty(_assertThisInitialized(_this), \"opacity\", new Animated.Value(_this.getChildStyleOpacityWithDefault()));\n _defineProperty(_assertThisInitialized(_this), \"setOpacityTo\", function (value, duration) {\n var _this$props$useNative;\n Animated.timing(_this.opacity, {\n toValue: value,\n duration: duration,\n easing: Easing.inOut(Easing.quad),\n useNativeDriver: (_this$props$useNative = _this.props.useNativeAnimations) !== null && _this$props$useNative !== void 0 ? _this$props$useNative : true\n }).start();\n });\n _defineProperty(_assertThisInitialized(_this), \"onStateChange\", function (_from, to) {\n if (to === TOUCHABLE_STATE.BEGAN) {\n _this.setOpacityTo(_this.props.activeOpacity, 0);\n } else if (to === TOUCHABLE_STATE.UNDETERMINED || to === TOUCHABLE_STATE.MOVED_OUTSIDE) {\n _this.setOpacityTo(_this.getChildStyleOpacityWithDefault(), 150);\n }\n });\n return _this;\n }\n _createClass(TouchableOpacity, [{\n key: \"render\",\n value: function render() {\n var _this$props = this.props,\n _this$props$style = _this$props.style,\n style = _this$props$style === void 0 ? {} : _this$props$style,\n rest = _objectWithoutProperties(_this$props, _excluded);\n return React.createElement(GenericTouchable, _extends({}, rest, {\n style: [style, {\n opacity: this.opacity\n }],\n onStateChange: this.onStateChange\n }), this.props.children ? this.props.children : React.createElement(View, null));\n }\n }]);\n return TouchableOpacity;\n}(Component);\nexport { TouchableOpacity as default };\n_defineProperty(TouchableOpacity, \"defaultProps\", _objectSpread(_objectSpread({}, GenericTouchable.defaultProps), {}, {\n activeOpacity: 0.2\n}));","map":{"version":3,"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,OAAOA,gBAAP,IACEC,eADF;AAIA,OAAO,KAAKC,KAAZ,MAAuB,OAAvB;AACA,SAASC,SAAT,QAA0B,OAA1B;AAAA,IASqBC,gBAAN;EAAA;EAAA;EAEb;IAAA;IAAA;IAAA;MAAAC;IAAA;IAAA;IAAAC,kFAOkC,YAAM;MACtC,IAAMC,UAAU,GAAGC,UAAU,CAACC,OAAX,CAAmB,MAAKC,KAAL,CAAWC,KAA9B,KAAwC,EAA3D;MACA,OAAOJ,UAAU,CAACK,OAAX,IAAsB,IAAtB,GAA6B,CAA7B,GAAiCL,UAAU,CAACK,OAAnD;IACD,CAVD;IAAAN,0DAYU,IAAIO,QAAQ,CAACC,KAAb,CAAmB,MAAKC,+BAAL,EAAnB,CAZV;IAAAT,+DAce,UAACU,KAAD,EAAgBC,QAAhB,EAAqC;MAAA;MAClDJ,QAAQ,CAACK,MAAT,CAAgB,MAAKN,OAArB,EAA8B;QAC5BO,OAAO,EAAEH,KADmB;QAE5BC,QAAQ,EAAEA,QAFkB;QAG5BG,MAAM,EAAEC,MAAM,CAACC,KAAP,CAAaD,MAAM,CAACE,IAApB,CAHoB;QAI5BC,eAAe,2BAAE,MAAKd,KAAL,CAAWe,mBAAb,yEAAoC;MAJvB,CAA9B,EAKGC,KALH;IAMD,CArBD;IAAApB,gEAuBgB,UAACqB,KAAD,EAAgBC,EAAhB,EAA+B;MAC7C,IAAIA,EAAE,KAAK3B,eAAe,CAAC4B,KAA3B,EAAkC;QAChC,MAAKC,YAAL,CAAkB,MAAKpB,KAAL,CAAWqB,aAA7B,EAA6C,CAA7C;MACD,CAFD,MAEO,IACLH,EAAE,KAAK3B,eAAe,CAAC+B,YAAvB,IACAJ,EAAE,KAAK3B,eAAe,CAACgC,aAFlB,EAGL;QACA,MAAKH,YAAL,CAAkB,MAAKf,+BAAL,EAAlB,EAA0D,GAA1D;MACD;IACF,CAhCD;IAAA;EAAA;EAAA;IAAA;IAAA,OAkCAmB,kBAAS;MACP,kBAAgC,KAAKxB,KAArC;QAAA,gCAAQC,KAAK;QAALA,KAAK,kCAAG,EAAV;QAAiBwB;MACvB,OACEjC,oBAACF,gBAAD,eACMmC,IADN;QAEExB,KAAK,EAAE,CACLA,KADK,EAEL;UACEC,OAAO,EAAE,KAAKA;QADhB,CAFK,CAFT;QAQEwB,aAAa,EAAE,KAAKA;MARtB,IASG,KAAK1B,KAAL,CAAW2B,QAAX,GAAsB,KAAK3B,KAAL,CAAW2B,QAAjC,GAA4CnC,oBAACoC,IAAD,OAT/C,CADF;IAaD;EAAA;EAAA;AAAA,EAnD2CnC,SAA/B;AAAA,SAAMC,gBAAN;gBAAMA,gB,kDAIdJ,gBAAgB,CAACuC,YADA;EAEpBR,aAAa,EAAE;AAAA,G","names":["GenericTouchable","TOUCHABLE_STATE","React","Component","TouchableOpacity","args","_defineProperty","childStyle","StyleSheet","flatten","props","style","opacity","Animated","Value","getChildStyleOpacityWithDefault","value","duration","timing","toValue","easing","Easing","inOut","quad","useNativeDriver","useNativeAnimations","start","_from","to","BEGAN","setOpacityTo","activeOpacity","UNDETERMINED","MOVED_OUTSIDE","render","rest","onStateChange","children","View","defaultProps"],"sources":["/Users/mathildejean/Documents/BUT/LaSuperMeteo/LaSuperMeteo/iut-expo-starter/node_modules/react-native-gesture-handler/lib/module/components/touchables/TouchableOpacity.tsx"],"sourcesContent":["import {\n Animated,\n Easing,\n StyleSheet,\n View,\n TouchableOpacityProps,\n} from 'react-native';\nimport GenericTouchable, {\n TOUCHABLE_STATE,\n GenericTouchableProps,\n} from './GenericTouchable';\nimport * as React from 'react';\nimport { Component } from 'react';\n\ninterface GHTouchableOpacityProps {\n useNativeAnimations?: boolean;\n}\n\n/**\n * TouchableOpacity bases on timing animation which has been used in RN's core\n */\nexport default class TouchableOpacity extends Component<\n TouchableOpacityProps & GenericTouchableProps & GHTouchableOpacityProps\n> {\n static defaultProps = {\n ...GenericTouchable.defaultProps,\n activeOpacity: 0.2,\n };\n\n // opacity is 1 one by default but could be overwritten\n getChildStyleOpacityWithDefault = () => {\n const childStyle = StyleSheet.flatten(this.props.style) || {};\n return childStyle.opacity == null ? 1 : childStyle.opacity;\n };\n\n opacity = new Animated.Value(this.getChildStyleOpacityWithDefault());\n\n setOpacityTo = (value: number, duration: number) => {\n Animated.timing(this.opacity, {\n toValue: value,\n duration: duration,\n easing: Easing.inOut(Easing.quad),\n useNativeDriver: this.props.useNativeAnimations ?? true,\n }).start();\n };\n\n onStateChange = (_from: number, to: number) => {\n if (to === TOUCHABLE_STATE.BEGAN) {\n this.setOpacityTo(this.props.activeOpacity!, 0);\n } else if (\n to === TOUCHABLE_STATE.UNDETERMINED ||\n to === TOUCHABLE_STATE.MOVED_OUTSIDE\n ) {\n this.setOpacityTo(this.getChildStyleOpacityWithDefault(), 150);\n }\n };\n\n render() {\n const { style = {}, ...rest } = this.props;\n return (\n \n {this.props.children ? this.props.children : }\n \n );\n }\n}\n"]},"metadata":{},"sourceType":"module","externalDependencies":[]}