sh3-server 0.15.2 → 0.15.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app/assets/core-DsojzR6k.js +2 -0
- package/app/assets/core-DsojzR6k.js.map +1 -0
- package/app/assets/{index-CuexSuRN.css → index-CPOBQSVo.css} +1 -1
- package/app/assets/index-DSoJbq2V.js +21 -0
- package/app/assets/index-DSoJbq2V.js.map +1 -0
- package/app/assets/index-YGsF1N98.js +2 -0
- package/app/assets/index-YGsF1N98.js.map +1 -0
- package/app/assets/tauri-backend-C83nL1gr.js +2 -0
- package/app/assets/{tauri-backend-BNhKUiUG.js.map → tauri-backend-C83nL1gr.js.map} +1 -1
- package/app/index.html +2 -2
- package/package.json +1 -1
- package/app/assets/index-56jHh6nx.js +0 -2
- package/app/assets/index-56jHh6nx.js.map +0 -1
- package/app/assets/index-dcWTOW90.js +0 -21
- package/app/assets/index-dcWTOW90.js.map +0 -1
- package/app/assets/tauri-backend-BNhKUiUG.js +0 -2
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{invoke as s,transformCallback as d,Resource as l}from"./core-DsojzR6k.js";var n;(function(a){a.WINDOW_RESIZED="tauri://resize",a.WINDOW_MOVED="tauri://move",a.WINDOW_CLOSE_REQUESTED="tauri://close-requested",a.WINDOW_DESTROYED="tauri://destroyed",a.WINDOW_FOCUS="tauri://focus",a.WINDOW_BLUR="tauri://blur",a.WINDOW_SCALE_FACTOR_CHANGED="tauri://scale-change",a.WINDOW_THEME_CHANGED="tauri://theme-changed",a.WINDOW_CREATED="tauri://window-created",a.WEBVIEW_CREATED="tauri://webview-created",a.DRAG_ENTER="tauri://drag-enter",a.DRAG_OVER="tauri://drag-over",a.DRAG_DROP="tauri://drag-drop",a.DRAG_LEAVE="tauri://drag-leave"})(n||(n={}));async function h(a,t){window.__TAURI_EVENT_PLUGIN_INTERNALS__.unregisterListener(a,t),await s("plugin:event|unlisten",{event:a,eventId:t})}async function o(a,t,e){var r;const u=(r=void 0)!==null&&r!==void 0?r:{kind:"Any"};return s("plugin:event|listen",{event:a,target:u,handler:d(t)}).then(c=>async()=>h(a,c))}async function y(a,t){return await i.load(a,t)}async function g(a){return await i.get(a)}class p{get store(){return this._store||(this._store=y(this.path,this.options)),this._store}constructor(t,e){this.path=t,this.options=e}async init(){await this.store}async set(t,e){return(await this.store).set(t,e)}async get(t){return(await this.store).get(t)}async has(t){return(await this.store).has(t)}async delete(t){return(await this.store).delete(t)}async clear(){await(await this.store).clear()}async reset(){await(await this.store).reset()}async keys(){return(await this.store).keys()}async values(){return(await this.store).values()}async entries(){return(await this.store).entries()}async length(){return(await this.store).length()}async reload(t){await(await this.store).reload(t)}async save(){await(await this.store).save()}async onKeyChange(t,e){return(await this.store).onKeyChange(t,e)}async onChange(t){return(await this.store).onChange(t)}async close(){this._store&&await(await this._store).close()}}class i extends l{constructor(t){super(t)}static async load(t,e){const r=await s("plugin:store|load",{path:t,options:e});return new i(r)}static async get(t){return await s("plugin:store|get_store",{path:t}).then(e=>e?new i(e):null)}async set(t,e){await s("plugin:store|set",{rid:this.rid,key:t,value:e})}async get(t){const[e,r]=await s("plugin:store|get",{rid:this.rid,key:t});return r?e:void 0}async has(t){return await s("plugin:store|has",{rid:this.rid,key:t})}async delete(t){return await s("plugin:store|delete",{rid:this.rid,key:t})}async clear(){await s("plugin:store|clear",{rid:this.rid})}async reset(){await s("plugin:store|reset",{rid:this.rid})}async keys(){return await s("plugin:store|keys",{rid:this.rid})}async values(){return await s("plugin:store|values",{rid:this.rid})}async entries(){return await s("plugin:store|entries",{rid:this.rid})}async length(){return await s("plugin:store|length",{rid:this.rid})}async reload(t){await s("plugin:store|reload",{rid:this.rid,...t})}async save(){await s("plugin:store|save",{rid:this.rid})}async onKeyChange(t,e){return await o("store://change",r=>{r.payload.resourceId===this.rid&&r.payload.key===t&&e(r.payload.exists?r.payload.value:void 0)})}async onChange(t){return await o("store://change",e=>{e.payload.resourceId===this.rid&&t(e.payload.key,e.payload.exists?e.payload.value:void 0)})}}export{p as LazyStore,i as Store,g as getStore,y as load};
|
|
2
|
+
//# sourceMappingURL=index-YGsF1N98.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-YGsF1N98.js","sources":["../../../../node_modules/@tauri-apps/api/event.js","../../../../node_modules/@tauri-apps/plugin-store/dist-js/index.js"],"sourcesContent":["import { invoke, transformCallback } from './core.js';\n\n// Copyright 2019-2024 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 [`app.withGlobalTauri`](https://v2.tauri.app/reference/config/#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_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_CREATED\"] = \"tauri://window-created\";\n TauriEvent[\"WEBVIEW_CREATED\"] = \"tauri://webview-created\";\n TauriEvent[\"DRAG_ENTER\"] = \"tauri://drag-enter\";\n TauriEvent[\"DRAG_OVER\"] = \"tauri://drag-over\";\n TauriEvent[\"DRAG_DROP\"] = \"tauri://drag-drop\";\n TauriEvent[\"DRAG_LEAVE\"] = \"tauri://drag-leave\";\n})(TauriEvent || (TauriEvent = {}));\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 window.__TAURI_EVENT_PLUGIN_INTERNALS__.unregisterListener(event, eventId);\n await invoke('plugin:event|unlisten', {\n event,\n eventId\n });\n}\n/**\n * Listen to an emitted event to any {@link EventTarget|target}.\n *\n * @example\n * ```typescript\n * import { listen } from '@tauri-apps/api/event';\n * const unlisten = await listen<string>('error', (event) => {\n * console.log(`Got error, 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 * @param options Event listening options.\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, options) {\n var _a;\n const target = typeof (options === null || options === void 0 ? void 0 : options.target) === 'string'\n ? { kind: 'AnyLabel', label: options.target }\n : ((_a = options === null || options === void 0 ? void 0 : options.target) !== null && _a !== void 0 ? _a : { kind: 'Any' });\n return invoke('plugin:event|listen', {\n event,\n target,\n handler: transformCallback(handler)\n }).then((eventId) => {\n return async () => _unlisten(event, eventId);\n });\n}\n/**\n * Listens once to an emitted event to any {@link EventTarget|target}.\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<LoadedPayload>('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 * @param handler Event handler callback.\n * @param options Event listening options.\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, options) {\n return listen(event, (eventData) => {\n void _unlisten(event, eventData.id);\n handler(eventData);\n }, options);\n}\n/**\n * Emits an event to all {@link EventTarget|targets}.\n *\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 * @param payload Event payload.\n *\n * @since 1.0.0\n */\nasync function emit(event, payload) {\n await invoke('plugin:event|emit', {\n event,\n payload\n });\n}\n/**\n * Emits an event to all {@link EventTarget|targets} matching the given target.\n *\n * @example\n * ```typescript\n * import { emitTo } from '@tauri-apps/api/event';\n * await emitTo('main', 'frontend-loaded', { loggedIn: true, token: 'authToken' });\n * ```\n *\n * @param target Label of the target Window/Webview/WebviewWindow or raw {@link EventTarget} object.\n * @param event Event name. Must include only alphanumeric characters, `-`, `/`, `:` and `_`.\n * @param payload Event payload.\n *\n * @since 2.0.0\n */\nasync function emitTo(target, event, payload) {\n const eventTarget = typeof target === 'string' ? { kind: 'AnyLabel', label: target } : target;\n await invoke('plugin:event|emit_to', {\n target: eventTarget,\n event,\n payload\n });\n}\n\nexport { TauriEvent, emit, emitTo, listen, once };\n","import { listen } from '@tauri-apps/api/event';\nimport { Resource, invoke } from '@tauri-apps/api/core';\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 * Create a new Store or load the existing store with the path.\n *\n * @example\n * ```typescript\n * import { Store } from '@tauri-apps/api/store';\n * const store = await Store.load('store.json');\n * ```\n *\n * @param path Path to save the store in `app_data_dir`\n * @param options Store configuration options\n */\nasync function load(path, options) {\n return await Store.load(path, options);\n}\n/**\n * Gets an already loaded store.\n *\n * If the store is not loaded, returns `null`. In this case you must {@link Store.load load} it.\n *\n * This function is more useful when you already know the store is loaded\n * and just need to access its instance. Prefer {@link Store.load} otherwise.\n *\n * @example\n * ```typescript\n * import { getStore } from '@tauri-apps/api/store';\n * const store = await getStore('store.json');\n * ```\n *\n * @param path Path of the store.\n */\nasync function getStore(path) {\n return await Store.get(path);\n}\n/**\n * A lazy loaded key-value store persisted by the backend layer.\n */\nclass LazyStore {\n get store() {\n if (!this._store) {\n this._store = load(this.path, this.options);\n }\n return this._store;\n }\n /**\n * Note that the options are not applied if someone else already created the store\n * @param path Path to save the store in `app_data_dir`\n * @param options Store configuration options\n */\n constructor(path, options) {\n this.path = path;\n this.options = options;\n }\n /**\n * Init/load the store if it's not loaded already\n */\n async init() {\n await this.store;\n }\n async set(key, value) {\n return (await this.store).set(key, value);\n }\n async get(key) {\n return (await this.store).get(key);\n }\n async has(key) {\n return (await this.store).has(key);\n }\n async delete(key) {\n return (await this.store).delete(key);\n }\n async clear() {\n await (await this.store).clear();\n }\n async reset() {\n await (await this.store).reset();\n }\n async keys() {\n return (await this.store).keys();\n }\n async values() {\n return (await this.store).values();\n }\n async entries() {\n return (await this.store).entries();\n }\n async length() {\n return (await this.store).length();\n }\n async reload(options) {\n await (await this.store).reload(options);\n }\n async save() {\n await (await this.store).save();\n }\n async onKeyChange(key, cb) {\n return (await this.store).onKeyChange(key, cb);\n }\n async onChange(cb) {\n return (await this.store).onChange(cb);\n }\n async close() {\n if (this._store) {\n await (await this._store).close();\n }\n }\n}\n/**\n * A key-value store persisted by the backend layer.\n */\nclass Store extends Resource {\n constructor(rid) {\n super(rid);\n }\n /**\n * Create a new Store or load the existing store with the path.\n *\n * @example\n * ```typescript\n * import { Store } from '@tauri-apps/api/store';\n * const store = await Store.load('store.json');\n * ```\n *\n * @param path Path to save the store in `app_data_dir`\n * @param options Store configuration options\n */\n static async load(path, options) {\n const rid = await invoke('plugin:store|load', {\n path,\n options\n });\n return new Store(rid);\n }\n /**\n * Gets an already loaded store.\n *\n * If the store is not loaded, returns `null`. In this case you must {@link Store.load load} it.\n *\n * This function is more useful when you already know the store is loaded\n * and just need to access its instance. Prefer {@link Store.load} otherwise.\n *\n * @example\n * ```typescript\n * import { Store } from '@tauri-apps/api/store';\n * let store = await Store.get('store.json');\n * if (!store) {\n * store = await Store.load('store.json');\n * }\n * ```\n *\n * @param path Path of the store.\n */\n static async get(path) {\n return await invoke('plugin:store|get_store', { path }).then((rid) => (rid ? new Store(rid) : null));\n }\n async set(key, value) {\n await invoke('plugin:store|set', {\n rid: this.rid,\n key,\n value\n });\n }\n async get(key) {\n const [value, exists] = await invoke('plugin:store|get', {\n rid: this.rid,\n key\n });\n return exists ? value : undefined;\n }\n async has(key) {\n return await invoke('plugin:store|has', {\n rid: this.rid,\n key\n });\n }\n async delete(key) {\n return await invoke('plugin:store|delete', {\n rid: this.rid,\n key\n });\n }\n async clear() {\n await invoke('plugin:store|clear', { rid: this.rid });\n }\n async reset() {\n await invoke('plugin:store|reset', { rid: this.rid });\n }\n async keys() {\n return await invoke('plugin:store|keys', { rid: this.rid });\n }\n async values() {\n return await invoke('plugin:store|values', { rid: this.rid });\n }\n async entries() {\n return await invoke('plugin:store|entries', { rid: this.rid });\n }\n async length() {\n return await invoke('plugin:store|length', { rid: this.rid });\n }\n async reload(options) {\n await invoke('plugin:store|reload', { rid: this.rid, ...options });\n }\n async save() {\n await invoke('plugin:store|save', { rid: this.rid });\n }\n async onKeyChange(key, cb) {\n return await listen('store://change', (event) => {\n if (event.payload.resourceId === this.rid && event.payload.key === key) {\n cb(event.payload.exists ? event.payload.value : undefined);\n }\n });\n }\n async onChange(cb) {\n return await listen('store://change', (event) => {\n if (event.payload.resourceId === this.rid) {\n cb(event.payload.key, event.payload.exists ? event.payload.value : undefined);\n }\n });\n }\n}\n\nexport { LazyStore, Store, getStore, load };\n"],"names":["TauriEvent","_unlisten","event","eventId","invoke","listen","handler","options","_a","target","transformCallback","load","path","Store","getStore","LazyStore","key","value","cb","Resource","rid","exists"],"mappings":"iFAcA,IAAIA,GACH,SAAUA,EAAY,CACnBA,EAAW,eAA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AAE,CACvD,CACA,MAAM,YAAYY,EAAKE,EAAI,CACvB,OAAO,MAAMb,EAAO,iBAAmBH,GAAU,CACzCA,EAAM,QAAQ,aAAe,KAAK,KAAOA,EAAM,QAAQ,MAAQc,GAC/DE,EAAGhB,EAAM,QAAQ,OAASA,EAAM,QAAQ,MAAQ,MAAS,CAEjE,CAAC,CACL,CACA,MAAM,SAASgB,EAAI,CACf,OAAO,MAAMb,EAAO,iBAAmBH,GAAU,CACzCA,EAAM,QAAQ,aAAe,KAAK,KAClCgB,EAAGhB,EAAM,QAAQ,IAAKA,EAAM,QAAQ,OAASA,EAAM,QAAQ,MAAQ,MAAS,CAEpF,CAAC,CACL,CACJ","x_google_ignoreList":[0,1]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{LazyStore as r}from"./index-YGsF1N98.js";import"./core-DsojzR6k.js";class n{#t;#e=new Map;constructor(e){this.#t=new r(`${e}.json`,{defaults:{},autoSave:!0})}read(e){return this.#e.get(e)}write(e,t){this.#e.set(e,t),this.#t.set(e,t).catch(s=>console.warn("SH3: store write failed",s))}delete(e){this.#e.delete(e),this.#t.delete(e).catch(t=>console.warn("SH3: store delete failed",t))}list(){return[...this.#e.keys()]}async init(){const e=await this.#t.entries();for(const[t,s]of e)this.#e.set(t,s)}}export{n as TauriStoreBackend};
|
|
2
|
+
//# sourceMappingURL=tauri-backend-C83nL1gr.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tauri-backend-
|
|
1
|
+
{"version":3,"file":"tauri-backend-C83nL1gr.js","sources":["../../../sh3-core/src/platform/tauri-backend.ts"],"sourcesContent":["/*\n * TauriStoreBackend — implements the sh3 Backend interface using\n * @tauri-apps/plugin-store. Each zone gets its own .json store file\n * (e.g. \"workspace.json\", \"user.json\") in Tauri's app data directory.\n *\n * tauri-plugin-store v2 keeps an in-memory cache and flushes to disk\n * automatically. We pre-load the full store into a local Map during\n * init(), then serve reads/lists synchronously from that cache —\n * matching the Backend interface contract. Writes go to both the\n * local cache and the Tauri store (fire-and-forget async).\n */\n\nimport { LazyStore } from '@tauri-apps/plugin-store';\nimport type { Backend } from '../state/types';\n\nexport class TauriStoreBackend implements Backend {\n #store: LazyStore;\n #cache = new Map<string, unknown>();\n\n constructor(zoneName: string) {\n this.#store = new LazyStore(`${zoneName}.json`, { defaults: {}, autoSave: true });\n }\n\n read(shardId: string): unknown | undefined {\n return this.#cache.get(shardId);\n }\n\n write(shardId: string, value: unknown): void {\n this.#cache.set(shardId, value);\n // Fire-and-forget — autoSave flushes to disk.\n this.#store.set(shardId, value).catch((e: unknown) => console.warn('SH3: store write failed', e));\n }\n\n delete(shardId: string): void {\n this.#cache.delete(shardId);\n this.#store.delete(shardId).catch((e: unknown) => console.warn('SH3: store delete failed', e));\n }\n\n list(): string[] {\n return [...this.#cache.keys()];\n }\n\n /**\n * Load the store from disk into the local cache. Must be called once\n * before read/list return meaningful data. Called by the platform\n * resolver at boot.\n */\n async init(): Promise<void> {\n const entries = await this.#store.entries<unknown>();\n for (const [key, value] of entries) {\n this.#cache.set(key, value);\n }\n }\n}\n"],"names":["TauriStoreBackend","#store","#cache","zoneName","LazyStore","shardId","value","e","entries","key"],"mappings":"2EAeO,MAAMA,CAAqC,CAChDC,GACAC,OAAa,IAEb,YAAYC,EAAkB,CAC5B,KAAKF,GAAS,IAAIG,EAAU,GAAGD,CAAQ,QAAS,CAAE,SAAU,CAAA,EAAI,SAAU,EAAA,CAAM,CAClF,CAEA,KAAKE,EAAsC,CACzC,OAAO,KAAKH,GAAO,IAAIG,CAAO,CAChC,CAEA,MAAMA,EAAiBC,EAAsB,CAC3C,KAAKJ,GAAO,IAAIG,EAASC,CAAK,EAE9B,KAAKL,GAAO,IAAII,EAASC,CAAK,EAAE,MAAOC,GAAe,QAAQ,KAAK,0BAA2BA,CAAC,CAAC,CAClG,CAEA,OAAOF,EAAuB,CAC5B,KAAKH,GAAO,OAAOG,CAAO,EAC1B,KAAKJ,GAAO,OAAOI,CAAO,EAAE,MAAOE,GAAe,QAAQ,KAAK,2BAA4BA,CAAC,CAAC,CAC/F,CAEA,MAAiB,CACf,MAAO,CAAC,GAAG,KAAKL,GAAO,MAAM,CAC/B,CAOA,MAAM,MAAsB,CAC1B,MAAMM,EAAU,MAAM,KAAKP,GAAO,QAAA,EAClC,SAAW,CAACQ,EAAKH,CAAK,IAAKE,EACzB,KAAKN,GAAO,IAAIO,EAAKH,CAAK,CAE9B,CACF"}
|
package/app/index.html
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
|
7
7
|
<title>SH3</title>
|
|
8
|
-
<script type="module" crossorigin src="/assets/index-
|
|
9
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
8
|
+
<script type="module" crossorigin src="/assets/index-DSoJbq2V.js"></script>
|
|
9
|
+
<link rel="stylesheet" crossorigin href="/assets/index-CPOBQSVo.css">
|
|
10
10
|
</head>
|
|
11
11
|
<body>
|
|
12
12
|
<div id="app"></div>
|
package/package.json
CHANGED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
function l(r,t,e,a){if(typeof t=="function"?r!==t||!a:!t.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e==="m"?a:e==="a"?a.call(r):a?a.value:t.get(r)}function h(r,t,e,a,o){if(typeof t=="function"?r!==t||!0:!t.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(r,e),e}var n;function y(r,t=!1){return window.__TAURI_INTERNALS__.transformCallback(r,t)}async function s(r,t={},e){return window.__TAURI_INTERNALS__.invoke(r,t,e)}class w{get rid(){return l(this,n,"f")}constructor(t){n.set(this,void 0),h(this,n,t)}async close(){return s("plugin:resources|close",{rid:this.rid})}}n=new WeakMap;var u;(function(r){r.WINDOW_RESIZED="tauri://resize",r.WINDOW_MOVED="tauri://move",r.WINDOW_CLOSE_REQUESTED="tauri://close-requested",r.WINDOW_DESTROYED="tauri://destroyed",r.WINDOW_FOCUS="tauri://focus",r.WINDOW_BLUR="tauri://blur",r.WINDOW_SCALE_FACTOR_CHANGED="tauri://scale-change",r.WINDOW_THEME_CHANGED="tauri://theme-changed",r.WINDOW_CREATED="tauri://window-created",r.WEBVIEW_CREATED="tauri://webview-created",r.DRAG_ENTER="tauri://drag-enter",r.DRAG_OVER="tauri://drag-over",r.DRAG_DROP="tauri://drag-drop",r.DRAG_LEAVE="tauri://drag-leave"})(u||(u={}));async function p(r,t){window.__TAURI_EVENT_PLUGIN_INTERNALS__.unregisterListener(r,t),await s("plugin:event|unlisten",{event:r,eventId:t})}async function c(r,t,e){var a;const o=(a=void 0)!==null&&a!==void 0?a:{kind:"Any"};return s("plugin:event|listen",{event:r,target:o,handler:y(t)}).then(d=>async()=>p(r,d))}async function g(r,t){return await i.load(r,t)}async function _(r){return await i.get(r)}class f{get store(){return this._store||(this._store=g(this.path,this.options)),this._store}constructor(t,e){this.path=t,this.options=e}async init(){await this.store}async set(t,e){return(await this.store).set(t,e)}async get(t){return(await this.store).get(t)}async has(t){return(await this.store).has(t)}async delete(t){return(await this.store).delete(t)}async clear(){await(await this.store).clear()}async reset(){await(await this.store).reset()}async keys(){return(await this.store).keys()}async values(){return(await this.store).values()}async entries(){return(await this.store).entries()}async length(){return(await this.store).length()}async reload(t){await(await this.store).reload(t)}async save(){await(await this.store).save()}async onKeyChange(t,e){return(await this.store).onKeyChange(t,e)}async onChange(t){return(await this.store).onChange(t)}async close(){this._store&&await(await this._store).close()}}class i extends w{constructor(t){super(t)}static async load(t,e){const a=await s("plugin:store|load",{path:t,options:e});return new i(a)}static async get(t){return await s("plugin:store|get_store",{path:t}).then(e=>e?new i(e):null)}async set(t,e){await s("plugin:store|set",{rid:this.rid,key:t,value:e})}async get(t){const[e,a]=await s("plugin:store|get",{rid:this.rid,key:t});return a?e:void 0}async has(t){return await s("plugin:store|has",{rid:this.rid,key:t})}async delete(t){return await s("plugin:store|delete",{rid:this.rid,key:t})}async clear(){await s("plugin:store|clear",{rid:this.rid})}async reset(){await s("plugin:store|reset",{rid:this.rid})}async keys(){return await s("plugin:store|keys",{rid:this.rid})}async values(){return await s("plugin:store|values",{rid:this.rid})}async entries(){return await s("plugin:store|entries",{rid:this.rid})}async length(){return await s("plugin:store|length",{rid:this.rid})}async reload(t){await s("plugin:store|reload",{rid:this.rid,...t})}async save(){await s("plugin:store|save",{rid:this.rid})}async onKeyChange(t,e){return await c("store://change",a=>{a.payload.resourceId===this.rid&&a.payload.key===t&&e(a.payload.exists?a.payload.value:void 0)})}async onChange(t){return await c("store://change",e=>{e.payload.resourceId===this.rid&&t(e.payload.key,e.payload.exists?e.payload.value:void 0)})}}export{f as LazyStore,i as Store,_ as getStore,g as load};
|
|
2
|
-
//# sourceMappingURL=index-56jHh6nx.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index-56jHh6nx.js","sources":["../../../../node_modules/@tauri-apps/api/external/tslib/tslib.es6.js","../../../../node_modules/@tauri-apps/api/core.js","../../../../node_modules/@tauri-apps/api/event.js","../../../../node_modules/@tauri-apps/plugin-store/dist-js/index.js"],"sourcesContent":["/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\r\n\r\n\r\nfunction __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nfunction __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\r\ntypeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\r\n var e = new Error(message);\r\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\r\n};\n\nexport { __classPrivateFieldGet, __classPrivateFieldSet };\n","import { __classPrivateFieldSet, __classPrivateFieldGet } from './external/tslib/tslib.es6.js';\n\n// Copyright 2019-2024 Tauri Programme within The Commons Conservancy\n// SPDX-License-Identifier: Apache-2.0\n// SPDX-License-Identifier: MIT\nvar _Channel_onmessage, _Channel_nextMessageIndex, _Channel_pendingMessages, _Channel_messageEndIndex, _Resource_rid;\n/**\n * Invoke your custom commands.\n *\n * This package is also accessible with `window.__TAURI__.core` when [`app.withGlobalTauri`](https://v2.tauri.app/reference/config/#withglobaltauri) in `tauri.conf.json` is set to `true`.\n * @module\n */\n/**\n * A key to be used to implement a special function\n * on your types that define how your type should be serialized\n * when passing across the IPC.\n * @example\n * Given a type in Rust that looks like this\n * ```rs\n * #[derive(serde::Serialize, serde::Deserialize)\n * enum UserId {\n * String(String),\n * Number(u32),\n * }\n * ```\n * `UserId::String(\"id\")` would be serialized into `{ String: \"id\" }`\n * and so we need to pass the same structure back to Rust\n * ```ts\n * import { SERIALIZE_TO_IPC_FN } from \"@tauri-apps/api/core\"\n *\n * class UserIdString {\n * id\n * constructor(id) {\n * this.id = id\n * }\n *\n * [SERIALIZE_TO_IPC_FN]() {\n * return { String: this.id }\n * }\n * }\n *\n * class UserIdNumber {\n * id\n * constructor(id) {\n * this.id = id\n * }\n *\n * [SERIALIZE_TO_IPC_FN]() {\n * return { Number: this.id }\n * }\n * }\n *\n * type UserId = UserIdString | UserIdNumber\n * ```\n *\n */\n// if this value changes, make sure to update it in:\n// 1. ipc.js\n// 2. process-ipc-message-fn.js\nconst SERIALIZE_TO_IPC_FN = '__TAURI_TO_IPC_KEY__';\n/**\n * Stores the callback in a known location, and returns an identifier that can be passed to the backend.\n * The backend uses the identifier to `eval()` the callback.\n *\n * @return An unique identifier associated with the callback function.\n *\n * @since 1.0.0\n */\nfunction transformCallback(\n// TODO: Make this not optional in v3\ncallback, once = false) {\n return window.__TAURI_INTERNALS__.transformCallback(callback, once);\n}\nclass Channel {\n constructor(onmessage) {\n _Channel_onmessage.set(this, void 0);\n // the index is used as a mechanism to preserve message order\n _Channel_nextMessageIndex.set(this, 0);\n _Channel_pendingMessages.set(this, []);\n _Channel_messageEndIndex.set(this, void 0);\n __classPrivateFieldSet(this, _Channel_onmessage, onmessage || (() => { }), \"f\");\n this.id = transformCallback((rawMessage) => {\n const index = rawMessage.index;\n if ('end' in rawMessage) {\n if (index == __classPrivateFieldGet(this, _Channel_nextMessageIndex, \"f\")) {\n this.cleanupCallback();\n }\n else {\n __classPrivateFieldSet(this, _Channel_messageEndIndex, index, \"f\");\n }\n return;\n }\n const message = rawMessage.message;\n // Process the message if we're at the right order\n if (index == __classPrivateFieldGet(this, _Channel_nextMessageIndex, \"f\")) {\n __classPrivateFieldGet(this, _Channel_onmessage, \"f\").call(this, message);\n __classPrivateFieldSet(this, _Channel_nextMessageIndex, __classPrivateFieldGet(this, _Channel_nextMessageIndex, \"f\") + 1, \"f\");\n // process pending messages\n while (__classPrivateFieldGet(this, _Channel_nextMessageIndex, \"f\") in __classPrivateFieldGet(this, _Channel_pendingMessages, \"f\")) {\n const message = __classPrivateFieldGet(this, _Channel_pendingMessages, \"f\")[__classPrivateFieldGet(this, _Channel_nextMessageIndex, \"f\")];\n __classPrivateFieldGet(this, _Channel_onmessage, \"f\").call(this, message);\n // eslint-disable-next-line @typescript-eslint/no-array-delete\n delete __classPrivateFieldGet(this, _Channel_pendingMessages, \"f\")[__classPrivateFieldGet(this, _Channel_nextMessageIndex, \"f\")];\n __classPrivateFieldSet(this, _Channel_nextMessageIndex, __classPrivateFieldGet(this, _Channel_nextMessageIndex, \"f\") + 1, \"f\");\n }\n if (__classPrivateFieldGet(this, _Channel_nextMessageIndex, \"f\") === __classPrivateFieldGet(this, _Channel_messageEndIndex, \"f\")) {\n this.cleanupCallback();\n }\n }\n // Queue the message if we're not\n else {\n // eslint-disable-next-line security/detect-object-injection\n __classPrivateFieldGet(this, _Channel_pendingMessages, \"f\")[index] = message;\n }\n });\n }\n cleanupCallback() {\n window.__TAURI_INTERNALS__.unregisterCallback(this.id);\n }\n set onmessage(handler) {\n __classPrivateFieldSet(this, _Channel_onmessage, handler, \"f\");\n }\n get onmessage() {\n return __classPrivateFieldGet(this, _Channel_onmessage, \"f\");\n }\n [(_Channel_onmessage = new WeakMap(), _Channel_nextMessageIndex = new WeakMap(), _Channel_pendingMessages = new WeakMap(), _Channel_messageEndIndex = new WeakMap(), SERIALIZE_TO_IPC_FN)]() {\n return `__CHANNEL__:${this.id}`;\n }\n toJSON() {\n // eslint-disable-next-line security/detect-object-injection\n return this[SERIALIZE_TO_IPC_FN]();\n }\n}\nclass PluginListener {\n constructor(plugin, event, channelId) {\n this.plugin = plugin;\n this.event = event;\n this.channelId = channelId;\n }\n async unregister() {\n return invoke(`plugin:${this.plugin}|remove_listener`, {\n event: this.event,\n channelId: this.channelId\n });\n }\n}\n/**\n * Adds a listener to a plugin event.\n *\n * @returns The listener object to stop listening to the events.\n *\n * @since 2.0.0\n */\nasync function addPluginListener(plugin, event, cb) {\n const handler = new Channel(cb);\n try {\n await invoke(`plugin:${plugin}|register_listener`, {\n event,\n handler\n });\n return new PluginListener(plugin, event, handler.id);\n }\n catch {\n // TODO(v3): remove this fallback\n // note: we must try with camelCase here for backwards compatibility\n await invoke(`plugin:${plugin}|registerListener`, { event, handler });\n return new PluginListener(plugin, event, handler.id);\n }\n}\n/**\n * Get permission state for a plugin.\n *\n * This should be used by plugin authors to wrap their actual implementation.\n */\nasync function checkPermissions(plugin) {\n return invoke(`plugin:${plugin}|check_permissions`);\n}\n/**\n * Request permissions.\n *\n * This should be used by plugin authors to wrap their actual implementation.\n */\nasync function requestPermissions(plugin) {\n return invoke(`plugin:${plugin}|request_permissions`);\n}\n/**\n * Sends a message to the backend.\n * @example\n * ```typescript\n * import { invoke } from '@tauri-apps/api/core';\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 * @param options The request options.\n * @return A promise resolving or rejecting to the backend response.\n *\n * @since 1.0.0\n */\nasync function invoke(cmd, args = {}, options) {\n return window.__TAURI_INTERNALS__.invoke(cmd, args, options);\n}\n/**\n * Convert a device file path to an URL that can be loaded by the webview.\n * Note that `asset:` and `http://asset.localhost` must be added to [`app.security.csp`](https://v2.tauri.app/reference/config/#csp-1) in `tauri.conf.json`.\n * Example CSP value: `\"csp\": \"default-src 'self' ipc: http://ipc.localhost; img-src 'self' asset: http://asset.localhost\"` to use the asset protocol on image sources.\n *\n * Additionally, `\"enable\" : \"true\"` must be added to [`app.security.assetProtocol`](https://v2.tauri.app/reference/config/#assetprotocolconfig)\n * in `tauri.conf.json` and its access scope must be defined on the `scope` array on the same `assetProtocol` object.\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/core';\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_INTERNALS__.convertFileSrc(filePath, protocol);\n}\n/**\n * A rust-backed resource stored through `tauri::Manager::resources_table` API.\n *\n * The resource lives in the main process and does not exist\n * in the Javascript world, and thus will not be cleaned up automatically\n * except on application exit. If you want to clean it up early, call {@linkcode Resource.close}\n *\n * @example\n * ```typescript\n * import { Resource, invoke } from '@tauri-apps/api/core';\n * export class DatabaseHandle extends Resource {\n * static async open(path: string): Promise<DatabaseHandle> {\n * const rid: number = await invoke('open_db', { path });\n * return new DatabaseHandle(rid);\n * }\n *\n * async execute(sql: string): Promise<void> {\n * await invoke('execute_sql', { rid: this.rid, sql });\n * }\n * }\n * ```\n */\nclass Resource {\n get rid() {\n return __classPrivateFieldGet(this, _Resource_rid, \"f\");\n }\n constructor(rid) {\n _Resource_rid.set(this, void 0);\n __classPrivateFieldSet(this, _Resource_rid, rid, \"f\");\n }\n /**\n * Destroys and cleans up this resource from memory.\n * **You should not call any method on this object anymore and should drop any reference to it.**\n */\n async close() {\n return invoke('plugin:resources|close', {\n rid: this.rid\n });\n }\n}\n_Resource_rid = new WeakMap();\nfunction isTauri() {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access\n return !!(globalThis || window).isTauri;\n}\n\nexport { Channel, PluginListener, Resource, SERIALIZE_TO_IPC_FN, addPluginListener, checkPermissions, convertFileSrc, invoke, isTauri, requestPermissions, transformCallback };\n","import { invoke, transformCallback } from './core.js';\n\n// Copyright 2019-2024 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 [`app.withGlobalTauri`](https://v2.tauri.app/reference/config/#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_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_CREATED\"] = \"tauri://window-created\";\n TauriEvent[\"WEBVIEW_CREATED\"] = \"tauri://webview-created\";\n TauriEvent[\"DRAG_ENTER\"] = \"tauri://drag-enter\";\n TauriEvent[\"DRAG_OVER\"] = \"tauri://drag-over\";\n TauriEvent[\"DRAG_DROP\"] = \"tauri://drag-drop\";\n TauriEvent[\"DRAG_LEAVE\"] = \"tauri://drag-leave\";\n})(TauriEvent || (TauriEvent = {}));\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 window.__TAURI_EVENT_PLUGIN_INTERNALS__.unregisterListener(event, eventId);\n await invoke('plugin:event|unlisten', {\n event,\n eventId\n });\n}\n/**\n * Listen to an emitted event to any {@link EventTarget|target}.\n *\n * @example\n * ```typescript\n * import { listen } from '@tauri-apps/api/event';\n * const unlisten = await listen<string>('error', (event) => {\n * console.log(`Got error, 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 * @param options Event listening options.\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, options) {\n var _a;\n const target = typeof (options === null || options === void 0 ? void 0 : options.target) === 'string'\n ? { kind: 'AnyLabel', label: options.target }\n : ((_a = options === null || options === void 0 ? void 0 : options.target) !== null && _a !== void 0 ? _a : { kind: 'Any' });\n return invoke('plugin:event|listen', {\n event,\n target,\n handler: transformCallback(handler)\n }).then((eventId) => {\n return async () => _unlisten(event, eventId);\n });\n}\n/**\n * Listens once to an emitted event to any {@link EventTarget|target}.\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<LoadedPayload>('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 * @param handler Event handler callback.\n * @param options Event listening options.\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, options) {\n return listen(event, (eventData) => {\n void _unlisten(event, eventData.id);\n handler(eventData);\n }, options);\n}\n/**\n * Emits an event to all {@link EventTarget|targets}.\n *\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 * @param payload Event payload.\n *\n * @since 1.0.0\n */\nasync function emit(event, payload) {\n await invoke('plugin:event|emit', {\n event,\n payload\n });\n}\n/**\n * Emits an event to all {@link EventTarget|targets} matching the given target.\n *\n * @example\n * ```typescript\n * import { emitTo } from '@tauri-apps/api/event';\n * await emitTo('main', 'frontend-loaded', { loggedIn: true, token: 'authToken' });\n * ```\n *\n * @param target Label of the target Window/Webview/WebviewWindow or raw {@link EventTarget} object.\n * @param event Event name. Must include only alphanumeric characters, `-`, `/`, `:` and `_`.\n * @param payload Event payload.\n *\n * @since 2.0.0\n */\nasync function emitTo(target, event, payload) {\n const eventTarget = typeof target === 'string' ? { kind: 'AnyLabel', label: target } : target;\n await invoke('plugin:event|emit_to', {\n target: eventTarget,\n event,\n payload\n });\n}\n\nexport { TauriEvent, emit, emitTo, listen, once };\n","import { listen } from '@tauri-apps/api/event';\nimport { Resource, invoke } from '@tauri-apps/api/core';\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 * Create a new Store or load the existing store with the path.\n *\n * @example\n * ```typescript\n * import { Store } from '@tauri-apps/api/store';\n * const store = await Store.load('store.json');\n * ```\n *\n * @param path Path to save the store in `app_data_dir`\n * @param options Store configuration options\n */\nasync function load(path, options) {\n return await Store.load(path, options);\n}\n/**\n * Gets an already loaded store.\n *\n * If the store is not loaded, returns `null`. In this case you must {@link Store.load load} it.\n *\n * This function is more useful when you already know the store is loaded\n * and just need to access its instance. Prefer {@link Store.load} otherwise.\n *\n * @example\n * ```typescript\n * import { getStore } from '@tauri-apps/api/store';\n * const store = await getStore('store.json');\n * ```\n *\n * @param path Path of the store.\n */\nasync function getStore(path) {\n return await Store.get(path);\n}\n/**\n * A lazy loaded key-value store persisted by the backend layer.\n */\nclass LazyStore {\n get store() {\n if (!this._store) {\n this._store = load(this.path, this.options);\n }\n return this._store;\n }\n /**\n * Note that the options are not applied if someone else already created the store\n * @param path Path to save the store in `app_data_dir`\n * @param options Store configuration options\n */\n constructor(path, options) {\n this.path = path;\n this.options = options;\n }\n /**\n * Init/load the store if it's not loaded already\n */\n async init() {\n await this.store;\n }\n async set(key, value) {\n return (await this.store).set(key, value);\n }\n async get(key) {\n return (await this.store).get(key);\n }\n async has(key) {\n return (await this.store).has(key);\n }\n async delete(key) {\n return (await this.store).delete(key);\n }\n async clear() {\n await (await this.store).clear();\n }\n async reset() {\n await (await this.store).reset();\n }\n async keys() {\n return (await this.store).keys();\n }\n async values() {\n return (await this.store).values();\n }\n async entries() {\n return (await this.store).entries();\n }\n async length() {\n return (await this.store).length();\n }\n async reload(options) {\n await (await this.store).reload(options);\n }\n async save() {\n await (await this.store).save();\n }\n async onKeyChange(key, cb) {\n return (await this.store).onKeyChange(key, cb);\n }\n async onChange(cb) {\n return (await this.store).onChange(cb);\n }\n async close() {\n if (this._store) {\n await (await this._store).close();\n }\n }\n}\n/**\n * A key-value store persisted by the backend layer.\n */\nclass Store extends Resource {\n constructor(rid) {\n super(rid);\n }\n /**\n * Create a new Store or load the existing store with the path.\n *\n * @example\n * ```typescript\n * import { Store } from '@tauri-apps/api/store';\n * const store = await Store.load('store.json');\n * ```\n *\n * @param path Path to save the store in `app_data_dir`\n * @param options Store configuration options\n */\n static async load(path, options) {\n const rid = await invoke('plugin:store|load', {\n path,\n options\n });\n return new Store(rid);\n }\n /**\n * Gets an already loaded store.\n *\n * If the store is not loaded, returns `null`. In this case you must {@link Store.load load} it.\n *\n * This function is more useful when you already know the store is loaded\n * and just need to access its instance. Prefer {@link Store.load} otherwise.\n *\n * @example\n * ```typescript\n * import { Store } from '@tauri-apps/api/store';\n * let store = await Store.get('store.json');\n * if (!store) {\n * store = await Store.load('store.json');\n * }\n * ```\n *\n * @param path Path of the store.\n */\n static async get(path) {\n return await invoke('plugin:store|get_store', { path }).then((rid) => (rid ? new Store(rid) : null));\n }\n async set(key, value) {\n await invoke('plugin:store|set', {\n rid: this.rid,\n key,\n value\n });\n }\n async get(key) {\n const [value, exists] = await invoke('plugin:store|get', {\n rid: this.rid,\n key\n });\n return exists ? value : undefined;\n }\n async has(key) {\n return await invoke('plugin:store|has', {\n rid: this.rid,\n key\n });\n }\n async delete(key) {\n return await invoke('plugin:store|delete', {\n rid: this.rid,\n key\n });\n }\n async clear() {\n await invoke('plugin:store|clear', { rid: this.rid });\n }\n async reset() {\n await invoke('plugin:store|reset', { rid: this.rid });\n }\n async keys() {\n return await invoke('plugin:store|keys', { rid: this.rid });\n }\n async values() {\n return await invoke('plugin:store|values', { rid: this.rid });\n }\n async entries() {\n return await invoke('plugin:store|entries', { rid: this.rid });\n }\n async length() {\n return await invoke('plugin:store|length', { rid: this.rid });\n }\n async reload(options) {\n await invoke('plugin:store|reload', { rid: this.rid, ...options });\n }\n async save() {\n await invoke('plugin:store|save', { rid: this.rid });\n }\n async onKeyChange(key, cb) {\n return await listen('store://change', (event) => {\n if (event.payload.resourceId === this.rid && event.payload.key === key) {\n cb(event.payload.exists ? event.payload.value : undefined);\n }\n });\n }\n async onChange(cb) {\n return await listen('store://change', (event) => {\n if (event.payload.resourceId === this.rid) {\n cb(event.payload.key, event.payload.exists ? event.payload.value : undefined);\n }\n });\n }\n}\n\nexport { LazyStore, Store, getStore, load };\n"],"names":["__classPrivateFieldGet","receiver","state","kind","f","__classPrivateFieldSet","value","_Resource_rid","transformCallback","callback","once","invoke","cmd","args","options","Resource","rid","TauriEvent","_unlisten","event","eventId","listen","handler","_a","target","load","path","Store","getStore","LazyStore","key","cb","exists"],"mappings":"AAiBA,SAASA,EAAuBC,EAAUC,EAAOC,EAAMC,EAAG,CAEtD,GAAI,OAAOF,GAAU,WAAaD,IAAaC,GAAS,CAACE,EAAI,CAACF,EAAM,IAAID,CAAQ,EAAG,MAAM,IAAI,UAAU,0EAA0E,EACjL,OAA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