{"version":3,"sources":["./node_modules/@ionic/core/dist/esm/swipe-back-d2cdbf9a.js"],"names":[],"mappings":";;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAmD;AACC;;AAEpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+DAA+D,8DAAK;AACpE;AACA,WAAW,wEAAa;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEkC","file":"swipe-back-d2cdbf9a-js-es2015.js","sourcesContent":["import { c as clamp } from './helpers-46f4a262.js';\nimport { createGesture } from './index-c38df685.js';\n\nconst createSwipeBackGesture = (el, canStartHandler, onStartHandler, onMoveHandler, onEndHandler) => {\r\n const win = el.ownerDocument.defaultView;\r\n const canStart = (detail) => {\r\n return detail.startX <= 50 && canStartHandler();\r\n };\r\n const onMove = (detail) => {\r\n // set the transition animation's progress\r\n const delta = detail.deltaX;\r\n const stepValue = delta / win.innerWidth;\r\n onMoveHandler(stepValue);\r\n };\r\n const onEnd = (detail) => {\r\n // the swipe back gesture has ended\r\n const delta = detail.deltaX;\r\n const width = win.innerWidth;\r\n const stepValue = delta / width;\r\n const velocity = detail.velocityX;\r\n const z = width / 2.0;\r\n const shouldComplete = velocity >= 0 && (velocity > 0.2 || detail.deltaX > z);\r\n const missing = shouldComplete ? 1 - stepValue : stepValue;\r\n const missingDistance = missing * width;\r\n let realDur = 0;\r\n if (missingDistance > 5) {\r\n const dur = missingDistance / Math.abs(velocity);\r\n realDur = Math.min(dur, 540);\r\n }\r\n /**\r\n * TODO: stepValue can sometimes return negative values\r\n * or values greater than 1 which should not be possible.\r\n * Need to investigate more to find where the issue is.\r\n */\r\n onEndHandler(shouldComplete, (stepValue <= 0) ? 0.01 : clamp(0, stepValue, 0.9999), realDur);\r\n };\r\n return createGesture({\r\n el,\r\n gestureName: 'goback-swipe',\r\n gesturePriority: 40,\r\n threshold: 10,\r\n canStart,\r\n onStart: onStartHandler,\r\n onMove,\r\n onEnd\r\n });\r\n};\n\nexport { createSwipeBackGesture };\n"],"sourceRoot":"webpack:///"}