diff --git a/.changes/api-window-cursor.md b/.changes/api-window-cursor.md new file mode 100644 index 000000000..97c987489 --- /dev/null +++ b/.changes/api-window-cursor.md @@ -0,0 +1,5 @@ +--- +"api": patch +--- + +Added the `setCursorGrab`, `setCursorVisible`, `setCursorIcon` and `setCursorPosition` methods to the `WebviewWindow` class. diff --git a/.changes/cursor-apis.md b/.changes/cursor-apis.md new file mode 100644 index 000000000..8dc7a39e1 --- /dev/null +++ b/.changes/cursor-apis.md @@ -0,0 +1,7 @@ +--- +"tauri": patch +"tauri-runtime": patch +"tauri-runtime-wry": patch +--- + +Expose Window cursor APIs `set_cursor_grab`, `set_cursor_visible`, `set_cursor_icon` and `set_cursor_position`. diff --git a/core/tauri-runtime-wry/src/lib.rs b/core/tauri-runtime-wry/src/lib.rs index b980c574b..dd22b74da 100644 --- a/core/tauri-runtime-wry/src/lib.rs +++ b/core/tauri-runtime-wry/src/lib.rs @@ -14,7 +14,7 @@ use tauri_runtime::{ webview::{WebviewIpcHandler, WindowBuilder, WindowBuilderBase}, window::{ dpi::{LogicalPosition, LogicalSize, PhysicalPosition, PhysicalSize, Position, Size}, - DetachedWindow, FileDropEvent, JsEventListenerKey, PendingWindow, WindowEvent, + CursorIcon, DetachedWindow, FileDropEvent, JsEventListenerKey, PendingWindow, WindowEvent, }, ClipboardManager, Dispatch, Error, EventLoopProxy, ExitRequestedEventAction, GlobalShortcutManager, Result, RunEvent, RunIteration, Runtime, RuntimeHandle, UserAttentionType, @@ -63,7 +63,7 @@ use wry::{ }, monitor::MonitorHandle, window::{ - Fullscreen, Icon as WryWindowIcon, Theme as WryTheme, + CursorIcon as WryCursorIcon, Fullscreen, Icon as WryWindowIcon, Theme as WryTheme, UserAttentionType as WryUserAttentionType, }, }, @@ -752,7 +752,7 @@ impl From for PositionWrapper { pub struct UserAttentionTypeWrapper(WryUserAttentionType); impl From for UserAttentionTypeWrapper { - fn from(request_type: UserAttentionType) -> UserAttentionTypeWrapper { + fn from(request_type: UserAttentionType) -> Self { let o = match request_type { UserAttentionType::Critical => WryUserAttentionType::Critical, UserAttentionType::Informational => WryUserAttentionType::Informational, @@ -761,6 +761,54 @@ impl From for UserAttentionTypeWrapper { } } +#[derive(Debug)] +pub struct CursorIconWrapper(WryCursorIcon); + +impl From for CursorIconWrapper { + fn from(icon: CursorIcon) -> Self { + use CursorIcon::*; + let i = match icon { + Default => WryCursorIcon::Default, + Crosshair => WryCursorIcon::Crosshair, + Hand => WryCursorIcon::Hand, + Arrow => WryCursorIcon::Arrow, + Move => WryCursorIcon::Move, + Text => WryCursorIcon::Text, + Wait => WryCursorIcon::Wait, + Help => WryCursorIcon::Help, + Progress => WryCursorIcon::Progress, + NotAllowed => WryCursorIcon::NotAllowed, + ContextMenu => WryCursorIcon::ContextMenu, + Cell => WryCursorIcon::Cell, + VerticalText => WryCursorIcon::VerticalText, + Alias => WryCursorIcon::Alias, + Copy => WryCursorIcon::Copy, + NoDrop => WryCursorIcon::NoDrop, + Grab => WryCursorIcon::Grab, + Grabbing => WryCursorIcon::Grabbing, + AllScroll => WryCursorIcon::AllScroll, + ZoomIn => WryCursorIcon::ZoomIn, + ZoomOut => WryCursorIcon::ZoomOut, + EResize => WryCursorIcon::EResize, + NResize => WryCursorIcon::NResize, + NeResize => WryCursorIcon::NeResize, + NwResize => WryCursorIcon::NwResize, + SResize => WryCursorIcon::SResize, + SeResize => WryCursorIcon::SeResize, + SwResize => WryCursorIcon::SwResize, + WResize => WryCursorIcon::WResize, + EwResize => WryCursorIcon::EwResize, + NsResize => WryCursorIcon::NsResize, + NeswResize => WryCursorIcon::NeswResize, + NwseResize => WryCursorIcon::NwseResize, + ColResize => WryCursorIcon::ColResize, + RowResize => WryCursorIcon::RowResize, + _ => WryCursorIcon::Default, + }; + Self(i) + } +} + #[derive(Debug, Clone, Default)] pub struct WindowBuilderWrapper { inner: WryWindowBuilder, @@ -1079,6 +1127,10 @@ pub enum WindowMessage { SetFocus, SetIcon(WryWindowIcon), SetSkipTaskbar(bool), + SetCursorGrab(bool), + SetCursorVisible(bool), + SetCursorIcon(CursorIcon), + SetCursorPosition(Position), DragWindow, UpdateMenuItem(u16, MenuUpdate), RequestRedraw, @@ -1505,6 +1557,37 @@ impl Dispatch for WryDispatcher { ) } + fn set_cursor_grab(&self, grab: bool) -> crate::Result<()> { + send_user_message( + &self.context, + Message::Window(self.window_id, WindowMessage::SetCursorGrab(grab)), + ) + } + + fn set_cursor_visible(&self, visible: bool) -> crate::Result<()> { + send_user_message( + &self.context, + Message::Window(self.window_id, WindowMessage::SetCursorVisible(visible)), + ) + } + + fn set_cursor_icon(&self, icon: CursorIcon) -> crate::Result<()> { + send_user_message( + &self.context, + Message::Window(self.window_id, WindowMessage::SetCursorIcon(icon)), + ) + } + + fn set_cursor_position>(&self, position: Pos) -> crate::Result<()> { + send_user_message( + &self.context, + Message::Window( + self.window_id, + WindowMessage::SetCursorPosition(position.into()), + ), + ) + } + fn start_dragging(&self) -> Result<()> { send_user_message( &self.context, @@ -2176,9 +2259,26 @@ fn handle_user_message( WindowMessage::SetIcon(icon) => { window.set_window_icon(Some(icon)); } - WindowMessage::SetSkipTaskbar(_skip) => { + #[allow(unused_variables)] + WindowMessage::SetSkipTaskbar(skip) => { #[cfg(any(windows, target_os = "linux"))] - window.set_skip_taskbar(_skip); + window.set_skip_taskbar(skip); + } + #[allow(unused_variables)] + WindowMessage::SetCursorGrab(grab) => { + #[cfg(any(windows, target_os = "macos"))] + let _ = window.set_cursor_grab(grab); + } + WindowMessage::SetCursorVisible(visible) => { + window.set_cursor_visible(visible); + } + WindowMessage::SetCursorIcon(icon) => { + window.set_cursor_icon(CursorIconWrapper::from(icon).0); + } + #[allow(unused_variables)] + WindowMessage::SetCursorPosition(position) => { + #[cfg(any(windows, target_os = "macos"))] + let _ = window.set_cursor_position(PositionWrapper::from(position).0); } WindowMessage::DragWindow => { let _ = window.drag_window(); diff --git a/core/tauri-runtime/src/lib.rs b/core/tauri-runtime/src/lib.rs index 8683b8375..8d5749cb5 100644 --- a/core/tauri-runtime/src/lib.rs +++ b/core/tauri-runtime/src/lib.rs @@ -26,7 +26,7 @@ use monitor::Monitor; use webview::WindowBuilder; use window::{ dpi::{PhysicalPosition, PhysicalSize, Position, Size}, - DetachedWindow, PendingWindow, WindowEvent, + CursorIcon, DetachedWindow, PendingWindow, WindowEvent, }; use crate::http::{ @@ -565,6 +565,23 @@ pub trait Dispatch: Debug + Clone + Send + Sync + Sized + 'static /// Whether to show the window icon in the task bar or not. fn set_skip_taskbar(&self, skip: bool) -> Result<()>; + /// Grabs the cursor, preventing it from leaving the window. + /// + /// There's no guarantee that the cursor will be hidden. You should + /// hide it by yourself if you want so. + fn set_cursor_grab(&self, grab: bool) -> Result<()>; + + /// Modifies the cursor's visibility. + /// + /// If `false`, this will hide the cursor. If `true`, this will show the cursor. + fn set_cursor_visible(&self, visible: bool) -> Result<()>; + + // Modifies the cursor icon of the window. + fn set_cursor_icon(&self, icon: CursorIcon) -> Result<()>; + + /// Changes the position of the cursor in window coordinates. + fn set_cursor_position>(&self, position: Pos) -> Result<()>; + /// Starts dragging the window. fn start_dragging(&self) -> Result<()>; diff --git a/core/tauri-runtime/src/window.rs b/core/tauri-runtime/src/window.rs index f50147164..3a6becd0c 100644 --- a/core/tauri-runtime/src/window.rs +++ b/core/tauri-runtime/src/window.rs @@ -10,7 +10,7 @@ use crate::{ webview::{WebviewAttributes, WebviewIpcHandler}, Dispatch, Runtime, UserEvent, WindowBuilder, }; -use serde::Serialize; +use serde::{Deserialize, Deserializer, Serialize}; use tauri_utils::{config::WindowConfig, Theme}; use std::{ @@ -98,6 +98,118 @@ fn get_menu_ids(map: &mut HashMap, menu: &Menu) { } } +/// Describes the appearance of the mouse cursor. +#[non_exhaustive] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum CursorIcon { + /// The platform-dependent default cursor. + Default, + /// A simple crosshair. + Crosshair, + /// A hand (often used to indicate links in web browsers). + Hand, + /// Self explanatory. + Arrow, + /// Indicates something is to be moved. + Move, + /// Indicates text that may be selected or edited. + Text, + /// Program busy indicator. + Wait, + /// Help indicator (often rendered as a "?") + Help, + /// Progress indicator. Shows that processing is being done. But in contrast + /// with "Wait" the user may still interact with the program. Often rendered + /// as a spinning beach ball, or an arrow with a watch or hourglass. + Progress, + + /// Cursor showing that something cannot be done. + NotAllowed, + ContextMenu, + Cell, + VerticalText, + Alias, + Copy, + NoDrop, + /// Indicates something can be grabbed. + Grab, + /// Indicates something is grabbed. + Grabbing, + AllScroll, + ZoomIn, + ZoomOut, + + /// Indicate that some edge is to be moved. For example, the 'SeResize' cursor + /// is used when the movement starts from the south-east corner of the box. + EResize, + NResize, + NeResize, + NwResize, + SResize, + SeResize, + SwResize, + WResize, + EwResize, + NsResize, + NeswResize, + NwseResize, + ColResize, + RowResize, +} + +impl<'de> Deserialize<'de> for CursorIcon { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + Ok(match s.to_lowercase().as_str() { + "default" => CursorIcon::Default, + "crosshair" => CursorIcon::Crosshair, + "hand" => CursorIcon::Hand, + "arrow" => CursorIcon::Arrow, + "move" => CursorIcon::Move, + "text" => CursorIcon::Text, + "wait" => CursorIcon::Wait, + "help" => CursorIcon::Help, + "progress" => CursorIcon::Progress, + "notallowed" => CursorIcon::NotAllowed, + "contextmenu" => CursorIcon::ContextMenu, + "cell" => CursorIcon::Cell, + "verticaltext" => CursorIcon::VerticalText, + "alias" => CursorIcon::Alias, + "copy" => CursorIcon::Copy, + "nodrop" => CursorIcon::NoDrop, + "grab" => CursorIcon::Grab, + "grabbing" => CursorIcon::Grabbing, + "allscroll" => CursorIcon::AllScroll, + "zoomun" => CursorIcon::ZoomIn, + "zoomout" => CursorIcon::ZoomOut, + "eresize" => CursorIcon::EResize, + "nresize" => CursorIcon::NResize, + "neresize" => CursorIcon::NeResize, + "nwresize" => CursorIcon::NwResize, + "sresize" => CursorIcon::SResize, + "seresize" => CursorIcon::SeResize, + "swresize" => CursorIcon::SwResize, + "wresize" => CursorIcon::WResize, + "ewresize" => CursorIcon::EwResize, + "nsresize" => CursorIcon::NsResize, + "neswresize" => CursorIcon::NeswResize, + "nwseresize" => CursorIcon::NwseResize, + "colresize" => CursorIcon::ColResize, + "rowresize" => CursorIcon::RowResize, + _ => CursorIcon::Default, + }) + } +} + +impl Default for CursorIcon { + fn default() -> Self { + CursorIcon::Default + } +} + /// A webview window that has yet to be built. pub struct PendingWindow> { /// The label that the window will be named. diff --git a/core/tauri/Cargo.toml b/core/tauri/Cargo.toml index 7862cd8c0..7d2d0c0c9 100644 --- a/core/tauri/Cargo.toml +++ b/core/tauri/Cargo.toml @@ -230,6 +230,10 @@ window-all = [ "window-set-focus", "window-set-icon", "window-set-skip-taskbar", + "window-set-cursor-grab", + "window-set-cursor-visible", + "window-set-cursor-icon", + "window-set-cursor-position", "window-start-dragging", "window-print" ] @@ -255,6 +259,10 @@ window-set-fullscreen = [ ] window-set-focus = [ ] window-set-icon = [ ] window-set-skip-taskbar = [ ] +window-set-cursor-grab = [ ] +window-set-cursor-visible = [ ] +window-set-cursor-icon = [ ] +window-set-cursor-position = [ ] window-start-dragging = [ ] window-print = [ ] config-json5 = [ "tauri-macros/config-json5" ] diff --git a/core/tauri/build.rs b/core/tauri/build.rs index fb608e338..5e2640cd9 100644 --- a/core/tauri/build.rs +++ b/core/tauri/build.rs @@ -29,7 +29,7 @@ fn main() { window_create: { any(window_all, feature = "window-create") }, window_center: { any(window_all, feature = "window-center") }, window_request_user_attention: { any(window_all, feature = "window-request-user-attention") }, - window_set_izable: { any(window_all, feature = "window-set-resizable") }, + window_set_resizable: { any(window_all, feature = "window-set-resizable") }, window_set_title: { any(window_all, feature = "window-set-title") }, window_maximize: { any(window_all, feature = "window-maximize") }, window_unmaximize: { any(window_all, feature = "window-unmaximize") }, @@ -48,6 +48,10 @@ fn main() { window_set_focus: { any(window_all, feature = "window-set-focus") }, window_set_icon: { any(window_all, feature = "window-set-icon") }, window_set_skip_taskbar: { any(window_all, feature = "window-set-skip-taskbar") }, + window_set_cursor_grab: { any(window_all, feature = "window-set-cursor-grab") }, + window_set_cursor_visible: { any(window_all, feature = "window-set-cursor-visible") }, + window_set_cursor_icon: { any(window_all, feature = "window-set-cursor-icon") }, + window_set_cursor_position: { any(window_all, feature = "window-set-cursor-position") }, window_start_dragging: { any(window_all, feature = "window-start-dragging") }, window_print: { any(window_all, feature = "window-print") }, diff --git a/core/tauri/scripts/bundle.js b/core/tauri/scripts/bundle.js index 3fa61b545..c3ed9b144 100644 --- a/core/tauri/scripts/bundle.js +++ b/core/tauri/scripts/bundle.js @@ -1 +1 @@ -function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_setPrototypeOf(e,t)}function _setPrototypeOf(e,t){return(_setPrototypeOf=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function _createSuper(e){var t=_isNativeReflectConstruct();return function(){var r,n=_getPrototypeOf(e);if(t){var a=_getPrototypeOf(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return _possibleConstructorReturn(this,r)}}function _possibleConstructorReturn(e,t){if(t&&("object"===_typeof(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(e)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function _getPrototypeOf(e){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _createForOfIteratorHelper(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=_unsupportedIterableToArray(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,a=function(){};return{s:a,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,u=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return i=e.done,e},e:function(e){u=!0,o=e},f:function(){try{i||null==r.return||r.return()}finally{if(u)throw o}}}}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0;--o){var i=this.tryEntries[o],u=i.completion;if("root"===i.tryLoc)return a("end");if(i.tryLoc<=this.prev){var s=n.call(i,"catchLoc"),c=n.call(i,"finallyLoc");if(s&&c){if(this.prev=0;--r){var a=this.tryEntries[r];if(a.tryLoc<=this.prev&&n.call(a,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),P(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;P(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:O(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),d}},e}("object"===("undefined"==typeof module?"undefined":_typeof(module))?module.exports:{});try{regeneratorRuntime=t}catch(e){"object"===("undefined"==typeof globalThis?"undefined":_typeof(globalThis))?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}function r(e){for(var t=void 0,r=e[0],n=1;n1&&void 0!==arguments[1]&&arguments[1],a=n(),o="_".concat(a);return Object.defineProperty(window,o,{value:function(n){return t&&Reflect.deleteProperty(window,o),r([e,"optionalCall",function(e){return e(n)}])},writable:!1,configurable:!0}),a}function o(e){return i.apply(this,arguments)}function i(){return(i=_asyncToGenerator(regeneratorRuntime.mark((function e(t){var r,n=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.length>1&&void 0!==n[1]?n[1]:{},e.abrupt("return",new Promise((function(e,n){var o=a((function(t){e(t),Reflect.deleteProperty(window,i)}),!0),i=a((function(e){n(e),Reflect.deleteProperty(window,o)}),!0);window.__TAURI_IPC__(_objectSpread({cmd:t,callback:o,error:i},r))})));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var u=Object.freeze({__proto__:null,transformCallback:a,invoke:o,convertFileSrc:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"asset",r=encodeURIComponent(e);return navigator.userAgent.includes("Windows")?"https://".concat(t,".localhost/").concat(r):"".concat(t,"://").concat(r)}});function s(e){return c.apply(this,arguments)}function c(){return(c=_asyncToGenerator(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",o("tauri",t));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function p(){return(p=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"App",message:{cmd:"getAppVersion"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function l(){return(l=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"App",message:{cmd:"getAppName"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function f(){return(f=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"App",message:{cmd:"getTauriVersion"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var h=Object.freeze({__proto__:null,getName:function(){return l.apply(this,arguments)},getVersion:function(){return p.apply(this,arguments)},getTauriVersion:function(){return f.apply(this,arguments)}});function m(){return(m=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Cli",message:{cmd:"cliMatches"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var d=Object.freeze({__proto__:null,getMatches:function(){return m.apply(this,arguments)}});function y(){return(y=_asyncToGenerator(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Clipboard",message:{cmd:"writeText",data:t}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function g(){return(g=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Clipboard",message:{cmd:"readText"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var _=Object.freeze({__proto__:null,writeText:function(e){return y.apply(this,arguments)},readText:function(){return g.apply(this,arguments)}});function w(){return(w=_asyncToGenerator(regeneratorRuntime.mark((function e(){var t,r=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return"object"===_typeof(t=r.length>0&&void 0!==r[0]?r[0]:{})&&Object.freeze(t),e.abrupt("return",s({__tauriModule:"Dialog",message:{cmd:"openDialog",options:t}}));case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function v(){return(v=_asyncToGenerator(regeneratorRuntime.mark((function e(){var t,r=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return"object"===_typeof(t=r.length>0&&void 0!==r[0]?r[0]:{})&&Object.freeze(t),e.abrupt("return",s({__tauriModule:"Dialog",message:{cmd:"saveDialog",options:t}}));case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function b(){return(b=_asyncToGenerator(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Dialog",message:{cmd:"messageDialog",message:t}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function R(){return(R=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Dialog",message:{cmd:"askDialog",title:r,message:t}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function k(){return(k=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Dialog",message:{cmd:"confirmDialog",title:r,message:t}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var x=Object.freeze({__proto__:null,open:function(){return w.apply(this,arguments)},save:function(){return v.apply(this,arguments)},message:function(e){return b.apply(this,arguments)},ask:function(e,t){return R.apply(this,arguments)},confirm:function(e,t){return k.apply(this,arguments)}});function T(e,t){return G.apply(this,arguments)}function G(){return(G=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Event",message:{cmd:"unlisten",event:t,eventId:r}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function P(e,t,r){return M.apply(this,arguments)}function M(){return(M=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r,n){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,s({__tauriModule:"Event",message:{cmd:"emit",event:t,windowLabel:r,payload:"string"==typeof n?n:JSON.stringify(n)}});case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function O(e,t,r){return A.apply(this,arguments)}function A(){return(A=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r,n){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Event",message:{cmd:"listen",event:t,windowLabel:r,handler:a(n)}}).then((function(e){return _asyncToGenerator(regeneratorRuntime.mark((function r(){return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",T(t,e));case 1:case"end":return r.stop()}}),r)})))})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function j(e,t,r){return C.apply(this,arguments)}function C(){return(C=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r,n){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",O(t,r,(function(e){n(e),T(t,e.id).catch((function(){}))})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function S(e,t){return D.apply(this,arguments)}function D(){return(D=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",O(t,null,r));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function z(e,t){return L.apply(this,arguments)}function L(){return(L=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",j(t,null,r));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function E(e,t){return W.apply(this,arguments)}function W(){return(W=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",P(t,void 0,r));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var F,I=Object.freeze({__proto__:null,listen:S,once:z,emit:E});function N(){return(N=_asyncToGenerator(regeneratorRuntime.mark((function e(t){var r,n=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.length>1&&void 0!==n[1]?n[1]:{},e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"readTextFile",path:t,options:r}}));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function U(){return(U=_asyncToGenerator(regeneratorRuntime.mark((function e(t){var r,n,a=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=a.length>1&&void 0!==a[1]?a[1]:{},e.next=3,s({__tauriModule:"Fs",message:{cmd:"readFile",path:t,options:r}});case 3:return n=e.sent,e.abrupt("return",Uint8Array.from(n));case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function H(){return(H=_asyncToGenerator(regeneratorRuntime.mark((function e(t){var r,n=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return"object"===_typeof(r=n.length>1&&void 0!==n[1]?n[1]:{})&&Object.freeze(r),"object"===_typeof(t)&&Object.freeze(t),e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"writeFile",path:t.path,contents:Array.from((new TextEncoder).encode(t.contents)),options:r}}));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function q(){return(q=_asyncToGenerator(regeneratorRuntime.mark((function e(t){var r,n=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return"object"===_typeof(r=n.length>1&&void 0!==n[1]?n[1]:{})&&Object.freeze(r),"object"===_typeof(t)&&Object.freeze(t),e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"writeFile",path:t.path,contents:Array.from(t.contents),options:r}}));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function B(){return(B=_asyncToGenerator(regeneratorRuntime.mark((function e(t){var r,n=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.length>1&&void 0!==n[1]?n[1]:{},e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"readDir",path:t,options:r}}));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function V(){return(V=_asyncToGenerator(regeneratorRuntime.mark((function e(t){var r,n=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.length>1&&void 0!==n[1]?n[1]:{},e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"createDir",path:t,options:r}}));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function J(){return(J=_asyncToGenerator(regeneratorRuntime.mark((function e(t){var r,n=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.length>1&&void 0!==n[1]?n[1]:{},e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"removeDir",path:t,options:r}}));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function K(){return(K=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){var n,a=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=a.length>2&&void 0!==a[2]?a[2]:{},e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"copyFile",source:t,destination:r,options:n}}));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Y(){return(Y=_asyncToGenerator(regeneratorRuntime.mark((function e(t){var r,n=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.length>1&&void 0!==n[1]?n[1]:{},e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"removeFile",path:t,options:r}}));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function $(){return($=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){var n,a=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=a.length>2&&void 0!==a[2]?a[2]:{},e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"renameFile",oldPath:t,newPath:r,options:n}}));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}!function(e){e[e.Audio=1]="Audio";e[e.Cache=2]="Cache";e[e.Config=3]="Config";e[e.Data=4]="Data";e[e.LocalData=5]="LocalData";e[e.Desktop=6]="Desktop";e[e.Document=7]="Document";e[e.Download=8]="Download";e[e.Executable=9]="Executable";e[e.Font=10]="Font";e[e.Home=11]="Home";e[e.Picture=12]="Picture";e[e.Public=13]="Public";e[e.Runtime=14]="Runtime";e[e.Template=15]="Template";e[e.Video=16]="Video";e[e.Resource=17]="Resource";e[e.App=18]="App";e[e.Log=19]="Log";e[e.Temp=20]="Temp"}(F||(F={}));var Q=Object.freeze({__proto__:null,get BaseDirectory(){return F},get Dir(){return F},readTextFile:function(e){return N.apply(this,arguments)},readBinaryFile:function(e){return U.apply(this,arguments)},writeFile:function(e){return H.apply(this,arguments)},writeBinaryFile:function(e){return q.apply(this,arguments)},readDir:function(e){return B.apply(this,arguments)},createDir:function(e){return V.apply(this,arguments)},removeDir:function(e){return J.apply(this,arguments)},copyFile:function(e,t){return K.apply(this,arguments)},removeFile:function(e){return Y.apply(this,arguments)},renameFile:function(e,t){return $.apply(this,arguments)}});function X(){return(X=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"GlobalShortcut",message:{cmd:"register",shortcut:t,handler:a(r)}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Z(){return(Z=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"GlobalShortcut",message:{cmd:"registerAll",shortcuts:t,handler:a(r)}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ee(){return(ee=_asyncToGenerator(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"GlobalShortcut",message:{cmd:"isRegistered",shortcut:t}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function te(){return(te=_asyncToGenerator(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"GlobalShortcut",message:{cmd:"unregister",shortcut:t}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function re(){return(re=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"GlobalShortcut",message:{cmd:"unregisterAll"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var ne,ae=Object.freeze({__proto__:null,register:function(e,t){return X.apply(this,arguments)},registerAll:function(e,t){return Z.apply(this,arguments)},isRegistered:function(e){return ee.apply(this,arguments)},unregister:function(e){return te.apply(this,arguments)},unregisterAll:function(){return re.apply(this,arguments)}});function oe(e,t){return null!=e?e:t()}function ie(e){for(var t=void 0,r=e[0],n=1;n=200&&this.status<300,this.headers=t.headers,this.rawHeaders=t.rawHeaders,this.data=t.data})),ce=function(){function e(t){_classCallCheck(this,e),this.id=t}var t,r,n,a,o,i,u;return _createClass(e,[{key:"drop",value:(u=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Http",message:{cmd:"dropClient",client:this.id}}));case 1:case"end":return e.stop()}}),e,this)}))),function(){return u.apply(this,arguments)})},{key:"request",value:(i=_asyncToGenerator(regeneratorRuntime.mark((function e(t){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(r=!t.responseType||t.responseType===ne.JSON)&&(t.responseType=ne.Text),e.abrupt("return",s({__tauriModule:"Http",message:{cmd:"httpRequest",client:this.id,options:t}}).then((function(e){var t=new se(e);if(r){try{t.data=JSON.parse(t.data)}catch(e){if(t.ok&&""===t.data)t.data={};else if(t.ok)throw Error("Failed to parse response `".concat(t.data,"` as JSON: ").concat(e,";\n try setting the `responseType` option to `ResponseType.Text` or `ResponseType.Binary` if the API does not return a JSON response."))}return t}return t})));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"get",value:(o=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.request(_objectSpread({method:"GET",url:t},r)));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return o.apply(this,arguments)})},{key:"post",value:(a=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r,n){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.request(_objectSpread({method:"POST",url:t,body:r},n)));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return a.apply(this,arguments)})},{key:"put",value:(n=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r,n){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.request(_objectSpread({method:"PUT",url:t,body:r},n)));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return n.apply(this,arguments)})},{key:"patch",value:(r=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.request(_objectSpread({method:"PATCH",url:t},r)));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"delete",value:(t=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.request(_objectSpread({method:"DELETE",url:t},r)));case 1:case"end":return e.stop()}}),e,this)}))),function(e,r){return t.apply(this,arguments)})}]),e}();function pe(e){return le.apply(this,arguments)}function le(){return(le=_asyncToGenerator(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Http",message:{cmd:"createClient",options:t}}).then((function(e){return new ce(e)})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var fe=null;function he(){return(he=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==fe){e.next=4;break}return e.next=3,pe();case 3:fe=e.sent;case 4:return e.abrupt("return",fe.request(_objectSpread({url:t,method:oe(ie([r,"optionalAccess",function(e){return e.method}]),(function(){return"GET"}))},r)));case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var me=Object.freeze({__proto__:null,getClient:pe,fetch:function(e,t){return he.apply(this,arguments)},Body:ue,Client:ce,Response:se,get ResponseType(){return ne}});function de(){return(de=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("default"===window.Notification.permission){e.next=2;break}return e.abrupt("return",Promise.resolve("granted"===window.Notification.permission));case 2:return e.abrupt("return",s({__tauriModule:"Notification",message:{cmd:"isNotificationPermissionGranted"}}));case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ye(){return(ye=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",window.Notification.requestPermission());case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var ge=Object.freeze({__proto__:null,sendNotification:function(e){"string"==typeof e?new window.Notification(e):new window.Notification(e.title,e)},requestPermission:function(){return ye.apply(this,arguments)},isPermissionGranted:function(){return de.apply(this,arguments)}});function _e(){return navigator.appVersion.includes("Win")}function we(){return(we=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.App}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ve(){return(ve=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Audio}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function be(){return(be=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Cache}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Re(){return(Re=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Config}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ke(){return(ke=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Data}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function xe(){return(xe=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Desktop}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Te(){return(Te=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Document}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ge(){return(Ge=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Download}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Pe(){return(Pe=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Executable}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Me(){return(Me=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Font}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Oe(){return(Oe=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Home}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ae(){return(Ae=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.LocalData}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function je(){return(je=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Picture}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ce(){return(Ce=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Public}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Se(){return(Se=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Resource}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function De(){return(De=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Runtime}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ze(){return(ze=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Template}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Le(){return(Le=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Video}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ee(){return(Ee=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Log}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var We=_e()?"\\":"/",Fe=_e()?";":":";function Ie(){return(Ie=_asyncToGenerator(regeneratorRuntime.mark((function e(){var t,r,n,a=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(t=a.length,r=new Array(t),n=0;n0&&void 0!==r[0]?r[0]:0,e.abrupt("return",s({__tauriModule:"Process",message:{cmd:"exit",exitCode:t}}));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ye(){return(Ye=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Process",message:{cmd:"relaunch"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var $e=Object.freeze({__proto__:null,exit:function(){return Ke.apply(this,arguments)},relaunch:function(){return Ye.apply(this,arguments)}});function Qe(e,t){return null!=e?e:t()}function Xe(e,t){return Ze.apply(this,arguments)}function Ze(){return(Ze=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){var n,o,i=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=i.length>2&&void 0!==i[2]?i[2]:[],o=i.length>3?i[3]:void 0,"object"===_typeof(n)&&Object.freeze(n),e.abrupt("return",s({__tauriModule:"Shell",message:{cmd:"execute",program:r,args:n,options:o,onEventFn:a(t)}}));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var et=function(){function e(){_classCallCheck(this,e),e.prototype.__init.call(this)}return _createClass(e,[{key:"__init",value:function(){this.eventListeners=Object.create(null)}},{key:"addEventListener",value:function(e,t){e in this.eventListeners?this.eventListeners[e].push(t):this.eventListeners[e]=[t]}},{key:"_emit",value:function(e,t){if(e in this.eventListeners){var r,n=_createForOfIteratorHelper(this.eventListeners[e]);try{for(n.s();!(r=n.n()).done;){(0,r.value)(t)}}catch(e){n.e(e)}finally{n.f()}}}},{key:"on",value:function(e,t){return this.addEventListener(e,t),this}}]),e}(),tt=function(){function e(t){_classCallCheck(this,e),this.pid=t}var t,r;return _createClass(e,[{key:"write",value:(r=_asyncToGenerator(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Shell",message:{cmd:"stdinWrite",pid:this.pid,buffer:"string"==typeof t?t:Array.from(t)}}));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"kill",value:(t=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Shell",message:{cmd:"killChild",pid:this.pid}}));case 1:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}]),e}(),rt=function(e){_inherits(a,e);var t,r,n=_createSuper(a);function a(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],o=arguments.length>2?arguments[2]:void 0;return _classCallCheck(this,a),t=n.call(this),a.prototype.__init2.call(_assertThisInitialized(t)),a.prototype.__init3.call(_assertThisInitialized(t)),t.program=e,t.args="string"==typeof r?[r]:r,t.options=Qe(o,(function(){return{}})),t}return _createClass(a,[{key:"__init2",value:function(){this.stdout=new et}},{key:"__init3",value:function(){this.stderr=new et}},{key:"spawn",value:(r=_asyncToGenerator(regeneratorRuntime.mark((function e(){var t=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Xe((function(e){switch(e.event){case"Error":t._emit("error",e.payload);break;case"Terminated":t._emit("close",e.payload);break;case"Stdout":t.stdout._emit("data",e.payload);break;case"Stderr":t.stderr._emit("data",e.payload)}}),this.program,this.args,this.options).then((function(e){return new tt(e)})));case 1:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"execute",value:(t=_asyncToGenerator(regeneratorRuntime.mark((function e(){var t=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){t.on("error",r);var n=[],a=[];t.stdout.on("data",(function(e){n.push(e)})),t.stderr.on("data",(function(e){a.push(e)})),t.on("close",(function(t){e({code:t.code,signal:t.signal,stdout:n.join("\n"),stderr:a.join("\n")})})),t.spawn().catch(r)})));case 1:case"end":return e.stop()}}),e)}))),function(){return t.apply(this,arguments)})}],[{key:"sidecar",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0,n=new a(e,t,r);return n.options.sidecar=!0,n}}]),a}(et);function nt(){return(nt=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Shell",message:{cmd:"open",path:t,with:r}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var at=Object.freeze({__proto__:null,Command:rt,Child:tt,EventEmitter:et,open:function(e,t){return nt.apply(this,arguments)}});function ot(e){for(var t=void 0,r=e[0],n=1;n1&&void 0!==arguments[1]?arguments[1]:{};return _classCallCheck(this,r),n=t.call(this,e),ct([a,"optionalAccess",function(e){return e.skip}])||s({__tauriModule:"Window",message:{cmd:"createWebview",data:{options:_objectSpread({label:e},a)}}}).then(_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",n.emit("tauri://created"));case 1:case"end":return e.stop()}}),e)})))).catch(function(){var e=_asyncToGenerator(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",n.emit("tauri://error",t));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),n}return _createClass(r,null,[{key:"getByLabel",value:function(e){return dt().some((function(t){return t.label===e}))?new r(e,{skip:!0}):null}}]),r}(wt);function bt(){return(bt=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"currentMonitor"}}}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Rt(){return(Rt=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"primaryMonitor"}}}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function kt(){return(kt=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"availableMonitors"}}}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}"__TAURI_METADATA__"in window?yt=new vt(window.__TAURI_METADATA__.__currentWindow.label,{skip:!0}):(console.warn('Could not find "window.__TAURI_METADATA__". The "appWindow" value will reference the "main" window label.\nNote that this is not an issue if running this frontend on a browser instead of a Tauri window.'),yt=new vt("main",{skip:!0}));var xt=Object.freeze({__proto__:null,WebviewWindow:vt,WebviewWindowHandle:_t,WindowManager:wt,getCurrent:function(){return new vt(window.__TAURI_METADATA__.__currentWindow.label,{skip:!0})},getAll:dt,get appWindow(){return yt},LogicalSize:lt,PhysicalSize:ft,LogicalPosition:ht,PhysicalPosition:mt,get UserAttentionType(){return pt},currentMonitor:function(){return bt.apply(this,arguments)},primaryMonitor:function(){return Rt.apply(this,arguments)},availableMonitors:function(){return kt.apply(this,arguments)}}),Tt=_e()?"\r\n":"\n";function Gt(){return(Gt=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Os",message:{cmd:"platform"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Pt(){return(Pt=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Os",message:{cmd:"version"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Mt(){return(Mt=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Os",message:{cmd:"osType"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ot(){return(Ot=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Os",message:{cmd:"arch"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function At(){return(At=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Os",message:{cmd:"tempdir"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var jt=Object.freeze({__proto__:null,EOL:Tt,platform:function(){return Gt.apply(this,arguments)},version:function(){return Pt.apply(this,arguments)},type:function(){return Mt.apply(this,arguments)},arch:function(){return Ot.apply(this,arguments)},tempdir:function(){return At.apply(this,arguments)}}),Ct=o;e.app=h,e.cli=d,e.clipboard=_,e.dialog=x,e.event=I,e.fs=Q,e.globalShortcut=ae,e.http=me,e.invoke=Ct,e.notification=ge,e.os=jt,e.path=Je,e.process=$e,e.shell=at,e.tauri=u,e.updater=st,e.window=xt,Object.defineProperty(e,"__esModule",{value:!0})})); +function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_setPrototypeOf(e,t)}function _setPrototypeOf(e,t){return(_setPrototypeOf=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function _createSuper(e){var t=_isNativeReflectConstruct();return function(){var r,n=_getPrototypeOf(e);if(t){var a=_getPrototypeOf(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return _possibleConstructorReturn(this,r)}}function _possibleConstructorReturn(e,t){if(t&&("object"===_typeof(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(e)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function _getPrototypeOf(e){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _createForOfIteratorHelper(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=_unsupportedIterableToArray(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,a=function(){};return{s:a,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,u=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return i=e.done,e},e:function(e){u=!0,o=e},f:function(){try{i||null==r.return||r.return()}finally{if(u)throw o}}}}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0;--o){var i=this.tryEntries[o],u=i.completion;if("root"===i.tryLoc)return a("end");if(i.tryLoc<=this.prev){var s=n.call(i,"catchLoc"),c=n.call(i,"finallyLoc");if(s&&c){if(this.prev=0;--r){var a=this.tryEntries[r];if(a.tryLoc<=this.prev&&n.call(a,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),P(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;P(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:O(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),d}},e}("object"===("undefined"==typeof module?"undefined":_typeof(module))?module.exports:{});try{regeneratorRuntime=t}catch(e){"object"===("undefined"==typeof globalThis?"undefined":_typeof(globalThis))?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}function r(e){for(var t=void 0,r=e[0],n=1;n1&&void 0!==arguments[1]&&arguments[1],a=n(),o="_".concat(a);return Object.defineProperty(window,o,{value:function(n){return t&&Reflect.deleteProperty(window,o),r([e,"optionalCall",function(e){return e(n)}])},writable:!1,configurable:!0}),a}function o(e){return i.apply(this,arguments)}function i(){return(i=_asyncToGenerator(regeneratorRuntime.mark((function e(t){var r,n=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.length>1&&void 0!==n[1]?n[1]:{},e.abrupt("return",new Promise((function(e,n){var o=a((function(t){e(t),Reflect.deleteProperty(window,i)}),!0),i=a((function(e){n(e),Reflect.deleteProperty(window,o)}),!0);window.__TAURI_IPC__(_objectSpread({cmd:t,callback:o,error:i},r))})));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var u=Object.freeze({__proto__:null,transformCallback:a,invoke:o,convertFileSrc:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"asset",r=encodeURIComponent(e);return navigator.userAgent.includes("Windows")?"https://".concat(t,".localhost/").concat(r):"".concat(t,"://").concat(r)}});function s(e){return c.apply(this,arguments)}function c(){return(c=_asyncToGenerator(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",o("tauri",t));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function p(){return(p=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"App",message:{cmd:"getAppVersion"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function l(){return(l=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"App",message:{cmd:"getAppName"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function f(){return(f=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"App",message:{cmd:"getTauriVersion"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var h=Object.freeze({__proto__:null,getName:function(){return l.apply(this,arguments)},getVersion:function(){return p.apply(this,arguments)},getTauriVersion:function(){return f.apply(this,arguments)}});function m(){return(m=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Cli",message:{cmd:"cliMatches"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var d=Object.freeze({__proto__:null,getMatches:function(){return m.apply(this,arguments)}});function y(){return(y=_asyncToGenerator(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Clipboard",message:{cmd:"writeText",data:t}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function g(){return(g=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Clipboard",message:{cmd:"readText"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var _=Object.freeze({__proto__:null,writeText:function(e){return y.apply(this,arguments)},readText:function(){return g.apply(this,arguments)}});function w(){return(w=_asyncToGenerator(regeneratorRuntime.mark((function e(){var t,r=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return"object"===_typeof(t=r.length>0&&void 0!==r[0]?r[0]:{})&&Object.freeze(t),e.abrupt("return",s({__tauriModule:"Dialog",message:{cmd:"openDialog",options:t}}));case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function v(){return(v=_asyncToGenerator(regeneratorRuntime.mark((function e(){var t,r=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return"object"===_typeof(t=r.length>0&&void 0!==r[0]?r[0]:{})&&Object.freeze(t),e.abrupt("return",s({__tauriModule:"Dialog",message:{cmd:"saveDialog",options:t}}));case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function b(){return(b=_asyncToGenerator(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Dialog",message:{cmd:"messageDialog",message:t}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function R(){return(R=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Dialog",message:{cmd:"askDialog",title:r,message:t}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function k(){return(k=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Dialog",message:{cmd:"confirmDialog",title:r,message:t}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var x=Object.freeze({__proto__:null,open:function(){return w.apply(this,arguments)},save:function(){return v.apply(this,arguments)},message:function(e){return b.apply(this,arguments)},ask:function(e,t){return R.apply(this,arguments)},confirm:function(e,t){return k.apply(this,arguments)}});function T(e,t){return G.apply(this,arguments)}function G(){return(G=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Event",message:{cmd:"unlisten",event:t,eventId:r}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function P(e,t,r){return M.apply(this,arguments)}function M(){return(M=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r,n){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,s({__tauriModule:"Event",message:{cmd:"emit",event:t,windowLabel:r,payload:"string"==typeof n?n:JSON.stringify(n)}});case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function O(e,t,r){return C.apply(this,arguments)}function C(){return(C=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r,n){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Event",message:{cmd:"listen",event:t,windowLabel:r,handler:a(n)}}).then((function(e){return _asyncToGenerator(regeneratorRuntime.mark((function r(){return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",T(t,e));case 1:case"end":return r.stop()}}),r)})))})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function A(e,t,r){return j.apply(this,arguments)}function j(){return(j=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r,n){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",O(t,r,(function(e){n(e),T(t,e.id).catch((function(){}))})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function S(e,t){return D.apply(this,arguments)}function D(){return(D=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",O(t,null,r));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function L(e,t){return z.apply(this,arguments)}function z(){return(z=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",A(t,null,r));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function E(e,t){return W.apply(this,arguments)}function W(){return(W=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",P(t,void 0,r));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var F,I=Object.freeze({__proto__:null,listen:S,once:L,emit:E});function N(){return(N=_asyncToGenerator(regeneratorRuntime.mark((function e(t){var r,n=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.length>1&&void 0!==n[1]?n[1]:{},e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"readTextFile",path:t,options:r}}));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function U(){return(U=_asyncToGenerator(regeneratorRuntime.mark((function e(t){var r,n,a=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=a.length>1&&void 0!==a[1]?a[1]:{},e.next=3,s({__tauriModule:"Fs",message:{cmd:"readFile",path:t,options:r}});case 3:return n=e.sent,e.abrupt("return",Uint8Array.from(n));case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function H(){return(H=_asyncToGenerator(regeneratorRuntime.mark((function e(t){var r,n=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return"object"===_typeof(r=n.length>1&&void 0!==n[1]?n[1]:{})&&Object.freeze(r),"object"===_typeof(t)&&Object.freeze(t),e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"writeFile",path:t.path,contents:Array.from((new TextEncoder).encode(t.contents)),options:r}}));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function V(){return(V=_asyncToGenerator(regeneratorRuntime.mark((function e(t){var r,n=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return"object"===_typeof(r=n.length>1&&void 0!==n[1]?n[1]:{})&&Object.freeze(r),"object"===_typeof(t)&&Object.freeze(t),e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"writeFile",path:t.path,contents:Array.from(t.contents),options:r}}));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function q(){return(q=_asyncToGenerator(regeneratorRuntime.mark((function e(t){var r,n=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.length>1&&void 0!==n[1]?n[1]:{},e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"readDir",path:t,options:r}}));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function B(){return(B=_asyncToGenerator(regeneratorRuntime.mark((function e(t){var r,n=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.length>1&&void 0!==n[1]?n[1]:{},e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"createDir",path:t,options:r}}));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function J(){return(J=_asyncToGenerator(regeneratorRuntime.mark((function e(t){var r,n=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.length>1&&void 0!==n[1]?n[1]:{},e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"removeDir",path:t,options:r}}));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function K(){return(K=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){var n,a=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=a.length>2&&void 0!==a[2]?a[2]:{},e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"copyFile",source:t,destination:r,options:n}}));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Y(){return(Y=_asyncToGenerator(regeneratorRuntime.mark((function e(t){var r,n=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.length>1&&void 0!==n[1]?n[1]:{},e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"removeFile",path:t,options:r}}));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function $(){return($=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){var n,a=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=a.length>2&&void 0!==a[2]?a[2]:{},e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"renameFile",oldPath:t,newPath:r,options:n}}));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}!function(e){e[e.Audio=1]="Audio";e[e.Cache=2]="Cache";e[e.Config=3]="Config";e[e.Data=4]="Data";e[e.LocalData=5]="LocalData";e[e.Desktop=6]="Desktop";e[e.Document=7]="Document";e[e.Download=8]="Download";e[e.Executable=9]="Executable";e[e.Font=10]="Font";e[e.Home=11]="Home";e[e.Picture=12]="Picture";e[e.Public=13]="Public";e[e.Runtime=14]="Runtime";e[e.Template=15]="Template";e[e.Video=16]="Video";e[e.Resource=17]="Resource";e[e.App=18]="App";e[e.Log=19]="Log";e[e.Temp=20]="Temp"}(F||(F={}));var Q=Object.freeze({__proto__:null,get BaseDirectory(){return F},get Dir(){return F},readTextFile:function(e){return N.apply(this,arguments)},readBinaryFile:function(e){return U.apply(this,arguments)},writeFile:function(e){return H.apply(this,arguments)},writeBinaryFile:function(e){return V.apply(this,arguments)},readDir:function(e){return q.apply(this,arguments)},createDir:function(e){return B.apply(this,arguments)},removeDir:function(e){return J.apply(this,arguments)},copyFile:function(e,t){return K.apply(this,arguments)},removeFile:function(e){return Y.apply(this,arguments)},renameFile:function(e,t){return $.apply(this,arguments)}});function X(){return(X=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"GlobalShortcut",message:{cmd:"register",shortcut:t,handler:a(r)}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Z(){return(Z=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"GlobalShortcut",message:{cmd:"registerAll",shortcuts:t,handler:a(r)}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ee(){return(ee=_asyncToGenerator(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"GlobalShortcut",message:{cmd:"isRegistered",shortcut:t}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function te(){return(te=_asyncToGenerator(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"GlobalShortcut",message:{cmd:"unregister",shortcut:t}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function re(){return(re=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"GlobalShortcut",message:{cmd:"unregisterAll"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var ne,ae=Object.freeze({__proto__:null,register:function(e,t){return X.apply(this,arguments)},registerAll:function(e,t){return Z.apply(this,arguments)},isRegistered:function(e){return ee.apply(this,arguments)},unregister:function(e){return te.apply(this,arguments)},unregisterAll:function(){return re.apply(this,arguments)}});function oe(e,t){return null!=e?e:t()}function ie(e){for(var t=void 0,r=e[0],n=1;n=200&&this.status<300,this.headers=t.headers,this.rawHeaders=t.rawHeaders,this.data=t.data})),ce=function(){function e(t){_classCallCheck(this,e),this.id=t}var t,r,n,a,o,i,u;return _createClass(e,[{key:"drop",value:(u=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Http",message:{cmd:"dropClient",client:this.id}}));case 1:case"end":return e.stop()}}),e,this)}))),function(){return u.apply(this,arguments)})},{key:"request",value:(i=_asyncToGenerator(regeneratorRuntime.mark((function e(t){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(r=!t.responseType||t.responseType===ne.JSON)&&(t.responseType=ne.Text),e.abrupt("return",s({__tauriModule:"Http",message:{cmd:"httpRequest",client:this.id,options:t}}).then((function(e){var t=new se(e);if(r){try{t.data=JSON.parse(t.data)}catch(e){if(t.ok&&""===t.data)t.data={};else if(t.ok)throw Error("Failed to parse response `".concat(t.data,"` as JSON: ").concat(e,";\n try setting the `responseType` option to `ResponseType.Text` or `ResponseType.Binary` if the API does not return a JSON response."))}return t}return t})));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"get",value:(o=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.request(_objectSpread({method:"GET",url:t},r)));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return o.apply(this,arguments)})},{key:"post",value:(a=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r,n){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.request(_objectSpread({method:"POST",url:t,body:r},n)));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return a.apply(this,arguments)})},{key:"put",value:(n=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r,n){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.request(_objectSpread({method:"PUT",url:t,body:r},n)));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return n.apply(this,arguments)})},{key:"patch",value:(r=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.request(_objectSpread({method:"PATCH",url:t},r)));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"delete",value:(t=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.request(_objectSpread({method:"DELETE",url:t},r)));case 1:case"end":return e.stop()}}),e,this)}))),function(e,r){return t.apply(this,arguments)})}]),e}();function pe(e){return le.apply(this,arguments)}function le(){return(le=_asyncToGenerator(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Http",message:{cmd:"createClient",options:t}}).then((function(e){return new ce(e)})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var fe=null;function he(){return(he=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==fe){e.next=4;break}return e.next=3,pe();case 3:fe=e.sent;case 4:return e.abrupt("return",fe.request(_objectSpread({url:t,method:oe(ie([r,"optionalAccess",function(e){return e.method}]),(function(){return"GET"}))},r)));case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var me=Object.freeze({__proto__:null,getClient:pe,fetch:function(e,t){return he.apply(this,arguments)},Body:ue,Client:ce,Response:se,get ResponseType(){return ne}});function de(){return(de=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("default"===window.Notification.permission){e.next=2;break}return e.abrupt("return",Promise.resolve("granted"===window.Notification.permission));case 2:return e.abrupt("return",s({__tauriModule:"Notification",message:{cmd:"isNotificationPermissionGranted"}}));case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ye(){return(ye=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",window.Notification.requestPermission());case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var ge=Object.freeze({__proto__:null,sendNotification:function(e){"string"==typeof e?new window.Notification(e):new window.Notification(e.title,e)},requestPermission:function(){return ye.apply(this,arguments)},isPermissionGranted:function(){return de.apply(this,arguments)}});function _e(){return navigator.appVersion.includes("Win")}function we(){return(we=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.App}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ve(){return(ve=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Audio}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function be(){return(be=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Cache}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Re(){return(Re=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Config}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ke(){return(ke=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Data}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function xe(){return(xe=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Desktop}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Te(){return(Te=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Document}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ge(){return(Ge=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Download}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Pe(){return(Pe=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Executable}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Me(){return(Me=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Font}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Oe(){return(Oe=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Home}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ce(){return(Ce=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.LocalData}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ae(){return(Ae=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Picture}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function je(){return(je=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Public}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Se(){return(Se=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Resource}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function De(){return(De=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Runtime}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Le(){return(Le=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Template}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ze(){return(ze=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Video}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ee(){return(Ee=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Log}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var We=_e()?"\\":"/",Fe=_e()?";":":";function Ie(){return(Ie=_asyncToGenerator(regeneratorRuntime.mark((function e(){var t,r,n,a=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(t=a.length,r=new Array(t),n=0;n0&&void 0!==r[0]?r[0]:0,e.abrupt("return",s({__tauriModule:"Process",message:{cmd:"exit",exitCode:t}}));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ye(){return(Ye=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Process",message:{cmd:"relaunch"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var $e=Object.freeze({__proto__:null,exit:function(){return Ke.apply(this,arguments)},relaunch:function(){return Ye.apply(this,arguments)}});function Qe(e,t){return null!=e?e:t()}function Xe(e,t){return Ze.apply(this,arguments)}function Ze(){return(Ze=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){var n,o,i=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=i.length>2&&void 0!==i[2]?i[2]:[],o=i.length>3?i[3]:void 0,"object"===_typeof(n)&&Object.freeze(n),e.abrupt("return",s({__tauriModule:"Shell",message:{cmd:"execute",program:r,args:n,options:o,onEventFn:a(t)}}));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var et=function(){function e(){_classCallCheck(this,e),e.prototype.__init.call(this)}return _createClass(e,[{key:"__init",value:function(){this.eventListeners=Object.create(null)}},{key:"addEventListener",value:function(e,t){e in this.eventListeners?this.eventListeners[e].push(t):this.eventListeners[e]=[t]}},{key:"_emit",value:function(e,t){if(e in this.eventListeners){var r,n=_createForOfIteratorHelper(this.eventListeners[e]);try{for(n.s();!(r=n.n()).done;){(0,r.value)(t)}}catch(e){n.e(e)}finally{n.f()}}}},{key:"on",value:function(e,t){return this.addEventListener(e,t),this}}]),e}(),tt=function(){function e(t){_classCallCheck(this,e),this.pid=t}var t,r;return _createClass(e,[{key:"write",value:(r=_asyncToGenerator(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Shell",message:{cmd:"stdinWrite",pid:this.pid,buffer:"string"==typeof t?t:Array.from(t)}}));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"kill",value:(t=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Shell",message:{cmd:"killChild",pid:this.pid}}));case 1:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}]),e}(),rt=function(e){_inherits(a,e);var t,r,n=_createSuper(a);function a(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],o=arguments.length>2?arguments[2]:void 0;return _classCallCheck(this,a),t=n.call(this),a.prototype.__init2.call(_assertThisInitialized(t)),a.prototype.__init3.call(_assertThisInitialized(t)),t.program=e,t.args="string"==typeof r?[r]:r,t.options=Qe(o,(function(){return{}})),t}return _createClass(a,[{key:"__init2",value:function(){this.stdout=new et}},{key:"__init3",value:function(){this.stderr=new et}},{key:"spawn",value:(r=_asyncToGenerator(regeneratorRuntime.mark((function e(){var t=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Xe((function(e){switch(e.event){case"Error":t._emit("error",e.payload);break;case"Terminated":t._emit("close",e.payload);break;case"Stdout":t.stdout._emit("data",e.payload);break;case"Stderr":t.stderr._emit("data",e.payload)}}),this.program,this.args,this.options).then((function(e){return new tt(e)})));case 1:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"execute",value:(t=_asyncToGenerator(regeneratorRuntime.mark((function e(){var t=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){t.on("error",r);var n=[],a=[];t.stdout.on("data",(function(e){n.push(e)})),t.stderr.on("data",(function(e){a.push(e)})),t.on("close",(function(t){e({code:t.code,signal:t.signal,stdout:n.join("\n"),stderr:a.join("\n")})})),t.spawn().catch(r)})));case 1:case"end":return e.stop()}}),e)}))),function(){return t.apply(this,arguments)})}],[{key:"sidecar",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0,n=new a(e,t,r);return n.options.sidecar=!0,n}}]),a}(et);function nt(){return(nt=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Shell",message:{cmd:"open",path:t,with:r}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var at=Object.freeze({__proto__:null,Command:rt,Child:tt,EventEmitter:et,open:function(e,t){return nt.apply(this,arguments)}});function ot(e){for(var t=void 0,r=e[0],n=1;n1&&void 0!==arguments[1]?arguments[1]:{};return _classCallCheck(this,r),n=t.call(this,e),ct([a,"optionalAccess",function(e){return e.skip}])||s({__tauriModule:"Window",message:{cmd:"createWebview",data:{options:_objectSpread({label:e},a)}}}).then(_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",n.emit("tauri://created"));case 1:case"end":return e.stop()}}),e)})))).catch(function(){var e=_asyncToGenerator(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",n.emit("tauri://error",t));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),n}return _createClass(r,null,[{key:"getByLabel",value:function(e){return dt().some((function(t){return t.label===e}))?new r(e,{skip:!0}):null}}]),r}(wt);function bt(){return(bt=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"currentMonitor"}}}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Rt(){return(Rt=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"primaryMonitor"}}}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function kt(){return(kt=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"availableMonitors"}}}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}"__TAURI_METADATA__"in window?yt=new vt(window.__TAURI_METADATA__.__currentWindow.label,{skip:!0}):(console.warn('Could not find "window.__TAURI_METADATA__". The "appWindow" value will reference the "main" window label.\nNote that this is not an issue if running this frontend on a browser instead of a Tauri window.'),yt=new vt("main",{skip:!0}));var xt=Object.freeze({__proto__:null,WebviewWindow:vt,WebviewWindowHandle:_t,WindowManager:wt,getCurrent:function(){return new vt(window.__TAURI_METADATA__.__currentWindow.label,{skip:!0})},getAll:dt,get appWindow(){return yt},LogicalSize:lt,PhysicalSize:ft,LogicalPosition:ht,PhysicalPosition:mt,get UserAttentionType(){return pt},currentMonitor:function(){return bt.apply(this,arguments)},primaryMonitor:function(){return Rt.apply(this,arguments)},availableMonitors:function(){return kt.apply(this,arguments)}}),Tt=_e()?"\r\n":"\n";function Gt(){return(Gt=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Os",message:{cmd:"platform"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Pt(){return(Pt=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Os",message:{cmd:"version"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Mt(){return(Mt=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Os",message:{cmd:"osType"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ot(){return(Ot=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Os",message:{cmd:"arch"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ct(){return(Ct=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Os",message:{cmd:"tempdir"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var At=Object.freeze({__proto__:null,EOL:Tt,platform:function(){return Gt.apply(this,arguments)},version:function(){return Pt.apply(this,arguments)},type:function(){return Mt.apply(this,arguments)},arch:function(){return Ot.apply(this,arguments)},tempdir:function(){return Ct.apply(this,arguments)}}),jt=o;e.app=h,e.cli=d,e.clipboard=_,e.dialog=x,e.event=I,e.fs=Q,e.globalShortcut=ae,e.http=me,e.invoke=jt,e.notification=ge,e.os=At,e.path=Je,e.process=$e,e.shell=at,e.tauri=u,e.updater=st,e.window=xt,Object.defineProperty(e,"__esModule",{value:!0})})); diff --git a/core/tauri/src/app.rs b/core/tauri/src/app.rs index 533fcdf3c..c00cd5a90 100644 --- a/core/tauri/src/app.rs +++ b/core/tauri/src/app.rs @@ -776,7 +776,7 @@ impl Builder { /// /// ## Platform-specific /// - /// - **macOS**: on macOS the application *must* be executed on the main thread, so this function is not exposed. + /// - **macOS:** on macOS the application *must* be executed on the main thread, so this function is not exposed. #[cfg(any(windows, target_os = "linux"))] #[cfg_attr(doc_cfg, doc(cfg(any(windows, target_os = "linux"))))] #[must_use] diff --git a/core/tauri/src/endpoints/window.rs b/core/tauri/src/endpoints/window.rs index b7fe0eb94..662a77e56 100644 --- a/core/tauri/src/endpoints/window.rs +++ b/core/tauri/src/endpoints/window.rs @@ -11,7 +11,7 @@ use crate::{ UserAttentionType, }, utils::config::WindowConfig, - Icon, Manager, Runtime, + CursorIcon, Icon, Manager, Runtime, }; use serde::Deserialize; use tauri_macros::{module_command_handler, CommandModule}; @@ -95,6 +95,10 @@ pub enum WindowManagerCmd { icon: IconDto, }, SetSkipTaskbar(bool), + SetCursorGrab(bool), + SetCursorVisible(bool), + SetCursorIcon(CursorIcon), + SetCursorPosition(Position), StartDragging, Print, // internals @@ -141,6 +145,18 @@ impl WindowManagerCmd { Self::SetSkipTaskbar(_) => { crate::Error::ApiNotAllowlisted("window > setSkipTaskbar".to_string()) } + Self::SetCursorGrab(_) => { + crate::Error::ApiNotAllowlisted("window > setCursorGrab".to_string()) + } + Self::SetCursorVisible(_) => { + crate::Error::ApiNotAllowlisted("window > setCursorVisible".to_string()) + } + Self::SetCursorIcon(_) => { + crate::Error::ApiNotAllowlisted("window > setCursorIcon".to_string()) + } + Self::SetCursorPosition(_) => { + crate::Error::ApiNotAllowlisted("window > setCursorPosition".to_string()) + } Self::StartDragging => crate::Error::ApiNotAllowlisted("window > startDragging".to_string()), Self::Print => crate::Error::ApiNotAllowlisted("window > print".to_string()), Self::InternalToggleMaximize => { @@ -270,6 +286,14 @@ impl Cmd { WindowManagerCmd::SetIcon { icon } => window.set_icon(icon.into())?, #[cfg(window_set_skip_taskbar)] WindowManagerCmd::SetSkipTaskbar(skip) => window.set_skip_taskbar(skip)?, + #[cfg(window_set_cursor_grab)] + WindowManagerCmd::SetCursorGrab(grab) => window.set_cursor_grab(grab)?, + #[cfg(window_set_cursor_visible)] + WindowManagerCmd::SetCursorVisible(visible) => window.set_cursor_visible(visible)?, + #[cfg(window_set_cursor_icon)] + WindowManagerCmd::SetCursorIcon(icon) => window.set_cursor_icon(icon)?, + #[cfg(window_set_cursor_position)] + WindowManagerCmd::SetCursorPosition(position) => window.set_cursor_position(position)?, #[cfg(window_start_dragging)] WindowManagerCmd::StartDragging => window.start_dragging()?, #[cfg(window_print)] diff --git a/core/tauri/src/lib.rs b/core/tauri/src/lib.rs index 313fbeb81..7b223d4d1 100644 --- a/core/tauri/src/lib.rs +++ b/core/tauri/src/lib.rs @@ -214,7 +214,7 @@ pub use { webview::WebviewAttributes, window::{ dpi::{LogicalPosition, LogicalSize, PhysicalPosition, PhysicalSize, Pixel, Position, Size}, - FileDropEvent, + CursorIcon, FileDropEvent, }, ClipboardManager, GlobalShortcutManager, RunIteration, TrayIcon, UserAttentionType, }, diff --git a/core/tauri/src/test/mock_runtime.rs b/core/tauri/src/test/mock_runtime.rs index f83cf604b..d6942f6d2 100644 --- a/core/tauri/src/test/mock_runtime.rs +++ b/core/tauri/src/test/mock_runtime.rs @@ -10,7 +10,7 @@ use tauri_runtime::{ webview::{WindowBuilder, WindowBuilderBase}, window::{ dpi::{PhysicalPosition, PhysicalSize, Position, Size}, - DetachedWindow, MenuEvent, PendingWindow, WindowEvent, + CursorIcon, DetachedWindow, MenuEvent, PendingWindow, WindowEvent, }, ClipboardManager, Dispatch, EventLoopProxy, GlobalShortcutManager, Result, RunEvent, Runtime, RuntimeHandle, UserAttentionType, UserEvent, WindowIcon, @@ -479,6 +479,22 @@ impl Dispatch for MockDispatcher { Ok(()) } + fn set_cursor_grab(&self, grab: bool) -> Result<()> { + Ok(()) + } + + fn set_cursor_visible(&self, visible: bool) -> Result<()> { + Ok(()) + } + + fn set_cursor_icon(&self, icon: CursorIcon) -> Result<()> { + Ok(()) + } + + fn set_cursor_position>(&self, position: Pos) -> Result<()> { + Ok(()) + } + fn start_dragging(&self) -> Result<()> { Ok(()) } diff --git a/core/tauri/src/window.rs b/core/tauri/src/window.rs index e4c260f3f..ab55a48c1 100644 --- a/core/tauri/src/window.rs +++ b/core/tauri/src/window.rs @@ -28,7 +28,7 @@ use crate::{ sealed::ManagerBase, sealed::RuntimeOrDispatch, utils::config::WindowUrl, - EventLoopMessage, Icon, Invoke, InvokeError, InvokeMessage, InvokeResolver, Manager, + CursorIcon, EventLoopMessage, Icon, Invoke, InvokeError, InvokeMessage, InvokeResolver, Manager, PageLoadPayload, Runtime, Theme, WindowEvent, }; @@ -774,7 +774,7 @@ impl Window { /// /// ## Platform-specific /// - /// - **macOS**: This is a private API on macOS, + /// - **macOS:** This is a private API on macOS, /// so you cannot use this if your application will be published on the App Store. /// /// # Examples @@ -1178,6 +1178,59 @@ impl Window { .map_err(Into::into) } + /// Grabs the cursor, preventing it from leaving the window. + /// + /// There's no guarantee that the cursor will be hidden. You should + /// hide it by yourself if you want so. + /// + /// ## Platform-specific + /// + /// - **Linux:** Unsupported. + /// - **macOS:** This locks the cursor in a fixed location, which looks visually awkward. + pub fn set_cursor_grab(&self, grab: bool) -> crate::Result<()> { + self + .window + .dispatcher + .set_cursor_grab(grab) + .map_err(Into::into) + } + + /// Modifies the cursor's visibility. + /// + /// If `false`, this will hide the cursor. If `true`, this will show the cursor. + /// + /// ## Platform-specific + /// + /// - **Linux:** Unsupported. + /// - **Windows:** The cursor is only hidden within the confines of the window. + /// - **macOS:** The cursor is hidden as long as the window has input focus, even if the cursor is + /// outside of the window. + pub fn set_cursor_visible(&self, visible: bool) -> crate::Result<()> { + self + .window + .dispatcher + .set_cursor_visible(visible) + .map_err(Into::into) + } + + /// Modifies the cursor icon of the window. + pub fn set_cursor_icon(&self, icon: CursorIcon) -> crate::Result<()> { + self + .window + .dispatcher + .set_cursor_icon(icon) + .map_err(Into::into) + } + + /// Changes the position of the cursor in window coordinates. + pub fn set_cursor_position>(&self, position: Pos) -> crate::Result<()> { + self + .window + .dispatcher + .set_cursor_position(position) + .map_err(Into::into) + } + /// Starts dragging the window. pub fn start_dragging(&self) -> crate::Result<()> { self.window.dispatcher.start_dragging().map_err(Into::into) diff --git a/examples/api/dist/assets/index.js b/examples/api/dist/assets/index.js index 582f8a333..8801254ab 100644 --- a/examples/api/dist/assets/index.js +++ b/examples/api/dist/assets/index.js @@ -1,24 +1,28 @@ -var Ql=Object.defineProperty,Zl=Object.defineProperties;var $l=Object.getOwnPropertyDescriptors;var hl=Object.getOwnPropertySymbols;var xl=Object.prototype.hasOwnProperty,ei=Object.prototype.propertyIsEnumerable;var ml=(n,e,l)=>e in n?Ql(n,e,{enumerable:!0,configurable:!0,writable:!0,value:l}):n[e]=l,vl=(n,e)=>{for(var l in e||(e={}))xl.call(e,l)&&ml(n,l,e[l]);if(hl)for(var l of hl(e))ei.call(e,l)&&ml(n,l,e[l]);return n},_l=(n,e)=>Zl(n,$l(e));import{S as V,i as J,s as K,e as a,a as m,t as M,b as u,c as T,d as t,l as y,f as j,n as I,g as S,r as Q,h as ti,j as ni,o as li,k as ii,m as gl,p as si,q as Pt,u as bl,v as hn,w as mn,x as oi,y as H,z as wl,A as kl,B as ai,C as Wt,D as lt,E as yl,F as ui,G as ri,H as ci,I as Cl,J as Ut,K as pi,L as Ml,M as zl,N as F,O as Tl,P as vn,Q as _n,R as Sl,T as Ll,U as fi,V as di,W as El,X as Hl,Y as hi,Z as mi,_ as vi,$ as _i,a0 as gi,a1 as bi,a2 as wi,a3 as ki,a4 as Ol,a5 as Rl,a6 as Al,a7 as Pl,a8 as yi,a9 as Wl,aa as Ul,ab as Ci,ac as Mi,ad as zi}from"./vendor.js";const Ti=function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const r of o.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&i(r)}).observe(document,{childList:!0,subtree:!0});function l(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerpolicy&&(o.referrerPolicy=s.referrerpolicy),s.crossorigin==="use-credentials"?o.credentials="include":s.crossorigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function i(s){if(s.ep)return;s.ep=!0;const o=l(s);fetch(s.href,o)}};Ti();function Si(n){let e,l,i,s,o,r,c,h,d,k,w,f,p,v,b,_,z,C,A,P,W;return{c(){e=a("h1"),e.textContent="Welcome",l=m(),i=a("p"),i.textContent="Tauri's API capabilities using the ` @tauri-apps/api ` package. It's used as\n the main validation app, serving as the testbed of our development process. In\n the future, this app will be used on Tauri's integration tests.",s=m(),o=a("p"),r=M("Current App version: "),c=M(n[0]),h=m(),d=a("p"),k=M("Current Tauri version: "),w=M(n[1]),f=m(),p=a("p"),v=M("Current App name: "),b=M(n[2]),_=m(),z=a("button"),z.textContent="Close application",C=m(),A=a("button"),A.textContent="Relaunch application",u(z,"class","button"),u(A,"class","button")},m(L,U){T(L,e,U),T(L,l,U),T(L,i,U),T(L,s,U),T(L,o,U),t(o,r),t(o,c),T(L,h,U),T(L,d,U),t(d,k),t(d,w),T(L,f,U),T(L,p,U),t(p,v),t(p,b),T(L,_,U),T(L,z,U),T(L,C,U),T(L,A,U),P||(W=[y(z,"click",n[3]),y(A,"click",n[4])],P=!0)},p(L,[U]){U&1&&j(c,L[0]),U&2&&j(w,L[1]),U&4&&j(b,L[2])},i:I,o:I,d(L){L&&S(e),L&&S(l),L&&S(i),L&&S(s),L&&S(o),L&&S(h),L&&S(d),L&&S(f),L&&S(p),L&&S(_),L&&S(z),L&&S(C),L&&S(A),P=!1,Q(W)}}}function Li(n,e,l){let i=0,s=0,o="Unknown";ti().then(h=>{l(2,o=h)}),ni().then(h=>{l(0,i=h)}),li().then(h=>{l(1,s=h)});async function r(){await ii()}async function c(){await gl()}return[i,s,o,r,c]}class Ei extends V{constructor(e){super();J(this,e,Li,Si,K,{})}}function Hi(n){let e,l,i,s,o,r,c,h,d,k,w;return{c(){e=a("div"),l=M(`This binary can be run on the terminal and takes the following arguments: - `),i=a("ul"),i.innerHTML=`
  • --config PATH
  • +var yi=Object.defineProperty,zi=Object.defineProperties;var Ci=Object.getOwnPropertyDescriptors;var Dl=Object.getOwnPropertySymbols;var Mi=Object.prototype.hasOwnProperty,Ti=Object.prototype.propertyIsEnumerable;var jl=(n,e,l)=>e in n?yi(n,e,{enumerable:!0,configurable:!0,writable:!0,value:l}):n[e]=l,Gl=(n,e)=>{for(var l in e||(e={}))Mi.call(e,l)&&jl(n,l,e[l]);if(Dl)for(var l of Dl(e))Ti.call(e,l)&&jl(n,l,e[l]);return n},Bl=(n,e)=>zi(n,Ci(e));import{S as J,i as X,s as Y,e as u,a as h,t as z,b as a,c as T,d as t,l as y,f as G,n as I,g as S,r as x,h as Si,j as Ri,o as Li,k as Ei,m as Fl,p as Hi,q as en,u as Vl,v as In,w as Un,x as Oi,y as L,z as Jl,A as Xl,B as Ai,C as tn,D as $e,E as Yl,F as Pi,G as Wi,H as Ii,I as Nn,J as xe,K as Ui,L as Kl,M as qn,N as B,O as Ql,P as nn,Q as Dn,R as Zl,T as $l,U as Ni,V as qi,W as xl,X as ei,Y as Di,Z as ji,_ as Gi,$ as Bi,a0 as Fi,a1 as Vi,a2 as Ji,a3 as Xi,a4 as ti,a5 as ni,a6 as li,a7 as ii,a8 as Yi,a9 as si,aa as oi,ab as Ki,ac as Qi,ad as Zi}from"./vendor.js";const $i=function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const r of o.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&i(r)}).observe(document,{childList:!0,subtree:!0});function l(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerpolicy&&(o.referrerPolicy=s.referrerpolicy),s.crossorigin==="use-credentials"?o.credentials="include":s.crossorigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function i(s){if(s.ep)return;s.ep=!0;const o=l(s);fetch(s.href,o)}};$i();function xi(n){let e,l,i,s,o,r,c,v,m,k,w,d,p,_,b,g,M,C,W,P,A;return{c(){e=u("h1"),e.textContent="Welcome",l=h(),i=u("p"),i.textContent="Tauri's API capabilities using the ` @tauri-apps/api ` package. It's used as\n the main validation app, serving as the testbed of our development process. In\n the future, this app will be used on Tauri's integration tests.",s=h(),o=u("p"),r=z("Current App version: "),c=z(n[0]),v=h(),m=u("p"),k=z("Current Tauri version: "),w=z(n[1]),d=h(),p=u("p"),_=z("Current App name: "),b=z(n[2]),g=h(),M=u("button"),M.textContent="Close application",C=h(),W=u("button"),W.textContent="Relaunch application",a(M,"class","button"),a(W,"class","button")},m(E,U){T(E,e,U),T(E,l,U),T(E,i,U),T(E,s,U),T(E,o,U),t(o,r),t(o,c),T(E,v,U),T(E,m,U),t(m,k),t(m,w),T(E,d,U),T(E,p,U),t(p,_),t(p,b),T(E,g,U),T(E,M,U),T(E,C,U),T(E,W,U),P||(A=[y(M,"click",n[3]),y(W,"click",n[4])],P=!0)},p(E,[U]){U&1&&G(c,E[0]),U&2&&G(w,E[1]),U&4&&G(b,E[2])},i:I,o:I,d(E){E&&S(e),E&&S(l),E&&S(i),E&&S(s),E&&S(o),E&&S(v),E&&S(m),E&&S(d),E&&S(p),E&&S(g),E&&S(M),E&&S(C),E&&S(W),P=!1,x(A)}}}function es(n,e,l){let i=0,s=0,o="Unknown";Si().then(v=>{l(2,o=v)}),Ri().then(v=>{l(0,i=v)}),Li().then(v=>{l(1,s=v)});async function r(){await Ei()}async function c(){await Fl()}return[i,s,o,r,c]}class ts extends J{constructor(e){super();X(this,e,es,xi,Y,{})}}function ns(n){let e,l,i,s,o,r,c,v,m,k,w;return{c(){e=u("div"),l=z(`This binary can be run on the terminal and takes the following arguments: + `),i=u("ul"),i.innerHTML=`
  • --config PATH
  • --theme light|dark|system
  • -
  • --verbose
  • `,s=M(` - Additionally, it has a `),o=a("i"),o.textContent="update --background",r=M(` subcommand. +
  • --verbose
  • `,s=z(` + Additionally, it has a `),o=u("i"),o.textContent="update --background",r=z(` subcommand. Note that the arguments are only parsed, not implemented. - `),c=a("br"),h=m(),d=a("button"),d.textContent="Get matches",u(d,"class","button"),u(d,"id","cli-matches")},m(f,p){T(f,e,p),t(e,l),t(e,i),t(e,s),t(e,o),t(e,r),t(e,c),t(e,h),t(e,d),k||(w=y(d,"click",n[0]),k=!0)},p:I,i:I,o:I,d(f){f&&S(e),k=!1,w()}}}function Oi(n,e,l){let{onMessage:i}=e;function s(){si().then(i).catch(i)}return n.$$set=o=>{"onMessage"in o&&l(1,i=o.onMessage)},[s,i]}class Ri extends V{constructor(e){super();J(this,e,Oi,Hi,K,{onMessage:1})}}function Ai(n){let e,l,i,s,o,r,c,h;return{c(){e=a("div"),l=a("button"),l.textContent="Call Log API",i=m(),s=a("button"),s.textContent="Call Request (async) API",o=m(),r=a("button"),r.textContent="Send event to Rust",u(l,"class","button"),u(l,"id","log"),u(s,"class","button"),u(s,"id","request"),u(r,"class","button"),u(r,"id","event")},m(d,k){T(d,e,k),t(e,l),t(e,i),t(e,s),t(e,o),t(e,r),c||(h=[y(l,"click",n[0]),y(s,"click",n[1]),y(r,"click",n[2])],c=!0)},p:I,i:I,o:I,d(d){d&&S(e),c=!1,Q(h)}}}function Pi(n,e,l){let{onMessage:i}=e,s;Pt(async()=>{s=await bl("rust-event",i)}),hn(()=>{s&&s()});function o(){mn("log_operation",{event:"tauri-click",payload:"this payload is optional because we used Option in Rust"})}function r(){mn("perform_request",{endpoint:"dummy endpoint arg",body:{id:5,name:"test"}}).then(i).catch(i)}function c(){oi("js-event","this is the payload string")}return n.$$set=h=>{"onMessage"in h&&l(3,i=h.onMessage)},[o,r,c,i]}class Wi extends V{constructor(e){super();J(this,e,Pi,Ai,K,{onMessage:3})}}function Ui(n){let e,l,i,s,o,r,c,h,d,k,w,f,p,v,b,_,z,C,A,P;return{c(){e=a("div"),l=a("input"),i=m(),s=a("input"),o=m(),r=a("div"),c=a("input"),h=m(),d=a("label"),d.textContent="Multiple",k=m(),w=a("div"),f=a("input"),p=m(),v=a("label"),v.textContent="Directory",b=m(),_=a("button"),_.textContent="Open dialog",z=m(),C=a("button"),C.textContent="Open save dialog",u(l,"id","dialog-default-path"),u(l,"placeholder","Default path"),u(s,"id","dialog-filter"),u(s,"placeholder","Extensions filter, comma-separated"),u(s,"class","svelte-1eg58yg"),u(c,"type","checkbox"),u(c,"id","dialog-multiple"),u(d,"for","dialog-multiple"),u(f,"type","checkbox"),u(f,"id","dialog-directory"),u(v,"for","dialog-directory"),u(_,"class","button"),u(_,"id","open-dialog"),u(C,"class","button"),u(C,"id","save-dialog")},m(W,L){T(W,e,L),t(e,l),H(l,n[0]),t(e,i),t(e,s),H(s,n[1]),t(e,o),t(e,r),t(r,c),c.checked=n[2],t(r,h),t(r,d),t(e,k),t(e,w),t(w,f),f.checked=n[3],t(w,p),t(w,v),t(e,b),t(e,_),t(e,z),t(e,C),A||(P=[y(l,"input",n[8]),y(s,"input",n[9]),y(c,"change",n[10]),y(f,"change",n[11]),y(_,"click",n[4]),y(C,"click",n[5])],A=!0)},p(W,[L]){L&1&&l.value!==W[0]&&H(l,W[0]),L&2&&s.value!==W[1]&&H(s,W[1]),L&4&&(c.checked=W[2]),L&8&&(f.checked=W[3])},i:I,o:I,d(W){W&&S(e),A=!1,Q(P)}}}function Ii(n,e){var l=new Blob([n],{type:"application/octet-binary"}),i=new FileReader;i.onload=function(s){var o=s.target.result;e(o.substr(o.indexOf(",")+1))},i.readAsDataURL(l)}function Ni(n,e,l){let{onMessage:i}=e,{insecureRenderHtml:s}=e,o=null,r=null,c=!1,h=!1;function d(){wl({title:"My wonderful open dialog",defaultPath:o,filters:r?[{name:"Tauri Example",extensions:r.split(",").map(b=>b.trim())}]:[],multiple:c,directory:h}).then(function(b){if(Array.isArray(b))i(b);else{var _=b,z=_.match(/\S+\.\S+$/g);kl(_).then(function(C){z&&(_.includes(".png")||_.includes(".jpg"))?Ii(new Uint8Array(C),function(A){var P="data:image/png;base64,"+A;s('')}):i(b)}).catch(i(b))}}).catch(i)}function k(){ai({title:"My wonderful save dialog",defaultPath:o,filters:r?[{name:"Tauri Example",extensions:r.split(",").map(b=>b.trim())}]:[]}).then(i).catch(i)}function w(){o=this.value,l(0,o)}function f(){r=this.value,l(1,r)}function p(){c=this.checked,l(2,c)}function v(){h=this.checked,l(3,h)}return n.$$set=b=>{"onMessage"in b&&l(6,i=b.onMessage),"insecureRenderHtml"in b&&l(7,s=b.insecureRenderHtml)},[o,r,c,h,d,k,i,s,w,f,p,v]}class qi extends V{constructor(e){super();J(this,e,Ni,Ui,K,{onMessage:6,insecureRenderHtml:7})}}function Il(n,e,l){const i=n.slice();return i[9]=e[l],i}function Nl(n){let e,l=n[9][0]+"",i,s;return{c(){e=a("option"),i=M(l),e.__value=s=n[9][1],e.value=e.__value},m(o,r){T(o,e,r),t(e,i)},p:I,d(o){o&&S(e)}}}function Di(n){let e,l,i,s,o,r,c,h,d,k,w,f,p,v=n[2],b=[];for(let _=0;_isNaN(parseInt(f))).map(f=>[f,yl[f]]);function h(){const f=o.match(/\S+\.\S+$/g),p={dir:ql()};(f?kl(o,p):ui(o,p)).then(function(b){if(f)if(o.includes(".png")||o.includes(".jpg"))ji(new Uint8Array(b),function(_){const z="data:image/png;base64,"+_;s('')});else{const _=String.fromCharCode.apply(null,b);s(''),setTimeout(()=>{const z=document.getElementById("file-response");z.value=_,document.getElementById("file-save").addEventListener("click",function(){writeFile({file:o,contents:z.value},{dir:ql()}).catch(i)})})}else i(b)}).catch(i)}function d(){l(1,r.src=ri(o),r)}function k(){o=this.value,l(0,o)}function w(f){ci[f?"unshift":"push"](()=>{r=f,l(1,r)})}return n.$$set=f=>{"onMessage"in f&&l(5,i=f.onMessage),"insecureRenderHtml"in f&&l(6,s=f.insecureRenderHtml)},[o,r,c,h,d,i,s,k,w]}class Fi extends V{constructor(e){super();J(this,e,Bi,Di,K,{onMessage:5,insecureRenderHtml:6})}}function Gi(n){let e,l,i,s,o,r,c,h,d,k,w,f,p,v,b,_,z;return{c(){e=a("form"),l=a("select"),i=a("option"),i.textContent="GET",s=a("option"),s.textContent="POST",o=a("option"),o.textContent="PUT",r=a("option"),r.textContent="PATCH",c=a("option"),c.textContent="DELETE",h=m(),d=a("input"),k=m(),w=a("br"),f=m(),p=a("textarea"),v=m(),b=a("button"),b.textContent="Make request",i.__value="GET",i.value=i.__value,s.__value="POST",s.value=s.__value,o.__value="PUT",o.value=o.__value,r.__value="PATCH",r.value=r.__value,c.__value="DELETE",c.value=c.__value,u(l,"class","button"),u(l,"id","request-method"),n[0]===void 0&&Cl(()=>n[5].call(l)),u(d,"id","request-url"),u(d,"placeholder","Type the request URL..."),u(p,"id","request-body"),u(p,"placeholder","Request body"),u(p,"rows","5"),u(p,"class","svelte-1xfmj7b"),u(b,"class","button"),u(b,"id","make-request")},m(C,A){T(C,e,A),t(e,l),t(l,i),t(l,s),t(l,o),t(l,r),t(l,c),Ut(l,n[0]),t(e,h),t(e,d),H(d,n[1]),t(e,k),t(e,w),t(e,f),t(e,p),H(p,n[2]),t(e,v),t(e,b),_||(z=[y(l,"change",n[5]),y(d,"input",n[6]),y(p,"input",n[7]),y(e,"submit",Wt(n[3]))],_=!0)},p(C,[A]){A&1&&Ut(l,C[0]),A&2&&d.value!==C[1]&&H(d,C[1]),A&4&&H(p,C[2])},i:I,o:I,d(C){C&&S(e),_=!1,Q(z)}}}function Vi(n,e,l){let i="GET",s="https://jsonplaceholder.typicode.com/todos/1",o="",{onMessage:r}=e;async function c(){const w=await pi().catch(b=>{throw r(b),b}),v={url:s||""||"",method:i||"GET"||"GET"};o.startsWith("{")&&o.endsWith("}")||o.startsWith("[")&&o.endsWith("]")?v.body=Ml.json(JSON.parse(o)):o!==""&&(v.body=Ml.text(o)),w.request(v).then(r).catch(r)}function h(){i=zl(this),l(0,i)}function d(){s=this.value,l(1,s)}function k(){o=this.value,l(2,o)}return n.$$set=w=>{"onMessage"in w&&l(4,r=w.onMessage)},[i,s,o,c,r,h,d,k]}class Ji extends V{constructor(e){super();J(this,e,Vi,Gi,K,{onMessage:4})}}function Ki(n){let e,l,i;return{c(){e=a("button"),e.textContent="Send test notification",u(e,"class","button"),u(e,"id","notification")},m(s,o){T(s,e,o),l||(i=y(e,"click",Xi),l=!0)},p:I,i:I,o:I,d(s){s&&S(e),l=!1,i()}}}function Xi(){new Notification("Notification title",{body:"This is the notification body"})}function Yi(n,e,l){let{onMessage:i}=e;return n.$$set=s=>{"onMessage"in s&&l(0,i=s.onMessage)},[i]}class Qi extends V{constructor(e){super();J(this,e,Yi,Ki,K,{onMessage:0})}}function Dl(n,e,l){const i=n.slice();return i[54]=e[l],i}function jl(n){let e,l=n[54]+"",i,s;return{c(){e=a("option"),i=M(l),e.__value=s=n[54],e.value=e.__value},m(o,r){T(o,e,r),t(e,i)},p(o,r){r[0]&2&&l!==(l=o[54]+"")&&j(i,l),r[0]&2&&s!==(s=o[54])&&(e.__value=s,e.value=e.__value)},d(o){o&&S(e)}}}function Zi(n){let e,l,i,s,o,r,c,h,d,k,w,f,p,v,b,_,z,C,A,P,W,L,U,q,Z,se,G,D,R,x,O,X,it,st,Te,ot,Ne,$,ue,Se,at,ee,ut,Le,rt,te,ct,re,Ee,pt,ne,ft,He,dt,le,ht,N,ye,gn,ce,bn,mt,wn,pe,kn,Oe,vt,yn,oe,Cn,_t,Mn,ae,It,ie,Re,fe,Nt,zn,qe,Tn,gt=n[20].width+"",qt,Sn,De,Ln,bt=n[20].height+"",Dt,En,de,jt,Hn,je,On,wt=n[21].width+"",Bt,Rn,Be,An,kt=n[21].height+"",Ft,Pn,Ae,he,Gt,Wn,Fe,Un,yt=n[20].toLogical(n[17]).width+"",Vt,In,Ge,Nn,Ct=n[20].toLogical(n[17]).height+"",Jt,qn,me,Kt,Dn,Ve,jn,Mt=n[21].toLogical(n[17]).width+"",Xt,Bn,Je,Fn,zt=n[21].toLogical(n[17]).height+"",Yt,Gn,Pe,ve,Qt,Vn,Ke,Jn,Tt=n[18].x+"",Zt,Kn,Xe,Xn,St=n[18].y+"",$t,Yn,_e,xt,Qn,Ye,Zn,Lt=n[19].x+"",en,$n,Qe,xn,Et=n[19].y+"",tn,el,We,ge,nn,tl,Ze,nl,Ht=n[18].toLogical(n[17]).x+"",ln,ll,$e,il,Ot=n[18].toLogical(n[17]).y+"",sn,sl,be,on,ol,xe,al,Rt=n[19].toLogical(n[17]).x+"",an,ul,et,rl,At=n[19].toLogical(n[17]).y+"",un,rn,we,Ce,cl,tt,cn,ke,Me,pl,nt,pn,ze,fn,Ue,dn,fl,Ie=Object.keys(n[1]),Y=[];for(let g=0;gn[31].call(l)),u(r,"type","checkbox"),u(k,"type","checkbox"),u(p,"title","Unminimizes after 2 seconds"),u(b,"title","Unminimizes after 2 seconds"),u(z,"title","Visible again after 2 seconds"),u(P,"type","checkbox"),u(q,"type","checkbox"),u(D,"type","checkbox"),u(X,"type","checkbox"),u(ee,"type","number"),u(ee,"min","0"),u(ee,"class","svelte-1tppwwz"),u(te,"type","number"),u(te,"min","0"),u(te,"class","svelte-1tppwwz"),u(ue,"class","flex col grow svelte-1tppwwz"),u(ne,"type","number"),u(ne,"min","400"),u(ne,"class","svelte-1tppwwz"),u(le,"type","number"),u(le,"min","400"),u(le,"class","svelte-1tppwwz"),u(re,"class","flex col grow svelte-1tppwwz"),u(ce,"type","number"),u(ce,"class","svelte-1tppwwz"),u(pe,"type","number"),u(pe,"class","svelte-1tppwwz"),u(N,"class","flex col grow svelte-1tppwwz"),u(oe,"type","number"),u(oe,"min","400"),u(oe,"class","svelte-1tppwwz"),u(ae,"type","number"),u(ae,"min","400"),u(ae,"class","svelte-1tppwwz"),u(Oe,"class","flex col grow svelte-1tppwwz"),u($,"class","window-controls flex flex-row svelte-1tppwwz"),u(e,"class","flex col"),u(qe,"class","svelte-1tppwwz"),u(De,"class","svelte-1tppwwz"),u(fe,"class","grow window-property svelte-1tppwwz"),u(je,"class","svelte-1tppwwz"),u(Be,"class","svelte-1tppwwz"),u(de,"class","grow window-property svelte-1tppwwz"),u(Re,"class","flex"),u(Fe,"class","svelte-1tppwwz"),u(Ge,"class","svelte-1tppwwz"),u(he,"class","grow window-property svelte-1tppwwz"),u(Ve,"class","svelte-1tppwwz"),u(Je,"class","svelte-1tppwwz"),u(me,"class","grow window-property svelte-1tppwwz"),u(Ae,"class","flex"),u(Ke,"class","svelte-1tppwwz"),u(Xe,"class","svelte-1tppwwz"),u(ve,"class","grow window-property svelte-1tppwwz"),u(Ye,"class","svelte-1tppwwz"),u(Qe,"class","svelte-1tppwwz"),u(_e,"class","grow window-property svelte-1tppwwz"),u(Pe,"class","flex"),u(Ze,"class","svelte-1tppwwz"),u($e,"class","svelte-1tppwwz"),u(ge,"class","grow window-property svelte-1tppwwz"),u(xe,"class","svelte-1tppwwz"),u(et,"class","svelte-1tppwwz"),u(be,"class","grow window-property svelte-1tppwwz"),u(We,"class","flex"),u(Ce,"id","title"),u(tt,"class","button"),u(tt,"type","submit"),u(we,"class","svelte-1tppwwz"),u(Me,"id","url"),u(nt,"class","button"),u(nt,"id","open-url"),u(ke,"class","svelte-1tppwwz"),u(ze,"class","button"),u(ze,"title","Minimizes the window, requests attention for 3s and then resets it"),u(Ue,"class","button")},m(g,E){T(g,e,E),t(e,l);for(let B=0;B{typeof N=="string"&&s[i].setIcon(N)})}function st(){const N=Math.random().toString().replace(".",""),ye=new fi(N);l(1,s[N]=ye,s),ye.once("tauri://error",function(){o("Error creating new webview")})}function Te(){s[i].innerSize().then(N=>{l(20,q=N),l(7,p=q.width),l(8,v=q.height)}),s[i].outerSize().then(N=>{l(21,Z=N)})}function ot(){s[i].innerPosition().then(N=>{l(18,L=N)}),s[i].outerPosition().then(N=>{l(19,U=N),l(13,A=U.x),l(14,P=U.y)})}async function Ne(N){se&&se(),G&&G(),G=await N.listen("tauri://move",ot),se=await N.listen("tauri://resize",Te)}async function $(){await s[i].minimize(),await s[i].requestUserAttention(di.Critical),await new Promise(N=>setTimeout(N,3e3)),await s[i].requestUserAttention(null)}function ue(){i=zl(this),l(0,i),l(1,s)}function Se(){c=this.checked,l(2,c)}function at(){h=this.checked,l(3,h)}const ee=()=>s[i].center();function ut(){d=this.checked,l(16,d)}function Le(){k=this.checked,l(4,k)}function rt(){w=this.checked,l(5,w)}function te(){f=this.checked,l(6,f)}function ct(){A=F(this.value),l(13,A)}function re(){P=F(this.value),l(14,P)}function Ee(){p=F(this.value),l(7,p)}function pt(){v=F(this.value),l(8,v)}function ne(){b=F(this.value),l(9,b)}function ft(){_=F(this.value),l(10,_)}function He(){z=F(this.value),l(11,z)}function dt(){C=F(this.value),l(12,C)}function le(){D=this.value,l(22,D)}function ht(){r=this.value,l(15,r)}return n.$$set=N=>{"onMessage"in N&&l(30,o=N.onMessage)},n.$$.update=()=>{n.$$.dirty[0]&7&&s[i].setResizable(c),n.$$.dirty[0]&11&&(h?s[i].maximize():s[i].unmaximize()),n.$$.dirty[0]&19&&s[i].setDecorations(k),n.$$.dirty[0]&35&&s[i].setAlwaysOnTop(w),n.$$.dirty[0]&67&&s[i].setFullscreen(f),n.$$.dirty[0]&387&&s[i].setSize(new _n(p,v)),n.$$.dirty[0]&1539&&(b&&_?s[i].setMinSize(new Sl(b,_)):s[i].setMinSize(null)),n.$$.dirty[0]&6147&&(z&&C?s[i].setMaxSize(new Sl(z,C)):s[i].setMaxSize(null)),n.$$.dirty[0]&24579&&s[i].setPosition(new vn(A,P)),n.$$.dirty[0]&3&&s[i].scaleFactor().then(N=>l(17,W=N)),n.$$.dirty[0]&3&&Ne(s[i])},[i,s,c,h,k,w,f,p,v,b,_,z,C,A,P,r,d,W,L,U,q,Z,D,R,x,O,X,it,st,$,o,ue,Se,at,ee,ut,Le,rt,te,ct,re,Ee,pt,ne,ft,He,dt,le,ht]}class xi extends V{constructor(e){super();J(this,e,$i,Zi,K,{onMessage:30},[-1,-1])}}function Bl(n,e,l){const i=n.slice();return i[9]=e[l],i}function Fl(n){let e,l=n[9]+"",i,s,o,r,c;function h(){return n[8](n[9])}return{c(){e=a("div"),i=M(l),s=m(),o=a("button"),o.textContent="Unregister",u(o,"type","button")},m(d,k){T(d,e,k),t(e,i),t(e,s),t(e,o),r||(c=y(o,"click",h),r=!0)},p(d,k){n=d,k&2&&l!==(l=n[9]+"")&&j(i,l)},d(d){d&&S(e),r=!1,c()}}}function Gl(n){let e,l,i;return{c(){e=a("button"),e.textContent="Unregister all",u(e,"type","button")},m(s,o){T(s,e,o),l||(i=y(e,"click",n[5]),l=!0)},p:I,d(s){s&&S(e),l=!1,i()}}}function es(n){let e,l,i,s,o,r,c,h,d,k,w=n[1],f=[];for(let v=0;vl(1,i=f));let r="CmdOrControl+X";function c(){const f=r;hi(f,()=>{s(`Shortcut ${f} triggered`)}).then(()=>{o.update(p=>[...p,f]),s(`Shortcut ${f} registered successfully`)}).catch(s)}function h(f){const p=f;mi(p).then(()=>{o.update(v=>v.filter(b=>b!==p)),s(`Shortcut ${p} unregistered`)}).catch(s)}function d(){vi().then(()=>{o.update(()=>[]),s("Unregistered all shortcuts")}).catch(s)}function k(){r=this.value,l(0,r)}const w=f=>h(f);return n.$$set=f=>{"onMessage"in f&&l(6,s=f.onMessage)},[r,i,o,c,h,d,s,k,w]}class ns extends V{constructor(e){super();J(this,e,ts,es,K,{onMessage:6})}}function Vl(n){let e,l,i,s,o;return{c(){e=a("input"),l=m(),i=a("button"),i.textContent="Write",u(e,"placeholder","write to stdin"),u(i,"class","button")},m(r,c){T(r,e,c),H(e,n[3]),T(r,l,c),T(r,i,c),s||(o=[y(e,"input",n[10]),y(i,"click",n[7])],s=!0)},p(r,c){c&8&&e.value!==r[3]&&H(e,r[3])},d(r){r&&S(e),r&&S(l),r&&S(i),s=!1,Q(o)}}}function ls(n){let e,l,i,s,o,r,c,h,d,k,w,f,p,v,b,_=n[4]&&Vl(n);return{c(){e=a("div"),l=a("div"),i=a("input"),s=m(),o=a("button"),o.textContent="Run",r=m(),c=a("button"),c.textContent="Kill",h=m(),_&&_.c(),d=m(),k=a("div"),w=a("input"),f=m(),p=a("input"),u(o,"class","button"),u(c,"class","button"),u(w,"placeholder","Working directory"),u(p,"class","env-vars svelte-1g38c1n"),u(p,"placeholder","Environment variables")},m(z,C){T(z,e,C),t(e,l),t(l,i),H(i,n[0]),t(l,s),t(l,o),t(l,r),t(l,c),t(l,h),_&&_.m(l,null),t(e,d),t(e,k),t(k,w),H(w,n[1]),t(k,f),t(k,p),H(p,n[2]),v||(b=[y(i,"input",n[9]),y(o,"click",n[5]),y(c,"click",n[6]),y(w,"input",n[11]),y(p,"input",n[12])],v=!0)},p(z,[C]){C&1&&i.value!==z[0]&&H(i,z[0]),z[4]?_?_.p(z,C):(_=Vl(z),_.c(),_.m(l,null)):_&&(_.d(1),_=null),C&2&&w.value!==z[1]&&H(w,z[1]),C&4&&p.value!==z[2]&&H(p,z[2])},i:I,o:I,d(z){z&&S(e),_&&_.d(),v=!1,Q(b)}}}function is(n,e,l){const i=navigator.userAgent.includes("Windows");let s=i?"cmd":"sh",o=i?["/C"]:["-c"],{onMessage:r}=e,c='echo "hello world"',h=null,d="SOMETHING=value ANOTHER=2",k="",w;function f(){return d.split(" ").reduce((P,W)=>{let[L,U]=W.split("=");return _l(vl({},P),{[L]:U})},{})}function p(){l(4,w=null);const P=new _i(s,[...o,c],{cwd:h||null,env:f()});P.on("close",W=>{r(`command finished with code ${W.code} and signal ${W.signal}`),l(4,w=null)}),P.on("error",W=>r(`command error: "${W}"`)),P.stdout.on("data",W=>r(`command stdout: "${W}"`)),P.stderr.on("data",W=>r(`command stderr: "${W}"`)),P.spawn().then(W=>{l(4,w=W)}).catch(r)}function v(){w.kill().then(()=>r("killed child process")).catch(r)}function b(){w.write(k).catch(r)}function _(){c=this.value,l(0,c)}function z(){k=this.value,l(3,k)}function C(){h=this.value,l(1,h)}function A(){d=this.value,l(2,d)}return n.$$set=P=>{"onMessage"in P&&l(8,r=P.onMessage)},[c,h,d,k,w,p,v,b,r,_,z,C,A]}class ss extends V{constructor(e){super();J(this,e,is,ls,K,{onMessage:8})}}function os(n){let e,l,i,s,o,r;return{c(){e=a("div"),l=a("button"),l.textContent="Check update",i=m(),s=a("button"),s.textContent="Install update",u(l,"class","button"),u(l,"id","check_update"),u(s,"class","button hidden"),u(s,"id","start_update")},m(c,h){T(c,e,h),t(e,l),t(e,i),t(e,s),o||(r=[y(l,"click",n[0]),y(s,"click",n[1])],o=!0)},p:I,i:I,o:I,d(c){c&&S(e),o=!1,Q(r)}}}function as(n,e,l){let{onMessage:i}=e,s;Pt(async()=>{s=await bl("tauri://update-status",i)}),hn(()=>{s&&s()});async function o(){try{document.getElementById("check_update").classList.add("hidden");const{shouldUpdate:c,manifest:h}=await gi();i(`Should update: ${c}`),i(h),c&&document.getElementById("start_update").classList.remove("hidden")}catch(c){i(c)}}async function r(){try{document.getElementById("start_update").classList.add("hidden"),await bi(),i("Installation complete, restart required."),await gl()}catch(c){i(c)}}return n.$$set=c=>{"onMessage"in c&&l(2,i=c.onMessage)},[o,r,i]}class us extends V{constructor(e){super();J(this,e,as,os,K,{onMessage:2})}}function rs(n){let e,l,i,s,o,r,c,h,d;return{c(){e=a("div"),l=a("div"),i=a("input"),s=m(),o=a("button"),o.textContent="Write",r=m(),c=a("button"),c.textContent="Read",u(i,"placeholder","Text to write to the clipboard"),u(o,"type","button"),u(c,"type","button")},m(k,w){T(k,e,w),t(e,l),t(l,i),H(i,n[0]),t(l,s),t(l,o),t(e,r),t(e,c),h||(d=[y(i,"input",n[4]),y(o,"click",n[1]),y(c,"click",n[2])],h=!0)},p(k,[w]){w&1&&i.value!==k[0]&&H(i,k[0])},i:I,o:I,d(k){k&&S(e),h=!1,Q(d)}}}function cs(n,e,l){let{onMessage:i}=e,s="clipboard message";function o(){wi(s).then(()=>{i("Wrote to the clipboard")}).catch(i)}function r(){ki().then(h=>{i(`Clipboard contents: ${h}`)}).catch(i)}function c(){s=this.value,l(0,s)}return n.$$set=h=>{"onMessage"in h&&l(3,i=h.onMessage)},[s,o,r,i,c]}class ps extends V{constructor(e){super();J(this,e,cs,rs,K,{onMessage:3})}}function fs(n){let e;return{c(){e=a("div"),e.innerHTML=`

    Not available for Linux

    - `},m(l,i){T(l,e,i)},p:I,i:I,o:I,d(l){l&&S(e)}}}function ds(n,e,l){let{onMessage:i}=e;const s=window.constraints={audio:!0,video:!0};function o(c){const h=document.querySelector("video"),d=c.getVideoTracks();i("Got stream with constraints:",s),i(`Using video device: ${d[0].label}`),window.stream=c,h.srcObject=c}function r(c){if(c.name==="ConstraintNotSatisfiedError"){const h=s.video;i(`The resolution ${h.width.exact}x${h.height.exact} px is not supported by your device.`)}else c.name==="PermissionDeniedError"&&i("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.");i(`getUserMedia error: ${c.name}`,c)}return Pt(async()=>{try{const c=await navigator.mediaDevices.getUserMedia(s);o(c)}catch(c){r(c)}}),hn(()=>{window.stream.getTracks().forEach(function(c){c.stop()})}),n.$$set=c=>{"onMessage"in c&&l(0,i=c.onMessage)},[i]}class hs extends V{constructor(e){super();J(this,e,ds,fs,K,{onMessage:0})}}function ms(n){let e,l,i,s,o,r,c,h,d,k,w,f;return{c(){e=a("input"),l=m(),i=a("input"),s=m(),o=a("button"),o.textContent="Post it.",r=m(),c=a("p"),c.textContent="Result:",h=m(),d=a("pre"),k=M(n[2]),u(o,"type","button")},m(p,v){T(p,e,v),H(e,n[0]),T(p,l,v),T(p,i,v),H(i,n[1]),T(p,s,v),T(p,o,v),T(p,r,v),T(p,c,v),T(p,h,v),T(p,d,v),t(d,k),w||(f=[y(e,"input",n[4]),y(i,"input",n[5]),y(o,"click",n[3])],w=!0)},p(p,[v]){v&1&&e.value!==p[0]&&H(e,p[0]),v&2&&i.value!==p[1]&&H(i,p[1]),v&4&&j(k,p[2])},i:I,o:I,d(p){p&&S(e),p&&S(l),p&&S(i),p&&S(s),p&&S(o),p&&S(r),p&&S(c),p&&S(h),p&&S(d),w=!1,Q(f)}}}function vs(n,e,l){let i="baz",s="qux",o=null;async function r(){let d=navigator.userAgent.includes("Windows")?"https://customprotocol.test/example.html":"customprotocol://test/example.html";const w=await(await fetch(d,{method:"POST",body:JSON.stringify({foo:i,bar:s})})).json();l(2,o=JSON.stringify(w))}function c(){i=this.value,l(0,i)}function h(){s=this.value,l(1,s)}return[i,s,o,r,c,h]}class _s extends V{constructor(e){super();J(this,e,vs,ms,K,{})}}function Jl(n,e,l){const i=n.slice();return i[10]=e[l],i}function Kl(n,e,l){const i=n.slice();return i[13]=e[l],i}function Xl(n){let e,l=n[13].label+"",i,s,o,r,c;function h(){return n[9](n[13])}return{c(){e=a("p"),i=M(l),s=m(),u(e,"class",o="nv noselect "+(n[0]===n[13]?"nv_selected":""))},m(d,k){T(d,e,k),t(e,i),t(e,s),r||(c=y(e,"click",h),r=!0)},p(d,k){n=d,k&1&&o!==(o="nv noselect "+(n[0]===n[13]?"nv_selected":""))&&u(e,"class",o)},d(d){d&&S(e),r=!1,c()}}}function gs(n){let e,l=n[10].html+"",i;return{c(){i=Ol(),e=new zi(i)},m(s,o){e.m(l,s,o),T(s,i,o)},p(s,o){o&2&&l!==(l=s[10].html+"")&&e.p(l)},d(s){s&&S(i),s&&e.d()}}}function bs(n){let e,l=n[10].text+"",i;return{c(){e=a("p"),i=M(l)},m(s,o){T(s,e,o),t(e,i)},p(s,o){o&2&&l!==(l=s[10].text+"")&&j(i,l)},d(s){s&&S(e)}}}function Yl(n){let e;function l(o,r){return o[10].text?bs:gs}let i=l(n),s=i(n);return{c(){s.c(),e=Ol()},m(o,r){s.m(o,r),T(o,e,r)},p(o,r){i===(i=l(o))&&s?s.p(o,r):(s.d(1),s=i(o),s&&(s.c(),s.m(e.parentNode,e)))},d(o){s.d(o),o&&S(e)}}}function ws(n){let e,l,i,s,o,r,c,h,d,k,w,f,p,v,b,_,z,C,A,P,W,L,U=n[2],q=[];for(let R=0;RDocumentation + `),c=u("br"),v=h(),m=u("button"),m.textContent="Get matches",a(m,"class","button"),a(m,"id","cli-matches")},m(d,p){T(d,e,p),t(e,l),t(e,i),t(e,s),t(e,o),t(e,r),t(e,c),t(e,v),t(e,m),k||(w=y(m,"click",n[0]),k=!0)},p:I,i:I,o:I,d(d){d&&S(e),k=!1,w()}}}function ls(n,e,l){let{onMessage:i}=e;function s(){Hi().then(i).catch(i)}return n.$$set=o=>{"onMessage"in o&&l(1,i=o.onMessage)},[s,i]}class is extends J{constructor(e){super();X(this,e,ls,ns,Y,{onMessage:1})}}function ss(n){let e,l,i,s,o,r,c,v;return{c(){e=u("div"),l=u("button"),l.textContent="Call Log API",i=h(),s=u("button"),s.textContent="Call Request (async) API",o=h(),r=u("button"),r.textContent="Send event to Rust",a(l,"class","button"),a(l,"id","log"),a(s,"class","button"),a(s,"id","request"),a(r,"class","button"),a(r,"id","event")},m(m,k){T(m,e,k),t(e,l),t(e,i),t(e,s),t(e,o),t(e,r),c||(v=[y(l,"click",n[0]),y(s,"click",n[1]),y(r,"click",n[2])],c=!0)},p:I,i:I,o:I,d(m){m&&S(e),c=!1,x(v)}}}function os(n,e,l){let{onMessage:i}=e,s;en(async()=>{s=await Vl("rust-event",i)}),In(()=>{s&&s()});function o(){Un("log_operation",{event:"tauri-click",payload:"this payload is optional because we used Option in Rust"})}function r(){Un("perform_request",{endpoint:"dummy endpoint arg",body:{id:5,name:"test"}}).then(i).catch(i)}function c(){Oi("js-event","this is the payload string")}return n.$$set=v=>{"onMessage"in v&&l(3,i=v.onMessage)},[o,r,c,i]}class us extends J{constructor(e){super();X(this,e,os,ss,Y,{onMessage:3})}}function as(n){let e,l,i,s,o,r,c,v,m,k,w,d,p,_,b,g,M,C,W,P;return{c(){e=u("div"),l=u("input"),i=h(),s=u("input"),o=h(),r=u("div"),c=u("input"),v=h(),m=u("label"),m.textContent="Multiple",k=h(),w=u("div"),d=u("input"),p=h(),_=u("label"),_.textContent="Directory",b=h(),g=u("button"),g.textContent="Open dialog",M=h(),C=u("button"),C.textContent="Open save dialog",a(l,"id","dialog-default-path"),a(l,"placeholder","Default path"),a(s,"id","dialog-filter"),a(s,"placeholder","Extensions filter, comma-separated"),a(s,"class","svelte-1eg58yg"),a(c,"type","checkbox"),a(c,"id","dialog-multiple"),a(m,"for","dialog-multiple"),a(d,"type","checkbox"),a(d,"id","dialog-directory"),a(_,"for","dialog-directory"),a(g,"class","button"),a(g,"id","open-dialog"),a(C,"class","button"),a(C,"id","save-dialog")},m(A,E){T(A,e,E),t(e,l),L(l,n[0]),t(e,i),t(e,s),L(s,n[1]),t(e,o),t(e,r),t(r,c),c.checked=n[2],t(r,v),t(r,m),t(e,k),t(e,w),t(w,d),d.checked=n[3],t(w,p),t(w,_),t(e,b),t(e,g),t(e,M),t(e,C),W||(P=[y(l,"input",n[8]),y(s,"input",n[9]),y(c,"change",n[10]),y(d,"change",n[11]),y(g,"click",n[4]),y(C,"click",n[5])],W=!0)},p(A,[E]){E&1&&l.value!==A[0]&&L(l,A[0]),E&2&&s.value!==A[1]&&L(s,A[1]),E&4&&(c.checked=A[2]),E&8&&(d.checked=A[3])},i:I,o:I,d(A){A&&S(e),W=!1,x(P)}}}function rs(n,e){var l=new Blob([n],{type:"application/octet-binary"}),i=new FileReader;i.onload=function(s){var o=s.target.result;e(o.substr(o.indexOf(",")+1))},i.readAsDataURL(l)}function cs(n,e,l){let{onMessage:i}=e,{insecureRenderHtml:s}=e,o=null,r=null,c=!1,v=!1;function m(){Jl({title:"My wonderful open dialog",defaultPath:o,filters:r?[{name:"Tauri Example",extensions:r.split(",").map(b=>b.trim())}]:[],multiple:c,directory:v}).then(function(b){if(Array.isArray(b))i(b);else{var g=b,M=g.match(/\S+\.\S+$/g);Xl(g).then(function(C){M&&(g.includes(".png")||g.includes(".jpg"))?rs(new Uint8Array(C),function(W){var P="data:image/png;base64,"+W;s('')}):i(b)}).catch(i(b))}}).catch(i)}function k(){Ai({title:"My wonderful save dialog",defaultPath:o,filters:r?[{name:"Tauri Example",extensions:r.split(",").map(b=>b.trim())}]:[]}).then(i).catch(i)}function w(){o=this.value,l(0,o)}function d(){r=this.value,l(1,r)}function p(){c=this.checked,l(2,c)}function _(){v=this.checked,l(3,v)}return n.$$set=b=>{"onMessage"in b&&l(6,i=b.onMessage),"insecureRenderHtml"in b&&l(7,s=b.insecureRenderHtml)},[o,r,c,v,m,k,i,s,w,d,p,_]}class ps extends J{constructor(e){super();X(this,e,cs,as,Y,{onMessage:6,insecureRenderHtml:7})}}function ui(n,e,l){const i=n.slice();return i[9]=e[l],i}function ai(n){let e,l=n[9][0]+"",i,s;return{c(){e=u("option"),i=z(l),e.__value=s=n[9][1],e.value=e.__value},m(o,r){T(o,e,r),t(e,i)},p:I,d(o){o&&S(e)}}}function fs(n){let e,l,i,s,o,r,c,v,m,k,w,d,p,_=n[2],b=[];for(let g=0;g<_.length;g+=1)b[g]=ai(ui(n,_,g));return{c(){e=u("form"),l=u("select"),i=u("option"),i.textContent="None";for(let g=0;gisNaN(parseInt(d))).map(d=>[d,Yl[d]]);function v(){const d=o.match(/\S+\.\S+$/g),p={dir:ri()};(d?Xl(o,p):Pi(o,p)).then(function(b){if(d)if(o.includes(".png")||o.includes(".jpg"))ds(new Uint8Array(b),function(g){const M="data:image/png;base64,"+g;s('')});else{const g=String.fromCharCode.apply(null,b);s(''),setTimeout(()=>{const M=document.getElementById("file-response");M.value=g,document.getElementById("file-save").addEventListener("click",function(){writeFile({file:o,contents:M.value},{dir:ri()}).catch(i)})})}else i(b)}).catch(i)}function m(){l(1,r.src=Wi(o),r)}function k(){o=this.value,l(0,o)}function w(d){Ii[d?"unshift":"push"](()=>{r=d,l(1,r)})}return n.$$set=d=>{"onMessage"in d&&l(5,i=d.onMessage),"insecureRenderHtml"in d&&l(6,s=d.insecureRenderHtml)},[o,r,c,v,m,i,s,k,w]}class ms extends J{constructor(e){super();X(this,e,hs,fs,Y,{onMessage:5,insecureRenderHtml:6})}}function vs(n){let e,l,i,s,o,r,c,v,m,k,w,d,p,_,b,g,M;return{c(){e=u("form"),l=u("select"),i=u("option"),i.textContent="GET",s=u("option"),s.textContent="POST",o=u("option"),o.textContent="PUT",r=u("option"),r.textContent="PATCH",c=u("option"),c.textContent="DELETE",v=h(),m=u("input"),k=h(),w=u("br"),d=h(),p=u("textarea"),_=h(),b=u("button"),b.textContent="Make request",i.__value="GET",i.value=i.__value,s.__value="POST",s.value=s.__value,o.__value="PUT",o.value=o.__value,r.__value="PATCH",r.value=r.__value,c.__value="DELETE",c.value=c.__value,a(l,"class","button"),a(l,"id","request-method"),n[0]===void 0&&Nn(()=>n[5].call(l)),a(m,"id","request-url"),a(m,"placeholder","Type the request URL..."),a(p,"id","request-body"),a(p,"placeholder","Request body"),a(p,"rows","5"),a(p,"class","svelte-1xfmj7b"),a(b,"class","button"),a(b,"id","make-request")},m(C,W){T(C,e,W),t(e,l),t(l,i),t(l,s),t(l,o),t(l,r),t(l,c),xe(l,n[0]),t(e,v),t(e,m),L(m,n[1]),t(e,k),t(e,w),t(e,d),t(e,p),L(p,n[2]),t(e,_),t(e,b),g||(M=[y(l,"change",n[5]),y(m,"input",n[6]),y(p,"input",n[7]),y(e,"submit",tn(n[3]))],g=!0)},p(C,[W]){W&1&&xe(l,C[0]),W&2&&m.value!==C[1]&&L(m,C[1]),W&4&&L(p,C[2])},i:I,o:I,d(C){C&&S(e),g=!1,x(M)}}}function _s(n,e,l){let i="GET",s="https://jsonplaceholder.typicode.com/todos/1",o="",{onMessage:r}=e;async function c(){const w=await Ui().catch(b=>{throw r(b),b}),_={url:s||""||"",method:i||"GET"||"GET"};o.startsWith("{")&&o.endsWith("}")||o.startsWith("[")&&o.endsWith("]")?_.body=Kl.json(JSON.parse(o)):o!==""&&(_.body=Kl.text(o)),w.request(_).then(r).catch(r)}function v(){i=qn(this),l(0,i)}function m(){s=this.value,l(1,s)}function k(){o=this.value,l(2,o)}return n.$$set=w=>{"onMessage"in w&&l(4,r=w.onMessage)},[i,s,o,c,r,v,m,k]}class gs extends J{constructor(e){super();X(this,e,_s,vs,Y,{onMessage:4})}}function bs(n){let e,l,i;return{c(){e=u("button"),e.textContent="Send test notification",a(e,"class","button"),a(e,"id","notification")},m(s,o){T(s,e,o),l||(i=y(e,"click",ws),l=!0)},p:I,i:I,o:I,d(s){s&&S(e),l=!1,i()}}}function ws(){new Notification("Notification title",{body:"This is the notification body"})}function ks(n,e,l){let{onMessage:i}=e;return n.$$set=s=>{"onMessage"in s&&l(0,i=s.onMessage)},[i]}class ys extends J{constructor(e){super();X(this,e,ks,bs,Y,{onMessage:0})}}function ci(n,e,l){const i=n.slice();return i[65]=e[l],i}function pi(n,e,l){const i=n.slice();return i[68]=e[l],i}function fi(n){let e,l=n[68]+"",i,s;return{c(){e=u("option"),i=z(l),e.__value=s=n[68],e.value=e.__value},m(o,r){T(o,e,r),t(e,i)},p(o,r){r[0]&2&&l!==(l=o[68]+"")&&G(i,l),r[0]&2&&s!==(s=o[68])&&(e.__value=s,e.value=e.__value)},d(o){o&&S(e)}}}function di(n){let e,l=n[65]+"",i,s;return{c(){e=u("option"),i=z(l),e.__value=s=n[65],e.value=e.__value},m(o,r){T(o,e,r),t(e,i)},p:I,d(o){o&&S(e)}}}function zs(n){let e,l,i,s,o,r,c,v,m,k,w,d,p,_,b,g,M,C,W,P,A,E,U,q,K,fe,V,j,O,Q,H,F,Se,Re,Pe,wt,et,ee,de,We,kt,le,yt,Ie,zt,ie,Ct,he,Ue,Mt,se,Tt,Ne,St,oe,Rt,me,qe,Lt,ue,Et,De,Ht,ae,Ot,ve,je,D,te,jn,At,Gn,ce,ln,re,Ge,_e,sn,Bn,tt,Fn,Pt=n[25].width+"",on,Vn,nt,Jn,Wt=n[25].height+"",un,Xn,ge,an,Yn,lt,Kn,It=n[26].width+"",rn,Qn,it,Zn,Ut=n[26].height+"",cn,$n,Be,be,pn,xn,st,el,Nt=n[25].toLogical(n[22]).width+"",fn,tl,ot,nl,qt=n[25].toLogical(n[22]).height+"",dn,ll,we,hn,il,ut,sl,Dt=n[26].toLogical(n[22]).width+"",mn,ol,at,ul,jt=n[26].toLogical(n[22]).height+"",vn,al,Fe,ke,_n,rl,rt,cl,Gt=n[23].x+"",gn,pl,ct,fl,Bt=n[23].y+"",bn,dl,ye,wn,hl,pt,ml,Ft=n[24].x+"",kn,vl,ft,_l,Vt=n[24].y+"",yn,gl,Ve,ze,zn,bl,dt,wl,Jt=n[23].toLogical(n[22]).x+"",Cn,kl,ht,yl,Xt=n[23].toLogical(n[22]).y+"",Mn,zl,Ce,Tn,Cl,mt,Ml,Yt=n[24].toLogical(n[22]).x+"",Sn,Tl,vt,Sl,Kt=n[24].toLogical(n[22]).y+"",Rn,Ln,ne,En,Rl,Qt,Je,Ll,El,Zt,Xe,Hl,Ol,pe,Al,Ye,$t,Pl,Le,Wl,xt,Il,Ee,Hn,Me,He,Ul,_t,On,Te,Oe,Nl,gt,An,Ae,Pn,Ke,Wn,ql,Qe=Object.keys(n[1]),Z=[];for(let f=0;fn[37].call(l)),a(r,"type","checkbox"),a(k,"type","checkbox"),a(p,"title","Unminimizes after 2 seconds"),a(b,"title","Unminimizes after 2 seconds"),a(M,"title","Visible again after 2 seconds"),a(P,"type","checkbox"),a(q,"type","checkbox"),a(j,"type","checkbox"),a(F,"type","checkbox"),a(le,"type","number"),a(le,"min","0"),a(le,"class","svelte-1tppwwz"),a(ie,"type","number"),a(ie,"min","0"),a(ie,"class","svelte-1tppwwz"),a(de,"class","flex col grow svelte-1tppwwz"),a(se,"type","number"),a(se,"min","400"),a(se,"class","svelte-1tppwwz"),a(oe,"type","number"),a(oe,"min","400"),a(oe,"class","svelte-1tppwwz"),a(he,"class","flex col grow svelte-1tppwwz"),a(ue,"type","number"),a(ue,"class","svelte-1tppwwz"),a(ae,"type","number"),a(ae,"class","svelte-1tppwwz"),a(me,"class","flex col grow svelte-1tppwwz"),a(te,"type","number"),a(te,"min","400"),a(te,"class","svelte-1tppwwz"),a(ce,"type","number"),a(ce,"min","400"),a(ce,"class","svelte-1tppwwz"),a(ve,"class","flex col grow svelte-1tppwwz"),a(ee,"class","window-controls flex flex-row svelte-1tppwwz"),a(e,"class","flex col"),a(tt,"class","svelte-1tppwwz"),a(nt,"class","svelte-1tppwwz"),a(_e,"class","grow window-property svelte-1tppwwz"),a(lt,"class","svelte-1tppwwz"),a(it,"class","svelte-1tppwwz"),a(ge,"class","grow window-property svelte-1tppwwz"),a(Ge,"class","flex"),a(st,"class","svelte-1tppwwz"),a(ot,"class","svelte-1tppwwz"),a(be,"class","grow window-property svelte-1tppwwz"),a(ut,"class","svelte-1tppwwz"),a(at,"class","svelte-1tppwwz"),a(we,"class","grow window-property svelte-1tppwwz"),a(Be,"class","flex"),a(rt,"class","svelte-1tppwwz"),a(ct,"class","svelte-1tppwwz"),a(ke,"class","grow window-property svelte-1tppwwz"),a(pt,"class","svelte-1tppwwz"),a(ft,"class","svelte-1tppwwz"),a(ye,"class","grow window-property svelte-1tppwwz"),a(Fe,"class","flex"),a(dt,"class","svelte-1tppwwz"),a(ht,"class","svelte-1tppwwz"),a(ze,"class","grow window-property svelte-1tppwwz"),a(mt,"class","svelte-1tppwwz"),a(vt,"class","svelte-1tppwwz"),a(Ce,"class","grow window-property svelte-1tppwwz"),a(Ve,"class","flex"),a(Je,"type","checkbox"),a(Xe,"type","checkbox"),a(pe,"class","button"),n[19]===void 0&&Nn(()=>n[55].call(pe)),a(Le,"type","number"),a(Ee,"type","number"),a(Ye,"class","flex col grow svelte-1tppwwz"),a(He,"id","title"),a(_t,"class","button"),a(_t,"type","submit"),a(Me,"class","svelte-1tppwwz"),a(Oe,"id","url"),a(gt,"class","button"),a(gt,"id","open-url"),a(Te,"class","svelte-1tppwwz"),a(Ae,"class","button"),a(Ae,"title","Minimizes the window, requests attention for 3s and then resets it"),a(Ke,"class","button")},m(f,R){T(f,e,R),t(e,l);for(let N=0;N{typeof D=="string"&&s[i].setIcon(D)})}function We(){const D=Math.random().toString().replace(".",""),te=new Ni(D);l(1,s[D]=te,s),te.once("tauri://error",function(){r("Error creating new webview")})}function kt(){s[i].innerSize().then(D=>{l(25,K=D),l(7,_=K.width),l(8,b=K.height)}),s[i].outerSize().then(D=>{l(26,fe=D)})}function le(){s[i].innerPosition().then(D=>{l(23,U=D)}),s[i].outerPosition().then(D=>{l(24,q=D),l(13,P=q.x),l(14,A=q.y)})}async function yt(D){V&&V(),j&&j(),j=await D.listen("tauri://move",le),V=await D.listen("tauri://resize",kt)}async function Ie(){await s[i].minimize(),await s[i].requestUserAttention(qi.Critical),await new Promise(D=>setTimeout(D,3e3)),await s[i].requestUserAttention(null)}function zt(){i=qn(this),l(0,i),l(1,s)}function ie(){v=this.checked,l(2,v)}function Ct(){m=this.checked,l(3,m)}const he=()=>s[i].center();function Ue(){k=this.checked,l(21,k)}function Mt(){w=this.checked,l(4,w)}function se(){d=this.checked,l(5,d)}function Tt(){p=this.checked,l(6,p)}function Ne(){P=B(this.value),l(13,P)}function St(){A=B(this.value),l(14,A)}function oe(){_=B(this.value),l(7,_)}function Rt(){b=B(this.value),l(8,b)}function me(){g=B(this.value),l(9,g)}function qe(){M=B(this.value),l(10,M)}function Lt(){C=B(this.value),l(11,C)}function ue(){W=B(this.value),l(12,W)}function Et(){O=this.checked,l(15,O)}function De(){Q=this.checked,l(16,Q)}function Ht(){Se=qn(this),l(19,Se),l(28,o)}function ae(){H=B(this.value),l(17,H)}function Ot(){F=B(this.value),l(18,F)}function ve(){Re=this.value,l(27,Re)}function je(){c=this.value,l(20,c)}return n.$$set=D=>{"onMessage"in D&&l(36,r=D.onMessage)},n.$$.update=()=>{n.$$.dirty[0]&7&&s[i].setResizable(v),n.$$.dirty[0]&11&&(m?s[i].maximize():s[i].unmaximize()),n.$$.dirty[0]&19&&s[i].setDecorations(w),n.$$.dirty[0]&35&&s[i].setAlwaysOnTop(d),n.$$.dirty[0]&67&&s[i].setFullscreen(p),n.$$.dirty[0]&387&&s[i].setSize(new Dn(_,b)),n.$$.dirty[0]&1539&&(g&&M?s[i].setMinSize(new Zl(g,M)):s[i].setMinSize(null)),n.$$.dirty[0]&6147&&(C&&W?s[i].setMaxSize(new Zl(C,W)):s[i].setMaxSize(null)),n.$$.dirty[0]&24579&&s[i].setPosition(new nn(P,A)),n.$$.dirty[0]&3&&s[i].scaleFactor().then(D=>l(22,E=D)),n.$$.dirty[0]&3&&yt(s[i]),n.$$.dirty[0]&32771&&s[i].setCursorGrab(O),n.$$.dirty[0]&65539&&s[i].setCursorVisible(Q),n.$$.dirty[0]&524291&&s[i].setCursorIcon(Se),n.$$.dirty[0]&393219&&s[i].setCursorPosition(new nn(H,F))},[i,s,v,m,w,d,p,_,b,g,M,C,W,P,A,O,Q,H,F,Se,c,k,E,U,q,K,fe,Re,o,Pe,wt,et,ee,de,We,Ie,r,zt,ie,Ct,he,Ue,Mt,se,Tt,Ne,St,oe,Rt,me,qe,Lt,ue,Et,De,Ht,ae,Ot,ve,je]}class Ms extends J{constructor(e){super();X(this,e,Cs,zs,Y,{onMessage:36},[-1,-1,-1])}}function hi(n,e,l){const i=n.slice();return i[9]=e[l],i}function mi(n){let e,l=n[9]+"",i,s,o,r,c;function v(){return n[8](n[9])}return{c(){e=u("div"),i=z(l),s=h(),o=u("button"),o.textContent="Unregister",a(o,"type","button")},m(m,k){T(m,e,k),t(e,i),t(e,s),t(e,o),r||(c=y(o,"click",v),r=!0)},p(m,k){n=m,k&2&&l!==(l=n[9]+"")&&G(i,l)},d(m){m&&S(e),r=!1,c()}}}function vi(n){let e,l,i;return{c(){e=u("button"),e.textContent="Unregister all",a(e,"type","button")},m(s,o){T(s,e,o),l||(i=y(e,"click",n[5]),l=!0)},p:I,d(s){s&&S(e),l=!1,i()}}}function Ts(n){let e,l,i,s,o,r,c,v,m,k,w=n[1],d=[];for(let _=0;_l(1,i=d));let r="CmdOrControl+X";function c(){const d=r;Di(d,()=>{s(`Shortcut ${d} triggered`)}).then(()=>{o.update(p=>[...p,d]),s(`Shortcut ${d} registered successfully`)}).catch(s)}function v(d){const p=d;ji(p).then(()=>{o.update(_=>_.filter(b=>b!==p)),s(`Shortcut ${p} unregistered`)}).catch(s)}function m(){Gi().then(()=>{o.update(()=>[]),s("Unregistered all shortcuts")}).catch(s)}function k(){r=this.value,l(0,r)}const w=d=>v(d);return n.$$set=d=>{"onMessage"in d&&l(6,s=d.onMessage)},[r,i,o,c,v,m,s,k,w]}class Rs extends J{constructor(e){super();X(this,e,Ss,Ts,Y,{onMessage:6})}}function _i(n){let e,l,i,s,o;return{c(){e=u("input"),l=h(),i=u("button"),i.textContent="Write",a(e,"placeholder","write to stdin"),a(i,"class","button")},m(r,c){T(r,e,c),L(e,n[3]),T(r,l,c),T(r,i,c),s||(o=[y(e,"input",n[10]),y(i,"click",n[7])],s=!0)},p(r,c){c&8&&e.value!==r[3]&&L(e,r[3])},d(r){r&&S(e),r&&S(l),r&&S(i),s=!1,x(o)}}}function Ls(n){let e,l,i,s,o,r,c,v,m,k,w,d,p,_,b,g=n[4]&&_i(n);return{c(){e=u("div"),l=u("div"),i=u("input"),s=h(),o=u("button"),o.textContent="Run",r=h(),c=u("button"),c.textContent="Kill",v=h(),g&&g.c(),m=h(),k=u("div"),w=u("input"),d=h(),p=u("input"),a(o,"class","button"),a(c,"class","button"),a(w,"placeholder","Working directory"),a(p,"class","env-vars svelte-1g38c1n"),a(p,"placeholder","Environment variables")},m(M,C){T(M,e,C),t(e,l),t(l,i),L(i,n[0]),t(l,s),t(l,o),t(l,r),t(l,c),t(l,v),g&&g.m(l,null),t(e,m),t(e,k),t(k,w),L(w,n[1]),t(k,d),t(k,p),L(p,n[2]),_||(b=[y(i,"input",n[9]),y(o,"click",n[5]),y(c,"click",n[6]),y(w,"input",n[11]),y(p,"input",n[12])],_=!0)},p(M,[C]){C&1&&i.value!==M[0]&&L(i,M[0]),M[4]?g?g.p(M,C):(g=_i(M),g.c(),g.m(l,null)):g&&(g.d(1),g=null),C&2&&w.value!==M[1]&&L(w,M[1]),C&4&&p.value!==M[2]&&L(p,M[2])},i:I,o:I,d(M){M&&S(e),g&&g.d(),_=!1,x(b)}}}function Es(n,e,l){const i=navigator.userAgent.includes("Windows");let s=i?"cmd":"sh",o=i?["/C"]:["-c"],{onMessage:r}=e,c='echo "hello world"',v=null,m="SOMETHING=value ANOTHER=2",k="",w;function d(){return m.split(" ").reduce((P,A)=>{let[E,U]=A.split("=");return Bl(Gl({},P),{[E]:U})},{})}function p(){l(4,w=null);const P=new Bi(s,[...o,c],{cwd:v||null,env:d()});P.on("close",A=>{r(`command finished with code ${A.code} and signal ${A.signal}`),l(4,w=null)}),P.on("error",A=>r(`command error: "${A}"`)),P.stdout.on("data",A=>r(`command stdout: "${A}"`)),P.stderr.on("data",A=>r(`command stderr: "${A}"`)),P.spawn().then(A=>{l(4,w=A)}).catch(r)}function _(){w.kill().then(()=>r("killed child process")).catch(r)}function b(){w.write(k).catch(r)}function g(){c=this.value,l(0,c)}function M(){k=this.value,l(3,k)}function C(){v=this.value,l(1,v)}function W(){m=this.value,l(2,m)}return n.$$set=P=>{"onMessage"in P&&l(8,r=P.onMessage)},[c,v,m,k,w,p,_,b,r,g,M,C,W]}class Hs extends J{constructor(e){super();X(this,e,Es,Ls,Y,{onMessage:8})}}function Os(n){let e,l,i,s,o,r;return{c(){e=u("div"),l=u("button"),l.textContent="Check update",i=h(),s=u("button"),s.textContent="Install update",a(l,"class","button"),a(l,"id","check_update"),a(s,"class","button hidden"),a(s,"id","start_update")},m(c,v){T(c,e,v),t(e,l),t(e,i),t(e,s),o||(r=[y(l,"click",n[0]),y(s,"click",n[1])],o=!0)},p:I,i:I,o:I,d(c){c&&S(e),o=!1,x(r)}}}function As(n,e,l){let{onMessage:i}=e,s;en(async()=>{s=await Vl("tauri://update-status",i)}),In(()=>{s&&s()});async function o(){try{document.getElementById("check_update").classList.add("hidden");const{shouldUpdate:c,manifest:v}=await Fi();i(`Should update: ${c}`),i(v),c&&document.getElementById("start_update").classList.remove("hidden")}catch(c){i(c)}}async function r(){try{document.getElementById("start_update").classList.add("hidden"),await Vi(),i("Installation complete, restart required."),await Fl()}catch(c){i(c)}}return n.$$set=c=>{"onMessage"in c&&l(2,i=c.onMessage)},[o,r,i]}class Ps extends J{constructor(e){super();X(this,e,As,Os,Y,{onMessage:2})}}function Ws(n){let e,l,i,s,o,r,c,v,m;return{c(){e=u("div"),l=u("div"),i=u("input"),s=h(),o=u("button"),o.textContent="Write",r=h(),c=u("button"),c.textContent="Read",a(i,"placeholder","Text to write to the clipboard"),a(o,"type","button"),a(c,"type","button")},m(k,w){T(k,e,w),t(e,l),t(l,i),L(i,n[0]),t(l,s),t(l,o),t(e,r),t(e,c),v||(m=[y(i,"input",n[4]),y(o,"click",n[1]),y(c,"click",n[2])],v=!0)},p(k,[w]){w&1&&i.value!==k[0]&&L(i,k[0])},i:I,o:I,d(k){k&&S(e),v=!1,x(m)}}}function Is(n,e,l){let{onMessage:i}=e,s="clipboard message";function o(){Ji(s).then(()=>{i("Wrote to the clipboard")}).catch(i)}function r(){Xi().then(v=>{i(`Clipboard contents: ${v}`)}).catch(i)}function c(){s=this.value,l(0,s)}return n.$$set=v=>{"onMessage"in v&&l(3,i=v.onMessage)},[s,o,r,i,c]}class Us extends J{constructor(e){super();X(this,e,Is,Ws,Y,{onMessage:3})}}function Ns(n){let e;return{c(){e=u("div"),e.innerHTML=`

    Not available for Linux

    + `},m(l,i){T(l,e,i)},p:I,i:I,o:I,d(l){l&&S(e)}}}function qs(n,e,l){let{onMessage:i}=e;const s=window.constraints={audio:!0,video:!0};function o(c){const v=document.querySelector("video"),m=c.getVideoTracks();i("Got stream with constraints:",s),i(`Using video device: ${m[0].label}`),window.stream=c,v.srcObject=c}function r(c){if(c.name==="ConstraintNotSatisfiedError"){const v=s.video;i(`The resolution ${v.width.exact}x${v.height.exact} px is not supported by your device.`)}else c.name==="PermissionDeniedError"&&i("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.");i(`getUserMedia error: ${c.name}`,c)}return en(async()=>{try{const c=await navigator.mediaDevices.getUserMedia(s);o(c)}catch(c){r(c)}}),In(()=>{window.stream.getTracks().forEach(function(c){c.stop()})}),n.$$set=c=>{"onMessage"in c&&l(0,i=c.onMessage)},[i]}class Ds extends J{constructor(e){super();X(this,e,qs,Ns,Y,{onMessage:0})}}function js(n){let e,l,i,s,o,r,c,v,m,k,w,d;return{c(){e=u("input"),l=h(),i=u("input"),s=h(),o=u("button"),o.textContent="Post it.",r=h(),c=u("p"),c.textContent="Result:",v=h(),m=u("pre"),k=z(n[2]),a(o,"type","button")},m(p,_){T(p,e,_),L(e,n[0]),T(p,l,_),T(p,i,_),L(i,n[1]),T(p,s,_),T(p,o,_),T(p,r,_),T(p,c,_),T(p,v,_),T(p,m,_),t(m,k),w||(d=[y(e,"input",n[4]),y(i,"input",n[5]),y(o,"click",n[3])],w=!0)},p(p,[_]){_&1&&e.value!==p[0]&&L(e,p[0]),_&2&&i.value!==p[1]&&L(i,p[1]),_&4&&G(k,p[2])},i:I,o:I,d(p){p&&S(e),p&&S(l),p&&S(i),p&&S(s),p&&S(o),p&&S(r),p&&S(c),p&&S(v),p&&S(m),w=!1,x(d)}}}function Gs(n,e,l){let i="baz",s="qux",o=null;async function r(){let m=navigator.userAgent.includes("Windows")?"https://customprotocol.test/example.html":"customprotocol://test/example.html";const w=await(await fetch(m,{method:"POST",body:JSON.stringify({foo:i,bar:s})})).json();l(2,o=JSON.stringify(w))}function c(){i=this.value,l(0,i)}function v(){s=this.value,l(1,s)}return[i,s,o,r,c,v]}class Bs extends J{constructor(e){super();X(this,e,Gs,js,Y,{})}}function gi(n,e,l){const i=n.slice();return i[10]=e[l],i}function bi(n,e,l){const i=n.slice();return i[13]=e[l],i}function wi(n){let e,l=n[13].label+"",i,s,o,r,c;function v(){return n[9](n[13])}return{c(){e=u("p"),i=z(l),s=h(),a(e,"class",o="nv noselect "+(n[0]===n[13]?"nv_selected":""))},m(m,k){T(m,e,k),t(e,i),t(e,s),r||(c=y(e,"click",v),r=!0)},p(m,k){n=m,k&1&&o!==(o="nv noselect "+(n[0]===n[13]?"nv_selected":""))&&a(e,"class",o)},d(m){m&&S(e),r=!1,c()}}}function Fs(n){let e,l=n[10].html+"",i;return{c(){i=ti(),e=new Zi(i)},m(s,o){e.m(l,s,o),T(s,i,o)},p(s,o){o&2&&l!==(l=s[10].html+"")&&e.p(l)},d(s){s&&S(i),s&&e.d()}}}function Vs(n){let e,l=n[10].text+"",i;return{c(){e=u("p"),i=z(l)},m(s,o){T(s,e,o),t(e,i)},p(s,o){o&2&&l!==(l=s[10].text+"")&&G(i,l)},d(s){s&&S(e)}}}function ki(n){let e;function l(o,r){return o[10].text?Vs:Fs}let i=l(n),s=i(n);return{c(){s.c(),e=ti()},m(o,r){s.m(o,r),T(o,e,r)},p(o,r){i===(i=l(o))&&s?s.p(o,r):(s.d(1),s=i(o),s&&(s.c(),s.m(e.parentNode,e)))},d(o){s.d(o),o&&S(e)}}}function Js(n){let e,l,i,s,o,r,c,v,m,k,w,d,p,_,b,g,M,C,W,P,A,E,U=n[2],q=[];for(let O=0;ODocumentation Github - Source`,c=m(),h=a("div"),d=a("div");for(let R=0;R{Ul(O,1)}),yi()}Z?(f=new Z(se(R)),Rl(f.$$.fragment),Wl(f.$$.fragment,1),Al(f,w,null)):f=null}if(x&2){G=R[1];let O;for(O=0;O{Mi(ks,()=>{mn("menu_toggle")})});const s=[{label:"Welcome",component:Ei},{label:"Messages",component:Wi},{label:"CLI",component:Ri},{label:"Dialog",component:qi},{label:"File system",component:Fi},{label:"HTTP",component:Ji},{label:"HTTP Form",component:_s},{label:"Notifications",component:Qi},{label:"Window",component:xi},{label:"Shortcuts",component:ns},{label:"Shell",component:ss},{label:"Updater",component:us},{label:"Clipboard",component:ps},{label:"WebRTC",component:hs}];let o=s[0],r=Hl([]);El(n,r,p=>l(1,i=p));function c(p){l(0,o=p)}function h(p){r.update(v=>[{text:`[${new Date().toLocaleTimeString()}]: `+(typeof p=="string"?p:JSON.stringify(p))},...v])}function d(p){r.update(v=>[{html:p},...v])}function k(){r.update(()=>[])}function w(){Ll("https://tauri.studio/")}return[o,i,s,r,c,h,d,k,w,p=>c(p)]}class Cs extends V{constructor(e){super();J(this,e,ys,ws,K,{})}}new Cs({target:document.body}); + Source`,c=h(),v=u("div"),m=u("div");for(let O=0;O{oi(H,1)}),Yi()}K?(d=new K(fe(O)),ni(d.$$.fragment),si(d.$$.fragment,1),li(d,w,null)):d=null}if(Q&2){V=O[1];let H;for(H=0;H{Qi(Xs,()=>{Un("menu_toggle")})});const s=[{label:"Welcome",component:ts},{label:"Messages",component:us},{label:"CLI",component:is},{label:"Dialog",component:ps},{label:"File system",component:ms},{label:"HTTP",component:gs},{label:"HTTP Form",component:Bs},{label:"Notifications",component:ys},{label:"Window",component:Ms},{label:"Shortcuts",component:Rs},{label:"Shell",component:Hs},{label:"Updater",component:Ps},{label:"Clipboard",component:Us},{label:"WebRTC",component:Ds}];let o=s[0],r=ei([]);xl(n,r,p=>l(1,i=p));function c(p){l(0,o=p)}function v(p){r.update(_=>[{text:`[${new Date().toLocaleTimeString()}]: `+(typeof p=="string"?p:JSON.stringify(p))},..._])}function m(p){r.update(_=>[{html:p},..._])}function k(){r.update(()=>[])}function w(){$l("https://tauri.studio/")}return[o,i,s,r,c,v,m,k,w,p=>c(p)]}class Ks extends J{constructor(e){super();X(this,e,Ys,Js,Y,{})}}new Ks({target:document.body}); diff --git a/examples/api/dist/assets/vendor.js b/examples/api/dist/assets/vendor.js index fb5ffd072..da0ce0769 100644 --- a/examples/api/dist/assets/vendor.js +++ b/examples/api/dist/assets/vendor.js @@ -1,4 +1,4 @@ -function T(){}function ot(t){return t()}function ut(){return Object.create(null)}function P(t){t.forEach(ot)}function Kt(t){return typeof t=="function"}function Rt(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}function Ut(t){return Object.keys(t).length===0}function Nt(t,...e){if(t==null)return T;const n=t.subscribe(...e);return n.unsubscribe?()=>n.unsubscribe():n}function Ge(t,e,n){t.$$.on_destroy.push(Nt(e,n))}function Je(t,e){t.appendChild(e)}function Bt(t,e,n){t.insertBefore(e,n||null)}function st(t){t.parentNode.removeChild(t)}function Xe(t,e){for(let n=0;nt.removeEventListener(e,n,i)}function tn(t){return function(e){return e.preventDefault(),t.call(this,e)}}function en(t,e,n){n==null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function nn(t){return t===""?null:+t}function Ht(t){return Array.from(t.childNodes)}function rn(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}function on(t,e){t.value=e==null?"":e}function un(t,e){for(let n=0;n{L.delete(t),i&&(n&&t.d(1),i())}),t.o(e)}}function pn(t){t&&t.c()}function Xt(t,e,n,i){const{fragment:r,on_mount:o,on_destroy:c,after_update:f}=t.$$;r&&r.m(e,n),i||B(()=>{const l=o.map(ot).filter(Kt);c?c.push(...l):P(l),t.$$.on_mount=[]}),f.forEach(B)}function Qt(t,e){const n=t.$$;n.fragment!==null&&(P(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function Yt(t,e){t.$$.dirty[0]===-1&&(E.push(t),Vt(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<{const g=y.length?y[0]:v;return l.ctx&&r(l.ctx[d],l.ctx[d]=g)&&(!l.skip_bound&&l.bound[d]&&l.bound[d](g),h&&Yt(t,d)),v}):[],l.update(),h=!0,P(l.before_update),l.fragment=i?i(l.ctx):!1,e.target){if(e.hydrate){const d=Ht(e.target);l.fragment&&l.fragment.l(d),d.forEach(st)}else l.fragment&&l.fragment.c();e.intro&&Jt(t.$$.fragment),Xt(t,e.target,e.anchor,e.customElement),ft()}D(f)}class vn{$destroy(){Qt(this,1),this.$destroy=T}$on(e,n){const i=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return i.push(n),()=>{const r=i.indexOf(n);r!==-1&&i.splice(r,1)}}$set(e){this.$$set&&!Ut(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const A=[];function _n(t,e=T){let n;const i=[];function r(f){if(Rt(t,f)&&(t=f,n)){const l=!A.length;for(let h=0;h{const d=i.indexOf(h);d!==-1&&i.splice(d,1),i.length===0&&(n(),n=null)}}return{set:r,update:o,subscribe:c}}/*! +function T(){}function ot(t){return t()}function ut(){return Object.create(null)}function A(t){t.forEach(ot)}function Kt(t){return typeof t=="function"}function Rt(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}function Ut(t){return Object.keys(t).length===0}function Nt(t,...e){if(t==null)return T;const n=t.subscribe(...e);return n.unsubscribe?()=>n.unsubscribe():n}function Ge(t,e,n){t.$$.on_destroy.push(Nt(e,n))}function Je(t,e){t.appendChild(e)}function Bt(t,e,n){t.insertBefore(e,n||null)}function st(t){t.parentNode.removeChild(t)}function Xe(t,e){for(let n=0;nt.removeEventListener(e,n,i)}function tn(t){return function(e){return e.preventDefault(),t.call(this,e)}}function en(t,e,n){n==null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function nn(t){return t===""?null:+t}function qt(t){return Array.from(t.childNodes)}function rn(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}function on(t,e){t.value=e==null?"":e}function un(t,e){for(let n=0;n{L.delete(t),i&&(n&&t.d(1),i())}),t.o(e)}}function pn(t){t&&t.c()}function Xt(t,e,n,i){const{fragment:r,on_mount:s,on_destroy:c,after_update:f}=t.$$;r&&r.m(e,n),i||B(()=>{const l=s.map(ot).filter(Kt);c?c.push(...l):A(l),t.$$.on_mount=[]}),f.forEach(B)}function Qt(t,e){const n=t.$$;n.fragment!==null&&(A(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function Yt(t,e){t.$$.dirty[0]===-1&&(E.push(t),Vt(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<{const g=_.length?_[0]:v;return l.ctx&&r(l.ctx[d],l.ctx[d]=g)&&(!l.skip_bound&&l.bound[d]&&l.bound[d](g),h&&Yt(t,d)),v}):[],l.update(),h=!0,A(l.before_update),l.fragment=i?i(l.ctx):!1,e.target){if(e.hydrate){const d=qt(e.target);l.fragment&&l.fragment.l(d),d.forEach(st)}else l.fragment&&l.fragment.c();e.intro&&Jt(t.$$.fragment),Xt(t,e.target,e.anchor,e.customElement),ft()}C(f)}class vn{$destroy(){Qt(this,1),this.$destroy=T}$on(e,n){const i=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return i.push(n),()=>{const r=i.indexOf(n);r!==-1&&i.splice(r,1)}}$set(e){this.$$set&&!Ut(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const P=[];function yn(t,e=T){let n;const i=[];function r(f){if(Rt(t,f)&&(t=f,n)){const l=!P.length;for(let h=0;h{const d=i.indexOf(h);d!==-1&&i.splice(d,1),i.length===0&&(n(),n=null)}}return{set:r,update:s,subscribe:c}}/*! * hotkeys-js v3.8.5 * A simple micro-library for defining and dispatching keyboard shortcuts. It has no dependencies. * @@ -6,7 +6,7 @@ function T(){}function ot(t){return t()}function ut(){return Object.create(null) * http://jaywcjlove.github.io/hotkeys * * Licensed under the MIT license. - */var I=typeof navigator!="undefined"?navigator.userAgent.toLowerCase().indexOf("firefox")>0:!1;function V(t,e,n){t.addEventListener?t.addEventListener(e,n,!1):t.attachEvent&&t.attachEvent("on".concat(e),function(){n(window.event)})}function ht(t,e){for(var n=e.slice(0,e.length-1),i=0;i=0;)e[n-1]+=",",e.splice(n,1),n=e.lastIndexOf("");return e}function Zt(t,e){for(var n=t.length>=e.length?t:e,i=t.length>=e.length?e:t,r=!0,o=0;o=0&&p.splice(n,1),t.key&&t.key.toLowerCase()==="meta"&&p.splice(0,p.length),(e===93||e===224)&&(e=91),e in _){_[e]=!1;for(var i in $)$[i]===e&&(M[i]=!1)}}function oe(t){if(!t)Object.keys(m).forEach(function(c){return delete m[c]});else if(Array.isArray(t))t.forEach(function(c){c.key&&G(c)});else if(typeof t=="object")t.key&&G(t);else if(typeof t=="string"){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i1?ht($,h):[];m[y]=m[y].map(function(b){var Ft=r?b.method===r:!0;return Ft&&b.scope===i&&Zt(b.mods,g)?{}:b})}})};function bt(t,e,n){var i;if(e.scope===n||e.scope==="all"){i=e.mods.length>0;for(var r in _)Object.prototype.hasOwnProperty.call(_,r)&&(!_[r]&&e.mods.indexOf(+r)>-1||_[r]&&e.mods.indexOf(+r)===-1)&&(i=!1);(e.mods.length===0&&!_[16]&&!_[18]&&!_[17]&&!_[91]||i||e.shortcut==="*")&&e.method(t,e)===!1&&(t.preventDefault?t.preventDefault():t.returnValue=!1,t.stopPropagation&&t.stopPropagation(),t.cancelBubble&&(t.cancelBubble=!0))}}function wt(t){var e=m["*"],n=t.keyCode||t.which||t.charCode;if(!!M.filter.call(this,t)){if((n===93||n===224)&&(n=91),p.indexOf(n)===-1&&n!==229&&p.push(n),["ctrlKey","altKey","shiftKey","metaKey"].forEach(function(g){var b=vt[g];t[g]&&p.indexOf(b)===-1?p.push(b):!t[g]&&p.indexOf(b)>-1?p.splice(p.indexOf(b),1):g==="metaKey"&&t[g]&&p.length===3&&(t.ctrlKey||t.shiftKey||t.altKey||(p=p.slice(p.indexOf(b))))}),n in _){_[n]=!0;for(var i in $)$[i]===n&&(M[i]=!0);if(!e)return}for(var r in _)Object.prototype.hasOwnProperty.call(_,r)&&(_[r]=t[vt[r]]);t.getModifierState&&!(t.altKey&&!t.ctrlKey)&&t.getModifierState("AltGraph")&&(p.indexOf(17)===-1&&p.push(17),p.indexOf(18)===-1&&p.push(18),_[17]=!0,_[18]=!0);var o=z();if(e)for(var c=0;c-1}function M(t,e,n){p=[];var i=pt(t),r=[],o="all",c=document,f=0,l=!1,h=!0,d="+";for(n===void 0&&typeof e=="function"&&(n=e),Object.prototype.toString.call(e)==="[object Object]"&&(e.scope&&(o=e.scope),e.element&&(c=e.element),e.keyup&&(l=e.keyup),e.keydown!==void 0&&(h=e.keydown),typeof e.splitKey=="string"&&(d=e.splitKey)),typeof e=="string"&&(o=e);f1&&(r=ht($,t)),t=t[t.length-1],t=t==="*"?"*":F(t),t in m||(m[t]=[]),m[t].push({keyup:l,keydown:h,scope:o,mods:r,shortcut:i[f],method:n,key:i[f],splitKey:d});typeof c!="undefined"&&!ue(c)&&window&&(yt.push(c),V(c,"keydown",function(v){wt(v)}),V(window,"focus",function(){p=[]}),V(c,"keyup",function(v){wt(v),re(v)}))}var J={setScope:gt,getScope:z,deleteScope:ie,getPressedKeyCodes:te,isPressed:ne,filter:ee,unbind:oe};for(var X in J)Object.prototype.hasOwnProperty.call(J,X)&&(M[X]=J[X]);if(typeof window!="undefined"){var se=window.hotkeys;M.noConflict=function(t){return t&&window.hotkeys===M&&(window.hotkeys=se),M},window.hotkeys=M}/*! ***************************************************************************** + */var H=typeof navigator!="undefined"?navigator.userAgent.toLowerCase().indexOf("firefox")>0:!1;function V(t,e,n){t.addEventListener?t.addEventListener(e,n,!1):t.attachEvent&&t.attachEvent("on".concat(e),function(){n(window.event)})}function ht(t,e){for(var n=e.slice(0,e.length-1),i=0;i=0;)e[n-1]+=",",e.splice(n,1),n=e.lastIndexOf("");return e}function Zt(t,e){for(var n=t.length>=e.length?t:e,i=t.length>=e.length?e:t,r=!0,s=0;s=0&&p.splice(n,1),t.key&&t.key.toLowerCase()==="meta"&&p.splice(0,p.length),(e===93||e===224)&&(e=91),e in y){y[e]=!1;for(var i in $)$[i]===e&&(M[i]=!1)}}function oe(t){if(!t)Object.keys(m).forEach(function(c){return delete m[c]});else if(Array.isArray(t))t.forEach(function(c){c.key&&G(c)});else if(typeof t=="object")t.key&&G(t);else if(typeof t=="string"){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i1?ht($,h):[];m[_]=m[_].map(function(b){var Ft=r?b.method===r:!0;return Ft&&b.scope===i&&Zt(b.mods,g)?{}:b})}})};function bt(t,e,n){var i;if(e.scope===n||e.scope==="all"){i=e.mods.length>0;for(var r in y)Object.prototype.hasOwnProperty.call(y,r)&&(!y[r]&&e.mods.indexOf(+r)>-1||y[r]&&e.mods.indexOf(+r)===-1)&&(i=!1);(e.mods.length===0&&!y[16]&&!y[18]&&!y[17]&&!y[91]||i||e.shortcut==="*")&&e.method(t,e)===!1&&(t.preventDefault?t.preventDefault():t.returnValue=!1,t.stopPropagation&&t.stopPropagation(),t.cancelBubble&&(t.cancelBubble=!0))}}function wt(t){var e=m["*"],n=t.keyCode||t.which||t.charCode;if(!!M.filter.call(this,t)){if((n===93||n===224)&&(n=91),p.indexOf(n)===-1&&n!==229&&p.push(n),["ctrlKey","altKey","shiftKey","metaKey"].forEach(function(g){var b=vt[g];t[g]&&p.indexOf(b)===-1?p.push(b):!t[g]&&p.indexOf(b)>-1?p.splice(p.indexOf(b),1):g==="metaKey"&&t[g]&&p.length===3&&(t.ctrlKey||t.shiftKey||t.altKey||(p=p.slice(p.indexOf(b))))}),n in y){y[n]=!0;for(var i in $)$[i]===n&&(M[i]=!0);if(!e)return}for(var r in y)Object.prototype.hasOwnProperty.call(y,r)&&(y[r]=t[vt[r]]);t.getModifierState&&!(t.altKey&&!t.ctrlKey)&&t.getModifierState("AltGraph")&&(p.indexOf(17)===-1&&p.push(17),p.indexOf(18)===-1&&p.push(18),y[17]=!0,y[18]=!0);var s=z();if(e)for(var c=0;c-1}function M(t,e,n){p=[];var i=pt(t),r=[],s="all",c=document,f=0,l=!1,h=!0,d="+";for(n===void 0&&typeof e=="function"&&(n=e),Object.prototype.toString.call(e)==="[object Object]"&&(e.scope&&(s=e.scope),e.element&&(c=e.element),e.keyup&&(l=e.keyup),e.keydown!==void 0&&(h=e.keydown),typeof e.splitKey=="string"&&(d=e.splitKey)),typeof e=="string"&&(s=e);f1&&(r=ht($,t)),t=t[t.length-1],t=t==="*"?"*":F(t),t in m||(m[t]=[]),m[t].push({keyup:l,keydown:h,scope:s,mods:r,shortcut:i[f],method:n,key:i[f],splitKey:d});typeof c!="undefined"&&!ue(c)&&window&&(_t.push(c),V(c,"keydown",function(v){wt(v)}),V(window,"focus",function(){p=[]}),V(c,"keyup",function(v){wt(v),re(v)}))}var J={setScope:gt,getScope:z,deleteScope:ie,getPressedKeyCodes:te,isPressed:ne,filter:ee,unbind:oe};for(var X in J)Object.prototype.hasOwnProperty.call(J,X)&&(M[X]=J[X]);if(typeof window!="undefined"){var se=window.hotkeys;M.noConflict=function(t){return t&&window.hotkeys===M&&(window.hotkeys=se),M},window.hotkeys=M}/*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any @@ -19,7 +19,7 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */var Mt=function(t,e){return(Mt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(n[r]=i[r])})(t,e)};function Q(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}Mt(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}var w=function(){return(w=Object.assign||function(t){for(var e,n=1,i=arguments.length;n0&&r[r.length-1])||d[0]!==6&&d[0]!==2)){c=0;continue}if(d[0]===3&&(!r||d[1]>r[0]&&d[1]0&&r[r.length-1])||d[0]!==6&&d[0]!==2)){c=0;continue}if(d[0]===3&&(!r||d[1]>r[0]&&d[1]=200&&this.status<300,this.headers=t.headers,this.rawHeaders=t.rawHeaders,this.data=t.data},zt=function(){function t(e){this.id=e}return t.prototype.drop=function(){return u(this,void 0,void 0,function(){return s(this,function(e){return[2,a({__tauriModule:"Http",message:{cmd:"dropClient",client:this.id}})]})})},t.prototype.request=function(e){return u(this,void 0,void 0,function(){var n;return s(this,function(i){return(n=!e.responseType||e.responseType===S.JSON)&&(e.responseType=S.Text),[2,a({__tauriModule:"Http",message:{cmd:"httpRequest",client:this.id,options:e}}).then(function(r){var o=new Et(r);if(n){try{o.data=JSON.parse(o.data)}catch(c){if(o.ok&&o.data==="")o.data={};else if(o.ok)throw Error("Failed to parse response `".concat(o.data,"` as JSON: ").concat(c,";\n try setting the `responseType` option to `ResponseType.Text` or `ResponseType.Binary` if the API does not return a JSON response."))}return o}return o})]})})},t.prototype.get=function(e,n){return u(this,void 0,void 0,function(){return s(this,function(i){return[2,this.request(w({method:"GET",url:e},n))]})})},t.prototype.post=function(e,n,i){return u(this,void 0,void 0,function(){return s(this,function(r){return[2,this.request(w({method:"POST",url:e,body:n},i))]})})},t.prototype.put=function(e,n,i){return u(this,void 0,void 0,function(){return s(this,function(r){return[2,this.request(w({method:"PUT",url:e,body:n},i))]})})},t.prototype.patch=function(e,n){return u(this,void 0,void 0,function(){return s(this,function(i){return[2,this.request(w({method:"PATCH",url:e},n))]})})},t.prototype.delete=function(e,n){return u(this,void 0,void 0,function(){return s(this,function(i){return[2,this.request(w({method:"DELETE",url:e},n))]})})},t}();function St(t){return u(this,void 0,void 0,function(){return s(this,function(e){return[2,a({__tauriModule:"Http",message:{cmd:"createClient",options:t}}).then(function(n){return new zt(n)})]})})}var et=null;function De(t,e){var n;return u(this,void 0,void 0,function(){return s(this,function(i){switch(i.label){case 0:return et!==null?[3,2]:[4,St()];case 1:et=i.sent(),i.label=2;case 2:return[2,et.request(w({url:t,method:(n=e==null?void 0:e.method)!==null&&n!==void 0?n:"GET"},e))]}})})}Object.freeze({__proto__:null,getClient:St,fetch:De,Body:We,Client:zt,Response:Et,get ResponseType(){return S}});var U,jt=function(t,e){this.type="Logical",this.width=t,this.height=e},nt=function(){function t(e,n){this.type="Physical",this.width=e,this.height=n}return t.prototype.toLogical=function(e){return new jt(this.width/e,this.height/e)},t}(),Wt=function(t,e){this.type="Logical",this.x=t,this.y=e},it=function(){function t(e,n){this.type="Physical",this.x=e,this.y=n}return t.prototype.toLogical=function(e){return new Wt(this.x/e,this.y/e)},t}();function ke(){return new j(window.__TAURI_METADATA__.__currentWindow.label,{skip:!0})}function Dt(){return window.__TAURI_METADATA__.__windows.map(function(t){return new j(t.label,{skip:!0})})}(function(t){t[t.Critical=1]="Critical",t[t.Informational=2]="Informational"})(U||(U={}));var rt,kt=["tauri://created","tauri://error"],Lt=function(){function t(e){this.label=e,this.listeners=Object.create(null)}return t.prototype.listen=function(e,n){return u(this,void 0,void 0,function(){var i=this;return s(this,function(r){return this._handleTauriEvent(e,n)?[2,Promise.resolve(function(){var o=i.listeners[e];o.splice(o.indexOf(n),1)})]:[2,Y(e,this.label,n)]})})},t.prototype.once=function(e,n){return u(this,void 0,void 0,function(){var i=this;return s(this,function(r){return this._handleTauriEvent(e,n)?[2,Promise.resolve(function(){var o=i.listeners[e];o.splice(o.indexOf(n),1)})]:[2,At(e,this.label,n)]})})},t.prototype.emit=function(e,n){return u(this,void 0,void 0,function(){var i,r;return s(this,function(o){if(kt.includes(e)){for(i=0,r=this.listeners[e]||[];i=200&&this.status<300,this.headers=t.headers,this.rawHeaders=t.rawHeaders,this.data=t.data},zt=function(){function t(e){this.id=e}return t.prototype.drop=function(){return o(this,void 0,void 0,function(){return u(this,function(e){return[2,a({__tauriModule:"Http",message:{cmd:"dropClient",client:this.id}})]})})},t.prototype.request=function(e){return o(this,void 0,void 0,function(){var n;return u(this,function(i){return(n=!e.responseType||e.responseType===S.JSON)&&(e.responseType=S.Text),[2,a({__tauriModule:"Http",message:{cmd:"httpRequest",client:this.id,options:e}}).then(function(r){var s=new Et(r);if(n){try{s.data=JSON.parse(s.data)}catch(c){if(s.ok&&s.data==="")s.data={};else if(s.ok)throw Error("Failed to parse response `".concat(s.data,"` as JSON: ").concat(c,";\n try setting the `responseType` option to `ResponseType.Text` or `ResponseType.Binary` if the API does not return a JSON response."))}return s}return s})]})})},t.prototype.get=function(e,n){return o(this,void 0,void 0,function(){return u(this,function(i){return[2,this.request(w({method:"GET",url:e},n))]})})},t.prototype.post=function(e,n,i){return o(this,void 0,void 0,function(){return u(this,function(r){return[2,this.request(w({method:"POST",url:e,body:n},i))]})})},t.prototype.put=function(e,n,i){return o(this,void 0,void 0,function(){return u(this,function(r){return[2,this.request(w({method:"PUT",url:e,body:n},i))]})})},t.prototype.patch=function(e,n){return o(this,void 0,void 0,function(){return u(this,function(i){return[2,this.request(w({method:"PATCH",url:e},n))]})})},t.prototype.delete=function(e,n){return o(this,void 0,void 0,function(){return u(this,function(i){return[2,this.request(w({method:"DELETE",url:e},n))]})})},t}();function St(t){return o(this,void 0,void 0,function(){return u(this,function(e){return[2,a({__tauriModule:"Http",message:{cmd:"createClient",options:t}}).then(function(n){return new zt(n)})]})})}var et=null;function Ce(t,e){var n;return o(this,void 0,void 0,function(){return u(this,function(i){switch(i.label){case 0:return et!==null?[3,2]:[4,St()];case 1:et=i.sent(),i.label=2;case 2:return[2,et.request(w({url:t,method:(n=e==null?void 0:e.method)!==null&&n!==void 0?n:"GET"},e))]}})})}Object.freeze({__proto__:null,getClient:St,fetch:Ce,Body:je,Client:zt,Response:Et,get ResponseType(){return S}});var U,Wt=function(t,e){this.type="Logical",this.width=t,this.height=e},nt=function(){function t(e,n){this.type="Physical",this.width=e,this.height=n}return t.prototype.toLogical=function(e){return new Wt(this.width/e,this.height/e)},t}(),jt=function(t,e){this.type="Logical",this.x=t,this.y=e},it=function(){function t(e,n){this.type="Physical",this.x=e,this.y=n}return t.prototype.toLogical=function(e){return new jt(this.x/e,this.y/e)},t}();function De(){return new W(window.__TAURI_METADATA__.__currentWindow.label,{skip:!0})}function Ct(){return window.__TAURI_METADATA__.__windows.map(function(t){return new W(t.label,{skip:!0})})}(function(t){t[t.Critical=1]="Critical",t[t.Informational=2]="Informational"})(U||(U={}));var rt,Dt=["tauri://created","tauri://error"],Lt=function(){function t(e){this.label=e,this.listeners=Object.create(null)}return t.prototype.listen=function(e,n){return o(this,void 0,void 0,function(){var i=this;return u(this,function(r){return this._handleTauriEvent(e,n)?[2,Promise.resolve(function(){var s=i.listeners[e];s.splice(s.indexOf(n),1)})]:[2,Y(e,this.label,n)]})})},t.prototype.once=function(e,n){return o(this,void 0,void 0,function(){var i=this;return u(this,function(r){return this._handleTauriEvent(e,n)?[2,Promise.resolve(function(){var s=i.listeners[e];s.splice(s.indexOf(n),1)})]:[2,Pt(e,this.label,n)]})})},t.prototype.emit=function(e,n){return o(this,void 0,void 0,function(){var i,r;return u(this,function(s){if(Dt.includes(e)){for(i=0,r=this.listeners[e]||[];i - import { appWindow, WebviewWindow, LogicalSize, UserAttentionType, PhysicalSize, PhysicalPosition } from "@tauri-apps/api/window"; - import { open as openDialog } from "@tauri-apps/api/dialog"; - import { open } from "@tauri-apps/api/shell"; + import { + appWindow, + WebviewWindow, + LogicalSize, + UserAttentionType, + PhysicalSize, + PhysicalPosition + } from '@tauri-apps/api/window' + import { open as openDialog } from '@tauri-apps/api/dialog' + import { open } from '@tauri-apps/api/shell' - let selectedWindow = appWindow.label; + let selectedWindow = appWindow.label const windowMap = { [selectedWindow]: appWindow } + const cursorIconOptions = [ + 'default', + 'crosshair', + 'hand', + 'arrow', + 'move', + 'text', + 'wait', + 'help', + 'progress', + // something cannot be done + 'notAllowed', + 'contextMenu', + 'cell', + 'verticalText', + 'alias', + 'copy', + 'noDrop', + // something can be grabbed + 'grab', + /// something is grabbed + 'grabbing', + 'allScroll', + 'zoomIn', + 'zoomOut', + // edge is to be moved + 'eResize', + 'nResize', + 'neResize', + 'nwResize', + 'sResize', + 'seResize', + 'swResize', + 'wResize', + 'ewResize', + 'nsResize', + 'neswResize', + 'nwseResize', + 'colResize', + 'rowResize' + ] - export let onMessage; + export let onMessage - let urlValue = "https://tauri.studio"; - let resizable = true; - let maximized = false; - let transparent = false; - let decorations = true; - let alwaysOnTop = false; - let fullscreen = false; - let width = 900; - let height = 700; - let minWidth = 600; - let minHeight = 600; - let maxWidth = null; - let maxHeight = null; - let x = 100; - let y = 100; - let scaleFactor = 1; - let innerPosition = new PhysicalPosition(x, y); - let outerPosition = new PhysicalPosition(x, y); - let innerSize = new PhysicalSize(width, height); - let outerSize = new PhysicalSize(width, height); - let resizeEventUnlisten; - let moveEventUnlisten; + let urlValue = 'https://tauri.studio' + let resizable = true + let maximized = false + let transparent = false + let decorations = true + let alwaysOnTop = false + let fullscreen = false + let width = 900 + let height = 700 + let minWidth = 600 + let minHeight = 600 + let maxWidth = null + let maxHeight = null + let x = 100 + let y = 100 + let scaleFactor = 1 + let innerPosition = new PhysicalPosition(x, y) + let outerPosition = new PhysicalPosition(x, y) + let innerSize = new PhysicalSize(width, height) + let outerSize = new PhysicalSize(width, height) + let resizeEventUnlisten + let moveEventUnlisten + let cursorGrab = false + let cursorVisible = true + let cursorX = 600 + let cursorY = 800 + let cursorIcon = 'default' - let windowTitle = "Awesome Tauri Example!"; + let windowTitle = 'Awesome Tauri Example!' function openUrl() { - open(urlValue); + open(urlValue) } function setTitle_() { - windowMap[selectedWindow].setTitle(windowTitle); + windowMap[selectedWindow].setTitle(windowTitle) } function hide_() { - windowMap[selectedWindow].hide(); - setTimeout(windowMap[selectedWindow].show, 2000); + windowMap[selectedWindow].hide() + setTimeout(windowMap[selectedWindow].show, 2000) } function minimize_() { - windowMap[selectedWindow].minimize(); - setTimeout(windowMap[selectedWindow].unminimize, 2000); + windowMap[selectedWindow].minimize() + setTimeout(windowMap[selectedWindow].unminimize, 2000) } function getIcon() { openDialog({ - multiple: false, - }).then(path => { + multiple: false + }).then((path) => { if (typeof path === 'string') { windowMap[selectedWindow].setIcon(path) } - }); + }) } function createWindow() { - const label = Math.random().toString().replace('.', ''); - const webview = new WebviewWindow(label); - windowMap[label] = webview; + const label = Math.random().toString().replace('.', '') + const webview = new WebviewWindow(label) + windowMap[label] = webview webview.once('tauri://error', function () { - onMessage("Error creating new webview") + onMessage('Error creating new webview') }) } function handleWindowResize() { - windowMap[selectedWindow].innerSize().then(response => { + windowMap[selectedWindow].innerSize().then((response) => { innerSize = response width = innerSize.width height = innerSize.height - }); - windowMap[selectedWindow].outerSize().then(response => { + }) + windowMap[selectedWindow].outerSize().then((response) => { outerSize = response - }); + }) } function handleWindowMove() { - windowMap[selectedWindow].innerPosition().then(response => { + windowMap[selectedWindow].innerPosition().then((response) => { innerPosition = response - }); - windowMap[selectedWindow].outerPosition().then(response => { + }) + windowMap[selectedWindow].outerPosition().then((response) => { outerPosition = response x = outerPosition.x y = outerPosition.y - }); + }) } async function addWindowEventListeners(window) { if (resizeEventUnlisten) { - resizeEventUnlisten(); + resizeEventUnlisten() } - if(moveEventUnlisten) { - moveEventUnlisten(); + if (moveEventUnlisten) { + moveEventUnlisten() } - moveEventUnlisten = await window.listen('tauri://move', handleWindowMove); - resizeEventUnlisten = await window.listen('tauri://resize', handleWindowResize); + moveEventUnlisten = await window.listen('tauri://move', handleWindowMove) + resizeEventUnlisten = await window.listen( + 'tauri://resize', + handleWindowResize + ) } async function requestUserAttention_() { - await windowMap[selectedWindow].minimize(); - await windowMap[selectedWindow].requestUserAttention(UserAttentionType.Critical); - await new Promise(resolve => setTimeout(resolve, 3000)); - await windowMap[selectedWindow].requestUserAttention(null); + await windowMap[selectedWindow].minimize() + await windowMap[selectedWindow].requestUserAttention( + UserAttentionType.Critical + ) + await new Promise((resolve) => setTimeout(resolve, 3000)) + await windowMap[selectedWindow].requestUserAttention(null) } - $: windowMap[selectedWindow].setResizable(resizable); - $: maximized ? windowMap[selectedWindow].maximize() : windowMap[selectedWindow].unmaximize(); - $: windowMap[selectedWindow].setDecorations(decorations); - $: windowMap[selectedWindow].setAlwaysOnTop(alwaysOnTop); - $: windowMap[selectedWindow].setFullscreen(fullscreen); + $: windowMap[selectedWindow].setResizable(resizable) + $: maximized + ? windowMap[selectedWindow].maximize() + : windowMap[selectedWindow].unmaximize() + $: windowMap[selectedWindow].setDecorations(decorations) + $: windowMap[selectedWindow].setAlwaysOnTop(alwaysOnTop) + $: windowMap[selectedWindow].setFullscreen(fullscreen) - $: windowMap[selectedWindow].setSize(new PhysicalSize(width, height)); - $: minWidth && minHeight ? windowMap[selectedWindow].setMinSize(new LogicalSize(minWidth, minHeight)) : windowMap[selectedWindow].setMinSize(null); - $: maxWidth && maxHeight ? windowMap[selectedWindow].setMaxSize(new LogicalSize(maxWidth, maxHeight)) : windowMap[selectedWindow].setMaxSize(null); - $: windowMap[selectedWindow].setPosition(new PhysicalPosition(x, y)); - $: windowMap[selectedWindow].scaleFactor().then(factor => scaleFactor = factor); - $: addWindowEventListeners(windowMap[selectedWindow]); + $: windowMap[selectedWindow].setSize(new PhysicalSize(width, height)) + $: minWidth && minHeight + ? windowMap[selectedWindow].setMinSize(new LogicalSize(minWidth, minHeight)) + : windowMap[selectedWindow].setMinSize(null) + $: maxWidth && maxHeight + ? windowMap[selectedWindow].setMaxSize(new LogicalSize(maxWidth, maxHeight)) + : windowMap[selectedWindow].setMaxSize(null) + $: windowMap[selectedWindow].setPosition(new PhysicalPosition(x, y)) + $: windowMap[selectedWindow] + .scaleFactor() + .then((factor) => (scaleFactor = factor)) + $: addWindowEventListeners(windowMap[selectedWindow]) + + $: windowMap[selectedWindow].setCursorGrab(cursorGrab) + $: windowMap[selectedWindow].setCursorVisible(cursorVisible) + $: windowMap[selectedWindow].setCursorIcon(cursorIcon) + $: windowMap[selectedWindow].setCursorPosition( + new PhysicalPosition(cursorX, cursorY) + )
    -
    +
    +

    Cursor

    + + + +
    +
    + X position + +
    +
    + Y position + +
    +
    +
    @@ -274,7 +376,12 @@
    - +