diff --git a/.changes/api-module-resolution-node.md b/.changes/api-module-resolution-node.md new file mode 100644 index 000000000..26e96bf91 --- /dev/null +++ b/.changes/api-module-resolution-node.md @@ -0,0 +1,5 @@ +--- +"@tauri-apps/api": "patch:bug" +--- + +Fix a regression where typescript could not find types when using `"moduleResolution": "node"` diff --git a/.changes/arboard.md b/.changes/arboard.md new file mode 100644 index 000000000..5a6aadb1f --- /dev/null +++ b/.changes/arboard.md @@ -0,0 +1,5 @@ +--- +"tauri-runtime-wry": patch:bug +--- + +Use `arboard` instead of `tao` clipboard implementation to prevent a crash. diff --git a/.changes/config-f64-deserialize.md b/.changes/config-f64-deserialize.md new file mode 100644 index 000000000..bd2f145b0 --- /dev/null +++ b/.changes/config-f64-deserialize.md @@ -0,0 +1,5 @@ +--- +'tauri-utils': 'patch:bug' +--- + +Fix compile error when parsing config that includes float values. diff --git a/.changes/dialog-window-forward-slash.md b/.changes/dialog-window-forward-slash.md new file mode 100644 index 000000000..83fcda5eb --- /dev/null +++ b/.changes/dialog-window-forward-slash.md @@ -0,0 +1,5 @@ +--- +'tauri': 'patch:bug' +--- + +On Windows, fix `open` dialog `defaultPath`, when invoked from JS, not working if the path uses forward slash (`/`) diff --git a/.changes/nsis-german.md b/.changes/nsis-german.md deleted file mode 100644 index 8425d0cf2..000000000 --- a/.changes/nsis-german.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'tauri-bundler': 'patch:enhance' ---- - -Added German language support to the NSIS bundler. diff --git a/.github/workflows/test-cli-rs.yml b/.github/workflows/test-cli-rs.yml index 716645fa2..49a5c9672 100644 --- a/.github/workflows/test-cli-rs.yml +++ b/.github/workflows/test-cli-rs.yml @@ -66,5 +66,5 @@ jobs: with: workspaces: tooling/cli - - name: build CLI - run: cargo build --manifest-path ./tooling/cli/Cargo.toml ${{ matrix.platform.args }} + - name: test CLI + run: cargo test --manifest-path ./tooling/cli/Cargo.toml ${{ matrix.platform.args }} diff --git a/core/tauri-macros/CHANGELOG.md b/core/tauri-macros/CHANGELOG.md index de9cd0eb0..ecb86702d 100644 --- a/core/tauri-macros/CHANGELOG.md +++ b/core/tauri-macros/CHANGELOG.md @@ -112,6 +112,12 @@ - First mobile alpha release! - [fa3a1098](https://www.github.com/tauri-apps/tauri/commit/fa3a10988a03aed1b66fb17d893b1a9adb90f7cd) feat(ci): prepare 2.0.0-alpha.0 ([#5786](https://www.github.com/tauri-apps/tauri/pull/5786)) on 2022-12-08 +## \[1.4.2] + +### Enhancements + +- [`5e05236b`](https://www.github.com/tauri-apps/tauri/commit/5e05236b4987346697c7caae0567d3c50714c198)([#8289](https://www.github.com/tauri-apps/tauri/pull/8289)) Added tracing for window startup, plugins, `Window::eval`, events, IPC, updater and custom protocol request handlers behind the `tracing` feature flag. + ## \[1.4.1] ### Dependencies diff --git a/core/tauri-macros/Cargo.toml b/core/tauri-macros/Cargo.toml index bea44962a..58309c9fc 100644 --- a/core/tauri-macros/Cargo.toml +++ b/core/tauri-macros/Cargo.toml @@ -16,7 +16,7 @@ rust-version = { workspace = true } proc-macro = true [dependencies] -proc-macro2 = "1" +proc-macro2 = { version = "1", features = [ "span-locations" ] } quote = "1" syn = { version = "2", features = [ "full" ] } heck = "0.4" @@ -29,3 +29,4 @@ compression = [ "tauri-codegen/compression" ] isolation = [ "tauri-codegen/isolation" ] config-json5 = [ "tauri-codegen/config-json5", "tauri-utils/config-json5" ] config-toml = [ "tauri-codegen/config-toml", "tauri-utils/config-toml" ] +tracing = [ ] diff --git a/core/tauri-macros/src/command/wrapper.rs b/core/tauri-macros/src/command/wrapper.rs index ac56829f3..c28c74c0f 100644 --- a/core/tauri-macros/src/command/wrapper.rs +++ b/core/tauri-macros/src/command/wrapper.rs @@ -214,6 +214,32 @@ pub fn wrapper(attributes: TokenStream, item: TokenStream) -> TokenStream { let root = attrs.root; + let kind = match attrs.execution_context { + ExecutionContext::Async if function.sig.asyncness.is_none() => "sync_threadpool", + ExecutionContext::Async => "async", + ExecutionContext::Blocking => "sync", + }; + + let loc = function.span().start(); + let line = loc.line; + let col = loc.column; + + let maybe_span = if cfg!(feature = "tracing") { + quote!({ + let _span = tracing::debug_span!( + "ipc::request::handler", + cmd = #message.command(), + kind = #kind, + loc.line = #line, + loc.col = #col, + is_internal = false, + ) + .entered(); + }) + } else { + quote!() + }; + // Rely on rust 2018 edition to allow importing a macro from a path. quote!( #async_command_check @@ -231,6 +257,8 @@ pub fn wrapper(attributes: TokenStream, item: TokenStream) -> TokenStream { #[allow(unused_variables)] let #root::ipc::Invoke { message: #message, resolver: #resolver } = $invoke; + #maybe_span + #body }}; } @@ -254,6 +282,21 @@ fn body_async( ) -> syn::Result { let Invoke { message, resolver } = invoke; parse_args(function, message, attributes).map(|args| { + #[cfg(feature = "tracing")] + quote! { + use tracing::Instrument; + + let span = tracing::debug_span!("ipc::request::run"); + #resolver.respond_async_serialized(async move { + let result = $path(#(#args?),*); + let kind = (&result).async_kind(); + kind.future(result).await + } + .instrument(span)); + return true; + } + + #[cfg(not(feature = "tracing"))] quote! { #resolver.respond_async_serialized(async move { let result = $path(#(#args?),*); @@ -284,7 +327,14 @@ fn body_blocking( Err(err) => { #resolver.invoke_error(err); return true }, }); + let maybe_span = if cfg!(feature = "tracing") { + quote!(let _span = tracing::debug_span!("ipc::request::run").entered();) + } else { + quote!() + }; + Ok(quote! { + #maybe_span let result = $path(#(match #args #match_body),*); let kind = (&result).blocking_kind(); kind.block(result, #resolver); diff --git a/core/tauri-runtime-wry/CHANGELOG.md b/core/tauri-runtime-wry/CHANGELOG.md index f0ecc1efd..52ed4179b 100644 --- a/core/tauri-runtime-wry/CHANGELOG.md +++ b/core/tauri-runtime-wry/CHANGELOG.md @@ -160,6 +160,12 @@ - Support `with_webview` for Android platform alowing execution of JNI code in context. - [8ea87e9c](https://www.github.com/tauri-apps/tauri/commit/8ea87e9c9ca8ba4c7017c8281f78aacd08f45785) feat(android): with_webview access for jni execution ([#5148](https://www.github.com/tauri-apps/tauri/pull/5148)) on 2022-09-08 +## \[0.14.2] + +### Enhancements + +- [`5e05236b`](https://www.github.com/tauri-apps/tauri/commit/5e05236b4987346697c7caae0567d3c50714c198)([#8289](https://www.github.com/tauri-apps/tauri/pull/8289)) Added tracing for window startup, plugins, `Window::eval`, events, IPC, updater and custom protocol request handlers behind the `tracing` feature flag. + ## \[0.14.1] ### Enhancements diff --git a/core/tauri-runtime-wry/Cargo.toml b/core/tauri-runtime-wry/Cargo.toml index 677a13d3d..46aafffaa 100644 --- a/core/tauri-runtime-wry/Cargo.toml +++ b/core/tauri-runtime-wry/Cargo.toml @@ -19,6 +19,7 @@ tauri-runtime = { version = "1.0.0-alpha.7", path = "../tauri-runtime" } tauri-utils = { version = "2.0.0-alpha.12", path = "../tauri-utils" } raw-window-handle = "0.5" http = "0.2" +tracing = { version = "0.1", optional = true } [target."cfg(windows)".dependencies] webview2-com = "0.28" @@ -47,3 +48,4 @@ macos-private-api = [ ] objc-exception = [ "wry/objc-exception" ] linux-protocol-body = [ "wry/linux-body", "webkit2gtk/v2_40" ] +tracing = [ "dep:tracing" ] diff --git a/core/tauri-runtime-wry/src/lib.rs b/core/tauri-runtime-wry/src/lib.rs index cbde23909..d566e9e5a 100644 --- a/core/tauri-runtime-wry/src/lib.rs +++ b/core/tauri-runtime-wry/src/lib.rs @@ -239,21 +239,39 @@ impl Context { } } -#[derive(Clone)] +#[cfg(feature = "tracing")] +#[derive(Debug, Clone, Default)] +pub struct ActiveTraceSpanStore(Rc>>); + +#[cfg(feature = "tracing")] +impl ActiveTraceSpanStore { + pub fn remove_window_draw(&self, window_id: WindowId) { + let mut store = self.0.borrow_mut(); + if let Some(index) = store + .iter() + .position(|t| matches!(t, ActiveTracingSpan::WindowDraw { id, span: _ } if id == &window_id)) + { + store.remove(index); + } + } +} + +#[cfg(feature = "tracing")] +#[derive(Debug)] +pub enum ActiveTracingSpan { + WindowDraw { + id: WindowId, + span: tracing::span::EnteredSpan, + }, +} + +#[derive(Debug, Clone)] pub struct DispatcherMainThreadContext { pub window_target: EventLoopWindowTarget>, pub web_context: WebContextStore, pub windows: Rc>>, -} - -impl std::fmt::Debug for DispatcherMainThreadContext { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.debug_struct("DispatcherMainThreadContext") - .field("window_target", &self.window_target) - .field("web_context", &self.web_context) - .field("windows", &self.windows) - .finish() - } + #[cfg(feature = "tracing")] + pub active_tracing_spans: ActiveTraceSpanStore, } // SAFETY: we ensure this type is only used on the main thread. @@ -1051,7 +1069,10 @@ pub enum WindowMessage { #[derive(Debug, Clone)] pub enum WebviewMessage { + #[cfg(not(feature = "tracing"))] EvaluateScript(String), + #[cfg(feature = "tracing")] + EvaluateScript(String, Sender<()>, tracing::Span), #[allow(dead_code)] WebviewEvent(WebviewEvent), Print, @@ -1560,6 +1581,21 @@ impl Dispatch for WryDispatcher { ) } + #[cfg(feature = "tracing")] + fn eval_script>(&self, script: S) -> Result<()> { + // use a channel so the EvaluateScript task uses the current span as parent + let (tx, rx) = channel(); + getter!( + self, + rx, + Message::Webview( + self.window_id, + WebviewMessage::EvaluateScript(script.into(), tx, tracing::Span::current()), + ) + ) + } + + #[cfg(not(feature = "tracing"))] fn eval_script>(&self, script: S) -> Result<()> { send_user_message( &self.context, @@ -1867,6 +1903,8 @@ impl Wry { window_target: event_loop.deref().clone(), web_context, windows, + #[cfg(feature = "tracing")] + active_tracing_spans: Default::default(), }, plugins: Default::default(), next_window_id: Default::default(), @@ -2009,6 +2047,9 @@ impl Runtime for Wry { let web_context = &self.context.main_thread.web_context; let plugins = self.context.plugins.clone(); + #[cfg(feature = "tracing")] + let active_tracing_spans = self.context.main_thread.active_tracing_spans.clone(); + let mut iteration = RunIteration::default(); let proxy = self.event_loop.create_proxy(); @@ -2031,6 +2072,8 @@ impl Runtime for Wry { callback: &mut callback, webview_id_map: webview_id_map.clone(), windows: windows.clone(), + #[cfg(feature = "tracing")] + active_tracing_spans: active_tracing_spans.clone(), }, web_context, ); @@ -2047,6 +2090,8 @@ impl Runtime for Wry { callback: &mut callback, windows: windows.clone(), webview_id_map: webview_id_map.clone(), + #[cfg(feature = "tracing")] + active_tracing_spans: active_tracing_spans.clone(), }, web_context, ); @@ -2061,6 +2106,8 @@ impl Runtime for Wry { let web_context = self.context.main_thread.web_context; let plugins = self.context.plugins.clone(); + #[cfg(feature = "tracing")] + let active_tracing_spans = self.context.main_thread.active_tracing_spans.clone(); let proxy = self.event_loop.create_proxy(); self.event_loop.run(move |event, event_loop, control_flow| { @@ -2074,6 +2121,8 @@ impl Runtime for Wry { callback: &mut callback, webview_id_map: webview_id_map.clone(), windows: windows.clone(), + #[cfg(feature = "tracing")] + active_tracing_spans: active_tracing_spans.clone(), }, &web_context, ); @@ -2089,6 +2138,8 @@ impl Runtime for Wry { callback: &mut callback, webview_id_map: webview_id_map.clone(), windows: windows.clone(), + #[cfg(feature = "tracing")] + active_tracing_spans: active_tracing_spans.clone(), }, &web_context, ); @@ -2100,6 +2151,8 @@ pub struct EventLoopIterationContext<'a, T: UserEvent> { pub callback: &'a mut (dyn FnMut(RunEvent) + 'static), pub webview_id_map: WebviewIdStore, pub windows: Rc>>, + #[cfg(feature = "tracing")] + pub active_tracing_spans: ActiveTraceSpanStore, } struct UserMessageContext { @@ -2374,6 +2427,19 @@ fn handle_user_message( } } Message::Webview(id, webview_message) => match webview_message { + #[cfg(feature = "tracing")] + WebviewMessage::EvaluateScript(script, tx, span) => { + let _span = span.entered(); + if let Some(WindowHandle::Webview { inner: webview, .. }) = + windows.borrow().get(&id).and_then(|w| w.inner.as_ref()) + { + if let Err(e) = webview.evaluate_script(&script) { + debug_eprintln!("{}", e); + } + } + tx.send(()).unwrap(); + } + #[cfg(not(feature = "tracing"))] WebviewMessage::EvaluateScript(script) => { if let Some(WindowHandle::Webview { inner: webview, .. }) = windows.borrow().get(&id).and_then(|w| w.inner.as_ref()) @@ -2441,6 +2507,8 @@ fn handle_event_loop( callback, webview_id_map, windows, + #[cfg(feature = "tracing")] + active_tracing_spans, } = context; if *control_flow != ControlFlow::Exit { *control_flow = ControlFlow::Wait; @@ -2463,6 +2531,11 @@ fn handle_event_loop( callback(RunEvent::Exit); } + #[cfg(feature = "tracing")] + Event::RedrawRequested(id) => { + active_tracing_spans.remove_window_draw(id); + } + Event::UserEvent(Message::Webview(id, WebviewMessage::WebviewEvent(event))) => { if let Some(event) = WindowEventWrapper::from(&event).0 { let windows = windows.borrow(); @@ -2650,6 +2723,14 @@ fn create_webview( .. } = pending; + #[cfg(feature = "tracing")] + let _webview_create_span = tracing::debug_span!("wry::webview::create").entered(); + #[cfg(feature = "tracing")] + let window_draw_span = tracing::debug_span!("wry::window::draw").entered(); + #[cfg(feature = "tracing")] + let window_create_span = + tracing::debug_span!(parent: &window_draw_span, "wry::window::create").entered(); + let window_event_listeners = WindowEventListeners::default(); #[cfg(windows)] @@ -2678,6 +2759,21 @@ fn create_webview( let focused = window_builder.inner.window.focused; let window = window_builder.inner.build(event_loop).unwrap(); + #[cfg(feature = "tracing")] + { + drop(window_create_span); + + context + .main_thread + .active_tracing_spans + .0 + .borrow_mut() + .push(ActiveTracingSpan::WindowDraw { + id: window.id(), + span: window_draw_span, + }); + } + context.webview_id_map.insert(window.id(), window_id); if window_builder.center { diff --git a/core/tauri-utils/CHANGELOG.md b/core/tauri-utils/CHANGELOG.md index 362430043..2b4f2a8de 100644 --- a/core/tauri-utils/CHANGELOG.md +++ b/core/tauri-utils/CHANGELOG.md @@ -112,6 +112,12 @@ - First mobile alpha release! - [fa3a1098](https://www.github.com/tauri-apps/tauri/commit/fa3a10988a03aed1b66fb17d893b1a9adb90f7cd) feat(ci): prepare 2.0.0-alpha.0 ([#5786](https://www.github.com/tauri-apps/tauri/pull/5786)) on 2022-12-08 +## \[1.5.3] + +### New Features + +- [`b3e53e72`](https://www.github.com/tauri-apps/tauri/commit/b3e53e7243311a2659b7569dddc20c56ac9f9d8e)([#8288](https://www.github.com/tauri-apps/tauri/pull/8288)) Added `Assets::iter` to iterate on all embedded assets. + ## \[1.5.0] ### New Features diff --git a/core/tauri-utils/src/assets.rs b/core/tauri-utils/src/assets.rs index 5b035a386..ca7f3de69 100644 --- a/core/tauri-utils/src/assets.rs +++ b/core/tauri-utils/src/assets.rs @@ -109,6 +109,9 @@ pub trait Assets: Send + Sync + 'static { /// Get the content of the passed [`AssetKey`]. fn get(&self, key: &AssetKey) -> Option>; + /// Iterator for the assets. + fn iter(&self) -> Box + '_>; + /// Gets the hashes for the CSP tag of the HTML on the given path. fn csp_hashes(&self, html_path: &AssetKey) -> Box> + '_>; } @@ -163,6 +166,10 @@ impl Assets for EmbeddedAssets { .map(|a| Cow::Owned(a.to_vec())) } + fn iter(&self) -> Box + '_> { + Box::new(self.assets.into_iter()) + } + fn csp_hashes(&self, html_path: &AssetKey) -> Box> + '_> { Box::new( self diff --git a/core/tauri-utils/src/config.rs b/core/tauri-utils/src/config.rs index 34744989a..c4920de39 100644 --- a/core/tauri-utils/src/config.rs +++ b/core/tauri-utils/src/config.rs @@ -2200,7 +2200,7 @@ mod build { } else if num.is_f64() { // guaranteed f64 let num = num.as_f64().unwrap(); - quote! { #prefix::Number(#num.into()) } + quote! { #prefix::Number(::serde_json::Number::from_f64(#num).unwrap(/* safe to unwrap, guaranteed f64 */)) } } else { // invalid number quote! { #prefix::Null } diff --git a/core/tauri/CHANGELOG.md b/core/tauri/CHANGELOG.md index 49753a49d..ce0ff38d1 100644 --- a/core/tauri/CHANGELOG.md +++ b/core/tauri/CHANGELOG.md @@ -419,6 +419,23 @@ - Export types required by the `mobile_entry_point` macro. - [98904863](https://www.github.com/tauri-apps/tauri/commit/9890486321c9c79ccfb7c547fafee85b5c3ffa71) feat(core): add `mobile_entry_point` macro ([#4983](https://www.github.com/tauri-apps/tauri/pull/4983)) on 2022-08-21 +## \[1.5.3] + +### Enhancements + +- [`b3e53e72`](https://www.github.com/tauri-apps/tauri/commit/b3e53e7243311a2659b7569dddc20c56ac9f9d8e)([#8288](https://www.github.com/tauri-apps/tauri/pull/8288)) Added `AssetResolver::iter` to iterate on all embedded assets. +- [`5e05236b`](https://www.github.com/tauri-apps/tauri/commit/5e05236b4987346697c7caae0567d3c50714c198)([#8289](https://www.github.com/tauri-apps/tauri/pull/8289)) Added tracing for window startup, plugins, `Window::eval`, events, IPC, updater and custom protocol request handlers behind the `tracing` feature flag. + +### Bug Fixes + +- [`2ba88563`](https://www.github.com/tauri-apps/tauri/commit/2ba8856343e284ed022f28cff6d16db15ad4645f)([#8095](https://www.github.com/tauri-apps/tauri/pull/8095)) Fix docs.rs build for `x86_64-apple-darwin`. +- [`4b6a602a`](https://www.github.com/tauri-apps/tauri/commit/4b6a602a89b36f24d34d6ccd8e3c9b7ce202c9eb)([#8234](https://www.github.com/tauri-apps/tauri/pull/8234)) Escape path of the updater msi to avoid crashing on installers with spaces. + +### Dependencies + +- Upgraded to `tauri-runtime-wry@0.14.2` +- Upgraded to `tauri-macros@1.4.2` + ## \[1.5.2] ### Bug Fixes diff --git a/core/tauri/Cargo.toml b/core/tauri/Cargo.toml index 70ecac996..36e8dd5d8 100644 --- a/core/tauri/Cargo.toml +++ b/core/tauri/Cargo.toml @@ -70,6 +70,7 @@ infer = { version = "0.15", optional = true } png = { version = "0.17", optional = true } ico = { version = "0.3.0", optional = true } http-range = { version = "0.1.5", optional = true } +tracing = { version = "0.1", optional = true } [target."cfg(any(target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"openbsd\", target_os = \"netbsd\", target_os = \"windows\", target_os = \"macos\"))".dependencies] muda = { version = "0.11", default-features = false, features = [ "serde" ] } @@ -130,6 +131,11 @@ default = [ "muda/common-controls-v6" ] tray-icon = [ "dep:tray-icon" ] +tracing = [ + "dep:tracing", + "tauri-macros/tracing", + "tauri-runtime-wry/tracing" +] test = [ ] compression = [ "tauri-macros/compression", "tauri-utils/compression" ] wry = [ "tauri-runtime-wry" ] diff --git a/core/tauri/src/app.rs b/core/tauri/src/app.rs index f33b6af94..98f361f39 100644 --- a/core/tauri/src/app.rs +++ b/core/tauri/src/app.rs @@ -250,6 +250,11 @@ impl AssetResolver { pub fn get(&self, path: String) -> Option { self.manager.get_asset(path).ok() } + + /// Iterate on all assets. + pub fn iter(&self) -> Box + '_> { + self.manager.assets.iter() + } } /// A handle to the currently running application. @@ -341,20 +346,14 @@ impl AppHandle { /// Ok(()) /// }); /// ``` - pub fn plugin + 'static>(&self, mut plugin: P) -> crate::Result<()> { - plugin - .initialize( - self, - self - .config() - .plugins - .0 - .get(plugin.name()) - .cloned() - .unwrap_or_default(), - ) - .map_err(|e| crate::Error::PluginInitialization(plugin.name().to_string(), e.to_string()))?; - self.manager().plugins.lock().unwrap().register(plugin); + #[cfg_attr(feature = "tracing", tracing::instrument(name = "app::plugin::register", skip(plugin), fields(name = plugin.name())))] + pub fn plugin + 'static>(&self, plugin: P) -> crate::Result<()> { + let mut plugin = Box::new(plugin) as Box>; + + let mut store = self.manager().plugins.lock().unwrap(); + store.initialize(&mut plugin, self, &self.config().plugins)?; + store.register(plugin); + Ok(()) } @@ -922,6 +921,7 @@ impl App { /// } /// ``` #[cfg(desktop)] + #[cfg_attr(feature = "tracing", tracing::instrument(name = "app::run_iteration"))] pub fn run_iteration(&mut self) -> crate::runtime::RunIteration { let manager = self.manager.clone(); let app_handle = self.handle().clone(); @@ -1161,7 +1161,7 @@ impl Builder { /// ``` #[must_use] pub fn plugin + 'static>(mut self, plugin: P) -> Self { - self.plugins.register(plugin); + self.plugins.register(Box::new(plugin)); self } @@ -1447,6 +1447,10 @@ impl Builder { /// Builds the application. #[allow(clippy::type_complexity)] + #[cfg_attr( + feature = "tracing", + tracing::instrument(name = "app::build", skip_all) + )] pub fn build(mut self, context: Context) -> crate::Result> { #[cfg(target_os = "macos")] if self.menu.is_none() && self.enable_macos_default_menu { diff --git a/core/tauri/src/command.rs b/core/tauri/src/command.rs index f3da5359d..766e0186b 100644 --- a/core/tauri/src/command.rs +++ b/core/tauri/src/command.rs @@ -55,6 +55,8 @@ impl<'de, D: Deserialize<'de>, R: Runtime> CommandArg<'de, R> for D { fn from_command(command: CommandItem<'de, R>) -> Result { let name = command.name; let arg = command.key; + #[cfg(feature = "tracing")] + let _span = tracing::trace_span!("ipc::request::deserialize_arg", arg = arg).entered(); Self::deserialize(command).map_err(|e| crate::Error::InvalidArgs(name, arg, e).into()) } } @@ -178,6 +180,8 @@ pub mod private { }; use futures_util::{FutureExt, TryFutureExt}; use std::future::Future; + #[cfg(feature = "tracing")] + pub use tracing; // ===== impl IpcResponse ===== diff --git a/core/tauri/src/event/mod.rs b/core/tauri/src/event/mod.rs index ae4660410..484887d09 100644 --- a/core/tauri/src/event/mod.rs +++ b/core/tauri/src/event/mod.rs @@ -43,6 +43,8 @@ impl EmitArgs { source_window_label: Option<&str>, payload: S, ) -> crate::Result { + #[cfg(feature = "tracing")] + let _span = tracing::debug_span!("window::emit::serialize").entered(); Ok(EmitArgs { event_name: event.into(), event: serde_json::to_string(event)?, diff --git a/core/tauri/src/lib.rs b/core/tauri/src/lib.rs index 59a197ff9..82004059d 100644 --- a/core/tauri/src/lib.rs +++ b/core/tauri/src/lib.rs @@ -13,6 +13,7 @@ //! The following are a list of [Cargo features](https://doc.rust-lang.org/stable/cargo/reference/manifest.html#the-features-section) that can be enabled or disabled: //! //! - **wry** *(enabled by default)*: Enables the [wry](https://github.com/tauri-apps/wry) runtime. Only disable it if you want a custom runtime. +//! - **tracing**: Enables [`tracing`](https://docs.rs/tracing/latest/tracing) for window startup, plugins, `Window::eval`, events, IPC, updater and custom protocol request handlers. //! - **test**: Enables the [`test`] module exposing unit test helpers. //! - **objc-exception**: Wrap each msg_send! in a @try/@catch and panics if an exception is caught, preventing Objective-C from unwinding into Rust. //! - **linux-ipc-protocol**: Use custom protocol for faster IPC on Linux. Requires webkit2gtk v2.40 or above. @@ -642,6 +643,10 @@ pub trait Manager: sealed::ManagerBase { /// app.emit("synchronized", ()); /// } /// ``` + #[cfg_attr( + feature = "tracing", + tracing::instrument("app::emit", skip(self, payload)) + )] fn emit(&self, event: &str, payload: S) -> Result<()> { self.manager().emit(event, None, payload) } @@ -663,6 +668,10 @@ pub trait Manager: sealed::ManagerBase { /// } /// } /// ``` + #[cfg_attr( + feature = "tracing", + tracing::instrument("app::emit::to", skip(self, payload)) + )] fn emit_to(&self, label: &str, event: &str, payload: S) -> Result<()> { self .manager() @@ -686,6 +695,10 @@ pub trait Manager: sealed::ManagerBase { /// } /// } /// ``` + #[cfg_attr( + feature = "tracing", + tracing::instrument("app::emit::filter", skip(self, payload, filter)) + )] fn emit_filter(&self, event: &str, payload: S, filter: F) -> Result<()> where S: Serialize + Clone, diff --git a/core/tauri/src/manager/mod.rs b/core/tauri/src/manager/mod.rs index a30fee400..c244c2401 100644 --- a/core/tauri/src/manager/mod.rs +++ b/core/tauri/src/manager/mod.rs @@ -430,7 +430,7 @@ impl AppManager { .plugins .lock() .expect("poisoned plugin store") - .initialize(app, &self.config.plugins) + .initialize_all(app, &self.config.plugins) } pub fn config(&self) -> &Config { diff --git a/core/tauri/src/plugin.rs b/core/tauri/src/plugin.rs index 5ba039a19..e4376a7de 100644 --- a/core/tauri/src/plugin.rs +++ b/core/tauri/src/plugin.rs @@ -6,12 +6,11 @@ use crate::{ app::UriSchemeResponder, - error::Error, ipc::{Invoke, InvokeHandler}, manager::window::UriSchemeProtocol, utils::config::PluginConfig, window::PageLoadPayload, - AppHandle, RunEvent, Runtime, Window, + AppHandle, Error, RunEvent, Runtime, Window, }; use serde::de::DeserializeOwned; use serde_json::Value as JsonValue; @@ -692,11 +691,11 @@ impl PluginStore { /// Adds a plugin to the store. /// /// Returns `true` if a plugin with the same name is already in the store. - pub fn register + 'static>(&mut self, plugin: P) -> bool { + pub fn register(&mut self, plugin: Box>) -> bool { let len = self.store.len(); self.store.retain(|p| p.name() != plugin.name()); let result = len != self.store.len(); - self.store.push(Box::new(plugin)); + self.store.push(plugin); result } @@ -707,20 +706,26 @@ impl PluginStore { len != self.store.len() } - /// Initializes all plugins in the store. + /// Initializes the given plugin. pub(crate) fn initialize( + &self, + plugin: &mut Box>, + app: &AppHandle, + config: &PluginConfig, + ) -> crate::Result<()> { + initialize(plugin, app, config) + } + + /// Initializes all plugins in the store. + pub(crate) fn initialize_all( &mut self, app: &AppHandle, config: &PluginConfig, ) -> crate::Result<()> { - self.store.iter_mut().try_for_each(|plugin| { - plugin - .initialize( - app, - config.0.get(plugin.name()).cloned().unwrap_or_default(), - ) - .map_err(|e| Error::PluginInitialization(plugin.name().to_string(), e.to_string())) - }) + self + .store + .iter_mut() + .try_for_each(|plugin| initialize(plugin, app, config)) } /// Generates an initialization script from all plugins in the store. @@ -736,10 +741,11 @@ impl PluginStore { /// Runs the created hook for all plugins in the store. pub(crate) fn created(&mut self, window: Window) { - self - .store - .iter_mut() - .for_each(|plugin| plugin.created(window.clone())) + self.store.iter_mut().for_each(|plugin| { + #[cfg(feature = "tracing")] + let _span = tracing::trace_span!("plugin::hooks::created", name = plugin.name()).entered(); + plugin.created(window.clone()) + }) } pub(crate) fn on_navigation(&mut self, window: &Window, url: &Url) -> bool { @@ -753,10 +759,12 @@ impl PluginStore { /// Runs the on_page_load hook for all plugins in the store. pub(crate) fn on_page_load(&mut self, window: &Window, payload: &PageLoadPayload<'_>) { - self - .store - .iter_mut() - .for_each(|plugin| plugin.on_page_load(window, payload)) + self.store.iter_mut().for_each(|plugin| { + #[cfg(feature = "tracing")] + let _span = + tracing::trace_span!("plugin::hooks::on_page_load", name = plugin.name()).entered(); + plugin.on_page_load(window, payload) + }) } /// Runs the on_event hook for all plugins in the store. @@ -773,6 +781,8 @@ impl PluginStore { pub(crate) fn extend_api(&mut self, plugin: &str, invoke: Invoke) -> bool { for p in self.store.iter_mut() { if p.name() == plugin { + #[cfg(feature = "tracing")] + let _span = tracing::trace_span!("plugin::hooks::ipc", name = plugin).entered(); return p.extend_api(invoke); } } @@ -780,3 +790,17 @@ impl PluginStore { true } } + +#[cfg_attr(feature = "tracing", tracing::instrument(name = "plugin::hooks::initialize", skip(plugin, app), fields(name = plugin.name())))] +fn initialize( + plugin: &mut Box>, + app: &AppHandle, + config: &PluginConfig, +) -> crate::Result<()> { + plugin + .initialize( + app, + config.0.get(plugin.name()).cloned().unwrap_or_default(), + ) + .map_err(|e| Error::PluginInitialization(plugin.name().to_string(), e.to_string())) +} diff --git a/core/tauri/src/test/mod.rs b/core/tauri/src/test/mod.rs index aef211635..933b53c37 100644 --- a/core/tauri/src/test/mod.rs +++ b/core/tauri/src/test/mod.rs @@ -27,6 +27,8 @@ //! } //! //! fn main() { +//! // Use `tauri::Builder::default()` to use the default runtime rather than the `MockRuntime`; +//! // let app = create_app(tauri::Builder::default()); //! let app = create_app(mock_builder()); //! let window = tauri::WindowBuilder::new(&app, "main", Default::default()) //! .build() @@ -52,7 +54,7 @@ mod mock_runtime; pub use mock_runtime::*; use serde::Serialize; -use std::{borrow::Cow, fmt::Debug}; +use std::{borrow::Cow, collections::HashMap, fmt::Debug}; use crate::{ ipc::{InvokeBody, InvokeError, InvokeResponse}, @@ -66,6 +68,7 @@ use tauri_utils::{ /// An empty [`Assets`] implementation. pub struct NoopAsset { + assets: HashMap<&'static str, &'static [u8]>, csp_hashes: Vec>, } @@ -74,6 +77,10 @@ impl Assets for NoopAsset { None } + fn iter(&self) -> Box + '_> { + Box::new(self.assets.iter()) + } + fn csp_hashes(&self, html_path: &AssetKey) -> Box> + '_> { Box::new(self.csp_hashes.iter().copied()) } @@ -82,6 +89,7 @@ impl Assets for NoopAsset { /// Creates a new empty [`Assets`] implementation. pub fn noop_assets() -> NoopAsset { NoopAsset { + assets: Default::default(), csp_hashes: Default::default(), } } diff --git a/core/tauri/src/window/mod.rs b/core/tauri/src/window/mod.rs index 7cf5b386d..2f64419aa 100644 --- a/core/tauri/src/window/mod.rs +++ b/core/tauri/src/window/mod.rs @@ -434,6 +434,7 @@ impl<'a, R: Runtime> WindowBuilder<'a, R> { } /// Creates a new webview window. + #[cfg_attr(feature = "tracing", tracing::instrument(name = "window::create"))] pub fn build(mut self) -> crate::Result> { let mut pending = PendingWindow::new( self.window_builder.clone(), @@ -1032,6 +1033,10 @@ impl PartialEq for Window { } impl Manager for Window { + #[cfg_attr( + feature = "tracing", + tracing::instrument("window::emit", skip(self, payload)) + )] fn emit(&self, event: &str, payload: S) -> crate::Result<()> { self.manager().emit(event, Some(self.label()), payload)?; Ok(()) @@ -1048,6 +1053,10 @@ impl Manager for Window { .emit_filter(event, Some(self.label()), payload, |w| label == w.label()) } + #[cfg_attr( + feature = "tracing", + tracing::instrument("window::emit::filter", skip(self, payload, filter)) + )] fn emit_filter(&self, event: &str, payload: S, filter: F) -> crate::Result<()> where S: Serialize + Clone, @@ -1058,6 +1067,7 @@ impl Manager for Window { .emit_filter(event, Some(self.label()), payload, filter) } } + impl ManagerBase for Window { fn manager(&self) -> &AppManager { &self.manager diff --git a/examples/api/dist/assets/index.css b/examples/api/dist/assets/index.css index f256b1384..523397b89 100644 --- a/examples/api/dist/assets/index.css +++ b/examples/api/dist/assets/index.css @@ -1 +1 @@ -*,::before,::after{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x:var(--un-empty,/*!*/ /*!*/);--un-pan-y:var(--un-empty,/*!*/ /*!*/);--un-pinch-zoom:var(--un-empty,/*!*/ /*!*/);--un-scroll-snap-strictness:proximity;--un-ordinal:var(--un-empty,/*!*/ /*!*/);--un-slashed-zero:var(--un-empty,/*!*/ /*!*/);--un-numeric-figure:var(--un-empty,/*!*/ /*!*/);--un-numeric-spacing:var(--un-empty,/*!*/ /*!*/);--un-numeric-fraction:var(--un-empty,/*!*/ /*!*/);--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 #0000;--un-ring-shadow:0 0 #0000;--un-shadow-inset:var(--un-empty,/*!*/ /*!*/);--un-shadow:0 0 #0000;--un-ring-inset:var(--un-empty,/*!*/ /*!*/);--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgba(147,197,253,0.5);--un-blur:var(--un-empty,/*!*/ /*!*/);--un-brightness:var(--un-empty,/*!*/ /*!*/);--un-contrast:var(--un-empty,/*!*/ /*!*/);--un-drop-shadow:var(--un-empty,/*!*/ /*!*/);--un-grayscale:var(--un-empty,/*!*/ /*!*/);--un-hue-rotate:var(--un-empty,/*!*/ /*!*/);--un-invert:var(--un-empty,/*!*/ /*!*/);--un-saturate:var(--un-empty,/*!*/ /*!*/);--un-sepia:var(--un-empty,/*!*/ /*!*/);--un-backdrop-blur:var(--un-empty,/*!*/ /*!*/);--un-backdrop-brightness:var(--un-empty,/*!*/ /*!*/);--un-backdrop-contrast:var(--un-empty,/*!*/ /*!*/);--un-backdrop-grayscale:var(--un-empty,/*!*/ /*!*/);--un-backdrop-hue-rotate:var(--un-empty,/*!*/ /*!*/);--un-backdrop-invert:var(--un-empty,/*!*/ /*!*/);--un-backdrop-opacity:var(--un-empty,/*!*/ /*!*/);--un-backdrop-saturate:var(--un-empty,/*!*/ /*!*/);--un-backdrop-sepia:var(--un-empty,/*!*/ /*!*/);}@font-face { font-family: 'Fira Code'; font-style: normal; font-weight: 400; font-display: swap; src: url(https://fonts.gstatic.com/s/firacode/v22/uU9eCBsR6Z2vfE9aq3bL0fxyUs4tcw4W_D1sFVc.ttf) format('truetype');}@font-face { font-family: 'Fira Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url(https://fonts.gstatic.com/s/firamono/v14/N0bX2SlFPv1weGeLZDtQIQ.ttf) format('truetype');}@font-face { font-family: 'Fira Mono'; font-style: normal; font-weight: 700; font-display: swap; src: url(https://fonts.gstatic.com/s/firamono/v14/N0bS2SlFPv1weGeLZDtondv3mQ.ttf) format('truetype');}@font-face { font-family: 'Rubik'; font-style: normal; font-weight: 400; font-display: swap; src: url(https://fonts.gstatic.com/s/rubik/v28/iJWZBXyIfDnIV5PNhY1KTN7Z-Yh-B4i1UA.ttf) format('truetype');}.i-codicon-clear-all{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 16 16' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='m10 12.6l.7.7l1.6-1.6l1.6 1.6l.8-.7L13 11l1.7-1.6l-.8-.8l-1.6 1.7l-1.6-1.7l-.7.8l1.6 1.6l-1.6 1.6zM1 4h14V3H1v1zm0 3h14V6H1v1zm8 2.5V9H1v1h8v-.5zM9 13v-1H1v1h8z'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-codicon-close{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 16 16' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' fill-rule='evenodd' d='m8 8.707l3.646 3.647l.708-.707L8.707 8l3.647-3.646l-.707-.708L8 7.293L4.354 3.646l-.707.708L7.293 8l-3.646 3.646l.707.708L8 8.707z' clip-rule='evenodd'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-codicon-hubot{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 16 16' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M8.48 4h4l.5.5v2.03h.52l.5.5V8l-.5.5h-.52v3l-.5.5H9.36l-2.5 2.76L6 14.4V12H3.5l-.5-.64V8.5h-.5L2 8v-.97l.5-.5H3V4.36L3.53 4h4V2.86A1 1 0 0 1 7 2a1 1 0 0 1 2 0a1 1 0 0 1-.52.83V4zM12 8V5H4v5.86l2.5.14H7v2.19l1.8-2.04l.35-.15H12V8zm-2.12.51a2.71 2.71 0 0 1-1.37.74v-.01a2.71 2.71 0 0 1-2.42-.74l-.7.71c.34.34.745.608 1.19.79c.45.188.932.286 1.42.29a3.7 3.7 0 0 0 2.58-1.07l-.7-.71zM6.49 6.5h-1v1h1v-1zm3 0h1v1h-1v-1z' clip-rule='evenodd'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-codicon-link-external{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 16 16' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='currentColor'%3E%3Cpath d='M1.5 1H6v1H2v12h12v-4h1v4.5l-.5.5h-13l-.5-.5v-13l.5-.5z'/%3E%3Cpath d='M15 1.5V8h-1V2.707L7.243 9.465l-.707-.708L13.293 2H8V1h6.5l.5.5z'/%3E%3C/g%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-codicon-menu{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 16 16' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M16 5H0V4h16v1zm0 8H0v-1h16v1zm0-4.008H0V8h16v.992z'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-codicon-radio-tower{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 16 16' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M2.998 5.58a5.55 5.55 0 0 1 1.62-3.88l-.71-.7a6.45 6.45 0 0 0 0 9.16l.71-.7a5.55 5.55 0 0 1-1.62-3.88zm1.06 0a4.42 4.42 0 0 0 1.32 3.17l.71-.71a3.27 3.27 0 0 1-.76-1.12a3.45 3.45 0 0 1 0-2.67a3.22 3.22 0 0 1 .76-1.13l-.71-.71a4.46 4.46 0 0 0-1.32 3.17zm7.65 3.21l-.71-.71c.33-.32.59-.704.76-1.13a3.449 3.449 0 0 0 0-2.67a3.22 3.22 0 0 0-.76-1.13l.71-.7a4.468 4.468 0 0 1 0 6.34zM13.068 1l-.71.71a5.43 5.43 0 0 1 0 7.74l.71.71a6.45 6.45 0 0 0 0-9.16zM9.993 5.43a1.5 1.5 0 0 1-.245.98a2 2 0 0 1-.27.23l3.44 7.73l-.92.4l-.77-1.73h-5.54l-.77 1.73l-.92-.4l3.44-7.73a1.52 1.52 0 0 1-.33-1.63a1.55 1.55 0 0 1 .56-.68a1.5 1.5 0 0 1 2.325 1.1zm-1.595-.34a.52.52 0 0 0-.25.14a.52.52 0 0 0-.11.22a.48.48 0 0 0 0 .29c.04.09.102.17.18.23a.54.54 0 0 0 .28.08a.51.51 0 0 0 .5-.5a.54.54 0 0 0-.08-.28a.58.58 0 0 0-.23-.18a.48.48 0 0 0-.29 0zm.23 2.05h-.27l-.87 1.94h2l-.86-1.94zm2.2 4.94l-.89-2h-2.88l-.89 2h4.66z' clip-rule='evenodd'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-codicon-window{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 16 16' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M14.5 2h-13l-.5.5v11l.5.5h13l.5-.5v-11l-.5-.5zM14 13H2V6h12v7zm0-8H2V3h12v2z'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-ph-broadcast{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 256 256' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M128 88a40 40 0 1 0 40 40a40 40 0 0 0-40-40Zm0 64a24 24 0 1 1 24-24a24 24 0 0 1-24 24Zm73.71 7.14a80 80 0 0 1-14.08 22.2a8 8 0 0 1-11.92-10.67a63.95 63.95 0 0 0 0-85.33a8 8 0 1 1 11.92-10.67a80.08 80.08 0 0 1 14.08 84.47ZM69 103.09a64 64 0 0 0 11.26 67.58a8 8 0 0 1-11.92 10.67a79.93 79.93 0 0 1 0-106.67a8 8 0 1 1 11.95 10.67A63.77 63.77 0 0 0 69 103.09ZM248 128a119.58 119.58 0 0 1-34.29 84a8 8 0 1 1-11.42-11.2a103.9 103.9 0 0 0 0-145.56A8 8 0 1 1 213.71 44A119.58 119.58 0 0 1 248 128ZM53.71 200.78A8 8 0 1 1 42.29 212a119.87 119.87 0 0 1 0-168a8 8 0 1 1 11.42 11.2a103.9 103.9 0 0 0 0 145.56Z'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-ph-chat-teardrop-text{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 256 256' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M168 112a8 8 0 0 1-8 8H96a8 8 0 0 1 0-16h64a8 8 0 0 1 8 8Zm-8 24H96a8 8 0 0 0 0 16h64a8 8 0 0 0 0-16Zm72-12a100.11 100.11 0 0 1-100 100H47.67A15.69 15.69 0 0 1 32 208.33V124a100 100 0 0 1 200 0Zm-16 0a84 84 0 0 0-168 0v84h84a84.09 84.09 0 0 0 84-84Z'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-ph-check-duotone{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 256 256' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='currentColor'%3E%3Cpath d='M232 56v144a16 16 0 0 1-16 16H40a16 16 0 0 1-16-16V56a16 16 0 0 1 16-16h176a16 16 0 0 1 16 16Z' opacity='.2'/%3E%3Cpath d='m205.66 85.66l-96 96a8 8 0 0 1-11.32 0l-40-40a8 8 0 0 1 11.32-11.32L104 164.69l90.34-90.35a8 8 0 0 1 11.32 11.32Z'/%3E%3C/g%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-ph-globe-stand{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 256 256' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M128 176a80 80 0 1 0-80-80a80.09 80.09 0 0 0 80 80Zm0-144a64 64 0 1 1-64 64a64.07 64.07 0 0 1 64-64Zm77.77 133.5a8 8 0 0 1-.23 11.32a111.24 111.24 0 0 1-69.54 30.9V224h24a8 8 0 0 1 0 16H96a8 8 0 0 1 0-16h24v-16.29A112 112 0 0 1 47.18 18.46a8 8 0 1 1 11.54 11.08a96 96 0 0 0 135.74 135.74a8 8 0 0 1 11.31.22Z'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-ph-hand-waving{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 256 256' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='m220.2 100l-18-31.18a28 28 0 0 0-47.3-1.92l-15.34-26.59a28 28 0 0 0-48.12-.63a28 28 0 0 0-43 34.78l3.34 5.79a28 28 0 0 0-22 41.92l38 65.82a87.46 87.46 0 0 0 53.43 41a88.56 88.56 0 0 0 22.92 3A88 88 0 0 0 220.2 100Zm-6.67 62.63A72 72 0 0 1 81.63 180l-38-65.82a12 12 0 0 1 20.79-12l22 38.1a8 8 0 1 0 13.85-8l-38-65.81a12 12 0 0 1 13.5-17.59a11.9 11.9 0 0 1 7.29 5.59l34 58.89a8 8 0 0 0 13.85-8l-26-45a12 12 0 0 1 20.78-12L160 107.78a48.08 48.08 0 0 0-11 61a8 8 0 0 0 13.86-8a32 32 0 0 1 11.71-43.71a8 8 0 0 0 2.93-10.93l-10-17.32a12 12 0 0 1 20.78-12l18 31.18a71.49 71.49 0 0 1 7.25 54.62Zm-29.26-132.7a8 8 0 0 1 9.8-5.66c15.91 4.27 29 14.11 36.86 27.73a8 8 0 0 1-13.86 8c-5.72-9.92-15.36-17.12-27.14-20.27a8 8 0 0 1-5.66-9.8ZM80.91 237a8 8 0 0 1-11.24 1.33c-11-8.69-20.11-19.58-28.6-34.28a8 8 0 0 1 13.86-8c7.44 12.88 15.27 22.32 24.65 29.72A8 8 0 0 1 80.91 237Z'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-ph-images-square{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 256 256' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M208 32H80a16 16 0 0 0-16 16v16H48a16 16 0 0 0-16 16v128a16 16 0 0 0 16 16h128a16 16 0 0 0 16-16v-16h16a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16ZM80 48h128v69.38l-16.7-16.7a16 16 0 0 0-22.62 0L93.37 176H80Zm96 160H48V80h16v96a16 16 0 0 0 16 16h96Zm32-32h-92l64-64l28 28v36Zm-88-64a24 24 0 1 0-24-24a24 24 0 0 0 24 24Zm0-32a8 8 0 1 1-8 8a8 8 0 0 1 8-8Z'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-ph-list{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 256 256' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M224 128a8 8 0 0 1-8 8H40a8 8 0 0 1 0-16h176a8 8 0 0 1 8 8ZM40 72h176a8 8 0 0 0 0-16H40a8 8 0 0 0 0 16Zm176 112H40a8 8 0 0 0 0 16h176a8 8 0 0 0 0-16Z'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-ph-moon{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 256 256' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M233.54 142.23a8 8 0 0 0-8-2a88.08 88.08 0 0 1-109.8-109.8a8 8 0 0 0-10-10a104.84 104.84 0 0 0-52.91 37A104 104 0 0 0 136 224a103.09 103.09 0 0 0 62.52-20.88a104.84 104.84 0 0 0 37-52.91a8 8 0 0 0-1.98-7.98Zm-44.64 48.11A88 88 0 0 1 65.66 67.11a89 89 0 0 1 31.4-26A106 106 0 0 0 96 56a104.11 104.11 0 0 0 104 104a106 106 0 0 0 14.92-1.06a89 89 0 0 1-26.02 31.4Z'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-ph-square-duotone{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 256 256' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='currentColor'%3E%3Cpath d='M216 48v160a8 8 0 0 1-8 8H48a8 8 0 0 1-8-8V48a8 8 0 0 1 8-8h160a8 8 0 0 1 8 8Z' opacity='.2'/%3E%3Cpath d='M208 32H48a16 16 0 0 0-16 16v160a16 16 0 0 0 16 16h160a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16Zm0 176H48V48h160v160Z'/%3E%3C/g%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-ph-sun{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 256 256' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M120 40V16a8 8 0 0 1 16 0v24a8 8 0 0 1-16 0Zm72 88a64 64 0 1 1-64-64a64.07 64.07 0 0 1 64 64Zm-16 0a48 48 0 1 0-48 48a48.05 48.05 0 0 0 48-48ZM58.34 69.66a8 8 0 0 0 11.32-11.32l-16-16a8 8 0 0 0-11.32 11.32Zm0 116.68l-16 16a8 8 0 0 0 11.32 11.32l16-16a8 8 0 0 0-11.32-11.32ZM192 72a8 8 0 0 0 5.66-2.34l16-16a8 8 0 0 0-11.32-11.32l-16 16A8 8 0 0 0 192 72Zm5.66 114.34a8 8 0 0 0-11.32 11.32l16 16a8 8 0 0 0 11.32-11.32ZM48 128a8 8 0 0 0-8-8H16a8 8 0 0 0 0 16h24a8 8 0 0 0 8-8Zm80 80a8 8 0 0 0-8 8v24a8 8 0 0 0 16 0v-24a8 8 0 0 0-8-8Zm112-88h-24a8 8 0 0 0 0 16h24a8 8 0 0 0 0-16Z'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-ph-tray{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 256 256' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M208 32H48a16 16 0 0 0-16 16v160a16 16 0 0 0 16 16h160a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16Zm0 16v104h-28.7a15.86 15.86 0 0 0-11.3 4.69L148.69 176h-41.38L88 156.69A15.86 15.86 0 0 0 76.69 152H48V48Zm0 160H48v-40h28.69L96 187.31a15.86 15.86 0 0 0 11.31 4.69h41.38a15.86 15.86 0 0 0 11.31-4.69L179.31 168H208v40Z'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.note-red{position:relative;display:inline-flex;align-items:center;border-left-width:4px;border-left-style:solid;--un-border-opacity:1;border-color:rgba(53,120,229,var(--un-border-opacity));border-radius:0.25rem;background-color:rgba(53,120,229,0.1);background-color:rgba(185,28,28,0.1);padding:0.5rem;text-decoration:none;}.nv{position:relative;display:flex;align-items:center;border-radius:0.25rem;padding:0.5rem;--un-text-opacity:1;color:rgba(194,197,202,var(--un-text-opacity));text-decoration:none;transition-property:all;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:125ms;}.nv_selected{position:relative;display:flex;align-items:center;border-left-width:4px;border-left-style:solid;border-radius:0.25rem;--un-bg-opacity:.05;background-color:hsla(0,0%,100%,var(--un-bg-opacity));padding:0.5rem;--un-text-opacity:1;color:rgba(194,197,202,var(--un-text-opacity));color:rgba(53,120,229,var(--un-text-opacity));text-decoration:none;transition-property:all;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:125ms;}.input{height:2.5rem;display:flex;align-items:center;border-radius:0.25rem;border-style:none;--un-bg-opacity:1;background-color:rgba(233,236,239,var(--un-bg-opacity));padding:0.5rem;--un-text-opacity:1;color:rgba(28,30,33,var(--un-text-opacity));--un-shadow:var(--un-shadow-inset) 0 4px 6px -1px var(--un-shadow-color, rgba(0,0,0,0.1)),var(--un-shadow-inset) 0 2px 4px -2px var(--un-shadow-color, rgba(0,0,0,0.1));box-shadow:var(--un-ring-offset-shadow, 0 0 #0000), var(--un-ring-shadow, 0 0 #0000), var(--un-shadow);outline:2px solid transparent;outline-offset:2px;}.btn{user-select:none;border-radius:0.25rem;border-style:none;--un-bg-opacity:1;background-color:rgba(53,120,229,var(--un-bg-opacity));padding:0.5rem;font-weight:400;--un-text-opacity:1;color:rgba(28,30,33,var(--un-text-opacity));color:rgba(255,255,255,var(--un-text-opacity));--un-shadow:var(--un-shadow-inset) 0 4px 6px -1px var(--un-shadow-color, rgba(0,0,0,0.1)),var(--un-shadow-inset) 0 2px 4px -2px var(--un-shadow-color, rgba(0,0,0,0.1));box-shadow:var(--un-ring-offset-shadow, 0 0 #0000), var(--un-ring-shadow, 0 0 #0000), var(--un-shadow);outline:2px solid transparent;outline-offset:2px;}.nv_selected:hover,.nv:hover{border-left-width:4px;border-left-style:solid;--un-bg-opacity:.05;background-color:hsla(0,0%,100%,var(--un-bg-opacity));--un-text-opacity:1;color:rgba(53,120,229,var(--un-text-opacity));}.dark .note-red{--un-border-opacity:1;border-color:rgba(103,214,237,var(--un-border-opacity));background-color:rgba(103,214,237,0.1);background-color:rgba(185,28,28,0.1);}.btn:hover{--un-bg-opacity:1;background-color:rgba(45,102,195,var(--un-bg-opacity));}.dark .btn{--un-bg-opacity:1;background-color:rgba(103,214,237,var(--un-bg-opacity));font-weight:600;--un-text-opacity:1;color:rgba(28,30,33,var(--un-text-opacity));}.dark .btn:hover{--un-bg-opacity:1;background-color:rgba(57,202,232,var(--un-bg-opacity));}.dark .input{--un-bg-opacity:1;background-color:rgba(36,37,38,var(--un-bg-opacity));--un-text-opacity:1;color:rgba(227,227,227,var(--un-text-opacity));}.dark .note-red::after,.note-red::after{--un-bg-opacity:1;background-color:rgba(185,28,28,var(--un-bg-opacity));}.btn:active{--un-bg-opacity:1;background-color:rgba(37,84,160,var(--un-bg-opacity));}.dark .btn:active{--un-bg-opacity:1;background-color:rgba(25,181,213,var(--un-bg-opacity));}.dark .nv_selected,.dark .nv_selected:hover,.dark .nv:hover{--un-text-opacity:1;color:rgba(103,214,237,var(--un-text-opacity));} ::-webkit-scrollbar-thumb { background-color: #3578E5; } .dark ::-webkit-scrollbar-thumb { background-color: #67d6ed; } code { font-size: 0.75rem; font-family: "Fira Code","Fira Mono",ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace; border-radius: 0.25rem; background-color: #d6d8da; } .code-block { font-family: "Fira Code","Fira Mono",ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace; font-size: 0.875rem; } .dark code { background-color: #282a2e; } .visible{visibility:visible;}.absolute{position:absolute;}.left-2{left:0.5rem;}.top-2{top:0.5rem;}.z-2000{z-index:2000;}.grid{display:grid;}.grid-rows-\[2fr_auto\]{grid-template-rows:2fr auto;}.grid-rows-\[2px_2rem_1fr\]{grid-template-rows:2px 2rem 1fr;}.grid-rows-\[auto_1fr\]{grid-template-rows:auto 1fr;}.grid-rows-\[min-content_auto\]{grid-template-rows:min-content auto;}.mb-2{margin-bottom:0.5rem;}.mr-2{margin-right:0.5rem;}.display-none{display:none;}.children-h-10>*{height:2.5rem;}.h-15rem{height:15rem;}.h-2px{height:2px;}.h-8{height:2rem;}.h-85\%{height:85%;}.h-screen{height:100vh;}.w-1px{width:1px;}.w-8{width:2rem;}.w-screen{width:100vw;}.flex{display:flex;}.flex-1{flex:1 1 0%;}.children-flex-none>*{flex:none;}.flex-shrink-0{flex-shrink:0;}.children\:grow>*,.grow{flex-grow:1;}.flex-grow-0{flex-grow:0;}.flex-row{flex-direction:row;}.flex-col{flex-direction:column;}.flex-wrap{flex-wrap:wrap;}@keyframes fade-in{from{opacity:0}to{opacity:1}}.animate-fade-in{animation:fade-in 1s linear 1;}.animate-duration-300ms{animation-duration:300ms;}.cursor-ns-resize{cursor:ns-resize;}.cursor-pointer{cursor:pointer;}.select-none{user-select:none;}.items-center{align-items:center;}.self-center{align-self:center;}.justify-center{justify-content:center;}.justify-between{justify-content:space-between;}.gap-1{grid-gap:0.25rem;gap:0.25rem;}.gap-2{grid-gap:0.5rem;gap:0.5rem;}.overflow-hidden{overflow:hidden;}.overflow-y-auto{overflow-y:auto;}.b{border-width:1px;border-style:solid;}.rd-1{border-radius:0.25rem;}.rd-8{border-radius:2rem;}.bg-accent{--un-bg-opacity:1;background-color:rgba(53,120,229,var(--un-bg-opacity));}.bg-black\/20{background-color:rgba(0,0,0,0.2);}.bg-darkPrimaryLighter{--un-bg-opacity:1;background-color:rgba(36,37,38,var(--un-bg-opacity));}.bg-gray\/30{background-color:rgba(156,163,175,0.3);}.bg-primary{--un-bg-opacity:1;background-color:rgba(255,255,255,var(--un-bg-opacity));}.bg-white\/5,.dark .dark\:bg-white\/5{background-color:rgba(255,255,255,0.05);}.dark .dark\:bg-darkAccent{--un-bg-opacity:1;background-color:rgba(103,214,237,var(--un-bg-opacity));}.dark .dark\:bg-darkPrimary{--un-bg-opacity:1;background-color:rgba(27,27,29,var(--un-bg-opacity));}.dark .dark\:hover\:bg-darkHoverOverlay:hover{--un-bg-opacity:.05;background-color:hsla(0,0%,100%,var(--un-bg-opacity));}.hover\:bg-hoverOverlay:hover{--un-bg-opacity:.05;background-color:rgba(0,0,0,var(--un-bg-opacity));}.active\:bg-accentDark:active{--un-bg-opacity:1;background-color:rgba(48,108,206,var(--un-bg-opacity));}.active\:bg-hoverOverlay\/25:active{background-color:rgba(0,0,0,0.25);}.dark .dark\:active\:bg-darkAccentDark:active{--un-bg-opacity:1;background-color:rgba(73,206,233,var(--un-bg-opacity));}.dark .dark\:active\:bg-darkHoverOverlay\/25:active{background-color:hsla(0,0%,100%,0.25);}.p-1{padding:0.25rem;}.p-7{padding:1.75rem;}.px{padding-left:1rem;padding-right:1rem;}.px-2{padding-left:0.5rem;padding-right:0.5rem;}.px-5{padding-left:1.25rem;padding-right:1.25rem;}.children-pb-2>*{padding-bottom:0.5rem;}.children-pt8>*{padding-top:2rem;}.all\:font-mono *{font-family:"Fira Code","Fira Mono",ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;}.all\:text-xs *{font-size:0.75rem;line-height:1rem;}.text-sm{font-size:0.875rem;line-height:1.25rem;}.font-700{font-weight:700;}.font-semibold{font-weight:600;}.dark .dark\:text-darkAccent{--un-text-opacity:1;color:rgba(103,214,237,var(--un-text-opacity));}.dark .dark\:text-darkPrimaryText{--un-text-opacity:1;color:rgba(227,227,227,var(--un-text-opacity));}.text-accent{--un-text-opacity:1;color:rgba(53,120,229,var(--un-text-opacity));}.text-primaryText{--un-text-opacity:1;color:rgba(28,30,33,var(--un-text-opacity));}.blur{--un-blur:blur(8px);filter:var(--un-blur) var(--un-brightness) var(--un-contrast) var(--un-drop-shadow) var(--un-grayscale) var(--un-hue-rotate) var(--un-invert) var(--un-saturate) var(--un-sepia);}.transition-colors-250{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:250ms;}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms;}@media (max-width: 639.9px){.lt-sm\:absolute{position:absolute;}.lt-sm\:z-1999{z-index:1999;}.lt-sm\:h-screen{height:100vh;}.lt-sm\:flex{display:flex;}.lt-sm\:shadow{--un-shadow:var(--un-shadow-inset) 0 1px 3px 0 var(--un-shadow-color, rgba(0,0,0,0.1)),var(--un-shadow-inset) 0 1px 2px -1px var(--un-shadow-color, rgba(0,0,0,0.1));box-shadow:var(--un-ring-offset-shadow, 0 0 #0000), var(--un-ring-shadow, 0 0 #0000), var(--un-shadow);}.lt-sm\:shadow-lg{--un-shadow:var(--un-shadow-inset) 0 10px 15px -3px var(--un-shadow-color, rgba(0,0,0,0.1)),var(--un-shadow-inset) 0 4px 6px -4px var(--un-shadow-color, rgba(0,0,0,0.1));box-shadow:var(--un-ring-offset-shadow, 0 0 #0000), var(--un-ring-shadow, 0 0 #0000), var(--un-shadow);}.lt-sm\:transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms;}}*:not(h1,h2,h3,h4,h5,h6){margin:0;padding:0}*{box-sizing:border-box;font-family:Rubik,sans-serif}::-webkit-scrollbar{width:.25rem;height:3px}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{border-radius:.25rem}code{padding:.05rem .25rem}code.code-block{padding:.5rem}#sidebar{width:18.75rem}@media screen and (max-width: 640px){#sidebar{--translate-x: -18.75rem;transform:translate(var(--translate-x))}} +*,::before,::after{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x:var(--un-empty,/*!*/ /*!*/);--un-pan-y:var(--un-empty,/*!*/ /*!*/);--un-pinch-zoom:var(--un-empty,/*!*/ /*!*/);--un-scroll-snap-strictness:proximity;--un-ordinal:var(--un-empty,/*!*/ /*!*/);--un-slashed-zero:var(--un-empty,/*!*/ /*!*/);--un-numeric-figure:var(--un-empty,/*!*/ /*!*/);--un-numeric-spacing:var(--un-empty,/*!*/ /*!*/);--un-numeric-fraction:var(--un-empty,/*!*/ /*!*/);--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 #0000;--un-ring-shadow:0 0 #0000;--un-shadow-inset:var(--un-empty,/*!*/ /*!*/);--un-shadow:0 0 #0000;--un-ring-inset:var(--un-empty,/*!*/ /*!*/);--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgba(147,197,253,0.5);--un-blur:var(--un-empty,/*!*/ /*!*/);--un-brightness:var(--un-empty,/*!*/ /*!*/);--un-contrast:var(--un-empty,/*!*/ /*!*/);--un-drop-shadow:var(--un-empty,/*!*/ /*!*/);--un-grayscale:var(--un-empty,/*!*/ /*!*/);--un-hue-rotate:var(--un-empty,/*!*/ /*!*/);--un-invert:var(--un-empty,/*!*/ /*!*/);--un-saturate:var(--un-empty,/*!*/ /*!*/);--un-sepia:var(--un-empty,/*!*/ /*!*/);--un-backdrop-blur:var(--un-empty,/*!*/ /*!*/);--un-backdrop-brightness:var(--un-empty,/*!*/ /*!*/);--un-backdrop-contrast:var(--un-empty,/*!*/ /*!*/);--un-backdrop-grayscale:var(--un-empty,/*!*/ /*!*/);--un-backdrop-hue-rotate:var(--un-empty,/*!*/ /*!*/);--un-backdrop-invert:var(--un-empty,/*!*/ /*!*/);--un-backdrop-opacity:var(--un-empty,/*!*/ /*!*/);--un-backdrop-saturate:var(--un-empty,/*!*/ /*!*/);--un-backdrop-sepia:var(--un-empty,/*!*/ /*!*/);}@font-face { font-family: 'Fira Code'; font-style: normal; font-weight: 400; font-display: swap; src: url(https://fonts.gstatic.com/s/firacode/v22/uU9eCBsR6Z2vfE9aq3bL0fxyUs4tcw4W_D1sFVc.ttf) format('truetype');}@font-face { font-family: 'Fira Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url(https://fonts.gstatic.com/s/firamono/v14/N0bX2SlFPv1weGeLZDtQIQ.ttf) format('truetype');}@font-face { font-family: 'Fira Mono'; font-style: normal; font-weight: 700; font-display: swap; src: url(https://fonts.gstatic.com/s/firamono/v14/N0bS2SlFPv1weGeLZDtondv3mQ.ttf) format('truetype');}@font-face { font-family: 'Rubik'; font-style: normal; font-weight: 400; font-display: swap; src: url(https://fonts.gstatic.com/s/rubik/v28/iJWZBXyIfDnIV5PNhY1KTN7Z-Yh-B4i1UA.ttf) format('truetype');}.i-codicon-clear-all{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 16 16' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='m10 12.6l.7.7l1.6-1.6l1.6 1.6l.8-.7L13 11l1.7-1.6l-.8-.8l-1.6 1.7l-1.6-1.7l-.7.8l1.6 1.6l-1.6 1.6zM1 4h14V3H1v1zm0 3h14V6H1v1zm8 2.5V9H1v1h8v-.5zM9 13v-1H1v1h8z'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-codicon-close{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 16 16' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' fill-rule='evenodd' d='m8 8.707l3.646 3.647l.708-.707L8.707 8l3.647-3.646l-.707-.708L8 7.293L4.354 3.646l-.707.708L7.293 8l-3.646 3.646l.707.708L8 8.707z' clip-rule='evenodd'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-codicon-hubot{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 16 16' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M8.48 4h4l.5.5v2.03h.52l.5.5V8l-.5.5h-.52v3l-.5.5H9.36l-2.5 2.76L6 14.4V12H3.5l-.5-.64V8.5h-.5L2 8v-.97l.5-.5H3V4.36L3.53 4h4V2.86A1 1 0 0 1 7 2a1 1 0 0 1 2 0a1 1 0 0 1-.52.83V4zM12 8V5H4v5.86l2.5.14H7v2.19l1.8-2.04l.35-.15H12V8zm-2.12.51a2.71 2.71 0 0 1-1.37.74v-.01a2.71 2.71 0 0 1-2.42-.74l-.7.71c.34.34.745.608 1.19.79c.45.188.932.286 1.42.29a3.7 3.7 0 0 0 2.58-1.07l-.7-.71zM6.49 6.5h-1v1h1v-1zm3 0h1v1h-1v-1z' clip-rule='evenodd'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-codicon-link-external{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 16 16' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='currentColor'%3E%3Cpath d='M1.5 1H6v1H2v12h12v-4h1v4.5l-.5.5h-13l-.5-.5v-13l.5-.5z'/%3E%3Cpath d='M15 1.5V8h-1V2.707L7.243 9.465l-.707-.708L13.293 2H8V1h6.5l.5.5z'/%3E%3C/g%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-codicon-menu{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 16 16' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M16 5H0V4h16v1zm0 8H0v-1h16v1zm0-4.008H0V8h16v.992z'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-codicon-radio-tower{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 16 16' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M2.998 5.58a5.55 5.55 0 0 1 1.62-3.88l-.71-.7a6.45 6.45 0 0 0 0 9.16l.71-.7a5.55 5.55 0 0 1-1.62-3.88zm1.06 0a4.42 4.42 0 0 0 1.32 3.17l.71-.71a3.27 3.27 0 0 1-.76-1.12a3.45 3.45 0 0 1 0-2.67a3.22 3.22 0 0 1 .76-1.13l-.71-.71a4.46 4.46 0 0 0-1.32 3.17zm7.65 3.21l-.71-.71c.33-.32.59-.704.76-1.13a3.449 3.449 0 0 0 0-2.67a3.22 3.22 0 0 0-.76-1.13l.71-.7a4.468 4.468 0 0 1 0 6.34zM13.068 1l-.71.71a5.43 5.43 0 0 1 0 7.74l.71.71a6.45 6.45 0 0 0 0-9.16zM9.993 5.43a1.5 1.5 0 0 1-.245.98a2 2 0 0 1-.27.23l3.44 7.73l-.92.4l-.77-1.73h-5.54l-.77 1.73l-.92-.4l3.44-7.73a1.52 1.52 0 0 1-.33-1.63a1.55 1.55 0 0 1 .56-.68a1.5 1.5 0 0 1 2.325 1.1zm-1.595-.34a.52.52 0 0 0-.25.14a.52.52 0 0 0-.11.22a.48.48 0 0 0 0 .29c.04.09.102.17.18.23a.54.54 0 0 0 .28.08a.51.51 0 0 0 .5-.5a.54.54 0 0 0-.08-.28a.58.58 0 0 0-.23-.18a.48.48 0 0 0-.29 0zm.23 2.05h-.27l-.87 1.94h2l-.86-1.94zm2.2 4.94l-.89-2h-2.88l-.89 2h4.66z' clip-rule='evenodd'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-codicon-window{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 16 16' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M14.5 2h-13l-.5.5v11l.5.5h13l.5-.5v-11l-.5-.5zM14 13H2V6h12v7zm0-8H2V3h12v2z'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-ph-broadcast{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 256 256' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M128 88a40 40 0 1 0 40 40a40 40 0 0 0-40-40Zm0 64a24 24 0 1 1 24-24a24 24 0 0 1-24 24Zm73.71 7.14a80 80 0 0 1-14.08 22.2a8 8 0 0 1-11.92-10.67a63.95 63.95 0 0 0 0-85.33a8 8 0 1 1 11.92-10.67a80.08 80.08 0 0 1 14.08 84.47ZM69 103.09a64 64 0 0 0 11.26 67.58a8 8 0 0 1-11.92 10.67a79.93 79.93 0 0 1 0-106.67a8 8 0 1 1 11.95 10.67A63.77 63.77 0 0 0 69 103.09ZM248 128a119.58 119.58 0 0 1-34.29 84a8 8 0 1 1-11.42-11.2a103.9 103.9 0 0 0 0-145.56A8 8 0 1 1 213.71 44A119.58 119.58 0 0 1 248 128ZM53.71 200.78A8 8 0 1 1 42.29 212a119.87 119.87 0 0 1 0-168a8 8 0 1 1 11.42 11.2a103.9 103.9 0 0 0 0 145.56Z'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-ph-chat-teardrop-text{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 256 256' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M168 112a8 8 0 0 1-8 8H96a8 8 0 0 1 0-16h64a8 8 0 0 1 8 8Zm-8 24H96a8 8 0 0 0 0 16h64a8 8 0 0 0 0-16Zm72-12a100.11 100.11 0 0 1-100 100H47.67A15.69 15.69 0 0 1 32 208.33V124a100 100 0 0 1 200 0Zm-16 0a84 84 0 0 0-168 0v84h84a84.09 84.09 0 0 0 84-84Z'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-ph-check-duotone{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 256 256' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='currentColor'%3E%3Cpath d='M232 56v144a16 16 0 0 1-16 16H40a16 16 0 0 1-16-16V56a16 16 0 0 1 16-16h176a16 16 0 0 1 16 16Z' opacity='.2'/%3E%3Cpath d='m205.66 85.66l-96 96a8 8 0 0 1-11.32 0l-40-40a8 8 0 0 1 11.32-11.32L104 164.69l90.34-90.35a8 8 0 0 1 11.32 11.32Z'/%3E%3C/g%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-ph-globe-stand{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 256 256' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M128 176a80 80 0 1 0-80-80a80.09 80.09 0 0 0 80 80Zm0-144a64 64 0 1 1-64 64a64.07 64.07 0 0 1 64-64Zm77.77 133.5a8 8 0 0 1-.23 11.32a111.24 111.24 0 0 1-69.54 30.9V224h24a8 8 0 0 1 0 16H96a8 8 0 0 1 0-16h24v-16.29A112 112 0 0 1 47.18 18.46a8 8 0 1 1 11.54 11.08a96 96 0 0 0 135.74 135.74a8 8 0 0 1 11.31.22Z'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-ph-hand-waving{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 256 256' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='m220.2 100l-18-31.18a28 28 0 0 0-47.3-1.92l-15.34-26.59a28 28 0 0 0-48.12-.63a28 28 0 0 0-43 34.78l3.34 5.79a28 28 0 0 0-22 41.92l38 65.82a87.46 87.46 0 0 0 53.43 41a88.56 88.56 0 0 0 22.92 3A88 88 0 0 0 220.2 100Zm-6.67 62.63A72 72 0 0 1 81.63 180l-38-65.82a12 12 0 0 1 20.79-12l22 38.1a8 8 0 1 0 13.85-8l-38-65.81a12 12 0 0 1 13.5-17.59a11.9 11.9 0 0 1 7.29 5.59l34 58.89a8 8 0 0 0 13.85-8l-26-45a12 12 0 0 1 20.78-12L160 107.78a48.08 48.08 0 0 0-11 61a8 8 0 0 0 13.86-8a32 32 0 0 1 11.71-43.71a8 8 0 0 0 2.93-10.93l-10-17.32a12 12 0 0 1 20.78-12l18 31.18a71.49 71.49 0 0 1 7.25 54.62Zm-29.26-132.7a8 8 0 0 1 9.8-5.66c15.91 4.27 29 14.11 36.86 27.73a8 8 0 0 1-13.86 8c-5.72-9.92-15.36-17.12-27.14-20.27a8 8 0 0 1-5.66-9.8ZM80.91 237a8 8 0 0 1-11.24 1.33c-11-8.69-20.11-19.58-28.6-34.28a8 8 0 0 1 13.86-8c7.44 12.88 15.27 22.32 24.65 29.72A8 8 0 0 1 80.91 237Z'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-ph-images-square{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 256 256' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M208 32H80a16 16 0 0 0-16 16v16H48a16 16 0 0 0-16 16v128a16 16 0 0 0 16 16h128a16 16 0 0 0 16-16v-16h16a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16ZM80 48h128v69.38l-16.7-16.7a16 16 0 0 0-22.62 0L93.37 176H80Zm96 160H48V80h16v96a16 16 0 0 0 16 16h96Zm32-32h-92l64-64l28 28v36Zm-88-64a24 24 0 1 0-24-24a24 24 0 0 0 24 24Zm0-32a8 8 0 1 1-8 8a8 8 0 0 1 8-8Z'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-ph-list{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 256 256' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M224 128a8 8 0 0 1-8 8H40a8 8 0 0 1 0-16h176a8 8 0 0 1 8 8ZM40 72h176a8 8 0 0 0 0-16H40a8 8 0 0 0 0 16Zm176 112H40a8 8 0 0 0 0 16h176a8 8 0 0 0 0-16Z'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-ph-moon{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 256 256' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M233.54 142.23a8 8 0 0 0-8-2a88.08 88.08 0 0 1-109.8-109.8a8 8 0 0 0-10-10a104.84 104.84 0 0 0-52.91 37A104 104 0 0 0 136 224a103.09 103.09 0 0 0 62.52-20.88a104.84 104.84 0 0 0 37-52.91a8 8 0 0 0-1.98-7.98Zm-44.64 48.11A88 88 0 0 1 65.66 67.11a89 89 0 0 1 31.4-26A106 106 0 0 0 96 56a104.11 104.11 0 0 0 104 104a106 106 0 0 0 14.92-1.06a89 89 0 0 1-26.02 31.4Z'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-ph-square-duotone{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 256 256' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='currentColor'%3E%3Cpath d='M216 48v160a8 8 0 0 1-8 8H48a8 8 0 0 1-8-8V48a8 8 0 0 1 8-8h160a8 8 0 0 1 8 8Z' opacity='.2'/%3E%3Cpath d='M208 32H48a16 16 0 0 0-16 16v160a16 16 0 0 0 16 16h160a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16Zm0 176H48V48h160v160Z'/%3E%3C/g%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-ph-sun{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 256 256' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M120 40V16a8 8 0 0 1 16 0v24a8 8 0 0 1-16 0Zm72 88a64 64 0 1 1-64-64a64.07 64.07 0 0 1 64 64Zm-16 0a48 48 0 1 0-48 48a48.05 48.05 0 0 0 48-48ZM58.34 69.66a8 8 0 0 0 11.32-11.32l-16-16a8 8 0 0 0-11.32 11.32Zm0 116.68l-16 16a8 8 0 0 0 11.32 11.32l16-16a8 8 0 0 0-11.32-11.32ZM192 72a8 8 0 0 0 5.66-2.34l16-16a8 8 0 0 0-11.32-11.32l-16 16A8 8 0 0 0 192 72Zm5.66 114.34a8 8 0 0 0-11.32 11.32l16 16a8 8 0 0 0 11.32-11.32ZM48 128a8 8 0 0 0-8-8H16a8 8 0 0 0 0 16h24a8 8 0 0 0 8-8Zm80 80a8 8 0 0 0-8 8v24a8 8 0 0 0 16 0v-24a8 8 0 0 0-8-8Zm112-88h-24a8 8 0 0 0 0 16h24a8 8 0 0 0 0-16Z'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-ph-tray{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 256 256' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M208 32H48a16 16 0 0 0-16 16v160a16 16 0 0 0 16 16h160a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16Zm0 16v104h-28.7a15.86 15.86 0 0 0-11.3 4.69L148.69 176h-41.38L88 156.69A15.86 15.86 0 0 0 76.69 152H48V48Zm0 160H48v-40h28.69L96 187.31a15.86 15.86 0 0 0 11.31 4.69h41.38a15.86 15.86 0 0 0 11.31-4.69L179.31 168H208v40Z'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.note-red{position:relative;display:inline-flex;align-items:center;border-left-width:4px;border-left-style:solid;--un-border-opacity:1;border-color:rgba(53,120,229,var(--un-border-opacity));border-radius:0.25rem;background-color:rgba(53,120,229,0.1);background-color:rgba(185,28,28,0.1);padding:0.5rem;text-decoration:none;}.nv{position:relative;display:flex;align-items:center;border-radius:0.25rem;padding:0.5rem;--un-text-opacity:1;color:rgba(194,197,202,var(--un-text-opacity));text-decoration:none;transition-property:all;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:125ms;}.nv_selected{position:relative;display:flex;align-items:center;border-left-width:4px;border-left-style:solid;border-radius:0.25rem;--un-bg-opacity:.05;background-color:hsla(0,0%,100%,var(--un-bg-opacity));padding:0.5rem;--un-text-opacity:1;color:rgba(194,197,202,var(--un-text-opacity));color:rgba(53,120,229,var(--un-text-opacity));text-decoration:none;transition-property:all;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:125ms;}.input{height:2.5rem;display:flex;align-items:center;border-radius:0.25rem;border-style:none;--un-bg-opacity:1;background-color:rgba(233,236,239,var(--un-bg-opacity));padding:0.5rem;--un-text-opacity:1;color:rgba(28,30,33,var(--un-text-opacity));--un-shadow:var(--un-shadow-inset) 0 4px 6px -1px var(--un-shadow-color, rgba(0,0,0,0.1)),var(--un-shadow-inset) 0 2px 4px -2px var(--un-shadow-color, rgba(0,0,0,0.1));box-shadow:var(--un-ring-offset-shadow, 0 0 #0000), var(--un-ring-shadow, 0 0 #0000), var(--un-shadow);outline:2px solid transparent;outline-offset:2px;}.btn{user-select:none;border-radius:0.25rem;border-style:none;--un-bg-opacity:1;background-color:rgba(53,120,229,var(--un-bg-opacity));padding:0.5rem;font-weight:400;--un-text-opacity:1;color:rgba(28,30,33,var(--un-text-opacity));color:rgba(255,255,255,var(--un-text-opacity));--un-shadow:var(--un-shadow-inset) 0 4px 6px -1px var(--un-shadow-color, rgba(0,0,0,0.1)),var(--un-shadow-inset) 0 2px 4px -2px var(--un-shadow-color, rgba(0,0,0,0.1));box-shadow:var(--un-ring-offset-shadow, 0 0 #0000), var(--un-ring-shadow, 0 0 #0000), var(--un-shadow);outline:2px solid transparent;outline-offset:2px;}.nv_selected:hover,.nv:hover{border-left-width:4px;border-left-style:solid;--un-bg-opacity:.05;background-color:hsla(0,0%,100%,var(--un-bg-opacity));--un-text-opacity:1;color:rgba(53,120,229,var(--un-text-opacity));}.dark .note-red{--un-border-opacity:1;border-color:rgba(103,214,237,var(--un-border-opacity));background-color:rgba(103,214,237,0.1);background-color:rgba(185,28,28,0.1);}.btn:hover{--un-bg-opacity:1;background-color:rgba(45,102,195,var(--un-bg-opacity));}.dark .btn{--un-bg-opacity:1;background-color:rgba(103,214,237,var(--un-bg-opacity));font-weight:600;--un-text-opacity:1;color:rgba(28,30,33,var(--un-text-opacity));}.dark .btn:hover{--un-bg-opacity:1;background-color:rgba(57,202,232,var(--un-bg-opacity));}.dark .input{--un-bg-opacity:1;background-color:rgba(36,37,38,var(--un-bg-opacity));--un-text-opacity:1;color:rgba(227,227,227,var(--un-text-opacity));}.dark .note-red::after,.note-red::after{--un-bg-opacity:1;background-color:rgba(185,28,28,var(--un-bg-opacity));}.btn:active{--un-bg-opacity:1;background-color:rgba(37,84,160,var(--un-bg-opacity));}.dark .btn:active{--un-bg-opacity:1;background-color:rgba(25,181,213,var(--un-bg-opacity));}.dark .nv_selected,.dark .nv_selected:hover,.dark .nv:hover{--un-text-opacity:1;color:rgba(103,214,237,var(--un-text-opacity));} ::-webkit-scrollbar-thumb { background-color: #3578E5; } .dark ::-webkit-scrollbar-thumb { background-color: #67d6ed; } code { font-size: 0.75rem; font-family: "Fira Code","Fira Mono",ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace; border-radius: 0.25rem; background-color: #d6d8da; } .code-block { font-family: "Fira Code","Fira Mono",ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace; font-size: 0.875rem; } .dark code { background-color: #282a2e; } .visible{visibility:visible;}.absolute{position:absolute;}.left-2{left:0.5rem;}.top-2{top:0.5rem;}.z-2000{z-index:2000;}.grid{display:grid;}.grid-rows-\[2fr_auto\]{grid-template-rows:2fr auto;}.grid-rows-\[2px_2rem_1fr\]{grid-template-rows:2px 2rem 1fr;}.grid-rows-\[auto_1fr\]{grid-template-rows:auto 1fr;}.grid-rows-\[min-content_auto\]{grid-template-rows:min-content auto;}.mb-2{margin-bottom:0.5rem;}.mr-2{margin-right:0.5rem;}.display-none{display:none;}.children-h-10>*{height:2.5rem;}.h-15rem{height:15rem;}.h-2px{height:2px;}.h-8{height:2rem;}.h-85\%{height:85%;}.h-screen{height:100vh;}.w-1px{width:1px;}.w-8{width:2rem;}.w-screen{width:100vw;}.flex{display:flex;}.flex-1{flex:1 1 0%;}.children-flex-none>*{flex:none;}.flex-shrink-0{flex-shrink:0;}.children\:grow>*,.grow{flex-grow:1;}.flex-grow-0{flex-grow:0;}.flex-row{flex-direction:row;}.flex-col{flex-direction:column;}.flex-wrap{flex-wrap:wrap;}@keyframes fade-in{from{opacity:0}to{opacity:1}}.animate-fade-in{animation:fade-in 1s linear 1;}.animate-duration-300ms{animation-duration:300ms;}.cursor-ns-resize{cursor:ns-resize;}.cursor-pointer{cursor:pointer;}.select-text{user-select:text;}.select-none{user-select:none;}.items-center{align-items:center;}.self-center{align-self:center;}.justify-center{justify-content:center;}.justify-between{justify-content:space-between;}.gap-1{grid-gap:0.25rem;gap:0.25rem;}.gap-2{grid-gap:0.5rem;gap:0.5rem;}.overflow-hidden{overflow:hidden;}.overflow-y-auto{overflow-y:auto;}.b{border-width:1px;border-style:solid;}.rd-1{border-radius:0.25rem;}.rd-8{border-radius:2rem;}.bg-accent{--un-bg-opacity:1;background-color:rgba(53,120,229,var(--un-bg-opacity));}.bg-black\/20{background-color:rgba(0,0,0,0.2);}.bg-darkPrimaryLighter{--un-bg-opacity:1;background-color:rgba(36,37,38,var(--un-bg-opacity));}.bg-gray\/30{background-color:rgba(156,163,175,0.3);}.bg-primary{--un-bg-opacity:1;background-color:rgba(255,255,255,var(--un-bg-opacity));}.bg-white\/5,.dark .dark\:bg-white\/5{background-color:rgba(255,255,255,0.05);}.dark .dark\:bg-darkAccent{--un-bg-opacity:1;background-color:rgba(103,214,237,var(--un-bg-opacity));}.dark .dark\:bg-darkPrimary{--un-bg-opacity:1;background-color:rgba(27,27,29,var(--un-bg-opacity));}.dark .dark\:hover\:bg-darkHoverOverlay:hover{--un-bg-opacity:.05;background-color:hsla(0,0%,100%,var(--un-bg-opacity));}.hover\:bg-hoverOverlay:hover{--un-bg-opacity:.05;background-color:rgba(0,0,0,var(--un-bg-opacity));}.active\:bg-accentDark:active{--un-bg-opacity:1;background-color:rgba(48,108,206,var(--un-bg-opacity));}.active\:bg-hoverOverlay\/25:active{background-color:rgba(0,0,0,0.25);}.dark .dark\:active\:bg-darkAccentDark:active{--un-bg-opacity:1;background-color:rgba(73,206,233,var(--un-bg-opacity));}.dark .dark\:active\:bg-darkHoverOverlay\/25:active{background-color:hsla(0,0%,100%,0.25);}.p-1{padding:0.25rem;}.p-7{padding:1.75rem;}.px{padding-left:1rem;padding-right:1rem;}.px-2{padding-left:0.5rem;padding-right:0.5rem;}.px-5{padding-left:1.25rem;padding-right:1.25rem;}.children-pb-2>*{padding-bottom:0.5rem;}.children-pt8>*{padding-top:2rem;}.all\:font-mono *{font-family:"Fira Code","Fira Mono",ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;}.all\:text-xs *{font-size:0.75rem;line-height:1rem;}.text-sm{font-size:0.875rem;line-height:1.25rem;}.font-700{font-weight:700;}.font-semibold{font-weight:600;}.dark .dark\:text-darkAccent{--un-text-opacity:1;color:rgba(103,214,237,var(--un-text-opacity));}.dark .dark\:text-darkPrimaryText{--un-text-opacity:1;color:rgba(227,227,227,var(--un-text-opacity));}.text-accent{--un-text-opacity:1;color:rgba(53,120,229,var(--un-text-opacity));}.text-primaryText{--un-text-opacity:1;color:rgba(28,30,33,var(--un-text-opacity));}.blur{--un-blur:blur(8px);filter:var(--un-blur) var(--un-brightness) var(--un-contrast) var(--un-drop-shadow) var(--un-grayscale) var(--un-hue-rotate) var(--un-invert) var(--un-saturate) var(--un-sepia);}.transition-colors-250{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:250ms;}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms;}@media (max-width: 639.9px){.lt-sm\:absolute{position:absolute;}.lt-sm\:z-1999{z-index:1999;}.lt-sm\:h-screen{height:100vh;}.lt-sm\:flex{display:flex;}.lt-sm\:shadow{--un-shadow:var(--un-shadow-inset) 0 1px 3px 0 var(--un-shadow-color, rgba(0,0,0,0.1)),var(--un-shadow-inset) 0 1px 2px -1px var(--un-shadow-color, rgba(0,0,0,0.1));box-shadow:var(--un-ring-offset-shadow, 0 0 #0000), var(--un-ring-shadow, 0 0 #0000), var(--un-shadow);}.lt-sm\:shadow-lg{--un-shadow:var(--un-shadow-inset) 0 10px 15px -3px var(--un-shadow-color, rgba(0,0,0,0.1)),var(--un-shadow-inset) 0 4px 6px -4px var(--un-shadow-color, rgba(0,0,0,0.1));box-shadow:var(--un-ring-offset-shadow, 0 0 #0000), var(--un-ring-shadow, 0 0 #0000), var(--un-shadow);}.lt-sm\:transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms;}}*:not(h1,h2,h3,h4,h5,h6){margin:0;padding:0}*{box-sizing:border-box;font-family:Rubik,sans-serif}::-webkit-scrollbar{width:.25rem;height:3px}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{border-radius:.25rem}code{padding:.05rem .25rem}code.code-block{padding:.5rem}#sidebar{width:18.75rem}@media screen and (max-width: 640px){#sidebar{--translate-x: -18.75rem;transform:translate(var(--translate-x))}} diff --git a/examples/api/dist/assets/index.js b/examples/api/dist/assets/index.js index cf83e747a..7501bda4d 100644 --- a/examples/api/dist/assets/index.js +++ b/examples/api/dist/assets/index.js @@ -1,19 +1,19 @@ -var br=Object.defineProperty;var wr=(t,e,n)=>e in t?br(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var _t=(t,e,n)=>(wr(t,typeof e!="symbol"?e+"":e,n),n);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))l(s);new MutationObserver(s=>{for(const u of s)if(u.type==="childList")for(const d of u.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&l(d)}).observe(document,{childList:!0,subtree:!0});function n(s){const u={};return s.integrity&&(u.integrity=s.integrity),s.referrerPolicy&&(u.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?u.credentials="include":s.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function l(s){if(s.ep)return;s.ep=!0;const u=n(s);fetch(s.href,u)}})();function ne(){}function lr(t){return t()}function Ms(){return Object.create(null)}function Ce(t){t.forEach(lr)}function sr(t){return typeof t=="function"}function je(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}let Vi;function kr(t,e){return t===e?!0:(Vi||(Vi=document.createElement("a")),Vi.href=e,t===Vi.href)}function yr(t){return Object.keys(t).length===0}function vr(t,...e){if(t==null){for(const l of e)l(void 0);return ne}const n=t.subscribe(...e);return n.unsubscribe?()=>n.unsubscribe():n}function Cr(t,e,n){t.$$.on_destroy.push(vr(e,n))}function i(t,e){t.appendChild(e)}function L(t,e,n){t.insertBefore(e,n||null)}function S(t){t.parentNode&&t.parentNode.removeChild(t)}function Je(t,e){for(let n=0;nt.removeEventListener(e,n,l)}function Ps(t){return function(e){return e.preventDefault(),t.call(this,e)}}function a(t,e,n){n==null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function X(t){return t===""?null:+t}function Lr(t){return Array.from(t.childNodes)}function se(t,e){e=""+e,t.data!==e&&(t.data=e)}function O(t,e){t.value=e??""}function xt(t,e,n,l){n==null?t.style.removeProperty(e):t.style.setProperty(e,n,l?"important":"")}function Qe(t,e,n){for(let l=0;l{const s=t.$$.callbacks[e];if(s){const u=Ar(e,n,{cancelable:l});return s.slice().forEach(d=>{d.call(t,u)}),!u.defaultPrevented}return!0}}const tn=[],On=[];let nn=[];const El=[],Pr=Promise.resolve();let Tl=!1;function Er(){Tl||(Tl=!0,Pr.then(or))}function wt(t){nn.push(t)}function ur(t){El.push(t)}const Sl=new Set;let $t=0;function or(){if($t!==0)return;const t=zn;do{try{for(;$tt.indexOf(l)===-1?e.push(l):n.push(l)),n.forEach(l=>l()),nn=e}const qi=new Set;let zt;function Or(){zt={r:0,c:[],p:zt}}function Wr(){zt.r||Ce(zt.c),zt=zt.p}function sn(t,e){t&&t.i&&(qi.delete(t),t.i(e))}function Wn(t,e,n,l){if(t&&t.o){if(qi.has(t))return;qi.add(t),zt.c.push(()=>{qi.delete(t),l&&(n&&t.d(1),l())}),t.o(e)}else l&&l()}function he(t){return(t==null?void 0:t.length)!==void 0?t:Array.from(t)}function cr(t,e,n){const l=t.$$.props[e];l!==void 0&&(t.$$.bound[l]=n,n(t.$$.ctx[l]))}function In(t){t&&t.c()}function rn(t,e,n){const{fragment:l,after_update:s}=t.$$;l&&l.m(e,n),wt(()=>{const u=t.$$.on_mount.map(lr).filter(sr);t.$$.on_destroy?t.$$.on_destroy.push(...u):Ce(u),t.$$.on_mount=[]}),s.forEach(wt)}function an(t,e){const n=t.$$;n.fragment!==null&&(zr(n.after_update),Ce(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function Ir(t,e){t.$$.dirty[0]===-1&&(tn.push(t),Er(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<{const y=k.length?k[0]:W;return h.ctx&&s(h.ctx[_],h.ctx[_]=y)&&(!h.skip_bound&&h.bound[_]&&h.bound[_](y),w&&Ir(t,_)),W}):[],h.update(),w=!0,Ce(h.before_update),h.fragment=l?l(h.ctx):!1,e.target){if(e.hydrate){const _=Lr(e.target);h.fragment&&h.fragment.l(_),_.forEach(S)}else h.fragment&&h.fragment.c();e.intro&&sn(t.$$.fragment),rn(t,e.target,e.anchor),or()}Tn(c)}class xe{constructor(){_t(this,"$$");_t(this,"$$set")}$destroy(){an(this,1),this.$destroy=ne}$on(e,n){if(!sr(n))return ne;const l=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return l.push(n),()=>{const s=l.indexOf(n);s!==-1&&l.splice(s,1)}}$set(e){this.$$set&&!yr(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const Rr="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(Rr);const en=[];function Dr(t,e=ne){let n;const l=new Set;function s(o){if(je(t,o)&&(t=o,n)){const c=!en.length;for(const h of l)h[1](),en.push(h,t);if(c){for(let h=0;h{l.delete(h),l.size===0&&n&&(n(),n=null)}}return{set:s,update:u,subscribe:d}}function Rn(t,e,n,l){if(n==="a"&&!l)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!l:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?l:n==="a"?l.call(t):l?l.value:e.get(t)}function Xi(t,e,n,l,s){if(l==="m")throw new TypeError("Private method is not writable");if(l==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return l==="a"?s.call(t,n):s?s.value=n:e.set(t,n),n}var En;function dr(t,e=!1){return window.__TAURI_INTERNALS__.transformCallback(t,e)}class Il{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,En.set(this,()=>{}),this.id=dr(e=>{Rn(this,En,"f").call(this,e)})}set onmessage(e){Xi(this,En,e,"f")}get onmessage(){return Rn(this,En,"f")}toJSON(){return`__CHANNEL__:${this.id}`}}En=new WeakMap;async function m(t,e={},n){return window.__TAURI_INTERNALS__.invoke(t,e,n)}async function Fr(){return m("plugin:app|version")}async function Hr(){return m("plugin:app|name")}async function Ur(){return m("plugin:app|tauri_version")}async function Br(){return m("plugin:app|app_show")}async function Vr(){return m("plugin:app|app_hide")}function qr(t){let e,n,l,s,u,d,o,c,h,w,_,W,k,y,C,E,V,D,M,I,P,T,R,Y;return{c(){e=r("div"),n=r("p"),n.innerHTML=`This is a demo of Tauri's API capabilities using the @tauri-apps/api package. It's used as the main validation app, serving as the test bed of our +var yr=Object.defineProperty;var vr=(t,e,n)=>e in t?yr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var _t=(t,e,n)=>(vr(t,typeof e!="symbol"?e+"":e,n),n);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))l(s);new MutationObserver(s=>{for(const u of s)if(u.type==="childList")for(const d of u.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&l(d)}).observe(document,{childList:!0,subtree:!0});function n(s){const u={};return s.integrity&&(u.integrity=s.integrity),s.referrerPolicy&&(u.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?u.credentials="include":s.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function l(s){if(s.ep)return;s.ep=!0;const u=n(s);fetch(s.href,u)}})();function ie(){}function sr(t){return t()}function Ms(){return Object.create(null)}function Ce(t){t.forEach(sr)}function rr(t){return typeof t=="function"}function je(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}let Vi;function Cr(t,e){return t===e?!0:(Vi||(Vi=document.createElement("a")),Vi.href=e,t===Vi.href)}function Sr(t){return Object.keys(t).length===0}function Lr(t,...e){if(t==null){for(const l of e)l(void 0);return ie}const n=t.subscribe(...e);return n.unsubscribe?()=>n.unsubscribe():n}function Ar(t,e,n){t.$$.on_destroy.push(Lr(e,n))}function i(t,e){t.appendChild(e)}function C(t,e,n){t.insertBefore(e,n||null)}function v(t){t.parentNode&&t.parentNode.removeChild(t)}function Je(t,e){for(let n=0;nt.removeEventListener(e,n,l)}function Ps(t){return function(e){return e.preventDefault(),t.call(this,e)}}function a(t,e,n){n==null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function Q(t){return t===""?null:+t}function Pr(t){return Array.from(t.childNodes)}function re(t,e){e=""+e,t.data!==e&&(t.data=e)}function I(t,e){t.value=e??""}function xt(t,e,n,l){n==null?t.style.removeProperty(e):t.style.setProperty(e,n,l?"important":"")}function Qe(t,e,n){for(let l=0;l{const s=t.$$.callbacks[e];if(s){const u=Er(e,n,{cancelable:l});return s.slice().forEach(d=>{d.call(t,u)}),!u.defaultPrevented}return!0}}const tn=[],sn=[];let nn=[];const El=[],or=Promise.resolve();let Tl=!1;function cr(){Tl||(Tl=!0,or.then(hr))}function Ts(){return cr(),or}function wt(t){nn.push(t)}function dr(t){El.push(t)}const Sl=new Set;let $t=0;function hr(){if($t!==0)return;const t=On;do{try{for(;$tt.indexOf(l)===-1?e.push(l):n.push(l)),n.forEach(l=>l()),nn=e}const qi=new Set;let zt;function Wr(){zt={r:0,c:[],p:zt}}function Ir(){zt.r||Ce(zt.c),zt=zt.p}function rn(t,e){t&&t.i&&(qi.delete(t),t.i(e))}function Wn(t,e,n,l){if(t&&t.o){if(qi.has(t))return;qi.add(t),zt.c.push(()=>{qi.delete(t),l&&(n&&t.d(1),l())}),t.o(e)}else l&&l()}function fe(t){return(t==null?void 0:t.length)!==void 0?t:Array.from(t)}function fr(t,e,n){const l=t.$$.props[e];l!==void 0&&(t.$$.bound[l]=n,n(t.$$.ctx[l]))}function In(t){t&&t.c()}function an(t,e,n){const{fragment:l,after_update:s}=t.$$;l&&l.m(e,n),wt(()=>{const u=t.$$.on_mount.map(sr).filter(rr);t.$$.on_destroy?t.$$.on_destroy.push(...u):Ce(u),t.$$.on_mount=[]}),s.forEach(wt)}function un(t,e){const n=t.$$;n.fragment!==null&&(Or(n.after_update),Ce(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function Rr(t,e){t.$$.dirty[0]===-1&&(tn.push(t),cr(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<{const y=k.length?k[0]:A;return h.ctx&&s(h.ctx[_],h.ctx[_]=y)&&(!h.skip_bound&&h.bound[_]&&h.bound[_](y),w&&Rr(t,_)),A}):[],h.update(),w=!0,Ce(h.before_update),h.fragment=l?l(h.ctx):!1,e.target){if(e.hydrate){const _=Pr(e.target);h.fragment&&h.fragment.l(_),_.forEach(v)}else h.fragment&&h.fragment.c();e.intro&&rn(t.$$.fragment),an(t,e.target,e.anchor),hr()}zn(c)}class xe{constructor(){_t(this,"$$");_t(this,"$$set")}$destroy(){un(this,1),this.$destroy=ie}$on(e,n){if(!rr(n))return ie;const l=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return l.push(n),()=>{const s=l.indexOf(n);s!==-1&&l.splice(s,1)}}$set(e){this.$$set&&!Sr(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const Dr="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(Dr);const en=[];function Fr(t,e=ie){let n;const l=new Set;function s(o){if(je(t,o)&&(t=o,n)){const c=!en.length;for(const h of l)h[1](),en.push(h,t);if(c){for(let h=0;h{l.delete(h),l.size===0&&n&&(n(),n=null)}}return{set:s,update:u,subscribe:d}}function Rn(t,e,n,l){if(n==="a"&&!l)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!l:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?l:n==="a"?l.call(t):l?l.value:e.get(t)}function Xi(t,e,n,l,s){if(l==="m")throw new TypeError("Private method is not writable");if(l==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return l==="a"?s.call(t,n):s?s.value=n:e.set(t,n),n}var Tn;function pr(t,e=!1){return window.__TAURI_INTERNALS__.transformCallback(t,e)}class Il{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,Tn.set(this,()=>{}),this.id=pr(e=>{Rn(this,Tn,"f").call(this,e)})}set onmessage(e){Xi(this,Tn,e,"f")}get onmessage(){return Rn(this,Tn,"f")}toJSON(){return`__CHANNEL__:${this.id}`}}Tn=new WeakMap;async function m(t,e={},n){return window.__TAURI_INTERNALS__.invoke(t,e,n)}async function Hr(){return m("plugin:app|version")}async function Ur(){return m("plugin:app|name")}async function Br(){return m("plugin:app|tauri_version")}async function Vr(){return m("plugin:app|app_show")}async function qr(){return m("plugin:app|app_hide")}function Nr(t){let e,n,l,s,u,d,o,c,h,w,_,A,k,y,L,M,B,D,O,P,E,z,R,J;return{c(){e=r("div"),n=r("p"),n.innerHTML=`This is a demo of Tauri's API capabilities using the @tauri-apps/api package. It's used as the main validation app, serving as the test bed of our development process. In the future, this app will be used on Tauri's integration - tests.`,l=p(),s=r("br"),u=p(),d=r("br"),o=p(),c=r("pre"),h=b(" App name: "),w=r("code"),_=b(t[2]),W=b(` - App version: `),k=r("code"),y=b(t[0]),C=b(` - Tauri version: `),E=r("code"),V=b(t[1]),D=b(` - `),M=p(),I=r("br"),P=p(),T=r("button"),T.textContent="Context menu",a(T,"class","btn")},m(q,Q){L(q,e,Q),i(e,n),i(e,l),i(e,s),i(e,u),i(e,d),i(e,o),i(e,c),i(c,h),i(c,w),i(w,_),i(c,W),i(c,k),i(k,y),i(c,C),i(c,E),i(E,V),i(c,D),i(e,M),i(e,I),i(e,P),i(e,T),R||(Y=A(T,"click",t[3]),R=!0)},p(q,[Q]){Q&4&&se(_,q[2]),Q&1&&se(y,q[0]),Q&2&&se(V,q[1])},i:ne,o:ne,d(q){q&&S(e),R=!1,Y()}}}function Nr(t,e,n){let l="1.0.0",s="1.0.0",u="Unknown";Hr().then(o=>{n(2,u=o)}),Fr().then(o=>{n(0,l=o)}),Ur().then(o=>{n(1,s=o)});function d(){m("popup_context_menu")}return[l,s,u,d]}class jr extends xe{constructor(e){super(),Ze(this,e,Nr,qr,je,{})}}var Oe;(function(t){t.WINDOW_RESIZED="tauri://resize",t.WINDOW_MOVED="tauri://move",t.WINDOW_CLOSE_REQUESTED="tauri://close-requested",t.WINDOW_CREATED="tauri://window-created",t.WINDOW_DESTROYED="tauri://destroyed",t.WINDOW_FOCUS="tauri://focus",t.WINDOW_BLUR="tauri://blur",t.WINDOW_SCALE_FACTOR_CHANGED="tauri://scale-change",t.WINDOW_THEME_CHANGED="tauri://theme-changed",t.WINDOW_FILE_DROP="tauri://file-drop",t.WINDOW_FILE_DROP_HOVER="tauri://file-drop-hover",t.WINDOW_FILE_DROP_CANCELLED="tauri://file-drop-cancelled"})(Oe||(Oe={}));async function hr(t,e){await m("plugin:event|unlisten",{event:t,eventId:e})}async function Rl(t,e,n){return m("plugin:event|listen",{event:t,windowLabel:n==null?void 0:n.target,handler:dr(e)}).then(l=>async()=>hr(t,l))}async function Gr(t,e,n){return Rl(t,l=>{e(l),hr(t,l.id).catch(()=>{})},n)}async function fr(t,e,n){await m("plugin:event|emit",{event:t,windowLabel:n==null?void 0:n.target,payload:e})}function Kr(t){let e,n,l,s,u,d,o,c;return{c(){e=r("div"),n=r("button"),n.textContent="Call Log API",l=p(),s=r("button"),s.textContent="Call Request (async) API",u=p(),d=r("button"),d.textContent="Send event to Rust",a(n,"class","btn"),a(n,"id","log"),a(s,"class","btn"),a(s,"id","request"),a(d,"class","btn"),a(d,"id","event")},m(h,w){L(h,e,w),i(e,n),i(e,l),i(e,s),i(e,u),i(e,d),o||(c=[A(n,"click",t[0]),A(s,"click",t[1]),A(d,"click",t[2])],o=!0)},p:ne,i:ne,o:ne,d(h){h&&S(e),o=!1,Ce(c)}}}function Xr(t,e,n){let{onMessage:l}=e,s;Ki(async()=>{s=await Rl("rust-event",l)}),rr(()=>{s&&s()});function u(){m("log_operation",{event:"tauri-click",payload:"this payload is optional because we used Option in Rust"})}function d(){m("perform_request",{endpoint:"dummy endpoint arg",body:{id:5,name:"test"}}).then(l).catch(l)}function o(){fr("js-event","this is the payload string")}return t.$$set=c=>{"onMessage"in c&&n(3,l=c.onMessage)},[u,d,o,l]}class Yr extends xe{constructor(e){super(),Ze(this,e,Xr,Kr,je,{onMessage:3})}}class zl{constructor(e,n){this.type="Logical",this.width=e,this.height=n}}class ln{constructor(e,n){this.type="Physical",this.width=e,this.height=n}toLogical(e){return new zl(this.width/e,this.height/e)}}class Qr{constructor(e,n){this.type="Logical",this.x=e,this.y=n}}class it{constructor(e,n){this.type="Physical",this.x=e,this.y=n}toLogical(e){return new Qr(this.x/e,this.y/e)}}var Yi;(function(t){t[t.Critical=1]="Critical",t[t.Informational=2]="Informational"})(Yi||(Yi={}));class Jr{constructor(e){this._preventDefault=!1,this.event=e.event,this.windowLabel=e.windowLabel,this.id=e.id}preventDefault(){this._preventDefault=!0}isPreventDefault(){return this._preventDefault}}var Qi;(function(t){t.None="none",t.Normal="normal",t.Indeterminate="indeterminate",t.Paused="paused",t.Error="error"})(Qi||(Qi={}));function pr(){return new Dn(window.__TAURI_INTERNALS__.metadata.currentWindow.label,{skip:!0})}function Ll(){return window.__TAURI_INTERNALS__.metadata.windows.map(t=>new Dn(t.label,{skip:!0}))}const Ts=["tauri://created","tauri://error"];class Dn{constructor(e,n={}){this.label=e,this.listeners=Object.create(null),n!=null&&n.skip||m("plugin:window|create",{options:{...n,label:e}}).then(async()=>this.emit("tauri://created")).catch(async l=>this.emit("tauri://error",l))}static getByLabel(e){return Ll().some(n=>n.label===e)?new Dn(e,{skip:!0}):null}static getCurrent(){return pr()}static getAll(){return Ll()}static async getFocusedWindow(){for(const e of Ll())if(await e.isFocused())return e;return null}async listen(e,n){return this._handleTauriEvent(e,n)?Promise.resolve(()=>{const l=this.listeners[e];l.splice(l.indexOf(n),1)}):Rl(e,n,{target:this.label})}async once(e,n){return this._handleTauriEvent(e,n)?Promise.resolve(()=>{const l=this.listeners[e];l.splice(l.indexOf(n),1)}):Gr(e,n,{target:this.label})}async emit(e,n){if(Ts.includes(e)){for(const l of this.listeners[e]||[])l({event:e,id:-1,windowLabel:this.label,payload:n});return Promise.resolve()}return fr(e,n,{target:this.label})}_handleTauriEvent(e,n){return Ts.includes(e)?(e in this.listeners?this.listeners[e].push(n):this.listeners[e]=[n],!0):!1}async scaleFactor(){return m("plugin:window|scale_factor",{label:this.label})}async innerPosition(){return m("plugin:window|inner_position",{label:this.label}).then(({x:e,y:n})=>new it(e,n))}async outerPosition(){return m("plugin:window|outer_position",{label:this.label}).then(({x:e,y:n})=>new it(e,n))}async innerSize(){return m("plugin:window|inner_size",{label:this.label}).then(({width:e,height:n})=>new ln(e,n))}async outerSize(){return m("plugin:window|outer_size",{label:this.label}).then(({width:e,height:n})=>new ln(e,n))}async isFullscreen(){return m("plugin:window|is_fullscreen",{label:this.label})}async isMinimized(){return m("plugin:window|is_minimized",{label:this.label})}async isMaximized(){return m("plugin:window|is_maximized",{label:this.label})}async isFocused(){return m("plugin:window|is_focused",{label:this.label})}async isDecorated(){return m("plugin:window|is_decorated",{label:this.label})}async isResizable(){return m("plugin:window|is_resizable",{label:this.label})}async isMaximizable(){return m("plugin:window|is_maximizable",{label:this.label})}async isMinimizable(){return m("plugin:window|is_minimizable",{label:this.label})}async isClosable(){return m("plugin:window|is_closable",{label:this.label})}async isVisible(){return m("plugin:window|is_visible",{label:this.label})}async title(){return m("plugin:window|title",{label:this.label})}async theme(){return m("plugin:window|theme",{label:this.label})}async center(){return m("plugin:window|center",{label:this.label})}async requestUserAttention(e){let n=null;return e&&(e===Yi.Critical?n={type:"Critical"}:n={type:"Informational"}),m("plugin:window|request_user_attention",{label:this.label,value:n})}async setResizable(e){return m("plugin:window|set_resizable",{label:this.label,value:e})}async setMaximizable(e){return m("plugin:window|set_maximizable",{label:this.label,value:e})}async setMinimizable(e){return m("plugin:window|set_minimizable",{label:this.label,value:e})}async setClosable(e){return m("plugin:window|set_closable",{label:this.label,value:e})}async setTitle(e){return m("plugin:window|set_title",{label:this.label,value:e})}async maximize(){return m("plugin:window|maximize",{label:this.label})}async unmaximize(){return m("plugin:window|unmaximize",{label:this.label})}async toggleMaximize(){return m("plugin:window|toggle_maximize",{label:this.label})}async minimize(){return m("plugin:window|minimize",{label:this.label})}async unminimize(){return m("plugin:window|unminimize",{label:this.label})}async show(){return m("plugin:window|show",{label:this.label})}async hide(){return m("plugin:window|hide",{label:this.label})}async close(){return m("plugin:window|close",{label:this.label})}async setDecorations(e){return m("plugin:window|set_decorations",{label:this.label,value:e})}async setShadow(e){return m("plugin:window|set_shadow",{label:this.label,value:e})}async setEffects(e){return m("plugin:window|set_effects",{label:this.label,value:e})}async clearEffects(){return m("plugin:window|set_effects",{label:this.label,value:null})}async setAlwaysOnTop(e){return m("plugin:window|set_always_on_top",{label:this.label,value:e})}async setAlwaysOnBottom(e){return m("plugin:window|set_always_on_bottom",{label:this.label,value:e})}async setContentProtected(e){return m("plugin:window|set_content_protected",{label:this.label,value:e})}async setSize(e){if(!e||e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return m("plugin:window|set_size",{label:this.label,value:{type:e.type,data:{width:e.width,height:e.height}}})}async setMinSize(e){if(e&&e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return m("plugin:window|set_min_size",{label:this.label,value:e?{type:e.type,data:{width:e.width,height:e.height}}:null})}async setMaxSize(e){if(e&&e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return m("plugin:window|set_max_size",{label:this.label,value:e?{type:e.type,data:{width:e.width,height:e.height}}:null})}async setPosition(e){if(!e||e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `position` argument must be either a LogicalPosition or a PhysicalPosition instance");return m("plugin:window|set_position",{label:this.label,value:{type:e.type,data:{x:e.x,y:e.y}}})}async setFullscreen(e){return m("plugin:window|set_fullscreen",{label:this.label,value:e})}async setFocus(){return m("plugin:window|set_focus",{label:this.label})}async setIcon(e){return m("plugin:window|set_icon",{label:this.label,value:typeof e=="string"?e:Array.from(e)})}async setSkipTaskbar(e){return m("plugin:window|set_skip_taskbar",{label:this.label,value:e})}async setCursorGrab(e){return m("plugin:window|set_cursor_grab",{label:this.label,value:e})}async setCursorVisible(e){return m("plugin:window|set_cursor_visible",{label:this.label,value:e})}async setCursorIcon(e){return m("plugin:window|set_cursor_icon",{label:this.label,value:e})}async setCursorPosition(e){if(!e||e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `position` argument must be either a LogicalPosition or a PhysicalPosition instance");return m("plugin:window|set_cursor_position",{label:this.label,value:{type:e.type,data:{x:e.x,y:e.y}}})}async setIgnoreCursorEvents(e){return m("plugin:window|set_ignore_cursor_events",{label:this.label,value:e})}async startDragging(){return m("plugin:window|start_dragging",{label:this.label})}async setProgressBar(e){return m("plugin:window|set_progress_bar",{label:this.label,value:e})}async onResized(e){return this.listen(Oe.WINDOW_RESIZED,n=>{n.payload=Zr(n.payload),e(n)})}async onMoved(e){return this.listen(Oe.WINDOW_MOVED,n=>{n.payload=Al(n.payload),e(n)})}async onCloseRequested(e){return this.listen(Oe.WINDOW_CLOSE_REQUESTED,n=>{const l=new Jr(n);Promise.resolve(e(l)).then(()=>{if(!l.isPreventDefault())return this.close()})})}async onFocusChanged(e){const n=await this.listen(Oe.WINDOW_FOCUS,s=>{e({...s,payload:!0})}),l=await this.listen(Oe.WINDOW_BLUR,s=>{e({...s,payload:!1})});return()=>{n(),l()}}async onScaleChanged(e){return this.listen(Oe.WINDOW_SCALE_FACTOR_CHANGED,e)}async onFileDropEvent(e){const n=await this.listen(Oe.WINDOW_FILE_DROP,u=>{e({...u,payload:{type:"drop",paths:u.payload.paths,position:Al(u.payload.position)}})}),l=await this.listen(Oe.WINDOW_FILE_DROP_HOVER,u=>{e({...u,payload:{type:"hover",paths:u.payload.paths,position:Al(u.payload.position)}})}),s=await this.listen(Oe.WINDOW_FILE_DROP_CANCELLED,u=>{e({...u,payload:{type:"cancel"}})});return()=>{n(),l(),s()}}async onThemeChanged(e){return this.listen(Oe.WINDOW_THEME_CHANGED,e)}}var Ji;(function(t){t.AppearanceBased="appearanceBased",t.Light="light",t.Dark="dark",t.MediumLight="mediumLight",t.UltraDark="ultraDark",t.Titlebar="titlebar",t.Selection="selection",t.Menu="menu",t.Popover="popover",t.Sidebar="sidebar",t.HeaderView="headerView",t.Sheet="sheet",t.WindowBackground="windowBackground",t.HudWindow="hudWindow",t.FullScreenUI="fullScreenUI",t.Tooltip="tooltip",t.ContentBackground="contentBackground",t.UnderWindowBackground="underWindowBackground",t.UnderPageBackground="underPageBackground",t.Mica="mica",t.Blur="blur",t.Acrylic="acrylic",t.Tabbed="tabbed",t.TabbedDark="tabbedDark",t.TabbedLight="tabbedLight"})(Ji||(Ji={}));var Zi;(function(t){t.FollowsWindowActiveState="followsWindowActiveState",t.Active="active",t.Inactive="inactive"})(Zi||(Zi={}));function Al(t){return new it(t.x,t.y)}function Zr(t){return new ln(t.width,t.height)}function zs(t,e,n){const l=t.slice();return l[105]=e[n],l}function Os(t,e,n){const l=t.slice();return l[108]=e[n],l}function Ws(t,e,n){const l=t.slice();return l[111]=e[n],l}function Is(t,e,n){const l=t.slice();return l[114]=e[n],l}function Rs(t,e,n){const l=t.slice();return l[117]=e[n],l}function Ds(t){let e,n,l,s,u,d,o=he(Object.keys(t[1])),c=[];for(let h=0;ht[59].call(l))},m(h,w){L(h,e,w),L(h,n,w),L(h,l,w),i(l,s);for(let _=0;_{n(2,u=o)}),Hr().then(o=>{n(0,l=o)}),Br().then(o=>{n(1,s=o)});function d(){m("popup_context_menu")}return[l,s,u,d]}class Gr extends xe{constructor(e){super(),Ze(this,e,jr,Nr,je,{})}}var Oe;(function(t){t.WINDOW_RESIZED="tauri://resize",t.WINDOW_MOVED="tauri://move",t.WINDOW_CLOSE_REQUESTED="tauri://close-requested",t.WINDOW_CREATED="tauri://window-created",t.WINDOW_DESTROYED="tauri://destroyed",t.WINDOW_FOCUS="tauri://focus",t.WINDOW_BLUR="tauri://blur",t.WINDOW_SCALE_FACTOR_CHANGED="tauri://scale-change",t.WINDOW_THEME_CHANGED="tauri://theme-changed",t.WINDOW_FILE_DROP="tauri://file-drop",t.WINDOW_FILE_DROP_HOVER="tauri://file-drop-hover",t.WINDOW_FILE_DROP_CANCELLED="tauri://file-drop-cancelled"})(Oe||(Oe={}));async function mr(t,e){await m("plugin:event|unlisten",{event:t,eventId:e})}async function Rl(t,e,n){return m("plugin:event|listen",{event:t,windowLabel:n==null?void 0:n.target,handler:pr(e)}).then(l=>async()=>mr(t,l))}async function Kr(t,e,n){return Rl(t,l=>{e(l),mr(t,l.id).catch(()=>{})},n)}async function gr(t,e,n){await m("plugin:event|emit",{event:t,windowLabel:n==null?void 0:n.target,payload:e})}function Xr(t){let e,n,l,s,u,d,o,c;return{c(){e=r("div"),n=r("button"),n.textContent="Call Log API",l=p(),s=r("button"),s.textContent="Call Request (async) API",u=p(),d=r("button"),d.textContent="Send event to Rust",a(n,"class","btn"),a(n,"id","log"),a(s,"class","btn"),a(s,"id","request"),a(d,"class","btn"),a(d,"id","event")},m(h,w){C(h,e,w),i(e,n),i(e,l),i(e,s),i(e,u),i(e,d),o||(c=[S(n,"click",t[0]),S(s,"click",t[1]),S(d,"click",t[2])],o=!0)},p:ie,i:ie,o:ie,d(h){h&&v(e),o=!1,Ce(c)}}}function Yr(t,e,n){let{onMessage:l}=e,s;Ki(async()=>{s=await Rl("rust-event",l)}),ar(()=>{s&&s()});function u(){m("log_operation",{event:"tauri-click",payload:"this payload is optional because we used Option in Rust"})}function d(){m("perform_request",{endpoint:"dummy endpoint arg",body:{id:5,name:"test"}}).then(l).catch(l)}function o(){gr("js-event","this is the payload string")}return t.$$set=c=>{"onMessage"in c&&n(3,l=c.onMessage)},[u,d,o,l]}class Qr extends xe{constructor(e){super(),Ze(this,e,Yr,Xr,je,{onMessage:3})}}class zl{constructor(e,n){this.type="Logical",this.width=e,this.height=n}}class ln{constructor(e,n){this.type="Physical",this.width=e,this.height=n}toLogical(e){return new zl(this.width/e,this.height/e)}}class Jr{constructor(e,n){this.type="Logical",this.x=e,this.y=n}}class it{constructor(e,n){this.type="Physical",this.x=e,this.y=n}toLogical(e){return new Jr(this.x/e,this.y/e)}}var Yi;(function(t){t[t.Critical=1]="Critical",t[t.Informational=2]="Informational"})(Yi||(Yi={}));class Zr{constructor(e){this._preventDefault=!1,this.event=e.event,this.windowLabel=e.windowLabel,this.id=e.id}preventDefault(){this._preventDefault=!0}isPreventDefault(){return this._preventDefault}}var Qi;(function(t){t.None="none",t.Normal="normal",t.Indeterminate="indeterminate",t.Paused="paused",t.Error="error"})(Qi||(Qi={}));function _r(){return new Dn(window.__TAURI_INTERNALS__.metadata.currentWindow.label,{skip:!0})}function Ll(){return window.__TAURI_INTERNALS__.metadata.windows.map(t=>new Dn(t.label,{skip:!0}))}const zs=["tauri://created","tauri://error"];class Dn{constructor(e,n={}){this.label=e,this.listeners=Object.create(null),n!=null&&n.skip||m("plugin:window|create",{options:{...n,label:e}}).then(async()=>this.emit("tauri://created")).catch(async l=>this.emit("tauri://error",l))}static getByLabel(e){return Ll().some(n=>n.label===e)?new Dn(e,{skip:!0}):null}static getCurrent(){return _r()}static getAll(){return Ll()}static async getFocusedWindow(){for(const e of Ll())if(await e.isFocused())return e;return null}async listen(e,n){return this._handleTauriEvent(e,n)?Promise.resolve(()=>{const l=this.listeners[e];l.splice(l.indexOf(n),1)}):Rl(e,n,{target:this.label})}async once(e,n){return this._handleTauriEvent(e,n)?Promise.resolve(()=>{const l=this.listeners[e];l.splice(l.indexOf(n),1)}):Kr(e,n,{target:this.label})}async emit(e,n){if(zs.includes(e)){for(const l of this.listeners[e]||[])l({event:e,id:-1,windowLabel:this.label,payload:n});return Promise.resolve()}return gr(e,n,{target:this.label})}_handleTauriEvent(e,n){return zs.includes(e)?(e in this.listeners?this.listeners[e].push(n):this.listeners[e]=[n],!0):!1}async scaleFactor(){return m("plugin:window|scale_factor",{label:this.label})}async innerPosition(){return m("plugin:window|inner_position",{label:this.label}).then(({x:e,y:n})=>new it(e,n))}async outerPosition(){return m("plugin:window|outer_position",{label:this.label}).then(({x:e,y:n})=>new it(e,n))}async innerSize(){return m("plugin:window|inner_size",{label:this.label}).then(({width:e,height:n})=>new ln(e,n))}async outerSize(){return m("plugin:window|outer_size",{label:this.label}).then(({width:e,height:n})=>new ln(e,n))}async isFullscreen(){return m("plugin:window|is_fullscreen",{label:this.label})}async isMinimized(){return m("plugin:window|is_minimized",{label:this.label})}async isMaximized(){return m("plugin:window|is_maximized",{label:this.label})}async isFocused(){return m("plugin:window|is_focused",{label:this.label})}async isDecorated(){return m("plugin:window|is_decorated",{label:this.label})}async isResizable(){return m("plugin:window|is_resizable",{label:this.label})}async isMaximizable(){return m("plugin:window|is_maximizable",{label:this.label})}async isMinimizable(){return m("plugin:window|is_minimizable",{label:this.label})}async isClosable(){return m("plugin:window|is_closable",{label:this.label})}async isVisible(){return m("plugin:window|is_visible",{label:this.label})}async title(){return m("plugin:window|title",{label:this.label})}async theme(){return m("plugin:window|theme",{label:this.label})}async center(){return m("plugin:window|center",{label:this.label})}async requestUserAttention(e){let n=null;return e&&(e===Yi.Critical?n={type:"Critical"}:n={type:"Informational"}),m("plugin:window|request_user_attention",{label:this.label,value:n})}async setResizable(e){return m("plugin:window|set_resizable",{label:this.label,value:e})}async setMaximizable(e){return m("plugin:window|set_maximizable",{label:this.label,value:e})}async setMinimizable(e){return m("plugin:window|set_minimizable",{label:this.label,value:e})}async setClosable(e){return m("plugin:window|set_closable",{label:this.label,value:e})}async setTitle(e){return m("plugin:window|set_title",{label:this.label,value:e})}async maximize(){return m("plugin:window|maximize",{label:this.label})}async unmaximize(){return m("plugin:window|unmaximize",{label:this.label})}async toggleMaximize(){return m("plugin:window|toggle_maximize",{label:this.label})}async minimize(){return m("plugin:window|minimize",{label:this.label})}async unminimize(){return m("plugin:window|unminimize",{label:this.label})}async show(){return m("plugin:window|show",{label:this.label})}async hide(){return m("plugin:window|hide",{label:this.label})}async close(){return m("plugin:window|close",{label:this.label})}async setDecorations(e){return m("plugin:window|set_decorations",{label:this.label,value:e})}async setShadow(e){return m("plugin:window|set_shadow",{label:this.label,value:e})}async setEffects(e){return m("plugin:window|set_effects",{label:this.label,value:e})}async clearEffects(){return m("plugin:window|set_effects",{label:this.label,value:null})}async setAlwaysOnTop(e){return m("plugin:window|set_always_on_top",{label:this.label,value:e})}async setAlwaysOnBottom(e){return m("plugin:window|set_always_on_bottom",{label:this.label,value:e})}async setContentProtected(e){return m("plugin:window|set_content_protected",{label:this.label,value:e})}async setSize(e){if(!e||e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return m("plugin:window|set_size",{label:this.label,value:{type:e.type,data:{width:e.width,height:e.height}}})}async setMinSize(e){if(e&&e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return m("plugin:window|set_min_size",{label:this.label,value:e?{type:e.type,data:{width:e.width,height:e.height}}:null})}async setMaxSize(e){if(e&&e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return m("plugin:window|set_max_size",{label:this.label,value:e?{type:e.type,data:{width:e.width,height:e.height}}:null})}async setPosition(e){if(!e||e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `position` argument must be either a LogicalPosition or a PhysicalPosition instance");return m("plugin:window|set_position",{label:this.label,value:{type:e.type,data:{x:e.x,y:e.y}}})}async setFullscreen(e){return m("plugin:window|set_fullscreen",{label:this.label,value:e})}async setFocus(){return m("plugin:window|set_focus",{label:this.label})}async setIcon(e){return m("plugin:window|set_icon",{label:this.label,value:typeof e=="string"?e:Array.from(e)})}async setSkipTaskbar(e){return m("plugin:window|set_skip_taskbar",{label:this.label,value:e})}async setCursorGrab(e){return m("plugin:window|set_cursor_grab",{label:this.label,value:e})}async setCursorVisible(e){return m("plugin:window|set_cursor_visible",{label:this.label,value:e})}async setCursorIcon(e){return m("plugin:window|set_cursor_icon",{label:this.label,value:e})}async setCursorPosition(e){if(!e||e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `position` argument must be either a LogicalPosition or a PhysicalPosition instance");return m("plugin:window|set_cursor_position",{label:this.label,value:{type:e.type,data:{x:e.x,y:e.y}}})}async setIgnoreCursorEvents(e){return m("plugin:window|set_ignore_cursor_events",{label:this.label,value:e})}async startDragging(){return m("plugin:window|start_dragging",{label:this.label})}async setProgressBar(e){return m("plugin:window|set_progress_bar",{label:this.label,value:e})}async onResized(e){return this.listen(Oe.WINDOW_RESIZED,n=>{n.payload=xr(n.payload),e(n)})}async onMoved(e){return this.listen(Oe.WINDOW_MOVED,n=>{n.payload=Al(n.payload),e(n)})}async onCloseRequested(e){return this.listen(Oe.WINDOW_CLOSE_REQUESTED,n=>{const l=new Zr(n);Promise.resolve(e(l)).then(()=>{if(!l.isPreventDefault())return this.close()})})}async onFocusChanged(e){const n=await this.listen(Oe.WINDOW_FOCUS,s=>{e({...s,payload:!0})}),l=await this.listen(Oe.WINDOW_BLUR,s=>{e({...s,payload:!1})});return()=>{n(),l()}}async onScaleChanged(e){return this.listen(Oe.WINDOW_SCALE_FACTOR_CHANGED,e)}async onFileDropEvent(e){const n=await this.listen(Oe.WINDOW_FILE_DROP,u=>{e({...u,payload:{type:"drop",paths:u.payload.paths,position:Al(u.payload.position)}})}),l=await this.listen(Oe.WINDOW_FILE_DROP_HOVER,u=>{e({...u,payload:{type:"hover",paths:u.payload.paths,position:Al(u.payload.position)}})}),s=await this.listen(Oe.WINDOW_FILE_DROP_CANCELLED,u=>{e({...u,payload:{type:"cancel"}})});return()=>{n(),l(),s()}}async onThemeChanged(e){return this.listen(Oe.WINDOW_THEME_CHANGED,e)}}var Ji;(function(t){t.AppearanceBased="appearanceBased",t.Light="light",t.Dark="dark",t.MediumLight="mediumLight",t.UltraDark="ultraDark",t.Titlebar="titlebar",t.Selection="selection",t.Menu="menu",t.Popover="popover",t.Sidebar="sidebar",t.HeaderView="headerView",t.Sheet="sheet",t.WindowBackground="windowBackground",t.HudWindow="hudWindow",t.FullScreenUI="fullScreenUI",t.Tooltip="tooltip",t.ContentBackground="contentBackground",t.UnderWindowBackground="underWindowBackground",t.UnderPageBackground="underPageBackground",t.Mica="mica",t.Blur="blur",t.Acrylic="acrylic",t.Tabbed="tabbed",t.TabbedDark="tabbedDark",t.TabbedLight="tabbedLight"})(Ji||(Ji={}));var Zi;(function(t){t.FollowsWindowActiveState="followsWindowActiveState",t.Active="active",t.Inactive="inactive"})(Zi||(Zi={}));function Al(t){return new it(t.x,t.y)}function xr(t){return new ln(t.width,t.height)}function Os(t,e,n){const l=t.slice();return l[105]=e[n],l}function Ws(t,e,n){const l=t.slice();return l[108]=e[n],l}function Is(t,e,n){const l=t.slice();return l[111]=e[n],l}function Rs(t,e,n){const l=t.slice();return l[114]=e[n],l}function Ds(t,e,n){const l=t.slice();return l[117]=e[n],l}function Fs(t){let e,n,l,s,u,d,o=fe(Object.keys(t[1])),c=[];for(let h=0;ht[59].call(l))},m(h,w){C(h,e,w),C(h,n,w),C(h,l,w),i(l,s);for(let _=0;_e in t?br(t,e,{enumerable:!0,config `),Ge=r("input"),Jn=p(),Dt=r("div"),Zn=b(`Min height `),Ke=r("input"),xn=p(),rt=r("div"),Ft=r("div"),$n=b(`Max width `),Ve=r("input"),ei=p(),Ht=r("div"),ti=b(`Max height - `),qe=r("input"),dn=p(),hn=r("br"),fn=p(),ze=r("div"),at=r("div"),Xe=r("div"),N=r("div"),N.textContent="Inner Size",pn=p(),kt=r("span"),mn=b("Width: "),Ut=b(yt),gn=p(),vt=r("span"),_n=b("Height: "),Bt=b(Ct),bn=p(),Ne=r("div"),St=r("div"),St.textContent="Outer Size",wn=p(),Lt=r("span"),kn=b("Width: "),Vt=b(At),yn=p(),Mt=r("span"),vn=b("Height: "),qt=b(Pt),ni=p(),Nt=r("div"),ut=r("div"),ii=r("div"),ii.textContent="Inner Logical Size",Fl=p(),li=r("span"),Hl=b("Width: "),xi=b(si),Ul=p(),ri=r("span"),Bl=b("Height: "),$i=b(ai),Vl=p(),ot=r("div"),ui=r("div"),ui.textContent="Outer Logical Size",ql=p(),oi=r("span"),Nl=b("Width: "),el=b(ci),jl=p(),di=r("span"),Gl=b("Height: "),tl=b(hi),Kl=p(),jt=r("div"),ct=r("div"),fi=r("div"),fi.textContent="Inner Position",Xl=p(),pi=r("span"),Yl=b("x: "),nl=b(mi),Ql=p(),gi=r("span"),Jl=b("y: "),il=b(_i),Zl=p(),dt=r("div"),bi=r("div"),bi.textContent="Outer Position",xl=p(),wi=r("span"),$l=b("x: "),ll=b(ki),es=p(),yi=r("span"),ts=b("y: "),sl=b(vi),ns=p(),Gt=r("div"),ht=r("div"),Ci=r("div"),Ci.textContent="Inner Logical Position",is=p(),Si=r("span"),ls=b("x: "),rl=b(Li),ss=p(),Ai=r("span"),rs=b("y: "),al=b(Mi),as=p(),ft=r("div"),Pi=r("div"),Pi.textContent="Outer Logical Position",us=p(),Ei=r("span"),os=b("x: "),ul=b(Ti),cs=p(),zi=r("span"),ds=b("y: "),ol=b(Oi),cl=p(),dl=r("br"),hl=p(),Cn=r("h4"),Cn.textContent="Cursor",fl=p(),$e=r("div"),Wi=r("label"),Kt=r("input"),hs=b(` + `),qe=r("input"),hn=p(),fn=r("br"),pn=p(),ze=r("div"),at=r("div"),Xe=r("div"),N=r("div"),N.textContent="Inner Size",mn=p(),kt=r("span"),gn=b("Width: "),Ut=b(yt),_n=p(),vt=r("span"),bn=b("Height: "),Bt=b(Ct),wn=p(),Ne=r("div"),St=r("div"),St.textContent="Outer Size",kn=p(),Lt=r("span"),yn=b("Width: "),Vt=b(At),vn=p(),Mt=r("span"),Cn=b("Height: "),qt=b(Pt),ni=p(),Nt=r("div"),ut=r("div"),ii=r("div"),ii.textContent="Inner Logical Size",Fl=p(),li=r("span"),Hl=b("Width: "),xi=b(si),Ul=p(),ri=r("span"),Bl=b("Height: "),$i=b(ai),Vl=p(),ot=r("div"),ui=r("div"),ui.textContent="Outer Logical Size",ql=p(),oi=r("span"),Nl=b("Width: "),el=b(ci),jl=p(),di=r("span"),Gl=b("Height: "),tl=b(hi),Kl=p(),jt=r("div"),ct=r("div"),fi=r("div"),fi.textContent="Inner Position",Xl=p(),pi=r("span"),Yl=b("x: "),nl=b(mi),Ql=p(),gi=r("span"),Jl=b("y: "),il=b(_i),Zl=p(),dt=r("div"),bi=r("div"),bi.textContent="Outer Position",xl=p(),wi=r("span"),$l=b("x: "),ll=b(ki),es=p(),yi=r("span"),ts=b("y: "),sl=b(vi),ns=p(),Gt=r("div"),ht=r("div"),Ci=r("div"),Ci.textContent="Inner Logical Position",is=p(),Si=r("span"),ls=b("x: "),rl=b(Li),ss=p(),Ai=r("span"),rs=b("y: "),al=b(Mi),as=p(),ft=r("div"),Pi=r("div"),Pi.textContent="Outer Logical Position",us=p(),Ei=r("span"),os=b("x: "),ul=b(Ti),cs=p(),zi=r("span"),ds=b("y: "),ol=b(Oi),cl=p(),dl=r("br"),hl=p(),Sn=r("h4"),Sn.textContent="Cursor",fl=p(),$e=r("div"),Wi=r("label"),Kt=r("input"),hs=b(` Grab`),fs=p(),Ii=r("label"),Xt=r("input"),ps=b(` Visible`),ms=p(),Ri=r("label"),Yt=r("input"),gs=b(` Ignore events`),pl=p(),et=r("div"),Di=r("label"),_s=b(`Icon `),tt=r("select");for(let f=0;ft[83].call(tt)),a(pt,"class","input"),a(pt,"type","number"),a(mt,"class","input"),a(mt,"type","number"),a(et,"class","flex gap-2"),a(gt,"class","input grow"),a(gt,"id","title"),a(Ln,"class","btn"),a(Ln,"type","submit"),a(Et,"class","flex gap-1"),a(Sn,"class","flex flex-col gap-1"),a(nt,"class","input"),t[26]===void 0&&wt(()=>t[87].call(nt)),a(Ye,"class","input"),a(Ye,"type","number"),a(Ye,"min","0"),a(Ye,"max","100"),a(Qt,"class","flex gap-2"),a(An,"class","flex flex-col gap-1")},m(f,g){L(f,e,g),L(f,n,g),L(f,l,g),i(l,s),i(l,u),i(l,d),i(d,o),O(o,t[43]),i(d,c),i(d,h),L(f,w,g),L(f,_,g),L(f,W,g),L(f,k,g),i(k,y),i(k,C),i(k,E),i(k,V),i(k,D),i(k,M),i(k,I),L(f,P,g),L(f,T,g),i(T,R),i(R,Y),i(R,q),q.checked=t[6],i(T,Q),i(T,ie),i(ie,ee),i(ie,v),v.checked=t[2],i(T,B),i(T,G),i(G,oe),i(G,Z),Z.checked=t[3],i(T,we),i(T,be),i(be,fe),i(be,ce),ce.checked=t[4],i(T,x),i(T,pe),i(pe,K),i(pe,le),le.checked=t[5],i(T,te),i(T,z),i(z,J),i(z,H),H.checked=t[7],i(T,re),i(T,Ae),i(Ae,ke),i(Ae,me),me.checked=t[8],i(T,We),i(T,Me),i(Me,Ie),i(Me,ge),ge.checked=t[9],i(T,_e),i(T,Se),i(Se,Pe),i(Se,de),de.checked=t[10],i(T,Le),i(T,ae),i(ae,Re),i(ae,De),De.checked=t[11],L(f,Ee,g),L(f,ue,g),L(f,F,g),L(f,$,g),i($,U),i(U,Te),i(Te,Vn),i(Te,Fe),O(Fe,t[18]),i(U,qn),i(U,Ot),i(Ot,Nn),i(Ot,He),O(He,t[19]),i($,jn),i($,lt),i(lt,Wt),i(Wt,Gn),i(Wt,Ue),O(Ue,t[12]),i(lt,Kn),i(lt,It),i(It,Xn),i(It,Be),O(Be,t[13]),i($,Yn),i($,st),i(st,Rt),i(Rt,Qn),i(Rt,Ge),O(Ge,t[14]),i(st,Jn),i(st,Dt),i(Dt,Zn),i(Dt,Ke),O(Ke,t[15]),i($,xn),i($,rt),i(rt,Ft),i(Ft,$n),i(Ft,Ve),O(Ve,t[16]),i(rt,ei),i(rt,Ht),i(Ht,ti),i(Ht,qe),O(qe,t[17]),L(f,dn,g),L(f,hn,g),L(f,fn,g),L(f,ze,g),i(ze,at),i(at,Xe),i(Xe,N),i(Xe,pn),i(Xe,kt),i(kt,mn),i(kt,Ut),i(Xe,gn),i(Xe,vt),i(vt,_n),i(vt,Bt),i(at,bn),i(at,Ne),i(Ne,St),i(Ne,wn),i(Ne,Lt),i(Lt,kn),i(Lt,Vt),i(Ne,yn),i(Ne,Mt),i(Mt,vn),i(Mt,qt),i(ze,ni),i(ze,Nt),i(Nt,ut),i(ut,ii),i(ut,Fl),i(ut,li),i(li,Hl),i(li,xi),i(ut,Ul),i(ut,ri),i(ri,Bl),i(ri,$i),i(Nt,Vl),i(Nt,ot),i(ot,ui),i(ot,ql),i(ot,oi),i(oi,Nl),i(oi,el),i(ot,jl),i(ot,di),i(di,Gl),i(di,tl),i(ze,Kl),i(ze,jt),i(jt,ct),i(ct,fi),i(ct,Xl),i(ct,pi),i(pi,Yl),i(pi,nl),i(ct,Ql),i(ct,gi),i(gi,Jl),i(gi,il),i(jt,Zl),i(jt,dt),i(dt,bi),i(dt,xl),i(dt,wi),i(wi,$l),i(wi,ll),i(dt,es),i(dt,yi),i(yi,ts),i(yi,sl),i(ze,ns),i(ze,Gt),i(Gt,ht),i(ht,Ci),i(ht,is),i(ht,Si),i(Si,ls),i(Si,rl),i(ht,ss),i(ht,Ai),i(Ai,rs),i(Ai,al),i(Gt,as),i(Gt,ft),i(ft,Pi),i(ft,us),i(ft,Ei),i(Ei,os),i(Ei,ul),i(ft,cs),i(ft,zi),i(zi,ds),i(zi,ol),L(f,cl,g),L(f,dl,g),L(f,hl,g),L(f,Cn,g),L(f,fl,g),L(f,$e,g),i($e,Wi),i(Wi,Kt),Kt.checked=t[20],i(Wi,hs),i($e,fs),i($e,Ii),i(Ii,Xt),Xt.checked=t[21],i(Ii,ps),i($e,ms),i($e,Ri),i(Ri,Yt),Yt.checked=t[25],i(Ri,gs),L(f,pl,g),L(f,et,g),i(et,Di),i(Di,_s),i(Di,tt);for(let j=0;jt[89].call(u)),a(h,"class","input"),t[37]===void 0&&wt(()=>t[90].call(h)),a(k,"class","input"),a(k,"type","number"),a(n,"class","flex"),xt(M,"max-width","120px"),a(M,"class","input"),a(M,"type","number"),a(M,"placeholder","R"),xt(P,"max-width","120px"),a(P,"class","input"),a(P,"type","number"),a(P,"placeholder","G"),xt(R,"max-width","120px"),a(R,"class","input"),a(R,"type","number"),a(R,"placeholder","B"),xt(q,"max-width","120px"),a(q,"class","input"),a(q,"type","number"),a(q,"placeholder","A"),a(D,"class","flex"),a(C,"class","flex"),a(ee,"class","btn"),xt(ee,"width","80px"),a(ie,"class","flex"),a(fe,"class","btn"),xt(fe,"width","80px"),a(B,"class","flex"),a(e,"class","flex flex-col gap-1")},m(z,J){L(z,e,J),i(e,n),i(n,l),i(l,s),i(l,u);for(let H=0;H=1,w,_,W,k=h&&Ds(t),y=t[1][t[0]]&&Hs(t);return{c(){e=r("div"),n=r("div"),l=r("input"),s=p(),u=r("button"),u.textContent="New window",d=p(),o=r("br"),c=p(),k&&k.c(),w=p(),y&&y.c(),a(l,"class","input grow"),a(l,"type","text"),a(l,"placeholder","New Window label.."),a(u,"class","btn"),a(n,"class","flex gap-1"),a(e,"class","flex flex-col children:grow gap-2")},m(C,E){L(C,e,E),i(e,n),i(n,l),O(l,t[28]),i(n,s),i(n,u),i(e,d),i(e,o),i(e,c),k&&k.m(e,null),i(e,w),y&&y.m(e,null),_||(W=[A(l,"input",t[58]),A(u,"click",t[53])],_=!0)},p(C,E){E[0]&268435456&&l.value!==C[28]&&O(l,C[28]),E[0]&2&&(h=Object.keys(C[1]).length>=1),h?k?k.p(C,E):(k=Ds(C),k.c(),k.m(e,w)):k&&(k.d(1),k=null),C[1][C[0]]?y?y.p(C,E):(y=Hs(C),y.c(),y.m(e,null)):y&&(y.d(1),y=null)},i:ne,o:ne,d(C){C&&S(e),k&&k.d(),y&&y.d(),_=!1,Ce(W)}}}function ea(t,e,n){const l=pr();let s=l.label;const u={[l.label]:l},d=["default","crosshair","hand","arrow","move","text","wait","help","progress","notAllowed","contextMenu","cell","verticalText","alias","copy","noDrop","grab","grabbing","allScroll","zoomIn","zoomOut","eResize","nResize","neResize","nwResize","sResize","seResize","swResize","wResize","ewResize","nsResize","neswResize","nwseResize","colResize","rowResize"],o=["mica","blur","acrylic","tabbed","tabbedDark","tabbedLight"],c=navigator.appVersion.includes("Windows"),h=navigator.appVersion.includes("Macintosh");let w=c?o:Object.keys(Ji).map(N=>Ji[N]).filter(N=>!o.includes(N));const _=Object.keys(Zi).map(N=>Zi[N]),W=Object.keys(Qi).map(N=>Qi[N]);let{onMessage:k}=e;const y=document.querySelector("main");let C,E=!0,V=!0,D=!0,M=!0,I=!1,P=!0,T=!1,R=!1,Y=!0,q=!1,Q=null,ie=null,ee=null,v=null,B=null,G=null,oe=null,Z=null,we=1,be=new it(oe,Z),fe=new it(oe,Z),ce=new ln(Q,ie),x=new ln(Q,ie),pe,K,le=!1,te=!0,z=null,J=null,H="default",re=!1,Ae="Awesome Tauri Example!",ke=[],me,We,Me,Ie,ge,_e,Se,Pe="none",de=0,Le;function ae(){u[s].setTitle(Ae)}function Re(){u[s].hide(),setTimeout(u[s].show,2e3)}function De(){u[s].minimize(),setTimeout(u[s].unminimize,2e3)}function Ee(){if(!C)return;const N=new Dn(C);n(1,u[C]=N,u),N.once("tauri://error",function(){k("Error creating new webview")})}function ue(){u[s].innerSize().then(N=>{n(32,ce=N),n(12,Q=ce.width),n(13,ie=ce.height)}),u[s].outerSize().then(N=>{n(33,x=N)})}function F(){u[s].innerPosition().then(N=>{n(30,be=N)}),u[s].outerPosition().then(N=>{n(31,fe=N),n(18,oe=fe.x),n(19,Z=fe.y)})}async function $(N){N&&(pe&&pe(),K&&K(),K=await N.listen("tauri://move",F),pe=await N.listen("tauri://resize",ue))}async function U(){await u[s].minimize(),await u[s].requestUserAttention(Yi.Critical),await new Promise(N=>setTimeout(N,3e3)),await u[s].requestUserAttention(null)}async function Te(){ke.includes(me)||n(35,ke=[...ke,me]);const N={effects:ke,state:We,radius:Me};Number.isInteger(Ie)&&Number.isInteger(ge)&&Number.isInteger(_e)&&Number.isInteger(Se)&&(N.color=[Ie,ge,_e,Se]),y.classList.remove("bg-primary"),y.classList.remove("dark:bg-darkPrimary"),await u[s].clearEffects(),await u[s].setEffects(N)}async function Vn(){n(35,ke=[]),await u[s].clearEffects(),y.classList.add("bg-primary"),y.classList.add("dark:bg-darkPrimary")}function Fe(){C=this.value,n(28,C)}function qn(){s=Pn(this),n(0,s),n(1,u)}function Ot(){Le=this.value,n(43,Le)}const Nn=()=>u[s].center();function He(){I=this.checked,n(6,I)}function jn(){E=this.checked,n(2,E)}function lt(){V=this.checked,n(3,V)}function Wt(){D=this.checked,n(4,D)}function Gn(){M=this.checked,n(5,M)}function Ue(){P=this.checked,n(7,P)}function Kn(){T=this.checked,n(8,T)}function It(){R=this.checked,n(9,R)}function Xn(){Y=this.checked,n(10,Y)}function Be(){q=this.checked,n(11,q)}function Yn(){oe=X(this.value),n(18,oe)}function st(){Z=X(this.value),n(19,Z)}function Rt(){Q=X(this.value),n(12,Q)}function Qn(){ie=X(this.value),n(13,ie)}function Ge(){ee=X(this.value),n(14,ee)}function Jn(){v=X(this.value),n(15,v)}function Dt(){B=X(this.value),n(16,B)}function Zn(){G=X(this.value),n(17,G)}function Ke(){le=this.checked,n(20,le)}function xn(){te=this.checked,n(21,te)}function rt(){re=this.checked,n(25,re)}function Ft(){H=Pn(this),n(24,H),n(44,d)}function $n(){z=X(this.value),n(22,z)}function Ve(){J=X(this.value),n(23,J)}function ei(){Ae=this.value,n(34,Ae)}function Ht(){Pe=Pn(this),n(26,Pe),n(49,W)}function ti(){de=X(this.value),n(27,de)}function qe(){me=Pn(this),n(36,me),n(47,w)}function dn(){We=Pn(this),n(37,We),n(48,_)}function hn(){Me=X(this.value),n(38,Me)}function fn(){Ie=X(this.value),n(39,Ie)}function ze(){ge=X(this.value),n(40,ge)}function at(){_e=X(this.value),n(41,_e)}function Xe(){Se=X(this.value),n(42,Se)}return t.$$set=N=>{"onMessage"in N&&n(57,k=N.onMessage)},t.$$.update=()=>{var N,pn,kt,mn,yt,Ut,gn,vt,_n,Ct,Bt,bn,Ne,St,wn,Lt,kn,At,Vt,yn,Mt,vn,Pt,qt;t.$$.dirty[0]&3&&(u[s],F(),ue()),t.$$.dirty[0]&7&&((N=u[s])==null||N.setResizable(E)),t.$$.dirty[0]&11&&((pn=u[s])==null||pn.setMaximizable(V)),t.$$.dirty[0]&19&&((kt=u[s])==null||kt.setMinimizable(D)),t.$$.dirty[0]&35&&((mn=u[s])==null||mn.setClosable(M)),t.$$.dirty[0]&67&&(I?(yt=u[s])==null||yt.maximize():(Ut=u[s])==null||Ut.unmaximize()),t.$$.dirty[0]&131&&((gn=u[s])==null||gn.setDecorations(P)),t.$$.dirty[0]&259&&((vt=u[s])==null||vt.setAlwaysOnTop(T)),t.$$.dirty[0]&515&&((_n=u[s])==null||_n.setAlwaysOnBottom(R)),t.$$.dirty[0]&1027&&((Ct=u[s])==null||Ct.setContentProtected(Y)),t.$$.dirty[0]&2051&&((Bt=u[s])==null||Bt.setFullscreen(q)),t.$$.dirty[0]&12291&&Q&&ie&&((bn=u[s])==null||bn.setSize(new ln(Q,ie))),t.$$.dirty[0]&49155&&(ee&&v?(Ne=u[s])==null||Ne.setMinSize(new zl(ee,v)):(St=u[s])==null||St.setMinSize(null)),t.$$.dirty[0]&196611&&(B>800&&G>400?(wn=u[s])==null||wn.setMaxSize(new zl(B,G)):(Lt=u[s])==null||Lt.setMaxSize(null)),t.$$.dirty[0]&786435&&oe!==null&&Z!==null&&((kn=u[s])==null||kn.setPosition(new it(oe,Z))),t.$$.dirty[0]&3&&((At=u[s])==null||At.scaleFactor().then(ni=>n(29,we=ni))),t.$$.dirty[0]&3&&$(u[s]),t.$$.dirty[0]&1048579&&((Vt=u[s])==null||Vt.setCursorGrab(le)),t.$$.dirty[0]&2097155&&((yn=u[s])==null||yn.setCursorVisible(te)),t.$$.dirty[0]&16777219&&((Mt=u[s])==null||Mt.setCursorIcon(H)),t.$$.dirty[0]&12582915&&z!==null&&J!==null&&((vn=u[s])==null||vn.setCursorPosition(new it(z,J))),t.$$.dirty[0]&33554435&&((Pt=u[s])==null||Pt.setIgnoreCursorEvents(re)),t.$$.dirty[0]&201326595&&((qt=u[s])==null||qt.setProgressBar({status:Pe,progress:de}))},[s,u,E,V,D,M,I,P,T,R,Y,q,Q,ie,ee,v,B,G,oe,Z,le,te,z,J,H,re,Pe,de,C,we,be,fe,ce,x,Ae,ke,me,We,Me,Ie,ge,_e,Se,Le,d,c,h,w,_,W,ae,Re,De,Ee,U,Te,Vn,k,Fe,qn,Ot,Nn,He,jn,lt,Wt,Gn,Ue,Kn,It,Xn,Be,Yn,st,Rt,Qn,Ge,Jn,Dt,Zn,Ke,xn,rt,Ft,$n,Ve,ei,Ht,ti,qe,dn,hn,fn,ze,at,Xe]}class ta extends xe{constructor(e){super(),Ze(this,e,ea,$r,je,{onMessage:57},null,[-1,-1,-1,-1])}}function na(t){let e;return{c(){e=r("div"),e.innerHTML='
Not available for Linux
',a(e,"class","flex flex-col gap-2")},m(n,l){L(n,e,l)},p:ne,i:ne,o:ne,d(n){n&&S(e)}}}function ia(t,e,n){let{onMessage:l}=e;const s=window.constraints={audio:!0,video:!0};function u(o){const c=document.querySelector("video"),h=o.getVideoTracks();l("Got stream with constraints:",s),l(`Using video device: ${h[0].label}`),window.stream=o,c.srcObject=o}function d(o){if(o.name==="ConstraintNotSatisfiedError"){const c=s.video;l(`The resolution ${c.width.exact}x${c.height.exact} px is not supported by your device.`)}else o.name==="PermissionDeniedError"&&l("Permissions have not been granted to use your camera and microphone, you need to allow the page access to your devices in order for the demo to work.");l(`getUserMedia error: ${o.name}`,o)}return Ki(async()=>{try{const o=await navigator.mediaDevices.getUserMedia(s);u(o)}catch(o){d(o)}}),rr(()=>{var o;(o=window.stream)==null||o.getTracks().forEach(function(c){c.stop()})}),t.$$set=o=>{"onMessage"in o&&n(0,l=o.onMessage)},[l]}class la extends xe{constructor(e){super(),Ze(this,e,ia,na,je,{onMessage:0})}}function sa(t){let e,n,l,s,u,d;return{c(){e=r("div"),n=r("button"),n.textContent="Show",l=p(),s=r("button"),s.textContent="Hide",a(n,"class","btn"),a(n,"id","show"),a(n,"title","Hides and shows the app after 2 seconds"),a(s,"class","btn"),a(s,"id","hide")},m(o,c){L(o,e,c),i(e,n),i(e,l),i(e,s),u||(d=[A(n,"click",t[0]),A(s,"click",t[1])],u=!0)},p:ne,i:ne,o:ne,d(o){o&&S(e),u=!1,Ce(d)}}}function ra(t,e,n){let{onMessage:l}=e;function s(){u().then(()=>{setTimeout(()=>{Br().then(()=>l("Shown app")).catch(l)},2e3)}).catch(l)}function u(){return Vr().then(()=>l("Hide app")).catch(l)}return t.$$set=d=>{"onMessage"in d&&n(2,l=d.onMessage)},[s,u,l]}class aa extends xe{constructor(e){super(),Ze(this,e,ra,sa,je,{onMessage:2})}}var Ni;class mr{get rid(){return Rn(this,Ni,"f")}constructor(e){Ni.set(this,void 0),Xi(this,Ni,e,"f")}async close(){return m("plugin:resources|close",{rid:this.rid})}}Ni=new WeakMap;var ji,Gi;function gr(t){var e;if("items"in t)t.items=(e=t.items)==null?void 0:e.map(n=>"rid"in n?n:gr(n));else if("action"in t&&t.action){const n=new Il;return n.onmessage=t.action,delete t.action,{...t,handler:n}}return t}async function un(t,e){const n=new Il;let l=null;return e&&typeof e=="object"&&("action"in e&&e.action&&(n.onmessage=e.action,delete e.action),"items"in e&&e.items&&(l=e.items.map(s=>"rid"in s?[s.rid,s.kind]:gr(s)))),m("plugin:menu|new",{kind:t,options:e?{...e,items:l}:void 0,handler:n})}class on extends mr{get id(){return Rn(this,ji,"f")}get kind(){return Rn(this,Gi,"f")}constructor(e,n,l){super(e),ji.set(this,void 0),Gi.set(this,void 0),Xi(this,ji,n,"f"),Xi(this,Gi,l,"f")}}ji=new WeakMap,Gi=new WeakMap;class Fn extends on{constructor(e,n){super(e,n,"MenuItem")}static async new(e){return un("MenuItem",e).then(([n,l])=>new Fn(n,l))}async text(){return m("plugin:menu|text",{rid:this.rid,kind:this.kind})}async setText(e){return m("plugin:menu|set_text",{rid:this.rid,kind:this.kind,text:e})}async isEnabled(){return m("plugin:menu|is_enabled",{rid:this.rid,kind:this.kind})}async setEnabled(e){return m("plugin:menu|set_enabled",{rid:this.rid,kind:this.kind,enabled:e})}async setAccelerator(e){return m("plugin:menu|set_accelerator",{rid:this.rid,kind:this.kind,accelerator:e})}}class cn extends on{constructor(e,n){super(e,n,"Check")}static async new(e){return un("Check",e).then(([n,l])=>new cn(n,l))}async text(){return m("plugin:menu|text",{rid:this.rid,kind:this.kind})}async setText(e){return m("plugin:menu|set_text",{rid:this.rid,kind:this.kind,text:e})}async isEnabled(){return m("plugin:menu|is_enabled",{rid:this.rid,kind:this.kind})}async setEnabled(e){return m("plugin:menu|set_enabled",{rid:this.rid,kind:this.kind,enabled:e})}async setAccelerator(e){return m("plugin:menu|set_accelerator",{rid:this.rid,kind:this.kind,accelerator:e})}async isChecked(){return m("plugin:menu|is_checked",{rid:this.rid})}async setChecked(e){return m("plugin:menu|set_checked",{rid:this.rid,checked:e})}}var Ns;(function(t){t.Add="Add",t.Advanced="Advanced",t.Bluetooth="Bluetooth",t.Bookmarks="Bookmarks",t.Caution="Caution",t.ColorPanel="ColorPanel",t.ColumnView="ColumnView",t.Computer="Computer",t.EnterFullScreen="EnterFullScreen",t.Everyone="Everyone",t.ExitFullScreen="ExitFullScreen",t.FlowView="FlowView",t.Folder="Folder",t.FolderBurnable="FolderBurnable",t.FolderSmart="FolderSmart",t.FollowLinkFreestanding="FollowLinkFreestanding",t.FontPanel="FontPanel",t.GoLeft="GoLeft",t.GoRight="GoRight",t.Home="Home",t.IChatTheater="IChatTheater",t.IconView="IconView",t.Info="Info",t.InvalidDataFreestanding="InvalidDataFreestanding",t.LeftFacingTriangle="LeftFacingTriangle",t.ListView="ListView",t.LockLocked="LockLocked",t.LockUnlocked="LockUnlocked",t.MenuMixedState="MenuMixedState",t.MenuOnState="MenuOnState",t.MobileMe="MobileMe",t.MultipleDocuments="MultipleDocuments",t.Network="Network",t.Path="Path",t.PreferencesGeneral="PreferencesGeneral",t.QuickLook="QuickLook",t.RefreshFreestanding="RefreshFreestanding",t.Refresh="Refresh",t.Remove="Remove",t.RevealFreestanding="RevealFreestanding",t.RightFacingTriangle="RightFacingTriangle",t.Share="Share",t.Slideshow="Slideshow",t.SmartBadge="SmartBadge",t.StatusAvailable="StatusAvailable",t.StatusNone="StatusNone",t.StatusPartiallyAvailable="StatusPartiallyAvailable",t.StatusUnavailable="StatusUnavailable",t.StopProgressFreestanding="StopProgressFreestanding",t.StopProgress="StopProgress",t.TrashEmpty="TrashEmpty",t.TrashFull="TrashFull",t.User="User",t.UserAccounts="UserAccounts",t.UserGroup="UserGroup",t.UserGuest="UserGuest"})(Ns||(Ns={}));class Hn extends on{constructor(e,n){super(e,n,"Icon")}static async new(e){return un("Icon",e).then(([n,l])=>new Hn(n,l))}async text(){return m("plugin:menu|text",{rid:this.rid,kind:this.kind})}async setText(e){return m("plugin:menu|set_text",{rid:this.rid,kind:this.kind,text:e})}async isEnabled(){return m("plugin:menu|is_enabled",{rid:this.rid,kind:this.kind})}async setEnabled(e){return m("plugin:menu|set_enabled",{rid:this.rid,kind:this.kind,enabled:e})}async setAccelerator(e){return m("plugin:menu|set_accelerator",{rid:this.rid,kind:this.kind,accelerator:e})}async setIcon(e){return m("plugin:menu|set_icon",{rid:this.rid,icon:e})}}class Un extends on{constructor(e,n){super(e,n,"Predefined")}static async new(e){return un("Predefined",e).then(([n,l])=>new Un(n,l))}async text(){return m("plugin:menu|text",{rid:this.rid,kind:this.kind})}async setText(e){return m("plugin:menu|set_text",{rid:this.rid,kind:this.kind,text:e})}}function Ml([t,e,n]){switch(n){case"Submenu":return new Bn(t,e);case"Predefined":return new Un(t,e);case"Check":return new cn(t,e);case"Icon":return new Hn(t,e);case"MenuItem":default:return new Fn(t,e)}}class Bn extends on{constructor(e,n){super(e,n,"Submenu")}static async new(e){return un("Submenu",e).then(([n,l])=>new Bn(n,l))}async text(){return m("plugin:menu|text",{rid:this.rid,kind:this.kind})}async setText(e){return m("plugin:menu|set_text",{rid:this.rid,kind:this.kind,text:e})}async isEnabled(){return m("plugin:menu|is_enabled",{rid:this.rid,kind:this.kind})}async setEnabled(e){return m("plugin:menu|set_enabled",{rid:this.rid,kind:this.kind,enabled:e})}async append(e){return m("plugin:menu|append",{rid:this.rid,kind:this.kind,items:(Array.isArray(e)?e:[e]).map(n=>"rid"in n?[n.rid,n.kind]:n)})}async prepend(e){return m("plugin:menu|prepend",{rid:this.rid,kind:this.kind,items:(Array.isArray(e)?e:[e]).map(n=>"rid"in n?[n.rid,n.kind]:n)})}async insert(e,n){return m("plugin:menu|insert",{rid:this.rid,kind:this.kind,items:(Array.isArray(e)?e:[e]).map(l=>"rid"in l?[l.rid,l.kind]:l),position:n})}async remove(e){return m("plugin:menu|remove",{rid:this.rid,kind:this.kind,item:[e.rid,e.kind]})}async removeAt(e){return m("plugin:menu|remove_at",{rid:this.rid,kind:this.kind,position:e}).then(Ml)}async items(){return m("plugin:menu|items",{rid:this.rid,kind:this.kind}).then(e=>e.map(Ml))}async get(e){return m("plugin:menu|get",{rid:this.rid,kind:this.kind,id:e}).then(n=>n?Ml(n):null)}async popup(e,n){let l=null;return e&&(l={type:e instanceof it?"Physical":"Logical",data:e}),m("plugin:menu|popup",{rid:this.rid,kind:this.kind,window:(n==null?void 0:n.label)??null,at:l})}async setAsWindowsMenuForNSApp(){return m("plugin:menu|set_as_windows_menu_for_nsapp",{rid:this.rid})}async setAsHelpMenuForNSApp(){return m("plugin:menu|set_as_help_menu_for_nsapp",{rid:this.rid})}}function Pl([t,e,n]){switch(n){case"Submenu":return new Bn(t,e);case"Predefined":return new Un(t,e);case"Check":return new cn(t,e);case"Icon":return new Hn(t,e);case"MenuItem":default:return new Fn(t,e)}}class bt extends on{constructor(e,n){super(e,n,"Menu")}static async new(e){return un("Menu",e).then(([n,l])=>new bt(n,l))}static async default(){return m("plugin:menu|default").then(([e,n])=>new bt(e,n))}async append(e){return m("plugin:menu|append",{rid:this.rid,kind:this.kind,items:(Array.isArray(e)?e:[e]).map(n=>"rid"in n?[n.rid,n.kind]:n)})}async prepend(e){return m("plugin:menu|prepend",{rid:this.rid,kind:this.kind,items:(Array.isArray(e)?e:[e]).map(n=>"rid"in n?[n.rid,n.kind]:n)})}async insert(e,n){return m("plugin:menu|insert",{rid:this.rid,kind:this.kind,items:(Array.isArray(e)?e:[e]).map(l=>"rid"in l?[l.rid,l.kind]:l),position:n})}async remove(e){return m("plugin:menu|remove",{rid:this.rid,kind:this.kind,item:[e.rid,e.kind]})}async removeAt(e){return m("plugin:menu|remove_at",{rid:this.rid,kind:this.kind,position:e}).then(Pl)}async items(){return m("plugin:menu|items",{rid:this.rid,kind:this.kind}).then(e=>e.map(Pl))}async get(e){return m("plugin:menu|get",{rid:this.rid,kind:this.kind,id:e}).then(n=>n?Pl(n):null)}async popup(e,n){let l=null;return e&&(l={type:e instanceof it?"Physical":"Logical",data:e}),m("plugin:menu|popup",{rid:this.rid,kind:this.kind,window:(n==null?void 0:n.label)??null,at:l})}async setAsAppMenu(){return m("plugin:menu|set_as_app_menu",{rid:this.rid}).then(e=>e?new bt(e[0],e[1]):null)}async setAsWindowMenu(e){return m("plugin:menu|set_as_window_menu",{rid:this.rid,window:(e==null?void 0:e.label)??null}).then(n=>n?new bt(n[0],n[1]):null)}}function js(t,e,n){const l=t.slice();return l[16]=e[n],l[17]=e,l[18]=n,l}function Gs(t,e,n){const l=t.slice();return l[19]=e[n],l[20]=e,l[21]=n,l}function Ks(t){let e,n,l,s,u,d,o=t[19]+"",c,h,w,_,W;function k(){t[9].call(n,t[20],t[21])}return{c(){e=r("div"),n=r("input"),u=p(),d=r("label"),c=b(o),w=p(),a(n,"id",l=t[19]+"Input"),n.checked=s=t[0]===t[19],a(n,"type","radio"),a(n,"name","kind"),a(d,"for",h=t[19]+"Input"),a(e,"class","flex gap-1")},m(y,C){L(y,e,C),i(e,n),O(n,t[19]),i(e,u),i(e,d),i(d,c),i(e,w),_||(W=[A(n,"change",t[6]),A(n,"change",k)],_=!0)},p(y,C){t=y,C&16&&l!==(l=t[19]+"Input")&&a(n,"id",l),C&17&&s!==(s=t[0]===t[19])&&(n.checked=s),C&16&&O(n,t[19]),C&16&&o!==(o=t[19]+"")&&se(c,o),C&16&&h!==(h=t[19]+"Input")&&a(d,"for",h)},d(y){y&&S(e),_=!1,Ce(W)}}}function Xs(t){let e,n,l;return{c(){e=r("input"),a(e,"class","input"),a(e,"type","text"),a(e,"placeholder","Text")},m(s,u){L(s,e,u),O(e,t[1]),n||(l=A(e,"input",t[10]),n=!0)},p(s,u){u&2&&e.value!==s[1]&&O(e,s[1])},d(s){s&&S(e),n=!1,l()}}}function ua(t){let e,n=he(t[5]),l=[];for(let s=0;sl("itemClick",{id:T,text:P})},I=await Fn.new(M);break;case"Icon":M={text:u,icon:d,action:T=>l("itemClick",{id:T,text:P})},I=await Hn.new(M);break;case"Check":M={text:u,checked:c,action:T=>l("itemClick",{id:T,text:P})},I=await cn.new(M);break;case"Predefined":M={item:o},I=await Un.new(M);break}l("new",{item:I,options:M}),n(1,u=""),o=""}function y(M,I){M[I]=this.value,n(4,h)}function C(){u=this.value,n(1,u)}function E(){d=this.value,n(2,d)}function V(){c=this.checked,n(3,c)}function D(M,I){M[I]=this.value,n(5,w)}return[s,u,d,c,h,w,_,W,k,y,C,E,V,D]}class fa extends xe{constructor(e){super(),Ze(this,e,ha,da,je,{})}}function Qs(t,e,n){const l=t.slice();return l[5]=e[n],l}function Js(t){let e,n,l,s,u,d=Zs(t[5])+"",o,c;return{c(){e=r("div"),n=r("div"),s=p(),u=r("p"),o=b(d),c=p(),a(n,"class",l=t[3](t[5])),a(e,"class","flex flex-row gap-1")},m(h,w){L(h,e,w),i(e,n),i(e,s),i(e,u),i(u,o),i(e,c)},p(h,w){w&1&&l!==(l=h[3](h[5]))&&a(n,"class",l),w&1&&d!==(d=Zs(h[5])+"")&&se(o,d)},d(h){h&&S(e)}}}function pa(t){let e,n,l,s,u;n=new fa({}),n.$on("new",t[1]),n.$on("itemClick",t[2]);let d=he(t[0]),o=[];for(let c=0;c{"items"in c&&n(0,l=c.items)},[l,u,d,o]}class _r extends xe{constructor(e){super(),Ze(this,e,ma,pa,je,{items:0})}}function ga(t){let e,n,l,s,u,d,o,c,h,w;function _(k){t[5](k)}let W={};return t[0]!==void 0&&(W.items=t[0]),n=new _r({props:W}),On.push(()=>cr(n,"items",_)),n.$on("itemClick",t[3]),{c(){e=r("div"),In(n.$$.fragment),s=p(),u=r("button"),u.textContent="Create menu",d=p(),o=r("button"),o.textContent="Popup",a(u,"class","btn"),a(o,"class","btn")},m(k,y){L(k,e,y),rn(n,e,null),i(e,s),i(e,u),i(e,d),i(e,o),c=!0,h||(w=[A(u,"click",t[1]),A(o,"click",t[2])],h=!0)},p(k,[y]){const C={};!l&&y&1&&(l=!0,C.items=k[0],ur(()=>l=!1)),n.$set(C)},i(k){c||(sn(n.$$.fragment,k),c=!0)},o(k){Wn(n.$$.fragment,k),c=!1},d(k){k&&S(e),an(n),h=!1,Ce(w)}}}function _a(t,e,n){let{onMessage:l}=e,s=[],u=null,d=null,o=0;const c=navigator.userAgent.includes("Macintosh");async function h(){d=await Bn.new({text:"app",items:s.map(y=>y.item)})}async function w(){await h(),o=s.length,u=await bt.new({items:[d]}),await(c?u.setAsAppMenu():u.setAsWindowMenu())}async function _(){(!d||o!==s.length)&&await h(),(await bt.new({items:[d]})).popup()}function W(y){l(`Item ${y.detail.text} clicked`)}function k(y){s=y,n(0,s)}return t.$$set=y=>{"onMessage"in y&&n(4,l=y.onMessage)},[s,w,_,W,l,k]}class ba extends xe{constructor(e){super(),Ze(this,e,_a,ga,je,{onMessage:4})}}class Dl extends mr{constructor(e,n){super(e),this.id=n}static async new(e){e!=null&&e.menu&&(e.menu=[e.menu.rid,e.menu.kind]),e!=null&&e.icon&&(e.icon=typeof e.icon=="string"?e.icon:Array.from(e.icon));const n=new Il;return e!=null&&e.action&&(n.onmessage=e.action,delete e.action),m("plugin:tray|new",{options:e??{},handler:n}).then(([l,s])=>new Dl(l,s))}async setIcon(e){let n=null;return e&&(n=typeof e=="string"?e:Array.from(e)),m("plugin:tray|set_icon",{rid:this.rid,icon:n})}async setMenu(e){return e&&(e=[e.rid,e.kind]),m("plugin:tray|set_menu",{rid:this.rid,menu:e})}async setTooltip(e){return m("plugin:tray|set_tooltip",{rid:this.rid,tooltip:e})}async setTitle(e){return m("plugin:tray|set_title",{rid:this.rid,title:e})}async setVisible(e){return m("plugin:tray|set_visible",{rid:this.rid,visible:e})}async setTempDirPath(e){return m("plugin:tray|set_temp_dir_path",{rid:this.rid,path:e})}async setIconAsTemplate(e){return m("plugin:tray|set_icon_as_template",{rid:this.rid,asTemplate:e})}async setMenuOnLeftClick(e){return m("plugin:tray|set_show_menu_on_left_click",{rid:this.rid,onLeft:e})}}function wa(t){let e,n,l,s,u,d,o,c,h,w,_,W,k,y,C,E,V,D,M,I,P,T,R,Y,q,Q;function ie(v){t[14](v)}let ee={};return t[5]!==void 0&&(ee.items=t[5]),M=new _r({props:ee}),On.push(()=>cr(M,"items",ie)),M.$on("itemClick",t[6]),{c(){e=r("div"),n=r("div"),l=r("input"),s=p(),u=r("input"),d=p(),o=r("label"),c=b(`Menu on left click - `),h=r("input"),w=p(),_=r("div"),W=r("input"),k=p(),y=r("label"),C=b(`Icon as template - `),E=r("input"),V=p(),D=r("div"),In(M.$$.fragment),P=p(),T=r("div"),R=r("button"),R.textContent="Create tray",a(l,"class","input grow"),a(l,"type","text"),a(l,"placeholder","Title"),a(u,"class","input grow"),a(u,"type","text"),a(u,"placeholder","Tooltip"),a(h,"type","checkbox"),a(n,"class","flex gap-1"),a(W,"class","input grow"),a(W,"type","text"),a(W,"placeholder","Icon path"),a(E,"type","checkbox"),a(_,"class","flex gap-1"),a(D,"class","flex children:grow"),a(R,"class","btn"),a(R,"title","Creates the tray icon"),a(T,"class","flex"),a(e,"class","flex flex-col children:grow gap-2")},m(v,B){L(v,e,B),i(e,n),i(n,l),O(l,t[2]),i(n,s),i(n,u),O(u,t[1]),i(n,d),i(n,o),i(o,c),i(o,h),h.checked=t[4],i(e,w),i(e,_),i(_,W),O(W,t[0]),i(_,k),i(_,y),i(y,C),i(y,E),E.checked=t[3],i(e,V),i(e,D),rn(M,D,null),i(e,P),i(e,T),i(T,R),Y=!0,q||(Q=[A(l,"input",t[9]),A(u,"input",t[10]),A(h,"change",t[11]),A(W,"input",t[12]),A(E,"change",t[13]),A(R,"click",t[7])],q=!0)},p(v,[B]){B&4&&l.value!==v[2]&&O(l,v[2]),B&2&&u.value!==v[1]&&O(u,v[1]),B&16&&(h.checked=v[4]),B&1&&W.value!==v[0]&&O(W,v[0]),B&8&&(E.checked=v[3]);const G={};!I&&B&32&&(I=!0,G.items=v[5],ur(()=>I=!1)),M.$set(G)},i(v){Y||(sn(M.$$.fragment,v),Y=!0)},o(v){Wn(M.$$.fragment,v),Y=!1},d(v){v&&S(e),an(M),q=!1,Ce(Q)}}}function ka(t,e,n){let{onMessage:l}=e,s=null,u=null,d=null,o=!1,c=!0,h=[];function w(D){l(`Item ${D.detail.text} clicked`)}async function _(){Dl.new({icon:s,tooltip:u,title:d,iconAsTemplate:o,menuOnLeftClick:c,menu:await bt.new({items:h.map(D=>D.item)}),action:D=>l(D)}).catch(l)}function W(){d=this.value,n(2,d)}function k(){u=this.value,n(1,u)}function y(){c=this.checked,n(4,c)}function C(){s=this.value,n(0,s)}function E(){o=this.checked,n(3,o)}function V(D){h=D,n(5,h)}return t.$$set=D=>{"onMessage"in D&&n(8,l=D.onMessage)},[s,u,d,o,c,h,w,_,l,W,k,y,C,E,V]}class ya extends xe{constructor(e){super(),Ze(this,e,ka,wa,je,{onMessage:8})}}function xs(t,e,n){const l=t.slice();return l[26]=e[n],l}function $s(t,e,n){const l=t.slice();return l[29]=e[n],l}function va(t){let e;return{c(){e=r("span"),a(e,"class","i-codicon-menu animate-duration-300ms animate-fade-in")},m(n,l){L(n,e,l)},d(n){n&&S(e)}}}function Ca(t){let e;return{c(){e=r("span"),a(e,"class","i-codicon-close animate-duration-300ms animate-fade-in")},m(n,l){L(n,e,l)},d(n){n&&S(e)}}}function Sa(t){let e,n;return{c(){e=b(`Switch to Dark mode - `),n=r("div"),a(n,"class","i-ph-moon")},m(l,s){L(l,e,s),L(l,n,s)},d(l){l&&(S(e),S(n))}}}function La(t){let e,n;return{c(){e=b(`Switch to Light mode - `),n=r("div"),a(n,"class","i-ph-sun")},m(l,s){L(l,e,s),L(l,n,s)},d(l){l&&(S(e),S(n))}}}function Aa(t){let e,n,l,s,u,d,o;function c(){return t[14](t[29])}return{c(){e=r("a"),n=r("div"),l=p(),s=r("p"),s.textContent=`${t[29].label}`,a(n,"class",t[29].icon+" mr-2"),a(e,"href","##"),a(e,"class",u="nv "+(t[1]===t[29]?"nv_selected":""))},m(h,w){L(h,e,w),i(e,n),i(e,l),i(e,s),d||(o=A(e,"click",c),d=!0)},p(h,w){t=h,w[0]&2&&u!==(u="nv "+(t[1]===t[29]?"nv_selected":""))&&a(e,"class",u)},d(h){h&&S(e),d=!1,o()}}}function er(t){let e,n=t[29]&&Aa(t);return{c(){n&&n.c(),e=Ol()},m(l,s){n&&n.m(l,s),L(l,e,s)},p(l,s){l[29]&&n.p(l,s)},d(l){l&&S(e),n&&n.d(l)}}}function tr(t){let e,n=t[26].html+"",l;return{c(){e=new Mr(!1),l=Ol(),e.a=l},m(s,u){e.m(n,s,u),L(s,l,u)},p(s,u){u[0]&16&&n!==(n=s[26].html+"")&&e.p(n)},d(s){s&&(S(l),e.d())}}}function Ma(t){let e,n,l,s,u,d,o,c,h,w,_,W,k,y,C,E,V,D,M,I,P,T,R,Y,q,Q,ie,ee,v,B,G,oe,Z=t[1].label+"",we,be,fe,ce,x,pe,K,le,te,z,J,H,re,Ae,ke,me,We,Me;function Ie(F,$){return F[0]?Ca:va}let ge=Ie(t),_e=ge(t);function Se(F,$){return F[2]?La:Sa}let Pe=Se(t),de=Pe(t),Le=he(t[5]),ae=[];for(let F=0;F`,V=p(),D=r("a"),D.innerHTML=`GitHub - `,M=p(),I=r("a"),I.innerHTML=`Source - `,P=p(),T=r("br"),R=p(),Y=r("div"),q=p(),Q=r("br"),ie=p(),ee=r("div");for(let F=0;F',Ae=p(),ke=r("div");for(let F=0;F{an(U,1)}),Wr()}Re?(x=Es(Re,De(F)),In(x.$$.fragment),sn(x.$$.fragment,1),rn(x,ce,null)):x=null}if($[0]&16){Ee=he(F[4]);let U;for(U=0;U{v.ctrlKey&&v.key==="b"&&m("toggle_menu")});const s=navigator.userAgent.toLowerCase(),u=s.includes("android")||s.includes("iphone"),d=[{label:"Welcome",component:jr,icon:"i-ph-hand-waving"},{label:"Communication",component:Yr,icon:"i-codicon-radio-tower"},!u&&{label:"App",component:aa,icon:"i-codicon-hubot"},{label:"Window",component:ta,icon:"i-codicon-window"},{label:"Menu",component:ba,icon:"i-ph-list"},{label:"Tray",component:ya,icon:"i-ph-tray"},{label:"WebRTC",component:la,icon:"i-ph-broadcast"}];let o=d[0];function c(v){n(1,o=v)}let h;Ki(()=>{n(2,h=localStorage&&localStorage.getItem("theme")=="dark"),ir(h)});function w(){n(2,h=!h),ir(h)}let _=Dr([]);Cr(t,_,v=>n(4,l=v));function W(v){_.update(B=>[{html:`
[${new Date().toLocaleTimeString()}]: `+(typeof v=="string"?v:JSON.stringify(v,null,1))+"
"},...B])}function k(v){_.update(B=>[{html:`
[${new Date().toLocaleTimeString()}]: `+v+"
"},...B])}function y(){_.update(()=>[])}let C,E,V;function D(v){V=v.clientY;const B=window.getComputedStyle(C);E=parseInt(B.height,10);const G=Z=>{const we=Z.clientY-V,be=E-we;n(3,C.style.height=`${be{document.removeEventListener("mouseup",oe),document.removeEventListener("mousemove",G)};document.addEventListener("mouseup",oe),document.addEventListener("mousemove",G)}let M=!1,I,P,T=!1,R=0,Y=0;const q=(v,B,G)=>Math.min(Math.max(B,v),G);Ki(()=>{n(13,I=document.querySelector("#sidebar")),P=document.querySelector("#sidebarToggle"),document.addEventListener("click",v=>{P.contains(v.target)?n(0,M=!M):M&&!I.contains(v.target)&&n(0,M=!1)}),document.addEventListener("touchstart",v=>{if(P.contains(v.target))return;const B=v.touches[0].clientX;(0{if(T){const B=v.touches[0].clientX;Y=B;const G=(B-R)/10;I.style.setProperty("--translate-x",`-${q(0,M?0-G:18.75-G,18.75)}rem`)}}),document.addEventListener("touchend",()=>{if(T){const v=(Y-R)/10;n(0,M=M?v>-(18.75/2):v>18.75/2)}T=!1})});const Q=v=>{c(v),n(0,M=!1)},ie=v=>v.key==="Enter"?y():{};function ee(v){On[v?"unshift":"push"](()=>{C=v,n(3,C)})}return t.$$.update=()=>{if(t.$$.dirty[0]&1){const v=document.querySelector("#sidebar");v&&Pa(v,M)}},[M,o,h,C,l,d,c,w,_,W,k,y,D,I,Q,ie,ee]}class Ta extends xe{constructor(e){super(),Ze(this,e,Ea,Ma,je,{},null,[-1,-1])}}new Ta({target:document.querySelector("#app")}); + `),Ye=r("input"),yl=p(),Tt&&Tt.c(),vl=Ol(),a(s,"for","windowIconPath"),a(o,"id","windowIconPath"),a(o,"class","input grow"),a(h,"class","btn"),a(h,"type","submit"),a(d,"class","flex gap-1 grow"),a(l,"class","flex gap-1 items-center"),a(y,"class","btn"),a(y,"title","Unminimizes after 2 seconds"),a(M,"class","btn"),a(M,"title","Unminimizes after 2 seconds"),a(D,"class","btn"),a(D,"title","Visible again after 2 seconds"),a(P,"class","btn"),a(P,"title","Minimizes the window, requests attention for 3s and then resets it"),a(k,"class","flex flex-wrap gap-2"),a(V,"type","checkbox"),a(q,"type","checkbox"),a(X,"type","checkbox"),a(ae,"type","checkbox"),a(se,"type","checkbox"),a(H,"type","checkbox"),a(me,"type","checkbox"),a(ge,"type","checkbox"),a(he,"type","checkbox"),a(De,"type","checkbox"),a(z,"class","flex flex-wrap gap-2"),a(Fe,"class","input"),a(Fe,"type","number"),a(Fe,"min","0"),a(He,"class","input"),a(He,"type","number"),a(He,"min","0"),a(U,"class","flex children:grow flex-col"),a(Ue,"class","input"),a(Ue,"type","number"),a(Ue,"min","400"),a(Be,"class","input"),a(Be,"type","number"),a(Be,"min","400"),a(lt,"class","flex children:grow flex-col"),a(Ge,"class","input"),a(Ge,"type","number"),a(Ke,"class","input"),a(Ke,"type","number"),a(st,"class","flex children:grow flex-col"),a(Ve,"class","input"),a(Ve,"type","number"),a(Ve,"min","800"),a(qe,"class","input"),a(qe,"type","number"),a(qe,"min","400"),a(rt,"class","flex children:grow flex-col"),a(ee,"class","flex flex-row gap-2 flex-wrap"),a(N,"class","text-accent dark:text-darkAccent font-700"),a(Xe,"class","grow"),a(St,"class","text-accent dark:text-darkAccent font-700"),a(Ne,"class","grow"),a(at,"class","flex"),a(ii,"class","text-accent dark:text-darkAccent font-700"),a(ut,"class","grow"),a(ui,"class","text-accent dark:text-darkAccent font-700"),a(ot,"class","grow"),a(Nt,"class","flex"),a(fi,"class","text-accent dark:text-darkAccent font-700"),a(ct,"class","grow"),a(bi,"class","text-accent dark:text-darkAccent font-700"),a(dt,"class","grow"),a(jt,"class","flex"),a(Ci,"class","text-accent dark:text-darkAccent font-700"),a(ht,"class","grow"),a(Pi,"class","text-accent dark:text-darkAccent font-700"),a(ft,"class","grow"),a(Gt,"class","flex"),a(Sn,"class","mb-2"),a(Kt,"type","checkbox"),a(Xt,"type","checkbox"),a(Yt,"type","checkbox"),a($e,"class","flex gap-2"),a(tt,"class","input"),t[24]===void 0&&wt(()=>t[83].call(tt)),a(pt,"class","input"),a(pt,"type","number"),a(mt,"class","input"),a(mt,"type","number"),a(et,"class","flex gap-2"),a(gt,"class","input grow"),a(gt,"id","title"),a(An,"class","btn"),a(An,"type","submit"),a(Et,"class","flex gap-1"),a(Ln,"class","flex flex-col gap-1"),a(nt,"class","input"),t[26]===void 0&&wt(()=>t[87].call(nt)),a(Ye,"class","input"),a(Ye,"type","number"),a(Ye,"min","0"),a(Ye,"max","100"),a(Qt,"class","flex gap-2"),a(Mn,"class","flex flex-col gap-1")},m(f,g){C(f,e,g),C(f,n,g),C(f,l,g),i(l,s),i(l,u),i(l,d),i(d,o),I(o,t[43]),i(d,c),i(d,h),C(f,w,g),C(f,_,g),C(f,A,g),C(f,k,g),i(k,y),i(k,L),i(k,M),i(k,B),i(k,D),i(k,O),i(k,P),C(f,E,g),C(f,z,g),i(z,R),i(R,J),i(R,V),V.checked=t[6],i(z,Z),i(z,le),i(le,te),i(le,q),q.checked=t[2],i(z,G),i(z,T),i(T,K),i(T,X),X.checked=t[3],i(z,be),i(z,ke),i(ke,de),i(ke,ae),ae.checked=t[4],i(z,$),i(z,pe),i(pe,Y),i(pe,se),se.checked=t[5],i(z,ne),i(z,W),i(W,x),i(W,H),H.checked=t[7],i(z,ue),i(z,Ae),i(Ae,we),i(Ae,me),me.checked=t[8],i(z,We),i(z,Me),i(Me,Ie),i(Me,ge),ge.checked=t[9],i(z,_e),i(z,Se),i(Se,Pe),i(Se,he),he.checked=t[10],i(z,Le),i(z,oe),i(oe,Re),i(oe,De),De.checked=t[11],C(f,Ee,g),C(f,ce,g),C(f,F,g),C(f,ee,g),i(ee,U),i(U,Te),i(Te,Vn),i(Te,Fe),I(Fe,t[18]),i(U,qn),i(U,Ot),i(Ot,Nn),i(Ot,He),I(He,t[19]),i(ee,jn),i(ee,lt),i(lt,Wt),i(Wt,Gn),i(Wt,Ue),I(Ue,t[12]),i(lt,Kn),i(lt,It),i(It,Xn),i(It,Be),I(Be,t[13]),i(ee,Yn),i(ee,st),i(st,Rt),i(Rt,Qn),i(Rt,Ge),I(Ge,t[14]),i(st,Jn),i(st,Dt),i(Dt,Zn),i(Dt,Ke),I(Ke,t[15]),i(ee,xn),i(ee,rt),i(rt,Ft),i(Ft,$n),i(Ft,Ve),I(Ve,t[16]),i(rt,ei),i(rt,Ht),i(Ht,ti),i(Ht,qe),I(qe,t[17]),C(f,hn,g),C(f,fn,g),C(f,pn,g),C(f,ze,g),i(ze,at),i(at,Xe),i(Xe,N),i(Xe,mn),i(Xe,kt),i(kt,gn),i(kt,Ut),i(Xe,_n),i(Xe,vt),i(vt,bn),i(vt,Bt),i(at,wn),i(at,Ne),i(Ne,St),i(Ne,kn),i(Ne,Lt),i(Lt,yn),i(Lt,Vt),i(Ne,vn),i(Ne,Mt),i(Mt,Cn),i(Mt,qt),i(ze,ni),i(ze,Nt),i(Nt,ut),i(ut,ii),i(ut,Fl),i(ut,li),i(li,Hl),i(li,xi),i(ut,Ul),i(ut,ri),i(ri,Bl),i(ri,$i),i(Nt,Vl),i(Nt,ot),i(ot,ui),i(ot,ql),i(ot,oi),i(oi,Nl),i(oi,el),i(ot,jl),i(ot,di),i(di,Gl),i(di,tl),i(ze,Kl),i(ze,jt),i(jt,ct),i(ct,fi),i(ct,Xl),i(ct,pi),i(pi,Yl),i(pi,nl),i(ct,Ql),i(ct,gi),i(gi,Jl),i(gi,il),i(jt,Zl),i(jt,dt),i(dt,bi),i(dt,xl),i(dt,wi),i(wi,$l),i(wi,ll),i(dt,es),i(dt,yi),i(yi,ts),i(yi,sl),i(ze,ns),i(ze,Gt),i(Gt,ht),i(ht,Ci),i(ht,is),i(ht,Si),i(Si,ls),i(Si,rl),i(ht,ss),i(ht,Ai),i(Ai,rs),i(Ai,al),i(Gt,as),i(Gt,ft),i(ft,Pi),i(ft,us),i(ft,Ei),i(Ei,os),i(Ei,ul),i(ft,cs),i(ft,zi),i(zi,ds),i(zi,ol),C(f,cl,g),C(f,dl,g),C(f,hl,g),C(f,Sn,g),C(f,fl,g),C(f,$e,g),i($e,Wi),i(Wi,Kt),Kt.checked=t[20],i(Wi,hs),i($e,fs),i($e,Ii),i(Ii,Xt),Xt.checked=t[21],i(Ii,ps),i($e,ms),i($e,Ri),i(Ri,Yt),Yt.checked=t[25],i(Ri,gs),C(f,pl,g),C(f,et,g),i(et,Di),i(Di,_s),i(Di,tt);for(let j=0;jt[89].call(u)),a(h,"class","input"),t[37]===void 0&&wt(()=>t[90].call(h)),a(k,"class","input"),a(k,"type","number"),a(n,"class","flex"),xt(O,"max-width","120px"),a(O,"class","input"),a(O,"type","number"),a(O,"placeholder","R"),xt(E,"max-width","120px"),a(E,"class","input"),a(E,"type","number"),a(E,"placeholder","G"),xt(R,"max-width","120px"),a(R,"class","input"),a(R,"type","number"),a(R,"placeholder","B"),xt(V,"max-width","120px"),a(V,"class","input"),a(V,"type","number"),a(V,"placeholder","A"),a(D,"class","flex"),a(L,"class","flex"),a(te,"class","btn"),xt(te,"width","80px"),a(le,"class","flex"),a(de,"class","btn"),xt(de,"width","80px"),a(G,"class","flex"),a(e,"class","flex flex-col gap-1")},m(W,x){C(W,e,x),i(e,n),i(n,l),i(l,s),i(l,u);for(let H=0;H=1,w,_,A,k=h&&Fs(t),y=t[1][t[0]]&&Us(t);return{c(){e=r("div"),n=r("div"),l=r("input"),s=p(),u=r("button"),u.textContent="New window",d=p(),o=r("br"),c=p(),k&&k.c(),w=p(),y&&y.c(),a(l,"class","input grow"),a(l,"type","text"),a(l,"placeholder","New Window label.."),a(u,"class","btn"),a(n,"class","flex gap-1"),a(e,"class","flex flex-col children:grow gap-2")},m(L,M){C(L,e,M),i(e,n),i(n,l),I(l,t[28]),i(n,s),i(n,u),i(e,d),i(e,o),i(e,c),k&&k.m(e,null),i(e,w),y&&y.m(e,null),_||(A=[S(l,"input",t[58]),S(u,"click",t[53])],_=!0)},p(L,M){M[0]&268435456&&l.value!==L[28]&&I(l,L[28]),M[0]&2&&(h=Object.keys(L[1]).length>=1),h?k?k.p(L,M):(k=Fs(L),k.c(),k.m(e,w)):k&&(k.d(1),k=null),L[1][L[0]]?y?y.p(L,M):(y=Us(L),y.c(),y.m(e,null)):y&&(y.d(1),y=null)},i:ie,o:ie,d(L){L&&v(e),k&&k.d(),y&&y.d(),_=!1,Ce(A)}}}function ta(t,e,n){const l=_r();let s=l.label;const u={[l.label]:l},d=["default","crosshair","hand","arrow","move","text","wait","help","progress","notAllowed","contextMenu","cell","verticalText","alias","copy","noDrop","grab","grabbing","allScroll","zoomIn","zoomOut","eResize","nResize","neResize","nwResize","sResize","seResize","swResize","wResize","ewResize","nsResize","neswResize","nwseResize","colResize","rowResize"],o=["mica","blur","acrylic","tabbed","tabbedDark","tabbedLight"],c=navigator.appVersion.includes("Windows"),h=navigator.appVersion.includes("Macintosh");let w=c?o:Object.keys(Ji).map(N=>Ji[N]).filter(N=>!o.includes(N));const _=Object.keys(Zi).map(N=>Zi[N]),A=Object.keys(Qi).map(N=>Qi[N]);let{onMessage:k}=e;const y=document.querySelector("main");let L,M=!0,B=!0,D=!0,O=!0,P=!1,E=!0,z=!1,R=!1,J=!0,V=!1,Z=null,le=null,te=null,q=null,G=null,T=null,K=null,X=null,be=1,ke=new it(K,X),de=new it(K,X),ae=new ln(Z,le),$=new ln(Z,le),pe,Y,se=!1,ne=!0,W=null,x=null,H="default",ue=!1,Ae="Awesome Tauri Example!",we=[],me,We,Me,Ie,ge,_e,Se,Pe="none",he=0,Le;function oe(){u[s].setTitle(Ae)}function Re(){u[s].hide(),setTimeout(u[s].show,2e3)}function De(){u[s].minimize(),setTimeout(u[s].unminimize,2e3)}function Ee(){if(!L)return;const N=new Dn(L);n(1,u[L]=N,u),N.once("tauri://error",function(){k("Error creating new webview")})}function ce(){u[s].innerSize().then(N=>{n(32,ae=N),n(12,Z=ae.width),n(13,le=ae.height)}),u[s].outerSize().then(N=>{n(33,$=N)})}function F(){u[s].innerPosition().then(N=>{n(30,ke=N)}),u[s].outerPosition().then(N=>{n(31,de=N),n(18,K=de.x),n(19,X=de.y)})}async function ee(N){N&&(pe&&pe(),Y&&Y(),Y=await N.listen("tauri://move",F),pe=await N.listen("tauri://resize",ce))}async function U(){await u[s].minimize(),await u[s].requestUserAttention(Yi.Critical),await new Promise(N=>setTimeout(N,3e3)),await u[s].requestUserAttention(null)}async function Te(){we.includes(me)||n(35,we=[...we,me]);const N={effects:we,state:We,radius:Me};Number.isInteger(Ie)&&Number.isInteger(ge)&&Number.isInteger(_e)&&Number.isInteger(Se)&&(N.color=[Ie,ge,_e,Se]),y.classList.remove("bg-primary"),y.classList.remove("dark:bg-darkPrimary"),await u[s].clearEffects(),await u[s].setEffects(N)}async function Vn(){n(35,we=[]),await u[s].clearEffects(),y.classList.add("bg-primary"),y.classList.add("dark:bg-darkPrimary")}function Fe(){L=this.value,n(28,L)}function qn(){s=En(this),n(0,s),n(1,u)}function Ot(){Le=this.value,n(43,Le)}const Nn=()=>u[s].center();function He(){P=this.checked,n(6,P)}function jn(){M=this.checked,n(2,M)}function lt(){B=this.checked,n(3,B)}function Wt(){D=this.checked,n(4,D)}function Gn(){O=this.checked,n(5,O)}function Ue(){E=this.checked,n(7,E)}function Kn(){z=this.checked,n(8,z)}function It(){R=this.checked,n(9,R)}function Xn(){J=this.checked,n(10,J)}function Be(){V=this.checked,n(11,V)}function Yn(){K=Q(this.value),n(18,K)}function st(){X=Q(this.value),n(19,X)}function Rt(){Z=Q(this.value),n(12,Z)}function Qn(){le=Q(this.value),n(13,le)}function Ge(){te=Q(this.value),n(14,te)}function Jn(){q=Q(this.value),n(15,q)}function Dt(){G=Q(this.value),n(16,G)}function Zn(){T=Q(this.value),n(17,T)}function Ke(){se=this.checked,n(20,se)}function xn(){ne=this.checked,n(21,ne)}function rt(){ue=this.checked,n(25,ue)}function Ft(){H=En(this),n(24,H),n(44,d)}function $n(){W=Q(this.value),n(22,W)}function Ve(){x=Q(this.value),n(23,x)}function ei(){Ae=this.value,n(34,Ae)}function Ht(){Pe=En(this),n(26,Pe),n(49,A)}function ti(){he=Q(this.value),n(27,he)}function qe(){me=En(this),n(36,me),n(47,w)}function hn(){We=En(this),n(37,We),n(48,_)}function fn(){Me=Q(this.value),n(38,Me)}function pn(){Ie=Q(this.value),n(39,Ie)}function ze(){ge=Q(this.value),n(40,ge)}function at(){_e=Q(this.value),n(41,_e)}function Xe(){Se=Q(this.value),n(42,Se)}return t.$$set=N=>{"onMessage"in N&&n(57,k=N.onMessage)},t.$$.update=()=>{var N,mn,kt,gn,yt,Ut,_n,vt,bn,Ct,Bt,wn,Ne,St,kn,Lt,yn,At,Vt,vn,Mt,Cn,Pt,qt;t.$$.dirty[0]&3&&(u[s],F(),ce()),t.$$.dirty[0]&7&&((N=u[s])==null||N.setResizable(M)),t.$$.dirty[0]&11&&((mn=u[s])==null||mn.setMaximizable(B)),t.$$.dirty[0]&19&&((kt=u[s])==null||kt.setMinimizable(D)),t.$$.dirty[0]&35&&((gn=u[s])==null||gn.setClosable(O)),t.$$.dirty[0]&67&&(P?(yt=u[s])==null||yt.maximize():(Ut=u[s])==null||Ut.unmaximize()),t.$$.dirty[0]&131&&((_n=u[s])==null||_n.setDecorations(E)),t.$$.dirty[0]&259&&((vt=u[s])==null||vt.setAlwaysOnTop(z)),t.$$.dirty[0]&515&&((bn=u[s])==null||bn.setAlwaysOnBottom(R)),t.$$.dirty[0]&1027&&((Ct=u[s])==null||Ct.setContentProtected(J)),t.$$.dirty[0]&2051&&((Bt=u[s])==null||Bt.setFullscreen(V)),t.$$.dirty[0]&12291&&Z&&le&&((wn=u[s])==null||wn.setSize(new ln(Z,le))),t.$$.dirty[0]&49155&&(te&&q?(Ne=u[s])==null||Ne.setMinSize(new zl(te,q)):(St=u[s])==null||St.setMinSize(null)),t.$$.dirty[0]&196611&&(G>800&&T>400?(kn=u[s])==null||kn.setMaxSize(new zl(G,T)):(Lt=u[s])==null||Lt.setMaxSize(null)),t.$$.dirty[0]&786435&&K!==null&&X!==null&&((yn=u[s])==null||yn.setPosition(new it(K,X))),t.$$.dirty[0]&3&&((At=u[s])==null||At.scaleFactor().then(ni=>n(29,be=ni))),t.$$.dirty[0]&3&&ee(u[s]),t.$$.dirty[0]&1048579&&((Vt=u[s])==null||Vt.setCursorGrab(se)),t.$$.dirty[0]&2097155&&((vn=u[s])==null||vn.setCursorVisible(ne)),t.$$.dirty[0]&16777219&&((Mt=u[s])==null||Mt.setCursorIcon(H)),t.$$.dirty[0]&12582915&&W!==null&&x!==null&&((Cn=u[s])==null||Cn.setCursorPosition(new it(W,x))),t.$$.dirty[0]&33554435&&((Pt=u[s])==null||Pt.setIgnoreCursorEvents(ue)),t.$$.dirty[0]&201326595&&((qt=u[s])==null||qt.setProgressBar({status:Pe,progress:he}))},[s,u,M,B,D,O,P,E,z,R,J,V,Z,le,te,q,G,T,K,X,se,ne,W,x,H,ue,Pe,he,L,be,ke,de,ae,$,Ae,we,me,We,Me,Ie,ge,_e,Se,Le,d,c,h,w,_,A,oe,Re,De,Ee,U,Te,Vn,k,Fe,qn,Ot,Nn,He,jn,lt,Wt,Gn,Ue,Kn,It,Xn,Be,Yn,st,Rt,Qn,Ge,Jn,Dt,Zn,Ke,xn,rt,Ft,$n,Ve,ei,Ht,ti,qe,hn,fn,pn,ze,at,Xe]}class na extends xe{constructor(e){super(),Ze(this,e,ta,ea,je,{onMessage:57},null,[-1,-1,-1,-1])}}function ia(t){let e;return{c(){e=r("div"),e.innerHTML='
Not available for Linux
',a(e,"class","flex flex-col gap-2")},m(n,l){C(n,e,l)},p:ie,i:ie,o:ie,d(n){n&&v(e)}}}function la(t,e,n){let{onMessage:l}=e;const s=window.constraints={audio:!0,video:!0};function u(o){const c=document.querySelector("video"),h=o.getVideoTracks();l("Got stream with constraints:",s),l(`Using video device: ${h[0].label}`),window.stream=o,c.srcObject=o}function d(o){if(o.name==="ConstraintNotSatisfiedError"){const c=s.video;l(`The resolution ${c.width.exact}x${c.height.exact} px is not supported by your device.`)}else o.name==="PermissionDeniedError"&&l("Permissions have not been granted to use your camera and microphone, you need to allow the page access to your devices in order for the demo to work.");l(`getUserMedia error: ${o.name}`,o)}return Ki(async()=>{try{const o=await navigator.mediaDevices.getUserMedia(s);u(o)}catch(o){d(o)}}),ar(()=>{var o;(o=window.stream)==null||o.getTracks().forEach(function(c){c.stop()})}),t.$$set=o=>{"onMessage"in o&&n(0,l=o.onMessage)},[l]}class sa extends xe{constructor(e){super(),Ze(this,e,la,ia,je,{onMessage:0})}}function ra(t){let e,n,l,s,u,d;return{c(){e=r("div"),n=r("button"),n.textContent="Show",l=p(),s=r("button"),s.textContent="Hide",a(n,"class","btn"),a(n,"id","show"),a(n,"title","Hides and shows the app after 2 seconds"),a(s,"class","btn"),a(s,"id","hide")},m(o,c){C(o,e,c),i(e,n),i(e,l),i(e,s),u||(d=[S(n,"click",t[0]),S(s,"click",t[1])],u=!0)},p:ie,i:ie,o:ie,d(o){o&&v(e),u=!1,Ce(d)}}}function aa(t,e,n){let{onMessage:l}=e;function s(){u().then(()=>{setTimeout(()=>{Vr().then(()=>l("Shown app")).catch(l)},2e3)}).catch(l)}function u(){return qr().then(()=>l("Hide app")).catch(l)}return t.$$set=d=>{"onMessage"in d&&n(2,l=d.onMessage)},[s,u,l]}class ua extends xe{constructor(e){super(),Ze(this,e,aa,ra,je,{onMessage:2})}}var Ni;class br{get rid(){return Rn(this,Ni,"f")}constructor(e){Ni.set(this,void 0),Xi(this,Ni,e,"f")}async close(){return m("plugin:resources|close",{rid:this.rid})}}Ni=new WeakMap;var ji,Gi;function wr(t){var e;if("items"in t)t.items=(e=t.items)==null?void 0:e.map(n=>"rid"in n?n:wr(n));else if("action"in t&&t.action){const n=new Il;return n.onmessage=t.action,delete t.action,{...t,handler:n}}return t}async function on(t,e){const n=new Il;let l=null;return e&&typeof e=="object"&&("action"in e&&e.action&&(n.onmessage=e.action,delete e.action),"items"in e&&e.items&&(l=e.items.map(s=>"rid"in s?[s.rid,s.kind]:wr(s)))),m("plugin:menu|new",{kind:t,options:e?{...e,items:l}:void 0,handler:n})}class cn extends br{get id(){return Rn(this,ji,"f")}get kind(){return Rn(this,Gi,"f")}constructor(e,n,l){super(e),ji.set(this,void 0),Gi.set(this,void 0),Xi(this,ji,n,"f"),Xi(this,Gi,l,"f")}}ji=new WeakMap,Gi=new WeakMap;class Fn extends cn{constructor(e,n){super(e,n,"MenuItem")}static async new(e){return on("MenuItem",e).then(([n,l])=>new Fn(n,l))}async text(){return m("plugin:menu|text",{rid:this.rid,kind:this.kind})}async setText(e){return m("plugin:menu|set_text",{rid:this.rid,kind:this.kind,text:e})}async isEnabled(){return m("plugin:menu|is_enabled",{rid:this.rid,kind:this.kind})}async setEnabled(e){return m("plugin:menu|set_enabled",{rid:this.rid,kind:this.kind,enabled:e})}async setAccelerator(e){return m("plugin:menu|set_accelerator",{rid:this.rid,kind:this.kind,accelerator:e})}}class dn extends cn{constructor(e,n){super(e,n,"Check")}static async new(e){return on("Check",e).then(([n,l])=>new dn(n,l))}async text(){return m("plugin:menu|text",{rid:this.rid,kind:this.kind})}async setText(e){return m("plugin:menu|set_text",{rid:this.rid,kind:this.kind,text:e})}async isEnabled(){return m("plugin:menu|is_enabled",{rid:this.rid,kind:this.kind})}async setEnabled(e){return m("plugin:menu|set_enabled",{rid:this.rid,kind:this.kind,enabled:e})}async setAccelerator(e){return m("plugin:menu|set_accelerator",{rid:this.rid,kind:this.kind,accelerator:e})}async isChecked(){return m("plugin:menu|is_checked",{rid:this.rid})}async setChecked(e){return m("plugin:menu|set_checked",{rid:this.rid,checked:e})}}var js;(function(t){t.Add="Add",t.Advanced="Advanced",t.Bluetooth="Bluetooth",t.Bookmarks="Bookmarks",t.Caution="Caution",t.ColorPanel="ColorPanel",t.ColumnView="ColumnView",t.Computer="Computer",t.EnterFullScreen="EnterFullScreen",t.Everyone="Everyone",t.ExitFullScreen="ExitFullScreen",t.FlowView="FlowView",t.Folder="Folder",t.FolderBurnable="FolderBurnable",t.FolderSmart="FolderSmart",t.FollowLinkFreestanding="FollowLinkFreestanding",t.FontPanel="FontPanel",t.GoLeft="GoLeft",t.GoRight="GoRight",t.Home="Home",t.IChatTheater="IChatTheater",t.IconView="IconView",t.Info="Info",t.InvalidDataFreestanding="InvalidDataFreestanding",t.LeftFacingTriangle="LeftFacingTriangle",t.ListView="ListView",t.LockLocked="LockLocked",t.LockUnlocked="LockUnlocked",t.MenuMixedState="MenuMixedState",t.MenuOnState="MenuOnState",t.MobileMe="MobileMe",t.MultipleDocuments="MultipleDocuments",t.Network="Network",t.Path="Path",t.PreferencesGeneral="PreferencesGeneral",t.QuickLook="QuickLook",t.RefreshFreestanding="RefreshFreestanding",t.Refresh="Refresh",t.Remove="Remove",t.RevealFreestanding="RevealFreestanding",t.RightFacingTriangle="RightFacingTriangle",t.Share="Share",t.Slideshow="Slideshow",t.SmartBadge="SmartBadge",t.StatusAvailable="StatusAvailable",t.StatusNone="StatusNone",t.StatusPartiallyAvailable="StatusPartiallyAvailable",t.StatusUnavailable="StatusUnavailable",t.StopProgressFreestanding="StopProgressFreestanding",t.StopProgress="StopProgress",t.TrashEmpty="TrashEmpty",t.TrashFull="TrashFull",t.User="User",t.UserAccounts="UserAccounts",t.UserGroup="UserGroup",t.UserGuest="UserGuest"})(js||(js={}));class Hn extends cn{constructor(e,n){super(e,n,"Icon")}static async new(e){return on("Icon",e).then(([n,l])=>new Hn(n,l))}async text(){return m("plugin:menu|text",{rid:this.rid,kind:this.kind})}async setText(e){return m("plugin:menu|set_text",{rid:this.rid,kind:this.kind,text:e})}async isEnabled(){return m("plugin:menu|is_enabled",{rid:this.rid,kind:this.kind})}async setEnabled(e){return m("plugin:menu|set_enabled",{rid:this.rid,kind:this.kind,enabled:e})}async setAccelerator(e){return m("plugin:menu|set_accelerator",{rid:this.rid,kind:this.kind,accelerator:e})}async setIcon(e){return m("plugin:menu|set_icon",{rid:this.rid,icon:e})}}class Un extends cn{constructor(e,n){super(e,n,"Predefined")}static async new(e){return on("Predefined",e).then(([n,l])=>new Un(n,l))}async text(){return m("plugin:menu|text",{rid:this.rid,kind:this.kind})}async setText(e){return m("plugin:menu|set_text",{rid:this.rid,kind:this.kind,text:e})}}function Ml([t,e,n]){switch(n){case"Submenu":return new Bn(t,e);case"Predefined":return new Un(t,e);case"Check":return new dn(t,e);case"Icon":return new Hn(t,e);case"MenuItem":default:return new Fn(t,e)}}class Bn extends cn{constructor(e,n){super(e,n,"Submenu")}static async new(e){return on("Submenu",e).then(([n,l])=>new Bn(n,l))}async text(){return m("plugin:menu|text",{rid:this.rid,kind:this.kind})}async setText(e){return m("plugin:menu|set_text",{rid:this.rid,kind:this.kind,text:e})}async isEnabled(){return m("plugin:menu|is_enabled",{rid:this.rid,kind:this.kind})}async setEnabled(e){return m("plugin:menu|set_enabled",{rid:this.rid,kind:this.kind,enabled:e})}async append(e){return m("plugin:menu|append",{rid:this.rid,kind:this.kind,items:(Array.isArray(e)?e:[e]).map(n=>"rid"in n?[n.rid,n.kind]:n)})}async prepend(e){return m("plugin:menu|prepend",{rid:this.rid,kind:this.kind,items:(Array.isArray(e)?e:[e]).map(n=>"rid"in n?[n.rid,n.kind]:n)})}async insert(e,n){return m("plugin:menu|insert",{rid:this.rid,kind:this.kind,items:(Array.isArray(e)?e:[e]).map(l=>"rid"in l?[l.rid,l.kind]:l),position:n})}async remove(e){return m("plugin:menu|remove",{rid:this.rid,kind:this.kind,item:[e.rid,e.kind]})}async removeAt(e){return m("plugin:menu|remove_at",{rid:this.rid,kind:this.kind,position:e}).then(Ml)}async items(){return m("plugin:menu|items",{rid:this.rid,kind:this.kind}).then(e=>e.map(Ml))}async get(e){return m("plugin:menu|get",{rid:this.rid,kind:this.kind,id:e}).then(n=>n?Ml(n):null)}async popup(e,n){let l=null;return e&&(l={type:e instanceof it?"Physical":"Logical",data:e}),m("plugin:menu|popup",{rid:this.rid,kind:this.kind,window:(n==null?void 0:n.label)??null,at:l})}async setAsWindowsMenuForNSApp(){return m("plugin:menu|set_as_windows_menu_for_nsapp",{rid:this.rid})}async setAsHelpMenuForNSApp(){return m("plugin:menu|set_as_help_menu_for_nsapp",{rid:this.rid})}}function Pl([t,e,n]){switch(n){case"Submenu":return new Bn(t,e);case"Predefined":return new Un(t,e);case"Check":return new dn(t,e);case"Icon":return new Hn(t,e);case"MenuItem":default:return new Fn(t,e)}}class bt extends cn{constructor(e,n){super(e,n,"Menu")}static async new(e){return on("Menu",e).then(([n,l])=>new bt(n,l))}static async default(){return m("plugin:menu|default").then(([e,n])=>new bt(e,n))}async append(e){return m("plugin:menu|append",{rid:this.rid,kind:this.kind,items:(Array.isArray(e)?e:[e]).map(n=>"rid"in n?[n.rid,n.kind]:n)})}async prepend(e){return m("plugin:menu|prepend",{rid:this.rid,kind:this.kind,items:(Array.isArray(e)?e:[e]).map(n=>"rid"in n?[n.rid,n.kind]:n)})}async insert(e,n){return m("plugin:menu|insert",{rid:this.rid,kind:this.kind,items:(Array.isArray(e)?e:[e]).map(l=>"rid"in l?[l.rid,l.kind]:l),position:n})}async remove(e){return m("plugin:menu|remove",{rid:this.rid,kind:this.kind,item:[e.rid,e.kind]})}async removeAt(e){return m("plugin:menu|remove_at",{rid:this.rid,kind:this.kind,position:e}).then(Pl)}async items(){return m("plugin:menu|items",{rid:this.rid,kind:this.kind}).then(e=>e.map(Pl))}async get(e){return m("plugin:menu|get",{rid:this.rid,kind:this.kind,id:e}).then(n=>n?Pl(n):null)}async popup(e,n){let l=null;return e&&(l={type:e instanceof it?"Physical":"Logical",data:e}),m("plugin:menu|popup",{rid:this.rid,kind:this.kind,window:(n==null?void 0:n.label)??null,at:l})}async setAsAppMenu(){return m("plugin:menu|set_as_app_menu",{rid:this.rid}).then(e=>e?new bt(e[0],e[1]):null)}async setAsWindowMenu(e){return m("plugin:menu|set_as_window_menu",{rid:this.rid,window:(e==null?void 0:e.label)??null}).then(n=>n?new bt(n[0],n[1]):null)}}function Gs(t,e,n){const l=t.slice();return l[16]=e[n],l[17]=e,l[18]=n,l}function Ks(t,e,n){const l=t.slice();return l[19]=e[n],l[20]=e,l[21]=n,l}function Xs(t){let e,n,l,s,u,d,o=t[19]+"",c,h,w,_,A;function k(){t[9].call(n,t[20],t[21])}return{c(){e=r("div"),n=r("input"),u=p(),d=r("label"),c=b(o),w=p(),a(n,"id",l=t[19]+"Input"),n.checked=s=t[0]===t[19],a(n,"type","radio"),a(n,"name","kind"),a(d,"for",h=t[19]+"Input"),a(e,"class","flex gap-1")},m(y,L){C(y,e,L),i(e,n),I(n,t[19]),i(e,u),i(e,d),i(d,c),i(e,w),_||(A=[S(n,"change",t[6]),S(n,"change",k)],_=!0)},p(y,L){t=y,L&16&&l!==(l=t[19]+"Input")&&a(n,"id",l),L&17&&s!==(s=t[0]===t[19])&&(n.checked=s),L&16&&I(n,t[19]),L&16&&o!==(o=t[19]+"")&&re(c,o),L&16&&h!==(h=t[19]+"Input")&&a(d,"for",h)},d(y){y&&v(e),_=!1,Ce(A)}}}function Ys(t){let e,n,l;return{c(){e=r("input"),a(e,"class","input"),a(e,"type","text"),a(e,"placeholder","Text")},m(s,u){C(s,e,u),I(e,t[1]),n||(l=S(e,"input",t[10]),n=!0)},p(s,u){u&2&&e.value!==s[1]&&I(e,s[1])},d(s){s&&v(e),n=!1,l()}}}function oa(t){let e,n=fe(t[5]),l=[];for(let s=0;sl("itemClick",{id:z,text:E})},P=await Fn.new(O);break;case"Icon":O={text:u,icon:d,action:z=>l("itemClick",{id:z,text:E})},P=await Hn.new(O);break;case"Check":O={text:u,checked:c,action:z=>l("itemClick",{id:z,text:E})},P=await dn.new(O);break;case"Predefined":O={item:o},P=await Un.new(O);break}l("new",{item:P,options:O}),n(1,u=""),o=""}function y(O,P){O[P]=this.value,n(4,h)}function L(){u=this.value,n(1,u)}function M(){d=this.value,n(2,d)}function B(){c=this.checked,n(3,c)}function D(O,P){O[P]=this.value,n(5,w)}return[s,u,d,c,h,w,_,A,k,y,L,M,B,D]}class pa extends xe{constructor(e){super(),Ze(this,e,fa,ha,je,{})}}function Js(t,e,n){const l=t.slice();return l[5]=e[n],l}function Zs(t){let e,n,l,s,u,d=xs(t[5])+"",o,c;return{c(){e=r("div"),n=r("div"),s=p(),u=r("p"),o=b(d),c=p(),a(n,"class",l=t[3](t[5])),a(e,"class","flex flex-row gap-1")},m(h,w){C(h,e,w),i(e,n),i(e,s),i(e,u),i(u,o),i(e,c)},p(h,w){w&1&&l!==(l=h[3](h[5]))&&a(n,"class",l),w&1&&d!==(d=xs(h[5])+"")&&re(o,d)},d(h){h&&v(e)}}}function ma(t){let e,n,l,s,u;n=new pa({}),n.$on("new",t[1]),n.$on("itemClick",t[2]);let d=fe(t[0]),o=[];for(let c=0;c{"items"in c&&n(0,l=c.items)},[l,u,d,o]}class kr extends xe{constructor(e){super(),Ze(this,e,ga,ma,je,{items:0})}}function _a(t){let e,n,l,s,u,d,o,c,h,w;function _(k){t[5](k)}let A={};return t[0]!==void 0&&(A.items=t[0]),n=new kr({props:A}),sn.push(()=>fr(n,"items",_)),n.$on("itemClick",t[3]),{c(){e=r("div"),In(n.$$.fragment),s=p(),u=r("button"),u.textContent="Create menu",d=p(),o=r("button"),o.textContent="Popup",a(u,"class","btn"),a(o,"class","btn")},m(k,y){C(k,e,y),an(n,e,null),i(e,s),i(e,u),i(e,d),i(e,o),c=!0,h||(w=[S(u,"click",t[1]),S(o,"click",t[2])],h=!0)},p(k,[y]){const L={};!l&&y&1&&(l=!0,L.items=k[0],dr(()=>l=!1)),n.$set(L)},i(k){c||(rn(n.$$.fragment,k),c=!0)},o(k){Wn(n.$$.fragment,k),c=!1},d(k){k&&v(e),un(n),h=!1,Ce(w)}}}function ba(t,e,n){let{onMessage:l}=e,s=[],u=null,d=null,o=0;const c=navigator.userAgent.includes("Macintosh");async function h(){d=await Bn.new({text:"app",items:s.map(y=>y.item)})}async function w(){await h(),o=s.length,u=await bt.new({items:[d]}),await(c?u.setAsAppMenu():u.setAsWindowMenu())}async function _(){(!d||o!==s.length)&&await h(),(await bt.new({items:[d]})).popup()}function A(y){l(`Item ${y.detail.text} clicked`)}function k(y){s=y,n(0,s)}return t.$$set=y=>{"onMessage"in y&&n(4,l=y.onMessage)},[s,w,_,A,l,k]}class wa extends xe{constructor(e){super(),Ze(this,e,ba,_a,je,{onMessage:4})}}class Dl extends br{constructor(e,n){super(e),this.id=n}static async new(e){e!=null&&e.menu&&(e.menu=[e.menu.rid,e.menu.kind]),e!=null&&e.icon&&(e.icon=typeof e.icon=="string"?e.icon:Array.from(e.icon));const n=new Il;return e!=null&&e.action&&(n.onmessage=e.action,delete e.action),m("plugin:tray|new",{options:e??{},handler:n}).then(([l,s])=>new Dl(l,s))}async setIcon(e){let n=null;return e&&(n=typeof e=="string"?e:Array.from(e)),m("plugin:tray|set_icon",{rid:this.rid,icon:n})}async setMenu(e){return e&&(e=[e.rid,e.kind]),m("plugin:tray|set_menu",{rid:this.rid,menu:e})}async setTooltip(e){return m("plugin:tray|set_tooltip",{rid:this.rid,tooltip:e})}async setTitle(e){return m("plugin:tray|set_title",{rid:this.rid,title:e})}async setVisible(e){return m("plugin:tray|set_visible",{rid:this.rid,visible:e})}async setTempDirPath(e){return m("plugin:tray|set_temp_dir_path",{rid:this.rid,path:e})}async setIconAsTemplate(e){return m("plugin:tray|set_icon_as_template",{rid:this.rid,asTemplate:e})}async setMenuOnLeftClick(e){return m("plugin:tray|set_show_menu_on_left_click",{rid:this.rid,onLeft:e})}}function ka(t){let e,n,l,s,u,d,o,c,h,w,_,A,k,y,L,M,B,D,O,P,E,z,R,J,V,Z;function le(q){t[14](q)}let te={};return t[5]!==void 0&&(te.items=t[5]),O=new kr({props:te}),sn.push(()=>fr(O,"items",le)),O.$on("itemClick",t[6]),{c(){e=r("div"),n=r("div"),l=r("input"),s=p(),u=r("input"),d=p(),o=r("label"),c=b(`Menu on left click + `),h=r("input"),w=p(),_=r("div"),A=r("input"),k=p(),y=r("label"),L=b(`Icon as template + `),M=r("input"),B=p(),D=r("div"),In(O.$$.fragment),E=p(),z=r("div"),R=r("button"),R.textContent="Create tray",a(l,"class","input grow"),a(l,"type","text"),a(l,"placeholder","Title"),a(u,"class","input grow"),a(u,"type","text"),a(u,"placeholder","Tooltip"),a(h,"type","checkbox"),a(n,"class","flex gap-1"),a(A,"class","input grow"),a(A,"type","text"),a(A,"placeholder","Icon path"),a(M,"type","checkbox"),a(_,"class","flex gap-1"),a(D,"class","flex children:grow"),a(R,"class","btn"),a(R,"title","Creates the tray icon"),a(z,"class","flex"),a(e,"class","flex flex-col children:grow gap-2")},m(q,G){C(q,e,G),i(e,n),i(n,l),I(l,t[2]),i(n,s),i(n,u),I(u,t[1]),i(n,d),i(n,o),i(o,c),i(o,h),h.checked=t[4],i(e,w),i(e,_),i(_,A),I(A,t[0]),i(_,k),i(_,y),i(y,L),i(y,M),M.checked=t[3],i(e,B),i(e,D),an(O,D,null),i(e,E),i(e,z),i(z,R),J=!0,V||(Z=[S(l,"input",t[9]),S(u,"input",t[10]),S(h,"change",t[11]),S(A,"input",t[12]),S(M,"change",t[13]),S(R,"click",t[7])],V=!0)},p(q,[G]){G&4&&l.value!==q[2]&&I(l,q[2]),G&2&&u.value!==q[1]&&I(u,q[1]),G&16&&(h.checked=q[4]),G&1&&A.value!==q[0]&&I(A,q[0]),G&8&&(M.checked=q[3]);const T={};!P&&G&32&&(P=!0,T.items=q[5],dr(()=>P=!1)),O.$set(T)},i(q){J||(rn(O.$$.fragment,q),J=!0)},o(q){Wn(O.$$.fragment,q),J=!1},d(q){q&&v(e),un(O),V=!1,Ce(Z)}}}function ya(t,e,n){let{onMessage:l}=e,s=null,u=null,d=null,o=!1,c=!0,h=[];function w(D){l(`Item ${D.detail.text} clicked`)}async function _(){Dl.new({icon:s,tooltip:u,title:d,iconAsTemplate:o,menuOnLeftClick:c,menu:await bt.new({items:h.map(D=>D.item)}),action:D=>l(D)}).catch(l)}function A(){d=this.value,n(2,d)}function k(){u=this.value,n(1,u)}function y(){c=this.checked,n(4,c)}function L(){s=this.value,n(0,s)}function M(){o=this.checked,n(3,o)}function B(D){h=D,n(5,h)}return t.$$set=D=>{"onMessage"in D&&n(8,l=D.onMessage)},[s,u,d,o,c,h,w,_,l,A,k,y,L,M,B]}class va extends xe{constructor(e){super(),Ze(this,e,ya,ka,je,{onMessage:8})}}function $s(t,e,n){const l=t.slice();return l[28]=e[n],l}function er(t,e,n){const l=t.slice();return l[31]=e[n],l}function Ca(t){let e;return{c(){e=r("span"),a(e,"class","i-codicon-menu animate-duration-300ms animate-fade-in")},m(n,l){C(n,e,l)},d(n){n&&v(e)}}}function Sa(t){let e;return{c(){e=r("span"),a(e,"class","i-codicon-close animate-duration-300ms animate-fade-in")},m(n,l){C(n,e,l)},d(n){n&&v(e)}}}function La(t){let e,n;return{c(){e=b(`Switch to Dark mode + `),n=r("div"),a(n,"class","i-ph-moon")},m(l,s){C(l,e,s),C(l,n,s)},d(l){l&&(v(e),v(n))}}}function Aa(t){let e,n;return{c(){e=b(`Switch to Light mode + `),n=r("div"),a(n,"class","i-ph-sun")},m(l,s){C(l,e,s),C(l,n,s)},d(l){l&&(v(e),v(n))}}}function Ma(t){let e,n,l,s,u,d,o;function c(){return t[15](t[31])}return{c(){e=r("a"),n=r("div"),l=p(),s=r("p"),s.textContent=`${t[31].label}`,a(n,"class",t[31].icon+" mr-2"),a(e,"href","##"),a(e,"class",u="nv "+(t[1]===t[31]?"nv_selected":""))},m(h,w){C(h,e,w),i(e,n),i(e,l),i(e,s),d||(o=S(e,"click",c),d=!0)},p(h,w){t=h,w[0]&2&&u!==(u="nv "+(t[1]===t[31]?"nv_selected":""))&&a(e,"class",u)},d(h){h&&v(e),d=!1,o()}}}function tr(t){let e,n=t[31]&&Ma(t);return{c(){n&&n.c(),e=Ol()},m(l,s){n&&n.m(l,s),C(l,e,s)},p(l,s){l[31]&&n.p(l,s)},d(l){l&&v(e),n&&n.d(l)}}}function nr(t){let e,n=t[28].html+"",l;return{c(){e=new Tr(!1),l=Ol(),e.a=l},m(s,u){e.m(n,s,u),C(s,l,u)},p(s,u){u[0]&32&&n!==(n=s[28].html+"")&&e.p(n)},d(s){s&&(v(l),e.d())}}}function Pa(t){let e,n,l,s,u,d,o,c,h,w,_,A,k,y,L,M,B,D,O,P,E,z,R,J,V,Z,le,te,q,G,T,K,X=t[1].label+"",be,ke,de,ae,$,pe,Y,se,ne,W,x,H,ue,Ae,we,me,We,Me;function Ie(F,ee){return F[0]?Sa:Ca}let ge=Ie(t),_e=ge(t);function Se(F,ee){return F[2]?Aa:La}let Pe=Se(t),he=Pe(t),Le=fe(t[6]),oe=[];for(let F=0;F`,B=p(),D=r("a"),D.innerHTML=`GitHub + `,O=p(),P=r("a"),P.innerHTML=`Source + `,E=p(),z=r("br"),R=p(),J=r("div"),V=p(),Z=r("br"),le=p(),te=r("div");for(let F=0;F',Ae=p(),we=r("div");for(let F=0;F{un(U,1)}),Ir()}Re?($=Es(Re,De(F)),In($.$$.fragment),rn($.$$.fragment,1),an($,ae,null)):$=null}if(ee[0]&32){Ee=fe(F[5]);let U;for(U=0;U{T.ctrlKey&&T.key==="b"&&m("toggle_menu")});const s=navigator.userAgent.toLowerCase(),u=s.includes("android")||s.includes("iphone"),d=[{label:"Welcome",component:Gr,icon:"i-ph-hand-waving"},{label:"Communication",component:Qr,icon:"i-codicon-radio-tower"},!u&&{label:"App",component:ua,icon:"i-codicon-hubot"},{label:"Window",component:na,icon:"i-codicon-window"},{label:"Menu",component:wa,icon:"i-ph-list"},{label:"Tray",component:va,icon:"i-ph-tray"},{label:"WebRTC",component:sa,icon:"i-ph-broadcast"}];let o=d[0];function c(T){n(1,o=T)}let h;Ki(()=>{n(2,h=localStorage&&localStorage.getItem("theme")=="dark"),lr(h)});function w(){n(2,h=!h),lr(h)}let _=Fr([]);Ar(t,_,T=>n(5,l=T));let A;async function k(T){_.update(K=>[...K,{html:`
[${new Date().toLocaleTimeString()}]: `+(typeof T=="string"?T:JSON.stringify(T,null,1))+"
"}]),await Ts(),A&&n(3,A.scrollTop=A.scrollHeight,A)}async function y(T){_.update(K=>[...K,{html:`
[${new Date().toLocaleTimeString()}]: `+T+"
"}]),await Ts(),A&&n(3,A.scrollTop=A.scrollHeight,A)}function L(){_.update(()=>[])}let M,B,D;function O(T){D=T.clientY;const K=window.getComputedStyle(M);B=parseInt(K.height,10);const X=ke=>{const de=ke.clientY-D,ae=B-de;n(4,M.style.height=`${ae{document.removeEventListener("mouseup",be),document.removeEventListener("mousemove",X)};document.addEventListener("mouseup",be),document.addEventListener("mousemove",X)}let P=!1,E,z,R=!1,J=0,V=0;const Z=(T,K,X)=>Math.min(Math.max(K,T),X);Ki(()=>{n(14,E=document.querySelector("#sidebar")),z=document.querySelector("#sidebarToggle"),document.addEventListener("click",T=>{z.contains(T.target)?n(0,P=!P):P&&!E.contains(T.target)&&n(0,P=!1)}),document.addEventListener("touchstart",T=>{if(z.contains(T.target))return;const K=T.touches[0].clientX;(0{if(R){const K=T.touches[0].clientX;V=K;const X=(K-J)/10;E.style.setProperty("--translate-x",`-${Z(0,P?0-X:18.75-X,18.75)}rem`)}}),document.addEventListener("touchend",()=>{if(R){const T=(V-J)/10;n(0,P=P?T>-(18.75/2):T>18.75/2)}R=!1})});const le=T=>{c(T),n(0,P=!1)},te=T=>T.key==="Enter"?L():{};function q(T){sn[T?"unshift":"push"](()=>{A=T,n(3,A)})}function G(T){sn[T?"unshift":"push"](()=>{M=T,n(4,M)})}return t.$$.update=()=>{if(t.$$.dirty[0]&1){const T=document.querySelector("#sidebar");T&&Ea(T,P)}},[P,o,h,A,M,l,d,c,w,_,k,y,L,O,E,le,te,q,G]}class za extends xe{constructor(e){super(),Ze(this,e,Ta,Pa,je,{},null,[-1,-1])}}new za({target:document.querySelector("#app")}); diff --git a/examples/api/src-tauri/Cargo.lock b/examples/api/src-tauri/Cargo.lock index 332f6bf0c..6067f2a8f 100644 --- a/examples/api/src-tauri/Cargo.lock +++ b/examples/api/src-tauri/Cargo.lock @@ -625,22 +625,6 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cd7cc57abe963c6d3b9d8be5b06ba7c8957a930305ca90304f24ef040aa6f961" -[[package]] -name = "cocoa" -version = "0.24.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f425db7937052c684daec3bd6375c8abe2d146dca4b8b143d6db777c39138f3a" -dependencies = [ - "bitflags 1.3.2", - "block", - "cocoa-foundation", - "core-foundation", - "core-graphics 0.22.3", - "foreign-types 0.3.2", - "libc", - "objc", -] - [[package]] name = "cocoa" version = "0.25.0" @@ -651,8 +635,8 @@ dependencies = [ "block", "cocoa-foundation", "core-foundation", - "core-graphics 0.23.1", - "foreign-types 0.5.0", + "core-graphics", + "foreign-types", "libc", "objc", ] @@ -724,19 +708,6 @@ version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" -[[package]] -name = "core-graphics" -version = "0.22.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2581bbab3b8ffc6fcbd550bf46c355135d16e9ff2a6ea032ad6b9bf1d7efe4fb" -dependencies = [ - "bitflags 1.3.2", - "core-foundation", - "core-graphics-types", - "foreign-types 0.3.2", - "libc", -] - [[package]] name = "core-graphics" version = "0.23.1" @@ -746,7 +717,7 @@ dependencies = [ "bitflags 1.3.2", "core-foundation", "core-graphics-types", - "foreign-types 0.5.0", + "foreign-types", "libc", ] @@ -1124,15 +1095,6 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared 0.1.1", -] - [[package]] name = "foreign-types" version = "0.5.0" @@ -1140,7 +1102,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d737d9aa519fb7b749cbc3b962edcf310a8dd1f4b67c91c4f83975dbdd17d965" dependencies = [ "foreign-types-macros", - "foreign-types-shared 0.3.1", + "foreign-types-shared", ] [[package]] @@ -1154,12 +1116,6 @@ dependencies = [ "syn 2.0.38", ] -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - [[package]] name = "foreign-types-shared" version = "0.3.1" @@ -2155,7 +2111,7 @@ version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b564d551449738387fb4541aef5fbfceaa81b2b732f2534c1c7c89dc7d673eaa" dependencies = [ - "cocoa 0.25.0", + "cocoa", "crossbeam-channel", "gtk", "keyboard-types", @@ -3408,9 +3364,9 @@ checksum = "3c0dff18fed076d29cb5779e918ef4b8a5dbb756204e4a027794f0bce233d949" dependencies = [ "bitflags 1.3.2", "cc", - "cocoa 0.25.0", + "cocoa", "core-foundation", - "core-graphics 0.23.1", + "core-graphics", "crossbeam-channel", "dispatch", "gdkwayland-sys", @@ -3460,11 +3416,11 @@ checksum = "14c39fd04924ca3a864207c66fc2cd7d22d7c016007f9ce846cbb9326331930a" [[package]] name = "tauri" -version = "2.0.0-alpha.18" +version = "2.0.0-alpha.20" dependencies = [ "anyhow", "bytes", - "cocoa 0.25.0", + "cocoa", "dirs-next", "embed_plist", "futures-util", @@ -3482,7 +3438,6 @@ dependencies = [ "mime", "muda", "objc", - "once_cell", "percent-encoding", "png", "raw-window-handle", @@ -3511,7 +3466,7 @@ dependencies = [ [[package]] name = "tauri-build" -version = "2.0.0-alpha.12" +version = "2.0.0-alpha.13" dependencies = [ "anyhow", "cargo_toml", @@ -3532,7 +3487,7 @@ dependencies = [ [[package]] name = "tauri-codegen" -version = "2.0.0-alpha.11" +version = "2.0.0-alpha.12" dependencies = [ "base64", "brotli", @@ -3556,7 +3511,7 @@ dependencies = [ [[package]] name = "tauri-macros" -version = "2.0.0-alpha.11" +version = "2.0.0-alpha.12" dependencies = [ "heck", "proc-macro2", @@ -3592,7 +3547,7 @@ dependencies = [ [[package]] name = "tauri-runtime" -version = "1.0.0-alpha.5" +version = "1.0.0-alpha.7" dependencies = [ "gtk", "http", @@ -3608,9 +3563,9 @@ dependencies = [ [[package]] name = "tauri-runtime-wry" -version = "1.0.0-alpha.6" +version = "1.0.0-alpha.8" dependencies = [ - "cocoa 0.24.1", + "cocoa", "gtk", "http", "jni", @@ -3627,7 +3582,7 @@ dependencies = [ [[package]] name = "tauri-utils" -version = "2.0.0-alpha.11" +version = "2.0.0-alpha.12" dependencies = [ "aes-gcm", "brotli", @@ -3944,8 +3899,8 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5375d350db4ccd3c783a4c683be535e70df5c62b07a824e7bcd6d43ef6d74181" dependencies = [ - "cocoa 0.25.0", - "core-graphics 0.23.1", + "cocoa", + "core-graphics", "crossbeam-channel", "dirs-next", "libappindicator", @@ -4340,7 +4295,7 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "67ff424735b1ac21293b0492b069394b0a189c8a463fb015a16dea7c2e221c08" dependencies = [ - "cocoa 0.25.0", + "cocoa", "objc", "raw-window-handle", "windows-sys 0.48.0", @@ -4352,7 +4307,7 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5931735e675b972fada30c7a402915d4d827aa5ef6c929c133d640c4b785e963" dependencies = [ - "cocoa 0.25.0", + "cocoa", "objc", "raw-window-handle", "windows-sys 0.48.0", @@ -4664,8 +4619,8 @@ dependencies = [ "base64", "block", "cfg_aliases", - "cocoa 0.25.0", - "core-graphics 0.23.1", + "cocoa", + "core-graphics", "crossbeam-channel", "dunce", "gdkx11", diff --git a/renovate.json b/renovate.json index f3174356f..0ef15aebe 100644 --- a/renovate.json +++ b/renovate.json @@ -22,7 +22,8 @@ "lockFileMaintenance": { "enabled": true }, - "rebaseConflictedPrs": false + "rebaseConflictedPrs": false, + "ignoreDeps": ["cargo_toml", "toml"] }, { "enabled": true, @@ -33,7 +34,8 @@ "lockFileMaintenance": { "enabled": true }, - "rebaseConflictedPrs": false + "rebaseConflictedPrs": false, + "ignoreDeps": ["cargo_toml"] }, { "enabled": true, @@ -78,7 +80,8 @@ "enabled": true }, "rebaseConflictedPrs": false, - "matchManagers": ["cargo"] + "matchManagers": ["cargo"], + "ignoreDeps": ["minisign"] }, { "enabled": true, diff --git a/tooling/api/CHANGELOG.md b/tooling/api/CHANGELOG.md index 6fad1aa17..c32bee261 100644 --- a/tooling/api/CHANGELOG.md +++ b/tooling/api/CHANGELOG.md @@ -128,6 +128,13 @@ - First mobile alpha release! - [fa3a1098](https://www.github.com/tauri-apps/tauri/commit/fa3a10988a03aed1b66fb17d893b1a9adb90f7cd) feat(ci): prepare 2.0.0-alpha.0 ([#5786](https://www.github.com/tauri-apps/tauri/pull/5786)) on 2022-12-08 +## \[1.5.2] + +### Bug Fixes + +- [`50462702`](https://www.github.com/tauri-apps/tauri/commit/504627027303ef5a0e855aab2abea64c6964223b)([#8267](https://www.github.com/tauri-apps/tauri/pull/8267)) Add top-level `main`, `module` and `types` fields in `package.json` to be compliant with typescripts's `"moduleResolution": "node"` +- [`14544e4b`](https://www.github.com/tauri-apps/tauri/commit/14544e4b87269c06c89fed3647d80f492e0a1d34)([#8219](https://www.github.com/tauri-apps/tauri/pull/8219)) Avoid crashing in `clearMocks` + ## \[1.5.1] ### New Features @@ -159,7 +166,7 @@ ## \[1.3.0] -- Return correct type for ` event.payload ` in `onResized` and `onMoved` window event handlers. +- Return correct type for `event.payload` in `onResized` and `onMoved` window event handlers. - [0b46637e](https://www.github.com/tauri-apps/tauri/commit/0b46637ebaba54403afa32a1cb466f09df2db999) fix(api): construct correct object for onResized and onMoved, closes [#6507](https://www.github.com/tauri-apps/tauri/pull/6507) ([#6509](https://www.github.com/tauri-apps/tauri/pull/6509)) on 2023-04-03 - Added the `WindowOptions::contentProtected` option and `WebviewWindow#setContentProtected` to change it at runtime. - [4ab5545b](https://www.github.com/tauri-apps/tauri/commit/4ab5545b7a831c549f3c65e74de487ede3ab7ce5) feat: add content protection api, closes [#5132](https://www.github.com/tauri-apps/tauri/pull/5132) ([#5513](https://www.github.com/tauri-apps/tauri/pull/5513)) on 2022-12-13 @@ -296,65 +303,84 @@ ## \[1.0.0-rc.0] - Add `fileDropEnabled` property to `WindowOptions` so you can now disable it when creating windows from js. + - [1bfc32a3](https://www.github.com/tauri-apps/tauri/commit/1bfc32a3b2f31b962ce8a5c611b60cb008360923) fix(api.js): add `fileDropEnabled` to `WindowOptions`, closes [#2968](https://www.github.com/tauri-apps/tauri/pull/2968) ([#2989](https://www.github.com/tauri-apps/tauri/pull/2989)) on 2021-12-09 - Add `logDir` function to the `path` module to access the suggested log directory. Add `BaseDirectory.Log` to the `fs` module. + - [acbb3ae7](https://www.github.com/tauri-apps/tauri/commit/acbb3ae7bb0165846b9456aea103269f027fc548) feat: add Log directory ([#2736](https://www.github.com/tauri-apps/tauri/pull/2736)) on 2021-10-16 - [62c7a8ad](https://www.github.com/tauri-apps/tauri/commit/62c7a8ad30fd3031b8679960590e5ef3eef8e4da) chore(covector): prepare for `rc` release ([#3376](https://www.github.com/tauri-apps/tauri/pull/3376)) on 2022-02-10 - Expose `ask`, `message` and `confirm` APIs on the dialog module. + - [e98c1af4](https://www.github.com/tauri-apps/tauri/commit/e98c1af44279a5ff6c8a6f0a506ecc219c9f77af) feat(core): expose message dialog APIs, fix window.confirm, implement HasRawWindowHandle for Window, closes [#2535](https://www.github.com/tauri-apps/tauri/pull/2535) ([#2700](https://www.github.com/tauri-apps/tauri/pull/2700)) on 2021-10-02 - Event `emit` now automatically serialize non-string types. + - [06000996](https://www.github.com/tauri-apps/tauri/commit/060009969627890fa9018e2f1105bad13299394c) feat(api): support unknown types for event emit payload, closes [#2929](https://www.github.com/tauri-apps/tauri/pull/2929) ([#2964](https://www.github.com/tauri-apps/tauri/pull/2964)) on 2022-01-07 - Fix `http.fetch` throwing error if the response is successful but the body is empty. + - [50c63900](https://www.github.com/tauri-apps/tauri/commit/50c63900c7313064037e2ceb798a6432fcd1bcda) fix(api.js): fix `http.fetch` throwing error if response body is empty, closes [#2831](https://www.github.com/tauri-apps/tauri/pull/2831) ([#3008](https://www.github.com/tauri-apps/tauri/pull/3008)) on 2021-12-09 - Add `title` option to file open/save dialogs. + - [e1d6a6e6](https://www.github.com/tauri-apps/tauri/commit/e1d6a6e6445637723e2331ca799a662e720e15a8) Create api-file-dialog-title.md ([#3235](https://www.github.com/tauri-apps/tauri/pull/3235)) on 2022-01-16 - [62c7a8ad](https://www.github.com/tauri-apps/tauri/commit/62c7a8ad30fd3031b8679960590e5ef3eef8e4da) chore(covector): prepare for `rc` release ([#3376](https://www.github.com/tauri-apps/tauri/pull/3376)) on 2022-02-10 - Fix `os.platform` returning `macos` and `windows` instead of `darwin` and `win32`. + - [3924c3d8](https://www.github.com/tauri-apps/tauri/commit/3924c3d85365df30b376a1ec6c2d933460d66af0) fix(api.js): fix `os.platform` return on macos and windows, closes [#2698](https://www.github.com/tauri-apps/tauri/pull/2698) ([#2699](https://www.github.com/tauri-apps/tauri/pull/2699)) on 2021-10-02 - The `formatCallback` helper function now returns a number instead of a string. + - [a48b8b18](https://www.github.com/tauri-apps/tauri/commit/a48b8b18d428bcc404d489daa690bbefe1f57311) feat(core): validate callbacks and event names \[TRI-038] \[TRI-020] ([#21](https://www.github.com/tauri-apps/tauri/pull/21)) on 2022-01-09 - Added `rawHeaders` to `http > Response`. + - [b7a2345b](https://www.github.com/tauri-apps/tauri/commit/b7a2345b06ca0306988b4ba3d3deadd449e65af9) feat(core): add raw headers to HTTP API, closes [#2695](https://www.github.com/tauri-apps/tauri/pull/2695) ([#3053](https://www.github.com/tauri-apps/tauri/pull/3053)) on 2022-01-07 - Removed the `currentDir` API from the `path` module. + - [a08509c6](https://www.github.com/tauri-apps/tauri/commit/a08509c641f43695e25944a2dd47697b18cd83e2) fix(api): remove `currentDir` API from the `path` module on 2022-02-04 - Remove `.ts` files on the published package. + - [0f321ac0](https://www.github.com/tauri-apps/tauri/commit/0f321ac08d56412edd5bc9d166201fbc95d887d8) fix(api): do not ship TS files, closes [#2598](https://www.github.com/tauri-apps/tauri/pull/2598) ([#2645](https://www.github.com/tauri-apps/tauri/pull/2645)) on 2021-09-23 - **Breaking change:** Replaces all usages of `number[]` with `Uint8Array` to be closer aligned with the wider JS ecosystem. + - [9b19a805](https://www.github.com/tauri-apps/tauri/commit/9b19a805aa8efa64b22f2dfef193a144b8e0cee3) fix(api.js) Replace `number[]`with `Uint8Array`. fixes [#3306](https://www.github.com/tauri-apps/tauri/pull/3306) ([#3305](https://www.github.com/tauri-apps/tauri/pull/3305)) on 2022-02-05 - `WindowManager` methods `innerPosition` `outerPosition` now correctly return instance of `PhysicalPosition`. `WindowManager` methods `innerSize` `outerSize` now correctly return instance of `PhysicalSize`. + - [cc8b1468](https://www.github.com/tauri-apps/tauri/commit/cc8b1468c821df53ceb771061c919409a9c80978) Fix(api): Window size and position returning wrong class (fix: [#2599](https://www.github.com/tauri-apps/tauri/pull/2599)) ([#2621](https://www.github.com/tauri-apps/tauri/pull/2621)) on 2021-09-22 - Change the `event` field of the `Event` interface to type `EventName` instead of `string`. + - [b5d9bcb4](https://www.github.com/tauri-apps/tauri/commit/b5d9bcb402380abc86ae1fa1a77c629af2275f9d) Consistent event name usage ([#3228](https://www.github.com/tauri-apps/tauri/pull/3228)) on 2022-01-15 - [62c7a8ad](https://www.github.com/tauri-apps/tauri/commit/62c7a8ad30fd3031b8679960590e5ef3eef8e4da) chore(covector): prepare for `rc` release ([#3376](https://www.github.com/tauri-apps/tauri/pull/3376)) on 2022-02-10 - Now `resolve()`, `join()` and `normalize()` from the `path` module, won't throw errors if the path doesn't exist, which matches NodeJS behavior. + - [fe381a0b](https://www.github.com/tauri-apps/tauri/commit/fe381a0bde86ebf4014007f6e21af4c1a9e58cef) fix: `join` no longer cares if path doesn't exist, closes [#2499](https://www.github.com/tauri-apps/tauri/pull/2499) ([#2548](https://www.github.com/tauri-apps/tauri/pull/2548)) on 2021-09-21 - Fixes the dialog `defaultPath` usage on Linux. + - [2212bd5d](https://www.github.com/tauri-apps/tauri/commit/2212bd5d75146f5a2df27cc2157a057642f626da) fix: dialog default path on Linux, closes [#3091](https://www.github.com/tauri-apps/tauri/pull/3091) ([#3123](https://www.github.com/tauri-apps/tauri/pull/3123)) on 2021-12-27 - Fixes `window.label` property returning null instead of the actual label. + - [f5109e0c](https://www.github.com/tauri-apps/tauri/commit/f5109e0c962e3d25404995194968bade1be33b16) fix(api): window label null instead of actual value, closes [#3295](https://www.github.com/tauri-apps/tauri/pull/3295) ([#3332](https://www.github.com/tauri-apps/tauri/pull/3332)) on 2022-02-04 - Remove the `BaseDirectory::Current` enum variant for security reasons. + - [696dca58](https://www.github.com/tauri-apps/tauri/commit/696dca58a9f8ee127a1cf857eb848e09f5845d18) refactor(core): remove `BaseDirectory::Current` variant on 2022-01-26 - Change `WindowLabel` type to `string`. + - [f68603ae](https://www.github.com/tauri-apps/tauri/commit/f68603aee4e16500dff9e385b217f5dd8b1b39e8) chore(docs): simplify event system documentation on 2021-09-27 - When building Universal macOS Binaries through the virtual target `universal-apple-darwin`: @@ -423,7 +449,7 @@ ## \[1.0.0-beta.3] - Export `Response` and `ResponseType` as value instead of type. - - [394b6e05](https://www.github.com/tauri-apps/tauri/commit/394b6e0572e7a0a92e103e462a7f603f7d569319) fix(api): http `ResponseType` export type error ([#2065](https://www.github.com/tauri-apps/tauri/pull/2065)) on 2021-06-24 + - [394b6e05](https://www.github.com/tauri-apps/tauri/commit/394b6e0572e7a0a92e103e462a7f603f7d569319) fix(api): http `ResponseType` export type error ([#2065](https://www.github.com/tauri-apps/tauri/pull/2065)) on 2021-06-24 ## \[1.0.0-beta.2] diff --git a/tooling/api/src/mocks.ts b/tooling/api/src/mocks.ts index 44b7a4ab7..f7fcd8805 100644 --- a/tooling/api/src/mocks.ts +++ b/tooling/api/src/mocks.ts @@ -196,10 +196,13 @@ export function clearMocks(): void { return } - // @ts-expect-error "The operand of a 'delete' operator must be optional' does not matter in this case - delete window.__TAURI_INTERNALS__.convertFileSrc - // @ts-expect-error "The operand of a 'delete' operator must be optional' does not matter in this case - delete window.__TAURI_INTERNALS__.ipc - // @ts-expect-error "The operand of a 'delete' operator must be optional' does not matter in this case - delete window.__TAURI_INTERNALS__.metadata + if (window.__TAURI_INTERNALS__?.convertFileSrc) + // @ts-expect-error "The operand of a 'delete' operator must be optional' does not matter in this case + delete window.__TAURI_INTERNALS__.convertFileSrc + if (window.__TAURI_INTERNALS__?.ipc) + // @ts-expect-error "The operand of a 'delete' operator must be optional' does not matter in this case + delete window.__TAURI_INTERNALS__.ipc + if (window.__TAURI_INTERNALS__?.metadata) + // @ts-expect-error "The operand of a 'delete' operator must be optional' does not matter in this case + delete window.__TAURI_INTERNALS__.metadata } diff --git a/tooling/api/yarn.lock b/tooling/api/yarn.lock index 2b7edd7cd..8b9349016 100644 --- a/tooling/api/yarn.lock +++ b/tooling/api/yarn.lock @@ -1245,6 +1245,13 @@ is-typed-array@^1.1.10, is-typed-array@^1.1.12, is-typed-array@^1.1.9: dependencies: which-typed-array "^1.1.11" +is-typed-array@^1.1.12: + version "1.1.12" + resolved "https://registry.yarnpkg.com/is-typed-array/-/is-typed-array-1.1.12.tgz#d0bab5686ef4a76f7a73097b95470ab199c57d4a" + integrity sha512-Z14TF2JNG8Lss5/HMqt0//T9JeHXttXy5pH/DBU4vi98ozO2btxzq9MwYDZYnKwU8nRsz/+GVFVRDq3DkVuSPg== + dependencies: + which-typed-array "^1.1.11" + is-weakref@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/is-weakref/-/is-weakref-1.0.2.tgz#9529f383a9338205e89765e0392efc2f100f06f2" diff --git a/tooling/bundler/CHANGELOG.md b/tooling/bundler/CHANGELOG.md index 451660c4d..186139381 100644 --- a/tooling/bundler/CHANGELOG.md +++ b/tooling/bundler/CHANGELOG.md @@ -103,6 +103,28 @@ - First mobile alpha release! - [fa3a1098](https://www.github.com/tauri-apps/tauri/commit/fa3a10988a03aed1b66fb17d893b1a9adb90f7cd) feat(ci): prepare 2.0.0-alpha.0 ([#5786](https://www.github.com/tauri-apps/tauri/pull/5786)) on 2022-12-08 +## \[1.4.7] + +### Bug Fixes + +- [`777ddf43`](https://www.github.com/tauri-apps/tauri/commit/777ddf434a966966dc8918322c1ec9ee3f822ee2)([#8376](https://www.github.com/tauri-apps/tauri/pull/8376)) Unset `NSISDIR` and `NSISCONFDIR` when running `makensis.exe` so it doesn't conflict with NSIS installed by the user. +- [`5ff9d459`](https://www.github.com/tauri-apps/tauri/commit/5ff9d4592a6dd8fc93165012ef367d78ea06e4ce)([#8390](https://www.github.com/tauri-apps/tauri/pull/8390)) NSIS perUser installers will now only check if the app is running on the current user. + +## \[1.4.6] + +### Bug Fixes + +- [`1d5aa38a`](https://www.github.com/tauri-apps/tauri/commit/1d5aa38ae418ea31f593590b6d32cf04d3bfd8c1)([#8162](https://www.github.com/tauri-apps/tauri/pull/8162)) Fixes errors on command output, occuring when the output stream contains an invalid UTF-8 character, or ends with a multi-bytes UTF-8 character. +- [`977a39f4`](https://www.github.com/tauri-apps/tauri/commit/977a39f4f7fb5e47492b51df931643b1af4f92b0)([#8292](https://www.github.com/tauri-apps/tauri/pull/8292)) Migrate the WebView2 offline installer to use shorturl provided by Microsoft. +- [`f26d9f08`](https://www.github.com/tauri-apps/tauri/commit/f26d9f0884f63f61b9f4d4fac15e6b251163793e)([#8263](https://www.github.com/tauri-apps/tauri/pull/8263)) Fixes an issue in the NSIS installer which caused the uninstallation to leave empty folders on the system if the `resources` feature was used. +- [`92bc7d0e`](https://www.github.com/tauri-apps/tauri/commit/92bc7d0e16157434330a1bcf1eefda6f0f1e5f85)([#8233](https://www.github.com/tauri-apps/tauri/pull/8233)) Fixes an issue in the NSIS installer which caused the installation to take much longer than expected when many `resources` were added to the bundle. + +## \[1.4.5] + +### Enhancements + +- [`cfe6fa6c`](https://www.github.com/tauri-apps/tauri/commit/cfe6fa6c91a8cc177d4665ba04dad32ba545159d)([#8061](https://www.github.com/tauri-apps/tauri/pull/8061)) Added German language support to the NSIS bundler. + ## \[1.4.4] ### Enhancements diff --git a/tooling/bundler/Cargo.toml b/tooling/bundler/Cargo.toml index 99f0d51a9..2d7b75f98 100644 --- a/tooling/bundler/Cargo.toml +++ b/tooling/bundler/Cargo.toml @@ -27,7 +27,7 @@ serde = { version = "1.0", features = [ "derive" ] } strsim = "0.10.0" tar = "0.4.40" walkdir = "2" -handlebars = "4.4" +handlebars = "4.5" tempfile = "3.8.1" log = { version = "0.4.20", features = [ "kv_unstable" ] } dirs-next = "2.0" diff --git a/tooling/bundler/src/bundle/common.rs b/tooling/bundler/src/bundle/common.rs index 10e2fa195..2332fc49a 100644 --- a/tooling/bundler/src/bundle/common.rs +++ b/tooling/bundler/src/bundle/common.rs @@ -164,11 +164,14 @@ impl CommandExt for Command { let mut lines = stdout_lines_.lock().unwrap(); loop { line.clear(); - if let Ok(0) = stdout.read_line(&mut line) { - break; + match stdout.read_line(&mut line) { + Ok(0) => break, + Ok(_) => { + debug!(action = "stdout"; "{}", line.trim_end()); + lines.extend(line.as_bytes().to_vec()); + } + Err(_) => (), } - debug!(action = "stdout"; "{}", &line[0..line.len() - 1]); - lines.extend(line.as_bytes().to_vec()); } }); @@ -180,11 +183,14 @@ impl CommandExt for Command { let mut lines = stderr_lines_.lock().unwrap(); loop { line.clear(); - if let Ok(0) = stderr.read_line(&mut line) { - break; + match stderr.read_line(&mut line) { + Ok(0) => break, + Ok(_) => { + debug!(action = "stderr"; "{}", line.trim_end()); + lines.extend(line.as_bytes().to_vec()); + } + Err(_) => (), } - debug!(action = "stderr"; "{}", &line[0..line.len() - 1]); - lines.extend(line.as_bytes().to_vec()); } }); diff --git a/tooling/bundler/src/bundle/windows/msi/wix.rs b/tooling/bundler/src/bundle/windows/msi/wix.rs index 04cca3ad4..7f1313433 100644 --- a/tooling/bundler/src/bundle/windows/msi/wix.rs +++ b/tooling/bundler/src/bundle/windows/msi/wix.rs @@ -10,9 +10,8 @@ use crate::bundle::{ windows::{ sign::try_sign, util::{ - download, download_and_verify, extract_zip, HashAlgorithm, WEBVIEW2_BOOTSTRAPPER_URL, - WEBVIEW2_X64_OFFLINE_INSTALLER_GUID, WEBVIEW2_X86_OFFLINE_INSTALLER_GUID, - WIX_OUTPUT_FOLDER_NAME, WIX_UPDATER_OUTPUT_FOLDER_NAME, + download_and_verify, download_webview2_bootstrapper, download_webview2_offline_installer, + extract_zip, HashAlgorithm, WIX_OUTPUT_FOLDER_NAME, WIX_UPDATER_OUTPUT_FOLDER_NAME, }, }, }; @@ -473,42 +472,15 @@ pub fn build_wix_app_installer( ); } WebviewInstallMode::EmbedBootstrapper { silent: _ } => { - let webview2_bootstrapper_path = output_path.join("MicrosoftEdgeWebview2Setup.exe"); - std::fs::write( - &webview2_bootstrapper_path, - download(WEBVIEW2_BOOTSTRAPPER_URL)?, - )?; + let webview2_bootstrapper_path = download_webview2_bootstrapper(&output_path)?; data.insert( "webview2_bootstrapper_path", to_json(webview2_bootstrapper_path), ); } WebviewInstallMode::OfflineInstaller { silent: _ } => { - let guid = if arch == "x64" { - WEBVIEW2_X64_OFFLINE_INSTALLER_GUID - } else { - WEBVIEW2_X86_OFFLINE_INSTALLER_GUID - }; - let offline_installer_path = dirs_next::cache_dir() - .unwrap() - .join("tauri") - .join("Webview2OfflineInstaller") - .join(guid) - .join(arch); - create_dir_all(&offline_installer_path)?; let webview2_installer_path = - offline_installer_path.join("MicrosoftEdgeWebView2RuntimeInstaller.exe"); - if !webview2_installer_path.exists() { - std::fs::write( - &webview2_installer_path, - download( - &format!("https://msedge.sf.dl.delivery.mp.microsoft.com/filestreamingservice/files/{}/MicrosoftEdgeWebView2RuntimeInstaller{}.exe", - guid, - arch.to_uppercase(), - ), - )?, - )?; - } + download_webview2_offline_installer(&output_path.join(arch), arch)?; data.insert("webview2_installer_path", to_json(webview2_installer_path)); } } diff --git a/tooling/bundler/src/bundle/windows/nsis.rs b/tooling/bundler/src/bundle/windows/nsis.rs index 0b59a15a6..308f822aa 100644 --- a/tooling/bundler/src/bundle/windows/nsis.rs +++ b/tooling/bundler/src/bundle/windows/nsis.rs @@ -8,9 +8,9 @@ use crate::{ bundle::{ common::CommandExt, windows::util::{ - download, download_and_verify, extract_zip, HashAlgorithm, NSIS_OUTPUT_FOLDER_NAME, - NSIS_UPDATER_OUTPUT_FOLDER_NAME, WEBVIEW2_BOOTSTRAPPER_URL, - WEBVIEW2_X64_OFFLINE_INSTALLER_GUID, WEBVIEW2_X86_OFFLINE_INSTALLER_GUID, + download, download_and_verify, download_webview2_bootstrapper, + download_webview2_offline_installer, extract_zip, HashAlgorithm, NSIS_OUTPUT_FOLDER_NAME, + NSIS_UPDATER_OUTPUT_FOLDER_NAME, }, }, Settings, @@ -37,8 +37,8 @@ const NSIS_URL: &str = const NSIS_SHA1: &str = "057e83c7d82462ec394af76c87d06733605543d4"; const NSIS_APPLICATIONID_URL: &str = "https://github.com/tauri-apps/binary-releases/releases/download/nsis-plugins-v0/NSIS-ApplicationID.zip"; const NSIS_TAURI_UTILS: &str = - "https://github.com/tauri-apps/nsis-tauri-utils/releases/download/nsis_tauri_utils-v0.2.1/nsis_tauri_utils.dll"; -const NSIS_TAURI_UTILS_SHA1: &str = "53A7CFAEB6A4A9653D6D5FBFF02A3C3B8720130A"; + "https://github.com/tauri-apps/nsis-tauri-utils/releases/download/nsis_tauri_utils-v0.2.2/nsis_tauri_utils.dll"; +const NSIS_TAURI_UTILS_SHA1: &str = "16DF1D1A5B4D5DF3859447279C55BE36D4109DFB"; #[cfg(target_os = "windows")] const NSIS_REQUIRED_FILES: &[&str] = &[ @@ -290,23 +290,38 @@ fn build_nsis_app_installer( .iter() .find(|bin| bin.main()) .ok_or_else(|| anyhow::anyhow!("Failed to get main binary"))?; + let main_binary_path = settings.binary_path(main_binary).with_extension("exe"); data.insert( "main_binary_name", to_json(main_binary.name().replace(".exe", "")), ); - data.insert( - "main_binary_path", - to_json(settings.binary_path(main_binary).with_extension("exe")), - ); + data.insert("main_binary_path", to_json(&main_binary_path)); let out_file = "nsis-output.exe"; data.insert("out_file", to_json(out_file)); let resources = generate_resource_data(settings)?; - data.insert("resources", to_json(resources)); + let resources_dirs = + std::collections::HashSet::::from_iter(resources.values().map(|r| r.0.to_owned())); + + let mut resources_ancestors = resources_dirs + .iter() + .flat_map(|p| p.ancestors()) + .collect::>(); + resources_ancestors.sort_unstable(); + resources_ancestors.dedup(); + resources_ancestors.sort_by_key(|p| std::cmp::Reverse(p.components().count())); + resources_ancestors.pop(); // Last one is always "" + + data.insert("resources_ancestors", to_json(resources_ancestors)); + data.insert("resources_dirs", to_json(resources_dirs)); + data.insert("resources", to_json(&resources)); let binaries = generate_binaries_data(settings)?; - data.insert("binaries", to_json(binaries)); + data.insert("binaries", to_json(&binaries)); + + let estimated_size = generate_estimated_size(&main_binary_path, &binaries, &resources)?; + data.insert("estimated_size", to_json(estimated_size)); if let Some(file_associations) = &settings.file_associations() { data.insert("file_associations", to_json(file_associations)); @@ -359,40 +374,15 @@ fn build_nsis_app_installer( match webview2_install_mode { WebviewInstallMode::EmbedBootstrapper { silent: _ } => { - let webview2_bootstrapper_path = tauri_tools_path.join("MicrosoftEdgeWebview2Setup.exe"); - std::fs::write( - &webview2_bootstrapper_path, - download(WEBVIEW2_BOOTSTRAPPER_URL)?, - )?; + let webview2_bootstrapper_path = download_webview2_bootstrapper(tauri_tools_path)?; data.insert( "webview2_bootstrapper_path", to_json(webview2_bootstrapper_path), ); } WebviewInstallMode::OfflineInstaller { silent: _ } => { - let guid = if arch == "x64" { - WEBVIEW2_X64_OFFLINE_INSTALLER_GUID - } else { - WEBVIEW2_X86_OFFLINE_INSTALLER_GUID - }; - let offline_installer_path = tauri_tools_path - .join("Webview2OfflineInstaller") - .join(guid) - .join(arch); - create_dir_all(&offline_installer_path)?; let webview2_installer_path = - offline_installer_path.join("MicrosoftEdgeWebView2RuntimeInstaller.exe"); - if !webview2_installer_path.exists() { - std::fs::write( - &webview2_installer_path, - download( - &format!("https://msedge.sf.dl.delivery.mp.microsoft.com/filestreamingservice/files/{}/MicrosoftEdgeWebView2RuntimeInstaller{}.exe", - guid, - arch.to_uppercase(), - ), - )?, - )?; - } + download_webview2_offline_installer(&tauri_tools_path.join(arch), arch)?; data.insert("webview2_installer_path", to_json(webview2_installer_path)); } _ => {} @@ -479,6 +469,8 @@ fn build_nsis_app_installer( _ => "-V4", }) .arg(installer_nsi_path) + .env_remove("NSISDIR") + .env_remove("NSISCONFDIR") .current_dir(output_path) .piped() .context("error running makensis.exe")?; @@ -600,6 +592,24 @@ fn generate_binaries_data(settings: &Settings) -> crate::Result { Ok(binaries) } +fn generate_estimated_size( + main: &Path, + binaries: &BinariesMap, + resources: &ResourcesMap, +) -> crate::Result { + use std::fs::metadata; + + let mut size = metadata(main)?.len(); + + for k in binaries.keys().chain(resources.keys()) { + size += metadata(k)?.len(); + } + + size /= 1000; + + Ok(format!("{size:#08x}")) +} + fn get_lang_data( lang: &str, custom_lang_files: Option<&HashMap>, diff --git a/tooling/bundler/src/bundle/windows/templates/installer.nsi b/tooling/bundler/src/bundle/windows/templates/installer.nsi index 227f6bcb9..1d097cb33 100644 --- a/tooling/bundler/src/bundle/windows/templates/installer.nsi +++ b/tooling/bundler/src/bundle/windows/templates/installer.nsi @@ -41,6 +41,7 @@ ${StrLoc} !define UNINSTKEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCTNAME}" !define MANUPRODUCTKEY "Software\${MANUFACTURER}\${PRODUCTNAME}" !define UNINSTALLERSIGNCOMMAND "{{uninstaller_sign_cmd}}" +!define ESTIMATEDSIZE "{{estimated_size}}" Name "${PRODUCTNAME}" BrandingText "${COPYRIGHT}" @@ -493,13 +494,21 @@ Section WebView2 SectionEnd !macro CheckIfAppIsRunning - nsis_tauri_utils::FindProcess "${MAINBINARYNAME}.exe" + !if "${INSTALLMODE}" == "currentUser" + nsis_tauri_utils::FindProcessCurrentUser "${MAINBINARYNAME}.exe" + !else + nsis_tauri_utils::FindProcess "${MAINBINARYNAME}.exe" + !endif Pop $R0 ${If} $R0 = 0 IfSilent kill 0 ${IfThen} $PassiveMode != 1 ${|} MessageBox MB_OKCANCEL "$(appRunningOkKill)" IDOK kill IDCANCEL cancel ${|} kill: - nsis_tauri_utils::KillProcess "${MAINBINARYNAME}.exe" + !if "${INSTALLMODE}" == "currentUser" + nsis_tauri_utils::KillProcessCurrentUser "${MAINBINARYNAME}.exe" + !else + nsis_tauri_utils::KillProcess "${MAINBINARYNAME}.exe" + !endif Pop $R0 Sleep 500 ${If} $R0 = 0 @@ -523,31 +532,25 @@ SectionEnd app_check_done: !macroend -Var AppSize Section Install SetOutPath $INSTDIR - StrCpy $AppSize 0 !insertmacro CheckIfAppIsRunning ; Copy main executable File "${MAINBINARYSRCPATH}" - ${GetSize} "$INSTDIR" "/M=${MAINBINARYNAME}.exe /S=0B" $0 $1 $2 - IntOp $AppSize $AppSize + $0 ; Copy resources + {{#each resources_dirs}} + CreateDirectory "$INSTDIR\\{{this}}" + {{/each}} {{#each resources}} - CreateDirectory "$INSTDIR\\{{this.[0]}}" File /a "/oname={{this.[1]}}" "{{@key}}" - ${GetSize} "$INSTDIR" "/M={{this.[1]}} /S=0B" $0 $1 $2 - IntOp $AppSize $AppSize + $0 {{/each}} ; Copy external binaries {{#each binaries}} File /a "/oname={{this}}" "{{@key}}" - ${GetSize} "$INSTDIR" "/M={{this}} /S=0B" $0 $1 $2 - IntOp $AppSize $AppSize + $0 {{/each}} ; Create file associations @@ -578,9 +581,7 @@ Section Install WriteRegStr SHCTX "${UNINSTKEY}" "UninstallString" "$\"$INSTDIR\uninstall.exe$\"" WriteRegDWORD SHCTX "${UNINSTKEY}" "NoModify" "1" WriteRegDWORD SHCTX "${UNINSTKEY}" "NoRepair" "1" - IntOp $AppSize $AppSize / 1000 - IntFmt $AppSize "0x%08X" $AppSize - WriteRegDWORD SHCTX "${UNINSTKEY}" "EstimatedSize" "$AppSize" + WriteRegDWORD SHCTX "${UNINSTKEY}" "EstimatedSize" "${ESTIMATEDSIZE}" ; Create start menu shortcut (GUI) !insertmacro MUI_STARTMENU_WRITE_BEGIN Application @@ -637,7 +638,6 @@ Section Uninstall ; Delete resources {{#each resources}} Delete "$INSTDIR\\{{this.[1]}}" - RMDir "$INSTDIR\\{{this.[0]}}" {{/each}} ; Delete external binaries @@ -655,7 +655,14 @@ Section Uninstall ; Delete uninstaller Delete "$INSTDIR\uninstall.exe" - RMDir "$INSTDIR" + ${If} $DeleteAppDataCheckboxState == 1 + RMDir /R /REBOOTOK "$INSTDIR" + ${Else} + {{#each resources_ancestors}} + RMDir /REBOOTOK "$INSTDIR\\{{this}}" + {{/each}} + RMDir "$INSTDIR" + ${EndIf} ; Remove start menu shortcut !insertmacro MUI_STARTMENU_GETFOLDER Application $AppStartMenuFolder diff --git a/tooling/bundler/src/bundle/windows/util.rs b/tooling/bundler/src/bundle/windows/util.rs index e27d91432..a9d4e3df6 100644 --- a/tooling/bundler/src/bundle/windows/util.rs +++ b/tooling/bundler/src/bundle/windows/util.rs @@ -5,7 +5,7 @@ use std::{ fs::{create_dir_all, File}, io::{Cursor, Read, Write}, - path::Path, + path::{Path, PathBuf}, }; use log::info; @@ -13,13 +13,61 @@ use sha2::Digest; use zip::ZipArchive; pub const WEBVIEW2_BOOTSTRAPPER_URL: &str = "https://go.microsoft.com/fwlink/p/?LinkId=2124703"; -pub const WEBVIEW2_X86_OFFLINE_INSTALLER_GUID: &str = "2c122012-898d-4a69-9ab6-aa50bbe81031"; -pub const WEBVIEW2_X64_OFFLINE_INSTALLER_GUID: &str = "0af26c79-02f0-4f06-a12d-116bc05ca860"; +pub const WEBVIEW2_OFFLINE_INSTALLER_X86_URL: &str = + "https://go.microsoft.com/fwlink/?linkid=2099617"; +pub const WEBVIEW2_OFFLINE_INSTALLER_X64_URL: &str = + "https://go.microsoft.com/fwlink/?linkid=2124701"; +pub const WEBVIEW2_URL_PREFIX: &str = + "https://msedge.sf.dl.delivery.mp.microsoft.com/filestreamingservice/files/"; pub const NSIS_OUTPUT_FOLDER_NAME: &str = "nsis"; pub const NSIS_UPDATER_OUTPUT_FOLDER_NAME: &str = "nsis-updater"; pub const WIX_OUTPUT_FOLDER_NAME: &str = "msi"; pub const WIX_UPDATER_OUTPUT_FOLDER_NAME: &str = "msi-updater"; +pub fn webview2_guid_path(url: &str) -> crate::Result<(String, String)> { + let agent = ureq::AgentBuilder::new().try_proxy_from_env(true).build(); + let response = agent.head(url).call().map_err(Box::new)?; + let final_url = response.get_url(); + let remaining_url = final_url.strip_prefix(WEBVIEW2_URL_PREFIX).ok_or_else(|| { + anyhow::anyhow!( + "WebView2 URL prefix mismatch. Expected `{}`, found `{}`.", + WEBVIEW2_URL_PREFIX, + final_url + ) + })?; + let (guid, filename) = remaining_url.split_once('/').ok_or_else(|| { + anyhow::anyhow!( + "WebView2 URL format mismatch. Expected `/`, found `{}`.", + remaining_url + ) + })?; + Ok((guid.into(), filename.into())) +} + +pub fn download_webview2_bootstrapper(base_path: &Path) -> crate::Result { + let file_path = base_path.join("MicrosoftEdgeWebview2Setup.exe"); + if !file_path.exists() { + std::fs::write(&file_path, download(WEBVIEW2_BOOTSTRAPPER_URL)?)?; + } + Ok(file_path) +} + +pub fn download_webview2_offline_installer(base_path: &Path, arch: &str) -> crate::Result { + let url = if arch == "x64" { + WEBVIEW2_OFFLINE_INSTALLER_X64_URL + } else { + WEBVIEW2_OFFLINE_INSTALLER_X86_URL + }; + let (guid, filename) = webview2_guid_path(url)?; + let dir_path = base_path.join(guid); + let file_path = dir_path.join(filename); + if !file_path.exists() { + create_dir_all(dir_path)?; + std::fs::write(&file_path, download(url)?)?; + } + Ok(file_path) +} + pub fn download(url: &str) -> crate::Result> { info!(action = "Downloading"; "{}", url); diff --git a/tooling/cli/CHANGELOG.md b/tooling/cli/CHANGELOG.md index 788d52c79..82c46886d 100644 --- a/tooling/cli/CHANGELOG.md +++ b/tooling/cli/CHANGELOG.md @@ -305,6 +305,34 @@ - First mobile alpha release! - [fa3a1098](https://www.github.com/tauri-apps/tauri/commit/fa3a10988a03aed1b66fb17d893b1a9adb90f7cd) feat(ci): prepare 2.0.0-alpha.0 ([#5786](https://www.github.com/tauri-apps/tauri/pull/5786)) on 2022-12-08 +## \[1.5.8] + +### Dependencies + +- Upgraded to `tauri-bundler@1.4.7` + +## \[1.5.7] + +### Bug Fixes + +- [`1d5aa38a`](https://www.github.com/tauri-apps/tauri/commit/1d5aa38ae418ea31f593590b6d32cf04d3bfd8c1)([#8162](https://www.github.com/tauri-apps/tauri/pull/8162)) Fixes errors on command output, occuring when the output stream contains an invalid UTF-8 character, or ends with a multi-bytes UTF-8 character. +- [`f26d9f08`](https://www.github.com/tauri-apps/tauri/commit/f26d9f0884f63f61b9f4d4fac15e6b251163793e)([#8263](https://www.github.com/tauri-apps/tauri/pull/8263)) Fixes an issue in the NSIS installer which caused the uninstallation to leave empty folders on the system if the `resources` feature was used. +- [`92bc7d0e`](https://www.github.com/tauri-apps/tauri/commit/92bc7d0e16157434330a1bcf1eefda6f0f1e5f85)([#8233](https://www.github.com/tauri-apps/tauri/pull/8233)) Fixes an issue in the NSIS installer which caused the installation to take much longer than expected when many `resources` were added to the bundle. + +### Dependencies + +- Upgraded to `tauri-bundler@1.4.6` + +## \[1.5.6] + +### Bug Fixes + +- [`5264e41d`](https://www.github.com/tauri-apps/tauri/commit/5264e41db3763e4c2eb0c3c21bd423fb7bece3e2)([#8082](https://www.github.com/tauri-apps/tauri/pull/8082)) Downgraded `rust-minisign` to `0.7.3` to fix signing updater bundles with empty passwords. + +### Dependencies + +- Upgraded to `tauri-bundler@1.4.5` + ## \[1.5.5] ### Enhancements diff --git a/tooling/cli/Cargo.lock b/tooling/cli/Cargo.lock index afe9f3f42..904dfe7f1 100644 --- a/tooling/cli/Cargo.lock +++ b/tooling/cli/Cargo.lock @@ -577,9 +577,9 @@ dependencies = [ [[package]] name = "core-foundation" -version = "0.9.3" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" dependencies = [ "core-foundation-sys", "libc", @@ -587,9 +587,9 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.4" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" +checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" [[package]] name = "core2" @@ -793,9 +793,9 @@ checksum = "7762d17f1241643615821a8455a0b2c3e803784b058693d990b11f2dce25a0ca" [[package]] name = "data-encoding" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308" +checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5" [[package]] name = "data-url" @@ -1133,9 +1133,9 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "form_urlencoded" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" dependencies = [ "percent-encoding", ] @@ -1327,9 +1327,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.28.0" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" [[package]] name = "glob" @@ -1339,15 +1339,15 @@ checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] name = "globset" -version = "0.4.13" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "759c97c1e17c55525b57192c06a267cda0ac5210b222d6b82189a2338fa1c13d" +checksum = "57da3b9b5b85bd66f31093f8c408b90a74431672542466497dcbdfdc02034be1" dependencies = [ "aho-corasick", "bstr", - "fnv", "log", - "regex", + "regex-automata", + "regex-syntax", ] [[package]] @@ -1561,9 +1561,9 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "idna" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" dependencies = [ "unicode-bidi", "unicode-normalization", @@ -1571,17 +1571,16 @@ dependencies = [ [[package]] name = "ignore" -version = "0.4.20" +version = "0.4.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbe7873dab538a9a44ad79ede1faf5f30d49f9a5c883ddbab48bce81b64b7492" +checksum = "747ad1b4ae841a78e8aba0d63adbfbeaea26b517b63705d47856b73015d27060" dependencies = [ + "crossbeam-deque", "globset", - "lazy_static", "log", "memchr", - "regex", + "regex-automata", "same-file", - "thread_local", "walkdir", "winapi-util", ] @@ -2625,9 +2624,9 @@ dependencies = [ [[package]] name = "percent-encoding" -version = "2.3.0" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pest" @@ -2933,9 +2932,9 @@ checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" [[package]] name = "proc-macro2" -version = "1.0.69" +version = "1.0.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" +checksum = "39278fbbf5fb4f646ce651690877f89d1c5811a3d4acb27700c1cb3cdb78fd3b" dependencies = [ "unicode-ident", ] @@ -4110,7 +4109,7 @@ dependencies = [ "thiserror", "tokio", "toml 0.8.8", - "toml_edit 0.20.7", + "toml_edit", "unicode-width", "ureq", "url", @@ -4281,16 +4280,6 @@ dependencies = [ "syn 2.0.39", ] -[[package]] -name = "thread_local" -version = "1.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" -dependencies = [ - "cfg-if", - "once_cell", -] - [[package]] name = "tiff" version = "0.9.0" @@ -4457,7 +4446,7 @@ dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.21.0", + "toml_edit", ] [[package]] @@ -4469,17 +4458,6 @@ dependencies = [ "serde", ] -[[package]] -name = "toml_edit" -version = "0.20.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70f427fce4d84c72b5b732388bf4a9f4531b53f74e2887e3ecb2481f68f66d81" -dependencies = [ - "indexmap 2.1.0", - "toml_datetime", - "winnow", -] - [[package]] name = "toml_edit" version = "0.21.0" @@ -4718,9 +4696,9 @@ dependencies = [ [[package]] name = "url" -version = "2.4.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" +checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" dependencies = [ "form_urlencoded", "idna", @@ -4988,9 +4966,9 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.25.2" +version = "0.25.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14247bb57be4f377dfb94c72830b8ce8fc6beac03cf4bf7b9732eadd414123fc" +checksum = "1778a42e8b3b90bff8d0f5032bf22250792889a5cdc752aa0020c84abe3aaf10" [[package]] name = "weezl" diff --git a/tooling/cli/Cargo.toml b/tooling/cli/Cargo.toml index 32d604791..2d0b10c4a 100644 --- a/tooling/cli/Cargo.toml +++ b/tooling/cli/Cargo.toml @@ -57,7 +57,7 @@ notify = "6.1" notify-debouncer-mini = "0.4" shared_child = "1.0" duct = "0.13" -toml_edit = "0.20" +toml_edit = "0.21" json-patch = "1.2" tauri-utils = { version = "2.0.0-alpha.12", path = "../../core/tauri-utils", features = [ "isolation", "schema", "config-json5", "config-toml" ] } tauri-utils-v1 = { version = "1", package = "tauri-utils", features = [ "isolation", "schema", "config-json5", "config-toml" ] } diff --git a/tooling/cli/metadata.json b/tooling/cli/metadata.json index 8ad9d6ba3..55dad6265 100644 --- a/tooling/cli/metadata.json +++ b/tooling/cli/metadata.json @@ -1,8 +1,8 @@ { "cli.js": { - "version": "1.5.5", + "version": "1.5.8", "node": ">= 10.0.0" }, - "tauri": "1.5.2", + "tauri": "1.5.3", "tauri-build": "1.5.0" } diff --git a/tooling/cli/node/CHANGELOG.md b/tooling/cli/node/CHANGELOG.md index 8ac1a4648..066cb2758 100644 --- a/tooling/cli/node/CHANGELOG.md +++ b/tooling/cli/node/CHANGELOG.md @@ -288,6 +288,34 @@ - First mobile alpha release! - [fa3a1098](https://www.github.com/tauri-apps/tauri/commit/fa3a10988a03aed1b66fb17d893b1a9adb90f7cd) feat(ci): prepare 2.0.0-alpha.0 ([#5786](https://www.github.com/tauri-apps/tauri/pull/5786)) on 2022-12-08 +## \[1.5.8] + +### Dependencies + +- Upgraded to `tauri-cli@1.5.8` + +## \[1.5.7] + +### Bug Fixes + +- [`1d5aa38a`](https://www.github.com/tauri-apps/tauri/commit/1d5aa38ae418ea31f593590b6d32cf04d3bfd8c1)([#8162](https://www.github.com/tauri-apps/tauri/pull/8162)) Fixes errors on command output, occuring when the output stream contains an invalid UTF-8 character, or ends with a multi-bytes UTF-8 character. +- [`f26d9f08`](https://www.github.com/tauri-apps/tauri/commit/f26d9f0884f63f61b9f4d4fac15e6b251163793e)([#8263](https://www.github.com/tauri-apps/tauri/pull/8263)) Fixes an issue in the NSIS installer which caused the uninstallation to leave empty folders on the system if the `resources` feature was used. +- [`92bc7d0e`](https://www.github.com/tauri-apps/tauri/commit/92bc7d0e16157434330a1bcf1eefda6f0f1e5f85)([#8233](https://www.github.com/tauri-apps/tauri/pull/8233)) Fixes an issue in the NSIS installer which caused the installation to take much longer than expected when many `resources` were added to the bundle. + +### Dependencies + +- Upgraded to `tauri-cli@1.5.7` + +## \[1.5.6] + +### Bug Fixes + +- [`5264e41d`](https://www.github.com/tauri-apps/tauri/commit/5264e41db3763e4c2eb0c3c21bd423fb7bece3e2)([#8082](https://www.github.com/tauri-apps/tauri/pull/8082)) Downgraded `rust-minisign` to `0.7.3` to fix signing updater bundles with empty passwords. + +### Dependencies + +- Upgraded to `tauri-cli@1.5.6` + ## \[1.5.5] ### Enhancements diff --git a/tooling/cli/node/Cargo.toml b/tooling/cli/node/Cargo.toml index 79618c4f6..2af60d570 100644 --- a/tooling/cli/node/Cargo.toml +++ b/tooling/cli/node/Cargo.toml @@ -8,13 +8,13 @@ crate-type = ["cdylib"] [dependencies] # Default enable napi4 feature, see https://nodejs.org/api/n-api.html#node-api-version-matrix -napi = { version = "2.13", default-features = false, features = ["napi4"] } -napi-derive = "2.13" +napi = { version = "2.14", default-features = false, features = ["napi4"] } +napi-derive = "2.14" tauri-cli = { path = "..", default-features = false } log = "0.4.20" [build-dependencies] -napi-build = "2.0" +napi-build = "2.1" [features] default = ["tauri-cli/default"] diff --git a/tooling/cli/node/test/jest/fixtures/app/src-tauri/Cargo.toml b/tooling/cli/node/test/jest/fixtures/app/src-tauri/Cargo.toml index 4ed3c422c..4f67a98e7 100644 --- a/tooling/cli/node/test/jest/fixtures/app/src-tauri/Cargo.toml +++ b/tooling/cli/node/test/jest/fixtures/app/src-tauri/Cargo.toml @@ -24,7 +24,7 @@ icon = [ tauri-build = { path = "../../../../../../../../core/tauri-build", features = [] } [dependencies] -serde_json = "1.0.107" +serde_json = "1.0.108" serde = "1.0" serde_derive = "1.0" tauri = { path = "../../../../../../../../core/tauri", features = ["api-all"] } diff --git a/tooling/cli/src/build.rs b/tooling/cli/src/build.rs index a2c6317e4..80d029a5f 100644 --- a/tooling/cli/src/build.rs +++ b/tooling/cli/src/build.rs @@ -58,7 +58,7 @@ pub struct Options { /// JSON string or path to JSON file to merge with tauri.conf.json #[clap(short, long)] pub config: Option, - /// Command line arguments passed to the runner + /// Command line arguments passed to the runner. Use `--` to explicitly mark the start of the arguments. pub args: Vec, /// Skip prompting for values #[clap(long)] diff --git a/tooling/cli/src/dev.rs b/tooling/cli/src/dev.rs index ecf95713f..b4c73576a 100644 --- a/tooling/cli/src/dev.rs +++ b/tooling/cli/src/dev.rs @@ -63,7 +63,9 @@ pub struct Options { /// Run the code in release mode #[clap(long = "release")] pub release_mode: bool, - /// Command line arguments passed to the runner. Arguments after `--` are passed to the application. + /// Command line arguments passed to the runner. + /// Use `--` to explicitly mark the start of the arguments. Arguments after a second `--` are passed to the application + /// e.g. `tauri dev -- [runnerArgs] -- [appArgs]`. pub args: Vec, /// Skip waiting for the frontend dev server to start before building the tauri application. #[clap(long, env = "TAURI_CLI_NO_DEV_SERVER_WAIT")] diff --git a/tooling/cli/src/helpers/updater_signature.rs b/tooling/cli/src/helpers/updater_signature.rs index 82923a229..972659dd8 100644 --- a/tooling/cli/src/helpers/updater_signature.rs +++ b/tooling/cli/src/helpers/updater_signature.rs @@ -165,3 +165,19 @@ where .map_err(|e| minisign::PError::new(minisign::ErrorKind::Io, e))?; Ok(BufReader::new(file)) } + +#[cfg(test)] +mod tests { + const PRIVATE_KEY: &str = "dW50cnVzdGVkIGNvbW1lbnQ6IHJzaWduIGVuY3J5cHRlZCBzZWNyZXQga2V5ClJXUlRZMEl5dkpDN09RZm5GeVAzc2RuYlNzWVVJelJRQnNIV2JUcGVXZUplWXZXYXpqUUFBQkFBQUFBQUFBQUFBQUlBQUFBQTZrN2RnWGh5dURxSzZiL1ZQSDdNcktiaHRxczQwMXdQelRHbjRNcGVlY1BLMTBxR2dpa3I3dDE1UTVDRDE4MXR4WlQwa1BQaXdxKy9UU2J2QmVSNXhOQWFDeG1GSVllbUNpTGJQRkhhTnROR3I5RmdUZi90OGtvaGhJS1ZTcjdZU0NyYzhQWlQ5cGM9Cg=="; + + // we use minisign=0.7.3 to prevent a breaking change + #[test] + fn empty_password_is_valid() { + let path = std::env::temp_dir().join("minisign-password-text.txt"); + std::fs::write(&path, b"TAURI").expect("failed to write test file"); + + let secret_key = + super::secret_key(PRIVATE_KEY.into(), Some("".into())).expect("failed to resolve secret key"); + super::sign_file(&secret_key, &path).expect("failed to sign file"); + } +} diff --git a/tooling/cli/src/lib.rs b/tooling/cli/src/lib.rs index 9232b60db..4698aee70 100644 --- a/tooling/cli/src/lib.rs +++ b/tooling/cli/src/lib.rs @@ -278,11 +278,14 @@ impl CommandExt for Command { let mut lines = stdout_lines_.lock().unwrap(); loop { line.clear(); - if let Ok(0) = stdout.read_line(&mut line) { - break; + match stdout.read_line(&mut line) { + Ok(0) => break, + Ok(_) => { + debug!(action = "stdout"; "{}", line.trim_end()); + lines.extend(line.as_bytes().to_vec()); + } + Err(_) => (), } - debug!(action = "stdout"; "{}", &line[0..line.len() - 1]); - lines.extend(line.as_bytes().to_vec()); } }); @@ -294,11 +297,14 @@ impl CommandExt for Command { let mut lines = stderr_lines_.lock().unwrap(); loop { line.clear(); - if let Ok(0) = stderr.read_line(&mut line) { - break; + match stderr.read_line(&mut line) { + Ok(0) => break, + Ok(_) => { + debug!(action = "stderr"; "{}", line.trim_end()); + lines.extend(line.as_bytes().to_vec()); + } + Err(_) => (), } - debug!(action = "stderr"; "{}", &line[0..line.len() - 1]); - lines.extend(line.as_bytes().to_vec()); } });