domquery-com 1.0.0
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/LICENSE +22 -0
- package/README.ko.md +273 -0
- package/README.md +272 -0
- package/domquery.js +6290 -0
- package/domquery.min.js +361 -0
- package/package.json +53 -0
- package/src/Kcolor.js +909 -0
- package/src/ajax.js +1220 -0
- package/src/alert.js +3516 -0
- package/src/animate.js +1775 -0
- package/src/lazyLoadImages.js +202 -0
- package/src/pulling.js +473 -0
- package/src/select.js +3154 -0
- package/src_min/Kcolor.min.js +45 -0
- package/src_min/ajax.min.js +61 -0
- package/src_min/alert.min.js +240 -0
- package/src_min/animate.min.js +118 -0
- package/src_min/lazyLoadImages.min.js +13 -0
- package/src_min/pulling.min.js +23 -0
- package/src_min/select.min.js +186 -0
package/src/alert.js
ADDED
|
@@ -0,0 +1,3516 @@
|
|
|
1
|
+
(function(g) {
|
|
2
|
+
const v = {
|
|
3
|
+
options: {},
|
|
4
|
+
observers: {},
|
|
5
|
+
rootElement: {
|
|
6
|
+
checked: !1,
|
|
7
|
+
element: null
|
|
8
|
+
},
|
|
9
|
+
closingAlerts: new Set,
|
|
10
|
+
callbackExecuting: !1
|
|
11
|
+
};
|
|
12
|
+
g.domQuery8Alert || (g.domQuery8Alert = {});
|
|
13
|
+
g.domQuery8Alert._internal = v;
|
|
14
|
+
const L = {
|
|
15
|
+
setTimeoutRAF: function(b, a) {
|
|
16
|
+
if (0 >= a) return requestAnimationFrame(b), null;
|
|
17
|
+
const p = performance.now();
|
|
18
|
+
let h;
|
|
19
|
+
const r = F => {
|
|
20
|
+
F - p >= a ? b() : h = requestAnimationFrame(r)
|
|
21
|
+
};
|
|
22
|
+
return h = requestAnimationFrame(r)
|
|
23
|
+
},
|
|
24
|
+
clearTimeoutRAF: function(b) {
|
|
25
|
+
b && cancelAnimationFrame(b)
|
|
26
|
+
},
|
|
27
|
+
nextFrame: function(b) {
|
|
28
|
+
return requestAnimationFrame(b)
|
|
29
|
+
},
|
|
30
|
+
afterFrames: function(b, a = 1) {
|
|
31
|
+
if (0 >= a) requestAnimationFrame(b);
|
|
32
|
+
else {
|
|
33
|
+
var p = 0,
|
|
34
|
+
h = () => {
|
|
35
|
+
p++;
|
|
36
|
+
p >= a ? b() : requestAnimationFrame(h)
|
|
37
|
+
};
|
|
38
|
+
requestAnimationFrame(h)
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
x = {
|
|
43
|
+
elementCache: new WeakMap,
|
|
44
|
+
allElementsCache: new WeakMap,
|
|
45
|
+
getElement: function(b, a) {
|
|
46
|
+
if (!b || !a) return null;
|
|
47
|
+
this.elementCache.has(b) || this.elementCache.set(b, {});
|
|
48
|
+
const p = this.elementCache.get(b);
|
|
49
|
+
a in p || (p[a] = b.querySelector(a));
|
|
50
|
+
return p[a]
|
|
51
|
+
},
|
|
52
|
+
getAllElements: function(b, a) {
|
|
53
|
+
if (!b || !a) return [];
|
|
54
|
+
this.allElementsCache.has(b) || this.allElementsCache.set(b, {});
|
|
55
|
+
const p =
|
|
56
|
+
this.allElementsCache.get(b);
|
|
57
|
+
a in p || (p[a] = Array.from(b.querySelectorAll(a)));
|
|
58
|
+
return p[a]
|
|
59
|
+
},
|
|
60
|
+
documentCache: {},
|
|
61
|
+
getDocumentElement: function(b) {
|
|
62
|
+
if (!b) return null;
|
|
63
|
+
b in this.documentCache || (this.documentCache[b] = document.querySelector(b));
|
|
64
|
+
return this.documentCache[b]
|
|
65
|
+
},
|
|
66
|
+
getAllDocumentElements: function(b) {
|
|
67
|
+
if (!b) return [];
|
|
68
|
+
const a = "all:" + b;
|
|
69
|
+
a in this.documentCache || (this.documentCache[a] = Array.from(document.querySelectorAll(b)));
|
|
70
|
+
return this.documentCache[a]
|
|
71
|
+
},
|
|
72
|
+
invalidate: function(b, a) {
|
|
73
|
+
b && this.elementCache.has(b) &&
|
|
74
|
+
delete this.elementCache.get(b)[a];
|
|
75
|
+
b && this.allElementsCache.has(b) && delete this.allElementsCache.get(b)[a]
|
|
76
|
+
},
|
|
77
|
+
invalidateDocument: function(b) {
|
|
78
|
+
delete this.documentCache[b];
|
|
79
|
+
delete this.documentCache["all:" + b]
|
|
80
|
+
},
|
|
81
|
+
clearParentCache: function(b) {
|
|
82
|
+
b && (this.elementCache.delete(b), this.allElementsCache.delete(b))
|
|
83
|
+
},
|
|
84
|
+
clearDocumentCache: function() {
|
|
85
|
+
this.documentCache = {}
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
$.AlertScrollManager = {
|
|
89
|
+
positions: {},
|
|
90
|
+
isUserScrolling: {},
|
|
91
|
+
lastScrollTime: {},
|
|
92
|
+
scrollStates: {},
|
|
93
|
+
savePosition: function(b, a) {
|
|
94
|
+
!b && a && (b = a.getAttribute("data-instance-id"));
|
|
95
|
+
if (b && a) {
|
|
96
|
+
a = [x.getElement(a, ".alert-scroll-wrapper"), x.getElement(a, ".domquery-alert-body"), a.querySelector('div[style*="overflow: auto"]'), a.querySelector('div[style*="overflow-y: auto"]'), a.querySelector('div[style*="overflow-y: scroll"]'), a].filter(p => null !== p);
|
|
97
|
+
for (const p of a)
|
|
98
|
+
if (p.scrollHeight > p.clientHeight) {
|
|
99
|
+
this.positions[b] = {
|
|
100
|
+
element: p,
|
|
101
|
+
position: p.scrollTop
|
|
102
|
+
};
|
|
103
|
+
break
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
scrollTo: function(b, a, p) {
|
|
108
|
+
if (!b) return !1;
|
|
109
|
+
b.scrollTo({
|
|
110
|
+
top: a,
|
|
111
|
+
behavior: "smooth"
|
|
112
|
+
});
|
|
113
|
+
return !0
|
|
114
|
+
},
|
|
115
|
+
restorePosition: function(b, a, p = 300) {
|
|
116
|
+
!b &&
|
|
117
|
+
a && (b = a.getAttribute("data-instance-id"));
|
|
118
|
+
if (!b || !a || !this.positions[b]) return !1;
|
|
119
|
+
const h = this.positions[b],
|
|
120
|
+
r = [x.getElement(a, ".alert-scroll-wrapper"), x.getElement(a, ".domquery-alert-body"), a.querySelector('div[style*="overflow: auto"]'), a.querySelector('div[style*="overflow-y: auto"]'), a.querySelector('div[style*="overflow-y: scroll"]'), a].filter(y => null !== y);
|
|
121
|
+
let F = 0;
|
|
122
|
+
const M = () => {
|
|
123
|
+
for (const y of r)
|
|
124
|
+
if (y.scrollHeight > y.clientHeight) return 0 < p ? this.scrollTo(y, h.position, p) : y.scrollTop = h.position, !0;
|
|
125
|
+
F++;
|
|
126
|
+
5 > F && setTimeout(M, 200);
|
|
127
|
+
return !1
|
|
128
|
+
};
|
|
129
|
+
return M()
|
|
130
|
+
},
|
|
131
|
+
clearPosition: function(b) {
|
|
132
|
+
return b && this.positions[b] ? (delete this.positions[b], !0) : !1
|
|
133
|
+
},
|
|
134
|
+
clearAll: function() {
|
|
135
|
+
this.positions = {};
|
|
136
|
+
return !0
|
|
137
|
+
},
|
|
138
|
+
scrollToBottom: function(b, a, p = !1) {
|
|
139
|
+
!b && a && (b = a.getAttribute("data-instance-id"));
|
|
140
|
+
if (!b || !a) return !1;
|
|
141
|
+
if (!p && !0 === this.isUserScrolling[b]) {
|
|
142
|
+
const h = Date.now();
|
|
143
|
+
if (this.lastScrollTime[b] && 3E3 > h - this.lastScrollTime[b]) return !1
|
|
144
|
+
}
|
|
145
|
+
if (!p && this.scrollStates[b] && this.scrollStates[b].thresholdExceeded) return !1;
|
|
146
|
+
b = [x.getElement(a, ".alert-scroll-wrapper"),
|
|
147
|
+
x.getElement(a, ".domquery-alert-body"), a.querySelector('div[style*="overflow: auto"]'), a.querySelector('div[style*="overflow-y: auto"]'), a.querySelector('div[style*="overflow-y: scroll"]'), a
|
|
148
|
+
].filter(h => null !== h);
|
|
149
|
+
for (const h of b)
|
|
150
|
+
if (h.scrollHeight > h.clientHeight) return h.scrollTop = h.scrollHeight, !0;
|
|
151
|
+
return !1
|
|
152
|
+
},
|
|
153
|
+
startUserScrolling: function(b) {
|
|
154
|
+
this.isUserScrolling[b] = !0;
|
|
155
|
+
this.lastScrollTime[b] = Date.now()
|
|
156
|
+
},
|
|
157
|
+
endUserScrolling: function(b, a = 1E3) {
|
|
158
|
+
L.setTimeoutRAF(() => {
|
|
159
|
+
this.isUserScrolling[b] = !1
|
|
160
|
+
}, a)
|
|
161
|
+
},
|
|
162
|
+
checkScrollThreshold: function(b,
|
|
163
|
+
a, p) {
|
|
164
|
+
if (b && a) {
|
|
165
|
+
a = [x.getElement(a, ".alert-scroll-wrapper"), x.getElement(a, ".domquery-alert-body"), a.querySelector('div[style*="overflow: auto"]'), a.querySelector('div[style*="overflow-y: auto"]'), a.querySelector('div[style*="overflow-y: scroll"]'), a].filter(r => null !== r);
|
|
166
|
+
for (var h of a)
|
|
167
|
+
if (h.scrollHeight > h.clientHeight) {
|
|
168
|
+
a = h.scrollHeight - h.scrollTop - h.clientHeight;
|
|
169
|
+
h = h.scrollHeight - h.clientHeight;
|
|
170
|
+
let r = 0;
|
|
171
|
+
"number" === typeof p ? r = p : "string" === typeof p && (p.endsWith("px") ? (r = parseInt(p, 10), isNaN(r) && (r = 0)) : p.endsWith("%") ?
|
|
172
|
+
(p = parseFloat(p), isNaN(p) || (r = p / 100 * h)) : isNaN(parseFloat(p)) || (r = parseFloat(p)));
|
|
173
|
+
this.scrollStates[b] ? this.scrollStates[b].threshold = r : this.scrollStates[b] = {
|
|
174
|
+
thresholdExceeded: !1,
|
|
175
|
+
threshold: r
|
|
176
|
+
};
|
|
177
|
+
this.scrollStates[b].thresholdExceeded = a > r ? !0 : !1;
|
|
178
|
+
break
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
};
|
|
183
|
+
$.scaleArr = function(b, a, p = 300) {
|
|
184
|
+
if (b && a) {
|
|
185
|
+
var h = "",
|
|
186
|
+
r = void 0;
|
|
187
|
+
void 0 !== a.LC ? (h = "LC", r = a.LC) : void 0 !== a.RC ? (h = "RC", r = a.RC) : void 0 !== a.TC ? (h = "TC", r = a.TC) : void 0 !== a.BC ? (h = "BC", r = a.BC) : void 0 !== a.TL ? (h = "TL", r = a.TL) : void 0 !== a.TR ? (h = "TR", r = a.TR) : void 0 !== a.BL ?
|
|
188
|
+
(h = "BL", r = a.BL) : void 0 !== a.BR && (h = "BR", r = a.BR);
|
|
189
|
+
b.style.position = "fixed";
|
|
190
|
+
b.style.willChange = "transform, opacity";
|
|
191
|
+
var F = "",
|
|
192
|
+
M = "",
|
|
193
|
+
y = !0 === ("undefined" !== typeof $ && $.isMobile ? $.isMobile() : {
|
|
194
|
+
isMobile: !1
|
|
195
|
+
}).isMobile,
|
|
196
|
+
K = () => {
|
|
197
|
+
if (y && g.visualViewport) {
|
|
198
|
+
b.style.opacity = String("number" === typeof a.opacity ? a.opacity : 1);
|
|
199
|
+
b.style.transition = "opacity 0.3s";
|
|
200
|
+
L.setTimeoutRAF(() => {
|
|
201
|
+
b.style.opacity = "1"
|
|
202
|
+
}, 1E3);
|
|
203
|
+
if (!0 === a.resize) {
|
|
204
|
+
const G = b.querySelectorAll('input:not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="checkbox"]):not([type="radio"]), textarea, select, [contenteditable="true"]');
|
|
205
|
+
let aa = g.visualViewport.height,
|
|
206
|
+
ia = !1,
|
|
207
|
+
ka = null,
|
|
208
|
+
ha = null;
|
|
209
|
+
var A = {
|
|
210
|
+
height: b.style.height,
|
|
211
|
+
maxHeight: b.style.maxHeight,
|
|
212
|
+
minHeight: b.style.minHeight,
|
|
213
|
+
overflow: b.style.overflow
|
|
214
|
+
},
|
|
215
|
+
T = null;
|
|
216
|
+
const Y = x.getElement(b, ".domquery-alert-body");
|
|
217
|
+
Y && (T = {
|
|
218
|
+
maxHeight: Y.style.maxHeight,
|
|
219
|
+
minHeight: Y.style.minHeight,
|
|
220
|
+
height: Y.style.height,
|
|
221
|
+
overflowY: Y.style.overflowY,
|
|
222
|
+
webkitOverflowScrolling: Y.style.webkitOverflowScrolling
|
|
223
|
+
});
|
|
224
|
+
const Ea = () => {
|
|
225
|
+
var c = b.getBoundingClientRect();
|
|
226
|
+
b.style.height = `${c.height}px`;
|
|
227
|
+
b.style.maxHeight = `${c.height}px`;
|
|
228
|
+
b.style.minHeight = `${c.height}px`;
|
|
229
|
+
Y && (c = Y.getBoundingClientRect(), Y.style.height = `${c.height}px`, Y.style.minHeight = `${c.height}px`)
|
|
230
|
+
};
|
|
231
|
+
L.setTimeoutRAF(Ea, 200);
|
|
232
|
+
const ra = () => {
|
|
233
|
+
ha && (clearTimeout(ha), ha = null);
|
|
234
|
+
Object.keys(A).forEach(c => {
|
|
235
|
+
b.style[c] = A[c]
|
|
236
|
+
});
|
|
237
|
+
Y && T && Object.keys(T).forEach(c => {
|
|
238
|
+
Y.style[c] = T[c]
|
|
239
|
+
});
|
|
240
|
+
L.setTimeoutRAF(Ea, 100);
|
|
241
|
+
ia = !1
|
|
242
|
+
},
|
|
243
|
+
Ba = () => {
|
|
244
|
+
var c = document.getElementById("keyboard-virtual-layer");
|
|
245
|
+
c && c.remove();
|
|
246
|
+
c = document.createElement("div");
|
|
247
|
+
c.id = "keyboard-virtual-layer";
|
|
248
|
+
c.style.cssText = `\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: transparent;\n z-index: ${parseInt(b.style.zIndex||
|
|
249
|
+
9999)+2};\n pointer-events: none;\n `;
|
|
250
|
+
const f = a.parent ? "string" === typeof a.parent ? document.querySelector(a.parent) : a.parent : document.body;
|
|
251
|
+
f ? f.appendChild(c) : document.body.appendChild(c);
|
|
252
|
+
return c
|
|
253
|
+
},
|
|
254
|
+
ya = () => {
|
|
255
|
+
try {
|
|
256
|
+
var c = document.getElementById("keyboard-transition-layer");
|
|
257
|
+
if (c) try {
|
|
258
|
+
c.remove()
|
|
259
|
+
} catch (l) {
|
|
260
|
+
c.parentNode && c.parentNode.removeChild(c)
|
|
261
|
+
}
|
|
262
|
+
c = "#ffffff";
|
|
263
|
+
var f = document.body;
|
|
264
|
+
let e = 10001;
|
|
265
|
+
try {
|
|
266
|
+
b && 1 === b.nodeType && (c = window.getComputedStyle(b).backgroundColor || "#ffffff")
|
|
267
|
+
} catch (l) {}
|
|
268
|
+
try {
|
|
269
|
+
if (a &&
|
|
270
|
+
a.parent)
|
|
271
|
+
if ("string" === typeof a.parent) {
|
|
272
|
+
const l = document.querySelector(a.parent);
|
|
273
|
+
l && (f = l)
|
|
274
|
+
} else a.parent instanceof Element && (f = a.parent)
|
|
275
|
+
} catch (l) {}
|
|
276
|
+
try {
|
|
277
|
+
if (b && b.style) {
|
|
278
|
+
const l = b.style.zIndex;
|
|
279
|
+
l && (e = parseInt(l) + 2)
|
|
280
|
+
}
|
|
281
|
+
} catch (l) {}
|
|
282
|
+
const d = document.createElement("div");
|
|
283
|
+
d.id = "keyboard-transition-layer";
|
|
284
|
+
d.style.position = "fixed";
|
|
285
|
+
d.style.top = "0";
|
|
286
|
+
d.style.left = "0";
|
|
287
|
+
d.style.width = "100%";
|
|
288
|
+
d.style.height = "100%";
|
|
289
|
+
d.style.backgroundColor = c;
|
|
290
|
+
d.style.opacity = "1";
|
|
291
|
+
d.style.transition = "opacity 0.3s ease";
|
|
292
|
+
d.style.zIndex = e.toString();
|
|
293
|
+
try {
|
|
294
|
+
f.appendChild(d)
|
|
295
|
+
} catch (l) {
|
|
296
|
+
document.body.appendChild(d)
|
|
297
|
+
}
|
|
298
|
+
return d
|
|
299
|
+
} catch (e) {
|
|
300
|
+
f = document.createElement("div");
|
|
301
|
+
f.style.display = "none";
|
|
302
|
+
try {
|
|
303
|
+
document.body.appendChild(f)
|
|
304
|
+
} catch (d) {}
|
|
305
|
+
return f
|
|
306
|
+
}
|
|
307
|
+
},
|
|
308
|
+
Aa = () => {
|
|
309
|
+
const c = g.visualViewport.height;
|
|
310
|
+
ha && L.clearTimeoutRAF(ha);
|
|
311
|
+
ha = L.setTimeoutRAF(() => {
|
|
312
|
+
if (c < aa - 50 && !ia) {
|
|
313
|
+
ia = !0;
|
|
314
|
+
za || (za = !0);
|
|
315
|
+
const f = c - Math.max(0, window.outerHeight - window.innerHeight);
|
|
316
|
+
b.style.height = `${f}px`;
|
|
317
|
+
b.style.maxHeight = `${f}px`;
|
|
318
|
+
b.style.minHeight = null;
|
|
319
|
+
if (Y) {
|
|
320
|
+
const e = x.getElement(b, ".domquery-alert-header"),
|
|
321
|
+
d =
|
|
322
|
+
x.getElement(b, ".domquery-alert-footer");
|
|
323
|
+
Y.style.maxHeight = `${f-(e?e.offsetHeight:0)-(d?d.offsetHeight:0)-40}px`;
|
|
324
|
+
Y.style.height = "";
|
|
325
|
+
Y.style.minHeight = "";
|
|
326
|
+
Y.style.overflowY = "auto";
|
|
327
|
+
Y.style.webkitOverflowScrolling = "touch";
|
|
328
|
+
Y.scrollTop = 0
|
|
329
|
+
}
|
|
330
|
+
} else c > aa - 100 && ia && ra()
|
|
331
|
+
}, 100)
|
|
332
|
+
};
|
|
333
|
+
g.visualViewport.addEventListener("resize", Aa);
|
|
334
|
+
let xa = !0,
|
|
335
|
+
da = null,
|
|
336
|
+
za = !1;
|
|
337
|
+
G && "function" === typeof G.forEach && G.forEach(c => {
|
|
338
|
+
c && c instanceof Element && (c.addEventListener("focus", () => {
|
|
339
|
+
if (xa) {
|
|
340
|
+
ka = Ba();
|
|
341
|
+
try {
|
|
342
|
+
da = ya()
|
|
343
|
+
} catch (f) {
|
|
344
|
+
da = document.createElement("div"),
|
|
345
|
+
da.style.display = "none", document.body.appendChild(da)
|
|
346
|
+
}
|
|
347
|
+
aa = g.visualViewport.height;
|
|
348
|
+
L.setTimeoutRAF(() => {
|
|
349
|
+
ka && (ka.remove(), ka = null);
|
|
350
|
+
L.setTimeoutRAF(() => {
|
|
351
|
+
da && (da.style.opacity = "0", L.setTimeoutRAF(() => {
|
|
352
|
+
da && (da.style.display = "none")
|
|
353
|
+
}, 300))
|
|
354
|
+
}, 300)
|
|
355
|
+
}, 200);
|
|
356
|
+
xa = !1
|
|
357
|
+
} else da && L.setTimeoutRAF(() => {
|
|
358
|
+
da && (da.style.display = "block", da.style.opacity = "1", L.setTimeoutRAF(() => {
|
|
359
|
+
da && (da.style.opacity = "0", L.setTimeoutRAF(() => {
|
|
360
|
+
da && (da.style.display = "none")
|
|
361
|
+
}, 300))
|
|
362
|
+
}, 300))
|
|
363
|
+
}, 300)
|
|
364
|
+
}), c.addEventListener("blur", () => {
|
|
365
|
+
L.setTimeoutRAF(() => {
|
|
366
|
+
const f = document.activeElement;
|
|
367
|
+
let e = !1;
|
|
368
|
+
Array.isArray(G) ? e = G.some(d => d === f) : G && "object" === typeof G && (e = G === f);
|
|
369
|
+
!e && ia && ra()
|
|
370
|
+
}, 100)
|
|
371
|
+
}))
|
|
372
|
+
});
|
|
373
|
+
const Da = setInterval(() => {
|
|
374
|
+
ia && g.visualViewport.height > aa - 100 && ra()
|
|
375
|
+
}, 1E3),
|
|
376
|
+
la = () => {
|
|
377
|
+
ia && window.innerHeight > aa - 100 && ra()
|
|
378
|
+
};
|
|
379
|
+
window.addEventListener("resize", la);
|
|
380
|
+
const ma = a.onClose;
|
|
381
|
+
a.onClose = function() {
|
|
382
|
+
g.visualViewport.removeEventListener("resize", Aa);
|
|
383
|
+
window.removeEventListener("resize", la);
|
|
384
|
+
clearInterval(Da);
|
|
385
|
+
ha && clearTimeout(ha);
|
|
386
|
+
const c = document.getElementById("keyboard-virtual-layer");
|
|
387
|
+
c && c.remove();
|
|
388
|
+
da && (da.remove(), da = null);
|
|
389
|
+
"function" === typeof ma && ma.apply(this, arguments)
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
let q = g.visualViewport.height,
|
|
393
|
+
m = null;
|
|
394
|
+
const t = () => {
|
|
395
|
+
if (100 < Math.abs(g.visualViewport.height - q)) m && clearTimeout(m), m = setTimeout(() => {
|
|
396
|
+
const G = g.visualViewport.offsetTop,
|
|
397
|
+
aa = g.visualViewport.height,
|
|
398
|
+
ia = g.innerHeight - aa;
|
|
399
|
+
switch (h) {
|
|
400
|
+
case "TC":
|
|
401
|
+
b.style.top = G + "px";
|
|
402
|
+
b.style.bottom = "auto";
|
|
403
|
+
break;
|
|
404
|
+
case "BC":
|
|
405
|
+
b.style.top = "auto";
|
|
406
|
+
b.style.bottom = ia + "px";
|
|
407
|
+
break;
|
|
408
|
+
case "LC":
|
|
409
|
+
case "RC":
|
|
410
|
+
b.style.top = G + aa / 2 + "px";
|
|
411
|
+
break;
|
|
412
|
+
case "TL":
|
|
413
|
+
case "TR":
|
|
414
|
+
b.style.top =
|
|
415
|
+
G + "px";
|
|
416
|
+
break;
|
|
417
|
+
case "BL":
|
|
418
|
+
case "BR":
|
|
419
|
+
b.style.bottom = ia + "px"
|
|
420
|
+
}
|
|
421
|
+
}, 100), q = g.visualViewport.height;
|
|
422
|
+
else {
|
|
423
|
+
const G = g.visualViewport.offsetTop,
|
|
424
|
+
aa = g.visualViewport.height,
|
|
425
|
+
ia = g.innerHeight - aa;
|
|
426
|
+
switch (h) {
|
|
427
|
+
case "TC":
|
|
428
|
+
b.style.top = G + "px";
|
|
429
|
+
b.style.bottom = "auto";
|
|
430
|
+
break;
|
|
431
|
+
case "BC":
|
|
432
|
+
b.style.top = "auto";
|
|
433
|
+
b.style.bottom = ia + "px";
|
|
434
|
+
break;
|
|
435
|
+
case "LC":
|
|
436
|
+
case "RC":
|
|
437
|
+
b.style.top = G + aa / 2 + "px";
|
|
438
|
+
break;
|
|
439
|
+
case "TL":
|
|
440
|
+
case "TR":
|
|
441
|
+
b.style.top = G + "px";
|
|
442
|
+
break;
|
|
443
|
+
case "BL":
|
|
444
|
+
case "BR":
|
|
445
|
+
b.style.bottom = ia + "px"
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
};
|
|
449
|
+
g.visualViewport.addEventListener("resize", t, {
|
|
450
|
+
passive: !0
|
|
451
|
+
});
|
|
452
|
+
g.visualViewport.addEventListener("scroll", t, {
|
|
453
|
+
passive: !0
|
|
454
|
+
});
|
|
455
|
+
t();
|
|
456
|
+
return () => {
|
|
457
|
+
m && clearTimeout(m);
|
|
458
|
+
g.visualViewport.removeEventListener("resize", t, {
|
|
459
|
+
passive: !0
|
|
460
|
+
});
|
|
461
|
+
g.visualViewport.removeEventListener("scroll", t, {
|
|
462
|
+
passive: !0
|
|
463
|
+
})
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
return null
|
|
467
|
+
};
|
|
468
|
+
"" === h || "center" === h ? (b.style.top = "50%", b.style.left = "50%", b.style.transformOrigin = "center", F = "translate(-50%, -50%) scale(0)", M = "translate(-50%, -50%) scale(1)") : ["LC", "RC"].includes(h) ? (b.style.top = "50%", b.style["LC" === h ? "left" : "right"] = "0", b.style.transformOrigin = `${"LC"===
|
|
469
|
+
h?"left":"right"} center`, !1 === r ? (F = `translate(${"LC"===h?"-100%":"100%"}, -50%)`, M = "translate(0, -50%)") : (F = "translate(0, -50%) scale(0)", M = "translate(0, -50%) scale(1)"), K()) : ["TC", "BC"].includes(h) ? (b.style["TC" === h ? "top" : "bottom"] = "0", b.style.left = "50%", b.style.transformOrigin = `${"TC"===h?"top":"bottom"} center`, !1 === r ? (F = `translate(-50%, ${"TC"===h?"-100%":"100%"})`, M = "translate(-50%, 0)") : (F = "translate(-50%, 0) scale(0)", M = "translate(-50%, 0) scale(1)"), K()) : ["TL", "TR", "BL", "BR"].includes(h) &&
|
|
470
|
+
(F = h.startsWith("T") ? "top" : "bottom", M = h.endsWith("L") ? "left" : "right", b.style[F] = "0", b.style[M] = "0", b.style.transformOrigin = `${F} ${M}`, !1 === r ? (F = `translate(${"right"===M?"100%":"-100%"}, ${"bottom"===F?"100%":"-100%"})`, M = "translate(0, 0)") : (F = "translate(0, 0) scale(0)", M = "translate(0, 0) scale(1)"), K());
|
|
471
|
+
b.style.transform = F;
|
|
472
|
+
b.style.opacity = String("number" === typeof a.opacity ? a.opacity : 1);
|
|
473
|
+
b.style.willChange = "transform, opacity";
|
|
474
|
+
b.style.backfaceVisibility = "hidden";
|
|
475
|
+
var w = null;
|
|
476
|
+
!0 === a.hide && (w = Array.from(b.querySelectorAll(".domquery-alert-body, .domquery-text-container, .domquery-text-bottom-container, .domquery-alert-close-btn, .alert-scroll-wrapper > div")),
|
|
477
|
+
w.forEach(A => {
|
|
478
|
+
A && (A.style.transition = "opacity 0.3s ease", A.style.opacity = "0")
|
|
479
|
+
}));
|
|
480
|
+
var D = performance.now(),
|
|
481
|
+
C = A => {
|
|
482
|
+
A = Math.min((A - D) / p, 1);
|
|
483
|
+
const T = a.easing ? this._anieasing(0, 1, A, a.easing) : A;
|
|
484
|
+
if (!0 === a.hide && w) {
|
|
485
|
+
const m = .8 <= A ? 5 * (A - .8) : 0;
|
|
486
|
+
w.forEach(t => {
|
|
487
|
+
t && (t.style.opacity = m.toString())
|
|
488
|
+
})
|
|
489
|
+
}
|
|
490
|
+
b.style.transform = (() => {
|
|
491
|
+
if (["TL", "TR", "BL", "BR"].includes(h)) {
|
|
492
|
+
if (!1 === r) {
|
|
493
|
+
var m = h.endsWith("L") ? "left" : "right",
|
|
494
|
+
t = h.startsWith("T") ? "top" : "bottom";
|
|
495
|
+
m = "right" === m ? 100 : -100;
|
|
496
|
+
t = "bottom" === t ? 100 : -100;
|
|
497
|
+
return `translate3d(${m+(0-m)*T}%, ${t+
|
|
498
|
+
(0-t)*T}%, 0)`
|
|
499
|
+
}
|
|
500
|
+
return `translate3d(0, 0, 0) scale(${T})`
|
|
501
|
+
}
|
|
502
|
+
if (!1 === r) {
|
|
503
|
+
if (["LC", "RC"].includes(h)) return t = "LC" === h ? -100 : 100, `translate3d(${t+(0-t)*T}%, -50%, 0)`;
|
|
504
|
+
if (["TC", "BC"].includes(h)) return t = "TC" === h ? -100 : 100, `translate3d(-50%, ${t+(0-t)*T}%, 0)`
|
|
505
|
+
}
|
|
506
|
+
return ["LC", "RC"].includes(h) ? `translate3d(0, -50%, 0) scale(${T})` : ["TC", "BC"].includes(h) ? `translate3d(-50%, 0, 0) scale(${T})` : ["TL", "TR", "BL", "BR"].includes(h) ? `translate3d(0, 0, 0) scale(${T})` : `translate3d(-50%, -50%, 0) scale(${T})`
|
|
507
|
+
})();
|
|
508
|
+
const q =
|
|
509
|
+
"number" === typeof a.opacity ? a.opacity : 1;
|
|
510
|
+
b.style.opacity = String(q + (1 - q) * T);
|
|
511
|
+
if (1 > A) Z = requestAnimationFrame(C);
|
|
512
|
+
else if (b.style.willChange = "auto", b.style.backfaceVisibility = "", a.onComplete) a.onComplete()
|
|
513
|
+
};
|
|
514
|
+
var Z = requestAnimationFrame(C);
|
|
515
|
+
return {
|
|
516
|
+
initialTransform: F,
|
|
517
|
+
finalTransform: M,
|
|
518
|
+
cancel: () => {
|
|
519
|
+
Z && (cancelAnimationFrame(Z), b.style.willChange = "auto", b.style.backfaceVisibility = "")
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
};
|
|
524
|
+
$.aBox = function(b, a) {
|
|
525
|
+
function p() {
|
|
526
|
+
if (M) {
|
|
527
|
+
F += 2 * r;
|
|
528
|
+
3 <= Math.abs(F) && (r *= -1);
|
|
529
|
+
var D = Math.abs(F) / 3;
|
|
530
|
+
D = 2 * (.5 > D ? 2 * D * D : -1 + (4 - 2 * D) * D);
|
|
531
|
+
if (a) switch (a) {
|
|
532
|
+
case "TL":
|
|
533
|
+
D =
|
|
534
|
+
`translate(${K-D}px, ${w-D}px)`;
|
|
535
|
+
break;
|
|
536
|
+
case "TR":
|
|
537
|
+
D = `translate(${K+D}px, ${w-D}px)`;
|
|
538
|
+
break;
|
|
539
|
+
case "BL":
|
|
540
|
+
D = `translate(${K-D}px, ${w+D}px)`;
|
|
541
|
+
break;
|
|
542
|
+
case "BR":
|
|
543
|
+
D = `translate(${K+D}px, ${w+D}px)`;
|
|
544
|
+
break;
|
|
545
|
+
case "TC":
|
|
546
|
+
D = `translate(${K}px, ${w-D}px)`;
|
|
547
|
+
break;
|
|
548
|
+
case "BC":
|
|
549
|
+
D = `translate(${K}px, ${w+D}px)`;
|
|
550
|
+
break;
|
|
551
|
+
case "LC":
|
|
552
|
+
D = `translate(${K-D}px, ${w}px)`;
|
|
553
|
+
break;
|
|
554
|
+
case "RC":
|
|
555
|
+
D = `translate(${K+D}px, ${w}px)`;
|
|
556
|
+
break;
|
|
557
|
+
default:
|
|
558
|
+
D = y
|
|
559
|
+
} else D = `${y} scale(${1+D/100})`;
|
|
560
|
+
h.css("transform", D); - 10 <= F && 10 >= F ? requestAnimationFrame(p) : (M = !1, h.css("transform",
|
|
561
|
+
y))
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
const h = $(b);
|
|
565
|
+
let r = 1,
|
|
566
|
+
F = 0,
|
|
567
|
+
M = !0;
|
|
568
|
+
const y = h.css("transform");
|
|
569
|
+
b = new DOMMatrix(y);
|
|
570
|
+
const K = b.m41,
|
|
571
|
+
w = b.m42;
|
|
572
|
+
p();
|
|
573
|
+
L.setTimeoutRAF(() => {
|
|
574
|
+
M = !1;
|
|
575
|
+
h.css("transform", y)
|
|
576
|
+
}, 300)
|
|
577
|
+
};
|
|
578
|
+
$._alert0 = function(b, a = {}, p = 300) {
|
|
579
|
+
var h = a.preserveExisting,
|
|
580
|
+
r = a.parent;
|
|
581
|
+
"string" === typeof b && (b = b.replace(/>\s+</g, "><").trim());
|
|
582
|
+
"object" === typeof b && (a = b, b = "");
|
|
583
|
+
if (null === b || void 0 === b) b = "";
|
|
584
|
+
var F = {
|
|
585
|
+
id: null,
|
|
586
|
+
swipe: !1,
|
|
587
|
+
parent: "body",
|
|
588
|
+
background: "#000000",
|
|
589
|
+
alpha: 50,
|
|
590
|
+
retainScroll: !0,
|
|
591
|
+
autoscroll: !1,
|
|
592
|
+
noScrollRestore: !1,
|
|
593
|
+
bgcolor: "#FFFFFF",
|
|
594
|
+
titleColor: "#000000",
|
|
595
|
+
color: "#000000",
|
|
596
|
+
TOPS: "",
|
|
597
|
+
shadow: "",
|
|
598
|
+
History: !0,
|
|
599
|
+
shadowBox: "0 2px 10px rgba(0,0,0,0.3)",
|
|
600
|
+
vibrate: !0,
|
|
601
|
+
trigger: "",
|
|
602
|
+
title: "",
|
|
603
|
+
Font: "1.1em",
|
|
604
|
+
font: "0.9em",
|
|
605
|
+
opacity: 1,
|
|
606
|
+
padding: 0,
|
|
607
|
+
margin: "0",
|
|
608
|
+
border: "none",
|
|
609
|
+
borderWidth: "",
|
|
610
|
+
borderStyle: "",
|
|
611
|
+
borderColor: "",
|
|
612
|
+
text: "",
|
|
613
|
+
textBottom: "",
|
|
614
|
+
width: "250px",
|
|
615
|
+
minWidth: "",
|
|
616
|
+
maxWidth: "",
|
|
617
|
+
height: "auto",
|
|
618
|
+
minHeight: "",
|
|
619
|
+
maxHeight: "",
|
|
620
|
+
radius: "3px",
|
|
621
|
+
zindex: 9999,
|
|
622
|
+
toastZindex: 99999,
|
|
623
|
+
$Ok: "Ok",
|
|
624
|
+
OkBgcolor: "#E0E0E0",
|
|
625
|
+
OkColor: "#000000",
|
|
626
|
+
scroll: !1,
|
|
627
|
+
scrollX: !1,
|
|
628
|
+
scrollY: !1,
|
|
629
|
+
unscroll: !1,
|
|
630
|
+
close: !1,
|
|
631
|
+
xclose: !1,
|
|
632
|
+
loading: !1,
|
|
633
|
+
TL: void 0,
|
|
634
|
+
TR: void 0,
|
|
635
|
+
BL: void 0,
|
|
636
|
+
BR: void 0,
|
|
637
|
+
TC: void 0,
|
|
638
|
+
LC: void 0,
|
|
639
|
+
RC: void 0,
|
|
640
|
+
BC: void 0,
|
|
641
|
+
CC: void 0
|
|
642
|
+
},
|
|
643
|
+
M = !1 !== a.$Ok || Object.keys(a).some(m => m.startsWith("$") && "$Ok" !== m);
|
|
644
|
+
a.padding = a.padding || (M ? "15px" : "15px 15px 0 15px");
|
|
645
|
+
"_self" === a.parent && (a.preserveExisting = !0);
|
|
646
|
+
if ("_blank" === a.parent) {
|
|
647
|
+
let m = 2147483640;
|
|
648
|
+
Array.from(document.querySelectorAll(".domquery-alert")).forEach(t => {
|
|
649
|
+
t = parseInt(getComputedStyle(t).zIndex);
|
|
650
|
+
!isNaN(t) && t > m && (m = t)
|
|
651
|
+
});
|
|
652
|
+
a.zindex = a.zindex && a.zindex !== F.zindex ? Math.max(a.zindex, m) + 2 : m + 2;
|
|
653
|
+
2147483647 < a.zindex &&
|
|
654
|
+
(a.zindex = 2147483647);
|
|
655
|
+
a.overlayZindex = a.zindex - 1
|
|
656
|
+
}
|
|
657
|
+
h = void 0 !== h ? h : a.preserveExisting;
|
|
658
|
+
r = void 0 !== r ? r : a.parent;
|
|
659
|
+
a = Object.assign({}, F, a);
|
|
660
|
+
void 0 !== h && (a.preserveExisting = h);
|
|
661
|
+
if ("_self" === r || "_blank" === r) a.parent = r;
|
|
662
|
+
delete a._originalParent;
|
|
663
|
+
if ("_self" !== a.parent && "_blank" !== a.parent && (!a.zindex || a.zindex === F.zindex)) {
|
|
664
|
+
r = Array.from(document.querySelectorAll(".domquery-alert"));
|
|
665
|
+
let m = F.zindex;
|
|
666
|
+
r.forEach(t => {
|
|
667
|
+
t = parseInt(getComputedStyle(t).zIndex);
|
|
668
|
+
!isNaN(t) && t > m && (m = t)
|
|
669
|
+
});
|
|
670
|
+
a.zindex = m + 2;
|
|
671
|
+
a.overlayZindex = a.zindex - 1
|
|
672
|
+
}!a.unscroll ||
|
|
673
|
+
a.scrollY || a.scroll || (a.scrollY = !0, a.hideScrollbar = !0);
|
|
674
|
+
!0 === a.scrollY && (a.forceScroll = !0, a.scroll = !0);
|
|
675
|
+
"auto" !== a.height || !a.scrollY && !a.scroll || a.minHeight || (a.minHeight = "200px");
|
|
676
|
+
r = m => {
|
|
677
|
+
if (void 0 === m) return "auto";
|
|
678
|
+
if ("number" === typeof m) return m + "px";
|
|
679
|
+
if ("string" === typeof m) {
|
|
680
|
+
if (/px|%|vh|vw|rem|em|ch|ex|cm|mm|in|pt|pc/i.test(m)) return m;
|
|
681
|
+
const t = parseFloat(m);
|
|
682
|
+
if (!isNaN(t)) return t + "px"
|
|
683
|
+
}
|
|
684
|
+
return m
|
|
685
|
+
};
|
|
686
|
+
const y = r(a.width);
|
|
687
|
+
let K = r(a.height);
|
|
688
|
+
"_blank" === a.parent && "100%" === K && (K = "100vh");
|
|
689
|
+
h = "" !== a.title;
|
|
690
|
+
M = `alert-${Date.now()}-${Math.random().toString(36).substr(2,
|
|
691
|
+
9)}`;
|
|
692
|
+
a.instanceId = M;
|
|
693
|
+
if (!a._originalFirstStepOptions) {
|
|
694
|
+
a._originalFirstStepOptions = {};
|
|
695
|
+
var w = new Set;
|
|
696
|
+
for (var D in a) a[D] && "object" === typeof a[D] && !Array.isArray(a[D]) && "_originalFirstStepOptions" !== D && "_hasNext" !== D && "instanceId" !== D && "_stepInputValues" !== D && "_currentStepKey" !== D && void 0 !== a[D].title && w.add(D);
|
|
697
|
+
for (var C in a) w.has(C) || "_originalFirstStepOptions" === C || "_hasNext" === C || "_stepInputValues" === C || "_currentStepKey" === C || (a._originalFirstStepOptions[C] = a[C])
|
|
698
|
+
}
|
|
699
|
+
a._currentStepKey || (a._currentStepKey =
|
|
700
|
+
"first");
|
|
701
|
+
a._stepInputValues || (a._stepInputValues = {});
|
|
702
|
+
v.options[M] = {
|
|
703
|
+
swipe: a.swipe,
|
|
704
|
+
parent: a.parent,
|
|
705
|
+
toast: a.toast,
|
|
706
|
+
swipeCallback: a.swipeCallback
|
|
707
|
+
};
|
|
708
|
+
a.toast || a.preserveExisting || "_blank" === a.parent || "_self" === a.parent || !(D = x.getDocumentElement(".domquery-alert:not(.toast-alert)")) || ((C = D.getAttribute("data-instance-id")) && (C = document.querySelector(`.domquery-shadow-overlay[data-instance-id="${C}"]`)) && C.parentNode && C.parentNode.removeChild(C), D.parentNode && D.parentNode.removeChild(D));
|
|
709
|
+
C = D = "";
|
|
710
|
+
let Z = [];
|
|
711
|
+
w =
|
|
712
|
+
(m, t) => {
|
|
713
|
+
if (!m) return "";
|
|
714
|
+
if ("function" === typeof m) {
|
|
715
|
+
try {
|
|
716
|
+
var G = m();
|
|
717
|
+
if ("string" === typeof G) return `<div class="domquery-text-container">${G}</div>`;
|
|
718
|
+
if (G instanceof Element) return `<div class="domquery-text-container">${G.outerHTML}</div>`
|
|
719
|
+
} catch (ia) {}
|
|
720
|
+
return ""
|
|
721
|
+
}
|
|
722
|
+
if ("string" === typeof m) {
|
|
723
|
+
G = t.alertId || "alert_" + Date.now();
|
|
724
|
+
t.alertId = G;
|
|
725
|
+
const ia = document.createElement("div");
|
|
726
|
+
ia.id = G;
|
|
727
|
+
for (var aa in t) "function" === typeof t[aa] && (ia[aa] = t[aa]);
|
|
728
|
+
document.body.appendChild(ia);
|
|
729
|
+
m = m.replace(/this\./g, `document.getElementById('${G}').`);
|
|
730
|
+
m = m.replace(/onclick="([^"]+)"/g, (ka, ha) => ha.includes("this.") ? ka : `onclick="window.${ha}"`);
|
|
731
|
+
t = m.trim();
|
|
732
|
+
return !t.startsWith("#") && !t.startsWith(".") || t.includes("bin(") || t.includes("{") || t.includes("}") ? `<div class="domquery-text-container">${m.split(/(\{[^}]+\}|bin\([^)]+\))/).map(ka=>(ka=ka.trim())?ka.startsWith("bin(")?ka.slice(4,-1).split(",").map(ha=>ha.trim()).map(ha=>{const Y=document.querySelector(ha);if(Y){const Ea=g.getComputedStyle(Y).display;"none"===Ea&&(Y.style.display="block");Z.push({selector:ha,
|
|
733
|
+
parent:Y.parentNode,nextSibling:Y.nextSibling,element:Y,originalDisplay:Ea});ha=Y.outerHTML;Y.parentNode.removeChild(Y);return ha}return""}).join("\n"):ka.startsWith("{")&&ka.endsWith("}")&&!ka.includes("{")&&!ka.includes("}")?ka.slice(1,-1).split(";").map(ha=>ha.trim()).map(ha=>{try{return eval(ha)||""}catch(Y){return""}}).join(""):ka:"").join("")}</div>` : (m = document.querySelector(t)) ? (aa = getComputedStyle(m).display, "none" === aa && (m.style.display = "block"), Z.push({
|
|
734
|
+
selector: t,
|
|
735
|
+
parent: m.parentNode,
|
|
736
|
+
nextSibling: m.nextSibling,
|
|
737
|
+
element: m,
|
|
738
|
+
originalDisplay: aa
|
|
739
|
+
}), t = m.outerHTML, m.parentNode.removeChild(m), `<div class="domquery-text-container">${t}</div>`) : ""
|
|
740
|
+
}
|
|
741
|
+
return `<div class="domquery-text-container">${String(m)}</div>`
|
|
742
|
+
};
|
|
743
|
+
a.text && (D = w(a.text, a));
|
|
744
|
+
a.textBottom && (C = w(a.textBottom, a));
|
|
745
|
+
w = a.xclose ? `<div style="position: absolute; right: 10px; top: 10px; cursor: pointer; transition: opacity 0.2s; z-index:1; ${!0===a.hide?"opacity: 0;":""}" class="domquery-close-x-btn">\n\t\t\t\t<svg width="20" height="20" viewBox="0 0 24 24" style="opacity: 0.6; transition: opacity 0.2s; pointer-events: all;"\n\t\t\t\t\t\tonmouseover="this.style.opacity='1'"\n\t\t\t\t\t\tonmouseout="this.style.opacity='0.6'">\n\t\t\t\t\t<path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z" fill="${a.color}"/>\n\t\t\t\t</svg>\n\t\t\t</div>` :
|
|
746
|
+
'<div style="display:none" class="domquery-close-x-btn"></div>';
|
|
747
|
+
const A = ['<div class="domquery-alert-loading" style="display: none;position: absolute;top: 0;left: 0;right: 0;bottom: 0;background: rgba(255,255,255,0.2);', "z-index: " + (a.zindex + 1) + ";", 'justify-content: center;align-items: center;"><div style="width: 40px;height: 40px;border: 3px solid #f3f3f3;', "border-top: 3px solid " + a.OkBgcolor + ";", 'border-radius: 50%;animation: spin 1s linear infinite;"></div></div><style>@keyframes spin {0% { transform: rotate(0deg); }100% { transform: rotate(360deg); }}</style>'].join(""),
|
|
748
|
+
T = (m => {
|
|
749
|
+
const t = [];
|
|
750
|
+
Object.keys(m).forEach(G => {
|
|
751
|
+
if (G.startsWith("$") && !G.endsWith("Style") && !G.endsWith("hover")) {
|
|
752
|
+
var aa = G.substring(1).replace(/Bgcolor|Color$/, "");
|
|
753
|
+
"Ok" === aa || G.endsWith("Color") || G.endsWith("Bgcolor") || t.find(ia => ia.name === aa) || t.push({
|
|
754
|
+
name: aa,
|
|
755
|
+
text: m[G] || aa,
|
|
756
|
+
bgcolor: m[`$${aa}Bgcolor`] || "#007bff",
|
|
757
|
+
color: m[`$${aa}Color`] || "#FFFFFF",
|
|
758
|
+
customStyle: m[`$${aa}Style`] || "",
|
|
759
|
+
hoverStyle: m[`$${aa}hover`] || ""
|
|
760
|
+
})
|
|
761
|
+
}
|
|
762
|
+
});
|
|
763
|
+
return t
|
|
764
|
+
})(a),
|
|
765
|
+
q = (() => {
|
|
766
|
+
let m = '<div style="text-align: right; margin-top: 15px;">';
|
|
767
|
+
if (!1 !==
|
|
768
|
+
a.$Ok) {
|
|
769
|
+
const t = a.$Okhover || "opacity: 1;",
|
|
770
|
+
G = ["padding: 6px 10px;", "background: " + (a.$OkBgcolor || a.OkBgcolor) + ";", "color: " + (a.$OkColor || a.OkColor) + ";", "border: none;border-radius: 3px;cursor: pointer;opacity: 0.9;font-size:0.9em;transition: all 0.2s;margin-left: 10px;", a.$OkStyle || ""].join("");
|
|
771
|
+
m += ['<button class="domquery-alert-close-btn" style="', G, '" onmouseover="this.style.cssText = `' + G + "; " + t + '`"', 'onmouseout="this.style.cssText = `' + G + '`">', a.$Ok, "</button>"].join("")
|
|
772
|
+
}
|
|
773
|
+
m += T.map(function(t) {
|
|
774
|
+
const G = ["padding: 6px 10px;", `background: ${t.bgcolor};`, `color: ${t.color};`, "border: none;border-radius: 3px;cursor: pointer;opacity: 0.9;font-size:0.9em;transition: all 0.2s;margin-left: 10px;", t.customStyle].join(""),
|
|
775
|
+
aa = t.hoverStyle || "opacity: 1;";
|
|
776
|
+
return [`<button class="alert-${t.name.toLowerCase()}-btn" style="`, G, '" onmouseover="this.style.cssText = `' + G + "; " + aa + '`"', 'onmouseout="this.style.cssText = `' + G + '`">', t.text, "</button>"].join("")
|
|
777
|
+
}).join("");
|
|
778
|
+
return m + "</div>"
|
|
779
|
+
})();
|
|
780
|
+
F = ["z-index: " + ("_blank" ===
|
|
781
|
+
a.parent ? a.zindex : a.toast ? a.toastZindex : a.zindex) + " !important;", "margin: " + (a.margin || "0") + ";", a.border ? "border: " + a.border + ";" : "", a.borderWidth ? "border-width: " + a.borderWidth + ";" : "", a.borderStyle ? "border-style: " + a.borderStyle + ";" : "", a.borderColor ? "border-color: " + a.borderColor + ";" : "", "background: " + a.bgcolor + ";", "width: " + y + ";", a.minWidth ? "min-width: " + r(a.minWidth) + ";" : "", a.maxWidth ? "max-width: " + r(a.maxWidth) + ";" : "", "height: " + K + ";", a.minHeight ? "min-height: " + r(a.minHeight) + ";" : "", a.maxHeight ?
|
|
782
|
+
"max-height: " + r(a.maxHeight) + ";" : "", "border-radius: " + a.radius + ";", "transparent" === a.bgcolor ? "" : !1 === a.shadowBox ? "" : "box-shadow: " + ("string" === typeof a.shadowBox ? a.shadowBox : F.shadowBox) + ";", "box-sizing: border-box;position: fixed;", "opacity: " + ("number" === typeof a.opacity ? a.opacity : 1) + ";", "z-index: " + a.zindex + ";", "overflow: hidden !important;", a.maxHeight ? "" : "max-height: 100vh !important;", "display: flex !important;flex-direction: column !important;"
|
|
783
|
+
].join("");
|
|
784
|
+
b = ['<div class="domquery-alert ' + (a.toast ?
|
|
785
|
+
"toast-alert" : "standard-alert") + '" ', `data-instance-id="${M}" `, null !== a.id ? `id="${a.id}" ` : `id="${M}" `, 'style="' + F + '">', w, A, a.scroll || a.scrollX || a.scrollY || a.forceScroll ? '<div class="alert-scroll-wrapper" style="position: relative !important;width: 100% !important;height: 100% !important;max-height: ' + (a.maxHeight || "100%") + " !important;overflow: " + (a.scroll || a.scrollY || a.forceScroll ? "auto" : a.scrollX ? "auto hidden" : a.scrollY || a.forceScroll ? "hidden auto" : "hidden") + " !important;" + (a.hideScrollbar ? "scrollbar-width: none !important; -ms-overflow-style: none !important;" :
|
|
786
|
+
"") + "-webkit-overflow-scrolling: touch !important;touch-action: " + (a.scroll || a.scrollY || a.forceScroll ? "pan-x pan-y" : a.scrollY || a.forceScroll ? "pan-y" : "pan-x") + ' !important;"><div style="padding: ' + ("0" === a.padding ? "0" : r(a.padding)) + ';">' : '<div style="padding: ' + ("0" === a.padding ? "0" : r(a.padding)) + ';overflow: hidden !important;max-height: 100% !important;height: 100% !important;flex: 1;">', '<div class="domquery-alert-body" style="width: 100% !important;' + (a.toast ? "text-overflow: ellipsis;" : "") + (a.scroll ||
|
|
787
|
+
a.scrollX || a.scrollY || a.forceScroll ? "" : "overflow: hidden !important;") + (!0 === a.hide ? "opacity: 0;" : "") + '">', ((m, t) => {
|
|
788
|
+
if (t) return `<div style="font-size:${a.Font}; font-weight:bold; color:${a.titleColor}">${a.title}</div>\n\t\t\t\t\t <hr style="border:none; height:1px; background-color:rgba(0,0,0,0.1); margin:10px 0">\n\t\t\t\t\t <div style="font-size:${a.font}; color:${a.color||"#000000"}">${m}</div>`;
|
|
789
|
+
let G;
|
|
790
|
+
m.includes("\n") ? G = m.split("\n", 2) : m.includes("<br>") && (G = m.split("<br>", 2));
|
|
791
|
+
return G ? `<div style="font-size:${a.Font}; font-weight:bold; color:${a.titleColor}">${G[0]}</div>\n\t\t\t\t\t <hr style="border:none; height:1px; background-color:rgba(0,0,0,0.1); margin:10px 0">\n\t\t\t\t\t <div style="font-size:${a.font}; color:${a.color||
|
|
792
|
+
"#000000"}">${G[1]}</div>` : `<div style="font-size:${a.Font}; font-weight:bold; color:${a.titleColor}">${m}</div>`
|
|
793
|
+
})(b, h), "</div>", '<div class="domquery-text-container" style="width: 100% !important;' + (a.scroll || a.scrollX || a.scrollY || a.forceScroll ? "" : "overflow: hidden !important;") + (!0 === a.hide ? "opacity: 0;" : "") + '">', D, "</div>", '<div style="width: 100% !important;' + (a.scroll || a.scrollX || a.scrollY || a.forceScroll ? "" : "overflow: hidden !important;") + (!0 === a.hide ? "opacity: 0;" : "") + '">', q, "</div>", '<div class="domquery-text-bottom-container" style="width: 100% !important;' +
|
|
794
|
+
(a.scroll || a.scrollX || a.scrollY || a.forceScroll ? "" : "overflow: hidden !important;") + (!0 === a.hide ? "opacity: 0;" : "") + '">', C, "</div></div>", a.scroll || a.scrollX || a.scrollY || a.forceScroll ? "</div></div>" : "</div>", "</div>"
|
|
795
|
+
].join("");
|
|
796
|
+
F = document.createElement("div");
|
|
797
|
+
F.innerHTML = b;
|
|
798
|
+
b = F.firstElementChild;
|
|
799
|
+
b._elementInfos = Z;
|
|
800
|
+
F = a && "number" === typeof a.openSpeed ? a.openSpeed : p;
|
|
801
|
+
a._closeSpeed = a && "number" === typeof a.closeSpeed ? a.closeSpeed : p;
|
|
802
|
+
return {
|
|
803
|
+
alertBox: b,
|
|
804
|
+
options: a,
|
|
805
|
+
speed: F,
|
|
806
|
+
buttonConfigs: T
|
|
807
|
+
}
|
|
808
|
+
};
|
|
809
|
+
$._alert1 = function(b, a, p,
|
|
810
|
+
h, r) {
|
|
811
|
+
function F(c) {
|
|
812
|
+
b.contains(c.target) || c.preventDefault()
|
|
813
|
+
}
|
|
814
|
+
|
|
815
|
+
function M(c, f, e) {
|
|
816
|
+
const d = x.getElement(f, ".alert-scroll-wrapper") || x.getElement(f, ".domquery-alert-body");
|
|
817
|
+
if (d)
|
|
818
|
+
if (50 < d.scrollHeight) $.AlertScrollManager.restorePosition(c, f, e);
|
|
819
|
+
else {
|
|
820
|
+
const l = new MutationObserver(() => {
|
|
821
|
+
50 < d.scrollHeight && ($.AlertScrollManager.restorePosition(c, f, e), l.disconnect())
|
|
822
|
+
});
|
|
823
|
+
l.observe(d, {
|
|
824
|
+
childList: !0,
|
|
825
|
+
subtree: !0
|
|
826
|
+
})
|
|
827
|
+
}
|
|
828
|
+
else {
|
|
829
|
+
const l = new MutationObserver(() => {
|
|
830
|
+
const u = x.getElement(f, ".alert-scroll-wrapper") || x.getElement(f, ".domquery-alert-body");
|
|
831
|
+
u && 50 < u.scrollHeight && ($.AlertScrollManager.restorePosition(c, f, e), l.disconnect())
|
|
832
|
+
});
|
|
833
|
+
l.observe(f, {
|
|
834
|
+
childList: !0,
|
|
835
|
+
subtree: !0
|
|
836
|
+
})
|
|
837
|
+
}
|
|
838
|
+
}
|
|
839
|
+
const y = b.getAttribute("data-instance-id");
|
|
840
|
+
let K = !0;
|
|
841
|
+
var w = () => {
|
|
842
|
+
if (!a.parent) return document.body;
|
|
843
|
+
if ("_blank" === a.parent) try {
|
|
844
|
+
var c = "domquery-blank-container-" + y;
|
|
845
|
+
let f = null,
|
|
846
|
+
e = 0;
|
|
847
|
+
Array.from(document.querySelectorAll(".domquery-alert")).forEach(k => {
|
|
848
|
+
if (k.getAttribute("data-instance-id") !== y) {
|
|
849
|
+
const n = parseInt(getComputedStyle(k).zIndex);
|
|
850
|
+
!isNaN(n) && n > e && (e = n, f = k)
|
|
851
|
+
}
|
|
852
|
+
});
|
|
853
|
+
const d = a.zindex ||
|
|
854
|
+
2147483647,
|
|
855
|
+
l = d - 1 - 1;
|
|
856
|
+
let u = document.getElementById(c);
|
|
857
|
+
if (u) {
|
|
858
|
+
const k = a.zindex || 2147483647;
|
|
859
|
+
a.overlayZindex = k - 1;
|
|
860
|
+
a.zindex = k;
|
|
861
|
+
a.toastZindex = k
|
|
862
|
+
} else {
|
|
863
|
+
u = document.createElement("div");
|
|
864
|
+
u.className = "domquery-blank-container";
|
|
865
|
+
u.id = c;
|
|
866
|
+
u.setAttribute("data-instance-id", y);
|
|
867
|
+
u.style.cssText = `\n\t\t\t\t\t\t\tposition: fixed;\n\t\t\t\t\t\t\ttop: 0;\n\t\t\t\t\t\t\tleft: 0;\n\t\t\t\t\t\t\twidth: 100vw;\n\t\t\t\t\t\t\theight: 100vh;\n\t\t\t\t\t\t\tpointer-events: none; /* \uae30\ubcf8\uc801\uc73c\ub85c\ub294 \uc774\ubca4\ud2b8 \ud1b5\uacfc */\n\t\t\t\t\t\t\tz-index: ${l};\n\t\t\t\t\t\t`;
|
|
868
|
+
document.body.appendChild(u);
|
|
869
|
+
b.setAttribute("data-blank-container-id", c);
|
|
870
|
+
b.style.position = "fixed";
|
|
871
|
+
b.style.pointerEvents = "auto";
|
|
872
|
+
b.style.setProperty("z-index", d.toString(), "important");
|
|
873
|
+
b.style.left = "0";
|
|
874
|
+
b.style.right = "0";
|
|
875
|
+
b.style.margin = "0 auto";
|
|
876
|
+
b.classList.add("domquery-independent-alert");
|
|
877
|
+
a.overlayZindex = d - 1;
|
|
878
|
+
a.zindex = d;
|
|
879
|
+
a.toastZindex = d;
|
|
880
|
+
b.style.setProperty("z-index", a.zindex.toString(), "important");
|
|
881
|
+
f && (a._parentAlert = f);
|
|
882
|
+
try {
|
|
883
|
+
window !== window.top && window.top.document.body.appendChild(u)
|
|
884
|
+
} catch (k) {}
|
|
885
|
+
}
|
|
886
|
+
return document.body
|
|
887
|
+
} catch (f) {
|
|
888
|
+
return document.body
|
|
889
|
+
}
|
|
890
|
+
if ("_self" ===
|
|
891
|
+
a.parent) {
|
|
892
|
+
let f = null,
|
|
893
|
+
e = 9998;
|
|
894
|
+
Array.from(document.querySelectorAll(".domquery-alert")).forEach(d => {
|
|
895
|
+
if (d.getAttribute("data-instance-id") !== a.instanceId) {
|
|
896
|
+
const l = parseInt(getComputedStyle(d).zIndex);
|
|
897
|
+
!isNaN(l) && l > e && (e = l, f = d)
|
|
898
|
+
}
|
|
899
|
+
});
|
|
900
|
+
if (f) {
|
|
901
|
+
a._parentAlert = f;
|
|
902
|
+
c = parseInt(getComputedStyle(f).zIndex) || 0;
|
|
903
|
+
!isNaN(c) && 0 < c ? (a.zindex = c + 2, a.overlayZindex = a.zindex - 1) : a.zindex && 9999 !== a.zindex || (a.zindex = 9999, a.overlayZindex = a.zindex - 1);
|
|
904
|
+
if (c = f.getAttribute("data-instance-id")) a._parentInstanceId = c, b.setAttribute("data-parent-instance-id",
|
|
905
|
+
c);
|
|
906
|
+
else try {
|
|
907
|
+
console.warn("[alert.js] _self alert \uc0dd\uc131 - \ubd80\ubaa8 instanceId\ub97c \ucc3e\uc744 \uc218 \uc5c6\uc74c")
|
|
908
|
+
} catch (d) {}
|
|
909
|
+
return document.body
|
|
910
|
+
}
|
|
911
|
+
console.warn("[alert.js] _self alert \uc0dd\uc131 - \ubd80\ubaa8 alert\ub97c \ucc3e\uc744 \uc218 \uc5c6\uc74c");
|
|
912
|
+
return document.body
|
|
913
|
+
}
|
|
914
|
+
c = null;
|
|
915
|
+
"string" === typeof a.parent ? a.parent.startsWith("#") ? (c = a.parent.substring(1), c = document.getElementById(c)) : c = document.querySelector(a.parent) : c = a.parent;
|
|
916
|
+
if (!c) return document.body;
|
|
917
|
+
c === document.body || c.classList.contains("domquery-alert") ||
|
|
918
|
+
"static" !== getComputedStyle(c).position || (c.style.position = "relative");
|
|
919
|
+
return c
|
|
920
|
+
};
|
|
921
|
+
const D = (c, f) => {
|
|
922
|
+
const e = c === document.body || c === document.documentElement ? g.pageYOffset : c.scrollTop,
|
|
923
|
+
d = (void 0 !== f ? f : c === document.body || c === document.documentElement ? g.pageYOffset : c.scrollTop) - e;
|
|
924
|
+
let l = null;
|
|
925
|
+
const u = k => {
|
|
926
|
+
l || (l = k);
|
|
927
|
+
k = Math.min((k - l) / 600, 1);
|
|
928
|
+
const n = 1 - Math.pow(1 - k, 5);
|
|
929
|
+
c === document.body || c === document.documentElement ? g.scrollTo(0, e + d * n) : c.scrollTop = e + d * n;
|
|
930
|
+
1 > k && g.requestAnimationFrame(u)
|
|
931
|
+
};
|
|
932
|
+
g.requestAnimationFrame(u)
|
|
933
|
+
},
|
|
934
|
+
C = w(),
|
|
935
|
+
Z = !0 === ("undefined" !== typeof $ && $.isMobile ? $.isMobile() : {
|
|
936
|
+
isMobile: !1
|
|
937
|
+
}).isMobile;
|
|
938
|
+
(function() {
|
|
939
|
+
if ("_self" === a.parent) {
|
|
940
|
+
const f = b.querySelector('div[style*="overflow: auto"]');
|
|
941
|
+
f && (f.addEventListener("wheel", e => {
|
|
942
|
+
e.stopPropagation();
|
|
943
|
+
f.scrollHeight > f.clientHeight && (e.preventDefault(), f.scrollTop += e.deltaY)
|
|
944
|
+
}, {
|
|
945
|
+
passive: !1
|
|
946
|
+
}), f.addEventListener("touchmove", e => {
|
|
947
|
+
const d = Math.abs(e.touches[0].clientX - (e.touches[0].target.getBoundingClientRect().left + e.touches[0].target.offsetWidth / 2)),
|
|
948
|
+
l = Math.abs(e.touches[0].clientY -
|
|
949
|
+
(e.touches[0].target.getBoundingClientRect().top + e.touches[0].target.offsetHeight / 2));
|
|
950
|
+
d > 1.5 * l || e.stopPropagation()
|
|
951
|
+
}, {
|
|
952
|
+
passive: !0
|
|
953
|
+
}));
|
|
954
|
+
var c = x.getElement(b, ".alert-scroll-wrapper");
|
|
955
|
+
c && (c.addEventListener("wheel", e => {
|
|
956
|
+
e.target.closest('div[style*="overflow: auto"]') || e.stopPropagation()
|
|
957
|
+
}, {
|
|
958
|
+
passive: !0
|
|
959
|
+
}), c.addEventListener("touchmove", e => {
|
|
960
|
+
if (!e.target.closest('div[style*="overflow: auto"]')) {
|
|
961
|
+
var d = Math.abs(e.touches[0].clientX - (e.touches[0].target.getBoundingClientRect().left + e.touches[0].target.offsetWidth /
|
|
962
|
+
2)),
|
|
963
|
+
l = Math.abs(e.touches[0].clientY - (e.touches[0].target.getBoundingClientRect().top + e.touches[0].target.offsetHeight / 2));
|
|
964
|
+
d > 1.5 * l || e.stopPropagation()
|
|
965
|
+
}
|
|
966
|
+
}, {
|
|
967
|
+
passive: !0
|
|
968
|
+
}))
|
|
969
|
+
} else if (c = Array.from(document.querySelectorAll(".domquery-alert")), 1 < c.length || "_blank" === a.parent && 0 < c.length) {
|
|
970
|
+
const f = b.querySelector('div[style*="overflow: auto"]');
|
|
971
|
+
f && (f.addEventListener("wheel", e => {
|
|
972
|
+
e.stopPropagation();
|
|
973
|
+
f.scrollHeight > f.clientHeight && (e.preventDefault(), f.scrollTop += e.deltaY)
|
|
974
|
+
}, {
|
|
975
|
+
passive: !1
|
|
976
|
+
}), f.addEventListener("touchmove",
|
|
977
|
+
e => {
|
|
978
|
+
const d = Math.abs(e.touches[0].clientX - (e.touches[0].target.getBoundingClientRect().left + e.touches[0].target.offsetWidth / 2)),
|
|
979
|
+
l = Math.abs(e.touches[0].clientY - (e.touches[0].target.getBoundingClientRect().top + e.touches[0].target.offsetHeight / 2));
|
|
980
|
+
d > 1.5 * l || e.stopPropagation()
|
|
981
|
+
}, {
|
|
982
|
+
passive: !0
|
|
983
|
+
}));
|
|
984
|
+
b.style.overflow = "auto";
|
|
985
|
+
b.style.WebkitOverflowScrolling = "touch"
|
|
986
|
+
} else if (!a.toast || a.toast && !1 !== a.background)
|
|
987
|
+
if (Z) {
|
|
988
|
+
document.body.style.overflow = "hidden";
|
|
989
|
+
document.documentElement.style.overflow = "hidden";
|
|
990
|
+
b.style.overflow =
|
|
991
|
+
"auto";
|
|
992
|
+
b.style.WebkitOverflowScrolling = "touch";
|
|
993
|
+
document.addEventListener("touchmove", F, {
|
|
994
|
+
passive: !1
|
|
995
|
+
});
|
|
996
|
+
const f = b.querySelector('div[style*="overflow: auto"]');
|
|
997
|
+
f && (f.addEventListener("wheel", e => {
|
|
998
|
+
e.stopPropagation();
|
|
999
|
+
f.scrollHeight > f.clientHeight && (e.preventDefault(), f.scrollTop += e.deltaY)
|
|
1000
|
+
}, {
|
|
1001
|
+
passive: !1
|
|
1002
|
+
}), f.addEventListener("touchmove", e => {
|
|
1003
|
+
const d = Math.abs(e.touches[0].clientX - (e.touches[0].target.getBoundingClientRect().left + e.touches[0].target.offsetWidth / 2)),
|
|
1004
|
+
l = Math.abs(e.touches[0].clientY - (e.touches[0].target.getBoundingClientRect().top +
|
|
1005
|
+
e.touches[0].target.offsetHeight / 2));
|
|
1006
|
+
d > 1.5 * l || e.stopPropagation()
|
|
1007
|
+
}, {
|
|
1008
|
+
passive: !0
|
|
1009
|
+
}))
|
|
1010
|
+
} else if (c = document.documentElement.scrollWidth > document.documentElement.clientWidth, document.documentElement.scrollHeight > document.documentElement.clientHeight || c) b.wheelListener = f => {
|
|
1011
|
+
const e = f.target.closest('div[style*="overflow: auto"]');
|
|
1012
|
+
e ? (f.stopPropagation(), e.scrollHeight > e.clientHeight && (f.preventDefault(), e.scrollTop += f.deltaY)) : b.contains(f.target) || f.preventDefault()
|
|
1013
|
+
}, document.addEventListener("wheel", b.wheelListener, {
|
|
1014
|
+
passive: !1
|
|
1015
|
+
})
|
|
1016
|
+
})();
|
|
1017
|
+
if (void 0 !== a.autoscroll) {
|
|
1018
|
+
const c = a.id || "default-scroll-position";
|
|
1019
|
+
if ("object" === typeof a.autoscroll && null !== a.autoscroll) {
|
|
1020
|
+
var A = a.autoscroll;
|
|
1021
|
+
const f = "number" === typeof A.duration ? A.duration : 300,
|
|
1022
|
+
e = "number" === typeof A.offset ? A.offset : 20;
|
|
1023
|
+
let d = null;
|
|
1024
|
+
A.scrollKey ? d = b.querySelector(`[data-scroll-key="${A.scrollKey}"]`) : A.selector && (d = b.querySelector(A.selector));
|
|
1025
|
+
d && setTimeout(() => {
|
|
1026
|
+
const u = x.getElement(b, ".alert-scroll-wrapper") || x.getElement(b, ".domquery-alert-body");
|
|
1027
|
+
if (u && d) {
|
|
1028
|
+
var k;
|
|
1029
|
+
if ((k =
|
|
1030
|
+
x.getElement(b, ".alert-scroll-wrapper") || x.getElement(b, ".domquery-alert-body")) && d) {
|
|
1031
|
+
if ("undefined" !== typeof $ && $.fn && $.fn.offset) {
|
|
1032
|
+
var n = $(d);
|
|
1033
|
+
k = $(k);
|
|
1034
|
+
n = n.offset().top;
|
|
1035
|
+
k = k.offset().top
|
|
1036
|
+
} else {
|
|
1037
|
+
n = d.getBoundingClientRect();
|
|
1038
|
+
const N = k.getBoundingClientRect();
|
|
1039
|
+
n = n.top - N.top + k.scrollTop;
|
|
1040
|
+
k = k.scrollTop
|
|
1041
|
+
}
|
|
1042
|
+
k = n - k - e
|
|
1043
|
+
} else k = null;
|
|
1044
|
+
null !== k && 0 <= k && $.AlertScrollManager.scrollTo(u, k, f)
|
|
1045
|
+
}
|
|
1046
|
+
}, (a && "number" === typeof a.openSpeed ? a.openSpeed : 500) + 50);
|
|
1047
|
+
const l = () => {
|
|
1048
|
+
$.AlertScrollManager.savePosition(c, b)
|
|
1049
|
+
};
|
|
1050
|
+
A = [x.getElement(b, ".alert-scroll-wrapper"),
|
|
1051
|
+
x.getElement(b, ".domquery-alert-body"), b.querySelector('div[style*="overflow: auto"]'), b.querySelector('div[style*="overflow-y: auto"]'), b.querySelector('div[style*="overflow-y: scroll"]'), b
|
|
1052
|
+
].filter(u => null !== u);
|
|
1053
|
+
A.forEach(u => {
|
|
1054
|
+
u.addEventListener("scroll", l, {
|
|
1055
|
+
passive: !0
|
|
1056
|
+
})
|
|
1057
|
+
});
|
|
1058
|
+
b.scrollListener = l;
|
|
1059
|
+
b.scrollElements = A
|
|
1060
|
+
} else {
|
|
1061
|
+
const f = "number" === typeof a.autoscroll ? a.autoscroll : 300;
|
|
1062
|
+
window.requestAnimationFrame(() => {
|
|
1063
|
+
M(c, b, f)
|
|
1064
|
+
});
|
|
1065
|
+
const e = () => {
|
|
1066
|
+
$.AlertScrollManager.savePosition(c, b)
|
|
1067
|
+
};
|
|
1068
|
+
A = [x.getElement(b, ".alert-scroll-wrapper"),
|
|
1069
|
+
x.getElement(b, ".domquery-alert-body"), b.querySelector('div[style*="overflow: auto"]'), b.querySelector('div[style*="overflow-y: auto"]'), b.querySelector('div[style*="overflow-y: scroll"]'), b
|
|
1070
|
+
].filter(d => null !== d);
|
|
1071
|
+
A.forEach(d => {
|
|
1072
|
+
d.addEventListener("scroll", e, {
|
|
1073
|
+
passive: !0
|
|
1074
|
+
})
|
|
1075
|
+
});
|
|
1076
|
+
b.scrollListener = e;
|
|
1077
|
+
b.scrollElements = A
|
|
1078
|
+
}
|
|
1079
|
+
}
|
|
1080
|
+
let T = 0,
|
|
1081
|
+
q = 0,
|
|
1082
|
+
m = 0,
|
|
1083
|
+
t = 0,
|
|
1084
|
+
G = 0,
|
|
1085
|
+
aa = !1,
|
|
1086
|
+
ia = null,
|
|
1087
|
+
ka = 0,
|
|
1088
|
+
ha = 0,
|
|
1089
|
+
Y = 1,
|
|
1090
|
+
Ea = 0,
|
|
1091
|
+
ra = !1,
|
|
1092
|
+
Ba = null,
|
|
1093
|
+
ya = !1,
|
|
1094
|
+
Aa = !1,
|
|
1095
|
+
xa = 0,
|
|
1096
|
+
da = 0;
|
|
1097
|
+
if (void 0 !== a.LC || void 0 !== a.RC || void 0 !== a.TC || void 0 !== a.BC)
|
|
1098
|
+
if (!0 === a.swipe) {
|
|
1099
|
+
const c = void 0 !== a.LC ?
|
|
1100
|
+
"LC" : void 0 !== a.RC ? "RC" : void 0 !== a.TC ? "TC" : "BC";
|
|
1101
|
+
let f = x.getDocumentElement(".domquery-shadow-overlay"),
|
|
1102
|
+
e = null,
|
|
1103
|
+
d = null;
|
|
1104
|
+
const l = () => {
|
|
1105
|
+
G = t = m = q = T = 0;
|
|
1106
|
+
aa = !1;
|
|
1107
|
+
ia = null;
|
|
1108
|
+
Aa = ya = !1;
|
|
1109
|
+
ha = ka = 0;
|
|
1110
|
+
Y = 1;
|
|
1111
|
+
b.style.transition = "";
|
|
1112
|
+
f && (f.style.transition = "")
|
|
1113
|
+
};
|
|
1114
|
+
(A = x.getElement(b, ".domquery-alert-close-btn") || x.getElement(b, ".domquery-close-x-btn")) && A.addEventListener("click", l);
|
|
1115
|
+
b.querySelectorAll(".domquery-alert-cancel-btn, .domquery-alert-confirm-btn").forEach(k => {
|
|
1116
|
+
k.addEventListener("click", l)
|
|
1117
|
+
});
|
|
1118
|
+
|
|
1119
|
+
function u() {
|
|
1120
|
+
const k = b.scrollTop;
|
|
1121
|
+
ra = 1 < Math.abs(k - Ea);
|
|
1122
|
+
Ea = k;
|
|
1123
|
+
ra && (aa || ya) && (aa = !1, ia = null, Aa = ya = !1, "LC" === c || "RC" === c ? b.style.left = `${ka}px` : b.style.top = `${ha}px`, "_self" === a.parent ? (e && (e.style.opacity = Y), d && d.initialOpacity && (d.style.opacity = d.initialOpacity)) : f && (f.style.opacity = Y))
|
|
1124
|
+
}
|
|
1125
|
+
b.addEventListener("scroll", () => {
|
|
1126
|
+
u();
|
|
1127
|
+
ra && (aa = !1, ia = null, Aa = ya = !1, b.style.left = `${ka}px`, f && (f.style.opacity = Y))
|
|
1128
|
+
}, {
|
|
1129
|
+
passive: !0
|
|
1130
|
+
});
|
|
1131
|
+
b.addEventListener("touchstart", k => {
|
|
1132
|
+
if (!k.target.closest(".editor-wrapper") && !k.target.closest(".domquery-alert-close-btn, .domquery-close-x-btn, .domquery-alert-cancel-btn, .domquery-alert-confirm-btn") &&
|
|
1133
|
+
!K) {
|
|
1134
|
+
var n = Array.from(document.querySelectorAll(".domquery-alert"));
|
|
1135
|
+
if (n.findIndex(N => N.getAttribute("data-instance-id") === a.instanceId) === n.length - 1)
|
|
1136
|
+
if (T = k.touches[0].clientX, q = k.touches[0].clientY, m = Date.now(), aa = !1, ia = null, Aa = ya = !1, G = t = 0, k = b.getBoundingClientRect(), ka = k.left, ha = k.top, "_self" === a.parent) {
|
|
1137
|
+
if (e = document.querySelector(`.domquery-shadow-overlay[data-instance-id="${a.instanceId}"]`), k = parseInt(a.instanceId) - 1, d = document.querySelector(`.domquery-shadow-overlay[data-instance-id="${k}"]`)) d.initialOpacity =
|
|
1138
|
+
parseFloat(g.getComputedStyle(d).opacity)
|
|
1139
|
+
} else(f = document.querySelector(`.domquery-shadow-overlay[data-instance-id="${a.instanceId}"]`)) && (Y = parseFloat(g.getComputedStyle(f).opacity))
|
|
1140
|
+
}
|
|
1141
|
+
}, {
|
|
1142
|
+
passive: !0
|
|
1143
|
+
});
|
|
1144
|
+
b.addEventListener("touchmove", k => {
|
|
1145
|
+
if (!k.target.closest(".editor-wrapper") && (k.stopPropagation(), !k.target.closest(".domquery-alert-close-btn, .domquery-close-x-btn, .domquery-alert-cancel-btn, .domquery-alert-confirm-btn") && !K)) {
|
|
1146
|
+
var n = k.target.closest(".domquery-alert").getAttribute("data-instance-id");
|
|
1147
|
+
if (!1 !== v.options[n]?.swipe) {
|
|
1148
|
+
n = k.touches[0];
|
|
1149
|
+
var N = n.clientX - T,
|
|
1150
|
+
U = n.clientY - q;
|
|
1151
|
+
t = N;
|
|
1152
|
+
G = U;
|
|
1153
|
+
if (!ra) {
|
|
1154
|
+
n = void 0 !== a.LC ? "LC" : void 0 !== a.RC ? "RC" : void 0 !== a.TC ? "TC" : "BC";
|
|
1155
|
+
if (!aa && (8 < Math.abs(N) || 8 < Math.abs(U)) && k.cancelable && null === ia) {
|
|
1156
|
+
var H = Math.abs(N),
|
|
1157
|
+
z = Math.abs(U);
|
|
1158
|
+
const sa = 20 < H + z ? 1.3 : 2;
|
|
1159
|
+
switch (n) {
|
|
1160
|
+
case "LC":
|
|
1161
|
+
0 > N && H > z * sa && (aa = ya = ia = !0, 20 < H && (k.preventDefault(), Aa = !0));
|
|
1162
|
+
break;
|
|
1163
|
+
case "RC":
|
|
1164
|
+
0 < N && H > z * sa && (aa = ya = ia = !0, 20 < H && (k.preventDefault(), Aa = !0));
|
|
1165
|
+
break;
|
|
1166
|
+
case "TC":
|
|
1167
|
+
0 > U && z > H * sa && (ia = !1, aa = ya = !0, 20 < z && (k.preventDefault(),
|
|
1168
|
+
Aa = !0));
|
|
1169
|
+
break;
|
|
1170
|
+
case "BC":
|
|
1171
|
+
0 < U && z > H * sa && (ia = !1, aa = ya = !0, 20 < z && (k.preventDefault(), Aa = !0))
|
|
1172
|
+
}
|
|
1173
|
+
}
|
|
1174
|
+
ya && !Aa && k.cancelable && (H = Math.abs(N), z = Math.abs(U), 20 < (ia ? H : z) && (k.preventDefault(), Aa = !0));
|
|
1175
|
+
ya && (k.stopPropagation(), k = b.offsetWidth, H = b.offsetHeight, z = 1 * ("LC" === n || "RC" === n ? k : H), k = N, H = U, ia ? (H = 0, "LC" === n ? k = Math.max(-z, Math.min(0, N)) : "RC" === n && (k = Math.min(z, Math.max(0, N)))) : (k = 0, "TC" === n ? H = Math.max(-z, Math.min(0, U)) : "BC" === n && (H = Math.min(z, Math.max(0, U)))), b.style.transform = "LC" === n || "RC" === n ? `translate3d(${k}px, -50%, 0)` :
|
|
1176
|
+
`translate3d(-50%, ${H}px, 0)`, N = "LC" === n || "RC" === n ? Math.abs(k) / z : Math.abs(H) / z, "_self" === a.parent ? (e && (e.style.opacity = Y - Y * N), d && (d.style.opacity = d.initialOpacity + (1 - d.initialOpacity) * N)) : f && (f.style.opacity = Y - Y * N), v.options[a.instanceId]?.swipeCallback && "function" === typeof v.options[a.instanceId].swipeCallback && (U = Date.now(), z = "LC" === n || "RC" === n ? Math.abs(k) / Math.max(U - m, 1) : Math.abs(H) / Math.max(U - m, 1), n = {
|
|
1177
|
+
direction: n.toLowerCase(),
|
|
1178
|
+
velocity: z,
|
|
1179
|
+
timeElapsed: U - m,
|
|
1180
|
+
progress: N,
|
|
1181
|
+
deltaX: k,
|
|
1182
|
+
deltaY: H,
|
|
1183
|
+
instanceId: a.instanceId,
|
|
1184
|
+
phase: "progress"
|
|
1185
|
+
}, v.options[a.instanceId].swipeCallback(n)))
|
|
1186
|
+
}
|
|
1187
|
+
}
|
|
1188
|
+
}
|
|
1189
|
+
}, {
|
|
1190
|
+
passive: !1
|
|
1191
|
+
});
|
|
1192
|
+
b.addEventListener("touchend", k => {
|
|
1193
|
+
if (!k.target.closest(".editor-wrapper") && ya && !K)
|
|
1194
|
+
if (Ba && (cancelAnimationFrame(Ba), Ba = null), k.stopPropagation(), u(), ra) b.style.transition = `all ${p}ms`, "LC" === c || "RC" === c ? b.style.left = `${ka}px` : b.style.top = `${ha}px`, "_self" === a.parent ? (e && (e.style.transition = `opacity ${p}ms`, e.style.opacity = Y), d && d.initialOpacity && (d.style.transition = `opacity ${p}ms`, d.style.opacity = d.initialOpacity)) : f &&
|
|
1195
|
+
(f.style.transition = `opacity ${p}ms`, f.style.opacity = Y);
|
|
1196
|
+
else {
|
|
1197
|
+
k = Date.now() - m;
|
|
1198
|
+
var n = "LC" === c || "RC" === c ? Math.abs(t) / Math.max(k, 1) : Math.abs(G) / Math.max(k, 1);
|
|
1199
|
+
xa = n;
|
|
1200
|
+
da = k;
|
|
1201
|
+
if (.5 < n) {
|
|
1202
|
+
b.timeoutId && (clearTimeout(b.timeoutId), b.timeoutId = null);
|
|
1203
|
+
a.timeOut && (a.timeOut = null);
|
|
1204
|
+
b._elementInfos && b._elementInfos.forEach(H => {
|
|
1205
|
+
if (H.element) try {
|
|
1206
|
+
H.nextSibling ? H.parent.insertBefore(H.element, H.nextSibling) : H.parent.appendChild(H.element), H.element.style.display = H.originalDisplay
|
|
1207
|
+
} catch (z) {}
|
|
1208
|
+
});
|
|
1209
|
+
aa = !1;
|
|
1210
|
+
ia = null;
|
|
1211
|
+
ha = ka = G = t = m = q = T = 0;
|
|
1212
|
+
Y =
|
|
1213
|
+
1;
|
|
1214
|
+
const N = .5 < n ? Math.max(Math.floor(k / 2), 600) : Math.max(k, 600),
|
|
1215
|
+
U = document.querySelectorAll(`.domquery-${a.toast?"toast":"shadow"}-overlay[data-instance-id="${a.instanceId}"]`);
|
|
1216
|
+
U.forEach(H => {
|
|
1217
|
+
H.style.transition = `opacity ${N}ms linear`;
|
|
1218
|
+
H.style.opacity = "0"
|
|
1219
|
+
});
|
|
1220
|
+
b.style.transition = `all ${N}ms ease-out`;
|
|
1221
|
+
switch (c) {
|
|
1222
|
+
case "LC":
|
|
1223
|
+
b.style.left = "-100%";
|
|
1224
|
+
break;
|
|
1225
|
+
case "RC":
|
|
1226
|
+
b.style.left = "100%";
|
|
1227
|
+
break;
|
|
1228
|
+
case "TC":
|
|
1229
|
+
b.style.top = "-100%";
|
|
1230
|
+
break;
|
|
1231
|
+
case "BC":
|
|
1232
|
+
b.style.top = "100%"
|
|
1233
|
+
}
|
|
1234
|
+
L.setTimeoutRAF(() => {
|
|
1235
|
+
U.forEach(H => {
|
|
1236
|
+
H && H.parentNode && H.parentNode.removeChild(H)
|
|
1237
|
+
});
|
|
1238
|
+
L.setTimeoutRAF(() => {
|
|
1239
|
+
la(c.toLowerCase(), !0, 0, "swipe")
|
|
1240
|
+
}, 100)
|
|
1241
|
+
}, N)
|
|
1242
|
+
} else {
|
|
1243
|
+
b.style.transition = "all 300ms";
|
|
1244
|
+
switch (c) {
|
|
1245
|
+
case "LC":
|
|
1246
|
+
case "RC":
|
|
1247
|
+
b.style.left = `${ka}px`;
|
|
1248
|
+
b.style.transform = "translate(0, -50%)";
|
|
1249
|
+
break;
|
|
1250
|
+
case "TC":
|
|
1251
|
+
case "BC":
|
|
1252
|
+
b.style.top = `${ha}px`, b.style.transform = "translate(-50%, 0)"
|
|
1253
|
+
}
|
|
1254
|
+
"_self" === a.parent ? (e && (e.style.transition = "opacity 300ms", e.style.opacity = Y), d && d.initialOpacity && (d.style.transition = "opacity 300ms", d.style.opacity = d.initialOpacity)) : f && (f.style.transition = "opacity 300ms", f.style.opacity =
|
|
1255
|
+
Y);
|
|
1256
|
+
L.setTimeoutRAF(() => {
|
|
1257
|
+
b.style.transition = "";
|
|
1258
|
+
document.querySelectorAll(".domquery-shadow-overlay").forEach(N => {
|
|
1259
|
+
N.style.transition = ""
|
|
1260
|
+
})
|
|
1261
|
+
}, 300)
|
|
1262
|
+
}
|
|
1263
|
+
}
|
|
1264
|
+
}, {
|
|
1265
|
+
passive: !0
|
|
1266
|
+
});
|
|
1267
|
+
b.addEventListener("touchcancel", () => {
|
|
1268
|
+
aa && (aa = !1, b.style.overflow = "auto", b.style.willChange = "auto")
|
|
1269
|
+
}, {
|
|
1270
|
+
passive: !0
|
|
1271
|
+
})
|
|
1272
|
+
} else b.addEventListener("touchmove", c => {
|
|
1273
|
+
const f = c.target.closest('.alert-scroll-wrapper, [style*="overflow: auto"], [id="chat-output"], [style*="overflow-y:auto"]');
|
|
1274
|
+
a.forceScroll || a.scrollY || f && (a.scroll || a.scrollY || a.scrollX) ?
|
|
1275
|
+
c.stopPropagation() : c.preventDefault()
|
|
1276
|
+
}, {
|
|
1277
|
+
passive: !1
|
|
1278
|
+
});
|
|
1279
|
+
createAlertContext = (c, f = [], e = "default") => ({
|
|
1280
|
+
totalResults: f,
|
|
1281
|
+
arr: f,
|
|
1282
|
+
element: b,
|
|
1283
|
+
el: b,
|
|
1284
|
+
closeType: e,
|
|
1285
|
+
focus: d => {
|
|
1286
|
+
const l = b.querySelectorAll("input");
|
|
1287
|
+
l[d] && l[d].focus()
|
|
1288
|
+
},
|
|
1289
|
+
close: function(d = "xclose") {
|
|
1290
|
+
this._closeWasCalled = !0;
|
|
1291
|
+
this._closeTypeParam = d;
|
|
1292
|
+
if (this._functionCallbackExecuting) return !0;
|
|
1293
|
+
try {
|
|
1294
|
+
if ("_self" === a.parent) {
|
|
1295
|
+
const l = x.getElement(b, ".domquery-close-x-btn") || x.getElement(b, ".domquery-alert-close-btn");
|
|
1296
|
+
l ? l.click() : la(d, !0, 0, "function")
|
|
1297
|
+
} else la(d, !0, 0, "function")
|
|
1298
|
+
} catch (l) {
|
|
1299
|
+
try {
|
|
1300
|
+
const u =
|
|
1301
|
+
x.getElement(b, ".domquery-close-x-btn") || x.getElement(b, ".domquery-alert-close-btn");
|
|
1302
|
+
u && u.click()
|
|
1303
|
+
} catch (u) {
|
|
1304
|
+
console.error("[close] \uc5d0\ub7ec:", u)
|
|
1305
|
+
}
|
|
1306
|
+
}
|
|
1307
|
+
return !0
|
|
1308
|
+
},
|
|
1309
|
+
setLoading: (d, l = 0, u) => {
|
|
1310
|
+
const k = b.querySelector(".domquery-alert-loading");
|
|
1311
|
+
k ? 0 < l ? setTimeout(() => {
|
|
1312
|
+
k.style.display = d ? "flex" : "none";
|
|
1313
|
+
"function" === typeof u && u()
|
|
1314
|
+
}, l) : (k.style.display = d ? "flex" : "none", "function" === typeof u && u()) : "function" === typeof u && u()
|
|
1315
|
+
},
|
|
1316
|
+
disableParentScroll: function(d) {
|
|
1317
|
+
b._scrollPosition = {
|
|
1318
|
+
x: g.pageXOffset || document.documentElement.scrollLeft,
|
|
1319
|
+
y: g.pageYOffset || document.documentElement.scrollTop
|
|
1320
|
+
};
|
|
1321
|
+
d ? d.split(",").map(l => l.trim()).forEach(l => {
|
|
1322
|
+
"body" === l || "html" === l ? (document.body.style.cssText += "overflow: hidden !important;", document.documentElement.style.cssText += "overflow: hidden !important;") : document.querySelectorAll(l).forEach(u => {
|
|
1323
|
+
u._originalOverflow = u.style.overflow;
|
|
1324
|
+
u._originalPosition = u.style.position;
|
|
1325
|
+
u.style.cssText += "overflow: hidden !important;"
|
|
1326
|
+
})
|
|
1327
|
+
}) : (document.body.style.cssText += "overflow: hidden !important;", document.documentElement.style.cssText +=
|
|
1328
|
+
"overflow: hidden !important;");
|
|
1329
|
+
!0 === ("undefined" !== typeof $ && $.isMobile ? $.isMobile() : {
|
|
1330
|
+
isIOS: !1
|
|
1331
|
+
}).isIOS && (document.body.style.position = "fixed", document.body.style.width = "100%", document.body.style.top = `-${b._scrollPosition.y}px`);
|
|
1332
|
+
return this
|
|
1333
|
+
},
|
|
1334
|
+
enableParentScroll: function(d) {
|
|
1335
|
+
d ? d.split(",").map(l => l.trim()).forEach(l => {
|
|
1336
|
+
"body" === l || "html" === l ? (document.body.style.overflow = "", document.documentElement.style.overflow = "") : document.querySelectorAll(l).forEach(u => {
|
|
1337
|
+
void 0 !== u._originalOverflow && (u.style.overflow =
|
|
1338
|
+
u._originalOverflow, delete u._originalOverflow);
|
|
1339
|
+
void 0 !== u._originalPosition && (u.style.position = u._originalPosition, delete u._originalPosition)
|
|
1340
|
+
})
|
|
1341
|
+
}) : (document.body.style.overflow = "", document.documentElement.style.overflow = "");
|
|
1342
|
+
!0 === ("undefined" !== typeof $ && $.isMobile ? $.isMobile() : {
|
|
1343
|
+
isIOS: !1
|
|
1344
|
+
}).isIOS && (document.body.style.position = "", document.body.style.width = "", document.body.style.top = "");
|
|
1345
|
+
if (d = b._scrollPosition) g.scrollTo(d.x, d.y), delete b._scrollPosition;
|
|
1346
|
+
return this
|
|
1347
|
+
},
|
|
1348
|
+
controlElementScroll: function(d,
|
|
1349
|
+
l) {
|
|
1350
|
+
d && ("disable" === l ? (d._savedOverflow = d.style.overflow, d._savedScrollTop = d.scrollTop, d.style.overflow = "hidden") : "enable" === l && (d.style.overflow = d._savedOverflow || "auto", void 0 !== d._savedScrollTop && (d.scrollTop = d._savedScrollTop)))
|
|
1351
|
+
},
|
|
1352
|
+
next: (d, l, u = 400, k, n, N) => {
|
|
1353
|
+
let U = null;
|
|
1354
|
+
const H = "CC TC LC RC BC RL LR TB BT".split(" ");
|
|
1355
|
+
"function" === typeof l ? (N = u, n = l, u = 400, l = null) : "number" === typeof l ? ("function" === typeof u ? (N = n, n = u) : "string" === typeof u && H.includes(u) && (U = u, "function" === typeof k && (N = n, n = k)), u = l, l = null) :
|
|
1356
|
+
"function" === typeof u ? (N = n, n = u, u = 400) : "string" === typeof u && H.includes(u) ? (U = u, "function" === typeof k && (N = n, n = k), u = 400) : "number" === typeof u && "string" === typeof k && H.includes(k) && (U = k);
|
|
1357
|
+
this.totalResults || (this.totalResults = {});
|
|
1358
|
+
k = a._currentStepKey || "first";
|
|
1359
|
+
l && (Array.isArray(l) || "" !== l) && (this.totalResults[k] = l);
|
|
1360
|
+
a._nextStepKey = "" === d ? "first" : d;
|
|
1361
|
+
let z;
|
|
1362
|
+
if ((z = "" === d ? a._originalFirstStepOptions || {} : a[d]) && "object" === typeof z) {
|
|
1363
|
+
var sa = this.totalResults ? {
|
|
1364
|
+
...this.totalResults
|
|
1365
|
+
} : {},
|
|
1366
|
+
P = document.querySelector(`.domquery-alert[data-instance-id="${a.instanceId}"]`);
|
|
1367
|
+
a._stepInputValues || (a._stepInputValues = {});
|
|
1368
|
+
if (P) {
|
|
1369
|
+
l = a._currentStepKey || "first";
|
|
1370
|
+
const S = {};
|
|
1371
|
+
P.querySelectorAll("input, textarea, select").forEach((na, ja) => {
|
|
1372
|
+
S[ja] = "checkbox" === na.type || "radio" === na.type ? na.checked : na.value
|
|
1373
|
+
});
|
|
1374
|
+
0 < Object.keys(S).length && (a._stepInputValues[l] = S)
|
|
1375
|
+
}
|
|
1376
|
+
P ? L.setTimeoutRAF(() => {
|
|
1377
|
+
a._hasNext = !0;
|
|
1378
|
+
var S = {};
|
|
1379
|
+
for (var na in a) a[na] && "object" === typeof a[na] && !Array.isArray(a[na]) && "_originalFirstStepOptions" !== na && "_hasNext" !== na && "instanceId" !== na && "_stepInputValues" !== na && "_currentStepKey" !==
|
|
1380
|
+
na && (S[na] = a[na]);
|
|
1381
|
+
Object.assign(a, z, S, {
|
|
1382
|
+
function: function(Q) {
|
|
1383
|
+
this.arr = this.totalResults = {
|
|
1384
|
+
...sa
|
|
1385
|
+
};
|
|
1386
|
+
Q && (Array.isArray(Q) || "" !== Q) && (this.totalResults[d || "first"] = Q, this.arr = {
|
|
1387
|
+
...this.totalResults
|
|
1388
|
+
});
|
|
1389
|
+
if (z.function) return this._functionCallbackExecuting = !0, Q = z.function.call(this, Q), this._functionCallbackExecuting = !1, Q
|
|
1390
|
+
}
|
|
1391
|
+
});
|
|
1392
|
+
const ja = P.querySelector(".domquery-alert-body"),
|
|
1393
|
+
fa = P.querySelector(".domquery-text-container"),
|
|
1394
|
+
Ja = (Q, R, I) => {
|
|
1395
|
+
ja && void 0 !== Q && (ja.innerHTML = Q);
|
|
1396
|
+
fa && void 0 !== R && (fa.innerHTML = R);
|
|
1397
|
+
(Q = P.querySelector(".domquery-text-bottom-container")) &&
|
|
1398
|
+
void 0 !== I && (Q.innerHTML = I);
|
|
1399
|
+
const ca = "" === d ? "first" : d;
|
|
1400
|
+
a._stepInputValues && a._stepInputValues[ca] && setTimeout(() => {
|
|
1401
|
+
const pa = P.querySelectorAll("input, textarea, select"),
|
|
1402
|
+
V = a._stepInputValues[ca];
|
|
1403
|
+
V && pa.forEach((X, B) => {
|
|
1404
|
+
void 0 !== V[B] && ("checkbox" === X.type || "radio" === X.type ? X.checked = V[B] : X.value = V[B])
|
|
1405
|
+
})
|
|
1406
|
+
}, 10);
|
|
1407
|
+
a._currentStepKey = a._nextStepKey || ("" === d ? "first" : d)
|
|
1408
|
+
},
|
|
1409
|
+
Ca = (Q, R = !1) => {
|
|
1410
|
+
if (!(!Q || ja.contains(Q) || fa && fa.contains(Q))) {
|
|
1411
|
+
var I = Q.querySelector(".domquery-alert-close-btn");
|
|
1412
|
+
if (I) {
|
|
1413
|
+
if (R) {
|
|
1414
|
+
var ca = z.$Okhover ||
|
|
1415
|
+
a.$Okhover || "opacity: 1;",
|
|
1416
|
+
pa = ["padding: 6px 10px;", "background: " + (z.$OkBgcolor || z.OkBgcolor || a.$OkBgcolor || a.OkBgcolor || "#E0E0E0") + ";", "color: " + (z.$OkColor || z.OkColor || a.$OkColor || a.OkColor || "#000000") + ";", "border: none;border-radius: 3px;cursor: pointer;opacity: 0.9;font-size:0.9em;transition: all 0.2s;margin-left: 10px;", z.$OkStyle || a.$OkStyle || ""].join("");
|
|
1417
|
+
I.style.cssText = pa;
|
|
1418
|
+
I.setAttribute("onmouseover", "this.style.cssText = `" + pa + "; " + ca + "`");
|
|
1419
|
+
I.setAttribute("onmouseout", "this.style.cssText = `" +
|
|
1420
|
+
pa + "`");
|
|
1421
|
+
I.offsetHeight
|
|
1422
|
+
}
|
|
1423
|
+
if (void 0 !== z.$Ok || void 0 !== a.$Ok) I.textContent = z.$Ok || a.$Ok
|
|
1424
|
+
}
|
|
1425
|
+
if (I = Q.querySelector(".alert-cancel-btn, .domquery-alert-cancel-btn"))
|
|
1426
|
+
if (R && (R = z.$cancelhover || a.$cancelhover || "opacity: 1;", ca = ["padding: 6px 10px;", "background: " + (z.$cancelBgcolor || z.cancelBgcolor || a.$cancelBgcolor || a.cancelBgcolor || "#e74c3c") + ";", "color: " + (z.$cancelColor || z.cancelColor || a.$cancelColor || a.cancelColor || "#FFFFFF") + ";", "border: none;border-radius: 3px;cursor: pointer;opacity: 0.9;font-size:0.9em;transition: all 0.2s;margin-left: 10px;",
|
|
1427
|
+
z.$cancelStyle || a.$cancelStyle || ""
|
|
1428
|
+
].join(""), I.style.cssText = ca, I.setAttribute("onmouseover", "this.style.cssText = `" + ca + "; " + R + "`"), I.setAttribute("onmouseout", "this.style.cssText = `" + ca + "`")), void 0 !== z.$cancel || void 0 !== a.$cancel) I.textContent = z.$cancel || a.$cancel;
|
|
1429
|
+
var V = Q.querySelector(".alert-prev-btn");
|
|
1430
|
+
if (void 0 !== z.$prev && !1 !== z.$prev || void 0 !== a.$prev && !1 !== a.$prev)
|
|
1431
|
+
if (R = z.$prevhover || a.$prevhover || "opacity: 1;", ca = ["padding: 6px 10px;", "background: " + (z.$prevBgcolor || a.$prevBgcolor || "#95a5a6") +
|
|
1432
|
+
";", "color: " + (z.$prevColor || a.$prevColor || "#FFFFFF") + ";", "border: none;border-radius: 3px;cursor: pointer;opacity: 0.9;font-size:0.9em;transition: all 0.2s;margin-left: 10px;", z.$prevStyle || a.$prevStyle || ""
|
|
1433
|
+
].join(""), pa = X => {
|
|
1434
|
+
z.prev && "function" === typeof z.prev ? X.onclick = function() {
|
|
1435
|
+
const B = createAlertContext("prev", [], "button");
|
|
1436
|
+
B.close = function(ea = "xclose") {
|
|
1437
|
+
la(ea, !0, 0, "button")
|
|
1438
|
+
};
|
|
1439
|
+
z.prev.call(B)
|
|
1440
|
+
} : a.prev && "function" === typeof a.prev && (X.onclick = function() {
|
|
1441
|
+
const B = createAlertContext("prev", [], "button");
|
|
1442
|
+
B.close = function(ea = "xclose") {
|
|
1443
|
+
la(ea, !0, 0, "button")
|
|
1444
|
+
};
|
|
1445
|
+
a.prev.call(B)
|
|
1446
|
+
})
|
|
1447
|
+
}, V) {
|
|
1448
|
+
V.style.cssText = ca;
|
|
1449
|
+
V.setAttribute("onmouseover", "this.style.cssText = `" + ca + "; " + R + "`");
|
|
1450
|
+
V.setAttribute("onmouseout", "this.style.cssText = `" + ca + "`");
|
|
1451
|
+
if (void 0 !== z.$prev || void 0 !== a.$prev) V.textContent = z.$prev || a.$prev;
|
|
1452
|
+
pa(V)
|
|
1453
|
+
} else V = document.createElement("button"), V.className = "alert-prev-btn", V.style.cssText = ca, V.setAttribute("onmouseover", "this.style.cssText = `" + ca + "; " + R + "`"), V.setAttribute("onmouseout", "this.style.cssText = `" +
|
|
1454
|
+
ca + "`"), V.textContent = z.$prev || a.$prev || "\uc774\uc804", pa(V), I ? Q.insertBefore(V, I) : Q.appendChild(V);
|
|
1455
|
+
else V && V.parentNode && V.parentNode.removeChild(V)
|
|
1456
|
+
}
|
|
1457
|
+
};
|
|
1458
|
+
if (ja) {
|
|
1459
|
+
const Q = ((J, E) => {
|
|
1460
|
+
if (E) return `<div style="font-size:${a.Font||"16px"}; font-weight:bold; color:${a.titleColor||"#000000"}">${a.title}</div>\n\t\t\t\t\t\t\t\t\t\t <hr style="border:none; height:1px; background-color:rgba(0,0,0,0.1); margin:10px 0">\n\t\t\t\t\t\t\t\t\t\t <div style="font-size:${a.font||"14px"}; color:${a.color||"#000000"}">${J}</div>`;
|
|
1461
|
+
let W;
|
|
1462
|
+
J.includes("\n") ? W = J.split("\n", 2) : J.includes("<br>") && (W = J.split("<br>", 2));
|
|
1463
|
+
return W ? `<div style="font-size:${a.Font||"16px"}; font-weight:bold; color:${a.titleColor||"#000000"}">${W[0]}</div>\n\t\t\t\t\t\t\t\t\t\t <hr style="border:none; height:1px; background-color:rgba(0,0,0,0.1); margin:10px 0">\n\t\t\t\t\t\t\t\t\t\t <div style="font-size:${a.font||"14px"}; color:${a.color||"#000000"}">${W[1]}</div>` : `<div style="font-size:${a.Font||"16px"}; font-weight:bold; color:${a.titleColor||
|
|
1464
|
+
"#000000"}">${J}</div>`
|
|
1465
|
+
})(z.message || a.message || "", "" !== a.title),
|
|
1466
|
+
R = (() => {
|
|
1467
|
+
const J = void 0 !== z.text ? z.text : a.text;
|
|
1468
|
+
if (!J) return "";
|
|
1469
|
+
if ("string" === typeof J) return J;
|
|
1470
|
+
if ("function" === typeof J) try {
|
|
1471
|
+
const E = J();
|
|
1472
|
+
if ("string" === typeof E) return E;
|
|
1473
|
+
if (E instanceof Element) return E.outerHTML
|
|
1474
|
+
} catch (E) {}
|
|
1475
|
+
return ""
|
|
1476
|
+
})(),
|
|
1477
|
+
I = (() => {
|
|
1478
|
+
const J = z.textBottom;
|
|
1479
|
+
if (void 0 === J || !J) return "";
|
|
1480
|
+
if ("string" === typeof J) return J;
|
|
1481
|
+
if ("function" === typeof J) try {
|
|
1482
|
+
const E = J();
|
|
1483
|
+
if ("string" === typeof E) return E;
|
|
1484
|
+
if (E instanceof Element) return E.outerHTML
|
|
1485
|
+
} catch (E) {}
|
|
1486
|
+
return ""
|
|
1487
|
+
})(),
|
|
1488
|
+
ca = J => {
|
|
1489
|
+
if (void 0 === J) return "auto";
|
|
1490
|
+
if ("number" === typeof J) return J + "px";
|
|
1491
|
+
if ("string" === typeof J) {
|
|
1492
|
+
if (/px|%|vh|vw|rem|em|ch|ex|cm|mm|in|pt|pc/i.test(J)) return J;
|
|
1493
|
+
const E = parseFloat(J);
|
|
1494
|
+
if (!isNaN(E)) return E + "px"
|
|
1495
|
+
}
|
|
1496
|
+
return J
|
|
1497
|
+
},
|
|
1498
|
+
pa = (J, E, W, va) => {
|
|
1499
|
+
W = Object.assign({}, a, E);
|
|
1500
|
+
if (void 0 !== E.bgcolor || void 0 !== a.bgcolor) J.style.background = W.bgcolor;
|
|
1501
|
+
if (void 0 !== E.radius || void 0 !== a.radius) J.style.borderRadius = W.radius;
|
|
1502
|
+
if (void 0 !== E.border || void 0 !== a.border) J.style.border = W.border || "none";
|
|
1503
|
+
if (void 0 !== E.borderWidth || void 0 !==
|
|
1504
|
+
a.borderWidth) J.style.borderWidth = W.borderWidth || "";
|
|
1505
|
+
if (void 0 !== E.borderStyle || void 0 !== a.borderStyle) J.style.borderStyle = W.borderStyle || "";
|
|
1506
|
+
if (void 0 !== E.borderColor || void 0 !== a.borderColor) J.style.borderColor = W.borderColor || "";
|
|
1507
|
+
if (void 0 !== E.shadowBox || void 0 !== a.shadowBox) !1 === W.shadowBox ? J.style.boxShadow = "none" : "string" === typeof W.shadowBox ? J.style.boxShadow = W.shadowBox : "transparent" !== W.bgcolor && (J.style.boxShadow = "0 2px 10px rgba(0,0,0,0.3)");
|
|
1508
|
+
if (void 0 !== E.opacity || void 0 !== a.opacity) J.style.opacity =
|
|
1509
|
+
"number" === typeof W.opacity ? String(W.opacity) : "1";
|
|
1510
|
+
if (void 0 !== E.margin || void 0 !== a.margin) J.style.margin = W.margin || "0";
|
|
1511
|
+
if (void 0 !== E.padding || void 0 !== a.padding) {
|
|
1512
|
+
va = "0" === W.padding ? "0" : ca(W.padding);
|
|
1513
|
+
const oa = J.querySelector(".alert-scroll-wrapper") || J.querySelector(".domquery-alert-body")?.parentElement;
|
|
1514
|
+
oa && (oa.style.padding = va)
|
|
1515
|
+
}
|
|
1516
|
+
if (void 0 !== E.minWidth || void 0 !== a.minWidth) J.style.minWidth = W.minWidth ? ca(W.minWidth) : "";
|
|
1517
|
+
if (void 0 !== E.maxWidth || void 0 !== a.maxWidth) J.style.maxWidth = W.maxWidth ? ca(W.maxWidth) :
|
|
1518
|
+
"";
|
|
1519
|
+
if (void 0 !== E.minHeight || void 0 !== a.minHeight) J.style.minHeight = W.minHeight ? ca(W.minHeight) : "";
|
|
1520
|
+
if (void 0 !== E.maxHeight || void 0 !== a.maxHeight) J.style.maxHeight = W.maxHeight ? ca(W.maxHeight) : ""
|
|
1521
|
+
},
|
|
1522
|
+
V = Math.max(P.offsetWidth, 1) + "px",
|
|
1523
|
+
X = Math.max(P.offsetHeight, 1) + "px",
|
|
1524
|
+
B = getComputedStyle(P).width,
|
|
1525
|
+
ea = getComputedStyle(P).height;
|
|
1526
|
+
let O = B,
|
|
1527
|
+
ba = ea;
|
|
1528
|
+
void 0 !== z.width && (O = ca(z.width));
|
|
1529
|
+
void 0 !== z.height && (ba = ca(z.height));
|
|
1530
|
+
const Fa = O !== B || ba !== ea;
|
|
1531
|
+
S = u || 400;
|
|
1532
|
+
if (U) {
|
|
1533
|
+
const J = (oa, qa, ta = !1) => {
|
|
1534
|
+
const ua = ta ? -1 : 1;
|
|
1535
|
+
return "CC" === oa ? `scale(${ta?
|
|
1536
|
+
1-qa:qa})` : "LC" === oa ? `translate3d(${ua*(ta?100*qa:100*(1-qa))}%, 0, 0)` : "RC" === oa ? `translate3d(${ua*(ta?100*-qa:100*-(1-qa))}%, 0, 0)` : "TC" === oa ? `translate3d(0, ${ua*(ta?100*qa:100*(1-qa))}%, 0)` : "BC" === oa ? `translate3d(0, ${ua*(ta?100*-qa:100*-(1-qa))}%, 0)` : "RL" === oa ? `translate3d(${ua*(ta?100*-qa:100*-(1-qa))}%, 0, 0)` : "LR" === oa ? `translate3d(${ua*(ta?100*qa:100*(1-qa))}%, 0, 0)` : "TB" === oa ? `translate3d(0, ${ua*(ta?100*qa:100*(1-qa))}%, 0)` : "BT" === oa ? `translate3d(0, ${ua*(ta?100*-qa:100*-(1-qa))}%, 0)` :
|
|
1537
|
+
"translate3d(0, 0, 0)"
|
|
1538
|
+
};
|
|
1539
|
+
if (Fa) {
|
|
1540
|
+
na = Math.max(parseFloat(V), 1);
|
|
1541
|
+
const oa = Math.max(parseFloat(X), 1);
|
|
1542
|
+
P.style.width = na + "px";
|
|
1543
|
+
P.style.height = oa + "px";
|
|
1544
|
+
P.style.minWidth = na + "px";
|
|
1545
|
+
P.style.minHeight = oa + "px";
|
|
1546
|
+
P.style.maxWidth = na + "px";
|
|
1547
|
+
P.style.maxHeight = oa + "px";
|
|
1548
|
+
P.style.boxSizing = "border-box";
|
|
1549
|
+
P.offsetWidth;
|
|
1550
|
+
P.offsetHeight
|
|
1551
|
+
}
|
|
1552
|
+
ja.style.willChange = "transform, opacity";
|
|
1553
|
+
ja.style.backfaceVisibility = "hidden";
|
|
1554
|
+
ja.style.transition = "none";
|
|
1555
|
+
ja.style.transform = "translate3d(0, 0, 0)";
|
|
1556
|
+
ja.style.opacity = "1";
|
|
1557
|
+
fa && (fa.style.willChange = "transform, opacity",
|
|
1558
|
+
fa.style.backfaceVisibility = "hidden", fa.style.transition = "none", fa.style.transform = "translate3d(0, 0, 0)", fa.style.opacity = "1");
|
|
1559
|
+
"CC" === U && (ja.style.transformOrigin = "center center", fa && (fa.style.transformOrigin = "center center"));
|
|
1560
|
+
na = P.querySelectorAll(".domquery-alert-close-btn, .alert-cancel-btn, .alert-confirm-btn, .alert-prev-btn, .domquery-alert-cancel-btn, .domquery-alert-confirm-btn");
|
|
1561
|
+
let E = null;
|
|
1562
|
+
0 < na.length && (E = na[0].parentElement, !E || ja.contains(E) || fa && fa.contains(E) || (E.style.willChange = "transform, opacity",
|
|
1563
|
+
E.style.backfaceVisibility = "hidden", E.style.transition = "none", E.style.transform = "translate3d(0, 0, 0)", E.style.opacity = "1"));
|
|
1564
|
+
ja.offsetHeight;
|
|
1565
|
+
fa && fa.offsetHeight;
|
|
1566
|
+
const W = .5 * S,
|
|
1567
|
+
va = .5 * S;
|
|
1568
|
+
requestAnimationFrame(() => {
|
|
1569
|
+
const oa = performance.now(),
|
|
1570
|
+
qa = ta => {
|
|
1571
|
+
ta = Math.min((ta - oa) / W, 1);
|
|
1572
|
+
const ua = 1 - Math.pow(1 - ta, 3);
|
|
1573
|
+
ja.style.transform = J(U, ua, !0);
|
|
1574
|
+
ja.style.opacity = String(1 - ua);
|
|
1575
|
+
fa && (fa.style.transform = J(U, ua, !0), fa.style.opacity = String(1 - ua));
|
|
1576
|
+
E && (E.style.transform = J(U, ua, !0), E.style.opacity = String(1 - ua));
|
|
1577
|
+
if (1 > ta) requestAnimationFrame(qa);
|
|
1578
|
+
else {
|
|
1579
|
+
Ja(Q, R, I);
|
|
1580
|
+
ta = P.querySelectorAll(".domquery-alert-close-btn, .alert-cancel-btn, .alert-confirm-btn, .alert-prev-btn, .domquery-alert-cancel-btn, .domquery-alert-confirm-btn");
|
|
1581
|
+
let wa = null;
|
|
1582
|
+
0 < ta.length && (wa = ta[0].parentElement, Ca(wa, !1), !wa || ja.contains(wa) || fa && fa.contains(wa) || (wa.style.willChange = "transform, opacity", wa.style.backfaceVisibility = "hidden", wa.style.transition = "none", wa.style.transform = J(U, 0, !1), wa.style.opacity = "0"));
|
|
1583
|
+
ja.style.transform = J(U, 0, !1);
|
|
1584
|
+
ja.style.opacity = "0";
|
|
1585
|
+
fa && (fa.style.transform =
|
|
1586
|
+
J(U, 0, !1), fa.style.opacity = "0");
|
|
1587
|
+
pa(P, z, O || B, ba || ea);
|
|
1588
|
+
ja.offsetHeight;
|
|
1589
|
+
fa && fa.offsetHeight;
|
|
1590
|
+
requestAnimationFrame(() => {
|
|
1591
|
+
if (Fa) {
|
|
1592
|
+
const Ga = parseFloat(V);
|
|
1593
|
+
var La = parseFloat(X),
|
|
1594
|
+
Ma = O,
|
|
1595
|
+
Ka = ba,
|
|
1596
|
+
Ia = !1;
|
|
1597
|
+
"auto" === ba && (Ka = P.style.height, P.style.height = "auto", Ia = P.offsetHeight, P.style.height = Ka || La + "px", Ka = Ia + "px", Ia = !0);
|
|
1598
|
+
"auto" === O && (La = P.style.width, P.style.width = "auto", Ma = P.offsetWidth, P.style.width = La || Ga + "px", Ma += "px", Ia = !0);
|
|
1599
|
+
P.style.transition = `width ${va}ms ease-out, height ${va}ms ease-out`;
|
|
1600
|
+
P.offsetWidth;
|
|
1601
|
+
O !== B && (P.style.width =
|
|
1602
|
+
Ma);
|
|
1603
|
+
ba !== ea && (P.style.height = Ka);
|
|
1604
|
+
Ia && setTimeout(() => {
|
|
1605
|
+
"auto" === O && (P.style.width = "auto");
|
|
1606
|
+
"auto" === ba && (P.style.height = "auto");
|
|
1607
|
+
P.style.transition = ""
|
|
1608
|
+
}, va)
|
|
1609
|
+
}
|
|
1610
|
+
P.offsetHeight;
|
|
1611
|
+
const Oa = performance.now(),
|
|
1612
|
+
Na = Ga => {
|
|
1613
|
+
Ga = Math.min((Ga - Oa) / va, 1);
|
|
1614
|
+
const Ha = 1 - Math.pow(1 - Ga, 3);
|
|
1615
|
+
ja.style.transform = J(U, Ha, !1);
|
|
1616
|
+
ja.style.opacity = String(Ha);
|
|
1617
|
+
fa && (fa.style.transform = J(U, Ha, !1), fa.style.opacity = String(Ha));
|
|
1618
|
+
wa && (wa.style.transform = J(U, Ha, !1), wa.style.opacity = String(Ha));
|
|
1619
|
+
1 > Ga ? requestAnimationFrame(Na) : (ja.style.willChange = "auto",
|
|
1620
|
+
ja.style.backfaceVisibility = "", ja.style.transition = "", ja.style.transform = "", ja.style.opacity = "", "CC" === U && (ja.style.transformOrigin = ""), fa && (fa.style.willChange = "auto", fa.style.backfaceVisibility = "", fa.style.transition = "", fa.style.transform = "", fa.style.opacity = "", "CC" === U && (fa.style.transformOrigin = "")), E && (E.style.willChange = "auto", E.style.backfaceVisibility = "", E.style.transition = "", E.style.transform = "", E.style.opacity = ""), wa && (wa.style.willChange = "auto", wa.style.backfaceVisibility = "", wa.style.transition =
|
|
1621
|
+
"", wa.style.transform = "", wa.style.opacity = ""), Fa && (P.style.transition = ""), "function" === typeof n && n(this))
|
|
1622
|
+
};
|
|
1623
|
+
requestAnimationFrame(Na)
|
|
1624
|
+
})
|
|
1625
|
+
}
|
|
1626
|
+
};
|
|
1627
|
+
requestAnimationFrame(qa)
|
|
1628
|
+
})
|
|
1629
|
+
} else Fa && (O !== B && (P.style.width = O), ba !== ea && (P.style.height = ba)), pa(P, z, O || B, ba || ea), Ja(Q, R, I), S = P.querySelectorAll(".domquery-alert-close-btn, .alert-cancel-btn, .alert-confirm-btn, .alert-prev-btn, .domquery-alert-cancel-btn, .domquery-alert-confirm-btn"), 0 < S.length && Ca(S[0].parentElement, !1), "function" === typeof n && n(this)
|
|
1630
|
+
} else "function" ===
|
|
1631
|
+
typeof n && n(this)
|
|
1632
|
+
}, 0) : "function" === typeof N && N(Error("Current alert box not found"))
|
|
1633
|
+
} else "function" === typeof N && N(Error(`Next options not found for key: ${d}`))
|
|
1634
|
+
}
|
|
1635
|
+
});
|
|
1636
|
+
const za = !Object.entries(a).some(([c, f]) => "CC TC LC RC BC TL TR BL BR".split(" ").includes(c) && void 0 !== f);
|
|
1637
|
+
let Da;
|
|
1638
|
+
if (za && r) {
|
|
1639
|
+
w = w();
|
|
1640
|
+
A = w.getBoundingClientRect();
|
|
1641
|
+
let c = r.clientX,
|
|
1642
|
+
f = r.clientY,
|
|
1643
|
+
e, d;
|
|
1644
|
+
if ("_self" === a.parent) {
|
|
1645
|
+
if (A = a._parentAlert || (() => {
|
|
1646
|
+
const k = Array.from(document.querySelectorAll(".domquery-alert"));
|
|
1647
|
+
for (let n = k.length - 1; 0 <= n; n--)
|
|
1648
|
+
if (k[n].getAttribute("data-instance-id") !==
|
|
1649
|
+
a.instanceId) return k[n];
|
|
1650
|
+
return null
|
|
1651
|
+
})()) A = A.getBoundingClientRect(), c = r ? r.clientX : A.left + A.width / 2, f = r ? r.clientY : A.top + A.height / 2;
|
|
1652
|
+
e = g.innerWidth / 2;
|
|
1653
|
+
d = g.innerHeight / 2;
|
|
1654
|
+
b.style.position = "fixed"
|
|
1655
|
+
} else w !== document.body ? (b.style.position = "absolute", c -= A.left, f -= A.top, e = A.width / 2, d = A.height / 2) : (e = g.innerWidth / 2, d = g.innerHeight / 2, b.style.position = "fixed");
|
|
1656
|
+
b.style.left = c + "px";
|
|
1657
|
+
b.style.top = f + "px";
|
|
1658
|
+
b.style.transform = "translate(-50%, -50%) scale(0)";
|
|
1659
|
+
b.style.opacity = String("number" === typeof a.opacity ? a.opacity :
|
|
1660
|
+
1);
|
|
1661
|
+
w.appendChild(b);
|
|
1662
|
+
const l = performance.now(),
|
|
1663
|
+
u = k => {
|
|
1664
|
+
k = Math.min((k - l) / p, 1);
|
|
1665
|
+
if (a.easing) {
|
|
1666
|
+
[n] = a.easing.split(",").map(H => H.trim());
|
|
1667
|
+
var n = $._anieasing(0, 1, k, n)
|
|
1668
|
+
} else n = k;
|
|
1669
|
+
const N = f + (d - f) * n,
|
|
1670
|
+
U = "number" === typeof a.opacity ? a.opacity : 1;
|
|
1671
|
+
b.style.left = c + (e - c) * n + "px";
|
|
1672
|
+
b.style.top = N + "px";
|
|
1673
|
+
b.style.transform = `translate(-50%, -50%) scale(${n})`;
|
|
1674
|
+
b.style.opacity = String(U + (1 - U) * n);
|
|
1675
|
+
if (1 > k) requestAnimationFrame(u);
|
|
1676
|
+
else if (K = !1, b.style.opacity = 1, a.onOpen && "function" === typeof a.onOpen) {
|
|
1677
|
+
k = createAlertContext(null, [], "open");
|
|
1678
|
+
a.onOpen.call(k,
|
|
1679
|
+
b);
|
|
1680
|
+
if (!0 === a.scrollY || !0 === a.forceScroll)
|
|
1681
|
+
if (k = x.getElement(b, ".alert-scroll-wrapper")) k.style.overflow = "hidden auto", k.style.webkitOverflowScrolling = "touch", k.style.touchAction = "pan-y", b.querySelectorAll('[id="chat-output"], [style*="overflow-y:auto"]').forEach(H => {
|
|
1682
|
+
H.style.overflow = "auto";
|
|
1683
|
+
H.style.overflowY = "auto";
|
|
1684
|
+
H.style.webkitOverflowScrolling = "touch";
|
|
1685
|
+
H.style.touchAction = "pan-y"
|
|
1686
|
+
});
|
|
1687
|
+
if (!0 === a.noScrollRestore) {
|
|
1688
|
+
const H = x.getElement(b, ".alert-scroll-wrapper") || x.getElement(b, ".domquery-alert-body");
|
|
1689
|
+
if (H) {
|
|
1690
|
+
H.scrollTop =
|
|
1691
|
+
0;
|
|
1692
|
+
k = (a && "number" === typeof a.openSpeed ? a.openSpeed : p) || 500;
|
|
1693
|
+
let z = !1;
|
|
1694
|
+
const sa = () => {
|
|
1695
|
+
z || (H.scrollTop = 0, requestAnimationFrame(sa))
|
|
1696
|
+
};
|
|
1697
|
+
requestAnimationFrame(sa);
|
|
1698
|
+
setTimeout(() => {
|
|
1699
|
+
z = !0
|
|
1700
|
+
}, k + 50)
|
|
1701
|
+
}
|
|
1702
|
+
}
|
|
1703
|
+
if (void 0 !== a.autoscroll) {
|
|
1704
|
+
const H = a.id || "default-scroll-position",
|
|
1705
|
+
z = "number" === typeof a.autoscroll ? a.autoscroll : 300;
|
|
1706
|
+
window.requestAnimationFrame(() => {
|
|
1707
|
+
M(H, b, z)
|
|
1708
|
+
})
|
|
1709
|
+
}
|
|
1710
|
+
}
|
|
1711
|
+
};
|
|
1712
|
+
requestAnimationFrame(u);
|
|
1713
|
+
Da = {
|
|
1714
|
+
finalTransform: "translate(-50%, -50%)"
|
|
1715
|
+
}
|
|
1716
|
+
} else Da = $.scaleArr(b, a, p), b.style.opacity = 1, L.setTimeoutRAF(() => {
|
|
1717
|
+
if (a.onOpen && "function" ===
|
|
1718
|
+
typeof a.onOpen) {
|
|
1719
|
+
var c = createAlertContext(null, [], "open");
|
|
1720
|
+
a.onOpen.call(c, b);
|
|
1721
|
+
if (!0 === a.scrollY || !0 === a.forceScroll)
|
|
1722
|
+
if (c = x.getElement(b, ".alert-scroll-wrapper")) c.style.overflow = "hidden auto", c.style.webkitOverflowScrolling = "touch", c.style.touchAction = "pan-y", b.querySelectorAll('[id="chat-output"], [style*="overflow-y:auto"]').forEach(f => {
|
|
1723
|
+
f.style.overflow = "auto";
|
|
1724
|
+
f.style.overflowY = "auto";
|
|
1725
|
+
f.style.webkitOverflowScrolling = "touch";
|
|
1726
|
+
f.style.touchAction = "pan-y"
|
|
1727
|
+
});
|
|
1728
|
+
if (!0 === a.noScrollRestore) {
|
|
1729
|
+
const f = x.getElement(b,
|
|
1730
|
+
".alert-scroll-wrapper") || x.getElement(b, ".domquery-alert-body");
|
|
1731
|
+
if (f) {
|
|
1732
|
+
f.scrollTop = 0;
|
|
1733
|
+
c = (a && "number" === typeof a.openSpeed ? a.openSpeed : p) || 500;
|
|
1734
|
+
let e = !1;
|
|
1735
|
+
const d = () => {
|
|
1736
|
+
e || (f.scrollTop = 0, requestAnimationFrame(d))
|
|
1737
|
+
};
|
|
1738
|
+
requestAnimationFrame(d);
|
|
1739
|
+
setTimeout(() => {
|
|
1740
|
+
e = !0
|
|
1741
|
+
}, c + 50)
|
|
1742
|
+
}
|
|
1743
|
+
}
|
|
1744
|
+
if (void 0 !== a.autoscroll) {
|
|
1745
|
+
const f = a.id || "default-scroll-position",
|
|
1746
|
+
e = "number" === typeof a.autoscroll ? a.autoscroll : 300;
|
|
1747
|
+
window.requestAnimationFrame(() => {
|
|
1748
|
+
M(f, b, e)
|
|
1749
|
+
})
|
|
1750
|
+
}
|
|
1751
|
+
}
|
|
1752
|
+
}, 0), L.setTimeoutRAF(() => {
|
|
1753
|
+
K = !1
|
|
1754
|
+
}, p);
|
|
1755
|
+
a.loading && (w = b.querySelector(".domquery-alert-loading")) &&
|
|
1756
|
+
(w.style.display = "flex");
|
|
1757
|
+
a.TOPS && (w = {
|
|
1758
|
+
button: null,
|
|
1759
|
+
scrollListener: null,
|
|
1760
|
+
create: function() {
|
|
1761
|
+
let c = a.TOPS;
|
|
1762
|
+
if ("string" === typeof a.TOPS && a.TOPS.startsWith("#")) {
|
|
1763
|
+
const e = document.querySelector(a.TOPS);
|
|
1764
|
+
e && (c = e.innerHTML)
|
|
1765
|
+
} else !0 === a.TOPS && (c = '\n\t\t\t\t\t <div class="domquery-tops-icon" style="\n\t\t\t\t\t\t width: 40px;\n\t\t\t\t\t\t height: 40px;\n\t\t\t\t\t\t background-color: transparent;\n\t\t\t\t\t\t border-radius: 50%;\n\t\t\t\t\t\t display: flex;\n\t\t\t\t\t\t justify-content: center;\n\t\t\t\t\t\t align-items: center;\n\t\t\t\t\t\t border: 2px solid rgba(150, 150, 150, 0.5);\n\t\t\t\t\t\t transition: all 0.3s ease;\n\t\t\t\t\t ">\n\t\t\t\t\t\t <svg width="20" height="20" viewBox="0 0 24 24" fill="rgba(100, 100, 100, 0.8)">\n\t\t\t\t\t\t\t <path d="M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z"></path>\n\t\t\t\t\t\t </svg>\n\t\t\t\t\t </div>\n\t\t\t\t\t');
|
|
1766
|
+
"static" === getComputedStyle(b).position && (b.style.position = "relative");
|
|
1767
|
+
this.button = document.createElement("div");
|
|
1768
|
+
this.button.className = "domquery-tops-button";
|
|
1769
|
+
this.button.setAttribute("data-instance-id", y);
|
|
1770
|
+
this.button.innerHTML = c;
|
|
1771
|
+
this.button.style.cssText = `\n\t\t\t\t\tposition: fixed;\n\t\t\t\t\tbottom: 15px;\n\t\t\t\t\tright: ${Z?"15px":"35px"};\n\t\t\t\t\topacity: 0;\n\t\t\t\t\ttransform: scale(0.7);\n\t\t\t\t\tcursor: pointer;\n\t\t\t\t\tz-index: 9999;\n\t\t\t\t\ttransition: all 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);\n\t\t\t\t `;
|
|
1772
|
+
Z;
|
|
1773
|
+
this.button.addEventListener("mouseenter", () => {
|
|
1774
|
+
var e = this.button.querySelector(".domquery-tops-icon");
|
|
1775
|
+
e && (e.style.backgroundColor = "rgba(50, 50, 50, 0.8)", e.style.border = "2px solid rgba(70, 70, 70, 0.9)", e.style.boxShadow = "0 3px 8px rgba(0, 0, 0, 0.5)", e.style.transform = "scale(1.1)", (e = e.querySelector("svg")) && e.setAttribute("fill", "rgba(230, 230, 230, 0.9)"))
|
|
1776
|
+
});
|
|
1777
|
+
this.button.addEventListener("mouseleave", () => {
|
|
1778
|
+
var e = x.getElement(this.button, ".domquery-tops-icon");
|
|
1779
|
+
e && (e.style.backgroundColor = "transparent",
|
|
1780
|
+
e.style.border = "2px solid rgba(150, 150, 150, 0.5)", e.style.boxShadow = "none", e.style.transform = "scale(1)", (e = x.getElement(e, "svg")) && e.setAttribute("fill", "rgba(100, 100, 100, 0.8)"))
|
|
1781
|
+
});
|
|
1782
|
+
b.appendChild(this.button);
|
|
1783
|
+
const f = x.getElement(b, ".alert-scroll-wrapper") || x.getElement(b, ".domquery-alert-body") || b.querySelector('div[style*="overflow: auto"]') || b;
|
|
1784
|
+
this.scrollListener = () => {
|
|
1785
|
+
const e = f.scrollTop,
|
|
1786
|
+
d = f.clientHeight,
|
|
1787
|
+
l = f.scrollHeight;
|
|
1788
|
+
l > d ? .1 < e / (l - d) ? (this.button.style.opacity = "1", this.button.style.transform =
|
|
1789
|
+
"scale(1)") : (this.button.style.opacity = "0", this.button.style.transform = "scale(0.7)") : (this.button.style.opacity = "0", this.button.style.transform = "scale(0.7)")
|
|
1790
|
+
};
|
|
1791
|
+
f.addEventListener("scroll", this.scrollListener, {
|
|
1792
|
+
passive: !0
|
|
1793
|
+
});
|
|
1794
|
+
this.scrollListener();
|
|
1795
|
+
this.button.addEventListener("click", () => {
|
|
1796
|
+
f.scrollTo({
|
|
1797
|
+
top: 0,
|
|
1798
|
+
behavior: "smooth"
|
|
1799
|
+
})
|
|
1800
|
+
});
|
|
1801
|
+
this.button.addEventListener("touchend", e => {
|
|
1802
|
+
e.preventDefault();
|
|
1803
|
+
f.scrollTo({
|
|
1804
|
+
top: 0,
|
|
1805
|
+
behavior: "smooth"
|
|
1806
|
+
})
|
|
1807
|
+
}, {
|
|
1808
|
+
passive: !1
|
|
1809
|
+
})
|
|
1810
|
+
},
|
|
1811
|
+
cleanup: function() {
|
|
1812
|
+
const c = x.getElement(b, ".alert-scroll-wrapper") ||
|
|
1813
|
+
x.getElement(b, ".domquery-alert-body") || b.querySelector('div[style*="overflow: auto"]') || b;
|
|
1814
|
+
this.scrollListener && c.removeEventListener("scroll", this.scrollListener, {
|
|
1815
|
+
passive: !0
|
|
1816
|
+
});
|
|
1817
|
+
this.button && this.button.parentNode && this.button.parentNode.removeChild(this.button)
|
|
1818
|
+
}
|
|
1819
|
+
}, w.create(), b.topsManager = w);
|
|
1820
|
+
const la = (c, f = !1, e, d = "default") => {
|
|
1821
|
+
if (K && (!f || "function" !== d)) return Promise.resolve();
|
|
1822
|
+
K = !0;
|
|
1823
|
+
v.closingAlerts.add(y);
|
|
1824
|
+
b && (x.clearParentCache(b), x.invalidateDocument(".domquery-alert"));
|
|
1825
|
+
if ("_blank" === a.parent) {
|
|
1826
|
+
1 < Array.from(document.querySelectorAll(".domquery-alert")).length ||
|
|
1827
|
+
(document.body.style.overflow = "", document.documentElement.style.overflow = "", !0 === ("undefined" !== typeof $ && $.isMobile ? $.isMobile() : {
|
|
1828
|
+
isIOS: !1
|
|
1829
|
+
}).isIOS && (document.body.style.position = "", document.body.style.width = "", document.body.style.top = "", window.scrollTo(0, parseInt(scrollY || "0"))));
|
|
1830
|
+
try {
|
|
1831
|
+
const n = a.instanceId;
|
|
1832
|
+
var l = document.querySelector(`.domquery-shadow-overlay[data-instance-id="${n}"]`);
|
|
1833
|
+
l && l.parentNode && l.setAttribute("data-related-alert", n);
|
|
1834
|
+
const N = document.querySelector(`.domquery-blank-iframe[data-instance-id="${n}"]`);
|
|
1835
|
+
if (N && N.parentNode) {
|
|
1836
|
+
try {
|
|
1837
|
+
N.contentWindow && (N.contentWindow._alertInstance = null, N.contentWindow._alertOptions = null, N.contentDocument && (N.contentDocument.body.innerHTML = ""))
|
|
1838
|
+
} catch (H) {}
|
|
1839
|
+
N.parentNode.removeChild(N)
|
|
1840
|
+
}
|
|
1841
|
+
const U = document.querySelectorAll(".domquery-blank-container");
|
|
1842
|
+
if (0 < U.length) {
|
|
1843
|
+
const H = Array.from(U).sort((sa, P) => {
|
|
1844
|
+
sa = parseInt(window.getComputedStyle(sa).zIndex || 0);
|
|
1845
|
+
return parseInt(window.getComputedStyle(P).zIndex || 0) - sa
|
|
1846
|
+
});
|
|
1847
|
+
0 < H.length && parseInt(window.getComputedStyle(H[0]).zIndex || 0);
|
|
1848
|
+
let z =
|
|
1849
|
+
0;
|
|
1850
|
+
H.forEach(sa => {
|
|
1851
|
+
const P = sa.getAttribute("data-instance-id");
|
|
1852
|
+
if (P !== n) {
|
|
1853
|
+
var S = parseInt(window.getComputedStyle(sa).zIndex || 0);
|
|
1854
|
+
P && (sa = document.querySelector(`.domquery-shadow-overlay[data-instance-id="${P}"]`)) && (S -= 20, sa.style.zIndex = S.toString(), sa.setAttribute("data-related-container", P), S > z && (z = S))
|
|
1855
|
+
}
|
|
1856
|
+
})
|
|
1857
|
+
}
|
|
1858
|
+
} catch (n) {}
|
|
1859
|
+
}
|
|
1860
|
+
v.observers && v.observers[a.instanceId] && (v.observers[a.instanceId].disconnect(), delete v.observers[a.instanceId]);
|
|
1861
|
+
g.alertScrollHandlers && g.alertScrollHandlers[a.instanceId] && (l = g.alertScrollHandlers[a.instanceId],
|
|
1862
|
+
l.element && l.handler && l.element.removeEventListener("scroll", l.handler), delete g.alertScrollHandlers[a.instanceId]);
|
|
1863
|
+
g.alertScrollStyles && g.alertScrollStyles[a.instanceId] && (document.head.removeChild(g.alertScrollStyles[a.instanceId]), delete g.alertScrollStyles[a.instanceId]);
|
|
1864
|
+
$.AlertScrollManager.isUserScrolling[a.instanceId] && delete $.AlertScrollManager.isUserScrolling[a.instanceId];
|
|
1865
|
+
$.AlertScrollManager.lastScrollTime[a.instanceId] && delete $.AlertScrollManager.lastScrollTime[a.instanceId];
|
|
1866
|
+
$.AlertScrollManager.scrollStates[a.instanceId] &&
|
|
1867
|
+
delete $.AlertScrollManager.scrollStates[a.instanceId];
|
|
1868
|
+
void 0 !== a.autoscroll && ($.AlertScrollManager.savePosition(a.id || "default-scroll-position", b), b.scrollListener && b.scrollElements && (b.scrollElements.forEach(n => {
|
|
1869
|
+
n.removeEventListener("scroll", b.scrollListener)
|
|
1870
|
+
}), delete b.scrollListener, delete b.scrollElements));
|
|
1871
|
+
try {
|
|
1872
|
+
a.instanceId && document.querySelectorAll(`.virtual-input-layer[data-alert-id="${a.instanceId}"]`).forEach(n => {
|
|
1873
|
+
n && n.parentNode && n.parentNode.removeChild(n)
|
|
1874
|
+
});
|
|
1875
|
+
var u = document.querySelectorAll(".virtual-input-layer");
|
|
1876
|
+
0 < u.length && u.forEach(n => {
|
|
1877
|
+
n && n.parentNode && n.parentNode.removeChild(n)
|
|
1878
|
+
});
|
|
1879
|
+
Array.from(document.body.children).forEach(n => {
|
|
1880
|
+
n.className && n.className.includes("virtual-input-layer") && document.body.removeChild(n)
|
|
1881
|
+
})
|
|
1882
|
+
} catch (n) {}
|
|
1883
|
+
b.timeoutId && (clearTimeout(b.timeoutId), b.timeoutId = null);
|
|
1884
|
+
if (u = b.querySelector(".domquery-alert-loading")) u.style.display = "none";
|
|
1885
|
+
const k = e || a && a._closeSpeed || p;
|
|
1886
|
+
return new Promise(n => {
|
|
1887
|
+
let N = !1,
|
|
1888
|
+
U = !1;
|
|
1889
|
+
if (!f && c && a.text && "function" === typeof a.function) {
|
|
1890
|
+
var H = Array.from(b.querySelectorAll("input, textarea, select"));
|
|
1891
|
+
const Q = [],
|
|
1892
|
+
R = {},
|
|
1893
|
+
I = new Set,
|
|
1894
|
+
ca = new Map,
|
|
1895
|
+
pa = new Map;
|
|
1896
|
+
H.forEach(B => {
|
|
1897
|
+
var ea = B.type;
|
|
1898
|
+
"checkbox" === ea ? (ea = B.name || "checkbox", ca.has(ea) || ca.set(ea, []), B.checked && ca.get(ea).push(B.value || "true")) : "radio" === ea && B.checked && (ea = B.name || "radio", pa.has(ea) || pa.set(ea, B.value || "true"))
|
|
1899
|
+
});
|
|
1900
|
+
H.forEach(B => {
|
|
1901
|
+
const ea = B.type;
|
|
1902
|
+
var O = B.tagName.toLowerCase();
|
|
1903
|
+
if ("checkbox" === ea) B = B.name || "checkbox", O = `checkbox_${B}`, I.has(O) || (B = ca.get(B) || [], 0 < B.length && (Q.push(B), R.checkbox = B), I.add(O));
|
|
1904
|
+
else if ("radio" === ea) {
|
|
1905
|
+
if (B = B.name || "radio",
|
|
1906
|
+
O = `radio_${B}`, !I.has(O)) {
|
|
1907
|
+
if (B = pa.get(B)) Q.push(B), R.radio = B;
|
|
1908
|
+
I.add(O)
|
|
1909
|
+
}
|
|
1910
|
+
} else "select" === O ? Q.push(B.value) : (B = B.value.replace(/[`'"]/g, ""), B = Q.push(B) - 1, "textarea" === O && (R.textarea = B))
|
|
1911
|
+
});
|
|
1912
|
+
for (var z in R) Q[z] = "textarea" === z && "number" === typeof R[z] ? Q[R[z]] : R[z];
|
|
1913
|
+
this.totalResults || (this.totalResults = []);
|
|
1914
|
+
const V = createAlertContext(c, this.totalResults, "function");
|
|
1915
|
+
V._closeWasCalled = !1;
|
|
1916
|
+
H = g.$closeAlert;
|
|
1917
|
+
let X;
|
|
1918
|
+
if ("_self" === a.parent || "_blank" === a.parent) X = () => {
|
|
1919
|
+
V._closeWasCalled = !0;
|
|
1920
|
+
L.setTimeoutRAF(() => {
|
|
1921
|
+
const B = x.getElement(b,
|
|
1922
|
+
".domquery-close-x-btn") || x.getElement(b, ".domquery-alert-close-btn");
|
|
1923
|
+
if (B) B.click();
|
|
1924
|
+
else try {
|
|
1925
|
+
la("xclose", !0, 0, "force_close")
|
|
1926
|
+
} catch (ea) {}
|
|
1927
|
+
}, 0);
|
|
1928
|
+
return !0
|
|
1929
|
+
}, g.$closeAlert = function(...B) {
|
|
1930
|
+
return X()
|
|
1931
|
+
};
|
|
1932
|
+
V._functionCallbackExecuting = !0;
|
|
1933
|
+
a.function.call(V, Q);
|
|
1934
|
+
V._functionCallbackExecuting = !1;
|
|
1935
|
+
g.$closeAlert = H;
|
|
1936
|
+
if (V._closeWasCalled) return la(V._closeTypeParam || "close", !0, 0, "function");
|
|
1937
|
+
K = !1;
|
|
1938
|
+
v.closingAlerts.delete(y);
|
|
1939
|
+
return Promise.resolve()
|
|
1940
|
+
}
|
|
1941
|
+
const sa = a.toast ? ".domquery-toast-overlay" : ".domquery-shadow-overlay",
|
|
1942
|
+
P = `${sa}[data-instance-id="${a.instanceId}"]`,
|
|
1943
|
+
S = "TC LC RC BC TL TR BL BR".split(" ").find(Q => void 0 !== a[Q]),
|
|
1944
|
+
na = S && !1 === a[S];
|
|
1945
|
+
let ja;
|
|
1946
|
+
if (a.easing) {
|
|
1947
|
+
const [Q, R] = a.easing.split(",").map(I => I.trim());
|
|
1948
|
+
ja = R || Q
|
|
1949
|
+
}
|
|
1950
|
+
const fa = performance.now(),
|
|
1951
|
+
Ja = () => {
|
|
1952
|
+
const Q = document.createElement("div");
|
|
1953
|
+
Q.style.position = "fixed";
|
|
1954
|
+
Q.style.zIndex = a.zindex;
|
|
1955
|
+
const R = b.offsetWidth,
|
|
1956
|
+
I = b.offsetHeight;
|
|
1957
|
+
Q.style.width = R + "px";
|
|
1958
|
+
Q.style.height = I + "px";
|
|
1959
|
+
Q.style.left = "50%";
|
|
1960
|
+
Q.style.top = "50%";
|
|
1961
|
+
Q.style.transform = "translate(-50%, -50%)";
|
|
1962
|
+
Q.style.pointerEvents = "none";
|
|
1963
|
+
const ca = b.parentNode;
|
|
1964
|
+
ca && ca.insertBefore(Q,
|
|
1965
|
+
b);
|
|
1966
|
+
Q.appendChild(b);
|
|
1967
|
+
b.style.position = "relative";
|
|
1968
|
+
b.style.left = "50%";
|
|
1969
|
+
b.style.top = "50%";
|
|
1970
|
+
b.style.width = R + "px";
|
|
1971
|
+
b.style.height = I + "px";
|
|
1972
|
+
return Q
|
|
1973
|
+
};
|
|
1974
|
+
Z && (document.body.style.overflow = "", document.documentElement.style.overflow = "", document.removeEventListener("touchmove", F));
|
|
1975
|
+
if (!0 === a.fastMode) {
|
|
1976
|
+
H = document.querySelector(`${sa}[data-instance-id="${y}"]`);
|
|
1977
|
+
if (a.easing) {
|
|
1978
|
+
const [R, I] = a.easing.split(",").map(ca => ca.trim());
|
|
1979
|
+
z = I || R
|
|
1980
|
+
} else z = "ease-out";
|
|
1981
|
+
const Q = function(R) {
|
|
1982
|
+
switch (R) {
|
|
1983
|
+
case "linear":
|
|
1984
|
+
return "linear";
|
|
1985
|
+
case "easeOutQuint":
|
|
1986
|
+
return "cubic-bezier(0.22, 1, 0.36, 1)";
|
|
1987
|
+
case "easeInOutQuint":
|
|
1988
|
+
return "cubic-bezier(0.83, 0, 0.17, 1)";
|
|
1989
|
+
case "easeInQuint":
|
|
1990
|
+
return "cubic-bezier(0.64, 0, 0.78, 0)";
|
|
1991
|
+
default:
|
|
1992
|
+
return "ease-out"
|
|
1993
|
+
}
|
|
1994
|
+
}(z);
|
|
1995
|
+
!0 === a.hide && b.querySelectorAll(".domquery-alert-body, .domquery-text-container, .domquery-text-bottom-container, .domquery-alert-close-btn, .alert-scroll-wrapper > div").forEach(R => {
|
|
1996
|
+
R && (R.style.transition = `opacity ${k/2}ms ${Q}`, R.style.opacity = "0")
|
|
1997
|
+
});
|
|
1998
|
+
H && (H.style.transition = `opacity ${k}ms ${Q}`, H.style.opacity = "0");
|
|
1999
|
+
H = void 0 !== a.CC;
|
|
2000
|
+
if (na)
|
|
2001
|
+
if (["TL", "TR",
|
|
2002
|
+
"BL", "BR"
|
|
2003
|
+
].includes(S)) {
|
|
2004
|
+
z = S.endsWith("L") ? "left" : "right";
|
|
2005
|
+
var Ca = S.startsWith("T") ? "top" : "bottom";
|
|
2006
|
+
z = `translate(${"right"===z?100:-100}%, ${"bottom"===Ca?100:-100}%)`
|
|
2007
|
+
} else z = ["LC", "RC"].includes(S) ? `translate(${"LC"===S?-100:100}%, -50%)` : ["TC", "BC"].includes(S) ? `translate(-50%, ${"TC"===S?-100:100}%)` : H ? "translate(-50%, -50%) scale(0.8)" : "scale(0.8)";
|
|
2008
|
+
else z = H ? "translate(-50%, -50%) scale(0.8)" : "scale(0.8)";
|
|
2009
|
+
b.style.willChange = "transform, opacity";
|
|
2010
|
+
b.style.backfaceVisibility = "hidden";
|
|
2011
|
+
if (z.includes("scale")) {
|
|
2012
|
+
Ca =
|
|
2013
|
+
"center center";
|
|
2014
|
+
if (S && !na)
|
|
2015
|
+
if ("BL" === S) Ca = "left bottom";
|
|
2016
|
+
else if ("BR" === S) Ca = "right bottom";
|
|
2017
|
+
else if ("TL" === S) Ca = "left top";
|
|
2018
|
+
else if ("TR" === S) Ca = "right top";
|
|
2019
|
+
else if ("TC" === S) Ca = "center top";
|
|
2020
|
+
else if ("BC" === S) Ca = "center bottom";
|
|
2021
|
+
else if ("LC" === S) Ca = "left center";
|
|
2022
|
+
else if ("RC" === S) Ca = "right center";
|
|
2023
|
+
else if ("CC" === S || H) Ca = "center center";
|
|
2024
|
+
b.style.transformOrigin = Ca
|
|
2025
|
+
}
|
|
2026
|
+
H = z;
|
|
2027
|
+
z.includes("translate") && !z.includes("translate3d") && (H = z.replace(/translate\(([^)]+)\)/g, "translate3d($1, 0)"));
|
|
2028
|
+
b.style.transition = `transform ${k}ms ${Q}, opacity ${k}ms ${Q}`;
|
|
2029
|
+
b.style.opacity = "0";
|
|
2030
|
+
b.style.transform = H;
|
|
2031
|
+
L.setTimeoutRAF(() => {
|
|
2032
|
+
b.style.willChange && (b.style.willChange = "auto", b.style.backfaceVisibility = "");
|
|
2033
|
+
K = !1;
|
|
2034
|
+
b._elementInfos && b._elementInfos.forEach(I => {
|
|
2035
|
+
I.element && (I.element.style.display = "none" === I.originalDisplay ? "none" : I.originalDisplay, I.parent && (I.nextSibling ? I.parent.insertBefore(I.element, I.nextSibling) : I.parent.appendChild(I.element)))
|
|
2036
|
+
});
|
|
2037
|
+
b.wrapper && b.wrapper.parentNode && b.wrapper.parentNode.removeChild(b.wrapper);
|
|
2038
|
+
var R = C.querySelector(P);
|
|
2039
|
+
R && R.remove();
|
|
2040
|
+
"_blank" === a.parent ? [`.domquery-shadow-overlay[data-connected-alert="${a.instanceId}"]`, `.domquery-shadow-overlay[data-related-alert="${a.instanceId}"]`, `.domquery-shadow-overlay[data-instance-id="${a.instanceId}"]`, `.domquery-blank-overlay[data-instance-id="${a.instanceId}"]`, `.domquery-blank-overlay[data-connected-alert="${a.instanceId}"]`].forEach(I => {
|
|
2041
|
+
document.querySelectorAll(I).forEach(ca => {
|
|
2042
|
+
ca && ca.parentNode && ca.remove()
|
|
2043
|
+
})
|
|
2044
|
+
}) : (R = document.querySelector(P)) && R.remove();
|
|
2045
|
+
if ("_blank" === a.parent && (document.querySelectorAll(`.domquery-alert[data-parent-instance-id="${y}"]`).forEach(I => {
|
|
2046
|
+
const ca = I.getAttribute("data-instance-id");
|
|
2047
|
+
if (ca && g.$closeAlert) try {
|
|
2048
|
+
const pa = I.querySelector(".domquery-close-x-btn") || I.querySelector(".domquery-alert-close-btn");
|
|
2049
|
+
if (pa) pa.click();
|
|
2050
|
+
else {
|
|
2051
|
+
I.parentNode && I.parentNode.removeChild(I);
|
|
2052
|
+
const V = document.querySelector(`.domquery-shadow-overlay[data-instance-id="${ca}"]`);
|
|
2053
|
+
V && V.parentNode && V.parentNode.removeChild(V)
|
|
2054
|
+
}
|
|
2055
|
+
} catch (pa) {
|
|
2056
|
+
I.parentNode && I.parentNode.removeChild(I)
|
|
2057
|
+
}
|
|
2058
|
+
}), (R = document.getElementById("domquery-blank-container-" + y)) && R.parentNode)) {
|
|
2059
|
+
const I = R.querySelector(".domquery-blank-iframe");
|
|
2060
|
+
if (I) try {
|
|
2061
|
+
I.contentWindow && (I.contentWindow._alertInstance = null, I.contentWindow._alertOptions = null, I.contentDocument && (I.contentDocument.body.innerHTML = ""))
|
|
2062
|
+
} catch (ca) {}
|
|
2063
|
+
R.parentNode.removeChild(R)
|
|
2064
|
+
}
|
|
2065
|
+
a.toast || !1 === a.History || (U = !0);
|
|
2066
|
+
R = "true" === b.getAttribute("data-offout");
|
|
2067
|
+
C !== document.body && void 0 !== C._originalOverflow && (C.style.overflow = C._originalOverflow, delete C._originalOverflow);
|
|
2068
|
+
b && b.parentNode && b.parentNode.removeChild(b);
|
|
2069
|
+
0 === document.querySelectorAll(".domquery-alert").length ? (b.wheelListener &&
|
|
2070
|
+
(document.removeEventListener("wheel", b.wheelListener, {
|
|
2071
|
+
passive: !1
|
|
2072
|
+
}), delete b.wheelListener), !1 === a.retainScroll ? (document.body.style.overflow = "", document.documentElement.style.overflow = "", void 0 !== document.body._originalOverflowX && (document.body.style.overflowX = document.body._originalOverflowX, document.documentElement.style.overflowX = document.documentElement._originalOverflowX, delete document.body._originalOverflowX, delete document.documentElement._originalOverflowX)) : R && a.History || (document.body.style.overflow =
|
|
2073
|
+
"", document.documentElement.style.overflow = "", void 0 !== document.body._originalOverflowX && (document.body.style.overflowX = document.body._originalOverflowX, document.documentElement.style.overflowX = document.documentElement._originalOverflowX, delete document.body._originalOverflowX, delete document.documentElement._originalOverflowX), !0 === ("undefined" !== typeof $ && $.isMobile ? $.isMobile() : {
|
|
2074
|
+
isIOS: !1
|
|
2075
|
+
}).isIOS && (document.body.style.position = "", document.body.style.width = "", document.body.style.top = ""))) : b.wheelListener &&
|
|
2076
|
+
(document.removeEventListener("wheel", b.wheelListener, {
|
|
2077
|
+
passive: !1
|
|
2078
|
+
}), delete b.wheelListener);
|
|
2079
|
+
a.onClose && "function" === typeof a.onClose && (R = createAlertContext(c, this.totalResults, d), a.onClose.call(R), 1 >= document.querySelectorAll(".domquery-alert").length && !1 !== a.retainScroll && (document.body.style.overflow = "", document.documentElement.style.overflow = ""));
|
|
2080
|
+
N || null === c || "function" !== typeof h || (N = !0, setTimeout(() => {
|
|
2081
|
+
v.callbackExecuting = !0;
|
|
2082
|
+
try {
|
|
2083
|
+
h(c, d)
|
|
2084
|
+
} finally {
|
|
2085
|
+
v.callbackExecuting = !1
|
|
2086
|
+
}
|
|
2087
|
+
}, 0));
|
|
2088
|
+
U && !a.toast && !1 !== a.History ?
|
|
2089
|
+
(R = !0 === a.closeBack ? void 0 : 0, domquery(window).historyOff("alert_" + y, function() {
|
|
2090
|
+
v.closingAlerts.delete(y);
|
|
2091
|
+
!0 !== a.closeBack && ("number" === typeof a.retainScroll ? D(C, a.retainScroll) : 0 === document.querySelectorAll(".domquery-alert").length && (document.body.style.overflow = "", document.documentElement.style.overflow = ""));
|
|
2092
|
+
U && n()
|
|
2093
|
+
}, R)) : v.closingAlerts.delete(y);
|
|
2094
|
+
a.History && !a.toast && (R = "overlay_" + y, domquery(window).historyOff(R));
|
|
2095
|
+
U || n()
|
|
2096
|
+
}, k + 20)
|
|
2097
|
+
} else {
|
|
2098
|
+
const Q = function(R) {
|
|
2099
|
+
const I = document.querySelector(`${sa}[data-instance-id="${y}"]`),
|
|
2100
|
+
ca = I ? parseFloat(g.getComputedStyle(I).opacity) : 0,
|
|
2101
|
+
pa = "number" === typeof a.opacity ? a.opacity : 1;
|
|
2102
|
+
let V;
|
|
2103
|
+
if (a.easing) {
|
|
2104
|
+
const [X, B] = a.easing.split(",").map(ea => ea.trim());
|
|
2105
|
+
V = B || X
|
|
2106
|
+
}!0 === a.hide && b.querySelectorAll(".domquery-alert-body, .domquery-text-container, .domquery-text-bottom-container, .domquery-alert-close-btn, .alert-scroll-wrapper > div").forEach(X => {
|
|
2107
|
+
X && (X.style.transition = "opacity 0.3s ease", X.style.opacity = "1")
|
|
2108
|
+
});
|
|
2109
|
+
return function(X) {
|
|
2110
|
+
var B = X - fa;
|
|
2111
|
+
X = Math.min(B / k, 1);
|
|
2112
|
+
if (!0 === a.hide) {
|
|
2113
|
+
var ea = b.querySelectorAll(".domquery-alert-body, .domquery-text-container, .domquery-text-bottom-container, .domquery-alert-close-btn, .alert-scroll-wrapper > div");
|
|
2114
|
+
const E = Math.max(0, 1 - 2 * X);
|
|
2115
|
+
ea.forEach(W => {
|
|
2116
|
+
W && (W.style.opacity = E.toString())
|
|
2117
|
+
})
|
|
2118
|
+
}
|
|
2119
|
+
if (na)
|
|
2120
|
+
if (ea = $._anieasing(0, 1, X, V), ["TL", "TR", "BL", "BR"].includes(S)) {
|
|
2121
|
+
var O = S.endsWith("L") ? "left" : "right";
|
|
2122
|
+
var ba = S.startsWith("T") ? "top" : "bottom";
|
|
2123
|
+
O = "right" === O ? 100 : -100;
|
|
2124
|
+
ba = "bottom" === ba ? 100 : -100;
|
|
2125
|
+
if (1 > B) O = null;
|
|
2126
|
+
else {
|
|
2127
|
+
var Fa = $._anieasing(0, 1, Math.min((B - 1) / k, 1), V);
|
|
2128
|
+
O = `translate3d(${O*Fa}%, ${ba*Fa}%, 0)`
|
|
2129
|
+
}
|
|
2130
|
+
null !== O && 1 <= B && (1 <= B && !b._willChangeApplied && (b.style.willChange = "transform, opacity", b.style.backfaceVisibility = "hidden",
|
|
2131
|
+
b._willChangeApplied = !0), b.style.transform = O);
|
|
2132
|
+
b.style.opacity = 1 - (1 - pa) * ea
|
|
2133
|
+
} else ["LC", "RC"].includes(S) ? (O = "LC" === S ? -100 : 100, 1 > B ? O = null : (ba = $._anieasing(0, 1, Math.min((B - 1) / k, 1), V), O = `translate3d(${O*ba}%, -50%, 0)`), null !== O && 1 <= B && (1 <= B && !b._willChangeApplied && (b.style.willChange = "transform, opacity", b.style.backfaceVisibility = "hidden", b._willChangeApplied = !0), b.style.transform = O), b.style.opacity = 1 - (1 - pa) * ea) : ["TC", "BC"].includes(S) && (O = "TC" === S ? -100 : 100, 1 > B ? O = null : (ba = $._anieasing(0, 1, Math.min((B -
|
|
2134
|
+
1) / k, 1), V), O = `translate3d(-50%, ${O*ba}%, 0)`), null !== O && 1 <= B && (1 <= B && !b._willChangeApplied && (b.style.willChange = "transform, opacity", b.style.backfaceVisibility = "hidden", b._willChangeApplied = !0), b.style.transform = O), b.style.opacity = 1 - (1 - pa) * ea);
|
|
2135
|
+
else if (za && r)
|
|
2136
|
+
if ("boxcenter" == ja) 1 > B || (B = $._anieasing(0, 1, Math.min((B - 1) / k, 1), V), b._willChangeApplied || (b.style.willChange = "transform, opacity", b.style.backfaceVisibility = "hidden", b.style.transformOrigin = "center center", b._willChangeApplied = !0), b.style.transform =
|
|
2137
|
+
`translate3d(-50%, -50%, 0) scale(${1-B})`, b.style.opacity = Math.max(0, 1 - B));
|
|
2138
|
+
else {
|
|
2139
|
+
B = $._anieasing(0, 1, X, V);
|
|
2140
|
+
ea = null;
|
|
2141
|
+
if ("_self" === a.parent)
|
|
2142
|
+
for (O = Array.from(document.querySelectorAll(".domquery-alert")), ba = O.length - 1; 0 <= ba; ba--)
|
|
2143
|
+
if (O[ba].getAttribute("data-instance-id") !== a.instanceId) {
|
|
2144
|
+
ea = O[ba];
|
|
2145
|
+
break
|
|
2146
|
+
} O = r.clientX;
|
|
2147
|
+
ba = r.clientY;
|
|
2148
|
+
if (ea) {
|
|
2149
|
+
var J = ea.getBoundingClientRect();
|
|
2150
|
+
O = r.clientX - J.left;
|
|
2151
|
+
ba = r.clientY - J.top;
|
|
2152
|
+
Fa = J.width / 2;
|
|
2153
|
+
J = J.height / 2
|
|
2154
|
+
} else Fa = g.innerWidth / 2, J = g.innerHeight / 2;
|
|
2155
|
+
b.wrapper || (b.wrapper = Ja());
|
|
2156
|
+
b.wrapper.style.position =
|
|
2157
|
+
ea ? "absolute" : "fixed";
|
|
2158
|
+
b.wrapper.style.left = `${O+(Fa-O)*(1-B)}px`;
|
|
2159
|
+
b.wrapper.style.top = `${ba+(J-ba)*(1-B)}px`;
|
|
2160
|
+
b.style.transition = "none";
|
|
2161
|
+
b._willChangeApplied || (b.style.willChange = "transform, opacity", b.style.backfaceVisibility = "hidden", b.style.transformOrigin = "center center", b._willChangeApplied = !0);
|
|
2162
|
+
b.style.transform = `translate3d(-50%, -50%, 0) scale(${1-B})`;
|
|
2163
|
+
b.style.opacity = 1 - (1 - pa) * B
|
|
2164
|
+
}
|
|
2165
|
+
else {
|
|
2166
|
+
ea = $._anieasing(0, 1, X, V);
|
|
2167
|
+
if (1 > B) O = null;
|
|
2168
|
+
else {
|
|
2169
|
+
O = 1 - $._anieasing(0, 1, Math.min((B - 1) / k, 1), V);
|
|
2170
|
+
if (!b._willChangeApplied) {
|
|
2171
|
+
b.style.willChange =
|
|
2172
|
+
"transform, opacity";
|
|
2173
|
+
b.style.backfaceVisibility = "hidden";
|
|
2174
|
+
ba = "center center";
|
|
2175
|
+
if (S && !na)
|
|
2176
|
+
if ("BL" === S) ba = "left bottom";
|
|
2177
|
+
else if ("BR" === S) ba = "right bottom";
|
|
2178
|
+
else if ("TL" === S) ba = "left top";
|
|
2179
|
+
else if ("TR" === S) ba = "right top";
|
|
2180
|
+
else if ("TC" === S) ba = "center top";
|
|
2181
|
+
else if ("BC" === S) ba = "center bottom";
|
|
2182
|
+
else if ("LC" === S) ba = "left center";
|
|
2183
|
+
else if ("RC" === S) ba = "right center";
|
|
2184
|
+
else if ("CC" === S || void 0 !== a.CC) ba = "center center";
|
|
2185
|
+
b.style.transformOrigin = ba;
|
|
2186
|
+
b._willChangeApplied = !0
|
|
2187
|
+
}
|
|
2188
|
+
void 0 !== a.CC ? O = `translate3d(-50%, -50%, 0) scale(${O})` :
|
|
2189
|
+
Da && Da.finalTransform ? (ba = Da.finalTransform, ba = ba.replace(/translate\(-50%,\s*-50%\)/g, "translate3d(-50%, -50%, 0)"), ba = ba.replace(/translate\(([^)]+)\)/g, "translate3d($1, 0)"), O = ba.replace("scale(1)", `scale(${O})`)) : O = `scale(${O})`
|
|
2190
|
+
}
|
|
2191
|
+
null !== O && 1 <= B && (b.style.transform = O);
|
|
2192
|
+
b.style.opacity = 1 - (1 - pa) * ea
|
|
2193
|
+
}
|
|
2194
|
+
I && (I.style.opacity = ca * (1 - X));
|
|
2195
|
+
if (1 > X) requestAnimationFrame(Q);
|
|
2196
|
+
else {
|
|
2197
|
+
b._willChangeApplied && (b.style.willChange = "auto", b.style.backfaceVisibility = "", delete b._willChangeApplied);
|
|
2198
|
+
K = !1;
|
|
2199
|
+
U && !a.toast && !1 !== a.History ?
|
|
2200
|
+
(X = !0 === a.closeBack ? void 0 : 0, domquery(window).historyOff("alert_" + y, function() {
|
|
2201
|
+
v.closingAlerts.delete(y);
|
|
2202
|
+
!0 !== a.closeBack && ("number" === typeof a.retainScroll ? D(C, a.retainScroll) : 0 === document.querySelectorAll(".domquery-alert").length && (document.body.style.overflow = "", document.documentElement.style.overflow = ""));
|
|
2203
|
+
U && n()
|
|
2204
|
+
}, X)) : v.closingAlerts.delete(y);
|
|
2205
|
+
X = "true" === b.getAttribute("data-offout");
|
|
2206
|
+
C !== document.body && void 0 !== C._originalOverflow && (C.style.overflow = C._originalOverflow, delete C._originalOverflow);
|
|
2207
|
+
b && b.parentNode && b.parentNode.removeChild(b);
|
|
2208
|
+
0 === document.querySelectorAll(".domquery-alert").length ? (b.wheelListener && (document.removeEventListener("wheel", b.wheelListener, {
|
|
2209
|
+
passive: !1
|
|
2210
|
+
}), delete b.wheelListener), !1 === a.retainScroll ? (document.body.style.overflow = "", document.documentElement.style.overflow = "") : X && a.History || (document.body.style.overflow = "", document.documentElement.style.overflow = "", !0 === ("undefined" !== typeof $ && $.isMobile ? $.isMobile() : {
|
|
2211
|
+
isIOS: !1
|
|
2212
|
+
}).isIOS && (document.body.style.position =
|
|
2213
|
+
"", document.body.style.width = "", document.body.style.top = "", window.scrollTo(0, parseInt(scrollY || "0"))))) : b.wheelListener && (document.removeEventListener("wheel", b.wheelListener, {
|
|
2214
|
+
passive: !1
|
|
2215
|
+
}), delete b.wheelListener);
|
|
2216
|
+
b._elementInfos && b._elementInfos.forEach(E => {
|
|
2217
|
+
E.element && E.parent && (E.element.style.display = "none" === E.originalDisplay ? "none" : E.originalDisplay, E.nextSibling ? E.parent.insertBefore(E.element, E.nextSibling) : E.parent.appendChild(E.element))
|
|
2218
|
+
});
|
|
2219
|
+
b.wrapper && b.wrapper.parentNode && b.wrapper.parentNode.removeChild(b.wrapper);
|
|
2220
|
+
(X = C.querySelector(P)) && X.remove();
|
|
2221
|
+
"_blank" === a.parent ? [`.domquery-shadow-overlay[data-connected-alert="${a.instanceId}"]`, `.domquery-shadow-overlay[data-related-alert="${a.instanceId}"]`, `.domquery-shadow-overlay[data-instance-id="${a.instanceId}"]`, `.domquery-blank-overlay[data-instance-id="${a.instanceId}"]`, `.domquery-blank-overlay[data-connected-alert="${a.instanceId}"]`].forEach(E => {
|
|
2222
|
+
document.querySelectorAll(E).forEach(W => {
|
|
2223
|
+
W && W.parentNode && W.remove()
|
|
2224
|
+
})
|
|
2225
|
+
}) : (X = document.querySelector(P)) && X.remove();
|
|
2226
|
+
if ("_blank" === a.parent) {
|
|
2227
|
+
document.querySelectorAll(`.domquery-alert[data-parent-instance-id="${y}"]`).forEach(E => {
|
|
2228
|
+
const W = E.getAttribute("data-instance-id");
|
|
2229
|
+
if (W && g.$closeAlert) try {
|
|
2230
|
+
const va = E.querySelector(".domquery-close-x-btn") || E.querySelector(".domquery-alert-close-btn");
|
|
2231
|
+
if (va) va.click();
|
|
2232
|
+
else {
|
|
2233
|
+
E.parentNode && E.parentNode.removeChild(E);
|
|
2234
|
+
const oa = document.querySelector(`.domquery-shadow-overlay[data-instance-id="${W}"]`);
|
|
2235
|
+
oa && oa.parentNode && oa.parentNode.removeChild(oa)
|
|
2236
|
+
}
|
|
2237
|
+
} catch (va) {
|
|
2238
|
+
E.parentNode && E.parentNode.removeChild(E)
|
|
2239
|
+
}
|
|
2240
|
+
});
|
|
2241
|
+
if (X = document.getElementById("domquery-blank-container-" + y)) {
|
|
2242
|
+
if (B = X.querySelector(".domquery-blank-iframe")) try {
|
|
2243
|
+
B.contentWindow && (B.contentWindow._alertInstance = null, B.contentWindow._alertOptions = null, B.contentDocument && (B.contentDocument.body.innerHTML = ""))
|
|
2244
|
+
} catch (E) {}
|
|
2245
|
+
X.parentNode && X.parentNode.removeChild(X)
|
|
2246
|
+
} [`.domquery-shadow-overlay[data-connected-alert="${y}"]`, `.domquery-shadow-overlay[data-related-alert="${y}"]`, `.domquery-shadow-overlay[data-instance-id="${y}"]`, `.domquery-blank-overlay[data-instance-id="${y}"]`,
|
|
2247
|
+
`.domquery-blank-overlay[data-connected-alert="${y}"]`
|
|
2248
|
+
].forEach(E => {
|
|
2249
|
+
document.querySelectorAll(E).forEach(W => {
|
|
2250
|
+
W && W.parentNode && W.remove()
|
|
2251
|
+
})
|
|
2252
|
+
});
|
|
2253
|
+
X = document.querySelectorAll(".domquery-blank-container");
|
|
2254
|
+
B = document.querySelectorAll(".domquery-alert");
|
|
2255
|
+
if (0 === X.length && 1 >= B.length) document.body.style.overflow = "", document.documentElement.style.overflow = "", !0 === ("undefined" !== typeof $ && $.isMobile ? $.isMobile() : {
|
|
2256
|
+
isIOS: !1
|
|
2257
|
+
}).isIOS && (document.body.style.position = "", document.body.style.width = "", document.body.style.top =
|
|
2258
|
+
"", window.scrollTo(0, parseInt(scrollY || "0")));
|
|
2259
|
+
else {
|
|
2260
|
+
const E = document.querySelectorAll(".domquery-alert");
|
|
2261
|
+
E.forEach(W => {
|
|
2262
|
+
var va = W.getAttribute("data-instance-id");
|
|
2263
|
+
if (va) {
|
|
2264
|
+
let oa = 9999;
|
|
2265
|
+
E.forEach(ua => {
|
|
2266
|
+
ua !== W && (ua = parseInt(window.getComputedStyle(ua).zIndex || 0), ua > oa && (oa = ua))
|
|
2267
|
+
});
|
|
2268
|
+
const qa = oa + 2;
|
|
2269
|
+
W.style.zIndex = qa.toString();
|
|
2270
|
+
const ta = document.querySelector(`.domquery-shadow-overlay[data-connected-alert="${va}"]`) || document.querySelector(`.domquery-blank-overlay[data-instance-id="${va}"]`) || document.querySelector(`.domquery-shadow-overlay[data-instance-id="${va}"]`);
|
|
2271
|
+
ta && (ta.style.zIndex = (qa - 1).toString());
|
|
2272
|
+
if (va = document.getElementById("domquery-blank-container-" + va)) va.style.zIndex = (qa - 2).toString()
|
|
2273
|
+
}
|
|
2274
|
+
})
|
|
2275
|
+
}
|
|
2276
|
+
}
|
|
2277
|
+
a.toast || !1 === a.History || (U = !0);
|
|
2278
|
+
C !== document.body && void 0 !== C._originalOverflow && (C.style.overflow = C._originalOverflow, delete C._originalOverflow);
|
|
2279
|
+
b && b.parentNode && b.parentNode.removeChild(b);
|
|
2280
|
+
0 === document.querySelectorAll(".domquery-alert").length && !0 !== a.closeBack && (!1 === a.retainScroll ? (document.body.style.overflow = "", document.documentElement.style.overflow =
|
|
2281
|
+
"") : (document.body.style.overflow = "", document.documentElement.style.overflow = "", !0 === ("undefined" !== typeof $ && $.isMobile ? $.isMobile() : {
|
|
2282
|
+
isIOS: !1
|
|
2283
|
+
}).isIOS && (document.body.style.position = "", document.body.style.width = "", document.body.style.top = "", b._scrollPosition && void 0 !== b._scrollPosition.y && window.scrollTo(0, b._scrollPosition.y))));
|
|
2284
|
+
"swipe" === R && v.options[y]?.swipeCallback && "function" === typeof v.options[y].swipeCallback && v.options[y].swipeCallback({
|
|
2285
|
+
direction: c,
|
|
2286
|
+
velocity: xa || 0,
|
|
2287
|
+
timeElapsed: da || 0,
|
|
2288
|
+
instanceId: y,
|
|
2289
|
+
phase: "complete"
|
|
2290
|
+
});
|
|
2291
|
+
a.onClose && "function" === typeof a.onClose && (X = createAlertContext(c, this.totalResults, R), a.onClose.call(X), 1 >= document.querySelectorAll(".domquery-alert").length && !1 !== a.retainScroll && (document.body.style.overflow = "", document.documentElement.style.overflow = ""));
|
|
2292
|
+
N || null === c || "function" !== typeof h || (N = !0, setTimeout(() => {
|
|
2293
|
+
v.callbackExecuting = !0;
|
|
2294
|
+
try {
|
|
2295
|
+
h(c, R)
|
|
2296
|
+
} finally {
|
|
2297
|
+
v.callbackExecuting = !1
|
|
2298
|
+
}
|
|
2299
|
+
}, 0));
|
|
2300
|
+
U && !a.toast && !1 !== a.History ? (X = !0 === a.closeBack ? void 0 : 0, domquery(window).historyOff("alert_" +
|
|
2301
|
+
y,
|
|
2302
|
+
function() {
|
|
2303
|
+
v.closingAlerts.delete(y);
|
|
2304
|
+
!0 !== a.closeBack && ("number" === typeof a.retainScroll ? D(C, a.retainScroll) : 0 === document.querySelectorAll(".domquery-alert").length && (document.body.style.overflow = "", document.documentElement.style.overflow = ""));
|
|
2305
|
+
U && n()
|
|
2306
|
+
}, X)) : v.closingAlerts.delete(y);
|
|
2307
|
+
a.History && !a.toast && (X = "overlay_" + y, domquery(window).historyOff(X), 0 === document.querySelectorAll(".domquery-shadow-overlay, .domquery-blank-overlay").length && v.bodyHistoryRegistered && (domquery(window).historyOff("alert_body_history"),
|
|
2308
|
+
v.bodyHistoryRegistered = !1));
|
|
2309
|
+
U || n()
|
|
2310
|
+
}
|
|
2311
|
+
}
|
|
2312
|
+
}(d);
|
|
2313
|
+
requestAnimationFrame(Q)
|
|
2314
|
+
}
|
|
2315
|
+
})
|
|
2316
|
+
};
|
|
2317
|
+
if (a.closeBack) {
|
|
2318
|
+
if (a.History && !a.toast) {
|
|
2319
|
+
const c = a.id && null !== a.id ? "alert_" + a.id : "alert_" + y;
|
|
2320
|
+
domquery(window).historyOn(c, function(f) {
|
|
2321
|
+
if (0 === f)
|
|
2322
|
+
if (0 < v.closingAlerts.size) domquery(window).historyOn(c, function() {}, !1);
|
|
2323
|
+
else {
|
|
2324
|
+
var e = Array.from(document.querySelectorAll(".domquery-alert")),
|
|
2325
|
+
d = l => (l = l.match(/\d+/)) ? parseInt(l[0]) : 0;
|
|
2326
|
+
f = d(y);
|
|
2327
|
+
e = Math.max(...e.map(l => d(l.getAttribute("data-instance-id"))));
|
|
2328
|
+
f === e && la("back", !0, void 0, "closeBack")
|
|
2329
|
+
}
|
|
2330
|
+
},
|
|
2331
|
+
!1, null, {})
|
|
2332
|
+
}
|
|
2333
|
+
} else if (a.History && !a.toast) {
|
|
2334
|
+
const c = a.id && null !== a.id ? "alert_" + a.id : "alert_" + y;
|
|
2335
|
+
domquery(window).historyOn(c, function(f) {
|
|
2336
|
+
b.setAttribute("data-offout", "true")
|
|
2337
|
+
}, !0, function(f) {
|
|
2338
|
+
if (0 < v.closingAlerts.size) domquery(window).historyOn(c, function() {}, !1);
|
|
2339
|
+
else {
|
|
2340
|
+
var e = Array.from(document.querySelectorAll(".domquery-alert")),
|
|
2341
|
+
d = l => (l = l.match(/\d+/)) ? parseInt(l[0]) : 0;
|
|
2342
|
+
f = d(y);
|
|
2343
|
+
e = Math.max(...e.map(l => d(l.getAttribute("data-instance-id"))));
|
|
2344
|
+
f === e && la("back", !0, void 0, "back")
|
|
2345
|
+
}
|
|
2346
|
+
}, {})
|
|
2347
|
+
}
|
|
2348
|
+
"_self" !== a.parent && document.body.appendChild(b);
|
|
2349
|
+
a.toast && (b.style.cssText += "overflow: hidden !important;", w = x.getElement(b, ".domquery-alert-body")) && (w.style.cssText += "overflow: hidden !important; text-overflow: ellipsis !important;");
|
|
2350
|
+
(w = document.querySelector(`.domquery-shadow-overlay[data-instance-id="${a.instanceId}"]`)) && w.parentNode && w.parentNode.removeChild(w);
|
|
2351
|
+
a.timeOut && "number" === typeof a.timeOut && 0 < a.timeOut && (b.timeoutId = L.setTimeoutRAF(() => {
|
|
2352
|
+
K || la("timeout", !0, void 0, "timeout")
|
|
2353
|
+
}, a.timeOut));
|
|
2354
|
+
if (C !== document.body || "_self" === a.parent || !a.parent &&
|
|
2355
|
+
C === document.body)
|
|
2356
|
+
if (C !== document.body && (b.style.position = "absolute", b.style.maxWidth = a.maxWidth ? processSize(a.maxWidth) : "100%", b.style.minWidth = a.minWidth ? processSize(a.minWidth) : "", b.style.maxHeight = a.maxHeight ? processSize(a.maxHeight) : "100%"), "_blank" === a.parent && b.style.setProperty("z-index", (a.zindex || 2147483647).toString(), "important"), "_self" === a.parent || !a.parent && C === document.body) b.style.position = "fixed", a.zindex && (b.style.zIndex = a.zindex.toString()), "TC LC RC BC TL TR BL BR".split(" ").some(c =>
|
|
2357
|
+
void 0 !== a[c]) && void 0 === a.CC ? void 0 !== a.TC ? (b.style.left = "50%", b.style.top = "0", b.style.transform = "translateX(-50%)") : void 0 !== a.BC ? (b.style.left = "50%", b.style.bottom = "0", b.style.transform = "translateX(-50%)") : void 0 !== a.LC ? (b.style.left = "0", b.style.top = "50%", b.style.transform = "translateY(-50%)") : void 0 !== a.RC ? (b.style.right = "0", b.style.top = "50%", b.style.transform = "translateY(-50%)") : void 0 !== a.TL ? (b.style.left = "0", b.style.top = "0", b.style.transform = "none") : void 0 !== a.TR ? (b.style.right = "0", b.style.top =
|
|
2358
|
+
"0", b.style.transform = "none") : void 0 !== a.BL ? (b.style.left = "0", b.style.bottom = "0", b.style.transform = "none") : void 0 !== a.BR && (b.style.right = "0", b.style.bottom = "0", b.style.transform = "none") : (b.style.left = "50%", b.style.top = "50%", b.style.transform = "translate(-50%, -50%)"), a.width && (b.style.width = a.width), a.height && (b.style.height = a.height), b.style.maxWidth = "100%", b.style.maxHeight = a.maxHeight ? processSize(a.maxHeight) : "100%";
|
|
2359
|
+
C !== document.body && !1 === a.BC && a.parent && "_self" !== a.parent && "_blank" !== a.parent &&
|
|
2360
|
+
(C._originalOverflow || (C._originalOverflow = getComputedStyle(C).overflow), C.style.overflow = "hidden");
|
|
2361
|
+
C.appendChild(b);
|
|
2362
|
+
if (!1 !== a.background) {
|
|
2363
|
+
w = "_blank" === a.parent ? document.body : "_self" === a.parent ? b : a.parent || "body";
|
|
2364
|
+
if ("_blank" === a.parent) {
|
|
2365
|
+
a.overlayZindex || (a.overlayZindex = (a.zindex || 2147483647) - 1);
|
|
2366
|
+
let c = null,
|
|
2367
|
+
f = 0;
|
|
2368
|
+
document.querySelectorAll(".domquery-alert").forEach(e => {
|
|
2369
|
+
if (e.getAttribute("data-instance-id") !== a.instanceId) {
|
|
2370
|
+
const d = parseInt(window.getComputedStyle(e).zIndex || 0);
|
|
2371
|
+
d > f && (f = d, c = e)
|
|
2372
|
+
}
|
|
2373
|
+
});
|
|
2374
|
+
c && (a._parentAlert =
|
|
2375
|
+
c)
|
|
2376
|
+
}
|
|
2377
|
+
$.shadow(w, {
|
|
2378
|
+
bgcolor: a.background,
|
|
2379
|
+
alpha: a.alpha,
|
|
2380
|
+
zindex: a.overlayZindex || (a.toast ? a.toastZindex - 10 : a.zindex - 10),
|
|
2381
|
+
close: !1,
|
|
2382
|
+
overlayType: a.toast ? "toast" : "alert",
|
|
2383
|
+
instanceId: a.instanceId,
|
|
2384
|
+
parent: a.parent,
|
|
2385
|
+
preserveExisting: a.toast
|
|
2386
|
+
}, p);
|
|
2387
|
+
"_blank" === a.parent && (w = document.querySelector(`.domquery-shadow-overlay[data-instance-id="${a.instanceId}"]`)) && (w.style.zIndex = a.overlayZindex, w.style.position = "fixed", w.style.top = "0", w.style.left = "0", w.style.width = "100%", w.style.height = "100%", "_blank" === a.parent && (w.setAttribute("data-blank-container",
|
|
2388
|
+
"domquery-blank-container-" + a.instanceId), w.style.pointerEvents = !0 === a.close ? "auto" : "none", b.classList.add("domquery-blank-alert"), b.style.zIndex = a.zindex.toString(), w.classList.add("domquery-blank-overlay"), w.setAttribute("data-connected-alert", a.instanceId), b.setAttribute("data-connected-overlay", w.getAttribute("data-instance-id") || "")), w.style.pointerEvents = "auto", w.style.backgroundColor = "rgba(0, 0, 0, 0.5)")
|
|
2389
|
+
}
|
|
2390
|
+
w = `.domquery-${a.toast?"toast":"shadow"}-overlay[data-instance-id="${a.instanceId}"]`;
|
|
2391
|
+
const ma = "_blank" === a.parent ? document.querySelector(w) : C.querySelector(w);
|
|
2392
|
+
if ("_blank" === a.parent && b && ma) {
|
|
2393
|
+
b.classList.add("domquery-blank-alert");
|
|
2394
|
+
ma.classList.add("domquery-blank-overlay");
|
|
2395
|
+
let c = 0;
|
|
2396
|
+
document.querySelectorAll(".domquery-blank-alert").forEach(f => {
|
|
2397
|
+
f !== b && (f = parseInt(window.getComputedStyle(f).zIndex || 0), f > c && (c = f))
|
|
2398
|
+
});
|
|
2399
|
+
w = 0 < c ? c + 2 : parseInt(b.style.zIndex || a.zindex || 0);
|
|
2400
|
+
b.style.zIndex = w.toString();
|
|
2401
|
+
ma.style.zIndex = (w - 1).toString();
|
|
2402
|
+
ma.setAttribute("data-connected-alert", a.instanceId);
|
|
2403
|
+
b.setAttribute("data-connected-overlay",
|
|
2404
|
+
ma.getAttribute("data-instance-id") || "");
|
|
2405
|
+
ma.style.pointerEvents = "auto";
|
|
2406
|
+
ma.style.backgroundColor || (ma.style.backgroundColor = "rgba(0, 0, 0, 0.5)");
|
|
2407
|
+
document.querySelectorAll(".domquery-blank-alert").forEach(f => {
|
|
2408
|
+
if (f !== b) {
|
|
2409
|
+
var e = f.getAttribute("data-instance-id"),
|
|
2410
|
+
d = f.getAttribute("data-connected-overlay");
|
|
2411
|
+
e && (d = document.querySelector(`.domquery-blank-overlay[data-instance-id="${d}"]`)) && (e = parseInt(window.getComputedStyle(f).zIndex || 0), d = parseInt(window.getComputedStyle(d).zIndex || 0), e <= d && (f.style.zIndex =
|
|
2412
|
+
(d + 1).toString()))
|
|
2413
|
+
}
|
|
2414
|
+
})
|
|
2415
|
+
}
|
|
2416
|
+
if (ma) {
|
|
2417
|
+
ma.style.pointerEvents = "auto";
|
|
2418
|
+
ma.style.backgroundColor || (ma.style.backgroundColor = "rgba(0, 0, 0, 0.5)");
|
|
2419
|
+
if (a.History && !a.toast) {
|
|
2420
|
+
w = "overlay_" + y;
|
|
2421
|
+
let c = null;
|
|
2422
|
+
const f = parseInt(window.getComputedStyle(ma).zIndex || 0);
|
|
2423
|
+
let e = 0;
|
|
2424
|
+
document.querySelectorAll(".domquery-shadow-overlay, .domquery-blank-overlay").forEach(d => {
|
|
2425
|
+
if (d !== ma) {
|
|
2426
|
+
const l = parseInt(window.getComputedStyle(d).zIndex || 0);
|
|
2427
|
+
l < f && l > e && (e = l, c = d.getAttribute("data-instance-id"))
|
|
2428
|
+
}
|
|
2429
|
+
});
|
|
2430
|
+
A = {};
|
|
2431
|
+
if (c) A.target = "overlay_" + c;
|
|
2432
|
+
else if (!v.bodyHistoryRegistered) {
|
|
2433
|
+
A.target =
|
|
2434
|
+
"alert_body_history";
|
|
2435
|
+
domquery(window).historyOn("alert_body_history", function(l) {}, !1, function(l) {
|
|
2436
|
+
l = document.querySelectorAll(".domquery-shadow-overlay, .domquery-blank-overlay");
|
|
2437
|
+
const u = 0 < v.closingAlerts.size;
|
|
2438
|
+
0 < l.length || u ? (window._domqueryStateManager && (l = window._domqueryStateManager.histories.get("gong_tea_yun_alert_body_history")) && (l.preventBack = !0), history.forward()) : window._domqueryStateManager && (l = window._domqueryStateManager.histories.get("gong_tea_yun_alert_body_history")) && (l.preventBack = !1)
|
|
2439
|
+
});
|
|
2440
|
+
v.bodyHistoryRegistered = !0;
|
|
2441
|
+
const d = "gong_tea_yun_" + (a.id && null !== a.id ? "alert_" + a.id : "alert_" + y);
|
|
2442
|
+
setTimeout(() => {
|
|
2443
|
+
if (window._domqueryStateManager) {
|
|
2444
|
+
const l = window._domqueryStateManager.histories.get(d);
|
|
2445
|
+
l && (l.preventBack = !0)
|
|
2446
|
+
}
|
|
2447
|
+
}, 10)
|
|
2448
|
+
}
|
|
2449
|
+
A.onCloseStart = function(d) {
|
|
2450
|
+
v.closingAlerts.add(y)
|
|
2451
|
+
};
|
|
2452
|
+
A.onCloseEnd = "alert_body_history" !== A.target ? function(d, l) {
|
|
2453
|
+
la("back", !0, void 0, "closeBack").then(() => {
|
|
2454
|
+
l()
|
|
2455
|
+
}).catch(() => {
|
|
2456
|
+
l()
|
|
2457
|
+
})
|
|
2458
|
+
} : function(d, l) {
|
|
2459
|
+
la("back", !0, void 0, "closeBack").then(() => {
|
|
2460
|
+
if (window._domqueryStateManager)
|
|
2461
|
+
for (let [u,
|
|
2462
|
+
k
|
|
2463
|
+
] of window._domqueryStateManager.histories)(u.includes("alert_") || u.includes("overlay_")) && k.isActive && (k.preventBack = !0);
|
|
2464
|
+
l();
|
|
2465
|
+
setTimeout(() => {
|
|
2466
|
+
if (window._domqueryStateManager) {
|
|
2467
|
+
const k = [];
|
|
2468
|
+
for (let [n, N] of window._domqueryStateManager.histories)
|
|
2469
|
+
if ((n.includes("alert_") || n.includes("overlay_")) && N.isActive) {
|
|
2470
|
+
var u = n.replace("gong_tea_yun_", "");
|
|
2471
|
+
k.push(u)
|
|
2472
|
+
} for (u = k.length - 1; 0 <= u; u--) domquery(window).historyOff(k[u]);
|
|
2473
|
+
v.bodyHistoryRegistered = !1
|
|
2474
|
+
}
|
|
2475
|
+
}, 100)
|
|
2476
|
+
}).catch(() => {
|
|
2477
|
+
if (window._domqueryStateManager)
|
|
2478
|
+
for (let [u,
|
|
2479
|
+
k
|
|
2480
|
+
] of window._domqueryStateManager.histories)(u.includes("alert_") || u.includes("overlay_")) && k.isActive && (k.preventBack = !0);
|
|
2481
|
+
l();
|
|
2482
|
+
setTimeout(() => {
|
|
2483
|
+
if (window._domqueryStateManager) {
|
|
2484
|
+
const k = [];
|
|
2485
|
+
for (let [n, N] of window._domqueryStateManager.histories)
|
|
2486
|
+
if ((n.includes("alert_") || n.includes("overlay_")) && N.isActive) {
|
|
2487
|
+
var u = n.replace("gong_tea_yun_", "");
|
|
2488
|
+
k.push(u)
|
|
2489
|
+
} for (u = k.length - 1; 0 <= u; u--) domquery(window).historyOff(k[u]);
|
|
2490
|
+
v.bodyHistoryRegistered = !1
|
|
2491
|
+
}
|
|
2492
|
+
}, 100)
|
|
2493
|
+
})
|
|
2494
|
+
};
|
|
2495
|
+
domquery(window).historyOn(w, function(d) {}, !1, null, A)
|
|
2496
|
+
}
|
|
2497
|
+
if (a.close) ma.style.backgroundColor ||
|
|
2498
|
+
(ma.style.backgroundColor = "rgba(0, 0, 0, 0.5)"), ma.addEventListener("click", c => {
|
|
2499
|
+
c.preventDefault();
|
|
2500
|
+
c.stopPropagation();
|
|
2501
|
+
K || (c = Array.from(document.querySelectorAll(".domquery-alert")), c.findIndex(f => f.getAttribute("data-instance-id") === a.instanceId) === c.length - 1 && la("xclose", !0, void 0, "overlay"))
|
|
2502
|
+
});
|
|
2503
|
+
else {
|
|
2504
|
+
let c = 0,
|
|
2505
|
+
f = !1;
|
|
2506
|
+
ma.addEventListener("click", e => {
|
|
2507
|
+
e.preventDefault();
|
|
2508
|
+
e.stopPropagation();
|
|
2509
|
+
if (!K && !f) {
|
|
2510
|
+
e = ma.getAttribute("data-connected-alert") || ma.getAttribute("data-instance-id");
|
|
2511
|
+
var d = document.querySelector(`.domquery-alert[data-instance-id="${e}"]`);
|
|
2512
|
+
if (d) {
|
|
2513
|
+
if (a.shadow) {
|
|
2514
|
+
let l = 0,
|
|
2515
|
+
u = 120;
|
|
2516
|
+
!0 === a.vibrate && (u = 30);
|
|
2517
|
+
const k = () => {
|
|
2518
|
+
const n = 0 === l % 2 ? "1" : "0.2";
|
|
2519
|
+
d.style.boxShadow = `0 0 23px rgba(${a.shadow.match(/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i)?a.shadow.match(/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i).slice(1).map(N=>parseInt(N,16)).join(","):"red"===a.shadow?"255,0,0":"blue"===a.shadow?"0,0,255":"green"===a.shadow?"0,255,0":"pink"===a.shadow?"255,192,203":"purple"===a.shadow?"128,0,128":"cyan"===a.shadow?"0,255,255":"yellow"===a.shadow?"255,255,0":
|
|
2520
|
+
"0,0,0"},${n})`;
|
|
2521
|
+
l++;
|
|
2522
|
+
10 > l ? setTimeout(k, u) : d.style.boxShadow = "0 2px 10px rgba(0,0,0,0.1)"
|
|
2523
|
+
};
|
|
2524
|
+
k();
|
|
2525
|
+
c = 20
|
|
2526
|
+
}
|
|
2527
|
+
if (!0 === a.vibrate) {
|
|
2528
|
+
e = "CC TC LC RC BC TL TR BL BR".split(" ").some(n => void 0 !== a[n]);
|
|
2529
|
+
const l = "TC LC RC BC TL TR BL BR".split(" ").find(n => void 0 !== a[n]);
|
|
2530
|
+
if ("vibrate" in navigator) try {
|
|
2531
|
+
navigator.vibrate(p / 3)
|
|
2532
|
+
} catch (n) {}
|
|
2533
|
+
const u = d.style.transform,
|
|
2534
|
+
k = d.style.transition;
|
|
2535
|
+
f = !0;
|
|
2536
|
+
e ? ($.aBox(d, l), L.setTimeoutRAF(() => {
|
|
2537
|
+
d.style.transform = u;
|
|
2538
|
+
d.style.transition = k;
|
|
2539
|
+
f = !1
|
|
2540
|
+
}, 300)) : (d.style.transition = "box-shadow 0s", d.style.boxShadow =
|
|
2541
|
+
"none", L.setTimeoutRAF(() => {
|
|
2542
|
+
$.aBox(d, l);
|
|
2543
|
+
L.setTimeoutRAF(() => {
|
|
2544
|
+
d.style.transform = u;
|
|
2545
|
+
d.style.transition = k;
|
|
2546
|
+
f = !1
|
|
2547
|
+
}, 300)
|
|
2548
|
+
}, c))
|
|
2549
|
+
}
|
|
2550
|
+
}
|
|
2551
|
+
}
|
|
2552
|
+
})
|
|
2553
|
+
}
|
|
2554
|
+
}
|
|
2555
|
+
a.buttonConfigs && a.buttonConfigs.forEach(c => {
|
|
2556
|
+
const f = b.querySelector(`.alert-${c.name}-btn`);
|
|
2557
|
+
f && f.addEventListener("click", () => {
|
|
2558
|
+
if (!K) {
|
|
2559
|
+
t = m = T = 0;
|
|
2560
|
+
aa = !1;
|
|
2561
|
+
ka = 0;
|
|
2562
|
+
Y = 1;
|
|
2563
|
+
b.style.transition = "";
|
|
2564
|
+
var e = document.querySelector(".domquery-shadow-overlay");
|
|
2565
|
+
e && (e.style.transition = "");
|
|
2566
|
+
a.closeBack && a.History && !a.toast && domquery(window).historyOff("alert_" + y, function() {
|
|
2567
|
+
"number" === typeof a.retainScroll &&
|
|
2568
|
+
D(C, a.retainScroll)
|
|
2569
|
+
});
|
|
2570
|
+
e = createAlertContext(c.name, [], "button");
|
|
2571
|
+
e.close = function(d = "xclose") {
|
|
2572
|
+
return la(d, !0, void 0, d)
|
|
2573
|
+
};
|
|
2574
|
+
"function" === typeof a[c.name] ? a[c.name].call(e, c.name, "button") : la(c.name, !0, void 0, c.name)
|
|
2575
|
+
}
|
|
2576
|
+
})
|
|
2577
|
+
});
|
|
2578
|
+
w = x.getElement(b, ".domquery-alert-close-btn");
|
|
2579
|
+
A = x.getElement(b, ".domquery-close-x-btn");
|
|
2580
|
+
w && w.addEventListener("click", () => {
|
|
2581
|
+
if (!K)
|
|
2582
|
+
if ("function" === typeof a.Ok) {
|
|
2583
|
+
const c = createAlertContext("Ok", [], "button");
|
|
2584
|
+
c.close = function(f = "xclose") {
|
|
2585
|
+
return la(f, !0, void 0, f)
|
|
2586
|
+
};
|
|
2587
|
+
a.Ok.call(c, "Ok", "button")
|
|
2588
|
+
} else la("close",
|
|
2589
|
+
!1, void 0, "button")
|
|
2590
|
+
});
|
|
2591
|
+
A && (A.style.pointerEvents = "auto", A.addEventListener("click", c => {
|
|
2592
|
+
c.stopPropagation();
|
|
2593
|
+
K || (a.closeBack && a.History && domquery(window).historyOff("alert_" + y, function() {
|
|
2594
|
+
!1 === a.retainScroll ? D(C, 0) : "number" === typeof a.retainScroll && D(C, a.retainScroll)
|
|
2595
|
+
}), la("xclose", !0, void 0, "xbutton"))
|
|
2596
|
+
}));
|
|
2597
|
+
b.style.cssText += "pointer-events: auto;";
|
|
2598
|
+
if (w = x.getElement(b, ".alert-scroll-wrapper")) w.addEventListener("wheel", c => {
|
|
2599
|
+
a.unscroll && ($.AlertScrollManager.startUserScrolling(y), !0 !== a.unscroll && $.AlertScrollManager.checkScrollThreshold(y,
|
|
2600
|
+
b, a.unscroll), $.AlertScrollManager.endUserScrolling(y))
|
|
2601
|
+
}, {
|
|
2602
|
+
passive: !0
|
|
2603
|
+
}), w.addEventListener("touchmove", c => {
|
|
2604
|
+
a.unscroll && ($.AlertScrollManager.startUserScrolling(y), !0 !== a.unscroll && $.AlertScrollManager.checkScrollThreshold(y, b, a.unscroll), $.AlertScrollManager.endUserScrolling(y))
|
|
2605
|
+
}, {
|
|
2606
|
+
passive: !0
|
|
2607
|
+
}), !0 !== a.unscroll && !1 !== a.unscroll && (A = () => {
|
|
2608
|
+
$.AlertScrollManager.checkScrollThreshold(y, b, a.unscroll)
|
|
2609
|
+
}, w.addEventListener("scroll", A, {
|
|
2610
|
+
passive: !0
|
|
2611
|
+
}), g.alertScrollHandlers || (g.alertScrollHandlers = {}), g.alertScrollHandlers[y] = {
|
|
2612
|
+
element: w,
|
|
2613
|
+
handler: A
|
|
2614
|
+
}), a.unscroll && (a.hideScrollbar && (A = document.createElement("style"), A.textContent = "\n\t\t\t\t\t.alert-scroll-wrapper::-webkit-scrollbar {\n\t\t\t\t\t\tdisplay: none !important;\n\t\t\t\t\t\twidth: 0 !important;\n\t\t\t\t\t\theight: 0 !important;\n\t\t\t\t\t}\n\t\t\t\t", document.head.appendChild(A), g.alertScrollStyles || (g.alertScrollStyles = {}), g.alertScrollStyles[y] = A), setTimeout(() => {
|
|
2615
|
+
$.AlertScrollManager.scrollToBottom(y, b, !0)
|
|
2616
|
+
}, 100), A = new MutationObserver(c => {
|
|
2617
|
+
$.AlertScrollManager.scrollToBottom(y,
|
|
2618
|
+
b)
|
|
2619
|
+
}), w = w.querySelector("div") || w, A.observe(w, {
|
|
2620
|
+
childList: !0,
|
|
2621
|
+
subtree: !0,
|
|
2622
|
+
characterData: !0
|
|
2623
|
+
}), v.observers[y] = A);
|
|
2624
|
+
return b
|
|
2625
|
+
};
|
|
2626
|
+
$.alert = function(b, a = {}, p = 300, h) {
|
|
2627
|
+
if (v.callbackExecuting) return new Promise(C => {
|
|
2628
|
+
setTimeout(() => {
|
|
2629
|
+
const Z = $.alert(b, a, p, h);
|
|
2630
|
+
Z && "function" === typeof Z.then ? Z.then(C) : C(Z)
|
|
2631
|
+
}, 300)
|
|
2632
|
+
});
|
|
2633
|
+
"object" !== typeof b || null === b || Array.isArray(b) || void 0 === b.text && void 0 === b.width && void 0 === b.height && void 0 === b.title && void 0 === b.bgcolor && void 0 === b.color && void 0 === b.$Ok && void 0 === b.close && void 0 === b.xclose &&
|
|
2634
|
+
void 0 === b.input && void 0 === b.prompt && void 0 === b.toast ? "number" === typeof a ? (h = p, p = a, a = {}) : "function" === typeof a ? (h = a, a = {}) : "function" === typeof p && (h = p, p = 300) : ("number" === typeof a ? (p = a, a = b) : "function" === typeof a ? (h = a, a = b) : a = "object" !== typeof a || null === a || Array.isArray(a) ? b : Object.assign({}, b, a), b = "");
|
|
2635
|
+
(3 <= arguments.length || !a) && a && (delete a.openSpeed, delete a.closeSpeed);
|
|
2636
|
+
var r = a.parent,
|
|
2637
|
+
F = Error().stack || "",
|
|
2638
|
+
M = "undefined" !== typeof event && event.target instanceof Element && event.target.closest(".domquery-alert") ||
|
|
2639
|
+
F.includes("onOpen") || F.includes("function") || "_self" === a.parent;
|
|
2640
|
+
F = Array.from(document.querySelectorAll(".domquery-alert"));
|
|
2641
|
+
F.filter(C => !C.contains(document.activeElement) && C !== document.activeElement);
|
|
2642
|
+
void 0 === r && 0 < F.length && (a.parent = "_self", a.preserveExisting = !0);
|
|
2643
|
+
if (M) a._originalParent = r;
|
|
2644
|
+
else {
|
|
2645
|
+
a._originalParent = r;
|
|
2646
|
+
r = "_self" === a.parent;
|
|
2647
|
+
M = a.parent instanceof Element || a.parent instanceof HTMLDocument;
|
|
2648
|
+
const C = a.parent === window || a.parent === document.defaultView;
|
|
2649
|
+
if (!("_blank" === a.parent || r || M || C) && 0 < F.length) return null;
|
|
2650
|
+
if (a.parent === window || a.parent === document.defaultView) a.parent = "_blank"
|
|
2651
|
+
}
|
|
2652
|
+
F = !0 === ("undefined" !== typeof $ && $.isMobile ? $.isMobile() : {
|
|
2653
|
+
isMobile: !1
|
|
2654
|
+
}).isMobile;
|
|
2655
|
+
if ((!0 === a.input || "string" === typeof a.input) && F) {
|
|
2656
|
+
const C = a.onOpen;
|
|
2657
|
+
a.onOpen = function(Z) {
|
|
2658
|
+
C && C.call(this, Z);
|
|
2659
|
+
const A = Z.querySelectorAll(!0 === a.input ? 'input:not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="checkbox"]):not([type="radio"]), textarea' : a.input);
|
|
2660
|
+
Z.querySelectorAll("select").forEach(T => {
|
|
2661
|
+
T.classList.add("no-virtual-layer")
|
|
2662
|
+
});
|
|
2663
|
+
if (0 < A.length) {
|
|
2664
|
+
const T = q => {
|
|
2665
|
+
function m(c, f = 5) {
|
|
2666
|
+
let e;
|
|
2667
|
+
if (c.startsWith("#")) {
|
|
2668
|
+
var d = c.substring(1);
|
|
2669
|
+
3 === d.length ? (c = parseInt(d[0] + d[0], 16), e = parseInt(d[1] + d[1], 16), d = parseInt(d[2] + d[2], 16)) : (c = parseInt(d.substring(0, 2), 16), e = parseInt(d.substring(2, 4), 16), d = parseInt(d.substring(4, 6), 16))
|
|
2670
|
+
} else if (c.startsWith("rgb"))
|
|
2671
|
+
if ((d = c.match(/\d+/g)) && 3 <= d.length) c = parseInt(d[0]), e = parseInt(d[1]), d = parseInt(d[2]);
|
|
2672
|
+
else return c;
|
|
2673
|
+
else return c;
|
|
2674
|
+
c = Math.min(255, Math.round(c * (100 + f) / 100));
|
|
2675
|
+
e = Math.min(255, Math.round(e * (100 + f) /
|
|
2676
|
+
100));
|
|
2677
|
+
d = Math.min(255, Math.round(d * (100 + f) / 100));
|
|
2678
|
+
return `#${c.toString(16).padStart(2,"0")}${e.toString(16).padStart(2,"0")}${d.toString(16).padStart(2,"0")}`
|
|
2679
|
+
}
|
|
2680
|
+
|
|
2681
|
+
function t(c) {
|
|
2682
|
+
let f;
|
|
2683
|
+
if (c.startsWith("#")) {
|
|
2684
|
+
var e = c.substring(1);
|
|
2685
|
+
3 === e.length ? (c = parseInt(e[0] + e[0], 16), f = parseInt(e[1] + e[1], 16), e = parseInt(e[2] + e[2], 16)) : (c = parseInt(e.substring(0, 2), 16), f = parseInt(e.substring(2, 4), 16), e = parseInt(e.substring(4, 6), 16))
|
|
2686
|
+
} else return "#ffffff";
|
|
2687
|
+
return 128 < (299 * c + 587 * f + 114 * e) / 1E3 ? "#000000" : "#ffffff"
|
|
2688
|
+
}
|
|
2689
|
+
if ("checkbox" !== q.type &&
|
|
2690
|
+
"radio" !== q.type && "select" !== q.tagName.toLowerCase() && !q.classList.contains("no-virtual-layer")) {
|
|
2691
|
+
document.querySelectorAll(".virtual-input-layer").forEach(c => {
|
|
2692
|
+
c && c.parentNode && c.parentNode.removeChild(c)
|
|
2693
|
+
});
|
|
2694
|
+
document.querySelectorAll(".virtual-input-overlay").forEach(c => {
|
|
2695
|
+
c && c.parentNode && c.parentNode.removeChild(c)
|
|
2696
|
+
});
|
|
2697
|
+
var G = q.value,
|
|
2698
|
+
aa = q.type,
|
|
2699
|
+
ia = q.placeholder,
|
|
2700
|
+
ka = q.getAttribute("title"),
|
|
2701
|
+
ha = q.getAttribute("titleColor"),
|
|
2702
|
+
Y = q.getAttribute("background"),
|
|
2703
|
+
Ea = q.getAttribute("color"),
|
|
2704
|
+
ra = a.inputBgcolor || "#ffffff",
|
|
2705
|
+
Ba = a.inputColor || "#333333",
|
|
2706
|
+
ya = ha || Ba;
|
|
2707
|
+
ha = (c, f = 20) => {
|
|
2708
|
+
let e;
|
|
2709
|
+
if (c.startsWith("#")) {
|
|
2710
|
+
var d = c.substring(1);
|
|
2711
|
+
3 === d.length ? (c = parseInt(d[0] + d[0], 16), e = parseInt(d[1] + d[1], 16), d = parseInt(d[2] + d[2], 16)) : (c = parseInt(d.substring(0, 2), 16), e = parseInt(d.substring(2, 4), 16), d = parseInt(d.substring(4, 6), 16))
|
|
2712
|
+
} else if (c.startsWith("rgb"))
|
|
2713
|
+
if ((d = c.match(/\d+/g)) && 3 <= d.length) c = parseInt(d[0]), e = parseInt(d[1]), d = parseInt(d[2]);
|
|
2714
|
+
else return c;
|
|
2715
|
+
else return c;
|
|
2716
|
+
c = Math.max(0, Math.round(c * (100 - f) / 100));
|
|
2717
|
+
e = Math.max(0, Math.round(e * (100 -
|
|
2718
|
+
f) / 100));
|
|
2719
|
+
d = Math.max(0, Math.round(d * (100 - f) / 100));
|
|
2720
|
+
return `#${c.toString(16).padStart(2,"0")}${e.toString(16).padStart(2,"0")}${d.toString(16).padStart(2,"0")}`
|
|
2721
|
+
};
|
|
2722
|
+
var Aa = ha(ra),
|
|
2723
|
+
xa = null;
|
|
2724
|
+
!0 === a.inputOverlay && (xa = document.createElement("div"), xa.className = "virtual-input-overlay", xa.id = "virtual-input-overlay-" + Date.now(), xa.style.cssText = `\n\t\t\t\t\t\t\t\tposition: fixed;\n\t\t\t\t\t\t\t\ttop: 0;\n\t\t\t\t\t\t\t\tleft: 0;\n\t\t\t\t\t\t\t\twidth: 100%;\n\t\t\t\t\t\t\t\theight: 100%;\n\t\t\t\t\t\t\t\tbackground-color: rgba(0, 0, 0, 0.5);\n\t\t\t\t\t\t\t\tz-index: ${parseInt(Z.style.zIndex||
|
|
2725
|
+
9999)+2};\n\t\t\t\t\t\t\t\topacity: 0;\n\t\t\t\t\t\t\t\ttransition: opacity 0.3s ease;\n\t\t\t\t\t\t\t`, document.body.appendChild(xa), setTimeout(() => {
|
|
2726
|
+
xa.style.opacity = "1"
|
|
2727
|
+
}, 10));
|
|
2728
|
+
var da = document.createElement("div");
|
|
2729
|
+
da.className = "virtual-input-layer";
|
|
2730
|
+
da.id = "virtual-input-layer-" + Date.now();
|
|
2731
|
+
da.style.cssText = `\n\t\t\t\t\t\t\tposition: fixed;\n\t\t\t\t\t\t\tleft: 0;\n\t\t\t\t\t\t\tright: 0;\n\t\t\t\t\t\t\ttop: 0;\n\t\t\t\t\t\t\tbackground-color: ${ra};\n\t\t\t\t\t\t\tcolor: ${Ba};\n\t\t\t\t\t\t\tpadding: ${a.inputPadding||
|
|
2732
|
+
"15px"};\n\t\t\t\t\t\t\tmargin: ${a.inputMargin||"0"};\n\t\t\t\t\t\t\tborder-radius: ${a.inputRadius||"0"};\n\t\t\t\t\t\t\tbox-shadow: 0 2px 10px rgba(0,0,0,0.2);\n\t\t\t\t\t\t\tz-index: ${parseInt(Z.style.zIndex||9999)+2};\n\t\t\t\t\t\t\tdisplay: flex;\n\t\t\t\t\t\t\tflex-direction: column;\n\t\t\t\t\t\t\t-webkit-tap-highlight-color: transparent;\n\t\t\t\t\t\t\ttouch-action: manipulation;\n\t\t\t\t\t\t\tfont-size: ${a.inputFontsize||"16px"};\n\t\t\t\t\t\t`;
|
|
2733
|
+
if (ka) {
|
|
2734
|
+
const c = document.createElement("div");
|
|
2735
|
+
c.textContent = ka;
|
|
2736
|
+
c.style.cssText = `\n\t\t\t\t\t\t\t\ttext-align: center;\n\t\t\t\t\t\t\t\tmargin-bottom: 15px;\n\t\t\t\t\t\t\t\tfont-weight: bold;\n\t\t\t\t\t\t\t\tcolor: ${ya};\n\t\t\t\t\t\t\t`;
|
|
2737
|
+
da.appendChild(c)
|
|
2738
|
+
}
|
|
2739
|
+
var za = document.createElement("input");
|
|
2740
|
+
za.type = aa || "text";
|
|
2741
|
+
za.value = G || "";
|
|
2742
|
+
za.placeholder = ia || "";
|
|
2743
|
+
za.style.cssText = `\n\t\t\t\t\t\t\tmargin: 0 0 10px 0;\n\t\t\t\t\t\t\tpadding: 10px;\n\t\t\t\t\t\t\tborder: 1px solid ${ha(ra,10)};\n\t\t\t\t\t\t\tborder-radius: 4px;\n\t\t\t\t\t\t\tfont-size: 16px;\n\t\t\t\t\t\t\tbackground-color: ${Y||
|
|
2744
|
+
("#ffffff"===ra?"#ffffff":m(ra,5))};\n\t\t\t\t\t\t\tcolor: ${Ea||Ba};\n\t\t\t\t\t\t\toutline: none;\n\t\t\t\t\t\t\tappearance: none;\n\t\t\t\t\t\t\t-webkit-appearance: none;\n\t\t\t\t\t\t`;
|
|
2745
|
+
G = document.createElement("style");
|
|
2746
|
+
Ba = a.inputPlaceholder || Ba;
|
|
2747
|
+
G.textContent = `\n\t\t\t\t\t\t\t#${da.id} input::placeholder {\n\t\t\t\t\t\t\t\tcolor: ${Ba};\n\t\t\t\t\t\t\t\topacity: ${a.inputPlaceholder?1:.5};\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t#${da.id} input::-webkit-input-placeholder {\n\t\t\t\t\t\t\t\tcolor: ${Ba};\n\t\t\t\t\t\t\t\topacity: ${a.inputPlaceholder?
|
|
2748
|
+
1:.5};\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t#${da.id} input::-moz-placeholder {\n\t\t\t\t\t\t\t\tcolor: ${Ba};\n\t\t\t\t\t\t\t\topacity: ${a.inputPlaceholder?1:.5};\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t#${da.id} input:-ms-input-placeholder {\n\t\t\t\t\t\t\t\tcolor: ${Ba};\n\t\t\t\t\t\t\t\topacity: ${a.inputPlaceholder?1:.5};\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t`;
|
|
2749
|
+
document.head.appendChild(G);
|
|
2750
|
+
var Da = document.createElement("button");
|
|
2751
|
+
Da.textContent = a.inputConfirm || "Confirm";
|
|
2752
|
+
Da.style.cssText = `\n\t\t\t\t\t\t\tpadding: 10px;\n\t\t\t\t\t\t\tbackground-color: ${a.OkBgcolor||
|
|
2753
|
+
Aa};\n\t\t\t\t\t\t\tcolor: ${a.OkColor||t(Aa)};\n\t\t\t\t\t\t\tborder: none;\n\t\t\t\t\t\t\tborder-radius: 4px;\n\t\t\t\t\t\t\tfont-size: 16px;\n\t\t\t\t\t\t\tflex: 1;\n\t\t\t\t\t\t\tcursor: pointer;\n\t\t\t\t\t\t`;
|
|
2754
|
+
var la = document.createElement("button");
|
|
2755
|
+
la.textContent = a.inputCancel || "Cancel";
|
|
2756
|
+
la.style.cssText = `\n\t\t\t\t\t\t\tpadding: 10px;\n\t\t\t\t\t\t\tbackground-color: ${ha(ra,10)};\n\t\t\t\t\t\t\tcolor: ${t(ha(ra,10))};\n\t\t\t\t\t\t\tborder: none;\n\t\t\t\t\t\t\tborder-radius: 4px;\n\t\t\t\t\t\t\tfont-size: 16px;\n\t\t\t\t\t\t\tflex: 1;\n\t\t\t\t\t\t\tcursor: pointer;\n\t\t\t\t\t\t`;
|
|
2757
|
+
ra = document.createElement("div");
|
|
2758
|
+
ra.style.cssText = "\n\t\t\t\t\t\t\tdisplay: flex;\n\t\t\t\t\t\t\tgap: 10px;\n\t\t\t\t\t\t";
|
|
2759
|
+
ra.appendChild(Da);
|
|
2760
|
+
ra.appendChild(la);
|
|
2761
|
+
da.appendChild(za);
|
|
2762
|
+
da.appendChild(ra);
|
|
2763
|
+
da.addEventListener("click", function(c) {
|
|
2764
|
+
c.stopPropagation()
|
|
2765
|
+
});
|
|
2766
|
+
za.addEventListener("click", function(c) {
|
|
2767
|
+
c.stopPropagation()
|
|
2768
|
+
});
|
|
2769
|
+
Da.addEventListener("click", function(c) {
|
|
2770
|
+
c.stopPropagation()
|
|
2771
|
+
});
|
|
2772
|
+
la.addEventListener("click", function(c) {
|
|
2773
|
+
c.stopPropagation()
|
|
2774
|
+
});
|
|
2775
|
+
da.dataset.alertId = a.instanceId;
|
|
2776
|
+
var ma = () => {
|
|
2777
|
+
try {
|
|
2778
|
+
xa && (xa.style.opacity =
|
|
2779
|
+
"0", setTimeout(() => {
|
|
2780
|
+
const d = document.getElementById(xa.id);
|
|
2781
|
+
d && d.parentNode && d.parentNode.removeChild(d)
|
|
2782
|
+
}, 300));
|
|
2783
|
+
document.querySelectorAll(".virtual-input-overlay").forEach(d => {
|
|
2784
|
+
d && d.parentNode && (d.style.opacity = "0", setTimeout(() => {
|
|
2785
|
+
d.parentNode && d.parentNode.removeChild(d)
|
|
2786
|
+
}, 300))
|
|
2787
|
+
});
|
|
2788
|
+
var c = document.getElementById(da.id);
|
|
2789
|
+
if (c && c.parentNode) return c.parentNode.removeChild(c), !0;
|
|
2790
|
+
const f = document.querySelectorAll(".virtual-input-layer");
|
|
2791
|
+
if (0 < f.length) return f.forEach(d => {
|
|
2792
|
+
d && d.parentNode && d.parentNode.removeChild(d)
|
|
2793
|
+
}),
|
|
2794
|
+
!0;
|
|
2795
|
+
const e = document.body.children;
|
|
2796
|
+
for (c = 0; c < e.length; c++)
|
|
2797
|
+
if (e[c].classList && (e[c].classList.contains("virtual-input-layer") || e[c].classList.contains("virtual-input-overlay"))) return document.body.removeChild(e[c]), !0;
|
|
2798
|
+
return !1
|
|
2799
|
+
} catch (f) {
|
|
2800
|
+
return !1
|
|
2801
|
+
}
|
|
2802
|
+
};
|
|
2803
|
+
Da.addEventListener("click", () => {
|
|
2804
|
+
try {
|
|
2805
|
+
q.value = za.value;
|
|
2806
|
+
const c = new Event("input", {
|
|
2807
|
+
bubbles: !0,
|
|
2808
|
+
cancelable: !0
|
|
2809
|
+
});
|
|
2810
|
+
q.dispatchEvent(c);
|
|
2811
|
+
const f = new Event("change", {
|
|
2812
|
+
bubbles: !0,
|
|
2813
|
+
cancelable: !0
|
|
2814
|
+
});
|
|
2815
|
+
q.dispatchEvent(f);
|
|
2816
|
+
!0 === ("undefined" !== typeof $ && $.isMobile ? $.isMobile() : {
|
|
2817
|
+
isIOS: !1
|
|
2818
|
+
}).isIOS && q.setAttribute("value", za.value)
|
|
2819
|
+
} catch (c) {} finally {
|
|
2820
|
+
ma() || Array.from(document.body.children).forEach(c => {
|
|
2821
|
+
c.className && (c.className.includes("virtual-input-layer") || c.className.includes("virtual-input-overlay")) && document.body.removeChild(c)
|
|
2822
|
+
})
|
|
2823
|
+
}
|
|
2824
|
+
});
|
|
2825
|
+
la.addEventListener("click", () => {
|
|
2826
|
+
ma() || Array.from(document.body.children).forEach(c => {
|
|
2827
|
+
c.className && (c.className.includes("virtual-input-layer") || c.className.includes("virtual-input-overlay")) && document.body.removeChild(c)
|
|
2828
|
+
})
|
|
2829
|
+
});
|
|
2830
|
+
za.addEventListener("keydown",
|
|
2831
|
+
c => {
|
|
2832
|
+
"Enter" === c.key ? (c.preventDefault(), Da.click()) : "Escape" === c.key && (c.preventDefault(), la.click())
|
|
2833
|
+
});
|
|
2834
|
+
document.body.appendChild(da);
|
|
2835
|
+
xa && xa.addEventListener("click", c => {
|
|
2836
|
+
c.target === xa && ma()
|
|
2837
|
+
});
|
|
2838
|
+
setTimeout(() => {
|
|
2839
|
+
const c = function(f) {
|
|
2840
|
+
da.contains(f.target) || f.target === da || f.target.classList.contains("virtual-input-overlay") || (ma(), document.removeEventListener("click", c))
|
|
2841
|
+
};
|
|
2842
|
+
document.addEventListener("click", c)
|
|
2843
|
+
}, 300);
|
|
2844
|
+
setTimeout(() => {
|
|
2845
|
+
za.focus()
|
|
2846
|
+
}, 100)
|
|
2847
|
+
}
|
|
2848
|
+
};
|
|
2849
|
+
A.forEach(q => {
|
|
2850
|
+
if (!(q.readOnly || q.disabled || q.classList.contains("no-virtual-layer"))) {
|
|
2851
|
+
var m =
|
|
2852
|
+
q.onfocus;
|
|
2853
|
+
q.addEventListener("click", t => {
|
|
2854
|
+
t.preventDefault();
|
|
2855
|
+
t.stopPropagation();
|
|
2856
|
+
T(q)
|
|
2857
|
+
});
|
|
2858
|
+
q.onfocus = function(t) {
|
|
2859
|
+
"checkbox" === q.type || "radio" === q.type || "select" === q.tagName.toLowerCase() || q.classList.contains("no-virtual-layer") ? m && m.call(this, t) : (t && t.preventDefault(), q.blur(), m && m.call(this, t), setTimeout(() => {
|
|
2860
|
+
T(q)
|
|
2861
|
+
}, 50))
|
|
2862
|
+
}
|
|
2863
|
+
}
|
|
2864
|
+
})
|
|
2865
|
+
}
|
|
2866
|
+
}
|
|
2867
|
+
}
|
|
2868
|
+
if (!0 === a.confirm) return a.Ok = a.Ok || "OK", a.$cancel = a.$cancel || "cancel", new Promise(C => {
|
|
2869
|
+
const Z = event,
|
|
2870
|
+
{
|
|
2871
|
+
alertBox: A,
|
|
2872
|
+
options: T,
|
|
2873
|
+
speed: q,
|
|
2874
|
+
buttonConfigs: m
|
|
2875
|
+
} = $._alert0(String(b), a, p);
|
|
2876
|
+
T.buttonConfigs =
|
|
2877
|
+
m;
|
|
2878
|
+
$._alert1(A, T, q, (t, G) => {
|
|
2879
|
+
t = "button" === G;
|
|
2880
|
+
h && h(t);
|
|
2881
|
+
C(t)
|
|
2882
|
+
}, Z)
|
|
2883
|
+
});
|
|
2884
|
+
F = event;
|
|
2885
|
+
const {
|
|
2886
|
+
alertBox: y,
|
|
2887
|
+
options: K,
|
|
2888
|
+
speed: w,
|
|
2889
|
+
buttonConfigs: D
|
|
2890
|
+
} = $._alert0(b, a, p);
|
|
2891
|
+
K.buttonConfigs = D;
|
|
2892
|
+
return $._alert1(y, K, w, h, F)
|
|
2893
|
+
};
|
|
2894
|
+
$.confirm = function(b, a = {}, p) {
|
|
2895
|
+
if ("string" !== typeof b || !b.trim()) return {
|
|
2896
|
+
else: function() {
|
|
2897
|
+
return this
|
|
2898
|
+
}
|
|
2899
|
+
};
|
|
2900
|
+
"function" === typeof a && (p = a, a = {});
|
|
2901
|
+
a.ifO = !0;
|
|
2902
|
+
return $.if(b, a, 300, p)
|
|
2903
|
+
};
|
|
2904
|
+
$.toast = function(b, a = {}, p = 300, h) {
|
|
2905
|
+
if ("object" === typeof b && null !== b) {
|
|
2906
|
+
h = p;
|
|
2907
|
+
p = a;
|
|
2908
|
+
a = b;
|
|
2909
|
+
if (!0 === a.closeToast) {
|
|
2910
|
+
Array.from(document.querySelectorAll(".domquery-alert.toast-alert")).forEach(r => {
|
|
2911
|
+
(r = x.getElement(r, ".domquery-close-x-btn") || x.getElement(r, ".domquery-alert-close-btn")) && r.click()
|
|
2912
|
+
});
|
|
2913
|
+
return
|
|
2914
|
+
}
|
|
2915
|
+
b = a.message || a.title || "";
|
|
2916
|
+
delete a.message;
|
|
2917
|
+
delete a.speed
|
|
2918
|
+
} else "string" !== typeof b && (b = String(b));
|
|
2919
|
+
"function" === typeof a ? (h = a, a = {}) : "function" === typeof p && (h = p, p = 300);
|
|
2920
|
+
void 0 === a.timeOut ? (a.timeOut = 3E3, void 0 === a.$Ok && (a.$Ok = !1)) : !1 === a.timeOut ? delete a.timeOut : void 0 === a.$Ok && (a.$Ok = !1);
|
|
2921
|
+
void 0 === a.background ? a.background = !1 : a.toastZindex = a.toastZindex || 9999;
|
|
2922
|
+
void 0 === a.closeBack && (a.closeBack = !1);
|
|
2923
|
+
a.History = !1;
|
|
2924
|
+
a.prompt = !0;
|
|
2925
|
+
a.toast = !0;
|
|
2926
|
+
return $.alert(b, a, p, h)
|
|
2927
|
+
};
|
|
2928
|
+
$.closeToast = function(b) {
|
|
2929
|
+
if (b = document.getElementById(b)) {
|
|
2930
|
+
b.timeoutId && (clearTimeout(b.timeoutId), b.timeoutId = null);
|
|
2931
|
+
const a = b.getAttribute("data-instance-id");
|
|
2932
|
+
a && v.options && v.options[a] && $._alert1(b, v.options[a], 0).close_Alert("close", !0, 0)
|
|
2933
|
+
}
|
|
2934
|
+
};
|
|
2935
|
+
$.prompt = function(b, a = {}, p = 300, h) {
|
|
2936
|
+
"function" === typeof a ? (h = a, a = {}) : "function" === typeof p && (h = p, p = 300);
|
|
2937
|
+
a.prompt = !0;
|
|
2938
|
+
return $.alert(b, a, p, h)
|
|
2939
|
+
};
|
|
2940
|
+
$.if = function(b, a = {}, p, h) {
|
|
2941
|
+
let r;
|
|
2942
|
+
const F = q => {
|
|
2943
|
+
if ("function" ===
|
|
2944
|
+
typeof q) return q();
|
|
2945
|
+
if (Array.isArray(q) && 3 === q.length) {
|
|
2946
|
+
const [m, t, G] = q;
|
|
2947
|
+
switch (t) {
|
|
2948
|
+
case ">":
|
|
2949
|
+
return m > G;
|
|
2950
|
+
case "<":
|
|
2951
|
+
return m < G;
|
|
2952
|
+
case ">=":
|
|
2953
|
+
return m >= G;
|
|
2954
|
+
case "<=":
|
|
2955
|
+
return m <= G;
|
|
2956
|
+
case "===":
|
|
2957
|
+
return m === G;
|
|
2958
|
+
case "!==":
|
|
2959
|
+
return m !== G;
|
|
2960
|
+
default:
|
|
2961
|
+
return !!q
|
|
2962
|
+
}
|
|
2963
|
+
} else return "boolean" === typeof q ? q : !!q
|
|
2964
|
+
};
|
|
2965
|
+
var M = (q, m, t = h) => $if(q, m, t);
|
|
2966
|
+
if ("object" === typeof a) {
|
|
2967
|
+
if (void 0 !== a.if) return F(b) ? M(a.if, {
|
|
2968
|
+
...a,
|
|
2969
|
+
if: void 0
|
|
2970
|
+
}, p, h) : {
|
|
2971
|
+
else: function() {},
|
|
2972
|
+
elseif: function() {}
|
|
2973
|
+
};
|
|
2974
|
+
if (a.hasOwnProperty("else")) {
|
|
2975
|
+
M = a.else;
|
|
2976
|
+
delete a.else;
|
|
2977
|
+
if (F(b)) return $.alert(a.title ||
|
|
2978
|
+
b, a, p);
|
|
2979
|
+
"function" === typeof M && M();
|
|
2980
|
+
return {
|
|
2981
|
+
else: function() {},
|
|
2982
|
+
elseif: function() {}
|
|
2983
|
+
}
|
|
2984
|
+
}
|
|
2985
|
+
}
|
|
2986
|
+
"number" === typeof a ? (h = p, p = a, a = {}) : "function" === typeof a ? (h = a, a = {}, p = 300) : "function" === typeof p && (h = p, p = 300);
|
|
2987
|
+
4 <= arguments.length && "function" === typeof arguments[3] && (h = arguments[3]);
|
|
2988
|
+
var y = r = b;
|
|
2989
|
+
a.ifO ? y = String(b) : (r = F(b), y = String(r));
|
|
2990
|
+
const K = (q => function(...m) {
|
|
2991
|
+
let t = -1;
|
|
2992
|
+
for (let G = m.length - 1; 0 <= G; G--)
|
|
2993
|
+
if ("object" === typeof m[G] && null !== m[G] && !Array.isArray(m[G])) {
|
|
2994
|
+
t = G;
|
|
2995
|
+
break
|
|
2996
|
+
} 0 <= t ? m[t].hasOwnProperty("retainScroll") || (m[t] = {
|
|
2997
|
+
...m[t],
|
|
2998
|
+
retainScroll: !1
|
|
2999
|
+
}) : m.push({
|
|
3000
|
+
retainScroll: !1
|
|
3001
|
+
});
|
|
3002
|
+
return q.apply(this, m)
|
|
3003
|
+
})($.alert),
|
|
3004
|
+
w = q => {
|
|
3005
|
+
const m = $.alert;
|
|
3006
|
+
$.alert = K;
|
|
3007
|
+
try {
|
|
3008
|
+
q?.()
|
|
3009
|
+
} finally {
|
|
3010
|
+
$.alert = m
|
|
3011
|
+
}
|
|
3012
|
+
};
|
|
3013
|
+
M = {
|
|
3014
|
+
elseif: function(q, m) {
|
|
3015
|
+
!r && "function" === typeof m && F(q) && (w(m), this.previousResult = !0);
|
|
3016
|
+
return this
|
|
3017
|
+
},
|
|
3018
|
+
else: function(q) {
|
|
3019
|
+
if (!r && !this.previousResult && "function" === typeof q) return w(q), this;
|
|
3020
|
+
if (a.$cancel) Z.cancel = q;
|
|
3021
|
+
else {
|
|
3022
|
+
const m = q.toString().match(/\(([^)]*)\)/);
|
|
3023
|
+
if (m && m[1]) {
|
|
3024
|
+
const t = m[1].trim();
|
|
3025
|
+
A.includes(t) && (Z[t] = q, A = A.filter(G => G !== t))
|
|
3026
|
+
}
|
|
3027
|
+
}
|
|
3028
|
+
return this
|
|
3029
|
+
},
|
|
3030
|
+
previousResult: !1
|
|
3031
|
+
};
|
|
3032
|
+
a = (q => {
|
|
3033
|
+
q = {
|
|
3034
|
+
...q
|
|
3035
|
+
};
|
|
3036
|
+
void 0 !== q.$ok && (q.$Ok = q.$ok, delete q.$ok);
|
|
3037
|
+
void 0 !== q.Ok && (q.$Ok = q.Ok, delete q.Ok);
|
|
3038
|
+
void 0 !== q.$OkBgcolor && (q.OkBgcolor = q.$OkBgcolor, delete q.$OkBgcolor);
|
|
3039
|
+
void 0 !== q.$OkColor && (q.OkColor = q.$OkColor, delete q.$OkColor);
|
|
3040
|
+
return q
|
|
3041
|
+
})(a);
|
|
3042
|
+
const D = "$Ok $ok $OkBgcolor $OkColor $cancel $cancelBgcolor $cancelColor".split(" ");
|
|
3043
|
+
var C = Object.keys(a).some(q => q.startsWith("$") && !D.includes(q));
|
|
3044
|
+
a = {
|
|
3045
|
+
$Ok: "OK",
|
|
3046
|
+
Cancel: "cancel",
|
|
3047
|
+
...(C || !1 === a.$cancel ? {} : {
|
|
3048
|
+
$cancel: "cancel"
|
|
3049
|
+
}),
|
|
3050
|
+
OkBgcolor: "#E0E0E0",
|
|
3051
|
+
OkColor: "#000000",
|
|
3052
|
+
$cancelBgcolor: "#ECEFF1",
|
|
3053
|
+
$cancelColor: "#607D8B",
|
|
3054
|
+
...a
|
|
3055
|
+
};
|
|
3056
|
+
if (C || !1 === a.$cancel) delete a.$cancel, delete a.$cancelBgcolor, delete a.$cancelColor;
|
|
3057
|
+
let Z = {},
|
|
3058
|
+
A = Object.keys(a).filter(q => q.startsWith("$") && !D.includes(q) && "undefined" !== typeof a[q] && null !== a[q]).map(q => q.substring(1));
|
|
3059
|
+
C = {
|
|
3060
|
+
else: function(q) {
|
|
3061
|
+
if (a.$cancel) Z.cancel = q;
|
|
3062
|
+
else {
|
|
3063
|
+
const m = q.toString().match(/\(([^)]*)\)/);
|
|
3064
|
+
if (m && m[1]) {
|
|
3065
|
+
const t = m[1].trim();
|
|
3066
|
+
A.includes(t) && (Z[t] = q, A = A.filter(G => G !== t))
|
|
3067
|
+
}
|
|
3068
|
+
}
|
|
3069
|
+
return this
|
|
3070
|
+
}
|
|
3071
|
+
};
|
|
3072
|
+
if (!a.ifO && !r) return Z.cancel && Z.cancel.call(null,
|
|
3073
|
+
"condition_false"), Object.assign(C, M);
|
|
3074
|
+
const T = {
|
|
3075
|
+
...a
|
|
3076
|
+
};
|
|
3077
|
+
void 0 !== a.$cancel && (T.Cancel = a.$cancel, T.$cancel = a.$cancel);
|
|
3078
|
+
T.Ok = function() {
|
|
3079
|
+
h && "function" === typeof h && h.call(this, this);
|
|
3080
|
+
this.close()
|
|
3081
|
+
};
|
|
3082
|
+
a.$cancel && (T.cancel = function() {
|
|
3083
|
+
this.close();
|
|
3084
|
+
Z.cancel && Z.cancel.call(this, "cancel")
|
|
3085
|
+
});
|
|
3086
|
+
Object.keys(a).filter(q => q.startsWith("$") && !D.includes(q)).forEach(q => {
|
|
3087
|
+
const m = q.substring(1);
|
|
3088
|
+
T[m] = function() {
|
|
3089
|
+
this.close();
|
|
3090
|
+
Z[m] && Z[m].call(this, m)
|
|
3091
|
+
}
|
|
3092
|
+
});
|
|
3093
|
+
y = T.message || y;
|
|
3094
|
+
T.message && delete T.message;
|
|
3095
|
+
$.alert(y, T, p);
|
|
3096
|
+
return Object.assign(C,
|
|
3097
|
+
M)
|
|
3098
|
+
};
|
|
3099
|
+
$.closeAlert = function(b, a) {
|
|
3100
|
+
"function" === typeof b && (a = b, b = null);
|
|
3101
|
+
var p = document.querySelectorAll(".domquery-alert");
|
|
3102
|
+
if (0 === p.length) return document.body.style.overflow = "", document.documentElement.style.overflow = "", document.querySelectorAll(".domquery-blank-container").forEach(K => {
|
|
3103
|
+
K && K.parentNode && K.parentNode.removeChild(K)
|
|
3104
|
+
}), document.querySelectorAll(".domquery-shadow-overlay, .domquery-toast-overlay").forEach(K => {
|
|
3105
|
+
K && K.parentNode && K.parentNode.removeChild(K)
|
|
3106
|
+
}), "function" === typeof a && setTimeout(a,
|
|
3107
|
+
300, null, "no_alert"), !1;
|
|
3108
|
+
let h = null;
|
|
3109
|
+
if (b) {
|
|
3110
|
+
if ((h = document.getElementById(b)) || (h = document.querySelector(`.domquery-alert[data-id="${b}"]`)), h || (h = document.querySelector(`.domquery-alert[data-instance-id="${b}"]`)), !h || !h.classList.contains("domquery-alert")) return "function" === typeof a && setTimeout(a, 50, null, "id_not_found"), !1
|
|
3111
|
+
} else h = p[p.length - 1];
|
|
3112
|
+
let r = !1;
|
|
3113
|
+
const F = (K, w) => {
|
|
3114
|
+
r || "function" !== typeof a || (r = !0, setTimeout(() => {
|
|
3115
|
+
a(K, w)
|
|
3116
|
+
}, 300))
|
|
3117
|
+
},
|
|
3118
|
+
M = new MutationObserver(K => {
|
|
3119
|
+
for (const w of K) "childList" === w.type && (K =
|
|
3120
|
+
Array.from(w.removedNodes), K.includes(h) || K.some(D => D.contains && D.contains(h))) && (M.disconnect(), F("removed", "dom_observation"))
|
|
3121
|
+
});
|
|
3122
|
+
M.observe(document.body, {
|
|
3123
|
+
childList: !0,
|
|
3124
|
+
subtree: !0
|
|
3125
|
+
});
|
|
3126
|
+
b = setTimeout(() => {
|
|
3127
|
+
M.disconnect();
|
|
3128
|
+
F("timeout", "safety")
|
|
3129
|
+
}, 1E3);
|
|
3130
|
+
try {
|
|
3131
|
+
const K = h.getAttribute("data-instance-id");
|
|
3132
|
+
p = "normal";
|
|
3133
|
+
let w = {};
|
|
3134
|
+
try {
|
|
3135
|
+
var y = h.getAttribute("data-options");
|
|
3136
|
+
y && (w = JSON.parse(y)) && "_self" === w.parent && (p = "self")
|
|
3137
|
+
} catch (C) {}
|
|
3138
|
+
const D = x.getElement(h, ".domquery-close-x-btn") || x.getElement(h, ".domquery-alert-close-btn");
|
|
3139
|
+
if ("self" === p) {
|
|
3140
|
+
const C = h.querySelectorAll("button");
|
|
3141
|
+
if (0 < C.length) {
|
|
3142
|
+
y = null;
|
|
3143
|
+
for (const Z of C) {
|
|
3144
|
+
const A = Z.textContent.trim().toLowerCase();
|
|
3145
|
+
if ("\ud655\uc778" === A || "ok" === A || "\uc608" === A || "yes" === A) {
|
|
3146
|
+
y = Z;
|
|
3147
|
+
break
|
|
3148
|
+
}
|
|
3149
|
+
}
|
|
3150
|
+
y ? y.click() : D ? D.click() : C[0].click()
|
|
3151
|
+
} else D && D.click();
|
|
3152
|
+
setTimeout(() => {
|
|
3153
|
+
if (document.contains(h)) {
|
|
3154
|
+
h.parentNode && h.parentNode.removeChild(h);
|
|
3155
|
+
const Z = document.querySelectorAll(".domquery-shadow-overlay, .domquery-toast-overlay");
|
|
3156
|
+
for (const A of Z) A.parentNode && A.parentNode.removeChild(A);
|
|
3157
|
+
F("forced_removal",
|
|
3158
|
+
"parent_self")
|
|
3159
|
+
}
|
|
3160
|
+
}, 100)
|
|
3161
|
+
} else if (D) D.click(), setTimeout(() => {
|
|
3162
|
+
if (document.contains(h)) {
|
|
3163
|
+
const C = document.querySelector(`.domquery-alert[data-instance-id="${K}"]`);
|
|
3164
|
+
if (C) {
|
|
3165
|
+
const Z = x.getElement(C, ".domquery-close-x-btn") || x.getElement(C, ".domquery-alert-close-btn");
|
|
3166
|
+
Z && Z.click();
|
|
3167
|
+
setTimeout(() => {
|
|
3168
|
+
if (document.contains(C)) {
|
|
3169
|
+
C.parentNode && C.parentNode.removeChild(C);
|
|
3170
|
+
const A = document.querySelectorAll(".domquery-shadow-overlay, .domquery-toast-overlay");
|
|
3171
|
+
for (const T of A) T.parentNode && T.parentNode.removeChild(T);
|
|
3172
|
+
document.querySelectorAll(".domquery-blank-container").forEach(T => {
|
|
3173
|
+
T && T.parentNode && T.parentNode.removeChild(T)
|
|
3174
|
+
})
|
|
3175
|
+
}
|
|
3176
|
+
}, 100)
|
|
3177
|
+
}
|
|
3178
|
+
}
|
|
3179
|
+
}, 100);
|
|
3180
|
+
else {
|
|
3181
|
+
h.parentNode && h.parentNode.removeChild(h);
|
|
3182
|
+
const C = document.querySelectorAll(".domquery-shadow-overlay, .domquery-toast-overlay");
|
|
3183
|
+
for (const Z of C) Z.parentNode && Z.parentNode.removeChild(Z);
|
|
3184
|
+
F("forced_removal", "no_button")
|
|
3185
|
+
}
|
|
3186
|
+
return !0
|
|
3187
|
+
} catch (K) {
|
|
3188
|
+
try {
|
|
3189
|
+
h && h.parentNode && h.parentNode.removeChild(h);
|
|
3190
|
+
const w = document.querySelectorAll(".domquery-shadow-overlay, .domquery-toast-overlay");
|
|
3191
|
+
for (const D of w) D.parentNode && D.parentNode.removeChild(D)
|
|
3192
|
+
} catch (w) {}
|
|
3193
|
+
clearTimeout(b);
|
|
3194
|
+
M.disconnect();
|
|
3195
|
+
F("emergency_removal", "error_recovery");
|
|
3196
|
+
return !0
|
|
3197
|
+
}
|
|
3198
|
+
}
|
|
3199
|
+
})("undefined" !== typeof window ? window : this);
|
|
3200
|
+
$.fn.alert = function(g, v, L, x) {
|
|
3201
|
+
const b = this[0];
|
|
3202
|
+
if (!b) return this;
|
|
3203
|
+
v = v || {};
|
|
3204
|
+
v.parent = b;
|
|
3205
|
+
$.alert(g, v, L, x);
|
|
3206
|
+
return this
|
|
3207
|
+
};
|
|
3208
|
+
$.fn.confirm = function(g, v, L) {
|
|
3209
|
+
const x = this[0];
|
|
3210
|
+
if (!x) return this;
|
|
3211
|
+
v = v || {};
|
|
3212
|
+
v.parent = x;
|
|
3213
|
+
return $.confirm(g, v, L)
|
|
3214
|
+
};
|
|
3215
|
+
$.fn.prompt = function(g, v, L, x) {
|
|
3216
|
+
const b = this[0];
|
|
3217
|
+
if (!b) return this;
|
|
3218
|
+
v = v || {};
|
|
3219
|
+
v.parent = b;
|
|
3220
|
+
v.prompt = !0;
|
|
3221
|
+
$.alert(g, v, L, x);
|
|
3222
|
+
return this
|
|
3223
|
+
};
|
|
3224
|
+
$.fn.toast = function(g, v, L, x) {
|
|
3225
|
+
const b = this[0];
|
|
3226
|
+
if (!b) return this;
|
|
3227
|
+
v = v || {};
|
|
3228
|
+
v.parent = b;
|
|
3229
|
+
v.toast = !0;
|
|
3230
|
+
$.alert(g, v, L, x);
|
|
3231
|
+
return this
|
|
3232
|
+
};
|
|
3233
|
+
$.fn.closeToast = function(g) {
|
|
3234
|
+
!g && this[0] && this[0].id && (g = this[0].id);
|
|
3235
|
+
g && $.closeToast(g);
|
|
3236
|
+
return this
|
|
3237
|
+
};
|
|
3238
|
+
$.fn.if = function(g, v, L, x) {
|
|
3239
|
+
const b = this[0];
|
|
3240
|
+
if (!b) return this;
|
|
3241
|
+
v = v || {};
|
|
3242
|
+
v.parent = b;
|
|
3243
|
+
return $.if(g, v, L, x)
|
|
3244
|
+
};
|
|
3245
|
+
$.fn.topAlert = function(g = 0, v = 300, L) {
|
|
3246
|
+
var x = $(".domquery-alert");
|
|
3247
|
+
if (0 === x.length) return "function" === typeof L && L(!1), !1;
|
|
3248
|
+
x = x.last();
|
|
3249
|
+
x = [x.find(".alert-scroll-wrapper"), x.find(".domquery-alert-body"), x.find('div[style*="overflow: auto"]'), x.find('div[style*="overflow-y: auto"]'), x.find('div[style*="overflow-y: scroll"]'), x].filter(a => 0 < a.length);
|
|
3250
|
+
let b = !1;
|
|
3251
|
+
for (const a of x)
|
|
3252
|
+
if (a[0].scrollHeight > a[0].clientHeight) {
|
|
3253
|
+
const p = a.scrollTop(),
|
|
3254
|
+
h = g - p,
|
|
3255
|
+
r = performance.now(),
|
|
3256
|
+
F = M => {
|
|
3257
|
+
M = Math.min((M - r) / v, 1);
|
|
3258
|
+
a.scrollTop(p + h * (1 -
|
|
3259
|
+
Math.pow(1 - M, 2)));
|
|
3260
|
+
1 > M ? requestAnimationFrame(F) : b || "function" !== typeof L || (b = !0, L(!0))
|
|
3261
|
+
};
|
|
3262
|
+
requestAnimationFrame(F);
|
|
3263
|
+
return !0
|
|
3264
|
+
}
|
|
3265
|
+
"function" !== typeof L || b || L(!1);
|
|
3266
|
+
return !1
|
|
3267
|
+
};
|
|
3268
|
+
const $alert = function(...g) {
|
|
3269
|
+
if (1 === g.length && "object" === typeof g[0]) {
|
|
3270
|
+
g = g[0];
|
|
3271
|
+
const v = "alert_" + Date.now();
|
|
3272
|
+
g.alertId = v;
|
|
3273
|
+
const L = document.createElement("div");
|
|
3274
|
+
L.id = v;
|
|
3275
|
+
for (const x in g) "function" === typeof g[x] && (L[x] = g[x]);
|
|
3276
|
+
document.body.appendChild(L);
|
|
3277
|
+
return void 0 !== g.speed ? $.alert(g.message || "", g, g.speed, g.callback) : void 0 !== g.callback ? $.alert(g.message || "", g, g.callback) : $.alert(g.message || "", g)
|
|
3278
|
+
}
|
|
3279
|
+
return $.alert.call($, ...g)
|
|
3280
|
+
},
|
|
3281
|
+
$confirm = function(...g) {
|
|
3282
|
+
return 1 === g.length && "object" === typeof g[0] ? (g = g[0], $.confirm(g.message ||
|
|
3283
|
+
"", g, g.callback)) : $.confirm.call($, ...g)
|
|
3284
|
+
},
|
|
3285
|
+
$prompt = function(...g) {
|
|
3286
|
+
return 1 === g.length && "object" === typeof g[0] ? (g = g[0], $.prompt(g.message || "", g, g.speed || 300, g.callback)) : $.prompt.call($, ...g)
|
|
3287
|
+
},
|
|
3288
|
+
$toast = function(...g) {
|
|
3289
|
+
return 1 === g.length && "object" === typeof g[0] ? (g = g[0], $.toast(g.message || "", g, g.speed || 300, g.callback)) : $.toast.call($, ...g)
|
|
3290
|
+
},
|
|
3291
|
+
$if = function(...g) {
|
|
3292
|
+
return 1 === g.length && "object" === typeof g[0] ? (g = g[0], $.if(g.condition || "", g, g.speed, g.thenCallback)) : $.if.call($, ...g)
|
|
3293
|
+
},
|
|
3294
|
+
$closeAlert = function(g, v) {
|
|
3295
|
+
return $.closeAlert(g,
|
|
3296
|
+
v)
|
|
3297
|
+
},
|
|
3298
|
+
$topAlert = function(g = 0, v = 300, L) {
|
|
3299
|
+
return $.fn.topAlert.call($, g, v, L)
|
|
3300
|
+
},
|
|
3301
|
+
$openAlert = function(g, v) {
|
|
3302
|
+
return $.openAlert(g, v)
|
|
3303
|
+
};
|
|
3304
|
+
$.openAlert = function(g, v) {
|
|
3305
|
+
let L = null;
|
|
3306
|
+
v ? "function" === typeof v && (L = v, v = {}) : v = {};
|
|
3307
|
+
return new Promise(x => {
|
|
3308
|
+
$.closeAlert(() => {
|
|
3309
|
+
let b = !1;
|
|
3310
|
+
var a = g;
|
|
3311
|
+
g.startsWith("#") && (a = g.substring(1));
|
|
3312
|
+
if (a = document.getElementById(a)) a.click(), b = !0;
|
|
3313
|
+
L && "function" === typeof L && setTimeout(() => L(b), 50);
|
|
3314
|
+
x(b)
|
|
3315
|
+
})
|
|
3316
|
+
})
|
|
3317
|
+
};
|
|
3318
|
+
const $lastAlert = function() {
|
|
3319
|
+
const g = Array.from(document.querySelectorAll(".domquery-alert"));
|
|
3320
|
+
return $(g[g.length - 1])
|
|
3321
|
+
},
|
|
3322
|
+
$spinner = function(g, v, L) {
|
|
3323
|
+
if (!g) {
|
|
3324
|
+
v = $(".domquery-spinner-overlay");
|
|
3325
|
+
L = $(".domquery-spinner-container");
|
|
3326
|
+
g = $(".domquery-spinner-message");
|
|
3327
|
+
if (v.length) {
|
|
3328
|
+
var x = parseFloat(v.css("opacity")),
|
|
3329
|
+
b = v.data("opacity");
|
|
3330
|
+
0 < x || b ? (L.remove(), g.length && (g.css({
|
|
3331
|
+
position: "absolute",
|
|
3332
|
+
transform: g.css("transform") || "translate(-50%, -50%)"
|
|
3333
|
+
}), g.css("animation", "fadeOut 0.5s forwards")), v.css({
|
|
3334
|
+
animation: "fadeOut 0.5s forwards"
|
|
3335
|
+
}),
|
|
3336
|
+
setTimeout(() => {
|
|
3337
|
+
$(".domquery-spinner-overlay, .domquery-spinner-message").remove()
|
|
3338
|
+
}, 500)) : $(".domquery-spinner-container, .domquery-spinner-overlay, .domquery-spinner-message").remove()
|
|
3339
|
+
}
|
|
3340
|
+
return this
|
|
3341
|
+
}
|
|
3342
|
+
$(".domquery-spinner-container, .domquery-spinner-overlay, .domquery-spinner-message-overlay, .domquery-spinner-message").remove();
|
|
3343
|
+
const a = $lastAlert();
|
|
3344
|
+
if (!a.length) return this;
|
|
3345
|
+
let p;
|
|
3346
|
+
g = (h = "transparent", r = 0) => {
|
|
3347
|
+
const F = $("<div>", {
|
|
3348
|
+
class: "domquery-spinner-container",
|
|
3349
|
+
css: {
|
|
3350
|
+
position: "absolute",
|
|
3351
|
+
top: "50%",
|
|
3352
|
+
left: "50%",
|
|
3353
|
+
transform: "translate(-50%, -50%)",
|
|
3354
|
+
width: "auto",
|
|
3355
|
+
height: "auto",
|
|
3356
|
+
display: "flex",
|
|
3357
|
+
justifyContent: "center",
|
|
3358
|
+
alignItems: "center",
|
|
3359
|
+
zIndex: 9999,
|
|
3360
|
+
pointerEvents: "none"
|
|
3361
|
+
}
|
|
3362
|
+
}),
|
|
3363
|
+
M = $("<div>", {
|
|
3364
|
+
class: "domquery-spinner",
|
|
3365
|
+
css: {
|
|
3366
|
+
width: "45px",
|
|
3367
|
+
height: "45px",
|
|
3368
|
+
border: "3px solid #f3f3f3",
|
|
3369
|
+
borderTop: "3px solid #3498db",
|
|
3370
|
+
borderRadius: "50%",
|
|
3371
|
+
animation: "spin 1s linear infinite",
|
|
3372
|
+
display: "block"
|
|
3373
|
+
}
|
|
3374
|
+
});
|
|
3375
|
+
h = $("<div>", {
|
|
3376
|
+
class: "domquery-spinner-overlay",
|
|
3377
|
+
css: {
|
|
3378
|
+
position: "absolute",
|
|
3379
|
+
top: 0,
|
|
3380
|
+
left: 0,
|
|
3381
|
+
width: "100%",
|
|
3382
|
+
height: "100%",
|
|
3383
|
+
backgroundColor: h,
|
|
3384
|
+
opacity: r,
|
|
3385
|
+
display: "block",
|
|
3386
|
+
zIndex: 9998,
|
|
3387
|
+
textAlign: "center",
|
|
3388
|
+
paddingTop: "60px"
|
|
3389
|
+
}
|
|
3390
|
+
});
|
|
3391
|
+
const y = $("<div>", {
|
|
3392
|
+
class: "domquery-spinner-message-overlay",
|
|
3393
|
+
css: {
|
|
3394
|
+
position: "absolute",
|
|
3395
|
+
top: 0,
|
|
3396
|
+
left: 0,
|
|
3397
|
+
width: "100%",
|
|
3398
|
+
height: "100%",
|
|
3399
|
+
backgroundColor: "transparent",
|
|
3400
|
+
zIndex: 9999,
|
|
3401
|
+
display: "flex",
|
|
3402
|
+
justifyContent: "center",
|
|
3403
|
+
alignItems: "center",
|
|
3404
|
+
pointerEvents: "none"
|
|
3405
|
+
}
|
|
3406
|
+
});
|
|
3407
|
+
r = r || .8;
|
|
3408
|
+
const K = "spinner-style-" + r;
|
|
3409
|
+
$("#" + K).remove();
|
|
3410
|
+
$("<style>", {
|
|
3411
|
+
id: K,
|
|
3412
|
+
text: `\n @keyframes spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n }\n @keyframes fadeIn {\n 0% { opacity: 0; }\n 100% { opacity: ${r}; }\n }\n @keyframes fadeOut {\n 0% { opacity: ${r}; }\n 100% { opacity: 0; }\n }\n @keyframes messageShow {\n 0% { opacity: 0; }\n 100% { opacity: 1; }\n }\n @keyframes messageHide {\n 0% { opacity: 1; }\n 100% { opacity: 0; }\n }\n .domquery-spinner-overlay {\n animation: fadeIn 0.5s forwards;\n }\n .domquery-spinner-message {\n opacity: 0;\n animation: messageShow 0.5s forwards;\n }\n `
|
|
3413
|
+
}).appendTo("head");
|
|
3414
|
+
F.append(M);
|
|
3415
|
+
a.append(h);
|
|
3416
|
+
a.append(y);
|
|
3417
|
+
a.append(F);
|
|
3418
|
+
h.data("opacity", r);
|
|
3419
|
+
return {
|
|
3420
|
+
spinner: M,
|
|
3421
|
+
overlay: h,
|
|
3422
|
+
messageOverlay: y,
|
|
3423
|
+
spinnerContainer: F
|
|
3424
|
+
}
|
|
3425
|
+
};
|
|
3426
|
+
x = (h, r) => {
|
|
3427
|
+
void 0 !== h && "50%" !== h && p.spinnerContainer.css({
|
|
3428
|
+
top: h
|
|
3429
|
+
});
|
|
3430
|
+
void 0 !== r && "50%" !== r && p.spinnerContainer.css({
|
|
3431
|
+
left: r
|
|
3432
|
+
})
|
|
3433
|
+
};
|
|
3434
|
+
b = (h, r) => {
|
|
3435
|
+
Object.keys(r).forEach(F => {
|
|
3436
|
+
"function" === typeof r[F] && (h.find("*").each(function() {
|
|
3437
|
+
this[F] = r[F].bind(this)
|
|
3438
|
+
}), h[0][F] = r[F].bind(h[0]))
|
|
3439
|
+
})
|
|
3440
|
+
};
|
|
3441
|
+
if ("object" === typeof v) {
|
|
3442
|
+
const {
|
|
3443
|
+
top: h,
|
|
3444
|
+
left: r,
|
|
3445
|
+
html: F,
|
|
3446
|
+
text: M,
|
|
3447
|
+
backgroundColor: y,
|
|
3448
|
+
opacity: K,
|
|
3449
|
+
spinner: w
|
|
3450
|
+
} = v;
|
|
3451
|
+
p =
|
|
3452
|
+
g(y, K);
|
|
3453
|
+
x(h, r);
|
|
3454
|
+
if (void 0 !== F) {
|
|
3455
|
+
const D = $("<div>", {
|
|
3456
|
+
class: "domquery-spinner-message",
|
|
3457
|
+
css: {
|
|
3458
|
+
position: "absolute",
|
|
3459
|
+
top: "0",
|
|
3460
|
+
left: "0",
|
|
3461
|
+
right: "0",
|
|
3462
|
+
bottom: "0",
|
|
3463
|
+
width: "100%",
|
|
3464
|
+
height: "100%",
|
|
3465
|
+
textAlign: "center",
|
|
3466
|
+
zIndex: 10001,
|
|
3467
|
+
color: "#fff",
|
|
3468
|
+
display: "flex",
|
|
3469
|
+
alignItems: "center",
|
|
3470
|
+
justifyContent: "center",
|
|
3471
|
+
boxSizing: "border-box",
|
|
3472
|
+
margin: "0",
|
|
3473
|
+
padding: "0",
|
|
3474
|
+
opacity: 0,
|
|
3475
|
+
pointerEvents: "auto"
|
|
3476
|
+
}
|
|
3477
|
+
}).appendTo(a);
|
|
3478
|
+
D.html(F);
|
|
3479
|
+
b(D, v);
|
|
3480
|
+
setTimeout(() => {
|
|
3481
|
+
D.css("animation", "messageShow 0.5s forwards")
|
|
3482
|
+
}, 50);
|
|
3483
|
+
!0 !== w && setTimeout(() => {
|
|
3484
|
+
$(".domquery-spinner").hide();
|
|
3485
|
+
$(".domquery-spinner-container").hide()
|
|
3486
|
+
}, 300)
|
|
3487
|
+
} else if (void 0 !== M) {
|
|
3488
|
+
const D = $("<div>", {
|
|
3489
|
+
class: "domquery-spinner-message",
|
|
3490
|
+
css: {
|
|
3491
|
+
position: "absolute",
|
|
3492
|
+
top: "50%",
|
|
3493
|
+
left: "50%",
|
|
3494
|
+
transform: "translate(-50%, -50%)",
|
|
3495
|
+
width: "100%",
|
|
3496
|
+
textAlign: "center",
|
|
3497
|
+
zIndex: 10001,
|
|
3498
|
+
color: "#fff",
|
|
3499
|
+
opacity: 0,
|
|
3500
|
+
pointerEvents: "auto"
|
|
3501
|
+
}
|
|
3502
|
+
}).appendTo(a);
|
|
3503
|
+
D.html(M);
|
|
3504
|
+
b(D, v);
|
|
3505
|
+
setTimeout(() => {
|
|
3506
|
+
D.css("animation", "messageShow 0.5s forwards")
|
|
3507
|
+
}, 50);
|
|
3508
|
+
!0 !== w && setTimeout(() => {
|
|
3509
|
+
$(".domquery-spinner").hide();
|
|
3510
|
+
$(".domquery-spinner-container").hide()
|
|
3511
|
+
}, 300)
|
|
3512
|
+
}
|
|
3513
|
+
} else p = g(), x(v,
|
|
3514
|
+
L);
|
|
3515
|
+
return this
|
|
3516
|
+
};
|