@eternalheart/vue-file-preview 1.6.13 → 1.7.0
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/README.md +2 -0
- package/README.zh-CN.md +2 -0
- package/lib/FilePreviewContent.vue.d.ts +17 -6
- package/lib/FilePreviewEmbed.vue.d.ts +14 -6
- package/lib/FilePreviewModal.vue.d.ts +14 -6
- package/lib/chunks/{EmptyState.vue_vue_type_script_setup_true_lang-C7qk6wj0.mjs → EmptyState.vue_vue_type_script_setup_true_lang--ZOobbGi.mjs} +1 -1
- package/lib/chunks/{avifLoader-CAUzjn-d-C0KRpetN.mjs → avifLoader-CAUzjn-d-CnJpGYJ2.mjs} +1 -1
- package/lib/chunks/{heicLoader-D_9PukkA-Czof_5FJ.mjs → heicLoader-D_9PukkA-g_dLrWLP.mjs} +1 -1
- package/lib/chunks/index-6XZXYqbp.mjs +125 -0
- package/lib/chunks/{index-B21EAyWz.mjs → index-BPSzwMOC.mjs} +51 -51
- package/lib/chunks/index-BYQ9S7Mk.mjs +104 -0
- package/lib/chunks/{index-8Vpbg2kS.mjs → index-Bf94DwQu.mjs} +105 -104
- package/lib/chunks/index-BfOWoMpY.mjs +359 -0
- package/lib/chunks/index-Bg8poMIm.mjs +117 -0
- package/lib/chunks/index-BzwJ0VWu.mjs +108 -0
- package/lib/chunks/index-C41YET0_.mjs +51 -0
- package/lib/chunks/{index-BvBqDq3O.mjs → index-C4hIk6pa.mjs} +2023 -2023
- package/lib/chunks/{index-BASg1cr4.mjs → index-C8lyQPe3.mjs} +1018 -1018
- package/lib/chunks/{index-C9mAajbD.mjs → index-CWPdNhoe.mjs} +200 -200
- package/lib/chunks/{index-BuqPb5mP.mjs → index-CrVQPnFj.mjs} +112 -112
- package/lib/chunks/{index-D30L8tm9.mjs → index-D5IF9F-D.mjs} +57 -57
- package/lib/chunks/{index-DN4Ui0Gh.mjs → index-DFeKS8tR.mjs} +120 -120
- package/lib/chunks/index-DM8Dfl-m.mjs +52 -0
- package/lib/chunks/index-DZe0BxAB.mjs +90 -0
- package/lib/chunks/{index-BlrFFeqc.mjs → index-GFcSJEwj.mjs} +75 -75
- package/lib/chunks/{index-Dkro_8Fy.mjs → index-LPGxJDnT.mjs} +32 -32
- package/lib/chunks/index-aKiIuKKx.mjs +157 -0
- package/lib/chunks/{index-DZZN3kYi.mjs → index-c-pYJEmH.mjs} +1589 -1394
- package/lib/chunks/{index-CxKZKUJj.mjs → index-z9RqL2wI.mjs} +1651 -1651
- package/lib/chunks/index-zLQlyNR2.mjs +383 -0
- package/lib/chunks/{jp2Loader-Dig19xyo-CKUaGhPl.mjs → jp2Loader-Dig19xyo-fCO1knZ0.mjs} +1 -1
- package/lib/chunks/{psdLoader-C0tKUXXl-CYWoQis5.mjs → psdLoader-C0tKUXXl-DihMskai.mjs} +1 -1
- package/lib/chunks/{rawLoader-C-tPeFAB-C35zC8nZ.mjs → rawLoader-C-tPeFAB-BSfDPl-z.mjs} +5 -5
- package/lib/chunks/{tiffLoader-BlhByX8w-BOxg_Du5.mjs → tiffLoader-BlhByX8w-JY5DaTre.mjs} +1 -1
- package/lib/chunks/{useShikiHighlight-BPmcxA-h.mjs → useShikiHighlight-C-ztcJBE.mjs} +1 -1
- package/lib/composables/useAudioPlayer.d.ts +1 -1
- package/lib/composables/usePreviewEvents.d.ts +27 -0
- package/lib/composables/useRequest.d.ts +16 -4
- package/lib/composables/useThemeMode.d.ts +1 -1
- package/lib/composables/useTranslator.d.ts +2 -2
- package/lib/core/events.d.ts +52 -0
- package/lib/core/i18n/index.d.ts +29 -0
- package/lib/core/i18n/messages/en-US.d.ts +5 -0
- package/lib/core/i18n/messages/index.d.ts +9 -0
- package/lib/core/i18n/messages/zh-CN.d.ts +5 -0
- package/lib/core/i18n/types.d.ts +23 -0
- package/lib/core/index.d.ts +34 -0
- package/lib/core/loaders/avifLoader.d.ts +22 -0
- package/lib/core/loaders/heicLoader.d.ts +21 -0
- package/lib/core/loaders/jp2Loader.d.ts +16 -0
- package/lib/core/loaders/jp2Worker.d.ts +1 -0
- package/lib/core/loaders/psdLoader.d.ts +14 -0
- package/lib/core/loaders/rawLoader.d.ts +14 -0
- package/lib/core/loaders/registry.d.ts +32 -0
- package/lib/core/loaders/tiffLoader.d.ts +28 -0
- package/lib/core/loaders/types.d.ts +56 -0
- package/lib/core/types.d.ts +89 -0
- package/lib/core/utils/csvParser.d.ts +31 -0
- package/lib/core/utils/emptyState.d.ts +28 -0
- package/lib/core/utils/excelDataConverter.d.ts +61 -0
- package/lib/core/utils/fileNormalizer.d.ts +21 -0
- package/lib/core/utils/fileType.d.ts +21 -0
- package/lib/core/utils/legacy-office/doc.d.ts +25 -0
- package/lib/core/utils/legacy-office/index.d.ts +8 -0
- package/lib/core/utils/legacy-office/ole.d.ts +8 -0
- package/lib/core/utils/legacy-office/ppt.d.ts +79 -0
- package/lib/core/utils/legacy-office/xls.d.ts +28 -0
- package/lib/core/utils/mimeTypes.d.ts +29 -0
- package/lib/core/utils/ooxml/docx.d.ts +17 -0
- package/lib/core/utils/ooxml/index.d.ts +4 -0
- package/lib/core/utils/ooxml/pptx.d.ts +7 -0
- package/lib/core/utils/ooxml/xml.d.ts +15 -0
- package/lib/core/utils/ooxml/zip.d.ts +3 -0
- package/lib/core/utils/pdfWorker.d.ts +61 -0
- package/lib/core/utils/previewMode.d.ts +7 -0
- package/lib/core/utils/request.d.ts +49 -0
- package/lib/core/utils/subtitleParser.d.ts +44 -0
- package/lib/core/utils/textDecoder.d.ts +30 -0
- package/lib/core/utils/uint8ArrayPolyfill.d.ts +18 -0
- package/lib/core/utils/zipReader.d.ts +51 -0
- package/lib/core/workers/imageDecoder.worker.d.ts +31 -0
- package/lib/core/workers/workerClient.d.ts +14 -0
- package/lib/i18n/localeKey.d.ts +1 -1
- package/lib/index.cjs +60 -60
- package/lib/index.css +1 -1
- package/lib/index.d.ts +11 -9
- package/lib/index.mjs +15 -12
- package/lib/renderers/Audio/index.vue.d.ts +1 -1
- package/lib/renderers/Cad/index.vue.d.ts +1 -1
- package/lib/renderers/Cad/toolbar.d.ts +2 -2
- package/lib/renderers/Csv/index.vue.d.ts +1 -1
- package/lib/renderers/Doc/index.vue.d.ts +1 -1
- package/lib/renderers/Docx/index.vue.d.ts +1 -1
- package/lib/renderers/Epub/index.vue.d.ts +1 -1
- package/lib/renderers/Font/index.vue.d.ts +1 -1
- package/lib/renderers/Image/index.vue.d.ts +2 -2
- package/lib/renderers/Json/index.vue.d.ts +2 -2
- package/lib/renderers/Markdown/index.vue.d.ts +1 -1
- package/lib/renderers/Mobi/index.vue.d.ts +1 -1
- package/lib/renderers/Msg/index.vue.d.ts +1 -1
- package/lib/renderers/Pdf/index.vue.d.ts +1 -1
- package/lib/renderers/Ppt/index.vue.d.ts +1 -1
- package/lib/renderers/Pptx/index.vue.d.ts +2 -2
- package/lib/renderers/Subtitle/index.vue.d.ts +1 -1
- package/lib/renderers/Text/index.vue.d.ts +2 -2
- package/lib/renderers/Unsupported/index.vue.d.ts +1 -1
- package/lib/renderers/Video/index.vue.d.ts +1 -1
- package/lib/renderers/Xlsx/index.vue.d.ts +2 -2
- package/lib/renderers/Xml/index.vue.d.ts +1 -1
- package/lib/renderers/Zip/TreeItem.vue.d.ts +1 -1
- package/lib/renderers/Zip/index.vue.d.ts +1 -1
- package/lib/renderers/base.types.d.ts +1 -1
- package/lib/renderers/registry.d.ts +1 -1
- package/lib/types.d.ts +3 -3
- package/package.json +2 -2
- package/lib/chunks/index--612Smof.mjs +0 -383
- package/lib/chunks/index-BB0i4QqI.mjs +0 -117
- package/lib/chunks/index-BVdrGK3Q.mjs +0 -356
- package/lib/chunks/index-Bp9CuvMZ.mjs +0 -157
- package/lib/chunks/index-Bxpf9v5j.mjs +0 -104
- package/lib/chunks/index-CDg6vIbT.mjs +0 -51
- package/lib/chunks/index-CWE-hKSs.mjs +0 -90
- package/lib/chunks/index-CY3xzGgt.mjs +0 -108
- package/lib/chunks/index-VdzIFJJW.mjs +0 -118
- package/lib/chunks/index-aoXgVLBb.mjs +0 -52
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { defineComponent as J, ref as U, watch as C, openBlock as j, createElementBlock as
|
|
2
|
-
import { u as te,
|
|
3
|
-
import { _ as
|
|
4
|
-
import { _ as
|
|
5
|
-
import { ChevronDown as
|
|
6
|
-
function
|
|
7
|
-
const
|
|
8
|
-
let n = 0,
|
|
9
|
-
function
|
|
10
|
-
let
|
|
11
|
-
for (;
|
|
1
|
+
import { defineComponent as J, ref as U, watch as C, openBlock as j, createElementBlock as $, createElementVNode as R, toDisplayString as ee, unref as Q, createBlock as W, createVNode as ne, h as g, inject as le, computed as Y } from "vue";
|
|
2
|
+
import { u as te, a as ie, b as ue, s as oe, h as se, y as fe, i as ce, l as pe, g as ke } from "./index-c-pYJEmH.mjs";
|
|
3
|
+
import { _ as ge } from "./RendererError.vue_vue_type_script_setup_true_lang-FmkMQHB8.mjs";
|
|
4
|
+
import { _ as re } from "./EmptyState.vue_vue_type_script_setup_true_lang--ZOobbGi.mjs";
|
|
5
|
+
import { ChevronDown as ae, ChevronRight as me } from "lucide-vue-next";
|
|
6
|
+
function be(e, o = !1) {
|
|
7
|
+
const s = e.length;
|
|
8
|
+
let n = 0, t = "", f = 0, i = 16, m = 0, p = 0, v = 0, y = 0, a = 0;
|
|
9
|
+
function _(l, T) {
|
|
10
|
+
let w = 0, k = 0;
|
|
11
|
+
for (; w < l; ) {
|
|
12
12
|
let u = e.charCodeAt(n);
|
|
13
13
|
if (u >= 48 && u <= 57)
|
|
14
14
|
k = k * 16 + u - 48;
|
|
@@ -18,14 +18,14 @@ function me(e, o = !1) {
|
|
|
18
18
|
k = k * 16 + u - 97 + 10;
|
|
19
19
|
else
|
|
20
20
|
break;
|
|
21
|
-
n++,
|
|
21
|
+
n++, w++;
|
|
22
22
|
}
|
|
23
|
-
return
|
|
23
|
+
return w < l && (k = -1), k;
|
|
24
24
|
}
|
|
25
|
-
function
|
|
26
|
-
n = l,
|
|
25
|
+
function b(l) {
|
|
26
|
+
n = l, t = "", f = 0, i = 16, a = 0;
|
|
27
27
|
}
|
|
28
|
-
function
|
|
28
|
+
function O() {
|
|
29
29
|
let l = n;
|
|
30
30
|
if (e.charCodeAt(n) === 48)
|
|
31
31
|
n++;
|
|
@@ -38,30 +38,30 @@ function me(e, o = !1) {
|
|
|
38
38
|
n++;
|
|
39
39
|
else
|
|
40
40
|
return a = 3, e.substring(l, n);
|
|
41
|
-
let
|
|
41
|
+
let T = n;
|
|
42
42
|
if (n < e.length && (e.charCodeAt(n) === 69 || e.charCodeAt(n) === 101))
|
|
43
43
|
if (n++, (n < e.length && e.charCodeAt(n) === 43 || e.charCodeAt(n) === 45) && n++, n < e.length && B(e.charCodeAt(n))) {
|
|
44
44
|
for (n++; n < e.length && B(e.charCodeAt(n)); )
|
|
45
45
|
n++;
|
|
46
|
-
|
|
46
|
+
T = n;
|
|
47
47
|
} else
|
|
48
48
|
a = 3;
|
|
49
|
-
return e.substring(l,
|
|
49
|
+
return e.substring(l, T);
|
|
50
50
|
}
|
|
51
51
|
function L() {
|
|
52
|
-
let l = "",
|
|
52
|
+
let l = "", T = n;
|
|
53
53
|
for (; ; ) {
|
|
54
|
-
if (n >=
|
|
55
|
-
l += e.substring(
|
|
54
|
+
if (n >= s) {
|
|
55
|
+
l += e.substring(T, n), a = 2;
|
|
56
56
|
break;
|
|
57
57
|
}
|
|
58
|
-
const
|
|
59
|
-
if (
|
|
60
|
-
l += e.substring(
|
|
58
|
+
const w = e.charCodeAt(n);
|
|
59
|
+
if (w === 34) {
|
|
60
|
+
l += e.substring(T, n), n++;
|
|
61
61
|
break;
|
|
62
62
|
}
|
|
63
|
-
if (
|
|
64
|
-
if (l += e.substring(
|
|
63
|
+
if (w === 92) {
|
|
64
|
+
if (l += e.substring(T, n), n++, n >= s) {
|
|
65
65
|
a = 2;
|
|
66
66
|
break;
|
|
67
67
|
}
|
|
@@ -92,18 +92,18 @@ function me(e, o = !1) {
|
|
|
92
92
|
l += " ";
|
|
93
93
|
break;
|
|
94
94
|
case 117:
|
|
95
|
-
const u =
|
|
95
|
+
const u = _(4);
|
|
96
96
|
u >= 0 ? l += String.fromCharCode(u) : a = 4;
|
|
97
97
|
break;
|
|
98
98
|
default:
|
|
99
99
|
a = 5;
|
|
100
100
|
}
|
|
101
|
-
|
|
101
|
+
T = n;
|
|
102
102
|
continue;
|
|
103
103
|
}
|
|
104
|
-
if (
|
|
105
|
-
if (E(
|
|
106
|
-
l += e.substring(
|
|
104
|
+
if (w >= 0 && w <= 31)
|
|
105
|
+
if (E(w)) {
|
|
106
|
+
l += e.substring(T, n), a = 2;
|
|
107
107
|
break;
|
|
108
108
|
} else
|
|
109
109
|
a = 6;
|
|
@@ -112,58 +112,58 @@ function me(e, o = !1) {
|
|
|
112
112
|
return l;
|
|
113
113
|
}
|
|
114
114
|
function A() {
|
|
115
|
-
if (
|
|
116
|
-
return
|
|
115
|
+
if (t = "", a = 0, f = n, p = m, y = v, n >= s)
|
|
116
|
+
return f = s, i = 17;
|
|
117
117
|
let l = e.charCodeAt(n);
|
|
118
118
|
if (D(l)) {
|
|
119
119
|
do
|
|
120
|
-
n++,
|
|
120
|
+
n++, t += String.fromCharCode(l), l = e.charCodeAt(n);
|
|
121
121
|
while (D(l));
|
|
122
|
-
return
|
|
122
|
+
return i = 15;
|
|
123
123
|
}
|
|
124
124
|
if (E(l))
|
|
125
|
-
return n++,
|
|
126
|
-
`), m++,
|
|
125
|
+
return n++, t += String.fromCharCode(l), l === 13 && e.charCodeAt(n) === 10 && (n++, t += `
|
|
126
|
+
`), m++, v = n, i = 14;
|
|
127
127
|
switch (l) {
|
|
128
128
|
case 123:
|
|
129
|
-
return n++,
|
|
129
|
+
return n++, i = 1;
|
|
130
130
|
case 125:
|
|
131
|
-
return n++,
|
|
131
|
+
return n++, i = 2;
|
|
132
132
|
case 91:
|
|
133
|
-
return n++,
|
|
133
|
+
return n++, i = 3;
|
|
134
134
|
case 93:
|
|
135
|
-
return n++,
|
|
135
|
+
return n++, i = 4;
|
|
136
136
|
case 58:
|
|
137
|
-
return n++,
|
|
137
|
+
return n++, i = 6;
|
|
138
138
|
case 44:
|
|
139
|
-
return n++,
|
|
139
|
+
return n++, i = 5;
|
|
140
140
|
case 34:
|
|
141
|
-
return n++,
|
|
141
|
+
return n++, t = L(), i = 10;
|
|
142
142
|
case 47:
|
|
143
|
-
const
|
|
143
|
+
const T = n - 1;
|
|
144
144
|
if (e.charCodeAt(n + 1) === 47) {
|
|
145
|
-
for (n += 2; n <
|
|
145
|
+
for (n += 2; n < s && !E(e.charCodeAt(n)); )
|
|
146
146
|
n++;
|
|
147
|
-
return
|
|
147
|
+
return t = e.substring(T, n), i = 12;
|
|
148
148
|
}
|
|
149
149
|
if (e.charCodeAt(n + 1) === 42) {
|
|
150
150
|
n += 2;
|
|
151
|
-
const
|
|
151
|
+
const w = s - 1;
|
|
152
152
|
let k = !1;
|
|
153
|
-
for (; n <
|
|
153
|
+
for (; n < w; ) {
|
|
154
154
|
const u = e.charCodeAt(n);
|
|
155
155
|
if (u === 42 && e.charCodeAt(n + 1) === 47) {
|
|
156
156
|
n += 2, k = !0;
|
|
157
157
|
break;
|
|
158
158
|
}
|
|
159
|
-
n++, E(u) && (u === 13 && e.charCodeAt(n) === 10 && n++, m++,
|
|
159
|
+
n++, E(u) && (u === 13 && e.charCodeAt(n) === 10 && n++, m++, v = n);
|
|
160
160
|
}
|
|
161
|
-
return k || (n++, a = 1),
|
|
161
|
+
return k || (n++, a = 1), t = e.substring(T, n), i = 13;
|
|
162
162
|
}
|
|
163
|
-
return
|
|
163
|
+
return t += String.fromCharCode(l), n++, i = 16;
|
|
164
164
|
case 45:
|
|
165
|
-
if (
|
|
166
|
-
return
|
|
165
|
+
if (t += String.fromCharCode(l), n++, n === s || !B(e.charCodeAt(n)))
|
|
166
|
+
return i = 16;
|
|
167
167
|
case 48:
|
|
168
168
|
case 49:
|
|
169
169
|
case 50:
|
|
@@ -174,22 +174,22 @@ function me(e, o = !1) {
|
|
|
174
174
|
case 55:
|
|
175
175
|
case 56:
|
|
176
176
|
case 57:
|
|
177
|
-
return
|
|
177
|
+
return t += O(), i = 11;
|
|
178
178
|
default:
|
|
179
|
-
for (; n <
|
|
179
|
+
for (; n < s && N(l); )
|
|
180
180
|
n++, l = e.charCodeAt(n);
|
|
181
|
-
if (
|
|
182
|
-
switch (
|
|
181
|
+
if (f !== n) {
|
|
182
|
+
switch (t = e.substring(f, n), t) {
|
|
183
183
|
case "true":
|
|
184
|
-
return
|
|
184
|
+
return i = 8;
|
|
185
185
|
case "false":
|
|
186
|
-
return
|
|
186
|
+
return i = 9;
|
|
187
187
|
case "null":
|
|
188
|
-
return
|
|
188
|
+
return i = 7;
|
|
189
189
|
}
|
|
190
|
-
return
|
|
190
|
+
return i = 16;
|
|
191
191
|
}
|
|
192
|
-
return
|
|
192
|
+
return t += String.fromCharCode(l), n++, i = 16;
|
|
193
193
|
}
|
|
194
194
|
}
|
|
195
195
|
function N(l) {
|
|
@@ -208,7 +208,7 @@ function me(e, o = !1) {
|
|
|
208
208
|
}
|
|
209
209
|
return !0;
|
|
210
210
|
}
|
|
211
|
-
function
|
|
211
|
+
function d() {
|
|
212
212
|
let l;
|
|
213
213
|
do
|
|
214
214
|
l = A();
|
|
@@ -216,15 +216,15 @@ function me(e, o = !1) {
|
|
|
216
216
|
return l;
|
|
217
217
|
}
|
|
218
218
|
return {
|
|
219
|
-
setPosition:
|
|
219
|
+
setPosition: b,
|
|
220
220
|
getPosition: () => n,
|
|
221
|
-
scan: o ?
|
|
222
|
-
getToken: () =>
|
|
223
|
-
getTokenValue: () =>
|
|
224
|
-
getTokenOffset: () =>
|
|
225
|
-
getTokenLength: () => n -
|
|
221
|
+
scan: o ? d : A,
|
|
222
|
+
getToken: () => i,
|
|
223
|
+
getTokenValue: () => t,
|
|
224
|
+
getTokenOffset: () => f,
|
|
225
|
+
getTokenLength: () => n - f,
|
|
226
226
|
getTokenStartLine: () => p,
|
|
227
|
-
getTokenStartCharacter: () =>
|
|
227
|
+
getTokenStartCharacter: () => f - y,
|
|
228
228
|
getTokenError: () => a
|
|
229
229
|
};
|
|
230
230
|
}
|
|
@@ -237,72 +237,72 @@ function E(e) {
|
|
|
237
237
|
function B(e) {
|
|
238
238
|
return e >= 48 && e <= 57;
|
|
239
239
|
}
|
|
240
|
-
var
|
|
240
|
+
var z;
|
|
241
241
|
(function(e) {
|
|
242
242
|
e[e.lineFeed = 10] = "lineFeed", e[e.carriageReturn = 13] = "carriageReturn", e[e.space = 32] = "space", e[e._0 = 48] = "_0", e[e._1 = 49] = "_1", e[e._2 = 50] = "_2", e[e._3 = 51] = "_3", e[e._4 = 52] = "_4", e[e._5 = 53] = "_5", e[e._6 = 54] = "_6", e[e._7 = 55] = "_7", e[e._8 = 56] = "_8", e[e._9 = 57] = "_9", e[e.a = 97] = "a", e[e.b = 98] = "b", e[e.c = 99] = "c", e[e.d = 100] = "d", e[e.e = 101] = "e", e[e.f = 102] = "f", e[e.g = 103] = "g", e[e.h = 104] = "h", e[e.i = 105] = "i", e[e.j = 106] = "j", e[e.k = 107] = "k", e[e.l = 108] = "l", e[e.m = 109] = "m", e[e.n = 110] = "n", e[e.o = 111] = "o", e[e.p = 112] = "p", e[e.q = 113] = "q", e[e.r = 114] = "r", e[e.s = 115] = "s", e[e.t = 116] = "t", e[e.u = 117] = "u", e[e.v = 118] = "v", e[e.w = 119] = "w", e[e.x = 120] = "x", e[e.y = 121] = "y", e[e.z = 122] = "z", e[e.A = 65] = "A", e[e.B = 66] = "B", e[e.C = 67] = "C", e[e.D = 68] = "D", e[e.E = 69] = "E", e[e.F = 70] = "F", e[e.G = 71] = "G", e[e.H = 72] = "H", e[e.I = 73] = "I", e[e.J = 74] = "J", e[e.K = 75] = "K", e[e.L = 76] = "L", e[e.M = 77] = "M", e[e.N = 78] = "N", e[e.O = 79] = "O", e[e.P = 80] = "P", e[e.Q = 81] = "Q", e[e.R = 82] = "R", e[e.S = 83] = "S", e[e.T = 84] = "T", e[e.U = 85] = "U", e[e.V = 86] = "V", e[e.W = 87] = "W", e[e.X = 88] = "X", e[e.Y = 89] = "Y", e[e.Z = 90] = "Z", e[e.asterisk = 42] = "asterisk", e[e.backslash = 92] = "backslash", e[e.closeBrace = 125] = "closeBrace", e[e.closeBracket = 93] = "closeBracket", e[e.colon = 58] = "colon", e[e.comma = 44] = "comma", e[e.dot = 46] = "dot", e[e.doubleQuote = 34] = "doubleQuote", e[e.minus = 45] = "minus", e[e.openBrace = 123] = "openBrace", e[e.openBracket = 91] = "openBracket", e[e.plus = 43] = "plus", e[e.slash = 47] = "slash", e[e.formFeed = 12] = "formFeed", e[e.tab = 9] = "tab";
|
|
243
|
-
})(
|
|
244
|
-
var
|
|
243
|
+
})(z || (z = {}));
|
|
244
|
+
var I;
|
|
245
245
|
(function(e) {
|
|
246
246
|
e.DEFAULT = {
|
|
247
247
|
allowTrailingComma: !1
|
|
248
248
|
};
|
|
249
|
-
})(
|
|
250
|
-
function
|
|
251
|
-
let n = null,
|
|
252
|
-
const
|
|
253
|
-
function
|
|
254
|
-
Array.isArray(
|
|
249
|
+
})(I || (I = {}));
|
|
250
|
+
function Te(e, o = [], s = I.DEFAULT) {
|
|
251
|
+
let n = null, t = [];
|
|
252
|
+
const f = [];
|
|
253
|
+
function i(p) {
|
|
254
|
+
Array.isArray(t) ? t.push(p) : n !== null && (t[n] = p);
|
|
255
255
|
}
|
|
256
|
-
return
|
|
256
|
+
return ve(e, {
|
|
257
257
|
onObjectBegin: () => {
|
|
258
258
|
const p = {};
|
|
259
|
-
|
|
259
|
+
i(p), f.push(t), t = p, n = null;
|
|
260
260
|
},
|
|
261
261
|
onObjectProperty: (p) => {
|
|
262
262
|
n = p;
|
|
263
263
|
},
|
|
264
264
|
onObjectEnd: () => {
|
|
265
|
-
|
|
265
|
+
t = f.pop();
|
|
266
266
|
},
|
|
267
267
|
onArrayBegin: () => {
|
|
268
268
|
const p = [];
|
|
269
|
-
|
|
269
|
+
i(p), f.push(t), t = p, n = null;
|
|
270
270
|
},
|
|
271
271
|
onArrayEnd: () => {
|
|
272
|
-
|
|
272
|
+
t = f.pop();
|
|
273
273
|
},
|
|
274
|
-
onLiteralValue:
|
|
275
|
-
onError: (p,
|
|
276
|
-
o.push({ error: p, offset:
|
|
274
|
+
onLiteralValue: i,
|
|
275
|
+
onError: (p, v, y) => {
|
|
276
|
+
o.push({ error: p, offset: v, length: y });
|
|
277
277
|
}
|
|
278
|
-
},
|
|
278
|
+
}, s), t[0];
|
|
279
279
|
}
|
|
280
|
-
function
|
|
281
|
-
const n =
|
|
282
|
-
let
|
|
283
|
-
function
|
|
284
|
-
return
|
|
280
|
+
function ve(e, o, s = I.DEFAULT) {
|
|
281
|
+
const n = be(e, !1), t = [];
|
|
282
|
+
let f = 0;
|
|
283
|
+
function i(c) {
|
|
284
|
+
return c ? () => f === 0 && c(n.getTokenOffset(), n.getTokenLength(), n.getTokenStartLine(), n.getTokenStartCharacter()) : () => !0;
|
|
285
285
|
}
|
|
286
|
-
function m(
|
|
287
|
-
return
|
|
286
|
+
function m(c) {
|
|
287
|
+
return c ? (r) => f === 0 && c(r, n.getTokenOffset(), n.getTokenLength(), n.getTokenStartLine(), n.getTokenStartCharacter()) : () => !0;
|
|
288
288
|
}
|
|
289
|
-
function p(
|
|
290
|
-
return
|
|
289
|
+
function p(c) {
|
|
290
|
+
return c ? (r) => f === 0 && c(r, n.getTokenOffset(), n.getTokenLength(), n.getTokenStartLine(), n.getTokenStartCharacter(), () => t.slice()) : () => !0;
|
|
291
291
|
}
|
|
292
|
-
function
|
|
293
|
-
return
|
|
294
|
-
|
|
292
|
+
function v(c) {
|
|
293
|
+
return c ? () => {
|
|
294
|
+
f > 0 ? f++ : c(n.getTokenOffset(), n.getTokenLength(), n.getTokenStartLine(), n.getTokenStartCharacter(), () => t.slice()) === !1 && (f = 1);
|
|
295
295
|
} : () => !0;
|
|
296
296
|
}
|
|
297
|
-
function
|
|
298
|
-
return
|
|
299
|
-
|
|
297
|
+
function y(c) {
|
|
298
|
+
return c ? () => {
|
|
299
|
+
f > 0 && f--, f === 0 && c(n.getTokenOffset(), n.getTokenLength(), n.getTokenStartLine(), n.getTokenStartCharacter());
|
|
300
300
|
} : () => !0;
|
|
301
301
|
}
|
|
302
|
-
const a =
|
|
302
|
+
const a = v(o.onObjectBegin), _ = p(o.onObjectProperty), b = y(o.onObjectEnd), O = v(o.onArrayBegin), L = y(o.onArrayEnd), A = p(o.onLiteralValue), N = m(o.onSeparator), d = i(o.onComment), l = m(o.onError), T = s && s.disallowComments, w = s && s.allowTrailingComma;
|
|
303
303
|
function k() {
|
|
304
304
|
for (; ; ) {
|
|
305
|
-
const
|
|
305
|
+
const c = n.scan();
|
|
306
306
|
switch (n.getTokenError()) {
|
|
307
307
|
case 4:
|
|
308
308
|
u(
|
|
@@ -323,7 +323,7 @@ function Te(e, o, c = V.DEFAULT) {
|
|
|
323
323
|
);
|
|
324
324
|
break;
|
|
325
325
|
case 1:
|
|
326
|
-
|
|
326
|
+
T || u(
|
|
327
327
|
11
|
|
328
328
|
/* ParseErrorCode.UnexpectedEndOfComment */
|
|
329
329
|
);
|
|
@@ -341,13 +341,13 @@ function Te(e, o, c = V.DEFAULT) {
|
|
|
341
341
|
);
|
|
342
342
|
break;
|
|
343
343
|
}
|
|
344
|
-
switch (
|
|
344
|
+
switch (c) {
|
|
345
345
|
case 12:
|
|
346
346
|
case 13:
|
|
347
|
-
|
|
347
|
+
T ? u(
|
|
348
348
|
10
|
|
349
349
|
/* ParseErrorCode.InvalidCommentToken */
|
|
350
|
-
) :
|
|
350
|
+
) : d();
|
|
351
351
|
break;
|
|
352
352
|
case 16:
|
|
353
353
|
u(
|
|
@@ -359,32 +359,32 @@ function Te(e, o, c = V.DEFAULT) {
|
|
|
359
359
|
case 14:
|
|
360
360
|
break;
|
|
361
361
|
default:
|
|
362
|
-
return
|
|
362
|
+
return c;
|
|
363
363
|
}
|
|
364
364
|
}
|
|
365
365
|
}
|
|
366
|
-
function u(
|
|
367
|
-
if (l(
|
|
368
|
-
let
|
|
369
|
-
for (;
|
|
370
|
-
if (r.indexOf(
|
|
366
|
+
function u(c, r = [], q = []) {
|
|
367
|
+
if (l(c), r.length + q.length > 0) {
|
|
368
|
+
let V = n.getToken();
|
|
369
|
+
for (; V !== 17; ) {
|
|
370
|
+
if (r.indexOf(V) !== -1) {
|
|
371
371
|
k();
|
|
372
372
|
break;
|
|
373
|
-
} else if (q.indexOf(
|
|
373
|
+
} else if (q.indexOf(V) !== -1)
|
|
374
374
|
break;
|
|
375
|
-
|
|
375
|
+
V = k();
|
|
376
376
|
}
|
|
377
377
|
}
|
|
378
378
|
}
|
|
379
|
-
function G(
|
|
379
|
+
function G(c) {
|
|
380
380
|
const r = n.getTokenValue();
|
|
381
|
-
return
|
|
381
|
+
return c ? A(r) : (_(r), t.push(r)), k(), !0;
|
|
382
382
|
}
|
|
383
383
|
function P() {
|
|
384
384
|
switch (n.getToken()) {
|
|
385
385
|
case 11:
|
|
386
|
-
const
|
|
387
|
-
let r = Number(
|
|
386
|
+
const c = n.getTokenValue();
|
|
387
|
+
let r = Number(c);
|
|
388
388
|
isNaN(r) && (u(
|
|
389
389
|
2
|
|
390
390
|
/* ParseErrorCode.InvalidNumberFormat */
|
|
@@ -409,7 +409,7 @@ function Te(e, o, c = V.DEFAULT) {
|
|
|
409
409
|
2,
|
|
410
410
|
5
|
|
411
411
|
/* SyntaxKind.CommaToken */
|
|
412
|
-
]), !1) : (G(!1), n.getToken() === 6 ? (N(":"), k(),
|
|
412
|
+
]), !1) : (G(!1), n.getToken() === 6 ? (N(":"), k(), F() || u(4, [], [
|
|
413
413
|
2,
|
|
414
414
|
5
|
|
415
415
|
/* SyntaxKind.CommaToken */
|
|
@@ -417,47 +417,47 @@ function Te(e, o, c = V.DEFAULT) {
|
|
|
417
417
|
2,
|
|
418
418
|
5
|
|
419
419
|
/* SyntaxKind.CommaToken */
|
|
420
|
-
]),
|
|
420
|
+
]), t.pop(), !0);
|
|
421
421
|
}
|
|
422
422
|
function x() {
|
|
423
423
|
a(), k();
|
|
424
|
-
let
|
|
424
|
+
let c = !1;
|
|
425
425
|
for (; n.getToken() !== 2 && n.getToken() !== 17; ) {
|
|
426
426
|
if (n.getToken() === 5) {
|
|
427
|
-
if (
|
|
427
|
+
if (c || u(4, [], []), N(","), k(), n.getToken() === 2 && w)
|
|
428
428
|
break;
|
|
429
|
-
} else
|
|
429
|
+
} else c && u(6, [], []);
|
|
430
430
|
h() || u(4, [], [
|
|
431
431
|
2,
|
|
432
432
|
5
|
|
433
433
|
/* SyntaxKind.CommaToken */
|
|
434
|
-
]),
|
|
434
|
+
]), c = !0;
|
|
435
435
|
}
|
|
436
|
-
return
|
|
436
|
+
return b(), n.getToken() !== 2 ? u(7, [
|
|
437
437
|
2
|
|
438
438
|
/* SyntaxKind.CloseBraceToken */
|
|
439
439
|
], []) : k(), !0;
|
|
440
440
|
}
|
|
441
441
|
function K() {
|
|
442
|
-
|
|
443
|
-
let
|
|
442
|
+
O(), k();
|
|
443
|
+
let c = !0, r = !1;
|
|
444
444
|
for (; n.getToken() !== 4 && n.getToken() !== 17; ) {
|
|
445
445
|
if (n.getToken() === 5) {
|
|
446
|
-
if (r || u(4, [], []), N(","), k(), n.getToken() === 4 &&
|
|
446
|
+
if (r || u(4, [], []), N(","), k(), n.getToken() === 4 && w)
|
|
447
447
|
break;
|
|
448
448
|
} else r && u(6, [], []);
|
|
449
|
-
|
|
449
|
+
c ? (t.push(0), c = !1) : t[t.length - 1]++, F() || u(4, [], [
|
|
450
450
|
4,
|
|
451
451
|
5
|
|
452
452
|
/* SyntaxKind.CommaToken */
|
|
453
453
|
]), r = !0;
|
|
454
454
|
}
|
|
455
|
-
return L(),
|
|
455
|
+
return L(), c || t.pop(), n.getToken() !== 4 ? u(8, [
|
|
456
456
|
4
|
|
457
457
|
/* SyntaxKind.CloseBracketToken */
|
|
458
458
|
], []) : k(), !0;
|
|
459
459
|
}
|
|
460
|
-
function
|
|
460
|
+
function F() {
|
|
461
461
|
switch (n.getToken()) {
|
|
462
462
|
case 3:
|
|
463
463
|
return K();
|
|
@@ -469,31 +469,31 @@ function Te(e, o, c = V.DEFAULT) {
|
|
|
469
469
|
return P();
|
|
470
470
|
}
|
|
471
471
|
}
|
|
472
|
-
return k(), n.getToken() === 17 ?
|
|
472
|
+
return k(), n.getToken() === 17 ? s.allowEmptyContent ? !0 : (u(4, [], []), !1) : F() ? (n.getToken() !== 17 && u(9, [], []), !0) : (u(4, [], []), !1);
|
|
473
473
|
}
|
|
474
|
-
var
|
|
474
|
+
var M;
|
|
475
475
|
(function(e) {
|
|
476
476
|
e[e.None = 0] = "None", e[e.UnexpectedEndOfComment = 1] = "UnexpectedEndOfComment", e[e.UnexpectedEndOfString = 2] = "UnexpectedEndOfString", e[e.UnexpectedEndOfNumber = 3] = "UnexpectedEndOfNumber", e[e.InvalidUnicode = 4] = "InvalidUnicode", e[e.InvalidEscapeCharacter = 5] = "InvalidEscapeCharacter", e[e.InvalidCharacter = 6] = "InvalidCharacter";
|
|
477
|
-
})(
|
|
478
|
-
var
|
|
477
|
+
})(M || (M = {}));
|
|
478
|
+
var X;
|
|
479
479
|
(function(e) {
|
|
480
480
|
e[e.OpenBraceToken = 1] = "OpenBraceToken", e[e.CloseBraceToken = 2] = "CloseBraceToken", e[e.OpenBracketToken = 3] = "OpenBracketToken", e[e.CloseBracketToken = 4] = "CloseBracketToken", e[e.CommaToken = 5] = "CommaToken", e[e.ColonToken = 6] = "ColonToken", e[e.NullKeyword = 7] = "NullKeyword", e[e.TrueKeyword = 8] = "TrueKeyword", e[e.FalseKeyword = 9] = "FalseKeyword", e[e.StringLiteral = 10] = "StringLiteral", e[e.NumericLiteral = 11] = "NumericLiteral", e[e.LineCommentTrivia = 12] = "LineCommentTrivia", e[e.BlockCommentTrivia = 13] = "BlockCommentTrivia", e[e.LineBreakTrivia = 14] = "LineBreakTrivia", e[e.Trivia = 15] = "Trivia", e[e.Unknown = 16] = "Unknown", e[e.EOF = 17] = "EOF";
|
|
481
|
-
})(
|
|
482
|
-
const
|
|
481
|
+
})(X || (X = {}));
|
|
482
|
+
const we = Te;
|
|
483
483
|
var Z;
|
|
484
484
|
(function(e) {
|
|
485
485
|
e[e.InvalidSymbol = 1] = "InvalidSymbol", e[e.InvalidNumberFormat = 2] = "InvalidNumberFormat", e[e.PropertyNameExpected = 3] = "PropertyNameExpected", e[e.ValueExpected = 4] = "ValueExpected", e[e.ColonExpected = 5] = "ColonExpected", e[e.CommaExpected = 6] = "CommaExpected", e[e.CloseBraceExpected = 7] = "CloseBraceExpected", e[e.CloseBracketExpected = 8] = "CloseBracketExpected", e[e.EndOfFileExpected = 9] = "EndOfFileExpected", e[e.InvalidCommentToken = 10] = "InvalidCommentToken", e[e.UnexpectedEndOfComment = 11] = "UnexpectedEndOfComment", e[e.UnexpectedEndOfString = 12] = "UnexpectedEndOfString", e[e.UnexpectedEndOfNumber = 13] = "UnexpectedEndOfNumber", e[e.InvalidUnicode = 14] = "InvalidUnicode", e[e.InvalidEscapeCharacter = 15] = "InvalidEscapeCharacter", e[e.InvalidCharacter = 16] = "InvalidCharacter";
|
|
486
486
|
})(Z || (Z = {}));
|
|
487
|
-
const
|
|
487
|
+
const ye = {
|
|
488
488
|
key: 0,
|
|
489
489
|
class: "vfp-renderer-loading"
|
|
490
|
-
},
|
|
490
|
+
}, Oe = { class: "vfp-renderer-loading-content" }, _e = { class: "vfp-renderer-loading-text" }, Ae = {
|
|
491
491
|
key: 3,
|
|
492
492
|
class: "vfp-w-full vfp-h-full vfp-bg-code-bg"
|
|
493
|
-
},
|
|
493
|
+
}, Le = {
|
|
494
494
|
key: 4,
|
|
495
495
|
class: "vfp-w-full vfp-h-full vfp-overflow-auto vfp-bg-code-bg vfp-py-6 vfp-px-4"
|
|
496
|
-
},
|
|
496
|
+
}, Be = J({ name: "JsonRenderer" }), Ne = {
|
|
497
497
|
key: "#9cdcfe",
|
|
498
498
|
string: "#ce9178",
|
|
499
499
|
number: "#b5cea8",
|
|
@@ -502,7 +502,7 @@ const we = {
|
|
|
502
502
|
colon: "rgb(255 255 255 / 0.6)",
|
|
503
503
|
collapsed: "rgb(255 255 255 / 0.4)",
|
|
504
504
|
arrow: "rgb(255 255 255 / 0.5)"
|
|
505
|
-
},
|
|
505
|
+
}, je = {
|
|
506
506
|
key: "#005cc5",
|
|
507
507
|
string: "#032f62",
|
|
508
508
|
number: "#005cc5",
|
|
@@ -512,20 +512,20 @@ const we = {
|
|
|
512
512
|
collapsed: "rgb(23 23 23 / 0.45)",
|
|
513
513
|
arrow: "rgb(23 23 23 / 0.55)"
|
|
514
514
|
};
|
|
515
|
-
function
|
|
516
|
-
return e === "light" ?
|
|
515
|
+
function Ee(e) {
|
|
516
|
+
return e === "light" ? je : Ne;
|
|
517
517
|
}
|
|
518
|
-
function
|
|
518
|
+
function Ue(e, o) {
|
|
519
519
|
return e === null ? g("span", { class: "json-null", style: { color: o.keyword } }, "null") : e === void 0 ? g("span", { class: "json-null", style: { color: o.keyword } }, "undefined") : typeof e == "boolean" ? g("span", { style: { color: o.keyword } }, String(e)) : typeof e == "number" ? g("span", { style: { color: o.number } }, String(e)) : typeof e == "string" ? g("span", { style: { color: o.string } }, `"${e}"`) : g("span", { style: { color: o.bracket } }, String(e));
|
|
520
520
|
}
|
|
521
|
-
function S(e, o,
|
|
522
|
-
return g("div", { class: "json-row", style: { paddingLeft: `${
|
|
521
|
+
function S(e, o, s, n, t) {
|
|
522
|
+
return g("div", { class: "json-row", style: { paddingLeft: `${s}px` } }, [
|
|
523
523
|
g("span", { class: "json-arrow-placeholder" }),
|
|
524
524
|
e !== void 0 ? g("span", { class: "json-key", style: { color: n.key } }, [
|
|
525
525
|
`"${e}"`,
|
|
526
526
|
g("span", { style: { color: n.colon } }, ": ")
|
|
527
527
|
]) : null,
|
|
528
|
-
|
|
528
|
+
t ? g("span", { style: { color: n.bracket } }, t) : Ue(o, n)
|
|
529
529
|
]);
|
|
530
530
|
}
|
|
531
531
|
const H = J({
|
|
@@ -537,84 +537,84 @@ const H = J({
|
|
|
537
537
|
defaultExpanded: { type: Boolean, default: !1 }
|
|
538
538
|
},
|
|
539
539
|
setup(e) {
|
|
540
|
-
const o = U(e.defaultExpanded),
|
|
540
|
+
const o = U(e.defaultExpanded), s = () => {
|
|
541
541
|
o.value = !o.value;
|
|
542
|
-
}, n = le(
|
|
543
|
-
return { expanded: o, toggle:
|
|
542
|
+
}, n = le(ce, null), t = Y(() => (n == null ? void 0 : n.t.value) ?? pe({ locale: "en-US" })), f = ke(), i = Y(() => Ee(f.value));
|
|
543
|
+
return { expanded: o, toggle: s, tFunc: t, colors: i };
|
|
544
544
|
},
|
|
545
545
|
render() {
|
|
546
|
-
const { keyName: e, value: o, depth:
|
|
546
|
+
const { keyName: e, value: o, depth: s, expanded: n, toggle: t, tFunc: f, colors: i } = this, m = s * 20;
|
|
547
547
|
if (o == null || typeof o != "object")
|
|
548
|
-
return S(e, o, m,
|
|
549
|
-
const p = Array.isArray(o),
|
|
550
|
-
if (
|
|
551
|
-
return S(e, null, m,
|
|
552
|
-
const
|
|
553
|
-
return
|
|
548
|
+
return S(e, o, m, i);
|
|
549
|
+
const p = Array.isArray(o), y = (p ? o : Object.entries(o)).length, a = p ? "[" : "{", _ = p ? "]" : "}";
|
|
550
|
+
if (y === 0)
|
|
551
|
+
return S(e, null, m, i, `${a}${_}`);
|
|
552
|
+
const b = [];
|
|
553
|
+
return b.push(
|
|
554
554
|
g("div", {
|
|
555
555
|
class: "json-row json-toggle",
|
|
556
556
|
style: { paddingLeft: `${m}px` },
|
|
557
|
-
onClick:
|
|
557
|
+
onClick: t
|
|
558
558
|
}, [
|
|
559
|
-
g("span", { class: "json-arrow", style: { color:
|
|
560
|
-
g(n ?
|
|
559
|
+
g("span", { class: "json-arrow", style: { color: i.arrow } }, [
|
|
560
|
+
g(n ? ae : me, { class: "vfp-w-3.5 vfp-h-3.5" })
|
|
561
561
|
]),
|
|
562
|
-
e !== void 0 ? g("span", { class: "json-key", style: { color:
|
|
562
|
+
e !== void 0 ? g("span", { class: "json-key", style: { color: i.key } }, [
|
|
563
563
|
`"${e}"`,
|
|
564
|
-
g("span", { style: { color:
|
|
564
|
+
g("span", { style: { color: i.colon } }, ": ")
|
|
565
565
|
]) : null,
|
|
566
|
-
g("span", { style: { color:
|
|
567
|
-
n ? null : g("span", { class: "json-collapsed", style: { color:
|
|
568
|
-
p ? `${
|
|
569
|
-
g("span", { style: { color:
|
|
566
|
+
g("span", { style: { color: i.bracket } }, a),
|
|
567
|
+
n ? null : g("span", { class: "json-collapsed", style: { color: i.collapsed } }, [
|
|
568
|
+
p ? `${y} ${f("json.items")}` : `${y} ${f("json.keys")}`,
|
|
569
|
+
g("span", { style: { color: i.bracket } }, ` ${_}`)
|
|
570
570
|
])
|
|
571
571
|
])
|
|
572
|
-
), n && (p ? o.forEach((
|
|
573
|
-
|
|
574
|
-
g(H, { key: L, value:
|
|
572
|
+
), n && (p ? o.forEach((O, L) => {
|
|
573
|
+
b.push(
|
|
574
|
+
g(H, { key: L, value: O, depth: s + 1, defaultExpanded: s < 1 })
|
|
575
575
|
);
|
|
576
|
-
}) : Object.entries(o).forEach(([
|
|
577
|
-
|
|
578
|
-
g(H, { key:
|
|
576
|
+
}) : Object.entries(o).forEach(([O, L]) => {
|
|
577
|
+
b.push(
|
|
578
|
+
g(H, { key: O, keyName: O, value: L, depth: s + 1, defaultExpanded: s < 1 })
|
|
579
579
|
);
|
|
580
|
-
}),
|
|
580
|
+
}), b.push(
|
|
581
581
|
g("div", { class: "json-row", style: { paddingLeft: `${m + 20}px` } }, [
|
|
582
|
-
g("span", { style: { color:
|
|
582
|
+
g("span", { style: { color: i.bracket } }, _)
|
|
583
583
|
])
|
|
584
|
-
)), g("div", null,
|
|
584
|
+
)), g("div", null, b);
|
|
585
585
|
}
|
|
586
|
-
}),
|
|
587
|
-
...
|
|
586
|
+
}), Re = /* @__PURE__ */ J({
|
|
587
|
+
...Be,
|
|
588
588
|
props: {
|
|
589
589
|
url: {},
|
|
590
590
|
fileName: {},
|
|
591
591
|
emptyHint: {}
|
|
592
592
|
},
|
|
593
593
|
setup(e, { expose: o }) {
|
|
594
|
-
const
|
|
595
|
-
return C(() =>
|
|
596
|
-
|
|
594
|
+
const s = e, { t: n } = te(), t = ie(), f = ue(), i = U(null), m = U(!1), p = U(!0), v = U(null), y = () => oe(s.emptyHint, "textual");
|
|
595
|
+
return C(() => s.url, async () => {
|
|
596
|
+
f.begin(s.url), p.value = !0, v.value = null;
|
|
597
597
|
try {
|
|
598
|
-
const
|
|
599
|
-
|
|
600
|
-
} catch (
|
|
601
|
-
console.error(
|
|
598
|
+
const b = await se(s.url, { fetcher: t.value });
|
|
599
|
+
m.value = fe(b), i.value = m.value ? null : we(b);
|
|
600
|
+
} catch (b) {
|
|
601
|
+
console.error(b), v.value = n.value("json.load_failed"), f.error(b);
|
|
602
602
|
} finally {
|
|
603
|
-
|
|
603
|
+
p.value = !1;
|
|
604
604
|
}
|
|
605
605
|
}, { immediate: !0 }), o({
|
|
606
606
|
getToolbarGroups: () => []
|
|
607
|
-
}), (
|
|
608
|
-
R("div",
|
|
609
|
-
|
|
610
|
-
R("span",
|
|
607
|
+
}), (b, O) => p.value ? (j(), $("div", ye, [
|
|
608
|
+
R("div", Oe, [
|
|
609
|
+
O[0] || (O[0] = R("div", { class: "vfp-renderer-spinner" }, null, -1)),
|
|
610
|
+
R("span", _e, ee(Q(n)("common.loading")), 1)
|
|
611
611
|
])
|
|
612
|
-
])) :
|
|
612
|
+
])) : v.value ? (j(), W(ge, {
|
|
613
613
|
key: 1,
|
|
614
|
-
message:
|
|
615
|
-
}, null, 8, ["message"])) :
|
|
614
|
+
message: v.value
|
|
615
|
+
}, null, 8, ["message"])) : m.value && y() ? (j(), W(re, { key: 2 })) : m.value ? (j(), $("div", Ae)) : (j(), $("div", Le, [
|
|
616
616
|
ne(Q(H), {
|
|
617
|
-
value:
|
|
617
|
+
value: i.value,
|
|
618
618
|
depth: 0,
|
|
619
619
|
"default-expanded": !0
|
|
620
620
|
}, null, 8, ["value"])
|
|
@@ -622,5 +622,5 @@ const H = J({
|
|
|
622
622
|
}
|
|
623
623
|
});
|
|
624
624
|
export {
|
|
625
|
-
|
|
625
|
+
Re as default
|
|
626
626
|
};
|