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A,EACdQ,YAAY,OAAS,CAAC,EAAGA,EAAY,CACnC4B,OAAO,OAAS,CACdsE,cAA2B,cAAZ9F,GAA4BpC,GAAS0B,EAAgC,GAAT,QAC1EM,EAAW4B,OACdlD,IAAKoC,KAEPhE,OAAQA,EACRqD,mBAAoBa,GAAsBC,SAAWd,EACrDL,QAASA,EACTpB,IAAKA,GACJ4B,KAAUf,GAAkC,cAAZa,IAAwC,SAAK,IAAO,CACrF4F,UAAuB,SAAK,KAAW,OAAS,CAC9ClJ,OAAQA,EACR4B,IAAKiC,EACLwF,MAAOjG,GACND,QAGT","sources":["webpack://mono-repo/./node_modules/@mui/material/SwipeableDrawer/SwipeableDrawer.js"],"sourcesContent":["'use client';\n\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"BackdropProps\"],\n _excluded2 = [\"anchor\", \"disableBackdropTransition\", \"disableDiscovery\", \"disableSwipeToOpen\", \"hideBackdrop\", \"hysteresis\", \"allowSwipeInChildren\", \"minFlingVelocity\", \"ModalProps\", \"onClose\", \"onOpen\", \"open\", \"PaperProps\", \"SwipeAreaProps\", \"swipeAreaWidth\", \"transitionDuration\", \"variant\"];\nimport * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport PropTypes from 'prop-types';\nimport { elementTypeAcceptingRef } from '@mui/utils';\nimport { useThemeProps } from '@mui/system';\nimport { NoSsr } from '@mui/base';\nimport Drawer, { getAnchor, isHorizontal } from '../Drawer/Drawer';\nimport useForkRef from '../utils/useForkRef';\nimport ownerDocument from '../utils/ownerDocument';\nimport ownerWindow from '../utils/ownerWindow';\nimport useEventCallback from '../utils/useEventCallback';\nimport useEnhancedEffect from '../utils/useEnhancedEffect';\nimport useTheme from '../styles/useTheme';\nimport { getTransitionProps } from '../transitions/utils';\nimport SwipeArea from './SwipeArea';\n\n// This value is closed to what browsers are using internally to\n// trigger a native scroll.\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nimport { jsxs as _jsxs } from \"react/jsx-runtime\";\nconst UNCERTAINTY_THRESHOLD = 3; // px\n\n// This is the part of the drawer displayed on touch start.\nconst DRAG_STARTED_SIGNAL = 20; // px\n\n// We can only have one instance at the time claiming ownership for handling the swipe.\n// Otherwise, the UX would be confusing.\n// That's why we use a singleton here.\nlet claimedSwipeInstance = null;\n\n// Exported for test purposes.\nexport function reset() {\n claimedSwipeInstance = null;\n}\nfunction calculateCurrentX(anchor, touches, doc) {\n return anchor === 'right' ? doc.body.offsetWidth - touches[0].pageX : touches[0].pageX;\n}\nfunction calculateCurrentY(anchor, touches, containerWindow) {\n return anchor === 'bottom' ? containerWindow.innerHeight - touches[0].clientY : touches[0].clientY;\n}\nfunction getMaxTranslate(horizontalSwipe, paperInstance) {\n return horizontalSwipe ? paperInstance.clientWidth : paperInstance.clientHeight;\n}\nfunction getTranslate(currentTranslate, startLocation, open, maxTranslate) {\n return Math.min(Math.max(open ? startLocation - currentTranslate : maxTranslate + startLocation - currentTranslate, 0), maxTranslate);\n}\n\n/**\n * @param {Element | null} element\n * @param {Element} rootNode\n */\nfunction getDomTreeShapes(element, rootNode) {\n // Adapted from https://github.com/oliviertassinari/react-swipeable-views/blob/7666de1dba253b896911adf2790ce51467670856/packages/react-swipeable-views/src/SwipeableViews.js#L129\n const domTreeShapes = [];\n while (element && element !== rootNode.parentElement) {\n const style = ownerWindow(rootNode).getComputedStyle(element);\n if (\n // Ignore the scroll children if the element is absolute positioned.\n style.getPropertyValue('position') === 'absolute' ||\n // Ignore the scroll children if the element has an overflowX hidden\n style.getPropertyValue('overflow-x') === 'hidden') {\n // noop\n } else if (element.clientWidth > 0 && element.scrollWidth > element.clientWidth || element.clientHeight > 0 && element.scrollHeight > element.clientHeight) {\n // Ignore the nodes that have no width.\n // Keep elements with a scroll\n domTreeShapes.push(element);\n }\n element = element.parentElement;\n }\n return domTreeShapes;\n}\n\n/**\n * @param {object} param0\n * @param {ReturnType} param0.domTreeShapes\n */\nfunction computeHasNativeHandler({\n domTreeShapes,\n start,\n current,\n anchor\n}) {\n // Adapted from https://github.com/oliviertassinari/react-swipeable-views/blob/7666de1dba253b896911adf2790ce51467670856/packages/react-swipeable-views/src/SwipeableViews.js#L175\n const axisProperties = {\n scrollPosition: {\n x: 'scrollLeft',\n y: 'scrollTop'\n },\n scrollLength: {\n x: 'scrollWidth',\n y: 'scrollHeight'\n },\n clientLength: {\n x: 'clientWidth',\n y: 'clientHeight'\n }\n };\n return domTreeShapes.some(shape => {\n // Determine if we are going backward or forward.\n let goingForward = current >= start;\n if (anchor === 'top' || anchor === 'left') {\n goingForward = !goingForward;\n }\n const axis = anchor === 'left' || anchor === 'right' ? 'x' : 'y';\n const scrollPosition = Math.round(shape[axisProperties.scrollPosition[axis]]);\n const areNotAtStart = scrollPosition > 0;\n const areNotAtEnd = scrollPosition + shape[axisProperties.clientLength[axis]] < shape[axisProperties.scrollLength[axis]];\n if (goingForward && areNotAtEnd || !goingForward && areNotAtStart) {\n return true;\n }\n return false;\n });\n}\nconst iOS = typeof navigator !== 'undefined' && /iPad|iPhone|iPod/.test(navigator.userAgent);\nconst SwipeableDrawer = /*#__PURE__*/React.forwardRef(function SwipeableDrawer(inProps, ref) {\n const props = useThemeProps({\n name: 'MuiSwipeableDrawer',\n props: inProps\n });\n const theme = useTheme();\n const transitionDurationDefault = {\n enter: theme.transitions.duration.enteringScreen,\n exit: theme.transitions.duration.leavingScreen\n };\n const {\n anchor = 'left',\n disableBackdropTransition = false,\n disableDiscovery = false,\n disableSwipeToOpen = iOS,\n hideBackdrop,\n hysteresis = 0.52,\n allowSwipeInChildren = false,\n minFlingVelocity = 450,\n ModalProps: {\n BackdropProps\n } = {},\n onClose,\n onOpen,\n open = false,\n PaperProps = {},\n SwipeAreaProps,\n swipeAreaWidth = 20,\n transitionDuration = transitionDurationDefault,\n variant = 'temporary' // Mobile first.\n } = props,\n ModalPropsProp = _objectWithoutPropertiesLoose(props.ModalProps, _excluded),\n other = _objectWithoutPropertiesLoose(props, _excluded2);\n const [maybeSwiping, setMaybeSwiping] = React.useState(false);\n const swipeInstance = React.useRef({\n isSwiping: null\n });\n const swipeAreaRef = React.useRef();\n const backdropRef = React.useRef();\n const paperRef = React.useRef();\n const handleRef = useForkRef(PaperProps.ref, paperRef);\n const touchDetected = React.useRef(false);\n\n // Ref for transition duration based on / to match swipe speed\n const calculatedDurationRef = React.useRef();\n\n // Use a ref so the open value used is always up to date inside useCallback.\n useEnhancedEffect(() => {\n calculatedDurationRef.current = null;\n }, [open]);\n const setPosition = React.useCallback((translate, options = {}) => {\n const {\n mode = null,\n changeTransition = true\n } = options;\n const anchorRtl = getAnchor(theme, anchor);\n const rtlTranslateMultiplier = ['right', 'bottom'].indexOf(anchorRtl) !== -1 ? 1 : -1;\n const horizontalSwipe = isHorizontal(anchor);\n const transform = horizontalSwipe ? `translate(${rtlTranslateMultiplier * translate}px, 0)` : `translate(0, ${rtlTranslateMultiplier * translate}px)`;\n const drawerStyle = paperRef.current.style;\n drawerStyle.webkitTransform = transform;\n drawerStyle.transform = transform;\n let transition = '';\n if (mode) {\n transition = theme.transitions.create('all', getTransitionProps({\n easing: undefined,\n style: undefined,\n timeout: transitionDuration\n }, {\n mode\n }));\n }\n if (changeTransition) {\n drawerStyle.webkitTransition = transition;\n drawerStyle.transition = transition;\n }\n if (!disableBackdropTransition && !hideBackdrop) {\n const backdropStyle = backdropRef.current.style;\n backdropStyle.opacity = 1 - translate / getMaxTranslate(horizontalSwipe, paperRef.current);\n if (changeTransition) {\n backdropStyle.webkitTransition = transition;\n backdropStyle.transition = transition;\n }\n }\n }, [anchor, disableBackdropTransition, hideBackdrop, theme, transitionDuration]);\n const handleBodyTouchEnd = useEventCallback(nativeEvent => {\n if (!touchDetected.current) {\n return;\n }\n claimedSwipeInstance = null;\n touchDetected.current = false;\n ReactDOM.flushSync(() => {\n setMaybeSwiping(false);\n });\n\n // The swipe wasn't started.\n if (!swipeInstance.current.isSwiping) {\n swipeInstance.current.isSwiping = null;\n return;\n }\n swipeInstance.current.isSwiping = null;\n const anchorRtl = getAnchor(theme, anchor);\n const horizontal = isHorizontal(anchor);\n let current;\n if (horizontal) {\n current = calculateCurrentX(anchorRtl, nativeEvent.changedTouches, ownerDocument(nativeEvent.currentTarget));\n } else {\n current = calculateCurrentY(anchorRtl, nativeEvent.changedTouches, ownerWindow(nativeEvent.currentTarget));\n }\n const startLocation = horizontal ? swipeInstance.current.startX : swipeInstance.current.startY;\n const maxTranslate = getMaxTranslate(horizontal, paperRef.current);\n const currentTranslate = getTranslate(current, startLocation, open, maxTranslate);\n const translateRatio = currentTranslate / maxTranslate;\n if (Math.abs(swipeInstance.current.velocity) > minFlingVelocity) {\n // Calculate transition duration to match swipe speed\n calculatedDurationRef.current = Math.abs((maxTranslate - currentTranslate) / swipeInstance.current.velocity) * 1000;\n }\n if (open) {\n if (swipeInstance.current.velocity > minFlingVelocity || translateRatio > hysteresis) {\n onClose();\n } else {\n // Reset the position, the swipe was aborted.\n setPosition(0, {\n mode: 'exit'\n });\n }\n return;\n }\n if (swipeInstance.current.velocity < -minFlingVelocity || 1 - translateRatio > hysteresis) {\n onOpen();\n } else {\n // Reset the position, the swipe was aborted.\n setPosition(getMaxTranslate(horizontal, paperRef.current), {\n mode: 'enter'\n });\n }\n });\n const startMaybeSwiping = (force = false) => {\n if (!maybeSwiping) {\n // on Safari Mobile, if you want to be able to have the 'click' event fired on child elements, nothing in the DOM can be changed.\n // this is because Safari Mobile will not fire any mouse events (still fires touch though) if the DOM changes during mousemove.\n // so do this change on first touchmove instead of touchstart\n if (force || !(disableDiscovery && allowSwipeInChildren)) {\n ReactDOM.flushSync(() => {\n setMaybeSwiping(true);\n });\n }\n const horizontalSwipe = isHorizontal(anchor);\n if (!open && paperRef.current) {\n // The ref may be null when a parent component updates while swiping.\n setPosition(getMaxTranslate(horizontalSwipe, paperRef.current) + (disableDiscovery ? 15 : -DRAG_STARTED_SIGNAL), {\n changeTransition: false\n });\n }\n swipeInstance.current.velocity = 0;\n swipeInstance.current.lastTime = null;\n swipeInstance.current.lastTranslate = null;\n swipeInstance.current.paperHit = false;\n touchDetected.current = true;\n }\n };\n const handleBodyTouchMove = useEventCallback(nativeEvent => {\n // the ref may be null when a parent component updates while swiping\n if (!paperRef.current || !touchDetected.current) {\n return;\n }\n\n // We are not supposed to handle this touch move because the swipe was started in a scrollable container in the drawer\n if (claimedSwipeInstance !== null && claimedSwipeInstance !== swipeInstance.current) {\n return;\n }\n startMaybeSwiping(true);\n const anchorRtl = getAnchor(theme, anchor);\n const horizontalSwipe = isHorizontal(anchor);\n const currentX = calculateCurrentX(anchorRtl, nativeEvent.touches, ownerDocument(nativeEvent.currentTarget));\n const currentY = calculateCurrentY(anchorRtl, nativeEvent.touches, ownerWindow(nativeEvent.currentTarget));\n if (open && paperRef.current.contains(nativeEvent.target) && claimedSwipeInstance === null) {\n const domTreeShapes = getDomTreeShapes(nativeEvent.target, paperRef.current);\n const hasNativeHandler = computeHasNativeHandler({\n domTreeShapes,\n start: horizontalSwipe ? swipeInstance.current.startX : swipeInstance.current.startY,\n current: horizontalSwipe ? currentX : currentY,\n anchor\n });\n if (hasNativeHandler) {\n claimedSwipeInstance = true;\n return;\n }\n claimedSwipeInstance = swipeInstance.current;\n }\n\n // We don't know yet.\n if (swipeInstance.current.isSwiping == null) {\n const dx = Math.abs(currentX - swipeInstance.current.startX);\n const dy = Math.abs(currentY - swipeInstance.current.startY);\n const definitelySwiping = horizontalSwipe ? dx > dy && dx > UNCERTAINTY_THRESHOLD : dy > dx && dy > UNCERTAINTY_THRESHOLD;\n if (definitelySwiping && nativeEvent.cancelable) {\n nativeEvent.preventDefault();\n }\n if (definitelySwiping === true || (horizontalSwipe ? dy > UNCERTAINTY_THRESHOLD : dx > UNCERTAINTY_THRESHOLD)) {\n swipeInstance.current.isSwiping = definitelySwiping;\n if (!definitelySwiping) {\n handleBodyTouchEnd(nativeEvent);\n return;\n }\n\n // Shift the starting point.\n swipeInstance.current.startX = currentX;\n swipeInstance.current.startY = currentY;\n\n // Compensate for the part of the drawer displayed on touch start.\n if (!disableDiscovery && !open) {\n if (horizontalSwipe) {\n swipeInstance.current.startX -= DRAG_STARTED_SIGNAL;\n } else {\n swipeInstance.current.startY -= DRAG_STARTED_SIGNAL;\n }\n }\n }\n }\n if (!swipeInstance.current.isSwiping) {\n return;\n }\n const maxTranslate = getMaxTranslate(horizontalSwipe, paperRef.current);\n let startLocation = horizontalSwipe ? swipeInstance.current.startX : swipeInstance.current.startY;\n if (open && !swipeInstance.current.paperHit) {\n startLocation = Math.min(startLocation, maxTranslate);\n }\n const translate = getTranslate(horizontalSwipe ? currentX : currentY, startLocation, open, maxTranslate);\n if (open) {\n if (!swipeInstance.current.paperHit) {\n const paperHit = horizontalSwipe ? currentX < maxTranslate : currentY < maxTranslate;\n if (paperHit) {\n swipeInstance.current.paperHit = true;\n swipeInstance.current.startX = currentX;\n swipeInstance.current.startY = currentY;\n } else {\n return;\n }\n } else if (translate === 0) {\n swipeInstance.current.startX = currentX;\n swipeInstance.current.startY = currentY;\n }\n }\n if (swipeInstance.current.lastTranslate === null) {\n swipeInstance.current.lastTranslate = translate;\n swipeInstance.current.lastTime = performance.now() + 1;\n }\n const velocity = (translate - swipeInstance.current.lastTranslate) / (performance.now() - swipeInstance.current.lastTime) * 1e3;\n\n // Low Pass filter.\n swipeInstance.current.velocity = swipeInstance.current.velocity * 0.4 + velocity * 0.6;\n swipeInstance.current.lastTranslate = translate;\n swipeInstance.current.lastTime = performance.now();\n\n // We are swiping, let's prevent the scroll event on iOS.\n if (nativeEvent.cancelable) {\n nativeEvent.preventDefault();\n }\n setPosition(translate);\n });\n const handleBodyTouchStart = useEventCallback(nativeEvent => {\n // We are not supposed to handle this touch move.\n // Example of use case: ignore the event if there is a Slider.\n if (nativeEvent.defaultPrevented) {\n return;\n }\n\n // We can only have one node at the time claiming ownership for handling the swipe.\n if (nativeEvent.defaultMuiPrevented) {\n return;\n }\n\n // At least one element clogs the drawer interaction zone.\n if (open && (hideBackdrop || !backdropRef.current.contains(nativeEvent.target)) && !paperRef.current.contains(nativeEvent.target)) {\n return;\n }\n const anchorRtl = getAnchor(theme, anchor);\n const horizontalSwipe = isHorizontal(anchor);\n const currentX = calculateCurrentX(anchorRtl, nativeEvent.touches, ownerDocument(nativeEvent.currentTarget));\n const currentY = calculateCurrentY(anchorRtl, nativeEvent.touches, ownerWindow(nativeEvent.currentTarget));\n if (!open) {\n var _paperRef$current;\n // logic for if swipe should be ignored:\n // if disableSwipeToOpen\n // if target != swipeArea, and target is not a child of paper ref\n // if is a child of paper ref, and `allowSwipeInChildren` does not allow it\n if (disableSwipeToOpen || !(nativeEvent.target === swipeAreaRef.current || (_paperRef$current = paperRef.current) != null && _paperRef$current.contains(nativeEvent.target) && (typeof allowSwipeInChildren === 'function' ? allowSwipeInChildren(nativeEvent, swipeAreaRef.current, paperRef.current) : allowSwipeInChildren))) {\n return;\n }\n if (horizontalSwipe) {\n if (currentX > swipeAreaWidth) {\n return;\n }\n } else if (currentY > swipeAreaWidth) {\n return;\n }\n }\n nativeEvent.defaultMuiPrevented = true;\n claimedSwipeInstance = null;\n swipeInstance.current.startX = currentX;\n swipeInstance.current.startY = currentY;\n startMaybeSwiping();\n });\n React.useEffect(() => {\n if (variant === 'temporary') {\n const doc = ownerDocument(paperRef.current);\n doc.addEventListener('touchstart', handleBodyTouchStart);\n // A blocking listener prevents Firefox's navbar to auto-hide on scroll.\n // It only needs to prevent scrolling on the drawer's content when open.\n // When closed, the overlay prevents scrolling.\n doc.addEventListener('touchmove', handleBodyTouchMove, {\n passive: !open\n });\n doc.addEventListener('touchend', handleBodyTouchEnd);\n return () => {\n doc.removeEventListener('touchstart', handleBodyTouchStart);\n doc.removeEventListener('touchmove', handleBodyTouchMove, {\n passive: !open\n });\n doc.removeEventListener('touchend', handleBodyTouchEnd);\n };\n }\n return undefined;\n }, [variant, open, handleBodyTouchStart, handleBodyTouchMove, handleBodyTouchEnd]);\n React.useEffect(() => () => {\n // We need to release the lock.\n if (claimedSwipeInstance === swipeInstance.current) {\n claimedSwipeInstance = null;\n }\n }, []);\n React.useEffect(() => {\n if (!open) {\n setMaybeSwiping(false);\n }\n }, [open]);\n return /*#__PURE__*/_jsxs(React.Fragment, {\n children: [/*#__PURE__*/_jsx(Drawer, _extends({\n open: variant === 'temporary' && maybeSwiping ? true : open,\n variant: variant,\n ModalProps: _extends({\n BackdropProps: _extends({}, BackdropProps, {\n ref: backdropRef\n })\n }, variant === 'temporary' && {\n keepMounted: true\n }, ModalPropsProp),\n hideBackdrop: hideBackdrop,\n PaperProps: _extends({}, PaperProps, {\n style: _extends({\n pointerEvents: variant === 'temporary' && !open && !allowSwipeInChildren ? 'none' : ''\n }, PaperProps.style),\n ref: handleRef\n }),\n anchor: anchor,\n transitionDuration: calculatedDurationRef.current || transitionDuration,\n onClose: onClose,\n ref: ref\n }, other)), !disableSwipeToOpen && variant === 'temporary' && /*#__PURE__*/_jsx(NoSsr, {\n children: /*#__PURE__*/_jsx(SwipeArea, _extends({\n anchor: anchor,\n ref: swipeAreaRef,\n width: swipeAreaWidth\n }, SwipeAreaProps))\n })]\n });\n});\nprocess.env.NODE_ENV !== \"production\" ? SwipeableDrawer.propTypes /* remove-proptypes */ = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the d.ts file and run \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n /**\n * If set to true, the swipe event will open the drawer even if the user begins the swipe on one of the drawer's children.\n * This can be useful in scenarios where the drawer is partially visible.\n * You can customize it further with a callback that determines which children the user can drag over to open the drawer\n * (for example, to ignore other elements that handle touch move events, like sliders).\n *\n * @param {TouchEvent} event The 'touchstart' event\n * @param {HTMLDivElement} swipeArea The swipe area element\n * @param {HTMLDivElement} paper The drawer's paper element\n *\n * @default false\n */\n allowSwipeInChildren: PropTypes.oneOfType([PropTypes.func, PropTypes.bool]),\n /**\n * @ignore\n */\n anchor: PropTypes.oneOf(['bottom', 'left', 'right', 'top']),\n /**\n * The content of the component.\n */\n children: PropTypes.node,\n /**\n * Disable the backdrop transition.\n * This can improve the FPS on low-end devices.\n * @default false\n */\n disableBackdropTransition: PropTypes.bool,\n /**\n * If `true`, touching the screen near the edge of the drawer will not slide in the drawer a bit\n * to promote accidental discovery of the swipe gesture.\n * @default false\n */\n disableDiscovery: PropTypes.bool,\n /**\n * If `true`, swipe to open is disabled. This is useful in browsers where swiping triggers\n * navigation actions. Swipe to open is disabled on iOS browsers by default.\n * @default typeof navigator !== 'undefined' && /iPad|iPhone|iPod/.test(navigator.userAgent)\n */\n disableSwipeToOpen: PropTypes.bool,\n /**\n * @ignore\n */\n hideBackdrop: PropTypes.bool,\n /**\n * Affects how far the drawer must be opened/closed to change its state.\n * Specified as percent (0-1) of the width of the drawer\n * @default 0.52\n */\n hysteresis: PropTypes.number,\n /**\n * Defines, from which (average) velocity on, the swipe is\n * defined as complete although hysteresis isn't reached.\n * Good threshold is between 250 - 1000 px/s\n * @default 450\n */\n minFlingVelocity: PropTypes.number,\n /**\n * @ignore\n */\n ModalProps: PropTypes /* @typescript-to-proptypes-ignore */.shape({\n BackdropProps: PropTypes.shape({\n component: elementTypeAcceptingRef\n })\n }),\n /**\n * Callback fired when the component requests to be closed.\n *\n * @param {React.SyntheticEvent<{}>} event The event source of the callback.\n */\n onClose: PropTypes.func.isRequired,\n /**\n * Callback fired when the component requests to be opened.\n *\n * @param {React.SyntheticEvent<{}>} event The event source of the callback.\n */\n onOpen: PropTypes.func.isRequired,\n /**\n * If `true`, the component is shown.\n * @default false\n */\n open: PropTypes.bool,\n /**\n * @ignore\n */\n PaperProps: PropTypes /* @typescript-to-proptypes-ignore */.shape({\n component: elementTypeAcceptingRef,\n style: PropTypes.object\n }),\n /**\n * The element is used to intercept the touch events on the edge.\n */\n SwipeAreaProps: PropTypes.object,\n /**\n * The width of the left most (or right most) area in `px` that\n * the drawer can be swiped open from.\n * @default 20\n */\n swipeAreaWidth: PropTypes.number,\n /**\n * The duration for the transition, in milliseconds.\n * You may specify a single timeout for all transitions, or individually with an object.\n * @default {\n * enter: theme.transitions.duration.enteringScreen,\n * exit: theme.transitions.duration.leavingScreen,\n * }\n */\n transitionDuration: PropTypes.oneOfType([PropTypes.number, PropTypes.shape({\n appear: PropTypes.number,\n enter: PropTypes.number,\n exit: PropTypes.number\n })]),\n /**\n * @ignore\n */\n variant: PropTypes.oneOf(['permanent', 'persistent', 'temporary'])\n} : void 0;\nexport default SwipeableDrawer;"],"names":["_excluded","_excluded2","claimedSwipeInstance","calculateCurrentX","anchor","touches","doc","body","offsetWidth","pageX","calculateCurrentY","containerWindow","innerHeight","clientY","getMaxTranslate","horizontalSwipe","paperInstance","clientWidth","clientHeight","getTranslate","currentTranslate","startLocation","open","maxTranslate","Math","min","max","iOS","navigator","test","userAgent","inProps","ref","props","name","theme","transitionDurationDefault","enter","transitions","duration","enteringScreen","exit","leavingScreen","disableBackdropTransition","disableDiscovery","disableSwipeToOpen","hideBackdrop","hysteresis","allowSwipeInChildren","minFlingVelocity","ModalProps","BackdropProps","onClose","onOpen","PaperProps","SwipeAreaProps","swipeAreaWidth","transitionDuration","variant","ModalPropsProp","other","maybeSwiping","setMaybeSwiping","swipeInstance","isSwiping","swipeAreaRef","backdropRef","paperRef","handleRef","touchDetected","calculatedDurationRef","current","setPosition","translate","options","mode","changeTransition","anchorRtl","rtlTranslateMultiplier","indexOf","transform","drawerStyle","style","webkitTransform","transition","create","easing","undefined","timeout","webkitTransition","backdropStyle","opacity","handleBodyTouchEnd","nativeEvent","horizontal","changedTouches","currentTarget","startX","startY","translateRatio","abs","velocity","startMaybeSwiping","force","lastTime","lastTranslate","paperHit","handleBodyTouchMove","currentX","currentY","contains","target","hasNativeHandler","domTreeShapes","start","axisProperties","x","y","some","shape","goingForward","axis","scrollPosition","round","areNotAtStart","areNotAtEnd","computeHasNativeHandler","element","rootNode","parentElement","getComputedStyle","getPropertyValue","scrollWidth","scrollHeight","push","getDomTreeShapes","dx","dy","definitelySwiping","cancelable","preventDefault","performance","now","handleBodyTouchStart","defaultPrevented","defaultMuiPrevented","_paperRef$current","addEventListener","passive","removeEventListener","children","keepMounted","pointerEvents","width"],"sourceRoot":""}