cask "opera@beta" do
  version "126.0.5750.30"
  sha256 "63cef0cda745407627cfae38bef69d3b44203e257dc16d01164a4ddbe9dff527"

  url "https://get.geo.opera.com/pub/opera-beta/#{version}/mac/Opera_beta_#{version}_Setup.dmg"
  name "Opera Beta"
  desc "Web browser"
  homepage "https://www.opera.com/computer/beta"

  # https://blogs.opera.com/desktop/2026/01/opera-126-0-5750-30-beta-update
  deprecate! date: "2026-02-05", because: :discontinued

  auto_updates true
  depends_on macos: :big_sur

  app "Opera Beta.app"

  zap trash: [
    "~/Library/Application Support/com.operasoftware.OperaNext",
    "~/Library/Caches/com.operasoftware.Installer.OperaNext",
    "~/Library/Caches/com.operasoftware.OperaNext",
    "~/Library/Cookies/com.operasoftware.OperaNext.binarycookies",
    "~/Library/HTTPStorages/com.operasoftware.Installer.OperaNext",
    "~/Library/Preferences/com.operasoftware.OperaNext.plist",
    "~/Library/Saved Application State/com.operasoftware.OperaNext.savedState",
  ]
end
