@vue/devtools-kit 7.4.4 → 7.4.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -27,9 +27,9 @@ var __toESM = (mod, isNodeMode, target22) => (target22 = mod != null ? __create(
27
27
  mod
28
28
  ));
29
29
 
30
- // ../../node_modules/.pnpm/tsup@8.2.4_@microsoft+api-extractor@7.43.0_@types+node@20.16.3__@swc+core@1.5.29_jiti@1.21.6__poim247rgdwcqyeqwscqjhxddq/node_modules/tsup/assets/esm_shims.js
30
+ // ../../node_modules/.pnpm/tsup@8.3.0_@microsoft+api-extractor@7.43.0_@types+node@20.16.5__@swc+core@1.5.29_jiti@1.21.6__ldnw4a7r4ccknnz6q542psuydy/node_modules/tsup/assets/esm_shims.js
31
31
  var init_esm_shims = __esm({
32
- "../../node_modules/.pnpm/tsup@8.2.4_@microsoft+api-extractor@7.43.0_@types+node@20.16.3__@swc+core@1.5.29_jiti@1.21.6__poim247rgdwcqyeqwscqjhxddq/node_modules/tsup/assets/esm_shims.js"() {
32
+ "../../node_modules/.pnpm/tsup@8.3.0_@microsoft+api-extractor@7.43.0_@types+node@20.16.5__@swc+core@1.5.29_jiti@1.21.6__ldnw4a7r4ccknnz6q542psuydy/node_modules/tsup/assets/esm_shims.js"() {
33
33
  "use strict";
34
34
  }
35
35
  });
@@ -1579,55 +1579,33 @@ init_esm_shims();
1579
1579
  init_esm_shims();
1580
1580
  import { isNuxtApp, target as target13 } from "@vue/devtools-shared";
1581
1581
 
1582
- // src/hook/index.ts
1583
- init_esm_shims();
1584
- import { target as target10 } from "@vue/devtools-shared";
1585
- import { createHooks as createHooks2 } from "hookable";
1586
-
1587
- // src/types/index.ts
1588
- init_esm_shims();
1589
-
1590
- // src/types/inspector.ts
1591
- init_esm_shims();
1592
-
1593
- // src/types/plugin.ts
1594
- init_esm_shims();
1595
-
1596
- // src/types/app.ts
1597
- init_esm_shims();
1598
-
1599
- // src/types/timeline.ts
1600
- init_esm_shims();
1601
-
1602
- // src/types/component.ts
1603
- init_esm_shims();
1604
-
1605
- // src/types/hook.ts
1606
- init_esm_shims();
1607
-
1608
- // src/types/tab.ts
1609
- init_esm_shims();
1610
-
1611
- // src/types/command.ts
1612
- init_esm_shims();
1613
-
1614
- // src/types/router.ts
1582
+ // src/compat/index.ts
1615
1583
  init_esm_shims();
1584
+ import { target } from "@vue/devtools-shared";
1585
+ function onLegacyDevToolsPluginApiAvailable(cb) {
1586
+ if (target.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__) {
1587
+ cb();
1588
+ return;
1589
+ }
1590
+ Object.defineProperty(target, "__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__", {
1591
+ set(value) {
1592
+ if (value)
1593
+ cb();
1594
+ },
1595
+ configurable: true
1596
+ });
1597
+ }
1616
1598
 
1617
1599
  // src/ctx/index.ts
1618
1600
  init_esm_shims();
1619
- import { target as target9 } from "@vue/devtools-shared";
1620
-
1621
- // src/ctx/hook.ts
1622
- init_esm_shims();
1623
- import { createHooks } from "hookable";
1601
+ import { target as target11 } from "@vue/devtools-shared";
1624
1602
 
1625
- // src/core/component-highlighter/index.ts
1603
+ // src/ctx/api.ts
1626
1604
  init_esm_shims();
1605
+ import { target as target9 } from "@vue/devtools-shared";
1627
1606
 
1628
- // src/core/component/utils/index.ts
1607
+ // src/core/component/state/editor.ts
1629
1608
  init_esm_shims();
1630
- import { basename, classify } from "@vue/devtools-shared";
1631
1609
 
1632
1610
  // src/shared/stub-vue.ts
1633
1611
  init_esm_shims();
@@ -1650,6 +1628,8 @@ function toRaw(observed) {
1650
1628
  var Fragment = Symbol.for("v-fgt");
1651
1629
 
1652
1630
  // src/core/component/utils/index.ts
1631
+ init_esm_shims();
1632
+ import { basename, classify } from "@vue/devtools-shared";
1653
1633
  function getComponentTypeName(options) {
1654
1634
  return options.name || options._componentTag || options.__VUE_DEVTOOLS_COMPONENT_GUSSED_NAME__ || options.__name;
1655
1635
  }
@@ -1749,6 +1729,146 @@ function ensurePropertyExists(obj, key, skipObjCheck = false) {
1749
1729
  return skipObjCheck ? key in obj : typeof obj === "object" && obj !== null ? key in obj : false;
1750
1730
  }
1751
1731
 
1732
+ // src/core/component/state/editor.ts
1733
+ var StateEditor = class {
1734
+ constructor() {
1735
+ this.refEditor = new RefStateEditor();
1736
+ }
1737
+ set(object, path, value, cb) {
1738
+ const sections = Array.isArray(path) ? path : path.split(".");
1739
+ const markRef = false;
1740
+ while (sections.length > 1) {
1741
+ const section = sections.shift();
1742
+ if (object instanceof Map)
1743
+ object = object.get(section);
1744
+ if (object instanceof Set)
1745
+ object = Array.from(object.values())[section];
1746
+ else object = object[section];
1747
+ if (this.refEditor.isRef(object))
1748
+ object = this.refEditor.get(object);
1749
+ }
1750
+ const field = sections[0];
1751
+ const item = this.refEditor.get(object)[field];
1752
+ if (cb) {
1753
+ cb(object, field, value);
1754
+ } else {
1755
+ if (this.refEditor.isRef(item))
1756
+ this.refEditor.set(item, value);
1757
+ else if (markRef)
1758
+ object[field] = value;
1759
+ else
1760
+ object[field] = value;
1761
+ }
1762
+ }
1763
+ get(object, path) {
1764
+ const sections = Array.isArray(path) ? path : path.split(".");
1765
+ for (let i = 0; i < sections.length; i++) {
1766
+ if (object instanceof Map)
1767
+ object = object.get(sections[i]);
1768
+ else
1769
+ object = object[sections[i]];
1770
+ if (this.refEditor.isRef(object))
1771
+ object = this.refEditor.get(object);
1772
+ if (!object)
1773
+ return void 0;
1774
+ }
1775
+ return object;
1776
+ }
1777
+ has(object, path, parent = false) {
1778
+ if (typeof object === "undefined")
1779
+ return false;
1780
+ const sections = Array.isArray(path) ? path.slice() : path.split(".");
1781
+ const size = !parent ? 1 : 2;
1782
+ while (object && sections.length > size) {
1783
+ const section = sections.shift();
1784
+ object = object[section];
1785
+ if (this.refEditor.isRef(object))
1786
+ object = this.refEditor.get(object);
1787
+ }
1788
+ return object != null && Object.prototype.hasOwnProperty.call(object, sections[0]);
1789
+ }
1790
+ createDefaultSetCallback(state) {
1791
+ return (object, field, value) => {
1792
+ if (state.remove || state.newKey) {
1793
+ if (Array.isArray(object))
1794
+ object.splice(field, 1);
1795
+ else if (toRaw(object) instanceof Map)
1796
+ object.delete(field);
1797
+ else if (toRaw(object) instanceof Set)
1798
+ object.delete(Array.from(object.values())[field]);
1799
+ else Reflect.deleteProperty(object, field);
1800
+ }
1801
+ if (!state.remove) {
1802
+ const target22 = object[state.newKey || field];
1803
+ if (this.refEditor.isRef(target22))
1804
+ this.refEditor.set(target22, value);
1805
+ else if (toRaw(object) instanceof Map)
1806
+ object.set(state.newKey || field, value);
1807
+ else if (toRaw(object) instanceof Set)
1808
+ object.add(value);
1809
+ else
1810
+ object[state.newKey || field] = value;
1811
+ }
1812
+ };
1813
+ }
1814
+ };
1815
+ var RefStateEditor = class {
1816
+ set(ref, value) {
1817
+ if (isRef(ref)) {
1818
+ ref.value = value;
1819
+ } else {
1820
+ if (ref instanceof Set && Array.isArray(value)) {
1821
+ ref.clear();
1822
+ value.forEach((v) => ref.add(v));
1823
+ return;
1824
+ }
1825
+ const currentKeys = Object.keys(value);
1826
+ if (ref instanceof Map) {
1827
+ const previousKeysSet2 = new Set(ref.keys());
1828
+ currentKeys.forEach((key) => {
1829
+ ref.set(key, Reflect.get(value, key));
1830
+ previousKeysSet2.delete(key);
1831
+ });
1832
+ previousKeysSet2.forEach((key) => ref.delete(key));
1833
+ return;
1834
+ }
1835
+ const previousKeysSet = new Set(Object.keys(ref));
1836
+ currentKeys.forEach((key) => {
1837
+ Reflect.set(ref, key, Reflect.get(value, key));
1838
+ previousKeysSet.delete(key);
1839
+ });
1840
+ previousKeysSet.forEach((key) => Reflect.deleteProperty(ref, key));
1841
+ }
1842
+ }
1843
+ get(ref) {
1844
+ return isRef(ref) ? ref.value : ref;
1845
+ }
1846
+ isRef(ref) {
1847
+ return isRef(ref) || isReactive(ref);
1848
+ }
1849
+ };
1850
+ async function editComponentState(payload, stateEditor2) {
1851
+ const { path, nodeId, state, type } = payload;
1852
+ const instance = getComponentInstance(activeAppRecord.value, nodeId);
1853
+ if (!instance)
1854
+ return;
1855
+ const targetPath = path.slice();
1856
+ let target22;
1857
+ if (instance.devtoolsRawSetupState && Object.keys(instance.devtoolsRawSetupState).includes(path[0]))
1858
+ target22 = instance.devtoolsRawSetupState;
1859
+ if (instance.data && Object.keys(instance.data).includes(path[0]))
1860
+ target22 = instance.data;
1861
+ if (target22 && targetPath) {
1862
+ if (state.type === "object" && type === "reactive") {
1863
+ }
1864
+ stateEditor2.set(target22, targetPath, state.value, stateEditor2.createDefaultSetCallback(state));
1865
+ }
1866
+ }
1867
+ var stateEditor = new StateEditor();
1868
+ async function editState(payload) {
1869
+ editComponentState(payload, stateEditor);
1870
+ }
1871
+
1752
1872
  // src/core/component/tree/el.ts
1753
1873
  init_esm_shims();
1754
1874
  function getRootElementsFromComponentInstance(instance) {
@@ -1771,6 +1891,9 @@ function getFragmentRootElements(vnode) {
1771
1891
  return list;
1772
1892
  }
1773
1893
 
1894
+ // src/core/component-highlighter/index.ts
1895
+ init_esm_shims();
1896
+
1774
1897
  // src/core/component/state/bounding-rect.ts
1775
1898
  init_esm_shims();
1776
1899
  function createRect() {
@@ -2060,194 +2183,75 @@ function scrollToComponent(options) {
2060
2183
  }
2061
2184
  }
2062
2185
 
2063
- // src/ctx/inspector.ts
2186
+ // src/core/component-inspector/index.ts
2064
2187
  init_esm_shims();
2065
2188
  import { target as target2 } from "@vue/devtools-shared";
2066
- import { debounce as debounce2 } from "perfect-debounce";
2189
+ var _a, _b;
2190
+ (_b = (_a = target2).__VUE_DEVTOOLS_COMPONENT_INSPECTOR_ENABLED__) != null ? _b : _a.__VUE_DEVTOOLS_COMPONENT_INSPECTOR_ENABLED__ = true;
2191
+ function toggleComponentInspectorEnabled(enabled) {
2192
+ target2.__VUE_DEVTOOLS_COMPONENT_INSPECTOR_ENABLED__ = enabled;
2193
+ }
2194
+ function waitForInspectorInit(cb) {
2195
+ let total = 0;
2196
+ const timer = setInterval(() => {
2197
+ if (target2.__VUE_INSPECTOR__) {
2198
+ clearInterval(timer);
2199
+ total += 30;
2200
+ cb();
2201
+ }
2202
+ if (total >= /* 5s */
2203
+ 5e3)
2204
+ clearInterval(timer);
2205
+ }, 30);
2206
+ }
2207
+ function setupInspector() {
2208
+ const inspector = target2.__VUE_INSPECTOR__;
2209
+ const _openInEditor = inspector.openInEditor;
2210
+ inspector.openInEditor = async (...params) => {
2211
+ inspector.disable();
2212
+ _openInEditor(...params);
2213
+ };
2214
+ }
2215
+ function getComponentInspector() {
2216
+ return new Promise((resolve) => {
2217
+ function setup() {
2218
+ setupInspector();
2219
+ resolve(target2.__VUE_INSPECTOR__);
2220
+ }
2221
+ if (!target2.__VUE_INSPECTOR__) {
2222
+ waitForInspectorInit(() => {
2223
+ setup();
2224
+ });
2225
+ } else {
2226
+ setup();
2227
+ }
2228
+ });
2229
+ }
2230
+
2231
+ // src/core/open-in-editor/index.ts
2232
+ init_esm_shims();
2233
+ import { target as target5 } from "@vue/devtools-shared";
2067
2234
 
2068
2235
  // src/ctx/state.ts
2069
2236
  init_esm_shims();
2070
2237
  import { target as global, isUrlString } from "@vue/devtools-shared";
2238
+ import { debounce as debounce2 } from "perfect-debounce";
2239
+
2240
+ // src/ctx/hook.ts
2241
+ init_esm_shims();
2242
+ import { createHooks } from "hookable";
2243
+
2244
+ // src/ctx/inspector.ts
2245
+ init_esm_shims();
2246
+ import { target as target4 } from "@vue/devtools-shared";
2071
2247
  import { debounce } from "perfect-debounce";
2072
- var _a, _b;
2073
- (_b = (_a = global).__VUE_DEVTOOLS_KIT_APP_RECORDS__) != null ? _b : _a.__VUE_DEVTOOLS_KIT_APP_RECORDS__ = [];
2074
- var _a2, _b2;
2075
- (_b2 = (_a2 = global).__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__) != null ? _b2 : _a2.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__ = {};
2076
- var _a3, _b3;
2077
- (_b3 = (_a3 = global).__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD_ID__) != null ? _b3 : _a3.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD_ID__ = "";
2078
- var _a4, _b4;
2079
- (_b4 = (_a4 = global).__VUE_DEVTOOLS_KIT_CUSTOM_TABS__) != null ? _b4 : _a4.__VUE_DEVTOOLS_KIT_CUSTOM_TABS__ = [];
2080
- var _a5, _b5;
2081
- (_b5 = (_a5 = global).__VUE_DEVTOOLS_KIT_CUSTOM_COMMANDS__) != null ? _b5 : _a5.__VUE_DEVTOOLS_KIT_CUSTOM_COMMANDS__ = [];
2082
- var STATE_KEY = "__VUE_DEVTOOLS_KIT_GLOBAL_STATE__";
2083
- function initStateFactory() {
2084
- return {
2085
- connected: false,
2086
- clientConnected: false,
2087
- vitePluginDetected: true,
2088
- appRecords: [],
2089
- activeAppRecordId: "",
2090
- tabs: [],
2091
- commands: [],
2092
- highPerfModeEnabled: true,
2093
- devtoolsClientDetected: {}
2094
- };
2095
- }
2096
- var _a6, _b6;
2097
- (_b6 = (_a6 = global)[STATE_KEY]) != null ? _b6 : _a6[STATE_KEY] = initStateFactory();
2098
- var callStateUpdatedHook = debounce((state) => {
2099
- devtoolsContext.hooks.callHook("devtoolsStateUpdated" /* DEVTOOLS_STATE_UPDATED */, { state });
2100
- });
2101
- var callConnectedUpdatedHook = debounce((state, oldState) => {
2102
- devtoolsContext.hooks.callHook("devtoolsConnectedUpdated" /* DEVTOOLS_CONNECTED_UPDATED */, { state, oldState });
2103
- });
2104
- var devtoolsAppRecords = new Proxy(global.__VUE_DEVTOOLS_KIT_APP_RECORDS__, {
2105
- get(_target, prop, receiver) {
2106
- if (prop === "value")
2107
- return global.__VUE_DEVTOOLS_KIT_APP_RECORDS__;
2108
- return global.__VUE_DEVTOOLS_KIT_APP_RECORDS__[prop];
2109
- }
2110
- });
2111
- var addDevToolsAppRecord = (app) => {
2112
- global.__VUE_DEVTOOLS_KIT_APP_RECORDS__ = [
2113
- ...global.__VUE_DEVTOOLS_KIT_APP_RECORDS__,
2114
- app
2115
- ];
2116
- };
2117
- var removeDevToolsAppRecord = (app) => {
2118
- global.__VUE_DEVTOOLS_KIT_APP_RECORDS__ = devtoolsAppRecords.value.filter((record) => record.app !== app);
2119
- };
2120
- var activeAppRecord = new Proxy(global.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__, {
2121
- get(_target, prop, receiver) {
2122
- if (prop === "value")
2123
- return global.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__;
2124
- else if (prop === "id")
2125
- return global.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD_ID__;
2126
- return global.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__[prop];
2127
- }
2128
- });
2129
- function updateAllStates() {
2130
- callStateUpdatedHook({
2131
- ...global[STATE_KEY],
2132
- appRecords: devtoolsAppRecords.value,
2133
- activeAppRecordId: activeAppRecord.id,
2134
- tabs: global.__VUE_DEVTOOLS_KIT_CUSTOM_TABS__,
2135
- commands: global.__VUE_DEVTOOLS_KIT_CUSTOM_COMMANDS__
2136
- });
2137
- }
2138
- function setActiveAppRecord(app) {
2139
- global.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__ = app;
2140
- updateAllStates();
2141
- }
2142
- function setActiveAppRecordId(id) {
2143
- global.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD_ID__ = id;
2144
- updateAllStates();
2145
- }
2146
- var devtoolsState = new Proxy(global[STATE_KEY], {
2147
- get(target22, property) {
2148
- if (property === "appRecords") {
2149
- return devtoolsAppRecords;
2150
- } else if (property === "activeAppRecordId") {
2151
- return activeAppRecord.id;
2152
- } else if (property === "tabs") {
2153
- return global.__VUE_DEVTOOLS_KIT_CUSTOM_TABS__;
2154
- } else if (property === "commands") {
2155
- return global.__VUE_DEVTOOLS_KIT_CUSTOM_COMMANDS__;
2156
- }
2157
- return global[STATE_KEY][property];
2158
- },
2159
- deleteProperty(target22, property) {
2160
- delete target22[property];
2161
- return true;
2162
- },
2163
- set(target22, property, value) {
2164
- const oldState = { ...global[STATE_KEY] };
2165
- target22[property] = value;
2166
- global[STATE_KEY][property] = value;
2167
- return true;
2168
- }
2169
- });
2170
- function resetDevToolsState() {
2171
- Object.assign(global[STATE_KEY], initStateFactory());
2172
- }
2173
- function updateDevToolsState(state) {
2174
- const oldState = {
2175
- ...global[STATE_KEY],
2176
- appRecords: devtoolsAppRecords.value,
2177
- activeAppRecordId: activeAppRecord.id
2178
- };
2179
- if (oldState.connected !== state.connected && state.connected || oldState.clientConnected !== state.clientConnected && state.clientConnected) {
2180
- callConnectedUpdatedHook(global[STATE_KEY], oldState);
2181
- }
2182
- Object.assign(global[STATE_KEY], state);
2183
- updateAllStates();
2184
- }
2185
- function onDevToolsConnected(fn) {
2186
- return new Promise((resolve) => {
2187
- if (devtoolsState.connected) {
2188
- fn();
2189
- resolve();
2190
- }
2191
- devtoolsContext.hooks.hook("devtoolsConnectedUpdated" /* DEVTOOLS_CONNECTED_UPDATED */, ({ state }) => {
2192
- if (state.connected) {
2193
- fn();
2194
- resolve();
2195
- }
2196
- });
2197
- });
2198
- }
2199
- var resolveIcon = (icon) => {
2200
- if (!icon)
2201
- return;
2202
- if (icon.startsWith("baseline-")) {
2203
- return `custom-ic-${icon}`;
2204
- }
2205
- if (icon.startsWith("i-") || isUrlString(icon))
2206
- return icon;
2207
- return `custom-ic-baseline-${icon}`;
2208
- };
2209
- function addCustomTab(tab) {
2210
- const tabs = global.__VUE_DEVTOOLS_KIT_CUSTOM_TABS__;
2211
- if (tabs.some((t) => t.name === tab.name))
2212
- return;
2213
- tabs.push({
2214
- ...tab,
2215
- icon: resolveIcon(tab.icon)
2216
- });
2217
- updateAllStates();
2218
- }
2219
- function addCustomCommand(action) {
2220
- const commands = global.__VUE_DEVTOOLS_KIT_CUSTOM_COMMANDS__;
2221
- if (commands.some((t) => t.id === action.id))
2222
- return;
2223
- commands.push({
2224
- ...action,
2225
- icon: resolveIcon(action.icon),
2226
- children: action.children ? action.children.map((child) => ({
2227
- ...child,
2228
- icon: resolveIcon(child.icon)
2229
- })) : void 0
2230
- });
2231
- updateAllStates();
2232
- }
2233
- function removeCustomCommand(actionId) {
2234
- const commands = global.__VUE_DEVTOOLS_KIT_CUSTOM_COMMANDS__;
2235
- const index = commands.findIndex((t) => t.id === actionId);
2236
- if (index === -1)
2237
- return;
2238
- commands.splice(index, 1);
2239
- updateAllStates();
2240
- }
2241
- function toggleClientConnected(state) {
2242
- updateDevToolsState({ clientConnected: state });
2243
- }
2244
2248
 
2245
2249
  // src/ctx/timeline.ts
2246
2250
  init_esm_shims();
2247
- import { target } from "@vue/devtools-shared";
2248
- var _a7, _b7;
2249
- (_b7 = (_a7 = target).__VUE_DEVTOOLS_KIT_TIMELINE_LAYERS) != null ? _b7 : _a7.__VUE_DEVTOOLS_KIT_TIMELINE_LAYERS = [];
2250
- var devtoolsTimelineLayers = new Proxy(target.__VUE_DEVTOOLS_KIT_TIMELINE_LAYERS, {
2251
+ import { target as target3 } from "@vue/devtools-shared";
2252
+ var _a2, _b2;
2253
+ (_b2 = (_a2 = target3).__VUE_DEVTOOLS_KIT_TIMELINE_LAYERS) != null ? _b2 : _a2.__VUE_DEVTOOLS_KIT_TIMELINE_LAYERS = [];
2254
+ var devtoolsTimelineLayers = new Proxy(target3.__VUE_DEVTOOLS_KIT_TIMELINE_LAYERS, {
2251
2255
  get(target22, prop, receiver) {
2252
2256
  return Reflect.get(target22, prop, receiver);
2253
2257
  }
@@ -2261,14 +2265,14 @@ function addTimelineLayer(options, descriptor) {
2261
2265
  }
2262
2266
 
2263
2267
  // src/ctx/inspector.ts
2264
- var _a8, _b8;
2265
- (_b8 = (_a8 = target2).__VUE_DEVTOOLS_KIT_INSPECTOR__) != null ? _b8 : _a8.__VUE_DEVTOOLS_KIT_INSPECTOR__ = [];
2266
- var devtoolsInspector = new Proxy(target2.__VUE_DEVTOOLS_KIT_INSPECTOR__, {
2268
+ var _a3, _b3;
2269
+ (_b3 = (_a3 = target4).__VUE_DEVTOOLS_KIT_INSPECTOR__) != null ? _b3 : _a3.__VUE_DEVTOOLS_KIT_INSPECTOR__ = [];
2270
+ var devtoolsInspector = new Proxy(target4.__VUE_DEVTOOLS_KIT_INSPECTOR__, {
2267
2271
  get(target22, prop, receiver) {
2268
2272
  return Reflect.get(target22, prop, receiver);
2269
2273
  }
2270
2274
  });
2271
- var callInspectorUpdatedHook = debounce2(() => {
2275
+ var callInspectorUpdatedHook = debounce(() => {
2272
2276
  devtoolsContext.hooks.callHook("sendInspectorToClient" /* SEND_INSPECTOR_TO_CLIENT */, getActiveInspectors());
2273
2277
  });
2274
2278
  function addInspector(inspector, descriptor) {
@@ -2292,7 +2296,8 @@ function getActiveInspectors() {
2292
2296
  logo: descriptor.logo,
2293
2297
  icon: `custom-ic-baseline-${(_a25 = options == null ? void 0 : options.icon) == null ? void 0 : _a25.replace(/_/g, "-")}`,
2294
2298
  packageName: descriptor.packageName,
2295
- homepage: descriptor.homepage
2299
+ homepage: descriptor.homepage,
2300
+ pluginId: descriptor.id
2296
2301
  };
2297
2302
  });
2298
2303
  }
@@ -2467,156 +2472,183 @@ function createDevToolsCtxHooks() {
2467
2472
  return hooks2;
2468
2473
  }
2469
2474
 
2470
- // src/ctx/api.ts
2471
- init_esm_shims();
2472
- import { target as target7 } from "@vue/devtools-shared";
2473
-
2474
- // src/core/component/state/editor.ts
2475
- init_esm_shims();
2476
- var StateEditor = class {
2477
- constructor() {
2478
- this.refEditor = new RefStateEditor();
2475
+ // src/ctx/state.ts
2476
+ var _a4, _b4;
2477
+ (_b4 = (_a4 = global).__VUE_DEVTOOLS_KIT_APP_RECORDS__) != null ? _b4 : _a4.__VUE_DEVTOOLS_KIT_APP_RECORDS__ = [];
2478
+ var _a5, _b5;
2479
+ (_b5 = (_a5 = global).__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__) != null ? _b5 : _a5.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__ = {};
2480
+ var _a6, _b6;
2481
+ (_b6 = (_a6 = global).__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD_ID__) != null ? _b6 : _a6.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD_ID__ = "";
2482
+ var _a7, _b7;
2483
+ (_b7 = (_a7 = global).__VUE_DEVTOOLS_KIT_CUSTOM_TABS__) != null ? _b7 : _a7.__VUE_DEVTOOLS_KIT_CUSTOM_TABS__ = [];
2484
+ var _a8, _b8;
2485
+ (_b8 = (_a8 = global).__VUE_DEVTOOLS_KIT_CUSTOM_COMMANDS__) != null ? _b8 : _a8.__VUE_DEVTOOLS_KIT_CUSTOM_COMMANDS__ = [];
2486
+ var STATE_KEY = "__VUE_DEVTOOLS_KIT_GLOBAL_STATE__";
2487
+ function initStateFactory() {
2488
+ return {
2489
+ connected: false,
2490
+ clientConnected: false,
2491
+ vitePluginDetected: true,
2492
+ appRecords: [],
2493
+ activeAppRecordId: "",
2494
+ tabs: [],
2495
+ commands: [],
2496
+ highPerfModeEnabled: true,
2497
+ devtoolsClientDetected: {}
2498
+ };
2499
+ }
2500
+ var _a9, _b9;
2501
+ (_b9 = (_a9 = global)[STATE_KEY]) != null ? _b9 : _a9[STATE_KEY] = initStateFactory();
2502
+ var callStateUpdatedHook = debounce2((state) => {
2503
+ devtoolsContext.hooks.callHook("devtoolsStateUpdated" /* DEVTOOLS_STATE_UPDATED */, { state });
2504
+ });
2505
+ var callConnectedUpdatedHook = debounce2((state, oldState) => {
2506
+ devtoolsContext.hooks.callHook("devtoolsConnectedUpdated" /* DEVTOOLS_CONNECTED_UPDATED */, { state, oldState });
2507
+ });
2508
+ var devtoolsAppRecords = new Proxy(global.__VUE_DEVTOOLS_KIT_APP_RECORDS__, {
2509
+ get(_target, prop, receiver) {
2510
+ if (prop === "value")
2511
+ return global.__VUE_DEVTOOLS_KIT_APP_RECORDS__;
2512
+ return global.__VUE_DEVTOOLS_KIT_APP_RECORDS__[prop];
2479
2513
  }
2480
- set(object, path, value, cb) {
2481
- const sections = Array.isArray(path) ? path : path.split(".");
2482
- const markRef = false;
2483
- while (sections.length > 1) {
2484
- const section = sections.shift();
2485
- if (object instanceof Map)
2486
- object = object.get(section);
2487
- if (object instanceof Set)
2488
- object = Array.from(object.values())[section];
2489
- else object = object[section];
2490
- if (this.refEditor.isRef(object))
2491
- object = this.refEditor.get(object);
2492
- }
2493
- const field = sections[0];
2494
- const item = this.refEditor.get(object)[field];
2495
- if (cb) {
2496
- cb(object, field, value);
2497
- } else {
2498
- if (this.refEditor.isRef(item))
2499
- this.refEditor.set(item, value);
2500
- else if (markRef)
2501
- object[field] = value;
2502
- else
2503
- object[field] = value;
2504
- }
2514
+ });
2515
+ var addDevToolsAppRecord = (app) => {
2516
+ global.__VUE_DEVTOOLS_KIT_APP_RECORDS__ = [
2517
+ ...global.__VUE_DEVTOOLS_KIT_APP_RECORDS__,
2518
+ app
2519
+ ];
2520
+ };
2521
+ var removeDevToolsAppRecord = (app) => {
2522
+ global.__VUE_DEVTOOLS_KIT_APP_RECORDS__ = devtoolsAppRecords.value.filter((record) => record.app !== app);
2523
+ };
2524
+ var activeAppRecord = new Proxy(global.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__, {
2525
+ get(_target, prop, receiver) {
2526
+ if (prop === "value")
2527
+ return global.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__;
2528
+ else if (prop === "id")
2529
+ return global.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD_ID__;
2530
+ return global.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__[prop];
2505
2531
  }
2506
- get(object, path) {
2507
- const sections = Array.isArray(path) ? path : path.split(".");
2508
- for (let i = 0; i < sections.length; i++) {
2509
- if (object instanceof Map)
2510
- object = object.get(sections[i]);
2511
- else
2512
- object = object[sections[i]];
2513
- if (this.refEditor.isRef(object))
2514
- object = this.refEditor.get(object);
2515
- if (!object)
2516
- return void 0;
2517
- }
2518
- return object;
2519
- }
2520
- has(object, path, parent = false) {
2521
- if (typeof object === "undefined")
2522
- return false;
2523
- const sections = Array.isArray(path) ? path.slice() : path.split(".");
2524
- const size = !parent ? 1 : 2;
2525
- while (object && sections.length > size) {
2526
- const section = sections.shift();
2527
- object = object[section];
2528
- if (this.refEditor.isRef(object))
2529
- object = this.refEditor.get(object);
2532
+ });
2533
+ function updateAllStates() {
2534
+ callStateUpdatedHook({
2535
+ ...global[STATE_KEY],
2536
+ appRecords: devtoolsAppRecords.value,
2537
+ activeAppRecordId: activeAppRecord.id,
2538
+ tabs: global.__VUE_DEVTOOLS_KIT_CUSTOM_TABS__,
2539
+ commands: global.__VUE_DEVTOOLS_KIT_CUSTOM_COMMANDS__
2540
+ });
2541
+ }
2542
+ function setActiveAppRecord(app) {
2543
+ global.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__ = app;
2544
+ updateAllStates();
2545
+ }
2546
+ function setActiveAppRecordId(id) {
2547
+ global.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD_ID__ = id;
2548
+ updateAllStates();
2549
+ }
2550
+ var devtoolsState = new Proxy(global[STATE_KEY], {
2551
+ get(target22, property) {
2552
+ if (property === "appRecords") {
2553
+ return devtoolsAppRecords;
2554
+ } else if (property === "activeAppRecordId") {
2555
+ return activeAppRecord.id;
2556
+ } else if (property === "tabs") {
2557
+ return global.__VUE_DEVTOOLS_KIT_CUSTOM_TABS__;
2558
+ } else if (property === "commands") {
2559
+ return global.__VUE_DEVTOOLS_KIT_CUSTOM_COMMANDS__;
2530
2560
  }
2531
- return object != null && Object.prototype.hasOwnProperty.call(object, sections[0]);
2561
+ return global[STATE_KEY][property];
2562
+ },
2563
+ deleteProperty(target22, property) {
2564
+ delete target22[property];
2565
+ return true;
2566
+ },
2567
+ set(target22, property, value) {
2568
+ const oldState = { ...global[STATE_KEY] };
2569
+ target22[property] = value;
2570
+ global[STATE_KEY][property] = value;
2571
+ return true;
2532
2572
  }
2533
- createDefaultSetCallback(state) {
2534
- return (object, field, value) => {
2535
- if (state.remove || state.newKey) {
2536
- if (Array.isArray(object))
2537
- object.splice(field, 1);
2538
- else if (toRaw(object) instanceof Map)
2539
- object.delete(field);
2540
- else if (toRaw(object) instanceof Set)
2541
- object.delete(Array.from(object.values())[field]);
2542
- else Reflect.deleteProperty(object, field);
2543
- }
2544
- if (!state.remove) {
2545
- const target22 = object[state.newKey || field];
2546
- if (this.refEditor.isRef(target22))
2547
- this.refEditor.set(target22, value);
2548
- else if (toRaw(object) instanceof Map)
2549
- object.set(state.newKey || field, value);
2550
- else if (toRaw(object) instanceof Set)
2551
- object.add(value);
2552
- else
2553
- object[state.newKey || field] = value;
2554
- }
2555
- };
2573
+ });
2574
+ function resetDevToolsState() {
2575
+ Object.assign(global[STATE_KEY], initStateFactory());
2576
+ }
2577
+ function updateDevToolsState(state) {
2578
+ const oldState = {
2579
+ ...global[STATE_KEY],
2580
+ appRecords: devtoolsAppRecords.value,
2581
+ activeAppRecordId: activeAppRecord.id
2582
+ };
2583
+ if (oldState.connected !== state.connected && state.connected || oldState.clientConnected !== state.clientConnected && state.clientConnected) {
2584
+ callConnectedUpdatedHook(global[STATE_KEY], oldState);
2556
2585
  }
2557
- };
2558
- var RefStateEditor = class {
2559
- set(ref, value) {
2560
- if (isRef(ref)) {
2561
- ref.value = value;
2562
- } else {
2563
- if (ref instanceof Set && Array.isArray(value)) {
2564
- ref.clear();
2565
- value.forEach((v) => ref.add(v));
2566
- return;
2567
- }
2568
- const currentKeys = Object.keys(value);
2569
- if (ref instanceof Map) {
2570
- const previousKeysSet2 = new Set(ref.keys());
2571
- currentKeys.forEach((key) => {
2572
- ref.set(key, Reflect.get(value, key));
2573
- previousKeysSet2.delete(key);
2574
- });
2575
- previousKeysSet2.forEach((key) => ref.delete(key));
2576
- return;
2577
- }
2578
- const previousKeysSet = new Set(Object.keys(ref));
2579
- currentKeys.forEach((key) => {
2580
- Reflect.set(ref, key, Reflect.get(value, key));
2581
- previousKeysSet.delete(key);
2582
- });
2583
- previousKeysSet.forEach((key) => Reflect.deleteProperty(ref, key));
2586
+ Object.assign(global[STATE_KEY], state);
2587
+ updateAllStates();
2588
+ }
2589
+ function onDevToolsConnected(fn) {
2590
+ return new Promise((resolve) => {
2591
+ if (devtoolsState.connected) {
2592
+ fn();
2593
+ resolve();
2584
2594
  }
2595
+ devtoolsContext.hooks.hook("devtoolsConnectedUpdated" /* DEVTOOLS_CONNECTED_UPDATED */, ({ state }) => {
2596
+ if (state.connected) {
2597
+ fn();
2598
+ resolve();
2599
+ }
2600
+ });
2601
+ });
2602
+ }
2603
+ var resolveIcon = (icon) => {
2604
+ if (!icon)
2605
+ return;
2606
+ if (icon.startsWith("baseline-")) {
2607
+ return `custom-ic-${icon}`;
2585
2608
  }
2586
- get(ref) {
2587
- return isRef(ref) ? ref.value : ref;
2588
- }
2589
- isRef(ref) {
2590
- return isRef(ref) || isReactive(ref);
2591
- }
2609
+ if (icon.startsWith("i-") || isUrlString(icon))
2610
+ return icon;
2611
+ return `custom-ic-baseline-${icon}`;
2592
2612
  };
2593
- async function editComponentState(payload, stateEditor2) {
2594
- const { path, nodeId, state, type } = payload;
2595
- const instance = getComponentInstance(activeAppRecord.value, nodeId);
2596
- if (!instance)
2613
+ function addCustomTab(tab) {
2614
+ const tabs = global.__VUE_DEVTOOLS_KIT_CUSTOM_TABS__;
2615
+ if (tabs.some((t) => t.name === tab.name))
2597
2616
  return;
2598
- const targetPath = path.slice();
2599
- let target22;
2600
- if (instance.devtoolsRawSetupState && Object.keys(instance.devtoolsRawSetupState).includes(path[0]))
2601
- target22 = instance.devtoolsRawSetupState;
2602
- if (instance.data && Object.keys(instance.data).includes(path[0]))
2603
- target22 = instance.data;
2604
- if (target22 && targetPath) {
2605
- if (state.type === "object" && type === "reactive") {
2606
- }
2607
- stateEditor2.set(target22, targetPath, state.value, stateEditor2.createDefaultSetCallback(state));
2608
- }
2617
+ tabs.push({
2618
+ ...tab,
2619
+ icon: resolveIcon(tab.icon)
2620
+ });
2621
+ updateAllStates();
2609
2622
  }
2610
- var stateEditor = new StateEditor();
2611
- async function editState(payload) {
2612
- editComponentState(payload, stateEditor);
2623
+ function addCustomCommand(action) {
2624
+ const commands = global.__VUE_DEVTOOLS_KIT_CUSTOM_COMMANDS__;
2625
+ if (commands.some((t) => t.id === action.id))
2626
+ return;
2627
+ commands.push({
2628
+ ...action,
2629
+ icon: resolveIcon(action.icon),
2630
+ children: action.children ? action.children.map((child) => ({
2631
+ ...child,
2632
+ icon: resolveIcon(child.icon)
2633
+ })) : void 0
2634
+ });
2635
+ updateAllStates();
2636
+ }
2637
+ function removeCustomCommand(actionId) {
2638
+ const commands = global.__VUE_DEVTOOLS_KIT_CUSTOM_COMMANDS__;
2639
+ const index = commands.findIndex((t) => t.id === actionId);
2640
+ if (index === -1)
2641
+ return;
2642
+ commands.splice(index, 1);
2643
+ updateAllStates();
2644
+ }
2645
+ function toggleClientConnected(state) {
2646
+ updateDevToolsState({ clientConnected: state });
2613
2647
  }
2614
2648
 
2615
2649
  // src/core/open-in-editor/index.ts
2616
- init_esm_shims();
2617
- import { target as target3 } from "@vue/devtools-shared";
2618
2650
  function setOpenInEditorBaseUrl(url) {
2619
- target3.__VUE_DEVTOOLS_OPEN_IN_EDITOR_BASE_URL__ = url;
2651
+ target5.__VUE_DEVTOOLS_OPEN_IN_EDITOR_BASE_URL__ = url;
2620
2652
  }
2621
2653
  function openInEditor(options = {}) {
2622
2654
  var _a25, _b25, _c;
@@ -2632,150 +2664,15 @@ function openInEditor(options = {}) {
2632
2664
  }
2633
2665
  });
2634
2666
  } else if (devtoolsState.vitePluginDetected) {
2635
- const _baseUrl = (_c = target3.__VUE_DEVTOOLS_OPEN_IN_EDITOR_BASE_URL__) != null ? _c : baseUrl;
2636
- target3.__VUE_INSPECTOR__.openInEditor(_baseUrl, file, line, column);
2637
- }
2638
- }
2639
- }
2640
-
2641
- // src/core/router/index.ts
2642
- init_esm_shims();
2643
- import { deepClone, target as global3 } from "@vue/devtools-shared";
2644
- import { debounce as debounce3 } from "perfect-debounce";
2645
-
2646
- // src/ctx/router.ts
2647
- init_esm_shims();
2648
- import { target as global2 } from "@vue/devtools-shared";
2649
- var ROUTER_KEY = "__VUE_DEVTOOLS_ROUTER__";
2650
- var ROUTER_INFO_KEY = "__VUE_DEVTOOLS_ROUTER_INFO__";
2651
- var _a9, _b9;
2652
- (_b9 = (_a9 = global2)[ROUTER_INFO_KEY]) != null ? _b9 : _a9[ROUTER_INFO_KEY] = {
2653
- currentRoute: null,
2654
- routes: []
2655
- };
2656
- var _a10, _b10;
2657
- (_b10 = (_a10 = global2)[ROUTER_KEY]) != null ? _b10 : _a10[ROUTER_KEY] = {};
2658
- var devtoolsRouterInfo = new Proxy(global2[ROUTER_INFO_KEY], {
2659
- get(target22, property) {
2660
- return global2[ROUTER_INFO_KEY][property];
2661
- }
2662
- });
2663
- var devtoolsRouter = new Proxy(global2[ROUTER_KEY], {
2664
- get(target22, property) {
2665
- if (property === "value") {
2666
- return global2[ROUTER_KEY];
2667
+ const _baseUrl = (_c = target5.__VUE_DEVTOOLS_OPEN_IN_EDITOR_BASE_URL__) != null ? _c : baseUrl;
2668
+ target5.__VUE_INSPECTOR__.openInEditor(_baseUrl, file, line, column);
2667
2669
  }
2668
2670
  }
2669
- });
2670
-
2671
- // src/core/router/index.ts
2672
- function getRoutes(router) {
2673
- const routesMap = /* @__PURE__ */ new Map();
2674
- return ((router == null ? void 0 : router.getRoutes()) || []).filter((i) => !routesMap.has(i.path) && routesMap.set(i.path, 1));
2675
- }
2676
- function filterRoutes(routes) {
2677
- return routes.map((item) => {
2678
- let { path, name, children, meta } = item;
2679
- if (children == null ? void 0 : children.length)
2680
- children = filterRoutes(children);
2681
- return {
2682
- path,
2683
- name,
2684
- children,
2685
- meta
2686
- };
2687
- });
2688
- }
2689
- function filterCurrentRoute(route) {
2690
- if (route) {
2691
- const { fullPath, hash, href, path, name, matched, params, query } = route;
2692
- return {
2693
- fullPath,
2694
- hash,
2695
- href,
2696
- path,
2697
- name,
2698
- params,
2699
- query,
2700
- matched: filterRoutes(matched)
2701
- };
2702
- }
2703
- return route;
2704
- }
2705
- function normalizeRouterInfo(appRecord, activeAppRecord2) {
2706
- function init() {
2707
- var _a25;
2708
- const router = (_a25 = appRecord.app) == null ? void 0 : _a25.config.globalProperties.$router;
2709
- const currentRoute = filterCurrentRoute(router == null ? void 0 : router.currentRoute.value);
2710
- const routes = filterRoutes(getRoutes(router));
2711
- const c = console.warn;
2712
- console.warn = () => {
2713
- };
2714
- global3[ROUTER_INFO_KEY] = {
2715
- currentRoute: currentRoute ? deepClone(currentRoute) : {},
2716
- routes: deepClone(routes)
2717
- };
2718
- global3[ROUTER_KEY] = router;
2719
- console.warn = c;
2720
- }
2721
- init();
2722
- hook.on.componentUpdated(debounce3(() => {
2723
- var _a25;
2724
- if (((_a25 = activeAppRecord2.value) == null ? void 0 : _a25.app) !== appRecord.app)
2725
- return;
2726
- init();
2727
- devtoolsContext.hooks.callHook("routerInfoUpdated" /* ROUTER_INFO_UPDATED */, { state: global3[ROUTER_INFO_KEY] });
2728
- }, 200));
2729
- }
2730
-
2731
- // src/core/component-inspector/index.ts
2732
- init_esm_shims();
2733
- import { target as target4 } from "@vue/devtools-shared";
2734
- var _a11, _b11;
2735
- (_b11 = (_a11 = target4).__VUE_DEVTOOLS_COMPONENT_INSPECTOR_ENABLED__) != null ? _b11 : _a11.__VUE_DEVTOOLS_COMPONENT_INSPECTOR_ENABLED__ = true;
2736
- function toggleComponentInspectorEnabled(enabled) {
2737
- target4.__VUE_DEVTOOLS_COMPONENT_INSPECTOR_ENABLED__ = enabled;
2738
- }
2739
- function waitForInspectorInit(cb) {
2740
- let total = 0;
2741
- const timer = setInterval(() => {
2742
- if (target4.__VUE_INSPECTOR__) {
2743
- clearInterval(timer);
2744
- total += 30;
2745
- cb();
2746
- }
2747
- if (total >= /* 5s */
2748
- 5e3)
2749
- clearInterval(timer);
2750
- }, 30);
2751
- }
2752
- function setupInspector() {
2753
- const inspector = target4.__VUE_INSPECTOR__;
2754
- const _openInEditor = inspector.openInEditor;
2755
- inspector.openInEditor = async (...params) => {
2756
- inspector.disable();
2757
- _openInEditor(...params);
2758
- };
2759
- }
2760
- function getComponentInspector() {
2761
- return new Promise((resolve) => {
2762
- function setup() {
2763
- setupInspector();
2764
- resolve(target4.__VUE_INSPECTOR__);
2765
- }
2766
- if (!target4.__VUE_INSPECTOR__) {
2767
- waitForInspectorInit(() => {
2768
- setup();
2769
- });
2770
- } else {
2771
- setup();
2772
- }
2773
- });
2774
2671
  }
2775
2672
 
2776
2673
  // src/core/plugin/index.ts
2777
2674
  init_esm_shims();
2778
- import { target as target6 } from "@vue/devtools-shared";
2675
+ import { target as target8 } from "@vue/devtools-shared";
2779
2676
 
2780
2677
  // src/api/index.ts
2781
2678
  init_esm_shims();
@@ -2788,10 +2685,10 @@ init_esm_shims();
2788
2685
 
2789
2686
  // src/ctx/plugin.ts
2790
2687
  init_esm_shims();
2791
- import { target as target5 } from "@vue/devtools-shared";
2792
- var _a12, _b12;
2793
- (_b12 = (_a12 = target5).__VUE_DEVTOOLS_KIT_PLUGIN_BUFFER__) != null ? _b12 : _a12.__VUE_DEVTOOLS_KIT_PLUGIN_BUFFER__ = [];
2794
- var devtoolsPluginBuffer = new Proxy(target5.__VUE_DEVTOOLS_KIT_PLUGIN_BUFFER__, {
2688
+ import { target as target6 } from "@vue/devtools-shared";
2689
+ var _a10, _b10;
2690
+ (_b10 = (_a10 = target6).__VUE_DEVTOOLS_KIT_PLUGIN_BUFFER__) != null ? _b10 : _a10.__VUE_DEVTOOLS_KIT_PLUGIN_BUFFER__ = [];
2691
+ var devtoolsPluginBuffer = new Proxy(target6.__VUE_DEVTOOLS_KIT_PLUGIN_BUFFER__, {
2795
2692
  get(target22, prop, receiver) {
2796
2693
  return Reflect.get(target22, prop, receiver);
2797
2694
  }
@@ -2812,10 +2709,12 @@ function getPluginLocalKey(pluginId) {
2812
2709
  return `__VUE_DEVTOOLS_NEXT_PLUGIN_SETTINGS__${pluginId}__`;
2813
2710
  }
2814
2711
  function getPluginSettingsOptions(pluginId) {
2815
- var _a25, _b25, _c, _d;
2816
- const descriptor = (_a25 = getInspector(pluginId)) == null ? void 0 : _a25.descriptor;
2817
- const item = (_c = (_b25 = devtoolsPluginBuffer.find((item2) => item2[0].id === (descriptor == null ? void 0 : descriptor.id))) == null ? void 0 : _b25[0]) != null ? _c : null;
2818
- return (_d = item == null ? void 0 : item.settings) != null ? _d : null;
2712
+ var _a25, _b25, _c;
2713
+ const item = (_b25 = (_a25 = devtoolsPluginBuffer.find((item2) => {
2714
+ var _a26;
2715
+ return item2[0].id === pluginId && !!((_a26 = item2[0]) == null ? void 0 : _a26.settings);
2716
+ })) == null ? void 0 : _a25[0]) != null ? _b25 : null;
2717
+ return (_c = item == null ? void 0 : item.settings) != null ? _c : null;
2819
2718
  }
2820
2719
  function getPluginSettings(pluginId, fallbackValue) {
2821
2720
  var _a25, _b25, _c;
@@ -2859,6 +2758,146 @@ function setPluginSettings(pluginId, key, value) {
2859
2758
  }, "setPluginSettings" /* SET_PLUGIN_SETTINGS */);
2860
2759
  }
2861
2760
 
2761
+ // src/hook/index.ts
2762
+ init_esm_shims();
2763
+ import { target as target7 } from "@vue/devtools-shared";
2764
+ import { createHooks as createHooks2 } from "hookable";
2765
+
2766
+ // src/types/index.ts
2767
+ init_esm_shims();
2768
+
2769
+ // src/types/app.ts
2770
+ init_esm_shims();
2771
+
2772
+ // src/types/command.ts
2773
+ init_esm_shims();
2774
+
2775
+ // src/types/component.ts
2776
+ init_esm_shims();
2777
+
2778
+ // src/types/hook.ts
2779
+ init_esm_shims();
2780
+
2781
+ // src/types/inspector.ts
2782
+ init_esm_shims();
2783
+
2784
+ // src/types/plugin.ts
2785
+ init_esm_shims();
2786
+
2787
+ // src/types/router.ts
2788
+ init_esm_shims();
2789
+
2790
+ // src/types/tab.ts
2791
+ init_esm_shims();
2792
+
2793
+ // src/types/timeline.ts
2794
+ init_esm_shims();
2795
+
2796
+ // src/hook/index.ts
2797
+ var _a11, _b11;
2798
+ var devtoolsHooks = (_b11 = (_a11 = target7).__VUE_DEVTOOLS_HOOK) != null ? _b11 : _a11.__VUE_DEVTOOLS_HOOK = createHooks2();
2799
+ var on = {
2800
+ vueAppInit(fn) {
2801
+ devtoolsHooks.hook("app:init" /* APP_INIT */, fn);
2802
+ },
2803
+ vueAppUnmount(fn) {
2804
+ devtoolsHooks.hook("app:unmount" /* APP_UNMOUNT */, fn);
2805
+ },
2806
+ vueAppConnected(fn) {
2807
+ devtoolsHooks.hook("app:connected" /* APP_CONNECTED */, fn);
2808
+ },
2809
+ componentAdded(fn) {
2810
+ return devtoolsHooks.hook("component:added" /* COMPONENT_ADDED */, fn);
2811
+ },
2812
+ componentUpdated(fn) {
2813
+ return devtoolsHooks.hook("component:updated" /* COMPONENT_UPDATED */, fn);
2814
+ },
2815
+ componentRemoved(fn) {
2816
+ return devtoolsHooks.hook("component:removed" /* COMPONENT_REMOVED */, fn);
2817
+ },
2818
+ setupDevtoolsPlugin(fn) {
2819
+ devtoolsHooks.hook("devtools-plugin:setup" /* SETUP_DEVTOOLS_PLUGIN */, fn);
2820
+ }
2821
+ };
2822
+ function createDevToolsHook() {
2823
+ return {
2824
+ id: "vue-devtools-next",
2825
+ devtoolsVersion: "7.0",
2826
+ enabled: false,
2827
+ appRecords: [],
2828
+ apps: [],
2829
+ events: /* @__PURE__ */ new Map(),
2830
+ on(event, fn) {
2831
+ var _a25;
2832
+ if (!this.events.has(event))
2833
+ this.events.set(event, []);
2834
+ (_a25 = this.events.get(event)) == null ? void 0 : _a25.push(fn);
2835
+ return () => this.off(event, fn);
2836
+ },
2837
+ once(event, fn) {
2838
+ const onceFn = (...args) => {
2839
+ this.off(event, onceFn);
2840
+ fn(...args);
2841
+ };
2842
+ this.on(event, onceFn);
2843
+ return [event, onceFn];
2844
+ },
2845
+ off(event, fn) {
2846
+ if (this.events.has(event)) {
2847
+ const eventCallbacks = this.events.get(event);
2848
+ const index = eventCallbacks.indexOf(fn);
2849
+ if (index !== -1)
2850
+ eventCallbacks.splice(index, 1);
2851
+ }
2852
+ },
2853
+ emit(event, ...payload) {
2854
+ if (this.events.has(event))
2855
+ this.events.get(event).forEach((fn) => fn(...payload));
2856
+ }
2857
+ };
2858
+ }
2859
+ function subscribeDevToolsHook() {
2860
+ const hook2 = target7.__VUE_DEVTOOLS_GLOBAL_HOOK__;
2861
+ hook2.on("app:init" /* APP_INIT */, (app, version) => {
2862
+ var _a25, _b25, _c;
2863
+ if ((_c = (_b25 = (_a25 = app == null ? void 0 : app._instance) == null ? void 0 : _a25.type) == null ? void 0 : _b25.devtools) == null ? void 0 : _c.hide)
2864
+ return;
2865
+ devtoolsHooks.callHook("app:init" /* APP_INIT */, app, version);
2866
+ });
2867
+ hook2.on("app:unmount" /* APP_UNMOUNT */, (app) => {
2868
+ devtoolsHooks.callHook("app:unmount" /* APP_UNMOUNT */, app);
2869
+ });
2870
+ hook2.on("component:added" /* COMPONENT_ADDED */, async (app, uid, parentUid, component) => {
2871
+ var _a25, _b25, _c;
2872
+ if (((_c = (_b25 = (_a25 = app == null ? void 0 : app._instance) == null ? void 0 : _a25.type) == null ? void 0 : _b25.devtools) == null ? void 0 : _c.hide) || devtoolsState.highPerfModeEnabled)
2873
+ return;
2874
+ if (!app || typeof uid !== "number" && !uid || !component)
2875
+ return;
2876
+ devtoolsHooks.callHook("component:added" /* COMPONENT_ADDED */, app, uid, parentUid, component);
2877
+ });
2878
+ hook2.on("component:updated" /* COMPONENT_UPDATED */, (app, uid, parentUid, component) => {
2879
+ if (!app || typeof uid !== "number" && !uid || !component || devtoolsState.highPerfModeEnabled)
2880
+ return;
2881
+ devtoolsHooks.callHook("component:updated" /* COMPONENT_UPDATED */, app, uid, parentUid, component);
2882
+ });
2883
+ hook2.on("component:removed" /* COMPONENT_REMOVED */, async (app, uid, parentUid, component) => {
2884
+ if (!app || typeof uid !== "number" && !uid || !component || devtoolsState.highPerfModeEnabled)
2885
+ return;
2886
+ devtoolsHooks.callHook("component:removed" /* COMPONENT_REMOVED */, app, uid, parentUid, component);
2887
+ });
2888
+ hook2.on("devtools-plugin:setup" /* SETUP_DEVTOOLS_PLUGIN */, (pluginDescriptor, setupFn, options) => {
2889
+ if ((options == null ? void 0 : options.target) === "legacy")
2890
+ return;
2891
+ devtoolsHooks.callHook("devtools-plugin:setup" /* SETUP_DEVTOOLS_PLUGIN */, pluginDescriptor, setupFn);
2892
+ });
2893
+ }
2894
+ var hook = {
2895
+ on,
2896
+ setupDevToolsPlugin(pluginDescriptor, setupFn) {
2897
+ return devtoolsHooks.callHook("devtools-plugin:setup" /* SETUP_DEVTOOLS_PLUGIN */, pluginDescriptor, setupFn);
2898
+ }
2899
+ };
2900
+
2862
2901
  // src/api/v6/index.ts
2863
2902
  var DevToolsV6PluginAPI = class {
2864
2903
  constructor({ plugin, ctx }) {
@@ -2939,260 +2978,42 @@ var DevToolsV6PluginAPI = class {
2939
2978
  now() {
2940
2979
  return Date.now();
2941
2980
  }
2942
- addTimelineLayer(options) {
2943
- this.hooks.callHook("timelineLayerAdded" /* TIMELINE_LAYER_ADDED */, { options, plugin: this.plugin });
2944
- }
2945
- addTimelineEvent(options) {
2946
- this.hooks.callHook("timelineEventAdded" /* TIMELINE_EVENT_ADDED */, { options, plugin: this.plugin });
2947
- }
2948
- // settings
2949
- getSettings(pluginId) {
2950
- const inspector = getActiveInspectors().find((i) => i.packageName === this.plugin.descriptor.packageName);
2951
- return getPluginSettings(pluginId != null ? pluginId : inspector == null ? void 0 : inspector.id, this.plugin.descriptor.settings);
2952
- }
2953
- // utilities
2954
- getComponentInstances(app) {
2955
- return this.hooks.callHook("getComponentInstances" /* GET_COMPONENT_INSTANCES */, { app });
2956
- }
2957
- getComponentBounds(instance) {
2958
- return this.hooks.callHook("getComponentBounds" /* GET_COMPONENT_BOUNDS */, { instance });
2959
- }
2960
- getComponentName(instance) {
2961
- return this.hooks.callHook("getComponentName" /* GET_COMPONENT_NAME */, { instance });
2962
- }
2963
- highlightElement(instance) {
2964
- const uid = instance.__VUE_DEVTOOLS_NEXT_UID__;
2965
- return this.hooks.callHook("componentHighlight" /* COMPONENT_HIGHLIGHT */, { uid });
2966
- }
2967
- unhighlightElement() {
2968
- return this.hooks.callHook("componentUnhighlight" /* COMPONENT_UNHIGHLIGHT */);
2969
- }
2970
- };
2971
-
2972
- // src/api/index.ts
2973
- var DevToolsPluginAPI = DevToolsV6PluginAPI;
2974
-
2975
- // src/core/plugin/components.ts
2976
- init_esm_shims();
2977
- import { debounce as debounce4 } from "perfect-debounce";
2978
-
2979
- // src/core/component/tree/walker.ts
2980
- init_esm_shims();
2981
-
2982
- // src/core/component/tree/filter.ts
2983
- init_esm_shims();
2984
- import { classify as classify2, kebabize } from "@vue/devtools-shared";
2985
- var ComponentFilter = class {
2986
- constructor(filter) {
2987
- this.filter = filter || "";
2988
- }
2989
- /**
2990
- * Check if an instance is qualified.
2991
- *
2992
- * @param {Vue|Vnode} instance
2993
- * @return {boolean}
2994
- */
2995
- isQualified(instance) {
2996
- const name = getInstanceName(instance);
2997
- return classify2(name).toLowerCase().includes(this.filter) || kebabize(name).toLowerCase().includes(this.filter);
2998
- }
2999
- };
3000
- function createComponentFilter(filterText) {
3001
- return new ComponentFilter(filterText);
3002
- }
3003
-
3004
- // src/core/component/tree/walker.ts
3005
- var ComponentWalker = class {
3006
- constructor(options) {
3007
- // Dedupe instances (Some instances may be both on a component and on a child abstract/functional component)
3008
- this.captureIds = /* @__PURE__ */ new Map();
3009
- const { filterText = "", maxDepth, recursively } = options;
3010
- this.componentFilter = createComponentFilter(filterText);
3011
- this.maxDepth = maxDepth;
3012
- this.recursively = recursively;
3013
- }
3014
- getComponentTree(instance) {
3015
- this.captureIds = /* @__PURE__ */ new Map();
3016
- return this.findQualifiedChildren(instance, 0);
3017
- }
3018
- getComponentParents(instance) {
3019
- this.captureIds = /* @__PURE__ */ new Map();
3020
- const parents = [];
3021
- this.captureId(instance);
3022
- let parent = instance;
3023
- while (parent = parent.parent) {
3024
- this.captureId(parent);
3025
- parents.push(parent);
3026
- }
3027
- return parents;
3028
- }
3029
- captureId(instance) {
3030
- if (!instance)
3031
- return null;
3032
- const id = instance.__VUE_DEVTOOLS_NEXT_UID__ != null ? instance.__VUE_DEVTOOLS_NEXT_UID__ : getUniqueComponentId(instance);
3033
- instance.__VUE_DEVTOOLS_NEXT_UID__ = id;
3034
- if (this.captureIds.has(id))
3035
- return null;
3036
- else
3037
- this.captureIds.set(id, void 0);
3038
- this.mark(instance);
3039
- return id;
3040
- }
3041
- /**
3042
- * Capture the meta information of an instance. (recursive)
3043
- *
3044
- * @param {Vue} instance
3045
- * @return {object}
3046
- */
3047
- async capture(instance, depth) {
3048
- var _a25;
3049
- if (!instance)
3050
- return null;
3051
- const id = this.captureId(instance);
3052
- const name = getInstanceName(instance);
3053
- const children = this.getInternalInstanceChildren(instance.subTree).filter((child) => !isBeingDestroyed(child));
3054
- const parents = this.getComponentParents(instance) || [];
3055
- const inactive = !!instance.isDeactivated || parents.some((parent) => parent.isDeactivated);
3056
- const treeNode = {
3057
- uid: instance.uid,
3058
- id,
3059
- name,
3060
- renderKey: getRenderKey(instance.vnode ? instance.vnode.key : null),
3061
- inactive,
3062
- children: [],
3063
- isFragment: isFragment(instance),
3064
- tags: typeof instance.type !== "function" ? [] : [
3065
- {
3066
- label: "functional",
3067
- textColor: 5592405,
3068
- backgroundColor: 15658734
3069
- }
3070
- ],
3071
- autoOpen: this.recursively,
3072
- file: instance.type.__file || ""
3073
- };
3074
- if (depth < this.maxDepth || instance.type.__isKeepAlive || parents.some((parent) => parent.type.__isKeepAlive)) {
3075
- treeNode.children = await Promise.all(children.map((child) => this.capture(child, depth + 1)).filter(Boolean));
3076
- }
3077
- if (this.isKeepAlive(instance)) {
3078
- const cachedComponents = this.getKeepAliveCachedInstances(instance);
3079
- const childrenIds = children.map((child) => child.__VUE_DEVTOOLS_NEXT_UID__);
3080
- for (const cachedChild of cachedComponents) {
3081
- if (!childrenIds.includes(cachedChild.__VUE_DEVTOOLS_NEXT_UID__)) {
3082
- const node = await this.capture({ ...cachedChild, isDeactivated: true }, depth + 1);
3083
- if (node)
3084
- treeNode.children.push(node);
3085
- }
3086
- }
3087
- }
3088
- const rootElements = getRootElementsFromComponentInstance(instance);
3089
- const firstElement = rootElements[0];
3090
- if (firstElement == null ? void 0 : firstElement.parentElement) {
3091
- const parentInstance = instance.parent;
3092
- const parentRootElements = parentInstance ? getRootElementsFromComponentInstance(parentInstance) : [];
3093
- let el = firstElement;
3094
- const indexList = [];
3095
- do {
3096
- indexList.push(Array.from(el.parentElement.childNodes).indexOf(el));
3097
- el = el.parentElement;
3098
- } while (el.parentElement && parentRootElements.length && !parentRootElements.includes(el));
3099
- treeNode.domOrder = indexList.reverse();
3100
- } else {
3101
- treeNode.domOrder = [-1];
3102
- }
3103
- if ((_a25 = instance.suspense) == null ? void 0 : _a25.suspenseKey) {
3104
- treeNode.tags.push({
3105
- label: instance.suspense.suspenseKey,
3106
- backgroundColor: 14979812,
3107
- textColor: 16777215
3108
- });
3109
- this.mark(instance, true);
3110
- }
3111
- return treeNode;
3112
- }
3113
- /**
3114
- * Find qualified children from a single instance.
3115
- * If the instance itself is qualified, just return itself.
3116
- * This is ok because [].concat works in both cases.
3117
- *
3118
- * @param {Vue|Vnode} instance
3119
- * @return {Vue|Array}
3120
- */
3121
- async findQualifiedChildren(instance, depth) {
3122
- var _a25;
3123
- if (this.componentFilter.isQualified(instance) && !((_a25 = instance.type.devtools) == null ? void 0 : _a25.hide)) {
3124
- return [await this.capture(instance, depth)];
3125
- } else if (instance.subTree) {
3126
- const list = this.isKeepAlive(instance) ? this.getKeepAliveCachedInstances(instance) : this.getInternalInstanceChildren(instance.subTree);
3127
- return this.findQualifiedChildrenFromList(list, depth);
3128
- } else {
3129
- return [];
3130
- }
3131
- }
3132
- /**
3133
- * Iterate through an array of instances and flatten it into
3134
- * an array of qualified instances. This is a depth-first
3135
- * traversal - e.g. if an instance is not matched, we will
3136
- * recursively go deeper until a qualified child is found.
3137
- *
3138
- * @param {Array} instances
3139
- * @return {Array}
3140
- */
3141
- async findQualifiedChildrenFromList(instances, depth) {
3142
- instances = instances.filter((child) => {
3143
- var _a25;
3144
- return !isBeingDestroyed(child) && !((_a25 = child.type.devtools) == null ? void 0 : _a25.hide);
3145
- });
3146
- if (!this.componentFilter.filter)
3147
- return Promise.all(instances.map((child) => this.capture(child, depth)));
3148
- else
3149
- return Array.prototype.concat.apply([], await Promise.all(instances.map((i) => this.findQualifiedChildren(i, depth))));
3150
- }
3151
- /**
3152
- * Get children from a component instance.
3153
- */
3154
- getInternalInstanceChildren(subTree, suspense = null) {
3155
- const list = [];
3156
- if (subTree) {
3157
- if (subTree.component) {
3158
- !suspense ? list.push(subTree.component) : list.push({ ...subTree.component, suspense });
3159
- } else if (subTree.suspense) {
3160
- const suspenseKey = !subTree.suspense.isInFallback ? "suspense default" : "suspense fallback";
3161
- list.push(...this.getInternalInstanceChildren(subTree.suspense.activeBranch, { ...subTree.suspense, suspenseKey }));
3162
- } else if (Array.isArray(subTree.children)) {
3163
- subTree.children.forEach((childSubTree) => {
3164
- if (childSubTree.component)
3165
- !suspense ? list.push(childSubTree.component) : list.push({ ...childSubTree.component, suspense });
3166
- else
3167
- list.push(...this.getInternalInstanceChildren(childSubTree, suspense));
3168
- });
3169
- }
3170
- }
3171
- return list.filter((child) => {
3172
- var _a25;
3173
- return !isBeingDestroyed(child) && !((_a25 = child.type.devtools) == null ? void 0 : _a25.hide);
3174
- });
2981
+ addTimelineLayer(options) {
2982
+ this.hooks.callHook("timelineLayerAdded" /* TIMELINE_LAYER_ADDED */, { options, plugin: this.plugin });
3175
2983
  }
3176
- /**
3177
- * Mark an instance as captured and store it in the instance map.
3178
- *
3179
- * @param {Vue} instance
3180
- */
3181
- mark(instance, force = false) {
3182
- const instanceMap = getAppRecord(instance).instanceMap;
3183
- if (force || !instanceMap.has(instance.__VUE_DEVTOOLS_NEXT_UID__)) {
3184
- instanceMap.set(instance.__VUE_DEVTOOLS_NEXT_UID__, instance);
3185
- activeAppRecord.value.instanceMap = instanceMap;
3186
- }
2984
+ addTimelineEvent(options) {
2985
+ this.hooks.callHook("timelineEventAdded" /* TIMELINE_EVENT_ADDED */, { options, plugin: this.plugin });
3187
2986
  }
3188
- isKeepAlive(instance) {
3189
- return instance.type.__isKeepAlive && instance.__v_cache;
2987
+ // settings
2988
+ getSettings(pluginId) {
2989
+ return getPluginSettings(pluginId != null ? pluginId : this.plugin.descriptor.id, this.plugin.descriptor.settings);
3190
2990
  }
3191
- getKeepAliveCachedInstances(instance) {
3192
- return Array.from(instance.__v_cache.values()).map((vnode) => vnode.component).filter(Boolean);
2991
+ // utilities
2992
+ getComponentInstances(app) {
2993
+ return this.hooks.callHook("getComponentInstances" /* GET_COMPONENT_INSTANCES */, { app });
2994
+ }
2995
+ getComponentBounds(instance) {
2996
+ return this.hooks.callHook("getComponentBounds" /* GET_COMPONENT_BOUNDS */, { instance });
2997
+ }
2998
+ getComponentName(instance) {
2999
+ return this.hooks.callHook("getComponentName" /* GET_COMPONENT_NAME */, { instance });
3000
+ }
3001
+ highlightElement(instance) {
3002
+ const uid = instance.__VUE_DEVTOOLS_NEXT_UID__;
3003
+ return this.hooks.callHook("componentHighlight" /* COMPONENT_HIGHLIGHT */, { uid });
3004
+ }
3005
+ unhighlightElement() {
3006
+ return this.hooks.callHook("componentUnhighlight" /* COMPONENT_UNHIGHLIGHT */);
3193
3007
  }
3194
3008
  };
3195
3009
 
3010
+ // src/api/index.ts
3011
+ var DevToolsPluginAPI = DevToolsV6PluginAPI;
3012
+
3013
+ // src/core/plugin/components.ts
3014
+ init_esm_shims();
3015
+ import { debounce as debounce3 } from "perfect-debounce";
3016
+
3196
3017
  // src/core/component/state/index.ts
3197
3018
  init_esm_shims();
3198
3019
 
@@ -3577,38 +3398,255 @@ function processEventListeners(instance) {
3577
3398
  });
3578
3399
  }
3579
3400
  }
3580
- return result;
3581
- }
3582
- function processInstanceState(instance) {
3583
- const mergedType = resolveMergedOptions(instance);
3584
- return processProps(instance).concat(
3585
- processState(instance),
3586
- processSetupState(instance),
3587
- processComputed(instance, mergedType),
3588
- processAttrs(instance),
3589
- processProvide(instance),
3590
- processInject(instance, mergedType),
3591
- processRefs(instance),
3592
- processEventListeners(instance)
3593
- );
3594
- }
3595
-
3596
- // src/core/component/state/index.ts
3597
- function getInstanceState(params) {
3598
- var _a25;
3599
- const instance = getComponentInstance(activeAppRecord.value, params.instanceId);
3600
- const id = getUniqueComponentId(instance);
3601
- const name = getInstanceName(instance);
3602
- const file = (_a25 = instance == null ? void 0 : instance.type) == null ? void 0 : _a25.__file;
3603
- const state = processInstanceState(instance);
3604
- return {
3605
- id,
3606
- name,
3607
- file,
3608
- state,
3609
- instance
3610
- };
3611
- }
3401
+ return result;
3402
+ }
3403
+ function processInstanceState(instance) {
3404
+ const mergedType = resolveMergedOptions(instance);
3405
+ return processProps(instance).concat(
3406
+ processState(instance),
3407
+ processSetupState(instance),
3408
+ processComputed(instance, mergedType),
3409
+ processAttrs(instance),
3410
+ processProvide(instance),
3411
+ processInject(instance, mergedType),
3412
+ processRefs(instance),
3413
+ processEventListeners(instance)
3414
+ );
3415
+ }
3416
+
3417
+ // src/core/component/state/index.ts
3418
+ function getInstanceState(params) {
3419
+ var _a25;
3420
+ const instance = getComponentInstance(activeAppRecord.value, params.instanceId);
3421
+ const id = getUniqueComponentId(instance);
3422
+ const name = getInstanceName(instance);
3423
+ const file = (_a25 = instance == null ? void 0 : instance.type) == null ? void 0 : _a25.__file;
3424
+ const state = processInstanceState(instance);
3425
+ return {
3426
+ id,
3427
+ name,
3428
+ file,
3429
+ state,
3430
+ instance
3431
+ };
3432
+ }
3433
+
3434
+ // src/core/component/tree/walker.ts
3435
+ init_esm_shims();
3436
+
3437
+ // src/core/component/tree/filter.ts
3438
+ init_esm_shims();
3439
+ import { classify as classify2, kebabize } from "@vue/devtools-shared";
3440
+ var ComponentFilter = class {
3441
+ constructor(filter) {
3442
+ this.filter = filter || "";
3443
+ }
3444
+ /**
3445
+ * Check if an instance is qualified.
3446
+ *
3447
+ * @param {Vue|Vnode} instance
3448
+ * @return {boolean}
3449
+ */
3450
+ isQualified(instance) {
3451
+ const name = getInstanceName(instance);
3452
+ return classify2(name).toLowerCase().includes(this.filter) || kebabize(name).toLowerCase().includes(this.filter);
3453
+ }
3454
+ };
3455
+ function createComponentFilter(filterText) {
3456
+ return new ComponentFilter(filterText);
3457
+ }
3458
+
3459
+ // src/core/component/tree/walker.ts
3460
+ var ComponentWalker = class {
3461
+ constructor(options) {
3462
+ // Dedupe instances (Some instances may be both on a component and on a child abstract/functional component)
3463
+ this.captureIds = /* @__PURE__ */ new Map();
3464
+ const { filterText = "", maxDepth, recursively } = options;
3465
+ this.componentFilter = createComponentFilter(filterText);
3466
+ this.maxDepth = maxDepth;
3467
+ this.recursively = recursively;
3468
+ }
3469
+ getComponentTree(instance) {
3470
+ this.captureIds = /* @__PURE__ */ new Map();
3471
+ return this.findQualifiedChildren(instance, 0);
3472
+ }
3473
+ getComponentParents(instance) {
3474
+ this.captureIds = /* @__PURE__ */ new Map();
3475
+ const parents = [];
3476
+ this.captureId(instance);
3477
+ let parent = instance;
3478
+ while (parent = parent.parent) {
3479
+ this.captureId(parent);
3480
+ parents.push(parent);
3481
+ }
3482
+ return parents;
3483
+ }
3484
+ captureId(instance) {
3485
+ if (!instance)
3486
+ return null;
3487
+ const id = instance.__VUE_DEVTOOLS_NEXT_UID__ != null ? instance.__VUE_DEVTOOLS_NEXT_UID__ : getUniqueComponentId(instance);
3488
+ instance.__VUE_DEVTOOLS_NEXT_UID__ = id;
3489
+ if (this.captureIds.has(id))
3490
+ return null;
3491
+ else
3492
+ this.captureIds.set(id, void 0);
3493
+ this.mark(instance);
3494
+ return id;
3495
+ }
3496
+ /**
3497
+ * Capture the meta information of an instance. (recursive)
3498
+ *
3499
+ * @param {Vue} instance
3500
+ * @return {object}
3501
+ */
3502
+ async capture(instance, depth) {
3503
+ var _a25;
3504
+ if (!instance)
3505
+ return null;
3506
+ const id = this.captureId(instance);
3507
+ const name = getInstanceName(instance);
3508
+ const children = this.getInternalInstanceChildren(instance.subTree).filter((child) => !isBeingDestroyed(child));
3509
+ const parents = this.getComponentParents(instance) || [];
3510
+ const inactive = !!instance.isDeactivated || parents.some((parent) => parent.isDeactivated);
3511
+ const treeNode = {
3512
+ uid: instance.uid,
3513
+ id,
3514
+ name,
3515
+ renderKey: getRenderKey(instance.vnode ? instance.vnode.key : null),
3516
+ inactive,
3517
+ children: [],
3518
+ isFragment: isFragment(instance),
3519
+ tags: typeof instance.type !== "function" ? [] : [
3520
+ {
3521
+ label: "functional",
3522
+ textColor: 5592405,
3523
+ backgroundColor: 15658734
3524
+ }
3525
+ ],
3526
+ autoOpen: this.recursively,
3527
+ file: instance.type.__file || ""
3528
+ };
3529
+ if (depth < this.maxDepth || instance.type.__isKeepAlive || parents.some((parent) => parent.type.__isKeepAlive)) {
3530
+ treeNode.children = await Promise.all(children.map((child) => this.capture(child, depth + 1)).filter(Boolean));
3531
+ }
3532
+ if (this.isKeepAlive(instance)) {
3533
+ const cachedComponents = this.getKeepAliveCachedInstances(instance);
3534
+ const childrenIds = children.map((child) => child.__VUE_DEVTOOLS_NEXT_UID__);
3535
+ for (const cachedChild of cachedComponents) {
3536
+ if (!childrenIds.includes(cachedChild.__VUE_DEVTOOLS_NEXT_UID__)) {
3537
+ const node = await this.capture({ ...cachedChild, isDeactivated: true }, depth + 1);
3538
+ if (node)
3539
+ treeNode.children.push(node);
3540
+ }
3541
+ }
3542
+ }
3543
+ const rootElements = getRootElementsFromComponentInstance(instance);
3544
+ const firstElement = rootElements[0];
3545
+ if (firstElement == null ? void 0 : firstElement.parentElement) {
3546
+ const parentInstance = instance.parent;
3547
+ const parentRootElements = parentInstance ? getRootElementsFromComponentInstance(parentInstance) : [];
3548
+ let el = firstElement;
3549
+ const indexList = [];
3550
+ do {
3551
+ indexList.push(Array.from(el.parentElement.childNodes).indexOf(el));
3552
+ el = el.parentElement;
3553
+ } while (el.parentElement && parentRootElements.length && !parentRootElements.includes(el));
3554
+ treeNode.domOrder = indexList.reverse();
3555
+ } else {
3556
+ treeNode.domOrder = [-1];
3557
+ }
3558
+ if ((_a25 = instance.suspense) == null ? void 0 : _a25.suspenseKey) {
3559
+ treeNode.tags.push({
3560
+ label: instance.suspense.suspenseKey,
3561
+ backgroundColor: 14979812,
3562
+ textColor: 16777215
3563
+ });
3564
+ this.mark(instance, true);
3565
+ }
3566
+ return treeNode;
3567
+ }
3568
+ /**
3569
+ * Find qualified children from a single instance.
3570
+ * If the instance itself is qualified, just return itself.
3571
+ * This is ok because [].concat works in both cases.
3572
+ *
3573
+ * @param {Vue|Vnode} instance
3574
+ * @return {Vue|Array}
3575
+ */
3576
+ async findQualifiedChildren(instance, depth) {
3577
+ var _a25;
3578
+ if (this.componentFilter.isQualified(instance) && !((_a25 = instance.type.devtools) == null ? void 0 : _a25.hide)) {
3579
+ return [await this.capture(instance, depth)];
3580
+ } else if (instance.subTree) {
3581
+ const list = this.isKeepAlive(instance) ? this.getKeepAliveCachedInstances(instance) : this.getInternalInstanceChildren(instance.subTree);
3582
+ return this.findQualifiedChildrenFromList(list, depth);
3583
+ } else {
3584
+ return [];
3585
+ }
3586
+ }
3587
+ /**
3588
+ * Iterate through an array of instances and flatten it into
3589
+ * an array of qualified instances. This is a depth-first
3590
+ * traversal - e.g. if an instance is not matched, we will
3591
+ * recursively go deeper until a qualified child is found.
3592
+ *
3593
+ * @param {Array} instances
3594
+ * @return {Array}
3595
+ */
3596
+ async findQualifiedChildrenFromList(instances, depth) {
3597
+ instances = instances.filter((child) => {
3598
+ var _a25;
3599
+ return !isBeingDestroyed(child) && !((_a25 = child.type.devtools) == null ? void 0 : _a25.hide);
3600
+ });
3601
+ if (!this.componentFilter.filter)
3602
+ return Promise.all(instances.map((child) => this.capture(child, depth)));
3603
+ else
3604
+ return Array.prototype.concat.apply([], await Promise.all(instances.map((i) => this.findQualifiedChildren(i, depth))));
3605
+ }
3606
+ /**
3607
+ * Get children from a component instance.
3608
+ */
3609
+ getInternalInstanceChildren(subTree, suspense = null) {
3610
+ const list = [];
3611
+ if (subTree) {
3612
+ if (subTree.component) {
3613
+ !suspense ? list.push(subTree.component) : list.push({ ...subTree.component, suspense });
3614
+ } else if (subTree.suspense) {
3615
+ const suspenseKey = !subTree.suspense.isInFallback ? "suspense default" : "suspense fallback";
3616
+ list.push(...this.getInternalInstanceChildren(subTree.suspense.activeBranch, { ...subTree.suspense, suspenseKey }));
3617
+ } else if (Array.isArray(subTree.children)) {
3618
+ subTree.children.forEach((childSubTree) => {
3619
+ if (childSubTree.component)
3620
+ !suspense ? list.push(childSubTree.component) : list.push({ ...childSubTree.component, suspense });
3621
+ else
3622
+ list.push(...this.getInternalInstanceChildren(childSubTree, suspense));
3623
+ });
3624
+ }
3625
+ }
3626
+ return list.filter((child) => {
3627
+ var _a25;
3628
+ return !isBeingDestroyed(child) && !((_a25 = child.type.devtools) == null ? void 0 : _a25.hide);
3629
+ });
3630
+ }
3631
+ /**
3632
+ * Mark an instance as captured and store it in the instance map.
3633
+ *
3634
+ * @param {Vue} instance
3635
+ */
3636
+ mark(instance, force = false) {
3637
+ const instanceMap = getAppRecord(instance).instanceMap;
3638
+ if (force || !instanceMap.has(instance.__VUE_DEVTOOLS_NEXT_UID__)) {
3639
+ instanceMap.set(instance.__VUE_DEVTOOLS_NEXT_UID__, instance);
3640
+ activeAppRecord.value.instanceMap = instanceMap;
3641
+ }
3642
+ }
3643
+ isKeepAlive(instance) {
3644
+ return instance.type.__isKeepAlive && instance.__v_cache;
3645
+ }
3646
+ getKeepAliveCachedInstances(instance) {
3647
+ return Array.from(instance.__v_cache.values()).map((vnode) => vnode.component).filter(Boolean);
3648
+ }
3649
+ };
3612
3650
 
3613
3651
  // src/core/vm/index.ts
3614
3652
  init_esm_shims();
@@ -3686,10 +3724,10 @@ function createComponentsDevToolsPlugin(app) {
3686
3724
  await api.sendInspectorState("components");
3687
3725
  }
3688
3726
  });
3689
- const debounceSendInspectorTree = debounce4(() => {
3727
+ const debounceSendInspectorTree = debounce3(() => {
3690
3728
  api.sendInspectorTree(INSPECTOR_ID);
3691
3729
  }, 120);
3692
- const debounceSendInspectorState = debounce4(() => {
3730
+ const debounceSendInspectorState = debounce3(() => {
3693
3731
  api.sendInspectorState(INSPECTOR_ID);
3694
3732
  }, 120);
3695
3733
  const componentAddedCleanup = hook.on.componentAdded(async (app2, uid, parentUid, component) => {
@@ -3773,8 +3811,8 @@ function createComponentsDevToolsPlugin(app) {
3773
3811
  }
3774
3812
 
3775
3813
  // src/core/plugin/index.ts
3776
- var _a13, _b13;
3777
- (_b13 = (_a13 = target6).__VUE_DEVTOOLS_KIT__REGISTERED_PLUGIN_APPS__) != null ? _b13 : _a13.__VUE_DEVTOOLS_KIT__REGISTERED_PLUGIN_APPS__ = /* @__PURE__ */ new Set();
3814
+ var _a12, _b12;
3815
+ (_b12 = (_a12 = target8).__VUE_DEVTOOLS_KIT__REGISTERED_PLUGIN_APPS__) != null ? _b12 : _a12.__VUE_DEVTOOLS_KIT__REGISTERED_PLUGIN_APPS__ = /* @__PURE__ */ new Set();
3778
3816
  function setupDevToolsPlugin(pluginDescriptor, setupFn) {
3779
3817
  return hook.setupDevToolsPlugin(pluginDescriptor, setupFn);
3780
3818
  }
@@ -3795,26 +3833,109 @@ function callDevToolsPluginSetupFn(plugin, app) {
3795
3833
  });
3796
3834
  }
3797
3835
  setupFn(api);
3798
- if (pluginDescriptor.settings) {
3799
- const inspector = devtoolsInspector.find((inspector2) => inspector2.descriptor.id === pluginDescriptor.id);
3800
- if (inspector) {
3801
- inspector.descriptor.settings = pluginDescriptor.settings;
3802
- initPluginSettings(inspector.options.id, pluginDescriptor.settings);
3803
- }
3804
- }
3805
3836
  }
3806
3837
  function removeRegisteredPluginApp(app) {
3807
- target6.__VUE_DEVTOOLS_KIT__REGISTERED_PLUGIN_APPS__.delete(app);
3838
+ target8.__VUE_DEVTOOLS_KIT__REGISTERED_PLUGIN_APPS__.delete(app);
3808
3839
  }
3809
3840
  function registerDevToolsPlugin(app) {
3810
- if (target6.__VUE_DEVTOOLS_KIT__REGISTERED_PLUGIN_APPS__.has(app))
3841
+ if (target8.__VUE_DEVTOOLS_KIT__REGISTERED_PLUGIN_APPS__.has(app))
3811
3842
  return;
3812
- target6.__VUE_DEVTOOLS_KIT__REGISTERED_PLUGIN_APPS__.add(app);
3843
+ target8.__VUE_DEVTOOLS_KIT__REGISTERED_PLUGIN_APPS__.add(app);
3813
3844
  devtoolsPluginBuffer.forEach((plugin) => {
3814
3845
  callDevToolsPluginSetupFn(plugin, app);
3815
3846
  });
3816
3847
  }
3817
3848
 
3849
+ // src/core/router/index.ts
3850
+ init_esm_shims();
3851
+ import { deepClone, target as global3 } from "@vue/devtools-shared";
3852
+ import { debounce as debounce4 } from "perfect-debounce";
3853
+
3854
+ // src/ctx/router.ts
3855
+ init_esm_shims();
3856
+ import { target as global2 } from "@vue/devtools-shared";
3857
+ var ROUTER_KEY = "__VUE_DEVTOOLS_ROUTER__";
3858
+ var ROUTER_INFO_KEY = "__VUE_DEVTOOLS_ROUTER_INFO__";
3859
+ var _a13, _b13;
3860
+ (_b13 = (_a13 = global2)[ROUTER_INFO_KEY]) != null ? _b13 : _a13[ROUTER_INFO_KEY] = {
3861
+ currentRoute: null,
3862
+ routes: []
3863
+ };
3864
+ var _a14, _b14;
3865
+ (_b14 = (_a14 = global2)[ROUTER_KEY]) != null ? _b14 : _a14[ROUTER_KEY] = {};
3866
+ var devtoolsRouterInfo = new Proxy(global2[ROUTER_INFO_KEY], {
3867
+ get(target22, property) {
3868
+ return global2[ROUTER_INFO_KEY][property];
3869
+ }
3870
+ });
3871
+ var devtoolsRouter = new Proxy(global2[ROUTER_KEY], {
3872
+ get(target22, property) {
3873
+ if (property === "value") {
3874
+ return global2[ROUTER_KEY];
3875
+ }
3876
+ }
3877
+ });
3878
+
3879
+ // src/core/router/index.ts
3880
+ function getRoutes(router) {
3881
+ const routesMap = /* @__PURE__ */ new Map();
3882
+ return ((router == null ? void 0 : router.getRoutes()) || []).filter((i) => !routesMap.has(i.path) && routesMap.set(i.path, 1));
3883
+ }
3884
+ function filterRoutes(routes) {
3885
+ return routes.map((item) => {
3886
+ let { path, name, children, meta } = item;
3887
+ if (children == null ? void 0 : children.length)
3888
+ children = filterRoutes(children);
3889
+ return {
3890
+ path,
3891
+ name,
3892
+ children,
3893
+ meta
3894
+ };
3895
+ });
3896
+ }
3897
+ function filterCurrentRoute(route) {
3898
+ if (route) {
3899
+ const { fullPath, hash, href, path, name, matched, params, query } = route;
3900
+ return {
3901
+ fullPath,
3902
+ hash,
3903
+ href,
3904
+ path,
3905
+ name,
3906
+ params,
3907
+ query,
3908
+ matched: filterRoutes(matched)
3909
+ };
3910
+ }
3911
+ return route;
3912
+ }
3913
+ function normalizeRouterInfo(appRecord, activeAppRecord2) {
3914
+ function init() {
3915
+ var _a25;
3916
+ const router = (_a25 = appRecord.app) == null ? void 0 : _a25.config.globalProperties.$router;
3917
+ const currentRoute = filterCurrentRoute(router == null ? void 0 : router.currentRoute.value);
3918
+ const routes = filterRoutes(getRoutes(router));
3919
+ const c = console.warn;
3920
+ console.warn = () => {
3921
+ };
3922
+ global3[ROUTER_INFO_KEY] = {
3923
+ currentRoute: currentRoute ? deepClone(currentRoute) : {},
3924
+ routes: deepClone(routes)
3925
+ };
3926
+ global3[ROUTER_KEY] = router;
3927
+ console.warn = c;
3928
+ }
3929
+ init();
3930
+ hook.on.componentUpdated(debounce4(() => {
3931
+ var _a25;
3932
+ if (((_a25 = activeAppRecord2.value) == null ? void 0 : _a25.app) !== appRecord.app)
3933
+ return;
3934
+ init();
3935
+ devtoolsContext.hooks.callHook("routerInfoUpdated" /* ROUTER_INFO_UPDATED */, { state: global3[ROUTER_INFO_KEY] });
3936
+ }, 200));
3937
+ }
3938
+
3818
3939
  // src/ctx/api.ts
3819
3940
  function createDevToolsApi(hooks2) {
3820
3941
  return {
@@ -3912,178 +4033,56 @@ function createDevToolsApi(hooks2) {
3912
4033
  if (instance) {
3913
4034
  const [el] = getRootElementsFromComponentInstance(instance);
3914
4035
  if (el) {
3915
- target7.__VUE_DEVTOOLS_INSPECT_DOM_TARGET__ = el;
4036
+ target9.__VUE_DEVTOOLS_INSPECT_DOM_TARGET__ = el;
3916
4037
  }
3917
4038
  }
3918
4039
  },
3919
- updatePluginSettings(pluginId, key, value) {
3920
- setPluginSettings(pluginId, key, value);
3921
- },
3922
- getPluginSettings(pluginId) {
3923
- return {
3924
- options: getPluginSettingsOptions(pluginId),
3925
- values: getPluginSettings(pluginId)
3926
- };
3927
- }
3928
- };
3929
- }
3930
-
3931
- // src/ctx/env.ts
3932
- init_esm_shims();
3933
- import { target as target8 } from "@vue/devtools-shared";
3934
- var _a14, _b14;
3935
- (_b14 = (_a14 = target8).__VUE_DEVTOOLS_ENV__) != null ? _b14 : _a14.__VUE_DEVTOOLS_ENV__ = {
3936
- vitePluginDetected: false
3937
- };
3938
- function getDevToolsEnv() {
3939
- return target8.__VUE_DEVTOOLS_ENV__;
3940
- }
3941
- function setDevToolsEnv(env) {
3942
- target8.__VUE_DEVTOOLS_ENV__ = {
3943
- ...target8.__VUE_DEVTOOLS_ENV__,
3944
- ...env
3945
- };
3946
- }
3947
-
3948
- // src/ctx/index.ts
3949
- var hooks = createDevToolsCtxHooks();
3950
- var _a15, _b15;
3951
- (_b15 = (_a15 = target9).__VUE_DEVTOOLS_KIT_CONTEXT__) != null ? _b15 : _a15.__VUE_DEVTOOLS_KIT_CONTEXT__ = {
3952
- hooks,
3953
- get state() {
3954
- return {
3955
- ...devtoolsState,
3956
- activeAppRecordId: activeAppRecord.id,
3957
- activeAppRecord: activeAppRecord.value,
3958
- appRecords: devtoolsAppRecords.value
3959
- };
3960
- },
3961
- api: createDevToolsApi(hooks)
3962
- };
3963
- var devtoolsContext = target9.__VUE_DEVTOOLS_KIT_CONTEXT__;
3964
-
3965
- // src/hook/index.ts
3966
- var _a16, _b16;
3967
- var devtoolsHooks = (_b16 = (_a16 = target10).__VUE_DEVTOOLS_HOOK) != null ? _b16 : _a16.__VUE_DEVTOOLS_HOOK = createHooks2();
3968
- var on = {
3969
- vueAppInit(fn) {
3970
- devtoolsHooks.hook("app:init" /* APP_INIT */, fn);
3971
- },
3972
- vueAppUnmount(fn) {
3973
- devtoolsHooks.hook("app:unmount" /* APP_UNMOUNT */, fn);
3974
- },
3975
- vueAppConnected(fn) {
3976
- devtoolsHooks.hook("app:connected" /* APP_CONNECTED */, fn);
3977
- },
3978
- componentAdded(fn) {
3979
- return devtoolsHooks.hook("component:added" /* COMPONENT_ADDED */, fn);
3980
- },
3981
- componentUpdated(fn) {
3982
- return devtoolsHooks.hook("component:updated" /* COMPONENT_UPDATED */, fn);
3983
- },
3984
- componentRemoved(fn) {
3985
- return devtoolsHooks.hook("component:removed" /* COMPONENT_REMOVED */, fn);
3986
- },
3987
- setupDevtoolsPlugin(fn) {
3988
- devtoolsHooks.hook("devtools-plugin:setup" /* SETUP_DEVTOOLS_PLUGIN */, fn);
3989
- }
3990
- };
3991
- function createDevToolsHook() {
3992
- return {
3993
- id: "vue-devtools-next",
3994
- devtoolsVersion: "7.0",
3995
- enabled: false,
3996
- appRecords: [],
3997
- apps: [],
3998
- events: /* @__PURE__ */ new Map(),
3999
- on(event, fn) {
4000
- var _a25;
4001
- if (!this.events.has(event))
4002
- this.events.set(event, []);
4003
- (_a25 = this.events.get(event)) == null ? void 0 : _a25.push(fn);
4004
- return () => this.off(event, fn);
4005
- },
4006
- once(event, fn) {
4007
- const onceFn = (...args) => {
4008
- this.off(event, onceFn);
4009
- fn(...args);
4010
- };
4011
- this.on(event, onceFn);
4012
- return [event, onceFn];
4013
- },
4014
- off(event, fn) {
4015
- if (this.events.has(event)) {
4016
- const eventCallbacks = this.events.get(event);
4017
- const index = eventCallbacks.indexOf(fn);
4018
- if (index !== -1)
4019
- eventCallbacks.splice(index, 1);
4020
- }
4021
- },
4022
- emit(event, ...payload) {
4023
- if (this.events.has(event))
4024
- this.events.get(event).forEach((fn) => fn(...payload));
4040
+ updatePluginSettings(pluginId, key, value) {
4041
+ setPluginSettings(pluginId, key, value);
4042
+ },
4043
+ getPluginSettings(pluginId) {
4044
+ return {
4045
+ options: getPluginSettingsOptions(pluginId),
4046
+ values: getPluginSettings(pluginId)
4047
+ };
4025
4048
  }
4026
4049
  };
4027
4050
  }
4028
- function subscribeDevToolsHook() {
4029
- const hook2 = target10.__VUE_DEVTOOLS_GLOBAL_HOOK__;
4030
- hook2.on("app:init" /* APP_INIT */, (app, version) => {
4031
- var _a25, _b25, _c;
4032
- if ((_c = (_b25 = (_a25 = app == null ? void 0 : app._instance) == null ? void 0 : _a25.type) == null ? void 0 : _b25.devtools) == null ? void 0 : _c.hide)
4033
- return;
4034
- devtoolsHooks.callHook("app:init" /* APP_INIT */, app, version);
4035
- });
4036
- hook2.on("app:unmount" /* APP_UNMOUNT */, (app) => {
4037
- devtoolsHooks.callHook("app:unmount" /* APP_UNMOUNT */, app);
4038
- });
4039
- hook2.on("component:added" /* COMPONENT_ADDED */, async (app, uid, parentUid, component) => {
4040
- var _a25, _b25, _c;
4041
- if (((_c = (_b25 = (_a25 = app == null ? void 0 : app._instance) == null ? void 0 : _a25.type) == null ? void 0 : _b25.devtools) == null ? void 0 : _c.hide) || devtoolsState.highPerfModeEnabled)
4042
- return;
4043
- if (!app || typeof uid !== "number" && !uid || !component)
4044
- return;
4045
- devtoolsHooks.callHook("component:added" /* COMPONENT_ADDED */, app, uid, parentUid, component);
4046
- });
4047
- hook2.on("component:updated" /* COMPONENT_UPDATED */, (app, uid, parentUid, component) => {
4048
- if (!app || typeof uid !== "number" && !uid || !component || devtoolsState.highPerfModeEnabled)
4049
- return;
4050
- devtoolsHooks.callHook("component:updated" /* COMPONENT_UPDATED */, app, uid, parentUid, component);
4051
- });
4052
- hook2.on("component:removed" /* COMPONENT_REMOVED */, async (app, uid, parentUid, component) => {
4053
- if (!app || typeof uid !== "number" && !uid || !component || devtoolsState.highPerfModeEnabled)
4054
- return;
4055
- devtoolsHooks.callHook("component:removed" /* COMPONENT_REMOVED */, app, uid, parentUid, component);
4056
- });
4057
- hook2.on("devtools-plugin:setup" /* SETUP_DEVTOOLS_PLUGIN */, (pluginDescriptor, setupFn, options) => {
4058
- if ((options == null ? void 0 : options.target) === "legacy")
4059
- return;
4060
- devtoolsHooks.callHook("devtools-plugin:setup" /* SETUP_DEVTOOLS_PLUGIN */, pluginDescriptor, setupFn);
4061
- });
4062
- }
4063
- var hook = {
4064
- on,
4065
- setupDevToolsPlugin(pluginDescriptor, setupFn) {
4066
- return devtoolsHooks.callHook("devtools-plugin:setup" /* SETUP_DEVTOOLS_PLUGIN */, pluginDescriptor, setupFn);
4067
- }
4068
- };
4069
4051
 
4070
- // src/compat/index.ts
4052
+ // src/ctx/env.ts
4071
4053
  init_esm_shims();
4072
- import { target as target11 } from "@vue/devtools-shared";
4073
- function onLegacyDevToolsPluginApiAvailable(cb) {
4074
- if (target11.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__) {
4075
- cb();
4076
- return;
4077
- }
4078
- Object.defineProperty(target11, "__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__", {
4079
- set(value) {
4080
- if (value)
4081
- cb();
4082
- },
4083
- configurable: true
4084
- });
4054
+ import { target as target10 } from "@vue/devtools-shared";
4055
+ var _a15, _b15;
4056
+ (_b15 = (_a15 = target10).__VUE_DEVTOOLS_ENV__) != null ? _b15 : _a15.__VUE_DEVTOOLS_ENV__ = {
4057
+ vitePluginDetected: false
4058
+ };
4059
+ function getDevToolsEnv() {
4060
+ return target10.__VUE_DEVTOOLS_ENV__;
4061
+ }
4062
+ function setDevToolsEnv(env) {
4063
+ target10.__VUE_DEVTOOLS_ENV__ = {
4064
+ ...target10.__VUE_DEVTOOLS_ENV__,
4065
+ ...env
4066
+ };
4085
4067
  }
4086
4068
 
4069
+ // src/ctx/index.ts
4070
+ var hooks = createDevToolsCtxHooks();
4071
+ var _a16, _b16;
4072
+ (_b16 = (_a16 = target11).__VUE_DEVTOOLS_KIT_CONTEXT__) != null ? _b16 : _a16.__VUE_DEVTOOLS_KIT_CONTEXT__ = {
4073
+ hooks,
4074
+ get state() {
4075
+ return {
4076
+ ...devtoolsState,
4077
+ activeAppRecordId: activeAppRecord.id,
4078
+ activeAppRecord: activeAppRecord.value,
4079
+ appRecords: devtoolsAppRecords.value
4080
+ };
4081
+ },
4082
+ api: createDevToolsApi(hooks)
4083
+ };
4084
+ var devtoolsContext = target11.__VUE_DEVTOOLS_KIT_CONTEXT__;
4085
+
4087
4086
  // src/core/app/index.ts
4088
4087
  init_esm_shims();
4089
4088
  var import_speakingurl = __toESM(require_speakingurl2(), 1);
@@ -4163,10 +4162,21 @@ function initDevTools() {
4163
4162
  Object.assign(__VUE_DEVTOOLS_GLOBAL_HOOK__, createDevToolsHook());
4164
4163
  }
4165
4164
  }
4165
+ target13.__VUE_DEVTOOLS_GLOBAL_HOOK__.once("init", (Vue) => {
4166
+ console.log("%c[_____Vue DevTools v7 log_____]", "color: red; font-bold: 700; font-size: 20px;");
4167
+ console.log("%cVue DevTools v7 detected in your Vue2 project. v7 only supports Vue3 and will not work.", "font-bold: 700; font-size: 16px;");
4168
+ const url = "https://chromewebstore.google.com/detail/vuejs-devtools/iaajmlceplecbljialhhkmedjlpdblhp";
4169
+ console.log(`%cThe legacy version that supports both Vue 2 and Vue 3 has been moved to %c ${url}`, "font-size: 16px;", "text-decoration: underline; cursor: pointer;font-size: 16px;");
4170
+ console.log("%cPlease install and enable only the legacy version for your Vue2 app.", "font-bold: 700; font-size: 16px;");
4171
+ console.log("%c[_____Vue DevTools v7 log_____]", "color: red; font-bold: 700; font-size: 20px;");
4172
+ });
4166
4173
  hook.on.setupDevtoolsPlugin((pluginDescriptor, setupFn) => {
4167
4174
  var _a26;
4168
4175
  addDevToolsPluginToBuffer(pluginDescriptor, setupFn);
4169
4176
  const { app } = (_a26 = activeAppRecord) != null ? _a26 : {};
4177
+ if (pluginDescriptor.settings) {
4178
+ initPluginSettings(pluginDescriptor.id, pluginDescriptor.settings);
4179
+ }
4170
4180
  if (!app)
4171
4181
  return;
4172
4182
  callDevToolsPluginSetupFn([pluginDescriptor, setupFn], app);
@@ -4237,20 +4247,186 @@ function toggleHighPerfMode(state) {
4237
4247
  devtoolsState.highPerfModeEnabled = state != null ? state : !devtoolsState.highPerfModeEnabled;
4238
4248
  }
4239
4249
 
4250
+ // src/core/component/state/format.ts
4251
+ init_esm_shims();
4252
+
4253
+ // src/core/component/state/reviver.ts
4254
+ init_esm_shims();
4255
+ import { target as target14 } from "@vue/devtools-shared";
4256
+ function reviveSet(val) {
4257
+ const result = /* @__PURE__ */ new Set();
4258
+ const list = val._custom.value;
4259
+ for (let i = 0; i < list.length; i++) {
4260
+ const value = list[i];
4261
+ result.add(revive(value));
4262
+ }
4263
+ return result;
4264
+ }
4265
+ function reviveMap(val) {
4266
+ const result = /* @__PURE__ */ new Map();
4267
+ const list = val._custom.value;
4268
+ for (let i = 0; i < list.length; i++) {
4269
+ const { key, value } = list[i];
4270
+ result.set(key, revive(value));
4271
+ }
4272
+ return result;
4273
+ }
4274
+ function revive(val) {
4275
+ if (val === UNDEFINED) {
4276
+ return void 0;
4277
+ } else if (val === INFINITY) {
4278
+ return Number.POSITIVE_INFINITY;
4279
+ } else if (val === NEGATIVE_INFINITY) {
4280
+ return Number.NEGATIVE_INFINITY;
4281
+ } else if (val === NAN) {
4282
+ return Number.NaN;
4283
+ } else if (val && val._custom) {
4284
+ const { _custom: custom } = val;
4285
+ if (custom.type === "component")
4286
+ return activeAppRecord.value.instanceMap.get(custom.id);
4287
+ else if (custom.type === "map")
4288
+ return reviveMap(val);
4289
+ else if (custom.type === "set")
4290
+ return reviveSet(val);
4291
+ else if (custom.type === "bigint")
4292
+ return BigInt(custom.value);
4293
+ else
4294
+ return revive(custom.value);
4295
+ } else if (symbolRE.test(val)) {
4296
+ const [, string] = symbolRE.exec(val);
4297
+ return Symbol.for(string);
4298
+ } else if (specialTypeRE.test(val)) {
4299
+ const [, type, string, , details] = specialTypeRE.exec(val);
4300
+ const result = new target14[type](string);
4301
+ if (type === "Error" && details)
4302
+ result.stack = details;
4303
+ return result;
4304
+ } else {
4305
+ return val;
4306
+ }
4307
+ }
4308
+ function reviver(key, value) {
4309
+ return revive(value);
4310
+ }
4311
+
4312
+ // src/core/component/state/format.ts
4313
+ function getInspectorStateValueType(value, raw = true) {
4314
+ const type = typeof value;
4315
+ if (value == null || value === UNDEFINED || value === "undefined") {
4316
+ return "null";
4317
+ } else if (type === "boolean" || type === "number" || value === INFINITY || value === NEGATIVE_INFINITY || value === NAN) {
4318
+ return "literal";
4319
+ } else if (value == null ? void 0 : value._custom) {
4320
+ if (raw || value._custom.display != null || value._custom.displayText != null)
4321
+ return "custom";
4322
+ else
4323
+ return getInspectorStateValueType(value._custom.value);
4324
+ } else if (typeof value === "string") {
4325
+ const typeMatch = specialTypeRE.exec(value);
4326
+ if (typeMatch) {
4327
+ const [, type2] = typeMatch;
4328
+ return `native ${type2}`;
4329
+ } else {
4330
+ return "string";
4331
+ }
4332
+ } else if (Array.isArray(value) || (value == null ? void 0 : value._isArray)) {
4333
+ return "array";
4334
+ } else if (isPlainObject(value)) {
4335
+ return "plain-object";
4336
+ } else {
4337
+ return "unknown";
4338
+ }
4339
+ }
4340
+ function formatInspectorStateValue(value, quotes = false, options) {
4341
+ var _a25, _b25, _c;
4342
+ const { customClass } = options != null ? options : {};
4343
+ let result;
4344
+ const type = getInspectorStateValueType(value, false);
4345
+ if (type !== "custom" && (value == null ? void 0 : value._custom))
4346
+ value = value._custom.value;
4347
+ if (result = internalStateTokenToString(value)) {
4348
+ return result;
4349
+ } else if (type === "custom") {
4350
+ const nestedName = ((_a25 = value._custom.value) == null ? void 0 : _a25._custom) && formatInspectorStateValue(value._custom.value, quotes, options);
4351
+ return nestedName || value._custom.displayText || value._custom.display;
4352
+ } else if (type === "array") {
4353
+ return `Array[${value.length}]`;
4354
+ } else if (type === "plain-object") {
4355
+ return `Object${Object.keys(value).length ? "" : " (empty)"}`;
4356
+ } else if (type == null ? void 0 : type.includes("native")) {
4357
+ return escape((_b25 = specialTypeRE.exec(value)) == null ? void 0 : _b25[2]);
4358
+ } else if (typeof value === "string") {
4359
+ const typeMatch = value.match(rawTypeRE);
4360
+ if (typeMatch) {
4361
+ value = escapeString(typeMatch[1]);
4362
+ } else if (quotes) {
4363
+ value = `<span>"</span>${(customClass == null ? void 0 : customClass.string) ? `<span class=${customClass.string}>${escapeString(value)}</span>` : escapeString(value)}<span>"</span>`;
4364
+ } else {
4365
+ value = (customClass == null ? void 0 : customClass.string) ? `<span class="${(_c = customClass == null ? void 0 : customClass.string) != null ? _c : ""}">${escapeString(value)}</span>` : escapeString(value);
4366
+ }
4367
+ }
4368
+ return value;
4369
+ }
4370
+ function escapeString(value) {
4371
+ return escape(value).replace(/ /g, "&nbsp;").replace(/\n/g, "<span>\\n</span>");
4372
+ }
4373
+ function getRaw(value) {
4374
+ var _a25, _b25, _c;
4375
+ let customType;
4376
+ const isCustom = getInspectorStateValueType(value) === "custom";
4377
+ let inherit = {};
4378
+ if (isCustom) {
4379
+ const data = value;
4380
+ const customValue = (_a25 = data._custom) == null ? void 0 : _a25.value;
4381
+ const currentCustomType = (_b25 = data._custom) == null ? void 0 : _b25.type;
4382
+ const nestedCustom = typeof customValue === "object" && customValue !== null && "_custom" in customValue ? getRaw(customValue) : { inherit: void 0, value: void 0, customType: void 0 };
4383
+ inherit = nestedCustom.inherit || ((_c = data._custom) == null ? void 0 : _c.fields) || {};
4384
+ value = nestedCustom.value || customValue;
4385
+ customType = nestedCustom.customType || currentCustomType;
4386
+ }
4387
+ if (value && value._isArray)
4388
+ value = value.items;
4389
+ return { value, inherit, customType };
4390
+ }
4391
+ function toEdit(value, customType) {
4392
+ if (customType === "bigint")
4393
+ return value;
4394
+ if (customType === "date")
4395
+ return value;
4396
+ return replaceTokenToString(JSON.stringify(value));
4397
+ }
4398
+ function toSubmit(value, customType) {
4399
+ if (customType === "bigint")
4400
+ return BigInt(value);
4401
+ if (customType === "date")
4402
+ return new Date(value);
4403
+ return JSON.parse(replaceStringToToken(value), reviver);
4404
+ }
4405
+
4406
+ // src/core/devtools-client/detected.ts
4407
+ init_esm_shims();
4408
+ import { target as target15 } from "@vue/devtools-shared";
4409
+ function updateDevToolsClientDetected(params) {
4410
+ devtoolsState.devtoolsClientDetected = {
4411
+ ...devtoolsState.devtoolsClientDetected,
4412
+ ...params
4413
+ };
4414
+ const devtoolsClientVisible = Object.values(devtoolsState.devtoolsClientDetected).some(Boolean);
4415
+ toggleHighPerfMode(!devtoolsClientVisible);
4416
+ }
4417
+ var _a18, _b18;
4418
+ (_b18 = (_a18 = target15).__VUE_DEVTOOLS_UPDATE_CLIENT_DETECTED__) != null ? _b18 : _a18.__VUE_DEVTOOLS_UPDATE_CLIENT_DETECTED__ = updateDevToolsClientDetected;
4419
+
4240
4420
  // src/messaging/index.ts
4241
4421
  init_esm_shims();
4422
+ import { target as target21 } from "@vue/devtools-shared";
4242
4423
  import { createBirpc, createBirpcGroup } from "birpc";
4243
- import { target as target19 } from "@vue/devtools-shared";
4244
4424
 
4245
4425
  // src/messaging/presets/index.ts
4246
4426
  init_esm_shims();
4247
4427
 
4248
- // src/messaging/presets/iframe/index.ts
4249
- init_esm_shims();
4250
-
4251
- // src/messaging/presets/iframe/client.ts
4428
+ // src/messaging/presets/broadcast-channel/index.ts
4252
4429
  init_esm_shims();
4253
- import { isBrowser } from "@vue/devtools-shared";
4254
4430
 
4255
4431
  // ../../node_modules/.pnpm/superjson@2.2.1/node_modules/superjson/dist/index.js
4256
4432
  init_esm_shims();
@@ -5060,84 +5236,6 @@ var registerCustom = SuperJSON.registerCustom;
5060
5236
  var registerSymbol = SuperJSON.registerSymbol;
5061
5237
  var allowErrorProps = SuperJSON.allowErrorProps;
5062
5238
 
5063
- // src/messaging/presets/iframe/context.ts
5064
- init_esm_shims();
5065
- import { target as target14 } from "@vue/devtools-shared";
5066
- var __DEVTOOLS_KIT_IFRAME_MESSAGING_EVENT_KEY = "__devtools-kit-iframe-messaging-event-key__";
5067
- var __IFRAME_SERVER_CONTEXT__ = "iframe:server-context";
5068
- function getIframeServerContext() {
5069
- return target14[__IFRAME_SERVER_CONTEXT__];
5070
- }
5071
- function setIframeServerContext(context) {
5072
- target14[__IFRAME_SERVER_CONTEXT__] = context;
5073
- }
5074
-
5075
- // src/messaging/presets/iframe/client.ts
5076
- function createIframeClientChannel() {
5077
- if (!isBrowser) {
5078
- return {
5079
- post: (data) => {
5080
- },
5081
- on: (handler) => {
5082
- }
5083
- };
5084
- }
5085
- return {
5086
- post: (data) => window.parent.postMessage(SuperJSON.stringify({
5087
- event: __DEVTOOLS_KIT_IFRAME_MESSAGING_EVENT_KEY,
5088
- data
5089
- }), "*"),
5090
- on: (handler) => window.addEventListener("message", (event) => {
5091
- try {
5092
- const parsed = SuperJSON.parse(event.data);
5093
- if (event.source === window.parent && parsed.event === __DEVTOOLS_KIT_IFRAME_MESSAGING_EVENT_KEY) {
5094
- handler(parsed.data);
5095
- }
5096
- } catch (e) {
5097
- }
5098
- })
5099
- };
5100
- }
5101
-
5102
- // src/messaging/presets/iframe/server.ts
5103
- init_esm_shims();
5104
- import { isBrowser as isBrowser2 } from "@vue/devtools-shared";
5105
- function createIframeServerChannel() {
5106
- if (!isBrowser2) {
5107
- return {
5108
- post: (data) => {
5109
- },
5110
- on: (handler) => {
5111
- }
5112
- };
5113
- }
5114
- return {
5115
- post: (data) => {
5116
- var _a25;
5117
- const iframe = getIframeServerContext();
5118
- (_a25 = iframe == null ? void 0 : iframe.contentWindow) == null ? void 0 : _a25.postMessage(SuperJSON.stringify({
5119
- event: __DEVTOOLS_KIT_IFRAME_MESSAGING_EVENT_KEY,
5120
- data
5121
- }), "*");
5122
- },
5123
- on: (handler) => {
5124
- window.addEventListener("message", (event) => {
5125
- const iframe = getIframeServerContext();
5126
- try {
5127
- const parsed = SuperJSON.parse(event.data);
5128
- if (event.source === (iframe == null ? void 0 : iframe.contentWindow) && parsed.event === __DEVTOOLS_KIT_IFRAME_MESSAGING_EVENT_KEY) {
5129
- handler(parsed.data);
5130
- }
5131
- } catch (e) {
5132
- }
5133
- });
5134
- }
5135
- };
5136
- }
5137
-
5138
- // src/messaging/presets/broadcast-channel/index.ts
5139
- init_esm_shims();
5140
-
5141
5239
  // src/messaging/presets/broadcast-channel/context.ts
5142
5240
  init_esm_shims();
5143
5241
  var __DEVTOOLS_KIT_BROADCAST_MESSAGING_EVENT_KEY = "__devtools-kit-broadcast-messaging-event-key__";
@@ -5164,79 +5262,15 @@ function createBroadcastChannel() {
5164
5262
  };
5165
5263
  }
5166
5264
 
5167
- // src/messaging/presets/vite/index.ts
5168
- init_esm_shims();
5169
-
5170
- // src/messaging/presets/vite/client.ts
5171
- init_esm_shims();
5172
-
5173
- // src/messaging/presets/vite/context.ts
5174
- init_esm_shims();
5175
- import { target as target15 } from "@vue/devtools-shared";
5176
- var __DEVTOOLS_KIT_VITE_MESSAGING_EVENT_KEY = "__devtools-kit-vite-messaging-event-key__";
5177
- var __VITE_CLIENT_CONTEXT__ = "vite:client-context";
5178
- var __VITE_SERVER_CONTEXT__ = "vite:server-context";
5179
- function getViteClientContext() {
5180
- return target15[__VITE_CLIENT_CONTEXT__];
5181
- }
5182
- function setViteClientContext(context) {
5183
- target15[__VITE_CLIENT_CONTEXT__] = context;
5184
- }
5185
- function getViteServerContext() {
5186
- return target15[__VITE_SERVER_CONTEXT__];
5187
- }
5188
- function setViteServerContext(context) {
5189
- target15[__VITE_SERVER_CONTEXT__] = context;
5190
- }
5191
-
5192
- // src/messaging/presets/vite/client.ts
5193
- function createViteClientChannel() {
5194
- const client = getViteClientContext();
5195
- return {
5196
- post: (data) => {
5197
- client == null ? void 0 : client.send(__DEVTOOLS_KIT_VITE_MESSAGING_EVENT_KEY, SuperJSON.stringify(data));
5198
- },
5199
- on: (handler) => {
5200
- client == null ? void 0 : client.on(__DEVTOOLS_KIT_VITE_MESSAGING_EVENT_KEY, (event) => {
5201
- handler(SuperJSON.parse(event));
5202
- });
5203
- }
5204
- };
5205
- }
5206
-
5207
- // src/messaging/presets/vite/server.ts
5208
- init_esm_shims();
5209
- function createViteServerChannel() {
5210
- var _a25;
5211
- const viteServer = getViteServerContext();
5212
- const ws = (_a25 = viteServer.hot) != null ? _a25 : viteServer.ws;
5213
- return {
5214
- post: (data) => ws == null ? void 0 : ws.send(__DEVTOOLS_KIT_VITE_MESSAGING_EVENT_KEY, SuperJSON.stringify(data)),
5215
- on: (handler) => ws == null ? void 0 : ws.on(__DEVTOOLS_KIT_VITE_MESSAGING_EVENT_KEY, (event) => {
5216
- handler(SuperJSON.parse(event));
5217
- })
5218
- };
5219
- }
5220
-
5221
- // src/messaging/presets/ws/index.ts
5222
- init_esm_shims();
5223
-
5224
- // src/messaging/presets/ws/client.ts
5225
- init_esm_shims();
5226
-
5227
- // src/messaging/presets/ws/context.ts
5228
- init_esm_shims();
5229
- import { target as target16 } from "@vue/devtools-shared";
5230
-
5231
- // src/messaging/presets/ws/server.ts
5265
+ // src/messaging/presets/electron/index.ts
5232
5266
  init_esm_shims();
5233
5267
 
5234
- // src/messaging/presets/electron/index.ts
5268
+ // src/messaging/presets/electron/client.ts
5235
5269
  init_esm_shims();
5236
5270
 
5237
5271
  // src/messaging/presets/electron/context.ts
5238
5272
  init_esm_shims();
5239
- import { target as target17 } from "@vue/devtools-shared";
5273
+ import { target as target16 } from "@vue/devtools-shared";
5240
5274
  var __ELECTRON_CLIENT_CONTEXT__ = "electron:client-context";
5241
5275
  var __ELECTRON_RPOXY_CONTEXT__ = "electron:proxy-context";
5242
5276
  var __ELECTRON_SERVER_CONTEXT__ = "electron:server-context";
@@ -5254,26 +5288,25 @@ var __DEVTOOLS_KIT_ELECTRON_MESSAGING_EVENT_KEY__ = {
5254
5288
  // on: proxy->server
5255
5289
  };
5256
5290
  function getElectronClientContext() {
5257
- return target17[__ELECTRON_CLIENT_CONTEXT__];
5291
+ return target16[__ELECTRON_CLIENT_CONTEXT__];
5258
5292
  }
5259
5293
  function setElectronClientContext(context) {
5260
- target17[__ELECTRON_CLIENT_CONTEXT__] = context;
5294
+ target16[__ELECTRON_CLIENT_CONTEXT__] = context;
5261
5295
  }
5262
5296
  function getElectronProxyContext() {
5263
- return target17[__ELECTRON_RPOXY_CONTEXT__];
5297
+ return target16[__ELECTRON_RPOXY_CONTEXT__];
5264
5298
  }
5265
5299
  function setElectronProxyContext(context) {
5266
- target17[__ELECTRON_RPOXY_CONTEXT__] = context;
5300
+ target16[__ELECTRON_RPOXY_CONTEXT__] = context;
5267
5301
  }
5268
5302
  function getElectronServerContext() {
5269
- return target17[__ELECTRON_SERVER_CONTEXT__];
5303
+ return target16[__ELECTRON_SERVER_CONTEXT__];
5270
5304
  }
5271
5305
  function setElectronServerContext(context) {
5272
- target17[__ELECTRON_SERVER_CONTEXT__] = context;
5306
+ target16[__ELECTRON_SERVER_CONTEXT__] = context;
5273
5307
  }
5274
5308
 
5275
5309
  // src/messaging/presets/electron/client.ts
5276
- init_esm_shims();
5277
5310
  function createElectronClientChannel() {
5278
5311
  const socket = getElectronClientContext();
5279
5312
  return {
@@ -5325,9 +5358,12 @@ function createElectronServerChannel() {
5325
5358
  // src/messaging/presets/extension/index.ts
5326
5359
  init_esm_shims();
5327
5360
 
5361
+ // src/messaging/presets/extension/client.ts
5362
+ init_esm_shims();
5363
+
5328
5364
  // src/messaging/presets/extension/context.ts
5329
5365
  init_esm_shims();
5330
- import { target as target18 } from "@vue/devtools-shared";
5366
+ import { target as target17 } from "@vue/devtools-shared";
5331
5367
  var __EXTENSION_CLIENT_CONTEXT__ = "electron:client-context";
5332
5368
  var __DEVTOOLS_KIT_EXTENSION_MESSAGING_EVENT_KEY__ = {
5333
5369
  // client
@@ -5343,14 +5379,13 @@ var __DEVTOOLS_KIT_EXTENSION_MESSAGING_EVENT_KEY__ = {
5343
5379
  // on: proxy->server
5344
5380
  };
5345
5381
  function getExtensionClientContext() {
5346
- return target18[__EXTENSION_CLIENT_CONTEXT__];
5382
+ return target17[__EXTENSION_CLIENT_CONTEXT__];
5347
5383
  }
5348
5384
  function setExtensionClientContext(context) {
5349
- target18[__EXTENSION_CLIENT_CONTEXT__] = context;
5385
+ target17[__EXTENSION_CLIENT_CONTEXT__] = context;
5350
5386
  }
5351
5387
 
5352
5388
  // src/messaging/presets/extension/client.ts
5353
- init_esm_shims();
5354
5389
  function createExtensionClientChannel() {
5355
5390
  let disconnected = false;
5356
5391
  let port = null;
@@ -5433,66 +5468,215 @@ function createExtensionProxyChannel() {
5433
5468
  };
5434
5469
  }
5435
5470
 
5436
- // src/messaging/presets/extension/server.ts
5471
+ // src/messaging/presets/extension/server.ts
5472
+ init_esm_shims();
5473
+ function createExtensionServerChannel() {
5474
+ return {
5475
+ post: (data) => {
5476
+ window.postMessage({
5477
+ source: __DEVTOOLS_KIT_EXTENSION_MESSAGING_EVENT_KEY__.SERVER_TO_PROXY,
5478
+ payload: SuperJSON.stringify(data)
5479
+ }, "*");
5480
+ },
5481
+ on: (handler) => {
5482
+ const listener = (event) => {
5483
+ if (event.data.source === __DEVTOOLS_KIT_EXTENSION_MESSAGING_EVENT_KEY__.PROXY_TO_SERVER && event.data.payload) {
5484
+ handler(SuperJSON.parse(event.data.payload));
5485
+ }
5486
+ };
5487
+ window.addEventListener("message", listener);
5488
+ return () => {
5489
+ window.removeEventListener("message", listener);
5490
+ };
5491
+ }
5492
+ };
5493
+ }
5494
+
5495
+ // src/messaging/presets/iframe/index.ts
5496
+ init_esm_shims();
5497
+
5498
+ // src/messaging/presets/iframe/client.ts
5499
+ init_esm_shims();
5500
+ import { isBrowser } from "@vue/devtools-shared";
5501
+
5502
+ // src/messaging/presets/iframe/context.ts
5503
+ init_esm_shims();
5504
+ import { target as target18 } from "@vue/devtools-shared";
5505
+ var __DEVTOOLS_KIT_IFRAME_MESSAGING_EVENT_KEY = "__devtools-kit-iframe-messaging-event-key__";
5506
+ var __IFRAME_SERVER_CONTEXT__ = "iframe:server-context";
5507
+ function getIframeServerContext() {
5508
+ return target18[__IFRAME_SERVER_CONTEXT__];
5509
+ }
5510
+ function setIframeServerContext(context) {
5511
+ target18[__IFRAME_SERVER_CONTEXT__] = context;
5512
+ }
5513
+
5514
+ // src/messaging/presets/iframe/client.ts
5515
+ function createIframeClientChannel() {
5516
+ if (!isBrowser) {
5517
+ return {
5518
+ post: (data) => {
5519
+ },
5520
+ on: (handler) => {
5521
+ }
5522
+ };
5523
+ }
5524
+ return {
5525
+ post: (data) => window.parent.postMessage(SuperJSON.stringify({
5526
+ event: __DEVTOOLS_KIT_IFRAME_MESSAGING_EVENT_KEY,
5527
+ data
5528
+ }), "*"),
5529
+ on: (handler) => window.addEventListener("message", (event) => {
5530
+ try {
5531
+ const parsed = SuperJSON.parse(event.data);
5532
+ if (event.source === window.parent && parsed.event === __DEVTOOLS_KIT_IFRAME_MESSAGING_EVENT_KEY) {
5533
+ handler(parsed.data);
5534
+ }
5535
+ } catch (e) {
5536
+ }
5537
+ })
5538
+ };
5539
+ }
5540
+
5541
+ // src/messaging/presets/iframe/server.ts
5542
+ init_esm_shims();
5543
+ import { isBrowser as isBrowser2 } from "@vue/devtools-shared";
5544
+ function createIframeServerChannel() {
5545
+ if (!isBrowser2) {
5546
+ return {
5547
+ post: (data) => {
5548
+ },
5549
+ on: (handler) => {
5550
+ }
5551
+ };
5552
+ }
5553
+ return {
5554
+ post: (data) => {
5555
+ var _a25;
5556
+ const iframe = getIframeServerContext();
5557
+ (_a25 = iframe == null ? void 0 : iframe.contentWindow) == null ? void 0 : _a25.postMessage(SuperJSON.stringify({
5558
+ event: __DEVTOOLS_KIT_IFRAME_MESSAGING_EVENT_KEY,
5559
+ data
5560
+ }), "*");
5561
+ },
5562
+ on: (handler) => {
5563
+ window.addEventListener("message", (event) => {
5564
+ const iframe = getIframeServerContext();
5565
+ try {
5566
+ const parsed = SuperJSON.parse(event.data);
5567
+ if (event.source === (iframe == null ? void 0 : iframe.contentWindow) && parsed.event === __DEVTOOLS_KIT_IFRAME_MESSAGING_EVENT_KEY) {
5568
+ handler(parsed.data);
5569
+ }
5570
+ } catch (e) {
5571
+ }
5572
+ });
5573
+ }
5574
+ };
5575
+ }
5576
+
5577
+ // src/messaging/presets/vite/index.ts
5437
5578
  init_esm_shims();
5438
- function createExtensionServerChannel() {
5579
+
5580
+ // src/messaging/presets/vite/client.ts
5581
+ init_esm_shims();
5582
+
5583
+ // src/messaging/presets/vite/context.ts
5584
+ init_esm_shims();
5585
+ import { target as target19 } from "@vue/devtools-shared";
5586
+ var __DEVTOOLS_KIT_VITE_MESSAGING_EVENT_KEY = "__devtools-kit-vite-messaging-event-key__";
5587
+ var __VITE_CLIENT_CONTEXT__ = "vite:client-context";
5588
+ var __VITE_SERVER_CONTEXT__ = "vite:server-context";
5589
+ function getViteClientContext() {
5590
+ return target19[__VITE_CLIENT_CONTEXT__];
5591
+ }
5592
+ function setViteClientContext(context) {
5593
+ target19[__VITE_CLIENT_CONTEXT__] = context;
5594
+ }
5595
+ function getViteServerContext() {
5596
+ return target19[__VITE_SERVER_CONTEXT__];
5597
+ }
5598
+ function setViteServerContext(context) {
5599
+ target19[__VITE_SERVER_CONTEXT__] = context;
5600
+ }
5601
+
5602
+ // src/messaging/presets/vite/client.ts
5603
+ function createViteClientChannel() {
5604
+ const client = getViteClientContext();
5439
5605
  return {
5440
5606
  post: (data) => {
5441
- window.postMessage({
5442
- source: __DEVTOOLS_KIT_EXTENSION_MESSAGING_EVENT_KEY__.SERVER_TO_PROXY,
5443
- payload: SuperJSON.stringify(data)
5444
- }, "*");
5607
+ client == null ? void 0 : client.send(__DEVTOOLS_KIT_VITE_MESSAGING_EVENT_KEY, SuperJSON.stringify(data));
5445
5608
  },
5446
5609
  on: (handler) => {
5447
- const listener = (event) => {
5448
- if (event.data.source === __DEVTOOLS_KIT_EXTENSION_MESSAGING_EVENT_KEY__.PROXY_TO_SERVER && event.data.payload) {
5449
- handler(SuperJSON.parse(event.data.payload));
5450
- }
5451
- };
5452
- window.addEventListener("message", listener);
5453
- return () => {
5454
- window.removeEventListener("message", listener);
5455
- };
5610
+ client == null ? void 0 : client.on(__DEVTOOLS_KIT_VITE_MESSAGING_EVENT_KEY, (event) => {
5611
+ handler(SuperJSON.parse(event));
5612
+ });
5456
5613
  }
5457
5614
  };
5458
5615
  }
5459
5616
 
5617
+ // src/messaging/presets/vite/server.ts
5618
+ init_esm_shims();
5619
+ function createViteServerChannel() {
5620
+ var _a25;
5621
+ const viteServer = getViteServerContext();
5622
+ const ws = (_a25 = viteServer.hot) != null ? _a25 : viteServer.ws;
5623
+ return {
5624
+ post: (data) => ws == null ? void 0 : ws.send(__DEVTOOLS_KIT_VITE_MESSAGING_EVENT_KEY, SuperJSON.stringify(data)),
5625
+ on: (handler) => ws == null ? void 0 : ws.on(__DEVTOOLS_KIT_VITE_MESSAGING_EVENT_KEY, (event) => {
5626
+ handler(SuperJSON.parse(event));
5627
+ })
5628
+ };
5629
+ }
5630
+
5631
+ // src/messaging/presets/ws/index.ts
5632
+ init_esm_shims();
5633
+
5634
+ // src/messaging/presets/ws/client.ts
5635
+ init_esm_shims();
5636
+
5637
+ // src/messaging/presets/ws/context.ts
5638
+ init_esm_shims();
5639
+ import { target as target20 } from "@vue/devtools-shared";
5640
+
5641
+ // src/messaging/presets/ws/server.ts
5642
+ init_esm_shims();
5643
+
5460
5644
  // src/messaging/index.ts
5461
- var _a18, _b18;
5462
- (_b18 = (_a18 = target19).__VUE_DEVTOOLS_KIT_MESSAGE_CHANNELS__) != null ? _b18 : _a18.__VUE_DEVTOOLS_KIT_MESSAGE_CHANNELS__ = [];
5463
5645
  var _a19, _b19;
5464
- (_b19 = (_a19 = target19).__VUE_DEVTOOLS_KIT_RPC_CLIENT__) != null ? _b19 : _a19.__VUE_DEVTOOLS_KIT_RPC_CLIENT__ = null;
5646
+ (_b19 = (_a19 = target21).__VUE_DEVTOOLS_KIT_MESSAGE_CHANNELS__) != null ? _b19 : _a19.__VUE_DEVTOOLS_KIT_MESSAGE_CHANNELS__ = [];
5465
5647
  var _a20, _b20;
5466
- (_b20 = (_a20 = target19).__VUE_DEVTOOLS_KIT_RPC_SERVER__) != null ? _b20 : _a20.__VUE_DEVTOOLS_KIT_RPC_SERVER__ = null;
5648
+ (_b20 = (_a20 = target21).__VUE_DEVTOOLS_KIT_RPC_CLIENT__) != null ? _b20 : _a20.__VUE_DEVTOOLS_KIT_RPC_CLIENT__ = null;
5467
5649
  var _a21, _b21;
5468
- (_b21 = (_a21 = target19).__VUE_DEVTOOLS_KIT_VITE_RPC_CLIENT__) != null ? _b21 : _a21.__VUE_DEVTOOLS_KIT_VITE_RPC_CLIENT__ = null;
5650
+ (_b21 = (_a21 = target21).__VUE_DEVTOOLS_KIT_RPC_SERVER__) != null ? _b21 : _a21.__VUE_DEVTOOLS_KIT_RPC_SERVER__ = null;
5469
5651
  var _a22, _b22;
5470
- (_b22 = (_a22 = target19).__VUE_DEVTOOLS_KIT_VITE_RPC_SERVER__) != null ? _b22 : _a22.__VUE_DEVTOOLS_KIT_VITE_RPC_SERVER__ = null;
5652
+ (_b22 = (_a22 = target21).__VUE_DEVTOOLS_KIT_VITE_RPC_CLIENT__) != null ? _b22 : _a22.__VUE_DEVTOOLS_KIT_VITE_RPC_CLIENT__ = null;
5471
5653
  var _a23, _b23;
5472
- (_b23 = (_a23 = target19).__VUE_DEVTOOLS_KIT_BROADCAST_RPC_SERVER__) != null ? _b23 : _a23.__VUE_DEVTOOLS_KIT_BROADCAST_RPC_SERVER__ = null;
5654
+ (_b23 = (_a23 = target21).__VUE_DEVTOOLS_KIT_VITE_RPC_SERVER__) != null ? _b23 : _a23.__VUE_DEVTOOLS_KIT_VITE_RPC_SERVER__ = null;
5655
+ var _a24, _b24;
5656
+ (_b24 = (_a24 = target21).__VUE_DEVTOOLS_KIT_BROADCAST_RPC_SERVER__) != null ? _b24 : _a24.__VUE_DEVTOOLS_KIT_BROADCAST_RPC_SERVER__ = null;
5473
5657
  function setRpcClientToGlobal(rpc) {
5474
- target19.__VUE_DEVTOOLS_KIT_RPC_CLIENT__ = rpc;
5658
+ target21.__VUE_DEVTOOLS_KIT_RPC_CLIENT__ = rpc;
5475
5659
  }
5476
5660
  function setRpcServerToGlobal(rpc) {
5477
- target19.__VUE_DEVTOOLS_KIT_RPC_SERVER__ = rpc;
5661
+ target21.__VUE_DEVTOOLS_KIT_RPC_SERVER__ = rpc;
5478
5662
  }
5479
5663
  function getRpcClient() {
5480
- return target19.__VUE_DEVTOOLS_KIT_RPC_CLIENT__;
5664
+ return target21.__VUE_DEVTOOLS_KIT_RPC_CLIENT__;
5481
5665
  }
5482
5666
  function getRpcServer() {
5483
- return target19.__VUE_DEVTOOLS_KIT_RPC_SERVER__;
5667
+ return target21.__VUE_DEVTOOLS_KIT_RPC_SERVER__;
5484
5668
  }
5485
5669
  function setViteRpcClientToGlobal(rpc) {
5486
- target19.__VUE_DEVTOOLS_KIT_VITE_RPC_CLIENT__ = rpc;
5670
+ target21.__VUE_DEVTOOLS_KIT_VITE_RPC_CLIENT__ = rpc;
5487
5671
  }
5488
5672
  function setViteRpcServerToGlobal(rpc) {
5489
- target19.__VUE_DEVTOOLS_KIT_VITE_RPC_SERVER__ = rpc;
5673
+ target21.__VUE_DEVTOOLS_KIT_VITE_RPC_SERVER__ = rpc;
5490
5674
  }
5491
5675
  function getViteRpcClient() {
5492
- return target19.__VUE_DEVTOOLS_KIT_VITE_RPC_CLIENT__;
5676
+ return target21.__VUE_DEVTOOLS_KIT_VITE_RPC_CLIENT__;
5493
5677
  }
5494
5678
  function getViteRpcServer() {
5495
- return target19.__VUE_DEVTOOLS_KIT_VITE_RPC_SERVER__;
5679
+ return target21.__VUE_DEVTOOLS_KIT_VITE_RPC_SERVER__;
5496
5680
  }
5497
5681
  function getChannel(preset, host = "client") {
5498
5682
  const channel = {
@@ -5569,6 +5753,12 @@ function createRpcProxy(options = {}) {
5569
5753
  // src/shared/index.ts
5570
5754
  init_esm_shims();
5571
5755
 
5756
+ // src/shared/env.ts
5757
+ init_esm_shims();
5758
+
5759
+ // src/shared/time.ts
5760
+ init_esm_shims();
5761
+
5572
5762
  // src/shared/util.ts
5573
5763
  init_esm_shims();
5574
5764
 
@@ -5877,65 +6067,6 @@ function stringifyReplacer(key, _value, depth, seenInstance) {
5877
6067
  return sanitize(val);
5878
6068
  }
5879
6069
 
5880
- // src/core/component/state/reviver.ts
5881
- init_esm_shims();
5882
- import { target as target20 } from "@vue/devtools-shared";
5883
- function reviveSet(val) {
5884
- const result = /* @__PURE__ */ new Set();
5885
- const list = val._custom.value;
5886
- for (let i = 0; i < list.length; i++) {
5887
- const value = list[i];
5888
- result.add(revive(value));
5889
- }
5890
- return result;
5891
- }
5892
- function reviveMap(val) {
5893
- const result = /* @__PURE__ */ new Map();
5894
- const list = val._custom.value;
5895
- for (let i = 0; i < list.length; i++) {
5896
- const { key, value } = list[i];
5897
- result.set(key, revive(value));
5898
- }
5899
- return result;
5900
- }
5901
- function revive(val) {
5902
- if (val === UNDEFINED) {
5903
- return void 0;
5904
- } else if (val === INFINITY) {
5905
- return Number.POSITIVE_INFINITY;
5906
- } else if (val === NEGATIVE_INFINITY) {
5907
- return Number.NEGATIVE_INFINITY;
5908
- } else if (val === NAN) {
5909
- return Number.NaN;
5910
- } else if (val && val._custom) {
5911
- const { _custom: custom } = val;
5912
- if (custom.type === "component")
5913
- return activeAppRecord.value.instanceMap.get(custom.id);
5914
- else if (custom.type === "map")
5915
- return reviveMap(val);
5916
- else if (custom.type === "set")
5917
- return reviveSet(val);
5918
- else if (custom.type === "bigint")
5919
- return BigInt(custom.value);
5920
- else
5921
- return revive(custom.value);
5922
- } else if (symbolRE.test(val)) {
5923
- const [, string] = symbolRE.exec(val);
5924
- return Symbol.for(string);
5925
- } else if (specialTypeRE.test(val)) {
5926
- const [, type, string, , details] = specialTypeRE.exec(val);
5927
- const result = new target20[type](string);
5928
- if (type === "Error" && details)
5929
- result.stack = details;
5930
- return result;
5931
- } else {
5932
- return val;
5933
- }
5934
- }
5935
- function reviver(key, value) {
5936
- return revive(value);
5937
- }
5938
-
5939
6070
  // src/shared/transfer.ts
5940
6071
  init_esm_shims();
5941
6072
  var MAX_SERIALIZED_SIZE = 2 * 1024 * 1024;
@@ -6060,101 +6191,6 @@ function parseCircularAutoChunks(data, reviver2 = null) {
6060
6191
  }
6061
6192
  }
6062
6193
 
6063
- // src/core/component/state/format.ts
6064
- init_esm_shims();
6065
- function getInspectorStateValueType(value, raw = true) {
6066
- const type = typeof value;
6067
- if (value == null || value === UNDEFINED || value === "undefined") {
6068
- return "null";
6069
- } else if (type === "boolean" || type === "number" || value === INFINITY || value === NEGATIVE_INFINITY || value === NAN) {
6070
- return "literal";
6071
- } else if (value == null ? void 0 : value._custom) {
6072
- if (raw || value._custom.display != null || value._custom.displayText != null)
6073
- return "custom";
6074
- else
6075
- return getInspectorStateValueType(value._custom.value);
6076
- } else if (typeof value === "string") {
6077
- const typeMatch = specialTypeRE.exec(value);
6078
- if (typeMatch) {
6079
- const [, type2] = typeMatch;
6080
- return `native ${type2}`;
6081
- } else {
6082
- return "string";
6083
- }
6084
- } else if (Array.isArray(value) || (value == null ? void 0 : value._isArray)) {
6085
- return "array";
6086
- } else if (isPlainObject(value)) {
6087
- return "plain-object";
6088
- } else {
6089
- return "unknown";
6090
- }
6091
- }
6092
- function formatInspectorStateValue(value, quotes = false, options) {
6093
- var _a25, _b25, _c;
6094
- const { customClass } = options != null ? options : {};
6095
- let result;
6096
- const type = getInspectorStateValueType(value, false);
6097
- if (type !== "custom" && (value == null ? void 0 : value._custom))
6098
- value = value._custom.value;
6099
- if (result = internalStateTokenToString(value)) {
6100
- return result;
6101
- } else if (type === "custom") {
6102
- const nestedName = ((_a25 = value._custom.value) == null ? void 0 : _a25._custom) && formatInspectorStateValue(value._custom.value, quotes, options);
6103
- return nestedName || value._custom.displayText || value._custom.display;
6104
- } else if (type === "array") {
6105
- return `Array[${value.length}]`;
6106
- } else if (type === "plain-object") {
6107
- return `Object${Object.keys(value).length ? "" : " (empty)"}`;
6108
- } else if (type == null ? void 0 : type.includes("native")) {
6109
- return escape((_b25 = specialTypeRE.exec(value)) == null ? void 0 : _b25[2]);
6110
- } else if (typeof value === "string") {
6111
- const typeMatch = value.match(rawTypeRE);
6112
- if (typeMatch) {
6113
- value = escapeString(typeMatch[1]);
6114
- } else if (quotes) {
6115
- value = `<span>"</span>${(customClass == null ? void 0 : customClass.string) ? `<span class=${customClass.string}>${escapeString(value)}</span>` : escapeString(value)}<span>"</span>`;
6116
- } else {
6117
- value = (customClass == null ? void 0 : customClass.string) ? `<span class="${(_c = customClass == null ? void 0 : customClass.string) != null ? _c : ""}">${escapeString(value)}</span>` : escapeString(value);
6118
- }
6119
- }
6120
- return value;
6121
- }
6122
- function escapeString(value) {
6123
- return escape(value).replace(/ /g, "&nbsp;").replace(/\n/g, "<span>\\n</span>");
6124
- }
6125
- function getRaw(value) {
6126
- var _a25, _b25, _c;
6127
- let customType;
6128
- const isCustom = getInspectorStateValueType(value) === "custom";
6129
- let inherit = {};
6130
- if (isCustom) {
6131
- const data = value;
6132
- const customValue = (_a25 = data._custom) == null ? void 0 : _a25.value;
6133
- const currentCustomType = (_b25 = data._custom) == null ? void 0 : _b25.type;
6134
- const nestedCustom = typeof customValue === "object" && customValue !== null && "_custom" in customValue ? getRaw(customValue) : { inherit: void 0, value: void 0, customType: void 0 };
6135
- inherit = nestedCustom.inherit || ((_c = data._custom) == null ? void 0 : _c.fields) || {};
6136
- value = nestedCustom.value || customValue;
6137
- customType = nestedCustom.customType || currentCustomType;
6138
- }
6139
- if (value && value._isArray)
6140
- value = value.items;
6141
- return { value, inherit, customType };
6142
- }
6143
- function toEdit(value, customType) {
6144
- if (customType === "bigint")
6145
- return value;
6146
- if (customType === "date")
6147
- return value;
6148
- return replaceTokenToString(JSON.stringify(value));
6149
- }
6150
- function toSubmit(value, customType) {
6151
- if (customType === "bigint")
6152
- return BigInt(value);
6153
- if (customType === "date")
6154
- return new Date(value);
6155
- return JSON.parse(replaceStringToToken(value), reviver);
6156
- }
6157
-
6158
6194
  // src/shared/util.ts
6159
6195
  function stringify2(data) {
6160
6196
  return stringifyCircularAutoChunks(data, stringifyReplacer);
@@ -6165,26 +6201,6 @@ function parse2(data, revive2 = false) {
6165
6201
  return revive2 ? parseCircularAutoChunks(data, reviver) : parseCircularAutoChunks(data);
6166
6202
  }
6167
6203
 
6168
- // src/shared/time.ts
6169
- init_esm_shims();
6170
-
6171
- // src/shared/env.ts
6172
- init_esm_shims();
6173
-
6174
- // src/core/devtools-client/detected.ts
6175
- init_esm_shims();
6176
- import { target as target21 } from "@vue/devtools-shared";
6177
- function updateDevToolsClientDetected(params) {
6178
- devtoolsState.devtoolsClientDetected = {
6179
- ...devtoolsState.devtoolsClientDetected,
6180
- ...params
6181
- };
6182
- const devtoolsClientVisible = Object.values(devtoolsState.devtoolsClientDetected).some(Boolean);
6183
- toggleHighPerfMode(!devtoolsClientVisible);
6184
- }
6185
- var _a24, _b24;
6186
- (_b24 = (_a24 = target21).__VUE_DEVTOOLS_UPDATE_CLIENT_DETECTED__) != null ? _b24 : _a24.__VUE_DEVTOOLS_UPDATE_CLIENT_DETECTED__ = updateDevToolsClientDetected;
6187
-
6188
6204
  // src/index.ts
6189
6205
  var devtools = {
6190
6206
  hook,