Compare commits

...
24 Commits
Author SHA1 Message Date
Kevin Yue ee675b059b feat: update dependencies for Windows and Unix targets, including reqwest and openssl 2025-12-14 00:08:23 +08:00
Kevin Yue 0669447aed Merge branch 'dev' into gpauth_windows 2025-12-13 23:56:16 +08:00
Kevin Yue d797c4f40e feat: add HIP report generation functionality and related dependencies 2025-12-13 23:39:51 +08:00
Kevin Yue f398ccadb7 Release 2.5.0 2025-12-08 22:41:42 +08:00
Kevin Yue 740c79af9b chore: update dependencies 2025-12-08 22:10:15 +08:00
Kevin Yue d0096c6cb2 feat: update application name and description to reflect GP Connect branding 2025-12-08 21:46:02 +08:00
Kevin Yue e4701c1bd8 feat: add support for client version emulation and integrate OpenConnect submodule 2025-12-08 21:46:02 +08:00
Kevin Yue a08ae655cf feat: support the --script-tun option 2025-12-02 19:54:09 +08:00
Olivier Louvignes a917e16e62 Add support for macOS builds (apple silicon) (#557) 2025-12-01 22:43:00 +08:00
Kevin Yue 8ed3304e61 Update flake.nix 2025-11-13 11:03:13 +08:00
Kevin Yue c40fd051e5 Release 2.4.7 2025-11-13 00:14:07 +08:00
Kevin Yue 09cd8ecb18 feat: upgrade Rust version to 1.85 2025-11-13 00:13:53 +08:00
Kevin Yue a4e1743691 feat: add NixOS support with flake configuration and package setup 2025-11-12 23:35:44 +08:00
Kevin Yue 801a339525 feat: update browser argument in Cli and ConnectArgs to include default value and argument count 2025-11-12 23:35:44 +08:00
Kevin Yue 49a7cbfe99 feat: add auth_executable parameter to SamlAuthLauncher and update launch logic 2025-11-12 23:35:44 +08:00
Kevin Yue 603975bfe0 feat: add hip parameter to ConnectArgs and VpnBuilder, update connection logic 2025-11-12 23:35:44 +08:00
Kevin Yue 49fe7447ff feat: add VpnEnv struct and update WsEvent to include VPN environment details 2025-11-12 23:35:43 +08:00
Kevin Yue 7048248268 feat: integrate common crate and add constants for user agent and lock files 2025-11-12 23:35:43 +08:00
Kevin Yue cad5ca3d68 fix: add vpnc script location 2025-11-12 23:35:43 +08:00
Kevin Yue 9e9ab6fb7d fix: update @mui/icons-material and @mui/material dependencies to version 7.3.4 2025-11-12 23:35:42 +08:00
Fred Eisele 8e55698271 Update the README.md to describe building with devcontainers (#521) 2025-11-04 22:27:25 +08:00
Kevin Yue 47338b21a8 fix: remove conditional check for PPA input in publish job 2025-10-15 23:41:42 +08:00
Kevin Yue 4c307e05f5 fix: update Docker volume paths in build steps 2025-10-15 23:38:08 +08:00
Kevin Yue 3175d1083a feat: gpauth support Windows 2025-02-02 18:43:28 +08:00
92 changed files with 3604 additions and 1727 deletions

No files matched your search

+1 -1
View File
@@ -7,7 +7,7 @@ ARG USER_GID=$USER_UID
ENV RUSTUP_HOME=/usr/local/rustup \
CARGO_HOME=/usr/local/cargo \
PATH=/usr/local/cargo/bin:$PATH \
RUST_VERSION=1.82.0
RUST_VERSION=1.85.0
# Install common dependencies
RUN set -eux; \
+4
View File
@@ -1,5 +1,6 @@
name: Build
on:
workflow_dispatch:
push:
paths-ignore:
- LICENSE
@@ -53,6 +54,7 @@ jobs:
repository: yuezk/GlobalProtect-openconnect
ref: ${{ github.ref }}
path: source/gp
submodules: recursive
- name: Create tarball
run: |
@@ -193,6 +195,7 @@ jobs:
repository: yuezk/GlobalProtect-openconnect
ref: ${{ github.ref }}
path: gpgui-source/gp
submodules: recursive
- name: Checkout gpgui@${{ github.ref_name }}
uses: actions/checkout@v4
with:
@@ -248,6 +251,7 @@ jobs:
repository: yuezk/GlobalProtect-openconnect
ref: ${{ github.ref }}
path: gh-release/gp
submodules: recursive
- name: Download all artifacts
uses: actions/download-artifact@v4
+1 -2
View File
@@ -19,7 +19,7 @@ on:
description: 'Rust version to use'
type: "string"
required: true
default: "1.82"
default: "1.85"
jobs:
check:
runs-on: ubuntu-latest
@@ -38,7 +38,6 @@ jobs:
publish-ppa:
needs: check
if: ${{ inputs.ppa }}
runs-on: ubuntu-latest
steps:
- uses: pnpm/action-setup@v4
+2 -2
View File
@@ -111,7 +111,7 @@ jobs:
- name: Build ${{ matrix.package }} package in Docker
run: |
docker run --pull=always --rm \
-v $(pwd)/build-${{ matrix.package }}:/${{ matrix.package }} \
-v $(pwd)/build-${{ matrix.package }}:/workspace \
-e COREPACK_INTEGRITY_KEYS=0 \
-e INCLUDE_GUI=1 \
yuezk/gpdev:${{ matrix.package }}-builder-tauri2
@@ -120,7 +120,7 @@ jobs:
run: |
docker run --pull=always --rm \
-e COREPACK_INTEGRITY_KEYS=0 \
-v $(pwd)/build-${{ matrix.package }}:/${{ matrix.package }} \
-v $(pwd)/build-${{ matrix.package }}:/workspace \
yuezk/gpdev:${{ matrix.package }}-builder-tauri2 \
bash install.sh
+3
View File
@@ -11,3 +11,6 @@ SNAPSHOT
# Tauri generated files
gen
# Nix files
result
+3
View File
@@ -0,0 +1,3 @@
[submodule "deps/openconnect"]
path = deps/openconnect
url = https://gitlab.com/openconnect/openconnect.git
+1 -1
View File
@@ -2,7 +2,7 @@
"configurations": [
{
"name": "Mac",
"includePath": ["/opt/homebrew/include"],
"includePath": ["deps/openconnect"],
"macFrameworkPath": ["/System/Library/Frameworks", "/Library/Frameworks"],
"intelliSenseMode": "macos-clang-x64",
"compilerPath": "/usr/bin/clang",
Generated
+691 -368
View File
File diff suppressed because it is too large. Load diff
+10 -4
View File
@@ -10,16 +10,18 @@ members = [
]
[workspace.package]
rust-version = "1.82"
version = "2.4.6"
rust-version = "1.85"
version = "2.5.0"
authors = ["Kevin Yue <[email protected]>"]
homepage = "https://github.com/yuezk/GlobalProtect-openconnect"
edition = "2021"
edition = "2024"
license = "GPL-3.0"
[workspace.dependencies]
anyhow = "1.0"
askama = "0.14"
base64 = "0.22"
chrono = "0.4"
clap = { version = "4", features = ["derive"] }
clap-verbosity-flag = "3"
ctrlc = "3.4"
@@ -32,9 +34,10 @@ regex = "1"
reqwest = { version = "0.12", features = ["native-tls", "json"] }
openssl = "0.10"
pem = "3"
roxmltree = "0.21"
xmltree = "0.12"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
# Use 0.36 as newer versions requires Rust 1.88+
sysinfo = "0.36"
tempfile = "3.8"
tokio = { version = "1" }
@@ -53,6 +56,9 @@ serde_urlencoded = "0.7"
md5 = "0.8"
sha256 = "1"
which = "8"
uuid = "1"
netdev = "0.39"
machine-uid = "0.5"
# Tauri dependencies
tauri = { version = "2" }
+8 -4
View File
@@ -6,7 +6,7 @@ INCLUDE_GUI ?= 0
CARGO ?= cargo
DISABLE_RUST_TOOLCHAIN ?= 0
VERSION = $(shell $(CARGO) metadata --no-deps --format-version 1 | jq -r '.packages[0].version')
VERSION = $(shell grep '^version' Cargo.toml | head -1 | sed 's/version *= *"\(.*\)"/\1/')
REVISION ?= 1
RPM_SOURCE ?= %{name}.tar.gz
@@ -109,10 +109,9 @@ build-rs:
# Only build the GUI components if BUILD_GUI is set to 1
if [ $(BUILD_GUI) -eq 1 ]; then \
$(CARGO) build $(CARGO_BUILD_ARGS) -p gpclient -p gpservice -p gpauth; \
$(CARGO) build $(CARGO_BUILD_ARGS) -p gpgui-helper --features "tauri/custom-protocol"; \
$(CARGO) build $(CARGO_BUILD_ARGS) -p gpclient -p gpservice -p gpauth -p gpgui-helper; \
else \
$(CARGO) build $(CARGO_BUILD_ARGS) -p gpclient -p gpservice -p gpauth --no-default-features; \
$(CARGO) build $(CARGO_BUILD_ARGS) -p gpclient -p gpservice -p gpauth; \
fi
clean:
@@ -137,6 +136,9 @@ install:
install -Dm755 .build/gpgui/gpgui_*/gpgui $(DESTDIR)/usr/bin/gpgui; \
fi
# Install the HIP report script
install -Dm755 packaging/files/usr/libexec/gpclient/hipreport.sh $(DESTDIR)/usr/libexec/gpclient/hipreport.sh
# Install the disconnect hooks
install -Dm755 packaging/files/usr/lib/NetworkManager/dispatcher.d/pre-down.d/gpclient.down $(DESTDIR)/usr/lib/NetworkManager/dispatcher.d/pre-down.d/gpclient.down
install -Dm755 packaging/files/usr/lib/NetworkManager/dispatcher.d/gpclient-nm-hook $(DESTDIR)/usr/lib/NetworkManager/dispatcher.d/gpclient-nm-hook
@@ -157,6 +159,8 @@ uninstall:
rm -f $(DESTDIR)/usr/bin/gpgui-helper
rm -f $(DESTDIR)/usr/bin/gpgui
rm -f $(DESTDIR)/usr/libexec/gpclient/hipreport.sh
rm -f $(DESTDIR)/usr/lib/NetworkManager/dispatcher.d/pre-down.d/gpclient.down
rm -f $(DESTDIR)/usr/lib/NetworkManager/dispatcher.d/gpclient-nm-hook
+106 -6
View File
@@ -144,6 +144,45 @@ sudo emerge -r guru sync
sudo emerge -av net-vpn/GlobalProtect-openconnect
```
### NixOS
This repo includes a flake for NixOS. You can add the following to your `flake.nix`:
```nix
{
inputs = {
# ... other inputs
globalprotect-openconnect.url = "github:yuezk/GlobalProtect-openconnect";
};
outputs = { nixpkgs, ... }@inputs: {
nixosConfigurations.<your-host> = nixpkgs.lib.nixosSystem {
specialArgs = { inherit inputs; };
modules = [
./configuration.nix
];
};
};
}
```
Then add `globalprotect-openconnect` to your `environment.systemPackages` in `configuration.nix`:
```nix
{ config, pkgs, inputs, ... }:
{
# ... other configurations
environment.systemPackages = with pkgs; [
# ... other packages
] ++ [
inputs.globalprotect-openconnect.packages.${pkgs.system}.default
];
}
```
Finally, run `sudo nixos-rebuild switch` to apply the changes.
### Other distributions
- Install `openconnect >= 8.20`, `webkit2gtk`, `libsecret`, `libayatana-appindicator` or `libappindicator-gtk3`.
@@ -153,23 +192,84 @@ sudo emerge -av net-vpn/GlobalProtect-openconnect
## Build from source
You can also build the client from source, steps are as follows:
You can build the client from source using either a devcontainer (recommended) or a local setup.
### Prerequisites
### Option 1: Using DevContainer (Recommended)
- [Install Rust 1.82 or later](https://www.rust-lang.org/tools/install)
This project includes a devcontainer configuration that provides a consistent build environment with all dependencies pre-installed.
#### Prerequisites
- [Docker](https://docs.docker.com/get-docker/)
- [VS Code](https://code.visualstudio.com/) with [Dev Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) (optional, for IDE support)
#### Build Steps
1. Clone the repository and submodules:
```bash
git clone https://github.com/yuezk/GlobalProtect-openconnect.git
cd GlobalProtect-openconnect
git submodule update --init --recursive
```
2. Build the devcontainer image:
```bash
docker build -t gpoc-devcontainer .devcontainer/
```
3. Build the project:
```bash
docker run --privileged --cap-add=NET_ADMIN --device=/dev/net/tun \
-v "$(pwd)":/workspace -w /workspace gpoc-devcontainer \
bash -c "export PATH=/usr/local/cargo/bin:\$PATH && make build"
```
4. The built binaries will be available in `target/release/`:
- `gpclient` - CLI client
- `gpservice` - Background service
- `gpauth` - Authentication helper
- `gpgui-helper` - GUI helper
#### Alternative: VS Code DevContainer
1. Open the project in VS Code
2. When prompted, click "Reopen in Container" or run the command "Dev Containers: Reopen in Container"
3. Once the container is built and running, open a terminal in VS Code and run:
```bash
make build
```
### Option 2: Local Build
#### Prerequisites
- [Install Rust 1.85 or later](https://www.rust-lang.org/tools/install)
- Install Tauri dependencies: https://tauri.app/start/prerequisites/
- Install `perl` and `jq`
- Install `perl`
- Install `openconnect >= 8.20` and `libopenconnect-dev` (or `openconnect-devel` on RPM-based distributions)
- Install `pkexec`, `gnome-keyring` (or `pam_kwallet` on KDE)
- Install `nodejs` and `pnpm` (optional only if you downloaded the source tarball from the release page and run with the `BUILD_FE=0` flag, see below)
### Build
#### Build Steps
1. Download the source code tarball from [releases](https://github.com/yuezk/GlobalProtect-openconnect/releases) page. Choose `globalprotect-openconnect-${version}.tar.gz`.
2. Extract the tarball with `tar -xzf globalprotect-openconnect-${version}.tar.gz`.
3. Enter the source directory and run `make build BUILD_FE=0` to build the client.
3. Run `sudo make install` to install the client. (Note, `DESTDIR` is not supported)
4. Run `sudo make install` to install the client. (Note, `DESTDIR` is not supported)
### Testing the Build
After building, you can test the CLI client:
```bash
./target/release/gpclient --help
```
### Build Options
- `BUILD_GUI=0` - Disable GUI components (CLI only)
- `BUILD_FE=0` - Skip frontend build (use pre-built assets)
- `OFFLINE=1` - Build in offline mode using vendored dependencies
## FAQ
+3 -1
View File
@@ -10,6 +10,7 @@ license.workspace = true
tauri-build = { version = "2", features = [], optional = true }
[dependencies]
common = { path = "../../crates/common" }
gpapi = { path = "../../crates/gpapi", features = ["clap"] }
auth = { path = "../../crates/auth", features = ["browser-auth"] }
@@ -24,7 +25,8 @@ tokio.workspace = true
tempfile.workspace = true
compile-time.workspace = true
home = "0.5"
# Pin to specific version due to MSRV
home = "=0.5.11"
# webview auth dependencies
tauri = { workspace = true, optional = true }
+4 -2
View File
@@ -1,11 +1,11 @@
use auth::{auth_prelogin, BrowserAuthenticator};
use clap::Parser;
use common::constants::GP_USER_AGENT;
use gpapi::{
auth::{SamlAuthData, SamlAuthResult},
clap::{args::Os, handle_error, Args, InfoLevelVerbosity},
gp_params::{ClientOs, GpParams},
utils::{normalize_server, openssl},
GP_USER_AGENT,
};
use log::info;
use serde_json::json;
@@ -62,7 +62,9 @@ struct Cli {
#[arg(
long,
help = "The browser to use for authentication, e.g., `default`, `firefox`, `chrome`, `chromium`, or the path to the browser executable"
help = "The browser to use for authentication, e.g., `default`, `firefox`, `chrome`, `chromium`, or the path to the browser executable",
default_missing_value = "default",
num_args=0..=1
)]
browser: Option<String>,
+11 -1
View File
@@ -12,6 +12,8 @@ gpapi = { path = "../../crates/gpapi", features = ["clap"] }
openconnect = { path = "../../crates/openconnect" }
anyhow.workspace = true
askama.workspace = true
chrono.workspace = true
clap.workspace = true
env_logger.workspace = true
inquire = "0.9"
@@ -19,11 +21,19 @@ log.workspace = true
tokio = { workspace = true, features = ["rt-multi-thread"] }
sysinfo.workspace = true
serde_json.workspace = true
serde_urlencoded.workspace = true
whoami.workspace = true
tempfile.workspace = true
reqwest.workspace = true
directories.workspace = true
compile-time.workspace = true
netdev.workspace = true
xmltree.workspace = true
[target.'cfg(target_os="windows")'.dependencies]
reqwest = { workspace = true, features = ["native-tls-vendored", "json"] }
[target.'cfg(target_family="unix")'.dependencies]
reqwest.workspace = true
[features]
default = ["webview-auth"]
+6 -2
View File
@@ -3,7 +3,7 @@ use std::{env::temp_dir, fs::File, str::FromStr};
use anyhow::bail;
use clap::{Parser, Subcommand};
use gpapi::{
clap::{handle_error, Args, InfoLevelVerbosity},
clap::{Args, InfoLevelVerbosity, handle_error},
utils::openssl,
};
use log::info;
@@ -12,10 +12,11 @@ use tempfile::NamedTempFile;
use tokio::fs;
use crate::{
GP_CLIENT_LOCK_FILE,
connect::{ConnectArgs, ConnectHandler},
disconnect::{DisconnectArgs, DisconnectHandler},
hip::{HipArgs, HipHandler},
launch_gui::{LaunchGuiArgs, LaunchGuiHandler},
GP_CLIENT_LOCK_FILE,
};
const VERSION: &str = concat!(env!("CARGO_PKG_VERSION"), " (", compile_time::date_str!(), ")");
@@ -34,6 +35,8 @@ enum CliCommand {
Disconnect(DisconnectArgs),
#[command(about = "Launch the GUI")]
LaunchGui(LaunchGuiArgs),
#[command(about = "Generate HIP report")]
Hip(HipArgs),
}
#[derive(Parser)]
@@ -132,6 +135,7 @@ impl Cli {
CliCommand::Connect(args) => ConnectHandler::new(args, &shared_args).handle().await,
CliCommand::Disconnect(args) => DisconnectHandler::new(args).handle().await,
CliCommand::LaunchGui(args) => LaunchGuiHandler::new(args).handle().await,
CliCommand::Hip(args) => HipHandler::new(args).handle().await,
}
}
}
+57 -27
View File
@@ -2,27 +2,26 @@ use std::{cell::RefCell, fs, sync::Arc};
use anyhow::bail;
use clap::Args;
use common::vpn_utils::find_csd_wrapper;
use common::constants::GP_USER_AGENT;
use gpapi::{
auth::SamlAuthResult,
clap::{args::Os, ToVerboseArg},
clap::{ToVerboseArg, args::Os},
credential::{Credential, PasswordCredential},
error::PortalError,
gateway::{gateway_login, GatewayLogin},
gateway::{GatewayLogin, gateway_login},
gp_params::{ClientOs, GpParams},
portal::{prelogin, retrieve_config, Prelogin, StandardPrelogin},
portal::{Prelogin, StandardPrelogin, prelogin, retrieve_config},
process::{
auth_launcher::SamlAuthLauncher,
users::{get_non_root_user, get_user_by_name},
},
utils::{request::RequestIdentityError, shutdown_signal},
GP_USER_AGENT,
utils::{host_utils, request::RequestIdentityError, shutdown_signal},
};
use inquire::{Password, PasswordDisplayMode, Select, Text};
use log::{info, warn};
use openconnect::Vpn;
use crate::{cli::SharedArgs, GP_CLIENT_LOCK_FILE};
use crate::{GP_CLIENT_LOCK_FILE, cli::SharedArgs};
#[derive(Args)]
pub(crate) struct ConnectArgs {
@@ -41,12 +40,15 @@ pub(crate) struct ConnectArgs {
#[arg(long, help = "Read the cookie from standard input")]
cookie_on_stdin: bool,
#[arg(long, short, help = "The VPNC script to use")]
#[arg(long, short, help = "The VPNC script to use", required_if_eq("script_tun", "true"))]
script: Option<String>,
#[arg(long, short, help = "The IFNAME for tunnel interface")]
interface: Option<String>,
#[arg(long, short = 'S', help = "Pass traffic to '--script' program, not tun")]
script_tun: bool,
#[arg(long, help = "Connect the server as a gateway, instead of a portal")]
as_gateway: bool,
@@ -93,6 +95,9 @@ pub(crate) struct ConnectArgs {
#[arg(long, help = "If not specified, it will be computed based on the --os option")]
os_version: Option<String>,
#[arg(long, help = "The GP client version to emulate, e.g., '6.2.4-49'")]
client_version: Option<String>,
#[arg(long, help = "Disable DTLS and ESP")]
no_dtls: bool,
@@ -116,29 +121,38 @@ pub(crate) struct ConnectArgs {
#[arg(
long,
help = "Use the specified browser to authenticate, e.g., `default`, `firefox`, `chrome`, `chromium`, `remote`, or the path to the browser executable. Use 'remote' for headless servers."
help = "Use the specified browser to authenticate, e.g., `default`, `firefox`, `chrome`, `chromium`, `remote`.\nOr the path to the browser executable.\nUse 'remote' for headless servers.",
default_missing_value = "default",
num_args=0..=1
)]
browser: Option<String>,
}
impl ConnectArgs {
fn default_os() -> Os {
if cfg!(target_os = "macos") {
#[cfg(target_os = "macos")]
{
Os::Mac
} else {
}
#[cfg(target_os = "windows")]
{
Os::Windows
}
#[cfg(not(any(target_os = "macos", target_os = "windows")))]
{
Os::Linux
}
}
fn os_version(&self) -> String {
fn os_version(&self) -> &str {
if let Some(os_version) = self.os_version.as_deref() {
return os_version.to_string();
return os_version;
}
match self.os {
Os::Linux => format!("Linux {}", whoami::distro()),
Os::Windows => String::from("Microsoft Windows 11 Pro , 64-bit"),
Os::Mac => String::from("Apple Mac OS X 13.4.0"),
Os::Linux => host_utils::get_linux_os_string(),
Os::Windows => host_utils::get_windows_os_string(),
Os::Mac => host_utils::get_macos_os_string(),
}
}
}
@@ -164,7 +178,7 @@ impl<'a> ConnectHandler<'a> {
GpParams::builder()
.user_agent(&self.args.user_agent)
.client_os(ClientOs::from(&self.args.os))
.os_version(self.args.os_version())
.os_version(self.args.os_version().to_owned())
.ignore_tls_errors(self.shared_args.ignore_tls_errors)
.certificate(self.args.certificate.clone())
.sslkey(self.args.sslkey.clone())
@@ -276,7 +290,11 @@ impl<'a> ConnectHandler<'a> {
}
};
self.connect_gateway(gateway, &cookie).await
// Use the client version from the command line argument if specified, otherwise
// use the version from the portal config if available
let client_version = self.args.client_version.as_deref().or_else(|| portal_config.version());
self.connect_gateway(gateway, &cookie, client_version).await
}
async fn connect_gateway_with_prelogin(&self, gateway: &str) -> anyhow::Result<()> {
@@ -290,7 +308,10 @@ impl<'a> ConnectHandler<'a> {
let cookie = self.login_gateway(gateway, &cred, &gp_params).await?;
self.connect_gateway(gateway, &cookie).await
// When logging in to a gateway directly, there is no portal config to get the client version from
let client_version = self.args.client_version.as_deref();
self.connect_gateway(gateway, &cookie, client_version).await
}
async fn login_gateway(&self, gateway: &str, cred: &Credential, gp_params: &GpParams) -> anyhow::Result<String> {
@@ -310,26 +331,30 @@ impl<'a> ConnectHandler<'a> {
}
}
async fn connect_gateway(&self, gateway: &str, cookie: &str) -> anyhow::Result<()> {
async fn connect_gateway(&self, gateway: &str, cookie: &str, client_version: Option<&str>) -> anyhow::Result<()> {
let mtu = self.args.mtu.unwrap_or(0);
let csd_uid = get_csd_uid(&self.args.csd_user)?;
let csd_wrapper = if self.args.csd_wrapper.is_some() {
self.args.csd_wrapper.clone()
let (hip, csd_wrapper) = if let Some(csd_wrapper) = &self.args.csd_wrapper {
(true, Some(csd_wrapper.clone()))
} else if self.args.hip {
find_csd_wrapper()
(true, None)
} else {
None
(false, None)
};
let os = ClientOs::from(&self.args.os).to_openconnect_os().to_string();
let client_version = client_version.map(|s| s.to_owned());
let vpn = Vpn::builder(gateway, cookie)
.script(self.args.script.clone())
.interface(self.args.interface.clone())
.script_tun(self.args.script_tun)
.user_agent(self.args.user_agent.clone())
.os(Some(os))
.client_version(client_version)
.certificate(self.args.certificate.clone())
.sslkey(self.args.sslkey.clone())
.key_password(self.latest_key_password.borrow().clone())
.hip(hip)
.csd_uid(csd_uid)
.csd_wrapper(csd_wrapper)
.reconnect_timeout(self.args.reconnect_timeout)
@@ -371,7 +396,9 @@ impl<'a> ConnectHandler<'a> {
let browser = if prelogin.support_default_browser() {
self.args.browser.as_deref()
} else if !cfg!(feature = "webview-auth") {
bail!("The server does not support authentication via the default browser and the gpclient is not built with the `webview-auth` feature");
bail!(
"The server does not support authentication via the default browser and the gpclient is not built with the `webview-auth` feature"
);
} else {
None
};
@@ -463,8 +490,11 @@ fn read_cookie_from_stdin() -> anyhow::Result<Credential> {
fn write_pid_file() {
let pid = std::process::id();
fs::write(GP_CLIENT_LOCK_FILE, pid.to_string()).unwrap();
info!("Wrote PID {} to {}", pid, GP_CLIENT_LOCK_FILE);
if let Err(err) = fs::write(GP_CLIENT_LOCK_FILE, pid.to_string()) {
warn!("Failed to write PID file: {}", err);
} else {
info!("Wrote PID {} to {}", pid, GP_CLIENT_LOCK_FILE);
}
}
fn get_csd_uid(csd_user: &Option<String>) -> anyhow::Result<u32> {
+381
View File
@@ -0,0 +1,381 @@
use askama::Template;
use clap::Args;
use gpapi::utils::host_utils;
use log::debug;
use std::collections::HashMap;
use xmltree::Element;
#[derive(Template)]
#[template(path = "hip_report.xml")]
struct HipReportTemplate<'a> {
client_version: &'a str,
generate_time: String,
day: String,
month: String,
year: String,
md5: &'a str,
user_name: &'a str,
host_info: HostInfo,
}
/// Host information for HIP reporting
struct HostInfo {
/// Only for macOS and Windows
host_id: String,
/// Common for all OSes
host_name: String,
os: &'static str,
/// Only for macOS and Windows
os_version: &'static str,
os_vendor: &'static str,
domain: String,
network_interfaces: Vec<NetworkInterface>,
}
impl HostInfo {
/// Get the first available IPv4 address from network interfaces
pub fn default_ipv4(&self) -> &str {
self
.network_interfaces
.first()
.and_then(|iface| iface.ipv4.as_deref())
.unwrap_or_default()
}
/// Get the first available IPv6 address from network interfaces
pub fn default_ipv6(&self) -> &str {
self
.network_interfaces
.first()
.and_then(|iface| iface.ipv6.as_deref())
.unwrap_or_default()
}
}
/// Network interface information
#[derive(Clone)]
struct NetworkInterface {
name: String,
description: String,
mac_address: Option<String>,
ipv4: Option<String>,
ipv6: Option<String>,
}
impl NetworkInterface {
/// Create a new network interface with basic information
fn new(name: String, description: String) -> Self {
Self {
name,
description,
mac_address: None,
ipv4: None,
ipv6: None,
}
}
/// Set MAC address
fn with_mac(mut self, mac: Option<String>) -> Self {
self.mac_address = mac;
self
}
/// Set IPv4 address
fn with_ipv4(mut self, ipv4: Option<String>) -> Self {
self.ipv4 = ipv4;
self
}
/// Set IPv6 address
fn with_ipv6(mut self, ipv6: Option<String>) -> Self {
self.ipv6 = ipv6;
self
}
}
#[derive(Args)]
pub(crate) struct HipArgs {
#[arg(long, help = "The authentication cookie")]
cookie: String,
#[arg(long, help = "The client IPv4 address")]
client_ip: Option<String>,
#[arg(long, help = "The client IPv6 address")]
client_ipv6: Option<String>,
#[arg(long, help = "The MD5 digest to encode into the HIP report")]
md5: String,
#[arg(long, default_value = "Windows", help = "The client OS (Linux, Mac, or Windows)")]
client_os: String,
#[arg(long, default_value = "", help = "The client software version")]
client_version: String,
}
pub(crate) struct HipHandler<'a> {
args: &'a HipArgs,
}
impl<'a> HipHandler<'a> {
pub(crate) fn new(args: &'a HipArgs) -> Self {
Self { args }
}
pub(crate) async fn handle(&self) -> anyhow::Result<()> {
self.validate_args()?;
let cookie_params = self.parse_cookie();
let report = self.generate_hip_report(&cookie_params)?;
debug!("Generated HIP report:\n{}", report);
println!("{}", report);
Ok(())
}
/// Validate that at least one IP address is provided
fn validate_args(&self) -> anyhow::Result<()> {
if self.args.client_ip.is_none() && self.args.client_ipv6.is_none() {
anyhow::bail!("At least one of --client-ip or --client-ipv6 must be provided");
}
Ok(())
}
fn parse_cookie(&self) -> HashMap<String, String> {
// Parse URL-encoded cookie string using serde_urlencoded
serde_urlencoded::from_str(&self.args.cookie).unwrap_or_default()
}
/// Generate the complete HIP report XML
fn generate_hip_report(&self, cookie_params: &HashMap<String, String>) -> anyhow::Result<String> {
let (generate_time, day, month, year) = get_current_time_components();
let user_name = cookie_params.get("user").map(|s| s.as_str()).unwrap_or("");
let host_info = self.collect_host_info(cookie_params);
let client_version = std::env::var("APP_VERSION")
.map(|v| v.leak() as &'a str)
.unwrap_or(&self.args.client_version);
let template = HipReportTemplate {
client_version,
generate_time,
day,
month,
year,
md5: &self.args.md5,
user_name,
host_info,
};
let report = template.render()?;
format_xml(&report)
}
/// Collect host information based on the client OS
fn collect_host_info(&self, cookie_params: &HashMap<String, String>) -> HostInfo {
let collector = HostInfoCollector::new(self.args, cookie_params);
match self.args.client_os.as_str() {
"Linux" => collector.collect_linux(),
"Mac" => collector.collect_macos(),
_ => collector.collect_windows(),
}
}
}
// ============================================================================
// Host Information Collector
// ============================================================================
/// Helper struct for collecting host information
struct HostInfoCollector<'a> {
args: &'a HipArgs,
cookie_params: &'a HashMap<String, String>,
}
impl<'a> HostInfoCollector<'a> {
fn new(args: &'a HipArgs, cookie_params: &'a HashMap<String, String>) -> Self {
Self { args, cookie_params }
}
/// Get domain from cookie parameters
fn get_domain(&self) -> String {
self
.cookie_params
.get("domain")
.map(|s| s.to_string())
.unwrap_or_default()
}
/// Collect network interface information with fallback
fn collect_network_interface(&self) -> NetworkInterface {
match netdev::get_default_interface() {
Ok(iface) => NetworkInterface::new(
iface.name.clone(),
iface.description.unwrap_or_else(|| iface.name.clone()),
)
.with_mac(iface.mac_addr.map(|mac| mac.address()))
.with_ipv4(iface.ipv4.first().map(|ip| ip.addr().to_string()))
.with_ipv6(iface.ipv6.first().map(|ip| ip.addr().to_string())),
Err(_) => NetworkInterface::new("unknown".to_string(), "unknown".to_string())
.with_ipv4(self.args.client_ip.clone())
.with_ipv6(self.args.client_ipv6.clone()),
}
}
/// Collect Linux-specific host information
fn collect_linux(&self) -> HostInfo {
let iface = self.collect_network_interface();
// Use the fixed interface name enp1s0f0 for Linux if it is not on Linux
let iface = NetworkInterface {
#[cfg(target_os = "linux")]
name: iface.name,
#[cfg(target_os = "linux")]
description: iface.description,
#[cfg(not(target_os = "linux"))]
name: "enp1s0f0".to_string(),
#[cfg(not(target_os = "linux"))]
description: "enp1s0f0".to_string(),
mac_address: iface.mac_address,
ipv4: iface.ipv4,
ipv6: iface.ipv6,
};
HostInfo {
os_vendor: "Linux",
host_id: host_utils::derive_uuid(&[]),
os: host_utils::get_linux_os_string(),
host_name: whoami::devicename(),
os_version: "",
domain: String::new(),
network_interfaces: vec![iface],
}
}
/// Collect macOS-specific host information
fn collect_macos(&self) -> HostInfo {
let iface = self.collect_network_interface();
// macOS use the mac address as host ID
let host_id = iface
.mac_address
.as_ref()
.map(|s| s.to_string())
.unwrap_or_else(|| "00:00:00:00:00:00".to_string());
// Use the fixed interface name en0 for macOS if it is not on macOS
let iface = NetworkInterface {
#[cfg(target_os = "macos")]
name: iface.name,
#[cfg(target_os = "macos")]
description: iface.description,
#[cfg(not(target_os = "macos"))]
name: "en0".to_string(),
#[cfg(not(target_os = "macos"))]
description: "en0".to_string(),
mac_address: iface.mac_address,
ipv4: iface.ipv4,
ipv6: iface.ipv6,
};
HostInfo {
os_vendor: "Apple",
host_id,
os: host_utils::get_macos_os_string(),
host_name: whoami::devicename(),
os_version: host_utils::get_macos_version(),
domain: self.get_domain(),
network_interfaces: vec![iface],
}
}
/// Collect Windows-specific host information
fn collect_windows(&self) -> HostInfo {
// Use the actual machine ID on Windows
#[cfg(target_os = "windows")]
let host_id = host_utils::get_machine_id().to_string();
#[cfg(not(target_os = "windows"))]
let host_id = host_utils::derive_uuid(&[]);
let iface = self.collect_network_interface();
// Use the fixed interface name if it is not on Windows
let iface = NetworkInterface {
#[cfg(target_os = "windows")]
name: iface.name,
#[cfg(target_os = "windows")]
description: iface.description,
#[cfg(not(target_os = "windows"))]
name: derive_windows_network_name(&iface),
#[cfg(not(target_os = "windows"))]
description: "PANGP Virtual Ethernet Adapter Secure".to_string(),
// mac address on windows should replace ':' with '-'
mac_address: iface.mac_address.map(|mac| mac.replace(':', "-")),
ipv4: iface.ipv4,
ipv6: iface.ipv6,
};
// Add the local loopback interface
let loopback_iface = NetworkInterface {
name: derive_windows_network_name(&iface),
description: "Software Loopback Interface 1".to_string(),
mac_address: Some(String::new()),
ipv4: Some("127.0.0.1".to_string()),
ipv6: Some("::1".to_string()),
};
let ifaces = vec![iface, loopback_iface];
HostInfo {
os_vendor: "Microsoft",
host_id,
os: host_utils::get_windows_os_string(),
host_name: whoami::devicename(),
os_version: host_utils::get_windows_version(),
domain: self.get_domain(),
network_interfaces: ifaces,
}
}
}
// ============================================================================
// Utility Functions
// ============================================================================
/// Get current time components for HIP report
fn get_current_time_components() -> (String, String, String, String) {
let now = chrono::Local::now();
(
now.format("%m/%d/%Y %H:%M:%S").to_string(),
now.format("%d").to_string(),
now.format("%m").to_string(),
now.format("%Y").to_string(),
)
}
/// Format XML string with proper indentation
fn format_xml(xml_str: &str) -> anyhow::Result<String> {
let xml = Element::parse(xml_str.as_bytes())?;
let config = xmltree::EmitterConfig::new().perform_indent(true);
let mut xml_buf = Vec::new();
xml.write_with_config(&mut xml_buf, config)?;
Ok(String::from_utf8(xml_buf)?)
}
fn derive_windows_network_name(iface: &NetworkInterface) -> String {
let seeds = [
iface.mac_address.as_deref().unwrap_or("00:00:00:00:00:00"),
iface.name.as_str(),
];
format!("{{{}}}", host_utils::derive_uuid(&seeds).to_uppercase())
}
+1 -1
View File
@@ -1,11 +1,11 @@
use std::{collections::HashMap, env::temp_dir, fs, path::PathBuf};
use clap::Args;
use common::constants::GP_CALLBACK_PORT_FILENAME;
use directories::ProjectDirs;
use gpapi::{
process::service_launcher::ServiceLauncher,
utils::{endpoint::http_endpoint, env_utils, shutdown_signal},
GP_CALLBACK_PORT_FILENAME,
};
use log::info;
use tokio::io::AsyncWriteExt;
+1
View File
@@ -1,6 +1,7 @@
mod cli;
mod connect;
mod disconnect;
mod hip;
mod launch_gui;
pub(crate) const GP_CLIENT_LOCK_FILE: &str = "/var/run/gpclient.lock";
+277
View File
@@ -0,0 +1,277 @@
<?xml version="1.0" encoding="UTF-8"?>
<hip-report name="hip-report">
<md5-sum>{{ md5 }}</md5-sum>
<user-name>{{ user_name }}</user-name>
<domain>{{ host_info.domain }}.internal</domain>
<host-name>{{ host_info.host_name }}</host-name>
<host-id>{{ host_info.host_id }}</host-id>
<ip-address>{{ host_info.default_ipv4() }}</ip-address>
<ipv6-address>{{ host_info.default_ipv6() }}</ipv6-address>
<generate-time>{{ generate_time }}</generate-time>
<hip-report-version>4</hip-report-version>
<categories>
<entry name="host-info">
<client-version>{{ client_version }}</client-version>
<os>{{ host_info.os }}</os>
<os-vendor>{{ host_info.os_vendor }}</os-vendor>
<domain>{{ host_info.domain }}.internal</domain>
<host-name>{{ host_info.host_name }}</host-name>
<host-id>{{ host_info.host_id }}</host-id>
<network-interface>
{% for iface in host_info.network_interfaces.iter() -%}
<entry name="{{ iface.name }}">
<description>{{ iface.description }}</description>
{% if let Some(mac) = iface.mac_address -%}
<mac-address>{{ mac }}</mac-address>
{% endif -%}
{% if let Some(ipv4) = iface.ipv4 -%}
<ip-address>
<entry name="{{ ipv4 }}"/>
</ip-address>
{% endif -%}
{% if let Some(ipv6) = iface.ipv6 -%}
<ipv6-address>
<entry name="{{ ipv6 }}"/>
</ipv6-address>
{% endif -%}
</entry>
{% endfor -%}
</network-interface>
</entry>
{% if host_info.os_vendor == "Microsoft" -%}
<entry name="antivirus">
<list>
<entry>
<ProductInfo>
<Prod name="McAfee VirusScan Enterprise" version="8.8.0.1804" defver="8682.0" prodType="1" engver="5900.7806" osType="1" vendor="McAfee, Inc." dateday="{{ day }}" dateyear="{{ year }}" datemon="{{ month }}">
</Prod>
<real-time-protection>yes</real-time-protection>
<last-full-scan-time>{{ generate_time }}</last-full-scan-time>
</ProductInfo>
</entry>
<entry>
<ProductInfo>
<Prod name="Windows Defender" version="4.11.15063.332" defver="1.245.683.0" prodType="1" engver="1.1.13804.0" osType="1" vendor="Microsoft Corp." dateday="{{ day }}" dateyear="{{ year }}" datemon="{{ month }}">
</Prod>
<real-time-protection>no</real-time-protection>
<last-full-scan-time>n/a</last-full-scan-time>
</ProductInfo>
</entry>
</list>
</entry>
<entry name="anti-spyware">
<list>
<entry>
<ProductInfo>
<Prod name="McAfee VirusScan Enterprise" version="8.8.0.1804" defver="8682.0" prodType="2" engver="5900.7806" osType="1" vendor="McAfee, Inc." dateday="{{ day }}" dateyear="{{ year }}" datemon="{{ month }}">
</Prod>
<real-time-protection>yes</real-time-protection>
<last-full-scan-time>{{ generate_time }}</last-full-scan-time>
</ProductInfo>
</entry>
<entry>
<ProductInfo>
<Prod name="Windows Defender" version="4.11.15063.332" defver="1.245.683.0" prodType="2" engver="1.1.13804.0" osType="1" vendor="Microsoft Corp." dateday="{{ day }}" dateyear="{{ year }}" datemon="{{ month }}">
</Prod>
<real-time-protection>no</real-time-protection>
<last-full-scan-time>n/a</last-full-scan-time>
</ProductInfo>
</entry>
</list>
</entry>
<entry name="disk-backup">
<list>
<entry>
<ProductInfo>
<Prod name="Windows Backup and Restore" version="{{ host_info.os_version }}" vendor="Microsoft Corp.">
</Prod>
<last-backup-time>n/a</last-backup-time>
</ProductInfo>
</entry>
</list>
</entry>
<entry name="disk-encryption">
<list>
<entry>
<ProductInfo>
<Prod name="Windows Drive Encryption" version="{{ host_info.os_version }}" vendor="Microsoft Corp.">
</Prod>
<drives>
<entry>
<drive-name>C:\\</drive-name>
<enc-state>full</enc-state>
</entry>
</drives>
</ProductInfo>
</entry>
</list>
</entry>
<entry name="firewall">
<list>
<entry>
<ProductInfo>
<Prod name="Microsoft Windows Firewall" version="10.0" vendor="Microsoft Corp.">
</Prod>
<is-enabled>yes</is-enabled>
</ProductInfo>
</entry>
</list>
</entry>
<entry name="patch-management">
<list>
<entry>
<ProductInfo>
<Prod name="McAfee ePolicy Orchestrator Agent" version="5.0.5.658" vendor="McAfee, Inc.">
</Prod>
<is-enabled>yes</is-enabled>
</ProductInfo>
</entry>
<entry>
<ProductInfo>
<Prod name="Microsoft Windows Update Agent" version="{{ host_info.os_version }}" vendor="Microsoft Corp.">
</Prod>
<is-enabled>yes</is-enabled>
</ProductInfo>
</entry>
</list>
<missing-patches/>
</entry>
{% elif host_info.os_vendor == "Apple" -%}
<entry name="anti-malware">
<list>
<entry>
<ProductInfo>
<Prod vendor="Apple Inc." name="Xprotect" version="2167" defver="235000000000000" engver="" datemon="{{ month }}" dateday="{{ day }}" dateyear="{{ year }}" prodType="3" osType="4"/>
<real-time-protection>yes</real-time-protection>
<last-full-scan-time>n/a</last-full-scan-time>
</ProductInfo>
</entry>
<entry>
<ProductInfo>
<Prod vendor="Apple Inc." name="Gatekeeper" version="{{ host_info.os_version }}" defver="" engver="" datemon="{{ month }}" dateday="{{ day }}" dateyear="{{ year }}" prodType="3" osType="4"/>
<real-time-protection>yes</real-time-protection>
<last-full-scan-time>n/a</last-full-scan-time>
</ProductInfo>
</entry>
</list>
</entry>
<entry name="disk-backup">
<list>
<entry>
<ProductInfo>
<Prod vendor="Apple Inc." name="Time Machine" version="1.3"/>
<last-backup-time>n/a</last-backup-time>
</ProductInfo>
</entry>
</list>
</entry>
<entry name="disk-encryption">
<list>
<entry>
<ProductInfo>
<Prod vendor="Apple Inc." name="FileVault" version="{{ host_info.os_version }}"/>
<drives>
<entry>
<drive-name>Macintosh HD</drive-name>
<enc-state>encrypted</enc-state>
</entry>
<entry>
<drive-name>Data</drive-name>
<enc-state>encrypted</enc-state>
</entry>
<entry>
<drive-name>All</drive-name>
<enc-state>encrypted</enc-state>
</entry>
</drives>
</ProductInfo>
</entry>
</list>
</entry>
<entry name="firewall">
<list>
<entry>
<ProductInfo>
<Prod vendor="Apple Inc." name="Mac OS X Builtin Firewall" version="{{ host_info.os_version }}"/>
<is-enabled>yes</is-enabled>
</ProductInfo>
</entry>
<entry>
<ProductInfo>
<Prod vendor="OpenBSD" name="Packet Filter" version="{{ host_info.os_version }}"/>
<is-enabled>no</is-enabled>
</ProductInfo>
</entry>
</list>
</entry>
<entry name="patch-management">
<list>
<entry>
<ProductInfo>
<Prod vendor="Apple Inc." name="Software Update" version="3.0"/>
<is-enabled>yes</is-enabled>
</ProductInfo>
</entry>
</list>
<missing-patches>
</missing-patches>
</entry>
{% elif host_info.os_vendor == "Linux" -%}
<entry name="anti-malware">
<list/>
</entry>
<entry name="disk-backup">
<list/>
</entry>
<entry name="disk-encryption">
<list>
<entry>
<ProductInfo>
<Prod name="cryptsetup" version="2.3.3" vendor="GitLab Inc.">
</Prod>
<drives>
<entry>
<drive-name>/</drive-name>
<enc-state>encrypted</enc-state>
</entry>
</drives>
</ProductInfo>
</entry>
</list>
</entry>
<entry name="firewall">
<list>
<entry>
<ProductInfo>
<Prod name="IPTables" version="1.8.4" vendor="IPTables">
</Prod>
<is-enabled>no</is-enabled>
</ProductInfo>
</entry>
<entry>
<ProductInfo>
<Prod name="nftables" version="0.9.3" vendor="The Netfilter Project">
</Prod>
<is-enabled>n/a</is-enabled>
</ProductInfo>
</entry>
</list>
</entry>
<entry name="patch-management">
<list>
<entry>
<ProductInfo>
<Prod name="Dandified Yum" version="4.2.23" vendor="Red Hat, Inc.">
</Prod>
<is-enabled>yes</is-enabled>
</ProductInfo>
</entry>
</list>
<missing-patches/>
</entry>
{% endif -%}
<entry name="data-loss-prevention">
<list/>
</entry>
</categories>
</hip-report>
+167
View File
@@ -0,0 +1,167 @@
function Av(l,i){for(var c=0;c<i.length;c++){const o=i[c];if(typeof o!="string"&&!Array.isArray(o)){for(const s in o)if(s!=="default"&&!(s in l)){const d=Object.getOwnPropertyDescriptor(o,s);d&&Object.defineProperty(l,s,d.get?d:{enumerable:!0,get:()=>o[s]})}}}return Object.freeze(Object.defineProperty(l,Symbol.toStringTag,{value:"Module"}))}(function(){const i=document.createElement("link").relList;if(i&&i.supports&&i.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))o(s);new MutationObserver(s=>{for(const d of s)if(d.type==="childList")for(const m of d.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&o(m)}).observe(document,{childList:!0,subtree:!0});function c(s){const d={};return s.integrity&&(d.integrity=s.integrity),s.referrerPolicy&&(d.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?d.credentials="include":s.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function o(s){if(s.ep)return;s.ep=!0;const d=c(s);fetch(s.href,d)}})();function xv(l){return l&&l.__esModule&&Object.prototype.hasOwnProperty.call(l,"default")?l.default:l}var hs={exports:{}},Gi={};var m0;function zv(){if(m0)return Gi;m0=1;var l=Symbol.for("react.transitional.element"),i=Symbol.for("react.fragment");function c(o,s,d){var m=null;if(d!==void 0&&(m=""+d),s.key!==void 0&&(m=""+s.key),"key"in s){d={};for(var g in s)g!=="key"&&(d[g]=s[g])}else d=s;return s=d.ref,{$$typeof:l,type:o,key:m,ref:s!==void 0?s:null,props:d}}return Gi.Fragment=i,Gi.jsx=c,Gi.jsxs=c,Gi}var y0;function Ov(){return y0||(y0=1,hs.exports=zv()),hs.exports}var lt=Ov(),ms={exports:{}},Yi={},ys={exports:{}},ps={};var p0;function Mv(){return p0||(p0=1,(function(l){function i(O,$){var et=O.length;O.push($);t:for(;0<et;){var rt=et-1>>>1,wt=O[rt];if(0<s(wt,$))O[rt]=$,O[et]=wt,et=rt;else break t}}function c(O){return O.length===0?null:O[0]}function o(O){if(O.length===0)return null;var $=O[0],et=O.pop();if(et!==$){O[0]=et;t:for(var rt=0,wt=O.length,S=wt>>>1;rt<S;){var j=2*(rt+1)-1,W=O[j],tt=j+1,ot=O[tt];if(0>s(W,et))tt<wt&&0>s(ot,W)?(O[rt]=ot,O[tt]=et,rt=tt):(O[rt]=W,O[j]=et,rt=j);else if(tt<wt&&0>s(ot,et))O[rt]=ot,O[tt]=et,rt=tt;else break t}}return $}function s(O,$){var et=O.sortIndex-$.sortIndex;return et!==0?et:O.id-$.id}if(l.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var d=performance;l.unstable_now=function(){return d.now()}}else{var m=Date,g=m.now();l.unstable_now=function(){return m.now()-g}}var v=[],p=[],A=1,E=null,D=3,q=!1,R=!1,_=!1,Y=!1,J=typeof setTimeout=="function"?setTimeout:null,F=typeof clearTimeout=="function"?clearTimeout:null,P=typeof setImmediate<"u"?setImmediate:null;function X(O){for(var $=c(p);$!==null;){if($.callback===null)o(p);else if($.startTime<=O)o(p),$.sortIndex=$.expirationTime,i(v,$);else break;$=c(p)}}function U(O){if(_=!1,X(O),!R)if(c(v)!==null)R=!0,G||(G=!0,y());else{var $=c(p);$!==null&&at(U,$.startTime-O)}}var G=!1,V=-1,dt=5,ht=-1;function gt(){return Y?!0:!(l.unstable_now()-ht<dt)}function ct(){if(Y=!1,G){var O=l.unstable_now();ht=O;var $=!0;try{t:{R=!1,_&&(_=!1,F(V),V=-1),q=!0;var et=D;try{e:{for(X(O),E=c(v);E!==null&&!(E.expirationTime>O&&gt());){var rt=E.callback;if(typeof rt=="function"){E.callback=null,D=E.priorityLevel;var wt=rt(E.expirationTime<=O);if(O=l.unstable_now(),typeof wt=="function"){E.callback=wt,X(O),$=!0;break e}E===c(v)&&o(v),X(O)}else o(v);E=c(v)}if(E!==null)$=!0;else{var S=c(p);S!==null&&at(U,S.startTime-O),$=!1}}break t}finally{E=null,D=et,q=!1}$=void 0}}finally{$?y():G=!1}}}var y;if(typeof P=="function")y=function(){P(ct)};else if(typeof MessageChannel<"u"){var k=new MessageChannel,Q=k.port2;k.port1.onmessage=ct,y=function(){Q.postMessage(null)}}else y=function(){J(ct,0)};function at(O,$){V=J(function(){O(l.unstable_now())},$)}l.unstable_IdlePriority=5,l.unstable_ImmediatePriority=1,l.unstable_LowPriority=4,l.unstable_NormalPriority=3,l.unstable_Profiling=null,l.unstable_UserBlockingPriority=2,l.unstable_cancelCallback=function(O){O.callback=null},l.unstable_forceFrameRate=function(O){0>O||125<O?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):dt=0<O?Math.floor(1e3/O):5},l.unstable_getCurrentPriorityLevel=function(){return D},l.unstable_next=function(O){switch(D){case 1:case 2:case 3:var $=3;break;default:$=D}var et=D;D=$;try{return O()}finally{D=et}},l.unstable_requestPaint=function(){Y=!0},l.unstable_runWithPriority=function(O,$){switch(O){case 1:case 2:case 3:case 4:case 5:break;default:O=3}var et=D;D=O;try{return $()}finally{D=et}},l.unstable_scheduleCallback=function(O,$,et){var rt=l.unstable_now();switch(typeof et=="object"&&et!==null?(et=et.delay,et=typeof et=="number"&&0<et?rt+et:rt):et=rt,O){case 1:var wt=-1;break;case 2:wt=250;break;case 5:wt=1073741823;break;case 4:wt=1e4;break;default:wt=5e3}return wt=et+wt,O={id:A++,callback:$,priorityLevel:O,startTime:et,expirationTime:wt,sortLine truncated
at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
`+Xl+t+iu}var $l=!1;function Ql(t,e){if(!t||$l)return"";$l=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var a={DetermineComponentFrameRoot:function(){try{if(e){var L=function(){throw Error()};if(Object.defineProperty(L.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(L,[])}catch(w){var M=w}Reflect.construct(t,[],L)}else{try{L.call()}catch(w){M=w}t.call(L.prototype)}}else{try{throw Error()}catch(w){M=w}(L=t())&&typeof L.catch=="function"&&L.catch(function(){})}}catch(w){if(w&&M&&typeof w.stack=="string")return[w.stack,M.stack]}return[null,null]}};a.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var u=Object.getOwnPropertyDescriptor(a.DetermineComponentFrameRoot,"name");u&&u.configurable&&Object.defineProperty(a.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var r=a.DetermineComponentFrameRoot(),f=r[0],h=r[1];if(f&&h){var b=f.split(`
`),z=h.split(`
`);for(u=a=0;a<b.length&&!b[a].includes("DetermineComponentFrameRoot");)a++;for(;u<z.length&&!z[u].includes("DetermineComponentFrameRoot");)u++;if(a===b.length||u===z.length)for(a=b.length-1,u=z.length-1;1<=a&&0<=u&&b[a]!==z[u];)u--;for(;1<=a&&0<=u;a--,u--)if(b[a]!==z[u]){if(a!==1||u!==1)do if(a--,u--,0>u||b[a]!==z[u]){var B=`
`+b[a].replace(" at new "," at ");return t.displayName&&B.includes("<anonymous>")&&(B=B.replace("<anonymous>",t.displayName)),B}while(1<=a&&0<=u);break}}}finally{$l=!1,Error.prepareStackTrace=n}return(n=t?t.displayName||t.name:"")?en(n):""}function $a(t,e){switch(t.tag){case 26:case 27:case 5:return en(t.type);case 16:return en("Lazy");case 13:return t.child!==e&&e!==null?en("Suspense Fallback"):en("Suspense");case 19:return en("SuspenseList");case 0:case 15:return Ql(t.type,!1);case 11:return Ql(t.type.render,!1);case 1:return Ql(t.type,!0);case 31:return en("Activity");default:return""}}function qn(t){try{var e="",n=null;do e+=$a(t,n),n=t,t=t.return;while(t);return e}catch(a){return`
Error generating stack: `+a.message+`
`+a.stack}}var Zl=Object.prototype.hasOwnProperty,Qa=l.unstable_scheduleCallback,kl=l.unstable_cancelCallback,ft=l.unstable_shouldYield,lp=l.unstable_requestPaint,ze=l.unstable_now,ip=l.unstable_getCurrentPriorityLevel,yf=l.unstable_ImmediatePriority,pf=l.unstable_UserBlockingPriority,uu=l.unstable_NormalPriority,up=l.unstable_LowPriority,gf=l.unstable_IdlePriority,rp=l.log,cp=l.unstable_setDisableYieldValue,Kl=null,Oe=null;function Gn(t){if(typeof rp=="function"&&cp(t),Oe&&typeof Oe.setStrictMode=="function")try{Oe.setStrictMode(Kl,t)}catch{}}var Me=Math.clz32?Math.clz32:fp,op=Math.log,sp=Math.LN2;function fp(t){return t>>>=0,t===0?32:31-(op(t)/sp|0)|0}var ru=256,cu=262144,ou=4194304;function ga(t){var e=t&42;if(e!==0)return e;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function su(t,e,n){var a=t.pendingLanes;if(a===0)return 0;var u=0,r=t.suspendedLanes,f=t.pingedLanes;t=t.warmLanes;var h=a&134217727;return h!==0?(a=h&~r,a!==0?u=ga(a):(f&=h,f!==0?u=ga(f):n||(n=h&~t,n!==0&&(u=ga(n))))):(h=a&~r,h!==0?u=ga(h):f!==0?u=ga(f):n||(n=a&~t,n!==0&&(u=ga(n)))),u===0?0:e!==0&&e!==u&&(e&r)===0&&(r=u&-u,n=e&-e,r>=n||r===32&&(n&4194048)!==0)?e:u}function Jl(t,e){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&e)===0}function dp(t,e){switch(t){case 1:case 2:case 4:case 8:case 64:return e+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function vf(){var t=ou;return ou<<=1,(ou&62914560)===0&&(ou=4194304),t}function tc(t){for(var e=[],n=0;31>n;n++)e.push(t);return e}function Wl(t,e){t.pendingLanes|=e,e!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function hp(t,e,n,a,u,r){var f=t.pendingLanes;t.pendingLanes=n,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=n,t.entangledLanes&=n,t.errorRecoveryDisabledLanes&=n,t.shellSuspendCounter=0;var h=t.entanglements,b=t.expirationTimes,z=t.hiddenUpdates;for(n=f&~n;0<n;){var B=31-Me(n),L=1<<B;h[B]=0,b[B]=-1;var M=z[B];if(M!==null)for(z[B]=null,B=0;B<M.length;B++){var w=M[B];w!==null&&(w.lane&=-536870913)}n&=~L}a!==0&&bf(t,a,0),r!==0&&u===0&&t.tag!==0&&(t.suspendedLanes|=r&~(f&~e))}function bf(t,e,n){t.pendingLanes|=e,t.suspendedLanes&=~e;var a=31-Me(e);t.entangledLanes|=e,t.entanglements[a]=t.entanglements[a]|1073741824|n&261930}function Sf(t,e){var n=t.entangledLanes|=e;for(t=t.entanglements;n;){var a=31-Me(n),u=1<<a;u&e|t[a]&e&&(t[a]|=e),n&=~u}}function Tf(t,e){var n=e&-e;return n=(n&42)!==0?1:ec(n),(n&(t.suspendedLanes|e))!==0?0:n}function ec(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function nc(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function Cf(){var t=$.p;return t!==0?t:(t=window.event,t===void 0?32:r0(t.type))}function Ef(t,e){var n=$.p;try{return $.p=t,e()}finally{$.p=n}}var Yn=Math.random().toString(36).slice(2),ce="__reactFiber$"+Yn,be="__reactProps$"+Yn,Za="__reactContainer$"+Yn,ac="__reactEvents$"+Yn,mp="__reactListeners$"+Yn,yp="__reactHandles$"+Yn,_f="__reactResources$"+Yn,Fl="__reactMarker$"+Yn;function lc(t){delete t[ce],delete t[be],delete t[ac],delete t[mp],delete t[yp]}function ka(t){var e=t[ce];if(e)return e;for(var n=t.parentNode;n;){if(e=n[Za]||n[ce]){if(n=e.alternate,e.child!==null||n!==null&&n.child!==null)for(t=Qm(t);t!==null;){if(n=t[ce])return n;t=Qm(t)}return e}t=n,n=t.parentNode}return null}function Ka(t){if(t=t[ce]||t[Za]){var e=t.tag;if(e===5||e===6||e===13||e===31||e===26||e===27||e===3)return t}return null}function Pl(t){var e=t.tag;if(e===5||e===26||e===27||e===6)return t.stateNode;throw Error(o(33))}function Ja(t){var e=t[_f];return e||(e=t[_f]={hoistableStyles:new Map,hoistableScripts:new Map}),e}function ie(t){t[Fl]=!0}var Af=new Set,xf={};function va(t,e){Wa(t,e),Wa(t+"Capture",e)}function Wa(t,e){for(xf[t]=e,t=0;t<e.length;t++)Af.add(e[t])}var pp=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u21 Line truncated
`).replace(kg,"")}function Um(t,e){return e=Nm(e),Nm(t)===e}function jt(t,e,n,a,u,r){switch(n){case"children":typeof a=="string"?e==="body"||e==="textarea"&&a===""||Pa(t,a):(typeof a=="number"||typeof a=="bigint")&&e!=="body"&&Pa(t,""+a);break;case"className":du(t,"class",a);break;case"tabIndex":du(t,"tabindex",a);break;case"dir":case"role":case"viewBox":case"width":case"height":du(t,n,a);break;case"style":Uf(t,a,r);break;case"data":if(e!=="object"){du(t,"data",a);break}case"src":case"href":if(a===""&&(e!=="a"||n!=="href")){t.removeAttribute(n);break}if(a==null||typeof a=="function"||typeof a=="symbol"||typeof a=="boolean"){t.removeAttribute(n);break}a=mu(""+a),t.setAttribute(n,a);break;case"action":case"formAction":if(typeof a=="function"){t.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof r=="function"&&(n==="formAction"?(e!=="input"&&jt(t,e,"name",u.name,u,null),jt(t,e,"formEncType",u.formEncType,u,null),jt(t,e,"formMethod",u.formMethod,u,null),jt(t,e,"formTarget",u.formTarget,u,null)):(jt(t,e,"encType",u.encType,u,null),jt(t,e,"method",u.method,u,null),jt(t,e,"target",u.target,u,null)));if(a==null||typeof a=="symbol"||typeof a=="boolean"){t.removeAttribute(n);break}a=mu(""+a),t.setAttribute(n,a);break;case"onClick":a!=null&&(t.onclick=gn);break;case"onScroll":a!=null&&bt("scroll",t);break;case"onScrollEnd":a!=null&&bt("scrollend",t);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(o(61));if(n=a.__html,n!=null){if(u.children!=null)throw Error(o(60));t.innerHTML=n}}break;case"multiple":t.multiple=a&&typeof a!="function"&&typeof a!="symbol";break;case"muted":t.muted=a&&typeof a!="function"&&typeof a!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(a==null||typeof a=="function"||typeof a=="boolean"||typeof a=="symbol"){t.removeAttribute("xlink:href");break}n=mu(""+a),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":a!=null&&typeof a!="function"&&typeof a!="symbol"?t.setAttribute(n,""+a):t.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":a&&typeof a!="function"&&typeof a!="symbol"?t.setAttribute(n,""):t.removeAttribute(n);break;case"capture":case"download":a===!0?t.setAttribute(n,""):a!==!1&&a!=null&&typeof a!="function"&&typeof a!="symbol"?t.setAttribute(n,a):t.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":a!=null&&typeof a!="function"&&typeof a!="symbol"&&!isNaN(a)&&1<=a?t.setAttribute(n,a):t.removeAttribute(n);break;case"rowSpan":case"start":a==null||typeof a=="function"||typeof a=="symbol"||isNaN(a)?t.removeAttribute(n):t.setAttribute(n,a);break;case"popover":bt("beforetoggle",t),bt("toggle",t),fu(t,"popover",a);break;case"xlinkActuate":pn(t,"http://www.w3.org/1999/xlink","xlink:actuate",a);break;case"xlinkArcrole":pn(t,"http://www.w3.org/1999/xlink","xlink:arcrole",a);break;case"xlinkRole":pn(t,"http://www.w3.org/1999/xlink","xlink:role",a);break;case"xlinkShow":pn(t,"http://www.w3.org/1999/xlink","xlink:show",a);break;case"xlinkTitle":pn(t,"http://www.w3.org/1999/xlink","xlink:title",a);break;case"xlinkType":pn(t,"http://www.w3.org/1999/xlink","xlink:type",a);break;case"xmlBase":pn(t,"http://www.w3.org/XML/1998/namespace","xml:base",a);break;case"xmlLang":pn(t,"http://www.w3.org/XML/1998/namespace","xml:lang",a);break;case"xmlSpace":pn(t,"http://www.w3.org/XML/1998/namespace","xml:space",a);break;case"is":fu(t,"is",a);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=Tp.get(n)||n,fu(t,n,a))}}function Jo(t,e,n,a,u,r){switch(n){case"style":Uf(t,a,r);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(o(61));if(n=a.__html,n!=null){if(u.children!=null)throw Error(o(60));t.innerHTML=n}}break;case"children":typeof a=="string"?Pa(t,a):(typeof a=="number"||typeof a=="bigint")&&Pa(t,""+a);break;case"onScroll":a!=null&&bt("scroll",t);break;case"onScrollEnd":a!=null&&bt("scrollend",t);break;case"onClick":a!=null&&(t.onclick=gn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"inne Line truncated
const theme = ${JSON.stringify(i,null,2)};
theme.breakpoints = createBreakpoints(theme.breakpoints || {});
theme.transitions = createTransitions(theme.transitions || {});
export default theme;`}function ty(l){return typeof l=="number"?`${(l*100).toFixed(0)}%`:`calc((${l}) * 100%)`}const jS=l=>{if(!Number.isNaN(+l))return+l;const i=l.match(/\d*\.?\d+/g);if(!i)return 0;let c=0;for(let o=0;o<i.length;o+=1)c+=+i[o];return c};function LS(l){Object.assign(l,{alpha(i,c){const o=this||l;return o.colorSpace?`oklch(from ${i} l c h / ${typeof c=="string"?`calc(${c})`:c})`:o.vars?`rgba(${i.replace(/var\(--([^,\s)]+)(?:,[^)]+)?\)+/g,"var(--$1Channel)")} / ${typeof c=="string"?`calc(${c})`:c})`:Ly(i,jS(c))},lighten(i,c){const o=this||l;return o.colorSpace?`color-mix(in ${o.colorSpace}, ${i}, #fff ${ty(c)})`:Ir(i,c)},darken(i,c){const o=this||l;return o.colorSpace?`color-mix(in ${o.colorSpace}, ${i}, #000 ${ty(c)})`:Pr(i,c)}})}function Hs(l={},...i){const{breakpoints:c,mixins:o={},spacing:s,palette:d={},transitions:m={},typography:g={},shape:v,colorSpace:p,...A}=l;if(l.vars&&l.generateThemeVars===void 0)throw new Error(qa(20));const E=of({...d,colorSpace:p}),D=rf(l);let q=Ge(D,{mixins:_S(D.breakpoints,o),palette:E,shadows:RS.slice(),typography:xS(E,g),transitions:NS(m),zIndex:{...US}});return q=Ge(q,A),q=i.reduce((R,_)=>Ge(R,_),q),q.unstable_sxConfig={...au,...A?.unstable_sxConfig},q.unstable_sx=function(_){return Ga({sx:_,theme:this})},q.toRuntimeSource=Vy,LS(q),q}function qS(l){let i;return l<1?i=5.11916*l**2:i=4.5*Math.log(l+1)+2,Math.round(i*10)/1e3}const GS=[...Array(25)].map((l,i)=>{if(i===0)return"none";const c=qS(i);return`linear-gradient(rgba(255 255 255 / ${c}), rgba(255 255 255 / ${c}))`});function Xy(l){return{inputPlaceholder:l==="dark"?.5:.42,inputUnderline:l==="dark"?.7:.42,switchTrackDisabled:l==="dark"?.2:.12,switchTrack:l==="dark"?.3:.38}}function $y(l){return l==="dark"?GS:[]}function YS(l){const{palette:i={mode:"light"},opacity:c,overlays:o,colorSpace:s,...d}=l,m=of({...i,colorSpace:s});return{palette:m,opacity:{...Xy(m.mode),...c},overlays:o||$y(m.mode),...d}}function VS(l){return!!l[0].match(/(cssVarPrefix|colorSchemeSelector|modularCssLayers|rootSelector|typography|mixins|breakpoints|direction|transitions)/)||!!l[0].match(/sxConfig$/)||l[0]==="palette"&&!!l[1]?.match(/(mode|contrastThreshold|tonalOffset)/)}const XS=l=>[...[...Array(25)].map((i,c)=>`--${l?`${l}-`:""}overlays-${c}`),`--${l?`${l}-`:""}palette-AppBar-darkBg`,`--${l?`${l}-`:""}palette-AppBar-darkColor`],$S=l=>(i,c)=>{const o=l.rootSelector||":root",s=l.colorSchemeSelector;let d=s;if(s==="class"&&(d=".%s"),s==="data"&&(d="[data-%s]"),s?.startsWith("data-")&&!s.includes("%s")&&(d=`[${s}="%s"]`),l.defaultColorScheme===i){if(i==="dark"){const m={};return XS(l.cssVarPrefix).forEach(g=>{m[g]=c[g],delete c[g]}),d==="media"?{[o]:c,"@media (prefers-color-scheme: dark)":{[o]:m}}:d?{[d.replace("%s",i)]:m,[`${o}, ${d.replace("%s",i)}`]:c}:{[o]:{...c,...m}}}if(d&&d!=="media")return`${o}, ${d.replace("%s",String(i))}`}else if(i){if(d==="media")return{[`@media (prefers-color-scheme: ${String(i)})`]:{[o]:c}};if(d)return d.replace("%s",String(i))}return o};function QS(l,i){i.forEach(c=>{l[c]||(l[c]={})})}function N(l,i,c){!l[i]&&c&&(l[i]=c)}function Qi(l){return typeof l!="string"||!l.startsWith("hsl")?l:jy(l)}function Nn(l,i){`${i}Channel`in l||(l[`${i}Channel`]=$i(Qi(l[i])))}function ZS(l){return typeof l=="number"?`${l}px`:typeof l=="string"||typeof l=="function"||Array.isArray(l)?l:"8px"}const fn=l=>{try{return l()}catch{}},kS=(l="mui")=>fS(l);function xs(l,i,c,o,s){if(!c)return;c=c===!0?{}:c;const d=s==="dark"?"dark":"light";if(!o){i[s]=YS({...c,palette:{mode:d,...c?.palette},colorSpace:l});return}const{palette:m,...g}=Hs({...o,palette:{mode:d,...c?.palette},colorSpace:l});return i[s]={...c,palette:m,opacity:{...Xy(d),...c?.opacity},overlays:c?.overlays||$y(d)},g}function KS(l={},...i){const{colorSchemes:c={light:!0},defaultColorScheme:o,disableCssColorScheme:s=!1,cssVarPrefix:d="mui",nativeColor:m=!1,shouldSkipGeneratingVar:g=VS,colorSchemeSelector:v=c.light&&c.dark?"media":void 0,rootSelector:p=":root",...A}=l,E=Object.keys(c)[0],D=o||(c.light&&E!=="light"?"light":E),q=kS(d),{[D]:R,light:_,dark:Y,...J}=c,F={...J};let P=R;if((D==="dark"&&!("dark"in c)||D==="light"&&!("light"in c))&&(P=!0),!P)throw new Error(qa(21,D));let X;m&&(X="oklch");const U=xs(X,F,P,A,D);_&&!F.light&&xs(X,F,_,void 0,"light"),Y&&!F.dark&&xs(X,F,Y,void 0,"dark");let G={defaultColorScheme:D,...U,cssVarPrefix:d,colorSchemeSelector:v,rootSelector:p,getCssVar:q,colorSchemes:F,font:{...ES(U.typography),...U.font},spacing:ZS(A.spacing)};Object.keys(G.colorSchemes).forEach(ct=>{const y=G.colorSchemes[ct].palette,k=at=>{const O=at.split("-"),$=O[1],et=O[2];return q(at,y[$][et])};y.mode==="light"&&(N(y.common,"background","#fff"),N(y.common,"onBackground","#000")),y.mode==="dark"&&(N(y.common,"background","#000"),N(y.common,"onBackground","#fff"));function Q(at,O,$){if(X){let et;return at===Ua&&(et=`transparent ${((1-$)*100).toFixed(0)}%`),at===Nt&&(et=`#000 ${($*100).toFixed(0)}%`),at===Ut&&(et=`#fff ${($*100).toFixed(0)}%`),`color-mix(in ${X}, ${O}, ${Line truncated
0% {
transform: scale(0);
opacity: 0.1;
}
100% {
transform: scale(1);
opacity: 0.3;
}
`,m2=ya`
0% {
opacity: 1;
}
100% {
opacity: 0;
}
`,y2=ya`
0% {
transform: scale(1);
}
50% {
transform: scale(0.92);
}
100% {
transform: scale(1);
}
`,p2=ye("span",{name:"MuiTouchRipple",slot:"Root"})({overflow:"hidden",pointerEvents:"none",position:"absolute",zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:"inherit"}),g2=ye(f2,{name:"MuiTouchRipple",slot:"Ripple"})`
opacity: 0;
position: absolute;
&.${Fe.rippleVisible} {
opacity: 0.3;
transform: scale(1);
animation-name: ${h2};
animation-duration: ${Ls}ms;
animation-timing-function: ${({theme:l})=>l.transitions.easing.easeInOut};
}
&.${Fe.ripplePulsate} {
animation-duration: ${({theme:l})=>l.transitions.duration.shorter}ms;
}
& .${Fe.child} {
opacity: 1;
display: block;
width: 100%;
height: 100%;
border-radius: 50%;
background-color: currentColor;
}
& .${Fe.childLeaving} {
opacity: 0;
animation-name: ${m2};
animation-duration: ${Ls}ms;
animation-timing-function: ${({theme:l})=>l.transitions.easing.easeInOut};
}
& .${Fe.childPulsate} {
position: absolute;
/* @noflip */
left: 0px;
top: 0;
animation-name: ${y2};
animation-duration: 2500ms;
animation-timing-function: ${({theme:l})=>l.transitions.easing.easeInOut};
animation-iteration-count: infinite;
animation-delay: 200ms;
}
`,v2=Z.forwardRef(function(i,c){const o=Va({props:i,name:"MuiTouchRipple"}),{center:s=!1,classes:d={},className:m,...g}=o,[v,p]=Z.useState([]),A=Z.useRef(0),E=Z.useRef(null);Z.useEffect(()=>{E.current&&(E.current(),E.current=null)},[v]);const D=Z.useRef(!1),q=c2(),R=Z.useRef(null),_=Z.useRef(null),Y=Z.useCallback(X=>{const{pulsate:U,rippleX:G,rippleY:V,rippleSize:dt,cb:ht}=X;p(gt=>[...gt,lt.jsx(g2,{classes:{ripple:me(d.ripple,Fe.ripple),rippleVisible:me(d.rippleVisible,Fe.rippleVisible),ripplePulsate:me(d.ripplePulsate,Fe.ripplePulsate),child:me(d.child,Fe.child),childLeaving:me(d.childLeaving,Fe.childLeaving),childPulsate:me(d.childPulsate,Fe.childPulsate)},timeout:Ls,pulsate:U,rippleX:G,rippleY:V,rippleSize:dt},A.current)]),A.current+=1,E.current=ht},[d]),J=Z.useCallback((X={},U={},G=()=>{})=>{const{pulsate:V=!1,center:dt=s||U.pulsate,fakeElement:ht=!1}=U;if(X?.type==="mousedown"&&D.current){D.current=!1;return}X?.type==="touchstart"&&(D.current=!0);const gt=ht?null:_.current,ct=gt?gt.getBoundingClientRect():{width:0,height:0,left:0,top:0};let y,k,Q;if(dt||X===void 0||X.clientX===0&&X.clientY===0||!X.clientX&&!X.touches)y=Math.round(ct.width/2),k=Math.round(ct.height/2);else{const{clientX:at,clientY:O}=X.touches&&X.touches.length>0?X.touches[0]:X;y=Math.round(at-ct.left),k=Math.round(O-ct.top)}if(dt)Q=Math.sqrt((2*ct.width**2+ct.height**2)/3),Q%2===0&&(Q+=1);else{const at=Math.max(Math.abs((gt?gt.clientWidth:0)-y),y)*2+2,O=Math.max(Math.abs((gt?gt.clientHeight:0)-k),k)*2+2;Q=Math.sqrt(at**2+O**2)}X?.touches?R.current===null&&(R.current=()=>{Y({pulsate:V,rippleX:y,rippleY:k,rippleSize:Q,cb:G})},q.start(d2,()=>{R.current&&(R.current(),R.current=null)})):Y({pulsate:V,rippleX:y,rippleY:k,rippleSize:Q,cb:G})},[s,Y,q]),F=Z.useCallback(()=>{J({},{pulsate:!0})},[J]),P=Z.useCallback((X,U)=>{if(q.clear(),X?.type==="touchend"&&R.current){R.current(),R.current=null,q.start(0,()=>{P(X,U)});return}R.current=null,p(G=>G.length>0?G.slice(1):G),E.current=U},[q]);return Z.useImperativeHandle(c,()=>({pulsate:F,start:J,stop:P}),[F,J,P]),lt.jsx(p2,{className:me(Fe.root,d.root,m),ref:_,...g,children:lt.jsx(ff,{component:null,exit:!0,children:v})})});function b2(l){return Vl("MuiButtonBase",l)}const S2=Ya("MuiButtonBase",["root","disabled","focusVisible"]),T2=l=>{const{disabled:i,focusVisible:c,focusVisibleClassName:o,classes:s}=l,m=lu({root:["root",i&&"disabled",c&&"focusVisible"]},b2,s);return c&&o&&(m.root+=` ${o}`),m},C2=ye("button",{name:"MuiButtonBase",slot:"Root"})({display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",boxSizing:"border-box",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},[`&.${S2.disabled}`]:{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}}),E2=Z.forwardRef(function(i,c){const o=Va({props:i,name:"MuiButtonBase"}),{action:s,centerRipple:d=!1,children:m,className:g,component:v="button",disabled:p=!1,disableRipple:A=!1,disableTouchRipple:E=!1,focusRipple:D=!1,focusVisibleClassName:q,LinkComponent:R="a",onBlur:_,onClick:Y,onContextMenu:J,onDragLeave:F,onFocus:P,onFocusVisible:X,onKeyDown:U,onKeyUp:G,onMouseDown:V,onMouseLeave:dt,onMouseUp:ht,onTouchEnd:gt,onTouchMove:ct,onTouchStart:y,tabIndex:k=0,TouchRippleProps:Q,touchRippleRef:at,type:O,...$}=o,et=Z.useRef(null),rt=o2(),wt=ny(rt.ref,at),[S,j]=Z.useState(!1);p&&S&&j(!1),Z.useImperativeHandle(s,()=>({focusVisible:()=>{j(!0),et.current.focus()}}),[]);const W=rt.shouldMount&&!A&&!p;Z.useEffect(()=>{S&&D&&!A&&rt.pulsate()},[A,D,S,rt]);const tt=Un(rt,"start",V,E),ot=Un(rt,"stop",J,E),pt=Un(rt,"stop",F,E),Et=Un(rt,"stop",ht,E),re=Un(rt,"stop",ft=>{S&&ft.preventDefault(),dt&&dt(ft)},E),Qt=Un(rt,"start",y,E),pa=Un(rt,"stop",gt,E),Xa=Un(rt,"stop",ct,E),Xl=Un(rt,"stop",ft=>{iy(ft.target)||j(!1),_&&_(ft)},!1),iu=Rr(ft=>{et.current||(et.current=ft.currentTarget),iy(ft.target)&&(j(!0),X&&X(ft)),P&&P(ft)}),en=()=>{const ft=et.current;return v&&v!=="button"&&!(ft.tagName==="A"&&ft.href)},$l=Rr(ft=>{D&&!ft.repeat&&S&&ft.key===" "&&rt.stop(ft,()=>{rt.start(ft)}),ft.target===ft.currentTarget&&en()&&ft.key===" "&&ft.preventDefault(),U&&U(ft),ft.target===ft.currentTarget&&en()&&ft.key==="Enter"&&!p&&(ft.preventDefault(),Y&&Y(ft))}),Ql=Rr(ft=>{D&&ft.key===" "&&S&&!ft.defaultPrevented&&rt.stop(ft,()=>{rt.pulsate(ft)}),G&&G(ft),Y&&ft.target===ft.currentTarget&&en()&&ft.key===" "&&!ft.defaultPrevented&&Y(ft)});let $a=v;$a==="button"&&($.href||$.to)&&($a=R);const qn={};if($a==="button"){const ft=!!$.formAction;qn.type=O===void 0&&!ft?"button":O,qn.disabled=p}else!$.href&&!$.to&&(qn.role="button"),p&&(qn["aria-disabled"]=p);const Zl=ny(c,et),Qa={...o,centerRipple:d,component:v,disabled:p,disableRipple:A,disableTouchRipple:E,focusRipple:D,tabIndex:k,focusVisible:S},kl= Line truncated
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
`,Gs=ya`
0% {
stroke-dasharray: 1px, 200px;
stroke-dashoffset: 0;
}
50% {
stroke-dasharray: 100px, 200px;
stroke-dashoffset: -15px;
}
100% {
stroke-dasharray: 1px, 200px;
stroke-dashoffset: -126px;
}
`,z2=typeof qs!="string"?Yl`
animation: ${qs} 1.4s linear infinite;
`:null,O2=typeof Gs!="string"?Yl`
animation: ${Gs} 1.4s ease-in-out infinite;
`:null,M2=l=>{const{classes:i,variant:c,color:o,disableShrink:s}=l,d={root:["root",c,`color${Rt(o)}`],svg:["svg"],track:["track"],circle:["circle",`circle${Rt(c)}`,s&&"circleDisableShrink"]};return lu(d,x2,i)},R2=ye("span",{name:"MuiCircularProgress",slot:"Root",overridesResolver:(l,i)=>{const{ownerState:c}=l;return[i.root,i[c.variant],i[`color${Rt(c.color)}`]]}})(Ln(({theme:l})=>({display:"inline-block",variants:[{props:{variant:"determinate"},style:{transition:l.transitions.create("transform")}},{props:{variant:"indeterminate"},style:z2||{animation:`${qs} 1.4s linear infinite`}},...Object.entries(l.palette).filter(ma()).map(([i])=>({props:{color:i},style:{color:(l.vars||l).palette[i].main}}))]}))),w2=ye("svg",{name:"MuiCircularProgress",slot:"Svg"})({display:"block"}),D2=ye("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(l,i)=>{const{ownerState:c}=l;return[i.circle,i[`circle${Rt(c.variant)}`],c.disableShrink&&i.circleDisableShrink]}})(Ln(({theme:l})=>({stroke:"currentColor",variants:[{props:{variant:"determinate"},style:{transition:l.transitions.create("stroke-dashoffset")}},{props:{variant:"indeterminate"},style:{strokeDasharray:"80px, 200px",strokeDashoffset:0}},{props:({ownerState:i})=>i.variant==="indeterminate"&&!i.disableShrink,style:O2||{animation:`${Gs} 1.4s ease-in-out infinite`}}]}))),B2=ye("circle",{name:"MuiCircularProgress",slot:"Track"})(Ln(({theme:l})=>({stroke:"currentColor",opacity:(l.vars||l).palette.action.activatedOpacity}))),N2=Z.forwardRef(function(i,c){const o=Va({props:i,name:"MuiCircularProgress"}),{className:s,color:d="primary",disableShrink:m=!1,enableTrackSlot:g=!1,size:v=40,style:p,thickness:A=3.6,value:E=0,variant:D="indeterminate",...q}=o,R={...o,color:d,disableShrink:m,size:v,thickness:A,value:E,variant:D,enableTrackSlot:g},_=M2(R),Y={},J={},F={};if(D==="determinate"){const P=2*Math.PI*((un-A)/2);Y.strokeDasharray=P.toFixed(3),F["aria-valuenow"]=Math.round(E),Y.strokeDashoffset=`${((100-E)/100*P).toFixed(3)}px`,J.transform="rotate(-90deg)"}return lt.jsx(R2,{className:me(_.root,s),style:{width:v,height:v,...J,...p},ownerState:R,ref:c,role:"progressbar",...F,...q,children:lt.jsxs(w2,{className:_.svg,ownerState:R,viewBox:`${un/2} ${un/2} ${un} ${un}`,children:[g?lt.jsx(B2,{className:_.track,ownerState:R,cx:un,cy:un,r:(un-A)/2,fill:"none",strokeWidth:A,"aria-hidden":"true"}):null,lt.jsx(D2,{className:_.circle,style:Y,ownerState:R,cx:un,cy:un,r:(un-A)/2,fill:"none",strokeWidth:A})]})})});function U2(l){return Vl("MuiTypography",l)}Ya("MuiTypography",["root","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"]);const H2={primary:!0,secondary:!0,error:!0,info:!0,success:!0,warning:!0,textPrimary:!0,textSecondary:!0,textDisabled:!0},j2=FS(),L2=l=>{const{align:i,gutterBottom:c,noWrap:o,paragraph:s,variant:d,classes:m}=l,g={root:["root",d,l.align!=="inherit"&&`align${Rt(i)}`,c&&"gutterBottom",o&&"noWrap",s&&"paragraph"]};return lu(g,U2,m)},q2=ye("span",{name:"MuiTypography",slot:"Root",overridesResolver:(l,i)=>{const{ownerState:c}=l;return[i.root,c.variant&&i[c.variant],c.align!=="inherit"&&i[`align${Rt(c.align)}`],c.noWrap&&i.noWrap,c.gutterBottom&&i.gutterBottom,c.paragraph&&i.paragraph]}})(Ln(({theme:l})=>({margin:0,variants:[{props:{variant:"inherit"},style:{font:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}},...Object.entries(l.typography).filter(([i,c])=>i!=="inherit"&&c&&typeof c=="object").map(([i,c])=>({props:{variant:i},style:c})),...Object.entries(l.palette).filter(ma()).map(([i])=>({props:{color:i},style:{color:(l.vars||l).palette[i].main}})),...Object.entries(l.palette?.text||{}).filter(([,i])=>typeof i=="string").map(([i])=>({props:{color:`text${Rt(i)}`},style:{color:(l.vars||l).palette.text[i]}})),{props:({ownerState:i})=>i.align!=="inherit",style:{textAlign:"var(--Typography-textAlign)"}},{props:({ownerState:i})=>i.noWrap,style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},{props:({ownerState:i})=>i.gutterBottom,style:{marginBottom:"0.35em"}},{props:({ownerState:i})=>i.paragraph,style:{marginBottom:16}}]}))),uy={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},hf=Z.forwardRef(function(i,c){const{color:o,...s}=Va({props:i,name:"MuiTypography"}),d=!H2[o],m=j2({...s,...d&&{color:o}}),{align:g="inherit",className:v,component:p,gutterBottom:A=!1,noWrap:E=!1,paragraph:D=!1,variant:q="body1",variantMapping:R=uy,..._}=m,Y={...m,align:g,color:o,className:v,component:p,gutterBottom:A,noWrap:E,paragraph:D,variant:q,variantMapping:R},J=p||(D?"p":R[q]||uy[q])||"span",F=L2(Y);return lt.jsx(q2,{as:J,ref:c,className:me(F.root,v),..._,ownerState:Y,style:{...g!=="inherit"&&{"--Typography-textAlign":g},..._.style}})}),G2=Ya("MuiBox",["root"]),Y2=Qy(),Hn=G1({themeId:Ks,defaultTheme:Y2,defaultClassName:G2.root,generateClassNa Line truncated
0% {
left: -35%;
right: 100%;
}
60% {
left: 100%;
right: -90%;
}
100% {
left: 100%;
right: -90%;
}
`,a5=typeof Xs!="string"?Yl`
animation: ${Xs} 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite;
`:null,$s=ya`
0% {
left: -200%;
right: 100%;
}
60% {
left: 107%;
right: -8%;
}
100% {
left: 107%;
right: -8%;
}
`,l5=typeof $s!="string"?Yl`
animation: ${$s} 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) 1.15s infinite;
`:null,Qs=ya`
0% {
opacity: 1;
background-position: 0 -23px;
}
60% {
opacity: 0;
background-position: 0 -23px;
}
100% {
opacity: 1;
background-position: -200px -23px;
}
`,i5=typeof Qs!="string"?Yl`
animation: ${Qs} 3s infinite linear;
`:null,u5=l=>{const{classes:i,variant:c,color:o}=l,s={root:["root",`color${Rt(o)}`,c],dashed:["dashed",`dashedColor${Rt(o)}`],bar1:["bar","bar1",`barColor${Rt(o)}`,(c==="indeterminate"||c==="query")&&"bar1Indeterminate",c==="determinate"&&"bar1Determinate",c==="buffer"&&"bar1Buffer"],bar2:["bar","bar2",c!=="buffer"&&`barColor${Rt(o)}`,c==="buffer"&&`color${Rt(o)}`,(c==="indeterminate"||c==="query")&&"bar2Indeterminate",c==="buffer"&&"bar2Buffer"]};return lu(s,n5,i)},mf=(l,i)=>l.vars?l.vars.palette.LinearProgress[`${i}Bg`]:l.palette.mode==="light"?l.lighten(l.palette[i].main,.62):l.darken(l.palette[i].main,.5),r5=ye("span",{name:"MuiLinearProgress",slot:"Root",overridesResolver:(l,i)=>{const{ownerState:c}=l;return[i.root,i[`color${Rt(c.color)}`],i[c.variant]]}})(Ln(({theme:l})=>({position:"relative",overflow:"hidden",display:"block",height:4,zIndex:0,"@media print":{colorAdjust:"exact"},variants:[...Object.entries(l.palette).filter(ma()).map(([i])=>({props:{color:i},style:{backgroundColor:mf(l,i)}})),{props:({ownerState:i})=>i.color==="inherit"&&i.variant!=="buffer",style:{"&::before":{content:'""',position:"absolute",left:0,top:0,right:0,bottom:0,backgroundColor:"currentColor",opacity:.3}}},{props:{variant:"buffer"},style:{backgroundColor:"transparent"}},{props:{variant:"query"},style:{transform:"rotate(180deg)"}}]}))),c5=ye("span",{name:"MuiLinearProgress",slot:"Dashed",overridesResolver:(l,i)=>{const{ownerState:c}=l;return[i.dashed,i[`dashedColor${Rt(c.color)}`]]}})(Ln(({theme:l})=>({position:"absolute",marginTop:0,height:"100%",width:"100%",backgroundSize:"10px 10px",backgroundPosition:"0 -23px",variants:[{props:{color:"inherit"},style:{opacity:.3,backgroundImage:"radial-gradient(currentColor 0%, currentColor 16%, transparent 42%)"}},...Object.entries(l.palette).filter(ma()).map(([i])=>{const c=mf(l,i);return{props:{color:i},style:{backgroundImage:`radial-gradient(${c} 0%, ${c} 16%, transparent 42%)`}}})]})),i5||{animation:`${Qs} 3s infinite linear`}),o5=ye("span",{name:"MuiLinearProgress",slot:"Bar1",overridesResolver:(l,i)=>{const{ownerState:c}=l;return[i.bar,i.bar1,i[`barColor${Rt(c.color)}`],(c.variant==="indeterminate"||c.variant==="query")&&i.bar1Indeterminate,c.variant==="determinate"&&i.bar1Determinate,c.variant==="buffer"&&i.bar1Buffer]}})(Ln(({theme:l})=>({width:"100%",position:"absolute",left:0,bottom:0,top:0,transition:"transform 0.2s linear",transformOrigin:"left",variants:[{props:{color:"inherit"},style:{backgroundColor:"currentColor"}},...Object.entries(l.palette).filter(ma()).map(([i])=>({props:{color:i},style:{backgroundColor:(l.vars||l).palette[i].main}})),{props:{variant:"determinate"},style:{transition:`transform .${Vs}s linear`}},{props:{variant:"buffer"},style:{zIndex:1,transition:`transform .${Vs}s linear`}},{props:({ownerState:i})=>i.variant==="indeterminate"||i.variant==="query",style:{width:"auto"}},{props:({ownerState:i})=>i.variant==="indeterminate"||i.variant==="query",style:a5||{animation:`${Xs} 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite`}}]}))),s5=ye("span",{name:"MuiLinearProgress",slot:"Bar2",overridesResolver:(l,i)=>{const{ownerState:c}=l;return[i.bar,i.bar2,i[`barColor${Rt(c.color)}`],(c.variant==="indeterminate"||c.variant==="query")&&i.bar2Indeterminate,c.variant==="buffer"&&i.bar2Buffer]}})(Ln(({theme:l})=>({width:"100%",position:"absolute",left:0,bottom:0,top:0,transition:"transform 0.2s linear",transformOrigin:"left",variants:[...Object.entries(l.palette).filter(ma()).map(([i])=>({props:{color:i},style:{"--LinearProgressBar2-barColor":(l.vars||l).palette[i].main}})),{props:({ownerState:i})=>i.variant!=="buffer"&&i.color!=="inherit",style:{backgroundColor:"var(--LinearProgressBar2-barColor, currentColor)"}},{props:({ownerState:i})=>i.variant!=="buffer"&&i.color==="inherit",style:{backgroundColor:"currentColor"}},{props:{color:"inherit"},style:{opacity:.3}},...Object.entries(l.palette).filter(ma()).map(([i])=>({props:{color:i,variant:"buffer"},style:{backgroundColor:mf(l,i),transition:`transform .${Vs}s linear`}})),{props:({ownerState:i})=>i.variant==="indeterminate"||i.variant==="query",style:{width:"auto"}},{props:({ownerState:i})=>i.variant==="indeterminate"||i.variant==="query",style:l5||{animation:`${$s} 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) 1.15s infinite`}}]}))),f5=Z.forwardRef(function(i,c){const o=Va({props:i,name:"MuiLinearProgress"}),{className:s,color:d="primary",value:m,valueBuffer:g,variant:v="indeterminate",...p}=o,A={...o,color:d,variant:v},E=u5(A),D=aS(),q={},R={bar1:{},bar2:{}};if((v==="determinate"||v==="buffer")&&m!==void 0){q["aria-valuenow"]=Math.round(m),q["aria-valuemin"]=0,q["aria-valuemax"]=100;let _=m-100;D&&(_=-_),R.bar1.transform=`translateX(${_}%)`}if(v==="buffer"&&g!==void 0){let _=(g||0)-100;D&&(_=-_),R.bar2.transform=`translateX(${_}%)`}return lt.jsxs(r5,{className:me(E.root,s),ownerState:A,role:"progressbar",...q,ref:c,...p,children:[v==="buffer"?lt.jsx(c5,{className:E.dashed,ownerState:A}):null,lt.jsx(o5,{classNa Line truncated
-228
View File
@@ -1,228 +0,0 @@
function qg(l,i){for(var o=0;o<i.length;o++){const c=i[o];if(typeof c!="string"&&!Array.isArray(c)){for(const s in c)if(s!=="default"&&!(s in l)){const d=Object.getOwnPropertyDescriptor(c,s);d&&Object.defineProperty(l,s,d.get?d:{enumerable:!0,get:()=>c[s]})}}}return Object.freeze(Object.defineProperty(l,Symbol.toStringTag,{value:"Module"}))}(function(){const i=document.createElement("link").relList;if(i&&i.supports&&i.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))c(s);new MutationObserver(s=>{for(const d of s)if(d.type==="childList")for(const m of d.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&c(m)}).observe(document,{childList:!0,subtree:!0});function o(s){const d={};return s.integrity&&(d.integrity=s.integrity),s.referrerPolicy&&(d.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?d.credentials="include":s.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function c(s){if(s.ep)return;s.ep=!0;const d=o(s);fetch(s.href,d)}})();function Gg(l){return l&&l.__esModule&&Object.prototype.hasOwnProperty.call(l,"default")?l.default:l}var Pc={exports:{}},Li={};/**
* @license React
* react-jsx-runtime.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var N0;function Yg(){if(N0)return Li;N0=1;var l=Symbol.for("react.transitional.element"),i=Symbol.for("react.fragment");function o(c,s,d){var m=null;if(d!==void 0&&(m=""+d),s.key!==void 0&&(m=""+s.key),"key"in s){d={};for(var v in s)v!=="key"&&(d[v]=s[v])}else d=s;return s=d.ref,{$$typeof:l,type:c,key:m,ref:s!==void 0?s:null,props:d}}return Li.Fragment=i,Li.jsx=o,Li.jsxs=o,Li}var U0;function $g(){return U0||(U0=1,Pc.exports=Yg()),Pc.exports}var nt=$g(),Ic={exports:{}},qi={},ts={exports:{}},es={};/**
* @license React
* scheduler.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var H0;function Vg(){return H0||(H0=1,(function(l){function i(Y,ut){var at=Y.length;Y.push(ut);t:for(;0<at;){var ct=at-1>>>1,S=Y[ct];if(0<s(S,ut))Y[ct]=ut,Y[at]=S,at=ct;else break t}}function o(Y){return Y.length===0?null:Y[0]}function c(Y){if(Y.length===0)return null;var ut=Y[0],at=Y.pop();if(at!==ut){Y[0]=at;t:for(var ct=0,S=Y.length,L=S>>>1;ct<L;){var lt=2*(ct+1)-1,it=Y[lt],J=lt+1,vt=Y[J];if(0>s(it,at))J<S&&0>s(vt,it)?(Y[ct]=vt,Y[J]=at,ct=J):(Y[ct]=it,Y[lt]=at,ct=lt);else if(J<S&&0>s(vt,at))Y[ct]=vt,Y[J]=at,ct=J;else break t}}return ut}function s(Y,ut){var at=Y.sortIndex-ut.sortIndex;return at!==0?at:Y.id-ut.id}if(l.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var d=performance;l.unstable_now=function(){return d.now()}}else{var m=Date,v=m.now();l.unstable_now=function(){return m.now()-v}}var b=[],y=[],O=1,_=null,w=3,H=!1,M=!1,A=!1,G=typeof setTimeout=="function"?setTimeout:null,X=typeof clearTimeout=="function"?clearTimeout:null,W=typeof setImmediate<"u"?setImmediate:null;function V(Y){for(var ut=o(y);ut!==null;){if(ut.callback===null)c(y);else if(ut.startTime<=Y)c(y),ut.sortIndex=ut.expirationTime,i(b,ut);else break;ut=o(y)}}function q(Y){if(A=!1,V(Y),!M)if(o(b)!==null)M=!0,Tt();else{var ut=o(y);ut!==null&&Dt(q,ut.startTime-Y)}}var R=!1,K=-1,P=5,ft=-1;function Q(){return!(l.unstable_now()-ft<P)}function p(){if(R){var Y=l.unstable_now();ft=Y;var ut=!0;try{t:{M=!1,A&&(A=!1,X(K),K=-1),H=!0;var at=w;try{e:{for(V(Y),_=o(b);_!==null&&!(_.expirationTime>Y&&Q());){var ct=_.callback;if(typeof ct=="function"){_.callback=null,w=_.priorityLevel;var S=ct(_.expirationTime<=Y);if(Y=l.unstable_now(),typeof S=="function"){_.callback=S,V(Y),ut=!0;break e}_===o(b)&&c(b),V(Y)}else c(b);_=o(b)}if(_!==null)ut=!0;else{var L=o(y);L!==null&&Dt(q,L.startTime-Y),ut=!1}}break t}finally{_=null,w=at,H=!1}ut=void 0}}finally{ut?k():R=!1}}}var k;if(typeof W=="function")k=function(){W(p)};else if(typeof MessageChannel<"u"){var tt=new MessageChannel,rt=tt.port2;tt.port1.onmessage=p,k=function(){rt.postMessage(null)}}else k=function(){G(p,0)};function Tt(){R||(R=!0,k())}function Dt(Y,ut){K=G(function(){Y(l.unstable_now())},ut)}l.unstable_IdlePriority=5,l.unstable_ImmediatePriority=1,l.unstable_LowPriority=4,l.unstable_NormalPriority=3,l.unstable_Profiling=null,l.unstable_UserBlockingPriority=2,l.unstable_cancelCallback=function(Y){Y.callback=null},l.unstable_continueExecution=function(){M||H||(M=!0,Tt())},l.unstable_forceFrameRate=function(Y){0>Y||125<Y?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P=0<Y?Math.floor(1e3/Y):5},l.unstable_getCurrentPriorityLevel=function(){return w},l.unstable_getFirstCallbackNode=function(){return o(b)},l.unstable_next=function(Y){switch(w){case 1:case 2:case 3:var ut=3;break;default:ut=w}var at=w;w=ut;try{return Y()}finally{w=at}},l.unstable_pauseExecution=function(){},l.unstable_requestPaint=function(){},l.unstable_runWithPriority=function(Y,ut){switch(Y){case 1:case 2:case 3:case 4:case 5:break;default:Y=3}var at=w;w=Y;try{return ut()}finally{w=at}},l.unstable_scheduleCallback=function(Y,ut,at){var ct=l.unstable_now();switch(typeof at=="object"&&at!==null?(at=at.delay,at=typeof at=="number"&&0<at?ct+at:ct):at=ct,Y){case 1:var S=-1;break;case 2:S=250;break;case 5:S=1073741823;break;case 4:S=1e4;break;default:S=5e3}return S=at+S,Y={id:O++,callback:ut,priorityLevel:Y,startTime:at,expirationTime:S,sortIndex:-1},at>ct?(Y.sortIndex=at,i(y,Y),o(b)===null&&Y===o(y)&&(A?(X(K),K=-1):A=!0,Dt(q,at-ct))):(Y.sortIndex=S,i(b,Y),M||H||(M=!0,Tt())),Y},l.unstable_shouldYield=Q,l.unstable_wrapCallback=function(Y){var ut=w;return function(){var at=w;w=ut;try{return Y.apply(this,arguments)}finally{w=at}}}})(es)),es}var j0;function kg(){return j0||(j0=1,ts.exports=Vg()),ts.exports}var ns={exports:{}},mt={};/**
* @license React
* react.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var L0;function Xg(){if(L0)return mt;L0=1;var l=Symbol.for("react.transitional.element"),i=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),c=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),d=Symbol.for("react.consumer"),m=Symbol.for("react.context"),v=Symbol.for("react.forward_ref"),b=Symbol.for("react.suspense"),y=Symbol.for("react.memo"),O=Symbol.for("react.lazy"),_=Symbol.iterator;function w(S){return S===null||typeof S!="object"?null:(S=_&&S[_]||S["@@iterator"],typeof S=="function"?S:null)}var H={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},M=Object.assign,A={};function G(S,L,lt){this.props=S,this.context=L,this.refs=A,this.updater=lt||H}G.prototype.isReactComponent={},G.prototype.setState=function(S,L){if(typeof S!="object"&&typeof S!="function"&&S!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,S,L,"setState")},G.prototype.forceUpdate=function(S){this.updater.enqueueForceUpdate(this,S,"forceUpdate")};function X(){}X.prototype=G.prototype;function W(S,L,lt){this.props=S,this.context=L,this.refs=A,this.updater=lt||H}var V=W.prototype=new X;V.constructor=W,M(V,G.prototype),V.isPureReactComponent=!0;var q=Array.isArray,R={H:null,A:null,T:null,S:null},K=Object.prototype.hasOwnProperty;function P(S,L,lt,it,J,vt){return lt=vt.ref,{$$typeof:l,type:S,key:L,ref:lt!==void 0?lt:null,props:vt}}function ft(S,L){return P(S.type,L,void 0,void 0,void 0,S.props)}function Q(S){return typeof S=="object"&&S!==null&&S.$$typeof===l}function p(S){var L={"=":"=0",":":"=2"};return"$"+S.replace(/[=:]/g,function(lt){return L[lt]})}var k=/\/+/g;function tt(S,L){return typeof S=="object"&&S!==null&&S.key!=null?p(""+S.key):L.toString(36)}function rt(){}function Tt(S){switch(S.status){case"fulfilled":return S.value;case"rejected":throw S.reason;default:switch(typeof S.status=="string"?S.then(rt,rt):(S.status="pending",S.then(function(L){S.status==="pending"&&(S.status="fulfilled",S.value=L)},function(L){S.status==="pending"&&(S.status="rejected",S.reason=L)})),S.status){case"fulfilled":return S.value;case"rejected":throw S.reason}}throw S}function Dt(S,L,lt,it,J){var vt=typeof S;(vt==="undefined"||vt==="boolean")&&(S=null);var dt=!1;if(S===null)dt=!0;else switch(vt){case"bigint":case"string":case"number":dt=!0;break;case"object":switch(S.$$typeof){case l:case i:dt=!0;break;case O:return dt=S._init,Dt(dt(S._payload),L,lt,it,J)}}if(dt)return J=J(S),dt=it===""?"."+tt(S,0):it,q(J)?(lt="",dt!=null&&(lt=dt.replace(k,"$&/")+"/"),Dt(J,L,lt,"",function($t){return $t})):J!=null&&(Q(J)&&(J=ft(J,lt+(J.key==null||S&&S.key===J.key?"":(""+J.key).replace(k,"$&/")+"/")+dt)),L.push(J)),1;dt=0;var re=it===""?".":it+":";if(q(S))for(var Et=0;Et<S.length;Et++)it=S[Et],vt=re+tt(it,Et),dt+=Dt(it,L,lt,vt,J);else if(Et=w(S),typeof Et=="function")for(S=Et.call(S),Et=0;!(it=S.next()).done;)it=it.value,vt=re+tt(it,Et++),dt+=Dt(it,L,lt,vt,J);else if(vt==="object"){if(typeof S.then=="function")return Dt(Tt(S),L,lt,it,J);throw L=String(S),Error("Objects are not valid as a React child (found: "+(L==="[object Object]"?"object with keys {"+Object.keys(S).join(", ")+"}":L)+"). If you meant to render a collection of children, use an array instead.")}return dt}function Y(S,L,lt){if(S==null)return S;var it=[],J=0;return Dt(S,it,"","",function(vt){return L.call(lt,vt,J++)}),it}function ut(S){if(S._status===-1){var L=S._result;L=L(),L.then(function(lt){(S._status===0||S._status===-1)&&(S._status=1,S._result=lt)},function(lt){(S._status===0||S._status===-1)&&(S._status=2,S._result=lt)}),S._status===-1&&(S._status=0,S._result=L)}if(S._status===1)return S._result.default;throw S._result}var at=typeof reportError=="function"?reportError:function(S){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var L=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof S=="object"&&S!==null&&typeof S.message=="string"?String(S.message):String(S),error:S});if(!window.dispatchEvent(L))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",S);return}console.error(S)};function ct(){}return mt.Children={map:Y,forEach:function(S,L,lt){Y(S,function(){L.apply(this,arguments)},lt)},count:function(S){var L=0;return Y(S,function(){L++}),L},toArray:function(S){return Y(S,function(L){return L})||[]},only:function(S){if(!Q(S))throw Error("React.Children.only expected to receive a single React element child.");return S}},mt.Component=G,mt.Fragment=o,mt.Profiler=s,mt.PureComponent=W,mt.StrictMode=c,mt.Suspense=b,mt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=R,mt.act=function(){throw Error("act(...) is not supported in production builds of React.")},mt.cache=function(S){return function(){return S.apply(null,arguments)}},mt.cloneElement=function(S,L,lt){if(S==null)throw Error("The argumeLine truncated
* @license React
* react-dom.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var G0;function Qg(){if(G0)return he;G0=1;var l=ws();function i(b){var y="https://react.dev/errors/"+b;if(1<arguments.length){y+="?args[]="+encodeURIComponent(arguments[1]);for(var O=2;O<arguments.length;O++)y+="&args[]="+encodeURIComponent(arguments[O])}return"Minified React error #"+b+"; visit "+y+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(){}var c={d:{f:o,r:function(){throw Error(i(522))},D:o,C:o,L:o,m:o,X:o,S:o,M:o},p:0,findDOMNode:null},s=Symbol.for("react.portal");function d(b,y,O){var _=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:_==null?null:""+_,children:b,containerInfo:y,implementation:O}}var m=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function v(b,y){if(b==="font")return"";if(typeof y=="string")return y==="use-credentials"?y:""}return he.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=c,he.createPortal=function(b,y){var O=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!y||y.nodeType!==1&&y.nodeType!==9&&y.nodeType!==11)throw Error(i(299));return d(b,y,null,O)},he.flushSync=function(b){var y=m.T,O=c.p;try{if(m.T=null,c.p=2,b)return b()}finally{m.T=y,c.p=O,c.d.f()}},he.preconnect=function(b,y){typeof b=="string"&&(y?(y=y.crossOrigin,y=typeof y=="string"?y==="use-credentials"?y:"":void 0):y=null,c.d.C(b,y))},he.prefetchDNS=function(b){typeof b=="string"&&c.d.D(b)},he.preinit=function(b,y){if(typeof b=="string"&&y&&typeof y.as=="string"){var O=y.as,_=v(O,y.crossOrigin),w=typeof y.integrity=="string"?y.integrity:void 0,H=typeof y.fetchPriority=="string"?y.fetchPriority:void 0;O==="style"?c.d.S(b,typeof y.precedence=="string"?y.precedence:void 0,{crossOrigin:_,integrity:w,fetchPriority:H}):O==="script"&&c.d.X(b,{crossOrigin:_,integrity:w,fetchPriority:H,nonce:typeof y.nonce=="string"?y.nonce:void 0})}},he.preinitModule=function(b,y){if(typeof b=="string")if(typeof y=="object"&&y!==null){if(y.as==null||y.as==="script"){var O=v(y.as,y.crossOrigin);c.d.M(b,{crossOrigin:O,integrity:typeof y.integrity=="string"?y.integrity:void 0,nonce:typeof y.nonce=="string"?y.nonce:void 0})}}else y==null&&c.d.M(b)},he.preload=function(b,y){if(typeof b=="string"&&typeof y=="object"&&y!==null&&typeof y.as=="string"){var O=y.as,_=v(O,y.crossOrigin);c.d.L(b,O,{crossOrigin:_,integrity:typeof y.integrity=="string"?y.integrity:void 0,nonce:typeof y.nonce=="string"?y.nonce:void 0,type:typeof y.type=="string"?y.type:void 0,fetchPriority:typeof y.fetchPriority=="string"?y.fetchPriority:void 0,referrerPolicy:typeof y.referrerPolicy=="string"?y.referrerPolicy:void 0,imageSrcSet:typeof y.imageSrcSet=="string"?y.imageSrcSet:void 0,imageSizes:typeof y.imageSizes=="string"?y.imageSizes:void 0,media:typeof y.media=="string"?y.media:void 0})}},he.preloadModule=function(b,y){if(typeof b=="string")if(y){var O=v(y.as,y.crossOrigin);c.d.m(b,{as:typeof y.as=="string"&&y.as!=="script"?y.as:void 0,crossOrigin:O,integrity:typeof y.integrity=="string"?y.integrity:void 0})}else c.d.m(b)},he.requestFormReset=function(b){c.d.r(b)},he.unstable_batchedUpdates=function(b,y){return b(y)},he.useFormState=function(b,y,O){return m.H.useFormState(b,y,O)},he.useFormStatus=function(){return m.H.useHostTransitionStatus()},he.version="19.0.0",he}var Y0;function Zg(){if(Y0)return as.exports;Y0=1;function l(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(l)}catch(i){console.error(i)}}return l(),as.exports=Qg(),as.exports}/**
* @license React
* react-dom-client.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var $0;function Kg(){if($0)return qi;$0=1;var l=kg(),i=ws(),o=Zg();function c(t){var e="https://react.dev/errors/"+t;if(1<arguments.length){e+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)e+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}var d=Symbol.for("react.element"),m=Symbol.for("react.transitional.element"),v=Symbol.for("react.portal"),b=Symbol.for("react.fragment"),y=Symbol.for("react.strict_mode"),O=Symbol.for("react.profiler"),_=Symbol.for("react.provider"),w=Symbol.for("react.consumer"),H=Symbol.for("react.context"),M=Symbol.for("react.forward_ref"),A=Symbol.for("react.suspense"),G=Symbol.for("react.suspense_list"),X=Symbol.for("react.memo"),W=Symbol.for("react.lazy"),V=Symbol.for("react.offscreen"),q=Symbol.for("react.memo_cache_sentinel"),R=Symbol.iterator;function K(t){return t===null||typeof t!="object"?null:(t=R&&t[R]||t["@@iterator"],typeof t=="function"?t:null)}var P=Symbol.for("react.client.reference");function ft(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===P?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case b:return"Fragment";case v:return"Portal";case O:return"Profiler";case y:return"StrictMode";case A:return"Suspense";case G:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case H:return(t.displayName||"Context")+".Provider";case w:return(t._context.displayName||"Context")+".Consumer";case M:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case X:return e=t.displayName||null,e!==null?e:ft(t.type)||"Memo";case W:e=t._payload,t=t._init;try{return ft(t(e))}catch{}}return null}var Q=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,p=Object.assign,k,tt;function rt(t){if(k===void 0)try{throw Error()}catch(n){var e=n.stack.trim().match(/\n( *(at )?)/);k=e&&e[1]||"",tt=-1<n.stack.indexOf(`
at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
`+k+t+tt}var Tt=!1;function Dt(t,e){if(!t||Tt)return"";Tt=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var a={DetermineComponentFrameRoot:function(){try{if(e){var j=function(){throw Error()};if(Object.defineProperty(j.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(j,[])}catch(B){var z=B}Reflect.construct(t,[],j)}else{try{j.call()}catch(B){z=B}t.call(j.prototype)}}else{try{throw Error()}catch(B){z=B}(j=t())&&typeof j.catch=="function"&&j.catch(function(){})}}catch(B){if(B&&z&&typeof B.stack=="string")return[B.stack,z.stack]}return[null,null]}};a.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var r=Object.getOwnPropertyDescriptor(a.DetermineComponentFrameRoot,"name");r&&r.configurable&&Object.defineProperty(a.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var u=a.DetermineComponentFrameRoot(),f=u[0],h=u[1];if(f&&h){var g=f.split(`
`),E=h.split(`
`);for(r=a=0;a<g.length&&!g[a].includes("DetermineComponentFrameRoot");)a++;for(;r<E.length&&!E[r].includes("DetermineComponentFrameRoot");)r++;if(a===g.length||r===E.length)for(a=g.length-1,r=E.length-1;1<=a&&0<=r&&g[a]!==E[r];)r--;for(;1<=a&&0<=r;a--,r--)if(g[a]!==E[r]){if(a!==1||r!==1)do if(a--,r--,0>r||g[a]!==E[r]){var N=`
`+g[a].replace(" at new "," at ");return t.displayName&&N.includes("<anonymous>")&&(N=N.replace("<anonymous>",t.displayName)),N}while(1<=a&&0<=r);break}}}finally{Tt=!1,Error.prepareStackTrace=n}return(n=t?t.displayName||t.name:"")?rt(n):""}function Y(t){switch(t.tag){case 26:case 27:case 5:return rt(t.type);case 16:return rt("Lazy");case 13:return rt("Suspense");case 19:return rt("SuspenseList");case 0:case 15:return t=Dt(t.type,!1),t;case 11:return t=Dt(t.type.render,!1),t;case 1:return t=Dt(t.type,!0),t;default:return""}}function ut(t){try{var e="";do e+=Y(t),t=t.return;while(t);return e}catch(n){return`
Error generating stack: `+n.message+`
`+n.stack}}function at(t){var e=t,n=t;if(t.alternate)for(;e.return;)e=e.return;else{t=e;do e=t,(e.flags&4098)!==0&&(n=e.return),t=e.return;while(t)}return e.tag===3?n:null}function ct(t){if(t.tag===13){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function S(t){if(at(t)!==t)throw Error(c(188))}function L(t){var e=t.alternate;if(!e){if(e=at(t),e===null)throw Error(c(188));return e!==t?null:t}for(var n=t,a=e;;){var r=n.return;if(r===null)break;var u=r.alternate;if(u===null){if(a=r.return,a!==null){n=a;continue}break}if(r.child===u.child){for(u=r.child;u;){if(u===n)return S(r),t;if(u===a)return S(r),e;u=u.sibling}throw Error(c(188))}if(n.return!==a.return)n=r,a=u;else{for(var f=!1,h=r.child;h;){if(h===n){f=!0,n=r,a=u;break}if(h===a){f=!0,a=r,n=u;break}h=h.sibling}if(!f){for(h=u.child;h;){if(h===n){f=!0,n=u,a=r;break}if(h===a){f=!0,a=u,n=r;break}h=h.sibling}if(!f)throw Error(c(189))}}if(n.alternate!==a)throw Error(c(190))}if(n.tag!==3)throw Error(c(188));return n.stateNode.current===n?t:e}function lt(t){var e=t.tag;if(e===5||e===26||e===27||e===6)return t;for(t=t.child;t!==null;){if(e=lt(t),e!==null)return e;t=t.sibling}return null}var it=Array.isArray,J=o.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,vt={pending:!1,data:null,method:null,action:null},dt=[],re=-1;function Et(t){return{current:t}}function $t(t){0>re||(t.current=dt[re],dt[re]=null,re--)}function Ht(t,e){re++,dt[re]=t.current,t.current=e}var Ne=Et(null),ma=Et(null),en=Et(null),Hn=Et(null);function Va(t,e){switch(Ht(en,e),Ht(ma,t),Ht(Ne,null),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)&&(e=e.namespaceURI)?c0(e):0;break;default:if(t=t===8?e.parentNode:e,e=t.tagName,t=t.namespaceURI)t=c0(t),e=s0(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}$t(Ne),Ht(Ne,e)}function jn(){$t(Ne),$t(ma),$t(en)}function Ln(t){t.memoizedState!==null&&Ht(Hn,t);var e=Ne.current,n=s0(e,t.type);e!==n&&(Ht(ma,t),Ht(Ne,n))}function nn(t){ma.current===t&&($t(Ne),$t(ma)),Hn.current===t&&($t(Hn),Bi._currentValue=vt)}var Gl=Object.prototype.hasOwnProperty,ka=l.unstable_scheduleCallback,Yl=l.unstable_cancelCallback,ht=l.unstable_shouldYield,vp=l.unstable_requestPaint,an=l.unstable_now,bp=l.unstable_getCurrentPriorityLevel,Fs=l.unstable_ImmediatePriority,Ps=l.unstable_UserBlockingPriority,ar=l.unstable_NormalPriority,Sp=l.unstable_LowPriority,Is=l.unstable_IdlePriority,Tp=l.log,Ep=l.unstable_setDisableYieldValue,$l=null,Ae=null;function Ap(t){if(Ae&&typeof Ae.onCommitFiberRoot=="function")try{Ae.onCommitFiberRoot($l,t,void 0,(t.current.flags&128)===128)}catch{}}function qn(t){if(typeof Tp=="function"&&Ep(t),Ae&&typeof Ae.setStrictMode=="function")try{Ae.setStrictMode($l,t)}catch{}}var xe=Math.clz32?Math.clz32:Cp,xp=Math.log,_p=Math.LN2;function Cp(t){return t>>>=0,t===0?32:31-(xp(t)/_p|0)|0}var lr=128,ir=4194304;function pa(t){var e=t&42;if(e!==0)return e;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194176;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function rr(t,e){var n=t.pendingLanes;if(n===0)return 0;var a=0,r=t.suspendedLanes,u=t.pingedLanes,f=t.warmLanes;t=t.finishedLanes!==0;var h=n&134217727;return h!==0?(n=h&~r,n!==0?a=pa(n):(u&=h,u!==0?a=pa(u):t||(f=h&~f,f!==0&&(a=pa(f))))):(h=n&~r,h!==0?a=pa(h):u!==0?a=pa(u):t||(f=n&~f,f!==0&&(a=pa(f)))),a===0?0:e!==0&&e!==a&&(e&r)===0&&(r=a&-a,f=e&-e,r>=f||r===32&&(f&4194176)!==0)?e:a}function Vl(t,e){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&e)===0}function Op(t,e){switch(t){case 1:case 2:case 4:case 8:return e+250;case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function tf(){var t=lr;return lr<<=1,(lr&4194176)===0&&(lr=128),t}function ef(){var t=ir;return ir<<=1,(ir&62914560)===0&&(ir=4194304),t}function Qu(t){for(var e=[],n=0;31>n;n++)e.push(t);return e}function kl(t,e){t.pendingLanes|=e,e!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function Rp(t,e,n,a,r,u){var f=t.pendingLanes;t.pendingLanes=n,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=n,t.entangledLanes&=n,t.errorRecoveryDisabledLanes&=n,t.shellSuspendCounter=0;var h=t.entanglements,g=t.expirationTimes,E=t.hiddenUpdates;for(n=f&~n;0<n;){var N=3 Line truncated
`).replace(og,"")}function o0(t,e){return e=u0(e),u0(t)===e}function tu(){}function wt(t,e,n,a,r,u){switch(n){case"children":typeof a=="string"?e==="body"||e==="textarea"&&a===""||Ja(t,a):(typeof a=="number"||typeof a=="bigint")&&e!=="body"&&Ja(t,""+a);break;case"className":or(t,"class",a);break;case"tabIndex":or(t,"tabindex",a);break;case"dir":case"role":case"viewBox":case"width":case"height":or(t,n,a);break;case"style":vf(t,a,u);break;case"data":if(e!=="object"){or(t,"data",a);break}case"src":case"href":if(a===""&&(e!=="a"||n!=="href")){t.removeAttribute(n);break}if(a==null||typeof a=="function"||typeof a=="symbol"||typeof a=="boolean"){t.removeAttribute(n);break}a=fr(""+a),t.setAttribute(n,a);break;case"action":case"formAction":if(typeof a=="function"){t.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof u=="function"&&(n==="formAction"?(e!=="input"&&wt(t,e,"name",r.name,r,null),wt(t,e,"formEncType",r.formEncType,r,null),wt(t,e,"formMethod",r.formMethod,r,null),wt(t,e,"formTarget",r.formTarget,r,null)):(wt(t,e,"encType",r.encType,r,null),wt(t,e,"method",r.method,r,null),wt(t,e,"target",r.target,r,null)));if(a==null||typeof a=="symbol"||typeof a=="boolean"){t.removeAttribute(n);break}a=fr(""+a),t.setAttribute(n,a);break;case"onClick":a!=null&&(t.onclick=tu);break;case"onScroll":a!=null&&bt("scroll",t);break;case"onScrollEnd":a!=null&&bt("scrollend",t);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(c(61));if(n=a.__html,n!=null){if(r.children!=null)throw Error(c(60));t.innerHTML=n}}break;case"multiple":t.multiple=a&&typeof a!="function"&&typeof a!="symbol";break;case"muted":t.muted=a&&typeof a!="function"&&typeof a!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(a==null||typeof a=="function"||typeof a=="boolean"||typeof a=="symbol"){t.removeAttribute("xlink:href");break}n=fr(""+a),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":a!=null&&typeof a!="function"&&typeof a!="symbol"?t.setAttribute(n,""+a):t.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":a&&typeof a!="function"&&typeof a!="symbol"?t.setAttribute(n,""):t.removeAttribute(n);break;case"capture":case"download":a===!0?t.setAttribute(n,""):a!==!1&&a!=null&&typeof a!="function"&&typeof a!="symbol"?t.setAttribute(n,a):t.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":a!=null&&typeof a!="function"&&typeof a!="symbol"&&!isNaN(a)&&1<=a?t.setAttribute(n,a):t.removeAttribute(n);break;case"rowSpan":case"start":a==null||typeof a=="function"||typeof a=="symbol"||isNaN(a)?t.removeAttribute(n):t.setAttribute(n,a);break;case"popover":bt("beforetoggle",t),bt("toggle",t),ur(t,"popover",a);break;case"xlinkActuate":yn(t,"http://www.w3.org/1999/xlink","xlink:actuate",a);break;case"xlinkArcrole":yn(t,"http://www.w3.org/1999/xlink","xlink:arcrole",a);break;case"xlinkRole":yn(t,"http://www.w3.org/1999/xlink","xlink:role",a);break;case"xlinkShow":yn(t,"http://www.w3.org/1999/xlink","xlink:show",a);break;case"xlinkTitle":yn(t,"http://www.w3.org/1999/xlink","xlink:title",a);break;case"xlinkType":yn(t,"http://www.w3.org/1999/xlink","xlink:type",a);break;case"xmlBase":yn(t,"http://www.w3.org/XML/1998/namespace","xml:base",a);break;case"xmlLang":yn(t,"http://www.w3.org/XML/1998/namespace","xml:lang",a);break;case"xmlSpace":yn(t,"http://www.w3.org/XML/1998/namespace","xml:space",a);break;case"is":ur(t,"is",a);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=jp.get(n)||n,ur(t,n,a))}}function Hc(t,e,n,a,r,u){switch(n){case"style":vf(t,a,u);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(c(61));if(n=a.__html,n!=null){if(r.children!=null)throw Error(c(60));t.innerHTML=n}}break;case"children":typeof a=="string"?Ja(t,a):(typeof a=="number"||typeof a=="bigint")&&Ja(t,""+a);break;case"onScroll":a!=null&&bt("scroll",t);break;case"onScrollEnd":a!=null&&bt("scrollend",t);break;case"onClick":a!=null&&(t.onclick=tu);break;case"suppressContentEditableWarning":case"suppressHydrationWar Line truncated
* react-is.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Z0;function Ov(){if(Z0)return Ot;Z0=1;var l=typeof Symbol=="function"&&Symbol.for,i=l?Symbol.for("react.element"):60103,o=l?Symbol.for("react.portal"):60106,c=l?Symbol.for("react.fragment"):60107,s=l?Symbol.for("react.strict_mode"):60108,d=l?Symbol.for("react.profiler"):60114,m=l?Symbol.for("react.provider"):60109,v=l?Symbol.for("react.context"):60110,b=l?Symbol.for("react.async_mode"):60111,y=l?Symbol.for("react.concurrent_mode"):60111,O=l?Symbol.for("react.forward_ref"):60112,_=l?Symbol.for("react.suspense"):60113,w=l?Symbol.for("react.suspense_list"):60120,H=l?Symbol.for("react.memo"):60115,M=l?Symbol.for("react.lazy"):60116,A=l?Symbol.for("react.block"):60121,G=l?Symbol.for("react.fundamental"):60117,X=l?Symbol.for("react.responder"):60118,W=l?Symbol.for("react.scope"):60119;function V(R){if(typeof R=="object"&&R!==null){var K=R.$$typeof;switch(K){case i:switch(R=R.type,R){case b:case y:case c:case d:case s:case _:return R;default:switch(R=R&&R.$$typeof,R){case v:case O:case M:case H:case m:return R;default:return K}}case o:return K}}}function q(R){return V(R)===y}return Ot.AsyncMode=b,Ot.ConcurrentMode=y,Ot.ContextConsumer=v,Ot.ContextProvider=m,Ot.Element=i,Ot.ForwardRef=O,Ot.Fragment=c,Ot.Lazy=M,Ot.Memo=H,Ot.Portal=o,Ot.Profiler=d,Ot.StrictMode=s,Ot.Suspense=_,Ot.isAsyncMode=function(R){return q(R)||V(R)===b},Ot.isConcurrentMode=q,Ot.isContextConsumer=function(R){return V(R)===v},Ot.isContextProvider=function(R){return V(R)===m},Ot.isElement=function(R){return typeof R=="object"&&R!==null&&R.$$typeof===i},Ot.isForwardRef=function(R){return V(R)===O},Ot.isFragment=function(R){return V(R)===c},Ot.isLazy=function(R){return V(R)===M},Ot.isMemo=function(R){return V(R)===H},Ot.isPortal=function(R){return V(R)===o},Ot.isProfiler=function(R){return V(R)===d},Ot.isStrictMode=function(R){return V(R)===s},Ot.isSuspense=function(R){return V(R)===_},Ot.isValidElementType=function(R){return typeof R=="string"||typeof R=="function"||R===c||R===y||R===d||R===s||R===_||R===w||typeof R=="object"&&R!==null&&(R.$$typeof===M||R.$$typeof===H||R.$$typeof===m||R.$$typeof===v||R.$$typeof===O||R.$$typeof===G||R.$$typeof===X||R.$$typeof===W||R.$$typeof===A)},Ot.typeOf=V,Ot}var K0;function Rv(){return K0||(K0=1,ls.exports=Ov()),ls.exports}var is,W0;function zv(){if(W0)return is;W0=1;var l=Rv(),i={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},o={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},c={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},d={};d[l.ForwardRef]=c,d[l.Memo]=s;function m(M){return l.isMemo(M)?s:d[M.$$typeof]||i}var v=Object.defineProperty,b=Object.getOwnPropertyNames,y=Object.getOwnPropertySymbols,O=Object.getOwnPropertyDescriptor,_=Object.getPrototypeOf,w=Object.prototype;function H(M,A,G){if(typeof A!="string"){if(w){var X=_(A);X&&X!==w&&H(M,X,G)}var W=b(A);y&&(W=W.concat(y(A)));for(var V=m(M),q=m(A),R=0;R<W.length;++R){var K=W[R];if(!o[K]&&!(G&&G[K])&&!(q&&q[K])&&!(V&&V[K])){var P=O(A,K);try{v(M,K,P)}catch{}}}}return M}return is=H,is}zv();var wv=!0;function jm(l,i,o){var c="";return o.split(" ").forEach(function(s){l[s]!==void 0?i.push(l[s]+";"):s&&(c+=s+" ")}),c}var Us=function(i,o,c){var s=i.key+"-"+o.name;(c===!1||wv===!1)&&i.registered[s]===void 0&&(i.registered[s]=o.styles)},Hs=function(i,o,c){Us(i,o,c);var s=i.key+"-"+o.name;if(i.inserted[o.name]===void 0){var d=o;do i.insert(o===d?"."+s:"",d,i.sheet,!0),d=d.next;while(d!==void 0)}};function Mv(l){for(var i=0,o,c=0,s=l.length;s>=4;++c,s-=4)o=l.charCodeAt(c)&255|(l.charCodeAt(++c)&255)<<8|(l.charCodeAt(++c)&255)<<16|(l.charCodeAt(++c)&255)<<24,o=(o&65535)*1540483477+((o>>>16)*59797<<16),o^=o>>>24,i=(o&65535)*1540483477+((o>>>16)*59797<<16)^(i&65535)*1540483477+((i>>>16)*59797<<16);switch(s){case 3:i^=(l.charCodeAt(c+2)&255)<<16;case 2:i^=(l.charCodeAt(c+1)&255)<<8;case 1:i^=l.charCodeAt(c)&255,i=(i&65535)*1540483477+((i>>>16)*59797<<16)}return i^=i>>>13,i=(i&65535)*1540483477+((i>>>16)*59797<<16),((i^i>>>15)>>>0).toString(36)}var Dv={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},Bv=/[A-Z]|^ms/g,Nv=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Lm=function(i){return i.charCodeAt(1)===45},J0=functioLine truncated
* @mui/styled-engine v6.4.3
*
* @license MIT
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/function $m(l,i){return gs(l,i)}function Fv(l,i){Array.isArray(l.__emotion_styles)&&(l.__emotion_styles=i(l.__emotion_styles))}const am=[];function lm(l){return am[0]=l,Pi(am)}var us={exports:{}},Mt={};/**
* @license React
* react-is.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var im;function Pv(){if(im)return Mt;im=1;var l=Symbol.for("react.transitional.element"),i=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),c=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),d=Symbol.for("react.consumer"),m=Symbol.for("react.context"),v=Symbol.for("react.forward_ref"),b=Symbol.for("react.suspense"),y=Symbol.for("react.suspense_list"),O=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),w=Symbol.for("react.offscreen"),H=Symbol.for("react.client.reference");function M(A){if(typeof A=="object"&&A!==null){var G=A.$$typeof;switch(G){case l:switch(A=A.type,A){case o:case s:case c:case b:case y:return A;default:switch(A=A&&A.$$typeof,A){case m:case v:case _:case O:return A;case d:return A;default:return G}}case i:return G}}}return Mt.ContextConsumer=d,Mt.ContextProvider=m,Mt.Element=l,Mt.ForwardRef=v,Mt.Fragment=o,Mt.Lazy=_,Mt.Memo=O,Mt.Portal=i,Mt.Profiler=s,Mt.StrictMode=c,Mt.Suspense=b,Mt.SuspenseList=y,Mt.isContextConsumer=function(A){return M(A)===d},Mt.isContextProvider=function(A){return M(A)===m},Mt.isElement=function(A){return typeof A=="object"&&A!==null&&A.$$typeof===l},Mt.isForwardRef=function(A){return M(A)===v},Mt.isFragment=function(A){return M(A)===o},Mt.isLazy=function(A){return M(A)===_},Mt.isMemo=function(A){return M(A)===O},Mt.isPortal=function(A){return M(A)===i},Mt.isProfiler=function(A){return M(A)===s},Mt.isStrictMode=function(A){return M(A)===c},Mt.isSuspense=function(A){return M(A)===b},Mt.isSuspenseList=function(A){return M(A)===y},Mt.isValidElementType=function(A){return typeof A=="string"||typeof A=="function"||A===o||A===s||A===c||A===b||A===y||A===w||typeof A=="object"&&A!==null&&(A.$$typeof===_||A.$$typeof===O||A.$$typeof===m||A.$$typeof===d||A.$$typeof===v||A.$$typeof===H||A.getModuleId!==void 0)},Mt.typeOf=M,Mt}var rm;function Iv(){return rm||(rm=1,us.exports=Pv()),us.exports}var Vm=Iv();function hn(l){if(typeof l!="object"||l===null)return!1;const i=Object.getPrototypeOf(l);return(i===null||i===Object.prototype||Object.getPrototypeOf(i)===null)&&!(Symbol.toStringTag in l)&&!(Symbol.iterator in l)}function km(l){if($.isValidElement(l)||Vm.isValidElementType(l)||!hn(l))return l;const i={};return Object.keys(l).forEach(o=>{i[o]=km(l[o])}),i}function Be(l,i,o={clone:!0}){const c=o.clone?{...l}:l;return hn(l)&&hn(i)&&Object.keys(i).forEach(s=>{$.isValidElement(i[s])||Vm.isValidElementType(i[s])?c[s]=i[s]:hn(i[s])&&Object.prototype.hasOwnProperty.call(l,s)&&hn(l[s])?c[s]=Be(l[s],i[s],o):o.clone?c[s]=hn(i[s])?km(i[s]):i[s]:c[s]=i[s]}),c}const tb=l=>{const i=Object.keys(l).map(o=>({key:o,val:l[o]}))||[];return i.sort((o,c)=>o.val-c.val),i.reduce((o,c)=>({...o,[c.key]:c.val}),{})};function eb(l){const{values:i={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:o="px",step:c=5,...s}=l,d=tb(i),m=Object.keys(d);function v(w){return`@media (min-width:${typeof i[w]=="number"?i[w]:w}${o})`}function b(w){return`@media (max-width:${(typeof i[w]=="number"?i[w]:w)-c/100}${o})`}function y(w,H){const M=m.indexOf(H);return`@media (min-width:${typeof i[w]=="number"?i[w]:w}${o}) and (max-width:${(M!==-1&&typeof i[m[M]]=="number"?i[m[M]]:H)-c/100}${o})`}function O(w){return m.indexOf(w)+1<m.length?y(w,m[m.indexOf(w)+1]):v(w)}function _(w){const H=m.indexOf(w);return H===0?v(m[1]):H===m.length-1?b(m[H]):y(w,m[m.indexOf(w)+1]).replace("@media","@media not all and")}return{keys:m,values:d,up:v,down:b,between:y,only:O,not:_,unit:o,...s}}function nb(l,i){if(!l.containerQueries)return i;const o=Object.keys(i).filter(c=>c.startsWith("@container")).sort((c,s)=>{const d=/min-width:\s*([0-9.]+)/;return+(c.match(d)?.[1]||0)-+(s.match(d)?.[1]||0)});return o.length?o.reduce((c,s)=>{const d=i[s];return delete c[s],c[s]=d,c},{...i}):i}function ab(l,i){return i==="@"||i.startsWith("@")&&(l.some(o=>i.startsWith(`@${o}`))||!!i.match(/^@\d/))}function lb(l,i){const o=i.match(/^@([^/]+)?\/?(.+)?$/);if(!o)return null;const[,c,s]=o,d=Number.isNaN(+c)?c||0:+c;return l.containerQueries(s).up(d)}function ib(l){const i=(d,m)=>d.replace("@media",m?`@container ${m}`:"@container");function o(d,m){d.up=(...v)=>i(l.breakpoints.up(...v),m),d.down=(...v)=>i(l.breakpoints.down(...v),m),d.between=(...v)=>i(l.breakpoints.between(...v),m),d.only=(...v)=>i(l.breakpoints.only(...v),m),d.not=(...v)=>{const b=i(l.breakpoints.not(...v),m);return b.includes("not all and")?b.replace("not all and ","").replace("min-width:","width<").replace("max-width:","width>").replace("and","or"):b}}const c={},s=d=>(o(c,d),c);return o(s),{...l,containerQueries:s}}const rb={borderRadius:4};function ki(l,i){return i?Be(l,i,{clone:!1}):l}const Hu={xs:0,sm:600,md:900,lg:1200,xl:1536},um={keys:["xs","sm","md","lg","xl"],up:l=>`@media (min-width:${Hu[l]}px)`},ub={containerQueries:l=>({up:i=>{let o=typeof i=="number"?i:Hu[i]||i;return typeof o=="number"&&(o=`${o}px`),l?`@container ${l} (min-width:${o})`:`@container (min-width:${o})`}})};function Un(l,i,o){const c=l.theme||{};if(Array.isArray(i)){const d=c.breakpoints||um;return i.redLine truncated
const theme = ${JSON.stringify(i,null,2)};
theme.breakpoints = createBreakpoints(theme.breakpoints || {});
theme.transitions = createTransitions(theme.transitions || {});
export default theme;`}function bs(l={},...i){const{breakpoints:o,mixins:c={},spacing:s,palette:d={},transitions:m={},typography:v={},shape:b,...y}=l;if(l.vars)throw new Error(qa(20));const O=Qs(d),_=Vs(l);let w=Be(_,{mixins:k1(_.breakpoints,c),palette:O,shadows:J1.slice(),typography:Q1(O,v),transitions:tS(m),zIndex:{...eS}});return w=Be(w,y),w=i.reduce((H,M)=>Be(H,M),w),w.unstable_sxConfig={...er,...y?.unstable_sxConfig},w.unstable_sx=function(M){return Ga({sx:M,theme:this})},w.toRuntimeSource=ap,w}function aS(l){let i;return l<1?i=5.11916*l**2:i=4.5*Math.log(l+1)+2,Math.round(i*10)/1e3}const lS=[...Array(25)].map((l,i)=>{if(i===0)return"none";const o=aS(i);return`linear-gradient(rgba(255 255 255 / ${o}), rgba(255 255 255 / ${o}))`});function lp(l){return{inputPlaceholder:l==="dark"?.5:.42,inputUnderline:l==="dark"?.7:.42,switchTrackDisabled:l==="dark"?.2:.12,switchTrack:l==="dark"?.3:.38}}function ip(l){return l==="dark"?lS:[]}function iS(l){const{palette:i={mode:"light"},opacity:o,overlays:c,...s}=l,d=Qs(i);return{palette:d,opacity:{...lp(d.mode),...o},overlays:c||ip(d.mode),...s}}function rS(l){return!!l[0].match(/(cssVarPrefix|colorSchemeSelector|rootSelector|typography|mixins|breakpoints|direction|transitions)/)||!!l[0].match(/sxConfig$/)||l[0]==="palette"&&!!l[1]?.match(/(mode|contrastThreshold|tonalOffset)/)}const uS=l=>[...[...Array(25)].map((i,o)=>`--${l?`${l}-`:""}overlays-${o}`),`--${l?`${l}-`:""}palette-AppBar-darkBg`,`--${l?`${l}-`:""}palette-AppBar-darkColor`],oS=l=>(i,o)=>{const c=l.rootSelector||":root",s=l.colorSchemeSelector;let d=s;if(s==="class"&&(d=".%s"),s==="data"&&(d="[data-%s]"),s?.startsWith("data-")&&!s.includes("%s")&&(d=`[${s}="%s"]`),l.defaultColorScheme===i){if(i==="dark"){const m={};return uS(l.cssVarPrefix).forEach(v=>{m[v]=o[v],delete o[v]}),d==="media"?{[c]:o,"@media (prefers-color-scheme: dark)":{[c]:m}}:d?{[d.replace("%s",i)]:m,[`${c}, ${d.replace("%s",i)}`]:o}:{[c]:{...o,...m}}}if(d&&d!=="media")return`${c}, ${d.replace("%s",String(i))}`}else if(i){if(d==="media")return{[`@media (prefers-color-scheme: ${String(i)})`]:{[c]:o}};if(d)return d.replace("%s",String(i))}return c};function cS(l,i){i.forEach(o=>{l[o]||(l[o]={})})}function D(l,i,o){!l[i]&&o&&(l[i]=o)}function Vi(l){return typeof l!="string"||!l.startsWith("hsl")?l:Im(l)}function Dn(l,i){`${i}Channel`in l||(l[`${i}Channel`]=$i(Vi(l[i])))}function sS(l){return typeof l=="number"?`${l}px`:typeof l=="string"||typeof l=="function"||Array.isArray(l)?l:"8px"}const sn=l=>{try{return l()}catch{}},fS=(l="mui")=>M1(l);function ss(l,i,o,c){if(!i)return;i=i===!0?{}:i;const s=c==="dark"?"dark":"light";if(!o){l[c]=iS({...i,palette:{mode:s,...i?.palette}});return}const{palette:d,...m}=bs({...o,palette:{mode:s,...i?.palette}});return l[c]={...i,palette:d,opacity:{...lp(s),...i?.opacity},overlays:i?.overlays||ip(s)},m}function dS(l={},...i){const{colorSchemes:o={light:!0},defaultColorScheme:c,disableCssColorScheme:s=!1,cssVarPrefix:d="mui",shouldSkipGeneratingVar:m=rS,colorSchemeSelector:v=o.light&&o.dark?"media":void 0,rootSelector:b=":root",...y}=l,O=Object.keys(o)[0],_=c||(o.light&&O!=="light"?"light":O),w=fS(d),{[_]:H,light:M,dark:A,...G}=o,X={...G};let W=H;if((_==="dark"&&!("dark"in o)||_==="light"&&!("light"in o))&&(W=!0),!W)throw new Error(qa(21,_));const V=ss(X,W,y,_);M&&!X.light&&ss(X,M,void 0,"light"),A&&!X.dark&&ss(X,A,void 0,"dark");let q={defaultColorScheme:_,...V,cssVarPrefix:d,colorSchemeSelector:v,rootSelector:b,getCssVar:w,colorSchemes:X,font:{...V1(V.typography),...V.font},spacing:sS(y.spacing)};Object.keys(q.colorSchemes).forEach(Q=>{const p=q.colorSchemes[Q].palette,k=tt=>{const rt=tt.split("-"),Tt=rt[1],Dt=rt[2];return w(tt,p[Tt][Dt])};if(p.mode==="light"&&(D(p.common,"background","#fff"),D(p.common,"onBackground","#000")),p.mode==="dark"&&(D(p.common,"background","#000"),D(p.common,"onBackground","#fff")),cS(p,["Alert","AppBar","Avatar","Button","Chip","FilledInput","LinearProgress","Skeleton","Slider","SnackbarContent","SpeedDialAction","StepConnector","StepContent","Switch","TableCell","Tooltip"]),p.mode==="light"){D(p.Alert,"errorColor",Nt(p.error.light,.6)),D(p.Alert,"infoColor",Nt(p.info.light,.6)),D(p.Alert,"successColor",Nt(p.success.light,.6)),D(p.Alert,"warningColor",Nt(p.warning.light,.6)),D(p.Alert,"errorFilledBg",k("palette-error-main")),D(p.Alert,"infoFilledBg",k("palette-info-main")),D(p.Alert,"successFilledBg",k("palette-success-main")),D(p.Alert,"warningFilledBg",k("palette-warning-main")),D(p.Alert,"errorFilledColor",sn(()=>p.getContrastText(p.error.main))),D(p.Alert,"infoFilledColor",sn(()=>p.getContrastText(p.info.main))),D(p.Alert,"successFilledColor",sn(()=>p.getContrastText(p.success.main))),D(p.Alert,"warningFilledColor",sn(()=>p.getContrastText(p.warning.main))),D(p.Alert,"errorStandardBg",Ut(p.error.light,.9)),D(p.Alert,"infoStandardBg",Ut(p.info.light,.9)),D(p.Alert,"successStandardBg",Ut(p.success.light,.9)),D(p.Alert,"warningStandardBg",Ut(p.warning.light,.9)),D(p.Alert,"errorIco Line truncated
0% {
transform: scale(0);
opacity: 0.1;
}
100% {
transform: scale(1);
opacity: 0.3;
}
`,zS=da`
0% {
opacity: 1;
}
100% {
opacity: 0;
}
`,wS=da`
0% {
transform: scale(1);
}
50% {
transform: scale(0.92);
}
100% {
transform: scale(1);
}
`,MS=ye("span",{name:"MuiTouchRipple",slot:"Root"})({overflow:"hidden",pointerEvents:"none",position:"absolute",zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:"inherit"}),DS=ye(CS,{name:"MuiTouchRipple",slot:"Ripple"})`
opacity: 0;
position: absolute;
&.${Ze.rippleVisible} {
opacity: 0.3;
transform: scale(1);
animation-name: ${RS};
animation-duration: ${Ts}ms;
animation-timing-function: ${({theme:l})=>l.transitions.easing.easeInOut};
}
&.${Ze.ripplePulsate} {
animation-duration: ${({theme:l})=>l.transitions.duration.shorter}ms;
}
& .${Ze.child} {
opacity: 1;
display: block;
width: 100%;
height: 100%;
border-radius: 50%;
background-color: currentColor;
}
& .${Ze.childLeaving} {
opacity: 0;
animation-name: ${zS};
animation-duration: ${Ts}ms;
animation-timing-function: ${({theme:l})=>l.transitions.easing.easeInOut};
}
& .${Ze.childPulsate} {
position: absolute;
/* @noflip */
left: 0px;
top: 0;
animation-name: ${wS};
animation-duration: 2500ms;
animation-timing-function: ${({theme:l})=>l.transitions.easing.easeInOut};
animation-iteration-count: infinite;
animation-delay: 200ms;
}
`,BS=$.forwardRef(function(i,o){const c=$a({props:i,name:"MuiTouchRipple"}),{center:s=!1,classes:d={},className:m,...v}=c,[b,y]=$.useState([]),O=$.useRef(0),_=$.useRef(null);$.useEffect(()=>{_.current&&(_.current(),_.current=null)},[b]);const w=$.useRef(!1),H=x1(),M=$.useRef(null),A=$.useRef(null),G=$.useCallback(q=>{const{pulsate:R,rippleX:K,rippleY:P,rippleSize:ft,cb:Q}=q;y(p=>[...p,nt.jsx(DS,{classes:{ripple:pe(d.ripple,Ze.ripple),rippleVisible:pe(d.rippleVisible,Ze.rippleVisible),ripplePulsate:pe(d.ripplePulsate,Ze.ripplePulsate),child:pe(d.child,Ze.child),childLeaving:pe(d.childLeaving,Ze.childLeaving),childPulsate:pe(d.childPulsate,Ze.childPulsate)},timeout:Ts,pulsate:R,rippleX:K,rippleY:P,rippleSize:ft},O.current)]),O.current+=1,_.current=Q},[d]),X=$.useCallback((q={},R={},K=()=>{})=>{const{pulsate:P=!1,center:ft=s||R.pulsate,fakeElement:Q=!1}=R;if(q?.type==="mousedown"&&w.current){w.current=!1;return}q?.type==="touchstart"&&(w.current=!0);const p=Q?null:A.current,k=p?p.getBoundingClientRect():{width:0,height:0,left:0,top:0};let tt,rt,Tt;if(ft||q===void 0||q.clientX===0&&q.clientY===0||!q.clientX&&!q.touches)tt=Math.round(k.width/2),rt=Math.round(k.height/2);else{const{clientX:Dt,clientY:Y}=q.touches&&q.touches.length>0?q.touches[0]:q;tt=Math.round(Dt-k.left),rt=Math.round(Y-k.top)}if(ft)Tt=Math.sqrt((2*k.width**2+k.height**2)/3),Tt%2===0&&(Tt+=1);else{const Dt=Math.max(Math.abs((p?p.clientWidth:0)-tt),tt)*2+2,Y=Math.max(Math.abs((p?p.clientHeight:0)-rt),rt)*2+2;Tt=Math.sqrt(Dt**2+Y**2)}q?.touches?M.current===null&&(M.current=()=>{G({pulsate:P,rippleX:tt,rippleY:rt,rippleSize:Tt,cb:K})},H.start(OS,()=>{M.current&&(M.current(),M.current=null)})):G({pulsate:P,rippleX:tt,rippleY:rt,rippleSize:Tt,cb:K})},[s,G,H]),W=$.useCallback(()=>{X({},{pulsate:!0})},[X]),V=$.useCallback((q,R)=>{if(H.clear(),q?.type==="touchend"&&M.current){M.current(),M.current=null,H.start(0,()=>{V(q,R)});return}M.current=null,y(K=>K.length>0?K.slice(1):K),_.current=R},[H]);return $.useImperativeHandle(o,()=>({pulsate:W,start:X,stop:V}),[W,X,V]),nt.jsx(MS,{className:pe(Ze.root,d.root,m),ref:A,...v,children:nt.jsx(Ks,{component:null,exit:!0,children:b})})});function NS(l){return ql("MuiButtonBase",l)}const US=Ya("MuiButtonBase",["root","disabled","focusVisible"]),HS=l=>{const{disabled:i,focusVisible:o,focusVisibleClassName:c,classes:s}=l,m=nr({root:["root",i&&"disabled",o&&"focusVisible"]},NS,s);return o&&c&&(m.root+=` ${c}`),m},jS=ye("button",{name:"MuiButtonBase",slot:"Root",overridesResolver:(l,i)=>i.root})({display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",boxSizing:"border-box",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},[`&.${US.disabled}`]:{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}}),LS=$.forwardRef(function(i,o){const c=$a({props:i,name:"MuiButtonBase"}),{action:s,centerRipple:d=!1,children:m,className:v,component:b="button",disabled:y=!1,disableRipple:O=!1,disableTouchRipple:_=!1,focusRipple:w=!1,focusVisibleClassName:H,LinkComponent:M="a",onBlur:A,onClick:G,onContextMenu:X,onDragLeave:W,onFocus:V,onFocusVisible:q,onKeyDown:R,onKeyUp:K,onMouseDown:P,onMouseLeave:ft,onMouseUp:Q,onTouchEnd:p,onTouchMove:k,onTouchStart:tt,tabIndex:rt=0,TouchRippleProps:Tt,touchRippleRef:Dt,type:Y,...ut}=c,at=$.useRef(null),ct=xS(),S=dm(ct.ref,Dt),[L,lt]=$.useState(!1);y&&L&&lt(!1),$.useImperativeHandle(s,()=>({focusVisible:()=>{lt(!0),at.current.focus()}}),[]);const it=ct.shouldMount&&!O&&!y;$.useEffect(()=>{L&&w&&!O&&ct.pulsate()},[O,w,L,ct]);const J=Bn(ct,"start",P,_),vt=Bn(ct,"stop",X,_),dt=Bn(ct,"stop",W,_),re=Bn(ct,"stop",Q,_),Et=Bn(ct,"stop",ht=>{L&&ht.preventDefault(),ft&&ft(ht)},_),$t=Bn(ct,"start",tt,_),Ht=Bn(ct,"stop",p,_),Ne=Bn(ct,"stop",k,_),ma=Bn(ct,"stop",ht=>{mm(ht.target)||lt(!1),A&&A(ht)},!1),en=Eu(ht=>{at.current||(at.current=ht.currentTarget),mm(ht.target)&&(lt(!0),q&&q(ht)),V&&V(ht)}),Hn=()=>{const ht=at.current;return b&&b!=="button"&&!(ht.tagName==="A"&&ht.href)},Va=Eu(ht=>{w&&!ht.repeat&&L&&ht.key===" "&&ct.stop(ht,()=>{ct.start(ht)}),ht.target===ht.currentTarget&&Hn()&&ht.key===" "&&ht.preventDefault(),R&&R(ht),ht.target===ht.currentTarget&&Hn()&&ht.key==="Enter"&&!y&&(ht.preventDefault(),G&&G(ht))}),jn=Eu(ht=>{w&&ht.key===" "&&L&&!ht.defaultPrevented&&ct.stop(ht,()=>{ct.pulsate(ht)}),K&&K(ht),G&&ht.target===ht.currentTarget&&Hn()&&ht.key===" "&&!ht.defaultPrevented&&G(ht)});let Ln=b;Ln==="button"&&(ut.href||ut.to)&&(Ln=M);const nn={};Ln==="button"?(nn.type=Y===void 0?"button":Y,nn.disabled=y):(!ut.href&&!ut.to&&(nn.role="button"),y&&(nn["aria-disabled"]=y));const Gl=dm(o,at),ka={...c,centerRipple:d,component:b,disabled:y,disableRipple:O,disableTouchRipple:_,focusRipple:w,tabIndex:rt,focusVisibl Line truncated
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
`,As=da`
0% {
stroke-dasharray: 1px, 200px;
stroke-dashoffset: 0;
}
50% {
stroke-dasharray: 100px, 200px;
stroke-dashoffset: -15px;
}
100% {
stroke-dasharray: 1px, 200px;
stroke-dashoffset: -126px;
}
`,$S=typeof Es!="string"?Ll`
animation: ${Es} 1.4s linear infinite;
`:null,VS=typeof As!="string"?Ll`
animation: ${As} 1.4s ease-in-out infinite;
`:null,kS=l=>{const{classes:i,variant:o,color:c,disableShrink:s}=l,d={root:["root",o,`color${Rt(c)}`],svg:["svg"],circle:["circle",`circle${Rt(o)}`,s&&"circleDisableShrink"]};return nr(d,YS,i)},XS=ye("span",{name:"MuiCircularProgress",slot:"Root",overridesResolver:(l,i)=>{const{ownerState:o}=l;return[i.root,i[o.variant],i[`color${Rt(o.color)}`]]}})(ha(({theme:l})=>({display:"inline-block",variants:[{props:{variant:"determinate"},style:{transition:l.transitions.create("transform")}},{props:{variant:"indeterminate"},style:$S||{animation:`${Es} 1.4s linear infinite`}},...Object.entries(l.palette).filter(fa()).map(([i])=>({props:{color:i},style:{color:(l.vars||l).palette[i].main}}))]}))),QS=ye("svg",{name:"MuiCircularProgress",slot:"Svg",overridesResolver:(l,i)=>i.svg})({display:"block"}),ZS=ye("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(l,i)=>{const{ownerState:o}=l;return[i.circle,i[`circle${Rt(o.variant)}`],o.disableShrink&&i.circleDisableShrink]}})(ha(({theme:l})=>({stroke:"currentColor",variants:[{props:{variant:"determinate"},style:{transition:l.transitions.create("stroke-dashoffset")}},{props:{variant:"indeterminate"},style:{strokeDasharray:"80px, 200px",strokeDashoffset:0}},{props:({ownerState:i})=>i.variant==="indeterminate"&&!i.disableShrink,style:VS||{animation:`${As} 1.4s ease-in-out infinite`}}]}))),KS=$.forwardRef(function(i,o){const c=$a({props:i,name:"MuiCircularProgress"}),{className:s,color:d="primary",disableShrink:m=!1,size:v=40,style:b,thickness:y=3.6,value:O=0,variant:_="indeterminate",...w}=c,H={...c,color:d,disableShrink:m,size:v,thickness:y,value:O,variant:_},M=kS(H),A={},G={},X={};if(_==="determinate"){const W=2*Math.PI*((oa-y)/2);A.strokeDasharray=W.toFixed(3),X["aria-valuenow"]=Math.round(O),A.strokeDashoffset=`${((100-O)/100*W).toFixed(3)}px`,G.transform="rotate(-90deg)"}return nt.jsx(XS,{className:pe(M.root,s),style:{width:v,height:v,...G,...b},ownerState:H,ref:o,role:"progressbar",...X,...w,children:nt.jsx(QS,{className:M.svg,ownerState:H,viewBox:`${oa/2} ${oa/2} ${oa} ${oa}`,children:nt.jsx(ZS,{className:M.circle,style:A,ownerState:H,cx:oa,cy:oa,r:(oa-y)/2,fill:"none",strokeWidth:y})})})});function WS(l){return ql("MuiTypography",l)}Ya("MuiTypography",["root","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"]);const JS={primary:!0,secondary:!0,error:!0,info:!0,success:!0,warning:!0,textPrimary:!0,textSecondary:!0,textDisabled:!0},FS=pS(),PS=l=>{const{align:i,gutterBottom:o,noWrap:c,paragraph:s,variant:d,classes:m}=l,v={root:["root",d,l.align!=="inherit"&&`align${Rt(i)}`,o&&"gutterBottom",c&&"noWrap",s&&"paragraph"]};return nr(v,WS,m)},IS=ye("span",{name:"MuiTypography",slot:"Root",overridesResolver:(l,i)=>{const{ownerState:o}=l;return[i.root,o.variant&&i[o.variant],o.align!=="inherit"&&i[`align${Rt(o.align)}`],o.noWrap&&i.noWrap,o.gutterBottom&&i.gutterBottom,o.paragraph&&i.paragraph]}})(ha(({theme:l})=>({margin:0,variants:[{props:{variant:"inherit"},style:{font:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}},...Object.entries(l.typography).filter(([i,o])=>i!=="inherit"&&o&&typeof o=="object").map(([i,o])=>({props:{variant:i},style:o})),...Object.entries(l.palette).filter(fa()).map(([i])=>({props:{color:i},style:{color:(l.vars||l).palette[i].main}})),...Object.entries(l.palette?.text||{}).filter(([,i])=>typeof i=="string").map(([i])=>({props:{color:`text${Rt(i)}`},style:{color:(l.vars||l).palette.text[i]}})),{props:({ownerState:i})=>i.align!=="inherit",style:{textAlign:"var(--Typography-textAlign)"}},{props:({ownerState:i})=>i.noWrap,style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},{props:({ownerState:i})=>i.gutterBottom,style:{marginBottom:"0.35em"}},{props:({ownerState:i})=>i.paragraph,style:{marginBottom:16}}]}))),xm={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},Ws=$.forwardRef(function(i,o){const{color:c,...s}=$a({props:i,name:"MuiTypography"}),d=!JS[c],m=FS({...s,...d&&{color:c}}),{align:v="inherit",className:b,component:y,gutterBottom:O=!1,noWrap:_=!1,paragraph:w=!1,variant:H="body1",variantMapping:M=xm,...A}=m,G={...m,align:v,color:c,className:b,component:y,gutterBottom:O,noWrap:_,paragraph:w,variant:H,variantMapping:M},X=y||(w?"p":M[H]||xm[H])||"span",W=PS(G);return nt.jsx(IS,{as:X,ref:o,className:pe(W.root,b),...A,ownerState:G,style:{...v!=="inherit"&&{"--Typography-textAlign":v},...A.style}})}),t2=Ya("MuiBox",["root"]),e2=rp(),Nn=n1({themeId:Ms,defaultTheme:e2,defaultClassName:t2.root,generateClassName:Wm.generate});function n2(l){return ql("MuiButton",l)}const ja=Ya("MuiButton",["root","text","textInherit","textPrimary","textSecondary","textSuccess","textError","textInfo","textWarning","outlined","outlinedInherit","outlinedPrimary","outlinedSecondary","outlinedSuccess","outlinedError","outlinedI Line truncated
0% {
left: -35%;
right: 100%;
}
60% {
left: 100%;
right: -90%;
}
100% {
left: 100%;
right: -90%;
}
`,g2=typeof Cs!="string"?Ll`
animation: ${Cs} 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite;
`:null,Os=da`
0% {
left: -200%;
right: 100%;
}
60% {
left: 107%;
right: -8%;
}
100% {
left: 107%;
right: -8%;
}
`,v2=typeof Os!="string"?Ll`
animation: ${Os} 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) 1.15s infinite;
`:null,Rs=da`
0% {
opacity: 1;
background-position: 0 -23px;
}
60% {
opacity: 0;
background-position: 0 -23px;
}
100% {
opacity: 1;
background-position: -200px -23px;
}
`,b2=typeof Rs!="string"?Ll`
animation: ${Rs} 3s infinite linear;
`:null,S2=l=>{const{classes:i,variant:o,color:c}=l,s={root:["root",`color${Rt(c)}`,o],dashed:["dashed",`dashedColor${Rt(c)}`],bar1:["bar","bar1",`barColor${Rt(c)}`,(o==="indeterminate"||o==="query")&&"bar1Indeterminate",o==="determinate"&&"bar1Determinate",o==="buffer"&&"bar1Buffer"],bar2:["bar","bar2",o!=="buffer"&&`barColor${Rt(c)}`,o==="buffer"&&`color${Rt(c)}`,(o==="indeterminate"||o==="query")&&"bar2Indeterminate",o==="buffer"&&"bar2Buffer"]};return nr(s,y2,i)},Js=(l,i)=>l.vars?l.vars.palette.LinearProgress[`${i}Bg`]:l.palette.mode==="light"?Xu(l.palette[i].main,.62):ku(l.palette[i].main,.5),T2=ye("span",{name:"MuiLinearProgress",slot:"Root",overridesResolver:(l,i)=>{const{ownerState:o}=l;return[i.root,i[`color${Rt(o.color)}`],i[o.variant]]}})(ha(({theme:l})=>({position:"relative",overflow:"hidden",display:"block",height:4,zIndex:0,"@media print":{colorAdjust:"exact"},variants:[...Object.entries(l.palette).filter(fa()).map(([i])=>({props:{color:i},style:{backgroundColor:Js(l,i)}})),{props:({ownerState:i})=>i.color==="inherit"&&i.variant!=="buffer",style:{"&::before":{content:'""',position:"absolute",left:0,top:0,right:0,bottom:0,backgroundColor:"currentColor",opacity:.3}}},{props:{variant:"buffer"},style:{backgroundColor:"transparent"}},{props:{variant:"query"},style:{transform:"rotate(180deg)"}}]}))),E2=ye("span",{name:"MuiLinearProgress",slot:"Dashed",overridesResolver:(l,i)=>{const{ownerState:o}=l;return[i.dashed,i[`dashedColor${Rt(o.color)}`]]}})(ha(({theme:l})=>({position:"absolute",marginTop:0,height:"100%",width:"100%",backgroundSize:"10px 10px",backgroundPosition:"0 -23px",variants:[{props:{color:"inherit"},style:{opacity:.3,backgroundImage:"radial-gradient(currentColor 0%, currentColor 16%, transparent 42%)"}},...Object.entries(l.palette).filter(fa()).map(([i])=>{const o=Js(l,i);return{props:{color:i},style:{backgroundImage:`radial-gradient(${o} 0%, ${o} 16%, transparent 42%)`}}})]})),b2||{animation:`${Rs} 3s infinite linear`}),A2=ye("span",{name:"MuiLinearProgress",slot:"Bar1",overridesResolver:(l,i)=>{const{ownerState:o}=l;return[i.bar,i.bar1,i[`barColor${Rt(o.color)}`],(o.variant==="indeterminate"||o.variant==="query")&&i.bar1Indeterminate,o.variant==="determinate"&&i.bar1Determinate,o.variant==="buffer"&&i.bar1Buffer]}})(ha(({theme:l})=>({width:"100%",position:"absolute",left:0,bottom:0,top:0,transition:"transform 0.2s linear",transformOrigin:"left",variants:[{props:{color:"inherit"},style:{backgroundColor:"currentColor"}},...Object.entries(l.palette).filter(fa()).map(([i])=>({props:{color:i},style:{backgroundColor:(l.vars||l).palette[i].main}})),{props:{variant:"determinate"},style:{transition:`transform .${_s}s linear`}},{props:{variant:"buffer"},style:{zIndex:1,transition:`transform .${_s}s linear`}},{props:({ownerState:i})=>i.variant==="indeterminate"||i.variant==="query",style:{width:"auto"}},{props:({ownerState:i})=>i.variant==="indeterminate"||i.variant==="query",style:g2||{animation:`${Cs} 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite`}}]}))),x2=ye("span",{name:"MuiLinearProgress",slot:"Bar2",overridesResolver:(l,i)=>{const{ownerState:o}=l;return[i.bar,i.bar2,i[`barColor${Rt(o.color)}`],(o.variant==="indeterminate"||o.variant==="query")&&i.bar2Indeterminate,o.variant==="buffer"&&i.bar2Buffer]}})(ha(({theme:l})=>({width:"100%",position:"absolute",left:0,bottom:0,top:0,transition:"transform 0.2s linear",transformOrigin:"left",variants:[...Object.entries(l.palette).filter(fa()).map(([i])=>({props:{color:i},style:{"--LinearProgressBar2-barColor":(l.vars||l).palette[i].main}})),{props:({ownerState:i})=>i.variant!=="buffer"&&i.color!=="inherit",style:{backgroundColor:"var(--LinearProgressBar2-barColor, currentColor)"}},{props:({ownerState:i})=>i.variant!=="buffer"&&i.color==="inherit",style:{backgroundColor:"currentColor"}},{props:{color:"inherit"},style:{opacity:.3}},...Object.entries(l.palette).filter(fa()).map(([i])=>({props:{color:i,variant:"buffer"},style:{backgroundColor:Js(l,i),transition:`transform .${_s}s linear`}})),{props:({ownerState:i})=>i.variant==="indeterminate"||i.variant==="query",style:{width:"auto"}},{props:({ownerState:i})=>i.variant==="indeterminate"||i.variant==="query",style:v2||{animation:`${Os} 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) 1.15s infinite`}}]}))),_2=$.forwardRef(function(i,o){const c=$a({props:i,name:"MuiLinearProgress"}),{className:s,color:d="primary",value:m,valueBuffer:v,variant:b="indeterminate",...y}=c,O={...c,color:d,variant:b},_=S2(O),w=C1(),H={},M={bar1:{},bar2:{}};if((b==="determinate"||b==="buffer")&&m!==void 0){H["aria-valuenow"]=Math.round(m),H["aria-valuemin"]=0,H["aria-valuemax"]=100;let A=m-100;w&&(A=-A),M.bar1.transform=`translateX(${A}%)`}if(b==="buffer"&&v!==void 0){let A=(v||0)-100;w&&(A=-A),M.bar2.transform=`translateX(${A}%)`}return nt.jsxs(T2,{className:pe(_.root,s),ownerState:O,role:"progressbar",...H,ref:o,...y,children:[b==="buffer"?nt.jsx(E2,{className:_.dashed,ownerState:O}):null,nt.jsx(A2,{className:_.bar1,own Line truncated
+2 -2
View File
@@ -4,8 +4,8 @@
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>GlobalProtect</title>
<script type="module" crossorigin src="/assets/main-zrEvn5KN.js"></script>
<title>GP Connect Helper</title>
<script type="module" crossorigin src="/assets/main-D4NFppIR.js"></script>
<link rel="stylesheet" crossorigin href="/assets/main-B3YRsHQ2.css">
</head>
<body>
+1 -1
View File
@@ -4,7 +4,7 @@
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>GlobalProtect</title>
<title>GP Connect Helper</title>
</head>
<body>
<script>
+15 -15
View File
@@ -11,27 +11,27 @@
"dependencies": {
"@emotion/react": "^11.14.0",
"@emotion/styled": "^11.14.1",
"@mui/icons-material": "^6.5.0",
"@mui/material": "^6.5.0",
"@tauri-apps/api": "^2.8.0",
"react": "^19.2.0",
"react-dom": "^19.2.0"
"@mui/icons-material": "^7.3.6",
"@mui/material": "^7.3.6",
"@tauri-apps/api": "^2.9.1",
"react": "^19.2.1",
"react-dom": "^19.2.1"
},
"devDependencies": {
"@tauri-apps/cli": "^2.8.4",
"@types/node": "^22.18.10",
"@types/react": "^19.2.2",
"@types/react-dom": "^19.2.2",
"@typescript-eslint/eslint-plugin": "^8.46.1",
"@typescript-eslint/parser": "^8.46.1",
"@vitejs/plugin-react": "^5.0.4",
"eslint": "^9.37.0",
"@tauri-apps/cli": "^2.9.5",
"@types/node": "^22.19.1",
"@types/react": "^19.2.7",
"@types/react-dom": "^19.2.3",
"@typescript-eslint/eslint-plugin": "^8.48.1",
"@typescript-eslint/parser": "^8.48.1",
"@vitejs/plugin-react": "^5.1.2",
"eslint": "^9.39.1",
"eslint-config-prettier": "^10.1.8",
"eslint-plugin-react": "^7.37.5",
"eslint-plugin-react-hooks": "^7.0.0",
"eslint-plugin-react-hooks": "^7.0.1",
"prettier": "3.4.2",
"typescript": "^5.9.3",
"vite": "^7.1.10"
"vite": "^7.2.7"
},
"packageManager": "[email protected]"
}
+619 -739
View File
File diff suppressed because it is too large. Load diff
+7 -2
View File
@@ -21,7 +21,12 @@ compile-time.workspace = true
env_logger.workspace = true
futures-util.workspace = true
tempfile.workspace = true
reqwest = { workspace = true, features = ["stream"] }
[target.'cfg(target_os="windows")'.dependencies]
reqwest = { workspace = true, features = ["native-tls-vendored", "stream"] }
[target.'cfg(target_family="unix")'.dependencies]
reqwest = { workspace = true, features = ["native-tls", "stream"] }
[features]
custom-protocol = ["tauri/custom-protocol"]
default = ["tauri/custom-protocol"]
+1 -1
View File
@@ -15,7 +15,7 @@
},
"windows": [
{
"title": "GlobalProtect GUI Helper",
"title": "GP Connect Helper",
"center": true,
"resizable": true,
"width": 500,
+1
View File
@@ -5,6 +5,7 @@ edition.workspace = true
license.workspace = true
[dependencies]
common = { path = "../../crates/common" }
gpapi = { path = "../../crates/gpapi", features = ["clap", "logger"] }
openconnect = { path = "../../crates/openconnect" }
clap.workspace = true
+2 -2
View File
@@ -3,13 +3,13 @@ use std::{collections::HashMap, io::Write};
use anyhow::bail;
use clap::Parser;
use common::constants::GP_SERVICE_LOCK_FILE;
use gpapi::clap::InfoLevelVerbosity;
use gpapi::logger;
use gpapi::{
process::gui_launcher::GuiLauncher,
service::{request::WsRequest, vpn_state::VpnState},
utils::{crypto::generate_key, env_utils, lock_file::LockFile, redact::Redaction, shutdown_signal},
GP_SERVICE_LOCK_FILE,
};
use log::{info, warn};
use tokio::sync::{mpsc, watch};
@@ -120,7 +120,7 @@ impl Cli {
let timestamp = buf.timestamp();
writeln!(
buf,
"[{} {} {}] {}",
"[{} {:<5} {}] {}",
timestamp,
record.level(),
record.module_path().unwrap_or_default(),
+1 -1
View File
@@ -17,11 +17,11 @@ use axum::{
http::StatusCode,
response::IntoResponse,
};
use common::constants::GP_GUI_BINARY;
use futures::{SinkExt, StreamExt};
use gpapi::{
service::{event::WsEvent, request::UpdateGuiRequest},
utils::checksum::verify_checksum,
GP_GUI_BINARY,
};
use log::{info, warn};
use tar::Archive;
+2
View File
@@ -42,9 +42,11 @@ impl VpnTaskContext {
.script(args.vpnc_script())
.user_agent(args.user_agent())
.os(args.openconnect_os())
.client_version(args.client_version())
.certificate(args.certificate())
.sslkey(args.sslkey())
.key_password(args.key_password())
.hip(args.hip())
.csd_uid(args.csd_uid())
.csd_wrapper(args.csd_wrapper())
.reconnect_timeout(args.reconnect_timeout())
+12 -4
View File
@@ -1,11 +1,13 @@
use std::sync::Arc;
use axum::extract::ws::Message;
use common::constants::GP_AUTH_BINARY;
use gpapi::{
service::{event::WsEvent, request::WsRequest, vpn_state::VpnState},
service::{event::WsEvent, request::WsRequest, vpn_env::VpnEnv, vpn_state::VpnState},
utils::{crypto::Crypto, lock_file::LockFile, redact::Redaction},
};
use log::{info, warn};
use openconnect::{find_csd_wrapper, find_vpnc_script};
use serde::de::DeserializeOwned;
use tokio::{
net::TcpListener,
@@ -56,9 +58,15 @@ impl WsServerContext {
let conn = Arc::new(WsConnection::new(Arc::clone(&self.crypto), tx));
// Send current VPN state to new client
info!("Sending current VPN state to new client");
let vpn_state = self.vpn_state_rx.borrow().clone();
if let Err(err) = conn.send_event(&WsEvent::VpnState(vpn_state)).await {
info!("Sending current environment to new client");
let vpn_env = VpnEnv {
vpn_state: self.vpn_state_rx.borrow().clone(),
vpnc_script: find_vpnc_script().map(|s| s.to_owned()),
csd_wrapper: find_csd_wrapper().map(|s| s.to_owned()),
auth_executable: GP_AUTH_BINARY.to_owned(),
};
if let Err(err) = conn.send_event(&WsEvent::VpnEnv(vpn_env)).await {
warn!("Failed to send VPN state to new client: {}", err);
}
+14
View File
@@ -1,5 +1,19 @@
# Changelog
## 2.5.0 - 2025-12-08
- GUI/CLI: statically link OpenConnect
- GUI/CLI: support configure the client version
- CLI: add the `-S/--script-tun` option to pass traffic to the `--script` handler
- GUI: update the branding to `GP Connect`
## 2.4.7 - 2025-11-12
- Support NixOS package installation
- Fix the VPNC script location on Void Linux
- Upgrade to Rust 1.85
- `--browser` without argument uses the system default browser
## 2.4.6 - 2025-10-15
- GUI: support the default configuration file for GUI client (fix [#492](https://github.com/yuezk/GlobalProtect-openconnect/issues/492))
+13 -2
View File
@@ -8,6 +8,7 @@ edition.workspace = true
license.workspace = true
[dependencies]
common = { path = "../common" }
gpapi = { path = "../gpapi" }
# Shared dependencies
@@ -28,15 +29,21 @@ regex = { workspace = true, optional = true }
tokio-util = { workspace = true, optional = true }
html-escape = { version = "0.2.13", optional = true }
[target.'cfg(not(target_os = "macos"))'.dependencies]
[target.'cfg(not(any(target_os="macos", target_os="windows")))'.dependencies]
webkit2gtk = { version = "2", optional = true }
[target.'cfg(target_os = "macos")'.dependencies]
[target.'cfg(target_os="macos")'.dependencies]
block2 = { version = "0.6", optional = true }
objc2 = { version = "0.6", optional = true }
objc2-foundation = { version = "0.3", optional = true }
objc2-web-kit = { version = "0.3", optional = true }
[target.'cfg(target_os="windows")'.dependencies]
webview2-com = { version = "0.34", optional = true }
windows-core = { version = "0.58", optional = true }
windows = { version = "0.58", optional = true }
serde_json = { workspace = true, optional = true }
[features]
browser-auth = [
"dep:webbrowser",
@@ -56,4 +63,8 @@ webview-auth = [
"dep:objc2",
"dep:objc2-foundation",
"dep:objc2-web-kit",
"dep:webview2-com",
"dep:windows-core",
"dep:windows",
"dep:serde_json",
]
+8 -3
View File
@@ -1,6 +1,7 @@
use std::{env::temp_dir, fs, os::unix::fs::PermissionsExt};
use std::{env::temp_dir, fs};
use gpapi::{auth::SamlAuthData, GP_CALLBACK_PORT_FILENAME};
use common::constants::GP_CALLBACK_PORT_FILENAME;
use gpapi::auth::SamlAuthData;
use log::info;
use tokio::{
io::AsyncReadExt,
@@ -144,7 +145,11 @@ async fn wait_auth_data() -> anyhow::Result<SamlAuthData> {
// Write the port to a file
fs::write(&port_file, port.to_string())?;
fs::set_permissions(&port_file, fs::Permissions::from_mode(0o600))?;
#[cfg(unix)]
{
use os::unix::fs::PermissionsExt;
fs::set_permissions(&port_file, fs::Permissions::from_mode(0o600))?;
}
// Remove the previous log file
let callback_log = temp_dir().join("gpcallback.log");
+2 -1
View File
@@ -1,8 +1,9 @@
mod auth_messenger;
mod webview_auth;
#[cfg_attr(not(target_os = "macos"), path = "webview/unix.rs")]
#[cfg_attr(not(any(target_os = "macos", target_os = "windows")), path = "webview/unix.rs")]
#[cfg_attr(target_os = "macos", path = "webview/macos.rs")]
#[cfg_attr(windows, path = "webview/windows.rs")]
mod platform_impl;
pub use webview_auth::WebviewAuthenticator;
+1 -1
View File
@@ -15,7 +15,7 @@ pub(crate) enum AuthDataLocation {
#[derive(Debug)]
pub(crate) enum AuthError {
/// Failed to load page due to TLS error
#[cfg(not(target_os = "macos"))]
#[cfg(not(any(target_os = "macos", target_os = "windows")))]
TlsError,
/// 1. Found auth data in headers/body but it's invalid
/// 2. Loaded an empty page, failed to load page. etc.
+3 -3
View File
@@ -116,7 +116,7 @@ impl<'a> WebviewAuthenticator<'a> {
match auth_messenger.subscribe().await? {
AuthEvent::Close => bail!("Authentication cancelled"),
AuthEvent::RaiseWindow => self.raise_window(&auth_window),
#[cfg(not(target_os = "macos"))]
#[cfg(not(any(target_os = "macos", target_os = "windows")))]
AuthEvent::Error(AuthError::TlsError) => bail!(gpapi::error::PortalError::TlsError),
AuthEvent::Error(AuthError::NotFound(location)) => {
info!(
@@ -262,10 +262,10 @@ impl<'a> WebviewAuthenticator<'a> {
info!("Raising auth window...");
#[cfg(target_os = "macos")]
#[cfg(any(target_os = "macos", target_os = "windows"))]
let result = auth_window.show();
#[cfg(not(target_os = "macos"))]
#[cfg(not(any(target_os = "macos", target_os = "windows")))]
let result = {
use gpapi::utils::window::WindowExt;
auth_window.raise()
+142
View File
@@ -0,0 +1,142 @@
use log::warn;
use tauri::webview::PlatformWebview;
use webview2_com::{
pwstr_from_str, take_pwstr, ExecuteScriptCompletedHandler,
Microsoft::Web::WebView2::Win32::{
ICoreWebView2WebResourceResponseView, ICoreWebView2_14, ICoreWebView2_2,
COREWEBVIEW2_SERVER_CERTIFICATE_ERROR_ACTION_ALWAYS_ALLOW,
},
ServerCertificateErrorDetectedEventHandler, WebResourceResponseReceivedEventHandler,
};
use windows_core::{Interface, PWSTR};
use super::{
auth_messenger::AuthError,
webview_auth::{GetHeader, PlatformWebviewExt},
};
impl PlatformWebviewExt for PlatformWebview {
fn ignore_tls_errors(&self) -> anyhow::Result<()> {
unsafe {
let wv = self.controller().CoreWebView2()?.cast::<ICoreWebView2_14>()?;
let handler = ServerCertificateErrorDetectedEventHandler::create(Box::new(|_, e| {
if let Some(e) = e {
let _ = e.SetAction(COREWEBVIEW2_SERVER_CERTIFICATE_ERROR_ACTION_ALWAYS_ALLOW);
}
Ok(())
}));
wv.add_ServerCertificateErrorDetected(&handler, &mut Default::default())?;
}
Ok(())
}
fn load_url(&self, url: &str) -> anyhow::Result<()> {
let url = pwstr_from_str(url);
unsafe { self.controller().CoreWebView2()?.Navigate(url)? }
Ok(())
}
fn load_html(&self, html: &str) -> anyhow::Result<()> {
let html = pwstr_from_str(html);
unsafe { self.controller().CoreWebView2()?.NavigateToString(html)? }
Ok(())
}
fn get_html(&self, callback: Box<dyn Fn(anyhow::Result<String>) + 'static>) {
unsafe {
match self.controller().CoreWebView2() {
Ok(wv) => {
let js = "document.documentElement.outerHTML";
let js = pwstr_from_str(js);
let handler = ExecuteScriptCompletedHandler::create(Box::new(move |err, html| {
if let Err(err) = err {
callback(Err(anyhow::anyhow!(err)));
return Ok(());
}
// The returned HTML is JSON.stringify'd string, so we need to parse it
let res = match serde_json::from_str(&html) {
Ok(Some(html)) => Ok(html),
Ok(None) => Err(anyhow::anyhow!("No HTML returned")),
Err(err) => Err(anyhow::anyhow!(err)),
};
callback(res);
Ok(())
}));
if let Err(err) = wv.ExecuteScript(js, &handler) {
warn!("Failed to execute script: {}", err);
}
}
Err(err) => callback(Err(anyhow::anyhow!(err))),
}
}
}
}
impl GetHeader for ICoreWebView2WebResourceResponseView {
fn get_header(&self, key: &str) -> Option<String> {
unsafe {
let headers = self.Headers().ok()?;
let key = pwstr_from_str(key);
let mut contains = Default::default();
headers.Contains(key, &mut contains).ok()?;
if contains.as_bool() {
let mut value = PWSTR::null();
headers.GetHeader(key, &mut value).ok()?;
let value = take_pwstr(value);
Some(value)
} else {
None
}
}
}
}
pub trait PlatformWebviewOnResponse {
fn on_response(
&self,
callback: Box<dyn Fn(anyhow::Result<ICoreWebView2WebResourceResponseView, AuthError>) + 'static>,
);
}
impl PlatformWebviewOnResponse for PlatformWebview {
fn on_response(
&self,
callback: Box<dyn Fn(anyhow::Result<ICoreWebView2WebResourceResponseView, AuthError>) + 'static>,
) {
unsafe {
let _ = self
.controller()
.CoreWebView2()
.and_then(|wv| wv.cast::<ICoreWebView2_2>())
.map(|wv| {
let handler = WebResourceResponseReceivedEventHandler::create(Box::new(move |_, e| {
let Some(e) = e else {
return Ok(());
};
match e.Response() {
Ok(res) => callback(Ok(res)),
Err(err) => warn!("Failed to get response: {}", err),
}
Ok(())
}));
let _ = wv.add_WebResourceResponseReceived(&handler, &mut Default::default());
});
}
}
}
-3
View File
@@ -6,6 +6,3 @@ authors.workspace = true
homepage.workspace = true
edition.workspace = true
license.workspace = true
[dependencies]
is_executable.workspace = true
@@ -14,6 +14,9 @@ fn main() {
println!("cargo:rustc-env=GP_SERVICE_BINARY={}", gp_service_binary.display());
println!("cargo:rustc-env=GP_CLIENT_BINARY={}", gp_client_binary.display());
println!("cargo:rustc-env=GP_AUTH_BINARY={}", gp_auth_binary.display());
println!("cargo:rustc-env=GP_GUI_HELPER_BINARY={}", gp_gui_helper_binary.display());
println!(
"cargo:rustc-env=GP_GUI_HELPER_BINARY={}",
gp_gui_helper_binary.display()
);
println!("cargo:rustc-env=GP_GUI_BINARY={}", gp_gui_binary.display());
}
+40
View File
@@ -0,0 +1,40 @@
pub const GP_USER_AGENT: &str = "PAN GlobalProtect";
pub const GP_CLIENT_VERSION: &str = "6.3.0-33";
pub const GP_SERVICE_LOCK_FILE: &str = "/var/run/gpservice.lock";
pub const GP_CALLBACK_PORT_FILENAME: &str = "gpcallback.port";
// Release binaries - macOS (Apple Silicon Homebrew)
#[cfg(all(not(debug_assertions), target_os = "macos"))]
pub const GP_CLIENT_BINARY: &str = "/opt/homebrew/bin/gpclient";
#[cfg(all(not(debug_assertions), target_os = "macos"))]
pub const GP_SERVICE_BINARY: &str = "/opt/homebrew/bin/gpservice";
#[cfg(all(not(debug_assertions), target_os = "macos"))]
pub const GP_GUI_BINARY: &str = "/opt/homebrew/bin/gpgui";
#[cfg(all(not(debug_assertions), target_os = "macos"))]
pub const GP_GUI_HELPER_BINARY: &str = "/opt/homebrew/bin/gpgui-helper";
#[cfg(all(not(debug_assertions), target_os = "macos"))]
pub const GP_AUTH_BINARY: &str = "/opt/homebrew/bin/gpauth";
// Release binaries - Linux
#[cfg(all(not(debug_assertions), not(target_os = "macos")))]
pub const GP_CLIENT_BINARY: &str = "/usr/bin/gpclient";
#[cfg(all(not(debug_assertions), not(target_os = "macos")))]
pub const GP_SERVICE_BINARY: &str = "/usr/bin/gpservice";
#[cfg(all(not(debug_assertions), not(target_os = "macos")))]
pub const GP_GUI_BINARY: &str = "/usr/bin/gpgui";
#[cfg(all(not(debug_assertions), not(target_os = "macos")))]
pub const GP_GUI_HELPER_BINARY: &str = "/usr/bin/gpgui-helper";
#[cfg(all(not(debug_assertions), not(target_os = "macos")))]
pub const GP_AUTH_BINARY: &str = "/usr/bin/gpauth";
// Debug binaries are set in build.rs via environment variables
#[cfg(debug_assertions)]
pub const GP_CLIENT_BINARY: &str = env!("GP_CLIENT_BINARY");
#[cfg(debug_assertions)]
pub const GP_SERVICE_BINARY: &str = env!("GP_SERVICE_BINARY");
#[cfg(debug_assertions)]
pub const GP_GUI_BINARY: &str = env!("GP_GUI_BINARY");
#[cfg(debug_assertions)]
pub const GP_GUI_HELPER_BINARY: &str = env!("GP_GUI_HELPER_BINARY");
#[cfg(debug_assertions)]
pub const GP_AUTH_BINARY: &str = env!("GP_AUTH_BINARY");
+1 -1
View File
@@ -1 +1 @@
pub mod vpn_utils;
pub mod constants;
+21 -4
View File
@@ -6,15 +6,14 @@ edition.workspace = true
license = "MIT"
[dependencies]
common = { path = "../common" }
anyhow.workspace = true
base64.workspace = true
dns-lookup.workspace = true
log.workspace = true
reqwest.workspace = true
openssl.workspace = true
version-compare = "0.2"
pem.workspace = true
roxmltree.workspace = true
xmltree.workspace = true
serde.workspace = true
specta = { workspace = true, features = ["derive"] }
urlencoding.workspace = true
@@ -27,11 +26,14 @@ chacha20poly1305 = { version = "0.10", features = ["std"] }
redact-engine.workspace = true
url.workspace = true
regex.workspace = true
uzers.workspace = true
serde_urlencoded.workspace = true
md5.workspace = true
sha256.workspace = true
machine-uid.workspace = true
uuid = { workspace = true, features = ["v5"] }
# Optional dependencies for features
tauri = { workspace = true, optional = true }
clap = { workspace = true, optional = true }
clap-verbosity-flag = { workspace = true, optional = true }
@@ -39,9 +41,24 @@ clap-verbosity-flag = { workspace = true, optional = true }
env_logger = { workspace = true, optional = true }
log-reload = { version = "0.1", optional = true }
# Dependencies for macOS and Windows only
[target.'cfg(any(target_os="macos", target_os="windows"))'.dependencies]
os_info = { version = "3", default-features = false }
# Dependencies for Linux and other OSes only
[target.'cfg(not(any(target_os="macos", target_os="windows")))'.dependencies]
gtk = "0.18"
[target.'cfg(target_os="windows")'.dependencies]
reqwest = { workspace = true, features = ["native-tls-vendored", "json"] }
openssl = { workspace = true, features = ["vendored"] }
# Dependencies for Unix-like systems only
[target.'cfg(target_family="unix")'.dependencies]
reqwest.workspace = true
openssl.workspace = true
uzers.workspace = true
[features]
tauri = ["dep:tauri"]
clap = ["dep:clap", "dep:clap-verbosity-flag"]
+1 -1
View File
@@ -104,7 +104,7 @@ impl SamlAuthData {
}
let auth_data = decode_to_string(auth_data).map_err(|e| {
warn!("Failed to decode SAML auth data: {}", e);
warn!("Failed to decode SAML auth data: {}", auth_data);
AuthDataParseError::Invalid(anyhow::anyhow!(e))
})?;
let auth_data = Self::from_html(&auth_data)?;
+12 -13
View File
@@ -2,9 +2,13 @@ use std::collections::HashMap;
use log::{info, warn};
use reqwest::Client;
use roxmltree::Document;
use xmltree::Element;
use crate::{gp_params::GpParams, process::hip_launcher::HipLauncher, utils::normalize_server};
use crate::{
gp_params::GpParams,
process::hip_launcher::HipLauncher,
utils::{normalize_server, xml::ElementExt},
};
struct HipReporter<'a> {
server: String,
@@ -65,13 +69,11 @@ impl HipReporter<'_> {
let res = self.client.post(&config_url).form(&params).send().await?;
let res_xml = res.error_for_status()?.text().await?;
let doc = Document::parse(&res_xml)?;
let root = Element::parse(res_xml.as_bytes())?;
// Get <ip-address>
let ip = doc
.descendants()
.find(|n| n.has_tag_name("ip-address"))
.and_then(|n| n.text())
let ip = root
.descendant_text("ip-address")
.ok_or_else(|| anyhow::anyhow!("ip-address not found"))?;
Ok(ip.to_string())
@@ -122,12 +124,9 @@ impl HipReporter<'_> {
}
fn is_hip_needed(res_xml: &str) -> anyhow::Result<bool> {
let doc = Document::parse(res_xml)?;
let hip_needed = doc
.descendants()
.find(|n| n.has_tag_name("hip-report-needed"))
.and_then(|n| n.text())
let root = Element::parse(res_xml.as_bytes())?;
let hip_needed = root
.descendant_text("hip-report-needed")
.ok_or_else(|| anyhow::anyhow!("hip-report-needed not found"))?;
Ok(hip_needed == "yes")
+15 -11
View File
@@ -1,14 +1,16 @@
use std::borrow::Cow;
use anyhow::bail;
use log::{info, warn};
use log::{debug, info, warn};
use reqwest::Client;
use roxmltree::Document;
use urlencoding::encode;
use xmltree::Element;
use crate::{
credential::Credential,
error::PortalError,
gp_params::GpParams,
utils::{normalize_server, parse_gp_response, remove_url_scheme},
utils::{normalize_server, parse_gp_response, remove_url_scheme, xml::ElementExt},
};
pub enum GatewayLogin {
@@ -50,18 +52,20 @@ pub async fn gateway_login(gateway: &str, cred: &Credential, gp_params: &GpParam
return Ok(GatewayLogin::Mfa(message, input_str));
}
let doc = Document::parse(&res)?;
debug!("Gateway login response: {}", res);
let cookie = build_gateway_token(&doc, gp_params.computer())?;
let root = Element::parse(res.as_bytes())?;
let cookie = build_gateway_token(&root, gp_params.computer())?;
Ok(GatewayLogin::Cookie(cookie))
}
fn build_gateway_token(doc: &Document, computer: &str) -> anyhow::Result<String> {
let args = doc
.descendants()
.filter(|n| n.has_tag_name("argument"))
.map(|n| n.text().unwrap_or("").to_string())
fn build_gateway_token(element: &Element, computer: &str) -> anyhow::Result<String> {
let args = element
.descendants("argument")
.iter()
.map(|e| e.get_text().unwrap_or_default())
.collect::<Vec<_>>();
let params = [
@@ -82,7 +86,7 @@ fn build_gateway_token(doc: &Document, computer: &str) -> anyhow::Result<String>
Ok(token)
}
fn read_args<'a>(args: &'a [String], index: usize, key: &'a str) -> anyhow::Result<(&'a str, &'a str)> {
fn read_args<'a>(args: &'a [Cow<'_, str>], index: usize, key: &'a str) -> anyhow::Result<(&'a str, &'a str)> {
args
.get(index)
.ok_or_else(|| anyhow::anyhow!("Failed to read {key} from args"))
+2
View File
@@ -1,5 +1,7 @@
mod login;
mod parse_gateways;
#[cfg(unix)]
pub mod hip;
pub use login::*;
+36 -36
View File
@@ -1,64 +1,64 @@
use log::info;
use roxmltree::Node;
use xmltree::Element;
use crate::utils::xml::NodeExt;
use crate::utils::xml::ElementExt;
use super::{Gateway, PriorityRule};
pub(crate) fn parse_gateways(node: &Node, prefer_internal: bool) -> Option<Vec<Gateway>> {
let node_gateways = node.find_descendant("gateways")?;
pub(crate) fn parse_gateways(element: &Element, prefer_internal: bool) -> Option<Vec<Gateway>> {
let node_gateways = element.descendant("gateways")?;
let internal_gateway_list = if prefer_internal {
info!("Try to parse the internal gateways...");
node_gateways.find_descendant("internal").and_then(|n| n.find_child("list"))
node_gateways.descendant("internal").and_then(|n| n.child("list"))
} else {
None
};
let gateway_list = internal_gateway_list.or_else(|| {
info!("Try to parse the external gateways...");
node_gateways.find_descendant("external").and_then(|n| n.find_child("list"))
node_gateways.descendant("external").and_then(|n| n.child("list"))
})?;
let gateways = gateway_list
.children()
.filter_map(|gateway_item| {
if !gateway_item.has_tag_name("entry") {
return None;
}
let address = gateway_item.attribute("name").unwrap_or_default().to_string();
let name = gateway_item.child_text("description").unwrap_or_default().to_string();
let priority = gateway_item
.child_text("priority")
.and_then(|s| s.parse().ok())
.unwrap_or(u32::MAX);
.children("entry")
.iter()
.map(|gateway_item| {
let address = gateway_item.attr("name").map(|s| s.to_string()).unwrap_or_default();
let name = gateway_item.child_text("description").unwrap_or_default();
let priority = parse_priority(gateway_item);
let priority_rules = gateway_item
.find_child("priority-rule")
.map(|n| {
n.children()
.filter_map(|n| {
if !n.has_tag_name("entry") {
return None;
}
let name = n.attribute("name").unwrap_or_default().to_string();
let priority: u32 = n
.child_text("priority")
.and_then(|s| s.parse().ok())
.unwrap_or(u32::MAX);
Some(PriorityRule { name, priority })
})
.collect()
})
.child("priority-rule")
.map(|n| parse_priority_rules(n))
.unwrap_or_default();
Some(Gateway {
Gateway {
name,
address,
priority,
priority_rules,
})
}
})
.collect();
Some(gateways)
}
fn parse_priority_rules(element: &Element) -> Vec<PriorityRule> {
element
.children("entry")
.iter()
.map(|n| {
let name = n.attr("name").map(|s| s.to_string()).unwrap_or_default();
let priority: u32 = parse_priority(n);
PriorityRule { name, priority }
})
.collect()
}
fn parse_priority(element: &Element) -> u32 {
element
.child_text("priority")
.and_then(|s| s.parse().ok())
.unwrap_or(u32::MAX)
}
+2 -1
View File
@@ -1,11 +1,12 @@
use std::collections::HashMap;
use common::constants::GP_USER_AGENT;
use log::info;
use reqwest::Client;
use serde::{Deserialize, Serialize};
use specta::Type;
use crate::{utils::request::create_identity, GP_USER_AGENT};
use crate::utils::request::create_identity;
#[derive(Debug, Serialize, Deserialize, Clone, Type, Default)]
pub enum ClientOs {
+3 -26
View File
@@ -4,7 +4,10 @@ pub mod error;
pub mod gateway;
pub mod gp_params;
pub mod portal;
#[cfg(unix)]
pub mod process;
pub mod service;
pub mod utils;
@@ -16,29 +19,3 @@ pub mod clap;
#[cfg(debug_assertions)]
pub const GP_API_KEY: &[u8; 32] = &[0; 32];
pub const GP_USER_AGENT: &str = "PAN GlobalProtect";
pub const GP_SERVICE_LOCK_FILE: &str = "/var/run/gpservice.lock";
pub const GP_CALLBACK_PORT_FILENAME: &str = "gpcallback.port";
#[cfg(not(debug_assertions))]
pub const GP_CLIENT_BINARY: &str = "/usr/bin/gpclient";
#[cfg(not(debug_assertions))]
pub const GP_SERVICE_BINARY: &str = "/usr/bin/gpservice";
#[cfg(not(debug_assertions))]
pub const GP_GUI_BINARY: &str = "/usr/bin/gpgui";
#[cfg(not(debug_assertions))]
pub const GP_GUI_HELPER_BINARY: &str = "/usr/bin/gpgui-helper";
#[cfg(not(debug_assertions))]
pub(crate) const GP_AUTH_BINARY: &str = "/usr/bin/gpauth";
#[cfg(debug_assertions)]
pub const GP_CLIENT_BINARY: &str = env!("GP_CLIENT_BINARY");
#[cfg(debug_assertions)]
pub const GP_SERVICE_BINARY: &str = env!("GP_SERVICE_BINARY");
#[cfg(debug_assertions)]
pub const GP_GUI_BINARY: &str = env!("GP_GUI_BINARY");
#[cfg(debug_assertions)]
pub const GP_GUI_HELPER_BINARY: &str = env!("GP_GUI_HELPER_BINARY");
#[cfg(debug_assertions)]
pub(crate) const GP_AUTH_BINARY: &str = env!("GP_AUTH_BINARY");
+23 -11
View File
@@ -1,17 +1,17 @@
use anyhow::bail;
use dns_lookup::lookup_addr;
use log::{info, warn};
use log::{debug, info, warn};
use reqwest::{Client, StatusCode};
use roxmltree::{Document, Node};
use serde::Serialize;
use specta::Type;
use xmltree::Element;
use crate::{
credential::{AuthCookieCredential, Credential},
error::PortalError,
gateway::{parse_gateways, Gateway},
gateway::{Gateway, parse_gateways},
gp_params::GpParams,
utils::{normalize_server, parse_gp_response, remove_url_scheme, xml::NodeExt},
utils::{normalize_server, parse_gp_response, remove_url_scheme, xml::ElementExt},
};
#[derive(Debug, Serialize, Type)]
@@ -29,6 +29,10 @@ pub struct PortalConfig {
* - Some(true): Internal host detection is supported and the user is connected to the internal network
*/
internal_host_detection: Option<bool>,
/**
* The version returned by the portal config, if any
*/
version: Option<String>,
}
impl PortalConfig {
@@ -52,6 +56,10 @@ impl PortalConfig {
self.internal_host_detection
}
pub fn version(&self) -> Option<&str> {
self.version.as_deref()
}
/// In-place sort the gateways by region
pub fn sort_gateways(&mut self, region: &str) {
let preferred_gateway = self.find_preferred_gateway(region);
@@ -133,12 +141,12 @@ pub async fn retrieve_config(portal: &str, cred: &Credential, gp_params: &GpPara
bail!(PortalError::ConfigError("Empty portal config response".to_string()))
}
let doc = Document::parse(&res_xml).map_err(|e| PortalError::ConfigError(e.to_string()))?;
let root = doc.root();
debug!("Portal config response: {}", res_xml);
let root = Element::parse(res_xml.as_bytes()).map_err(|e| PortalError::ConfigError(e.to_string()))?;
let mut ihd_enabled = false;
let mut prefer_internal = false;
if let Some(ihd_node) = root.find_descendant("internal-host-detection") {
if let Some(ihd_node) = root.descendant("internal-host-detection") {
ihd_enabled = true;
prefer_internal = internal_host_detect(&ihd_node)
}
@@ -158,21 +166,25 @@ pub async fn retrieve_config(portal: &str, cred: &Credential, gp_params: &GpPara
gateways.push(Gateway::new(server.to_string(), server.to_string()));
}
let version = root.descendant_text("version").map(|s| s.to_string());
info!("Detected portal version: {:?}", version);
Ok(PortalConfig {
portal: server.to_string(),
auth_cookie: AuthCookieCredential::new(cred.username(), user_auth_cookie, prelogon_user_auth_cookie),
auth_cookie: AuthCookieCredential::new(cred.username(), &user_auth_cookie, &prelogon_user_auth_cookie),
config_cred: cred.clone(),
gateways,
config_digest: config_digest.map(|s| s.to_string()),
internal_host_detection: if ihd_enabled { Some(prefer_internal) } else { None },
version,
})
}
// Perform DNS lookup and compare the result with the expected hostname
fn internal_host_detect(node: &Node) -> bool {
fn internal_host_detect(element: &Element) -> bool {
let ip_info = [
(node.child_text("ip-address"), node.child_text("host")),
(node.child_text("ipv6-address"), node.child_text("ipv6-host")),
(element.child_text("ip-address"), element.child_text("host")),
(element.child_text("ipv6-address"), element.child_text("ipv6-host")),
];
info!("Found internal-host-detection, performing DNS lookup");
+20 -29
View File
@@ -1,14 +1,14 @@
use anyhow::{anyhow, bail};
use log::{info, warn};
use reqwest::{Client, StatusCode};
use roxmltree::Document;
use serde::Serialize;
use specta::Type;
use xmltree::Element;
use crate::{
error::PortalError,
gp_params::GpParams,
utils::{base64, normalize_server, parse_gp_response, xml::NodeExt},
utils::{base64, normalize_server, parse_gp_response, xml::ElementExt},
};
const REQUIRED_PARAMS: [&str; 8] = [
@@ -143,32 +143,30 @@ pub async fn prelogin(portal: &str, gp_params: &GpParams) -> anyhow::Result<Prel
}
fn parse_res_xml(res_xml: &str, is_gateway: bool) -> anyhow::Result<Prelogin> {
let doc = Document::parse(res_xml)?;
let root = doc.root();
let root = Element::parse(res_xml.as_bytes())?;
let status = root
.descendant_text("status")
.ok_or_else(|| anyhow::anyhow!("Prelogin response does not contain status element"))?;
// Check the status of the prelogin response
if status.to_uppercase() != "SUCCESS" {
let msg = root.descendant_text("msg").unwrap_or("Unknown error");
let msg = root
.descendant_text("msg")
.unwrap_or_else(|| String::from("Unknown error"));
bail!("{}", msg)
}
let region = root
.descendant_text("region")
.unwrap_or_else(|| {
info!("Prelogin response does not contain region element");
"Unknown"
})
.to_string();
let region = root.descendant_text("region").unwrap_or_else(|| {
info!("Prelogin response does not contain region element");
String::from("Unknown")
});
let saml_method = root.descendant_text("saml-auth-method");
let saml_request = root.descendant_text("saml-request");
let saml_default_browser = root.descendant_text("saml-default-browser");
// Check if the prelogin response is SAML
if saml_method.is_some() && saml_request.is_some() {
let saml_request = base64::decode_to_string(saml_request.unwrap())?;
let saml_request = base64::decode_to_string(&saml_request.unwrap())?;
let support_default_browser = saml_default_browser.map(|s| s.to_lowercase() == "yes").unwrap_or(false);
let saml_prelogin = SamlPrelogin {
@@ -181,25 +179,18 @@ fn parse_res_xml(res_xml: &str, is_gateway: bool) -> anyhow::Result<Prelogin> {
return Ok(Prelogin::Saml(saml_prelogin));
}
let label_username = root
.descendant_text("username-label")
.unwrap_or_else(|| {
info!("Username label has no value, using default");
"Username"
})
.to_string();
let label_password = root
.descendant_text("password-label")
.unwrap_or_else(|| {
info!("Password label has no value, using default");
"Password"
})
.to_string();
let label_username = root.descendant_text("username-label").unwrap_or_else(|| {
info!("Username label has no value, using default");
String::from("Username")
});
let label_password = root.descendant_text("password-label").unwrap_or_else(|| {
info!("Password label has no value, using default");
String::from("Password")
});
let auth_message = root
.descendant_text("authentication-message")
.unwrap_or("Please enter the login credentials")
.to_string();
.unwrap_or_else(|| String::from("Please enter the login credentials"));
let standard_prelogin = StandardPrelogin {
region,
is_gateway,
+11 -2
View File
@@ -1,14 +1,16 @@
use std::process::Stdio;
use anyhow::bail;
use common::constants::GP_AUTH_BINARY;
use tokio::process::Command;
use crate::{auth::SamlAuthResult, credential::Credential, GP_AUTH_BINARY};
use crate::{auth::SamlAuthResult, credential::Credential};
use super::command_traits::CommandExt;
pub struct SamlAuthLauncher<'a> {
server: &'a str,
auth_executable: Option<&'a str>,
gateway: bool,
saml_request: Option<&'a str>,
user_agent: Option<&'a str>,
@@ -30,6 +32,7 @@ impl<'a> SamlAuthLauncher<'a> {
pub fn new(server: &'a str) -> Self {
Self {
server,
auth_executable: None,
gateway: false,
saml_request: None,
user_agent: None,
@@ -48,6 +51,11 @@ impl<'a> SamlAuthLauncher<'a> {
}
}
pub fn auth_executable(mut self, auth_executable: Option<&'a str>) -> Self {
self.auth_executable = auth_executable;
self
}
pub fn gateway(mut self, gateway: bool) -> Self {
self.gateway = gateway;
self
@@ -113,7 +121,8 @@ impl<'a> SamlAuthLauncher<'a> {
/// Launch the authenticator binary as the current user or SUDO_USER if available.
pub async fn launch(self) -> anyhow::Result<Credential> {
let mut auth_cmd = Command::new(GP_AUTH_BINARY);
let program = self.auth_executable.unwrap_or(GP_AUTH_BINARY);
let mut auth_cmd = Command::new(program);
auth_cmd.arg(self.server);
if self.gateway {
+12 -4
View File
@@ -11,10 +11,18 @@ pub trait CommandExt {
impl CommandExt for Command {
fn new_pkexec<S: AsRef<OsStr>>(program: S) -> Command {
let mut cmd = Command::new("pkexec");
cmd.arg("--user").arg("root").arg(program);
cmd
#[cfg(target_os = "macos")]
{
let mut cmd = Command::new("sudo");
cmd.arg(program);
cmd
}
#[cfg(not(target_os = "macos"))]
{
let mut cmd = Command::new("pkexec");
cmd.arg("--user").arg("root").arg(program);
cmd
}
}
fn into_non_root(mut self) -> anyhow::Result<Command> {
@@ -1,10 +1,11 @@
use std::{collections::HashMap, path::PathBuf, process::Stdio};
use anyhow::bail;
use common::constants::GP_GUI_HELPER_BINARY;
use log::info;
use tokio::{io::AsyncWriteExt, process::Command};
use crate::{process::command_traits::CommandExt, utils, GP_GUI_HELPER_BINARY};
use crate::{process::command_traits::CommandExt, utils};
pub struct GuiHelperLauncher<'a> {
program: PathBuf,
+2 -1
View File
@@ -5,10 +5,11 @@ use std::{
};
use anyhow::bail;
use common::constants::GP_GUI_BINARY;
use log::info;
use tokio::{io::AsyncWriteExt, process::Command};
use crate::{process::gui_helper_launcher::GuiHelperLauncher, utils::base64, GP_GUI_BINARY};
use crate::{process::gui_helper_launcher::GuiHelperLauncher, utils::base64};
use super::command_traits::CommandExt;
+3
View File
@@ -1,8 +1,11 @@
pub(crate) mod command_traits;
pub(crate) mod gui_helper_launcher;
pub mod auth_launcher;
pub mod gui_launcher;
pub mod hip_launcher;
pub mod service_launcher;
#[cfg(unix)]
pub mod users;
+3 -4
View File
@@ -4,10 +4,9 @@ use std::{
process::{ExitStatus, Stdio},
};
use common::constants::GP_SERVICE_BINARY;
use tokio::process::Command;
use crate::GP_SERVICE_BINARY;
use super::command_traits::CommandExt;
pub struct ServiceLauncher<'a> {
@@ -15,7 +14,7 @@ pub struct ServiceLauncher<'a> {
minimized: bool,
env_file: Option<String>,
log_file: Option<String>,
verbose: Option<&'a str>
verbose: Option<&'a str>,
}
impl Default for ServiceLauncher<'_> {
@@ -31,7 +30,7 @@ impl<'a> ServiceLauncher<'a> {
minimized: false,
env_file: None,
log_file: None,
verbose: None
verbose: None,
}
}
+2 -1
View File
@@ -1,10 +1,11 @@
use serde::{Deserialize, Serialize};
use super::vpn_state::VpnState;
use crate::service::{vpn_env::VpnEnv, vpn_state::VpnState};
/// Events that can be emitted by the service
#[derive(Debug, Serialize, Deserialize, Clone)]
pub enum WsEvent {
VpnEnv(VpnEnv),
VpnState(VpnState),
ActiveGui,
ResumeConnection,
+1
View File
@@ -1,3 +1,4 @@
pub mod event;
pub mod request;
pub mod vpn_env;
pub mod vpn_state;
+26
View File
@@ -31,13 +31,19 @@ impl LaunchGuiRequest {
pub struct ConnectArgs {
cookie: String,
vpnc_script: Option<String>,
user_agent: Option<String>,
os: Option<ClientOs>,
client_version: Option<String>,
certificate: Option<String>,
sslkey: Option<String>,
key_password: Option<String>,
hip: bool,
csd_uid: u32,
csd_wrapper: Option<String>,
reconnect_timeout: u32,
mtu: u32,
disable_ipv6: bool,
@@ -51,9 +57,11 @@ impl ConnectArgs {
vpnc_script: None,
user_agent: None,
os: None,
client_version: None,
certificate: None,
sslkey: None,
key_password: None,
hip: false,
csd_uid: 0,
csd_wrapper: None,
reconnect_timeout: 300,
@@ -79,6 +87,10 @@ impl ConnectArgs {
self.os.as_ref().map(|os| os.to_openconnect_os().to_string())
}
pub fn client_version(&self) -> Option<String> {
self.client_version.clone()
}
pub fn certificate(&self) -> Option<String> {
self.certificate.clone()
}
@@ -91,6 +103,10 @@ impl ConnectArgs {
self.key_password.clone()
}
pub fn hip(&self) -> bool {
self.hip
}
pub fn csd_uid(&self) -> u32 {
self.csd_uid
}
@@ -135,6 +151,11 @@ impl ConnectRequest {
self
}
pub fn with_hip(mut self, hip: bool) -> Self {
self.args.hip = hip;
self
}
pub fn with_csd_uid(mut self, csd_uid: u32) -> Self {
self.args.csd_uid = csd_uid;
self
@@ -155,6 +176,11 @@ impl ConnectRequest {
self
}
pub fn with_client_version(mut self, client_version: &str) -> Self {
self.args.client_version = Some(client_version.to_string());
self
}
pub fn with_certificate<T: Into<Option<String>>>(mut self, certificate: T) -> Self {
self.args.certificate = certificate.into();
self
+22
View File
@@ -0,0 +1,22 @@
use serde::{Deserialize, Serialize};
use crate::service::vpn_state::VpnState;
/// Represents the VPN environment configuration.
/// When a client connects, the gpservice sends the current VPN environment
/// to the client so that it can configure itself accordingly.
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct VpnEnv {
/// The VPN connection state
pub vpn_state: VpnState,
/// The default VPN script path
pub vpnc_script: Option<String>,
/// The default CSD wrapper script path
pub csd_wrapper: Option<String>,
/// The gpauth executable path
/// Used by the client to launch gpauth for authentication
pub auth_executable: String,
}
+5 -3
View File
@@ -39,11 +39,13 @@ pub fn load_env_vars<T: AsRef<Path>>(env_file: T) -> anyhow::Result<HashMap<Stri
pub fn patch_gui_runtime_env(hidpi: bool) {
// This is to avoid blank screen on some systems
std::env::set_var("WEBKIT_DISABLE_COMPOSITING_MODE", "1");
unsafe { std::env::set_var("WEBKIT_DISABLE_COMPOSITING_MODE", "1") };
if hidpi {
info!("Setting GDK_SCALE=2 and GDK_DPI_SCALE=0.5");
std::env::set_var("GDK_SCALE", "2");
std::env::set_var("GDK_DPI_SCALE", "0.5");
unsafe {
std::env::set_var("GDK_SCALE", "2");
std::env::set_var("GDK_DPI_SCALE", "0.5");
};
}
}
+108
View File
@@ -0,0 +1,108 @@
use std::sync::OnceLock;
const DEFAULT_MACOS_VERSION: &str = "13.4.0";
#[cfg(not(target_os = "linux"))]
const DEFAULT_LINUX_DISTRO: &str = "Ubuntu 24.04.3 LTS";
#[cfg(not(target_os = "windows"))]
const DEFAULT_WINDOWS_DISTRO: &str = "Windows 11 Pro";
const DEFAULT_WINDOWS_VERSION: &str = "10.0.22631.0";
const DEFAULT_MACHINE_ID: &str = "DEADBEEF-DEAD-BEEF-DEAD-BEEFDEADBEEF";
static MACHINE_ID: OnceLock<&'static str> = OnceLock::new();
static MACOS_VERSION: OnceLock<&'static str> = OnceLock::new();
static MACOS_OS_STRING: OnceLock<String> = OnceLock::new();
static LINUX_OS_STRING: OnceLock<String> = OnceLock::new();
static WINDOWS_VERSION: OnceLock<&'static str> = OnceLock::new();
static WINDOWS_OS_STRING: OnceLock<String> = OnceLock::new();
/// On macOS, get the OS version, or fallback to default
/// On other OSes, always return default
pub fn get_macos_version() -> &'static str {
MACOS_VERSION.get_or_init(|| {
#[cfg(target_os = "macos")]
{
match os_info::get().version() {
os_info::Version::Unknown => DEFAULT_MACOS_VERSION,
v => v.to_string().leak(),
}
}
#[cfg(not(target_os = "macos"))]
DEFAULT_MACOS_VERSION
})
}
pub fn get_macos_os_string() -> &'static str {
MACOS_OS_STRING.get_or_init(|| format!("Apple Mac OS X {}", get_macos_version()))
}
/// On Linux, use the real distro name if possible
/// On other OSes, fallback to default
pub fn get_linux_os_string() -> &'static str {
LINUX_OS_STRING.get_or_init(|| {
#[cfg(target_os = "linux")]
{
format!("Linux {}", whoami::distro())
}
#[cfg(not(target_os = "linux"))]
{
format!("Linux {}", DEFAULT_LINUX_DISTRO)
}
})
}
/// On Windows, get the OS version, or fallback to default
/// On other OSes, always return default
pub fn get_windows_version() -> &'static str {
WINDOWS_VERSION.get_or_init(|| {
#[cfg(target_os = "windows")]
{
match os_info::get().version() {
os_info::Version::Unknown => DEFAULT_WINDOWS_VERSION,
v => format!("{}.0", v).leak(),
}
}
#[cfg(not(target_os = "windows"))]
DEFAULT_WINDOWS_VERSION
})
}
/// On Windows, use the real edition if possible
/// On other OSes, fallback to default
/// The trailing space is intentional
pub fn get_windows_os_string() -> &'static str {
WINDOWS_OS_STRING.get_or_init(|| {
#[cfg(target_os = "windows")]
{
let edition = os_info::get()
.edition()
.map(|e| e.to_string())
.unwrap_or_else(|| whoami::distro());
format!("Microsoft {} , 64-bit", edition)
}
#[cfg(not(target_os = "windows"))]
{
format!("Microsoft {} , 64-bit", DEFAULT_WINDOWS_DISTRO)
}
})
}
/// Get machine ID or fallback to default
pub fn get_machine_id() -> &'static str {
MACHINE_ID.get_or_init(|| {
machine_uid::get()
.map(|id| id.to_string().leak() as &'static str)
.unwrap_or(DEFAULT_MACHINE_ID)
})
}
/// Generate a UUID v5 based on machine ID and provided seeds
pub fn derive_uuid(seeds: &[&str]) -> String {
use uuid::Uuid;
let namespace = Uuid::NAMESPACE_DNS;
let name = format!("{}-{}", get_machine_id(), seeds.join("-"));
let uuid = Uuid::new_v5(&namespace, name.as_bytes());
uuid.hyphenated().to_string()
}
+2 -1
View File
@@ -1,5 +1,6 @@
use std::path::PathBuf;
use common::constants::GP_SERVICE_LOCK_FILE;
use thiserror::Error;
use tokio::fs;
@@ -94,7 +95,7 @@ impl LockInfo {
}
pub async fn gpservice_lock_info() -> Result<LockInfo, LockFileError> {
LockInfo::from_file(crate::GP_SERVICE_LOCK_FILE).await
LockInfo::from_file(GP_SERVICE_LOCK_FILE).await
}
#[cfg(test)]
+2 -1
View File
@@ -5,11 +5,12 @@ pub mod checksum;
pub mod crypto;
pub mod endpoint;
pub mod env_utils;
pub mod host_utils;
pub mod lock_file;
pub mod openssl;
pub mod redact;
pub mod request;
#[cfg(feature = "tauri")]
#[cfg(all(feature = "tauri", not(any(target_os = "macos", target_os = "windows"))))]
pub mod window;
mod shutdown_signal;
+1 -1
View File
@@ -46,7 +46,7 @@ pub fn fix_openssl_env() -> anyhow::Result<NamedTempFile> {
let openssl_conf_path = openssl_conf.path();
fix_openssl(openssl_conf_path)?;
std::env::set_var("OPENSSL_CONF", openssl_conf_path);
unsafe { std::env::set_var("OPENSSL_CONF", openssl_conf_path) };
Ok(openssl_conf)
}
+15 -9
View File
@@ -6,15 +6,21 @@ pub async fn shutdown_signal() {
};
#[cfg(unix)]
let terminate = async {
signal::unix::signal(signal::unix::SignalKind::terminate())
.expect("failed to install signal handler")
.recv()
.await;
};
{
let terminate = async {
signal::unix::signal(signal::unix::SignalKind::terminate())
.expect("failed to install signal handler")
.recv()
.await;
};
tokio::select! {
_ = ctrl_c => {},
_ = terminate => {},
}
}
tokio::select! {
_ = ctrl_c => {},
_ = terminate => {},
#[cfg(not(unix))]
{
ctrl_c.await;
}
}
+75 -15
View File
@@ -1,27 +1,87 @@
use roxmltree::Node;
use xmltree::Element;
pub(crate) trait NodeExt<'a> {
fn find_descendant(&self, name: &str) -> Option<Node<'a, 'a>>;
fn descendant_text(&self, name: &str) -> Option<&'a str>;
pub(crate) trait ElementExt {
/// Recursively find all descendants with the given name
fn descendants(&self, name: &str) -> Vec<&Element>;
fn find_child(&self, name: &str) -> Option<Node<'a, 'a>>;
fn child_text(&self, name: &str) -> Option<&'a str>;
/// Recursively find the first descendant with the given name
fn descendant(&self, name: &str) -> Option<&Element>;
/// Recursively find the text of the first descendant with the given name
fn descendant_text(&self, name: &str) -> Option<String>;
/// Find the first child with the given name
fn child(&self, name: &str) -> Option<&Element>;
/// Find the text of the first child with the given name
fn child_text(&self, name: &str) -> Option<String>;
/// Get the direct child element with the given name
fn children(&self, name: &str) -> Vec<&Element>;
/// Get the attribute value by name
fn attr(&self, name: &str) -> Option<&str>;
}
impl<'a> NodeExt<'a> for Node<'a, 'a> {
fn find_descendant(&self, name: &str) -> Option<Node<'a, 'a>> {
self.descendants().find(|n| n.has_tag_name(name))
impl ElementExt for Element {
fn descendants(&self, name: &str) -> Vec<&Element> {
let mut results = Vec::new();
if self.name == name {
results.push(self);
}
for child in &self.children {
if let Some(element) = child.as_element() {
results.extend(element.descendants(name));
}
}
results
}
fn descendant_text(&self, name: &str) -> Option<&'a str> {
self.find_descendant(name).and_then(|node| node.text())
fn descendant(&self, name: &str) -> Option<&Element> {
if self.name == name {
return Some(self);
}
for child in &self.children {
if let Some(element) = child.as_element() {
if let Some(found) = element.descendant(name) {
return Some(found);
}
}
}
None
}
fn find_child(&self, name: &str) -> Option<Node<'a, 'a>> {
self.children().find(|n| n.has_tag_name(name))
fn descendant_text(&self, name: &str) -> Option<String> {
self
.descendant(name)
.and_then(|element| element.get_text().map(|s| s.to_string()))
}
fn child_text(&self, name: &str) -> Option<&'a str> {
self.find_child(name).and_then(|node| node.text())
fn child(&self, name: &str) -> Option<&Element> {
self.get_child(name)
}
fn child_text(&self, name: &str) -> Option<String> {
self
.get_child(name)
.and_then(|element| element.get_text().map(|s| s.to_string()))
}
fn children(&self, name: &str) -> Vec<&Element> {
self
.children
.iter()
.filter_map(|child| child.as_element())
.filter(|element| element.name == name)
.collect()
}
fn attr(&self, name: &str) -> Option<&str> {
self.attributes.get(name).map(|s| s.as_str())
}
}
+4 -1
View File
@@ -6,8 +6,11 @@ license.workspace = true
links = "openconnect"
[dependencies]
common = { path = "../common" }
log.workspace = true
is_executable.workspace = true
[build-dependencies]
cc = "1"
autotools = "0.2"
pkg-config = "0.3"
fs_extra = "1"
+82 -5
View File
@@ -1,14 +1,91 @@
use std::{env, path::PathBuf, process::Command};
fn main() {
// Link to the native openconnect library
println!("cargo:rustc-link-lib=openconnect");
println!("cargo:rustc-link-search=/opt/homebrew/lib"); // Homebrew path
let manifest_dir = env::var("CARGO_MANIFEST_DIR").unwrap();
let out_dir = PathBuf::from(env::var("OUT_DIR").unwrap());
let deps_dir = PathBuf::from(&manifest_dir).join("../../deps");
let openconnect_dir = deps_dir.join("openconnect");
let gp_version_patch = deps_dir.join("patches/openconnect-gp-version.patch");
// The temporary location where we will build
let build_src = out_dir.join("openconnect_build");
// Track changes so cargo rebuilds if patch or submodule changes
println!("cargo:rerun-if-changed={}", openconnect_dir.display());
println!("cargo:rerun-if-changed={}", gp_version_patch.display());
// Prepare the build directory
// If the directory exists from a previous run, remove it to ensure a clean slate
if build_src.exists() {
std::fs::remove_dir_all(&build_src).unwrap();
}
std::fs::create_dir_all(&build_src).unwrap();
// Copy the source code to OUT_DIR
// We use fs_extra options to copy contents recursively
let mut options = fs_extra::dir::CopyOptions::new();
options.overwrite = true;
options.content_only = true; // Copy content of src into dest, not src folder itself
fs_extra::dir::copy(&openconnect_dir, &build_src, &options).expect("Failed to copy C source code to OUT_DIR");
// Apply the Patch
// We use the system `patch` command.
let status = Command::new("patch")
.arg("-p1") // Strip one level of path (standard for git diffs)
.arg("-i") // Input file
.arg(&gp_version_patch)
.current_dir(&build_src) // Run INSIDE the copied dir
.status()
.expect("Failed to execute patch command");
if !status.success() {
panic!("Failed to apply patch file: {}", gp_version_patch.display());
}
// Build the OpenConnect library using autotools
// We explicitly enable static and disable shared to ensure we get a .a file.
// .reconf("-ivf") is CRITICAL for git submodules because 'configure'
// usually doesn't exist yet and needs to be generated.
let dst = autotools::Config::new(&build_src)
.reconf("-ivf")
.enable_static()
.disable_shared()
.disable("nls", None) // disable translations to save space
.disable("docs", None)
.disable("dsa-tests", None)
.without("libproxy", None)
.without("stoken", None)
.without("libpcsclite", None)
.without("libpskc", None)
.without("gssapi", None)
.with("gnutls-tss2", Some("no"))
.with("vpnc-script", Some("/etc/vpnc/vpnc-script")) // Specify vpnc-script, otherwise it will fail on macOS
.build();
// Link the 'openconnect' static library
println!("cargo:rustc-link-search=native={}/lib", dst.display());
println!("cargo:rustc-link-lib=static=openconnect");
// Using pkg-config to find system deps
pkg_config::probe_library("libxml-2.0").unwrap();
pkg_config::probe_library("zlib").unwrap();
pkg_config::probe_library("liblz4").unwrap();
pkg_config::probe_library("gnutls").unwrap();
// Below are required by gnutls
pkg_config::probe_library("p11-kit-1").unwrap();
pkg_config::probe_library("hogweed").unwrap();
pkg_config::probe_library("nettle").unwrap();
pkg_config::probe_library("gmp").unwrap();
// Compile the vpn.c file
println!("cargo:rerun-if-changed=src/ffi/vpn.c");
println!("cargo:rerun-if-changed=src/ffi/vpn.h");
// Compile the vpn.c file
cc::Build::new()
.file("src/ffi/vpn.c")
.include("src/ffi")
.include("/opt/homebrew/include") // Homebrew path
.include(&dst.join("include"))
.compile("vpn");
}
+9 -4
View File
@@ -2,6 +2,7 @@ use crate::Vpn;
use log::{debug, info, trace, warn};
use std::ffi::{c_char, c_int, c_void};
/// ConnectOptions struct for FFI, the field names and order must match the C definition.
#[repr(C)]
#[derive(Debug)]
pub(crate) struct ConnectOptions {
@@ -9,11 +10,15 @@ pub(crate) struct ConnectOptions {
pub server: *const c_char,
pub cookie: *const c_char,
pub user_agent: *const c_char,
pub os: *const c_char,
pub client_version: *const c_char,
pub script: *const c_char,
pub interface: *const c_char,
pub os: *const c_char,
pub script_tun: u32,
pub certificate: *const c_char,
pub sslkey: *const c_char,
pub key_password: *const c_char,
@@ -31,7 +36,7 @@ pub(crate) struct ConnectOptions {
}
#[link(name = "vpn")]
extern "C" {
unsafe extern "C" {
#[link_name = "vpn_connect"]
fn vpn_connect(options: *const ConnectOptions, callback: extern "C" fn(i32, *mut c_void)) -> c_int;
@@ -47,7 +52,7 @@ pub(crate) fn disconnect() {
unsafe { vpn_disconnect() }
}
#[no_mangle]
#[unsafe(no_mangle)]
extern "C" fn on_vpn_connected(pipe_fd: i32, vpn: *mut c_void) {
let vpn = unsafe { &*(vpn as *const Vpn) };
vpn.on_connected(pipe_fd);
@@ -56,7 +61,7 @@ extern "C" fn on_vpn_connected(pipe_fd: i32, vpn: *mut c_void) {
// Logger used in the C code.
// level: 0 = error, 1 = info, 2 = debug, 3 = trace
// map the error level log in openconnect to the warning level
#[no_mangle]
#[unsafe(no_mangle)]
extern "C" fn vpn_log(level: i32, message: *const c_char) {
let message = unsafe { std::ffi::CStr::from_ptr(message) };
let message = message.to_str().unwrap_or("Invalid log message");
+19 -5
View File
@@ -12,6 +12,7 @@ void *g_user_data;
static int g_cmd_pipe_fd;
static const char *g_vpnc_script;
static const char *g_vpnc_interface;
static int g_script_tun;
static vpn_connected_callback on_vpn_connected;
/* Validate the peer certificate */
@@ -41,8 +42,14 @@ static void print_progress(__attribute__((unused)) void *_vpninfo, int level,
static void setup_tun_handler(void *_vpninfo)
{
int ret = openconnect_setup_tun_device(_vpninfo, g_vpnc_script,
g_vpnc_interface);
int ret;
if (g_script_tun) {
ret = openconnect_setup_tun_script(_vpninfo, g_vpnc_script);
} else {
ret = openconnect_setup_tun_device(_vpninfo, g_vpnc_script,
g_vpnc_interface);
}
if (!ret) {
on_vpn_connected(g_cmd_pipe_fd, g_user_data);
}
@@ -51,18 +58,20 @@ static void setup_tun_handler(void *_vpninfo)
/* Initialize VPN connection */
int vpn_connect(const vpn_options *options, vpn_connected_callback callback)
{
INFO("openconnect version: %s", openconnect_get_version());
struct openconnect_info *vpninfo;
struct utsname utsbuf;
g_user_data = options->user_data;
g_vpnc_script = options->script;
g_vpnc_interface = options->interface;
g_script_tun = options->script_tun;
on_vpn_connected = callback;
INFO("User agent: %s", options->user_agent);
INFO("VPNC script: %s", options->script);
INFO("USER_AGENT: %s", options->user_agent);
INFO("OS: %s", options->os);
INFO("CLIENT_VERSION: %s", options->client_version);
INFO("VPNC_SCRIPT: %s", options->script);
INFO("SCRIPT_TUN: %d", g_script_tun);
INFO("CSD_USER: %d", options->csd_uid);
INFO("CSD_WRAPPER: %s", options->csd_wrapper);
INFO("RECONNECT_TIMEOUT: %d", options->reconnect_timeout);
@@ -90,6 +99,11 @@ int vpn_connect(const vpn_options *options, vpn_connected_callback callback)
openconnect_set_reported_os(vpninfo, options->os);
}
if (options->client_version) {
openconnect_set_gp_app_version(vpninfo,
options->client_version);
}
if (options->certificate) {
INFO("Setting client certificate: %s", options->certificate);
openconnect_set_client_cert(vpninfo, options->certificate,
+6 -1
View File
@@ -7,13 +7,18 @@ typedef void (*vpn_connected_callback)(int cmd_pipe_fd, void *user_data);
typedef struct vpn_options {
void *user_data;
const char *server;
const char *cookie;
const char *user_agent;
const char *os;
const char *client_version;
const char *script;
const char *interface;
const char *os;
const int script_tun;
const char *certificate;
const char *sslkey;
const char *key_password;
+2
View File
@@ -1,4 +1,6 @@
mod ffi;
mod vpn;
mod vpn_utils;
pub use vpn::*;
pub use vpn_utils::*;
+66 -14
View File
@@ -4,20 +4,25 @@ use std::{
sync::{Arc, RwLock},
};
use common::vpn_utils::{check_executable, find_vpnc_script};
use log::info;
use crate::ffi;
use crate::vpn_utils::{check_executable, find_csd_wrapper, find_vpnc_script};
type OnConnectedCallback = Arc<RwLock<Option<Box<dyn FnOnce() + 'static + Send + Sync>>>>;
pub struct Vpn {
server: CString,
cookie: CString,
user_agent: CString,
os: CString,
client_version: Option<CString>,
script: CString,
interface: Option<CString>,
os: CString,
script_tun: bool,
certificate: Option<CString>,
sslkey: Option<CString>,
key_password: Option<CString>,
@@ -66,10 +71,14 @@ impl Vpn {
server: self.server.as_ptr(),
cookie: self.cookie.as_ptr(),
user_agent: self.user_agent.as_ptr(),
os: self.os.as_ptr(),
client_version: Self::option_to_ptr(&self.client_version),
script: self.script.as_ptr(),
interface: Self::option_to_ptr(&self.interface),
os: self.os.as_ptr(),
script_tun: self.script_tun as u32,
certificate: Self::option_to_ptr(&self.certificate),
sslkey: Self::option_to_ptr(&self.sslkey),
@@ -119,14 +128,17 @@ pub struct VpnBuilder {
cookie: String,
script: Option<String>,
interface: Option<String>,
script_tun: bool,
user_agent: Option<String>,
os: Option<String>,
client_version: Option<String>,
certificate: Option<String>,
sslkey: Option<String>,
key_password: Option<String>,
hip: bool,
csd_uid: u32,
csd_wrapper: Option<String>,
@@ -145,14 +157,17 @@ impl VpnBuilder {
cookie: cookie.to_string(),
script: None,
interface: None,
script_tun: false,
user_agent: None,
os: None,
client_version: None,
certificate: None,
sslkey: None,
key_password: None,
hip: false,
csd_uid: 0,
csd_wrapper: None,
@@ -174,6 +189,11 @@ impl VpnBuilder {
self
}
pub fn script_tun(mut self, script_tun: bool) -> Self {
self.script_tun = script_tun;
self
}
pub fn user_agent<T: Into<Option<String>>>(mut self, user_agent: T) -> Self {
self.user_agent = user_agent.into();
self
@@ -184,6 +204,11 @@ impl VpnBuilder {
self
}
pub fn client_version<T: Into<Option<String>>>(mut self, client_version: T) -> Self {
self.client_version = client_version.into();
self
}
pub fn certificate<T: Into<Option<String>>>(mut self, certificate: T) -> Self {
self.certificate = certificate.into();
self
@@ -199,6 +224,11 @@ impl VpnBuilder {
self
}
pub fn hip(mut self, hip: bool) -> Self {
self.hip = hip;
self
}
pub fn csd_uid(mut self, csd_uid: u32) -> Self {
self.csd_uid = csd_uid;
self
@@ -234,18 +264,36 @@ impl VpnBuilder {
self
}
pub fn build(self) -> Result<Vpn, VpnError> {
let script = match self.script {
fn determine_script(&self) -> Result<&str, VpnError> {
match &self.script {
Some(script) => {
check_executable(&script).map_err(|e| VpnError::new(e.to_string()))?;
script
check_executable(script).map_err(|e| VpnError::new(e.to_string()))?;
Ok(script)
}
None => find_vpnc_script().ok_or_else(|| VpnError::new(String::from("Failed to find vpnc-script")))?,
};
if let Some(csd_wrapper) = &self.csd_wrapper {
check_executable(csd_wrapper).map_err(|e| VpnError::new(e.to_string()))?;
None => find_vpnc_script().ok_or_else(|| VpnError::new(String::from("Failed to find vpnc-script"))),
}
}
fn determine_csd_wrapper(&self) -> Result<Option<&str>, VpnError> {
if !self.hip {
return Ok(None);
}
match &self.csd_wrapper {
Some(csd_wrapper) if !csd_wrapper.is_empty() => {
check_executable(csd_wrapper).map_err(|e| VpnError::new(e.to_string()))?;
Ok(Some(csd_wrapper))
}
_ => {
let s = find_csd_wrapper().ok_or_else(|| VpnError::new(String::from("Failed to find csd wrapper")))?;
Ok(Some(s))
}
}
}
pub fn build(self) -> Result<Vpn, VpnError> {
let script = self.determine_script()?.to_owned();
let csd_wrapper = self.determine_csd_wrapper()?.map(|s| s.to_owned());
let user_agent = self.user_agent.unwrap_or_default();
let os = self.os.unwrap_or("linux".to_string());
@@ -253,10 +301,14 @@ impl VpnBuilder {
Ok(Vpn {
server: Self::to_cstring(&self.server),
cookie: Self::to_cstring(&self.cookie),
user_agent: Self::to_cstring(&user_agent),
os: Self::to_cstring(&os),
client_version: self.client_version.as_deref().map(Self::to_cstring),
script: Self::to_cstring(&script),
interface: self.interface.as_deref().map(Self::to_cstring),
os: Self::to_cstring(&os),
script_tun: self.script_tun,
certificate: self.certificate.as_deref().map(Self::to_cstring),
sslkey: self.sslkey.as_deref().map(Self::to_cstring),
@@ -264,7 +316,7 @@ impl VpnBuilder {
servercert: None,
csd_uid: self.csd_uid,
csd_wrapper: self.csd_wrapper.as_deref().map(Self::to_cstring),
csd_wrapper: csd_wrapper.as_deref().map(Self::to_cstring),
reconnect_timeout: self.reconnect_timeout,
mtu: self.mtu,
@@ -9,11 +9,13 @@ const VPNC_SCRIPT_LOCATIONS: &[&str] = &[
"/usr/sbin/vpnc-script",
"/etc/vpnc/vpnc-script",
"/etc/openconnect/vpnc-script",
"/usr/libexec/vpnc-scripts/vpnc-script",
#[cfg(target_os = "macos")]
"/opt/homebrew/etc/vpnc/vpnc-script",
];
const CSD_WRAPPER_LOCATIONS: &[&str] = &[
"/usr/libexec/gpclient/hipreport.sh",
#[cfg(target_arch = "x86_64")]
"/usr/lib/x86_64-linux-gnu/openconnect/hipreport.sh",
#[cfg(target_arch = "aarch64")]
@@ -24,22 +26,22 @@ const CSD_WRAPPER_LOCATIONS: &[&str] = &[
"/opt/homebrew/opt/openconnect/libexec/openconnect/hipreport.sh",
];
fn find_executable(locations: &[&str]) -> Option<String> {
fn find_executable(locations: &[&'static str]) -> Option<&'static str> {
for location in locations.iter() {
let path = Path::new(location);
if path.is_executable() {
return Some(location.to_string());
return Some(*location);
}
}
None
}
pub fn find_vpnc_script() -> Option<String> {
pub fn find_vpnc_script() -> Option<&'static str> {
find_executable(&VPNC_SCRIPT_LOCATIONS)
}
pub fn find_csd_wrapper() -> Option<String> {
pub fn find_csd_wrapper() -> Option<&'static str> {
find_executable(&CSD_WRAPPER_LOCATIONS)
}
Vendored Submodule
+1
Submodule deps/openconnect added at 0dcdff87db.
+98
View File
@@ -0,0 +1,98 @@
diff --git a/gpst.c b/gpst.c
index 244aaf04..17fc1f45 100644
--- a/gpst.c
+++ b/gpst.c
@@ -650,8 +650,11 @@ static int gpst_get_config(struct openconnect_info *vpninfo)
/* submit getconfig request */
+ char *app_version = openconnect_get_gp_app_version(vpninfo);
+ vpn_progress(vpninfo, PRG_DEBUG, _("Using GlobalProtect app version: %s\n"), app_version);
+
buf_append(request_body, "client-type=1&protocol-version=p1&internal=no");
- append_opt(request_body, "app-version", vpninfo->csd_ticket ? : "6.3.0-33");
+ append_opt(request_body, "app-version", app_version);
append_opt(request_body, "ipv6-support", vpninfo->disable_ipv6 ? "no" : "yes");
append_opt(request_body, "clientos", gpst_os_name(vpninfo));
append_opt(request_body, "os-version", vpninfo->platname);
@@ -1040,9 +1043,8 @@ static int run_hip_script(struct openconnect_info *vpninfo)
* accept new ones.
*/
unsetenv("APP_VERSION");
- if (vpninfo->csd_ticket)
- if (setenv("APP_VERSION", vpninfo->csd_ticket, 1))
- goto out;
+ if (setenv("APP_VERSION", openconnect_get_gp_app_version(vpninfo), 1))
+ goto out;
execv(hip_argv[0], (char **)hip_argv);
diff --git a/library.c b/library.c
index b5e74e9b..18334c76 100644
--- a/library.c
+++ b/library.c
@@ -896,6 +896,7 @@ void openconnect_vpninfo_free(struct openconnect_info *vpninfo)
free(vpninfo->localname);
free(vpninfo->useragent);
+ free(vpninfo->gp_app_version);
free(vpninfo->authgroup);
#ifdef HAVE_LIBSTOKEN
if (vpninfo->stoken_pin)
@@ -1019,6 +1020,20 @@ int openconnect_set_useragent(struct openconnect_info *vpninfo,
return 0;
}
+int openconnect_set_gp_app_version(struct openconnect_info *vpninfo,
+ const char *gp_app_version)
+{
+ UTF8CHECK(gp_app_version);
+
+ STRDUP(vpninfo->gp_app_version, gp_app_version);
+ return 0;
+}
+
+const char *openconnect_get_gp_app_version(struct openconnect_info *vpninfo)
+{
+ return vpninfo->csd_ticket ?: (vpninfo->gp_app_version ?: "6.3.0-33");
+}
+
int openconnect_set_urlpath(struct openconnect_info *vpninfo,
const char *urlpath)
{
diff --git a/openconnect-internal.h b/openconnect-internal.h
index abf45bbd..988f85f0 100644
--- a/openconnect-internal.h
+++ b/openconnect-internal.h
@@ -786,6 +786,7 @@ struct openconnect_info {
int is_dyndns; /* Attempt to redo DNS lookup on each CSTP reconnect */
char *useragent;
char *version_string;
+ char *gp_app_version;
const char *quit_reason;
const char *delay_tunnel_reason; /* If non-null, provides a reason why protocol is not yet ready for tunnel setup */
@@ -1677,6 +1678,9 @@ void openconnect_set_juniper(struct openconnect_info *vpninfo);
/* hpke.c */
int handle_external_browser(struct openconnect_info *vpninfo);
+/* Get the app version */
+const char *openconnect_get_gp_app_version(struct openconnect_info *vpninfo);
+
/* version.c */
extern const char openconnect_version_str[];
diff --git a/openconnect.h b/openconnect.h
index 136f181a..67fc1283 100644
--- a/openconnect.h
+++ b/openconnect.h
@@ -470,6 +470,9 @@ int openconnect_set_http_proxy(struct openconnect_info *vpninfo,
int openconnect_set_useragent(struct openconnect_info *vpninfo,
const char *useragent);
+int openconnect_set_gp_app_version(struct openconnect_info *vpninfo,
+ const char *gp_app_version);
+
int openconnect_passphrase_from_fsid(struct openconnect_info *vpninfo);
int openconnect_obtain_cookie(struct openconnect_info *vpninfo);
int openconnect_init_ssl(void);
Generated
+103 -25
View File
@@ -1,15 +1,56 @@
{
"nodes": {
"fenix": {
"inputs": {
"nixpkgs": [
"naersk",
"nixpkgs"
],
"rust-analyzer-src": "rust-analyzer-src"
},
"locked": {
"lastModified": 1752475459,
"narHash": "sha256-z6QEu4ZFuHiqdOPbYss4/Q8B0BFhacR8ts6jO/F/aOU=",
"owner": "nix-community",
"repo": "fenix",
"rev": "bf0d6f70f4c9a9cf8845f992105652173f4b617f",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "fenix",
"type": "github"
}
},
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"naersk": {
"inputs": {
"fenix": "fenix",
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1718727675,
"narHash": "sha256-uFsCwWYI2pUpt0awahSBorDUrUfBhaAiyz+BPTS2MHk=",
"lastModified": 1752689277,
"narHash": "sha256-uldUBFkZe/E7qbvxa3mH1ItrWZyT6w1dBKJQF/3ZSsc=",
"owner": "nix-community",
"repo": "naersk",
"rev": "941ce6dc38762a7cfb90b5add223d584feed299b",
"rev": "0e72363d0938b0208d6c646d10649164c43f4d64",
"type": "github"
},
"original": {
@@ -20,39 +61,43 @@
},
"nixpkgs": {
"locked": {
"lastModified": 0,
"narHash": "sha256-US1tAChvPxT52RV8GksWZS415tTS7PV42KTc2PNDBmc=",
"path": "/nix/store/aa0zsahvyqnvzkicsh29jirm9hwv95pg-source",
"type": "path"
},
"original": {
"id": "nixpkgs",
"type": "indirect"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1720244366,
"narHash": "sha256-WrDV0FPMVd2Sq9hkR5LNHudS3OSMmUrs90JUTN+MXpA=",
"lastModified": 1752077645,
"narHash": "sha256-HM791ZQtXV93xtCY+ZxG1REzhQenSQO020cu6rHtAPk=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "49ee0e94463abada1de470c9c07bfc12b36dcf40",
"rev": "be9e214982e20b8310878ac2baa063a961c1bdf6",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-24.05",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1761880412,
"narHash": "sha256-QoJjGd4NstnyOG4mm4KXF+weBzA2AH/7gn1Pmpfcb0A=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "a7fc11be66bdfb5cdde611ee5ce381c183da8386",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_3": {
"locked": {
"lastModified": 1718428119,
"narHash": "sha256-WdWDpNaq6u1IPtxtYHHWpl5BmabtpmLnMAx0RdJ/vo8=",
"lastModified": 1744536153,
"narHash": "sha256-awS2zRgF4uTwrOKwwiJcByDzDOdo3Q1rPZbiHQg/N38=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "e6cea36f83499eb4e9cd184c8a8e823296b50ad5",
"rev": "18dd725c29603f582cf1900e0d25f9f1063dbf11",
"type": "github"
},
"original": {
@@ -64,21 +109,39 @@
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"naersk": "naersk",
"nixpkgs": "nixpkgs_2",
"rust-overlay": "rust-overlay"
}
},
"rust-analyzer-src": {
"flake": false,
"locked": {
"lastModified": 1752428706,
"narHash": "sha256-EJcdxw3aXfP8Ex1Nm3s0awyH9egQvB2Gu+QEnJn2Sfg=",
"owner": "rust-lang",
"repo": "rust-analyzer",
"rev": "591e3b7624be97e4443ea7b5542c191311aa141d",
"type": "github"
},
"original": {
"owner": "rust-lang",
"ref": "nightly",
"repo": "rust-analyzer",
"type": "github"
}
},
"rust-overlay": {
"inputs": {
"nixpkgs": "nixpkgs_3"
},
"locked": {
"lastModified": 1720318855,
"narHash": "sha256-w3CCVK9LJ5aznXGkO1IyAlbvMNJfyA+dBF7Z1Zwx1LA=",
"lastModified": 1761878277,
"narHash": "sha256-6fCtyVdTzoQejwoextAu7dCLoy5fyD3WVh+Qm7t2Nhg=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "3eed08a074cd2000884a69d448d70da2843f7103",
"rev": "6604534e44090c917db714faa58d47861657690c",
"type": "github"
},
"original": {
@@ -86,6 +149,21 @@
"repo": "rust-overlay",
"type": "github"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
}
},
"root": "root",
+120 -48
View File
@@ -1,59 +1,131 @@
# This flake was initially generated by fh, the CLI for FlakeHub (version 0.1.12)
{
# Flake inputs
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
flake-utils.url = "github:numtide/flake-utils";
naersk.url = "github:nix-community/naersk";
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
rust-overlay.url = "github:oxalica/rust-overlay";
};
# Flake outputs that other flakes can use
outputs = {
self,
nixpkgs,
naersk,
rust-overlay,
}: let
supportedSystems = ["x86_64-linux" "aarch64-linux"];
forEachSupportedSystem = f:
nixpkgs.lib.genAttrs supportedSystems (system:
f rec {
pkgs = import nixpkgs {
inherit system;
overlays = [rust-overlay.overlays.default];
};
naersk' = pkgs.callPackage naersk {};
});
in {
packages = forEachSupportedSystem ({
pkgs,
naersk',
}: {
default = naersk'.buildPackage {
src = ./.;
nativeBuildInputs = with pkgs; [
perl
jq
openconnect
libsoup
webkitgtk
pkg-config
];
outputs =
{
self,
flake-utils,
naersk,
nixpkgs,
rust-overlay,
}:
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = (import nixpkgs) {
inherit system;
overlays = [ (import rust-overlay) ];
};
overrideMain = {...}: {
postPatch = ''
substituteInPlace crates/common/src/vpn_utils.rs \
--replace-fail /etc/vpnc/vpnc-script ${pkgs.vpnc-scripts}/bin/vpnc-script
substituteInPlace crates/gpapi/src/lib.rs \
--replace-fail /usr/bin/gpclient $out/bin/gpclient \
--replace-fail /usr/bin/gpservice $out/bin/gpservice \
--replace-fail /usr/bin/gpgui-helper $out/bin/gpgui-helper \
--replace-fail /usr/bin/gpgui $out/bin/gpgui \
--replace-fail /usr/bin/gpauth $out/bin/gpauth
cargoToml = builtins.fromTOML (builtins.readFile ./Cargo.toml);
pname = "globalprotect-openconnect";
version = cargoToml.workspace.package.version;
toolchain = pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
naersk' = pkgs.callPackage naersk {
cargo = toolchain;
rustc = toolchain;
};
cpu = pkgs.stdenv.hostPlatform.parsed.cpu.name;
gpgui = pkgs.fetchzip {
url = "https://github.com/yuezk/GlobalProtect-openconnect/releases/download/v${version}/gpgui_${cpu}.bin.tar.xz";
hash = "sha256-Cvy/ca2Q4LdxX7Z9KzuQy6t6FDMcaSyyyjF/YCnZeeM=";
};
in
{
# For `nix build`
packages.default = naersk'.buildPackage {
inherit pname version;
# Must be set to true to avoid issues with the Tauri build process
singleStep = true;
src = ./.;
buildInputs =
with pkgs;
[
openconnect
]
++ lib.optionals stdenv.isLinux [
glib
gtk3
libsoup_3
webkitgtk_4_1
];
nativeBuildInputs =
with pkgs;
[ ]
++ lib.optionals stdenv.isLinux [
autoPatchelfHook
];
runtimeDependencies =
with pkgs;
[ ]
++ lib.optionals stdenv.isLinux [
libappindicator-gtk3
];
overrideMain =
{ ... }:
{
postPatch = ''
substituteInPlace crates/openconnect/src/vpn_utils.rs \
--replace-fail /etc/vpnc/vpnc-script ${pkgs.vpnc-scripts}/bin/vpnc-script \
--replace-fail /usr/lib/openconnect/hipreport.sh ${pkgs.openconnect}/libexec/openconnect/hipreport.sh
substituteInPlace crates/common/src/constants.rs \
--replace-fail /usr/bin/gpclient $out/bin/gpclient \
--replace-fail /usr/bin/gpservice $out/bin/gpservice \
--replace-fail /usr/bin/gpgui-helper $out/bin/gpgui-helper \
--replace-fail /usr/bin/gpgui $out/bin/gpgui \
--replace-fail /usr/bin/gpauth $out/bin/gpauth
'';
};
postInstall = ''
# Copy the prebuilt gpgui binary to the output bin directory
cp ${gpgui}/gpgui $out/bin/gpgui
chmod +x $out/bin/gpgui
cp -r packaging/files/usr/share $out/share
cp -r packaging/files/usr/lib $out/lib
# Change the `/usr/bin/gpclient` path in the desktop file
substituteInPlace $out/share/applications/gpgui.desktop \
--replace-fail /usr/bin/gpclient $out/bin/gpclient
substituteInPlace $out/lib/NetworkManager/dispatcher.d/pre-down.d/gpclient.down \
--replace-fail /usr/bin/gpclient $out/bin/gpclient
# Change the `/usr/bin/gpservice` path in the polkit policy file
substituteInPlace $out/share/polkit-1/actions/com.yuezk.gpgui.policy \
--replace-fail /usr/bin/gpservice $out/bin/gpservice
'';
};
};
});
};
apps.default = {
type = "app";
program = "${self.packages.${system}.default}/bin/gpclient";
};
# For `nix develop`: not fully set up yet
devShell = pkgs.mkShell {
nativeBuildInputs = with pkgs; [
rustc
cargo
];
};
}
);
}
+5
View File
@@ -10,6 +10,9 @@ install:
install -Dm755 artifacts/usr/bin/gpgui $(DESTDIR)/usr/bin/gpgui; \
fi
# Install the HIP report script
install -Dm755 artifacts/usr/libexec/gpclient/hipreport.sh $(DESTDIR)/usr/libexec/gpclient/hipreport.sh
# Install the disconnect hooks
install -Dm755 artifacts/usr/lib/NetworkManager/dispatcher.d/pre-down.d/gpclient.down $(DESTDIR)/usr/lib/NetworkManager/dispatcher.d/pre-down.d/gpclient.down
install -Dm755 artifacts/usr/lib/NetworkManager/dispatcher.d/gpclient-nm-hook $(DESTDIR)/usr/lib/NetworkManager/dispatcher.d/gpclient-nm-hook
@@ -30,6 +33,8 @@ uninstall:
rm -f $(DESTDIR)/usr/bin/gpgui-helper
rm -f $(DESTDIR)/usr/bin/gpgui
rm -f $(DESTDIR)/usr/libexec/gpclient/hipreport.sh
rm -f $(DESTDIR)/usr/lib/NetworkManager/dispatcher.d/pre-down.d/gpclient.down
rm -f $(DESTDIR)/usr/lib/NetworkManager/dispatcher.d/gpclient-nm-hook
+3 -4
View File
@@ -5,7 +5,6 @@ Maintainer: Kevin Yue <[email protected]>
Standards-Version: 4.1.4
Build-Depends: debhelper (>= 9),
pkg-config,
jq (>= 1),
make (>= 4),
libssl-dev,
libsecret-1-0,
@@ -13,7 +12,7 @@ Build-Depends: debhelper (>= 9),
gnome-keyring,
libwebkit2gtk-4.1-dev,
libopenconnect-dev (>= 8.20),
rust-1.82-all | rust-1.85-all
rust-1.85-all
Homepage: https://github.com/yuezk/GlobalProtect-openconnect
Package: globalprotect-openconnect
@@ -25,5 +24,5 @@ Depends: ${misc:Depends},
libsecret-1-0,
libayatana-appindicator3-1,
gnome-keyring,
Description: A GUI for GlobalProtect VPN
A GUI for GlobalProtect VPN, based on OpenConnect, supports the SSO authentication method.
Description: A GUI client for GlobalProtect VPN
A GUI client for GlobalProtect VPN, based on OpenConnect, supports the SSO authentication method.
+1 -1
View File
@@ -5,7 +5,7 @@ export BUILD_FE = 0
export BUILD_GUI = @BUILD_GUI@
export DISABLE_RUST_TOOLCHAIN = 0
export PATH := /usr/lib/rust-1.82/bin:/usr/lib/rust-1.85/bin:$(PATH)
export PATH := /usr/lib/rust-1.85/bin:$(PATH)
%:
which cargo
+11
View File
@@ -0,0 +1,11 @@
#!/bin/sh
# Wrapper for gpclient hip
GPCLIENT_BIN="/usr/bin/gpclient"
# Redirect the output to a file for debugging then output to stdout
LOGFILE="/tmp/gpclient-hipreport.log"
HIP_REPORT_OUTPUT=$(exec 2> "$LOGFILE" "$GPCLIENT_BIN" hip -vv "$@")
echo "$HIP_REPORT_OUTPUT"
@@ -1,8 +1,8 @@
[Desktop Entry]
Type=Application
Name=GlobalProtect Openconnect VPN Client
Comment=A GUI for GlobalProtect VPN
Name=GP Connect
Comment=A GUI client for GlobalProtect VPN
GenericName=GlobalProtect VPN Client
Categories=Network;Dialup;
Exec=/usr/bin/gpclient launch-gui %u
+5 -3
View File
@@ -4,12 +4,14 @@ _pkgname=@PKG_NAME@
pkgname=${_pkgname}
pkgver="@VERSION@"
pkgrel=@REVISION@
pkgdesc="A GUI for GlobalProtect VPN, based on OpenConnect, supports the SSO authentication method."
pkgdesc="A GUI client for GlobalProtect VPN, based on OpenConnect, supports the SSO authentication method."
arch=('x86_64' 'aarch64')
url="https://github.com/yuezk/GlobalProtect-openconnect"
license=('GPL3')
makedepends=('make' 'pkg-config' 'rust' 'cargo' 'jq' 'webkit2gtk-4.1' 'curl' 'wget' 'file' 'openssl' 'appmenu-gtk-module' 'libappindicator-gtk3' 'librsvg' 'openconnect' 'libsecret')
depends=('openconnect>=8.20' webkit2gtk-4.1 libappindicator-gtk3 libsecret)
makedepends=('make' 'pkg-config' 'rust' 'cargo' 'file')
depends=('webkit2gtk-4.1' 'libappindicator-gtk3' 'librsvg' 'libsecret' 'openssl' 'appmenu-gtk-module'
'gnutls' 'libxml2' 'vpnc' 'lz4' 'libp11-kit' 'nettle' 'xdg-utils'
'openconnect>=8.20')
optdepends=('wmctrl: for window management')
provides=('globalprotect-openconnect' 'gpclient' 'gpservice' 'gpauth' 'gpgui')
@@ -11,7 +11,6 @@ Source: @SOURCE@
BuildRequires: make
BuildRequires: rust
BuildRequires: cargo
BuildRequires: jq
BuildRequires: pkg-config
BuildRequires: openconnect-devel
BuildRequires: (openssl-devel or libopenssl-devel)
@@ -53,6 +52,7 @@ make build OFFLINE=@OFFLINE@ BUILD_FE=0
%files
%defattr(-,root,root)
%{_bindir}/*
%{_libexecdir}/gpclient/hipreport.sh
%{_datadir}/applications/gpgui.desktop
%{_datadir}/icons/hicolor/32x32/apps/gpgui.png
%{_datadir}/icons/hicolor/128x128/apps/gpgui.png
@@ -67,6 +67,8 @@ make build OFFLINE=@OFFLINE@ BUILD_FE=0
/usr/lib/NetworkManager/dispatcher.d/pre-down.d/gpclient.down
/usr/lib/NetworkManager/dispatcher.d/gpclient-nm-hook
%dir %{_libexecdir}
%dir %{_libexecdir}/gpclient
%dir %{_datadir}/icons/hicolor
%dir %{_datadir}/icons/hicolor/32x32
%dir %{_datadir}/icons/hicolor/32x32/apps
+1 -1
View File
@@ -1,2 +1,2 @@
[toolchain]
channel = "1.82"
channel = "1.85"
+1 -1
View File
@@ -4,5 +4,5 @@ tab_spaces = 2
newline_style = "Unix"
reorder_imports = true
reorder_modules = true
edition = "2021"
edition = "2024"
merge_derives = true