import { v4 as uuidv4 } from 'uuid';

export default class BaseAnnotation {
  constructor ({
    container,
    annotation,
    viewport,
    page,
    eventBus
  }) {
    if (!annotation.name) {
      annotation.name = uuidv4()
    }
    this.container = container
    this.annotation = annotation
    this.viewport = viewport
    this.scale = viewport.scale
    this.isEdit = false
    this.eventBus = eventBus

    this.deleteSvgStr = `<rect width="30" height="30" rx="2" fill="#DDE9FF"/>
      <path fill-rule="evenodd" clip-rule="evenodd" d="M19 6.5V9.5H24V10.5H21.5V23.5H8.5V10.5H6V9.5H11V6.5H19ZM9.5 10.5V22.5H20.5V10.5H9.5ZM18 7.5V9.5H12V7.5H18ZM13.5 13V20H12.5V13H13.5ZM17.5 20V13H16.5V20H17.5Z" fill="#333333"/>
    `

    this.page = page
  }
}
