@vtj/renderer 0.9.0-alpha.1 → 0.9.0-alpha.11

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
1
  import { Base as xe, BUILT_IN_COMPONENTS as Re, ProjectModel as A, HistoryModel as ce } from "@vtj/core";
2
- import { isUrl as ke, url as x, dedupArray as Ce, isString as j, isFunction as ee, logger as I, createRequest as Fe, merge as Ae, pathToRegexp as Ie, pathToRegexpMatch as Oe, formDataToJson as De, storage as B, cookie as U, toArray as te, unRSA as se, delay as le, camelCase as $, upperFirst as Me, pick as Te, jsonp as He, loadScript as ne, Request as Be, Storage as Ue, mapToObject as z } from "@vtj/utils";
3
- import * as M from "vue";
4
- import { inject as ue, toRef as Ne, readonly as Le, customRef as qe, ref as O, unref as Je, getCurrentInstance as de, onBeforeUnmount as Ve, getCurrentScope as ze, onScopeDispose as Ke, watch as pe, onMounted as We, computed as fe, defineComponent as K, h as q, openBlock as Ge, createElementBlock as Ye, createElementVNode as b, toDisplayString as N, defineAsyncComponent as re, watchEffect as Qe } from "vue";
5
- import { ElLoading as Xe, ElNotification as T } from "element-plus";
2
+ import { isUrl as ke, url as x, dedupArray as Ce, isString as j, isFunction as ee, logger as I, createRequest as Fe, merge as Ae, pathToRegexp as Ie, pathToRegexpMatch as Oe, formDataToJson as Me, storage as B, cookie as U, toArray as te, unRSA as ne, delay as le, camelCase as $, upperFirst as Te, pick as De, jsonp as He, loadScript as se, Request as Be, Storage as Ue, mapToObject as z } from "@vtj/utils";
3
+ import * as T from "vue";
4
+ import { inject as ue, toRef as Ne, readonly as Le, customRef as qe, ref as O, onBeforeUnmount as Je, getCurrentScope as Ve, onScopeDispose as ze, unref as Ke, getCurrentInstance as de, watch as pe, computed as fe, onMounted as We, defineComponent as K, h as q, openBlock as Ge, createElementBlock as Ye, createElementVNode as b, toDisplayString as N, defineAsyncComponent as re, watchEffect as Qe } from "vue";
5
+ import { ElNotification as D, ElLoading as Xe } from "element-plus";
6
6
  import { useRoute as he } from "vue-router";
7
7
  /**!
8
8
  * Copyright (c) 2024, VTJ.PRO All rights reserved.
9
9
  * @name @vtj/renderer
10
10
  * @author CHC chenhuachun1549@dingtalk.com
11
- * @version 0.9.0-alpha.1
11
+ * @version 0.9.0-alpha.11
12
12
  * @license <a href="https://vtj.pro/license.html">MIT License</a>
13
13
  */
14
- const R = "0.9.0-alpha.1";
15
- var _ = /* @__PURE__ */ ((n) => (n.Runtime = "Runtime", n.Design = "Design", n.Raw = "Raw", n.VNode = "VNode", n))(_ || {});
14
+ const R = "0.9.0-alpha.11";
15
+ var _ = /* @__PURE__ */ ((s) => (s.Runtime = "Runtime", s.Design = "Design", s.Raw = "Raw", s.VNode = "VNode", s))(_ || {});
16
16
  const oe = [
17
17
  "$el",
18
18
  "$emit",
@@ -25,7 +25,7 @@ const oe = [
25
25
  "$props",
26
26
  "$options",
27
27
  "$forceUpdate"
28
- ], _s = [
28
+ ], wn = [
29
29
  "beforeCreate",
30
30
  "created",
31
31
  "beforeMount",
@@ -48,38 +48,38 @@ const oe = [
48
48
  Function,
49
49
  Date
50
50
  }, W = "VtjPage", me = "VtjHomepage";
51
- function C(n, e) {
52
- return n.map((t) => ke(t) || t.startsWith("/") ? t : `${e}${t}`);
51
+ function C(s, e) {
52
+ return s.map((t) => ke(t) || t.startsWith("/") ? t : `${e}${t}`);
53
53
  }
54
- function G(n) {
55
- return /\.css$/.test(n);
54
+ function G(s) {
55
+ return /\.css$/.test(s);
56
56
  }
57
- function Y(n) {
58
- return /\.js$/.test(n);
57
+ function Y(s) {
58
+ return /\.js$/.test(s);
59
59
  }
60
- function tt(n) {
61
- return /\.json$/.test(n);
60
+ function tt(s) {
61
+ return /\.json$/.test(s);
62
62
  }
63
- function ws(n) {
64
- return n.map(
63
+ function Sn(s) {
64
+ return s.map(
65
65
  (e) => `<script src="${x.append(e, { v: R })}"><\/script>`
66
66
  ).join("");
67
67
  }
68
- function Ss(n = []) {
69
- return n.map(
68
+ function jn(s = []) {
69
+ return s.map(
70
70
  (e) => `<link rel="stylesheet" href="${x.append(e, { v: R })}" />`
71
71
  ).join("");
72
72
  }
73
- function st(n, e = !1) {
74
- return e && n.endsWith(".prod.js") ? n.replace(".prod.js", ".js") : n;
73
+ function nt(s, e = !1) {
74
+ return e && s.endsWith(".prod.js") ? s.replace(".prod.js", ".js") : s;
75
75
  }
76
- function nt(n, e, t = !1) {
77
- const s = n.filter((u) => !!u.enabled), r = [], o = [], a = [], i = [], c = {}, l = {}, f = [], d = {};
78
- return s.forEach(
79
- ({ urls: u, assetsUrl: m, library: p, assetsLibrary: h, localeLibrary: w }) => {
76
+ function st(s, e, t = !1) {
77
+ const n = s.filter((u) => !!u.enabled), r = [], o = [], a = [], i = [], l = {}, c = {}, f = [], d = {};
78
+ return n.forEach(
79
+ ({ urls: u, assetsUrl: h, library: p, assetsLibrary: m, localeLibrary: w }) => {
80
80
  u?.forEach((g) => {
81
- Y(g) && r.push(st(g, t)), G(g) && o.push(g);
82
- }), p && (i.push(p), c[p] = C(u || [], e), w && (l[p] = w)), m && a.push(m), h && f.push(h), p && h && (d[h] = p);
81
+ Y(g) && r.push(nt(g, t)), G(g) && o.push(g);
82
+ }), p && (i.push(p), l[p] = C(u || [], e), w && (c[p] = w)), h && a.push(h), m && f.push(m), p && m && (d[m] = p);
83
83
  }
84
84
  ), {
85
85
  scripts: C(r, e),
@@ -88,97 +88,97 @@ function nt(n, e, t = !1) {
88
88
  libraryExports: i,
89
89
  materialExports: Ce(f),
90
90
  materialMapLibrary: d,
91
- libraryMap: c,
92
- libraryLocaleMap: l
91
+ libraryMap: l,
92
+ libraryLocaleMap: c
93
93
  };
94
94
  }
95
- function rt(n, e) {
96
- const { name: t, parent: s, alias: r } = n;
97
- return s ? e[s]?.[r || t] : e[r || t];
95
+ function rt(s, e) {
96
+ const { name: t, parent: n, alias: r } = s;
97
+ return n ? e[n]?.[r || t] : e[r || t];
98
98
  }
99
- function ge(n) {
100
- return j(n) ? n : JSON.stringify(n);
99
+ function ge(s) {
100
+ return j(s) ? s : JSON.stringify(s);
101
101
  }
102
- function ve(n, e, t) {
103
- const s = n.CSSStyleSheet;
104
- if (s.prototype.replaceSync) {
105
- const r = new s();
102
+ function ve(s, e, t) {
103
+ const n = s.CSSStyleSheet;
104
+ if (n.prototype.replaceSync) {
105
+ const r = new n();
106
106
  r.id = e, r.replaceSync(t);
107
- const o = n.document, a = o.adoptedStyleSheets, i = Array.from(a).filter(
108
- (c) => c.id !== e
107
+ const o = s.document, a = o.adoptedStyleSheets, i = Array.from(a).filter(
108
+ (l) => l.id !== e
109
109
  );
110
110
  o.adoptedStyleSheets = [...i, r];
111
111
  } else {
112
- const r = n.document;
112
+ const r = s.document;
113
113
  let o = r.getElementById(e);
114
114
  o ? o.innerHTML = t : (o = r.createElement("style"), o.id = e, o.innerHTML = t, r.head.appendChild(o));
115
115
  }
116
116
  }
117
- async function ot(n, e) {
118
- const t = await window.fetch(e).then((s) => s.text()).catch(() => "");
119
- t && ve(window, n, t);
117
+ async function ot(s, e) {
118
+ const t = await window.fetch(e).then((n) => n.text()).catch(() => "");
119
+ t && ve(window, s, t);
120
120
  }
121
- function it(n, e = window) {
122
- const t = e.document, s = e.document.head;
123
- for (const r of n)
121
+ function it(s, e = window) {
122
+ const t = e.document, n = e.document.head;
123
+ for (const r of s)
124
124
  if (!t.getElementById(r)) {
125
125
  const a = t.createElement("link");
126
- a.rel = "stylesheet", a.id = r, a.href = r, s.appendChild(a);
126
+ a.rel = "stylesheet", a.id = r, a.href = r, n.appendChild(a);
127
127
  }
128
128
  }
129
- async function at(n, e, t = window) {
130
- const s = t.document, r = t.document.head;
129
+ async function at(s, e, t = window) {
130
+ const n = t.document, r = t.document.head;
131
131
  let o = t[e];
132
132
  return o ? o.default || o : new Promise((a, i) => {
133
- for (const c of n) {
134
- const l = s.createElement("script");
135
- l.src = c, l.onload = () => {
133
+ for (const l of s) {
134
+ const c = n.createElement("script");
135
+ c.src = l, c.onload = () => {
136
136
  o = t[e], o ? a(o.default || o) : i(null);
137
- }, l.onerror = (f) => {
137
+ }, c.onerror = (f) => {
138
138
  i(f);
139
- }, r.appendChild(l);
139
+ }, r.appendChild(c);
140
140
  }
141
141
  });
142
142
  }
143
- function ct(n) {
144
- return ee(n) || ee(n?.install);
143
+ function ct(s) {
144
+ return ee(s) || ee(s?.install);
145
145
  }
146
- function k(n, e, t = !1, s = !1) {
146
+ function k(s, e, t = !1, n = !1) {
147
147
  try {
148
148
  const r = ['"use strict";', "var __self = arguments[0];"];
149
149
  r.push("return ");
150
- let o = (n.value || "").trim();
151
- o = o.replace(/this(\W|$)/g, (i, c) => `__self${c}`), o = r.join(`
150
+ let o = (s.value || "").trim();
151
+ o = o.replace(/this(\W|$)/g, (i, l) => `__self${l}`), o = r.join(`
152
152
  `) + o;
153
153
  const a = `with(${t ? "{}" : "$scope || {}"}) { ${o} }`;
154
154
  return new Function("$scope", a)(e);
155
155
  } catch (r) {
156
- if (I.error("parseExpression.error", r, n, e?.__self ?? e), s)
156
+ if (I.error("parseExpression.error", r, s, e?.__self ?? e), n)
157
157
  throw r;
158
158
  }
159
159
  }
160
- function ie(n, e, t = !1, s = !1) {
161
- const r = k(n, e, t, s);
160
+ function ie(s, e, t = !1, n = !1) {
161
+ const r = k(s, e, t, n);
162
162
  if (typeof r != "function" && (I.error(
163
163
  "parseFunction.error",
164
164
  "not a function",
165
- n,
165
+ s,
166
166
  e?.__self ?? e
167
- ), s))
168
- throw new Error(`"${n.value}" not a function`);
167
+ ), n))
168
+ throw new Error(`"${s.value}" not a function`);
169
169
  return r;
170
170
  }
171
- function S(n) {
172
- return n && n.type === "JSExpression";
171
+ function S(s) {
172
+ return s && s.type === "JSExpression";
173
173
  }
174
- function H(n) {
175
- return typeof n == "object" && n && n.type === "JSFunction";
174
+ function H(s) {
175
+ return typeof s == "object" && s && s.type === "JSFunction";
176
176
  }
177
- function lt(n) {
178
- return S(n) || H(n);
177
+ function lt(s) {
178
+ return S(s) || H(s);
179
179
  }
180
- function js(n) {
181
- return lt(n) ? n.value : JSON.stringify(n);
180
+ function $n(s) {
181
+ return lt(s) ? s.value : JSON.stringify(s);
182
182
  }
183
183
  let E = null;
184
184
  const ut = Fe({
@@ -187,11 +187,11 @@ const ut = Fe({
187
187
  validSuccess: !0,
188
188
  originResponse: !1,
189
189
  loading: !0,
190
- validate: (n) => n.data?.code === 0 || !!n.data?.success,
190
+ validate: (s) => s.data?.code === 0 || !!s.data?.success,
191
191
  failMessage: !0,
192
- showError: (n) => {
193
- T.error({
194
- message: n || "未知错误"
192
+ showError: (s) => {
193
+ D.error({
194
+ message: s || "未知错误"
195
195
  });
196
196
  },
197
197
  showLoading: () => {
@@ -207,58 +207,58 @@ const ut = Fe({
207
207
  }
208
208
  });
209
209
  let P;
210
- function dt(n, e) {
211
- const { jsonp: t, request: s } = e;
212
- if (n.method === "jsonp")
213
- return (r = {}) => t(n.url, {
214
- ...n.jsonpOptions,
210
+ function dt(s, e) {
211
+ const { jsonp: t, request: n } = e;
212
+ if (s.method === "jsonp")
213
+ return (r = {}) => t(s.url, {
214
+ ...s.jsonpOptions,
215
215
  query: r
216
216
  });
217
217
  {
218
- const r = n.headers ? k(n.headers, {}, !0) : void 0, o = {
219
- url: n.url,
220
- method: n.method,
218
+ const r = s.headers ? k(s.headers, {}, !0) : void 0, o = {
219
+ url: s.url,
220
+ method: s.method,
221
221
  settings: {
222
- ...n.settings,
222
+ ...s.settings,
223
223
  headers: r
224
224
  }
225
225
  };
226
- return (a, i) => (delete o.data, s.send(Ae(o, i || {}, { data: a })));
226
+ return (a, i) => (delete o.data, n.send(Ae(o, i || {}, { data: a })));
227
227
  }
228
228
  }
229
- function pt(n, e) {
229
+ function pt(s, e) {
230
230
  const { metaQuery: t } = e;
231
231
  if (!t) return;
232
- const { code: s, queryCode: r } = n;
232
+ const { code: n, queryCode: r } = s;
233
233
  return (o, a) => {
234
234
  if (!t) {
235
235
  console.warn("adapter.metaQuery is not defined!");
236
236
  return;
237
237
  }
238
- return t(s, r, o, a);
238
+ return t(n, r, o, a);
239
239
  };
240
240
  }
241
- function ft(n = [], e = [], t) {
242
- const s = {};
243
- for (const r of n)
244
- s[r.id] = dt(r, t);
241
+ function ft(s = [], e = [], t) {
242
+ const n = {};
243
+ for (const r of s)
244
+ n[r.id] = dt(r, t);
245
245
  for (const r of e)
246
- s[r.id] = pt(r, t);
247
- return s;
246
+ n[r.id] = pt(r, t);
247
+ return n;
248
248
  }
249
- async function ht(n = []) {
249
+ async function ht(s = []) {
250
250
  P = await import("mockjs").then((e) => e.default || e), P && (P.setup({
251
251
  timeout: "50-500"
252
- }), ye(), n.forEach((e) => mt(P, e)));
252
+ }), ye(), s.forEach((e) => mt(P, e)));
253
253
  }
254
- function mt(n, e) {
254
+ function mt(s, e) {
255
255
  if (!e.mock) return;
256
- const { url: t, mockTemplate: s } = e;
257
- if (t && s) {
258
- const r = Ie(`${t}(.*)`), o = Oe(t, { decode: decodeURIComponent }), a = k(s, {}, !0);
259
- n.mock(r, (i) => {
260
- const c = x.parse(i.url) || {}, l = i.body instanceof FormData ? De(i.body) : i.body, f = o(i.url)?.params;
261
- return Object.assign(i, { data: l, params: c, query: f }), n.mock(a(i));
256
+ const { url: t, mockTemplate: n } = e;
257
+ if (t && n) {
258
+ const r = Ie(`${t}(.*)`), o = Oe(t, { decode: decodeURIComponent }), a = k(n, {}, !0);
259
+ s.mock(r, (i) => {
260
+ const l = x.parse(i.url) || {}, c = i.body instanceof FormData ? Me(i.body) : i.body, f = o(i.url)?.params;
261
+ return Object.assign(i, { data: c, params: l, query: f }), s.mock(a(i));
262
262
  });
263
263
  }
264
264
  }
@@ -275,9 +275,10 @@ const gt = {
275
275
  redirectParam: "r",
276
276
  unauthorizedCode: 401,
277
277
  unauthorizedMessage: "登录已经失效,请重新登录!",
278
- noPermissionMessage: "无权限访问该页面"
278
+ noPermissionMessage: "无权限访问该页面",
279
+ keyPrefix: ""
279
280
  }, _e = Symbol("access");
280
- class $s {
281
+ class bn {
281
282
  options;
282
283
  data = null;
283
284
  mode = _.Raw;
@@ -285,22 +286,22 @@ class $s {
285
286
  this.options = Object.assign({}, gt, e), this.loadData();
286
287
  }
287
288
  connect(e) {
288
- const { mode: t, router: s, request: r } = e;
289
- this.mode = t, s && t === _.Raw && this.setGuard(s), r && this.setRequest(r);
289
+ const { mode: t, router: n, request: r } = e;
290
+ this.mode = t, n && t === _.Raw && this.setGuard(n), r && this.setRequest(r);
290
291
  }
291
292
  login(e) {
292
- const { storageKey: t, storagePrefix: s, session: r, authKey: o } = this.options;
293
+ const { storageKey: t, storagePrefix: n, session: r, authKey: o } = this.options;
293
294
  this.setData(e), this.data && (B.save(t, e, {
294
295
  type: "local",
295
- prefix: s
296
+ prefix: n
296
297
  }), r && U.set(o, this.data.token));
297
298
  }
298
299
  clear() {
299
- const { storageKey: e, storagePrefix: t, session: s, authKey: r } = this.options;
300
+ const { storageKey: e, storagePrefix: t, session: n, authKey: r } = this.options;
300
301
  this.data = null, B.remove(e, {
301
302
  type: "local",
302
303
  prefix: t
303
- }), s && U.remove(r);
304
+ }), n && U.remove(r);
304
305
  }
305
306
  logout() {
306
307
  this.clear(), this.toLogin();
@@ -312,20 +313,20 @@ class $s {
312
313
  return this.data?.token;
313
314
  }
314
315
  can(e) {
315
- const { permissions: t = {} } = this.data || {};
316
- return typeof e == "function" ? e(t) : te(e).every((r) => t[r]);
316
+ const { keyPrefix: t } = this.options, { permissions: n = {} } = this.data || {};
317
+ return typeof e == "function" ? e(n) : te(e).every((o) => n[o] || n[t + o]);
317
318
  }
318
319
  some(e) {
319
- const { permissions: t = {} } = this.data || {};
320
- return te(e).some((r) => t[r]);
320
+ const { keyPrefix: t } = this.options, { permissions: n = {} } = this.data || {};
321
+ return te(e).some((o) => n[o] || n[t + o]);
321
322
  }
322
323
  install(e) {
323
324
  e.config.globalProperties.$access || (e.config.globalProperties.$access = this), e.provide(_e, this);
324
325
  }
325
326
  isAuthPath(e) {
326
- const { auth: t, isAuth: s } = this.options;
327
- if (s)
328
- return s(e);
327
+ const { auth: t, isAuth: n } = this.options;
328
+ if (n)
329
+ return n(e);
329
330
  if (e.path && typeof t == "string") {
330
331
  const r = t.split("#")[1] || t;
331
332
  return e.path === r;
@@ -335,32 +336,32 @@ class $s {
335
336
  toLogin() {
336
337
  const { auth: e, redirectParam: t } = this.options;
337
338
  if (!e || this.mode !== _.Raw) return;
338
- const s = t ? `?${t}=${encodeURIComponent(location.href)}` : "";
339
- typeof e == "function" ? e(s) : location.href = t ? `${e}${s}` : e;
339
+ const n = t ? `?${t}=${encodeURIComponent(location.href)}` : "";
340
+ typeof e == "function" ? e(n) : location.href = t ? `${e}${n}` : e;
340
341
  }
341
342
  setData(e) {
342
343
  const { privateKey: t } = this.options;
343
344
  if (Array.isArray(e) && t) {
344
- const s = e.map((r) => se(r, t));
345
- this.data = JSON.parse(s.join(""));
345
+ const n = e.map((r) => ne(r, t));
346
+ this.data = JSON.parse(n.join(""));
346
347
  return;
347
348
  }
348
349
  if (typeof e == "string")
349
350
  try {
350
- const s = t ? se(e, t) : e;
351
- s ? this.data = JSON.parse(s) : console.warn("RSA解密失败或登录信息缺失");
352
- } catch (s) {
353
- console.warn(s);
351
+ const n = t ? ne(e, t) : e;
352
+ n ? this.data = JSON.parse(n) : console.warn("RSA解密失败或登录信息缺失");
353
+ } catch (n) {
354
+ console.warn(n);
354
355
  }
355
356
  else
356
357
  this.data = e;
357
358
  }
358
359
  loadData() {
359
- const { storageKey: e, storagePrefix: t } = this.options, s = B.get(e, {
360
+ const { storageKey: e, storagePrefix: t } = this.options, n = B.get(e, {
360
361
  type: "local",
361
362
  prefix: t
362
363
  });
363
- this.setData(s);
364
+ this.setData(n);
364
365
  }
365
366
  isLogined() {
366
367
  const { session: e, authKey: t } = this.options;
@@ -374,7 +375,7 @@ class $s {
374
375
  return !0;
375
376
  }
376
377
  setGuard(e) {
377
- e.beforeEach((t, s, r) => this.guard(t, r));
378
+ e.beforeEach((t, n, r) => this.guard(t, r));
378
379
  }
379
380
  guard(e, t) {
380
381
  if (this.isWhiteList(e) || this.isAuthPath(e))
@@ -383,15 +384,15 @@ class $s {
383
384
  if (this.hasRoutePermission(e))
384
385
  return t();
385
386
  {
386
- const s = this.options.noPermissionMessage || "无权限访问";
387
- return this.showTip(s), t(!1);
387
+ const n = this.options.noPermissionMessage || "无权限访问";
388
+ return this.showTip(n), t(!1);
388
389
  }
389
390
  }
390
391
  t(!1), this.toLogin();
391
392
  }
392
393
  isWhiteList(e) {
393
394
  const { whiteList: t } = this.options;
394
- return t ? Array.isArray(t) ? t.some((s) => e.fullPath.startsWith(s)) : t(e) : !1;
395
+ return t ? Array.isArray(t) ? t.some((n) => e.fullPath.startsWith(n)) : t(e) : !1;
395
396
  }
396
397
  isUnauthorized(e) {
397
398
  const { unauthorizedCode: t = 401 } = this.options;
@@ -406,14 +407,14 @@ class $s {
406
407
  t && (await le(150), await t(e, {
407
408
  title: "提示",
408
409
  type: "warning"
409
- }).catch((s) => s));
410
+ }).catch((n) => n));
410
411
  }
411
412
  setRequest(e) {
412
413
  e.useRequest((t) => (this.data?.token && (t.headers[this.options.authKey] = this.data?.token), t)), e.useResponse(
413
414
  async (t) => (await this.showUnauthorizedAlert(t), t),
414
415
  async (t) => {
415
- const s = t.response || t || {};
416
- return await this.showUnauthorizedAlert(s), Promise.reject(t);
416
+ const n = t.response || t || {};
417
+ return await this.showUnauthorizedAlert(n), Promise.reject(t);
417
418
  }
418
419
  );
419
420
  }
@@ -447,14 +448,14 @@ class yt {
447
448
  $apis = {};
448
449
  __transform = {};
449
450
  constructor(e) {
450
- const { mode: t, dsl: s, attrs: r } = e;
451
- this.__mode = t, s && (this.__id = s.id || null, this.__transform = s.transform || {}), r && Object.assign(this, r);
452
- }
453
- setup(e, t = M) {
454
- const s = t.getCurrentInstance();
455
- if (!s) return;
456
- this.__refs = {}, this.$refs = {}, this.context = {}, this.__contextRefs = {}, this.__instance = s.proxy;
457
- const r = s.appContext.config.globalProperties;
451
+ const { mode: t, dsl: n, attrs: r } = e;
452
+ this.__mode = t, n && (this.__id = n.id || null, this.__transform = n.transform || {}), r && Object.assign(this, r);
453
+ }
454
+ setup(e, t = T) {
455
+ const n = t.getCurrentInstance();
456
+ if (!n) return;
457
+ this.__refs = {}, this.$refs = {}, this.context = {}, this.__contextRefs = {}, this.__instance = n.proxy;
458
+ const r = n.appContext.config.globalProperties;
458
459
  Object.assign(this, r), Object.assign(this, e || {}), this.__proxy(), t.onMounted(() => {
459
460
  this.__proxy();
460
461
  }), t.onUnmounted(() => {
@@ -476,87 +477,87 @@ class yt {
476
477
  __parseFunction(e) {
477
478
  if (e)
478
479
  if (this.__mode === _.Runtime) {
479
- const { id: t, type: s } = e, r = t ? this.__transform[t] ?? e.value : e.value;
480
- return ie({ type: s, value: r }, this);
480
+ const { id: t, type: n } = e, r = t ? this.__transform[t] ?? e.value : e.value;
481
+ return ie({ type: n, value: r }, this);
481
482
  } else
482
483
  return ie(e, this);
483
484
  }
484
485
  __parseExpression(e) {
485
486
  if (e)
486
487
  if (this.__mode === _.Runtime) {
487
- const { id: t, type: s } = e, r = t ? this.__transform[t] ?? e.value : e.value;
488
- return k({ type: s, value: r }, this);
488
+ const { id: t, type: n } = e, r = t ? this.__transform[t] ?? e.value : e.value;
489
+ return k({ type: n, value: r }, this);
489
490
  } else
490
491
  return k(e, this);
491
492
  }
492
493
  __ref(e = null, t) {
493
494
  if (this.__mode !== _.VNode)
494
- return e && e !== this.__id && (this.__contextRefs[e] = this), async (s) => {
495
+ return e && e !== this.__id && (this.__contextRefs[e] = this), async (n) => {
495
496
  await le(0);
496
- let r = s?.$vtjEl || s?.$el || s?._?.vnode?.el || s;
497
+ let r = n?.$vtjEl || n?.$el || n?._?.vnode?.el || n;
497
498
  if (!r) {
498
499
  typeof t == "string" && (delete this.$refs[t], e && delete this.__refs[e]);
499
500
  return;
500
501
  }
501
- if (r.nodeType === 3 && r.nextSibling && (r = r.nextSibling), r.__vtj__ = e, _.Design === this.__mode && (r.__context__ = this, r.draggable = !0), e && (this.__refs[e] = s), typeof t == "function")
502
- t(s);
502
+ if (r.nodeType === 3 && r.nextSibling && (r = r.nextSibling), r.__vtj__ = e, _.Design === this.__mode && (r.__context__ = this, r.draggable = !0), e && (this.__refs[e] = n), typeof t == "function")
503
+ t(n);
503
504
  else if (t) {
504
505
  const o = this.$refs[t];
505
- if (o && s !== o) {
506
- const a = new Set([].concat(o, s));
506
+ if (o && n !== o) {
507
+ const a = new Set([].concat(o, n));
507
508
  this.$refs[t] = Array.from(a);
508
509
  } else
509
- this.$refs[t] = s;
510
+ this.$refs[t] = n;
510
511
  }
511
- return s;
512
+ return n;
512
513
  };
513
514
  }
514
515
  __clone(e = {}) {
515
- const t = { ...this.context, ...e }, s = {
516
+ const t = { ...this.context, ...e }, n = {
516
517
  ...t,
517
518
  context: t
518
519
  };
519
- return s.context.__proto__ = this.context, s.__proto__ = this, s;
520
+ return n.context.__proto__ = this.context, n.__proto__ = this, n;
520
521
  }
521
522
  }
522
- function J(n) {
523
+ function J(s) {
523
524
  const {
524
- Vue: e = M,
525
+ Vue: e = T,
525
526
  mode: t = _.Runtime,
526
- components: s = {},
527
+ components: n = {},
527
528
  libs: r = {},
528
529
  apis: o = {},
529
530
  loader: a
530
- } = n, i = e.computed(() => n.dsl), c = {
531
- $components: s,
531
+ } = s, i = e.computed(() => s.dsl), l = {
532
+ $components: n,
532
533
  $libs: r,
533
534
  $apis: o
534
- }, l = new yt({
535
+ }, c = new yt({
535
536
  mode: t,
536
537
  dsl: i.value,
537
- attrs: c
538
+ attrs: l
538
539
  }), f = e.defineComponent({
539
540
  name: i.value.name,
540
541
  props: {
541
- ...wt(i.value.props ?? [], l)
542
+ ...wt(i.value.props ?? [], c)
542
543
  },
543
544
  setup(d) {
544
- l.$props = d, l.props = d, i.value.id && ve(
545
- n.window || window,
545
+ c.$props = d, c.props = d, i.value.id && ve(
546
+ s.window || window,
546
547
  i.value.id,
547
548
  i.value.css || ""
548
- ), l.state = St(e, i.value.state ?? {}, l);
549
- const u = jt(e, i.value.computed ?? {}, l), m = $t(i.value.methods ?? {}, l), p = bt(e, i.value.inject, l), h = Et(
549
+ ), c.state = St(e, i.value.state ?? {}, c);
550
+ const u = jt(e, i.value.computed ?? {}, c), h = $t(i.value.methods ?? {}, c), p = bt(e, i.value.inject, c), m = Et(
550
551
  i.value.dataSources || {},
551
- l
552
+ c
552
553
  ), w = {
553
554
  ...p,
554
555
  ...u,
555
- ...m,
556
- ...h
556
+ ...h,
557
+ ...m
557
558
  };
558
- return l.setup(w, e), Pt(e, i.value.watch ?? [], l), {
559
- vtj: l
559
+ return c.setup(w, e), Pt(e, i.value.watch ?? [], c), {
560
+ vtj: c
560
561
  };
561
562
  },
562
563
  emits: _t(i.value.emits),
@@ -564,249 +565,249 @@ function J(n) {
564
565
  render() {
565
566
  if (!i.value.nodes) return null;
566
567
  const d = i.value.nodes || [];
567
- return d.length === 1 ? D(d[0], l, e, a) : d.map((u) => D(u, l, e, a));
568
+ return d.length === 1 ? M(d[0], c, e, a) : d.map((u) => M(u, c, e, a));
568
569
  },
569
- ...xt(i.value.lifeCycles ?? {}, l)
570
+ ...xt(i.value.lifeCycles ?? {}, c)
570
571
  });
571
572
  return {
572
573
  renderer: e.markRaw(f),
573
- context: l
574
+ context: c
574
575
  };
575
576
  }
576
- function _t(n = []) {
577
- return n.map((e) => j(e) ? e : e.name);
577
+ function _t(s = []) {
578
+ return s.map((e) => j(e) ? e : e.name);
578
579
  }
579
- function wt(n = [], e) {
580
- const t = (s) => s ? (Array.isArray(s) ? s : [s]).map((o) => et[o]) : void 0;
581
- return n.map((s) => j(s) ? {
582
- name: s
580
+ function wt(s = [], e) {
581
+ const t = (n) => n ? (Array.isArray(n) ? n : [n]).map((o) => et[o]) : void 0;
582
+ return s.map((n) => j(n) ? {
583
+ name: n
583
584
  } : {
584
- name: s.name,
585
- type: s.type,
586
- required: s.required,
587
- default: S(s.default) ? e.__parseExpression(s.default) : s.default
585
+ name: n.name,
586
+ type: n.type,
587
+ required: n.required,
588
+ default: S(n.default) ? e.__parseExpression(n.default) : n.default
588
589
  }).reduce(
589
- (s, r) => (s[r.name] = {
590
+ (n, r) => (n[r.name] = {
590
591
  type: t(r.type),
591
592
  required: r.required,
592
593
  default: r.default
593
- }, s),
594
+ }, n),
594
595
  {}
595
596
  );
596
597
  }
597
- function St(n, e, t) {
598
- return n.reactive(
598
+ function St(s, e, t) {
599
+ return s.reactive(
599
600
  Object.keys(e || {}).reduce(
600
- (s, r) => {
601
+ (n, r) => {
601
602
  let o = e[r];
602
- return S(o) ? o = t.__parseExpression(o) : H(o) && (o = t.__parseFunction(o)), s[r] = o, s;
603
+ return S(o) ? o = t.__parseExpression(o) : H(o) && (o = t.__parseFunction(o)), n[r] = o, n;
603
604
  },
604
605
  {}
605
606
  )
606
607
  );
607
608
  }
608
- function jt(n, e, t) {
609
+ function jt(s, e, t) {
609
610
  return Object.entries(e ?? {}).reduce(
610
- (s, [r, o]) => (s[r] = n.computed(t.__parseFunction(o)), s),
611
+ (n, [r, o]) => (n[r] = s.computed(t.__parseFunction(o)), n),
611
612
  {}
612
613
  );
613
614
  }
614
- function $t(n, e) {
615
- return Object.entries(n ?? {}).reduce(
616
- (t, [s, r]) => (t[s] = e.__parseFunction(r), t),
615
+ function $t(s, e) {
616
+ return Object.entries(s ?? {}).reduce(
617
+ (t, [n, r]) => (t[n] = e.__parseFunction(r), t),
617
618
  {}
618
619
  );
619
620
  }
620
- function bt(n, e = [], t) {
621
+ function bt(s, e = [], t) {
621
622
  return e.reduce(
622
- (s, r) => {
623
+ (n, r) => {
623
624
  const { name: o, from: a } = r || {};
624
625
  r.default;
625
- const i = S(a) ? t.__parseExpression(a) || o : a ?? o, c = S(r.default) ? t.__parseExpression(r.default) : r.default ?? null;
626
- return s[o] = n.inject(i, c), s;
626
+ const i = S(a) ? t.__parseExpression(a) || o : a ?? o, l = S(r.default) ? t.__parseExpression(r.default) : r.default ?? null;
627
+ return n[o] = s.inject(i, l), n;
627
628
  },
628
629
  {}
629
630
  );
630
631
  }
631
- function Et(n, e) {
632
- return Object.keys(n).reduce(
633
- (t, s) => {
634
- const r = n[s], o = e.$apis[r.ref], a = H(r.transform) ? r.transform.value ? e.__parseFunction(r.transform) : void 0 : r.transform;
635
- return t[s] = async (...i) => {
636
- const c = await o.apply(e, i);
637
- return a ? a(c) : c;
632
+ function Et(s, e) {
633
+ return Object.keys(s).reduce(
634
+ (t, n) => {
635
+ const r = s[n], o = e.$apis[r.ref], a = H(r.transform) ? r.transform.value ? e.__parseFunction(r.transform) : void 0 : r.transform;
636
+ return t[n] = async (...i) => {
637
+ const l = await o.apply(e, i);
638
+ return a ? a(l) : l;
638
639
  }, t;
639
640
  },
640
641
  {}
641
642
  );
642
643
  }
643
- function Pt(n, e = [], t) {
644
- e.forEach((s) => {
645
- n.watch(
646
- t.__parseExpression(s.source),
647
- t.__parseFunction(s.handler),
644
+ function Pt(s, e = [], t) {
645
+ e.forEach((n) => {
646
+ s.watch(
647
+ t.__parseExpression(n.source),
648
+ t.__parseFunction(n.handler),
648
649
  {
649
- deep: s.deep,
650
- immediate: s.immediate
650
+ deep: n.deep,
651
+ immediate: n.immediate
651
652
  }
652
653
  );
653
654
  });
654
655
  }
655
- function xt(n, e) {
656
- return Object.entries(n ?? {}).reduce(
657
- (t, [s, r]) => (t[s] = e.__parseFunction(r), t),
656
+ function xt(s, e) {
657
+ return Object.entries(s ?? {}).reduce(
658
+ (t, [n, r]) => (t[n] = e.__parseFunction(r), t),
658
659
  {}
659
660
  );
660
661
  }
661
662
  let L = [];
662
- const Rt = (n) => n;
663
- async function we(n, e = window) {
664
- const { urls: t = [], library: s } = n, r = t.filter((i) => Y(i));
665
- if (r.length === 0 || !s) return null;
663
+ const Rt = (s) => s;
664
+ async function we(s, e = window) {
665
+ const { urls: t = [], library: n } = s, r = t.filter((i) => Y(i));
666
+ if (r.length === 0 || !n) return null;
666
667
  const o = t.filter((i) => G(i));
667
- return o.length && it(o, e), await at(r, s, e).catch(
668
- (i) => (console.warn("loadScriptUrl error", r, s, i), null)
668
+ return o.length && it(o, e), await at(r, n, e).catch(
669
+ (i) => (console.warn("loadScriptUrl error", r, n, i), null)
669
670
  );
670
671
  }
671
- function V(n) {
672
- const { getDsl: e, getDslByUrl: t, options: s } = n;
673
- return s.window && (L.forEach((r) => {
674
- delete s.window[r];
675
- }), L = []), (r, o, a = M) => !o || typeof o == "string" ? r : o.type === "Schema" && o.id ? a.defineAsyncComponent(async () => {
672
+ function V(s) {
673
+ const { getDsl: e, getDslByUrl: t, options: n } = s;
674
+ return n.window && (L.forEach((r) => {
675
+ delete n.window[r];
676
+ }), L = []), (r, o, a = T) => !o || typeof o == "string" ? r : o.type === "Schema" && o.id ? a.defineAsyncComponent(async () => {
676
677
  const i = await e(o.id);
677
678
  return i && (i.name = r), i ? J({
678
- ...s,
679
+ ...n,
679
680
  Vue: a,
680
681
  dsl: i,
681
682
  mode: _.Runtime,
682
- loader: V(n)
683
+ loader: V(s)
683
684
  }).renderer : null;
684
685
  }) : o.type === "UrlSchema" && o.url ? a.defineAsyncComponent(async () => {
685
686
  const i = await t(o.url);
686
687
  return i && (i.name = r), i ? J({
687
- ...s,
688
+ ...n,
688
689
  Vue: a,
689
690
  dsl: i,
690
691
  mode: _.Runtime,
691
- loader: V(n)
692
+ loader: V(s)
692
693
  }).renderer : null;
693
694
  }) : o.type === "Plugin" ? (o.library && L.push(o.library), a.defineAsyncComponent(async () => {
694
- const i = await we(o, s.window);
695
+ const i = await we(o, n.window);
695
696
  return i || (console.warn("getPlugin result is null", o), null);
696
697
  })) : r;
697
698
  }
698
- function D(n, e, t = M, s = Rt) {
699
- if (!n || !n.name || n.invisible) return null;
700
- const { id: r = null, directives: o = [] } = n, { vIf: a, vFor: i, vShow: c, vModels: l, vBind: f } = kt(o);
699
+ function M(s, e, t = T, n = Rt) {
700
+ if (!s || !s.name || s.invisible) return null;
701
+ const { id: r = null, directives: o = [] } = s, { vIf: a, vFor: i, vShow: l, vModels: c, vBind: f } = kt(o);
701
702
  if (a && !Ct(a, e))
702
703
  return null;
703
704
  const d = (u) => {
704
- const m = u.$components, p = (() => {
705
- if (n.name === "component")
706
- return Ft(u, n.props?.is);
707
- if (n.name === "slot") return n.name;
708
- const v = s(n.name, n.from, t);
709
- return j(v) ? m[v] ?? v : v;
710
- })(), h = At(r, n.props ?? {}, u), w = It(t, n.events ?? {}, u);
711
- if (n.name === "slot")
712
- return Ot(t, n, h, u, s);
713
- f && Object.assign(h, u.__parseExpression(f.value)), c && (h.style = Object.assign(
714
- h.style ?? {},
715
- Mt(c, u)
716
- )), l.forEach((v) => {
717
- Object.assign(h, Tt(t, v, u));
705
+ const h = u.$components, p = (() => {
706
+ if (s.name === "component")
707
+ return Ft(u, s.props?.is);
708
+ if (s.name === "slot") return s.name;
709
+ const v = n(s.name, s.from, t);
710
+ return j(v) ? h[v] ?? v : v;
711
+ })(), m = At(r, s.props ?? {}, u), w = It(t, s.events ?? {}, u);
712
+ if (s.name === "slot")
713
+ return Ot(t, s, m, u, n);
714
+ f && Object.assign(m, u.__parseExpression(f.value)), l && (m.style = Object.assign(
715
+ m.style ?? {},
716
+ Tt(l, u)
717
+ )), c.forEach((v) => {
718
+ Object.assign(m, Dt(t, v, u));
718
719
  });
719
720
  const g = Ht(
720
721
  t,
721
- n.children ?? [],
722
+ s.children ?? [],
722
723
  u,
723
- s,
724
- n
724
+ n,
725
+ s
725
726
  );
726
- return t.createVNode(p, { ...h, ...w }, g);
727
+ return t.createVNode(p, { ...m, ...w }, g);
727
728
  };
728
729
  return i ? Nt(i, d, e) : d(e);
729
730
  }
730
- function kt(n = []) {
731
- const e = n.find((i) => $(i.name) === "vIf"), t = n.find((i) => $(i.name) === "vFor"), s = n.find((i) => $(i.name) === "vShow"), r = n.find((i) => $(i.name) === "vBind"), o = n.filter((i) => $(i.name) === "vModel"), a = n.filter(
731
+ function kt(s = []) {
732
+ const e = s.find((i) => $(i.name) === "vIf"), t = s.find((i) => $(i.name) === "vFor"), n = s.find((i) => $(i.name) === "vShow"), r = s.find((i) => $(i.name) === "vBind"), o = s.filter((i) => $(i.name) === "vModel"), a = s.filter(
732
733
  (i) => !Ze.includes($(i.name))
733
734
  );
734
735
  return {
735
736
  vIf: e,
736
737
  vFor: t,
737
- vShow: s,
738
+ vShow: n,
738
739
  vModels: o,
739
740
  vBind: r,
740
741
  others: a
741
742
  };
742
743
  }
743
- function Ct(n, e) {
744
- return !!e.__parseExpression(n.value);
744
+ function Ct(s, e) {
745
+ return !!e.__parseExpression(s.value);
745
746
  }
746
- function Ft(n, e) {
747
- return e ? S(e) ? n.__parseExpression(e) : e : "div";
747
+ function Ft(s, e) {
748
+ return e ? S(e) ? s.__parseExpression(e) : e : "div";
748
749
  }
749
- function At(n, e, t) {
750
- const s = Object.keys(e || {}).reduce(
750
+ function At(s, e, t) {
751
+ const n = Object.keys(e || {}).reduce(
751
752
  (r, o) => {
752
753
  let a = e[o];
753
754
  return S(a) ? a = t.__parseExpression(a) : H(a) && (a = t.__parseFunction(a)), r[o] = a, r;
754
755
  },
755
756
  {}
756
757
  );
757
- return s.ref = t.__ref(n, s.ref), s;
758
+ return n.ref = t.__ref(s, n.ref), n;
758
759
  }
759
- function It(n, e, t) {
760
- const s = ["passive", "capture", "once"], r = {
760
+ function It(s, e, t) {
761
+ const n = ["passive", "capture", "once"], r = {
761
762
  capture: "Capture",
762
763
  once: "Once",
763
764
  passive: "OnceCapture"
764
765
  };
765
766
  return Object.keys(e || {}).reduce(
766
767
  (o, a) => {
767
- const i = e[a], c = Se(i.modifiers), l = c.find((u) => s.includes(u)), f = "on" + Me(a) + (l && r[l] || ""), d = t.__parseFunction(i.handler);
768
- return d && (o[f] = n.withModifiers(d, c)), o;
768
+ const i = e[a], l = Se(i.modifiers), c = l.find((u) => n.includes(u)), f = "on" + Te(a) + (c && r[c] || ""), d = t.__parseFunction(i.handler);
769
+ return d && (o[f] = s.withModifiers(d, l)), o;
769
770
  },
770
771
  {}
771
772
  );
772
773
  }
773
- function Se(n = {}, e = !1) {
774
- const t = Object.keys(n);
775
- return e ? t.map((s) => "." + s) : t;
774
+ function Se(s = {}, e = !1) {
775
+ const t = Object.keys(s);
776
+ return e ? t.map((n) => "." + n) : t;
776
777
  }
777
- function Ot(n, e, t, s, r) {
778
- const { children: o } = e, a = Dt(e, s), i = s.$slots?.[a.name];
779
- return i ? i(t) : o ? j(o) ? n.createTextVNode(o) : S(o) ? n.createTextVNode(
780
- ge(s.__parseExpression(o))
778
+ function Ot(s, e, t, n, r) {
779
+ const { children: o } = e, a = Mt(e, n), i = n.$slots?.[a.name];
780
+ return i ? i(t) : o ? j(o) ? s.createTextVNode(o) : S(o) ? s.createTextVNode(
781
+ ge(n.__parseExpression(o))
781
782
  ) : Array.isArray(o) ? o.map(
782
- (c) => D(c, s, n, r)
783
+ (l) => M(l, n, s, r)
783
784
  ) : null : null;
784
785
  }
785
- function Dt(n, e) {
786
- const { props: t } = n, s = t?.name || "default";
786
+ function Mt(s, e) {
787
+ const { props: t } = s, n = t?.name || "default";
787
788
  return {
788
- name: S(s) ? e.__parseExpression(s) : s,
789
+ name: S(n) ? e.__parseExpression(n) : n,
789
790
  params: []
790
791
  };
791
792
  }
792
- function Mt(n, e) {
793
- return e.__parseExpression(n.value) ? {} : {
793
+ function Tt(s, e) {
794
+ return e.__parseExpression(s.value) ? {} : {
794
795
  display: "none"
795
796
  };
796
797
  }
797
- function Tt(n, e, t) {
798
- const s = {
798
+ function Dt(s, e, t) {
799
+ const n = {
799
800
  type: "JSFunction",
800
801
  value: e.value?.value ? `(v) => {
801
802
  ${e.value.value} = v;
802
803
  }` : "(v) => {}"
803
- }, r = t.__parseFunction(s), o = Se(e.modifiers), a = S(e.arg) ? t.__parseExpression(e.arg) : e.arg || "modelValue";
804
+ }, r = t.__parseFunction(n), o = Se(e.modifiers), a = S(e.arg) ? t.__parseExpression(e.arg) : e.arg || "modelValue";
804
805
  return {
805
806
  [a]: t.__parseExpression(e.value),
806
- [`onUpdate:${a}`]: o.length && r ? n.withModifiers(r, o) : r
807
+ [`onUpdate:${a}`]: o.length && r ? s.withModifiers(r, o) : r
807
808
  };
808
809
  }
809
- function Ht(n, e, t, s, r) {
810
+ function Ht(s, e, t, n, r) {
810
811
  if (!e) return null;
811
812
  if (j(e))
812
813
  return { default: () => e };
@@ -818,93 +819,93 @@ function Ht(n, e, t, s, r) {
818
819
  const o = Bt(e), a = (i) => !i || !r ? {} : r?.id && Object.keys(i).length ? {
819
820
  [`scope_${r.id}`]: i
820
821
  } : {};
821
- return Object.entries(o).reduce((i, [c, { nodes: l, params: f }]) => (i[c] = (d) => {
822
- const u = f.length ? Te(d ?? {}, f) : a(d);
823
- return l.map(
824
- (m) => D(m, t.__clone(u), n, s)
822
+ return Object.entries(o).reduce((i, [l, { nodes: c, params: f }]) => (i[l] = (d) => {
823
+ const u = f.length ? De(d ?? {}, f) : a(d);
824
+ return c.map(
825
+ (h) => M(h, t.__clone(u), s, n)
825
826
  );
826
827
  }, i), {});
827
828
  }
828
829
  return null;
829
830
  }
830
- function Bt(n) {
831
+ function Bt(s) {
831
832
  const e = {
832
833
  default: {
833
834
  params: [],
834
835
  nodes: []
835
836
  }
836
837
  };
837
- for (const t of n) {
838
- const s = Ut(t.slot), r = s.name;
839
- e[r] ? (e[r].nodes.push(t), e[r].params = e[r].params.concat(s.params)) : e[r] = {
838
+ for (const t of s) {
839
+ const n = Ut(t.slot), r = n.name;
840
+ e[r] ? (e[r].nodes.push(t), e[r].params = e[r].params.concat(n.params)) : e[r] = {
840
841
  nodes: [t],
841
- params: s.params
842
+ params: n.params
842
843
  };
843
844
  }
844
845
  return e;
845
846
  }
846
- function Ut(n = "default") {
847
- return j(n) ? { name: n, params: [] } : { params: [], ...n };
847
+ function Ut(s = "default") {
848
+ return j(s) ? { name: s, params: [] } : { params: [], ...s };
848
849
  }
849
- function Nt(n, e, t) {
850
- const { value: s, iterator: r } = n, { item: o = "item", index: a = "index" } = r || {};
851
- let i = t.__parseExpression(s) || [];
852
- return Number.isInteger(i) && (i = new Array(i).fill(!0).map((c, l) => l + 1)), Array.isArray(i) ? i.map((c, l) => e(t.__clone({ [o]: c, [a]: l }))) : (console.warn("[vForRender]:", `${s?.value} is not a Arrary`), []);
850
+ function Nt(s, e, t) {
851
+ const { value: n, iterator: r } = s, { item: o = "item", index: a = "index" } = r || {};
852
+ let i = t.__parseExpression(n) || [];
853
+ return Number.isInteger(i) && (i = new Array(i).fill(!0).map((l, c) => c + 1)), Array.isArray(i) ? i.map((l, c) => e(t.__clone({ [o]: l, [a]: c }))) : (console.warn("[vForRender]:", `${n?.value} is not a Arrary`), []);
853
854
  }
854
- function Lt(n) {
855
- return ze() ? (Ke(n), !0) : !1;
855
+ function Lt(s) {
856
+ return Ve() ? (ze(s), !0) : !1;
856
857
  }
857
- function Q(n) {
858
- return typeof n == "function" ? n() : Je(n);
858
+ function Q(s) {
859
+ return typeof s == "function" ? s() : Ke(s);
859
860
  }
860
861
  const je = typeof window < "u" && typeof document < "u";
861
862
  typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
862
- const qt = (n) => n != null, Jt = () => {
863
+ const qt = (s) => s != null, Jt = () => {
863
864
  };
864
- function Vt(n) {
865
+ function Vt(s) {
865
866
  return de();
866
867
  }
867
- function zt(...n) {
868
- if (n.length !== 1)
869
- return Ne(...n);
870
- const e = n[0];
868
+ function zt(...s) {
869
+ if (s.length !== 1)
870
+ return Ne(...s);
871
+ const e = s[0];
871
872
  return typeof e == "function" ? Le(qe(() => ({ get: e, set: Jt }))) : O(e);
872
873
  }
873
- function Kt(n, e) {
874
- Vt() && Ve(n, e);
874
+ function Kt(s, e) {
875
+ Vt() && Je(s, e);
875
876
  }
876
877
  const Wt = je ? window : void 0, Gt = je ? window.document : void 0;
877
- function Yt(n) {
878
+ function Yt(s) {
878
879
  var e;
879
- const t = Q(n);
880
+ const t = Q(s);
880
881
  return (e = t?.$el) != null ? e : t;
881
882
  }
882
883
  function Qt() {
883
- const n = O(!1), e = de();
884
+ const s = O(!1), e = de();
884
885
  return e && We(() => {
885
- n.value = !0;
886
- }, e), n;
886
+ s.value = !0;
887
+ }, e), s;
887
888
  }
888
- function Xt(n) {
889
+ function Xt(s) {
889
890
  const e = Qt();
890
- return fe(() => (e.value, !!n()));
891
+ return fe(() => (e.value, !!s()));
891
892
  }
892
- function Zt(n, e, t = {}) {
893
- const { window: s = Wt, ...r } = t;
893
+ function Zt(s, e, t = {}) {
894
+ const { window: n = Wt, ...r } = t;
894
895
  let o;
895
- const a = Xt(() => s && "MutationObserver" in s), i = () => {
896
+ const a = Xt(() => n && "MutationObserver" in n), i = () => {
896
897
  o && (o.disconnect(), o = void 0);
897
- }, c = fe(() => {
898
- const u = Q(n), m = (Array.isArray(u) ? u : [u]).map(Yt).filter(qt);
899
- return new Set(m);
900
- }), l = pe(
901
- () => c.value,
898
+ }, l = fe(() => {
899
+ const u = Q(s), h = (Array.isArray(u) ? u : [u]).map(Yt).filter(qt);
900
+ return new Set(h);
901
+ }), c = pe(
902
+ () => l.value,
902
903
  (u) => {
903
- i(), a.value && u.size && (o = new MutationObserver(e), u.forEach((m) => o.observe(m, r)));
904
+ i(), a.value && u.size && (o = new MutationObserver(e), u.forEach((h) => o.observe(h, r)));
904
905
  },
905
906
  { immediate: !0, flush: "post" }
906
907
  ), f = () => o?.takeRecords(), d = () => {
907
- l(), i();
908
+ c(), i();
908
909
  };
909
910
  return Lt(d), {
910
911
  isSupported: a,
@@ -912,12 +913,12 @@ function Zt(n, e, t = {}) {
912
913
  takeRecords: f
913
914
  };
914
915
  }
915
- function es(n = null, e = {}) {
916
- var t, s, r;
916
+ function en(s = null, e = {}) {
917
+ var t, n, r;
917
918
  const {
918
919
  document: o = Gt,
919
920
  restoreOnUnmount: a = (d) => d
920
- } = e, i = (t = o?.title) != null ? t : "", c = zt((s = n ?? o?.title) != null ? s : null), l = n && typeof n == "function";
921
+ } = e, i = (t = o?.title) != null ? t : "", l = zt((n = s ?? o?.title) != null ? n : null), c = s && typeof s == "function";
921
922
  function f(d) {
922
923
  if (!("titleTemplate" in e))
923
924
  return d;
@@ -925,63 +926,63 @@ function es(n = null, e = {}) {
925
926
  return typeof u == "function" ? u(d) : Q(u).replace(/%s/g, d);
926
927
  }
927
928
  return pe(
928
- c,
929
+ l,
929
930
  (d, u) => {
930
931
  d !== u && o && (o.title = f(typeof d == "string" ? d : ""));
931
932
  },
932
933
  { immediate: !0 }
933
- ), e.observe && !e.titleTemplate && o && !l && Zt(
934
+ ), e.observe && !e.titleTemplate && o && !c && Zt(
934
935
  (r = o.head) == null ? void 0 : r.querySelector("title"),
935
936
  () => {
936
- o && o.title !== c.value && (c.value = f(o.title));
937
+ o && o.title !== l.value && (l.value = f(o.title));
937
938
  },
938
939
  { childList: !0 }
939
940
  ), Kt(() => {
940
941
  if (a) {
941
- const d = a(i, c.value || "");
942
+ const d = a(i, l.value || "");
942
943
  d != null && o && (o.title = d);
943
944
  }
944
- }), c;
945
+ }), l;
945
946
  }
946
947
  const ae = K({
947
948
  name: "VtjPageContainer",
948
949
  async setup() {
949
- const n = be(), e = he(), t = e.params.id, s = t ? n.getPage(t) : n.getHomepage(), r = s ? await n.getRenderComponent(s.id) : null;
950
- return s && (Object.assign(e.meta, s.meta || {}), es(s.title || "VTJ")), {
951
- provider: n,
950
+ const s = be(), e = he(), t = e.params.id, n = t ? s.getPage(t) : s.getHomepage(), r = n ? await s.getRenderComponent(n.id) : null;
951
+ return n && (Object.assign(e.meta, n.meta || {}), en(n.title || "VTJ")), {
952
+ provider: s,
952
953
  component: r,
953
- file: s,
954
+ file: n,
954
955
  query: e.query,
955
- meta: s?.meta
956
+ meta: n?.meta
956
957
  };
957
958
  },
958
959
  render() {
959
- const { component: n, query: e } = this;
960
- return n ? q(n, e) : q("div", "页面不存在");
960
+ const { component: s, query: e } = this;
961
+ return s ? q(s, e) : q("div", "页面不存在");
961
962
  }
962
- }), ts = {
963
+ }), tn = {
963
964
  "data-l-h6o7ki7": "",
964
965
  class: "vtj-startup__wrapper"
965
- }, ss = {
966
+ }, nn = {
966
967
  "data-l-h6o7ki7": "",
967
968
  class: "vtj-startup"
968
- }, ns = {
969
+ }, sn = {
969
970
  "data-l-h6o7ki7": "",
970
971
  class: "vtj-startup__name"
971
- }, rs = { "data-l-h6o7ki7": "" }, os = {
972
+ }, rn = { "data-l-h6o7ki7": "" }, on = {
972
973
  "data-l-h6o7ki7": "",
973
974
  class: "vtj-startup__tagline"
974
- }, is = {
975
+ }, an = {
975
976
  "data-l-h6o7ki7": "",
976
977
  class: "vtj-startup__actions"
977
- }, as = /* @__PURE__ */ K({
978
+ }, cn = /* @__PURE__ */ K({
978
979
  __name: "Startup",
979
980
  props: {
980
981
  name: { default: "VTJ.PRO" },
981
982
  tagline: { default: "基于 Vue3 + TypeScript 快速打造高生产力的低代码研发平台" },
982
983
  actionText: { default: "开始设计" }
983
984
  },
984
- setup(n) {
985
+ setup(s) {
985
986
  ((r, o) => {
986
987
  let a = document.getElementById("h6o7ki7");
987
988
  a || (a = document.createElement("style"), a.id = "h6o7ki7", document.head.appendChild(a), a.innerHTML = o);
@@ -1051,54 +1052,54 @@ const ae = K({
1051
1052
  .vtj-startup__actions button[data-l-h6o7ki7]:hover{
1052
1053
  opacity: 0.7;
1053
1054
  }`);
1054
- const t = n, s = () => {
1055
+ const t = s, n = () => {
1055
1056
  if (typeof window < "u") {
1056
1057
  let o = (window.__VTJ_LINK__ || {}).href || window.location.pathname + "__vtj__/#/";
1057
1058
  window.location.href = o;
1058
1059
  }
1059
1060
  };
1060
- return (r, o) => (Ge(), Ye("div", ts, [
1061
- b("div", ss, [
1062
- b("h1", ns, [
1063
- b("span", rs, N(t.name), 1)
1061
+ return (r, o) => (Ge(), Ye("div", tn, [
1062
+ b("div", nn, [
1063
+ b("h1", sn, [
1064
+ b("span", rn, N(t.name), 1)
1064
1065
  ]),
1065
- b("div", os, N(t.tagline), 1),
1066
- b("div", is, [
1066
+ b("div", on, N(t.tagline), 1),
1067
+ b("div", an, [
1067
1068
  b("button", {
1068
1069
  "data-l-h6o7ki7": "",
1069
- onClick: s
1070
+ onClick: n
1070
1071
  }, N(t.actionText), 1)
1071
1072
  ])
1072
1073
  ])
1073
1074
  ]));
1074
1075
  }
1075
- }), cs = K({
1076
+ }), ln = K({
1076
1077
  name: "VtjStartupContainer",
1077
1078
  render() {
1078
- return q(as);
1079
+ return q(cn);
1079
1080
  }
1080
1081
  }), $e = Symbol("Provider");
1081
- var ls = /* @__PURE__ */ ((n) => (n.Production = "production", n.Development = "development", n))(ls || {});
1082
- class us extends xe {
1082
+ var un = /* @__PURE__ */ ((s) => (s.Production = "production", s.Development = "development", s))(un || {});
1083
+ class dn extends xe {
1083
1084
  constructor(e) {
1084
1085
  super(), this.options = e;
1085
1086
  const {
1086
1087
  service: t,
1087
- mode: s = _.Raw,
1088
+ mode: n = _.Raw,
1088
1089
  dependencies: r,
1089
1090
  materials: o,
1090
1091
  project: a = {},
1091
1092
  adapter: i = {},
1092
- globals: c = {},
1093
- modules: l = {},
1093
+ globals: l = {},
1094
+ modules: c = {},
1094
1095
  router: f = null,
1095
1096
  materialPath: d = "./",
1096
1097
  nodeEnv: u = "development"
1097
1098
  /* Development */
1098
1099
  } = e;
1099
- this.mode = s, this.modules = l, this.service = t, this.router = f, this.materialPath = d, this.nodeEnv = u, r && (this.dependencies = r), o && (this.materials = o), Object.assign(this.globals, c), Object.assign(this.adapter, i);
1100
- const { access: m, request: p } = this.adapter;
1101
- m && m.connect({ mode: s, router: f, request: p }), s !== _.Design && this.load(a);
1100
+ this.mode = n, this.modules = c, this.service = t, this.router = f, this.materialPath = d, this.nodeEnv = u, r && (this.dependencies = r), o && (this.materials = o), Object.assign(this.globals, l), Object.assign(this.adapter, i);
1101
+ const { access: h, request: p } = this.adapter;
1102
+ h && h.connect({ mode: n, router: f, request: p }), n !== _.Design && this.load(a);
1102
1103
  }
1103
1104
  mode;
1104
1105
  globals = {};
@@ -1119,109 +1120,109 @@ class us extends xe {
1119
1120
  const t = this.modules[`.vtj/projects/${e.id}.json`];
1120
1121
  if (this.project = t ? await t() : await this.service.init(e), !this.project)
1121
1122
  throw new Error("project is null");
1122
- const { apis: s = [], meta: r = [] } = this.project, o = window;
1123
- o.CKEDITOR_VERSION = void 0, this.nodeEnv !== "production" ? await this.loadAssets(o) : await this.loadDependencies(o), this.apis = ft(s, r, this.adapter), ye(), this.project.config?.mock && ht(s), this.initRouter(), this.triggerReady();
1123
+ const { apis: n = [], meta: r = [] } = this.project, o = window;
1124
+ o.CKEDITOR_VERSION = void 0, this.nodeEnv !== "production" ? await this.loadAssets(o) : await this.loadDependencies(o), this.apis = ft(n, r, this.adapter), ye(), this.project.config?.mock && ht(n), this.initRouter(), this.triggerReady();
1124
1125
  }
1125
1126
  async loadDependencies(e) {
1126
1127
  const t = Object.entries(this.dependencies);
1127
- for (const [s, r] of t)
1128
- e[s] || (e[s] = await r());
1128
+ for (const [n, r] of t)
1129
+ e[n] || (e[n] = await r());
1129
1130
  }
1130
1131
  async loadAssets(e) {
1131
- const { dependencies: t = [] } = this.project, { dependencies: s, library: r, components: o, materialPath: a, nodeEnv: i } = this, {
1132
- libraryExports: c,
1133
- libraryMap: l,
1132
+ const { dependencies: t = [] } = this.project, { dependencies: n, library: r, components: o, materialPath: a, nodeEnv: i } = this, {
1133
+ libraryExports: l,
1134
+ libraryMap: c,
1134
1135
  materials: f,
1135
1136
  materialExports: d,
1136
1137
  materialMapLibrary: u
1137
- } = nt(
1138
+ } = st(
1138
1139
  t,
1139
1140
  a,
1140
1141
  i === "development"
1141
1142
  /* Development */
1142
1143
  );
1143
- for (const p of c) {
1144
- const h = s[p], w = e[p];
1144
+ for (const p of l) {
1145
+ const m = n[p], w = e[p];
1145
1146
  if (w)
1146
1147
  r[p] = w;
1147
- else if (h)
1148
- e[p] = r[p] = await h();
1148
+ else if (m)
1149
+ e[p] = r[p] = await m();
1149
1150
  else {
1150
- const g = l[p] || [];
1151
+ const g = c[p] || [];
1151
1152
  for (const v of g)
1152
- G(v) && await ot(p, x.append(v, { v: R })), Y(v) && await ne(x.append(v, { v: R }));
1153
+ G(v) && await ot(p, x.append(v, { v: R })), Y(v) && await se(x.append(v, { v: R }));
1153
1154
  r[p] = e[p];
1154
1155
  }
1155
1156
  }
1156
1157
  for (const p of f)
1157
- await ne(x.append(p, { v: R }));
1158
- const m = this.materials || {};
1158
+ await se(x.append(p, { v: R }));
1159
+ const h = this.materials || {};
1159
1160
  for (const p of d) {
1160
- const h = e[u[p]], w = Re[p];
1161
+ const m = e[u[p]], w = Re[p];
1161
1162
  if (w)
1162
- h && w.forEach((g) => {
1163
- o[g] = h[g];
1163
+ m && w.forEach((g) => {
1164
+ o[g] = m[g];
1164
1165
  });
1165
1166
  else {
1166
- const g = m[p] ? (await m[p]()).default : e[p];
1167
- g && h && (g.components || []).forEach((v) => {
1168
- o[v.name] = rt(v, h);
1167
+ const g = h[p] ? (await h[p]()).default : e[p];
1168
+ g && m && (g.components || []).forEach((v) => {
1169
+ o[v.name] = rt(v, m);
1169
1170
  });
1170
1171
  }
1171
1172
  }
1172
1173
  }
1173
1174
  initRouter() {
1174
- const { router: e, project: t, options: s } = this;
1175
+ const { router: e, project: t, options: n } = this;
1175
1176
  if (!e) return;
1176
- const { routeParentName: r, pageRouteName: o = "page", routeMeta: a } = s, i = {
1177
+ const { routeParentName: r, pageRouteName: o = "page", routeMeta: a } = n, i = {
1177
1178
  path: `/${o}/:id`,
1178
1179
  name: W,
1179
1180
  component: ae
1180
- }, c = {
1181
+ }, l = {
1181
1182
  path: "/",
1182
1183
  name: me,
1183
- component: t?.homepage ? ae : cs,
1184
+ component: t?.homepage ? ae : ln,
1184
1185
  meta: a
1185
1186
  };
1186
- r ? (e.addRoute(r, i), e.addRoute(r, c)) : (e.addRoute(i), e.addRoute(c));
1187
+ r ? (e.addRoute(r, i), e.addRoute(r, l)) : (e.addRoute(i), e.addRoute(l));
1187
1188
  }
1188
1189
  install(e) {
1189
1190
  const t = e.config.globalProperties.installed || {};
1190
- for (const [s, r] of Object.entries(this.library))
1191
- !t[s] && ct(r) && (e.use(r), t[s] = !0);
1192
- this.options.install && e.use(this.options.install), this.adapter.access && e.use(this.adapter.access), e.provide($e, this), e.config.globalProperties.installed = t, this.mode === _.Design && (e.config.errorHandler = (s, r, o) => {
1193
- const a = r?.$options.name, i = typeof s == "string" ? s : s?.message || s?.msg || "未知错误", c = `[ ${a} ] ${i} ${o}`;
1191
+ for (const [n, r] of Object.entries(this.library))
1192
+ !t[n] && ct(r) && (e.use(r), t[n] = !0);
1193
+ this.options.install && e.use(this.options.install), this.adapter.access && e.use(this.adapter.access), e.provide($e, this), e.config.globalProperties.installed = t, this.mode === _.Design && (e.config.errorHandler = (n, r, o) => {
1194
+ const a = r?.$options.name, i = typeof n == "string" ? n : n?.message || n?.msg || "未知错误", l = `[ ${a} ] ${i} ${o}`;
1194
1195
  console.error(
1195
1196
  "[VTJ Error]:",
1196
1197
  {
1197
- err: s,
1198
+ err: n,
1198
1199
  instance: r,
1199
1200
  info: o
1200
1201
  },
1201
- s?.stack
1202
- ), T.error({
1202
+ n?.stack
1203
+ ), D.error({
1203
1204
  title: "未处理的异常:请在控制台查看详情",
1204
- message: c
1205
+ message: l
1205
1206
  });
1206
1207
  });
1207
1208
  }
1208
1209
  getFile(e) {
1209
1210
  const { blocks: t = [] } = this.project || {};
1210
- return this.getPage(e) || t.find((s) => s.id === e) || null;
1211
+ return this.getPage(e) || t.find((n) => n.id === e) || null;
1211
1212
  }
1212
1213
  getPage(e) {
1213
- const { pages: t = [] } = this.project || {}, s = (r, o = []) => {
1214
+ const { pages: t = [] } = this.project || {}, n = (r, o = []) => {
1214
1215
  for (const a of o) {
1215
1216
  if (a.id === r)
1216
1217
  return a;
1217
1218
  if (a.children && a.children.length) {
1218
- const i = s(r, a.children);
1219
+ const i = n(r, a.children);
1219
1220
  if (i)
1220
1221
  return i;
1221
1222
  }
1222
1223
  }
1223
1224
  };
1224
- return s(e, t) || null;
1225
+ return n(e, t) || null;
1225
1226
  }
1226
1227
  getHomepage() {
1227
1228
  const { homepage: e } = this.project || {};
@@ -1240,65 +1241,65 @@ class us extends xe {
1240
1241
  validSuccess: !1,
1241
1242
  originResponse: !0
1242
1243
  }
1243
- }).then((s) => s.data).catch(() => null));
1244
+ }).then((n) => n.data).catch(() => null));
1244
1245
  }
1245
1246
  createDslRenderer(e, t = {}) {
1246
- const { library: s, components: r, mode: o, apis: a } = this, i = {
1247
+ const { library: n, components: r, mode: o, apis: a } = this, i = {
1247
1248
  mode: o,
1248
- Vue: s.Vue,
1249
+ Vue: n.Vue,
1249
1250
  components: r,
1250
- libs: s,
1251
+ libs: n,
1251
1252
  apis: a,
1252
1253
  window,
1253
1254
  ...t
1254
- }, c = V({
1255
- getDsl: async (l) => await this.getDsl(l) || null,
1256
- getDslByUrl: async (l) => await this.getDslByUrl(l) || null,
1255
+ }, l = V({
1256
+ getDsl: async (c) => await this.getDsl(c) || null,
1257
+ getDslByUrl: async (c) => await this.getDslByUrl(c) || null,
1257
1258
  options: i
1258
1259
  });
1259
1260
  return J({
1260
1261
  ...i,
1261
1262
  dsl: e,
1262
- loader: c
1263
+ loader: l
1263
1264
  });
1264
1265
  }
1265
1266
  async getRenderComponent(e, t) {
1266
- const s = this.getFile(e);
1267
- if (!s)
1267
+ const n = this.getFile(e);
1268
+ if (!n)
1268
1269
  return I.warn(`Can not find file: ${e}`), null;
1269
- t && t(s);
1270
+ t && t(n);
1270
1271
  const r = `.vtj/vue/${e}.vue`, o = this.modules[r];
1271
1272
  if (o)
1272
1273
  return (await o())?.default;
1273
- const a = await this.getDsl(s.id);
1274
+ const a = await this.getDsl(n.id);
1274
1275
  return a ? this.createDslRenderer(a).renderer : (I.warn(`Can not find dsl: ${e}`), null);
1275
1276
  }
1276
1277
  defineUrlSchemaComponent(e, t) {
1277
1278
  return re(async () => {
1278
- const s = await this.getDslByUrl(e);
1279
- return s ? (s.name = t || s.name, this.createDslRenderer(s).renderer) : null;
1279
+ const n = await this.getDslByUrl(e);
1280
+ return n ? (n.name = t || n.name, this.createDslRenderer(n).renderer) : null;
1280
1281
  });
1281
1282
  }
1282
1283
  definePluginComponent(e) {
1283
1284
  return re(async () => await we(e, window));
1284
1285
  }
1285
1286
  }
1286
- function bs(n) {
1287
- const e = new us(n);
1287
+ function En(s) {
1288
+ const e = new dn(s);
1288
1289
  return {
1289
1290
  provider: e,
1290
- onReady: (s) => e.ready(s)
1291
+ onReady: (n) => e.ready(n)
1291
1292
  };
1292
1293
  }
1293
- function be(n = {}) {
1294
+ function be(s = {}) {
1294
1295
  const e = ue($e);
1295
1296
  if (!e)
1296
1297
  throw new Error("Can not find provider");
1297
1298
  if (e.nodeEnv === "development") {
1298
- const { id: t, version: s } = n;
1299
- t && s && (async () => {
1299
+ const { id: t, version: n } = s;
1300
+ t && n && (async () => {
1300
1301
  const r = await e.getDsl(t);
1301
- r?.__VERSION__ !== s && T.warning({
1302
+ r?.__VERSION__ !== n && D.warning({
1302
1303
  title: r?.name,
1303
1304
  message: "当前组件源码版本与运行时版本不一致,请重新发布组件"
1304
1305
  });
@@ -1312,23 +1313,23 @@ const X = new Be({
1312
1313
  validSuccess: !0,
1313
1314
  originResponse: !1,
1314
1315
  failMessage: !0,
1315
- validate: (n) => n.data?.code === 0,
1316
- showError: (n) => {
1317
- T.error({
1318
- message: n || "未知错误"
1316
+ validate: (s) => s.data?.code === 0,
1317
+ showError: (s) => {
1318
+ D.error({
1319
+ message: s || "未知错误"
1319
1320
  });
1320
1321
  }
1321
1322
  }
1322
- }), ds = (n = "/__vtj__/api/:type.json") => (e, t) => X.send({
1323
- url: n,
1323
+ }), pn = (s = "/__vtj__/api/:type.json") => (e, t) => X.send({
1324
+ url: s,
1324
1325
  method: "post",
1325
1326
  params: { type: e },
1326
1327
  data: {
1327
1328
  type: e,
1328
1329
  data: t
1329
1330
  }
1330
- }), ps = (n = "/__vtj__/api/uploader.json") => async (e, t) => await X.send({
1331
- url: n,
1331
+ }), fn = (s = "/__vtj__/api/uploader.json") => async (e, t) => await X.send({
1332
+ url: s,
1332
1333
  method: "post",
1333
1334
  data: {
1334
1335
  files: e,
@@ -1337,13 +1338,13 @@ const X = new Be({
1337
1338
  settings: {
1338
1339
  type: "data"
1339
1340
  }
1340
- }).then((s) => s && s[0] ? s[0] : null).catch(() => null);
1341
+ }).then((n) => n && n[0] ? n[0] : null).catch(() => null);
1341
1342
  class Z {
1342
1343
  api;
1343
1344
  pluginCaches = {};
1344
1345
  uploader;
1345
1346
  constructor() {
1346
- this.api = ds(), this.uploader = ps();
1347
+ this.api = pn(), this.uploader = fn();
1347
1348
  }
1348
1349
  async getExtension() {
1349
1350
  console.log("BaseService.getExtension");
@@ -1416,11 +1417,11 @@ class Z {
1416
1417
  return await this.api("clearStaticFiles", e).catch(() => "");
1417
1418
  }
1418
1419
  async getPluginMaterial(e) {
1419
- const { urls: t = [] } = e, s = t.filter((o) => tt(o))[0];
1420
- if (!s) return null;
1421
- const r = this.pluginCaches[s];
1422
- return r || (this.pluginCaches[s] = X.send({
1423
- url: s,
1420
+ const { urls: t = [] } = e, n = t.filter((o) => tt(o))[0];
1421
+ if (!n) return null;
1422
+ const r = this.pluginCaches[n];
1423
+ return r || (this.pluginCaches[n] = X.send({
1424
+ url: n,
1424
1425
  method: "get",
1425
1426
  settings: {
1426
1427
  validSuccess: !1,
@@ -1434,9 +1435,9 @@ const y = new Ue({
1434
1435
  expired: 0,
1435
1436
  prefix: "__VTJ_"
1436
1437
  });
1437
- class Es extends Z {
1438
+ class Pn extends Z {
1438
1439
  init(e) {
1439
- const t = new A(e), s = y.get(`project_${t.id}`), r = Object.assign(t.toDsl(), s || {});
1440
+ const t = new A(e), n = y.get(`project_${t.id}`), r = Object.assign(t.toDsl(), n || {});
1440
1441
  return y.save(`project_${t.id}`, r), Promise.resolve(r);
1441
1442
  }
1442
1443
  saveProject(e) {
@@ -1468,30 +1469,30 @@ class Es extends Z {
1468
1469
  return Promise.resolve(!0);
1469
1470
  }
1470
1471
  getHistory(e) {
1471
- const t = y.get(`history_${e}`), s = new ce(t || { id: e });
1472
- return Promise.resolve(s.toDsl());
1472
+ const t = y.get(`history_${e}`), n = new ce(t || { id: e });
1473
+ return Promise.resolve(n.toDsl());
1473
1474
  }
1474
1475
  getHistoryItem(e, t) {
1475
- const s = y.get(`history_${e}_${t}`);
1476
- return Promise.resolve(s);
1476
+ const n = y.get(`history_${e}_${t}`);
1477
+ return Promise.resolve(n);
1477
1478
  }
1478
1479
  saveHistoryItem(e, t) {
1479
1480
  return y.save(`history_${e}_${t.id}`, t), Promise.resolve(!0);
1480
1481
  }
1481
1482
  removeHistoryItem(e, t) {
1482
- return t.forEach((s) => {
1483
- y.remove(`history_${e}_${s}`);
1483
+ return t.forEach((n) => {
1484
+ y.remove(`history_${e}_${n}`);
1484
1485
  }), Promise.resolve(!0);
1485
1486
  }
1486
1487
  }
1487
- class fs extends Z {
1488
+ class hn extends Z {
1488
1489
  projects = {};
1489
1490
  materials = {};
1490
1491
  files = {};
1491
1492
  histories = {};
1492
1493
  historyItems = {};
1493
1494
  init(e) {
1494
- const t = new A(e), s = this.projects[t.id] || {}, r = Object.assign(t.toDsl(), s);
1495
+ const t = new A(e), n = this.projects[t.id] || {}, r = Object.assign(t.toDsl(), n);
1495
1496
  return this.projects[r.id] = r, Promise.resolve(r);
1496
1497
  }
1497
1498
  saveProject(e) {
@@ -1523,29 +1524,29 @@ class fs extends Z {
1523
1524
  return Promise.resolve(!0);
1524
1525
  }
1525
1526
  getHistory(e) {
1526
- const t = this.histories[e], s = new ce(t || { id: e });
1527
- return Promise.resolve(s);
1527
+ const t = this.histories[e], n = new ce(t || { id: e });
1528
+ return Promise.resolve(n);
1528
1529
  }
1529
1530
  getHistoryItem(e, t) {
1530
- const s = `${e}_${t}`, r = this.historyItems[s] || {};
1531
+ const n = `${e}_${t}`, r = this.historyItems[n] || {};
1531
1532
  return Promise.resolve(r);
1532
1533
  }
1533
1534
  saveHistoryItem(e, t) {
1534
- const s = `${e}_${t.id}`;
1535
- return this.historyItems[s] = t, Promise.resolve(!0);
1535
+ const n = `${e}_${t.id}`;
1536
+ return this.historyItems[n] = t, Promise.resolve(!0);
1536
1537
  }
1537
1538
  removeHistoryItem(e, t) {
1538
- return t.forEach((s) => {
1539
- const r = `${e}_${s}`;
1539
+ return t.forEach((n) => {
1540
+ const r = `${e}_${n}`;
1540
1541
  delete this.historyItems[r];
1541
1542
  }), Promise.resolve(!0);
1542
1543
  }
1543
1544
  }
1544
1545
  let F = null;
1545
- function Ps() {
1546
- return F || (F = new fs(), F);
1546
+ function xn() {
1547
+ return F || (F = new hn(), F);
1547
1548
  }
1548
- class xs extends Z {
1549
+ class Rn extends Z {
1549
1550
  getFileCaches = {};
1550
1551
  async getExtension() {
1551
1552
  return await this.api("getExtension", {}).catch(() => {
@@ -1600,56 +1601,56 @@ class xs extends Z {
1600
1601
  );
1601
1602
  }
1602
1603
  }
1603
- function Ee(n = []) {
1604
- return n.map((e) => {
1605
- const { id: t, title: s, icon: r, children: o, hidden: a } = e;
1604
+ function Ee(s, e = []) {
1605
+ return e.map((t) => {
1606
+ const { id: n, title: r, icon: o, children: a, hidden: i } = t;
1606
1607
  return {
1607
- id: t,
1608
- title: s,
1609
- icon: r,
1610
- hidden: a,
1611
- url: `/page/${t}`,
1612
- children: o && o.length ? Ee(o) : void 0
1608
+ id: n,
1609
+ title: r,
1610
+ icon: o,
1611
+ hidden: i,
1612
+ url: `${s}/${n}`,
1613
+ children: a && a.length ? Ee(s, a) : void 0
1613
1614
  };
1614
1615
  });
1615
1616
  }
1616
- function Pe(n, e) {
1617
- if (!e) return n;
1617
+ function Pe(s, e) {
1618
+ if (!e) return s;
1618
1619
  let t = [];
1619
- for (const s of n)
1620
- if (s.children && s.children.length) {
1621
- const r = Pe(s.children, e);
1622
- r.length && (s.children = r, t.push(s));
1620
+ for (const n of s)
1621
+ if (n.children && n.children.length) {
1622
+ const r = Pe(n.children, e);
1623
+ r.length && (n.children = r, t.push(n));
1623
1624
  } else
1624
- e[s.id] && t.push(s);
1625
+ e.can(n.id.toString()) && t.push(n);
1625
1626
  return t;
1626
1627
  }
1627
- function Rs() {
1628
- const n = be(), e = he(), t = vt(), s = O(!1), r = O(!1), o = t?.getData(), a = n.project;
1628
+ function kn(s) {
1629
+ const { menuBasePath: e = "/page" } = s || {}, t = be(), n = he(), r = vt(), o = O(!1), a = O(!1), i = t.project;
1629
1630
  Qe(() => {
1630
- const { name: l, params: f, meta: d } = e;
1631
- if (l === W) {
1632
- const u = n.getPage(f.id);
1633
- s.value = !u?.mask, r.value = !!u?.pure;
1634
- } else if (l === me) {
1635
- const u = n.getHomepage();
1636
- s.value = !u?.mask, r.value = !!u?.pure;
1631
+ const { name: f, params: d, meta: u } = n;
1632
+ if (f === W) {
1633
+ const h = t.getPage(d.id);
1634
+ o.value = !h?.mask, a.value = !!h?.pure;
1635
+ } else if (f === me) {
1636
+ const h = t.getHomepage();
1637
+ o.value = !h?.mask, a.value = !!h?.pure;
1637
1638
  } else
1638
- s.value = !d.mask, r.value = !!d.pure;
1639
+ o.value = !u.mask, a.value = !!u.pure;
1639
1640
  });
1640
- const i = Ee(a?.pages), c = a?.config;
1641
+ const l = Ee(e, i?.pages), c = i?.config;
1641
1642
  return {
1642
- disabled: s,
1643
+ disabled: o,
1643
1644
  logo: c?.logo,
1644
1645
  themeSwitchable: c?.themeSwitchable,
1645
- title: c?.title || a?.description || a?.name || "VTJ App",
1646
- menus: Pe(i, o?.permissions),
1647
- pure: r
1646
+ title: c?.title || i?.description || i?.name || "VTJ App",
1647
+ menus: Pe(l, r),
1648
+ pure: a
1648
1649
  };
1649
1650
  }
1650
1651
  export {
1651
1652
  _e as ACCESS_KEY,
1652
- $s as Access,
1653
+ bn as Access,
1653
1654
  Ze as BUILT_IN_DIRECTIVES,
1654
1655
  Z as BaseService,
1655
1656
  oe as CONTEXT_HOST,
@@ -1657,24 +1658,24 @@ export {
1657
1658
  _ as ContextMode,
1658
1659
  et as DATA_TYPES,
1659
1660
  me as HOMEPAGE_ROUTE_NAME,
1660
- js as JSCodeToString,
1661
- _s as LIFE_CYCLES_LIST,
1662
- xs as LocalService,
1663
- fs as MemoryService,
1664
- ls as NodeEnv,
1661
+ $n as JSCodeToString,
1662
+ wn as LIFE_CYCLES_LIST,
1663
+ Rn as LocalService,
1664
+ hn as MemoryService,
1665
+ un as NodeEnv,
1665
1666
  W as PAGE_ROUTE_NAME,
1666
- us as Provider,
1667
- as as Startup,
1668
- Es as StorageService,
1667
+ dn as Provider,
1668
+ cn as Startup,
1669
+ Pn as StorageService,
1669
1670
  R as VTJ_RENDERER_VERSION,
1670
1671
  ve as adoptedStyleSheets,
1671
- ws as createAssetScripts,
1672
- Ss as createAssetsCss,
1672
+ Sn as createAssetScripts,
1673
+ jn as createAssetsCss,
1673
1674
  Et as createDataSources,
1674
1675
  V as createLoader,
1675
- Ps as createMemoryService,
1676
+ xn as createMemoryService,
1676
1677
  pt as createMetaApi,
1677
- bs as createProvider,
1678
+ En as createProvider,
1678
1679
  J as createRenderer,
1679
1680
  dt as createSchemaApi,
1680
1681
  ft as createSchemaApis,
@@ -1696,14 +1697,14 @@ export {
1696
1697
  mt as mockApi,
1697
1698
  ht as mockApis,
1698
1699
  ye as mockCleanup,
1699
- D as nodeRender,
1700
- nt as parseDeps,
1700
+ M as nodeRender,
1701
+ st as parseDeps,
1701
1702
  k as parseExpression,
1702
1703
  ie as parseFunction,
1703
1704
  $e as providerKey,
1704
- st as removeProdFlag,
1705
+ nt as removeProdFlag,
1705
1706
  ge as toString,
1706
1707
  vt as useAccess,
1707
- Rs as useMask,
1708
+ kn as useMask,
1708
1709
  be as useProvider
1709
1710
  };