vite-plugin-vue-devtools 0.0.1-alpha.0 → 0.0.1-alpha.2

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.
Files changed (30) hide show
  1. package/dist/client/assets/VCard-07e53519.js +15 -0
  2. package/dist/client/assets/VIcon.vue_vue_type_script_setup_true_lang-c622c694.js +19 -0
  3. package/dist/client/assets/VIconTitle.vue_vue_type_script_setup_true_lang-5f26c7d7.js +30 -0
  4. package/dist/client/assets/VPanelGrids-2e4d7603.js +15 -0
  5. package/dist/client/assets/VTextInput-52804693.css +18 -0
  6. package/dist/client/assets/VTextInput.vue_vue_type_script_setup_true_lang-11aa9678.js +145 -0
  7. package/dist/client/assets/__inspecting-ca212e33.js +51 -0
  8. package/dist/client/assets/assets-7d94be21.js +1403 -0
  9. package/dist/client/assets/components-f04eb68e.js +699 -0
  10. package/dist/client/assets/fuse.esm-c317b696.js +1782 -0
  11. package/dist/client/assets/graph-b9e504aa.js +52260 -0
  12. package/dist/client/assets/index-ab9e9151.js +15372 -0
  13. package/dist/client/assets/index-f0fa9f81.css +454 -0
  14. package/dist/client/assets/inspect-d697adb8.js +96 -0
  15. package/dist/client/assets/overview-afb7d69a.js +305 -0
  16. package/dist/client/assets/pages-43ddf646.js +21 -0
  17. package/dist/client/assets/pages-4aa45253.js +320 -0
  18. package/dist/client/assets/pinia-178be7b6.js +139 -0
  19. package/dist/client/assets/routes-cd4e8e50.js +129 -0
  20. package/dist/client/assets/rpc-c07563d7.js +136 -0
  21. package/dist/client/assets/settings-c9f4467d.js +299 -0
  22. package/dist/client/assets/splitpanes.es-f2ab0d30.js +725 -0
  23. package/dist/client/assets/timeline-6da2fbae.js +209 -0
  24. package/dist/client/index.html +23 -0
  25. package/dist/index.cjs +7764 -0
  26. package/dist/index.d.ts +5 -0
  27. package/dist/index.mjs +7748 -0
  28. package/package.json +92 -8
  29. package/src/node/Container.vue +298 -0
  30. package/src/node/app.js +41 -0
@@ -0,0 +1,725 @@
1
+ import { _ as _sfc_main$3 } from './VIcon.vue_vue_type_script_setup_true_lang-c622c694.js';
2
+ import { d as defineComponent, o as openBlock, a as createBlock, n as normalizeClass, z as isRef, T as toRaw, Q as computed, X as resolveComponent, c as createElementBlock, r as renderList, e as createBaseVNode, t as toDisplayString, m as createCommentVNode, u as unref, F as Fragment, P as ref, b as createVNode, an as h, v as renderSlot, N as normalizeStyle } from './index-ab9e9151.js';
3
+
4
+ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
5
+ __name: "VExpandIcon",
6
+ props: {
7
+ value: { type: Boolean }
8
+ },
9
+ setup(__props) {
10
+ return (_ctx, _cache) => {
11
+ const _component_VIcon = _sfc_main$3;
12
+ return openBlock(), createBlock(_component_VIcon, {
13
+ class: normalizeClass(["material-symbols:arrow-right", {
14
+ "transform rotate-90": __props.value
15
+ }]),
16
+ "text-5": "",
17
+ "op-50": "",
18
+ "n-transition": ""
19
+ }, null, 8, ["class"]);
20
+ };
21
+ }
22
+ });
23
+
24
+ /* Injected with object hook! */
25
+
26
+ const objectToString = Object.prototype.toString;
27
+ function toTypeString(value) {
28
+ return objectToString.call(value);
29
+ }
30
+ function toRawType(value) {
31
+ return toTypeString(value).slice(8, -1);
32
+ }
33
+ function isPlainObject(val) {
34
+ return toTypeString(val) === "[object Object]";
35
+ }
36
+ const isArray = Array.isArray;
37
+ function isMap(val) {
38
+ return toTypeString(val) === "[object Map]";
39
+ }
40
+ function isSet(val) {
41
+ return toTypeString(val) === "[object Set]";
42
+ }
43
+ function isRegExp(val) {
44
+ return toTypeString(val) === "[object RegExp]";
45
+ }
46
+ function isComputed(raw) {
47
+ return isRef(raw) && !!raw.effect;
48
+ }
49
+ const ESC = {
50
+ "<": "&lt;",
51
+ ">": "&gt;",
52
+ '"': "&quot;",
53
+ "&": "&amp;"
54
+ };
55
+ function escapeChar(a) {
56
+ return ESC[a] || a;
57
+ }
58
+ function escape(s) {
59
+ return s.replace(/[<>"&]/g, escapeChar);
60
+ }
61
+
62
+ /* Injected with object hook! */
63
+
64
+ function getFuntionDetails(func) {
65
+ let string = "";
66
+ let matches = null;
67
+ try {
68
+ string = Function.prototype.toString.call(func);
69
+ matches = String.prototype.match.call(string, /\([\s\S]*?\)/);
70
+ } catch (e) {
71
+ }
72
+ const match = matches && matches[0];
73
+ const args = typeof match === "string" ? match : "(?)";
74
+ const name = typeof func.name === "string" ? func.name : "";
75
+ return `<span style="opacity:.5;">function</span> ${escape(name)}${args}`;
76
+ }
77
+ function formatWithExtraType(value, type) {
78
+ return `${value} <span style="color:#6b7280;padding:'0 5px';">(${type})</span>`;
79
+ }
80
+ function formatStateType(value) {
81
+ if (isComputed(value)) {
82
+ const state = formatStateType(value.value);
83
+ return {
84
+ ...state,
85
+ ...state.recursive ? { rawDisplay: formatWithExtraType(state.rawDisplay, "Computed") } : { value: formatWithExtraType(state.value, "Computed") }
86
+ };
87
+ } else if (isRef(value)) {
88
+ const state = formatStateType(toRaw(value.value));
89
+ return {
90
+ ...state,
91
+ ...state.recursive ? { rawDisplay: formatWithExtraType(state.rawDisplay, "Ref") } : { value: formatWithExtraType(state.value, "Ref") }
92
+ };
93
+ } else if (isArray(value)) {
94
+ return {
95
+ rawType: "object",
96
+ rawDisplay: `Array[${value.length}]`,
97
+ recursive: true,
98
+ value
99
+ };
100
+ } else if (typeof value === "function") {
101
+ return {
102
+ rawType: "function",
103
+ recursive: false,
104
+ value: getFuntionDetails(value)
105
+ };
106
+ } else if (typeof value === "bigint") {
107
+ const stringifiedBigInt = BigInt.prototype.toString.call(value);
108
+ return {
109
+ rawType: "string",
110
+ rawDisplay: `BigInt(${stringifiedBigInt})`,
111
+ recursive: false,
112
+ value: stringifiedBigInt
113
+ };
114
+ } else if (Number.isNaN(value)) {
115
+ return {
116
+ rawType: "literal",
117
+ recursive: false,
118
+ value: "NaN"
119
+ };
120
+ } else if (value === Infinity) {
121
+ return {
122
+ rawType: "literal",
123
+ recursive: false,
124
+ value: "Infinity"
125
+ };
126
+ } else if (value === -Infinity) {
127
+ return {
128
+ rawType: "literal",
129
+ recursive: false,
130
+ value: "-Infinity"
131
+ };
132
+ } else if (typeof value === "symbol") {
133
+ return {
134
+ rawType: "literal",
135
+ recursive: false,
136
+ value: Symbol.prototype.toString.call(value)
137
+ };
138
+ } else if (value === null) {
139
+ return {
140
+ rawType: "null",
141
+ recursive: false,
142
+ value: "null"
143
+ };
144
+ } else if (typeof value === "undefined") {
145
+ return {
146
+ rawType: "null",
147
+ recursive: false,
148
+ value: "undefined"
149
+ };
150
+ } else if (typeof value === "string") {
151
+ return {
152
+ rawType: "string",
153
+ recursive: false,
154
+ value: `"${value}"`
155
+ };
156
+ } else if (value !== "null" && typeof value === "object") {
157
+ if (isMap(value)) {
158
+ return {
159
+ rawType: "object",
160
+ rawDisplay: "Map",
161
+ recursive: true,
162
+ value: Array.from(value.entries()).map(([key, value2]) => ({ key, value: value2 }))
163
+ };
164
+ } else if (isSet(value)) {
165
+ const list = Array.from(value);
166
+ return {
167
+ rawType: "object",
168
+ rawDisplay: `Set[${list.length}]`,
169
+ recursive: true,
170
+ value: list
171
+ };
172
+ } else if (isRegExp(value)) {
173
+ return {
174
+ rawType: "string",
175
+ recursive: false,
176
+ value: RegExp.prototype.toString.call(value)
177
+ };
178
+ } else if (toRawType(value) === "Error") {
179
+ return {
180
+ rawType: "string",
181
+ recursive: false,
182
+ // @ts-expect-error skip
183
+ value: `${value?.message}: ${value?.stack}`
184
+ };
185
+ } else if (value?.state && value._vm || value.constructor?.name === "Store" && value._wrappedGetters) {
186
+ return {
187
+ rawType: "string",
188
+ recursive: false,
189
+ value: '"[object Store]"'
190
+ };
191
+ } else if (value.constructor && value.constructor.name === "VueRouter" || value.currentRoute) {
192
+ return {
193
+ rawType: "string",
194
+ recursive: false,
195
+ value: '"[object Router]"'
196
+ };
197
+ } else if (typeof value.render === "function") {
198
+ return {
199
+ rawType: "object",
200
+ recursive: false,
201
+ // @ts-expect-error skip
202
+ value: formatWithExtraType(value.__name, "Component") ?? "Vue Component"
203
+ };
204
+ } else if (isPlainObject(value)) {
205
+ return {
206
+ rawType: "object",
207
+ rawDisplay: "Object",
208
+ recursive: true,
209
+ value
210
+ };
211
+ } else {
212
+ return {
213
+ rawType: "string",
214
+ recursive: false,
215
+ value: `"${toRawType(value)}"`
216
+ };
217
+ }
218
+ } else {
219
+ return {
220
+ rawType: "literal",
221
+ recursive: false,
222
+ value
223
+ };
224
+ }
225
+ }
226
+
227
+ /* Injected with object hook! */
228
+
229
+ const _hoisted_1$1 = ["onClick"];
230
+ const _hoisted_2$1 = {
231
+ key: 1,
232
+ "inline-block": "",
233
+ "h-6": "",
234
+ "w-6": ""
235
+ };
236
+ const _hoisted_3 = {
237
+ "text-purple-700": "",
238
+ "dark:text-purple-300": ""
239
+ };
240
+ const _hoisted_4 = /* @__PURE__ */ createBaseVNode("span", {
241
+ "px-1": "",
242
+ "op-60": ""
243
+ }, ":", -1);
244
+ const _hoisted_5 = ["innerHTML"];
245
+ const _hoisted_6 = ["innerHTML"];
246
+ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
247
+ __name: "StateFieldsTree",
248
+ props: {
249
+ id: null,
250
+ data: null,
251
+ depth: { default: 0 },
252
+ expandedId: null
253
+ },
254
+ emits: ["updateExpanded"],
255
+ setup(__props, { emit: emits }) {
256
+ const props = __props;
257
+ const rawTypeStyles = { literal: "raw-literal", string: "raw-string", object: "raw-object", function: "raw-function", null: "raw-null" };
258
+ const list = computed(() => {
259
+ if (Array.isArray(props.data)) {
260
+ return props.data.map((item) => {
261
+ return formatStateType(item);
262
+ });
263
+ } else if (typeof props.data === "object" && props.data !== null) {
264
+ const o = {};
265
+ for (const k in props.data) {
266
+ const key = k;
267
+ o[key] = formatStateType(props.data[k]);
268
+ }
269
+ return o;
270
+ } else {
271
+ return formatStateType("");
272
+ }
273
+ });
274
+ function toggleExpand(id) {
275
+ emits("updateExpanded", id);
276
+ }
277
+ return (_ctx, _cache) => {
278
+ const _component_VExpandIcon = _sfc_main$2;
279
+ const _component_StateFieldsTree = resolveComponent("StateFieldsTree", true);
280
+ return openBlock(true), createElementBlock(Fragment, null, renderList(unref(list), (item, index) => {
281
+ return openBlock(), createElementBlock("code", {
282
+ key: index,
283
+ block: "",
284
+ "select-none": "",
285
+ "pl-2": "",
286
+ "text-sm": ""
287
+ }, [
288
+ createBaseVNode("p", {
289
+ flex: "",
290
+ "items-center": "",
291
+ class: normalizeClass([item?.recursive && "cursor-pointer"]),
292
+ onClick: ($event) => item?.recursive ? toggleExpand(`${__props.id}-${__props.depth}-${index}`) : () => {
293
+ }
294
+ }, [
295
+ item?.recursive ? (openBlock(), createBlock(_component_VExpandIcon, {
296
+ key: 0,
297
+ value: __props.expandedId.includes(`${__props.id}-${__props.depth}-${index}`)
298
+ }, null, 8, ["value"])) : (openBlock(), createElementBlock("i", _hoisted_2$1)),
299
+ createBaseVNode("span", _hoisted_3, toDisplayString(index), 1),
300
+ _hoisted_4,
301
+ item?.recursive ? (openBlock(), createElementBlock("span", {
302
+ key: 2,
303
+ class: normalizeClass(rawTypeStyles[item.rawType]),
304
+ "max-w": "[75%]",
305
+ truncate: "",
306
+ innerHTML: item?.rawDisplay
307
+ }, null, 10, _hoisted_5)) : (openBlock(), createElementBlock("span", {
308
+ key: 3,
309
+ class: normalizeClass(rawTypeStyles[item.rawType]),
310
+ "max-w": "[75%]",
311
+ truncate: "",
312
+ innerHTML: item?.value
313
+ }, null, 10, _hoisted_6))
314
+ ], 10, _hoisted_1$1),
315
+ __props.expandedId.includes(`${__props.id}-${__props.depth}-${index}`) && item?.recursive && __props.depth <= 2 ? (openBlock(), createBlock(_component_StateFieldsTree, {
316
+ key: 0,
317
+ id: __props.id,
318
+ data: item?.value,
319
+ depth: __props.depth + 1,
320
+ "expanded-id": __props.expandedId,
321
+ onUpdateExpanded: toggleExpand
322
+ }, null, 8, ["id", "data", "depth", "expanded-id"])) : createCommentVNode("", true)
323
+ ]);
324
+ }), 128);
325
+ };
326
+ }
327
+ });
328
+
329
+ /* Injected with object hook! */
330
+
331
+ const _hoisted_1 = { "text-primary": "" };
332
+ const _hoisted_2 = {
333
+ key: 0,
334
+ "pl-3": ""
335
+ };
336
+ const expandedIdCache = ref([]);
337
+ const _sfc_main = /* @__PURE__ */ defineComponent({
338
+ __name: "StateFields",
339
+ props: {
340
+ data: null,
341
+ id: { default: 0 }
342
+ },
343
+ setup(__props) {
344
+ const isExpanded = ref(true);
345
+ function toggleExpanded() {
346
+ isExpanded.value = !isExpanded.value;
347
+ }
348
+ function updateExpandedIdCache(id) {
349
+ if (expandedIdCache.value.includes(id))
350
+ expandedIdCache.value = expandedIdCache.value.filter((i) => i !== id);
351
+ else
352
+ expandedIdCache.value.push(id);
353
+ }
354
+ return (_ctx, _cache) => {
355
+ const _component_VExpandIcon = _sfc_main$2;
356
+ const _component_StateFieldsTree = _sfc_main$1;
357
+ return openBlock(), createElementBlock("div", null, [
358
+ createBaseVNode("h3", {
359
+ flex: "",
360
+ "cursor-pointer": "",
361
+ "items-center": "",
362
+ rounded: "",
363
+ "py-1": "",
364
+ class: "hover:bg-[#c2e9d7] hover:dark:bg-[#2c3e50]",
365
+ onClick: toggleExpanded
366
+ }, [
367
+ createVNode(_component_VExpandIcon, { value: unref(isExpanded) }, null, 8, ["value"]),
368
+ createBaseVNode("span", _hoisted_1, toDisplayString(__props.data.key), 1)
369
+ ]),
370
+ unref(isExpanded) ? (openBlock(), createElementBlock("div", _hoisted_2, [
371
+ createVNode(_component_StateFieldsTree, {
372
+ id: __props.id,
373
+ data: __props.data.value,
374
+ "expanded-id": unref(expandedIdCache),
375
+ onUpdateExpanded: updateExpandedIdCache
376
+ }, null, 8, ["id", "data", "expanded-id"])
377
+ ])) : createCommentVNode("", true)
378
+ ]);
379
+ };
380
+ }
381
+ });
382
+
383
+ /* Injected with object hook! */
384
+
385
+ const M = {
386
+ name: "splitpanes",
387
+ emits: ["ready", "resize", "resized", "pane-click", "pane-maximize", "pane-add", "pane-remove", "splitter-click"],
388
+ props: {
389
+ horizontal: { type: Boolean },
390
+ pushOtherPanes: { type: Boolean, default: !0 },
391
+ dblClickSplitter: { type: Boolean, default: !0 },
392
+ rtl: { type: Boolean, default: !1 },
393
+ firstSplitter: { type: Boolean }
394
+ },
395
+ provide() {
396
+ return {
397
+ requestUpdate: this.requestUpdate,
398
+ onPaneAdd: this.onPaneAdd,
399
+ onPaneRemove: this.onPaneRemove,
400
+ onPaneClick: this.onPaneClick
401
+ };
402
+ },
403
+ data: () => ({
404
+ container: null,
405
+ ready: !1,
406
+ panes: [],
407
+ touch: {
408
+ mouseDown: !1,
409
+ dragging: !1,
410
+ activeSplitter: null
411
+ },
412
+ splitterTaps: {
413
+ splitter: null,
414
+ timeoutId: null
415
+ }
416
+ }),
417
+ computed: {
418
+ panesCount() {
419
+ return this.panes.length;
420
+ },
421
+ indexedPanes() {
422
+ return this.panes.reduce((e, i) => (e[i.id] = i) && e, {});
423
+ }
424
+ },
425
+ methods: {
426
+ updatePaneComponents() {
427
+ this.panes.forEach((e) => {
428
+ e.update && e.update({
429
+ [this.horizontal ? "height" : "width"]: `${this.indexedPanes[e.id].size}%`
430
+ });
431
+ });
432
+ },
433
+ bindEvents() {
434
+ document.addEventListener("mousemove", this.onMouseMove, { passive: !1 }), document.addEventListener("mouseup", this.onMouseUp), "ontouchstart" in window && (document.addEventListener("touchmove", this.onMouseMove, { passive: !1 }), document.addEventListener("touchend", this.onMouseUp));
435
+ },
436
+ unbindEvents() {
437
+ document.removeEventListener("mousemove", this.onMouseMove, { passive: !1 }), document.removeEventListener("mouseup", this.onMouseUp), "ontouchstart" in window && (document.removeEventListener("touchmove", this.onMouseMove, { passive: !1 }), document.removeEventListener("touchend", this.onMouseUp));
438
+ },
439
+ onMouseDown(e, i) {
440
+ this.bindEvents(), this.touch.mouseDown = !0, this.touch.activeSplitter = i;
441
+ },
442
+ onMouseMove(e) {
443
+ this.touch.mouseDown && (e.preventDefault(), this.touch.dragging = !0, this.calculatePanesSize(this.getCurrentMouseDrag(e)), this.$emit("resize", this.panes.map((i) => ({ min: i.min, max: i.max, size: i.size }))));
444
+ },
445
+ onMouseUp() {
446
+ this.touch.dragging && this.$emit("resized", this.panes.map((e) => ({ min: e.min, max: e.max, size: e.size }))), this.touch.mouseDown = !1, setTimeout(() => {
447
+ this.touch.dragging = !1, this.unbindEvents();
448
+ }, 100);
449
+ },
450
+ onSplitterClick(e, i) {
451
+ "ontouchstart" in window && (e.preventDefault(), this.dblClickSplitter && (this.splitterTaps.splitter === i ? (clearTimeout(this.splitterTaps.timeoutId), this.splitterTaps.timeoutId = null, this.onSplitterDblClick(e, i), this.splitterTaps.splitter = null) : (this.splitterTaps.splitter = i, this.splitterTaps.timeoutId = setTimeout(() => {
452
+ this.splitterTaps.splitter = null;
453
+ }, 500)))), this.touch.dragging || this.$emit("splitter-click", this.panes[i]);
454
+ },
455
+ onSplitterDblClick(e, i) {
456
+ let s = 0;
457
+ this.panes = this.panes.map((n, t) => (n.size = t === i ? n.max : n.min, t !== i && (s += n.min), n)), this.panes[i].size -= s, this.$emit("pane-maximize", this.panes[i]), this.$emit("resized", this.panes.map((n) => ({ min: n.min, max: n.max, size: n.size })));
458
+ },
459
+ onPaneClick(e, i) {
460
+ this.$emit("pane-click", this.indexedPanes[i]);
461
+ },
462
+ getCurrentMouseDrag(e) {
463
+ const i = this.container.getBoundingClientRect(), { clientX: s, clientY: n } = "ontouchstart" in window && e.touches ? e.touches[0] : e;
464
+ return {
465
+ x: s - i.left,
466
+ y: n - i.top
467
+ };
468
+ },
469
+ getCurrentDragPercentage(e) {
470
+ e = e[this.horizontal ? "y" : "x"];
471
+ const i = this.container[this.horizontal ? "clientHeight" : "clientWidth"];
472
+ return this.rtl && !this.horizontal && (e = i - e), e * 100 / i;
473
+ },
474
+ calculatePanesSize(e) {
475
+ const i = this.touch.activeSplitter;
476
+ let s = {
477
+ prevPanesSize: this.sumPrevPanesSize(i),
478
+ nextPanesSize: this.sumNextPanesSize(i),
479
+ prevReachedMinPanes: 0,
480
+ nextReachedMinPanes: 0
481
+ };
482
+ const n = 0 + (this.pushOtherPanes ? 0 : s.prevPanesSize), t = 100 - (this.pushOtherPanes ? 0 : s.nextPanesSize), a = Math.max(Math.min(this.getCurrentDragPercentage(e), t), n);
483
+ let r = [i, i + 1], o = this.panes[r[0]] || null, h = this.panes[r[1]] || null;
484
+ const l = o.max < 100 && a >= o.max + s.prevPanesSize, u = h.max < 100 && a <= 100 - (h.max + this.sumNextPanesSize(i + 1));
485
+ if (l || u) {
486
+ l ? (o.size = o.max, h.size = Math.max(100 - o.max - s.prevPanesSize - s.nextPanesSize, 0)) : (o.size = Math.max(100 - h.max - s.prevPanesSize - this.sumNextPanesSize(i + 1), 0), h.size = h.max);
487
+ return;
488
+ }
489
+ if (this.pushOtherPanes) {
490
+ const d = this.doPushOtherPanes(s, a);
491
+ if (!d)
492
+ return;
493
+ (({ sums: s, panesToResize: r } = d)), o = this.panes[r[0]] || null, h = this.panes[r[1]] || null;
494
+ }
495
+ o !== null && (o.size = Math.min(Math.max(a - s.prevPanesSize - s.prevReachedMinPanes, o.min), o.max)), h !== null && (h.size = Math.min(Math.max(100 - a - s.nextPanesSize - s.nextReachedMinPanes, h.min), h.max));
496
+ },
497
+ doPushOtherPanes(e, i) {
498
+ const s = this.touch.activeSplitter, n = [s, s + 1];
499
+ return i < e.prevPanesSize + this.panes[n[0]].min && (n[0] = this.findPrevExpandedPane(s).index, e.prevReachedMinPanes = 0, n[0] < s && this.panes.forEach((t, a) => {
500
+ a > n[0] && a <= s && (t.size = t.min, e.prevReachedMinPanes += t.min);
501
+ }), e.prevPanesSize = this.sumPrevPanesSize(n[0]), n[0] === void 0) ? (e.prevReachedMinPanes = 0, this.panes[0].size = this.panes[0].min, this.panes.forEach((t, a) => {
502
+ a > 0 && a <= s && (t.size = t.min, e.prevReachedMinPanes += t.min);
503
+ }), this.panes[n[1]].size = 100 - e.prevReachedMinPanes - this.panes[0].min - e.prevPanesSize - e.nextPanesSize, null) : i > 100 - e.nextPanesSize - this.panes[n[1]].min && (n[1] = this.findNextExpandedPane(s).index, e.nextReachedMinPanes = 0, n[1] > s + 1 && this.panes.forEach((t, a) => {
504
+ a > s && a < n[1] && (t.size = t.min, e.nextReachedMinPanes += t.min);
505
+ }), e.nextPanesSize = this.sumNextPanesSize(n[1] - 1), n[1] === void 0) ? (e.nextReachedMinPanes = 0, this.panes[this.panesCount - 1].size = this.panes[this.panesCount - 1].min, this.panes.forEach((t, a) => {
506
+ a < this.panesCount - 1 && a >= s + 1 && (t.size = t.min, e.nextReachedMinPanes += t.min);
507
+ }), this.panes[n[0]].size = 100 - e.prevPanesSize - e.nextReachedMinPanes - this.panes[this.panesCount - 1].min - e.nextPanesSize, null) : { sums: e, panesToResize: n };
508
+ },
509
+ sumPrevPanesSize(e) {
510
+ return this.panes.reduce((i, s, n) => i + (n < e ? s.size : 0), 0);
511
+ },
512
+ sumNextPanesSize(e) {
513
+ return this.panes.reduce((i, s, n) => i + (n > e + 1 ? s.size : 0), 0);
514
+ },
515
+ findPrevExpandedPane(e) {
516
+ return [...this.panes].reverse().find((s) => s.index < e && s.size > s.min) || {};
517
+ },
518
+ findNextExpandedPane(e) {
519
+ return this.panes.find((s) => s.index > e + 1 && s.size > s.min) || {};
520
+ },
521
+ checkSplitpanesNodes() {
522
+ Array.from(this.container.children).forEach((i) => {
523
+ const s = i.classList.contains("splitpanes__pane"), n = i.classList.contains("splitpanes__splitter");
524
+ !s && !n && (i.parentNode.removeChild(i), console.warn("Splitpanes: Only <pane> elements are allowed at the root of <splitpanes>. One of your DOM nodes was removed."));
525
+ });
526
+ },
527
+ addSplitter(e, i, s = !1) {
528
+ const n = e - 1, t = document.createElement("div");
529
+ t.classList.add("splitpanes__splitter"), s || (t.onmousedown = (a) => this.onMouseDown(a, n), typeof window < "u" && "ontouchstart" in window && (t.ontouchstart = (a) => this.onMouseDown(a, n)), t.onclick = (a) => this.onSplitterClick(a, n + 1)), this.dblClickSplitter && (t.ondblclick = (a) => this.onSplitterDblClick(a, n + 1)), i.parentNode.insertBefore(t, i);
530
+ },
531
+ removeSplitter(e) {
532
+ e.onmousedown = void 0, e.onclick = void 0, e.ondblclick = void 0, e.parentNode.removeChild(e);
533
+ },
534
+ redoSplitters() {
535
+ const e = Array.from(this.container.children);
536
+ e.forEach((s) => {
537
+ s.className.includes("splitpanes__splitter") && this.removeSplitter(s);
538
+ });
539
+ let i = 0;
540
+ e.forEach((s) => {
541
+ s.className.includes("splitpanes__pane") && (!i && this.firstSplitter ? this.addSplitter(i, s, !0) : i && this.addSplitter(i, s), i++);
542
+ });
543
+ },
544
+ requestUpdate({ target: e, ...i }) {
545
+ const s = this.indexedPanes[e._.uid];
546
+ Object.entries(i).forEach(([n, t]) => s[n] = t);
547
+ },
548
+ onPaneAdd(e) {
549
+ let i = -1;
550
+ Array.from(e.$el.parentNode.children).some((t) => (t.className.includes("splitpanes__pane") && i++, t === e.$el));
551
+ const s = parseFloat(e.minSize), n = parseFloat(e.maxSize);
552
+ this.panes.splice(i, 0, {
553
+ id: e._.uid,
554
+ index: i,
555
+ min: isNaN(s) ? 0 : s,
556
+ max: isNaN(n) ? 100 : n,
557
+ size: e.size === null ? null : parseFloat(e.size),
558
+ givenSize: e.size,
559
+ update: e.update
560
+ }), this.panes.forEach((t, a) => t.index = a), this.ready && this.$nextTick(() => {
561
+ this.redoSplitters(), this.resetPaneSizes({ addedPane: this.panes[i] }), this.$emit("pane-add", { index: i, panes: this.panes.map((t) => ({ min: t.min, max: t.max, size: t.size })) });
562
+ });
563
+ },
564
+ onPaneRemove(e) {
565
+ const i = this.panes.findIndex((n) => n.id === e._.uid), s = this.panes.splice(i, 1)[0];
566
+ this.panes.forEach((n, t) => n.index = t), this.$nextTick(() => {
567
+ this.redoSplitters(), this.resetPaneSizes({ removedPane: { ...s, index: i } }), this.$emit("pane-remove", { removed: s, panes: this.panes.map((n) => ({ min: n.min, max: n.max, size: n.size })) });
568
+ });
569
+ },
570
+ resetPaneSizes(e = {}) {
571
+ !e.addedPane && !e.removedPane ? this.initialPanesSizing() : this.panes.some((i) => i.givenSize !== null || i.min || i.max < 100) ? this.equalizeAfterAddOrRemove(e) : this.equalize(), this.ready && this.$emit("resized", this.panes.map((i) => ({ min: i.min, max: i.max, size: i.size })));
572
+ },
573
+ equalize() {
574
+ const e = 100 / this.panesCount;
575
+ let i = 0;
576
+ const s = [], n = [];
577
+ this.panes.forEach((t) => {
578
+ t.size = Math.max(Math.min(e, t.max), t.min), i -= t.size, t.size >= t.max && s.push(t.id), t.size <= t.min && n.push(t.id);
579
+ }), i > 0.1 && this.readjustSizes(i, s, n);
580
+ },
581
+ initialPanesSizing() {
582
+ let e = 100;
583
+ const i = [], s = [];
584
+ let n = 0;
585
+ this.panes.forEach((a) => {
586
+ e -= a.size, a.size !== null && n++, a.size >= a.max && i.push(a.id), a.size <= a.min && s.push(a.id);
587
+ });
588
+ let t = 100;
589
+ e > 0.1 && (this.panes.forEach((a) => {
590
+ a.size === null && (a.size = Math.max(Math.min(e / (this.panesCount - n), a.max), a.min)), t -= a.size;
591
+ }), t > 0.1 && this.readjustSizes(e, i, s));
592
+ },
593
+ equalizeAfterAddOrRemove({ addedPane: e, removedPane: i } = {}) {
594
+ let s = 100 / this.panesCount, n = 0;
595
+ const t = [], a = [];
596
+ e && e.givenSize !== null && (s = (100 - e.givenSize) / (this.panesCount - 1)), this.panes.forEach((r) => {
597
+ n -= r.size, r.size >= r.max && t.push(r.id), r.size <= r.min && a.push(r.id);
598
+ }), !(Math.abs(n) < 0.1) && (this.panes.forEach((r) => {
599
+ e && e.givenSize !== null && e.id === r.id || (r.size = Math.max(Math.min(s, r.max), r.min)), n -= r.size, r.size >= r.max && t.push(r.id), r.size <= r.min && a.push(r.id);
600
+ }), n > 0.1 && this.readjustSizes(n, t, a));
601
+ },
602
+ readjustSizes(e, i, s) {
603
+ let n;
604
+ e > 0 ? n = e / (this.panesCount - i.length) : n = e / (this.panesCount - s.length), this.panes.forEach((t, a) => {
605
+ if (e > 0 && !i.includes(t.id)) {
606
+ const r = Math.max(Math.min(t.size + n, t.max), t.min), o = r - t.size;
607
+ e -= o, t.size = r;
608
+ } else if (!s.includes(t.id)) {
609
+ const r = Math.max(Math.min(t.size + n, t.max), t.min), o = r - t.size;
610
+ e -= o, t.size = r;
611
+ }
612
+ t.update({
613
+ [this.horizontal ? "height" : "width"]: `${this.indexedPanes[t.id].size}%`
614
+ });
615
+ }), Math.abs(e) > 0.1 && this.$nextTick(() => {
616
+ this.ready && console.warn("Splitpanes: Could not resize panes correctly due to their constraints.");
617
+ });
618
+ }
619
+ },
620
+ watch: {
621
+ panes: {
622
+ deep: !0,
623
+ immediate: !1,
624
+ handler() {
625
+ this.updatePaneComponents();
626
+ }
627
+ },
628
+ horizontal() {
629
+ this.updatePaneComponents();
630
+ },
631
+ firstSplitter() {
632
+ this.redoSplitters();
633
+ },
634
+ dblClickSplitter(e) {
635
+ [...this.container.querySelectorAll(".splitpanes__splitter")].forEach((s, n) => {
636
+ s.ondblclick = e ? (t) => this.onSplitterDblClick(t, n) : void 0;
637
+ });
638
+ }
639
+ },
640
+ beforeUnmount() {
641
+ this.ready = !1;
642
+ },
643
+ mounted() {
644
+ this.container = this.$refs.container, this.checkSplitpanesNodes(), this.redoSplitters(), this.resetPaneSizes(), this.$emit("ready"), this.ready = !0;
645
+ },
646
+ render() {
647
+ return h(
648
+ "div",
649
+ {
650
+ ref: "container",
651
+ class: [
652
+ "splitpanes",
653
+ `splitpanes--${this.horizontal ? "horizontal" : "vertical"}`,
654
+ {
655
+ "splitpanes--dragging": this.touch.dragging
656
+ }
657
+ ]
658
+ },
659
+ this.$slots.default()
660
+ );
661
+ }
662
+ }, S = (e, i) => {
663
+ const s = e.__vccOpts || e;
664
+ for (const [n, t] of i)
665
+ s[n] = t;
666
+ return s;
667
+ }, x = {
668
+ name: "pane",
669
+ inject: ["requestUpdate", "onPaneAdd", "onPaneRemove", "onPaneClick"],
670
+ props: {
671
+ size: { type: [Number, String], default: null },
672
+ minSize: { type: [Number, String], default: 0 },
673
+ maxSize: { type: [Number, String], default: 100 }
674
+ },
675
+ data: () => ({
676
+ style: {}
677
+ }),
678
+ mounted() {
679
+ this.onPaneAdd(this);
680
+ },
681
+ beforeUnmount() {
682
+ this.onPaneRemove(this);
683
+ },
684
+ methods: {
685
+ update(e) {
686
+ this.style = e;
687
+ }
688
+ },
689
+ computed: {
690
+ sizeNumber() {
691
+ return this.size || this.size === 0 ? parseFloat(this.size) : null;
692
+ },
693
+ minSizeNumber() {
694
+ return parseFloat(this.minSize);
695
+ },
696
+ maxSizeNumber() {
697
+ return parseFloat(this.maxSize);
698
+ }
699
+ },
700
+ watch: {
701
+ sizeNumber(e) {
702
+ this.requestUpdate({ target: this, size: e });
703
+ },
704
+ minSizeNumber(e) {
705
+ this.requestUpdate({ target: this, min: e });
706
+ },
707
+ maxSizeNumber(e) {
708
+ this.requestUpdate({ target: this, max: e });
709
+ }
710
+ }
711
+ };
712
+ function P(e, i, s, n, t, a) {
713
+ return openBlock(), createElementBlock("div", {
714
+ class: "splitpanes__pane",
715
+ onClick: i[0] || (i[0] = (r) => a.onPaneClick(r, e._.uid)),
716
+ style: normalizeStyle(e.style)
717
+ }, [
718
+ renderSlot(e.$slots, "default")
719
+ ], 4);
720
+ }
721
+ const g = /* @__PURE__ */ S(x, [["render", P]]);
722
+
723
+ /* Injected with object hook! */
724
+
725
+ export { M, _sfc_main as _, _sfc_main$2 as a, g };