{"version":3,"sources":["webpack:///./node_modules/@ionic/core/components/swipe-back.js"],"names":["createSwipeBackGesture","el","canStartHandler","onStartHandler","onMoveHandler","onEndHandler","win","ownerDocument","defaultView","rtl","isAtEdge","detail","threshold","startX","innerWidth","getDeltaX","deltaX","getVelocityX","velocityX","canStart","onMove","delta","stepValue","onEnd","width","velocity","z","shouldComplete","missing","missingDistance","realDur","dur","Math","abs","min","gestureName","gesturePriority","onStart"],"mappings":"kHAAA;;;;AAOA,MAAMA,EAAyB,CAACC,EAAIC,EAAiBC,EAAgBC,EAAeC,KAClF,MAAMC,EAAML,EAAGM,cAAcC,YAC7B,IAAIC,EAAM,eAAMR,GAMhB,MAAMS,EAAYC,IAChB,MAAMC,EAAY,IACZ,OAAEC,GAAWF,EACnB,OAAIF,EACKI,GAAUP,EAAIQ,WAAaF,EAE7BC,GAAUD,GAEbG,EAAaJ,GACVF,GAAOE,EAAOK,OAASL,EAAOK,OAEjCC,EAAgBN,GACbF,GAAOE,EAAOO,UAAYP,EAAOO,UAEpCC,EAAYR,IAMhBF,EAAM,eAAMR,GACLS,EAASC,IAAWT,KAEvBkB,EAAUT,IAEd,MAAMU,EAAQN,EAAUJ,GAClBW,EAAYD,EAAQf,EAAIQ,WAC9BV,EAAckB,IAEVC,EAASZ,IAEb,MAAMU,EAAQN,EAAUJ,GAClBa,EAAQlB,EAAIQ,WACZQ,EAAYD,EAAQG,EACpBC,EAAWR,EAAaN,GACxBe,EAAIF,EAAQ,EACZG,EAAiBF,GAAY,IAAMA,EAAW,IAAOJ,EAAQK,GAC7DE,EAAUD,EAAiB,EAAIL,EAAYA,EAC3CO,EAAkBD,EAAUJ,EAClC,IAAIM,EAAU,EACd,GAAID,EAAkB,EAAG,CACvB,MAAME,EAAMF,EAAkBG,KAAKC,IAAIR,GACvCK,EAAUE,KAAKE,IAAIH,EAAK,KAE1B1B,EAAasB,EAAgBL,GAAa,EAAI,IAAO,eAAM,EAAGA,EAAW,OAASQ,IAEpF,OAAO,2BAAc,CACnB7B,KACAkC,YAAa,eACbC,gBAAiB,GACjBxB,UAAW,GACXO,WACAkB,QAASlC,EACTiB,SACAG","file":"js/chunk-2d0e9381.00aadc45.js","sourcesContent":["/*!\n * (C) Ionic http://ionicframework.com - MIT License\n */\nimport { h as clamp } from './helpers.js';\nimport { i as isRTL } from './dir.js';\nimport { createGesture } from './index2.js';\n\nconst createSwipeBackGesture = (el, canStartHandler, onStartHandler, onMoveHandler, onEndHandler) => {\n const win = el.ownerDocument.defaultView;\n let rtl = isRTL(el);\n /**\n * Determine if a gesture is near the edge\n * of the screen. If true, then the swipe\n * to go back gesture should proceed.\n */\n const isAtEdge = (detail) => {\n const threshold = 50;\n const { startX } = detail;\n if (rtl) {\n return startX >= win.innerWidth - threshold;\n }\n return startX <= threshold;\n };\n const getDeltaX = (detail) => {\n return rtl ? -detail.deltaX : detail.deltaX;\n };\n const getVelocityX = (detail) => {\n return rtl ? -detail.velocityX : detail.velocityX;\n };\n const canStart = (detail) => {\n /**\n * The user's locale can change mid-session,\n * so we need to check text direction at\n * the beginning of every gesture.\n */\n rtl = isRTL(el);\n return isAtEdge(detail) && canStartHandler();\n };\n const onMove = (detail) => {\n // set the transition animation's progress\n const delta = getDeltaX(detail);\n const stepValue = delta / win.innerWidth;\n onMoveHandler(stepValue);\n };\n const onEnd = (detail) => {\n // the swipe back gesture has ended\n const delta = getDeltaX(detail);\n const width = win.innerWidth;\n const stepValue = delta / width;\n const velocity = getVelocityX(detail);\n const z = width / 2.0;\n const shouldComplete = velocity >= 0 && (velocity > 0.2 || delta > z);\n const missing = shouldComplete ? 1 - stepValue : stepValue;\n const missingDistance = missing * width;\n let realDur = 0;\n if (missingDistance > 5) {\n const dur = missingDistance / Math.abs(velocity);\n realDur = Math.min(dur, 540);\n }\n onEndHandler(shouldComplete, stepValue <= 0 ? 0.01 : clamp(0, stepValue, 0.9999), realDur);\n };\n return createGesture({\n el,\n gestureName: 'goback-swipe',\n gesturePriority: 40,\n threshold: 10,\n canStart,\n onStart: onStartHandler,\n onMove,\n onEnd,\n });\n};\n\nexport { createSwipeBackGesture };\n"],"sourceRoot":""}