{"ast":null,"code":"import _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport * as ReactDOM from 'react-dom';\nimport { elementTypeAcceptingRef } from '@material-ui/utils';\nimport { getThemeProps } from '@material-ui/styles';\nimport Drawer, { getAnchor, isHorizontal } from '../Drawer/Drawer';\nimport ownerDocument from '../utils/ownerDocument';\nimport useEventCallback from '../utils/useEventCallback';\nimport { duration } from '../styles/transitions';\nimport useTheme from '../styles/useTheme';\nimport { getTransitionProps } from '../transitions/utils';\nimport NoSsr from '../NoSsr';\nimport SwipeArea from './SwipeArea'; // This value is closed to what browsers are using internally to\n// trigger a native scroll.\n\nvar UNCERTAINTY_THRESHOLD = 3; // px\n// We can only have one node 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.\n\nvar nodeThatClaimedTheSwipe = null; // Exported for test purposes.\n\nexport function reset() {\n  nodeThatClaimedTheSwipe = null;\n}\n\nfunction calculateCurrentX(anchor, touches) {\n  return anchor === 'right' ? document.body.offsetWidth - touches[0].pageX : touches[0].pageX;\n}\n\nfunction calculateCurrentY(anchor, touches) {\n  return anchor === 'bottom' ? window.innerHeight - touches[0].clientY : touches[0].clientY;\n}\n\nfunction getMaxTranslate(horizontalSwipe, paperInstance) {\n  return horizontalSwipe ? paperInstance.clientWidth : paperInstance.clientHeight;\n}\n\nfunction getTranslate(currentTranslate, startLocation, open, maxTranslate) {\n  return Math.min(Math.max(open ? startLocation - currentTranslate : maxTranslate + startLocation - currentTranslate, 0), maxTranslate);\n}\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  var domTreeShapes = [];\n\n  while (element && element !== rootNode) {\n    var style = window.getComputedStyle(element);\n\n    if ( // Ignore the scroll children if the element is absolute positioned.\n    style.getPropertyValue('position') === 'absolute' || // Ignore the scroll children if the element has an overflowX hidden\n    style.getPropertyValue('overflow-x') === 'hidden') {\n      domTreeShapes = [];\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\n    element = element.parentElement;\n  }\n\n  return domTreeShapes;\n}\n\nfunction findNativeHandler(_ref) {\n  var domTreeShapes = _ref.domTreeShapes,\n      start = _ref.start,\n      current = _ref.current,\n      anchor = _ref.anchor; // Adapted from https://github.com/oliviertassinari/react-swipeable-views/blob/7666de1dba253b896911adf2790ce51467670856/packages/react-swipeable-views/src/SwipeableViews.js#L175\n\n  var 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(function (shape) {\n    // Determine if we are going backward or forward.\n    var goingForward = current >= start;\n\n    if (anchor === 'top' || anchor === 'left') {\n      goingForward = !goingForward;\n    }\n\n    var axis = anchor === 'left' || anchor === 'right' ? 'x' : 'y';\n    var scrollPosition = shape[axisProperties.scrollPosition[axis]];\n    var areNotAtStart = scrollPosition > 0;\n    var areNotAtEnd = scrollPosition + shape[axisProperties.clientLength[axis]] < shape[axisProperties.scrollLength[axis]];\n\n    if (goingForward && areNotAtEnd || !goingForward && areNotAtStart) {\n      return shape;\n    }\n\n    return null;\n  });\n}\n\nvar iOS = typeof navigator !== 'undefined' && /iPad|iPhone|iPod/.test(navigator.userAgent);\nvar transitionDurationDefault = {\n  enter: duration.enteringScreen,\n  exit: duration.leavingScreen\n};\nvar useEnhancedEffect = typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect;\nvar SwipeableDrawer = /*#__PURE__*/React.forwardRef(function SwipeableDrawer(inProps, ref) {\n  var theme = useTheme();\n  var props = getThemeProps({\n    name: 'MuiSwipeableDrawer',\n    props: _extends({}, inProps),\n    theme: theme\n  });\n  var _props$anchor = props.anchor,\n      anchor = _props$anchor === void 0 ? 'left' : _props$anchor,\n      _props$disableBackdro = props.disableBackdropTransition,\n      disableBackdropTransition = _props$disableBackdro === void 0 ? false : _props$disableBackdro,\n      _props$disableDiscove = props.disableDiscovery,\n      disableDiscovery = _props$disableDiscove === void 0 ? false : _props$disableDiscove,\n      _props$disableSwipeTo = props.disableSwipeToOpen,\n      disableSwipeToOpen = _props$disableSwipeTo === void 0 ? iOS : _props$disableSwipeTo,\n      hideBackdrop = props.hideBackdrop,\n      _props$hysteresis = props.hysteresis,\n      hysteresis = _props$hysteresis === void 0 ? 0.52 : _props$hysteresis,\n      _props$minFlingVeloci = props.minFlingVelocity,\n      minFlingVelocity = _props$minFlingVeloci === void 0 ? 450 : _props$minFlingVeloci,\n      _props$ModalProps = props.ModalProps;\n  _props$ModalProps = _props$ModalProps === void 0 ? {} : _props$ModalProps;\n\n  var BackdropProps = _props$ModalProps.BackdropProps,\n      ModalPropsProp = _objectWithoutProperties(_props$ModalProps, [\"BackdropProps\"]),\n      onClose = props.onClose,\n      onOpen = props.onOpen,\n      open = props.open,\n      _props$PaperProps = props.PaperProps,\n      PaperProps = _props$PaperProps === void 0 ? {} : _props$PaperProps,\n      SwipeAreaProps = props.SwipeAreaProps,\n      _props$swipeAreaWidth = props.swipeAreaWidth,\n      swipeAreaWidth = _props$swipeAreaWidth === void 0 ? 20 : _props$swipeAreaWidth,\n      _props$transitionDura = props.transitionDuration,\n      transitionDuration = _props$transitionDura === void 0 ? transitionDurationDefault : _props$transitionDura,\n      _props$variant = props.variant,\n      variant = _props$variant === void 0 ? 'temporary' : _props$variant,\n      other = _objectWithoutProperties(props, [\"anchor\", \"disableBackdropTransition\", \"disableDiscovery\", \"disableSwipeToOpen\", \"hideBackdrop\", \"hysteresis\", \"minFlingVelocity\", \"ModalProps\", \"onClose\", \"onOpen\", \"open\", \"PaperProps\", \"SwipeAreaProps\", \"swipeAreaWidth\", \"transitionDuration\", \"variant\"]);\n\n  var _React$useState = React.useState(false),\n      maybeSwiping = _React$useState[0],\n      setMaybeSwiping = _React$useState[1];\n\n  var swipeInstance = React.useRef({\n    isSwiping: null\n  });\n  var swipeAreaRef = React.useRef();\n  var backdropRef = React.useRef();\n  var paperRef = React.useRef();\n  var touchDetected = React.useRef(false); // Ref for transition duration based on / to match swipe speed\n\n  var calculatedDurationRef = React.useRef(); // Use a ref so the open value used is always up to date inside useCallback.\n\n  useEnhancedEffect(function () {\n    calculatedDurationRef.current = null;\n  }, [open]);\n  var setPosition = React.useCallback(function (translate) {\n    var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n    var _options$mode = options.mode,\n        mode = _options$mode === void 0 ? null : _options$mode,\n        _options$changeTransi = options.changeTransition,\n        changeTransition = _options$changeTransi === void 0 ? true : _options$changeTransi;\n    var anchorRtl = getAnchor(theme, anchor);\n    var rtlTranslateMultiplier = ['right', 'bottom'].indexOf(anchorRtl) !== -1 ? 1 : -1;\n    var horizontalSwipe = isHorizontal(anchor);\n    var transform = horizontalSwipe ? \"translate(\".concat(rtlTranslateMultiplier * translate, \"px, 0)\") : \"translate(0, \".concat(rtlTranslateMultiplier * translate, \"px)\");\n    var drawerStyle = paperRef.current.style;\n    drawerStyle.webkitTransform = transform;\n    drawerStyle.transform = transform;\n    var transition = '';\n\n    if (mode) {\n      transition = theme.transitions.create('all', getTransitionProps({\n        timeout: transitionDuration\n      }, {\n        mode: mode\n      }));\n    }\n\n    if (changeTransition) {\n      drawerStyle.webkitTransition = transition;\n      drawerStyle.transition = transition;\n    }\n\n    if (!disableBackdropTransition && !hideBackdrop) {\n      var backdropStyle = backdropRef.current.style;\n      backdropStyle.opacity = 1 - translate / getMaxTranslate(horizontalSwipe, paperRef.current);\n\n      if (changeTransition) {\n        backdropStyle.webkitTransition = transition;\n        backdropStyle.transition = transition;\n      }\n    }\n  }, [anchor, disableBackdropTransition, hideBackdrop, theme, transitionDuration]);\n  var handleBodyTouchEnd = useEventCallback(function (event) {\n    if (!touchDetected.current) {\n      return;\n    }\n\n    nodeThatClaimedTheSwipe = null;\n    touchDetected.current = false;\n    setMaybeSwiping(false); // The swipe wasn't started.\n\n    if (!swipeInstance.current.isSwiping) {\n      swipeInstance.current.isSwiping = null;\n      return;\n    }\n\n    swipeInstance.current.isSwiping = null;\n    var anchorRtl = getAnchor(theme, anchor);\n    var horizontal = isHorizontal(anchor);\n    var current;\n\n    if (horizontal) {\n      current = calculateCurrentX(anchorRtl, event.changedTouches);\n    } else {\n      current = calculateCurrentY(anchorRtl, event.changedTouches);\n    }\n\n    var startLocation = horizontal ? swipeInstance.current.startX : swipeInstance.current.startY;\n    var maxTranslate = getMaxTranslate(horizontal, paperRef.current);\n    var currentTranslate = getTranslate(current, startLocation, open, maxTranslate);\n    var translateRatio = currentTranslate / maxTranslate;\n\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\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\n      return;\n    }\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  var handleBodyTouchMove = useEventCallback(function (event) {\n    // the ref may be null when a parent component updates while swiping\n    if (!paperRef.current || !touchDetected.current) {\n      return;\n    } // We are not supposed to handle this touch move because the swipe was started in a scrollable container in the drawer\n\n\n    if (nodeThatClaimedTheSwipe != null && nodeThatClaimedTheSwipe !== swipeInstance.current) {\n      return;\n    }\n\n    var anchorRtl = getAnchor(theme, anchor);\n    var horizontalSwipe = isHorizontal(anchor);\n    var currentX = calculateCurrentX(anchorRtl, event.touches);\n    var currentY = calculateCurrentY(anchorRtl, event.touches);\n\n    if (open && paperRef.current.contains(event.target) && nodeThatClaimedTheSwipe == null) {\n      var domTreeShapes = getDomTreeShapes(event.target, paperRef.current);\n      var nativeHandler = findNativeHandler({\n        domTreeShapes: domTreeShapes,\n        start: horizontalSwipe ? swipeInstance.current.startX : swipeInstance.current.startY,\n        current: horizontalSwipe ? currentX : currentY,\n        anchor: anchor\n      });\n\n      if (nativeHandler) {\n        nodeThatClaimedTheSwipe = nativeHandler;\n        return;\n      }\n\n      nodeThatClaimedTheSwipe = swipeInstance.current;\n    } // We don't know yet.\n\n\n    if (swipeInstance.current.isSwiping == null) {\n      var dx = Math.abs(currentX - swipeInstance.current.startX);\n      var dy = Math.abs(currentY - swipeInstance.current.startY); // We are likely to be swiping, let's prevent the scroll event on iOS.\n\n      if (dx > dy) {\n        if (event.cancelable) {\n          event.preventDefault();\n        }\n      }\n\n      var definitelySwiping = horizontalSwipe ? dx > dy && dx > UNCERTAINTY_THRESHOLD : dy > dx && dy > UNCERTAINTY_THRESHOLD;\n\n      if (definitelySwiping === true || (horizontalSwipe ? dy > UNCERTAINTY_THRESHOLD : dx > UNCERTAINTY_THRESHOLD)) {\n        swipeInstance.current.isSwiping = definitelySwiping;\n\n        if (!definitelySwiping) {\n          handleBodyTouchEnd(event);\n          return;\n        } // Shift the starting point.\n\n\n        swipeInstance.current.startX = currentX;\n        swipeInstance.current.startY = currentY; // Compensate for the part of the drawer displayed on touch start.\n\n        if (!disableDiscovery && !open) {\n          if (horizontalSwipe) {\n            swipeInstance.current.startX -= swipeAreaWidth;\n          } else {\n            swipeInstance.current.startY -= swipeAreaWidth;\n          }\n        }\n      }\n    }\n\n    if (!swipeInstance.current.isSwiping) {\n      return;\n    }\n\n    var maxTranslate = getMaxTranslate(horizontalSwipe, paperRef.current);\n    var startLocation = horizontalSwipe ? swipeInstance.current.startX : swipeInstance.current.startY;\n\n    if (open && !swipeInstance.current.paperHit) {\n      startLocation = Math.min(startLocation, maxTranslate);\n    }\n\n    var translate = getTranslate(horizontalSwipe ? currentX : currentY, startLocation, open, maxTranslate);\n\n    if (open) {\n      if (!swipeInstance.current.paperHit) {\n        var paperHit = horizontalSwipe ? currentX < maxTranslate : currentY < maxTranslate;\n\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\n    if (swipeInstance.current.lastTranslate === null) {\n      swipeInstance.current.lastTranslate = translate;\n      swipeInstance.current.lastTime = performance.now() + 1;\n    }\n\n    var velocity = (translate - swipeInstance.current.lastTranslate) / (performance.now() - swipeInstance.current.lastTime) * 1e3; // Low Pass filter.\n\n    swipeInstance.current.velocity = swipeInstance.current.velocity * 0.4 + velocity * 0.6;\n    swipeInstance.current.lastTranslate = translate;\n    swipeInstance.current.lastTime = performance.now(); // We are swiping, let's prevent the scroll event on iOS.\n\n    if (event.cancelable) {\n      event.preventDefault();\n    }\n\n    setPosition(translate);\n  });\n  var handleBodyTouchStart = useEventCallback(function (event) {\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 (event.defaultPrevented) {\n      return;\n    } // We can only have one node at the time claiming ownership for handling the swipe.\n\n\n    if (event.muiHandled) {\n      return;\n    } // At least one element clogs the drawer interaction zone.\n\n\n    if (open && !backdropRef.current.contains(event.target) && !paperRef.current.contains(event.target)) {\n      return;\n    }\n\n    var anchorRtl = getAnchor(theme, anchor);\n    var horizontalSwipe = isHorizontal(anchor);\n    var currentX = calculateCurrentX(anchorRtl, event.touches);\n    var currentY = calculateCurrentY(anchorRtl, event.touches);\n\n    if (!open) {\n      if (disableSwipeToOpen || event.target !== swipeAreaRef.current) {\n        return;\n      }\n\n      if (horizontalSwipe) {\n        if (currentX > swipeAreaWidth) {\n          return;\n        }\n      } else if (currentY > swipeAreaWidth) {\n        return;\n      }\n    }\n\n    event.muiHandled = true;\n    nodeThatClaimedTheSwipe = null;\n    swipeInstance.current.startX = currentX;\n    swipeInstance.current.startY = currentY;\n    setMaybeSwiping(true);\n\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 ? 20 : -swipeAreaWidth), {\n        changeTransition: false\n      });\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  React.useEffect(function () {\n    if (variant === 'temporary') {\n      var doc = ownerDocument(paperRef.current);\n      doc.addEventListener('touchstart', handleBodyTouchStart);\n      doc.addEventListener('touchmove', handleBodyTouchMove, {\n        passive: false\n      });\n      doc.addEventListener('touchend', handleBodyTouchEnd);\n      return function () {\n        doc.removeEventListener('touchstart', handleBodyTouchStart);\n        doc.removeEventListener('touchmove', handleBodyTouchMove, {\n          passive: false\n        });\n        doc.removeEventListener('touchend', handleBodyTouchEnd);\n      };\n    }\n\n    return undefined;\n  }, [variant, handleBodyTouchStart, handleBodyTouchMove, handleBodyTouchEnd]);\n  React.useEffect(function () {\n    return function () {\n      // We need to release the lock.\n      if (nodeThatClaimedTheSwipe === swipeInstance.current) {\n        nodeThatClaimedTheSwipe = null;\n      }\n    };\n  }, []);\n  React.useEffect(function () {\n    if (!open) {\n      setMaybeSwiping(false);\n    }\n  }, [open]);\n  var handleBackdropRef = React.useCallback(function (instance) {\n    // #StrictMode ready\n    backdropRef.current = ReactDOM.findDOMNode(instance);\n  }, []);\n  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Drawer, _extends({\n    open: variant === 'temporary' && maybeSwiping ? true : open,\n    variant: variant,\n    ModalProps: _extends({\n      BackdropProps: _extends({}, BackdropProps, {\n        ref: handleBackdropRef\n      })\n    }, ModalPropsProp),\n    PaperProps: _extends({}, PaperProps, {\n      style: _extends({\n        pointerEvents: variant === 'temporary' && !open ? 'none' : ''\n      }, PaperProps.style),\n      ref: paperRef\n    }),\n    anchor: anchor,\n    transitionDuration: calculatedDurationRef.current || transitionDuration,\n    onClose: onClose,\n    ref: ref\n  }, other)), !disableSwipeToOpen && variant === 'temporary' && /*#__PURE__*/React.createElement(NoSsr, null, /*#__PURE__*/React.createElement(SwipeArea, _extends({\n    anchor: anchor,\n    ref: swipeAreaRef,\n    width: swipeAreaWidth\n  }, SwipeAreaProps))));\n});\nprocess.env.NODE_ENV !== \"production\" ? SwipeableDrawer.propTypes = {\n  /**\n   * @ignore\n   */\n  anchor: PropTypes.oneOf(['left', 'top', 'right', 'bottom']),\n\n  /**\n   * The content of the component.\n   */\n  children: PropTypes.node,\n\n  /**\n   * Disable the backdrop transition.\n   * This can improve the FPS on low-end devices.\n   */\n  disableBackdropTransition: PropTypes.bool,\n\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   */\n  disableDiscovery: PropTypes.bool,\n\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   */\n  disableSwipeToOpen: PropTypes.bool,\n\n  /**\n   * @ignore\n   */\n  hideBackdrop: PropTypes.bool,\n\n  /**\n   * Affects how far the drawer must be opened/closed to change his state.\n   * Specified as percent (0-1) of the width of the drawer\n   */\n  hysteresis: PropTypes.number,\n\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   */\n  minFlingVelocity: PropTypes.number,\n\n  /**\n   * @ignore\n   */\n  ModalProps: PropTypes.shape({\n    BackdropProps: PropTypes.shape({\n      component: elementTypeAcceptingRef\n    })\n  }),\n\n  /**\n   * Callback fired when the component requests to be closed.\n   *\n   * @param {object} event The event source of the callback.\n   */\n  onClose: PropTypes.func.isRequired,\n\n  /**\n   * Callback fired when the component requests to be opened.\n   *\n   * @param {object} event The event source of the callback.\n   */\n  onOpen: PropTypes.func.isRequired,\n\n  /**\n   * If `true`, the drawer is open.\n   */\n  open: PropTypes.bool.isRequired,\n\n  /**\n   * @ignore\n   */\n  PaperProps: PropTypes.shape({\n    component: elementTypeAcceptingRef,\n    style: PropTypes.object\n  }),\n\n  /**\n   * The element is used to intercept the touch events on the edge.\n   */\n  SwipeAreaProps: PropTypes.object,\n\n  /**\n   * The width of the left most (or right most) area in pixels where the\n   * drawer can be swiped open from.\n   */\n  swipeAreaWidth: PropTypes.number,\n\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   */\n  transitionDuration: PropTypes.oneOfType([PropTypes.number, PropTypes.shape({\n    enter: PropTypes.number,\n    exit: PropTypes.number\n  })]),\n\n  /**\n   * @ignore\n   */\n  variant: PropTypes.oneOf(['permanent', 'persistent', 'temporary'])\n} : void 0;\nexport default SwipeableDrawer;","map":{"version":3,"sources":["C:/laragon/www/itokin/DriverOPCDA/frontend/node_modules/@material-ui/core/esm/SwipeableDrawer/SwipeableDrawer.js"],"names":["_objectWithoutProperties","_extends","React","PropTypes","ReactDOM","elementTypeAcceptingRef","getThemeProps","Drawer","getAnchor","isHorizontal","ownerDocument","useEventCallback","duration","useTheme","getTransitionProps","NoSsr","SwipeArea","UNCERTAINTY_THRESHOLD","nodeThatClaimedTheSwipe","reset","calculateCurrentX","anchor","touches","document","body","offsetWidth","pageX","calculateCurrentY","window","innerHeight","clientY","getMaxTranslate","horizontalSwipe","paperInstance","clientWidth","clientHeight","getTranslate","currentTranslate","startLocation","open","maxTranslate","Math","min","max","getDomTreeShapes","element","rootNode","domTreeShapes","style","getComputedStyle","getPropertyValue","scrollWidth","scrollHeight","push","parentElement","findNativeHandler","_ref","start","current","axisProperties","scrollPosition","x","y","scrollLength","clientLength","some","shape","goingForward","axis","areNotAtStart","areNotAtEnd","iOS","navigator","test","userAgent","transitionDurationDefault","enter","enteringScreen","exit","leavingScreen","useEnhancedEffect","useLayoutEffect","useEffect","SwipeableDrawer","forwardRef","inProps","ref","theme","props","name","_props$anchor","_props$disableBackdro","disableBackdropTransition","_props$disableDiscove","disableDiscovery","_props$disableSwipeTo","disableSwipeToOpen","hideBackdrop","_props$hysteresis","hysteresis","_props$minFlingVeloci","minFlingVelocity","_props$ModalProps","ModalProps","BackdropProps","ModalPropsProp","onClose","onOpen","_props$PaperProps","PaperProps","SwipeAreaProps","_props$swipeAreaWidth","swipeAreaWidth","_props$transitionDura","transitionDuration","_props$variant","variant","other","_React$useState","useState","maybeSwiping","setMaybeSwiping","swipeInstance","useRef","isSwiping","swipeAreaRef","backdropRef","paperRef","touchDetected","calculatedDurationRef","setPosition","useCallback","translate","options","arguments","length","undefined","_options$mode","mode","_options$changeTransi","changeTransition","anchorRtl","rtlTranslateMultiplier","indexOf","transform","concat","drawerStyle","webkitTransform","transition","transitions","create","timeout","webkitTransition","backdropStyle","opacity","handleBodyTouchEnd","event","horizontal","changedTouches","startX","startY","translateRatio","abs","velocity","handleBodyTouchMove","currentX","currentY","contains","target","nativeHandler","dx","dy","cancelable","preventDefault","definitelySwiping","paperHit","lastTranslate","lastTime","performance","now","handleBodyTouchStart","defaultPrevented","muiHandled","doc","addEventListener","passive","removeEventListener","handleBackdropRef","instance","findDOMNode","createElement","Fragment","pointerEvents","width","process","env","NODE_ENV","propTypes","oneOf","children","node","bool","number","component","func","isRequired","object","oneOfType"],"mappings":"AAAA,OAAOA,wBAAP,MAAqC,oDAArC;AACA,OAAOC,QAAP,MAAqB,oCAArB;AACA,OAAO,KAAKC,KAAZ,MAAuB,OAAvB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAO,KAA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,CAAC+D,KAAV,CAAgB;AACzEU,IAAAA,KAAK,EAAEzE,SAAS,CAACuM,MADwD;AAEzE5H,IAAAA,IAAI,EAAE3E,SAAS,CAACuM;AAFyD,GAAhB,CAAnB,CAApB,CAlG8C;;AAuGlE;AACF;AACA;AACEtF,EAAAA,OAAO,EAAEjH,SAAS,CAACmM,KAAV,CAAgB,CAAC,WAAD,EAAc,YAAd,EAA4B,WAA5B,CAAhB;AA1GyD,CAApE,GA2GI,KAAK,CA3GT;AA4GA,eAAenH,eAAf","sourcesContent":["import _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport * as ReactDOM from 'react-dom';\nimport { elementTypeAcceptingRef } from '@material-ui/utils';\nimport { getThemeProps } from '@material-ui/styles';\nimport Drawer, { getAnchor, isHorizontal } from '../Drawer/Drawer';\nimport ownerDocument from '../utils/ownerDocument';\nimport useEventCallback from '../utils/useEventCallback';\nimport { duration } from '../styles/transitions';\nimport useTheme from '../styles/useTheme';\nimport { getTransitionProps } from '../transitions/utils';\nimport NoSsr from '../NoSsr';\nimport SwipeArea from './SwipeArea'; // This value is closed to what browsers are using internally to\n// trigger a native scroll.\n\nvar UNCERTAINTY_THRESHOLD = 3; // px\n// We can only have one node 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.\n\nvar nodeThatClaimedTheSwipe = null; // Exported for test purposes.\n\nexport function reset() {\n  nodeThatClaimedTheSwipe = null;\n}\n\nfunction calculateCurrentX(anchor, touches) {\n  return anchor === 'right' ? document.body.offsetWidth - touches[0].pageX : touches[0].pageX;\n}\n\nfunction calculateCurrentY(anchor, touches) {\n  return anchor === 'bottom' ? window.innerHeight - touches[0].clientY : touches[0].clientY;\n}\n\nfunction getMaxTranslate(horizontalSwipe, paperInstance) {\n  return horizontalSwipe ? paperInstance.clientWidth : paperInstance.clientHeight;\n}\n\nfunction getTranslate(currentTranslate, startLocation, open, maxTranslate) {\n  return Math.min(Math.max(open ? startLocation - currentTranslate : maxTranslate + startLocation - currentTranslate, 0), maxTranslate);\n}\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  var domTreeShapes = [];\n\n  while (element && element !== rootNode) {\n    var style = window.getComputedStyle(element);\n\n    if ( // Ignore the scroll children if the element is absolute positioned.\n    style.getPropertyValue('position') === 'absolute' || // Ignore the scroll children if the element has an overflowX hidden\n    style.getPropertyValue('overflow-x') === 'hidden') {\n      domTreeShapes = [];\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\n    element = element.parentElement;\n  }\n\n  return domTreeShapes;\n}\n\nfunction findNativeHandler(_ref) {\n  var domTreeShapes = _ref.domTreeShapes,\n      start = _ref.start,\n      current = _ref.current,\n      anchor = _ref.anchor;\n  // Adapted from https://github.com/oliviertassinari/react-swipeable-views/blob/7666de1dba253b896911adf2790ce51467670856/packages/react-swipeable-views/src/SwipeableViews.js#L175\n  var 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(function (shape) {\n    // Determine if we are going backward or forward.\n    var goingForward = current >= start;\n\n    if (anchor === 'top' || anchor === 'left') {\n      goingForward = !goingForward;\n    }\n\n    var axis = anchor === 'left' || anchor === 'right' ? 'x' : 'y';\n    var scrollPosition = shape[axisProperties.scrollPosition[axis]];\n    var areNotAtStart = scrollPosition > 0;\n    var areNotAtEnd = scrollPosition + shape[axisProperties.clientLength[axis]] < shape[axisProperties.scrollLength[axis]];\n\n    if (goingForward && areNotAtEnd || !goingForward && areNotAtStart) {\n      return shape;\n    }\n\n    return null;\n  });\n}\n\nvar iOS = typeof navigator !== 'undefined' && /iPad|iPhone|iPod/.test(navigator.userAgent);\nvar transitionDurationDefault = {\n  enter: duration.enteringScreen,\n  exit: duration.leavingScreen\n};\nvar useEnhancedEffect = typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect;\nvar SwipeableDrawer = /*#__PURE__*/React.forwardRef(function SwipeableDrawer(inProps, ref) {\n  var theme = useTheme();\n  var props = getThemeProps({\n    name: 'MuiSwipeableDrawer',\n    props: _extends({}, inProps),\n    theme: theme\n  });\n  var _props$anchor = props.anchor,\n      anchor = _props$anchor === void 0 ? 'left' : _props$anchor,\n      _props$disableBackdro = props.disableBackdropTransition,\n      disableBackdropTransition = _props$disableBackdro === void 0 ? false : _props$disableBackdro,\n      _props$disableDiscove = props.disableDiscovery,\n      disableDiscovery = _props$disableDiscove === void 0 ? false : _props$disableDiscove,\n      _props$disableSwipeTo = props.disableSwipeToOpen,\n      disableSwipeToOpen = _props$disableSwipeTo === void 0 ? iOS : _props$disableSwipeTo,\n      hideBackdrop = props.hideBackdrop,\n      _props$hysteresis = props.hysteresis,\n      hysteresis = _props$hysteresis === void 0 ? 0.52 : _props$hysteresis,\n      _props$minFlingVeloci = props.minFlingVelocity,\n      minFlingVelocity = _props$minFlingVeloci === void 0 ? 450 : _props$minFlingVeloci,\n      _props$ModalProps = props.ModalProps;\n  _props$ModalProps = _props$ModalProps === void 0 ? {} : _props$ModalProps;\n\n  var BackdropProps = _props$ModalProps.BackdropProps,\n      ModalPropsProp = _objectWithoutProperties(_props$ModalProps, [\"BackdropProps\"]),\n      onClose = props.onClose,\n      onOpen = props.onOpen,\n      open = props.open,\n      _props$PaperProps = props.PaperProps,\n      PaperProps = _props$PaperProps === void 0 ? {} : _props$PaperProps,\n      SwipeAreaProps = props.SwipeAreaProps,\n      _props$swipeAreaWidth = props.swipeAreaWidth,\n      swipeAreaWidth = _props$swipeAreaWidth === void 0 ? 20 : _props$swipeAreaWidth,\n      _props$transitionDura = props.transitionDuration,\n      transitionDuration = _props$transitionDura === void 0 ? transitionDurationDefault : _props$transitionDura,\n      _props$variant = props.variant,\n      variant = _props$variant === void 0 ? 'temporary' : _props$variant,\n      other = _objectWithoutProperties(props, [\"anchor\", \"disableBackdropTransition\", \"disableDiscovery\", \"disableSwipeToOpen\", \"hideBackdrop\", \"hysteresis\", \"minFlingVelocity\", \"ModalProps\", \"onClose\", \"onOpen\", \"open\", \"PaperProps\", \"SwipeAreaProps\", \"swipeAreaWidth\", \"transitionDuration\", \"variant\"]);\n\n  var _React$useState = React.useState(false),\n      maybeSwiping = _React$useState[0],\n      setMaybeSwiping = _React$useState[1];\n\n  var swipeInstance = React.useRef({\n    isSwiping: null\n  });\n  var swipeAreaRef = React.useRef();\n  var backdropRef = React.useRef();\n  var paperRef = React.useRef();\n  var touchDetected = React.useRef(false); // Ref for transition duration based on / to match swipe speed\n\n  var calculatedDurationRef = React.useRef(); // Use a ref so the open value used is always up to date inside useCallback.\n\n  useEnhancedEffect(function () {\n    calculatedDurationRef.current = null;\n  }, [open]);\n  var setPosition = React.useCallback(function (translate) {\n    var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n    var _options$mode = options.mode,\n        mode = _options$mode === void 0 ? null : _options$mode,\n        _options$changeTransi = options.changeTransition,\n        changeTransition = _options$changeTransi === void 0 ? true : _options$changeTransi;\n    var anchorRtl = getAnchor(theme, anchor);\n    var rtlTranslateMultiplier = ['right', 'bottom'].indexOf(anchorRtl) !== -1 ? 1 : -1;\n    var horizontalSwipe = isHorizontal(anchor);\n    var transform = horizontalSwipe ? \"translate(\".concat(rtlTranslateMultiplier * translate, \"px, 0)\") : \"translate(0, \".concat(rtlTranslateMultiplier * translate, \"px)\");\n    var drawerStyle = paperRef.current.style;\n    drawerStyle.webkitTransform = transform;\n    drawerStyle.transform = transform;\n    var transition = '';\n\n    if (mode) {\n      transition = theme.transitions.create('all', getTransitionProps({\n        timeout: transitionDuration\n      }, {\n        mode: mode\n      }));\n    }\n\n    if (changeTransition) {\n      drawerStyle.webkitTransition = transition;\n      drawerStyle.transition = transition;\n    }\n\n    if (!disableBackdropTransition && !hideBackdrop) {\n      var backdropStyle = backdropRef.current.style;\n      backdropStyle.opacity = 1 - translate / getMaxTranslate(horizontalSwipe, paperRef.current);\n\n      if (changeTransition) {\n        backdropStyle.webkitTransition = transition;\n        backdropStyle.transition = transition;\n      }\n    }\n  }, [anchor, disableBackdropTransition, hideBackdrop, theme, transitionDuration]);\n  var handleBodyTouchEnd = useEventCallback(function (event) {\n    if (!touchDetected.current) {\n      return;\n    }\n\n    nodeThatClaimedTheSwipe = null;\n    touchDetected.current = false;\n    setMaybeSwiping(false); // The swipe wasn't started.\n\n    if (!swipeInstance.current.isSwiping) {\n      swipeInstance.current.isSwiping = null;\n      return;\n    }\n\n    swipeInstance.current.isSwiping = null;\n    var anchorRtl = getAnchor(theme, anchor);\n    var horizontal = isHorizontal(anchor);\n    var current;\n\n    if (horizontal) {\n      current = calculateCurrentX(anchorRtl, event.changedTouches);\n    } else {\n      current = calculateCurrentY(anchorRtl, event.changedTouches);\n    }\n\n    var startLocation = horizontal ? swipeInstance.current.startX : swipeInstance.current.startY;\n    var maxTranslate = getMaxTranslate(horizontal, paperRef.current);\n    var currentTranslate = getTranslate(current, startLocation, open, maxTranslate);\n    var translateRatio = currentTranslate / maxTranslate;\n\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\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\n      return;\n    }\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  var handleBodyTouchMove = useEventCallback(function (event) {\n    // the ref may be null when a parent component updates while swiping\n    if (!paperRef.current || !touchDetected.current) {\n      return;\n    } // We are not supposed to handle this touch move because the swipe was started in a scrollable container in the drawer\n\n\n    if (nodeThatClaimedTheSwipe != null && nodeThatClaimedTheSwipe !== swipeInstance.current) {\n      return;\n    }\n\n    var anchorRtl = getAnchor(theme, anchor);\n    var horizontalSwipe = isHorizontal(anchor);\n    var currentX = calculateCurrentX(anchorRtl, event.touches);\n    var currentY = calculateCurrentY(anchorRtl, event.touches);\n\n    if (open && paperRef.current.contains(event.target) && nodeThatClaimedTheSwipe == null) {\n      var domTreeShapes = getDomTreeShapes(event.target, paperRef.current);\n      var nativeHandler = findNativeHandler({\n        domTreeShapes: domTreeShapes,\n        start: horizontalSwipe ? swipeInstance.current.startX : swipeInstance.current.startY,\n        current: horizontalSwipe ? currentX : currentY,\n        anchor: anchor\n      });\n\n      if (nativeHandler) {\n        nodeThatClaimedTheSwipe = nativeHandler;\n        return;\n      }\n\n      nodeThatClaimedTheSwipe = swipeInstance.current;\n    } // We don't know yet.\n\n\n    if (swipeInstance.current.isSwiping == null) {\n      var dx = Math.abs(currentX - swipeInstance.current.startX);\n      var dy = Math.abs(currentY - swipeInstance.current.startY); // We are likely to be swiping, let's prevent the scroll event on iOS.\n\n      if (dx > dy) {\n        if (event.cancelable) {\n          event.preventDefault();\n        }\n      }\n\n      var definitelySwiping = horizontalSwipe ? dx > dy && dx > UNCERTAINTY_THRESHOLD : dy > dx && dy > UNCERTAINTY_THRESHOLD;\n\n      if (definitelySwiping === true || (horizontalSwipe ? dy > UNCERTAINTY_THRESHOLD : dx > UNCERTAINTY_THRESHOLD)) {\n        swipeInstance.current.isSwiping = definitelySwiping;\n\n        if (!definitelySwiping) {\n          handleBodyTouchEnd(event);\n          return;\n        } // Shift the starting point.\n\n\n        swipeInstance.current.startX = currentX;\n        swipeInstance.current.startY = currentY; // Compensate for the part of the drawer displayed on touch start.\n\n        if (!disableDiscovery && !open) {\n          if (horizontalSwipe) {\n            swipeInstance.current.startX -= swipeAreaWidth;\n          } else {\n            swipeInstance.current.startY -= swipeAreaWidth;\n          }\n        }\n      }\n    }\n\n    if (!swipeInstance.current.isSwiping) {\n      return;\n    }\n\n    var maxTranslate = getMaxTranslate(horizontalSwipe, paperRef.current);\n    var startLocation = horizontalSwipe ? swipeInstance.current.startX : swipeInstance.current.startY;\n\n    if (open && !swipeInstance.current.paperHit) {\n      startLocation = Math.min(startLocation, maxTranslate);\n    }\n\n    var translate = getTranslate(horizontalSwipe ? currentX : currentY, startLocation, open, maxTranslate);\n\n    if (open) {\n      if (!swipeInstance.current.paperHit) {\n        var paperHit = horizontalSwipe ? currentX < maxTranslate : currentY < maxTranslate;\n\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\n    if (swipeInstance.current.lastTranslate === null) {\n      swipeInstance.current.lastTranslate = translate;\n      swipeInstance.current.lastTime = performance.now() + 1;\n    }\n\n    var velocity = (translate - swipeInstance.current.lastTranslate) / (performance.now() - swipeInstance.current.lastTime) * 1e3; // Low Pass filter.\n\n    swipeInstance.current.velocity = swipeInstance.current.velocity * 0.4 + velocity * 0.6;\n    swipeInstance.current.lastTranslate = translate;\n    swipeInstance.current.lastTime = performance.now(); // We are swiping, let's prevent the scroll event on iOS.\n\n    if (event.cancelable) {\n      event.preventDefault();\n    }\n\n    setPosition(translate);\n  });\n  var handleBodyTouchStart = useEventCallback(function (event) {\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 (event.defaultPrevented) {\n      return;\n    } // We can only have one node at the time claiming ownership for handling the swipe.\n\n\n    if (event.muiHandled) {\n      return;\n    } // At least one element clogs the drawer interaction zone.\n\n\n    if (open && !backdropRef.current.contains(event.target) && !paperRef.current.contains(event.target)) {\n      return;\n    }\n\n    var anchorRtl = getAnchor(theme, anchor);\n    var horizontalSwipe = isHorizontal(anchor);\n    var currentX = calculateCurrentX(anchorRtl, event.touches);\n    var currentY = calculateCurrentY(anchorRtl, event.touches);\n\n    if (!open) {\n      if (disableSwipeToOpen || event.target !== swipeAreaRef.current) {\n        return;\n      }\n\n      if (horizontalSwipe) {\n        if (currentX > swipeAreaWidth) {\n          return;\n        }\n      } else if (currentY > swipeAreaWidth) {\n        return;\n      }\n    }\n\n    event.muiHandled = true;\n    nodeThatClaimedTheSwipe = null;\n    swipeInstance.current.startX = currentX;\n    swipeInstance.current.startY = currentY;\n    setMaybeSwiping(true);\n\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 ? 20 : -swipeAreaWidth), {\n        changeTransition: false\n      });\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  React.useEffect(function () {\n    if (variant === 'temporary') {\n      var doc = ownerDocument(paperRef.current);\n      doc.addEventListener('touchstart', handleBodyTouchStart);\n      doc.addEventListener('touchmove', handleBodyTouchMove, {\n        passive: false\n      });\n      doc.addEventListener('touchend', handleBodyTouchEnd);\n      return function () {\n        doc.removeEventListener('touchstart', handleBodyTouchStart);\n        doc.removeEventListener('touchmove', handleBodyTouchMove, {\n          passive: false\n        });\n        doc.removeEventListener('touchend', handleBodyTouchEnd);\n      };\n    }\n\n    return undefined;\n  }, [variant, handleBodyTouchStart, handleBodyTouchMove, handleBodyTouchEnd]);\n  React.useEffect(function () {\n    return function () {\n      // We need to release the lock.\n      if (nodeThatClaimedTheSwipe === swipeInstance.current) {\n        nodeThatClaimedTheSwipe = null;\n      }\n    };\n  }, []);\n  React.useEffect(function () {\n    if (!open) {\n      setMaybeSwiping(false);\n    }\n  }, [open]);\n  var handleBackdropRef = React.useCallback(function (instance) {\n    // #StrictMode ready\n    backdropRef.current = ReactDOM.findDOMNode(instance);\n  }, []);\n  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Drawer, _extends({\n    open: variant === 'temporary' && maybeSwiping ? true : open,\n    variant: variant,\n    ModalProps: _extends({\n      BackdropProps: _extends({}, BackdropProps, {\n        ref: handleBackdropRef\n      })\n    }, ModalPropsProp),\n    PaperProps: _extends({}, PaperProps, {\n      style: _extends({\n        pointerEvents: variant === 'temporary' && !open ? 'none' : ''\n      }, PaperProps.style),\n      ref: paperRef\n    }),\n    anchor: anchor,\n    transitionDuration: calculatedDurationRef.current || transitionDuration,\n    onClose: onClose,\n    ref: ref\n  }, other)), !disableSwipeToOpen && variant === 'temporary' && /*#__PURE__*/React.createElement(NoSsr, null, /*#__PURE__*/React.createElement(SwipeArea, _extends({\n    anchor: anchor,\n    ref: swipeAreaRef,\n    width: swipeAreaWidth\n  }, SwipeAreaProps))));\n});\nprocess.env.NODE_ENV !== \"production\" ? SwipeableDrawer.propTypes = {\n  /**\n   * @ignore\n   */\n  anchor: PropTypes.oneOf(['left', 'top', 'right', 'bottom']),\n\n  /**\n   * The content of the component.\n   */\n  children: PropTypes.node,\n\n  /**\n   * Disable the backdrop transition.\n   * This can improve the FPS on low-end devices.\n   */\n  disableBackdropTransition: PropTypes.bool,\n\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   */\n  disableDiscovery: PropTypes.bool,\n\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   */\n  disableSwipeToOpen: PropTypes.bool,\n\n  /**\n   * @ignore\n   */\n  hideBackdrop: PropTypes.bool,\n\n  /**\n   * Affects how far the drawer must be opened/closed to change his state.\n   * Specified as percent (0-1) of the width of the drawer\n   */\n  hysteresis: PropTypes.number,\n\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   */\n  minFlingVelocity: PropTypes.number,\n\n  /**\n   * @ignore\n   */\n  ModalProps: PropTypes.shape({\n    BackdropProps: PropTypes.shape({\n      component: elementTypeAcceptingRef\n    })\n  }),\n\n  /**\n   * Callback fired when the component requests to be closed.\n   *\n   * @param {object} event The event source of the callback.\n   */\n  onClose: PropTypes.func.isRequired,\n\n  /**\n   * Callback fired when the component requests to be opened.\n   *\n   * @param {object} event The event source of the callback.\n   */\n  onOpen: PropTypes.func.isRequired,\n\n  /**\n   * If `true`, the drawer is open.\n   */\n  open: PropTypes.bool.isRequired,\n\n  /**\n   * @ignore\n   */\n  PaperProps: PropTypes.shape({\n    component: elementTypeAcceptingRef,\n    style: PropTypes.object\n  }),\n\n  /**\n   * The element is used to intercept the touch events on the edge.\n   */\n  SwipeAreaProps: PropTypes.object,\n\n  /**\n   * The width of the left most (or right most) area in pixels where the\n   * drawer can be swiped open from.\n   */\n  swipeAreaWidth: PropTypes.number,\n\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   */\n  transitionDuration: PropTypes.oneOfType([PropTypes.number, PropTypes.shape({\n    enter: PropTypes.number,\n    exit: PropTypes.number\n  })]),\n\n  /**\n   * @ignore\n   */\n  variant: PropTypes.oneOf(['permanent', 'persistent', 'temporary'])\n} : void 0;\nexport default SwipeableDrawer;"]},"metadata":{},"sourceType":"module"}