diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f327af3 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +node_modules/* +package-lock.json +yarn.lock +unpackage diff --git a/node_modules/.bin/vue-demi-fix b/node_modules/.bin/vue-demi-fix deleted file mode 100644 index dba2771..0000000 --- a/node_modules/.bin/vue-demi-fix +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../vue-demi/bin/vue-demi-fix.js" "$@" -else - exec node "$basedir/../vue-demi/bin/vue-demi-fix.js" "$@" -fi diff --git a/node_modules/.bin/vue-demi-fix.cmd b/node_modules/.bin/vue-demi-fix.cmd deleted file mode 100644 index 567cf78..0000000 --- a/node_modules/.bin/vue-demi-fix.cmd +++ /dev/null @@ -1,17 +0,0 @@ -@ECHO off -GOTO start -:find_dp0 -SET dp0=%~dp0 -EXIT /b -:start -SETLOCAL -CALL :find_dp0 - -IF EXIST "%dp0%\node.exe" ( - SET "_prog=%dp0%\node.exe" -) ELSE ( - SET "_prog=node" - SET PATHEXT=%PATHEXT:;.JS;=;% -) - -endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\vue-demi\bin\vue-demi-fix.js" %* diff --git a/node_modules/.bin/vue-demi-fix.ps1 b/node_modules/.bin/vue-demi-fix.ps1 deleted file mode 100644 index adecc34..0000000 --- a/node_modules/.bin/vue-demi-fix.ps1 +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env pwsh -$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent - -$exe="" -if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { - # Fix case when both the Windows and Linux builds of Node - # are installed in the same directory - $exe=".exe" -} -$ret=0 -if (Test-Path "$basedir/node$exe") { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "$basedir/node$exe" "$basedir/../vue-demi/bin/vue-demi-fix.js" $args - } else { - & "$basedir/node$exe" "$basedir/../vue-demi/bin/vue-demi-fix.js" $args - } - $ret=$LASTEXITCODE -} else { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "node$exe" "$basedir/../vue-demi/bin/vue-demi-fix.js" $args - } else { - & "node$exe" "$basedir/../vue-demi/bin/vue-demi-fix.js" $args - } - $ret=$LASTEXITCODE -} -exit $ret diff --git a/node_modules/.bin/vue-demi-switch b/node_modules/.bin/vue-demi-switch deleted file mode 100644 index 458c052..0000000 --- a/node_modules/.bin/vue-demi-switch +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../vue-demi/bin/vue-demi-switch.js" "$@" -else - exec node "$basedir/../vue-demi/bin/vue-demi-switch.js" "$@" -fi diff --git a/node_modules/.bin/vue-demi-switch.cmd b/node_modules/.bin/vue-demi-switch.cmd deleted file mode 100644 index fce7991..0000000 --- a/node_modules/.bin/vue-demi-switch.cmd +++ /dev/null @@ -1,17 +0,0 @@ -@ECHO off -GOTO start -:find_dp0 -SET dp0=%~dp0 -EXIT /b -:start -SETLOCAL -CALL :find_dp0 - -IF EXIST "%dp0%\node.exe" ( - SET "_prog=%dp0%\node.exe" -) ELSE ( - SET "_prog=node" - SET PATHEXT=%PATHEXT:;.JS;=;% -) - -endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\vue-demi\bin\vue-demi-switch.js" %* diff --git a/node_modules/.bin/vue-demi-switch.ps1 b/node_modules/.bin/vue-demi-switch.ps1 deleted file mode 100644 index fbb4d69..0000000 --- a/node_modules/.bin/vue-demi-switch.ps1 +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env pwsh -$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent - -$exe="" -if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { - # Fix case when both the Windows and Linux builds of Node - # are installed in the same directory - $exe=".exe" -} -$ret=0 -if (Test-Path "$basedir/node$exe") { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "$basedir/node$exe" "$basedir/../vue-demi/bin/vue-demi-switch.js" $args - } else { - & "$basedir/node$exe" "$basedir/../vue-demi/bin/vue-demi-switch.js" $args - } - $ret=$LASTEXITCODE -} else { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "node$exe" "$basedir/../vue-demi/bin/vue-demi-switch.js" $args - } else { - & "node$exe" "$basedir/../vue-demi/bin/vue-demi-switch.js" $args - } - $ret=$LASTEXITCODE -} -exit $ret diff --git a/node_modules/.package-lock.json b/node_modules/.package-lock.json deleted file mode 100644 index 58bb735..0000000 --- a/node_modules/.package-lock.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "name": "version-record", - "version": "1.0.0", - "lockfileVersion": 2, - "requires": true, - "packages": { - "node_modules/@vue/devtools-api": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@vue/devtools-api/-/devtools-api-6.5.0.tgz", - "integrity": "sha512-o9KfBeaBmCKl10usN4crU53fYtC1r7jJwdGKjPT24t348rHxgfpZ0xL3Xm/gLUYnc0oTp8LAmrxOeLyu6tbk2Q==" - }, - "node_modules/pinia": { - "version": "2.1.6", - "resolved": "https://registry.npmjs.org/pinia/-/pinia-2.1.6.tgz", - "integrity": "sha512-bIU6QuE5qZviMmct5XwCesXelb5VavdOWKWaB17ggk++NUwQWWbP5YnsONTk3b752QkW9sACiR81rorpeOMSvQ==", - "dependencies": { - "@vue/devtools-api": "^6.5.0", - "vue-demi": ">=0.14.5" - }, - "funding": { - "url": "https://github.com/sponsors/posva" - }, - "peerDependencies": { - "@vue/composition-api": "^1.4.0", - "typescript": ">=4.4.4", - "vue": "^2.6.14 || ^3.3.0" - }, - "peerDependenciesMeta": { - "@vue/composition-api": { - "optional": true - }, - "typescript": { - "optional": true - } - } - }, - "node_modules/vue": { - "version": "2.6.14", - "resolved": "https://registry.npmjs.org/vue/-/vue-2.6.14.tgz", - "integrity": "sha512-x2284lgYvjOMj3Za7kqzRcUSxBboHqtgRE2zlos1qWaOye5yUmHn42LB1250NJBLRwEcdrB0JRwyPTEPhfQjiQ==", - "peer": true - }, - "node_modules/vue-demi": { - "version": "0.14.6", - "resolved": "https://registry.npmjs.org/vue-demi/-/vue-demi-0.14.6.tgz", - "integrity": "sha512-8QA7wrYSHKaYgUxDA5ZC24w+eHm3sYCbp0EzcDwKqN3p6HqtTCGR/GVsPyZW92unff4UlcSh++lmqDWN3ZIq4w==", - "hasInstallScript": true, - "bin": { - "vue-demi-fix": "bin/vue-demi-fix.js", - "vue-demi-switch": "bin/vue-demi-switch.js" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/antfu" - }, - "peerDependencies": { - "@vue/composition-api": "^1.0.0-rc.1", - "vue": "^3.0.0-0 || ^2.6.0" - }, - "peerDependenciesMeta": { - "@vue/composition-api": { - "optional": true - } - } - } - } -} diff --git a/node_modules/@vue/devtools-api/lib/cjs/api/api.js b/node_modules/@vue/devtools-api/lib/cjs/api/api.js deleted file mode 100644 index c8ad2e5..0000000 --- a/node_modules/@vue/devtools-api/lib/cjs/api/api.js +++ /dev/null @@ -1,2 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@vue/devtools-api/lib/cjs/api/app.js b/node_modules/@vue/devtools-api/lib/cjs/api/app.js deleted file mode 100644 index c8ad2e5..0000000 --- a/node_modules/@vue/devtools-api/lib/cjs/api/app.js +++ /dev/null @@ -1,2 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@vue/devtools-api/lib/cjs/api/component.js b/node_modules/@vue/devtools-api/lib/cjs/api/component.js deleted file mode 100644 index c8ad2e5..0000000 --- a/node_modules/@vue/devtools-api/lib/cjs/api/component.js +++ /dev/null @@ -1,2 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@vue/devtools-api/lib/cjs/api/context.js b/node_modules/@vue/devtools-api/lib/cjs/api/context.js deleted file mode 100644 index c8ad2e5..0000000 --- a/node_modules/@vue/devtools-api/lib/cjs/api/context.js +++ /dev/null @@ -1,2 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@vue/devtools-api/lib/cjs/api/hooks.js b/node_modules/@vue/devtools-api/lib/cjs/api/hooks.js deleted file mode 100644 index c8ad2e5..0000000 --- a/node_modules/@vue/devtools-api/lib/cjs/api/hooks.js +++ /dev/null @@ -1,2 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@vue/devtools-api/lib/cjs/api/index.js b/node_modules/@vue/devtools-api/lib/cjs/api/index.js deleted file mode 100644 index 22f7589..0000000 --- a/node_modules/@vue/devtools-api/lib/cjs/api/index.js +++ /dev/null @@ -1,22 +0,0 @@ -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -__exportStar(require("./api.js"), exports); -__exportStar(require("./app.js"), exports); -__exportStar(require("./component.js"), exports); -__exportStar(require("./context.js"), exports); -__exportStar(require("./hooks.js"), exports); -__exportStar(require("./util.js"), exports); diff --git a/node_modules/@vue/devtools-api/lib/cjs/api/util.js b/node_modules/@vue/devtools-api/lib/cjs/api/util.js deleted file mode 100644 index c8ad2e5..0000000 --- a/node_modules/@vue/devtools-api/lib/cjs/api/util.js +++ /dev/null @@ -1,2 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@vue/devtools-api/lib/cjs/const.js b/node_modules/@vue/devtools-api/lib/cjs/const.js deleted file mode 100644 index 84d408c..0000000 --- a/node_modules/@vue/devtools-api/lib/cjs/const.js +++ /dev/null @@ -1,5 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.HOOK_PLUGIN_SETTINGS_SET = exports.HOOK_SETUP = void 0; -exports.HOOK_SETUP = 'devtools-plugin:setup'; -exports.HOOK_PLUGIN_SETTINGS_SET = 'plugin:settings:set'; diff --git a/node_modules/@vue/devtools-api/lib/cjs/env.js b/node_modules/@vue/devtools-api/lib/cjs/env.js deleted file mode 100644 index 178d457..0000000 --- a/node_modules/@vue/devtools-api/lib/cjs/env.js +++ /dev/null @@ -1,17 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.isProxyAvailable = exports.getTarget = exports.getDevtoolsGlobalHook = void 0; -function getDevtoolsGlobalHook() { - return getTarget().__VUE_DEVTOOLS_GLOBAL_HOOK__; -} -exports.getDevtoolsGlobalHook = getDevtoolsGlobalHook; -function getTarget() { - // @ts-ignore - return (typeof navigator !== 'undefined' && typeof window !== 'undefined') - ? window - : typeof global !== 'undefined' - ? global - : {}; -} -exports.getTarget = getTarget; -exports.isProxyAvailable = typeof Proxy === 'function'; diff --git a/node_modules/@vue/devtools-api/lib/cjs/index.js b/node_modules/@vue/devtools-api/lib/cjs/index.js deleted file mode 100644 index 249ac4d..0000000 --- a/node_modules/@vue/devtools-api/lib/cjs/index.js +++ /dev/null @@ -1,44 +0,0 @@ -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.setupDevtoolsPlugin = void 0; -const env_js_1 = require("./env.js"); -const const_js_1 = require("./const.js"); -const proxy_js_1 = require("./proxy.js"); -__exportStar(require("./api/index.js"), exports); -__exportStar(require("./plugin.js"), exports); -__exportStar(require("./time.js"), exports); -function setupDevtoolsPlugin(pluginDescriptor, setupFn) { - const descriptor = pluginDescriptor; - const target = (0, env_js_1.getTarget)(); - const hook = (0, env_js_1.getDevtoolsGlobalHook)(); - const enableProxy = env_js_1.isProxyAvailable && descriptor.enableEarlyProxy; - if (hook && (target.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__ || !enableProxy)) { - hook.emit(const_js_1.HOOK_SETUP, pluginDescriptor, setupFn); - } - else { - const proxy = enableProxy ? new proxy_js_1.ApiProxy(descriptor, hook) : null; - const list = target.__VUE_DEVTOOLS_PLUGINS__ = target.__VUE_DEVTOOLS_PLUGINS__ || []; - list.push({ - pluginDescriptor: descriptor, - setupFn, - proxy, - }); - if (proxy) - setupFn(proxy.proxiedTarget); - } -} -exports.setupDevtoolsPlugin = setupDevtoolsPlugin; diff --git a/node_modules/@vue/devtools-api/lib/cjs/plugin.js b/node_modules/@vue/devtools-api/lib/cjs/plugin.js deleted file mode 100644 index c8ad2e5..0000000 --- a/node_modules/@vue/devtools-api/lib/cjs/plugin.js +++ /dev/null @@ -1,2 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@vue/devtools-api/lib/cjs/proxy.js b/node_modules/@vue/devtools-api/lib/cjs/proxy.js deleted file mode 100644 index 5385e60..0000000 --- a/node_modules/@vue/devtools-api/lib/cjs/proxy.js +++ /dev/null @@ -1,111 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ApiProxy = void 0; -const const_js_1 = require("./const.js"); -const time_js_1 = require("./time.js"); -class ApiProxy { - constructor(plugin, hook) { - this.target = null; - this.targetQueue = []; - this.onQueue = []; - this.plugin = plugin; - this.hook = hook; - const defaultSettings = {}; - if (plugin.settings) { - for (const id in plugin.settings) { - const item = plugin.settings[id]; - defaultSettings[id] = item.defaultValue; - } - } - const localSettingsSaveId = `__vue-devtools-plugin-settings__${plugin.id}`; - let currentSettings = Object.assign({}, defaultSettings); - try { - const raw = localStorage.getItem(localSettingsSaveId); - const data = JSON.parse(raw); - Object.assign(currentSettings, data); - } - catch (e) { - // noop - } - this.fallbacks = { - getSettings() { - return currentSettings; - }, - setSettings(value) { - try { - localStorage.setItem(localSettingsSaveId, JSON.stringify(value)); - } - catch (e) { - // noop - } - currentSettings = value; - }, - now() { - return (0, time_js_1.now)(); - }, - }; - if (hook) { - hook.on(const_js_1.HOOK_PLUGIN_SETTINGS_SET, (pluginId, value) => { - if (pluginId === this.plugin.id) { - this.fallbacks.setSettings(value); - } - }); - } - this.proxiedOn = new Proxy({}, { - get: (_target, prop) => { - if (this.target) { - return this.target.on[prop]; - } - else { - return (...args) => { - this.onQueue.push({ - method: prop, - args, - }); - }; - } - }, - }); - this.proxiedTarget = new Proxy({}, { - get: (_target, prop) => { - if (this.target) { - return this.target[prop]; - } - else if (prop === 'on') { - return this.proxiedOn; - } - else if (Object.keys(this.fallbacks).includes(prop)) { - return (...args) => { - this.targetQueue.push({ - method: prop, - args, - resolve: () => { }, - }); - return this.fallbacks[prop](...args); - }; - } - else { - return (...args) => { - return new Promise(resolve => { - this.targetQueue.push({ - method: prop, - args, - resolve, - }); - }); - }; - } - }, - }); - } - async setRealTarget(target) { - this.target = target; - for (const item of this.onQueue) { - this.target.on[item.method](...item.args); - } - for (const item of this.targetQueue) { - item.resolve(await this.target[item.method](...item.args)); - } - } -} -exports.ApiProxy = ApiProxy; diff --git a/node_modules/@vue/devtools-api/lib/cjs/time.js b/node_modules/@vue/devtools-api/lib/cjs/time.js deleted file mode 100644 index 5b17a25..0000000 --- a/node_modules/@vue/devtools-api/lib/cjs/time.js +++ /dev/null @@ -1,28 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.now = exports.isPerformanceSupported = void 0; -let supported; -let perf; -function isPerformanceSupported() { - var _a; - if (supported !== undefined) { - return supported; - } - if (typeof window !== 'undefined' && window.performance) { - supported = true; - perf = window.performance; - } - else if (typeof global !== 'undefined' && ((_a = global.perf_hooks) === null || _a === void 0 ? void 0 : _a.performance)) { - supported = true; - perf = global.perf_hooks.performance; - } - else { - supported = false; - } - return supported; -} -exports.isPerformanceSupported = isPerformanceSupported; -function now() { - return isPerformanceSupported() ? perf.now() : Date.now(); -} -exports.now = now; diff --git a/node_modules/@vue/devtools-api/lib/esm/api/api.d.ts b/node_modules/@vue/devtools-api/lib/esm/api/api.d.ts deleted file mode 100644 index 071312a..0000000 --- a/node_modules/@vue/devtools-api/lib/esm/api/api.d.ts +++ /dev/null @@ -1,108 +0,0 @@ -import type { ComponentBounds, Hookable } from './hooks.js'; -import type { Context } from './context.js'; -import type { ComponentInstance, ComponentState, StateBase } from './component.js'; -import type { App } from './app.js'; -import type { ID } from './util.js'; -export interface DevtoolsPluginApi { - on: Hookable; - notifyComponentUpdate(instance?: ComponentInstance): void; - addTimelineLayer(options: TimelineLayerOptions): void; - addTimelineEvent(options: TimelineEventOptions): void; - addInspector(options: CustomInspectorOptions): void; - sendInspectorTree(inspectorId: string): void; - sendInspectorState(inspectorId: string): void; - selectInspectorNode(inspectorId: string, nodeId: string): void; - getComponentBounds(instance: ComponentInstance): Promise; - getComponentName(instance: ComponentInstance): Promise; - getComponentInstances(app: App): Promise; - highlightElement(instance: ComponentInstance): void; - unhighlightElement(): void; - getSettings(pluginId?: string): TSettings; - now(): number; - /** - * @private Not implemented yet - */ - setSettings(values: TSettings): void; -} -export interface AppRecord { - id: string; - name: string; - instanceMap: Map; - rootInstance: ComponentInstance; -} -export interface TimelineLayerOptions { - id: string; - label: string; - color: number; - skipScreenshots?: boolean; - groupsOnly?: boolean; - ignoreNoDurationGroups?: boolean; - screenshotOverlayRender?: (event: TimelineEvent & ScreenshotOverlayEvent, ctx: ScreenshotOverlayRenderContext) => ScreenshotOverlayRenderResult | Promise; -} -export interface ScreenshotOverlayEvent { - layerId: string; - renderMeta: any; -} -export interface ScreenshotOverlayRenderContext { - screenshot: ScreenshotData; - events: (TimelineEvent & ScreenshotOverlayEvent)[]; - index: number; -} -export declare type ScreenshotOverlayRenderResult = HTMLElement | string | false; -export interface ScreenshotData { - time: number; -} -export interface TimelineEventOptions { - layerId: string; - event: TimelineEvent; - all?: boolean; -} -export interface TimelineEvent { - time: number; - data: TData; - logType?: 'default' | 'warning' | 'error'; - meta?: TMeta; - groupId?: ID; - title?: string; - subtitle?: string; -} -export interface TimelineMarkerOptions { - id: string; - time: number; - color: number; - label: string; - all?: boolean; -} -export interface CustomInspectorOptions { - id: string; - label: string; - icon?: string; - treeFilterPlaceholder?: string; - stateFilterPlaceholder?: string; - noSelectionText?: string; - actions?: { - icon: string; - tooltip?: string; - action: () => void | Promise; - }[]; - nodeActions?: { - icon: string; - tooltip?: string; - action: (nodeId: string) => void | Promise; - }[]; -} -export interface CustomInspectorNode { - id: string; - label: string; - children?: CustomInspectorNode[]; - tags?: InspectorNodeTag[]; -} -export interface InspectorNodeTag { - label: string; - textColor: number; - backgroundColor: number; - tooltip?: string; -} -export interface CustomInspectorState { - [key: string]: (StateBase | Omit)[]; -} diff --git a/node_modules/@vue/devtools-api/lib/esm/api/api.js b/node_modules/@vue/devtools-api/lib/esm/api/api.js deleted file mode 100644 index cb0ff5c..0000000 --- a/node_modules/@vue/devtools-api/lib/esm/api/api.js +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/node_modules/@vue/devtools-api/lib/esm/api/app.d.ts b/node_modules/@vue/devtools-api/lib/esm/api/app.d.ts deleted file mode 100644 index 42638c0..0000000 --- a/node_modules/@vue/devtools-api/lib/esm/api/app.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare type App = any; diff --git a/node_modules/@vue/devtools-api/lib/esm/api/app.js b/node_modules/@vue/devtools-api/lib/esm/api/app.js deleted file mode 100644 index cb0ff5c..0000000 --- a/node_modules/@vue/devtools-api/lib/esm/api/app.js +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/node_modules/@vue/devtools-api/lib/esm/api/component.d.ts b/node_modules/@vue/devtools-api/lib/esm/api/component.d.ts deleted file mode 100644 index 335dd04..0000000 --- a/node_modules/@vue/devtools-api/lib/esm/api/component.d.ts +++ /dev/null @@ -1,78 +0,0 @@ -import type { InspectorNodeTag } from './api.js'; -import type { ID } from './util.js'; -export declare type ComponentInstance = any; -export interface ComponentTreeNode { - uid: ID; - id: string; - name: string; - renderKey: string | number; - inactive: boolean; - isFragment: boolean; - hasChildren: boolean; - children: ComponentTreeNode[]; - domOrder?: number[]; - consoleId?: string; - isRouterView?: boolean; - macthedRouteSegment?: string; - tags: InspectorNodeTag[]; - autoOpen: boolean; - meta?: any; -} -export interface InspectedComponentData { - id: string; - name: string; - file: string; - state: ComponentState[]; - functional?: boolean; -} -export interface StateBase { - key: string; - value: any; - editable?: boolean; - objectType?: 'ref' | 'reactive' | 'computed' | 'other'; - raw?: string; -} -export interface ComponentStateBase extends StateBase { - type: string; -} -export interface ComponentPropState extends ComponentStateBase { - meta?: { - type: string; - required: boolean; - /** Vue 1 only */ - mode?: 'default' | 'sync' | 'once'; - }; -} -export declare type ComponentBuiltinCustomStateTypes = 'function' | 'map' | 'set' | 'reference' | 'component' | 'component-definition' | 'router' | 'store'; -export interface ComponentCustomState extends ComponentStateBase { - value: CustomState; -} -export declare type CustomState = { - _custom: { - type: ComponentBuiltinCustomStateTypes | string; - objectType?: string; - display?: string; - tooltip?: string; - value?: any; - abstract?: boolean; - file?: string; - uid?: number; - readOnly?: boolean; - /** Configure immediate child fields */ - fields?: { - abstract?: boolean; - }; - id?: any; - actions?: { - icon: string; - tooltip?: string; - action: () => void | Promise; - }[]; - /** internal */ - _reviveId?: number; - }; -}; -export declare type ComponentState = ComponentStateBase | ComponentPropState | ComponentCustomState; -export interface ComponentDevtoolsOptions { - hide?: boolean; -} diff --git a/node_modules/@vue/devtools-api/lib/esm/api/component.js b/node_modules/@vue/devtools-api/lib/esm/api/component.js deleted file mode 100644 index cb0ff5c..0000000 --- a/node_modules/@vue/devtools-api/lib/esm/api/component.js +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/node_modules/@vue/devtools-api/lib/esm/api/context.d.ts b/node_modules/@vue/devtools-api/lib/esm/api/context.d.ts deleted file mode 100644 index 29388f1..0000000 --- a/node_modules/@vue/devtools-api/lib/esm/api/context.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { AppRecord } from './api.js'; -export interface Context { - currentTab: string; - currentAppRecord: AppRecord; -} diff --git a/node_modules/@vue/devtools-api/lib/esm/api/context.js b/node_modules/@vue/devtools-api/lib/esm/api/context.js deleted file mode 100644 index cb0ff5c..0000000 --- a/node_modules/@vue/devtools-api/lib/esm/api/context.js +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/node_modules/@vue/devtools-api/lib/esm/api/hooks.d.ts b/node_modules/@vue/devtools-api/lib/esm/api/hooks.d.ts deleted file mode 100644 index c980b13..0000000 --- a/node_modules/@vue/devtools-api/lib/esm/api/hooks.d.ts +++ /dev/null @@ -1,180 +0,0 @@ -import type { ComponentTreeNode, InspectedComponentData, ComponentInstance, ComponentDevtoolsOptions } from './component.js'; -import type { App } from './app.js'; -import type { CustomInspectorNode, CustomInspectorState, TimelineEvent } from './api.js'; -export declare const enum Hooks { - TRANSFORM_CALL = "transformCall", - GET_APP_RECORD_NAME = "getAppRecordName", - GET_APP_ROOT_INSTANCE = "getAppRootInstance", - REGISTER_APPLICATION = "registerApplication", - WALK_COMPONENT_TREE = "walkComponentTree", - VISIT_COMPONENT_TREE = "visitComponentTree", - WALK_COMPONENT_PARENTS = "walkComponentParents", - INSPECT_COMPONENT = "inspectComponent", - GET_COMPONENT_BOUNDS = "getComponentBounds", - GET_COMPONENT_NAME = "getComponentName", - GET_COMPONENT_INSTANCES = "getComponentInstances", - GET_ELEMENT_COMPONENT = "getElementComponent", - GET_COMPONENT_ROOT_ELEMENTS = "getComponentRootElements", - EDIT_COMPONENT_STATE = "editComponentState", - GET_COMPONENT_DEVTOOLS_OPTIONS = "getAppDevtoolsOptions", - GET_COMPONENT_RENDER_CODE = "getComponentRenderCode", - INSPECT_TIMELINE_EVENT = "inspectTimelineEvent", - TIMELINE_CLEARED = "timelineCleared", - GET_INSPECTOR_TREE = "getInspectorTree", - GET_INSPECTOR_STATE = "getInspectorState", - EDIT_INSPECTOR_STATE = "editInspectorState", - SET_PLUGIN_SETTINGS = "setPluginSettings" -} -export interface ComponentBounds { - left: number; - top: number; - width: number; - height: number; -} -export declare type HookPayloads = { - [Hooks.TRANSFORM_CALL]: { - callName: string; - inArgs: any[]; - outArgs: any[]; - }; - [Hooks.GET_APP_RECORD_NAME]: { - app: App; - name: string; - }; - [Hooks.GET_APP_ROOT_INSTANCE]: { - app: App; - root: ComponentInstance; - }; - [Hooks.REGISTER_APPLICATION]: { - app: App; - }; - [Hooks.WALK_COMPONENT_TREE]: { - componentInstance: ComponentInstance; - componentTreeData: ComponentTreeNode[]; - maxDepth: number; - filter: string; - recursively: boolean; - }; - [Hooks.VISIT_COMPONENT_TREE]: { - app: App; - componentInstance: ComponentInstance; - treeNode: ComponentTreeNode; - filter: string; - }; - [Hooks.WALK_COMPONENT_PARENTS]: { - componentInstance: ComponentInstance; - parentInstances: ComponentInstance[]; - }; - [Hooks.INSPECT_COMPONENT]: { - app: App; - componentInstance: ComponentInstance; - instanceData: InspectedComponentData; - }; - [Hooks.GET_COMPONENT_BOUNDS]: { - componentInstance: ComponentInstance; - bounds: ComponentBounds; - }; - [Hooks.GET_COMPONENT_NAME]: { - componentInstance: ComponentInstance; - name: string; - }; - [Hooks.GET_COMPONENT_INSTANCES]: { - app: App; - componentInstances: ComponentInstance[]; - }; - [Hooks.GET_ELEMENT_COMPONENT]: { - element: HTMLElement | any; - componentInstance: ComponentInstance; - }; - [Hooks.GET_COMPONENT_ROOT_ELEMENTS]: { - componentInstance: ComponentInstance; - rootElements: (HTMLElement | any)[]; - }; - [Hooks.EDIT_COMPONENT_STATE]: { - app: App; - componentInstance: ComponentInstance; - path: string[]; - type: string; - state: EditStatePayload; - set: (object: any, path?: string | (string[]), value?: any, cb?: (object: any, field: string, value: any) => void) => void; - }; - [Hooks.GET_COMPONENT_DEVTOOLS_OPTIONS]: { - componentInstance: ComponentInstance; - options: ComponentDevtoolsOptions; - }; - [Hooks.GET_COMPONENT_RENDER_CODE]: { - componentInstance: ComponentInstance; - code: string; - }; - [Hooks.INSPECT_TIMELINE_EVENT]: { - app: App; - layerId: string; - event: TimelineEvent; - all?: boolean; - data: any; - }; - [Hooks.TIMELINE_CLEARED]: Record; - [Hooks.GET_INSPECTOR_TREE]: { - app: App; - inspectorId: string; - filter: string; - rootNodes: CustomInspectorNode[]; - }; - [Hooks.GET_INSPECTOR_STATE]: { - app: App; - inspectorId: string; - nodeId: string; - state: CustomInspectorState; - }; - [Hooks.EDIT_INSPECTOR_STATE]: { - app: App; - inspectorId: string; - nodeId: string; - path: string[]; - type: string; - state: EditStatePayload; - set: (object: any, path?: string | (string[]), value?: any, cb?: (object: any, field: string, value: any) => void) => void; - }; - [Hooks.SET_PLUGIN_SETTINGS]: { - app: App; - pluginId: string; - key: string; - newValue: any; - oldValue: any; - settings: any; - }; -}; -export declare type EditStatePayload = { - value: any; - newKey?: string | null; - remove?: undefined | false; -} | { - value?: undefined; - newKey?: undefined; - remove: true; -}; -export declare type HookHandler = (payload: TPayload, ctx: TContext) => void | Promise; -export interface Hookable { - transformCall(handler: HookHandler): any; - getAppRecordName(handler: HookHandler): any; - getAppRootInstance(handler: HookHandler): any; - registerApplication(handler: HookHandler): any; - walkComponentTree(handler: HookHandler): any; - visitComponentTree(handler: HookHandler): any; - walkComponentParents(handler: HookHandler): any; - inspectComponent(handler: HookHandler): any; - getComponentBounds(handler: HookHandler): any; - getComponentName(handler: HookHandler): any; - getComponentInstances(handler: HookHandler): any; - getElementComponent(handler: HookHandler): any; - getComponentRootElements(handler: HookHandler): any; - editComponentState(handler: HookHandler): any; - getComponentDevtoolsOptions(handler: HookHandler): any; - getComponentRenderCode(handler: HookHandler): any; - inspectTimelineEvent(handler: HookHandler): any; - timelineCleared(handler: HookHandler): any; - getInspectorTree(handler: HookHandler): any; - getInspectorState(handler: HookHandler): any; - editInspectorState(handler: HookHandler): any; - setPluginSettings(handler: HookHandler): any; -} diff --git a/node_modules/@vue/devtools-api/lib/esm/api/hooks.js b/node_modules/@vue/devtools-api/lib/esm/api/hooks.js deleted file mode 100644 index cb0ff5c..0000000 --- a/node_modules/@vue/devtools-api/lib/esm/api/hooks.js +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/node_modules/@vue/devtools-api/lib/esm/api/index.d.ts b/node_modules/@vue/devtools-api/lib/esm/api/index.d.ts deleted file mode 100644 index 70d09d2..0000000 --- a/node_modules/@vue/devtools-api/lib/esm/api/index.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export * from './api.js'; -export * from './app.js'; -export * from './component.js'; -export * from './context.js'; -export * from './hooks.js'; -export * from './util.js'; diff --git a/node_modules/@vue/devtools-api/lib/esm/api/index.js b/node_modules/@vue/devtools-api/lib/esm/api/index.js deleted file mode 100644 index 70d09d2..0000000 --- a/node_modules/@vue/devtools-api/lib/esm/api/index.js +++ /dev/null @@ -1,6 +0,0 @@ -export * from './api.js'; -export * from './app.js'; -export * from './component.js'; -export * from './context.js'; -export * from './hooks.js'; -export * from './util.js'; diff --git a/node_modules/@vue/devtools-api/lib/esm/api/util.d.ts b/node_modules/@vue/devtools-api/lib/esm/api/util.d.ts deleted file mode 100644 index 7c437e5..0000000 --- a/node_modules/@vue/devtools-api/lib/esm/api/util.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export declare type ID = number | string; -export interface WithId { - id: ID; -} diff --git a/node_modules/@vue/devtools-api/lib/esm/api/util.js b/node_modules/@vue/devtools-api/lib/esm/api/util.js deleted file mode 100644 index cb0ff5c..0000000 --- a/node_modules/@vue/devtools-api/lib/esm/api/util.js +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/node_modules/@vue/devtools-api/lib/esm/const.d.ts b/node_modules/@vue/devtools-api/lib/esm/const.d.ts deleted file mode 100644 index 289b254..0000000 --- a/node_modules/@vue/devtools-api/lib/esm/const.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare const HOOK_SETUP = "devtools-plugin:setup"; -export declare const HOOK_PLUGIN_SETTINGS_SET = "plugin:settings:set"; diff --git a/node_modules/@vue/devtools-api/lib/esm/const.js b/node_modules/@vue/devtools-api/lib/esm/const.js deleted file mode 100644 index 872ea3e..0000000 --- a/node_modules/@vue/devtools-api/lib/esm/const.js +++ /dev/null @@ -1,2 +0,0 @@ -export const HOOK_SETUP = 'devtools-plugin:setup'; -export const HOOK_PLUGIN_SETTINGS_SET = 'plugin:settings:set'; diff --git a/node_modules/@vue/devtools-api/lib/esm/env.d.ts b/node_modules/@vue/devtools-api/lib/esm/env.d.ts deleted file mode 100644 index 16c1399..0000000 --- a/node_modules/@vue/devtools-api/lib/esm/env.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { PluginDescriptor, SetupFunction } from './index.js'; -import type { ApiProxy } from './proxy.js'; -export interface PluginQueueItem { - pluginDescriptor: PluginDescriptor; - setupFn: SetupFunction; - proxy?: ApiProxy; -} -interface GlobalTarget { - __VUE_DEVTOOLS_PLUGINS__?: PluginQueueItem[]; - __VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__?: boolean; -} -export declare function getDevtoolsGlobalHook(): any; -export declare function getTarget(): GlobalTarget; -export declare const isProxyAvailable: boolean; -export {}; diff --git a/node_modules/@vue/devtools-api/lib/esm/env.js b/node_modules/@vue/devtools-api/lib/esm/env.js deleted file mode 100644 index 6713a93..0000000 --- a/node_modules/@vue/devtools-api/lib/esm/env.js +++ /dev/null @@ -1,12 +0,0 @@ -export function getDevtoolsGlobalHook() { - return getTarget().__VUE_DEVTOOLS_GLOBAL_HOOK__; -} -export function getTarget() { - // @ts-ignore - return (typeof navigator !== 'undefined' && typeof window !== 'undefined') - ? window - : typeof global !== 'undefined' - ? global - : {}; -} -export const isProxyAvailable = typeof Proxy === 'function'; diff --git a/node_modules/@vue/devtools-api/lib/esm/index.d.ts b/node_modules/@vue/devtools-api/lib/esm/index.d.ts deleted file mode 100644 index 6833324..0000000 --- a/node_modules/@vue/devtools-api/lib/esm/index.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -import type { DevtoolsPluginApi } from './api/index.js'; -import type { PluginDescriptor, ExtractSettingsTypes, PluginSettingsItem } from './plugin.js'; -export * from './api/index.js'; -export * from './plugin.js'; -export * from './time.js'; -export { PluginQueueItem } from './env.js'; -declare type Cast = A extends B ? A : B; -declare type Narrowable = string | number | bigint | boolean; -declare type Narrow = Cast; -})>; -declare type Exact = { - [K in keyof C]: K extends keyof T ? T[K] : never; -}; -export declare type SetupFunction = (api: DevtoolsPluginApi) => void; -export declare function setupDevtoolsPlugin, TSettings = ExtractSettingsTypes ? S : Record : Record>>(pluginDescriptor: Narrow, setupFn: SetupFunction): void; diff --git a/node_modules/@vue/devtools-api/lib/esm/index.js b/node_modules/@vue/devtools-api/lib/esm/index.js deleted file mode 100644 index 39259bc..0000000 --- a/node_modules/@vue/devtools-api/lib/esm/index.js +++ /dev/null @@ -1,26 +0,0 @@ -import { getTarget, getDevtoolsGlobalHook, isProxyAvailable } from './env.js'; -import { HOOK_SETUP } from './const.js'; -import { ApiProxy } from './proxy.js'; -export * from './api/index.js'; -export * from './plugin.js'; -export * from './time.js'; -export function setupDevtoolsPlugin(pluginDescriptor, setupFn) { - const descriptor = pluginDescriptor; - const target = getTarget(); - const hook = getDevtoolsGlobalHook(); - const enableProxy = isProxyAvailable && descriptor.enableEarlyProxy; - if (hook && (target.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__ || !enableProxy)) { - hook.emit(HOOK_SETUP, pluginDescriptor, setupFn); - } - else { - const proxy = enableProxy ? new ApiProxy(descriptor, hook) : null; - const list = target.__VUE_DEVTOOLS_PLUGINS__ = target.__VUE_DEVTOOLS_PLUGINS__ || []; - list.push({ - pluginDescriptor: descriptor, - setupFn, - proxy, - }); - if (proxy) - setupFn(proxy.proxiedTarget); - } -} diff --git a/node_modules/@vue/devtools-api/lib/esm/plugin.d.ts b/node_modules/@vue/devtools-api/lib/esm/plugin.d.ts deleted file mode 100644 index dd182ca..0000000 --- a/node_modules/@vue/devtools-api/lib/esm/plugin.d.ts +++ /dev/null @@ -1,47 +0,0 @@ -import type { App } from './api/index.js'; -export interface PluginDescriptor { - id: string; - label: string; - app: App; - packageName?: string; - homepage?: string; - componentStateTypes?: string[]; - logo?: string; - disableAppScope?: boolean; - disablePluginScope?: boolean; - /** - * Run the plugin setup and expose the api even if the devtools is not opened yet. - * Useful to record timeline events early. - */ - enableEarlyProxy?: boolean; - settings?: Record; -} -export declare type PluginSettingsItem = { - label: string; - description?: string; -} & ({ - type: 'boolean'; - defaultValue: boolean; -} | { - type: 'choice'; - defaultValue: string | number; - options: { - value: string | number; - label: string; - }[]; - component?: 'select' | 'button-group'; -} | { - type: 'text'; - defaultValue: string; -}); -declare type InferSettingsType = [T] extends [{ - type: 'boolean'; -}] ? boolean : [T] extends [{ - type: 'choice'; -}] ? T['options'][number]['value'] : [T] extends [{ - type: 'text'; -}] ? string : unknown; -export declare type ExtractSettingsTypes> = { - [K in keyof O]: InferSettingsType; -}; -export {}; diff --git a/node_modules/@vue/devtools-api/lib/esm/plugin.js b/node_modules/@vue/devtools-api/lib/esm/plugin.js deleted file mode 100644 index cb0ff5c..0000000 --- a/node_modules/@vue/devtools-api/lib/esm/plugin.js +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/node_modules/@vue/devtools-api/lib/esm/proxy.d.ts b/node_modules/@vue/devtools-api/lib/esm/proxy.d.ts deleted file mode 100644 index 38ff867..0000000 --- a/node_modules/@vue/devtools-api/lib/esm/proxy.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -import type { Context, DevtoolsPluginApi, Hookable } from './api/index.js'; -import type { PluginDescriptor } from './plugin.js'; -interface QueueItem { - method: string; - args: any[]; - resolve?: (value?: any) => void; -} -export declare class ApiProxy = DevtoolsPluginApi> { - target: TTarget | null; - targetQueue: QueueItem[]; - proxiedTarget: TTarget; - onQueue: QueueItem[]; - proxiedOn: Hookable; - plugin: PluginDescriptor; - hook: any; - fallbacks: Record; - constructor(plugin: PluginDescriptor, hook: any); - setRealTarget(target: TTarget): Promise; -} -export {}; diff --git a/node_modules/@vue/devtools-api/lib/esm/proxy.js b/node_modules/@vue/devtools-api/lib/esm/proxy.js deleted file mode 100644 index 639077e..0000000 --- a/node_modules/@vue/devtools-api/lib/esm/proxy.js +++ /dev/null @@ -1,107 +0,0 @@ -import { HOOK_PLUGIN_SETTINGS_SET } from './const.js'; -import { now } from './time.js'; -export class ApiProxy { - constructor(plugin, hook) { - this.target = null; - this.targetQueue = []; - this.onQueue = []; - this.plugin = plugin; - this.hook = hook; - const defaultSettings = {}; - if (plugin.settings) { - for (const id in plugin.settings) { - const item = plugin.settings[id]; - defaultSettings[id] = item.defaultValue; - } - } - const localSettingsSaveId = `__vue-devtools-plugin-settings__${plugin.id}`; - let currentSettings = Object.assign({}, defaultSettings); - try { - const raw = localStorage.getItem(localSettingsSaveId); - const data = JSON.parse(raw); - Object.assign(currentSettings, data); - } - catch (e) { - // noop - } - this.fallbacks = { - getSettings() { - return currentSettings; - }, - setSettings(value) { - try { - localStorage.setItem(localSettingsSaveId, JSON.stringify(value)); - } - catch (e) { - // noop - } - currentSettings = value; - }, - now() { - return now(); - }, - }; - if (hook) { - hook.on(HOOK_PLUGIN_SETTINGS_SET, (pluginId, value) => { - if (pluginId === this.plugin.id) { - this.fallbacks.setSettings(value); - } - }); - } - this.proxiedOn = new Proxy({}, { - get: (_target, prop) => { - if (this.target) { - return this.target.on[prop]; - } - else { - return (...args) => { - this.onQueue.push({ - method: prop, - args, - }); - }; - } - }, - }); - this.proxiedTarget = new Proxy({}, { - get: (_target, prop) => { - if (this.target) { - return this.target[prop]; - } - else if (prop === 'on') { - return this.proxiedOn; - } - else if (Object.keys(this.fallbacks).includes(prop)) { - return (...args) => { - this.targetQueue.push({ - method: prop, - args, - resolve: () => { }, - }); - return this.fallbacks[prop](...args); - }; - } - else { - return (...args) => { - return new Promise(resolve => { - this.targetQueue.push({ - method: prop, - args, - resolve, - }); - }); - }; - } - }, - }); - } - async setRealTarget(target) { - this.target = target; - for (const item of this.onQueue) { - this.target.on[item.method](...item.args); - } - for (const item of this.targetQueue) { - item.resolve(await this.target[item.method](...item.args)); - } - } -} diff --git a/node_modules/@vue/devtools-api/lib/esm/time.d.ts b/node_modules/@vue/devtools-api/lib/esm/time.d.ts deleted file mode 100644 index 1aebade..0000000 --- a/node_modules/@vue/devtools-api/lib/esm/time.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare function isPerformanceSupported(): boolean; -export declare function now(): number; diff --git a/node_modules/@vue/devtools-api/lib/esm/time.js b/node_modules/@vue/devtools-api/lib/esm/time.js deleted file mode 100644 index 99bedb5..0000000 --- a/node_modules/@vue/devtools-api/lib/esm/time.js +++ /dev/null @@ -1,23 +0,0 @@ -let supported; -let perf; -export function isPerformanceSupported() { - var _a; - if (supported !== undefined) { - return supported; - } - if (typeof window !== 'undefined' && window.performance) { - supported = true; - perf = window.performance; - } - else if (typeof global !== 'undefined' && ((_a = global.perf_hooks) === null || _a === void 0 ? void 0 : _a.performance)) { - supported = true; - perf = global.perf_hooks.performance; - } - else { - supported = false; - } - return supported; -} -export function now() { - return isPerformanceSupported() ? perf.now() : Date.now(); -} diff --git a/node_modules/@vue/devtools-api/package.json b/node_modules/@vue/devtools-api/package.json deleted file mode 100644 index 0fe878b..0000000 --- a/node_modules/@vue/devtools-api/package.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "name": "@vue/devtools-api", - "version": "6.5.0", - "description": "Interact with the Vue devtools from the page", - "main": "lib/cjs/index.js", - "browser": "lib/esm/index.js", - "module": "lib/esm/index.js", - "types": "lib/esm/index.d.ts", - "sideEffects": false, - "author": { - "name": "Guillaume Chau" - }, - "files": [ - "lib/esm", - "lib/cjs" - ], - "license": "MIT", - "repository": { - "url": "https://github.com/vuejs/vue-devtools.git", - "type": "git", - "directory": "packages/api" - }, - "publishConfig": { - "access": "public" - }, - "scripts": { - "build": "rimraf lib && yarn build:esm && yarn build:cjs", - "build:esm": "tsc --module es2015 --outDir lib/esm -d", - "build:cjs": "tsc --module commonjs --outDir lib/cjs", - "build:watch": "yarn tsc --module es2015 --outDir lib/esm -d -w --sourceMap" - }, - "devDependencies": { - "@types/node": "^13.9.1", - "@types/webpack-env": "^1.15.1", - "typescript": "^4.5.2" - } -} \ No newline at end of file diff --git a/node_modules/pinia/LICENSE b/node_modules/pinia/LICENSE deleted file mode 100644 index 0c77562..0000000 --- a/node_modules/pinia/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2019-present Eduardo San Martin Morote - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/pinia/README.md b/node_modules/pinia/README.md deleted file mode 100644 index d73d322..0000000 --- a/node_modules/pinia/README.md +++ /dev/null @@ -1,24 +0,0 @@ -

- - Pinia logo - -

- -# Pinia - -> Intuitive, type safe and flexible Store for Vue - -## 👉 [Demo with Vue 3 on StackBlitz](https://stackblitz.com/github/piniajs/example-vue-3-vite) - -## Help me keep working on this project 💚 - -- [Become a Sponsor on GitHub](https://github.com/sponsors/posva) -- [One-time donation via PayPal](https://paypal.me/posva) - -## Documentation - -To learn more about Pinia, check [its documentation](https://pinia.vuejs.org). - -## License - -[MIT](http://opensource.org/licenses/MIT) diff --git a/node_modules/pinia/dist/pinia.cjs b/node_modules/pinia/dist/pinia.cjs deleted file mode 100644 index 859b41a..0000000 --- a/node_modules/pinia/dist/pinia.cjs +++ /dev/null @@ -1,2019 +0,0 @@ -/*! - * pinia v2.1.6 - * (c) 2023 Eduardo San Martin Morote - * @license MIT - */ -'use strict'; - -var vueDemi = require('vue-demi'); -var devtoolsApi = require('@vue/devtools-api'); - -/** - * setActivePinia must be called to handle SSR at the top of functions like - * `fetch`, `setup`, `serverPrefetch` and others - */ -let activePinia; -/** - * Sets or unsets the active pinia. Used in SSR and internally when calling - * actions and getters - * - * @param pinia - Pinia instance - */ -// @ts-expect-error: cannot constrain the type of the return -const setActivePinia = (pinia) => (activePinia = pinia); -/** - * Get the currently active pinia if there is any. - */ -const getActivePinia = () => (vueDemi.hasInjectionContext() && vueDemi.inject(piniaSymbol)) || activePinia; -const piniaSymbol = ((process.env.NODE_ENV !== 'production') ? Symbol('pinia') : /* istanbul ignore next */ Symbol()); - -function isPlainObject( -// eslint-disable-next-line @typescript-eslint/no-explicit-any -o) { - return (o && - typeof o === 'object' && - Object.prototype.toString.call(o) === '[object Object]' && - typeof o.toJSON !== 'function'); -} -// type DeepReadonly = { readonly [P in keyof T]: DeepReadonly } -// TODO: can we change these to numbers? -/** - * Possible types for SubscriptionCallback - */ -exports.MutationType = void 0; -(function (MutationType) { - /** - * Direct mutation of the state: - * - * - `store.name = 'new name'` - * - `store.$state.name = 'new name'` - * - `store.list.push('new item')` - */ - MutationType["direct"] = "direct"; - /** - * Mutated the state with `$patch` and an object - * - * - `store.$patch({ name: 'newName' })` - */ - MutationType["patchObject"] = "patch object"; - /** - * Mutated the state with `$patch` and a function - * - * - `store.$patch(state => state.name = 'newName')` - */ - MutationType["patchFunction"] = "patch function"; - // maybe reset? for $state = {} and $reset -})(exports.MutationType || (exports.MutationType = {})); - -const IS_CLIENT = typeof window !== 'undefined'; -/** - * Should we add the devtools plugins. - * - only if dev mode or forced through the prod devtools flag - * - not in test - * - only if window exists (could change in the future) - */ -const USE_DEVTOOLS = ((process.env.NODE_ENV !== 'production') || false) && !(process.env.NODE_ENV === 'test') && IS_CLIENT; - -/* - * FileSaver.js A saveAs() FileSaver implementation. - * - * Originally by Eli Grey, adapted as an ESM module by Eduardo San Martin - * Morote. - * - * License : MIT - */ -// The one and only way of getting global scope in all environments -// https://stackoverflow.com/q/3277182/1008999 -const _global = /*#__PURE__*/ (() => typeof window === 'object' && window.window === window - ? window - : typeof self === 'object' && self.self === self - ? self - : typeof global === 'object' && global.global === global - ? global - : typeof globalThis === 'object' - ? globalThis - : { HTMLElement: null })(); -function bom(blob, { autoBom = false } = {}) { - // prepend BOM for UTF-8 XML and text/* types (including HTML) - // note: your browser will automatically convert UTF-16 U+FEFF to EF BB BF - if (autoBom && - /^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(blob.type)) { - return new Blob([String.fromCharCode(0xfeff), blob], { type: blob.type }); - } - return blob; -} -function download(url, name, opts) { - const xhr = new XMLHttpRequest(); - xhr.open('GET', url); - xhr.responseType = 'blob'; - xhr.onload = function () { - saveAs(xhr.response, name, opts); - }; - xhr.onerror = function () { - console.error('could not download file'); - }; - xhr.send(); -} -function corsEnabled(url) { - const xhr = new XMLHttpRequest(); - // use sync to avoid popup blocker - xhr.open('HEAD', url, false); - try { - xhr.send(); - } - catch (e) { } - return xhr.status >= 200 && xhr.status <= 299; -} -// `a.click()` doesn't work for all browsers (#465) -function click(node) { - try { - node.dispatchEvent(new MouseEvent('click')); - } - catch (e) { - const evt = document.createEvent('MouseEvents'); - evt.initMouseEvent('click', true, true, window, 0, 0, 0, 80, 20, false, false, false, false, 0, null); - node.dispatchEvent(evt); - } -} -const _navigator = - typeof navigator === 'object' ? navigator : { userAgent: '' }; -// Detect WebView inside a native macOS app by ruling out all browsers -// We just need to check for 'Safari' because all other browsers (besides Firefox) include that too -// https://www.whatismybrowser.com/guides/the-latest-user-agent/macos -const isMacOSWebView = /*#__PURE__*/ (() => /Macintosh/.test(_navigator.userAgent) && - /AppleWebKit/.test(_navigator.userAgent) && - !/Safari/.test(_navigator.userAgent))(); -const saveAs = !IS_CLIENT - ? () => { } // noop - : // Use download attribute first if possible (#193 Lumia mobile) unless this is a macOS WebView or mini program - typeof HTMLAnchorElement !== 'undefined' && - 'download' in HTMLAnchorElement.prototype && - !isMacOSWebView - ? downloadSaveAs - : // Use msSaveOrOpenBlob as a second approach - 'msSaveOrOpenBlob' in _navigator - ? msSaveAs - : // Fallback to using FileReader and a popup - fileSaverSaveAs; -function downloadSaveAs(blob, name = 'download', opts) { - const a = document.createElement('a'); - a.download = name; - a.rel = 'noopener'; // tabnabbing - // TODO: detect chrome extensions & packaged apps - // a.target = '_blank' - if (typeof blob === 'string') { - // Support regular links - a.href = blob; - if (a.origin !== location.origin) { - if (corsEnabled(a.href)) { - download(blob, name, opts); - } - else { - a.target = '_blank'; - click(a); - } - } - else { - click(a); - } - } - else { - // Support blobs - a.href = URL.createObjectURL(blob); - setTimeout(function () { - URL.revokeObjectURL(a.href); - }, 4e4); // 40s - setTimeout(function () { - click(a); - }, 0); - } -} -function msSaveAs(blob, name = 'download', opts) { - if (typeof blob === 'string') { - if (corsEnabled(blob)) { - download(blob, name, opts); - } - else { - const a = document.createElement('a'); - a.href = blob; - a.target = '_blank'; - setTimeout(function () { - click(a); - }); - } - } - else { - // @ts-ignore: works on windows - navigator.msSaveOrOpenBlob(bom(blob, opts), name); - } -} -function fileSaverSaveAs(blob, name, opts, popup) { - // Open a popup immediately do go around popup blocker - // Mostly only available on user interaction and the fileReader is async so... - popup = popup || open('', '_blank'); - if (popup) { - popup.document.title = popup.document.body.innerText = 'downloading...'; - } - if (typeof blob === 'string') - return download(blob, name, opts); - const force = blob.type === 'application/octet-stream'; - const isSafari = /constructor/i.test(String(_global.HTMLElement)) || 'safari' in _global; - const isChromeIOS = /CriOS\/[\d]+/.test(navigator.userAgent); - if ((isChromeIOS || (force && isSafari) || isMacOSWebView) && - typeof FileReader !== 'undefined') { - // Safari doesn't allow downloading of blob URLs - const reader = new FileReader(); - reader.onloadend = function () { - let url = reader.result; - if (typeof url !== 'string') { - popup = null; - throw new Error('Wrong reader.result type'); - } - url = isChromeIOS - ? url - : url.replace(/^data:[^;]*;/, 'data:attachment/file;'); - if (popup) { - popup.location.href = url; - } - else { - location.assign(url); - } - popup = null; // reverse-tabnabbing #460 - }; - reader.readAsDataURL(blob); - } - else { - const url = URL.createObjectURL(blob); - if (popup) - popup.location.assign(url); - else - location.href = url; - popup = null; // reverse-tabnabbing #460 - setTimeout(function () { - URL.revokeObjectURL(url); - }, 4e4); // 40s - } -} - -/** - * Shows a toast or console.log - * - * @param message - message to log - * @param type - different color of the tooltip - */ -function toastMessage(message, type) { - const piniaMessage = '🍍 ' + message; - if (typeof __VUE_DEVTOOLS_TOAST__ === 'function') { - // No longer available :( - __VUE_DEVTOOLS_TOAST__(piniaMessage, type); - } - else if (type === 'error') { - console.error(piniaMessage); - } - else if (type === 'warn') { - console.warn(piniaMessage); - } - else { - console.log(piniaMessage); - } -} -function isPinia(o) { - return '_a' in o && 'install' in o; -} - -/** - * This file contain devtools actions, they are not Pinia actions. - */ -// --- -function checkClipboardAccess() { - if (!('clipboard' in navigator)) { - toastMessage(`Your browser doesn't support the Clipboard API`, 'error'); - return true; - } -} -function checkNotFocusedError(error) { - if (error instanceof Error && - error.message.toLowerCase().includes('document is not focused')) { - toastMessage('You need to activate the "Emulate a focused page" setting in the "Rendering" panel of devtools.', 'warn'); - return true; - } - return false; -} -async function actionGlobalCopyState(pinia) { - if (checkClipboardAccess()) - return; - try { - await navigator.clipboard.writeText(JSON.stringify(pinia.state.value)); - toastMessage('Global state copied to clipboard.'); - } - catch (error) { - if (checkNotFocusedError(error)) - return; - toastMessage(`Failed to serialize the state. Check the console for more details.`, 'error'); - console.error(error); - } -} -async function actionGlobalPasteState(pinia) { - if (checkClipboardAccess()) - return; - try { - loadStoresState(pinia, JSON.parse(await navigator.clipboard.readText())); - toastMessage('Global state pasted from clipboard.'); - } - catch (error) { - if (checkNotFocusedError(error)) - return; - toastMessage(`Failed to deserialize the state from clipboard. Check the console for more details.`, 'error'); - console.error(error); - } -} -async function actionGlobalSaveState(pinia) { - try { - saveAs(new Blob([JSON.stringify(pinia.state.value)], { - type: 'text/plain;charset=utf-8', - }), 'pinia-state.json'); - } - catch (error) { - toastMessage(`Failed to export the state as JSON. Check the console for more details.`, 'error'); - console.error(error); - } -} -let fileInput; -function getFileOpener() { - if (!fileInput) { - fileInput = document.createElement('input'); - fileInput.type = 'file'; - fileInput.accept = '.json'; - } - function openFile() { - return new Promise((resolve, reject) => { - fileInput.onchange = async () => { - const files = fileInput.files; - if (!files) - return resolve(null); - const file = files.item(0); - if (!file) - return resolve(null); - return resolve({ text: await file.text(), file }); - }; - // @ts-ignore: TODO: changed from 4.3 to 4.4 - fileInput.oncancel = () => resolve(null); - fileInput.onerror = reject; - fileInput.click(); - }); - } - return openFile; -} -async function actionGlobalOpenStateFile(pinia) { - try { - const open = getFileOpener(); - const result = await open(); - if (!result) - return; - const { text, file } = result; - loadStoresState(pinia, JSON.parse(text)); - toastMessage(`Global state imported from "${file.name}".`); - } - catch (error) { - toastMessage(`Failed to import the state from JSON. Check the console for more details.`, 'error'); - console.error(error); - } -} -function loadStoresState(pinia, state) { - for (const key in state) { - const storeState = pinia.state.value[key]; - if (storeState) { - Object.assign(storeState, state[key]); - } - } -} - -function formatDisplay(display) { - return { - _custom: { - display, - }, - }; -} -const PINIA_ROOT_LABEL = '🍍 Pinia (root)'; -const PINIA_ROOT_ID = '_root'; -function formatStoreForInspectorTree(store) { - return isPinia(store) - ? { - id: PINIA_ROOT_ID, - label: PINIA_ROOT_LABEL, - } - : { - id: store.$id, - label: store.$id, - }; -} -function formatStoreForInspectorState(store) { - if (isPinia(store)) { - const storeNames = Array.from(store._s.keys()); - const storeMap = store._s; - const state = { - state: storeNames.map((storeId) => ({ - editable: true, - key: storeId, - value: store.state.value[storeId], - })), - getters: storeNames - .filter((id) => storeMap.get(id)._getters) - .map((id) => { - const store = storeMap.get(id); - return { - editable: false, - key: id, - value: store._getters.reduce((getters, key) => { - getters[key] = store[key]; - return getters; - }, {}), - }; - }), - }; - return state; - } - const state = { - state: Object.keys(store.$state).map((key) => ({ - editable: true, - key, - value: store.$state[key], - })), - }; - // avoid adding empty getters - if (store._getters && store._getters.length) { - state.getters = store._getters.map((getterName) => ({ - editable: false, - key: getterName, - value: store[getterName], - })); - } - if (store._customProperties.size) { - state.customProperties = Array.from(store._customProperties).map((key) => ({ - editable: true, - key, - value: store[key], - })); - } - return state; -} -function formatEventData(events) { - if (!events) - return {}; - if (Array.isArray(events)) { - // TODO: handle add and delete for arrays and objects - return events.reduce((data, event) => { - data.keys.push(event.key); - data.operations.push(event.type); - data.oldValue[event.key] = event.oldValue; - data.newValue[event.key] = event.newValue; - return data; - }, { - oldValue: {}, - keys: [], - operations: [], - newValue: {}, - }); - } - else { - return { - operation: formatDisplay(events.type), - key: formatDisplay(events.key), - oldValue: events.oldValue, - newValue: events.newValue, - }; - } -} -function formatMutationType(type) { - switch (type) { - case exports.MutationType.direct: - return 'mutation'; - case exports.MutationType.patchFunction: - return '$patch'; - case exports.MutationType.patchObject: - return '$patch'; - default: - return 'unknown'; - } -} - -// timeline can be paused when directly changing the state -let isTimelineActive = true; -const componentStateTypes = []; -const MUTATIONS_LAYER_ID = 'pinia:mutations'; -const INSPECTOR_ID = 'pinia'; -const { assign: assign$1 } = Object; -/** - * Gets the displayed name of a store in devtools - * - * @param id - id of the store - * @returns a formatted string - */ -const getStoreType = (id) => '🍍 ' + id; -/** - * Add the pinia plugin without any store. Allows displaying a Pinia plugin tab - * as soon as it is added to the application. - * - * @param app - Vue application - * @param pinia - pinia instance - */ -function registerPiniaDevtools(app, pinia) { - devtoolsApi.setupDevtoolsPlugin({ - id: 'dev.esm.pinia', - label: 'Pinia 🍍', - logo: 'https://pinia.vuejs.org/logo.svg', - packageName: 'pinia', - homepage: 'https://pinia.vuejs.org', - componentStateTypes, - app, - }, (api) => { - if (typeof api.now !== 'function') { - toastMessage('You seem to be using an outdated version of Vue Devtools. Are you still using the Beta release instead of the stable one? You can find the links at https://devtools.vuejs.org/guide/installation.html.'); - } - api.addTimelineLayer({ - id: MUTATIONS_LAYER_ID, - label: `Pinia 🍍`, - color: 0xe5df88, - }); - api.addInspector({ - id: INSPECTOR_ID, - label: 'Pinia 🍍', - icon: 'storage', - treeFilterPlaceholder: 'Search stores', - actions: [ - { - icon: 'content_copy', - action: () => { - actionGlobalCopyState(pinia); - }, - tooltip: 'Serialize and copy the state', - }, - { - icon: 'content_paste', - action: async () => { - await actionGlobalPasteState(pinia); - api.sendInspectorTree(INSPECTOR_ID); - api.sendInspectorState(INSPECTOR_ID); - }, - tooltip: 'Replace the state with the content of your clipboard', - }, - { - icon: 'save', - action: () => { - actionGlobalSaveState(pinia); - }, - tooltip: 'Save the state as a JSON file', - }, - { - icon: 'folder_open', - action: async () => { - await actionGlobalOpenStateFile(pinia); - api.sendInspectorTree(INSPECTOR_ID); - api.sendInspectorState(INSPECTOR_ID); - }, - tooltip: 'Import the state from a JSON file', - }, - ], - nodeActions: [ - { - icon: 'restore', - tooltip: 'Reset the state (with "$reset")', - action: (nodeId) => { - const store = pinia._s.get(nodeId); - if (!store) { - toastMessage(`Cannot reset "${nodeId}" store because it wasn't found.`, 'warn'); - } - else if (typeof store.$reset !== 'function') { - toastMessage(`Cannot reset "${nodeId}" store because it doesn't have a "$reset" method implemented.`, 'warn'); - } - else { - store.$reset(); - toastMessage(`Store "${nodeId}" reset.`); - } - }, - }, - ], - }); - api.on.inspectComponent((payload, ctx) => { - const proxy = (payload.componentInstance && - payload.componentInstance.proxy); - if (proxy && proxy._pStores) { - const piniaStores = payload.componentInstance.proxy._pStores; - Object.values(piniaStores).forEach((store) => { - payload.instanceData.state.push({ - type: getStoreType(store.$id), - key: 'state', - editable: true, - value: store._isOptionsAPI - ? { - _custom: { - value: vueDemi.toRaw(store.$state), - actions: [ - { - icon: 'restore', - tooltip: 'Reset the state of this store', - action: () => store.$reset(), - }, - ], - }, - } - : // NOTE: workaround to unwrap transferred refs - Object.keys(store.$state).reduce((state, key) => { - state[key] = store.$state[key]; - return state; - }, {}), - }); - if (store._getters && store._getters.length) { - payload.instanceData.state.push({ - type: getStoreType(store.$id), - key: 'getters', - editable: false, - value: store._getters.reduce((getters, key) => { - try { - getters[key] = store[key]; - } - catch (error) { - // @ts-expect-error: we just want to show it in devtools - getters[key] = error; - } - return getters; - }, {}), - }); - } - }); - } - }); - api.on.getInspectorTree((payload) => { - if (payload.app === app && payload.inspectorId === INSPECTOR_ID) { - let stores = [pinia]; - stores = stores.concat(Array.from(pinia._s.values())); - payload.rootNodes = (payload.filter - ? stores.filter((store) => '$id' in store - ? store.$id - .toLowerCase() - .includes(payload.filter.toLowerCase()) - : PINIA_ROOT_LABEL.toLowerCase().includes(payload.filter.toLowerCase())) - : stores).map(formatStoreForInspectorTree); - } - }); - api.on.getInspectorState((payload) => { - if (payload.app === app && payload.inspectorId === INSPECTOR_ID) { - const inspectedStore = payload.nodeId === PINIA_ROOT_ID - ? pinia - : pinia._s.get(payload.nodeId); - if (!inspectedStore) { - // this could be the selected store restored for a different project - // so it's better not to say anything here - return; - } - if (inspectedStore) { - payload.state = formatStoreForInspectorState(inspectedStore); - } - } - }); - api.on.editInspectorState((payload, ctx) => { - if (payload.app === app && payload.inspectorId === INSPECTOR_ID) { - const inspectedStore = payload.nodeId === PINIA_ROOT_ID - ? pinia - : pinia._s.get(payload.nodeId); - if (!inspectedStore) { - return toastMessage(`store "${payload.nodeId}" not found`, 'error'); - } - const { path } = payload; - if (!isPinia(inspectedStore)) { - // access only the state - if (path.length !== 1 || - !inspectedStore._customProperties.has(path[0]) || - path[0] in inspectedStore.$state) { - path.unshift('$state'); - } - } - else { - // Root access, we can omit the `.value` because the devtools API does it for us - path.unshift('state'); - } - isTimelineActive = false; - payload.set(inspectedStore, path, payload.state.value); - isTimelineActive = true; - } - }); - api.on.editComponentState((payload) => { - if (payload.type.startsWith('🍍')) { - const storeId = payload.type.replace(/^🍍\s*/, ''); - const store = pinia._s.get(storeId); - if (!store) { - return toastMessage(`store "${storeId}" not found`, 'error'); - } - const { path } = payload; - if (path[0] !== 'state') { - return toastMessage(`Invalid path for store "${storeId}":\n${path}\nOnly state can be modified.`); - } - // rewrite the first entry to be able to directly set the state as - // well as any other path - path[0] = '$state'; - isTimelineActive = false; - payload.set(store, path, payload.state.value); - isTimelineActive = true; - } - }); - }); -} -function addStoreToDevtools(app, store) { - if (!componentStateTypes.includes(getStoreType(store.$id))) { - componentStateTypes.push(getStoreType(store.$id)); - } - devtoolsApi.setupDevtoolsPlugin({ - id: 'dev.esm.pinia', - label: 'Pinia 🍍', - logo: 'https://pinia.vuejs.org/logo.svg', - packageName: 'pinia', - homepage: 'https://pinia.vuejs.org', - componentStateTypes, - app, - settings: { - logStoreChanges: { - label: 'Notify about new/deleted stores', - type: 'boolean', - defaultValue: true, - }, - // useEmojis: { - // label: 'Use emojis in messages ⚡️', - // type: 'boolean', - // defaultValue: true, - // }, - }, - }, (api) => { - // gracefully handle errors - const now = typeof api.now === 'function' ? api.now.bind(api) : Date.now; - store.$onAction(({ after, onError, name, args }) => { - const groupId = runningActionId++; - api.addTimelineEvent({ - layerId: MUTATIONS_LAYER_ID, - event: { - time: now(), - title: '🛫 ' + name, - subtitle: 'start', - data: { - store: formatDisplay(store.$id), - action: formatDisplay(name), - args, - }, - groupId, - }, - }); - after((result) => { - activeAction = undefined; - api.addTimelineEvent({ - layerId: MUTATIONS_LAYER_ID, - event: { - time: now(), - title: '🛬 ' + name, - subtitle: 'end', - data: { - store: formatDisplay(store.$id), - action: formatDisplay(name), - args, - result, - }, - groupId, - }, - }); - }); - onError((error) => { - activeAction = undefined; - api.addTimelineEvent({ - layerId: MUTATIONS_LAYER_ID, - event: { - time: now(), - logType: 'error', - title: '💥 ' + name, - subtitle: 'end', - data: { - store: formatDisplay(store.$id), - action: formatDisplay(name), - args, - error, - }, - groupId, - }, - }); - }); - }, true); - store._customProperties.forEach((name) => { - vueDemi.watch(() => vueDemi.unref(store[name]), (newValue, oldValue) => { - api.notifyComponentUpdate(); - api.sendInspectorState(INSPECTOR_ID); - if (isTimelineActive) { - api.addTimelineEvent({ - layerId: MUTATIONS_LAYER_ID, - event: { - time: now(), - title: 'Change', - subtitle: name, - data: { - newValue, - oldValue, - }, - groupId: activeAction, - }, - }); - } - }, { deep: true }); - }); - store.$subscribe(({ events, type }, state) => { - api.notifyComponentUpdate(); - api.sendInspectorState(INSPECTOR_ID); - if (!isTimelineActive) - return; - // rootStore.state[store.id] = state - const eventData = { - time: now(), - title: formatMutationType(type), - data: assign$1({ store: formatDisplay(store.$id) }, formatEventData(events)), - groupId: activeAction, - }; - if (type === exports.MutationType.patchFunction) { - eventData.subtitle = '⤵️'; - } - else if (type === exports.MutationType.patchObject) { - eventData.subtitle = '🧩'; - } - else if (events && !Array.isArray(events)) { - eventData.subtitle = events.type; - } - if (events) { - eventData.data['rawEvent(s)'] = { - _custom: { - display: 'DebuggerEvent', - type: 'object', - tooltip: 'raw DebuggerEvent[]', - value: events, - }, - }; - } - api.addTimelineEvent({ - layerId: MUTATIONS_LAYER_ID, - event: eventData, - }); - }, { detached: true, flush: 'sync' }); - const hotUpdate = store._hotUpdate; - store._hotUpdate = vueDemi.markRaw((newStore) => { - hotUpdate(newStore); - api.addTimelineEvent({ - layerId: MUTATIONS_LAYER_ID, - event: { - time: now(), - title: '🔥 ' + store.$id, - subtitle: 'HMR update', - data: { - store: formatDisplay(store.$id), - info: formatDisplay(`HMR update`), - }, - }, - }); - // update the devtools too - api.notifyComponentUpdate(); - api.sendInspectorTree(INSPECTOR_ID); - api.sendInspectorState(INSPECTOR_ID); - }); - const { $dispose } = store; - store.$dispose = () => { - $dispose(); - api.notifyComponentUpdate(); - api.sendInspectorTree(INSPECTOR_ID); - api.sendInspectorState(INSPECTOR_ID); - api.getSettings().logStoreChanges && - toastMessage(`Disposed "${store.$id}" store 🗑`); - }; - // trigger an update so it can display new registered stores - api.notifyComponentUpdate(); - api.sendInspectorTree(INSPECTOR_ID); - api.sendInspectorState(INSPECTOR_ID); - api.getSettings().logStoreChanges && - toastMessage(`"${store.$id}" store installed 🆕`); - }); -} -let runningActionId = 0; -let activeAction; -/** - * Patches a store to enable action grouping in devtools by wrapping the store with a Proxy that is passed as the - * context of all actions, allowing us to set `runningAction` on each access and effectively associating any state - * mutation to the action. - * - * @param store - store to patch - * @param actionNames - list of actionst to patch - */ -function patchActionForGrouping(store, actionNames, wrapWithProxy) { - // original actions of the store as they are given by pinia. We are going to override them - const actions = actionNames.reduce((storeActions, actionName) => { - // use toRaw to avoid tracking #541 - storeActions[actionName] = vueDemi.toRaw(store)[actionName]; - return storeActions; - }, {}); - for (const actionName in actions) { - store[actionName] = function () { - // the running action id is incremented in a before action hook - const _actionId = runningActionId; - const trackedStore = wrapWithProxy - ? new Proxy(store, { - get(...args) { - activeAction = _actionId; - return Reflect.get(...args); - }, - set(...args) { - activeAction = _actionId; - return Reflect.set(...args); - }, - }) - : store; - // For Setup Stores we need https://github.com/tc39/proposal-async-context - activeAction = _actionId; - const retValue = actions[actionName].apply(trackedStore, arguments); - // this is safer as async actions in Setup Stores would associate mutations done outside of the action - activeAction = undefined; - return retValue; - }; - } -} -/** - * pinia.use(devtoolsPlugin) - */ -function devtoolsPlugin({ app, store, options }) { - // HMR module - if (store.$id.startsWith('__hot:')) { - return; - } - // detect option api vs setup api - store._isOptionsAPI = !!options.state; - patchActionForGrouping(store, Object.keys(options.actions), store._isOptionsAPI); - // Upgrade the HMR to also update the new actions - const originalHotUpdate = store._hotUpdate; - vueDemi.toRaw(store)._hotUpdate = function (newStore) { - originalHotUpdate.apply(this, arguments); - patchActionForGrouping(store, Object.keys(newStore._hmrPayload.actions), !!store._isOptionsAPI); - }; - addStoreToDevtools(app, - // FIXME: is there a way to allow the assignment from Store to StoreGeneric? - store); -} - -/** - * Creates a Pinia instance to be used by the application - */ -function createPinia() { - const scope = vueDemi.effectScope(true); - // NOTE: here we could check the window object for a state and directly set it - // if there is anything like it with Vue 3 SSR - const state = scope.run(() => vueDemi.ref({})); - let _p = []; - // plugins added before calling app.use(pinia) - let toBeInstalled = []; - const pinia = vueDemi.markRaw({ - install(app) { - // this allows calling useStore() outside of a component setup after - // installing pinia's plugin - setActivePinia(pinia); - if (!vueDemi.isVue2) { - pinia._a = app; - app.provide(piniaSymbol, pinia); - app.config.globalProperties.$pinia = pinia; - /* istanbul ignore else */ - if (USE_DEVTOOLS) { - registerPiniaDevtools(app, pinia); - } - toBeInstalled.forEach((plugin) => _p.push(plugin)); - toBeInstalled = []; - } - }, - use(plugin) { - if (!this._a && !vueDemi.isVue2) { - toBeInstalled.push(plugin); - } - else { - _p.push(plugin); - } - return this; - }, - _p, - // it's actually undefined here - // @ts-expect-error - _a: null, - _e: scope, - _s: new Map(), - state, - }); - // pinia devtools rely on dev only features so they cannot be forced unless - // the dev build of Vue is used. Avoid old browsers like IE11. - if (USE_DEVTOOLS && typeof Proxy !== 'undefined') { - pinia.use(devtoolsPlugin); - } - return pinia; -} - -/** - * Checks if a function is a `StoreDefinition`. - * - * @param fn - object to test - * @returns true if `fn` is a StoreDefinition - */ -const isUseStore = (fn) => { - return typeof fn === 'function' && typeof fn.$id === 'string'; -}; -/** - * Mutates in place `newState` with `oldState` to _hot update_ it. It will - * remove any key not existing in `newState` and recursively merge plain - * objects. - * - * @param newState - new state object to be patched - * @param oldState - old state that should be used to patch newState - * @returns - newState - */ -function patchObject(newState, oldState) { - // no need to go through symbols because they cannot be serialized anyway - for (const key in oldState) { - const subPatch = oldState[key]; - // skip the whole sub tree - if (!(key in newState)) { - continue; - } - const targetValue = newState[key]; - if (isPlainObject(targetValue) && - isPlainObject(subPatch) && - !vueDemi.isRef(subPatch) && - !vueDemi.isReactive(subPatch)) { - newState[key] = patchObject(targetValue, subPatch); - } - else { - // objects are either a bit more complex (e.g. refs) or primitives, so we - // just set the whole thing - if (vueDemi.isVue2) { - vueDemi.set(newState, key, subPatch); - } - else { - newState[key] = subPatch; - } - } - } - return newState; -} -/** - * Creates an _accept_ function to pass to `import.meta.hot` in Vite applications. - * - * @example - * ```js - * const useUser = defineStore(...) - * if (import.meta.hot) { - * import.meta.hot.accept(acceptHMRUpdate(useUser, import.meta.hot)) - * } - * ``` - * - * @param initialUseStore - return of the defineStore to hot update - * @param hot - `import.meta.hot` - */ -function acceptHMRUpdate(initialUseStore, hot) { - // strip as much as possible from iife.prod - if (!(process.env.NODE_ENV !== 'production')) { - return () => { }; - } - return (newModule) => { - const pinia = hot.data.pinia || initialUseStore._pinia; - if (!pinia) { - // this store is still not used - return; - } - // preserve the pinia instance across loads - hot.data.pinia = pinia; - // console.log('got data', newStore) - for (const exportName in newModule) { - const useStore = newModule[exportName]; - // console.log('checking for', exportName) - if (isUseStore(useStore) && pinia._s.has(useStore.$id)) { - // console.log('Accepting update for', useStore.$id) - const id = useStore.$id; - if (id !== initialUseStore.$id) { - console.warn(`The id of the store changed from "${initialUseStore.$id}" to "${id}". Reloading.`); - // return import.meta.hot.invalidate() - return hot.invalidate(); - } - const existingStore = pinia._s.get(id); - if (!existingStore) { - console.log(`[Pinia]: skipping hmr because store doesn't exist yet`); - return; - } - useStore(pinia, existingStore); - } - } - }; -} - -const noop = () => { }; -function addSubscription(subscriptions, callback, detached, onCleanup = noop) { - subscriptions.push(callback); - const removeSubscription = () => { - const idx = subscriptions.indexOf(callback); - if (idx > -1) { - subscriptions.splice(idx, 1); - onCleanup(); - } - }; - if (!detached && vueDemi.getCurrentScope()) { - vueDemi.onScopeDispose(removeSubscription); - } - return removeSubscription; -} -function triggerSubscriptions(subscriptions, ...args) { - subscriptions.slice().forEach((callback) => { - callback(...args); - }); -} - -const fallbackRunWithContext = (fn) => fn(); -function mergeReactiveObjects(target, patchToApply) { - // Handle Map instances - if (target instanceof Map && patchToApply instanceof Map) { - patchToApply.forEach((value, key) => target.set(key, value)); - } - // Handle Set instances - if (target instanceof Set && patchToApply instanceof Set) { - patchToApply.forEach(target.add, target); - } - // no need to go through symbols because they cannot be serialized anyway - for (const key in patchToApply) { - if (!patchToApply.hasOwnProperty(key)) - continue; - const subPatch = patchToApply[key]; - const targetValue = target[key]; - if (isPlainObject(targetValue) && - isPlainObject(subPatch) && - target.hasOwnProperty(key) && - !vueDemi.isRef(subPatch) && - !vueDemi.isReactive(subPatch)) { - // NOTE: here I wanted to warn about inconsistent types but it's not possible because in setup stores one might - // start the value of a property as a certain type e.g. a Map, and then for some reason, during SSR, change that - // to `undefined`. When trying to hydrate, we want to override the Map with `undefined`. - target[key] = mergeReactiveObjects(targetValue, subPatch); - } - else { - // @ts-expect-error: subPatch is a valid value - target[key] = subPatch; - } - } - return target; -} -const skipHydrateSymbol = (process.env.NODE_ENV !== 'production') - ? Symbol('pinia:skipHydration') - : /* istanbul ignore next */ Symbol(); -const skipHydrateMap = /*#__PURE__*/ new WeakMap(); -/** - * Tells Pinia to skip the hydration process of a given object. This is useful in setup stores (only) when you return a - * stateful object in the store but it isn't really state. e.g. returning a router instance in a setup store. - * - * @param obj - target object - * @returns obj - */ -function skipHydrate(obj) { - return vueDemi.isVue2 - ? // in @vue/composition-api, the refs are sealed so defineProperty doesn't work... - /* istanbul ignore next */ skipHydrateMap.set(obj, 1) && obj - : Object.defineProperty(obj, skipHydrateSymbol, {}); -} -/** - * Returns whether a value should be hydrated - * - * @param obj - target variable - * @returns true if `obj` should be hydrated - */ -function shouldHydrate(obj) { - return vueDemi.isVue2 - ? /* istanbul ignore next */ !skipHydrateMap.has(obj) - : !isPlainObject(obj) || !obj.hasOwnProperty(skipHydrateSymbol); -} -const { assign } = Object; -function isComputed(o) { - return !!(vueDemi.isRef(o) && o.effect); -} -function createOptionsStore(id, options, pinia, hot) { - const { state, actions, getters } = options; - const initialState = pinia.state.value[id]; - let store; - function setup() { - if (!initialState && (!(process.env.NODE_ENV !== 'production') || !hot)) { - /* istanbul ignore if */ - if (vueDemi.isVue2) { - vueDemi.set(pinia.state.value, id, state ? state() : {}); - } - else { - pinia.state.value[id] = state ? state() : {}; - } - } - // avoid creating a state in pinia.state.value - const localState = (process.env.NODE_ENV !== 'production') && hot - ? // use ref() to unwrap refs inside state TODO: check if this is still necessary - vueDemi.toRefs(vueDemi.ref(state ? state() : {}).value) - : vueDemi.toRefs(pinia.state.value[id]); - return assign(localState, actions, Object.keys(getters || {}).reduce((computedGetters, name) => { - if ((process.env.NODE_ENV !== 'production') && name in localState) { - console.warn(`[🍍]: A getter cannot have the same name as another state property. Rename one of them. Found with "${name}" in store "${id}".`); - } - computedGetters[name] = vueDemi.markRaw(vueDemi.computed(() => { - setActivePinia(pinia); - // it was created just before - const store = pinia._s.get(id); - // allow cross using stores - /* istanbul ignore next */ - if (vueDemi.isVue2 && !store._r) - return; - // @ts-expect-error - // return getters![name].call(context, context) - // TODO: avoid reading the getter while assigning with a global variable - return getters[name].call(store, store); - })); - return computedGetters; - }, {})); - } - store = createSetupStore(id, setup, options, pinia, hot, true); - return store; -} -function createSetupStore($id, setup, options = {}, pinia, hot, isOptionsStore) { - let scope; - const optionsForPlugin = assign({ actions: {} }, options); - /* istanbul ignore if */ - if ((process.env.NODE_ENV !== 'production') && !pinia._e.active) { - throw new Error('Pinia destroyed'); - } - // watcher options for $subscribe - const $subscribeOptions = { - deep: true, - // flush: 'post', - }; - /* istanbul ignore else */ - if ((process.env.NODE_ENV !== 'production') && !vueDemi.isVue2) { - $subscribeOptions.onTrigger = (event) => { - /* istanbul ignore else */ - if (isListening) { - debuggerEvents = event; - // avoid triggering this while the store is being built and the state is being set in pinia - } - else if (isListening == false && !store._hotUpdating) { - // let patch send all the events together later - /* istanbul ignore else */ - if (Array.isArray(debuggerEvents)) { - debuggerEvents.push(event); - } - else { - console.error('🍍 debuggerEvents should be an array. This is most likely an internal Pinia bug.'); - } - } - }; - } - // internal state - let isListening; // set to true at the end - let isSyncListening; // set to true at the end - let subscriptions = []; - let actionSubscriptions = []; - let debuggerEvents; - const initialState = pinia.state.value[$id]; - // avoid setting the state for option stores if it is set - // by the setup - if (!isOptionsStore && !initialState && (!(process.env.NODE_ENV !== 'production') || !hot)) { - /* istanbul ignore if */ - if (vueDemi.isVue2) { - vueDemi.set(pinia.state.value, $id, {}); - } - else { - pinia.state.value[$id] = {}; - } - } - const hotState = vueDemi.ref({}); - // avoid triggering too many listeners - // https://github.com/vuejs/pinia/issues/1129 - let activeListener; - function $patch(partialStateOrMutator) { - let subscriptionMutation; - isListening = isSyncListening = false; - // reset the debugger events since patches are sync - /* istanbul ignore else */ - if ((process.env.NODE_ENV !== 'production')) { - debuggerEvents = []; - } - if (typeof partialStateOrMutator === 'function') { - partialStateOrMutator(pinia.state.value[$id]); - subscriptionMutation = { - type: exports.MutationType.patchFunction, - storeId: $id, - events: debuggerEvents, - }; - } - else { - mergeReactiveObjects(pinia.state.value[$id], partialStateOrMutator); - subscriptionMutation = { - type: exports.MutationType.patchObject, - payload: partialStateOrMutator, - storeId: $id, - events: debuggerEvents, - }; - } - const myListenerId = (activeListener = Symbol()); - vueDemi.nextTick().then(() => { - if (activeListener === myListenerId) { - isListening = true; - } - }); - isSyncListening = true; - // because we paused the watcher, we need to manually call the subscriptions - triggerSubscriptions(subscriptions, subscriptionMutation, pinia.state.value[$id]); - } - const $reset = isOptionsStore - ? function $reset() { - const { state } = options; - const newState = state ? state() : {}; - // we use a patch to group all changes into one single subscription - this.$patch(($state) => { - assign($state, newState); - }); - } - : /* istanbul ignore next */ - (process.env.NODE_ENV !== 'production') - ? () => { - throw new Error(`🍍: Store "${$id}" is built using the setup syntax and does not implement $reset().`); - } - : noop; - function $dispose() { - scope.stop(); - subscriptions = []; - actionSubscriptions = []; - pinia._s.delete($id); - } - /** - * Wraps an action to handle subscriptions. - * - * @param name - name of the action - * @param action - action to wrap - * @returns a wrapped action to handle subscriptions - */ - function wrapAction(name, action) { - return function () { - setActivePinia(pinia); - const args = Array.from(arguments); - const afterCallbackList = []; - const onErrorCallbackList = []; - function after(callback) { - afterCallbackList.push(callback); - } - function onError(callback) { - onErrorCallbackList.push(callback); - } - // @ts-expect-error - triggerSubscriptions(actionSubscriptions, { - args, - name, - store, - after, - onError, - }); - let ret; - try { - ret = action.apply(this && this.$id === $id ? this : store, args); - // handle sync errors - } - catch (error) { - triggerSubscriptions(onErrorCallbackList, error); - throw error; - } - if (ret instanceof Promise) { - return ret - .then((value) => { - triggerSubscriptions(afterCallbackList, value); - return value; - }) - .catch((error) => { - triggerSubscriptions(onErrorCallbackList, error); - return Promise.reject(error); - }); - } - // trigger after callbacks - triggerSubscriptions(afterCallbackList, ret); - return ret; - }; - } - const _hmrPayload = /*#__PURE__*/ vueDemi.markRaw({ - actions: {}, - getters: {}, - state: [], - hotState, - }); - const partialStore = { - _p: pinia, - // _s: scope, - $id, - $onAction: addSubscription.bind(null, actionSubscriptions), - $patch, - $reset, - $subscribe(callback, options = {}) { - const removeSubscription = addSubscription(subscriptions, callback, options.detached, () => stopWatcher()); - const stopWatcher = scope.run(() => vueDemi.watch(() => pinia.state.value[$id], (state) => { - if (options.flush === 'sync' ? isSyncListening : isListening) { - callback({ - storeId: $id, - type: exports.MutationType.direct, - events: debuggerEvents, - }, state); - } - }, assign({}, $subscribeOptions, options))); - return removeSubscription; - }, - $dispose, - }; - /* istanbul ignore if */ - if (vueDemi.isVue2) { - // start as non ready - partialStore._r = false; - } - const store = vueDemi.reactive((process.env.NODE_ENV !== 'production') || USE_DEVTOOLS - ? assign({ - _hmrPayload, - _customProperties: vueDemi.markRaw(new Set()), // devtools custom properties - }, partialStore - // must be added later - // setupStore - ) - : partialStore); - // store the partial store now so the setup of stores can instantiate each other before they are finished without - // creating infinite loops. - pinia._s.set($id, store); - const runWithContext = (pinia._a && pinia._a.runWithContext) || fallbackRunWithContext; - // TODO: idea create skipSerialize that marks properties as non serializable and they are skipped - const setupStore = pinia._e.run(() => { - scope = vueDemi.effectScope(); - return runWithContext(() => scope.run(setup)); - }); - // overwrite existing actions to support $onAction - for (const key in setupStore) { - const prop = setupStore[key]; - if ((vueDemi.isRef(prop) && !isComputed(prop)) || vueDemi.isReactive(prop)) { - // mark it as a piece of state to be serialized - if ((process.env.NODE_ENV !== 'production') && hot) { - vueDemi.set(hotState.value, key, vueDemi.toRef(setupStore, key)); - // createOptionStore directly sets the state in pinia.state.value so we - // can just skip that - } - else if (!isOptionsStore) { - // in setup stores we must hydrate the state and sync pinia state tree with the refs the user just created - if (initialState && shouldHydrate(prop)) { - if (vueDemi.isRef(prop)) { - prop.value = initialState[key]; - } - else { - // probably a reactive object, lets recursively assign - // @ts-expect-error: prop is unknown - mergeReactiveObjects(prop, initialState[key]); - } - } - // transfer the ref to the pinia state to keep everything in sync - /* istanbul ignore if */ - if (vueDemi.isVue2) { - vueDemi.set(pinia.state.value[$id], key, prop); - } - else { - pinia.state.value[$id][key] = prop; - } - } - /* istanbul ignore else */ - if ((process.env.NODE_ENV !== 'production')) { - _hmrPayload.state.push(key); - } - // action - } - else if (typeof prop === 'function') { - // @ts-expect-error: we are overriding the function we avoid wrapping if - const actionValue = (process.env.NODE_ENV !== 'production') && hot ? prop : wrapAction(key, prop); - // this a hot module replacement store because the hotUpdate method needs - // to do it with the right context - /* istanbul ignore if */ - if (vueDemi.isVue2) { - vueDemi.set(setupStore, key, actionValue); - } - else { - // @ts-expect-error - setupStore[key] = actionValue; - } - /* istanbul ignore else */ - if ((process.env.NODE_ENV !== 'production')) { - _hmrPayload.actions[key] = prop; - } - // list actions so they can be used in plugins - // @ts-expect-error - optionsForPlugin.actions[key] = prop; - } - else if ((process.env.NODE_ENV !== 'production')) { - // add getters for devtools - if (isComputed(prop)) { - _hmrPayload.getters[key] = isOptionsStore - ? // @ts-expect-error - options.getters[key] - : prop; - if (IS_CLIENT) { - const getters = setupStore._getters || - // @ts-expect-error: same - (setupStore._getters = vueDemi.markRaw([])); - getters.push(key); - } - } - } - } - // add the state, getters, and action properties - /* istanbul ignore if */ - if (vueDemi.isVue2) { - Object.keys(setupStore).forEach((key) => { - vueDemi.set(store, key, setupStore[key]); - }); - } - else { - assign(store, setupStore); - // allows retrieving reactive objects with `storeToRefs()`. Must be called after assigning to the reactive object. - // Make `storeToRefs()` work with `reactive()` #799 - assign(vueDemi.toRaw(store), setupStore); - } - // use this instead of a computed with setter to be able to create it anywhere - // without linking the computed lifespan to wherever the store is first - // created. - Object.defineProperty(store, '$state', { - get: () => ((process.env.NODE_ENV !== 'production') && hot ? hotState.value : pinia.state.value[$id]), - set: (state) => { - /* istanbul ignore if */ - if ((process.env.NODE_ENV !== 'production') && hot) { - throw new Error('cannot set hotState'); - } - $patch(($state) => { - assign($state, state); - }); - }, - }); - // add the hotUpdate before plugins to allow them to override it - /* istanbul ignore else */ - if ((process.env.NODE_ENV !== 'production')) { - store._hotUpdate = vueDemi.markRaw((newStore) => { - store._hotUpdating = true; - newStore._hmrPayload.state.forEach((stateKey) => { - if (stateKey in store.$state) { - const newStateTarget = newStore.$state[stateKey]; - const oldStateSource = store.$state[stateKey]; - if (typeof newStateTarget === 'object' && - isPlainObject(newStateTarget) && - isPlainObject(oldStateSource)) { - patchObject(newStateTarget, oldStateSource); - } - else { - // transfer the ref - newStore.$state[stateKey] = oldStateSource; - } - } - // patch direct access properties to allow store.stateProperty to work as - // store.$state.stateProperty - vueDemi.set(store, stateKey, vueDemi.toRef(newStore.$state, stateKey)); - }); - // remove deleted state properties - Object.keys(store.$state).forEach((stateKey) => { - if (!(stateKey in newStore.$state)) { - vueDemi.del(store, stateKey); - } - }); - // avoid devtools logging this as a mutation - isListening = false; - isSyncListening = false; - pinia.state.value[$id] = vueDemi.toRef(newStore._hmrPayload, 'hotState'); - isSyncListening = true; - vueDemi.nextTick().then(() => { - isListening = true; - }); - for (const actionName in newStore._hmrPayload.actions) { - const action = newStore[actionName]; - vueDemi.set(store, actionName, wrapAction(actionName, action)); - } - // TODO: does this work in both setup and option store? - for (const getterName in newStore._hmrPayload.getters) { - const getter = newStore._hmrPayload.getters[getterName]; - const getterValue = isOptionsStore - ? // special handling of options api - vueDemi.computed(() => { - setActivePinia(pinia); - return getter.call(store, store); - }) - : getter; - vueDemi.set(store, getterName, getterValue); - } - // remove deleted getters - Object.keys(store._hmrPayload.getters).forEach((key) => { - if (!(key in newStore._hmrPayload.getters)) { - vueDemi.del(store, key); - } - }); - // remove old actions - Object.keys(store._hmrPayload.actions).forEach((key) => { - if (!(key in newStore._hmrPayload.actions)) { - vueDemi.del(store, key); - } - }); - // update the values used in devtools and to allow deleting new properties later on - store._hmrPayload = newStore._hmrPayload; - store._getters = newStore._getters; - store._hotUpdating = false; - }); - } - if (USE_DEVTOOLS) { - const nonEnumerable = { - writable: true, - configurable: true, - // avoid warning on devtools trying to display this property - enumerable: false, - }; - ['_p', '_hmrPayload', '_getters', '_customProperties'].forEach((p) => { - Object.defineProperty(store, p, assign({ value: store[p] }, nonEnumerable)); - }); - } - /* istanbul ignore if */ - if (vueDemi.isVue2) { - // mark the store as ready before plugins - store._r = true; - } - // apply all plugins - pinia._p.forEach((extender) => { - /* istanbul ignore else */ - if (USE_DEVTOOLS) { - const extensions = scope.run(() => extender({ - store, - app: pinia._a, - pinia, - options: optionsForPlugin, - })); - Object.keys(extensions || {}).forEach((key) => store._customProperties.add(key)); - assign(store, extensions); - } - else { - assign(store, scope.run(() => extender({ - store, - app: pinia._a, - pinia, - options: optionsForPlugin, - }))); - } - }); - if ((process.env.NODE_ENV !== 'production') && - store.$state && - typeof store.$state === 'object' && - typeof store.$state.constructor === 'function' && - !store.$state.constructor.toString().includes('[native code]')) { - console.warn(`[🍍]: The "state" must be a plain object. It cannot be\n` + - `\tstate: () => new MyClass()\n` + - `Found in store "${store.$id}".`); - } - // only apply hydrate to option stores with an initial state in pinia - if (initialState && - isOptionsStore && - options.hydrate) { - options.hydrate(store.$state, initialState); - } - isListening = true; - isSyncListening = true; - return store; -} -function defineStore( -// TODO: add proper types from above -idOrOptions, setup, setupOptions) { - let id; - let options; - const isSetupStore = typeof setup === 'function'; - if (typeof idOrOptions === 'string') { - id = idOrOptions; - // the option store setup will contain the actual options in this case - options = isSetupStore ? setupOptions : setup; - } - else { - options = idOrOptions; - id = idOrOptions.id; - if ((process.env.NODE_ENV !== 'production') && typeof id !== 'string') { - throw new Error(`[🍍]: "defineStore()" must be passed a store id as its first argument.`); - } - } - function useStore(pinia, hot) { - const hasContext = vueDemi.hasInjectionContext(); - pinia = - // in test mode, ignore the argument provided as we can always retrieve a - // pinia instance with getActivePinia() - ((process.env.NODE_ENV === 'test') && activePinia && activePinia._testing ? null : pinia) || - (hasContext ? vueDemi.inject(piniaSymbol, null) : null); - if (pinia) - setActivePinia(pinia); - if ((process.env.NODE_ENV !== 'production') && !activePinia) { - throw new Error(`[🍍]: "getActivePinia()" was called but there was no active Pinia. Did you forget to install pinia?\n` + - `\tconst pinia = createPinia()\n` + - `\tapp.use(pinia)\n` + - `This will fail in production.`); - } - pinia = activePinia; - if (!pinia._s.has(id)) { - // creating the store registers it in `pinia._s` - if (isSetupStore) { - createSetupStore(id, setup, options, pinia); - } - else { - createOptionsStore(id, options, pinia); - } - /* istanbul ignore else */ - if ((process.env.NODE_ENV !== 'production')) { - // @ts-expect-error: not the right inferred type - useStore._pinia = pinia; - } - } - const store = pinia._s.get(id); - if ((process.env.NODE_ENV !== 'production') && hot) { - const hotId = '__hot:' + id; - const newStore = isSetupStore - ? createSetupStore(hotId, setup, options, pinia, true) - : createOptionsStore(hotId, assign({}, options), pinia, true); - hot._hotUpdate(newStore); - // cleanup the state properties and the store from the cache - delete pinia.state.value[hotId]; - pinia._s.delete(hotId); - } - if ((process.env.NODE_ENV !== 'production') && IS_CLIENT) { - const currentInstance = vueDemi.getCurrentInstance(); - // save stores in instances to access them devtools - if (currentInstance && - currentInstance.proxy && - // avoid adding stores that are just built for hot module replacement - !hot) { - const vm = currentInstance.proxy; - const cache = '_pStores' in vm ? vm._pStores : (vm._pStores = {}); - cache[id] = store; - } - } - // StoreGeneric cannot be casted towards Store - return store; - } - useStore.$id = id; - return useStore; -} - -let mapStoreSuffix = 'Store'; -/** - * Changes the suffix added by `mapStores()`. Can be set to an empty string. - * Defaults to `"Store"`. Make sure to extend the MapStoresCustomization - * interface if you are using TypeScript. - * - * @param suffix - new suffix - */ -function setMapStoreSuffix(suffix // could be 'Store' but that would be annoying for JS -) { - mapStoreSuffix = suffix; -} -/** - * Allows using stores without the composition API (`setup()`) by generating an - * object to be spread in the `computed` field of a component. It accepts a list - * of store definitions. - * - * @example - * ```js - * export default { - * computed: { - * // other computed properties - * ...mapStores(useUserStore, useCartStore) - * }, - * - * created() { - * this.userStore // store with id "user" - * this.cartStore // store with id "cart" - * } - * } - * ``` - * - * @param stores - list of stores to map to an object - */ -function mapStores(...stores) { - if ((process.env.NODE_ENV !== 'production') && Array.isArray(stores[0])) { - console.warn(`[🍍]: Directly pass all stores to "mapStores()" without putting them in an array:\n` + - `Replace\n` + - `\tmapStores([useAuthStore, useCartStore])\n` + - `with\n` + - `\tmapStores(useAuthStore, useCartStore)\n` + - `This will fail in production if not fixed.`); - stores = stores[0]; - } - return stores.reduce((reduced, useStore) => { - // @ts-expect-error: $id is added by defineStore - reduced[useStore.$id + mapStoreSuffix] = function () { - return useStore(this.$pinia); - }; - return reduced; - }, {}); -} -/** - * Allows using state and getters from one store without using the composition - * API (`setup()`) by generating an object to be spread in the `computed` field - * of a component. - * - * @param useStore - store to map from - * @param keysOrMapper - array or object - */ -function mapState(useStore, keysOrMapper) { - return Array.isArray(keysOrMapper) - ? keysOrMapper.reduce((reduced, key) => { - reduced[key] = function () { - return useStore(this.$pinia)[key]; - }; - return reduced; - }, {}) - : Object.keys(keysOrMapper).reduce((reduced, key) => { - // @ts-expect-error - reduced[key] = function () { - const store = useStore(this.$pinia); - const storeKey = keysOrMapper[key]; - // for some reason TS is unable to infer the type of storeKey to be a - // function - return typeof storeKey === 'function' - ? storeKey.call(this, store) - : store[storeKey]; - }; - return reduced; - }, {}); -} -/** - * Alias for `mapState()`. You should use `mapState()` instead. - * @deprecated use `mapState()` instead. - */ -const mapGetters = mapState; -/** - * Allows directly using actions from your store without using the composition - * API (`setup()`) by generating an object to be spread in the `methods` field - * of a component. - * - * @param useStore - store to map from - * @param keysOrMapper - array or object - */ -function mapActions(useStore, keysOrMapper) { - return Array.isArray(keysOrMapper) - ? keysOrMapper.reduce((reduced, key) => { - // @ts-expect-error - reduced[key] = function (...args) { - return useStore(this.$pinia)[key](...args); - }; - return reduced; - }, {}) - : Object.keys(keysOrMapper).reduce((reduced, key) => { - // @ts-expect-error - reduced[key] = function (...args) { - return useStore(this.$pinia)[keysOrMapper[key]](...args); - }; - return reduced; - }, {}); -} -/** - * Allows using state and getters from one store without using the composition - * API (`setup()`) by generating an object to be spread in the `computed` field - * of a component. - * - * @param useStore - store to map from - * @param keysOrMapper - array or object - */ -function mapWritableState(useStore, keysOrMapper) { - return Array.isArray(keysOrMapper) - ? keysOrMapper.reduce((reduced, key) => { - // @ts-ignore - reduced[key] = { - get() { - return useStore(this.$pinia)[key]; - }, - set(value) { - // it's easier to type it here as any - return (useStore(this.$pinia)[key] = value); - }, - }; - return reduced; - }, {}) - : Object.keys(keysOrMapper).reduce((reduced, key) => { - // @ts-ignore - reduced[key] = { - get() { - return useStore(this.$pinia)[keysOrMapper[key]]; - }, - set(value) { - // it's easier to type it here as any - return (useStore(this.$pinia)[keysOrMapper[key]] = value); - }, - }; - return reduced; - }, {}); -} - -/** - * Creates an object of references with all the state, getters, and plugin-added - * state properties of the store. Similar to `toRefs()` but specifically - * designed for Pinia stores so methods and non reactive properties are - * completely ignored. - * - * @param store - store to extract the refs from - */ -function storeToRefs(store) { - // See https://github.com/vuejs/pinia/issues/852 - // It's easier to just use toRefs() even if it includes more stuff - if (vueDemi.isVue2) { - // @ts-expect-error: toRefs include methods and others - return vueDemi.toRefs(store); - } - else { - store = vueDemi.toRaw(store); - const refs = {}; - for (const key in store) { - const value = store[key]; - if (vueDemi.isRef(value) || vueDemi.isReactive(value)) { - // @ts-expect-error: the key is state or getter - refs[key] = - // --- - vueDemi.toRef(store, key); - } - } - return refs; - } -} - -/** - * Vue 2 Plugin that must be installed for pinia to work. Note **you don't need - * this plugin if you are using Nuxt.js**. Use the `buildModule` instead: - * https://pinia.vuejs.org/ssr/nuxt.html. - * - * @example - * ```js - * import Vue from 'vue' - * import { PiniaVuePlugin, createPinia } from 'pinia' - * - * Vue.use(PiniaVuePlugin) - * const pinia = createPinia() - * - * new Vue({ - * el: '#app', - * // ... - * pinia, - * }) - * ``` - * - * @param _Vue - `Vue` imported from 'vue'. - */ -const PiniaVuePlugin = function (_Vue) { - // Equivalent of - // app.config.globalProperties.$pinia = pinia - _Vue.mixin({ - beforeCreate() { - const options = this.$options; - if (options.pinia) { - const pinia = options.pinia; - // HACK: taken from provide(): https://github.com/vuejs/composition-api/blob/main/src/apis/inject.ts#L31 - /* istanbul ignore else */ - if (!this._provided) { - const provideCache = {}; - Object.defineProperty(this, '_provided', { - get: () => provideCache, - set: (v) => Object.assign(provideCache, v), - }); - } - this._provided[piniaSymbol] = pinia; - // propagate the pinia instance in an SSR friendly way - // avoid adding it to nuxt twice - /* istanbul ignore else */ - if (!this.$pinia) { - this.$pinia = pinia; - } - pinia._a = this; - if (IS_CLIENT) { - // this allows calling useStore() outside of a component setup after - // installing pinia's plugin - setActivePinia(pinia); - } - if (USE_DEVTOOLS) { - registerPiniaDevtools(pinia._a, pinia); - } - } - else if (!this.$pinia && options.parent && options.parent.$pinia) { - this.$pinia = options.parent.$pinia; - } - }, - destroyed() { - delete this._pStores; - }, - }); -}; - -exports.PiniaVuePlugin = PiniaVuePlugin; -exports.acceptHMRUpdate = acceptHMRUpdate; -exports.createPinia = createPinia; -exports.defineStore = defineStore; -exports.getActivePinia = getActivePinia; -exports.mapActions = mapActions; -exports.mapGetters = mapGetters; -exports.mapState = mapState; -exports.mapStores = mapStores; -exports.mapWritableState = mapWritableState; -exports.setActivePinia = setActivePinia; -exports.setMapStoreSuffix = setMapStoreSuffix; -exports.skipHydrate = skipHydrate; -exports.storeToRefs = storeToRefs; diff --git a/node_modules/pinia/dist/pinia.d.ts b/node_modules/pinia/dist/pinia.d.ts deleted file mode 100644 index 0b3851f..0000000 --- a/node_modules/pinia/dist/pinia.d.ts +++ /dev/null @@ -1,986 +0,0 @@ -import { App } from 'vue-demi'; -import { ComputedRef } from 'vue-demi'; -import type { DebuggerEvent } from 'vue-demi'; -import { EffectScope } from 'vue-demi'; -import type { Plugin as Plugin_2 } from 'vue-demi'; -import { Ref } from 'vue-demi'; -import { ToRef } from 'vue-demi'; -import { ToRefs } from 'vue-demi'; -import { UnwrapRef } from 'vue-demi'; -import type { WatchOptions } from 'vue-demi'; - -/** - * Creates an _accept_ function to pass to `import.meta.hot` in Vite applications. - * - * @example - * ```js - * const useUser = defineStore(...) - * if (import.meta.hot) { - * import.meta.hot.accept(acceptHMRUpdate(useUser, import.meta.hot)) - * } - * ``` - * - * @param initialUseStore - return of the defineStore to hot update - * @param hot - `import.meta.hot` - */ -export declare function acceptHMRUpdate = _GettersTree, A = _ActionsTree>(initialUseStore: StoreDefinition, hot: any): (newModule: any) => any; - -/** - * Type of an object of Actions. For internal usage only. - * For internal use **only** - */ -export declare type _ActionsTree = Record; - -export declare type _Awaited = T extends null | undefined ? T : T extends object & { - then(onfulfilled: infer F): any; -} ? F extends (value: infer V, ...args: any) => any ? _Awaited : never : T; - -/** - * Creates a Pinia instance to be used by the application - */ -export declare function createPinia(): Pinia; - -/** - * Recursive `Partial`. Used by {@link Store['$patch']}. - * - * For internal use **only** - */ -export declare type _DeepPartial = { - [K in keyof T]?: _DeepPartial; -}; - -/** - * Options parameter of `defineStore()` for setup stores. Can be extended to - * augment stores with the plugin API. @see {@link DefineStoreOptionsBase}. - */ -export declare interface DefineSetupStoreOptions extends DefineStoreOptionsBase> { - /** - * Extracted actions. Added by useStore(). SHOULD NOT be added by the user when - * creating the store. Can be used in plugins to get the list of actions in a - * store defined with a setup function. Note this is always defined - */ - actions?: A; -} - -/** - * Creates a `useStore` function that retrieves the store instance - * - * @param id - id of the store (must be unique) - * @param options - options to define the store - */ -export declare function defineStore = {}, A = {}>(id: Id, options: Omit, 'id'>): StoreDefinition; - -/** - * Creates a `useStore` function that retrieves the store instance - * - * @param options - options to define the store - */ -export declare function defineStore = {}, A = {}>(options: DefineStoreOptions): StoreDefinition; - -/** - * Creates a `useStore` function that retrieves the store instance - * - * @param id - id of the store (must be unique) - * @param storeSetup - function that defines the store - * @param options - extra options - */ -export declare function defineStore(id: Id, storeSetup: () => SS, options?: DefineSetupStoreOptions, _ExtractGettersFromSetupStore, _ExtractActionsFromSetupStore>): StoreDefinition, _ExtractGettersFromSetupStore, _ExtractActionsFromSetupStore>; - -/** - * Options parameter of `defineStore()` for option stores. Can be extended to - * augment stores with the plugin API. @see {@link DefineStoreOptionsBase}. - */ -export declare interface DefineStoreOptions extends DefineStoreOptionsBase> { - /** - * Unique string key to identify the store across the application. - */ - id: Id; - /** - * Function to create a fresh state. **Must be an arrow function** to ensure - * correct typings! - */ - state?: () => S; - /** - * Optional object of getters. - */ - getters?: G & ThisType & _StoreWithGetters & PiniaCustomProperties> & _GettersTree; - /** - * Optional object of actions. - */ - actions?: A & ThisType & _StoreWithState & _StoreWithGetters & PiniaCustomProperties>; - /** - * Allows hydrating the store during SSR when complex state (like client side only refs) are used in the store - * definition and copying the value from `pinia.state` isn't enough. - * - * @example - * If in your `state`, you use any `customRef`s, any `computed`s, or any `ref`s that have a different value on - * Server and Client, you need to manually hydrate them. e.g., a custom ref that is stored in the local - * storage: - * - * ```ts - * const useStore = defineStore('main', { - * state: () => ({ - * n: useLocalStorage('key', 0) - * }), - * hydrate(storeState, initialState) { - * // @ts-expect-error: https://github.com/microsoft/TypeScript/issues/43826 - * storeState.n = useLocalStorage('key', 0) - * } - * }) - * ``` - * - * @param storeState - the current state in the store - * @param initialState - initialState - */ - hydrate?(storeState: UnwrapRef, initialState: UnwrapRef): void; -} - -/** - * Options passed to `defineStore()` that are common between option and setup - * stores. Extend this interface if you want to add custom options to both kinds - * of stores. - */ -export declare interface DefineStoreOptionsBase { -} - -/** - * Available `options` when creating a pinia plugin. - */ -export declare interface DefineStoreOptionsInPlugin extends Omit, 'id' | 'actions'> { - /** - * Extracted object of actions. Added by useStore() when the store is built - * using the setup API, otherwise uses the one passed to `defineStore()`. - * Defaults to an empty object if no actions are defined. - */ - actions: A; -} - -/** - * For internal use **only** - */ -export declare type _ExtractActionsFromSetupStore = SS extends undefined | void ? {} : _ExtractActionsFromSetupStore_Keys extends keyof SS ? Pick> : never; - -/** - * Type that enables refactoring through IDE. - * For internal use **only** - */ -export declare type _ExtractActionsFromSetupStore_Keys = keyof { - [K in keyof SS as SS[K] extends _Method ? K : never]: any; -}; - -/** - * For internal use **only** - */ -export declare type _ExtractGettersFromSetupStore = SS extends undefined | void ? {} : _ExtractGettersFromSetupStore_Keys extends keyof SS ? Pick> : never; - -/** - * Type that enables refactoring through IDE. - * For internal use **only** - */ -export declare type _ExtractGettersFromSetupStore_Keys = keyof { - [K in keyof SS as SS[K] extends ComputedRef ? K : never]: any; -}; - -/** - * For internal use **only** - */ -export declare type _ExtractStateFromSetupStore = SS extends undefined | void ? {} : _ExtractStateFromSetupStore_Keys extends keyof SS ? _UnwrapAll>> : never; - -/** - * Type that enables refactoring through IDE. - * For internal use **only** - */ -export declare type _ExtractStateFromSetupStore_Keys = keyof { - [K in keyof SS as SS[K] extends _Method | ComputedRef ? never : K]: any; -}; - -/** - * Get the currently active pinia if there is any. - */ -export declare const getActivePinia: () => Pinia | undefined; - -/** - * Type of an object of Getters that infers the argument. For internal usage only. - * For internal use **only** - */ -export declare type _GettersTree = Record & UnwrapRef>) => any) | (() => any)>; - -/** - * Allows directly using actions from your store without using the composition - * API (`setup()`) by generating an object to be spread in the `methods` field - * of a component. The values of the object are the actions while the keys are - * the names of the resulting methods. - * - * @example - * ```js - * export default { - * methods: { - * // other methods properties - * // useCounterStore has two actions named `increment` and `setCount` - * ...mapActions(useCounterStore, { moar: 'increment', setIt: 'setCount' }) - * }, - * - * created() { - * this.moar() - * this.setIt(2) - * } - * } - * ``` - * - * @param useStore - store to map from - * @param keyMapper - object to define new names for the actions - */ -export declare function mapActions, A, KeyMapper extends Record>(useStore: StoreDefinition, keyMapper: KeyMapper): _MapActionsObjectReturn; - -/** - * Allows directly using actions from your store without using the composition - * API (`setup()`) by generating an object to be spread in the `methods` field - * of a component. - * - * @example - * ```js - * export default { - * methods: { - * // other methods properties - * ...mapActions(useCounterStore, ['increment', 'setCount']) - * }, - * - * created() { - * this.increment() - * this.setCount(2) // pass arguments as usual - * } - * } - * ``` - * - * @param useStore - store to map from - * @param keys - array of action names to map - */ -export declare function mapActions, A>(useStore: StoreDefinition, keys: Array): _MapActionsReturn; - -/** - * For internal use **only** - */ -export declare type _MapActionsObjectReturn> = { - [key in keyof T]: A[T[key]]; -}; - -/** - * For internal use **only** - */ -export declare type _MapActionsReturn = { - [key in keyof A]: A[key]; -}; - -/** - * Alias for `mapState()`. You should use `mapState()` instead. - * @deprecated use `mapState()` instead. - */ -export declare const mapGetters: typeof mapState; - -/** - * Allows using state and getters from one store without using the composition - * API (`setup()`) by generating an object to be spread in the `computed` field - * of a component. The values of the object are the state properties/getters - * while the keys are the names of the resulting computed properties. - * Optionally, you can also pass a custom function that will receive the store - * as its first argument. Note that while it has access to the component - * instance via `this`, it won't be typed. - * - * @example - * ```js - * export default { - * computed: { - * // other computed properties - * // useCounterStore has a state property named `count` and a getter `double` - * ...mapState(useCounterStore, { - * n: 'count', - * triple: store => store.n * 3, - * // note we can't use an arrow function if we want to use `this` - * custom(store) { - * return this.someComponentValue + store.n - * }, - * doubleN: 'double' - * }) - * }, - * - * created() { - * this.n // 2 - * this.doubleN // 4 - * } - * } - * ``` - * - * @param useStore - store to map from - * @param keyMapper - object of state properties or getters - */ -export declare function mapState, A, KeyMapper extends Record) => any)>>(useStore: StoreDefinition, keyMapper: KeyMapper): _MapStateObjectReturn; - -/** - * Allows using state and getters from one store without using the composition - * API (`setup()`) by generating an object to be spread in the `computed` field - * of a component. - * - * @example - * ```js - * export default { - * computed: { - * // other computed properties - * ...mapState(useCounterStore, ['count', 'double']) - * }, - * - * created() { - * this.count // 2 - * this.double // 4 - * } - * } - * ``` - * - * @param useStore - store to map from - * @param keys - array of state properties or getters - */ -export declare function mapState, A, Keys extends keyof S | keyof G>(useStore: StoreDefinition, keys: readonly Keys[]): _MapStateReturn; - -/** - * For internal use **only** - */ -export declare type _MapStateObjectReturn, A, T extends Record) => any)> = {}> = { - [key in keyof T]: () => T[key] extends (store: any) => infer R ? R : T[key] extends keyof Store ? Store[T[key]] : never; -}; - -/** - * For internal use **only** - */ -export declare type _MapStateReturn, Keys extends keyof S | keyof G = keyof S | keyof G> = { - [key in Keys]: () => Store[key]; -}; - -/** - * Allows using stores without the composition API (`setup()`) by generating an - * object to be spread in the `computed` field of a component. It accepts a list - * of store definitions. - * - * @example - * ```js - * export default { - * computed: { - * // other computed properties - * ...mapStores(useUserStore, useCartStore) - * }, - * - * created() { - * this.userStore // store with id "user" - * this.cartStore // store with id "cart" - * } - * } - * ``` - * - * @param stores - list of stores to map to an object - */ -export declare function mapStores(...stores: [...Stores]): _Spread; - -/** - * Interface to allow customizing map helpers. Extend this interface with the - * following properties: - * - * - `suffix`: string. Affects the suffix of `mapStores()`, defaults to `Store`. - */ -export declare interface MapStoresCustomization { -} - -/** - * Same as `mapState()` but creates computed setters as well so the state can be - * modified. Differently from `mapState()`, only `state` properties can be - * added. - * - * @param useStore - store to map from - * @param keyMapper - object of state properties - */ -export declare function mapWritableState, A, KeyMapper extends Record>(useStore: StoreDefinition, keyMapper: KeyMapper): _MapWritableStateObjectReturn; - -/** - * Allows using state and getters from one store without using the composition - * API (`setup()`) by generating an object to be spread in the `computed` field - * of a component. - * - * @param useStore - store to map from - * @param keys - array of state properties - */ -export declare function mapWritableState, A, Keys extends keyof S>(useStore: StoreDefinition, keys: readonly Keys[]): { - [K in Keys]: { - get: () => S[K]; - set: (value: S[K]) => any; - }; -}; - -/** - * For internal use **only** - */ -export declare type _MapWritableStateObjectReturn> = { - [key in keyof T]: { - get: () => S[T[key]]; - set: (value: S[T[key]]) => any; - }; -}; - -/** - * For internal use **only** - */ -export declare type _MapWritableStateReturn = { - [key in keyof S]: { - get: () => S[key]; - set: (value: S[key]) => any; - }; -}; - -/** - * Generic type for a function that can infer arguments and return type - * - * For internal use **only** - */ -export declare type _Method = (...args: any[]) => any; - -/** - * Possible types for SubscriptionCallback - */ -export declare enum MutationType { - /** - * Direct mutation of the state: - * - * - `store.name = 'new name'` - * - `store.$state.name = 'new name'` - * - `store.list.push('new item')` - */ - direct = "direct", - /** - * Mutated the state with `$patch` and an object - * - * - `store.$patch({ name: 'newName' })` - */ - patchObject = "patch object", - /** - * Mutated the state with `$patch` and a function - * - * - `store.$patch(state => state.name = 'newName')` - */ - patchFunction = "patch function" -} - -/** - * Every application must own its own pinia to be able to create stores - */ -export declare interface Pinia { - install: (app: App) => void; - /** - * root state - */ - state: Ref>; - /** - * Adds a store plugin to extend every store - * - * @param plugin - store plugin to add - */ - use(plugin: PiniaPlugin): Pinia; - /* Excluded from this release type: _p */ - /* Excluded from this release type: _a */ - /* Excluded from this release type: _e */ - /* Excluded from this release type: _s */ - /* Excluded from this release type: _testing */ -} - -/** - * Interface to be extended by the user when they add properties through plugins. - */ -export declare interface PiniaCustomProperties, A = _ActionsTree> { -} - -/** - * Properties that are added to every `store.$state` by `pinia.use()`. - */ -export declare interface PiniaCustomStateProperties { -} - -/** - * Plugin to extend every store. - */ -export declare interface PiniaPlugin { - /** - * Plugin to extend every store. Returns an object to extend the store or - * nothing. - * - * @param context - Context - */ - (context: PiniaPluginContext): Partial | void; -} - -/** - * Context argument passed to Pinia plugins. - */ -export declare interface PiniaPluginContext, A = _ActionsTree> { - /** - * pinia instance. - */ - pinia: Pinia; - /** - * Current app created with `Vue.createApp()`. - */ - app: App; - /** - * Current store being extended. - */ - store: Store; - /** - * Initial options defining the store when calling `defineStore()`. - */ - options: DefineStoreOptionsInPlugin; -} - -/** - * Plugin to extend every store. - * @deprecated use PiniaPlugin instead - */ -export declare type PiniaStorePlugin = PiniaPlugin; - -/** - * Vue 2 Plugin that must be installed for pinia to work. Note **you don't need - * this plugin if you are using Nuxt.js**. Use the `buildModule` instead: - * https://pinia.vuejs.org/ssr/nuxt.html. - * - * @example - * ```js - * import Vue from 'vue' - * import { PiniaVuePlugin, createPinia } from 'pinia' - * - * Vue.use(PiniaVuePlugin) - * const pinia = createPinia() - * - * new Vue({ - * el: '#app', - * // ... - * pinia, - * }) - * ``` - * - * @param _Vue - `Vue` imported from 'vue'. - */ -export declare const PiniaVuePlugin: Plugin_2; - -declare interface _SetActivePinia { - (pinia: Pinia): Pinia; - (pinia: undefined): undefined; - (pinia: Pinia | undefined): Pinia | undefined; -} - -/** - * Sets or unsets the active pinia. Used in SSR and internally when calling - * actions and getters - * - * @param pinia - Pinia instance - */ -export declare const setActivePinia: _SetActivePinia; - -/** - * Changes the suffix added by `mapStores()`. Can be set to an empty string. - * Defaults to `"Store"`. Make sure to extend the MapStoresCustomization - * interface if you are using TypeScript. - * - * @param suffix - new suffix - */ -export declare function setMapStoreSuffix(suffix: MapStoresCustomization extends Record<'suffix', infer Suffix> ? Suffix : string): void; - -/** - * Tells Pinia to skip the hydration process of a given object. This is useful in setup stores (only) when you return a - * stateful object in the store but it isn't really state. e.g. returning a router instance in a setup store. - * - * @param obj - target object - * @returns obj - */ -export declare function skipHydrate(obj: T): T; - -/** - * For internal use **only**. - */ -export declare type _Spread = A extends [infer L, ...infer R] ? _StoreObject & _Spread : unknown; - -/** - * Generic state of a Store - */ -export declare type StateTree = Record; - -/** - * Store type to build a store. - */ -export declare type Store = _StoreWithState & UnwrapRef & _StoreWithGetters & (_ActionsTree extends A ? {} : A) & PiniaCustomProperties & PiniaCustomStateProperties; - -/** - * Extract the actions of a store type. Works with both a Setup Store or an - * Options Store. - */ -export declare type StoreActions = SS extends Store, infer A> ? A : _ExtractActionsFromSetupStore; - -/** - * Return type of `defineStore()`. Function that allows instantiating a store. - */ -export declare interface StoreDefinition, A = _ActionsTree> { - /** - * Returns a store, creates it if necessary. - * - * @param pinia - Pinia instance to retrieve the store - * @param hot - dev only hot module replacement - */ - (pinia?: Pinia | null | undefined, hot?: StoreGeneric): Store; - /** - * Id of the store. Used by map helpers. - */ - $id: Id; - /* Excluded from this release type: _pinia */ -} - -/** - * Generic and type-unsafe version of Store. Doesn't fail on access with - * strings, making it much easier to write generic functions that do not care - * about the kind of store that is passed. - */ -export declare type StoreGeneric = Store, _ActionsTree>; - -/** - * Extract the getters of a store type. Works with both a Setup Store or an - * Options Store. - */ -export declare type StoreGetters = SS extends Store ? _StoreWithGetters : _ExtractGettersFromSetupStore; - -/** - * For internal use **only**. - */ -export declare type _StoreObject = S extends StoreDefinition ? { - [Id in `${Ids}${MapStoresCustomization extends Record<'suffix', infer Suffix> ? Suffix : 'Store'}`]: () => Store ? Suffix : 'Store'}` ? RealId : string, State, Getters, Actions>; -} : {}; - -/** - * Argument of `store.$onAction()` - */ -export declare type StoreOnActionListener = (context: StoreOnActionListenerContext) => void; - -/** - * Context object passed to callbacks of `store.$onAction(context => {})` - * TODO: should have only the Id, the Store and Actions to generate the proper object - */ -export declare type StoreOnActionListenerContext = _ActionsTree extends A ? _StoreOnActionListenerContext : { - [Name in keyof A]: Name extends string ? _StoreOnActionListenerContext, Name, A> : never; -}[keyof A]; - -/** - * Actual type for {@link StoreOnActionListenerContext}. Exists for refactoring - * purposes. For internal use only. - * For internal use **only** - */ -export declare interface _StoreOnActionListenerContext { - /** - * Name of the action - */ - name: ActionName; - /** - * Store that is invoking the action - */ - store: Store; - /** - * Parameters passed to the action - */ - args: A extends Record ? Parameters : unknown[]; - /** - * Sets up a hook once the action is finished. It receives the return value - * of the action, if it's a Promise, it will be unwrapped. - */ - after: (callback: A extends Record ? (resolvedReturn: _Awaited>) => void : () => void) => void; - /** - * Sets up a hook if the action fails. Return `false` to catch the error and - * stop it from propagating. - */ - onError: (callback: (error: unknown) => void) => void; -} - -/** - * Properties of a store. - */ -export declare interface StoreProperties { - /** - * Unique identifier of the store - */ - $id: Id; - /* Excluded from this release type: _p */ - /* Excluded from this release type: _getters */ - /* Excluded from this release type: _isOptionsAPI */ - /** - * Used by devtools plugin to retrieve properties added with plugins. Removed - * in production. Can be used by the user to add property keys of the store - * that should be displayed in devtools. - */ - _customProperties: Set; - /* Excluded from this release type: _hotUpdate */ - /* Excluded from this release type: _hotUpdating */ - /* Excluded from this release type: _hmrPayload */ -} - -/** - * Extract the state of a store type. Works with both a Setup Store or an - * Options Store. Note this unwraps refs. - */ -export declare type StoreState = SS extends Store, _ActionsTree> ? UnwrapRef : _ExtractStateFromSetupStore; - -/** - * Extracts the return type for `storeToRefs`. - * Will convert any `getters` into `ComputedRef`. - */ -declare type StoreToRefs = ToRefs & PiniaCustomStateProperties>> & ToComputedRefs>; - -/** - * Creates an object of references with all the state, getters, and plugin-added - * state properties of the store. Similar to `toRefs()` but specifically - * designed for Pinia stores so methods and non reactive properties are - * completely ignored. - * - * @param store - store to extract the refs from - */ -export declare function storeToRefs(store: SS): StoreToRefs; - -/** - * Store augmented for actions. For internal usage only. - * For internal use **only** - */ -export declare type _StoreWithActions = { - [k in keyof A]: A[k] extends (...args: infer P) => infer R ? (...args: P) => R : never; -}; - -/** - * Store augmented with getters. For internal usage only. - * For internal use **only** - */ -export declare type _StoreWithGetters = { - readonly [k in keyof G]: G[k] extends (...args: any[]) => infer R ? R : UnwrapRef; -}; - -/** - * Base store with state and functions. Should not be used directly. - */ -export declare interface _StoreWithState extends StoreProperties { - /** - * State of the Store. Setting it will internally call `$patch()` to update the state. - */ - $state: UnwrapRef & PiniaCustomStateProperties; - /** - * Applies a state patch to current state. Allows passing nested values - * - * @param partialState - patch to apply to the state - */ - $patch(partialState: _DeepPartial>): void; - /** - * Group multiple changes into one function. Useful when mutating objects like - * Sets or arrays and applying an object patch isn't practical, e.g. appending - * to an array. The function passed to `$patch()` **must be synchronous**. - * - * @param stateMutator - function that mutates `state`, cannot be asynchronous - */ - $patch) => any>(stateMutator: ReturnType extends Promise ? never : F): void; - /** - * Resets the store to its initial state by building a new state object. - * TODO: make this options only - */ - $reset(): void; - /** - * Setups a callback to be called whenever the state changes. It also returns a function to remove the callback. Note - * that when calling `store.$subscribe()` inside of a component, it will be automatically cleaned up when the - * component gets unmounted unless `detached` is set to true. - * - * @param callback - callback passed to the watcher - * @param options - `watch` options + `detached` to detach the subscription from the context (usually a component) - * this is called from. Note that the `flush` option does not affect calls to `store.$patch()`. - * @returns function that removes the watcher - */ - $subscribe(callback: SubscriptionCallback, options?: { - detached?: boolean; - } & WatchOptions): () => void; - /** - * Setups a callback to be called every time an action is about to get - * invoked. The callback receives an object with all the relevant information - * of the invoked action: - * - `store`: the store it is invoked on - * - `name`: The name of the action - * - `args`: The parameters passed to the action - * - * On top of these, it receives two functions that allow setting up a callback - * once the action finishes or when it fails. - * - * It also returns a function to remove the callback. Note than when calling - * `store.$onAction()` inside of a component, it will be automatically cleaned - * up when the component gets unmounted unless `detached` is set to true. - * - * @example - * - *```js - *store.$onAction(({ after, onError }) => { - * // Here you could share variables between all of the hooks as well as - * // setting up watchers and clean them up - * after((resolvedValue) => { - * // can be used to cleanup side effects - * . // `resolvedValue` is the value returned by the action, if it's a - * . // Promise, it will be the resolved value instead of the Promise - * }) - * onError((error) => { - * // can be used to pass up errors - * }) - *}) - *``` - * - * @param callback - callback called before every action - * @param detached - detach the subscription from the context this is called from - * @returns function that removes the watcher - */ - $onAction(callback: StoreOnActionListener, detached?: boolean): () => void; - /** - * Stops the associated effect scope of the store and remove it from the store - * registry. Plugins can override this method to cleanup any added effects. - * e.g. devtools plugin stops displaying disposed stores from devtools. - * Note this doesn't delete the state of the store, you have to do it manually with - * `delete pinia.state.value[store.$id]` if you want to. If you don't and the - * store is used again, it will reuse the previous state. - */ - $dispose(): void; - /* Excluded from this release type: _r */ -} - -/** - * Callback of a subscription - */ -export declare type SubscriptionCallback = ( -/** - * Object with information relative to the store mutation that triggered the - * subscription. - */ -mutation: SubscriptionCallbackMutation, -/** - * State of the store when the subscription is triggered. Same as - * `store.$state`. - */ -state: UnwrapRef) => void; - -/** - * Context object passed to a subscription callback. - */ -export declare type SubscriptionCallbackMutation = SubscriptionCallbackMutationDirect | SubscriptionCallbackMutationPatchObject | SubscriptionCallbackMutationPatchFunction; - -/** - * Base type for the context passed to a subscription callback. Internal type. - */ -export declare interface _SubscriptionCallbackMutationBase { - /** - * Type of the mutation. - */ - type: MutationType; - /** - * `id` of the store doing the mutation. - */ - storeId: string; - /** - * 🔴 DEV ONLY, DO NOT use for production code. Different mutation calls. Comes from - * https://vuejs.org/guide/extras/reactivity-in-depth.html#reactivity-debugging and allows to track mutations in - * devtools and plugins **during development only**. - */ - events?: DebuggerEvent[] | DebuggerEvent; -} - -/** - * Context passed to a subscription callback when directly mutating the state of - * a store with `store.someState = newValue` or `store.$state.someState = - * newValue`. - */ -export declare interface SubscriptionCallbackMutationDirect extends _SubscriptionCallbackMutationBase { - type: MutationType.direct; - events: DebuggerEvent; -} - -/** - * Context passed to a subscription callback when `store.$patch()` is called - * with a function. - */ -export declare interface SubscriptionCallbackMutationPatchFunction extends _SubscriptionCallbackMutationBase { - type: MutationType.patchFunction; - events: DebuggerEvent[]; -} - -/** - * Context passed to a subscription callback when `store.$patch()` is called - * with an object. - */ -export declare interface SubscriptionCallbackMutationPatchObject extends _SubscriptionCallbackMutationBase { - type: MutationType.patchObject; - events: DebuggerEvent[]; - /** - * Object passed to `store.$patch()`. - */ - payload: _DeepPartial; -} - -declare type ToComputedRefs = { - [K in keyof T]: ToRef extends Ref ? ComputedRef : ToRef; -}; - -/** - * Type that enables refactoring through IDE. - * For internal use **only** - */ -export declare type _UnwrapAll = { - [K in keyof SS]: UnwrapRef; -}; - -export { } - -// Extensions of Vue types to be appended manually -// https://github.com/microsoft/rushstack/issues/2090 -// https://github.com/microsoft/rushstack/issues/1709 - -// @ts-ignore: works on Vue 2, fails in Vue 3 -declare module 'vue/types/vue' { - interface Vue { - /** - * Currently installed pinia instance. - */ - $pinia: Pinia - - /** - * Cache of stores instantiated by the current instance. Used by map - * helpers. Used internally by Pinia. - * - * @internal - */ - _pStores?: Record - } -} - -// @ts-ignore: works on Vue 2, fails in Vue 3 -declare module 'vue/types/options' { - interface ComponentOptions { - /** - * Pinia instance to install in your application. Should be passed to the - * root Vue. - */ - pinia?: Pinia - } -} - -// TODO: figure out why it cannot be 'vue' -// @ts-ignore: works on Vue 3, fails in Vue 2 -declare module '@vue/runtime-core' { - export interface ComponentCustomProperties { - /** - * Access to the application's Pinia - */ - $pinia: Pinia - - /** - * Cache of stores instantiated by the current instance. Used by devtools to - * list currently used stores. Used internally by Pinia. - * - * @internal - */ - _pStores?: Record - } -} diff --git a/node_modules/pinia/dist/pinia.esm-browser.js b/node_modules/pinia/dist/pinia.esm-browser.js deleted file mode 100644 index 5e50d7d..0000000 --- a/node_modules/pinia/dist/pinia.esm-browser.js +++ /dev/null @@ -1,1996 +0,0 @@ -/*! - * pinia v2.1.6 - * (c) 2023 Eduardo San Martin Morote - * @license MIT - */ -import { hasInjectionContext, inject, toRaw, watch, unref, markRaw, effectScope, ref, isVue2, isRef, isReactive, set, getCurrentScope, onScopeDispose, getCurrentInstance, reactive, toRef, del, nextTick, computed, toRefs } from 'vue-demi'; -import { setupDevtoolsPlugin } from '@vue/devtools-api'; - -/** - * setActivePinia must be called to handle SSR at the top of functions like - * `fetch`, `setup`, `serverPrefetch` and others - */ -let activePinia; -/** - * Sets or unsets the active pinia. Used in SSR and internally when calling - * actions and getters - * - * @param pinia - Pinia instance - */ -// @ts-expect-error: cannot constrain the type of the return -const setActivePinia = (pinia) => (activePinia = pinia); -/** - * Get the currently active pinia if there is any. - */ -const getActivePinia = () => (hasInjectionContext() && inject(piniaSymbol)) || activePinia; -const piniaSymbol = (Symbol('pinia') ); - -function isPlainObject( -// eslint-disable-next-line @typescript-eslint/no-explicit-any -o) { - return (o && - typeof o === 'object' && - Object.prototype.toString.call(o) === '[object Object]' && - typeof o.toJSON !== 'function'); -} -// type DeepReadonly = { readonly [P in keyof T]: DeepReadonly } -// TODO: can we change these to numbers? -/** - * Possible types for SubscriptionCallback - */ -var MutationType; -(function (MutationType) { - /** - * Direct mutation of the state: - * - * - `store.name = 'new name'` - * - `store.$state.name = 'new name'` - * - `store.list.push('new item')` - */ - MutationType["direct"] = "direct"; - /** - * Mutated the state with `$patch` and an object - * - * - `store.$patch({ name: 'newName' })` - */ - MutationType["patchObject"] = "patch object"; - /** - * Mutated the state with `$patch` and a function - * - * - `store.$patch(state => state.name = 'newName')` - */ - MutationType["patchFunction"] = "patch function"; - // maybe reset? for $state = {} and $reset -})(MutationType || (MutationType = {})); - -const IS_CLIENT = typeof window !== 'undefined'; -/** - * Should we add the devtools plugins. - * - only if dev mode or forced through the prod devtools flag - * - not in test - * - only if window exists (could change in the future) - */ -const USE_DEVTOOLS = IS_CLIENT; - -/* - * FileSaver.js A saveAs() FileSaver implementation. - * - * Originally by Eli Grey, adapted as an ESM module by Eduardo San Martin - * Morote. - * - * License : MIT - */ -// The one and only way of getting global scope in all environments -// https://stackoverflow.com/q/3277182/1008999 -const _global = /*#__PURE__*/ (() => typeof window === 'object' && window.window === window - ? window - : typeof self === 'object' && self.self === self - ? self - : typeof global === 'object' && global.global === global - ? global - : typeof globalThis === 'object' - ? globalThis - : { HTMLElement: null })(); -function bom(blob, { autoBom = false } = {}) { - // prepend BOM for UTF-8 XML and text/* types (including HTML) - // note: your browser will automatically convert UTF-16 U+FEFF to EF BB BF - if (autoBom && - /^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(blob.type)) { - return new Blob([String.fromCharCode(0xfeff), blob], { type: blob.type }); - } - return blob; -} -function download(url, name, opts) { - const xhr = new XMLHttpRequest(); - xhr.open('GET', url); - xhr.responseType = 'blob'; - xhr.onload = function () { - saveAs(xhr.response, name, opts); - }; - xhr.onerror = function () { - console.error('could not download file'); - }; - xhr.send(); -} -function corsEnabled(url) { - const xhr = new XMLHttpRequest(); - // use sync to avoid popup blocker - xhr.open('HEAD', url, false); - try { - xhr.send(); - } - catch (e) { } - return xhr.status >= 200 && xhr.status <= 299; -} -// `a.click()` doesn't work for all browsers (#465) -function click(node) { - try { - node.dispatchEvent(new MouseEvent('click')); - } - catch (e) { - const evt = document.createEvent('MouseEvents'); - evt.initMouseEvent('click', true, true, window, 0, 0, 0, 80, 20, false, false, false, false, 0, null); - node.dispatchEvent(evt); - } -} -const _navigator = - typeof navigator === 'object' ? navigator : { userAgent: '' }; -// Detect WebView inside a native macOS app by ruling out all browsers -// We just need to check for 'Safari' because all other browsers (besides Firefox) include that too -// https://www.whatismybrowser.com/guides/the-latest-user-agent/macos -const isMacOSWebView = /*#__PURE__*/ (() => /Macintosh/.test(_navigator.userAgent) && - /AppleWebKit/.test(_navigator.userAgent) && - !/Safari/.test(_navigator.userAgent))(); -const saveAs = !IS_CLIENT - ? () => { } // noop - : // Use download attribute first if possible (#193 Lumia mobile) unless this is a macOS WebView or mini program - typeof HTMLAnchorElement !== 'undefined' && - 'download' in HTMLAnchorElement.prototype && - !isMacOSWebView - ? downloadSaveAs - : // Use msSaveOrOpenBlob as a second approach - 'msSaveOrOpenBlob' in _navigator - ? msSaveAs - : // Fallback to using FileReader and a popup - fileSaverSaveAs; -function downloadSaveAs(blob, name = 'download', opts) { - const a = document.createElement('a'); - a.download = name; - a.rel = 'noopener'; // tabnabbing - // TODO: detect chrome extensions & packaged apps - // a.target = '_blank' - if (typeof blob === 'string') { - // Support regular links - a.href = blob; - if (a.origin !== location.origin) { - if (corsEnabled(a.href)) { - download(blob, name, opts); - } - else { - a.target = '_blank'; - click(a); - } - } - else { - click(a); - } - } - else { - // Support blobs - a.href = URL.createObjectURL(blob); - setTimeout(function () { - URL.revokeObjectURL(a.href); - }, 4e4); // 40s - setTimeout(function () { - click(a); - }, 0); - } -} -function msSaveAs(blob, name = 'download', opts) { - if (typeof blob === 'string') { - if (corsEnabled(blob)) { - download(blob, name, opts); - } - else { - const a = document.createElement('a'); - a.href = blob; - a.target = '_blank'; - setTimeout(function () { - click(a); - }); - } - } - else { - // @ts-ignore: works on windows - navigator.msSaveOrOpenBlob(bom(blob, opts), name); - } -} -function fileSaverSaveAs(blob, name, opts, popup) { - // Open a popup immediately do go around popup blocker - // Mostly only available on user interaction and the fileReader is async so... - popup = popup || open('', '_blank'); - if (popup) { - popup.document.title = popup.document.body.innerText = 'downloading...'; - } - if (typeof blob === 'string') - return download(blob, name, opts); - const force = blob.type === 'application/octet-stream'; - const isSafari = /constructor/i.test(String(_global.HTMLElement)) || 'safari' in _global; - const isChromeIOS = /CriOS\/[\d]+/.test(navigator.userAgent); - if ((isChromeIOS || (force && isSafari) || isMacOSWebView) && - typeof FileReader !== 'undefined') { - // Safari doesn't allow downloading of blob URLs - const reader = new FileReader(); - reader.onloadend = function () { - let url = reader.result; - if (typeof url !== 'string') { - popup = null; - throw new Error('Wrong reader.result type'); - } - url = isChromeIOS - ? url - : url.replace(/^data:[^;]*;/, 'data:attachment/file;'); - if (popup) { - popup.location.href = url; - } - else { - location.assign(url); - } - popup = null; // reverse-tabnabbing #460 - }; - reader.readAsDataURL(blob); - } - else { - const url = URL.createObjectURL(blob); - if (popup) - popup.location.assign(url); - else - location.href = url; - popup = null; // reverse-tabnabbing #460 - setTimeout(function () { - URL.revokeObjectURL(url); - }, 4e4); // 40s - } -} - -/** - * Shows a toast or console.log - * - * @param message - message to log - * @param type - different color of the tooltip - */ -function toastMessage(message, type) { - const piniaMessage = '🍍 ' + message; - if (typeof __VUE_DEVTOOLS_TOAST__ === 'function') { - // No longer available :( - __VUE_DEVTOOLS_TOAST__(piniaMessage, type); - } - else if (type === 'error') { - console.error(piniaMessage); - } - else if (type === 'warn') { - console.warn(piniaMessage); - } - else { - console.log(piniaMessage); - } -} -function isPinia(o) { - return '_a' in o && 'install' in o; -} - -/** - * This file contain devtools actions, they are not Pinia actions. - */ -// --- -function checkClipboardAccess() { - if (!('clipboard' in navigator)) { - toastMessage(`Your browser doesn't support the Clipboard API`, 'error'); - return true; - } -} -function checkNotFocusedError(error) { - if (error instanceof Error && - error.message.toLowerCase().includes('document is not focused')) { - toastMessage('You need to activate the "Emulate a focused page" setting in the "Rendering" panel of devtools.', 'warn'); - return true; - } - return false; -} -async function actionGlobalCopyState(pinia) { - if (checkClipboardAccess()) - return; - try { - await navigator.clipboard.writeText(JSON.stringify(pinia.state.value)); - toastMessage('Global state copied to clipboard.'); - } - catch (error) { - if (checkNotFocusedError(error)) - return; - toastMessage(`Failed to serialize the state. Check the console for more details.`, 'error'); - console.error(error); - } -} -async function actionGlobalPasteState(pinia) { - if (checkClipboardAccess()) - return; - try { - loadStoresState(pinia, JSON.parse(await navigator.clipboard.readText())); - toastMessage('Global state pasted from clipboard.'); - } - catch (error) { - if (checkNotFocusedError(error)) - return; - toastMessage(`Failed to deserialize the state from clipboard. Check the console for more details.`, 'error'); - console.error(error); - } -} -async function actionGlobalSaveState(pinia) { - try { - saveAs(new Blob([JSON.stringify(pinia.state.value)], { - type: 'text/plain;charset=utf-8', - }), 'pinia-state.json'); - } - catch (error) { - toastMessage(`Failed to export the state as JSON. Check the console for more details.`, 'error'); - console.error(error); - } -} -let fileInput; -function getFileOpener() { - if (!fileInput) { - fileInput = document.createElement('input'); - fileInput.type = 'file'; - fileInput.accept = '.json'; - } - function openFile() { - return new Promise((resolve, reject) => { - fileInput.onchange = async () => { - const files = fileInput.files; - if (!files) - return resolve(null); - const file = files.item(0); - if (!file) - return resolve(null); - return resolve({ text: await file.text(), file }); - }; - // @ts-ignore: TODO: changed from 4.3 to 4.4 - fileInput.oncancel = () => resolve(null); - fileInput.onerror = reject; - fileInput.click(); - }); - } - return openFile; -} -async function actionGlobalOpenStateFile(pinia) { - try { - const open = getFileOpener(); - const result = await open(); - if (!result) - return; - const { text, file } = result; - loadStoresState(pinia, JSON.parse(text)); - toastMessage(`Global state imported from "${file.name}".`); - } - catch (error) { - toastMessage(`Failed to import the state from JSON. Check the console for more details.`, 'error'); - console.error(error); - } -} -function loadStoresState(pinia, state) { - for (const key in state) { - const storeState = pinia.state.value[key]; - if (storeState) { - Object.assign(storeState, state[key]); - } - } -} - -function formatDisplay(display) { - return { - _custom: { - display, - }, - }; -} -const PINIA_ROOT_LABEL = '🍍 Pinia (root)'; -const PINIA_ROOT_ID = '_root'; -function formatStoreForInspectorTree(store) { - return isPinia(store) - ? { - id: PINIA_ROOT_ID, - label: PINIA_ROOT_LABEL, - } - : { - id: store.$id, - label: store.$id, - }; -} -function formatStoreForInspectorState(store) { - if (isPinia(store)) { - const storeNames = Array.from(store._s.keys()); - const storeMap = store._s; - const state = { - state: storeNames.map((storeId) => ({ - editable: true, - key: storeId, - value: store.state.value[storeId], - })), - getters: storeNames - .filter((id) => storeMap.get(id)._getters) - .map((id) => { - const store = storeMap.get(id); - return { - editable: false, - key: id, - value: store._getters.reduce((getters, key) => { - getters[key] = store[key]; - return getters; - }, {}), - }; - }), - }; - return state; - } - const state = { - state: Object.keys(store.$state).map((key) => ({ - editable: true, - key, - value: store.$state[key], - })), - }; - // avoid adding empty getters - if (store._getters && store._getters.length) { - state.getters = store._getters.map((getterName) => ({ - editable: false, - key: getterName, - value: store[getterName], - })); - } - if (store._customProperties.size) { - state.customProperties = Array.from(store._customProperties).map((key) => ({ - editable: true, - key, - value: store[key], - })); - } - return state; -} -function formatEventData(events) { - if (!events) - return {}; - if (Array.isArray(events)) { - // TODO: handle add and delete for arrays and objects - return events.reduce((data, event) => { - data.keys.push(event.key); - data.operations.push(event.type); - data.oldValue[event.key] = event.oldValue; - data.newValue[event.key] = event.newValue; - return data; - }, { - oldValue: {}, - keys: [], - operations: [], - newValue: {}, - }); - } - else { - return { - operation: formatDisplay(events.type), - key: formatDisplay(events.key), - oldValue: events.oldValue, - newValue: events.newValue, - }; - } -} -function formatMutationType(type) { - switch (type) { - case MutationType.direct: - return 'mutation'; - case MutationType.patchFunction: - return '$patch'; - case MutationType.patchObject: - return '$patch'; - default: - return 'unknown'; - } -} - -// timeline can be paused when directly changing the state -let isTimelineActive = true; -const componentStateTypes = []; -const MUTATIONS_LAYER_ID = 'pinia:mutations'; -const INSPECTOR_ID = 'pinia'; -const { assign: assign$1 } = Object; -/** - * Gets the displayed name of a store in devtools - * - * @param id - id of the store - * @returns a formatted string - */ -const getStoreType = (id) => '🍍 ' + id; -/** - * Add the pinia plugin without any store. Allows displaying a Pinia plugin tab - * as soon as it is added to the application. - * - * @param app - Vue application - * @param pinia - pinia instance - */ -function registerPiniaDevtools(app, pinia) { - setupDevtoolsPlugin({ - id: 'dev.esm.pinia', - label: 'Pinia 🍍', - logo: 'https://pinia.vuejs.org/logo.svg', - packageName: 'pinia', - homepage: 'https://pinia.vuejs.org', - componentStateTypes, - app, - }, (api) => { - if (typeof api.now !== 'function') { - toastMessage('You seem to be using an outdated version of Vue Devtools. Are you still using the Beta release instead of the stable one? You can find the links at https://devtools.vuejs.org/guide/installation.html.'); - } - api.addTimelineLayer({ - id: MUTATIONS_LAYER_ID, - label: `Pinia 🍍`, - color: 0xe5df88, - }); - api.addInspector({ - id: INSPECTOR_ID, - label: 'Pinia 🍍', - icon: 'storage', - treeFilterPlaceholder: 'Search stores', - actions: [ - { - icon: 'content_copy', - action: () => { - actionGlobalCopyState(pinia); - }, - tooltip: 'Serialize and copy the state', - }, - { - icon: 'content_paste', - action: async () => { - await actionGlobalPasteState(pinia); - api.sendInspectorTree(INSPECTOR_ID); - api.sendInspectorState(INSPECTOR_ID); - }, - tooltip: 'Replace the state with the content of your clipboard', - }, - { - icon: 'save', - action: () => { - actionGlobalSaveState(pinia); - }, - tooltip: 'Save the state as a JSON file', - }, - { - icon: 'folder_open', - action: async () => { - await actionGlobalOpenStateFile(pinia); - api.sendInspectorTree(INSPECTOR_ID); - api.sendInspectorState(INSPECTOR_ID); - }, - tooltip: 'Import the state from a JSON file', - }, - ], - nodeActions: [ - { - icon: 'restore', - tooltip: 'Reset the state (with "$reset")', - action: (nodeId) => { - const store = pinia._s.get(nodeId); - if (!store) { - toastMessage(`Cannot reset "${nodeId}" store because it wasn't found.`, 'warn'); - } - else if (typeof store.$reset !== 'function') { - toastMessage(`Cannot reset "${nodeId}" store because it doesn't have a "$reset" method implemented.`, 'warn'); - } - else { - store.$reset(); - toastMessage(`Store "${nodeId}" reset.`); - } - }, - }, - ], - }); - api.on.inspectComponent((payload, ctx) => { - const proxy = (payload.componentInstance && - payload.componentInstance.proxy); - if (proxy && proxy._pStores) { - const piniaStores = payload.componentInstance.proxy._pStores; - Object.values(piniaStores).forEach((store) => { - payload.instanceData.state.push({ - type: getStoreType(store.$id), - key: 'state', - editable: true, - value: store._isOptionsAPI - ? { - _custom: { - value: toRaw(store.$state), - actions: [ - { - icon: 'restore', - tooltip: 'Reset the state of this store', - action: () => store.$reset(), - }, - ], - }, - } - : // NOTE: workaround to unwrap transferred refs - Object.keys(store.$state).reduce((state, key) => { - state[key] = store.$state[key]; - return state; - }, {}), - }); - if (store._getters && store._getters.length) { - payload.instanceData.state.push({ - type: getStoreType(store.$id), - key: 'getters', - editable: false, - value: store._getters.reduce((getters, key) => { - try { - getters[key] = store[key]; - } - catch (error) { - // @ts-expect-error: we just want to show it in devtools - getters[key] = error; - } - return getters; - }, {}), - }); - } - }); - } - }); - api.on.getInspectorTree((payload) => { - if (payload.app === app && payload.inspectorId === INSPECTOR_ID) { - let stores = [pinia]; - stores = stores.concat(Array.from(pinia._s.values())); - payload.rootNodes = (payload.filter - ? stores.filter((store) => '$id' in store - ? store.$id - .toLowerCase() - .includes(payload.filter.toLowerCase()) - : PINIA_ROOT_LABEL.toLowerCase().includes(payload.filter.toLowerCase())) - : stores).map(formatStoreForInspectorTree); - } - }); - api.on.getInspectorState((payload) => { - if (payload.app === app && payload.inspectorId === INSPECTOR_ID) { - const inspectedStore = payload.nodeId === PINIA_ROOT_ID - ? pinia - : pinia._s.get(payload.nodeId); - if (!inspectedStore) { - // this could be the selected store restored for a different project - // so it's better not to say anything here - return; - } - if (inspectedStore) { - payload.state = formatStoreForInspectorState(inspectedStore); - } - } - }); - api.on.editInspectorState((payload, ctx) => { - if (payload.app === app && payload.inspectorId === INSPECTOR_ID) { - const inspectedStore = payload.nodeId === PINIA_ROOT_ID - ? pinia - : pinia._s.get(payload.nodeId); - if (!inspectedStore) { - return toastMessage(`store "${payload.nodeId}" not found`, 'error'); - } - const { path } = payload; - if (!isPinia(inspectedStore)) { - // access only the state - if (path.length !== 1 || - !inspectedStore._customProperties.has(path[0]) || - path[0] in inspectedStore.$state) { - path.unshift('$state'); - } - } - else { - // Root access, we can omit the `.value` because the devtools API does it for us - path.unshift('state'); - } - isTimelineActive = false; - payload.set(inspectedStore, path, payload.state.value); - isTimelineActive = true; - } - }); - api.on.editComponentState((payload) => { - if (payload.type.startsWith('🍍')) { - const storeId = payload.type.replace(/^🍍\s*/, ''); - const store = pinia._s.get(storeId); - if (!store) { - return toastMessage(`store "${storeId}" not found`, 'error'); - } - const { path } = payload; - if (path[0] !== 'state') { - return toastMessage(`Invalid path for store "${storeId}":\n${path}\nOnly state can be modified.`); - } - // rewrite the first entry to be able to directly set the state as - // well as any other path - path[0] = '$state'; - isTimelineActive = false; - payload.set(store, path, payload.state.value); - isTimelineActive = true; - } - }); - }); -} -function addStoreToDevtools(app, store) { - if (!componentStateTypes.includes(getStoreType(store.$id))) { - componentStateTypes.push(getStoreType(store.$id)); - } - setupDevtoolsPlugin({ - id: 'dev.esm.pinia', - label: 'Pinia 🍍', - logo: 'https://pinia.vuejs.org/logo.svg', - packageName: 'pinia', - homepage: 'https://pinia.vuejs.org', - componentStateTypes, - app, - settings: { - logStoreChanges: { - label: 'Notify about new/deleted stores', - type: 'boolean', - defaultValue: true, - }, - // useEmojis: { - // label: 'Use emojis in messages ⚡️', - // type: 'boolean', - // defaultValue: true, - // }, - }, - }, (api) => { - // gracefully handle errors - const now = typeof api.now === 'function' ? api.now.bind(api) : Date.now; - store.$onAction(({ after, onError, name, args }) => { - const groupId = runningActionId++; - api.addTimelineEvent({ - layerId: MUTATIONS_LAYER_ID, - event: { - time: now(), - title: '🛫 ' + name, - subtitle: 'start', - data: { - store: formatDisplay(store.$id), - action: formatDisplay(name), - args, - }, - groupId, - }, - }); - after((result) => { - activeAction = undefined; - api.addTimelineEvent({ - layerId: MUTATIONS_LAYER_ID, - event: { - time: now(), - title: '🛬 ' + name, - subtitle: 'end', - data: { - store: formatDisplay(store.$id), - action: formatDisplay(name), - args, - result, - }, - groupId, - }, - }); - }); - onError((error) => { - activeAction = undefined; - api.addTimelineEvent({ - layerId: MUTATIONS_LAYER_ID, - event: { - time: now(), - logType: 'error', - title: '💥 ' + name, - subtitle: 'end', - data: { - store: formatDisplay(store.$id), - action: formatDisplay(name), - args, - error, - }, - groupId, - }, - }); - }); - }, true); - store._customProperties.forEach((name) => { - watch(() => unref(store[name]), (newValue, oldValue) => { - api.notifyComponentUpdate(); - api.sendInspectorState(INSPECTOR_ID); - if (isTimelineActive) { - api.addTimelineEvent({ - layerId: MUTATIONS_LAYER_ID, - event: { - time: now(), - title: 'Change', - subtitle: name, - data: { - newValue, - oldValue, - }, - groupId: activeAction, - }, - }); - } - }, { deep: true }); - }); - store.$subscribe(({ events, type }, state) => { - api.notifyComponentUpdate(); - api.sendInspectorState(INSPECTOR_ID); - if (!isTimelineActive) - return; - // rootStore.state[store.id] = state - const eventData = { - time: now(), - title: formatMutationType(type), - data: assign$1({ store: formatDisplay(store.$id) }, formatEventData(events)), - groupId: activeAction, - }; - if (type === MutationType.patchFunction) { - eventData.subtitle = '⤵️'; - } - else if (type === MutationType.patchObject) { - eventData.subtitle = '🧩'; - } - else if (events && !Array.isArray(events)) { - eventData.subtitle = events.type; - } - if (events) { - eventData.data['rawEvent(s)'] = { - _custom: { - display: 'DebuggerEvent', - type: 'object', - tooltip: 'raw DebuggerEvent[]', - value: events, - }, - }; - } - api.addTimelineEvent({ - layerId: MUTATIONS_LAYER_ID, - event: eventData, - }); - }, { detached: true, flush: 'sync' }); - const hotUpdate = store._hotUpdate; - store._hotUpdate = markRaw((newStore) => { - hotUpdate(newStore); - api.addTimelineEvent({ - layerId: MUTATIONS_LAYER_ID, - event: { - time: now(), - title: '🔥 ' + store.$id, - subtitle: 'HMR update', - data: { - store: formatDisplay(store.$id), - info: formatDisplay(`HMR update`), - }, - }, - }); - // update the devtools too - api.notifyComponentUpdate(); - api.sendInspectorTree(INSPECTOR_ID); - api.sendInspectorState(INSPECTOR_ID); - }); - const { $dispose } = store; - store.$dispose = () => { - $dispose(); - api.notifyComponentUpdate(); - api.sendInspectorTree(INSPECTOR_ID); - api.sendInspectorState(INSPECTOR_ID); - api.getSettings().logStoreChanges && - toastMessage(`Disposed "${store.$id}" store 🗑`); - }; - // trigger an update so it can display new registered stores - api.notifyComponentUpdate(); - api.sendInspectorTree(INSPECTOR_ID); - api.sendInspectorState(INSPECTOR_ID); - api.getSettings().logStoreChanges && - toastMessage(`"${store.$id}" store installed 🆕`); - }); -} -let runningActionId = 0; -let activeAction; -/** - * Patches a store to enable action grouping in devtools by wrapping the store with a Proxy that is passed as the - * context of all actions, allowing us to set `runningAction` on each access and effectively associating any state - * mutation to the action. - * - * @param store - store to patch - * @param actionNames - list of actionst to patch - */ -function patchActionForGrouping(store, actionNames, wrapWithProxy) { - // original actions of the store as they are given by pinia. We are going to override them - const actions = actionNames.reduce((storeActions, actionName) => { - // use toRaw to avoid tracking #541 - storeActions[actionName] = toRaw(store)[actionName]; - return storeActions; - }, {}); - for (const actionName in actions) { - store[actionName] = function () { - // the running action id is incremented in a before action hook - const _actionId = runningActionId; - const trackedStore = wrapWithProxy - ? new Proxy(store, { - get(...args) { - activeAction = _actionId; - return Reflect.get(...args); - }, - set(...args) { - activeAction = _actionId; - return Reflect.set(...args); - }, - }) - : store; - // For Setup Stores we need https://github.com/tc39/proposal-async-context - activeAction = _actionId; - const retValue = actions[actionName].apply(trackedStore, arguments); - // this is safer as async actions in Setup Stores would associate mutations done outside of the action - activeAction = undefined; - return retValue; - }; - } -} -/** - * pinia.use(devtoolsPlugin) - */ -function devtoolsPlugin({ app, store, options }) { - // HMR module - if (store.$id.startsWith('__hot:')) { - return; - } - // detect option api vs setup api - store._isOptionsAPI = !!options.state; - patchActionForGrouping(store, Object.keys(options.actions), store._isOptionsAPI); - // Upgrade the HMR to also update the new actions - const originalHotUpdate = store._hotUpdate; - toRaw(store)._hotUpdate = function (newStore) { - originalHotUpdate.apply(this, arguments); - patchActionForGrouping(store, Object.keys(newStore._hmrPayload.actions), !!store._isOptionsAPI); - }; - addStoreToDevtools(app, - // FIXME: is there a way to allow the assignment from Store to StoreGeneric? - store); -} - -/** - * Creates a Pinia instance to be used by the application - */ -function createPinia() { - const scope = effectScope(true); - // NOTE: here we could check the window object for a state and directly set it - // if there is anything like it with Vue 3 SSR - const state = scope.run(() => ref({})); - let _p = []; - // plugins added before calling app.use(pinia) - let toBeInstalled = []; - const pinia = markRaw({ - install(app) { - // this allows calling useStore() outside of a component setup after - // installing pinia's plugin - setActivePinia(pinia); - if (!isVue2) { - pinia._a = app; - app.provide(piniaSymbol, pinia); - app.config.globalProperties.$pinia = pinia; - /* istanbul ignore else */ - if (USE_DEVTOOLS) { - registerPiniaDevtools(app, pinia); - } - toBeInstalled.forEach((plugin) => _p.push(plugin)); - toBeInstalled = []; - } - }, - use(plugin) { - if (!this._a && !isVue2) { - toBeInstalled.push(plugin); - } - else { - _p.push(plugin); - } - return this; - }, - _p, - // it's actually undefined here - // @ts-expect-error - _a: null, - _e: scope, - _s: new Map(), - state, - }); - // pinia devtools rely on dev only features so they cannot be forced unless - // the dev build of Vue is used. Avoid old browsers like IE11. - if (USE_DEVTOOLS && typeof Proxy !== 'undefined') { - pinia.use(devtoolsPlugin); - } - return pinia; -} - -/** - * Checks if a function is a `StoreDefinition`. - * - * @param fn - object to test - * @returns true if `fn` is a StoreDefinition - */ -const isUseStore = (fn) => { - return typeof fn === 'function' && typeof fn.$id === 'string'; -}; -/** - * Mutates in place `newState` with `oldState` to _hot update_ it. It will - * remove any key not existing in `newState` and recursively merge plain - * objects. - * - * @param newState - new state object to be patched - * @param oldState - old state that should be used to patch newState - * @returns - newState - */ -function patchObject(newState, oldState) { - // no need to go through symbols because they cannot be serialized anyway - for (const key in oldState) { - const subPatch = oldState[key]; - // skip the whole sub tree - if (!(key in newState)) { - continue; - } - const targetValue = newState[key]; - if (isPlainObject(targetValue) && - isPlainObject(subPatch) && - !isRef(subPatch) && - !isReactive(subPatch)) { - newState[key] = patchObject(targetValue, subPatch); - } - else { - // objects are either a bit more complex (e.g. refs) or primitives, so we - // just set the whole thing - if (isVue2) { - set(newState, key, subPatch); - } - else { - newState[key] = subPatch; - } - } - } - return newState; -} -/** - * Creates an _accept_ function to pass to `import.meta.hot` in Vite applications. - * - * @example - * ```js - * const useUser = defineStore(...) - * if (import.meta.hot) { - * import.meta.hot.accept(acceptHMRUpdate(useUser, import.meta.hot)) - * } - * ``` - * - * @param initialUseStore - return of the defineStore to hot update - * @param hot - `import.meta.hot` - */ -function acceptHMRUpdate(initialUseStore, hot) { - return (newModule) => { - const pinia = hot.data.pinia || initialUseStore._pinia; - if (!pinia) { - // this store is still not used - return; - } - // preserve the pinia instance across loads - hot.data.pinia = pinia; - // console.log('got data', newStore) - for (const exportName in newModule) { - const useStore = newModule[exportName]; - // console.log('checking for', exportName) - if (isUseStore(useStore) && pinia._s.has(useStore.$id)) { - // console.log('Accepting update for', useStore.$id) - const id = useStore.$id; - if (id !== initialUseStore.$id) { - console.warn(`The id of the store changed from "${initialUseStore.$id}" to "${id}". Reloading.`); - // return import.meta.hot.invalidate() - return hot.invalidate(); - } - const existingStore = pinia._s.get(id); - if (!existingStore) { - console.log(`[Pinia]: skipping hmr because store doesn't exist yet`); - return; - } - useStore(pinia, existingStore); - } - } - }; -} - -const noop = () => { }; -function addSubscription(subscriptions, callback, detached, onCleanup = noop) { - subscriptions.push(callback); - const removeSubscription = () => { - const idx = subscriptions.indexOf(callback); - if (idx > -1) { - subscriptions.splice(idx, 1); - onCleanup(); - } - }; - if (!detached && getCurrentScope()) { - onScopeDispose(removeSubscription); - } - return removeSubscription; -} -function triggerSubscriptions(subscriptions, ...args) { - subscriptions.slice().forEach((callback) => { - callback(...args); - }); -} - -const fallbackRunWithContext = (fn) => fn(); -function mergeReactiveObjects(target, patchToApply) { - // Handle Map instances - if (target instanceof Map && patchToApply instanceof Map) { - patchToApply.forEach((value, key) => target.set(key, value)); - } - // Handle Set instances - if (target instanceof Set && patchToApply instanceof Set) { - patchToApply.forEach(target.add, target); - } - // no need to go through symbols because they cannot be serialized anyway - for (const key in patchToApply) { - if (!patchToApply.hasOwnProperty(key)) - continue; - const subPatch = patchToApply[key]; - const targetValue = target[key]; - if (isPlainObject(targetValue) && - isPlainObject(subPatch) && - target.hasOwnProperty(key) && - !isRef(subPatch) && - !isReactive(subPatch)) { - // NOTE: here I wanted to warn about inconsistent types but it's not possible because in setup stores one might - // start the value of a property as a certain type e.g. a Map, and then for some reason, during SSR, change that - // to `undefined`. When trying to hydrate, we want to override the Map with `undefined`. - target[key] = mergeReactiveObjects(targetValue, subPatch); - } - else { - // @ts-expect-error: subPatch is a valid value - target[key] = subPatch; - } - } - return target; -} -const skipHydrateSymbol = Symbol('pinia:skipHydration') - ; -const skipHydrateMap = /*#__PURE__*/ new WeakMap(); -/** - * Tells Pinia to skip the hydration process of a given object. This is useful in setup stores (only) when you return a - * stateful object in the store but it isn't really state. e.g. returning a router instance in a setup store. - * - * @param obj - target object - * @returns obj - */ -function skipHydrate(obj) { - return isVue2 - ? // in @vue/composition-api, the refs are sealed so defineProperty doesn't work... - /* istanbul ignore next */ skipHydrateMap.set(obj, 1) && obj - : Object.defineProperty(obj, skipHydrateSymbol, {}); -} -/** - * Returns whether a value should be hydrated - * - * @param obj - target variable - * @returns true if `obj` should be hydrated - */ -function shouldHydrate(obj) { - return isVue2 - ? /* istanbul ignore next */ !skipHydrateMap.has(obj) - : !isPlainObject(obj) || !obj.hasOwnProperty(skipHydrateSymbol); -} -const { assign } = Object; -function isComputed(o) { - return !!(isRef(o) && o.effect); -} -function createOptionsStore(id, options, pinia, hot) { - const { state, actions, getters } = options; - const initialState = pinia.state.value[id]; - let store; - function setup() { - if (!initialState && (!hot)) { - /* istanbul ignore if */ - if (isVue2) { - set(pinia.state.value, id, state ? state() : {}); - } - else { - pinia.state.value[id] = state ? state() : {}; - } - } - // avoid creating a state in pinia.state.value - const localState = hot - ? // use ref() to unwrap refs inside state TODO: check if this is still necessary - toRefs(ref(state ? state() : {}).value) - : toRefs(pinia.state.value[id]); - return assign(localState, actions, Object.keys(getters || {}).reduce((computedGetters, name) => { - if (name in localState) { - console.warn(`[🍍]: A getter cannot have the same name as another state property. Rename one of them. Found with "${name}" in store "${id}".`); - } - computedGetters[name] = markRaw(computed(() => { - setActivePinia(pinia); - // it was created just before - const store = pinia._s.get(id); - // allow cross using stores - /* istanbul ignore next */ - if (isVue2 && !store._r) - return; - // @ts-expect-error - // return getters![name].call(context, context) - // TODO: avoid reading the getter while assigning with a global variable - return getters[name].call(store, store); - })); - return computedGetters; - }, {})); - } - store = createSetupStore(id, setup, options, pinia, hot, true); - return store; -} -function createSetupStore($id, setup, options = {}, pinia, hot, isOptionsStore) { - let scope; - const optionsForPlugin = assign({ actions: {} }, options); - /* istanbul ignore if */ - if (!pinia._e.active) { - throw new Error('Pinia destroyed'); - } - // watcher options for $subscribe - const $subscribeOptions = { - deep: true, - // flush: 'post', - }; - /* istanbul ignore else */ - if (!isVue2) { - $subscribeOptions.onTrigger = (event) => { - /* istanbul ignore else */ - if (isListening) { - debuggerEvents = event; - // avoid triggering this while the store is being built and the state is being set in pinia - } - else if (isListening == false && !store._hotUpdating) { - // let patch send all the events together later - /* istanbul ignore else */ - if (Array.isArray(debuggerEvents)) { - debuggerEvents.push(event); - } - else { - console.error('🍍 debuggerEvents should be an array. This is most likely an internal Pinia bug.'); - } - } - }; - } - // internal state - let isListening; // set to true at the end - let isSyncListening; // set to true at the end - let subscriptions = []; - let actionSubscriptions = []; - let debuggerEvents; - const initialState = pinia.state.value[$id]; - // avoid setting the state for option stores if it is set - // by the setup - if (!isOptionsStore && !initialState && (!hot)) { - /* istanbul ignore if */ - if (isVue2) { - set(pinia.state.value, $id, {}); - } - else { - pinia.state.value[$id] = {}; - } - } - const hotState = ref({}); - // avoid triggering too many listeners - // https://github.com/vuejs/pinia/issues/1129 - let activeListener; - function $patch(partialStateOrMutator) { - let subscriptionMutation; - isListening = isSyncListening = false; - // reset the debugger events since patches are sync - /* istanbul ignore else */ - { - debuggerEvents = []; - } - if (typeof partialStateOrMutator === 'function') { - partialStateOrMutator(pinia.state.value[$id]); - subscriptionMutation = { - type: MutationType.patchFunction, - storeId: $id, - events: debuggerEvents, - }; - } - else { - mergeReactiveObjects(pinia.state.value[$id], partialStateOrMutator); - subscriptionMutation = { - type: MutationType.patchObject, - payload: partialStateOrMutator, - storeId: $id, - events: debuggerEvents, - }; - } - const myListenerId = (activeListener = Symbol()); - nextTick().then(() => { - if (activeListener === myListenerId) { - isListening = true; - } - }); - isSyncListening = true; - // because we paused the watcher, we need to manually call the subscriptions - triggerSubscriptions(subscriptions, subscriptionMutation, pinia.state.value[$id]); - } - const $reset = isOptionsStore - ? function $reset() { - const { state } = options; - const newState = state ? state() : {}; - // we use a patch to group all changes into one single subscription - this.$patch(($state) => { - assign($state, newState); - }); - } - : /* istanbul ignore next */ - () => { - throw new Error(`🍍: Store "${$id}" is built using the setup syntax and does not implement $reset().`); - } - ; - function $dispose() { - scope.stop(); - subscriptions = []; - actionSubscriptions = []; - pinia._s.delete($id); - } - /** - * Wraps an action to handle subscriptions. - * - * @param name - name of the action - * @param action - action to wrap - * @returns a wrapped action to handle subscriptions - */ - function wrapAction(name, action) { - return function () { - setActivePinia(pinia); - const args = Array.from(arguments); - const afterCallbackList = []; - const onErrorCallbackList = []; - function after(callback) { - afterCallbackList.push(callback); - } - function onError(callback) { - onErrorCallbackList.push(callback); - } - // @ts-expect-error - triggerSubscriptions(actionSubscriptions, { - args, - name, - store, - after, - onError, - }); - let ret; - try { - ret = action.apply(this && this.$id === $id ? this : store, args); - // handle sync errors - } - catch (error) { - triggerSubscriptions(onErrorCallbackList, error); - throw error; - } - if (ret instanceof Promise) { - return ret - .then((value) => { - triggerSubscriptions(afterCallbackList, value); - return value; - }) - .catch((error) => { - triggerSubscriptions(onErrorCallbackList, error); - return Promise.reject(error); - }); - } - // trigger after callbacks - triggerSubscriptions(afterCallbackList, ret); - return ret; - }; - } - const _hmrPayload = /*#__PURE__*/ markRaw({ - actions: {}, - getters: {}, - state: [], - hotState, - }); - const partialStore = { - _p: pinia, - // _s: scope, - $id, - $onAction: addSubscription.bind(null, actionSubscriptions), - $patch, - $reset, - $subscribe(callback, options = {}) { - const removeSubscription = addSubscription(subscriptions, callback, options.detached, () => stopWatcher()); - const stopWatcher = scope.run(() => watch(() => pinia.state.value[$id], (state) => { - if (options.flush === 'sync' ? isSyncListening : isListening) { - callback({ - storeId: $id, - type: MutationType.direct, - events: debuggerEvents, - }, state); - } - }, assign({}, $subscribeOptions, options))); - return removeSubscription; - }, - $dispose, - }; - /* istanbul ignore if */ - if (isVue2) { - // start as non ready - partialStore._r = false; - } - const store = reactive(assign({ - _hmrPayload, - _customProperties: markRaw(new Set()), // devtools custom properties - }, partialStore - // must be added later - // setupStore - ) - ); - // store the partial store now so the setup of stores can instantiate each other before they are finished without - // creating infinite loops. - pinia._s.set($id, store); - const runWithContext = (pinia._a && pinia._a.runWithContext) || fallbackRunWithContext; - // TODO: idea create skipSerialize that marks properties as non serializable and they are skipped - const setupStore = pinia._e.run(() => { - scope = effectScope(); - return runWithContext(() => scope.run(setup)); - }); - // overwrite existing actions to support $onAction - for (const key in setupStore) { - const prop = setupStore[key]; - if ((isRef(prop) && !isComputed(prop)) || isReactive(prop)) { - // mark it as a piece of state to be serialized - if (hot) { - set(hotState.value, key, toRef(setupStore, key)); - // createOptionStore directly sets the state in pinia.state.value so we - // can just skip that - } - else if (!isOptionsStore) { - // in setup stores we must hydrate the state and sync pinia state tree with the refs the user just created - if (initialState && shouldHydrate(prop)) { - if (isRef(prop)) { - prop.value = initialState[key]; - } - else { - // probably a reactive object, lets recursively assign - // @ts-expect-error: prop is unknown - mergeReactiveObjects(prop, initialState[key]); - } - } - // transfer the ref to the pinia state to keep everything in sync - /* istanbul ignore if */ - if (isVue2) { - set(pinia.state.value[$id], key, prop); - } - else { - pinia.state.value[$id][key] = prop; - } - } - /* istanbul ignore else */ - { - _hmrPayload.state.push(key); - } - // action - } - else if (typeof prop === 'function') { - // @ts-expect-error: we are overriding the function we avoid wrapping if - const actionValue = hot ? prop : wrapAction(key, prop); - // this a hot module replacement store because the hotUpdate method needs - // to do it with the right context - /* istanbul ignore if */ - if (isVue2) { - set(setupStore, key, actionValue); - } - else { - // @ts-expect-error - setupStore[key] = actionValue; - } - /* istanbul ignore else */ - { - _hmrPayload.actions[key] = prop; - } - // list actions so they can be used in plugins - // @ts-expect-error - optionsForPlugin.actions[key] = prop; - } - else { - // add getters for devtools - if (isComputed(prop)) { - _hmrPayload.getters[key] = isOptionsStore - ? // @ts-expect-error - options.getters[key] - : prop; - if (IS_CLIENT) { - const getters = setupStore._getters || - // @ts-expect-error: same - (setupStore._getters = markRaw([])); - getters.push(key); - } - } - } - } - // add the state, getters, and action properties - /* istanbul ignore if */ - if (isVue2) { - Object.keys(setupStore).forEach((key) => { - set(store, key, setupStore[key]); - }); - } - else { - assign(store, setupStore); - // allows retrieving reactive objects with `storeToRefs()`. Must be called after assigning to the reactive object. - // Make `storeToRefs()` work with `reactive()` #799 - assign(toRaw(store), setupStore); - } - // use this instead of a computed with setter to be able to create it anywhere - // without linking the computed lifespan to wherever the store is first - // created. - Object.defineProperty(store, '$state', { - get: () => (hot ? hotState.value : pinia.state.value[$id]), - set: (state) => { - /* istanbul ignore if */ - if (hot) { - throw new Error('cannot set hotState'); - } - $patch(($state) => { - assign($state, state); - }); - }, - }); - // add the hotUpdate before plugins to allow them to override it - /* istanbul ignore else */ - { - store._hotUpdate = markRaw((newStore) => { - store._hotUpdating = true; - newStore._hmrPayload.state.forEach((stateKey) => { - if (stateKey in store.$state) { - const newStateTarget = newStore.$state[stateKey]; - const oldStateSource = store.$state[stateKey]; - if (typeof newStateTarget === 'object' && - isPlainObject(newStateTarget) && - isPlainObject(oldStateSource)) { - patchObject(newStateTarget, oldStateSource); - } - else { - // transfer the ref - newStore.$state[stateKey] = oldStateSource; - } - } - // patch direct access properties to allow store.stateProperty to work as - // store.$state.stateProperty - set(store, stateKey, toRef(newStore.$state, stateKey)); - }); - // remove deleted state properties - Object.keys(store.$state).forEach((stateKey) => { - if (!(stateKey in newStore.$state)) { - del(store, stateKey); - } - }); - // avoid devtools logging this as a mutation - isListening = false; - isSyncListening = false; - pinia.state.value[$id] = toRef(newStore._hmrPayload, 'hotState'); - isSyncListening = true; - nextTick().then(() => { - isListening = true; - }); - for (const actionName in newStore._hmrPayload.actions) { - const action = newStore[actionName]; - set(store, actionName, wrapAction(actionName, action)); - } - // TODO: does this work in both setup and option store? - for (const getterName in newStore._hmrPayload.getters) { - const getter = newStore._hmrPayload.getters[getterName]; - const getterValue = isOptionsStore - ? // special handling of options api - computed(() => { - setActivePinia(pinia); - return getter.call(store, store); - }) - : getter; - set(store, getterName, getterValue); - } - // remove deleted getters - Object.keys(store._hmrPayload.getters).forEach((key) => { - if (!(key in newStore._hmrPayload.getters)) { - del(store, key); - } - }); - // remove old actions - Object.keys(store._hmrPayload.actions).forEach((key) => { - if (!(key in newStore._hmrPayload.actions)) { - del(store, key); - } - }); - // update the values used in devtools and to allow deleting new properties later on - store._hmrPayload = newStore._hmrPayload; - store._getters = newStore._getters; - store._hotUpdating = false; - }); - } - if (USE_DEVTOOLS) { - const nonEnumerable = { - writable: true, - configurable: true, - // avoid warning on devtools trying to display this property - enumerable: false, - }; - ['_p', '_hmrPayload', '_getters', '_customProperties'].forEach((p) => { - Object.defineProperty(store, p, assign({ value: store[p] }, nonEnumerable)); - }); - } - /* istanbul ignore if */ - if (isVue2) { - // mark the store as ready before plugins - store._r = true; - } - // apply all plugins - pinia._p.forEach((extender) => { - /* istanbul ignore else */ - if (USE_DEVTOOLS) { - const extensions = scope.run(() => extender({ - store, - app: pinia._a, - pinia, - options: optionsForPlugin, - })); - Object.keys(extensions || {}).forEach((key) => store._customProperties.add(key)); - assign(store, extensions); - } - else { - assign(store, scope.run(() => extender({ - store, - app: pinia._a, - pinia, - options: optionsForPlugin, - }))); - } - }); - if (store.$state && - typeof store.$state === 'object' && - typeof store.$state.constructor === 'function' && - !store.$state.constructor.toString().includes('[native code]')) { - console.warn(`[🍍]: The "state" must be a plain object. It cannot be\n` + - `\tstate: () => new MyClass()\n` + - `Found in store "${store.$id}".`); - } - // only apply hydrate to option stores with an initial state in pinia - if (initialState && - isOptionsStore && - options.hydrate) { - options.hydrate(store.$state, initialState); - } - isListening = true; - isSyncListening = true; - return store; -} -function defineStore( -// TODO: add proper types from above -idOrOptions, setup, setupOptions) { - let id; - let options; - const isSetupStore = typeof setup === 'function'; - if (typeof idOrOptions === 'string') { - id = idOrOptions; - // the option store setup will contain the actual options in this case - options = isSetupStore ? setupOptions : setup; - } - else { - options = idOrOptions; - id = idOrOptions.id; - if (typeof id !== 'string') { - throw new Error(`[🍍]: "defineStore()" must be passed a store id as its first argument.`); - } - } - function useStore(pinia, hot) { - const hasContext = hasInjectionContext(); - pinia = - // in test mode, ignore the argument provided as we can always retrieve a - // pinia instance with getActivePinia() - (pinia) || - (hasContext ? inject(piniaSymbol, null) : null); - if (pinia) - setActivePinia(pinia); - if (!activePinia) { - throw new Error(`[🍍]: "getActivePinia()" was called but there was no active Pinia. Did you forget to install pinia?\n` + - `\tconst pinia = createPinia()\n` + - `\tapp.use(pinia)\n` + - `This will fail in production.`); - } - pinia = activePinia; - if (!pinia._s.has(id)) { - // creating the store registers it in `pinia._s` - if (isSetupStore) { - createSetupStore(id, setup, options, pinia); - } - else { - createOptionsStore(id, options, pinia); - } - /* istanbul ignore else */ - { - // @ts-expect-error: not the right inferred type - useStore._pinia = pinia; - } - } - const store = pinia._s.get(id); - if (hot) { - const hotId = '__hot:' + id; - const newStore = isSetupStore - ? createSetupStore(hotId, setup, options, pinia, true) - : createOptionsStore(hotId, assign({}, options), pinia, true); - hot._hotUpdate(newStore); - // cleanup the state properties and the store from the cache - delete pinia.state.value[hotId]; - pinia._s.delete(hotId); - } - if (IS_CLIENT) { - const currentInstance = getCurrentInstance(); - // save stores in instances to access them devtools - if (currentInstance && - currentInstance.proxy && - // avoid adding stores that are just built for hot module replacement - !hot) { - const vm = currentInstance.proxy; - const cache = '_pStores' in vm ? vm._pStores : (vm._pStores = {}); - cache[id] = store; - } - } - // StoreGeneric cannot be casted towards Store - return store; - } - useStore.$id = id; - return useStore; -} - -let mapStoreSuffix = 'Store'; -/** - * Changes the suffix added by `mapStores()`. Can be set to an empty string. - * Defaults to `"Store"`. Make sure to extend the MapStoresCustomization - * interface if you are using TypeScript. - * - * @param suffix - new suffix - */ -function setMapStoreSuffix(suffix // could be 'Store' but that would be annoying for JS -) { - mapStoreSuffix = suffix; -} -/** - * Allows using stores without the composition API (`setup()`) by generating an - * object to be spread in the `computed` field of a component. It accepts a list - * of store definitions. - * - * @example - * ```js - * export default { - * computed: { - * // other computed properties - * ...mapStores(useUserStore, useCartStore) - * }, - * - * created() { - * this.userStore // store with id "user" - * this.cartStore // store with id "cart" - * } - * } - * ``` - * - * @param stores - list of stores to map to an object - */ -function mapStores(...stores) { - if (Array.isArray(stores[0])) { - console.warn(`[🍍]: Directly pass all stores to "mapStores()" without putting them in an array:\n` + - `Replace\n` + - `\tmapStores([useAuthStore, useCartStore])\n` + - `with\n` + - `\tmapStores(useAuthStore, useCartStore)\n` + - `This will fail in production if not fixed.`); - stores = stores[0]; - } - return stores.reduce((reduced, useStore) => { - // @ts-expect-error: $id is added by defineStore - reduced[useStore.$id + mapStoreSuffix] = function () { - return useStore(this.$pinia); - }; - return reduced; - }, {}); -} -/** - * Allows using state and getters from one store without using the composition - * API (`setup()`) by generating an object to be spread in the `computed` field - * of a component. - * - * @param useStore - store to map from - * @param keysOrMapper - array or object - */ -function mapState(useStore, keysOrMapper) { - return Array.isArray(keysOrMapper) - ? keysOrMapper.reduce((reduced, key) => { - reduced[key] = function () { - return useStore(this.$pinia)[key]; - }; - return reduced; - }, {}) - : Object.keys(keysOrMapper).reduce((reduced, key) => { - // @ts-expect-error - reduced[key] = function () { - const store = useStore(this.$pinia); - const storeKey = keysOrMapper[key]; - // for some reason TS is unable to infer the type of storeKey to be a - // function - return typeof storeKey === 'function' - ? storeKey.call(this, store) - : store[storeKey]; - }; - return reduced; - }, {}); -} -/** - * Alias for `mapState()`. You should use `mapState()` instead. - * @deprecated use `mapState()` instead. - */ -const mapGetters = mapState; -/** - * Allows directly using actions from your store without using the composition - * API (`setup()`) by generating an object to be spread in the `methods` field - * of a component. - * - * @param useStore - store to map from - * @param keysOrMapper - array or object - */ -function mapActions(useStore, keysOrMapper) { - return Array.isArray(keysOrMapper) - ? keysOrMapper.reduce((reduced, key) => { - // @ts-expect-error - reduced[key] = function (...args) { - return useStore(this.$pinia)[key](...args); - }; - return reduced; - }, {}) - : Object.keys(keysOrMapper).reduce((reduced, key) => { - // @ts-expect-error - reduced[key] = function (...args) { - return useStore(this.$pinia)[keysOrMapper[key]](...args); - }; - return reduced; - }, {}); -} -/** - * Allows using state and getters from one store without using the composition - * API (`setup()`) by generating an object to be spread in the `computed` field - * of a component. - * - * @param useStore - store to map from - * @param keysOrMapper - array or object - */ -function mapWritableState(useStore, keysOrMapper) { - return Array.isArray(keysOrMapper) - ? keysOrMapper.reduce((reduced, key) => { - // @ts-ignore - reduced[key] = { - get() { - return useStore(this.$pinia)[key]; - }, - set(value) { - // it's easier to type it here as any - return (useStore(this.$pinia)[key] = value); - }, - }; - return reduced; - }, {}) - : Object.keys(keysOrMapper).reduce((reduced, key) => { - // @ts-ignore - reduced[key] = { - get() { - return useStore(this.$pinia)[keysOrMapper[key]]; - }, - set(value) { - // it's easier to type it here as any - return (useStore(this.$pinia)[keysOrMapper[key]] = value); - }, - }; - return reduced; - }, {}); -} - -/** - * Creates an object of references with all the state, getters, and plugin-added - * state properties of the store. Similar to `toRefs()` but specifically - * designed for Pinia stores so methods and non reactive properties are - * completely ignored. - * - * @param store - store to extract the refs from - */ -function storeToRefs(store) { - // See https://github.com/vuejs/pinia/issues/852 - // It's easier to just use toRefs() even if it includes more stuff - if (isVue2) { - // @ts-expect-error: toRefs include methods and others - return toRefs(store); - } - else { - store = toRaw(store); - const refs = {}; - for (const key in store) { - const value = store[key]; - if (isRef(value) || isReactive(value)) { - // @ts-expect-error: the key is state or getter - refs[key] = - // --- - toRef(store, key); - } - } - return refs; - } -} - -/** - * Vue 2 Plugin that must be installed for pinia to work. Note **you don't need - * this plugin if you are using Nuxt.js**. Use the `buildModule` instead: - * https://pinia.vuejs.org/ssr/nuxt.html. - * - * @example - * ```js - * import Vue from 'vue' - * import { PiniaVuePlugin, createPinia } from 'pinia' - * - * Vue.use(PiniaVuePlugin) - * const pinia = createPinia() - * - * new Vue({ - * el: '#app', - * // ... - * pinia, - * }) - * ``` - * - * @param _Vue - `Vue` imported from 'vue'. - */ -const PiniaVuePlugin = function (_Vue) { - // Equivalent of - // app.config.globalProperties.$pinia = pinia - _Vue.mixin({ - beforeCreate() { - const options = this.$options; - if (options.pinia) { - const pinia = options.pinia; - // HACK: taken from provide(): https://github.com/vuejs/composition-api/blob/main/src/apis/inject.ts#L31 - /* istanbul ignore else */ - if (!this._provided) { - const provideCache = {}; - Object.defineProperty(this, '_provided', { - get: () => provideCache, - set: (v) => Object.assign(provideCache, v), - }); - } - this._provided[piniaSymbol] = pinia; - // propagate the pinia instance in an SSR friendly way - // avoid adding it to nuxt twice - /* istanbul ignore else */ - if (!this.$pinia) { - this.$pinia = pinia; - } - pinia._a = this; - if (IS_CLIENT) { - // this allows calling useStore() outside of a component setup after - // installing pinia's plugin - setActivePinia(pinia); - } - if (USE_DEVTOOLS) { - registerPiniaDevtools(pinia._a, pinia); - } - } - else if (!this.$pinia && options.parent && options.parent.$pinia) { - this.$pinia = options.parent.$pinia; - } - }, - destroyed() { - delete this._pStores; - }, - }); -}; - -export { MutationType, PiniaVuePlugin, acceptHMRUpdate, createPinia, defineStore, getActivePinia, mapActions, mapGetters, mapState, mapStores, mapWritableState, setActivePinia, setMapStoreSuffix, skipHydrate, storeToRefs }; diff --git a/node_modules/pinia/dist/pinia.iife.js b/node_modules/pinia/dist/pinia.iife.js deleted file mode 100644 index 64f1c55..0000000 --- a/node_modules/pinia/dist/pinia.iife.js +++ /dev/null @@ -1,2180 +0,0 @@ -/*! - * pinia v2.1.6 - * (c) 2023 Eduardo San Martin Morote - * @license MIT - */ -var Pinia = (function (exports, vueDemi) { - 'use strict'; - - /** - * setActivePinia must be called to handle SSR at the top of functions like - * `fetch`, `setup`, `serverPrefetch` and others - */ - let activePinia; - /** - * Sets or unsets the active pinia. Used in SSR and internally when calling - * actions and getters - * - * @param pinia - Pinia instance - */ - // @ts-expect-error: cannot constrain the type of the return - const setActivePinia = (pinia) => (activePinia = pinia); - /** - * Get the currently active pinia if there is any. - */ - const getActivePinia = () => (vueDemi.hasInjectionContext() && vueDemi.inject(piniaSymbol)) || activePinia; - const piniaSymbol = (Symbol('pinia') ); - - function getDevtoolsGlobalHook() { - return getTarget().__VUE_DEVTOOLS_GLOBAL_HOOK__; - } - function getTarget() { - // @ts-ignore - return (typeof navigator !== 'undefined' && typeof window !== 'undefined') - ? window - : typeof global !== 'undefined' - ? global - : {}; - } - const isProxyAvailable = typeof Proxy === 'function'; - - const HOOK_SETUP = 'devtools-plugin:setup'; - const HOOK_PLUGIN_SETTINGS_SET = 'plugin:settings:set'; - - let supported; - let perf; - function isPerformanceSupported() { - var _a; - if (supported !== undefined) { - return supported; - } - if (typeof window !== 'undefined' && window.performance) { - supported = true; - perf = window.performance; - } - else if (typeof global !== 'undefined' && ((_a = global.perf_hooks) === null || _a === void 0 ? void 0 : _a.performance)) { - supported = true; - perf = global.perf_hooks.performance; - } - else { - supported = false; - } - return supported; - } - function now() { - return isPerformanceSupported() ? perf.now() : Date.now(); - } - - class ApiProxy { - constructor(plugin, hook) { - this.target = null; - this.targetQueue = []; - this.onQueue = []; - this.plugin = plugin; - this.hook = hook; - const defaultSettings = {}; - if (plugin.settings) { - for (const id in plugin.settings) { - const item = plugin.settings[id]; - defaultSettings[id] = item.defaultValue; - } - } - const localSettingsSaveId = `__vue-devtools-plugin-settings__${plugin.id}`; - let currentSettings = Object.assign({}, defaultSettings); - try { - const raw = localStorage.getItem(localSettingsSaveId); - const data = JSON.parse(raw); - Object.assign(currentSettings, data); - } - catch (e) { - // noop - } - this.fallbacks = { - getSettings() { - return currentSettings; - }, - setSettings(value) { - try { - localStorage.setItem(localSettingsSaveId, JSON.stringify(value)); - } - catch (e) { - // noop - } - currentSettings = value; - }, - now() { - return now(); - }, - }; - if (hook) { - hook.on(HOOK_PLUGIN_SETTINGS_SET, (pluginId, value) => { - if (pluginId === this.plugin.id) { - this.fallbacks.setSettings(value); - } - }); - } - this.proxiedOn = new Proxy({}, { - get: (_target, prop) => { - if (this.target) { - return this.target.on[prop]; - } - else { - return (...args) => { - this.onQueue.push({ - method: prop, - args, - }); - }; - } - }, - }); - this.proxiedTarget = new Proxy({}, { - get: (_target, prop) => { - if (this.target) { - return this.target[prop]; - } - else if (prop === 'on') { - return this.proxiedOn; - } - else if (Object.keys(this.fallbacks).includes(prop)) { - return (...args) => { - this.targetQueue.push({ - method: prop, - args, - resolve: () => { }, - }); - return this.fallbacks[prop](...args); - }; - } - else { - return (...args) => { - return new Promise(resolve => { - this.targetQueue.push({ - method: prop, - args, - resolve, - }); - }); - }; - } - }, - }); - } - async setRealTarget(target) { - this.target = target; - for (const item of this.onQueue) { - this.target.on[item.method](...item.args); - } - for (const item of this.targetQueue) { - item.resolve(await this.target[item.method](...item.args)); - } - } - } - - function setupDevtoolsPlugin(pluginDescriptor, setupFn) { - const descriptor = pluginDescriptor; - const target = getTarget(); - const hook = getDevtoolsGlobalHook(); - const enableProxy = isProxyAvailable && descriptor.enableEarlyProxy; - if (hook && (target.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__ || !enableProxy)) { - hook.emit(HOOK_SETUP, pluginDescriptor, setupFn); - } - else { - const proxy = enableProxy ? new ApiProxy(descriptor, hook) : null; - const list = target.__VUE_DEVTOOLS_PLUGINS__ = target.__VUE_DEVTOOLS_PLUGINS__ || []; - list.push({ - pluginDescriptor: descriptor, - setupFn, - proxy, - }); - if (proxy) - setupFn(proxy.proxiedTarget); - } - } - - function isPlainObject( - // eslint-disable-next-line @typescript-eslint/no-explicit-any - o) { - return (o && - typeof o === 'object' && - Object.prototype.toString.call(o) === '[object Object]' && - typeof o.toJSON !== 'function'); - } - // type DeepReadonly = { readonly [P in keyof T]: DeepReadonly } - // TODO: can we change these to numbers? - /** - * Possible types for SubscriptionCallback - */ - exports.MutationType = void 0; - (function (MutationType) { - /** - * Direct mutation of the state: - * - * - `store.name = 'new name'` - * - `store.$state.name = 'new name'` - * - `store.list.push('new item')` - */ - MutationType["direct"] = "direct"; - /** - * Mutated the state with `$patch` and an object - * - * - `store.$patch({ name: 'newName' })` - */ - MutationType["patchObject"] = "patch object"; - /** - * Mutated the state with `$patch` and a function - * - * - `store.$patch(state => state.name = 'newName')` - */ - MutationType["patchFunction"] = "patch function"; - // maybe reset? for $state = {} and $reset - })(exports.MutationType || (exports.MutationType = {})); - - const IS_CLIENT = typeof window !== 'undefined'; - /** - * Should we add the devtools plugins. - * - only if dev mode or forced through the prod devtools flag - * - not in test - * - only if window exists (could change in the future) - */ - const USE_DEVTOOLS = IS_CLIENT; - - /* - * FileSaver.js A saveAs() FileSaver implementation. - * - * Originally by Eli Grey, adapted as an ESM module by Eduardo San Martin - * Morote. - * - * License : MIT - */ - // The one and only way of getting global scope in all environments - // https://stackoverflow.com/q/3277182/1008999 - const _global = /*#__PURE__*/ (() => typeof window === 'object' && window.window === window - ? window - : typeof self === 'object' && self.self === self - ? self - : typeof global === 'object' && global.global === global - ? global - : typeof globalThis === 'object' - ? globalThis - : { HTMLElement: null })(); - function bom(blob, { autoBom = false } = {}) { - // prepend BOM for UTF-8 XML and text/* types (including HTML) - // note: your browser will automatically convert UTF-16 U+FEFF to EF BB BF - if (autoBom && - /^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(blob.type)) { - return new Blob([String.fromCharCode(0xfeff), blob], { type: blob.type }); - } - return blob; - } - function download(url, name, opts) { - const xhr = new XMLHttpRequest(); - xhr.open('GET', url); - xhr.responseType = 'blob'; - xhr.onload = function () { - saveAs(xhr.response, name, opts); - }; - xhr.onerror = function () { - console.error('could not download file'); - }; - xhr.send(); - } - function corsEnabled(url) { - const xhr = new XMLHttpRequest(); - // use sync to avoid popup blocker - xhr.open('HEAD', url, false); - try { - xhr.send(); - } - catch (e) { } - return xhr.status >= 200 && xhr.status <= 299; - } - // `a.click()` doesn't work for all browsers (#465) - function click(node) { - try { - node.dispatchEvent(new MouseEvent('click')); - } - catch (e) { - const evt = document.createEvent('MouseEvents'); - evt.initMouseEvent('click', true, true, window, 0, 0, 0, 80, 20, false, false, false, false, 0, null); - node.dispatchEvent(evt); - } - } - const _navigator = - typeof navigator === 'object' ? navigator : { userAgent: '' }; - // Detect WebView inside a native macOS app by ruling out all browsers - // We just need to check for 'Safari' because all other browsers (besides Firefox) include that too - // https://www.whatismybrowser.com/guides/the-latest-user-agent/macos - const isMacOSWebView = /*#__PURE__*/ (() => /Macintosh/.test(_navigator.userAgent) && - /AppleWebKit/.test(_navigator.userAgent) && - !/Safari/.test(_navigator.userAgent))(); - const saveAs = !IS_CLIENT - ? () => { } // noop - : // Use download attribute first if possible (#193 Lumia mobile) unless this is a macOS WebView or mini program - typeof HTMLAnchorElement !== 'undefined' && - 'download' in HTMLAnchorElement.prototype && - !isMacOSWebView - ? downloadSaveAs - : // Use msSaveOrOpenBlob as a second approach - 'msSaveOrOpenBlob' in _navigator - ? msSaveAs - : // Fallback to using FileReader and a popup - fileSaverSaveAs; - function downloadSaveAs(blob, name = 'download', opts) { - const a = document.createElement('a'); - a.download = name; - a.rel = 'noopener'; // tabnabbing - // TODO: detect chrome extensions & packaged apps - // a.target = '_blank' - if (typeof blob === 'string') { - // Support regular links - a.href = blob; - if (a.origin !== location.origin) { - if (corsEnabled(a.href)) { - download(blob, name, opts); - } - else { - a.target = '_blank'; - click(a); - } - } - else { - click(a); - } - } - else { - // Support blobs - a.href = URL.createObjectURL(blob); - setTimeout(function () { - URL.revokeObjectURL(a.href); - }, 4e4); // 40s - setTimeout(function () { - click(a); - }, 0); - } - } - function msSaveAs(blob, name = 'download', opts) { - if (typeof blob === 'string') { - if (corsEnabled(blob)) { - download(blob, name, opts); - } - else { - const a = document.createElement('a'); - a.href = blob; - a.target = '_blank'; - setTimeout(function () { - click(a); - }); - } - } - else { - // @ts-ignore: works on windows - navigator.msSaveOrOpenBlob(bom(blob, opts), name); - } - } - function fileSaverSaveAs(blob, name, opts, popup) { - // Open a popup immediately do go around popup blocker - // Mostly only available on user interaction and the fileReader is async so... - popup = popup || open('', '_blank'); - if (popup) { - popup.document.title = popup.document.body.innerText = 'downloading...'; - } - if (typeof blob === 'string') - return download(blob, name, opts); - const force = blob.type === 'application/octet-stream'; - const isSafari = /constructor/i.test(String(_global.HTMLElement)) || 'safari' in _global; - const isChromeIOS = /CriOS\/[\d]+/.test(navigator.userAgent); - if ((isChromeIOS || (force && isSafari) || isMacOSWebView) && - typeof FileReader !== 'undefined') { - // Safari doesn't allow downloading of blob URLs - const reader = new FileReader(); - reader.onloadend = function () { - let url = reader.result; - if (typeof url !== 'string') { - popup = null; - throw new Error('Wrong reader.result type'); - } - url = isChromeIOS - ? url - : url.replace(/^data:[^;]*;/, 'data:attachment/file;'); - if (popup) { - popup.location.href = url; - } - else { - location.assign(url); - } - popup = null; // reverse-tabnabbing #460 - }; - reader.readAsDataURL(blob); - } - else { - const url = URL.createObjectURL(blob); - if (popup) - popup.location.assign(url); - else - location.href = url; - popup = null; // reverse-tabnabbing #460 - setTimeout(function () { - URL.revokeObjectURL(url); - }, 4e4); // 40s - } - } - - /** - * Shows a toast or console.log - * - * @param message - message to log - * @param type - different color of the tooltip - */ - function toastMessage(message, type) { - const piniaMessage = '🍍 ' + message; - if (typeof __VUE_DEVTOOLS_TOAST__ === 'function') { - // No longer available :( - __VUE_DEVTOOLS_TOAST__(piniaMessage, type); - } - else if (type === 'error') { - console.error(piniaMessage); - } - else if (type === 'warn') { - console.warn(piniaMessage); - } - else { - console.log(piniaMessage); - } - } - function isPinia(o) { - return '_a' in o && 'install' in o; - } - - /** - * This file contain devtools actions, they are not Pinia actions. - */ - // --- - function checkClipboardAccess() { - if (!('clipboard' in navigator)) { - toastMessage(`Your browser doesn't support the Clipboard API`, 'error'); - return true; - } - } - function checkNotFocusedError(error) { - if (error instanceof Error && - error.message.toLowerCase().includes('document is not focused')) { - toastMessage('You need to activate the "Emulate a focused page" setting in the "Rendering" panel of devtools.', 'warn'); - return true; - } - return false; - } - async function actionGlobalCopyState(pinia) { - if (checkClipboardAccess()) - return; - try { - await navigator.clipboard.writeText(JSON.stringify(pinia.state.value)); - toastMessage('Global state copied to clipboard.'); - } - catch (error) { - if (checkNotFocusedError(error)) - return; - toastMessage(`Failed to serialize the state. Check the console for more details.`, 'error'); - console.error(error); - } - } - async function actionGlobalPasteState(pinia) { - if (checkClipboardAccess()) - return; - try { - loadStoresState(pinia, JSON.parse(await navigator.clipboard.readText())); - toastMessage('Global state pasted from clipboard.'); - } - catch (error) { - if (checkNotFocusedError(error)) - return; - toastMessage(`Failed to deserialize the state from clipboard. Check the console for more details.`, 'error'); - console.error(error); - } - } - async function actionGlobalSaveState(pinia) { - try { - saveAs(new Blob([JSON.stringify(pinia.state.value)], { - type: 'text/plain;charset=utf-8', - }), 'pinia-state.json'); - } - catch (error) { - toastMessage(`Failed to export the state as JSON. Check the console for more details.`, 'error'); - console.error(error); - } - } - let fileInput; - function getFileOpener() { - if (!fileInput) { - fileInput = document.createElement('input'); - fileInput.type = 'file'; - fileInput.accept = '.json'; - } - function openFile() { - return new Promise((resolve, reject) => { - fileInput.onchange = async () => { - const files = fileInput.files; - if (!files) - return resolve(null); - const file = files.item(0); - if (!file) - return resolve(null); - return resolve({ text: await file.text(), file }); - }; - // @ts-ignore: TODO: changed from 4.3 to 4.4 - fileInput.oncancel = () => resolve(null); - fileInput.onerror = reject; - fileInput.click(); - }); - } - return openFile; - } - async function actionGlobalOpenStateFile(pinia) { - try { - const open = getFileOpener(); - const result = await open(); - if (!result) - return; - const { text, file } = result; - loadStoresState(pinia, JSON.parse(text)); - toastMessage(`Global state imported from "${file.name}".`); - } - catch (error) { - toastMessage(`Failed to import the state from JSON. Check the console for more details.`, 'error'); - console.error(error); - } - } - function loadStoresState(pinia, state) { - for (const key in state) { - const storeState = pinia.state.value[key]; - if (storeState) { - Object.assign(storeState, state[key]); - } - } - } - - function formatDisplay(display) { - return { - _custom: { - display, - }, - }; - } - const PINIA_ROOT_LABEL = '🍍 Pinia (root)'; - const PINIA_ROOT_ID = '_root'; - function formatStoreForInspectorTree(store) { - return isPinia(store) - ? { - id: PINIA_ROOT_ID, - label: PINIA_ROOT_LABEL, - } - : { - id: store.$id, - label: store.$id, - }; - } - function formatStoreForInspectorState(store) { - if (isPinia(store)) { - const storeNames = Array.from(store._s.keys()); - const storeMap = store._s; - const state = { - state: storeNames.map((storeId) => ({ - editable: true, - key: storeId, - value: store.state.value[storeId], - })), - getters: storeNames - .filter((id) => storeMap.get(id)._getters) - .map((id) => { - const store = storeMap.get(id); - return { - editable: false, - key: id, - value: store._getters.reduce((getters, key) => { - getters[key] = store[key]; - return getters; - }, {}), - }; - }), - }; - return state; - } - const state = { - state: Object.keys(store.$state).map((key) => ({ - editable: true, - key, - value: store.$state[key], - })), - }; - // avoid adding empty getters - if (store._getters && store._getters.length) { - state.getters = store._getters.map((getterName) => ({ - editable: false, - key: getterName, - value: store[getterName], - })); - } - if (store._customProperties.size) { - state.customProperties = Array.from(store._customProperties).map((key) => ({ - editable: true, - key, - value: store[key], - })); - } - return state; - } - function formatEventData(events) { - if (!events) - return {}; - if (Array.isArray(events)) { - // TODO: handle add and delete for arrays and objects - return events.reduce((data, event) => { - data.keys.push(event.key); - data.operations.push(event.type); - data.oldValue[event.key] = event.oldValue; - data.newValue[event.key] = event.newValue; - return data; - }, { - oldValue: {}, - keys: [], - operations: [], - newValue: {}, - }); - } - else { - return { - operation: formatDisplay(events.type), - key: formatDisplay(events.key), - oldValue: events.oldValue, - newValue: events.newValue, - }; - } - } - function formatMutationType(type) { - switch (type) { - case exports.MutationType.direct: - return 'mutation'; - case exports.MutationType.patchFunction: - return '$patch'; - case exports.MutationType.patchObject: - return '$patch'; - default: - return 'unknown'; - } - } - - // timeline can be paused when directly changing the state - let isTimelineActive = true; - const componentStateTypes = []; - const MUTATIONS_LAYER_ID = 'pinia:mutations'; - const INSPECTOR_ID = 'pinia'; - const { assign: assign$1 } = Object; - /** - * Gets the displayed name of a store in devtools - * - * @param id - id of the store - * @returns a formatted string - */ - const getStoreType = (id) => '🍍 ' + id; - /** - * Add the pinia plugin without any store. Allows displaying a Pinia plugin tab - * as soon as it is added to the application. - * - * @param app - Vue application - * @param pinia - pinia instance - */ - function registerPiniaDevtools(app, pinia) { - setupDevtoolsPlugin({ - id: 'dev.esm.pinia', - label: 'Pinia 🍍', - logo: 'https://pinia.vuejs.org/logo.svg', - packageName: 'pinia', - homepage: 'https://pinia.vuejs.org', - componentStateTypes, - app, - }, (api) => { - if (typeof api.now !== 'function') { - toastMessage('You seem to be using an outdated version of Vue Devtools. Are you still using the Beta release instead of the stable one? You can find the links at https://devtools.vuejs.org/guide/installation.html.'); - } - api.addTimelineLayer({ - id: MUTATIONS_LAYER_ID, - label: `Pinia 🍍`, - color: 0xe5df88, - }); - api.addInspector({ - id: INSPECTOR_ID, - label: 'Pinia 🍍', - icon: 'storage', - treeFilterPlaceholder: 'Search stores', - actions: [ - { - icon: 'content_copy', - action: () => { - actionGlobalCopyState(pinia); - }, - tooltip: 'Serialize and copy the state', - }, - { - icon: 'content_paste', - action: async () => { - await actionGlobalPasteState(pinia); - api.sendInspectorTree(INSPECTOR_ID); - api.sendInspectorState(INSPECTOR_ID); - }, - tooltip: 'Replace the state with the content of your clipboard', - }, - { - icon: 'save', - action: () => { - actionGlobalSaveState(pinia); - }, - tooltip: 'Save the state as a JSON file', - }, - { - icon: 'folder_open', - action: async () => { - await actionGlobalOpenStateFile(pinia); - api.sendInspectorTree(INSPECTOR_ID); - api.sendInspectorState(INSPECTOR_ID); - }, - tooltip: 'Import the state from a JSON file', - }, - ], - nodeActions: [ - { - icon: 'restore', - tooltip: 'Reset the state (with "$reset")', - action: (nodeId) => { - const store = pinia._s.get(nodeId); - if (!store) { - toastMessage(`Cannot reset "${nodeId}" store because it wasn't found.`, 'warn'); - } - else if (typeof store.$reset !== 'function') { - toastMessage(`Cannot reset "${nodeId}" store because it doesn't have a "$reset" method implemented.`, 'warn'); - } - else { - store.$reset(); - toastMessage(`Store "${nodeId}" reset.`); - } - }, - }, - ], - }); - api.on.inspectComponent((payload, ctx) => { - const proxy = (payload.componentInstance && - payload.componentInstance.proxy); - if (proxy && proxy._pStores) { - const piniaStores = payload.componentInstance.proxy._pStores; - Object.values(piniaStores).forEach((store) => { - payload.instanceData.state.push({ - type: getStoreType(store.$id), - key: 'state', - editable: true, - value: store._isOptionsAPI - ? { - _custom: { - value: vueDemi.toRaw(store.$state), - actions: [ - { - icon: 'restore', - tooltip: 'Reset the state of this store', - action: () => store.$reset(), - }, - ], - }, - } - : // NOTE: workaround to unwrap transferred refs - Object.keys(store.$state).reduce((state, key) => { - state[key] = store.$state[key]; - return state; - }, {}), - }); - if (store._getters && store._getters.length) { - payload.instanceData.state.push({ - type: getStoreType(store.$id), - key: 'getters', - editable: false, - value: store._getters.reduce((getters, key) => { - try { - getters[key] = store[key]; - } - catch (error) { - // @ts-expect-error: we just want to show it in devtools - getters[key] = error; - } - return getters; - }, {}), - }); - } - }); - } - }); - api.on.getInspectorTree((payload) => { - if (payload.app === app && payload.inspectorId === INSPECTOR_ID) { - let stores = [pinia]; - stores = stores.concat(Array.from(pinia._s.values())); - payload.rootNodes = (payload.filter - ? stores.filter((store) => '$id' in store - ? store.$id - .toLowerCase() - .includes(payload.filter.toLowerCase()) - : PINIA_ROOT_LABEL.toLowerCase().includes(payload.filter.toLowerCase())) - : stores).map(formatStoreForInspectorTree); - } - }); - api.on.getInspectorState((payload) => { - if (payload.app === app && payload.inspectorId === INSPECTOR_ID) { - const inspectedStore = payload.nodeId === PINIA_ROOT_ID - ? pinia - : pinia._s.get(payload.nodeId); - if (!inspectedStore) { - // this could be the selected store restored for a different project - // so it's better not to say anything here - return; - } - if (inspectedStore) { - payload.state = formatStoreForInspectorState(inspectedStore); - } - } - }); - api.on.editInspectorState((payload, ctx) => { - if (payload.app === app && payload.inspectorId === INSPECTOR_ID) { - const inspectedStore = payload.nodeId === PINIA_ROOT_ID - ? pinia - : pinia._s.get(payload.nodeId); - if (!inspectedStore) { - return toastMessage(`store "${payload.nodeId}" not found`, 'error'); - } - const { path } = payload; - if (!isPinia(inspectedStore)) { - // access only the state - if (path.length !== 1 || - !inspectedStore._customProperties.has(path[0]) || - path[0] in inspectedStore.$state) { - path.unshift('$state'); - } - } - else { - // Root access, we can omit the `.value` because the devtools API does it for us - path.unshift('state'); - } - isTimelineActive = false; - payload.set(inspectedStore, path, payload.state.value); - isTimelineActive = true; - } - }); - api.on.editComponentState((payload) => { - if (payload.type.startsWith('🍍')) { - const storeId = payload.type.replace(/^🍍\s*/, ''); - const store = pinia._s.get(storeId); - if (!store) { - return toastMessage(`store "${storeId}" not found`, 'error'); - } - const { path } = payload; - if (path[0] !== 'state') { - return toastMessage(`Invalid path for store "${storeId}":\n${path}\nOnly state can be modified.`); - } - // rewrite the first entry to be able to directly set the state as - // well as any other path - path[0] = '$state'; - isTimelineActive = false; - payload.set(store, path, payload.state.value); - isTimelineActive = true; - } - }); - }); - } - function addStoreToDevtools(app, store) { - if (!componentStateTypes.includes(getStoreType(store.$id))) { - componentStateTypes.push(getStoreType(store.$id)); - } - setupDevtoolsPlugin({ - id: 'dev.esm.pinia', - label: 'Pinia 🍍', - logo: 'https://pinia.vuejs.org/logo.svg', - packageName: 'pinia', - homepage: 'https://pinia.vuejs.org', - componentStateTypes, - app, - settings: { - logStoreChanges: { - label: 'Notify about new/deleted stores', - type: 'boolean', - defaultValue: true, - }, - // useEmojis: { - // label: 'Use emojis in messages ⚡️', - // type: 'boolean', - // defaultValue: true, - // }, - }, - }, (api) => { - // gracefully handle errors - const now = typeof api.now === 'function' ? api.now.bind(api) : Date.now; - store.$onAction(({ after, onError, name, args }) => { - const groupId = runningActionId++; - api.addTimelineEvent({ - layerId: MUTATIONS_LAYER_ID, - event: { - time: now(), - title: '🛫 ' + name, - subtitle: 'start', - data: { - store: formatDisplay(store.$id), - action: formatDisplay(name), - args, - }, - groupId, - }, - }); - after((result) => { - activeAction = undefined; - api.addTimelineEvent({ - layerId: MUTATIONS_LAYER_ID, - event: { - time: now(), - title: '🛬 ' + name, - subtitle: 'end', - data: { - store: formatDisplay(store.$id), - action: formatDisplay(name), - args, - result, - }, - groupId, - }, - }); - }); - onError((error) => { - activeAction = undefined; - api.addTimelineEvent({ - layerId: MUTATIONS_LAYER_ID, - event: { - time: now(), - logType: 'error', - title: '💥 ' + name, - subtitle: 'end', - data: { - store: formatDisplay(store.$id), - action: formatDisplay(name), - args, - error, - }, - groupId, - }, - }); - }); - }, true); - store._customProperties.forEach((name) => { - vueDemi.watch(() => vueDemi.unref(store[name]), (newValue, oldValue) => { - api.notifyComponentUpdate(); - api.sendInspectorState(INSPECTOR_ID); - if (isTimelineActive) { - api.addTimelineEvent({ - layerId: MUTATIONS_LAYER_ID, - event: { - time: now(), - title: 'Change', - subtitle: name, - data: { - newValue, - oldValue, - }, - groupId: activeAction, - }, - }); - } - }, { deep: true }); - }); - store.$subscribe(({ events, type }, state) => { - api.notifyComponentUpdate(); - api.sendInspectorState(INSPECTOR_ID); - if (!isTimelineActive) - return; - // rootStore.state[store.id] = state - const eventData = { - time: now(), - title: formatMutationType(type), - data: assign$1({ store: formatDisplay(store.$id) }, formatEventData(events)), - groupId: activeAction, - }; - if (type === exports.MutationType.patchFunction) { - eventData.subtitle = '⤵️'; - } - else if (type === exports.MutationType.patchObject) { - eventData.subtitle = '🧩'; - } - else if (events && !Array.isArray(events)) { - eventData.subtitle = events.type; - } - if (events) { - eventData.data['rawEvent(s)'] = { - _custom: { - display: 'DebuggerEvent', - type: 'object', - tooltip: 'raw DebuggerEvent[]', - value: events, - }, - }; - } - api.addTimelineEvent({ - layerId: MUTATIONS_LAYER_ID, - event: eventData, - }); - }, { detached: true, flush: 'sync' }); - const hotUpdate = store._hotUpdate; - store._hotUpdate = vueDemi.markRaw((newStore) => { - hotUpdate(newStore); - api.addTimelineEvent({ - layerId: MUTATIONS_LAYER_ID, - event: { - time: now(), - title: '🔥 ' + store.$id, - subtitle: 'HMR update', - data: { - store: formatDisplay(store.$id), - info: formatDisplay(`HMR update`), - }, - }, - }); - // update the devtools too - api.notifyComponentUpdate(); - api.sendInspectorTree(INSPECTOR_ID); - api.sendInspectorState(INSPECTOR_ID); - }); - const { $dispose } = store; - store.$dispose = () => { - $dispose(); - api.notifyComponentUpdate(); - api.sendInspectorTree(INSPECTOR_ID); - api.sendInspectorState(INSPECTOR_ID); - api.getSettings().logStoreChanges && - toastMessage(`Disposed "${store.$id}" store 🗑`); - }; - // trigger an update so it can display new registered stores - api.notifyComponentUpdate(); - api.sendInspectorTree(INSPECTOR_ID); - api.sendInspectorState(INSPECTOR_ID); - api.getSettings().logStoreChanges && - toastMessage(`"${store.$id}" store installed 🆕`); - }); - } - let runningActionId = 0; - let activeAction; - /** - * Patches a store to enable action grouping in devtools by wrapping the store with a Proxy that is passed as the - * context of all actions, allowing us to set `runningAction` on each access and effectively associating any state - * mutation to the action. - * - * @param store - store to patch - * @param actionNames - list of actionst to patch - */ - function patchActionForGrouping(store, actionNames, wrapWithProxy) { - // original actions of the store as they are given by pinia. We are going to override them - const actions = actionNames.reduce((storeActions, actionName) => { - // use toRaw to avoid tracking #541 - storeActions[actionName] = vueDemi.toRaw(store)[actionName]; - return storeActions; - }, {}); - for (const actionName in actions) { - store[actionName] = function () { - // the running action id is incremented in a before action hook - const _actionId = runningActionId; - const trackedStore = wrapWithProxy - ? new Proxy(store, { - get(...args) { - activeAction = _actionId; - return Reflect.get(...args); - }, - set(...args) { - activeAction = _actionId; - return Reflect.set(...args); - }, - }) - : store; - // For Setup Stores we need https://github.com/tc39/proposal-async-context - activeAction = _actionId; - const retValue = actions[actionName].apply(trackedStore, arguments); - // this is safer as async actions in Setup Stores would associate mutations done outside of the action - activeAction = undefined; - return retValue; - }; - } - } - /** - * pinia.use(devtoolsPlugin) - */ - function devtoolsPlugin({ app, store, options }) { - // HMR module - if (store.$id.startsWith('__hot:')) { - return; - } - // detect option api vs setup api - store._isOptionsAPI = !!options.state; - patchActionForGrouping(store, Object.keys(options.actions), store._isOptionsAPI); - // Upgrade the HMR to also update the new actions - const originalHotUpdate = store._hotUpdate; - vueDemi.toRaw(store)._hotUpdate = function (newStore) { - originalHotUpdate.apply(this, arguments); - patchActionForGrouping(store, Object.keys(newStore._hmrPayload.actions), !!store._isOptionsAPI); - }; - addStoreToDevtools(app, - // FIXME: is there a way to allow the assignment from Store to StoreGeneric? - store); - } - - /** - * Creates a Pinia instance to be used by the application - */ - function createPinia() { - const scope = vueDemi.effectScope(true); - // NOTE: here we could check the window object for a state and directly set it - // if there is anything like it with Vue 3 SSR - const state = scope.run(() => vueDemi.ref({})); - let _p = []; - // plugins added before calling app.use(pinia) - let toBeInstalled = []; - const pinia = vueDemi.markRaw({ - install(app) { - // this allows calling useStore() outside of a component setup after - // installing pinia's plugin - setActivePinia(pinia); - if (!vueDemi.isVue2) { - pinia._a = app; - app.provide(piniaSymbol, pinia); - app.config.globalProperties.$pinia = pinia; - /* istanbul ignore else */ - if (USE_DEVTOOLS) { - registerPiniaDevtools(app, pinia); - } - toBeInstalled.forEach((plugin) => _p.push(plugin)); - toBeInstalled = []; - } - }, - use(plugin) { - if (!this._a && !vueDemi.isVue2) { - toBeInstalled.push(plugin); - } - else { - _p.push(plugin); - } - return this; - }, - _p, - // it's actually undefined here - // @ts-expect-error - _a: null, - _e: scope, - _s: new Map(), - state, - }); - // pinia devtools rely on dev only features so they cannot be forced unless - // the dev build of Vue is used. Avoid old browsers like IE11. - if (USE_DEVTOOLS && typeof Proxy !== 'undefined') { - pinia.use(devtoolsPlugin); - } - return pinia; - } - - /** - * Checks if a function is a `StoreDefinition`. - * - * @param fn - object to test - * @returns true if `fn` is a StoreDefinition - */ - const isUseStore = (fn) => { - return typeof fn === 'function' && typeof fn.$id === 'string'; - }; - /** - * Mutates in place `newState` with `oldState` to _hot update_ it. It will - * remove any key not existing in `newState` and recursively merge plain - * objects. - * - * @param newState - new state object to be patched - * @param oldState - old state that should be used to patch newState - * @returns - newState - */ - function patchObject(newState, oldState) { - // no need to go through symbols because they cannot be serialized anyway - for (const key in oldState) { - const subPatch = oldState[key]; - // skip the whole sub tree - if (!(key in newState)) { - continue; - } - const targetValue = newState[key]; - if (isPlainObject(targetValue) && - isPlainObject(subPatch) && - !vueDemi.isRef(subPatch) && - !vueDemi.isReactive(subPatch)) { - newState[key] = patchObject(targetValue, subPatch); - } - else { - // objects are either a bit more complex (e.g. refs) or primitives, so we - // just set the whole thing - if (vueDemi.isVue2) { - vueDemi.set(newState, key, subPatch); - } - else { - newState[key] = subPatch; - } - } - } - return newState; - } - /** - * Creates an _accept_ function to pass to `import.meta.hot` in Vite applications. - * - * @example - * ```js - * const useUser = defineStore(...) - * if (import.meta.hot) { - * import.meta.hot.accept(acceptHMRUpdate(useUser, import.meta.hot)) - * } - * ``` - * - * @param initialUseStore - return of the defineStore to hot update - * @param hot - `import.meta.hot` - */ - function acceptHMRUpdate(initialUseStore, hot) { - return (newModule) => { - const pinia = hot.data.pinia || initialUseStore._pinia; - if (!pinia) { - // this store is still not used - return; - } - // preserve the pinia instance across loads - hot.data.pinia = pinia; - // console.log('got data', newStore) - for (const exportName in newModule) { - const useStore = newModule[exportName]; - // console.log('checking for', exportName) - if (isUseStore(useStore) && pinia._s.has(useStore.$id)) { - // console.log('Accepting update for', useStore.$id) - const id = useStore.$id; - if (id !== initialUseStore.$id) { - console.warn(`The id of the store changed from "${initialUseStore.$id}" to "${id}". Reloading.`); - // return import.meta.hot.invalidate() - return hot.invalidate(); - } - const existingStore = pinia._s.get(id); - if (!existingStore) { - console.log(`[Pinia]: skipping hmr because store doesn't exist yet`); - return; - } - useStore(pinia, existingStore); - } - } - }; - } - - const noop = () => { }; - function addSubscription(subscriptions, callback, detached, onCleanup = noop) { - subscriptions.push(callback); - const removeSubscription = () => { - const idx = subscriptions.indexOf(callback); - if (idx > -1) { - subscriptions.splice(idx, 1); - onCleanup(); - } - }; - if (!detached && vueDemi.getCurrentScope()) { - vueDemi.onScopeDispose(removeSubscription); - } - return removeSubscription; - } - function triggerSubscriptions(subscriptions, ...args) { - subscriptions.slice().forEach((callback) => { - callback(...args); - }); - } - - const fallbackRunWithContext = (fn) => fn(); - function mergeReactiveObjects(target, patchToApply) { - // Handle Map instances - if (target instanceof Map && patchToApply instanceof Map) { - patchToApply.forEach((value, key) => target.set(key, value)); - } - // Handle Set instances - if (target instanceof Set && patchToApply instanceof Set) { - patchToApply.forEach(target.add, target); - } - // no need to go through symbols because they cannot be serialized anyway - for (const key in patchToApply) { - if (!patchToApply.hasOwnProperty(key)) - continue; - const subPatch = patchToApply[key]; - const targetValue = target[key]; - if (isPlainObject(targetValue) && - isPlainObject(subPatch) && - target.hasOwnProperty(key) && - !vueDemi.isRef(subPatch) && - !vueDemi.isReactive(subPatch)) { - // NOTE: here I wanted to warn about inconsistent types but it's not possible because in setup stores one might - // start the value of a property as a certain type e.g. a Map, and then for some reason, during SSR, change that - // to `undefined`. When trying to hydrate, we want to override the Map with `undefined`. - target[key] = mergeReactiveObjects(targetValue, subPatch); - } - else { - // @ts-expect-error: subPatch is a valid value - target[key] = subPatch; - } - } - return target; - } - const skipHydrateSymbol = Symbol('pinia:skipHydration') - ; - const skipHydrateMap = /*#__PURE__*/ new WeakMap(); - /** - * Tells Pinia to skip the hydration process of a given object. This is useful in setup stores (only) when you return a - * stateful object in the store but it isn't really state. e.g. returning a router instance in a setup store. - * - * @param obj - target object - * @returns obj - */ - function skipHydrate(obj) { - return vueDemi.isVue2 - ? // in @vue/composition-api, the refs are sealed so defineProperty doesn't work... - /* istanbul ignore next */ skipHydrateMap.set(obj, 1) && obj - : Object.defineProperty(obj, skipHydrateSymbol, {}); - } - /** - * Returns whether a value should be hydrated - * - * @param obj - target variable - * @returns true if `obj` should be hydrated - */ - function shouldHydrate(obj) { - return vueDemi.isVue2 - ? /* istanbul ignore next */ !skipHydrateMap.has(obj) - : !isPlainObject(obj) || !obj.hasOwnProperty(skipHydrateSymbol); - } - const { assign } = Object; - function isComputed(o) { - return !!(vueDemi.isRef(o) && o.effect); - } - function createOptionsStore(id, options, pinia, hot) { - const { state, actions, getters } = options; - const initialState = pinia.state.value[id]; - let store; - function setup() { - if (!initialState && (!hot)) { - /* istanbul ignore if */ - if (vueDemi.isVue2) { - vueDemi.set(pinia.state.value, id, state ? state() : {}); - } - else { - pinia.state.value[id] = state ? state() : {}; - } - } - // avoid creating a state in pinia.state.value - const localState = hot - ? // use ref() to unwrap refs inside state TODO: check if this is still necessary - vueDemi.toRefs(vueDemi.ref(state ? state() : {}).value) - : vueDemi.toRefs(pinia.state.value[id]); - return assign(localState, actions, Object.keys(getters || {}).reduce((computedGetters, name) => { - if (name in localState) { - console.warn(`[🍍]: A getter cannot have the same name as another state property. Rename one of them. Found with "${name}" in store "${id}".`); - } - computedGetters[name] = vueDemi.markRaw(vueDemi.computed(() => { - setActivePinia(pinia); - // it was created just before - const store = pinia._s.get(id); - // allow cross using stores - /* istanbul ignore next */ - if (vueDemi.isVue2 && !store._r) - return; - // @ts-expect-error - // return getters![name].call(context, context) - // TODO: avoid reading the getter while assigning with a global variable - return getters[name].call(store, store); - })); - return computedGetters; - }, {})); - } - store = createSetupStore(id, setup, options, pinia, hot, true); - return store; - } - function createSetupStore($id, setup, options = {}, pinia, hot, isOptionsStore) { - let scope; - const optionsForPlugin = assign({ actions: {} }, options); - /* istanbul ignore if */ - if (!pinia._e.active) { - throw new Error('Pinia destroyed'); - } - // watcher options for $subscribe - const $subscribeOptions = { - deep: true, - // flush: 'post', - }; - /* istanbul ignore else */ - if (!vueDemi.isVue2) { - $subscribeOptions.onTrigger = (event) => { - /* istanbul ignore else */ - if (isListening) { - debuggerEvents = event; - // avoid triggering this while the store is being built and the state is being set in pinia - } - else if (isListening == false && !store._hotUpdating) { - // let patch send all the events together later - /* istanbul ignore else */ - if (Array.isArray(debuggerEvents)) { - debuggerEvents.push(event); - } - else { - console.error('🍍 debuggerEvents should be an array. This is most likely an internal Pinia bug.'); - } - } - }; - } - // internal state - let isListening; // set to true at the end - let isSyncListening; // set to true at the end - let subscriptions = []; - let actionSubscriptions = []; - let debuggerEvents; - const initialState = pinia.state.value[$id]; - // avoid setting the state for option stores if it is set - // by the setup - if (!isOptionsStore && !initialState && (!hot)) { - /* istanbul ignore if */ - if (vueDemi.isVue2) { - vueDemi.set(pinia.state.value, $id, {}); - } - else { - pinia.state.value[$id] = {}; - } - } - const hotState = vueDemi.ref({}); - // avoid triggering too many listeners - // https://github.com/vuejs/pinia/issues/1129 - let activeListener; - function $patch(partialStateOrMutator) { - let subscriptionMutation; - isListening = isSyncListening = false; - // reset the debugger events since patches are sync - /* istanbul ignore else */ - { - debuggerEvents = []; - } - if (typeof partialStateOrMutator === 'function') { - partialStateOrMutator(pinia.state.value[$id]); - subscriptionMutation = { - type: exports.MutationType.patchFunction, - storeId: $id, - events: debuggerEvents, - }; - } - else { - mergeReactiveObjects(pinia.state.value[$id], partialStateOrMutator); - subscriptionMutation = { - type: exports.MutationType.patchObject, - payload: partialStateOrMutator, - storeId: $id, - events: debuggerEvents, - }; - } - const myListenerId = (activeListener = Symbol()); - vueDemi.nextTick().then(() => { - if (activeListener === myListenerId) { - isListening = true; - } - }); - isSyncListening = true; - // because we paused the watcher, we need to manually call the subscriptions - triggerSubscriptions(subscriptions, subscriptionMutation, pinia.state.value[$id]); - } - const $reset = isOptionsStore - ? function $reset() { - const { state } = options; - const newState = state ? state() : {}; - // we use a patch to group all changes into one single subscription - this.$patch(($state) => { - assign($state, newState); - }); - } - : /* istanbul ignore next */ - () => { - throw new Error(`🍍: Store "${$id}" is built using the setup syntax and does not implement $reset().`); - } - ; - function $dispose() { - scope.stop(); - subscriptions = []; - actionSubscriptions = []; - pinia._s.delete($id); - } - /** - * Wraps an action to handle subscriptions. - * - * @param name - name of the action - * @param action - action to wrap - * @returns a wrapped action to handle subscriptions - */ - function wrapAction(name, action) { - return function () { - setActivePinia(pinia); - const args = Array.from(arguments); - const afterCallbackList = []; - const onErrorCallbackList = []; - function after(callback) { - afterCallbackList.push(callback); - } - function onError(callback) { - onErrorCallbackList.push(callback); - } - // @ts-expect-error - triggerSubscriptions(actionSubscriptions, { - args, - name, - store, - after, - onError, - }); - let ret; - try { - ret = action.apply(this && this.$id === $id ? this : store, args); - // handle sync errors - } - catch (error) { - triggerSubscriptions(onErrorCallbackList, error); - throw error; - } - if (ret instanceof Promise) { - return ret - .then((value) => { - triggerSubscriptions(afterCallbackList, value); - return value; - }) - .catch((error) => { - triggerSubscriptions(onErrorCallbackList, error); - return Promise.reject(error); - }); - } - // trigger after callbacks - triggerSubscriptions(afterCallbackList, ret); - return ret; - }; - } - const _hmrPayload = /*#__PURE__*/ vueDemi.markRaw({ - actions: {}, - getters: {}, - state: [], - hotState, - }); - const partialStore = { - _p: pinia, - // _s: scope, - $id, - $onAction: addSubscription.bind(null, actionSubscriptions), - $patch, - $reset, - $subscribe(callback, options = {}) { - const removeSubscription = addSubscription(subscriptions, callback, options.detached, () => stopWatcher()); - const stopWatcher = scope.run(() => vueDemi.watch(() => pinia.state.value[$id], (state) => { - if (options.flush === 'sync' ? isSyncListening : isListening) { - callback({ - storeId: $id, - type: exports.MutationType.direct, - events: debuggerEvents, - }, state); - } - }, assign({}, $subscribeOptions, options))); - return removeSubscription; - }, - $dispose, - }; - /* istanbul ignore if */ - if (vueDemi.isVue2) { - // start as non ready - partialStore._r = false; - } - const store = vueDemi.reactive(assign({ - _hmrPayload, - _customProperties: vueDemi.markRaw(new Set()), // devtools custom properties - }, partialStore - // must be added later - // setupStore - ) - ); - // store the partial store now so the setup of stores can instantiate each other before they are finished without - // creating infinite loops. - pinia._s.set($id, store); - const runWithContext = (pinia._a && pinia._a.runWithContext) || fallbackRunWithContext; - // TODO: idea create skipSerialize that marks properties as non serializable and they are skipped - const setupStore = pinia._e.run(() => { - scope = vueDemi.effectScope(); - return runWithContext(() => scope.run(setup)); - }); - // overwrite existing actions to support $onAction - for (const key in setupStore) { - const prop = setupStore[key]; - if ((vueDemi.isRef(prop) && !isComputed(prop)) || vueDemi.isReactive(prop)) { - // mark it as a piece of state to be serialized - if (hot) { - vueDemi.set(hotState.value, key, vueDemi.toRef(setupStore, key)); - // createOptionStore directly sets the state in pinia.state.value so we - // can just skip that - } - else if (!isOptionsStore) { - // in setup stores we must hydrate the state and sync pinia state tree with the refs the user just created - if (initialState && shouldHydrate(prop)) { - if (vueDemi.isRef(prop)) { - prop.value = initialState[key]; - } - else { - // probably a reactive object, lets recursively assign - // @ts-expect-error: prop is unknown - mergeReactiveObjects(prop, initialState[key]); - } - } - // transfer the ref to the pinia state to keep everything in sync - /* istanbul ignore if */ - if (vueDemi.isVue2) { - vueDemi.set(pinia.state.value[$id], key, prop); - } - else { - pinia.state.value[$id][key] = prop; - } - } - /* istanbul ignore else */ - { - _hmrPayload.state.push(key); - } - // action - } - else if (typeof prop === 'function') { - // @ts-expect-error: we are overriding the function we avoid wrapping if - const actionValue = hot ? prop : wrapAction(key, prop); - // this a hot module replacement store because the hotUpdate method needs - // to do it with the right context - /* istanbul ignore if */ - if (vueDemi.isVue2) { - vueDemi.set(setupStore, key, actionValue); - } - else { - // @ts-expect-error - setupStore[key] = actionValue; - } - /* istanbul ignore else */ - { - _hmrPayload.actions[key] = prop; - } - // list actions so they can be used in plugins - // @ts-expect-error - optionsForPlugin.actions[key] = prop; - } - else { - // add getters for devtools - if (isComputed(prop)) { - _hmrPayload.getters[key] = isOptionsStore - ? // @ts-expect-error - options.getters[key] - : prop; - if (IS_CLIENT) { - const getters = setupStore._getters || - // @ts-expect-error: same - (setupStore._getters = vueDemi.markRaw([])); - getters.push(key); - } - } - } - } - // add the state, getters, and action properties - /* istanbul ignore if */ - if (vueDemi.isVue2) { - Object.keys(setupStore).forEach((key) => { - vueDemi.set(store, key, setupStore[key]); - }); - } - else { - assign(store, setupStore); - // allows retrieving reactive objects with `storeToRefs()`. Must be called after assigning to the reactive object. - // Make `storeToRefs()` work with `reactive()` #799 - assign(vueDemi.toRaw(store), setupStore); - } - // use this instead of a computed with setter to be able to create it anywhere - // without linking the computed lifespan to wherever the store is first - // created. - Object.defineProperty(store, '$state', { - get: () => (hot ? hotState.value : pinia.state.value[$id]), - set: (state) => { - /* istanbul ignore if */ - if (hot) { - throw new Error('cannot set hotState'); - } - $patch(($state) => { - assign($state, state); - }); - }, - }); - // add the hotUpdate before plugins to allow them to override it - /* istanbul ignore else */ - { - store._hotUpdate = vueDemi.markRaw((newStore) => { - store._hotUpdating = true; - newStore._hmrPayload.state.forEach((stateKey) => { - if (stateKey in store.$state) { - const newStateTarget = newStore.$state[stateKey]; - const oldStateSource = store.$state[stateKey]; - if (typeof newStateTarget === 'object' && - isPlainObject(newStateTarget) && - isPlainObject(oldStateSource)) { - patchObject(newStateTarget, oldStateSource); - } - else { - // transfer the ref - newStore.$state[stateKey] = oldStateSource; - } - } - // patch direct access properties to allow store.stateProperty to work as - // store.$state.stateProperty - vueDemi.set(store, stateKey, vueDemi.toRef(newStore.$state, stateKey)); - }); - // remove deleted state properties - Object.keys(store.$state).forEach((stateKey) => { - if (!(stateKey in newStore.$state)) { - vueDemi.del(store, stateKey); - } - }); - // avoid devtools logging this as a mutation - isListening = false; - isSyncListening = false; - pinia.state.value[$id] = vueDemi.toRef(newStore._hmrPayload, 'hotState'); - isSyncListening = true; - vueDemi.nextTick().then(() => { - isListening = true; - }); - for (const actionName in newStore._hmrPayload.actions) { - const action = newStore[actionName]; - vueDemi.set(store, actionName, wrapAction(actionName, action)); - } - // TODO: does this work in both setup and option store? - for (const getterName in newStore._hmrPayload.getters) { - const getter = newStore._hmrPayload.getters[getterName]; - const getterValue = isOptionsStore - ? // special handling of options api - vueDemi.computed(() => { - setActivePinia(pinia); - return getter.call(store, store); - }) - : getter; - vueDemi.set(store, getterName, getterValue); - } - // remove deleted getters - Object.keys(store._hmrPayload.getters).forEach((key) => { - if (!(key in newStore._hmrPayload.getters)) { - vueDemi.del(store, key); - } - }); - // remove old actions - Object.keys(store._hmrPayload.actions).forEach((key) => { - if (!(key in newStore._hmrPayload.actions)) { - vueDemi.del(store, key); - } - }); - // update the values used in devtools and to allow deleting new properties later on - store._hmrPayload = newStore._hmrPayload; - store._getters = newStore._getters; - store._hotUpdating = false; - }); - } - if (USE_DEVTOOLS) { - const nonEnumerable = { - writable: true, - configurable: true, - // avoid warning on devtools trying to display this property - enumerable: false, - }; - ['_p', '_hmrPayload', '_getters', '_customProperties'].forEach((p) => { - Object.defineProperty(store, p, assign({ value: store[p] }, nonEnumerable)); - }); - } - /* istanbul ignore if */ - if (vueDemi.isVue2) { - // mark the store as ready before plugins - store._r = true; - } - // apply all plugins - pinia._p.forEach((extender) => { - /* istanbul ignore else */ - if (USE_DEVTOOLS) { - const extensions = scope.run(() => extender({ - store, - app: pinia._a, - pinia, - options: optionsForPlugin, - })); - Object.keys(extensions || {}).forEach((key) => store._customProperties.add(key)); - assign(store, extensions); - } - else { - assign(store, scope.run(() => extender({ - store, - app: pinia._a, - pinia, - options: optionsForPlugin, - }))); - } - }); - if (store.$state && - typeof store.$state === 'object' && - typeof store.$state.constructor === 'function' && - !store.$state.constructor.toString().includes('[native code]')) { - console.warn(`[🍍]: The "state" must be a plain object. It cannot be\n` + - `\tstate: () => new MyClass()\n` + - `Found in store "${store.$id}".`); - } - // only apply hydrate to option stores with an initial state in pinia - if (initialState && - isOptionsStore && - options.hydrate) { - options.hydrate(store.$state, initialState); - } - isListening = true; - isSyncListening = true; - return store; - } - function defineStore( - // TODO: add proper types from above - idOrOptions, setup, setupOptions) { - let id; - let options; - const isSetupStore = typeof setup === 'function'; - if (typeof idOrOptions === 'string') { - id = idOrOptions; - // the option store setup will contain the actual options in this case - options = isSetupStore ? setupOptions : setup; - } - else { - options = idOrOptions; - id = idOrOptions.id; - if (typeof id !== 'string') { - throw new Error(`[🍍]: "defineStore()" must be passed a store id as its first argument.`); - } - } - function useStore(pinia, hot) { - const hasContext = vueDemi.hasInjectionContext(); - pinia = - // in test mode, ignore the argument provided as we can always retrieve a - // pinia instance with getActivePinia() - (pinia) || - (hasContext ? vueDemi.inject(piniaSymbol, null) : null); - if (pinia) - setActivePinia(pinia); - if (!activePinia) { - throw new Error(`[🍍]: "getActivePinia()" was called but there was no active Pinia. Did you forget to install pinia?\n` + - `\tconst pinia = createPinia()\n` + - `\tapp.use(pinia)\n` + - `This will fail in production.`); - } - pinia = activePinia; - if (!pinia._s.has(id)) { - // creating the store registers it in `pinia._s` - if (isSetupStore) { - createSetupStore(id, setup, options, pinia); - } - else { - createOptionsStore(id, options, pinia); - } - /* istanbul ignore else */ - { - // @ts-expect-error: not the right inferred type - useStore._pinia = pinia; - } - } - const store = pinia._s.get(id); - if (hot) { - const hotId = '__hot:' + id; - const newStore = isSetupStore - ? createSetupStore(hotId, setup, options, pinia, true) - : createOptionsStore(hotId, assign({}, options), pinia, true); - hot._hotUpdate(newStore); - // cleanup the state properties and the store from the cache - delete pinia.state.value[hotId]; - pinia._s.delete(hotId); - } - if (IS_CLIENT) { - const currentInstance = vueDemi.getCurrentInstance(); - // save stores in instances to access them devtools - if (currentInstance && - currentInstance.proxy && - // avoid adding stores that are just built for hot module replacement - !hot) { - const vm = currentInstance.proxy; - const cache = '_pStores' in vm ? vm._pStores : (vm._pStores = {}); - cache[id] = store; - } - } - // StoreGeneric cannot be casted towards Store - return store; - } - useStore.$id = id; - return useStore; - } - - let mapStoreSuffix = 'Store'; - /** - * Changes the suffix added by `mapStores()`. Can be set to an empty string. - * Defaults to `"Store"`. Make sure to extend the MapStoresCustomization - * interface if you are using TypeScript. - * - * @param suffix - new suffix - */ - function setMapStoreSuffix(suffix // could be 'Store' but that would be annoying for JS - ) { - mapStoreSuffix = suffix; - } - /** - * Allows using stores without the composition API (`setup()`) by generating an - * object to be spread in the `computed` field of a component. It accepts a list - * of store definitions. - * - * @example - * ```js - * export default { - * computed: { - * // other computed properties - * ...mapStores(useUserStore, useCartStore) - * }, - * - * created() { - * this.userStore // store with id "user" - * this.cartStore // store with id "cart" - * } - * } - * ``` - * - * @param stores - list of stores to map to an object - */ - function mapStores(...stores) { - if (Array.isArray(stores[0])) { - console.warn(`[🍍]: Directly pass all stores to "mapStores()" without putting them in an array:\n` + - `Replace\n` + - `\tmapStores([useAuthStore, useCartStore])\n` + - `with\n` + - `\tmapStores(useAuthStore, useCartStore)\n` + - `This will fail in production if not fixed.`); - stores = stores[0]; - } - return stores.reduce((reduced, useStore) => { - // @ts-expect-error: $id is added by defineStore - reduced[useStore.$id + mapStoreSuffix] = function () { - return useStore(this.$pinia); - }; - return reduced; - }, {}); - } - /** - * Allows using state and getters from one store without using the composition - * API (`setup()`) by generating an object to be spread in the `computed` field - * of a component. - * - * @param useStore - store to map from - * @param keysOrMapper - array or object - */ - function mapState(useStore, keysOrMapper) { - return Array.isArray(keysOrMapper) - ? keysOrMapper.reduce((reduced, key) => { - reduced[key] = function () { - return useStore(this.$pinia)[key]; - }; - return reduced; - }, {}) - : Object.keys(keysOrMapper).reduce((reduced, key) => { - // @ts-expect-error - reduced[key] = function () { - const store = useStore(this.$pinia); - const storeKey = keysOrMapper[key]; - // for some reason TS is unable to infer the type of storeKey to be a - // function - return typeof storeKey === 'function' - ? storeKey.call(this, store) - : store[storeKey]; - }; - return reduced; - }, {}); - } - /** - * Alias for `mapState()`. You should use `mapState()` instead. - * @deprecated use `mapState()` instead. - */ - const mapGetters = mapState; - /** - * Allows directly using actions from your store without using the composition - * API (`setup()`) by generating an object to be spread in the `methods` field - * of a component. - * - * @param useStore - store to map from - * @param keysOrMapper - array or object - */ - function mapActions(useStore, keysOrMapper) { - return Array.isArray(keysOrMapper) - ? keysOrMapper.reduce((reduced, key) => { - // @ts-expect-error - reduced[key] = function (...args) { - return useStore(this.$pinia)[key](...args); - }; - return reduced; - }, {}) - : Object.keys(keysOrMapper).reduce((reduced, key) => { - // @ts-expect-error - reduced[key] = function (...args) { - return useStore(this.$pinia)[keysOrMapper[key]](...args); - }; - return reduced; - }, {}); - } - /** - * Allows using state and getters from one store without using the composition - * API (`setup()`) by generating an object to be spread in the `computed` field - * of a component. - * - * @param useStore - store to map from - * @param keysOrMapper - array or object - */ - function mapWritableState(useStore, keysOrMapper) { - return Array.isArray(keysOrMapper) - ? keysOrMapper.reduce((reduced, key) => { - // @ts-ignore - reduced[key] = { - get() { - return useStore(this.$pinia)[key]; - }, - set(value) { - // it's easier to type it here as any - return (useStore(this.$pinia)[key] = value); - }, - }; - return reduced; - }, {}) - : Object.keys(keysOrMapper).reduce((reduced, key) => { - // @ts-ignore - reduced[key] = { - get() { - return useStore(this.$pinia)[keysOrMapper[key]]; - }, - set(value) { - // it's easier to type it here as any - return (useStore(this.$pinia)[keysOrMapper[key]] = value); - }, - }; - return reduced; - }, {}); - } - - /** - * Creates an object of references with all the state, getters, and plugin-added - * state properties of the store. Similar to `toRefs()` but specifically - * designed for Pinia stores so methods and non reactive properties are - * completely ignored. - * - * @param store - store to extract the refs from - */ - function storeToRefs(store) { - // See https://github.com/vuejs/pinia/issues/852 - // It's easier to just use toRefs() even if it includes more stuff - if (vueDemi.isVue2) { - // @ts-expect-error: toRefs include methods and others - return vueDemi.toRefs(store); - } - else { - store = vueDemi.toRaw(store); - const refs = {}; - for (const key in store) { - const value = store[key]; - if (vueDemi.isRef(value) || vueDemi.isReactive(value)) { - // @ts-expect-error: the key is state or getter - refs[key] = - // --- - vueDemi.toRef(store, key); - } - } - return refs; - } - } - - /** - * Vue 2 Plugin that must be installed for pinia to work. Note **you don't need - * this plugin if you are using Nuxt.js**. Use the `buildModule` instead: - * https://pinia.vuejs.org/ssr/nuxt.html. - * - * @example - * ```js - * import Vue from 'vue' - * import { PiniaVuePlugin, createPinia } from 'pinia' - * - * Vue.use(PiniaVuePlugin) - * const pinia = createPinia() - * - * new Vue({ - * el: '#app', - * // ... - * pinia, - * }) - * ``` - * - * @param _Vue - `Vue` imported from 'vue'. - */ - const PiniaVuePlugin = function (_Vue) { - // Equivalent of - // app.config.globalProperties.$pinia = pinia - _Vue.mixin({ - beforeCreate() { - const options = this.$options; - if (options.pinia) { - const pinia = options.pinia; - // HACK: taken from provide(): https://github.com/vuejs/composition-api/blob/main/src/apis/inject.ts#L31 - /* istanbul ignore else */ - if (!this._provided) { - const provideCache = {}; - Object.defineProperty(this, '_provided', { - get: () => provideCache, - set: (v) => Object.assign(provideCache, v), - }); - } - this._provided[piniaSymbol] = pinia; - // propagate the pinia instance in an SSR friendly way - // avoid adding it to nuxt twice - /* istanbul ignore else */ - if (!this.$pinia) { - this.$pinia = pinia; - } - pinia._a = this; - if (IS_CLIENT) { - // this allows calling useStore() outside of a component setup after - // installing pinia's plugin - setActivePinia(pinia); - } - if (USE_DEVTOOLS) { - registerPiniaDevtools(pinia._a, pinia); - } - } - else if (!this.$pinia && options.parent && options.parent.$pinia) { - this.$pinia = options.parent.$pinia; - } - }, - destroyed() { - delete this._pStores; - }, - }); - }; - - exports.PiniaVuePlugin = PiniaVuePlugin; - exports.acceptHMRUpdate = acceptHMRUpdate; - exports.createPinia = createPinia; - exports.defineStore = defineStore; - exports.getActivePinia = getActivePinia; - exports.mapActions = mapActions; - exports.mapGetters = mapGetters; - exports.mapState = mapState; - exports.mapStores = mapStores; - exports.mapWritableState = mapWritableState; - exports.setActivePinia = setActivePinia; - exports.setMapStoreSuffix = setMapStoreSuffix; - exports.skipHydrate = skipHydrate; - exports.storeToRefs = storeToRefs; - - return exports; - -})({}, VueDemi); diff --git a/node_modules/pinia/dist/pinia.iife.prod.js b/node_modules/pinia/dist/pinia.iife.prod.js deleted file mode 100644 index bee640a..0000000 --- a/node_modules/pinia/dist/pinia.iife.prod.js +++ /dev/null @@ -1,6 +0,0 @@ -/*! - * pinia v2.1.6 - * (c) 2023 Eduardo San Martin Morote - * @license MIT - */ -var Pinia=function(t,e){"use strict";let n;const i=t=>n=t,s=Symbol();function o(t){return t&&"object"==typeof t&&"[object Object]"===Object.prototype.toString.call(t)&&"function"!=typeof t.toJSON}var r;t.MutationType=void 0,(r=t.MutationType||(t.MutationType={})).direct="direct",r.patchObject="patch object",r.patchFunction="patch function";const c="undefined"!=typeof window;const a=()=>{};function u(t,n,i,s=a){t.push(n);const o=()=>{const e=t.indexOf(n);e>-1&&(t.splice(e,1),s())};return!i&&e.getCurrentScope()&&e.onScopeDispose(o),o}function p(t,...e){t.slice().forEach((t=>{t(...e)}))}const f=t=>t();function h(t,n){t instanceof Map&&n instanceof Map&&n.forEach(((e,n)=>t.set(n,e))),t instanceof Set&&n instanceof Set&&n.forEach(t.add,t);for(const i in n){if(!n.hasOwnProperty(i))continue;const s=n[i],r=t[i];t[i]=o(r)&&o(s)&&t.hasOwnProperty(i)&&!e.isRef(s)&&!e.isReactive(s)?h(r,s):s}return t}const l=Symbol(),d=new WeakMap;const{assign:y}=Object;function v(n,s,r={},c,v,$){let b;const _=y({actions:{}},r),j={deep:!0};let O,S,g,m=[],R=[];const P=c.state.value[n];let V;function w(i){let s;O=S=!1,"function"==typeof i?(i(c.state.value[n]),s={type:t.MutationType.patchFunction,storeId:n,events:g}):(h(c.state.value[n],i),s={type:t.MutationType.patchObject,payload:i,storeId:n,events:g});const o=V=Symbol();e.nextTick().then((()=>{V===o&&(O=!0)})),S=!0,p(m,s,c.state.value[n])}$||P||(e.isVue2?e.set(c.state.value,n,{}):c.state.value[n]={}),e.ref({});const M=$?function(){const{state:t}=r,e=t?t():{};this.$patch((t=>{y(t,e)}))}:a;function A(t,e){return function(){i(c);const s=Array.from(arguments),o=[],r=[];let a;p(R,{args:s,name:t,store:T,after:function(t){o.push(t)},onError:function(t){r.push(t)}});try{a=e.apply(this&&this.$id===n?this:T,s)}catch(t){throw p(r,t),t}return a instanceof Promise?a.then((t=>(p(o,t),t))).catch((t=>(p(r,t),Promise.reject(t)))):(p(o,a),a)}}const k={_p:c,$id:n,$onAction:u.bind(null,R),$patch:w,$reset:M,$subscribe(i,s={}){const o=u(m,i,s.detached,(()=>r())),r=b.run((()=>e.watch((()=>c.state.value[n]),(e=>{("sync"===s.flush?S:O)&&i({storeId:n,type:t.MutationType.direct,events:g},e)}),y({},j,s))));return o},$dispose:function(){b.stop(),m=[],R=[],c._s.delete(n)}};e.isVue2&&(k._r=!1);const T=e.reactive(k);c._s.set(n,T);const x=c._a&&c._a.runWithContext||f,E=c._e.run((()=>(b=e.effectScope(),x((()=>b.run(s))))));for(const t in E){const i=E[t];if(e.isRef(i)&&(!e.isRef(I=i)||!I.effect)||e.isReactive(i))$||(!P||(C=i,e.isVue2?d.has(C):o(C)&&C.hasOwnProperty(l))||(e.isRef(i)?i.value=P[t]:h(i,P[t])),e.isVue2?e.set(c.state.value[n],t,i):c.state.value[n][t]=i);else if("function"==typeof i){const n=A(t,i);e.isVue2?e.set(E,t,n):E[t]=n,_.actions[t]=i}}var C,I;return e.isVue2?Object.keys(E).forEach((t=>{e.set(T,t,E[t])})):(y(T,E),y(e.toRaw(T),E)),Object.defineProperty(T,"$state",{get:()=>c.state.value[n],set:t=>{w((e=>{y(e,t)}))}}),e.isVue2&&(T._r=!0),c._p.forEach((t=>{y(T,b.run((()=>t({store:T,app:c._a,pinia:c,options:_}))))})),P&&$&&r.hydrate&&r.hydrate(T.$state,P),O=!0,S=!0,T}let $="Store";function b(t,e){return Array.isArray(e)?e.reduce(((e,n)=>(e[n]=function(){return t(this.$pinia)[n]},e)),{}):Object.keys(e).reduce(((n,i)=>(n[i]=function(){const n=t(this.$pinia),s=e[i];return"function"==typeof s?s.call(this,n):n[s]},n)),{})}const _=b;return t.PiniaVuePlugin=function(t){t.mixin({beforeCreate(){const t=this.$options;if(t.pinia){const e=t.pinia;if(!this._provided){const t={};Object.defineProperty(this,"_provided",{get:()=>t,set:e=>Object.assign(t,e)})}this._provided[s]=e,this.$pinia||(this.$pinia=e),e._a=this,c&&i(e)}else!this.$pinia&&t.parent&&t.parent.$pinia&&(this.$pinia=t.parent.$pinia)},destroyed(){delete this._pStores}})},t.acceptHMRUpdate=function(t,e){return()=>{}},t.createPinia=function(){const t=e.effectScope(!0),n=t.run((()=>e.ref({})));let o=[],r=[];const c=e.markRaw({install(t){i(c),e.isVue2||(c._a=t,t.provide(s,c),t.config.globalProperties.$pinia=c,r.forEach((t=>o.push(t))),r=[])},use(t){return this._a||e.isVue2?o.push(t):r.push(t),this},_p:o,_a:null,_e:t,_s:new Map,state:n});return c},t.defineStore=function(t,o,r){let c,a;const u="function"==typeof o;function p(t,r){const p=e.hasInjectionContext();(t=t||(p?e.inject(s,null):null))&&i(t),(t=n)._s.has(c)||(u?v(c,o,a,t):function(t,n,s,o){const{state:r,actions:c,getters:a}=n,u=s.state.value[t];let p;p=v(t,(function(){u||(e.isVue2?e.set(s.state.value,t,r?r():{}):s.state.value[t]=r?r():{});const n=e.toRefs(s.state.value[t]);return y(n,c,Object.keys(a||{}).reduce(((n,o)=>(n[o]=e.markRaw(e.computed((()=>{i(s);const n=s._s.get(t);if(!e.isVue2||n._r)return a[o].call(n,n)}))),n)),{}))}),n,s,0,!0)}(c,a,t));return t._s.get(c)}return"string"==typeof t?(c=t,a=u?r:o):(a=t,c=t.id),p.$id=c,p},t.getActivePinia=()=>e.hasInjectionContext()&&e.inject(s)||n,t.mapActions=function(t,e){return Array.isArray(e)?e.reduce(((e,n)=>(e[n]=function(...e){return t(this.$pinia)[n](...e)},e)),{}):Object.keys(e).reduce(((n,i)=>(n[i]=function(...n){return t(this.$pinia)[e[i]](...n)},n)),{})},t.mapGetters=_,t.mapState=b,t.mapStores=function(...t){return t.reduce(((t,e)=>(t[e.$id+$]=function(){return e(this.$pinia)},t)),{})},t.mapWritableState=function(t,e){return Array.isArray(e)?e.reduce(((e,n)=>(e[n]={get(){return t(this.$pinia)[n]},set(e){return t(this.$pinia)[n]=e}},e)),{}):Object.keys(e).reduce(((n,i)=>(n[i]={get(){return t(this.$pinia)[e[i]]},set(n){return t(this.$pinia)[e[i]]=n}},n)),{})},t.setActivePinia=i,t.setMapStoreSuffix=function(t){$=t},t.skipHydrate=function(t){return e.isVue2?d.set(t,1)&&t:Object.defineProperty(t,l,{})},t.storeToRefs=function(t){if(e.isVue2)return e.toRefs(t);{t=e.toRaw(t);const n={};for(const i in t){const s=t[i];(e.isRef(s)||e.isReactive(s))&&(n[i]=e.toRef(t,i))}return n}},t}({},VueDemi); diff --git a/node_modules/pinia/dist/pinia.mjs b/node_modules/pinia/dist/pinia.mjs deleted file mode 100644 index 4b52ecd..0000000 --- a/node_modules/pinia/dist/pinia.mjs +++ /dev/null @@ -1,2004 +0,0 @@ -/*! - * pinia v2.1.6 - * (c) 2023 Eduardo San Martin Morote - * @license MIT - */ -import { hasInjectionContext, inject, toRaw, watch, unref, markRaw, effectScope, ref, isVue2, isRef, isReactive, set, getCurrentScope, onScopeDispose, getCurrentInstance, reactive, toRef, del, nextTick, computed, toRefs } from 'vue-demi'; -import { setupDevtoolsPlugin } from '@vue/devtools-api'; - -/** - * setActivePinia must be called to handle SSR at the top of functions like - * `fetch`, `setup`, `serverPrefetch` and others - */ -let activePinia; -/** - * Sets or unsets the active pinia. Used in SSR and internally when calling - * actions and getters - * - * @param pinia - Pinia instance - */ -// @ts-expect-error: cannot constrain the type of the return -const setActivePinia = (pinia) => (activePinia = pinia); -/** - * Get the currently active pinia if there is any. - */ -const getActivePinia = () => (hasInjectionContext() && inject(piniaSymbol)) || activePinia; -const piniaSymbol = ((process.env.NODE_ENV !== 'production') ? Symbol('pinia') : /* istanbul ignore next */ Symbol()); - -function isPlainObject( -// eslint-disable-next-line @typescript-eslint/no-explicit-any -o) { - return (o && - typeof o === 'object' && - Object.prototype.toString.call(o) === '[object Object]' && - typeof o.toJSON !== 'function'); -} -// type DeepReadonly = { readonly [P in keyof T]: DeepReadonly } -// TODO: can we change these to numbers? -/** - * Possible types for SubscriptionCallback - */ -var MutationType; -(function (MutationType) { - /** - * Direct mutation of the state: - * - * - `store.name = 'new name'` - * - `store.$state.name = 'new name'` - * - `store.list.push('new item')` - */ - MutationType["direct"] = "direct"; - /** - * Mutated the state with `$patch` and an object - * - * - `store.$patch({ name: 'newName' })` - */ - MutationType["patchObject"] = "patch object"; - /** - * Mutated the state with `$patch` and a function - * - * - `store.$patch(state => state.name = 'newName')` - */ - MutationType["patchFunction"] = "patch function"; - // maybe reset? for $state = {} and $reset -})(MutationType || (MutationType = {})); - -const IS_CLIENT = typeof window !== 'undefined'; -/** - * Should we add the devtools plugins. - * - only if dev mode or forced through the prod devtools flag - * - not in test - * - only if window exists (could change in the future) - */ -const USE_DEVTOOLS = ((process.env.NODE_ENV !== 'production') || (typeof __VUE_PROD_DEVTOOLS__ !== 'undefined' && __VUE_PROD_DEVTOOLS__)) && !(process.env.NODE_ENV === 'test') && IS_CLIENT; - -/* - * FileSaver.js A saveAs() FileSaver implementation. - * - * Originally by Eli Grey, adapted as an ESM module by Eduardo San Martin - * Morote. - * - * License : MIT - */ -// The one and only way of getting global scope in all environments -// https://stackoverflow.com/q/3277182/1008999 -const _global = /*#__PURE__*/ (() => typeof window === 'object' && window.window === window - ? window - : typeof self === 'object' && self.self === self - ? self - : typeof global === 'object' && global.global === global - ? global - : typeof globalThis === 'object' - ? globalThis - : { HTMLElement: null })(); -function bom(blob, { autoBom = false } = {}) { - // prepend BOM for UTF-8 XML and text/* types (including HTML) - // note: your browser will automatically convert UTF-16 U+FEFF to EF BB BF - if (autoBom && - /^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(blob.type)) { - return new Blob([String.fromCharCode(0xfeff), blob], { type: blob.type }); - } - return blob; -} -function download(url, name, opts) { - const xhr = new XMLHttpRequest(); - xhr.open('GET', url); - xhr.responseType = 'blob'; - xhr.onload = function () { - saveAs(xhr.response, name, opts); - }; - xhr.onerror = function () { - console.error('could not download file'); - }; - xhr.send(); -} -function corsEnabled(url) { - const xhr = new XMLHttpRequest(); - // use sync to avoid popup blocker - xhr.open('HEAD', url, false); - try { - xhr.send(); - } - catch (e) { } - return xhr.status >= 200 && xhr.status <= 299; -} -// `a.click()` doesn't work for all browsers (#465) -function click(node) { - try { - node.dispatchEvent(new MouseEvent('click')); - } - catch (e) { - const evt = document.createEvent('MouseEvents'); - evt.initMouseEvent('click', true, true, window, 0, 0, 0, 80, 20, false, false, false, false, 0, null); - node.dispatchEvent(evt); - } -} -const _navigator = - typeof navigator === 'object' ? navigator : { userAgent: '' }; -// Detect WebView inside a native macOS app by ruling out all browsers -// We just need to check for 'Safari' because all other browsers (besides Firefox) include that too -// https://www.whatismybrowser.com/guides/the-latest-user-agent/macos -const isMacOSWebView = /*#__PURE__*/ (() => /Macintosh/.test(_navigator.userAgent) && - /AppleWebKit/.test(_navigator.userAgent) && - !/Safari/.test(_navigator.userAgent))(); -const saveAs = !IS_CLIENT - ? () => { } // noop - : // Use download attribute first if possible (#193 Lumia mobile) unless this is a macOS WebView or mini program - typeof HTMLAnchorElement !== 'undefined' && - 'download' in HTMLAnchorElement.prototype && - !isMacOSWebView - ? downloadSaveAs - : // Use msSaveOrOpenBlob as a second approach - 'msSaveOrOpenBlob' in _navigator - ? msSaveAs - : // Fallback to using FileReader and a popup - fileSaverSaveAs; -function downloadSaveAs(blob, name = 'download', opts) { - const a = document.createElement('a'); - a.download = name; - a.rel = 'noopener'; // tabnabbing - // TODO: detect chrome extensions & packaged apps - // a.target = '_blank' - if (typeof blob === 'string') { - // Support regular links - a.href = blob; - if (a.origin !== location.origin) { - if (corsEnabled(a.href)) { - download(blob, name, opts); - } - else { - a.target = '_blank'; - click(a); - } - } - else { - click(a); - } - } - else { - // Support blobs - a.href = URL.createObjectURL(blob); - setTimeout(function () { - URL.revokeObjectURL(a.href); - }, 4e4); // 40s - setTimeout(function () { - click(a); - }, 0); - } -} -function msSaveAs(blob, name = 'download', opts) { - if (typeof blob === 'string') { - if (corsEnabled(blob)) { - download(blob, name, opts); - } - else { - const a = document.createElement('a'); - a.href = blob; - a.target = '_blank'; - setTimeout(function () { - click(a); - }); - } - } - else { - // @ts-ignore: works on windows - navigator.msSaveOrOpenBlob(bom(blob, opts), name); - } -} -function fileSaverSaveAs(blob, name, opts, popup) { - // Open a popup immediately do go around popup blocker - // Mostly only available on user interaction and the fileReader is async so... - popup = popup || open('', '_blank'); - if (popup) { - popup.document.title = popup.document.body.innerText = 'downloading...'; - } - if (typeof blob === 'string') - return download(blob, name, opts); - const force = blob.type === 'application/octet-stream'; - const isSafari = /constructor/i.test(String(_global.HTMLElement)) || 'safari' in _global; - const isChromeIOS = /CriOS\/[\d]+/.test(navigator.userAgent); - if ((isChromeIOS || (force && isSafari) || isMacOSWebView) && - typeof FileReader !== 'undefined') { - // Safari doesn't allow downloading of blob URLs - const reader = new FileReader(); - reader.onloadend = function () { - let url = reader.result; - if (typeof url !== 'string') { - popup = null; - throw new Error('Wrong reader.result type'); - } - url = isChromeIOS - ? url - : url.replace(/^data:[^;]*;/, 'data:attachment/file;'); - if (popup) { - popup.location.href = url; - } - else { - location.assign(url); - } - popup = null; // reverse-tabnabbing #460 - }; - reader.readAsDataURL(blob); - } - else { - const url = URL.createObjectURL(blob); - if (popup) - popup.location.assign(url); - else - location.href = url; - popup = null; // reverse-tabnabbing #460 - setTimeout(function () { - URL.revokeObjectURL(url); - }, 4e4); // 40s - } -} - -/** - * Shows a toast or console.log - * - * @param message - message to log - * @param type - different color of the tooltip - */ -function toastMessage(message, type) { - const piniaMessage = '🍍 ' + message; - if (typeof __VUE_DEVTOOLS_TOAST__ === 'function') { - // No longer available :( - __VUE_DEVTOOLS_TOAST__(piniaMessage, type); - } - else if (type === 'error') { - console.error(piniaMessage); - } - else if (type === 'warn') { - console.warn(piniaMessage); - } - else { - console.log(piniaMessage); - } -} -function isPinia(o) { - return '_a' in o && 'install' in o; -} - -/** - * This file contain devtools actions, they are not Pinia actions. - */ -// --- -function checkClipboardAccess() { - if (!('clipboard' in navigator)) { - toastMessage(`Your browser doesn't support the Clipboard API`, 'error'); - return true; - } -} -function checkNotFocusedError(error) { - if (error instanceof Error && - error.message.toLowerCase().includes('document is not focused')) { - toastMessage('You need to activate the "Emulate a focused page" setting in the "Rendering" panel of devtools.', 'warn'); - return true; - } - return false; -} -async function actionGlobalCopyState(pinia) { - if (checkClipboardAccess()) - return; - try { - await navigator.clipboard.writeText(JSON.stringify(pinia.state.value)); - toastMessage('Global state copied to clipboard.'); - } - catch (error) { - if (checkNotFocusedError(error)) - return; - toastMessage(`Failed to serialize the state. Check the console for more details.`, 'error'); - console.error(error); - } -} -async function actionGlobalPasteState(pinia) { - if (checkClipboardAccess()) - return; - try { - loadStoresState(pinia, JSON.parse(await navigator.clipboard.readText())); - toastMessage('Global state pasted from clipboard.'); - } - catch (error) { - if (checkNotFocusedError(error)) - return; - toastMessage(`Failed to deserialize the state from clipboard. Check the console for more details.`, 'error'); - console.error(error); - } -} -async function actionGlobalSaveState(pinia) { - try { - saveAs(new Blob([JSON.stringify(pinia.state.value)], { - type: 'text/plain;charset=utf-8', - }), 'pinia-state.json'); - } - catch (error) { - toastMessage(`Failed to export the state as JSON. Check the console for more details.`, 'error'); - console.error(error); - } -} -let fileInput; -function getFileOpener() { - if (!fileInput) { - fileInput = document.createElement('input'); - fileInput.type = 'file'; - fileInput.accept = '.json'; - } - function openFile() { - return new Promise((resolve, reject) => { - fileInput.onchange = async () => { - const files = fileInput.files; - if (!files) - return resolve(null); - const file = files.item(0); - if (!file) - return resolve(null); - return resolve({ text: await file.text(), file }); - }; - // @ts-ignore: TODO: changed from 4.3 to 4.4 - fileInput.oncancel = () => resolve(null); - fileInput.onerror = reject; - fileInput.click(); - }); - } - return openFile; -} -async function actionGlobalOpenStateFile(pinia) { - try { - const open = getFileOpener(); - const result = await open(); - if (!result) - return; - const { text, file } = result; - loadStoresState(pinia, JSON.parse(text)); - toastMessage(`Global state imported from "${file.name}".`); - } - catch (error) { - toastMessage(`Failed to import the state from JSON. Check the console for more details.`, 'error'); - console.error(error); - } -} -function loadStoresState(pinia, state) { - for (const key in state) { - const storeState = pinia.state.value[key]; - if (storeState) { - Object.assign(storeState, state[key]); - } - } -} - -function formatDisplay(display) { - return { - _custom: { - display, - }, - }; -} -const PINIA_ROOT_LABEL = '🍍 Pinia (root)'; -const PINIA_ROOT_ID = '_root'; -function formatStoreForInspectorTree(store) { - return isPinia(store) - ? { - id: PINIA_ROOT_ID, - label: PINIA_ROOT_LABEL, - } - : { - id: store.$id, - label: store.$id, - }; -} -function formatStoreForInspectorState(store) { - if (isPinia(store)) { - const storeNames = Array.from(store._s.keys()); - const storeMap = store._s; - const state = { - state: storeNames.map((storeId) => ({ - editable: true, - key: storeId, - value: store.state.value[storeId], - })), - getters: storeNames - .filter((id) => storeMap.get(id)._getters) - .map((id) => { - const store = storeMap.get(id); - return { - editable: false, - key: id, - value: store._getters.reduce((getters, key) => { - getters[key] = store[key]; - return getters; - }, {}), - }; - }), - }; - return state; - } - const state = { - state: Object.keys(store.$state).map((key) => ({ - editable: true, - key, - value: store.$state[key], - })), - }; - // avoid adding empty getters - if (store._getters && store._getters.length) { - state.getters = store._getters.map((getterName) => ({ - editable: false, - key: getterName, - value: store[getterName], - })); - } - if (store._customProperties.size) { - state.customProperties = Array.from(store._customProperties).map((key) => ({ - editable: true, - key, - value: store[key], - })); - } - return state; -} -function formatEventData(events) { - if (!events) - return {}; - if (Array.isArray(events)) { - // TODO: handle add and delete for arrays and objects - return events.reduce((data, event) => { - data.keys.push(event.key); - data.operations.push(event.type); - data.oldValue[event.key] = event.oldValue; - data.newValue[event.key] = event.newValue; - return data; - }, { - oldValue: {}, - keys: [], - operations: [], - newValue: {}, - }); - } - else { - return { - operation: formatDisplay(events.type), - key: formatDisplay(events.key), - oldValue: events.oldValue, - newValue: events.newValue, - }; - } -} -function formatMutationType(type) { - switch (type) { - case MutationType.direct: - return 'mutation'; - case MutationType.patchFunction: - return '$patch'; - case MutationType.patchObject: - return '$patch'; - default: - return 'unknown'; - } -} - -// timeline can be paused when directly changing the state -let isTimelineActive = true; -const componentStateTypes = []; -const MUTATIONS_LAYER_ID = 'pinia:mutations'; -const INSPECTOR_ID = 'pinia'; -const { assign: assign$1 } = Object; -/** - * Gets the displayed name of a store in devtools - * - * @param id - id of the store - * @returns a formatted string - */ -const getStoreType = (id) => '🍍 ' + id; -/** - * Add the pinia plugin without any store. Allows displaying a Pinia plugin tab - * as soon as it is added to the application. - * - * @param app - Vue application - * @param pinia - pinia instance - */ -function registerPiniaDevtools(app, pinia) { - setupDevtoolsPlugin({ - id: 'dev.esm.pinia', - label: 'Pinia 🍍', - logo: 'https://pinia.vuejs.org/logo.svg', - packageName: 'pinia', - homepage: 'https://pinia.vuejs.org', - componentStateTypes, - app, - }, (api) => { - if (typeof api.now !== 'function') { - toastMessage('You seem to be using an outdated version of Vue Devtools. Are you still using the Beta release instead of the stable one? You can find the links at https://devtools.vuejs.org/guide/installation.html.'); - } - api.addTimelineLayer({ - id: MUTATIONS_LAYER_ID, - label: `Pinia 🍍`, - color: 0xe5df88, - }); - api.addInspector({ - id: INSPECTOR_ID, - label: 'Pinia 🍍', - icon: 'storage', - treeFilterPlaceholder: 'Search stores', - actions: [ - { - icon: 'content_copy', - action: () => { - actionGlobalCopyState(pinia); - }, - tooltip: 'Serialize and copy the state', - }, - { - icon: 'content_paste', - action: async () => { - await actionGlobalPasteState(pinia); - api.sendInspectorTree(INSPECTOR_ID); - api.sendInspectorState(INSPECTOR_ID); - }, - tooltip: 'Replace the state with the content of your clipboard', - }, - { - icon: 'save', - action: () => { - actionGlobalSaveState(pinia); - }, - tooltip: 'Save the state as a JSON file', - }, - { - icon: 'folder_open', - action: async () => { - await actionGlobalOpenStateFile(pinia); - api.sendInspectorTree(INSPECTOR_ID); - api.sendInspectorState(INSPECTOR_ID); - }, - tooltip: 'Import the state from a JSON file', - }, - ], - nodeActions: [ - { - icon: 'restore', - tooltip: 'Reset the state (with "$reset")', - action: (nodeId) => { - const store = pinia._s.get(nodeId); - if (!store) { - toastMessage(`Cannot reset "${nodeId}" store because it wasn't found.`, 'warn'); - } - else if (typeof store.$reset !== 'function') { - toastMessage(`Cannot reset "${nodeId}" store because it doesn't have a "$reset" method implemented.`, 'warn'); - } - else { - store.$reset(); - toastMessage(`Store "${nodeId}" reset.`); - } - }, - }, - ], - }); - api.on.inspectComponent((payload, ctx) => { - const proxy = (payload.componentInstance && - payload.componentInstance.proxy); - if (proxy && proxy._pStores) { - const piniaStores = payload.componentInstance.proxy._pStores; - Object.values(piniaStores).forEach((store) => { - payload.instanceData.state.push({ - type: getStoreType(store.$id), - key: 'state', - editable: true, - value: store._isOptionsAPI - ? { - _custom: { - value: toRaw(store.$state), - actions: [ - { - icon: 'restore', - tooltip: 'Reset the state of this store', - action: () => store.$reset(), - }, - ], - }, - } - : // NOTE: workaround to unwrap transferred refs - Object.keys(store.$state).reduce((state, key) => { - state[key] = store.$state[key]; - return state; - }, {}), - }); - if (store._getters && store._getters.length) { - payload.instanceData.state.push({ - type: getStoreType(store.$id), - key: 'getters', - editable: false, - value: store._getters.reduce((getters, key) => { - try { - getters[key] = store[key]; - } - catch (error) { - // @ts-expect-error: we just want to show it in devtools - getters[key] = error; - } - return getters; - }, {}), - }); - } - }); - } - }); - api.on.getInspectorTree((payload) => { - if (payload.app === app && payload.inspectorId === INSPECTOR_ID) { - let stores = [pinia]; - stores = stores.concat(Array.from(pinia._s.values())); - payload.rootNodes = (payload.filter - ? stores.filter((store) => '$id' in store - ? store.$id - .toLowerCase() - .includes(payload.filter.toLowerCase()) - : PINIA_ROOT_LABEL.toLowerCase().includes(payload.filter.toLowerCase())) - : stores).map(formatStoreForInspectorTree); - } - }); - api.on.getInspectorState((payload) => { - if (payload.app === app && payload.inspectorId === INSPECTOR_ID) { - const inspectedStore = payload.nodeId === PINIA_ROOT_ID - ? pinia - : pinia._s.get(payload.nodeId); - if (!inspectedStore) { - // this could be the selected store restored for a different project - // so it's better not to say anything here - return; - } - if (inspectedStore) { - payload.state = formatStoreForInspectorState(inspectedStore); - } - } - }); - api.on.editInspectorState((payload, ctx) => { - if (payload.app === app && payload.inspectorId === INSPECTOR_ID) { - const inspectedStore = payload.nodeId === PINIA_ROOT_ID - ? pinia - : pinia._s.get(payload.nodeId); - if (!inspectedStore) { - return toastMessage(`store "${payload.nodeId}" not found`, 'error'); - } - const { path } = payload; - if (!isPinia(inspectedStore)) { - // access only the state - if (path.length !== 1 || - !inspectedStore._customProperties.has(path[0]) || - path[0] in inspectedStore.$state) { - path.unshift('$state'); - } - } - else { - // Root access, we can omit the `.value` because the devtools API does it for us - path.unshift('state'); - } - isTimelineActive = false; - payload.set(inspectedStore, path, payload.state.value); - isTimelineActive = true; - } - }); - api.on.editComponentState((payload) => { - if (payload.type.startsWith('🍍')) { - const storeId = payload.type.replace(/^🍍\s*/, ''); - const store = pinia._s.get(storeId); - if (!store) { - return toastMessage(`store "${storeId}" not found`, 'error'); - } - const { path } = payload; - if (path[0] !== 'state') { - return toastMessage(`Invalid path for store "${storeId}":\n${path}\nOnly state can be modified.`); - } - // rewrite the first entry to be able to directly set the state as - // well as any other path - path[0] = '$state'; - isTimelineActive = false; - payload.set(store, path, payload.state.value); - isTimelineActive = true; - } - }); - }); -} -function addStoreToDevtools(app, store) { - if (!componentStateTypes.includes(getStoreType(store.$id))) { - componentStateTypes.push(getStoreType(store.$id)); - } - setupDevtoolsPlugin({ - id: 'dev.esm.pinia', - label: 'Pinia 🍍', - logo: 'https://pinia.vuejs.org/logo.svg', - packageName: 'pinia', - homepage: 'https://pinia.vuejs.org', - componentStateTypes, - app, - settings: { - logStoreChanges: { - label: 'Notify about new/deleted stores', - type: 'boolean', - defaultValue: true, - }, - // useEmojis: { - // label: 'Use emojis in messages ⚡️', - // type: 'boolean', - // defaultValue: true, - // }, - }, - }, (api) => { - // gracefully handle errors - const now = typeof api.now === 'function' ? api.now.bind(api) : Date.now; - store.$onAction(({ after, onError, name, args }) => { - const groupId = runningActionId++; - api.addTimelineEvent({ - layerId: MUTATIONS_LAYER_ID, - event: { - time: now(), - title: '🛫 ' + name, - subtitle: 'start', - data: { - store: formatDisplay(store.$id), - action: formatDisplay(name), - args, - }, - groupId, - }, - }); - after((result) => { - activeAction = undefined; - api.addTimelineEvent({ - layerId: MUTATIONS_LAYER_ID, - event: { - time: now(), - title: '🛬 ' + name, - subtitle: 'end', - data: { - store: formatDisplay(store.$id), - action: formatDisplay(name), - args, - result, - }, - groupId, - }, - }); - }); - onError((error) => { - activeAction = undefined; - api.addTimelineEvent({ - layerId: MUTATIONS_LAYER_ID, - event: { - time: now(), - logType: 'error', - title: '💥 ' + name, - subtitle: 'end', - data: { - store: formatDisplay(store.$id), - action: formatDisplay(name), - args, - error, - }, - groupId, - }, - }); - }); - }, true); - store._customProperties.forEach((name) => { - watch(() => unref(store[name]), (newValue, oldValue) => { - api.notifyComponentUpdate(); - api.sendInspectorState(INSPECTOR_ID); - if (isTimelineActive) { - api.addTimelineEvent({ - layerId: MUTATIONS_LAYER_ID, - event: { - time: now(), - title: 'Change', - subtitle: name, - data: { - newValue, - oldValue, - }, - groupId: activeAction, - }, - }); - } - }, { deep: true }); - }); - store.$subscribe(({ events, type }, state) => { - api.notifyComponentUpdate(); - api.sendInspectorState(INSPECTOR_ID); - if (!isTimelineActive) - return; - // rootStore.state[store.id] = state - const eventData = { - time: now(), - title: formatMutationType(type), - data: assign$1({ store: formatDisplay(store.$id) }, formatEventData(events)), - groupId: activeAction, - }; - if (type === MutationType.patchFunction) { - eventData.subtitle = '⤵️'; - } - else if (type === MutationType.patchObject) { - eventData.subtitle = '🧩'; - } - else if (events && !Array.isArray(events)) { - eventData.subtitle = events.type; - } - if (events) { - eventData.data['rawEvent(s)'] = { - _custom: { - display: 'DebuggerEvent', - type: 'object', - tooltip: 'raw DebuggerEvent[]', - value: events, - }, - }; - } - api.addTimelineEvent({ - layerId: MUTATIONS_LAYER_ID, - event: eventData, - }); - }, { detached: true, flush: 'sync' }); - const hotUpdate = store._hotUpdate; - store._hotUpdate = markRaw((newStore) => { - hotUpdate(newStore); - api.addTimelineEvent({ - layerId: MUTATIONS_LAYER_ID, - event: { - time: now(), - title: '🔥 ' + store.$id, - subtitle: 'HMR update', - data: { - store: formatDisplay(store.$id), - info: formatDisplay(`HMR update`), - }, - }, - }); - // update the devtools too - api.notifyComponentUpdate(); - api.sendInspectorTree(INSPECTOR_ID); - api.sendInspectorState(INSPECTOR_ID); - }); - const { $dispose } = store; - store.$dispose = () => { - $dispose(); - api.notifyComponentUpdate(); - api.sendInspectorTree(INSPECTOR_ID); - api.sendInspectorState(INSPECTOR_ID); - api.getSettings().logStoreChanges && - toastMessage(`Disposed "${store.$id}" store 🗑`); - }; - // trigger an update so it can display new registered stores - api.notifyComponentUpdate(); - api.sendInspectorTree(INSPECTOR_ID); - api.sendInspectorState(INSPECTOR_ID); - api.getSettings().logStoreChanges && - toastMessage(`"${store.$id}" store installed 🆕`); - }); -} -let runningActionId = 0; -let activeAction; -/** - * Patches a store to enable action grouping in devtools by wrapping the store with a Proxy that is passed as the - * context of all actions, allowing us to set `runningAction` on each access and effectively associating any state - * mutation to the action. - * - * @param store - store to patch - * @param actionNames - list of actionst to patch - */ -function patchActionForGrouping(store, actionNames, wrapWithProxy) { - // original actions of the store as they are given by pinia. We are going to override them - const actions = actionNames.reduce((storeActions, actionName) => { - // use toRaw to avoid tracking #541 - storeActions[actionName] = toRaw(store)[actionName]; - return storeActions; - }, {}); - for (const actionName in actions) { - store[actionName] = function () { - // the running action id is incremented in a before action hook - const _actionId = runningActionId; - const trackedStore = wrapWithProxy - ? new Proxy(store, { - get(...args) { - activeAction = _actionId; - return Reflect.get(...args); - }, - set(...args) { - activeAction = _actionId; - return Reflect.set(...args); - }, - }) - : store; - // For Setup Stores we need https://github.com/tc39/proposal-async-context - activeAction = _actionId; - const retValue = actions[actionName].apply(trackedStore, arguments); - // this is safer as async actions in Setup Stores would associate mutations done outside of the action - activeAction = undefined; - return retValue; - }; - } -} -/** - * pinia.use(devtoolsPlugin) - */ -function devtoolsPlugin({ app, store, options }) { - // HMR module - if (store.$id.startsWith('__hot:')) { - return; - } - // detect option api vs setup api - store._isOptionsAPI = !!options.state; - patchActionForGrouping(store, Object.keys(options.actions), store._isOptionsAPI); - // Upgrade the HMR to also update the new actions - const originalHotUpdate = store._hotUpdate; - toRaw(store)._hotUpdate = function (newStore) { - originalHotUpdate.apply(this, arguments); - patchActionForGrouping(store, Object.keys(newStore._hmrPayload.actions), !!store._isOptionsAPI); - }; - addStoreToDevtools(app, - // FIXME: is there a way to allow the assignment from Store to StoreGeneric? - store); -} - -/** - * Creates a Pinia instance to be used by the application - */ -function createPinia() { - const scope = effectScope(true); - // NOTE: here we could check the window object for a state and directly set it - // if there is anything like it with Vue 3 SSR - const state = scope.run(() => ref({})); - let _p = []; - // plugins added before calling app.use(pinia) - let toBeInstalled = []; - const pinia = markRaw({ - install(app) { - // this allows calling useStore() outside of a component setup after - // installing pinia's plugin - setActivePinia(pinia); - if (!isVue2) { - pinia._a = app; - app.provide(piniaSymbol, pinia); - app.config.globalProperties.$pinia = pinia; - /* istanbul ignore else */ - if (USE_DEVTOOLS) { - registerPiniaDevtools(app, pinia); - } - toBeInstalled.forEach((plugin) => _p.push(plugin)); - toBeInstalled = []; - } - }, - use(plugin) { - if (!this._a && !isVue2) { - toBeInstalled.push(plugin); - } - else { - _p.push(plugin); - } - return this; - }, - _p, - // it's actually undefined here - // @ts-expect-error - _a: null, - _e: scope, - _s: new Map(), - state, - }); - // pinia devtools rely on dev only features so they cannot be forced unless - // the dev build of Vue is used. Avoid old browsers like IE11. - if (USE_DEVTOOLS && typeof Proxy !== 'undefined') { - pinia.use(devtoolsPlugin); - } - return pinia; -} - -/** - * Checks if a function is a `StoreDefinition`. - * - * @param fn - object to test - * @returns true if `fn` is a StoreDefinition - */ -const isUseStore = (fn) => { - return typeof fn === 'function' && typeof fn.$id === 'string'; -}; -/** - * Mutates in place `newState` with `oldState` to _hot update_ it. It will - * remove any key not existing in `newState` and recursively merge plain - * objects. - * - * @param newState - new state object to be patched - * @param oldState - old state that should be used to patch newState - * @returns - newState - */ -function patchObject(newState, oldState) { - // no need to go through symbols because they cannot be serialized anyway - for (const key in oldState) { - const subPatch = oldState[key]; - // skip the whole sub tree - if (!(key in newState)) { - continue; - } - const targetValue = newState[key]; - if (isPlainObject(targetValue) && - isPlainObject(subPatch) && - !isRef(subPatch) && - !isReactive(subPatch)) { - newState[key] = patchObject(targetValue, subPatch); - } - else { - // objects are either a bit more complex (e.g. refs) or primitives, so we - // just set the whole thing - if (isVue2) { - set(newState, key, subPatch); - } - else { - newState[key] = subPatch; - } - } - } - return newState; -} -/** - * Creates an _accept_ function to pass to `import.meta.hot` in Vite applications. - * - * @example - * ```js - * const useUser = defineStore(...) - * if (import.meta.hot) { - * import.meta.hot.accept(acceptHMRUpdate(useUser, import.meta.hot)) - * } - * ``` - * - * @param initialUseStore - return of the defineStore to hot update - * @param hot - `import.meta.hot` - */ -function acceptHMRUpdate(initialUseStore, hot) { - // strip as much as possible from iife.prod - if (!(process.env.NODE_ENV !== 'production')) { - return () => { }; - } - return (newModule) => { - const pinia = hot.data.pinia || initialUseStore._pinia; - if (!pinia) { - // this store is still not used - return; - } - // preserve the pinia instance across loads - hot.data.pinia = pinia; - // console.log('got data', newStore) - for (const exportName in newModule) { - const useStore = newModule[exportName]; - // console.log('checking for', exportName) - if (isUseStore(useStore) && pinia._s.has(useStore.$id)) { - // console.log('Accepting update for', useStore.$id) - const id = useStore.$id; - if (id !== initialUseStore.$id) { - console.warn(`The id of the store changed from "${initialUseStore.$id}" to "${id}". Reloading.`); - // return import.meta.hot.invalidate() - return hot.invalidate(); - } - const existingStore = pinia._s.get(id); - if (!existingStore) { - console.log(`[Pinia]: skipping hmr because store doesn't exist yet`); - return; - } - useStore(pinia, existingStore); - } - } - }; -} - -const noop = () => { }; -function addSubscription(subscriptions, callback, detached, onCleanup = noop) { - subscriptions.push(callback); - const removeSubscription = () => { - const idx = subscriptions.indexOf(callback); - if (idx > -1) { - subscriptions.splice(idx, 1); - onCleanup(); - } - }; - if (!detached && getCurrentScope()) { - onScopeDispose(removeSubscription); - } - return removeSubscription; -} -function triggerSubscriptions(subscriptions, ...args) { - subscriptions.slice().forEach((callback) => { - callback(...args); - }); -} - -const fallbackRunWithContext = (fn) => fn(); -function mergeReactiveObjects(target, patchToApply) { - // Handle Map instances - if (target instanceof Map && patchToApply instanceof Map) { - patchToApply.forEach((value, key) => target.set(key, value)); - } - // Handle Set instances - if (target instanceof Set && patchToApply instanceof Set) { - patchToApply.forEach(target.add, target); - } - // no need to go through symbols because they cannot be serialized anyway - for (const key in patchToApply) { - if (!patchToApply.hasOwnProperty(key)) - continue; - const subPatch = patchToApply[key]; - const targetValue = target[key]; - if (isPlainObject(targetValue) && - isPlainObject(subPatch) && - target.hasOwnProperty(key) && - !isRef(subPatch) && - !isReactive(subPatch)) { - // NOTE: here I wanted to warn about inconsistent types but it's not possible because in setup stores one might - // start the value of a property as a certain type e.g. a Map, and then for some reason, during SSR, change that - // to `undefined`. When trying to hydrate, we want to override the Map with `undefined`. - target[key] = mergeReactiveObjects(targetValue, subPatch); - } - else { - // @ts-expect-error: subPatch is a valid value - target[key] = subPatch; - } - } - return target; -} -const skipHydrateSymbol = (process.env.NODE_ENV !== 'production') - ? Symbol('pinia:skipHydration') - : /* istanbul ignore next */ Symbol(); -const skipHydrateMap = /*#__PURE__*/ new WeakMap(); -/** - * Tells Pinia to skip the hydration process of a given object. This is useful in setup stores (only) when you return a - * stateful object in the store but it isn't really state. e.g. returning a router instance in a setup store. - * - * @param obj - target object - * @returns obj - */ -function skipHydrate(obj) { - return isVue2 - ? // in @vue/composition-api, the refs are sealed so defineProperty doesn't work... - /* istanbul ignore next */ skipHydrateMap.set(obj, 1) && obj - : Object.defineProperty(obj, skipHydrateSymbol, {}); -} -/** - * Returns whether a value should be hydrated - * - * @param obj - target variable - * @returns true if `obj` should be hydrated - */ -function shouldHydrate(obj) { - return isVue2 - ? /* istanbul ignore next */ !skipHydrateMap.has(obj) - : !isPlainObject(obj) || !obj.hasOwnProperty(skipHydrateSymbol); -} -const { assign } = Object; -function isComputed(o) { - return !!(isRef(o) && o.effect); -} -function createOptionsStore(id, options, pinia, hot) { - const { state, actions, getters } = options; - const initialState = pinia.state.value[id]; - let store; - function setup() { - if (!initialState && (!(process.env.NODE_ENV !== 'production') || !hot)) { - /* istanbul ignore if */ - if (isVue2) { - set(pinia.state.value, id, state ? state() : {}); - } - else { - pinia.state.value[id] = state ? state() : {}; - } - } - // avoid creating a state in pinia.state.value - const localState = (process.env.NODE_ENV !== 'production') && hot - ? // use ref() to unwrap refs inside state TODO: check if this is still necessary - toRefs(ref(state ? state() : {}).value) - : toRefs(pinia.state.value[id]); - return assign(localState, actions, Object.keys(getters || {}).reduce((computedGetters, name) => { - if ((process.env.NODE_ENV !== 'production') && name in localState) { - console.warn(`[🍍]: A getter cannot have the same name as another state property. Rename one of them. Found with "${name}" in store "${id}".`); - } - computedGetters[name] = markRaw(computed(() => { - setActivePinia(pinia); - // it was created just before - const store = pinia._s.get(id); - // allow cross using stores - /* istanbul ignore next */ - if (isVue2 && !store._r) - return; - // @ts-expect-error - // return getters![name].call(context, context) - // TODO: avoid reading the getter while assigning with a global variable - return getters[name].call(store, store); - })); - return computedGetters; - }, {})); - } - store = createSetupStore(id, setup, options, pinia, hot, true); - return store; -} -function createSetupStore($id, setup, options = {}, pinia, hot, isOptionsStore) { - let scope; - const optionsForPlugin = assign({ actions: {} }, options); - /* istanbul ignore if */ - if ((process.env.NODE_ENV !== 'production') && !pinia._e.active) { - throw new Error('Pinia destroyed'); - } - // watcher options for $subscribe - const $subscribeOptions = { - deep: true, - // flush: 'post', - }; - /* istanbul ignore else */ - if ((process.env.NODE_ENV !== 'production') && !isVue2) { - $subscribeOptions.onTrigger = (event) => { - /* istanbul ignore else */ - if (isListening) { - debuggerEvents = event; - // avoid triggering this while the store is being built and the state is being set in pinia - } - else if (isListening == false && !store._hotUpdating) { - // let patch send all the events together later - /* istanbul ignore else */ - if (Array.isArray(debuggerEvents)) { - debuggerEvents.push(event); - } - else { - console.error('🍍 debuggerEvents should be an array. This is most likely an internal Pinia bug.'); - } - } - }; - } - // internal state - let isListening; // set to true at the end - let isSyncListening; // set to true at the end - let subscriptions = []; - let actionSubscriptions = []; - let debuggerEvents; - const initialState = pinia.state.value[$id]; - // avoid setting the state for option stores if it is set - // by the setup - if (!isOptionsStore && !initialState && (!(process.env.NODE_ENV !== 'production') || !hot)) { - /* istanbul ignore if */ - if (isVue2) { - set(pinia.state.value, $id, {}); - } - else { - pinia.state.value[$id] = {}; - } - } - const hotState = ref({}); - // avoid triggering too many listeners - // https://github.com/vuejs/pinia/issues/1129 - let activeListener; - function $patch(partialStateOrMutator) { - let subscriptionMutation; - isListening = isSyncListening = false; - // reset the debugger events since patches are sync - /* istanbul ignore else */ - if ((process.env.NODE_ENV !== 'production')) { - debuggerEvents = []; - } - if (typeof partialStateOrMutator === 'function') { - partialStateOrMutator(pinia.state.value[$id]); - subscriptionMutation = { - type: MutationType.patchFunction, - storeId: $id, - events: debuggerEvents, - }; - } - else { - mergeReactiveObjects(pinia.state.value[$id], partialStateOrMutator); - subscriptionMutation = { - type: MutationType.patchObject, - payload: partialStateOrMutator, - storeId: $id, - events: debuggerEvents, - }; - } - const myListenerId = (activeListener = Symbol()); - nextTick().then(() => { - if (activeListener === myListenerId) { - isListening = true; - } - }); - isSyncListening = true; - // because we paused the watcher, we need to manually call the subscriptions - triggerSubscriptions(subscriptions, subscriptionMutation, pinia.state.value[$id]); - } - const $reset = isOptionsStore - ? function $reset() { - const { state } = options; - const newState = state ? state() : {}; - // we use a patch to group all changes into one single subscription - this.$patch(($state) => { - assign($state, newState); - }); - } - : /* istanbul ignore next */ - (process.env.NODE_ENV !== 'production') - ? () => { - throw new Error(`🍍: Store "${$id}" is built using the setup syntax and does not implement $reset().`); - } - : noop; - function $dispose() { - scope.stop(); - subscriptions = []; - actionSubscriptions = []; - pinia._s.delete($id); - } - /** - * Wraps an action to handle subscriptions. - * - * @param name - name of the action - * @param action - action to wrap - * @returns a wrapped action to handle subscriptions - */ - function wrapAction(name, action) { - return function () { - setActivePinia(pinia); - const args = Array.from(arguments); - const afterCallbackList = []; - const onErrorCallbackList = []; - function after(callback) { - afterCallbackList.push(callback); - } - function onError(callback) { - onErrorCallbackList.push(callback); - } - // @ts-expect-error - triggerSubscriptions(actionSubscriptions, { - args, - name, - store, - after, - onError, - }); - let ret; - try { - ret = action.apply(this && this.$id === $id ? this : store, args); - // handle sync errors - } - catch (error) { - triggerSubscriptions(onErrorCallbackList, error); - throw error; - } - if (ret instanceof Promise) { - return ret - .then((value) => { - triggerSubscriptions(afterCallbackList, value); - return value; - }) - .catch((error) => { - triggerSubscriptions(onErrorCallbackList, error); - return Promise.reject(error); - }); - } - // trigger after callbacks - triggerSubscriptions(afterCallbackList, ret); - return ret; - }; - } - const _hmrPayload = /*#__PURE__*/ markRaw({ - actions: {}, - getters: {}, - state: [], - hotState, - }); - const partialStore = { - _p: pinia, - // _s: scope, - $id, - $onAction: addSubscription.bind(null, actionSubscriptions), - $patch, - $reset, - $subscribe(callback, options = {}) { - const removeSubscription = addSubscription(subscriptions, callback, options.detached, () => stopWatcher()); - const stopWatcher = scope.run(() => watch(() => pinia.state.value[$id], (state) => { - if (options.flush === 'sync' ? isSyncListening : isListening) { - callback({ - storeId: $id, - type: MutationType.direct, - events: debuggerEvents, - }, state); - } - }, assign({}, $subscribeOptions, options))); - return removeSubscription; - }, - $dispose, - }; - /* istanbul ignore if */ - if (isVue2) { - // start as non ready - partialStore._r = false; - } - const store = reactive((process.env.NODE_ENV !== 'production') || USE_DEVTOOLS - ? assign({ - _hmrPayload, - _customProperties: markRaw(new Set()), // devtools custom properties - }, partialStore - // must be added later - // setupStore - ) - : partialStore); - // store the partial store now so the setup of stores can instantiate each other before they are finished without - // creating infinite loops. - pinia._s.set($id, store); - const runWithContext = (pinia._a && pinia._a.runWithContext) || fallbackRunWithContext; - // TODO: idea create skipSerialize that marks properties as non serializable and they are skipped - const setupStore = pinia._e.run(() => { - scope = effectScope(); - return runWithContext(() => scope.run(setup)); - }); - // overwrite existing actions to support $onAction - for (const key in setupStore) { - const prop = setupStore[key]; - if ((isRef(prop) && !isComputed(prop)) || isReactive(prop)) { - // mark it as a piece of state to be serialized - if ((process.env.NODE_ENV !== 'production') && hot) { - set(hotState.value, key, toRef(setupStore, key)); - // createOptionStore directly sets the state in pinia.state.value so we - // can just skip that - } - else if (!isOptionsStore) { - // in setup stores we must hydrate the state and sync pinia state tree with the refs the user just created - if (initialState && shouldHydrate(prop)) { - if (isRef(prop)) { - prop.value = initialState[key]; - } - else { - // probably a reactive object, lets recursively assign - // @ts-expect-error: prop is unknown - mergeReactiveObjects(prop, initialState[key]); - } - } - // transfer the ref to the pinia state to keep everything in sync - /* istanbul ignore if */ - if (isVue2) { - set(pinia.state.value[$id], key, prop); - } - else { - pinia.state.value[$id][key] = prop; - } - } - /* istanbul ignore else */ - if ((process.env.NODE_ENV !== 'production')) { - _hmrPayload.state.push(key); - } - // action - } - else if (typeof prop === 'function') { - // @ts-expect-error: we are overriding the function we avoid wrapping if - const actionValue = (process.env.NODE_ENV !== 'production') && hot ? prop : wrapAction(key, prop); - // this a hot module replacement store because the hotUpdate method needs - // to do it with the right context - /* istanbul ignore if */ - if (isVue2) { - set(setupStore, key, actionValue); - } - else { - // @ts-expect-error - setupStore[key] = actionValue; - } - /* istanbul ignore else */ - if ((process.env.NODE_ENV !== 'production')) { - _hmrPayload.actions[key] = prop; - } - // list actions so they can be used in plugins - // @ts-expect-error - optionsForPlugin.actions[key] = prop; - } - else if ((process.env.NODE_ENV !== 'production')) { - // add getters for devtools - if (isComputed(prop)) { - _hmrPayload.getters[key] = isOptionsStore - ? // @ts-expect-error - options.getters[key] - : prop; - if (IS_CLIENT) { - const getters = setupStore._getters || - // @ts-expect-error: same - (setupStore._getters = markRaw([])); - getters.push(key); - } - } - } - } - // add the state, getters, and action properties - /* istanbul ignore if */ - if (isVue2) { - Object.keys(setupStore).forEach((key) => { - set(store, key, setupStore[key]); - }); - } - else { - assign(store, setupStore); - // allows retrieving reactive objects with `storeToRefs()`. Must be called after assigning to the reactive object. - // Make `storeToRefs()` work with `reactive()` #799 - assign(toRaw(store), setupStore); - } - // use this instead of a computed with setter to be able to create it anywhere - // without linking the computed lifespan to wherever the store is first - // created. - Object.defineProperty(store, '$state', { - get: () => ((process.env.NODE_ENV !== 'production') && hot ? hotState.value : pinia.state.value[$id]), - set: (state) => { - /* istanbul ignore if */ - if ((process.env.NODE_ENV !== 'production') && hot) { - throw new Error('cannot set hotState'); - } - $patch(($state) => { - assign($state, state); - }); - }, - }); - // add the hotUpdate before plugins to allow them to override it - /* istanbul ignore else */ - if ((process.env.NODE_ENV !== 'production')) { - store._hotUpdate = markRaw((newStore) => { - store._hotUpdating = true; - newStore._hmrPayload.state.forEach((stateKey) => { - if (stateKey in store.$state) { - const newStateTarget = newStore.$state[stateKey]; - const oldStateSource = store.$state[stateKey]; - if (typeof newStateTarget === 'object' && - isPlainObject(newStateTarget) && - isPlainObject(oldStateSource)) { - patchObject(newStateTarget, oldStateSource); - } - else { - // transfer the ref - newStore.$state[stateKey] = oldStateSource; - } - } - // patch direct access properties to allow store.stateProperty to work as - // store.$state.stateProperty - set(store, stateKey, toRef(newStore.$state, stateKey)); - }); - // remove deleted state properties - Object.keys(store.$state).forEach((stateKey) => { - if (!(stateKey in newStore.$state)) { - del(store, stateKey); - } - }); - // avoid devtools logging this as a mutation - isListening = false; - isSyncListening = false; - pinia.state.value[$id] = toRef(newStore._hmrPayload, 'hotState'); - isSyncListening = true; - nextTick().then(() => { - isListening = true; - }); - for (const actionName in newStore._hmrPayload.actions) { - const action = newStore[actionName]; - set(store, actionName, wrapAction(actionName, action)); - } - // TODO: does this work in both setup and option store? - for (const getterName in newStore._hmrPayload.getters) { - const getter = newStore._hmrPayload.getters[getterName]; - const getterValue = isOptionsStore - ? // special handling of options api - computed(() => { - setActivePinia(pinia); - return getter.call(store, store); - }) - : getter; - set(store, getterName, getterValue); - } - // remove deleted getters - Object.keys(store._hmrPayload.getters).forEach((key) => { - if (!(key in newStore._hmrPayload.getters)) { - del(store, key); - } - }); - // remove old actions - Object.keys(store._hmrPayload.actions).forEach((key) => { - if (!(key in newStore._hmrPayload.actions)) { - del(store, key); - } - }); - // update the values used in devtools and to allow deleting new properties later on - store._hmrPayload = newStore._hmrPayload; - store._getters = newStore._getters; - store._hotUpdating = false; - }); - } - if (USE_DEVTOOLS) { - const nonEnumerable = { - writable: true, - configurable: true, - // avoid warning on devtools trying to display this property - enumerable: false, - }; - ['_p', '_hmrPayload', '_getters', '_customProperties'].forEach((p) => { - Object.defineProperty(store, p, assign({ value: store[p] }, nonEnumerable)); - }); - } - /* istanbul ignore if */ - if (isVue2) { - // mark the store as ready before plugins - store._r = true; - } - // apply all plugins - pinia._p.forEach((extender) => { - /* istanbul ignore else */ - if (USE_DEVTOOLS) { - const extensions = scope.run(() => extender({ - store, - app: pinia._a, - pinia, - options: optionsForPlugin, - })); - Object.keys(extensions || {}).forEach((key) => store._customProperties.add(key)); - assign(store, extensions); - } - else { - assign(store, scope.run(() => extender({ - store, - app: pinia._a, - pinia, - options: optionsForPlugin, - }))); - } - }); - if ((process.env.NODE_ENV !== 'production') && - store.$state && - typeof store.$state === 'object' && - typeof store.$state.constructor === 'function' && - !store.$state.constructor.toString().includes('[native code]')) { - console.warn(`[🍍]: The "state" must be a plain object. It cannot be\n` + - `\tstate: () => new MyClass()\n` + - `Found in store "${store.$id}".`); - } - // only apply hydrate to option stores with an initial state in pinia - if (initialState && - isOptionsStore && - options.hydrate) { - options.hydrate(store.$state, initialState); - } - isListening = true; - isSyncListening = true; - return store; -} -function defineStore( -// TODO: add proper types from above -idOrOptions, setup, setupOptions) { - let id; - let options; - const isSetupStore = typeof setup === 'function'; - if (typeof idOrOptions === 'string') { - id = idOrOptions; - // the option store setup will contain the actual options in this case - options = isSetupStore ? setupOptions : setup; - } - else { - options = idOrOptions; - id = idOrOptions.id; - if ((process.env.NODE_ENV !== 'production') && typeof id !== 'string') { - throw new Error(`[🍍]: "defineStore()" must be passed a store id as its first argument.`); - } - } - function useStore(pinia, hot) { - const hasContext = hasInjectionContext(); - pinia = - // in test mode, ignore the argument provided as we can always retrieve a - // pinia instance with getActivePinia() - ((process.env.NODE_ENV === 'test') && activePinia && activePinia._testing ? null : pinia) || - (hasContext ? inject(piniaSymbol, null) : null); - if (pinia) - setActivePinia(pinia); - if ((process.env.NODE_ENV !== 'production') && !activePinia) { - throw new Error(`[🍍]: "getActivePinia()" was called but there was no active Pinia. Did you forget to install pinia?\n` + - `\tconst pinia = createPinia()\n` + - `\tapp.use(pinia)\n` + - `This will fail in production.`); - } - pinia = activePinia; - if (!pinia._s.has(id)) { - // creating the store registers it in `pinia._s` - if (isSetupStore) { - createSetupStore(id, setup, options, pinia); - } - else { - createOptionsStore(id, options, pinia); - } - /* istanbul ignore else */ - if ((process.env.NODE_ENV !== 'production')) { - // @ts-expect-error: not the right inferred type - useStore._pinia = pinia; - } - } - const store = pinia._s.get(id); - if ((process.env.NODE_ENV !== 'production') && hot) { - const hotId = '__hot:' + id; - const newStore = isSetupStore - ? createSetupStore(hotId, setup, options, pinia, true) - : createOptionsStore(hotId, assign({}, options), pinia, true); - hot._hotUpdate(newStore); - // cleanup the state properties and the store from the cache - delete pinia.state.value[hotId]; - pinia._s.delete(hotId); - } - if ((process.env.NODE_ENV !== 'production') && IS_CLIENT) { - const currentInstance = getCurrentInstance(); - // save stores in instances to access them devtools - if (currentInstance && - currentInstance.proxy && - // avoid adding stores that are just built for hot module replacement - !hot) { - const vm = currentInstance.proxy; - const cache = '_pStores' in vm ? vm._pStores : (vm._pStores = {}); - cache[id] = store; - } - } - // StoreGeneric cannot be casted towards Store - return store; - } - useStore.$id = id; - return useStore; -} - -let mapStoreSuffix = 'Store'; -/** - * Changes the suffix added by `mapStores()`. Can be set to an empty string. - * Defaults to `"Store"`. Make sure to extend the MapStoresCustomization - * interface if you are using TypeScript. - * - * @param suffix - new suffix - */ -function setMapStoreSuffix(suffix // could be 'Store' but that would be annoying for JS -) { - mapStoreSuffix = suffix; -} -/** - * Allows using stores without the composition API (`setup()`) by generating an - * object to be spread in the `computed` field of a component. It accepts a list - * of store definitions. - * - * @example - * ```js - * export default { - * computed: { - * // other computed properties - * ...mapStores(useUserStore, useCartStore) - * }, - * - * created() { - * this.userStore // store with id "user" - * this.cartStore // store with id "cart" - * } - * } - * ``` - * - * @param stores - list of stores to map to an object - */ -function mapStores(...stores) { - if ((process.env.NODE_ENV !== 'production') && Array.isArray(stores[0])) { - console.warn(`[🍍]: Directly pass all stores to "mapStores()" without putting them in an array:\n` + - `Replace\n` + - `\tmapStores([useAuthStore, useCartStore])\n` + - `with\n` + - `\tmapStores(useAuthStore, useCartStore)\n` + - `This will fail in production if not fixed.`); - stores = stores[0]; - } - return stores.reduce((reduced, useStore) => { - // @ts-expect-error: $id is added by defineStore - reduced[useStore.$id + mapStoreSuffix] = function () { - return useStore(this.$pinia); - }; - return reduced; - }, {}); -} -/** - * Allows using state and getters from one store without using the composition - * API (`setup()`) by generating an object to be spread in the `computed` field - * of a component. - * - * @param useStore - store to map from - * @param keysOrMapper - array or object - */ -function mapState(useStore, keysOrMapper) { - return Array.isArray(keysOrMapper) - ? keysOrMapper.reduce((reduced, key) => { - reduced[key] = function () { - return useStore(this.$pinia)[key]; - }; - return reduced; - }, {}) - : Object.keys(keysOrMapper).reduce((reduced, key) => { - // @ts-expect-error - reduced[key] = function () { - const store = useStore(this.$pinia); - const storeKey = keysOrMapper[key]; - // for some reason TS is unable to infer the type of storeKey to be a - // function - return typeof storeKey === 'function' - ? storeKey.call(this, store) - : store[storeKey]; - }; - return reduced; - }, {}); -} -/** - * Alias for `mapState()`. You should use `mapState()` instead. - * @deprecated use `mapState()` instead. - */ -const mapGetters = mapState; -/** - * Allows directly using actions from your store without using the composition - * API (`setup()`) by generating an object to be spread in the `methods` field - * of a component. - * - * @param useStore - store to map from - * @param keysOrMapper - array or object - */ -function mapActions(useStore, keysOrMapper) { - return Array.isArray(keysOrMapper) - ? keysOrMapper.reduce((reduced, key) => { - // @ts-expect-error - reduced[key] = function (...args) { - return useStore(this.$pinia)[key](...args); - }; - return reduced; - }, {}) - : Object.keys(keysOrMapper).reduce((reduced, key) => { - // @ts-expect-error - reduced[key] = function (...args) { - return useStore(this.$pinia)[keysOrMapper[key]](...args); - }; - return reduced; - }, {}); -} -/** - * Allows using state and getters from one store without using the composition - * API (`setup()`) by generating an object to be spread in the `computed` field - * of a component. - * - * @param useStore - store to map from - * @param keysOrMapper - array or object - */ -function mapWritableState(useStore, keysOrMapper) { - return Array.isArray(keysOrMapper) - ? keysOrMapper.reduce((reduced, key) => { - // @ts-ignore - reduced[key] = { - get() { - return useStore(this.$pinia)[key]; - }, - set(value) { - // it's easier to type it here as any - return (useStore(this.$pinia)[key] = value); - }, - }; - return reduced; - }, {}) - : Object.keys(keysOrMapper).reduce((reduced, key) => { - // @ts-ignore - reduced[key] = { - get() { - return useStore(this.$pinia)[keysOrMapper[key]]; - }, - set(value) { - // it's easier to type it here as any - return (useStore(this.$pinia)[keysOrMapper[key]] = value); - }, - }; - return reduced; - }, {}); -} - -/** - * Creates an object of references with all the state, getters, and plugin-added - * state properties of the store. Similar to `toRefs()` but specifically - * designed for Pinia stores so methods and non reactive properties are - * completely ignored. - * - * @param store - store to extract the refs from - */ -function storeToRefs(store) { - // See https://github.com/vuejs/pinia/issues/852 - // It's easier to just use toRefs() even if it includes more stuff - if (isVue2) { - // @ts-expect-error: toRefs include methods and others - return toRefs(store); - } - else { - store = toRaw(store); - const refs = {}; - for (const key in store) { - const value = store[key]; - if (isRef(value) || isReactive(value)) { - // @ts-expect-error: the key is state or getter - refs[key] = - // --- - toRef(store, key); - } - } - return refs; - } -} - -/** - * Vue 2 Plugin that must be installed for pinia to work. Note **you don't need - * this plugin if you are using Nuxt.js**. Use the `buildModule` instead: - * https://pinia.vuejs.org/ssr/nuxt.html. - * - * @example - * ```js - * import Vue from 'vue' - * import { PiniaVuePlugin, createPinia } from 'pinia' - * - * Vue.use(PiniaVuePlugin) - * const pinia = createPinia() - * - * new Vue({ - * el: '#app', - * // ... - * pinia, - * }) - * ``` - * - * @param _Vue - `Vue` imported from 'vue'. - */ -const PiniaVuePlugin = function (_Vue) { - // Equivalent of - // app.config.globalProperties.$pinia = pinia - _Vue.mixin({ - beforeCreate() { - const options = this.$options; - if (options.pinia) { - const pinia = options.pinia; - // HACK: taken from provide(): https://github.com/vuejs/composition-api/blob/main/src/apis/inject.ts#L31 - /* istanbul ignore else */ - if (!this._provided) { - const provideCache = {}; - Object.defineProperty(this, '_provided', { - get: () => provideCache, - set: (v) => Object.assign(provideCache, v), - }); - } - this._provided[piniaSymbol] = pinia; - // propagate the pinia instance in an SSR friendly way - // avoid adding it to nuxt twice - /* istanbul ignore else */ - if (!this.$pinia) { - this.$pinia = pinia; - } - pinia._a = this; - if (IS_CLIENT) { - // this allows calling useStore() outside of a component setup after - // installing pinia's plugin - setActivePinia(pinia); - } - if (USE_DEVTOOLS) { - registerPiniaDevtools(pinia._a, pinia); - } - } - else if (!this.$pinia && options.parent && options.parent.$pinia) { - this.$pinia = options.parent.$pinia; - } - }, - destroyed() { - delete this._pStores; - }, - }); -}; - -export { MutationType, PiniaVuePlugin, acceptHMRUpdate, createPinia, defineStore, getActivePinia, mapActions, mapGetters, mapState, mapStores, mapWritableState, setActivePinia, setMapStoreSuffix, skipHydrate, storeToRefs }; diff --git a/node_modules/pinia/dist/pinia.prod.cjs b/node_modules/pinia/dist/pinia.prod.cjs deleted file mode 100644 index 2afd99f..0000000 --- a/node_modules/pinia/dist/pinia.prod.cjs +++ /dev/null @@ -1,808 +0,0 @@ -/*! - * pinia v2.1.6 - * (c) 2023 Eduardo San Martin Morote - * @license MIT - */ -'use strict'; - -var vueDemi = require('vue-demi'); - -/** - * setActivePinia must be called to handle SSR at the top of functions like - * `fetch`, `setup`, `serverPrefetch` and others - */ -let activePinia; -/** - * Sets or unsets the active pinia. Used in SSR and internally when calling - * actions and getters - * - * @param pinia - Pinia instance - */ -// @ts-expect-error: cannot constrain the type of the return -const setActivePinia = (pinia) => (activePinia = pinia); -/** - * Get the currently active pinia if there is any. - */ -const getActivePinia = () => (vueDemi.hasInjectionContext() && vueDemi.inject(piniaSymbol)) || activePinia; -const piniaSymbol = (/* istanbul ignore next */ Symbol()); - -function isPlainObject( -// eslint-disable-next-line @typescript-eslint/no-explicit-any -o) { - return (o && - typeof o === 'object' && - Object.prototype.toString.call(o) === '[object Object]' && - typeof o.toJSON !== 'function'); -} -// type DeepReadonly = { readonly [P in keyof T]: DeepReadonly } -// TODO: can we change these to numbers? -/** - * Possible types for SubscriptionCallback - */ -exports.MutationType = void 0; -(function (MutationType) { - /** - * Direct mutation of the state: - * - * - `store.name = 'new name'` - * - `store.$state.name = 'new name'` - * - `store.list.push('new item')` - */ - MutationType["direct"] = "direct"; - /** - * Mutated the state with `$patch` and an object - * - * - `store.$patch({ name: 'newName' })` - */ - MutationType["patchObject"] = "patch object"; - /** - * Mutated the state with `$patch` and a function - * - * - `store.$patch(state => state.name = 'newName')` - */ - MutationType["patchFunction"] = "patch function"; - // maybe reset? for $state = {} and $reset -})(exports.MutationType || (exports.MutationType = {})); - -const IS_CLIENT = typeof window !== 'undefined'; - -/** - * Creates a Pinia instance to be used by the application - */ -function createPinia() { - const scope = vueDemi.effectScope(true); - // NOTE: here we could check the window object for a state and directly set it - // if there is anything like it with Vue 3 SSR - const state = scope.run(() => vueDemi.ref({})); - let _p = []; - // plugins added before calling app.use(pinia) - let toBeInstalled = []; - const pinia = vueDemi.markRaw({ - install(app) { - // this allows calling useStore() outside of a component setup after - // installing pinia's plugin - setActivePinia(pinia); - if (!vueDemi.isVue2) { - pinia._a = app; - app.provide(piniaSymbol, pinia); - app.config.globalProperties.$pinia = pinia; - toBeInstalled.forEach((plugin) => _p.push(plugin)); - toBeInstalled = []; - } - }, - use(plugin) { - if (!this._a && !vueDemi.isVue2) { - toBeInstalled.push(plugin); - } - else { - _p.push(plugin); - } - return this; - }, - _p, - // it's actually undefined here - // @ts-expect-error - _a: null, - _e: scope, - _s: new Map(), - state, - }); - return pinia; -} - -/** - * Creates an _accept_ function to pass to `import.meta.hot` in Vite applications. - * - * @example - * ```js - * const useUser = defineStore(...) - * if (import.meta.hot) { - * import.meta.hot.accept(acceptHMRUpdate(useUser, import.meta.hot)) - * } - * ``` - * - * @param initialUseStore - return of the defineStore to hot update - * @param hot - `import.meta.hot` - */ -function acceptHMRUpdate(initialUseStore, hot) { - // strip as much as possible from iife.prod - { - return () => { }; - } -} - -const noop = () => { }; -function addSubscription(subscriptions, callback, detached, onCleanup = noop) { - subscriptions.push(callback); - const removeSubscription = () => { - const idx = subscriptions.indexOf(callback); - if (idx > -1) { - subscriptions.splice(idx, 1); - onCleanup(); - } - }; - if (!detached && vueDemi.getCurrentScope()) { - vueDemi.onScopeDispose(removeSubscription); - } - return removeSubscription; -} -function triggerSubscriptions(subscriptions, ...args) { - subscriptions.slice().forEach((callback) => { - callback(...args); - }); -} - -const fallbackRunWithContext = (fn) => fn(); -function mergeReactiveObjects(target, patchToApply) { - // Handle Map instances - if (target instanceof Map && patchToApply instanceof Map) { - patchToApply.forEach((value, key) => target.set(key, value)); - } - // Handle Set instances - if (target instanceof Set && patchToApply instanceof Set) { - patchToApply.forEach(target.add, target); - } - // no need to go through symbols because they cannot be serialized anyway - for (const key in patchToApply) { - if (!patchToApply.hasOwnProperty(key)) - continue; - const subPatch = patchToApply[key]; - const targetValue = target[key]; - if (isPlainObject(targetValue) && - isPlainObject(subPatch) && - target.hasOwnProperty(key) && - !vueDemi.isRef(subPatch) && - !vueDemi.isReactive(subPatch)) { - // NOTE: here I wanted to warn about inconsistent types but it's not possible because in setup stores one might - // start the value of a property as a certain type e.g. a Map, and then for some reason, during SSR, change that - // to `undefined`. When trying to hydrate, we want to override the Map with `undefined`. - target[key] = mergeReactiveObjects(targetValue, subPatch); - } - else { - // @ts-expect-error: subPatch is a valid value - target[key] = subPatch; - } - } - return target; -} -const skipHydrateSymbol = /* istanbul ignore next */ Symbol(); -const skipHydrateMap = /*#__PURE__*/ new WeakMap(); -/** - * Tells Pinia to skip the hydration process of a given object. This is useful in setup stores (only) when you return a - * stateful object in the store but it isn't really state. e.g. returning a router instance in a setup store. - * - * @param obj - target object - * @returns obj - */ -function skipHydrate(obj) { - return vueDemi.isVue2 - ? // in @vue/composition-api, the refs are sealed so defineProperty doesn't work... - /* istanbul ignore next */ skipHydrateMap.set(obj, 1) && obj - : Object.defineProperty(obj, skipHydrateSymbol, {}); -} -/** - * Returns whether a value should be hydrated - * - * @param obj - target variable - * @returns true if `obj` should be hydrated - */ -function shouldHydrate(obj) { - return vueDemi.isVue2 - ? /* istanbul ignore next */ !skipHydrateMap.has(obj) - : !isPlainObject(obj) || !obj.hasOwnProperty(skipHydrateSymbol); -} -const { assign } = Object; -function isComputed(o) { - return !!(vueDemi.isRef(o) && o.effect); -} -function createOptionsStore(id, options, pinia, hot) { - const { state, actions, getters } = options; - const initialState = pinia.state.value[id]; - let store; - function setup() { - if (!initialState && (!false )) { - /* istanbul ignore if */ - if (vueDemi.isVue2) { - vueDemi.set(pinia.state.value, id, state ? state() : {}); - } - else { - pinia.state.value[id] = state ? state() : {}; - } - } - // avoid creating a state in pinia.state.value - const localState = vueDemi.toRefs(pinia.state.value[id]); - return assign(localState, actions, Object.keys(getters || {}).reduce((computedGetters, name) => { - computedGetters[name] = vueDemi.markRaw(vueDemi.computed(() => { - setActivePinia(pinia); - // it was created just before - const store = pinia._s.get(id); - // allow cross using stores - /* istanbul ignore next */ - if (vueDemi.isVue2 && !store._r) - return; - // @ts-expect-error - // return getters![name].call(context, context) - // TODO: avoid reading the getter while assigning with a global variable - return getters[name].call(store, store); - })); - return computedGetters; - }, {})); - } - store = createSetupStore(id, setup, options, pinia, hot, true); - return store; -} -function createSetupStore($id, setup, options = {}, pinia, hot, isOptionsStore) { - let scope; - const optionsForPlugin = assign({ actions: {} }, options); - // watcher options for $subscribe - const $subscribeOptions = { - deep: true, - // flush: 'post', - }; - // internal state - let isListening; // set to true at the end - let isSyncListening; // set to true at the end - let subscriptions = []; - let actionSubscriptions = []; - let debuggerEvents; - const initialState = pinia.state.value[$id]; - // avoid setting the state for option stores if it is set - // by the setup - if (!isOptionsStore && !initialState && (!false )) { - /* istanbul ignore if */ - if (vueDemi.isVue2) { - vueDemi.set(pinia.state.value, $id, {}); - } - else { - pinia.state.value[$id] = {}; - } - } - vueDemi.ref({}); - // avoid triggering too many listeners - // https://github.com/vuejs/pinia/issues/1129 - let activeListener; - function $patch(partialStateOrMutator) { - let subscriptionMutation; - isListening = isSyncListening = false; - if (typeof partialStateOrMutator === 'function') { - partialStateOrMutator(pinia.state.value[$id]); - subscriptionMutation = { - type: exports.MutationType.patchFunction, - storeId: $id, - events: debuggerEvents, - }; - } - else { - mergeReactiveObjects(pinia.state.value[$id], partialStateOrMutator); - subscriptionMutation = { - type: exports.MutationType.patchObject, - payload: partialStateOrMutator, - storeId: $id, - events: debuggerEvents, - }; - } - const myListenerId = (activeListener = Symbol()); - vueDemi.nextTick().then(() => { - if (activeListener === myListenerId) { - isListening = true; - } - }); - isSyncListening = true; - // because we paused the watcher, we need to manually call the subscriptions - triggerSubscriptions(subscriptions, subscriptionMutation, pinia.state.value[$id]); - } - const $reset = isOptionsStore - ? function $reset() { - const { state } = options; - const newState = state ? state() : {}; - // we use a patch to group all changes into one single subscription - this.$patch(($state) => { - assign($state, newState); - }); - } - : /* istanbul ignore next */ - noop; - function $dispose() { - scope.stop(); - subscriptions = []; - actionSubscriptions = []; - pinia._s.delete($id); - } - /** - * Wraps an action to handle subscriptions. - * - * @param name - name of the action - * @param action - action to wrap - * @returns a wrapped action to handle subscriptions - */ - function wrapAction(name, action) { - return function () { - setActivePinia(pinia); - const args = Array.from(arguments); - const afterCallbackList = []; - const onErrorCallbackList = []; - function after(callback) { - afterCallbackList.push(callback); - } - function onError(callback) { - onErrorCallbackList.push(callback); - } - // @ts-expect-error - triggerSubscriptions(actionSubscriptions, { - args, - name, - store, - after, - onError, - }); - let ret; - try { - ret = action.apply(this && this.$id === $id ? this : store, args); - // handle sync errors - } - catch (error) { - triggerSubscriptions(onErrorCallbackList, error); - throw error; - } - if (ret instanceof Promise) { - return ret - .then((value) => { - triggerSubscriptions(afterCallbackList, value); - return value; - }) - .catch((error) => { - triggerSubscriptions(onErrorCallbackList, error); - return Promise.reject(error); - }); - } - // trigger after callbacks - triggerSubscriptions(afterCallbackList, ret); - return ret; - }; - } - const partialStore = { - _p: pinia, - // _s: scope, - $id, - $onAction: addSubscription.bind(null, actionSubscriptions), - $patch, - $reset, - $subscribe(callback, options = {}) { - const removeSubscription = addSubscription(subscriptions, callback, options.detached, () => stopWatcher()); - const stopWatcher = scope.run(() => vueDemi.watch(() => pinia.state.value[$id], (state) => { - if (options.flush === 'sync' ? isSyncListening : isListening) { - callback({ - storeId: $id, - type: exports.MutationType.direct, - events: debuggerEvents, - }, state); - } - }, assign({}, $subscribeOptions, options))); - return removeSubscription; - }, - $dispose, - }; - /* istanbul ignore if */ - if (vueDemi.isVue2) { - // start as non ready - partialStore._r = false; - } - const store = vueDemi.reactive(partialStore); - // store the partial store now so the setup of stores can instantiate each other before they are finished without - // creating infinite loops. - pinia._s.set($id, store); - const runWithContext = (pinia._a && pinia._a.runWithContext) || fallbackRunWithContext; - // TODO: idea create skipSerialize that marks properties as non serializable and they are skipped - const setupStore = pinia._e.run(() => { - scope = vueDemi.effectScope(); - return runWithContext(() => scope.run(setup)); - }); - // overwrite existing actions to support $onAction - for (const key in setupStore) { - const prop = setupStore[key]; - if ((vueDemi.isRef(prop) && !isComputed(prop)) || vueDemi.isReactive(prop)) { - // mark it as a piece of state to be serialized - if (!isOptionsStore) { - // in setup stores we must hydrate the state and sync pinia state tree with the refs the user just created - if (initialState && shouldHydrate(prop)) { - if (vueDemi.isRef(prop)) { - prop.value = initialState[key]; - } - else { - // probably a reactive object, lets recursively assign - // @ts-expect-error: prop is unknown - mergeReactiveObjects(prop, initialState[key]); - } - } - // transfer the ref to the pinia state to keep everything in sync - /* istanbul ignore if */ - if (vueDemi.isVue2) { - vueDemi.set(pinia.state.value[$id], key, prop); - } - else { - pinia.state.value[$id][key] = prop; - } - } - // action - } - else if (typeof prop === 'function') { - // @ts-expect-error: we are overriding the function we avoid wrapping if - const actionValue = wrapAction(key, prop); - // this a hot module replacement store because the hotUpdate method needs - // to do it with the right context - /* istanbul ignore if */ - if (vueDemi.isVue2) { - vueDemi.set(setupStore, key, actionValue); - } - else { - // @ts-expect-error - setupStore[key] = actionValue; - } - // list actions so they can be used in plugins - // @ts-expect-error - optionsForPlugin.actions[key] = prop; - } - else ; - } - // add the state, getters, and action properties - /* istanbul ignore if */ - if (vueDemi.isVue2) { - Object.keys(setupStore).forEach((key) => { - vueDemi.set(store, key, setupStore[key]); - }); - } - else { - assign(store, setupStore); - // allows retrieving reactive objects with `storeToRefs()`. Must be called after assigning to the reactive object. - // Make `storeToRefs()` work with `reactive()` #799 - assign(vueDemi.toRaw(store), setupStore); - } - // use this instead of a computed with setter to be able to create it anywhere - // without linking the computed lifespan to wherever the store is first - // created. - Object.defineProperty(store, '$state', { - get: () => (pinia.state.value[$id]), - set: (state) => { - $patch(($state) => { - assign($state, state); - }); - }, - }); - /* istanbul ignore if */ - if (vueDemi.isVue2) { - // mark the store as ready before plugins - store._r = true; - } - // apply all plugins - pinia._p.forEach((extender) => { - /* istanbul ignore else */ - { - assign(store, scope.run(() => extender({ - store, - app: pinia._a, - pinia, - options: optionsForPlugin, - }))); - } - }); - // only apply hydrate to option stores with an initial state in pinia - if (initialState && - isOptionsStore && - options.hydrate) { - options.hydrate(store.$state, initialState); - } - isListening = true; - isSyncListening = true; - return store; -} -function defineStore( -// TODO: add proper types from above -idOrOptions, setup, setupOptions) { - let id; - let options; - const isSetupStore = typeof setup === 'function'; - if (typeof idOrOptions === 'string') { - id = idOrOptions; - // the option store setup will contain the actual options in this case - options = isSetupStore ? setupOptions : setup; - } - else { - options = idOrOptions; - id = idOrOptions.id; - } - function useStore(pinia, hot) { - const hasContext = vueDemi.hasInjectionContext(); - pinia = - // in test mode, ignore the argument provided as we can always retrieve a - // pinia instance with getActivePinia() - ((process.env.NODE_ENV === 'test') && activePinia && activePinia._testing ? null : pinia) || - (hasContext ? vueDemi.inject(piniaSymbol, null) : null); - if (pinia) - setActivePinia(pinia); - pinia = activePinia; - if (!pinia._s.has(id)) { - // creating the store registers it in `pinia._s` - if (isSetupStore) { - createSetupStore(id, setup, options, pinia); - } - else { - createOptionsStore(id, options, pinia); - } - } - const store = pinia._s.get(id); - // StoreGeneric cannot be casted towards Store - return store; - } - useStore.$id = id; - return useStore; -} - -let mapStoreSuffix = 'Store'; -/** - * Changes the suffix added by `mapStores()`. Can be set to an empty string. - * Defaults to `"Store"`. Make sure to extend the MapStoresCustomization - * interface if you are using TypeScript. - * - * @param suffix - new suffix - */ -function setMapStoreSuffix(suffix // could be 'Store' but that would be annoying for JS -) { - mapStoreSuffix = suffix; -} -/** - * Allows using stores without the composition API (`setup()`) by generating an - * object to be spread in the `computed` field of a component. It accepts a list - * of store definitions. - * - * @example - * ```js - * export default { - * computed: { - * // other computed properties - * ...mapStores(useUserStore, useCartStore) - * }, - * - * created() { - * this.userStore // store with id "user" - * this.cartStore // store with id "cart" - * } - * } - * ``` - * - * @param stores - list of stores to map to an object - */ -function mapStores(...stores) { - return stores.reduce((reduced, useStore) => { - // @ts-expect-error: $id is added by defineStore - reduced[useStore.$id + mapStoreSuffix] = function () { - return useStore(this.$pinia); - }; - return reduced; - }, {}); -} -/** - * Allows using state and getters from one store without using the composition - * API (`setup()`) by generating an object to be spread in the `computed` field - * of a component. - * - * @param useStore - store to map from - * @param keysOrMapper - array or object - */ -function mapState(useStore, keysOrMapper) { - return Array.isArray(keysOrMapper) - ? keysOrMapper.reduce((reduced, key) => { - reduced[key] = function () { - return useStore(this.$pinia)[key]; - }; - return reduced; - }, {}) - : Object.keys(keysOrMapper).reduce((reduced, key) => { - // @ts-expect-error - reduced[key] = function () { - const store = useStore(this.$pinia); - const storeKey = keysOrMapper[key]; - // for some reason TS is unable to infer the type of storeKey to be a - // function - return typeof storeKey === 'function' - ? storeKey.call(this, store) - : store[storeKey]; - }; - return reduced; - }, {}); -} -/** - * Alias for `mapState()`. You should use `mapState()` instead. - * @deprecated use `mapState()` instead. - */ -const mapGetters = mapState; -/** - * Allows directly using actions from your store without using the composition - * API (`setup()`) by generating an object to be spread in the `methods` field - * of a component. - * - * @param useStore - store to map from - * @param keysOrMapper - array or object - */ -function mapActions(useStore, keysOrMapper) { - return Array.isArray(keysOrMapper) - ? keysOrMapper.reduce((reduced, key) => { - // @ts-expect-error - reduced[key] = function (...args) { - return useStore(this.$pinia)[key](...args); - }; - return reduced; - }, {}) - : Object.keys(keysOrMapper).reduce((reduced, key) => { - // @ts-expect-error - reduced[key] = function (...args) { - return useStore(this.$pinia)[keysOrMapper[key]](...args); - }; - return reduced; - }, {}); -} -/** - * Allows using state and getters from one store without using the composition - * API (`setup()`) by generating an object to be spread in the `computed` field - * of a component. - * - * @param useStore - store to map from - * @param keysOrMapper - array or object - */ -function mapWritableState(useStore, keysOrMapper) { - return Array.isArray(keysOrMapper) - ? keysOrMapper.reduce((reduced, key) => { - // @ts-ignore - reduced[key] = { - get() { - return useStore(this.$pinia)[key]; - }, - set(value) { - // it's easier to type it here as any - return (useStore(this.$pinia)[key] = value); - }, - }; - return reduced; - }, {}) - : Object.keys(keysOrMapper).reduce((reduced, key) => { - // @ts-ignore - reduced[key] = { - get() { - return useStore(this.$pinia)[keysOrMapper[key]]; - }, - set(value) { - // it's easier to type it here as any - return (useStore(this.$pinia)[keysOrMapper[key]] = value); - }, - }; - return reduced; - }, {}); -} - -/** - * Creates an object of references with all the state, getters, and plugin-added - * state properties of the store. Similar to `toRefs()` but specifically - * designed for Pinia stores so methods and non reactive properties are - * completely ignored. - * - * @param store - store to extract the refs from - */ -function storeToRefs(store) { - // See https://github.com/vuejs/pinia/issues/852 - // It's easier to just use toRefs() even if it includes more stuff - if (vueDemi.isVue2) { - // @ts-expect-error: toRefs include methods and others - return vueDemi.toRefs(store); - } - else { - store = vueDemi.toRaw(store); - const refs = {}; - for (const key in store) { - const value = store[key]; - if (vueDemi.isRef(value) || vueDemi.isReactive(value)) { - // @ts-expect-error: the key is state or getter - refs[key] = - // --- - vueDemi.toRef(store, key); - } - } - return refs; - } -} - -/** - * Vue 2 Plugin that must be installed for pinia to work. Note **you don't need - * this plugin if you are using Nuxt.js**. Use the `buildModule` instead: - * https://pinia.vuejs.org/ssr/nuxt.html. - * - * @example - * ```js - * import Vue from 'vue' - * import { PiniaVuePlugin, createPinia } from 'pinia' - * - * Vue.use(PiniaVuePlugin) - * const pinia = createPinia() - * - * new Vue({ - * el: '#app', - * // ... - * pinia, - * }) - * ``` - * - * @param _Vue - `Vue` imported from 'vue'. - */ -const PiniaVuePlugin = function (_Vue) { - // Equivalent of - // app.config.globalProperties.$pinia = pinia - _Vue.mixin({ - beforeCreate() { - const options = this.$options; - if (options.pinia) { - const pinia = options.pinia; - // HACK: taken from provide(): https://github.com/vuejs/composition-api/blob/main/src/apis/inject.ts#L31 - /* istanbul ignore else */ - if (!this._provided) { - const provideCache = {}; - Object.defineProperty(this, '_provided', { - get: () => provideCache, - set: (v) => Object.assign(provideCache, v), - }); - } - this._provided[piniaSymbol] = pinia; - // propagate the pinia instance in an SSR friendly way - // avoid adding it to nuxt twice - /* istanbul ignore else */ - if (!this.$pinia) { - this.$pinia = pinia; - } - pinia._a = this; - if (IS_CLIENT) { - // this allows calling useStore() outside of a component setup after - // installing pinia's plugin - setActivePinia(pinia); - } - } - else if (!this.$pinia && options.parent && options.parent.$pinia) { - this.$pinia = options.parent.$pinia; - } - }, - destroyed() { - delete this._pStores; - }, - }); -}; - -exports.PiniaVuePlugin = PiniaVuePlugin; -exports.acceptHMRUpdate = acceptHMRUpdate; -exports.createPinia = createPinia; -exports.defineStore = defineStore; -exports.getActivePinia = getActivePinia; -exports.mapActions = mapActions; -exports.mapGetters = mapGetters; -exports.mapState = mapState; -exports.mapStores = mapStores; -exports.mapWritableState = mapWritableState; -exports.setActivePinia = setActivePinia; -exports.setMapStoreSuffix = setMapStoreSuffix; -exports.skipHydrate = skipHydrate; -exports.storeToRefs = storeToRefs; diff --git a/node_modules/pinia/index.cjs b/node_modules/pinia/index.cjs deleted file mode 100644 index 9fc1f5c..0000000 --- a/node_modules/pinia/index.cjs +++ /dev/null @@ -1,7 +0,0 @@ -'use strict' - -if (process.env.NODE_ENV === 'production') { - module.exports = require('./dist/pinia.prod.cjs') -} else { - module.exports = require('./dist/pinia.cjs') -} diff --git a/node_modules/pinia/index.js b/node_modules/pinia/index.js deleted file mode 100644 index 9fc1f5c..0000000 --- a/node_modules/pinia/index.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict' - -if (process.env.NODE_ENV === 'production') { - module.exports = require('./dist/pinia.prod.cjs') -} else { - module.exports = require('./dist/pinia.cjs') -} diff --git a/node_modules/pinia/package.json b/node_modules/pinia/package.json deleted file mode 100644 index c13f7f3..0000000 --- a/node_modules/pinia/package.json +++ /dev/null @@ -1,100 +0,0 @@ -{ - "name": "pinia", - "version": "2.1.6", - "description": "Intuitive, type safe and flexible Store for Vue", - "main": "index.js", - "module": "dist/pinia.mjs", - "unpkg": "dist/pinia.iife.js", - "jsdelivr": "dist/pinia.iife.js", - "types": "dist/pinia.d.ts", - "exports": { - ".": { - "types": "./dist/pinia.d.ts", - "node": { - "import": { - "production": "./dist/pinia.prod.cjs", - "development": "./dist/pinia.mjs", - "default": "./dist/pinia.mjs" - }, - "require": { - "production": "./dist/pinia.prod.cjs", - "development": "./dist/pinia.cjs", - "default": "./index.js" - } - }, - "import": "./dist/pinia.mjs", - "require": "./index.js" - }, - "./package.json": "./package.json", - "./dist/*": "./dist/*" - }, - "sideEffects": false, - "author": { - "name": "Eduardo San Martin Morote", - "email": "posva13@gmail.com" - }, - "funding": "https://github.com/sponsors/posva", - "files": [ - "dist/*.js", - "dist/*.mjs", - "dist/*.cjs", - "dist/pinia.d.ts", - "index.js", - "index.cjs", - "LICENSE", - "README.md" - ], - "keywords": [ - "vue", - "vuex", - "store", - "pinia", - "piña", - "pigna", - "composition", - "api", - "setup", - "typed", - "typescript", - "ts", - "type", - "safe" - ], - "license": "MIT", - "devDependencies": { - "@microsoft/api-extractor": "7.34.4", - "@vue/test-utils": "^2.4.0" - }, - "dependencies": { - "@vue/devtools-api": "^6.5.0", - "vue-demi": ">=0.14.5" - }, - "peerDependencies": { - "@vue/composition-api": "^1.4.0", - "typescript": ">=4.4.4", - "vue": "^2.6.14 || ^3.3.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - }, - "@vue/composition-api": { - "optional": true - } - }, - "repository": { - "type": "git", - "url": "git+https://github.com/vuejs/pinia.git" - }, - "bugs": { - "url": "https://github.com/vuejs/pinia/issues" - }, - "homepage": "https://github.com/vuejs/pinia#readme", - "scripts": { - "build": "rimraf dist && rollup -c ../../rollup.config.mjs --environment TARGET:pinia", - "build:dts": "api-extractor run --local --verbose && tail -n +3 ./src/globalExtensions.ts >> dist/pinia.d.ts", - "changelog": "conventional-changelog -p angular -i CHANGELOG.md -s --commit-path . -l pinia -r 1", - "test:dts": "tsc -p ./test-dts/tsconfig.json", - "test": "yarn run build && yarn run build:dts && yarn test:dts" - } -} \ No newline at end of file diff --git a/node_modules/vue-demi/LICENSE b/node_modules/vue-demi/LICENSE deleted file mode 100644 index 894ffaf..0000000 --- a/node_modules/vue-demi/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2020-present, Anthony Fu - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/vue-demi/README.md b/node_modules/vue-demi/README.md deleted file mode 100644 index 4f23e0b..0000000 --- a/node_modules/vue-demi/README.md +++ /dev/null @@ -1,228 +0,0 @@ - - -

-Vue Demi (half in French) is a developing utility
allows you to write Universal Vue Libraries for Vue 2 & 3
-See more details in this blog post -

- -
- -
- -## Strategies - -- `<=2.6`: exports from `vue` + `@vue/composition-api` with plugin auto installing. -- `2.7`: exports from `vue` (Composition API is built-in in Vue 2.7). -- `>=3.0`: exports from `vue`, with polyfill of Vue 2's `set` and `del` API. - -## Usage - -Install this as your plugin's dependency: - -```bash -npm i vue-demi -# or -yarn add vue-demi -# or -pnpm i vue-demi -``` - -Add `vue` and `@vue/composition-api` to your plugin's peer dependencies to specify what versions you support. - -```jsonc -{ - "dependencies": { - "vue-demi": "latest" - }, - "peerDependencies": { - "@vue/composition-api": "^1.0.0-rc.1", - "vue": "^2.0.0 || >=3.0.0" - }, - "peerDependenciesMeta": { - "@vue/composition-api": { - "optional": true - } - }, - "devDependencies": { - "vue": "^3.0.0" // or "^2.6.0" base on your preferred working environment - }, -} -``` - -Import everything related to Vue from it, it will redirect to `vue@2` + `@vue/composition-api` or `vue@3` based on users' environments. - -```ts -import { ref, reactive, defineComponent } from 'vue-demi' -``` - -Publish your plugin and all is done! - -> When using with [Vite](https://vitejs.dev), you will need to opt-out the pre-bundling to get `vue-demi` work properly by -> ```js -> // vite.config.js -> export default defineConfig({ -> optimizeDeps: { -> exclude: ['vue-demi'] -> } -> }) -> ``` - -### Extra APIs - -`Vue Demi` provides extra APIs to help distinguish users' environments and to do some version-specific logic. - -### `isVue2` `isVue3` - -```ts -import { isVue2, isVue3 } from 'vue-demi' - -if (isVue2) { - // Vue 2 only -} else { - // Vue 3 only -} -``` - -### `Vue2` - -To avoid bringing in all the tree-shakable modules, we provide a `Vue2` export to support access to Vue 2's global API. (See [#41](https://github.com/vueuse/vue-demi/issues/41).) - -```ts -import { Vue2 } from 'vue-demi' - -if (Vue2) { - Vue2.config.ignoredElements.push('x-foo') -} -``` - -### `install()` - -Composition API in Vue 2 is provided as a plugin and needs to be installed on the Vue instance before using. Normally, `vue-demi` will try to install it automatically. For some usages where you might need to ensure the plugin gets installed correctly, the `install()` API is exposed to as a safe version of `Vue.use(CompositionAPI)`. `install()` in the Vue 3 environment will be an empty function (no-op). - -```ts -import { install } from 'vue-demi' - -install() -``` - -## CLI - -### Manually Switch Versions - -To explicitly switch the redirecting version, you can use these commands in your project's root. - -```bash -npx vue-demi-switch 2 -# or -npx vue-demi-switch 3 -``` - -### Package Aliasing - -If you would like to import `vue` under an alias, you can use the following command - -```bash -npx vue-demi-switch 2 vue2 -# or -npx vue-demi-switch 3 vue3 -``` - -Then `vue-demi` will redirect APIs from the alias name you specified, for example: - -```ts -import * as Vue from 'vue3' - -var isVue2 = false -var isVue3 = true -var Vue2 = undefined - -export * from 'vue3' -export { - Vue, - Vue2, - isVue2, - isVue3, -} -``` - -### Auto Fix - -If the `postinstall` hook doesn't get triggered or you have updated the Vue version, try to run the following command to resolve the redirecting. - -```bash -npx vue-demi-fix -``` - -### Isomorphic Testings - -You can support testing for both versions by adding npm alias in your dev dependencies. For example: - -```json -{ - "scripts": { - "test:2": "vue-demi-switch 2 vue2 && jest", - "test:3": "vue-demi-switch 3 && jest", - }, - "devDependencies": { - "vue": "^3.0.0", - "vue2": "npm:vue@2" - }, -} -``` - -or - -```json -{ - "scripts": { - "test:2": "vue-demi-switch 2 && jest", - "test:3": "vue-demi-switch 3 vue3 && jest", - }, - "devDependencies": { - "vue": "^2.6.0", - "vue3": "npm:vue@3" - }, -} -``` - -## Examples - -See [examples](./examples). - -## Who is using this? - -- [VueUse](https://github.com/vueuse/vueuse) - Collection of Composition API utils -- [@vue/apollo-composable](https://github.com/vuejs/vue-apollo/tree/v4/packages/vue-apollo-composable) - Apollo GraphQL functions for Vue Composition API -- [vuelidate](https://github.com/vuelidate/vuelidate) - Simple, lightweight model-based validation -- [vue-composition-test-utils](https://github.com/ariesjia/vue-composition-test-utils) - Simple vue composition api unit test utilities -- [vue-use-stripe](https://github.com/frandiox/vue-use-stripe) - Stripe Elements wrapper for Vue.js -- [@opd/g2plot-vue](https://github.com/open-data-plan/g2plot-vue) - G2plot for vue -- [vue-echarts](https://github.com/ecomfe/vue-echarts) - Vue.js component for Apache ECharts. -- [fluent-vue](https://github.com/Demivan/fluent-vue) - Vue.js integration for [Fluent.js](https://github.com/projectfluent/fluent.js) - JavaScript implementation of [Project Fluent](https://projectfluent.org) -- [vue-datatable-url-sync](https://github.com/socotecio/vue-datatable-url-sync) - Synchronize datatable options and filters with the url to keep user preference even after refresh or navigation -- [vue-insta-stories](https://github.com/UnevenSoftware/vue-insta-stories) - Instagram stories in your vue projects. -- [vue-tiny-validate](https://github.com/FrontLabsOfficial/vue-tiny-validate) - Tiny Vue Validate Composition -- [v-perfect-signature](https://github.com/wobsoriano/v-perfect-signature) - Pressure-sensitive signature drawing for Vue 2 and 3 -- [vue-winbox](https://github.com/wobsoriano/vue-winbox) - A wrapper component for WinBox.js that adds the ability to mount Vue components. -- [vue-word-highlighter](https://github.com/kawamataryo/vue-word-highlighter) - The word highlighter library for Vue 2 and Vue 3 -- [vue-chart-3](https://github.com/victorgarciaesgi/vue-chart-3) - Vue.js component for Chart.js -- [json-editor-vue](https://github.com/cloydlau/json-editor-vue) - JSON editor & viewer for Vue 2 and 3. -- [kidar-echarts](https://github.com/kidarjs/kidar-echarts) - A simpler echarts component for Vue 2 and 3. -- [vue3-sketch-ruler](https://github.com/kakajun/vue3-sketch-ruler) - The zoom operation used for page presentation for Vue 2 and 3( Replace render function with template ) -- [vue-rough-notation](https://github.com/Leecason/vue-rough-notation) - RoughNotation wrapper component for Vue 2 and 3. -- [vue-request](https://github.com/AttoJS/vue-request) - Vue composition API for data fetching, supports SWR, polling, error retry, cache request, pagination, etc. -- [vue3-lazyload](https://github.com/murongg/vue3-lazyload) - A vue3.x image lazyload plugin. -- [vue-codemirror6](https://github.com/logue/vue-codemirror6) - CodeMirror6 component for Vue2 and 3. -> open a PR to add your library ;) - -## Underhood - -See [the blog post](https://antfu.me/posts/make-libraries-working-with-vue-2-and-3/#-introducing-vue-demi). - -## License - -MIT License © 2020 [Anthony Fu](https://github.com/antfu) diff --git a/node_modules/vue-demi/bin/vue-demi-fix.js b/node_modules/vue-demi/bin/vue-demi-fix.js deleted file mode 100644 index 684a621..0000000 --- a/node_modules/vue-demi/bin/vue-demi-fix.js +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env node -'use strict' -require('../scripts/postinstall') diff --git a/node_modules/vue-demi/bin/vue-demi-switch.js b/node_modules/vue-demi/bin/vue-demi-switch.js deleted file mode 100644 index 360eada..0000000 --- a/node_modules/vue-demi/bin/vue-demi-switch.js +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env node -'use strict' -require('../scripts/switch-cli') diff --git a/node_modules/vue-demi/lib/index.cjs b/node_modules/vue-demi/lib/index.cjs deleted file mode 100644 index 5f873d2..0000000 --- a/node_modules/vue-demi/lib/index.cjs +++ /dev/null @@ -1,32 +0,0 @@ -var Vue = require('vue') -var VueCompositionAPI = require('@vue/composition-api') - -function install(_vue) { - var vueLib = _vue || Vue - if (vueLib && 'default' in vueLib) { - vueLib = vueLib.default - } - - if (vueLib && !vueLib['__composition_api_installed__']) { - if (VueCompositionAPI && 'default' in VueCompositionAPI) - vueLib.use(VueCompositionAPI.default) - else if (VueCompositionAPI) - vueLib.use(VueCompositionAPI) - } -} - -install(Vue) - -Object.keys(VueCompositionAPI).forEach(function(key) { - exports[key] = VueCompositionAPI[key] -}) - -exports.Vue = Vue -exports.Vue2 = Vue -exports.isVue2 = true -exports.isVue3 = false -exports.install = install -exports.version = Vue.version - -// Not implemented https://github.com/vuejs/core/pull/8111, falls back to getCurrentInstance() -exports.hasInjectionContext = () => !!VueCompositionAPI.getCurrentInstance() diff --git a/node_modules/vue-demi/lib/index.d.ts b/node_modules/vue-demi/lib/index.d.ts deleted file mode 100644 index bbdcbc5..0000000 --- a/node_modules/vue-demi/lib/index.d.ts +++ /dev/null @@ -1,33 +0,0 @@ -import Vue from 'vue' -import type { PluginFunction, PluginObject } from 'vue' -declare const isVue2: boolean -declare const isVue3: boolean -declare const Vue2: typeof Vue | undefined -declare const version: string -declare const install: (vue?: typeof Vue) => void -/** - * @deprecated To avoid bringing in all the tree-shakable modules, this API has been deprecated. Use `Vue2` or named exports instead. - * Refer to https://github.com/vueuse/vue-demi/issues/41 - */ -declare const V: typeof Vue - -/** - * DebuggerEvent is a Vue 3 development only feature. This type cannot exist in Vue 2. - */ -export declare type DebuggerEvent = never - -// accept no generic because Vue 3 doesn't accept any -// https://github.com/vuejs/vue-next/pull/2758/ -export declare type Plugin = PluginObject | PluginFunction -export type { VNode } from 'vue' -export * from '@vue/composition-api' -export { - V as Vue, - Vue2, - isVue2, - isVue3, - version, - install, -} - -export declare function hasInjectionContext(): boolean diff --git a/node_modules/vue-demi/lib/index.iife.js b/node_modules/vue-demi/lib/index.iife.js deleted file mode 100644 index 2179268..0000000 --- a/node_modules/vue-demi/lib/index.iife.js +++ /dev/null @@ -1,115 +0,0 @@ -var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) { - if (VueDemi.install) { - return VueDemi - } - if (!Vue) { - console.error('[vue-demi] no Vue instance found, please be sure to import `vue` before `vue-demi`.') - return VueDemi - } - - // Vue 2.7 - if (Vue.version.slice(0, 4) === '2.7.') { - for (var key in Vue) { - VueDemi[key] = Vue[key] - } - VueDemi.isVue2 = true - VueDemi.isVue3 = false - VueDemi.install = function () {} - VueDemi.Vue = Vue - VueDemi.Vue2 = Vue - VueDemi.version = Vue.version - VueDemi.warn = Vue.util.warn - VueDemi.hasInjectionContext = () => !!VueDemi.getCurrentInstance() - function createApp(rootComponent, rootProps) { - var vm - var provide = {} - var app = { - config: Vue.config, - use: Vue.use.bind(Vue), - mixin: Vue.mixin.bind(Vue), - component: Vue.component.bind(Vue), - provide: function (key, value) { - provide[key] = value - return this - }, - directive: function (name, dir) { - if (dir) { - Vue.directive(name, dir) - return app - } else { - return Vue.directive(name) - } - }, - mount: function (el, hydrating) { - if (!vm) { - vm = new Vue(Object.assign({ propsData: rootProps }, rootComponent, { provide: Object.assign(provide, rootComponent.provide) })) - vm.$mount(el, hydrating) - return vm - } else { - return vm - } - }, - unmount: function () { - if (vm) { - vm.$destroy() - vm = undefined - } - }, - } - return app - } - VueDemi.createApp = createApp - } - // Vue 2.6.x - else if (Vue.version.slice(0, 2) === '2.') { - if (VueCompositionAPI) { - for (var key in VueCompositionAPI) { - VueDemi[key] = VueCompositionAPI[key] - } - VueDemi.isVue2 = true - VueDemi.isVue3 = false - VueDemi.install = function () {} - VueDemi.Vue = Vue - VueDemi.Vue2 = Vue - VueDemi.version = Vue.version - VueDemi.hasInjectionContext = () => !!VueDemi.getCurrentInstance() - } else { - console.error('[vue-demi] no VueCompositionAPI instance found, please be sure to import `@vue/composition-api` before `vue-demi`.') - } - } - // Vue 3 - else if (Vue.version.slice(0, 2) === '3.') { - for (var key in Vue) { - VueDemi[key] = Vue[key] - } - VueDemi.isVue2 = false - VueDemi.isVue3 = true - VueDemi.install = function () {} - VueDemi.Vue = Vue - VueDemi.Vue2 = undefined - VueDemi.version = Vue.version - VueDemi.set = function (target, key, val) { - if (Array.isArray(target)) { - target.length = Math.max(target.length, key) - target.splice(key, 1, val) - return val - } - target[key] = val - return val - } - VueDemi.del = function (target, key) { - if (Array.isArray(target)) { - target.splice(key, 1) - return - } - delete target[key] - } - } else { - console.error('[vue-demi] Vue version ' + Vue.version + ' is unsupported.') - } - return VueDemi -})( - (this.VueDemi = this.VueDemi || (typeof VueDemi !== 'undefined' ? VueDemi : {})), - this.Vue || (typeof Vue !== 'undefined' ? Vue : undefined), - this.VueCompositionAPI || (typeof VueCompositionAPI !== 'undefined' ? VueCompositionAPI : undefined) -); diff --git a/node_modules/vue-demi/lib/index.mjs b/node_modules/vue-demi/lib/index.mjs deleted file mode 100644 index 2c18122..0000000 --- a/node_modules/vue-demi/lib/index.mjs +++ /dev/null @@ -1,49 +0,0 @@ -import Vue from 'vue' -import VueCompositionAPI, { getCurrentInstance } from '@vue/composition-api/dist/vue-composition-api.mjs' - -function install(_vue) { - _vue = _vue || Vue - if (_vue && !_vue['__composition_api_installed__']) - _vue.use(VueCompositionAPI) -} - -install(Vue) - -var isVue2 = true -var isVue3 = false -var Vue2 = Vue -var version = Vue.version - -/**VCA-EXPORTS**/ -export * from '@vue/composition-api/dist/vue-composition-api.mjs' -/**VCA-EXPORTS**/ - -export { - Vue, - Vue2, - isVue2, - isVue3, - version, - install, -} - - -// Vue 3 components mock -function createMockComponent(name) { - return { - setup() { - throw new Error('[vue-demi] ' + name + ' is not supported in Vue 2. It\'s provided to avoid compiler errors.') - } - } -} -export var Fragment = /*#__PURE__*/ createMockComponent('Fragment') -export var Transition = /*#__PURE__*/ createMockComponent('Transition') -export var TransitionGroup = /*#__PURE__*/ createMockComponent('TransitionGroup') -export var Teleport = /*#__PURE__*/ createMockComponent('Teleport') -export var Suspense = /*#__PURE__*/ createMockComponent('Suspense') -export var KeepAlive = /*#__PURE__*/ createMockComponent('KeepAlive') - -// Not implemented https://github.com/vuejs/core/pull/8111, falls back to getCurrentInstance() -export function hasInjectionContext() { - return !!getCurrentInstance() -} diff --git a/node_modules/vue-demi/lib/v2.7/index.cjs b/node_modules/vue-demi/lib/v2.7/index.cjs deleted file mode 100644 index 1dce010..0000000 --- a/node_modules/vue-demi/lib/v2.7/index.cjs +++ /dev/null @@ -1,58 +0,0 @@ -var VueModule = require('vue') - -// get the real Vue https://github.com/vueuse/vue-demi/issues/192 -var Vue = VueModule.default || VueModule - -exports.Vue = Vue -exports.Vue2 = Vue -exports.isVue2 = true -exports.isVue3 = false -exports.install = function () {} -exports.warn = Vue.util.warn - -// createApp polyfill -exports.createApp = function (rootComponent, rootProps) { - var vm - var provide = {} - var app = { - config: Vue.config, - use: Vue.use.bind(Vue), - mixin: Vue.mixin.bind(Vue), - component: Vue.component.bind(Vue), - provide: function (key, value) { - provide[key] = value - return this - }, - directive: function (name, dir) { - if (dir) { - Vue.directive(name, dir) - return app - } else { - return Vue.directive(name) - } - }, - mount: function (el, hydrating) { - if (!vm) { - vm = new Vue(Object.assign({ propsData: rootProps }, rootComponent, { provide: Object.assign(provide, rootComponent.provide) })) - vm.$mount(el, hydrating) - return vm - } else { - return vm - } - }, - unmount: function () { - if (vm) { - vm.$destroy() - vm = undefined - } - }, - } - return app -} - -Object.keys(VueModule).forEach(function (key) { - exports[key] = VueModule[key] -}) - -// Not implemented https://github.com/vuejs/core/pull/8111, falls back to getCurrentInstance() -exports.hasInjectionContext = () => !!VueModule.getCurrentInstance() diff --git a/node_modules/vue-demi/lib/v2.7/index.d.ts b/node_modules/vue-demi/lib/v2.7/index.d.ts deleted file mode 100644 index 827c7b2..0000000 --- a/node_modules/vue-demi/lib/v2.7/index.d.ts +++ /dev/null @@ -1,38 +0,0 @@ -import Vue from 'vue' -import type { PluginFunction, PluginObject, VueConstructor, Directive, InjectionKey, Component } from 'vue' - -declare const isVue2: boolean -declare const isVue3: boolean -declare const Vue2: typeof Vue | undefined -declare const version: string -declare const install: (vue?: typeof Vue) => void -export declare function warn(msg: string, vm?: Component | null): void -/** - * @deprecated To avoid bringing in all the tree-shakable modules, this API has been deprecated. Use `Vue2` or named exports instead. - * Refer to https://github.com/vueuse/vue-demi/issues/41 - */ -declare const V: typeof Vue - -// accept no generic because Vue 3 doesn't accept any -// https://github.com/vuejs/vue-next/pull/2758/ -export declare type Plugin = PluginObject | PluginFunction -export type { VNode } from 'vue' -export * from 'vue' -export { V as Vue, Vue2, isVue2, isVue3, version, install } - -// #region createApp polyfill -export interface App { - config: VueConstructor['config'] - use: VueConstructor['use'] - mixin: VueConstructor['mixin'] - component: VueConstructor['component'] - directive(name: string): Directive | undefined - directive(name: string, directive: Directive): this - provide(key: InjectionKey | string, value: T): this - mount: Vue['$mount'] - unmount: Vue['$destroy'] -} -export declare function createApp(rootComponent: any, rootProps?: any): App -// #endregion - -export declare function hasInjectionContext(): boolean diff --git a/node_modules/vue-demi/lib/v2.7/index.mjs b/node_modules/vue-demi/lib/v2.7/index.mjs deleted file mode 100644 index e575059..0000000 --- a/node_modules/vue-demi/lib/v2.7/index.mjs +++ /dev/null @@ -1,80 +0,0 @@ -import Vue from 'vue' -import { getCurrentInstance } from 'vue' - -var isVue2 = true -var isVue3 = false -var Vue2 = Vue -var warn = Vue.util.warn - -function install() {} - -// createApp polyfill -export function createApp(rootComponent, rootProps) { - var vm - var provide = {} - var app = { - config: Vue.config, - use: Vue.use.bind(Vue), - mixin: Vue.mixin.bind(Vue), - component: Vue.component.bind(Vue), - provide: function (key, value) { - provide[key] = value - return this - }, - directive: function (name, dir) { - if (dir) { - Vue.directive(name, dir) - return app - } else { - return Vue.directive(name) - } - }, - mount: function (el, hydrating) { - if (!vm) { - vm = new Vue(Object.assign({ propsData: rootProps }, rootComponent, { provide: Object.assign(provide, rootComponent.provide) })) - vm.$mount(el, hydrating) - return vm - } else { - return vm - } - }, - unmount: function () { - if (vm) { - vm.$destroy() - vm = undefined - } - }, - } - return app -} - -export { - Vue, - Vue2, - isVue2, - isVue3, - install, - warn -} - -// Vue 3 components mock -function createMockComponent(name) { - return { - setup() { - throw new Error('[vue-demi] ' + name + ' is not supported in Vue 2. It\'s provided to avoid compiler errors.') - } - } -} -export var Fragment = /*#__PURE__*/ createMockComponent('Fragment') -export var Transition = /*#__PURE__*/ createMockComponent('Transition') -export var TransitionGroup = /*#__PURE__*/ createMockComponent('TransitionGroup') -export var Teleport = /*#__PURE__*/ createMockComponent('Teleport') -export var Suspense = /*#__PURE__*/ createMockComponent('Suspense') -export var KeepAlive = /*#__PURE__*/ createMockComponent('KeepAlive') - -export * from 'vue' - -// Not implemented https://github.com/vuejs/core/pull/8111, falls back to getCurrentInstance() -export function hasInjectionContext() { - return !!getCurrentInstance() -} diff --git a/node_modules/vue-demi/lib/v2/index.cjs b/node_modules/vue-demi/lib/v2/index.cjs deleted file mode 100644 index 5f873d2..0000000 --- a/node_modules/vue-demi/lib/v2/index.cjs +++ /dev/null @@ -1,32 +0,0 @@ -var Vue = require('vue') -var VueCompositionAPI = require('@vue/composition-api') - -function install(_vue) { - var vueLib = _vue || Vue - if (vueLib && 'default' in vueLib) { - vueLib = vueLib.default - } - - if (vueLib && !vueLib['__composition_api_installed__']) { - if (VueCompositionAPI && 'default' in VueCompositionAPI) - vueLib.use(VueCompositionAPI.default) - else if (VueCompositionAPI) - vueLib.use(VueCompositionAPI) - } -} - -install(Vue) - -Object.keys(VueCompositionAPI).forEach(function(key) { - exports[key] = VueCompositionAPI[key] -}) - -exports.Vue = Vue -exports.Vue2 = Vue -exports.isVue2 = true -exports.isVue3 = false -exports.install = install -exports.version = Vue.version - -// Not implemented https://github.com/vuejs/core/pull/8111, falls back to getCurrentInstance() -exports.hasInjectionContext = () => !!VueCompositionAPI.getCurrentInstance() diff --git a/node_modules/vue-demi/lib/v2/index.d.ts b/node_modules/vue-demi/lib/v2/index.d.ts deleted file mode 100644 index bbdcbc5..0000000 --- a/node_modules/vue-demi/lib/v2/index.d.ts +++ /dev/null @@ -1,33 +0,0 @@ -import Vue from 'vue' -import type { PluginFunction, PluginObject } from 'vue' -declare const isVue2: boolean -declare const isVue3: boolean -declare const Vue2: typeof Vue | undefined -declare const version: string -declare const install: (vue?: typeof Vue) => void -/** - * @deprecated To avoid bringing in all the tree-shakable modules, this API has been deprecated. Use `Vue2` or named exports instead. - * Refer to https://github.com/vueuse/vue-demi/issues/41 - */ -declare const V: typeof Vue - -/** - * DebuggerEvent is a Vue 3 development only feature. This type cannot exist in Vue 2. - */ -export declare type DebuggerEvent = never - -// accept no generic because Vue 3 doesn't accept any -// https://github.com/vuejs/vue-next/pull/2758/ -export declare type Plugin = PluginObject | PluginFunction -export type { VNode } from 'vue' -export * from '@vue/composition-api' -export { - V as Vue, - Vue2, - isVue2, - isVue3, - version, - install, -} - -export declare function hasInjectionContext(): boolean diff --git a/node_modules/vue-demi/lib/v2/index.mjs b/node_modules/vue-demi/lib/v2/index.mjs deleted file mode 100644 index 2c18122..0000000 --- a/node_modules/vue-demi/lib/v2/index.mjs +++ /dev/null @@ -1,49 +0,0 @@ -import Vue from 'vue' -import VueCompositionAPI, { getCurrentInstance } from '@vue/composition-api/dist/vue-composition-api.mjs' - -function install(_vue) { - _vue = _vue || Vue - if (_vue && !_vue['__composition_api_installed__']) - _vue.use(VueCompositionAPI) -} - -install(Vue) - -var isVue2 = true -var isVue3 = false -var Vue2 = Vue -var version = Vue.version - -/**VCA-EXPORTS**/ -export * from '@vue/composition-api/dist/vue-composition-api.mjs' -/**VCA-EXPORTS**/ - -export { - Vue, - Vue2, - isVue2, - isVue3, - version, - install, -} - - -// Vue 3 components mock -function createMockComponent(name) { - return { - setup() { - throw new Error('[vue-demi] ' + name + ' is not supported in Vue 2. It\'s provided to avoid compiler errors.') - } - } -} -export var Fragment = /*#__PURE__*/ createMockComponent('Fragment') -export var Transition = /*#__PURE__*/ createMockComponent('Transition') -export var TransitionGroup = /*#__PURE__*/ createMockComponent('TransitionGroup') -export var Teleport = /*#__PURE__*/ createMockComponent('Teleport') -export var Suspense = /*#__PURE__*/ createMockComponent('Suspense') -export var KeepAlive = /*#__PURE__*/ createMockComponent('KeepAlive') - -// Not implemented https://github.com/vuejs/core/pull/8111, falls back to getCurrentInstance() -export function hasInjectionContext() { - return !!getCurrentInstance() -} diff --git a/node_modules/vue-demi/lib/v3/index.cjs b/node_modules/vue-demi/lib/v3/index.cjs deleted file mode 100644 index 8197f90..0000000 --- a/node_modules/vue-demi/lib/v3/index.cjs +++ /dev/null @@ -1,29 +0,0 @@ -var Vue = require('vue') - -Object.keys(Vue).forEach(function(key) { - exports[key] = Vue[key] -}) - -exports.set = function(target, key, val) { - if (Array.isArray(target)) { - target.length = Math.max(target.length, key) - target.splice(key, 1, val) - return val - } - target[key] = val - return val -} - -exports.del = function(target, key) { - if (Array.isArray(target)) { - target.splice(key, 1) - return - } - delete target[key] -} - -exports.Vue = Vue -exports.Vue2 = undefined -exports.isVue2 = false -exports.isVue3 = true -exports.install = function(){} diff --git a/node_modules/vue-demi/lib/v3/index.d.ts b/node_modules/vue-demi/lib/v3/index.d.ts deleted file mode 100644 index 897b4c5..0000000 --- a/node_modules/vue-demi/lib/v3/index.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -import * as Vue from 'vue' -declare const isVue2: boolean -declare const isVue3: boolean -declare const Vue2: any -declare const install: (vue?: any) => void -/** - * @deprecated To avoid bringing in all the tree-shakable modules, this API has been deprecated. Use `Vue2` or named exports instead. - * Refer to https://github.com/vueuse/vue-demi/issues/41 - */ -declare const V: typeof Vue - -export function set(target: any, key: any, val: T): T -export function del(target: any, key: any): void - -export * from 'vue' -export { - V as Vue, - Vue2, - isVue2, - isVue3, - install, -} diff --git a/node_modules/vue-demi/lib/v3/index.mjs b/node_modules/vue-demi/lib/v3/index.mjs deleted file mode 100644 index be3a96d..0000000 --- a/node_modules/vue-demi/lib/v3/index.mjs +++ /dev/null @@ -1,34 +0,0 @@ -import * as Vue from 'vue' - -var isVue2 = false -var isVue3 = true -var Vue2 = undefined - -function install() {} - -export function set(target, key, val) { - if (Array.isArray(target)) { - target.length = Math.max(target.length, key) - target.splice(key, 1, val) - return val - } - target[key] = val - return val -} - -export function del(target, key) { - if (Array.isArray(target)) { - target.splice(key, 1) - return - } - delete target[key] -} - -export * from 'vue' -export { - Vue, - Vue2, - isVue2, - isVue3, - install, -} diff --git a/node_modules/vue-demi/package.json b/node_modules/vue-demi/package.json deleted file mode 100644 index 27e4dfc..0000000 --- a/node_modules/vue-demi/package.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "name": "vue-demi", - "version": "0.14.6", - "engines": { - "node": ">=12" - }, - "repository": "https://github.com/antfu/vue-demi.git", - "funding": "https://github.com/sponsors/antfu", - "license": "MIT", - "author": "Anthony Fu ", - "main": "lib/index.cjs", - "jsdelivr": "lib/index.iife.js", - "unpkg": "lib/index.iife.js", - "module": "lib/index.mjs", - "types": "lib/index.d.ts", - "exports": { - ".": { - "types": "./lib/index.d.ts", - "require": "./lib/index.cjs", - "import": "./lib/index.mjs", - "browser": "./lib/index.mjs" - }, - "./*": "./*" - }, - "bin": { - "vue-demi-fix": "bin/vue-demi-fix.js", - "vue-demi-switch": "bin/vue-demi-switch.js" - }, - "files": [ - "lib", - "bin", - "scripts" - ], - "scripts": { - "postinstall": "node ./scripts/postinstall.js", - "release": "npx bumpp --tag --commit --push && npm publish" - }, - "peerDependencies": { - "@vue/composition-api": "^1.0.0-rc.1", - "vue": "^3.0.0-0 || ^2.6.0" - }, - "peerDependenciesMeta": { - "@vue/composition-api": { - "optional": true - } - } -} diff --git a/node_modules/vue-demi/scripts/postinstall.js b/node_modules/vue-demi/scripts/postinstall.js deleted file mode 100644 index 62484ec..0000000 --- a/node_modules/vue-demi/scripts/postinstall.js +++ /dev/null @@ -1,19 +0,0 @@ -const { switchVersion, loadModule } = require('./utils') - -const Vue = loadModule('vue') - -if (!Vue || typeof Vue.version !== 'string') { - console.warn('[vue-demi] Vue is not found. Please run "npm install vue" to install.') -} -else if (Vue.version.startsWith('2.7.')) { - switchVersion(2.7) -} -else if (Vue.version.startsWith('2.')) { - switchVersion(2) -} -else if (Vue.version.startsWith('3.')) { - switchVersion(3) -} -else { - console.warn(`[vue-demi] Vue version v${Vue.version} is not suppported.`) -} diff --git a/node_modules/vue-demi/scripts/switch-cli.js b/node_modules/vue-demi/scripts/switch-cli.js deleted file mode 100644 index 3c104ca..0000000 --- a/node_modules/vue-demi/scripts/switch-cli.js +++ /dev/null @@ -1,18 +0,0 @@ -const { switchVersion } = require('./utils') - -const version = process.argv[2] -const vueEntry = process.argv[3] || 'vue' - -if (version === '2.7') { - switchVersion(2.7, vueEntry) - console.log(`[vue-demi] Switched for Vue 2.7 (entry: "${vueEntry}")`) -} else if (version === '2') { - switchVersion(2, vueEntry) - console.log(`[vue-demi] Switched for Vue 2 (entry: "${vueEntry}")`) -} else if (version === '3') { - switchVersion(3, vueEntry) - console.log(`[vue-demi] Switched for Vue 3 (entry: "${vueEntry}")`) -} else { - console.warn(`[vue-demi] expecting version "2" or "2.7" or "3" but got "${version}"`) - process.exit(1) -} diff --git a/node_modules/vue-demi/scripts/utils.js b/node_modules/vue-demi/scripts/utils.js deleted file mode 100644 index eff99f0..0000000 --- a/node_modules/vue-demi/scripts/utils.js +++ /dev/null @@ -1,62 +0,0 @@ -const fs = require('fs') -const path = require('path') - -const dir = path.resolve(__dirname, '..', 'lib') - -function loadModule(name) { - try { - return require(name) - } catch (e) { - return undefined - } -} - -function copy(name, version, vue) { - vue = vue || 'vue' - const src = path.join(dir, `v${version}`, name) - const dest = path.join(dir, name) - let content = fs.readFileSync(src, 'utf-8') - content = content.replace(/'vue'/g, `'${vue}'`) - // unlink for pnpm, #92 - try { - fs.unlinkSync(dest) - } catch (error) { } - fs.writeFileSync(dest, content, 'utf-8') -} - -function updateVue2API() { - const ignoreList = ['version', 'default'] - const VCA = loadModule('@vue/composition-api') - if (!VCA) { - console.warn('[vue-demi] Composition API plugin is not found. Please run "npm install @vue/composition-api" to install.') - return - } - - const exports = Object.keys(VCA).filter(i => !ignoreList.includes(i)) - - const esmPath = path.join(dir, 'index.mjs') - let content = fs.readFileSync(esmPath, 'utf-8') - - content = content.replace( - /\/\*\*VCA-EXPORTS\*\*\/[\s\S]+\/\*\*VCA-EXPORTS\*\*\//m, -`/**VCA-EXPORTS**/ -export { ${exports.join(', ')} } from '@vue/composition-api/dist/vue-composition-api.mjs' -/**VCA-EXPORTS**/` - ) - - fs.writeFileSync(esmPath, content, 'utf-8') - -} - -function switchVersion(version, vue) { - copy('index.cjs', version, vue) - copy('index.mjs', version, vue) - copy('index.d.ts', version, vue) - - if (version === 2) - updateVue2API() -} - - -module.exports.loadModule = loadModule -module.exports.switchVersion = switchVersion diff --git a/node_modules/vue/LICENSE b/node_modules/vue/LICENSE deleted file mode 100644 index b65dd9e..0000000 --- a/node_modules/vue/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2013-present, Yuxi (Evan) You - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/vue/README.md b/node_modules/vue/README.md deleted file mode 100644 index 862d58f..0000000 --- a/node_modules/vue/README.md +++ /dev/null @@ -1,386 +0,0 @@ -

Vue logo

- -

- Build Status - Coverage Status - Downloads - Version - License - Chat -
- Build Status -

- -

Supporting Vue.js

- -Vue.js is an MIT-licensed open source project with its ongoing development made possible entirely by the support of these awesome [backers](https://github.com/vuejs/vue/blob/dev/BACKERS.md). If you'd like to join them, please consider: - -- [Become a backer or sponsor on Patreon](https://www.patreon.com/evanyou). -- [Become a backer or sponsor on Open Collective](https://opencollective.com/vuejs). -- [One-time donation via PayPal or crypto-currencies](https://vuejs.org/support-vuejs/#One-time-Donations). - -#### What's the difference between Patreon and OpenCollective? - -Funds donated via Patreon go directly to support Evan You's full-time work on Vue.js. Funds donated via OpenCollective are managed with transparent expenses and will be used for compensating work and expenses for core team members or sponsoring community events. Your name/logo will receive proper recognition and exposure by donating on either platform. - -

Special Sponsors

- - -

- - - -

- - - -

Platinum Sponsors

- - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- - - - - - - - - - - -
- - - -

Platinum Sponsors (China)

- - - - - - -
- - - -
- - -

Gold Sponsors

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - -
- - -

Sponsors via Open Collective

- -

Platinum

- - - - -

Gold

- - - - - - - - - - - - ---- - -## Introduction - -Vue (pronounced `/vjuː/`, like view) is a **progressive framework** for building user interfaces. It is designed from the ground up to be incrementally adoptable, and can easily scale between a library and a framework depending on different use cases. It consists of an approachable core library that focuses on the view layer only, and an ecosystem of supporting libraries that helps you tackle complexity in large Single-Page Applications. - -#### Browser Compatibility - -Vue.js supports all browsers that are [ES5-compliant](https://kangax.github.io/compat-table/es5/) (IE8 and below are not supported). - -## Ecosystem - -| Project | Status | Description | -|---------|--------|-------------| -| [vue-router] | [![vue-router-status]][vue-router-package] | Single-page application routing | -| [vuex] | [![vuex-status]][vuex-package] | Large-scale state management | -| [vue-cli] | [![vue-cli-status]][vue-cli-package] | Project scaffolding | -| [vue-loader] | [![vue-loader-status]][vue-loader-package] | Single File Component (`*.vue` file) loader for webpack | -| [vue-server-renderer] | [![vue-server-renderer-status]][vue-server-renderer-package] | Server-side rendering support | -| [vue-class-component] | [![vue-class-component-status]][vue-class-component-package] | TypeScript decorator for a class-based API | -| [vue-rx] | [![vue-rx-status]][vue-rx-package] | RxJS integration | -| [vue-devtools] | [![vue-devtools-status]][vue-devtools-package] | Browser DevTools extension | - -[vue-router]: https://github.com/vuejs/vue-router -[vuex]: https://github.com/vuejs/vuex -[vue-cli]: https://github.com/vuejs/vue-cli -[vue-loader]: https://github.com/vuejs/vue-loader -[vue-server-renderer]: https://github.com/vuejs/vue/tree/dev/packages/vue-server-renderer -[vue-class-component]: https://github.com/vuejs/vue-class-component -[vue-rx]: https://github.com/vuejs/vue-rx -[vue-devtools]: https://github.com/vuejs/vue-devtools - -[vue-router-status]: https://img.shields.io/npm/v/vue-router.svg -[vuex-status]: https://img.shields.io/npm/v/vuex.svg -[vue-cli-status]: https://img.shields.io/npm/v/@vue/cli.svg -[vue-loader-status]: https://img.shields.io/npm/v/vue-loader.svg -[vue-server-renderer-status]: https://img.shields.io/npm/v/vue-server-renderer.svg -[vue-class-component-status]: https://img.shields.io/npm/v/vue-class-component.svg -[vue-rx-status]: https://img.shields.io/npm/v/vue-rx.svg -[vue-devtools-status]: https://img.shields.io/chrome-web-store/v/nhdogjmejiglipccpnnnanhbledajbpd.svg - -[vue-router-package]: https://npmjs.com/package/vue-router -[vuex-package]: https://npmjs.com/package/vuex -[vue-cli-package]: https://npmjs.com/package/@vue/cli -[vue-loader-package]: https://npmjs.com/package/vue-loader -[vue-server-renderer-package]: https://npmjs.com/package/vue-server-renderer -[vue-class-component-package]: https://npmjs.com/package/vue-class-component -[vue-rx-package]: https://npmjs.com/package/vue-rx -[vue-devtools-package]: https://chrome.google.com/webstore/detail/vuejs-devtools/nhdogjmejiglipccpnnnanhbledajbpd - -## Documentation - -To check out [live examples](https://vuejs.org/v2/examples/) and docs, visit [vuejs.org](https://vuejs.org). - -## Questions - -For questions and support please use [the official forum](https://forum.vuejs.org) or [community chat](https://chat.vuejs.org/). The issue list of this repo is **exclusively** for bug reports and feature requests. - -## Issues - -Please make sure to read the [Issue Reporting Checklist](https://github.com/vuejs/vue/blob/dev/.github/CONTRIBUTING.md#issue-reporting-guidelines) before opening an issue. Issues not conforming to the guidelines may be closed immediately. - -## Changelog - -Detailed changes for each release are documented in the [release notes](https://github.com/vuejs/vue/releases). - -## Stay In Touch - -- [Twitter](https://twitter.com/vuejs) -- [Blog](https://medium.com/the-vue-point) -- [Job Board](https://vuejobs.com/?ref=vuejs) - -## Contribution - -Please make sure to read the [Contributing Guide](https://github.com/vuejs/vue/blob/dev/.github/CONTRIBUTING.md) before making a pull request. If you have a Vue-related project/component/tool, add it with a pull request to [this curated list](https://github.com/vuejs/awesome-vue)! - -Thank you to all the people who already contributed to Vue! - - - - -## License - -[MIT](https://opensource.org/licenses/MIT) - -Copyright (c) 2013-present, Yuxi (Evan) You diff --git a/node_modules/vue/dist/README.md b/node_modules/vue/dist/README.md deleted file mode 100644 index 19386ec..0000000 --- a/node_modules/vue/dist/README.md +++ /dev/null @@ -1,122 +0,0 @@ -## Explanation of Build Files - -| | UMD | CommonJS | ES Module | -| --- | --- | --- | --- | -| **Full** | vue.js | vue.common.js | vue.esm.js | -| **Runtime-only** | vue.runtime.js | vue.runtime.common.js | vue.runtime.esm.js | -| **Full (production)** | vue.min.js | | | -| **Runtime-only (production)** | vue.runtime.min.js | | | - -### Terms - -- **Full**: builds that contain both the compiler and the runtime. - -- **Compiler**: code that is responsible for compiling template strings into JavaScript render functions. - -- **Runtime**: code that is responsible for creating Vue instances, rendering and patching virtual DOM, etc. Basically everything minus the compiler. - -- **[UMD](https://github.com/umdjs/umd)**: UMD builds can be used directly in the browser via a `` - : '' - } - - renderScripts (context: Object): string { - if (this.clientManifest) { - const initial = this.preloadFiles.filter(({ file }) => isJS(file)) - const async = (this.getUsedAsyncFiles(context) || []).filter(({ file }) => isJS(file)) - const needed = [initial[0]].concat(async, initial.slice(1)) - return needed.map(({ file }) => { - return `` - }).join('') - } else { - return '' - } - } - - getUsedAsyncFiles (context: Object): ?Array { - if (!context._mappedFiles && context._registeredComponents && this.mapFiles) { - const registered = Array.from(context._registeredComponents) - context._mappedFiles = this.mapFiles(registered).map(normalizeFile) - } - return context._mappedFiles - } - - // create a transform stream - createStream (context: ?Object): TemplateStream { - if (!this.parsedTemplate) { - throw new Error('createStream cannot be called without a template.') - } - return new TemplateStream(this, this.parsedTemplate, context || {}) - } -} - -function normalizeFile (file: string): Resource { - const withoutQuery = file.replace(/\?.*/, '') - const extension = path.extname(withoutQuery).slice(1) - return { - file, - extension, - fileWithoutQuery: withoutQuery, - asType: getPreloadType(extension) - } -} - -function getPreloadType (ext: string): string { - if (ext === 'js') { - return 'script' - } else if (ext === 'css') { - return 'style' - } else if (/jpe?g|png|svg|gif|webp|ico/.test(ext)) { - return 'image' - } else if (/woff2?|ttf|otf|eot/.test(ext)) { - return 'font' - } else { - // not exhausting all possibilities here, but above covers common cases - return '' - } -} diff --git a/node_modules/vue/src/server/template-renderer/parse-template.js b/node_modules/vue/src/server/template-renderer/parse-template.js deleted file mode 100644 index 1ccfe89..0000000 --- a/node_modules/vue/src/server/template-renderer/parse-template.js +++ /dev/null @@ -1,42 +0,0 @@ -/* @flow */ - -const compile = require('lodash.template') -const compileOptions = { - escape: /{{([^{][\s\S]+?[^}])}}/g, - interpolate: /{{{([\s\S]+?)}}}/g -} - -export type ParsedTemplate = { - head: (data: any) => string; - neck: (data: any) => string; - tail: (data: any) => string; -}; - -export function parseTemplate ( - template: string, - contentPlaceholder?: string = '' -): ParsedTemplate { - if (typeof template === 'object') { - return template - } - - let i = template.indexOf('') - const j = template.indexOf(contentPlaceholder) - - if (j < 0) { - throw new Error(`Content placeholder not found in template.`) - } - - if (i < 0) { - i = template.indexOf('') - if (i < 0) { - i = j - } - } - - return { - head: compile(template.slice(0, i), compileOptions), - neck: compile(template.slice(i, j), compileOptions), - tail: compile(template.slice(j + contentPlaceholder.length), compileOptions) - } -} diff --git a/node_modules/vue/src/server/template-renderer/template-stream.js b/node_modules/vue/src/server/template-renderer/template-stream.js deleted file mode 100644 index ed4db78..0000000 --- a/node_modules/vue/src/server/template-renderer/template-stream.js +++ /dev/null @@ -1,82 +0,0 @@ -/* @flow */ - -const Transform = require('stream').Transform -import type TemplateRenderer from './index' -import type { ParsedTemplate } from './parse-template' - -export default class TemplateStream extends Transform { - started: boolean; - renderer: TemplateRenderer; - template: ParsedTemplate; - context: Object; - inject: boolean; - - constructor ( - renderer: TemplateRenderer, - template: ParsedTemplate, - context: Object - ) { - super() - this.started = false - this.renderer = renderer - this.template = template - this.context = context || {} - this.inject = renderer.inject - } - - _transform (data: Buffer | string, encoding: string, done: Function) { - if (!this.started) { - this.emit('beforeStart') - this.start() - } - this.push(data) - done() - } - - start () { - this.started = true - this.push(this.template.head(this.context)) - - if (this.inject) { - // inline server-rendered head meta information - if (this.context.head) { - this.push(this.context.head) - } - - // inline preload/prefetch directives for initial/async chunks - const links = this.renderer.renderResourceHints(this.context) - if (links) { - this.push(links) - } - - // CSS files and inline server-rendered CSS collected by vue-style-loader - const styles = this.renderer.renderStyles(this.context) - if (styles) { - this.push(styles) - } - } - - this.push(this.template.neck(this.context)) - } - - _flush (done: Function) { - this.emit('beforeEnd') - - if (this.inject) { - // inline initial store state - const state = this.renderer.renderState(this.context) - if (state) { - this.push(state) - } - - // embed scripts needed - const scripts = this.renderer.renderScripts(this.context) - if (scripts) { - this.push(scripts) - } - } - - this.push(this.template.tail(this.context)) - done() - } -} diff --git a/node_modules/vue/src/server/util.js b/node_modules/vue/src/server/util.js deleted file mode 100644 index 908f8c9..0000000 --- a/node_modules/vue/src/server/util.js +++ /dev/null @@ -1,18 +0,0 @@ -/* @flow */ - -export const isJS = (file: string): boolean => /\.js(\?[^.]+)?$/.test(file) - -export const isCSS = (file: string): boolean => /\.css(\?[^.]+)?$/.test(file) - -export function createPromiseCallback () { - let resolve, reject - const promise: Promise = new Promise((_resolve, _reject) => { - resolve = _resolve - reject = _reject - }) - const cb = (err: Error, res?: string) => { - if (err) return reject(err) - resolve(res || '') - } - return { promise, cb } -} diff --git a/node_modules/vue/src/server/webpack-plugin/client.js b/node_modules/vue/src/server/webpack-plugin/client.js deleted file mode 100644 index ec7b875..0000000 --- a/node_modules/vue/src/server/webpack-plugin/client.js +++ /dev/null @@ -1,67 +0,0 @@ -const hash = require('hash-sum') -const uniq = require('lodash.uniq') -import { isJS, isCSS, getAssetName, onEmit, stripModuleIdHash } from './util' - -export default class VueSSRClientPlugin { - constructor (options = {}) { - this.options = Object.assign({ - filename: 'vue-ssr-client-manifest.json' - }, options) - } - - apply (compiler) { - const stage = 'PROCESS_ASSETS_STAGE_ADDITIONAL' - onEmit(compiler, 'vue-client-plugin', stage, (compilation, cb) => { - const stats = compilation.getStats().toJson() - - const allFiles = uniq(stats.assets - .map(a => a.name)) - - const initialFiles = uniq(Object.keys(stats.entrypoints) - .map(name => stats.entrypoints[name].assets) - .reduce((assets, all) => all.concat(assets), []) - .map(getAssetName) - .filter((file) => isJS(file) || isCSS(file))) - - const asyncFiles = allFiles - .filter((file) => isJS(file) || isCSS(file)) - .filter(file => initialFiles.indexOf(file) < 0) - - const manifest = { - publicPath: stats.publicPath, - all: allFiles, - initial: initialFiles, - async: asyncFiles, - modules: { /* [identifier: string]: Array */ } - } - - const assetModules = stats.modules.filter(m => m.assets.length) - const fileToIndex = asset => manifest.all.indexOf(getAssetName(asset)) - stats.modules.forEach(m => { - // ignore modules duplicated in multiple chunks - if (m.chunks.length === 1) { - const cid = m.chunks[0] - const chunk = stats.chunks.find(c => c.id === cid) - if (!chunk || !chunk.files) { - return - } - const id = stripModuleIdHash(m.identifier) - const files = manifest.modules[hash(id)] = chunk.files.map(fileToIndex) - // find all asset modules associated with the same chunk - assetModules.forEach(m => { - if (m.chunks.some(id => id === cid)) { - files.push.apply(files, m.assets.map(fileToIndex)) - } - }) - } - }) - - const json = JSON.stringify(manifest, null, 2) - compilation.assets[this.options.filename] = { - source: () => json, - size: () => json.length - } - cb() - }) - } -} diff --git a/node_modules/vue/src/server/webpack-plugin/server.js b/node_modules/vue/src/server/webpack-plugin/server.js deleted file mode 100644 index 02fab24..0000000 --- a/node_modules/vue/src/server/webpack-plugin/server.js +++ /dev/null @@ -1,69 +0,0 @@ -import { validate, isJS, getAssetName, onEmit } from './util' - -export default class VueSSRServerPlugin { - constructor (options = {}) { - this.options = Object.assign({ - filename: 'vue-ssr-server-bundle.json' - }, options) - } - - apply (compiler) { - validate(compiler) - - const stage = 'PROCESS_ASSETS_STAGE_OPTIMIZE_TRANSFER' - onEmit(compiler, 'vue-server-plugin', stage, (compilation, cb) => { - const stats = compilation.getStats().toJson() - const entryName = Object.keys(stats.entrypoints)[0] - const entryInfo = stats.entrypoints[entryName] - - if (!entryInfo) { - // #5553 - return cb() - } - - const entryAssets = entryInfo.assets - .map(getAssetName) - .filter(isJS) - - if (entryAssets.length > 1) { - throw new Error( - `Server-side bundle should have one single entry file. ` + - `Avoid using CommonsChunkPlugin in the server config.` - ) - } - - const entry = entryAssets[0] - if (!entry || typeof entry !== 'string') { - throw new Error( - `Entry "${entryName}" not found. Did you specify the correct entry option?` - ) - } - - const bundle = { - entry, - files: {}, - maps: {} - } - - Object.keys(compilation.assets).forEach(name => { - if (isJS(name)) { - bundle.files[name] = compilation.assets[name].source() - } else if (name.match(/\.js\.map$/)) { - bundle.maps[name.replace(/\.map$/, '')] = JSON.parse(compilation.assets[name].source()) - } - // do not emit anything else for server - delete compilation.assets[name] - }) - - const json = JSON.stringify(bundle, null, 2) - const filename = this.options.filename - - compilation.assets[filename] = { - source: () => json, - size: () => json.length - } - - cb() - }) - } -} diff --git a/node_modules/vue/src/server/webpack-plugin/util.js b/node_modules/vue/src/server/webpack-plugin/util.js deleted file mode 100644 index 844671b..0000000 --- a/node_modules/vue/src/server/webpack-plugin/util.js +++ /dev/null @@ -1,73 +0,0 @@ -const { red, yellow } = require('chalk') -const webpack = require('webpack') - -const prefix = `[vue-server-renderer-webpack-plugin]` -const warn = exports.warn = msg => console.error(red(`${prefix} ${msg}\n`)) -const tip = exports.tip = msg => console.log(yellow(`${prefix} ${msg}\n`)) - -const isWebpack5 = !!(webpack.version && webpack.version[0] > 4) - -export const validate = compiler => { - if (compiler.options.target !== 'node') { - warn('webpack config `target` should be "node".') - } - - if (compiler.options.output) { - if (compiler.options.output.library) { - // Webpack >= 5.0.0 - if (compiler.options.output.library.type !== 'commonjs2') { - warn('webpack config `output.library.type` should be "commonjs2".') - } - } else if (compiler.options.output.libraryTarget !== 'commonjs2') { - // Webpack < 5.0.0 - warn('webpack config `output.libraryTarget` should be "commonjs2".') - } - } - - if (!compiler.options.externals) { - tip( - 'It is recommended to externalize dependencies in the server build for ' + - 'better build performance.' - ) - } -} - -export const onEmit = (compiler, name, stageName, hook) => { - if (isWebpack5) { - // Webpack >= 5.0.0 - compiler.hooks.compilation.tap(name, compilation => { - if (compilation.compiler !== compiler) { - // Ignore child compilers - return - } - const stage = webpack.Compilation[stageName] - compilation.hooks.processAssets.tapAsync({ name, stage }, (assets, cb) => { - hook(compilation, cb) - }) - }) - } else if (compiler.hooks) { - // Webpack >= 4.0.0 - compiler.hooks.emit.tapAsync(name, hook) - } else { - // Webpack < 4.0.0 - compiler.plugin('emit', hook) - } -} - -export const stripModuleIdHash = id => { - if (isWebpack5) { - // Webpack >= 5.0.0 - return id.replace(/\|\w+$/, '') - } - // Webpack < 5.0.0 - return id.replace(/\s\w+$/, '') -} - -export const getAssetName = asset => { - if (typeof asset === 'string') { - return asset - } - return asset.name -} - -export { isJS, isCSS } from '../util' diff --git a/node_modules/vue/src/server/write.js b/node_modules/vue/src/server/write.js deleted file mode 100644 index 27a5e8a..0000000 --- a/node_modules/vue/src/server/write.js +++ /dev/null @@ -1,50 +0,0 @@ -/* @flow */ - -const MAX_STACK_DEPTH = 800 -const noop = _ => _ - -const defer = typeof process !== 'undefined' && process.nextTick - ? process.nextTick - : typeof Promise !== 'undefined' - ? fn => Promise.resolve().then(fn) - : typeof setTimeout !== 'undefined' - ? setTimeout - : noop - -if (defer === noop) { - throw new Error( - 'Your JavaScript runtime does not support any asynchronous primitives ' + - 'that are required by vue-server-renderer. Please use a polyfill for ' + - 'either Promise or setTimeout.' - ) -} - -export function createWriteFunction ( - write: (text: string, next: Function) => boolean, - onError: Function -): Function { - let stackDepth = 0 - const cachedWrite = (text, next) => { - if (text && cachedWrite.caching) { - cachedWrite.cacheBuffer[cachedWrite.cacheBuffer.length - 1] += text - } - const waitForNext = write(text, next) - if (waitForNext !== true) { - if (stackDepth >= MAX_STACK_DEPTH) { - defer(() => { - try { next() } catch (e) { - onError(e) - } - }) - } else { - stackDepth++ - next() - stackDepth-- - } - } - } - cachedWrite.caching = false - cachedWrite.cacheBuffer = [] - cachedWrite.componentBuffer = [] - return cachedWrite -} diff --git a/node_modules/vue/src/sfc/parser.js b/node_modules/vue/src/sfc/parser.js deleted file mode 100644 index 59c5fc3..0000000 --- a/node_modules/vue/src/sfc/parser.js +++ /dev/null @@ -1,134 +0,0 @@ -/* @flow */ - -import deindent from 'de-indent' -import { parseHTML } from 'compiler/parser/html-parser' -import { makeMap } from 'shared/util' - -const splitRE = /\r?\n/g -const replaceRE = /./g -const isSpecialTag = makeMap('script,style,template', true) - -/** - * Parse a single-file component (*.vue) file into an SFC Descriptor Object. - */ -export function parseComponent ( - content: string, - options?: Object = {} -): SFCDescriptor { - const sfc: SFCDescriptor = { - template: null, - script: null, - styles: [], - customBlocks: [], - errors: [] - } - let depth = 0 - let currentBlock: ?SFCBlock = null - - let warn = msg => { - sfc.errors.push(msg) - } - - if (process.env.NODE_ENV !== 'production' && options.outputSourceRange) { - warn = (msg, range) => { - const data: WarningMessage = { msg } - if (range.start != null) { - data.start = range.start - } - if (range.end != null) { - data.end = range.end - } - sfc.errors.push(data) - } - } - - function start ( - tag: string, - attrs: Array, - unary: boolean, - start: number, - end: number - ) { - if (depth === 0) { - currentBlock = { - type: tag, - content: '', - start: end, - attrs: attrs.reduce((cumulated, { name, value }) => { - cumulated[name] = value || true - return cumulated - }, {}) - } - if (isSpecialTag(tag)) { - checkAttrs(currentBlock, attrs) - if (tag === 'style') { - sfc.styles.push(currentBlock) - } else { - sfc[tag] = currentBlock - } - } else { // custom blocks - sfc.customBlocks.push(currentBlock) - } - } - if (!unary) { - depth++ - } - } - - function checkAttrs (block: SFCBlock, attrs: Array) { - for (let i = 0; i < attrs.length; i++) { - const attr = attrs[i] - if (attr.name === 'lang') { - block.lang = attr.value - } - if (attr.name === 'scoped') { - block.scoped = true - } - if (attr.name === 'module') { - block.module = attr.value || true - } - if (attr.name === 'src') { - block.src = attr.value - } - } - } - - function end (tag: string, start: number) { - if (depth === 1 && currentBlock) { - currentBlock.end = start - let text = content.slice(currentBlock.start, currentBlock.end) - if (options.deindent !== false) { - text = deindent(text) - } - // pad content so that linters and pre-processors can output correct - // line numbers in errors and warnings - if (currentBlock.type !== 'template' && options.pad) { - text = padContent(currentBlock, options.pad) + text - } - currentBlock.content = text - currentBlock = null - } - depth-- - } - - function padContent (block: SFCBlock, pad: true | "line" | "space") { - if (pad === 'space') { - return content.slice(0, block.start).replace(replaceRE, ' ') - } else { - const offset = content.slice(0, block.start).split(splitRE).length - const padChar = block.type === 'script' && !block.lang - ? '//\n' - : '\n' - return Array(offset).join(padChar) - } - } - - parseHTML(content, { - warn, - start, - end, - outputSourceRange: options.outputSourceRange - }) - - return sfc -} diff --git a/node_modules/vue/src/shared/constants.js b/node_modules/vue/src/shared/constants.js deleted file mode 100644 index a8b15e0..0000000 --- a/node_modules/vue/src/shared/constants.js +++ /dev/null @@ -1,22 +0,0 @@ -export const SSR_ATTR = 'data-server-rendered' - -export const ASSET_TYPES = [ - 'component', - 'directive', - 'filter' -] - -export const LIFECYCLE_HOOKS = [ - 'beforeCreate', - 'created', - 'beforeMount', - 'mounted', - 'beforeUpdate', - 'updated', - 'beforeDestroy', - 'destroyed', - 'activated', - 'deactivated', - 'errorCaptured', - 'serverPrefetch' -] diff --git a/node_modules/vue/src/shared/util.js b/node_modules/vue/src/shared/util.js deleted file mode 100644 index 9f240c7..0000000 --- a/node_modules/vue/src/shared/util.js +++ /dev/null @@ -1,343 +0,0 @@ -/* @flow */ - -export const emptyObject = Object.freeze({}) - -// These helpers produce better VM code in JS engines due to their -// explicitness and function inlining. -export function isUndef (v: any): boolean %checks { - return v === undefined || v === null -} - -export function isDef (v: any): boolean %checks { - return v !== undefined && v !== null -} - -export function isTrue (v: any): boolean %checks { - return v === true -} - -export function isFalse (v: any): boolean %checks { - return v === false -} - -/** - * Check if value is primitive. - */ -export function isPrimitive (value: any): boolean %checks { - return ( - typeof value === 'string' || - typeof value === 'number' || - // $flow-disable-line - typeof value === 'symbol' || - typeof value === 'boolean' - ) -} - -/** - * Quick object check - this is primarily used to tell - * Objects from primitive values when we know the value - * is a JSON-compliant type. - */ -export function isObject (obj: mixed): boolean %checks { - return obj !== null && typeof obj === 'object' -} - -/** - * Get the raw type string of a value, e.g., [object Object]. - */ -const _toString = Object.prototype.toString - -export function toRawType (value: any): string { - return _toString.call(value).slice(8, -1) -} - -/** - * Strict object type check. Only returns true - * for plain JavaScript objects. - */ -export function isPlainObject (obj: any): boolean { - return _toString.call(obj) === '[object Object]' -} - -export function isRegExp (v: any): boolean { - return _toString.call(v) === '[object RegExp]' -} - -/** - * Check if val is a valid array index. - */ -export function isValidArrayIndex (val: any): boolean { - const n = parseFloat(String(val)) - return n >= 0 && Math.floor(n) === n && isFinite(val) -} - -export function isPromise (val: any): boolean { - return ( - isDef(val) && - typeof val.then === 'function' && - typeof val.catch === 'function' - ) -} - -/** - * Convert a value to a string that is actually rendered. - */ -export function toString (val: any): string { - return val == null - ? '' - : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString) - ? JSON.stringify(val, null, 2) - : String(val) -} - -/** - * Convert an input value to a number for persistence. - * If the conversion fails, return original string. - */ -export function toNumber (val: string): number | string { - const n = parseFloat(val) - return isNaN(n) ? val : n -} - -/** - * Make a map and return a function for checking if a key - * is in that map. - */ -export function makeMap ( - str: string, - expectsLowerCase?: boolean -): (key: string) => true | void { - const map = Object.create(null) - const list: Array = str.split(',') - for (let i = 0; i < list.length; i++) { - map[list[i]] = true - } - return expectsLowerCase - ? val => map[val.toLowerCase()] - : val => map[val] -} - -/** - * Check if a tag is a built-in tag. - */ -export const isBuiltInTag = makeMap('slot,component', true) - -/** - * Check if an attribute is a reserved attribute. - */ -export const isReservedAttribute = makeMap('key,ref,slot,slot-scope,is') - -/** - * Remove an item from an array. - */ -export function remove (arr: Array, item: any): Array | void { - if (arr.length) { - const index = arr.indexOf(item) - if (index > -1) { - return arr.splice(index, 1) - } - } -} - -/** - * Check whether an object has the property. - */ -const hasOwnProperty = Object.prototype.hasOwnProperty -export function hasOwn (obj: Object | Array<*>, key: string): boolean { - return hasOwnProperty.call(obj, key) -} - -/** - * Create a cached version of a pure function. - */ -export function cached (fn: F): F { - const cache = Object.create(null) - return (function cachedFn (str: string) { - const hit = cache[str] - return hit || (cache[str] = fn(str)) - }: any) -} - -/** - * Camelize a hyphen-delimited string. - */ -const camelizeRE = /-(\w)/g -export const camelize = cached((str: string): string => { - return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : '') -}) - -/** - * Capitalize a string. - */ -export const capitalize = cached((str: string): string => { - return str.charAt(0).toUpperCase() + str.slice(1) -}) - -/** - * Hyphenate a camelCase string. - */ -const hyphenateRE = /\B([A-Z])/g -export const hyphenate = cached((str: string): string => { - return str.replace(hyphenateRE, '-$1').toLowerCase() -}) - -/** - * Simple bind polyfill for environments that do not support it, - * e.g., PhantomJS 1.x. Technically, we don't need this anymore - * since native bind is now performant enough in most browsers. - * But removing it would mean breaking code that was able to run in - * PhantomJS 1.x, so this must be kept for backward compatibility. - */ - -/* istanbul ignore next */ -function polyfillBind (fn: Function, ctx: Object): Function { - function boundFn (a) { - const l = arguments.length - return l - ? l > 1 - ? fn.apply(ctx, arguments) - : fn.call(ctx, a) - : fn.call(ctx) - } - - boundFn._length = fn.length - return boundFn -} - -function nativeBind (fn: Function, ctx: Object): Function { - return fn.bind(ctx) -} - -export const bind = Function.prototype.bind - ? nativeBind - : polyfillBind - -/** - * Convert an Array-like object to a real Array. - */ -export function toArray (list: any, start?: number): Array { - start = start || 0 - let i = list.length - start - const ret: Array = new Array(i) - while (i--) { - ret[i] = list[i + start] - } - return ret -} - -/** - * Mix properties into target object. - */ -export function extend (to: Object, _from: ?Object): Object { - for (const key in _from) { - to[key] = _from[key] - } - return to -} - -/** - * Merge an Array of Objects into a single Object. - */ -export function toObject (arr: Array): Object { - const res = {} - for (let i = 0; i < arr.length; i++) { - if (arr[i]) { - extend(res, arr[i]) - } - } - return res -} - -/* eslint-disable no-unused-vars */ - -/** - * Perform no operation. - * Stubbing args to make Flow happy without leaving useless transpiled code - * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/). - */ -export function noop (a?: any, b?: any, c?: any) {} - -/** - * Always return false. - */ -export const no = (a?: any, b?: any, c?: any) => false - -/* eslint-enable no-unused-vars */ - -/** - * Return the same value. - */ -export const identity = (_: any) => _ - -/** - * Generate a string containing static keys from compiler modules. - */ -export function genStaticKeys (modules: Array): string { - return modules.reduce((keys, m) => { - return keys.concat(m.staticKeys || []) - }, []).join(',') -} - -/** - * Check if two values are loosely equal - that is, - * if they are plain objects, do they have the same shape? - */ -export function looseEqual (a: any, b: any): boolean { - if (a === b) return true - const isObjectA = isObject(a) - const isObjectB = isObject(b) - if (isObjectA && isObjectB) { - try { - const isArrayA = Array.isArray(a) - const isArrayB = Array.isArray(b) - if (isArrayA && isArrayB) { - return a.length === b.length && a.every((e, i) => { - return looseEqual(e, b[i]) - }) - } else if (a instanceof Date && b instanceof Date) { - return a.getTime() === b.getTime() - } else if (!isArrayA && !isArrayB) { - const keysA = Object.keys(a) - const keysB = Object.keys(b) - return keysA.length === keysB.length && keysA.every(key => { - return looseEqual(a[key], b[key]) - }) - } else { - /* istanbul ignore next */ - return false - } - } catch (e) { - /* istanbul ignore next */ - return false - } - } else if (!isObjectA && !isObjectB) { - return String(a) === String(b) - } else { - return false - } -} - -/** - * Return the first index at which a loosely equal value can be - * found in the array (if value is a plain object, the array must - * contain an object of the same shape), or -1 if it is not present. - */ -export function looseIndexOf (arr: Array, val: mixed): number { - for (let i = 0; i < arr.length; i++) { - if (looseEqual(arr[i], val)) return i - } - return -1 -} - -/** - * Ensure a function is called only once. - */ -export function once (fn: Function): Function { - let called = false - return function () { - if (!called) { - called = true - fn.apply(this, arguments) - } - } -} diff --git a/node_modules/vue/types/index.d.ts b/node_modules/vue/types/index.d.ts deleted file mode 100644 index 58ceb20..0000000 --- a/node_modules/vue/types/index.d.ts +++ /dev/null @@ -1,39 +0,0 @@ -import { Vue } from "./vue"; -import "./umd"; - -export default Vue; - -export { - CreateElement, - VueConstructor -} from "./vue"; - -export { - Component, - AsyncComponent, - ComponentOptions, - FunctionalComponentOptions, - RenderContext, - PropType, - PropOptions, - ComputedOptions, - WatchHandler, - WatchOptions, - WatchOptionsWithHandler, - DirectiveFunction, - DirectiveOptions -} from "./options"; - -export { - PluginFunction, - PluginObject -} from "./plugin"; - -export { - VNodeChildren, - VNodeChildrenArrayContents, - VNode, - VNodeComponentOptions, - VNodeData, - VNodeDirective -} from "./vnode"; diff --git a/node_modules/vue/types/options.d.ts b/node_modules/vue/types/options.d.ts deleted file mode 100644 index ff26605..0000000 --- a/node_modules/vue/types/options.d.ts +++ /dev/null @@ -1,207 +0,0 @@ -import { Vue, CreateElement, CombinedVueInstance } from "./vue"; -import { VNode, VNodeData, VNodeDirective, NormalizedScopedSlot } from "./vnode"; - -type Constructor = { - new (...args: any[]): any; -} - -// we don't support infer props in async component -// N.B. ComponentOptions is contravariant, the default generic should be bottom type -export type Component, Methods=DefaultMethods, Computed=DefaultComputed, Props=DefaultProps> = - | typeof Vue - | FunctionalComponentOptions - | ComponentOptions - -type EsModule = T | { default: T } - -type ImportedComponent, Methods=DefaultMethods, Computed=DefaultComputed, Props=DefaultProps> - = EsModule> - -export type AsyncComponent, Methods=DefaultMethods, Computed=DefaultComputed, Props=DefaultProps> - = AsyncComponentPromise - | AsyncComponentFactory - -export type AsyncComponentPromise, Methods=DefaultMethods, Computed=DefaultComputed, Props=DefaultProps> = ( - resolve: (component: Component) => void, - reject: (reason?: any) => void -) => Promise> | void; - -export type AsyncComponentFactory, Methods=DefaultMethods, Computed=DefaultComputed, Props=DefaultProps> = () => { - component: Promise>; - loading?: ImportedComponent; - error?: ImportedComponent; - delay?: number; - timeout?: number; -} - -/** - * When the `Computed` type parameter on `ComponentOptions` is inferred, - * it should have a property with the return type of every get-accessor. - * Since there isn't a way to query for the return type of a function, we allow TypeScript - * to infer from the shape of `Accessors` and work backwards. - */ -export type Accessors = { - [K in keyof T]: (() => T[K]) | ComputedOptions -} - -type DataDef = Data | ((this: Readonly & V) => Data) -/** - * This type should be used when an array of strings is used for a component's `props` value. - */ -export type ThisTypedComponentOptionsWithArrayProps = - object & - ComponentOptions, V>, Methods, Computed, PropNames[], Record> & - ThisType>>>; - -/** - * This type should be used when an object mapped to `PropOptions` is used for a component's `props` value. - */ -export type ThisTypedComponentOptionsWithRecordProps = - object & - ComponentOptions, Methods, Computed, RecordPropsDefinition, Props> & - ThisType>>; - -type DefaultData = object | ((this: V) => object); -type DefaultProps = Record; -type DefaultMethods = { [key: string]: (this: V, ...args: any[]) => any }; -type DefaultComputed = { [key: string]: any }; -export interface ComponentOptions< - V extends Vue, - Data=DefaultData, - Methods=DefaultMethods, - Computed=DefaultComputed, - PropsDef=PropsDefinition, - Props=DefaultProps> { - data?: Data; - props?: PropsDef; - propsData?: object; - computed?: Accessors; - methods?: Methods; - watch?: Record | WatchHandler>; - - el?: Element | string; - template?: string; - // hack is for functional component type inference, should not be used in user code - render?(createElement: CreateElement, hack: RenderContext): VNode; - renderError?(createElement: CreateElement, err: Error): VNode; - staticRenderFns?: ((createElement: CreateElement) => VNode)[]; - - beforeCreate?(this: V): void; - created?(): void; - beforeDestroy?(): void; - destroyed?(): void; - beforeMount?(): void; - mounted?(): void; - beforeUpdate?(): void; - updated?(): void; - activated?(): void; - deactivated?(): void; - errorCaptured?(err: Error, vm: Vue, info: string): boolean | void; - serverPrefetch?(this: V): Promise; - - directives?: { [key: string]: DirectiveFunction | DirectiveOptions }; - components?: { [key: string]: Component | AsyncComponent }; - transitions?: { [key: string]: object }; - filters?: { [key: string]: Function }; - - provide?: object | (() => object); - inject?: InjectOptions; - - model?: { - prop?: string; - event?: string; - }; - - parent?: Vue; - mixins?: (ComponentOptions | typeof Vue)[]; - name?: string; - // TODO: support properly inferred 'extends' - extends?: ComponentOptions | typeof Vue; - delimiters?: [string, string]; - comments?: boolean; - inheritAttrs?: boolean; -} - -export interface FunctionalComponentOptions> { - name?: string; - props?: PropDefs; - model?: { - prop?: string; - event?: string; - }; - inject?: InjectOptions; - functional: boolean; - render?(this: undefined, createElement: CreateElement, context: RenderContext): VNode | VNode[]; -} - -export interface RenderContext { - props: Props; - children: VNode[]; - slots(): any; - data: VNodeData; - parent: Vue; - listeners: { [key: string]: Function | Function[] }; - scopedSlots: { [key: string]: NormalizedScopedSlot }; - injections: any -} - -export type Prop = { (): T } | { new(...args: never[]): T & object } | { new(...args: string[]): Function } - -export type PropType = Prop | Prop[]; - -export type PropValidator = PropOptions | PropType; - -export interface PropOptions { - type?: PropType; - required?: boolean; - default?: T | null | undefined | (() => T | null | undefined); - validator?(value: T): boolean; -} - -export type RecordPropsDefinition = { - [K in keyof T]: PropValidator -} -export type ArrayPropsDefinition = (keyof T)[]; -export type PropsDefinition = ArrayPropsDefinition | RecordPropsDefinition; - -export interface ComputedOptions { - get?(): T; - set?(value: T): void; - cache?: boolean; -} - -export type WatchHandler = string | ((val: T, oldVal: T) => void); - -export interface WatchOptions { - deep?: boolean; - immediate?: boolean; -} - -export interface WatchOptionsWithHandler extends WatchOptions { - handler: WatchHandler; -} - -export interface DirectiveBinding extends Readonly { - readonly modifiers: { [key: string]: boolean }; -} - -export type DirectiveFunction = ( - el: HTMLElement, - binding: DirectiveBinding, - vnode: VNode, - oldVnode: VNode -) => void; - -export interface DirectiveOptions { - bind?: DirectiveFunction; - inserted?: DirectiveFunction; - update?: DirectiveFunction; - componentUpdated?: DirectiveFunction; - unbind?: DirectiveFunction; -} - -export type InjectKey = string | symbol; - -export type InjectOptions = { - [key: string]: InjectKey | { from?: InjectKey, default?: any } -} | string[]; diff --git a/node_modules/vue/types/plugin.d.ts b/node_modules/vue/types/plugin.d.ts deleted file mode 100644 index 5741f86..0000000 --- a/node_modules/vue/types/plugin.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { Vue as _Vue } from "./vue"; - -export type PluginFunction = (Vue: typeof _Vue, options?: T) => void; - -export interface PluginObject { - install: PluginFunction; - [key: string]: any; -} diff --git a/node_modules/vue/types/umd.d.ts b/node_modules/vue/types/umd.d.ts deleted file mode 100644 index d1dc8d1..0000000 --- a/node_modules/vue/types/umd.d.ts +++ /dev/null @@ -1,48 +0,0 @@ -import * as V from "./index"; -import { - DefaultData, - DefaultProps, - DefaultMethods, - DefaultComputed, - PropsDefinition -} from "./options"; - -// Expose some types for backward compatibility... -declare namespace Vue { - // vue.d.ts - export type CreateElement = V.CreateElement; - export type VueConstructor = V.VueConstructor; - - // options.d.ts - export type Component, Methods=DefaultMethods, Computed=DefaultComputed, Props=DefaultProps> = V.Component; - export type AsyncComponent, Methods=DefaultMethods, Computed=DefaultComputed, Props=DefaultProps> = V.AsyncComponent; - export type ComponentOptions, Methods=DefaultMethods, Computed=DefaultComputed, PropsDef=PropsDefinition, Props=DefaultProps> = V.ComponentOptions; - export type FunctionalComponentOptions> = V.FunctionalComponentOptions; - export type RenderContext = V.RenderContext; - export type PropType = V.PropType; - export type PropOptions = V.PropOptions; - export type ComputedOptions = V.ComputedOptions; - export type WatchHandler = V.WatchHandler; - export type WatchOptions = V.WatchOptions; - export type WatchOptionsWithHandler = V.WatchOptionsWithHandler; - export type DirectiveFunction = V.DirectiveFunction; - export type DirectiveOptions = V.DirectiveOptions; - - // plugin.d.ts - export type PluginFunction = V.PluginFunction; - export type PluginObject = V.PluginObject; - - // vnode.d.ts - export type VNodeChildren = V.VNodeChildren; - export type VNodeChildrenArrayContents = V.VNodeChildrenArrayContents; - export type VNode = V.VNode; - export type VNodeComponentOptions = V.VNodeComponentOptions; - export type VNodeData = V.VNodeData; - export type VNodeDirective = V.VNodeDirective; -} - -declare class Vue extends V.default {} - -export = Vue; - -export as namespace Vue; diff --git a/node_modules/vue/types/vnode.d.ts b/node_modules/vue/types/vnode.d.ts deleted file mode 100644 index 997980c..0000000 --- a/node_modules/vue/types/vnode.d.ts +++ /dev/null @@ -1,76 +0,0 @@ -import { Vue } from "./vue"; - -export type ScopedSlot = (props: any) => ScopedSlotReturnValue; -type ScopedSlotReturnValue = VNode | string | boolean | null | undefined | ScopedSlotReturnArray; -interface ScopedSlotReturnArray extends Array {} - -// Scoped slots are guaranteed to return Array of VNodes starting in 2.6 -export type NormalizedScopedSlot = (props: any) => ScopedSlotChildren; -export type ScopedSlotChildren = VNode[] | undefined; - -// Relaxed type compatible with $createElement -export type VNodeChildren = VNodeChildrenArrayContents | [ScopedSlot] | string | boolean | null | undefined; -export interface VNodeChildrenArrayContents extends Array {} - -export interface VNode { - tag?: string; - data?: VNodeData; - children?: VNode[]; - text?: string; - elm?: Node; - ns?: string; - context?: Vue; - key?: string | number | symbol | boolean; - componentOptions?: VNodeComponentOptions; - componentInstance?: Vue; - parent?: VNode; - raw?: boolean; - isStatic?: boolean; - isRootInsert: boolean; - isComment: boolean; -} - -export interface VNodeComponentOptions { - Ctor: typeof Vue; - propsData?: object; - listeners?: object; - children?: VNode[]; - tag?: string; -} - -export interface VNodeData { - key?: string | number; - slot?: string; - scopedSlots?: { [key: string]: ScopedSlot | undefined }; - ref?: string; - refInFor?: boolean; - tag?: string; - staticClass?: string; - class?: any; - staticStyle?: { [key: string]: any }; - style?: string | object[] | object; - props?: { [key: string]: any }; - attrs?: { [key: string]: any }; - domProps?: { [key: string]: any }; - hook?: { [key: string]: Function }; - on?: { [key: string]: Function | Function[] }; - nativeOn?: { [key: string]: Function | Function[] }; - transition?: object; - show?: boolean; - inlineTemplate?: { - render: Function; - staticRenderFns: Function[]; - }; - directives?: VNodeDirective[]; - keepAlive?: boolean; -} - -export interface VNodeDirective { - name: string; - value?: any; - oldValue?: any; - expression?: string; - arg?: string; - oldArg?: string; - modifiers?: { [key: string]: boolean }; -} diff --git a/node_modules/vue/types/vue.d.ts b/node_modules/vue/types/vue.d.ts deleted file mode 100644 index 7adb5a5..0000000 --- a/node_modules/vue/types/vue.d.ts +++ /dev/null @@ -1,132 +0,0 @@ -import { - Component, - AsyncComponent, - ComponentOptions, - FunctionalComponentOptions, - WatchOptionsWithHandler, - WatchHandler, - DirectiveOptions, - DirectiveFunction, - RecordPropsDefinition, - ThisTypedComponentOptionsWithArrayProps, - ThisTypedComponentOptionsWithRecordProps, - WatchOptions, -} from "./options"; -import { VNode, VNodeData, VNodeChildren, NormalizedScopedSlot } from "./vnode"; -import { PluginFunction, PluginObject } from "./plugin"; - -export interface CreateElement { - (tag?: string | Component | AsyncComponent | (() => Component), children?: VNodeChildren): VNode; - (tag?: string | Component | AsyncComponent | (() => Component), data?: VNodeData, children?: VNodeChildren): VNode; -} - -export interface Vue { - readonly $el: Element; - readonly $options: ComponentOptions; - readonly $parent: Vue; - readonly $root: Vue; - readonly $children: Vue[]; - readonly $refs: { [key: string]: Vue | Element | (Vue | Element)[] | undefined }; - readonly $slots: { [key: string]: VNode[] | undefined }; - readonly $scopedSlots: { [key: string]: NormalizedScopedSlot | undefined }; - readonly $isServer: boolean; - readonly $data: Record; - readonly $props: Record; - readonly $ssrContext: any; - readonly $vnode: VNode; - readonly $attrs: Record; - readonly $listeners: Record; - - $mount(elementOrSelector?: Element | string, hydrating?: boolean): this; - $forceUpdate(): void; - $destroy(): void; - $set: typeof Vue.set; - $delete: typeof Vue.delete; - $watch( - expOrFn: string, - callback: (this: this, n: any, o: any) => void, - options?: WatchOptions - ): (() => void); - $watch( - expOrFn: (this: this) => T, - callback: (this: this, n: T, o: T) => void, - options?: WatchOptions - ): (() => void); - $on(event: string | string[], callback: Function): this; - $once(event: string | string[], callback: Function): this; - $off(event?: string | string[], callback?: Function): this; - $emit(event: string, ...args: any[]): this; - $nextTick(callback: (this: this) => void): void; - $nextTick(): Promise; - $createElement: CreateElement; -} - -export type CombinedVueInstance = Data & Methods & Computed & Props & Instance; -export type ExtendedVue = VueConstructor & Vue>; - -export interface VueConfiguration { - silent: boolean; - optionMergeStrategies: any; - devtools: boolean; - productionTip: boolean; - performance: boolean; - errorHandler(err: Error, vm: Vue, info: string): void; - warnHandler(msg: string, vm: Vue, trace: string): void; - ignoredElements: (string | RegExp)[]; - keyCodes: { [key: string]: number | number[] }; - async: boolean; -} - -export interface VueConstructor { - new (options?: ThisTypedComponentOptionsWithArrayProps): CombinedVueInstance>; - // ideally, the return type should just contain Props, not Record. But TS requires to have Base constructors with the same return type. - new (options?: ThisTypedComponentOptionsWithRecordProps): CombinedVueInstance>; - new (options?: ComponentOptions): CombinedVueInstance>; - - extend(options?: ThisTypedComponentOptionsWithArrayProps): ExtendedVue>; - extend(options?: ThisTypedComponentOptionsWithRecordProps): ExtendedVue; - extend(definition: FunctionalComponentOptions, PropNames[]>): ExtendedVue>; - extend(definition: FunctionalComponentOptions>): ExtendedVue; - extend(options?: ComponentOptions): ExtendedVue; - - nextTick(callback: (this: T) => void, context?: T): void; - nextTick(): Promise - set(object: object, key: string | number, value: T): T; - set(array: T[], key: number, value: T): T; - delete(object: object, key: string | number): void; - delete(array: T[], key: number): void; - - directive( - id: string, - definition?: DirectiveOptions | DirectiveFunction - ): DirectiveOptions; - filter(id: string, definition?: Function): Function; - - component(id: string): VueConstructor; - component(id: string, constructor: VC): VC; - component(id: string, definition: AsyncComponent): ExtendedVue; - component(id: string, definition?: ThisTypedComponentOptionsWithArrayProps): ExtendedVue>; - component(id: string, definition?: ThisTypedComponentOptionsWithRecordProps): ExtendedVue; - component(id: string, definition: FunctionalComponentOptions, PropNames[]>): ExtendedVue>; - component(id: string, definition: FunctionalComponentOptions>): ExtendedVue; - component(id: string, definition?: ComponentOptions): ExtendedVue; - - use(plugin: PluginObject | PluginFunction, options?: T): VueConstructor; - use(plugin: PluginObject | PluginFunction, ...options: any[]): VueConstructor; - mixin(mixin: VueConstructor | ComponentOptions): VueConstructor; - compile(template: string): { - render(createElement: typeof Vue.prototype.$createElement): VNode; - staticRenderFns: (() => VNode)[]; - }; - - observable(obj: T): T; - - util: { - warn(msg: string, vm?: InstanceType): void; - }; - - config: VueConfiguration; - version: string; -} - -export const Vue: VueConstructor; diff --git a/unpackage/dist/dev/mp-weixin/api/index.js b/unpackage/dist/dev/mp-weixin/api/index.js deleted file mode 100644 index 396f75b..0000000 --- a/unpackage/dist/dev/mp-weixin/api/index.js +++ /dev/null @@ -1,474 +0,0 @@ -"use strict"; -const common_vendor = require("../common/vendor.js"); -const api_request = require("./request.js"); -const API = { - //微信登录 - getToken: (data) => api_request.net.POST("/login/token", data), - // 获取token - wx_login: (data, userId) => api_request.net.POST("/user/binding/wechat", data, true, { "userId": userId }), - // 微信登录 - // upload: (data) => net.POST('/user/upload',data), // 文件上传 - userinfoUpdae: (data) => api_request.net.PUT("/user/info", data), - // 更新用户信息 - // 首页 - getHospitalList: (data) => api_request.net.GET("/hospital/list", data), - // 获取医院信息 - // 百科 - getArticleList: (data) => api_request.net.GET("/article/list", data), - // 百科列表 - getArticleDetail: (data) => api_request.net.GET("/article/" + data.id), - // 百科列表 - /* - 首页信息 - */ - getIndexInfo: (data) => api_request.net.GET("/api/index/index"), - // 首页信息 - getIndexBanner: (data) => api_request.net.GET("/api/banner/index", data), - // 轮播图 - getIndexNotice: (data) => api_request.net.GET("/api/news/notice"), - // 公告 - getGoodsDetail: (data) => api_request.net.GET("/api/goods/detail", data), - // 商品详情(普通商品) - getSeckillGoodsDetail: (data) => api_request.net.GET("/api/seckill_goods/detail", data), - // 商品详情(秒杀) - getGroupGoodsDetail: (data) => api_request.net.GET("/api/group_goods/detail", data), - // 商品详情(团购) - getGoodsList: (data) => api_request.net.GET("/api/goods/lists", data), - // 商品列表(普通商品) - getSeckillGoodsList: (data) => api_request.net.GET("/api/seckill_goods/lists", data), - // 商品列表(限时) - getGroupGoodsList: (data) => api_request.net.GET("/api/group_goods/lists?page=&keyword=", data), - // 商品列表(团购) - getNewinfo: (data) => api_request.net.GET("/api/goods/getGoodsSpec", data), - // 根据商品规格更新数据 - getCategoryList: (data) => api_request.net.GET("/api/goods_category/lists"), - // 获取商品分类 - getCategory: (data) => api_request.net.GET("/api/goods/category", data), - // 根据分类Id获取分类商品 - getCartList: (data) => api_request.net.GET("/api/cart/lists", data), - // 获取购物车列表 - addCart: (data) => api_request.net.POST("/api/cart/add", data), - // 加入购物车 - delCart: (data) => api_request.net.POST("/api/cart/delete", data), - // 删除购物车 - updateCart: (data) => api_request.net.POST("/api/cart/edit", data), - // 更新购物车 - login: (data) => api_request.net.POST("/api/user/wechatLogin", data), - // 登录 - login_test: (data) => api_request.net.GET("/api/user/testLogin?id=1"), - // 登录 测试专用 - zhuce: (data) => api_request.net.POST("/api/user/profile", data), - // 注册 - getOrderList: (data) => api_request.net.GET("/api/order/lists", data), - //订单列表 - getOrderGroupList: (data) => api_request.net.GET("/api/group_order/lists", data), - //订单列表(团购) - getOrderSeckillList: (data) => api_request.net.GET("/api/seckill_order/lists", data), - //订单列表(秒杀) - pay: (data) => api_request.net.POST("/api/order/pay", data), - //支付 - payGroup: (data) => api_request.net.POST("/api/group_order/pay", data), - //支付(团购) - paySeckill: (data) => api_request.net.POST("/api/seckill_order/pay", data), - //支付(秒杀) - refund: (data) => api_request.net.POST("/api/order/refund", data), - //退款 - getOrderInviteList: (data) => api_request.net.GET("/api/invite/order", data), - //分销订单 - getOrderBaseinfo: (data) => api_request.net.POST("/api/order/preview", data), - //获取订单提交页面的基本信息 - getOrderGroupBaseinfo: (data) => api_request.net.POST("/api/group_order/preview", data), - //获取订单提交页面的基本信息(团购) - getOrderSeckillBaseinfo: (data) => api_request.net.POST("/api/seckill_order/preview", data), - //获取订单提交页面的基本信息(秒杀) - getOrderCartinfo: (data) => api_request.net.POST("/api/order/cartPreview", data), - //获取订单提交页面的基本信息(购物车来的) - getDelivery: (data) => api_request.net.GET("/api/index/delivery", data), - //获取配送相关的选项(普通商品) - staffApply: (data) => api_request.net.POST("/api/invite/apply", data), - //业务员申请 - deliveryApply: (data) => api_request.net.POST("/api/staff/apply", data), - //配送员申请 - getDeliveryArea: (data) => api_request.net.GET("/api/staff/getDeliveryArea"), - //获取配送区域 - getAddressList: (data) => api_request.net.GET("/api/address/lists"), - //地址列表 - getAddDetail: (data) => api_request.net.GET("/api/address/detail", data), - //地址详情 - addAddress: (data) => api_request.net.POST("/api/address/add", data), - //新增地址 - editAddress: (data) => api_request.net.POST("/api/address/edit", data), - //修改地址 - delAddress: (data) => api_request.net.GET("/api/address/delete", data), - //删除地址 - getDefaultAddress: (data) => api_request.net.GET("/api/address/getDefault"), - //获取默认地址 - orderSubmitFunc: (data) => api_request.net.POST("/api/order/order", data), - //提交订单(普通订单) - orderSubmitCartFunc: (data) => api_request.net.POST("/api/order/cartOrder", data), - //提交订单(购物车) - orderSubmitGroupFunc: (data) => api_request.net.POST("/api/group_order/order", data), - //提交订单(团购订单) - orderSubmitSeckillFunc: (data) => api_request.net.POST("/api/seckill_order/order", data), - //提交订单(秒杀订单) - orderDetail: (data) => api_request.net.GET("/api/order/detail", data), - //订单详情-普通订单 (顾客) - orderGroupDetail: (data) => api_request.net.GET("/api/group_order/detail", data), - //订单详情-团购订单 - orderSeckillDetail: (data) => api_request.net.GET("/api/seckill_order/detail", data), - //订单详情-秒杀订单 - orderStaffDetail: (data) => api_request.net.GET("/api/staff/orderDetail", data), - //订单详情-配送订单 - orderLeaderDetail: (data) => api_request.net.GET("/api/leader/orderDetail", data), - //订单详情-管理员订单 - orderCancel: (data) => api_request.net.POST("/api/order/cancle", data), - //取消订单 - orderCancelGroup: (data) => api_request.net.POST("/api/group_order/cancle", data), - //取消订单 (团购) - orderCancelSeckill: (data) => api_request.net.POST("/api/seckill_order/cancle", data), - //取消订单 (秒杀) - /* - 用户相关 - */ - getUserInfo: (data) => api_request.net.GET("/api/user/userInfo", data), - //获取用户信息 - updateUserInfo: (data) => api_request.net.POST("/api/user/profile", data), - //更新用户信息 - rechargeFunc: (data) => api_request.net.POST("/api/recharge/recharge", data), - //充值 - withdrawalFunc: (data) => api_request.net.POST("/api/withdrawl/submit", data), - //提现 - vipBuy: (data) => api_request.net.POST("/api/vip/order", data), - //购买VIP - vipConfig: (data) => api_request.net.GET("/api/vip/config"), - //会员说明 - /* - 优惠券 - */ - getCouponsList: (data) => api_request.net.GET("/api/coupon/userCoupons", data), - //优惠券 - getCouponsCenterList: (data) => api_request.net.GET("/api/coupon/lists", data), - //领券中心 - couponsCenterReceive: (data) => api_request.net.POST("/api/coupon/receive", data), - //领取优惠 - getMyStars: (data) => api_request.net.GET("/api/collect/lists", data), - //我的收藏 - /* - 推广中心 - */ - inviteCenter: (data) => api_request.net.GET("/api/invite/index", data), - //首页 - inviteCenterwithdrawl: (data) => api_request.net.POST("/api/withdrawl/submit", data), - //提现 - inviteCenterwithdrawlDetail: (data) => api_request.net.GET("/api/invite/withdrawlDetail", data), - //提现明细 - inviteCenterwithdrawlRecodes: (data) => api_request.net.GET("/api/invite/record", data), - //提现明细(佣金) - getShareQrcode: (data) => api_request.net.GET("/api/user/getShareQrcode"), - //用户分销二维码 - /* - 配置相关 - */ - getConfig: (data) => api_request.net.GET("/api/index/config"), - setDeliveryTime: (data) => api_request.net.POST("/api/staff/setDeliveryTime", data), - // 设置配送时间 - getDeliveryTime: (data) => api_request.net.GET("/api/staff/getDeliveryTime"), - // 获取配送时间 - getStaffOrder: (data) => api_request.net.GET("/api/staff/orderLists", data), - // 获取订单管理列表(配送员) - getManageOrder: (data) => api_request.net.GET("/api/leader/orderLists", data), - // 获取订单管理列表(团长) - deliveryPhoto: (data) => api_request.net.POST("/api/staff/deliveryPhoto", data), - // 送达拍照 - reveiceOrder: (data) => api_request.net.POST("/api/staff/reveiceOrder", data), - // 接单 - reveiceOrderOk: (data) => api_request.net.POST("/api/leader/assignOrder", data), - // 派单 - getStaffList: (data) => api_request.net.GET("/api/leader/staffList"), - // 配送员列表 - goodsBuyFunc: (data) => api_request.net.POST("/api/leader/goodsBuy", data), - // 商品申购 - getRecordList: (data) => api_request.net.GET("/api/leader/recordList", data), - // 货物入库 - /** - * - * 登录类信息 - * - */ - // 检查更新 - getUpdateVersion: (data) => api_request.net.GET("/api/v1/index/version"), - // 获取定位 - getLocationInfo: (data) => api_request.net.GET("/api/v1/index/ip", data), - // 验证码登陆 - codeLogin: (data) => api_request.net.POST("/code/login", data), - // H5扫码登录邀请接口 - inviteLogin: (data) => api_request.net.POST("/api/v1/invite/login", data), - // 发送手机验证码接口 - sendVerifyCode: (data) => api_request.net.POST("/api/v1/sms/send", { send_type: "student", ...data }), - // 注销账号 - unRegister: (data) => api_request.net.POST("/api/v1/student/delete", data), - // 授权登录 - accessLogin: (data, t = "wx") => api_request.net.POST(`/api/v1/${t}/login`, data), - // 退出登录 - logOut: (data) => api_request.net.POST("/api/v1/code/logout", data), - // 获取省份 - getProvince: (data) => api_request.net.GET("/api/v1/colleges/getProvince", data), - // 根据学员所选择的教学点获取院校列表接口 - collegesList: (data) => api_request.net.GET("/api/v1/colleges/list", data), - // 通过市反查省/自治区/直辖市 - getProvinceByCity: (data) => api_request.net.GET("/api/v1/region/getProvinceByCity", data), - /** - * - * 用户信息 - * - */ - // 学员个人信息接口 - selectUserInfo: (data) => api_request.net.GET("/api/v1/student/info", data), - // 登录成功后填写学员信息接口 - userUpdate: (data) => api_request.net.POST("/api/v1/student/update", data), - // 邀请二维码 - qrcode: (data) => api_request.net.POST("/api/v1/student/invite/qrcode", data), - uploadBase64: (data) => api_request.net.POST("/api/v1/student/uploadBase64", data), - // 获取被邀请人列表接口 - inviteList: (data) => api_request.net.GET("/api/v1/student/invite/list", data), - // 积分列表 - scoreList: (data) => api_request.net.GET("/point", data), - // 余额明细 - balanceList: (data) => api_request.net.POST("/api/v1/balance/detail/get/list", data), - // 模拟测试记录 - recordList: (data) => api_request.net.GET("/api/v1/test-record/mock/examination/record", data), - // 练习题错误集详情 - practiceList: (data) => api_request.net.GET("/api/v1/test-record/practice/list", data), - /** - * - * 首页数据 - * - */ - // 首页配置获取 - indexConfig: (data) => api_request.net.GET("/api/v1/index/config", data), - // 轮播 - // indexBanner: data => net.GET('/app/banner', data), - indexBanner: (data) => api_request.net.POST("/api/v1/index/lbt", data), - // 获取咨询文章列表 - // wzList: data => net.GET('/app/consult-wz', data), - wzList: (data) => api_request.net.POST("/api/v1/index/wz/list", data), - // 获取咨询文章 - // wzInfo: id => net.GET(`/app/consult-wz/${id}`), - wzInfo: (id) => api_request.net.GET(`/api/v1/index/wz/${id}`), - // 获取课程分页 - getCourseList: (data) => api_request.net.GET(`/app/course/page`, data), - // 获取推荐院校列表 - // recommendwzList: data => net.GET('/app/academy', data), - recommendwzList: (data) => api_request.net.POST("/api/v1/index/academy/list", data), - // 获取推荐院校文章 - // recommendwzInfo: id => net.GET(`/app/academy/${id}`), - recommendwzInfo: (id) => api_request.net.GET(`/api/v1/index/academy/${id}`), - // 推荐院校文章阅读量累计 - // recomendaddReadNumber: data => net.PUT('/app/academy/num',data), - recomendaddReadNumber: (data) => api_request.net.POST("/api/v1/index/academy/add/num", data), - //获取考试大纲列表 - syllabusList: (data) => api_request.net.POST("/api/v1/index/syllabus/list", data), - // 搜索 - search: (data) => api_request.net.POST("/api/v1/index/search", data), - // 阅读量累计 - addReadNumber: (data) => api_request.net.PUT("/app/consult-wz/num", data), - // 师资团队列表 - lecturerList: (data) => api_request.net.GET("/api/v1/index/lecturer", data), - // 师资详情 - lecturerDetail: (id) => api_request.net.GET(`/api/v1/index/lecturer/${id}`), - // 获取资料列表 - indexMaterial: (data) => api_request.net.GET("/api/v1/index/material", data), - // indexMaterial: data => net.GET('/app/material', data), - // 获取资料详情 - materialDetail: (data) => api_request.net.GET(`/api/v1/index/material/${data.id}`, { buyer_id: data.buyer_id }), - // 获取精品课程 - indexBoutiqueCourse: (data) => api_request.net.GET("/api/v1/index/boutique/course", data), - // 获取精品课程详情 - boutiqueCourseDetail: (id) => api_request.net.GET(`/api/v1/index/boutique/course/${id}`), - // 获取课程 - courseList: (data) => api_request.net.POST("/api/v1/course/get", data), - // 获取套餐 - comboList: (data) => api_request.net.POST("/api/v1/combo/course/get", data), - // courseList: data => net.GET('/app/course/page', data), - // 获取课程详情 - courseDetail: (id, data) => api_request.net.GET(`/api/v1/course/${id}`, data), - // courseDetail: (id, data) => net.GET(`/app/course`, {id}), - // 获取线下课程 - offlineCourseList: (data) => api_request.net.POST("/api/v1/offline/course/get", data), - // 获取线下课程详情 - offlineCourseDetail: (id) => api_request.net.GET(`/api/v1/offline/course/${id}`), - // 获取套餐课程详情 - getComboDetail: (data) => api_request.net.GET(`/api/v1/combo/course/${data.id}`, { buyer_id: data.buyer_id }), - // 获取直播课列表 - // liveCourseList: data => net.GET('/api/v1/sys-course-live', data), - liveCourseList: (data) => api_request.net.GET("/api/v1/api-live-course", data), - // 直播课详情 - viewCourse: (id, data) => api_request.net.GET("/api/v1/sys-course-live/" + id, { buyer_id: data.buyer_id }), - // 直播课详情 测试 - viewCourse_test: (id, data) => api_request.net.GET("/api/v1/api-live-course/" + id, { buyer_id: data.buyer_id }), - /*题库 管理*/ - //题库 - getQuestionExercise: (data) => api_request.net.GET("/exercises", data), - // 科目 - subjectList: (data) => api_request.net.GET("/api/v1/public/subject", data), - // subjectList: data => net.GET('/app/subject/list', data), - // 获取学员学习列表接口 - learningList: (data) => api_request.net.GET("/api/v1/learning", data), - // 学习课程详情 - learningDetail: (data) => api_request.net.GET(`/api/v1/learning/course/${data}`), - // 学习直播课程详情 - learningLiveDetail: (data) => api_request.net.GET(`/api/v1/learning/course/live/${data}`), - // 学员学习计时接口 - // "time_type": "stop" //计时类型 start-开始计时 stop-停止计时 - studyDuration: (data) => api_request.net.POST("/api/v1/learning/course/duration", data), - // 学习统计API - courseStatistics: (data) => api_request.net.POST("/api/v1/learning/course/statistics", data), - // 题型分类 - questionBankType: (data) => api_request.net.GET("/api/v1/questionBank/type", data), - // 网课、测试、题库详情 - exercisesDetails: (data) => api_request.net.GET(`/api/v1/exercises/detail/${data}`), - // 测试练习题列表 - testList: (data) => api_request.net.GET("/api/v1/exercises/test/list", data), - // 模拟试卷列表 - examinationList: (data) => api_request.net.GET("/api/v1/examination/list", data), - // 获取题库、网课题目列表接口 - exerciseSubjectList: (data) => api_request.net.GET("/api/v1/exercise/subject/list", data), - // 试题分类 - exercisesType: (data) => api_request.net.GET("/api/v1/exercises/type", data), - // 模拟题详情 - examinationDetail: (id) => api_request.net.GET(`/api/v1/examination/detail/${id}`), - // 开始答题 - startTest: (data) => api_request.net.POST("/api/v1/exercises/start/answer", data), - // question_bank_id - // 交卷 - submitTest: (data) => api_request.net.POST("/api/v1/exercises/submit", data), - // 下一题 - nextSubject: (data) => api_request.net.POST("/api/v1/exercises/next", data), - // 重新答题 - againAnswer: (data) => api_request.net.POST("/api/v1/exercises/againAnswer", data), - // 答题成绩报告 - scoreReport: (data) => api_request.net.GET("/api/v1/exercises/achievement/report", data), - // 获取团购列表 - getGroupList: (data) => api_request.net.GET("/api/v1/group/page", data), - // 获取团购详情 - getGroupPurchaseData: (data) => api_request.net.GET("/api/v1/group", data), - //发起拼团 - starGroupPurchase: (data) => api_request.net.POST("/api/v1/group", data), - //加入拼团 - joinGroupPurchase: (data) => api_request.net.POST("/api/v1/group/join", data), - /** - * - * 支付接口 - * - */ - // 支付接口 - wxOrAlipay: (data) => api_request.net.POST("/api/v1/pay", data), - // 获取openid - getOpenID: (data) => { - return common_vendor.index.request({ - url: "https://api.weixin.qq.com/sns/oauth2/access_token", - method: "GET", - // header: { - // ...header, - // ...headers - // }, - data - }); - }, - // 余额支付 - yuePay: (data) => api_request.net.POST("/api/v1/student/pay/balance", data), - //H5下单API - // v3_pay:data => net.POST('https://api.mch.weixin.qq.com/v3/pay/transactions/h5',data) - v3_pay: (data) => { - return common_vendor.index.request({ - url: "https://api.mch.weixin.qq.com/v3/pay/transactions/h5", - method: "POST", - header: { - "Content-Type": "application/json" - }, - data - }); - }, - //测试 - pay_check: (data) => api_request.net.POST("/api/v1/wxpay/check", data), - pay_callback: (data) => api_request.net.POST("/api/v1/wxpay/callback", data), - /** - * - * 地址接口 - * - */ - // 列表 - addressList: (data) => api_request.net.POST("/api/v1/address", data), - // student_id - // 新增/编辑 - addressAction: (data) => api_request.net.POST(`/api/v1/address/add`, data), - editaddressAction: (data) => api_request.net.PUT(`/api/v1/address`, data), - // 删除 - addressDelete: (data) => api_request.net.DELETE("/api/v1/address", data), - // id - /** - * - * 购物车接口 - * - */ - // 列表 - cartList: (data) => api_request.net.POST("/api/v1/shopping/cart", data), - // 添加 - cartAdd: (data) => api_request.net.POST("/api/v1/shopping/cart/add", data), - // 编辑 - cartUpdate: (data) => api_request.net.POST("/api/v1/shopping/cart/update", data), - // 删除 - cartDelete: (data) => api_request.net.POST("/api/v1/shopping/cart/delete", data), - // id - /** - * - * 订单接口 - * - */ - // 订单查询 - orderList: (data) => api_request.net.POST("/api/v1/api-order/get/my/order/list", data), - // 确认收货 - orderUpdate: (data) => api_request.net.POST("/api/v1/api-order/update/material/order", data), - // 删除 - orderDelete: (data) => api_request.net.POST("/api/v1/api-order/delete/order", data), - /** - * 商品价格合计 - * @param { order_count_list: [{ id: '', order_type: '', num: ''}] } - * - */ - orderCount: (data) => api_request.net.POST("/api/v1/api-order/order/count", data), - /** - * 资料,在线课程的立即购买/购物车 - * @param { goods: [{ id: '', order_type: '', num: ''}], student_id: '' } - * - */ - orderBuynow: (data) => api_request.net.POST("/api/v1/api-order/order/buynow", data), - // 新增资料订单 - orderMaterialAdd: (data) => api_request.net.POST("/api/v1/api-order/add/material/order", data), - // 新增在线课程订单 - orderOnlineAdd: (data) => api_request.net.POST("/api/v1/api-order/add/online/order", data), - // 直播课订单 - orderLiveAdd: (data) => api_request.net.POST("/api/v1/api-order/add/live/order", data), - // 新增套餐课程订单 - orderComboAdd: (data) => api_request.net.POST("/api/v1/api-order/add/combo/order", data), - // 新增线下订单==报名 - orderOfflineAdd: (data) => api_request.net.POST("/api/v1/api-order/add/offline/order", data), - // 新增团购订单 - orderGroupAdd: (data) => api_request.net.POST("/api/v1/api-order/add/group/order", data), - // 分享平台 - shareProvider: () => api_request.net.getShareProvider(), - // 支付方式 - paymentProvider: () => api_request.net.getPaymentProvider(), - // 物流查询 - queryKuaidi: (data) => api_request.net.POST("/api/v1/kuaidi/poll/query", data), - // SHARE: () => net.SHARE(), - // 提现 - transfer: (data) => api_request.net.POST("/api/v1/wxpay/transfer", data), - // 获取我的收藏分页列表 - getStarList: (data) => api_request.net.POST("/api/v1/favorite/get", data), - // 取消收藏 - cancelStar: (data) => api_request.net.DELETE("/api/v1/favorite", data), - //添加收藏 - addStar: (data) => api_request.net.POST("/api/v1/favorite", data) -}; -exports.API = API; diff --git a/unpackage/dist/dev/mp-weixin/api/request.js b/unpackage/dist/dev/mp-weixin/api/request.js deleted file mode 100644 index bff5e5e..0000000 --- a/unpackage/dist/dev/mp-weixin/api/request.js +++ /dev/null @@ -1,190 +0,0 @@ -"use strict"; -const common_vendor = require("../common/vendor.js"); -const config_index = require("../config/index.js"); -const loginUrl = "pages/user/login"; -const net = { - REQUEST(url, method = "GET", data, checkLogin = true, header) { - let token = common_vendor.index.getStorageSync("access_token") || "Basic ZGV2OmRldjEyMw=="; - const headers = { - // "Content-Type": "application/json", - "Content-Type": "application/x-www-form-urlencoded", - "Authorization": token, - "x-token": token, - "token": token - // "X-Forwarded-For":'client_ip' - // 'Referer':'twzxjy.com' - }; - var pages = getCurrentPages(); - var page = pages[pages.length - 1]; - return common_vendor.index.request({ - url: config_index.config.baseUrl + url, - method, - header: { - ...header, - ...headers - }, - data - }).then((res) => { - if (res.statusCode === 200 && res.data) { - if (res.data.code === 409) { - common_vendor.index.showModal({ - title: "提示", - content: "您的账号已在其他设备登录,已强制下线!", - confirmColor: "#006647", - showCancel: false, - success: (res2) => { - if (res2.confirm) { - common_vendor.index.removeStorageSync("access_token"); - common_vendor.index.removeStorageSync("user_info"); - if (checkLogin && page.route != loginUrl) { - common_vendor.index.navigateTo({ - url: "/" + loginUrl - }); - } - } - } - }); - return { - ...res.data - }; - } - if (res.data.code === 5) { - common_vendor.index.removeStorageSync("access_token"); - if (page.route != loginUrl && checkLogin) { - common_vendor.index.navigateTo({ - url: "/" + loginUrl - }); - } - } - return res.data; - } else { - const reg = /abort/; - let code = 0; - let msg = res[0] && res[0].errMsg || "未知错误"; - if (res[0] && res[0].errMsg && reg.test(res[0].errMsg)) { - msg = "网络请求中断"; - } - return { - code, - msg, - data: null - }; - } - }).catch((parmas) => { - return parmas; - }); - }, - GET(url, body, checkLogin = true, header) { - return this.REQUEST(url, "GET", body, checkLogin, header); - }, - POST(url, body, checkLogin = true, header) { - return this.REQUEST(url, "POST", body, checkLogin, header); - }, - PUT(url, body, header) { - return this.REQUEST(url, "PUT", body, header); - }, - DELETE(url, body, header) { - return this.REQUEST(url, "DELETE", body, header); - }, - UPLOAD(data) { - return new Promise((resolve, reject) => { - let token = common_vendor.index.getStorageSync("access_token") || ""; - common_vendor.index.uploadFile({ - ...data, - url: config_index.config.base_url + data.url, - header: { - "Access-Token": token - }, - success(res) { - res.data = JSON.parse(res.data); - if (res.data.code === 401) { - common_vendor.index.removeStorageSync("access_token"); - common_vendor.index.removeStorageSync("userInfo"); - common_vendor.index.navigateTo({ - url: "/pages/login/login" - }); - } - resolve(res); - }, - fail(e) { - console.log(e); - reject(e); - } - }); - }); - }, - getShareProvider: () => { - return common_vendor.index.getProvider({ - service: "share" - }).then((res) => { - let data = []; - for (let i = 0; i < res.provider.length; i++) { - switch (res.provider[i]) { - case "weixin": - data.push({ - name: "微信好友", - id: "weixin", - icon: "/static/wx.png" - }); - data.push({ - name: "朋友圈", - id: "weixin", - type: "WXSenceTimeline", - icon: "/static/pyq.png" - }); - break; - case "qq": - data.push({ - name: "QQ好友", - id: "qq", - icon: "/static/qq.png" - }); - break; - } - } - return data; - }).catch((parmas) => { - return Promise.reject(); - }); - }, - getPaymentProvider: () => { - return common_vendor.index.getProvider({ - service: "payment" - }).then((res) => { - let data = []; - const aliPay = { - name: "支付宝支付", - id: "alipay", - icon: "/static/order/zfbp@3x.png" - }; - const wxPay = { - name: "微信支付", - id: "wxpay", - icon: "/static/order/wxp@3x.png" - }; - const yuePay = { - name: "余额支付", - id: "yepay", - icon: "/static/order/yep@3x.png" - }; - for (let i = 0; i < res[1].provider.length; i++) { - switch (res[1].provider[i]) { - case "alipay": - data.push({ - ...aliPay - }); - break; - case "wxpay": - data.push({ - ...wxPay - }); - break; - } - } - return [...data, yuePay]; - }).catch((parmas) => { - return Promise.reject(); - }); - } -}; -exports.net = net; diff --git a/unpackage/dist/dev/mp-weixin/app.js b/unpackage/dist/dev/mp-weixin/app.js deleted file mode 100644 index 024b67c..0000000 --- a/unpackage/dist/dev/mp-weixin/app.js +++ /dev/null @@ -1,36 +0,0 @@ -"use strict"; -Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); -const common_vendor = require("./common/vendor.js"); -if (!Math) { - "./pages/index/index.js"; - "./pages/wikipedia/index.js"; - "./pages/wikipedia/detail.js"; - "./pages/user/index.js"; - "./pages/user/userInfo.js"; - "./pages/login/login.js"; - "./pages/user/star.js"; - "./pages/user/setting.js"; - "./pages/user/feedback.js"; - "./pages/index/visionTest.js"; -} -const _sfc_main = { - onLaunch: function() { - console.log("App Launch"); - }, - onShow: function() { - console.log("App Show"); - }, - onHide: function() { - console.log("App Hide"); - } -}; -const App = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__file", "F:/项目2023/视力表/vision-record/App.vue"]]); -function createApp() { - const app = common_vendor.createSSRApp(App); - app.use(common_vendor.createPinia()); - return { - app - }; -} -createApp().app.mount("#app"); -exports.createApp = createApp; diff --git a/unpackage/dist/dev/mp-weixin/app.json b/unpackage/dist/dev/mp-weixin/app.json deleted file mode 100644 index e25d3ec..0000000 --- a/unpackage/dist/dev/mp-weixin/app.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "pages": [ - "pages/index/index", - "pages/wikipedia/index", - "pages/wikipedia/detail", - "pages/user/index", - "pages/user/userInfo", - "pages/login/login", - "pages/user/star", - "pages/user/setting", - "pages/user/feedback", - "pages/index/visionTest" - ], - "window": { - "navigationBarTextStyle": "white", - "navigationBarTitleText": "uni-app", - "navigationBarBackgroundColor": "#26758d", - "backgroundColor": "#F8F8F8" - }, - "tabBar": { - "color": "#999999", - "selectedColor": "#26758d", - "borderStyle": "black", - "backgroundColor": "#ffffff", - "list": [ - { - "pagePath": "pages/index/index", - "iconPath": "static/tabs/home.png", - "selectedIconPath": "static/tabs/home2.png", - "text": "首页" - }, - { - "pagePath": "pages/wikipedia/index", - "iconPath": "static/tabs/order.png", - "selectedIconPath": "static/tabs/order2.png", - "text": "百科" - }, - { - "pagePath": "pages/user/index", - "iconPath": "static/tabs/user.png", - "selectedIconPath": "static/tabs/user2.png", - "text": "我的" - } - ] - }, - "usingComponents": {} -} \ No newline at end of file diff --git a/unpackage/dist/dev/mp-weixin/app.wxss b/unpackage/dist/dev/mp-weixin/app.wxss deleted file mode 100644 index 524a2c5..0000000 --- a/unpackage/dist/dev/mp-weixin/app.wxss +++ /dev/null @@ -1,698 +0,0 @@ -/** - * 这里是uni-app内置的常用样式变量 - * - * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量 - * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App - * - */ -/** - * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能 - * - * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件 - */ -/* 颜色变量 */ -/* 行为相关颜色 */ -/* 文字基本颜色 */ -/* 背景颜色 */ -/* 边框颜色 */ -/* 尺寸变量 */ -/* 文字尺寸 */ -/* 图片尺寸 */ -/* Border Radius */ -/* 水平间距 */ -/* 垂直间距 */ -/* 透明度 */ -/* 文章场景相关 */ -.uniui-color:before { - content: "\e6cf"; -} -.uniui-wallet:before { - content: "\e6b1"; -} -.uniui-settings-filled:before { - content: "\e6ce"; -} -.uniui-auth-filled:before { - content: "\e6cc"; -} -.uniui-shop-filled:before { - content: "\e6cd"; -} -.uniui-staff-filled:before { - content: "\e6cb"; -} -.uniui-vip-filled:before { - content: "\e6c6"; -} -.uniui-plus-filled:before { - content: "\e6c7"; -} -.uniui-folder-add-filled:before { - content: "\e6c8"; -} -.uniui-color-filled:before { - content: "\e6c9"; -} -.uniui-tune-filled:before { - content: "\e6ca"; -} -.uniui-calendar-filled:before { - content: "\e6c0"; -} -.uniui-notification-filled:before { - content: "\e6c1"; -} -.uniui-wallet-filled:before { - content: "\e6c2"; -} -.uniui-medal-filled:before { - content: "\e6c3"; -} -.uniui-gift-filled:before { - content: "\e6c4"; -} -.uniui-fire-filled:before { - content: "\e6c5"; -} -.uniui-refreshempty:before { - content: "\e6bf"; -} -.uniui-location-filled:before { - content: "\e6af"; -} -.uniui-person-filled:before { - content: "\e69d"; -} -.uniui-personadd-filled:before { - content: "\e698"; -} -.uniui-back:before { - content: "\e6b9"; -} -.uniui-forward:before { - content: "\e6ba"; -} -.uniui-arrow-right:before { - content: "\e6bb"; -} -.uniui-arrowthinright:before { - content: "\e6bb"; -} -.uniui-arrow-left:before { - content: "\e6bc"; -} -.uniui-arrowthinleft:before { - content: "\e6bc"; -} -.uniui-arrow-up:before { - content: "\e6bd"; -} -.uniui-arrowthinup:before { - content: "\e6bd"; -} -.uniui-arrow-down:before { - content: "\e6be"; -} -.uniui-arrowthindown:before { - content: "\e6be"; -} -.uniui-bottom:before { - content: "\e6b8"; -} -.uniui-arrowdown:before { - content: "\e6b8"; -} -.uniui-right:before { - content: "\e6b5"; -} -.uniui-arrowright:before { - content: "\e6b5"; -} -.uniui-top:before { - content: "\e6b6"; -} -.uniui-arrowup:before { - content: "\e6b6"; -} -.uniui-left:before { - content: "\e6b7"; -} -.uniui-arrowleft:before { - content: "\e6b7"; -} -.uniui-eye:before { - content: "\e651"; -} -.uniui-eye-filled:before { - content: "\e66a"; -} -.uniui-eye-slash:before { - content: "\e6b3"; -} -.uniui-eye-slash-filled:before { - content: "\e6b4"; -} -.uniui-info-filled:before { - content: "\e649"; -} -.uniui-reload:before { - content: "\e6b2"; -} -.uniui-micoff-filled:before { - content: "\e6b0"; -} -.uniui-map-pin-ellipse:before { - content: "\e6ac"; -} -.uniui-map-pin:before { - content: "\e6ad"; -} -.uniui-location:before { - content: "\e6ae"; -} -.uniui-starhalf:before { - content: "\e683"; -} -.uniui-star:before { - content: "\e688"; -} -.uniui-star-filled:before { - content: "\e68f"; -} -.uniui-calendar:before { - content: "\e6a0"; -} -.uniui-fire:before { - content: "\e6a1"; -} -.uniui-medal:before { - content: "\e6a2"; -} -.uniui-font:before { - content: "\e6a3"; -} -.uniui-gift:before { - content: "\e6a4"; -} -.uniui-link:before { - content: "\e6a5"; -} -.uniui-notification:before { - content: "\e6a6"; -} -.uniui-staff:before { - content: "\e6a7"; -} -.uniui-vip:before { - content: "\e6a8"; -} -.uniui-folder-add:before { - content: "\e6a9"; -} -.uniui-tune:before { - content: "\e6aa"; -} -.uniui-auth:before { - content: "\e6ab"; -} -.uniui-person:before { - content: "\e699"; -} -.uniui-email-filled:before { - content: "\e69a"; -} -.uniui-phone-filled:before { - content: "\e69b"; -} -.uniui-phone:before { - content: "\e69c"; -} -.uniui-email:before { - content: "\e69e"; -} -.uniui-personadd:before { - content: "\e69f"; -} -.uniui-chatboxes-filled:before { - content: "\e692"; -} -.uniui-contact:before { - content: "\e693"; -} -.uniui-chatbubble-filled:before { - content: "\e694"; -} -.uniui-contact-filled:before { - content: "\e695"; -} -.uniui-chatboxes:before { - content: "\e696"; -} -.uniui-chatbubble:before { - content: "\e697"; -} -.uniui-upload-filled:before { - content: "\e68e"; -} -.uniui-upload:before { - content: "\e690"; -} -.uniui-weixin:before { - content: "\e691"; -} -.uniui-compose:before { - content: "\e67f"; -} -.uniui-qq:before { - content: "\e680"; -} -.uniui-download-filled:before { - content: "\e681"; -} -.uniui-pyq:before { - content: "\e682"; -} -.uniui-sound:before { - content: "\e684"; -} -.uniui-trash-filled:before { - content: "\e685"; -} -.uniui-sound-filled:before { - content: "\e686"; -} -.uniui-trash:before { - content: "\e687"; -} -.uniui-videocam-filled:before { - content: "\e689"; -} -.uniui-spinner-cycle:before { - content: "\e68a"; -} -.uniui-weibo:before { - content: "\e68b"; -} -.uniui-videocam:before { - content: "\e68c"; -} -.uniui-download:before { - content: "\e68d"; -} -.uniui-help:before { - content: "\e679"; -} -.uniui-navigate-filled:before { - content: "\e67a"; -} -.uniui-plusempty:before { - content: "\e67b"; -} -.uniui-smallcircle:before { - content: "\e67c"; -} -.uniui-minus-filled:before { - content: "\e67d"; -} -.uniui-micoff:before { - content: "\e67e"; -} -.uniui-closeempty:before { - content: "\e66c"; -} -.uniui-clear:before { - content: "\e66d"; -} -.uniui-navigate:before { - content: "\e66e"; -} -.uniui-minus:before { - content: "\e66f"; -} -.uniui-image:before { - content: "\e670"; -} -.uniui-mic:before { - content: "\e671"; -} -.uniui-paperplane:before { - content: "\e672"; -} -.uniui-close:before { - content: "\e673"; -} -.uniui-help-filled:before { - content: "\e674"; -} -.uniui-paperplane-filled:before { - content: "\e675"; -} -.uniui-plus:before { - content: "\e676"; -} -.uniui-mic-filled:before { - content: "\e677"; -} -.uniui-image-filled:before { - content: "\e678"; -} -.uniui-locked-filled:before { - content: "\e668"; -} -.uniui-info:before { - content: "\e669"; -} -.uniui-locked:before { - content: "\e66b"; -} -.uniui-camera-filled:before { - content: "\e658"; -} -.uniui-chat-filled:before { - content: "\e659"; -} -.uniui-camera:before { - content: "\e65a"; -} -.uniui-circle:before { - content: "\e65b"; -} -.uniui-checkmarkempty:before { - content: "\e65c"; -} -.uniui-chat:before { - content: "\e65d"; -} -.uniui-circle-filled:before { - content: "\e65e"; -} -.uniui-flag:before { - content: "\e65f"; -} -.uniui-flag-filled:before { - content: "\e660"; -} -.uniui-gear-filled:before { - content: "\e661"; -} -.uniui-home:before { - content: "\e662"; -} -.uniui-home-filled:before { - content: "\e663"; -} -.uniui-gear:before { - content: "\e664"; -} -.uniui-smallcircle-filled:before { - content: "\e665"; -} -.uniui-map-filled:before { - content: "\e666"; -} -.uniui-map:before { - content: "\e667"; -} -.uniui-refresh-filled:before { - content: "\e656"; -} -.uniui-refresh:before { - content: "\e657"; -} -.uniui-cloud-upload:before { - content: "\e645"; -} -.uniui-cloud-download-filled:before { - content: "\e646"; -} -.uniui-cloud-download:before { - content: "\e647"; -} -.uniui-cloud-upload-filled:before { - content: "\e648"; -} -.uniui-redo:before { - content: "\e64a"; -} -.uniui-images-filled:before { - content: "\e64b"; -} -.uniui-undo-filled:before { - content: "\e64c"; -} -.uniui-more:before { - content: "\e64d"; -} -.uniui-more-filled:before { - content: "\e64e"; -} -.uniui-undo:before { - content: "\e64f"; -} -.uniui-images:before { - content: "\e650"; -} -.uniui-paperclip:before { - content: "\e652"; -} -.uniui-settings:before { - content: "\e653"; -} -.uniui-search:before { - content: "\e654"; -} -.uniui-redo-filled:before { - content: "\e655"; -} -.uniui-list:before { - content: "\e644"; -} -.uniui-mail-open-filled:before { - content: "\e63a"; -} -.uniui-hand-down-filled:before { - content: "\e63c"; -} -.uniui-hand-down:before { - content: "\e63d"; -} -.uniui-hand-up-filled:before { - content: "\e63e"; -} -.uniui-hand-up:before { - content: "\e63f"; -} -.uniui-heart-filled:before { - content: "\e641"; -} -.uniui-mail-open:before { - content: "\e643"; -} -.uniui-heart:before { - content: "\e639"; -} -.uniui-loop:before { - content: "\e633"; -} -.uniui-pulldown:before { - content: "\e632"; -} -.uniui-scan:before { - content: "\e62a"; -} -.uniui-bars:before { - content: "\e627"; -} -.uniui-cart-filled:before { - content: "\e629"; -} -.uniui-checkbox:before { - content: "\e62b"; -} -.uniui-checkbox-filled:before { - content: "\e62c"; -} -.uniui-shop:before { - content: "\e62f"; -} -.uniui-headphones:before { - content: "\e630"; -} -.uniui-cart:before { - content: "\e631"; -} -@font-face { - font-family: uniicons; - src: url("data:font/ttf;base64,AAEAAAALAIAAAwAwR1NVQiCLJXoAAAE4AAAAVE9TLzI8PEmfAAABjAAAAGBjbWFwI/huxgAABGgAAAo2Z2x5ZjdREQoAAA/gAABxyGhlYWQeRxNVAAAA4AAAADZoaGVhB94EIAAAALwAAAAkaG10eHwAAAAAAAHsAAACfGxvY2G+ANjyAAAOoAAAAUBtYXhwAbUAqgAAARgAAAAgbmFtZTe8RacAAIGoAAACZ3Bvc3S0buJjAACEEAAAB54AAQAAA4D/gABcBAAAAAAABAAAAQAAAAAAAAAAAAAAAAAAAJ8AAQAAAAEAAFISLZRfDzz1AAsEAAAAAADdk+etAAAAAN2T560AAP/gBAADHgAAAAgAAgAAAAAAAAABAAAAnwCeAAwAAAAAAAIAAAAKAAoAAAD/AAAAAAAAAAEAAAAKADAAPgACREZMVAAObGF0bgAaAAQAAAAAAAAAAQAAAAQAAAAAAAAAAQAAAAFsaWdhAAgAAAABAAAAAQAEAAQAAAABAAgAAQAGAAAAAQAAAAQEAAGQAAUAAAKJAswAAACPAokCzAAAAesAMgEIAAACAAUDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFBmRWQAwOYn5s8DgP+AAAAD3ACAAAAAAQAAAAAAAAAAAAAAAAACBAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAA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vbWUtZmlsbGVkBGdlYXISc21hbGxjaXJjbGUtZmlsbGVkCm1hcC1maWxsZWQDbWFwDnJlZnJlc2gtZmlsbGVkB3JlZnJlc2gMY2xvdWQtdXBsb2FkFWNsb3VkLWRvd25sb2FkLWZpbGxlZA5jbG91ZC1kb3dubG9hZBNjbG91ZC11cGxvYWQtZmlsbGVkBHJlZG8NaW1hZ2VzLWZpbGxlZAt1bmRvLWZpbGxlZARtb3JlC21vcmUtZmlsbGVkBHVuZG8GaW1hZ2VzCXBhcGVyY2xpcAhzZXR0aW5ncwZzZWFyY2gLcmVkby1maWxsZWQEbGlzdBBtYWlsLW9wZW4tZmlsbGVkEGhhbmQtZG93bi1maWxsZWQJaGFuZC1kb3duDmhhbmQtdXAtZmlsbGVkB2hhbmQtdXAMaGVhcnQtZmlsbGVkCW1haWwtb3BlbgVoZWFydARsb29wCHB1bGxkb3duBHNjYW4EYmFycwtjYXJ0LWZpbGxlZAhjaGVja2JveA9jaGVja2JveC1maWxsZWQEc2hvcApoZWFkcGhvbmVzBGNhcnQAAAAA") format("truetype"); -} -.uni-icons { - font-family: uniicons; - text-decoration: none; - text-align: center; -} -/** - * 这里是uni-app内置的常用样式变量 - * - * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量 - * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App - * - */ -/** - * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能 - * - * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件 - */ -/* 颜色变量 */ -/* 行为相关颜色 */ -/* 文字基本颜色 */ -/* 背景颜色 */ -/* 边框颜色 */ -/* 尺寸变量 */ -/* 文字尺寸 */ -/* 图片尺寸 */ -/* Border Radius */ -/* 水平间距 */ -/* 垂直间距 */ -/* 透明度 */ -/* 文章场景相关 */ -/*每个页面公共css */ -.page-bg-gray { - background: #f8f8f8; -} -.page-box { - /* height: 100%; - overflow: scroll; */ - min-height: 100%; -} -uni-page-body, page { - height: 100%; -} -page { - font-size: 28rpx; -} -.text-ellipsis-1 { - /*超出部分省略号 单行*/ - overflow: hidden; - text-overflow: ellipsis; - -webkit-line-clamp: 1; - display: -webkit-box; - -webkit-box-orient: vertical; - /* min-height: 38rpx; */ -} -.icon-custom { - width: 32rpx; - height: 32rpx; -} -.small-text { - color: gray !important; - font-size: 24rpx; - font-weight: 100 !important; -} -.bold-text { - font-weight: 600; - font-size: 36rpx; -} -.margin-line { - height: 20rpx; - width: 100%; - background-color: #f8f8f8; -} -.clearCss { - opacity: 0 !important; -} -.shim { - /* 垫片 */ - width: 100%; - height: 140rpx; -} -.big-text { - font-size: 80rpx; - /* font-weight: 600; */ -} -.red-text { - color: red; -} -.line { - height: 2rpx; - width: 100%; - background-color: #e7e7e7; -} -.num-show { - position: absolute; - width: 40rpx; - height: 40rpx; - color: white; - background: #7cc4e8; - border-radius: 50%; - display: flex; - align-items: center; - justify-content: center; - top: -24rpx; - right: -10rpx; - border: 2rpx solid white; -} - -/* 通用卡片样式 */ -.u-card { - background-color: white; -} -.u-card .u-card-row:last-child { - border-bottom: unset; -} -.u-card .u-card-row { - padding: 40rpx; - border-bottom: 2rpx solid #e7e7e7; -} -.u-card .u-card-row .u-card-row-btn { - color: #086EC7; -} -.u-card .u-card-row .u-card-row-top, .u-card .u-card-row .u-card-row-content { - display: flex; - align-items: center; - justify-content: space-between; -} -.u-card .u-card-row .u-card-row-top { - padding-bottom: 40rpx; -} -.u-card .u-card-row .u-card-row-top .u-card-right .u-card-right-btn { - color: #7cc4e8; -} -.u-card .u-card-row .u-card-row-content .u-card-right { - display: flex; -} -.popup-content { - padding-top: 40rpx; - background-color: white; - border-radius: 20rpx 20rpx 0 0; - overflow: scroll; -} -.small-btn-css { - background: #7CC4E8; - color: white; - padding: 6rpx 40rpx; - border-radius: 40rpx; - font-size: 28rpx; - white-space: nowrap; - margin-left: 10rpx; - position: relative; -} -.cancel-btn { - display: block; - margin-top: 20rpx; -} -.cancel-btn .add-btn { - background: white !important; - color: black !important; - border: 2rpx solid #7cc4e8 !important; -} -.invalidCss { - background-color: #767676 !important; -} - .uni-popup__wrapper { - bottom: -34px; -} - .popup-content { - bottom: -34px; - padding-bottom: 34px; - background-color: white; -}page{--status-bar-height:25px;--top-window-height:0px;--window-top:0px;--window-bottom:0px;--window-left:0px;--window-right:0px;--window-magin:0px}[data-c-h="true"]{display: none !important;} \ No newline at end of file diff --git a/unpackage/dist/dev/mp-weixin/common/vendor.js b/unpackage/dist/dev/mp-weixin/common/vendor.js deleted file mode 100644 index 1629c0f..0000000 --- a/unpackage/dist/dev/mp-weixin/common/vendor.js +++ /dev/null @@ -1,7748 +0,0 @@ -"use strict"; -const _export_sfc = (sfc, props) => { - const target = sfc.__vccOpts || sfc; - for (const [key, val] of props) { - target[key] = val; - } - return target; -}; -function makeMap(str, expectsLowerCase) { - const map = /* @__PURE__ */ Object.create(null); - const list = str.split(","); - for (let i = 0; i < list.length; i++) { - map[list[i]] = true; - } - return expectsLowerCase ? (val) => !!map[val.toLowerCase()] : (val) => !!map[val]; -} -function normalizeStyle(value) { - if (isArray(value)) { - const res = {}; - for (let i = 0; i < value.length; i++) { - const item = value[i]; - const normalized = isString(item) ? parseStringStyle(item) : normalizeStyle(item); - if (normalized) { - for (const key in normalized) { - res[key] = normalized[key]; - } - } - } - return res; - } else if (isString(value)) { - return value; - } else if (isObject$1(value)) { - return value; - } -} -const listDelimiterRE = /;(?![^(]*\))/g; -const propertyDelimiterRE = /:([^]+)/; -const styleCommentRE = /\/\*.*?\*\//gs; -function parseStringStyle(cssText) { - const ret = {}; - cssText.replace(styleCommentRE, "").split(listDelimiterRE).forEach((item) => { - if (item) { - const tmp = item.split(propertyDelimiterRE); - tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim()); - } - }); - return ret; -} -function normalizeClass(value) { - let res = ""; - if (isString(value)) { - res = value; - } else if (isArray(value)) { - for (let i = 0; i < value.length; i++) { - const normalized = normalizeClass(value[i]); - if (normalized) { - res += normalized + " "; - } - } - } else if (isObject$1(value)) { - for (const name in value) { - if (value[name]) { - res += name + " "; - } - } - } - return res.trim(); -} -const toDisplayString = (val) => { - return isString(val) ? val : val == null ? "" : isArray(val) || isObject$1(val) && (val.toString === objectToString || !isFunction(val.toString)) ? JSON.stringify(val, replacer, 2) : String(val); -}; -const replacer = (_key, val) => { - if (val && val.__v_isRef) { - return replacer(_key, val.value); - } else if (isMap(val)) { - return { - [`Map(${val.size})`]: [...val.entries()].reduce((entries, [key, val2]) => { - entries[`${key} =>`] = val2; - return entries; - }, {}) - }; - } else if (isSet(val)) { - return { - [`Set(${val.size})`]: [...val.values()] - }; - } else if (isObject$1(val) && !isArray(val) && !isPlainObject$1(val)) { - return String(val); - } - return val; -}; -const EMPTY_OBJ = Object.freeze({}); -const EMPTY_ARR = Object.freeze([]); -const NOOP = () => { -}; -const NO = () => false; -const onRE = /^on[^a-z]/; -const isOn = (key) => onRE.test(key); -const isModelListener = (key) => key.startsWith("onUpdate:"); -const extend = Object.assign; -const remove = (arr, el) => { - const i = arr.indexOf(el); - if (i > -1) { - arr.splice(i, 1); - } -}; -const hasOwnProperty$2 = Object.prototype.hasOwnProperty; -const hasOwn$1 = (val, key) => hasOwnProperty$2.call(val, key); -const isArray = Array.isArray; -const isMap = (val) => toTypeString(val) === "[object Map]"; -const isSet = (val) => toTypeString(val) === "[object Set]"; -const isFunction = (val) => typeof val === "function"; -const isString = (val) => typeof val === "string"; -const isSymbol = (val) => typeof val === "symbol"; -const isObject$1 = (val) => val !== null && typeof val === "object"; -const isPromise = (val) => { - return isObject$1(val) && isFunction(val.then) && isFunction(val.catch); -}; -const objectToString = Object.prototype.toString; -const toTypeString = (value) => objectToString.call(value); -const toRawType = (value) => { - return toTypeString(value).slice(8, -1); -}; -const isPlainObject$1 = (val) => toTypeString(val) === "[object Object]"; -const isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key; -const isReservedProp = /* @__PURE__ */ makeMap( - // the leading comma is intentional so empty string "" is also included - ",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted" -); -const isBuiltInDirective = /* @__PURE__ */ makeMap("bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo"); -const cacheStringFunction = (fn) => { - const cache = /* @__PURE__ */ Object.create(null); - return (str) => { - const hit = cache[str]; - return hit || (cache[str] = fn(str)); - }; -}; -const camelizeRE = /-(\w)/g; -const camelize = cacheStringFunction((str) => { - return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : ""); -}); -const hyphenateRE = /\B([A-Z])/g; -const hyphenate = cacheStringFunction((str) => str.replace(hyphenateRE, "-$1").toLowerCase()); -const capitalize = cacheStringFunction((str) => str.charAt(0).toUpperCase() + str.slice(1)); -const toHandlerKey = cacheStringFunction((str) => str ? `on${capitalize(str)}` : ``); -const hasChanged = (value, oldValue) => !Object.is(value, oldValue); -const invokeArrayFns$1 = (fns, arg) => { - for (let i = 0; i < fns.length; i++) { - fns[i](arg); - } -}; -const def = (obj, key, value) => { - Object.defineProperty(obj, key, { - configurable: true, - enumerable: false, - value - }); -}; -const looseToNumber = (val) => { - const n2 = parseFloat(val); - return isNaN(n2) ? val : n2; -}; -const LINEFEED = "\n"; -const SLOT_DEFAULT_NAME = "d"; -const ON_SHOW = "onShow"; -const ON_HIDE = "onHide"; -const ON_LAUNCH = "onLaunch"; -const ON_ERROR = "onError"; -const ON_THEME_CHANGE = "onThemeChange"; -const ON_PAGE_NOT_FOUND = "onPageNotFound"; -const ON_UNHANDLE_REJECTION = "onUnhandledRejection"; -const ON_LOAD = "onLoad"; -const ON_READY = "onReady"; -const ON_UNLOAD = "onUnload"; -const ON_INIT = "onInit"; -const ON_SAVE_EXIT_STATE = "onSaveExitState"; -const ON_RESIZE = "onResize"; -const ON_BACK_PRESS = "onBackPress"; -const ON_PAGE_SCROLL = "onPageScroll"; -const ON_TAB_ITEM_TAP = "onTabItemTap"; -const ON_REACH_BOTTOM = "onReachBottom"; -const ON_PULL_DOWN_REFRESH = "onPullDownRefresh"; -const ON_SHARE_TIMELINE = "onShareTimeline"; -const ON_ADD_TO_FAVORITES = "onAddToFavorites"; -const ON_SHARE_APP_MESSAGE = "onShareAppMessage"; -const ON_NAVIGATION_BAR_BUTTON_TAP = "onNavigationBarButtonTap"; -const ON_NAVIGATION_BAR_SEARCH_INPUT_CLICKED = "onNavigationBarSearchInputClicked"; -const ON_NAVIGATION_BAR_SEARCH_INPUT_CHANGED = "onNavigationBarSearchInputChanged"; -const ON_NAVIGATION_BAR_SEARCH_INPUT_CONFIRMED = "onNavigationBarSearchInputConfirmed"; -const ON_NAVIGATION_BAR_SEARCH_INPUT_FOCUS_CHANGED = "onNavigationBarSearchInputFocusChanged"; -const customizeRE = /:/g; -function customizeEvent(str) { - return camelize(str.replace(customizeRE, "-")); -} -function hasLeadingSlash(str) { - return str.indexOf("/") === 0; -} -function addLeadingSlash(str) { - return hasLeadingSlash(str) ? str : "/" + str; -} -const invokeArrayFns = (fns, arg) => { - let ret; - for (let i = 0; i < fns.length; i++) { - ret = fns[i](arg); - } - return ret; -}; -function once(fn, ctx = null) { - let res; - return (...args) => { - if (fn) { - res = fn.apply(ctx, args); - fn = null; - } - return res; - }; -} -function getValueByDataPath(obj, path) { - if (!isString(path)) { - return; - } - path = path.replace(/\[(\d+)\]/g, ".$1"); - const parts = path.split("."); - let key = parts[0]; - if (!obj) { - obj = {}; - } - if (parts.length === 1) { - return obj[key]; - } - return getValueByDataPath(obj[key], parts.slice(1).join(".")); -} -function sortObject(obj) { - let sortObj = {}; - if (isPlainObject$1(obj)) { - Object.keys(obj).sort().forEach((key) => { - const _key = key; - sortObj[_key] = obj[_key]; - }); - } - return !Object.keys(sortObj) ? obj : sortObj; -} -const encode = encodeURIComponent; -function stringifyQuery(obj, encodeStr = encode) { - const res = obj ? Object.keys(obj).map((key) => { - let val = obj[key]; - if (typeof val === void 0 || val === null) { - val = ""; - } else if (isPlainObject$1(val)) { - val = JSON.stringify(val); - } - return encodeStr(key) + "=" + encodeStr(val); - }).filter((x) => x.length > 0).join("&") : null; - return res ? `?${res}` : ""; -} -const PAGE_HOOKS = [ - ON_INIT, - ON_LOAD, - ON_SHOW, - ON_HIDE, - ON_UNLOAD, - ON_BACK_PRESS, - ON_PAGE_SCROLL, - ON_TAB_ITEM_TAP, - ON_REACH_BOTTOM, - ON_PULL_DOWN_REFRESH, - ON_SHARE_TIMELINE, - ON_SHARE_APP_MESSAGE, - ON_ADD_TO_FAVORITES, - ON_SAVE_EXIT_STATE, - ON_NAVIGATION_BAR_BUTTON_TAP, - ON_NAVIGATION_BAR_SEARCH_INPUT_CLICKED, - ON_NAVIGATION_BAR_SEARCH_INPUT_CHANGED, - ON_NAVIGATION_BAR_SEARCH_INPUT_CONFIRMED, - ON_NAVIGATION_BAR_SEARCH_INPUT_FOCUS_CHANGED -]; -function isRootHook(name) { - return PAGE_HOOKS.indexOf(name) > -1; -} -const UniLifecycleHooks = [ - ON_SHOW, - ON_HIDE, - ON_LAUNCH, - ON_ERROR, - ON_THEME_CHANGE, - ON_PAGE_NOT_FOUND, - ON_UNHANDLE_REJECTION, - ON_INIT, - ON_LOAD, - ON_READY, - ON_UNLOAD, - ON_RESIZE, - ON_BACK_PRESS, - ON_PAGE_SCROLL, - ON_TAB_ITEM_TAP, - ON_REACH_BOTTOM, - ON_PULL_DOWN_REFRESH, - ON_SHARE_TIMELINE, - ON_ADD_TO_FAVORITES, - ON_SHARE_APP_MESSAGE, - ON_SAVE_EXIT_STATE, - ON_NAVIGATION_BAR_BUTTON_TAP, - ON_NAVIGATION_BAR_SEARCH_INPUT_CLICKED, - ON_NAVIGATION_BAR_SEARCH_INPUT_CHANGED, - ON_NAVIGATION_BAR_SEARCH_INPUT_CONFIRMED, - ON_NAVIGATION_BAR_SEARCH_INPUT_FOCUS_CHANGED -]; -const MINI_PROGRAM_PAGE_RUNTIME_HOOKS = /* @__PURE__ */ (() => { - return { - onPageScroll: 1, - onShareAppMessage: 1 << 1, - onShareTimeline: 1 << 2 - }; -})(); -function isUniLifecycleHook(name, value, checkType = true) { - if (checkType && !isFunction(value)) { - return false; - } - if (UniLifecycleHooks.indexOf(name) > -1) { - return true; - } else if (name.indexOf("on") === 0) { - return true; - } - return false; -} -let vueApp; -const createVueAppHooks = []; -function onCreateVueApp(hook) { - if (vueApp) { - return hook(vueApp); - } - createVueAppHooks.push(hook); -} -function invokeCreateVueAppHook(app) { - vueApp = app; - createVueAppHooks.forEach((hook) => hook(app)); -} -const invokeCreateErrorHandler = once((app, createErrorHandler2) => { - if (isFunction(app._component.onError)) { - return createErrorHandler2(app); - } -}); -const E = function() { -}; -E.prototype = { - on: function(name, callback, ctx) { - var e2 = this.e || (this.e = {}); - (e2[name] || (e2[name] = [])).push({ - fn: callback, - ctx - }); - return this; - }, - once: function(name, callback, ctx) { - var self = this; - function listener() { - self.off(name, listener); - callback.apply(ctx, arguments); - } - listener._ = callback; - return this.on(name, listener, ctx); - }, - emit: function(name) { - var data = [].slice.call(arguments, 1); - var evtArr = ((this.e || (this.e = {}))[name] || []).slice(); - var i = 0; - var len = evtArr.length; - for (i; i < len; i++) { - evtArr[i].fn.apply(evtArr[i].ctx, data); - } - return this; - }, - off: function(name, callback) { - var e2 = this.e || (this.e = {}); - var evts = e2[name]; - var liveEvents = []; - if (evts && callback) { - for (var i = 0, len = evts.length; i < len; i++) { - if (evts[i].fn !== callback && evts[i].fn._ !== callback) - liveEvents.push(evts[i]); - } - } - liveEvents.length ? e2[name] = liveEvents : delete e2[name]; - return this; - } -}; -var E$1 = E; -const isObject = (val) => val !== null && typeof val === "object"; -const defaultDelimiters = ["{", "}"]; -class BaseFormatter { - constructor() { - this._caches = /* @__PURE__ */ Object.create(null); - } - interpolate(message, values, delimiters = defaultDelimiters) { - if (!values) { - return [message]; - } - let tokens = this._caches[message]; - if (!tokens) { - tokens = parse(message, delimiters); - this._caches[message] = tokens; - } - return compile$1(tokens, values); - } -} -const RE_TOKEN_LIST_VALUE = /^(?:\d)+/; -const RE_TOKEN_NAMED_VALUE = /^(?:\w)+/; -function parse(format, [startDelimiter, endDelimiter]) { - const tokens = []; - let position = 0; - let text = ""; - while (position < format.length) { - let char = format[position++]; - if (char === startDelimiter) { - if (text) { - tokens.push({ type: "text", value: text }); - } - text = ""; - let sub = ""; - char = format[position++]; - while (char !== void 0 && char !== endDelimiter) { - sub += char; - char = format[position++]; - } - const isClosed = char === endDelimiter; - const type = RE_TOKEN_LIST_VALUE.test(sub) ? "list" : isClosed && RE_TOKEN_NAMED_VALUE.test(sub) ? "named" : "unknown"; - tokens.push({ value: sub, type }); - } else { - text += char; - } - } - text && tokens.push({ type: "text", value: text }); - return tokens; -} -function compile$1(tokens, values) { - const compiled = []; - let index2 = 0; - const mode = Array.isArray(values) ? "list" : isObject(values) ? "named" : "unknown"; - if (mode === "unknown") { - return compiled; - } - while (index2 < tokens.length) { - const token = tokens[index2]; - switch (token.type) { - case "text": - compiled.push(token.value); - break; - case "list": - compiled.push(values[parseInt(token.value, 10)]); - break; - case "named": - if (mode === "named") { - compiled.push(values[token.value]); - } else { - { - console.warn(`Type of token '${token.type}' and format of value '${mode}' don't match!`); - } - } - break; - case "unknown": - { - console.warn(`Detect 'unknown' type of token!`); - } - break; - } - index2++; - } - return compiled; -} -const LOCALE_ZH_HANS = "zh-Hans"; -const LOCALE_ZH_HANT = "zh-Hant"; -const LOCALE_EN = "en"; -const LOCALE_FR = "fr"; -const LOCALE_ES = "es"; -const hasOwnProperty$1 = Object.prototype.hasOwnProperty; -const hasOwn = (val, key) => hasOwnProperty$1.call(val, key); -const defaultFormatter = new BaseFormatter(); -function include(str, parts) { - return !!parts.find((part) => str.indexOf(part) !== -1); -} -function startsWith(str, parts) { - return parts.find((part) => str.indexOf(part) === 0); -} -function normalizeLocale(locale, messages) { - if (!locale) { - return; - } - locale = locale.trim().replace(/_/g, "-"); - if (messages && messages[locale]) { - return locale; - } - locale = locale.toLowerCase(); - if (locale === "chinese") { - return LOCALE_ZH_HANS; - } - if (locale.indexOf("zh") === 0) { - if (locale.indexOf("-hans") > -1) { - return LOCALE_ZH_HANS; - } - if (locale.indexOf("-hant") > -1) { - return LOCALE_ZH_HANT; - } - if (include(locale, ["-tw", "-hk", "-mo", "-cht"])) { - return LOCALE_ZH_HANT; - } - return LOCALE_ZH_HANS; - } - let locales = [LOCALE_EN, LOCALE_FR, LOCALE_ES]; - if (messages && Object.keys(messages).length > 0) { - locales = Object.keys(messages); - } - const lang = startsWith(locale, locales); - if (lang) { - return lang; - } -} -class I18n { - constructor({ locale, fallbackLocale, messages, watcher, formater }) { - this.locale = LOCALE_EN; - this.fallbackLocale = LOCALE_EN; - this.message = {}; - this.messages = {}; - this.watchers = []; - if (fallbackLocale) { - this.fallbackLocale = fallbackLocale; - } - this.formater = formater || defaultFormatter; - this.messages = messages || {}; - this.setLocale(locale || LOCALE_EN); - if (watcher) { - this.watchLocale(watcher); - } - } - setLocale(locale) { - const oldLocale = this.locale; - this.locale = normalizeLocale(locale, this.messages) || this.fallbackLocale; - if (!this.messages[this.locale]) { - this.messages[this.locale] = {}; - } - this.message = this.messages[this.locale]; - if (oldLocale !== this.locale) { - this.watchers.forEach((watcher) => { - watcher(this.locale, oldLocale); - }); - } - } - getLocale() { - return this.locale; - } - watchLocale(fn) { - const index2 = this.watchers.push(fn) - 1; - return () => { - this.watchers.splice(index2, 1); - }; - } - add(locale, message, override = true) { - const curMessages = this.messages[locale]; - if (curMessages) { - if (override) { - Object.assign(curMessages, message); - } else { - Object.keys(message).forEach((key) => { - if (!hasOwn(curMessages, key)) { - curMessages[key] = message[key]; - } - }); - } - } else { - this.messages[locale] = message; - } - } - f(message, values, delimiters) { - return this.formater.interpolate(message, values, delimiters).join(""); - } - t(key, locale, values) { - let message = this.message; - if (typeof locale === "string") { - locale = normalizeLocale(locale, this.messages); - locale && (message = this.messages[locale]); - } else { - values = locale; - } - if (!hasOwn(message, key)) { - console.warn(`Cannot translate the value of keypath ${key}. Use the value of keypath as default.`); - return key; - } - return this.formater.interpolate(message[key], values).join(""); - } -} -function watchAppLocale(appVm, i18n) { - if (appVm.$watchLocale) { - appVm.$watchLocale((newLocale) => { - i18n.setLocale(newLocale); - }); - } else { - appVm.$watch(() => appVm.$locale, (newLocale) => { - i18n.setLocale(newLocale); - }); - } -} -function getDefaultLocale() { - if (typeof index !== "undefined" && index.getLocale) { - return index.getLocale(); - } - if (typeof global !== "undefined" && global.getLocale) { - return global.getLocale(); - } - return LOCALE_EN; -} -function initVueI18n(locale, messages = {}, fallbackLocale, watcher) { - if (typeof locale !== "string") { - [locale, messages] = [ - messages, - locale - ]; - } - if (typeof locale !== "string") { - locale = getDefaultLocale(); - } - if (typeof fallbackLocale !== "string") { - fallbackLocale = typeof __uniConfig !== "undefined" && __uniConfig.fallbackLocale || LOCALE_EN; - } - const i18n = new I18n({ - locale, - fallbackLocale, - messages, - watcher - }); - let t2 = (key, values) => { - if (typeof getApp !== "function") { - t2 = function(key2, values2) { - return i18n.t(key2, values2); - }; - } else { - let isWatchedAppLocale = false; - t2 = function(key2, values2) { - const appVm = getApp().$vm; - if (appVm) { - appVm.$locale; - if (!isWatchedAppLocale) { - isWatchedAppLocale = true; - watchAppLocale(appVm, i18n); - } - } - return i18n.t(key2, values2); - }; - } - return t2(key, values); - }; - return { - i18n, - f(message, values, delimiters) { - return i18n.f(message, values, delimiters); - }, - t(key, values) { - return t2(key, values); - }, - add(locale2, message, override = true) { - return i18n.add(locale2, message, override); - }, - watch(fn) { - return i18n.watchLocale(fn); - }, - getLocale() { - return i18n.getLocale(); - }, - setLocale(newLocale) { - return i18n.setLocale(newLocale); - } - }; -} -function getBaseSystemInfo() { - return wx.getSystemInfoSync(); -} -function validateProtocolFail(name, msg) { - console.warn(`${name}: ${msg}`); -} -function validateProtocol(name, data, protocol, onFail) { - if (!onFail) { - onFail = validateProtocolFail; - } - for (const key in protocol) { - const errMsg = validateProp$1(key, data[key], protocol[key], !hasOwn$1(data, key)); - if (isString(errMsg)) { - onFail(name, errMsg); - } - } -} -function validateProtocols(name, args, protocol, onFail) { - if (!protocol) { - return; - } - if (!isArray(protocol)) { - return validateProtocol(name, args[0] || /* @__PURE__ */ Object.create(null), protocol, onFail); - } - const len = protocol.length; - const argsLen = args.length; - for (let i = 0; i < len; i++) { - const opts = protocol[i]; - const data = /* @__PURE__ */ Object.create(null); - if (argsLen > i) { - data[opts.name] = args[i]; - } - validateProtocol(name, data, { [opts.name]: opts }, onFail); - } -} -function validateProp$1(name, value, prop, isAbsent) { - if (!isPlainObject$1(prop)) { - prop = { type: prop }; - } - const { type, required, validator } = prop; - if (required && isAbsent) { - return 'Missing required args: "' + name + '"'; - } - if (value == null && !required) { - return; - } - if (type != null) { - let isValid = false; - const types = isArray(type) ? type : [type]; - const expectedTypes = []; - for (let i = 0; i < types.length && !isValid; i++) { - const { valid, expectedType } = assertType$1(value, types[i]); - expectedTypes.push(expectedType || ""); - isValid = valid; - } - if (!isValid) { - return getInvalidTypeMessage$1(name, value, expectedTypes); - } - } - if (validator) { - return validator(value); - } -} -const isSimpleType$1 = /* @__PURE__ */ makeMap("String,Number,Boolean,Function,Symbol"); -function assertType$1(value, type) { - let valid; - const expectedType = getType$1(type); - if (isSimpleType$1(expectedType)) { - const t2 = typeof value; - valid = t2 === expectedType.toLowerCase(); - if (!valid && t2 === "object") { - valid = value instanceof type; - } - } else if (expectedType === "Object") { - valid = isObject$1(value); - } else if (expectedType === "Array") { - valid = isArray(value); - } else { - { - valid = value instanceof type; - } - } - return { - valid, - expectedType - }; -} -function getInvalidTypeMessage$1(name, value, expectedTypes) { - let message = `Invalid args: type check failed for args "${name}". Expected ${expectedTypes.map(capitalize).join(", ")}`; - const expectedType = expectedTypes[0]; - const receivedType = toRawType(value); - const expectedValue = styleValue$1(value, expectedType); - const receivedValue = styleValue$1(value, receivedType); - if (expectedTypes.length === 1 && isExplicable$1(expectedType) && !isBoolean$1(expectedType, receivedType)) { - message += ` with value ${expectedValue}`; - } - message += `, got ${receivedType} `; - if (isExplicable$1(receivedType)) { - message += `with value ${receivedValue}.`; - } - return message; -} -function getType$1(ctor) { - const match = ctor && ctor.toString().match(/^\s*function (\w+)/); - return match ? match[1] : ""; -} -function styleValue$1(value, type) { - if (type === "String") { - return `"${value}"`; - } else if (type === "Number") { - return `${Number(value)}`; - } else { - return `${value}`; - } -} -function isExplicable$1(type) { - const explicitTypes = ["string", "number", "boolean"]; - return explicitTypes.some((elem) => type.toLowerCase() === elem); -} -function isBoolean$1(...args) { - return args.some((elem) => elem.toLowerCase() === "boolean"); -} -function tryCatch(fn) { - return function() { - try { - return fn.apply(fn, arguments); - } catch (e2) { - console.error(e2); - } - }; -} -let invokeCallbackId = 1; -const invokeCallbacks = {}; -function addInvokeCallback(id, name, callback, keepAlive = false) { - invokeCallbacks[id] = { - name, - keepAlive, - callback - }; - return id; -} -function invokeCallback(id, res, extras) { - if (typeof id === "number") { - const opts = invokeCallbacks[id]; - if (opts) { - if (!opts.keepAlive) { - delete invokeCallbacks[id]; - } - return opts.callback(res, extras); - } - } - return res; -} -const API_SUCCESS = "success"; -const API_FAIL = "fail"; -const API_COMPLETE = "complete"; -function getApiCallbacks(args) { - const apiCallbacks = {}; - for (const name in args) { - const fn = args[name]; - if (isFunction(fn)) { - apiCallbacks[name] = tryCatch(fn); - delete args[name]; - } - } - return apiCallbacks; -} -function normalizeErrMsg$1(errMsg, name) { - if (!errMsg || errMsg.indexOf(":fail") === -1) { - return name + ":ok"; - } - return name + errMsg.substring(errMsg.indexOf(":fail")); -} -function createAsyncApiCallback(name, args = {}, { beforeAll, beforeSuccess } = {}) { - if (!isPlainObject$1(args)) { - args = {}; - } - const { success, fail, complete } = getApiCallbacks(args); - const hasSuccess = isFunction(success); - const hasFail = isFunction(fail); - const hasComplete = isFunction(complete); - const callbackId = invokeCallbackId++; - addInvokeCallback(callbackId, name, (res) => { - res = res || {}; - res.errMsg = normalizeErrMsg$1(res.errMsg, name); - isFunction(beforeAll) && beforeAll(res); - if (res.errMsg === name + ":ok") { - isFunction(beforeSuccess) && beforeSuccess(res, args); - hasSuccess && success(res); - } else { - hasFail && fail(res); - } - hasComplete && complete(res); - }); - return callbackId; -} -const HOOK_SUCCESS = "success"; -const HOOK_FAIL = "fail"; -const HOOK_COMPLETE = "complete"; -const globalInterceptors = {}; -const scopedInterceptors = {}; -function wrapperHook(hook, params) { - return function(data) { - return hook(data, params) || data; - }; -} -function queue$1(hooks, data, params) { - let promise = false; - for (let i = 0; i < hooks.length; i++) { - const hook = hooks[i]; - if (promise) { - promise = Promise.resolve(wrapperHook(hook, params)); - } else { - const res = hook(data, params); - if (isPromise(res)) { - promise = Promise.resolve(res); - } - if (res === false) { - return { - then() { - }, - catch() { - } - }; - } - } - } - return promise || { - then(callback) { - return callback(data); - }, - catch() { - } - }; -} -function wrapperOptions(interceptors2, options = {}) { - [HOOK_SUCCESS, HOOK_FAIL, HOOK_COMPLETE].forEach((name) => { - const hooks = interceptors2[name]; - if (!isArray(hooks)) { - return; - } - const oldCallback = options[name]; - options[name] = function callbackInterceptor(res) { - queue$1(hooks, res, options).then((res2) => { - return isFunction(oldCallback) && oldCallback(res2) || res2; - }); - }; - }); - return options; -} -function wrapperReturnValue(method, returnValue) { - const returnValueHooks = []; - if (isArray(globalInterceptors.returnValue)) { - returnValueHooks.push(...globalInterceptors.returnValue); - } - const interceptor = scopedInterceptors[method]; - if (interceptor && isArray(interceptor.returnValue)) { - returnValueHooks.push(...interceptor.returnValue); - } - returnValueHooks.forEach((hook) => { - returnValue = hook(returnValue) || returnValue; - }); - return returnValue; -} -function getApiInterceptorHooks(method) { - const interceptor = /* @__PURE__ */ Object.create(null); - Object.keys(globalInterceptors).forEach((hook) => { - if (hook !== "returnValue") { - interceptor[hook] = globalInterceptors[hook].slice(); - } - }); - const scopedInterceptor = scopedInterceptors[method]; - if (scopedInterceptor) { - Object.keys(scopedInterceptor).forEach((hook) => { - if (hook !== "returnValue") { - interceptor[hook] = (interceptor[hook] || []).concat(scopedInterceptor[hook]); - } - }); - } - return interceptor; -} -function invokeApi(method, api, options, params) { - const interceptor = getApiInterceptorHooks(method); - if (interceptor && Object.keys(interceptor).length) { - if (isArray(interceptor.invoke)) { - const res = queue$1(interceptor.invoke, options); - return res.then((options2) => { - return api(wrapperOptions(getApiInterceptorHooks(method), options2), ...params); - }); - } else { - return api(wrapperOptions(interceptor, options), ...params); - } - } - return api(options, ...params); -} -function hasCallback(args) { - if (isPlainObject$1(args) && [API_SUCCESS, API_FAIL, API_COMPLETE].find((cb) => isFunction(args[cb]))) { - return true; - } - return false; -} -function handlePromise(promise) { - return promise; -} -function promisify$1(name, fn) { - return (args = {}, ...rest) => { - if (hasCallback(args)) { - return wrapperReturnValue(name, invokeApi(name, fn, args, rest)); - } - return wrapperReturnValue(name, handlePromise(new Promise((resolve2, reject) => { - invokeApi(name, fn, extend(args, { success: resolve2, fail: reject }), rest); - }))); - }; -} -function formatApiArgs(args, options) { - const params = args[0]; - if (!options || !isPlainObject$1(options.formatArgs) && isPlainObject$1(params)) { - return; - } - const formatArgs = options.formatArgs; - const keys = Object.keys(formatArgs); - for (let i = 0; i < keys.length; i++) { - const name = keys[i]; - const formatterOrDefaultValue = formatArgs[name]; - if (isFunction(formatterOrDefaultValue)) { - const errMsg = formatterOrDefaultValue(args[0][name], params); - if (isString(errMsg)) { - return errMsg; - } - } else { - if (!hasOwn$1(params, name)) { - params[name] = formatterOrDefaultValue; - } - } - } -} -function invokeSuccess(id, name, res) { - return invokeCallback(id, extend(res || {}, { errMsg: name + ":ok" })); -} -function invokeFail(id, name, errMsg, errRes) { - return invokeCallback(id, extend({ errMsg: name + ":fail" + (errMsg ? " " + errMsg : "") }, errRes)); -} -function beforeInvokeApi(name, args, protocol, options) { - { - validateProtocols(name, args, protocol); - } - if (options && options.beforeInvoke) { - const errMsg2 = options.beforeInvoke(args); - if (isString(errMsg2)) { - return errMsg2; - } - } - const errMsg = formatApiArgs(args, options); - if (errMsg) { - return errMsg; - } -} -function normalizeErrMsg(errMsg) { - if (!errMsg || isString(errMsg)) { - return errMsg; - } - if (errMsg.stack) { - console.error(errMsg.message + LINEFEED + errMsg.stack); - return errMsg.message; - } - return errMsg; -} -function wrapperTaskApi(name, fn, protocol, options) { - return (args) => { - const id = createAsyncApiCallback(name, args, options); - const errMsg = beforeInvokeApi(name, [args], protocol, options); - if (errMsg) { - return invokeFail(id, name, errMsg); - } - return fn(args, { - resolve: (res) => invokeSuccess(id, name, res), - reject: (errMsg2, errRes) => invokeFail(id, name, normalizeErrMsg(errMsg2), errRes) - }); - }; -} -function wrapperSyncApi(name, fn, protocol, options) { - return (...args) => { - const errMsg = beforeInvokeApi(name, args, protocol, options); - if (errMsg) { - throw new Error(errMsg); - } - return fn.apply(null, args); - }; -} -function wrapperAsyncApi(name, fn, protocol, options) { - return wrapperTaskApi(name, fn, protocol, options); -} -function defineSyncApi(name, fn, protocol, options) { - return wrapperSyncApi(name, fn, protocol, options); -} -function defineAsyncApi(name, fn, protocol, options) { - return promisify$1(name, wrapperAsyncApi(name, fn, protocol, options)); -} -const API_UPX2PX = "upx2px"; -const Upx2pxProtocol = [ - { - name: "upx", - type: [Number, String], - required: true - } -]; -const EPS = 1e-4; -const BASE_DEVICE_WIDTH = 750; -let isIOS = false; -let deviceWidth = 0; -let deviceDPR = 0; -function checkDeviceWidth() { - const { platform, pixelRatio, windowWidth } = getBaseSystemInfo(); - deviceWidth = windowWidth; - deviceDPR = pixelRatio; - isIOS = platform === "ios"; -} -const upx2px = defineSyncApi(API_UPX2PX, (number, newDeviceWidth) => { - if (deviceWidth === 0) { - checkDeviceWidth(); - } - number = Number(number); - if (number === 0) { - return 0; - } - let width = newDeviceWidth || deviceWidth; - let result = number / BASE_DEVICE_WIDTH * width; - if (result < 0) { - result = -result; - } - result = Math.floor(result + EPS); - if (result === 0) { - if (deviceDPR === 1 || !isIOS) { - result = 1; - } else { - result = 0.5; - } - } - return number < 0 ? -result : result; -}, Upx2pxProtocol); -const API_ADD_INTERCEPTOR = "addInterceptor"; -const API_REMOVE_INTERCEPTOR = "removeInterceptor"; -const AddInterceptorProtocol = [ - { - name: "method", - type: [String, Object], - required: true - } -]; -const RemoveInterceptorProtocol = AddInterceptorProtocol; -function mergeInterceptorHook(interceptors2, interceptor) { - Object.keys(interceptor).forEach((hook) => { - if (isFunction(interceptor[hook])) { - interceptors2[hook] = mergeHook(interceptors2[hook], interceptor[hook]); - } - }); -} -function removeInterceptorHook(interceptors2, interceptor) { - if (!interceptors2 || !interceptor) { - return; - } - Object.keys(interceptor).forEach((name) => { - const hooks = interceptors2[name]; - const hook = interceptor[name]; - if (isArray(hooks) && isFunction(hook)) { - remove(hooks, hook); - } - }); -} -function mergeHook(parentVal, childVal) { - const res = childVal ? parentVal ? parentVal.concat(childVal) : isArray(childVal) ? childVal : [childVal] : parentVal; - return res ? dedupeHooks(res) : res; -} -function dedupeHooks(hooks) { - const res = []; - for (let i = 0; i < hooks.length; i++) { - if (res.indexOf(hooks[i]) === -1) { - res.push(hooks[i]); - } - } - return res; -} -const addInterceptor = defineSyncApi(API_ADD_INTERCEPTOR, (method, interceptor) => { - if (isString(method) && isPlainObject$1(interceptor)) { - mergeInterceptorHook(scopedInterceptors[method] || (scopedInterceptors[method] = {}), interceptor); - } else if (isPlainObject$1(method)) { - mergeInterceptorHook(globalInterceptors, method); - } -}, AddInterceptorProtocol); -const removeInterceptor = defineSyncApi(API_REMOVE_INTERCEPTOR, (method, interceptor) => { - if (isString(method)) { - if (isPlainObject$1(interceptor)) { - removeInterceptorHook(scopedInterceptors[method], interceptor); - } else { - delete scopedInterceptors[method]; - } - } else if (isPlainObject$1(method)) { - removeInterceptorHook(globalInterceptors, method); - } -}, RemoveInterceptorProtocol); -const interceptors = {}; -const API_ON = "$on"; -const OnProtocol = [ - { - name: "event", - type: String, - required: true - }, - { - name: "callback", - type: Function, - required: true - } -]; -const API_ONCE = "$once"; -const OnceProtocol = OnProtocol; -const API_OFF = "$off"; -const OffProtocol = [ - { - name: "event", - type: [String, Array] - }, - { - name: "callback", - type: Function - } -]; -const API_EMIT = "$emit"; -const EmitProtocol = [ - { - name: "event", - type: String, - required: true - } -]; -const emitter = new E$1(); -const $on = defineSyncApi(API_ON, (name, callback) => { - emitter.on(name, callback); - return () => emitter.off(name, callback); -}, OnProtocol); -const $once = defineSyncApi(API_ONCE, (name, callback) => { - emitter.once(name, callback); - return () => emitter.off(name, callback); -}, OnceProtocol); -const $off = defineSyncApi(API_OFF, (name, callback) => { - if (!name) { - emitter.e = {}; - return; - } - if (!isArray(name)) - name = [name]; - name.forEach((n2) => emitter.off(n2, callback)); -}, OffProtocol); -const $emit = defineSyncApi(API_EMIT, (name, ...args) => { - emitter.emit(name, ...args); -}, EmitProtocol); -let cid; -let cidErrMsg; -let enabled; -function normalizePushMessage(message) { - try { - return JSON.parse(message); - } catch (e2) { - } - return message; -} -function invokePushCallback(args) { - if (args.type === "enabled") { - enabled = true; - } else if (args.type === "clientId") { - cid = args.cid; - cidErrMsg = args.errMsg; - invokeGetPushCidCallbacks(cid, args.errMsg); - } else if (args.type === "pushMsg") { - const message = { - type: "receive", - data: normalizePushMessage(args.message) - }; - for (let i = 0; i < onPushMessageCallbacks.length; i++) { - const callback = onPushMessageCallbacks[i]; - callback(message); - if (message.stopped) { - break; - } - } - } else if (args.type === "click") { - onPushMessageCallbacks.forEach((callback) => { - callback({ - type: "click", - data: normalizePushMessage(args.message) - }); - }); - } -} -const getPushCidCallbacks = []; -function invokeGetPushCidCallbacks(cid2, errMsg) { - getPushCidCallbacks.forEach((callback) => { - callback(cid2, errMsg); - }); - getPushCidCallbacks.length = 0; -} -const API_GET_PUSH_CLIENT_ID = "getPushClientId"; -const getPushClientId = defineAsyncApi(API_GET_PUSH_CLIENT_ID, (_, { resolve: resolve2, reject }) => { - Promise.resolve().then(() => { - if (typeof enabled === "undefined") { - enabled = false; - cid = ""; - cidErrMsg = "uniPush is not enabled"; - } - getPushCidCallbacks.push((cid2, errMsg) => { - if (cid2) { - resolve2({ cid: cid2 }); - } else { - reject(errMsg); - } - }); - if (typeof cid !== "undefined") { - invokeGetPushCidCallbacks(cid, cidErrMsg); - } - }); -}); -const onPushMessageCallbacks = []; -const onPushMessage = (fn) => { - if (onPushMessageCallbacks.indexOf(fn) === -1) { - onPushMessageCallbacks.push(fn); - } -}; -const offPushMessage = (fn) => { - if (!fn) { - onPushMessageCallbacks.length = 0; - } else { - const index2 = onPushMessageCallbacks.indexOf(fn); - if (index2 > -1) { - onPushMessageCallbacks.splice(index2, 1); - } - } -}; -const SYNC_API_RE = /^\$|getLocale|setLocale|sendNativeEvent|restoreGlobal|requireGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64|getDeviceInfo|getAppBaseInfo|getWindowInfo|getSystemSetting|getAppAuthorizeSetting/; -const CONTEXT_API_RE = /^create|Manager$/; -const CONTEXT_API_RE_EXC = ["createBLEConnection"]; -const ASYNC_API = ["createBLEConnection"]; -const CALLBACK_API_RE = /^on|^off/; -function isContextApi(name) { - return CONTEXT_API_RE.test(name) && CONTEXT_API_RE_EXC.indexOf(name) === -1; -} -function isSyncApi(name) { - return SYNC_API_RE.test(name) && ASYNC_API.indexOf(name) === -1; -} -function isCallbackApi(name) { - return CALLBACK_API_RE.test(name) && name !== "onPush"; -} -function shouldPromise(name) { - if (isContextApi(name) || isSyncApi(name) || isCallbackApi(name)) { - return false; - } - return true; -} -if (!Promise.prototype.finally) { - Promise.prototype.finally = function(onfinally) { - const promise = this.constructor; - return this.then((value) => promise.resolve(onfinally && onfinally()).then(() => value), (reason) => promise.resolve(onfinally && onfinally()).then(() => { - throw reason; - })); - }; -} -function promisify(name, api) { - if (!shouldPromise(name)) { - return api; - } - if (!isFunction(api)) { - return api; - } - return function promiseApi(options = {}, ...rest) { - if (isFunction(options.success) || isFunction(options.fail) || isFunction(options.complete)) { - return wrapperReturnValue(name, invokeApi(name, api, options, rest)); - } - return wrapperReturnValue(name, handlePromise(new Promise((resolve2, reject) => { - invokeApi(name, api, extend({}, options, { - success: resolve2, - fail: reject - }), rest); - }))); - }; -} -const CALLBACKS = ["success", "fail", "cancel", "complete"]; -function initWrapper(protocols2) { - function processCallback(methodName, method, returnValue) { - return function(res) { - return method(processReturnValue(methodName, res, returnValue)); - }; - } - function processArgs(methodName, fromArgs, argsOption = {}, returnValue = {}, keepFromArgs = false) { - if (isPlainObject$1(fromArgs)) { - const toArgs = keepFromArgs === true ? fromArgs : {}; - if (isFunction(argsOption)) { - argsOption = argsOption(fromArgs, toArgs) || {}; - } - for (const key in fromArgs) { - if (hasOwn$1(argsOption, key)) { - let keyOption = argsOption[key]; - if (isFunction(keyOption)) { - keyOption = keyOption(fromArgs[key], fromArgs, toArgs); - } - if (!keyOption) { - console.warn(`微信小程序 ${methodName} 暂不支持 ${key}`); - } else if (isString(keyOption)) { - toArgs[keyOption] = fromArgs[key]; - } else if (isPlainObject$1(keyOption)) { - toArgs[keyOption.name ? keyOption.name : key] = keyOption.value; - } - } else if (CALLBACKS.indexOf(key) !== -1) { - const callback = fromArgs[key]; - if (isFunction(callback)) { - toArgs[key] = processCallback(methodName, callback, returnValue); - } - } else { - if (!keepFromArgs && !hasOwn$1(toArgs, key)) { - toArgs[key] = fromArgs[key]; - } - } - } - return toArgs; - } else if (isFunction(fromArgs)) { - fromArgs = processCallback(methodName, fromArgs, returnValue); - } - return fromArgs; - } - function processReturnValue(methodName, res, returnValue, keepReturnValue = false) { - if (isFunction(protocols2.returnValue)) { - res = protocols2.returnValue(methodName, res); - } - return processArgs(methodName, res, returnValue, {}, keepReturnValue); - } - return function wrapper(methodName, method) { - if (!hasOwn$1(protocols2, methodName)) { - return method; - } - const protocol = protocols2[methodName]; - if (!protocol) { - return function() { - console.error(`微信小程序 暂不支持${methodName}`); - }; - } - return function(arg1, arg2) { - let options = protocol; - if (isFunction(protocol)) { - options = protocol(arg1); - } - arg1 = processArgs(methodName, arg1, options.args, options.returnValue); - const args = [arg1]; - if (typeof arg2 !== "undefined") { - args.push(arg2); - } - const returnValue = wx[options.name || methodName].apply(wx, args); - if (isSyncApi(methodName)) { - return processReturnValue(methodName, returnValue, options.returnValue, isContextApi(methodName)); - } - return returnValue; - }; - }; -} -const getLocale = () => { - const app = isFunction(getApp) && getApp({ allowDefault: true }); - if (app && app.$vm) { - return app.$vm.$locale; - } - return normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN; -}; -const setLocale = (locale) => { - const app = isFunction(getApp) && getApp(); - if (!app) { - return false; - } - const oldLocale = app.$vm.$locale; - if (oldLocale !== locale) { - app.$vm.$locale = locale; - onLocaleChangeCallbacks.forEach((fn) => fn({ locale })); - return true; - } - return false; -}; -const onLocaleChangeCallbacks = []; -const onLocaleChange = (fn) => { - if (onLocaleChangeCallbacks.indexOf(fn) === -1) { - onLocaleChangeCallbacks.push(fn); - } -}; -if (typeof global !== "undefined") { - global.getLocale = getLocale; -} -const UUID_KEY = "__DC_STAT_UUID"; -let deviceId; -function useDeviceId(global2 = wx) { - return function addDeviceId(_, toRes) { - deviceId = deviceId || global2.getStorageSync(UUID_KEY); - if (!deviceId) { - deviceId = Date.now() + "" + Math.floor(Math.random() * 1e7); - wx.setStorage({ - key: UUID_KEY, - data: deviceId - }); - } - toRes.deviceId = deviceId; - }; -} -function addSafeAreaInsets(fromRes, toRes) { - if (fromRes.safeArea) { - const safeArea = fromRes.safeArea; - toRes.safeAreaInsets = { - top: safeArea.top, - left: safeArea.left, - right: fromRes.windowWidth - safeArea.right, - bottom: fromRes.screenHeight - safeArea.bottom - }; - } -} -function populateParameters(fromRes, toRes) { - const { brand = "", model = "", system = "", language = "", theme, version: version2, platform, fontSizeSetting, SDKVersion, pixelRatio, deviceOrientation } = fromRes; - let osName = ""; - let osVersion = ""; - { - osName = system.split(" ")[0] || ""; - osVersion = system.split(" ")[1] || ""; - } - let hostVersion = version2; - let deviceType = getGetDeviceType(fromRes, model); - let deviceBrand = getDeviceBrand(brand); - let _hostName = getHostName(fromRes); - let _deviceOrientation = deviceOrientation; - let _devicePixelRatio = pixelRatio; - let _SDKVersion = SDKVersion; - const hostLanguage = language.replace(/_/g, "-"); - const parameters = { - appId: "__UNI__A2B2065", - appName: "vision-record", - appVersion: "1.0.0", - appVersionCode: "100", - appLanguage: getAppLanguage(hostLanguage), - uniCompileVersion: "3.8.12", - uniRuntimeVersion: "3.8.12", - uniPlatform: "mp-weixin", - deviceBrand, - deviceModel: model, - deviceType, - devicePixelRatio: _devicePixelRatio, - deviceOrientation: _deviceOrientation, - osName: osName.toLocaleLowerCase(), - osVersion, - hostTheme: theme, - hostVersion, - hostLanguage, - hostName: _hostName, - hostSDKVersion: _SDKVersion, - hostFontSizeSetting: fontSizeSetting, - windowTop: 0, - windowBottom: 0, - // TODO - osLanguage: void 0, - osTheme: void 0, - ua: void 0, - hostPackageName: void 0, - browserName: void 0, - browserVersion: void 0 - }; - extend(toRes, parameters); -} -function getGetDeviceType(fromRes, model) { - let deviceType = fromRes.deviceType || "phone"; - { - const deviceTypeMaps = { - ipad: "pad", - windows: "pc", - mac: "pc" - }; - const deviceTypeMapsKeys = Object.keys(deviceTypeMaps); - const _model = model.toLocaleLowerCase(); - for (let index2 = 0; index2 < deviceTypeMapsKeys.length; index2++) { - const _m = deviceTypeMapsKeys[index2]; - if (_model.indexOf(_m) !== -1) { - deviceType = deviceTypeMaps[_m]; - break; - } - } - } - return deviceType; -} -function getDeviceBrand(brand) { - let deviceBrand = brand; - if (deviceBrand) { - deviceBrand = deviceBrand.toLocaleLowerCase(); - } - return deviceBrand; -} -function getAppLanguage(defaultLanguage) { - return getLocale ? getLocale() : defaultLanguage; -} -function getHostName(fromRes) { - const _platform = "WeChat"; - let _hostName = fromRes.hostName || _platform; - { - if (fromRes.environment) { - _hostName = fromRes.environment; - } else if (fromRes.host && fromRes.host.env) { - _hostName = fromRes.host.env; - } - } - return _hostName; -} -const getSystemInfo = { - returnValue: (fromRes, toRes) => { - addSafeAreaInsets(fromRes, toRes); - useDeviceId()(fromRes, toRes); - populateParameters(fromRes, toRes); - } -}; -const getSystemInfoSync = getSystemInfo; -const redirectTo = {}; -const previewImage = { - args(fromArgs, toArgs) { - let currentIndex = parseInt(fromArgs.current); - if (isNaN(currentIndex)) { - return; - } - const urls = fromArgs.urls; - if (!isArray(urls)) { - return; - } - const len = urls.length; - if (!len) { - return; - } - if (currentIndex < 0) { - currentIndex = 0; - } else if (currentIndex >= len) { - currentIndex = len - 1; - } - if (currentIndex > 0) { - toArgs.current = urls[currentIndex]; - toArgs.urls = urls.filter((item, index2) => index2 < currentIndex ? item !== urls[currentIndex] : true); - } else { - toArgs.current = urls[0]; - } - return { - indicator: false, - loop: false - }; - } -}; -const showActionSheet = { - args(fromArgs, toArgs) { - toArgs.alertText = fromArgs.title; - } -}; -const getDeviceInfo = { - returnValue: (fromRes, toRes) => { - const { brand, model } = fromRes; - let deviceType = getGetDeviceType(fromRes, model); - let deviceBrand = getDeviceBrand(brand); - useDeviceId()(fromRes, toRes); - toRes = sortObject(extend(toRes, { - deviceType, - deviceBrand, - deviceModel: model - })); - } -}; -const getAppBaseInfo = { - returnValue: (fromRes, toRes) => { - const { version: version2, language, SDKVersion, theme } = fromRes; - let _hostName = getHostName(fromRes); - let hostLanguage = language.replace(/_/g, "-"); - toRes = sortObject(extend(toRes, { - hostVersion: version2, - hostLanguage, - hostName: _hostName, - hostSDKVersion: SDKVersion, - hostTheme: theme, - appId: "__UNI__A2B2065", - appName: "vision-record", - appVersion: "1.0.0", - appVersionCode: "100", - appLanguage: getAppLanguage(hostLanguage) - })); - } -}; -const getWindowInfo = { - returnValue: (fromRes, toRes) => { - addSafeAreaInsets(fromRes, toRes); - toRes = sortObject(extend(toRes, { - windowTop: 0, - windowBottom: 0 - })); - } -}; -const getAppAuthorizeSetting = { - returnValue: function(fromRes, toRes) { - const { locationReducedAccuracy } = fromRes; - toRes.locationAccuracy = "unsupported"; - if (locationReducedAccuracy === true) { - toRes.locationAccuracy = "reduced"; - } else if (locationReducedAccuracy === false) { - toRes.locationAccuracy = "full"; - } - } -}; -const baseApis = { - $on, - $off, - $once, - $emit, - upx2px, - interceptors, - addInterceptor, - removeInterceptor, - onCreateVueApp, - invokeCreateVueAppHook, - getLocale, - setLocale, - onLocaleChange, - getPushClientId, - onPushMessage, - offPushMessage, - invokePushCallback -}; -function initUni(api, protocols2, platform = wx) { - const wrapper = initWrapper(protocols2); - const UniProxyHandlers = { - get(target, key) { - if (hasOwn$1(target, key)) { - return target[key]; - } - if (hasOwn$1(api, key)) { - return promisify(key, api[key]); - } - if (hasOwn$1(baseApis, key)) { - return promisify(key, baseApis[key]); - } - return promisify(key, wrapper(key, platform[key])); - } - }; - return new Proxy({}, UniProxyHandlers); -} -function initGetProvider(providers) { - return function getProvider2({ service, success, fail, complete }) { - let res; - if (providers[service]) { - res = { - errMsg: "getProvider:ok", - service, - provider: providers[service] - }; - isFunction(success) && success(res); - } else { - res = { - errMsg: "getProvider:fail:服务[" + service + "]不存在" - }; - isFunction(fail) && fail(res); - } - isFunction(complete) && complete(res); - }; -} -const objectKeys = [ - "qy", - "env", - "error", - "version", - "lanDebug", - "cloud", - "serviceMarket", - "router", - "worklet", - "__webpack_require_UNI_MP_PLUGIN__" -]; -const singlePageDisableKey = ["lanDebug", "router", "worklet"]; -const launchOption = wx.getLaunchOptionsSync ? wx.getLaunchOptionsSync() : null; -function isWxKey(key) { - if (launchOption && launchOption.scene === 1154 && singlePageDisableKey.includes(key)) { - return false; - } - return objectKeys.indexOf(key) > -1 || typeof wx[key] === "function"; -} -function initWx() { - const newWx = {}; - for (const key in wx) { - if (isWxKey(key)) { - newWx[key] = wx[key]; - } - } - if (typeof globalThis !== "undefined" && typeof requireMiniProgram === "undefined") { - globalThis.wx = newWx; - } - return newWx; -} -const mocks$1 = ["__route__", "__wxExparserNodeId__", "__wxWebviewId__"]; -const getProvider = initGetProvider({ - oauth: ["weixin"], - share: ["weixin"], - payment: ["wxpay"], - push: ["weixin"] -}); -function initComponentMocks(component) { - const res = /* @__PURE__ */ Object.create(null); - mocks$1.forEach((name) => { - res[name] = component[name]; - }); - return res; -} -function createSelectorQuery() { - const query = wx$2.createSelectorQuery(); - const oldIn = query.in; - query.in = function newIn(component) { - return oldIn.call(this, initComponentMocks(component)); - }; - return query; -} -const wx$2 = initWx(); -let baseInfo = wx$2.getAppBaseInfo && wx$2.getAppBaseInfo(); -if (!baseInfo) { - baseInfo = wx$2.getSystemInfoSync(); -} -const host = baseInfo ? baseInfo.host : null; -const shareVideoMessage = host && host.env === "SAAASDK" ? wx$2.miniapp.shareVideoMessage : wx$2.shareVideoMessage; -var shims = /* @__PURE__ */ Object.freeze({ - __proto__: null, - createSelectorQuery, - getProvider, - shareVideoMessage -}); -const compressImage = { - args(fromArgs, toArgs) { - if (fromArgs.compressedHeight && !toArgs.compressHeight) { - toArgs.compressHeight = fromArgs.compressedHeight; - } - if (fromArgs.compressedWidth && !toArgs.compressWidth) { - toArgs.compressWidth = fromArgs.compressedWidth; - } - } -}; -var protocols = /* @__PURE__ */ Object.freeze({ - __proto__: null, - compressImage, - getAppAuthorizeSetting, - getAppBaseInfo, - getDeviceInfo, - getSystemInfo, - getSystemInfoSync, - getWindowInfo, - previewImage, - redirectTo, - showActionSheet -}); -const wx$1 = initWx(); -var index = initUni(shims, protocols, wx$1); -function warn$1(msg, ...args) { - console.warn(`[Vue warn] ${msg}`, ...args); -} -let activeEffectScope; -class EffectScope { - constructor(detached = false) { - this.detached = detached; - this._active = true; - this.effects = []; - this.cleanups = []; - this.parent = activeEffectScope; - if (!detached && activeEffectScope) { - this.index = (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push(this) - 1; - } - } - get active() { - return this._active; - } - run(fn) { - if (this._active) { - const currentEffectScope = activeEffectScope; - try { - activeEffectScope = this; - return fn(); - } finally { - activeEffectScope = currentEffectScope; - } - } else { - warn$1(`cannot run an inactive effect scope.`); - } - } - /** - * This should only be called on non-detached scopes - * @internal - */ - on() { - activeEffectScope = this; - } - /** - * This should only be called on non-detached scopes - * @internal - */ - off() { - activeEffectScope = this.parent; - } - stop(fromParent) { - if (this._active) { - let i, l; - for (i = 0, l = this.effects.length; i < l; i++) { - this.effects[i].stop(); - } - for (i = 0, l = this.cleanups.length; i < l; i++) { - this.cleanups[i](); - } - if (this.scopes) { - for (i = 0, l = this.scopes.length; i < l; i++) { - this.scopes[i].stop(true); - } - } - if (!this.detached && this.parent && !fromParent) { - const last = this.parent.scopes.pop(); - if (last && last !== this) { - this.parent.scopes[this.index] = last; - last.index = this.index; - } - } - this.parent = void 0; - this._active = false; - } - } -} -function effectScope(detached) { - return new EffectScope(detached); -} -function recordEffectScope(effect, scope = activeEffectScope) { - if (scope && scope.active) { - scope.effects.push(effect); - } -} -function getCurrentScope() { - return activeEffectScope; -} -function onScopeDispose(fn) { - if (activeEffectScope) { - activeEffectScope.cleanups.push(fn); - } else { - warn$1(`onScopeDispose() is called when there is no active effect scope to be associated with.`); - } -} -const createDep = (effects) => { - const dep = new Set(effects); - dep.w = 0; - dep.n = 0; - return dep; -}; -const wasTracked = (dep) => (dep.w & trackOpBit) > 0; -const newTracked = (dep) => (dep.n & trackOpBit) > 0; -const initDepMarkers = ({ deps }) => { - if (deps.length) { - for (let i = 0; i < deps.length; i++) { - deps[i].w |= trackOpBit; - } - } -}; -const finalizeDepMarkers = (effect) => { - const { deps } = effect; - if (deps.length) { - let ptr = 0; - for (let i = 0; i < deps.length; i++) { - const dep = deps[i]; - if (wasTracked(dep) && !newTracked(dep)) { - dep.delete(effect); - } else { - deps[ptr++] = dep; - } - dep.w &= ~trackOpBit; - dep.n &= ~trackOpBit; - } - deps.length = ptr; - } -}; -const targetMap = /* @__PURE__ */ new WeakMap(); -let effectTrackDepth = 0; -let trackOpBit = 1; -const maxMarkerBits = 30; -let activeEffect; -const ITERATE_KEY = Symbol("iterate"); -const MAP_KEY_ITERATE_KEY = Symbol("Map key iterate"); -class ReactiveEffect { - constructor(fn, scheduler = null, scope) { - this.fn = fn; - this.scheduler = scheduler; - this.active = true; - this.deps = []; - this.parent = void 0; - recordEffectScope(this, scope); - } - run() { - if (!this.active) { - return this.fn(); - } - let parent = activeEffect; - let lastShouldTrack = shouldTrack; - while (parent) { - if (parent === this) { - return; - } - parent = parent.parent; - } - try { - this.parent = activeEffect; - activeEffect = this; - shouldTrack = true; - trackOpBit = 1 << ++effectTrackDepth; - if (effectTrackDepth <= maxMarkerBits) { - initDepMarkers(this); - } else { - cleanupEffect(this); - } - return this.fn(); - } finally { - if (effectTrackDepth <= maxMarkerBits) { - finalizeDepMarkers(this); - } - trackOpBit = 1 << --effectTrackDepth; - activeEffect = this.parent; - shouldTrack = lastShouldTrack; - this.parent = void 0; - if (this.deferStop) { - this.stop(); - } - } - } - stop() { - if (activeEffect === this) { - this.deferStop = true; - } else if (this.active) { - cleanupEffect(this); - if (this.onStop) { - this.onStop(); - } - this.active = false; - } - } -} -function cleanupEffect(effect) { - const { deps } = effect; - if (deps.length) { - for (let i = 0; i < deps.length; i++) { - deps[i].delete(effect); - } - deps.length = 0; - } -} -let shouldTrack = true; -const trackStack = []; -function pauseTracking() { - trackStack.push(shouldTrack); - shouldTrack = false; -} -function resetTracking() { - const last = trackStack.pop(); - shouldTrack = last === void 0 ? true : last; -} -function track(target, type, key) { - if (shouldTrack && activeEffect) { - let depsMap = targetMap.get(target); - if (!depsMap) { - targetMap.set(target, depsMap = /* @__PURE__ */ new Map()); - } - let dep = depsMap.get(key); - if (!dep) { - depsMap.set(key, dep = createDep()); - } - const eventInfo = { effect: activeEffect, target, type, key }; - trackEffects(dep, eventInfo); - } -} -function trackEffects(dep, debuggerEventExtraInfo) { - let shouldTrack2 = false; - if (effectTrackDepth <= maxMarkerBits) { - if (!newTracked(dep)) { - dep.n |= trackOpBit; - shouldTrack2 = !wasTracked(dep); - } - } else { - shouldTrack2 = !dep.has(activeEffect); - } - if (shouldTrack2) { - dep.add(activeEffect); - activeEffect.deps.push(dep); - if (activeEffect.onTrack) { - activeEffect.onTrack(Object.assign({ effect: activeEffect }, debuggerEventExtraInfo)); - } - } -} -function trigger(target, type, key, newValue, oldValue, oldTarget) { - const depsMap = targetMap.get(target); - if (!depsMap) { - return; - } - let deps = []; - if (type === "clear") { - deps = [...depsMap.values()]; - } else if (key === "length" && isArray(target)) { - const newLength = Number(newValue); - depsMap.forEach((dep, key2) => { - if (key2 === "length" || key2 >= newLength) { - deps.push(dep); - } - }); - } else { - if (key !== void 0) { - deps.push(depsMap.get(key)); - } - switch (type) { - case "add": - if (!isArray(target)) { - deps.push(depsMap.get(ITERATE_KEY)); - if (isMap(target)) { - deps.push(depsMap.get(MAP_KEY_ITERATE_KEY)); - } - } else if (isIntegerKey(key)) { - deps.push(depsMap.get("length")); - } - break; - case "delete": - if (!isArray(target)) { - deps.push(depsMap.get(ITERATE_KEY)); - if (isMap(target)) { - deps.push(depsMap.get(MAP_KEY_ITERATE_KEY)); - } - } - break; - case "set": - if (isMap(target)) { - deps.push(depsMap.get(ITERATE_KEY)); - } - break; - } - } - const eventInfo = { target, type, key, newValue, oldValue, oldTarget }; - if (deps.length === 1) { - if (deps[0]) { - { - triggerEffects(deps[0], eventInfo); - } - } - } else { - const effects = []; - for (const dep of deps) { - if (dep) { - effects.push(...dep); - } - } - { - triggerEffects(createDep(effects), eventInfo); - } - } -} -function triggerEffects(dep, debuggerEventExtraInfo) { - const effects = isArray(dep) ? dep : [...dep]; - for (const effect of effects) { - if (effect.computed) { - triggerEffect(effect, debuggerEventExtraInfo); - } - } - for (const effect of effects) { - if (!effect.computed) { - triggerEffect(effect, debuggerEventExtraInfo); - } - } -} -function triggerEffect(effect, debuggerEventExtraInfo) { - if (effect !== activeEffect || effect.allowRecurse) { - if (effect.onTrigger) { - effect.onTrigger(extend({ effect }, debuggerEventExtraInfo)); - } - if (effect.scheduler) { - effect.scheduler(); - } else { - effect.run(); - } - } -} -function getDepFromReactive(object, key) { - var _a2; - return (_a2 = targetMap.get(object)) === null || _a2 === void 0 ? void 0 : _a2.get(key); -} -const isNonTrackableKeys = /* @__PURE__ */ makeMap(`__proto__,__v_isRef,__isVue`); -const builtInSymbols = new Set( - /* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol) -); -const get$1 = /* @__PURE__ */ createGetter(); -const shallowGet = /* @__PURE__ */ createGetter(false, true); -const readonlyGet = /* @__PURE__ */ createGetter(true); -const shallowReadonlyGet = /* @__PURE__ */ createGetter(true, true); -const arrayInstrumentations = /* @__PURE__ */ createArrayInstrumentations(); -function createArrayInstrumentations() { - const instrumentations = {}; - ["includes", "indexOf", "lastIndexOf"].forEach((key) => { - instrumentations[key] = function(...args) { - const arr = toRaw(this); - for (let i = 0, l = this.length; i < l; i++) { - track(arr, "get", i + ""); - } - const res = arr[key](...args); - if (res === -1 || res === false) { - return arr[key](...args.map(toRaw)); - } else { - return res; - } - }; - }); - ["push", "pop", "shift", "unshift", "splice"].forEach((key) => { - instrumentations[key] = function(...args) { - pauseTracking(); - const res = toRaw(this)[key].apply(this, args); - resetTracking(); - return res; - }; - }); - return instrumentations; -} -function hasOwnProperty(key) { - const obj = toRaw(this); - track(obj, "has", key); - return obj.hasOwnProperty(key); -} -function createGetter(isReadonly2 = false, shallow = false) { - return function get2(target, key, receiver) { - if (key === "__v_isReactive") { - return !isReadonly2; - } else if (key === "__v_isReadonly") { - return isReadonly2; - } else if (key === "__v_isShallow") { - return shallow; - } else if (key === "__v_raw" && receiver === (isReadonly2 ? shallow ? shallowReadonlyMap : readonlyMap : shallow ? shallowReactiveMap : reactiveMap).get(target)) { - return target; - } - const targetIsArray = isArray(target); - if (!isReadonly2) { - if (targetIsArray && hasOwn$1(arrayInstrumentations, key)) { - return Reflect.get(arrayInstrumentations, key, receiver); - } - if (key === "hasOwnProperty") { - return hasOwnProperty; - } - } - const res = Reflect.get(target, key, receiver); - if (isSymbol(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) { - return res; - } - if (!isReadonly2) { - track(target, "get", key); - } - if (shallow) { - return res; - } - if (isRef(res)) { - return targetIsArray && isIntegerKey(key) ? res : res.value; - } - if (isObject$1(res)) { - return isReadonly2 ? readonly(res) : reactive(res); - } - return res; - }; -} -const set$1 = /* @__PURE__ */ createSetter(); -const shallowSet = /* @__PURE__ */ createSetter(true); -function createSetter(shallow = false) { - return function set2(target, key, value, receiver) { - let oldValue = target[key]; - if (isReadonly(oldValue) && isRef(oldValue) && !isRef(value)) { - return false; - } - if (!shallow) { - if (!isShallow(value) && !isReadonly(value)) { - oldValue = toRaw(oldValue); - value = toRaw(value); - } - if (!isArray(target) && isRef(oldValue) && !isRef(value)) { - oldValue.value = value; - return true; - } - } - const hadKey = isArray(target) && isIntegerKey(key) ? Number(key) < target.length : hasOwn$1(target, key); - const result = Reflect.set(target, key, value, receiver); - if (target === toRaw(receiver)) { - if (!hadKey) { - trigger(target, "add", key, value); - } else if (hasChanged(value, oldValue)) { - trigger(target, "set", key, value, oldValue); - } - } - return result; - }; -} -function deleteProperty(target, key) { - const hadKey = hasOwn$1(target, key); - const oldValue = target[key]; - const result = Reflect.deleteProperty(target, key); - if (result && hadKey) { - trigger(target, "delete", key, void 0, oldValue); - } - return result; -} -function has$1(target, key) { - const result = Reflect.has(target, key); - if (!isSymbol(key) || !builtInSymbols.has(key)) { - track(target, "has", key); - } - return result; -} -function ownKeys(target) { - track(target, "iterate", isArray(target) ? "length" : ITERATE_KEY); - return Reflect.ownKeys(target); -} -const mutableHandlers = { - get: get$1, - set: set$1, - deleteProperty, - has: has$1, - ownKeys -}; -const readonlyHandlers = { - get: readonlyGet, - set(target, key) { - { - warn$1(`Set operation on key "${String(key)}" failed: target is readonly.`, target); - } - return true; - }, - deleteProperty(target, key) { - { - warn$1(`Delete operation on key "${String(key)}" failed: target is readonly.`, target); - } - return true; - } -}; -const shallowReactiveHandlers = /* @__PURE__ */ extend({}, mutableHandlers, { - get: shallowGet, - set: shallowSet -}); -const shallowReadonlyHandlers = /* @__PURE__ */ extend({}, readonlyHandlers, { - get: shallowReadonlyGet -}); -const toShallow = (value) => value; -const getProto = (v) => Reflect.getPrototypeOf(v); -function get(target, key, isReadonly2 = false, isShallow2 = false) { - target = target[ - "__v_raw" - /* ReactiveFlags.RAW */ - ]; - const rawTarget = toRaw(target); - const rawKey = toRaw(key); - if (!isReadonly2) { - if (key !== rawKey) { - track(rawTarget, "get", key); - } - track(rawTarget, "get", rawKey); - } - const { has: has2 } = getProto(rawTarget); - const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive; - if (has2.call(rawTarget, key)) { - return wrap(target.get(key)); - } else if (has2.call(rawTarget, rawKey)) { - return wrap(target.get(rawKey)); - } else if (target !== rawTarget) { - target.get(key); - } -} -function has(key, isReadonly2 = false) { - const target = this[ - "__v_raw" - /* ReactiveFlags.RAW */ - ]; - const rawTarget = toRaw(target); - const rawKey = toRaw(key); - if (!isReadonly2) { - if (key !== rawKey) { - track(rawTarget, "has", key); - } - track(rawTarget, "has", rawKey); - } - return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey); -} -function size(target, isReadonly2 = false) { - target = target[ - "__v_raw" - /* ReactiveFlags.RAW */ - ]; - !isReadonly2 && track(toRaw(target), "iterate", ITERATE_KEY); - return Reflect.get(target, "size", target); -} -function add(value) { - value = toRaw(value); - const target = toRaw(this); - const proto = getProto(target); - const hadKey = proto.has.call(target, value); - if (!hadKey) { - target.add(value); - trigger(target, "add", value, value); - } - return this; -} -function set$2(key, value) { - value = toRaw(value); - const target = toRaw(this); - const { has: has2, get: get2 } = getProto(target); - let hadKey = has2.call(target, key); - if (!hadKey) { - key = toRaw(key); - hadKey = has2.call(target, key); - } else { - checkIdentityKeys(target, has2, key); - } - const oldValue = get2.call(target, key); - target.set(key, value); - if (!hadKey) { - trigger(target, "add", key, value); - } else if (hasChanged(value, oldValue)) { - trigger(target, "set", key, value, oldValue); - } - return this; -} -function deleteEntry(key) { - const target = toRaw(this); - const { has: has2, get: get2 } = getProto(target); - let hadKey = has2.call(target, key); - if (!hadKey) { - key = toRaw(key); - hadKey = has2.call(target, key); - } else { - checkIdentityKeys(target, has2, key); - } - const oldValue = get2 ? get2.call(target, key) : void 0; - const result = target.delete(key); - if (hadKey) { - trigger(target, "delete", key, void 0, oldValue); - } - return result; -} -function clear() { - const target = toRaw(this); - const hadItems = target.size !== 0; - const oldTarget = isMap(target) ? new Map(target) : new Set(target); - const result = target.clear(); - if (hadItems) { - trigger(target, "clear", void 0, void 0, oldTarget); - } - return result; -} -function createForEach(isReadonly2, isShallow2) { - return function forEach(callback, thisArg) { - const observed = this; - const target = observed[ - "__v_raw" - /* ReactiveFlags.RAW */ - ]; - const rawTarget = toRaw(target); - const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive; - !isReadonly2 && track(rawTarget, "iterate", ITERATE_KEY); - return target.forEach((value, key) => { - return callback.call(thisArg, wrap(value), wrap(key), observed); - }); - }; -} -function createIterableMethod(method, isReadonly2, isShallow2) { - return function(...args) { - const target = this[ - "__v_raw" - /* ReactiveFlags.RAW */ - ]; - const rawTarget = toRaw(target); - const targetIsMap = isMap(rawTarget); - const isPair = method === "entries" || method === Symbol.iterator && targetIsMap; - const isKeyOnly = method === "keys" && targetIsMap; - const innerIterator = target[method](...args); - const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive; - !isReadonly2 && track(rawTarget, "iterate", isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY); - return { - // iterator protocol - next() { - const { value, done } = innerIterator.next(); - return done ? { value, done } : { - value: isPair ? [wrap(value[0]), wrap(value[1])] : wrap(value), - done - }; - }, - // iterable protocol - [Symbol.iterator]() { - return this; - } - }; - }; -} -function createReadonlyMethod(type) { - return function(...args) { - { - const key = args[0] ? `on key "${args[0]}" ` : ``; - console.warn(`${capitalize(type)} operation ${key}failed: target is readonly.`, toRaw(this)); - } - return type === "delete" ? false : this; - }; -} -function createInstrumentations() { - const mutableInstrumentations2 = { - get(key) { - return get(this, key); - }, - get size() { - return size(this); - }, - has, - add, - set: set$2, - delete: deleteEntry, - clear, - forEach: createForEach(false, false) - }; - const shallowInstrumentations2 = { - get(key) { - return get(this, key, false, true); - }, - get size() { - return size(this); - }, - has, - add, - set: set$2, - delete: deleteEntry, - clear, - forEach: createForEach(false, true) - }; - const readonlyInstrumentations2 = { - get(key) { - return get(this, key, true); - }, - get size() { - return size(this, true); - }, - has(key) { - return has.call(this, key, true); - }, - add: createReadonlyMethod( - "add" - /* TriggerOpTypes.ADD */ - ), - set: createReadonlyMethod( - "set" - /* TriggerOpTypes.SET */ - ), - delete: createReadonlyMethod( - "delete" - /* TriggerOpTypes.DELETE */ - ), - clear: createReadonlyMethod( - "clear" - /* TriggerOpTypes.CLEAR */ - ), - forEach: createForEach(true, false) - }; - const shallowReadonlyInstrumentations2 = { - get(key) { - return get(this, key, true, true); - }, - get size() { - return size(this, true); - }, - has(key) { - return has.call(this, key, true); - }, - add: createReadonlyMethod( - "add" - /* TriggerOpTypes.ADD */ - ), - set: createReadonlyMethod( - "set" - /* TriggerOpTypes.SET */ - ), - delete: createReadonlyMethod( - "delete" - /* TriggerOpTypes.DELETE */ - ), - clear: createReadonlyMethod( - "clear" - /* TriggerOpTypes.CLEAR */ - ), - forEach: createForEach(true, true) - }; - const iteratorMethods = ["keys", "values", "entries", Symbol.iterator]; - iteratorMethods.forEach((method) => { - mutableInstrumentations2[method] = createIterableMethod(method, false, false); - readonlyInstrumentations2[method] = createIterableMethod(method, true, false); - shallowInstrumentations2[method] = createIterableMethod(method, false, true); - shallowReadonlyInstrumentations2[method] = createIterableMethod(method, true, true); - }); - return [ - mutableInstrumentations2, - readonlyInstrumentations2, - shallowInstrumentations2, - shallowReadonlyInstrumentations2 - ]; -} -const [mutableInstrumentations, readonlyInstrumentations, shallowInstrumentations, shallowReadonlyInstrumentations] = /* @__PURE__ */ createInstrumentations(); -function createInstrumentationGetter(isReadonly2, shallow) { - const instrumentations = shallow ? isReadonly2 ? shallowReadonlyInstrumentations : shallowInstrumentations : isReadonly2 ? readonlyInstrumentations : mutableInstrumentations; - return (target, key, receiver) => { - if (key === "__v_isReactive") { - return !isReadonly2; - } else if (key === "__v_isReadonly") { - return isReadonly2; - } else if (key === "__v_raw") { - return target; - } - return Reflect.get(hasOwn$1(instrumentations, key) && key in target ? instrumentations : target, key, receiver); - }; -} -const mutableCollectionHandlers = { - get: /* @__PURE__ */ createInstrumentationGetter(false, false) -}; -const shallowCollectionHandlers = { - get: /* @__PURE__ */ createInstrumentationGetter(false, true) -}; -const readonlyCollectionHandlers = { - get: /* @__PURE__ */ createInstrumentationGetter(true, false) -}; -const shallowReadonlyCollectionHandlers = { - get: /* @__PURE__ */ createInstrumentationGetter(true, true) -}; -function checkIdentityKeys(target, has2, key) { - const rawKey = toRaw(key); - if (rawKey !== key && has2.call(target, rawKey)) { - const type = toRawType(target); - console.warn(`Reactive ${type} contains both the raw and reactive versions of the same object${type === `Map` ? ` as keys` : ``}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`); - } -} -const reactiveMap = /* @__PURE__ */ new WeakMap(); -const shallowReactiveMap = /* @__PURE__ */ new WeakMap(); -const readonlyMap = /* @__PURE__ */ new WeakMap(); -const shallowReadonlyMap = /* @__PURE__ */ new WeakMap(); -function targetTypeMap(rawType) { - switch (rawType) { - case "Object": - case "Array": - return 1; - case "Map": - case "Set": - case "WeakMap": - case "WeakSet": - return 2; - default: - return 0; - } -} -function getTargetType(value) { - return value[ - "__v_skip" - /* ReactiveFlags.SKIP */ - ] || !Object.isExtensible(value) ? 0 : targetTypeMap(toRawType(value)); -} -function reactive(target) { - if (isReadonly(target)) { - return target; - } - return createReactiveObject(target, false, mutableHandlers, mutableCollectionHandlers, reactiveMap); -} -function shallowReactive(target) { - return createReactiveObject(target, false, shallowReactiveHandlers, shallowCollectionHandlers, shallowReactiveMap); -} -function readonly(target) { - return createReactiveObject(target, true, readonlyHandlers, readonlyCollectionHandlers, readonlyMap); -} -function shallowReadonly(target) { - return createReactiveObject(target, true, shallowReadonlyHandlers, shallowReadonlyCollectionHandlers, shallowReadonlyMap); -} -function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandlers, proxyMap) { - if (!isObject$1(target)) { - { - console.warn(`value cannot be made reactive: ${String(target)}`); - } - return target; - } - if (target[ - "__v_raw" - /* ReactiveFlags.RAW */ - ] && !(isReadonly2 && target[ - "__v_isReactive" - /* ReactiveFlags.IS_REACTIVE */ - ])) { - return target; - } - const existingProxy = proxyMap.get(target); - if (existingProxy) { - return existingProxy; - } - const targetType = getTargetType(target); - if (targetType === 0) { - return target; - } - const proxy = new Proxy(target, targetType === 2 ? collectionHandlers : baseHandlers); - proxyMap.set(target, proxy); - return proxy; -} -function isReactive(value) { - if (isReadonly(value)) { - return isReactive(value[ - "__v_raw" - /* ReactiveFlags.RAW */ - ]); - } - return !!(value && value[ - "__v_isReactive" - /* ReactiveFlags.IS_REACTIVE */ - ]); -} -function isReadonly(value) { - return !!(value && value[ - "__v_isReadonly" - /* ReactiveFlags.IS_READONLY */ - ]); -} -function isShallow(value) { - return !!(value && value[ - "__v_isShallow" - /* ReactiveFlags.IS_SHALLOW */ - ]); -} -function isProxy(value) { - return isReactive(value) || isReadonly(value); -} -function toRaw(observed) { - const raw = observed && observed[ - "__v_raw" - /* ReactiveFlags.RAW */ - ]; - return raw ? toRaw(raw) : observed; -} -function markRaw(value) { - def(value, "__v_skip", true); - return value; -} -const toReactive = (value) => isObject$1(value) ? reactive(value) : value; -const toReadonly = (value) => isObject$1(value) ? readonly(value) : value; -function trackRefValue(ref2) { - if (shouldTrack && activeEffect) { - ref2 = toRaw(ref2); - { - trackEffects(ref2.dep || (ref2.dep = createDep()), { - target: ref2, - type: "get", - key: "value" - }); - } - } -} -function triggerRefValue(ref2, newVal) { - ref2 = toRaw(ref2); - const dep = ref2.dep; - if (dep) { - { - triggerEffects(dep, { - target: ref2, - type: "set", - key: "value", - newValue: newVal - }); - } - } -} -function isRef(r) { - return !!(r && r.__v_isRef === true); -} -function ref(value) { - return createRef(value, false); -} -function createRef(rawValue, shallow) { - if (isRef(rawValue)) { - return rawValue; - } - return new RefImpl(rawValue, shallow); -} -class RefImpl { - constructor(value, __v_isShallow) { - this.__v_isShallow = __v_isShallow; - this.dep = void 0; - this.__v_isRef = true; - this._rawValue = __v_isShallow ? value : toRaw(value); - this._value = __v_isShallow ? value : toReactive(value); - } - get value() { - trackRefValue(this); - return this._value; - } - set value(newVal) { - const useDirectValue = this.__v_isShallow || isShallow(newVal) || isReadonly(newVal); - newVal = useDirectValue ? newVal : toRaw(newVal); - if (hasChanged(newVal, this._rawValue)) { - this._rawValue = newVal; - this._value = useDirectValue ? newVal : toReactive(newVal); - triggerRefValue(this, newVal); - } - } -} -function unref(ref2) { - return isRef(ref2) ? ref2.value : ref2; -} -const shallowUnwrapHandlers = { - get: (target, key, receiver) => unref(Reflect.get(target, key, receiver)), - set: (target, key, value, receiver) => { - const oldValue = target[key]; - if (isRef(oldValue) && !isRef(value)) { - oldValue.value = value; - return true; - } else { - return Reflect.set(target, key, value, receiver); - } - } -}; -function proxyRefs(objectWithRefs) { - return isReactive(objectWithRefs) ? objectWithRefs : new Proxy(objectWithRefs, shallowUnwrapHandlers); -} -function toRefs(object) { - if (!isProxy(object)) { - console.warn(`toRefs() expects a reactive object but received a plain one.`); - } - const ret = isArray(object) ? new Array(object.length) : {}; - for (const key in object) { - ret[key] = toRef(object, key); - } - return ret; -} -class ObjectRefImpl { - constructor(_object, _key, _defaultValue) { - this._object = _object; - this._key = _key; - this._defaultValue = _defaultValue; - this.__v_isRef = true; - } - get value() { - const val = this._object[this._key]; - return val === void 0 ? this._defaultValue : val; - } - set value(newVal) { - this._object[this._key] = newVal; - } - get dep() { - return getDepFromReactive(toRaw(this._object), this._key); - } -} -function toRef(object, key, defaultValue) { - const val = object[key]; - return isRef(val) ? val : new ObjectRefImpl(object, key, defaultValue); -} -var _a; -class ComputedRefImpl { - constructor(getter, _setter, isReadonly2, isSSR) { - this._setter = _setter; - this.dep = void 0; - this.__v_isRef = true; - this[_a] = false; - this._dirty = true; - this.effect = new ReactiveEffect(getter, () => { - if (!this._dirty) { - this._dirty = true; - triggerRefValue(this); - } - }); - this.effect.computed = this; - this.effect.active = this._cacheable = !isSSR; - this[ - "__v_isReadonly" - /* ReactiveFlags.IS_READONLY */ - ] = isReadonly2; - } - get value() { - const self = toRaw(this); - trackRefValue(self); - if (self._dirty || !self._cacheable) { - self._dirty = false; - self._value = self.effect.run(); - } - return self._value; - } - set value(newValue) { - this._setter(newValue); - } -} -_a = "__v_isReadonly"; -function computed$1(getterOrOptions, debugOptions, isSSR = false) { - let getter; - let setter; - const onlyGetter = isFunction(getterOrOptions); - if (onlyGetter) { - getter = getterOrOptions; - setter = () => { - console.warn("Write operation failed: computed value is readonly"); - }; - } else { - getter = getterOrOptions.get; - setter = getterOrOptions.set; - } - const cRef = new ComputedRefImpl(getter, setter, onlyGetter || !setter, isSSR); - if (debugOptions && !isSSR) { - cRef.effect.onTrack = debugOptions.onTrack; - cRef.effect.onTrigger = debugOptions.onTrigger; - } - return cRef; -} -const stack = []; -function pushWarningContext(vnode) { - stack.push(vnode); -} -function popWarningContext() { - stack.pop(); -} -function warn(msg, ...args) { - pauseTracking(); - const instance = stack.length ? stack[stack.length - 1].component : null; - const appWarnHandler = instance && instance.appContext.config.warnHandler; - const trace = getComponentTrace(); - if (appWarnHandler) { - callWithErrorHandling(appWarnHandler, instance, 11, [ - msg + args.join(""), - instance && instance.proxy, - trace.map(({ vnode }) => `at <${formatComponentName(instance, vnode.type)}>`).join("\n"), - trace - ]); - } else { - const warnArgs = [`[Vue warn]: ${msg}`, ...args]; - if (trace.length && // avoid spamming console during tests - true) { - warnArgs.push(` -`, ...formatTrace(trace)); - } - console.warn(...warnArgs); - } - resetTracking(); -} -function getComponentTrace() { - let currentVNode = stack[stack.length - 1]; - if (!currentVNode) { - return []; - } - const normalizedStack = []; - while (currentVNode) { - const last = normalizedStack[0]; - if (last && last.vnode === currentVNode) { - last.recurseCount++; - } else { - normalizedStack.push({ - vnode: currentVNode, - recurseCount: 0 - }); - } - const parentInstance = currentVNode.component && currentVNode.component.parent; - currentVNode = parentInstance && parentInstance.vnode; - } - return normalizedStack; -} -function formatTrace(trace) { - const logs = []; - trace.forEach((entry, i) => { - logs.push(...i === 0 ? [] : [` -`], ...formatTraceEntry(entry)); - }); - return logs; -} -function formatTraceEntry({ vnode, recurseCount }) { - const postfix = recurseCount > 0 ? `... (${recurseCount} recursive calls)` : ``; - const isRoot = vnode.component ? vnode.component.parent == null : false; - const open = ` at <${formatComponentName(vnode.component, vnode.type, isRoot)}`; - const close = `>` + postfix; - return vnode.props ? [open, ...formatProps(vnode.props), close] : [open + close]; -} -function formatProps(props) { - const res = []; - const keys = Object.keys(props); - keys.slice(0, 3).forEach((key) => { - res.push(...formatProp(key, props[key])); - }); - if (keys.length > 3) { - res.push(` ...`); - } - return res; -} -function formatProp(key, value, raw) { - if (isString(value)) { - value = JSON.stringify(value); - return raw ? value : [`${key}=${value}`]; - } else if (typeof value === "number" || typeof value === "boolean" || value == null) { - return raw ? value : [`${key}=${value}`]; - } else if (isRef(value)) { - value = formatProp(key, toRaw(value.value), true); - return raw ? value : [`${key}=Ref<`, value, `>`]; - } else if (isFunction(value)) { - return [`${key}=fn${value.name ? `<${value.name}>` : ``}`]; - } else { - value = toRaw(value); - return raw ? value : [`${key}=`, value]; - } -} -const ErrorTypeStrings = { - [ - "sp" - /* LifecycleHooks.SERVER_PREFETCH */ - ]: "serverPrefetch hook", - [ - "bc" - /* LifecycleHooks.BEFORE_CREATE */ - ]: "beforeCreate hook", - [ - "c" - /* LifecycleHooks.CREATED */ - ]: "created hook", - [ - "bm" - /* LifecycleHooks.BEFORE_MOUNT */ - ]: "beforeMount hook", - [ - "m" - /* LifecycleHooks.MOUNTED */ - ]: "mounted hook", - [ - "bu" - /* LifecycleHooks.BEFORE_UPDATE */ - ]: "beforeUpdate hook", - [ - "u" - /* LifecycleHooks.UPDATED */ - ]: "updated", - [ - "bum" - /* LifecycleHooks.BEFORE_UNMOUNT */ - ]: "beforeUnmount hook", - [ - "um" - /* LifecycleHooks.UNMOUNTED */ - ]: "unmounted hook", - [ - "a" - /* LifecycleHooks.ACTIVATED */ - ]: "activated hook", - [ - "da" - /* LifecycleHooks.DEACTIVATED */ - ]: "deactivated hook", - [ - "ec" - /* LifecycleHooks.ERROR_CAPTURED */ - ]: "errorCaptured hook", - [ - "rtc" - /* LifecycleHooks.RENDER_TRACKED */ - ]: "renderTracked hook", - [ - "rtg" - /* LifecycleHooks.RENDER_TRIGGERED */ - ]: "renderTriggered hook", - [ - 0 - /* ErrorCodes.SETUP_FUNCTION */ - ]: "setup function", - [ - 1 - /* ErrorCodes.RENDER_FUNCTION */ - ]: "render function", - [ - 2 - /* ErrorCodes.WATCH_GETTER */ - ]: "watcher getter", - [ - 3 - /* ErrorCodes.WATCH_CALLBACK */ - ]: "watcher callback", - [ - 4 - /* ErrorCodes.WATCH_CLEANUP */ - ]: "watcher cleanup function", - [ - 5 - /* ErrorCodes.NATIVE_EVENT_HANDLER */ - ]: "native event handler", - [ - 6 - /* ErrorCodes.COMPONENT_EVENT_HANDLER */ - ]: "component event handler", - [ - 7 - /* ErrorCodes.VNODE_HOOK */ - ]: "vnode hook", - [ - 8 - /* ErrorCodes.DIRECTIVE_HOOK */ - ]: "directive hook", - [ - 9 - /* ErrorCodes.TRANSITION_HOOK */ - ]: "transition hook", - [ - 10 - /* ErrorCodes.APP_ERROR_HANDLER */ - ]: "app errorHandler", - [ - 11 - /* ErrorCodes.APP_WARN_HANDLER */ - ]: "app warnHandler", - [ - 12 - /* ErrorCodes.FUNCTION_REF */ - ]: "ref function", - [ - 13 - /* ErrorCodes.ASYNC_COMPONENT_LOADER */ - ]: "async component loader", - [ - 14 - /* ErrorCodes.SCHEDULER */ - ]: "scheduler flush. This is likely a Vue internals bug. Please open an issue at https://new-issue.vuejs.org/?repo=vuejs/core" -}; -function callWithErrorHandling(fn, instance, type, args) { - let res; - try { - res = args ? fn(...args) : fn(); - } catch (err) { - handleError(err, instance, type); - } - return res; -} -function callWithAsyncErrorHandling(fn, instance, type, args) { - if (isFunction(fn)) { - const res = callWithErrorHandling(fn, instance, type, args); - if (res && isPromise(res)) { - res.catch((err) => { - handleError(err, instance, type); - }); - } - return res; - } - const values = []; - for (let i = 0; i < fn.length; i++) { - values.push(callWithAsyncErrorHandling(fn[i], instance, type, args)); - } - return values; -} -function handleError(err, instance, type, throwInDev = true) { - const contextVNode = instance ? instance.vnode : null; - if (instance) { - let cur = instance.parent; - const exposedInstance = instance.proxy; - const errorInfo = ErrorTypeStrings[type] || type; - while (cur) { - const errorCapturedHooks = cur.ec; - if (errorCapturedHooks) { - for (let i = 0; i < errorCapturedHooks.length; i++) { - if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === false) { - return; - } - } - } - cur = cur.parent; - } - const appErrorHandler = instance.appContext.config.errorHandler; - if (appErrorHandler) { - callWithErrorHandling(appErrorHandler, null, 10, [err, exposedInstance, errorInfo]); - return; - } - } - logError(err, type, contextVNode, throwInDev); -} -function logError(err, type, contextVNode, throwInDev = true) { - { - const info = ErrorTypeStrings[type] || type; - if (contextVNode) { - pushWarningContext(contextVNode); - } - warn(`Unhandled error${info ? ` during execution of ${info}` : ``}`); - if (contextVNode) { - popWarningContext(); - } - if (throwInDev) { - console.error(err); - } else { - console.error(err); - } - } -} -let isFlushing = false; -let isFlushPending = false; -const queue = []; -let flushIndex = 0; -const pendingPostFlushCbs = []; -let activePostFlushCbs = null; -let postFlushIndex = 0; -const resolvedPromise = /* @__PURE__ */ Promise.resolve(); -let currentFlushPromise = null; -const RECURSION_LIMIT = 100; -function nextTick$1(fn) { - const p2 = currentFlushPromise || resolvedPromise; - return fn ? p2.then(this ? fn.bind(this) : fn) : p2; -} -function findInsertionIndex(id) { - let start = flushIndex + 1; - let end = queue.length; - while (start < end) { - const middle = start + end >>> 1; - const middleJobId = getId(queue[middle]); - middleJobId < id ? start = middle + 1 : end = middle; - } - return start; -} -function queueJob(job) { - if (!queue.length || !queue.includes(job, isFlushing && job.allowRecurse ? flushIndex + 1 : flushIndex)) { - if (job.id == null) { - queue.push(job); - } else { - queue.splice(findInsertionIndex(job.id), 0, job); - } - queueFlush(); - } -} -function queueFlush() { - if (!isFlushing && !isFlushPending) { - isFlushPending = true; - currentFlushPromise = resolvedPromise.then(flushJobs); - } -} -function hasQueueJob(job) { - return queue.indexOf(job) > -1; -} -function invalidateJob(job) { - const i = queue.indexOf(job); - if (i > flushIndex) { - queue.splice(i, 1); - } -} -function queuePostFlushCb(cb) { - if (!isArray(cb)) { - if (!activePostFlushCbs || !activePostFlushCbs.includes(cb, cb.allowRecurse ? postFlushIndex + 1 : postFlushIndex)) { - pendingPostFlushCbs.push(cb); - } - } else { - pendingPostFlushCbs.push(...cb); - } - queueFlush(); -} -function flushPreFlushCbs(seen, i = isFlushing ? flushIndex + 1 : 0) { - { - seen = seen || /* @__PURE__ */ new Map(); - } - for (; i < queue.length; i++) { - const cb = queue[i]; - if (cb && cb.pre) { - if (checkRecursiveUpdates(seen, cb)) { - continue; - } - queue.splice(i, 1); - i--; - cb(); - } - } -} -function flushPostFlushCbs(seen) { - if (pendingPostFlushCbs.length) { - const deduped = [...new Set(pendingPostFlushCbs)]; - pendingPostFlushCbs.length = 0; - if (activePostFlushCbs) { - activePostFlushCbs.push(...deduped); - return; - } - activePostFlushCbs = deduped; - { - seen = seen || /* @__PURE__ */ new Map(); - } - activePostFlushCbs.sort((a, b) => getId(a) - getId(b)); - for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) { - if (checkRecursiveUpdates(seen, activePostFlushCbs[postFlushIndex])) { - continue; - } - activePostFlushCbs[postFlushIndex](); - } - activePostFlushCbs = null; - postFlushIndex = 0; - } -} -const getId = (job) => job.id == null ? Infinity : job.id; -const comparator = (a, b) => { - const diff2 = getId(a) - getId(b); - if (diff2 === 0) { - if (a.pre && !b.pre) - return -1; - if (b.pre && !a.pre) - return 1; - } - return diff2; -}; -function flushJobs(seen) { - isFlushPending = false; - isFlushing = true; - { - seen = seen || /* @__PURE__ */ new Map(); - } - queue.sort(comparator); - const check = (job) => checkRecursiveUpdates(seen, job); - try { - for (flushIndex = 0; flushIndex < queue.length; flushIndex++) { - const job = queue[flushIndex]; - if (job && job.active !== false) { - if (check(job)) { - continue; - } - callWithErrorHandling( - job, - null, - 14 - /* ErrorCodes.SCHEDULER */ - ); - } - } - } finally { - flushIndex = 0; - queue.length = 0; - flushPostFlushCbs(seen); - isFlushing = false; - currentFlushPromise = null; - if (queue.length || pendingPostFlushCbs.length) { - flushJobs(seen); - } - } -} -function checkRecursiveUpdates(seen, fn) { - if (!seen.has(fn)) { - seen.set(fn, 1); - } else { - const count = seen.get(fn); - if (count > RECURSION_LIMIT) { - const instance = fn.ownerInstance; - const componentName = instance && getComponentName(instance.type); - warn(`Maximum recursive updates exceeded${componentName ? ` in component <${componentName}>` : ``}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`); - return true; - } else { - seen.set(fn, count + 1); - } - } -} -let devtools; -let buffer = []; -let devtoolsNotInstalled = false; -function emit$1(event, ...args) { - if (devtools) { - devtools.emit(event, ...args); - } else if (!devtoolsNotInstalled) { - buffer.push({ event, args }); - } -} -function setDevtoolsHook(hook, target) { - var _a2, _b; - devtools = hook; - if (devtools) { - devtools.enabled = true; - buffer.forEach(({ event, args }) => devtools.emit(event, ...args)); - buffer = []; - } else if ( - // handle late devtools injection - only do this if we are in an actual - // browser environment to avoid the timer handle stalling test runner exit - // (#4815) - typeof window !== "undefined" && // some envs mock window but not fully - // eslint-disable-next-line no-restricted-globals - window.HTMLElement && // also exclude jsdom - // eslint-disable-next-line no-restricted-globals - !((_b = (_a2 = window.navigator) === null || _a2 === void 0 ? void 0 : _a2.userAgent) === null || _b === void 0 ? void 0 : _b.includes("jsdom")) - ) { - const replay = target.__VUE_DEVTOOLS_HOOK_REPLAY__ = target.__VUE_DEVTOOLS_HOOK_REPLAY__ || []; - replay.push((newHook) => { - setDevtoolsHook(newHook, target); - }); - setTimeout(() => { - if (!devtools) { - target.__VUE_DEVTOOLS_HOOK_REPLAY__ = null; - devtoolsNotInstalled = true; - buffer = []; - } - }, 3e3); - } else { - devtoolsNotInstalled = true; - buffer = []; - } -} -function devtoolsInitApp(app, version2) { - emit$1("app:init", app, version2, { - Fragment, - Text, - Comment, - Static - }); -} -const devtoolsComponentAdded = /* @__PURE__ */ createDevtoolsComponentHook( - "component:added" - /* DevtoolsHooks.COMPONENT_ADDED */ -); -const devtoolsComponentUpdated = /* @__PURE__ */ createDevtoolsComponentHook( - "component:updated" - /* DevtoolsHooks.COMPONENT_UPDATED */ -); -const _devtoolsComponentRemoved = /* @__PURE__ */ createDevtoolsComponentHook( - "component:removed" - /* DevtoolsHooks.COMPONENT_REMOVED */ -); -const devtoolsComponentRemoved = (component) => { - if (devtools && typeof devtools.cleanupBuffer === "function" && // remove the component if it wasn't buffered - !devtools.cleanupBuffer(component)) { - _devtoolsComponentRemoved(component); - } -}; -function createDevtoolsComponentHook(hook) { - return (component) => { - emit$1( - hook, - component.appContext.app, - component.uid, - // fixed by xxxxxx - // 为 0 是 App,无 parent 是 Page 指向 App - component.uid === 0 ? void 0 : component.parent ? component.parent.uid : 0, - component - ); - }; -} -const devtoolsPerfStart = /* @__PURE__ */ createDevtoolsPerformanceHook( - "perf:start" - /* DevtoolsHooks.PERFORMANCE_START */ -); -const devtoolsPerfEnd = /* @__PURE__ */ createDevtoolsPerformanceHook( - "perf:end" - /* DevtoolsHooks.PERFORMANCE_END */ -); -function createDevtoolsPerformanceHook(hook) { - return (component, type, time) => { - emit$1(hook, component.appContext.app, component.uid, component, type, time); - }; -} -function devtoolsComponentEmit(component, event, params) { - emit$1("component:emit", component.appContext.app, component, event, params); -} -function emit(instance, event, ...rawArgs) { - if (instance.isUnmounted) - return; - const props = instance.vnode.props || EMPTY_OBJ; - { - const { emitsOptions, propsOptions: [propsOptions] } = instance; - if (emitsOptions) { - if (!(event in emitsOptions) && true) { - if (!propsOptions || !(toHandlerKey(event) in propsOptions)) { - warn(`Component emitted event "${event}" but it is neither declared in the emits option nor as an "${toHandlerKey(event)}" prop.`); - } - } else { - const validator = emitsOptions[event]; - if (isFunction(validator)) { - const isValid = validator(...rawArgs); - if (!isValid) { - warn(`Invalid event arguments: event validation failed for event "${event}".`); - } - } - } - } - } - let args = rawArgs; - const isModelListener2 = event.startsWith("update:"); - const modelArg = isModelListener2 && event.slice(7); - if (modelArg && modelArg in props) { - const modifiersKey = `${modelArg === "modelValue" ? "model" : modelArg}Modifiers`; - const { number, trim } = props[modifiersKey] || EMPTY_OBJ; - if (trim) { - args = rawArgs.map((a) => isString(a) ? a.trim() : a); - } - if (number) { - args = rawArgs.map(looseToNumber); - } - } - { - devtoolsComponentEmit(instance, event, args); - } - { - const lowerCaseEvent = event.toLowerCase(); - if (lowerCaseEvent !== event && props[toHandlerKey(lowerCaseEvent)]) { - warn(`Event "${lowerCaseEvent}" is emitted in component ${formatComponentName(instance, instance.type)} but the handler is registered for "${event}". Note that HTML attributes are case-insensitive and you cannot use v-on to listen to camelCase events when using in-DOM templates. You should probably use "${hyphenate(event)}" instead of "${event}".`); - } - } - let handlerName; - let handler = props[handlerName = toHandlerKey(event)] || // also try camelCase event handler (#2249) - props[handlerName = toHandlerKey(camelize(event))]; - if (!handler && isModelListener2) { - handler = props[handlerName = toHandlerKey(hyphenate(event))]; - } - if (handler) { - callWithAsyncErrorHandling(handler, instance, 6, args); - } - const onceHandler = props[handlerName + `Once`]; - if (onceHandler) { - if (!instance.emitted) { - instance.emitted = {}; - } else if (instance.emitted[handlerName]) { - return; - } - instance.emitted[handlerName] = true; - callWithAsyncErrorHandling(onceHandler, instance, 6, args); - } -} -function normalizeEmitsOptions(comp, appContext, asMixin = false) { - const cache = appContext.emitsCache; - const cached = cache.get(comp); - if (cached !== void 0) { - return cached; - } - const raw = comp.emits; - let normalized = {}; - let hasExtends = false; - if (!isFunction(comp)) { - const extendEmits = (raw2) => { - const normalizedFromExtend = normalizeEmitsOptions(raw2, appContext, true); - if (normalizedFromExtend) { - hasExtends = true; - extend(normalized, normalizedFromExtend); - } - }; - if (!asMixin && appContext.mixins.length) { - appContext.mixins.forEach(extendEmits); - } - if (comp.extends) { - extendEmits(comp.extends); - } - if (comp.mixins) { - comp.mixins.forEach(extendEmits); - } - } - if (!raw && !hasExtends) { - if (isObject$1(comp)) { - cache.set(comp, null); - } - return null; - } - if (isArray(raw)) { - raw.forEach((key) => normalized[key] = null); - } else { - extend(normalized, raw); - } - if (isObject$1(comp)) { - cache.set(comp, normalized); - } - return normalized; -} -function isEmitListener(options, key) { - if (!options || !isOn(key)) { - return false; - } - key = key.slice(2).replace(/Once$/, ""); - return hasOwn$1(options, key[0].toLowerCase() + key.slice(1)) || hasOwn$1(options, hyphenate(key)) || hasOwn$1(options, key); -} -let currentRenderingInstance = null; -function setCurrentRenderingInstance(instance) { - const prev = currentRenderingInstance; - currentRenderingInstance = instance; - instance && instance.type.__scopeId || null; - return prev; -} -function provide(key, value) { - if (!currentInstance) { - { - warn(`provide() can only be used inside setup().`); - } - } else { - let provides = currentInstance.provides; - const parentProvides = currentInstance.parent && currentInstance.parent.provides; - if (parentProvides === provides) { - provides = currentInstance.provides = Object.create(parentProvides); - } - provides[key] = value; - if (currentInstance.type.mpType === "app") { - currentInstance.appContext.app.provide(key, value); - } - } -} -function inject(key, defaultValue, treatDefaultAsFactory = false) { - const instance = currentInstance || currentRenderingInstance; - if (instance) { - const provides = instance.parent == null ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides; - if (provides && key in provides) { - return provides[key]; - } else if (arguments.length > 1) { - return treatDefaultAsFactory && isFunction(defaultValue) ? defaultValue.call(instance.proxy) : defaultValue; - } else { - warn(`injection "${String(key)}" not found.`); - } - } else { - warn(`inject() can only be used inside setup() or functional components.`); - } -} -const INITIAL_WATCHER_VALUE = {}; -function watch(source, cb, options) { - if (!isFunction(cb)) { - warn(`\`watch(fn, options?)\` signature has been moved to a separate API. Use \`watchEffect(fn, options?)\` instead. \`watch\` now only supports \`watch(source, cb, options?) signature.`); - } - return doWatch(source, cb, options); -} -function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EMPTY_OBJ) { - if (!cb) { - if (immediate !== void 0) { - warn(`watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.`); - } - if (deep !== void 0) { - warn(`watch() "deep" option is only respected when using the watch(source, callback, options?) signature.`); - } - } - const warnInvalidSource = (s2) => { - warn(`Invalid watch source: `, s2, `A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.`); - }; - const instance = getCurrentScope() === (currentInstance === null || currentInstance === void 0 ? void 0 : currentInstance.scope) ? currentInstance : null; - let getter; - let forceTrigger = false; - let isMultiSource = false; - if (isRef(source)) { - getter = () => source.value; - forceTrigger = isShallow(source); - } else if (isReactive(source)) { - getter = () => source; - deep = true; - } else if (isArray(source)) { - isMultiSource = true; - forceTrigger = source.some((s2) => isReactive(s2) || isShallow(s2)); - getter = () => source.map((s2) => { - if (isRef(s2)) { - return s2.value; - } else if (isReactive(s2)) { - return traverse(s2); - } else if (isFunction(s2)) { - return callWithErrorHandling( - s2, - instance, - 2 - /* ErrorCodes.WATCH_GETTER */ - ); - } else { - warnInvalidSource(s2); - } - }); - } else if (isFunction(source)) { - if (cb) { - getter = () => callWithErrorHandling( - source, - instance, - 2 - /* ErrorCodes.WATCH_GETTER */ - ); - } else { - getter = () => { - if (instance && instance.isUnmounted) { - return; - } - if (cleanup) { - cleanup(); - } - return callWithAsyncErrorHandling(source, instance, 3, [onCleanup]); - }; - } - } else { - getter = NOOP; - warnInvalidSource(source); - } - if (cb && deep) { - const baseGetter = getter; - getter = () => traverse(baseGetter()); - } - let cleanup; - let onCleanup = (fn) => { - cleanup = effect.onStop = () => { - callWithErrorHandling( - fn, - instance, - 4 - /* ErrorCodes.WATCH_CLEANUP */ - ); - }; - }; - let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE; - const job = () => { - if (!effect.active) { - return; - } - if (cb) { - const newValue = effect.run(); - if (deep || forceTrigger || (isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue)) || false) { - if (cleanup) { - cleanup(); - } - callWithAsyncErrorHandling(cb, instance, 3, [ - newValue, - // pass undefined as the old value when it's changed for the first time - oldValue === INITIAL_WATCHER_VALUE ? void 0 : isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE ? [] : oldValue, - onCleanup - ]); - oldValue = newValue; - } - } else { - effect.run(); - } - }; - job.allowRecurse = !!cb; - let scheduler; - if (flush === "sync") { - scheduler = job; - } else if (flush === "post") { - scheduler = () => queuePostRenderEffect$1(job, instance && instance.suspense); - } else { - job.pre = true; - if (instance) - job.id = instance.uid; - scheduler = () => queueJob(job); - } - const effect = new ReactiveEffect(getter, scheduler); - { - effect.onTrack = onTrack; - effect.onTrigger = onTrigger; - } - if (cb) { - if (immediate) { - job(); - } else { - oldValue = effect.run(); - } - } else if (flush === "post") { - queuePostRenderEffect$1(effect.run.bind(effect), instance && instance.suspense); - } else { - effect.run(); - } - const unwatch = () => { - effect.stop(); - if (instance && instance.scope) { - remove(instance.scope.effects, effect); - } - }; - return unwatch; -} -function instanceWatch(source, value, options) { - const publicThis = this.proxy; - const getter = isString(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis); - let cb; - if (isFunction(value)) { - cb = value; - } else { - cb = value.handler; - options = value; - } - const cur = currentInstance; - setCurrentInstance(this); - const res = doWatch(getter, cb.bind(publicThis), options); - if (cur) { - setCurrentInstance(cur); - } else { - unsetCurrentInstance(); - } - return res; -} -function createPathGetter(ctx, path) { - const segments = path.split("."); - return () => { - let cur = ctx; - for (let i = 0; i < segments.length && cur; i++) { - cur = cur[segments[i]]; - } - return cur; - }; -} -function traverse(value, seen) { - if (!isObject$1(value) || value[ - "__v_skip" - /* ReactiveFlags.SKIP */ - ]) { - return value; - } - seen = seen || /* @__PURE__ */ new Set(); - if (seen.has(value)) { - return value; - } - seen.add(value); - if (isRef(value)) { - traverse(value.value, seen); - } else if (isArray(value)) { - for (let i = 0; i < value.length; i++) { - traverse(value[i], seen); - } - } else if (isSet(value) || isMap(value)) { - value.forEach((v) => { - traverse(v, seen); - }); - } else if (isPlainObject$1(value)) { - for (const key in value) { - traverse(value[key], seen); - } - } - return value; -} -const isKeepAlive = (vnode) => vnode.type.__isKeepAlive; -function onActivated(hook, target) { - registerKeepAliveHook(hook, "a", target); -} -function onDeactivated(hook, target) { - registerKeepAliveHook(hook, "da", target); -} -function registerKeepAliveHook(hook, type, target = currentInstance) { - const wrappedHook = hook.__wdc || (hook.__wdc = () => { - let current = target; - while (current) { - if (current.isDeactivated) { - return; - } - current = current.parent; - } - return hook(); - }); - injectHook(type, wrappedHook, target); - if (target) { - let current = target.parent; - while (current && current.parent) { - if (isKeepAlive(current.parent.vnode)) { - injectToKeepAliveRoot(wrappedHook, type, target, current); - } - current = current.parent; - } - } -} -function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) { - const injected = injectHook( - type, - hook, - keepAliveRoot, - true - /* prepend */ - ); - onUnmounted(() => { - remove(keepAliveRoot[type], injected); - }, target); -} -function injectHook(type, hook, target = currentInstance, prepend = false) { - if (target) { - if (isRootHook(type)) { - target = target.root; - } - const hooks = target[type] || (target[type] = []); - const wrappedHook = hook.__weh || (hook.__weh = (...args) => { - if (target.isUnmounted) { - return; - } - pauseTracking(); - setCurrentInstance(target); - const res = callWithAsyncErrorHandling(hook, target, type, args); - unsetCurrentInstance(); - resetTracking(); - return res; - }); - if (prepend) { - hooks.unshift(wrappedHook); - } else { - hooks.push(wrappedHook); - } - return wrappedHook; - } else { - const apiName = toHandlerKey((ErrorTypeStrings[type] || type.replace(/^on/, "")).replace(/ hook$/, "")); - warn(`${apiName} is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup().`); - } -} -const createHook$1 = (lifecycle) => (hook, target = currentInstance) => ( - // post-create lifecycle registrations are noops during SSR (except for serverPrefetch) - (!isInSSRComponentSetup || lifecycle === "sp") && injectHook(lifecycle, (...args) => hook(...args), target) -); -const onBeforeMount = createHook$1( - "bm" - /* LifecycleHooks.BEFORE_MOUNT */ -); -const onMounted = createHook$1( - "m" - /* LifecycleHooks.MOUNTED */ -); -const onBeforeUpdate = createHook$1( - "bu" - /* LifecycleHooks.BEFORE_UPDATE */ -); -const onUpdated = createHook$1( - "u" - /* LifecycleHooks.UPDATED */ -); -const onBeforeUnmount = createHook$1( - "bum" - /* LifecycleHooks.BEFORE_UNMOUNT */ -); -const onUnmounted = createHook$1( - "um" - /* LifecycleHooks.UNMOUNTED */ -); -const onServerPrefetch = createHook$1( - "sp" - /* LifecycleHooks.SERVER_PREFETCH */ -); -const onRenderTriggered = createHook$1( - "rtg" - /* LifecycleHooks.RENDER_TRIGGERED */ -); -const onRenderTracked = createHook$1( - "rtc" - /* LifecycleHooks.RENDER_TRACKED */ -); -function onErrorCaptured(hook, target = currentInstance) { - injectHook("ec", hook, target); -} -function validateDirectiveName(name) { - if (isBuiltInDirective(name)) { - warn("Do not use built-in directive ids as custom directive id: " + name); - } -} -const COMPONENTS = "components"; -function resolveComponent(name, maybeSelfReference) { - return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name; -} -function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false) { - const instance = currentRenderingInstance || currentInstance; - if (instance) { - const Component2 = instance.type; - if (type === COMPONENTS) { - const selfName = getComponentName( - Component2, - false - /* do not include inferred name to avoid breaking existing code */ - ); - if (selfName && (selfName === name || selfName === camelize(name) || selfName === capitalize(camelize(name)))) { - return Component2; - } - } - const res = ( - // local registration - // check instance[type] first which is resolved for options API - resolve(instance[type] || Component2[type], name) || // global registration - resolve(instance.appContext[type], name) - ); - if (!res && maybeSelfReference) { - return Component2; - } - if (warnMissing && !res) { - const extra = type === COMPONENTS ? ` -If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.` : ``; - warn(`Failed to resolve ${type.slice(0, -1)}: ${name}${extra}`); - } - return res; - } else { - warn(`resolve${capitalize(type.slice(0, -1))} can only be used in render() or setup().`); - } -} -function resolve(registry, name) { - return registry && (registry[name] || registry[camelize(name)] || registry[capitalize(camelize(name))]); -} -const getPublicInstance = (i) => { - if (!i) - return null; - if (isStatefulComponent(i)) - return getExposeProxy(i) || i.proxy; - return getPublicInstance(i.parent); -}; -const publicPropertiesMap = ( - // Move PURE marker to new line to workaround compiler discarding it - // due to type annotation - /* @__PURE__ */ extend(/* @__PURE__ */ Object.create(null), { - $: (i) => i, - // fixed by xxxxxx vue-i18n 在 dev 模式,访问了 $el,故模拟一个假的 - // $el: i => i.vnode.el, - $el: (i) => i.__$el || (i.__$el = {}), - $data: (i) => i.data, - $props: (i) => shallowReadonly(i.props), - $attrs: (i) => shallowReadonly(i.attrs), - $slots: (i) => shallowReadonly(i.slots), - $refs: (i) => shallowReadonly(i.refs), - $parent: (i) => getPublicInstance(i.parent), - $root: (i) => getPublicInstance(i.root), - $emit: (i) => i.emit, - $options: (i) => resolveMergedOptions(i), - $forceUpdate: (i) => i.f || (i.f = () => queueJob(i.update)), - // $nextTick: i => i.n || (i.n = nextTick.bind(i.proxy!)),// fixed by xxxxxx - $watch: (i) => instanceWatch.bind(i) - }) -); -const isReservedPrefix = (key) => key === "_" || key === "$"; -const hasSetupBinding = (state, key) => state !== EMPTY_OBJ && !state.__isScriptSetup && hasOwn$1(state, key); -const PublicInstanceProxyHandlers = { - get({ _: instance }, key) { - const { ctx, setupState, data, props, accessCache, type, appContext } = instance; - if (key === "__isVue") { - return true; - } - let normalizedProps; - if (key[0] !== "$") { - const n2 = accessCache[key]; - if (n2 !== void 0) { - switch (n2) { - case 1: - return setupState[key]; - case 2: - return data[key]; - case 4: - return ctx[key]; - case 3: - return props[key]; - } - } else if (hasSetupBinding(setupState, key)) { - accessCache[key] = 1; - return setupState[key]; - } else if (data !== EMPTY_OBJ && hasOwn$1(data, key)) { - accessCache[key] = 2; - return data[key]; - } else if ( - // only cache other properties when instance has declared (thus stable) - // props - (normalizedProps = instance.propsOptions[0]) && hasOwn$1(normalizedProps, key) - ) { - accessCache[key] = 3; - return props[key]; - } else if (ctx !== EMPTY_OBJ && hasOwn$1(ctx, key)) { - accessCache[key] = 4; - return ctx[key]; - } else if (shouldCacheAccess) { - accessCache[key] = 0; - } - } - const publicGetter = publicPropertiesMap[key]; - let cssModule, globalProperties; - if (publicGetter) { - if (key === "$attrs") { - track(instance, "get", key); - } - return publicGetter(instance); - } else if ( - // css module (injected by vue-loader) - (cssModule = type.__cssModules) && (cssModule = cssModule[key]) - ) { - return cssModule; - } else if (ctx !== EMPTY_OBJ && hasOwn$1(ctx, key)) { - accessCache[key] = 4; - return ctx[key]; - } else if ( - // global properties - globalProperties = appContext.config.globalProperties, hasOwn$1(globalProperties, key) - ) { - { - return globalProperties[key]; - } - } else if (currentRenderingInstance && (!isString(key) || // #1091 avoid internal isRef/isVNode checks on component instance leading - // to infinite warning loop - key.indexOf("__v") !== 0)) { - if (data !== EMPTY_OBJ && isReservedPrefix(key[0]) && hasOwn$1(data, key)) { - warn(`Property ${JSON.stringify(key)} must be accessed via $data because it starts with a reserved character ("$" or "_") and is not proxied on the render context.`); - } else if (instance === currentRenderingInstance) { - warn(`Property ${JSON.stringify(key)} was accessed during render but is not defined on instance.`); - } - } - }, - set({ _: instance }, key, value) { - const { data, setupState, ctx } = instance; - if (hasSetupBinding(setupState, key)) { - setupState[key] = value; - return true; - } else if (setupState.__isScriptSetup && hasOwn$1(setupState, key)) { - warn(`Cannot mutate

- -
-
npm -