@vtj/renderer 0.9.15 → 0.9.16

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 Ae, BUILT_IN_COMPONENTS as Ie, ProjectModel as H, HistoryModel as ue } from "@vtj/core";
2
- import { isUrl as Me, url as k, dedupArray as De, isString as j, isFunction as V, logger as P, storage as U, cookie as L, toArray as re, unRSA as oe, delay as pe, createRequest as de, jsonp as fe, merge as He, pathToRegexp as Oe, pathToRegexpMatch as Be, formDataToJson as Ne, camelCase as $, upperFirst as Ue, pick as Le, request as z, loadScript as ie, Storage as qe, mapToObject as Q } from "@vtj/utils";
2
+ import { isUrl as Me, url as R, dedupArray as De, isString as j, isFunction as V, logger as x, storage as U, cookie as L, toArray as re, unRSA as oe, delay as de, createRequest as pe, jsonp as fe, merge as He, pathToRegexp as Oe, pathToRegexpMatch as Be, formDataToJson as Ne, camelCase as $, upperFirst as Ue, pick as Le, request as z, loadScript as ie, Storage as qe, mapToObject as Q } from "@vtj/utils";
3
3
  import * as B from "vue";
4
- import { inject as he, toRef as Je, readonly as Ve, customRef as ze, ref as F, onBeforeUnmount as Ke, getCurrentScope as We, onScopeDispose as Ge, unref as Ye, getCurrentInstance as me, watch as ge, computed as ve, onMounted as Qe, defineComponent as X, h as K, openBlock as Xe, createElementBlock as Ze, createElementVNode as R, toDisplayString as q, defineAsyncComponent as ae, watchEffect as et } from "vue";
5
- import E from "mockjs";
4
+ import { inject as he, toRef as Je, readonly as Ve, customRef as ze, ref as F, onBeforeUnmount as Ke, getCurrentScope as We, onScopeDispose as Ge, unref as Ye, getCurrentInstance as me, watch as ge, computed as ve, onMounted as Qe, defineComponent as X, h as K, openBlock as Xe, createElementBlock as Ze, createElementVNode as E, toDisplayString as q, defineAsyncComponent as ae, watchEffect as et } from "vue";
5
+ import k from "mockjs";
6
6
  import { useRoute as ye } from "vue-router";
7
7
  /**!
8
8
  * Copyright (c) 2025, VTJ.PRO All rights reserved.
9
9
  * @name @vtj/renderer
10
10
  * @author CHC chenhuachun1549@dingtalk.com
11
- * @version 0.9.15
11
+ * @version 0.9.16
12
12
  * @license <a href="https://vtj.pro/license.html">MIT License</a>
13
13
  */
14
- const x = "0.9.15";
15
- var y = /* @__PURE__ */ ((n) => (n.Runtime = "Runtime", n.Design = "Design", n.Raw = "Raw", n.VNode = "VNode", n))(y || {});
14
+ const P = "0.9.16";
15
+ var y = /* @__PURE__ */ ((s) => (s.Runtime = "Runtime", s.Design = "Design", s.Raw = "Raw", s.VNode = "VNode", s))(y || {});
16
16
  const ce = [
17
17
  "$el",
18
18
  "$emit",
@@ -25,7 +25,7 @@ const ce = [
25
25
  "$props",
26
26
  "$options",
27
27
  "$forceUpdate"
28
- ], ks = [
28
+ ], xn = [
29
29
  "beforeCreate",
30
30
  "created",
31
31
  "beforeMount",
@@ -46,7 +46,7 @@ const ce = [
46
46
  "vFor",
47
47
  "vBind",
48
48
  "vHtml"
49
- ], st = {
49
+ ], nt = {
50
50
  String,
51
51
  Number,
52
52
  Boolean,
@@ -54,41 +54,41 @@ const ce = [
54
54
  Object,
55
55
  Function,
56
56
  Date
57
- }, C = "VtjPage", D = "VtjHomepage", nt = "html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot".split(
57
+ }, C = "VtjPage", D = "VtjHomepage", st = "html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot".split(
58
58
  ","
59
59
  ), rt = "component,slot".split(",");
60
- function I(n, e) {
61
- return n.map((t) => Me(t) || t.startsWith("/") ? t : `${e}${t}`);
60
+ function I(s, e) {
61
+ return s.map((t) => Me(t) || t.startsWith("/") ? t : `${e}${t}`);
62
62
  }
63
- function Z(n) {
64
- return /\.css$/.test(n);
63
+ function Z(s) {
64
+ return /\.css$/.test(s);
65
65
  }
66
- function ee(n) {
67
- return /\.js$/.test(n);
66
+ function ee(s) {
67
+ return /\.js$/.test(s);
68
68
  }
69
- function ot(n) {
70
- return /\.json$/.test(n);
69
+ function ot(s) {
70
+ return /\.json$/.test(s);
71
71
  }
72
- function Ps(n) {
73
- return n.map(
74
- (e) => `<script src="${k.append(e, { v: x })}"><\/script>`
72
+ function Pn(s) {
73
+ return s.map(
74
+ (e) => `<script src="${R.append(e, { v: P })}"><\/script>`
75
75
  ).join("");
76
76
  }
77
- function xs(n = []) {
78
- return n.map(
79
- (e) => `<link rel="stylesheet" href="${k.append(e, { v: x })}" />`
77
+ function Cn(s = []) {
78
+ return s.map(
79
+ (e) => `<link rel="stylesheet" href="${R.append(e, { v: P })}" />`
80
80
  ).join("");
81
81
  }
82
- function it(n, e = !1) {
83
- return e && n.endsWith(".prod.js") ? n.replace(".prod.js", ".js") : n;
82
+ function it(s, e = !1) {
83
+ return e && s.endsWith(".prod.js") ? s.replace(".prod.js", ".js") : s;
84
84
  }
85
- function at(n, e, t = !1) {
86
- const s = n.filter((p) => !!p.enabled), r = [], o = [], a = [], i = [], c = {}, l = {}, f = [], u = {};
87
- return s.forEach(
88
- ({ urls: p, assetsUrl: h, library: m, assetsLibrary: d, localeLibrary: w }) => {
89
- p?.forEach((g) => {
85
+ function at(s, e, t = !1) {
86
+ const n = s.filter((d) => !!d.enabled), r = [], o = [], a = [], i = [], c = {}, l = {}, f = [], u = {};
87
+ return n.forEach(
88
+ ({ urls: d, assetsUrl: h, library: m, assetsLibrary: p, localeLibrary: w }) => {
89
+ d?.forEach((g) => {
90
90
  ee(g) && r.push(it(g, t)), Z(g) && o.push(g);
91
- }), m && (i.push(m), c[m] = I(p || [], e), w && (l[m] = w)), h && a.push(h), d && f.push(d), m && d && (u[d] = m);
91
+ }), m && (i.push(m), c[m] = I(d || [], e), w && (l[m] = w)), h && a.push(h), p && f.push(p), m && p && (u[p] = m);
92
92
  }
93
93
  ), {
94
94
  scripts: I(r, e),
@@ -101,46 +101,46 @@ function at(n, e, t = !1) {
101
101
  libraryLocaleMap: l
102
102
  };
103
103
  }
104
- function ct(n, e) {
105
- const { name: t, parent: s, alias: r } = n;
106
- return s ? e[s]?.[r || t] : e[r || t];
104
+ function ct(s, e) {
105
+ const { name: t, parent: n, alias: r } = s;
106
+ return n ? e[n]?.[r || t] : e[r || t];
107
107
  }
108
- function _e(n) {
109
- return j(n) ? n : JSON.stringify(n);
108
+ function _e(s) {
109
+ return j(s) ? s : JSON.stringify(s);
110
110
  }
111
- function we(n, e, t) {
112
- const s = n.CSSStyleSheet;
113
- if (s.prototype.replaceSync) {
114
- const r = new s();
111
+ function we(s, e, t) {
112
+ const n = s.CSSStyleSheet;
113
+ if (n.prototype.replaceSync) {
114
+ const r = new n();
115
115
  r.id = e, r.replaceSync(t);
116
- const o = n.document, a = o.adoptedStyleSheets, i = Array.from(a).filter(
116
+ const o = s.document, a = o.adoptedStyleSheets, i = Array.from(a).filter(
117
117
  (c) => c.id !== e
118
118
  );
119
119
  o.adoptedStyleSheets = [...i, r];
120
120
  } else {
121
- const r = n.document;
121
+ const r = s.document;
122
122
  let o = r.getElementById(e);
123
123
  o ? o.innerHTML = t : (o = r.createElement("style"), o.id = e, o.innerHTML = t, r.head.appendChild(o));
124
124
  }
125
125
  }
126
- async function lt(n, e) {
127
- const t = await window.fetch(e).then((s) => s.text()).catch(() => "");
128
- t && we(window, n, t);
126
+ async function lt(s, e) {
127
+ const t = await window.fetch(e).then((n) => n.text()).catch(() => "");
128
+ t && we(window, s, t);
129
129
  }
130
- function ut(n, e = window) {
131
- const t = e.document, s = e.document.head;
132
- for (const r of n)
130
+ function ut(s, e = window) {
131
+ const t = e.document, n = e.document.head;
132
+ for (const r of s)
133
133
  if (!t.getElementById(r)) {
134
134
  const a = t.createElement("link");
135
- a.rel = "stylesheet", a.id = r, a.href = r, s.appendChild(a);
135
+ a.rel = "stylesheet", a.id = r, a.href = r, n.appendChild(a);
136
136
  }
137
137
  }
138
- async function pt(n, e, t = window) {
139
- const s = t.document, r = t.document.head;
138
+ async function dt(s, e, t = window) {
139
+ const n = t.document, r = t.document.head;
140
140
  let o = t[e];
141
141
  return o ? o.default || o : new Promise((a, i) => {
142
- for (const c of n) {
143
- const l = s.createElement("script");
142
+ for (const c of s) {
143
+ const l = n.createElement("script");
144
144
  l.src = c, l.onload = () => {
145
145
  o = t[e], o ? a(o.default || o) : i(null);
146
146
  }, l.onerror = (f) => {
@@ -149,51 +149,51 @@ async function pt(n, e, t = window) {
149
149
  }
150
150
  });
151
151
  }
152
- function dt(n) {
153
- return V(n) || V(n?.install);
152
+ function pt(s) {
153
+ return V(s) || V(s?.install);
154
154
  }
155
- function ft(n) {
156
- return rt.includes(n);
155
+ function ft(s) {
156
+ return rt.includes(s);
157
157
  }
158
- function ht(n) {
159
- return nt.includes(n);
158
+ function ht(s) {
159
+ return st.includes(s);
160
160
  }
161
- function T(n, e, t = !1, s = !1) {
161
+ function T(s, e, t = !1, n = !1) {
162
162
  try {
163
163
  const r = ['"use strict";', "var __self = arguments[0];"];
164
164
  r.push("return ");
165
- let o = (n.value || "").trim();
165
+ let o = (s.value || "").trim();
166
166
  o = o.replace(/this(\W|$)/g, (i, c) => `__self${c}`), o = r.join(`
167
167
  `) + o;
168
168
  const a = `with(${t ? "{}" : "$scope || {}"}) { ${o} }`;
169
169
  return new Function("$scope", a)(e);
170
170
  } catch (r) {
171
- if (P.error("parseExpression.error", r, n, e?.__self ?? e), s)
171
+ if (x.error("parseExpression.error", r, s, e?.__self ?? e), n)
172
172
  throw r;
173
173
  }
174
174
  }
175
- function W(n, e, t = !1, s = !1) {
176
- const r = T(n, e, t, s);
177
- if (typeof r != "function" && (P.error(
175
+ function W(s, e, t = !1, n = !1) {
176
+ const r = T(s, e, t, n);
177
+ if (typeof r != "function" && (x.error(
178
178
  "parseFunction.error",
179
179
  "not a function",
180
- n,
180
+ s,
181
181
  e?.__self ?? e
182
- ), s))
183
- throw new Error(`"${n.value}" not a function`);
182
+ ), n))
183
+ throw new Error(`"${s.value}" not a function`);
184
184
  return r;
185
185
  }
186
- function _(n) {
187
- return n && n.type === "JSExpression";
186
+ function _(s) {
187
+ return s && s.type === "JSExpression";
188
188
  }
189
- function A(n) {
190
- return typeof n == "object" && n && n.type === "JSFunction";
189
+ function A(s) {
190
+ return typeof s == "object" && s && s.type === "JSFunction";
191
191
  }
192
- function mt(n) {
193
- return _(n) || A(n);
192
+ function mt(s) {
193
+ return _(s) || A(s);
194
194
  }
195
- function Cs(n) {
196
- return mt(n) ? n.value : JSON.stringify(n);
195
+ function Fn(s) {
196
+ return mt(s) ? s.value : JSON.stringify(s);
197
197
  }
198
198
  const gt = {
199
199
  session: !1,
@@ -208,7 +208,7 @@ const gt = {
208
208
  noPermissionMessage: "无权限访问该页面",
209
209
  appName: ""
210
210
  }, Se = Symbol("access");
211
- class Fs {
211
+ class Tn {
212
212
  options;
213
213
  data = null;
214
214
  mode = y.Raw;
@@ -216,22 +216,22 @@ class Fs {
216
216
  this.options = Object.assign({}, gt, e), this.loadData();
217
217
  }
218
218
  connect(e) {
219
- const { mode: t, router: s, request: r } = e;
220
- this.mode = t, s && this.mode === y.Raw && this.setGuard(s), r && this.setRequest(r);
219
+ const { mode: t, router: n, request: r } = e;
220
+ this.mode = t, n && this.mode === y.Raw && this.setGuard(n), r && this.setRequest(r);
221
221
  }
222
222
  login(e) {
223
- const { storageKey: t, storagePrefix: s, session: r, authKey: o } = this.options;
223
+ const { storageKey: t, storagePrefix: n, session: r, authKey: o } = this.options;
224
224
  this.setData(e), this.data && (U.save(t, e, {
225
225
  type: "local",
226
- prefix: s
226
+ prefix: n
227
227
  }), r && L.set(o, this.data.token));
228
228
  }
229
229
  clear() {
230
- const { storageKey: e, storagePrefix: t, session: s, authKey: r } = this.options;
230
+ const { storageKey: e, storagePrefix: t, session: n, authKey: r } = this.options;
231
231
  this.data = null, U.remove(e, {
232
232
  type: "local",
233
233
  prefix: t
234
- }), s && L.remove(r);
234
+ }), n && L.remove(r);
235
235
  }
236
236
  logout() {
237
237
  this.clear(), this.toLogin();
@@ -243,20 +243,20 @@ class Fs {
243
243
  return this.data || this.loadData(), this.data?.token;
244
244
  }
245
245
  can(e) {
246
- const { appName: t } = this.options, { permissions: s = {} } = this.data || {};
247
- return typeof e == "function" ? e(s) : re(e).every((o) => s[o] || s[t + "." + o]);
246
+ const { appName: t } = this.options, { permissions: n = {} } = this.data || {};
247
+ return typeof e == "function" ? e(n) : re(e).every((o) => n[o] || n[t + "." + o]);
248
248
  }
249
249
  some(e) {
250
- const { appName: t } = this.options, { permissions: s = {} } = this.data || {};
251
- return re(e).some((o) => s[o] || s[t + "." + o]);
250
+ const { appName: t } = this.options, { permissions: n = {} } = this.data || {};
251
+ return re(e).some((o) => n[o] || n[t + "." + o]);
252
252
  }
253
253
  install(e) {
254
254
  e.config.globalProperties.$access || (e.config.globalProperties.$access = this), e.provide(Se, this);
255
255
  }
256
256
  isAuthPath(e) {
257
- const { auth: t, isAuth: s } = this.options;
258
- if (s)
259
- return s(e);
257
+ const { auth: t, isAuth: n } = this.options;
258
+ if (n)
259
+ return n(e);
260
260
  if (e.path && typeof t == "string") {
261
261
  const r = t.split("#")[1] || t;
262
262
  return e.path === r;
@@ -266,32 +266,32 @@ class Fs {
266
266
  toLogin() {
267
267
  const { auth: e, redirectParam: t } = this.options;
268
268
  if (!e) return;
269
- const s = t ? `?${t}=${encodeURIComponent(location.href)}` : "";
270
- typeof e == "function" ? e(s) : location.href = t ? `${e}${s}` : e;
269
+ const n = t ? `?${t}=${encodeURIComponent(location.href)}` : "";
270
+ typeof e == "function" ? e(n) : location.href = t ? `${e}${n}` : e;
271
271
  }
272
272
  setData(e) {
273
273
  const { privateKey: t } = this.options;
274
274
  if (Array.isArray(e) && t) {
275
- const s = e.map((r) => oe(r, t));
276
- this.data = JSON.parse(s.join(""));
275
+ const n = e.map((r) => oe(r, t));
276
+ this.data = JSON.parse(n.join(""));
277
277
  return;
278
278
  }
279
279
  if (typeof e == "string")
280
280
  try {
281
- const s = t ? oe(e, t) : e;
282
- s ? this.data = JSON.parse(s) : console.warn("RSA解密失败或登录信息缺失");
283
- } catch (s) {
284
- console.warn(s);
281
+ const n = t ? oe(e, t) : e;
282
+ n ? this.data = JSON.parse(n) : console.warn("RSA解密失败或登录信息缺失");
283
+ } catch (n) {
284
+ console.warn(n);
285
285
  }
286
286
  else
287
287
  this.data = e;
288
288
  }
289
289
  loadData() {
290
- const { storageKey: e, storagePrefix: t } = this.options, s = U.get(e, {
290
+ const { storageKey: e, storagePrefix: t } = this.options, n = U.get(e, {
291
291
  type: "local",
292
292
  prefix: t
293
293
  });
294
- this.setData(s || null);
294
+ this.setData(n || null);
295
295
  }
296
296
  isLogined() {
297
297
  const { session: e, authKey: t } = this.options;
@@ -305,7 +305,7 @@ class Fs {
305
305
  return !0;
306
306
  }
307
307
  setGuard(e) {
308
- e.beforeEach((t, s, r) => this.guard(t, r));
308
+ e.beforeEach((t, n, r) => this.guard(t, r));
309
309
  }
310
310
  async guard(e, t) {
311
311
  if (this.isWhiteList(e) || this.isAuthPath(e))
@@ -314,15 +314,15 @@ class Fs {
314
314
  if (this.hasRoutePermission(e))
315
315
  return t();
316
316
  {
317
- const { noPermissionMessage: s = "无权限访问", unauthorized: r = !1 } = this.options;
318
- return await this.showTip(s), V(r) ? (r(), t(!1)) : j(r) ? t(r) : t(!1);
317
+ const { noPermissionMessage: n = "无权限访问", unauthorized: r = !1 } = this.options;
318
+ return await this.showTip(n), V(r) ? (r(), t(!1)) : j(r) ? t(r) : t(!1);
319
319
  }
320
320
  }
321
321
  t(!1), this.toLogin();
322
322
  }
323
323
  isWhiteList(e) {
324
324
  const { whiteList: t } = this.options;
325
- return t ? Array.isArray(t) ? t.some((s) => e.fullPath.startsWith(s)) : t(e) : !1;
325
+ return t ? Array.isArray(t) ? t.some((n) => e.fullPath.startsWith(n)) : t(e) : !1;
326
326
  }
327
327
  isUnauthorized(e) {
328
328
  const { unauthorizedCode: t = 401 } = this.options;
@@ -334,7 +334,7 @@ class Fs {
334
334
  }
335
335
  async showTip(e) {
336
336
  const { alert: t } = this.options;
337
- return t ? (await pe(150), await t(e, {
337
+ return t ? (await de(150), await t(e, {
338
338
  title: "提示",
339
339
  type: "warning"
340
340
  }).catch(() => !1)) : !1;
@@ -343,8 +343,8 @@ class Fs {
343
343
  e.useRequest((t) => (this.data?.token && (t.headers[this.options.authKey] = this.data?.token), t)), e.useResponse(
344
344
  async (t) => (await this.showUnauthorizedAlert(t), t),
345
345
  async (t) => {
346
- const s = t.response || t || {};
347
- return await this.showUnauthorizedAlert(s), Promise.reject(t);
346
+ const n = t.response || t || {};
347
+ return await this.showUnauthorizedAlert(n), Promise.reject(t);
348
348
  }
349
349
  );
350
350
  }
@@ -352,11 +352,11 @@ class Fs {
352
352
  function vt() {
353
353
  return he(Se, null);
354
354
  }
355
- function Ts(n = {}) {
356
- const { notify: e, loading: t, settings: s = {} } = n;
355
+ function An(s = {}) {
356
+ const { notify: e, loading: t, settings: n = {} } = s;
357
357
  let r = null;
358
358
  return {
359
- request: de({
359
+ request: pe({
360
360
  settings: {
361
361
  type: "form",
362
362
  validSuccess: !0,
@@ -373,7 +373,7 @@ function Ts(n = {}) {
373
373
  hideLoading: () => {
374
374
  r && (r.close(), r = null);
375
375
  },
376
- ...s
376
+ ...n
377
377
  }
378
378
  }),
379
379
  jsonp: fe,
@@ -381,74 +381,74 @@ function Ts(n = {}) {
381
381
  loading: t
382
382
  };
383
383
  }
384
- function yt(n, e) {
385
- const { jsonp: t, request: s } = e;
386
- if (n.method === "jsonp")
387
- return (r = {}) => t(n.url, {
388
- ...n.jsonpOptions,
384
+ function yt(s, e) {
385
+ const { jsonp: t, request: n } = e;
386
+ if (s.method === "jsonp")
387
+ return (r = {}) => t(s.url, {
388
+ ...s.jsonpOptions,
389
389
  query: r
390
390
  });
391
391
  {
392
- const r = n.headers ? T(n.headers, {}, !0) : void 0, o = {
393
- url: n.url,
394
- method: n.method,
392
+ const r = s.headers ? T(s.headers, {}, !0) : void 0, o = {
393
+ url: s.url,
394
+ method: s.method,
395
395
  settings: {
396
- ...n.settings,
396
+ ...s.settings,
397
397
  headers: r
398
398
  }
399
399
  };
400
- return (a, i) => (delete o.data, s.send(He(o, i || {}, { data: a })));
400
+ return (a, i) => (delete o.data, n.send(He(o, i || {}, { data: a })));
401
401
  }
402
402
  }
403
- function _t(n, e) {
403
+ function _t(s, e) {
404
404
  const { metaQuery: t } = e;
405
405
  if (!t) return;
406
- const { code: s, queryCode: r } = n;
406
+ const { code: n, queryCode: r } = s;
407
407
  return (o, a) => {
408
408
  if (!t) {
409
409
  console.warn("adapter.metaQuery is not defined!");
410
410
  return;
411
411
  }
412
- return t(s, r, o, a);
412
+ return t(n, r, o, a);
413
413
  };
414
414
  }
415
- function wt(n = [], e = [], t) {
416
- const s = {};
417
- for (const r of n)
418
- s[r.id] = yt(r, t);
415
+ function wt(s = [], e = [], t) {
416
+ const n = {};
417
+ for (const r of s)
418
+ n[r.id] = yt(r, t);
419
419
  for (const r of e)
420
- s[r.id] = _t(r, t);
421
- return s;
420
+ n[r.id] = _t(r, t);
421
+ return n;
422
422
  }
423
- async function St(n = []) {
424
- E && (be(), n.forEach((e) => jt(E, e)));
423
+ async function St(s = []) {
424
+ k && (be(), s.forEach((e) => jt(k, e)));
425
425
  }
426
- function bt(n) {
427
- const e = A(n.mockTemplate) && n.mockTemplate.value ? W(n.mockTemplate, {}, !0) : void 0;
426
+ function bt(s) {
427
+ const e = A(s.mockTemplate) && s.mockTemplate.value ? W(s.mockTemplate, {}, !0) : void 0;
428
428
  return async (...t) => {
429
- let s = {};
429
+ let n = {};
430
430
  if (e)
431
431
  try {
432
- s = await e.apply(e, t);
432
+ n = await e.apply(e, t);
433
433
  } catch (r) {
434
- P.warn("模拟数据模版异常", r);
434
+ x.warn("模拟数据模版异常", r);
435
435
  }
436
- return E.mock(s);
436
+ return k.mock(n);
437
437
  };
438
438
  }
439
- function jt(n, e) {
439
+ function jt(s, e) {
440
440
  if (!e.mock) return;
441
- const { url: t, mockTemplate: s } = e;
442
- if (t && s) {
443
- const r = Oe(`${t}(.*)`), o = Be(t, { decode: decodeURIComponent }), a = T(s, {}, !0);
444
- n.mock(r, (i) => {
445
- const c = k.parse(i.url) || {}, l = i.body instanceof FormData ? Ne(i.body) : i.body, f = o(i.url)?.params;
446
- return Object.assign(i, { data: l, params: c, query: f }), n.mock(a(i));
441
+ const { url: t, mockTemplate: n } = e;
442
+ if (t && n) {
443
+ const r = Oe(`${t}(.*)`), o = Be(t, { decode: decodeURIComponent }), a = T(n, {}, !0);
444
+ s.mock(r, (i) => {
445
+ const c = R.parse(i.url) || {}, l = i.body instanceof FormData ? Ne(i.body) : i.body, f = o(i.url)?.params;
446
+ return Object.assign(i, { data: l, params: c, query: f }), s.mock(a(i));
447
447
  });
448
448
  }
449
449
  }
450
450
  function be() {
451
- E && (E._mocked = {});
451
+ k && (k._mocked = {});
452
452
  }
453
453
  class $t {
454
454
  __id = null;
@@ -476,14 +476,14 @@ class $t {
476
476
  $apis = {};
477
477
  __transform = {};
478
478
  constructor(e) {
479
- const { mode: t, dsl: s, attrs: r } = e;
480
- this.__mode = t, s && (this.__id = s.id || null, this.__transform = s.transform || {}), r && Object.assign(this, r);
479
+ const { mode: t, dsl: n, attrs: r } = e;
480
+ this.__mode = t, n && (this.__id = n.id || null, this.__transform = n.transform || {}), r && Object.assign(this, r);
481
481
  }
482
482
  setup(e, t = B) {
483
- const s = t.getCurrentInstance();
484
- if (!s) return;
485
- this.__refs = {}, this.$refs = {}, this.context = {}, this.__contextRefs = {}, this.__instance = s.proxy;
486
- const r = s.appContext.config.globalProperties;
483
+ const n = t.getCurrentInstance();
484
+ if (!n) return;
485
+ this.__refs = {}, this.$refs = {}, this.context = {}, this.__contextRefs = {}, this.__instance = n.proxy;
486
+ const r = n.appContext.config.globalProperties;
487
487
  Object.assign(this, r), Object.assign(this, e || {}), this.__proxy(), t.onMounted(() => {
488
488
  this.__proxy();
489
489
  }), t.onUnmounted(() => {
@@ -508,57 +508,57 @@ class $t {
508
508
  __parseFunction(e) {
509
509
  if (e)
510
510
  if (this.__mode === y.Runtime) {
511
- const { id: t, type: s } = e, r = t ? this.__transform[t] ?? e.value : e.value;
512
- return W({ type: s, value: r }, this);
511
+ const { id: t, type: n } = e, r = t ? this.__transform[t] ?? e.value : e.value;
512
+ return W({ type: n, value: r }, this);
513
513
  } else
514
514
  return W(e, this);
515
515
  }
516
516
  __parseExpression(e) {
517
517
  if (e)
518
518
  if (this.__mode === y.Runtime) {
519
- const { id: t, type: s } = e, r = t ? this.__transform[t] ?? e.value : e.value;
520
- return T({ type: s, value: r }, this);
519
+ const { id: t, type: n } = e, r = t ? this.__transform[t] ?? e.value : e.value;
520
+ return T({ type: n, value: r }, this);
521
521
  } else
522
522
  return T(e, this);
523
523
  }
524
524
  __ref(e = null, t) {
525
525
  if (this.__mode !== y.VNode)
526
- return e && e !== this.__id && (this.__contextRefs[e] = this), async (s) => {
527
- await pe(0);
528
- let r = s?.$vtjEl || s?.$el || s?._?.vnode?.el || s;
526
+ return e && e !== this.__id && (this.__contextRefs[e] = this), async (n) => {
527
+ await de(0);
528
+ let r = n?.$vtjEl || n?.$el || n?._?.vnode?.el || n;
529
529
  if (!r) {
530
530
  typeof t == "string" && (delete this.$refs[t], e && delete this.__refs[e]);
531
531
  return;
532
532
  }
533
- return r.nodeType === 3 && r.nextSibling && (r = r.nextSibling), r.__vtj__ = e, y.Design === this.__mode && (r.__context__ = this, r.draggable = !0), e && (this.__refs[e] = this.__getRefEl(this.__refs, e, s)), typeof t == "function" ? t(s) : t && (this.$refs[t] = this.__getRefEl(this.$refs, t, s)), s;
533
+ return r.nodeType === 3 && r.nextSibling && (r = r.nextSibling), r.__vtj__ = e, y.Design === this.__mode && (r.__context__ = this, r.draggable = !0), e && (this.__refs[e] = this.__getRefEl(this.__refs, e, n)), typeof t == "function" ? t(n) : t && (this.$refs[t] = this.__getRefEl(this.$refs, t, n)), n;
534
534
  };
535
535
  }
536
- __getRefEl(e, t, s) {
536
+ __getRefEl(e, t, n) {
537
537
  const r = e[t];
538
- if (r && s !== r) {
539
- const o = new Set([].concat(r, s));
538
+ if (r && n !== r) {
539
+ const o = new Set([].concat(r, n));
540
540
  return Array.from(o);
541
541
  } else
542
- return s;
542
+ return n;
543
543
  }
544
544
  __clone(e = {}) {
545
- const t = { ...this.context, ...e }, s = {
545
+ const t = { ...this.context, ...e }, n = {
546
546
  ...t,
547
547
  context: t
548
548
  };
549
- return s.context.__proto__ = this.context, s.__proto__ = this, s;
549
+ return n.context.__proto__ = this.context, n.__proto__ = this, n;
550
550
  }
551
551
  }
552
- function G(n) {
552
+ function G(s) {
553
553
  const {
554
554
  Vue: e = B,
555
555
  mode: t = y.Runtime,
556
- components: s = {},
556
+ components: n = {},
557
557
  libs: r = {},
558
558
  apis: o = {},
559
559
  loader: a
560
- } = n, i = e.computed(() => n.dsl), c = {
561
- $components: s,
560
+ } = s, i = e.computed(() => s.dsl), c = {
561
+ $components: n,
562
562
  $libs: r,
563
563
  $apis: o
564
564
  }, l = new $t({
@@ -568,22 +568,22 @@ function G(n) {
568
568
  }), f = e.defineComponent({
569
569
  name: i.value.name,
570
570
  props: {
571
- ...Rt(i.value.props ?? [], l)
571
+ ...kt(i.value.props ?? [], l)
572
572
  },
573
573
  setup(u) {
574
574
  l.$props = u, l.props = u, i.value.id && we(
575
- n.window || window,
575
+ s.window || window,
576
576
  i.value.id,
577
577
  i.value.css || ""
578
- ), l.state = kt(e, i.value.state ?? {}, l);
579
- const p = Pt(e, i.value.computed ?? {}, l), h = xt(i.value.methods ?? {}, l), m = Ct(e, i.value.inject, l), d = Ft(
578
+ ), l.state = Rt(e, i.value.state ?? {}, l);
579
+ const d = xt(e, i.value.computed ?? {}, l), h = Pt(i.value.methods ?? {}, l), m = Ct(e, i.value.inject, l), p = Ft(
580
580
  i.value.dataSources || {},
581
581
  l
582
582
  ), w = {
583
583
  ...m,
584
- ...p,
584
+ ...d,
585
585
  ...h,
586
- ...d
586
+ ...p
587
587
  };
588
588
  return l.setup(w, e), Tt(e, i.value.watch ?? [], l), {
589
589
  vtj: l
@@ -594,7 +594,7 @@ function G(n) {
594
594
  render() {
595
595
  if (!i.value.nodes) return null;
596
596
  const u = i.value.nodes || [];
597
- return u.length === 1 ? O(u[0], l, e, a) : u.map((p) => O(p, l, e, a));
597
+ return u.length === 1 ? O(u[0], l, e, a) : u.map((d) => O(d, l, e, a));
598
598
  },
599
599
  ...At(i.value.lifeCycles ?? {}, l)
600
600
  });
@@ -603,70 +603,70 @@ function G(n) {
603
603
  context: l
604
604
  };
605
605
  }
606
- function Et(n = []) {
607
- return n.map((e) => j(e) ? e : e.name);
606
+ function Et(s = []) {
607
+ return s.map((e) => j(e) ? e : e.name);
608
608
  }
609
- function Rt(n = [], e) {
610
- const t = (s) => s ? (Array.isArray(s) ? s : [s]).map((o) => st[o]) : void 0;
611
- return n.map((s) => j(s) ? {
612
- name: s
609
+ function kt(s = [], e) {
610
+ const t = (n) => n ? (Array.isArray(n) ? n : [n]).map((o) => nt[o]) : void 0;
611
+ return s.map((n) => j(n) ? {
612
+ name: n
613
613
  } : {
614
- name: s.name,
615
- type: s.type,
616
- required: s.required,
617
- default: _(s.default) ? e.__parseExpression(s.default) : s.default
614
+ name: n.name,
615
+ type: n.type,
616
+ required: n.required,
617
+ default: _(n.default) ? e.__parseExpression(n.default) : n.default
618
618
  }).reduce(
619
- (s, r) => (s[r.name] = {
619
+ (n, r) => (n[r.name] = {
620
620
  type: t(r.type),
621
621
  required: r.required,
622
622
  default: r.default
623
- }, s),
623
+ }, n),
624
624
  {}
625
625
  );
626
626
  }
627
- function kt(n, e, t) {
628
- return n.reactive(
627
+ function Rt(s, e, t) {
628
+ return s.reactive(
629
629
  Object.keys(e || {}).reduce(
630
- (s, r) => {
630
+ (n, r) => {
631
631
  let o = e[r];
632
- return _(o) ? o = t.__parseExpression(o) : A(o) && (o = t.__parseFunction(o)), s[r] = o, s;
632
+ return _(o) ? o = t.__parseExpression(o) : A(o) && (o = t.__parseFunction(o)), n[r] = o, n;
633
633
  },
634
634
  {}
635
635
  )
636
636
  );
637
637
  }
638
- function Pt(n, e, t) {
638
+ function xt(s, e, t) {
639
639
  return Object.entries(e ?? {}).reduce(
640
- (s, [r, o]) => (s[r] = n.computed(t.__parseFunction(o)), s),
640
+ (n, [r, o]) => (n[r] = s.computed(t.__parseFunction(o)), n),
641
641
  {}
642
642
  );
643
643
  }
644
- function xt(n, e) {
645
- return Object.entries(n ?? {}).reduce(
646
- (t, [s, r]) => (t[s] = e.__parseFunction(r), t),
644
+ function Pt(s, e) {
645
+ return Object.entries(s ?? {}).reduce(
646
+ (t, [n, r]) => (t[n] = e.__parseFunction(r), t),
647
647
  {}
648
648
  );
649
649
  }
650
- function Ct(n, e = [], t) {
650
+ function Ct(s, e = [], t) {
651
651
  return e.reduce(
652
- (s, r) => {
652
+ (n, r) => {
653
653
  const { name: o, from: a } = r || {};
654
654
  r.default;
655
655
  const i = _(a) ? t.__parseExpression(a) || o : a ?? o, c = _(r.default) ? t.__parseExpression(r.default) : r.default ?? null;
656
- return s[o] = n.inject(i, c), s;
656
+ return n[o] = s.inject(i, c), n;
657
657
  },
658
658
  {}
659
659
  );
660
660
  }
661
- function Ft(n, e) {
662
- return Object.keys(n).reduce(
663
- (t, s) => {
664
- const r = n[s];
661
+ function Ft(s, e) {
662
+ return Object.keys(s).reduce(
663
+ (t, n) => {
664
+ const r = s[n];
665
665
  if (r.type === "mock")
666
- t[s] = bt(r);
666
+ t[n] = bt(r);
667
667
  else if (r.ref) {
668
668
  const o = e.$apis[r.ref], a = A(r.transform) ? r.transform.value ? e.__parseFunction(r.transform) : void 0 : r.transform;
669
- t[s] = async (...i) => {
669
+ t[n] = async (...i) => {
670
670
  const c = await o.apply(e, i);
671
671
  return a ? a(c) : c;
672
672
  };
@@ -676,194 +676,194 @@ function Ft(n, e) {
676
676
  {}
677
677
  );
678
678
  }
679
- function Tt(n, e = [], t) {
680
- e.forEach((s) => {
681
- n.watch(
682
- t.__parseExpression(s.source),
683
- t.__parseFunction(s.handler),
679
+ function Tt(s, e = [], t) {
680
+ e.forEach((n) => {
681
+ s.watch(
682
+ t.__parseExpression(n.source),
683
+ t.__parseFunction(n.handler),
684
684
  {
685
- deep: s.deep,
686
- immediate: s.immediate
685
+ deep: n.deep,
686
+ immediate: n.immediate
687
687
  }
688
688
  );
689
689
  });
690
690
  }
691
- function At(n, e) {
692
- return Object.entries(n ?? {}).reduce(
693
- (t, [s, r]) => (t[s] = e.__parseFunction(r), t),
691
+ function At(s, e) {
692
+ return Object.entries(s ?? {}).reduce(
693
+ (t, [n, r]) => (t[n] = e.__parseFunction(r), t),
694
694
  {}
695
695
  );
696
696
  }
697
697
  let J = [];
698
- const It = (n) => n;
699
- async function je(n, e = window) {
700
- const { urls: t = [], library: s } = n, r = t.filter((i) => ee(i));
701
- if (r.length === 0 || !s) return null;
698
+ const It = (s) => s;
699
+ async function je(s, e = window) {
700
+ const { urls: t = [], library: n } = s, r = t.filter((i) => ee(i));
701
+ if (r.length === 0 || !n) return null;
702
702
  const o = t.filter((i) => Z(i));
703
- return o.length && ut(o, e), await pt(r, s, e).catch(
704
- (i) => (console.warn("loadScriptUrl error", r, s, i), null)
703
+ return o.length && ut(o, e), await dt(r, n, e).catch(
704
+ (i) => (console.warn("loadScriptUrl error", r, n, i), null)
705
705
  );
706
706
  }
707
- function Y(n) {
708
- const { getDsl: e, getDslByUrl: t, options: s } = n;
709
- return s.window && (J.forEach((r) => {
710
- delete s.window[r];
707
+ function Y(s) {
708
+ const { getDsl: e, getDslByUrl: t, options: n } = s;
709
+ return n.window && (J.forEach((r) => {
710
+ delete n.window[r];
711
711
  }), J = []), (r, o, a = B) => !o || typeof o == "string" ? r : o.type === "Schema" && o.id ? a.defineAsyncComponent(async () => {
712
712
  const i = await e(o.id);
713
713
  return i && (i.name = r), i ? G({
714
- ...s,
714
+ ...n,
715
715
  Vue: a,
716
716
  dsl: i,
717
717
  mode: y.Runtime,
718
- loader: Y(n)
718
+ loader: Y(s)
719
719
  }).renderer : null;
720
720
  }) : o.type === "UrlSchema" && o.url ? a.defineAsyncComponent(async () => {
721
721
  const i = await t(o.url);
722
722
  return i && (i.name = r), i ? G({
723
- ...s,
723
+ ...n,
724
724
  Vue: a,
725
725
  dsl: i,
726
726
  mode: y.Runtime,
727
- loader: Y(n)
727
+ loader: Y(s)
728
728
  }).renderer : null;
729
729
  }) : o.type === "Plugin" ? (o.library && J.push(o.library), a.defineAsyncComponent(async () => {
730
- const i = await je(o, s.window);
730
+ const i = await je(o, n.window);
731
731
  return i || (console.warn("getPlugin result is null", o), null);
732
732
  })) : r;
733
733
  }
734
- function O(n, e, t = B, s = It) {
735
- if (!n || !n.name || n.invisible) return null;
736
- const r = t.getCurrentInstance()?.appContext, { id: o = null, directives: a = [] } = n, { vIf: i, vFor: c, vShow: l, vModels: f, vBind: u, vHtml: p, others: h } = Dt(a);
734
+ function O(s, e, t = B, n = It) {
735
+ if (!s || !s.name || s.invisible) return null;
736
+ const r = t.getCurrentInstance()?.appContext, { id: o = null, directives: a = [] } = s, { vIf: i, vFor: c, vShow: l, vModels: f, vBind: u, vHtml: d, others: h } = Dt(a);
737
737
  if (i && !Ht(i, e))
738
738
  return null;
739
- const m = (d) => {
740
- const w = d.$components, g = (() => {
741
- if (n.name === "component")
742
- return Ot(d, n.props?.is);
743
- if (n.name === "slot") return n.name;
744
- const b = s(n.name, n.from, t);
739
+ const m = (p) => {
740
+ const w = p.$components, g = (() => {
741
+ if (s.name === "component")
742
+ return Ot(p, s.props?.is);
743
+ if (s.name === "slot") return s.name;
744
+ const b = n(s.name, s.from, t);
745
745
  return j(b) ? ft(b) || ht(b) ? b : w[b] ?? r?.app?.component(b) ?? b : b;
746
- })(), S = Bt(o, n.props ?? {}, d), Fe = Nt(t, n.events ?? {}, d);
747
- if (n.name === "slot")
748
- return Ut(t, n, S, d, s);
749
- u && Object.assign(S, d.__parseExpression(u.value)), l && (S.style = Object.assign(
746
+ })(), S = Bt(o, s.props ?? {}, p), Fe = Nt(t, s.events ?? {}, p);
747
+ if (s.name === "slot")
748
+ return Ut(t, s, S, p, n);
749
+ u && Object.assign(S, p.__parseExpression(u.value)), l && (S.style = Object.assign(
750
750
  S.style ?? {},
751
- qt(l, d)
752
- )), p && Object.assign(S, Jt(p, d)), f.forEach((b) => {
753
- Object.assign(S, Vt(t, b, d));
751
+ qt(l, p)
752
+ )), d && Object.assign(S, Jt(d, p)), f.forEach((b) => {
753
+ Object.assign(S, Vt(t, b, p));
754
754
  });
755
755
  const Te = zt(
756
756
  t,
757
- n.children ?? [],
758
- d,
759
- s,
760
- n
757
+ s.children ?? [],
758
+ p,
759
+ n,
760
+ s
761
761
  );
762
762
  let N = t.createVNode(g, { ...S, ...Fe }, Te);
763
- const ne = r ? Mt(r, h, d) : [];
764
- return ne.length && (N = t.withDirectives(N, ne)), N;
763
+ const se = r ? Mt(r, h, p) : [];
764
+ return se.length && (N = t.withDirectives(N, se)), N;
765
765
  };
766
766
  return c ? Gt(c, m, e) : m(e);
767
767
  }
768
- function Mt(n, e, t) {
769
- const s = n.app;
768
+ function Mt(s, e, t) {
769
+ const n = s.app;
770
770
  return e.map((r) => {
771
- const o = typeof r.name == "string" ? s.directive(r.name) : t.__parseExpression(r.name);
771
+ const o = typeof r.name == "string" ? n.directive(r.name) : t.__parseExpression(r.name);
772
772
  if (!o) return null;
773
773
  const a = [o];
774
774
  return r.value && a.push(t.__parseExpression(r.value)), r.arg && a.push(r.arg), r.modifiers && a.push(r.modifiers), a;
775
775
  }).filter((r) => !!r);
776
776
  }
777
- function Dt(n = []) {
778
- const e = n.find((c) => $(c.name) === "vIf"), t = n.find((c) => $(c.name) === "vFor"), s = n.find((c) => $(c.name) === "vShow"), r = n.find((c) => $(c.name) === "vBind"), o = n.find((c) => $(c.name) === "vHtml"), a = n.filter(
777
+ function Dt(s = []) {
778
+ const e = s.find((c) => $(c.name) === "vIf"), t = s.find((c) => $(c.name) === "vFor"), n = s.find((c) => $(c.name) === "vShow"), r = s.find((c) => $(c.name) === "vBind"), o = s.find((c) => $(c.name) === "vHtml"), a = s.filter(
779
779
  (c) => $(c.name) === "vModel"
780
- ), i = n.filter(
780
+ ), i = s.filter(
781
781
  (c) => !tt.includes($(c.name))
782
782
  );
783
783
  return {
784
784
  vIf: e,
785
785
  vFor: t,
786
- vShow: s,
786
+ vShow: n,
787
787
  vModels: a,
788
788
  vBind: r,
789
789
  others: i,
790
790
  vHtml: o
791
791
  };
792
792
  }
793
- function Ht(n, e) {
794
- return !!e.__parseExpression(n.value);
793
+ function Ht(s, e) {
794
+ return !!e.__parseExpression(s.value);
795
795
  }
796
- function Ot(n, e) {
797
- return e ? _(e) ? n.__parseExpression(e) : e : "div";
796
+ function Ot(s, e) {
797
+ return e ? _(e) ? s.__parseExpression(e) : e : "div";
798
798
  }
799
- function Bt(n, e, t) {
800
- const s = Object.keys(e || {}).reduce(
799
+ function Bt(s, e, t) {
800
+ const n = Object.keys(e || {}).reduce(
801
801
  (r, o) => {
802
802
  let a = e[o];
803
803
  return _(a) ? a = t.__parseExpression(a) : A(a) && (a = t.__parseFunction(a)), r[o] = a, r;
804
804
  },
805
805
  {}
806
806
  );
807
- return s.ref = t.__ref(n, s.ref), s;
807
+ return n.ref = t.__ref(s, n.ref), n;
808
808
  }
809
- function Nt(n, e, t) {
810
- const s = ["passive", "capture", "once"], r = {
809
+ function Nt(s, e, t) {
810
+ const n = ["passive", "capture", "once"], r = {
811
811
  capture: "Capture",
812
812
  once: "Once",
813
813
  passive: "OnceCapture"
814
814
  };
815
815
  return Object.keys(e || {}).reduce(
816
816
  (o, a) => {
817
- const i = e[a], c = $e(i.modifiers), l = c.find((p) => s.includes(p)), f = "on" + Ue(a) + (l && r[l] || ""), u = t.__parseFunction(i.handler);
818
- return u && (o[f] = n.withModifiers(u, c)), o;
817
+ const i = e[a], c = $e(i.modifiers), l = c.find((d) => n.includes(d)), f = "on" + Ue(a) + (l && r[l] || ""), u = t.__parseFunction(i.handler);
818
+ return u && (o[f] = s.withModifiers(u, c)), o;
819
819
  },
820
820
  {}
821
821
  );
822
822
  }
823
- function $e(n = {}, e = !1) {
824
- const t = Object.keys(n);
825
- return e ? t.map((s) => "." + s) : t;
823
+ function $e(s = {}, e = !1) {
824
+ const t = Object.keys(s);
825
+ return e ? t.map((n) => "." + n) : t;
826
826
  }
827
- function Ut(n, e, t, s, r) {
828
- const { children: o } = e, a = Lt(e, s), i = s.$slots?.[a.name];
829
- return i ? i(t) : o ? j(o) ? n.createTextVNode(o) : _(o) ? n.createTextVNode(
830
- _e(s.__parseExpression(o))
827
+ function Ut(s, e, t, n, r) {
828
+ const { children: o } = e, a = Lt(e, n), i = n.$slots?.[a.name];
829
+ return i ? i(t) : o ? j(o) ? s.createTextVNode(o) : _(o) ? s.createTextVNode(
830
+ _e(n.__parseExpression(o))
831
831
  ) : Array.isArray(o) ? o.map(
832
- (c) => O(c, s, n, r)
832
+ (c) => O(c, n, s, r)
833
833
  ) : null : null;
834
834
  }
835
- function Lt(n, e) {
836
- const { props: t } = n, s = t?.name || "default";
835
+ function Lt(s, e) {
836
+ const { props: t } = s, n = t?.name || "default";
837
837
  return {
838
- name: _(s) ? e.__parseExpression(s) : s,
838
+ name: _(n) ? e.__parseExpression(n) : n,
839
839
  params: []
840
840
  };
841
841
  }
842
- function qt(n, e) {
843
- return e.__parseExpression(n.value) ? {} : {
842
+ function qt(s, e) {
843
+ return e.__parseExpression(s.value) ? {} : {
844
844
  display: "none"
845
845
  };
846
846
  }
847
- function Jt(n, e) {
847
+ function Jt(s, e) {
848
848
  return {
849
- innerHTML: e.__parseExpression(n.value) || ""
849
+ innerHTML: e.__parseExpression(s.value) || ""
850
850
  };
851
851
  }
852
- function Vt(n, e, t) {
853
- const s = {
852
+ function Vt(s, e, t) {
853
+ const n = {
854
854
  type: "JSFunction",
855
855
  value: e.value?.value ? `(v) => {
856
856
  ${e.value.value} = v;
857
857
  }` : "(v) => {}"
858
- }, r = t.__parseFunction(s), o = $e(
858
+ }, r = t.__parseFunction(n), o = $e(
859
859
  _(e.modifiers) ? t.__parseExpression(e.modifiers) : e.modifiers
860
860
  ), a = _(e.arg) ? t.__parseExpression(e.arg) : e.arg || "modelValue";
861
861
  return {
862
862
  [a]: t.__parseExpression(e.value),
863
- [`onUpdate:${a}`]: o.length && r ? n.withModifiers(r, o) : r
863
+ [`onUpdate:${a}`]: o.length && r ? s.withModifiers(r, o) : r
864
864
  };
865
865
  }
866
- function zt(n, e, t, s, r) {
866
+ function zt(s, e, t, n, r) {
867
867
  if (!e) return null;
868
868
  if (j(e))
869
869
  return { default: () => e };
@@ -876,88 +876,88 @@ function zt(n, e, t, s, r) {
876
876
  [`scope_${r.id}`]: i
877
877
  } : {};
878
878
  return Object.entries(o).reduce((i, [c, { nodes: l, params: f }]) => (i[c] = (u) => {
879
- const p = f.length ? Le(u ?? {}, f) : a(u);
879
+ const d = f.length ? Le(u ?? {}, f) : a(u);
880
880
  return l.map(
881
- (h) => O(h, t.__clone(p), n, s)
881
+ (h) => O(h, t.__clone(d), s, n)
882
882
  );
883
883
  }, i), {});
884
884
  }
885
885
  return null;
886
886
  }
887
- function Kt(n) {
887
+ function Kt(s) {
888
888
  const e = {
889
889
  default: {
890
890
  params: [],
891
891
  nodes: []
892
892
  }
893
893
  };
894
- for (const t of n) {
895
- const s = Wt(t.slot), r = s.name;
896
- e[r] ? (e[r].nodes.push(t), e[r].params = e[r].params.concat(s.params)) : e[r] = {
894
+ for (const t of s) {
895
+ const n = Wt(t.slot), r = n.name;
896
+ e[r] ? (e[r].nodes.push(t), e[r].params = e[r].params.concat(n.params)) : e[r] = {
897
897
  nodes: [t],
898
- params: s.params
898
+ params: n.params
899
899
  };
900
900
  }
901
901
  return e;
902
902
  }
903
- function Wt(n = "default") {
904
- return j(n) ? { name: n, params: [] } : { params: [], ...n };
903
+ function Wt(s = "default") {
904
+ return j(s) ? { name: s, params: [] } : { params: [], ...s };
905
905
  }
906
- function Gt(n, e, t) {
907
- const { value: s, iterator: r } = n, { item: o = "item", index: a = "index" } = r || {};
908
- let i = t.__parseExpression(s) || [];
909
- 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`), []);
906
+ function Gt(s, e, t) {
907
+ const { value: n, iterator: r } = s, { item: o = "item", index: a = "index" } = r || {};
908
+ let i = t.__parseExpression(n) || [];
909
+ 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]:", `${n?.value} is not a Arrary`), []);
910
910
  }
911
- function Yt(n) {
912
- return We() ? (Ge(n), !0) : !1;
911
+ function Yt(s) {
912
+ return We() ? (Ge(s), !0) : !1;
913
913
  }
914
- function te(n) {
915
- return typeof n == "function" ? n() : Ye(n);
914
+ function te(s) {
915
+ return typeof s == "function" ? s() : Ye(s);
916
916
  }
917
917
  const Ee = typeof window < "u" && typeof document < "u";
918
918
  typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
919
- const Qt = (n) => n != null, Xt = () => {
919
+ const Qt = (s) => s != null, Xt = () => {
920
920
  };
921
- function Zt(n) {
921
+ function Zt(s) {
922
922
  return me();
923
923
  }
924
- function es(...n) {
925
- if (n.length !== 1)
926
- return Je(...n);
927
- const e = n[0];
924
+ function en(...s) {
925
+ if (s.length !== 1)
926
+ return Je(...s);
927
+ const e = s[0];
928
928
  return typeof e == "function" ? Ve(ze(() => ({ get: e, set: Xt }))) : F(e);
929
929
  }
930
- function ts(n, e) {
931
- Zt() && Ke(n, e);
930
+ function tn(s, e) {
931
+ Zt() && Ke(s, e);
932
932
  }
933
- const ss = Ee ? window : void 0, ns = Ee ? window.document : void 0;
934
- function rs(n) {
933
+ const nn = Ee ? window : void 0, sn = Ee ? window.document : void 0;
934
+ function rn(s) {
935
935
  var e;
936
- const t = te(n);
936
+ const t = te(s);
937
937
  return (e = t?.$el) != null ? e : t;
938
938
  }
939
- function os() {
940
- const n = F(!1), e = me();
939
+ function on() {
940
+ const s = F(!1), e = me();
941
941
  return e && Qe(() => {
942
- n.value = !0;
943
- }, e), n;
942
+ s.value = !0;
943
+ }, e), s;
944
944
  }
945
- function is(n) {
946
- const e = os();
947
- return ve(() => (e.value, !!n()));
945
+ function an(s) {
946
+ const e = on();
947
+ return ve(() => (e.value, !!s()));
948
948
  }
949
- function as(n, e, t = {}) {
950
- const { window: s = ss, ...r } = t;
949
+ function cn(s, e, t = {}) {
950
+ const { window: n = nn, ...r } = t;
951
951
  let o;
952
- const a = is(() => s && "MutationObserver" in s), i = () => {
952
+ const a = an(() => n && "MutationObserver" in n), i = () => {
953
953
  o && (o.disconnect(), o = void 0);
954
954
  }, c = ve(() => {
955
- const p = te(n), h = (Array.isArray(p) ? p : [p]).map(rs).filter(Qt);
955
+ const d = te(s), h = (Array.isArray(d) ? d : [d]).map(rn).filter(Qt);
956
956
  return new Set(h);
957
957
  }), l = ge(
958
958
  () => c.value,
959
- (p) => {
960
- i(), a.value && p.size && (o = new MutationObserver(e), p.forEach((h) => o.observe(h, r)));
959
+ (d) => {
960
+ i(), a.value && d.size && (o = new MutationObserver(e), d.forEach((h) => o.observe(h, r)));
961
961
  },
962
962
  { immediate: !0, flush: "post" }
963
963
  ), f = () => o?.takeRecords(), u = () => {
@@ -969,31 +969,31 @@ function as(n, e, t = {}) {
969
969
  takeRecords: f
970
970
  };
971
971
  }
972
- function cs(n = null, e = {}) {
973
- var t, s, r;
972
+ function ln(s = null, e = {}) {
973
+ var t, n, r;
974
974
  const {
975
- document: o = ns,
975
+ document: o = sn,
976
976
  restoreOnUnmount: a = (u) => u
977
- } = e, i = (t = o?.title) != null ? t : "", c = es((s = n ?? o?.title) != null ? s : null), l = n && typeof n == "function";
977
+ } = e, i = (t = o?.title) != null ? t : "", c = en((n = s ?? o?.title) != null ? n : null), l = s && typeof s == "function";
978
978
  function f(u) {
979
979
  if (!("titleTemplate" in e))
980
980
  return u;
981
- const p = e.titleTemplate || "%s";
982
- return typeof p == "function" ? p(u) : te(p).replace(/%s/g, u);
981
+ const d = e.titleTemplate || "%s";
982
+ return typeof d == "function" ? d(u) : te(d).replace(/%s/g, u);
983
983
  }
984
984
  return ge(
985
985
  c,
986
- (u, p) => {
987
- u !== p && o && (o.title = f(typeof u == "string" ? u : ""));
986
+ (u, d) => {
987
+ u !== d && o && (o.title = f(typeof u == "string" ? u : ""));
988
988
  },
989
989
  { immediate: !0 }
990
- ), e.observe && !e.titleTemplate && o && !l && as(
990
+ ), e.observe && !e.titleTemplate && o && !l && cn(
991
991
  (r = o.head) == null ? void 0 : r.querySelector("title"),
992
992
  () => {
993
993
  o && o.title !== c.value && (c.value = f(o.title));
994
994
  },
995
995
  { childList: !0 }
996
- ), ts(() => {
996
+ ), tn(() => {
997
997
  if (a) {
998
998
  const u = a(i, c.value || "");
999
999
  u != null && o && (o.title = u);
@@ -1003,11 +1003,11 @@ function cs(n = null, e = {}) {
1003
1003
  const le = X({
1004
1004
  name: "VtjPageContainer",
1005
1005
  async setup() {
1006
- const n = ke(), e = ye(), t = e.params.id, s = t ? n.getPage(t) : n.getHomepage(), r = s ? await n.getRenderComponent(s.id) : null, o = F(Symbol());
1007
- return s && (Object.assign(e.meta, s.meta || {}, { cache: s.cache }), cs(s.title || "VTJ")), {
1008
- provider: n,
1006
+ const s = Re(), e = ye(), t = e.params.id, n = t ? s.getPage(t) : s.getHomepage(), r = n ? await s.getRenderComponent(n.id) : null, o = F(Symbol());
1007
+ return n && (Object.assign(e.meta, n.meta || {}, { cache: n.cache }), ln(n.title || "VTJ")), {
1008
+ provider: s,
1009
1009
  component: r,
1010
- file: s,
1010
+ file: n,
1011
1011
  query: e.query,
1012
1012
  meta: e.meta,
1013
1013
  sid: o,
@@ -1015,28 +1015,28 @@ const le = X({
1015
1015
  };
1016
1016
  },
1017
1017
  render() {
1018
- const { component: n, query: e, sid: t } = this;
1019
- return n ? K(n, { ...e, key: t }) : K("div", "页面不存在");
1018
+ const { component: s, query: e, sid: t } = this;
1019
+ return s ? K(s, { ...e, key: t }) : K("div", "页面不存在");
1020
1020
  },
1021
1021
  activated() {
1022
1022
  this.meta.cache === !1 && (this.sid = Symbol());
1023
1023
  }
1024
- }), ls = {
1024
+ }), un = {
1025
1025
  "data-l-h6o7ki7": "",
1026
1026
  class: "vtj-startup__wrapper"
1027
- }, us = {
1027
+ }, dn = {
1028
1028
  "data-l-h6o7ki7": "",
1029
1029
  class: "vtj-startup"
1030
- }, ps = {
1030
+ }, pn = {
1031
1031
  "data-l-h6o7ki7": "",
1032
1032
  class: "vtj-startup__name"
1033
- }, ds = { "data-l-h6o7ki7": "" }, fs = {
1033
+ }, fn = { "data-l-h6o7ki7": "" }, hn = {
1034
1034
  "data-l-h6o7ki7": "",
1035
1035
  class: "vtj-startup__tagline"
1036
- }, hs = {
1036
+ }, mn = {
1037
1037
  "data-l-h6o7ki7": "",
1038
1038
  class: "vtj-startup__actions"
1039
- }, ms = /* @__PURE__ */ X({
1039
+ }, gn = /* @__PURE__ */ X({
1040
1040
  __name: "Startup",
1041
1041
  props: {
1042
1042
  name: { default: "VTJ.PRO" },
@@ -1044,7 +1044,7 @@ const le = X({
1044
1044
  actionText: { default: "开始设计" },
1045
1045
  link: {}
1046
1046
  },
1047
- setup(n) {
1047
+ setup(s) {
1048
1048
  ((r, o) => {
1049
1049
  let a = document.getElementById("h6o7ki7");
1050
1050
  a || (a = document.createElement("style"), a.id = "h6o7ki7", document.head.appendChild(a), a.innerHTML = o);
@@ -1091,11 +1091,22 @@ const le = X({
1091
1091
  .vtj-startup__actions[data-l-h6o7ki7]{
1092
1092
  display: flex;
1093
1093
  flex-wrap: wrap;
1094
- justify-content: flex-end;
1094
+ justify-content: space-between;
1095
+ align-items: center;
1095
1096
  border-top: 1px solid rgba(60, 60, 67, 0.08);
1096
1097
  padding: 20px 0 0 0;
1097
1098
  margin-top: 20px;
1098
1099
  }
1100
+ .vtj-startup__actions span[data-l-h6o7ki7]{
1101
+ color: #e6a23c;
1102
+ }@media (max-width: 768px){
1103
+
1104
+ .vtj-startup__actions span[data-l-h6o7ki7]{
1105
+ display: block;
1106
+ text-align: center;
1107
+ width: 100%;
1108
+ }
1109
+ }
1099
1110
  .vtj-startup__actions button[data-l-h6o7ki7]{
1100
1111
  height: 40px;
1101
1112
  padding: 0 20px;
@@ -1109,12 +1120,13 @@ const le = X({
1109
1120
 
1110
1121
  .vtj-startup__actions button[data-l-h6o7ki7]{
1111
1122
  width: 100%;
1123
+ margin-top: 20px;
1112
1124
  }
1113
1125
  }
1114
1126
  .vtj-startup__actions button[data-l-h6o7ki7]:hover{
1115
1127
  opacity: 0.7;
1116
1128
  }`);
1117
- const t = n, s = () => {
1129
+ const t = s, n = () => {
1118
1130
  if (typeof window < "u") {
1119
1131
  if (t.link) {
1120
1132
  typeof t.link == "function" ? t.link() : window.location.href = t.link;
@@ -1124,34 +1136,35 @@ const le = X({
1124
1136
  window.location.href = o;
1125
1137
  }
1126
1138
  };
1127
- return (r, o) => (Xe(), Ze("div", ls, [
1128
- R("div", us, [
1129
- R("h1", ps, [
1130
- R("span", ds, q(t.name), 1)
1139
+ return (r, o) => (Xe(), Ze("div", un, [
1140
+ E("div", dn, [
1141
+ E("h1", pn, [
1142
+ E("span", fn, q(t.name), 1)
1131
1143
  ]),
1132
- R("div", fs, q(t.tagline), 1),
1133
- R("div", hs, [
1134
- R("button", {
1144
+ E("div", hn, q(t.tagline), 1),
1145
+ E("div", mn, [
1146
+ o[0] || (o[0] = E("span", { "data-l-h6o7ki7": "" }, "设置项目主页后,将替换此页面显示", -1)),
1147
+ E("button", {
1135
1148
  "data-l-h6o7ki7": "",
1136
- onClick: s
1149
+ onClick: n
1137
1150
  }, q(t.actionText), 1)
1138
1151
  ])
1139
1152
  ])
1140
1153
  ]));
1141
1154
  }
1142
- }), gs = X({
1155
+ }), vn = X({
1143
1156
  name: "VtjStartupContainer",
1144
1157
  render() {
1145
- return K(ms);
1158
+ return K(gn);
1146
1159
  }
1147
- }), Re = Symbol("Provider");
1148
- var vs = /* @__PURE__ */ ((n) => (n.Production = "production", n.Development = "development", n))(vs || {});
1149
- class ys extends Ae {
1160
+ }), ke = Symbol("Provider");
1161
+ var yn = /* @__PURE__ */ ((s) => (s.Production = "production", s.Development = "development", s))(yn || {});
1162
+ class _n extends Ae {
1150
1163
  constructor(e) {
1151
1164
  super(), this.options = e;
1152
1165
  const {
1153
1166
  service: t,
1154
- mode: s = y.Raw,
1167
+ mode: n = y.Raw,
1155
1168
  dependencies: r,
1156
1169
  materials: o,
1157
1170
  project: a = {},
@@ -1160,12 +1173,12 @@ class ys extends Ae {
1160
1173
  modules: l = {},
1161
1174
  router: f = null,
1162
1175
  materialPath: u = "./",
1163
- nodeEnv: p = "development"
1176
+ nodeEnv: d = "development"
1164
1177
  /* Development */
1165
1178
  } = e;
1166
- this.mode = s, this.modules = l, this.service = t, this.router = f, this.materialPath = u, this.nodeEnv = p, r && (this.dependencies = r), o && (this.materials = o), Object.assign(this.globals, c), Object.assign(this.adapter, i);
1179
+ this.mode = n, this.modules = l, this.service = t, this.router = f, this.materialPath = u, this.nodeEnv = d, r && (this.dependencies = r), o && (this.materials = o), Object.assign(this.globals, c), Object.assign(this.adapter, i);
1167
1180
  const { access: h, request: m } = this.adapter;
1168
- h && h.connect({ mode: s, router: f, request: m }), a && s !== y.Design ? this.load(a) : this.project = a, E.setup({
1181
+ h && h.connect({ mode: n, router: f, request: m }), a && n !== y.Design ? this.load(a) : this.project = a, k.setup({
1169
1182
  timeout: "50-500"
1170
1183
  });
1171
1184
  }
@@ -1186,35 +1199,35 @@ class ys extends Ae {
1186
1199
  urlDslCaches = {};
1187
1200
  createMock(e) {
1188
1201
  return async (...t) => {
1189
- let s = {};
1202
+ let n = {};
1190
1203
  if (e)
1191
1204
  try {
1192
- s = await e.apply(e, t);
1205
+ n = await e.apply(e, t);
1193
1206
  } catch (r) {
1194
- P.warn("模拟数据模版异常", r);
1207
+ x.warn("模拟数据模版异常", r);
1195
1208
  }
1196
- return E.mock(s);
1209
+ return k.mock(n);
1197
1210
  };
1198
1211
  }
1199
1212
  async load(e) {
1200
1213
  const t = this.modules[`.vtj/projects/${e.id}.json`];
1201
1214
  if (this.project = t ? await t() : await this.service.init(e), !this.project)
1202
1215
  throw new Error("project is null");
1203
- const { apis: s = [], meta: r = [] } = this.project, o = window;
1204
- o.CKEDITOR_VERSION = void 0, this.mode === y.Raw ? await this.loadDependencies(o) : await this.loadAssets(o), this.apis = wt(s, r, this.adapter), be(), St(s), this.initRouter(), this.triggerReady();
1216
+ const { apis: n = [], meta: r = [] } = this.project, o = window;
1217
+ o.CKEDITOR_VERSION = void 0, this.mode === y.Raw ? await this.loadDependencies(o) : await this.loadAssets(o), this.apis = wt(n, r, this.adapter), be(), St(n), this.initRouter(), this.triggerReady();
1205
1218
  }
1206
1219
  async loadDependencies(e) {
1207
1220
  const t = Object.entries(this.dependencies);
1208
- for (const [s, r] of t)
1209
- e[s] || (e[s] = this.library[s] = await r());
1221
+ for (const [n, r] of t)
1222
+ e[n] || (e[n] = this.library[n] = await r());
1210
1223
  }
1211
1224
  async loadAssets(e) {
1212
- const { dependencies: t = [] } = this.project, { dependencies: s, library: r, components: o, materialPath: a, nodeEnv: i } = this, {
1225
+ const { dependencies: t = [] } = this.project, { dependencies: n, library: r, components: o, materialPath: a, nodeEnv: i } = this, {
1213
1226
  libraryExports: c,
1214
1227
  libraryMap: l,
1215
1228
  materials: f,
1216
1229
  materialExports: u,
1217
- materialMapLibrary: p
1230
+ materialMapLibrary: d
1218
1231
  } = at(
1219
1232
  t,
1220
1233
  a,
@@ -1222,86 +1235,86 @@ class ys extends Ae {
1222
1235
  /* Development */
1223
1236
  );
1224
1237
  for (const h of c) {
1225
- const m = s[h], d = e[h];
1226
- if (d)
1227
- r[h] = d;
1238
+ const m = n[h], p = e[h];
1239
+ if (p)
1240
+ r[h] = p;
1228
1241
  else if (m)
1229
1242
  e[h] = r[h] = await m();
1230
1243
  else {
1231
1244
  const w = l[h] || [];
1232
1245
  for (const g of w)
1233
- Z(g) && await lt(h, k.append(g, { v: x })), ee(g) && await ie(k.append(g, { v: x }));
1246
+ Z(g) && await lt(h, R.append(g, { v: P })), ee(g) && await ie(R.append(g, { v: P }));
1234
1247
  r[h] = e[h];
1235
1248
  }
1236
1249
  }
1237
1250
  if (i === "development") {
1238
1251
  for (const m of f)
1239
- await ie(k.append(m, { v: x }));
1252
+ await ie(R.append(m, { v: P }));
1240
1253
  const h = this.materials || {};
1241
1254
  for (const m of u) {
1242
- const d = e[p[m]], w = Ie[m];
1255
+ const p = e[d[m]], w = Ie[m];
1243
1256
  if (w)
1244
- d && w.forEach((g) => {
1245
- o[g] = d[g];
1257
+ p && w.forEach((g) => {
1258
+ o[g] = p[g];
1246
1259
  });
1247
1260
  else {
1248
1261
  const g = h[m] ? (await h[m]()).default : e[m];
1249
- g && d && (g.components || []).forEach((S) => {
1250
- o[S.name] = ct(S, d);
1262
+ g && p && (g.components || []).forEach((S) => {
1263
+ o[S.name] = ct(S, p);
1251
1264
  });
1252
1265
  }
1253
1266
  }
1254
1267
  }
1255
1268
  }
1256
1269
  initRouter() {
1257
- const { router: e, project: t, options: s, adapter: r } = this;
1270
+ const { router: e, project: t, options: n, adapter: r } = this;
1258
1271
  if (!e) return;
1259
- const { routeAppendTo: o, pageRouteName: a = "page", routeMeta: i } = s, c = o ? "" : "/", l = {
1272
+ const { routeAppendTo: o, pageRouteName: a = "page", routeMeta: i } = n, c = o ? "" : "/", l = {
1260
1273
  path: `${c}${a}/:id`,
1261
1274
  name: C,
1262
1275
  component: le
1263
1276
  }, f = {
1264
1277
  path: c,
1265
1278
  name: D,
1266
- component: t?.homepage ? le : r.startupComponent || gs,
1279
+ component: t?.homepage ? le : r.startupComponent || vn,
1267
1280
  meta: i
1268
1281
  };
1269
1282
  e.hasRoute(C) && e.removeRoute(C), e.hasRoute(D) && e.removeRoute(D), o ? (e.addRoute(o, l), e.addRoute(o, f)) : (e.addRoute(l), e.addRoute(f));
1270
1283
  }
1271
1284
  install(e) {
1272
1285
  const t = e.config.globalProperties.installed || {};
1273
- for (const [s, r] of Object.entries(this.library))
1274
- !t[s] && dt(r) && (e.use(r), t[s] = !0);
1275
- this.options.install && e.use(this.options.install), this.adapter.access && e.use(this.adapter.access), e.provide(Re, this), e.config.globalProperties.installed = t, this.mode === y.Design && (e.config.errorHandler = (s, r, o) => {
1276
- const a = r?.$options.name, i = typeof s == "string" ? s : s?.message || s?.msg || "未知错误", c = `[ ${a} ] ${i} ${o}`;
1286
+ for (const [n, r] of Object.entries(this.library))
1287
+ !t[n] && pt(r) && (e.use(r), t[n] = !0);
1288
+ this.options.install && e.use(this.options.install), this.adapter.access && e.use(this.adapter.access), e.provide(ke, this), e.config.globalProperties.installed = t, this.mode === y.Design && (e.config.errorHandler = (n, r, o) => {
1289
+ const a = r?.$options.name, i = typeof n == "string" ? n : n?.message || n?.msg || "未知错误", c = `[ ${a} ] ${i} ${o}`;
1277
1290
  console.error(
1278
1291
  "[VTJ Error]:",
1279
1292
  {
1280
- err: s,
1293
+ err: n,
1281
1294
  instance: r,
1282
1295
  info: o
1283
1296
  },
1284
- s?.stack
1297
+ n?.stack
1285
1298
  ), this.adapter.notify && this.adapter.notify(c, "组件渲染错误", "error");
1286
1299
  });
1287
1300
  }
1288
1301
  getFile(e) {
1289
1302
  const { blocks: t = [] } = this.project || {};
1290
- return this.getPage(e) || t.find((s) => s.id === e) || null;
1303
+ return this.getPage(e) || t.find((n) => n.id === e) || null;
1291
1304
  }
1292
1305
  getPage(e) {
1293
- const { pages: t = [] } = this.project || {}, s = (r, o = []) => {
1306
+ const { pages: t = [] } = this.project || {}, n = (r, o = []) => {
1294
1307
  for (const a of o) {
1295
1308
  if (a.id === r)
1296
1309
  return a;
1297
1310
  if (a.children && a.children.length) {
1298
- const i = s(r, a.children);
1311
+ const i = n(r, a.children);
1299
1312
  if (i)
1300
1313
  return i;
1301
1314
  }
1302
1315
  }
1303
1316
  };
1304
- return s(e, t) || null;
1317
+ return n(e, t) || null;
1305
1318
  }
1306
1319
  getHomepage() {
1307
1320
  const { homepage: e } = this.project || {};
@@ -1320,14 +1333,14 @@ class ys extends Ae {
1320
1333
  validSuccess: !1,
1321
1334
  originResponse: !0
1322
1335
  }
1323
- }).then((s) => s.data).catch(() => null));
1336
+ }).then((n) => n.data).catch(() => null));
1324
1337
  }
1325
1338
  createDslRenderer(e, t = {}) {
1326
- const { library: s, components: r, mode: o, apis: a } = this, i = {
1339
+ const { library: n, components: r, mode: o, apis: a } = this, i = {
1327
1340
  mode: o,
1328
- Vue: s.Vue,
1341
+ Vue: n.Vue,
1329
1342
  components: r,
1330
- libs: s,
1343
+ libs: n,
1331
1344
  apis: a,
1332
1345
  window,
1333
1346
  ...t
@@ -1343,42 +1356,42 @@ class ys extends Ae {
1343
1356
  });
1344
1357
  }
1345
1358
  async getRenderComponent(e, t) {
1346
- const s = this.getFile(e);
1347
- if (!s)
1348
- return P.warn(`Can not find file: ${e}`), null;
1349
- t && t(s);
1359
+ const n = this.getFile(e);
1360
+ if (!n)
1361
+ return x.warn(`Can not find file: ${e}`), null;
1362
+ t && t(n);
1350
1363
  const r = `.vtj/vue/${e}.vue`, o = this.modules[r];
1351
1364
  if (o)
1352
1365
  return (await o())?.default;
1353
- const a = await this.getDsl(s.id);
1354
- return a ? this.createDslRenderer(a).renderer : (P.warn(`Can not find dsl: ${e}`), null);
1366
+ const a = await this.getDsl(n.id);
1367
+ return a ? this.createDslRenderer(a).renderer : (x.warn(`Can not find dsl: ${e}`), null);
1355
1368
  }
1356
1369
  defineUrlSchemaComponent(e, t) {
1357
1370
  return ae(async () => {
1358
- const s = await this.getDslByUrl(e);
1359
- return s ? (s.name = t || s.name, this.createDslRenderer(s).renderer) : null;
1371
+ const n = await this.getDslByUrl(e);
1372
+ return n ? (n.name = t || n.name, this.createDslRenderer(n).renderer) : null;
1360
1373
  });
1361
1374
  }
1362
1375
  definePluginComponent(e) {
1363
1376
  return ae(async () => await je(e, window));
1364
1377
  }
1365
1378
  }
1366
- function As(n) {
1367
- const e = new ys(n);
1379
+ function In(s) {
1380
+ const e = new _n(s);
1368
1381
  return {
1369
1382
  provider: e,
1370
- onReady: (s) => e.ready(s)
1383
+ onReady: (n) => e.ready(n)
1371
1384
  };
1372
1385
  }
1373
- function ke(n = {}) {
1374
- const e = he(Re);
1386
+ function Re(s = {}) {
1387
+ const e = he(ke);
1375
1388
  if (!e)
1376
1389
  throw new Error("Can not find provider");
1377
1390
  if (e.nodeEnv === "development") {
1378
- const { id: t, version: s } = n;
1379
- t && s && (async () => {
1391
+ const { id: t, version: n } = s;
1392
+ t && n && (async () => {
1380
1393
  const r = await e.getDsl(t);
1381
- r?.__VERSION__ !== s && e.adapter.notify && e.adapter.notify(
1394
+ r?.__VERSION__ !== n && e.adapter.notify && e.adapter.notify(
1382
1395
  `[ ${r?.name} ] 组件源码版本与运行时版本不一致,请重新发布组件`,
1383
1396
  "版本不一致",
1384
1397
  "warning"
@@ -1387,35 +1400,35 @@ function ke(n = {}) {
1387
1400
  }
1388
1401
  return e;
1389
1402
  }
1390
- const Pe = {
1403
+ const xe = {
1391
1404
  type: "json",
1392
1405
  validSuccess: !0,
1393
1406
  originResponse: !1,
1394
1407
  failMessage: !0,
1395
- validate: (n) => n.data?.code === 0
1396
- }, _s = (n, e = "/__vtj__/api/:type.json") => (t, s) => n.send({
1408
+ validate: (s) => s.data?.code === 0
1409
+ }, wn = (s, e = "/__vtj__/api/:type.json") => (t, n) => s.send({
1397
1410
  url: e,
1398
1411
  method: "post",
1399
1412
  params: { type: t },
1400
1413
  data: {
1401
1414
  type: t,
1402
- data: s
1415
+ data: n
1403
1416
  },
1404
- settings: Pe
1405
- }), ws = (n, e = "/__vtj__/api/uploader.json") => async (t, s) => await n.send({
1417
+ settings: xe
1418
+ }), Sn = (s, e = "/__vtj__/api/uploader.json") => async (t, n) => await s.send({
1406
1419
  url: e,
1407
1420
  method: "post",
1408
1421
  data: {
1409
1422
  files: t,
1410
- projectId: s
1423
+ projectId: n
1411
1424
  },
1412
1425
  settings: {
1413
- ...Pe,
1426
+ ...xe,
1414
1427
  type: "data"
1415
1428
  }
1416
1429
  }).then((r) => r && r[0] ? r[0] : null).catch(() => null);
1417
- function Is(n) {
1418
- return de({
1430
+ function Mn(s) {
1431
+ return pe({
1419
1432
  settings: {
1420
1433
  type: "json",
1421
1434
  validSuccess: !0,
@@ -1423,17 +1436,17 @@ function Is(n) {
1423
1436
  failMessage: !0,
1424
1437
  validate: (e) => e.data?.code === 0,
1425
1438
  showError: (e) => {
1426
- n && n(e || "未知错误");
1439
+ s && s(e || "未知错误");
1427
1440
  }
1428
1441
  }
1429
1442
  });
1430
1443
  }
1431
- class se {
1444
+ class ne {
1432
1445
  api;
1433
1446
  pluginCaches = {};
1434
1447
  uploader;
1435
1448
  constructor(e = z) {
1436
- this.api = _s(e), this.uploader = ws(e);
1449
+ this.api = wn(e), this.uploader = Sn(e);
1437
1450
  }
1438
1451
  async getExtension() {
1439
1452
  console.log("BaseService.getExtension");
@@ -1506,11 +1519,11 @@ class se {
1506
1519
  return await this.api("clearStaticFiles", e).catch(() => "");
1507
1520
  }
1508
1521
  async getPluginMaterial(e) {
1509
- const { urls: t = [] } = e, s = t.filter((o) => ot(o))[0];
1510
- if (!s) return null;
1511
- const r = this.pluginCaches[s];
1512
- return r || (this.pluginCaches[s] = z.send({
1513
- url: s,
1522
+ const { urls: t = [] } = e, n = t.filter((o) => ot(o))[0];
1523
+ if (!n) return null;
1524
+ const r = this.pluginCaches[n];
1525
+ return r || (this.pluginCaches[n] = z.send({
1526
+ url: n,
1514
1527
  method: "get",
1515
1528
  settings: {
1516
1529
  validSuccess: !1,
@@ -1527,9 +1540,9 @@ const v = new qe({
1527
1540
  expired: 0,
1528
1541
  prefix: "__VTJ_"
1529
1542
  });
1530
- class Ms extends se {
1543
+ class Dn extends ne {
1531
1544
  init(e) {
1532
- const t = new H(e), s = v.get(`project_${t.id}`), r = Object.assign(t.toDsl(), s || {});
1545
+ const t = new H(e), n = v.get(`project_${t.id}`), r = Object.assign(t.toDsl(), n || {});
1533
1546
  return v.save(`project_${t.id}`, r), Promise.resolve(r);
1534
1547
  }
1535
1548
  saveProject(e) {
@@ -1561,30 +1574,30 @@ class Ms extends se {
1561
1574
  return Promise.resolve(!0);
1562
1575
  }
1563
1576
  getHistory(e) {
1564
- const t = v.get(`history_${e}`), s = new ue(t || { id: e });
1565
- return Promise.resolve(s.toDsl());
1577
+ const t = v.get(`history_${e}`), n = new ue(t || { id: e });
1578
+ return Promise.resolve(n.toDsl());
1566
1579
  }
1567
1580
  getHistoryItem(e, t) {
1568
- const s = v.get(`history_${e}_${t}`);
1569
- return Promise.resolve(s);
1581
+ const n = v.get(`history_${e}_${t}`);
1582
+ return Promise.resolve(n);
1570
1583
  }
1571
1584
  saveHistoryItem(e, t) {
1572
1585
  return v.save(`history_${e}_${t.id}`, t), Promise.resolve(!0);
1573
1586
  }
1574
1587
  removeHistoryItem(e, t) {
1575
- return t.forEach((s) => {
1576
- v.remove(`history_${e}_${s}`);
1588
+ return t.forEach((n) => {
1589
+ v.remove(`history_${e}_${n}`);
1577
1590
  }), Promise.resolve(!0);
1578
1591
  }
1579
1592
  }
1580
- class Ss extends se {
1593
+ class bn extends ne {
1581
1594
  projects = {};
1582
1595
  materials = {};
1583
1596
  files = {};
1584
1597
  histories = {};
1585
1598
  historyItems = {};
1586
1599
  init(e) {
1587
- const t = new H(e), s = this.projects[t.id] || {}, r = Object.assign(t.toDsl(), s);
1600
+ const t = new H(e), n = this.projects[t.id] || {}, r = Object.assign(t.toDsl(), n);
1588
1601
  return this.projects[r.id] = r, Promise.resolve(r);
1589
1602
  }
1590
1603
  saveProject(e) {
@@ -1616,29 +1629,29 @@ class Ss extends se {
1616
1629
  return Promise.resolve(!0);
1617
1630
  }
1618
1631
  getHistory(e) {
1619
- const t = this.histories[e], s = new ue(t || { id: e });
1620
- return Promise.resolve(s);
1632
+ const t = this.histories[e], n = new ue(t || { id: e });
1633
+ return Promise.resolve(n);
1621
1634
  }
1622
1635
  getHistoryItem(e, t) {
1623
- const s = `${e}_${t}`, r = this.historyItems[s] || {};
1636
+ const n = `${e}_${t}`, r = this.historyItems[n] || {};
1624
1637
  return Promise.resolve(r);
1625
1638
  }
1626
1639
  saveHistoryItem(e, t) {
1627
- const s = `${e}_${t.id}`;
1628
- return this.historyItems[s] = t, Promise.resolve(!0);
1640
+ const n = `${e}_${t.id}`;
1641
+ return this.historyItems[n] = t, Promise.resolve(!0);
1629
1642
  }
1630
1643
  removeHistoryItem(e, t) {
1631
- return t.forEach((s) => {
1632
- const r = `${e}_${s}`;
1644
+ return t.forEach((n) => {
1645
+ const r = `${e}_${n}`;
1633
1646
  delete this.historyItems[r];
1634
1647
  }), Promise.resolve(!0);
1635
1648
  }
1636
1649
  }
1637
1650
  let M = null;
1638
- function Ds() {
1639
- return M || (M = new Ss(), M);
1651
+ function Hn() {
1652
+ return M || (M = new bn(), M);
1640
1653
  }
1641
- class Hs extends se {
1654
+ class On extends ne {
1642
1655
  getFileCaches = {};
1643
1656
  async getExtension() {
1644
1657
  return await this.api("getExtension", {}).catch(() => {
@@ -1693,48 +1706,48 @@ class Hs extends se {
1693
1706
  );
1694
1707
  }
1695
1708
  }
1696
- function xe(n, e, t = []) {
1697
- return t.map((s) => {
1698
- const { id: r, title: o, icon: a, children: i, hidden: c } = s;
1709
+ function Pe(s, e, t = []) {
1710
+ return t.map((n) => {
1711
+ const { id: r, title: o, icon: a, children: i, hidden: c } = n;
1699
1712
  return {
1700
1713
  id: r,
1701
1714
  title: o,
1702
1715
  icon: a,
1703
1716
  hidden: c,
1704
- url: `${n}/${e}/${r}`,
1705
- children: i && i.length ? xe(n, e, i) : void 0
1717
+ url: `${s}/${e}/${r}`,
1718
+ children: i && i.length ? Pe(s, e, i) : void 0
1706
1719
  };
1707
1720
  });
1708
1721
  }
1709
- function Ce(n, e) {
1710
- if (!e) return n;
1722
+ function Ce(s, e) {
1723
+ if (!e) return s;
1711
1724
  let t = [];
1712
- for (const s of n)
1713
- if (s.children && s.children.length) {
1714
- const r = Ce(s.children, e);
1715
- r.length && (s.children = r, t.push(s));
1725
+ for (const n of s)
1726
+ if (n.children && n.children.length) {
1727
+ const r = Ce(n.children, e);
1728
+ r.length && (n.children = r, t.push(n));
1716
1729
  } else
1717
- e.can(s.id.toString()) && t.push(s);
1730
+ e.can(n.id.toString()) && t.push(n);
1718
1731
  return t;
1719
1732
  }
1720
- function Os(n) {
1733
+ function Bn(s) {
1721
1734
  const {
1722
1735
  menuPathPrefix: e = "",
1723
1736
  pageRouteName: t = "page",
1724
- disableMenusFilter: s = !1
1725
- } = n || {}, r = ke(), o = ye(), a = vt(), i = F(!1), c = F(!1), l = r.project;
1737
+ disableMenusFilter: n = !1
1738
+ } = s || {}, r = Re(), o = ye(), a = vt(), i = F(!1), c = F(!1), l = r.project;
1726
1739
  et(() => {
1727
- const { name: p, params: h, meta: m } = o;
1728
- if (p === C) {
1729
- const d = r.getPage(h.id);
1730
- i.value = !d?.mask, c.value = !!d?.pure;
1731
- } else if (p === D) {
1732
- const d = r.getHomepage();
1733
- i.value = !d?.mask, c.value = !!d?.pure;
1740
+ const { name: d, params: h, meta: m } = o;
1741
+ if (d === C) {
1742
+ const p = r.getPage(h.id);
1743
+ i.value = !p?.mask, c.value = !!p?.pure;
1744
+ } else if (d === D) {
1745
+ const p = r.getHomepage();
1746
+ i.value = !p?.mask, c.value = !!p?.pure;
1734
1747
  } else
1735
1748
  i.value = !m.mask, c.value = !!m.pure;
1736
1749
  });
1737
- const f = xe(
1750
+ const f = Pe(
1738
1751
  e,
1739
1752
  t,
1740
1753
  l?.pages
@@ -1744,46 +1757,46 @@ function Os(n) {
1744
1757
  logo: u?.logo,
1745
1758
  themeSwitchable: u?.themeSwitchable,
1746
1759
  title: u?.title || l?.description || l?.name || "VTJ App",
1747
- menus: s ? f : Ce(f, a),
1760
+ menus: n ? f : Ce(f, a),
1748
1761
  pure: c
1749
1762
  };
1750
1763
  }
1751
1764
  export {
1752
1765
  Se as ACCESS_KEY,
1753
- Fs as Access,
1766
+ Tn as Access,
1754
1767
  rt as BUILD_IN_TAGS,
1755
1768
  tt as BUILT_IN_DIRECTIVES,
1756
- se as BaseService,
1769
+ ne as BaseService,
1757
1770
  ce as CONTEXT_HOST,
1758
1771
  $t as Context,
1759
1772
  y as ContextMode,
1760
- st as DATA_TYPES,
1773
+ nt as DATA_TYPES,
1761
1774
  D as HOMEPAGE_ROUTE_NAME,
1762
- nt as HTML_TAGS,
1763
- Cs as JSCodeToString,
1764
- ks as LIFE_CYCLES_LIST,
1765
- Hs as LocalService,
1766
- Ss as MemoryService,
1767
- vs as NodeEnv,
1775
+ st as HTML_TAGS,
1776
+ Fn as JSCodeToString,
1777
+ xn as LIFE_CYCLES_LIST,
1778
+ On as LocalService,
1779
+ bn as MemoryService,
1780
+ yn as NodeEnv,
1768
1781
  C as PAGE_ROUTE_NAME,
1769
- ys as Provider,
1770
- ms as Startup,
1771
- Ms as StorageService,
1772
- x as VTJ_RENDERER_VERSION,
1782
+ _n as Provider,
1783
+ gn as Startup,
1784
+ Dn as StorageService,
1785
+ P as VTJ_RENDERER_VERSION,
1773
1786
  we as adoptedStyleSheets,
1774
- Ts as createAdapter,
1775
- Ps as createAssetScripts,
1776
- xs as createAssetsCss,
1787
+ An as createAdapter,
1788
+ Pn as createAssetScripts,
1789
+ Cn as createAssetsCss,
1777
1790
  Ft as createDataSources,
1778
1791
  Y as createLoader,
1779
- Ds as createMemoryService,
1792
+ Hn as createMemoryService,
1780
1793
  _t as createMetaApi,
1781
1794
  bt as createMock,
1782
- As as createProvider,
1795
+ In as createProvider,
1783
1796
  G as createRenderer,
1784
1797
  yt as createSchemaApi,
1785
1798
  wt as createSchemaApis,
1786
- Is as createServiceRequest,
1799
+ Mn as createServiceRequest,
1787
1800
  It as defaultLoader,
1788
1801
  I as fillBasePath,
1789
1802
  $e as getModifiers,
@@ -1797,10 +1810,10 @@ export {
1797
1810
  ot as isJSON,
1798
1811
  ee as isJSUrl,
1799
1812
  ht as isNativeTag,
1800
- dt as isVuePlugin,
1813
+ pt as isVuePlugin,
1801
1814
  lt as loadCss,
1802
1815
  ut as loadCssUrl,
1803
- pt as loadScriptUrl,
1816
+ dt as loadScriptUrl,
1804
1817
  jt as mockApi,
1805
1818
  St as mockApis,
1806
1819
  be as mockCleanup,
@@ -1808,10 +1821,10 @@ export {
1808
1821
  at as parseDeps,
1809
1822
  T as parseExpression,
1810
1823
  W as parseFunction,
1811
- Re as providerKey,
1824
+ ke as providerKey,
1812
1825
  it as removeProdFlag,
1813
1826
  _e as toString,
1814
1827
  vt as useAccess,
1815
- Os as useMask,
1816
- ke as useProvider
1828
+ Bn as useMask,
1829
+ Re as useProvider
1817
1830
  };