{ "version": 3, "sources": ["../../node_modules/@tauri-apps/api/tauri.js", "../../node_modules/@tauri-apps/api/helpers/tauri.js", "../../node_modules/@tauri-apps/api/helpers/event.js", "../../node_modules/@tauri-apps/api/event.js", "../../node_modules/@tauri-apps/api/fs.js", "../../node_modules/@tauri-apps/api/http.js", "../../node_modules/@tauri-apps/api/helpers/os-check.js", "../../node_modules/@tauri-apps/api/path.js", "../../node_modules/@tauri-apps/api/window.js", "../../node_modules/@tauri-apps/api/os.js", "../../node_modules/@tauri-apps/api/index.js", "../index.ts"], "sourcesContent": ["// Copyright 2019-2023 Tauri Programme within The Commons Conservancy\n// SPDX-License-Identifier: Apache-2.0\n// SPDX-License-Identifier: MIT\n/** @ignore */\nfunction uid() {\n return window.crypto.getRandomValues(new Uint32Array(1))[0];\n}\n/**\n * Transforms a callback function to a string identifier that can be passed to the backend.\n * The backend uses the identifier to `eval()` the callback.\n *\n * @return A unique identifier associated with the callback function.\n *\n * @since 1.0.0\n */\nfunction transformCallback(callback, once = false) {\n const identifier = uid();\n const prop = `_${identifier}`;\n Object.defineProperty(window, prop, {\n value: (result) => {\n if (once) {\n Reflect.deleteProperty(window, prop);\n }\n return callback === null || callback === void 0 ? void 0 : callback(result);\n },\n writable: false,\n configurable: true\n });\n return identifier;\n}\n/**\n * Sends a message to the backend.\n * @example\n * ```typescript\n * import { invoke } from '@tauri-apps/api/tauri';\n * await invoke('login', { user: 'tauri', password: 'poiwe3h4r5ip3yrhtew9ty' });\n * ```\n *\n * @param cmd The command name.\n * @param args The optional arguments to pass to the command.\n * @return A promise resolving or rejecting to the backend response.\n *\n * @since 1.0.0\n */\nasync function invoke(cmd, args = {}) {\n return new Promise((resolve, reject) => {\n const callback = transformCallback((e) => {\n resolve(e);\n Reflect.deleteProperty(window, `_${error}`);\n }, true);\n const error = transformCallback((e) => {\n reject(e);\n Reflect.deleteProperty(window, `_${callback}`);\n }, true);\n window.__TAURI_IPC__({\n cmd,\n callback,\n error,\n ...args\n });\n });\n}\n/**\n * Convert a device file path to an URL that can be loaded by the webview.\n * Note that `asset:` and `https://asset.localhost` must be added to [`tauri.security.csp`](https://tauri.app/v1/api/config/#securityconfig.csp) in `tauri.conf.json`.\n * Example CSP value: `\"csp\": \"default-src 'self'; img-src 'self' asset: https://asset.localhost\"` to use the asset protocol on image sources.\n *\n * Additionally, `asset` must be added to [`tauri.allowlist.protocol`](https://tauri.app/v1/api/config/#allowlistconfig.protocol)\n * in `tauri.conf.json` and its access scope must be defined on the `assetScope` array on the same `protocol` object.\n * For example:\n * ```json\n * {\n * \"tauri\": {\n * \"allowlist\": {\n * \"protocol\": {\n * \"asset\": true,\n * \"assetScope\": [\"$APPDATA/assets/*\"]\n * }\n * }\n * }\n * }\n * ```\n *\n * @param filePath The file path.\n * @param protocol The protocol to use. Defaults to `asset`. You only need to set this when using a custom protocol.\n * @example\n * ```typescript\n * import { appDataDir, join } from '@tauri-apps/api/path';\n * import { convertFileSrc } from '@tauri-apps/api/tauri';\n * const appDataDirPath = await appDataDir();\n * const filePath = await join(appDataDirPath, 'assets/video.mp4');\n * const assetUrl = convertFileSrc(filePath);\n *\n * const video = document.getElementById('my-video');\n * const source = document.createElement('source');\n * source.type = 'video/mp4';\n * source.src = assetUrl;\n * video.appendChild(source);\n * video.load();\n * ```\n *\n * @return the URL that can be used as source on the webview.\n *\n * @since 1.0.0\n */\nfunction convertFileSrc(filePath, protocol = 'asset') {\n return window.__TAURI__.convertFileSrc(filePath, protocol);\n}\n\nexport { convertFileSrc, invoke, transformCallback };\n", "import { invoke } from '../tauri.js';\n\n// Copyright 2019-2023 Tauri Programme within The Commons Conservancy\n// SPDX-License-Identifier: Apache-2.0\n// SPDX-License-Identifier: MIT\n/** @ignore */\nasync function invokeTauriCommand(command) {\n return invoke('tauri', command);\n}\n\nexport { invokeTauriCommand };\n", "import { invokeTauriCommand } from './tauri.js';\nimport { transformCallback } from '../tauri.js';\n\n// Copyright 2019-2023 Tauri Programme within The Commons Conservancy\n// SPDX-License-Identifier: Apache-2.0\n// SPDX-License-Identifier: MIT\n/**\n * Unregister the event listener associated with the given name and id.\n *\n * @ignore\n * @param event The event name\n * @param eventId Event identifier\n * @returns\n */\nasync function _unlisten(event, eventId) {\n return invokeTauriCommand({\n __tauriModule: 'Event',\n message: {\n cmd: 'unlisten',\n event,\n eventId\n }\n });\n}\n/**\n * Emits an event to the backend.\n *\n * @param event Event name. Must include only alphanumeric characters, `-`, `/`, `:` and `_`.\n * @param [windowLabel] The label of the window to which the event is sent, if null/undefined the event will be sent to all windows\n * @param [payload] Event payload\n * @returns\n */\nasync function emit(event, windowLabel, payload) {\n await invokeTauriCommand({\n __tauriModule: 'Event',\n message: {\n cmd: 'emit',\n event,\n windowLabel,\n payload\n }\n });\n}\n/**\n * Listen to an event from the backend.\n *\n * @param event Event name. Must include only alphanumeric characters, `-`, `/`, `:` and `_`.\n * @param handler Event handler callback.\n * @return A promise resolving to a function to unlisten to the event.\n */\nasync function listen(event, windowLabel, handler) {\n return invokeTauriCommand({\n __tauriModule: 'Event',\n message: {\n cmd: 'listen',\n event,\n windowLabel,\n handler: transformCallback(handler)\n }\n }).then((eventId) => {\n return async () => _unlisten(event, eventId);\n });\n}\n/**\n * Listen to an one-off event from the backend.\n *\n * @param event Event name. Must include only alphanumeric characters, `-`, `/`, `:` and `_`.\n * @param handler Event handler callback.\n * @returns A promise resolving to a function to unlisten to the event.\n */\nasync function once(event, windowLabel, handler) {\n return listen(event, windowLabel, (eventData) => {\n handler(eventData);\n _unlisten(event, eventData.id).catch(() => { });\n });\n}\n\nexport { emit, listen, once };\n", "import { listen as listen$1, once as once$1, emit as emit$1 } from './helpers/event.js';\n\n// Copyright 2019-2023 Tauri Programme within The Commons Conservancy\n// SPDX-License-Identifier: Apache-2.0\n// SPDX-License-Identifier: MIT\n/**\n * The event system allows you to emit events to the backend and listen to events from it.\n *\n * This package is also accessible with `window.__TAURI__.event` when [`build.withGlobalTauri`](https://tauri.app/v1/api/config/#buildconfig.withglobaltauri) in `tauri.conf.json` is set to `true`.\n * @module\n */\n/**\n * @since 1.1.0\n */\nvar TauriEvent;\n(function (TauriEvent) {\n TauriEvent[\"WINDOW_RESIZED\"] = \"tauri://resize\";\n TauriEvent[\"WINDOW_MOVED\"] = \"tauri://move\";\n TauriEvent[\"WINDOW_CLOSE_REQUESTED\"] = \"tauri://close-requested\";\n TauriEvent[\"WINDOW_CREATED\"] = \"tauri://window-created\";\n TauriEvent[\"WINDOW_DESTROYED\"] = \"tauri://destroyed\";\n TauriEvent[\"WINDOW_FOCUS\"] = \"tauri://focus\";\n TauriEvent[\"WINDOW_BLUR\"] = \"tauri://blur\";\n TauriEvent[\"WINDOW_SCALE_FACTOR_CHANGED\"] = \"tauri://scale-change\";\n TauriEvent[\"WINDOW_THEME_CHANGED\"] = \"tauri://theme-changed\";\n TauriEvent[\"WINDOW_FILE_DROP\"] = \"tauri://file-drop\";\n TauriEvent[\"WINDOW_FILE_DROP_HOVER\"] = \"tauri://file-drop-hover\";\n TauriEvent[\"WINDOW_FILE_DROP_CANCELLED\"] = \"tauri://file-drop-cancelled\";\n TauriEvent[\"MENU\"] = \"tauri://menu\";\n TauriEvent[\"CHECK_UPDATE\"] = \"tauri://update\";\n TauriEvent[\"UPDATE_AVAILABLE\"] = \"tauri://update-available\";\n TauriEvent[\"INSTALL_UPDATE\"] = \"tauri://update-install\";\n TauriEvent[\"STATUS_UPDATE\"] = \"tauri://update-status\";\n TauriEvent[\"DOWNLOAD_PROGRESS\"] = \"tauri://update-download-progress\";\n})(TauriEvent || (TauriEvent = {}));\n/**\n * Listen to an event. The event can be either global or window-specific.\n * See {@link Event.windowLabel} to check the event source.\n *\n * @example\n * ```typescript\n * import { listen } from '@tauri-apps/api/event';\n * const unlisten = await listen('error', (event) => {\n * console.log(`Got error in window ${event.windowLabel}, payload: ${event.payload}`);\n * });\n *\n * // you need to call unlisten if your handler goes out of scope e.g. the component is unmounted\n * unlisten();\n * ```\n *\n * @param event Event name. Must include only alphanumeric characters, `-`, `/`, `:` and `_`.\n * @param handler Event handler callback.\n * @returns A promise resolving to a function to unlisten to the event.\n * Note that removing the listener is required if your listener goes out of scope e.g. the component is unmounted.\n *\n * @since 1.0.0\n */\nasync function listen(event, handler) {\n return listen$1(event, null, handler);\n}\n/**\n * Listen to an one-off event. See {@link listen} for more information.\n *\n * @example\n * ```typescript\n * import { once } from '@tauri-apps/api/event';\n * interface LoadedPayload {\n * loggedIn: boolean,\n * token: string\n * }\n * const unlisten = await once('loaded', (event) => {\n * console.log(`App is loaded, loggedIn: ${event.payload.loggedIn}, token: ${event.payload.token}`);\n * });\n *\n * // you need to call unlisten if your handler goes out of scope e.g. the component is unmounted\n * unlisten();\n * ```\n *\n * @param event Event name. Must include only alphanumeric characters, `-`, `/`, `:` and `_`.\n * @returns A promise resolving to a function to unlisten to the event.\n * Note that removing the listener is required if your listener goes out of scope e.g. the component is unmounted.\n *\n * @since 1.0.0\n */\nasync function once(event, handler) {\n return once$1(event, null, handler);\n}\n/**\n * Emits an event to the backend and all Tauri windows.\n * @example\n * ```typescript\n * import { emit } from '@tauri-apps/api/event';\n * await emit('frontend-loaded', { loggedIn: true, token: 'authToken' });\n * ```\n *\n * @param event Event name. Must include only alphanumeric characters, `-`, `/`, `:` and `_`.\n *\n * @since 1.0.0\n */\nasync function emit(event, payload) {\n return emit$1(event, undefined, payload);\n}\n\nexport { TauriEvent, emit, listen, once };\n", "import { invokeTauriCommand } from './helpers/tauri.js';\n\n// Copyright 2019-2023 Tauri Programme within The Commons Conservancy\n// SPDX-License-Identifier: Apache-2.0\n// SPDX-License-Identifier: MIT\n/**\n * Access the file system.\n *\n * This package is also accessible with `window.__TAURI__.fs` when [`build.withGlobalTauri`](https://tauri.app/v1/api/config/#buildconfig.withglobaltauri) in `tauri.conf.json` is set to `true`.\n *\n * The APIs must be added to [`tauri.allowlist.fs`](https://tauri.app/v1/api/config/#allowlistconfig.fs) in `tauri.conf.json`:\n * ```json\n * {\n * \"tauri\": {\n * \"allowlist\": {\n * \"fs\": {\n * \"all\": true, // enable all FS APIs\n * \"readFile\": true,\n * \"writeFile\": true,\n * \"readDir\": true,\n * \"copyFile\": true,\n * \"createDir\": true,\n * \"removeDir\": true,\n * \"removeFile\": true,\n * \"renameFile\": true,\n * \"exists\": true\n * }\n * }\n * }\n * }\n * ```\n * It is recommended to allowlist only the APIs you use for optimal bundle size and security.\n *\n * ## Security\n *\n * This module prevents path traversal, not allowing absolute paths or parent dir components\n * (i.e. \"/usr/path/to/file\" or \"../path/to/file\" paths are not allowed).\n * Paths accessed with this API must be relative to one of the {@link BaseDirectory | base directories}\n * so if you need access to arbitrary filesystem paths, you must write such logic on the core layer instead.\n *\n * The API has a scope configuration that forces you to restrict the paths that can be accessed using glob patterns.\n *\n * The scope configuration is an array of glob patterns describing folder paths that are allowed.\n * For instance, this scope configuration only allows accessing files on the\n * *databases* folder of the {@link path.appDataDir | $APPDATA directory}:\n * ```json\n * {\n * \"tauri\": {\n * \"allowlist\": {\n * \"fs\": {\n * \"scope\": [\"$APPDATA/databases/*\"]\n * }\n * }\n * }\n * }\n * ```\n *\n * Notice the use of the `$APPDATA` variable. The value is injected at runtime, resolving to the {@link path.appDataDir | app data directory}.\n * The available variables are:\n * {@link path.appConfigDir | `$APPCONFIG`}, {@link path.appDataDir | `$APPDATA`}, {@link path.appLocalDataDir | `$APPLOCALDATA`},\n * {@link path.appCacheDir | `$APPCACHE`}, {@link path.appLogDir | `$APPLOG`},\n * {@link path.audioDir | `$AUDIO`}, {@link path.cacheDir | `$CACHE`}, {@link path.configDir | `$CONFIG`}, {@link path.dataDir | `$DATA`},\n * {@link path.localDataDir | `$LOCALDATA`}, {@link path.desktopDir | `$DESKTOP`}, {@link path.documentDir | `$DOCUMENT`},\n * {@link path.downloadDir | `$DOWNLOAD`}, {@link path.executableDir | `$EXE`}, {@link path.fontDir | `$FONT`}, {@link path.homeDir | `$HOME`},\n * {@link path.pictureDir | `$PICTURE`}, {@link path.publicDir | `$PUBLIC`}, {@link path.runtimeDir | `$RUNTIME`},\n * {@link path.templateDir | `$TEMPLATE`}, {@link path.videoDir | `$VIDEO`}, {@link path.resourceDir | `$RESOURCE`}, {@link path.appDir | `$APP`},\n * {@link path.logDir | `$LOG`}, {@link os.tempdir | `$TEMP`}.\n *\n * Trying to execute any API with a URL not configured on the scope results in a promise rejection due to denied access.\n *\n * Note that this scope applies to **all** APIs on this module.\n *\n * @module\n */\n/**\n * @since 1.0.0\n */\nvar BaseDirectory;\n(function (BaseDirectory) {\n BaseDirectory[BaseDirectory[\"Audio\"] = 1] = \"Audio\";\n BaseDirectory[BaseDirectory[\"Cache\"] = 2] = \"Cache\";\n BaseDirectory[BaseDirectory[\"Config\"] = 3] = \"Config\";\n BaseDirectory[BaseDirectory[\"Data\"] = 4] = \"Data\";\n BaseDirectory[BaseDirectory[\"LocalData\"] = 5] = \"LocalData\";\n BaseDirectory[BaseDirectory[\"Desktop\"] = 6] = \"Desktop\";\n BaseDirectory[BaseDirectory[\"Document\"] = 7] = \"Document\";\n BaseDirectory[BaseDirectory[\"Download\"] = 8] = \"Download\";\n BaseDirectory[BaseDirectory[\"Executable\"] = 9] = \"Executable\";\n BaseDirectory[BaseDirectory[\"Font\"] = 10] = \"Font\";\n BaseDirectory[BaseDirectory[\"Home\"] = 11] = \"Home\";\n BaseDirectory[BaseDirectory[\"Picture\"] = 12] = \"Picture\";\n BaseDirectory[BaseDirectory[\"Public\"] = 13] = \"Public\";\n BaseDirectory[BaseDirectory[\"Runtime\"] = 14] = \"Runtime\";\n BaseDirectory[BaseDirectory[\"Template\"] = 15] = \"Template\";\n BaseDirectory[BaseDirectory[\"Video\"] = 16] = \"Video\";\n BaseDirectory[BaseDirectory[\"Resource\"] = 17] = \"Resource\";\n BaseDirectory[BaseDirectory[\"App\"] = 18] = \"App\";\n BaseDirectory[BaseDirectory[\"Log\"] = 19] = \"Log\";\n BaseDirectory[BaseDirectory[\"Temp\"] = 20] = \"Temp\";\n BaseDirectory[BaseDirectory[\"AppConfig\"] = 21] = \"AppConfig\";\n BaseDirectory[BaseDirectory[\"AppData\"] = 22] = \"AppData\";\n BaseDirectory[BaseDirectory[\"AppLocalData\"] = 23] = \"AppLocalData\";\n BaseDirectory[BaseDirectory[\"AppCache\"] = 24] = \"AppCache\";\n BaseDirectory[BaseDirectory[\"AppLog\"] = 25] = \"AppLog\";\n})(BaseDirectory || (BaseDirectory = {}));\n/**\n * Reads a file as an UTF-8 encoded string.\n * @example\n * ```typescript\n * import { readTextFile, BaseDirectory } from '@tauri-apps/api/fs';\n * // Read the text file in the `$APPCONFIG/app.conf` path\n * const contents = await readTextFile('app.conf', { dir: BaseDirectory.AppConfig });\n * ```\n *\n * @since 1.0.0\n */\nasync function readTextFile(filePath, options = {}) {\n return invokeTauriCommand({\n __tauriModule: 'Fs',\n message: {\n cmd: 'readTextFile',\n path: filePath,\n options\n }\n });\n}\n/**\n * Reads a file as byte array.\n * @example\n * ```typescript\n * import { readBinaryFile, BaseDirectory } from '@tauri-apps/api/fs';\n * // Read the image file in the `$RESOURCEDIR/avatar.png` path\n * const contents = await readBinaryFile('avatar.png', { dir: BaseDirectory.Resource });\n * ```\n *\n * @since 1.0.0\n */\nasync function readBinaryFile(filePath, options = {}) {\n const arr = await invokeTauriCommand({\n __tauriModule: 'Fs',\n message: {\n cmd: 'readFile',\n path: filePath,\n options\n }\n });\n return Uint8Array.from(arr);\n}\n/**\n * Writes a UTF-8 text file.\n *\n * @returns A promise indicating the success or failure of the operation.\n *\n * @since 1.0.0\n */\nasync function writeTextFile(path, contents, options) {\n if (typeof options === 'object') {\n Object.freeze(options);\n }\n if (typeof path === 'object') {\n Object.freeze(path);\n }\n const file = { path: '', contents: '' };\n let fileOptions = options;\n if (typeof path === 'string') {\n file.path = path;\n }\n else {\n file.path = path.path;\n file.contents = path.contents;\n }\n if (typeof contents === 'string') {\n file.contents = contents !== null && contents !== void 0 ? contents : '';\n }\n else {\n fileOptions = contents;\n }\n return invokeTauriCommand({\n __tauriModule: 'Fs',\n message: {\n cmd: 'writeFile',\n path: file.path,\n contents: Array.from(new TextEncoder().encode(file.contents)),\n options: fileOptions\n }\n });\n}\n/**\n * Writes a byte array content to a file.\n *\n * @returns A promise indicating the success or failure of the operation.\n *\n * @since 1.0.0\n */\nasync function writeBinaryFile(path, contents, options) {\n if (typeof options === 'object') {\n Object.freeze(options);\n }\n if (typeof path === 'object') {\n Object.freeze(path);\n }\n const file = { path: '', contents: [] };\n let fileOptions = options;\n if (typeof path === 'string') {\n file.path = path;\n }\n else {\n file.path = path.path;\n file.contents = path.contents;\n }\n if (contents && 'dir' in contents) {\n fileOptions = contents;\n }\n else if (typeof path === 'string') {\n // @ts-expect-error in this case `contents` is always a BinaryFileContents\n file.contents = contents !== null && contents !== void 0 ? contents : [];\n }\n return invokeTauriCommand({\n __tauriModule: 'Fs',\n message: {\n cmd: 'writeFile',\n path: file.path,\n contents: Array.from(file.contents instanceof ArrayBuffer\n ? new Uint8Array(file.contents)\n : file.contents),\n options: fileOptions\n }\n });\n}\n/**\n * List directory files.\n * @example\n * ```typescript\n * import { readDir, BaseDirectory } from '@tauri-apps/api/fs';\n * // Reads the `$APPDATA/users` directory recursively\n * const entries = await readDir('users', { dir: BaseDirectory.AppData, recursive: true });\n *\n * function processEntries(entries) {\n * for (const entry of entries) {\n * console.log(`Entry: ${entry.path}`);\n * if (entry.children) {\n * processEntries(entry.children)\n * }\n * }\n * }\n * ```\n *\n * @since 1.0.0\n */\nasync function readDir(dir, options = {}) {\n return invokeTauriCommand({\n __tauriModule: 'Fs',\n message: {\n cmd: 'readDir',\n path: dir,\n options\n }\n });\n}\n/**\n * Creates a directory.\n * If one of the path's parent components doesn't exist\n * and the `recursive` option isn't set to true, the promise will be rejected.\n * @example\n * ```typescript\n * import { createDir, BaseDirectory } from '@tauri-apps/api/fs';\n * // Create the `$APPDATA/users` directory\n * await createDir('users', { dir: BaseDirectory.AppData, recursive: true });\n * ```\n *\n * @returns A promise indicating the success or failure of the operation.\n *\n * @since 1.0.0\n */\nasync function createDir(dir, options = {}) {\n return invokeTauriCommand({\n __tauriModule: 'Fs',\n message: {\n cmd: 'createDir',\n path: dir,\n options\n }\n });\n}\n/**\n * Removes a directory.\n * If the directory is not empty and the `recursive` option isn't set to true, the promise will be rejected.\n * @example\n * ```typescript\n * import { removeDir, BaseDirectory } from '@tauri-apps/api/fs';\n * // Remove the directory `$APPDATA/users`\n * await removeDir('users', { dir: BaseDirectory.AppData });\n * ```\n *\n * @returns A promise indicating the success or failure of the operation.\n *\n * @since 1.0.0\n */\nasync function removeDir(dir, options = {}) {\n return invokeTauriCommand({\n __tauriModule: 'Fs',\n message: {\n cmd: 'removeDir',\n path: dir,\n options\n }\n });\n}\n/**\n * Copies a file to a destination.\n * @example\n * ```typescript\n * import { copyFile, BaseDirectory } from '@tauri-apps/api/fs';\n * // Copy the `$APPCONFIG/app.conf` file to `$APPCONFIG/app.conf.bk`\n * await copyFile('app.conf', 'app.conf.bk', { dir: BaseDirectory.AppConfig });\n * ```\n *\n * @returns A promise indicating the success or failure of the operation.\n *\n * @since 1.0.0\n */\nasync function copyFile(source, destination, options = {}) {\n return invokeTauriCommand({\n __tauriModule: 'Fs',\n message: {\n cmd: 'copyFile',\n source,\n destination,\n options\n }\n });\n}\n/**\n * Removes a file.\n * @example\n * ```typescript\n * import { removeFile, BaseDirectory } from '@tauri-apps/api/fs';\n * // Remove the `$APPConfig/app.conf` file\n * await removeFile('app.conf', { dir: BaseDirectory.AppConfig });\n * ```\n *\n * @returns A promise indicating the success or failure of the operation.\n *\n * @since 1.0.0\n */\nasync function removeFile(file, options = {}) {\n return invokeTauriCommand({\n __tauriModule: 'Fs',\n message: {\n cmd: 'removeFile',\n path: file,\n options\n }\n });\n}\n/**\n * Renames a file.\n * @example\n * ```typescript\n * import { renameFile, BaseDirectory } from '@tauri-apps/api/fs';\n * // Rename the `$APPDATA/avatar.png` file\n * await renameFile('avatar.png', 'deleted.png', { dir: BaseDirectory.AppData });\n * ```\n *\n * @returns A promise indicating the success or failure of the operation.\n *\n * @since 1.0.0\n */\nasync function renameFile(oldPath, newPath, options = {}) {\n return invokeTauriCommand({\n __tauriModule: 'Fs',\n message: {\n cmd: 'renameFile',\n oldPath,\n newPath,\n options\n }\n });\n}\n/**\n * Check if a path exists.\n * @example\n * ```typescript\n * import { exists, BaseDirectory } from '@tauri-apps/api/fs';\n * // Check if the `$APPDATA/avatar.png` file exists\n * await exists('avatar.png', { dir: BaseDirectory.AppData });\n * ```\n *\n * @since 1.1.0\n */\nasync function exists(path, options = {}) {\n return invokeTauriCommand({\n __tauriModule: 'Fs',\n message: {\n cmd: 'exists',\n path,\n options\n }\n });\n}\n\nexport { BaseDirectory, BaseDirectory as Dir, copyFile, createDir, exists, readBinaryFile, readDir, readTextFile, removeDir, removeFile, renameFile, writeBinaryFile, writeTextFile as writeFile, writeTextFile };\n", "import { invokeTauriCommand } from './helpers/tauri.js';\n\n// Copyright 2019-2023 Tauri Programme within The Commons Conservancy\n// SPDX-License-Identifier: Apache-2.0\n// SPDX-License-Identifier: MIT\n/**\n * Access the HTTP client written in Rust.\n *\n * This package is also accessible with `window.__TAURI__.http` when [`build.withGlobalTauri`](https://tauri.app/v1/api/config/#buildconfig.withglobaltauri) in `tauri.conf.json` is set to `true`.\n *\n * The APIs must be allowlisted on `tauri.conf.json`:\n * ```json\n * {\n * \"tauri\": {\n * \"allowlist\": {\n * \"http\": {\n * \"all\": true, // enable all http APIs\n * \"request\": true // enable HTTP request API\n * }\n * }\n * }\n * }\n * ```\n * It is recommended to allowlist only the APIs you use for optimal bundle size and security.\n *\n * ## Security\n *\n * This API has a scope configuration that forces you to restrict the URLs and paths that can be accessed using glob patterns.\n *\n * For instance, this scope configuration only allows making HTTP requests to the GitHub API for the `tauri-apps` organization:\n * ```json\n * {\n * \"tauri\": {\n * \"allowlist\": {\n * \"http\": {\n * \"scope\": [\"https://api.github.com/repos/tauri-apps/*\"]\n * }\n * }\n * }\n * }\n * ```\n * Trying to execute any API with a URL not configured on the scope results in a promise rejection due to denied access.\n *\n * @module\n */\n/**\n * @since 1.0.0\n */\nvar ResponseType;\n(function (ResponseType) {\n ResponseType[ResponseType[\"JSON\"] = 1] = \"JSON\";\n ResponseType[ResponseType[\"Text\"] = 2] = \"Text\";\n ResponseType[ResponseType[\"Binary\"] = 3] = \"Binary\";\n})(ResponseType || (ResponseType = {}));\nasync function formBody(data) {\n const form = {};\n const append = async (key, v) => {\n if (v !== null) {\n let r;\n if (typeof v === 'string') {\n r = v;\n }\n else if (v instanceof Uint8Array || Array.isArray(v)) {\n r = Array.from(v);\n }\n else if (v instanceof File) {\n r = {\n file: Array.from(new Uint8Array(await v.arrayBuffer())),\n mime: v.type,\n fileName: v.name\n };\n }\n else if (typeof v.file === 'string') {\n r = { file: v.file, mime: v.mime, fileName: v.fileName };\n }\n else {\n r = { file: Array.from(v.file), mime: v.mime, fileName: v.fileName };\n }\n form[String(key)] = r;\n }\n };\n if (data instanceof FormData) {\n for (const [key, value] of data) {\n await append(key, value);\n }\n }\n else {\n for (const [key, value] of Object.entries(data)) {\n await append(key, value);\n }\n }\n return form;\n}\n/**\n * The body object to be used on POST and PUT requests.\n *\n * @since 1.0.0\n */\nclass Body {\n /** @ignore */\n constructor(type, payload) {\n this.type = type;\n this.payload = payload;\n }\n /**\n * Creates a new form data body. The form data is an object where each key is the entry name,\n * and the value is either a string or a file object.\n *\n * By default it sets the `application/x-www-form-urlencoded` Content-Type header,\n * but you can set it to `multipart/form-data` if the Cargo feature `http-multipart` is enabled.\n *\n * Note that a file path must be allowed in the `fs` allowlist scope.\n *\n * @example\n * ```typescript\n * import { Body } from \"@tauri-apps/api/http\"\n * const body = Body.form({\n * key: 'value',\n * image: {\n * file: '/path/to/file', // either a path or an array buffer of the file contents\n * mime: 'image/jpeg', // optional\n * fileName: 'image.jpg' // optional\n * }\n * });\n *\n * // alternatively, use a FormData:\n * const form = new FormData();\n * form.append('key', 'value');\n * form.append('image', file, 'image.png');\n * const formBody = Body.form(form);\n * ```\n *\n * @param data The body data.\n *\n * @returns The body object ready to be used on the POST and PUT requests.\n */\n static form(data) {\n return new Body('Form', data);\n }\n /**\n * Creates a new JSON body.\n * @example\n * ```typescript\n * import { Body } from \"@tauri-apps/api/http\"\n * Body.json({\n * registered: true,\n * name: 'tauri'\n * });\n * ```\n *\n * @param data The body JSON object.\n *\n * @returns The body object ready to be used on the POST and PUT requests.\n */\n static json(data) {\n return new Body('Json', data);\n }\n /**\n * Creates a new UTF-8 string body.\n * @example\n * ```typescript\n * import { Body } from \"@tauri-apps/api/http\"\n * Body.text('The body content as a string');\n * ```\n *\n * @param value The body string.\n *\n * @returns The body object ready to be used on the POST and PUT requests.\n */\n static text(value) {\n return new Body('Text', value);\n }\n /**\n * Creates a new byte array body.\n * @example\n * ```typescript\n * import { Body } from \"@tauri-apps/api/http\"\n * Body.bytes(new Uint8Array([1, 2, 3]));\n * ```\n *\n * @param bytes The body byte array.\n *\n * @returns The body object ready to be used on the POST and PUT requests.\n */\n static bytes(bytes) {\n // stringifying Uint8Array doesn't return an array of numbers, so we create one here\n return new Body('Bytes', Array.from(bytes instanceof ArrayBuffer ? new Uint8Array(bytes) : bytes));\n }\n}\n/**\n * Response object.\n *\n * @since 1.0.0\n * */\nclass Response {\n /** @ignore */\n constructor(response) {\n this.url = response.url;\n this.status = response.status;\n this.ok = this.status >= 200 && this.status < 300;\n this.headers = response.headers;\n this.rawHeaders = response.rawHeaders;\n this.data = response.data;\n }\n}\n/**\n * @since 1.0.0\n */\nclass Client {\n /** @ignore */\n constructor(id) {\n this.id = id;\n }\n /**\n * Drops the client instance.\n * @example\n * ```typescript\n * import { getClient } from '@tauri-apps/api/http';\n * const client = await getClient();\n * await client.drop();\n * ```\n */\n async drop() {\n return invokeTauriCommand({\n __tauriModule: 'Http',\n message: {\n cmd: 'dropClient',\n client: this.id\n }\n });\n }\n /**\n * Makes an HTTP request.\n * @example\n * ```typescript\n * import { getClient } from '@tauri-apps/api/http';\n * const client = await getClient();\n * const response = await client.request({\n * method: 'GET',\n * url: 'http://localhost:3003/users',\n * });\n * ```\n */\n async request(options) {\n var _a;\n const jsonResponse = !options.responseType || options.responseType === ResponseType.JSON;\n if (jsonResponse) {\n options.responseType = ResponseType.Text;\n }\n if (((_a = options.body) === null || _a === void 0 ? void 0 : _a.type) === 'Form') {\n options.body.payload = await formBody(options.body.payload);\n }\n return invokeTauriCommand({\n __tauriModule: 'Http',\n message: {\n cmd: 'httpRequest',\n client: this.id,\n options\n }\n }).then((res) => {\n const response = new Response(res);\n if (jsonResponse) {\n /* eslint-disable */\n try {\n response.data = JSON.parse(response.data);\n }\n catch (e) {\n if (response.ok && response.data === '') {\n response.data = {};\n }\n else if (response.ok) {\n throw Error(`Failed to parse response \\`${response.data}\\` as JSON: ${e};\n try setting the \\`responseType\\` option to \\`ResponseType.Text\\` or \\`ResponseType.Binary\\` if the API does not return a JSON response.`);\n }\n }\n /* eslint-enable */\n return response;\n }\n return response;\n });\n }\n /**\n * Makes a GET request.\n * @example\n * ```typescript\n * import { getClient, ResponseType } from '@tauri-apps/api/http';\n * const client = await getClient();\n * const response = await client.get('http://localhost:3003/users', {\n * timeout: 30,\n * // the expected response type\n * responseType: ResponseType.JSON\n * });\n * ```\n */\n async get(url, options) {\n return this.request({\n method: 'GET',\n url,\n ...options\n });\n }\n /**\n * Makes a POST request.\n * @example\n * ```typescript\n * import { getClient, Body, ResponseType } from '@tauri-apps/api/http';\n * const client = await getClient();\n * const response = await client.post('http://localhost:3003/users', {\n * body: Body.json({\n * name: 'tauri',\n * password: 'awesome'\n * }),\n * // in this case the server returns a simple string\n * responseType: ResponseType.Text,\n * });\n * ```\n */\n async post(url, body, options) {\n return this.request({\n method: 'POST',\n url,\n body,\n ...options\n });\n }\n /**\n * Makes a PUT request.\n * @example\n * ```typescript\n * import { getClient, Body } from '@tauri-apps/api/http';\n * const client = await getClient();\n * const response = await client.put('http://localhost:3003/users/1', {\n * body: Body.form({\n * file: {\n * file: '/home/tauri/avatar.png',\n * mime: 'image/png',\n * fileName: 'avatar.png'\n * }\n * })\n * });\n * ```\n */\n async put(url, body, options) {\n return this.request({\n method: 'PUT',\n url,\n body,\n ...options\n });\n }\n /**\n * Makes a PATCH request.\n * @example\n * ```typescript\n * import { getClient, Body } from '@tauri-apps/api/http';\n * const client = await getClient();\n * const response = await client.patch('http://localhost:3003/users/1', {\n * body: Body.json({ email: 'contact@tauri.app' })\n * });\n * ```\n */\n async patch(url, options) {\n return this.request({\n method: 'PATCH',\n url,\n ...options\n });\n }\n /**\n * Makes a DELETE request.\n * @example\n * ```typescript\n * import { getClient } from '@tauri-apps/api/http';\n * const client = await getClient();\n * const response = await client.delete('http://localhost:3003/users/1');\n * ```\n */\n async delete(url, options) {\n return this.request({\n method: 'DELETE',\n url,\n ...options\n });\n }\n}\n/**\n * Creates a new client using the specified options.\n * @example\n * ```typescript\n * import { getClient } from '@tauri-apps/api/http';\n * const client = await getClient();\n * ```\n *\n * @param options Client configuration.\n *\n * @returns A promise resolving to the client instance.\n *\n * @since 1.0.0\n */\nasync function getClient(options) {\n return invokeTauriCommand({\n __tauriModule: 'Http',\n message: {\n cmd: 'createClient',\n options\n }\n }).then((id) => new Client(id));\n}\n/** @internal */\nlet defaultClient = null;\n/**\n * Perform an HTTP request using the default client.\n * @example\n * ```typescript\n * import { fetch } from '@tauri-apps/api/http';\n * const response = await fetch('http://localhost:3003/users/2', {\n * method: 'GET',\n * timeout: 30,\n * });\n * ```\n */\nasync function fetch(url, options) {\n var _a;\n if (defaultClient === null) {\n defaultClient = await getClient();\n }\n return defaultClient.request({\n url,\n method: (_a = options === null || options === void 0 ? void 0 : options.method) !== null && _a !== void 0 ? _a : 'GET',\n ...options\n });\n}\n\nexport { Body, Client, Response, ResponseType, fetch, getClient };\n", "// Copyright 2019-2023 Tauri Programme within The Commons Conservancy\n// SPDX-License-Identifier: Apache-2.0\n// SPDX-License-Identifier: MIT\n/** @ignore */\nfunction isWindows() {\n return navigator.appVersion.includes('Win');\n}\n\nexport { isWindows };\n", "import { invokeTauriCommand } from './helpers/tauri.js';\nimport { BaseDirectory } from './fs.js';\nimport { isWindows } from './helpers/os-check.js';\n\n// Copyright 2019-2023 Tauri Programme within The Commons Conservancy\n// SPDX-License-Identifier: Apache-2.0\n// SPDX-License-Identifier: MIT\n/**\n * The path module provides utilities for working with file and directory paths.\n *\n * This package is also accessible with `window.__TAURI__.path` when [`build.withGlobalTauri`](https://tauri.app/v1/api/config/#buildconfig.withglobaltauri) in `tauri.conf.json` is set to `true`.\n *\n * The APIs must be added to [`tauri.allowlist.path`](https://tauri.app/v1/api/config/#allowlistconfig.path) in `tauri.conf.json`:\n * ```json\n * {\n * \"tauri\": {\n * \"allowlist\": {\n * \"path\": {\n * \"all\": true, // enable all Path APIs\n * }\n * }\n * }\n * }\n * ```\n * It is recommended to allowlist only the APIs you use for optimal bundle size and security.\n * @module\n */\n/**\n * Returns the path to the suggested directory for your app config files.\n *\n * @deprecated since 1.2.0: Will be removed in 2.0.0. Use {@link appConfigDir} or {@link appDataDir} instead.\n * @since 1.0.0\n */\nasync function appDir() {\n return appConfigDir();\n}\n/**\n * Returns the path to the suggested directory for your app's config files.\n * Resolves to `${configDir}/${bundleIdentifier}`, where `bundleIdentifier` is the value [`tauri.bundle.identifier`](https://tauri.app/v1/api/config/#bundleconfig.identifier) is configured in `tauri.conf.json`.\n * @example\n * ```typescript\n * import { appConfigDir } from '@tauri-apps/api/path';\n * const appConfigDirPath = await appConfigDir();\n * ```\n *\n * @since 1.2.0\n */\nasync function appConfigDir() {\n return invokeTauriCommand({\n __tauriModule: 'Path',\n message: {\n cmd: 'resolvePath',\n path: '',\n directory: BaseDirectory.AppConfig\n }\n });\n}\n/**\n * Returns the path to the suggested directory for your app's data files.\n * Resolves to `${dataDir}/${bundleIdentifier}`, where `bundleIdentifier` is the value [`tauri.bundle.identifier`](https://tauri.app/v1/api/config/#bundleconfig.identifier) is configured in `tauri.conf.json`.\n * @example\n * ```typescript\n * import { appDataDir } from '@tauri-apps/api/path';\n * const appDataDirPath = await appDataDir();\n * ```\n *\n * @since 1.2.0\n */\nasync function appDataDir() {\n return invokeTauriCommand({\n __tauriModule: 'Path',\n message: {\n cmd: 'resolvePath',\n path: '',\n directory: BaseDirectory.AppData\n }\n });\n}\n/**\n * Returns the path to the suggested directory for your app's local data files.\n * Resolves to `${localDataDir}/${bundleIdentifier}`, where `bundleIdentifier` is the value [`tauri.bundle.identifier`](https://tauri.app/v1/api/config/#bundleconfig.identifier) is configured in `tauri.conf.json`.\n * @example\n * ```typescript\n * import { appLocalDataDir } from '@tauri-apps/api/path';\n * const appLocalDataDirPath = await appLocalDataDir();\n * ```\n *\n * @since 1.2.0\n */\nasync function appLocalDataDir() {\n return invokeTauriCommand({\n __tauriModule: 'Path',\n message: {\n cmd: 'resolvePath',\n path: '',\n directory: BaseDirectory.AppLocalData\n }\n });\n}\n/**\n * Returns the path to the suggested directory for your app's cache files.\n * Resolves to `${cacheDir}/${bundleIdentifier}`, where `bundleIdentifier` is the value [`tauri.bundle.identifier`](https://tauri.app/v1/api/config/#bundleconfig.identifier) is configured in `tauri.conf.json`.\n * @example\n * ```typescript\n * import { appCacheDir } from '@tauri-apps/api/path';\n * const appCacheDirPath = await appCacheDir();\n * ```\n *\n * @since 1.2.0\n */\nasync function appCacheDir() {\n return invokeTauriCommand({\n __tauriModule: 'Path',\n message: {\n cmd: 'resolvePath',\n path: '',\n directory: BaseDirectory.AppCache\n }\n });\n}\n/**\n * Returns the path to the user's audio directory.\n *\n * #### Platform-specific\n *\n * - **Linux:** Resolves to [`xdg-user-dirs`](https://www.freedesktop.org/wiki/Software/xdg-user-dirs/)' `XDG_MUSIC_DIR`.\n * - **macOS:** Resolves to `$HOME/Music`.\n * - **Windows:** Resolves to `{FOLDERID_Music}`.\n * @example\n * ```typescript\n * import { audioDir } from '@tauri-apps/api/path';\n * const audioDirPath = await audioDir();\n * ```\n *\n * @since 1.0.0\n */\nasync function audioDir() {\n return invokeTauriCommand({\n __tauriModule: 'Path',\n message: {\n cmd: 'resolvePath',\n path: '',\n directory: BaseDirectory.Audio\n }\n });\n}\n/**\n * Returns the path to the user's cache directory.\n *\n * #### Platform-specific\n *\n * - **Linux:** Resolves to `$XDG_CACHE_HOME` or `$HOME/.cache`.\n * - **macOS:** Resolves to `$HOME/Library/Caches`.\n * - **Windows:** Resolves to `{FOLDERID_LocalAppData}`.\n * @example\n * ```typescript\n * import { cacheDir } from '@tauri-apps/api/path';\n * const cacheDirPath = await cacheDir();\n * ```\n *\n * @since 1.0.0\n */\nasync function cacheDir() {\n return invokeTauriCommand({\n __tauriModule: 'Path',\n message: {\n cmd: 'resolvePath',\n path: '',\n directory: BaseDirectory.Cache\n }\n });\n}\n/**\n * Returns the path to the user's config directory.\n *\n * #### Platform-specific\n *\n * - **Linux:** Resolves to `$XDG_CONFIG_HOME` or `$HOME/.config`.\n * - **macOS:** Resolves to `$HOME/Library/Application Support`.\n * - **Windows:** Resolves to `{FOLDERID_RoamingAppData}`.\n * @example\n * ```typescript\n * import { configDir } from '@tauri-apps/api/path';\n * const configDirPath = await configDir();\n * ```\n *\n * @since 1.0.0\n */\nasync function configDir() {\n return invokeTauriCommand({\n __tauriModule: 'Path',\n message: {\n cmd: 'resolvePath',\n path: '',\n directory: BaseDirectory.Config\n }\n });\n}\n/**\n * Returns the path to the user's data directory.\n *\n * #### Platform-specific\n *\n * - **Linux:** Resolves to `$XDG_DATA_HOME` or `$HOME/.local/share`.\n * - **macOS:** Resolves to `$HOME/Library/Application Support`.\n * - **Windows:** Resolves to `{FOLDERID_RoamingAppData}`.\n * @example\n * ```typescript\n * import { dataDir } from '@tauri-apps/api/path';\n * const dataDirPath = await dataDir();\n * ```\n *\n * @since 1.0.0\n */\nasync function dataDir() {\n return invokeTauriCommand({\n __tauriModule: 'Path',\n message: {\n cmd: 'resolvePath',\n path: '',\n directory: BaseDirectory.Data\n }\n });\n}\n/**\n * Returns the path to the user's desktop directory.\n *\n * #### Platform-specific\n *\n * - **Linux:** Resolves to [`xdg-user-dirs`](https://www.freedesktop.org/wiki/Software/xdg-user-dirs/)' `XDG_DESKTOP_DIR`.\n * - **macOS:** Resolves to `$HOME/Desktop`.\n * - **Windows:** Resolves to `{FOLDERID_Desktop}`.\n * @example\n * ```typescript\n * import { desktopDir } from '@tauri-apps/api/path';\n * const desktopPath = await desktopDir();\n * ```\n *\n * @since 1.0.0\n */\nasync function desktopDir() {\n return invokeTauriCommand({\n __tauriModule: 'Path',\n message: {\n cmd: 'resolvePath',\n path: '',\n directory: BaseDirectory.Desktop\n }\n });\n}\n/**\n * Returns the path to the user's document directory.\n * @example\n * ```typescript\n * import { documentDir } from '@tauri-apps/api/path';\n * const documentDirPath = await documentDir();\n * ```\n *\n * #### Platform-specific\n *\n * - **Linux:** Resolves to [`xdg-user-dirs`](https://www.freedesktop.org/wiki/Software/xdg-user-dirs/)' `XDG_DOCUMENTS_DIR`.\n * - **macOS:** Resolves to `$HOME/Documents`.\n * - **Windows:** Resolves to `{FOLDERID_Documents}`.\n *\n * @since 1.0.0\n */\nasync function documentDir() {\n return invokeTauriCommand({\n __tauriModule: 'Path',\n message: {\n cmd: 'resolvePath',\n path: '',\n directory: BaseDirectory.Document\n }\n });\n}\n/**\n * Returns the path to the user's download directory.\n *\n * #### Platform-specific\n *\n * - **Linux**: Resolves to [`xdg-user-dirs`](https://www.freedesktop.org/wiki/Software/xdg-user-dirs/)' `XDG_DOWNLOAD_DIR`.\n * - **macOS**: Resolves to `$HOME/Downloads`.\n * - **Windows**: Resolves to `{FOLDERID_Downloads}`.\n * @example\n * ```typescript\n * import { downloadDir } from '@tauri-apps/api/path';\n * const downloadDirPath = await downloadDir();\n * ```\n *\n * @since 1.0.0\n */\nasync function downloadDir() {\n return invokeTauriCommand({\n __tauriModule: 'Path',\n message: {\n cmd: 'resolvePath',\n path: '',\n directory: BaseDirectory.Download\n }\n });\n}\n/**\n * Returns the path to the user's executable directory.\n *\n * #### Platform-specific\n *\n * - **Linux:** Resolves to `$XDG_BIN_HOME/../bin` or `$XDG_DATA_HOME/../bin` or `$HOME/.local/bin`.\n * - **macOS:** Not supported.\n * - **Windows:** Not supported.\n * @example\n * ```typescript\n * import { executableDir } from '@tauri-apps/api/path';\n * const executableDirPath = await executableDir();\n * ```\n *\n * @since 1.0.0\n */\nasync function executableDir() {\n return invokeTauriCommand({\n __tauriModule: 'Path',\n message: {\n cmd: 'resolvePath',\n path: '',\n directory: BaseDirectory.Executable\n }\n });\n}\n/**\n * Returns the path to the user's font directory.\n *\n * #### Platform-specific\n *\n * - **Linux:** Resolves to `$XDG_DATA_HOME/fonts` or `$HOME/.local/share/fonts`.\n * - **macOS:** Resolves to `$HOME/Library/Fonts`.\n * - **Windows:** Not supported.\n * @example\n * ```typescript\n * import { fontDir } from '@tauri-apps/api/path';\n * const fontDirPath = await fontDir();\n * ```\n *\n * @since 1.0.0\n */\nasync function fontDir() {\n return invokeTauriCommand({\n __tauriModule: 'Path',\n message: {\n cmd: 'resolvePath',\n path: '',\n directory: BaseDirectory.Font\n }\n });\n}\n/**\n * Returns the path to the user's home directory.\n *\n * #### Platform-specific\n *\n * - **Linux:** Resolves to `$HOME`.\n * - **macOS:** Resolves to `$HOME`.\n * - **Windows:** Resolves to `{FOLDERID_Profile}`.\n * @example\n * ```typescript\n * import { homeDir } from '@tauri-apps/api/path';\n * const homeDirPath = await homeDir();\n * ```\n *\n * @since 1.0.0\n */\nasync function homeDir() {\n return invokeTauriCommand({\n __tauriModule: 'Path',\n message: {\n cmd: 'resolvePath',\n path: '',\n directory: BaseDirectory.Home\n }\n });\n}\n/**\n * Returns the path to the user's local data directory.\n *\n * #### Platform-specific\n *\n * - **Linux:** Resolves to `$XDG_DATA_HOME` or `$HOME/.local/share`.\n * - **macOS:** Resolves to `$HOME/Library/Application Support`.\n * - **Windows:** Resolves to `{FOLDERID_LocalAppData}`.\n * @example\n * ```typescript\n * import { localDataDir } from '@tauri-apps/api/path';\n * const localDataDirPath = await localDataDir();\n * ```\n *\n * @since 1.0.0\n */\nasync function localDataDir() {\n return invokeTauriCommand({\n __tauriModule: 'Path',\n message: {\n cmd: 'resolvePath',\n path: '',\n directory: BaseDirectory.LocalData\n }\n });\n}\n/**\n * Returns the path to the user's picture directory.\n *\n * #### Platform-specific\n *\n * - **Linux:** Resolves to [`xdg-user-dirs`](https://www.freedesktop.org/wiki/Software/xdg-user-dirs/)' `XDG_PICTURES_DIR`.\n * - **macOS:** Resolves to `$HOME/Pictures`.\n * - **Windows:** Resolves to `{FOLDERID_Pictures}`.\n * @example\n * ```typescript\n * import { pictureDir } from '@tauri-apps/api/path';\n * const pictureDirPath = await pictureDir();\n * ```\n *\n * @since 1.0.0\n */\nasync function pictureDir() {\n return invokeTauriCommand({\n __tauriModule: 'Path',\n message: {\n cmd: 'resolvePath',\n path: '',\n directory: BaseDirectory.Picture\n }\n });\n}\n/**\n * Returns the path to the user's public directory.\n *\n * #### Platform-specific\n *\n * - **Linux:** Resolves to [`xdg-user-dirs`](https://www.freedesktop.org/wiki/Software/xdg-user-dirs/)' `XDG_PUBLICSHARE_DIR`.\n * - **macOS:** Resolves to `$HOME/Public`.\n * - **Windows:** Resolves to `{FOLDERID_Public}`.\n * @example\n * ```typescript\n * import { publicDir } from '@tauri-apps/api/path';\n * const publicDirPath = await publicDir();\n * ```\n *\n * @since 1.0.0\n */\nasync function publicDir() {\n return invokeTauriCommand({\n __tauriModule: 'Path',\n message: {\n cmd: 'resolvePath',\n path: '',\n directory: BaseDirectory.Public\n }\n });\n}\n/**\n * Returns the path to the application's resource directory.\n * To resolve a resource path, see the [[resolveResource | `resolveResource API`]].\n * @example\n * ```typescript\n * import { resourceDir } from '@tauri-apps/api/path';\n * const resourceDirPath = await resourceDir();\n * ```\n *\n * @since 1.0.0\n */\nasync function resourceDir() {\n return invokeTauriCommand({\n __tauriModule: 'Path',\n message: {\n cmd: 'resolvePath',\n path: '',\n directory: BaseDirectory.Resource\n }\n });\n}\n/**\n * Resolve the path to a resource file.\n * @example\n * ```typescript\n * import { resolveResource } from '@tauri-apps/api/path';\n * const resourcePath = await resolveResource('script.sh');\n * ```\n *\n * @param resourcePath The path to the resource.\n * Must follow the same syntax as defined in `tauri.conf.json > tauri > bundle > resources`, i.e. keeping subfolders and parent dir components (`../`).\n * @returns The full path to the resource.\n *\n * @since 1.0.0\n */\nasync function resolveResource(resourcePath) {\n return invokeTauriCommand({\n __tauriModule: 'Path',\n message: {\n cmd: 'resolvePath',\n path: resourcePath,\n directory: BaseDirectory.Resource\n }\n });\n}\n/**\n * Returns the path to the user's runtime directory.\n *\n * #### Platform-specific\n *\n * - **Linux:** Resolves to `$XDG_RUNTIME_DIR`.\n * - **macOS:** Not supported.\n * - **Windows:** Not supported.\n * @example\n * ```typescript\n * import { runtimeDir } from '@tauri-apps/api/path';\n * const runtimeDirPath = await runtimeDir();\n * ```\n *\n * @since 1.0.0\n */\nasync function runtimeDir() {\n return invokeTauriCommand({\n __tauriModule: 'Path',\n message: {\n cmd: 'resolvePath',\n path: '',\n directory: BaseDirectory.Runtime\n }\n });\n}\n/**\n * Returns the path to the user's template directory.\n *\n * #### Platform-specific\n *\n * - **Linux:** Resolves to [`xdg-user-dirs`](https://www.freedesktop.org/wiki/Software/xdg-user-dirs/)' `XDG_TEMPLATES_DIR`.\n * - **macOS:** Not supported.\n * - **Windows:** Resolves to `{FOLDERID_Templates}`.\n * @example\n * ```typescript\n * import { templateDir } from '@tauri-apps/api/path';\n * const templateDirPath = await templateDir();\n * ```\n *\n * @since 1.0.0\n */\nasync function templateDir() {\n return invokeTauriCommand({\n __tauriModule: 'Path',\n message: {\n cmd: 'resolvePath',\n path: '',\n directory: BaseDirectory.Template\n }\n });\n}\n/**\n * Returns the path to the user's video directory.\n *\n * #### Platform-specific\n *\n * - **Linux:** Resolves to [`xdg-user-dirs`](https://www.freedesktop.org/wiki/Software/xdg-user-dirs/)' `XDG_VIDEOS_DIR`.\n * - **macOS:** Resolves to `$HOME/Movies`.\n * - **Windows:** Resolves to `{FOLDERID_Videos}`.\n * @example\n * ```typescript\n * import { videoDir } from '@tauri-apps/api/path';\n * const videoDirPath = await videoDir();\n * ```\n *\n * @since 1.0.0\n */\nasync function videoDir() {\n return invokeTauriCommand({\n __tauriModule: 'Path',\n message: {\n cmd: 'resolvePath',\n path: '',\n directory: BaseDirectory.Video\n }\n });\n}\n/**\n * Returns the path to the suggested log directory.\n *\n * @deprecated since 1.2.0: Will be removed in 2.0.0. Use {@link appLogDir} instead.\n * @since 1.0.0\n */\nasync function logDir() {\n return appLogDir();\n}\n/**\n * Returns the path to the suggested directory for your app's log files.\n *\n * #### Platform-specific\n *\n * - **Linux:** Resolves to `${configDir}/${bundleIdentifier}/logs`.\n * - **macOS:** Resolves to `${homeDir}/Library/Logs/{bundleIdentifier}`\n * - **Windows:** Resolves to `${configDir}/${bundleIdentifier}/logs`.\n * @example\n * ```typescript\n * import { appLogDir } from '@tauri-apps/api/path';\n * const appLogDirPath = await appLogDir();\n * ```\n *\n * @since 1.2.0\n */\nasync function appLogDir() {\n return invokeTauriCommand({\n __tauriModule: 'Path',\n message: {\n cmd: 'resolvePath',\n path: '',\n directory: BaseDirectory.AppLog\n }\n });\n}\n/**\n * Provides the platform-specific path segment separator:\n * - `\\` on Windows\n * - `/` on POSIX\n *\n * @since 1.0.0\n */\nconst sep = isWindows() ? '\\\\' : '/';\n/**\n * Provides the platform-specific path segment delimiter:\n * - `;` on Windows\n * - `:` on POSIX\n *\n * @since 1.0.0\n */\nconst delimiter = isWindows() ? ';' : ':';\n/**\n * Resolves a sequence of `paths` or `path` segments into an absolute path.\n * @example\n * ```typescript\n * import { resolve, appDataDir } from '@tauri-apps/api/path';\n * const appDataDirPath = await appDataDir();\n * const path = await resolve(appDataDirPath, '..', 'users', 'tauri', 'avatar.png');\n * ```\n *\n * @since 1.0.0\n */\nasync function resolve(...paths) {\n return invokeTauriCommand({\n __tauriModule: 'Path',\n message: {\n cmd: 'resolve',\n paths\n }\n });\n}\n/**\n * Normalizes the given `path`, resolving `'..'` and `'.'` segments and resolve symbolic links.\n * @example\n * ```typescript\n * import { normalize, appDataDir } from '@tauri-apps/api/path';\n * const appDataDirPath = await appDataDir();\n * const path = await normalize(appDataDirPath, '..', 'users', 'tauri', 'avatar.png');\n * ```\n *\n * @since 1.0.0\n */\nasync function normalize(path) {\n return invokeTauriCommand({\n __tauriModule: 'Path',\n message: {\n cmd: 'normalize',\n path\n }\n });\n}\n/**\n * Joins all given `path` segments together using the platform-specific separator as a delimiter, then normalizes the resulting path.\n * @example\n * ```typescript\n * import { join, appDataDir } from '@tauri-apps/api/path';\n * const appDataDirPath = await appDataDir();\n * const path = await join(appDataDirPath, 'users', 'tauri', 'avatar.png');\n * ```\n *\n * @since 1.0.0\n */\nasync function join(...paths) {\n return invokeTauriCommand({\n __tauriModule: 'Path',\n message: {\n cmd: 'join',\n paths\n }\n });\n}\n/**\n * Returns the directory name of a `path`. Trailing directory separators are ignored.\n * @example\n * ```typescript\n * import { dirname } from '@tauri-apps/api/path';\n * const dir = await dirname('/path/to/somedir/');\n * assert(dir === 'somedir');\n * ```\n *\n * @since 1.0.0\n */\nasync function dirname(path) {\n return invokeTauriCommand({\n __tauriModule: 'Path',\n message: {\n cmd: 'dirname',\n path\n }\n });\n}\n/**\n * Returns the extension of the `path`.\n * @example\n * ```typescript\n * import { extname } from '@tauri-apps/api/path';\n * const ext = await extname('/path/to/file.html');\n * assert(ext === 'html');\n * ```\n *\n * @since 1.0.0\n */\nasync function extname(path) {\n return invokeTauriCommand({\n __tauriModule: 'Path',\n message: {\n cmd: 'extname',\n path\n }\n });\n}\n/**\n * Returns the last portion of a `path`. Trailing directory separators are ignored.\n * @example\n * ```typescript\n * import { basename } from '@tauri-apps/api/path';\n * const base = await basename('path/to/app.conf');\n * assert(base === 'app.conf');\n * ```\n *\n * @param ext An optional file extension to be removed from the returned path.\n *\n * @since 1.0.0\n */\nasync function basename(path, ext) {\n return invokeTauriCommand({\n __tauriModule: 'Path',\n message: {\n cmd: 'basename',\n path,\n ext\n }\n });\n}\n/**\n * Returns whether the path is absolute or not.\n * @example\n * ```typescript\n * import { isAbsolute } from '@tauri-apps/api/path';\n * assert(await isAbsolute('/home/tauri'));\n * ```\n *\n * @since 1.0.0\n */\nasync function isAbsolute(path) {\n return invokeTauriCommand({\n __tauriModule: 'Path',\n message: {\n cmd: 'isAbsolute',\n path\n }\n });\n}\n\nexport { BaseDirectory, appCacheDir, appConfigDir, appDataDir, appDir, appLocalDataDir, appLogDir, audioDir, basename, cacheDir, configDir, dataDir, delimiter, desktopDir, dirname, documentDir, downloadDir, executableDir, extname, fontDir, homeDir, isAbsolute, join, localDataDir, logDir, normalize, pictureDir, publicDir, resolve, resolveResource, resourceDir, runtimeDir, sep, templateDir, videoDir };\n", "import { invokeTauriCommand } from './helpers/tauri.js';\nimport { listen, once, emit } from './helpers/event.js';\nimport { TauriEvent } from './event.js';\n\n// Copyright 2019-2023 Tauri Programme within The Commons Conservancy\n// SPDX-License-Identifier: Apache-2.0\n// SPDX-License-Identifier: MIT\n/**\n * Provides APIs to create windows, communicate with other windows and manipulate the current window.\n *\n * This package is also accessible with `window.__TAURI__.window` when [`build.withGlobalTauri`](https://tauri.app/v1/api/config/#buildconfig.withglobaltauri) in `tauri.conf.json` is set to `true`.\n *\n * The APIs must be added to [`tauri.allowlist.window`](https://tauri.app/v1/api/config/#allowlistconfig.window) in `tauri.conf.json`:\n * ```json\n * {\n * \"tauri\": {\n * \"allowlist\": {\n * \"window\": {\n * \"all\": true, // enable all window APIs\n * \"create\": true, // enable window creation\n * \"center\": true,\n * \"requestUserAttention\": true,\n * \"setResizable\": true,\n * \"setMaximizable\": true,\n * \"setMinimizable\": true,\n * \"setClosable\": true,\n * \"setTitle\": true,\n * \"maximize\": true,\n * \"unmaximize\": true,\n * \"minimize\": true,\n * \"unminimize\": true,\n * \"show\": true,\n * \"hide\": true,\n * \"close\": true,\n * \"setDecorations\": true,\n * \"setAlwaysOnTop\": true,\n * \"setContentProtected\": true,\n * \"setSize\": true,\n * \"setMinSize\": true,\n * \"setMaxSize\": true,\n * \"setPosition\": true,\n * \"setFullscreen\": true,\n * \"setFocus\": true,\n * \"setIcon\": true,\n * \"setSkipTaskbar\": true,\n * \"setCursorGrab\": true,\n * \"setCursorVisible\": true,\n * \"setCursorIcon\": true,\n * \"setCursorPosition\": true,\n * \"setIgnoreCursorEvents\": true,\n * \"startDragging\": true,\n * \"print\": true\n * }\n * }\n * }\n * }\n * ```\n * It is recommended to allowlist only the APIs you use for optimal bundle size and security.\n *\n * ## Window events\n *\n * Events can be listened to using `appWindow.listen`:\n * ```typescript\n * import { appWindow } from \"@tauri-apps/api/window\";\n * appWindow.listen(\"my-window-event\", ({ event, payload }) => { });\n * ```\n *\n * @module\n */\n/**\n * A size represented in logical pixels.\n *\n * @since 1.0.0\n */\nclass LogicalSize {\n constructor(width, height) {\n this.type = 'Logical';\n this.width = width;\n this.height = height;\n }\n}\n/**\n * A size represented in physical pixels.\n *\n * @since 1.0.0\n */\nclass PhysicalSize {\n constructor(width, height) {\n this.type = 'Physical';\n this.width = width;\n this.height = height;\n }\n /**\n * Converts the physical size to a logical one.\n * @example\n * ```typescript\n * import { appWindow } from '@tauri-apps/api/window';\n * const factor = await appWindow.scaleFactor();\n * const size = await appWindow.innerSize();\n * const logical = size.toLogical(factor);\n * ```\n * */\n toLogical(scaleFactor) {\n return new LogicalSize(this.width / scaleFactor, this.height / scaleFactor);\n }\n}\n/**\n * A position represented in logical pixels.\n *\n * @since 1.0.0\n */\nclass LogicalPosition {\n constructor(x, y) {\n this.type = 'Logical';\n this.x = x;\n this.y = y;\n }\n}\n/**\n * A position represented in physical pixels.\n *\n * @since 1.0.0\n */\nclass PhysicalPosition {\n constructor(x, y) {\n this.type = 'Physical';\n this.x = x;\n this.y = y;\n }\n /**\n * Converts the physical position to a logical one.\n * @example\n * ```typescript\n * import { appWindow } from '@tauri-apps/api/window';\n * const factor = await appWindow.scaleFactor();\n * const position = await appWindow.innerPosition();\n * const logical = position.toLogical(factor);\n * ```\n * */\n toLogical(scaleFactor) {\n return new LogicalPosition(this.x / scaleFactor, this.y / scaleFactor);\n }\n}\n/**\n * Attention type to request on a window.\n *\n * @since 1.0.0\n */\nvar UserAttentionType;\n(function (UserAttentionType) {\n /**\n * #### Platform-specific\n * - **macOS:** Bounces the dock icon until the application is in focus.\n * - **Windows:** Flashes both the window and the taskbar button until the application is in focus.\n */\n UserAttentionType[UserAttentionType[\"Critical\"] = 1] = \"Critical\";\n /**\n * #### Platform-specific\n * - **macOS:** Bounces the dock icon once.\n * - **Windows:** Flashes the taskbar button until the application is in focus.\n */\n UserAttentionType[UserAttentionType[\"Informational\"] = 2] = \"Informational\";\n})(UserAttentionType || (UserAttentionType = {}));\n/**\n * Get an instance of `WebviewWindow` for the current webview window.\n *\n * @since 1.0.0\n */\nfunction getCurrent() {\n return new WebviewWindow(window.__TAURI_METADATA__.__currentWindow.label, {\n // @ts-expect-error `skip` is not defined in the public API but it is handled by the constructor\n skip: true\n });\n}\n/**\n * Gets a list of instances of `WebviewWindow` for all available webview windows.\n *\n * @since 1.0.0\n */\nfunction getAll() {\n return window.__TAURI_METADATA__.__windows.map((w) => new WebviewWindow(w.label, {\n // @ts-expect-error `skip` is not defined in the public API but it is handled by the constructor\n skip: true\n }));\n}\n/** @ignore */\n// events that are emitted right here instead of by the created webview\nconst localTauriEvents = ['tauri://created', 'tauri://error'];\n/**\n * A webview window handle allows emitting and listening to events from the backend that are tied to the window.\n *\n * @ignore\n * @since 1.0.0\n */\nclass WebviewWindowHandle {\n constructor(label) {\n this.label = label;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n this.listeners = Object.create(null);\n }\n /**\n * Listen to an event emitted by the backend or webview.\n * The event must either be a global event or an event targetting this window.\n *\n * See {@link WebviewWindow.emit | `emit`} for more information.\n *\n * @example\n * ```typescript\n * import { appWindow } from '@tauri-apps/api/window';\n * const unlisten = await appWindow.listen('state-changed', (event) => {\n * console.log(`Got error: ${payload}`);\n * });\n *\n * // you need to call unlisten if your handler goes out of scope e.g. the component is unmounted\n * unlisten();\n * ```\n *\n * Note that removing the listener is required if your listener goes out of scope e.g. the component is unmounted.\n *\n * @param event Event name. Must include only alphanumeric characters, `-`, `/`, `:` and `_`.\n * @param handler Event handler.\n * @returns A promise resolving to a function to unlisten to the event.\n */\n async listen(event, handler) {\n if (this._handleTauriEvent(event, handler)) {\n return Promise.resolve(() => {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, security/detect-object-injection\n const listeners = this.listeners[event];\n listeners.splice(listeners.indexOf(handler), 1);\n });\n }\n return listen(event, this.label, handler);\n }\n /**\n * Listen to an one-off event.\n * See {@link WebviewWindow.listen | `listen`} for more information.\n *\n * @example\n * ```typescript\n * import { appWindow } from '@tauri-apps/api/window';\n * const unlisten = await appWindow.once('initialized', (event) => {\n * console.log(`Window initialized!`);\n * });\n *\n * // you need to call unlisten if your handler goes out of scope e.g. the component is unmounted\n * unlisten();\n * ```\n *\n * Note that removing the listener is required if your listener goes out of scope e.g. the component is unmounted.\n *\n * @param event Event name. Must include only alphanumeric characters, `-`, `/`, `:` and `_`.\n * @param handler Event handler.\n * @returns A promise resolving to a function to unlisten to the event.\n */\n async once(event, handler) {\n if (this._handleTauriEvent(event, handler)) {\n return Promise.resolve(() => {\n // eslint-disable-next-line security/detect-object-injection\n const listeners = this.listeners[event];\n listeners.splice(listeners.indexOf(handler), 1);\n });\n }\n return once(event, this.label, handler);\n }\n /**\n * Emits an event to the backend and all Tauri windows.\n * The event will have this window's {@link WebviewWindow.label | label} as {@link Event.windowLabel | source window label}.\n *\n * @example\n * ```typescript\n * import { appWindow } from '@tauri-apps/api/window';\n * await appWindow.emit('window-loaded', { loggedIn: true, token: 'authToken' });\n * ```\n *\n * This function can also be used to communicate between windows:\n * ```typescript\n * import { appWindow } from '@tauri-apps/api/window';\n * await appWindow.listen('sync-data', (event) => { });\n *\n * // on another window...\n * import { WebviewWindow } from '@tauri-apps/api/window';\n * const otherWindow = WebviewWindow.getByLabel('other')\n * await otherWindow.emit('sync-data');\n * ```\n *\n * Global listeners are also triggered:\n * ```typescript\n * import { appWindow } from '@tauri-apps/api/window';\n * import { listen } from '@tauri-apps/api/event';\n * await listen('ping', (event) => { });\n *\n * await appWindow.emit('ping');\n * ```\n *\n * @param event Event name. Must include only alphanumeric characters, `-`, `/`, `:` and `_`.\n * @param payload Event payload.\n */\n async emit(event, payload) {\n if (localTauriEvents.includes(event)) {\n // eslint-disable-next-line\n for (const handler of this.listeners[event] || []) {\n handler({ event, id: -1, windowLabel: this.label, payload });\n }\n return Promise.resolve();\n }\n return emit(event, this.label, payload);\n }\n /** @ignore */\n _handleTauriEvent(event, handler) {\n if (localTauriEvents.includes(event)) {\n if (!(event in this.listeners)) {\n // eslint-disable-next-line\n this.listeners[event] = [handler];\n }\n else {\n // eslint-disable-next-line\n this.listeners[event].push(handler);\n }\n return true;\n }\n return false;\n }\n}\n/**\n * Manage the current window object.\n *\n * @ignore\n * @since 1.0.0\n */\nclass WindowManager extends WebviewWindowHandle {\n // Getters\n /**\n * The scale factor that can be used to map physical pixels to logical pixels.\n * @example\n * ```typescript\n * import { appWindow } from '@tauri-apps/api/window';\n * const factor = await appWindow.scaleFactor();\n * ```\n *\n * @returns The window's monitor scale factor.\n * */\n async scaleFactor() {\n return invokeTauriCommand({\n __tauriModule: 'Window',\n message: {\n cmd: 'manage',\n data: {\n label: this.label,\n cmd: {\n type: 'scaleFactor'\n }\n }\n }\n });\n }\n /**\n * The position of the top-left hand corner of the window's client area relative to the top-left hand corner of the desktop.\n * @example\n * ```typescript\n * import { appWindow } from '@tauri-apps/api/window';\n * const position = await appWindow.innerPosition();\n * ```\n *\n * @returns The window's inner position.\n * */\n async innerPosition() {\n return invokeTauriCommand({\n __tauriModule: 'Window',\n message: {\n cmd: 'manage',\n data: {\n label: this.label,\n cmd: {\n type: 'innerPosition'\n }\n }\n }\n }).then(({ x, y }) => new PhysicalPosition(x, y));\n }\n /**\n * The position of the top-left hand corner of the window relative to the top-left hand corner of the desktop.\n * @example\n * ```typescript\n * import { appWindow } from '@tauri-apps/api/window';\n * const position = await appWindow.outerPosition();\n * ```\n *\n * @returns The window's outer position.\n * */\n async outerPosition() {\n return invokeTauriCommand({\n __tauriModule: 'Window',\n message: {\n cmd: 'manage',\n data: {\n label: this.label,\n cmd: {\n type: 'outerPosition'\n }\n }\n }\n }).then(({ x, y }) => new PhysicalPosition(x, y));\n }\n /**\n * The physical size of the window's client area.\n * The client area is the content of the window, excluding the title bar and borders.\n * @example\n * ```typescript\n * import { appWindow } from '@tauri-apps/api/window';\n * const size = await appWindow.innerSize();\n * ```\n *\n * @returns The window's inner size.\n */\n async innerSize() {\n return invokeTauriCommand({\n __tauriModule: 'Window',\n message: {\n cmd: 'manage',\n data: {\n label: this.label,\n cmd: {\n type: 'innerSize'\n }\n }\n }\n }).then(({ width, height }) => new PhysicalSize(width, height));\n }\n /**\n * The physical size of the entire window.\n * These dimensions include the title bar and borders. If you don't want that (and you usually don't), use inner_size instead.\n * @example\n * ```typescript\n * import { appWindow } from '@tauri-apps/api/window';\n * const size = await appWindow.outerSize();\n * ```\n *\n * @returns The window's outer size.\n */\n async outerSize() {\n return invokeTauriCommand({\n __tauriModule: 'Window',\n message: {\n cmd: 'manage',\n data: {\n label: this.label,\n cmd: {\n type: 'outerSize'\n }\n }\n }\n }).then(({ width, height }) => new PhysicalSize(width, height));\n }\n /**\n * Gets the window's current fullscreen state.\n * @example\n * ```typescript\n * import { appWindow } from '@tauri-apps/api/window';\n * const fullscreen = await appWindow.isFullscreen();\n * ```\n *\n * @returns Whether the window is in fullscreen mode or not.\n * */\n async isFullscreen() {\n return invokeTauriCommand({\n __tauriModule: 'Window',\n message: {\n cmd: 'manage',\n data: {\n label: this.label,\n cmd: {\n type: 'isFullscreen'\n }\n }\n }\n });\n }\n /**\n * Gets the window's current minimized state.\n * @example\n * ```typescript\n * import { appWindow } from '@tauri-apps/api/window';\n * const minimized = await appWindow.isMinimized();\n * ```\n *\n * @since 1.3.0\n * */\n async isMinimized() {\n return invokeTauriCommand({\n __tauriModule: 'Window',\n message: {\n cmd: 'manage',\n data: {\n label: this.label,\n cmd: {\n type: 'isMinimized'\n }\n }\n }\n });\n }\n /**\n * Gets the window's current maximized state.\n * @example\n * ```typescript\n * import { appWindow } from '@tauri-apps/api/window';\n * const maximized = await appWindow.isMaximized();\n * ```\n *\n * @returns Whether the window is maximized or not.\n * */\n async isMaximized() {\n return invokeTauriCommand({\n __tauriModule: 'Window',\n message: {\n cmd: 'manage',\n data: {\n label: this.label,\n cmd: {\n type: 'isMaximized'\n }\n }\n }\n });\n }\n /**\n * Gets the window's current focus state.\n * @example\n * ```typescript\n * import { appWindow } from '@tauri-apps/api/window';\n * const focused = await appWindow.isFocused();\n * ```\n *\n * @returns Whether the window is focused or not.\n *\n * @since 1.4\n * */\n async isFocused() {\n return invokeTauriCommand({\n __tauriModule: 'Window',\n message: {\n cmd: 'manage',\n data: {\n label: this.label,\n cmd: {\n type: 'isFocused'\n }\n }\n }\n });\n }\n /**\n * Gets the window's current decorated state.\n * @example\n * ```typescript\n * import { appWindow } from '@tauri-apps/api/window';\n * const decorated = await appWindow.isDecorated();\n * ```\n *\n * @returns Whether the window is decorated or not.\n * */\n async isDecorated() {\n return invokeTauriCommand({\n __tauriModule: 'Window',\n message: {\n cmd: 'manage',\n data: {\n label: this.label,\n cmd: {\n type: 'isDecorated'\n }\n }\n }\n });\n }\n /**\n * Gets the window's current resizable state.\n * @example\n * ```typescript\n * import { appWindow } from '@tauri-apps/api/window';\n * const resizable = await appWindow.isResizable();\n * ```\n *\n * @returns Whether the window is resizable or not.\n * */\n async isResizable() {\n return invokeTauriCommand({\n __tauriModule: 'Window',\n message: {\n cmd: 'manage',\n data: {\n label: this.label,\n cmd: {\n type: 'isResizable'\n }\n }\n }\n });\n }\n /**\n * Gets the window\u2019s native maximize button state.\n *\n * #### Platform-specific\n *\n * - **Linux / iOS / Android:** Unsupported.\n *\n * @example\n * ```typescript\n * import { appWindow } from '@tauri-apps/api/window';\n * const maximizable = await appWindow.isMaximizable();\n * ```\n *\n * @returns Whether the window's native maximize button is enabled or not.\n * */\n async isMaximizable() {\n return invokeTauriCommand({\n __tauriModule: 'Window',\n message: {\n cmd: 'manage',\n data: {\n label: this.label,\n cmd: {\n type: 'isMaximizable'\n }\n }\n }\n });\n }\n /**\n * Gets the window\u2019s native minimize button state.\n *\n * #### Platform-specific\n *\n * - **Linux / iOS / Android:** Unsupported.\n *\n * @example\n * ```typescript\n * import { appWindow } from '@tauri-apps/api/window';\n * const minimizable = await appWindow.isMinimizable();\n * ```\n *\n * @returns Whether the window's native minimize button is enabled or not.\n * */\n async isMinimizable() {\n return invokeTauriCommand({\n __tauriModule: 'Window',\n message: {\n cmd: 'manage',\n data: {\n label: this.label,\n cmd: {\n type: 'isMinimizable'\n }\n }\n }\n });\n }\n /**\n * Gets the window\u2019s native close button state.\n *\n * #### Platform-specific\n *\n * - **Linux / iOS / Android:** Unsupported.\n *\n * @example\n * ```typescript\n * import { appWindow } from '@tauri-apps/api/window';\n * const closable = await appWindow.isClosable();\n * ```\n *\n * @returns Whether the window's native close button is enabled or not.\n * */\n async isClosable() {\n return invokeTauriCommand({\n __tauriModule: 'Window',\n message: {\n cmd: 'manage',\n data: {\n label: this.label,\n cmd: {\n type: 'isClosable'\n }\n }\n }\n });\n }\n /**\n * Gets the window's current visible state.\n * @example\n * ```typescript\n * import { appWindow } from '@tauri-apps/api/window';\n * const visible = await appWindow.isVisible();\n * ```\n *\n * @returns Whether the window is visible or not.\n * */\n async isVisible() {\n return invokeTauriCommand({\n __tauriModule: 'Window',\n message: {\n cmd: 'manage',\n data: {\n label: this.label,\n cmd: {\n type: 'isVisible'\n }\n }\n }\n });\n }\n /**\n * Gets the window's current title.\n * @example\n * ```typescript\n * import { appWindow } from '@tauri-apps/api/window';\n * const title = await appWindow.title();\n * ```\n *\n * @since 1.3.0\n * */\n async title() {\n return invokeTauriCommand({\n __tauriModule: 'Window',\n message: {\n cmd: 'manage',\n data: {\n label: this.label,\n cmd: {\n type: 'title'\n }\n }\n }\n });\n }\n /**\n * Gets the window's current theme.\n *\n * #### Platform-specific\n *\n * - **macOS:** Theme was introduced on macOS 10.14. Returns `light` on macOS 10.13 and below.\n *\n * @example\n * ```typescript\n * import { appWindow } from '@tauri-apps/api/window';\n * const theme = await appWindow.theme();\n * ```\n *\n * @returns The window theme.\n * */\n async theme() {\n return invokeTauriCommand({\n __tauriModule: 'Window',\n message: {\n cmd: 'manage',\n data: {\n label: this.label,\n cmd: {\n type: 'theme'\n }\n }\n }\n });\n }\n // Setters\n /**\n * Centers the window.\n * @example\n * ```typescript\n * import { appWindow } from '@tauri-apps/api/window';\n * await appWindow.center();\n * ```\n *\n * @returns A promise indicating the success or failure of the operation.\n */\n async center() {\n return invokeTauriCommand({\n __tauriModule: 'Window',\n message: {\n cmd: 'manage',\n data: {\n label: this.label,\n cmd: {\n type: 'center'\n }\n }\n }\n });\n }\n /**\n * Requests user attention to the window, this has no effect if the application\n * is already focused. How requesting for user attention manifests is platform dependent,\n * see `UserAttentionType` for details.\n *\n * Providing `null` will unset the request for user attention. Unsetting the request for\n * user attention might not be done automatically by the WM when the window receives input.\n *\n * #### Platform-specific\n *\n * - **macOS:** `null` has no effect.\n * - **Linux:** Urgency levels have the same effect.\n * @example\n * ```typescript\n * import { appWindow } from '@tauri-apps/api/window';\n * await appWindow.requestUserAttention();\n * ```\n *\n * @param requestType\n * @returns A promise indicating the success or failure of the operation.\n */\n async requestUserAttention(requestType) {\n let requestType_ = null;\n if (requestType) {\n if (requestType === UserAttentionType.Critical) {\n requestType_ = { type: 'Critical' };\n }\n else {\n requestType_ = { type: 'Informational' };\n }\n }\n return invokeTauriCommand({\n __tauriModule: 'Window',\n message: {\n cmd: 'manage',\n data: {\n label: this.label,\n cmd: {\n type: 'requestUserAttention',\n payload: requestType_\n }\n }\n }\n });\n }\n /**\n * Updates the window resizable flag.\n * @example\n * ```typescript\n * import { appWindow } from '@tauri-apps/api/window';\n * await appWindow.setResizable(false);\n * ```\n *\n * @param resizable\n * @returns A promise indicating the success or failure of the operation.\n */\n async setResizable(resizable) {\n return invokeTauriCommand({\n __tauriModule: 'Window',\n message: {\n cmd: 'manage',\n data: {\n label: this.label,\n cmd: {\n type: 'setResizable',\n payload: resizable\n }\n }\n }\n });\n }\n /**\n * Sets whether the window's native maximize button is enabled or not.\n * If resizable is set to false, this setting is ignored.\n *\n * #### Platform-specific\n *\n * - **macOS:** Disables the \"zoom\" button in the window titlebar, which is also used to enter fullscreen mode.\n * - **Linux / iOS / Android:** Unsupported.\n *\n * @example\n * ```typescript\n * import { appWindow } from '@tauri-apps/api/window';\n * await appWindow.setMaximizable(false);\n * ```\n *\n * @param maximizable\n * @returns A promise indicating the success or failure of the operation.\n */\n async setMaximizable(maximizable) {\n return invokeTauriCommand({\n __tauriModule: 'Window',\n message: {\n cmd: 'manage',\n data: {\n label: this.label,\n cmd: {\n type: 'setMaximizable',\n payload: maximizable\n }\n }\n }\n });\n }\n /**\n * Sets whether the window's native minimize button is enabled or not.\n *\n * #### Platform-specific\n *\n * - **Linux / iOS / Android:** Unsupported.\n *\n * @example\n * ```typescript\n * import { appWindow } from '@tauri-apps/api/window';\n * await appWindow.setMinimizable(false);\n * ```\n *\n * @param minimizable\n * @returns A promise indicating the success or failure of the operation.\n */\n async setMinimizable(minimizable) {\n return invokeTauriCommand({\n __tauriModule: 'Window',\n message: {\n cmd: 'manage',\n data: {\n label: this.label,\n cmd: {\n type: 'setMinimizable',\n payload: minimizable\n }\n }\n }\n });\n }\n /**\n * Sets whether the window's native close button is enabled or not.\n *\n * #### Platform-specific\n *\n * - **Linux:** GTK+ will do its best to convince the window manager not to show a close button. Depending on the system, this function may not have any effect when called on a window that is already visible\n * - **iOS / Android:** Unsupported.\n *\n * @example\n * ```typescript\n * import { appWindow } from '@tauri-apps/api/window';\n * await appWindow.setClosable(false);\n * ```\n *\n * @param closable\n * @returns A promise indicating the success or failure of the operation.\n */\n async setClosable(closable) {\n return invokeTauriCommand({\n __tauriModule: 'Window',\n message: {\n cmd: 'manage',\n data: {\n label: this.label,\n cmd: {\n type: 'setClosable',\n payload: closable\n }\n }\n }\n });\n }\n /**\n * Sets the window title.\n * @example\n * ```typescript\n * import { appWindow } from '@tauri-apps/api/window';\n * await appWindow.setTitle('Tauri');\n * ```\n *\n * @param title The new title\n * @returns A promise indicating the success or failure of the operation.\n */\n async setTitle(title) {\n return invokeTauriCommand({\n __tauriModule: 'Window',\n message: {\n cmd: 'manage',\n data: {\n label: this.label,\n cmd: {\n type: 'setTitle',\n payload: title\n }\n }\n }\n });\n }\n /**\n * Maximizes the window.\n * @example\n * ```typescript\n * import { appWindow } from '@tauri-apps/api/window';\n * await appWindow.maximize();\n * ```\n *\n * @returns A promise indicating the success or failure of the operation.\n */\n async maximize() {\n return invokeTauriCommand({\n __tauriModule: 'Window',\n message: {\n cmd: 'manage',\n data: {\n label: this.label,\n cmd: {\n type: 'maximize'\n }\n }\n }\n });\n }\n /**\n * Unmaximizes the window.\n * @example\n * ```typescript\n * import { appWindow } from '@tauri-apps/api/window';\n * await appWindow.unmaximize();\n * ```\n *\n * @returns A promise indicating the success or failure of the operation.\n */\n async unmaximize() {\n return invokeTauriCommand({\n __tauriModule: 'Window',\n message: {\n cmd: 'manage',\n data: {\n label: this.label,\n cmd: {\n type: 'unmaximize'\n }\n }\n }\n });\n }\n /**\n * Toggles the window maximized state.\n * @example\n * ```typescript\n * import { appWindow } from '@tauri-apps/api/window';\n * await appWindow.toggleMaximize();\n * ```\n *\n * @returns A promise indicating the success or failure of the operation.\n */\n async toggleMaximize() {\n return invokeTauriCommand({\n __tauriModule: 'Window',\n message: {\n cmd: 'manage',\n data: {\n label: this.label,\n cmd: {\n type: 'toggleMaximize'\n }\n }\n }\n });\n }\n /**\n * Minimizes the window.\n * @example\n * ```typescript\n * import { appWindow } from '@tauri-apps/api/window';\n * await appWindow.minimize();\n * ```\n *\n * @returns A promise indicating the success or failure of the operation.\n */\n async minimize() {\n return invokeTauriCommand({\n __tauriModule: 'Window',\n message: {\n cmd: 'manage',\n data: {\n label: this.label,\n cmd: {\n type: 'minimize'\n }\n }\n }\n });\n }\n /**\n * Unminimizes the window.\n * @example\n * ```typescript\n * import { appWindow } from '@tauri-apps/api/window';\n * await appWindow.unminimize();\n * ```\n *\n * @returns A promise indicating the success or failure of the operation.\n */\n async unminimize() {\n return invokeTauriCommand({\n __tauriModule: 'Window',\n message: {\n cmd: 'manage',\n data: {\n label: this.label,\n cmd: {\n type: 'unminimize'\n }\n }\n }\n });\n }\n /**\n * Sets the window visibility to true.\n * @example\n * ```typescript\n * import { appWindow } from '@tauri-apps/api/window';\n * await appWindow.show();\n * ```\n *\n * @returns A promise indicating the success or failure of the operation.\n */\n async show() {\n return invokeTauriCommand({\n __tauriModule: 'Window',\n message: {\n cmd: 'manage',\n data: {\n label: this.label,\n cmd: {\n type: 'show'\n }\n }\n }\n });\n }\n /**\n * Sets the window visibility to false.\n * @example\n * ```typescript\n * import { appWindow } from '@tauri-apps/api/window';\n * await appWindow.hide();\n * ```\n *\n * @returns A promise indicating the success or failure of the operation.\n */\n async hide() {\n return invokeTauriCommand({\n __tauriModule: 'Window',\n message: {\n cmd: 'manage',\n data: {\n label: this.label,\n cmd: {\n type: 'hide'\n }\n }\n }\n });\n }\n /**\n * Closes the window.\n * @example\n * ```typescript\n * import { appWindow } from '@tauri-apps/api/window';\n * await appWindow.close();\n * ```\n *\n * @returns A promise indicating the success or failure of the operation.\n */\n async close() {\n return invokeTauriCommand({\n __tauriModule: 'Window',\n message: {\n cmd: 'manage',\n data: {\n label: this.label,\n cmd: {\n type: 'close'\n }\n }\n }\n });\n }\n /**\n * Whether the window should have borders and bars.\n * @example\n * ```typescript\n * import { appWindow } from '@tauri-apps/api/window';\n * await appWindow.setDecorations(false);\n * ```\n *\n * @param decorations Whether the window should have borders and bars.\n * @returns A promise indicating the success or failure of the operation.\n */\n async setDecorations(decorations) {\n return invokeTauriCommand({\n __tauriModule: 'Window',\n message: {\n cmd: 'manage',\n data: {\n label: this.label,\n cmd: {\n type: 'setDecorations',\n payload: decorations\n }\n }\n }\n });\n }\n /**\n * Whether the window should always be on top of other windows.\n * @example\n * ```typescript\n * import { appWindow } from '@tauri-apps/api/window';\n * await appWindow.setAlwaysOnTop(true);\n * ```\n *\n * @param alwaysOnTop Whether the window should always be on top of other windows or not.\n * @returns A promise indicating the success or failure of the operation.\n */\n async setAlwaysOnTop(alwaysOnTop) {\n return invokeTauriCommand({\n __tauriModule: 'Window',\n message: {\n cmd: 'manage',\n data: {\n label: this.label,\n cmd: {\n type: 'setAlwaysOnTop',\n payload: alwaysOnTop\n }\n }\n }\n });\n }\n /**\n * Prevents the window contents from being captured by other apps.\n * @example\n * ```typescript\n * import { appWindow } from '@tauri-apps/api/window';\n * await appWindow.setContentProtected(true);\n * ```\n *\n * @returns A promise indicating the success or failure of the operation.\n *\n * @since 1.2.0\n */\n async setContentProtected(protected_) {\n return invokeTauriCommand({\n __tauriModule: 'Window',\n message: {\n cmd: 'manage',\n data: {\n label: this.label,\n cmd: {\n type: 'setContentProtected',\n payload: protected_\n }\n }\n }\n });\n }\n /**\n * Resizes the window with a new inner size.\n * @example\n * ```typescript\n * import { appWindow, LogicalSize } from '@tauri-apps/api/window';\n * await appWindow.setSize(new LogicalSize(600, 500));\n * ```\n *\n * @param size The logical or physical inner size.\n * @returns A promise indicating the success or failure of the operation.\n */\n async setSize(size) {\n if (!size || (size.type !== 'Logical' && size.type !== 'Physical')) {\n throw new Error('the `size` argument must be either a LogicalSize or a PhysicalSize instance');\n }\n return invokeTauriCommand({\n __tauriModule: 'Window',\n message: {\n cmd: 'manage',\n data: {\n label: this.label,\n cmd: {\n type: 'setSize',\n payload: {\n type: size.type,\n data: {\n width: size.width,\n height: size.height\n }\n }\n }\n }\n }\n });\n }\n /**\n * Sets the window minimum inner size. If the `size` argument is not provided, the constraint is unset.\n * @example\n * ```typescript\n * import { appWindow, PhysicalSize } from '@tauri-apps/api/window';\n * await appWindow.setMinSize(new PhysicalSize(600, 500));\n * ```\n *\n * @param size The logical or physical inner size, or `null` to unset the constraint.\n * @returns A promise indicating the success or failure of the operation.\n */\n async setMinSize(size) {\n if (size && size.type !== 'Logical' && size.type !== 'Physical') {\n throw new Error('the `size` argument must be either a LogicalSize or a PhysicalSize instance');\n }\n return invokeTauriCommand({\n __tauriModule: 'Window',\n message: {\n cmd: 'manage',\n data: {\n label: this.label,\n cmd: {\n type: 'setMinSize',\n payload: size\n ? {\n type: size.type,\n data: {\n width: size.width,\n height: size.height\n }\n }\n : null\n }\n }\n }\n });\n }\n /**\n * Sets the window maximum inner size. If the `size` argument is undefined, the constraint is unset.\n * @example\n * ```typescript\n * import { appWindow, LogicalSize } from '@tauri-apps/api/window';\n * await appWindow.setMaxSize(new LogicalSize(600, 500));\n * ```\n *\n * @param size The logical or physical inner size, or `null` to unset the constraint.\n * @returns A promise indicating the success or failure of the operation.\n */\n async setMaxSize(size) {\n if (size && size.type !== 'Logical' && size.type !== 'Physical') {\n throw new Error('the `size` argument must be either a LogicalSize or a PhysicalSize instance');\n }\n return invokeTauriCommand({\n __tauriModule: 'Window',\n message: {\n cmd: 'manage',\n data: {\n label: this.label,\n cmd: {\n type: 'setMaxSize',\n payload: size\n ? {\n type: size.type,\n data: {\n width: size.width,\n height: size.height\n }\n }\n : null\n }\n }\n }\n });\n }\n /**\n * Sets the window outer position.\n * @example\n * ```typescript\n * import { appWindow, LogicalPosition } from '@tauri-apps/api/window';\n * await appWindow.setPosition(new LogicalPosition(600, 500));\n * ```\n *\n * @param position The new position, in logical or physical pixels.\n * @returns A promise indicating the success or failure of the operation.\n */\n async setPosition(position) {\n if (!position ||\n (position.type !== 'Logical' && position.type !== 'Physical')) {\n throw new Error('the `position` argument must be either a LogicalPosition or a PhysicalPosition instance');\n }\n return invokeTauriCommand({\n __tauriModule: 'Window',\n message: {\n cmd: 'manage',\n data: {\n label: this.label,\n cmd: {\n type: 'setPosition',\n payload: {\n type: position.type,\n data: {\n x: position.x,\n y: position.y\n }\n }\n }\n }\n }\n });\n }\n /**\n * Sets the window fullscreen state.\n * @example\n * ```typescript\n * import { appWindow } from '@tauri-apps/api/window';\n * await appWindow.setFullscreen(true);\n * ```\n *\n * @param fullscreen Whether the window should go to fullscreen or not.\n * @returns A promise indicating the success or failure of the operation.\n */\n async setFullscreen(fullscreen) {\n return invokeTauriCommand({\n __tauriModule: 'Window',\n message: {\n cmd: 'manage',\n data: {\n label: this.label,\n cmd: {\n type: 'setFullscreen',\n payload: fullscreen\n }\n }\n }\n });\n }\n /**\n * Bring the window to front and focus.\n * @example\n * ```typescript\n * import { appWindow } from '@tauri-apps/api/window';\n * await appWindow.setFocus();\n * ```\n *\n * @returns A promise indicating the success or failure of the operation.\n */\n async setFocus() {\n return invokeTauriCommand({\n __tauriModule: 'Window',\n message: {\n cmd: 'manage',\n data: {\n label: this.label,\n cmd: {\n type: 'setFocus'\n }\n }\n }\n });\n }\n /**\n * Sets the window icon.\n * @example\n * ```typescript\n * import { appWindow } from '@tauri-apps/api/window';\n * await appWindow.setIcon('/tauri/awesome.png');\n * ```\n *\n * Note that you need the `icon-ico` or `icon-png` Cargo features to use this API.\n * To enable it, change your Cargo.toml file:\n * ```toml\n * [dependencies]\n * tauri = { version = \"...\", features = [\"...\", \"icon-png\"] }\n * ```\n *\n * @param icon Icon bytes or path to the icon file.\n * @returns A promise indicating the success or failure of the operation.\n */\n async setIcon(icon) {\n return invokeTauriCommand({\n __tauriModule: 'Window',\n message: {\n cmd: 'manage',\n data: {\n label: this.label,\n cmd: {\n type: 'setIcon',\n payload: {\n // correctly serialize Uint8Arrays\n icon: typeof icon === 'string' ? icon : Array.from(icon)\n }\n }\n }\n }\n });\n }\n /**\n * Whether the window icon should be hidden from the taskbar or not.\n *\n * #### Platform-specific\n *\n * - **macOS:** Unsupported.\n * @example\n * ```typescript\n * import { appWindow } from '@tauri-apps/api/window';\n * await appWindow.setSkipTaskbar(true);\n * ```\n *\n * @param skip true to hide window icon, false to show it.\n * @returns A promise indicating the success or failure of the operation.\n */\n async setSkipTaskbar(skip) {\n return invokeTauriCommand({\n __tauriModule: 'Window',\n message: {\n cmd: 'manage',\n data: {\n label: this.label,\n cmd: {\n type: 'setSkipTaskbar',\n payload: skip\n }\n }\n }\n });\n }\n /**\n * Grabs the cursor, preventing it from leaving the window.\n *\n * There's no guarantee that the cursor will be hidden. You should\n * hide it by yourself if you want so.\n *\n * #### Platform-specific\n *\n * - **Linux:** Unsupported.\n * - **macOS:** This locks the cursor in a fixed location, which looks visually awkward.\n * @example\n * ```typescript\n * import { appWindow } from '@tauri-apps/api/window';\n * await appWindow.setCursorGrab(true);\n * ```\n *\n * @param grab `true` to grab the cursor icon, `false` to release it.\n * @returns A promise indicating the success or failure of the operation.\n */\n async setCursorGrab(grab) {\n return invokeTauriCommand({\n __tauriModule: 'Window',\n message: {\n cmd: 'manage',\n data: {\n label: this.label,\n cmd: {\n type: 'setCursorGrab',\n payload: grab\n }\n }\n }\n });\n }\n /**\n * Modifies the cursor's visibility.\n *\n * #### Platform-specific\n *\n * - **Windows:** The cursor is only hidden within the confines of the window.\n * - **macOS:** The cursor is hidden as long as the window has input focus, even if the cursor is\n * outside of the window.\n * @example\n * ```typescript\n * import { appWindow } from '@tauri-apps/api/window';\n * await appWindow.setCursorVisible(false);\n * ```\n *\n * @param visible If `false`, this will hide the cursor. If `true`, this will show the cursor.\n * @returns A promise indicating the success or failure of the operation.\n */\n async setCursorVisible(visible) {\n return invokeTauriCommand({\n __tauriModule: 'Window',\n message: {\n cmd: 'manage',\n data: {\n label: this.label,\n cmd: {\n type: 'setCursorVisible',\n payload: visible\n }\n }\n }\n });\n }\n /**\n * Modifies the cursor icon of the window.\n * @example\n * ```typescript\n * import { appWindow } from '@tauri-apps/api/window';\n * await appWindow.setCursorIcon('help');\n * ```\n *\n * @param icon The new cursor icon.\n * @returns A promise indicating the success or failure of the operation.\n */\n async setCursorIcon(icon) {\n return invokeTauriCommand({\n __tauriModule: 'Window',\n message: {\n cmd: 'manage',\n data: {\n label: this.label,\n cmd: {\n type: 'setCursorIcon',\n payload: icon\n }\n }\n }\n });\n }\n /**\n * Changes the position of the cursor in window coordinates.\n * @example\n * ```typescript\n * import { appWindow, LogicalPosition } from '@tauri-apps/api/window';\n * await appWindow.setCursorPosition(new LogicalPosition(600, 300));\n * ```\n *\n * @param position The new cursor position.\n * @returns A promise indicating the success or failure of the operation.\n */\n async setCursorPosition(position) {\n if (!position ||\n (position.type !== 'Logical' && position.type !== 'Physical')) {\n throw new Error('the `position` argument must be either a LogicalPosition or a PhysicalPosition instance');\n }\n return invokeTauriCommand({\n __tauriModule: 'Window',\n message: {\n cmd: 'manage',\n data: {\n label: this.label,\n cmd: {\n type: 'setCursorPosition',\n payload: {\n type: position.type,\n data: {\n x: position.x,\n y: position.y\n }\n }\n }\n }\n }\n });\n }\n /**\n * Changes the cursor events behavior.\n *\n * @example\n * ```typescript\n * import { appWindow } from '@tauri-apps/api/window';\n * await appWindow.setIgnoreCursorEvents(true);\n * ```\n *\n * @param ignore `true` to ignore the cursor events; `false` to process them as usual.\n * @returns A promise indicating the success or failure of the operation.\n */\n async setIgnoreCursorEvents(ignore) {\n return invokeTauriCommand({\n __tauriModule: 'Window',\n message: {\n cmd: 'manage',\n data: {\n label: this.label,\n cmd: {\n type: 'setIgnoreCursorEvents',\n payload: ignore\n }\n }\n }\n });\n }\n /**\n * Starts dragging the window.\n * @example\n * ```typescript\n * import { appWindow } from '@tauri-apps/api/window';\n * await appWindow.startDragging();\n * ```\n *\n * @return A promise indicating the success or failure of the operation.\n */\n async startDragging() {\n return invokeTauriCommand({\n __tauriModule: 'Window',\n message: {\n cmd: 'manage',\n data: {\n label: this.label,\n cmd: {\n type: 'startDragging'\n }\n }\n }\n });\n }\n // Listeners\n /**\n * Listen to window resize.\n *\n * @example\n * ```typescript\n * import { appWindow } from \"@tauri-apps/api/window\";\n * const unlisten = await appWindow.onResized(({ payload: size }) => {\n * console.log('Window resized', size);\n * });\n *\n * // you need to call unlisten if your handler goes out of scope e.g. the component is unmounted\n * unlisten();\n * ```\n *\n * @returns A promise resolving to a function to unlisten to the event.\n * Note that removing the listener is required if your listener goes out of scope e.g. the component is unmounted.\n *\n * @since 1.0.2\n */\n async onResized(handler) {\n return this.listen(TauriEvent.WINDOW_RESIZED, (e) => {\n e.payload = mapPhysicalSize(e.payload);\n handler(e);\n });\n }\n /**\n * Listen to window move.\n *\n * @example\n * ```typescript\n * import { appWindow } from \"@tauri-apps/api/window\";\n * const unlisten = await appWindow.onMoved(({ payload: position }) => {\n * console.log('Window moved', position);\n * });\n *\n * // you need to call unlisten if your handler goes out of scope e.g. the component is unmounted\n * unlisten();\n * ```\n *\n * @returns A promise resolving to a function to unlisten to the event.\n * Note that removing the listener is required if your listener goes out of scope e.g. the component is unmounted.\n *\n * @since 1.0.2\n */\n async onMoved(handler) {\n return this.listen(TauriEvent.WINDOW_MOVED, (e) => {\n e.payload = mapPhysicalPosition(e.payload);\n handler(e);\n });\n }\n /**\n * Listen to window close requested. Emitted when the user requests to closes the window.\n *\n * @example\n * ```typescript\n * import { appWindow } from \"@tauri-apps/api/window\";\n * import { confirm } from '@tauri-apps/api/dialog';\n * const unlisten = await appWindow.onCloseRequested(async (event) => {\n * const confirmed = await confirm('Are you sure?');\n * if (!confirmed) {\n * // user did not confirm closing the window; let's prevent it\n * event.preventDefault();\n * }\n * });\n *\n * // you need to call unlisten if your handler goes out of scope e.g. the component is unmounted\n * unlisten();\n * ```\n *\n * @returns A promise resolving to a function to unlisten to the event.\n * Note that removing the listener is required if your listener goes out of scope e.g. the component is unmounted.\n *\n * @since 1.0.2\n */\n /* eslint-disable @typescript-eslint/promise-function-async */\n async onCloseRequested(handler) {\n return this.listen(TauriEvent.WINDOW_CLOSE_REQUESTED, (event) => {\n const evt = new CloseRequestedEvent(event);\n void Promise.resolve(handler(evt)).then(() => {\n if (!evt.isPreventDefault()) {\n return this.close();\n }\n });\n });\n }\n /* eslint-enable */\n /**\n * Listen to window focus change.\n *\n * @example\n * ```typescript\n * import { appWindow } from \"@tauri-apps/api/window\";\n * const unlisten = await appWindow.onFocusChanged(({ payload: focused }) => {\n * console.log('Focus changed, window is focused? ' + focused);\n * });\n *\n * // you need to call unlisten if your handler goes out of scope e.g. the component is unmounted\n * unlisten();\n * ```\n *\n * @returns A promise resolving to a function to unlisten to the event.\n * Note that removing the listener is required if your listener goes out of scope e.g. the component is unmounted.\n *\n * @since 1.0.2\n */\n async onFocusChanged(handler) {\n const unlistenFocus = await this.listen(TauriEvent.WINDOW_FOCUS, (event) => {\n handler({ ...event, payload: true });\n });\n const unlistenBlur = await this.listen(TauriEvent.WINDOW_BLUR, (event) => {\n handler({ ...event, payload: false });\n });\n return () => {\n unlistenFocus();\n unlistenBlur();\n };\n }\n /**\n * Listen to window scale change. Emitted when the window's scale factor has changed.\n * The following user actions can cause DPI changes:\n * - Changing the display's resolution.\n * - Changing the display's scale factor (e.g. in Control Panel on Windows).\n * - Moving the window to a display with a different scale factor.\n *\n * @example\n * ```typescript\n * import { appWindow } from \"@tauri-apps/api/window\";\n * const unlisten = await appWindow.onScaleChanged(({ payload }) => {\n * console.log('Scale changed', payload.scaleFactor, payload.size);\n * });\n *\n * // you need to call unlisten if your handler goes out of scope e.g. the component is unmounted\n * unlisten();\n * ```\n *\n * @returns A promise resolving to a function to unlisten to the event.\n * Note that removing the listener is required if your listener goes out of scope e.g. the component is unmounted.\n *\n * @since 1.0.2\n */\n async onScaleChanged(handler) {\n return this.listen(TauriEvent.WINDOW_SCALE_FACTOR_CHANGED, handler);\n }\n /**\n * Listen to the window menu item click. The payload is the item id.\n *\n * @example\n * ```typescript\n * import { appWindow } from \"@tauri-apps/api/window\";\n * const unlisten = await appWindow.onMenuClicked(({ payload: menuId }) => {\n * console.log('Menu clicked: ' + menuId);\n * });\n *\n * // you need to call unlisten if your handler goes out of scope e.g. the component is unmounted\n * unlisten();\n * ```\n *\n * @returns A promise resolving to a function to unlisten to the event.\n * Note that removing the listener is required if your listener goes out of scope e.g. the component is unmounted.\n *\n * @since 1.0.2\n */\n async onMenuClicked(handler) {\n return this.listen(TauriEvent.MENU, handler);\n }\n /**\n * Listen to a file drop event.\n * The listener is triggered when the user hovers the selected files on the window,\n * drops the files or cancels the operation.\n *\n * @example\n * ```typescript\n * import { appWindow } from \"@tauri-apps/api/window\";\n * const unlisten = await appWindow.onFileDropEvent((event) => {\n * if (event.payload.type === 'hover') {\n * console.log('User hovering', event.payload.paths);\n * } else if (event.payload.type === 'drop') {\n * console.log('User dropped', event.payload.paths);\n * } else {\n * console.log('File drop cancelled');\n * }\n * });\n *\n * // you need to call unlisten if your handler goes out of scope e.g. the component is unmounted\n * unlisten();\n * ```\n *\n * @returns A promise resolving to a function to unlisten to the event.\n * Note that removing the listener is required if your listener goes out of scope e.g. the component is unmounted.\n *\n * @since 1.0.2\n */\n async onFileDropEvent(handler) {\n const unlistenFileDrop = await this.listen(TauriEvent.WINDOW_FILE_DROP, (event) => {\n handler({ ...event, payload: { type: 'drop', paths: event.payload } });\n });\n const unlistenFileHover = await this.listen(TauriEvent.WINDOW_FILE_DROP_HOVER, (event) => {\n handler({ ...event, payload: { type: 'hover', paths: event.payload } });\n });\n const unlistenCancel = await this.listen(TauriEvent.WINDOW_FILE_DROP_CANCELLED, (event) => {\n handler({ ...event, payload: { type: 'cancel' } });\n });\n return () => {\n unlistenFileDrop();\n unlistenFileHover();\n unlistenCancel();\n };\n }\n /**\n * Listen to the system theme change.\n *\n * @example\n * ```typescript\n * import { appWindow } from \"@tauri-apps/api/window\";\n * const unlisten = await appWindow.onThemeChanged(({ payload: theme }) => {\n * console.log('New theme: ' + theme);\n * });\n *\n * // you need to call unlisten if your handler goes out of scope e.g. the component is unmounted\n * unlisten();\n * ```\n *\n * @returns A promise resolving to a function to unlisten to the event.\n * Note that removing the listener is required if your listener goes out of scope e.g. the component is unmounted.\n *\n * @since 1.0.2\n */\n async onThemeChanged(handler) {\n return this.listen(TauriEvent.WINDOW_THEME_CHANGED, handler);\n }\n}\n/**\n * @since 1.0.2\n */\nclass CloseRequestedEvent {\n constructor(event) {\n this._preventDefault = false;\n this.event = event.event;\n this.windowLabel = event.windowLabel;\n this.id = event.id;\n }\n preventDefault() {\n this._preventDefault = true;\n }\n isPreventDefault() {\n return this._preventDefault;\n }\n}\n/**\n * Create new webview windows and get a handle to existing ones.\n *\n * Windows are identified by a *label* a unique identifier that can be used to reference it later.\n * It may only contain alphanumeric characters `a-zA-Z` plus the following special characters `-`, `/`, `:` and `_`.\n *\n * @example\n * ```typescript\n * // loading embedded asset:\n * const webview = new WebviewWindow('theUniqueLabel', {\n * url: 'path/to/page.html'\n * });\n * // alternatively, load a remote URL:\n * const webview = new WebviewWindow('theUniqueLabel', {\n * url: 'https://github.com/tauri-apps/tauri'\n * });\n *\n * webview.once('tauri://created', function () {\n * // webview window successfully created\n * });\n * webview.once('tauri://error', function (e) {\n * // an error happened creating the webview window\n * });\n *\n * // emit an event to the backend\n * await webview.emit(\"some event\", \"data\");\n * // listen to an event from the backend\n * const unlisten = await webview.listen(\"event name\", e => {});\n * unlisten();\n * ```\n *\n * @since 1.0.2\n */\nclass WebviewWindow extends WindowManager {\n /**\n * Creates a new WebviewWindow.\n * @example\n * ```typescript\n * import { WebviewWindow } from '@tauri-apps/api/window';\n * const webview = new WebviewWindow('my-label', {\n * url: 'https://github.com/tauri-apps/tauri'\n * });\n * webview.once('tauri://created', function () {\n * // webview window successfully created\n * });\n * webview.once('tauri://error', function (e) {\n * // an error happened creating the webview window\n * });\n * ```\n *\n * * @param label The unique webview window label. Must be alphanumeric: `a-zA-Z-/:_`.\n * @returns The WebviewWindow instance to communicate with the webview.\n */\n constructor(label, options = {}) {\n super(label);\n // @ts-expect-error `skip` is not a public API so it is not defined in WindowOptions\n if (!(options === null || options === void 0 ? void 0 : options.skip)) {\n invokeTauriCommand({\n __tauriModule: 'Window',\n message: {\n cmd: 'createWebview',\n data: {\n options: {\n label,\n ...options\n }\n }\n }\n })\n .then(async () => this.emit('tauri://created'))\n .catch(async (e) => this.emit('tauri://error', e));\n }\n }\n /**\n * Gets the WebviewWindow for the webview associated with the given label.\n * @example\n * ```typescript\n * import { WebviewWindow } from '@tauri-apps/api/window';\n * const mainWindow = WebviewWindow.getByLabel('main');\n * ```\n *\n * @param label The webview window label.\n * @returns The WebviewWindow instance to communicate with the webview or null if the webview doesn't exist.\n */\n static getByLabel(label) {\n if (getAll().some((w) => w.label === label)) {\n // @ts-expect-error `skip` is not defined in the public API but it is handled by the constructor\n return new WebviewWindow(label, { skip: true });\n }\n return null;\n }\n /**\n * Gets the focused window.\n * @example\n * ```typescript\n * import { WebviewWindow } from '@tauri-apps/api/window';\n * const focusedWindow = WebviewWindow.getFocusedWindow();\n * ```\n *\n * @returns The WebviewWindow instance to communicate with the webview or `undefined` if there is not any focused window.\n *\n * @since 1.4\n */\n static async getFocusedWindow() {\n for (const w of getAll()) {\n if (await w.isFocused()) {\n return w;\n }\n }\n return null;\n }\n}\n/** The WebviewWindow for the current window. */\nlet appWindow;\nif ('__TAURI_METADATA__' in window) {\n appWindow = new WebviewWindow(window.__TAURI_METADATA__.__currentWindow.label, {\n // @ts-expect-error `skip` is not defined in the public API but it is handled by the constructor\n skip: true\n });\n}\nelse {\n 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.`);\n appWindow = new WebviewWindow('main', {\n // @ts-expect-error `skip` is not defined in the public API but it is handled by the constructor\n skip: true\n });\n}\nfunction mapMonitor(m) {\n return m === null\n ? null\n : {\n name: m.name,\n scaleFactor: m.scaleFactor,\n position: mapPhysicalPosition(m.position),\n size: mapPhysicalSize(m.size)\n };\n}\nfunction mapPhysicalPosition(m) {\n return new PhysicalPosition(m.x, m.y);\n}\nfunction mapPhysicalSize(m) {\n return new PhysicalSize(m.width, m.height);\n}\n/**\n * Returns the monitor on which the window currently resides.\n * Returns `null` if current monitor can't be detected.\n * @example\n * ```typescript\n * import { currentMonitor } from '@tauri-apps/api/window';\n * const monitor = currentMonitor();\n * ```\n *\n * @since 1.0.0\n */\nasync function currentMonitor() {\n return invokeTauriCommand({\n __tauriModule: 'Window',\n message: {\n cmd: 'manage',\n data: {\n cmd: {\n type: 'currentMonitor'\n }\n }\n }\n }).then(mapMonitor);\n}\n/**\n * Returns the primary monitor of the system.\n * Returns `null` if it can't identify any monitor as a primary one.\n * @example\n * ```typescript\n * import { primaryMonitor } from '@tauri-apps/api/window';\n * const monitor = primaryMonitor();\n * ```\n *\n * @since 1.0.0\n */\nasync function primaryMonitor() {\n return invokeTauriCommand({\n __tauriModule: 'Window',\n message: {\n cmd: 'manage',\n data: {\n cmd: {\n type: 'primaryMonitor'\n }\n }\n }\n }).then(mapMonitor);\n}\n/**\n * Returns the list of all the monitors available on the system.\n * @example\n * ```typescript\n * import { availableMonitors } from '@tauri-apps/api/window';\n * const monitors = availableMonitors();\n * ```\n *\n * @since 1.0.0\n */\nasync function availableMonitors() {\n return invokeTauriCommand({\n __tauriModule: 'Window',\n message: {\n cmd: 'manage',\n data: {\n cmd: {\n type: 'availableMonitors'\n }\n }\n }\n }).then((ms) => ms.map(mapMonitor));\n}\n\nexport { CloseRequestedEvent, LogicalPosition, LogicalSize, PhysicalPosition, PhysicalSize, UserAttentionType, WebviewWindow, WebviewWindowHandle, WindowManager, appWindow, availableMonitors, currentMonitor, getAll, getCurrent, primaryMonitor };\n", "import { isWindows } from './helpers/os-check.js';\nimport { invokeTauriCommand } from './helpers/tauri.js';\n\n// Copyright 2019-2023 Tauri Programme within The Commons Conservancy\n// SPDX-License-Identifier: Apache-2.0\n// SPDX-License-Identifier: MIT\n/**\n * Provides operating system-related utility methods and properties.\n *\n * This package is also accessible with `window.__TAURI__.os` when [`build.withGlobalTauri`](https://tauri.app/v1/api/config/#buildconfig.withglobaltauri) in `tauri.conf.json` is set to `true`.\n *\n * The APIs must be added to [`tauri.allowlist.os`](https://tauri.app/v1/api/config/#allowlistconfig.os) in `tauri.conf.json`:\n * ```json\n * {\n * \"tauri\": {\n * \"allowlist\": {\n * \"os\": {\n * \"all\": true, // enable all Os APIs\n * }\n * }\n * }\n * }\n * ```\n * It is recommended to allowlist only the APIs you use for optimal bundle size and security.\n * @module\n */\n/**\n * The operating system-specific end-of-line marker.\n * - `\\n` on POSIX\n * - `\\r\\n` on Windows\n *\n * @since 1.0.0\n * */\nconst EOL = isWindows() ? '\\r\\n' : '\\n';\n/**\n * Returns a string identifying the operating system platform.\n * The value is set at compile time. Possible values are `'linux'`, `'darwin'`, `'ios'`, `'freebsd'`, `'dragonfly'`, `'netbsd'`, `'openbsd'`, `'solaris'`, `'android'`, `'win32'`\n * @example\n * ```typescript\n * import { platform } from '@tauri-apps/api/os';\n * const platformName = await platform();\n * ```\n *\n * @since 1.0.0\n *\n */\nasync function platform() {\n return invokeTauriCommand({\n __tauriModule: 'Os',\n message: {\n cmd: 'platform'\n }\n });\n}\n/**\n * Returns a string identifying the kernel version.\n * @example\n * ```typescript\n * import { version } from '@tauri-apps/api/os';\n * const osVersion = await version();\n * ```\n *\n * @since 1.0.0\n */\nasync function version() {\n return invokeTauriCommand({\n __tauriModule: 'Os',\n message: {\n cmd: 'version'\n }\n });\n}\n/**\n * Returns `'Linux'` on Linux, `'Darwin'` on macOS, and `'Windows_NT'` on Windows.\n * @example\n * ```typescript\n * import { type } from '@tauri-apps/api/os';\n * const osType = await type();\n * ```\n *\n * @since 1.0.0\n */\nasync function type() {\n return invokeTauriCommand({\n __tauriModule: 'Os',\n message: {\n cmd: 'osType'\n }\n });\n}\n/**\n * Returns the operating system CPU architecture for which the tauri app was compiled.\n * Possible values are `'x86'`, `'x86_64'`, `'arm'`, `'aarch64'`, `'mips'`, `'mips64'`, `'powerpc'`, `'powerpc64'`, `'riscv64'`, `'s390x'`, `'sparc64'`.\n * @example\n * ```typescript\n * import { arch } from '@tauri-apps/api/os';\n * const archName = await arch();\n * ```\n *\n * @since 1.0.0\n */\nasync function arch() {\n return invokeTauriCommand({\n __tauriModule: 'Os',\n message: {\n cmd: 'arch'\n }\n });\n}\n/**\n * Returns the operating system's default directory for temporary files as a string.\n * @example\n * ```typescript\n * import { tempdir } from '@tauri-apps/api/os';\n * const tempdirPath = await tempdir();\n * ```\n *\n * @since 1.0.0\n */\nasync function tempdir() {\n return invokeTauriCommand({\n __tauriModule: 'Os',\n message: {\n cmd: 'tempdir'\n }\n });\n}\n/**\n * Returns a String with a `BCP-47` language tag inside. If the locale couldn\u2019t be obtained, `null` is returned instead.\n * @example\n * ```typescript\n * import { locale } from '@tauri-apps/api/os';\n * const locale = await locale();\n * if (locale) {\n * // use the locale string here\n * }\n * ```\n *\n * @since 1.4.0\n */\nasync function locale() {\n return invokeTauriCommand({\n __tauriModule: 'Os',\n message: {\n cmd: 'locale'\n }\n });\n}\n\nexport { EOL, arch, locale, platform, tempdir, type, version };\n", "import * as app from './app.js';\nexport { app };\nimport * as cli from './cli.js';\nexport { cli };\nimport * as clipboard from './clipboard.js';\nexport { clipboard };\nimport * as dialog from './dialog.js';\nexport { dialog };\nimport * as event from './event.js';\nexport { event };\nimport * as fs from './fs.js';\nexport { fs };\nimport * as globalShortcut from './globalShortcut.js';\nexport { globalShortcut };\nimport * as http from './http.js';\nexport { http };\nimport * as notification from './notification.js';\nexport { notification };\nimport * as path from './path.js';\nexport { path };\nimport * as process from './process.js';\nexport { process };\nimport * as shell from './shell.js';\nexport { shell };\nimport { invoke as invoke$1 } from './tauri.js';\nimport * as tauri from './tauri.js';\nexport { tauri };\nimport * as updater from './updater.js';\nexport { updater };\nimport * as window from './window.js';\nexport { window };\nimport * as os from './os.js';\nexport { os };\n\n// Copyright 2019-2023 Tauri Programme within The Commons Conservancy\n// SPDX-License-Identifier: Apache-2.0\n// SPDX-License-Identifier: MIT\n/**\n * The Tauri API allows you to interface with the backend layer.\n *\n * This module exposes all other modules as an object where the key is the module name, and the value is the module exports.\n * @example\n * ```typescript\n * import { app, dialog, event, fs, globalShortcut } from '@tauri-apps/api'\n * ```\n * @module\n */\n/** @ignore */\nconst invoke = invoke$1;\n\nexport { invoke };\n", "import * as tauriApi from '@tauri-apps/api';\nimport * as tauriEvent from '@tauri-apps/api/event';\nimport * as tauriApiPath from '@tauri-apps/api/path';\n\nconst SHOW_COMMAND = 'plugin:context_menu|show_context_menu';\n\nimport * as ContextMenu from './types';\nexport type { ContextMenu };\n\nexport async function assetToPath(asset: string): Promise {\n\treturn await tauriApiPath.resolveResource(asset);\n}\n\n// for each item, if it is a function, replace it with an event listener\nasync function processItems(items: ContextMenu.Item[], prefix: string): Promise {\n\tconst unlisteners: tauriEvent.UnlistenFn[] = [];\n\n\t// Copy the items array so we don't mutate the original\n\t// (needed if called multiple times)\n\tconst processed:ContextMenu.Item[] = [ ...items.map((item) => ({ ...item })) ];\n\n\tfor (let i = 0; i < processed.length; i++) {\n\t\tconst itemEvent = processed[i].event;\n\n\t\tif (typeof itemEvent === 'function') {\n\t\t\tconst eventName = `${prefix}_context_menu_item_${i}`;\n\n\t\t\t// Listen to the event and call the function directly\n\t\t\tunlisteners.push(await tauriEvent.listen(eventName, (e) => {\n\t\t\t\tconst data:ContextMenu.CallbackEvent = { ...e, payload: items[i].payload };\n\t\t\t\titemEvent(data);\n\t\t\t}));\n\n\t\t\t// Set the event name on the item instead of the function\n\t\t\tprocessed[i].event = eventName;\n\n\t\t\t// Remove the payload from the item so it doesn't get sent to the plugin\n\t\t\t// (it's already been sent to the event listener)\n\t\t\tprocessed[i].payload = undefined;\n\t\t}\n\n\t\t// Recurse into subitems if they exist\n\t\tif (items[i].subitems) {\n\t\t\tconst result = await processItems(items[i].subitems as ContextMenu.Item[], `${prefix}_${i}`);\n\t\t\tunlisteners.push(...result.unlisteners);\n\t\t\tprocessed[i].subitems = result.processed;\n\t\t}\n\t}\n\n\treturn { unlisteners, processed };\n}\n\nexport async function showMenu(options: ContextMenu.Options) {\n\tconst { unlisteners, processed } = await processItems(options.items, 'root');\n\n\t// unlisten all events when the menu closes\n\tconst unlistenMenuClose = await tauriEvent.listen(\"menu-did-close\", () => {\n\t\tunlisteners.forEach((unlistener) => unlistener());\n\t\tunlisteners.length = 0;\n\t\tunlistenMenuClose();\n\t});\n\n\t// send the options to the plugin\n\ttauriApi.invoke(SHOW_COMMAND, { ...options, items: processed } as any);\n}\n\nexport function onEventShowMenu(eventName: string, options: ContextMenu.EventOptions): void {\n\twindow.addEventListener(eventName, async (e) => {\n\t\te.preventDefault();\n\t\t\n\t\t// if options is a function, call it to get the options\n\t\tif (typeof options === 'function') {\n\t\t\toptions = await options(e as MouseEvent);\n\t\t}\n\n\t\tawait showMenu(options);\n\t});\n}"], "mappings": "AAIA,SAASA,GAAM,CACX,OAAO,OAAO,OAAO,gBAAgB,IAAI,YAAY,CAAC,CAAC,EAAE,CAAC,CAC9D,CASA,SAASC,EAAkBC,EAAUC,EAAO,GAAO,CAC/C,IAAMC,EAAaJ,EAAI,EACjBK,EAAO,IAAID,CAAU,GAC3B,cAAO,eAAe,OAAQC,EAAM,CAChC,MAAQC,IACAH,GACA,QAAQ,eAAe,OAAQE,CAAI,EAEoBH,IAASI,CAAM,GAE9E,SAAU,GACV,aAAc,EAClB,CAAC,EACMF,CACX,CAeA,eAAeG,EAAOC,EAAKC,EAAO,CAAC,EAAG,CAClC,OAAO,IAAI,QAAQ,CAACC,EAASC,IAAW,CACpC,IAAMT,EAAWD,EAAmBW,GAAM,CACtCF,EAAQE,CAAC,EACT,QAAQ,eAAe,OAAQ,IAAIC,CAAK,EAAE,CAC9C,EAAG,EAAI,EACDA,EAAQZ,EAAmBW,GAAM,CACnCD,EAAOC,CAAC,EACR,QAAQ,eAAe,OAAQ,IAAIV,CAAQ,EAAE,CACjD,EAAG,EAAI,EACP,OAAO,cAAc,CACjB,IAAAM,EACA,SAAAN,EACA,MAAAW,EACA,GAAGJ,CACP,CAAC,CACL,CAAC,CACL,CCvDA,eAAeK,EAAmBC,EAAS,CACvC,OAAOC,EAAO,QAASD,CAAO,CAClC,CCMA,eAAeE,EAAUC,EAAOC,EAAS,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,OAAS,EACrBY,EAAkB,CACnB,CAAC,EAGQE,EAAOrB,GAAc,CAAE,GAAGkB,EAAS,MAAOV,CAAU,CAAQ,CACtE,CAEO,SAASc,GAAgBV,EAAmBM,EAAyC,CAC3F,OAAO,iBAAiBN,EAAW,MAAOE,GAAM,CAC/CA,EAAE,eAAe,EAGb,OAAOI,GAAY,aACtBA,EAAU,MAAMA,EAAQJ,CAAe,GAGxC,MAAMG,GAASC,CAAO,CACvB,CAAC,CACF", "names": ["uid", "transformCallback", "callback", "once", "identifier", "prop", "result", "invoke", "cmd", "args", "resolve", "reject", "e", "error", "invokeTauriCommand", "command", "invoke", "_unlisten", "event", "eventId", "invokeTauriCommand", "emit", "windowLabel", "payload", "listen", "handler", "transformCallback", "once", "eventData", "TauriEvent", "listen", "event", "handler", "BaseDirectory", "ResponseType", "isWindows", "resolveResource", "resourcePath", "invokeTauriCommand", "BaseDirectory", "sep", "isWindows", "delimiter", "LogicalSize", "width", "height", "PhysicalSize", "scaleFactor", "LogicalPosition", "x", "y", "PhysicalPosition", "UserAttentionType", "getAll", "w", "WebviewWindow", "localTauriEvents", "WebviewWindowHandle", "label", "event", "handler", "listeners", "listen", "once", "payload", "emit", "WindowManager", "invokeTauriCommand", "x", "y", "PhysicalPosition", "width", "height", "PhysicalSize", "requestType", "requestType_", "UserAttentionType", "resizable", "maximizable", "minimizable", "closable", "title", "decorations", "alwaysOnTop", "protected_", "size", "position", "fullscreen", "icon", "skip", "grab", "visible", "ignore", "TauriEvent", "e", "mapPhysicalSize", "mapPhysicalPosition", "evt", "CloseRequestedEvent", "unlistenFocus", "unlistenBlur", "unlistenFileDrop", "unlistenFileHover", "unlistenCancel", "_WebviewWindow", "options", "appWindow", "mapPhysicalPosition", "m", "PhysicalPosition", "mapPhysicalSize", "PhysicalSize", "EOL", "isWindows", "invoke", "SHOW_COMMAND", "assetToPath", "asset", "resolveResource", "processItems", "items", "prefix", "unlisteners", "processed", "item", "i", "itemEvent", "eventName", "listen", "e", "data", "result", "showMenu", "options", "unlistenMenuClose", "unlistener", "invoke", "onEventShowMenu"] }