You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 line
9.8 KiB

{"ast":null,"code":"var TouchHistoryMath = {\n centroidDimension: function centroidDimension(touchHistory, touchesChangedAfter, isXAxis, ofCurrent) {\n var touchBank = touchHistory.touchBank;\n var total = 0;\n var count = 0;\n var oneTouchData = touchHistory.numberActiveTouches === 1 ? touchHistory.touchBank[touchHistory.indexOfSingleActiveTouch] : null;\n if (oneTouchData !== null) {\n if (oneTouchData.touchActive && oneTouchData.currentTimeStamp > touchesChangedAfter) {\n total += ofCurrent && isXAxis ? oneTouchData.currentPageX : ofCurrent && !isXAxis ? oneTouchData.currentPageY : !ofCurrent && isXAxis ? oneTouchData.previousPageX : oneTouchData.previousPageY;\n count = 1;\n }\n } else {\n for (var i = 0; i < touchBank.length; i++) {\n var touchTrack = touchBank[i];\n if (touchTrack !== null && touchTrack !== undefined && touchTrack.touchActive && touchTrack.currentTimeStamp >= touchesChangedAfter) {\n var toAdd = void 0;\n if (ofCurrent && isXAxis) {\n toAdd = touchTrack.currentPageX;\n } else if (ofCurrent && !isXAxis) {\n toAdd = touchTrack.currentPageY;\n } else if (!ofCurrent && isXAxis) {\n toAdd = touchTrack.previousPageX;\n } else {\n toAdd = touchTrack.previousPageY;\n }\n total += toAdd;\n count++;\n }\n }\n }\n return count > 0 ? total / count : TouchHistoryMath.noCentroid;\n },\n currentCentroidXOfTouchesChangedAfter: function currentCentroidXOfTouchesChangedAfter(touchHistory, touchesChangedAfter) {\n return TouchHistoryMath.centroidDimension(touchHistory, touchesChangedAfter, true, true);\n },\n currentCentroidYOfTouchesChangedAfter: function currentCentroidYOfTouchesChangedAfter(touchHistory, touchesChangedAfter) {\n return TouchHistoryMath.centroidDimension(touchHistory, touchesChangedAfter, false, true);\n },\n previousCentroidXOfTouchesChangedAfter: function previousCentroidXOfTouchesChangedAfter(touchHistory, touchesChangedAfter) {\n return TouchHistoryMath.centroidDimension(touchHistory, touchesChangedAfter, true, false);\n },\n previousCentroidYOfTouchesChangedAfter: function previousCentroidYOfTouchesChangedAfter(touchHistory, touchesChangedAfter) {\n return TouchHistoryMath.centroidDimension(touchHistory, touchesChangedAfter, false, false);\n },\n currentCentroidX: function currentCentroidX(touchHistory) {\n return TouchHistoryMath.centroidDimension(touchHistory, 0, true, true);\n },\n currentCentroidY: function currentCentroidY(touchHistory) {\n return TouchHistoryMath.centroidDimension(touchHistory, 0, false, true);\n },\n noCentroid: -1\n};\nexport default TouchHistoryMath;","map":{"version":3,"names":["TouchHistoryMath","centroidDimension","touchHistory","touchesChangedAfter","isXAxis","ofCurrent","touchBank","total","count","oneTouchData","numberActiveTouches","indexOfSingleActiveTouch","touchActive","currentTimeStamp","currentPageX","currentPageY","previousPageX","previousPageY","i","length","touchTrack","undefined","toAdd","noCentroid","currentCentroidXOfTouchesChangedAfter","currentCentroidYOfTouchesChangedAfter","previousCentroidXOfTouchesChangedAfter","previousCentroidYOfTouchesChangedAfter","currentCentroidX","currentCentroidY"],"sources":["/Users/thomaschazot/Documents/But2A/LaSuperMeteo/iut-expo-starter/node_modules/react-native-web/dist/vendor/react-native/TouchHistoryMath/index.js"],"sourcesContent":["/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @format\n */\nvar TouchHistoryMath = {\n /**\n * This code is optimized and not intended to look beautiful. This allows\n * computing of touch centroids that have moved after `touchesChangedAfter`\n * timeStamp. You can compute the current centroid involving all touches\n * moves after `touchesChangedAfter`, or you can compute the previous\n * centroid of all touches that were moved after `touchesChangedAfter`.\n *\n * @param {TouchHistoryMath} touchHistory Standard Responder touch track\n * data.\n * @param {number} touchesChangedAfter timeStamp after which moved touches\n * are considered \"actively moving\" - not just \"active\".\n * @param {boolean} isXAxis Consider `x` dimension vs. `y` dimension.\n * @param {boolean} ofCurrent Compute current centroid for actively moving\n * touches vs. previous centroid of now actively moving touches.\n * @return {number} value of centroid in specified dimension.\n */\n centroidDimension: function centroidDimension(touchHistory, touchesChangedAfter, isXAxis, ofCurrent) {\n var touchBank = touchHistory.touchBank;\n var total = 0;\n var count = 0;\n var oneTouchData = touchHistory.numberActiveTouches === 1 ? touchHistory.touchBank[touchHistory.indexOfSingleActiveTouch] : null;\n\n if (oneTouchData !== null) {\n if (oneTouchData.touchActive && oneTouchData.currentTimeStamp > touchesChangedAfter) {\n total += ofCurrent && isXAxis ? oneTouchData.currentPageX : ofCurrent && !isXAxis ? oneTouchData.currentPageY : !ofCurrent && isXAxis ? oneTouchData.previousPageX : oneTouchData.previousPageY;\n count = 1;\n }\n } else {\n for (var i = 0; i < touchBank.length; i++) {\n var touchTrack = touchBank[i];\n\n if (touchTrack !== null && touchTrack !== undefined && touchTrack.touchActive && touchTrack.currentTimeStamp >= touchesChangedAfter) {\n var toAdd = void 0; // Yuck, program temporarily in invalid state.\n\n if (ofCurrent && isXAxis) {\n toAdd = touchTrack.currentPageX;\n } else if (ofCurrent && !isXAxis) {\n toAdd = touchTrack.currentPageY;\n } else if (!ofCurrent && isXAxis) {\n toAdd = touchTrack.previousPageX;\n } else {\n toAdd = touchTrack.previousPageY;\n }\n\n total += toAdd;\n count++;\n }\n }\n }\n\n return count > 0 ? total / count : TouchHistoryMath.noCentroid;\n },\n currentCentroidXOfTouchesChangedAfter: function currentCentroidXOfTouchesChangedAfter(touchHistory, touchesChangedAfter) {\n return TouchHistoryMath.centroidDimension(touchHistory, touchesChangedAfter, true, // isXAxis\n true // ofCurrent\n );\n },\n currentCentroidYOfTouchesChangedAfter: function currentCentroidYOfTouchesChangedAfter(touchHistory, touchesChangedAfter) {\n return TouchHistoryMath.centroidDimension(touchHistory, touchesChangedAfter, false, // isXAxis\n true // ofCurrent\n );\n },\n previousCentroidXOfTouchesChangedAfter: function previousCentroidXOfTouchesChangedAfter(touchHistory, touchesChangedAfter) {\n return TouchHistoryMath.centroidDimension(touchHistory, touchesChangedAfter, true, // isXAxis\n false // ofCurrent\n );\n },\n previousCentroidYOfTouchesChangedAfter: function previousCentroidYOfTouchesChangedAfter(touchHistory, touchesChangedAfter) {\n return TouchHistoryMath.centroidDimension(touchHistory, touchesChangedAfter, false, // isXAxis\n false // ofCurrent\n );\n },\n currentCentroidX: function currentCentroidX(touchHistory) {\n return TouchHistoryMath.centroidDimension(touchHistory, 0, // touchesChangedAfter\n true, // isXAxis\n true // ofCurrent\n );\n },\n currentCentroidY: function currentCentroidY(touchHistory) {\n return TouchHistoryMath.centroidDimension(touchHistory, 0, // touchesChangedAfter\n false, // isXAxis\n true // ofCurrent\n );\n },\n noCentroid: -1\n};\nexport default TouchHistoryMath;"],"mappings":"AAQA,IAAIA,gBAAgB,GAAG;EAiBrBC,iBAAiB,EAAE,SAASA,iBAAiB,CAACC,YAAY,EAAEC,mBAAmB,EAAEC,OAAO,EAAEC,SAAS,EAAE;IACnG,IAAIC,SAAS,GAAGJ,YAAY,CAACI,SAAS;IACtC,IAAIC,KAAK,GAAG,CAAC;IACb,IAAIC,KAAK,GAAG,CAAC;IACb,IAAIC,YAAY,GAAGP,YAAY,CAACQ,mBAAmB,KAAK,CAAC,GAAGR,YAAY,CAACI,SAAS,CAACJ,YAAY,CAACS,wBAAwB,CAAC,GAAG,IAAI;IAEhI,IAAIF,YAAY,KAAK,IAAI,EAAE;MACzB,IAAIA,YAAY,CAACG,WAAW,IAAIH,YAAY,CAACI,gBAAgB,GAAGV,mBAAmB,EAAE;QACnFI,KAAK,IAAIF,SAAS,IAAID,OAAO,GAAGK,YAAY,CAACK,YAAY,GAAGT,SAAS,IAAI,CAACD,OAAO,GAAGK,YAAY,CAACM,YAAY,GAAG,CAACV,SAAS,IAAID,OAAO,GAAGK,YAAY,CAACO,aAAa,GAAGP,YAAY,CAACQ,aAAa;QAC/LT,KAAK,GAAG,CAAC;MACX;IACF,CAAC,MAAM;MACL,KAAK,IAAIU,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGZ,SAAS,CAACa,MAAM,EAAED,CAAC,EAAE,EAAE;Q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