1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525 |
- import {
- setupDevtoolsPlugin
- } from "./chunk-3GOOGFKQ.js";
- import {
- del,
- isVue2,
- set
- } from "./chunk-RNWUNH7L.js";
- import {
- computed2 as computed,
- effectScope,
- getCurrentInstance,
- getCurrentScope,
- hasInjectionContext,
- inject,
- isReactive,
- isRef,
- markRaw,
- nextTick,
- onScopeDispose,
- reactive,
- ref,
- toRaw,
- toRef,
- toRefs,
- unref,
- watch
- } from "./chunk-RDKJTCL2.js";
- import "./chunk-HM4MQYWN.js";
- // node_modules/pinia/dist/pinia.mjs
- var activePinia;
- var setActivePinia = (pinia) => activePinia = pinia;
- var getActivePinia = () => hasInjectionContext() && inject(piniaSymbol) || activePinia;
- var piniaSymbol = true ? Symbol("pinia") : (
- /* istanbul ignore next */
- Symbol()
- );
- function isPlainObject(o) {
- return o && typeof o === "object" && Object.prototype.toString.call(o) === "[object Object]" && typeof o.toJSON !== "function";
- }
- var MutationType;
- (function(MutationType2) {
- MutationType2["direct"] = "direct";
- MutationType2["patchObject"] = "patch object";
- MutationType2["patchFunction"] = "patch function";
- })(MutationType || (MutationType = {}));
- var IS_CLIENT = typeof window !== "undefined";
- var USE_DEVTOOLS = IS_CLIENT;
- var _global = (() => 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 } = {}) {
- 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(65279), 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();
- xhr.open("HEAD", url, false);
- try {
- xhr.send();
- } catch (e) {
- }
- return xhr.status >= 200 && xhr.status <= 299;
- }
- 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);
- }
- }
- var _navigator = typeof navigator === "object" ? navigator : { userAgent: "" };
- var isMacOSWebView = (() => /Macintosh/.test(_navigator.userAgent) && /AppleWebKit/.test(_navigator.userAgent) && !/Safari/.test(_navigator.userAgent))();
- var saveAs = !IS_CLIENT ? () => {
- } : (
- // 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";
- if (typeof blob === "string") {
- 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 {
- a.href = URL.createObjectURL(blob);
- setTimeout(function() {
- URL.revokeObjectURL(a.href);
- }, 4e4);
- 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 {
- navigator.msSaveOrOpenBlob(bom(blob, opts), name);
- }
- }
- function fileSaverSaveAs(blob, name, opts, popup) {
- 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") {
- 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;
- };
- reader.readAsDataURL(blob);
- } else {
- const url = URL.createObjectURL(blob);
- if (popup)
- popup.location.assign(url);
- else
- location.href = url;
- popup = null;
- setTimeout(function() {
- URL.revokeObjectURL(url);
- }, 4e4);
- }
- }
- function toastMessage(message, type) {
- const piniaMessage = "🍍 " + message;
- if (typeof __VUE_DEVTOOLS_TOAST__ === "function") {
- __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;
- }
- 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);
- }
- }
- var 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 });
- };
- fileInput.oncancel = () => resolve(null);
- fileInput.onerror = reject;
- fileInput.click();
- });
- }
- return openFile;
- }
- async function actionGlobalOpenStateFile(pinia) {
- try {
- const open2 = getFileOpener();
- const result = await open2();
- 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]);
- } else {
- pinia.state.value[key] = state[key];
- }
- }
- }
- function formatDisplay(display) {
- return {
- _custom: {
- display
- }
- };
- }
- var PINIA_ROOT_LABEL = "🍍 Pinia (root)";
- var 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 state2 = {
- state: storeNames.map((storeId) => ({
- editable: true,
- key: storeId,
- value: store.state.value[storeId]
- })),
- getters: storeNames.filter((id) => storeMap.get(id)._getters).map((id) => {
- const store2 = storeMap.get(id);
- return {
- editable: false,
- key: id,
- value: store2._getters.reduce((getters, key) => {
- getters[key] = store2[key];
- return getters;
- }, {})
- };
- })
- };
- return state2;
- }
- const state = {
- state: Object.keys(store.$state).map((key) => ({
- editable: true,
- key,
- value: store.$state[key]
- }))
- };
- 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)) {
- 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";
- }
- }
- var isTimelineActive = true;
- var componentStateTypes = [];
- var MUTATIONS_LAYER_ID = "pinia:mutations";
- var INSPECTOR_ID = "pinia";
- var { assign: assign$1 } = Object;
- var getStoreType = (id) => "🍍 " + id;
- 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: 15064968
- });
- 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) {
- 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) {
- 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)) {
- if (path.length !== 1 || !inspectedStore._customProperties.has(path[0]) || path[0] in inspectedStore.$state) {
- path.unshift("$state");
- }
- } else {
- 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}":
- ${path}
- Only state can be modified.`);
- }
- 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) => {
- 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 = void 0;
- 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 = void 0;
- 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;
- 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`)
- }
- }
- });
- 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 🗑`);
- };
- api.notifyComponentUpdate();
- api.sendInspectorTree(INSPECTOR_ID);
- api.sendInspectorState(INSPECTOR_ID);
- api.getSettings().logStoreChanges && toastMessage(`"${store.$id}" store installed 🆕`);
- });
- }
- var runningActionId = 0;
- var activeAction;
- function patchActionForGrouping(store, actionNames, wrapWithProxy) {
- const actions = actionNames.reduce((storeActions, actionName) => {
- storeActions[actionName] = toRaw(store)[actionName];
- return storeActions;
- }, {});
- for (const actionName in actions) {
- store[actionName] = function() {
- 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;
- activeAction = _actionId;
- const retValue = actions[actionName].apply(trackedStore, arguments);
- activeAction = void 0;
- return retValue;
- };
- }
- }
- function devtoolsPlugin({ app, store, options }) {
- if (store.$id.startsWith("__hot:")) {
- return;
- }
- store._isOptionsAPI = !!options.state;
- patchActionForGrouping(store, Object.keys(options.actions), store._isOptionsAPI);
- 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<Id, S, G, A> to StoreGeneric?
- store
- );
- }
- function createPinia() {
- const scope = effectScope(true);
- const state = scope.run(() => ref({}));
- let _p = [];
- let toBeInstalled = [];
- const pinia = markRaw({
- install(app) {
- setActivePinia(pinia);
- if (!isVue2) {
- pinia._a = app;
- app.provide(piniaSymbol, pinia);
- app.config.globalProperties.$pinia = pinia;
- 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: /* @__PURE__ */ new Map(),
- state
- });
- if (USE_DEVTOOLS && typeof Proxy !== "undefined") {
- pinia.use(devtoolsPlugin);
- }
- return pinia;
- }
- var isUseStore = (fn) => {
- return typeof fn === "function" && typeof fn.$id === "string";
- };
- function patchObject(newState, oldState) {
- for (const key in oldState) {
- const subPatch = oldState[key];
- if (!(key in newState)) {
- continue;
- }
- const targetValue = newState[key];
- if (isPlainObject(targetValue) && isPlainObject(subPatch) && !isRef(subPatch) && !isReactive(subPatch)) {
- newState[key] = patchObject(targetValue, subPatch);
- } else {
- if (isVue2) {
- set(newState, key, subPatch);
- } else {
- newState[key] = subPatch;
- }
- }
- }
- return newState;
- }
- function acceptHMRUpdate(initialUseStore, hot) {
- if (false) {
- return () => {
- };
- }
- return (newModule) => {
- const pinia = hot.data.pinia || initialUseStore._pinia;
- if (!pinia) {
- return;
- }
- hot.data.pinia = pinia;
- for (const exportName in newModule) {
- const useStore = newModule[exportName];
- if (isUseStore(useStore) && pinia._s.has(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 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);
- }
- }
- };
- }
- var 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);
- });
- }
- var fallbackRunWithContext = (fn) => fn();
- function mergeReactiveObjects(target, patchToApply) {
- if (target instanceof Map && patchToApply instanceof Map) {
- patchToApply.forEach((value, key) => target.set(key, value));
- }
- if (target instanceof Set && patchToApply instanceof Set) {
- patchToApply.forEach(target.add, target);
- }
- 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)) {
- target[key] = mergeReactiveObjects(targetValue, subPatch);
- } else {
- target[key] = subPatch;
- }
- }
- return target;
- }
- var skipHydrateSymbol = true ? Symbol("pinia:skipHydration") : (
- /* istanbul ignore next */
- Symbol()
- );
- var skipHydrateMap = /* @__PURE__ */ new WeakMap();
- 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, {});
- }
- function shouldHydrate(obj) {
- return isVue2 ? (
- /* istanbul ignore next */
- !skipHydrateMap.has(obj)
- ) : !isPlainObject(obj) || !obj.hasOwnProperty(skipHydrateSymbol);
- }
- var { 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) {
- if (isVue2) {
- set(pinia.state.value, id, state ? state() : {});
- } else {
- pinia.state.value[id] = state ? state() : {};
- }
- }
- 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);
- const store2 = pinia._s.get(id);
- if (isVue2 && !store2._r)
- return;
- return getters[name].call(store2, store2);
- }));
- 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);
- if (!pinia._e.active) {
- throw new Error("Pinia destroyed");
- }
- const $subscribeOptions = {
- deep: true
- // flush: 'post',
- };
- if (!isVue2) {
- $subscribeOptions.onTrigger = (event) => {
- if (isListening) {
- debuggerEvents = event;
- } else if (isListening == false && !store._hotUpdating) {
- if (Array.isArray(debuggerEvents)) {
- debuggerEvents.push(event);
- } else {
- console.error("🍍 debuggerEvents should be an array. This is most likely an internal Pinia bug.");
- }
- }
- };
- }
- let isListening;
- let isSyncListening;
- let subscriptions = [];
- let actionSubscriptions = [];
- let debuggerEvents;
- const initialState = pinia.state.value[$id];
- if (!isOptionsStore && !initialState && !hot) {
- if (isVue2) {
- set(pinia.state.value, $id, {});
- } else {
- pinia.state.value[$id] = {};
- }
- }
- const hotState = ref({});
- let activeListener;
- function $patch(partialStateOrMutator) {
- let subscriptionMutation;
- isListening = isSyncListening = false;
- if (true) {
- 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;
- triggerSubscriptions(subscriptions, subscriptionMutation, pinia.state.value[$id]);
- }
- const $reset = isOptionsStore ? function $reset2() {
- const { state } = options;
- const newState = state ? state() : {};
- this.$patch(($state) => {
- assign($state, newState);
- });
- } : (
- /* istanbul ignore next */
- true ? () => {
- 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);
- }
- 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);
- }
- triggerSubscriptions(actionSubscriptions, {
- args,
- name,
- store,
- after,
- onError
- });
- let ret;
- try {
- ret = action.apply(this && this.$id === $id ? this : store, args);
- } 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);
- });
- }
- triggerSubscriptions(afterCallbackList, ret);
- return ret;
- };
- }
- const _hmrPayload = markRaw({
- actions: {},
- getters: {},
- state: [],
- hotState
- });
- const partialStore = {
- _p: pinia,
- // _s: scope,
- $id,
- $onAction: addSubscription.bind(null, actionSubscriptions),
- $patch,
- $reset,
- $subscribe(callback, options2 = {}) {
- const removeSubscription = addSubscription(subscriptions, callback, options2.detached, () => stopWatcher());
- const stopWatcher = scope.run(() => watch(() => pinia.state.value[$id], (state) => {
- if (options2.flush === "sync" ? isSyncListening : isListening) {
- callback({
- storeId: $id,
- type: MutationType.direct,
- events: debuggerEvents
- }, state);
- }
- }, assign({}, $subscribeOptions, options2)));
- return removeSubscription;
- },
- $dispose
- };
- if (isVue2) {
- partialStore._r = false;
- }
- const store = reactive(true ? assign(
- {
- _hmrPayload,
- _customProperties: markRaw(/* @__PURE__ */ new Set())
- // devtools custom properties
- },
- partialStore
- // must be added later
- // setupStore
- ) : partialStore);
- pinia._s.set($id, store);
- const runWithContext = pinia._a && pinia._a.runWithContext || fallbackRunWithContext;
- const setupStore = runWithContext(() => pinia._e.run(() => (scope = effectScope()).run(setup)));
- for (const key in setupStore) {
- const prop = setupStore[key];
- if (isRef(prop) && !isComputed(prop) || isReactive(prop)) {
- if (hot) {
- set(hotState.value, key, toRef(setupStore, key));
- } else if (!isOptionsStore) {
- if (initialState && shouldHydrate(prop)) {
- if (isRef(prop)) {
- prop.value = initialState[key];
- } else {
- mergeReactiveObjects(prop, initialState[key]);
- }
- }
- if (isVue2) {
- set(pinia.state.value[$id], key, prop);
- } else {
- pinia.state.value[$id][key] = prop;
- }
- }
- if (true) {
- _hmrPayload.state.push(key);
- }
- } else if (typeof prop === "function") {
- const actionValue = hot ? prop : wrapAction(key, prop);
- if (isVue2) {
- set(setupStore, key, actionValue);
- } else {
- setupStore[key] = actionValue;
- }
- if (true) {
- _hmrPayload.actions[key] = prop;
- }
- optionsForPlugin.actions[key] = prop;
- } else if (true) {
- 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);
- }
- }
- }
- }
- if (isVue2) {
- Object.keys(setupStore).forEach((key) => {
- set(store, key, setupStore[key]);
- });
- } else {
- assign(store, setupStore);
- assign(toRaw(store), setupStore);
- }
- Object.defineProperty(store, "$state", {
- get: () => hot ? hotState.value : pinia.state.value[$id],
- set: (state) => {
- if (hot) {
- throw new Error("cannot set hotState");
- }
- $patch(($state) => {
- assign($state, state);
- });
- }
- });
- if (true) {
- 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 {
- newStore.$state[stateKey] = oldStateSource;
- }
- }
- set(store, stateKey, toRef(newStore.$state, stateKey));
- });
- Object.keys(store.$state).forEach((stateKey) => {
- if (!(stateKey in newStore.$state)) {
- del(store, stateKey);
- }
- });
- 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));
- }
- 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);
- }
- Object.keys(store._hmrPayload.getters).forEach((key) => {
- if (!(key in newStore._hmrPayload.getters)) {
- del(store, key);
- }
- });
- Object.keys(store._hmrPayload.actions).forEach((key) => {
- if (!(key in newStore._hmrPayload.actions)) {
- del(store, key);
- }
- });
- 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));
- });
- }
- if (isVue2) {
- store._r = true;
- }
- pinia._p.forEach((extender) => {
- 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
- state: () => new MyClass()
- Found in store "${store.$id}".`);
- }
- if (initialState && isOptionsStore && options.hydrate) {
- options.hydrate(store.$state, initialState);
- }
- isListening = true;
- isSyncListening = true;
- return store;
- }
- function defineStore(idOrOptions, setup, setupOptions) {
- let id;
- let options;
- const isSetupStore = typeof setup === "function";
- if (typeof idOrOptions === "string") {
- id = idOrOptions;
- 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()
- (false ? null : pinia) || (hasContext ? inject(piniaSymbol, null) : null);
- if (pinia)
- setActivePinia(pinia);
- if (!activePinia) {
- throw new Error(`[🍍]: "getActivePinia()" was called but there was no active Pinia. Are you trying to use a store before calling "app.use(pinia)"?
- See https://pinia.vuejs.org/core-concepts/outside-component-usage.html for help.
- This will fail in production.`);
- }
- pinia = activePinia;
- if (!pinia._s.has(id)) {
- if (isSetupStore) {
- createSetupStore(id, setup, options, pinia);
- } else {
- createOptionsStore(id, options, pinia);
- }
- if (true) {
- 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);
- delete pinia.state.value[hotId];
- pinia._s.delete(hotId);
- }
- if (IS_CLIENT) {
- const currentInstance = getCurrentInstance();
- 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;
- }
- }
- return store;
- }
- useStore.$id = id;
- return useStore;
- }
- var mapStoreSuffix = "Store";
- function setMapStoreSuffix(suffix) {
- mapStoreSuffix = suffix;
- }
- function mapStores(...stores) {
- if (Array.isArray(stores[0])) {
- console.warn(`[🍍]: Directly pass all stores to "mapStores()" without putting them in an array:
- Replace
- mapStores([useAuthStore, useCartStore])
- with
- mapStores(useAuthStore, useCartStore)
- This will fail in production if not fixed.`);
- stores = stores[0];
- }
- return stores.reduce((reduced, useStore) => {
- reduced[useStore.$id + mapStoreSuffix] = function() {
- return useStore(this.$pinia);
- };
- return reduced;
- }, {});
- }
- 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) => {
- reduced[key] = function() {
- const store = useStore(this.$pinia);
- const storeKey = keysOrMapper[key];
- return typeof storeKey === "function" ? storeKey.call(this, store) : store[storeKey];
- };
- return reduced;
- }, {});
- }
- var mapGetters = mapState;
- function mapActions(useStore, keysOrMapper) {
- return Array.isArray(keysOrMapper) ? keysOrMapper.reduce((reduced, key) => {
- reduced[key] = function(...args) {
- return useStore(this.$pinia)[key](...args);
- };
- return reduced;
- }, {}) : Object.keys(keysOrMapper).reduce((reduced, key) => {
- reduced[key] = function(...args) {
- return useStore(this.$pinia)[keysOrMapper[key]](...args);
- };
- return reduced;
- }, {});
- }
- function mapWritableState(useStore, keysOrMapper) {
- return Array.isArray(keysOrMapper) ? keysOrMapper.reduce((reduced, key) => {
- reduced[key] = {
- get() {
- return useStore(this.$pinia)[key];
- },
- set(value) {
- return useStore(this.$pinia)[key] = value;
- }
- };
- return reduced;
- }, {}) : Object.keys(keysOrMapper).reduce((reduced, key) => {
- reduced[key] = {
- get() {
- return useStore(this.$pinia)[keysOrMapper[key]];
- },
- set(value) {
- return useStore(this.$pinia)[keysOrMapper[key]] = value;
- }
- };
- return reduced;
- }, {});
- }
- function storeToRefs(store) {
- if (isVue2) {
- return toRefs(store);
- } else {
- store = toRaw(store);
- const refs = {};
- for (const key in store) {
- const value = store[key];
- if (isRef(value) || isReactive(value)) {
- refs[key] = // ---
- toRef(store, key);
- }
- }
- return refs;
- }
- }
- var PiniaVuePlugin = function(_Vue) {
- _Vue.mixin({
- beforeCreate() {
- const options = this.$options;
- if (options.pinia) {
- const pinia = options.pinia;
- if (!this._provided) {
- const provideCache = {};
- Object.defineProperty(this, "_provided", {
- get: () => provideCache,
- set: (v) => Object.assign(provideCache, v)
- });
- }
- this._provided[piniaSymbol] = pinia;
- if (!this.$pinia) {
- this.$pinia = pinia;
- }
- pinia._a = this;
- if (IS_CLIENT) {
- 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
- };
- /*! Bundled license information:
- pinia/dist/pinia.mjs:
- (*!
- * pinia v2.1.7
- * (c) 2023 Eduardo San Martin Morote
- * @license MIT
- *)
- */
- //# sourceMappingURL=pinia.js.map
|