@vtj/renderer 0.8.168 → 0.8.170

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.mjs CHANGED
@@ -1,18 +1,18 @@
1
- import { Base as Se, BUILT_IN_COMPONENTS as $e, ProjectModel as I, HistoryModel as ne } from "@vtj/core";
2
- import { isUrl as je, url as b, dedupArray as Ee, isString as $, isFunction as Y, logger as A, createRequest as Pe, merge as be, pathToRegexp as Re, pathToRegexpMatch as Ce, formDataToJson as Fe, storage as k, cookie as T, toArray as Q, delay as re, camelCase as j, upperFirst as xe, pick as Ie, jsonp as Ae, loadScript as X, Request as He, Storage as Oe, mapToObject as q } from "@vtj/utils";
1
+ import { Base as $e, BUILT_IN_COMPONENTS as je, ProjectModel as I, HistoryModel as ne } from "@vtj/core";
2
+ import { isUrl as Ee, url as b, dedupArray as Pe, isString as $, isFunction as Y, logger as D, createRequest as be, merge as Re, pathToRegexp as Ce, pathToRegexpMatch as Fe, formDataToJson as xe, storage as k, cookie as T, toArray as Q, unAES as Ie, MD5 as De, delay as re, camelCase as j, upperFirst as Ae, pick as Oe, jsonp as He, loadScript as X, Request as Me, Storage as ke, mapToObject as q } from "@vtj/utils";
3
3
  import * as O from "vue";
4
- import { inject as oe, toRef as De, readonly as Me, customRef as ke, ref as J, onBeforeUnmount as Te, getCurrentScope as Be, onScopeDispose as Ue, unref as Ne, getCurrentInstance as ie, watch as ae, computed as ce, onMounted as Le, defineComponent as ue, h as U, defineAsyncComponent as Z, watchEffect as qe } from "vue";
4
+ import { inject as oe, toRef as Te, readonly as Be, customRef as Ue, ref as J, onBeforeUnmount as Ne, getCurrentScope as Le, onScopeDispose as qe, unref as Je, getCurrentInstance as ie, watch as ae, computed as ce, onMounted as Ve, defineComponent as ue, h as U, defineAsyncComponent as Z, watchEffect as ze } from "vue";
5
5
  import { useRoute as le } from "vue-router";
6
- import { ElNotification as D, ElLoading as Je } from "element-plus";
7
- import { XStartup as Ve } from "@vtj/ui";
6
+ import { ElNotification as H, ElLoading as Ke } from "element-plus";
7
+ import { XStartup as We } from "@vtj/ui";
8
8
  /**!
9
9
  * Copyright (c) 2024, VTJ.PRO All rights reserved.
10
10
  * @name @vtj/renderer
11
11
  * @author CHC chenhuachun1549@dingtalk.com
12
- * @version 0.8.168
12
+ * @version 0.8.170
13
13
  * @license <a href="https://vtj.pro/license.html">MIT License</a>
14
14
  */
15
- const R = "0.8.168";
15
+ const R = "0.8.170";
16
16
  var _ = /* @__PURE__ */ ((n) => (n.Runtime = "Runtime", n.Design = "Design", n.Raw = "Raw", n.VNode = "VNode", n))(_ || {});
17
17
  const ee = [
18
18
  "$el",
@@ -26,7 +26,7 @@ const ee = [
26
26
  "$props",
27
27
  "$options",
28
28
  "$forceUpdate"
29
- ], os = [
29
+ ], us = [
30
30
  "beforeCreate",
31
31
  "created",
32
32
  "beforeMount",
@@ -40,7 +40,7 @@ const ee = [
40
40
  "renderTriggered",
41
41
  "activated",
42
42
  "deactivated"
43
- ], ze = ["vIf", "vShow", "vModel", "vFor", "vBind"], Ke = {
43
+ ], Ge = ["vIf", "vShow", "vModel", "vFor", "vBind"], Ye = {
44
44
  String,
45
45
  Number,
46
46
  Boolean,
@@ -50,7 +50,7 @@ const ee = [
50
50
  Date
51
51
  };
52
52
  function F(n, e) {
53
- return n.map((t) => je(t) || t.startsWith("/") ? t : `${e}${t}`);
53
+ return n.map((t) => Ee(t) || t.startsWith("/") ? t : `${e}${t}`);
54
54
  }
55
55
  function V(n) {
56
56
  return /\.css$/.test(n);
@@ -58,42 +58,42 @@ function V(n) {
58
58
  function z(n) {
59
59
  return /\.js$/.test(n);
60
60
  }
61
- function We(n) {
61
+ function Qe(n) {
62
62
  return /\.json$/.test(n);
63
63
  }
64
- function is(n) {
64
+ function ls(n) {
65
65
  return n.map(
66
66
  (e) => `<script src="${b.append(e, { v: R })}"><\/script>`
67
67
  ).join("");
68
68
  }
69
- function as(n = []) {
69
+ function fs(n = []) {
70
70
  return n.map(
71
71
  (e) => `<link rel="stylesheet" href="${b.append(e, { v: R })}" />`
72
72
  ).join("");
73
73
  }
74
- function Ge(n, e = !1) {
74
+ function Xe(n, e = !1) {
75
75
  return e && n.endsWith(".prod.js") ? n.replace(".prod.js", ".js") : n;
76
76
  }
77
- function Ye(n, e, t = !1) {
78
- const s = n.filter((l) => !!l.enabled), r = [], o = [], a = [], i = [], u = {}, c = {}, p = [], f = {};
77
+ function Ze(n, e, t = !1) {
78
+ const s = n.filter((f) => !!f.enabled), r = [], o = [], a = [], i = [], u = {}, c = {}, p = [], l = {};
79
79
  return s.forEach(
80
- ({ urls: l, assetsUrl: m, library: d, assetsLibrary: h, localeLibrary: w }) => {
81
- l?.forEach((v) => {
82
- z(v) && r.push(Ge(v, t)), V(v) && o.push(v);
83
- }), d && (i.push(d), u[d] = F(l || [], e), w && (c[d] = w)), m && a.push(m), h && p.push(h), d && h && (f[h] = d);
80
+ ({ urls: f, assetsUrl: m, library: d, assetsLibrary: h, localeLibrary: w }) => {
81
+ f?.forEach((v) => {
82
+ z(v) && r.push(Xe(v, t)), V(v) && o.push(v);
83
+ }), d && (i.push(d), u[d] = F(f || [], e), w && (c[d] = w)), m && a.push(m), h && p.push(h), d && h && (l[h] = d);
84
84
  }
85
85
  ), {
86
86
  scripts: F(r, e),
87
87
  css: F(o, e),
88
88
  materials: F(a, e),
89
89
  libraryExports: i,
90
- materialExports: Ee(p),
91
- materialMapLibrary: f,
90
+ materialExports: Pe(p),
91
+ materialMapLibrary: l,
92
92
  libraryMap: u,
93
93
  libraryLocaleMap: c
94
94
  };
95
95
  }
96
- function Qe(n, e) {
96
+ function et(n, e) {
97
97
  const { name: t, parent: s, alias: r } = n;
98
98
  return s ? e[s]?.[r || t] : e[r || t];
99
99
  }
@@ -115,11 +115,11 @@ function de(n, e, t) {
115
115
  o ? o.innerHTML = t : (o = r.createElement("style"), o.id = e, o.innerHTML = t, r.head.appendChild(o));
116
116
  }
117
117
  }
118
- async function Xe(n, e) {
118
+ async function tt(n, e) {
119
119
  const t = await window.fetch(e).then((s) => s.text()).catch(() => "");
120
120
  t && de(window, n, t);
121
121
  }
122
- function Ze(n, e = window) {
122
+ function st(n, e = window) {
123
123
  const t = e.document, s = e.document.head;
124
124
  for (const r of n)
125
125
  if (!t.getElementById(r)) {
@@ -127,7 +127,7 @@ function Ze(n, e = window) {
127
127
  a.rel = "stylesheet", a.id = r, a.href = r, s.appendChild(a);
128
128
  }
129
129
  }
130
- async function et(n, e, t = window) {
130
+ async function nt(n, e, t = window) {
131
131
  const s = t.document, r = t.document.head;
132
132
  let o = t[e];
133
133
  return o ? o.default || o : new Promise((a, i) => {
@@ -141,7 +141,7 @@ async function et(n, e, t = window) {
141
141
  }
142
142
  });
143
143
  }
144
- function tt(n) {
144
+ function rt(n) {
145
145
  return Y(n) || Y(n?.install);
146
146
  }
147
147
  function C(n, e, t = !1, s = !1) {
@@ -154,13 +154,13 @@ function C(n, e, t = !1, s = !1) {
154
154
  const a = `with(${t ? "{}" : "$scope || {}"}) { ${o} }`;
155
155
  return new Function("$scope", a)(e);
156
156
  } catch (r) {
157
- if (A.error("parseExpression.error", r, n, e?.__self ?? e), s)
157
+ if (D.error("parseExpression.error", r, n, e?.__self ?? e), s)
158
158
  throw r;
159
159
  }
160
160
  }
161
161
  function te(n, e, t = !1, s = !1) {
162
162
  const r = C(n, e, t, s);
163
- if (typeof r != "function" && (A.error(
163
+ if (typeof r != "function" && (D.error(
164
164
  "parseFunction.error",
165
165
  "not a function",
166
166
  n,
@@ -175,14 +175,14 @@ function S(n) {
175
175
  function M(n) {
176
176
  return typeof n == "object" && n && n.type === "JSFunction";
177
177
  }
178
- function st(n) {
178
+ function ot(n) {
179
179
  return S(n) || M(n);
180
180
  }
181
- function cs(n) {
182
- return st(n) ? n.value : JSON.stringify(n);
181
+ function ds(n) {
182
+ return ot(n) ? n.value : JSON.stringify(n);
183
183
  }
184
184
  let E = null;
185
- const nt = Pe({
185
+ const it = be({
186
186
  settings: {
187
187
  type: "form",
188
188
  validSuccess: !0,
@@ -191,12 +191,12 @@ const nt = Pe({
191
191
  validate: (n) => n.data?.code === 0 || !!n.data?.success,
192
192
  failMessage: !0,
193
193
  showError: (n) => {
194
- D.error({
194
+ H.error({
195
195
  message: n || "未知错误"
196
196
  });
197
197
  },
198
198
  showLoading: () => {
199
- E && E.close(), E = Je.service({
199
+ E && E.close(), E = Ke.service({
200
200
  lock: !0,
201
201
  text: "Loading",
202
202
  background: "rgba(0, 0, 0, 0.05)"
@@ -208,7 +208,7 @@ const nt = Pe({
208
208
  }
209
209
  });
210
210
  let P;
211
- function rt(n, e) {
211
+ function at(n, e) {
212
212
  const { jsonp: t, request: s } = e;
213
213
  if (n.method === "jsonp")
214
214
  return (r = {}) => t(n.url, {
@@ -224,10 +224,10 @@ function rt(n, e) {
224
224
  headers: r
225
225
  }
226
226
  };
227
- return (a, i) => (delete o.data, s.send(be(o, i || {}, { data: a })));
227
+ return (a, i) => (delete o.data, s.send(Re(o, i || {}, { data: a })));
228
228
  }
229
229
  }
230
- function ot(n, e) {
230
+ function ct(n, e) {
231
231
  const { metaQuery: t } = e;
232
232
  if (!t) return;
233
233
  const { code: s, queryCode: r } = n;
@@ -239,26 +239,26 @@ function ot(n, e) {
239
239
  return t(s, r, o, a);
240
240
  };
241
241
  }
242
- function it(n = [], e = [], t) {
242
+ function ut(n = [], e = [], t) {
243
243
  const s = {};
244
244
  for (const r of n)
245
- s[r.id] = rt(r, t);
245
+ s[r.id] = at(r, t);
246
246
  for (const r of e)
247
- s[r.id] = ot(r, t);
247
+ s[r.id] = ct(r, t);
248
248
  return s;
249
249
  }
250
- async function at(n = []) {
250
+ async function lt(n = []) {
251
251
  P = await import("mockjs").then((e) => e.default || e), P && (P.setup({
252
252
  timeout: "50-500"
253
- }), pe(), n.forEach((e) => ct(P, e)));
253
+ }), pe(), n.forEach((e) => ft(P, e)));
254
254
  }
255
- function ct(n, e) {
255
+ function ft(n, e) {
256
256
  if (!e.mock) return;
257
257
  const { url: t, mockTemplate: s } = e;
258
258
  if (t && s) {
259
- const r = Re(`${t}(.*)`), o = Ce(t, { decode: decodeURIComponent }), a = C(s, {}, !0);
259
+ const r = Ce(`${t}(.*)`), o = Fe(t, { decode: decodeURIComponent }), a = C(s, {}, !0);
260
260
  n.mock(r, (i) => {
261
- const u = b.parse(i.url) || {}, c = i.body instanceof FormData ? Fe(i.body) : i.body, p = o(i.url)?.params;
261
+ const u = b.parse(i.url) || {}, c = i.body instanceof FormData ? xe(i.body) : i.body, p = o(i.url)?.params;
262
262
  return Object.assign(i, { data: c, params: u, query: p }), n.mock(a(i));
263
263
  });
264
264
  }
@@ -266,7 +266,7 @@ function ct(n, e) {
266
266
  function pe() {
267
267
  P && (P._mocked = {});
268
268
  }
269
- const ut = {
269
+ const dt = {
270
270
  session: !1,
271
271
  authKey: "Authorization",
272
272
  storageKey: "ACCESS_STORAGE",
@@ -277,12 +277,12 @@ const ut = {
277
277
  unauthorizedCode: 401,
278
278
  unauthorizedMessage: "登录已经失效,请重新登录!"
279
279
  }, he = Symbol("access");
280
- class us {
280
+ class ps {
281
281
  options;
282
282
  data = null;
283
283
  mode = _.Raw;
284
284
  constructor(e) {
285
- this.options = Object.assign({}, ut, e), this.loadData();
285
+ this.options = Object.assign({}, dt, e), this.loadData();
286
286
  }
287
287
  connect(e) {
288
288
  const { mode: t, router: s, request: r } = e;
@@ -290,10 +290,10 @@ class us {
290
290
  }
291
291
  login(e) {
292
292
  const { storageKey: t, storagePrefix: s, session: r, authKey: o } = this.options;
293
- this.data = e, k.save(t, e, {
293
+ this.setData(e), this.data && (k.save(t, e, {
294
294
  type: "local",
295
295
  prefix: s
296
- }), r && T.set(o, e.token);
296
+ }), r && T.set(o, this.data.token));
297
297
  }
298
298
  clear() {
299
299
  const { storageKey: e, storagePrefix: t, session: s, authKey: r } = this.options;
@@ -310,7 +310,7 @@ class us {
310
310
  }
311
311
  can(e) {
312
312
  const { permissions: t = {} } = this.data || {};
313
- return Q(e).every((r) => t[r]);
313
+ return typeof e == "function" ? e(t) : Q(e).every((r) => t[r]);
314
314
  }
315
315
  some(e) {
316
316
  const { permissions: t = {} } = this.data || {};
@@ -335,22 +335,39 @@ class us {
335
335
  const s = t ? `?${t}=${encodeURIComponent(location.href)}` : "";
336
336
  typeof e == "function" ? e(s) : location.href = t ? `${e}${s}` : e;
337
337
  }
338
+ setData(e) {
339
+ const { crypto: t } = this.options;
340
+ if (typeof e == "string")
341
+ try {
342
+ this.data = JSON.parse(
343
+ t ? Ie(e, De(t.toLowerCase())) : e
344
+ );
345
+ } catch (s) {
346
+ console.warn(s);
347
+ }
348
+ else
349
+ this.data = e;
350
+ }
338
351
  loadData() {
339
- const { storageKey: e, storagePrefix: t } = this.options;
340
- this.data = k.get(e, {
352
+ const { storageKey: e, storagePrefix: t } = this.options, s = k.get(e, {
341
353
  type: "local",
342
354
  prefix: t
343
355
  });
356
+ this.setData(s);
344
357
  }
345
358
  isLogined() {
346
359
  const { session: e, authKey: t } = this.options;
347
360
  return e && t ? !!T.get(t) : !!this.data;
348
361
  }
362
+ hasRoutePermission(e) {
363
+ const t = e.params.id;
364
+ return t && this.can(t);
365
+ }
349
366
  setGuard(e) {
350
367
  e.beforeEach((t, s, r) => this.guard(t, r));
351
368
  }
352
369
  guard(e, t) {
353
- if (this.isWhiteList(e) || this.isLogined() || this.isAuthPath(e))
370
+ if (this.isWhiteList(e) || this.isLogined() || this.isAuthPath(e) || this.hasRoutePermission(e))
354
371
  return t();
355
372
  t(!1), this.toLogin();
356
373
  }
@@ -379,11 +396,10 @@ class us {
379
396
  );
380
397
  }
381
398
  }
382
- function ls() {
383
- const n = oe(he, null);
384
- return n || console.warn("access is null"), n;
399
+ function pt() {
400
+ return oe(he, null);
385
401
  }
386
- class lt {
402
+ class ht {
387
403
  __id = null;
388
404
  __mode;
389
405
  __instance = null;
@@ -493,53 +509,53 @@ function N(n) {
493
509
  $components: s,
494
510
  $libs: r,
495
511
  $apis: o
496
- }, c = new lt({
512
+ }, c = new ht({
497
513
  mode: t,
498
514
  dsl: i.value,
499
515
  attrs: u
500
516
  }), p = e.defineComponent({
501
517
  name: i.value.name,
502
518
  props: {
503
- ...dt(i.value.props ?? [], c)
519
+ ...vt(i.value.props ?? [], c)
504
520
  },
505
- setup(f) {
506
- c.$props = f, c.props = f, i.value.id && de(
521
+ setup(l) {
522
+ c.$props = l, c.props = l, i.value.id && de(
507
523
  n.window || window,
508
524
  i.value.id,
509
525
  i.value.css || ""
510
- ), c.state = pt(e, i.value.state ?? {}, c);
511
- const l = ht(e, i.value.computed ?? {}, c), m = mt(i.value.methods ?? {}, c), d = vt(e, i.value.inject, c), h = gt(
526
+ ), c.state = gt(e, i.value.state ?? {}, c);
527
+ const f = yt(e, i.value.computed ?? {}, c), m = _t(i.value.methods ?? {}, c), d = wt(e, i.value.inject, c), h = St(
512
528
  i.value.dataSources || {},
513
529
  c
514
530
  ), w = {
515
531
  ...d,
516
- ...l,
532
+ ...f,
517
533
  ...m,
518
534
  ...h
519
535
  };
520
- return c.setup(w, e), yt(e, i.value.watch ?? [], c), {
536
+ return c.setup(w, e), $t(e, i.value.watch ?? [], c), {
521
537
  vtj: c
522
538
  };
523
539
  },
524
- emits: ft(i.value.emits),
540
+ emits: mt(i.value.emits),
525
541
  expose: ["vtj"],
526
542
  render() {
527
543
  if (!i.value.nodes) return null;
528
- const f = i.value.nodes || [];
529
- return f.length === 1 ? H(f[0], c, e, a) : f.map((l) => H(l, c, e, a));
544
+ const l = i.value.nodes || [];
545
+ return l.length === 1 ? A(l[0], c, e, a) : l.map((f) => A(f, c, e, a));
530
546
  },
531
- ..._t(i.value.lifeCycles ?? {}, c)
547
+ ...jt(i.value.lifeCycles ?? {}, c)
532
548
  });
533
549
  return {
534
550
  renderer: e.markRaw(p),
535
551
  context: c
536
552
  };
537
553
  }
538
- function ft(n = []) {
554
+ function mt(n = []) {
539
555
  return n.map((e) => $(e) ? e : e.name);
540
556
  }
541
- function dt(n = [], e) {
542
- const t = (s) => s ? (Array.isArray(s) ? s : [s]).map((o) => Ke[o]) : void 0;
557
+ function vt(n = [], e) {
558
+ const t = (s) => s ? (Array.isArray(s) ? s : [s]).map((o) => Ye[o]) : void 0;
543
559
  return n.map((s) => $(s) ? {
544
560
  name: s
545
561
  } : {
@@ -556,7 +572,7 @@ function dt(n = [], e) {
556
572
  {}
557
573
  );
558
574
  }
559
- function pt(n, e, t) {
575
+ function gt(n, e, t) {
560
576
  return n.reactive(
561
577
  Object.keys(e || {}).reduce(
562
578
  (s, r) => {
@@ -567,19 +583,19 @@ function pt(n, e, t) {
567
583
  )
568
584
  );
569
585
  }
570
- function ht(n, e, t) {
586
+ function yt(n, e, t) {
571
587
  return Object.entries(e ?? {}).reduce(
572
588
  (s, [r, o]) => (s[r] = n.computed(t.__parseFunction(o)), s),
573
589
  {}
574
590
  );
575
591
  }
576
- function mt(n, e) {
592
+ function _t(n, e) {
577
593
  return Object.entries(n ?? {}).reduce(
578
594
  (t, [s, r]) => (t[s] = e.__parseFunction(r), t),
579
595
  {}
580
596
  );
581
597
  }
582
- function vt(n, e = [], t) {
598
+ function wt(n, e = [], t) {
583
599
  return e.reduce(
584
600
  (s, r) => {
585
601
  const { name: o, from: a } = r || {};
@@ -590,7 +606,7 @@ function vt(n, e = [], t) {
590
606
  {}
591
607
  );
592
608
  }
593
- function gt(n, e) {
609
+ function St(n, e) {
594
610
  return Object.keys(n).reduce(
595
611
  (t, s) => {
596
612
  const r = n[s], o = e.$apis[r.ref], a = M(r.transform) ? r.transform.value ? e.__parseFunction(r.transform) : void 0 : r.transform;
@@ -602,7 +618,7 @@ function gt(n, e) {
602
618
  {}
603
619
  );
604
620
  }
605
- function yt(n, e = [], t) {
621
+ function $t(n, e = [], t) {
606
622
  e.forEach((s) => {
607
623
  n.watch(
608
624
  t.__parseExpression(s.source),
@@ -614,19 +630,19 @@ function yt(n, e = [], t) {
614
630
  );
615
631
  });
616
632
  }
617
- function _t(n, e) {
633
+ function jt(n, e) {
618
634
  return Object.entries(n ?? {}).reduce(
619
635
  (t, [s, r]) => (t[s] = e.__parseFunction(r), t),
620
636
  {}
621
637
  );
622
638
  }
623
639
  let B = [];
624
- const wt = (n) => n;
640
+ const Et = (n) => n;
625
641
  async function me(n, e = window) {
626
642
  const { urls: t = [], library: s } = n, r = t.filter((i) => z(i));
627
643
  if (r.length === 0 || !s) return null;
628
644
  const o = t.filter((i) => V(i));
629
- return o.length && Ze(o, e), await et(r, s, e).catch(
645
+ return o.length && st(o, e), await nt(r, s, e).catch(
630
646
  (i) => (console.warn("loadScriptUrl error", r, s, i), null)
631
647
  );
632
648
  }
@@ -657,41 +673,41 @@ function L(n) {
657
673
  return i || (console.warn("getPlugin result is null", o), null);
658
674
  })) : r;
659
675
  }
660
- function H(n, e, t = O, s = wt) {
676
+ function A(n, e, t = O, s = Et) {
661
677
  if (!n || !n.name || n.invisible) return null;
662
- const { id: r = null, directives: o = [] } = n, { vIf: a, vFor: i, vShow: u, vModels: c, vBind: p } = St(o);
663
- if (a && !$t(a, e))
678
+ const { id: r = null, directives: o = [] } = n, { vIf: a, vFor: i, vShow: u, vModels: c, vBind: p } = Pt(o);
679
+ if (a && !bt(a, e))
664
680
  return null;
665
- const f = (l) => {
666
- const m = l.$components, d = (() => {
681
+ const l = (f) => {
682
+ const m = f.$components, d = (() => {
667
683
  if (n.name === "component")
668
- return jt(l, n.props?.is);
684
+ return Rt(f, n.props?.is);
669
685
  if (n.name === "slot") return n.name;
670
686
  const g = s(n.name, n.from, t);
671
687
  return $(g) ? m[g] ?? g : g;
672
- })(), h = Et(r, n.props ?? {}, l), w = Pt(t, n.events ?? {}, l);
688
+ })(), h = Ct(r, n.props ?? {}, f), w = Ft(t, n.events ?? {}, f);
673
689
  if (n.name === "slot")
674
- return bt(t, n, h, l, s);
675
- p && Object.assign(h, l.__parseExpression(p.value)), u && (h.style = Object.assign(
690
+ return xt(t, n, h, f, s);
691
+ p && Object.assign(h, f.__parseExpression(p.value)), u && (h.style = Object.assign(
676
692
  h.style ?? {},
677
- Ct(u, l)
693
+ Dt(u, f)
678
694
  )), c.forEach((g) => {
679
- Object.assign(h, Ft(t, g, l));
695
+ Object.assign(h, At(t, g, f));
680
696
  });
681
- const v = xt(
697
+ const v = Ot(
682
698
  t,
683
699
  n.children ?? [],
684
- l,
700
+ f,
685
701
  s,
686
702
  n
687
703
  );
688
704
  return t.createVNode(d, { ...h, ...w }, v);
689
705
  };
690
- return i ? Ht(i, f, e) : f(e);
706
+ return i ? kt(i, l, e) : l(e);
691
707
  }
692
- function St(n = []) {
708
+ function Pt(n = []) {
693
709
  const e = n.find((i) => j(i.name) === "vIf"), t = n.find((i) => j(i.name) === "vFor"), s = n.find((i) => j(i.name) === "vShow"), r = n.find((i) => j(i.name) === "vBind"), o = n.filter((i) => j(i.name) === "vModel"), a = n.filter(
694
- (i) => !ze.includes(j(i.name))
710
+ (i) => !Ge.includes(j(i.name))
695
711
  );
696
712
  return {
697
713
  vIf: e,
@@ -702,13 +718,13 @@ function St(n = []) {
702
718
  others: a
703
719
  };
704
720
  }
705
- function $t(n, e) {
721
+ function bt(n, e) {
706
722
  return !!e.__parseExpression(n.value);
707
723
  }
708
- function jt(n, e) {
724
+ function Rt(n, e) {
709
725
  return e ? S(e) ? n.__parseExpression(e) : e : "div";
710
726
  }
711
- function Et(n, e, t) {
727
+ function Ct(n, e, t) {
712
728
  const s = Object.keys(e || {}).reduce(
713
729
  (r, o) => {
714
730
  let a = e[o];
@@ -718,7 +734,7 @@ function Et(n, e, t) {
718
734
  );
719
735
  return s.ref = t.__ref(n, s.ref), s;
720
736
  }
721
- function Pt(n, e, t) {
737
+ function Ft(n, e, t) {
722
738
  const s = ["passive", "capture", "once"], r = {
723
739
  capture: "Capture",
724
740
  once: "Once",
@@ -726,8 +742,8 @@ function Pt(n, e, t) {
726
742
  };
727
743
  return Object.keys(e || {}).reduce(
728
744
  (o, a) => {
729
- const i = e[a], u = ve(i.modifiers), c = u.find((l) => s.includes(l)), p = "on" + xe(a) + (c && r[c] || ""), f = t.__parseFunction(i.handler);
730
- return f && (o[p] = n.withModifiers(f, u)), o;
745
+ const i = e[a], u = ve(i.modifiers), c = u.find((f) => s.includes(f)), p = "on" + Ae(a) + (c && r[c] || ""), l = t.__parseFunction(i.handler);
746
+ return l && (o[p] = n.withModifiers(l, u)), o;
731
747
  },
732
748
  {}
733
749
  );
@@ -736,27 +752,27 @@ function ve(n = {}, e = !1) {
736
752
  const t = Object.keys(n);
737
753
  return e ? t.map((s) => "." + s) : t;
738
754
  }
739
- function bt(n, e, t, s, r) {
740
- const { children: o } = e, a = Rt(e, s), i = s.$slots?.[a.name];
755
+ function xt(n, e, t, s, r) {
756
+ const { children: o } = e, a = It(e, s), i = s.$slots?.[a.name];
741
757
  return i ? i(t) : o ? $(o) ? n.createTextVNode(o) : S(o) ? n.createTextVNode(
742
758
  fe(s.__parseExpression(o))
743
759
  ) : Array.isArray(o) ? o.map(
744
- (u) => H(u, s, n, r)
760
+ (u) => A(u, s, n, r)
745
761
  ) : null : null;
746
762
  }
747
- function Rt(n, e) {
763
+ function It(n, e) {
748
764
  const { props: t } = n, s = t?.name || "default";
749
765
  return {
750
766
  name: S(s) ? e.__parseExpression(s) : s,
751
767
  params: []
752
768
  };
753
769
  }
754
- function Ct(n, e) {
770
+ function Dt(n, e) {
755
771
  return e.__parseExpression(n.value) ? {} : {
756
772
  display: "none"
757
773
  };
758
774
  }
759
- function Ft(n, e, t) {
775
+ function At(n, e, t) {
760
776
  const s = {
761
777
  type: "JSFunction",
762
778
  value: e.value?.value ? `(v) => {
@@ -768,7 +784,7 @@ function Ft(n, e, t) {
768
784
  [`onUpdate:${a}`]: o.length && r ? n.withModifiers(r, o) : r
769
785
  };
770
786
  }
771
- function xt(n, e, t, s, r) {
787
+ function Ot(n, e, t, s, r) {
772
788
  if (!e) return null;
773
789
  if ($(e))
774
790
  return { default: () => e };
@@ -777,19 +793,19 @@ function xt(n, e, t, s, r) {
777
793
  default: () => fe(t.__parseExpression(e))
778
794
  };
779
795
  if (Array.isArray(e) && e.length > 0) {
780
- const o = It(e), a = (i) => !i || !r ? {} : r?.id && Object.keys(i).length ? {
796
+ const o = Ht(e), a = (i) => !i || !r ? {} : r?.id && Object.keys(i).length ? {
781
797
  [`scope_${r.id}`]: i
782
798
  } : {};
783
- return Object.entries(o).reduce((i, [u, { nodes: c, params: p }]) => (i[u] = (f) => {
784
- const l = p.length ? Ie(f ?? {}, p) : a(f);
799
+ return Object.entries(o).reduce((i, [u, { nodes: c, params: p }]) => (i[u] = (l) => {
800
+ const f = p.length ? Oe(l ?? {}, p) : a(l);
785
801
  return c.map(
786
- (m) => H(m, t.__clone(l), n, s)
802
+ (m) => A(m, t.__clone(f), n, s)
787
803
  );
788
804
  }, i), {});
789
805
  }
790
806
  return null;
791
807
  }
792
- function It(n) {
808
+ function Ht(n) {
793
809
  const e = {
794
810
  default: {
795
811
  params: [],
@@ -797,7 +813,7 @@ function It(n) {
797
813
  }
798
814
  };
799
815
  for (const t of n) {
800
- const s = At(t.slot), r = s.name;
816
+ const s = Mt(t.slot), r = s.name;
801
817
  e[r] ? (e[r].nodes.push(t), e[r].params = e[r].params.concat(s.params)) : e[r] = {
802
818
  nodes: [t],
803
819
  params: s.params
@@ -805,103 +821,103 @@ function It(n) {
805
821
  }
806
822
  return e;
807
823
  }
808
- function At(n = "default") {
824
+ function Mt(n = "default") {
809
825
  return $(n) ? { name: n, params: [] } : { params: [], ...n };
810
826
  }
811
- function Ht(n, e, t) {
827
+ function kt(n, e, t) {
812
828
  const { value: s, iterator: r } = n, { item: o = "item", index: a = "index" } = r || {};
813
829
  let i = t.__parseExpression(s) || [];
814
830
  return Number.isInteger(i) && (i = new Array(i).fill(!0).map((u, c) => c + 1)), Array.isArray(i) ? i.map((u, c) => e(t.__clone({ [o]: u, [a]: c }))) : (console.warn("[vForRender]:", `${s?.value} is not a Arrary`), []);
815
831
  }
816
- function Ot(n) {
817
- return Be() ? (Ue(n), !0) : !1;
832
+ function Tt(n) {
833
+ return Le() ? (qe(n), !0) : !1;
818
834
  }
819
835
  function K(n) {
820
- return typeof n == "function" ? n() : Ne(n);
836
+ return typeof n == "function" ? n() : Je(n);
821
837
  }
822
838
  const ge = typeof window < "u" && typeof document < "u";
823
839
  typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
824
- const Dt = (n) => n != null, Mt = () => {
840
+ const Bt = (n) => n != null, Ut = () => {
825
841
  };
826
- function kt(n) {
842
+ function Nt(n) {
827
843
  return ie();
828
844
  }
829
- function Tt(...n) {
845
+ function Lt(...n) {
830
846
  if (n.length !== 1)
831
- return De(...n);
847
+ return Te(...n);
832
848
  const e = n[0];
833
- return typeof e == "function" ? Me(ke(() => ({ get: e, set: Mt }))) : J(e);
849
+ return typeof e == "function" ? Be(Ue(() => ({ get: e, set: Ut }))) : J(e);
834
850
  }
835
- function Bt(n, e) {
836
- kt() && Te(n, e);
851
+ function qt(n, e) {
852
+ Nt() && Ne(n, e);
837
853
  }
838
- const Ut = ge ? window : void 0, Nt = ge ? window.document : void 0;
839
- function Lt(n) {
854
+ const Jt = ge ? window : void 0, Vt = ge ? window.document : void 0;
855
+ function zt(n) {
840
856
  var e;
841
857
  const t = K(n);
842
858
  return (e = t?.$el) != null ? e : t;
843
859
  }
844
- function qt() {
860
+ function Kt() {
845
861
  const n = J(!1), e = ie();
846
- return e && Le(() => {
862
+ return e && Ve(() => {
847
863
  n.value = !0;
848
864
  }, e), n;
849
865
  }
850
- function Jt(n) {
851
- const e = qt();
866
+ function Wt(n) {
867
+ const e = Kt();
852
868
  return ce(() => (e.value, !!n()));
853
869
  }
854
- function Vt(n, e, t = {}) {
855
- const { window: s = Ut, ...r } = t;
870
+ function Gt(n, e, t = {}) {
871
+ const { window: s = Jt, ...r } = t;
856
872
  let o;
857
- const a = Jt(() => s && "MutationObserver" in s), i = () => {
873
+ const a = Wt(() => s && "MutationObserver" in s), i = () => {
858
874
  o && (o.disconnect(), o = void 0);
859
875
  }, u = ce(() => {
860
- const l = K(n), m = (Array.isArray(l) ? l : [l]).map(Lt).filter(Dt);
876
+ const f = K(n), m = (Array.isArray(f) ? f : [f]).map(zt).filter(Bt);
861
877
  return new Set(m);
862
878
  }), c = ae(
863
879
  () => u.value,
864
- (l) => {
865
- i(), a.value && l.size && (o = new MutationObserver(e), l.forEach((m) => o.observe(m, r)));
880
+ (f) => {
881
+ i(), a.value && f.size && (o = new MutationObserver(e), f.forEach((m) => o.observe(m, r)));
866
882
  },
867
883
  { immediate: !0, flush: "post" }
868
- ), p = () => o?.takeRecords(), f = () => {
884
+ ), p = () => o?.takeRecords(), l = () => {
869
885
  c(), i();
870
886
  };
871
- return Ot(f), {
887
+ return Tt(l), {
872
888
  isSupported: a,
873
- stop: f,
889
+ stop: l,
874
890
  takeRecords: p
875
891
  };
876
892
  }
877
- function zt(n = null, e = {}) {
893
+ function Yt(n = null, e = {}) {
878
894
  var t, s, r;
879
895
  const {
880
- document: o = Nt,
881
- restoreOnUnmount: a = (f) => f
882
- } = e, i = (t = o?.title) != null ? t : "", u = Tt((s = n ?? o?.title) != null ? s : null), c = n && typeof n == "function";
883
- function p(f) {
896
+ document: o = Vt,
897
+ restoreOnUnmount: a = (l) => l
898
+ } = e, i = (t = o?.title) != null ? t : "", u = Lt((s = n ?? o?.title) != null ? s : null), c = n && typeof n == "function";
899
+ function p(l) {
884
900
  if (!("titleTemplate" in e))
885
- return f;
886
- const l = e.titleTemplate || "%s";
887
- return typeof l == "function" ? l(f) : K(l).replace(/%s/g, f);
901
+ return l;
902
+ const f = e.titleTemplate || "%s";
903
+ return typeof f == "function" ? f(l) : K(f).replace(/%s/g, l);
888
904
  }
889
905
  return ae(
890
906
  u,
891
- (f, l) => {
892
- f !== l && o && (o.title = p(typeof f == "string" ? f : ""));
907
+ (l, f) => {
908
+ l !== f && o && (o.title = p(typeof l == "string" ? l : ""));
893
909
  },
894
910
  { immediate: !0 }
895
- ), e.observe && !e.titleTemplate && o && !c && Vt(
911
+ ), e.observe && !e.titleTemplate && o && !c && Gt(
896
912
  (r = o.head) == null ? void 0 : r.querySelector("title"),
897
913
  () => {
898
914
  o && o.title !== u.value && (u.value = p(o.title));
899
915
  },
900
916
  { childList: !0 }
901
- ), Bt(() => {
917
+ ), qt(() => {
902
918
  if (a) {
903
- const f = a(i, u.value || "");
904
- f != null && o && (o.title = f);
919
+ const l = a(i, u.value || "");
920
+ l != null && o && (o.title = l);
905
921
  }
906
922
  }), u;
907
923
  }
@@ -909,7 +925,7 @@ const se = ue({
909
925
  name: "VtjPageContainer",
910
926
  async setup() {
911
927
  const n = _e(), e = le(), t = e.params.id, s = t ? n.getPage(t) : n.getHomepage(), r = s ? await n.getRenderComponent(s.id) : null;
912
- return s && zt(s.title || "VTJ"), {
928
+ return s && Yt(s.title || "VTJ"), {
913
929
  provider: n,
914
930
  component: r,
915
931
  file: s,
@@ -919,14 +935,14 @@ const se = ue({
919
935
  render() {
920
936
  return this.component ? U(this.component, this.query) : U("div", "页面不存在");
921
937
  }
922
- }), Kt = ue({
938
+ }), Qt = ue({
923
939
  name: "VtjStartupContainer",
924
940
  render() {
925
- return U(Ve);
941
+ return U(We);
926
942
  }
927
943
  }), ye = Symbol("Provider");
928
- var Wt = /* @__PURE__ */ ((n) => (n.Production = "production", n.Development = "development", n))(Wt || {});
929
- class Gt extends Se {
944
+ var Xt = /* @__PURE__ */ ((n) => (n.Production = "production", n.Development = "development", n))(Xt || {});
945
+ class Zt extends $e {
930
946
  constructor(e) {
931
947
  super(), this.options = e;
932
948
  const {
@@ -939,18 +955,18 @@ class Gt extends Se {
939
955
  globals: u = {},
940
956
  modules: c = {},
941
957
  router: p = null,
942
- materialPath: f = "./",
943
- nodeEnv: l = "development"
958
+ materialPath: l = "./",
959
+ nodeEnv: f = "development"
944
960
  /* Development */
945
961
  } = e;
946
- this.mode = s, this.modules = c, this.service = t, this.router = p, this.materialPath = f, this.nodeEnv = l, r && (this.dependencies = r), o && (this.materials = o), Object.assign(this.globals, u), Object.assign(this.adapter, i);
962
+ this.mode = s, this.modules = c, this.service = t, this.router = p, this.materialPath = l, this.nodeEnv = f, r && (this.dependencies = r), o && (this.materials = o), Object.assign(this.globals, u), Object.assign(this.adapter, i);
947
963
  const { access: m, request: d } = this.adapter;
948
964
  m && m.connect({ mode: s, router: p, request: d }), s !== _.Design && this.load(a);
949
965
  }
950
966
  mode;
951
967
  globals = {};
952
968
  modules = {};
953
- adapter = { request: nt, jsonp: Ae };
969
+ adapter = { request: it, jsonp: He };
954
970
  apis = {};
955
971
  dependencies = {};
956
972
  materials = {};
@@ -967,7 +983,7 @@ class Gt extends Se {
967
983
  if (this.project = t ? await t() : await this.service.init(e), !this.project)
968
984
  throw new Error("project is null");
969
985
  const { apis: s = [], meta: r = [] } = this.project, o = window;
970
- o.CKEDITOR_VERSION = void 0, this.nodeEnv !== "production" ? await this.loadAssets(o) : await this.loadDependencies(o), this.apis = it(s, r, this.adapter), pe(), this.project.config?.mock && at(s), this.initRouter(), this.triggerReady();
986
+ o.CKEDITOR_VERSION = void 0, this.nodeEnv !== "production" ? await this.loadAssets(o) : await this.loadDependencies(o), this.apis = ut(s, r, this.adapter), pe(), this.project.config?.mock && lt(s), this.initRouter(), this.triggerReady();
971
987
  }
972
988
  async loadDependencies(e) {
973
989
  const t = Object.entries(this.dependencies);
@@ -979,9 +995,9 @@ class Gt extends Se {
979
995
  libraryExports: u,
980
996
  libraryMap: c,
981
997
  materials: p,
982
- materialExports: f,
983
- materialMapLibrary: l
984
- } = Ye(
998
+ materialExports: l,
999
+ materialMapLibrary: f
1000
+ } = Ze(
985
1001
  t,
986
1002
  a,
987
1003
  i === "development"
@@ -996,15 +1012,15 @@ class Gt extends Se {
996
1012
  else {
997
1013
  const v = c[d] || [];
998
1014
  for (const g of v)
999
- V(g) && await Xe(d, b.append(g, { v: R })), z(g) && await X(b.append(g, { v: R }));
1015
+ V(g) && await tt(d, b.append(g, { v: R })), z(g) && await X(b.append(g, { v: R }));
1000
1016
  r[d] = e[d];
1001
1017
  }
1002
1018
  }
1003
1019
  for (const d of p)
1004
1020
  await X(b.append(d, { v: R }));
1005
1021
  const m = this.materials || {};
1006
- for (const d of f) {
1007
- const h = e[l[d]], w = $e[d];
1022
+ for (const d of l) {
1023
+ const h = e[f[d]], w = je[d];
1008
1024
  if (w)
1009
1025
  h && w.forEach((v) => {
1010
1026
  o[v] = h[v];
@@ -1012,7 +1028,7 @@ class Gt extends Se {
1012
1028
  else {
1013
1029
  const v = m[d] ? (await m[d]()).default : e[d];
1014
1030
  v && h && (v.components || []).forEach((g) => {
1015
- o[g.name] = Qe(g, h);
1031
+ o[g.name] = et(g, h);
1016
1032
  });
1017
1033
  }
1018
1034
  }
@@ -1026,13 +1042,13 @@ class Gt extends Se {
1026
1042
  }), e.addRoute({
1027
1043
  path: "/",
1028
1044
  name: "VtjHomepage",
1029
- component: t?.homepage ? se : Kt
1045
+ component: t?.homepage ? se : Qt
1030
1046
  }));
1031
1047
  }
1032
1048
  install(e) {
1033
1049
  const t = e.config.globalProperties.installed || {};
1034
1050
  for (const [s, r] of Object.entries(this.library))
1035
- !t[s] && tt(r) && (e.use(r), t[s] = !0);
1051
+ !t[s] && rt(r) && (e.use(r), t[s] = !0);
1036
1052
  this.options.install && e.use(this.options.install), this.adapter.access && e.use(this.adapter.access), e.provide(ye, this), e.config.globalProperties.installed = t, this.nodeEnv === "development" && (e.config.errorHandler = (s, r, o) => {
1037
1053
  const a = r?.$options.name, i = typeof s == "string" ? s : s?.message || s?.msg || "未知错误", u = `[ ${a} ] ${i} ${o}`;
1038
1054
  console.error(
@@ -1043,8 +1059,8 @@ class Gt extends Se {
1043
1059
  info: o
1044
1060
  },
1045
1061
  s?.stack
1046
- ), D.error({
1047
- title: "运行时错误:请在控制台查看详情",
1062
+ ), H.error({
1063
+ title: "未处理的异常:请在控制台查看详情",
1048
1064
  message: u
1049
1065
  });
1050
1066
  });
@@ -1109,12 +1125,12 @@ class Gt extends Se {
1109
1125
  async getRenderComponent(e) {
1110
1126
  const t = this.getFile(e);
1111
1127
  if (!t)
1112
- return A.warn(`Can not find file: ${e}`), null;
1128
+ return D.warn(`Can not find file: ${e}`), null;
1113
1129
  const s = `.vtj/vue/${e}.vue`, r = this.modules[s];
1114
1130
  if (r)
1115
1131
  return (await r())?.default;
1116
1132
  const o = await this.getDsl(t.id);
1117
- return o ? this.createDslRenderer(o).renderer : (A.warn(`Can not find dsl: ${e}`), null);
1133
+ return o ? this.createDslRenderer(o).renderer : (D.warn(`Can not find dsl: ${e}`), null);
1118
1134
  }
1119
1135
  defineUrlSchemaComponent(e, t) {
1120
1136
  return Z(async () => {
@@ -1126,8 +1142,8 @@ class Gt extends Se {
1126
1142
  return Z(async () => await me(e, window));
1127
1143
  }
1128
1144
  }
1129
- function fs(n) {
1130
- const e = new Gt(n);
1145
+ function hs(n) {
1146
+ const e = new Zt(n);
1131
1147
  return {
1132
1148
  provider: e,
1133
1149
  onReady: (s) => e.ready(s)
@@ -1141,7 +1157,7 @@ function _e(n = {}) {
1141
1157
  const { id: t, version: s } = n;
1142
1158
  t && s && (async () => {
1143
1159
  const r = await e.getDsl(t);
1144
- r?.__VERSION__ !== s && D.warning({
1160
+ r?.__VERSION__ !== s && H.warning({
1145
1161
  title: r?.name,
1146
1162
  message: "当前组件源码版本与运行时版本不一致,请重新发布组件"
1147
1163
  });
@@ -1149,7 +1165,7 @@ function _e(n = {}) {
1149
1165
  }
1150
1166
  return e;
1151
1167
  }
1152
- const W = new He({
1168
+ const W = new Me({
1153
1169
  settings: {
1154
1170
  type: "json",
1155
1171
  validSuccess: !0,
@@ -1157,12 +1173,12 @@ const W = new He({
1157
1173
  failMessage: !0,
1158
1174
  validate: (n) => n.data?.code === 0,
1159
1175
  showError: (n) => {
1160
- D.error({
1176
+ H.error({
1161
1177
  message: n || "未知错误"
1162
1178
  });
1163
1179
  }
1164
1180
  }
1165
- }), Yt = (n = "/__vtj__/api/:type.json") => (e, t) => W.send({
1181
+ }), es = (n = "/__vtj__/api/:type.json") => (e, t) => W.send({
1166
1182
  url: n,
1167
1183
  method: "post",
1168
1184
  params: { type: e },
@@ -1170,7 +1186,7 @@ const W = new He({
1170
1186
  type: e,
1171
1187
  data: t
1172
1188
  }
1173
- }), Qt = (n = "/__vtj__/api/uploader.json") => async (e, t) => await W.send({
1189
+ }), ts = (n = "/__vtj__/api/uploader.json") => async (e, t) => await W.send({
1174
1190
  url: n,
1175
1191
  method: "post",
1176
1192
  data: {
@@ -1186,7 +1202,7 @@ class G {
1186
1202
  pluginCaches = {};
1187
1203
  uploader;
1188
1204
  constructor() {
1189
- this.api = Yt(), this.uploader = Qt();
1205
+ this.api = es(), this.uploader = ts();
1190
1206
  }
1191
1207
  async getExtension() {
1192
1208
  console.log("BaseService.getExtension");
@@ -1259,7 +1275,7 @@ class G {
1259
1275
  return await this.api("clearStaticFiles", e).catch(() => "");
1260
1276
  }
1261
1277
  async getPluginMaterial(e) {
1262
- const { urls: t = [] } = e, s = t.filter((o) => We(o))[0];
1278
+ const { urls: t = [] } = e, s = t.filter((o) => Qe(o))[0];
1263
1279
  if (!s) return null;
1264
1280
  const r = this.pluginCaches[s];
1265
1281
  return r || (this.pluginCaches[s] = W.send({
@@ -1272,12 +1288,12 @@ class G {
1272
1288
  }).then((o) => o.data).catch(() => null));
1273
1289
  }
1274
1290
  }
1275
- const y = new Oe({
1291
+ const y = new ke({
1276
1292
  type: "local",
1277
1293
  expired: 0,
1278
1294
  prefix: "__VTJ_"
1279
1295
  });
1280
- class ds extends G {
1296
+ class ms extends G {
1281
1297
  init(e) {
1282
1298
  const t = new I(e), s = y.get(`project_${t.id}`), r = Object.assign(t.toDsl(), s || {});
1283
1299
  return y.save(`project_${t.id}`, r), Promise.resolve(r);
@@ -1327,7 +1343,7 @@ class ds extends G {
1327
1343
  }), Promise.resolve(!0);
1328
1344
  }
1329
1345
  }
1330
- class Xt extends G {
1346
+ class ss extends G {
1331
1347
  projects = {};
1332
1348
  materials = {};
1333
1349
  files = {};
@@ -1385,10 +1401,10 @@ class Xt extends G {
1385
1401
  }
1386
1402
  }
1387
1403
  let x = null;
1388
- function ps() {
1389
- return x || (x = new Xt(), x);
1404
+ function vs() {
1405
+ return x || (x = new ss(), x);
1390
1406
  }
1391
- class hs extends G {
1407
+ class gs extends G {
1392
1408
  getFileCaches = {};
1393
1409
  async getExtension() {
1394
1410
  return await this.api("getExtension", {}).catch(() => {
@@ -1456,82 +1472,93 @@ function we(n = []) {
1456
1472
  };
1457
1473
  });
1458
1474
  }
1459
- function ms() {
1460
- const n = _e(), e = le(), t = J(!1), s = n.project;
1461
- qe(() => {
1462
- const { name: a, params: i, meta: u } = e;
1463
- if (a === "VtjPage") {
1464
- const c = n.getPage(i.id);
1465
- t.value = !c?.mask;
1466
- } else if (a === "VtjHomepage") {
1467
- const c = n.getHomepage();
1468
- t.value = !c?.mask;
1475
+ function Se(n, e) {
1476
+ if (!e) return n;
1477
+ let t = [];
1478
+ for (const s of n)
1479
+ if (s.children && s.children.length) {
1480
+ const r = Se(s.children, e);
1481
+ r.length && (s.children = r, t.push(s));
1482
+ } else
1483
+ e[s.id] && t.push(s);
1484
+ return t;
1485
+ }
1486
+ function ys() {
1487
+ const n = _e(), e = le(), t = pt(), s = J(!1), r = t?.getData(), o = n.project;
1488
+ ze(() => {
1489
+ const { name: u, params: c, meta: p } = e;
1490
+ if (u === "VtjPage") {
1491
+ const l = n.getPage(c.id);
1492
+ s.value = !l?.mask;
1493
+ } else if (u === "VtjHomepage") {
1494
+ const l = n.getHomepage();
1495
+ s.value = !l?.mask;
1469
1496
  } else
1470
- t.value = !u.mask;
1497
+ s.value = !p.mask;
1471
1498
  });
1472
- const r = we(s?.pages), o = s?.config;
1499
+ const a = we(o?.pages), i = o?.config;
1473
1500
  return {
1474
- disabled: t,
1475
- logo: o?.logo,
1476
- themeSwitchable: o?.themeSwitchable,
1477
- title: o?.title || s?.description || s?.name || "VTJ App",
1478
- menus: r
1501
+ disabled: s,
1502
+ logo: i?.logo,
1503
+ themeSwitchable: i?.themeSwitchable,
1504
+ title: i?.title || o?.description || o?.name || "VTJ App",
1505
+ menus: Se(a, r?.permissions)
1479
1506
  };
1480
1507
  }
1481
1508
  export {
1482
1509
  he as ACCESS_KEY,
1483
- us as Access,
1484
- ze as BUILT_IN_DIRECTIVES,
1510
+ ps as Access,
1511
+ Ge as BUILT_IN_DIRECTIVES,
1485
1512
  G as BaseService,
1486
1513
  ee as CONTEXT_HOST,
1487
- lt as Context,
1514
+ ht as Context,
1488
1515
  _ as ContextMode,
1489
- Ke as DATA_TYPES,
1490
- cs as JSCodeToString,
1491
- os as LIFE_CYCLES_LIST,
1492
- hs as LocalService,
1493
- Xt as MemoryService,
1494
- Wt as NodeEnv,
1495
- Gt as Provider,
1496
- ds as StorageService,
1516
+ Ye as DATA_TYPES,
1517
+ ds as JSCodeToString,
1518
+ us as LIFE_CYCLES_LIST,
1519
+ gs as LocalService,
1520
+ ss as MemoryService,
1521
+ Xt as NodeEnv,
1522
+ Zt as Provider,
1523
+ ms as StorageService,
1497
1524
  R as VTJ_RENDERER_VERSION,
1498
1525
  de as adoptedStyleSheets,
1499
- is as createAssetScripts,
1500
- as as createAssetsCss,
1501
- gt as createDataSources,
1526
+ ls as createAssetScripts,
1527
+ fs as createAssetsCss,
1528
+ St as createDataSources,
1502
1529
  L as createLoader,
1503
- ps as createMemoryService,
1504
- ot as createMetaApi,
1505
- fs as createProvider,
1530
+ vs as createMemoryService,
1531
+ ct as createMetaApi,
1532
+ hs as createProvider,
1506
1533
  N as createRenderer,
1507
- rt as createSchemaApi,
1508
- it as createSchemaApis,
1509
- wt as defaultLoader,
1534
+ at as createSchemaApi,
1535
+ ut as createSchemaApis,
1536
+ Et as defaultLoader,
1510
1537
  F as fillBasePath,
1511
1538
  ve as getModifiers,
1512
1539
  me as getPlugin,
1513
- Qe as getRawComponent,
1540
+ et as getRawComponent,
1514
1541
  V as isCSSUrl,
1515
- st as isJSCode,
1542
+ ot as isJSCode,
1516
1543
  S as isJSExpression,
1517
1544
  M as isJSFunction,
1518
- We as isJSON,
1545
+ Qe as isJSON,
1519
1546
  z as isJSUrl,
1520
- tt as isVuePlugin,
1521
- Xe as loadCss,
1522
- Ze as loadCssUrl,
1523
- et as loadScriptUrl,
1524
- ct as mockApi,
1525
- at as mockApis,
1547
+ rt as isVuePlugin,
1548
+ tt as loadCss,
1549
+ st as loadCssUrl,
1550
+ nt as loadScriptUrl,
1551
+ ft as mockApi,
1552
+ lt as mockApis,
1526
1553
  pe as mockCleanup,
1527
- H as nodeRender,
1528
- Ye as parseDeps,
1554
+ A as nodeRender,
1555
+ Ze as parseDeps,
1529
1556
  C as parseExpression,
1530
1557
  te as parseFunction,
1531
1558
  ye as providerKey,
1532
- Ge as removeProdFlag,
1559
+ Xe as removeProdFlag,
1533
1560
  fe as toString,
1534
- ls as useAccess,
1535
- ms as useMask,
1561
+ pt as useAccess,
1562
+ ys as useMask,
1536
1563
  _e as useProvider
1537
1564
  };