{"version":3,"file":"ngx-swipeable-panel.mjs","sources":["../../../../libs/swipeable-panel/src/lib/constants/index.ts","../../../../libs/swipeable-panel/src/lib/utilities/funcs/nil.ts","../../../../libs/swipeable-panel/src/lib/core/swipeable-core.ts","../../../../libs/swipeable-panel/src/lib/utilities/funcs/mouse.ts","../../../../libs/swipeable-panel/src/lib/swipeable-panel.directive.ts","../../../../libs/swipeable-panel/src/lib/swipeable-panel.module.ts","../../../../libs/swipeable-panel/src/ngx-swipeable-panel.ts"],"sourcesContent":["/** Snap positions represented in [%] */\nexport const SwipeablePanelSnap = {\n  Top: 0,\n  Center: 50,\n  Bottom: 100,\n};\n\n/** Snap treshold represented in [%] */\nexport type SwipeablePanelSnapTreshold = {\n  top?: number;\n  center?: number;\n  bottom?: number;\n};\n\n/** Wait time before swipping can start in [ms] */\nexport const WAIT_TIME_BEFORE_SWIPE_CAN_START = 250;\n\n/** Motion offset before swipping can start in [%] */\nexport const MOTION_OFFSET_BEFORE_SWIPE_CAN_START = 1;\n\nexport const SWIPEABLE_PANEL_STYLE = `\n          z-index: 1000;\n          display: block;\n          position: absolute;\n          left: 0;\n          right: 0;\n          bottom: 0;\n          height: auto;\n        `;\n","export function isNil(val: unknown): val is null | undefined {\n  return val === null || val === undefined;\n}\n\nexport function notNil<T>(val: T): val is NonNullable<T> {\n  return !isNil(val);\n}\n","import {\n  MOTION_OFFSET_BEFORE_SWIPE_CAN_START,\n  SwipeablePanelSnap,\n  SwipeablePanelSnapTreshold,\n  WAIT_TIME_BEFORE_SWIPE_CAN_START,\n} from '../constants';\nimport { isNil, notNil } from '../utilities';\nimport {\n  SwipeCoordinate,\n  SwipeMovement,\n  SwipeablePanelSnapPosition,\n} from './types';\n\nexport function getTouchCoordinate(event: TouchEvent): SwipeCoordinate {\n  return {\n    x: event.changedTouches[0].clientX,\n    y: event.changedTouches[0].clientY,\n  };\n}\n\nexport function canUpdatePosition(\n  position: SwipeablePanelSnapPosition | number,\n) {\n  return (\n    position <= SwipeablePanelSnap.Bottom && position >= SwipeablePanelSnap.Top\n  );\n}\n\nexport function isSwipeActive(\n  movement: SwipeMovement,\n  swipeInitTime?: number,\n): boolean {\n  const currentTime = new Date().getTime();\n\n  if (\n    isNil(swipeInitTime) ||\n    isNaN(swipeInitTime) ||\n    !isFinite(swipeInitTime) ||\n    swipeInitTime > currentTime\n  )\n    return false;\n\n  const elapsedTimeInMs = currentTime - swipeInitTime;\n\n  // measured in ms\n  if (elapsedTimeInMs < WAIT_TIME_BEFORE_SWIPE_CAN_START) return false;\n\n  // measured in %\n  if (\n    (Math.abs(movement.from - movement.to) / movement.from) * 100 <=\n    MOTION_OFFSET_BEFORE_SWIPE_CAN_START\n  )\n    return false;\n\n  return true;\n}\n\nexport function validateSnapTresholds(treshold?: SwipeablePanelSnapTreshold) {\n  if (isNil(treshold)) return;\n\n  const { top, center, bottom } = treshold;\n\n  if (\n    notNil(top) &&\n    notNil(center) &&\n    top >= SwipeablePanelSnap.Center - center\n  ) {\n    throw new Error('Top and center treshold should not overlap.');\n  }\n\n  if (\n    notNil(top) &&\n    isNil(center) &&\n    notNil(bottom) &&\n    top >= SwipeablePanelSnap.Bottom - bottom\n  ) {\n    throw new Error('Top and bottom treshold should not overlap.');\n  }\n\n  if (\n    isNil(top) &&\n    notNil(center) &&\n    notNil(bottom) &&\n    SwipeablePanelSnap.Center + center > SwipeablePanelSnap.Bottom - bottom\n  ) {\n    throw new Error('Bottom and center treshold should not overlap.');\n  }\n}\n","export function isLeftMouseDown(event: MouseEvent): boolean {\n  // 1: Primary button (usually the left button)\n  return event.buttons === 1;\n}\n\n// This will fail if there's any kind of rotation going on.\nexport function isMouseWithinElement(event: MouseEvent, element: HTMLElement) {\n  const offset = element.getBoundingClientRect();\n  return event.clientX - offset.x >= 0 && event.clientY - offset.y >= 0;\n}\n","import { BooleanInput, coerceBooleanProperty } from '@angular/cdk/coercion';\nimport {\n  Directive,\n  ElementRef,\n  EventEmitter,\n  HostBinding,\n  HostListener,\n  Input,\n  NgZone,\n  OnDestroy,\n  OnInit,\n  Output,\n  inject,\n} from '@angular/core';\nimport {\n  SWIPEABLE_PANEL_STYLE,\n  SwipeablePanelSnap,\n  SwipeablePanelSnapTreshold,\n} from './constants';\nimport { SwipeEvent } from './core/types';\nimport {\n  canUpdatePosition,\n  getTouchCoordinate,\n  isSwipeActive,\n  validateSnapTresholds,\n} from './core/swipeable-core';\nimport { isLeftMouseDown, isMouseWithinElement } from './utilities/funcs/mouse';\nimport { isNil, notNil } from './utilities';\n\n@Directive({\n  selector: '[ngxSwipeablePanel]',\n})\nexport class SwipeablePanelDirective implements OnInit, OnDestroy {\n  private elementRef = inject(ElementRef);\n  private zone = inject(NgZone);\n  private startPosition?: number;\n  private currentPosition = 0;\n  private swipeInitTime?: number;\n  private _enabled = true;\n  private _closed = false;\n  private _treshold?: SwipeablePanelSnapTreshold;\n  private observer: ResizeObserver;\n\n  get isClosed() {\n    return this._closed;\n  }\n\n  get swipeablePanel(): HTMLDivElement {\n    return this.elementRef.nativeElement;\n  }\n\n  get swipeablePanelParentHeight(): number {\n    // eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain\n    return this.swipeablePanel.offsetParent?.clientHeight!;\n  }\n\n  @Input()\n  set snapTreshold(treshold: SwipeablePanelSnapTreshold | undefined) {\n    this._treshold = treshold;\n    validateSnapTresholds(this._treshold);\n  }\n  get snapTreshold(): SwipeablePanelSnapTreshold | undefined {\n    return this._treshold;\n  }\n\n  @Input()\n  swipeHeightWhenClosed = 0;\n\n  @Input() style = '';\n\n  @Input({\n    alias: 'ngxSwipeablePanel',\n    required: true,\n  })\n  set enabled(value: BooleanInput) {\n    this._enabled = coerceBooleanProperty(value);\n\n    if (!this._enabled) {\n      this.position = null;\n    }\n  }\n  get enabled(): boolean {\n    return this._enabled;\n  }\n\n  @HostBinding('style.transition')\n  @Input()\n  cssTransition: string = 'top 500ms ease 0s';\n\n  @Output() swipeStart = new EventEmitter();\n  @Output() swipping = new EventEmitter();\n  @Output() swipeEnd = new EventEmitter();\n  @Output() positionChange = new EventEmitter<SwipeEvent>();\n\n  @HostBinding('style')\n  get styles(): string {\n    return [this.style, this.enabled ? SWIPEABLE_PANEL_STYLE : ''].join(' ');\n  }\n\n  @HostBinding('style.top.%')\n  position: number | null = SwipeablePanelSnap.Center;\n\n  get canSnapToTop() {\n    return (\n      this.position !== SwipeablePanelSnap.Top &&\n      this.getCurrentPositionPercentage() <=\n        SwipeablePanelSnap.Top + (this.snapTreshold?.top ?? 0)\n    );\n  }\n\n  get canSnapToCenter() {\n    const currentPositionPercentage = this.getCurrentPositionPercentage();\n    return (\n      this.position !== SwipeablePanelSnap.Center &&\n      currentPositionPercentage >=\n        SwipeablePanelSnap.Center - (this.snapTreshold?.center ?? 0) &&\n      currentPositionPercentage <=\n        SwipeablePanelSnap.Center + (this.snapTreshold?.center ?? 0)\n    );\n  }\n\n  get canSnapToBottom() {\n    const bottomWithOffset =\n      SwipeablePanelSnap.Bottom - (this.snapTreshold?.bottom ?? 0);\n    return (\n      (this.position !== SwipeablePanelSnap.Bottom &&\n        bottomWithOffset === SwipeablePanelSnap.Bottom) ||\n      this.position === bottomWithOffset ||\n      this.getCurrentPositionPercentage() >= bottomWithOffset\n    );\n  }\n\n  get canUpdatePosition() {\n    return canUpdatePosition(this.getCurrentPositionPercentage());\n  }\n\n  ngOnInit(): void {\n    this.adjustPositionOnResize();\n  }\n\n  ngOnDestroy(): void {\n    this.observer.unobserve(this.swipeablePanel);\n  }\n\n  @HostListener('document:mousedown', ['$event'])\n  mouseDown(event: MouseEvent) {\n    if (\n      this.enabled &&\n      isLeftMouseDown(event) &&\n      isMouseWithinElement(event, this.swipeablePanel)\n    ) {\n      this.startPosition = event.clientY;\n      this.swipeInitTime = new Date().getTime();\n      this.swipeStart.emit();\n    }\n  }\n\n  @HostListener('document:mousemove', ['$event'])\n  mouseMove(event: MouseEvent) {\n    event.preventDefault();\n\n    const currentPosition = event.clientY;\n    if (\n      !this.canSwipeByTouchOrMouse(currentPosition) ||\n      !isLeftMouseDown(event)\n    )\n      return;\n\n    this.setPosition(currentPosition);\n    this.swipping.emit();\n  }\n\n  @HostListener('document:mouseup', ['$event'])\n  mouseUp(event: MouseEvent) {\n    const currentPosition = event.clientY;\n    if (!this.canSwipeByTouchOrMouse(currentPosition)) {\n      this.deactivateSwipe();\n      return;\n    }\n\n    this.snapToPosition(currentPosition);\n    this.swipeEnd.emit();\n  }\n\n  @HostListener('touchstart', ['$event'])\n  touchStart(event: TouchEvent) {\n    if (!this.enabled) return;\n\n    this.startPosition = getTouchCoordinate(event).y;\n    this.swipeInitTime = new Date().getTime();\n    this.swipeStart.emit();\n  }\n\n  @HostListener('touchmove', ['$event'])\n  touchMove(event: TouchEvent) {\n    event.preventDefault();\n\n    const currentPosition = getTouchCoordinate(event).y;\n    if (!this.canSwipeByTouchOrMouse(currentPosition)) return;\n\n    this.setPosition(currentPosition);\n    this.swipping.emit();\n  }\n\n  @HostListener('touchend', ['$event'])\n  touchEnd(event: TouchEvent) {\n    const currentPosition = getTouchCoordinate(event).y;\n    if (!this.canSwipeByTouchOrMouse(currentPosition)) return;\n\n    this.snapToPosition(currentPosition);\n    this.swipeEnd.emit();\n  }\n\n  close(): void {\n    if (!this.enabled) return;\n\n    this.currentPosition =\n      this.swipeablePanelParentHeight - this.swipeHeightWhenClosed;\n    this.position = this.getClosedPosition();\n    this._closed = true;\n    this.positionChange.emit({ value: this.position, snapped: false });\n  }\n\n  setPosition(value: number): void {\n    if (!this.enabled) return;\n\n    this.currentPosition = value;\n\n    if (!this.canUpdatePosition) return;\n\n    this.position = this.getCurrentPositionPercentage();\n    this._closed = this.position >= this.getClosedPosition();\n\n    this.positionChange.emit({ value: this.position, snapped: false });\n  }\n\n  snapToPosition(value: number): void {\n    if (!this.enabled) return;\n\n    if (isNil(this.snapTreshold)) {\n      this.setPosition(value);\n      return;\n    }\n\n    this.currentPosition = value;\n    const previousPosition = this.position;\n\n    if (this.canSnapToTop) {\n      this.position = SwipeablePanelSnap.Top;\n      this._closed = false;\n    } else if (this.canSnapToCenter) {\n      this.position = SwipeablePanelSnap.Center;\n      this._closed = false;\n    } else if (this.canSnapToBottom) {\n      this.position = this.getClosedPosition();\n      this._closed = true;\n    }\n\n    this.deactivateSwipe();\n\n    if (this.position !== previousPosition) {\n      this.positionChange.emit({ value: this.position, snapped: true });\n    }\n  }\n\n  getCurrentPositionPercentage(): number {\n    return (\n      100 -\n      Math.round(\n        ((this.swipeablePanelParentHeight - this.currentPosition) /\n          this.swipeablePanelParentHeight) *\n          100,\n      )\n    );\n  }\n\n  private canSwipeByTouchOrMouse(currentPosition: number): boolean {\n    return (\n      this.enabled &&\n      notNil(this.startPosition) &&\n      isSwipeActive(\n        { from: this.startPosition, to: currentPosition },\n        this.swipeInitTime,\n      )\n    );\n  }\n\n  private deactivateSwipe(): void {\n    this.startPosition = undefined;\n    this.swipeInitTime = undefined;\n  }\n\n  private getClosedPosition(): number {\n    return this.swipeablePanelParentHeight === 0\n      ? SwipeablePanelSnap.Bottom\n      : Math.round(\n          SwipeablePanelSnap.Bottom -\n            (this.swipeHeightWhenClosed / this.swipeablePanelParentHeight) *\n              100,\n        );\n  }\n\n  private adjustPositionOnResize(): void {\n    this.observer = new ResizeObserver((entries) => {\n      const entry = notNil(entries) && entries[0];\n      if (isNil(entry)) return;\n      this.zone.run(() => {\n        const currentBottomOffset = this.getClosedPosition();\n        const tresholdBottomOffset = this.snapTreshold?.bottom ?? 0;\n        if (this.isClosed && currentBottomOffset >= tresholdBottomOffset) {\n          this.position = this.getClosedPosition();\n        }\n      });\n    });\n\n    this.observer.observe(this.swipeablePanel);\n  }\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { SwipeablePanelDirective } from './swipeable-panel.directive';\n\n@NgModule({\n  imports: [CommonModule],\n  declarations: [SwipeablePanelDirective],\n  exports: [SwipeablePanelDirective],\n})\nexport class SwipeablePanelModule {}\n","/**\n * Generated bund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