Files
kapp/5861.js
T
2026-05-12 16:58:11 -03:00

142 lines
4.3 KiB
JavaScript

(self["webpackChunkapp"] = self["webpackChunkapp"] || []).push([[5861],{
/***/ 17481:
/*!***********************************************************!*\
!*** ./node_modules/@ionic/core/dist/esm/dir-e8b767a8.js ***!
\***********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "i": () => (/* binding */ isRTL)
/* harmony export */ });
/*!
* (C) Ionic http://ionicframework.com - MIT License
*/
/**
* Returns `true` if the document or host element
* has a `dir` set to `rtl`. The host value will always
* take priority over the root document value.
*/
const isRTL = hostEl => {
if (hostEl) {
if (hostEl.dir !== '') {
return hostEl.dir.toLowerCase() === 'rtl';
}
}
return (document === null || document === void 0 ? void 0 : document.dir.toLowerCase()) === 'rtl';
};
/***/ }),
/***/ 35861:
/*!******************************************************************!*\
!*** ./node_modules/@ionic/core/dist/esm/swipe-back-e35bd7d6.js ***!
\******************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "createSwipeBackGesture": () => (/* binding */ createSwipeBackGesture)
/* harmony export */ });
/* harmony import */ var _helpers_3b390e48_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./helpers-3b390e48.js */ 29259);
/* harmony import */ var _dir_e8b767a8_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./dir-e8b767a8.js */ 17481);
/* harmony import */ var _index_422b6e83_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./index-422b6e83.js */ 36366);
/* harmony import */ var _gesture_controller_17060b7c_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./gesture-controller-17060b7c.js */ 56379);
/*!
* (C) Ionic http://ionicframework.com - MIT License
*/
const createSwipeBackGesture = (el, canStartHandler, onStartHandler, onMoveHandler, onEndHandler) => {
const win = el.ownerDocument.defaultView;
let rtl = (0,_dir_e8b767a8_js__WEBPACK_IMPORTED_MODULE_1__.i)(el);
/**
* Determine if a gesture is near the edge
* of the screen. If true, then the swipe
* to go back gesture should proceed.
*/
const isAtEdge = detail => {
const threshold = 50;
const {
startX
} = detail;
if (rtl) {
return startX >= win.innerWidth - threshold;
}
return startX <= threshold;
};
const getDeltaX = detail => {
return rtl ? -detail.deltaX : detail.deltaX;
};
const getVelocityX = detail => {
return rtl ? -detail.velocityX : detail.velocityX;
};
const canStart = detail => {
/**
* The user's locale can change mid-session,
* so we need to check text direction at
* the beginning of every gesture.
*/
rtl = (0,_dir_e8b767a8_js__WEBPACK_IMPORTED_MODULE_1__.i)(el);
return isAtEdge(detail) && canStartHandler();
};
const onMove = detail => {
// set the transition animation's progress
const delta = getDeltaX(detail);
const stepValue = delta / win.innerWidth;
onMoveHandler(stepValue);
};
const onEnd = detail => {
// the swipe back gesture has ended
const delta = getDeltaX(detail);
const width = win.innerWidth;
const stepValue = delta / width;
const velocity = getVelocityX(detail);
const z = width / 2.0;
const shouldComplete = velocity >= 0 && (velocity > 0.2 || delta > z);
const missing = shouldComplete ? 1 - stepValue : stepValue;
const missingDistance = missing * width;
let realDur = 0;
if (missingDistance > 5) {
const dur = missingDistance / Math.abs(velocity);
realDur = Math.min(dur, 540);
}
onEndHandler(shouldComplete, stepValue <= 0 ? 0.01 : (0,_helpers_3b390e48_js__WEBPACK_IMPORTED_MODULE_0__.l)(0, stepValue, 0.9999), realDur);
};
return (0,_index_422b6e83_js__WEBPACK_IMPORTED_MODULE_2__.createGesture)({
el,
gestureName: 'goback-swipe',
gesturePriority: 40,
threshold: 10,
canStart,
onStart: onStartHandler,
onMove,
onEnd
});
};
/***/ })
}])
//# sourceMappingURL=5861.js.map