     return "\(offset) - \(breakId)(\(breakType)) \n\(url)\n\n"
   }
 }
+enum AdType {
+  case instream
+  case outstream
+}
 class NonLinearView: UIView {
   var isAdHidden = true {
     didSet {

    
    addSubview(close)
    constrain(close, image) {
      $0.0.centerX == $0.1.right
      $0.0.centerY == $0.1.top
      $0.0.height == 44
      $0.0.width == 44
    }

    close.isHidden = true
    close.addTarget(self, action: #selector(NonLinearView.dismissAds), for: .touchUpInside)
    
    let tap = UITapGestureRecognizer(target: self, action: #selector(NonLinearView.clickThrough))
    image.isUserInteractionEnabled = true
    image.addGestureRecognizer(tap)
  }
  required init?(coder _: NSCoder) {
    fatalError("init(coder:) has not been implemented")

        default: break
        }
      }
      guard let heightPercentage = Float(adParameters["height"] ?? "100") else { return }
      constrain(image, replace: self.image.imageSize) {
        $0.width == self.bounds.width
        $0.height == self.bounds.height * CGFloat(heightPercentage * 0.01)
      }
    }
  }
  convenience init(type: AdType) {
    self.init(frame: .zero)
    close = type == .instream ? CloseButton(type: .system) : SquareCloseButton(type: .system)
    clipsToBounds = true
    image.clipsToBounds = true
    addSubview(image)
