pennsieve-dashboard 0.1.3 → 0.1.5
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/pennsieve-dashboard.es.js +887 -877
- package/dist/pennsieve-dashboard.umd.js +27 -27
- package/dist/static/duckdb/duckdb-browser-eh.worker.js +14 -0
- package/dist/static/duckdb/duckdb-browser-mvp.worker.js +14 -0
- package/dist/static/duckdb/duckdb-eh.wasm +0 -0
- package/dist/static/duckdb/duckdb-mvp.wasm +0 -0
- package/dist/style.css +1 -1
- package/package.json +9 -6
|
@@ -1,204 +1,215 @@
|
|
|
1
1
|
var Hs = Object.defineProperty;
|
|
2
2
|
var Os = (o, e, t) => e in o ? Hs(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t;
|
|
3
|
-
var
|
|
4
|
-
import { defineComponent as
|
|
5
|
-
import { defineStore as
|
|
6
|
-
import { ElTag as
|
|
3
|
+
var O = (o, e, t) => Os(o, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
import { defineComponent as we, createElementBlock as $, openBlock as R, createElementVNode as z, ref as B, reactive as ns, watch as ce, isRef as Ps, isReactive as $s, markRaw as Bs, computed as Ce, resolveComponent as ie, createBlock as ae, withCtx as q, createVNode as X, Fragment as ze, renderList as it, unref as ue, createTextVNode as We, inject as Us, shallowRef as os, resolveDirective as ls, renderSlot as wt, mergeProps as li, withDirectives as Le, toDisplayString as Ae, withKeys as as, vShow as xt, vModelText as Fs, createCommentVNode as kt, normalizeClass as Ws, resolveDynamicComponent as Fi, provide as Gs, onBeforeMount as Vs, onMounted as qs, onBeforeUnmount as js, defineAsyncComponent as Ys, nextTick as Xs } from "vue";
|
|
5
|
+
import { defineStore as Ks, storeToRefs as ti } from "pinia";
|
|
6
|
+
import { ElTag as Zs, ElTooltip as hs } from "element-plus";
|
|
7
7
|
/*! Element Plus Icons Vue v2.3.2 */
|
|
8
|
-
var
|
|
8
|
+
var Qs = /* @__PURE__ */ we({
|
|
9
9
|
name: "CircleCloseFilled",
|
|
10
10
|
__name: "circle-close-filled",
|
|
11
11
|
setup(o) {
|
|
12
|
-
return (e, t) => (
|
|
12
|
+
return (e, t) => (R(), $("svg", {
|
|
13
13
|
xmlns: "http://www.w3.org/2000/svg",
|
|
14
14
|
viewBox: "0 0 1024 1024"
|
|
15
15
|
}, [
|
|
16
|
-
|
|
16
|
+
z("path", {
|
|
17
17
|
fill: "currentColor",
|
|
18
18
|
d: "M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 393.664L407.936 353.6a38.4 38.4 0 1 0-54.336 54.336L457.664 512 353.6 616.064a38.4 38.4 0 1 0 54.336 54.336L512 566.336 616.064 670.4a38.4 38.4 0 1 0 54.336-54.336L566.336 512 670.4 407.936a38.4 38.4 0 1 0-54.336-54.336z"
|
|
19
19
|
})
|
|
20
20
|
]));
|
|
21
21
|
}
|
|
22
|
-
}),
|
|
22
|
+
}), Js = Qs, er = /* @__PURE__ */ we({
|
|
23
23
|
name: "Close",
|
|
24
24
|
__name: "close",
|
|
25
25
|
setup(o) {
|
|
26
|
-
return (e, t) => (
|
|
26
|
+
return (e, t) => (R(), $("svg", {
|
|
27
27
|
xmlns: "http://www.w3.org/2000/svg",
|
|
28
28
|
viewBox: "0 0 1024 1024"
|
|
29
29
|
}, [
|
|
30
|
-
|
|
30
|
+
z("path", {
|
|
31
31
|
fill: "currentColor",
|
|
32
32
|
d: "M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"
|
|
33
33
|
})
|
|
34
34
|
]));
|
|
35
35
|
}
|
|
36
|
-
}),
|
|
36
|
+
}), tr = er, ir = /* @__PURE__ */ we({
|
|
37
37
|
name: "Edit",
|
|
38
38
|
__name: "edit",
|
|
39
39
|
setup(o) {
|
|
40
|
-
return (e, t) => (
|
|
40
|
+
return (e, t) => (R(), $("svg", {
|
|
41
41
|
xmlns: "http://www.w3.org/2000/svg",
|
|
42
42
|
viewBox: "0 0 1024 1024"
|
|
43
43
|
}, [
|
|
44
|
-
|
|
44
|
+
z("path", {
|
|
45
45
|
fill: "currentColor",
|
|
46
46
|
d: "M832 512a32 32 0 1 1 64 0v352a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V160a32 32 0 0 1 32-32h352a32 32 0 0 1 0 64H192v640h640z"
|
|
47
47
|
}),
|
|
48
|
-
|
|
48
|
+
z("path", {
|
|
49
49
|
fill: "currentColor",
|
|
50
50
|
d: "m469.952 554.24 52.8-7.552L847.104 222.4a32 32 0 1 0-45.248-45.248L477.44 501.44l-7.552 52.8zm422.4-422.4a96 96 0 0 1 0 135.808l-331.84 331.84a32 32 0 0 1-18.112 9.088L436.8 623.68a32 32 0 0 1-36.224-36.224l15.104-105.6a32 32 0 0 1 9.024-18.112l331.904-331.84a96 96 0 0 1 135.744 0z"
|
|
51
51
|
})
|
|
52
52
|
]));
|
|
53
53
|
}
|
|
54
|
-
}),
|
|
54
|
+
}), us = ir, sr = /* @__PURE__ */ we({
|
|
55
55
|
name: "Lock",
|
|
56
56
|
__name: "lock",
|
|
57
57
|
setup(o) {
|
|
58
|
-
return (e, t) => (
|
|
58
|
+
return (e, t) => (R(), $("svg", {
|
|
59
59
|
xmlns: "http://www.w3.org/2000/svg",
|
|
60
60
|
viewBox: "0 0 1024 1024"
|
|
61
61
|
}, [
|
|
62
|
-
|
|
62
|
+
z("path", {
|
|
63
63
|
fill: "currentColor",
|
|
64
64
|
d: "M224 448a32 32 0 0 0-32 32v384a32 32 0 0 0 32 32h576a32 32 0 0 0 32-32V480a32 32 0 0 0-32-32zm0-64h576a96 96 0 0 1 96 96v384a96 96 0 0 1-96 96H224a96 96 0 0 1-96-96V480a96 96 0 0 1 96-96"
|
|
65
65
|
}),
|
|
66
|
-
|
|
66
|
+
z("path", {
|
|
67
67
|
fill: "currentColor",
|
|
68
68
|
d: "M512 544a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V576a32 32 0 0 1 32-32m192-160v-64a192 192 0 1 0-384 0v64zM512 64a256 256 0 0 1 256 256v128H256V320A256 256 0 0 1 512 64"
|
|
69
69
|
})
|
|
70
70
|
]));
|
|
71
71
|
}
|
|
72
|
-
}),
|
|
72
|
+
}), rr = sr, nr = /* @__PURE__ */ we({
|
|
73
73
|
name: "Unlock",
|
|
74
74
|
__name: "unlock",
|
|
75
75
|
setup(o) {
|
|
76
|
-
return (e, t) => (
|
|
76
|
+
return (e, t) => (R(), $("svg", {
|
|
77
77
|
xmlns: "http://www.w3.org/2000/svg",
|
|
78
78
|
viewBox: "0 0 1024 1024"
|
|
79
79
|
}, [
|
|
80
|
-
|
|
80
|
+
z("path", {
|
|
81
81
|
fill: "currentColor",
|
|
82
82
|
d: "M224 448a32 32 0 0 0-32 32v384a32 32 0 0 0 32 32h576a32 32 0 0 0 32-32V480a32 32 0 0 0-32-32zm0-64h576a96 96 0 0 1 96 96v384a96 96 0 0 1-96 96H224a96 96 0 0 1-96-96V480a96 96 0 0 1 96-96"
|
|
83
83
|
}),
|
|
84
|
-
|
|
84
|
+
z("path", {
|
|
85
85
|
fill: "currentColor",
|
|
86
86
|
d: "M512 544a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V576a32 32 0 0 1 32-32m178.304-295.296A192.064 192.064 0 0 0 320 320v64h352l96 38.4V448H256V320a256 256 0 0 1 493.76-95.104z"
|
|
87
87
|
})
|
|
88
88
|
]));
|
|
89
89
|
}
|
|
90
|
-
}),
|
|
91
|
-
const nt =
|
|
92
|
-
const o =
|
|
93
|
-
function
|
|
94
|
-
|
|
90
|
+
}), or = nr;
|
|
91
|
+
const nt = Ks("globalPensieveDashVars", () => {
|
|
92
|
+
const o = B([]), e = B({}), t = "dashboard-globalVarsStore", i = B([]), s = B([]), r = B({}), l = ns({});
|
|
93
|
+
function n(x, E) {
|
|
94
|
+
l[x] = E;
|
|
95
95
|
}
|
|
96
|
-
function
|
|
97
|
-
for (const
|
|
98
|
-
Object.assign(
|
|
96
|
+
function u(x = {}) {
|
|
97
|
+
for (const E of Object.keys(l)) delete l[E];
|
|
98
|
+
Object.assign(l, x);
|
|
99
99
|
}
|
|
100
|
-
const
|
|
101
|
-
delete
|
|
100
|
+
const a = (x) => {
|
|
101
|
+
delete l[x], me();
|
|
102
102
|
};
|
|
103
|
-
function
|
|
104
|
-
for (const
|
|
105
|
-
}
|
|
106
|
-
function d() {
|
|
107
|
-
return JSON.parse(JSON.stringify(n));
|
|
103
|
+
function h() {
|
|
104
|
+
for (const x of Object.keys(l)) delete l[x];
|
|
108
105
|
}
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
},
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
106
|
+
function p() {
|
|
107
|
+
return JSON.parse(JSON.stringify(l));
|
|
108
|
+
}
|
|
109
|
+
const d = (x) => s.value.find((E) => E.id === x), _ = (x, E) => {
|
|
110
|
+
i.value.push({ name: x, value: E });
|
|
111
|
+
}, v = () => {
|
|
112
|
+
i.value = [];
|
|
113
|
+
}, L = (x) => {
|
|
114
|
+
const E = C(x);
|
|
115
|
+
r.value = E;
|
|
116
|
+
}, H = () => r.value;
|
|
117
|
+
function C(x) {
|
|
118
|
+
const E = {};
|
|
119
|
+
if (!x || typeof x != "object") return E;
|
|
120
|
+
for (const [K, W] of Object.entries(x))
|
|
121
|
+
if (W && typeof W == "object" && !(Ps(W) || $s(W))) {
|
|
122
|
+
const oe = Object.getPrototypeOf(W) === Object.prototype;
|
|
123
|
+
E[K] = oe ? { ...W } : Bs(W);
|
|
124
124
|
} else
|
|
125
|
-
|
|
126
|
-
return
|
|
127
|
-
}
|
|
128
|
-
const
|
|
129
|
-
const
|
|
130
|
-
|
|
131
|
-
},
|
|
132
|
-
const
|
|
133
|
-
return
|
|
134
|
-
...
|
|
135
|
-
component:
|
|
125
|
+
E[K] = W;
|
|
126
|
+
return E;
|
|
127
|
+
}
|
|
128
|
+
const D = (x) => {
|
|
129
|
+
const E = s.value.find((K) => K.id === x);
|
|
130
|
+
E && (E.Props = E.Props || {}, E.Props.locked = !E.Props.locked);
|
|
131
|
+
}, S = (x) => x.map((E) => {
|
|
132
|
+
const K = e.value[E.componentKey];
|
|
133
|
+
return K ? {
|
|
134
|
+
...E,
|
|
135
|
+
component: K
|
|
136
136
|
// attach runtime component
|
|
137
137
|
} : null;
|
|
138
|
-
}).filter((
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
138
|
+
}).filter((E) => !!E);
|
|
139
|
+
let m = null;
|
|
140
|
+
function y(x) {
|
|
141
|
+
m = x;
|
|
142
|
+
}
|
|
143
|
+
function P() {
|
|
144
|
+
m = null;
|
|
145
|
+
}
|
|
146
|
+
function U() {
|
|
147
|
+
return m ? m() : null;
|
|
148
|
+
}
|
|
149
|
+
function pe() {
|
|
150
|
+
var E, K;
|
|
151
|
+
return (((K = (E = U()) == null ? void 0 : E.save) == null ? void 0 : K.call(E)) ?? []).map((W) => {
|
|
152
|
+
const oe = s.value.find((at) => at.id === W.id);
|
|
153
|
+
if (!oe || !oe.componentKey)
|
|
154
|
+
return console.warn(`save: missing item or componentKey for id=${W == null ? void 0 : W.id}`), null;
|
|
155
|
+
const { x: It, y: Ht, w: lt, h: Ot } = W;
|
|
146
156
|
return {
|
|
147
|
-
id:
|
|
148
|
-
componentKey:
|
|
149
|
-
componentName:
|
|
150
|
-
hideHeader:
|
|
151
|
-
Props:
|
|
152
|
-
x:
|
|
153
|
-
y:
|
|
154
|
-
w:
|
|
155
|
-
h:
|
|
157
|
+
id: oe.id,
|
|
158
|
+
componentKey: oe.componentKey,
|
|
159
|
+
componentName: oe.componentName,
|
|
160
|
+
hideHeader: oe.hideHeader,
|
|
161
|
+
Props: oe.Props ?? {},
|
|
162
|
+
x: It,
|
|
163
|
+
y: Ht,
|
|
164
|
+
w: lt,
|
|
165
|
+
h: Ot
|
|
156
166
|
};
|
|
157
|
-
}).filter((
|
|
167
|
+
}).filter((W) => !!W);
|
|
158
168
|
}
|
|
159
|
-
const
|
|
160
|
-
var
|
|
161
|
-
const
|
|
169
|
+
const me = () => {
|
|
170
|
+
var E;
|
|
171
|
+
const x = {
|
|
162
172
|
version: 1,
|
|
163
|
-
items:
|
|
164
|
-
filters:
|
|
173
|
+
items: pe(),
|
|
174
|
+
filters: p()
|
|
165
175
|
};
|
|
166
|
-
((
|
|
167
|
-
},
|
|
168
|
-
const
|
|
169
|
-
if (!
|
|
170
|
-
|
|
176
|
+
((E = x.items) == null ? void 0 : E.length) < 1 || localStorage.setItem(t, JSON.stringify(x));
|
|
177
|
+
}, N = () => {
|
|
178
|
+
const x = localStorage.getItem(t);
|
|
179
|
+
if (!x) {
|
|
180
|
+
s.value = o.value, u({});
|
|
171
181
|
return;
|
|
172
182
|
}
|
|
173
183
|
try {
|
|
174
|
-
const
|
|
175
|
-
|
|
176
|
-
} catch (
|
|
177
|
-
console.error("Failed to parse globalVarsStore:",
|
|
184
|
+
const E = JSON.parse(x);
|
|
185
|
+
s.value = Array.isArray(E.items) ? S(E.items) : o.value, u(E.filters ?? {});
|
|
186
|
+
} catch (E) {
|
|
187
|
+
console.error("Failed to parse globalVarsStore:", E), s.value = o.value, u({});
|
|
178
188
|
}
|
|
179
189
|
};
|
|
180
|
-
return
|
|
181
|
-
DASHBOARD_ITEMS:
|
|
190
|
+
return ce(l, () => me(), { deep: !0 }), {
|
|
191
|
+
DASHBOARD_ITEMS: s,
|
|
182
192
|
DefaultLayout: o,
|
|
183
193
|
ComponentRegistry: e,
|
|
184
|
-
optionsData:
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
194
|
+
optionsData: i,
|
|
195
|
+
Services: r,
|
|
196
|
+
Filters: l,
|
|
197
|
+
registerGridProvider: y,
|
|
198
|
+
unregisterGridProvider: P,
|
|
199
|
+
setFilter: n,
|
|
200
|
+
clearFilter: a,
|
|
201
|
+
clearAllFilters: h,
|
|
202
|
+
resetFilters: u,
|
|
203
|
+
getDashItem: d,
|
|
204
|
+
toggleWidgetLock: D,
|
|
205
|
+
addOptionsDataItems: _,
|
|
206
|
+
clearOptionsDataItems: v,
|
|
207
|
+
saveToLocalStorage: me,
|
|
208
|
+
loadFromLocalStorage: N,
|
|
209
|
+
setOptionServices: L,
|
|
210
|
+
getServices: H
|
|
200
211
|
};
|
|
201
|
-
}),
|
|
212
|
+
}), lr = { class: "widget-settings-container" }, ar = { class: "widget-setting" }, hr = { class: "dialog-footer" }, ur = /* @__PURE__ */ we({
|
|
202
213
|
__name: "TextWidgetSettings",
|
|
203
214
|
props: {
|
|
204
215
|
showDialog: { type: Boolean },
|
|
@@ -208,31 +219,31 @@ const nt = Xs("globalPensieveDashVars", () => {
|
|
|
208
219
|
},
|
|
209
220
|
emits: ["close-dialog", "update-text-var"],
|
|
210
221
|
setup(o, { emit: e }) {
|
|
211
|
-
const t = nt(), { optionsData: i } =
|
|
222
|
+
const t = nt(), { optionsData: i } = ti(t), s = e, r = o, l = Ce({
|
|
212
223
|
get: () => r.showDialog,
|
|
213
224
|
set: (p) => {
|
|
214
225
|
p || s("close-dialog");
|
|
215
226
|
}
|
|
216
|
-
}), n =
|
|
217
|
-
|
|
227
|
+
}), n = B(r.reactiveSourceValue ?? ""), u = B(r.manualEntryValue ?? ""), a = B(!!r.hideHeaderValue);
|
|
228
|
+
ce(() => r.reactiveSourceValue, (p) => {
|
|
218
229
|
n.value = p ?? "";
|
|
219
|
-
}),
|
|
230
|
+
}), ce(() => r.manualEntryValue, (p) => {
|
|
220
231
|
u.value = p ?? "";
|
|
221
|
-
}, { immediate: !0 }),
|
|
232
|
+
}, { immediate: !0 }), ce(() => r.hideHeaderValue, (p) => {
|
|
222
233
|
a.value = !!p;
|
|
223
234
|
});
|
|
224
235
|
function h() {
|
|
225
236
|
var v;
|
|
226
|
-
const p = (n.value || "").trim(), d = p !== "",
|
|
237
|
+
const p = (n.value || "").trim(), d = p !== "", _ = d ? null : ((v = u.value) == null ? void 0 : v.trim()) || "";
|
|
227
238
|
s("update-text-var", {
|
|
228
239
|
reactiveSource: d ? p : null,
|
|
229
|
-
manualEdit:
|
|
240
|
+
manualEdit: _,
|
|
230
241
|
hideHeader: a.value
|
|
231
242
|
}), l.value = !1;
|
|
232
243
|
}
|
|
233
244
|
return (p, d) => {
|
|
234
|
-
const
|
|
235
|
-
return
|
|
245
|
+
const _ = ie("el-option"), v = ie("el-select"), L = ie("el-input"), H = ie("el-checkbox"), C = ie("el-button"), D = ie("el-dialog");
|
|
246
|
+
return R(), ae(D, {
|
|
236
247
|
class: "full-dialog-dashboard",
|
|
237
248
|
modelValue: l.value,
|
|
238
249
|
"onUpdate:modelValue": d[4] || (d[4] = (S) => l.value = S),
|
|
@@ -240,8 +251,8 @@ const nt = Xs("globalPensieveDashVars", () => {
|
|
|
240
251
|
"append-to-body": !0
|
|
241
252
|
}, {
|
|
242
253
|
footer: q(() => [
|
|
243
|
-
|
|
244
|
-
X(
|
|
254
|
+
z("div", hr, [
|
|
255
|
+
X(C, {
|
|
245
256
|
class: "secondary",
|
|
246
257
|
onClick: d[3] || (d[3] = (S) => l.value = !1)
|
|
247
258
|
}, {
|
|
@@ -250,7 +261,7 @@ const nt = Xs("globalPensieveDashVars", () => {
|
|
|
250
261
|
])]),
|
|
251
262
|
_: 1
|
|
252
263
|
}),
|
|
253
|
-
X(
|
|
264
|
+
X(C, { onClick: h }, {
|
|
254
265
|
default: q(() => [...d[9] || (d[9] = [
|
|
255
266
|
We("Save", -1)
|
|
256
267
|
])]),
|
|
@@ -259,22 +270,22 @@ const nt = Xs("globalPensieveDashVars", () => {
|
|
|
259
270
|
])
|
|
260
271
|
]),
|
|
261
272
|
default: q(() => [
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
d[5] || (d[5] =
|
|
265
|
-
d[6] || (d[6] =
|
|
273
|
+
z("div", lr, [
|
|
274
|
+
z("div", ar, [
|
|
275
|
+
d[5] || (d[5] = z("h4", null, "Select This Widget's Value", -1)),
|
|
276
|
+
d[6] || (d[6] = z("h5", null, "Select From Variables", -1)),
|
|
266
277
|
X(v, {
|
|
267
278
|
modelValue: n.value,
|
|
268
279
|
"onUpdate:modelValue": d[0] || (d[0] = (S) => n.value = S),
|
|
269
280
|
class: "text-settings-height"
|
|
270
281
|
}, {
|
|
271
282
|
default: q(() => [
|
|
272
|
-
(
|
|
283
|
+
(R(), ae(_, {
|
|
273
284
|
value: "",
|
|
274
285
|
key: "__manual__",
|
|
275
286
|
label: "Manual entry"
|
|
276
287
|
})),
|
|
277
|
-
(
|
|
288
|
+
(R(!0), $(ze, null, it(ue(i), (S) => (R(), ae(_, {
|
|
278
289
|
key: S.name,
|
|
279
290
|
label: S.name,
|
|
280
291
|
value: S.name
|
|
@@ -282,13 +293,13 @@ const nt = Xs("globalPensieveDashVars", () => {
|
|
|
282
293
|
]),
|
|
283
294
|
_: 1
|
|
284
295
|
}, 8, ["modelValue"]),
|
|
285
|
-
d[7] || (d[7] =
|
|
286
|
-
X(
|
|
296
|
+
d[7] || (d[7] = z("h5", null, "Manual Entry", -1)),
|
|
297
|
+
X(L, {
|
|
287
298
|
modelValue: u.value,
|
|
288
299
|
"onUpdate:modelValue": d[1] || (d[1] = (S) => u.value = S),
|
|
289
300
|
class: "text-settings-height"
|
|
290
301
|
}, null, 8, ["modelValue"]),
|
|
291
|
-
X(
|
|
302
|
+
X(H, {
|
|
292
303
|
modelValue: a.value,
|
|
293
304
|
"onUpdate:modelValue": d[2] || (d[2] = (S) => a.value = S),
|
|
294
305
|
label: "Hide Header"
|
|
@@ -300,12 +311,12 @@ const nt = Xs("globalPensieveDashVars", () => {
|
|
|
300
311
|
}, 8, ["modelValue"]);
|
|
301
312
|
};
|
|
302
313
|
}
|
|
303
|
-
}),
|
|
314
|
+
}), Me = (o, e) => {
|
|
304
315
|
const t = o.__vccOpts || o;
|
|
305
316
|
for (const [i, s] of e)
|
|
306
317
|
t[i] = s;
|
|
307
318
|
return t;
|
|
308
|
-
},
|
|
319
|
+
}, cr = /* @__PURE__ */ Me(ur, [["__scopeId", "data-v-769ea864"]]), dr = { key: 0 }, pr = /* @__PURE__ */ we({
|
|
309
320
|
inheritAttrs: !1,
|
|
310
321
|
__name: "TextWidget",
|
|
311
322
|
props: {
|
|
@@ -317,115 +328,115 @@ const nt = Xs("globalPensieveDashVars", () => {
|
|
|
317
328
|
setup(o) {
|
|
318
329
|
const e = nt(), t = o;
|
|
319
330
|
Us("dashboard:globalVars", null);
|
|
320
|
-
const i =
|
|
321
|
-
|
|
322
|
-
i.value =
|
|
331
|
+
const i = B(t.displayText ?? "");
|
|
332
|
+
ce(() => t.displayText, (C) => {
|
|
333
|
+
i.value = C ?? "";
|
|
323
334
|
}, { immediate: !0 });
|
|
324
|
-
const s =
|
|
325
|
-
var
|
|
326
|
-
const
|
|
327
|
-
if (!
|
|
328
|
-
const
|
|
335
|
+
const s = Ce(() => !!(t.bindedKey && t.bindedKey.trim() !== "")), r = Ce(() => {
|
|
336
|
+
var m;
|
|
337
|
+
const C = (m = t.bindedKey) == null ? void 0 : m.trim();
|
|
338
|
+
if (!C) return "—";
|
|
339
|
+
const D = e.optionsData.find((y) => (y == null ? void 0 : y.name) === C), S = D == null ? void 0 : D.value;
|
|
329
340
|
return Array.isArray(S) ? S.join(", ") : S && typeof S == "object" ? JSON.stringify(S) : S ?? "—";
|
|
330
|
-
}), l =
|
|
341
|
+
}), l = B("Text Widget"), n = os([{ comp: us, event: _, tooltip: "open Text settings" }]), u = B(!1), a = B(null);
|
|
331
342
|
function h() {
|
|
332
|
-
var
|
|
333
|
-
u.value = !0, (
|
|
343
|
+
var C, D;
|
|
344
|
+
u.value = !0, (D = (C = a.value) == null ? void 0 : C.focus) == null || D.call(C);
|
|
334
345
|
}
|
|
335
346
|
function p() {
|
|
336
347
|
u.value = !1;
|
|
337
348
|
}
|
|
338
|
-
const d =
|
|
339
|
-
function
|
|
349
|
+
const d = B(!1);
|
|
350
|
+
function _() {
|
|
340
351
|
d.value = !0;
|
|
341
352
|
}
|
|
342
353
|
function v() {
|
|
343
354
|
d.value = !1, e.saveToLocalStorage();
|
|
344
355
|
}
|
|
345
|
-
function
|
|
346
|
-
const
|
|
347
|
-
|
|
356
|
+
function L({ manualEdit: C, reactiveSource: D, hideHeader: S }) {
|
|
357
|
+
const m = e.getDashItem(t.widgetID);
|
|
358
|
+
m && (m.hideHeader = S, D && D.trim() !== "" ? (m.Props = m.Props || {}, m.Props.bindedKey = D, m.Props.displayText = null, m.componentName = H(D)) : (m.Props = m.Props || {}, m.Props.bindedKey = null, m.Props.displayText = C ?? "", m.componentName = C ?? "Text"), e.saveToLocalStorage());
|
|
348
359
|
}
|
|
349
|
-
function
|
|
350
|
-
return
|
|
360
|
+
function H(C) {
|
|
361
|
+
return C ? C.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/^./, (D) => D.toUpperCase()) : "";
|
|
351
362
|
}
|
|
352
|
-
return (
|
|
353
|
-
const S = ie("el-input"),
|
|
354
|
-
return
|
|
355
|
-
|
|
363
|
+
return (C, D) => {
|
|
364
|
+
const S = ie("el-input"), m = ls("click-out");
|
|
365
|
+
return R(), $(ze, null, [
|
|
366
|
+
wt(C.$slots, "default", {
|
|
356
367
|
widgetName: l.value,
|
|
357
368
|
childIcons: n.value
|
|
358
369
|
}, void 0, !0),
|
|
359
|
-
|
|
360
|
-
s.value ? (
|
|
361
|
-
|
|
362
|
-
])) :
|
|
370
|
+
z("div", li({ class: "text-widget-wrap" }, C.$attrs), [
|
|
371
|
+
s.value ? (R(), $("div", dr, [
|
|
372
|
+
z("h2", null, Ae(r.value), 1)
|
|
373
|
+
])) : Le((R(), $("div", {
|
|
363
374
|
key: 1,
|
|
364
|
-
onKeyup:
|
|
375
|
+
onKeyup: as(p, ["enter"]),
|
|
365
376
|
class: "tw-flex"
|
|
366
377
|
}, [
|
|
367
|
-
|
|
378
|
+
Le(z("div", null, [
|
|
368
379
|
X(S, {
|
|
369
380
|
ref_key: "textUserInput",
|
|
370
381
|
ref: a,
|
|
371
382
|
modelValue: i.value,
|
|
372
|
-
"onUpdate:modelValue":
|
|
373
|
-
onFocus:
|
|
374
|
-
var P,
|
|
375
|
-
return (
|
|
383
|
+
"onUpdate:modelValue": D[0] || (D[0] = (y) => i.value = y),
|
|
384
|
+
onFocus: D[1] || (D[1] = (y) => {
|
|
385
|
+
var P, U;
|
|
386
|
+
return (U = (P = y.target) == null ? void 0 : P.select) == null ? void 0 : U.call(P);
|
|
376
387
|
})
|
|
377
388
|
}, null, 8, ["modelValue"])
|
|
378
389
|
], 512), [
|
|
379
|
-
[
|
|
390
|
+
[xt, u.value]
|
|
380
391
|
]),
|
|
381
|
-
|
|
382
|
-
onClick:
|
|
392
|
+
Le(z("div", {
|
|
393
|
+
onClick: D[2] || (D[2] = (y) => h()),
|
|
383
394
|
class: "tw-w-full tw-h-full"
|
|
384
395
|
}, [
|
|
385
|
-
|
|
396
|
+
z("h2", null, Ae(i.value), 1)
|
|
386
397
|
], 512), [
|
|
387
|
-
[
|
|
398
|
+
[xt, !u.value]
|
|
388
399
|
])
|
|
389
400
|
], 32)), [
|
|
390
|
-
[
|
|
401
|
+
[m, p]
|
|
391
402
|
])
|
|
392
403
|
], 16),
|
|
393
|
-
X(
|
|
404
|
+
X(cr, {
|
|
394
405
|
"show-dialog": d.value,
|
|
395
406
|
"reactive-source-value": t.bindedKey || "",
|
|
396
407
|
"manual-entry-value": i.value,
|
|
397
408
|
"hide-header-value": t.hideHeader || !1,
|
|
398
409
|
onCloseDialog: v,
|
|
399
|
-
onUpdateTextVar:
|
|
410
|
+
onUpdateTextVar: L
|
|
400
411
|
}, null, 8, ["show-dialog", "reactive-source-value", "manual-entry-value", "hide-header-value"])
|
|
401
412
|
], 64);
|
|
402
413
|
};
|
|
403
414
|
}
|
|
404
|
-
}),
|
|
405
|
-
function
|
|
415
|
+
}), so = /* @__PURE__ */ Me(pr, [["__scopeId", "data-v-4743c11f"]]);
|
|
416
|
+
function ai() {
|
|
406
417
|
return { async: !1, breaks: !1, extensions: null, gfm: !0, hooks: null, pedantic: !1, renderer: null, silent: !1, tokenizer: null, walkTokens: null };
|
|
407
418
|
}
|
|
408
|
-
var
|
|
409
|
-
function
|
|
410
|
-
|
|
419
|
+
var Ie = ai();
|
|
420
|
+
function cs(o) {
|
|
421
|
+
Ie = o;
|
|
411
422
|
}
|
|
412
423
|
var tt = { exec: () => null };
|
|
413
|
-
function
|
|
424
|
+
function I(o, e = "") {
|
|
414
425
|
let t = typeof o == "string" ? o : o.source, i = { replace: (s, r) => {
|
|
415
426
|
let l = typeof r == "string" ? r : r.source;
|
|
416
427
|
return l = l.replace(se.caret, "$1"), t = t.replace(s, l), i;
|
|
417
428
|
}, getRegex: () => new RegExp(t, e) };
|
|
418
429
|
return i;
|
|
419
430
|
}
|
|
420
|
-
var se = { codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm, outputLinkReplace: /\\([\[\]])/g, indentCodeCompensation: /^(\s+)(?:```)/, beginningSpace: /^\s+/, endingHash: /#$/, startingSpaceChar: /^ /, endingSpaceChar: / $/, nonSpaceChar: /[^ ]/, newLineCharGlobal: /\n/g, tabCharGlobal: /\t/g, multipleSpaceGlobal: /\s+/g, blankLine: /^[ \t]*$/, doubleBlankLine: /\n[ \t]*\n[ \t]*$/, blockquoteStart: /^ {0,3}>/, blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g, blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm, listReplaceTabs: /^\t+/, listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g, listIsTask: /^\[[ xX]\] /, listReplaceTask: /^\[[ xX]\] +/, anyLine: /\n.*\n/, hrefBrackets: /^<(.*)>$/, tableDelimiter: /[:|]/, tableAlignChars: /^\||\| *$/g, tableRowBlankLine: /\n[ \t]*$/, tableAlignRight: /^ *-+: *$/, tableAlignCenter: /^ *:-+: *$/, tableAlignLeft: /^ *:-+ *$/, startATag: /^<a /i, endATag: /^<\/a>/i, startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i, endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i, startAngleBracket: /^</, endAngleBracket: />$/, pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/, unicodeAlphaNumeric: /[\p{L}\p{N}]/u, escapeTest: /[&<>"']/, escapeReplace: /[&<>"']/g, escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g, unescapeTest: /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig, caret: /(^|[^\[])\^/g, percentDecode: /%25/g, findPipe: /\|/g, splitPipe: / \|/, slashPipe: /\\\|/g, carriageReturn: /\r\n|\r/g, spaceLine: /^ +$/gm, notSpaceStart: /^\S*/, endingNewline: /\n$/, listItemRegex: (o) => new RegExp(`^( {0,3}${o})((?:[ ][^\\n]*)?(?:\\n|$))`), nextBulletRegex: (o) => new RegExp(`^ {0,${Math.min(3, o - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), hrRegex: (o) => new RegExp(`^ {0,${Math.min(3, o - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), fencesBeginRegex: (o) => new RegExp(`^ {0,${Math.min(3, o - 1)}}(?:\`\`\`|~~~)`), headingBeginRegex: (o) => new RegExp(`^ {0,${Math.min(3, o - 1)}}#`), htmlBeginRegex: (o) => new RegExp(`^ {0,${Math.min(3, o - 1)}}<(?:[a-z].*>|!--)`, "i") },
|
|
421
|
-
]`).replace("lheading",
|
|
422
|
-
function
|
|
431
|
+
var se = { codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm, outputLinkReplace: /\\([\[\]])/g, indentCodeCompensation: /^(\s+)(?:```)/, beginningSpace: /^\s+/, endingHash: /#$/, startingSpaceChar: /^ /, endingSpaceChar: / $/, nonSpaceChar: /[^ ]/, newLineCharGlobal: /\n/g, tabCharGlobal: /\t/g, multipleSpaceGlobal: /\s+/g, blankLine: /^[ \t]*$/, doubleBlankLine: /\n[ \t]*\n[ \t]*$/, blockquoteStart: /^ {0,3}>/, blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g, blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm, listReplaceTabs: /^\t+/, listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g, listIsTask: /^\[[ xX]\] /, listReplaceTask: /^\[[ xX]\] +/, anyLine: /\n.*\n/, hrefBrackets: /^<(.*)>$/, tableDelimiter: /[:|]/, tableAlignChars: /^\||\| *$/g, tableRowBlankLine: /\n[ \t]*$/, tableAlignRight: /^ *-+: *$/, tableAlignCenter: /^ *:-+: *$/, tableAlignLeft: /^ *:-+ *$/, startATag: /^<a /i, endATag: /^<\/a>/i, startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i, endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i, startAngleBracket: /^</, endAngleBracket: />$/, pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/, unicodeAlphaNumeric: /[\p{L}\p{N}]/u, escapeTest: /[&<>"']/, escapeReplace: /[&<>"']/g, escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g, unescapeTest: /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig, caret: /(^|[^\[])\^/g, percentDecode: /%25/g, findPipe: /\|/g, splitPipe: / \|/, slashPipe: /\\\|/g, carriageReturn: /\r\n|\r/g, spaceLine: /^ +$/gm, notSpaceStart: /^\S*/, endingNewline: /\n$/, listItemRegex: (o) => new RegExp(`^( {0,3}${o})((?:[ ][^\\n]*)?(?:\\n|$))`), nextBulletRegex: (o) => new RegExp(`^ {0,${Math.min(3, o - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), hrRegex: (o) => new RegExp(`^ {0,${Math.min(3, o - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), fencesBeginRegex: (o) => new RegExp(`^ {0,${Math.min(3, o - 1)}}(?:\`\`\`|~~~)`), headingBeginRegex: (o) => new RegExp(`^ {0,${Math.min(3, o - 1)}}#`), htmlBeginRegex: (o) => new RegExp(`^ {0,${Math.min(3, o - 1)}}<(?:[a-z].*>|!--)`, "i") }, fr = /^(?:[ \t]*(?:\n|$))+/, gr = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, mr = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, ot = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, _r = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, hi = /(?:[*+-]|\d{1,9}[.)])/, ds = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, ps = I(ds).replace(/bull/g, hi).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex(), yr = I(ds).replace(/bull/g, hi).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(), ui = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, br = /^[^\n]+/, ci = /(?!\s*\])(?:\\.|[^\[\]\\])+/, vr = I(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", ci).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), wr = I(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, hi).getRegex(), zt = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul", di = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, xr = I("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", di).replace("tag", zt).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), fs = I(ui).replace("hr", ot).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", zt).getRegex(), kr = I(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", fs).getRegex(), pi = { blockquote: kr, code: gr, def: vr, fences: mr, heading: _r, hr: ot, html: xr, lheading: ps, list: wr, newline: fr, paragraph: fs, table: tt, text: br }, Wi = I("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", ot).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", zt).getRegex(), Er = { ...pi, lheading: yr, table: Wi, paragraph: I(ui).replace("hr", ot).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", Wi).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", zt).getRegex() }, Tr = { ...pi, html: I(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", di).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(), def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/, heading: /^(#{1,6})(.*)(?:\n+|$)/, fences: tt, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: I(ui).replace("hr", ot).replace("heading", ` *#{1,6} *[^
|
|
432
|
+
]`).replace("lheading", ps).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() }, Rr = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Sr = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, gs = /^( {2,}|\\)\n(?!\s*$)/, Cr = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, Nt = /[\p{P}\p{S}]/u, fi = /[\s\p{P}\p{S}]/u, ms = /[^\s\p{P}\p{S}]/u, Ar = I(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, fi).getRegex(), _s = /(?!~)[\p{P}\p{S}]/u, Dr = /(?!~)[\s\p{P}\p{S}]/u, Lr = /(?:[^\s\p{P}\p{S}]|~)/u, zr = /\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<(?! )[^<>]*?>/g, ys = /^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/, Nr = I(ys, "u").replace(/punct/g, Nt).getRegex(), Mr = I(ys, "u").replace(/punct/g, _s).getRegex(), bs = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", Ir = I(bs, "gu").replace(/notPunctSpace/g, ms).replace(/punctSpace/g, fi).replace(/punct/g, Nt).getRegex(), Hr = I(bs, "gu").replace(/notPunctSpace/g, Lr).replace(/punctSpace/g, Dr).replace(/punct/g, _s).getRegex(), Or = I("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, ms).replace(/punctSpace/g, fi).replace(/punct/g, Nt).getRegex(), Pr = I(/\\(punct)/, "gu").replace(/punct/g, Nt).getRegex(), $r = I(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(), Br = I(di).replace("(?:-->|$)", "-->").getRegex(), Ur = I("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", Br).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), Et = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/, Fr = I(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label", Et).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), vs = I(/^!?\[(label)\]\[(ref)\]/).replace("label", Et).replace("ref", ci).getRegex(), ws = I(/^!?\[(ref)\](?:\[\])?/).replace("ref", ci).getRegex(), Wr = I("reflink|nolink(?!\\()", "g").replace("reflink", vs).replace("nolink", ws).getRegex(), gi = { _backpedal: tt, anyPunctuation: Pr, autolink: $r, blockSkip: zr, br: gs, code: Sr, del: tt, emStrongLDelim: Nr, emStrongRDelimAst: Ir, emStrongRDelimUnd: Or, escape: Rr, link: Fr, nolink: ws, punctuation: Ar, reflink: vs, reflinkSearch: Wr, tag: Ur, text: Cr, url: tt }, Gr = { ...gi, link: I(/^!?\[(label)\]\((.*?)\)/).replace("label", Et).getRegex(), reflink: I(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", Et).getRegex() }, ii = { ...gi, emStrongRDelimAst: Hr, emStrongLDelim: Mr, url: I(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/, "i").replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(), _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/, del: /^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/, text: /^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/ }, Vr = { ...ii, br: I(gs).replace("{2,}", "*").getRegex(), text: I(ii.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() }, mt = { normal: pi, gfm: Er, pedantic: Tr }, Ye = { normal: gi, gfm: ii, breaks: Vr, pedantic: Gr }, qr = { "&": "&", "<": "<", ">": ">", '"': """, "'": "'" }, Gi = (o) => qr[o];
|
|
433
|
+
function ye(o, e) {
|
|
423
434
|
if (e) {
|
|
424
|
-
if (se.escapeTest.test(o)) return o.replace(se.escapeReplace,
|
|
425
|
-
} else if (se.escapeTestNoEncode.test(o)) return o.replace(se.escapeReplaceNoEncode,
|
|
435
|
+
if (se.escapeTest.test(o)) return o.replace(se.escapeReplace, Gi);
|
|
436
|
+
} else if (se.escapeTestNoEncode.test(o)) return o.replace(se.escapeReplaceNoEncode, Gi);
|
|
426
437
|
return o;
|
|
427
438
|
}
|
|
428
|
-
function
|
|
439
|
+
function Vi(o) {
|
|
429
440
|
try {
|
|
430
441
|
o = encodeURI(o).replace(se.percentDecode, "%");
|
|
431
442
|
} catch {
|
|
@@ -433,7 +444,7 @@ function Gi(o) {
|
|
|
433
444
|
}
|
|
434
445
|
return o;
|
|
435
446
|
}
|
|
436
|
-
function
|
|
447
|
+
function qi(o, e) {
|
|
437
448
|
var r;
|
|
438
449
|
let t = o.replace(se.findPipe, (l, n, u) => {
|
|
439
450
|
let a = !1, h = n;
|
|
@@ -453,7 +464,7 @@ function Xe(o, e, t) {
|
|
|
453
464
|
s++;
|
|
454
465
|
return o.slice(0, i - s);
|
|
455
466
|
}
|
|
456
|
-
function
|
|
467
|
+
function jr(o, e) {
|
|
457
468
|
if (o.indexOf(e[1]) === -1) return -1;
|
|
458
469
|
let t = 0;
|
|
459
470
|
for (let i = 0; i < o.length; i++) if (o[i] === "\\") i++;
|
|
@@ -461,13 +472,13 @@ function qr(o, e) {
|
|
|
461
472
|
else if (o[i] === e[1] && (t--, t < 0)) return i;
|
|
462
473
|
return t > 0 ? -2 : -1;
|
|
463
474
|
}
|
|
464
|
-
function
|
|
475
|
+
function ji(o, e, t, i, s) {
|
|
465
476
|
let r = e.href, l = e.title || null, n = o[1].replace(s.other.outputLinkReplace, "$1");
|
|
466
477
|
i.state.inLink = !0;
|
|
467
478
|
let u = { type: o[0].charAt(0) === "!" ? "image" : "link", raw: t, href: r, title: l, text: n, tokens: i.inlineTokens(n) };
|
|
468
479
|
return i.state.inLink = !1, u;
|
|
469
480
|
}
|
|
470
|
-
function
|
|
481
|
+
function Yr(o, e, t) {
|
|
471
482
|
let i = o.match(t.other.indentCodeCompensation);
|
|
472
483
|
if (i === null) return e;
|
|
473
484
|
let s = i[1];
|
|
@@ -480,12 +491,12 @@ function jr(o, e, t) {
|
|
|
480
491
|
}).join(`
|
|
481
492
|
`);
|
|
482
493
|
}
|
|
483
|
-
var
|
|
494
|
+
var Tt = class {
|
|
484
495
|
constructor(o) {
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
this.options = o ||
|
|
496
|
+
O(this, "options");
|
|
497
|
+
O(this, "rules");
|
|
498
|
+
O(this, "lexer");
|
|
499
|
+
this.options = o || Ie;
|
|
489
500
|
}
|
|
490
501
|
space(o) {
|
|
491
502
|
let e = this.rules.block.newline.exec(o);
|
|
@@ -502,7 +513,7 @@ var Et = class {
|
|
|
502
513
|
fences(o) {
|
|
503
514
|
let e = this.rules.block.fences.exec(o);
|
|
504
515
|
if (e) {
|
|
505
|
-
let t = e[0], i =
|
|
516
|
+
let t = e[0], i = Yr(t, e[3] || "", this.rules);
|
|
506
517
|
return { type: "code", raw: t, lang: e[2] ? e[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : e[2], text: i };
|
|
507
518
|
}
|
|
508
519
|
}
|
|
@@ -545,16 +556,16 @@ ${h}` : h;
|
|
|
545
556
|
let d = r.at(-1);
|
|
546
557
|
if ((d == null ? void 0 : d.type) === "code") break;
|
|
547
558
|
if ((d == null ? void 0 : d.type) === "blockquote") {
|
|
548
|
-
let
|
|
559
|
+
let _ = d, v = _.raw + `
|
|
549
560
|
` + t.join(`
|
|
550
|
-
`),
|
|
551
|
-
r[r.length - 1] =
|
|
561
|
+
`), L = this.blockquote(v);
|
|
562
|
+
r[r.length - 1] = L, i = i.substring(0, i.length - _.raw.length) + L.raw, s = s.substring(0, s.length - _.text.length) + L.text;
|
|
552
563
|
break;
|
|
553
564
|
} else if ((d == null ? void 0 : d.type) === "list") {
|
|
554
|
-
let
|
|
565
|
+
let _ = d, v = _.raw + `
|
|
555
566
|
` + t.join(`
|
|
556
|
-
`),
|
|
557
|
-
r[r.length - 1] =
|
|
567
|
+
`), L = this.list(v);
|
|
568
|
+
r[r.length - 1] = L, i = i.substring(0, i.length - d.raw.length) + L.raw, s = s.substring(0, s.length - _.raw.length) + L.raw, t = v.substring(r.at(-1).raw.length).split(`
|
|
558
569
|
`);
|
|
559
570
|
continue;
|
|
560
571
|
}
|
|
@@ -573,29 +584,29 @@ ${h}` : h;
|
|
|
573
584
|
if (!(e = r.exec(o)) || this.rules.block.hr.test(o)) break;
|
|
574
585
|
a = e[0], o = o.substring(a.length);
|
|
575
586
|
let p = e[2].split(`
|
|
576
|
-
`, 1)[0].replace(this.rules.other.listReplaceTabs, (
|
|
577
|
-
`, 1)[0],
|
|
578
|
-
if (this.options.pedantic ? (v = 2, h = p.trimStart()) :
|
|
587
|
+
`, 1)[0].replace(this.rules.other.listReplaceTabs, (C) => " ".repeat(3 * C.length)), d = o.split(`
|
|
588
|
+
`, 1)[0], _ = !p.trim(), v = 0;
|
|
589
|
+
if (this.options.pedantic ? (v = 2, h = p.trimStart()) : _ ? v = e[1].length + 1 : (v = e[2].search(this.rules.other.nonSpaceChar), v = v > 4 ? 1 : v, h = p.slice(v), v += e[1].length), _ && this.rules.other.blankLine.test(d) && (a += d + `
|
|
579
590
|
`, o = o.substring(d.length + 1), u = !0), !u) {
|
|
580
|
-
let
|
|
591
|
+
let C = this.rules.other.nextBulletRegex(v), D = this.rules.other.hrRegex(v), S = this.rules.other.fencesBeginRegex(v), m = this.rules.other.headingBeginRegex(v), y = this.rules.other.htmlBeginRegex(v);
|
|
581
592
|
for (; o; ) {
|
|
582
593
|
let P = o.split(`
|
|
583
|
-
`, 1)[0],
|
|
584
|
-
if (d = P, this.options.pedantic ? (d = d.replace(this.rules.other.listReplaceNesting, " "),
|
|
585
|
-
if (
|
|
586
|
-
` +
|
|
594
|
+
`, 1)[0], U;
|
|
595
|
+
if (d = P, this.options.pedantic ? (d = d.replace(this.rules.other.listReplaceNesting, " "), U = d) : U = d.replace(this.rules.other.tabCharGlobal, " "), S.test(d) || m.test(d) || y.test(d) || C.test(d) || D.test(d)) break;
|
|
596
|
+
if (U.search(this.rules.other.nonSpaceChar) >= v || !d.trim()) h += `
|
|
597
|
+
` + U.slice(v);
|
|
587
598
|
else {
|
|
588
|
-
if (
|
|
599
|
+
if (_ || p.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || S.test(p) || m.test(p) || D.test(p)) break;
|
|
589
600
|
h += `
|
|
590
601
|
` + d;
|
|
591
602
|
}
|
|
592
|
-
!
|
|
593
|
-
`, o = o.substring(P.length + 1), p =
|
|
603
|
+
!_ && !d.trim() && (_ = !0), a += P + `
|
|
604
|
+
`, o = o.substring(P.length + 1), p = U.slice(v);
|
|
594
605
|
}
|
|
595
606
|
}
|
|
596
607
|
s.loose || (l ? s.loose = !0 : this.rules.other.doubleBlankLine.test(a) && (l = !0));
|
|
597
|
-
let
|
|
598
|
-
this.options.gfm && (
|
|
608
|
+
let L = null, H;
|
|
609
|
+
this.options.gfm && (L = this.rules.other.listIsTask.exec(h), L && (H = L[0] !== "[ ] ", h = h.replace(this.rules.other.listReplaceTask, ""))), s.items.push({ type: "list_item", raw: a, task: !!L, checked: H, loose: !1, text: h, tokens: [] }), s.raw += a;
|
|
599
610
|
}
|
|
600
611
|
let n = s.items.at(-1);
|
|
601
612
|
if (n) n.raw = n.raw.trimEnd(), n.text = n.text.trimEnd();
|
|
@@ -624,12 +635,12 @@ ${h}` : h;
|
|
|
624
635
|
var l;
|
|
625
636
|
let e = this.rules.block.table.exec(o);
|
|
626
637
|
if (!e || !this.rules.other.tableDelimiter.test(e[2])) return;
|
|
627
|
-
let t =
|
|
638
|
+
let t = qi(e[1]), i = e[2].replace(this.rules.other.tableAlignChars, "").split("|"), s = (l = e[3]) != null && l.trim() ? e[3].replace(this.rules.other.tableRowBlankLine, "").split(`
|
|
628
639
|
`) : [], r = { type: "table", raw: e[0], header: [], align: [], rows: [] };
|
|
629
640
|
if (t.length === i.length) {
|
|
630
641
|
for (let n of i) this.rules.other.tableAlignRight.test(n) ? r.align.push("right") : this.rules.other.tableAlignCenter.test(n) ? r.align.push("center") : this.rules.other.tableAlignLeft.test(n) ? r.align.push("left") : r.align.push(null);
|
|
631
642
|
for (let n = 0; n < t.length; n++) r.header.push({ text: t[n], tokens: this.lexer.inline(t[n]), header: !0, align: r.align[n] });
|
|
632
|
-
for (let n of s) r.rows.push(
|
|
643
|
+
for (let n of s) r.rows.push(qi(n, r.header.length).map((u, a) => ({ text: u, tokens: this.lexer.inline(u), header: !1, align: r.align[a] })));
|
|
633
644
|
return r;
|
|
634
645
|
}
|
|
635
646
|
}
|
|
@@ -666,7 +677,7 @@ ${h}` : h;
|
|
|
666
677
|
let r = Xe(t.slice(0, -1), "\\");
|
|
667
678
|
if ((t.length - r.length) % 2 === 0) return;
|
|
668
679
|
} else {
|
|
669
|
-
let r =
|
|
680
|
+
let r = jr(e[2], "()");
|
|
670
681
|
if (r === -2) return;
|
|
671
682
|
if (r > -1) {
|
|
672
683
|
let l = (e[0].indexOf("!") === 0 ? 5 : 4) + e[1].length + r;
|
|
@@ -678,7 +689,7 @@ ${h}` : h;
|
|
|
678
689
|
let r = this.rules.other.pedanticHrefTitle.exec(i);
|
|
679
690
|
r && (i = r[1], s = r[3]);
|
|
680
691
|
} else s = e[3] ? e[3].slice(1, -1) : "";
|
|
681
|
-
return i = i.trim(), this.rules.other.startAngleBracket.test(i) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(t) ? i = i.slice(1) : i = i.slice(1, -1)),
|
|
692
|
+
return i = i.trim(), this.rules.other.startAngleBracket.test(i) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(t) ? i = i.slice(1) : i = i.slice(1, -1)), ji(e, { href: i && i.replace(this.rules.inline.anyPunctuation, "$1"), title: s && s.replace(this.rules.inline.anyPunctuation, "$1") }, e[0], this.lexer, this.rules);
|
|
682
693
|
}
|
|
683
694
|
}
|
|
684
695
|
reflink(o, e) {
|
|
@@ -689,7 +700,7 @@ ${h}` : h;
|
|
|
689
700
|
let r = t[0].charAt(0);
|
|
690
701
|
return { type: "text", raw: r, text: r };
|
|
691
702
|
}
|
|
692
|
-
return
|
|
703
|
+
return ji(t, s, t[0], this.lexer, this.rules);
|
|
693
704
|
}
|
|
694
705
|
}
|
|
695
706
|
emStrong(o, e, t = "") {
|
|
@@ -709,8 +720,8 @@ ${h}` : h;
|
|
|
709
720
|
l = Math.min(l, l + n + u);
|
|
710
721
|
let h = [...i[0]][0].length, p = o.slice(0, s + i.index + h + l);
|
|
711
722
|
if (Math.min(s, l) % 2) {
|
|
712
|
-
let
|
|
713
|
-
return { type: "em", raw: p, text:
|
|
723
|
+
let _ = p.slice(1, -1);
|
|
724
|
+
return { type: "em", raw: p, text: _, tokens: this.lexer.inlineTokens(_) };
|
|
714
725
|
}
|
|
715
726
|
let d = p.slice(2, -2);
|
|
716
727
|
return { type: "strong", raw: p, text: d, tokens: this.lexer.inlineTokens(d) };
|
|
@@ -762,25 +773,25 @@ ${h}` : h;
|
|
|
762
773
|
return { type: "text", raw: e[0], text: e[0], escaped: t };
|
|
763
774
|
}
|
|
764
775
|
}
|
|
765
|
-
},
|
|
776
|
+
}, Re = class si {
|
|
766
777
|
constructor(e) {
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = e ||
|
|
773
|
-
let t = { other: se, block:
|
|
774
|
-
this.options.pedantic ? (t.block =
|
|
778
|
+
O(this, "tokens");
|
|
779
|
+
O(this, "options");
|
|
780
|
+
O(this, "state");
|
|
781
|
+
O(this, "tokenizer");
|
|
782
|
+
O(this, "inlineQueue");
|
|
783
|
+
this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = e || Ie, this.options.tokenizer = this.options.tokenizer || new Tt(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = { inLink: !1, inRawBlock: !1, top: !0 };
|
|
784
|
+
let t = { other: se, block: mt.normal, inline: Ye.normal };
|
|
785
|
+
this.options.pedantic ? (t.block = mt.pedantic, t.inline = Ye.pedantic) : this.options.gfm && (t.block = mt.gfm, this.options.breaks ? t.inline = Ye.breaks : t.inline = Ye.gfm), this.tokenizer.rules = t;
|
|
775
786
|
}
|
|
776
787
|
static get rules() {
|
|
777
|
-
return { block:
|
|
788
|
+
return { block: mt, inline: Ye };
|
|
778
789
|
}
|
|
779
790
|
static lex(e, t) {
|
|
780
|
-
return new
|
|
791
|
+
return new si(t).lex(e);
|
|
781
792
|
}
|
|
782
793
|
static lexInline(e, t) {
|
|
783
|
-
return new
|
|
794
|
+
return new si(t).inlineTokens(e);
|
|
784
795
|
}
|
|
785
796
|
lex(e) {
|
|
786
797
|
e = e.replace(se.carriageReturn, `
|
|
@@ -948,9 +959,9 @@ ${h}` : h;
|
|
|
948
959
|
}
|
|
949
960
|
let p = e;
|
|
950
961
|
if ((a = this.options.extensions) != null && a.startInline) {
|
|
951
|
-
let d = 1 / 0,
|
|
952
|
-
this.options.extensions.startInline.forEach((
|
|
953
|
-
v =
|
|
962
|
+
let d = 1 / 0, _ = e.slice(1), v;
|
|
963
|
+
this.options.extensions.startInline.forEach((L) => {
|
|
964
|
+
v = L.call({ lexer: this }, _), typeof v == "number" && v >= 0 && (d = Math.min(d, v));
|
|
954
965
|
}), d < 1 / 0 && d >= 0 && (p = e.substring(0, d + 1));
|
|
955
966
|
}
|
|
956
967
|
if (h = this.tokenizer.inlineText(p)) {
|
|
@@ -969,11 +980,11 @@ ${h}` : h;
|
|
|
969
980
|
}
|
|
970
981
|
return t;
|
|
971
982
|
}
|
|
972
|
-
},
|
|
983
|
+
}, Rt = class {
|
|
973
984
|
constructor(o) {
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
this.options = o ||
|
|
985
|
+
O(this, "options");
|
|
986
|
+
O(this, "parser");
|
|
987
|
+
this.options = o || Ie;
|
|
977
988
|
}
|
|
978
989
|
space(o) {
|
|
979
990
|
return "";
|
|
@@ -982,8 +993,8 @@ ${h}` : h;
|
|
|
982
993
|
var r;
|
|
983
994
|
let i = (r = (e || "").match(se.notSpaceStart)) == null ? void 0 : r[0], s = o.replace(se.endingNewline, "") + `
|
|
984
995
|
`;
|
|
985
|
-
return i ? '<pre><code class="language-' +
|
|
986
|
-
` : "<pre><code>" + (t ? s :
|
|
996
|
+
return i ? '<pre><code class="language-' + ye(i) + '">' + (t ? s : ye(s, !0)) + `</code></pre>
|
|
997
|
+
` : "<pre><code>" + (t ? s : ye(s, !0)) + `</code></pre>
|
|
987
998
|
`;
|
|
988
999
|
}
|
|
989
1000
|
blockquote({ tokens: o }) {
|
|
@@ -1021,7 +1032,7 @@ ${this.parser.parse(o)}</blockquote>
|
|
|
1021
1032
|
let e = "";
|
|
1022
1033
|
if (o.task) {
|
|
1023
1034
|
let i = this.checkbox({ checked: !!o.checked });
|
|
1024
|
-
o.loose ? ((t = o.tokens[0]) == null ? void 0 : t.type) === "paragraph" ? (o.tokens[0].text = i + " " + o.tokens[0].text, o.tokens[0].tokens && o.tokens[0].tokens.length > 0 && o.tokens[0].tokens[0].type === "text" && (o.tokens[0].tokens[0].text = i + " " +
|
|
1035
|
+
o.loose ? ((t = o.tokens[0]) == null ? void 0 : t.type) === "paragraph" ? (o.tokens[0].text = i + " " + o.tokens[0].text, o.tokens[0].tokens && o.tokens[0].tokens.length > 0 && o.tokens[0].tokens[0].type === "text" && (o.tokens[0].tokens[0].text = i + " " + ye(o.tokens[0].tokens[0].text), o.tokens[0].tokens[0].escaped = !0)) : o.tokens.unshift({ type: "text", raw: i + " ", text: i + " ", escaped: !0 }) : e += i + " ";
|
|
1025
1036
|
}
|
|
1026
1037
|
return e += this.parser.parse(o.tokens, !!o.loose), `<li>${e}</li>
|
|
1027
1038
|
`;
|
|
@@ -1067,7 +1078,7 @@ ${o}</tr>
|
|
|
1067
1078
|
return `<em>${this.parser.parseInline(o)}</em>`;
|
|
1068
1079
|
}
|
|
1069
1080
|
codespan({ text: o }) {
|
|
1070
|
-
return `<code>${
|
|
1081
|
+
return `<code>${ye(o, !0)}</code>`;
|
|
1071
1082
|
}
|
|
1072
1083
|
br(o) {
|
|
1073
1084
|
return "<br>";
|
|
@@ -1076,24 +1087,24 @@ ${o}</tr>
|
|
|
1076
1087
|
return `<del>${this.parser.parseInline(o)}</del>`;
|
|
1077
1088
|
}
|
|
1078
1089
|
link({ href: o, title: e, tokens: t }) {
|
|
1079
|
-
let i = this.parser.parseInline(t), s =
|
|
1090
|
+
let i = this.parser.parseInline(t), s = Vi(o);
|
|
1080
1091
|
if (s === null) return i;
|
|
1081
1092
|
o = s;
|
|
1082
1093
|
let r = '<a href="' + o + '"';
|
|
1083
|
-
return e && (r += ' title="' +
|
|
1094
|
+
return e && (r += ' title="' + ye(e) + '"'), r += ">" + i + "</a>", r;
|
|
1084
1095
|
}
|
|
1085
1096
|
image({ href: o, title: e, text: t, tokens: i }) {
|
|
1086
1097
|
i && (t = this.parser.parseInline(i, this.parser.textRenderer));
|
|
1087
|
-
let s =
|
|
1088
|
-
if (s === null) return
|
|
1098
|
+
let s = Vi(o);
|
|
1099
|
+
if (s === null) return ye(t);
|
|
1089
1100
|
o = s;
|
|
1090
1101
|
let r = `<img src="${o}" alt="${t}"`;
|
|
1091
|
-
return e && (r += ` title="${
|
|
1102
|
+
return e && (r += ` title="${ye(e)}"`), r += ">", r;
|
|
1092
1103
|
}
|
|
1093
1104
|
text(o) {
|
|
1094
|
-
return "tokens" in o && o.tokens ? this.parser.parseInline(o.tokens) : "escaped" in o && o.escaped ? o.text :
|
|
1105
|
+
return "tokens" in o && o.tokens ? this.parser.parseInline(o.tokens) : "escaped" in o && o.escaped ? o.text : ye(o.text);
|
|
1095
1106
|
}
|
|
1096
|
-
},
|
|
1107
|
+
}, mi = class {
|
|
1097
1108
|
strong({ text: o }) {
|
|
1098
1109
|
return o;
|
|
1099
1110
|
}
|
|
@@ -1121,18 +1132,18 @@ ${o}</tr>
|
|
|
1121
1132
|
br() {
|
|
1122
1133
|
return "";
|
|
1123
1134
|
}
|
|
1124
|
-
},
|
|
1135
|
+
}, Se = class ri {
|
|
1125
1136
|
constructor(e) {
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
this.options = e ||
|
|
1137
|
+
O(this, "options");
|
|
1138
|
+
O(this, "renderer");
|
|
1139
|
+
O(this, "textRenderer");
|
|
1140
|
+
this.options = e || Ie, this.options.renderer = this.options.renderer || new Rt(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new mi();
|
|
1130
1141
|
}
|
|
1131
1142
|
static parse(e, t) {
|
|
1132
|
-
return new
|
|
1143
|
+
return new ri(t).parse(e);
|
|
1133
1144
|
}
|
|
1134
1145
|
static parseInline(e, t) {
|
|
1135
|
-
return new
|
|
1146
|
+
return new ri(t).parseInline(e);
|
|
1136
1147
|
}
|
|
1137
1148
|
parse(e, t = !0) {
|
|
1138
1149
|
var s, r;
|
|
@@ -1267,11 +1278,11 @@ ${o}</tr>
|
|
|
1267
1278
|
}
|
|
1268
1279
|
return i;
|
|
1269
1280
|
}
|
|
1270
|
-
},
|
|
1281
|
+
}, ei, bt = (ei = class {
|
|
1271
1282
|
constructor(o) {
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
this.options = o ||
|
|
1283
|
+
O(this, "options");
|
|
1284
|
+
O(this, "block");
|
|
1285
|
+
this.options = o || Ie;
|
|
1275
1286
|
}
|
|
1276
1287
|
preprocess(o) {
|
|
1277
1288
|
return o;
|
|
@@ -1283,23 +1294,23 @@ ${o}</tr>
|
|
|
1283
1294
|
return o;
|
|
1284
1295
|
}
|
|
1285
1296
|
provideLexer() {
|
|
1286
|
-
return this.block ?
|
|
1297
|
+
return this.block ? Re.lex : Re.lexInline;
|
|
1287
1298
|
}
|
|
1288
1299
|
provideParser() {
|
|
1289
|
-
return this.block ?
|
|
1300
|
+
return this.block ? Se.parse : Se.parseInline;
|
|
1290
1301
|
}
|
|
1291
|
-
},
|
|
1302
|
+
}, O(ei, "passThroughHooks", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens"])), ei), Xr = class {
|
|
1292
1303
|
constructor(...o) {
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1304
|
+
O(this, "defaults", ai());
|
|
1305
|
+
O(this, "options", this.setOptions);
|
|
1306
|
+
O(this, "parse", this.parseMarkdown(!0));
|
|
1307
|
+
O(this, "parseInline", this.parseMarkdown(!1));
|
|
1308
|
+
O(this, "Parser", Se);
|
|
1309
|
+
O(this, "Renderer", Rt);
|
|
1310
|
+
O(this, "TextRenderer", mi);
|
|
1311
|
+
O(this, "Lexer", Re);
|
|
1312
|
+
O(this, "Tokenizer", Tt);
|
|
1313
|
+
O(this, "Hooks", bt);
|
|
1303
1314
|
this.use(...o);
|
|
1304
1315
|
}
|
|
1305
1316
|
walkTokens(o, e) {
|
|
@@ -1347,7 +1358,7 @@ ${o}</tr>
|
|
|
1347
1358
|
}
|
|
1348
1359
|
"childTokens" in s && s.childTokens && (e.childTokens[s.name] = s.childTokens);
|
|
1349
1360
|
}), i.extensions = e), t.renderer) {
|
|
1350
|
-
let s = this.defaults.renderer || new
|
|
1361
|
+
let s = this.defaults.renderer || new Rt(this.defaults);
|
|
1351
1362
|
for (let r in t.renderer) {
|
|
1352
1363
|
if (!(r in s)) throw new Error(`renderer '${r}' does not exist`);
|
|
1353
1364
|
if (["options", "parser"].includes(r)) continue;
|
|
@@ -1360,7 +1371,7 @@ ${o}</tr>
|
|
|
1360
1371
|
i.renderer = s;
|
|
1361
1372
|
}
|
|
1362
1373
|
if (t.tokenizer) {
|
|
1363
|
-
let s = this.defaults.tokenizer || new
|
|
1374
|
+
let s = this.defaults.tokenizer || new Tt(this.defaults);
|
|
1364
1375
|
for (let r in t.tokenizer) {
|
|
1365
1376
|
if (!(r in s)) throw new Error(`tokenizer '${r}' does not exist`);
|
|
1366
1377
|
if (["options", "rules", "lexer"].includes(r)) continue;
|
|
@@ -1373,12 +1384,12 @@ ${o}</tr>
|
|
|
1373
1384
|
i.tokenizer = s;
|
|
1374
1385
|
}
|
|
1375
1386
|
if (t.hooks) {
|
|
1376
|
-
let s = this.defaults.hooks || new
|
|
1387
|
+
let s = this.defaults.hooks || new bt();
|
|
1377
1388
|
for (let r in t.hooks) {
|
|
1378
1389
|
if (!(r in s)) throw new Error(`hook '${r}' does not exist`);
|
|
1379
1390
|
if (["options", "block"].includes(r)) continue;
|
|
1380
1391
|
let l = r, n = t.hooks[l], u = s[l];
|
|
1381
|
-
|
|
1392
|
+
bt.passThroughHooks.has(r) ? s[l] = (a) => {
|
|
1382
1393
|
if (this.defaults.async) return Promise.resolve(n.call(s, a)).then((p) => u.call(s, p));
|
|
1383
1394
|
let h = n.call(s, a);
|
|
1384
1395
|
return u.call(s, h);
|
|
@@ -1403,10 +1414,10 @@ ${o}</tr>
|
|
|
1403
1414
|
return this.defaults = { ...this.defaults, ...o }, this;
|
|
1404
1415
|
}
|
|
1405
1416
|
lexer(o, e) {
|
|
1406
|
-
return
|
|
1417
|
+
return Re.lex(o, e ?? this.defaults);
|
|
1407
1418
|
}
|
|
1408
1419
|
parser(o, e) {
|
|
1409
|
-
return
|
|
1420
|
+
return Se.parse(o, e ?? this.defaults);
|
|
1410
1421
|
}
|
|
1411
1422
|
parseMarkdown(o) {
|
|
1412
1423
|
return (e, t) => {
|
|
@@ -1415,7 +1426,7 @@ ${o}</tr>
|
|
|
1415
1426
|
if (typeof e > "u" || e === null) return r(new Error("marked(): input parameter is undefined or null"));
|
|
1416
1427
|
if (typeof e != "string") return r(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(e) + ", string expected"));
|
|
1417
1428
|
s.hooks && (s.hooks.options = s, s.hooks.block = o);
|
|
1418
|
-
let l = s.hooks ? s.hooks.provideLexer() : o ?
|
|
1429
|
+
let l = s.hooks ? s.hooks.provideLexer() : o ? Re.lex : Re.lexInline, n = s.hooks ? s.hooks.provideParser() : o ? Se.parse : Se.parseInline;
|
|
1419
1430
|
if (s.async) return Promise.resolve(s.hooks ? s.hooks.preprocess(e) : e).then((u) => l(u, s)).then((u) => s.hooks ? s.hooks.processAllTokens(u) : u).then((u) => s.walkTokens ? Promise.all(this.walkTokens(u, s.walkTokens)).then(() => u) : u).then((u) => n(u, s)).then((u) => s.hooks ? s.hooks.postprocess(u) : u).catch(r);
|
|
1420
1431
|
try {
|
|
1421
1432
|
s.hooks && (e = s.hooks.preprocess(e));
|
|
@@ -1432,149 +1443,149 @@ ${o}</tr>
|
|
|
1432
1443
|
return (t) => {
|
|
1433
1444
|
if (t.message += `
|
|
1434
1445
|
Please report this to https://github.com/markedjs/marked.`, o) {
|
|
1435
|
-
let i = "<p>An error occurred:</p><pre>" +
|
|
1446
|
+
let i = "<p>An error occurred:</p><pre>" + ye(t.message + "", !0) + "</pre>";
|
|
1436
1447
|
return e ? Promise.resolve(i) : i;
|
|
1437
1448
|
}
|
|
1438
1449
|
if (e) return Promise.reject(t);
|
|
1439
1450
|
throw t;
|
|
1440
1451
|
};
|
|
1441
1452
|
}
|
|
1442
|
-
},
|
|
1443
|
-
function
|
|
1444
|
-
return
|
|
1453
|
+
}, Ne = new Xr();
|
|
1454
|
+
function M(o, e) {
|
|
1455
|
+
return Ne.parse(o, e);
|
|
1445
1456
|
}
|
|
1446
|
-
|
|
1447
|
-
return
|
|
1457
|
+
M.options = M.setOptions = function(o) {
|
|
1458
|
+
return Ne.setOptions(o), M.defaults = Ne.defaults, cs(M.defaults), M;
|
|
1448
1459
|
};
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
return
|
|
1460
|
+
M.getDefaults = ai;
|
|
1461
|
+
M.defaults = Ie;
|
|
1462
|
+
M.use = function(...o) {
|
|
1463
|
+
return Ne.use(...o), M.defaults = Ne.defaults, cs(M.defaults), M;
|
|
1453
1464
|
};
|
|
1454
|
-
|
|
1455
|
-
return
|
|
1465
|
+
M.walkTokens = function(o, e) {
|
|
1466
|
+
return Ne.walkTokens(o, e);
|
|
1456
1467
|
};
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1468
|
+
M.parseInline = Ne.parseInline;
|
|
1469
|
+
M.Parser = Se;
|
|
1470
|
+
M.parser = Se.parse;
|
|
1471
|
+
M.Renderer = Rt;
|
|
1472
|
+
M.TextRenderer = mi;
|
|
1473
|
+
M.Lexer = Re;
|
|
1474
|
+
M.lexer = Re.lex;
|
|
1475
|
+
M.Tokenizer = Tt;
|
|
1476
|
+
M.Hooks = bt;
|
|
1477
|
+
M.parse = M;
|
|
1478
|
+
M.options;
|
|
1479
|
+
M.setOptions;
|
|
1480
|
+
M.use;
|
|
1481
|
+
M.walkTokens;
|
|
1482
|
+
M.parseInline;
|
|
1483
|
+
Se.parse;
|
|
1484
|
+
Re.lex;
|
|
1474
1485
|
/*! @license DOMPurify 3.2.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.6/LICENSE */
|
|
1475
1486
|
const {
|
|
1476
|
-
entries:
|
|
1477
|
-
setPrototypeOf:
|
|
1478
|
-
isFrozen:
|
|
1479
|
-
getPrototypeOf:
|
|
1480
|
-
getOwnPropertyDescriptor:
|
|
1487
|
+
entries: xs,
|
|
1488
|
+
setPrototypeOf: Yi,
|
|
1489
|
+
isFrozen: Kr,
|
|
1490
|
+
getPrototypeOf: Zr,
|
|
1491
|
+
getOwnPropertyDescriptor: Qr
|
|
1481
1492
|
} = Object;
|
|
1482
1493
|
let {
|
|
1483
1494
|
freeze: re,
|
|
1484
|
-
seal:
|
|
1485
|
-
create:
|
|
1495
|
+
seal: de,
|
|
1496
|
+
create: ks
|
|
1486
1497
|
} = Object, {
|
|
1487
|
-
apply:
|
|
1488
|
-
construct:
|
|
1498
|
+
apply: ni,
|
|
1499
|
+
construct: oi
|
|
1489
1500
|
} = typeof Reflect < "u" && Reflect;
|
|
1490
1501
|
re || (re = function(e) {
|
|
1491
1502
|
return e;
|
|
1492
1503
|
});
|
|
1493
|
-
|
|
1504
|
+
de || (de = function(e) {
|
|
1494
1505
|
return e;
|
|
1495
1506
|
});
|
|
1496
|
-
|
|
1507
|
+
ni || (ni = function(e, t, i) {
|
|
1497
1508
|
return e.apply(t, i);
|
|
1498
1509
|
});
|
|
1499
|
-
|
|
1510
|
+
oi || (oi = function(e, t) {
|
|
1500
1511
|
return new e(...t);
|
|
1501
1512
|
});
|
|
1502
|
-
const
|
|
1513
|
+
const _t = ne(Array.prototype.forEach), Jr = ne(Array.prototype.lastIndexOf), Xi = ne(Array.prototype.pop), Ke = ne(Array.prototype.push), en = ne(Array.prototype.splice), vt = ne(String.prototype.toLowerCase), Xt = ne(String.prototype.toString), Ki = ne(String.prototype.match), Ze = ne(String.prototype.replace), tn = ne(String.prototype.indexOf), sn = ne(String.prototype.trim), fe = ne(Object.prototype.hasOwnProperty), te = ne(RegExp.prototype.test), Qe = rn(TypeError);
|
|
1503
1514
|
function ne(o) {
|
|
1504
1515
|
return function(e) {
|
|
1505
1516
|
e instanceof RegExp && (e.lastIndex = 0);
|
|
1506
1517
|
for (var t = arguments.length, i = new Array(t > 1 ? t - 1 : 0), s = 1; s < t; s++)
|
|
1507
1518
|
i[s - 1] = arguments[s];
|
|
1508
|
-
return
|
|
1519
|
+
return ni(o, e, i);
|
|
1509
1520
|
};
|
|
1510
1521
|
}
|
|
1511
|
-
function
|
|
1522
|
+
function rn(o) {
|
|
1512
1523
|
return function() {
|
|
1513
1524
|
for (var e = arguments.length, t = new Array(e), i = 0; i < e; i++)
|
|
1514
1525
|
t[i] = arguments[i];
|
|
1515
|
-
return
|
|
1526
|
+
return oi(o, t);
|
|
1516
1527
|
};
|
|
1517
1528
|
}
|
|
1518
|
-
function
|
|
1519
|
-
let t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] :
|
|
1520
|
-
|
|
1529
|
+
function A(o, e) {
|
|
1530
|
+
let t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : vt;
|
|
1531
|
+
Yi && Yi(o, null);
|
|
1521
1532
|
let i = e.length;
|
|
1522
1533
|
for (; i--; ) {
|
|
1523
1534
|
let s = e[i];
|
|
1524
1535
|
if (typeof s == "string") {
|
|
1525
1536
|
const r = t(s);
|
|
1526
|
-
r !== s && (
|
|
1537
|
+
r !== s && (Kr(e) || (e[i] = r), s = r);
|
|
1527
1538
|
}
|
|
1528
1539
|
o[s] = !0;
|
|
1529
1540
|
}
|
|
1530
1541
|
return o;
|
|
1531
1542
|
}
|
|
1532
|
-
function
|
|
1543
|
+
function nn(o) {
|
|
1533
1544
|
for (let e = 0; e < o.length; e++)
|
|
1534
|
-
|
|
1545
|
+
fe(o, e) || (o[e] = null);
|
|
1535
1546
|
return o;
|
|
1536
1547
|
}
|
|
1537
|
-
function
|
|
1538
|
-
const e =
|
|
1539
|
-
for (const [t, i] of
|
|
1540
|
-
|
|
1548
|
+
function Te(o) {
|
|
1549
|
+
const e = ks(null);
|
|
1550
|
+
for (const [t, i] of xs(o))
|
|
1551
|
+
fe(o, t) && (Array.isArray(i) ? e[t] = nn(i) : i && typeof i == "object" && i.constructor === Object ? e[t] = Te(i) : e[t] = i);
|
|
1541
1552
|
return e;
|
|
1542
1553
|
}
|
|
1543
1554
|
function Je(o, e) {
|
|
1544
1555
|
for (; o !== null; ) {
|
|
1545
|
-
const i =
|
|
1556
|
+
const i = Qr(o, e);
|
|
1546
1557
|
if (i) {
|
|
1547
1558
|
if (i.get)
|
|
1548
1559
|
return ne(i.get);
|
|
1549
1560
|
if (typeof i.value == "function")
|
|
1550
1561
|
return ne(i.value);
|
|
1551
1562
|
}
|
|
1552
|
-
o =
|
|
1563
|
+
o = Zr(o);
|
|
1553
1564
|
}
|
|
1554
1565
|
function t() {
|
|
1555
1566
|
return null;
|
|
1556
1567
|
}
|
|
1557
1568
|
return t;
|
|
1558
1569
|
}
|
|
1559
|
-
const
|
|
1570
|
+
const Zi = re(["a", "abbr", "acronym", "address", "area", "article", "aside", "audio", "b", "bdi", "bdo", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "decorator", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "element", "em", "fieldset", "figcaption", "figure", "font", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "img", "input", "ins", "kbd", "label", "legend", "li", "main", "map", "mark", "marquee", "menu", "menuitem", "meter", "nav", "nobr", "ol", "optgroup", "option", "output", "p", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "section", "select", "shadow", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "tr", "track", "tt", "u", "ul", "var", "video", "wbr"]), Kt = re(["svg", "a", "altglyph", "altglyphdef", "altglyphitem", "animatecolor", "animatemotion", "animatetransform", "circle", "clippath", "defs", "desc", "ellipse", "filter", "font", "g", "glyph", "glyphref", "hkern", "image", "line", "lineargradient", "marker", "mask", "metadata", "mpath", "path", "pattern", "polygon", "polyline", "radialgradient", "rect", "stop", "style", "switch", "symbol", "text", "textpath", "title", "tref", "tspan", "view", "vkern"]), Zt = re(["feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence"]), on = re(["animate", "color-profile", "cursor", "discard", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "foreignobject", "hatch", "hatchpath", "mesh", "meshgradient", "meshpatch", "meshrow", "missing-glyph", "script", "set", "solidcolor", "unknown", "use"]), Qt = re(["math", "menclose", "merror", "mfenced", "mfrac", "mglyph", "mi", "mlabeledtr", "mmultiscripts", "mn", "mo", "mover", "mpadded", "mphantom", "mroot", "mrow", "ms", "mspace", "msqrt", "mstyle", "msub", "msup", "msubsup", "mtable", "mtd", "mtext", "mtr", "munder", "munderover", "mprescripts"]), ln = re(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), Qi = re(["#text"]), Ji = re(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "controls", "controlslist", "coords", "crossorigin", "datetime", "decoding", "default", "dir", "disabled", "disablepictureinpicture", "disableremoteplayback", "download", "draggable", "enctype", "enterkeyhint", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "inputmode", "integrity", "ismap", "kind", "label", "lang", "list", "loading", "loop", "low", "max", "maxlength", "media", "method", "min", "minlength", "multiple", "muted", "name", "nonce", "noshade", "novalidate", "nowrap", "open", "optimum", "pattern", "placeholder", "playsinline", "popover", "popovertarget", "popovertargetaction", "poster", "preload", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "title", "translate", "type", "usemap", "valign", "value", "width", "wrap", "xmlns", "slot"]), Jt = re(["accent-height", "accumulate", "additive", "alignment-baseline", "amplitude", "ascent", "attributename", "attributetype", "azimuth", "basefrequency", "baseline-shift", "begin", "bias", "by", "class", "clip", "clippathunits", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cx", "cy", "d", "dx", "dy", "diffuseconstant", "direction", "display", "divisor", "dur", "edgemode", "elevation", "end", "exponent", "fill", "fill-opacity", "fill-rule", "filter", "filterunits", "flood-color", "flood-opacity", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "fx", "fy", "g1", "g2", "glyph-name", "glyphref", "gradientunits", "gradienttransform", "height", "href", "id", "image-rendering", "in", "in2", "intercept", "k", "k1", "k2", "k3", "k4", "kerning", "keypoints", "keysplines", "keytimes", "lang", "lengthadjust", "letter-spacing", "kernelmatrix", "kernelunitlength", "lighting-color", "local", "marker-end", "marker-mid", "marker-start", "markerheight", "markerunits", "markerwidth", "maskcontentunits", "maskunits", "max", "mask", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "points", "preservealpha", "preserveaspectratio", "primitiveunits", "r", "rx", "ry", "radius", "refx", "refy", "repeatcount", "repeatdur", "restart", "result", "rotate", "scale", "seed", "shape-rendering", "slope", "specularconstant", "specularexponent", "spreadmethod", "startoffset", "stddeviation", "stitchtiles", "stop-color", "stop-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke", "stroke-width", "style", "surfacescale", "systemlanguage", "tabindex", "tablevalues", "targetx", "targety", "transform", "transform-origin", "text-anchor", "text-decoration", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "viewbox", "visibility", "version", "vert-adv-y", "vert-origin-x", "vert-origin-y", "width", "word-spacing", "wrap", "writing-mode", "xchannelselector", "ychannelselector", "x", "x1", "x2", "xmlns", "y", "y1", "y2", "z", "zoomandpan"]), es = re(["accent", "accentunder", "align", "bevelled", "close", "columnsalign", "columnlines", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lspace", "lquote", "mathbackground", "mathcolor", "mathsize", "mathvariant", "maxsize", "minsize", "movablelimits", "notation", "numalign", "open", "rowalign", "rowlines", "rowspacing", "rowspan", "rspace", "rquote", "scriptlevel", "scriptminsize", "scriptsizemultiplier", "selection", "separator", "separators", "stretchy", "subscriptshift", "supscriptshift", "symmetric", "voffset", "width", "xmlns"]), yt = re(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), an = de(/\{\{[\w\W]*|[\w\W]*\}\}/gm), hn = de(/<%[\w\W]*|[\w\W]*%>/gm), un = de(/\$\{[\w\W]*/gm), cn = de(/^data-[\-\w.\u00B7-\uFFFF]+$/), dn = de(/^aria-[\-\w]+$/), Es = de(
|
|
1560
1571
|
/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
|
|
1561
1572
|
// eslint-disable-line no-useless-escape
|
|
1562
|
-
),
|
|
1573
|
+
), pn = de(/^(?:\w+script|data):/i), fn = de(
|
|
1563
1574
|
/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
|
|
1564
1575
|
// eslint-disable-line no-control-regex
|
|
1565
|
-
),
|
|
1566
|
-
var
|
|
1576
|
+
), Ts = de(/^html$/i), gn = de(/^[a-z][.\w]*(-[.\w]+)+$/i);
|
|
1577
|
+
var ts = /* @__PURE__ */ Object.freeze({
|
|
1567
1578
|
__proto__: null,
|
|
1568
|
-
ARIA_ATTR:
|
|
1569
|
-
ATTR_WHITESPACE:
|
|
1570
|
-
CUSTOM_ELEMENT:
|
|
1571
|
-
DATA_ATTR:
|
|
1572
|
-
DOCTYPE_NAME:
|
|
1573
|
-
ERB_EXPR:
|
|
1574
|
-
IS_ALLOWED_URI:
|
|
1575
|
-
IS_SCRIPT_OR_DATA:
|
|
1576
|
-
MUSTACHE_EXPR:
|
|
1577
|
-
TMPLIT_EXPR:
|
|
1579
|
+
ARIA_ATTR: dn,
|
|
1580
|
+
ATTR_WHITESPACE: fn,
|
|
1581
|
+
CUSTOM_ELEMENT: gn,
|
|
1582
|
+
DATA_ATTR: cn,
|
|
1583
|
+
DOCTYPE_NAME: Ts,
|
|
1584
|
+
ERB_EXPR: hn,
|
|
1585
|
+
IS_ALLOWED_URI: Es,
|
|
1586
|
+
IS_SCRIPT_OR_DATA: pn,
|
|
1587
|
+
MUSTACHE_EXPR: an,
|
|
1588
|
+
TMPLIT_EXPR: un
|
|
1578
1589
|
});
|
|
1579
1590
|
const et = {
|
|
1580
1591
|
element: 1,
|
|
@@ -1583,9 +1594,9 @@ const et = {
|
|
|
1583
1594
|
progressingInstruction: 7,
|
|
1584
1595
|
comment: 8,
|
|
1585
1596
|
document: 9
|
|
1586
|
-
},
|
|
1597
|
+
}, mn = function() {
|
|
1587
1598
|
return typeof window > "u" ? null : window;
|
|
1588
|
-
},
|
|
1599
|
+
}, _n = function(e, t) {
|
|
1589
1600
|
if (typeof e != "object" || typeof e.createPolicy != "function")
|
|
1590
1601
|
return null;
|
|
1591
1602
|
let i = null;
|
|
@@ -1604,7 +1615,7 @@ const et = {
|
|
|
1604
1615
|
} catch {
|
|
1605
1616
|
return console.warn("TrustedTypes policy " + r + " could not be created."), null;
|
|
1606
1617
|
}
|
|
1607
|
-
},
|
|
1618
|
+
}, is = function() {
|
|
1608
1619
|
return {
|
|
1609
1620
|
afterSanitizeAttributes: [],
|
|
1610
1621
|
afterSanitizeElements: [],
|
|
@@ -1617,9 +1628,9 @@ const et = {
|
|
|
1617
1628
|
uponSanitizeShadowNode: []
|
|
1618
1629
|
};
|
|
1619
1630
|
};
|
|
1620
|
-
function
|
|
1621
|
-
let o = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] :
|
|
1622
|
-
const e = (w) =>
|
|
1631
|
+
function Rs() {
|
|
1632
|
+
let o = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : mn();
|
|
1633
|
+
const e = (w) => Rs(w);
|
|
1623
1634
|
if (e.version = "3.2.6", e.removed = [], !o || !o.document || o.document.nodeType !== et.document || !o.Element)
|
|
1624
1635
|
return e.isSupported = !1, e;
|
|
1625
1636
|
let {
|
|
@@ -1634,40 +1645,40 @@ function Ts() {
|
|
|
1634
1645
|
NamedNodeMap: h = o.NamedNodeMap || o.MozNamedAttrMap,
|
|
1635
1646
|
HTMLFormElement: p,
|
|
1636
1647
|
DOMParser: d,
|
|
1637
|
-
trustedTypes:
|
|
1638
|
-
} = o, v = u.prototype,
|
|
1648
|
+
trustedTypes: _
|
|
1649
|
+
} = o, v = u.prototype, L = Je(v, "cloneNode"), H = Je(v, "remove"), C = Je(v, "nextSibling"), D = Je(v, "childNodes"), S = Je(v, "parentNode");
|
|
1639
1650
|
if (typeof l == "function") {
|
|
1640
1651
|
const w = t.createElement("template");
|
|
1641
1652
|
w.content && w.content.ownerDocument && (t = w.content.ownerDocument);
|
|
1642
1653
|
}
|
|
1643
|
-
let
|
|
1654
|
+
let m, y = "";
|
|
1644
1655
|
const {
|
|
1645
1656
|
implementation: P,
|
|
1646
|
-
createNodeIterator:
|
|
1647
|
-
createDocumentFragment:
|
|
1648
|
-
getElementsByTagName:
|
|
1657
|
+
createNodeIterator: U,
|
|
1658
|
+
createDocumentFragment: pe,
|
|
1659
|
+
getElementsByTagName: me
|
|
1649
1660
|
} = t, {
|
|
1650
|
-
importNode:
|
|
1661
|
+
importNode: N
|
|
1651
1662
|
} = i;
|
|
1652
|
-
let
|
|
1653
|
-
e.isSupported = typeof
|
|
1663
|
+
let x = is();
|
|
1664
|
+
e.isSupported = typeof xs == "function" && typeof S == "function" && P && P.createHTMLDocument !== void 0;
|
|
1654
1665
|
const {
|
|
1655
|
-
MUSTACHE_EXPR:
|
|
1656
|
-
ERB_EXPR:
|
|
1657
|
-
TMPLIT_EXPR:
|
|
1658
|
-
DATA_ATTR:
|
|
1659
|
-
ARIA_ATTR:
|
|
1660
|
-
IS_SCRIPT_OR_DATA:
|
|
1661
|
-
ATTR_WHITESPACE:
|
|
1662
|
-
CUSTOM_ELEMENT:
|
|
1663
|
-
} =
|
|
1666
|
+
MUSTACHE_EXPR: E,
|
|
1667
|
+
ERB_EXPR: K,
|
|
1668
|
+
TMPLIT_EXPR: W,
|
|
1669
|
+
DATA_ATTR: oe,
|
|
1670
|
+
ARIA_ATTR: It,
|
|
1671
|
+
IS_SCRIPT_OR_DATA: Ht,
|
|
1672
|
+
ATTR_WHITESPACE: lt,
|
|
1673
|
+
CUSTOM_ELEMENT: Ot
|
|
1674
|
+
} = ts;
|
|
1664
1675
|
let {
|
|
1665
|
-
IS_ALLOWED_URI:
|
|
1666
|
-
} =
|
|
1667
|
-
const
|
|
1668
|
-
let
|
|
1669
|
-
const
|
|
1670
|
-
let G = Object.seal(
|
|
1676
|
+
IS_ALLOWED_URI: at
|
|
1677
|
+
} = ts, j = null;
|
|
1678
|
+
const bi = A({}, [...Zi, ...Kt, ...Zt, ...Qt, ...Qi]);
|
|
1679
|
+
let Z = null;
|
|
1680
|
+
const vi = A({}, [...Ji, ...Jt, ...es, ...yt]);
|
|
1681
|
+
let G = Object.seal(ks(null, {
|
|
1671
1682
|
tagNameCheck: {
|
|
1672
1683
|
writable: !0,
|
|
1673
1684
|
configurable: !1,
|
|
@@ -1686,53 +1697,53 @@ function Ts() {
|
|
|
1686
1697
|
enumerable: !0,
|
|
1687
1698
|
value: !1
|
|
1688
1699
|
}
|
|
1689
|
-
})), Ge = null,
|
|
1700
|
+
})), Ge = null, Pt = null, wi = !0, $t = !0, xi = !1, ki = !0, He = !1, ht = !0, De = !1, Bt = !1, Ut = !1, Oe = !1, ut = !1, ct = !1, Ei = !0, Ti = !1;
|
|
1690
1701
|
const Cs = "user-content-";
|
|
1691
|
-
let
|
|
1692
|
-
const
|
|
1693
|
-
let
|
|
1694
|
-
const
|
|
1695
|
-
let
|
|
1696
|
-
const
|
|
1697
|
-
let Be =
|
|
1698
|
-
const As =
|
|
1699
|
-
let
|
|
1700
|
-
const Ds =
|
|
1702
|
+
let Ft = !0, Ve = !1, Pe = {}, $e = null;
|
|
1703
|
+
const Ri = A({}, ["annotation-xml", "audio", "colgroup", "desc", "foreignobject", "head", "iframe", "math", "mi", "mn", "mo", "ms", "mtext", "noembed", "noframes", "noscript", "plaintext", "script", "style", "svg", "template", "thead", "title", "video", "xmp"]);
|
|
1704
|
+
let Si = null;
|
|
1705
|
+
const Ci = A({}, ["audio", "video", "img", "source", "image", "track"]);
|
|
1706
|
+
let Wt = null;
|
|
1707
|
+
const Ai = A({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), dt = "http://www.w3.org/1998/Math/MathML", pt = "http://www.w3.org/2000/svg", xe = "http://www.w3.org/1999/xhtml";
|
|
1708
|
+
let Be = xe, Gt = !1, Vt = null;
|
|
1709
|
+
const As = A({}, [dt, pt, xe], Xt);
|
|
1710
|
+
let ft = A({}, ["mi", "mo", "mn", "ms", "mtext"]), gt = A({}, ["annotation-xml"]);
|
|
1711
|
+
const Ds = A({}, ["title", "style", "font", "a", "script"]);
|
|
1701
1712
|
let qe = null;
|
|
1702
1713
|
const Ls = ["application/xhtml+xml", "text/html"], zs = "text/html";
|
|
1703
1714
|
let Y = null, Ue = null;
|
|
1704
|
-
const Ns = t.createElement("form"),
|
|
1715
|
+
const Ns = t.createElement("form"), Di = function(c) {
|
|
1705
1716
|
return c instanceof RegExp || c instanceof Function;
|
|
1706
|
-
},
|
|
1717
|
+
}, qt = function() {
|
|
1707
1718
|
let c = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
1708
1719
|
if (!(Ue && Ue === c)) {
|
|
1709
|
-
if ((!c || typeof c != "object") && (c = {}), c =
|
|
1710
|
-
Ls.indexOf(c.PARSER_MEDIA_TYPE) === -1 ? zs : c.PARSER_MEDIA_TYPE, Y = qe === "application/xhtml+xml" ?
|
|
1720
|
+
if ((!c || typeof c != "object") && (c = {}), c = Te(c), qe = // eslint-disable-next-line unicorn/prefer-includes
|
|
1721
|
+
Ls.indexOf(c.PARSER_MEDIA_TYPE) === -1 ? zs : c.PARSER_MEDIA_TYPE, Y = qe === "application/xhtml+xml" ? Xt : vt, j = fe(c, "ALLOWED_TAGS") ? A({}, c.ALLOWED_TAGS, Y) : bi, Z = fe(c, "ALLOWED_ATTR") ? A({}, c.ALLOWED_ATTR, Y) : vi, Vt = fe(c, "ALLOWED_NAMESPACES") ? A({}, c.ALLOWED_NAMESPACES, Xt) : As, Wt = fe(c, "ADD_URI_SAFE_ATTR") ? A(Te(Ai), c.ADD_URI_SAFE_ATTR, Y) : Ai, Si = fe(c, "ADD_DATA_URI_TAGS") ? A(Te(Ci), c.ADD_DATA_URI_TAGS, Y) : Ci, $e = fe(c, "FORBID_CONTENTS") ? A({}, c.FORBID_CONTENTS, Y) : Ri, Ge = fe(c, "FORBID_TAGS") ? A({}, c.FORBID_TAGS, Y) : Te({}), Pt = fe(c, "FORBID_ATTR") ? A({}, c.FORBID_ATTR, Y) : Te({}), Pe = fe(c, "USE_PROFILES") ? c.USE_PROFILES : !1, wi = c.ALLOW_ARIA_ATTR !== !1, $t = c.ALLOW_DATA_ATTR !== !1, xi = c.ALLOW_UNKNOWN_PROTOCOLS || !1, ki = c.ALLOW_SELF_CLOSE_IN_ATTR !== !1, He = c.SAFE_FOR_TEMPLATES || !1, ht = c.SAFE_FOR_XML !== !1, De = c.WHOLE_DOCUMENT || !1, Oe = c.RETURN_DOM || !1, ut = c.RETURN_DOM_FRAGMENT || !1, ct = c.RETURN_TRUSTED_TYPE || !1, Ut = c.FORCE_BODY || !1, Ei = c.SANITIZE_DOM !== !1, Ti = c.SANITIZE_NAMED_PROPS || !1, Ft = c.KEEP_CONTENT !== !1, Ve = c.IN_PLACE || !1, at = c.ALLOWED_URI_REGEXP || Es, Be = c.NAMESPACE || xe, ft = c.MATHML_TEXT_INTEGRATION_POINTS || ft, gt = c.HTML_INTEGRATION_POINTS || gt, G = c.CUSTOM_ELEMENT_HANDLING || {}, c.CUSTOM_ELEMENT_HANDLING && Di(c.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (G.tagNameCheck = c.CUSTOM_ELEMENT_HANDLING.tagNameCheck), c.CUSTOM_ELEMENT_HANDLING && Di(c.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (G.attributeNameCheck = c.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), c.CUSTOM_ELEMENT_HANDLING && typeof c.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (G.allowCustomizedBuiltInElements = c.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), He && ($t = !1), ut && (Oe = !0), Pe && (j = A({}, Qi), Z = [], Pe.html === !0 && (A(j, Zi), A(Z, Ji)), Pe.svg === !0 && (A(j, Kt), A(Z, Jt), A(Z, yt)), Pe.svgFilters === !0 && (A(j, Zt), A(Z, Jt), A(Z, yt)), Pe.mathMl === !0 && (A(j, Qt), A(Z, es), A(Z, yt))), c.ADD_TAGS && (j === bi && (j = Te(j)), A(j, c.ADD_TAGS, Y)), c.ADD_ATTR && (Z === vi && (Z = Te(Z)), A(Z, c.ADD_ATTR, Y)), c.ADD_URI_SAFE_ATTR && A(Wt, c.ADD_URI_SAFE_ATTR, Y), c.FORBID_CONTENTS && ($e === Ri && ($e = Te($e)), A($e, c.FORBID_CONTENTS, Y)), Ft && (j["#text"] = !0), De && A(j, ["html", "head", "body"]), j.table && (A(j, ["tbody"]), delete Ge.tbody), c.TRUSTED_TYPES_POLICY) {
|
|
1711
1722
|
if (typeof c.TRUSTED_TYPES_POLICY.createHTML != "function")
|
|
1712
1723
|
throw Qe('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
|
|
1713
1724
|
if (typeof c.TRUSTED_TYPES_POLICY.createScriptURL != "function")
|
|
1714
1725
|
throw Qe('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
|
|
1715
|
-
|
|
1726
|
+
m = c.TRUSTED_TYPES_POLICY, y = m.createHTML("");
|
|
1716
1727
|
} else
|
|
1717
|
-
|
|
1728
|
+
m === void 0 && (m = _n(_, s)), m !== null && typeof y == "string" && (y = m.createHTML(""));
|
|
1718
1729
|
re && re(c), Ue = c;
|
|
1719
1730
|
}
|
|
1720
|
-
},
|
|
1731
|
+
}, Li = A({}, [...Kt, ...Zt, ...on]), zi = A({}, [...Qt, ...ln]), Ms = function(c) {
|
|
1721
1732
|
let g = S(c);
|
|
1722
1733
|
(!g || !g.tagName) && (g = {
|
|
1723
1734
|
namespaceURI: Be,
|
|
1724
1735
|
tagName: "template"
|
|
1725
1736
|
});
|
|
1726
|
-
const b =
|
|
1727
|
-
return
|
|
1728
|
-
},
|
|
1737
|
+
const b = vt(c.tagName), F = vt(g.tagName);
|
|
1738
|
+
return Vt[c.namespaceURI] ? c.namespaceURI === pt ? g.namespaceURI === xe ? b === "svg" : g.namespaceURI === dt ? b === "svg" && (F === "annotation-xml" || ft[F]) : !!Li[b] : c.namespaceURI === dt ? g.namespaceURI === xe ? b === "math" : g.namespaceURI === pt ? b === "math" && gt[F] : !!zi[b] : c.namespaceURI === xe ? g.namespaceURI === pt && !gt[F] || g.namespaceURI === dt && !ft[F] ? !1 : !zi[b] && (Ds[b] || !Li[b]) : !!(qe === "application/xhtml+xml" && Vt[c.namespaceURI]) : !1;
|
|
1739
|
+
}, _e = function(c) {
|
|
1729
1740
|
Ke(e.removed, {
|
|
1730
1741
|
element: c
|
|
1731
1742
|
});
|
|
1732
1743
|
try {
|
|
1733
1744
|
S(c).removeChild(c);
|
|
1734
1745
|
} catch {
|
|
1735
|
-
|
|
1746
|
+
H(c);
|
|
1736
1747
|
}
|
|
1737
1748
|
}, Fe = function(c, g) {
|
|
1738
1749
|
try {
|
|
@@ -1747,9 +1758,9 @@ function Ts() {
|
|
|
1747
1758
|
});
|
|
1748
1759
|
}
|
|
1749
1760
|
if (g.removeAttribute(c), c === "is")
|
|
1750
|
-
if (Oe ||
|
|
1761
|
+
if (Oe || ut)
|
|
1751
1762
|
try {
|
|
1752
|
-
|
|
1763
|
+
_e(g);
|
|
1753
1764
|
} catch {
|
|
1754
1765
|
}
|
|
1755
1766
|
else
|
|
@@ -1757,96 +1768,96 @@ function Ts() {
|
|
|
1757
1768
|
g.setAttribute(c, "");
|
|
1758
1769
|
} catch {
|
|
1759
1770
|
}
|
|
1760
|
-
},
|
|
1771
|
+
}, Ni = function(c) {
|
|
1761
1772
|
let g = null, b = null;
|
|
1762
|
-
if (
|
|
1773
|
+
if (Ut)
|
|
1763
1774
|
c = "<remove></remove>" + c;
|
|
1764
1775
|
else {
|
|
1765
|
-
const V =
|
|
1776
|
+
const V = Ki(c, /^[\r\n\t ]+/);
|
|
1766
1777
|
b = V && V[0];
|
|
1767
1778
|
}
|
|
1768
|
-
qe === "application/xhtml+xml" && Be ===
|
|
1769
|
-
const
|
|
1770
|
-
if (Be ===
|
|
1779
|
+
qe === "application/xhtml+xml" && Be === xe && (c = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + c + "</body></html>");
|
|
1780
|
+
const F = m ? m.createHTML(c) : c;
|
|
1781
|
+
if (Be === xe)
|
|
1771
1782
|
try {
|
|
1772
|
-
g = new d().parseFromString(
|
|
1783
|
+
g = new d().parseFromString(F, qe);
|
|
1773
1784
|
} catch {
|
|
1774
1785
|
}
|
|
1775
1786
|
if (!g || !g.documentElement) {
|
|
1776
1787
|
g = P.createDocument(Be, "template", null);
|
|
1777
1788
|
try {
|
|
1778
|
-
g.documentElement.innerHTML =
|
|
1789
|
+
g.documentElement.innerHTML = Gt ? y : F;
|
|
1779
1790
|
} catch {
|
|
1780
1791
|
}
|
|
1781
1792
|
}
|
|
1782
1793
|
const J = g.body || g.documentElement;
|
|
1783
|
-
return c && b && J.insertBefore(t.createTextNode(b), J.childNodes[0] || null), Be ===
|
|
1784
|
-
},
|
|
1785
|
-
return
|
|
1794
|
+
return c && b && J.insertBefore(t.createTextNode(b), J.childNodes[0] || null), Be === xe ? me.call(g, De ? "html" : "body")[0] : De ? g.documentElement : J;
|
|
1795
|
+
}, Mi = function(c) {
|
|
1796
|
+
return U.call(
|
|
1786
1797
|
c.ownerDocument || c,
|
|
1787
1798
|
c,
|
|
1788
1799
|
// eslint-disable-next-line no-bitwise
|
|
1789
1800
|
a.SHOW_ELEMENT | a.SHOW_COMMENT | a.SHOW_TEXT | a.SHOW_PROCESSING_INSTRUCTION | a.SHOW_CDATA_SECTION,
|
|
1790
1801
|
null
|
|
1791
1802
|
);
|
|
1792
|
-
},
|
|
1803
|
+
}, jt = function(c) {
|
|
1793
1804
|
return c instanceof p && (typeof c.nodeName != "string" || typeof c.textContent != "string" || typeof c.removeChild != "function" || !(c.attributes instanceof h) || typeof c.removeAttribute != "function" || typeof c.setAttribute != "function" || typeof c.namespaceURI != "string" || typeof c.insertBefore != "function" || typeof c.hasChildNodes != "function");
|
|
1794
|
-
},
|
|
1805
|
+
}, Ii = function(c) {
|
|
1795
1806
|
return typeof n == "function" && c instanceof n;
|
|
1796
1807
|
};
|
|
1797
|
-
function
|
|
1798
|
-
|
|
1808
|
+
function ke(w, c, g) {
|
|
1809
|
+
_t(w, (b) => {
|
|
1799
1810
|
b.call(e, c, g, Ue);
|
|
1800
1811
|
});
|
|
1801
1812
|
}
|
|
1802
|
-
const
|
|
1813
|
+
const Hi = function(c) {
|
|
1803
1814
|
let g = null;
|
|
1804
|
-
if (
|
|
1805
|
-
return
|
|
1815
|
+
if (ke(x.beforeSanitizeElements, c, null), jt(c))
|
|
1816
|
+
return _e(c), !0;
|
|
1806
1817
|
const b = Y(c.nodeName);
|
|
1807
|
-
if (
|
|
1818
|
+
if (ke(x.uponSanitizeElement, c, {
|
|
1808
1819
|
tagName: b,
|
|
1809
1820
|
allowedTags: j
|
|
1810
|
-
}),
|
|
1811
|
-
return
|
|
1821
|
+
}), ht && c.hasChildNodes() && !Ii(c.firstElementChild) && te(/<[/\w!]/g, c.innerHTML) && te(/<[/\w!]/g, c.textContent) || c.nodeType === et.progressingInstruction || ht && c.nodeType === et.comment && te(/<[/\w]/g, c.data))
|
|
1822
|
+
return _e(c), !0;
|
|
1812
1823
|
if (!j[b] || Ge[b]) {
|
|
1813
|
-
if (!Ge[b] &&
|
|
1824
|
+
if (!Ge[b] && Pi(b) && (G.tagNameCheck instanceof RegExp && te(G.tagNameCheck, b) || G.tagNameCheck instanceof Function && G.tagNameCheck(b)))
|
|
1814
1825
|
return !1;
|
|
1815
|
-
if (
|
|
1816
|
-
const
|
|
1817
|
-
if (J &&
|
|
1826
|
+
if (Ft && !$e[b]) {
|
|
1827
|
+
const F = S(c) || c.parentNode, J = D(c) || c.childNodes;
|
|
1828
|
+
if (J && F) {
|
|
1818
1829
|
const V = J.length;
|
|
1819
|
-
for (let
|
|
1820
|
-
const
|
|
1821
|
-
|
|
1830
|
+
for (let le = V - 1; le >= 0; --le) {
|
|
1831
|
+
const Ee = L(J[le], !0);
|
|
1832
|
+
Ee.__removalCount = (c.__removalCount || 0) + 1, F.insertBefore(Ee, C(c));
|
|
1822
1833
|
}
|
|
1823
1834
|
}
|
|
1824
1835
|
}
|
|
1825
|
-
return
|
|
1836
|
+
return _e(c), !0;
|
|
1826
1837
|
}
|
|
1827
|
-
return c instanceof u && !Ms(c) || (b === "noscript" || b === "noembed" || b === "noframes") && te(/<\/no(script|embed|frames)/i, c.innerHTML) ? (
|
|
1828
|
-
g = Ze(g,
|
|
1838
|
+
return c instanceof u && !Ms(c) || (b === "noscript" || b === "noembed" || b === "noframes") && te(/<\/no(script|embed|frames)/i, c.innerHTML) ? (_e(c), !0) : (He && c.nodeType === et.text && (g = c.textContent, _t([E, K, W], (F) => {
|
|
1839
|
+
g = Ze(g, F, " ");
|
|
1829
1840
|
}), c.textContent !== g && (Ke(e.removed, {
|
|
1830
1841
|
element: c.cloneNode()
|
|
1831
|
-
}), c.textContent = g)),
|
|
1832
|
-
},
|
|
1833
|
-
if (
|
|
1842
|
+
}), c.textContent = g)), ke(x.afterSanitizeElements, c, null), !1);
|
|
1843
|
+
}, Oi = function(c, g, b) {
|
|
1844
|
+
if (Ei && (g === "id" || g === "name") && (b in t || b in Ns))
|
|
1834
1845
|
return !1;
|
|
1835
|
-
if (!(
|
|
1836
|
-
if (!(
|
|
1837
|
-
if (!
|
|
1846
|
+
if (!($t && !Pt[g] && te(oe, g))) {
|
|
1847
|
+
if (!(wi && te(It, g))) {
|
|
1848
|
+
if (!Z[g] || Pt[g]) {
|
|
1838
1849
|
if (
|
|
1839
1850
|
// First condition does a very basic check if a) it's basically a valid custom element tagname AND
|
|
1840
1851
|
// b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
|
1841
1852
|
// and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
|
|
1842
|
-
!(
|
|
1853
|
+
!(Pi(c) && (G.tagNameCheck instanceof RegExp && te(G.tagNameCheck, c) || G.tagNameCheck instanceof Function && G.tagNameCheck(c)) && (G.attributeNameCheck instanceof RegExp && te(G.attributeNameCheck, g) || G.attributeNameCheck instanceof Function && G.attributeNameCheck(g)) || // Alternative, second condition checks if it's an `is`-attribute, AND
|
|
1843
1854
|
// the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
|
1844
1855
|
g === "is" && G.allowCustomizedBuiltInElements && (G.tagNameCheck instanceof RegExp && te(G.tagNameCheck, b) || G.tagNameCheck instanceof Function && G.tagNameCheck(b)))
|
|
1845
1856
|
) return !1;
|
|
1846
|
-
} else if (!
|
|
1847
|
-
if (!te(
|
|
1848
|
-
if (!((g === "src" || g === "xlink:href" || g === "href") && c !== "script" &&
|
|
1849
|
-
if (!(
|
|
1857
|
+
} else if (!Wt[g]) {
|
|
1858
|
+
if (!te(at, Ze(b, lt, ""))) {
|
|
1859
|
+
if (!((g === "src" || g === "xlink:href" || g === "href") && c !== "script" && tn(b, "data:") === 0 && Si[c])) {
|
|
1860
|
+
if (!(xi && !te(Ht, Ze(b, lt, "")))) {
|
|
1850
1861
|
if (b)
|
|
1851
1862
|
return !1;
|
|
1852
1863
|
}
|
|
@@ -1856,31 +1867,31 @@ function Ts() {
|
|
|
1856
1867
|
}
|
|
1857
1868
|
}
|
|
1858
1869
|
return !0;
|
|
1859
|
-
}, Oi = function(c) {
|
|
1860
|
-
return c !== "annotation-xml" && Xi(c, Ss);
|
|
1861
1870
|
}, Pi = function(c) {
|
|
1862
|
-
|
|
1871
|
+
return c !== "annotation-xml" && Ki(c, Ot);
|
|
1872
|
+
}, $i = function(c) {
|
|
1873
|
+
ke(x.beforeSanitizeAttributes, c, null);
|
|
1863
1874
|
const {
|
|
1864
1875
|
attributes: g
|
|
1865
1876
|
} = c;
|
|
1866
|
-
if (!g ||
|
|
1877
|
+
if (!g || jt(c))
|
|
1867
1878
|
return;
|
|
1868
1879
|
const b = {
|
|
1869
1880
|
attrName: "",
|
|
1870
1881
|
attrValue: "",
|
|
1871
1882
|
keepAttr: !0,
|
|
1872
|
-
allowedAttributes:
|
|
1883
|
+
allowedAttributes: Z,
|
|
1873
1884
|
forceKeepAttr: void 0
|
|
1874
1885
|
};
|
|
1875
|
-
let
|
|
1876
|
-
for (;
|
|
1877
|
-
const J = g[
|
|
1886
|
+
let F = g.length;
|
|
1887
|
+
for (; F--; ) {
|
|
1888
|
+
const J = g[F], {
|
|
1878
1889
|
name: V,
|
|
1879
|
-
namespaceURI:
|
|
1880
|
-
value:
|
|
1881
|
-
} = J, je = Y(V),
|
|
1882
|
-
let ee = V === "value" ?
|
|
1883
|
-
if (b.attrName = je, b.attrValue = ee, b.keepAttr = !0, b.forceKeepAttr = void 0,
|
|
1890
|
+
namespaceURI: le,
|
|
1891
|
+
value: Ee
|
|
1892
|
+
} = J, je = Y(V), Yt = Ee;
|
|
1893
|
+
let ee = V === "value" ? Yt : sn(Yt);
|
|
1894
|
+
if (b.attrName = je, b.attrValue = ee, b.keepAttr = !0, b.forceKeepAttr = void 0, ke(x.uponSanitizeAttribute, c, b), ee = b.attrValue, Ti && (je === "id" || je === "name") && (Fe(V, c), ee = Cs + ee), ht && te(/((--!?|])>)|<\/(style|title)/i, ee)) {
|
|
1884
1895
|
Fe(V, c);
|
|
1885
1896
|
continue;
|
|
1886
1897
|
}
|
|
@@ -1890,47 +1901,47 @@ function Ts() {
|
|
|
1890
1901
|
Fe(V, c);
|
|
1891
1902
|
continue;
|
|
1892
1903
|
}
|
|
1893
|
-
if (!
|
|
1904
|
+
if (!ki && te(/\/>/i, ee)) {
|
|
1894
1905
|
Fe(V, c);
|
|
1895
1906
|
continue;
|
|
1896
1907
|
}
|
|
1897
|
-
He &&
|
|
1898
|
-
ee = Ze(ee,
|
|
1908
|
+
He && _t([E, K, W], (Ui) => {
|
|
1909
|
+
ee = Ze(ee, Ui, " ");
|
|
1899
1910
|
});
|
|
1900
|
-
const
|
|
1901
|
-
if (!
|
|
1911
|
+
const Bi = Y(c.nodeName);
|
|
1912
|
+
if (!Oi(Bi, je, ee)) {
|
|
1902
1913
|
Fe(V, c);
|
|
1903
1914
|
continue;
|
|
1904
1915
|
}
|
|
1905
|
-
if (
|
|
1906
|
-
switch (
|
|
1916
|
+
if (m && typeof _ == "object" && typeof _.getAttributeType == "function" && !le)
|
|
1917
|
+
switch (_.getAttributeType(Bi, je)) {
|
|
1907
1918
|
case "TrustedHTML": {
|
|
1908
|
-
ee =
|
|
1919
|
+
ee = m.createHTML(ee);
|
|
1909
1920
|
break;
|
|
1910
1921
|
}
|
|
1911
1922
|
case "TrustedScriptURL": {
|
|
1912
|
-
ee =
|
|
1923
|
+
ee = m.createScriptURL(ee);
|
|
1913
1924
|
break;
|
|
1914
1925
|
}
|
|
1915
1926
|
}
|
|
1916
|
-
if (ee !==
|
|
1927
|
+
if (ee !== Yt)
|
|
1917
1928
|
try {
|
|
1918
|
-
|
|
1929
|
+
le ? c.setAttributeNS(le, V, ee) : c.setAttribute(V, ee), jt(c) ? _e(c) : Xi(e.removed);
|
|
1919
1930
|
} catch {
|
|
1920
1931
|
Fe(V, c);
|
|
1921
1932
|
}
|
|
1922
1933
|
}
|
|
1923
|
-
|
|
1934
|
+
ke(x.afterSanitizeAttributes, c, null);
|
|
1924
1935
|
}, Is = function w(c) {
|
|
1925
1936
|
let g = null;
|
|
1926
|
-
const b =
|
|
1927
|
-
for (
|
|
1928
|
-
|
|
1929
|
-
|
|
1937
|
+
const b = Mi(c);
|
|
1938
|
+
for (ke(x.beforeSanitizeShadowDOM, c, null); g = b.nextNode(); )
|
|
1939
|
+
ke(x.uponSanitizeShadowNode, g, null), Hi(g), $i(g), g.content instanceof r && w(g.content);
|
|
1940
|
+
ke(x.afterSanitizeShadowDOM, c, null);
|
|
1930
1941
|
};
|
|
1931
1942
|
return e.sanitize = function(w) {
|
|
1932
|
-
let c = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, g = null, b = null,
|
|
1933
|
-
if (
|
|
1943
|
+
let c = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, g = null, b = null, F = null, J = null;
|
|
1944
|
+
if (Gt = !w, Gt && (w = "<!-->"), typeof w != "string" && !Ii(w))
|
|
1934
1945
|
if (typeof w.toString == "function") {
|
|
1935
1946
|
if (w = w.toString(), typeof w != "string")
|
|
1936
1947
|
throw Qe("dirty is not a string, aborting");
|
|
@@ -1938,65 +1949,65 @@ function Ts() {
|
|
|
1938
1949
|
throw Qe("toString is not a function");
|
|
1939
1950
|
if (!e.isSupported)
|
|
1940
1951
|
return w;
|
|
1941
|
-
if (
|
|
1952
|
+
if (Bt || qt(c), e.removed = [], typeof w == "string" && (Ve = !1), Ve) {
|
|
1942
1953
|
if (w.nodeName) {
|
|
1943
|
-
const
|
|
1944
|
-
if (!j[
|
|
1954
|
+
const Ee = Y(w.nodeName);
|
|
1955
|
+
if (!j[Ee] || Ge[Ee])
|
|
1945
1956
|
throw Qe("root node is forbidden and cannot be sanitized in-place");
|
|
1946
1957
|
}
|
|
1947
1958
|
} else if (w instanceof n)
|
|
1948
|
-
g =
|
|
1959
|
+
g = Ni("<!---->"), b = g.ownerDocument.importNode(w, !0), b.nodeType === et.element && b.nodeName === "BODY" || b.nodeName === "HTML" ? g = b : g.appendChild(b);
|
|
1949
1960
|
else {
|
|
1950
|
-
if (!Oe && !He && !
|
|
1961
|
+
if (!Oe && !He && !De && // eslint-disable-next-line unicorn/prefer-includes
|
|
1951
1962
|
w.indexOf("<") === -1)
|
|
1952
|
-
return
|
|
1953
|
-
if (g =
|
|
1954
|
-
return Oe ? null :
|
|
1963
|
+
return m && ct ? m.createHTML(w) : w;
|
|
1964
|
+
if (g = Ni(w), !g)
|
|
1965
|
+
return Oe ? null : ct ? y : "";
|
|
1955
1966
|
}
|
|
1956
|
-
g &&
|
|
1957
|
-
const V =
|
|
1958
|
-
for (;
|
|
1959
|
-
|
|
1967
|
+
g && Ut && _e(g.firstChild);
|
|
1968
|
+
const V = Mi(Ve ? w : g);
|
|
1969
|
+
for (; F = V.nextNode(); )
|
|
1970
|
+
Hi(F), $i(F), F.content instanceof r && Is(F.content);
|
|
1960
1971
|
if (Ve)
|
|
1961
1972
|
return w;
|
|
1962
1973
|
if (Oe) {
|
|
1963
|
-
if (
|
|
1964
|
-
for (J =
|
|
1974
|
+
if (ut)
|
|
1975
|
+
for (J = pe.call(g.ownerDocument); g.firstChild; )
|
|
1965
1976
|
J.appendChild(g.firstChild);
|
|
1966
1977
|
else
|
|
1967
1978
|
J = g;
|
|
1968
|
-
return (
|
|
1979
|
+
return (Z.shadowroot || Z.shadowrootmode) && (J = N.call(i, J, !0)), J;
|
|
1969
1980
|
}
|
|
1970
|
-
let
|
|
1971
|
-
return
|
|
1972
|
-
` +
|
|
1973
|
-
|
|
1974
|
-
}),
|
|
1981
|
+
let le = De ? g.outerHTML : g.innerHTML;
|
|
1982
|
+
return De && j["!doctype"] && g.ownerDocument && g.ownerDocument.doctype && g.ownerDocument.doctype.name && te(Ts, g.ownerDocument.doctype.name) && (le = "<!DOCTYPE " + g.ownerDocument.doctype.name + `>
|
|
1983
|
+
` + le), He && _t([E, K, W], (Ee) => {
|
|
1984
|
+
le = Ze(le, Ee, " ");
|
|
1985
|
+
}), m && ct ? m.createHTML(le) : le;
|
|
1975
1986
|
}, e.setConfig = function() {
|
|
1976
1987
|
let w = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
1977
|
-
|
|
1988
|
+
qt(w), Bt = !0;
|
|
1978
1989
|
}, e.clearConfig = function() {
|
|
1979
|
-
Ue = null,
|
|
1990
|
+
Ue = null, Bt = !1;
|
|
1980
1991
|
}, e.isValidAttribute = function(w, c, g) {
|
|
1981
|
-
Ue ||
|
|
1982
|
-
const b = Y(w),
|
|
1983
|
-
return
|
|
1992
|
+
Ue || qt({});
|
|
1993
|
+
const b = Y(w), F = Y(c);
|
|
1994
|
+
return Oi(b, F, g);
|
|
1984
1995
|
}, e.addHook = function(w, c) {
|
|
1985
|
-
typeof c == "function" && Ke(
|
|
1996
|
+
typeof c == "function" && Ke(x[w], c);
|
|
1986
1997
|
}, e.removeHook = function(w, c) {
|
|
1987
1998
|
if (c !== void 0) {
|
|
1988
|
-
const g =
|
|
1989
|
-
return g === -1 ? void 0 :
|
|
1999
|
+
const g = Jr(x[w], c);
|
|
2000
|
+
return g === -1 ? void 0 : en(x[w], g, 1)[0];
|
|
1990
2001
|
}
|
|
1991
|
-
return
|
|
2002
|
+
return Xi(x[w]);
|
|
1992
2003
|
}, e.removeHooks = function(w) {
|
|
1993
|
-
|
|
2004
|
+
x[w] = [];
|
|
1994
2005
|
}, e.removeAllHooks = function() {
|
|
1995
|
-
|
|
2006
|
+
x = is();
|
|
1996
2007
|
}, e;
|
|
1997
2008
|
}
|
|
1998
|
-
var
|
|
1999
|
-
const
|
|
2009
|
+
var yn = Rs();
|
|
2010
|
+
const bn = ["innerHTML"], vn = "Markdown", wn = /* @__PURE__ */ we({
|
|
2000
2011
|
inheritAttrs: !1,
|
|
2001
2012
|
__name: "Markdown",
|
|
2002
2013
|
props: {
|
|
@@ -2007,22 +2018,22 @@ const yn = ["innerHTML"], bn = "Markdown", vn = /* @__PURE__ */ ye({
|
|
|
2007
2018
|
},
|
|
2008
2019
|
emits: ["update:markdownText", "changeMode"],
|
|
2009
2020
|
setup(o, { emit: e }) {
|
|
2010
|
-
const t = o, i = e, s =
|
|
2011
|
-
|
|
2021
|
+
const t = o, i = e, s = os([{ comp: us, event: a, tooltip: "Edit Markdown" }]);
|
|
2022
|
+
M.setOptions({
|
|
2012
2023
|
gfm: !0,
|
|
2013
2024
|
breaks: !0
|
|
2014
2025
|
});
|
|
2015
|
-
const r =
|
|
2016
|
-
|
|
2026
|
+
const r = B(t.markdownText ?? "");
|
|
2027
|
+
ce(() => t.markdownText, (h) => {
|
|
2017
2028
|
h !== void 0 && h !== r.value && (r.value = h);
|
|
2018
2029
|
});
|
|
2019
|
-
const l =
|
|
2020
|
-
|
|
2030
|
+
const l = B(t.mode ? t.mode === "edit" : !1);
|
|
2031
|
+
ce(() => t.mode, (h) => {
|
|
2021
2032
|
h && (l.value = h === "edit");
|
|
2022
2033
|
});
|
|
2023
|
-
const n =
|
|
2024
|
-
const h = t.inputFormat === "html" ? r.value ?? "" :
|
|
2025
|
-
return t.sanitize === !1 ? h :
|
|
2034
|
+
const n = Ce(() => {
|
|
2035
|
+
const h = t.inputFormat === "html" ? r.value ?? "" : M.parse(r.value ?? "");
|
|
2036
|
+
return t.sanitize === !1 ? h : yn.sanitize(h);
|
|
2026
2037
|
});
|
|
2027
2038
|
function u() {
|
|
2028
2039
|
i("update:markdownText", r.value);
|
|
@@ -2030,13 +2041,13 @@ const yn = ["innerHTML"], bn = "Markdown", vn = /* @__PURE__ */ ye({
|
|
|
2030
2041
|
function a() {
|
|
2031
2042
|
l.value = !l.value, i("changeMode", l.value ? "edit" : "preview");
|
|
2032
2043
|
}
|
|
2033
|
-
return (h, p) => (
|
|
2034
|
-
|
|
2035
|
-
widgetName:
|
|
2044
|
+
return (h, p) => (R(), $(ze, null, [
|
|
2045
|
+
wt(h.$slots, "default", {
|
|
2046
|
+
widgetName: vn,
|
|
2036
2047
|
childIcons: s.value
|
|
2037
2048
|
}, void 0, !0),
|
|
2038
|
-
|
|
2039
|
-
l.value ?
|
|
2049
|
+
z("div", li({ class: "markdown-widget-wrap" }, h.$attrs), [
|
|
2050
|
+
l.value ? Le((R(), $("textarea", {
|
|
2040
2051
|
key: 0,
|
|
2041
2052
|
"onUpdate:modelValue": p[0] || (p[0] = (d) => r.value = d),
|
|
2042
2053
|
onInput: u,
|
|
@@ -2044,16 +2055,16 @@ const yn = ["innerHTML"], bn = "Markdown", vn = /* @__PURE__ */ ye({
|
|
|
2044
2055
|
placeholder: "Write markdown here…"
|
|
2045
2056
|
}, null, 544)), [
|
|
2046
2057
|
[Fs, r.value]
|
|
2047
|
-
]) : (
|
|
2058
|
+
]) : (R(), $("div", {
|
|
2048
2059
|
key: 1,
|
|
2049
2060
|
class: "markdown-output",
|
|
2050
2061
|
innerHTML: n.value
|
|
2051
|
-
}, null, 8,
|
|
2062
|
+
}, null, 8, bn))
|
|
2052
2063
|
], 16)
|
|
2053
2064
|
], 64));
|
|
2054
2065
|
}
|
|
2055
|
-
}),
|
|
2056
|
-
function
|
|
2066
|
+
}), ro = /* @__PURE__ */ Me(wn, [["__scopeId", "data-v-b2d32c29"]]);
|
|
2067
|
+
function xn(o, e, t, i, s) {
|
|
2057
2068
|
let r = (...l) => (console.warn("gridstack.js: Function `" + t + "` is deprecated in " + s + " and has been replaced with `" + i + "`. It will be **removed** in a future release"), e.apply(o, l));
|
|
2058
2069
|
return r.prototype = e.prototype, r;
|
|
2059
2070
|
}
|
|
@@ -2354,7 +2365,7 @@ class f {
|
|
|
2354
2365
|
), (i || e.target).dispatchEvent(s);
|
|
2355
2366
|
}
|
|
2356
2367
|
}
|
|
2357
|
-
class
|
|
2368
|
+
class be {
|
|
2358
2369
|
constructor(e = {}) {
|
|
2359
2370
|
this.addedNodes = [], this.removedNodes = [], this.column = e.column || 12, this.maxRow = e.maxRow, this._float = e.float, this.nodes = e.nodes || [], this.onChange = e.onChange;
|
|
2360
2371
|
}
|
|
@@ -2520,7 +2531,7 @@ class me {
|
|
|
2520
2531
|
* @param resizing if out of bound, resize down or move into the grid to fit ?
|
|
2521
2532
|
*/
|
|
2522
2533
|
prepareNode(e, t) {
|
|
2523
|
-
e._id = e._id ??
|
|
2534
|
+
e._id = e._id ?? be._idSeq++, (e.x === void 0 || e.y === void 0 || e.x === null || e.y === null) && (e.autoPosition = !0);
|
|
2524
2535
|
let i = { x: 0, y: 0, w: 1, h: 1 };
|
|
2525
2536
|
return f.defaults(e, i), e.autoPosition || delete e.autoPosition, e.noResize || delete e.noResize, e.noMove || delete e.noMove, f.sanitizeMinMax(e), typeof e.x == "string" && (e.x = Number(e.x)), typeof e.y == "string" && (e.y = Number(e.y)), typeof e.w == "string" && (e.w = Number(e.w)), typeof e.h == "string" && (e.h = Number(e.h)), isNaN(e.x) && (e.x = i.x, e.autoPosition = !0), isNaN(e.y) && (e.y = i.y, e.autoPosition = !0), isNaN(e.w) && (e.w = i.w), isNaN(e.h) && (e.h = i.h), this.nodeBoundFix(e, t), e;
|
|
2526
2537
|
}
|
|
@@ -2602,7 +2613,7 @@ class me {
|
|
|
2602
2613
|
return !1;
|
|
2603
2614
|
if (t.pack = !0, !this.maxRow)
|
|
2604
2615
|
return this.moveNode(e, t);
|
|
2605
|
-
let i, s = new
|
|
2616
|
+
let i, s = new be({
|
|
2606
2617
|
column: this.column,
|
|
2607
2618
|
float: this.float,
|
|
2608
2619
|
nodes: this.nodes.map((l) => l._id === e._id ? (i = { ...l }, i) : { ...l })
|
|
@@ -2624,7 +2635,7 @@ class me {
|
|
|
2624
2635
|
willItFit(e) {
|
|
2625
2636
|
if (delete e._willFitPos, !this.maxRow)
|
|
2626
2637
|
return !0;
|
|
2627
|
-
let t = new
|
|
2638
|
+
let t = new be({
|
|
2628
2639
|
column: this.column,
|
|
2629
2640
|
float: this.float,
|
|
2630
2641
|
nodes: this.nodes.map((s) => ({ ...s }))
|
|
@@ -2650,8 +2661,8 @@ class me {
|
|
|
2650
2661
|
if (n.length) {
|
|
2651
2662
|
let p = e._moving && !t.nested, d = p ? this.directionCollideCoverage(e, t, n) : n[0];
|
|
2652
2663
|
if (p && d && ((h = (a = e.grid) == null ? void 0 : a.opts) != null && h.subGridDynamic) && !e.grid._isTemp) {
|
|
2653
|
-
let
|
|
2654
|
-
|
|
2664
|
+
let _ = f.areaIntercept(t.rect, d._rect), v = f.area(t.rect), L = f.area(d._rect);
|
|
2665
|
+
_ / (v < L ? v : L) > 0.8 && (d.grid.makeSubGrid(d.el, void 0, e), d = void 0);
|
|
2655
2666
|
}
|
|
2656
2667
|
d ? u = !this._fixCollisions(e, r, d, t) : (u = !1, i && delete t.pack);
|
|
2657
2668
|
}
|
|
@@ -2725,17 +2736,17 @@ class me {
|
|
|
2725
2736
|
const a = this._layouts[t] || [];
|
|
2726
2737
|
let h = this._layouts.length - 1;
|
|
2727
2738
|
!a.length && e !== h && ((u = this._layouts[h]) != null && u.length) && (e = h, this._layouts[h].forEach((p) => {
|
|
2728
|
-
let d = i.find((
|
|
2739
|
+
let d = i.find((_) => _._id === p._id);
|
|
2729
2740
|
d && (!r && !p.autoPosition && (d.x = p.x ?? d.x, d.y = p.y ?? d.y), d.w = p.w ?? d.w, (p.x == null || p.y === void 0) && (d.autoPosition = !0));
|
|
2730
2741
|
})), a.forEach((p) => {
|
|
2731
|
-
let d = i.findIndex((
|
|
2742
|
+
let d = i.findIndex((_) => _._id === p._id);
|
|
2732
2743
|
if (d !== -1) {
|
|
2733
|
-
const
|
|
2744
|
+
const _ = i[d];
|
|
2734
2745
|
if (r) {
|
|
2735
|
-
|
|
2746
|
+
_.w = p.w;
|
|
2736
2747
|
return;
|
|
2737
2748
|
}
|
|
2738
|
-
(p.autoPosition || isNaN(p.x) || isNaN(p.y)) && this.findEmptyPosition(p, l), p.autoPosition || (
|
|
2749
|
+
(p.autoPosition || isNaN(p.x) || isNaN(p.y)) && this.findEmptyPosition(p, l), p.autoPosition || (_.x = p.x ?? _.x, _.y = p.y ?? _.y, _.w = p.w ?? _.w, l.push(_)), i.splice(d, 1);
|
|
2739
2750
|
}
|
|
2740
2751
|
});
|
|
2741
2752
|
}
|
|
@@ -2769,7 +2780,7 @@ class me {
|
|
|
2769
2780
|
return e.forEach((r, l) => {
|
|
2770
2781
|
if (r._id === void 0) {
|
|
2771
2782
|
const n = r.id ? this.nodes.find((u) => u.id === r.id) : void 0;
|
|
2772
|
-
r._id = (n == null ? void 0 : n._id) ??
|
|
2783
|
+
r._id = (n == null ? void 0 : n._id) ?? be._idSeq++;
|
|
2773
2784
|
}
|
|
2774
2785
|
s[l] = { x: r.x, y: r.y, w: r.w, _id: r._id };
|
|
2775
2786
|
}), this._layouts = i ? [] : this._layouts || [], this._layouts[t] = s, this;
|
|
@@ -2780,7 +2791,7 @@ class me {
|
|
|
2780
2791
|
* @param column corresponding column index to save it under
|
|
2781
2792
|
*/
|
|
2782
2793
|
cacheOneLayout(e, t) {
|
|
2783
|
-
e._id = e._id ??
|
|
2794
|
+
e._id = e._id ?? be._idSeq++;
|
|
2784
2795
|
let i = { x: e.x, y: e.y, w: e.w, _id: e._id };
|
|
2785
2796
|
(e.autoPosition || e.x === void 0) && (delete i.x, delete i.y, e.autoPosition && (i.autoPosition = !0)), this._layouts = this._layouts || [], this._layouts[t] = this._layouts[t] || [];
|
|
2786
2797
|
let s = this.findCacheLayout(e, t);
|
|
@@ -2804,8 +2815,8 @@ class me {
|
|
|
2804
2815
|
return this;
|
|
2805
2816
|
}
|
|
2806
2817
|
}
|
|
2807
|
-
|
|
2808
|
-
const
|
|
2818
|
+
be._idSeq = 0;
|
|
2819
|
+
const he = {
|
|
2809
2820
|
alwaysShowResizeHandle: "mobile",
|
|
2810
2821
|
animate: !0,
|
|
2811
2822
|
auto: !0,
|
|
@@ -2837,18 +2848,18 @@ const ae = {
|
|
|
2837
2848
|
// staticGrid: false,
|
|
2838
2849
|
// styleInHead: false,
|
|
2839
2850
|
//removable
|
|
2840
|
-
},
|
|
2851
|
+
}, kn = {
|
|
2841
2852
|
handle: ".grid-stack-item-content",
|
|
2842
2853
|
appendTo: "body"
|
|
2843
2854
|
// revert: 'invalid',
|
|
2844
2855
|
// scroll: false,
|
|
2845
2856
|
};
|
|
2846
|
-
class
|
|
2857
|
+
class k {
|
|
2847
2858
|
}
|
|
2848
|
-
const
|
|
2849
|
-
class
|
|
2859
|
+
const ge = typeof window < "u" && typeof document < "u" && ("ontouchstart" in document || "ontouchstart" in window || window.DocumentTouch && document instanceof window.DocumentTouch || navigator.maxTouchPoints > 0 || navigator.msMaxTouchPoints > 0);
|
|
2860
|
+
class ve {
|
|
2850
2861
|
}
|
|
2851
|
-
function
|
|
2862
|
+
function St(o, e) {
|
|
2852
2863
|
if (o.touches.length > 1)
|
|
2853
2864
|
return;
|
|
2854
2865
|
o.cancelable && o.preventDefault();
|
|
@@ -2886,7 +2897,7 @@ function Rt(o, e) {
|
|
|
2886
2897
|
// relatedTarget
|
|
2887
2898
|
), o.target.dispatchEvent(i);
|
|
2888
2899
|
}
|
|
2889
|
-
function
|
|
2900
|
+
function Ss(o, e) {
|
|
2890
2901
|
o.cancelable && o.preventDefault();
|
|
2891
2902
|
const t = document.createEvent("MouseEvents");
|
|
2892
2903
|
t.initMouseEvent(
|
|
@@ -2922,46 +2933,46 @@ function Rs(o, e) {
|
|
|
2922
2933
|
// relatedTarget
|
|
2923
2934
|
), o.target.dispatchEvent(t);
|
|
2924
2935
|
}
|
|
2925
|
-
function St(o) {
|
|
2926
|
-
_e.touchHandled || (_e.touchHandled = !0, Rt(o, "mousedown"));
|
|
2927
|
-
}
|
|
2928
2936
|
function Ct(o) {
|
|
2929
|
-
|
|
2937
|
+
ve.touchHandled || (ve.touchHandled = !0, St(o, "mousedown"));
|
|
2930
2938
|
}
|
|
2931
2939
|
function At(o) {
|
|
2932
|
-
|
|
2933
|
-
return;
|
|
2934
|
-
_e.pointerLeaveTimeout && (window.clearTimeout(_e.pointerLeaveTimeout), delete _e.pointerLeaveTimeout);
|
|
2935
|
-
const e = !!x.dragElement;
|
|
2936
|
-
Rt(o, "mouseup"), e || Rt(o, "click"), _e.touchHandled = !1;
|
|
2940
|
+
ve.touchHandled && St(o, "mousemove");
|
|
2937
2941
|
}
|
|
2938
2942
|
function Dt(o) {
|
|
2939
|
-
|
|
2943
|
+
if (!ve.touchHandled)
|
|
2944
|
+
return;
|
|
2945
|
+
ve.pointerLeaveTimeout && (window.clearTimeout(ve.pointerLeaveTimeout), delete ve.pointerLeaveTimeout);
|
|
2946
|
+
const e = !!k.dragElement;
|
|
2947
|
+
St(o, "mouseup"), e || St(o, "click"), ve.touchHandled = !1;
|
|
2940
2948
|
}
|
|
2941
|
-
function
|
|
2942
|
-
|
|
2949
|
+
function Lt(o) {
|
|
2950
|
+
o.pointerType !== "mouse" && o.target.releasePointerCapture(o.pointerId);
|
|
2943
2951
|
}
|
|
2944
2952
|
function ss(o) {
|
|
2945
|
-
|
|
2946
|
-
|
|
2953
|
+
k.dragElement && o.pointerType !== "mouse" && Ss(o, "mouseenter");
|
|
2954
|
+
}
|
|
2955
|
+
function rs(o) {
|
|
2956
|
+
k.dragElement && o.pointerType !== "mouse" && (ve.pointerLeaveTimeout = window.setTimeout(() => {
|
|
2957
|
+
delete ve.pointerLeaveTimeout, Ss(o, "mouseleave");
|
|
2947
2958
|
}, 10));
|
|
2948
2959
|
}
|
|
2949
|
-
class
|
|
2960
|
+
class Mt {
|
|
2950
2961
|
constructor(e, t, i) {
|
|
2951
2962
|
this.moving = !1, this.host = e, this.dir = t, this.option = i, this._mouseDown = this._mouseDown.bind(this), this._mouseMove = this._mouseMove.bind(this), this._mouseUp = this._mouseUp.bind(this), this._init();
|
|
2952
2963
|
}
|
|
2953
2964
|
/** @internal */
|
|
2954
2965
|
_init() {
|
|
2955
2966
|
const e = document.createElement("div");
|
|
2956
|
-
return e.classList.add("ui-resizable-handle"), e.classList.add(`${
|
|
2967
|
+
return e.classList.add("ui-resizable-handle"), e.classList.add(`${Mt.prefix}${this.dir}`), e.style.zIndex = "100", e.style.userSelect = "none", this.el = e, this.host.appendChild(this.el), this.el.addEventListener("mousedown", this._mouseDown), ge && (this.el.addEventListener("touchstart", Ct), this.el.addEventListener("pointerdown", Lt)), this;
|
|
2957
2968
|
}
|
|
2958
2969
|
/** call this when resize handle needs to be removed and cleaned up */
|
|
2959
2970
|
destroy() {
|
|
2960
|
-
return this.moving && this._mouseUp(this.mouseDownEvent), this.el.removeEventListener("mousedown", this._mouseDown),
|
|
2971
|
+
return this.moving && this._mouseUp(this.mouseDownEvent), this.el.removeEventListener("mousedown", this._mouseDown), ge && (this.el.removeEventListener("touchstart", Ct), this.el.removeEventListener("pointerdown", Lt)), this.host.removeChild(this.el), delete this.el, delete this.host, this;
|
|
2961
2972
|
}
|
|
2962
2973
|
/** @internal called on mouse down on us: capture move on the entire document (mouse might not stay on us) until we release the mouse */
|
|
2963
2974
|
_mouseDown(e) {
|
|
2964
|
-
this.mouseDownEvent = e, document.addEventListener("mousemove", this._mouseMove, !0), document.addEventListener("mouseup", this._mouseUp, !0),
|
|
2975
|
+
this.mouseDownEvent = e, document.addEventListener("mousemove", this._mouseMove, !0), document.addEventListener("mouseup", this._mouseUp, !0), ge && (this.el.addEventListener("touchmove", At), this.el.addEventListener("touchend", Dt)), e.stopPropagation(), e.preventDefault();
|
|
2965
2976
|
}
|
|
2966
2977
|
/** @internal */
|
|
2967
2978
|
_mouseMove(e) {
|
|
@@ -2970,15 +2981,15 @@ class Nt {
|
|
|
2970
2981
|
}
|
|
2971
2982
|
/** @internal */
|
|
2972
2983
|
_mouseUp(e) {
|
|
2973
|
-
this.moving && this._triggerEvent("stop", e), document.removeEventListener("mousemove", this._mouseMove, !0), document.removeEventListener("mouseup", this._mouseUp, !0),
|
|
2984
|
+
this.moving && this._triggerEvent("stop", e), document.removeEventListener("mousemove", this._mouseMove, !0), document.removeEventListener("mouseup", this._mouseUp, !0), ge && (this.el.removeEventListener("touchmove", At), this.el.removeEventListener("touchend", Dt)), delete this.moving, delete this.mouseDownEvent, e.stopPropagation(), e.preventDefault();
|
|
2974
2985
|
}
|
|
2975
2986
|
/** @internal */
|
|
2976
2987
|
_triggerEvent(e, t) {
|
|
2977
2988
|
return this.option[e] && this.option[e](t), this;
|
|
2978
2989
|
}
|
|
2979
2990
|
}
|
|
2980
|
-
|
|
2981
|
-
class
|
|
2991
|
+
Mt.prefix = "ui-resizable-";
|
|
2992
|
+
class _i {
|
|
2982
2993
|
constructor() {
|
|
2983
2994
|
this._eventRegister = {};
|
|
2984
2995
|
}
|
|
@@ -3006,7 +3017,7 @@ class fi {
|
|
|
3006
3017
|
return this._eventRegister[e](t);
|
|
3007
3018
|
}
|
|
3008
3019
|
}
|
|
3009
|
-
class st extends
|
|
3020
|
+
class st extends _i {
|
|
3010
3021
|
constructor(e, t = {}) {
|
|
3011
3022
|
super(), this.rectScale = { x: 1, y: 1 }, this._ui = () => {
|
|
3012
3023
|
const s = this.el.parentElement.getBoundingClientRect(), r = {
|
|
@@ -3061,22 +3072,22 @@ class st extends fi {
|
|
|
3061
3072
|
}
|
|
3062
3073
|
/** @internal turns auto hide on/off */
|
|
3063
3074
|
_setupAutoHide(e) {
|
|
3064
|
-
return e ? (this.el.classList.add("ui-resizable-autohide"), this.el.addEventListener("mouseover", this._mouseOver), this.el.addEventListener("mouseout", this._mouseOut)) : (this.el.classList.remove("ui-resizable-autohide"), this.el.removeEventListener("mouseover", this._mouseOver), this.el.removeEventListener("mouseout", this._mouseOut),
|
|
3075
|
+
return e ? (this.el.classList.add("ui-resizable-autohide"), this.el.addEventListener("mouseover", this._mouseOver), this.el.addEventListener("mouseout", this._mouseOut)) : (this.el.classList.remove("ui-resizable-autohide"), this.el.removeEventListener("mouseover", this._mouseOver), this.el.removeEventListener("mouseout", this._mouseOut), k.overResizeElement === this && delete k.overResizeElement), this;
|
|
3065
3076
|
}
|
|
3066
3077
|
/** @internal */
|
|
3067
3078
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
3068
3079
|
_mouseOver(e) {
|
|
3069
|
-
|
|
3080
|
+
k.overResizeElement || k.dragElement || (k.overResizeElement = this, this.el.classList.remove("ui-resizable-autohide"));
|
|
3070
3081
|
}
|
|
3071
3082
|
/** @internal */
|
|
3072
3083
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
3073
3084
|
_mouseOut(e) {
|
|
3074
|
-
|
|
3085
|
+
k.overResizeElement === this && (delete k.overResizeElement, this.el.classList.add("ui-resizable-autohide"));
|
|
3075
3086
|
}
|
|
3076
3087
|
/** @internal */
|
|
3077
3088
|
_setupHandlers() {
|
|
3078
3089
|
let e = this.option.handles || "e,s,se";
|
|
3079
|
-
return e === "all" && (e = "n,e,s,w,se,sw,ne,nw"), this.handlers = e.split(",").map((t) => t.trim()).map((t) => new
|
|
3090
|
+
return e === "all" && (e = "n,e,s,w,se,sw,ne,nw"), this.handlers = e.split(",").map((t) => t.trim()).map((t) => new Mt(this.el, t, {
|
|
3080
3091
|
start: (i) => {
|
|
3081
3092
|
this._resizeStart(i);
|
|
3082
3093
|
},
|
|
@@ -3165,8 +3176,8 @@ class st extends fi {
|
|
|
3165
3176
|
}
|
|
3166
3177
|
}
|
|
3167
3178
|
st._originStyleProp = ["width", "height", "position", "left", "top", "opacity", "zIndex"];
|
|
3168
|
-
const
|
|
3169
|
-
class rt extends
|
|
3179
|
+
const En = 'input,textarea,button,select,option,[contenteditable="true"],.ui-resizable-handle';
|
|
3180
|
+
class rt extends _i {
|
|
3170
3181
|
constructor(e, t = {}) {
|
|
3171
3182
|
super(), this.dragScale = { x: 1, y: 1 }, this.el = e, this.option = t;
|
|
3172
3183
|
let i = t.handle.substring(1);
|
|
@@ -3179,10 +3190,10 @@ class rt extends fi {
|
|
|
3179
3190
|
super.off(e);
|
|
3180
3191
|
}
|
|
3181
3192
|
enable() {
|
|
3182
|
-
this.disabled !== !1 && (super.enable(), this.dragEl.addEventListener("mousedown", this._mouseDown),
|
|
3193
|
+
this.disabled !== !1 && (super.enable(), this.dragEl.addEventListener("mousedown", this._mouseDown), ge && (this.dragEl.addEventListener("touchstart", Ct), this.dragEl.addEventListener("pointerdown", Lt)), this.el.classList.remove("ui-draggable-disabled"));
|
|
3183
3194
|
}
|
|
3184
3195
|
disable(e = !1) {
|
|
3185
|
-
this.disabled !== !0 && (super.disable(), this.dragEl.removeEventListener("mousedown", this._mouseDown),
|
|
3196
|
+
this.disabled !== !0 && (super.disable(), this.dragEl.removeEventListener("mousedown", this._mouseDown), ge && (this.dragEl.removeEventListener("touchstart", Ct), this.dragEl.removeEventListener("pointerdown", Lt)), e || this.el.classList.add("ui-draggable-disabled"));
|
|
3186
3197
|
}
|
|
3187
3198
|
destroy() {
|
|
3188
3199
|
this.dragTimeout && window.clearTimeout(this.dragTimeout), delete this.dragTimeout, this.mouseDownEvent && this._mouseUp(this.mouseDownEvent), this.disable(!0), delete this.el, delete this.helper, delete this.option, super.destroy();
|
|
@@ -3192,8 +3203,8 @@ class rt extends fi {
|
|
|
3192
3203
|
}
|
|
3193
3204
|
/** @internal call when mouse goes down before a dragstart happens */
|
|
3194
3205
|
_mouseDown(e) {
|
|
3195
|
-
if (!
|
|
3196
|
-
return e.button !== 0 || e.target.closest(
|
|
3206
|
+
if (!k.mouseHandled)
|
|
3207
|
+
return e.button !== 0 || e.target.closest(En) || this.option.cancel && e.target.closest(this.option.cancel) || (this.mouseDownEvent = e, delete this.dragging, delete k.dragElement, delete k.dropElement, document.addEventListener("mousemove", this._mouseMove, !0), document.addEventListener("mouseup", this._mouseUp, !0), ge && (this.dragEl.addEventListener("touchmove", At), this.dragEl.addEventListener("touchend", Dt)), e.preventDefault(), document.activeElement && document.activeElement.blur(), k.mouseHandled = !0), !0;
|
|
3197
3208
|
}
|
|
3198
3209
|
/** @internal method to call actual drag event */
|
|
3199
3210
|
_callDrag(e) {
|
|
@@ -3207,15 +3218,15 @@ class rt extends fi {
|
|
|
3207
3218
|
var i;
|
|
3208
3219
|
let t = this.mouseDownEvent;
|
|
3209
3220
|
if (this.dragging)
|
|
3210
|
-
if (this._dragFollow(e),
|
|
3211
|
-
const s = Number.isInteger(
|
|
3221
|
+
if (this._dragFollow(e), k.pauseDrag) {
|
|
3222
|
+
const s = Number.isInteger(k.pauseDrag) ? k.pauseDrag : 100;
|
|
3212
3223
|
this.dragTimeout && window.clearTimeout(this.dragTimeout), this.dragTimeout = window.setTimeout(() => this._callDrag(e), s);
|
|
3213
3224
|
} else
|
|
3214
3225
|
this._callDrag(e);
|
|
3215
3226
|
else if (Math.abs(e.x - t.x) + Math.abs(e.y - t.y) > 3) {
|
|
3216
|
-
this.dragging = !0,
|
|
3227
|
+
this.dragging = !0, k.dragElement = this;
|
|
3217
3228
|
let s = (i = this.el.gridstackNode) == null ? void 0 : i.grid;
|
|
3218
|
-
s ?
|
|
3229
|
+
s ? k.dropElement = s.el.ddElement.ddDroppable : delete k.dropElement, this.helper = this._createHelper(e), this._setupHelperContainmentStyle(), this.dragOffset = this._getDragOffset(e, this.el, this.helperContainment);
|
|
3219
3230
|
const r = f.initEvent(e, { target: this.el, type: "dragstart" });
|
|
3220
3231
|
this._setupHelperStyle(e), this.option.start && this.option.start(r, this.ui()), this.triggerEvent("dragstart", r);
|
|
3221
3232
|
}
|
|
@@ -3224,12 +3235,12 @@ class rt extends fi {
|
|
|
3224
3235
|
/** @internal call when the mouse gets released to drop the item at current location */
|
|
3225
3236
|
_mouseUp(e) {
|
|
3226
3237
|
var t;
|
|
3227
|
-
if (document.removeEventListener("mousemove", this._mouseMove, !0), document.removeEventListener("mouseup", this._mouseUp, !0),
|
|
3228
|
-
delete this.dragging, ((t =
|
|
3238
|
+
if (document.removeEventListener("mousemove", this._mouseMove, !0), document.removeEventListener("mouseup", this._mouseUp, !0), ge && (this.dragEl.removeEventListener("touchmove", At, !0), this.dragEl.removeEventListener("touchend", Dt, !0)), this.dragging) {
|
|
3239
|
+
delete this.dragging, ((t = k.dropElement) == null ? void 0 : t.el) === this.el.parentElement && delete k.dropElement, this.helperContainment.style.position = this.parentOriginStylePosition || null, this.helper === this.el ? this._removeHelperStyle() : this.helper.remove();
|
|
3229
3240
|
const i = f.initEvent(e, { target: this.el, type: "dragstop" });
|
|
3230
|
-
this.option.stop && this.option.stop(i), this.triggerEvent("dragstop", i),
|
|
3241
|
+
this.option.stop && this.option.stop(i), this.triggerEvent("dragstop", i), k.dropElement && k.dropElement.drop(e);
|
|
3231
3242
|
}
|
|
3232
|
-
delete this.helper, delete this.mouseDownEvent, delete
|
|
3243
|
+
delete this.helper, delete this.mouseDownEvent, delete k.dragElement, delete k.dropElement, delete k.mouseHandled, e.preventDefault();
|
|
3233
3244
|
}
|
|
3234
3245
|
/** @internal create a clone copy (or user defined method) of the original drag item if set */
|
|
3235
3246
|
_createHelper(e) {
|
|
@@ -3311,7 +3322,7 @@ class rt extends fi {
|
|
|
3311
3322
|
}
|
|
3312
3323
|
}
|
|
3313
3324
|
rt.originStyleProp = ["transition", "pointerEvents", "position", "left", "top", "minWidth", "willChange"];
|
|
3314
|
-
class
|
|
3325
|
+
class Tn extends _i {
|
|
3315
3326
|
constructor(e, t = {}) {
|
|
3316
3327
|
super(), this.el = e, this.option = t, this._mouseEnter = this._mouseEnter.bind(this), this._mouseLeave = this._mouseLeave.bind(this), this.enable(), this._setupAccept();
|
|
3317
3328
|
}
|
|
@@ -3322,10 +3333,10 @@ class En extends fi {
|
|
|
3322
3333
|
super.off(e);
|
|
3323
3334
|
}
|
|
3324
3335
|
enable() {
|
|
3325
|
-
this.disabled !== !1 && (super.enable(), this.el.classList.add("ui-droppable"), this.el.classList.remove("ui-droppable-disabled"), this.el.addEventListener("mouseenter", this._mouseEnter), this.el.addEventListener("mouseleave", this._mouseLeave),
|
|
3336
|
+
this.disabled !== !1 && (super.enable(), this.el.classList.add("ui-droppable"), this.el.classList.remove("ui-droppable-disabled"), this.el.addEventListener("mouseenter", this._mouseEnter), this.el.addEventListener("mouseleave", this._mouseLeave), ge && (this.el.addEventListener("pointerenter", ss), this.el.addEventListener("pointerleave", rs)));
|
|
3326
3337
|
}
|
|
3327
3338
|
disable(e = !1) {
|
|
3328
|
-
this.disabled !== !0 && (super.disable(), this.el.classList.remove("ui-droppable"), e || this.el.classList.add("ui-droppable-disabled"), this.el.removeEventListener("mouseenter", this._mouseEnter), this.el.removeEventListener("mouseleave", this._mouseLeave),
|
|
3339
|
+
this.disabled !== !0 && (super.disable(), this.el.classList.remove("ui-droppable"), e || this.el.classList.add("ui-droppable-disabled"), this.el.removeEventListener("mouseenter", this._mouseEnter), this.el.removeEventListener("mouseleave", this._mouseLeave), ge && (this.el.removeEventListener("pointerenter", ss), this.el.removeEventListener("pointerleave", rs)));
|
|
3329
3340
|
}
|
|
3330
3341
|
destroy() {
|
|
3331
3342
|
this.disable(!0), this.el.classList.remove("ui-droppable"), this.el.classList.remove("ui-droppable-disabled"), super.destroy();
|
|
@@ -3335,21 +3346,21 @@ class En extends fi {
|
|
|
3335
3346
|
}
|
|
3336
3347
|
/** @internal called when the cursor enters our area - prepare for a possible drop and track leaving */
|
|
3337
3348
|
_mouseEnter(e) {
|
|
3338
|
-
if (!
|
|
3349
|
+
if (!k.dragElement || !this._canDrop(k.dragElement.el))
|
|
3339
3350
|
return;
|
|
3340
|
-
e.preventDefault(), e.stopPropagation(),
|
|
3351
|
+
e.preventDefault(), e.stopPropagation(), k.dropElement && k.dropElement !== this && k.dropElement._mouseLeave(e), k.dropElement = this;
|
|
3341
3352
|
const t = f.initEvent(e, { target: this.el, type: "dropover" });
|
|
3342
|
-
this.option.over && this.option.over(t, this._ui(
|
|
3353
|
+
this.option.over && this.option.over(t, this._ui(k.dragElement)), this.triggerEvent("dropover", t), this.el.classList.add("ui-droppable-over");
|
|
3343
3354
|
}
|
|
3344
3355
|
/** @internal called when the item is leaving our area, stop tracking if we had moving item */
|
|
3345
3356
|
_mouseLeave(e) {
|
|
3346
3357
|
var i;
|
|
3347
|
-
if (!
|
|
3358
|
+
if (!k.dragElement || k.dropElement !== this)
|
|
3348
3359
|
return;
|
|
3349
3360
|
e.preventDefault(), e.stopPropagation();
|
|
3350
3361
|
const t = f.initEvent(e, { target: this.el, type: "dropout" });
|
|
3351
|
-
if (this.option.out && this.option.out(t, this._ui(
|
|
3352
|
-
delete
|
|
3362
|
+
if (this.option.out && this.option.out(t, this._ui(k.dragElement)), this.triggerEvent("dropout", t), k.dropElement === this) {
|
|
3363
|
+
delete k.dropElement;
|
|
3353
3364
|
let s, r = this.el.parentElement;
|
|
3354
3365
|
for (; !s && r; )
|
|
3355
3366
|
s = (i = r.ddElement) == null ? void 0 : i.ddDroppable, r = r.parentElement;
|
|
@@ -3360,7 +3371,7 @@ class En extends fi {
|
|
|
3360
3371
|
drop(e) {
|
|
3361
3372
|
e.preventDefault();
|
|
3362
3373
|
const t = f.initEvent(e, { target: this.el, type: "drop" });
|
|
3363
|
-
this.option.drop && this.option.drop(t, this._ui(
|
|
3374
|
+
this.option.drop && this.option.drop(t, this._ui(k.dragElement)), this.triggerEvent("drop", t);
|
|
3364
3375
|
}
|
|
3365
3376
|
/** @internal true if element matches the string/method accept option */
|
|
3366
3377
|
_canDrop(e) {
|
|
@@ -3378,9 +3389,9 @@ class En extends fi {
|
|
|
3378
3389
|
};
|
|
3379
3390
|
}
|
|
3380
3391
|
}
|
|
3381
|
-
class
|
|
3392
|
+
class yi {
|
|
3382
3393
|
static init(e) {
|
|
3383
|
-
return e.ddElement || (e.ddElement = new
|
|
3394
|
+
return e.ddElement || (e.ddElement = new yi(e)), e.ddElement;
|
|
3384
3395
|
}
|
|
3385
3396
|
constructor(e) {
|
|
3386
3397
|
this.el = e;
|
|
@@ -3404,13 +3415,13 @@ class gi {
|
|
|
3404
3415
|
return this.ddResizable && (this.ddResizable.destroy(), delete this.ddResizable), this;
|
|
3405
3416
|
}
|
|
3406
3417
|
setupDroppable(e) {
|
|
3407
|
-
return this.ddDroppable ? this.ddDroppable.updateOption(e) : this.ddDroppable = new
|
|
3418
|
+
return this.ddDroppable ? this.ddDroppable.updateOption(e) : this.ddDroppable = new Tn(this.el, e), this;
|
|
3408
3419
|
}
|
|
3409
3420
|
cleanDroppable() {
|
|
3410
3421
|
return this.ddDroppable && (this.ddDroppable.destroy(), delete this.ddDroppable), this;
|
|
3411
3422
|
}
|
|
3412
3423
|
}
|
|
3413
|
-
class
|
|
3424
|
+
class Rn {
|
|
3414
3425
|
resizable(e, t, i, s) {
|
|
3415
3426
|
return this._getDDElements(e).forEach((r) => {
|
|
3416
3427
|
if (t === "disable" || t === "enable")
|
|
@@ -3475,7 +3486,7 @@ class Tn {
|
|
|
3475
3486
|
}
|
|
3476
3487
|
on(e, t, i) {
|
|
3477
3488
|
return this._getDDElements(e).forEach((s) => s.on(t, (r) => {
|
|
3478
|
-
i(r,
|
|
3489
|
+
i(r, k.dragElement ? k.dragElement.el : r.target, k.dragElement ? k.dragElement.helper : null);
|
|
3479
3490
|
})), this;
|
|
3480
3491
|
}
|
|
3481
3492
|
off(e, t) {
|
|
@@ -3486,7 +3497,7 @@ class Tn {
|
|
|
3486
3497
|
let i = f.getElements(e);
|
|
3487
3498
|
if (!i.length)
|
|
3488
3499
|
return [];
|
|
3489
|
-
let s = i.map((r) => r.ddElement || (t ?
|
|
3500
|
+
let s = i.map((r) => r.ddElement || (t ? yi.init(r) : null));
|
|
3490
3501
|
return t || s.filter((r) => r), s;
|
|
3491
3502
|
}
|
|
3492
3503
|
}
|
|
@@ -3497,8 +3508,8 @@ class Tn {
|
|
|
3497
3508
|
* Copyright (c) 2021-2022 Alain Dumesny
|
|
3498
3509
|
* see root license https://github.com/gridstack/gridstack.js/tree/master/LICENSE
|
|
3499
3510
|
*/
|
|
3500
|
-
const
|
|
3501
|
-
class
|
|
3511
|
+
const Q = new Rn();
|
|
3512
|
+
class T {
|
|
3502
3513
|
/**
|
|
3503
3514
|
* initializing the HTML element, or selector string, into a grid will return the grid. Calling it again will
|
|
3504
3515
|
* simply return the existing instance (ignore any passed options). There is also an initAll() version that support
|
|
@@ -3513,8 +3524,8 @@ class E {
|
|
|
3513
3524
|
* let grid = document.querySelector('.grid-stack').gridstack;
|
|
3514
3525
|
*/
|
|
3515
3526
|
static init(e = {}, t = ".grid-stack") {
|
|
3516
|
-
let i =
|
|
3517
|
-
return i ? (i.gridstack || (i.gridstack = new
|
|
3527
|
+
let i = T.getGridElement(t);
|
|
3528
|
+
return i ? (i.gridstack || (i.gridstack = new T(i, f.cloneDeep(e))), i.gridstack) : (console.error(typeof t == "string" ? 'GridStack.initAll() no grid was found with selector "' + t + `" - element missing or wrong selector ?
|
|
3518
3529
|
Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.` : "GridStack.init() no grid element was passed."), null);
|
|
3519
3530
|
}
|
|
3520
3531
|
/**
|
|
@@ -3528,8 +3539,8 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3528
3539
|
*/
|
|
3529
3540
|
static initAll(e = {}, t = ".grid-stack") {
|
|
3530
3541
|
let i = [];
|
|
3531
|
-
return
|
|
3532
|
-
s.gridstack || (s.gridstack = new
|
|
3542
|
+
return T.getGridElements(t).forEach((s) => {
|
|
3543
|
+
s.gridstack || (s.gridstack = new T(s, f.cloneDeep(e))), i.push(s.gridstack);
|
|
3533
3544
|
}), i.length === 0 && console.error('GridStack.initAll() no grid was found with selector "' + t + `" - element missing or wrong selector ?
|
|
3534
3545
|
Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.`), i;
|
|
3535
3546
|
}
|
|
@@ -3548,27 +3559,27 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3548
3559
|
const l = i.gridstack;
|
|
3549
3560
|
return t && (l.opts = { ...l.opts, ...t }), t.children !== void 0 && l.load(t.children), l;
|
|
3550
3561
|
}
|
|
3551
|
-
if (!e.classList.contains("grid-stack") ||
|
|
3552
|
-
if (
|
|
3553
|
-
i =
|
|
3562
|
+
if (!e.classList.contains("grid-stack") || T.addRemoveCB)
|
|
3563
|
+
if (T.addRemoveCB)
|
|
3564
|
+
i = T.addRemoveCB(e, t, !0, !0);
|
|
3554
3565
|
else {
|
|
3555
3566
|
let l = document.implementation.createHTMLDocument("");
|
|
3556
3567
|
l.body.innerHTML = `<div class="grid-stack ${t.class || ""}"></div>`, i = l.body.children[0], e.appendChild(i);
|
|
3557
3568
|
}
|
|
3558
|
-
return
|
|
3569
|
+
return T.init(t, i);
|
|
3559
3570
|
}
|
|
3560
3571
|
/** call this method to register your engine instead of the default one.
|
|
3561
3572
|
* See instead `GridStackOptions.engineClass` if you only need to
|
|
3562
3573
|
* replace just one instance.
|
|
3563
3574
|
*/
|
|
3564
3575
|
static registerEngine(e) {
|
|
3565
|
-
|
|
3576
|
+
T.engineClass = e;
|
|
3566
3577
|
}
|
|
3567
3578
|
/** @internal create placeholder DIV as needed */
|
|
3568
3579
|
get placeholder() {
|
|
3569
3580
|
if (!this._placeholder) {
|
|
3570
3581
|
let e = document.createElement("div");
|
|
3571
|
-
e.className = "placeholder-content", this.opts.placeholderText && (e.innerHTML = this.opts.placeholderText), this._placeholder = document.createElement("div"), this._placeholder.classList.add(this.opts.placeholderClass,
|
|
3582
|
+
e.className = "placeholder-content", this.opts.placeholderText && (e.innerHTML = this.opts.placeholderText), this._placeholder = document.createElement("div"), this._placeholder.classList.add(this.opts.placeholderClass, he.itemClass, this.opts.itemClass), this.placeholder.appendChild(e);
|
|
3572
3583
|
}
|
|
3573
3584
|
return this._placeholder;
|
|
3574
3585
|
}
|
|
@@ -3583,24 +3594,24 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3583
3594
|
let i = f.toNumber(e.getAttribute("gs-row"));
|
|
3584
3595
|
t.column === "auto" && delete t.column, t.alwaysShowResizeHandle !== void 0 && (t._alwaysShowResizeHandle = t.alwaysShowResizeHandle);
|
|
3585
3596
|
let s = {
|
|
3586
|
-
...f.cloneDeep(
|
|
3587
|
-
column: f.toNumber(e.getAttribute("gs-column")) ||
|
|
3588
|
-
minRow: i || f.toNumber(e.getAttribute("gs-min-row")) ||
|
|
3589
|
-
maxRow: i || f.toNumber(e.getAttribute("gs-max-row")) ||
|
|
3590
|
-
staticGrid: f.toBool(e.getAttribute("gs-static")) ||
|
|
3597
|
+
...f.cloneDeep(he),
|
|
3598
|
+
column: f.toNumber(e.getAttribute("gs-column")) || he.column,
|
|
3599
|
+
minRow: i || f.toNumber(e.getAttribute("gs-min-row")) || he.minRow,
|
|
3600
|
+
maxRow: i || f.toNumber(e.getAttribute("gs-max-row")) || he.maxRow,
|
|
3601
|
+
staticGrid: f.toBool(e.getAttribute("gs-static")) || he.staticGrid,
|
|
3591
3602
|
draggable: {
|
|
3592
|
-
handle: (t.handleClass ? "." + t.handleClass : t.handle ? t.handle : "") ||
|
|
3603
|
+
handle: (t.handleClass ? "." + t.handleClass : t.handle ? t.handle : "") || he.draggable.handle
|
|
3593
3604
|
},
|
|
3594
3605
|
removableOptions: {
|
|
3595
|
-
accept: t.itemClass ||
|
|
3596
|
-
decline:
|
|
3606
|
+
accept: t.itemClass || he.removableOptions.accept,
|
|
3607
|
+
decline: he.removableOptions.decline
|
|
3597
3608
|
}
|
|
3598
3609
|
};
|
|
3599
3610
|
e.getAttribute("gs-animate") && (s.animate = f.toBool(e.getAttribute("gs-animate"))), this.opts = f.defaults(t, s), t = null, this._initMargin(), this.opts.column !== 1 && !this.opts.disableOneColumnMode && this._widthOrContainer() <= this.opts.oneColumnSize && (this._prevColumn = this.getColumn(), this.opts.column = 1), this.opts.rtl === "auto" && (this.opts.rtl = e.style.direction === "rtl"), this.opts.rtl && this.el.classList.add("grid-stack-rtl");
|
|
3600
3611
|
const r = (u = this.el.parentElement) == null ? void 0 : u.parentElement;
|
|
3601
|
-
let l = r != null && r.classList.contains(
|
|
3602
|
-
l && (l.subGrid = this, this.parentGridItem = l, this.el.classList.add("grid-stack-nested"), l.el.classList.add("grid-stack-sub-grid")), this._isAutoCellHeight = this.opts.cellHeight === "auto", this._isAutoCellHeight || this.opts.cellHeight === "initial" ? this.cellHeight(void 0, !1) : (typeof this.opts.cellHeight == "number" && this.opts.cellHeightUnit && this.opts.cellHeightUnit !==
|
|
3603
|
-
let n = this.opts.engineClass ||
|
|
3612
|
+
let l = r != null && r.classList.contains(he.itemClass) ? r.gridstackNode : void 0;
|
|
3613
|
+
l && (l.subGrid = this, this.parentGridItem = l, this.el.classList.add("grid-stack-nested"), l.el.classList.add("grid-stack-sub-grid")), this._isAutoCellHeight = this.opts.cellHeight === "auto", this._isAutoCellHeight || this.opts.cellHeight === "initial" ? this.cellHeight(void 0, !1) : (typeof this.opts.cellHeight == "number" && this.opts.cellHeightUnit && this.opts.cellHeightUnit !== he.cellHeightUnit && (this.opts.cellHeight = this.opts.cellHeight + this.opts.cellHeightUnit, delete this.opts.cellHeightUnit), this.cellHeight(this.opts.cellHeight, !1)), this.opts.alwaysShowResizeHandle === "mobile" && (this.opts.alwaysShowResizeHandle = ge), this._styleSheetClass = "gs-id-" + be._idSeq++, this.el.classList.add(this._styleSheetClass), this._setStaticClass();
|
|
3614
|
+
let n = this.opts.engineClass || T.engineClass || be;
|
|
3604
3615
|
if (this.engine = new n({
|
|
3605
3616
|
column: this.getColumn(),
|
|
3606
3617
|
float: this.opts.float,
|
|
@@ -3610,15 +3621,15 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3610
3621
|
this.engine.nodes.forEach((d) => {
|
|
3611
3622
|
p = Math.max(p, d.y + d.h);
|
|
3612
3623
|
}), h.forEach((d) => {
|
|
3613
|
-
let
|
|
3614
|
-
|
|
3624
|
+
let _ = d.el;
|
|
3625
|
+
_ && (d._removeDOM ? (_ && _.remove(), delete d._removeDOM) : this._writePosAttr(_, d));
|
|
3615
3626
|
}), this._updateStyles(!1, p);
|
|
3616
3627
|
}
|
|
3617
3628
|
}), this.opts.auto && (this.batchUpdate(), this.getGridItems().forEach((h) => this._prepareElement(h)), this.batchUpdate(!1)), this.opts.children) {
|
|
3618
3629
|
let h = this.opts.children;
|
|
3619
3630
|
delete this.opts.children, h.length && this.load(h);
|
|
3620
3631
|
}
|
|
3621
|
-
this.setAnimation(this.opts.animate), this._updateStyles(), this.el.classList.add("gs-" + this.opts.column), this.opts.subGridDynamic && !
|
|
3632
|
+
this.setAnimation(this.opts.animate), this._updateStyles(), this.el.classList.add("gs-" + this.opts.column), this.opts.subGridDynamic && !k.pauseDrag && (k.pauseDrag = !0), ((a = this.opts.draggable) == null ? void 0 : a.pause) !== void 0 && (k.pauseDrag = this.opts.draggable.pause), this._setupRemoveDrop(), this._setupAcceptWidget(), this._updateResizeEvent();
|
|
3622
3633
|
}
|
|
3623
3634
|
/**
|
|
3624
3635
|
* add a new widget and returns it.
|
|
@@ -3646,8 +3657,8 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3646
3657
|
} else if (arguments.length === 0 || arguments.length === 1 && i(e))
|
|
3647
3658
|
if (r = t = e, r != null && r.el)
|
|
3648
3659
|
s = r.el;
|
|
3649
|
-
else if (
|
|
3650
|
-
s =
|
|
3660
|
+
else if (T.addRemoveCB)
|
|
3661
|
+
s = T.addRemoveCB(this.el, t, !0, !1);
|
|
3651
3662
|
else {
|
|
3652
3663
|
let n = (t == null ? void 0 : t.content) || "", u = document.implementation.createHTMLDocument("");
|
|
3653
3664
|
u.body.innerHTML = `<div class="grid-stack-item ${this.opts.itemClass || ""}"><div class="grid-stack-item-content">${n}</div></div>`, s = u.body.children[0];
|
|
@@ -3670,31 +3681,31 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3670
3681
|
* @returns newly created grid
|
|
3671
3682
|
*/
|
|
3672
3683
|
makeSubGrid(e, t, i, s = !0) {
|
|
3673
|
-
var
|
|
3684
|
+
var _, v, L;
|
|
3674
3685
|
let r = e.gridstackNode;
|
|
3675
|
-
if (r || (r = this.makeWidget(e).gridstackNode), (
|
|
3686
|
+
if (r || (r = this.makeWidget(e).gridstackNode), (_ = r.subGrid) != null && _.el)
|
|
3676
3687
|
return r.subGrid;
|
|
3677
3688
|
let l, n = this;
|
|
3678
3689
|
for (; n && !l; )
|
|
3679
|
-
l = (v = n.opts) == null ? void 0 : v.subGridOpts, n = (
|
|
3690
|
+
l = (v = n.opts) == null ? void 0 : v.subGridOpts, n = (L = n.parentGridItem) == null ? void 0 : L.grid;
|
|
3680
3691
|
t = f.cloneDeep({ ...l || {}, children: void 0, ...t || r.subGridOpts }), r.subGridOpts = t;
|
|
3681
3692
|
let u;
|
|
3682
3693
|
t.column === "auto" && (u = !0, t.column = Math.max(r.w || 1, (i == null ? void 0 : i.w) || 1), t.disableOneColumnMode = !0);
|
|
3683
3694
|
let a = r.el.querySelector(".grid-stack-item-content"), h, p;
|
|
3684
3695
|
if (s) {
|
|
3685
|
-
if (this._removeDD(r.el), p = { ...r, x: 0, y: 0 }, f.removeInternalForSave(p), delete p.subGridOpts, r.content && (p.content = r.content, delete r.content),
|
|
3686
|
-
h =
|
|
3696
|
+
if (this._removeDD(r.el), p = { ...r, x: 0, y: 0 }, f.removeInternalForSave(p), delete p.subGridOpts, r.content && (p.content = r.content, delete r.content), T.addRemoveCB)
|
|
3697
|
+
h = T.addRemoveCB(this.el, p, !0, !1);
|
|
3687
3698
|
else {
|
|
3688
|
-
let
|
|
3689
|
-
|
|
3699
|
+
let H = document.implementation.createHTMLDocument("");
|
|
3700
|
+
H.body.innerHTML = '<div class="grid-stack-item"></div>', h = H.body.children[0], h.appendChild(a), H.body.innerHTML = '<div class="grid-stack-item-content"></div>', a = H.body.children[0], r.el.appendChild(a);
|
|
3690
3701
|
}
|
|
3691
3702
|
this._prepareDragDropByNode(r);
|
|
3692
3703
|
}
|
|
3693
3704
|
if (i) {
|
|
3694
|
-
let
|
|
3695
|
-
|
|
3705
|
+
let H = u ? t.column : r.w, C = r.h + i.h, D = r.el.style;
|
|
3706
|
+
D.transition = "none", this.update(r.el, { w: H, h: C }), setTimeout(() => D.transition = null);
|
|
3696
3707
|
}
|
|
3697
|
-
let d = r.subGrid =
|
|
3708
|
+
let d = r.subGrid = T.addGrid(a, t);
|
|
3698
3709
|
return i != null && i._moving && (d._isTemp = !0), u && (d._autoColumn = !0), s && d.addWidget(h, p), i && (i._moving ? window.setTimeout(() => f.simulateMouseEvent(i._event, "mouseenter", d.el), 0) : d.addWidget(r.el, r)), d;
|
|
3699
3710
|
}
|
|
3700
3711
|
/**
|
|
@@ -3717,7 +3728,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3717
3728
|
* @param saveCB callback for each node -> widget, so application can insert additional data to be saved into the widget data structure.
|
|
3718
3729
|
* @returns list of widgets or full grid option, including .children list of widgets
|
|
3719
3730
|
*/
|
|
3720
|
-
save(e = !0, t = !1, i =
|
|
3731
|
+
save(e = !0, t = !1, i = T.saveCB) {
|
|
3721
3732
|
let s = this.engine.save(e, i);
|
|
3722
3733
|
if (s.forEach((r) => {
|
|
3723
3734
|
var l;
|
|
@@ -3733,7 +3744,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3733
3744
|
let r = f.cloneDeep(this.opts);
|
|
3734
3745
|
r.marginBottom === r.marginTop && r.marginRight === r.marginLeft && r.marginTop === r.marginRight && (r.margin = r.marginTop, delete r.marginTop, delete r.marginRight, delete r.marginBottom, delete r.marginLeft), r.rtl === (this.el.style.direction === "rtl") && (r.rtl = "auto"), this._isAutoCellHeight && (r.cellHeight = "auto"), this._autoColumn && (r.column = "auto", delete r.disableOneColumnMode);
|
|
3735
3746
|
const l = r._alwaysShowResizeHandle;
|
|
3736
|
-
return delete r._alwaysShowResizeHandle, l !== void 0 ? r.alwaysShowResizeHandle = l : delete r.alwaysShowResizeHandle, f.removeInternalAndSame(r,
|
|
3747
|
+
return delete r._alwaysShowResizeHandle, l !== void 0 ? r.alwaysShowResizeHandle = l : delete r.alwaysShowResizeHandle, f.removeInternalAndSame(r, he), r.children = s, r;
|
|
3737
3748
|
}
|
|
3738
3749
|
return s;
|
|
3739
3750
|
}
|
|
@@ -3747,19 +3758,19 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3747
3758
|
* @example
|
|
3748
3759
|
* see http://gridstackjs.com/demo/serialization.html
|
|
3749
3760
|
*/
|
|
3750
|
-
load(e, t =
|
|
3761
|
+
load(e, t = T.addRemoveCB || !0) {
|
|
3751
3762
|
e = f.cloneDeep(e);
|
|
3752
3763
|
const i = e.some((a) => a.x !== void 0 || a.y !== void 0);
|
|
3753
3764
|
i && (e = f.sort(e, -1, this._prevColumn || this.getColumn())), this._insertNotAppend = i;
|
|
3754
3765
|
const s = this.opts.column;
|
|
3755
3766
|
this._prevColumn && this._prevColumn !== s && e.some((a) => (a.x || 0) + a.w > s) && (this._ignoreLayoutsNodeChange = !0, this.engine.cacheLayout(e, this._prevColumn, !0));
|
|
3756
|
-
const r =
|
|
3757
|
-
typeof t == "function" && (
|
|
3767
|
+
const r = T.addRemoveCB;
|
|
3768
|
+
typeof t == "function" && (T.addRemoveCB = t);
|
|
3758
3769
|
let l = [];
|
|
3759
3770
|
this.batchUpdate(), t && [...this.engine.nodes].forEach((h) => {
|
|
3760
3771
|
if (!h.id)
|
|
3761
3772
|
return;
|
|
3762
|
-
f.find(e, h.id) || (
|
|
3773
|
+
f.find(e, h.id) || (T.addRemoveCB && T.addRemoveCB(this.el, h, !1, !1), l.push(h), this.removeWidget(h.el, !0, !1));
|
|
3763
3774
|
});
|
|
3764
3775
|
let n = [];
|
|
3765
3776
|
this.engine.nodes = this.engine.nodes.filter((a) => f.find(e, a.id) ? (n.push(a), !1) : !0);
|
|
@@ -3773,7 +3784,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3773
3784
|
d && d.gridstack && (d.gridstack.load(a.subGridOpts.children), this._insertNotAppend = !0);
|
|
3774
3785
|
}
|
|
3775
3786
|
} else t && this.addWidget(a);
|
|
3776
|
-
}), this.engine.removedNodes = l, this.doContentResize(u, !0), this.batchUpdate(!1), delete this._ignoreLayoutsNodeChange, delete this._insertNotAppend, r ?
|
|
3787
|
+
}), this.engine.removedNodes = l, this.doContentResize(u, !0), this.batchUpdate(!1), delete this._ignoreLayoutsNodeChange, delete this._insertNotAppend, r ? T.addRemoveCB = r : delete T.addRemoveCB, this;
|
|
3777
3788
|
}
|
|
3778
3789
|
/**
|
|
3779
3790
|
* use before calling a bunch of `addWidget()` to prevent un-necessary relayouts in between (more efficient)
|
|
@@ -3929,7 +3940,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3929
3940
|
* grid.makeWidget('2', {w:2, content: 'hello'});
|
|
3930
3941
|
*/
|
|
3931
3942
|
makeWidget(e, t) {
|
|
3932
|
-
let i =
|
|
3943
|
+
let i = T.getElement(e);
|
|
3933
3944
|
this._prepareElement(i, !0, t);
|
|
3934
3945
|
const s = i.gridstackNode;
|
|
3935
3946
|
return this._updateContainerHeight(), this.doContentResize(!1, !1, s), s.subGridOpts && this.makeSubGrid(i, s.subGridOpts, void 0, !1), this._prevColumn && this.opts.column === 1 && (this._ignoreLayoutsNodeChange = !0), this._triggerAddEvent(), this._triggerChangeEvent(), delete this._ignoreLayoutsNodeChange, i;
|
|
@@ -3971,11 +3982,11 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3971
3982
|
* @param triggerEvent if `false` (quiet mode) element will not be added to removed list and no 'removed' callbacks will be called (Default? true).
|
|
3972
3983
|
*/
|
|
3973
3984
|
removeWidget(e, t = !0, i = !0) {
|
|
3974
|
-
return
|
|
3985
|
+
return T.getElements(e).forEach((s) => {
|
|
3975
3986
|
if (s.parentElement && s.parentElement !== this.el)
|
|
3976
3987
|
return;
|
|
3977
3988
|
let r = s.gridstackNode;
|
|
3978
|
-
r || (r = this.engine.nodes.find((l) => s === l.el)), r && (
|
|
3989
|
+
r || (r = this.engine.nodes.find((l) => s === l.el)), r && (T.addRemoveCB && T.addRemoveCB(this.el, r, !1, !1), delete s.gridstackNode, this._removeDD(s), this.engine.removeNode(r, t, i), t && s.parentElement && s.remove());
|
|
3979
3990
|
}), i && (this._triggerRemoveEvent(), this._triggerChangeEvent()), this;
|
|
3980
3991
|
}
|
|
3981
3992
|
/**
|
|
@@ -4017,7 +4028,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
4017
4028
|
let i = arguments, s = 1;
|
|
4018
4029
|
return t = { x: i[s++], y: i[s++], w: i[s++], h: i[s++] }, this.update(e, t);
|
|
4019
4030
|
}
|
|
4020
|
-
return
|
|
4031
|
+
return T.getElements(e).forEach((i) => {
|
|
4021
4032
|
var h;
|
|
4022
4033
|
let s = i == null ? void 0 : i.gridstackNode;
|
|
4023
4034
|
if (!s)
|
|
@@ -4058,19 +4069,19 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
4058
4069
|
if (!r)
|
|
4059
4070
|
return;
|
|
4060
4071
|
let l = t && i.h ? i.h * r : e.clientHeight, n;
|
|
4061
|
-
if (i.resizeToContentParent && (n = e.querySelector(i.resizeToContentParent)), n || (n = e.querySelector(
|
|
4072
|
+
if (i.resizeToContentParent && (n = e.querySelector(i.resizeToContentParent)), n || (n = e.querySelector(T.resizeToContentParent)), !n)
|
|
4062
4073
|
return;
|
|
4063
4074
|
const u = e.clientHeight - n.clientHeight, a = t && i.h ? i.h * r - u : n.clientHeight;
|
|
4064
4075
|
let h;
|
|
4065
4076
|
if (i.subGrid)
|
|
4066
4077
|
h = i.subGrid.getRow() * i.subGrid.getCellHeight();
|
|
4067
4078
|
else {
|
|
4068
|
-
const
|
|
4069
|
-
if (!
|
|
4070
|
-
console.log(`Error: resizeToContent() '${
|
|
4079
|
+
const _ = n.firstElementChild;
|
|
4080
|
+
if (!_) {
|
|
4081
|
+
console.log(`Error: resizeToContent() '${T.resizeToContentParent}'.firstElementChild is null, make sure to have a div like container. Skipping sizing.`);
|
|
4071
4082
|
return;
|
|
4072
4083
|
}
|
|
4073
|
-
h =
|
|
4084
|
+
h = _.getBoundingClientRect().height || a;
|
|
4074
4085
|
}
|
|
4075
4086
|
if (a === h)
|
|
4076
4087
|
return;
|
|
@@ -4081,7 +4092,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
4081
4092
|
}
|
|
4082
4093
|
/** call the user resize (so they can do extra work) else our build in version */
|
|
4083
4094
|
resizeToContentCheck(e, t = !1) {
|
|
4084
|
-
|
|
4095
|
+
T.resizeToContentCB ? T.resizeToContentCB(e, t) : this.resizeToContent(e, t);
|
|
4085
4096
|
}
|
|
4086
4097
|
/**
|
|
4087
4098
|
* Updates the margins which will set all 4 sides at once - see `GridStackOptions.margin` for format options (CSS string format of 1,2,4 values or single number).
|
|
@@ -4281,7 +4292,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
4281
4292
|
}
|
|
4282
4293
|
/** @internal */
|
|
4283
4294
|
static getGridElement(e) {
|
|
4284
|
-
return
|
|
4295
|
+
return T.getElement(e);
|
|
4285
4296
|
}
|
|
4286
4297
|
/** @internal */
|
|
4287
4298
|
static getGridElements(e) {
|
|
@@ -4299,7 +4310,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
4299
4310
|
*/
|
|
4300
4311
|
/** get the global (but static to this code) DD implementation */
|
|
4301
4312
|
static getDD() {
|
|
4302
|
-
return
|
|
4313
|
+
return Q;
|
|
4303
4314
|
}
|
|
4304
4315
|
/**
|
|
4305
4316
|
* call to setup dragging in from the outside (say toolbar), by specifying the class selection and options.
|
|
@@ -4310,10 +4321,10 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
4310
4321
|
* @param root optional root which defaults to document (for shadow dom pas the parent HTMLDocument)
|
|
4311
4322
|
*/
|
|
4312
4323
|
static setupDragIn(e, t, i = document) {
|
|
4313
|
-
(t == null ? void 0 : t.pause) !== void 0 && (
|
|
4324
|
+
(t == null ? void 0 : t.pause) !== void 0 && (k.pauseDrag = t.pause), t = { ...kn, ...t || {} };
|
|
4314
4325
|
let s = typeof e == "string" ? f.getElements(e, i) : e;
|
|
4315
4326
|
s.length && (s == null || s.forEach((r) => {
|
|
4316
|
-
|
|
4327
|
+
Q.isDraggable(r) || Q.dragIn(r, t);
|
|
4317
4328
|
}));
|
|
4318
4329
|
}
|
|
4319
4330
|
/**
|
|
@@ -4323,7 +4334,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
4323
4334
|
* @param val if true widget will be draggable, assuming the parent grid isn't noMove or static.
|
|
4324
4335
|
*/
|
|
4325
4336
|
movable(e, t) {
|
|
4326
|
-
return this.opts.staticGrid ? this : (
|
|
4337
|
+
return this.opts.staticGrid ? this : (T.getElements(e).forEach((i) => {
|
|
4327
4338
|
let s = i.gridstackNode;
|
|
4328
4339
|
s && (t ? delete s.noMove : s.noMove = !0, this._prepareDragDropByNode(s));
|
|
4329
4340
|
}), this);
|
|
@@ -4334,7 +4345,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
4334
4345
|
* @param val if true widget will be resizable, assuming the parent grid isn't noResize or static.
|
|
4335
4346
|
*/
|
|
4336
4347
|
resizable(e, t) {
|
|
4337
|
-
return this.opts.staticGrid ? this : (
|
|
4348
|
+
return this.opts.staticGrid ? this : (T.getElements(e).forEach((i) => {
|
|
4338
4349
|
let s = i.gridstackNode;
|
|
4339
4350
|
s && (t ? delete s.noResize : s.noResize = !0, this._prepareDragDropByNode(s));
|
|
4340
4351
|
}), this);
|
|
@@ -4386,12 +4397,12 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
4386
4397
|
}
|
|
4387
4398
|
/** @internal removes any drag&drop present (called during destroy) */
|
|
4388
4399
|
_removeDD(e) {
|
|
4389
|
-
return
|
|
4400
|
+
return Q.draggable(e, "destroy").resizable(e, "destroy"), e.gridstackNode && delete e.gridstackNode._initDD, delete e.ddElement, this;
|
|
4390
4401
|
}
|
|
4391
4402
|
/** @internal called to add drag over to support widgets being added externally */
|
|
4392
4403
|
_setupAcceptWidget() {
|
|
4393
4404
|
if (this.opts.staticGrid || !this.opts.acceptWidgets && !this.opts.removable)
|
|
4394
|
-
return
|
|
4405
|
+
return Q.droppable(this.el, "destroy"), this;
|
|
4395
4406
|
let e, t, i = (s, r, l) => {
|
|
4396
4407
|
let n = r.gridstackNode;
|
|
4397
4408
|
if (!n)
|
|
@@ -4403,7 +4414,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
4403
4414
|
if (n._temporaryRemoved) {
|
|
4404
4415
|
if (n.x = Math.max(0, Math.round(h / t)), n.y = Math.max(0, Math.round(a / e)), delete n.autoPosition, this.engine.nodeBoundFix(n), !this.engine.willItFit(n)) {
|
|
4405
4416
|
if (n.autoPosition = !0, !this.engine.willItFit(n)) {
|
|
4406
|
-
|
|
4417
|
+
Q.off(r, "drag");
|
|
4407
4418
|
return;
|
|
4408
4419
|
}
|
|
4409
4420
|
n._willFitPos && (f.copyPos(n, n._willFitPos), delete n._willFitPos);
|
|
@@ -4412,7 +4423,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
4412
4423
|
} else
|
|
4413
4424
|
this._dragOrResize(l, s, p, n, t, e);
|
|
4414
4425
|
};
|
|
4415
|
-
return
|
|
4426
|
+
return Q.droppable(this.el, {
|
|
4416
4427
|
accept: (s) => {
|
|
4417
4428
|
let r = s.gridstackNode;
|
|
4418
4429
|
if ((r == null ? void 0 : r.grid) === this)
|
|
@@ -4439,7 +4450,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
4439
4450
|
n != null && n.grid && n.grid !== this && !n._temporaryRemoved && n.grid._leave(r, l), t = this.cellWidth(), e = this.getCellHeight(!0), n || (n = this._readAttr(r, !1)), n.grid || (n._isExternal = !0, r.gridstackNode = n), l = l || r;
|
|
4440
4451
|
let u = n.w || Math.round(l.offsetWidth / t) || 1, a = n.h || Math.round(l.offsetHeight / e) || 1;
|
|
4441
4452
|
return n.grid && n.grid !== this ? (r._gridstackNodeOrig || (r._gridstackNodeOrig = n), r.gridstackNode = n = { ...n, w: u, h: a, grid: this }, delete n.x, delete n.y, this.engine.cleanupNode(n).nodeBoundFix(n), n._initDD = n._isExternal = // DOM needs to be re-parented on a drop
|
|
4442
|
-
n._temporaryRemoved = !0) : (n.w = u, n.h = a, n._temporaryRemoved = !0), this._itemRemoving(n.el, !1),
|
|
4453
|
+
n._temporaryRemoved = !0) : (n.w = u, n.h = a, n._temporaryRemoved = !0), this._itemRemoving(n.el, !1), Q.on(r, "drag", i), i(s, r, l), !1;
|
|
4443
4454
|
}).on(this.el, "dropout", (s, r, l) => {
|
|
4444
4455
|
let n = r.gridstackNode;
|
|
4445
4456
|
return n && (!n.grid || n.grid === this) && (this._leave(r, l), this._isTemp && this.removeAsSubGrid(n)), !1;
|
|
@@ -4452,14 +4463,14 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
4452
4463
|
this.placeholder.remove();
|
|
4453
4464
|
let a = r._gridstackNodeOrig;
|
|
4454
4465
|
if (delete r._gridstackNodeOrig, u && (a != null && a.grid) && a.grid !== this) {
|
|
4455
|
-
let
|
|
4456
|
-
|
|
4466
|
+
let _ = a.grid;
|
|
4467
|
+
_.engine.removeNodeFromLayoutCache(a), _.engine.removedNodes.push(a), _._triggerRemoveEvent()._triggerChangeEvent(), _.parentGridItem && !_.engine.nodes.length && _.opts.subGridDynamic && _.removeAsSubGrid();
|
|
4457
4468
|
}
|
|
4458
|
-
if (!n || (u && (this.engine.cleanupNode(n), n.grid = this), delete n.grid._isTemp,
|
|
4469
|
+
if (!n || (u && (this.engine.cleanupNode(n), n.grid = this), delete n.grid._isTemp, Q.off(r, "drag"), l !== r ? (l.remove(), r.gridstackNode = a, u && (r = r.cloneNode(!0))) : (r.remove(), this._removeDD(r)), !u))
|
|
4459
4470
|
return !1;
|
|
4460
4471
|
r.gridstackNode = n, n.el = r;
|
|
4461
4472
|
let h = (d = (p = n.subGrid) == null ? void 0 : p.el) == null ? void 0 : d.gridstack;
|
|
4462
|
-
return f.copyPos(n, this._readAttr(this.placeholder)), f.removePositioningStyles(r), this._writeAttr(r, n), r.classList.add(
|
|
4473
|
+
return f.copyPos(n, this._readAttr(this.placeholder)), f.removePositioningStyles(r), this._writeAttr(r, n), r.classList.add(he.itemClass, this.opts.itemClass), this.el.appendChild(r), h && (h.parentGridItem = n, h.opts.styleInHead || h._updateStyles(!0)), this._prepareDragDropByNode(n), this._updateContainerHeight(), this.engine.addedNodes.push(n), this._triggerAddEvent(), this._triggerChangeEvent(), this.engine.endUpdate(), this._gsEventHandler.dropped && this._gsEventHandler.dropped({ ...s, type: "dropped" }, a && a.grid ? a : void 0, n), !1;
|
|
4463
4474
|
}), this;
|
|
4464
4475
|
}
|
|
4465
4476
|
/** @internal mark item for removal */
|
|
@@ -4473,7 +4484,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
4473
4484
|
let e = document.querySelector(this.opts.removable);
|
|
4474
4485
|
if (!e)
|
|
4475
4486
|
return this;
|
|
4476
|
-
|
|
4487
|
+
Q.isDroppable(e) || Q.droppable(e, this.opts.removableOptions).on(e, "dropover", (t, i) => this._itemRemoving(i, !0)).on(e, "dropout", (t, i) => this._itemRemoving(i, !1));
|
|
4477
4488
|
}
|
|
4478
4489
|
return this;
|
|
4479
4490
|
}
|
|
@@ -4500,7 +4511,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
4500
4511
|
this._extraDragRow = 0, this._updateContainerHeight(), this._triggerChangeEvent(), this.engine.endUpdate(), h.type === "resizestop" && (Number.isInteger(e.sizeToContent) && (e.sizeToContent = e.h), this.doContentResize(!1, !0, e));
|
|
4501
4512
|
}
|
|
4502
4513
|
};
|
|
4503
|
-
|
|
4514
|
+
Q.draggable(t, {
|
|
4504
4515
|
start: n,
|
|
4505
4516
|
stop: a,
|
|
4506
4517
|
drag: u
|
|
@@ -4510,26 +4521,26 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
4510
4521
|
resize: u
|
|
4511
4522
|
}), e._initDD = !0;
|
|
4512
4523
|
}
|
|
4513
|
-
return
|
|
4524
|
+
return Q.draggable(t, i ? "disable" : "enable").resizable(t, s ? "disable" : "enable"), this;
|
|
4514
4525
|
}
|
|
4515
4526
|
/** @internal handles actual drag/resize start */
|
|
4516
4527
|
_onStartMoving(e, t, i, s, r, l) {
|
|
4517
|
-
this.engine.cleanNodes().beginUpdate(s), this._writePosAttr(this.placeholder, s), this.el.appendChild(this.placeholder), s.el = this.placeholder, s._lastUiPosition = i.position, s._prevYPix = i.position.top, s._moving = t.type === "dragstart", delete s._lastTried, t.type === "dropover" && s._temporaryRemoved && (this.engine.addNode(s), s._moving = !0), this.engine.cacheRects(r, l, this.opts.marginTop, this.opts.marginRight, this.opts.marginBottom, this.opts.marginLeft), t.type === "resizestart" && (
|
|
4528
|
+
this.engine.cleanNodes().beginUpdate(s), this._writePosAttr(this.placeholder, s), this.el.appendChild(this.placeholder), s.el = this.placeholder, s._lastUiPosition = i.position, s._prevYPix = i.position.top, s._moving = t.type === "dragstart", delete s._lastTried, t.type === "dropover" && s._temporaryRemoved && (this.engine.addNode(s), s._moving = !0), this.engine.cacheRects(r, l, this.opts.marginTop, this.opts.marginRight, this.opts.marginBottom, this.opts.marginLeft), t.type === "resizestart" && (Q.resizable(e, "option", "minWidth", r * (s.minW || 1)).resizable(e, "option", "minHeight", l * (s.minH || 1)), s.maxW && Q.resizable(e, "option", "maxWidth", r * s.maxW), s.maxH && Q.resizable(e, "option", "maxHeight", l * s.maxH));
|
|
4518
4529
|
}
|
|
4519
4530
|
/** @internal handles actual drag/resize */
|
|
4520
4531
|
_dragOrResize(e, t, i, s, r, l) {
|
|
4521
|
-
let n = { ...s._orig }, u, a = this.opts.marginLeft, h = this.opts.marginRight, p = this.opts.marginTop, d = this.opts.marginBottom,
|
|
4522
|
-
if (a = Math.min(a, v), h = Math.min(h, v), p = Math.min(p,
|
|
4532
|
+
let n = { ...s._orig }, u, a = this.opts.marginLeft, h = this.opts.marginRight, p = this.opts.marginTop, d = this.opts.marginBottom, _ = Math.round(l * 0.1), v = Math.round(r * 0.1);
|
|
4533
|
+
if (a = Math.min(a, v), h = Math.min(h, v), p = Math.min(p, _), d = Math.min(d, _), t.type === "drag") {
|
|
4523
4534
|
if (s._temporaryRemoved)
|
|
4524
4535
|
return;
|
|
4525
|
-
let
|
|
4526
|
-
s._prevYPix = i.position.top, this.opts.draggable.scroll !== !1 && f.updateScrollPosition(e, i.position,
|
|
4527
|
-
let
|
|
4528
|
-
n.x = Math.round(
|
|
4536
|
+
let H = i.position.top - s._prevYPix;
|
|
4537
|
+
s._prevYPix = i.position.top, this.opts.draggable.scroll !== !1 && f.updateScrollPosition(e, i.position, H);
|
|
4538
|
+
let C = i.position.left + (i.position.left > s._lastUiPosition.left ? -h : a), D = i.position.top + (i.position.top > s._lastUiPosition.top ? -d : p);
|
|
4539
|
+
n.x = Math.round(C / r), n.y = Math.round(D / l);
|
|
4529
4540
|
let S = this._extraDragRow;
|
|
4530
4541
|
if (this.engine.collide(s, n)) {
|
|
4531
|
-
let
|
|
4532
|
-
this.opts.maxRow &&
|
|
4542
|
+
let m = this.getRow(), y = Math.max(0, n.y + s.h - m);
|
|
4543
|
+
this.opts.maxRow && m + y > this.opts.maxRow && (y = Math.max(0, this.opts.maxRow - m)), this._extraDragRow = y;
|
|
4533
4544
|
} else
|
|
4534
4545
|
this._extraDragRow = 0;
|
|
4535
4546
|
if (this._extraDragRow !== S && this._updateContainerHeight(), s.x === n.x && s.y === n.y)
|
|
@@ -4537,20 +4548,20 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
4537
4548
|
} else if (t.type === "resize") {
|
|
4538
4549
|
if (n.x < 0 || (f.updateScrollResize(t, e, l), n.w = Math.round((i.size.width - a) / r), n.h = Math.round((i.size.height - p) / l), s.w === n.w && s.h === n.h) || s._lastTried && s._lastTried.w === n.w && s._lastTried.h === n.h)
|
|
4539
4550
|
return;
|
|
4540
|
-
let
|
|
4541
|
-
n.x = Math.round(
|
|
4551
|
+
let H = i.position.left + a, C = i.position.top + p;
|
|
4552
|
+
n.x = Math.round(H / r), n.y = Math.round(C / l), u = !0;
|
|
4542
4553
|
}
|
|
4543
4554
|
s._event = t, s._lastTried = n;
|
|
4544
|
-
let
|
|
4555
|
+
let L = {
|
|
4545
4556
|
x: i.position.left + a,
|
|
4546
4557
|
y: i.position.top + p,
|
|
4547
4558
|
w: (i.size ? i.size.width : s.w * r) - a - h,
|
|
4548
4559
|
h: (i.size ? i.size.height : s.h * l) - p - d
|
|
4549
4560
|
};
|
|
4550
|
-
if (this.engine.moveNodeCheck(s, { ...n, cellWidth: r, cellHeight: l, rect:
|
|
4561
|
+
if (this.engine.moveNodeCheck(s, { ...n, cellWidth: r, cellHeight: l, rect: L, resizing: u })) {
|
|
4551
4562
|
s._lastUiPosition = i.position, this.engine.cacheRects(r, l, p, h, d, a), delete s._skipDown, u && s.subGrid && s.subGrid.onResize(), this._extraDragRow = 0, this._updateContainerHeight();
|
|
4552
|
-
let
|
|
4553
|
-
this._writePosAttr(
|
|
4563
|
+
let H = t.target;
|
|
4564
|
+
this._writePosAttr(H, s), this._gsEventHandler[t.type] && this._gsEventHandler[t.type](t, H);
|
|
4554
4565
|
}
|
|
4555
4566
|
}
|
|
4556
4567
|
/** @internal called when item leaving our area by either cursor dropout event
|
|
@@ -4559,44 +4570,44 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
4559
4570
|
*/
|
|
4560
4571
|
_leave(e, t) {
|
|
4561
4572
|
let i = e.gridstackNode;
|
|
4562
|
-
i && (
|
|
4573
|
+
i && (Q.off(e, "drag"), !i._temporaryRemoved && (i._temporaryRemoved = !0, this.engine.removeNode(i), i.el = i._isExternal && t ? t : e, this.opts.removable === !0 && this._itemRemoving(e, !0), e._gridstackNodeOrig ? (e.gridstackNode = e._gridstackNodeOrig, delete e._gridstackNodeOrig) : i._isExternal && (delete i.el, delete e.gridstackNode, this.engine.restoreInitial())));
|
|
4563
4574
|
}
|
|
4564
4575
|
// legacy method removed
|
|
4565
4576
|
commit() {
|
|
4566
|
-
return
|
|
4577
|
+
return xn(this, this.batchUpdate(!1), "commit", "batchUpdate", "5.2"), this;
|
|
4567
4578
|
}
|
|
4568
4579
|
}
|
|
4569
|
-
|
|
4570
|
-
|
|
4571
|
-
|
|
4572
|
-
|
|
4573
|
-
const
|
|
4580
|
+
T.resizeToContentParent = ".grid-stack-item-content";
|
|
4581
|
+
T.Utils = f;
|
|
4582
|
+
T.Engine = be;
|
|
4583
|
+
T.GDRev = "9.5.1";
|
|
4584
|
+
const Sn = { class: "tw-flex tw-flex-row tw-flex-wrap tw-gap-2" }, Cn = { class: "color-primary" }, An = { class: "color-secondary" }, Dn = {
|
|
4574
4585
|
key: 1,
|
|
4575
4586
|
class: "empty"
|
|
4576
|
-
},
|
|
4587
|
+
}, Ln = {
|
|
4577
4588
|
key: 0,
|
|
4578
4589
|
class: "clear-filter-div"
|
|
4579
|
-
},
|
|
4590
|
+
}, zn = /* @__PURE__ */ we({
|
|
4580
4591
|
__name: "Filter",
|
|
4581
4592
|
props: {
|
|
4582
4593
|
order: {},
|
|
4583
4594
|
exclude: {}
|
|
4584
4595
|
},
|
|
4585
4596
|
setup(o) {
|
|
4586
|
-
const e = o, t = nt(), i =
|
|
4597
|
+
const e = o, t = nt(), i = Ce(() => ({ ...t.Filters })), s = Ce(() => {
|
|
4587
4598
|
const a = i.value;
|
|
4588
4599
|
return Object.keys(a).map((h) => ({ key: h, value: a[h] })).filter(({ value: h }) => !(h == null || typeof h == "string" && h.trim() === "" || Array.isArray(h) && h.length === 0));
|
|
4589
|
-
}), r =
|
|
4600
|
+
}), r = Ce(() => {
|
|
4590
4601
|
var p;
|
|
4591
4602
|
const a = new Set(e.exclude ?? []), h = s.value.filter((d) => !a.has(d.key));
|
|
4592
4603
|
if ((p = e.order) != null && p.length) {
|
|
4593
|
-
const d = new Map(e.order.map((
|
|
4594
|
-
h.sort((
|
|
4595
|
-
const
|
|
4596
|
-
return
|
|
4604
|
+
const d = new Map(e.order.map((_, v) => [_, v]));
|
|
4605
|
+
h.sort((_, v) => {
|
|
4606
|
+
const L = d.has(_.key) ? d.get(_.key) : Number.MAX_SAFE_INTEGER, H = d.has(v.key) ? d.get(v.key) : Number.MAX_SAFE_INTEGER;
|
|
4607
|
+
return L - H || _.key.localeCompare(v.key);
|
|
4597
4608
|
});
|
|
4598
4609
|
} else
|
|
4599
|
-
h.sort((d,
|
|
4610
|
+
h.sort((d, _) => d.key.localeCompare(_.key));
|
|
4600
4611
|
return h;
|
|
4601
4612
|
});
|
|
4602
4613
|
function l(a) {
|
|
@@ -4611,30 +4622,30 @@ const Rn = { class: "tw-flex tw-flex-row tw-flex-wrap tw-gap-2" }, Sn = { class:
|
|
|
4611
4622
|
}
|
|
4612
4623
|
return (a, h) => {
|
|
4613
4624
|
const p = ie("el-icon"), d = ie("el-row");
|
|
4614
|
-
return
|
|
4625
|
+
return R(), ae(d, {
|
|
4615
4626
|
class: "filter-wrapper tw-m-1",
|
|
4616
4627
|
align: "middle",
|
|
4617
4628
|
justify: "space-between"
|
|
4618
4629
|
}, {
|
|
4619
4630
|
default: q(() => [
|
|
4620
|
-
|
|
4621
|
-
r.value.length ? (
|
|
4631
|
+
z("div", Sn, [
|
|
4632
|
+
r.value.length ? (R(!0), $(ze, { key: 0 }, it(r.value, (_) => (R(), ae(ue(Zs), {
|
|
4622
4633
|
class: "color-background",
|
|
4623
|
-
key:
|
|
4634
|
+
key: _.key,
|
|
4624
4635
|
closable: "",
|
|
4625
|
-
onClose: (v) => n(
|
|
4636
|
+
onClose: (v) => n(_.key),
|
|
4626
4637
|
effect: "dark",
|
|
4627
4638
|
type: "info"
|
|
4628
4639
|
}, {
|
|
4629
4640
|
default: q(() => [
|
|
4630
|
-
|
|
4631
|
-
|
|
4641
|
+
z("b", Cn, Ae(_.key) + ": ", 1),
|
|
4642
|
+
z("span", An, Ae(l(_.value)), 1)
|
|
4632
4643
|
]),
|
|
4633
4644
|
_: 2
|
|
4634
|
-
}, 1032, ["onClose"]))), 128)) : (
|
|
4645
|
+
}, 1032, ["onClose"]))), 128)) : (R(), $("span", Dn))
|
|
4635
4646
|
]),
|
|
4636
|
-
r.value.length ? (
|
|
4637
|
-
X(
|
|
4647
|
+
r.value.length ? (R(), $("div", Ln, [
|
|
4648
|
+
X(ue(hs), {
|
|
4638
4649
|
placement: "top-start",
|
|
4639
4650
|
content: "Clear All Filters"
|
|
4640
4651
|
}, {
|
|
@@ -4644,26 +4655,26 @@ const Rn = { class: "tw-flex tw-flex-row tw-flex-wrap tw-gap-2" }, Sn = { class:
|
|
|
4644
4655
|
onClick: u
|
|
4645
4656
|
}, {
|
|
4646
4657
|
default: q(() => [
|
|
4647
|
-
X(
|
|
4658
|
+
X(ue(Js))
|
|
4648
4659
|
]),
|
|
4649
4660
|
_: 1
|
|
4650
4661
|
})
|
|
4651
4662
|
]),
|
|
4652
4663
|
_: 1
|
|
4653
4664
|
})
|
|
4654
|
-
])) :
|
|
4665
|
+
])) : kt("", !0)
|
|
4655
4666
|
]),
|
|
4656
4667
|
_: 1
|
|
4657
4668
|
});
|
|
4658
4669
|
};
|
|
4659
4670
|
}
|
|
4660
|
-
}),
|
|
4671
|
+
}), Nn = /* @__PURE__ */ Me(zn, [["__scopeId", "data-v-3487ec9b"]]), Mn = {
|
|
4661
4672
|
key: 0,
|
|
4662
4673
|
class: "content-header dash-header-visible stick-to-top tw-flex tw-flex-row tw-items-center tw-justify-between tw-h-10"
|
|
4663
|
-
},
|
|
4674
|
+
}, In = { class: "editing-div" }, Hn = { class: "tw-m-4 tw-leading-none tw-pl-1 widget-name" }, On = { class: "header-slot-icon" }, Pn = {
|
|
4664
4675
|
key: 1,
|
|
4665
4676
|
class: "dash-header-hide content-header"
|
|
4666
|
-
},
|
|
4677
|
+
}, $n = { class: "header-slot-icon" }, Bn = {
|
|
4667
4678
|
__name: "DashHeader",
|
|
4668
4679
|
props: {
|
|
4669
4680
|
widgetName: {
|
|
@@ -4678,11 +4689,11 @@ const Rn = { class: "tw-flex tw-flex-row tw-flex-wrap tw-gap-2" }, Sn = { class:
|
|
|
4678
4689
|
hideHeader: Boolean
|
|
4679
4690
|
},
|
|
4680
4691
|
setup(o) {
|
|
4681
|
-
const e = nt(), t = o, i =
|
|
4682
|
-
|
|
4692
|
+
const e = nt(), t = o, i = B(null);
|
|
4693
|
+
ce(() => t.widgetName, (u) => {
|
|
4683
4694
|
i.value = u;
|
|
4684
4695
|
}, { immediate: !0 });
|
|
4685
|
-
const s =
|
|
4696
|
+
const s = B(!1), r = B(null);
|
|
4686
4697
|
function l() {
|
|
4687
4698
|
s.value = !0, r.value && r.value.focus();
|
|
4688
4699
|
}
|
|
@@ -4694,18 +4705,18 @@ const Rn = { class: "tw-flex tw-flex-row tw-flex-wrap tw-gap-2" }, Sn = { class:
|
|
|
4694
4705
|
u.componentName = i;
|
|
4695
4706
|
}
|
|
4696
4707
|
return (u, a) => {
|
|
4697
|
-
const h = ie("el-input"), p =
|
|
4698
|
-
return o.hideHeader ? (
|
|
4699
|
-
|
|
4700
|
-
|
|
4708
|
+
const h = ie("el-input"), p = ls("click-out");
|
|
4709
|
+
return o.hideHeader ? (R(), $("div", Pn, [
|
|
4710
|
+
z("div", $n, [
|
|
4711
|
+
wt(u.$slots, "default", {}, void 0, !0)
|
|
4701
4712
|
])
|
|
4702
|
-
])) : (
|
|
4703
|
-
|
|
4704
|
-
|
|
4705
|
-
onKeyup:
|
|
4713
|
+
])) : (R(), $("div", Mn, [
|
|
4714
|
+
z("div", null, [
|
|
4715
|
+
Le((R(), $("div", {
|
|
4716
|
+
onKeyup: as(n, ["enter"]),
|
|
4706
4717
|
class: "tw-flex"
|
|
4707
4718
|
}, [
|
|
4708
|
-
|
|
4719
|
+
Le(z("div", In, [
|
|
4709
4720
|
X(h, {
|
|
4710
4721
|
onFocus: a[0] || (a[0] = (d) => d.target.select()),
|
|
4711
4722
|
ref_key: "textUserInput",
|
|
@@ -4714,27 +4725,27 @@ const Rn = { class: "tw-flex tw-flex-row tw-flex-wrap tw-gap-2" }, Sn = { class:
|
|
|
4714
4725
|
"onUpdate:modelValue": a[1] || (a[1] = (d) => i.value = d)
|
|
4715
4726
|
}, null, 8, ["modelValue"])
|
|
4716
4727
|
], 512), [
|
|
4717
|
-
[
|
|
4728
|
+
[xt, s.value]
|
|
4718
4729
|
]),
|
|
4719
|
-
|
|
4730
|
+
Le(z("div", {
|
|
4720
4731
|
onClick: a[2] || (a[2] = (d) => l()),
|
|
4721
4732
|
class: "visible-div"
|
|
4722
4733
|
}, [
|
|
4723
|
-
|
|
4734
|
+
z("div", Hn, Ae(i.value), 1)
|
|
4724
4735
|
], 512), [
|
|
4725
|
-
[
|
|
4736
|
+
[xt, !s.value]
|
|
4726
4737
|
])
|
|
4727
4738
|
], 32)), [
|
|
4728
4739
|
[p, n]
|
|
4729
4740
|
])
|
|
4730
4741
|
]),
|
|
4731
|
-
|
|
4732
|
-
|
|
4742
|
+
z("div", On, [
|
|
4743
|
+
wt(u.$slots, "default", {}, void 0, !0)
|
|
4733
4744
|
])
|
|
4734
4745
|
]));
|
|
4735
4746
|
};
|
|
4736
4747
|
}
|
|
4737
|
-
},
|
|
4748
|
+
}, Un = /* @__PURE__ */ Me(Bn, [["__scopeId", "data-v-4f4aa869"]]), Fn = { class: "tw-flex" }, Wn = {
|
|
4738
4749
|
__name: "WidgetWrapper",
|
|
4739
4750
|
props: {
|
|
4740
4751
|
widgetID: {
|
|
@@ -4766,13 +4777,13 @@ const Rn = { class: "tw-flex tw-flex-row tw-flex-wrap tw-gap-2" }, Sn = { class:
|
|
|
4766
4777
|
emits: ["removeWidget", "toggle-lock"],
|
|
4767
4778
|
setup(o, { emit: e }) {
|
|
4768
4779
|
const t = e, i = o;
|
|
4769
|
-
let s =
|
|
4770
|
-
const r =
|
|
4771
|
-
|
|
4780
|
+
let s = B(null);
|
|
4781
|
+
const r = B(!1);
|
|
4782
|
+
ce(() => i.isLocked, (u) => {
|
|
4772
4783
|
r.value = u;
|
|
4773
4784
|
}, { immediate: !0 });
|
|
4774
|
-
const l =
|
|
4775
|
-
|
|
4785
|
+
const l = B(null);
|
|
4786
|
+
ce(() => i.hideWidgetsHeader, (u) => {
|
|
4776
4787
|
l.value = u;
|
|
4777
4788
|
}, { immediate: !0 });
|
|
4778
4789
|
function n() {
|
|
@@ -4783,12 +4794,12 @@ const Rn = { class: "tw-flex tw-flex-row tw-flex-wrap tw-gap-2" }, Sn = { class:
|
|
|
4783
4794
|
}
|
|
4784
4795
|
return (u, a) => {
|
|
4785
4796
|
const h = ie("el-icon");
|
|
4786
|
-
return
|
|
4797
|
+
return R(), $("div", {
|
|
4787
4798
|
ref_key: "instance",
|
|
4788
4799
|
ref: s,
|
|
4789
4800
|
class: Ws(["grid-stack-item-content", { "locked-widget": o.isLocked }])
|
|
4790
4801
|
}, [
|
|
4791
|
-
(
|
|
4802
|
+
(R(), ae(Fi(o.componentTag), li({
|
|
4792
4803
|
class: ["widget-body", { "widget-body-no-head": l.value }],
|
|
4793
4804
|
widgetID: o.widgetID,
|
|
4794
4805
|
hideHeader: l.value
|
|
@@ -4797,7 +4808,7 @@ const Rn = { class: "tw-flex tw-flex-row tw-flex-wrap tw-gap-2" }, Sn = { class:
|
|
|
4797
4808
|
isLocked: r.value
|
|
4798
4809
|
}), {
|
|
4799
4810
|
default: q((p) => [
|
|
4800
|
-
p ? (
|
|
4811
|
+
p ? (R(), ae(Un, {
|
|
4801
4812
|
key: 0,
|
|
4802
4813
|
widgetName: i.componentName,
|
|
4803
4814
|
widgetID: o.widgetID,
|
|
@@ -4805,13 +4816,13 @@ const Rn = { class: "tw-flex tw-flex-row tw-flex-wrap tw-gap-2" }, Sn = { class:
|
|
|
4805
4816
|
hideHeader: l.value
|
|
4806
4817
|
}, {
|
|
4807
4818
|
default: q(() => [
|
|
4808
|
-
|
|
4809
|
-
(
|
|
4819
|
+
z("div", Fn, [
|
|
4820
|
+
(R(!0), $(ze, null, it(p.childIcons, (d) => (R(), ae(ue(hs), { placement: "bottom-start" }, {
|
|
4810
4821
|
content: q(() => [
|
|
4811
|
-
We(
|
|
4822
|
+
We(Ae(d.tooltip), 1)
|
|
4812
4823
|
]),
|
|
4813
4824
|
default: q(() => [
|
|
4814
|
-
(
|
|
4825
|
+
(R(), ae(Fi(d.comp), {
|
|
4815
4826
|
class: "tw-w-4 header-icon",
|
|
4816
4827
|
onClick: d.event
|
|
4817
4828
|
}, null, 8, ["onClick"]))
|
|
@@ -4823,51 +4834,51 @@ const Rn = { class: "tw-flex tw-flex-row tw-flex-wrap tw-gap-2" }, Sn = { class:
|
|
|
4823
4834
|
onClick: a[0] || (a[0] = (d) => n())
|
|
4824
4835
|
}, {
|
|
4825
4836
|
default: q(() => [
|
|
4826
|
-
r.value ? (
|
|
4837
|
+
r.value ? (R(), ae(ue(rr), { key: 0 })) : (R(), ae(ue(or), { key: 1 }))
|
|
4827
4838
|
]),
|
|
4828
4839
|
_: 1
|
|
4829
4840
|
}),
|
|
4830
|
-
!o.staticMode && !o.isLocked ? (
|
|
4841
|
+
!o.staticMode && !o.isLocked ? (R(), ae(h, {
|
|
4831
4842
|
key: 0,
|
|
4832
4843
|
class: "item-widget-button",
|
|
4833
4844
|
onClick: a[1] || (a[1] = (d) => u.$emit("removeWidget"))
|
|
4834
4845
|
}, {
|
|
4835
4846
|
default: q(() => [
|
|
4836
|
-
X(
|
|
4847
|
+
X(ue(tr))
|
|
4837
4848
|
]),
|
|
4838
4849
|
_: 1
|
|
4839
|
-
})) :
|
|
4850
|
+
})) : kt("", !0)
|
|
4840
4851
|
])
|
|
4841
4852
|
]),
|
|
4842
4853
|
_: 2
|
|
4843
|
-
}, 1032, ["widgetName", "widgetID", "staticMode", "hideHeader"])) :
|
|
4854
|
+
}, 1032, ["widgetName", "widgetID", "staticMode", "hideHeader"])) : kt("", !0)
|
|
4844
4855
|
]),
|
|
4845
4856
|
_: 1
|
|
4846
4857
|
}, 16, ["class", "widgetID", "hideHeader", "style", "isLocked"]))
|
|
4847
4858
|
], 2);
|
|
4848
4859
|
};
|
|
4849
4860
|
}
|
|
4850
|
-
},
|
|
4861
|
+
}, Gn = /* @__PURE__ */ Me(Wn, [["__scopeId", "data-v-a2daf4ac"]]), Vn = { class: "dashboard-app" }, qn = {
|
|
4851
4862
|
key: 0,
|
|
4852
4863
|
class: "dash-header tw-max-h-screen tw-flex tw-flex-col"
|
|
4853
|
-
},
|
|
4864
|
+
}, jn = { class: "tw-float-left tw-m-1 button" }, Yn = {
|
|
4854
4865
|
key: 1,
|
|
4855
4866
|
class: "tw-h-10 dash-header"
|
|
4856
|
-
},
|
|
4867
|
+
}, Xn = { class: "tw-float-left tw-m-1" }, Kn = { class: "tw-m-4 tw-w-40" }, Zn = ["gs-x", "gs-y", "gs-w", "gs-h", "gs-id", "id", "props", "gs-locked", "gs-no-move", "gs-no-resize"], Qn = /* @__PURE__ */ we({
|
|
4857
4868
|
__name: "Dashboard",
|
|
4858
4869
|
props: {
|
|
4859
4870
|
hideHeader: {},
|
|
4860
4871
|
options: {}
|
|
4861
4872
|
},
|
|
4862
4873
|
setup(o) {
|
|
4863
|
-
const e = o, t = nt(), { DASHBOARD_ITEMS: i } =
|
|
4864
|
-
apiUrl:
|
|
4865
|
-
var
|
|
4866
|
-
return (
|
|
4874
|
+
const e = o, t = nt(), { DASHBOARD_ITEMS: i } = ti(t), s = {
|
|
4875
|
+
apiUrl: Ce(() => {
|
|
4876
|
+
var m;
|
|
4877
|
+
return (m = t.Services) == null ? void 0 : m.ApiUrl;
|
|
4867
4878
|
}),
|
|
4868
|
-
s3Url:
|
|
4869
|
-
var
|
|
4870
|
-
return (
|
|
4879
|
+
s3Url: Ce(() => {
|
|
4880
|
+
var m;
|
|
4881
|
+
return (m = t.Services) == null ? void 0 : m.s3Url;
|
|
4871
4882
|
}),
|
|
4872
4883
|
filters: t.Filters,
|
|
4873
4884
|
setFilter: t.setFilter,
|
|
@@ -4875,22 +4886,22 @@ const Rn = { class: "tw-flex tw-flex-row tw-flex-wrap tw-gap-2" }, Sn = { class:
|
|
|
4875
4886
|
resetFilters: t.resetFilters
|
|
4876
4887
|
};
|
|
4877
4888
|
Gs("dashboard:globalVars", s);
|
|
4878
|
-
let r =
|
|
4879
|
-
const
|
|
4880
|
-
let u =
|
|
4881
|
-
const h =
|
|
4889
|
+
let r = B("Edit Grid"), l = null;
|
|
4890
|
+
const n = B(null);
|
|
4891
|
+
let u = B(!0), a = 0;
|
|
4892
|
+
const h = B([]), { ComponentRegistry: p } = ti(t), d = ns({});
|
|
4882
4893
|
Vs(() => {
|
|
4883
|
-
var
|
|
4884
|
-
|
|
4894
|
+
var m;
|
|
4895
|
+
_(), t.loadFromLocalStorage(), a = ((m = i.value) == null ? void 0 : m.length) + 1;
|
|
4885
4896
|
}), qs(() => {
|
|
4886
|
-
v(),
|
|
4887
|
-
});
|
|
4888
|
-
function
|
|
4889
|
-
var
|
|
4890
|
-
t.DefaultLayout = (
|
|
4897
|
+
v(), L();
|
|
4898
|
+
}), js(() => t.unregisterGridProvider());
|
|
4899
|
+
function _() {
|
|
4900
|
+
var m, y;
|
|
4901
|
+
t.DefaultLayout = (m = e.options) == null ? void 0 : m.defaultLayout, t.setOptionServices((y = e.options) == null ? void 0 : y.services);
|
|
4891
4902
|
}
|
|
4892
4903
|
function v() {
|
|
4893
|
-
const
|
|
4904
|
+
const m = {
|
|
4894
4905
|
float: !0,
|
|
4895
4906
|
column: 12,
|
|
4896
4907
|
cellHeight: "70px",
|
|
@@ -4901,118 +4912,117 @@ const Rn = { class: "tw-flex tw-flex-row tw-flex-wrap tw-gap-2" }, Sn = { class:
|
|
|
4901
4912
|
handles: "e,se,s,sw,w,n"
|
|
4902
4913
|
}
|
|
4903
4914
|
};
|
|
4904
|
-
l
|
|
4915
|
+
l = T.init(m), t.registerGridProvider(() => l), l.setStatic(u.value);
|
|
4905
4916
|
}
|
|
4906
|
-
|
|
4917
|
+
ce(
|
|
4907
4918
|
() => {
|
|
4908
|
-
var
|
|
4909
|
-
return (
|
|
4919
|
+
var m;
|
|
4920
|
+
return (m = e.options) == null ? void 0 : m.availableWidgets;
|
|
4910
4921
|
},
|
|
4911
|
-
(
|
|
4912
|
-
p.value = {}, h.value = [],
|
|
4913
|
-
let
|
|
4922
|
+
(m) => {
|
|
4923
|
+
p.value = {}, h.value = [], m && m.forEach((y, P) => {
|
|
4924
|
+
let U, pe;
|
|
4914
4925
|
if (y && typeof y == "object" && "name" in y && "component" in y)
|
|
4915
|
-
|
|
4926
|
+
U = y.name, pe = y.component;
|
|
4916
4927
|
else if (y && typeof y == "object" && "name" in y && "loader" in y)
|
|
4917
|
-
|
|
4918
|
-
const
|
|
4919
|
-
return
|
|
4928
|
+
U = y.name, pe = Ys(async () => {
|
|
4929
|
+
const me = await y.loader();
|
|
4930
|
+
return me.default ?? me;
|
|
4920
4931
|
});
|
|
4921
4932
|
else if (y && (typeof y == "function" || typeof y == "object"))
|
|
4922
|
-
|
|
4933
|
+
pe = y, U = y.name || `Widget${P + 1}`;
|
|
4923
4934
|
else if (typeof y == "function")
|
|
4924
4935
|
return;
|
|
4925
|
-
|
|
4936
|
+
!U || !pe || p.value[U] || (p.value[U] = pe, h.value.push(U));
|
|
4926
4937
|
});
|
|
4927
4938
|
},
|
|
4928
4939
|
{ immediate: !0, deep: !0 }
|
|
4929
4940
|
);
|
|
4930
|
-
function
|
|
4931
|
-
const
|
|
4932
|
-
if (
|
|
4941
|
+
function L() {
|
|
4942
|
+
const m = e.options.globalData;
|
|
4943
|
+
if (m) {
|
|
4933
4944
|
t.clearOptionsDataItems();
|
|
4934
|
-
for (const y in
|
|
4935
|
-
t.addOptionsDataItems(y,
|
|
4945
|
+
for (const y in m)
|
|
4946
|
+
t.addOptionsDataItems(y, m[y]);
|
|
4936
4947
|
}
|
|
4937
4948
|
}
|
|
4938
|
-
|
|
4939
|
-
l.
|
|
4949
|
+
ce(() => u.value, (m) => {
|
|
4950
|
+
l.setStatic(m), r.value = m ? "Edit Grid" : "Save Grid";
|
|
4940
4951
|
});
|
|
4941
|
-
function
|
|
4942
|
-
if (!
|
|
4952
|
+
function H(m) {
|
|
4953
|
+
if (!m)
|
|
4943
4954
|
return;
|
|
4944
|
-
const y = `${
|
|
4955
|
+
const y = `${m}-${a}`, P = {
|
|
4945
4956
|
id: y,
|
|
4946
4957
|
w: 2,
|
|
4947
4958
|
h: 6,
|
|
4948
4959
|
autoPosition: !0,
|
|
4949
|
-
component: p.value[
|
|
4950
|
-
componentKey:
|
|
4951
|
-
componentName:
|
|
4960
|
+
component: p.value[m],
|
|
4961
|
+
componentKey: m,
|
|
4962
|
+
componentName: m,
|
|
4952
4963
|
Props: {}
|
|
4953
4964
|
};
|
|
4954
|
-
a++, i.value.push(P),
|
|
4955
|
-
|
|
4956
|
-
($ = l.value) == null || $.makeWidget(`#${y}`);
|
|
4965
|
+
a++, i.value.push(P), Xs(() => {
|
|
4966
|
+
l == null || l.makeWidget(`#${y}`);
|
|
4957
4967
|
});
|
|
4958
4968
|
}
|
|
4959
|
-
function
|
|
4960
|
-
var y = i.value.findIndex((
|
|
4969
|
+
function C(m) {
|
|
4970
|
+
var y = i.value.findIndex((U) => U.id == m);
|
|
4961
4971
|
i.value.splice(y, 1);
|
|
4962
|
-
const P = `#${
|
|
4963
|
-
l.
|
|
4972
|
+
const P = `#${m}`;
|
|
4973
|
+
l.removeWidget(P, !1);
|
|
4964
4974
|
}
|
|
4965
|
-
function
|
|
4966
|
-
const P = d[
|
|
4967
|
-
P && l
|
|
4975
|
+
function D({ id: m, isLocked: y }) {
|
|
4976
|
+
const P = d[m];
|
|
4977
|
+
P && l && l.update(P, {
|
|
4968
4978
|
locked: !y,
|
|
4969
4979
|
noMove: !y,
|
|
4970
4980
|
noResize: !y
|
|
4971
|
-
}), t.toggleWidgetLock(
|
|
4981
|
+
}), t.toggleWidgetLock(m);
|
|
4972
4982
|
}
|
|
4973
4983
|
function S() {
|
|
4974
4984
|
u.value = !u.value, u.value && t.saveToLocalStorage();
|
|
4975
4985
|
}
|
|
4976
|
-
return (
|
|
4977
|
-
const P = ie("el-button"),
|
|
4978
|
-
return
|
|
4979
|
-
|
|
4986
|
+
return (m, y) => {
|
|
4987
|
+
const P = ie("el-button"), U = ie("el-option"), pe = ie("el-select"), me = ie("el-col");
|
|
4988
|
+
return R(), $("div", Vn, [
|
|
4989
|
+
m.hideHeader ? (R(), $("div", Yn, [
|
|
4980
4990
|
y[2] || (y[2] = We("x ", -1)),
|
|
4981
|
-
|
|
4991
|
+
z("span", Xn, [
|
|
4982
4992
|
X(P, {
|
|
4983
4993
|
class: "edit-button",
|
|
4984
|
-
onClick: y[1] || (y[1] = (
|
|
4994
|
+
onClick: y[1] || (y[1] = (N) => S())
|
|
4985
4995
|
}, {
|
|
4986
4996
|
default: q(() => [
|
|
4987
|
-
We(
|
|
4997
|
+
We(Ae(ue(r)), 1)
|
|
4988
4998
|
]),
|
|
4989
4999
|
_: 1
|
|
4990
5000
|
})
|
|
4991
5001
|
])
|
|
4992
|
-
])) : (
|
|
4993
|
-
|
|
5002
|
+
])) : (R(), $("div", qn, [
|
|
5003
|
+
z("span", jn, [
|
|
4994
5004
|
X(P, {
|
|
4995
5005
|
class: "edit-button",
|
|
4996
|
-
onClick: y[0] || (y[0] = (
|
|
5006
|
+
onClick: y[0] || (y[0] = (N) => S())
|
|
4997
5007
|
}, {
|
|
4998
5008
|
default: q(() => [
|
|
4999
|
-
We(
|
|
5009
|
+
We(Ae(ue(r)), 1)
|
|
5000
5010
|
]),
|
|
5001
5011
|
_: 1
|
|
5002
5012
|
})
|
|
5003
5013
|
]),
|
|
5004
|
-
X(
|
|
5014
|
+
X(Nn)
|
|
5005
5015
|
])),
|
|
5006
|
-
|
|
5016
|
+
ue(u) ? kt("", !0) : (R(), ae(me, { key: 2 }, {
|
|
5007
5017
|
default: q(() => [
|
|
5008
|
-
|
|
5009
|
-
X(
|
|
5018
|
+
z("div", Kn, [
|
|
5019
|
+
X(pe, { placeholder: "Add New Widget" }, {
|
|
5010
5020
|
default: q(() => [
|
|
5011
|
-
(
|
|
5012
|
-
key:
|
|
5013
|
-
label:
|
|
5014
|
-
value:
|
|
5015
|
-
onClick: (
|
|
5021
|
+
(R(!0), $(ze, null, it(h.value, (N) => (R(), ae(U, {
|
|
5022
|
+
key: N,
|
|
5023
|
+
label: N,
|
|
5024
|
+
value: N,
|
|
5025
|
+
onClick: (x) => H(N)
|
|
5016
5026
|
}, null, 8, ["label", "value", "onClick"]))), 128))
|
|
5017
5027
|
]),
|
|
5018
5028
|
_: 1
|
|
@@ -5021,49 +5031,49 @@ const Rn = { class: "tw-flex tw-flex-row tw-flex-wrap tw-gap-2" }, Sn = { class:
|
|
|
5021
5031
|
]),
|
|
5022
5032
|
_: 1
|
|
5023
5033
|
})),
|
|
5024
|
-
|
|
5034
|
+
z("div", {
|
|
5025
5035
|
ref_key: "root",
|
|
5026
5036
|
ref: n,
|
|
5027
5037
|
class: "grid-stack tw-h-screen"
|
|
5028
5038
|
}, [
|
|
5029
|
-
(
|
|
5030
|
-
var
|
|
5031
|
-
return
|
|
5039
|
+
(R(!0), $(ze, null, it(ue(i), (N) => {
|
|
5040
|
+
var x, E, K, W;
|
|
5041
|
+
return R(), $("div", {
|
|
5032
5042
|
class: "grid-stack-item",
|
|
5033
5043
|
ref_for: !0,
|
|
5034
|
-
ref: (
|
|
5035
|
-
"gs-x":
|
|
5036
|
-
"gs-y":
|
|
5037
|
-
"gs-w":
|
|
5038
|
-
"gs-h":
|
|
5039
|
-
"gs-id":
|
|
5040
|
-
id:
|
|
5041
|
-
key:
|
|
5042
|
-
props:
|
|
5043
|
-
"gs-locked": (
|
|
5044
|
-
"gs-no-move": (
|
|
5045
|
-
"gs-no-resize": (
|
|
5044
|
+
ref: (oe) => d[N.id] = oe,
|
|
5045
|
+
"gs-x": N.x,
|
|
5046
|
+
"gs-y": N.y,
|
|
5047
|
+
"gs-w": N.w,
|
|
5048
|
+
"gs-h": N.h,
|
|
5049
|
+
"gs-id": N.id,
|
|
5050
|
+
id: N.id,
|
|
5051
|
+
key: N.id,
|
|
5052
|
+
props: N.Props,
|
|
5053
|
+
"gs-locked": (x = N.Props) == null ? void 0 : x.locked,
|
|
5054
|
+
"gs-no-move": (E = N.Props) == null ? void 0 : E.locked,
|
|
5055
|
+
"gs-no-resize": (K = N.Props) == null ? void 0 : K.locked
|
|
5046
5056
|
}, [
|
|
5047
|
-
X(
|
|
5048
|
-
widgetID:
|
|
5049
|
-
onRemoveWidget: (
|
|
5050
|
-
onToggleLock:
|
|
5051
|
-
"static-mode":
|
|
5052
|
-
componentTag:
|
|
5053
|
-
componentProperties:
|
|
5054
|
-
componentName:
|
|
5055
|
-
hideWidgetsHeader:
|
|
5056
|
-
"is-locked": (
|
|
5057
|
+
X(Gn, {
|
|
5058
|
+
widgetID: N.id,
|
|
5059
|
+
onRemoveWidget: (oe) => C(N.id),
|
|
5060
|
+
onToggleLock: D,
|
|
5061
|
+
"static-mode": ue(u),
|
|
5062
|
+
componentTag: N.component,
|
|
5063
|
+
componentProperties: N.Props,
|
|
5064
|
+
componentName: N.componentName,
|
|
5065
|
+
hideWidgetsHeader: N.hideHeader,
|
|
5066
|
+
"is-locked": (W = N.Props) == null ? void 0 : W.locked
|
|
5057
5067
|
}, null, 8, ["widgetID", "onRemoveWidget", "static-mode", "componentTag", "componentProperties", "componentName", "hideWidgetsHeader", "is-locked"])
|
|
5058
|
-
], 8,
|
|
5068
|
+
], 8, Zn);
|
|
5059
5069
|
}), 128))
|
|
5060
5070
|
], 512)
|
|
5061
5071
|
]);
|
|
5062
5072
|
};
|
|
5063
5073
|
}
|
|
5064
|
-
}),
|
|
5074
|
+
}), no = /* @__PURE__ */ Me(Qn, [["__scopeId", "data-v-8526759f"]]);
|
|
5065
5075
|
export {
|
|
5066
|
-
|
|
5067
|
-
|
|
5068
|
-
|
|
5076
|
+
ro as MarkdownWidget,
|
|
5077
|
+
no as PennsieveDashboard,
|
|
5078
|
+
so as TextWidget
|
|
5069
5079
|
};
|