diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index b0d2951a2..45e06096f 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -69,4 +69,12 @@ body: attributes: label: Data from about:support if applicable (click on the "Copy text to clipboard" button) description: Please copy and paste about:support data if you think it might be relevant. This will help us understand your environment. - render: shell + value: | +
+ about:support + + + ``` + Select this line and paste your about:support clipboard + ``` +
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 37a257f7f..a16ec8328 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -63,9 +63,9 @@ jobs: with: submodules: recursive token: ${{ secrets.DEPLOY_KEY }} - fetch-depth: 0 - name: Check if correct branch + if: ${{ inputs.create_release }} run: | echo "Checking if we are on the correct branch" git branch @@ -74,6 +74,8 @@ jobs: branch="${{ inputs.update_branch }}" if [[ $branch == "twilight" ]]; then branch="dev" + elif [[ $branch == "release" ]]; then + branch="stable" fi if [[ $(git branch --show-current) != $branch ]]; then echo ">>> Branch mismatch" @@ -275,15 +277,15 @@ jobs: - name: Compress run: | cd engine - tar --use-compress-program=zstd -hcf ../zen.source.tar.gz * + tar --use-compress-program=zstd -hcf ../zen.source.tar.zst * cd .. - name: Upload artifact uses: actions/upload-artifact@v4 with: retention-days: 5 - name: zen.source.tar.gz - path: ./zen.source.tar.gz + name: zen.source.tar.zst + path: ./zen.source.tar.zst windows-step-1: name: Windows build step 1 (PGO build) @@ -385,7 +387,7 @@ jobs: if [ "${{ inputs.update_branch }}" = "twilight" ]; then sed -i -e 's/Name=Zen Browser/Name=Zen Twilight/g' AppDir/zen.desktop - sed -i -e 's/StartupWMClass=zen-release/StartupWMClass=zen-twilight/g' AppDir/zen.desktop + sed -i -e 's/StartupWMClass=zen/StartupWMClass=zen-twilight/g' AppDir/zen.desktop fi APPDIR=AppDir @@ -489,7 +491,7 @@ jobs: uses: marvinpinto/action-automatic-releases@master with: files: | - zen.source.tar.gz + zen.source.tar.zst zen.linux-x86_64.tar.bz2 zen.linux-aarch64.tar.bz2 zen-x86_64.AppImage @@ -512,7 +514,7 @@ jobs: title: 'Twilight build - ${{ needs.build-data.outputs.version }} (${{ needs.build-data.outputs.build_date }} at ${{ needs.build-data.outputs.build_time }})' draft: false prerelease: true - repo_token: ${{ github.token }} + repo_token: ${{ secrets.DEPLOY_KEY }} env: GITHUB_REPOSITORY: ${{ github.repository }} @@ -525,7 +527,7 @@ jobs: prerelease: false title: 'Release build - ${{ needs.build-data.outputs.version }} (${{ needs.build-data.outputs.build_date }})' files: | - zen.source.tar.gz + zen.source.tar.zst zen.linux-x86_64.tar.bz2 zen.linux-aarch64.tar.bz2 zen-x86_64.AppImage diff --git a/.github/workflows/linux-release-build.yml b/.github/workflows/linux-release-build.yml index 50ce86cb8..8aeae6c55 100644 --- a/.github/workflows/linux-release-build.yml +++ b/.github/workflows/linux-release-build.yml @@ -16,7 +16,8 @@ jobs: build-linux: permissions: contents: write - runs-on: ubuntu-latest + # aarch64 does not need full 16x + runs-on: ${{ (inputs.release-branch == 'release' && matrix.arch == 'x86_64') && 'ubuntu-latest' || 'ubuntu-latest' }} strategy: fail-fast: false matrix: @@ -125,22 +126,16 @@ jobs: - name: Build env: SURFER_COMPAT: ${{ matrix.arch }} + ZEN_RELEASE_BRANCH: ${{ inputs.release-branch }} continue-on-error: true run: | export SURFER_PLATFORM="linux" - sh .github/workflows/src/release-build.sh - - - name: Build again if it failed - if: failure() - env: - SURFER_COMPAT: ${{ matrix.arch }} - run: | - export SURFER_PLATFORM="linux" - sh .github/workflows/src/release-build.sh + bash .github/workflows/src/release-build.sh - name: Package env: SURFER_COMPAT: ${{ matrix.arch }} + ZEN_GA_DISABLE_PGO: true run: | export SURFER_PLATFORM="linux" export ZEN_RELEASE=1 diff --git a/.github/workflows/macos-release-build.yml b/.github/workflows/macos-release-build.yml index 324c70bf7..e3bb85823 100644 --- a/.github/workflows/macos-release-build.yml +++ b/.github/workflows/macos-release-build.yml @@ -15,7 +15,7 @@ on: jobs: mac-build: name: Build macOS - ${{ matrix.arch }} - runs-on: macos-14 + runs-on: ${{ inputs.release-branch == 'release' && 'macos-14' || 'macos-14' }} strategy: fail-fast: false @@ -115,18 +115,10 @@ jobs: - name: Build Zen env: SURFER_COMPAT: ${{ matrix.arch }} + ZEN_RELEASE_BRANCH: ${{ inputs.release-branch }} run: | export SURFER_PLATFORM="darwin" - if test "${{ matrix.arch }}" = "x86_64"; then - export ZEN_DISABLE_LTO=1 - fi - sh .github/workflows/src/release-build.sh - - - name: Rebuild Zen if failed - if: failure() - run: | - export SURFER_PLATFORM="darwin" - sh .github/workflows/src/release-build.sh + bash .github/workflows/src/release-build.sh - name: Import APPLE DEVELOPER ID CERTIFICATE for .app uses: Apple-Actions/import-codesign-certs@v3 @@ -134,9 +126,18 @@ jobs: p12-file-base64: ${{ secrets.macOS_CERTIFICATES_P12_For_App_BASE64 }} p12-password: ${{ secrets.macOS_CERTIFICATES_P12_PASSWORD }} + - name: Import provisioning profile for .app + run: | + echo "${{ secrets.macOS_PROVISIONING_PROFILE }}" | base64 --decode > ./engine/Zen_Browser.provisionprofile + ls -la + - name: Package env: SURFER_COMPAT: ${{ matrix.arch }} + ZEN_GA_DISABLE_PGO: true + MACOS_APPLE_ACCOUNT_ID: ${{ secrets.macOS_AppleAccountId }} + MACOS_APPLE_DEVELOPER_ID_TEAM_ID: ${{ secrets.macOS_AppleDeveloperIdTeamId }} + MACOS_APPLE_DEVELOPER_ID_PASSWORD: ${{ secrets.macOS_AppleDeveloperIdPassword }} run: | export SURFER_PLATFORM="darwin" export MACOS_APPLE_DEVELOPER_ID="${{ secrets.macOS_AppleDeveloperId }}" @@ -147,6 +148,10 @@ jobs: run: | mv ./dist/output.mar macos-${{ matrix.arch }}.mar + - name: Remove sensitive information + run: | + rm -f ./engine/Zen_Browser.provisionprofile + - name: Sign .dmg run: | set -ex @@ -157,6 +162,8 @@ jobs: --apple-id "${{ secrets.macOS_AppleAccountId }}" \ --team-id "${{ secrets.macOS_AppleDeveloperIdTeamId }}" \ --password "${{ secrets.macOS_AppleDeveloperIdPassword }}" \ + --no-s3-acceleration \ + --verbose \ --wait xcrun stapler staple "zen.macos-${{ matrix.arch }}.dmg" diff --git a/.github/workflows/src/release-build.sh b/.github/workflows/src/release-build.sh index 809032a9a..54531b196 100644 --- a/.github/workflows/src/release-build.sh +++ b/.github/workflows/src/release-build.sh @@ -1,17 +1,19 @@ #!/bin/bash -set -ex +set -xe if command -v apt-get &> /dev/null; then - sudo apt-get update - sudo apt-get install -y xvfb + sudo add-apt-repository ppa:kisak/kisak-mesa + sudo apt update + sudo apt upgrade + sudo apt-get install -y xvfb libnvidia-egl-wayland1 mesa-utils libgl1-mesa-dri fi ulimit -n 4096 -if ! command -v Xvfb &> /dev/null; then +if command -v Xvfb &> /dev/null; then if ! test "$ZEN_CROSS_COMPILING"; then - Xvfb :2 -screen 0 1024x768x24 & + Xvfb :2 -nolisten tcp -noreset -screen 0 1024x768x24 & export LLVM_PROFDATA=$HOME/.mozbuild/clang/bin/llvm-profdata export DISPLAY=:2 fi diff --git a/.github/workflows/twilight-release-schedule.yml b/.github/workflows/twilight-release-schedule.yml index 110ec1147..bf2c3c7d2 100644 --- a/.github/workflows/twilight-release-schedule.yml +++ b/.github/workflows/twilight-release-schedule.yml @@ -4,6 +4,12 @@ on: schedule: - cron: '0 23 * * *' workflow_dispatch: + inputs: + create_release: + description: 'Whether to do a release' + required: false + type: boolean + default: true jobs: twilight-release-schedule: @@ -12,7 +18,7 @@ jobs: secrets: inherit uses: ./.github/workflows/build.yml with: - create_release: true + create_release: ${{ github.event_name != 'workflow_dispatch' && true || inputs.create_release }} update_branch: twilight update_version: false diff --git a/.github/workflows/windows-profile-build.yml b/.github/workflows/windows-profile-build.yml index 5c5e9b574..97a18017c 100644 --- a/.github/workflows/windows-profile-build.yml +++ b/.github/workflows/windows-profile-build.yml @@ -25,7 +25,7 @@ jobs: matrix: arch: [x86_64, aarch64] - runs-on: windows-latest + runs-on: ${{ inputs.release-branch == 'release' && 'windows-latest' || 'windows-latest' }} steps: - name: Checkout repository @@ -38,8 +38,8 @@ jobs: - name: Setup Git run: | - git config --global user.email "mr-cheff@users.noreply.github.com" - git config --global user.name "mr-cheff" + git config --global user.email "mauro-balades@users.noreply.github.com" + git config --global user.name "mauro-balades" - name: Setup pnpm run: npm install -g pnpm @@ -47,6 +47,9 @@ jobs: - name: Install Surfer run: npm i -g @zen-browser/surfer + - name: Load Surfer CI setup + run: pnpm surfer ci --brand ${{ inputs.release-branch }} --display-version ${{ inputs.build-version }} + - name: Download artifact if: ${{ matrix.arch == 'x86_64' }} uses: actions/download-artifact@v4 diff --git a/.github/workflows/windows-release-build.yml b/.github/workflows/windows-release-build.yml index 5d78f442b..b7d00dcf7 100644 --- a/.github/workflows/windows-release-build.yml +++ b/.github/workflows/windows-release-build.yml @@ -22,7 +22,8 @@ on: jobs: windows-build: name: Build Windows - ${{ matrix.arch }} - runs-on: ubuntu-latest + # aarch64 does not need full 16x, and we also dont use full LTO when generating GPO + runs-on: ${{ (inputs.release-branch == 'release' && !inputs.generate-gpo && matrix.arch == 'x86_64') && 'ubuntu-latest' || 'ubuntu-latest' }} strategy: fail-fast: false @@ -32,6 +33,7 @@ jobs: steps: - name: Free Disk Space (Ubuntu) uses: jlumbroso/free-disk-space@main + if: ${{ !(inputs.generate-gpo && matrix.arch == 'aarch64') }} with: tool-cache: false @@ -62,6 +64,7 @@ jobs: run: pnpm surfer ci --brand ${{ inputs.release-branch }} --display-version ${{ inputs.build-version }} - name: Download Firefox and dependencies + if: ${{ !(inputs.generate-gpo && matrix.arch == 'aarch64') }} run: pnpm surfer download - name: win-cross Cache @@ -81,7 +84,7 @@ jobs: core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); - name: Setup for Windows - if: steps.cache-win-cross.outputs.cache-hit != 'true' + if: steps.cache-win-cross.outputs.cache-hit != 'true' && !(inputs.generate-gpo && matrix.arch == 'aarch64') run: | set -x mkdir -p ~/win-cross @@ -91,10 +94,51 @@ jobs: tar --zstd -xvf wine.tar.zst -C ~/win-cross rm wine.tar.zst echo Setup Visual Studio - sudo apt install -y msitools python3-pip + sudo apt-get update + sudo apt-get install -y python3-pip autoconf \ + autoconf2.13 \ + automake \ + bison \ + build-essential \ + cabextract \ + curl \ + cmake \ + flex \ + gawk \ + gcc-multilib \ + git \ + gnupg \ + jq \ + libbz2-dev \ + libexpat1-dev \ + libffi-dev \ + libncursesw5-dev \ + libsqlite3-dev \ + libssl-dev \ + libtool \ + libucl-dev \ + libxml2-dev \ + msitools \ + ninja-build \ + openssh-client \ + p7zip-full \ + pkg-config \ + procps \ + python3-requests \ + python3-toml \ + scons \ + subversion \ + tar \ + unzip \ + uuid \ + uuid-dev \ + wget \ + zip \ + zlib1g-dev ./mach python --virtualenv build taskcluster/scripts/misc/get_vs.py build/vs/vs2022.yaml ~/win-cross/vs2022 - name: Bootstrap + if: ${{ !(inputs.generate-gpo && matrix.arch == 'aarch64') }} run: | set -x cd engine/ @@ -113,6 +157,7 @@ jobs: ls ~/win-cross/vs2022 || true - name: Setup Rust + if: ${{ !(inputs.generate-gpo && matrix.arch == 'aarch64') }} run: | cd engine/ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain 1.79 @@ -129,11 +174,13 @@ jobs: echo "export MOZ_WINDOWS_RS_DIR=$(pwd)/windows-0.58.0" >> ../configs/common/mozconfig - name: Import + if: ${{ !(inputs.generate-gpo && matrix.arch == 'aarch64') }} env: SURFER_COMPAT: ${{ matrix.arch }} run: pnpm surfer import --verbose - name: Build language packs + if: ${{ !(inputs.generate-gpo && matrix.arch == 'aarch64') }} run: sh scripts/download-language-packs.sh - name: Download artifact (if use profdata) @@ -156,6 +203,7 @@ jobs: if: ${{ !(inputs.generate-gpo && matrix.arch == 'aarch64') }} env: SURFER_COMPAT: ${{ matrix.arch }} + ZEN_RELEASE_BRANCH: ${{ inputs.release-branch }} run: | set -x dos2unix configs/windows/mozconfig @@ -164,12 +212,13 @@ jobs: if test ${{ inputs.generate-gpo }} = true; then export ZEN_GA_GENERATE_PROFILE=1 fi - sh .github/workflows/src/release-build.sh + bash .github/workflows/src/release-build.sh - name: Package if: ${{ !(inputs.generate-gpo && matrix.arch == 'aarch64') }} env: SURFER_COMPAT: ${{ matrix.arch }} + ZEN_GA_DISABLE_PGO: true run: | set -x export SURFER_PLATFORM="win32" diff --git a/.prettierignore b/.prettierignore index 839364df1..30d5deeee 100644 --- a/.prettierignore +++ b/.prettierignore @@ -4,6 +4,8 @@ engine/ **/*.xhtml **/*.inc.xhtml **/*.bundle.min.js +**/*.min.js +**/*.min.mjs **/*.svg diff --git a/AppDir/zen.desktop b/AppDir/zen.desktop index e9279001f..948030426 100644 --- a/AppDir/zen.desktop +++ b/AppDir/zen.desktop @@ -5,7 +5,7 @@ Exec=zen %u Icon=zen Type=Application MimeType=text/html;text/xml;application/xhtml+xml;x-scheme-handler/http;x-scheme-handler/https;application/x-xpinstall;application/pdf;application/json; -StartupWMClass=zen-release +StartupWMClass=zen Categories=Network;WebBrowser; StartupNotify=true Terminal=false diff --git a/CODEOWNERS b/CODEOWNERS index 64c09c8d3..5f964be1d 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -1 +1 @@ -* @mr-cheff +* @mauro-balades diff --git a/README.md b/README.md index f5141bcd6..d1d61fd8a 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ ## 🖥️ Compatibility -Zen is currently built using firefox version `133.0.3`! 🚀 +Zen is currently built using firefox version `134.0`! 🚀 - Check out the latest [release notes](https://zen-browser.app/release-notes)! - Part of our mission is to keep Zen up-to-date with the latest version of Firefox, so you can enjoy the latest features and security updates! diff --git a/build/codesign/browser.developer.entitlements.xml b/build/codesign/browser.developer.entitlements.xml index 90d8e7cc2..7722dd8df 100644 --- a/build/codesign/browser.developer.entitlements.xml +++ b/build/codesign/browser.developer.entitlements.xml @@ -28,5 +28,12 @@ for native messaging webextension helper applications launched by Firefox which rely on Apple Events to signal other processes. --> com.apple.security.automation.apple-events + + + com.apple.security.smartcard + + + com.apple.application-identifier + H36NPCN86W.app.zen-browser.zen diff --git a/build/codesign/codesign.bash b/build/codesign/codesign.bash index 7dce57163..74104451b 100644 --- a/build/codesign/codesign.bash +++ b/build/codesign/codesign.bash @@ -111,6 +111,9 @@ echo "-------------------------------------------------------------------------" set -x +# move Zen_Browser.provisionprofile to the Contents directory +#cp Zen_Browser.provisionprofile "${BUNDLE}"/Contents/embedded.provisionprofile + # Clear extended attributes which cause codesign to fail xattr -cr "${BUNDLE}" @@ -119,8 +122,15 @@ xattr -cr "${BUNDLE}" codesign --force -o runtime --verbose --sign "$IDENTITY" \ "${BUNDLE}/Contents/Library/LaunchServices/org.mozilla.updater" \ "${BUNDLE}/Contents/MacOS/XUL" \ -"${BUNDLE}/Contents/MacOS/pingsender" \ -"${BUNDLE}/Contents/MacOS/*.dylib" \ +"${BUNDLE}"/Contents/embedded.provisionprofile \ +"${BUNDLE}/Contents/MacOS/pingsender" + +# Sign every ${BUNDLE}/Contents/MacOS/*.dylib +find "${BUNDLE}"/Contents/MacOS -type f -name "*.dylib" -exec \ +codesign --force --verbose --sign "$IDENTITY" {} \; + +find "${BUNDLE}"/Contents/MacOS -type f -name "*.dylib" -exec \ +codesign -vvv --strict --deep --verbose {} \; codesign --force -o runtime --verbose --sign "$IDENTITY" --deep \ "${BUNDLE}"/Contents/MacOS/updater.app @@ -166,4 +176,4 @@ if [ ! -z "${OUTPUT_DMG_FILE}" ]; then rm ${TEMP_FILE} rm ${TEMP_DMG} rm -rf "${DISK_IMAGE_DIR}" -fi \ No newline at end of file +fi diff --git a/configs/common/mozconfig b/configs/common/mozconfig index a01e78de6..9d55df0dd 100644 --- a/configs/common/mozconfig +++ b/configs/common/mozconfig @@ -13,6 +13,8 @@ export MOZ_APP_DISPLAYNAME="${name}" export MOZ_BRANDING_DIRECTORY=${brandingDir} export MOZ_OFFICIAL_BRANDING_DIRECTORY=${brandingDir} +ac_add_options --with-distribution-id=app.zen-browser + # Uncomment if builds are too resource hungry # mk_add_options MOZ_MAKE_FLAGS="-j4" # ac_add_options --enable-linker=gold @@ -54,8 +56,15 @@ if test "$ZEN_RELEASE"; then ac_add_options --disable-default-browser-agent if ! test "$ZEN_DISABLE_LTO"; then - export MOZ_LTO=cross,thin - ac_add_options --enable-lto=cross,thin + # only enable full LTO when ZEN_RELEASE_BRANCH is 'release' + if test "$ZEN_RELEASE_BRANCH" = "release"; then + # TODO: make it "full" once we have the resources to build it + export MOZ_LTO=cross,thin + ac_add_options --enable-lto=cross,thin + else + export MOZ_LTO=cross,thin + ac_add_options --enable-lto=cross,thin + fi fi ac_add_options --enable-jemalloc @@ -64,10 +73,6 @@ if test "$ZEN_RELEASE"; then MOZILLA_OFFICIAL=1 export MOZILLA_OFFICIAL=1 - mk_add_options MOZ_OPTIMIZE=2 - MOZ_OPTIMIZE=2 - export MOZ_OPTIMIZE=2 - export OPT_LEVEL="3" ac_add_options OPT_LEVEL="3" diff --git a/configs/linux/mozconfig b/configs/linux/mozconfig index 90382e702..cdabe9862 100644 --- a/configs/linux/mozconfig +++ b/configs/linux/mozconfig @@ -12,27 +12,32 @@ if test "$SURFER_COMPAT" = "x86_64"; then ac_add_options --enable-eme=widevine # Enable Profile Guided Optimization - export MOZ_PGO=1 - ac_add_options MOZ_PGO=1 + if test "$ZEN_GA_DISABLE_PGO"; then + export ZEN_DUMMY=1 + else + export MOZ_PGO=1 + ac_add_options MOZ_PGO=1 + fi # Optimization flags for SURFER_COMPAT - ac_add_options --enable-optimize="-O3 -march=x86-64" + ac_add_options --enable-optimize="-O3 -w -ftree-vectorize -Qvec -mfpmath=sse -mprfchw -msse3 -mcx16 -msahf" - export CFLAGS="$CFLAGS -O3 -ffp-contract=fast -march=x86-64" - export CPPFLAGS="$CPPFLAGS -O3 -ffp-contract=fast -march=x86-64" - export CXXFLAGS="$CXXFLAGS -O3 -flto=thin -ffp-contract=fast -march=x86-64" - export LDFLAGS="$LDFLAGS -Wl,-O3 -Wl,-mllvm,-fp-contract=fast -march=x86-64" - export RUSTFLAGS="$RUSTFLAGS -C target-cpu=x86-64 -C codegen-units=1 -Clink-args=--icf=safe" + export LDFLAGS="$LDFLAGS -Wl,-O3" + export RUSTFLAGS="$RUSTFLAGS -Clink-args=--icf=safe" elif test "$SURFER_COMPAT" = "aarch64"; then ac_add_options --target=aarch64-linux-gnu ac_add_options --enable-optimize="-O3" + # override LTO settings + export MOZ_LTO=cross,thin + ac_add_options --enable-lto=cross,thin + export CFLAGS="$CFLAGS -O3" export CPPFLAGS="$CPPFLAGS -O3" export CXXFLAGS="$CXXFLAGS -O3" export LDFLAGS="$LDFLAGS -Wl,-O3" - export RUSTFLAGS="$RUSTFLAGS -C codegen-units=1 -Clink-args=--icf=safe" + export RUSTFLAGS="$RUSTFLAGS -Clink-args=--icf=safe" fi export VERBOSE=1 diff --git a/configs/macos/mozconfig b/configs/macos/mozconfig index 3bed43a1c..7528354cf 100644 --- a/configs/macos/mozconfig +++ b/configs/macos/mozconfig @@ -7,8 +7,12 @@ export MOZ_MACBUNDLE_ID=${appId} export MOZ_MACBUNDLE_NAME="Zen Browser.app" if test "$ZEN_RELEASE"; then - export MOZ_PGO=1 - ac_add_options MOZ_PGO=1 + if test "$ZEN_GA_DISABLE_PGO"; then + export ZEN_DUMMY=1 + else + export MOZ_PGO=1 + ac_add_options MOZ_PGO=1 + fi fi if test "$SURFER_COMPAT" = "x86_64"; then @@ -21,7 +25,7 @@ if test "$SURFER_COMPAT" = "x86_64"; then export CPPFLAGS="-O3 -march=nehalem" export CXXFLAGS="-O3 -march=nehalem" export LDFLAGS="-Wl,-O3 -march=nehalem" - export RUSTFLAGS="-Ctarget-cpu=nehalem -C codegen-units=1" + export RUSTFLAGS="-Ctarget-cpu=nehalem" else ac_add_options --target=aarch64-apple-darwin @@ -34,7 +38,7 @@ else export CPPFLAGS="-O3 -march=armv8.3-a+simd -mcpu=apple-m1" export CXXFLAGS="-O3 -march=armv8.3-a+simd -mcpu=apple-m1" export LDFLAGS="-Wl,-O3 -march=armv8.3-a+simd -mcpu=apple-m1" - export RUSTFLAGS="-C target-feature=+v8.3a -C codegen-units=1 -Ctarget-cpu=apple-m1" + export RUSTFLAGS="-C target-feature=+v8.3a -Ctarget-cpu=apple-m1" fi export VERBOSE=1 diff --git a/configs/windows/mozconfig b/configs/windows/mozconfig index aa4336271..cee2f9b26 100644 --- a/configs/windows/mozconfig +++ b/configs/windows/mozconfig @@ -32,11 +32,8 @@ if test "$SURFER_COMPAT" = "x86_64"; then ac_add_options --target=x86_64-pc-windows-msvc ac_add_options --enable-eme=widevine - ac_add_options --enable-optimize="-O3 -w -ftree-vectorize" + ac_add_options --enable-optimize="-O3 -w -ftree-vectorize -Qvec -mfpmath=sse -mprfchw -msse3 -mcx16 -msahf" - export CFLAGS="-O3 -Qvec -w" - export CPPFLAGS="-O3 -Qvec -w" - export CXXFLAGS="-O3 -Qvec -w" export LDFLAGS="-Wl,-O3" export RUSTFLAGS="-Clink-args=--icf=safe" elif test "$SURFER_COMPAT" = "aarch64"; then @@ -45,11 +42,15 @@ elif test "$SURFER_COMPAT" = "aarch64"; then ac_add_options --enable-optimize="-O2 -mtune=cortex-a55 -march=armv8.2-a+simd" + # override LTO settings + export MOZ_LTO=cross,thin + ac_add_options --enable-lto=cross,thin + export CFLAGS="-O2 -march=armv8.2-a+simd -mtune=cortex-a55" export CPPFLAGS="-O2 -march=armv8.2-a+simd -mtune=cortex-a55" export CXXFLAGS="-O2 -march=armv8.2-a+simd -mtune=cortex-a55" export LDFLAGS="-Wl,-O2 -march=armv8.2-a+simd -mtune=cortex-a55" - export RUSTFLAGS="-C target-feature=+v8.2a -C codegen-units=1 -Ctarget-cpu=cortex-a55" + export RUSTFLAGS="-C target-feature=+v8.2a -Ctarget-cpu=cortex-a55" fi #export POLLY="-mllvm -polly -mllvm -polly-2nd-level-tiling -mllvm -polly-loopfusion-greedy -mllvm -polly-pattern-matching-based-opts -mllvm -polly-position=before-vectorizer -mllvm -polly-vectorizer=stripmine" @@ -61,9 +62,13 @@ if test "$ZEN_CROSS_COMPILING"; then mk_add_options "export MOZ_AUTOMATION_PACKAGE_GENERATED_SOURCES=0" ac_add_options --enable-profile-generate=cross elif test "$SURFER_COMPAT" = "x86_64"; then - # Dont use PGO on aarch64 builds - ac_add_options --enable-profile-use=cross - ac_add_options --with-pgo-profile-path=$(echo ~)/artifact/merged.profdata - ac_add_options --with-pgo-jarlog=$(echo ~)/artifact/en-US.log + # Dont use PGO on aarch64 builds and the ZEN_GA_DISABLE_PGO flag is not set + if test "$ZEN_GA_DISABLE_PGO"; then + export ZEN_DUMMY=1 + else + ac_add_options --enable-profile-use=cross + ac_add_options --with-pgo-profile-path=$(echo ~)/artifact/merged.profdata + ac_add_options --with-pgo-jarlog=$(echo ~)/artifact/en-US.log + fi fi fi diff --git a/docs/issue-metrics/2024_2024-12-01..2024-12-31.md b/docs/issue-metrics/2024_2024-12-01..2024-12-31.md index cc07fe7c6..03425300c 100644 --- a/docs/issue-metrics/2024_2024-12-01..2024-12-31.md +++ b/docs/issue-metrics/2024_2024-12-01..2024-12-31.md @@ -2,13 +2,13 @@ | Metric | Average | Median | 90th percentile | | --- | --- | --- | ---: | -| Time to first response | 1 day, 10:53:14 | 5:38:18 | 3 days, 13:56:56 | -| Time to close | 3 days, 13:05:55 | 1 day, 5:00:17 | 10 days, 5:43:20 | +| Time to first response | 2 days, 2:25:52 | 6:06:45 | 4 days, 23:54:11 | +| Time to close | 4 days, 10:13:09 | 1 day, 7:06:20 | 11 days, 18:39:59 | | Metric | Count | | --- | ---: | -| Number of items that remain open | 304 | -| Number of items closed | 267 | +| Number of items that remain open | 293 | +| Number of items closed | 278 | | Total number of items created | 571 | | Title | URL | Time to first response | Time to close | @@ -63,7 +63,7 @@ | Some toolbar buttons stay colored after clicking on them but their panels don't open | https://github.com/zen-browser/desktop/issues/4032 | None | None | | The browser has stopped opening. | https://github.com/zen-browser/desktop/issues/4031 | 2 days, 6:02:42 | 3 days, 20:59:18 | | Startup error | https://github.com/zen-browser/desktop/issues/4029 | 4 days, 7:59:19 | None | -| Ctrl+Shift+C stopped working | https://github.com/zen-browser/desktop/issues/4028 | 2 days, 4:35:14 | 4 days, 3:39:28 | +| Devtool shortcuts aren't being able to be customized | https://github.com/zen-browser/desktop/issues/4028 | 2 days, 4:35:14 | 6 days, 7:02:43 | | At start all bookmarks automatically opens | https://github.com/zen-browser/desktop/issues/4026 | None | None | | Sponsored suggestions are still enabled | https://github.com/zen-browser/desktop/issues/4020 | 14:48:28 | None | | Windows chrome not looking right | https://github.com/zen-browser/desktop/issues/4017 | 4:53:33 | 5:02:49 | @@ -76,7 +76,7 @@ | mouse/keyboard click does not work after some tab switch / window minimize | https://github.com/zen-browser/desktop/issues/4008 | None | None | | Theme resets to default/accent colors on startup | https://github.com/zen-browser/desktop/issues/4007 | 1 day, 16:54:17 | None | | Remove browser padding mod not working | https://github.com/zen-browser/desktop/issues/4005 | 1 day, 8:07:50 | 1 day, 8:07:50 | -| A bunch of error 0x80040111's when starting zen | https://github.com/zen-browser/desktop/issues/4004 | 1 day, 10:18:21 | None | +| A bunch of error 0x80040111's when starting zen | https://github.com/zen-browser/desktop/issues/4004 | 1 day, 10:18:21 | 9 days, 9:15:34 | | hover margin on tab bar is too big until you resize it manually | https://github.com/zen-browser/desktop/issues/4002 | 1 day, 16:46:24 | None | | (UI) Firefox sidebar overlaps with page content | https://github.com/zen-browser/desktop/issues/4001 | None | None | | Unable to view bookmarks toolbar | https://github.com/zen-browser/desktop/issues/4000 | 5:31:10 | 16:20:24 | @@ -92,7 +92,7 @@ | Zen doesn't remember entered data on webpages when clicking "go back" button | https://github.com/zen-browser/desktop/issues/3989 | None | None | | Unexpected text appears when selecting wallpapers and typing. | https://github.com/zen-browser/desktop/issues/3988 | 2 days, 14:37:23 | 2 days, 14:37:23 | | [BUG] Extension Expands Vertically on Each Usage | https://github.com/zen-browser/desktop/issues/3987 | 0:03:27 | 2 days, 2:35:47 | -| Pinning (or unpinning) extensions cause toolbar to break in compact mode | https://github.com/zen-browser/desktop/issues/3986 | None | None | +| Pinning (or unpinning) extensions cause toolbar to break in compact mode | https://github.com/zen-browser/desktop/issues/3986 | 8 days, 15:29:08 | None | | Weird behavior on MacOS when Zen is in fullscreen | https://github.com/zen-browser/desktop/issues/3985 | 0:54:00 | None | | Title bar buttons on Linux | https://github.com/zen-browser/desktop/issues/3984 | None | None | | Playback Issue After Long Pauses in Videos: Requires Refresh to Fix | https://github.com/zen-browser/desktop/issues/3981 | None | None | @@ -157,10 +157,10 @@ | Default shortcut for "Copy current URL" overridden by element inspector | https://github.com/zen-browser/desktop/issues/3894 | 0:04:46 | 0:32:12 | | Default Firefox Window Control buttons used instead of custom Zen icons | https://github.com/zen-browser/desktop/issues/3893 | 0:18:50 | 11 days, 18:08:37 | | Flightradar24 has botched information when hovering an airport | https://github.com/zen-browser/desktop/issues/3892 | None | 7:23:49 | -| Crash when playing videos | https://github.com/zen-browser/desktop/issues/3891 | None | None | +| Crash when playing videos | https://github.com/zen-browser/desktop/issues/3891 | 16 days, 23:26:14 | None | | Sidebar goes black | https://github.com/zen-browser/desktop/issues/3890 | 2:18:33 | None | | Dark theme not respected | https://github.com/zen-browser/desktop/issues/3889 | 10:06:12 | None | -| Mod default preferences not displayed correctly until reopening the settings page or browser restart | https://github.com/zen-browser/desktop/issues/3887 | None | None | +| Mod default preferences not displayed correctly until reopening the settings page or browser restart | https://github.com/zen-browser/desktop/issues/3887 | 15 days, 6:11:30 | 16 days, 2:04:56 | | Bookmarks stop working. Impossible to add and manage | https://github.com/zen-browser/desktop/issues/3886 | 7:47:27 | 8:06:47 | | [Bug] Wrong Title For Tab Bar & Top Bar | https://github.com/zen-browser/desktop/issues/3885 | None | 18:00:09 | | Settings lay-out looks odd on half-screen | https://github.com/zen-browser/desktop/issues/3884 | None | None | @@ -268,7 +268,7 @@ | Cannot close browser window when Tab bar is on right and minimised state | https://github.com/zen-browser/desktop/issues/3743 | 15:42:59 | None | | Left bar unnecessary empty space / settings update | https://github.com/zen-browser/desktop/issues/3742 | 1 day, 3:18:43 | None | | side bar opens up when ctrl + tabbing (compact mode) | https://github.com/zen-browser/desktop/issues/3741 | 1:20:34 | 5:11:01 | -| MacOS traffic lights visual bug in Compact mode | https://github.com/zen-browser/desktop/issues/3740 | None | None | +| MacOS traffic lights visual bug in Compact mode | https://github.com/zen-browser/desktop/issues/3740 | 20 days, 8:33:17 | 20 days, 8:33:17 | | Hard-coded orange accent colour in many places | https://github.com/zen-browser/desktop/issues/3739 | None | None | | Popover doesn't automatically close when losing focus (video demo) | https://github.com/zen-browser/desktop/issues/3737 | None | 9:32:27 | | Isn't userChrome.css supposed to be the last stylesheet loaded? | https://github.com/zen-browser/desktop/issues/3736 | None | None | @@ -412,11 +412,11 @@ | Mouse back button occasionally fails to go back a page, tries switching workspaces instead | https://github.com/zen-browser/desktop/issues/3564 | None | None | | Weird Spacing In Sidebar | https://github.com/zen-browser/desktop/issues/3563 | 0:59:49 | None | | Browser view padding | https://github.com/zen-browser/desktop/issues/3562 | 1:58:05 | None | -| Changing mod string preferences sometimes results in missing characters | https://github.com/zen-browser/desktop/issues/3558 | None | None | +| Changing mod string preferences sometimes results in missing characters | https://github.com/zen-browser/desktop/issues/3558 | None | 24 days, 6:15:07 | | Rounded corners only showing on overscroll on "release notes" page | https://github.com/zen-browser/desktop/issues/3557 | None | None | | Missing options in "Show in compact view" in settings. | https://github.com/zen-browser/desktop/issues/3556 | 5:59:42 | 17 days, 15:15:02 | | Text completely distorted | https://github.com/zen-browser/desktop/issues/3555 | 5:41:26 | None | -| Application freezes when interacting with the address bar | https://github.com/zen-browser/desktop/issues/3552 | None | None | +| Application freezes when interacting with the address bar | https://github.com/zen-browser/desktop/issues/3552 | 22 days, 11:37:39 | None | | Tab right click stops working after using "Change Tab to Workspace" | https://github.com/zen-browser/desktop/issues/3549 | 7:57:32 | None | | Need some help! not sure if this is the right place?? | https://github.com/zen-browser/desktop/issues/3548 | None | None | | Windows "Show accent color on title bars and window borders" option looks broken with new titlebar | https://github.com/zen-browser/desktop/issues/3546 | 0:39:49 | 9 days, 14:07:17 | @@ -499,7 +499,7 @@ | Bookmarks don't get fully deleted from places.sqlite | https://github.com/zen-browser/desktop/issues/3444 | None | None | | When Workspaces are enabled browser.tabs.closeWindowWithLastTab set to true does not work (macOS) | https://github.com/zen-browser/desktop/issues/3443 | None | None | | Logging on Google does not prompt security key popup to login | https://github.com/zen-browser/desktop/issues/3442 | 11:20:10 | 21 days, 12:51:05 | -| Zen breaks when all keybinds are assigned to "not set" | https://github.com/zen-browser/desktop/issues/3441 | 7 days, 8:26:47 | None | +| Zen breaks when all keybinds are assigned to "not set" | https://github.com/zen-browser/desktop/issues/3441 | 7 days, 8:26:47 | 25 days, 14:43:17 | | After the new twilight update "Toggle Sidebar's Width" hotkey is not there | https://github.com/zen-browser/desktop/issues/3440 | 5 days, 19:37:46 | 6 days, 16:41:34 | | "Open previous windows and tabs" issue with MacOS Spaces | https://github.com/zen-browser/desktop/issues/3439 | 7 days, 18:19:48 | None | | "Keyboard shortcuts" page can show an outdated state between restarts | https://github.com/zen-browser/desktop/issues/3438 | None | None | @@ -521,7 +521,7 @@ | Choose app dialog window not listing any apps except Zen itself | https://github.com/zen-browser/desktop/issues/3418 | None | None | | No privacy | https://github.com/zen-browser/desktop/issues/3417 | None | None | | The page goes black, and upon attempting to reload, nothing is displayed | https://github.com/zen-browser/desktop/issues/3413 | None | None | -| Can't move the cursor with arrows from my keyboard when i'm in a field | https://github.com/zen-browser/desktop/issues/3412 | None | None | +| Can't move the cursor with arrows from my keyboard when i'm in a field | https://github.com/zen-browser/desktop/issues/3412 | 27 days, 22:13:16 | 30 days, 20:23:42 | | Essentials and pinned tabs still don't retain favicons after reset | https://github.com/zen-browser/desktop/issues/3411 | None | 4 days, 6:01:13 | | Unload tabs can't click and crash the browser | https://github.com/zen-browser/desktop/issues/3410 | None | None | | Rounded corners & fluorescent RGB-style lighting around the perimeter on full screen Youtube. Goes away in Private window? | https://github.com/zen-browser/desktop/issues/3409 | None | 0:06:16 | @@ -534,10 +534,10 @@ | `npm run build` failed | https://github.com/zen-browser/desktop/issues/3401 | None | None | | New URL in sidebar layout makes browser unusable | https://github.com/zen-browser/desktop/issues/3400 | 3 days, 16:54:29 | 4 days, 2:15:00 | | CSS not loading or something | https://github.com/zen-browser/desktop/issues/3399 | None | None | -| Unnecessary empty space in tab | https://github.com/zen-browser/desktop/issues/3398 | None | None | +| Unnecessary empty space in tab | https://github.com/zen-browser/desktop/issues/3398 | None | 31 days, 12:18:50 | | The window control buttons are duplicated on top of each other | https://github.com/zen-browser/desktop/issues/3395 | 2:08:07 | 3 days, 20:39:23 | -| Customizing Toolbar | https://github.com/zen-browser/desktop/issues/3394 | None | None | -| Keyboard shortcuts not resetting to default values | https://github.com/zen-browser/desktop/issues/3390 | None | None | +| Customizing Toolbar | https://github.com/zen-browser/desktop/issues/3394 | 28 days, 20:55:35 | 28 days, 20:55:35 | +| Keyboard shortcuts not resetting to default values | https://github.com/zen-browser/desktop/issues/3390 | None | 30 days, 21:31:32 | | Possible Memory Leak - Zen won't leave the Taskbar after hours of use | https://github.com/zen-browser/desktop/issues/3389 | None | None | | Can't switch to Tab. Possibly because Tab has a modal dialog. | https://github.com/zen-browser/desktop/issues/3386 | 1 day, 3:55:33 | None | | The option to hide autofill from the browser does not work with iCloud passwords | https://github.com/zen-browser/desktop/issues/3384 | None | None | @@ -553,16 +553,16 @@ | Open/close sidebar icon is confusing | https://github.com/zen-browser/desktop/issues/3370 | None | None | | Tab Management - Workspaces - Display workspaces as an icon strip bug | https://github.com/zen-browser/desktop/issues/3369 | None | None | | Google meet not loading | https://github.com/zen-browser/desktop/issues/3368 | 16:55:47 | None | -| Workspace icon highlight on hover is uneven | https://github.com/zen-browser/desktop/issues/3367 | None | None | +| Workspace icon highlight on hover is uneven | https://github.com/zen-browser/desktop/issues/3367 | 30 days, 0:55:16 | 30 days, 0:55:16 | | The main UI's background doesn't follow the theme sometimes | https://github.com/zen-browser/desktop/issues/3366 | None | None | | Shortcut Settings Typo | https://github.com/zen-browser/desktop/issues/3365 | None | None | -| Video image freezes when we move the progress video bar, and only the audio is playing | https://github.com/zen-browser/desktop/issues/3363 | None | None | +| Video image freezes when we move the progress video bar, and only the audio is playing | https://github.com/zen-browser/desktop/issues/3363 | 31 days, 7:22:57 | None | | ClickTrades Webpage not loading | https://github.com/zen-browser/desktop/issues/3362 | None | None | | When switch workspaces, the current-focused tab sometimes also show in the new workspace | https://github.com/zen-browser/desktop/issues/3357 | 3:34:51 | 9 days, 17:41:38 | | Toggle Floating Sidebar keyboard shortcut not working | https://github.com/zen-browser/desktop/issues/3356 | 6 days, 13:00:18 | None | | Workspace icon still shows on compact mode even when flag is disabled. | https://github.com/zen-browser/desktop/issues/3355 | 20 days, 3:42:54 | 20 days, 3:42:39 | | Moving tab across workspace and then right-clicking on it does not render a menu | https://github.com/zen-browser/desktop/issues/3353 | 2 days, 14:33:51 | 18 days, 16:47:56 | -| Glance in compact view opens tabs bar | https://github.com/zen-browser/desktop/issues/3351 | None | None | +| Glance in compact view opens tabs bar | https://github.com/zen-browser/desktop/issues/3351 | 31 days, 13:55:54 | 33 days, 15:15:20 | | Dev Tools Context Menus Broken | https://github.com/zen-browser/desktop/issues/3350 | None | None | | Stuck in toolbar customizing mode | https://github.com/zen-browser/desktop/issues/3349 | None | None | | Top Bar Padding Increasing in Compact Mode (Twilight) | https://github.com/zen-browser/desktop/issues/3348 | 9:32:10 | 6 days, 22:39:00 | diff --git a/l10n b/l10n index d444262fd..1abc46f17 160000 --- a/l10n +++ b/l10n @@ -1 +1 @@ -Subproject commit d444262fdb32071eb995c5266ad4fe8846f650f1 +Subproject commit 1abc46f17d90b4e38af88539944d4a664568ec4c diff --git a/package.json b/package.json index bd6aeea65..2a79e5d32 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ }, "homepage": "https://github.com/zen-browser/core#readme", "dependencies": { - "@zen-browser/surfer": "^1.8.6" + "@zen-browser/surfer": "^1.9.8" }, "devDependencies": { "husky": "^9.1.7", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 0ee98a356..048b7a1e0 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -9,8 +9,8 @@ importers: .: dependencies: '@zen-browser/surfer': - specifier: ^1.8.6 - version: 1.8.6(glob@7.2.3) + specifier: ^1.9.8 + version: 1.9.8(glob@7.2.3) devDependencies: husky: specifier: ^9.1.7 @@ -122,8 +122,8 @@ packages: '@types/node@17.0.45': resolution: {integrity: sha512-w+tIMs3rq2afQdsPJlODhoUEKzFP1ayaoyl1CcnwtIlsVe7K7bA1NGm4s3PraqTLlXnbIN84zuBlxBWo1u9BLw==} - '@zen-browser/surfer@1.8.6': - resolution: {integrity: sha512-S/zGDRlMROdUqy6i6ZzhB8llMFi08XBJ2ypSQjwDKfiCtCB3oUGMPx7ahzI79cY0mvuTLpr5/NERKlR7Wq9nkA==} + '@zen-browser/surfer@1.9.8': + resolution: {integrity: sha512-dx4ouPDB7bg+eWR+NNuhdroR0JyZ+bWlxpAFskl9TiR3cvr1qtmZG9bYSF27nLNOUSWgKNamjevP785B08Cxjg==} hasBin: true ansi-escapes@7.0.0: @@ -152,8 +152,8 @@ packages: asap@2.0.6: resolution: {integrity: sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA==} - async-compat@1.5.1: - resolution: {integrity: sha512-itH7HB0C7nzX7ynpIJYEJqpvuXmfWXXbzDrTfJOJJ3fJfgNTGgZUqKVYUT3U17zhceZiTdPdtiUQQns2F3RRCQ==} + async-compat@1.6.1: + resolution: {integrity: sha512-8ggRAJiUews+8pjzG/fQ0O9QOPxHFa3DGvvMoH67rukjIiRL7AVGcaUSkA6ecZYlDvyom7zet7zy1ZFjRliuqw==} engines: {node: '>=0.8'} async-icns@1.0.2: @@ -207,8 +207,8 @@ packages: buffer@5.7.1: resolution: {integrity: sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==} - call-once-fn@1.0.1: - resolution: {integrity: sha512-/MIar5BYO3zAwe0QZCFsr89R6vn6BWiS3BCG2IyCUobkY3rAKK5r+elC3TWdBQW4q6A8aNjS5CDTmtUnAIOa7g==} + call-once-fn@1.0.6: + resolution: {integrity: sha512-zBcRjl/aFJEJqNSNw0gtzi4ZtDLBqPqIbU8qyXv5M2biF2nYHqcpIXOWo6ZhhDAQDkr9WgXQnLLyXQJvWm5AMg==} engines: {node: '>=0.8'} chalk@4.1.2: @@ -270,8 +270,8 @@ packages: resolution: {integrity: sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==} engines: {node: '>= 0.6'} - core-js-pure@3.39.0: - resolution: {integrity: sha512-7fEcWwKI4rJinnK+wLTezeg2smbFFdSBP6E2kQZNbnzM2s1rpKQ6aaRteZSSg7FLU3P0HGGVo/gbpfanU36urg==} + core-js-pure@3.40.0: + resolution: {integrity: sha512-AtDzVIgRrmRKQai62yuSIN5vNiQjcJakJb4fbhVw3ehxx7Lohphvw9SGNWKhLFqSxC4ilD0g/L1huAYFQU3Q6A==} core-util-is@1.0.3: resolution: {integrity: sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==} @@ -337,12 +337,12 @@ packages: resolution: {integrity: sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==} engines: {node: '>=6'} - extract-base-iterator@1.2.1: - resolution: {integrity: sha512-6paYzxwwx215Zj29ZhoCw2wnaGnU8kPPIzth0U71JwZCo9oR5sGUBWQd6Da5YIWmUZKsadCULxr2dRAzhTmKIA==} + extract-base-iterator@1.2.10: + resolution: {integrity: sha512-xdSKIpRrB+AqUJByl1pIOAyHs2vUfA4pL05SiB/9ZhC4AYS4G9a5TNmKEfY6KKeoPw5eFLoQ/9hVUUq5BIguFA==} engines: {node: '>=0.8'} - fast-extract@1.3.1: - resolution: {integrity: sha512-4er0iCszwwY1JX1SfYHQKuoPTmu6ISIG8W4gD8/jHkB7/Ws9i0ZNu+48BpalV+GGsushMvllTFk8txLBGbpYGg==} + fast-extract@1.3.10: + resolution: {integrity: sha512-XrV3AQLlaW4sDMSOwcBRDBMaEdJKgXT2EhtsqTufdZWWNN2b8zmRSGee/VV/vurO0agKoEVCyxja2DmkBzv6lg==} engines: {node: '>=0.8'} peerDependencies: lzma-native: '*' @@ -369,8 +369,8 @@ packages: debug: optional: true - fs-access-compat@1.0.3: - resolution: {integrity: sha512-bIT52oDQuazHSEnu17+MnRGVTTtLpMluu9Zuv25RhJ+iVWrTX95aXK+9yEsQ1ZaIRCWeHjx1IgR38QH/8psWKQ==} + fs-access-compat@1.1.4: + resolution: {integrity: sha512-Qvy38V5JTnQT9pDulL2HBDiuZ1XbA3IHLJrHZpsP2gcBocflwnrbIcRd/dcH+ax55JEqqc8N1ARpaxITlp7hMg==} engines: {node: '>=0.8'} fs-constants@1.0.0: @@ -588,8 +588,8 @@ packages: mkdirp-classic@0.5.3: resolution: {integrity: sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==} - mock-require-lazy@1.0.1: - resolution: {integrity: sha512-Sv05IW2MuG7C+gVTHirqF8cbqAM8MeMEIKU3MIQDA1pyXKnv0AGa/3l0iwXk/i+81OoFzt+iU0p8DdphV2Ejww==} + mock-require-lazy@1.0.6: + resolution: {integrity: sha512-+0sOddS06fxFPJEDulH1Qssavf7D8UWa54Z6LQFuKwWwKwXLIU2JHnNt9Qi449LkqrKtNVa0rHhAzoJCZxvTgg==} engines: {node: '>=0.8'} modern-async@1.1.5: @@ -717,8 +717,8 @@ packages: pumpify@2.0.1: resolution: {integrity: sha512-m7KOje7jZxrmutanlkS1daj1dS6z6BgslzOXmcSEpIlCxM3VJH7lG5QLeck/6hgF6F4crFf01UtQmNsJfweTAw==} - queue-cb@1.4.4: - resolution: {integrity: sha512-WHT/6s0nK/TB6/tlCi30NGNh8mQrCVmQAH5Hq/ZLaYFTjKVfsIKmfftJYAHXfGJ2FlRlVSAJjFBbSvSGJriCAw==} + queue-cb@1.4.10: + resolution: {integrity: sha512-Hi3ZvXvKhrmxJhn6FhwsyW/Dd6OFZy2RWPXrAxQFw0jDnoiOzx2edkarCr5RpR6no7nZ+O4if59M/2HKzFy3hw==} engines: {node: '>=0.8'} rc@1.2.8: @@ -828,8 +828,8 @@ packages: sprintf-js@1.0.3: resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} - stack-base-iterator@1.1.5: - resolution: {integrity: sha512-wFnKvg6qFFCQBvpBqa4SWnDGIVziYu8A2ATQqcvYwdi774efdRHzXarjW88vaTy2fLbuVVH0g361UfOEJHWmCA==} + stack-base-iterator@1.1.11: + resolution: {integrity: sha512-c9f/rUFy/GJCEn0kx7gqIM/LByOrvOAq4I0cEVeahcmSGFfFa2xAto6/RcjApT0qbz/+IrA0OCM7CHnSiVDrOw==} engines: {node: '>=0.8'} stream-shift@1.0.3: @@ -880,8 +880,8 @@ packages: tar-fs@2.1.1: resolution: {integrity: sha512-V0r2Y9scmbDRLCNex/+hYzvp/zyYjvFbHPNgVTKfQvVrb6guiE/fxP+XblDNR011utopbkex2nM4dHNV6GDsng==} - tar-iterator@1.2.2: - resolution: {integrity: sha512-cFr12lmqNsIBFT++9QJSPNdOXndBU3XyWOx6UDq+2AipKA865i/RKIc+kbHv1i5Ko60+rYSI+/5PPMCQP3fP+g==} + tar-iterator@1.2.9: + resolution: {integrity: sha512-sHgC+mJjn5n4v1YDQsFyGUg8Up6byOWV8QjQh/ZOYSOVkmg5q9ivpTgIKJrQOUihivsh+4pQlY5gMmXyH4AyOg==} engines: {node: '>=0.8'} tar-stream-compat@2.1.5: @@ -892,8 +892,8 @@ packages: resolution: {integrity: sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==} engines: {node: '>=6'} - temp-suffix@0.1.1: - resolution: {integrity: sha512-wcluXJ6A8HhyhEOOTXHPKV9TRTcL7vwmnfrWTZn7c7zrFp16trP1lfpsxaKN52pToFNByQ+y3zsJC8JlDAaKrg==} + temp-suffix@0.1.6: + resolution: {integrity: sha512-oxSvTMUHbFUEbCIQGJa221DvtpA1oNSlthyGjPJ/yiAum8JgE/Nu4jHh7osM7IKHPomRDCmxmYdTuX442EuZKg==} engines: {node: '>=0.8'} through2@2.0.5: @@ -957,8 +957,8 @@ packages: engines: {node: '>= 14'} hasBin: true - zip-iterator@1.2.1: - resolution: {integrity: sha512-56+76FbbgsQySl8wAh9W7SCaSyzFQK3xjL1+6tzai5ER+f7mSVpU9wKgPk+N9ZJ/5xTJqg5Z2rUe9d7SxrbgFQ==} + zip-iterator@1.2.7: + resolution: {integrity: sha512-hLYAZigng8q3AWJyNJgiUAokV/NXYBXgLeYt+PnkcXMES9syJwiLCBJ1qvoBEip97E5/H0T5OwpZcCrx91FE8A==} engines: {node: '>=0.8'} zip@1.2.0: @@ -1036,7 +1036,7 @@ snapshots: '@types/node@17.0.45': {} - '@zen-browser/surfer@1.8.6(glob@7.2.3)': + '@zen-browser/surfer@1.9.8(glob@7.2.3)': dependencies: '@resvg/resvg-js': 1.4.0 async-icns: 1.0.2 @@ -1045,7 +1045,7 @@ snapshots: cli-progress: 3.12.0 commander: 6.2.1 execa: 5.1.1 - fast-extract: 1.3.1(glob@7.2.3) + fast-extract: 1.3.10(glob@7.2.3) fs-extra: 10.1.0 ini: 3.0.1 is-apple-silicon: https://codeload.github.com/trickypr/is-apple-silicon/tar.gz/5f75501a1d7566ba9f94174b6825d7bd9d302b6a @@ -1085,7 +1085,7 @@ snapshots: asap@2.0.6: {} - async-compat@1.5.1: + async-compat@1.6.1: dependencies: is-error: 2.2.2 is-promise: 4.0.0 @@ -1153,7 +1153,7 @@ snapshots: base64-js: 1.5.1 ieee754: 1.2.1 - call-once-fn@1.0.1: {} + call-once-fn@1.0.6: {} chalk@4.1.2: dependencies: @@ -1208,7 +1208,7 @@ snapshots: dependencies: safe-buffer: 5.2.1 - core-js-pure@3.39.0: {} + core-js-pure@3.40.0: {} core-util-is@1.0.3: {} @@ -1277,43 +1277,43 @@ snapshots: expand-template@2.0.3: {} - extract-base-iterator@1.2.1(glob@7.2.3): + extract-base-iterator@1.2.10(glob@7.2.3): dependencies: - fs-access-compat: 1.0.3 + fs-access-compat: 1.1.4 graceful-fs: 4.2.11 is-absolute: 1.0.0 lodash.compact: 3.0.1 mkdirp-classic: 0.5.3 object-assign: 4.1.1 - queue-cb: 1.4.4 + queue-cb: 1.4.10 rimraf2: 2.8.2(glob@7.2.3) - stack-base-iterator: 1.1.5 + stack-base-iterator: 1.1.11 transitivePeerDependencies: - glob - fast-extract@1.3.1(glob@7.2.3): + fast-extract@1.3.10(glob@7.2.3): dependencies: bl: 3.0.1 buffer-v6-polyfill: 1.0.5 - call-once-fn: 1.0.1 + call-once-fn: 1.0.6 content-disposition: 0.5.4 end-of-stream: 1.4.4 flush-write-stream: 2.0.0 lodash.throttle: 4.1.1 mkdirp-classic: 0.5.3 - mock-require-lazy: 1.0.1 + mock-require-lazy: 1.0.6 next-tick: 1.1.0 progress-stream: 2.0.0 pumpify: 2.0.1 - queue-cb: 1.4.4 + queue-cb: 1.4.10 readable-stream: 2.3.8 require_optional: 1.0.1 rimraf2: 2.8.2(glob@7.2.3) signal-exit: 3.0.7 - tar-iterator: 1.2.2(glob@7.2.3) - temp-suffix: 0.1.1 + tar-iterator: 1.2.9(glob@7.2.3) + temp-suffix: 0.1.6 unbzip2-stream: 1.4.3 - zip-iterator: 1.2.1(glob@7.2.3) + zip-iterator: 1.2.7(glob@7.2.3) transitivePeerDependencies: - glob @@ -1330,7 +1330,7 @@ snapshots: follow-redirects@1.15.9: {} - fs-access-compat@1.0.3: {} + fs-access-compat@1.1.4: {} fs-constants@1.0.0: {} @@ -1515,14 +1515,14 @@ snapshots: mkdirp-classic@0.5.3: {} - mock-require-lazy@1.0.1: + mock-require-lazy@1.0.6: dependencies: get-caller-file: 2.0.5 normalize-path: 3.0.0 modern-async@1.1.5: dependencies: - core-js-pure: 3.39.0 + core-js-pure: 3.40.0 nanoassert: 2.0.0 mount-dmg@1.0.1: @@ -1640,7 +1640,7 @@ snapshots: inherits: 2.0.4 pump: 3.0.2 - queue-cb@1.4.4: {} + queue-cb@1.4.10: {} rc@1.2.8: dependencies: @@ -1752,11 +1752,11 @@ snapshots: sprintf-js@1.0.3: {} - stack-base-iterator@1.1.5: + stack-base-iterator@1.1.11: dependencies: asap: 2.0.6 - async-compat: 1.5.1 - call-once-fn: 1.0.1 + async-compat: 1.6.1 + call-once-fn: 1.0.6 fifo: 2.4.1 stream-shift@1.0.3: {} @@ -1808,16 +1808,16 @@ snapshots: pump: 3.0.2 tar-stream: 2.2.0 - tar-iterator@1.2.2(glob@7.2.3): + tar-iterator@1.2.9(glob@7.2.3): dependencies: - call-once-fn: 1.0.1 + call-once-fn: 1.0.6 end-of-stream: 1.4.4 - extract-base-iterator: 1.2.1(glob@7.2.3) - fs-access-compat: 1.0.3 + extract-base-iterator: 1.2.10(glob@7.2.3) + fs-access-compat: 1.1.4 lifecycle: 1.0.4 lodash.compact: 3.0.1 mkdirp-classic: 0.5.3 - queue-cb: 1.4.4 + queue-cb: 1.4.10 rimraf2: 2.8.2(glob@7.2.3) tar-stream-compat: 2.1.5 transitivePeerDependencies: @@ -1840,7 +1840,7 @@ snapshots: inherits: 2.0.4 readable-stream: 3.6.2 - temp-suffix@0.1.1: + temp-suffix@0.1.6: dependencies: imurmurhash: 0.1.4 @@ -1902,22 +1902,22 @@ snapshots: yaml@2.6.1: {} - zip-iterator@1.2.1(glob@7.2.3): + zip-iterator@1.2.7(glob@7.2.3): dependencies: buffer-v6-polyfill: 1.0.5 - call-once-fn: 1.0.1 + call-once-fn: 1.0.6 end-of-stream: 1.4.4 - extract-base-iterator: 1.2.1(glob@7.2.3) - fs-access-compat: 1.0.3 + extract-base-iterator: 1.2.10(glob@7.2.3) + fs-access-compat: 1.1.4 lifecycle: 1.0.4 lodash.compact: 3.0.1 mkdirp-classic: 0.5.3 os-shim: 0.1.3 - queue-cb: 1.4.4 + queue-cb: 1.4.10 readable-stream: 2.3.8 rimraf2: 2.8.2(glob@7.2.3) short-hash: 1.0.0 - temp-suffix: 0.1.1 + temp-suffix: 0.1.6 zip: 1.2.0 transitivePeerDependencies: - glob diff --git a/src/browser/app/macbuild/Contents/Info-plist-in.patch b/src/browser/app/macbuild/Contents/Info-plist-in.patch new file mode 100644 index 000000000..d683c6419 --- /dev/null +++ b/src/browser/app/macbuild/Contents/Info-plist-in.patch @@ -0,0 +1,13 @@ +diff --git a/browser/app/macbuild/Contents/Info.plist.in b/browser/app/macbuild/Contents/Info.plist.in +index 73b400d58fd25ac13132f1a3fe3ea619e4f4e4f9..ee90ce7ac67bd9aa7bbc2a656843875afb985591 100644 +--- a/browser/app/macbuild/Contents/Info.plist.in ++++ b/browser/app/macbuild/Contents/Info.plist.in +@@ -191,7 +191,7 @@ + CFBundleIconFile + firefox.icns + CFBundleIdentifier +- @MOZ_MACBUNDLE_ID@ ++ app.zen-browser.zen + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName diff --git a/src/browser/app/profile/zen-browser.js b/src/browser/app/profile/zen-browser.js index b8eb0069d..6da43313e 100644 --- a/src/browser/app/profile/zen-browser.js +++ b/src/browser/app/profile/zen-browser.js @@ -85,6 +85,7 @@ pref('zen.theme.accent-color', "#ffb787"); pref('zen.theme.content-element-separation', 6); // In pixels pref('zen.theme.pill-button', false); pref('zen.theme.gradient', true); +pref('zen.theme.essentials-favicon-bg', true); pref('zen.tabs.show-newtab-vertical', true); pref('zen.view.show-newtab-button-border-top', true); @@ -145,7 +146,12 @@ pref('zen.view.use-single-toolbar', true); pref('zen.view.sidebar-expanded', true); pref('zen.view.sidebar-collapsed.hide-mute-button', true); pref('zen.view.experimental-force-window-controls-left', false); + +#ifdef XP_MACOSX +pref('zen.view.grey-out-inactive-windows', false); +#else pref('zen.view.grey-out-inactive-windows', true); +#endif pref('zen.view.hide-window-controls', true); pref('zen.view.experimental-no-window-controls', false); @@ -185,7 +191,7 @@ pref('zen.splitView.rearrange-hover-size', 24); pref('zen.startup.smooth-scroll-in-tabs', true); // Zen Workspaces -pref('zen.workspaces.enabled', true, locked); +pref('zen.workspaces.disabled_for_testing', false); pref('zen.workspaces.hide-deactivated-workspaces', false); pref('zen.workspaces.hide-default-container-indicator', true); pref('zen.workspaces.individual-pinned-tabs', true); @@ -197,8 +203,6 @@ pref('zen.workspaces.swipe-actions', true); pref('zen.workspaces.wrap-around-navigation', true); pref('zen.workspaces.natural-scroll', false); pref('zen.workspaces.scroll-modifier-key','ctrl'); // can be ctrl, alt, shift, or a meta key -pref('zen.workspaces.icons', '["⌚","⌛","⏪","⏫","⏬","⏰","⏳","⚽","⚾","⛄","⛅","⛎","⛔","⛪","⛲","⛳","⛵","⛺","⛽","✅","✊","✋","✨","❌","❎","❓","⭐","⭕","🀄","🃏","🆎","🆑","🆒","🆓","🆔","🆕","🆖","🆗","🆘","🆙","🆚","🈁","🈚","🈯","🈲","🈳","🈴","🈵","🈶","🈸","🈹","🈺","🉐","🉑","🌀","🌁","🌂","🌃","🌄","🌅","🌆","🌇","🌈","🌉","🌊","🌋","🌌","🌍","🌎","🌏","🌐","🌑","🌒","🌓","🌔","🌕","🌖","🌗","🌘","🌙","🌚","🌛","🌜","🌝","🌞","🌟","🌠","🌭","🌮","🌯","🌰","🌱","🌲","🌳","🌴","🌵","🌷","🌸","🌹","🌺","🌻","🌼","🌽","🌾","🌿","🍀","🍁","🍂","🍃","🍄","🍅","🍆","🍇","🍈","🍉","🍊","🍋","🍌","🍍","🍎","🍏","🍐","🍑","🍒","🍓","🍔","🍕","🍖","🍗","🍘","🍙","🍚","🍛","🍜","🍝","🍞","🍟","🍠","🍡","🍢","🍣","🍤","🍥","🍦","🍧","🍨","🍩","🍪","🍫","🍬","🍭","🍮","🍯","🍰","🍱","🍲","🍳","🍴","🍵","🍶","🍷","🍸","🍹","🍺","🍻","🍼","🍾","🍿","🎀","🎁","🎂","🎃","🎄","🎅","🎆","🎇","🎈","🎉","🎊","🎋","🎌","🎍","🎎","🎏","🎐","🎑","🎒","🎓","🎠","🎡","🎢","🎣","🎤","🎥","🎦","🎧","🎨","🎩","🎪","🎫","🎬","🎭","🎮","🎯","🎰","🎱","🎲","🎳","🎴","🎵","🎶","🎷","🎸","🎹","🎺","🎻","🎼","🎽","🎾","🎿","🏀","🏁","🏂","🏃","🏄","🏅","🏆","🏇","🏈","🏉","🏊","🏏","🏐","🏑","🏒","🏓","🏠","🏡","🏢","🏣","🏤","🏥","🏦","🏧","🏨","🏩","🏪","🏫","🏬","🏭","🏮","🏯","🏰","🏴","🏸","🏹","🏺","🏻","🏼","🏽","🏾","🏿","🐀","🐁","🐂","🐃","🐄","🐅","🐆","🐇","🐈","🐉","🐊","🐋","🐌","🐍","🐎","🐏","🐐","🐑","🐒","🐓","🐔","🐕","🐖","🐗","🐘","🐙","🐚","🐛","🐜","🐝","🐞","🐟","🐠","🐡","🐢","🐣","🐤","🐥","🐦","🐧","🐨","🐩","🐪","🐫","🐬","🐭","🐮","🐯","🐰","🐱","🐲","🐳","🐴","🐵","🐶","🐷","🐸","🐹","🐺","🐻","🐼","🐽","🐾","👀","👂","👃","👄","👅","👆","👇","👈","👉","👊","👋","👌","👍","👎","👏","👐","👑","👒","👓","👔","👕","👖","👗","👘","👙","👚","👛","👜","👝","👞","👟","👠","👡","👢","👣","👤","👥","👦","👧","👨","👩","👪","👫","👬","👭","👮","👯","👰","👱","👲","👳","👴","👵","👶","👷","👸","👹","👺","👻","👼","👽","👾","👿","💀","💁","💂","💃","💄","💅","💆","💇","💈","💉","💊","💋","💌","💍","💎","💏","💐","💑","💒","💓","💔","💕","💖","💗","💘","💙","💚","💛","💜","💝","💞","💟","💠","💡","💢","💣","💤","💥","💦","💧","💨","💩","💪","💫","💬","💭","💮","💯","💰","💱","💲","💳","💴","💵","💶","💷","💸","💹","💺","💻","💼","💽","💾","💿","📀","📁","📂","📃","📄","📅","📆","📇","📈","📉","📊","📋","📌","📍","📎","📏","📐","📑","📒","📓","📔","📕","📖","📗","📘","📙","📚","📛","📜","📝","📞","📟","📠","📡","📢","📣","📤","📥","📦","📧","📨","📩","📪","📫","📬","📭","📮","📯","📰","📱","📲","📳","📴","📵","📶","📷","📸","📹","📺","📻","📼","📿","🔀","🔁","🔂","🔃","🔄","🔅","🔆","🔇","🔈","🔉","🔊","🔋","🔌","🔍","🔎","🔏","🔐","🔑","🔒","🔓","🔔","🔕","🔖","🔗","🔘","🔙","🔚","🔛","🔜","🔝","🔞","🔟","🔠","🔡","🔢","🔣","🔤","🔥","🔦","🔧","🔨","🔩","🔪","🔫","🔬","🔭","🔮","🔯","🔰","🔱","🔲","🔳","🔴","🔵","🔶","🔷","🔸","🔹","🔺","🔻","🔼","🔽","🕋","🕌","🕍","🕎","🕐","🕑","🕒","🕓","🕔","🕕","🕖","🕗","🕘","🕙","🕚","🕛","🕜","🕝","🕞","🕟","🕠","🕡","🕢","🕣","🕤","🕥","🕦","🕧","🖕","🖖","🗻","🗼","🗽","🗾","🗿","😀","😁","😂","😃","😄","😅","😆","😇","😈","😉","😊","😋","😌","😍","😎","😏","😐","😑","😒","😓","😔","😕","😖","😗","😘","😙","😚","😛","😜","😝","😞","😟","😠","😡","😢","😣","😤","😥","😦","😧","😨","😩","😪","😫","😬","😭","😮","😯","😰","😱","😲","😳","😴","😵","😶","😷","😸","😹","😺","😻","😼","😽","😾","😿","🙀","🙁","🙂","🙃","🙄","🙅","🙆","🙇","🙈","🙉","🙊","🙋","🙌","🙍","🙎","🙏","🚀","🚁","🚂","🚃","🚄","🚅","🚆","🚇","🚈","🚉","🚊","🚋","🚌","🚍","🚎","🚏","🚐","🚑","🚒","🚓","🚔","🚕","🚖","🚗","🚘","🚙","🚚","🚛","🚜","🚝","🚞","🚟","🚠","🚡","🚢","🚣","🚤","🚥","🚦","🚧","🚨","🚩","🚪","🚫","🚬","🚭","🚮","🚯","🚰","🚱","🚲","🚳","🚴","🚵","🚶","🚷","🚸","🚹","🚺","🚻","🚼","🚽","🚾","🚿","🛀","🛁","🛂","🛃","🛄","🛅","🛌","🛐","🛫","🛬","🤐","🤑","🤒","🤓","🤔","🤕","🤖","🤗","🤘","🦀","🦁","🦂","🦃","🦄","🧀","🇦🇨","🇦🇩","🇦🇪","🇦🇫","🇦🇬","🇦🇮","🇦🇱","🇦🇲","🇦🇴","🇦🇶","🇦🇷","🇦🇸","🇦🇹","🇦🇺","🇦🇼","🇦🇽","🇦🇿","🇧🇦","🇧🇧","🇧🇩","🇧🇪","🇧🇫","🇧🇬","🇧🇭","🇧🇮","🇧🇯","🇧🇱","🇧🇲","🇧🇳","🇧🇴","🇧🇶","🇧🇷","🇧🇸","🇧🇹","🇧🇻","🇧🇼","🇧🇾","🇧🇿","🇨🇦","🇨🇨","🇨🇩","🇨🇫","🇨🇬","🇨🇭","🇨🇮","🇨🇰","🇨🇱","🇨🇲","🇨🇳","🇨🇴","🇨🇵","🇨🇷","🇨🇺","🇨🇻","🇨🇼","🇨🇽","🇨🇾","🇨🇿","🇩🇪","🇩🇬","🇩🇯","🇩🇰","🇩🇲","🇩🇴","🇩🇿","🇪🇦","🇪🇨","🇪🇪","🇪🇬","🇪🇭","🇪🇷","🇪🇸","🇪🇹","🇪🇺","🇫🇮","🇫🇯","🇫🇰","🇫🇲","🇫🇴","🇫🇷","🇬🇦","🇬🇧","🇬🇩","🇬🇪","🇬🇫","🇬🇬","🇬🇭","🇬🇮","🇬🇱","🇬🇲","🇬🇳","🇬🇵","🇬🇶","🇬🇷","🇬🇸","🇬🇹","🇬🇺","🇬🇼","🇬🇾","🇭🇰","🇭🇲","🇭🇳","🇭🇷","🇭🇹","🇭🇺","🇮🇨","🇮🇩","🇮🇪","🇮🇱","🇮🇲","🇮🇳","🇮🇴","🇮🇶","🇮🇷","🇮🇸","🇮🇹","🇯🇪","🇯🇲","🇯🇴","🇯🇵","🇰🇪","🇰🇬","🇰🇭","🇰🇮","🇰🇲","🇰🇳","🇰🇵","🇰🇷","🇰🇼","🇰🇾","🇰🇿","🇱🇦","🇱🇧","🇱🇨","🇱🇮","🇱🇰","🇱🇷","🇱🇸","🇱🇹","🇱🇺","🇱🇻","🇱🇾","🇲🇦","🇲🇨","🇲🇩","🇲🇪","🇲🇫","🇲🇬","🇲🇭","🇲🇰","🇲🇱","🇲🇲","🇲🇳","🇲🇴","🇲🇵","🇲🇶","🇲🇷","🇲🇸","🇲🇹","🇲🇺","🇲🇻","🇲🇼","🇲🇽","🇲🇾","🇲🇿","🇳🇦","🇳🇨","🇳🇪","🇳🇫","🇳🇬","🇳🇮","🇳🇱","🇳🇴","🇳🇵","🇳🇷","🇳🇺","🇳🇿","🇴🇲","🇵🇦","🇵🇪","🇵🇫","🇵🇬","🇵🇭","🇵🇰","🇵🇱","🇵🇲","🇵🇳","🇵🇷","🇵🇸","🇵🇹","🇵🇼","🇵🇾","🇶🇦","🇷🇪","🇷🇴","🇷🇸","🇷🇺","🇷🇼","🇸🇦","🇸🇧","🇸🇨","🇸🇩","🇸🇪","🇸🇬","🇸🇭","🇸🇮","🇸🇯","🇸🇰","🇸🇱","🇸🇲","🇸🇳","🇸🇴","🇸🇷","🇸🇸","🇸🇹","🇸🇻","🇸🇽","🇸🇾","🇸🇿","🇹🇦","🇹🇨","🇹🇩","🇹🇫","🇹🇬","🇹🇭","🇹🇯","🇹🇰","🇹🇱","🇹🇲","🇹🇳","🇹🇴","🇹🇷","🇹🇹","🇹🇻","🇹🇼","🇹🇿","🇺🇦","🇺🇬","🇺🇲","🇺🇸","🇺🇾","🇺🇿","🇻🇦","🇻🇨","🇻🇪","🇻🇬","🇻🇮","🇻🇳","🇻🇺","🇼🇫","🇼🇸","🇽🇰","🇾🇪","🇾🇹","🇿🇦","🇿🇲","🇿🇼"]'); -pref('services.sync.prefs.sync.zen.workspaces.icons', true); pref('services.sync.engine.workspaces', false); pref('zen.essentials.enabled', true); pref('zen.workspaces.container-specific-essentials-enabled', false); @@ -228,15 +232,6 @@ pref("browser.xul.error_pages.expert_bad_cert", true); pref("security.tls.enable_0rtt_data", false); pref("network.http.http3.enable_0rtt", false); -// Media -pref("media.memory_cache_max_size", 1048576); -pref("media.cache_readahead_limit", 9000); -pref("media.cache_resume_threshold", 3600); -pref("media.memory_caches_combined_limit_kb", 2560000); - -// Image decoding -pref("image.mem.decode_bytes_at_a_time", 32768); - // Network pref("network.http.max-urgent-start-excessive-connections-per-host", 5); pref("network.dnsCacheExpiration", 3600); @@ -322,8 +317,6 @@ pref('browser.newtabpage.activity-stream.system.showWeather', true); // Enable experimental settings page (Used for Zen Labs) pref('browser.preferences.experimental', true); -// Jang's personal speedups (Thanks to Jang for these!) - // Prefetching: pref("network.dns.disablePrefetch", false); pref("network.prefetch-next", true); @@ -429,3 +422,20 @@ pref("browser.newtabpage.activity-stream.asrouter.userprefs.cfr.addons", false); pref("browser.newtabpage.activity-stream.asrouter.userprefs.cfr.features", false); pref("browser.preferences.moreFromMozilla", false, locked); pref("browser.aboutwelcome.enabled", false); + +// ---- Experimental settings to try make zen faster +pref("gfx.canvas.accelerated.cache-items", 32768); +pref("gfx.canvas.accelerated.cache-size", 4096); +pref("gfx.content.skia-font-cache-size", 80); + +pref("media.memory_cache_max_size", 1048576); +pref("media.cache_readahead_limit", 9000); +pref("media.cache_resume_threshold", 3600); +pref("media.memory_caches_combined_limit_kb", 2560000); + +pref("image.mem.decode_bytes_at_a_time", 32768); + +// Enable GPU by default +pref("gfx.canvas.accelerated", true); +pref("media.hardware-video-decoding.enabled", true); +pref("layers.gpu-process.enabled", true); diff --git a/src/browser/base/content/ZenStartup.mjs b/src/browser/base/content/ZenStartup.mjs index 35f3e7ea3..f868916ce 100644 --- a/src/browser/base/content/ZenStartup.mjs +++ b/src/browser/base/content/ZenStartup.mjs @@ -37,10 +37,10 @@ false ); - ZenWorkspaces.init(); - gZenUIManager.init(); - gZenVerticalTabsManager.init(); gZenCompactModeManager.init(); + ZenWorkspaces.init(); + gZenVerticalTabsManager.init(); + gZenUIManager.init(); document.l10n.setAttributes(document.getElementById('tabs-newtab-button'), 'tabs-toolbar-new-tab'); } catch (e) { diff --git a/src/browser/base/content/ZenUIManager.mjs b/src/browser/base/content/ZenUIManager.mjs index 959fc9ad6..80436baeb 100644 --- a/src/browser/base/content/ZenUIManager.mjs +++ b/src/browser/base/content/ZenUIManager.mjs @@ -8,6 +8,10 @@ var gZenUIManager = { XPCOMUtils.defineLazyPreferenceGetter(this, 'sidebarHeightThrottle', 'zen.view.sidebar-height-throttle', 500); XPCOMUtils.defineLazyPreferenceGetter(this, 'contentElementSeparation', 'zen.theme.content-element-separation', 0); + ChromeUtils.defineLazyGetter(this, 'motion', () => { + return ChromeUtils.importESModule('chrome://browser/content/zen-vendor/motion.min.mjs', { global: 'current' }); + }); + new ResizeObserver(gZenCommonActions.throttle(this.updateTabsToolbar.bind(this), this.sidebarHeightThrottle)).observe( document.getElementById('tabbrowser-tabs') ); @@ -256,7 +260,9 @@ var gZenVerticalTabsManager = { try { this._updateMaxWidth(); - window.docShell.treeOwner.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIAppWindow).rollupAllPopups(); + if (window.docShell) { + window.docShell.treeOwner.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIAppWindow).rollupAllPopups(); + } const topButtons = document.getElementById('zen-sidebar-top-buttons'); const isCompactMode = this._prefsCompactMode && !forCustomizableMode; diff --git a/src/browser/base/content/browser-sets-inc.patch b/src/browser/base/content/browser-sets-inc.patch new file mode 100644 index 000000000..c4bb1bffb --- /dev/null +++ b/src/browser/base/content/browser-sets-inc.patch @@ -0,0 +1,9 @@ +diff --git a/browser/base/content/browser-sets.inc b/browser/base/content/browser-sets.inc +index 493c593d66883082c2a4df87c4706f919ea675f8..aaaa833b64b0fd890aa2a0794eaeb7e41f002f06 100644 +--- a/browser/base/content/browser-sets.inc ++++ b/browser/base/content/browser-sets.inc +@@ -393,3 +393,4 @@ + internal="true"/> + #endif + ++ diff --git a/src/browser/base/content/zen-assets.jar.inc.mn b/src/browser/base/content/zen-assets.jar.inc.mn index 1db5d1874..11ae40418 100644 --- a/src/browser/base/content/zen-assets.jar.inc.mn +++ b/src/browser/base/content/zen-assets.jar.inc.mn @@ -75,3 +75,4 @@ # JS Vendor content/browser/zen-vendor/tsparticles.confetti.bundle.min.js (content/zen-vendor/tsparticles.confetti.bundle.min.js) + content/browser/zen-vendor/motion.min.mjs (content/zen-vendor/motion.min.mjs) diff --git a/src/browser/base/content/zen-styles/zen-animations.css b/src/browser/base/content/zen-styles/zen-animations.css index 14ec72705..78fa7cfe1 100644 --- a/src/browser/base/content/zen-styles/zen-animations.css +++ b/src/browser/base/content/zen-styles/zen-animations.css @@ -9,7 +9,18 @@ } 60% { - transform: scale3d(1.01, 1.01, 1.01); + transform: scale3d(1.02, 1.02, 1.02); + } + + to { + opacity: 1; + transform: scale3d(1, 1, 1); + } +} + +@keyframes zen-jello-animation-alt { + 0% { + transform: scale3d(0.8, 0.8, 0.8); } to { @@ -89,28 +100,6 @@ } } -@keyframes zen-slide-in { - from { - transform: translateX(-150%); - opacity: 0; - } - to { - transform: translateX(0); - opacity: 1; - } -} - -@keyframes zen-slide-in-reverse { - from { - transform: translateX(150%); - opacity: 0; - } - to { - transform: translateX(0); - opacity: 1; - } -} - @keyframes zen-deck-fadeIn { 0% { transform: scale(0.9); @@ -263,38 +252,6 @@ } } -@keyframes zen-glance-content-animation { - /* make the box appear from initial width/height and x/y coordinates */ - 0% { - opacity: 0; - top: 50%; - left: 50%; - transform: translate(-50%, -50%) translateZ(0); - width: 0%; - height: 0%; - } - - 80% { - /* make the box grow to full width/height */ - opacity: 1; - transform: translate(-50%, -50%) translateZ(0); - top: 50%; - left: 50%; - width: 87%; - height: 102%; - } - - 100% { - /* make the box shrink to final width/height and x/y coordinates */ - transform: translate(-50%, -50%) translateZ(0); - opacity: 1; - width: 85%; - height: 100%; - top: 50%; - left: 50%; - } -} - @keyframes zen-glance-content-animation-out { 0% { /* make the box shrink to final width/height and x/y coordinates */ diff --git a/src/browser/base/content/zen-styles/zen-browser-container.css b/src/browser/base/content/zen-styles/zen-browser-container.css index 69eee4f2f..9afaef709 100644 --- a/src/browser/base/content/zen-styles/zen-browser-container.css +++ b/src/browser/base/content/zen-styles/zen-browser-container.css @@ -14,16 +14,15 @@ transform 0.1s ease-in-out, opacity 0.1s ease-in-out; - box-shadow: 0 0 1px 1px light-dark(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.5)); overflow: hidden; - margin: 1px; :root[zen-right-side='true'] & { margin-left: var(--zen-element-separation); } - :root[zen-no-padding='true'] &:not([zen-split='true']) { - border-radius: 0 !important; + :root:not([zen-no-padding='true']) & { + margin: 1px; + box-shadow: 0 0 1px 1px light-dark(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.5)); } } diff --git a/src/browser/base/content/zen-styles/zen-browser-ui.css b/src/browser/base/content/zen-styles/zen-browser-ui.css index 3b03740e0..f669bef87 100644 --- a/src/browser/base/content/zen-styles/zen-browser-ui.css +++ b/src/browser/base/content/zen-styles/zen-browser-ui.css @@ -141,7 +141,7 @@ margin-right: 0; } - &:not([zen-no-padding='true']) #zen-tabbox-wrapper { + &:not([zen-no-padding='true'], [zen-right-side='true']) #zen-tabbox-wrapper { margin-left: 1px; } } diff --git a/src/browser/base/content/zen-styles/zen-compact-mode.css b/src/browser/base/content/zen-styles/zen-compact-mode.css index 7970e3bcd..d1a754cf9 100644 --- a/src/browser/base/content/zen-styles/zen-compact-mode.css +++ b/src/browser/base/content/zen-styles/zen-compact-mode.css @@ -59,13 +59,13 @@ :root[zen-single-toolbar='true'] & { top: var(--zen-element-separation); - - & #nav-bar { - margin-left: calc(var(--zen-toolbox-padding) / 2) !important; - } } } + &:not([zen-right-side='true']) #nav-bar { + margin-left: 0 !important; + } + & #urlbar[open] { top: 0 !important; } @@ -131,9 +131,112 @@ *:is([panelopen='true'], [open='true'], #nav-bar:focus-within):not(tab):not(.zen-compact-mode-ignore) ) { &:not([animate='true']) { + --zen-compact-mode-func: linear( + 0 0%, + 0.002958 1%, + 0.01137 2%, + 0.024581 3%, + 0.041981 4%, + 0.063001 5%, + 0.087118 6%, + 0.113846 7.000000000000001%, + 0.14274 8%, + 0.173391 9%, + 0.205425 10%, + 0.238504 11%, + 0.272318 12%, + 0.30659 13%, + 0.341071 14.000000000000002%, + 0.375535 15%, + 0.409787 16%, + 0.44365 17%, + 0.476971 18%, + 0.509618 19%, + 0.541476 20%, + 0.572448 21%, + 0.602453 22%, + 0.631425 23%, + 0.65931 24%, + 0.686067 25%, + 0.711668 26%, + 0.736092 27%, + 0.759328 28.000000000000004%, + 0.781375 28.999999999999996%, + 0.802235 30%, + 0.821921 31%, + 0.840449 32%, + 0.857841 33%, + 0.874121 34%, + 0.88932 35%, + 0.903469 36%, + 0.916603 37%, + 0.928759 38%, + 0.939975 39%, + 0.950291 40%, + 0.959747 41%, + 0.968385 42%, + 0.976244 43%, + 0.983366 44%, + 0.989792 45%, + 0.995562 46%, + 1.000716 47%, + 1.005292 48%, + 1.009328 49%, + 1.01286 50%, + 1.015925 51%, + 1.018556 52%, + 1.020787 53%, + 1.022648 54%, + 1.024172 55.00000000000001%, + 1.025385 56.00000000000001%, + 1.026316 56.99999999999999%, + 1.026991 57.99999999999999%, + 1.027434 59%, + 1.027669 60%, + 1.027717 61%, + 1.027599 62%, + 1.027334 63%, + 1.02694 64%, + 1.026433 65%, + 1.025829 66%, + 1.025143 67%, + 1.024388 68%, + 1.023575 69%, + 1.022715 70%, + 1.02182 71%, + 1.020898 72%, + 1.019957 73%, + 1.019005 74%, + 1.018048 75%, + 1.017094 76%, + 1.016146 77%, + 1.015211 78%, + 1.014291 79%, + 1.013391 80%, + 1.012513 81%, + 1.01166 82%, + 1.010835 83%, + 1.010039 84%, + 1.009273 85%, + 1.008538 86%, + 1.007836 87%, + 1.007166 88%, + 1.00653 89%, + 1.005926 90%, + 1.005355 91%, + 1.004817 92%, + 1.00431 93%, + 1.003835 94%, + 1.003391 95%, + 1.002976 96%, + 1.002591 97%, + 1.002233 98%, + 1.001902 99%, + 1.001597 100% + ); transition: - left 0.25s ease, - right 0.25s ease; + left 0.3125s var(--zen-compact-mode-func), + right 0.3125s var(--zen-compact-mode-func); opacity: 1; left: -1px; diff --git a/src/browser/base/content/zen-styles/zen-glance.css b/src/browser/base/content/zen-styles/zen-glance.css index 03396a3a7..ce2e4e2f0 100644 --- a/src/browser/base/content/zen-styles/zen-glance.css +++ b/src/browser/base/content/zen-styles/zen-glance.css @@ -105,7 +105,6 @@ height: 100%; opacity: 1; transition: opacity 0.2s ease-in-out; - transition-delay: 0.1s; } &[animate-full='true'] { @@ -118,7 +117,8 @@ } &[animate='true'] { - animation: zen-glance-content-animation 0.4s ease-in-out forwards; + position: absolute; + transform: translate(-50%, -50%); &:not([animate-end='true']) { pointer-events: none; diff --git a/src/browser/base/content/zen-styles/zen-panel-ui.css b/src/browser/base/content/zen-styles/zen-panel-ui.css index 39edad6bc..2aac0b79e 100644 --- a/src/browser/base/content/zen-styles/zen-panel-ui.css +++ b/src/browser/base/content/zen-styles/zen-panel-ui.css @@ -5,6 +5,10 @@ */ panel[type='arrow'][animate][animate='open']::part(content) { animation: zen-jello-animation 0.35s ease; + + @media (-moz-platform: macos) { + animation: zen-jello-animation-alt 0.35s ease; + } } panel[type='arrow'][animate]:not([animate='open'])::part(content) { diff --git a/src/browser/base/content/zen-styles/zen-tabs/vertical-tabs.css b/src/browser/base/content/zen-styles/zen-tabs/vertical-tabs.css index 3842d0db9..63acad020 100644 --- a/src/browser/base/content/zen-styles/zen-tabs/vertical-tabs.css +++ b/src/browser/base/content/zen-styles/zen-tabs/vertical-tabs.css @@ -223,6 +223,7 @@ #tabbrowser-tabs { margin-inline-start: 0 !important; padding-inline-start: 0 !important; + overflow-x: hidden; --tab-inner-inline-margin: 0; @@ -242,23 +243,6 @@ & .tabbrowser-tab { transition: scale 0.07s ease; #tabbrowser-tabs &:not([zen-essential='true']) { - #tabbrowser-tabs[zen-workspace-animation='previous'] & { - animation: zen-slide-in; - } - - #tabbrowser-tabs[zen-workspace-animation='next'] & { - animation: zen-slide-in-reverse; - } - - #tabbrowser-tabs[zen-workspace-animation] & { - opacity: 0; - transform: translateX(-100%); - animation-delay: 0.2s; - animation-fill-mode: forwards; - animation-duration: 0.2s; - animation-timing-function: ease; - } - #tabbrowser-tabs[dont-animate-tabs] & { opacity: 0; } @@ -963,6 +947,39 @@ & .tab-icon-overlay { margin-inline-end: 0 !important; } + + @media (-moz-bool-pref: 'zen.theme.essentials-favicon-bg') { + &[selected] .tab-background { + &::after { + content: ""; + inset: -50%; + filter: blur(15px); + position: absolute; + background-size: 100% 100%; + background-clip: padding-box; + background-image: var(--zen-tab-icon); + z-index: -1; + } + + background: transparent; + overflow: hidden; + + &::before { + background: light-dark(rgba(255, 255, 255, 0.8), rgba(68, 64, 64, 0.80)); + margin: 2px; + border-radius: calc(var(--tab-border-radius) - 2px); + position: absolute; + inset: 0; + z-index: 0; + content: ""; + transition: background 0.2s ease-in-out; + } + } + + &[selected]:hover .tab-background::before { + background: light-dark(rgba(255, 255, 255, 0.8), rgba(68, 64, 64, 0.85)); + } + } } diff --git a/src/browser/base/content/zen-styles/zen-theme.css b/src/browser/base/content/zen-styles/zen-theme.css index e311ca693..ca1bcc4e3 100644 --- a/src/browser/base/content/zen-styles/zen-theme.css +++ b/src/browser/base/content/zen-styles/zen-theme.css @@ -103,7 +103,7 @@ --zen-button-border-radius: 5px; --zen-button-padding: 0.6rem 1.2rem; - --zen-toolbar-element-bg: light-dark(rgba(255, 255, 255, 0.4), rgba(170, 170, 170, 0.2)); + --zen-toolbar-element-bg: light-dark(rgba(255, 255, 255, 0.65), rgba(170, 170, 170, 0.2)); /* Toolbar */ --zen-toolbar-height: 38px; diff --git a/src/browser/base/content/zen-styles/zen-urlbar.css b/src/browser/base/content/zen-styles/zen-urlbar.css index 170f06e5e..f6330a83d 100644 --- a/src/browser/base/content/zen-styles/zen-urlbar.css +++ b/src/browser/base/content/zen-styles/zen-urlbar.css @@ -360,6 +360,7 @@ button.popup-notification-dropmarker { } #urlbar[open] { + z-index: 2; --urlbar-margin-inline: 5px !important; & #identity-box { diff --git a/src/browser/base/content/zen-styles/zen-workspaces.css b/src/browser/base/content/zen-styles/zen-workspaces.css index 708135d0e..d63d2587c 100644 --- a/src/browser/base/content/zen-styles/zen-workspaces.css +++ b/src/browser/base/content/zen-styles/zen-workspaces.css @@ -479,7 +479,7 @@ } } -@media (not (-moz-bool-pref: 'zen.workspaces.show-workspace-indicator')) or (not (-moz-bool-pref: 'zen.workspaces.enabled')) { +@media not (-moz-bool-pref: 'zen.workspaces.show-workspace-indicator') { #zen-current-workspace-indicator { display: none !important; } diff --git a/src/browser/base/content/zen-vendor/motion.min.mjs b/src/browser/base/content/zen-vendor/motion.min.mjs new file mode 100644 index 000000000..915552945 --- /dev/null +++ b/src/browser/base/content/zen-vendor/motion.min.mjs @@ -0,0 +1,7 @@ +/** + * Bundled by jsDelivr using Rollup v2.79.2 and Terser v5.37.0. + * Original file: /npm/motion@11.17.0/dist/es/motion/lib/index.mjs + * + * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files + */ +const t=!1;function e(){return t}const n=t=>t;let s=n;const i=(t,e,n)=>{const s=e-t;return 0===s?1:(n-t)/s};function r(t){let e;return()=>(void 0===e&&(e=t()),e)}const o=r((()=>void 0!==window.ScrollTimeline));class a{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map((t=>"finished"in t?t.finished:t)))}getAll(t){return this.animations[0][t]}setAll(t,e){for(let n=0;no()&&n.attachTimeline?n.attachTimeline(t):"function"==typeof e?e(n):void 0));return()=>{n.forEach(((t,e)=>{t&&t(),this.animations[e].stop()}))}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let e=0;ee[t]()))}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class l extends a{then(t,e){return Promise.all(this.animations).then(t).catch(e)}}const u=t=>1e3*t,c=t=>t/1e3,h=2e4;function d(t){let e=0;let n=t.next(e);for(;!n.done&&e=h?1/0:e}const p=(t,e,n=10)=>{let s="";const r=Math.max(Math.round(e/n),2);for(let e=0;en>e?e:n{const s=e*o,i=s*t,r=s-n,a=R(e,o),l=Math.exp(-i);return C-r/a*l},r=e=>{const s=e*o*t,r=s*n+n,a=Math.pow(o,2)*Math.pow(e,2)*t,l=Math.exp(-s),u=R(Math.pow(e,2),o);return(-i(e)+C>0?-1:1)*((r-a)*l)/u}):(i=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,r=e=>Math.exp(-e*t)*(t*t*(n-e)));const a=function(t,e,n){let s=n;for(let n=1;nvoid 0!==t[e]))}function L(t=S,e=T){const n="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:s,restDelta:i}=n;const r=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:r},{stiffness:l,damping:m,mass:x,duration:M,velocity:P,isResolvedFromDuration:k}=function(t){let e={velocity:b,stiffness:y,damping:v,mass:w,isResolvedFromDuration:!1,...t};if(!D(t,I)&&D(t,B))if(t.visualDuration){const n=t.visualDuration,s=2*Math.PI/(1.2*n),i=s*s,r=2*f(.05,1,1-(t.bounce||0))*Math.sqrt(i);e={...e,mass:w,stiffness:i,damping:r}}else{const n=E(t);e={...e,...n,mass:w},e.isResolvedFromDuration=!0}return e}({...n,velocity:-c(n.velocity||0)}),F=P||0,C=m/(2*Math.sqrt(l*x)),O=o-r,L=c(Math.sqrt(l/x)),W=Math.abs(O)<5;let N;if(s||(s=W?A.granular:A.default),i||(i=W?V.granular:V.default),C<1){const t=R(L,C);N=e=>{const n=Math.exp(-C*L*e);return o-n*((F+C*L*O)/t*Math.sin(t*e)+O*Math.cos(t*e))}}else if(1===C)N=t=>o-Math.exp(-L*t)*(O+(F+L*O)*t);else{const t=L*Math.sqrt(C*C-1);N=e=>{const n=Math.exp(-C*L*e),s=Math.min(t*e,300);return o-n*((F+C*L*O)*Math.sinh(s)+t*O*Math.cosh(s))/t}}const K={calculatedDuration:k&&M||null,next:t=>{const e=N(t);if(k)a.done=t>=M;else{let n=0;C<1&&(n=0===t?u(F):g(N,t,e));const r=Math.abs(n)<=s,l=Math.abs(o-e)<=i;a.done=r&&l}return a.value=a.done?o:e,a},toString:()=>{const t=Math.min(d(K),h),e=p((e=>K.next(t*e).value),t,30);return t+"ms "+e}};return K}function W(t,e=100,n){const s=n({...t,keyframes:[0,e]}),i=Math.min(d(s),h);return{type:"keyframes",ease:t=>s.next(i*t).value/e,duration:c(i)}}function N(t){return"function"==typeof t}const K=(t,e,n)=>{const s=e-t;return((n-t)%s+s)%s+t},$=t=>Array.isArray(t)&&"number"!=typeof t[0];function j(t,e){return $(t)?t[K(0,t.length,e)]:t}const z=(t,e,n)=>t+(e-t)*n;function H(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const r=i(0,e,s);t.push(z(n,1,r))}}function U(t){const e=[0];return H(e,t.length-1),e}const Y=t=>Boolean(t&&t.getVelocity);function q(t,e,n){var s;if(t instanceof Element)return[t];if("string"==typeof t){let i=document;e&&(i=e.current);const r=null!==(s=null==n?void 0:n[t])&&void 0!==s?s:i.querySelectorAll(t);return r?Array.from(r):[]}return Array.from(t)}function X(t){return"object"==typeof t&&!Array.isArray(t)}function G(t,e,n,s){return"string"==typeof t&&X(e)?q(t,n,s):t instanceof NodeList?Array.from(t):Array.isArray(t)?t:[t]}function Z(t,e,n){return t*(e+1)}function _(t,e,n,s){var i;return"number"==typeof e?e:e.startsWith("-")||e.startsWith("+")?Math.max(0,t+parseFloat(e)):"<"===e?n:null!==(i=s.get(e))&&void 0!==i?i:t}function J(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}function Q(t,e,n,s,i,r){!function(t,e,n){for(let s=0;se&&i.at"number"==typeof t,at=t=>t.every(ot),lt=new WeakMap;function ut(t,e){return t?t[e]||t.default||t:void 0}const ct=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],ht=new Set(ct),dt=new Set(["width","height","top","left","right","bottom",...ct]),pt=t=>(t=>Array.isArray(t))(t)?t[t.length-1]||0:t,ft=!1;const mt=["read","resolveKeyframes","update","preRender","render","postRender"];const{schedule:gt,cancel:yt,state:vt,steps:wt}=function(t,e){let n=!1,s=!0;const i={delta:0,timestamp:0,isProcessing:!1},r=()=>n=!0,o=mt.reduce(((t,e)=>(t[e]=function(t){let e=new Set,n=new Set,s=!1,i=!1;const r=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1};function a(e){r.has(e)&&(l.schedule(e),t()),e(o)}const l={schedule:(t,i=!1,o=!1)=>{const a=o&&s?e:n;return i&&r.add(t),a.has(t)||a.add(t),t},cancel:t=>{n.delete(t),r.delete(t)},process:t=>{o=t,s?i=!0:(s=!0,[e,n]=[n,e],e.forEach(a),e.clear(),s=!1,i&&(i=!1,l.process(t)))}};return l}(r),t)),{}),{read:a,resolveKeyframes:l,update:u,preRender:c,render:h,postRender:d}=o,p=()=>{const r=performance.now();n=!1,i.delta=s?1e3/60:Math.max(Math.min(r-i.timestamp,40),1),i.timestamp=r,i.isProcessing=!0,a.process(i),l.process(i),u.process(i),c.process(i),h.process(i),d.process(i),i.isProcessing=!1,n&&e&&(s=!1,t(p))};return{schedule:mt.reduce(((e,r)=>{const a=o[r];return e[r]=(e,r=!1,o=!1)=>(n||(n=!0,s=!0,i.isProcessing||t(p)),a.schedule(e,r,o)),e}),{}),cancel:t=>{for(let e=0;e(void 0===bt&&Tt.set(vt.isProcessing||ft?vt.timestamp:performance.now()),bt),set:t=>{bt=t,queueMicrotask(xt)}};class St{constructor(){this.subscriptions=[]}add(t){var e,n;return e=this.subscriptions,n=t,-1===e.indexOf(n)&&e.push(n),()=>J(this.subscriptions,t)}notify(t,e,n){const s=this.subscriptions.length;if(s)if(1===s)this.subscriptions[0](t,e,n);else for(let i=0;i{const n=Tt.now();this.updatedAt!==n&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),e&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=Tt.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e))))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new St);const n=this.events[t].add(e);return"change"===t?()=>{n(),gt.read((()=>{this.events.change.getSize()||this.stop()}))}:n}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t,e=!0){e&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,e)}setWithVelocity(t,e,n){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=Tt.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return m(parseFloat(this.current)-parseFloat(this.prevFrameValue),e)}start(t){return this.stop(),new Promise((e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()})).then((()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()}))}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Vt(t,e){return new At(t,e)}function Mt(t){const e=[{},{}];return null==t||t.values.forEach(((t,n)=>{e[0][n]=t.get(),e[1][n]=t.getVelocity()})),e}function Pt(t,e,n,s){if("function"==typeof e){const[i,r]=Mt(s);e=e(void 0!==n?n:t.custom,i,r)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){const[i,r]=Mt(s);e=e(void 0!==n?n:t.custom,i,r)}return e}function kt(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Vt(n))}function Ft(t,e){const n=function(t,e,n){const s=t.getProps();return Pt(s,e,void 0!==n?n:s.custom,t)}(t,e);let{transitionEnd:s={},transition:i={},...r}=n||{};r={...r,...s};for(const e in r){kt(t,e,pt(r[e]))}}function Ct(t,e){const n=t.getValue("willChange");if(s=n,Boolean(Y(s)&&s.add))return n.add(e);var s}const Et=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Ot="data-"+Et("framerAppearId");function Rt(t){return t.props[Ot]}function Bt(t,e){t.timeline=e,t.onfinish=null}const It=t=>Array.isArray(t)&&"number"==typeof t[0],Dt={linearEasing:void 0};function Lt(t,e){const n=r(t);return()=>{var t;return null!==(t=Dt[e])&&void 0!==t?t:n()}}const Wt=Lt((()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0}),"linearEasing");function Nt(t){return Boolean("function"==typeof t&&Wt()||!t||"string"==typeof t&&(t in $t||Wt())||It(t)||Array.isArray(t)&&t.every(Nt))}const Kt=([t,e,n,s])=>`cubic-bezier(${t}, ${e}, ${n}, ${s})`,$t={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Kt([0,.65,.55,1]),circOut:Kt([.55,0,1,.45]),backIn:Kt([.31,.01,.66,-.59]),backOut:Kt([.33,1.53,.69,.99])};function jt(t,e){return t?"function"==typeof t&&Wt()?p(t,e):It(t)?Kt(t):Array.isArray(t)?t.map((t=>jt(t,e)||$t.easeOut)):$t[t]:void 0}const zt=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function Ht(t,e,s,i){if(t===e&&s===i)return n;const r=e=>function(t,e,n,s,i){let r,o,a=0;do{o=e+(n-e)/2,r=zt(o,s,i)-t,r>0?n=o:e=o}while(Math.abs(r)>1e-7&&++a<12);return o}(e,0,1,t,s);return t=>0===t||1===t?t:zt(r(t),e,i)}const Ut=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Yt=t=>e=>1-t(1-e),qt=Ht(.33,1.53,.69,.99),Xt=Yt(qt),Gt=Ut(Xt),Zt=t=>(t*=2)<1?.5*Xt(t):.5*(2-Math.pow(2,-10*(t-1))),_t=t=>1-Math.sin(Math.acos(t)),Jt=Yt(_t),Qt=Ut(_t),te=t=>/^0[^.\s]+$/u.test(t);const ee={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},ne={...ee,transform:t=>f(0,1,t)},se={...ee,default:1},ie=t=>Math.round(1e5*t)/1e5,re=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const oe=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,ae=(t,e)=>n=>Boolean("string"==typeof n&&oe.test(n)&&n.startsWith(t)||e&&!function(t){return null==t}(n)&&Object.prototype.hasOwnProperty.call(n,e)),le=(t,e,n)=>s=>{if("string"!=typeof s)return s;const[i,r,o,a]=s.match(re);return{[t]:parseFloat(i),[e]:parseFloat(r),[n]:parseFloat(o),alpha:void 0!==a?parseFloat(a):1}},ue={...ee,transform:t=>Math.round((t=>f(0,255,t))(t))},ce={test:ae("rgb","red"),parse:le("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:s=1})=>"rgba("+ue.transform(t)+", "+ue.transform(e)+", "+ue.transform(n)+", "+ie(ne.transform(s))+")"};const he={test:ae("#"),parse:function(t){let e="",n="",s="",i="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),s=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),s=t.substring(3,4),i=t.substring(4,5),e+=e,n+=n,s+=s,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:i?parseInt(i,16)/255:1}},transform:ce.transform},de=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),pe=de("deg"),fe=de("%"),me=de("px"),ge=de("vh"),ye=de("vw"),ve={...fe,parse:t=>fe.parse(t)/100,transform:t=>fe.transform(100*t)},we={test:ae("hsl","hue"),parse:le("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:s=1})=>"hsla("+Math.round(t)+", "+fe.transform(ie(e))+", "+fe.transform(ie(n))+", "+ie(ne.transform(s))+")"},be={test:t=>ce.test(t)||he.test(t)||we.test(t),parse:t=>ce.test(t)?ce.parse(t):we.test(t)?we.parse(t):he.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?ce.transform(t):we.transform(t)},xe=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const Te="number",Se="color",Ae=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Ve(t){const e=t.toString(),n=[],s={color:[],number:[],var:[]},i=[];let r=0;const o=e.replace(Ae,(t=>(be.test(t)?(s.color.push(r),i.push(Se),n.push(be.parse(t))):t.startsWith("var(")?(s.var.push(r),i.push("var"),n.push(t)):(s.number.push(r),i.push(Te),n.push(parseFloat(t))),++r,"${}"))).split("${}");return{values:n,split:o,indexes:s,types:i}}function Me(t){return Ve(t).values}function Pe(t){const{split:e,types:n}=Ve(t),s=e.length;return t=>{let i="";for(let r=0;r"number"==typeof t?0:t;const Fe={test:function(t){var e,n;return isNaN(t)&&"string"==typeof t&&((null===(e=t.match(re))||void 0===e?void 0:e.length)||0)+((null===(n=t.match(xe))||void 0===n?void 0:n.length)||0)>0},parse:Me,createTransformer:Pe,getAnimatableNone:function(t){const e=Me(t);return Pe(t)(e.map(ke))}},Ce=new Set(["brightness","contrast","saturate","opacity"]);function Ee(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[s]=n.match(re)||[];if(!s)return t;const i=n.replace(s,"");let r=Ce.has(e)?1:0;return s!==n&&(r*=100),e+"("+r+i+")"}const Oe=/\b([a-z-]*)\(.*?\)/gu,Re={...Fe,getAnimatableNone:t=>{const e=t.match(Oe);return e?e.map(Ee).join(" "):t}},Be={borderWidth:me,borderTopWidth:me,borderRightWidth:me,borderBottomWidth:me,borderLeftWidth:me,borderRadius:me,radius:me,borderTopLeftRadius:me,borderTopRightRadius:me,borderBottomRightRadius:me,borderBottomLeftRadius:me,width:me,maxWidth:me,height:me,maxHeight:me,top:me,right:me,bottom:me,left:me,padding:me,paddingTop:me,paddingRight:me,paddingBottom:me,paddingLeft:me,margin:me,marginTop:me,marginRight:me,marginBottom:me,marginLeft:me,backgroundPositionX:me,backgroundPositionY:me},Ie={rotate:pe,rotateX:pe,rotateY:pe,rotateZ:pe,scale:se,scaleX:se,scaleY:se,scaleZ:se,skew:pe,skewX:pe,skewY:pe,distance:me,translateX:me,translateY:me,translateZ:me,x:me,y:me,z:me,perspective:me,transformPerspective:me,opacity:ne,originX:ve,originY:ve,originZ:me},De={...ee,transform:Math.round},Le={...Be,...Ie,zIndex:De,size:me,fillOpacity:ne,strokeOpacity:ne,numOctaves:De},We={...Le,color:be,backgroundColor:be,outlineColor:be,fill:be,stroke:be,borderColor:be,borderTopColor:be,borderRightColor:be,borderBottomColor:be,borderLeftColor:be,filter:Re,WebkitFilter:Re},Ne=t=>We[t];function Ke(t,e){let n=Ne(t);return n!==Re&&(n=Fe),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const $e=new Set(["auto","none","0"]);const je=t=>t===ee||t===me,ze=(t,e)=>parseFloat(t.split(", ")[e]),He=(t,e)=>(n,{transform:s})=>{if("none"===s||!s)return 0;const i=s.match(/^matrix3d\((.+)\)$/u);if(i)return ze(i[1],e);{const e=s.match(/^matrix\((.+)\)$/u);return e?ze(e[1],t):0}},Ue=new Set(["x","y","z"]),Ye=ct.filter((t=>!Ue.has(t)));const qe={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:He(4,13),y:He(5,14)};qe.translateX=qe.x,qe.translateY=qe.y;const Xe=new Set;let Ge=!1,Ze=!1;function _e(){if(Ze){const t=Array.from(Xe).filter((t=>t.needsMeasurement)),e=new Set(t.map((t=>t.element))),n=new Map;e.forEach((t=>{const e=function(t){const e=[];return Ye.forEach((n=>{const s=t.getValue(n);void 0!==s&&(e.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))})),e}(t);e.length&&(n.set(t,e),t.render())})),t.forEach((t=>t.measureInitialState())),e.forEach((t=>{t.render();const e=n.get(t);e&&e.forEach((([e,n])=>{var s;null===(s=t.getValue(e))||void 0===s||s.set(n)}))})),t.forEach((t=>t.measureEndState())),t.forEach((t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)}))}Ze=!1,Ge=!1,Xe.forEach((t=>t.complete())),Xe.clear()}function Je(){Xe.forEach((t=>{t.readKeyframes(),t.needsMeasurement&&(Ze=!0)}))}class Qe{constructor(t,e,n,s,i,r=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=n,this.motionValue=s,this.element=i,this.isAsync=r}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Xe.add(this),Ge||(Ge=!0,gt.read(Je),gt.resolveKeyframes(_e))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:n,motionValue:s}=this;for(let i=0;i/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),en=t=>e=>"string"==typeof e&&e.startsWith(t),nn=en("--"),sn=en("var(--"),rn=t=>!!sn(t)&&on.test(t.split("/*")[0].trim()),on=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,an=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function ln(t,e,n=1){const[s,i]=function(t){const e=an.exec(t);if(!e)return[,];const[,n,s,i]=e;return[`--${null!=n?n:s}`,i]}(t);if(!s)return;const r=window.getComputedStyle(e).getPropertyValue(s);if(r){const t=r.trim();return tn(t)?parseFloat(t):t}return rn(i)?ln(i,e,n+1):i}const un=t=>e=>e.test(t),cn=[ee,me,fe,pe,ye,ge,{test:t=>"auto"===t,parse:t=>t}],hn=t=>cn.find(un(t));class dn extends Qe{constructor(t,e,n,s,i){super(t,e,n,s,i,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:n}=this;if(!e||!e.current)return;super.readKeyframes();for(let n=0;n{e.getValue(t).set(n)})),this.resolveNoneKeyframes()}}const pn=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!Fe.test(t)&&"0"!==t||t.startsWith("url(")));function fn(t,e,n,s){const i=t[0];if(null===i)return!1;if("display"===e||"visibility"===e)return!0;const r=t[t.length-1],o=pn(i,e),a=pn(r,e);return!(!o||!a)&&(function(t){const e=t[0];if(1===t.length)return!0;for(let n=0;nnull!==t;function gn(t,{repeat:e,repeatType:n="loop"},s){const i=t.filter(mn),r=e&&"loop"!==n&&e%2==1?0:i.length-1;return r&&void 0!==s?s:i[r]}class yn{constructor({autoplay:t=!0,delay:e=0,type:n="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:r="loop",...o}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=Tt.now(),this.options={autoplay:t,delay:e,type:n,repeat:s,repeatDelay:i,repeatType:r,...o},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt}get resolved(){return this._resolved||this.hasAttemptedResolve||(Je(),_e()),this._resolved}onKeyframesResolved(t,e){this.resolvedAt=Tt.now(),this.hasAttemptedResolve=!0;const{name:n,type:s,velocity:i,delay:r,onComplete:o,onUpdate:a,isGenerator:l}=this.options;if(!l&&!fn(t,n,s,i)){if(!r)return null==a||a(gn(t,this.options,e)),null==o||o(),void this.resolveFinishedPromise();this.options.duration=0}const u=this.initPlayback(t,e);!1!==u&&(this._resolved={keyframes:t,finalKeyframe:e,...u},this.onPostResolved())}onPostResolved(){}then(t,e){return this.currentFinishedPromise.then(t,e)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise((t=>{this.resolveFinishedPromise=t}))}}function vn(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function wn(t,e){return n=>n>0?e:t}const bn=(t,e,n)=>{const s=t*t,i=n*(e*e-s)+s;return i<0?0:Math.sqrt(i)},xn=[he,ce,we];function Tn(t){const e=(n=t,xn.find((t=>t.test(n))));var n;if(!Boolean(e))return!1;let s=e.parse(t);return e===we&&(s=function({hue:t,saturation:e,lightness:n,alpha:s}){t/=360,n/=100;let i=0,r=0,o=0;if(e/=100){const s=n<.5?n*(1+e):n+e-n*e,a=2*n-s;i=vn(a,s,t+1/3),r=vn(a,s,t),o=vn(a,s,t-1/3)}else i=r=o=n;return{red:Math.round(255*i),green:Math.round(255*r),blue:Math.round(255*o),alpha:s}}(s)),s}const Sn=(t,e)=>{const n=Tn(t),s=Tn(e);if(!n||!s)return wn(t,e);const i={...n};return t=>(i.red=bn(n.red,s.red,t),i.green=bn(n.green,s.green,t),i.blue=bn(n.blue,s.blue,t),i.alpha=z(n.alpha,s.alpha,t),ce.transform(i))},An=(t,e)=>n=>e(t(n)),Vn=(...t)=>t.reduce(An),Mn=new Set(["none","hidden"]);function Pn(t,e){return n=>z(t,e,n)}function kn(t){return"number"==typeof t?Pn:"string"==typeof t?rn(t)?wn:be.test(t)?Sn:En:Array.isArray(t)?Fn:"object"==typeof t?be.test(t)?Sn:Cn:wn}function Fn(t,e){const n=[...t],s=n.length,i=t.map(((t,n)=>kn(t)(t,e[n])));return t=>{for(let e=0;e{for(const e in s)n[e]=s[e](t);return n}}const En=(t,e)=>{const n=Fe.createTransformer(e),s=Ve(t),i=Ve(e);return s.indexes.var.length===i.indexes.var.length&&s.indexes.color.length===i.indexes.color.length&&s.indexes.number.length>=i.indexes.number.length?Mn.has(t)&&!i.values.length||Mn.has(e)&&!s.values.length?function(t,e){return Mn.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}(t,e):Vn(Fn(function(t,e){var n;const s=[],i={color:0,var:0,number:0};for(let r=0;rvoid 0===a?l:void 0===l||Math.abs(a-t)-f*Math.exp(-t/s),w=t=>y+v(t),b=t=>{const e=v(t),n=w(t);d.done=Math.abs(e)<=u,d.value=d.done?y:n};let x,T;const S=t=>{var e;(e=d.value,void 0!==a&&el)&&(x=t,T=L({keyframes:[d.value,p(d.value)],velocity:g(w,t,d.value),damping:i,stiffness:r,restDelta:u,restSpeed:c}))};return S(0),{calculatedDuration:null,next:t=>{let e=!1;return T||void 0!==x||(e=!0,b(t),S(t)),void 0!==x&&t>=x?T.next(t-x):(!e&&b(t),d)}}}const Bn=Ht(.42,0,1,1),In=Ht(0,0,.58,1),Dn=Ht(.42,0,.58,1),Ln={linear:n,easeIn:Bn,easeInOut:Dn,easeOut:In,circIn:_t,circInOut:Qt,circOut:Jt,backIn:Xt,backInOut:Gt,backOut:qt,anticipate:Zt},Wn=t=>{if(It(t)){s(4===t.length);const[e,n,i,r]=t;return Ht(e,n,i,r)}return"string"==typeof t?Ln[t]:t};function Nn(t,e,{clamp:r=!0,ease:o,mixer:a}={}){const l=t.length;if(s(l===e.length),1===l)return()=>e[0];if(2===l&&e[0]===e[1])return()=>e[1];const u=t[0]===t[1];t[0]>t[l-1]&&(t=[...t].reverse(),e=[...e].reverse());const c=function(t,e,s){const i=[],r=s||On,o=t.length-1;for(let s=0;s{if(u&&n1)for(;sd(f(t[0],t[l-1],e)):d}function Kn({duration:t=300,keyframes:e,times:n,ease:s="easeInOut"}){const i=$(s)?s.map(Wn):Wn(s),r={done:!1,value:e[0]},o=function(t,e){return t.map((t=>t*e))}(n&&n.length===e.length?n:U(e),t),a=Nn(o,e,{ease:Array.isArray(i)?i:(l=e,u=i,l.map((()=>u||Dn)).splice(0,l.length-1))});var l,u;return{calculatedDuration:t,next:e=>(r.value=a(e),r.done=e>=t,r)}}const $n=t=>{const e=({timestamp:e})=>t(e);return{start:()=>gt.update(e,!0),stop:()=>yt(e),now:()=>vt.isProcessing?vt.timestamp:Tt.now()}},jn={decay:Rn,inertia:Rn,tween:Kn,keyframes:Kn,spring:L},zn=t=>t/100;class Hn extends yn{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.teardown();const{onStop:t}=this.options;t&&t()};const{name:e,motionValue:n,element:s,keyframes:i}=this.options,r=(null==s?void 0:s.KeyframeResolver)||Qe;this.resolver=new r(i,((t,e)=>this.onKeyframesResolved(t,e)),e,n,s),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:e="keyframes",repeat:n=0,repeatDelay:s=0,repeatType:i,velocity:r=0}=this.options,o=N(e)?e:jn[e]||Kn;let a,l;o!==Kn&&"number"!=typeof t[0]&&(a=Vn(zn,On(t[0],t[1])),t=[0,100]);const u=o({...this.options,keyframes:t});"mirror"===i&&(l=o({...this.options,keyframes:[...t].reverse(),velocity:-r})),null===u.calculatedDuration&&(u.calculatedDuration=d(u));const{calculatedDuration:c}=u,h=c+s;return{generator:u,mirroredGenerator:l,mapPercentToKeyframes:a,calculatedDuration:c,resolvedDuration:h,totalDuration:h*(n+1)-s}}onPostResolved(){const{autoplay:t=!0}=this.options;this.play(),"paused"!==this.pendingPlayState&&t?this.state=this.pendingPlayState:this.pause()}tick(t,e=!1){const{resolved:n}=this;if(!n){const{keyframes:t}=this.options;return{done:!0,value:t[t.length-1]}}const{finalKeyframe:s,generator:i,mirroredGenerator:r,mapPercentToKeyframes:o,keyframes:a,calculatedDuration:l,totalDuration:u,resolvedDuration:c}=n;if(null===this.startTime)return i.next(0);const{delay:h,repeat:d,repeatType:p,repeatDelay:m,onUpdate:g}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-u/this.speed,this.startTime)),e?this.currentTime=t:null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const y=this.currentTime-h*(this.speed>=0?1:-1),v=this.speed>=0?y<0:y>u;this.currentTime=Math.max(y,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=u);let w=this.currentTime,b=i;if(d){const t=Math.min(this.currentTime,u)/c;let e=Math.floor(t),n=t%1;!n&&t>=1&&(n=1),1===n&&e--,e=Math.min(e,d+1);Boolean(e%2)&&("reverse"===p?(n=1-n,m&&(n-=m/c)):"mirror"===p&&(b=r)),w=f(0,1,n)*c}const x=v?{done:!1,value:a[0]}:b.next(w);o&&(x.value=o(x.value));let{done:T}=x;v||null===l||(T=this.speed>=0?this.currentTime>=u:this.currentTime<=0);const S=null===this.holdTime&&("finished"===this.state||"running"===this.state&&T);return S&&void 0!==s&&(x.value=gn(a,this.options,s)),g&&g(x.value),S&&this.finish(),x}get duration(){const{resolved:t}=this;return t?c(t.calculatedDuration):0}get time(){return c(this.currentTime)}set time(t){t=u(t),this.currentTime=t,null!==this.holdTime||0===this.speed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const e=this.playbackSpeed!==t;this.playbackSpeed=t,e&&(this.time=c(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved)return void(this.pendingPlayState="running");if(this.isStopped)return;const{driver:t=$n,onPlay:e,startTime:n}=this.options;this.driver||(this.driver=t((t=>this.tick(t)))),e&&e();const s=this.driver.now();null!==this.holdTime?this.startTime=s-this.holdTime:this.startTime?"finished"===this.state&&(this.startTime=s):this.startTime=null!=n?n:this.calcStartTime(),"finished"===this.state&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;this._resolved?(this.state="paused",this.holdTime=null!==(t=this.currentTime)&&void 0!==t?t:0):this.pendingPlayState="paused"}complete(){"running"!==this.state&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){null!==this.cancelTime&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}}const Un=new Set(["opacity","clipPath","filter","transform"]);function Yn(t,e,n,{delay:s=0,duration:i=300,repeat:r=0,repeatType:o="loop",ease:a="easeInOut",times:l}={}){const u={[e]:n};l&&(u.offset=l);const c=jt(a,i);return Array.isArray(c)&&(u.easing=c),t.animate(u,{delay:s,duration:i,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:r+1,direction:"reverse"===o?"alternate":"normal"})}const qn=r((()=>Object.hasOwnProperty.call(Element.prototype,"animate")));const Xn={anticipate:Zt,backInOut:Gt,circInOut:Qt};class Gn extends yn{constructor(t){super(t);const{name:e,motionValue:n,element:s,keyframes:i}=this.options;this.resolver=new dn(i,((t,e)=>this.onKeyframesResolved(t,e)),e,n,s),this.resolver.scheduleResolve()}initPlayback(t,e){var n;let{duration:s=300,times:i,ease:r,type:o,motionValue:a,name:l,startTime:u}=this.options;if(!(null===(n=a.owner)||void 0===n?void 0:n.current))return!1;var c;if("string"==typeof r&&Wt()&&r in Xn&&(r=Xn[r]),N((c=this.options).type)||"spring"===c.type||!Nt(c.ease)){const{onComplete:e,onUpdate:n,motionValue:a,element:l,...u}=this.options,c=function(t,e){const n=new Hn({...e,keyframes:t,repeat:0,delay:0,isGenerator:!0});let s={done:!1,value:t[0]};const i=[];let r=0;for(;!s.done&&r<2e4;)s=n.sample(r),i.push(s.value),r+=10;return{times:void 0,keyframes:i,duration:r-10,ease:"linear"}}(t,u);1===(t=c.keyframes).length&&(t[1]=t[0]),s=c.duration,i=c.times,r=c.ease,o="keyframes"}const h=Yn(a.owner.current,l,t,{...this.options,duration:s,times:i,ease:r});return h.startTime=null!=u?u:this.calcStartTime(),this.pendingTimeline?(Bt(h,this.pendingTimeline),this.pendingTimeline=void 0):h.onfinish=()=>{const{onComplete:n}=this.options;a.set(gn(t,this.options,e)),n&&n(),this.cancel(),this.resolveFinishedPromise()},{animation:h,duration:s,times:i,type:o,ease:r,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:e}=t;return c(e)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:e}=t;return c(e.currentTime||0)}set time(t){const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.currentTime=u(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:e}=t;return e.playbackRate}set speed(t){const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:e}=t;return e.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:e}=t;return e.startTime}attachTimeline(t){if(this._resolved){const{resolved:e}=this;if(!e)return n;const{animation:s}=e;Bt(s,t)}else this.pendingTimeline=t;return n}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:e}=t;"finished"===e.playState&&this.updateFinishedPromise(),e.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:e}=t;e.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:e,keyframes:n,duration:s,type:i,ease:r,times:o}=t;if("idle"===e.playState||"finished"===e.playState)return;if(this.time){const{motionValue:t,onUpdate:e,onComplete:a,element:l,...c}=this.options,h=new Hn({...c,keyframes:n,duration:s,type:i,ease:r,times:o,isGenerator:!0}),d=u(this.time);t.setWithVelocity(h.sample(d-10).value,h.sample(d).value,10)}const{onStop:a}=this.options;a&&a(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:e,name:n,repeatDelay:s,repeatType:i,damping:r,type:o}=t;return qn()&&n&&Un.has(n)&&e&&e.owner&&e.owner.current instanceof HTMLElement&&!e.owner.getProps().onUpdate&&!s&&"mirror"!==i&&0!==r&&"inertia"!==o}}const Zn={type:"spring",stiffness:500,damping:25,restSpeed:10},_n={type:"keyframes",duration:.8},Jn={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Qn=(t,{keyframes:e})=>e.length>2?_n:ht.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:Zn:Jn;const ts=(t,e,n,s={},i,r)=>o=>{const a=ut(s,t)||{},c=a.delay||s.delay||0;let{elapsed:h=0}=s;h-=u(c);let d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-h,onUpdate:t=>{e.set(t),a.onUpdate&&a.onUpdate(t)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:r?void 0:i};(function({when:t,delay:e,delayChildren:n,staggerChildren:s,staggerDirection:i,repeat:r,repeatType:o,repeatDelay:a,from:l,elapsed:u,...c}){return!!Object.keys(c).length})(a)||(d={...d,...Qn(t,d)}),d.duration&&(d.duration=u(d.duration)),d.repeatDelay&&(d.repeatDelay=u(d.repeatDelay)),void 0!==d.from&&(d.keyframes[0]=d.from);let p=!1;if((!1===d.type||0===d.duration&&!d.repeatDelay)&&(d.duration=0,0===d.delay&&(p=!0)),p&&!r&&void 0!==e.get()){const t=gn(d.keyframes,a);if(void 0!==t)return gt.update((()=>{d.onUpdate(t),d.onComplete()})),new l([])}return!r&&Gn.supports(d)?new Gn(d):new Hn(d)};function es({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,s}function ns(t,e,{delay:n=0,transitionOverride:s,type:i}={}){var r;let{transition:o=t.getDefaultTransition(),transitionEnd:a,...l}=e;s&&(o=s);const u=[],c=i&&t.animationState&&t.animationState.getState()[i];for(const e in l){const s=t.getValue(e,null!==(r=t.latestValues[e])&&void 0!==r?r:null),i=l[e];if(void 0===i||c&&es(c,e))continue;const a={delay:n,...ut(o||{},e)};let h=!1;if(window.MotionHandoffAnimation){const n=Rt(t);if(n){const t=window.MotionHandoffAnimation(n,e,gt);null!==t&&(a.startTime=t,h=!0)}}Ct(t,e),s.start(ts(e,s,i,t.shouldReduceMotion&&dt.has(e)?{type:!1}:a,t,h));const d=s.animation;d&&u.push(d)}return a&&Promise.all(u).then((()=>{gt.update((()=>{a&&Ft(t,a)}))})),u}const ss=()=>({x:{min:0,max:0},y:{min:0,max:0}}),is={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},rs={};for(const t in is)rs[t]={isEnabled:e=>is[t].some((t=>!!e[t]))};const os="undefined"!=typeof window,as={current:null},ls={current:!1};const us=[...cn,be,Fe];const cs=["initial","animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"];function hs(t){return null!==(e=t.animate)&&"object"==typeof e&&"function"==typeof e.start||cs.some((e=>function(t){return"string"==typeof t||Array.isArray(t)}(t[e])));var e}const ds=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class ps{scrapeMotionValuesFromProps(t,e,n){return{}}constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:s,blockInitialAnimation:i,visualState:r},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Qe,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const t=Tt.now();this.renderScheduledAtthis.bindToMotionValue(e,t))),ls.current||function(){if(ls.current=!0,os)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>as.current=t.matches;t.addListener(e),e()}else as.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||as.current),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){lt.delete(this.current),this.projection&&this.projection.unmount(),yt(this.notifyUpdate),yt(this.render),this.valueSubscriptions.forEach((t=>t())),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}bindToMotionValue(t,e){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const n=ht.has(t),s=e.on("change",(e=>{this.latestValues[t]=e,this.props.onUpdate&>.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0)})),i=e.on("renderRequest",this.scheduleRender);let r;window.MotionCheckAppearSync&&(r=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,(()=>{s(),i(),r&&r(),e.owner&&e.stop()}))}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}updateFeatures(){let t="animation";for(t in rs){const e=rs[t];if(!e)continue;const{isEnabled:n,Feature:s}=e;if(!this.features[t]&&s&&n(this.props)&&(this.features[t]=new s(this)),this.features[t]){const e=this.features[t];e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;ee.variantChildren.delete(t)}addValue(t,e){const n=this.values.get(t);e!==n&&(n&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e),this.latestValues[t]=e.get())}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return void 0===n&&void 0!==e&&(n=Vt(null===e?void 0:e,{owner:this}),this.addValue(t,n)),n}readValue(t,e){var n;let s=void 0===this.latestValues[t]&&this.current?null!==(n=this.getBaseTargetFromProps(this.props,t))&&void 0!==n?n:this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];var i;return null!=s&&("string"==typeof s&&(tn(s)||te(s))?s=parseFloat(s):(i=s,!us.find(un(i))&&Fe.test(e)&&(s=Ke(t,e))),this.setBaseTarget(t,Y(s)?s.get():s)),Y(s)?s.get():s}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){var e;const{initial:n}=this.props;let s;if("string"==typeof n||"object"==typeof n){const i=Pt(this.props,n,null===(e=this.presenceContext)||void 0===e?void 0:e.custom);i&&(s=i[t])}if(n&&void 0!==s)return s;const i=this.getBaseTargetFromProps(this.props,t);return void 0===i||Y(i)?void 0!==this.initialValues[t]&&void 0===s?void 0:this.baseTarget[t]:i}on(t,e){return this.events[t]||(this.events[t]=new St),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}}class fs extends ps{constructor(){super(...arguments),this.KeyframeResolver=dn}sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){return t.style?t.style[e]:void 0}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Y(t)&&(this.childSubscription=t.on("change",(t=>{this.current&&(this.current.textContent=`${t}`)})))}}const ms=(t,e)=>e&&"number"==typeof t?e.transform(t):t,gs={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},ys=ct.length;function vs(t,e,n){const{style:s,vars:i,transformOrigin:r}=t;let o=!1,a=!1;for(const t in e){const n=e[t];if(ht.has(t))o=!0;else if(nn(t))i[t]=n;else{const e=ms(n,Le[t]);t.startsWith("origin")?(a=!0,r[t]=e):s[t]=e}}if(e.transform||(o||n?s.transform=function(t,e,n){let s="",i=!0;for(let r=0;r{const l=it(t),{delay:c=0,times:h=U(l),type:d="keyframes",repeat:m,repeatType:g,repeatDelay:v=0,...w}=n;let{ease:b=e.ease||"easeOut",duration:x}=n;const T="function"==typeof c?c(i,a):c,S=l.length,A=N(d)?d:null==r?void 0:r[d];if(S<=2&&A){let t=100;if(2===S&&at(l)){const e=l[1]-l[0];t=Math.abs(e)}const e={...w};void 0!==x&&(e.duration=u(x));const n=W(e,t,A);b=n.ease,x=n.duration}null!=x||(x=o);const V=p+T;1===h.length&&0===h[0]&&(h[1]=1);const M=h.length-l.length;if(M>0&&H(h,M),1===l.length&&l.unshift(null),m){x=Z(x,m);const t=[...l],e=[...h];b=Array.isArray(b)?[...b]:[b];const n=[...b];for(let s=0;s{for(const r in t){const o=t[r];o.sort(et);const l=[],u=[],c=[];for(let t=0;t{s.push(...Rs(n,t,e))})),s}function Is(t){return function(e,n,s){let i=[];var r;r=e,i=Array.isArray(r)&&r.some(Array.isArray)?Bs(e,n,t):Rs(e,n,s,t);const o=new l(i);return t&&t.animations.push(o),o}}const Ds=Is();class Ls{constructor(t){this.animation=t}get duration(){var t,e,n;const s=(null===(e=null===(t=this.animation)||void 0===t?void 0:t.effect)||void 0===e?void 0:e.getComputedTiming().duration)||(null===(n=this.options)||void 0===n?void 0:n.duration)||300;return c(Number(s))}get time(){var t;return this.animation?c((null===(t=this.animation)||void 0===t?void 0:t.currentTime)||0):0}set time(t){this.animation&&(this.animation.currentTime=u(t))}get speed(){return this.animation?this.animation.playbackRate:1}set speed(t){this.animation&&(this.animation.playbackRate=t)}get state(){return this.animation?this.animation.playState:"finished"}get startTime(){return this.animation?this.animation.startTime:null}get finished(){return this.animation?this.animation.finished:Promise.resolve()}play(){this.animation&&this.animation.play()}pause(){this.animation&&this.animation.pause()}stop(){this.animation&&"idle"!==this.state&&"finished"!==this.state&&(this.animation.commitStyles&&this.animation.commitStyles(),this.cancel())}flatten(){var t;this.animation&&(null===(t=this.animation.effect)||void 0===t||t.updateTiming({easing:"linear"}))}attachTimeline(t){return this.animation&&Bt(this.animation,t),n}complete(){this.animation&&this.animation.finish()}cancel(){try{this.animation&&this.animation.cancel()}catch(t){}}}function Ws(t,e,n){t.style.setProperty(`--${e}`,n)}function Ns(t,e,n){t.style[e]=n}const Ks=r((()=>{try{document.createElement("div").animate({opacity:[1]})}catch(t){return!1}return!0})),$s=new WeakMap;const js="easeOut";function zs(t){const e=$s.get(t)||new Map;return $s.set(t,e),$s.get(t)}class Hs extends Ls{constructor(t,e,n,i){const r=e.startsWith("--");s("string"!=typeof i.type);const o=zs(t).get(e);o&&o.stop();if(Array.isArray(n)||(n=[n]),function(t,e,n){for(let s=0;se.startsWith("--")?t.style.getPropertyValue(e):window.getComputedStyle(t)[e])),N(i.type)){const t=W(i,100,i.type);i.ease=Wt()?t.ease:js,i.duration=u(t.duration),i.type="keyframes"}else i.ease=i.ease||js;const a=()=>{this.setValue(t,e,gn(n,i)),this.cancel(),this.resolveFinishedPromise()},l=()=>{this.setValue=r?Ws:Ns,this.options=i,this.updateFinishedPromise(),this.removeAnimation=()=>{var n;return null===(n=$s.get(t))||void 0===n?void 0:n.delete(e)}};qn()?(super(Yn(t,e,n,i)),l(),!1===i.autoplay&&this.animation.pause(),this.animation.onfinish=a,zs(t).set(e,this)):(super(),l(),a())}then(t,e){return this.currentFinishedPromise.then(t,e)}updateFinishedPromise(){this.currentFinishedPromise=new Promise((t=>{this.resolveFinishedPromise=t}))}play(){"finished"===this.state&&this.updateFinishedPromise(),super.play()}cancel(){this.removeAnimation(),super.cancel()}}const Us=t=>function(e,n,s){return new l(function(t,e,n,s){const i=q(t,s),r=i.length,o=[];for(let t=0;t{const{currentTime:s}=e,i=(null===s?0:s.value)/100;n!==i&&t(i),n=i};return gt.update(s,!0),()=>yt(s)}const Xs=new WeakMap;let Gs;function Zs({target:t,contentRect:e,borderBoxSize:n}){var s;null===(s=Xs.get(t))||void 0===s||s.forEach((s=>{s({target:t,contentSize:e,get size(){return function(t,e){if(e){const{inlineSize:t,blockSize:n}=e[0];return{width:t,height:n}}return t instanceof SVGElement&&"getBBox"in t?t.getBBox():{width:t.offsetWidth,height:t.offsetHeight}}(t,n)}})}))}function _s(t){t.forEach(Zs)}function Js(t,e){Gs||"undefined"!=typeof ResizeObserver&&(Gs=new ResizeObserver(_s));const n=q(t);return n.forEach((t=>{let n=Xs.get(t);n||(n=new Set,Xs.set(t,n)),n.add(e),null==Gs||Gs.observe(t)})),()=>{n.forEach((t=>{const n=Xs.get(t);null==n||n.delete(e),(null==n?void 0:n.size)||null==Gs||Gs.unobserve(t)}))}}const Qs=new Set;let ti;function ei(t){return Qs.add(t),ti||(ti=()=>{const t={width:window.innerWidth,height:window.innerHeight},e={target:window,size:t,contentSize:t};Qs.forEach((t=>t(e)))},window.addEventListener("resize",ti)),()=>{Qs.delete(t),!Qs.size&&ti&&(ti=void 0)}}const ni={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}};function si(t,e,n,s){const r=n[e],{length:o,position:a}=ni[e],l=r.current,u=n.time;r.current=t[`scroll${a}`],r.scrollLength=t[`scroll${o}`]-t[`client${o}`],r.offset.length=0,r.offset[0]=0,r.offset[1]=r.scrollLength,r.progress=i(0,r.scrollLength,r.current);const c=s-u;r.velocity=c>50?0:m(r.current-l,c)}const ii={start:0,center:.5,end:1};function ri(t,e,n=0){let s=0;if(t in ii&&(t=ii[t]),"string"==typeof t){const e=parseFloat(t);t.endsWith("px")?s=e:t.endsWith("%")?t=e/100:t.endsWith("vw")?s=e/100*document.documentElement.clientWidth:t.endsWith("vh")?s=e/100*document.documentElement.clientHeight:t=e}return"number"==typeof t&&(s=e*t),n+s}const oi=[0,0];function ai(t,e,n,s){let i=Array.isArray(t)?t:oi,r=0,o=0;return"number"==typeof t?i=[t,t]:"string"==typeof t&&(i=(t=t.trim()).includes(" ")?t.split(" "):[t,ii[t]?t:"0"]),r=ri(i[0],n,s),o=ri(i[1],e),r-o}const li={Enter:[[0,1],[1,1]],Exit:[[0,0],[1,0]],Any:[[1,0],[0,1]],All:[[0,0],[1,1]]},ui={x:0,y:0};function ci(t,e,n){const{offset:s=li.All}=n,{target:i=t,axis:r="y"}=n,o="y"===r?"height":"width",a=i!==t?function(t,e){const n={x:0,y:0};let s=t;for(;s&&s!==e;)if(s instanceof HTMLElement)n.x+=s.offsetLeft,n.y+=s.offsetTop,s=s.offsetParent;else if("svg"===s.tagName){const t=s.getBoundingClientRect();s=s.parentElement;const e=s.getBoundingClientRect();n.x+=t.left-e.left,n.y+=t.top-e.top}else{if(!(s instanceof SVGGraphicsElement))break;{const{x:t,y:e}=s.getBBox();n.x+=t,n.y+=e;let i=null,r=s.parentNode;for(;!i;)"svg"===r.tagName&&(i=r),r=s.parentNode;s=i}}return n}(i,t):ui,l=i===t?{width:t.scrollWidth,height:t.scrollHeight}:function(t){return"getBBox"in t&&"svg"!==t.tagName?t.getBBox():{width:t.clientWidth,height:t.clientHeight}}(i),u={width:t.clientWidth,height:t.clientHeight};e[r].offset.length=0;let c=!e[r].interpolate;const h=s.length;for(let t=0;tfunction(t,e=t,n){if(n.x.targetOffset=0,n.y.targetOffset=0,e!==t){let s=e;for(;s&&s!==t;)n.x.targetOffset+=s.offsetLeft,n.y.targetOffset+=s.offsetTop,s=s.offsetParent}n.x.targetLength=e===t?e.scrollWidth:e.clientWidth,n.y.targetLength=e===t?e.scrollHeight:e.clientHeight,n.x.containerLength=t.clientWidth,n.y.containerLength=t.clientHeight}(t,s.target,n),update:e=>{!function(t,e,n){si(t,"x",e,n),si(t,"y",e,n),e.time=n}(t,n,e),(s.offset||s.target)&&ci(t,n,s)},notify:()=>e(n)}}const di=new WeakMap,pi=new WeakMap,fi=new WeakMap,mi=t=>t===document.documentElement?window:t;function gi(t,{container:e=document.documentElement,...n}={}){let s=fi.get(e);s||(s=new Set,fi.set(e,s));const i=hi(e,t,{time:0,x:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0},y:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0}},n);if(s.add(i),!di.has(e)){const t=()=>{for(const t of s)t.measure()},n=()=>{for(const t of s)t.update(vt.timestamp)},i=()=>{for(const t of s)t.notify()},a=()=>{gt.read(t,!1,!0),gt.read(n,!1,!0),gt.update(i,!1,!0)};di.set(e,a);const l=mi(e);window.addEventListener("resize",a,{passive:!0}),e!==document.documentElement&&pi.set(e,(o=a,"function"==typeof(r=e)?ei(r):Js(r,o))),l.addEventListener("scroll",a,{passive:!0})}var r,o;const a=di.get(e);return gt.read(a,!1,!0),()=>{var t;yt(a);const n=fi.get(e);if(!n)return;if(n.delete(i),n.size)return;const s=di.get(e);di.delete(e),s&&(mi(e).removeEventListener("scroll",s),null===(t=pi.get(e))||void 0===t||t(),window.removeEventListener("resize",s))}}const yi=new Map;function vi({source:t,container:e=document.documentElement,axis:n="y"}={}){t&&(e=t),yi.has(e)||yi.set(e,{});const s=yi.get(e);return s[n]||(s[n]=o()?new ScrollTimeline({source:e,axis:n}):function({source:t,container:e,axis:n="y"}){t&&(e=t);const s={value:0},i=gi((t=>{s.value=100*t[n].progress}),{container:e,axis:n});return{currentTime:s,cancel:i}}({source:e,axis:n})),s[n]}function wi(t){return t&&(t.target||t.offset)}function bi(t,{axis:e="y",...s}={}){const i={axis:e,...s};return"function"==typeof t?function(t,e){return function(t){return 2===t.length}(t)||wi(e)?gi((n=>{t(n[e.axis].progress,n)}),e):qs(t,vi(e))}(t,i):function(t,e){if(t.flatten(),wi(e))return t.pause(),gi((n=>{t.time=t.duration*n[e.axis].progress}),e);{const s=vi(e);return t.attachTimeline?t.attachTimeline(s,(t=>(t.pause(),qs((e=>{t.time=t.duration*e}),s)))):n}}(t,i)}const xi={some:0,all:1};function Ti(t,e,{root:n,margin:s,amount:i="some"}={}){const r=q(t),o=new WeakMap,a=new IntersectionObserver((t=>{t.forEach((t=>{const n=o.get(t.target);if(t.isIntersecting!==Boolean(n))if(t.isIntersecting){const n=e(t);"function"==typeof n?o.set(t.target,n):a.unobserve(t.target)}else"function"==typeof n&&(n(t),o.delete(t.target))}))}),{root:n,rootMargin:s,threshold:"number"==typeof i?i:xi[i]});return r.forEach((t=>a.observe(t))),()=>a.disconnect()}function Si(t,e="end"){return n=>{const s=(n="end"===e?Math.min(n,.999):Math.max(n,.001))*t,i="end"===e?Math.floor(s):Math.ceil(s);return f(0,1,i/t)}}function Ai(t=.1,{startDelay:e=0,from:n=0,ease:s}={}){return(i,r)=>{const o="number"==typeof n?n:function(t,e){if("first"===t)return 0;{const n=e-1;return"last"===t?n:n/2}}(n,r),a=Math.abs(o-i);let l=t*a;if(s){const e=r*t;l=Wn(s)(l/e)*e}return e+l}}function Vi(t,e){return function(t,e){const n=Tt.now(),s=({timestamp:i})=>{const r=i-n;r>=e&&(yt(s),t(r-e))};return gt.read(s,!0),()=>yt(s)}(t,u(e))}const Mi=(t,e)=>Math.abs(t-e);function Pi(t,e){const n=Mi(t.x,e.x),s=Mi(t.y,e.y);return Math.sqrt(n**2+s**2)}function ki(...t){const e=!Array.isArray(t[0]),n=e?0:-1,s=t[0+n],i=t[1+n],r=t[2+n],o=t[3+n],a=Nn(i,r,{mixer:(l=r[0],(t=>t&&"object"==typeof t&&t.mix)(l)?l.mix:void 0),...o});var l;return e?a(s):a}const Fi=gt,Ci=mt.reduce(((t,e)=>(t[e]=t=>yt(t),t)),{});export{At as MotionValue,Ds as animate,Ys as animateMini,Zt as anticipate,Xt as backIn,Gt as backInOut,qt as backOut,yt as cancelFrame,Ci as cancelSync,_t as circIn,Qt as circInOut,Jt as circOut,f as clamp,Is as createScopedAnimate,Ht as cubicBezier,Vi as delay,Mi as distance,Pi as distance2D,Bn as easeIn,Dn as easeInOut,In as easeOut,gt as frame,vt as frameData,wt as frameSteps,Ti as inView,Rn as inertia,Nn as interpolate,s as invariant,e as isDragActive,Kn as keyframes,Ut as mirrorEasing,On as mix,Vt as motionValue,n as noop,Vn as pipe,i as progress,Yt as reverseEasing,bi as scroll,gi as scrollInfo,L as spring,Ai as stagger,Si as steps,Fi as sync,Tt as time,ki as transform,K as wrap};export default null; diff --git a/src/browser/base/zen-components/ZenCompactMode.mjs b/src/browser/base/zen-components/ZenCompactMode.mjs index 4f6ff01d4..00b4cd028 100644 --- a/src/browser/base/zen-components/ZenCompactMode.mjs +++ b/src/browser/base/zen-components/ZenCompactMode.mjs @@ -7,6 +7,13 @@ XPCOMUtils.defineLazyPreferenceGetter( 800 ); +XPCOMUtils.defineLazyPreferenceGetter( + lazyCompactMode, + 'COMPACT_MODE_FLASH_ENABLED', + 'zen.view.compact.toolbar-flash-popup', + true +); + var gZenCompactModeManager = { _flashTimeouts: {}, _evenListeners: [], @@ -50,6 +57,12 @@ var gZenCompactModeManager = { return this._sidebar; }, + flashSidebarIfNecessary(aInstant = false) { + if (!aInstant && this.prefefence && lazyCompactMode.COMPACT_MODE_FLASH_ENABLED && !gZenGlanceManager._animating) { + this.flashSidebar(); + } + }, + addContextMenu() { const fragment = window.MozXULElement.parseXULToFragment(` diff --git a/src/browser/base/zen-components/ZenGlanceManager.mjs b/src/browser/base/zen-components/ZenGlanceManager.mjs index 3a8d8d35a..224a242ab 100644 --- a/src/browser/base/zen-components/ZenGlanceManager.mjs +++ b/src/browser/base/zen-components/ZenGlanceManager.mjs @@ -3,7 +3,7 @@ #currentBrowser = null; #currentTab = null; - #animating = false; + _animating = false; init() { document.documentElement.setAttribute('zen-glance-uuid', gZenUIManager.generateUuidv4()); @@ -86,6 +86,8 @@ const currentTab = gBrowser.selectedTab; this.animatingOpen = true; + this._animating = true; + const browserElement = this.createBrowserElement(url, currentTab); this.overlay = browserElement.closest('.browserSidebarContainer'); @@ -100,25 +102,41 @@ window.requestAnimationFrame(() => { this.quickOpenGlance(); - this.browserWrapper.style.setProperty('--initial-x', `${initialX}px`); - this.browserWrapper.style.setProperty('--initial-y', `${initialY}px`); - this.browserWrapper.style.setProperty('--initial-width', initialWidth + 'px'); - this.browserWrapper.style.setProperty('--initial-height', initialHeight + 'px'); - this.overlay.removeAttribute('fade-out'); this.browserWrapper.setAttribute('animate', true); - this.#animating = true; - setTimeout(() => { - this.browserWrapper.setAttribute('animate-end', true); - this.browserWrapper.setAttribute('has-finished-animation', true); - this.#animating = false; - this.animatingOpen = false; - }, 500); + this.browserWrapper.style.top = `${initialY}px`; + this.browserWrapper.style.left = `${initialX}px`; + this.browserWrapper.style.width = `${initialWidth}px`; + this.browserWrapper.style.height = `${initialHeight}px`; + gZenUIManager.motion + .animate( + this.browserWrapper, + { + top: [`${initialY}px`, '50%'], + left: [`${initialX}px`, '50%'], + width: [`${initialWidth}px`, '85%'], + height: [`${initialHeight}px`, '100%'], + opacity: [0.8, 1], + }, + { + duration: 0.5, + ease: 'easeIn', + type: 'spring', + bounce: 0.25, + } + ) + .then(() => { + this.browserWrapper.removeAttribute('animate'); + this.browserWrapper.setAttribute('animate-end', true); + this.browserWrapper.setAttribute('has-finished-animation', true); + this._animating = false; + this.animatingOpen = false; + }); }); } closeGlance({ noAnimation = false, onTabClose = false } = {}) { - if (this.#animating || !this.#currentBrowser || this.animatingOpen || this._duringOpening) { + if (this._animating || !this.#currentBrowser || this.animatingOpen || this._duringOpening) { return; } @@ -130,6 +148,8 @@ return; } + this._animating = true; + gBrowser._insertTabAtIndex(this.#currentTab, { index: this.currentParentTab._tPos + 1, }); @@ -195,6 +215,8 @@ this.lastCurrentTab = null; this._duringOpening = false; + + this._animating = false; }, 400); }); }); @@ -281,6 +303,7 @@ this.animatingFullOpen = true; this.currentParentTab._visuallySelected = false; + this.browserWrapper.removeAttribute('style'); this.browserWrapper.removeAttribute('has-finished-animation'); this.browserWrapper.setAttribute('animate-full', true); this.#currentTab.removeAttribute('zen-glance-tab'); diff --git a/src/browser/base/zen-components/ZenGradientGenerator.mjs b/src/browser/base/zen-components/ZenGradientGenerator.mjs index 15b22e43b..24b1c53d0 100644 --- a/src/browser/base/zen-components/ZenGradientGenerator.mjs +++ b/src/browser/base/zen-components/ZenGradientGenerator.mjs @@ -658,7 +658,7 @@ setTimeout(() => { // Reactivate the transition after the animation appWrapper.removeAttribute('post-animating'); - }); + }, 100); }, 700); }); } diff --git a/src/browser/base/zen-components/ZenKeyboardShortcuts.mjs b/src/browser/base/zen-components/ZenKeyboardShortcuts.mjs index 2231912ed..d0400ec7d 100644 --- a/src/browser/base/zen-components/ZenKeyboardShortcuts.mjs +++ b/src/browser/base/zen-components/ZenKeyboardShortcuts.mjs @@ -995,11 +995,7 @@ var gZenKeyboardShortcutsManager = { return browser.gZenKeyboardShortcutsManager._zenKeyset; } - browser.gZenKeyboardShortcutsManager._zenKeyset = browser.document.createXULElement('keyset'); - browser.gZenKeyboardShortcutsManager._zenKeyset.id = ZEN_KEYSET_ID; - - const mainKeyset = browser.document.getElementById(ZEN_MAIN_KEYSET_ID); - mainKeyset.after(browser.gZenKeyboardShortcutsManager._zenKeyset); + throw new Error('Zen keyset not found'); } return browser.gZenKeyboardShortcutsManager._zenKeyset; }, diff --git a/src/browser/base/zen-components/ZenPinnedTabManager.mjs b/src/browser/base/zen-components/ZenPinnedTabManager.mjs index 3f25b098d..a4f4a467a 100644 --- a/src/browser/base/zen-components/ZenPinnedTabManager.mjs +++ b/src/browser/base/zen-components/ZenPinnedTabManager.mjs @@ -68,6 +68,13 @@ await this._refreshPinnedTabs(newWorkspace, { init: onInit }); } + onTabIconChanged(tab, url = null) { + const iconUrl = url ?? tab.iconImage.src; + if (tab.hasAttribute('zen-essential')) { + tab.querySelector('.tab-background').style.setProperty('--zen-tab-icon', `url(${iconUrl})`); + } + } + get enabled() { if (typeof this._enabled === 'undefined') { this._enabled = !( @@ -544,6 +551,7 @@ gBrowser.unpinTab(tab); } gBrowser.pinTab(tab); + this.onTabIconChanged(tab); } } diff --git a/src/browser/base/zen-components/ZenWorkspaces.mjs b/src/browser/base/zen-components/ZenWorkspaces.mjs index d7f6c8aca..c84c654d9 100644 --- a/src/browser/base/zen-components/ZenWorkspaces.mjs +++ b/src/browser/base/zen-components/ZenWorkspaces.mjs @@ -309,7 +309,8 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature { get workspaceEnabled() { if (typeof this._workspaceEnabled === 'undefined') { - this._workspaceEnabled = Services.prefs.getBoolPref('zen.workspaces.enabled', false) && this.shouldHaveWorkspaces; + this._workspaceEnabled = + !Services.prefs.getBoolPref('zen.workspaces.disabled_for_testing', false) && this.shouldHaveWorkspaces; return this._workspaceEnabled; } return this._workspaceEnabled; @@ -368,21 +369,7 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature { return this._workspaceCache; } - async onWorkspacesEnabledChanged() { - if (this.workspaceEnabled) { - throw Error("Shoud've had reloaded the window"); - } else { - this._workspaceCache = null; - document.getElementById('zen-workspaces-button')?.remove(); - for (let tab of gBrowser.tabs) { - gBrowser.showTab(tab); - } - } - } - async initializeWorkspaces() { - Services.prefs.addObserver('zen.workspaces.enabled', this.onWorkspacesEnabledChanged.bind(this)); - await this.initializeWorkspacesButton(); if (this.workspaceEnabled) { this._initializeWorkspaceCreationIcons(); @@ -404,7 +391,7 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature { activeWorkspace = workspaces.workspaces[0]; this.activeWorkspace = activeWorkspace?.uuid; } - await this.changeWorkspace(activeWorkspace, true); + await this.changeWorkspace(activeWorkspace, { onInit: true }); } try { if (activeWorkspace) { @@ -428,6 +415,10 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature { indicator.addEventListener('click', th); } + shouldCloseWindow() { + return !window.toolbar.visible || Services.prefs.getBoolPref('browser.tabs.closeWindowWithLastTab'); + } + handleTabBeforeClose(tab) { if (!this.workspaceEnabled || this.__contextIsDelete) { return null; @@ -438,17 +429,33 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature { return null; } - const shouldOpenNewTabIfLastUnpinnedTabIsClosed = this.shouldOpenNewTabIfLastUnpinnedTabIsClosed; - - let tabs = gBrowser.tabs.filter( - (t) => - t.getAttribute('zen-workspace-id') === workspaceID && - (!shouldOpenNewTabIfLastUnpinnedTabIsClosed || !t.pinned || t.getAttribute('pending') !== 'true') - ); + let tabs = gBrowser.visibleTabs; + let tabsPinned = tabs.filter((t) => !this.shouldOpenNewTabIfLastUnpinnedTabIsClosed || !t.pinned); + const shouldCloseWindow = this.shouldCloseWindow(); if (tabs.length === 1 && tabs[0] === tab) { - let newTab = this._createNewTabForWorkspace({ uuid: workspaceID }); - return newTab; + if (shouldCloseWindow) { + // We've already called beforeunload on all the relevant tabs if we get here, + // so avoid calling it again: + window.skipNextCanClose = true; + + // Closing the tab and replacing it with a blank one is notably slower + // than closing the window right away. If the caller opts in, take + // the fast path. + if (!gBrowser._removingTabs.size) { + // This call actually closes the window, unless the user + // cancels the operation. We are finished here in both cases. + this._isClosingWindow = true; + // Inside a setTimeout to avoid reentrancy issues. + setTimeout(() => { + document.getElementById('cmd_closeWindow').doCommand(); + }, 100); + return this._createNewTabForWorkspace({ uuid: workspaceID }); + } + return null; + } + } else if (tabsPinned.length === 1 && tabsPinned[0] === tab) { + return this._createNewTabForWorkspace({ uuid: workspaceID }); } return null; @@ -463,10 +470,6 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature { return tab; } - _kIcons = JSON.parse(Services.prefs.getStringPref('zen.workspaces.icons')).map((icon) => - typeof Intl.Segmenter !== 'undefined' ? new Intl.Segmenter().segment(icon).containing().segment : Array.from(icon)[0] - ); - searchIcons(input, icons) { input = input.toLowerCase(); @@ -543,7 +546,8 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature { let container = document.getElementById('PanelUI-zen-workspaces-icon-picker-wrapper'); let searchInput = document.getElementById('PanelUI-zen-workspaces-icon-search-input'); searchInput.value = ''; - for (let icon of this._kIcons) { + for (let iconData of this.emojis) { + const icon = iconData[0]; let button = document.createXULElement('toolbarbutton'); button.className = 'toolbarbutton-1 workspace-icon-button'; button.setAttribute('label', icon); @@ -621,7 +625,7 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature { let parentPanel = document.getElementById('PanelUI-zen-workspaces-multiview'); // randomly select an icon - let icon = this._kIcons[Math.floor(Math.random() * this._kIcons.length)]; + let icon = this.emojis[Math.floor(Math.random() * (this.emojis.length - 257))][0]; this._workspaceCreateInput.textContent = ''; this._workspaceCreateInput.value = ''; this._workspaceCreateInput.setAttribute('data-initial-value', ''); @@ -1263,7 +1267,7 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature { this._changeListeners.push(func); } - async changeWorkspace(window, onInit = false) { + async changeWorkspace(window, ...args) { if (!this.workspaceEnabled || this._inChangingWorkspace) { return; } @@ -1271,13 +1275,14 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature { await SessionStore.promiseInitialized; this._inChangingWorkspace = true; try { - await this._performWorkspaceChange(window, onInit); + await this._performWorkspaceChange(window, ...args); } finally { this._inChangingWorkspace = false; + this.tabContainer.removeAttribute('dont-animate-tabs'); } } - async _performWorkspaceChange(window, onInit) { + async _performWorkspaceChange(window, { onInit = false, explicitAnimationDirection = undefined } = {}) { const previousWorkspace = await this.getActiveWorkspace(); this.activeWorkspace = window.uuid; @@ -1287,6 +1292,21 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature { // Refresh tab cache this.tabContainer._invalidateCachedTabs(); + let animationDirection; + if (previousWorkspace && !onInit && !this._animatingChange) { + animationDirection = + explicitAnimationDirection ?? + (workspaces.workspaces.findIndex((w) => w.uuid === previousWorkspace.uuid) < + workspaces.workspaces.findIndex((w) => w.uuid === window.uuid) + ? 'right' + : 'left'); + } + if (animationDirection) { + // Animate tabs out of view before changing workspace, therefor we + // need to animate in the opposite direction + await this._animateTabs(animationDirection === 'left' ? 'right' : 'left', true); + } + // First pass: Handle tab visibility and workspace ID assignment const visibleTabs = this._processTabVisibility(window.uuid, containerId, workspaces); @@ -1296,22 +1316,47 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature { // Update UI and state await this._updateWorkspaceState(window, onInit); - // Animate acordingly - if (previousWorkspace && !this._animatingChange) { - // we want to know if we are moving forward or backward in sense of animation - let isNextWorkspace = - onInit || - workspaces.workspaces.findIndex((w) => w.uuid === previousWorkspace.uuid) < - workspaces.workspaces.findIndex((w) => w.uuid === window.uuid); - gBrowser.tabContainer.setAttribute('zen-workspace-animation', isNextWorkspace ? 'next' : 'previous'); - this._animatingChange = true; - setTimeout(() => { - this._animatingChange = false; - gBrowser.tabContainer.removeAttribute('zen-workspace-animation'); - }, 500); + if (animationDirection) { + await this._animateTabs(animationDirection); } } + _animateElement(element, direction, out = false, callback) { + if (out) { + element.animate([{ transform: 'translateX(0)' }, { transform: `translateX(${direction === 'left' ? '-' : ''}100%)` }], { + duration: 100, + easing: 'ease', + fill: 'both', + }).onfinish = callback; + return; + } + element.animate([{ transform: `translateX(${direction === 'left' ? '-' : ''}100%)` }, { transform: 'translateX(0)' }], { + duration: 100, + easing: 'ease', + fill: 'both', + }).onfinish = callback; + } + + async _animateTabs(direction, out = false) { + const tabs = gBrowser.visibleTabs.filter((tab) => !tab.hasAttribute('zen-essential')); + return new Promise((resolve) => { + let count = 0; + const onAnimationEnd = () => { + count++; + // +1 for the workspace indicator tab + if (count >= tabs.length + 1) { + resolve(); + } + }; + this.tabContainer.removeAttribute('dont-animate-tabs'); + // Also animate the workspace indicator label + this._animateElement(document.getElementById('zen-current-workspace-indicator'), direction, out, () => onAnimationEnd()); + for (const tab of tabs) { + this._animateElement(tab, direction, out, () => onAnimationEnd()); + } + }); + } + _processTabVisibility(workspaceUuid, containerId, workspaces) { const visibleTabs = new Set(); const lastSelectedTab = this._lastSelectedWorkspaceTabs[workspaceUuid]; @@ -1339,9 +1384,6 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature { gBrowser.hideTab(tab, undefined, true); } } - window.requestAnimationFrame(() => { - this.tabContainer.removeAttribute('dont-animate-tabs'); - }); return visibleTabs; } @@ -1541,7 +1583,7 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature { } async onLocationChange(browser) { - if (!this.workspaceEnabled || this._inChangingWorkspace) { + if (!this.workspaceEnabled || this._inChangingWorkspace || this._isClosingWindow) { return; } @@ -1680,7 +1722,7 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature { } let nextWorkspace = workspaces.workspaces[targetIndex]; - await this.changeWorkspace(nextWorkspace); + await this.changeWorkspace(nextWorkspace, { explicitAnimationDirection: offset > 0 ? 'right' : 'left' }); } _initializeWorkspaceTabContextMenus() { diff --git a/src/browser/components/preferences/zen-settings.js b/src/browser/components/preferences/zen-settings.js index 45f2493ff..214bffc03 100644 --- a/src/browser/components/preferences/zen-settings.js +++ b/src/browser/components/preferences/zen-settings.js @@ -167,7 +167,7 @@ var gZenMarketplaceManager = { const browser = ZenMultiWindowFeature.currentBrowser; const themeList = document.createElement('div'); - for (const theme of Object.values(themes)) { + for (const theme of Object.values(themes).sort((a, b) => a.name.localeCompare(b.name))) { const sanitizedName = `theme-${theme.name?.replaceAll(/\s/g, '-')?.replaceAll(/[^A-z_-]+/g, '')}`; const isThemeEnabled = theme.enabled === undefined || theme.enabled; @@ -672,29 +672,15 @@ var gZenWorkspacesSettings = { } }, }; - Services.prefs.addObserver('zen.workspaces.enabled', this); Services.prefs.addObserver('zen.tab-unloader.enabled', tabsUnloaderPrefListener); Services.prefs.addObserver('zen.glance.enabled', tabsUnloaderPrefListener); // We can use the same listener for both prefs Services.prefs.addObserver('zen.glance.activation-method', tabsUnloaderPrefListener); window.addEventListener('unload', () => { - Services.prefs.removeObserver('zen.workspaces.enabled', this); Services.prefs.removeObserver('zen.tab-unloader.enabled', tabsUnloaderPrefListener); Services.prefs.removeObserver('zen.glance.enabled', tabsUnloaderPrefListener); Services.prefs.removeObserver('zen.glance.activation-method', tabsUnloaderPrefListener); }); }, - - async observe(subject, topic, data) { - await this.onWorkspaceChange(Services.prefs.getBoolPref('zen.workspaces.enabled')); - }, - - async onWorkspaceChange(checked) { - let buttonIndex = await confirmRestartPrompt(true, 1, true, false); - if (buttonIndex == CONFIRM_RESTART_PROMPT_RESTART_NOW) { - Services.startup.quit(Ci.nsIAppStartup.eAttemptQuit | Ci.nsIAppStartup.eRestart); - return; - } - }, }; const ZEN_CKS_CLASS_BASE = 'zenCKSOption'; @@ -860,7 +846,7 @@ var gZenCKSSettings = { if (!target.nextElementSibling) { target.after( window.MozXULElement.parseXULToFragment(` - + `) ); target.value = 'Not set'; @@ -1007,11 +993,6 @@ Preferences.addAll([ type: 'bool', default: true, }, - { - id: 'zen.workspaces.enabled', - type: 'bool', - default: true, - }, { id: 'zen.theme.pill-button', type: 'bool', diff --git a/src/browser/components/preferences/zenTabsManagement.inc.xhtml b/src/browser/components/preferences/zenTabsManagement.inc.xhtml index c04dd8a55..490ffef07 100644 --- a/src/browser/components/preferences/zenTabsManagement.inc.xhtml +++ b/src/browser/components/preferences/zenTabsManagement.inc.xhtml @@ -17,27 +17,21 @@ - - - - - - - - - + + + + + into the DOM if necessary. -@@ -2434,7 +2467,7 @@ +@@ -2434,7 +2468,7 @@ // hasSiblings=false on both the existing browser and the new browser. if (this.tabs.length == 2) { this.tabs[0].linkedBrowser.browsingContext.hasSiblings = true; @@ -97,7 +98,7 @@ index ce68c339f35416574b7bc7ebf8c93378f653242b..46d25e4381eaae71f3aec1025788684c } else { aTab.linkedBrowser.browsingContext.hasSiblings = this.tabs.length > 1; } -@@ -2666,6 +2699,12 @@ +@@ -2666,6 +2700,12 @@ ); } @@ -110,7 +111,7 @@ index ce68c339f35416574b7bc7ebf8c93378f653242b..46d25e4381eaae71f3aec1025788684c if (!UserInteraction.running("browser.tabs.opening", window)) { UserInteraction.start("browser.tabs.opening", "initting", window); } -@@ -2735,6 +2774,12 @@ +@@ -2735,6 +2775,12 @@ noInitialLabel, skipBackgroundNotify, }); @@ -123,7 +124,7 @@ index ce68c339f35416574b7bc7ebf8c93378f653242b..46d25e4381eaae71f3aec1025788684c if (insertTab) { // insert the tab into the tab container in the correct position this._insertTabAtIndex(t, { -@@ -2878,6 +2923,13 @@ +@@ -2878,6 +2924,13 @@ } } @@ -137,7 +138,7 @@ index ce68c339f35416574b7bc7ebf8c93378f653242b..46d25e4381eaae71f3aec1025788684c // Additionally send pinned tab events if (pinned) { this._notifyPinnedStatus(t); -@@ -3389,6 +3441,23 @@ +@@ -3389,6 +3442,23 @@ ) { tabWasReused = true; tab = this.selectedTab; @@ -161,7 +162,7 @@ index ce68c339f35416574b7bc7ebf8c93378f653242b..46d25e4381eaae71f3aec1025788684c if (!tabData.pinned) { this.unpinTab(tab); } else { -@@ -3402,6 +3471,9 @@ +@@ -3402,6 +3472,9 @@ restoreTabsLazily && !select && !tabData.pinned; let url = "about:blank"; @@ -171,7 +172,7 @@ index ce68c339f35416574b7bc7ebf8c93378f653242b..46d25e4381eaae71f3aec1025788684c if (tabData.entries?.length) { let activeIndex = (tabData.index || tabData.entries.length) - 1; // Ensure the index is in bounds. -@@ -3438,6 +3510,21 @@ +@@ -3438,6 +3511,21 @@ preferredRemoteType, }); @@ -193,7 +194,7 @@ index ce68c339f35416574b7bc7ebf8c93378f653242b..46d25e4381eaae71f3aec1025788684c if (select) { tabToSelect = tab; } -@@ -3491,7 +3578,6 @@ +@@ -3491,7 +3579,6 @@ this.tabContainer._invalidateCachedTabs(); } } @@ -201,7 +202,7 @@ index ce68c339f35416574b7bc7ebf8c93378f653242b..46d25e4381eaae71f3aec1025788684c tab.initialize(); } -@@ -4070,6 +4156,10 @@ +@@ -4070,6 +4157,10 @@ return; } @@ -212,7 +213,7 @@ index ce68c339f35416574b7bc7ebf8c93378f653242b..46d25e4381eaae71f3aec1025788684c this.removeTabs(selectedTabs); } -@@ -4389,6 +4479,13 @@ +@@ -4389,6 +4480,13 @@ TelemetryStopwatch.start("FX_TAB_CLOSE_TIME_NO_ANIM_MS", aTab); } @@ -226,7 +227,7 @@ index ce68c339f35416574b7bc7ebf8c93378f653242b..46d25e4381eaae71f3aec1025788684c // Handle requests for synchronously removing an already // asynchronously closing tab. if (!animate && aTab.closing) { -@@ -4404,6 +4501,10 @@ +@@ -4404,6 +4502,10 @@ // state). let tabWidth = window.windowUtils.getBoundsWithoutFlushing(aTab).width; @@ -237,7 +238,7 @@ index ce68c339f35416574b7bc7ebf8c93378f653242b..46d25e4381eaae71f3aec1025788684c if ( !this._beginRemoveTab(aTab, { closeWindowFastpath: true, -@@ -4556,7 +4657,7 @@ +@@ -4556,14 +4658,14 @@ !!this.tabsInCollapsedTabGroups.length; if ( aTab.visible && @@ -246,7 +247,15 @@ index ce68c339f35416574b7bc7ebf8c93378f653242b..46d25e4381eaae71f3aec1025788684c !anyRemainingTabsInCollapsedTabGroups ) { closeWindow = -@@ -5411,10 +5512,10 @@ + closeWindowWithLastTab != null + ? closeWindowWithLastTab + : !window.toolbar.visible || +- Services.prefs.getBoolPref("browser.tabs.closeWindowWithLastTab"); ++ Services.prefs.getBoolPref("browser.tabs.closeWindowWithLastTab") && !ZenWorkspaces._isClosingWindow; + + if (closeWindow) { + // We've already called beforeunload on all the relevant tabs if we get here, +@@ -5411,10 +5513,10 @@ SessionStore.deleteCustomTabValue(aTab, "hiddenBy"); } @@ -259,7 +268,7 @@ index ce68c339f35416574b7bc7ebf8c93378f653242b..46d25e4381eaae71f3aec1025788684c aTab.selected || aTab.closing || // Tabs that are sharing the screen, microphone or camera cannot be hidden. -@@ -7384,6 +7485,7 @@ +@@ -7384,6 +7486,7 @@ aWebProgress.isTopLevel ) { this.mTab.setAttribute("busy", "true"); @@ -267,7 +276,7 @@ index ce68c339f35416574b7bc7ebf8c93378f653242b..46d25e4381eaae71f3aec1025788684c gBrowser._tabAttrModified(this.mTab, ["busy"]); this.mTab._notselectedsinceload = !this.mTab.selected; gBrowser.syncThrobberAnimations(this.mTab); -@@ -8344,7 +8446,7 @@ var TabContextMenu = { +@@ -8344,7 +8447,7 @@ var TabContextMenu = { ); contextUnpinSelectedTabs.hidden = !this.contextTab.pinned || !multiselectionContext; @@ -276,7 +285,7 @@ index ce68c339f35416574b7bc7ebf8c93378f653242b..46d25e4381eaae71f3aec1025788684c // Move Tab items let contextMoveTabOptions = document.getElementById( "context_moveTabOptions" -@@ -8378,7 +8480,7 @@ var TabContextMenu = { +@@ -8378,7 +8481,7 @@ var TabContextMenu = { let contextMoveTabToStart = document.getElementById("context_moveToStart"); let isFirstTab = tabsToMove[0] == visibleTabs[0] || @@ -285,7 +294,7 @@ index ce68c339f35416574b7bc7ebf8c93378f653242b..46d25e4381eaae71f3aec1025788684c contextMoveTabToStart.disabled = isFirstTab && allSelectedTabsAdjacent; document.getElementById("context_openTabInWindow").disabled = -@@ -8607,6 +8709,7 @@ var TabContextMenu = { +@@ -8607,6 +8710,7 @@ var TabContextMenu = { if (this.contextTab.multiselected) { gBrowser.removeMultiSelectedTabs(); } else { diff --git a/src/browser/components/tabbrowser/content/tabs-js.patch b/src/browser/components/tabbrowser/content/tabs-js.patch index d7b754e4a..c33b0871b 100644 --- a/src/browser/components/tabbrowser/content/tabs-js.patch +++ b/src/browser/components/tabbrowser/content/tabs-js.patch @@ -1,5 +1,5 @@ diff --git a/browser/components/tabbrowser/content/tabs.js b/browser/components/tabbrowser/content/tabs.js -index f7c39fe804182e2bdf53045ba3b6a5ba17079fc3..8b594d9d13b60c51c6f9306e28178e75b5f49782 100644 +index f7c39fe804182e2bdf53045ba3b6a5ba17079fc3..f578fe9da3c502289c6a3e3a0ba17de6e747e80f 100644 --- a/browser/components/tabbrowser/content/tabs.js +++ b/browser/components/tabbrowser/content/tabs.js @@ -649,7 +649,7 @@ @@ -85,23 +85,15 @@ index f7c39fe804182e2bdf53045ba3b6a5ba17079fc3..8b594d9d13b60c51c6f9306e28178e75 if (tab && rect(tab).width <= this._tabClipWidth) { this.setAttribute("closebuttons", "activetab"); } else { -@@ -1790,10 +1792,12 @@ +@@ -1794,6 +1796,7 @@ + this.arrowScrollbox.ensureElementIsVisible(selectedTab, aInstant); + } - _handleTabSelect(aInstant) { - let selectedTab = this.selectedItem; -- if (this.overflowing) { -- this.arrowScrollbox.ensureElementIsVisible(selectedTab, aInstant); -- } -+ this.arrowScrollbox.ensureElementIsVisible(selectedTab, aInstant); - -+ if (!aInstant && Services.prefs.getBoolPref('zen.view.compact') -+ && Services.prefs.getBoolPref('zen.view.compact.toolbar-flash-popup')) { -+ gZenCompactModeManager.flashSidebar(); -+ } ++ gZenCompactModeManager.flashSidebarIfNecessary(aInstant); selectedTab._notselectedsinceload = false; } -@@ -1841,7 +1845,7 @@ +@@ -1841,7 +1844,7 @@ if (isEndTab && !this._hasTabTempMaxWidth) { return; } @@ -110,7 +102,7 @@ index f7c39fe804182e2bdf53045ba3b6a5ba17079fc3..8b594d9d13b60c51c6f9306e28178e75 // Force tabs to stay the same width, unless we're closing the last tab, // which case we need to let them expand just enough so that the overall // tabbar width is the same. -@@ -1856,7 +1860,7 @@ +@@ -1856,7 +1859,7 @@ let tabsToReset = []; for (let i = numPinned; i < tabs.length; i++) { let tab = tabs[i]; @@ -119,7 +111,7 @@ index f7c39fe804182e2bdf53045ba3b6a5ba17079fc3..8b594d9d13b60c51c6f9306e28178e75 if (!isEndTab) { // keep tabs the same width tab.style.transition = "none"; -@@ -1922,13 +1926,13 @@ +@@ -1922,13 +1925,13 @@ let verticalTabsContainer = document.getElementById( "vertical-pinned-tabs-container" ); @@ -135,7 +127,7 @@ index f7c39fe804182e2bdf53045ba3b6a5ba17079fc3..8b594d9d13b60c51c6f9306e28178e75 } } -@@ -1952,7 +1956,7 @@ +@@ -1952,7 +1955,7 @@ _positionPinnedTabs() { let tabs = this.visibleTabs; @@ -144,7 +136,7 @@ index f7c39fe804182e2bdf53045ba3b6a5ba17079fc3..8b594d9d13b60c51c6f9306e28178e75 let absPositionHorizontalTabs = this.overflowing && tabs.length > numPinned && numPinned > 0; -@@ -2033,7 +2037,7 @@ +@@ -2033,7 +2036,7 @@ return; } @@ -153,7 +145,7 @@ index f7c39fe804182e2bdf53045ba3b6a5ba17079fc3..8b594d9d13b60c51c6f9306e28178e75 let directionX = screenX > dragData.animLastScreenX; let directionY = screenY > dragData.animLastScreenY; -@@ -2221,9 +2225,9 @@ +@@ -2221,9 +2224,9 @@ } let pinned = draggedTab.pinned; @@ -165,7 +157,7 @@ index f7c39fe804182e2bdf53045ba3b6a5ba17079fc3..8b594d9d13b60c51c6f9306e28178e75 pinned ? numPinned : undefined ); -@@ -2456,8 +2460,8 @@ +@@ -2456,8 +2459,8 @@ ); } @@ -176,7 +168,7 @@ index f7c39fe804182e2bdf53045ba3b6a5ba17079fc3..8b594d9d13b60c51c6f9306e28178e75 return; } -@@ -2622,9 +2626,9 @@ +@@ -2622,9 +2625,9 @@ function newIndex(aTab, index) { // Don't allow mixing pinned and unpinned tabs. if (aTab.pinned) { @@ -188,7 +180,7 @@ index f7c39fe804182e2bdf53045ba3b6a5ba17079fc3..8b594d9d13b60c51c6f9306e28178e75 } } -@@ -2726,12 +2730,14 @@ +@@ -2726,12 +2729,14 @@ selectedTab = { left: selectedTab.left, right: selectedTab.right, @@ -204,7 +196,7 @@ index f7c39fe804182e2bdf53045ba3b6a5ba17079fc3..8b594d9d13b60c51c6f9306e28178e75 selectedTab, ]; }) -@@ -2748,8 +2754,11 @@ +@@ -2748,8 +2753,11 @@ delete this._lastTabToScrollIntoView; // Is the new tab already completely visible? if ( @@ -218,7 +210,7 @@ index f7c39fe804182e2bdf53045ba3b6a5ba17079fc3..8b594d9d13b60c51c6f9306e28178e75 ) { return; } -@@ -2757,21 +2766,29 @@ +@@ -2757,21 +2765,29 @@ if (this.arrowScrollbox.smoothScroll) { // Can we make both the new tab and the selected tab completely visible? if ( @@ -227,7 +219,7 @@ index f7c39fe804182e2bdf53045ba3b6a5ba17079fc3..8b594d9d13b60c51c6f9306e28178e75 - tabRect.right - selectedRect.left, - selectedRect.right - tabRect.left - ) <= scrollRect.width -+ !selectedRect || this.verticalMode ++ !selectedRect || (this.verticalMode + ? Math.max( + tabRect.bottom - selectedRect.top, + selectedRect.bottom - tabRect.top @@ -235,7 +227,7 @@ index f7c39fe804182e2bdf53045ba3b6a5ba17079fc3..8b594d9d13b60c51c6f9306e28178e75 + : Math.max( + tabRect.right - selectedRect.left, + selectedRect.right - tabRect.left -+ ) <= scrollRect.width ++ ) <= scrollRect.width) ) { this.arrowScrollbox.ensureElementIsVisible(tabToScrollIntoView); return; diff --git a/src/browser/components/urlbar/UrlbarInput-sys-mjs.patch b/src/browser/components/urlbar/UrlbarInput-sys-mjs.patch index 699763ba2..5cefe55f6 100644 --- a/src/browser/components/urlbar/UrlbarInput-sys-mjs.patch +++ b/src/browser/components/urlbar/UrlbarInput-sys-mjs.patch @@ -1,5 +1,5 @@ diff --git a/browser/components/urlbar/UrlbarInput.sys.mjs b/browser/components/urlbar/UrlbarInput.sys.mjs -index 3ab07e5864b3bb200608e7f619645f92ade129fe..12fe08c48d5ca9f00253e0aa6ebbc867ff471c83 100644 +index 3ab07e5864b3bb200608e7f619645f92ade129fe..31085d82271b0259cd69ec9691ea5f33fe29e19e 100644 --- a/browser/components/urlbar/UrlbarInput.sys.mjs +++ b/browser/components/urlbar/UrlbarInput.sys.mjs @@ -67,6 +67,13 @@ XPCOMUtils.defineLazyPreferenceGetter( @@ -16,21 +16,19 @@ index 3ab07e5864b3bb200608e7f619645f92ade129fe..12fe08c48d5ca9f00253e0aa6ebbc867 const DEFAULT_FORM_HISTORY_NAME = "searchbar-history"; const SEARCH_BUTTON_CLASS = "urlbar-search-button"; -@@ -2152,6 +2159,13 @@ export class UrlbarInput { +@@ -2152,6 +2159,11 @@ export class UrlbarInput { this.setAttribute("breakout-extend", "true"); + if (lazy.ZEN_URLBAR_BEHAVIOR == 'float' || (lazy.ZEN_URLBAR_BEHAVIOR == 'floating-on-type' && !this.focusedViaMousedown)) { + this.setAttribute("zen-floating-urlbar", "true"); -+ this.classList.add("zen-floating-urlbar"); + } else { + this.removeAttribute("zen-floating-urlbar"); -+ this.classList.remove("zen-floating-urlbar"); + } // Enable the animation only after the first extend call to ensure it // doesn't run when opening a new window. if (!this.hasAttribute("breakout-extend-animate")) { -@@ -3875,6 +3889,11 @@ export class UrlbarInput { +@@ -3875,6 +3887,11 @@ export class UrlbarInput { } _on_click(event) { @@ -42,7 +40,7 @@ index 3ab07e5864b3bb200608e7f619645f92ade129fe..12fe08c48d5ca9f00253e0aa6ebbc867 if ( event.target == this.inputField || event.target == this._inputContainer || -@@ -3986,9 +4005,12 @@ export class UrlbarInput { +@@ -3986,9 +4003,12 @@ export class UrlbarInput { } _on_mousedown(event) { @@ -56,7 +54,7 @@ index 3ab07e5864b3bb200608e7f619645f92ade129fe..12fe08c48d5ca9f00253e0aa6ebbc867 if ( event.target != this.inputField && -@@ -3998,8 +4020,8 @@ export class UrlbarInput { +@@ -3998,8 +4018,8 @@ export class UrlbarInput { break; } diff --git a/src/browser/themes/shared/zen-icons/icons.css b/src/browser/themes/shared/zen-icons/icons.css index 230089869..bcd1f08a5 100644 --- a/src/browser/themes/shared/zen-icons/icons.css +++ b/src/browser/themes/shared/zen-icons/icons.css @@ -1117,6 +1117,15 @@ menuitem[id='placesContext_new:separator'] { menupopup > menuitem:is([type='checkbox']) .menu-iconic-left { --menu-image: none !important; margin-inline-start: 4px; - margin-inline-end: 0; - padding-inline-end: 0; + + @media not (-moz-platform: windows) { + margin-inline-end: 0; + padding-inline-end: 0; + } +} + +@media (-moz-platform: windows) { + menupopup > menuitem[checked='true'] { + padding-inline-start: 6px; + } } diff --git a/src/build/pgo/profileserver-py.patch b/src/build/pgo/profileserver-py.patch new file mode 100644 index 000000000..cf162035a --- /dev/null +++ b/src/build/pgo/profileserver-py.patch @@ -0,0 +1,19 @@ +diff --git a/build/pgo/profileserver.py b/build/pgo/profileserver.py +index 31556cc9ae1a44a04e300083f7be4dc908cc3794..23ef1d8f5b30068ffdddc3c9cb6cd45e64d93071 100755 +--- a/build/pgo/profileserver.py ++++ b/build/pgo/profileserver.py +@@ -18,7 +18,13 @@ from mozprofile import FirefoxProfile, Preferences + from mozprofile.permissions import ServerLocations + from mozrunner import CLI, FirefoxRunner + +-PORT = 8888 ++import socket ++def find_free_port(): ++ with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s: ++ s.bind(('', 0)) ++ return s.getsockname()[1] ++ ++PORT = find_free_port() + + PATH_MAPPINGS = { + "/webkit/PerformanceTests": "third_party/webkit/PerformanceTests", diff --git a/src/old-configure-in.patch b/src/old-configure-in.patch new file mode 100644 index 000000000..ef93907c4 --- /dev/null +++ b/src/old-configure-in.patch @@ -0,0 +1,13 @@ +diff --git a/old-configure.in b/old-configure.in +index 036734708f20d658248a8b5b3a6d8adc2530a878..4e1f0d96cd355cc1195b58548b29c1a5d6bedaa8 100644 +--- a/old-configure.in ++++ b/old-configure.in +@@ -89,7 +89,7 @@ dnl Mac bundle identifier (based on MOZ_APP_DISPLAYNAME) + if test -z "$MOZ_MACBUNDLE_ID"; then + MOZ_MACBUNDLE_ID=`echo $MOZ_APP_DISPLAYNAME | tr 'A-Z' 'a-z' | tr -dc 'a-z-'` + fi +-MOZ_MACBUNDLE_ID=${MOZ_DISTRIBUTION_ID}.${MOZ_MACBUNDLE_ID} ++MOZ_MACBUNDLE_ID=app.zen-browser.zen + if test "$MOZ_DEBUG"; then + MOZ_MACBUNDLE_ID=${MOZ_MACBUNDLE_ID}debug + fi diff --git a/src/testing/profiles/profileserver/user-js.patch b/src/testing/profiles/profileserver/user-js.patch index 3967e6da4..d18ac8ea3 100644 --- a/src/testing/profiles/profileserver/user-js.patch +++ b/src/testing/profiles/profileserver/user-js.patch @@ -9,7 +9,7 @@ index 19ff7d474f6d22d2d386764e2e6942ce6a324470..40d1906bdebd08510014fd6124be1705 + +// zen: +// Disable some of zen's features to better match the default Firefox experience -+user_pref("zen.workspaces.enabled", false); ++user_pref("zen.workspaces.disabled_for_testing", true); +user_pref("zen.welcome-screen.enabled", false); +user_pref("zen.tab-unloader.enabled", false); +user_pref("zen.watermark.enabled", false); diff --git a/src/toolkit/moz-configure.patch b/src/toolkit/moz-configure.patch index f3cd4394e..d6f8ff73e 100644 --- a/src/toolkit/moz-configure.patch +++ b/src/toolkit/moz-configure.patch @@ -1,5 +1,5 @@ diff --git a/toolkit/moz.configure b/toolkit/moz.configure -index 9c3bb513537f1efc44788fc3efb9f7561eca9c0e..dcada8742c5ea147d2378357c86c9a8b7dc639db 100644 +index 9c3bb513537f1efc44788fc3efb9f7561eca9c0e..b1dd5bd9c28c95c69486b9803c76279af01459bd 100644 --- a/toolkit/moz.configure +++ b/toolkit/moz.configure @@ -81,10 +81,13 @@ option( @@ -39,3 +39,14 @@ index 9c3bb513537f1efc44788fc3efb9f7561eca9c0e..dcada8742c5ea147d2378357c86c9a8b option( +@@ -3535,8 +3538,8 @@ with only_when(compile_environment): + @depends(target) + def default_user_appdir(target): + if target.kernel in ("WINNT", "Darwin"): +- return "Mozilla" +- return ".mozilla" ++ return "Zen" ++ return ".zen" + + option( + "--with-user-appdir", diff --git a/src/toolkit/themes/shared/in-content/common-shared-css.patch b/src/toolkit/themes/shared/in-content/common-shared-css.patch index 671d51a86..0b2bba3c6 100644 --- a/src/toolkit/themes/shared/in-content/common-shared-css.patch +++ b/src/toolkit/themes/shared/in-content/common-shared-css.patch @@ -1,5 +1,5 @@ diff --git a/toolkit/themes/shared/in-content/common-shared.css b/toolkit/themes/shared/in-content/common-shared.css -index 646a11b699a0b34204cd766836678bfc17e8548e..3fc584bc42d7c3acbd7cb2d86d7fa013c1f2406d 100644 +index 38e13e0436ee3a2d722f2fc6e11ecafd122fb4eb..c0f985f7e0e74f7050ef91fb9d460d4880d389e4 100644 --- a/toolkit/themes/shared/in-content/common-shared.css +++ b/toolkit/themes/shared/in-content/common-shared.css @@ -5,6 +5,8 @@ @@ -11,7 +11,7 @@ index 646a11b699a0b34204cd766836678bfc17e8548e..3fc584bc42d7c3acbd7cb2d86d7fa013 @namespace html "http://www.w3.org/1999/xhtml"; @namespace xul "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"; -@@ -54,7 +56,7 @@ +@@ -53,7 +55,7 @@ --in-content-table-border-color: var(--in-content-box-border-color); --in-content-table-header-background: var(--in-content-primary-button-background); --in-content-table-header-color: var(--in-content-primary-button-text-color); @@ -20,7 +20,7 @@ index 646a11b699a0b34204cd766836678bfc17e8548e..3fc584bc42d7c3acbd7cb2d86d7fa013 --dialog-warning-text-color: var(--red-60); -@@ -740,7 +742,6 @@ html|*#categories { +@@ -737,7 +739,6 @@ html|*#categories { color: inherit; margin-inline-start: 34px; padding-inline: 10px; @@ -28,7 +28,15 @@ index 646a11b699a0b34204cd766836678bfc17e8548e..3fc584bc42d7c3acbd7cb2d86d7fa013 } html|*#categories > html|*.category { -@@ -777,7 +778,8 @@ html|*#categories > html|*.category:dir(rtl) { +@@ -767,14 +768,15 @@ html|*#categories > html|*.category:dir(rtl) { + + #categories > .category:hover:active { + background-color: var(--in-content-button-background-active); +- color: var(--in-content-button-text-color-active); ++ color: var(--in-content-button-text-color-active) !important; + border-color: var(--in-content-button-border-color-active); + } + @media not (forced-colors) { #categories > .category[selected], #categories > .category.selected { @@ -38,7 +46,7 @@ index 646a11b699a0b34204cd766836678bfc17e8548e..3fc584bc42d7c3acbd7cb2d86d7fa013 } #categories > .category[selected]:not(:hover) { -@@ -839,7 +841,7 @@ html|*#categories[last-input-type="mouse"] > html|button.category:focus-visible +@@ -836,7 +838,7 @@ html|*#categories[last-input-type="mouse"] > html|button.category:focus-visible fill-opacity: 1; } @@ -47,7 +55,7 @@ index 646a11b699a0b34204cd766836678bfc17e8548e..3fc584bc42d7c3acbd7cb2d86d7fa013 :root { --in-content-sidebar-width: 118px; } -@@ -1219,7 +1221,7 @@ xul|*.sidebar-footer-link { +@@ -1216,7 +1218,7 @@ xul|*.sidebar-footer-link { user-select: none; } diff --git a/surfer.json b/surfer.json index 2b08484fc..634e05290 100644 --- a/surfer.json +++ b/surfer.json @@ -5,7 +5,7 @@ "binaryName": "zen", "version": { "product": "firefox", - "version": "133.0.3", + "version": "134.0", "candidate": "134.0" }, "buildOptions": { @@ -39,7 +39,7 @@ "brandShortName": "Zen", "brandFullName": "Zen Twilight", "release": { - "displayVersion": "1.6t", + "displayVersion": "1.7t", "github": { "repo": "zen-browser/desktop" }