cask "meld-studio" do
  version "0.10.5.1"
  sha256 :no_check

  url "https://packages.streamwithmeld.com/MeldStudioInstaller.dmg",
      verified: "packages.streamwithmeld.com/"
  name "Meld Studio"
  desc "Live streaming and recording software"
  homepage "https://www.meldstudio.co/"

  livecheck do
    url :url
    strategy :extract_plist
  end

  auto_updates true
  depends_on macos: :monterey

  app "Meld Studio.app"

  uninstall launchctl: [
    "co.meldstudio.keystone.agent",
    "co.meldstudio.keystone.xpcservice",
    "co.meldstudio.MeldStudioUpdater.wake",
  ]

  zap trash: [
    "~/Library/Application Support/MeldStudio",
    "~/Library/HTTPStorages/co.meldstudio.MeldStudioUpdater",
    "~/Library/LaunchAgents/co.meldstudio.keystone.agent.plist",
    "~/Library/LaunchAgents/co.meldstudio.keystone.xpcservice.plist",
    "~/Library/LaunchAgents/co.meldstudio.MeldStudioUpdater.wake.plist",
    "~/Library/MeldStudio",
  ]
end
