@opengis/cms 0.0.56 → 0.0.58
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +131 -131
- package/dist/AddNewItemInTree-05PSSEFi.js +76 -0
- package/dist/ArticlesPage-CFjE_cw_.js +298 -0
- package/dist/CollectionsBreadcrumb-BCxeRikP.js +4 -0
- package/dist/CollectionsBreadcrumb.vue_vue_type_script_setup_true_lang-umRzB5mY.js +53 -0
- package/dist/CollectionsPage-DHfPNql6.js +124 -0
- package/dist/{CreateForm-BMOBeP4G.js → CreateForm-5FvT45vH.js} +1 -1
- package/dist/Dashboard-C1eGscNd.js +358 -0
- package/dist/EditCollectionPage-DIr1tdtn.js +187 -0
- package/dist/{EmptyData-DaZt_nAm.js → EmptyData-DxPrSXhV.js} +1 -1
- package/dist/{MenuAddPage-Bf48Z-ah.js → MenuAddPage-D-p3gFgm.js} +40 -35
- package/dist/MenuBody-rN5j4YBu.js +125 -0
- package/dist/MenuItemPage-BoJw885D.js +1027 -0
- package/dist/MenuList-DFEBS0NB.js +172 -0
- package/dist/MenuPage-BCZB_S8j.js +107 -0
- package/dist/MenuWrapper-AZ_8s-zd.js +12 -0
- package/dist/MonacoEditor-Db-3Jc3E.js +4 -0
- package/dist/{UniversalTable.vue_vue_type_script_setup_true_lang-CJGTsd1V.js → UniversalTable-CzqPG-tY.js} +12 -12
- package/dist/{UniversalTablePagination.vue_vue_type_script_setup_true_lang-GYZd_gkA.js → UniversalTablePagination-4gL47A7I.js} +1 -1
- package/dist/VsFormTags-CMjiu9sY.js +114 -0
- package/dist/VsPreview-DwETkOpb.js +63 -0
- package/dist/contentForm-CtMhQTG0.js +489 -0
- package/dist/getField-CpwVE28P.js +179 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.html +29 -29
- package/dist/index.js +72 -71
- package/dist/style.css +1 -1
- package/dist/vs-builder-edit-D-q1o8tF.js +604 -0
- package/dist/vs-builder-monaco-B3Jj0V31.js +33 -0
- package/dist/vs-builder-preview-BH4VAM3a.js +44 -0
- package/dist/vs-form-custom-datatable-BDZo48w3.js +317 -0
- package/dist/vs-form-integer-BZ855R3g.js +61 -0
- package/dist/vs-form-media-select-NY27EaG1.js +837 -0
- package/dist/vs-form-reference-list-Dtv8fJJU.js +1536 -0
- package/dist/vs-form-reletion-link-BhzNQszm.js +34 -0
- package/dist/vs-form-tiptap-DDFQjRjY.js +4 -0
- package/dist/vs-form-tiptap.vue_vue_type_script_setup_true_lang-DGgsqXwg.js +11 -0
- package/dist/vs-richtext-md-C098v_6Q.js +4 -0
- package/dist/vs-richtext-md.vue_vue_type_script_setup_true_lang-Ct8uTV-J.js +14 -0
- package/input-types.json +9 -9
- package/locales/en.json +815 -814
- package/locales/uk.json +813 -812
- package/module/cms/cls/content.status.json +17 -17
- package/module/cms/cls/user_type.json +9 -9
- package/module/cms/form/admin.users.form.json +77 -77
- package/module/cms/select/cms.page_type.sql +1 -1
- package/module/cms/select/news_tag_id.sql +11 -11
- package/module/cms/table/admin.users.table.json +53 -53
- package/module/cms/table/collection.default.table.json +96 -96
- package/module/cms/table/single.default.table.json +116 -116
- package/package.json +68 -68
- package/plugin.js +43 -43
- package/server/app.js +35 -35
- package/server/config.js +4 -4
- package/server/functions/getContent.js +45 -45
- package/server/functions/getDraftKey.js +22 -22
- package/server/functions/getSearchData.js +31 -31
- package/server/functions/getTags.js +30 -30
- package/server/functions/getUser.js +27 -27
- package/server/functions/utils/mock.reply.js +55 -55
- package/server/index.js +22 -22
- package/server/migrations/fixes.sql +129 -129
- package/server/migrations/site.sql +595 -595
- package/server/plugins/adminHook.js +78 -78
- package/server/plugins/hook.js +59 -59
- package/server/plugins/vite.js +75 -75
- package/server/routes/category/controllers/cms.category.delete.js +21 -21
- package/server/routes/category/controllers/cms.category.get.js +17 -17
- package/server/routes/category/controllers/cms.category.list.js +16 -16
- package/server/routes/category/controllers/cms.category.post.js +21 -21
- package/server/routes/category/controllers/cms.category.put.js +23 -23
- package/server/routes/category/index.mjs +22 -22
- package/server/routes/cms/controllers/cmsStat.js +55 -55
- package/server/routes/cms/controllers/cmsSuggest.js +57 -57
- package/server/routes/cms/controllers/deleteContent.js +113 -113
- package/server/routes/cms/controllers/deleteMedia.js +76 -76
- package/server/routes/cms/controllers/downloadMedia.js +84 -84
- package/server/routes/cms/controllers/getContent.js +113 -113
- package/server/routes/cms/controllers/getContentBySlug.js +93 -93
- package/server/routes/cms/controllers/insertContent.js +217 -217
- package/server/routes/cms/controllers/listMedia.js +155 -155
- package/server/routes/cms/controllers/metadataMedia.js +39 -39
- package/server/routes/cms/controllers/properties.get.js +18 -18
- package/server/routes/cms/controllers/properties.post.js +99 -99
- package/server/routes/cms/controllers/searchContent.js +214 -214
- package/server/routes/cms/controllers/translate.js +89 -89
- package/server/routes/cms/controllers/updateContent.js +266 -264
- package/server/routes/cms/controllers/uploadMedia.js +79 -79
- package/server/routes/cms/functions/getSettings.js +48 -48
- package/server/routes/cms/index.mjs +112 -112
- package/server/routes/cms/utils/additionalData.js +35 -35
- package/server/routes/cms/utils/getCollection.js +89 -89
- package/server/routes/cms/utils/getSingle.js +188 -183
- package/server/routes/cms/utils/inputTypes.js +5 -5
- package/server/routes/cms/utils/insertContentLocalization.js +104 -104
- package/server/routes/cms/utils/requestTranslation.js +85 -85
- package/server/routes/cms/utils/updateLocalization.js +47 -47
- package/server/routes/cmsSpace/controllers/deleteSpace.js +25 -25
- package/server/routes/cmsSpace/controllers/getSpaces.js +27 -27
- package/server/routes/cmsSpace/controllers/insertSpace.js +21 -21
- package/server/routes/cmsSpace/controllers/updateSpace.js +23 -23
- package/server/routes/cmsSpace/index.mjs +20 -20
- package/server/routes/contentType/controllers/addContentType.js +160 -160
- package/server/routes/contentType/controllers/contentTypeList.js +54 -54
- package/server/routes/contentType/controllers/delContentType.js +75 -75
- package/server/routes/contentType/controllers/editContentType.js +88 -81
- package/server/routes/contentType/controllers/getContentType.js +65 -57
- package/server/routes/contentType/index.mjs +35 -35
- package/server/routes/contentType/utils/updateContents.js +44 -44
- package/server/routes/contentType/utils/updateCustomContentTable.js +53 -53
- package/server/routes/feedback/controllers/email.list.js +24 -24
- package/server/routes/feedback/controllers/feedback.js +48 -48
- package/server/routes/feedback/controllers/feedback.list.js +37 -37
- package/server/routes/feedback/controllers/news.subscriptions.js +44 -44
- package/server/routes/feedback/index.mjs +71 -71
- package/server/routes/logs/controllers/export.user.logs.js +77 -77
- package/server/routes/logs/controllers/user.logs.js +44 -44
- package/server/routes/logs/index.mjs +9 -9
- package/server/routes/menu/controllers/addMenu.js +37 -37
- package/server/routes/menu/controllers/delMenu.js +31 -31
- package/server/routes/menu/controllers/editMenu.js +41 -41
- package/server/routes/menu/controllers/getMenu.js +24 -24
- package/server/routes/menu/functions/getMenu.js +50 -50
- package/server/routes/menu/index.mjs +13 -13
- package/server/routes/migration/controllers/collectionToCustom.js +137 -137
- package/server/routes/migration/index.mjs +8 -8
- package/server/routes/root.mjs +8 -8
- package/server/routes/tags/controllers/add.tags.js +24 -24
- package/server/routes/tags/controllers/del.tags.js +19 -19
- package/server/routes/tags/controllers/edit.tags.js +25 -25
- package/server/routes/tags/controllers/get.tags.js +15 -15
- package/server/routes/tags/index.mjs +14 -14
- package/server/templates/cls/cms.category_type.json +9 -9
- package/server/templates/cls/cms.content_review_status.json +9 -9
- package/server/templates/cls/cms.content_status.json +9 -9
- package/server/templates/cls/cms.content_type.json +9 -9
- package/server/templates/cls/cms.lang.json +9 -9
- package/server/templates/page/login.html +126 -126
- package/utils.d.ts +52 -52
- package/utils.js +8 -8
- package/dist/ArticlesPage-BcR1hbds.js +0 -286
- package/dist/BuilderPage-CK_osM89.js +0 -386
- package/dist/CollectionsBreadcrumb.vue_vue_type_script_setup_true_lang-CnOe9ORD.js +0 -45
- package/dist/CollectionsPage-JfmrHNR_.js +0 -110
- package/dist/EditCollectionPage-Cw3GQYRe.js +0 -809
- package/dist/MenuItemPage-CXn5HC8j.js +0 -1366
- package/dist/MenuPage-tJZtK46W.js +0 -106
- package/dist/contentForm-B6gHgGkz.js +0 -586
- package/dist/getField-Y5WXnRR0.js +0 -2948
|
@@ -1,1366 +0,0 @@
|
|
|
1
|
-
import { openBlock as w, createElementBlock as F, createStaticVNode as Re, defineComponent as D, ref as k, normalizeClass as B, createTextVNode as X, toDisplayString as _, createCommentVNode as $, createBlock as O, unref as y, withModifiers as Y, createVNode as A, createElementVNode as v, withDirectives as Le, withKeys as te, vModelText as Me, watch as Ue, resolveComponent as De, withCtx as j, nextTick as ne, mergeModels as Ye, useModel as pe, onBeforeMount as Be, Fragment as $e, computed as Pe, onMounted as Ve } from "vue";
|
|
2
|
-
import { d as He } from "./vuedraggable-CoAPPFYd.js";
|
|
3
|
-
import { _ as qe } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
4
|
-
import { Pencil as je, Trash2 as Ke, Check as Ge, X as Qe, Plus as We, ArrowLeft as ze, HelpCircle as Ze, Save as Xe } from "lucide-vue-next";
|
|
5
|
-
import { confirm as Je, VsModal as er, notify as I } from "@opengis/core";
|
|
6
|
-
import { useI18n as H } from "vue-i18n";
|
|
7
|
-
import rr, { inputs as K, VForm as ve } from "@opengis/form";
|
|
8
|
-
import { _ as he } from "./MonacoEditor.vue_vue_type_script_setup_true_lang-B1DrxmQX.js";
|
|
9
|
-
import { useRouter as tr, useRoute as nr } from "vue-router";
|
|
10
|
-
const ir = {}, lr = {
|
|
11
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
12
|
-
width: "24",
|
|
13
|
-
height: "24",
|
|
14
|
-
viewBox: "0 0 24 24",
|
|
15
|
-
fill: "none",
|
|
16
|
-
stroke: "currentColor",
|
|
17
|
-
"stroke-width": "2",
|
|
18
|
-
"stroke-linecap": "round",
|
|
19
|
-
"stroke-linejoin": "round"
|
|
20
|
-
};
|
|
21
|
-
function ar(e, r) {
|
|
22
|
-
return w(), F("svg", lr, [...r[0] || (r[0] = [
|
|
23
|
-
Re('<circle cx="9" cy="12" r="1"></circle><circle cx="9" cy="5" r="1"></circle><circle cx="9" cy="19" r="1"></circle><circle cx="15" cy="12" r="1"></circle><circle cx="15" cy="5" r="1"></circle><circle cx="15" cy="19" r="1"></circle>', 6)
|
|
24
|
-
])]);
|
|
25
|
-
}
|
|
26
|
-
const ur = /* @__PURE__ */ qe(ir, [["render", ar]]), or = {
|
|
27
|
-
key: 0,
|
|
28
|
-
class: "p-3 flex items-center gap-x-3 cursor-grab bg-gray-100 border border-gray-300 rounded-lg font-medium text-sm text-gray-800 dark:bg-neutral-900 dark:border-neutral-700 dark:text-neutral-200"
|
|
29
|
-
}, sr = {
|
|
30
|
-
key: 0,
|
|
31
|
-
class: "text-xs text-gray-500 dark:text-neutral-400 ml-2"
|
|
32
|
-
}, cr = {
|
|
33
|
-
key: 1,
|
|
34
|
-
class: "p-3 flex items-center gap-x-2 bg-gray-100 border border-gray-300 rounded-lg dark:bg-neutral-900 dark:border-neutral-700"
|
|
35
|
-
}, fr = { class: "text-sm font-medium text-gray-800 dark:text-neutral-200 shrink-0" }, mr = /* @__PURE__ */ D({
|
|
36
|
-
__name: "MenuItem",
|
|
37
|
-
props: {
|
|
38
|
-
title: {},
|
|
39
|
-
value: {}
|
|
40
|
-
},
|
|
41
|
-
emits: ["delete", "update:value"],
|
|
42
|
-
setup(e, { emit: r }) {
|
|
43
|
-
const t = e, i = r, n = k(!1), a = k(""), l = () => {
|
|
44
|
-
typeof t.value == "string" && (a.value = t.value, n.value = !0);
|
|
45
|
-
}, u = () => {
|
|
46
|
-
typeof t.value == "string" && (i("update:value", a.value), n.value = !1);
|
|
47
|
-
}, o = () => {
|
|
48
|
-
n.value = !1, a.value = "";
|
|
49
|
-
};
|
|
50
|
-
return (s, m) => (w(), F("div", {
|
|
51
|
-
class: B([{ "space-y-1": typeof e.value != "string" }, "dark:bg-transparent"])
|
|
52
|
-
}, [
|
|
53
|
-
n.value ? (w(), F("div", cr, [
|
|
54
|
-
v("span", fr, _(e.title) + ":", 1),
|
|
55
|
-
Le(v("input", {
|
|
56
|
-
"onUpdate:modelValue": m[1] || (m[1] = (p) => a.value = p),
|
|
57
|
-
onKeyup: [
|
|
58
|
-
te(u, ["enter"]),
|
|
59
|
-
te(o, ["esc"])
|
|
60
|
-
],
|
|
61
|
-
onBlur: u,
|
|
62
|
-
class: "flex-1 px-2 py-1 text-sm border border-gray-300 rounded dark:bg-neutral-800 dark:border-neutral-600 dark:text-neutral-200 focus:outline-none focus:ring-2 focus:ring-blue-500",
|
|
63
|
-
type: "text",
|
|
64
|
-
placeholder: "/link"
|
|
65
|
-
}, null, 544), [
|
|
66
|
-
[Me, a.value]
|
|
67
|
-
]),
|
|
68
|
-
v("button", {
|
|
69
|
-
onClick: Y(u, ["stop"]),
|
|
70
|
-
class: "shrink-0 p-1 text-green-600 dark:text-green-400 hover:bg-green-50 dark:hover:bg-green-900/20 rounded",
|
|
71
|
-
title: "Save"
|
|
72
|
-
}, [
|
|
73
|
-
A(y(Ge), { class: "size-4" })
|
|
74
|
-
]),
|
|
75
|
-
v("button", {
|
|
76
|
-
onClick: Y(o, ["stop"]),
|
|
77
|
-
class: "shrink-0 p-1 text-red-600 dark:text-red-400 hover:bg-red-50 dark:hover:bg-red-900/20 rounded",
|
|
78
|
-
title: "Cancel"
|
|
79
|
-
}, [
|
|
80
|
-
A(y(Qe), { class: "size-4" })
|
|
81
|
-
])
|
|
82
|
-
])) : (w(), F("div", or, [
|
|
83
|
-
X(_(e.title) + " ", 1),
|
|
84
|
-
typeof e.value == "string" ? (w(), F("span", sr, _(e.value), 1)) : $("", !0),
|
|
85
|
-
typeof e.value == "string" ? (w(), O(y(je), {
|
|
86
|
-
key: 1,
|
|
87
|
-
class: "shrink-0 size-4 ml-auto text-gray-500 dark:text-neutral-500 cursor-pointer hover:text-blue-600 dark:hover:text-blue-400",
|
|
88
|
-
onClick: Y(l, ["stop"])
|
|
89
|
-
})) : $("", !0),
|
|
90
|
-
A(y(Ke), {
|
|
91
|
-
class: "shrink-0 size-4 text-gray-500 dark:text-neutral-500 cursor-pointer hover:text-red-600 dark:hover:text-red-400",
|
|
92
|
-
onClick: m[0] || (m[0] = Y((p) => i("delete"), ["stop"]))
|
|
93
|
-
}),
|
|
94
|
-
A(ur, { class: "shrink-0 size-4 cursor-pointer text-gray-500 dark:text-neutral-500" })
|
|
95
|
-
]))
|
|
96
|
-
], 2));
|
|
97
|
-
}
|
|
98
|
-
}), dr = { class: "space-y-1" }, pr = /* @__PURE__ */ D({
|
|
99
|
-
__name: "MenuList",
|
|
100
|
-
props: {
|
|
101
|
-
list: {
|
|
102
|
-
type: Array,
|
|
103
|
-
default: () => []
|
|
104
|
-
},
|
|
105
|
-
inside: {
|
|
106
|
-
type: Boolean,
|
|
107
|
-
default: !1
|
|
108
|
-
}
|
|
109
|
-
},
|
|
110
|
-
emits: ["update:list", "delete:item"],
|
|
111
|
-
setup(e, { emit: r }) {
|
|
112
|
-
const { t } = H(), i = e, n = r, a = k([]);
|
|
113
|
-
Ue(
|
|
114
|
-
() => i.list,
|
|
115
|
-
(m) => {
|
|
116
|
-
a.value = m ? [...m] : [];
|
|
117
|
-
},
|
|
118
|
-
{ immediate: !0, deep: !0 }
|
|
119
|
-
);
|
|
120
|
-
const l = () => {
|
|
121
|
-
n("update:list", a.value);
|
|
122
|
-
}, u = (m) => {
|
|
123
|
-
Je({
|
|
124
|
-
title: t("cms.builder.deleteTitle"),
|
|
125
|
-
message: t("cms.builder.deleteObject"),
|
|
126
|
-
type: "error",
|
|
127
|
-
onConfirm: () => {
|
|
128
|
-
n("update:list", a.value), n("delete:item", m);
|
|
129
|
-
}
|
|
130
|
-
});
|
|
131
|
-
}, o = (m, p) => {
|
|
132
|
-
m.value = p, ne(() => {
|
|
133
|
-
a.value = [...a.value], n("update:list", a.value);
|
|
134
|
-
});
|
|
135
|
-
}, s = (m, p) => {
|
|
136
|
-
m.children = p, ne(() => {
|
|
137
|
-
a.value = [...a.value], n("update:list", a.value);
|
|
138
|
-
});
|
|
139
|
-
};
|
|
140
|
-
return (m, p) => {
|
|
141
|
-
const c = De("MenuList", !0);
|
|
142
|
-
return w(), O(y(He), {
|
|
143
|
-
tag: "ul",
|
|
144
|
-
list: a.value,
|
|
145
|
-
group: { name: "nested", pull: !0, put: !0 },
|
|
146
|
-
"item-key": "id",
|
|
147
|
-
class: B(["nested-sortable space-y-1", { "ps-5 dark:bg-transparent": e.inside }]),
|
|
148
|
-
onChange: l,
|
|
149
|
-
onEnd: l
|
|
150
|
-
}, {
|
|
151
|
-
item: j(({ element: d }) => [
|
|
152
|
-
v("div", dr, [
|
|
153
|
-
A(mr, {
|
|
154
|
-
title: d.title,
|
|
155
|
-
value: d.value,
|
|
156
|
-
onDelete: (f) => u(d),
|
|
157
|
-
"onUpdate:value": (f) => o(d, f)
|
|
158
|
-
}, null, 8, ["title", "value", "onDelete", "onUpdate:value"]),
|
|
159
|
-
Array.isArray(d.children) ? (w(), O(c, {
|
|
160
|
-
key: 0,
|
|
161
|
-
list: d.children,
|
|
162
|
-
inside: !0,
|
|
163
|
-
"onUpdate:list": (f) => s(d, f),
|
|
164
|
-
"onDelete:item": u
|
|
165
|
-
}, null, 8, ["list", "onUpdate:list"])) : $("", !0)
|
|
166
|
-
])
|
|
167
|
-
]),
|
|
168
|
-
_: 1
|
|
169
|
-
}, 8, ["list", "class"]);
|
|
170
|
-
};
|
|
171
|
-
}
|
|
172
|
-
}), vr = { class: "flex justify-end p-[20px] gap-[10px] border-t w-full" }, hr = /* @__PURE__ */ D({
|
|
173
|
-
__name: "AddNewItemInTree",
|
|
174
|
-
props: {
|
|
175
|
-
isOpen: { type: Boolean, required: !0 },
|
|
176
|
-
isOpenModifiers: {}
|
|
177
|
-
},
|
|
178
|
-
emits: /* @__PURE__ */ Ye(["addNewItem"], ["update:isOpen"]),
|
|
179
|
-
setup(e, { emit: r }) {
|
|
180
|
-
const { t } = H(), i = pe(e, "isOpen"), n = k({}), a = r, l = k({}), u = {
|
|
181
|
-
title: {
|
|
182
|
-
type: "text",
|
|
183
|
-
label: t("cms.menu.form.name"),
|
|
184
|
-
required: !0,
|
|
185
|
-
placeholder: t("cms.menu.form.name"),
|
|
186
|
-
validators: ["required"]
|
|
187
|
-
},
|
|
188
|
-
value: {
|
|
189
|
-
type: "text",
|
|
190
|
-
label: t("cms.menu.form.value"),
|
|
191
|
-
required: !0,
|
|
192
|
-
placeholder: t("cms.menu.form.value"),
|
|
193
|
-
validators: ["required"]
|
|
194
|
-
}
|
|
195
|
-
}, o = async () => {
|
|
196
|
-
if (await n.value.validate()) {
|
|
197
|
-
I({
|
|
198
|
-
type: "warning",
|
|
199
|
-
title: t("cms.common.actions.warning"),
|
|
200
|
-
message: t("cms.menu.createMenuFailed")
|
|
201
|
-
});
|
|
202
|
-
return;
|
|
203
|
-
}
|
|
204
|
-
a("addNewItem", l.value), l.value = {};
|
|
205
|
-
};
|
|
206
|
-
return (s, m) => (w(), O(y(er), {
|
|
207
|
-
teleport: "#modal",
|
|
208
|
-
visible: i.value,
|
|
209
|
-
title: s.$t("cms.menu.createMenu"),
|
|
210
|
-
template: "default",
|
|
211
|
-
closeClickBack: !1,
|
|
212
|
-
onClose: m[3] || (m[3] = (p) => i.value = !1)
|
|
213
|
-
}, {
|
|
214
|
-
footer: j(() => [
|
|
215
|
-
v("div", vr, [
|
|
216
|
-
v("button", {
|
|
217
|
-
class: "inline-flex items-center px-3 py-2 text-sm text-black duration-300 border border-gray-200 rounded-lg gap-x-2 whitespace-nowrap hover:bg-gray-100",
|
|
218
|
-
onClick: m[2] || (m[2] = (p) => {
|
|
219
|
-
i.value = !1, l.value = {};
|
|
220
|
-
})
|
|
221
|
-
}, _(s.$t("cms.common.actions.cancel")), 1),
|
|
222
|
-
v("button", {
|
|
223
|
-
onClick: o,
|
|
224
|
-
class: "py-2 px-3 inline-flex items-center gap-x-2 text-sm whitespace-nowrap text-white bg-blue-500 rounded-lg !border-gray-200 hover:bg-blue-700 duration-300"
|
|
225
|
-
}, _(s.$t("cms.common.actions.save")), 1)
|
|
226
|
-
])
|
|
227
|
-
]),
|
|
228
|
-
default: j(() => [
|
|
229
|
-
A(y(rr), {
|
|
230
|
-
form: n.value,
|
|
231
|
-
"onUpdate:form": m[0] || (m[0] = (p) => n.value = p),
|
|
232
|
-
modelValue: l.value,
|
|
233
|
-
"onUpdate:modelValue": m[1] || (m[1] = (p) => l.value = p),
|
|
234
|
-
schema: u
|
|
235
|
-
}, null, 8, ["form", "modelValue"])
|
|
236
|
-
]),
|
|
237
|
-
_: 1
|
|
238
|
-
}, 8, ["visible", "title"]));
|
|
239
|
-
}
|
|
240
|
-
}), xr = /* @__PURE__ */ D({
|
|
241
|
-
__name: "MenuBody",
|
|
242
|
-
props: {
|
|
243
|
-
modelValue: {},
|
|
244
|
-
modelModifiers: {}
|
|
245
|
-
},
|
|
246
|
-
emits: ["update:modelValue"],
|
|
247
|
-
setup(e) {
|
|
248
|
-
K["vs-input-monaco-editor"] = he;
|
|
249
|
-
const { t: r } = H(), t = k(!1), i = k(null), n = pe(e, "modelValue"), a = k({}), l = async (c) => {
|
|
250
|
-
try {
|
|
251
|
-
if (await a.value.validate()) {
|
|
252
|
-
I({
|
|
253
|
-
type: "warning",
|
|
254
|
-
title: r("cms.common.actions.warning"),
|
|
255
|
-
message: r("cms.menu.createMenuFailed")
|
|
256
|
-
});
|
|
257
|
-
return;
|
|
258
|
-
}
|
|
259
|
-
t.value = !1, c.id = Math.random().toString(36).substr(2, 9), c.children = [], n.value.items.unshift(c);
|
|
260
|
-
} catch (d) {
|
|
261
|
-
console.log(d);
|
|
262
|
-
}
|
|
263
|
-
}, u = k([
|
|
264
|
-
{
|
|
265
|
-
key: "name",
|
|
266
|
-
title: r("cms.common.title"),
|
|
267
|
-
type: "text",
|
|
268
|
-
placeholder: r("cms.common.title"),
|
|
269
|
-
required: !0,
|
|
270
|
-
validators: ["required"]
|
|
271
|
-
},
|
|
272
|
-
{
|
|
273
|
-
key: "description",
|
|
274
|
-
title: r("cms.common.description"),
|
|
275
|
-
type: "text",
|
|
276
|
-
placeholder: r("cms.common.description"),
|
|
277
|
-
required: !0,
|
|
278
|
-
validators: ["required"]
|
|
279
|
-
},
|
|
280
|
-
{
|
|
281
|
-
key: "locale",
|
|
282
|
-
title: r("cms.menu.form.language"),
|
|
283
|
-
type: "select",
|
|
284
|
-
placeholder: r("cms.menu.form.language"),
|
|
285
|
-
required: !0,
|
|
286
|
-
options: [
|
|
287
|
-
{ text: "Ukrainian", id: "uk" },
|
|
288
|
-
{ text: "English", id: "en" }
|
|
289
|
-
],
|
|
290
|
-
validators: ["required"]
|
|
291
|
-
}
|
|
292
|
-
]), o = (c) => {
|
|
293
|
-
let d = [];
|
|
294
|
-
for (const f in c)
|
|
295
|
-
typeof c[f] == "object" ? d.push({
|
|
296
|
-
title: f,
|
|
297
|
-
value: "",
|
|
298
|
-
id: Math.random().toString(36).substr(2, 9),
|
|
299
|
-
children: o(c[f])
|
|
300
|
-
}) : d.push({
|
|
301
|
-
title: f,
|
|
302
|
-
value: c[f],
|
|
303
|
-
id: Math.random().toString(36).substr(2, 9),
|
|
304
|
-
children: []
|
|
305
|
-
});
|
|
306
|
-
return d;
|
|
307
|
-
}, s = (c) => {
|
|
308
|
-
n.value.items = c;
|
|
309
|
-
}, m = (c) => {
|
|
310
|
-
p(n.value.items, c.id);
|
|
311
|
-
};
|
|
312
|
-
function p(c, d) {
|
|
313
|
-
for (let f = c.length - 1; f >= 0; f--) {
|
|
314
|
-
if (c[f].id === d)
|
|
315
|
-
return c.splice(f, 1), !0;
|
|
316
|
-
if (c[f].children && c[f].children.length && p(c[f].children, d))
|
|
317
|
-
return !0;
|
|
318
|
-
}
|
|
319
|
-
return !1;
|
|
320
|
-
}
|
|
321
|
-
return Be(() => {
|
|
322
|
-
Array.isArray(n.value.items) || (n.value.items = o(n.value.items));
|
|
323
|
-
}), (c, d) => (w(), F($e, null, [
|
|
324
|
-
A(y(ve), {
|
|
325
|
-
schema: u.value,
|
|
326
|
-
modelValue: n.value,
|
|
327
|
-
"onUpdate:modelValue": d[0] || (d[0] = (f) => n.value = f),
|
|
328
|
-
form: a.value,
|
|
329
|
-
"onUpdate:form": d[1] || (d[1] = (f) => a.value = f)
|
|
330
|
-
}, null, 8, ["schema", "modelValue", "form"]),
|
|
331
|
-
v("button", {
|
|
332
|
-
onClick: d[2] || (d[2] = (f) => t.value = !0),
|
|
333
|
-
class: "inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium w-min ml-auto my-6 h-9 px-4 py-2 bg-blue-600 text-white shadow-md transition-all duration-200 transform hover:bg-blue-700 hover:shadow-lg hover:scale-105 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50"
|
|
334
|
-
}, [
|
|
335
|
-
A(y(We), { class: "w-4 h-4 mr-2" }),
|
|
336
|
-
X(" " + _(c.$t("cms.menu.createMenu")), 1)
|
|
337
|
-
]),
|
|
338
|
-
A(hr, {
|
|
339
|
-
isOpen: t.value,
|
|
340
|
-
"onUpdate:isOpen": d[3] || (d[3] = (f) => t.value = f),
|
|
341
|
-
form: i.value,
|
|
342
|
-
"onUpdate:form": d[4] || (d[4] = (f) => i.value = f),
|
|
343
|
-
onAddNewItem: l
|
|
344
|
-
}, null, 8, ["isOpen", "form"]),
|
|
345
|
-
A(pr, {
|
|
346
|
-
class: "px-2",
|
|
347
|
-
list: n.value.items,
|
|
348
|
-
"onUpdate:list": s,
|
|
349
|
-
"onDelete:item": m
|
|
350
|
-
}, null, 8, ["list"])
|
|
351
|
-
], 64));
|
|
352
|
-
}
|
|
353
|
-
});
|
|
354
|
-
/*! js-yaml 4.1.1 https://github.com/nodeca/js-yaml @license MIT */
|
|
355
|
-
function xe(e) {
|
|
356
|
-
return typeof e > "u" || e === null;
|
|
357
|
-
}
|
|
358
|
-
function gr(e) {
|
|
359
|
-
return typeof e == "object" && e !== null;
|
|
360
|
-
}
|
|
361
|
-
function yr(e) {
|
|
362
|
-
return Array.isArray(e) ? e : xe(e) ? [] : [e];
|
|
363
|
-
}
|
|
364
|
-
function wr(e, r) {
|
|
365
|
-
var t, i, n, a;
|
|
366
|
-
if (r)
|
|
367
|
-
for (a = Object.keys(r), t = 0, i = a.length; t < i; t += 1)
|
|
368
|
-
n = a[t], e[n] = r[n];
|
|
369
|
-
return e;
|
|
370
|
-
}
|
|
371
|
-
function kr(e, r) {
|
|
372
|
-
var t = "", i;
|
|
373
|
-
for (i = 0; i < r; i += 1)
|
|
374
|
-
t += e;
|
|
375
|
-
return t;
|
|
376
|
-
}
|
|
377
|
-
function Ar(e) {
|
|
378
|
-
return e === 0 && Number.NEGATIVE_INFINITY === 1 / e;
|
|
379
|
-
}
|
|
380
|
-
var br = xe, _r = gr, Er = yr, Fr = kr, Cr = Ar, Sr = wr, C = {
|
|
381
|
-
isNothing: br,
|
|
382
|
-
isObject: _r,
|
|
383
|
-
toArray: Er,
|
|
384
|
-
repeat: Fr,
|
|
385
|
-
isNegativeZero: Cr,
|
|
386
|
-
extend: Sr
|
|
387
|
-
};
|
|
388
|
-
function ge(e, r) {
|
|
389
|
-
var t = "", i = e.reason || "(unknown reason)";
|
|
390
|
-
return e.mark ? (e.mark.name && (t += 'in "' + e.mark.name + '" '), t += "(" + (e.mark.line + 1) + ":" + (e.mark.column + 1) + ")", !r && e.mark.snippet && (t += `
|
|
391
|
-
|
|
392
|
-
` + e.mark.snippet), i + " " + t) : i;
|
|
393
|
-
}
|
|
394
|
-
function R(e, r) {
|
|
395
|
-
Error.call(this), this.name = "YAMLException", this.reason = e, this.mark = r, this.message = ge(this, !1), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error().stack || "";
|
|
396
|
-
}
|
|
397
|
-
R.prototype = Object.create(Error.prototype);
|
|
398
|
-
R.prototype.constructor = R;
|
|
399
|
-
R.prototype.toString = function(r) {
|
|
400
|
-
return this.name + ": " + ge(this, r);
|
|
401
|
-
};
|
|
402
|
-
var b = R, Nr = [
|
|
403
|
-
"kind",
|
|
404
|
-
"multi",
|
|
405
|
-
"resolve",
|
|
406
|
-
"construct",
|
|
407
|
-
"instanceOf",
|
|
408
|
-
"predicate",
|
|
409
|
-
"represent",
|
|
410
|
-
"representName",
|
|
411
|
-
"defaultStyle",
|
|
412
|
-
"styleAliases"
|
|
413
|
-
], Or = [
|
|
414
|
-
"scalar",
|
|
415
|
-
"sequence",
|
|
416
|
-
"mapping"
|
|
417
|
-
];
|
|
418
|
-
function Tr(e) {
|
|
419
|
-
var r = {};
|
|
420
|
-
return e !== null && Object.keys(e).forEach(function(t) {
|
|
421
|
-
e[t].forEach(function(i) {
|
|
422
|
-
r[String(i)] = t;
|
|
423
|
-
});
|
|
424
|
-
}), r;
|
|
425
|
-
}
|
|
426
|
-
function Ir(e, r) {
|
|
427
|
-
if (r = r || {}, Object.keys(r).forEach(function(t) {
|
|
428
|
-
if (Nr.indexOf(t) === -1)
|
|
429
|
-
throw new b('Unknown option "' + t + '" is met in definition of "' + e + '" YAML type.');
|
|
430
|
-
}), this.options = r, this.tag = e, this.kind = r.kind || null, this.resolve = r.resolve || function() {
|
|
431
|
-
return !0;
|
|
432
|
-
}, this.construct = r.construct || function(t) {
|
|
433
|
-
return t;
|
|
434
|
-
}, this.instanceOf = r.instanceOf || null, this.predicate = r.predicate || null, this.represent = r.represent || null, this.representName = r.representName || null, this.defaultStyle = r.defaultStyle || null, this.multi = r.multi || !1, this.styleAliases = Tr(r.styleAliases || null), Or.indexOf(this.kind) === -1)
|
|
435
|
-
throw new b('Unknown kind "' + this.kind + '" is specified for "' + e + '" YAML type.');
|
|
436
|
-
}
|
|
437
|
-
var x = Ir;
|
|
438
|
-
function ie(e, r) {
|
|
439
|
-
var t = [];
|
|
440
|
-
return e[r].forEach(function(i) {
|
|
441
|
-
var n = t.length;
|
|
442
|
-
t.forEach(function(a, l) {
|
|
443
|
-
a.tag === i.tag && a.kind === i.kind && a.multi === i.multi && (n = l);
|
|
444
|
-
}), t[n] = i;
|
|
445
|
-
}), t;
|
|
446
|
-
}
|
|
447
|
-
function Rr() {
|
|
448
|
-
var e = {
|
|
449
|
-
scalar: {},
|
|
450
|
-
sequence: {},
|
|
451
|
-
mapping: {},
|
|
452
|
-
fallback: {},
|
|
453
|
-
multi: {
|
|
454
|
-
scalar: [],
|
|
455
|
-
sequence: [],
|
|
456
|
-
mapping: [],
|
|
457
|
-
fallback: []
|
|
458
|
-
}
|
|
459
|
-
}, r, t;
|
|
460
|
-
function i(n) {
|
|
461
|
-
n.multi ? (e.multi[n.kind].push(n), e.multi.fallback.push(n)) : e[n.kind][n.tag] = e.fallback[n.tag] = n;
|
|
462
|
-
}
|
|
463
|
-
for (r = 0, t = arguments.length; r < t; r += 1)
|
|
464
|
-
arguments[r].forEach(i);
|
|
465
|
-
return e;
|
|
466
|
-
}
|
|
467
|
-
function G(e) {
|
|
468
|
-
return this.extend(e);
|
|
469
|
-
}
|
|
470
|
-
G.prototype.extend = function(r) {
|
|
471
|
-
var t = [], i = [];
|
|
472
|
-
if (r instanceof x)
|
|
473
|
-
i.push(r);
|
|
474
|
-
else if (Array.isArray(r))
|
|
475
|
-
i = i.concat(r);
|
|
476
|
-
else if (r && (Array.isArray(r.implicit) || Array.isArray(r.explicit)))
|
|
477
|
-
r.implicit && (t = t.concat(r.implicit)), r.explicit && (i = i.concat(r.explicit));
|
|
478
|
-
else
|
|
479
|
-
throw new b("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");
|
|
480
|
-
t.forEach(function(a) {
|
|
481
|
-
if (!(a instanceof x))
|
|
482
|
-
throw new b("Specified list of YAML types (or a single Type object) contains a non-Type object.");
|
|
483
|
-
if (a.loadKind && a.loadKind !== "scalar")
|
|
484
|
-
throw new b("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");
|
|
485
|
-
if (a.multi)
|
|
486
|
-
throw new b("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.");
|
|
487
|
-
}), i.forEach(function(a) {
|
|
488
|
-
if (!(a instanceof x))
|
|
489
|
-
throw new b("Specified list of YAML types (or a single Type object) contains a non-Type object.");
|
|
490
|
-
});
|
|
491
|
-
var n = Object.create(G.prototype);
|
|
492
|
-
return n.implicit = (this.implicit || []).concat(t), n.explicit = (this.explicit || []).concat(i), n.compiledImplicit = ie(n, "implicit"), n.compiledExplicit = ie(n, "explicit"), n.compiledTypeMap = Rr(n.compiledImplicit, n.compiledExplicit), n;
|
|
493
|
-
};
|
|
494
|
-
var Lr = G, Mr = new x("tag:yaml.org,2002:str", {
|
|
495
|
-
kind: "scalar",
|
|
496
|
-
construct: function(e) {
|
|
497
|
-
return e !== null ? e : "";
|
|
498
|
-
}
|
|
499
|
-
}), Ur = new x("tag:yaml.org,2002:seq", {
|
|
500
|
-
kind: "sequence",
|
|
501
|
-
construct: function(e) {
|
|
502
|
-
return e !== null ? e : [];
|
|
503
|
-
}
|
|
504
|
-
}), Dr = new x("tag:yaml.org,2002:map", {
|
|
505
|
-
kind: "mapping",
|
|
506
|
-
construct: function(e) {
|
|
507
|
-
return e !== null ? e : {};
|
|
508
|
-
}
|
|
509
|
-
}), Yr = new Lr({
|
|
510
|
-
explicit: [
|
|
511
|
-
Mr,
|
|
512
|
-
Ur,
|
|
513
|
-
Dr
|
|
514
|
-
]
|
|
515
|
-
});
|
|
516
|
-
function Br(e) {
|
|
517
|
-
if (e === null)
|
|
518
|
-
return !0;
|
|
519
|
-
var r = e.length;
|
|
520
|
-
return r === 1 && e === "~" || r === 4 && (e === "null" || e === "Null" || e === "NULL");
|
|
521
|
-
}
|
|
522
|
-
function $r() {
|
|
523
|
-
return null;
|
|
524
|
-
}
|
|
525
|
-
function Pr(e) {
|
|
526
|
-
return e === null;
|
|
527
|
-
}
|
|
528
|
-
var Vr = new x("tag:yaml.org,2002:null", {
|
|
529
|
-
kind: "scalar",
|
|
530
|
-
resolve: Br,
|
|
531
|
-
construct: $r,
|
|
532
|
-
predicate: Pr,
|
|
533
|
-
represent: {
|
|
534
|
-
canonical: function() {
|
|
535
|
-
return "~";
|
|
536
|
-
},
|
|
537
|
-
lowercase: function() {
|
|
538
|
-
return "null";
|
|
539
|
-
},
|
|
540
|
-
uppercase: function() {
|
|
541
|
-
return "NULL";
|
|
542
|
-
},
|
|
543
|
-
camelcase: function() {
|
|
544
|
-
return "Null";
|
|
545
|
-
},
|
|
546
|
-
empty: function() {
|
|
547
|
-
return "";
|
|
548
|
-
}
|
|
549
|
-
},
|
|
550
|
-
defaultStyle: "lowercase"
|
|
551
|
-
});
|
|
552
|
-
function Hr(e) {
|
|
553
|
-
if (e === null)
|
|
554
|
-
return !1;
|
|
555
|
-
var r = e.length;
|
|
556
|
-
return r === 4 && (e === "true" || e === "True" || e === "TRUE") || r === 5 && (e === "false" || e === "False" || e === "FALSE");
|
|
557
|
-
}
|
|
558
|
-
function qr(e) {
|
|
559
|
-
return e === "true" || e === "True" || e === "TRUE";
|
|
560
|
-
}
|
|
561
|
-
function jr(e) {
|
|
562
|
-
return Object.prototype.toString.call(e) === "[object Boolean]";
|
|
563
|
-
}
|
|
564
|
-
var Kr = new x("tag:yaml.org,2002:bool", {
|
|
565
|
-
kind: "scalar",
|
|
566
|
-
resolve: Hr,
|
|
567
|
-
construct: qr,
|
|
568
|
-
predicate: jr,
|
|
569
|
-
represent: {
|
|
570
|
-
lowercase: function(e) {
|
|
571
|
-
return e ? "true" : "false";
|
|
572
|
-
},
|
|
573
|
-
uppercase: function(e) {
|
|
574
|
-
return e ? "TRUE" : "FALSE";
|
|
575
|
-
},
|
|
576
|
-
camelcase: function(e) {
|
|
577
|
-
return e ? "True" : "False";
|
|
578
|
-
}
|
|
579
|
-
},
|
|
580
|
-
defaultStyle: "lowercase"
|
|
581
|
-
});
|
|
582
|
-
function Gr(e) {
|
|
583
|
-
return 48 <= e && e <= 57 || 65 <= e && e <= 70 || 97 <= e && e <= 102;
|
|
584
|
-
}
|
|
585
|
-
function Qr(e) {
|
|
586
|
-
return 48 <= e && e <= 55;
|
|
587
|
-
}
|
|
588
|
-
function Wr(e) {
|
|
589
|
-
return 48 <= e && e <= 57;
|
|
590
|
-
}
|
|
591
|
-
function zr(e) {
|
|
592
|
-
if (e === null)
|
|
593
|
-
return !1;
|
|
594
|
-
var r = e.length, t = 0, i = !1, n;
|
|
595
|
-
if (!r)
|
|
596
|
-
return !1;
|
|
597
|
-
if (n = e[t], (n === "-" || n === "+") && (n = e[++t]), n === "0") {
|
|
598
|
-
if (t + 1 === r)
|
|
599
|
-
return !0;
|
|
600
|
-
if (n = e[++t], n === "b") {
|
|
601
|
-
for (t++; t < r; t++)
|
|
602
|
-
if (n = e[t], n !== "_") {
|
|
603
|
-
if (n !== "0" && n !== "1")
|
|
604
|
-
return !1;
|
|
605
|
-
i = !0;
|
|
606
|
-
}
|
|
607
|
-
return i && n !== "_";
|
|
608
|
-
}
|
|
609
|
-
if (n === "x") {
|
|
610
|
-
for (t++; t < r; t++)
|
|
611
|
-
if (n = e[t], n !== "_") {
|
|
612
|
-
if (!Gr(e.charCodeAt(t)))
|
|
613
|
-
return !1;
|
|
614
|
-
i = !0;
|
|
615
|
-
}
|
|
616
|
-
return i && n !== "_";
|
|
617
|
-
}
|
|
618
|
-
if (n === "o") {
|
|
619
|
-
for (t++; t < r; t++)
|
|
620
|
-
if (n = e[t], n !== "_") {
|
|
621
|
-
if (!Qr(e.charCodeAt(t)))
|
|
622
|
-
return !1;
|
|
623
|
-
i = !0;
|
|
624
|
-
}
|
|
625
|
-
return i && n !== "_";
|
|
626
|
-
}
|
|
627
|
-
}
|
|
628
|
-
if (n === "_")
|
|
629
|
-
return !1;
|
|
630
|
-
for (; t < r; t++)
|
|
631
|
-
if (n = e[t], n !== "_") {
|
|
632
|
-
if (!Wr(e.charCodeAt(t)))
|
|
633
|
-
return !1;
|
|
634
|
-
i = !0;
|
|
635
|
-
}
|
|
636
|
-
return !(!i || n === "_");
|
|
637
|
-
}
|
|
638
|
-
function Zr(e) {
|
|
639
|
-
var r = e, t = 1, i;
|
|
640
|
-
if (r.indexOf("_") !== -1 && (r = r.replace(/_/g, "")), i = r[0], (i === "-" || i === "+") && (i === "-" && (t = -1), r = r.slice(1), i = r[0]), r === "0")
|
|
641
|
-
return 0;
|
|
642
|
-
if (i === "0") {
|
|
643
|
-
if (r[1] === "b")
|
|
644
|
-
return t * parseInt(r.slice(2), 2);
|
|
645
|
-
if (r[1] === "x")
|
|
646
|
-
return t * parseInt(r.slice(2), 16);
|
|
647
|
-
if (r[1] === "o")
|
|
648
|
-
return t * parseInt(r.slice(2), 8);
|
|
649
|
-
}
|
|
650
|
-
return t * parseInt(r, 10);
|
|
651
|
-
}
|
|
652
|
-
function Xr(e) {
|
|
653
|
-
return Object.prototype.toString.call(e) === "[object Number]" && e % 1 === 0 && !C.isNegativeZero(e);
|
|
654
|
-
}
|
|
655
|
-
var Jr = new x("tag:yaml.org,2002:int", {
|
|
656
|
-
kind: "scalar",
|
|
657
|
-
resolve: zr,
|
|
658
|
-
construct: Zr,
|
|
659
|
-
predicate: Xr,
|
|
660
|
-
represent: {
|
|
661
|
-
binary: function(e) {
|
|
662
|
-
return e >= 0 ? "0b" + e.toString(2) : "-0b" + e.toString(2).slice(1);
|
|
663
|
-
},
|
|
664
|
-
octal: function(e) {
|
|
665
|
-
return e >= 0 ? "0o" + e.toString(8) : "-0o" + e.toString(8).slice(1);
|
|
666
|
-
},
|
|
667
|
-
decimal: function(e) {
|
|
668
|
-
return e.toString(10);
|
|
669
|
-
},
|
|
670
|
-
/* eslint-disable max-len */
|
|
671
|
-
hexadecimal: function(e) {
|
|
672
|
-
return e >= 0 ? "0x" + e.toString(16).toUpperCase() : "-0x" + e.toString(16).toUpperCase().slice(1);
|
|
673
|
-
}
|
|
674
|
-
},
|
|
675
|
-
defaultStyle: "decimal",
|
|
676
|
-
styleAliases: {
|
|
677
|
-
binary: [2, "bin"],
|
|
678
|
-
octal: [8, "oct"],
|
|
679
|
-
decimal: [10, "dec"],
|
|
680
|
-
hexadecimal: [16, "hex"]
|
|
681
|
-
}
|
|
682
|
-
}), et = new RegExp(
|
|
683
|
-
// 2.5e4, 2.5 and integers
|
|
684
|
-
"^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"
|
|
685
|
-
);
|
|
686
|
-
function rt(e) {
|
|
687
|
-
return !(e === null || !et.test(e) || // Quick hack to not allow integers end with `_`
|
|
688
|
-
// Probably should update regexp & check speed
|
|
689
|
-
e[e.length - 1] === "_");
|
|
690
|
-
}
|
|
691
|
-
function tt(e) {
|
|
692
|
-
var r, t;
|
|
693
|
-
return r = e.replace(/_/g, "").toLowerCase(), t = r[0] === "-" ? -1 : 1, "+-".indexOf(r[0]) >= 0 && (r = r.slice(1)), r === ".inf" ? t === 1 ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY : r === ".nan" ? NaN : t * parseFloat(r, 10);
|
|
694
|
-
}
|
|
695
|
-
var nt = /^[-+]?[0-9]+e/;
|
|
696
|
-
function it(e, r) {
|
|
697
|
-
var t;
|
|
698
|
-
if (isNaN(e))
|
|
699
|
-
switch (r) {
|
|
700
|
-
case "lowercase":
|
|
701
|
-
return ".nan";
|
|
702
|
-
case "uppercase":
|
|
703
|
-
return ".NAN";
|
|
704
|
-
case "camelcase":
|
|
705
|
-
return ".NaN";
|
|
706
|
-
}
|
|
707
|
-
else if (Number.POSITIVE_INFINITY === e)
|
|
708
|
-
switch (r) {
|
|
709
|
-
case "lowercase":
|
|
710
|
-
return ".inf";
|
|
711
|
-
case "uppercase":
|
|
712
|
-
return ".INF";
|
|
713
|
-
case "camelcase":
|
|
714
|
-
return ".Inf";
|
|
715
|
-
}
|
|
716
|
-
else if (Number.NEGATIVE_INFINITY === e)
|
|
717
|
-
switch (r) {
|
|
718
|
-
case "lowercase":
|
|
719
|
-
return "-.inf";
|
|
720
|
-
case "uppercase":
|
|
721
|
-
return "-.INF";
|
|
722
|
-
case "camelcase":
|
|
723
|
-
return "-.Inf";
|
|
724
|
-
}
|
|
725
|
-
else if (C.isNegativeZero(e))
|
|
726
|
-
return "-0.0";
|
|
727
|
-
return t = e.toString(10), nt.test(t) ? t.replace("e", ".e") : t;
|
|
728
|
-
}
|
|
729
|
-
function lt(e) {
|
|
730
|
-
return Object.prototype.toString.call(e) === "[object Number]" && (e % 1 !== 0 || C.isNegativeZero(e));
|
|
731
|
-
}
|
|
732
|
-
var at = new x("tag:yaml.org,2002:float", {
|
|
733
|
-
kind: "scalar",
|
|
734
|
-
resolve: rt,
|
|
735
|
-
construct: tt,
|
|
736
|
-
predicate: lt,
|
|
737
|
-
represent: it,
|
|
738
|
-
defaultStyle: "lowercase"
|
|
739
|
-
}), ut = Yr.extend({
|
|
740
|
-
implicit: [
|
|
741
|
-
Vr,
|
|
742
|
-
Kr,
|
|
743
|
-
Jr,
|
|
744
|
-
at
|
|
745
|
-
]
|
|
746
|
-
}), ot = ut, ye = new RegExp(
|
|
747
|
-
"^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"
|
|
748
|
-
), we = new RegExp(
|
|
749
|
-
"^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$"
|
|
750
|
-
);
|
|
751
|
-
function st(e) {
|
|
752
|
-
return e === null ? !1 : ye.exec(e) !== null || we.exec(e) !== null;
|
|
753
|
-
}
|
|
754
|
-
function ct(e) {
|
|
755
|
-
var r, t, i, n, a, l, u, o = 0, s = null, m, p, c;
|
|
756
|
-
if (r = ye.exec(e), r === null && (r = we.exec(e)), r === null)
|
|
757
|
-
throw new Error("Date resolve error");
|
|
758
|
-
if (t = +r[1], i = +r[2] - 1, n = +r[3], !r[4])
|
|
759
|
-
return new Date(Date.UTC(t, i, n));
|
|
760
|
-
if (a = +r[4], l = +r[5], u = +r[6], r[7]) {
|
|
761
|
-
for (o = r[7].slice(0, 3); o.length < 3; )
|
|
762
|
-
o += "0";
|
|
763
|
-
o = +o;
|
|
764
|
-
}
|
|
765
|
-
return r[9] && (m = +r[10], p = +(r[11] || 0), s = (m * 60 + p) * 6e4, r[9] === "-" && (s = -s)), c = new Date(Date.UTC(t, i, n, a, l, u, o)), s && c.setTime(c.getTime() - s), c;
|
|
766
|
-
}
|
|
767
|
-
function ft(e) {
|
|
768
|
-
return e.toISOString();
|
|
769
|
-
}
|
|
770
|
-
var mt = new x("tag:yaml.org,2002:timestamp", {
|
|
771
|
-
kind: "scalar",
|
|
772
|
-
resolve: st,
|
|
773
|
-
construct: ct,
|
|
774
|
-
instanceOf: Date,
|
|
775
|
-
represent: ft
|
|
776
|
-
});
|
|
777
|
-
function dt(e) {
|
|
778
|
-
return e === "<<" || e === null;
|
|
779
|
-
}
|
|
780
|
-
var pt = new x("tag:yaml.org,2002:merge", {
|
|
781
|
-
kind: "scalar",
|
|
782
|
-
resolve: dt
|
|
783
|
-
}), J = `ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
|
|
784
|
-
\r`;
|
|
785
|
-
function vt(e) {
|
|
786
|
-
if (e === null)
|
|
787
|
-
return !1;
|
|
788
|
-
var r, t, i = 0, n = e.length, a = J;
|
|
789
|
-
for (t = 0; t < n; t++)
|
|
790
|
-
if (r = a.indexOf(e.charAt(t)), !(r > 64)) {
|
|
791
|
-
if (r < 0)
|
|
792
|
-
return !1;
|
|
793
|
-
i += 6;
|
|
794
|
-
}
|
|
795
|
-
return i % 8 === 0;
|
|
796
|
-
}
|
|
797
|
-
function ht(e) {
|
|
798
|
-
var r, t, i = e.replace(/[\r\n=]/g, ""), n = i.length, a = J, l = 0, u = [];
|
|
799
|
-
for (r = 0; r < n; r++)
|
|
800
|
-
r % 4 === 0 && r && (u.push(l >> 16 & 255), u.push(l >> 8 & 255), u.push(l & 255)), l = l << 6 | a.indexOf(i.charAt(r));
|
|
801
|
-
return t = n % 4 * 6, t === 0 ? (u.push(l >> 16 & 255), u.push(l >> 8 & 255), u.push(l & 255)) : t === 18 ? (u.push(l >> 10 & 255), u.push(l >> 2 & 255)) : t === 12 && u.push(l >> 4 & 255), new Uint8Array(u);
|
|
802
|
-
}
|
|
803
|
-
function xt(e) {
|
|
804
|
-
var r = "", t = 0, i, n, a = e.length, l = J;
|
|
805
|
-
for (i = 0; i < a; i++)
|
|
806
|
-
i % 3 === 0 && i && (r += l[t >> 18 & 63], r += l[t >> 12 & 63], r += l[t >> 6 & 63], r += l[t & 63]), t = (t << 8) + e[i];
|
|
807
|
-
return n = a % 3, n === 0 ? (r += l[t >> 18 & 63], r += l[t >> 12 & 63], r += l[t >> 6 & 63], r += l[t & 63]) : n === 2 ? (r += l[t >> 10 & 63], r += l[t >> 4 & 63], r += l[t << 2 & 63], r += l[64]) : n === 1 && (r += l[t >> 2 & 63], r += l[t << 4 & 63], r += l[64], r += l[64]), r;
|
|
808
|
-
}
|
|
809
|
-
function gt(e) {
|
|
810
|
-
return Object.prototype.toString.call(e) === "[object Uint8Array]";
|
|
811
|
-
}
|
|
812
|
-
var yt = new x("tag:yaml.org,2002:binary", {
|
|
813
|
-
kind: "scalar",
|
|
814
|
-
resolve: vt,
|
|
815
|
-
construct: ht,
|
|
816
|
-
predicate: gt,
|
|
817
|
-
represent: xt
|
|
818
|
-
}), wt = Object.prototype.hasOwnProperty, kt = Object.prototype.toString;
|
|
819
|
-
function At(e) {
|
|
820
|
-
if (e === null)
|
|
821
|
-
return !0;
|
|
822
|
-
var r = [], t, i, n, a, l, u = e;
|
|
823
|
-
for (t = 0, i = u.length; t < i; t += 1) {
|
|
824
|
-
if (n = u[t], l = !1, kt.call(n) !== "[object Object]")
|
|
825
|
-
return !1;
|
|
826
|
-
for (a in n)
|
|
827
|
-
if (wt.call(n, a))
|
|
828
|
-
if (!l)
|
|
829
|
-
l = !0;
|
|
830
|
-
else
|
|
831
|
-
return !1;
|
|
832
|
-
if (!l)
|
|
833
|
-
return !1;
|
|
834
|
-
if (r.indexOf(a) === -1)
|
|
835
|
-
r.push(a);
|
|
836
|
-
else
|
|
837
|
-
return !1;
|
|
838
|
-
}
|
|
839
|
-
return !0;
|
|
840
|
-
}
|
|
841
|
-
function bt(e) {
|
|
842
|
-
return e !== null ? e : [];
|
|
843
|
-
}
|
|
844
|
-
var _t = new x("tag:yaml.org,2002:omap", {
|
|
845
|
-
kind: "sequence",
|
|
846
|
-
resolve: At,
|
|
847
|
-
construct: bt
|
|
848
|
-
}), Et = Object.prototype.toString;
|
|
849
|
-
function Ft(e) {
|
|
850
|
-
if (e === null)
|
|
851
|
-
return !0;
|
|
852
|
-
var r, t, i, n, a, l = e;
|
|
853
|
-
for (a = new Array(l.length), r = 0, t = l.length; r < t; r += 1) {
|
|
854
|
-
if (i = l[r], Et.call(i) !== "[object Object]" || (n = Object.keys(i), n.length !== 1))
|
|
855
|
-
return !1;
|
|
856
|
-
a[r] = [n[0], i[n[0]]];
|
|
857
|
-
}
|
|
858
|
-
return !0;
|
|
859
|
-
}
|
|
860
|
-
function Ct(e) {
|
|
861
|
-
if (e === null)
|
|
862
|
-
return [];
|
|
863
|
-
var r, t, i, n, a, l = e;
|
|
864
|
-
for (a = new Array(l.length), r = 0, t = l.length; r < t; r += 1)
|
|
865
|
-
i = l[r], n = Object.keys(i), a[r] = [n[0], i[n[0]]];
|
|
866
|
-
return a;
|
|
867
|
-
}
|
|
868
|
-
var St = new x("tag:yaml.org,2002:pairs", {
|
|
869
|
-
kind: "sequence",
|
|
870
|
-
resolve: Ft,
|
|
871
|
-
construct: Ct
|
|
872
|
-
}), Nt = Object.prototype.hasOwnProperty;
|
|
873
|
-
function Ot(e) {
|
|
874
|
-
if (e === null)
|
|
875
|
-
return !0;
|
|
876
|
-
var r, t = e;
|
|
877
|
-
for (r in t)
|
|
878
|
-
if (Nt.call(t, r) && t[r] !== null)
|
|
879
|
-
return !1;
|
|
880
|
-
return !0;
|
|
881
|
-
}
|
|
882
|
-
function Tt(e) {
|
|
883
|
-
return e !== null ? e : {};
|
|
884
|
-
}
|
|
885
|
-
var It = new x("tag:yaml.org,2002:set", {
|
|
886
|
-
kind: "mapping",
|
|
887
|
-
resolve: Ot,
|
|
888
|
-
construct: Tt
|
|
889
|
-
}), Rt = ot.extend({
|
|
890
|
-
implicit: [
|
|
891
|
-
mt,
|
|
892
|
-
pt
|
|
893
|
-
],
|
|
894
|
-
explicit: [
|
|
895
|
-
yt,
|
|
896
|
-
_t,
|
|
897
|
-
St,
|
|
898
|
-
It
|
|
899
|
-
]
|
|
900
|
-
});
|
|
901
|
-
function le(e) {
|
|
902
|
-
return e === 48 ? "\0" : e === 97 ? "\x07" : e === 98 ? "\b" : e === 116 || e === 9 ? " " : e === 110 ? `
|
|
903
|
-
` : e === 118 ? "\v" : e === 102 ? "\f" : e === 114 ? "\r" : e === 101 ? "\x1B" : e === 32 ? " " : e === 34 ? '"' : e === 47 ? "/" : e === 92 ? "\\" : e === 78 ? "
" : e === 95 ? " " : e === 76 ? "\u2028" : e === 80 ? "\u2029" : "";
|
|
904
|
-
}
|
|
905
|
-
var Lt = new Array(256), Mt = new Array(256);
|
|
906
|
-
for (var S = 0; S < 256; S++)
|
|
907
|
-
Lt[S] = le(S) ? 1 : 0, Mt[S] = le(S);
|
|
908
|
-
var ke = Object.prototype.toString, Ae = Object.prototype.hasOwnProperty, ee = 65279, Ut = 9, L = 10, Dt = 13, Yt = 32, Bt = 33, $t = 34, Q = 35, Pt = 37, Vt = 38, Ht = 39, qt = 42, be = 44, jt = 45, P = 58, Kt = 61, Gt = 62, Qt = 63, Wt = 64, _e = 91, Ee = 93, zt = 96, Fe = 123, Zt = 124, Ce = 125, g = {};
|
|
909
|
-
g[0] = "\\0";
|
|
910
|
-
g[7] = "\\a";
|
|
911
|
-
g[8] = "\\b";
|
|
912
|
-
g[9] = "\\t";
|
|
913
|
-
g[10] = "\\n";
|
|
914
|
-
g[11] = "\\v";
|
|
915
|
-
g[12] = "\\f";
|
|
916
|
-
g[13] = "\\r";
|
|
917
|
-
g[27] = "\\e";
|
|
918
|
-
g[34] = '\\"';
|
|
919
|
-
g[92] = "\\\\";
|
|
920
|
-
g[133] = "\\N";
|
|
921
|
-
g[160] = "\\_";
|
|
922
|
-
g[8232] = "\\L";
|
|
923
|
-
g[8233] = "\\P";
|
|
924
|
-
var Xt = [
|
|
925
|
-
"y",
|
|
926
|
-
"Y",
|
|
927
|
-
"yes",
|
|
928
|
-
"Yes",
|
|
929
|
-
"YES",
|
|
930
|
-
"on",
|
|
931
|
-
"On",
|
|
932
|
-
"ON",
|
|
933
|
-
"n",
|
|
934
|
-
"N",
|
|
935
|
-
"no",
|
|
936
|
-
"No",
|
|
937
|
-
"NO",
|
|
938
|
-
"off",
|
|
939
|
-
"Off",
|
|
940
|
-
"OFF"
|
|
941
|
-
], Jt = /^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;
|
|
942
|
-
function en(e, r) {
|
|
943
|
-
var t, i, n, a, l, u, o;
|
|
944
|
-
if (r === null)
|
|
945
|
-
return {};
|
|
946
|
-
for (t = {}, i = Object.keys(r), n = 0, a = i.length; n < a; n += 1)
|
|
947
|
-
l = i[n], u = String(r[l]), l.slice(0, 2) === "!!" && (l = "tag:yaml.org,2002:" + l.slice(2)), o = e.compiledTypeMap.fallback[l], o && Ae.call(o.styleAliases, u) && (u = o.styleAliases[u]), t[l] = u;
|
|
948
|
-
return t;
|
|
949
|
-
}
|
|
950
|
-
function rn(e) {
|
|
951
|
-
var r, t, i;
|
|
952
|
-
if (r = e.toString(16).toUpperCase(), e <= 255)
|
|
953
|
-
t = "x", i = 2;
|
|
954
|
-
else if (e <= 65535)
|
|
955
|
-
t = "u", i = 4;
|
|
956
|
-
else if (e <= 4294967295)
|
|
957
|
-
t = "U", i = 8;
|
|
958
|
-
else
|
|
959
|
-
throw new b("code point within a string may not be greater than 0xFFFFFFFF");
|
|
960
|
-
return "\\" + t + C.repeat("0", i - r.length) + r;
|
|
961
|
-
}
|
|
962
|
-
var tn = 1, M = 2;
|
|
963
|
-
function nn(e) {
|
|
964
|
-
this.schema = e.schema || Rt, this.indent = Math.max(1, e.indent || 2), this.noArrayIndent = e.noArrayIndent || !1, this.skipInvalid = e.skipInvalid || !1, this.flowLevel = C.isNothing(e.flowLevel) ? -1 : e.flowLevel, this.styleMap = en(this.schema, e.styles || null), this.sortKeys = e.sortKeys || !1, this.lineWidth = e.lineWidth || 80, this.noRefs = e.noRefs || !1, this.noCompatMode = e.noCompatMode || !1, this.condenseFlow = e.condenseFlow || !1, this.quotingType = e.quotingType === '"' ? M : tn, this.forceQuotes = e.forceQuotes || !1, this.replacer = typeof e.replacer == "function" ? e.replacer : null, this.implicitTypes = this.schema.compiledImplicit, this.explicitTypes = this.schema.compiledExplicit, this.tag = null, this.result = "", this.duplicates = [], this.usedDuplicates = null;
|
|
965
|
-
}
|
|
966
|
-
function ae(e, r) {
|
|
967
|
-
for (var t = C.repeat(" ", r), i = 0, n = -1, a = "", l, u = e.length; i < u; )
|
|
968
|
-
n = e.indexOf(`
|
|
969
|
-
`, i), n === -1 ? (l = e.slice(i), i = u) : (l = e.slice(i, n + 1), i = n + 1), l.length && l !== `
|
|
970
|
-
` && (a += t), a += l;
|
|
971
|
-
return a;
|
|
972
|
-
}
|
|
973
|
-
function W(e, r) {
|
|
974
|
-
return `
|
|
975
|
-
` + C.repeat(" ", e.indent * r);
|
|
976
|
-
}
|
|
977
|
-
function ln(e, r) {
|
|
978
|
-
var t, i, n;
|
|
979
|
-
for (t = 0, i = e.implicitTypes.length; t < i; t += 1)
|
|
980
|
-
if (n = e.implicitTypes[t], n.resolve(r))
|
|
981
|
-
return !0;
|
|
982
|
-
return !1;
|
|
983
|
-
}
|
|
984
|
-
function V(e) {
|
|
985
|
-
return e === Yt || e === Ut;
|
|
986
|
-
}
|
|
987
|
-
function U(e) {
|
|
988
|
-
return 32 <= e && e <= 126 || 161 <= e && e <= 55295 && e !== 8232 && e !== 8233 || 57344 <= e && e <= 65533 && e !== ee || 65536 <= e && e <= 1114111;
|
|
989
|
-
}
|
|
990
|
-
function ue(e) {
|
|
991
|
-
return U(e) && e !== ee && e !== Dt && e !== L;
|
|
992
|
-
}
|
|
993
|
-
function oe(e, r, t) {
|
|
994
|
-
var i = ue(e), n = i && !V(e);
|
|
995
|
-
return (
|
|
996
|
-
// ns-plain-safe
|
|
997
|
-
(t ? (
|
|
998
|
-
// c = flow-in
|
|
999
|
-
i
|
|
1000
|
-
) : i && e !== be && e !== _e && e !== Ee && e !== Fe && e !== Ce) && e !== Q && !(r === P && !n) || ue(r) && !V(r) && e === Q || r === P && n
|
|
1001
|
-
);
|
|
1002
|
-
}
|
|
1003
|
-
function an(e) {
|
|
1004
|
-
return U(e) && e !== ee && !V(e) && e !== jt && e !== Qt && e !== P && e !== be && e !== _e && e !== Ee && e !== Fe && e !== Ce && e !== Q && e !== Vt && e !== qt && e !== Bt && e !== Zt && e !== Kt && e !== Gt && e !== Ht && e !== $t && e !== Pt && e !== Wt && e !== zt;
|
|
1005
|
-
}
|
|
1006
|
-
function un(e) {
|
|
1007
|
-
return !V(e) && e !== P;
|
|
1008
|
-
}
|
|
1009
|
-
function T(e, r) {
|
|
1010
|
-
var t = e.charCodeAt(r), i;
|
|
1011
|
-
return t >= 55296 && t <= 56319 && r + 1 < e.length && (i = e.charCodeAt(r + 1), i >= 56320 && i <= 57343) ? (t - 55296) * 1024 + i - 56320 + 65536 : t;
|
|
1012
|
-
}
|
|
1013
|
-
function Se(e) {
|
|
1014
|
-
var r = /^\n* /;
|
|
1015
|
-
return r.test(e);
|
|
1016
|
-
}
|
|
1017
|
-
var Ne = 1, z = 2, Oe = 3, Te = 4, N = 5;
|
|
1018
|
-
function on(e, r, t, i, n, a, l, u) {
|
|
1019
|
-
var o, s = 0, m = null, p = !1, c = !1, d = i !== -1, f = -1, h = an(T(e, 0)) && un(T(e, e.length - 1));
|
|
1020
|
-
if (r || l)
|
|
1021
|
-
for (o = 0; o < e.length; s >= 65536 ? o += 2 : o++) {
|
|
1022
|
-
if (s = T(e, o), !U(s))
|
|
1023
|
-
return N;
|
|
1024
|
-
h = h && oe(s, m, u), m = s;
|
|
1025
|
-
}
|
|
1026
|
-
else {
|
|
1027
|
-
for (o = 0; o < e.length; s >= 65536 ? o += 2 : o++) {
|
|
1028
|
-
if (s = T(e, o), s === L)
|
|
1029
|
-
p = !0, d && (c = c || // Foldable line = too long, and not more-indented.
|
|
1030
|
-
o - f - 1 > i && e[f + 1] !== " ", f = o);
|
|
1031
|
-
else if (!U(s))
|
|
1032
|
-
return N;
|
|
1033
|
-
h = h && oe(s, m, u), m = s;
|
|
1034
|
-
}
|
|
1035
|
-
c = c || d && o - f - 1 > i && e[f + 1] !== " ";
|
|
1036
|
-
}
|
|
1037
|
-
return !p && !c ? h && !l && !n(e) ? Ne : a === M ? N : z : t > 9 && Se(e) ? N : l ? a === M ? N : z : c ? Te : Oe;
|
|
1038
|
-
}
|
|
1039
|
-
function sn(e, r, t, i, n) {
|
|
1040
|
-
e.dump = function() {
|
|
1041
|
-
if (r.length === 0)
|
|
1042
|
-
return e.quotingType === M ? '""' : "''";
|
|
1043
|
-
if (!e.noCompatMode && (Xt.indexOf(r) !== -1 || Jt.test(r)))
|
|
1044
|
-
return e.quotingType === M ? '"' + r + '"' : "'" + r + "'";
|
|
1045
|
-
var a = e.indent * Math.max(1, t), l = e.lineWidth === -1 ? -1 : Math.max(Math.min(e.lineWidth, 40), e.lineWidth - a), u = i || e.flowLevel > -1 && t >= e.flowLevel;
|
|
1046
|
-
function o(s) {
|
|
1047
|
-
return ln(e, s);
|
|
1048
|
-
}
|
|
1049
|
-
switch (on(
|
|
1050
|
-
r,
|
|
1051
|
-
u,
|
|
1052
|
-
e.indent,
|
|
1053
|
-
l,
|
|
1054
|
-
o,
|
|
1055
|
-
e.quotingType,
|
|
1056
|
-
e.forceQuotes && !i,
|
|
1057
|
-
n
|
|
1058
|
-
)) {
|
|
1059
|
-
case Ne:
|
|
1060
|
-
return r;
|
|
1061
|
-
case z:
|
|
1062
|
-
return "'" + r.replace(/'/g, "''") + "'";
|
|
1063
|
-
case Oe:
|
|
1064
|
-
return "|" + se(r, e.indent) + ce(ae(r, a));
|
|
1065
|
-
case Te:
|
|
1066
|
-
return ">" + se(r, e.indent) + ce(ae(cn(r, l), a));
|
|
1067
|
-
case N:
|
|
1068
|
-
return '"' + fn(r) + '"';
|
|
1069
|
-
default:
|
|
1070
|
-
throw new b("impossible error: invalid scalar style");
|
|
1071
|
-
}
|
|
1072
|
-
}();
|
|
1073
|
-
}
|
|
1074
|
-
function se(e, r) {
|
|
1075
|
-
var t = Se(e) ? String(r) : "", i = e[e.length - 1] === `
|
|
1076
|
-
`, n = i && (e[e.length - 2] === `
|
|
1077
|
-
` || e === `
|
|
1078
|
-
`), a = n ? "+" : i ? "" : "-";
|
|
1079
|
-
return t + a + `
|
|
1080
|
-
`;
|
|
1081
|
-
}
|
|
1082
|
-
function ce(e) {
|
|
1083
|
-
return e[e.length - 1] === `
|
|
1084
|
-
` ? e.slice(0, -1) : e;
|
|
1085
|
-
}
|
|
1086
|
-
function cn(e, r) {
|
|
1087
|
-
for (var t = /(\n+)([^\n]*)/g, i = function() {
|
|
1088
|
-
var s = e.indexOf(`
|
|
1089
|
-
`);
|
|
1090
|
-
return s = s !== -1 ? s : e.length, t.lastIndex = s, fe(e.slice(0, s), r);
|
|
1091
|
-
}(), n = e[0] === `
|
|
1092
|
-
` || e[0] === " ", a, l; l = t.exec(e); ) {
|
|
1093
|
-
var u = l[1], o = l[2];
|
|
1094
|
-
a = o[0] === " ", i += u + (!n && !a && o !== "" ? `
|
|
1095
|
-
` : "") + fe(o, r), n = a;
|
|
1096
|
-
}
|
|
1097
|
-
return i;
|
|
1098
|
-
}
|
|
1099
|
-
function fe(e, r) {
|
|
1100
|
-
if (e === "" || e[0] === " ")
|
|
1101
|
-
return e;
|
|
1102
|
-
for (var t = / [^ ]/g, i, n = 0, a, l = 0, u = 0, o = ""; i = t.exec(e); )
|
|
1103
|
-
u = i.index, u - n > r && (a = l > n ? l : u, o += `
|
|
1104
|
-
` + e.slice(n, a), n = a + 1), l = u;
|
|
1105
|
-
return o += `
|
|
1106
|
-
`, e.length - n > r && l > n ? o += e.slice(n, l) + `
|
|
1107
|
-
` + e.slice(l + 1) : o += e.slice(n), o.slice(1);
|
|
1108
|
-
}
|
|
1109
|
-
function fn(e) {
|
|
1110
|
-
for (var r = "", t = 0, i, n = 0; n < e.length; t >= 65536 ? n += 2 : n++)
|
|
1111
|
-
t = T(e, n), i = g[t], !i && U(t) ? (r += e[n], t >= 65536 && (r += e[n + 1])) : r += i || rn(t);
|
|
1112
|
-
return r;
|
|
1113
|
-
}
|
|
1114
|
-
function mn(e, r, t) {
|
|
1115
|
-
var i = "", n = e.tag, a, l, u;
|
|
1116
|
-
for (a = 0, l = t.length; a < l; a += 1)
|
|
1117
|
-
u = t[a], e.replacer && (u = e.replacer.call(t, String(a), u)), (E(e, r, u, !1, !1) || typeof u > "u" && E(e, r, null, !1, !1)) && (i !== "" && (i += "," + (e.condenseFlow ? "" : " ")), i += e.dump);
|
|
1118
|
-
e.tag = n, e.dump = "[" + i + "]";
|
|
1119
|
-
}
|
|
1120
|
-
function me(e, r, t, i) {
|
|
1121
|
-
var n = "", a = e.tag, l, u, o;
|
|
1122
|
-
for (l = 0, u = t.length; l < u; l += 1)
|
|
1123
|
-
o = t[l], e.replacer && (o = e.replacer.call(t, String(l), o)), (E(e, r + 1, o, !0, !0, !1, !0) || typeof o > "u" && E(e, r + 1, null, !0, !0, !1, !0)) && ((!i || n !== "") && (n += W(e, r)), e.dump && L === e.dump.charCodeAt(0) ? n += "-" : n += "- ", n += e.dump);
|
|
1124
|
-
e.tag = a, e.dump = n || "[]";
|
|
1125
|
-
}
|
|
1126
|
-
function dn(e, r, t) {
|
|
1127
|
-
var i = "", n = e.tag, a = Object.keys(t), l, u, o, s, m;
|
|
1128
|
-
for (l = 0, u = a.length; l < u; l += 1)
|
|
1129
|
-
m = "", i !== "" && (m += ", "), e.condenseFlow && (m += '"'), o = a[l], s = t[o], e.replacer && (s = e.replacer.call(t, o, s)), E(e, r, o, !1, !1) && (e.dump.length > 1024 && (m += "? "), m += e.dump + (e.condenseFlow ? '"' : "") + ":" + (e.condenseFlow ? "" : " "), E(e, r, s, !1, !1) && (m += e.dump, i += m));
|
|
1130
|
-
e.tag = n, e.dump = "{" + i + "}";
|
|
1131
|
-
}
|
|
1132
|
-
function pn(e, r, t, i) {
|
|
1133
|
-
var n = "", a = e.tag, l = Object.keys(t), u, o, s, m, p, c;
|
|
1134
|
-
if (e.sortKeys === !0)
|
|
1135
|
-
l.sort();
|
|
1136
|
-
else if (typeof e.sortKeys == "function")
|
|
1137
|
-
l.sort(e.sortKeys);
|
|
1138
|
-
else if (e.sortKeys)
|
|
1139
|
-
throw new b("sortKeys must be a boolean or a function");
|
|
1140
|
-
for (u = 0, o = l.length; u < o; u += 1)
|
|
1141
|
-
c = "", (!i || n !== "") && (c += W(e, r)), s = l[u], m = t[s], e.replacer && (m = e.replacer.call(t, s, m)), E(e, r + 1, s, !0, !0, !0) && (p = e.tag !== null && e.tag !== "?" || e.dump && e.dump.length > 1024, p && (e.dump && L === e.dump.charCodeAt(0) ? c += "?" : c += "? "), c += e.dump, p && (c += W(e, r)), E(e, r + 1, m, !0, p) && (e.dump && L === e.dump.charCodeAt(0) ? c += ":" : c += ": ", c += e.dump, n += c));
|
|
1142
|
-
e.tag = a, e.dump = n || "{}";
|
|
1143
|
-
}
|
|
1144
|
-
function de(e, r, t) {
|
|
1145
|
-
var i, n, a, l, u, o;
|
|
1146
|
-
for (n = t ? e.explicitTypes : e.implicitTypes, a = 0, l = n.length; a < l; a += 1)
|
|
1147
|
-
if (u = n[a], (u.instanceOf || u.predicate) && (!u.instanceOf || typeof r == "object" && r instanceof u.instanceOf) && (!u.predicate || u.predicate(r))) {
|
|
1148
|
-
if (t ? u.multi && u.representName ? e.tag = u.representName(r) : e.tag = u.tag : e.tag = "?", u.represent) {
|
|
1149
|
-
if (o = e.styleMap[u.tag] || u.defaultStyle, ke.call(u.represent) === "[object Function]")
|
|
1150
|
-
i = u.represent(r, o);
|
|
1151
|
-
else if (Ae.call(u.represent, o))
|
|
1152
|
-
i = u.represent[o](r, o);
|
|
1153
|
-
else
|
|
1154
|
-
throw new b("!<" + u.tag + '> tag resolver accepts not "' + o + '" style');
|
|
1155
|
-
e.dump = i;
|
|
1156
|
-
}
|
|
1157
|
-
return !0;
|
|
1158
|
-
}
|
|
1159
|
-
return !1;
|
|
1160
|
-
}
|
|
1161
|
-
function E(e, r, t, i, n, a, l) {
|
|
1162
|
-
e.tag = null, e.dump = t, de(e, t, !1) || de(e, t, !0);
|
|
1163
|
-
var u = ke.call(e.dump), o = i, s;
|
|
1164
|
-
i && (i = e.flowLevel < 0 || e.flowLevel > r);
|
|
1165
|
-
var m = u === "[object Object]" || u === "[object Array]", p, c;
|
|
1166
|
-
if (m && (p = e.duplicates.indexOf(t), c = p !== -1), (e.tag !== null && e.tag !== "?" || c || e.indent !== 2 && r > 0) && (n = !1), c && e.usedDuplicates[p])
|
|
1167
|
-
e.dump = "*ref_" + p;
|
|
1168
|
-
else {
|
|
1169
|
-
if (m && c && !e.usedDuplicates[p] && (e.usedDuplicates[p] = !0), u === "[object Object]")
|
|
1170
|
-
i && Object.keys(e.dump).length !== 0 ? (pn(e, r, e.dump, n), c && (e.dump = "&ref_" + p + e.dump)) : (dn(e, r, e.dump), c && (e.dump = "&ref_" + p + " " + e.dump));
|
|
1171
|
-
else if (u === "[object Array]")
|
|
1172
|
-
i && e.dump.length !== 0 ? (e.noArrayIndent && !l && r > 0 ? me(e, r - 1, e.dump, n) : me(e, r, e.dump, n), c && (e.dump = "&ref_" + p + e.dump)) : (mn(e, r, e.dump), c && (e.dump = "&ref_" + p + " " + e.dump));
|
|
1173
|
-
else if (u === "[object String]")
|
|
1174
|
-
e.tag !== "?" && sn(e, e.dump, r, a, o);
|
|
1175
|
-
else {
|
|
1176
|
-
if (u === "[object Undefined]")
|
|
1177
|
-
return !1;
|
|
1178
|
-
if (e.skipInvalid)
|
|
1179
|
-
return !1;
|
|
1180
|
-
throw new b("unacceptable kind of an object to dump " + u);
|
|
1181
|
-
}
|
|
1182
|
-
e.tag !== null && e.tag !== "?" && (s = encodeURI(
|
|
1183
|
-
e.tag[0] === "!" ? e.tag.slice(1) : e.tag
|
|
1184
|
-
).replace(/!/g, "%21"), e.tag[0] === "!" ? s = "!" + s : s.slice(0, 18) === "tag:yaml.org,2002:" ? s = "!!" + s.slice(18) : s = "!<" + s + ">", e.dump = s + " " + e.dump);
|
|
1185
|
-
}
|
|
1186
|
-
return !0;
|
|
1187
|
-
}
|
|
1188
|
-
function vn(e, r) {
|
|
1189
|
-
var t = [], i = [], n, a;
|
|
1190
|
-
for (Z(e, t, i), n = 0, a = i.length; n < a; n += 1)
|
|
1191
|
-
r.duplicates.push(t[i[n]]);
|
|
1192
|
-
r.usedDuplicates = new Array(a);
|
|
1193
|
-
}
|
|
1194
|
-
function Z(e, r, t) {
|
|
1195
|
-
var i, n, a;
|
|
1196
|
-
if (e !== null && typeof e == "object")
|
|
1197
|
-
if (n = r.indexOf(e), n !== -1)
|
|
1198
|
-
t.indexOf(n) === -1 && t.push(n);
|
|
1199
|
-
else if (r.push(e), Array.isArray(e))
|
|
1200
|
-
for (n = 0, a = e.length; n < a; n += 1)
|
|
1201
|
-
Z(e[n], r, t);
|
|
1202
|
-
else
|
|
1203
|
-
for (i = Object.keys(e), n = 0, a = i.length; n < a; n += 1)
|
|
1204
|
-
Z(e[i[n]], r, t);
|
|
1205
|
-
}
|
|
1206
|
-
function hn(e, r) {
|
|
1207
|
-
r = r || {};
|
|
1208
|
-
var t = new nn(r);
|
|
1209
|
-
t.noRefs || vn(e, t);
|
|
1210
|
-
var i = e;
|
|
1211
|
-
return t.replacer && (i = t.replacer.call({ "": i }, "", i)), E(t, 0, i, !0, !0) ? t.dump + `
|
|
1212
|
-
` : "";
|
|
1213
|
-
}
|
|
1214
|
-
var xn = hn, gn = {
|
|
1215
|
-
dump: xn
|
|
1216
|
-
}, yn = gn.dump;
|
|
1217
|
-
const wn = { class: "space-y-6 max-w-7xl mx-auto" }, kn = { class: "flex items-center justify-between" }, An = { class: "flex items-center gap-4" }, bn = { class: "flex items-center gap-2" }, _n = { class: "text-2xl font-semibold text-gray-900 dark:text-white" }, En = ["href", "title"], Fn = { class: "flex items-center space-x-3" }, Cn = {
|
|
1218
|
-
key: 0,
|
|
1219
|
-
class: "max-w-[1000px] flex flex-col"
|
|
1220
|
-
}, Sn = { class: "flex ml-2 mb-6 w-min border border-gray-200 dark:border-gray-700 rounded-full overflow-hidden" }, Yn = /* @__PURE__ */ D({
|
|
1221
|
-
__name: "MenuItemPage",
|
|
1222
|
-
setup(e) {
|
|
1223
|
-
K["vs-input-monaco-editor"] = he, console.log("[MenuItemPage] vs-input-monaco-editor registered:", !!K["vs-input-monaco-editor"]);
|
|
1224
|
-
const { t: r, locale: t } = H(), i = tr(), n = nr(), a = Pe(() => [
|
|
1225
|
-
{
|
|
1226
|
-
key: "name",
|
|
1227
|
-
title: r("cms.menu.form.name"),
|
|
1228
|
-
type: "text",
|
|
1229
|
-
placeholder: r("cms.menu.form.name"),
|
|
1230
|
-
required: !0,
|
|
1231
|
-
validators: ["required"]
|
|
1232
|
-
},
|
|
1233
|
-
{
|
|
1234
|
-
key: "description",
|
|
1235
|
-
title: r("cms.menu.form.description"),
|
|
1236
|
-
type: "text",
|
|
1237
|
-
placeholder: r("cms.menu.form.description"),
|
|
1238
|
-
required: !0,
|
|
1239
|
-
validators: ["required"]
|
|
1240
|
-
},
|
|
1241
|
-
{
|
|
1242
|
-
key: "locale",
|
|
1243
|
-
title: r("cms.menu.form.language"),
|
|
1244
|
-
type: "select",
|
|
1245
|
-
placeholder: r("cms.menu.form.language"),
|
|
1246
|
-
options: [
|
|
1247
|
-
{ text: "Ukrainian", id: "uk" },
|
|
1248
|
-
{ text: "English", id: "en" }
|
|
1249
|
-
],
|
|
1250
|
-
required: !0,
|
|
1251
|
-
validators: ["required"]
|
|
1252
|
-
},
|
|
1253
|
-
{
|
|
1254
|
-
key: "content",
|
|
1255
|
-
title: r("cms.menu.form.content"),
|
|
1256
|
-
type: "monaco-editor",
|
|
1257
|
-
height: "500px",
|
|
1258
|
-
language: "yaml",
|
|
1259
|
-
theme: "vs-light"
|
|
1260
|
-
}
|
|
1261
|
-
]), l = k(null), u = k({}), o = k(!1), s = k(!1), m = (d) => {
|
|
1262
|
-
const f = {};
|
|
1263
|
-
for (const h of d) {
|
|
1264
|
-
const { title: re, value: Ie, children: q } = h;
|
|
1265
|
-
q && q.length > 0 ? f[re] = m(q) : f[re] = Ie;
|
|
1266
|
-
}
|
|
1267
|
-
return f;
|
|
1268
|
-
}, p = async () => {
|
|
1269
|
-
l.value;
|
|
1270
|
-
let d = { ...l.value || {} };
|
|
1271
|
-
if (await u.value.validate()) {
|
|
1272
|
-
I({
|
|
1273
|
-
type: "warning",
|
|
1274
|
-
title: r("cms.common.actions.warning"),
|
|
1275
|
-
message: r("cms.menu.createMenuFailed")
|
|
1276
|
-
});
|
|
1277
|
-
return;
|
|
1278
|
-
}
|
|
1279
|
-
s.value && Array.isArray(d.items) && (d.items = m(d.items), d.content = yn(d.items));
|
|
1280
|
-
try {
|
|
1281
|
-
await fetch(`/api/cms-menu/${n.params.id}`, {
|
|
1282
|
-
method: "PUT",
|
|
1283
|
-
headers: {
|
|
1284
|
-
"Content-Type": "application/json"
|
|
1285
|
-
},
|
|
1286
|
-
body: JSON.stringify(d)
|
|
1287
|
-
}), I({
|
|
1288
|
-
title: r("cms.menu.menuUpdated"),
|
|
1289
|
-
type: "success",
|
|
1290
|
-
message: r("cms.menu.menuUpdated")
|
|
1291
|
-
}), i.push("/menu");
|
|
1292
|
-
} catch {
|
|
1293
|
-
I({
|
|
1294
|
-
title: r("cms.menu.menuUpdateError"),
|
|
1295
|
-
type: "error",
|
|
1296
|
-
message: r("cms.menu.menuUpdateError")
|
|
1297
|
-
});
|
|
1298
|
-
}
|
|
1299
|
-
};
|
|
1300
|
-
return Ve(async () => {
|
|
1301
|
-
try {
|
|
1302
|
-
const f = await (await fetch(`/api/cms-menu/${n.params.id}`)).json();
|
|
1303
|
-
l.value = f, o.value = !0;
|
|
1304
|
-
} catch {
|
|
1305
|
-
o.value = !1;
|
|
1306
|
-
}
|
|
1307
|
-
}), (d, f) => (w(), F("div", wn, [
|
|
1308
|
-
v("div", kn, [
|
|
1309
|
-
v("div", An, [
|
|
1310
|
-
v("button", {
|
|
1311
|
-
onClick: f[0] || (f[0] = (h) => y(i).back()),
|
|
1312
|
-
class: "p-2 text-gray-500 rounded-full hover:text-gray-900 dark:text-gray-400 dark:hover:text-white hover:bg-gray-100 dark:hover:bg-gray-700"
|
|
1313
|
-
}, [
|
|
1314
|
-
A(y(ze), { class: "w-5 h-5" })
|
|
1315
|
-
]),
|
|
1316
|
-
v("div", bn, [
|
|
1317
|
-
v("h1", _n, _(d.$t("cms.menu.editMenu")), 1),
|
|
1318
|
-
v("a", {
|
|
1319
|
-
href: `https://cms.opengis.info/${y(t)}/guides/menu/`,
|
|
1320
|
-
target: "_blank",
|
|
1321
|
-
title: d.$t("cms.guide.menu")
|
|
1322
|
-
}, [
|
|
1323
|
-
A(y(Ze), { class: "w-5 h-5" })
|
|
1324
|
-
], 8, En)
|
|
1325
|
-
])
|
|
1326
|
-
]),
|
|
1327
|
-
v("div", Fn, [
|
|
1328
|
-
v("button", {
|
|
1329
|
-
onClick: p,
|
|
1330
|
-
class: "inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium h-9 px-4 py-2 bg-blue-600 text-white shadow-md transition-all duration-200 transform hover:bg-blue-700 hover:shadow-lg hover:scale-105 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50"
|
|
1331
|
-
}, [
|
|
1332
|
-
A(y(Xe), { class: "w-4 h-4 mr-2" }),
|
|
1333
|
-
X(" " + _(d.$t("cms.common.actions.save")), 1)
|
|
1334
|
-
])
|
|
1335
|
-
])
|
|
1336
|
-
]),
|
|
1337
|
-
o.value ? (w(), F("div", Cn, [
|
|
1338
|
-
v("div", Sn, [
|
|
1339
|
-
v("button", {
|
|
1340
|
-
onClick: f[1] || (f[1] = (h) => s.value = !1),
|
|
1341
|
-
class: B([{ "bg-gray-200 text-gray-900 dark:bg-gray-700 dark:text-white": !s.value }, "text-gray-500 hover:text-gray-900 dark:hover:text-white hover:bg-gray-200 dark:hover:bg-gray-700 whitespace-nowrap px-5 py-2 w-[200px] text-sm font-medium"])
|
|
1342
|
-
}, _(d.$t("cms.menu.textEditor")), 3),
|
|
1343
|
-
v("button", {
|
|
1344
|
-
onClick: f[2] || (f[2] = (h) => s.value = !0),
|
|
1345
|
-
class: B([{ "bg-gray-200 text-gray-900 dark:bg-gray-700 dark:text-white": s.value }, "text-gray-500 hover:text-gray-900 dark:hover:text-white hover:bg-gray-200 dark:hover:bg-gray-700 whitespace-nowrap px-5 py-2 w-[200px] text-sm font-medium"])
|
|
1346
|
-
}, _(d.$t("cms.menu.listTree")), 3)
|
|
1347
|
-
]),
|
|
1348
|
-
s.value ? (w(), O(xr, {
|
|
1349
|
-
key: 0,
|
|
1350
|
-
modelValue: l.value,
|
|
1351
|
-
"onUpdate:modelValue": f[3] || (f[3] = (h) => l.value = h)
|
|
1352
|
-
}, null, 8, ["modelValue"])) : (w(), O(y(ve), {
|
|
1353
|
-
key: 1,
|
|
1354
|
-
schema: a.value,
|
|
1355
|
-
modelValue: l.value,
|
|
1356
|
-
"onUpdate:modelValue": f[4] || (f[4] = (h) => l.value = h),
|
|
1357
|
-
form: u.value,
|
|
1358
|
-
"onUpdate:form": f[5] || (f[5] = (h) => u.value = h)
|
|
1359
|
-
}, null, 8, ["schema", "modelValue", "form"]))
|
|
1360
|
-
])) : $("", !0)
|
|
1361
|
-
]));
|
|
1362
|
-
}
|
|
1363
|
-
});
|
|
1364
|
-
export {
|
|
1365
|
-
Yn as default
|
|
1366
|
-
};
|