d26db06f74
NPM Installation / build (16.x, ubuntu-latest) (push) Has been cancelled
NPM Installation / build (16.x, windows-latest) (push) Has been cancelled
NPM Installation / build (17.x, ubuntu-latest) (push) Has been cancelled
NPM Installation / build (17.x, windows-latest) (push) Has been cancelled
NPM Installation / build (18.x, ubuntu-latest) (push) Has been cancelled
NPM Installation / build (18.x, windows-latest) (push) Has been cancelled
4983 lines
143 KiB
JavaScript
4983 lines
143 KiB
JavaScript
import { $n as toRefs, Bn as markRaw, In as isReactive$1, Kn as ref, Mn as effectScope, Nn as getCurrentScope, Ot as nextTick, Qn as toRef, Rn as isRef$1, U as computed, Vn as onScopeDispose, Wn as reactive, Zn as toRaw$1, gn as watch, ht as hasInjectionContext, nr as unref, ut as getCurrentInstance, xt as inject } from "./vue.runtime.esm-bundler-BbnC8aGa.js";
|
||
import { t as createHooks } from "./dist-CY5vkPpf.js";
|
||
//#region node_modules/@vue/devtools-shared/dist/index.js
|
||
var __create$1 = Object.create;
|
||
var __defProp$1 = Object.defineProperty;
|
||
var __getOwnPropDesc$1 = Object.getOwnPropertyDescriptor;
|
||
var __getOwnPropNames$1 = Object.getOwnPropertyNames;
|
||
var __getProtoOf$1 = Object.getPrototypeOf;
|
||
var __hasOwnProp$1 = Object.prototype.hasOwnProperty;
|
||
var __esm$1 = (fn, res) => function __init() {
|
||
return fn && (res = (0, fn[__getOwnPropNames$1(fn)[0]])(fn = 0)), res;
|
||
};
|
||
var __commonJS$1 = (cb, mod) => function __require() {
|
||
return mod || (0, cb[__getOwnPropNames$1(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
||
};
|
||
var __copyProps$1 = (to, from, except, desc) => {
|
||
if (from && typeof from === "object" || typeof from === "function") {
|
||
for (let key of __getOwnPropNames$1(from)) if (!__hasOwnProp$1.call(to, key) && key !== except) __defProp$1(to, key, {
|
||
get: () => from[key],
|
||
enumerable: !(desc = __getOwnPropDesc$1(from, key)) || desc.enumerable
|
||
});
|
||
}
|
||
return to;
|
||
};
|
||
var __toESM$1 = (mod, isNodeMode, target2) => (target2 = mod != null ? __create$1(__getProtoOf$1(mod)) : {}, __copyProps$1(isNodeMode || !mod || !mod.__esModule ? __defProp$1(target2, "default", {
|
||
value: mod,
|
||
enumerable: true
|
||
}) : target2, mod));
|
||
var init_esm_shims$1 = __esm$1({ "../../node_modules/.pnpm/tsup@8.4.0_@microsoft+api-extractor@7.51.1_@types+node@22.13.14__jiti@2.4.2_postcss@8.5_96eb05a9d65343021e53791dd83f3773/node_modules/tsup/assets/esm_shims.js"() {
|
||
"use strict";
|
||
} });
|
||
var require_rfdc = __commonJS$1({ "../../node_modules/.pnpm/rfdc@1.4.1/node_modules/rfdc/index.js"(exports, module) {
|
||
"use strict";
|
||
init_esm_shims$1();
|
||
module.exports = rfdc2;
|
||
function copyBuffer(cur) {
|
||
if (cur instanceof Buffer) return Buffer.from(cur);
|
||
return new cur.constructor(cur.buffer.slice(), cur.byteOffset, cur.length);
|
||
}
|
||
function rfdc2(opts) {
|
||
opts = opts || {};
|
||
if (opts.circles) return rfdcCircles(opts);
|
||
const constructorHandlers = /* @__PURE__ */ new Map();
|
||
constructorHandlers.set(Date, (o) => new Date(o));
|
||
constructorHandlers.set(Map, (o, fn) => new Map(cloneArray(Array.from(o), fn)));
|
||
constructorHandlers.set(Set, (o, fn) => new Set(cloneArray(Array.from(o), fn)));
|
||
if (opts.constructorHandlers) for (const handler2 of opts.constructorHandlers) constructorHandlers.set(handler2[0], handler2[1]);
|
||
let handler = null;
|
||
return opts.proto ? cloneProto : clone;
|
||
function cloneArray(a, fn) {
|
||
const keys = Object.keys(a);
|
||
const a2 = new Array(keys.length);
|
||
for (let i = 0; i < keys.length; i++) {
|
||
const k = keys[i];
|
||
const cur = a[k];
|
||
if (typeof cur !== "object" || cur === null) a2[k] = cur;
|
||
else if (cur.constructor !== Object && (handler = constructorHandlers.get(cur.constructor))) a2[k] = handler(cur, fn);
|
||
else if (ArrayBuffer.isView(cur)) a2[k] = copyBuffer(cur);
|
||
else a2[k] = fn(cur);
|
||
}
|
||
return a2;
|
||
}
|
||
function clone(o) {
|
||
if (typeof o !== "object" || o === null) return o;
|
||
if (Array.isArray(o)) return cloneArray(o, clone);
|
||
if (o.constructor !== Object && (handler = constructorHandlers.get(o.constructor))) return handler(o, clone);
|
||
const o2 = {};
|
||
for (const k in o) {
|
||
if (Object.hasOwnProperty.call(o, k) === false) continue;
|
||
const cur = o[k];
|
||
if (typeof cur !== "object" || cur === null) o2[k] = cur;
|
||
else if (cur.constructor !== Object && (handler = constructorHandlers.get(cur.constructor))) o2[k] = handler(cur, clone);
|
||
else if (ArrayBuffer.isView(cur)) o2[k] = copyBuffer(cur);
|
||
else o2[k] = clone(cur);
|
||
}
|
||
return o2;
|
||
}
|
||
function cloneProto(o) {
|
||
if (typeof o !== "object" || o === null) return o;
|
||
if (Array.isArray(o)) return cloneArray(o, cloneProto);
|
||
if (o.constructor !== Object && (handler = constructorHandlers.get(o.constructor))) return handler(o, cloneProto);
|
||
const o2 = {};
|
||
for (const k in o) {
|
||
const cur = o[k];
|
||
if (typeof cur !== "object" || cur === null) o2[k] = cur;
|
||
else if (cur.constructor !== Object && (handler = constructorHandlers.get(cur.constructor))) o2[k] = handler(cur, cloneProto);
|
||
else if (ArrayBuffer.isView(cur)) o2[k] = copyBuffer(cur);
|
||
else o2[k] = cloneProto(cur);
|
||
}
|
||
return o2;
|
||
}
|
||
}
|
||
function rfdcCircles(opts) {
|
||
const refs = [];
|
||
const refsNew = [];
|
||
const constructorHandlers = /* @__PURE__ */ new Map();
|
||
constructorHandlers.set(Date, (o) => new Date(o));
|
||
constructorHandlers.set(Map, (o, fn) => new Map(cloneArray(Array.from(o), fn)));
|
||
constructorHandlers.set(Set, (o, fn) => new Set(cloneArray(Array.from(o), fn)));
|
||
if (opts.constructorHandlers) for (const handler2 of opts.constructorHandlers) constructorHandlers.set(handler2[0], handler2[1]);
|
||
let handler = null;
|
||
return opts.proto ? cloneProto : clone;
|
||
function cloneArray(a, fn) {
|
||
const keys = Object.keys(a);
|
||
const a2 = new Array(keys.length);
|
||
for (let i = 0; i < keys.length; i++) {
|
||
const k = keys[i];
|
||
const cur = a[k];
|
||
if (typeof cur !== "object" || cur === null) a2[k] = cur;
|
||
else if (cur.constructor !== Object && (handler = constructorHandlers.get(cur.constructor))) a2[k] = handler(cur, fn);
|
||
else if (ArrayBuffer.isView(cur)) a2[k] = copyBuffer(cur);
|
||
else {
|
||
const index = refs.indexOf(cur);
|
||
if (index !== -1) a2[k] = refsNew[index];
|
||
else a2[k] = fn(cur);
|
||
}
|
||
}
|
||
return a2;
|
||
}
|
||
function clone(o) {
|
||
if (typeof o !== "object" || o === null) return o;
|
||
if (Array.isArray(o)) return cloneArray(o, clone);
|
||
if (o.constructor !== Object && (handler = constructorHandlers.get(o.constructor))) return handler(o, clone);
|
||
const o2 = {};
|
||
refs.push(o);
|
||
refsNew.push(o2);
|
||
for (const k in o) {
|
||
if (Object.hasOwnProperty.call(o, k) === false) continue;
|
||
const cur = o[k];
|
||
if (typeof cur !== "object" || cur === null) o2[k] = cur;
|
||
else if (cur.constructor !== Object && (handler = constructorHandlers.get(cur.constructor))) o2[k] = handler(cur, clone);
|
||
else if (ArrayBuffer.isView(cur)) o2[k] = copyBuffer(cur);
|
||
else {
|
||
const i = refs.indexOf(cur);
|
||
if (i !== -1) o2[k] = refsNew[i];
|
||
else o2[k] = clone(cur);
|
||
}
|
||
}
|
||
refs.pop();
|
||
refsNew.pop();
|
||
return o2;
|
||
}
|
||
function cloneProto(o) {
|
||
if (typeof o !== "object" || o === null) return o;
|
||
if (Array.isArray(o)) return cloneArray(o, cloneProto);
|
||
if (o.constructor !== Object && (handler = constructorHandlers.get(o.constructor))) return handler(o, cloneProto);
|
||
const o2 = {};
|
||
refs.push(o);
|
||
refsNew.push(o2);
|
||
for (const k in o) {
|
||
const cur = o[k];
|
||
if (typeof cur !== "object" || cur === null) o2[k] = cur;
|
||
else if (cur.constructor !== Object && (handler = constructorHandlers.get(cur.constructor))) o2[k] = handler(cur, cloneProto);
|
||
else if (ArrayBuffer.isView(cur)) o2[k] = copyBuffer(cur);
|
||
else {
|
||
const i = refs.indexOf(cur);
|
||
if (i !== -1) o2[k] = refsNew[i];
|
||
else o2[k] = cloneProto(cur);
|
||
}
|
||
}
|
||
refs.pop();
|
||
refsNew.pop();
|
||
return o2;
|
||
}
|
||
}
|
||
} });
|
||
init_esm_shims$1();
|
||
init_esm_shims$1();
|
||
init_esm_shims$1();
|
||
var isBrowser = typeof navigator !== "undefined";
|
||
var target = typeof window !== "undefined" ? window : typeof globalThis !== "undefined" ? globalThis : typeof global !== "undefined" ? global : {};
|
||
typeof target.chrome !== "undefined" && target.chrome.devtools;
|
||
isBrowser && (target.self, target.top);
|
||
var _a$1;
|
||
typeof navigator !== "undefined" && ((_a$1 = navigator.userAgent) == null || _a$1.toLowerCase().includes("electron"));
|
||
typeof window !== "undefined" && window.__NUXT__;
|
||
init_esm_shims$1();
|
||
var import_rfdc = __toESM$1(require_rfdc(), 1);
|
||
var classifyRE = /(?:^|[-_/])(\w)/g;
|
||
function toUpper(_, c) {
|
||
return c ? c.toUpperCase() : "";
|
||
}
|
||
function classify(str) {
|
||
return str && `${str}`.replace(classifyRE, toUpper);
|
||
}
|
||
function basename(filename, ext) {
|
||
let normalizedFilename = filename.replace(/^[a-z]:/i, "").replace(/\\/g, "/");
|
||
if (normalizedFilename.endsWith(`index${ext}`)) normalizedFilename = normalizedFilename.replace(`/index${ext}`, ext);
|
||
const lastSlashIndex = normalizedFilename.lastIndexOf("/");
|
||
const baseNameWithExt = normalizedFilename.substring(lastSlashIndex + 1);
|
||
if (ext) {
|
||
const extIndex = baseNameWithExt.lastIndexOf(ext);
|
||
return baseNameWithExt.substring(0, extIndex);
|
||
}
|
||
return "";
|
||
}
|
||
var deepClone = (0, import_rfdc.default)({ circles: true });
|
||
//#endregion
|
||
//#region node_modules/perfect-debounce/dist/index.mjs
|
||
var DEBOUNCE_DEFAULTS = { trailing: true };
|
||
function debounce(fn, wait = 25, options = {}) {
|
||
options = {
|
||
...DEBOUNCE_DEFAULTS,
|
||
...options
|
||
};
|
||
if (!Number.isFinite(wait)) throw new TypeError("Expected `wait` to be a finite number");
|
||
let leadingValue;
|
||
let timeout;
|
||
let resolveList = [];
|
||
let currentPromise;
|
||
let trailingArgs;
|
||
const applyFn = (_this, args) => {
|
||
currentPromise = _applyPromised(fn, _this, args);
|
||
currentPromise.finally(() => {
|
||
currentPromise = null;
|
||
if (options.trailing && trailingArgs && !timeout) {
|
||
const promise = applyFn(_this, trailingArgs);
|
||
trailingArgs = null;
|
||
return promise;
|
||
}
|
||
});
|
||
return currentPromise;
|
||
};
|
||
return function(...args) {
|
||
if (currentPromise) {
|
||
if (options.trailing) trailingArgs = args;
|
||
return currentPromise;
|
||
}
|
||
return new Promise((resolve) => {
|
||
const shouldCallNow = !timeout && options.leading;
|
||
clearTimeout(timeout);
|
||
timeout = setTimeout(() => {
|
||
timeout = null;
|
||
const promise = options.leading ? leadingValue : applyFn(this, args);
|
||
for (const _resolve of resolveList) _resolve(promise);
|
||
resolveList = [];
|
||
}, wait);
|
||
if (shouldCallNow) {
|
||
leadingValue = applyFn(this, args);
|
||
resolve(leadingValue);
|
||
} else resolveList.push(resolve);
|
||
});
|
||
};
|
||
}
|
||
async function _applyPromised(fn, _this, args) {
|
||
return await fn.apply(_this, args);
|
||
}
|
||
//#endregion
|
||
//#region node_modules/@vue/devtools-kit/dist/index.js
|
||
var __create = Object.create;
|
||
var __defProp = Object.defineProperty;
|
||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||
var __getProtoOf = Object.getPrototypeOf;
|
||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||
var __esm = (fn, res) => function __init() {
|
||
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
||
};
|
||
var __commonJS = (cb, mod) => function __require() {
|
||
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
||
};
|
||
var __copyProps = (to, from, except, desc) => {
|
||
if (from && typeof from === "object" || typeof from === "function") {
|
||
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
||
get: () => from[key],
|
||
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
||
});
|
||
}
|
||
return to;
|
||
};
|
||
var __toESM = (mod, isNodeMode, target22) => (target22 = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target22, "default", {
|
||
value: mod,
|
||
enumerable: true
|
||
}) : target22, mod));
|
||
var init_esm_shims = __esm({ "../../node_modules/.pnpm/tsup@8.4.0_@microsoft+api-extractor@7.51.1_@types+node@22.13.14__jiti@2.4.2_postcss@8.5_96eb05a9d65343021e53791dd83f3773/node_modules/tsup/assets/esm_shims.js"() {
|
||
"use strict";
|
||
} });
|
||
var require_speakingurl = __commonJS({ "../../node_modules/.pnpm/speakingurl@14.0.1/node_modules/speakingurl/lib/speakingurl.js"(exports, module) {
|
||
"use strict";
|
||
init_esm_shims();
|
||
(function(root) {
|
||
"use strict";
|
||
var charMap = {
|
||
"À": "A",
|
||
"Á": "A",
|
||
"Â": "A",
|
||
"Ã": "A",
|
||
"Ä": "Ae",
|
||
"Å": "A",
|
||
"Æ": "AE",
|
||
"Ç": "C",
|
||
"È": "E",
|
||
"É": "E",
|
||
"Ê": "E",
|
||
"Ë": "E",
|
||
"Ì": "I",
|
||
"Í": "I",
|
||
"Î": "I",
|
||
"Ï": "I",
|
||
"Ð": "D",
|
||
"Ñ": "N",
|
||
"Ò": "O",
|
||
"Ó": "O",
|
||
"Ô": "O",
|
||
"Õ": "O",
|
||
"Ö": "Oe",
|
||
"Ő": "O",
|
||
"Ø": "O",
|
||
"Ù": "U",
|
||
"Ú": "U",
|
||
"Û": "U",
|
||
"Ü": "Ue",
|
||
"Ű": "U",
|
||
"Ý": "Y",
|
||
"Þ": "TH",
|
||
"ß": "ss",
|
||
"à": "a",
|
||
"á": "a",
|
||
"â": "a",
|
||
"ã": "a",
|
||
"ä": "ae",
|
||
"å": "a",
|
||
"æ": "ae",
|
||
"ç": "c",
|
||
"è": "e",
|
||
"é": "e",
|
||
"ê": "e",
|
||
"ë": "e",
|
||
"ì": "i",
|
||
"í": "i",
|
||
"î": "i",
|
||
"ï": "i",
|
||
"ð": "d",
|
||
"ñ": "n",
|
||
"ò": "o",
|
||
"ó": "o",
|
||
"ô": "o",
|
||
"õ": "o",
|
||
"ö": "oe",
|
||
"ő": "o",
|
||
"ø": "o",
|
||
"ù": "u",
|
||
"ú": "u",
|
||
"û": "u",
|
||
"ü": "ue",
|
||
"ű": "u",
|
||
"ý": "y",
|
||
"þ": "th",
|
||
"ÿ": "y",
|
||
"ẞ": "SS",
|
||
"ا": "a",
|
||
"أ": "a",
|
||
"إ": "i",
|
||
"آ": "aa",
|
||
"ؤ": "u",
|
||
"ئ": "e",
|
||
"ء": "a",
|
||
"ب": "b",
|
||
"ت": "t",
|
||
"ث": "th",
|
||
"ج": "j",
|
||
"ح": "h",
|
||
"خ": "kh",
|
||
"د": "d",
|
||
"ذ": "th",
|
||
"ر": "r",
|
||
"ز": "z",
|
||
"س": "s",
|
||
"ش": "sh",
|
||
"ص": "s",
|
||
"ض": "dh",
|
||
"ط": "t",
|
||
"ظ": "z",
|
||
"ع": "a",
|
||
"غ": "gh",
|
||
"ف": "f",
|
||
"ق": "q",
|
||
"ك": "k",
|
||
"ل": "l",
|
||
"م": "m",
|
||
"ن": "n",
|
||
"ه": "h",
|
||
"و": "w",
|
||
"ي": "y",
|
||
"ى": "a",
|
||
"ة": "h",
|
||
"ﻻ": "la",
|
||
"ﻷ": "laa",
|
||
"ﻹ": "lai",
|
||
"ﻵ": "laa",
|
||
"گ": "g",
|
||
"چ": "ch",
|
||
"پ": "p",
|
||
"ژ": "zh",
|
||
"ک": "k",
|
||
"ی": "y",
|
||
"َ": "a",
|
||
"ً": "an",
|
||
"ِ": "e",
|
||
"ٍ": "en",
|
||
"ُ": "u",
|
||
"ٌ": "on",
|
||
"ْ": "",
|
||
"٠": "0",
|
||
"١": "1",
|
||
"٢": "2",
|
||
"٣": "3",
|
||
"٤": "4",
|
||
"٥": "5",
|
||
"٦": "6",
|
||
"٧": "7",
|
||
"٨": "8",
|
||
"٩": "9",
|
||
"۰": "0",
|
||
"۱": "1",
|
||
"۲": "2",
|
||
"۳": "3",
|
||
"۴": "4",
|
||
"۵": "5",
|
||
"۶": "6",
|
||
"۷": "7",
|
||
"۸": "8",
|
||
"۹": "9",
|
||
"က": "k",
|
||
"ခ": "kh",
|
||
"ဂ": "g",
|
||
"ဃ": "ga",
|
||
"င": "ng",
|
||
"စ": "s",
|
||
"ဆ": "sa",
|
||
"ဇ": "z",
|
||
"စျ": "za",
|
||
"ည": "ny",
|
||
"ဋ": "t",
|
||
"ဌ": "ta",
|
||
"ဍ": "d",
|
||
"ဎ": "da",
|
||
"ဏ": "na",
|
||
"တ": "t",
|
||
"ထ": "ta",
|
||
"ဒ": "d",
|
||
"ဓ": "da",
|
||
"န": "n",
|
||
"ပ": "p",
|
||
"ဖ": "pa",
|
||
"ဗ": "b",
|
||
"ဘ": "ba",
|
||
"မ": "m",
|
||
"ယ": "y",
|
||
"ရ": "ya",
|
||
"လ": "l",
|
||
"ဝ": "w",
|
||
"သ": "th",
|
||
"ဟ": "h",
|
||
"ဠ": "la",
|
||
"အ": "a",
|
||
"ြ": "y",
|
||
"ျ": "ya",
|
||
"ွ": "w",
|
||
"ြွ": "yw",
|
||
"ျွ": "ywa",
|
||
"ှ": "h",
|
||
"ဧ": "e",
|
||
"၏": "-e",
|
||
"ဣ": "i",
|
||
"ဤ": "-i",
|
||
"ဉ": "u",
|
||
"ဦ": "-u",
|
||
"ဩ": "aw",
|
||
"သြော": "aw",
|
||
"ဪ": "aw",
|
||
"၀": "0",
|
||
"၁": "1",
|
||
"၂": "2",
|
||
"၃": "3",
|
||
"၄": "4",
|
||
"၅": "5",
|
||
"၆": "6",
|
||
"၇": "7",
|
||
"၈": "8",
|
||
"၉": "9",
|
||
"္": "",
|
||
"့": "",
|
||
"း": "",
|
||
"č": "c",
|
||
"ď": "d",
|
||
"ě": "e",
|
||
"ň": "n",
|
||
"ř": "r",
|
||
"š": "s",
|
||
"ť": "t",
|
||
"ů": "u",
|
||
"ž": "z",
|
||
"Č": "C",
|
||
"Ď": "D",
|
||
"Ě": "E",
|
||
"Ň": "N",
|
||
"Ř": "R",
|
||
"Š": "S",
|
||
"Ť": "T",
|
||
"Ů": "U",
|
||
"Ž": "Z",
|
||
"ހ": "h",
|
||
"ށ": "sh",
|
||
"ނ": "n",
|
||
"ރ": "r",
|
||
"ބ": "b",
|
||
"ޅ": "lh",
|
||
"ކ": "k",
|
||
"އ": "a",
|
||
"ވ": "v",
|
||
"މ": "m",
|
||
"ފ": "f",
|
||
"ދ": "dh",
|
||
"ތ": "th",
|
||
"ލ": "l",
|
||
"ގ": "g",
|
||
"ޏ": "gn",
|
||
"ސ": "s",
|
||
"ޑ": "d",
|
||
"ޒ": "z",
|
||
"ޓ": "t",
|
||
"ޔ": "y",
|
||
"ޕ": "p",
|
||
"ޖ": "j",
|
||
"ޗ": "ch",
|
||
"ޘ": "tt",
|
||
"ޙ": "hh",
|
||
"ޚ": "kh",
|
||
"ޛ": "th",
|
||
"ޜ": "z",
|
||
"ޝ": "sh",
|
||
"ޞ": "s",
|
||
"ޟ": "d",
|
||
"ޠ": "t",
|
||
"ޡ": "z",
|
||
"ޢ": "a",
|
||
"ޣ": "gh",
|
||
"ޤ": "q",
|
||
"ޥ": "w",
|
||
"ަ": "a",
|
||
"ާ": "aa",
|
||
"ި": "i",
|
||
"ީ": "ee",
|
||
"ު": "u",
|
||
"ޫ": "oo",
|
||
"ެ": "e",
|
||
"ޭ": "ey",
|
||
"ޮ": "o",
|
||
"ޯ": "oa",
|
||
"ް": "",
|
||
"ა": "a",
|
||
"ბ": "b",
|
||
"გ": "g",
|
||
"დ": "d",
|
||
"ე": "e",
|
||
"ვ": "v",
|
||
"ზ": "z",
|
||
"თ": "t",
|
||
"ი": "i",
|
||
"კ": "k",
|
||
"ლ": "l",
|
||
"მ": "m",
|
||
"ნ": "n",
|
||
"ო": "o",
|
||
"პ": "p",
|
||
"ჟ": "zh",
|
||
"რ": "r",
|
||
"ს": "s",
|
||
"ტ": "t",
|
||
"უ": "u",
|
||
"ფ": "p",
|
||
"ქ": "k",
|
||
"ღ": "gh",
|
||
"ყ": "q",
|
||
"შ": "sh",
|
||
"ჩ": "ch",
|
||
"ც": "ts",
|
||
"ძ": "dz",
|
||
"წ": "ts",
|
||
"ჭ": "ch",
|
||
"ხ": "kh",
|
||
"ჯ": "j",
|
||
"ჰ": "h",
|
||
"α": "a",
|
||
"β": "v",
|
||
"γ": "g",
|
||
"δ": "d",
|
||
"ε": "e",
|
||
"ζ": "z",
|
||
"η": "i",
|
||
"θ": "th",
|
||
"ι": "i",
|
||
"κ": "k",
|
||
"λ": "l",
|
||
"μ": "m",
|
||
"ν": "n",
|
||
"ξ": "ks",
|
||
"ο": "o",
|
||
"π": "p",
|
||
"ρ": "r",
|
||
"σ": "s",
|
||
"τ": "t",
|
||
"υ": "y",
|
||
"φ": "f",
|
||
"χ": "x",
|
||
"ψ": "ps",
|
||
"ω": "o",
|
||
"ά": "a",
|
||
"έ": "e",
|
||
"ί": "i",
|
||
"ό": "o",
|
||
"ύ": "y",
|
||
"ή": "i",
|
||
"ώ": "o",
|
||
"ς": "s",
|
||
"ϊ": "i",
|
||
"ΰ": "y",
|
||
"ϋ": "y",
|
||
"ΐ": "i",
|
||
"Α": "A",
|
||
"Β": "B",
|
||
"Γ": "G",
|
||
"Δ": "D",
|
||
"Ε": "E",
|
||
"Ζ": "Z",
|
||
"Η": "I",
|
||
"Θ": "TH",
|
||
"Ι": "I",
|
||
"Κ": "K",
|
||
"Λ": "L",
|
||
"Μ": "M",
|
||
"Ν": "N",
|
||
"Ξ": "KS",
|
||
"Ο": "O",
|
||
"Π": "P",
|
||
"Ρ": "R",
|
||
"Σ": "S",
|
||
"Τ": "T",
|
||
"Υ": "Y",
|
||
"Φ": "F",
|
||
"Χ": "X",
|
||
"Ψ": "PS",
|
||
"Ω": "O",
|
||
"Ά": "A",
|
||
"Έ": "E",
|
||
"Ί": "I",
|
||
"Ό": "O",
|
||
"Ύ": "Y",
|
||
"Ή": "I",
|
||
"Ώ": "O",
|
||
"Ϊ": "I",
|
||
"Ϋ": "Y",
|
||
"ā": "a",
|
||
"ē": "e",
|
||
"ģ": "g",
|
||
"ī": "i",
|
||
"ķ": "k",
|
||
"ļ": "l",
|
||
"ņ": "n",
|
||
"ū": "u",
|
||
"Ā": "A",
|
||
"Ē": "E",
|
||
"Ģ": "G",
|
||
"Ī": "I",
|
||
"Ķ": "k",
|
||
"Ļ": "L",
|
||
"Ņ": "N",
|
||
"Ū": "U",
|
||
"Ќ": "Kj",
|
||
"ќ": "kj",
|
||
"Љ": "Lj",
|
||
"љ": "lj",
|
||
"Њ": "Nj",
|
||
"њ": "nj",
|
||
"Тс": "Ts",
|
||
"тс": "ts",
|
||
"ą": "a",
|
||
"ć": "c",
|
||
"ę": "e",
|
||
"ł": "l",
|
||
"ń": "n",
|
||
"ś": "s",
|
||
"ź": "z",
|
||
"ż": "z",
|
||
"Ą": "A",
|
||
"Ć": "C",
|
||
"Ę": "E",
|
||
"Ł": "L",
|
||
"Ń": "N",
|
||
"Ś": "S",
|
||
"Ź": "Z",
|
||
"Ż": "Z",
|
||
"Є": "Ye",
|
||
"І": "I",
|
||
"Ї": "Yi",
|
||
"Ґ": "G",
|
||
"є": "ye",
|
||
"і": "i",
|
||
"ї": "yi",
|
||
"ґ": "g",
|
||
"ă": "a",
|
||
"Ă": "A",
|
||
"ș": "s",
|
||
"Ș": "S",
|
||
"ț": "t",
|
||
"Ț": "T",
|
||
"ţ": "t",
|
||
"Ţ": "T",
|
||
"а": "a",
|
||
"б": "b",
|
||
"в": "v",
|
||
"г": "g",
|
||
"д": "d",
|
||
"е": "e",
|
||
"ё": "yo",
|
||
"ж": "zh",
|
||
"з": "z",
|
||
"и": "i",
|
||
"й": "i",
|
||
"к": "k",
|
||
"л": "l",
|
||
"м": "m",
|
||
"н": "n",
|
||
"о": "o",
|
||
"п": "p",
|
||
"р": "r",
|
||
"с": "s",
|
||
"т": "t",
|
||
"у": "u",
|
||
"ф": "f",
|
||
"х": "kh",
|
||
"ц": "c",
|
||
"ч": "ch",
|
||
"ш": "sh",
|
||
"щ": "sh",
|
||
"ъ": "",
|
||
"ы": "y",
|
||
"ь": "",
|
||
"э": "e",
|
||
"ю": "yu",
|
||
"я": "ya",
|
||
"А": "A",
|
||
"Б": "B",
|
||
"В": "V",
|
||
"Г": "G",
|
||
"Д": "D",
|
||
"Е": "E",
|
||
"Ё": "Yo",
|
||
"Ж": "Zh",
|
||
"З": "Z",
|
||
"И": "I",
|
||
"Й": "I",
|
||
"К": "K",
|
||
"Л": "L",
|
||
"М": "M",
|
||
"Н": "N",
|
||
"О": "O",
|
||
"П": "P",
|
||
"Р": "R",
|
||
"С": "S",
|
||
"Т": "T",
|
||
"У": "U",
|
||
"Ф": "F",
|
||
"Х": "Kh",
|
||
"Ц": "C",
|
||
"Ч": "Ch",
|
||
"Ш": "Sh",
|
||
"Щ": "Sh",
|
||
"Ъ": "",
|
||
"Ы": "Y",
|
||
"Ь": "",
|
||
"Э": "E",
|
||
"Ю": "Yu",
|
||
"Я": "Ya",
|
||
"ђ": "dj",
|
||
"ј": "j",
|
||
"ћ": "c",
|
||
"џ": "dz",
|
||
"Ђ": "Dj",
|
||
"Ј": "j",
|
||
"Ћ": "C",
|
||
"Џ": "Dz",
|
||
"ľ": "l",
|
||
"ĺ": "l",
|
||
"ŕ": "r",
|
||
"Ľ": "L",
|
||
"Ĺ": "L",
|
||
"Ŕ": "R",
|
||
"ş": "s",
|
||
"Ş": "S",
|
||
"ı": "i",
|
||
"İ": "I",
|
||
"ğ": "g",
|
||
"Ğ": "G",
|
||
"ả": "a",
|
||
"Ả": "A",
|
||
"ẳ": "a",
|
||
"Ẳ": "A",
|
||
"ẩ": "a",
|
||
"Ẩ": "A",
|
||
"đ": "d",
|
||
"Đ": "D",
|
||
"ẹ": "e",
|
||
"Ẹ": "E",
|
||
"ẽ": "e",
|
||
"Ẽ": "E",
|
||
"ẻ": "e",
|
||
"Ẻ": "E",
|
||
"ế": "e",
|
||
"Ế": "E",
|
||
"ề": "e",
|
||
"Ề": "E",
|
||
"ệ": "e",
|
||
"Ệ": "E",
|
||
"ễ": "e",
|
||
"Ễ": "E",
|
||
"ể": "e",
|
||
"Ể": "E",
|
||
"ỏ": "o",
|
||
"ọ": "o",
|
||
"Ọ": "o",
|
||
"ố": "o",
|
||
"Ố": "O",
|
||
"ồ": "o",
|
||
"Ồ": "O",
|
||
"ổ": "o",
|
||
"Ổ": "O",
|
||
"ộ": "o",
|
||
"Ộ": "O",
|
||
"ỗ": "o",
|
||
"Ỗ": "O",
|
||
"ơ": "o",
|
||
"Ơ": "O",
|
||
"ớ": "o",
|
||
"Ớ": "O",
|
||
"ờ": "o",
|
||
"Ờ": "O",
|
||
"ợ": "o",
|
||
"Ợ": "O",
|
||
"ỡ": "o",
|
||
"Ỡ": "O",
|
||
"Ở": "o",
|
||
"ở": "o",
|
||
"ị": "i",
|
||
"Ị": "I",
|
||
"ĩ": "i",
|
||
"Ĩ": "I",
|
||
"ỉ": "i",
|
||
"Ỉ": "i",
|
||
"ủ": "u",
|
||
"Ủ": "U",
|
||
"ụ": "u",
|
||
"Ụ": "U",
|
||
"ũ": "u",
|
||
"Ũ": "U",
|
||
"ư": "u",
|
||
"Ư": "U",
|
||
"ứ": "u",
|
||
"Ứ": "U",
|
||
"ừ": "u",
|
||
"Ừ": "U",
|
||
"ự": "u",
|
||
"Ự": "U",
|
||
"ữ": "u",
|
||
"Ữ": "U",
|
||
"ử": "u",
|
||
"Ử": "ư",
|
||
"ỷ": "y",
|
||
"Ỷ": "y",
|
||
"ỳ": "y",
|
||
"Ỳ": "Y",
|
||
"ỵ": "y",
|
||
"Ỵ": "Y",
|
||
"ỹ": "y",
|
||
"Ỹ": "Y",
|
||
"ạ": "a",
|
||
"Ạ": "A",
|
||
"ấ": "a",
|
||
"Ấ": "A",
|
||
"ầ": "a",
|
||
"Ầ": "A",
|
||
"ậ": "a",
|
||
"Ậ": "A",
|
||
"ẫ": "a",
|
||
"Ẫ": "A",
|
||
"ắ": "a",
|
||
"Ắ": "A",
|
||
"ằ": "a",
|
||
"Ằ": "A",
|
||
"ặ": "a",
|
||
"Ặ": "A",
|
||
"ẵ": "a",
|
||
"Ẵ": "A",
|
||
"⓪": "0",
|
||
"①": "1",
|
||
"②": "2",
|
||
"③": "3",
|
||
"④": "4",
|
||
"⑤": "5",
|
||
"⑥": "6",
|
||
"⑦": "7",
|
||
"⑧": "8",
|
||
"⑨": "9",
|
||
"⑩": "10",
|
||
"⑪": "11",
|
||
"⑫": "12",
|
||
"⑬": "13",
|
||
"⑭": "14",
|
||
"⑮": "15",
|
||
"⑯": "16",
|
||
"⑰": "17",
|
||
"⑱": "18",
|
||
"⑲": "18",
|
||
"⑳": "18",
|
||
"⓵": "1",
|
||
"⓶": "2",
|
||
"⓷": "3",
|
||
"⓸": "4",
|
||
"⓹": "5",
|
||
"⓺": "6",
|
||
"⓻": "7",
|
||
"⓼": "8",
|
||
"⓽": "9",
|
||
"⓾": "10",
|
||
"⓿": "0",
|
||
"⓫": "11",
|
||
"⓬": "12",
|
||
"⓭": "13",
|
||
"⓮": "14",
|
||
"⓯": "15",
|
||
"⓰": "16",
|
||
"⓱": "17",
|
||
"⓲": "18",
|
||
"⓳": "19",
|
||
"⓴": "20",
|
||
"Ⓐ": "A",
|
||
"Ⓑ": "B",
|
||
"Ⓒ": "C",
|
||
"Ⓓ": "D",
|
||
"Ⓔ": "E",
|
||
"Ⓕ": "F",
|
||
"Ⓖ": "G",
|
||
"Ⓗ": "H",
|
||
"Ⓘ": "I",
|
||
"Ⓙ": "J",
|
||
"Ⓚ": "K",
|
||
"Ⓛ": "L",
|
||
"Ⓜ": "M",
|
||
"Ⓝ": "N",
|
||
"Ⓞ": "O",
|
||
"Ⓟ": "P",
|
||
"Ⓠ": "Q",
|
||
"Ⓡ": "R",
|
||
"Ⓢ": "S",
|
||
"Ⓣ": "T",
|
||
"Ⓤ": "U",
|
||
"Ⓥ": "V",
|
||
"Ⓦ": "W",
|
||
"Ⓧ": "X",
|
||
"Ⓨ": "Y",
|
||
"Ⓩ": "Z",
|
||
"ⓐ": "a",
|
||
"ⓑ": "b",
|
||
"ⓒ": "c",
|
||
"ⓓ": "d",
|
||
"ⓔ": "e",
|
||
"ⓕ": "f",
|
||
"ⓖ": "g",
|
||
"ⓗ": "h",
|
||
"ⓘ": "i",
|
||
"ⓙ": "j",
|
||
"ⓚ": "k",
|
||
"ⓛ": "l",
|
||
"ⓜ": "m",
|
||
"ⓝ": "n",
|
||
"ⓞ": "o",
|
||
"ⓟ": "p",
|
||
"ⓠ": "q",
|
||
"ⓡ": "r",
|
||
"ⓢ": "s",
|
||
"ⓣ": "t",
|
||
"ⓤ": "u",
|
||
"ⓦ": "v",
|
||
"ⓥ": "w",
|
||
"ⓧ": "x",
|
||
"ⓨ": "y",
|
||
"ⓩ": "z",
|
||
"“": "\"",
|
||
"”": "\"",
|
||
"‘": "'",
|
||
"’": "'",
|
||
"∂": "d",
|
||
"ƒ": "f",
|
||
"™": "(TM)",
|
||
"©": "(C)",
|
||
"œ": "oe",
|
||
"Œ": "OE",
|
||
"®": "(R)",
|
||
"†": "+",
|
||
"℠": "(SM)",
|
||
"…": "...",
|
||
"˚": "o",
|
||
"º": "o",
|
||
"ª": "a",
|
||
"•": "*",
|
||
"၊": ",",
|
||
"။": ".",
|
||
"$": "USD",
|
||
"€": "EUR",
|
||
"₢": "BRN",
|
||
"₣": "FRF",
|
||
"£": "GBP",
|
||
"₤": "ITL",
|
||
"₦": "NGN",
|
||
"₧": "ESP",
|
||
"₩": "KRW",
|
||
"₪": "ILS",
|
||
"₫": "VND",
|
||
"₭": "LAK",
|
||
"₮": "MNT",
|
||
"₯": "GRD",
|
||
"₱": "ARS",
|
||
"₲": "PYG",
|
||
"₳": "ARA",
|
||
"₴": "UAH",
|
||
"₵": "GHS",
|
||
"¢": "cent",
|
||
"¥": "CNY",
|
||
"元": "CNY",
|
||
"円": "YEN",
|
||
"﷼": "IRR",
|
||
"₠": "EWE",
|
||
"฿": "THB",
|
||
"₨": "INR",
|
||
"₹": "INR",
|
||
"₰": "PF",
|
||
"₺": "TRY",
|
||
"؋": "AFN",
|
||
"₼": "AZN",
|
||
"лв": "BGN",
|
||
"៛": "KHR",
|
||
"₡": "CRC",
|
||
"₸": "KZT",
|
||
"ден": "MKD",
|
||
"zł": "PLN",
|
||
"₽": "RUB",
|
||
"₾": "GEL"
|
||
};
|
||
var lookAheadCharArray = ["်", "ް"];
|
||
var diatricMap = {
|
||
"ာ": "a",
|
||
"ါ": "a",
|
||
"ေ": "e",
|
||
"ဲ": "e",
|
||
"ိ": "i",
|
||
"ီ": "i",
|
||
"ို": "o",
|
||
"ု": "u",
|
||
"ူ": "u",
|
||
"ေါင်": "aung",
|
||
"ော": "aw",
|
||
"ော်": "aw",
|
||
"ေါ": "aw",
|
||
"ေါ်": "aw",
|
||
"်": "်",
|
||
"က်": "et",
|
||
"ိုက်": "aik",
|
||
"ောက်": "auk",
|
||
"င်": "in",
|
||
"ိုင်": "aing",
|
||
"ောင်": "aung",
|
||
"စ်": "it",
|
||
"ည်": "i",
|
||
"တ်": "at",
|
||
"ိတ်": "eik",
|
||
"ုတ်": "ok",
|
||
"ွတ်": "ut",
|
||
"ေတ်": "it",
|
||
"ဒ်": "d",
|
||
"ိုဒ်": "ok",
|
||
"ုဒ်": "ait",
|
||
"န်": "an",
|
||
"ာန်": "an",
|
||
"ိန်": "ein",
|
||
"ုန်": "on",
|
||
"ွန်": "un",
|
||
"ပ်": "at",
|
||
"ိပ်": "eik",
|
||
"ုပ်": "ok",
|
||
"ွပ်": "ut",
|
||
"န်ုပ်": "nub",
|
||
"မ်": "an",
|
||
"ိမ်": "ein",
|
||
"ုမ်": "on",
|
||
"ွမ်": "un",
|
||
"ယ်": "e",
|
||
"ိုလ်": "ol",
|
||
"ဉ်": "in",
|
||
"ံ": "an",
|
||
"ိံ": "ein",
|
||
"ုံ": "on",
|
||
"ައް": "ah",
|
||
"ަށް": "ah"
|
||
};
|
||
var langCharMap = {
|
||
"en": {},
|
||
"az": {
|
||
"ç": "c",
|
||
"ə": "e",
|
||
"ğ": "g",
|
||
"ı": "i",
|
||
"ö": "o",
|
||
"ş": "s",
|
||
"ü": "u",
|
||
"Ç": "C",
|
||
"Ə": "E",
|
||
"Ğ": "G",
|
||
"İ": "I",
|
||
"Ö": "O",
|
||
"Ş": "S",
|
||
"Ü": "U"
|
||
},
|
||
"cs": {
|
||
"č": "c",
|
||
"ď": "d",
|
||
"ě": "e",
|
||
"ň": "n",
|
||
"ř": "r",
|
||
"š": "s",
|
||
"ť": "t",
|
||
"ů": "u",
|
||
"ž": "z",
|
||
"Č": "C",
|
||
"Ď": "D",
|
||
"Ě": "E",
|
||
"Ň": "N",
|
||
"Ř": "R",
|
||
"Š": "S",
|
||
"Ť": "T",
|
||
"Ů": "U",
|
||
"Ž": "Z"
|
||
},
|
||
"fi": {
|
||
"ä": "a",
|
||
"Ä": "A",
|
||
"ö": "o",
|
||
"Ö": "O"
|
||
},
|
||
"hu": {
|
||
"ä": "a",
|
||
"Ä": "A",
|
||
"ö": "o",
|
||
"Ö": "O",
|
||
"ü": "u",
|
||
"Ü": "U",
|
||
"ű": "u",
|
||
"Ű": "U"
|
||
},
|
||
"lt": {
|
||
"ą": "a",
|
||
"č": "c",
|
||
"ę": "e",
|
||
"ė": "e",
|
||
"į": "i",
|
||
"š": "s",
|
||
"ų": "u",
|
||
"ū": "u",
|
||
"ž": "z",
|
||
"Ą": "A",
|
||
"Č": "C",
|
||
"Ę": "E",
|
||
"Ė": "E",
|
||
"Į": "I",
|
||
"Š": "S",
|
||
"Ų": "U",
|
||
"Ū": "U"
|
||
},
|
||
"lv": {
|
||
"ā": "a",
|
||
"č": "c",
|
||
"ē": "e",
|
||
"ģ": "g",
|
||
"ī": "i",
|
||
"ķ": "k",
|
||
"ļ": "l",
|
||
"ņ": "n",
|
||
"š": "s",
|
||
"ū": "u",
|
||
"ž": "z",
|
||
"Ā": "A",
|
||
"Č": "C",
|
||
"Ē": "E",
|
||
"Ģ": "G",
|
||
"Ī": "i",
|
||
"Ķ": "k",
|
||
"Ļ": "L",
|
||
"Ņ": "N",
|
||
"Š": "S",
|
||
"Ū": "u",
|
||
"Ž": "Z"
|
||
},
|
||
"pl": {
|
||
"ą": "a",
|
||
"ć": "c",
|
||
"ę": "e",
|
||
"ł": "l",
|
||
"ń": "n",
|
||
"ó": "o",
|
||
"ś": "s",
|
||
"ź": "z",
|
||
"ż": "z",
|
||
"Ą": "A",
|
||
"Ć": "C",
|
||
"Ę": "e",
|
||
"Ł": "L",
|
||
"Ń": "N",
|
||
"Ó": "O",
|
||
"Ś": "S",
|
||
"Ź": "Z",
|
||
"Ż": "Z"
|
||
},
|
||
"sv": {
|
||
"ä": "a",
|
||
"Ä": "A",
|
||
"ö": "o",
|
||
"Ö": "O"
|
||
},
|
||
"sk": {
|
||
"ä": "a",
|
||
"Ä": "A"
|
||
},
|
||
"sr": {
|
||
"љ": "lj",
|
||
"њ": "nj",
|
||
"Љ": "Lj",
|
||
"Њ": "Nj",
|
||
"đ": "dj",
|
||
"Đ": "Dj"
|
||
},
|
||
"tr": {
|
||
"Ü": "U",
|
||
"Ö": "O",
|
||
"ü": "u",
|
||
"ö": "o"
|
||
}
|
||
};
|
||
var symbolMap = {
|
||
"ar": {
|
||
"∆": "delta",
|
||
"∞": "la-nihaya",
|
||
"♥": "hob",
|
||
"&": "wa",
|
||
"|": "aw",
|
||
"<": "aqal-men",
|
||
">": "akbar-men",
|
||
"∑": "majmou",
|
||
"¤": "omla"
|
||
},
|
||
"az": {},
|
||
"ca": {
|
||
"∆": "delta",
|
||
"∞": "infinit",
|
||
"♥": "amor",
|
||
"&": "i",
|
||
"|": "o",
|
||
"<": "menys que",
|
||
">": "mes que",
|
||
"∑": "suma dels",
|
||
"¤": "moneda"
|
||
},
|
||
"cs": {
|
||
"∆": "delta",
|
||
"∞": "nekonecno",
|
||
"♥": "laska",
|
||
"&": "a",
|
||
"|": "nebo",
|
||
"<": "mensi nez",
|
||
">": "vetsi nez",
|
||
"∑": "soucet",
|
||
"¤": "mena"
|
||
},
|
||
"de": {
|
||
"∆": "delta",
|
||
"∞": "unendlich",
|
||
"♥": "Liebe",
|
||
"&": "und",
|
||
"|": "oder",
|
||
"<": "kleiner als",
|
||
">": "groesser als",
|
||
"∑": "Summe von",
|
||
"¤": "Waehrung"
|
||
},
|
||
"dv": {
|
||
"∆": "delta",
|
||
"∞": "kolunulaa",
|
||
"♥": "loabi",
|
||
"&": "aai",
|
||
"|": "noonee",
|
||
"<": "ah vure kuda",
|
||
">": "ah vure bodu",
|
||
"∑": "jumula",
|
||
"¤": "faisaa"
|
||
},
|
||
"en": {
|
||
"∆": "delta",
|
||
"∞": "infinity",
|
||
"♥": "love",
|
||
"&": "and",
|
||
"|": "or",
|
||
"<": "less than",
|
||
">": "greater than",
|
||
"∑": "sum",
|
||
"¤": "currency"
|
||
},
|
||
"es": {
|
||
"∆": "delta",
|
||
"∞": "infinito",
|
||
"♥": "amor",
|
||
"&": "y",
|
||
"|": "u",
|
||
"<": "menos que",
|
||
">": "mas que",
|
||
"∑": "suma de los",
|
||
"¤": "moneda"
|
||
},
|
||
"fa": {
|
||
"∆": "delta",
|
||
"∞": "bi-nahayat",
|
||
"♥": "eshgh",
|
||
"&": "va",
|
||
"|": "ya",
|
||
"<": "kamtar-az",
|
||
">": "bishtar-az",
|
||
"∑": "majmooe",
|
||
"¤": "vahed"
|
||
},
|
||
"fi": {
|
||
"∆": "delta",
|
||
"∞": "aarettomyys",
|
||
"♥": "rakkaus",
|
||
"&": "ja",
|
||
"|": "tai",
|
||
"<": "pienempi kuin",
|
||
">": "suurempi kuin",
|
||
"∑": "summa",
|
||
"¤": "valuutta"
|
||
},
|
||
"fr": {
|
||
"∆": "delta",
|
||
"∞": "infiniment",
|
||
"♥": "Amour",
|
||
"&": "et",
|
||
"|": "ou",
|
||
"<": "moins que",
|
||
">": "superieure a",
|
||
"∑": "somme des",
|
||
"¤": "monnaie"
|
||
},
|
||
"ge": {
|
||
"∆": "delta",
|
||
"∞": "usasruloba",
|
||
"♥": "siqvaruli",
|
||
"&": "da",
|
||
"|": "an",
|
||
"<": "naklebi",
|
||
">": "meti",
|
||
"∑": "jami",
|
||
"¤": "valuta"
|
||
},
|
||
"gr": {},
|
||
"hu": {
|
||
"∆": "delta",
|
||
"∞": "vegtelen",
|
||
"♥": "szerelem",
|
||
"&": "es",
|
||
"|": "vagy",
|
||
"<": "kisebb mint",
|
||
">": "nagyobb mint",
|
||
"∑": "szumma",
|
||
"¤": "penznem"
|
||
},
|
||
"it": {
|
||
"∆": "delta",
|
||
"∞": "infinito",
|
||
"♥": "amore",
|
||
"&": "e",
|
||
"|": "o",
|
||
"<": "minore di",
|
||
">": "maggiore di",
|
||
"∑": "somma",
|
||
"¤": "moneta"
|
||
},
|
||
"lt": {
|
||
"∆": "delta",
|
||
"∞": "begalybe",
|
||
"♥": "meile",
|
||
"&": "ir",
|
||
"|": "ar",
|
||
"<": "maziau nei",
|
||
">": "daugiau nei",
|
||
"∑": "suma",
|
||
"¤": "valiuta"
|
||
},
|
||
"lv": {
|
||
"∆": "delta",
|
||
"∞": "bezgaliba",
|
||
"♥": "milestiba",
|
||
"&": "un",
|
||
"|": "vai",
|
||
"<": "mazak neka",
|
||
">": "lielaks neka",
|
||
"∑": "summa",
|
||
"¤": "valuta"
|
||
},
|
||
"my": {
|
||
"∆": "kwahkhyaet",
|
||
"∞": "asaonasme",
|
||
"♥": "akhyait",
|
||
"&": "nhin",
|
||
"|": "tho",
|
||
"<": "ngethaw",
|
||
">": "kyithaw",
|
||
"∑": "paungld",
|
||
"¤": "ngwekye"
|
||
},
|
||
"mk": {},
|
||
"nl": {
|
||
"∆": "delta",
|
||
"∞": "oneindig",
|
||
"♥": "liefde",
|
||
"&": "en",
|
||
"|": "of",
|
||
"<": "kleiner dan",
|
||
">": "groter dan",
|
||
"∑": "som",
|
||
"¤": "valuta"
|
||
},
|
||
"pl": {
|
||
"∆": "delta",
|
||
"∞": "nieskonczonosc",
|
||
"♥": "milosc",
|
||
"&": "i",
|
||
"|": "lub",
|
||
"<": "mniejsze niz",
|
||
">": "wieksze niz",
|
||
"∑": "suma",
|
||
"¤": "waluta"
|
||
},
|
||
"pt": {
|
||
"∆": "delta",
|
||
"∞": "infinito",
|
||
"♥": "amor",
|
||
"&": "e",
|
||
"|": "ou",
|
||
"<": "menor que",
|
||
">": "maior que",
|
||
"∑": "soma",
|
||
"¤": "moeda"
|
||
},
|
||
"ro": {
|
||
"∆": "delta",
|
||
"∞": "infinit",
|
||
"♥": "dragoste",
|
||
"&": "si",
|
||
"|": "sau",
|
||
"<": "mai mic ca",
|
||
">": "mai mare ca",
|
||
"∑": "suma",
|
||
"¤": "valuta"
|
||
},
|
||
"ru": {
|
||
"∆": "delta",
|
||
"∞": "beskonechno",
|
||
"♥": "lubov",
|
||
"&": "i",
|
||
"|": "ili",
|
||
"<": "menshe",
|
||
">": "bolshe",
|
||
"∑": "summa",
|
||
"¤": "valjuta"
|
||
},
|
||
"sk": {
|
||
"∆": "delta",
|
||
"∞": "nekonecno",
|
||
"♥": "laska",
|
||
"&": "a",
|
||
"|": "alebo",
|
||
"<": "menej ako",
|
||
">": "viac ako",
|
||
"∑": "sucet",
|
||
"¤": "mena"
|
||
},
|
||
"sr": {},
|
||
"tr": {
|
||
"∆": "delta",
|
||
"∞": "sonsuzluk",
|
||
"♥": "ask",
|
||
"&": "ve",
|
||
"|": "veya",
|
||
"<": "kucuktur",
|
||
">": "buyuktur",
|
||
"∑": "toplam",
|
||
"¤": "para birimi"
|
||
},
|
||
"uk": {
|
||
"∆": "delta",
|
||
"∞": "bezkinechnist",
|
||
"♥": "lubov",
|
||
"&": "i",
|
||
"|": "abo",
|
||
"<": "menshe",
|
||
">": "bilshe",
|
||
"∑": "suma",
|
||
"¤": "valjuta"
|
||
},
|
||
"vn": {
|
||
"∆": "delta",
|
||
"∞": "vo cuc",
|
||
"♥": "yeu",
|
||
"&": "va",
|
||
"|": "hoac",
|
||
"<": "nho hon",
|
||
">": "lon hon",
|
||
"∑": "tong",
|
||
"¤": "tien te"
|
||
}
|
||
};
|
||
var uricChars = [
|
||
";",
|
||
"?",
|
||
":",
|
||
"@",
|
||
"&",
|
||
"=",
|
||
"+",
|
||
"$",
|
||
",",
|
||
"/"
|
||
].join("");
|
||
var uricNoSlashChars = [
|
||
";",
|
||
"?",
|
||
":",
|
||
"@",
|
||
"&",
|
||
"=",
|
||
"+",
|
||
"$",
|
||
","
|
||
].join("");
|
||
var markChars = [
|
||
".",
|
||
"!",
|
||
"~",
|
||
"*",
|
||
"'",
|
||
"(",
|
||
")"
|
||
].join("");
|
||
var getSlug = function getSlug2(input, opts) {
|
||
var separator = "-";
|
||
var result = "";
|
||
var diatricString = "";
|
||
var convertSymbols = true;
|
||
var customReplacements = {};
|
||
var maintainCase;
|
||
var titleCase;
|
||
var truncate;
|
||
var uricFlag;
|
||
var uricNoSlashFlag;
|
||
var markFlag;
|
||
var symbol;
|
||
var langChar;
|
||
var lucky;
|
||
var i;
|
||
var ch;
|
||
var l;
|
||
var lastCharWasSymbol;
|
||
var lastCharWasDiatric;
|
||
var allowedChars = "";
|
||
if (typeof input !== "string") return "";
|
||
if (typeof opts === "string") separator = opts;
|
||
symbol = symbolMap.en;
|
||
langChar = langCharMap.en;
|
||
if (typeof opts === "object") {
|
||
maintainCase = opts.maintainCase || false;
|
||
customReplacements = opts.custom && typeof opts.custom === "object" ? opts.custom : customReplacements;
|
||
truncate = +opts.truncate > 1 && opts.truncate || false;
|
||
uricFlag = opts.uric || false;
|
||
uricNoSlashFlag = opts.uricNoSlash || false;
|
||
markFlag = opts.mark || false;
|
||
convertSymbols = opts.symbols === false || opts.lang === false ? false : true;
|
||
separator = opts.separator || separator;
|
||
if (uricFlag) allowedChars += uricChars;
|
||
if (uricNoSlashFlag) allowedChars += uricNoSlashChars;
|
||
if (markFlag) allowedChars += markChars;
|
||
symbol = opts.lang && symbolMap[opts.lang] && convertSymbols ? symbolMap[opts.lang] : convertSymbols ? symbolMap.en : {};
|
||
langChar = opts.lang && langCharMap[opts.lang] ? langCharMap[opts.lang] : opts.lang === false || opts.lang === true ? {} : langCharMap.en;
|
||
if (opts.titleCase && typeof opts.titleCase.length === "number" && Array.prototype.toString.call(opts.titleCase)) {
|
||
opts.titleCase.forEach(function(v) {
|
||
customReplacements[v + ""] = v + "";
|
||
});
|
||
titleCase = true;
|
||
} else titleCase = !!opts.titleCase;
|
||
if (opts.custom && typeof opts.custom.length === "number" && Array.prototype.toString.call(opts.custom)) opts.custom.forEach(function(v) {
|
||
customReplacements[v + ""] = v + "";
|
||
});
|
||
Object.keys(customReplacements).forEach(function(v) {
|
||
var r;
|
||
if (v.length > 1) r = new RegExp("\\b" + escapeChars(v) + "\\b", "gi");
|
||
else r = new RegExp(escapeChars(v), "gi");
|
||
input = input.replace(r, customReplacements[v]);
|
||
});
|
||
for (ch in customReplacements) allowedChars += ch;
|
||
}
|
||
allowedChars += separator;
|
||
allowedChars = escapeChars(allowedChars);
|
||
input = input.replace(/(^\s+|\s+$)/g, "");
|
||
lastCharWasSymbol = false;
|
||
lastCharWasDiatric = false;
|
||
for (i = 0, l = input.length; i < l; i++) {
|
||
ch = input[i];
|
||
if (isReplacedCustomChar(ch, customReplacements)) lastCharWasSymbol = false;
|
||
else if (langChar[ch]) {
|
||
ch = lastCharWasSymbol && langChar[ch].match(/[A-Za-z0-9]/) ? " " + langChar[ch] : langChar[ch];
|
||
lastCharWasSymbol = false;
|
||
} else if (ch in charMap) {
|
||
if (i + 1 < l && lookAheadCharArray.indexOf(input[i + 1]) >= 0) {
|
||
diatricString += ch;
|
||
ch = "";
|
||
} else if (lastCharWasDiatric === true) {
|
||
ch = diatricMap[diatricString] + charMap[ch];
|
||
diatricString = "";
|
||
} else ch = lastCharWasSymbol && charMap[ch].match(/[A-Za-z0-9]/) ? " " + charMap[ch] : charMap[ch];
|
||
lastCharWasSymbol = false;
|
||
lastCharWasDiatric = false;
|
||
} else if (ch in diatricMap) {
|
||
diatricString += ch;
|
||
ch = "";
|
||
if (i === l - 1) ch = diatricMap[diatricString];
|
||
lastCharWasDiatric = true;
|
||
} else if (symbol[ch] && !(uricFlag && uricChars.indexOf(ch) !== -1) && !(uricNoSlashFlag && uricNoSlashChars.indexOf(ch) !== -1)) {
|
||
ch = lastCharWasSymbol || result.substr(-1).match(/[A-Za-z0-9]/) ? separator + symbol[ch] : symbol[ch];
|
||
ch += input[i + 1] !== void 0 && input[i + 1].match(/[A-Za-z0-9]/) ? separator : "";
|
||
lastCharWasSymbol = true;
|
||
} else {
|
||
if (lastCharWasDiatric === true) {
|
||
ch = diatricMap[diatricString] + ch;
|
||
diatricString = "";
|
||
lastCharWasDiatric = false;
|
||
} else if (lastCharWasSymbol && (/[A-Za-z0-9]/.test(ch) || result.substr(-1).match(/A-Za-z0-9]/))) ch = " " + ch;
|
||
lastCharWasSymbol = false;
|
||
}
|
||
result += ch.replace(new RegExp("[^\\w\\s" + allowedChars + "_-]", "g"), separator);
|
||
}
|
||
if (titleCase) result = result.replace(/(\w)(\S*)/g, function(_, i2, r) {
|
||
var j = i2.toUpperCase() + (r !== null ? r : "");
|
||
return Object.keys(customReplacements).indexOf(j.toLowerCase()) < 0 ? j : j.toLowerCase();
|
||
});
|
||
result = result.replace(/\s+/g, separator).replace(new RegExp("\\" + separator + "+", "g"), separator).replace(new RegExp("(^\\" + separator + "+|\\" + separator + "+$)", "g"), "");
|
||
if (truncate && result.length > truncate) {
|
||
lucky = result.charAt(truncate) === separator;
|
||
result = result.slice(0, truncate);
|
||
if (!lucky) result = result.slice(0, result.lastIndexOf(separator));
|
||
}
|
||
if (!maintainCase && !titleCase) result = result.toLowerCase();
|
||
return result;
|
||
};
|
||
var createSlug = function createSlug2(opts) {
|
||
return function getSlugWithConfig(input) {
|
||
return getSlug(input, opts);
|
||
};
|
||
};
|
||
var escapeChars = function escapeChars2(input) {
|
||
return input.replace(/[-\\^$*+?.()|[\]{}\/]/g, "\\$&");
|
||
};
|
||
var isReplacedCustomChar = function(ch, customReplacements) {
|
||
for (var c in customReplacements) if (customReplacements[c] === ch) return true;
|
||
};
|
||
if (typeof module !== "undefined" && module.exports) {
|
||
module.exports = getSlug;
|
||
module.exports.createSlug = createSlug;
|
||
} else if (typeof define !== "undefined" && define.amd) define([], function() {
|
||
return getSlug;
|
||
});
|
||
else try {
|
||
if (root.getSlug || root.createSlug) throw "speakingurl: globals exists /(getSlug|createSlug)/";
|
||
else {
|
||
root.getSlug = getSlug;
|
||
root.createSlug = createSlug;
|
||
}
|
||
} catch (e) {}
|
||
})(exports);
|
||
} });
|
||
var require_speakingurl2 = __commonJS({ "../../node_modules/.pnpm/speakingurl@14.0.1/node_modules/speakingurl/index.js"(exports, module) {
|
||
"use strict";
|
||
init_esm_shims();
|
||
module.exports = require_speakingurl();
|
||
} });
|
||
init_esm_shims();
|
||
init_esm_shims();
|
||
init_esm_shims();
|
||
init_esm_shims();
|
||
init_esm_shims();
|
||
init_esm_shims();
|
||
init_esm_shims();
|
||
init_esm_shims();
|
||
function getComponentTypeName(options) {
|
||
var _a25;
|
||
const name = options.name || options._componentTag || options.__VUE_DEVTOOLS_COMPONENT_GUSSED_NAME__ || options.__name;
|
||
if (name === "index" && ((_a25 = options.__file) == null ? void 0 : _a25.endsWith("index.vue"))) return "";
|
||
return name;
|
||
}
|
||
function getComponentFileName(options) {
|
||
const file = options.__file;
|
||
if (file) return classify(basename(file, ".vue"));
|
||
}
|
||
function saveComponentGussedName(instance, name) {
|
||
instance.type.__VUE_DEVTOOLS_COMPONENT_GUSSED_NAME__ = name;
|
||
return name;
|
||
}
|
||
function getAppRecord(instance) {
|
||
if (instance.__VUE_DEVTOOLS_NEXT_APP_RECORD__) return instance.__VUE_DEVTOOLS_NEXT_APP_RECORD__;
|
||
else if (instance.root) return instance.appContext.app.__VUE_DEVTOOLS_NEXT_APP_RECORD__;
|
||
}
|
||
function isFragment(instance) {
|
||
var _a25, _b25;
|
||
const subTreeType = (_a25 = instance.subTree) == null ? void 0 : _a25.type;
|
||
const appRecord = getAppRecord(instance);
|
||
if (appRecord) return ((_b25 = appRecord == null ? void 0 : appRecord.types) == null ? void 0 : _b25.Fragment) === subTreeType;
|
||
return false;
|
||
}
|
||
function getInstanceName(instance) {
|
||
var _a25, _b25, _c;
|
||
const name = getComponentTypeName((instance == null ? void 0 : instance.type) || {});
|
||
if (name) return name;
|
||
if ((instance == null ? void 0 : instance.root) === instance) return "Root";
|
||
for (const key in (_b25 = (_a25 = instance.parent) == null ? void 0 : _a25.type) == null ? void 0 : _b25.components) if (instance.parent.type.components[key] === (instance == null ? void 0 : instance.type)) return saveComponentGussedName(instance, key);
|
||
for (const key in (_c = instance.appContext) == null ? void 0 : _c.components) if (instance.appContext.components[key] === (instance == null ? void 0 : instance.type)) return saveComponentGussedName(instance, key);
|
||
const fileName = getComponentFileName((instance == null ? void 0 : instance.type) || {});
|
||
if (fileName) return fileName;
|
||
return "Anonymous Component";
|
||
}
|
||
function getUniqueComponentId(instance) {
|
||
var _a25, _b25, _c;
|
||
return `${(_c = (_b25 = (_a25 = instance == null ? void 0 : instance.appContext) == null ? void 0 : _a25.app) == null ? void 0 : _b25.__VUE_DEVTOOLS_NEXT_APP_RECORD_ID__) != null ? _c : 0}:${instance === (instance == null ? void 0 : instance.root) ? "root" : instance.uid}`;
|
||
}
|
||
function getComponentInstance(appRecord, instanceId) {
|
||
instanceId = instanceId || `${appRecord.id}:root`;
|
||
return appRecord.instanceMap.get(instanceId) || appRecord.instanceMap.get(":root");
|
||
}
|
||
function createRect() {
|
||
const rect = {
|
||
top: 0,
|
||
bottom: 0,
|
||
left: 0,
|
||
right: 0,
|
||
get width() {
|
||
return rect.right - rect.left;
|
||
},
|
||
get height() {
|
||
return rect.bottom - rect.top;
|
||
}
|
||
};
|
||
return rect;
|
||
}
|
||
var range;
|
||
function getTextRect(node) {
|
||
if (!range) range = document.createRange();
|
||
range.selectNode(node);
|
||
return range.getBoundingClientRect();
|
||
}
|
||
function getFragmentRect(vnode) {
|
||
const rect = createRect();
|
||
if (!vnode.children) return rect;
|
||
for (let i = 0, l = vnode.children.length; i < l; i++) {
|
||
const childVnode = vnode.children[i];
|
||
let childRect;
|
||
if (childVnode.component) childRect = getComponentBoundingRect(childVnode.component);
|
||
else if (childVnode.el) {
|
||
const el = childVnode.el;
|
||
if (el.nodeType === 1 || el.getBoundingClientRect) childRect = el.getBoundingClientRect();
|
||
else if (el.nodeType === 3 && el.data.trim()) childRect = getTextRect(el);
|
||
}
|
||
if (childRect) mergeRects(rect, childRect);
|
||
}
|
||
return rect;
|
||
}
|
||
function mergeRects(a, b) {
|
||
if (!a.top || b.top < a.top) a.top = b.top;
|
||
if (!a.bottom || b.bottom > a.bottom) a.bottom = b.bottom;
|
||
if (!a.left || b.left < a.left) a.left = b.left;
|
||
if (!a.right || b.right > a.right) a.right = b.right;
|
||
return a;
|
||
}
|
||
var DEFAULT_RECT = {
|
||
top: 0,
|
||
left: 0,
|
||
right: 0,
|
||
bottom: 0,
|
||
width: 0,
|
||
height: 0
|
||
};
|
||
function getComponentBoundingRect(instance) {
|
||
const el = instance.subTree.el;
|
||
if (typeof window === "undefined") return DEFAULT_RECT;
|
||
if (isFragment(instance)) return getFragmentRect(instance.subTree);
|
||
else if ((el == null ? void 0 : el.nodeType) === 1) return el == null ? void 0 : el.getBoundingClientRect();
|
||
else if (instance.subTree.component) return getComponentBoundingRect(instance.subTree.component);
|
||
else return DEFAULT_RECT;
|
||
}
|
||
init_esm_shims();
|
||
function getRootElementsFromComponentInstance(instance) {
|
||
if (isFragment(instance)) return getFragmentRootElements(instance.subTree);
|
||
if (!instance.subTree) return [];
|
||
return [instance.subTree.el];
|
||
}
|
||
function getFragmentRootElements(vnode) {
|
||
if (!vnode.children) return [];
|
||
const list = [];
|
||
vnode.children.forEach((childVnode) => {
|
||
if (childVnode.component) list.push(...getRootElementsFromComponentInstance(childVnode.component));
|
||
else if (childVnode == null ? void 0 : childVnode.el) list.push(childVnode.el);
|
||
});
|
||
return list;
|
||
}
|
||
var CONTAINER_ELEMENT_ID = "__vue-devtools-component-inspector__";
|
||
var CARD_ELEMENT_ID = "__vue-devtools-component-inspector__card__";
|
||
var COMPONENT_NAME_ELEMENT_ID = "__vue-devtools-component-inspector__name__";
|
||
var INDICATOR_ELEMENT_ID = "__vue-devtools-component-inspector__indicator__";
|
||
var containerStyles = {
|
||
display: "block",
|
||
zIndex: 2147483640,
|
||
position: "fixed",
|
||
backgroundColor: "#42b88325",
|
||
border: "1px solid #42b88350",
|
||
borderRadius: "5px",
|
||
transition: "all 0.1s ease-in",
|
||
pointerEvents: "none"
|
||
};
|
||
var cardStyles = {
|
||
fontFamily: "Arial, Helvetica, sans-serif",
|
||
padding: "5px 8px",
|
||
borderRadius: "4px",
|
||
textAlign: "left",
|
||
position: "absolute",
|
||
left: 0,
|
||
color: "#e9e9e9",
|
||
fontSize: "14px",
|
||
fontWeight: 600,
|
||
lineHeight: "24px",
|
||
backgroundColor: "#42b883",
|
||
boxShadow: "0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1)"
|
||
};
|
||
var indicatorStyles = {
|
||
display: "inline-block",
|
||
fontWeight: 400,
|
||
fontStyle: "normal",
|
||
fontSize: "12px",
|
||
opacity: .7
|
||
};
|
||
function getContainerElement() {
|
||
return document.getElementById(CONTAINER_ELEMENT_ID);
|
||
}
|
||
function getCardElement() {
|
||
return document.getElementById(CARD_ELEMENT_ID);
|
||
}
|
||
function getIndicatorElement() {
|
||
return document.getElementById(INDICATOR_ELEMENT_ID);
|
||
}
|
||
function getNameElement() {
|
||
return document.getElementById(COMPONENT_NAME_ELEMENT_ID);
|
||
}
|
||
function getStyles(bounds) {
|
||
return {
|
||
left: `${Math.round(bounds.left * 100) / 100}px`,
|
||
top: `${Math.round(bounds.top * 100) / 100}px`,
|
||
width: `${Math.round(bounds.width * 100) / 100}px`,
|
||
height: `${Math.round(bounds.height * 100) / 100}px`
|
||
};
|
||
}
|
||
function create(options) {
|
||
var _a25;
|
||
const containerEl = document.createElement("div");
|
||
containerEl.id = (_a25 = options.elementId) != null ? _a25 : CONTAINER_ELEMENT_ID;
|
||
Object.assign(containerEl.style, {
|
||
...containerStyles,
|
||
...getStyles(options.bounds),
|
||
...options.style
|
||
});
|
||
const cardEl = document.createElement("span");
|
||
cardEl.id = CARD_ELEMENT_ID;
|
||
Object.assign(cardEl.style, {
|
||
...cardStyles,
|
||
top: options.bounds.top < 35 ? 0 : "-35px"
|
||
});
|
||
const nameEl = document.createElement("span");
|
||
nameEl.id = COMPONENT_NAME_ELEMENT_ID;
|
||
nameEl.innerHTML = `<${options.name}> `;
|
||
const indicatorEl = document.createElement("i");
|
||
indicatorEl.id = INDICATOR_ELEMENT_ID;
|
||
indicatorEl.innerHTML = `${Math.round(options.bounds.width * 100) / 100} x ${Math.round(options.bounds.height * 100) / 100}`;
|
||
Object.assign(indicatorEl.style, indicatorStyles);
|
||
cardEl.appendChild(nameEl);
|
||
cardEl.appendChild(indicatorEl);
|
||
containerEl.appendChild(cardEl);
|
||
document.body.appendChild(containerEl);
|
||
return containerEl;
|
||
}
|
||
function update(options) {
|
||
const containerEl = getContainerElement();
|
||
const cardEl = getCardElement();
|
||
const nameEl = getNameElement();
|
||
const indicatorEl = getIndicatorElement();
|
||
if (containerEl) {
|
||
Object.assign(containerEl.style, {
|
||
...containerStyles,
|
||
...getStyles(options.bounds)
|
||
});
|
||
Object.assign(cardEl.style, { top: options.bounds.top < 35 ? 0 : "-35px" });
|
||
nameEl.innerHTML = `<${options.name}> `;
|
||
indicatorEl.innerHTML = `${Math.round(options.bounds.width * 100) / 100} x ${Math.round(options.bounds.height * 100) / 100}`;
|
||
}
|
||
}
|
||
function highlight(instance) {
|
||
const bounds = getComponentBoundingRect(instance);
|
||
if (!bounds.width && !bounds.height) return;
|
||
const name = getInstanceName(instance);
|
||
getContainerElement() ? update({
|
||
bounds,
|
||
name
|
||
}) : create({
|
||
bounds,
|
||
name
|
||
});
|
||
}
|
||
function unhighlight() {
|
||
const el = getContainerElement();
|
||
if (el) el.style.display = "none";
|
||
}
|
||
var inspectInstance = null;
|
||
function inspectFn(e) {
|
||
const target22 = e.target;
|
||
if (target22) {
|
||
const instance = target22.__vueParentComponent;
|
||
if (instance) {
|
||
inspectInstance = instance;
|
||
if (instance.vnode.el) {
|
||
const bounds = getComponentBoundingRect(instance);
|
||
const name = getInstanceName(instance);
|
||
getContainerElement() ? update({
|
||
bounds,
|
||
name
|
||
}) : create({
|
||
bounds,
|
||
name
|
||
});
|
||
}
|
||
}
|
||
}
|
||
}
|
||
function selectComponentFn(e, cb) {
|
||
e.preventDefault();
|
||
e.stopPropagation();
|
||
if (inspectInstance) cb(getUniqueComponentId(inspectInstance));
|
||
}
|
||
var inspectComponentHighLighterSelectFn = null;
|
||
function cancelInspectComponentHighLighter() {
|
||
unhighlight();
|
||
window.removeEventListener("mouseover", inspectFn);
|
||
window.removeEventListener("click", inspectComponentHighLighterSelectFn, true);
|
||
inspectComponentHighLighterSelectFn = null;
|
||
}
|
||
function inspectComponentHighLighter() {
|
||
window.addEventListener("mouseover", inspectFn);
|
||
return new Promise((resolve) => {
|
||
function onSelect(e) {
|
||
e.preventDefault();
|
||
e.stopPropagation();
|
||
selectComponentFn(e, (id) => {
|
||
window.removeEventListener("click", onSelect, true);
|
||
inspectComponentHighLighterSelectFn = null;
|
||
window.removeEventListener("mouseover", inspectFn);
|
||
const el = getContainerElement();
|
||
if (el) el.style.display = "none";
|
||
resolve(JSON.stringify({ id }));
|
||
});
|
||
}
|
||
inspectComponentHighLighterSelectFn = onSelect;
|
||
window.addEventListener("click", onSelect, true);
|
||
});
|
||
}
|
||
function scrollToComponent(options) {
|
||
const instance = getComponentInstance(activeAppRecord.value, options.id);
|
||
if (instance) {
|
||
const [el] = getRootElementsFromComponentInstance(instance);
|
||
if (typeof el.scrollIntoView === "function") el.scrollIntoView({ behavior: "smooth" });
|
||
else {
|
||
const bounds = getComponentBoundingRect(instance);
|
||
const scrollTarget = document.createElement("div");
|
||
const styles = {
|
||
...getStyles(bounds),
|
||
position: "absolute"
|
||
};
|
||
Object.assign(scrollTarget.style, styles);
|
||
document.body.appendChild(scrollTarget);
|
||
scrollTarget.scrollIntoView({ behavior: "smooth" });
|
||
setTimeout(() => {
|
||
document.body.removeChild(scrollTarget);
|
||
}, 2e3);
|
||
}
|
||
setTimeout(() => {
|
||
const bounds = getComponentBoundingRect(instance);
|
||
if (bounds.width || bounds.height) {
|
||
const name = getInstanceName(instance);
|
||
const el2 = getContainerElement();
|
||
el2 ? update({
|
||
...options,
|
||
name,
|
||
bounds
|
||
}) : create({
|
||
...options,
|
||
name,
|
||
bounds
|
||
});
|
||
setTimeout(() => {
|
||
if (el2) el2.style.display = "none";
|
||
}, 1500);
|
||
}
|
||
}, 1200);
|
||
}
|
||
}
|
||
init_esm_shims();
|
||
var _a;
|
||
(_a = target).__VUE_DEVTOOLS_COMPONENT_INSPECTOR_ENABLED__ ?? (_a.__VUE_DEVTOOLS_COMPONENT_INSPECTOR_ENABLED__ = true);
|
||
function waitForInspectorInit(cb) {
|
||
let total = 0;
|
||
const timer = setInterval(() => {
|
||
if (target.__VUE_INSPECTOR__) {
|
||
clearInterval(timer);
|
||
total += 30;
|
||
cb();
|
||
}
|
||
if (total >= 5e3) clearInterval(timer);
|
||
}, 30);
|
||
}
|
||
function setupInspector() {
|
||
const inspector = target.__VUE_INSPECTOR__;
|
||
const _openInEditor = inspector.openInEditor;
|
||
inspector.openInEditor = async (...params) => {
|
||
inspector.disable();
|
||
_openInEditor(...params);
|
||
};
|
||
}
|
||
function getComponentInspector() {
|
||
return new Promise((resolve) => {
|
||
function setup() {
|
||
setupInspector();
|
||
resolve(target.__VUE_INSPECTOR__);
|
||
}
|
||
if (!target.__VUE_INSPECTOR__) waitForInspectorInit(() => {
|
||
setup();
|
||
});
|
||
else setup();
|
||
});
|
||
}
|
||
init_esm_shims();
|
||
init_esm_shims();
|
||
function isReadonly(value) {
|
||
return !!(value && value["__v_isReadonly"]);
|
||
}
|
||
function isReactive(value) {
|
||
if (isReadonly(value)) return isReactive(value["__v_raw"]);
|
||
return !!(value && value["__v_isReactive"]);
|
||
}
|
||
function isRef(r) {
|
||
return !!(r && r.__v_isRef === true);
|
||
}
|
||
function toRaw(observed) {
|
||
const raw = observed && observed["__v_raw"];
|
||
return raw ? toRaw(raw) : observed;
|
||
}
|
||
var StateEditor = class {
|
||
constructor() {
|
||
this.refEditor = new RefStateEditor();
|
||
}
|
||
set(object, path, value, cb) {
|
||
const sections = Array.isArray(path) ? path : path.split(".");
|
||
while (sections.length > 1) {
|
||
const section = sections.shift();
|
||
if (object instanceof Map) object = object.get(section);
|
||
else if (object instanceof Set) object = Array.from(object.values())[section];
|
||
else object = object[section];
|
||
if (this.refEditor.isRef(object)) object = this.refEditor.get(object);
|
||
}
|
||
const field = sections[0];
|
||
const item = this.refEditor.get(object)[field];
|
||
if (cb) cb(object, field, value);
|
||
else if (this.refEditor.isRef(item)) this.refEditor.set(item, value);
|
||
else object[field] = value;
|
||
}
|
||
get(object, path) {
|
||
const sections = Array.isArray(path) ? path : path.split(".");
|
||
for (let i = 0; i < sections.length; i++) {
|
||
if (object instanceof Map) object = object.get(sections[i]);
|
||
else object = object[sections[i]];
|
||
if (this.refEditor.isRef(object)) object = this.refEditor.get(object);
|
||
if (!object) return void 0;
|
||
}
|
||
return object;
|
||
}
|
||
has(object, path, parent = false) {
|
||
if (typeof object === "undefined") return false;
|
||
const sections = Array.isArray(path) ? path.slice() : path.split(".");
|
||
const size = !parent ? 1 : 2;
|
||
while (object && sections.length > size) {
|
||
const section = sections.shift();
|
||
object = object[section];
|
||
if (this.refEditor.isRef(object)) object = this.refEditor.get(object);
|
||
}
|
||
return object != null && Object.prototype.hasOwnProperty.call(object, sections[0]);
|
||
}
|
||
createDefaultSetCallback(state) {
|
||
return (object, field, value) => {
|
||
if (state.remove || state.newKey) if (Array.isArray(object)) object.splice(field, 1);
|
||
else if (toRaw(object) instanceof Map) object.delete(field);
|
||
else if (toRaw(object) instanceof Set) object.delete(Array.from(object.values())[field]);
|
||
else Reflect.deleteProperty(object, field);
|
||
if (!state.remove) {
|
||
const target22 = object[state.newKey || field];
|
||
if (this.refEditor.isRef(target22)) this.refEditor.set(target22, value);
|
||
else if (toRaw(object) instanceof Map) object.set(state.newKey || field, value);
|
||
else if (toRaw(object) instanceof Set) object.add(value);
|
||
else object[state.newKey || field] = value;
|
||
}
|
||
};
|
||
}
|
||
};
|
||
var RefStateEditor = class {
|
||
set(ref, value) {
|
||
if (isRef(ref)) ref.value = value;
|
||
else {
|
||
if (ref instanceof Set && Array.isArray(value)) {
|
||
ref.clear();
|
||
value.forEach((v) => ref.add(v));
|
||
return;
|
||
}
|
||
const currentKeys = Object.keys(value);
|
||
if (ref instanceof Map) {
|
||
const previousKeysSet2 = new Set(ref.keys());
|
||
currentKeys.forEach((key) => {
|
||
ref.set(key, Reflect.get(value, key));
|
||
previousKeysSet2.delete(key);
|
||
});
|
||
previousKeysSet2.forEach((key) => ref.delete(key));
|
||
return;
|
||
}
|
||
const previousKeysSet = new Set(Object.keys(ref));
|
||
currentKeys.forEach((key) => {
|
||
Reflect.set(ref, key, Reflect.get(value, key));
|
||
previousKeysSet.delete(key);
|
||
});
|
||
previousKeysSet.forEach((key) => Reflect.deleteProperty(ref, key));
|
||
}
|
||
}
|
||
get(ref) {
|
||
return isRef(ref) ? ref.value : ref;
|
||
}
|
||
isRef(ref) {
|
||
return isRef(ref) || isReactive(ref);
|
||
}
|
||
};
|
||
new StateEditor();
|
||
init_esm_shims();
|
||
init_esm_shims();
|
||
init_esm_shims();
|
||
var TIMELINE_LAYERS_STATE_STORAGE_ID = "__VUE_DEVTOOLS_KIT_TIMELINE_LAYERS_STATE__";
|
||
function getTimelineLayersStateFromStorage() {
|
||
if (typeof window === "undefined" || !isBrowser || typeof localStorage === "undefined" || localStorage === null) return {
|
||
recordingState: false,
|
||
mouseEventEnabled: false,
|
||
keyboardEventEnabled: false,
|
||
componentEventEnabled: false,
|
||
performanceEventEnabled: false,
|
||
selected: ""
|
||
};
|
||
const state = typeof localStorage.getItem !== "undefined" ? localStorage.getItem(TIMELINE_LAYERS_STATE_STORAGE_ID) : null;
|
||
return state ? JSON.parse(state) : {
|
||
recordingState: false,
|
||
mouseEventEnabled: false,
|
||
keyboardEventEnabled: false,
|
||
componentEventEnabled: false,
|
||
performanceEventEnabled: false,
|
||
selected: ""
|
||
};
|
||
}
|
||
init_esm_shims();
|
||
init_esm_shims();
|
||
init_esm_shims();
|
||
var _a2;
|
||
(_a2 = target).__VUE_DEVTOOLS_KIT_TIMELINE_LAYERS ?? (_a2.__VUE_DEVTOOLS_KIT_TIMELINE_LAYERS = []);
|
||
var devtoolsTimelineLayers = new Proxy(target.__VUE_DEVTOOLS_KIT_TIMELINE_LAYERS, { get(target22, prop, receiver) {
|
||
return Reflect.get(target22, prop, receiver);
|
||
} });
|
||
function addTimelineLayer(options, descriptor) {
|
||
devtoolsState.timelineLayersState[descriptor.id] = false;
|
||
devtoolsTimelineLayers.push({
|
||
...options,
|
||
descriptorId: descriptor.id,
|
||
appRecord: getAppRecord(descriptor.app)
|
||
});
|
||
}
|
||
var _a3;
|
||
(_a3 = target).__VUE_DEVTOOLS_KIT_INSPECTOR__ ?? (_a3.__VUE_DEVTOOLS_KIT_INSPECTOR__ = []);
|
||
var devtoolsInspector = new Proxy(target.__VUE_DEVTOOLS_KIT_INSPECTOR__, { get(target22, prop, receiver) {
|
||
return Reflect.get(target22, prop, receiver);
|
||
} });
|
||
var callInspectorUpdatedHook = debounce(() => {
|
||
devtoolsContext.hooks.callHook("sendInspectorToClient", getActiveInspectors());
|
||
});
|
||
function addInspector(inspector, descriptor) {
|
||
var _a25, _b25;
|
||
devtoolsInspector.push({
|
||
options: inspector,
|
||
descriptor,
|
||
treeFilterPlaceholder: (_a25 = inspector.treeFilterPlaceholder) != null ? _a25 : "Search tree...",
|
||
stateFilterPlaceholder: (_b25 = inspector.stateFilterPlaceholder) != null ? _b25 : "Search state...",
|
||
treeFilter: "",
|
||
selectedNodeId: "",
|
||
appRecord: getAppRecord(descriptor.app)
|
||
});
|
||
callInspectorUpdatedHook();
|
||
}
|
||
function getActiveInspectors() {
|
||
return devtoolsInspector.filter((inspector) => inspector.descriptor.app === activeAppRecord.value.app).filter((inspector) => inspector.descriptor.id !== "components").map((inspector) => {
|
||
var _a25;
|
||
const descriptor = inspector.descriptor;
|
||
const options = inspector.options;
|
||
return {
|
||
id: options.id,
|
||
label: options.label,
|
||
logo: descriptor.logo,
|
||
icon: `custom-ic-baseline-${(_a25 = options == null ? void 0 : options.icon) == null ? void 0 : _a25.replace(/_/g, "-")}`,
|
||
packageName: descriptor.packageName,
|
||
homepage: descriptor.homepage,
|
||
pluginId: descriptor.id
|
||
};
|
||
});
|
||
}
|
||
function getInspector(id, app) {
|
||
return devtoolsInspector.find((inspector) => inspector.options.id === id && (app ? inspector.descriptor.app === app : true));
|
||
}
|
||
function createDevToolsCtxHooks() {
|
||
const hooks2 = createHooks();
|
||
hooks2.hook("addInspector", ({ inspector, plugin }) => {
|
||
addInspector(inspector, plugin.descriptor);
|
||
});
|
||
const debounceSendInspectorTree = debounce(async ({ inspectorId, plugin }) => {
|
||
var _a25;
|
||
if (!inspectorId || !((_a25 = plugin == null ? void 0 : plugin.descriptor) == null ? void 0 : _a25.app) || devtoolsState.highPerfModeEnabled) return;
|
||
const inspector = getInspector(inspectorId, plugin.descriptor.app);
|
||
const _payload = {
|
||
app: plugin.descriptor.app,
|
||
inspectorId,
|
||
filter: (inspector == null ? void 0 : inspector.treeFilter) || "",
|
||
rootNodes: []
|
||
};
|
||
await new Promise((resolve) => {
|
||
hooks2.callHookWith(async (callbacks) => {
|
||
await Promise.all(callbacks.map((cb) => cb(_payload)));
|
||
resolve();
|
||
}, "getInspectorTree");
|
||
});
|
||
hooks2.callHookWith(async (callbacks) => {
|
||
await Promise.all(callbacks.map((cb) => cb({
|
||
inspectorId,
|
||
rootNodes: _payload.rootNodes
|
||
})));
|
||
}, "sendInspectorTreeToClient");
|
||
}, 120);
|
||
hooks2.hook("sendInspectorTree", debounceSendInspectorTree);
|
||
const debounceSendInspectorState = debounce(async ({ inspectorId, plugin }) => {
|
||
var _a25;
|
||
if (!inspectorId || !((_a25 = plugin == null ? void 0 : plugin.descriptor) == null ? void 0 : _a25.app) || devtoolsState.highPerfModeEnabled) return;
|
||
const inspector = getInspector(inspectorId, plugin.descriptor.app);
|
||
const _payload = {
|
||
app: plugin.descriptor.app,
|
||
inspectorId,
|
||
nodeId: (inspector == null ? void 0 : inspector.selectedNodeId) || "",
|
||
state: null
|
||
};
|
||
const ctx = { currentTab: `custom-inspector:${inspectorId}` };
|
||
if (_payload.nodeId) await new Promise((resolve) => {
|
||
hooks2.callHookWith(async (callbacks) => {
|
||
await Promise.all(callbacks.map((cb) => cb(_payload, ctx)));
|
||
resolve();
|
||
}, "getInspectorState");
|
||
});
|
||
hooks2.callHookWith(async (callbacks) => {
|
||
await Promise.all(callbacks.map((cb) => cb({
|
||
inspectorId,
|
||
nodeId: _payload.nodeId,
|
||
state: _payload.state
|
||
})));
|
||
}, "sendInspectorStateToClient");
|
||
}, 120);
|
||
hooks2.hook("sendInspectorState", debounceSendInspectorState);
|
||
hooks2.hook("customInspectorSelectNode", ({ inspectorId, nodeId, plugin }) => {
|
||
const inspector = getInspector(inspectorId, plugin.descriptor.app);
|
||
if (!inspector) return;
|
||
inspector.selectedNodeId = nodeId;
|
||
});
|
||
hooks2.hook("timelineLayerAdded", ({ options, plugin }) => {
|
||
addTimelineLayer(options, plugin.descriptor);
|
||
});
|
||
hooks2.hook("timelineEventAdded", ({ options, plugin }) => {
|
||
var _a25;
|
||
if (devtoolsState.highPerfModeEnabled || !((_a25 = devtoolsState.timelineLayersState) == null ? void 0 : _a25[plugin.descriptor.id]) && ![
|
||
"performance",
|
||
"component-event",
|
||
"keyboard",
|
||
"mouse"
|
||
].includes(options.layerId)) return;
|
||
hooks2.callHookWith(async (callbacks) => {
|
||
await Promise.all(callbacks.map((cb) => cb(options)));
|
||
}, "sendTimelineEventToClient");
|
||
});
|
||
hooks2.hook("getComponentInstances", async ({ app }) => {
|
||
const appRecord = app.__VUE_DEVTOOLS_NEXT_APP_RECORD__;
|
||
if (!appRecord) return null;
|
||
const appId = appRecord.id.toString();
|
||
return [...appRecord.instanceMap].filter(([key]) => key.split(":")[0] === appId).map(([, instance]) => instance);
|
||
});
|
||
hooks2.hook("getComponentBounds", async ({ instance }) => {
|
||
return getComponentBoundingRect(instance);
|
||
});
|
||
hooks2.hook("getComponentName", ({ instance }) => {
|
||
return getInstanceName(instance);
|
||
});
|
||
hooks2.hook("componentHighlight", ({ uid }) => {
|
||
const instance = activeAppRecord.value.instanceMap.get(uid);
|
||
if (instance) highlight(instance);
|
||
});
|
||
hooks2.hook("componentUnhighlight", () => {
|
||
unhighlight();
|
||
});
|
||
return hooks2;
|
||
}
|
||
var _a4;
|
||
(_a4 = target).__VUE_DEVTOOLS_KIT_APP_RECORDS__ ?? (_a4.__VUE_DEVTOOLS_KIT_APP_RECORDS__ = []);
|
||
var _a5;
|
||
(_a5 = target).__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__ ?? (_a5.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__ = {});
|
||
var _a6;
|
||
(_a6 = target).__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD_ID__ ?? (_a6.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD_ID__ = "");
|
||
var _a7;
|
||
(_a7 = target).__VUE_DEVTOOLS_KIT_CUSTOM_TABS__ ?? (_a7.__VUE_DEVTOOLS_KIT_CUSTOM_TABS__ = []);
|
||
var _a8;
|
||
(_a8 = target).__VUE_DEVTOOLS_KIT_CUSTOM_COMMANDS__ ?? (_a8.__VUE_DEVTOOLS_KIT_CUSTOM_COMMANDS__ = []);
|
||
var STATE_KEY = "__VUE_DEVTOOLS_KIT_GLOBAL_STATE__";
|
||
function initStateFactory() {
|
||
return {
|
||
connected: false,
|
||
clientConnected: false,
|
||
vitePluginDetected: true,
|
||
appRecords: [],
|
||
activeAppRecordId: "",
|
||
tabs: [],
|
||
commands: [],
|
||
highPerfModeEnabled: true,
|
||
devtoolsClientDetected: {},
|
||
perfUniqueGroupId: 0,
|
||
timelineLayersState: getTimelineLayersStateFromStorage()
|
||
};
|
||
}
|
||
var _a9;
|
||
(_a9 = target)[STATE_KEY] ?? (_a9[STATE_KEY] = initStateFactory());
|
||
var callStateUpdatedHook = debounce((state) => {
|
||
devtoolsContext.hooks.callHook("devtoolsStateUpdated", { state });
|
||
});
|
||
debounce((state, oldState) => {
|
||
devtoolsContext.hooks.callHook("devtoolsConnectedUpdated", {
|
||
state,
|
||
oldState
|
||
});
|
||
});
|
||
var devtoolsAppRecords = new Proxy(target.__VUE_DEVTOOLS_KIT_APP_RECORDS__, { get(_target, prop, receiver) {
|
||
if (prop === "value") return target.__VUE_DEVTOOLS_KIT_APP_RECORDS__;
|
||
return target.__VUE_DEVTOOLS_KIT_APP_RECORDS__[prop];
|
||
} });
|
||
var activeAppRecord = new Proxy(target.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__, { get(_target, prop, receiver) {
|
||
if (prop === "value") return target.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__;
|
||
else if (prop === "id") return target.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD_ID__;
|
||
return target.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__[prop];
|
||
} });
|
||
function updateAllStates() {
|
||
callStateUpdatedHook({
|
||
...target[STATE_KEY],
|
||
appRecords: devtoolsAppRecords.value,
|
||
activeAppRecordId: activeAppRecord.id,
|
||
tabs: target.__VUE_DEVTOOLS_KIT_CUSTOM_TABS__,
|
||
commands: target.__VUE_DEVTOOLS_KIT_CUSTOM_COMMANDS__
|
||
});
|
||
}
|
||
function setActiveAppRecord(app) {
|
||
target.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__ = app;
|
||
updateAllStates();
|
||
}
|
||
function setActiveAppRecordId(id) {
|
||
target.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD_ID__ = id;
|
||
updateAllStates();
|
||
}
|
||
var devtoolsState = new Proxy(target[STATE_KEY], {
|
||
get(target22, property) {
|
||
if (property === "appRecords") return devtoolsAppRecords;
|
||
else if (property === "activeAppRecordId") return activeAppRecord.id;
|
||
else if (property === "tabs") return target.__VUE_DEVTOOLS_KIT_CUSTOM_TABS__;
|
||
else if (property === "commands") return target.__VUE_DEVTOOLS_KIT_CUSTOM_COMMANDS__;
|
||
return target[STATE_KEY][property];
|
||
},
|
||
deleteProperty(target22, property) {
|
||
delete target22[property];
|
||
return true;
|
||
},
|
||
set(target22, property, value) {
|
||
({ ...target[STATE_KEY] });
|
||
target22[property] = value;
|
||
target[STATE_KEY][property] = value;
|
||
return true;
|
||
}
|
||
});
|
||
function openInEditor(options = {}) {
|
||
var _a25, _b25, _c;
|
||
const { file, host, baseUrl = window.location.origin, line = 0, column = 0 } = options;
|
||
if (file) {
|
||
if (host === "chrome-extension") {
|
||
const fileName = file.replace(/\\/g, "\\\\");
|
||
const _baseUrl = (_b25 = (_a25 = window.VUE_DEVTOOLS_CONFIG) == null ? void 0 : _a25.openInEditorHost) != null ? _b25 : "/";
|
||
fetch(`${_baseUrl}__open-in-editor?file=${encodeURI(file)}`).then((response) => {
|
||
if (!response.ok) {
|
||
const msg = `Opening component ${fileName} failed`;
|
||
console.log(`%c${msg}`, "color:red");
|
||
}
|
||
});
|
||
} else if (devtoolsState.vitePluginDetected) {
|
||
const _baseUrl = (_c = target.__VUE_DEVTOOLS_OPEN_IN_EDITOR_BASE_URL__) != null ? _c : baseUrl;
|
||
target.__VUE_INSPECTOR__.openInEditor(_baseUrl, file, line, column);
|
||
}
|
||
}
|
||
}
|
||
init_esm_shims();
|
||
init_esm_shims();
|
||
init_esm_shims();
|
||
init_esm_shims();
|
||
init_esm_shims();
|
||
var _a10;
|
||
(_a10 = target).__VUE_DEVTOOLS_KIT_PLUGIN_BUFFER__ ?? (_a10.__VUE_DEVTOOLS_KIT_PLUGIN_BUFFER__ = []);
|
||
var devtoolsPluginBuffer = new Proxy(target.__VUE_DEVTOOLS_KIT_PLUGIN_BUFFER__, { get(target22, prop, receiver) {
|
||
return Reflect.get(target22, prop, receiver);
|
||
} });
|
||
function _getSettings(settings) {
|
||
const _settings = {};
|
||
Object.keys(settings).forEach((key) => {
|
||
_settings[key] = settings[key].defaultValue;
|
||
});
|
||
return _settings;
|
||
}
|
||
function getPluginLocalKey(pluginId) {
|
||
return `__VUE_DEVTOOLS_NEXT_PLUGIN_SETTINGS__${pluginId}__`;
|
||
}
|
||
function getPluginSettingsOptions(pluginId) {
|
||
var _a25, _b25, _c;
|
||
const item = (_b25 = (_a25 = devtoolsPluginBuffer.find((item2) => {
|
||
var _a26;
|
||
return item2[0].id === pluginId && !!((_a26 = item2[0]) == null ? void 0 : _a26.settings);
|
||
})) == null ? void 0 : _a25[0]) != null ? _b25 : null;
|
||
return (_c = item == null ? void 0 : item.settings) != null ? _c : null;
|
||
}
|
||
function getPluginSettings(pluginId, fallbackValue) {
|
||
var _a25, _b25, _c;
|
||
const localKey = getPluginLocalKey(pluginId);
|
||
if (localKey) {
|
||
const localSettings = localStorage.getItem(localKey);
|
||
if (localSettings) return JSON.parse(localSettings);
|
||
}
|
||
if (pluginId) {
|
||
const item = (_b25 = (_a25 = devtoolsPluginBuffer.find((item2) => item2[0].id === pluginId)) == null ? void 0 : _a25[0]) != null ? _b25 : null;
|
||
return _getSettings((_c = item == null ? void 0 : item.settings) != null ? _c : {});
|
||
}
|
||
return _getSettings(fallbackValue);
|
||
}
|
||
function initPluginSettings(pluginId, settings) {
|
||
const localKey = getPluginLocalKey(pluginId);
|
||
if (!localStorage.getItem(localKey)) localStorage.setItem(localKey, JSON.stringify(_getSettings(settings)));
|
||
}
|
||
function setPluginSettings(pluginId, key, value) {
|
||
const localKey = getPluginLocalKey(pluginId);
|
||
const localSettings = localStorage.getItem(localKey);
|
||
const parsedLocalSettings = JSON.parse(localSettings || "{}");
|
||
const updated = {
|
||
...parsedLocalSettings,
|
||
[key]: value
|
||
};
|
||
localStorage.setItem(localKey, JSON.stringify(updated));
|
||
devtoolsContext.hooks.callHookWith((callbacks) => {
|
||
callbacks.forEach((cb) => cb({
|
||
pluginId,
|
||
key,
|
||
oldValue: parsedLocalSettings[key],
|
||
newValue: value,
|
||
settings: updated
|
||
}));
|
||
}, "setPluginSettings");
|
||
}
|
||
init_esm_shims();
|
||
init_esm_shims();
|
||
init_esm_shims();
|
||
init_esm_shims();
|
||
init_esm_shims();
|
||
init_esm_shims();
|
||
init_esm_shims();
|
||
init_esm_shims();
|
||
init_esm_shims();
|
||
init_esm_shims();
|
||
init_esm_shims();
|
||
var _a11, _b11;
|
||
var devtoolsHooks = (_b11 = (_a11 = target).__VUE_DEVTOOLS_HOOK) != null ? _b11 : _a11.__VUE_DEVTOOLS_HOOK = createHooks();
|
||
var hook = {
|
||
on: {
|
||
vueAppInit(fn) {
|
||
devtoolsHooks.hook("app:init", fn);
|
||
},
|
||
vueAppUnmount(fn) {
|
||
devtoolsHooks.hook("app:unmount", fn);
|
||
},
|
||
vueAppConnected(fn) {
|
||
devtoolsHooks.hook("app:connected", fn);
|
||
},
|
||
componentAdded(fn) {
|
||
return devtoolsHooks.hook("component:added", fn);
|
||
},
|
||
componentEmit(fn) {
|
||
return devtoolsHooks.hook("component:emit", fn);
|
||
},
|
||
componentUpdated(fn) {
|
||
return devtoolsHooks.hook("component:updated", fn);
|
||
},
|
||
componentRemoved(fn) {
|
||
return devtoolsHooks.hook("component:removed", fn);
|
||
},
|
||
setupDevtoolsPlugin(fn) {
|
||
devtoolsHooks.hook("devtools-plugin:setup", fn);
|
||
},
|
||
perfStart(fn) {
|
||
return devtoolsHooks.hook("perf:start", fn);
|
||
},
|
||
perfEnd(fn) {
|
||
return devtoolsHooks.hook("perf:end", fn);
|
||
}
|
||
},
|
||
setupDevToolsPlugin(pluginDescriptor, setupFn) {
|
||
return devtoolsHooks.callHook("devtools-plugin:setup", pluginDescriptor, setupFn);
|
||
}
|
||
};
|
||
var DevToolsV6PluginAPI = class {
|
||
constructor({ plugin, ctx }) {
|
||
this.hooks = ctx.hooks;
|
||
this.plugin = plugin;
|
||
}
|
||
get on() {
|
||
return {
|
||
visitComponentTree: (handler) => {
|
||
this.hooks.hook("visitComponentTree", handler);
|
||
},
|
||
inspectComponent: (handler) => {
|
||
this.hooks.hook("inspectComponent", handler);
|
||
},
|
||
editComponentState: (handler) => {
|
||
this.hooks.hook("editComponentState", handler);
|
||
},
|
||
getInspectorTree: (handler) => {
|
||
this.hooks.hook("getInspectorTree", handler);
|
||
},
|
||
getInspectorState: (handler) => {
|
||
this.hooks.hook("getInspectorState", handler);
|
||
},
|
||
editInspectorState: (handler) => {
|
||
this.hooks.hook("editInspectorState", handler);
|
||
},
|
||
inspectTimelineEvent: (handler) => {
|
||
this.hooks.hook("inspectTimelineEvent", handler);
|
||
},
|
||
timelineCleared: (handler) => {
|
||
this.hooks.hook("timelineCleared", handler);
|
||
},
|
||
setPluginSettings: (handler) => {
|
||
this.hooks.hook("setPluginSettings", handler);
|
||
}
|
||
};
|
||
}
|
||
notifyComponentUpdate(instance) {
|
||
var _a25;
|
||
if (devtoolsState.highPerfModeEnabled) return;
|
||
const inspector = getActiveInspectors().find((i) => i.packageName === this.plugin.descriptor.packageName);
|
||
if (inspector == null ? void 0 : inspector.id) {
|
||
if (instance) {
|
||
const args = [
|
||
instance.appContext.app,
|
||
instance.uid,
|
||
(_a25 = instance.parent) == null ? void 0 : _a25.uid,
|
||
instance
|
||
];
|
||
devtoolsHooks.callHook("component:updated", ...args);
|
||
} else devtoolsHooks.callHook("component:updated");
|
||
this.hooks.callHook("sendInspectorState", {
|
||
inspectorId: inspector.id,
|
||
plugin: this.plugin
|
||
});
|
||
}
|
||
}
|
||
addInspector(options) {
|
||
this.hooks.callHook("addInspector", {
|
||
inspector: options,
|
||
plugin: this.plugin
|
||
});
|
||
if (this.plugin.descriptor.settings) initPluginSettings(options.id, this.plugin.descriptor.settings);
|
||
}
|
||
sendInspectorTree(inspectorId) {
|
||
if (devtoolsState.highPerfModeEnabled) return;
|
||
this.hooks.callHook("sendInspectorTree", {
|
||
inspectorId,
|
||
plugin: this.plugin
|
||
});
|
||
}
|
||
sendInspectorState(inspectorId) {
|
||
if (devtoolsState.highPerfModeEnabled) return;
|
||
this.hooks.callHook("sendInspectorState", {
|
||
inspectorId,
|
||
plugin: this.plugin
|
||
});
|
||
}
|
||
selectInspectorNode(inspectorId, nodeId) {
|
||
this.hooks.callHook("customInspectorSelectNode", {
|
||
inspectorId,
|
||
nodeId,
|
||
plugin: this.plugin
|
||
});
|
||
}
|
||
visitComponentTree(payload) {
|
||
return this.hooks.callHook("visitComponentTree", payload);
|
||
}
|
||
now() {
|
||
if (devtoolsState.highPerfModeEnabled) return 0;
|
||
return Date.now();
|
||
}
|
||
addTimelineLayer(options) {
|
||
this.hooks.callHook("timelineLayerAdded", {
|
||
options,
|
||
plugin: this.plugin
|
||
});
|
||
}
|
||
addTimelineEvent(options) {
|
||
if (devtoolsState.highPerfModeEnabled) return;
|
||
this.hooks.callHook("timelineEventAdded", {
|
||
options,
|
||
plugin: this.plugin
|
||
});
|
||
}
|
||
getSettings(pluginId) {
|
||
return getPluginSettings(pluginId != null ? pluginId : this.plugin.descriptor.id, this.plugin.descriptor.settings);
|
||
}
|
||
getComponentInstances(app) {
|
||
return this.hooks.callHook("getComponentInstances", { app });
|
||
}
|
||
getComponentBounds(instance) {
|
||
return this.hooks.callHook("getComponentBounds", { instance });
|
||
}
|
||
getComponentName(instance) {
|
||
return this.hooks.callHook("getComponentName", { instance });
|
||
}
|
||
highlightElement(instance) {
|
||
const uid = instance.__VUE_DEVTOOLS_NEXT_UID__;
|
||
return this.hooks.callHook("componentHighlight", { uid });
|
||
}
|
||
unhighlightElement() {
|
||
return this.hooks.callHook("componentUnhighlight");
|
||
}
|
||
};
|
||
var DevToolsPluginAPI = DevToolsV6PluginAPI;
|
||
init_esm_shims();
|
||
init_esm_shims();
|
||
init_esm_shims();
|
||
init_esm_shims();
|
||
var UNDEFINED = "__vue_devtool_undefined__";
|
||
var INFINITY = "__vue_devtool_infinity__";
|
||
var NEGATIVE_INFINITY = "__vue_devtool_negative_infinity__";
|
||
var NAN = "__vue_devtool_nan__";
|
||
init_esm_shims();
|
||
init_esm_shims();
|
||
Object.entries({
|
||
[UNDEFINED]: "undefined",
|
||
[NAN]: "NaN",
|
||
[INFINITY]: "Infinity",
|
||
[NEGATIVE_INFINITY]: "-Infinity"
|
||
}).reduce((acc, [key, value]) => {
|
||
acc[value] = key;
|
||
return acc;
|
||
}, {});
|
||
init_esm_shims();
|
||
init_esm_shims();
|
||
init_esm_shims();
|
||
init_esm_shims();
|
||
init_esm_shims();
|
||
var _a12;
|
||
(_a12 = target).__VUE_DEVTOOLS_KIT__REGISTERED_PLUGIN_APPS__ ?? (_a12.__VUE_DEVTOOLS_KIT__REGISTERED_PLUGIN_APPS__ = /* @__PURE__ */ new Set());
|
||
function setupDevToolsPlugin(pluginDescriptor, setupFn) {
|
||
return hook.setupDevToolsPlugin(pluginDescriptor, setupFn);
|
||
}
|
||
function callDevToolsPluginSetupFn(plugin, app) {
|
||
const [pluginDescriptor, setupFn] = plugin;
|
||
if (pluginDescriptor.app !== app) return;
|
||
const api = new DevToolsPluginAPI({
|
||
plugin: {
|
||
setupFn,
|
||
descriptor: pluginDescriptor
|
||
},
|
||
ctx: devtoolsContext
|
||
});
|
||
if (pluginDescriptor.packageName === "vuex") api.on.editInspectorState((payload) => {
|
||
api.sendInspectorState(payload.inspectorId);
|
||
});
|
||
setupFn(api);
|
||
}
|
||
function registerDevToolsPlugin(app, options) {
|
||
if (target.__VUE_DEVTOOLS_KIT__REGISTERED_PLUGIN_APPS__.has(app)) return;
|
||
if (devtoolsState.highPerfModeEnabled && !(options == null ? void 0 : options.inspectingComponent)) return;
|
||
target.__VUE_DEVTOOLS_KIT__REGISTERED_PLUGIN_APPS__.add(app);
|
||
devtoolsPluginBuffer.forEach((plugin) => {
|
||
callDevToolsPluginSetupFn(plugin, app);
|
||
});
|
||
}
|
||
init_esm_shims();
|
||
init_esm_shims();
|
||
var ROUTER_KEY = "__VUE_DEVTOOLS_ROUTER__";
|
||
var ROUTER_INFO_KEY = "__VUE_DEVTOOLS_ROUTER_INFO__", _a13;
|
||
(_a13 = target)["__VUE_DEVTOOLS_ROUTER_INFO__"] ?? (_a13["__VUE_DEVTOOLS_ROUTER_INFO__"] = {
|
||
currentRoute: null,
|
||
routes: []
|
||
});
|
||
var _a14;
|
||
(_a14 = target)["__VUE_DEVTOOLS_ROUTER__"] ?? (_a14["__VUE_DEVTOOLS_ROUTER__"] = {});
|
||
new Proxy(target[ROUTER_INFO_KEY], { get(target22, property) {
|
||
return target[ROUTER_INFO_KEY][property];
|
||
} });
|
||
new Proxy(target[ROUTER_KEY], { get(target22, property) {
|
||
if (property === "value") return target[ROUTER_KEY];
|
||
} });
|
||
function getRoutes(router) {
|
||
const routesMap = /* @__PURE__ */ new Map();
|
||
return ((router == null ? void 0 : router.getRoutes()) || []).filter((i) => !routesMap.has(i.path) && routesMap.set(i.path, 1));
|
||
}
|
||
function filterRoutes(routes) {
|
||
return routes.map((item) => {
|
||
let { path, name, children, meta } = item;
|
||
if (children == null ? void 0 : children.length) children = filterRoutes(children);
|
||
return {
|
||
path,
|
||
name,
|
||
children,
|
||
meta
|
||
};
|
||
});
|
||
}
|
||
function filterCurrentRoute(route) {
|
||
if (route) {
|
||
const { fullPath, hash, href, path, name, matched, params, query } = route;
|
||
return {
|
||
fullPath,
|
||
hash,
|
||
href,
|
||
path,
|
||
name,
|
||
params,
|
||
query,
|
||
matched: filterRoutes(matched)
|
||
};
|
||
}
|
||
return route;
|
||
}
|
||
function normalizeRouterInfo(appRecord, activeAppRecord2) {
|
||
function init() {
|
||
var _a25;
|
||
const router = (_a25 = appRecord.app) == null ? void 0 : _a25.config.globalProperties.$router;
|
||
const currentRoute = filterCurrentRoute(router == null ? void 0 : router.currentRoute.value);
|
||
const routes = filterRoutes(getRoutes(router));
|
||
const c = console.warn;
|
||
console.warn = () => {};
|
||
target[ROUTER_INFO_KEY] = {
|
||
currentRoute: currentRoute ? deepClone(currentRoute) : {},
|
||
routes: deepClone(routes)
|
||
};
|
||
target[ROUTER_KEY] = router;
|
||
console.warn = c;
|
||
}
|
||
init();
|
||
hook.on.componentUpdated(debounce(() => {
|
||
var _a25;
|
||
if (((_a25 = activeAppRecord2.value) == null ? void 0 : _a25.app) !== appRecord.app) return;
|
||
init();
|
||
if (devtoolsState.highPerfModeEnabled) return;
|
||
devtoolsContext.hooks.callHook("routerInfoUpdated", { state: target[ROUTER_INFO_KEY] });
|
||
}, 200));
|
||
}
|
||
function createDevToolsApi(hooks2) {
|
||
return {
|
||
async getInspectorTree(payload) {
|
||
const _payload = {
|
||
...payload,
|
||
app: activeAppRecord.value.app,
|
||
rootNodes: []
|
||
};
|
||
await new Promise((resolve) => {
|
||
hooks2.callHookWith(async (callbacks) => {
|
||
await Promise.all(callbacks.map((cb) => cb(_payload)));
|
||
resolve();
|
||
}, "getInspectorTree");
|
||
});
|
||
return _payload.rootNodes;
|
||
},
|
||
async getInspectorState(payload) {
|
||
const _payload = {
|
||
...payload,
|
||
app: activeAppRecord.value.app,
|
||
state: null
|
||
};
|
||
const ctx = { currentTab: `custom-inspector:${payload.inspectorId}` };
|
||
await new Promise((resolve) => {
|
||
hooks2.callHookWith(async (callbacks) => {
|
||
await Promise.all(callbacks.map((cb) => cb(_payload, ctx)));
|
||
resolve();
|
||
}, "getInspectorState");
|
||
});
|
||
return _payload.state;
|
||
},
|
||
editInspectorState(payload) {
|
||
const stateEditor2 = new StateEditor();
|
||
const _payload = {
|
||
...payload,
|
||
app: activeAppRecord.value.app,
|
||
set: (obj, path = payload.path, value = payload.state.value, cb) => {
|
||
stateEditor2.set(obj, path, value, cb || stateEditor2.createDefaultSetCallback(payload.state));
|
||
}
|
||
};
|
||
hooks2.callHookWith((callbacks) => {
|
||
callbacks.forEach((cb) => cb(_payload));
|
||
}, "editInspectorState");
|
||
},
|
||
sendInspectorState(inspectorId) {
|
||
const inspector = getInspector(inspectorId);
|
||
hooks2.callHook("sendInspectorState", {
|
||
inspectorId,
|
||
plugin: {
|
||
descriptor: inspector.descriptor,
|
||
setupFn: () => ({})
|
||
}
|
||
});
|
||
},
|
||
inspectComponentInspector() {
|
||
return inspectComponentHighLighter();
|
||
},
|
||
cancelInspectComponentInspector() {
|
||
return cancelInspectComponentHighLighter();
|
||
},
|
||
getComponentRenderCode(id) {
|
||
const instance = getComponentInstance(activeAppRecord.value, id);
|
||
if (instance) return !(typeof (instance == null ? void 0 : instance.type) === "function") ? instance.render.toString() : instance.type.toString();
|
||
},
|
||
scrollToComponent(id) {
|
||
return scrollToComponent({ id });
|
||
},
|
||
openInEditor,
|
||
getVueInspector: getComponentInspector,
|
||
toggleApp(id, options) {
|
||
const appRecord = devtoolsAppRecords.value.find((record) => record.id === id);
|
||
if (appRecord) {
|
||
setActiveAppRecordId(id);
|
||
setActiveAppRecord(appRecord);
|
||
normalizeRouterInfo(appRecord, activeAppRecord);
|
||
callInspectorUpdatedHook();
|
||
registerDevToolsPlugin(appRecord.app, options);
|
||
}
|
||
},
|
||
inspectDOM(instanceId) {
|
||
const instance = getComponentInstance(activeAppRecord.value, instanceId);
|
||
if (instance) {
|
||
const [el] = getRootElementsFromComponentInstance(instance);
|
||
if (el) target.__VUE_DEVTOOLS_INSPECT_DOM_TARGET__ = el;
|
||
}
|
||
},
|
||
updatePluginSettings(pluginId, key, value) {
|
||
setPluginSettings(pluginId, key, value);
|
||
},
|
||
getPluginSettings(pluginId) {
|
||
return {
|
||
options: getPluginSettingsOptions(pluginId),
|
||
values: getPluginSettings(pluginId)
|
||
};
|
||
}
|
||
};
|
||
}
|
||
init_esm_shims();
|
||
var _a15;
|
||
(_a15 = target).__VUE_DEVTOOLS_ENV__ ?? (_a15.__VUE_DEVTOOLS_ENV__ = { vitePluginDetected: false });
|
||
var hooks = createDevToolsCtxHooks(), _a16;
|
||
(_a16 = target).__VUE_DEVTOOLS_KIT_CONTEXT__ ?? (_a16.__VUE_DEVTOOLS_KIT_CONTEXT__ = {
|
||
hooks,
|
||
get state() {
|
||
return {
|
||
...devtoolsState,
|
||
activeAppRecordId: activeAppRecord.id,
|
||
activeAppRecord: activeAppRecord.value,
|
||
appRecords: devtoolsAppRecords.value
|
||
};
|
||
},
|
||
api: createDevToolsApi(hooks)
|
||
});
|
||
var devtoolsContext = target.__VUE_DEVTOOLS_KIT_CONTEXT__;
|
||
init_esm_shims();
|
||
__toESM(require_speakingurl2(), 1);
|
||
var _a17;
|
||
(_a17 = target).__VUE_DEVTOOLS_NEXT_APP_RECORD_INFO__ != null || (_a17.__VUE_DEVTOOLS_NEXT_APP_RECORD_INFO__ = {
|
||
id: 0,
|
||
appIds: /* @__PURE__ */ new Set()
|
||
});
|
||
init_esm_shims();
|
||
init_esm_shims();
|
||
function toggleHighPerfMode(state) {
|
||
devtoolsState.highPerfModeEnabled = state != null ? state : !devtoolsState.highPerfModeEnabled;
|
||
if (!state && activeAppRecord.value) registerDevToolsPlugin(activeAppRecord.value.app);
|
||
}
|
||
init_esm_shims();
|
||
init_esm_shims();
|
||
init_esm_shims();
|
||
function updateDevToolsClientDetected(params) {
|
||
devtoolsState.devtoolsClientDetected = {
|
||
...devtoolsState.devtoolsClientDetected,
|
||
...params
|
||
};
|
||
toggleHighPerfMode(!Object.values(devtoolsState.devtoolsClientDetected).some(Boolean));
|
||
}
|
||
var _a18;
|
||
(_a18 = target).__VUE_DEVTOOLS_UPDATE_CLIENT_DETECTED__ ?? (_a18.__VUE_DEVTOOLS_UPDATE_CLIENT_DETECTED__ = updateDevToolsClientDetected);
|
||
init_esm_shims();
|
||
init_esm_shims();
|
||
init_esm_shims();
|
||
init_esm_shims();
|
||
init_esm_shims();
|
||
init_esm_shims();
|
||
init_esm_shims();
|
||
var DoubleIndexedKV = class {
|
||
constructor() {
|
||
this.keyToValue = /* @__PURE__ */ new Map();
|
||
this.valueToKey = /* @__PURE__ */ new Map();
|
||
}
|
||
set(key, value) {
|
||
this.keyToValue.set(key, value);
|
||
this.valueToKey.set(value, key);
|
||
}
|
||
getByKey(key) {
|
||
return this.keyToValue.get(key);
|
||
}
|
||
getByValue(value) {
|
||
return this.valueToKey.get(value);
|
||
}
|
||
clear() {
|
||
this.keyToValue.clear();
|
||
this.valueToKey.clear();
|
||
}
|
||
};
|
||
var Registry = class {
|
||
constructor(generateIdentifier) {
|
||
this.generateIdentifier = generateIdentifier;
|
||
this.kv = new DoubleIndexedKV();
|
||
}
|
||
register(value, identifier) {
|
||
if (this.kv.getByValue(value)) return;
|
||
if (!identifier) identifier = this.generateIdentifier(value);
|
||
this.kv.set(identifier, value);
|
||
}
|
||
clear() {
|
||
this.kv.clear();
|
||
}
|
||
getIdentifier(value) {
|
||
return this.kv.getByValue(value);
|
||
}
|
||
getValue(identifier) {
|
||
return this.kv.getByKey(identifier);
|
||
}
|
||
};
|
||
var ClassRegistry = class extends Registry {
|
||
constructor() {
|
||
super((c) => c.name);
|
||
this.classToAllowedProps = /* @__PURE__ */ new Map();
|
||
}
|
||
register(value, options) {
|
||
if (typeof options === "object") {
|
||
if (options.allowProps) this.classToAllowedProps.set(value, options.allowProps);
|
||
super.register(value, options.identifier);
|
||
} else super.register(value, options);
|
||
}
|
||
getAllowedProps(value) {
|
||
return this.classToAllowedProps.get(value);
|
||
}
|
||
};
|
||
init_esm_shims();
|
||
init_esm_shims();
|
||
function valuesOfObj(record) {
|
||
if ("values" in Object) return Object.values(record);
|
||
const values = [];
|
||
for (const key in record) if (record.hasOwnProperty(key)) values.push(record[key]);
|
||
return values;
|
||
}
|
||
function find(record, predicate) {
|
||
const values = valuesOfObj(record);
|
||
if ("find" in values) return values.find(predicate);
|
||
const valuesNotNever = values;
|
||
for (let i = 0; i < valuesNotNever.length; i++) {
|
||
const value = valuesNotNever[i];
|
||
if (predicate(value)) return value;
|
||
}
|
||
}
|
||
function forEach(record, run) {
|
||
Object.entries(record).forEach(([key, value]) => run(value, key));
|
||
}
|
||
function includes(arr, value) {
|
||
return arr.indexOf(value) !== -1;
|
||
}
|
||
function findArr(record, predicate) {
|
||
for (let i = 0; i < record.length; i++) {
|
||
const value = record[i];
|
||
if (predicate(value)) return value;
|
||
}
|
||
}
|
||
var CustomTransformerRegistry = class {
|
||
constructor() {
|
||
this.transfomers = {};
|
||
}
|
||
register(transformer) {
|
||
this.transfomers[transformer.name] = transformer;
|
||
}
|
||
findApplicable(v) {
|
||
return find(this.transfomers, (transformer) => transformer.isApplicable(v));
|
||
}
|
||
findByName(name) {
|
||
return this.transfomers[name];
|
||
}
|
||
};
|
||
init_esm_shims();
|
||
init_esm_shims();
|
||
var getType = (payload) => Object.prototype.toString.call(payload).slice(8, -1);
|
||
var isUndefined = (payload) => typeof payload === "undefined";
|
||
var isNull = (payload) => payload === null;
|
||
var isPlainObject2 = (payload) => {
|
||
if (typeof payload !== "object" || payload === null) return false;
|
||
if (payload === Object.prototype) return false;
|
||
if (Object.getPrototypeOf(payload) === null) return true;
|
||
return Object.getPrototypeOf(payload) === Object.prototype;
|
||
};
|
||
var isEmptyObject = (payload) => isPlainObject2(payload) && Object.keys(payload).length === 0;
|
||
var isArray = (payload) => Array.isArray(payload);
|
||
var isString = (payload) => typeof payload === "string";
|
||
var isNumber = (payload) => typeof payload === "number" && !isNaN(payload);
|
||
var isBoolean = (payload) => typeof payload === "boolean";
|
||
var isRegExp = (payload) => payload instanceof RegExp;
|
||
var isMap = (payload) => payload instanceof Map;
|
||
var isSet = (payload) => payload instanceof Set;
|
||
var isSymbol = (payload) => getType(payload) === "Symbol";
|
||
var isDate = (payload) => payload instanceof Date && !isNaN(payload.valueOf());
|
||
var isError = (payload) => payload instanceof Error;
|
||
var isNaNValue = (payload) => typeof payload === "number" && isNaN(payload);
|
||
var isPrimitive2 = (payload) => isBoolean(payload) || isNull(payload) || isUndefined(payload) || isNumber(payload) || isString(payload) || isSymbol(payload);
|
||
var isBigint = (payload) => typeof payload === "bigint";
|
||
var isInfinite = (payload) => payload === Infinity || payload === -Infinity;
|
||
var isTypedArray = (payload) => ArrayBuffer.isView(payload) && !(payload instanceof DataView);
|
||
var isURL = (payload) => payload instanceof URL;
|
||
init_esm_shims();
|
||
var escapeKey = (key) => key.replace(/\./g, "\\.");
|
||
var stringifyPath = (path) => path.map(String).map(escapeKey).join(".");
|
||
var parsePath = (string) => {
|
||
const result = [];
|
||
let segment = "";
|
||
for (let i = 0; i < string.length; i++) {
|
||
let char = string.charAt(i);
|
||
if (char === "\\" && string.charAt(i + 1) === ".") {
|
||
segment += ".";
|
||
i++;
|
||
continue;
|
||
}
|
||
if (char === ".") {
|
||
result.push(segment);
|
||
segment = "";
|
||
continue;
|
||
}
|
||
segment += char;
|
||
}
|
||
const lastSegment = segment;
|
||
result.push(lastSegment);
|
||
return result;
|
||
};
|
||
init_esm_shims();
|
||
function simpleTransformation(isApplicable, annotation, transform, untransform) {
|
||
return {
|
||
isApplicable,
|
||
annotation,
|
||
transform,
|
||
untransform
|
||
};
|
||
}
|
||
var simpleRules = [
|
||
simpleTransformation(isUndefined, "undefined", () => null, () => void 0),
|
||
simpleTransformation(isBigint, "bigint", (v) => v.toString(), (v) => {
|
||
if (typeof BigInt !== "undefined") return BigInt(v);
|
||
console.error("Please add a BigInt polyfill.");
|
||
return v;
|
||
}),
|
||
simpleTransformation(isDate, "Date", (v) => v.toISOString(), (v) => new Date(v)),
|
||
simpleTransformation(isError, "Error", (v, superJson) => {
|
||
const baseError = {
|
||
name: v.name,
|
||
message: v.message
|
||
};
|
||
superJson.allowedErrorProps.forEach((prop) => {
|
||
baseError[prop] = v[prop];
|
||
});
|
||
return baseError;
|
||
}, (v, superJson) => {
|
||
const e = new Error(v.message);
|
||
e.name = v.name;
|
||
e.stack = v.stack;
|
||
superJson.allowedErrorProps.forEach((prop) => {
|
||
e[prop] = v[prop];
|
||
});
|
||
return e;
|
||
}),
|
||
simpleTransformation(isRegExp, "regexp", (v) => "" + v, (regex) => {
|
||
const body = regex.slice(1, regex.lastIndexOf("/"));
|
||
const flags = regex.slice(regex.lastIndexOf("/") + 1);
|
||
return new RegExp(body, flags);
|
||
}),
|
||
simpleTransformation(isSet, "set", (v) => [...v.values()], (v) => new Set(v)),
|
||
simpleTransformation(isMap, "map", (v) => [...v.entries()], (v) => new Map(v)),
|
||
simpleTransformation((v) => isNaNValue(v) || isInfinite(v), "number", (v) => {
|
||
if (isNaNValue(v)) return "NaN";
|
||
if (v > 0) return "Infinity";
|
||
else return "-Infinity";
|
||
}, Number),
|
||
simpleTransformation((v) => v === 0 && 1 / v === -Infinity, "number", () => {
|
||
return "-0";
|
||
}, Number),
|
||
simpleTransformation(isURL, "URL", (v) => v.toString(), (v) => new URL(v))
|
||
];
|
||
function compositeTransformation(isApplicable, annotation, transform, untransform) {
|
||
return {
|
||
isApplicable,
|
||
annotation,
|
||
transform,
|
||
untransform
|
||
};
|
||
}
|
||
var symbolRule = compositeTransformation((s, superJson) => {
|
||
if (isSymbol(s)) return !!superJson.symbolRegistry.getIdentifier(s);
|
||
return false;
|
||
}, (s, superJson) => {
|
||
return ["symbol", superJson.symbolRegistry.getIdentifier(s)];
|
||
}, (v) => v.description, (_, a, superJson) => {
|
||
const value = superJson.symbolRegistry.getValue(a[1]);
|
||
if (!value) throw new Error("Trying to deserialize unknown symbol");
|
||
return value;
|
||
});
|
||
var constructorToName = [
|
||
Int8Array,
|
||
Uint8Array,
|
||
Int16Array,
|
||
Uint16Array,
|
||
Int32Array,
|
||
Uint32Array,
|
||
Float32Array,
|
||
Float64Array,
|
||
Uint8ClampedArray
|
||
].reduce((obj, ctor) => {
|
||
obj[ctor.name] = ctor;
|
||
return obj;
|
||
}, {});
|
||
var typedArrayRule = compositeTransformation(isTypedArray, (v) => ["typed-array", v.constructor.name], (v) => [...v], (v, a) => {
|
||
const ctor = constructorToName[a[1]];
|
||
if (!ctor) throw new Error("Trying to deserialize unknown typed array");
|
||
return new ctor(v);
|
||
});
|
||
function isInstanceOfRegisteredClass(potentialClass, superJson) {
|
||
if (potentialClass == null ? void 0 : potentialClass.constructor) return !!superJson.classRegistry.getIdentifier(potentialClass.constructor);
|
||
return false;
|
||
}
|
||
var classRule = compositeTransformation(isInstanceOfRegisteredClass, (clazz, superJson) => {
|
||
return ["class", superJson.classRegistry.getIdentifier(clazz.constructor)];
|
||
}, (clazz, superJson) => {
|
||
const allowedProps = superJson.classRegistry.getAllowedProps(clazz.constructor);
|
||
if (!allowedProps) return { ...clazz };
|
||
const result = {};
|
||
allowedProps.forEach((prop) => {
|
||
result[prop] = clazz[prop];
|
||
});
|
||
return result;
|
||
}, (v, a, superJson) => {
|
||
const clazz = superJson.classRegistry.getValue(a[1]);
|
||
if (!clazz) throw new Error(`Trying to deserialize unknown class '${a[1]}' - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564`);
|
||
return Object.assign(Object.create(clazz.prototype), v);
|
||
});
|
||
var customRule = compositeTransformation((value, superJson) => {
|
||
return !!superJson.customTransformerRegistry.findApplicable(value);
|
||
}, (value, superJson) => {
|
||
return ["custom", superJson.customTransformerRegistry.findApplicable(value).name];
|
||
}, (value, superJson) => {
|
||
return superJson.customTransformerRegistry.findApplicable(value).serialize(value);
|
||
}, (v, a, superJson) => {
|
||
const transformer = superJson.customTransformerRegistry.findByName(a[1]);
|
||
if (!transformer) throw new Error("Trying to deserialize unknown custom value");
|
||
return transformer.deserialize(v);
|
||
});
|
||
var compositeRules = [
|
||
classRule,
|
||
symbolRule,
|
||
customRule,
|
||
typedArrayRule
|
||
];
|
||
var transformValue = (value, superJson) => {
|
||
const applicableCompositeRule = findArr(compositeRules, (rule) => rule.isApplicable(value, superJson));
|
||
if (applicableCompositeRule) return {
|
||
value: applicableCompositeRule.transform(value, superJson),
|
||
type: applicableCompositeRule.annotation(value, superJson)
|
||
};
|
||
const applicableSimpleRule = findArr(simpleRules, (rule) => rule.isApplicable(value, superJson));
|
||
if (applicableSimpleRule) return {
|
||
value: applicableSimpleRule.transform(value, superJson),
|
||
type: applicableSimpleRule.annotation
|
||
};
|
||
};
|
||
var simpleRulesByAnnotation = {};
|
||
simpleRules.forEach((rule) => {
|
||
simpleRulesByAnnotation[rule.annotation] = rule;
|
||
});
|
||
var untransformValue = (json, type, superJson) => {
|
||
if (isArray(type)) switch (type[0]) {
|
||
case "symbol": return symbolRule.untransform(json, type, superJson);
|
||
case "class": return classRule.untransform(json, type, superJson);
|
||
case "custom": return customRule.untransform(json, type, superJson);
|
||
case "typed-array": return typedArrayRule.untransform(json, type, superJson);
|
||
default: throw new Error("Unknown transformation: " + type);
|
||
}
|
||
else {
|
||
const transformation = simpleRulesByAnnotation[type];
|
||
if (!transformation) throw new Error("Unknown transformation: " + type);
|
||
return transformation.untransform(json, superJson);
|
||
}
|
||
};
|
||
init_esm_shims();
|
||
var getNthKey = (value, n) => {
|
||
if (n > value.size) throw new Error("index out of bounds");
|
||
const keys = value.keys();
|
||
while (n > 0) {
|
||
keys.next();
|
||
n--;
|
||
}
|
||
return keys.next().value;
|
||
};
|
||
function validatePath(path) {
|
||
if (includes(path, "__proto__")) throw new Error("__proto__ is not allowed as a property");
|
||
if (includes(path, "prototype")) throw new Error("prototype is not allowed as a property");
|
||
if (includes(path, "constructor")) throw new Error("constructor is not allowed as a property");
|
||
}
|
||
var getDeep = (object, path) => {
|
||
validatePath(path);
|
||
for (let i = 0; i < path.length; i++) {
|
||
const key = path[i];
|
||
if (isSet(object)) object = getNthKey(object, +key);
|
||
else if (isMap(object)) {
|
||
const row = +key;
|
||
const type = +path[++i] === 0 ? "key" : "value";
|
||
const keyOfRow = getNthKey(object, row);
|
||
switch (type) {
|
||
case "key":
|
||
object = keyOfRow;
|
||
break;
|
||
case "value":
|
||
object = object.get(keyOfRow);
|
||
break;
|
||
}
|
||
} else object = object[key];
|
||
}
|
||
return object;
|
||
};
|
||
var setDeep = (object, path, mapper) => {
|
||
validatePath(path);
|
||
if (path.length === 0) return mapper(object);
|
||
let parent = object;
|
||
for (let i = 0; i < path.length - 1; i++) {
|
||
const key = path[i];
|
||
if (isArray(parent)) {
|
||
const index = +key;
|
||
parent = parent[index];
|
||
} else if (isPlainObject2(parent)) parent = parent[key];
|
||
else if (isSet(parent)) {
|
||
const row = +key;
|
||
parent = getNthKey(parent, row);
|
||
} else if (isMap(parent)) {
|
||
if (i === path.length - 2) break;
|
||
const row = +key;
|
||
const type = +path[++i] === 0 ? "key" : "value";
|
||
const keyOfRow = getNthKey(parent, row);
|
||
switch (type) {
|
||
case "key":
|
||
parent = keyOfRow;
|
||
break;
|
||
case "value":
|
||
parent = parent.get(keyOfRow);
|
||
break;
|
||
}
|
||
}
|
||
}
|
||
const lastKey = path[path.length - 1];
|
||
if (isArray(parent)) parent[+lastKey] = mapper(parent[+lastKey]);
|
||
else if (isPlainObject2(parent)) parent[lastKey] = mapper(parent[lastKey]);
|
||
if (isSet(parent)) {
|
||
const oldValue = getNthKey(parent, +lastKey);
|
||
const newValue = mapper(oldValue);
|
||
if (oldValue !== newValue) {
|
||
parent.delete(oldValue);
|
||
parent.add(newValue);
|
||
}
|
||
}
|
||
if (isMap(parent)) {
|
||
const row = +path[path.length - 2];
|
||
const keyToRow = getNthKey(parent, row);
|
||
switch (+lastKey === 0 ? "key" : "value") {
|
||
case "key": {
|
||
const newKey = mapper(keyToRow);
|
||
parent.set(newKey, parent.get(keyToRow));
|
||
if (newKey !== keyToRow) parent.delete(keyToRow);
|
||
break;
|
||
}
|
||
case "value":
|
||
parent.set(keyToRow, mapper(parent.get(keyToRow)));
|
||
break;
|
||
}
|
||
}
|
||
return object;
|
||
};
|
||
function traverse(tree, walker2, origin = []) {
|
||
if (!tree) return;
|
||
if (!isArray(tree)) {
|
||
forEach(tree, (subtree, key) => traverse(subtree, walker2, [...origin, ...parsePath(key)]));
|
||
return;
|
||
}
|
||
const [nodeValue, children] = tree;
|
||
if (children) forEach(children, (child, key) => {
|
||
traverse(child, walker2, [...origin, ...parsePath(key)]);
|
||
});
|
||
walker2(nodeValue, origin);
|
||
}
|
||
function applyValueAnnotations(plain, annotations, superJson) {
|
||
traverse(annotations, (type, path) => {
|
||
plain = setDeep(plain, path, (v) => untransformValue(v, type, superJson));
|
||
});
|
||
return plain;
|
||
}
|
||
function applyReferentialEqualityAnnotations(plain, annotations) {
|
||
function apply(identicalPaths, path) {
|
||
const object = getDeep(plain, parsePath(path));
|
||
identicalPaths.map(parsePath).forEach((identicalObjectPath) => {
|
||
plain = setDeep(plain, identicalObjectPath, () => object);
|
||
});
|
||
}
|
||
if (isArray(annotations)) {
|
||
const [root, other] = annotations;
|
||
root.forEach((identicalPath) => {
|
||
plain = setDeep(plain, parsePath(identicalPath), () => plain);
|
||
});
|
||
if (other) forEach(other, apply);
|
||
} else forEach(annotations, apply);
|
||
return plain;
|
||
}
|
||
var isDeep = (object, superJson) => isPlainObject2(object) || isArray(object) || isMap(object) || isSet(object) || isInstanceOfRegisteredClass(object, superJson);
|
||
function addIdentity(object, path, identities) {
|
||
const existingSet = identities.get(object);
|
||
if (existingSet) existingSet.push(path);
|
||
else identities.set(object, [path]);
|
||
}
|
||
function generateReferentialEqualityAnnotations(identitites, dedupe) {
|
||
const result = {};
|
||
let rootEqualityPaths = void 0;
|
||
identitites.forEach((paths) => {
|
||
if (paths.length <= 1) return;
|
||
if (!dedupe) paths = paths.map((path) => path.map(String)).sort((a, b) => a.length - b.length);
|
||
const [representativePath, ...identicalPaths] = paths;
|
||
if (representativePath.length === 0) rootEqualityPaths = identicalPaths.map(stringifyPath);
|
||
else result[stringifyPath(representativePath)] = identicalPaths.map(stringifyPath);
|
||
});
|
||
if (rootEqualityPaths) if (isEmptyObject(result)) return [rootEqualityPaths];
|
||
else return [rootEqualityPaths, result];
|
||
else return isEmptyObject(result) ? void 0 : result;
|
||
}
|
||
var walker = (object, identities, superJson, dedupe, path = [], objectsInThisPath = [], seenObjects = /* @__PURE__ */ new Map()) => {
|
||
var _a25;
|
||
const primitive = isPrimitive2(object);
|
||
if (!primitive) {
|
||
addIdentity(object, path, identities);
|
||
const seen = seenObjects.get(object);
|
||
if (seen) return dedupe ? { transformedValue: null } : seen;
|
||
}
|
||
if (!isDeep(object, superJson)) {
|
||
const transformed2 = transformValue(object, superJson);
|
||
const result2 = transformed2 ? {
|
||
transformedValue: transformed2.value,
|
||
annotations: [transformed2.type]
|
||
} : { transformedValue: object };
|
||
if (!primitive) seenObjects.set(object, result2);
|
||
return result2;
|
||
}
|
||
if (includes(objectsInThisPath, object)) return { transformedValue: null };
|
||
const transformationResult = transformValue(object, superJson);
|
||
const transformed = (_a25 = transformationResult == null ? void 0 : transformationResult.value) != null ? _a25 : object;
|
||
const transformedValue = isArray(transformed) ? [] : {};
|
||
const innerAnnotations = {};
|
||
forEach(transformed, (value, index) => {
|
||
if (index === "__proto__" || index === "constructor" || index === "prototype") throw new Error(`Detected property ${index}. This is a prototype pollution risk, please remove it from your object.`);
|
||
const recursiveResult = walker(value, identities, superJson, dedupe, [...path, index], [...objectsInThisPath, object], seenObjects);
|
||
transformedValue[index] = recursiveResult.transformedValue;
|
||
if (isArray(recursiveResult.annotations)) innerAnnotations[index] = recursiveResult.annotations;
|
||
else if (isPlainObject2(recursiveResult.annotations)) forEach(recursiveResult.annotations, (tree, key) => {
|
||
innerAnnotations[escapeKey(index) + "." + key] = tree;
|
||
});
|
||
});
|
||
const result = isEmptyObject(innerAnnotations) ? {
|
||
transformedValue,
|
||
annotations: !!transformationResult ? [transformationResult.type] : void 0
|
||
} : {
|
||
transformedValue,
|
||
annotations: !!transformationResult ? [transformationResult.type, innerAnnotations] : innerAnnotations
|
||
};
|
||
if (!primitive) seenObjects.set(object, result);
|
||
return result;
|
||
};
|
||
init_esm_shims();
|
||
init_esm_shims();
|
||
function getType2(payload) {
|
||
return Object.prototype.toString.call(payload).slice(8, -1);
|
||
}
|
||
function isArray2(payload) {
|
||
return getType2(payload) === "Array";
|
||
}
|
||
function isPlainObject3(payload) {
|
||
if (getType2(payload) !== "Object") return false;
|
||
const prototype = Object.getPrototypeOf(payload);
|
||
return !!prototype && prototype.constructor === Object && prototype === Object.prototype;
|
||
}
|
||
function assignProp(carry, key, newVal, originalObject, includeNonenumerable) {
|
||
const propType = {}.propertyIsEnumerable.call(originalObject, key) ? "enumerable" : "nonenumerable";
|
||
if (propType === "enumerable") carry[key] = newVal;
|
||
if (includeNonenumerable && propType === "nonenumerable") Object.defineProperty(carry, key, {
|
||
value: newVal,
|
||
enumerable: false,
|
||
writable: true,
|
||
configurable: true
|
||
});
|
||
}
|
||
function copy(target22, options = {}) {
|
||
if (isArray2(target22)) return target22.map((item) => copy(item, options));
|
||
if (!isPlainObject3(target22)) return target22;
|
||
const props = Object.getOwnPropertyNames(target22);
|
||
const symbols = Object.getOwnPropertySymbols(target22);
|
||
return [...props, ...symbols].reduce((carry, key) => {
|
||
if (isArray2(options.props) && !options.props.includes(key)) return carry;
|
||
const val = target22[key];
|
||
assignProp(carry, key, copy(val, options), target22, options.nonenumerable);
|
||
return carry;
|
||
}, {});
|
||
}
|
||
var SuperJSON = class {
|
||
/**
|
||
* @param dedupeReferentialEqualities If true, SuperJSON will make sure only one instance of referentially equal objects are serialized and the rest are replaced with `null`.
|
||
*/
|
||
constructor({ dedupe = false } = {}) {
|
||
this.classRegistry = new ClassRegistry();
|
||
this.symbolRegistry = new Registry((s) => {
|
||
var _a25;
|
||
return (_a25 = s.description) != null ? _a25 : "";
|
||
});
|
||
this.customTransformerRegistry = new CustomTransformerRegistry();
|
||
this.allowedErrorProps = [];
|
||
this.dedupe = dedupe;
|
||
}
|
||
serialize(object) {
|
||
const identities = /* @__PURE__ */ new Map();
|
||
const output = walker(object, identities, this, this.dedupe);
|
||
const res = { json: output.transformedValue };
|
||
if (output.annotations) res.meta = {
|
||
...res.meta,
|
||
values: output.annotations
|
||
};
|
||
const equalityAnnotations = generateReferentialEqualityAnnotations(identities, this.dedupe);
|
||
if (equalityAnnotations) res.meta = {
|
||
...res.meta,
|
||
referentialEqualities: equalityAnnotations
|
||
};
|
||
return res;
|
||
}
|
||
deserialize(payload) {
|
||
const { json, meta } = payload;
|
||
let result = copy(json);
|
||
if (meta == null ? void 0 : meta.values) result = applyValueAnnotations(result, meta.values, this);
|
||
if (meta == null ? void 0 : meta.referentialEqualities) result = applyReferentialEqualityAnnotations(result, meta.referentialEqualities);
|
||
return result;
|
||
}
|
||
stringify(object) {
|
||
return JSON.stringify(this.serialize(object));
|
||
}
|
||
parse(string) {
|
||
return this.deserialize(JSON.parse(string));
|
||
}
|
||
registerClass(v, options) {
|
||
this.classRegistry.register(v, options);
|
||
}
|
||
registerSymbol(v, identifier) {
|
||
this.symbolRegistry.register(v, identifier);
|
||
}
|
||
registerCustom(transformer, name) {
|
||
this.customTransformerRegistry.register({
|
||
name,
|
||
...transformer
|
||
});
|
||
}
|
||
allowErrorProps(...props) {
|
||
this.allowedErrorProps.push(...props);
|
||
}
|
||
};
|
||
SuperJSON.defaultInstance = new SuperJSON();
|
||
SuperJSON.serialize = SuperJSON.defaultInstance.serialize.bind(SuperJSON.defaultInstance);
|
||
SuperJSON.deserialize = SuperJSON.defaultInstance.deserialize.bind(SuperJSON.defaultInstance);
|
||
SuperJSON.stringify = SuperJSON.defaultInstance.stringify.bind(SuperJSON.defaultInstance);
|
||
SuperJSON.parse = SuperJSON.defaultInstance.parse.bind(SuperJSON.defaultInstance);
|
||
SuperJSON.registerClass = SuperJSON.defaultInstance.registerClass.bind(SuperJSON.defaultInstance);
|
||
SuperJSON.registerSymbol = SuperJSON.defaultInstance.registerSymbol.bind(SuperJSON.defaultInstance);
|
||
SuperJSON.registerCustom = SuperJSON.defaultInstance.registerCustom.bind(SuperJSON.defaultInstance);
|
||
SuperJSON.allowErrorProps = SuperJSON.defaultInstance.allowErrorProps.bind(SuperJSON.defaultInstance);
|
||
SuperJSON.serialize;
|
||
SuperJSON.deserialize;
|
||
SuperJSON.stringify;
|
||
SuperJSON.parse;
|
||
SuperJSON.registerClass;
|
||
SuperJSON.registerCustom;
|
||
SuperJSON.registerSymbol;
|
||
SuperJSON.allowErrorProps;
|
||
init_esm_shims();
|
||
init_esm_shims();
|
||
init_esm_shims();
|
||
init_esm_shims();
|
||
init_esm_shims();
|
||
init_esm_shims();
|
||
init_esm_shims();
|
||
init_esm_shims();
|
||
init_esm_shims();
|
||
init_esm_shims();
|
||
init_esm_shims();
|
||
init_esm_shims();
|
||
init_esm_shims();
|
||
init_esm_shims();
|
||
init_esm_shims();
|
||
init_esm_shims();
|
||
init_esm_shims();
|
||
init_esm_shims();
|
||
init_esm_shims();
|
||
init_esm_shims();
|
||
init_esm_shims();
|
||
init_esm_shims();
|
||
init_esm_shims();
|
||
var _a19;
|
||
(_a19 = target).__VUE_DEVTOOLS_KIT_MESSAGE_CHANNELS__ ?? (_a19.__VUE_DEVTOOLS_KIT_MESSAGE_CHANNELS__ = []);
|
||
var _a20;
|
||
(_a20 = target).__VUE_DEVTOOLS_KIT_RPC_CLIENT__ ?? (_a20.__VUE_DEVTOOLS_KIT_RPC_CLIENT__ = null);
|
||
var _a21;
|
||
(_a21 = target).__VUE_DEVTOOLS_KIT_RPC_SERVER__ ?? (_a21.__VUE_DEVTOOLS_KIT_RPC_SERVER__ = null);
|
||
var _a22;
|
||
(_a22 = target).__VUE_DEVTOOLS_KIT_VITE_RPC_CLIENT__ ?? (_a22.__VUE_DEVTOOLS_KIT_VITE_RPC_CLIENT__ = null);
|
||
var _a23;
|
||
(_a23 = target).__VUE_DEVTOOLS_KIT_VITE_RPC_SERVER__ ?? (_a23.__VUE_DEVTOOLS_KIT_VITE_RPC_SERVER__ = null);
|
||
var _a24;
|
||
(_a24 = target).__VUE_DEVTOOLS_KIT_BROADCAST_RPC_SERVER__ ?? (_a24.__VUE_DEVTOOLS_KIT_BROADCAST_RPC_SERVER__ = null);
|
||
init_esm_shims();
|
||
init_esm_shims();
|
||
init_esm_shims();
|
||
init_esm_shims();
|
||
init_esm_shims();
|
||
init_esm_shims();
|
||
init_esm_shims();
|
||
//#endregion
|
||
//#region node_modules/pinia/dist/pinia.mjs
|
||
/*!
|
||
* pinia v3.0.4
|
||
* (c) 2025 Eduardo San Martin Morote
|
||
* @license MIT
|
||
*/
|
||
var IS_CLIENT = typeof window !== "undefined";
|
||
/**
|
||
* setActivePinia must be called to handle SSR at the top of functions like
|
||
* `fetch`, `setup`, `serverPrefetch` and others
|
||
*/
|
||
var activePinia;
|
||
/**
|
||
* Sets or unsets the active pinia. Used in SSR and internally when calling
|
||
* actions and getters
|
||
*
|
||
* @param pinia - Pinia instance
|
||
*/
|
||
var setActivePinia = (pinia) => activePinia = pinia;
|
||
/**
|
||
* Get the currently active pinia if there is any.
|
||
*/
|
||
var getActivePinia = () => {
|
||
const pinia = hasInjectionContext() && inject(piniaSymbol);
|
||
if (!pinia && !IS_CLIENT) console.error("[🍍]: Pinia instance not found in context. This falls back to the global activePinia which exposes you to cross-request pollution on the server. Most of the time, it means you are calling \"useStore()\" in the wrong place.\nRead https://vuejs.org/guide/reusability/composables.html to learn more");
|
||
return pinia || activePinia;
|
||
};
|
||
var piniaSymbol = Symbol("pinia");
|
||
function isPlainObject(o) {
|
||
return o && typeof o === "object" && Object.prototype.toString.call(o) === "[object Object]" && typeof o.toJSON !== "function";
|
||
}
|
||
/**
|
||
* 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";
|
||
})(MutationType || (MutationType = {}));
|
||
var _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 } = {}) {
|
||
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 = new MouseEvent("click", {
|
||
bubbles: true,
|
||
cancelable: true,
|
||
view: window,
|
||
detail: 0,
|
||
screenX: 80,
|
||
screenY: 20,
|
||
clientX: 80,
|
||
clientY: 20,
|
||
ctrlKey: false,
|
||
altKey: false,
|
||
shiftKey: false,
|
||
metaKey: false,
|
||
button: 0,
|
||
relatedTarget: null
|
||
});
|
||
node.dispatchEvent(evt);
|
||
}
|
||
}
|
||
var _navigator = typeof navigator === "object" ? navigator : { userAgent: "" };
|
||
var isMacOSWebView = /*#__PURE__*/ (() => /Macintosh/.test(_navigator.userAgent) && /AppleWebKit/.test(_navigator.userAgent) && !/Safari/.test(_navigator.userAgent))();
|
||
var saveAs = !IS_CLIENT ? () => {} : typeof HTMLAnchorElement !== "undefined" && "download" in HTMLAnchorElement.prototype && !isMacOSWebView ? downloadSaveAs : "msSaveOrOpenBlob" in _navigator ? msSaveAs : 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);
|
||
}
|
||
}
|
||
/**
|
||
* 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") __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);
|
||
}
|
||
}
|
||
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 result = await getFileOpener()();
|
||
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;
|
||
return {
|
||
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;
|
||
}, {})
|
||
};
|
||
})
|
||
};
|
||
}
|
||
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;
|
||
/**
|
||
* Gets the displayed name of a store in devtools
|
||
*
|
||
* @param id - id of the store
|
||
* @returns a formatted string
|
||
*/
|
||
var 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: 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) => {
|
||
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$1(store.$state),
|
||
actions: [{
|
||
icon: "restore",
|
||
tooltip: "Reset the state of this store",
|
||
action: () => store.$reset()
|
||
}]
|
||
} } : 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);
|
||
}
|
||
});
|
||
globalThis.$pinia = pinia;
|
||
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) {
|
||
if (payload.nodeId !== PINIA_ROOT_ID) globalThis.$store = toRaw$1(inspectedStore);
|
||
payload.state = formatStoreForInspectorState(inspectedStore);
|
||
}
|
||
}
|
||
});
|
||
api.on.editInspectorState((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 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}":\n${path}\nOnly 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
|
||
} }
|
||
}, (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;
|
||
/**
|
||
* 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) {
|
||
const actions = actionNames.reduce((storeActions, actionName) => {
|
||
storeActions[actionName] = toRaw$1(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;
|
||
};
|
||
}
|
||
/**
|
||
* pinia.use(devtoolsPlugin)
|
||
*/
|
||
function devtoolsPlugin({ app, store, options }) {
|
||
if (store.$id.startsWith("__hot:")) return;
|
||
store._isOptionsAPI = !!options.state;
|
||
if (!store._p._testing) {
|
||
patchActionForGrouping(store, Object.keys(options.actions), store._isOptionsAPI);
|
||
const originalHotUpdate = store._hotUpdate;
|
||
toRaw$1(store)._hotUpdate = function(newStore) {
|
||
originalHotUpdate.apply(this, arguments);
|
||
patchActionForGrouping(store, Object.keys(newStore._hmrPayload.actions), !!store._isOptionsAPI);
|
||
};
|
||
}
|
||
addStoreToDevtools(app, store);
|
||
}
|
||
/**
|
||
* Creates a Pinia instance to be used by the application
|
||
*/
|
||
function createPinia() {
|
||
const scope = effectScope(true);
|
||
const state = scope.run(() => ref({}));
|
||
let _p = [];
|
||
let toBeInstalled = [];
|
||
const pinia = markRaw({
|
||
install(app) {
|
||
setActivePinia(pinia);
|
||
pinia._a = app;
|
||
app.provide(piniaSymbol, pinia);
|
||
app.config.globalProperties.$pinia = pinia;
|
||
/* istanbul ignore else */
|
||
if (IS_CLIENT) registerPiniaDevtools(app, pinia);
|
||
toBeInstalled.forEach((plugin) => _p.push(plugin));
|
||
toBeInstalled = [];
|
||
},
|
||
use(plugin) {
|
||
if (!this._a) toBeInstalled.push(plugin);
|
||
else _p.push(plugin);
|
||
return this;
|
||
},
|
||
_p,
|
||
_a: null,
|
||
_e: scope,
|
||
_s: /* @__PURE__ */ new Map(),
|
||
state
|
||
});
|
||
if (IS_CLIENT && typeof Proxy !== "undefined") pinia.use(devtoolsPlugin);
|
||
return pinia;
|
||
}
|
||
/**
|
||
* Dispose a Pinia instance by stopping its effectScope and removing the state, plugins and stores. This is mostly
|
||
* useful in tests, with both a testing pinia or a regular pinia and in applications that use multiple pinia instances.
|
||
* Once disposed, the pinia instance cannot be used anymore.
|
||
*
|
||
* @param pinia - pinia instance
|
||
*/
|
||
function disposePinia(pinia) {
|
||
pinia._e.stop();
|
||
pinia._s.clear();
|
||
pinia._p.splice(0);
|
||
pinia.state.value = {};
|
||
pinia._a = null;
|
||
}
|
||
/**
|
||
* Checks if a function is a `StoreDefinition`.
|
||
*
|
||
* @param fn - object to test
|
||
* @returns true if `fn` is a StoreDefinition
|
||
*/
|
||
var 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) {
|
||
for (const key in oldState) {
|
||
const subPatch = oldState[key];
|
||
if (!(key in newState)) continue;
|
||
const targetValue = newState[key];
|
||
if (isPlainObject(targetValue) && isPlainObject(subPatch) && !isRef$1(subPatch) && !isReactive$1(subPatch)) newState[key] = patchObject(targetValue, 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) 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.add(callback);
|
||
const removeSubscription = () => {
|
||
subscriptions.delete(callback) && onCleanup();
|
||
};
|
||
if (!detached && getCurrentScope()) onScopeDispose(removeSubscription);
|
||
return removeSubscription;
|
||
}
|
||
function triggerSubscriptions(subscriptions, ...args) {
|
||
subscriptions.forEach((callback) => {
|
||
callback(...args);
|
||
});
|
||
}
|
||
var fallbackRunWithContext = (fn) => fn();
|
||
/**
|
||
* Marks a function as an action for `$onAction`
|
||
* @internal
|
||
*/
|
||
var ACTION_MARKER = Symbol();
|
||
/**
|
||
* Action name symbol. Allows to add a name to an action after defining it
|
||
* @internal
|
||
*/
|
||
var ACTION_NAME = Symbol();
|
||
function mergeReactiveObjects(target, patchToApply) {
|
||
if (target instanceof Map && patchToApply instanceof Map) patchToApply.forEach((value, key) => target.set(key, value));
|
||
else 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$1(subPatch) && !isReactive$1(subPatch)) target[key] = mergeReactiveObjects(targetValue, subPatch);
|
||
else target[key] = subPatch;
|
||
}
|
||
return target;
|
||
}
|
||
var skipHydrateSymbol = Symbol("pinia:skipHydration");
|
||
/**
|
||
* 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 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 !isPlainObject(obj) || !Object.prototype.hasOwnProperty.call(obj, skipHydrateSymbol);
|
||
}
|
||
var { assign } = Object;
|
||
function isComputed(o) {
|
||
return !!(isRef$1(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 */
|
||
pinia.state.value[id] = state ? state() : {};
|
||
const localState = hot ? 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 store = pinia._s.get(id);
|
||
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");
|
||
const $subscribeOptions = { deep: true };
|
||
$subscribeOptions.onTrigger = (event) => {
|
||
/* istanbul ignore else */
|
||
if (isListening) debuggerEvents = event;
|
||
else if (isListening == false && !store._hotUpdating)
|
||
/* 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.");
|
||
};
|
||
let isListening;
|
||
let isSyncListening;
|
||
let subscriptions = /* @__PURE__ */ new Set();
|
||
let actionSubscriptions = /* @__PURE__ */ new Set();
|
||
let debuggerEvents;
|
||
const initialState = pinia.state.value[$id];
|
||
if (!isOptionsStore && !initialState && !hot)
|
||
/* istanbul ignore if */
|
||
pinia.state.value[$id] = {};
|
||
const hotState = ref({});
|
||
let activeListener;
|
||
function $patch(partialStateOrMutator) {
|
||
let subscriptionMutation;
|
||
isListening = isSyncListening = false;
|
||
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 $reset() {
|
||
const { state } = options;
|
||
const newState = state ? state() : {};
|
||
this.$patch(($state) => {
|
||
assign($state, newState);
|
||
});
|
||
} : () => {
|
||
throw new Error(`🍍: Store "${$id}" is built using the setup syntax and does not implement $reset().`);
|
||
};
|
||
function $dispose() {
|
||
scope.stop();
|
||
subscriptions.clear();
|
||
actionSubscriptions.clear();
|
||
pinia._s.delete($id);
|
||
}
|
||
/**
|
||
* Helper that wraps function so it can be tracked with $onAction
|
||
* @param fn - action to wrap
|
||
* @param name - name of the action
|
||
*/
|
||
const action = (fn, name = "") => {
|
||
if (ACTION_MARKER in fn) {
|
||
fn[ACTION_NAME] = name;
|
||
return fn;
|
||
}
|
||
const wrappedAction = function() {
|
||
setActivePinia(pinia);
|
||
const args = Array.from(arguments);
|
||
const afterCallbackSet = /* @__PURE__ */ new Set();
|
||
const onErrorCallbackSet = /* @__PURE__ */ new Set();
|
||
function after(callback) {
|
||
afterCallbackSet.add(callback);
|
||
}
|
||
function onError(callback) {
|
||
onErrorCallbackSet.add(callback);
|
||
}
|
||
triggerSubscriptions(actionSubscriptions, {
|
||
args,
|
||
name: wrappedAction[ACTION_NAME],
|
||
store,
|
||
after,
|
||
onError
|
||
});
|
||
let ret;
|
||
try {
|
||
ret = fn.apply(this && this.$id === $id ? this : store, args);
|
||
} catch (error) {
|
||
triggerSubscriptions(onErrorCallbackSet, error);
|
||
throw error;
|
||
}
|
||
if (ret instanceof Promise) return ret.then((value) => {
|
||
triggerSubscriptions(afterCallbackSet, value);
|
||
return value;
|
||
}).catch((error) => {
|
||
triggerSubscriptions(onErrorCallbackSet, error);
|
||
return Promise.reject(error);
|
||
});
|
||
triggerSubscriptions(afterCallbackSet, ret);
|
||
return ret;
|
||
};
|
||
wrappedAction[ACTION_MARKER] = true;
|
||
wrappedAction[ACTION_NAME] = name;
|
||
return wrappedAction;
|
||
};
|
||
const _hmrPayload = /*#__PURE__*/ markRaw({
|
||
actions: {},
|
||
getters: {},
|
||
state: [],
|
||
hotState
|
||
});
|
||
const partialStore = {
|
||
_p: pinia,
|
||
$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
|
||
};
|
||
const store = reactive(assign({
|
||
_hmrPayload,
|
||
_customProperties: markRaw(/* @__PURE__ */ new Set())
|
||
}, partialStore));
|
||
pinia._s.set($id, store);
|
||
const setupStore = (pinia._a && pinia._a.runWithContext || fallbackRunWithContext)(() => pinia._e.run(() => (scope = effectScope()).run(() => setup({ action }))));
|
||
for (const key in setupStore) {
|
||
const prop = setupStore[key];
|
||
if (isRef$1(prop) && !isComputed(prop) || isReactive$1(prop)) {
|
||
if (hot) hotState.value[key] = toRef(setupStore, key);
|
||
else if (!isOptionsStore) {
|
||
if (initialState && shouldHydrate(prop)) if (isRef$1(prop)) prop.value = initialState[key];
|
||
else mergeReactiveObjects(prop, initialState[key]);
|
||
pinia.state.value[$id][key] = prop;
|
||
}
|
||
_hmrPayload.state.push(key);
|
||
} else if (typeof prop === "function") {
|
||
setupStore[key] = hot ? prop : action(prop, key);
|
||
_hmrPayload.actions[key] = prop;
|
||
optionsForPlugin.actions[key] = prop;
|
||
} else if (isComputed(prop)) {
|
||
_hmrPayload.getters[key] = isOptionsStore ? options.getters[key] : prop;
|
||
if (IS_CLIENT) (setupStore._getters || (setupStore._getters = markRaw([]))).push(key);
|
||
}
|
||
}
|
||
/* istanbul ignore if */
|
||
assign(store, setupStore);
|
||
assign(toRaw$1(store), setupStore);
|
||
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);
|
||
});
|
||
}
|
||
});
|
||
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;
|
||
}
|
||
store[stateKey] = toRef(newStore.$state, stateKey);
|
||
});
|
||
Object.keys(store.$state).forEach((stateKey) => {
|
||
if (!(stateKey in newStore.$state)) delete 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 actionFn = newStore[actionName];
|
||
store[actionName] = action(actionFn, actionName);
|
||
}
|
||
for (const getterName in newStore._hmrPayload.getters) {
|
||
const getter = newStore._hmrPayload.getters[getterName];
|
||
store[getterName] = isOptionsStore ? computed(() => {
|
||
setActivePinia(pinia);
|
||
return getter.call(store, store);
|
||
}) : getter;
|
||
}
|
||
Object.keys(store._hmrPayload.getters).forEach((key) => {
|
||
if (!(key in newStore._hmrPayload.getters)) delete store[key];
|
||
});
|
||
Object.keys(store._hmrPayload.actions).forEach((key) => {
|
||
if (!(key in newStore._hmrPayload.actions)) delete store[key];
|
||
});
|
||
store._hmrPayload = newStore._hmrPayload;
|
||
store._getters = newStore._getters;
|
||
store._hotUpdating = false;
|
||
});
|
||
if (IS_CLIENT) {
|
||
const nonEnumerable = {
|
||
writable: true,
|
||
configurable: true,
|
||
enumerable: false
|
||
};
|
||
[
|
||
"_p",
|
||
"_hmrPayload",
|
||
"_getters",
|
||
"_customProperties"
|
||
].forEach((p) => {
|
||
Object.defineProperty(store, p, assign({ value: store[p] }, nonEnumerable));
|
||
});
|
||
}
|
||
pinia._p.forEach((extender) => {
|
||
/* istanbul ignore else */
|
||
if (IS_CLIENT) {
|
||
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;
|
||
}
|
||
/*! #__NO_SIDE_EFFECTS__ */
|
||
function defineStore(id, setup, setupOptions) {
|
||
let options;
|
||
const isSetupStore = typeof setup === "function";
|
||
options = isSetupStore ? setupOptions : setup;
|
||
function useStore(pinia, hot) {
|
||
const hasContext = hasInjectionContext();
|
||
pinia = 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)\"?\nSee https://pinia.vuejs.org/core-concepts/outside-component-usage.html for help.\nThis will fail in production.");
|
||
pinia = activePinia;
|
||
if (!pinia._s.has(id)) {
|
||
if (isSetupStore) createSetupStore(id, setup, options, pinia);
|
||
else createOptionsStore(id, options, pinia);
|
||
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 && !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";
|
||
/**
|
||
* 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) {
|
||
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:\nReplace\n mapStores([useAuthStore, useCartStore])\nwith\n mapStores(useAuthStore, useCartStore)\nThis 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;
|
||
}, {});
|
||
}
|
||
/**
|
||
* 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) => {
|
||
reduced[key] = function() {
|
||
const store = useStore(this.$pinia);
|
||
const storeKey = keysOrMapper[key];
|
||
return typeof storeKey === "function" ? storeKey.call(this, store) : store[storeKey];
|
||
};
|
||
return reduced;
|
||
}, {});
|
||
}
|
||
/**
|
||
* Alias for `mapState()`. You should use `mapState()` instead.
|
||
* @deprecated use `mapState()` instead.
|
||
*/
|
||
var 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) => {
|
||
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;
|
||
}, {});
|
||
}
|
||
/**
|
||
* 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) => {
|
||
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;
|
||
}, {});
|
||
}
|
||
/**
|
||
* 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) {
|
||
const rawStore = toRaw$1(store);
|
||
const refs = {};
|
||
for (const key in rawStore) {
|
||
const value = rawStore[key];
|
||
if (value.effect) refs[key] = computed({
|
||
get: () => store[key],
|
||
set(value) {
|
||
store[key] = value;
|
||
}
|
||
});
|
||
else if (isRef$1(value) || isReactive$1(value)) refs[key] = toRef(store, key);
|
||
}
|
||
return refs;
|
||
}
|
||
//#endregion
|
||
export { MutationType, acceptHMRUpdate, createPinia, defineStore, disposePinia, getActivePinia, mapActions, mapGetters, mapState, mapStores, mapWritableState, setActivePinia, setMapStoreSuffix, shouldHydrate, skipHydrate, storeToRefs };
|
||
|
||
//# sourceMappingURL=pinia.js.map
|