@luizleon/sf.prefeiturasp.vuecomponents 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/content/Content.d.ts +21 -0
- package/dist/components/icon/Icon.d.ts +39 -0
- package/dist/components/internal/LoadingCircle.d.ts +2 -0
- package/dist/components/internal/LogoutIcon.d.ts +2 -0
- package/dist/components/internal/MenuIcon.d.ts +2 -0
- package/dist/components/internal/ScrollToTop.d.ts +2 -0
- package/dist/components/internal/ThemeToggle.d.ts +2 -0
- package/dist/components/internal/cssClassBuilder.d.ts +29 -0
- package/dist/components/layout/Layout.d.ts +12 -0
- package/dist/components/navmenulink/NavMenuLink.d.ts +12 -0
- package/dist/enum/cor.d.ts +9 -0
- package/dist/enum/index.d.ts +2 -0
- package/dist/enum/tamanho.d.ts +5 -0
- package/dist/index.d.ts +9 -0
- package/dist/lib.es.js +2724 -0
- package/dist/lib.umd.js +79 -0
- package/dist/services/authService.d.ts +20 -0
- package/dist/services/dialogService.d.ts +12 -0
- package/dist/services/navMenuService.d.ts +9 -0
- package/dist/style.css +1 -0
- package/package.json +31 -0
- package/src/components/content/Content.d.ts +35 -0
- package/src/components/content/Content.vue +41 -0
- package/src/components/icon/Icon.d.ts +38 -0
- package/src/components/icon/Icon.vue +43 -0
- package/src/components/internal/LoadingCircle.vue +16 -0
- package/src/components/internal/LogoutIcon.vue +14 -0
- package/src/components/internal/MenuIcon.vue +13 -0
- package/src/components/internal/ScrollToTop.vue +26 -0
- package/src/components/internal/ThemeToggle.ts +41 -0
- package/src/components/internal/ThemeToggle.vue +23 -0
- package/src/components/internal/cssClassBuilder.ts +44 -0
- package/src/components/layout/Layout.d.ts +44 -0
- package/src/components/layout/Layout.vue +63 -0
- package/src/components/navmenulink/NavMenuLink.d.ts +34 -0
- package/src/components/navmenulink/NavMenuLink.vue +41 -0
- package/src/enum/cor.ts +9 -0
- package/src/enum/index.ts +2 -0
- package/src/enum/tamanho.ts +5 -0
- package/src/index.ts +56 -0
- package/src/services/authService.ts +69 -0
- package/src/services/dialogService.ts +35 -0
- package/src/services/navMenuService.ts +21 -0
- package/src/sf-oidc-state.html +15 -0
- package/src/style/componentes.scss +22 -0
- package/src/style/src/_animation.scss +441 -0
- package/src/style/src/_display.scss +10 -0
- package/src/style/src/_flexbox.scss +85 -0
- package/src/style/src/_functions.scss +171 -0
- package/src/style/src/_gap.scss +8 -0
- package/src/style/src/_grid.scss +100 -0
- package/src/style/src/_mixins.scss +633 -0
- package/src/style/src/_normalize.scss +351 -0
- package/src/style/src/_ripple.scss +30 -0
- package/src/style/src/_size.scss +98 -0
- package/src/style/src/_spacing.scss +42 -0
- package/src/style/src/_typography.scss +43 -0
- package/src/style/src/_variables.scss +87 -0
- package/src/style/src/components/_button.scss +110 -0
- package/src/style/src/components/_checkbox.scss +53 -0
- package/src/style/src/components/_content.scss +57 -0
- package/src/style/src/components/_datefield.scss +405 -0
- package/src/style/src/components/_drawer.scss +99 -0
- package/src/style/src/components/_icon.scss +120 -0
- package/src/style/src/components/_internal_icon_button.scss +5 -0
- package/src/style/src/components/_layout.scss +183 -0
- package/src/style/src/components/_loading-circle.scss +24 -0
- package/src/style/src/components/_mark.scss +9 -0
- package/src/style/src/components/_mask.scss +33 -0
- package/src/style/src/components/_navmenulink.scss +31 -0
- package/src/style/src/components/_numpad.scss +58 -0
- package/src/style/src/components/_progress-circular.scss +52 -0
- package/src/style/src/components/_scrollToTop.scss +28 -0
- package/src/style/src/components/_select.scss +60 -0
- package/src/style/src/components/_svg_icon.scss +5 -0
- package/src/style/src/components/_textfield.scss +186 -0
- package/src/style/src/components/_themetoggle.scss +25 -0
- package/src/style/src/components/_toast.scss +66 -0
- package/src/style/src/components/_tooltip.scss +55 -0
- package/src/style/src/sweetalert/_sweetalert.scss +9 -0
- package/src/style/src/sweetalert/scss/_animations.scss +197 -0
- package/src/style/src/sweetalert/scss/_body.scss +45 -0
- package/src/style/src/sweetalert/scss/_core.scss +863 -0
- package/src/style/src/sweetalert/scss/_mixins.scss +16 -0
- package/src/style/src/sweetalert/scss/_theming.scss +8 -0
- package/src/style/src/sweetalert/scss/_toasts-animations.scss +83 -0
- package/src/style/src/sweetalert/scss/_toasts-body.scss +85 -0
- package/src/style/src/sweetalert/scss/_toasts.scss +203 -0
- package/src/style/src/sweetalert/scss/_variables.scss +265 -0
- package/src/style/tema.scss +169 -0
- package/src/ts-helpers.d.ts +57 -0
- package/tsconfig.json +19 -0
- package/vite.config.js +25 -0
package/dist/lib.es.js
ADDED
|
@@ -0,0 +1,2724 @@
|
|
|
1
|
+
var ur = Object.defineProperty;
|
|
2
|
+
var dr = (a, o, d) => o in a ? ur(a, o, { enumerable: !0, configurable: !0, writable: !0, value: d }) : a[o] = d;
|
|
3
|
+
var Ze = (a, o, d) => (dr(a, typeof o != "symbol" ? o + "" : o, d), d);
|
|
4
|
+
import { ref, openBlock, createElementBlock, createElementVNode, defineComponent, normalizeStyle, normalizeClass, mergeProps, createBlock, Fragment, createTextVNode, toDisplayString, createCommentVNode, unref, createStaticVNode, createVNode, renderSlot, resolveComponent, withCtx, onMounted, nextTick } from "vue";
|
|
5
|
+
var commonjsGlobal = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
6
|
+
function getDefaultExportFromCjs(a) {
|
|
7
|
+
return a && a.__esModule && Object.prototype.hasOwnProperty.call(a, "default") ? a.default : a;
|
|
8
|
+
}
|
|
9
|
+
var base64Js = {};
|
|
10
|
+
base64Js.byteLength = byteLength;
|
|
11
|
+
base64Js.toByteArray = toByteArray;
|
|
12
|
+
base64Js.fromByteArray = fromByteArray;
|
|
13
|
+
var lookup = [], revLookup = [], Arr = typeof Uint8Array < "u" ? Uint8Array : Array, code = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
14
|
+
for (var i = 0, len = code.length; i < len; ++i)
|
|
15
|
+
lookup[i] = code[i], revLookup[code.charCodeAt(i)] = i;
|
|
16
|
+
revLookup["-".charCodeAt(0)] = 62;
|
|
17
|
+
revLookup["_".charCodeAt(0)] = 63;
|
|
18
|
+
function getLens(a) {
|
|
19
|
+
var o = a.length;
|
|
20
|
+
if (o % 4 > 0)
|
|
21
|
+
throw new Error("Invalid string. Length must be a multiple of 4");
|
|
22
|
+
var d = a.indexOf("=");
|
|
23
|
+
d === -1 && (d = o);
|
|
24
|
+
var f = d === o ? 0 : 4 - d % 4;
|
|
25
|
+
return [d, f];
|
|
26
|
+
}
|
|
27
|
+
function byteLength(a) {
|
|
28
|
+
var o = getLens(a), d = o[0], f = o[1];
|
|
29
|
+
return (d + f) * 3 / 4 - f;
|
|
30
|
+
}
|
|
31
|
+
function _byteLength(a, o, d) {
|
|
32
|
+
return (o + d) * 3 / 4 - d;
|
|
33
|
+
}
|
|
34
|
+
function toByteArray(a) {
|
|
35
|
+
var o, d = getLens(a), f = d[0], y = d[1], l = new Arr(_byteLength(a, f, y)), k = 0, g = y > 0 ? f - 4 : f, _;
|
|
36
|
+
for (_ = 0; _ < g; _ += 4)
|
|
37
|
+
o = revLookup[a.charCodeAt(_)] << 18 | revLookup[a.charCodeAt(_ + 1)] << 12 | revLookup[a.charCodeAt(_ + 2)] << 6 | revLookup[a.charCodeAt(_ + 3)], l[k++] = o >> 16 & 255, l[k++] = o >> 8 & 255, l[k++] = o & 255;
|
|
38
|
+
return y === 2 && (o = revLookup[a.charCodeAt(_)] << 2 | revLookup[a.charCodeAt(_ + 1)] >> 4, l[k++] = o & 255), y === 1 && (o = revLookup[a.charCodeAt(_)] << 10 | revLookup[a.charCodeAt(_ + 1)] << 4 | revLookup[a.charCodeAt(_ + 2)] >> 2, l[k++] = o >> 8 & 255, l[k++] = o & 255), l;
|
|
39
|
+
}
|
|
40
|
+
function tripletToBase64(a) {
|
|
41
|
+
return lookup[a >> 18 & 63] + lookup[a >> 12 & 63] + lookup[a >> 6 & 63] + lookup[a & 63];
|
|
42
|
+
}
|
|
43
|
+
function encodeChunk(a, o, d) {
|
|
44
|
+
for (var f, y = [], l = o; l < d; l += 3)
|
|
45
|
+
f = (a[l] << 16 & 16711680) + (a[l + 1] << 8 & 65280) + (a[l + 2] & 255), y.push(tripletToBase64(f));
|
|
46
|
+
return y.join("");
|
|
47
|
+
}
|
|
48
|
+
function fromByteArray(a) {
|
|
49
|
+
for (var o, d = a.length, f = d % 3, y = [], l = 16383, k = 0, g = d - f; k < g; k += l)
|
|
50
|
+
y.push(encodeChunk(a, k, k + l > g ? g : k + l));
|
|
51
|
+
return f === 1 ? (o = a[d - 1], y.push(
|
|
52
|
+
lookup[o >> 2] + lookup[o << 4 & 63] + "=="
|
|
53
|
+
)) : f === 2 && (o = (a[d - 2] << 8) + a[d - 1], y.push(
|
|
54
|
+
lookup[o >> 10] + lookup[o >> 4 & 63] + lookup[o << 2 & 63] + "="
|
|
55
|
+
)), y.join("");
|
|
56
|
+
}
|
|
57
|
+
var sha256$1 = { exports: {} };
|
|
58
|
+
/**
|
|
59
|
+
* [js-sha256]{@link https://github.com/emn178/js-sha256}
|
|
60
|
+
*
|
|
61
|
+
* @version 0.9.0
|
|
62
|
+
* @author Chen, Yi-Cyuan [emn178@gmail.com]
|
|
63
|
+
* @copyright Chen, Yi-Cyuan 2014-2017
|
|
64
|
+
* @license MIT
|
|
65
|
+
*/
|
|
66
|
+
(function(module) {
|
|
67
|
+
(function() {
|
|
68
|
+
var ERROR = "input is invalid type", WINDOW = typeof window == "object", root = WINDOW ? window : {};
|
|
69
|
+
root.JS_SHA256_NO_WINDOW && (WINDOW = !1);
|
|
70
|
+
var WEB_WORKER = !WINDOW && typeof self == "object", NODE_JS = !root.JS_SHA256_NO_NODE_JS && typeof process == "object" && process.versions && process.versions.node;
|
|
71
|
+
NODE_JS ? root = commonjsGlobal : WEB_WORKER && (root = self);
|
|
72
|
+
var COMMON_JS = !root.JS_SHA256_NO_COMMON_JS && !0 && module.exports, ARRAY_BUFFER = !root.JS_SHA256_NO_ARRAY_BUFFER && typeof ArrayBuffer < "u", HEX_CHARS = "0123456789abcdef".split(""), EXTRA = [-2147483648, 8388608, 32768, 128], SHIFT = [24, 16, 8, 0], K = [
|
|
73
|
+
1116352408,
|
|
74
|
+
1899447441,
|
|
75
|
+
3049323471,
|
|
76
|
+
3921009573,
|
|
77
|
+
961987163,
|
|
78
|
+
1508970993,
|
|
79
|
+
2453635748,
|
|
80
|
+
2870763221,
|
|
81
|
+
3624381080,
|
|
82
|
+
310598401,
|
|
83
|
+
607225278,
|
|
84
|
+
1426881987,
|
|
85
|
+
1925078388,
|
|
86
|
+
2162078206,
|
|
87
|
+
2614888103,
|
|
88
|
+
3248222580,
|
|
89
|
+
3835390401,
|
|
90
|
+
4022224774,
|
|
91
|
+
264347078,
|
|
92
|
+
604807628,
|
|
93
|
+
770255983,
|
|
94
|
+
1249150122,
|
|
95
|
+
1555081692,
|
|
96
|
+
1996064986,
|
|
97
|
+
2554220882,
|
|
98
|
+
2821834349,
|
|
99
|
+
2952996808,
|
|
100
|
+
3210313671,
|
|
101
|
+
3336571891,
|
|
102
|
+
3584528711,
|
|
103
|
+
113926993,
|
|
104
|
+
338241895,
|
|
105
|
+
666307205,
|
|
106
|
+
773529912,
|
|
107
|
+
1294757372,
|
|
108
|
+
1396182291,
|
|
109
|
+
1695183700,
|
|
110
|
+
1986661051,
|
|
111
|
+
2177026350,
|
|
112
|
+
2456956037,
|
|
113
|
+
2730485921,
|
|
114
|
+
2820302411,
|
|
115
|
+
3259730800,
|
|
116
|
+
3345764771,
|
|
117
|
+
3516065817,
|
|
118
|
+
3600352804,
|
|
119
|
+
4094571909,
|
|
120
|
+
275423344,
|
|
121
|
+
430227734,
|
|
122
|
+
506948616,
|
|
123
|
+
659060556,
|
|
124
|
+
883997877,
|
|
125
|
+
958139571,
|
|
126
|
+
1322822218,
|
|
127
|
+
1537002063,
|
|
128
|
+
1747873779,
|
|
129
|
+
1955562222,
|
|
130
|
+
2024104815,
|
|
131
|
+
2227730452,
|
|
132
|
+
2361852424,
|
|
133
|
+
2428436474,
|
|
134
|
+
2756734187,
|
|
135
|
+
3204031479,
|
|
136
|
+
3329325298
|
|
137
|
+
], OUTPUT_TYPES = ["hex", "array", "digest", "arrayBuffer"], blocks = [];
|
|
138
|
+
(root.JS_SHA256_NO_NODE_JS || !Array.isArray) && (Array.isArray = function(a) {
|
|
139
|
+
return Object.prototype.toString.call(a) === "[object Array]";
|
|
140
|
+
}), ARRAY_BUFFER && (root.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW || !ArrayBuffer.isView) && (ArrayBuffer.isView = function(a) {
|
|
141
|
+
return typeof a == "object" && a.buffer && a.buffer.constructor === ArrayBuffer;
|
|
142
|
+
});
|
|
143
|
+
var createOutputMethod = function(a, o) {
|
|
144
|
+
return function(d) {
|
|
145
|
+
return new Sha256(o, !0).update(d)[a]();
|
|
146
|
+
};
|
|
147
|
+
}, createMethod = function(a) {
|
|
148
|
+
var o = createOutputMethod("hex", a);
|
|
149
|
+
NODE_JS && (o = nodeWrap(o, a)), o.create = function() {
|
|
150
|
+
return new Sha256(a);
|
|
151
|
+
}, o.update = function(y) {
|
|
152
|
+
return o.create().update(y);
|
|
153
|
+
};
|
|
154
|
+
for (var d = 0; d < OUTPUT_TYPES.length; ++d) {
|
|
155
|
+
var f = OUTPUT_TYPES[d];
|
|
156
|
+
o[f] = createOutputMethod(f, a);
|
|
157
|
+
}
|
|
158
|
+
return o;
|
|
159
|
+
}, nodeWrap = function(method, is224) {
|
|
160
|
+
var crypto = eval("require('crypto')"), Buffer = eval("require('buffer').Buffer"), algorithm = is224 ? "sha224" : "sha256", nodeMethod = function(a) {
|
|
161
|
+
if (typeof a == "string")
|
|
162
|
+
return crypto.createHash(algorithm).update(a, "utf8").digest("hex");
|
|
163
|
+
if (a == null)
|
|
164
|
+
throw new Error(ERROR);
|
|
165
|
+
return a.constructor === ArrayBuffer && (a = new Uint8Array(a)), Array.isArray(a) || ArrayBuffer.isView(a) || a.constructor === Buffer ? crypto.createHash(algorithm).update(new Buffer(a)).digest("hex") : method(a);
|
|
166
|
+
};
|
|
167
|
+
return nodeMethod;
|
|
168
|
+
}, createHmacOutputMethod = function(a, o) {
|
|
169
|
+
return function(d, f) {
|
|
170
|
+
return new HmacSha256(d, o, !0).update(f)[a]();
|
|
171
|
+
};
|
|
172
|
+
}, createHmacMethod = function(a) {
|
|
173
|
+
var o = createHmacOutputMethod("hex", a);
|
|
174
|
+
o.create = function(y) {
|
|
175
|
+
return new HmacSha256(y, a);
|
|
176
|
+
}, o.update = function(y, l) {
|
|
177
|
+
return o.create(y).update(l);
|
|
178
|
+
};
|
|
179
|
+
for (var d = 0; d < OUTPUT_TYPES.length; ++d) {
|
|
180
|
+
var f = OUTPUT_TYPES[d];
|
|
181
|
+
o[f] = createHmacOutputMethod(f, a);
|
|
182
|
+
}
|
|
183
|
+
return o;
|
|
184
|
+
};
|
|
185
|
+
function Sha256(a, o) {
|
|
186
|
+
o ? (blocks[0] = blocks[16] = blocks[1] = blocks[2] = blocks[3] = blocks[4] = blocks[5] = blocks[6] = blocks[7] = blocks[8] = blocks[9] = blocks[10] = blocks[11] = blocks[12] = blocks[13] = blocks[14] = blocks[15] = 0, this.blocks = blocks) : this.blocks = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], a ? (this.h0 = 3238371032, this.h1 = 914150663, this.h2 = 812702999, this.h3 = 4144912697, this.h4 = 4290775857, this.h5 = 1750603025, this.h6 = 1694076839, this.h7 = 3204075428) : (this.h0 = 1779033703, this.h1 = 3144134277, this.h2 = 1013904242, this.h3 = 2773480762, this.h4 = 1359893119, this.h5 = 2600822924, this.h6 = 528734635, this.h7 = 1541459225), this.block = this.start = this.bytes = this.hBytes = 0, this.finalized = this.hashed = !1, this.first = !0, this.is224 = a;
|
|
187
|
+
}
|
|
188
|
+
Sha256.prototype.update = function(a) {
|
|
189
|
+
if (!this.finalized) {
|
|
190
|
+
var o, d = typeof a;
|
|
191
|
+
if (d !== "string") {
|
|
192
|
+
if (d === "object") {
|
|
193
|
+
if (a === null)
|
|
194
|
+
throw new Error(ERROR);
|
|
195
|
+
if (ARRAY_BUFFER && a.constructor === ArrayBuffer)
|
|
196
|
+
a = new Uint8Array(a);
|
|
197
|
+
else if (!Array.isArray(a) && (!ARRAY_BUFFER || !ArrayBuffer.isView(a)))
|
|
198
|
+
throw new Error(ERROR);
|
|
199
|
+
} else
|
|
200
|
+
throw new Error(ERROR);
|
|
201
|
+
o = !0;
|
|
202
|
+
}
|
|
203
|
+
for (var f, y = 0, l, k = a.length, g = this.blocks; y < k; ) {
|
|
204
|
+
if (this.hashed && (this.hashed = !1, g[0] = this.block, g[16] = g[1] = g[2] = g[3] = g[4] = g[5] = g[6] = g[7] = g[8] = g[9] = g[10] = g[11] = g[12] = g[13] = g[14] = g[15] = 0), o)
|
|
205
|
+
for (l = this.start; y < k && l < 64; ++y)
|
|
206
|
+
g[l >> 2] |= a[y] << SHIFT[l++ & 3];
|
|
207
|
+
else
|
|
208
|
+
for (l = this.start; y < k && l < 64; ++y)
|
|
209
|
+
f = a.charCodeAt(y), f < 128 ? g[l >> 2] |= f << SHIFT[l++ & 3] : f < 2048 ? (g[l >> 2] |= (192 | f >> 6) << SHIFT[l++ & 3], g[l >> 2] |= (128 | f & 63) << SHIFT[l++ & 3]) : f < 55296 || f >= 57344 ? (g[l >> 2] |= (224 | f >> 12) << SHIFT[l++ & 3], g[l >> 2] |= (128 | f >> 6 & 63) << SHIFT[l++ & 3], g[l >> 2] |= (128 | f & 63) << SHIFT[l++ & 3]) : (f = 65536 + ((f & 1023) << 10 | a.charCodeAt(++y) & 1023), g[l >> 2] |= (240 | f >> 18) << SHIFT[l++ & 3], g[l >> 2] |= (128 | f >> 12 & 63) << SHIFT[l++ & 3], g[l >> 2] |= (128 | f >> 6 & 63) << SHIFT[l++ & 3], g[l >> 2] |= (128 | f & 63) << SHIFT[l++ & 3]);
|
|
210
|
+
this.lastByteIndex = l, this.bytes += l - this.start, l >= 64 ? (this.block = g[16], this.start = l - 64, this.hash(), this.hashed = !0) : this.start = l;
|
|
211
|
+
}
|
|
212
|
+
return this.bytes > 4294967295 && (this.hBytes += this.bytes / 4294967296 << 0, this.bytes = this.bytes % 4294967296), this;
|
|
213
|
+
}
|
|
214
|
+
}, Sha256.prototype.finalize = function() {
|
|
215
|
+
if (!this.finalized) {
|
|
216
|
+
this.finalized = !0;
|
|
217
|
+
var a = this.blocks, o = this.lastByteIndex;
|
|
218
|
+
a[16] = this.block, a[o >> 2] |= EXTRA[o & 3], this.block = a[16], o >= 56 && (this.hashed || this.hash(), a[0] = this.block, a[16] = a[1] = a[2] = a[3] = a[4] = a[5] = a[6] = a[7] = a[8] = a[9] = a[10] = a[11] = a[12] = a[13] = a[14] = a[15] = 0), a[14] = this.hBytes << 3 | this.bytes >>> 29, a[15] = this.bytes << 3, this.hash();
|
|
219
|
+
}
|
|
220
|
+
}, Sha256.prototype.hash = function() {
|
|
221
|
+
var a = this.h0, o = this.h1, d = this.h2, f = this.h3, y = this.h4, l = this.h5, k = this.h6, g = this.h7, _ = this.blocks, H, M, O, W, B, J, V, D, he, Q, ie;
|
|
222
|
+
for (H = 16; H < 64; ++H)
|
|
223
|
+
B = _[H - 15], M = (B >>> 7 | B << 25) ^ (B >>> 18 | B << 14) ^ B >>> 3, B = _[H - 2], O = (B >>> 17 | B << 15) ^ (B >>> 19 | B << 13) ^ B >>> 10, _[H] = _[H - 16] + M + _[H - 7] + O << 0;
|
|
224
|
+
for (ie = o & d, H = 0; H < 64; H += 4)
|
|
225
|
+
this.first ? (this.is224 ? (D = 300032, B = _[0] - 1413257819, g = B - 150054599 << 0, f = B + 24177077 << 0) : (D = 704751109, B = _[0] - 210244248, g = B - 1521486534 << 0, f = B + 143694565 << 0), this.first = !1) : (M = (a >>> 2 | a << 30) ^ (a >>> 13 | a << 19) ^ (a >>> 22 | a << 10), O = (y >>> 6 | y << 26) ^ (y >>> 11 | y << 21) ^ (y >>> 25 | y << 7), D = a & o, W = D ^ a & d ^ ie, V = y & l ^ ~y & k, B = g + O + V + K[H] + _[H], J = M + W, g = f + B << 0, f = B + J << 0), M = (f >>> 2 | f << 30) ^ (f >>> 13 | f << 19) ^ (f >>> 22 | f << 10), O = (g >>> 6 | g << 26) ^ (g >>> 11 | g << 21) ^ (g >>> 25 | g << 7), he = f & a, W = he ^ f & o ^ D, V = g & y ^ ~g & l, B = k + O + V + K[H + 1] + _[H + 1], J = M + W, k = d + B << 0, d = B + J << 0, M = (d >>> 2 | d << 30) ^ (d >>> 13 | d << 19) ^ (d >>> 22 | d << 10), O = (k >>> 6 | k << 26) ^ (k >>> 11 | k << 21) ^ (k >>> 25 | k << 7), Q = d & f, W = Q ^ d & a ^ he, V = k & g ^ ~k & y, B = l + O + V + K[H + 2] + _[H + 2], J = M + W, l = o + B << 0, o = B + J << 0, M = (o >>> 2 | o << 30) ^ (o >>> 13 | o << 19) ^ (o >>> 22 | o << 10), O = (l >>> 6 | l << 26) ^ (l >>> 11 | l << 21) ^ (l >>> 25 | l << 7), ie = o & d, W = ie ^ o & f ^ Q, V = l & k ^ ~l & g, B = y + O + V + K[H + 3] + _[H + 3], J = M + W, y = a + B << 0, a = B + J << 0;
|
|
226
|
+
this.h0 = this.h0 + a << 0, this.h1 = this.h1 + o << 0, this.h2 = this.h2 + d << 0, this.h3 = this.h3 + f << 0, this.h4 = this.h4 + y << 0, this.h5 = this.h5 + l << 0, this.h6 = this.h6 + k << 0, this.h7 = this.h7 + g << 0;
|
|
227
|
+
}, Sha256.prototype.hex = function() {
|
|
228
|
+
this.finalize();
|
|
229
|
+
var a = this.h0, o = this.h1, d = this.h2, f = this.h3, y = this.h4, l = this.h5, k = this.h6, g = this.h7, _ = HEX_CHARS[a >> 28 & 15] + HEX_CHARS[a >> 24 & 15] + HEX_CHARS[a >> 20 & 15] + HEX_CHARS[a >> 16 & 15] + HEX_CHARS[a >> 12 & 15] + HEX_CHARS[a >> 8 & 15] + HEX_CHARS[a >> 4 & 15] + HEX_CHARS[a & 15] + HEX_CHARS[o >> 28 & 15] + HEX_CHARS[o >> 24 & 15] + HEX_CHARS[o >> 20 & 15] + HEX_CHARS[o >> 16 & 15] + HEX_CHARS[o >> 12 & 15] + HEX_CHARS[o >> 8 & 15] + HEX_CHARS[o >> 4 & 15] + HEX_CHARS[o & 15] + HEX_CHARS[d >> 28 & 15] + HEX_CHARS[d >> 24 & 15] + HEX_CHARS[d >> 20 & 15] + HEX_CHARS[d >> 16 & 15] + HEX_CHARS[d >> 12 & 15] + HEX_CHARS[d >> 8 & 15] + HEX_CHARS[d >> 4 & 15] + HEX_CHARS[d & 15] + HEX_CHARS[f >> 28 & 15] + HEX_CHARS[f >> 24 & 15] + HEX_CHARS[f >> 20 & 15] + HEX_CHARS[f >> 16 & 15] + HEX_CHARS[f >> 12 & 15] + HEX_CHARS[f >> 8 & 15] + HEX_CHARS[f >> 4 & 15] + HEX_CHARS[f & 15] + HEX_CHARS[y >> 28 & 15] + HEX_CHARS[y >> 24 & 15] + HEX_CHARS[y >> 20 & 15] + HEX_CHARS[y >> 16 & 15] + HEX_CHARS[y >> 12 & 15] + HEX_CHARS[y >> 8 & 15] + HEX_CHARS[y >> 4 & 15] + HEX_CHARS[y & 15] + HEX_CHARS[l >> 28 & 15] + HEX_CHARS[l >> 24 & 15] + HEX_CHARS[l >> 20 & 15] + HEX_CHARS[l >> 16 & 15] + HEX_CHARS[l >> 12 & 15] + HEX_CHARS[l >> 8 & 15] + HEX_CHARS[l >> 4 & 15] + HEX_CHARS[l & 15] + HEX_CHARS[k >> 28 & 15] + HEX_CHARS[k >> 24 & 15] + HEX_CHARS[k >> 20 & 15] + HEX_CHARS[k >> 16 & 15] + HEX_CHARS[k >> 12 & 15] + HEX_CHARS[k >> 8 & 15] + HEX_CHARS[k >> 4 & 15] + HEX_CHARS[k & 15];
|
|
230
|
+
return this.is224 || (_ += HEX_CHARS[g >> 28 & 15] + HEX_CHARS[g >> 24 & 15] + HEX_CHARS[g >> 20 & 15] + HEX_CHARS[g >> 16 & 15] + HEX_CHARS[g >> 12 & 15] + HEX_CHARS[g >> 8 & 15] + HEX_CHARS[g >> 4 & 15] + HEX_CHARS[g & 15]), _;
|
|
231
|
+
}, Sha256.prototype.toString = Sha256.prototype.hex, Sha256.prototype.digest = function() {
|
|
232
|
+
this.finalize();
|
|
233
|
+
var a = this.h0, o = this.h1, d = this.h2, f = this.h3, y = this.h4, l = this.h5, k = this.h6, g = this.h7, _ = [
|
|
234
|
+
a >> 24 & 255,
|
|
235
|
+
a >> 16 & 255,
|
|
236
|
+
a >> 8 & 255,
|
|
237
|
+
a & 255,
|
|
238
|
+
o >> 24 & 255,
|
|
239
|
+
o >> 16 & 255,
|
|
240
|
+
o >> 8 & 255,
|
|
241
|
+
o & 255,
|
|
242
|
+
d >> 24 & 255,
|
|
243
|
+
d >> 16 & 255,
|
|
244
|
+
d >> 8 & 255,
|
|
245
|
+
d & 255,
|
|
246
|
+
f >> 24 & 255,
|
|
247
|
+
f >> 16 & 255,
|
|
248
|
+
f >> 8 & 255,
|
|
249
|
+
f & 255,
|
|
250
|
+
y >> 24 & 255,
|
|
251
|
+
y >> 16 & 255,
|
|
252
|
+
y >> 8 & 255,
|
|
253
|
+
y & 255,
|
|
254
|
+
l >> 24 & 255,
|
|
255
|
+
l >> 16 & 255,
|
|
256
|
+
l >> 8 & 255,
|
|
257
|
+
l & 255,
|
|
258
|
+
k >> 24 & 255,
|
|
259
|
+
k >> 16 & 255,
|
|
260
|
+
k >> 8 & 255,
|
|
261
|
+
k & 255
|
|
262
|
+
];
|
|
263
|
+
return this.is224 || _.push(g >> 24 & 255, g >> 16 & 255, g >> 8 & 255, g & 255), _;
|
|
264
|
+
}, Sha256.prototype.array = Sha256.prototype.digest, Sha256.prototype.arrayBuffer = function() {
|
|
265
|
+
this.finalize();
|
|
266
|
+
var a = new ArrayBuffer(this.is224 ? 28 : 32), o = new DataView(a);
|
|
267
|
+
return o.setUint32(0, this.h0), o.setUint32(4, this.h1), o.setUint32(8, this.h2), o.setUint32(12, this.h3), o.setUint32(16, this.h4), o.setUint32(20, this.h5), o.setUint32(24, this.h6), this.is224 || o.setUint32(28, this.h7), a;
|
|
268
|
+
};
|
|
269
|
+
function HmacSha256(a, o, d) {
|
|
270
|
+
var f, y = typeof a;
|
|
271
|
+
if (y === "string") {
|
|
272
|
+
var l = [], k = a.length, g = 0, _;
|
|
273
|
+
for (f = 0; f < k; ++f)
|
|
274
|
+
_ = a.charCodeAt(f), _ < 128 ? l[g++] = _ : _ < 2048 ? (l[g++] = 192 | _ >> 6, l[g++] = 128 | _ & 63) : _ < 55296 || _ >= 57344 ? (l[g++] = 224 | _ >> 12, l[g++] = 128 | _ >> 6 & 63, l[g++] = 128 | _ & 63) : (_ = 65536 + ((_ & 1023) << 10 | a.charCodeAt(++f) & 1023), l[g++] = 240 | _ >> 18, l[g++] = 128 | _ >> 12 & 63, l[g++] = 128 | _ >> 6 & 63, l[g++] = 128 | _ & 63);
|
|
275
|
+
a = l;
|
|
276
|
+
} else if (y === "object") {
|
|
277
|
+
if (a === null)
|
|
278
|
+
throw new Error(ERROR);
|
|
279
|
+
if (ARRAY_BUFFER && a.constructor === ArrayBuffer)
|
|
280
|
+
a = new Uint8Array(a);
|
|
281
|
+
else if (!Array.isArray(a) && (!ARRAY_BUFFER || !ArrayBuffer.isView(a)))
|
|
282
|
+
throw new Error(ERROR);
|
|
283
|
+
} else
|
|
284
|
+
throw new Error(ERROR);
|
|
285
|
+
a.length > 64 && (a = new Sha256(o, !0).update(a).array());
|
|
286
|
+
var H = [], M = [];
|
|
287
|
+
for (f = 0; f < 64; ++f) {
|
|
288
|
+
var O = a[f] || 0;
|
|
289
|
+
H[f] = 92 ^ O, M[f] = 54 ^ O;
|
|
290
|
+
}
|
|
291
|
+
Sha256.call(this, o, d), this.update(M), this.oKeyPad = H, this.inner = !0, this.sharedMemory = d;
|
|
292
|
+
}
|
|
293
|
+
HmacSha256.prototype = new Sha256(), HmacSha256.prototype.finalize = function() {
|
|
294
|
+
if (Sha256.prototype.finalize.call(this), this.inner) {
|
|
295
|
+
this.inner = !1;
|
|
296
|
+
var a = this.array();
|
|
297
|
+
Sha256.call(this, this.is224, this.sharedMemory), this.update(this.oKeyPad), this.update(a), Sha256.prototype.finalize.call(this);
|
|
298
|
+
}
|
|
299
|
+
};
|
|
300
|
+
var exports = createMethod();
|
|
301
|
+
exports.sha256 = exports, exports.sha224 = createMethod(!0), exports.sha256.hmac = createHmacMethod(), exports.sha224.hmac = createHmacMethod(!0), COMMON_JS ? module.exports = exports : (root.sha256 = exports.sha256, root.sha224 = exports.sha224);
|
|
302
|
+
})();
|
|
303
|
+
})(sha256$1);
|
|
304
|
+
var sha256Exports = sha256$1.exports;
|
|
305
|
+
const sha256 = /* @__PURE__ */ getDefaultExportFromCjs(sha256Exports);
|
|
306
|
+
if (typeof Promise > "u")
|
|
307
|
+
throw Error("Keycloak requires an environment that supports Promises. Make sure that you include the appropriate polyfill.");
|
|
308
|
+
function Keycloak(a) {
|
|
309
|
+
if (!(this instanceof Keycloak))
|
|
310
|
+
throw new Error("The 'Keycloak' constructor must be invoked with 'new'.");
|
|
311
|
+
for (var o = this, d, f = [], y, l = {
|
|
312
|
+
enable: !0,
|
|
313
|
+
callbackList: [],
|
|
314
|
+
interval: 5
|
|
315
|
+
}, k = document.getElementsByTagName("script"), g = 0; g < k.length; g++)
|
|
316
|
+
(k[g].src.indexOf("keycloak.js") !== -1 || k[g].src.indexOf("keycloak.min.js") !== -1) && k[g].src.indexOf("version=") !== -1 && (o.iframeVersion = k[g].src.substring(k[g].src.indexOf("version=") + 8).split("&")[0]);
|
|
317
|
+
var _ = !0, H = _e(console.info), M = _e(console.warn);
|
|
318
|
+
o.init = function(s) {
|
|
319
|
+
if (o.didInitialize)
|
|
320
|
+
throw new Error("A 'Keycloak' instance can only be initialized once.");
|
|
321
|
+
o.didInitialize = !0, o.authenticated = !1, y = ve();
|
|
322
|
+
var c = ["default", "cordova", "cordova-native"];
|
|
323
|
+
if (s && c.indexOf(s.adapter) > -1 ? d = I(s.adapter) : s && typeof s.adapter == "object" ? d = s.adapter : window.Cordova || window.cordova ? d = I("cordova") : d = I(), s) {
|
|
324
|
+
if (typeof s.useNonce < "u" && (_ = s.useNonce), typeof s.checkLoginIframe < "u" && (l.enable = s.checkLoginIframe), s.checkLoginIframeInterval && (l.interval = s.checkLoginIframeInterval), s.onLoad === "login-required" && (o.loginRequired = !0), s.responseMode)
|
|
325
|
+
if (s.responseMode === "query" || s.responseMode === "fragment")
|
|
326
|
+
o.responseMode = s.responseMode;
|
|
327
|
+
else
|
|
328
|
+
throw "Invalid value for responseMode";
|
|
329
|
+
if (s.flow) {
|
|
330
|
+
switch (s.flow) {
|
|
331
|
+
case "standard":
|
|
332
|
+
o.responseType = "code";
|
|
333
|
+
break;
|
|
334
|
+
case "implicit":
|
|
335
|
+
o.responseType = "id_token token";
|
|
336
|
+
break;
|
|
337
|
+
case "hybrid":
|
|
338
|
+
o.responseType = "code id_token token";
|
|
339
|
+
break;
|
|
340
|
+
default:
|
|
341
|
+
throw "Invalid value for flow";
|
|
342
|
+
}
|
|
343
|
+
o.flow = s.flow;
|
|
344
|
+
}
|
|
345
|
+
if (s.timeSkew != null && (o.timeSkew = s.timeSkew), s.redirectUri && (o.redirectUri = s.redirectUri), s.silentCheckSsoRedirectUri && (o.silentCheckSsoRedirectUri = s.silentCheckSsoRedirectUri), typeof s.silentCheckSsoFallback == "boolean" ? o.silentCheckSsoFallback = s.silentCheckSsoFallback : o.silentCheckSsoFallback = !0, s.pkceMethod) {
|
|
346
|
+
if (s.pkceMethod !== "S256")
|
|
347
|
+
throw "Invalid value for pkceMethod";
|
|
348
|
+
o.pkceMethod = s.pkceMethod;
|
|
349
|
+
}
|
|
350
|
+
typeof s.enableLogging == "boolean" ? o.enableLogging = s.enableLogging : o.enableLogging = !1, typeof s.scope == "string" && (o.scope = s.scope), typeof s.messageReceiveTimeout == "number" && s.messageReceiveTimeout > 0 ? o.messageReceiveTimeout = s.messageReceiveTimeout : o.messageReceiveTimeout = 1e4;
|
|
351
|
+
}
|
|
352
|
+
o.responseMode || (o.responseMode = "fragment"), o.responseType || (o.responseType = "code", o.flow = "standard");
|
|
353
|
+
var m = R(), w = R();
|
|
354
|
+
w.promise.then(function() {
|
|
355
|
+
o.onReady && o.onReady(o.authenticated), m.setSuccess(o.authenticated);
|
|
356
|
+
}).catch(function(S) {
|
|
357
|
+
m.setError(S);
|
|
358
|
+
});
|
|
359
|
+
var p = ie();
|
|
360
|
+
function C() {
|
|
361
|
+
var S = function(L) {
|
|
362
|
+
L || (E.prompt = "none"), s && s.locale && (E.locale = s.locale), o.login(E).then(function() {
|
|
363
|
+
w.setSuccess();
|
|
364
|
+
}).catch(function(G) {
|
|
365
|
+
w.setError(G);
|
|
366
|
+
});
|
|
367
|
+
}, x = function() {
|
|
368
|
+
var L = document.createElement("iframe"), G = o.createLoginUrl({ prompt: "none", redirectUri: o.silentCheckSsoRedirectUri });
|
|
369
|
+
L.setAttribute("src", G), L.setAttribute("sandbox", "allow-scripts allow-same-origin"), L.setAttribute("title", "keycloak-silent-check-sso"), L.style.display = "none", document.body.appendChild(L);
|
|
370
|
+
var ne = function(j) {
|
|
371
|
+
if (!(j.origin !== window.location.origin || L.contentWindow !== j.source)) {
|
|
372
|
+
var pe = ae(j.data);
|
|
373
|
+
Q(pe, w), document.body.removeChild(L), window.removeEventListener("message", ne);
|
|
374
|
+
}
|
|
375
|
+
};
|
|
376
|
+
window.addEventListener("message", ne);
|
|
377
|
+
}, E = {};
|
|
378
|
+
switch (s.onLoad) {
|
|
379
|
+
case "check-sso":
|
|
380
|
+
l.enable ? ce().then(function() {
|
|
381
|
+
re().then(function(L) {
|
|
382
|
+
L ? w.setSuccess() : o.silentCheckSsoRedirectUri ? x() : S(!1);
|
|
383
|
+
}).catch(function(L) {
|
|
384
|
+
w.setError(L);
|
|
385
|
+
});
|
|
386
|
+
}) : o.silentCheckSsoRedirectUri ? x() : S(!1);
|
|
387
|
+
break;
|
|
388
|
+
case "login-required":
|
|
389
|
+
S(!0);
|
|
390
|
+
break;
|
|
391
|
+
default:
|
|
392
|
+
throw "Invalid value for onLoad";
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
function b() {
|
|
396
|
+
var S = ae(window.location.href);
|
|
397
|
+
if (S && window.history.replaceState(window.history.state, null, S.newUrl), S && S.valid)
|
|
398
|
+
return ce().then(function() {
|
|
399
|
+
Q(S, w);
|
|
400
|
+
}).catch(function(x) {
|
|
401
|
+
w.setError(x);
|
|
402
|
+
});
|
|
403
|
+
s ? s.token && s.refreshToken ? (de(s.token, s.refreshToken, s.idToken), l.enable ? ce().then(function() {
|
|
404
|
+
re().then(function(x) {
|
|
405
|
+
x ? (o.onAuthSuccess && o.onAuthSuccess(), w.setSuccess(), N()) : w.setSuccess();
|
|
406
|
+
}).catch(function(x) {
|
|
407
|
+
w.setError(x);
|
|
408
|
+
});
|
|
409
|
+
}) : o.updateToken(-1).then(function() {
|
|
410
|
+
o.onAuthSuccess && o.onAuthSuccess(), w.setSuccess();
|
|
411
|
+
}).catch(function(x) {
|
|
412
|
+
o.onAuthError && o.onAuthError(), s.onLoad ? C() : w.setError(x);
|
|
413
|
+
})) : s.onLoad ? C() : w.setSuccess() : w.setSuccess();
|
|
414
|
+
}
|
|
415
|
+
function v() {
|
|
416
|
+
var S = R(), x = function() {
|
|
417
|
+
(document.readyState === "interactive" || document.readyState === "complete") && (document.removeEventListener("readystatechange", x), S.setSuccess());
|
|
418
|
+
};
|
|
419
|
+
return document.addEventListener("readystatechange", x), x(), S.promise;
|
|
420
|
+
}
|
|
421
|
+
return p.then(function() {
|
|
422
|
+
v().then(Y).then(b).catch(function(S) {
|
|
423
|
+
m.setError(S);
|
|
424
|
+
});
|
|
425
|
+
}), p.catch(function(S) {
|
|
426
|
+
m.setError(S);
|
|
427
|
+
}), m.promise;
|
|
428
|
+
}, o.login = function(s) {
|
|
429
|
+
return d.login(s);
|
|
430
|
+
};
|
|
431
|
+
function O(s) {
|
|
432
|
+
var c = null, m = window.crypto || window.msCrypto;
|
|
433
|
+
if (m && m.getRandomValues && window.Uint8Array)
|
|
434
|
+
return c = new Uint8Array(s), m.getRandomValues(c), c;
|
|
435
|
+
c = new Array(s);
|
|
436
|
+
for (var w = 0; w < c.length; w++)
|
|
437
|
+
c[w] = Math.floor(256 * Math.random());
|
|
438
|
+
return c;
|
|
439
|
+
}
|
|
440
|
+
function W(s) {
|
|
441
|
+
return B(s, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789");
|
|
442
|
+
}
|
|
443
|
+
function B(s, c) {
|
|
444
|
+
for (var m = O(s), w = new Array(s), p = 0; p < s; p++)
|
|
445
|
+
w[p] = c.charCodeAt(m[p] % c.length);
|
|
446
|
+
return String.fromCharCode.apply(null, w);
|
|
447
|
+
}
|
|
448
|
+
function J(s, c) {
|
|
449
|
+
switch (s) {
|
|
450
|
+
case "S256":
|
|
451
|
+
var m = new Uint8Array(sha256.arrayBuffer(c)), w = base64Js.fromByteArray(m).replace(/\+/g, "-").replace(/\//g, "_").replace(/\=/g, "");
|
|
452
|
+
return w;
|
|
453
|
+
default:
|
|
454
|
+
throw "Invalid value for pkceMethod";
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
function V(s) {
|
|
458
|
+
var c = {
|
|
459
|
+
id_token: {
|
|
460
|
+
acr: s
|
|
461
|
+
}
|
|
462
|
+
};
|
|
463
|
+
return JSON.stringify(c);
|
|
464
|
+
}
|
|
465
|
+
o.createLoginUrl = function(s) {
|
|
466
|
+
var c = Ie(), m = Ie(), w = d.redirectUri(s), p = {
|
|
467
|
+
state: c,
|
|
468
|
+
nonce: m,
|
|
469
|
+
redirectUri: encodeURIComponent(w)
|
|
470
|
+
};
|
|
471
|
+
s && s.prompt && (p.prompt = s.prompt);
|
|
472
|
+
var C;
|
|
473
|
+
s && s.action == "register" ? C = o.endpoints.register() : C = o.endpoints.authorize();
|
|
474
|
+
var b = s && s.scope || o.scope;
|
|
475
|
+
b ? b.indexOf("openid") === -1 && (b = "openid " + b) : b = "openid";
|
|
476
|
+
var v = C + "?client_id=" + encodeURIComponent(o.clientId) + "&redirect_uri=" + encodeURIComponent(w) + "&state=" + encodeURIComponent(c) + "&response_mode=" + encodeURIComponent(o.responseMode) + "&response_type=" + encodeURIComponent(o.responseType) + "&scope=" + encodeURIComponent(b);
|
|
477
|
+
if (_ && (v = v + "&nonce=" + encodeURIComponent(m)), s && s.prompt && (v += "&prompt=" + encodeURIComponent(s.prompt)), s && s.maxAge && (v += "&max_age=" + encodeURIComponent(s.maxAge)), s && s.loginHint && (v += "&login_hint=" + encodeURIComponent(s.loginHint)), s && s.idpHint && (v += "&kc_idp_hint=" + encodeURIComponent(s.idpHint)), s && s.action && s.action != "register" && (v += "&kc_action=" + encodeURIComponent(s.action)), s && s.locale && (v += "&ui_locales=" + encodeURIComponent(s.locale)), s && s.acr) {
|
|
478
|
+
var S = V(s.acr);
|
|
479
|
+
v += "&claims=" + encodeURIComponent(S);
|
|
480
|
+
}
|
|
481
|
+
if (o.pkceMethod) {
|
|
482
|
+
var x = W(96);
|
|
483
|
+
p.pkceCodeVerifier = x;
|
|
484
|
+
var E = J(o.pkceMethod, x);
|
|
485
|
+
v += "&code_challenge=" + E, v += "&code_challenge_method=" + o.pkceMethod;
|
|
486
|
+
}
|
|
487
|
+
return y.add(p), v;
|
|
488
|
+
}, o.logout = function(s) {
|
|
489
|
+
return d.logout(s);
|
|
490
|
+
}, o.createLogoutUrl = function(s) {
|
|
491
|
+
var c = o.endpoints.logout() + "?client_id=" + encodeURIComponent(o.clientId) + "&post_logout_redirect_uri=" + encodeURIComponent(d.redirectUri(s, !1));
|
|
492
|
+
return o.idToken && (c += "&id_token_hint=" + encodeURIComponent(o.idToken)), c;
|
|
493
|
+
}, o.register = function(s) {
|
|
494
|
+
return d.register(s);
|
|
495
|
+
}, o.createRegisterUrl = function(s) {
|
|
496
|
+
return s || (s = {}), s.action = "register", o.createLoginUrl(s);
|
|
497
|
+
}, o.createAccountUrl = function(s) {
|
|
498
|
+
var c = D(), m = void 0;
|
|
499
|
+
return typeof c < "u" && (m = c + "/account?referrer=" + encodeURIComponent(o.clientId) + "&referrer_uri=" + encodeURIComponent(d.redirectUri(s))), m;
|
|
500
|
+
}, o.accountManagement = function() {
|
|
501
|
+
return d.accountManagement();
|
|
502
|
+
}, o.hasRealmRole = function(s) {
|
|
503
|
+
var c = o.realmAccess;
|
|
504
|
+
return !!c && c.roles.indexOf(s) >= 0;
|
|
505
|
+
}, o.hasResourceRole = function(s, c) {
|
|
506
|
+
if (!o.resourceAccess)
|
|
507
|
+
return !1;
|
|
508
|
+
var m = o.resourceAccess[c || o.clientId];
|
|
509
|
+
return !!m && m.roles.indexOf(s) >= 0;
|
|
510
|
+
}, o.loadUserProfile = function() {
|
|
511
|
+
var s = D() + "/account", c = new XMLHttpRequest();
|
|
512
|
+
c.open("GET", s, !0), c.setRequestHeader("Accept", "application/json"), c.setRequestHeader("Authorization", "bearer " + o.token);
|
|
513
|
+
var m = R();
|
|
514
|
+
return c.onreadystatechange = function() {
|
|
515
|
+
c.readyState == 4 && (c.status == 200 ? (o.profile = JSON.parse(c.responseText), m.setSuccess(o.profile)) : m.setError());
|
|
516
|
+
}, c.send(), m.promise;
|
|
517
|
+
}, o.loadUserInfo = function() {
|
|
518
|
+
var s = o.endpoints.userinfo(), c = new XMLHttpRequest();
|
|
519
|
+
c.open("GET", s, !0), c.setRequestHeader("Accept", "application/json"), c.setRequestHeader("Authorization", "bearer " + o.token);
|
|
520
|
+
var m = R();
|
|
521
|
+
return c.onreadystatechange = function() {
|
|
522
|
+
c.readyState == 4 && (c.status == 200 ? (o.userInfo = JSON.parse(c.responseText), m.setSuccess(o.userInfo)) : m.setError());
|
|
523
|
+
}, c.send(), m.promise;
|
|
524
|
+
}, o.isTokenExpired = function(s) {
|
|
525
|
+
if (!o.tokenParsed || !o.refreshToken && o.flow != "implicit")
|
|
526
|
+
throw "Not authenticated";
|
|
527
|
+
if (o.timeSkew == null)
|
|
528
|
+
return H("[KEYCLOAK] Unable to determine if token is expired as timeskew is not set"), !0;
|
|
529
|
+
var c = o.tokenParsed.exp - Math.ceil((/* @__PURE__ */ new Date()).getTime() / 1e3) + o.timeSkew;
|
|
530
|
+
if (s) {
|
|
531
|
+
if (isNaN(s))
|
|
532
|
+
throw "Invalid minValidity";
|
|
533
|
+
c -= s;
|
|
534
|
+
}
|
|
535
|
+
return c < 0;
|
|
536
|
+
}, o.updateToken = function(s) {
|
|
537
|
+
var c = R();
|
|
538
|
+
if (!o.refreshToken)
|
|
539
|
+
return c.setError(), c.promise;
|
|
540
|
+
s = s || 5;
|
|
541
|
+
var m = function() {
|
|
542
|
+
var p = !1;
|
|
543
|
+
if (s == -1 ? (p = !0, H("[KEYCLOAK] Refreshing token: forced refresh")) : (!o.tokenParsed || o.isTokenExpired(s)) && (p = !0, H("[KEYCLOAK] Refreshing token: token expired")), !p)
|
|
544
|
+
c.setSuccess(!1);
|
|
545
|
+
else {
|
|
546
|
+
var C = "grant_type=refresh_token&refresh_token=" + o.refreshToken, b = o.endpoints.token();
|
|
547
|
+
if (f.push(c), f.length == 1) {
|
|
548
|
+
var v = new XMLHttpRequest();
|
|
549
|
+
v.open("POST", b, !0), v.setRequestHeader("Content-type", "application/x-www-form-urlencoded"), v.withCredentials = !0, C += "&client_id=" + encodeURIComponent(o.clientId);
|
|
550
|
+
var S = (/* @__PURE__ */ new Date()).getTime();
|
|
551
|
+
v.onreadystatechange = function() {
|
|
552
|
+
if (v.readyState == 4)
|
|
553
|
+
if (v.status == 200) {
|
|
554
|
+
H("[KEYCLOAK] Token refreshed"), S = (S + (/* @__PURE__ */ new Date()).getTime()) / 2;
|
|
555
|
+
var x = JSON.parse(v.responseText);
|
|
556
|
+
de(x.access_token, x.refresh_token, x.id_token, S), o.onAuthRefreshSuccess && o.onAuthRefreshSuccess();
|
|
557
|
+
for (var E = f.pop(); E != null; E = f.pop())
|
|
558
|
+
E.setSuccess(!0);
|
|
559
|
+
} else {
|
|
560
|
+
M("[KEYCLOAK] Failed to refresh token"), v.status == 400 && o.clearToken(), o.onAuthRefreshError && o.onAuthRefreshError();
|
|
561
|
+
for (var E = f.pop(); E != null; E = f.pop())
|
|
562
|
+
E.setError(!0);
|
|
563
|
+
}
|
|
564
|
+
}, v.send(C);
|
|
565
|
+
}
|
|
566
|
+
}
|
|
567
|
+
};
|
|
568
|
+
if (l.enable) {
|
|
569
|
+
var w = re();
|
|
570
|
+
w.then(function() {
|
|
571
|
+
m();
|
|
572
|
+
}).catch(function(p) {
|
|
573
|
+
c.setError(p);
|
|
574
|
+
});
|
|
575
|
+
} else
|
|
576
|
+
m();
|
|
577
|
+
return c.promise;
|
|
578
|
+
}, o.clearToken = function() {
|
|
579
|
+
o.token && (de(null, null, null), o.onAuthLogout && o.onAuthLogout(), o.loginRequired && o.login());
|
|
580
|
+
};
|
|
581
|
+
function D() {
|
|
582
|
+
if (typeof o.authServerUrl < "u")
|
|
583
|
+
return o.authServerUrl.charAt(o.authServerUrl.length - 1) == "/" ? o.authServerUrl + "realms/" + encodeURIComponent(o.realm) : o.authServerUrl + "/realms/" + encodeURIComponent(o.realm);
|
|
584
|
+
}
|
|
585
|
+
function he() {
|
|
586
|
+
return window.location.origin ? window.location.origin : window.location.protocol + "//" + window.location.hostname + (window.location.port ? ":" + window.location.port : "");
|
|
587
|
+
}
|
|
588
|
+
function Q(s, c) {
|
|
589
|
+
var m = s.code, w = s.error, p = s.prompt, C = (/* @__PURE__ */ new Date()).getTime();
|
|
590
|
+
if (s.kc_action_status && o.onActionUpdate && o.onActionUpdate(s.kc_action_status), w) {
|
|
591
|
+
if (p != "none") {
|
|
592
|
+
var b = { error: w, error_description: s.error_description };
|
|
593
|
+
o.onAuthError && o.onAuthError(b), c && c.setError(b);
|
|
594
|
+
} else
|
|
595
|
+
c && c.setSuccess();
|
|
596
|
+
return;
|
|
597
|
+
} else
|
|
598
|
+
o.flow != "standard" && (s.access_token || s.id_token) && E(s.access_token, null, s.id_token, !0);
|
|
599
|
+
if (o.flow != "implicit" && m) {
|
|
600
|
+
var v = "code=" + m + "&grant_type=authorization_code", S = o.endpoints.token(), x = new XMLHttpRequest();
|
|
601
|
+
x.open("POST", S, !0), x.setRequestHeader("Content-type", "application/x-www-form-urlencoded"), v += "&client_id=" + encodeURIComponent(o.clientId), v += "&redirect_uri=" + s.redirectUri, s.pkceCodeVerifier && (v += "&code_verifier=" + s.pkceCodeVerifier), x.withCredentials = !0, x.onreadystatechange = function() {
|
|
602
|
+
if (x.readyState == 4)
|
|
603
|
+
if (x.status == 200) {
|
|
604
|
+
var L = JSON.parse(x.responseText);
|
|
605
|
+
E(L.access_token, L.refresh_token, L.id_token, o.flow === "standard"), N();
|
|
606
|
+
} else
|
|
607
|
+
o.onAuthError && o.onAuthError(), c && c.setError();
|
|
608
|
+
}, x.send(v);
|
|
609
|
+
}
|
|
610
|
+
function E(L, G, ne, j) {
|
|
611
|
+
C = (C + (/* @__PURE__ */ new Date()).getTime()) / 2, de(L, G, ne, C), _ && (o.tokenParsed && o.tokenParsed.nonce != s.storedNonce || o.refreshTokenParsed && o.refreshTokenParsed.nonce != s.storedNonce || o.idTokenParsed && o.idTokenParsed.nonce != s.storedNonce) ? (H("[KEYCLOAK] Invalid nonce, clearing token"), o.clearToken(), c && c.setError()) : j && (o.onAuthSuccess && o.onAuthSuccess(), c && c.setSuccess());
|
|
612
|
+
}
|
|
613
|
+
}
|
|
614
|
+
function ie(s) {
|
|
615
|
+
var c = R(), m;
|
|
616
|
+
a ? typeof a == "string" && (m = a) : m = "keycloak.json";
|
|
617
|
+
function w(x) {
|
|
618
|
+
x ? o.endpoints = {
|
|
619
|
+
authorize: function() {
|
|
620
|
+
return x.authorization_endpoint;
|
|
621
|
+
},
|
|
622
|
+
token: function() {
|
|
623
|
+
return x.token_endpoint;
|
|
624
|
+
},
|
|
625
|
+
logout: function() {
|
|
626
|
+
if (!x.end_session_endpoint)
|
|
627
|
+
throw "Not supported by the OIDC server";
|
|
628
|
+
return x.end_session_endpoint;
|
|
629
|
+
},
|
|
630
|
+
checkSessionIframe: function() {
|
|
631
|
+
if (!x.check_session_iframe)
|
|
632
|
+
throw "Not supported by the OIDC server";
|
|
633
|
+
return x.check_session_iframe;
|
|
634
|
+
},
|
|
635
|
+
register: function() {
|
|
636
|
+
throw 'Redirection to "Register user" page not supported in standard OIDC mode';
|
|
637
|
+
},
|
|
638
|
+
userinfo: function() {
|
|
639
|
+
if (!x.userinfo_endpoint)
|
|
640
|
+
throw "Not supported by the OIDC server";
|
|
641
|
+
return x.userinfo_endpoint;
|
|
642
|
+
}
|
|
643
|
+
} : o.endpoints = {
|
|
644
|
+
authorize: function() {
|
|
645
|
+
return D() + "/protocol/openid-connect/auth";
|
|
646
|
+
},
|
|
647
|
+
token: function() {
|
|
648
|
+
return D() + "/protocol/openid-connect/token";
|
|
649
|
+
},
|
|
650
|
+
logout: function() {
|
|
651
|
+
return D() + "/protocol/openid-connect/logout";
|
|
652
|
+
},
|
|
653
|
+
checkSessionIframe: function() {
|
|
654
|
+
var E = D() + "/protocol/openid-connect/login-status-iframe.html";
|
|
655
|
+
return o.iframeVersion && (E = E + "?version=" + o.iframeVersion), E;
|
|
656
|
+
},
|
|
657
|
+
thirdPartyCookiesIframe: function() {
|
|
658
|
+
var E = D() + "/protocol/openid-connect/3p-cookies/step1.html";
|
|
659
|
+
return o.iframeVersion && (E = E + "?version=" + o.iframeVersion), E;
|
|
660
|
+
},
|
|
661
|
+
register: function() {
|
|
662
|
+
return D() + "/protocol/openid-connect/registrations";
|
|
663
|
+
},
|
|
664
|
+
userinfo: function() {
|
|
665
|
+
return D() + "/protocol/openid-connect/userinfo";
|
|
666
|
+
}
|
|
667
|
+
};
|
|
668
|
+
}
|
|
669
|
+
if (m) {
|
|
670
|
+
var p = new XMLHttpRequest();
|
|
671
|
+
p.open("GET", m, !0), p.setRequestHeader("Accept", "application/json"), p.onreadystatechange = function() {
|
|
672
|
+
if (p.readyState == 4)
|
|
673
|
+
if (p.status == 200 || Se(p)) {
|
|
674
|
+
var x = JSON.parse(p.responseText);
|
|
675
|
+
o.authServerUrl = x["auth-server-url"], o.realm = x.realm, o.clientId = x.resource, w(null), c.setSuccess();
|
|
676
|
+
} else
|
|
677
|
+
c.setError();
|
|
678
|
+
}, p.send();
|
|
679
|
+
} else {
|
|
680
|
+
if (!a.clientId)
|
|
681
|
+
throw "clientId missing";
|
|
682
|
+
o.clientId = a.clientId;
|
|
683
|
+
var C = a.oidcProvider;
|
|
684
|
+
if (C)
|
|
685
|
+
if (typeof C == "string") {
|
|
686
|
+
var S;
|
|
687
|
+
C.charAt(C.length - 1) == "/" ? S = C + ".well-known/openid-configuration" : S = C + "/.well-known/openid-configuration";
|
|
688
|
+
var p = new XMLHttpRequest();
|
|
689
|
+
p.open("GET", S, !0), p.setRequestHeader("Accept", "application/json"), p.onreadystatechange = function() {
|
|
690
|
+
if (p.readyState == 4)
|
|
691
|
+
if (p.status == 200 || Se(p)) {
|
|
692
|
+
var E = JSON.parse(p.responseText);
|
|
693
|
+
w(E), c.setSuccess();
|
|
694
|
+
} else
|
|
695
|
+
c.setError();
|
|
696
|
+
}, p.send();
|
|
697
|
+
} else
|
|
698
|
+
w(C), c.setSuccess();
|
|
699
|
+
else {
|
|
700
|
+
if (!a.url) {
|
|
701
|
+
for (var b = document.getElementsByTagName("script"), v = 0; v < b.length; v++)
|
|
702
|
+
if (b[v].src.match(/.*keycloak\.js/)) {
|
|
703
|
+
a.url = b[v].src.substr(0, b[v].src.indexOf("/js/keycloak.js"));
|
|
704
|
+
break;
|
|
705
|
+
}
|
|
706
|
+
}
|
|
707
|
+
if (!a.realm)
|
|
708
|
+
throw "realm missing";
|
|
709
|
+
o.authServerUrl = a.url, o.realm = a.realm, w(null), c.setSuccess();
|
|
710
|
+
}
|
|
711
|
+
}
|
|
712
|
+
return c.promise;
|
|
713
|
+
}
|
|
714
|
+
function Se(s) {
|
|
715
|
+
return s.status == 0 && s.responseText && s.responseURL.startsWith("file:");
|
|
716
|
+
}
|
|
717
|
+
function de(s, c, m, w) {
|
|
718
|
+
if (o.tokenTimeoutHandle && (clearTimeout(o.tokenTimeoutHandle), o.tokenTimeoutHandle = null), c ? (o.refreshToken = c, o.refreshTokenParsed = Ae(c)) : (delete o.refreshToken, delete o.refreshTokenParsed), m ? (o.idToken = m, o.idTokenParsed = Ae(m)) : (delete o.idToken, delete o.idTokenParsed), s) {
|
|
719
|
+
if (o.token = s, o.tokenParsed = Ae(s), o.sessionId = o.tokenParsed.session_state, o.authenticated = !0, o.subject = o.tokenParsed.sub, o.realmAccess = o.tokenParsed.realm_access, o.resourceAccess = o.tokenParsed.resource_access, w && (o.timeSkew = Math.floor(w / 1e3) - o.tokenParsed.iat), o.timeSkew != null && (H("[KEYCLOAK] Estimated time difference between browser and server is " + o.timeSkew + " seconds"), o.onTokenExpired)) {
|
|
720
|
+
var p = (o.tokenParsed.exp - (/* @__PURE__ */ new Date()).getTime() / 1e3 + o.timeSkew) * 1e3;
|
|
721
|
+
H("[KEYCLOAK] Token expires in " + Math.round(p / 1e3) + " s"), p <= 0 ? o.onTokenExpired() : o.tokenTimeoutHandle = setTimeout(o.onTokenExpired, p);
|
|
722
|
+
}
|
|
723
|
+
} else
|
|
724
|
+
delete o.token, delete o.tokenParsed, delete o.subject, delete o.realmAccess, delete o.resourceAccess, o.authenticated = !1;
|
|
725
|
+
}
|
|
726
|
+
function Ae(s) {
|
|
727
|
+
switch (s = s.split(".")[1], s = s.replace(/-/g, "+"), s = s.replace(/_/g, "/"), s.length % 4) {
|
|
728
|
+
case 0:
|
|
729
|
+
break;
|
|
730
|
+
case 2:
|
|
731
|
+
s += "==";
|
|
732
|
+
break;
|
|
733
|
+
case 3:
|
|
734
|
+
s += "=";
|
|
735
|
+
break;
|
|
736
|
+
default:
|
|
737
|
+
throw "Invalid token";
|
|
738
|
+
}
|
|
739
|
+
return s = decodeURIComponent(escape(atob(s))), s = JSON.parse(s), s;
|
|
740
|
+
}
|
|
741
|
+
function Ie() {
|
|
742
|
+
var s = "0123456789abcdef", c = B(36, s).split("");
|
|
743
|
+
c[14] = "4", c[19] = s.substr(c[19] & 3 | 8, 1), c[8] = c[13] = c[18] = c[23] = "-";
|
|
744
|
+
var m = c.join("");
|
|
745
|
+
return m;
|
|
746
|
+
}
|
|
747
|
+
function ae(s) {
|
|
748
|
+
var c = Oe(s);
|
|
749
|
+
if (c) {
|
|
750
|
+
var m = y.get(c.state);
|
|
751
|
+
return m && (c.valid = !0, c.redirectUri = m.redirectUri, c.storedNonce = m.nonce, c.prompt = m.prompt, c.pkceCodeVerifier = m.pkceCodeVerifier), c;
|
|
752
|
+
}
|
|
753
|
+
}
|
|
754
|
+
function Oe(s) {
|
|
755
|
+
var c;
|
|
756
|
+
switch (o.flow) {
|
|
757
|
+
case "standard":
|
|
758
|
+
c = ["code", "state", "session_state", "kc_action_status", "iss"];
|
|
759
|
+
break;
|
|
760
|
+
case "implicit":
|
|
761
|
+
c = ["access_token", "token_type", "id_token", "state", "session_state", "expires_in", "kc_action_status", "iss"];
|
|
762
|
+
break;
|
|
763
|
+
case "hybrid":
|
|
764
|
+
c = ["access_token", "token_type", "id_token", "code", "state", "session_state", "expires_in", "kc_action_status", "iss"];
|
|
765
|
+
break;
|
|
766
|
+
}
|
|
767
|
+
c.push("error"), c.push("error_description"), c.push("error_uri");
|
|
768
|
+
var m = s.indexOf("?"), w = s.indexOf("#"), p, C;
|
|
769
|
+
if (o.responseMode === "query" && m !== -1 ? (p = s.substring(0, m), C = Fe(s.substring(m + 1, w !== -1 ? w : s.length), c), C.paramsString !== "" && (p += "?" + C.paramsString), w !== -1 && (p += s.substring(w))) : o.responseMode === "fragment" && w !== -1 && (p = s.substring(0, w), C = Fe(s.substring(w + 1), c), C.paramsString !== "" && (p += "#" + C.paramsString)), C && C.oauthParams) {
|
|
770
|
+
if (o.flow === "standard" || o.flow === "hybrid") {
|
|
771
|
+
if ((C.oauthParams.code || C.oauthParams.error) && C.oauthParams.state)
|
|
772
|
+
return C.oauthParams.newUrl = p, C.oauthParams;
|
|
773
|
+
} else if (o.flow === "implicit" && (C.oauthParams.access_token || C.oauthParams.error) && C.oauthParams.state)
|
|
774
|
+
return C.oauthParams.newUrl = p, C.oauthParams;
|
|
775
|
+
}
|
|
776
|
+
}
|
|
777
|
+
function Fe(s, c) {
|
|
778
|
+
for (var m = s.split("&"), w = {
|
|
779
|
+
paramsString: "",
|
|
780
|
+
oauthParams: {}
|
|
781
|
+
}, p = 0; p < m.length; p++) {
|
|
782
|
+
var C = m[p].indexOf("="), b = m[p].slice(0, C);
|
|
783
|
+
c.indexOf(b) !== -1 ? w.oauthParams[b] = m[p].slice(C + 1) : (w.paramsString !== "" && (w.paramsString += "&"), w.paramsString += m[p]);
|
|
784
|
+
}
|
|
785
|
+
return w;
|
|
786
|
+
}
|
|
787
|
+
function R() {
|
|
788
|
+
var s = {
|
|
789
|
+
setSuccess: function(c) {
|
|
790
|
+
s.resolve(c);
|
|
791
|
+
},
|
|
792
|
+
setError: function(c) {
|
|
793
|
+
s.reject(c);
|
|
794
|
+
}
|
|
795
|
+
};
|
|
796
|
+
return s.promise = new Promise(function(c, m) {
|
|
797
|
+
s.resolve = c, s.reject = m;
|
|
798
|
+
}), s;
|
|
799
|
+
}
|
|
800
|
+
function u(s, c, m) {
|
|
801
|
+
var w = null, p = new Promise(function(C, b) {
|
|
802
|
+
w = setTimeout(function() {
|
|
803
|
+
b({ error: m || "Promise is not settled within timeout of " + c + "ms" });
|
|
804
|
+
}, c);
|
|
805
|
+
});
|
|
806
|
+
return Promise.race([s, p]).finally(function() {
|
|
807
|
+
clearTimeout(w);
|
|
808
|
+
});
|
|
809
|
+
}
|
|
810
|
+
function ce() {
|
|
811
|
+
var s = R();
|
|
812
|
+
if (!l.enable || l.iframe)
|
|
813
|
+
return s.setSuccess(), s.promise;
|
|
814
|
+
var c = document.createElement("iframe");
|
|
815
|
+
l.iframe = c, c.onload = function() {
|
|
816
|
+
var p = o.endpoints.authorize();
|
|
817
|
+
p.charAt(0) === "/" ? l.iframeOrigin = he() : l.iframeOrigin = p.substring(0, p.indexOf("/", 8)), s.setSuccess();
|
|
818
|
+
};
|
|
819
|
+
var m = o.endpoints.checkSessionIframe();
|
|
820
|
+
c.setAttribute("src", m), c.setAttribute("sandbox", "allow-scripts allow-same-origin"), c.setAttribute("title", "keycloak-session-iframe"), c.style.display = "none", document.body.appendChild(c);
|
|
821
|
+
var w = function(p) {
|
|
822
|
+
if (!(p.origin !== l.iframeOrigin || l.iframe.contentWindow !== p.source) && (p.data == "unchanged" || p.data == "changed" || p.data == "error")) {
|
|
823
|
+
p.data != "unchanged" && o.clearToken();
|
|
824
|
+
for (var C = l.callbackList.splice(0, l.callbackList.length), b = C.length - 1; b >= 0; --b) {
|
|
825
|
+
var v = C[b];
|
|
826
|
+
p.data == "error" ? v.setError() : v.setSuccess(p.data == "unchanged");
|
|
827
|
+
}
|
|
828
|
+
}
|
|
829
|
+
};
|
|
830
|
+
return window.addEventListener("message", w, !1), s.promise;
|
|
831
|
+
}
|
|
832
|
+
function N() {
|
|
833
|
+
l.enable && o.token && setTimeout(function() {
|
|
834
|
+
re().then(function(s) {
|
|
835
|
+
s && N();
|
|
836
|
+
});
|
|
837
|
+
}, l.interval * 1e3);
|
|
838
|
+
}
|
|
839
|
+
function re() {
|
|
840
|
+
var s = R();
|
|
841
|
+
if (l.iframe && l.iframeOrigin) {
|
|
842
|
+
var c = o.clientId + " " + (o.sessionId ? o.sessionId : "");
|
|
843
|
+
l.callbackList.push(s);
|
|
844
|
+
var m = l.iframeOrigin;
|
|
845
|
+
l.callbackList.length == 1 && l.iframe.contentWindow.postMessage(c, m);
|
|
846
|
+
} else
|
|
847
|
+
s.setSuccess();
|
|
848
|
+
return s.promise;
|
|
849
|
+
}
|
|
850
|
+
function Y() {
|
|
851
|
+
var s = R();
|
|
852
|
+
if (l.enable || o.silentCheckSsoRedirectUri) {
|
|
853
|
+
var c = document.createElement("iframe");
|
|
854
|
+
c.setAttribute("src", o.endpoints.thirdPartyCookiesIframe()), c.setAttribute("sandbox", "allow-scripts allow-same-origin"), c.setAttribute("title", "keycloak-3p-check-iframe"), c.style.display = "none", document.body.appendChild(c);
|
|
855
|
+
var m = function(w) {
|
|
856
|
+
c.contentWindow === w.source && (w.data !== "supported" && w.data !== "unsupported" || (w.data === "unsupported" && (M(
|
|
857
|
+
`[KEYCLOAK] Your browser is blocking access to 3rd-party cookies, this means:
|
|
858
|
+
|
|
859
|
+
- It is not possible to retrieve tokens without redirecting to the Keycloak server (a.k.a. no support for silent authentication).
|
|
860
|
+
- It is not possible to automatically detect changes to the session status (such as the user logging out in another tab).
|
|
861
|
+
|
|
862
|
+
For more information see: https://www.keycloak.org/docs/latest/securing_apps/#_modern_browsers`
|
|
863
|
+
), l.enable = !1, o.silentCheckSsoFallback && (o.silentCheckSsoRedirectUri = !1)), document.body.removeChild(c), window.removeEventListener("message", m), s.setSuccess()));
|
|
864
|
+
};
|
|
865
|
+
window.addEventListener("message", m, !1);
|
|
866
|
+
} else
|
|
867
|
+
s.setSuccess();
|
|
868
|
+
return u(s.promise, o.messageReceiveTimeout, "Timeout when waiting for 3rd party check iframe message.");
|
|
869
|
+
}
|
|
870
|
+
function I(s) {
|
|
871
|
+
if (!s || s == "default")
|
|
872
|
+
return {
|
|
873
|
+
login: function(b) {
|
|
874
|
+
return window.location.assign(o.createLoginUrl(b)), R().promise;
|
|
875
|
+
},
|
|
876
|
+
logout: function(b) {
|
|
877
|
+
return window.location.replace(o.createLogoutUrl(b)), R().promise;
|
|
878
|
+
},
|
|
879
|
+
register: function(b) {
|
|
880
|
+
return window.location.assign(o.createRegisterUrl(b)), R().promise;
|
|
881
|
+
},
|
|
882
|
+
accountManagement: function() {
|
|
883
|
+
var b = o.createAccountUrl();
|
|
884
|
+
if (typeof b < "u")
|
|
885
|
+
window.location.href = b;
|
|
886
|
+
else
|
|
887
|
+
throw "Not supported by the OIDC server";
|
|
888
|
+
return R().promise;
|
|
889
|
+
},
|
|
890
|
+
redirectUri: function(b, v) {
|
|
891
|
+
return b && b.redirectUri ? b.redirectUri : o.redirectUri ? o.redirectUri : location.href;
|
|
892
|
+
}
|
|
893
|
+
};
|
|
894
|
+
if (s == "cordova") {
|
|
895
|
+
l.enable = !1;
|
|
896
|
+
var c = function(b, v, S) {
|
|
897
|
+
return window.cordova && window.cordova.InAppBrowser ? window.cordova.InAppBrowser.open(b, v, S) : window.open(b, v, S);
|
|
898
|
+
}, m = function(b) {
|
|
899
|
+
return b && b.cordovaOptions ? Object.keys(b.cordovaOptions).reduce(function(v, S) {
|
|
900
|
+
return v[S] = b.cordovaOptions[S], v;
|
|
901
|
+
}, {}) : {};
|
|
902
|
+
}, w = function(b) {
|
|
903
|
+
return Object.keys(b).reduce(function(v, S) {
|
|
904
|
+
return v.push(S + "=" + b[S]), v;
|
|
905
|
+
}, []).join(",");
|
|
906
|
+
}, p = function(b) {
|
|
907
|
+
var v = m(b);
|
|
908
|
+
return v.location = "no", b && b.prompt == "none" && (v.hidden = "yes"), w(v);
|
|
909
|
+
}, C = o.redirectUri || "http://localhost";
|
|
910
|
+
return {
|
|
911
|
+
login: function(b) {
|
|
912
|
+
var v = R(), S = p(b), x = o.createLoginUrl(b), E = c(x, "_blank", S), L = !1, G = !1, ne = function() {
|
|
913
|
+
G = !0, E.close();
|
|
914
|
+
};
|
|
915
|
+
return E.addEventListener("loadstart", function(j) {
|
|
916
|
+
if (j.url.indexOf(C) == 0) {
|
|
917
|
+
var pe = ae(j.url);
|
|
918
|
+
Q(pe, v), ne(), L = !0;
|
|
919
|
+
}
|
|
920
|
+
}), E.addEventListener("loaderror", function(j) {
|
|
921
|
+
if (!L)
|
|
922
|
+
if (j.url.indexOf(C) == 0) {
|
|
923
|
+
var pe = ae(j.url);
|
|
924
|
+
Q(pe, v), ne(), L = !0;
|
|
925
|
+
} else
|
|
926
|
+
v.setError(), ne();
|
|
927
|
+
}), E.addEventListener("exit", function(j) {
|
|
928
|
+
G || v.setError({
|
|
929
|
+
reason: "closed_by_user"
|
|
930
|
+
});
|
|
931
|
+
}), v.promise;
|
|
932
|
+
},
|
|
933
|
+
logout: function(b) {
|
|
934
|
+
var v = R(), S = o.createLogoutUrl(b), x = c(S, "_blank", "location=no,hidden=yes,clearcache=yes"), E;
|
|
935
|
+
return x.addEventListener("loadstart", function(L) {
|
|
936
|
+
L.url.indexOf(C) == 0 && x.close();
|
|
937
|
+
}), x.addEventListener("loaderror", function(L) {
|
|
938
|
+
L.url.indexOf(C) == 0 || (E = !0), x.close();
|
|
939
|
+
}), x.addEventListener("exit", function(L) {
|
|
940
|
+
E ? v.setError() : (o.clearToken(), v.setSuccess());
|
|
941
|
+
}), v.promise;
|
|
942
|
+
},
|
|
943
|
+
register: function(b) {
|
|
944
|
+
var v = R(), S = o.createRegisterUrl(), x = p(b), E = c(S, "_blank", x);
|
|
945
|
+
return E.addEventListener("loadstart", function(L) {
|
|
946
|
+
if (L.url.indexOf(C) == 0) {
|
|
947
|
+
E.close();
|
|
948
|
+
var G = ae(L.url);
|
|
949
|
+
Q(G, v);
|
|
950
|
+
}
|
|
951
|
+
}), v.promise;
|
|
952
|
+
},
|
|
953
|
+
accountManagement: function() {
|
|
954
|
+
var b = o.createAccountUrl();
|
|
955
|
+
if (typeof b < "u") {
|
|
956
|
+
var v = c(b, "_blank", "location=no");
|
|
957
|
+
v.addEventListener("loadstart", function(S) {
|
|
958
|
+
S.url.indexOf(C) == 0 && v.close();
|
|
959
|
+
});
|
|
960
|
+
} else
|
|
961
|
+
throw "Not supported by the OIDC server";
|
|
962
|
+
},
|
|
963
|
+
redirectUri: function(b) {
|
|
964
|
+
return C;
|
|
965
|
+
}
|
|
966
|
+
};
|
|
967
|
+
}
|
|
968
|
+
if (s == "cordova-native")
|
|
969
|
+
return l.enable = !1, {
|
|
970
|
+
login: function(b) {
|
|
971
|
+
var v = R(), S = o.createLoginUrl(b);
|
|
972
|
+
return universalLinks.subscribe("keycloak", function(x) {
|
|
973
|
+
universalLinks.unsubscribe("keycloak"), window.cordova.plugins.browsertab.close();
|
|
974
|
+
var E = ae(x.url);
|
|
975
|
+
Q(E, v);
|
|
976
|
+
}), window.cordova.plugins.browsertab.openUrl(S), v.promise;
|
|
977
|
+
},
|
|
978
|
+
logout: function(b) {
|
|
979
|
+
var v = R(), S = o.createLogoutUrl(b);
|
|
980
|
+
return universalLinks.subscribe("keycloak", function(x) {
|
|
981
|
+
universalLinks.unsubscribe("keycloak"), window.cordova.plugins.browsertab.close(), o.clearToken(), v.setSuccess();
|
|
982
|
+
}), window.cordova.plugins.browsertab.openUrl(S), v.promise;
|
|
983
|
+
},
|
|
984
|
+
register: function(b) {
|
|
985
|
+
var v = R(), S = o.createRegisterUrl(b);
|
|
986
|
+
return universalLinks.subscribe("keycloak", function(x) {
|
|
987
|
+
universalLinks.unsubscribe("keycloak"), window.cordova.plugins.browsertab.close();
|
|
988
|
+
var E = ae(x.url);
|
|
989
|
+
Q(E, v);
|
|
990
|
+
}), window.cordova.plugins.browsertab.openUrl(S), v.promise;
|
|
991
|
+
},
|
|
992
|
+
accountManagement: function() {
|
|
993
|
+
var b = o.createAccountUrl();
|
|
994
|
+
if (typeof b < "u")
|
|
995
|
+
window.cordova.plugins.browsertab.openUrl(b);
|
|
996
|
+
else
|
|
997
|
+
throw "Not supported by the OIDC server";
|
|
998
|
+
},
|
|
999
|
+
redirectUri: function(b) {
|
|
1000
|
+
return b && b.redirectUri ? b.redirectUri : o.redirectUri ? o.redirectUri : "http://localhost";
|
|
1001
|
+
}
|
|
1002
|
+
};
|
|
1003
|
+
throw "invalid adapter type: " + s;
|
|
1004
|
+
}
|
|
1005
|
+
var le = function() {
|
|
1006
|
+
if (!(this instanceof le))
|
|
1007
|
+
return new le();
|
|
1008
|
+
localStorage.setItem("kc-test", "test"), localStorage.removeItem("kc-test");
|
|
1009
|
+
var s = this;
|
|
1010
|
+
function c() {
|
|
1011
|
+
for (var m = (/* @__PURE__ */ new Date()).getTime(), w = 0; w < localStorage.length; w++) {
|
|
1012
|
+
var p = localStorage.key(w);
|
|
1013
|
+
if (p && p.indexOf("kc-callback-") == 0) {
|
|
1014
|
+
var C = localStorage.getItem(p);
|
|
1015
|
+
if (C)
|
|
1016
|
+
try {
|
|
1017
|
+
var b = JSON.parse(C).expires;
|
|
1018
|
+
(!b || b < m) && localStorage.removeItem(p);
|
|
1019
|
+
} catch {
|
|
1020
|
+
localStorage.removeItem(p);
|
|
1021
|
+
}
|
|
1022
|
+
}
|
|
1023
|
+
}
|
|
1024
|
+
}
|
|
1025
|
+
s.get = function(m) {
|
|
1026
|
+
if (m) {
|
|
1027
|
+
var w = "kc-callback-" + m, p = localStorage.getItem(w);
|
|
1028
|
+
return p && (localStorage.removeItem(w), p = JSON.parse(p)), c(), p;
|
|
1029
|
+
}
|
|
1030
|
+
}, s.add = function(m) {
|
|
1031
|
+
c();
|
|
1032
|
+
var w = "kc-callback-" + m.state;
|
|
1033
|
+
m.expires = (/* @__PURE__ */ new Date()).getTime() + 60 * 60 * 1e3, localStorage.setItem(w, JSON.stringify(m));
|
|
1034
|
+
};
|
|
1035
|
+
}, be = function() {
|
|
1036
|
+
if (!(this instanceof be))
|
|
1037
|
+
return new be();
|
|
1038
|
+
var s = this;
|
|
1039
|
+
s.get = function(p) {
|
|
1040
|
+
if (p) {
|
|
1041
|
+
var C = m("kc-callback-" + p);
|
|
1042
|
+
if (w("kc-callback-" + p, "", c(-100)), C)
|
|
1043
|
+
return JSON.parse(C);
|
|
1044
|
+
}
|
|
1045
|
+
}, s.add = function(p) {
|
|
1046
|
+
w("kc-callback-" + p.state, JSON.stringify(p), c(60));
|
|
1047
|
+
}, s.removeItem = function(p) {
|
|
1048
|
+
w(p, "", c(-100));
|
|
1049
|
+
};
|
|
1050
|
+
var c = function(p) {
|
|
1051
|
+
var C = /* @__PURE__ */ new Date();
|
|
1052
|
+
return C.setTime(C.getTime() + p * 60 * 1e3), C;
|
|
1053
|
+
}, m = function(p) {
|
|
1054
|
+
for (var C = p + "=", b = document.cookie.split(";"), v = 0; v < b.length; v++) {
|
|
1055
|
+
for (var S = b[v]; S.charAt(0) == " "; )
|
|
1056
|
+
S = S.substring(1);
|
|
1057
|
+
if (S.indexOf(C) == 0)
|
|
1058
|
+
return S.substring(C.length, S.length);
|
|
1059
|
+
}
|
|
1060
|
+
return "";
|
|
1061
|
+
}, w = function(p, C, b) {
|
|
1062
|
+
var v = p + "=" + C + "; expires=" + b.toUTCString() + "; ";
|
|
1063
|
+
document.cookie = v;
|
|
1064
|
+
};
|
|
1065
|
+
};
|
|
1066
|
+
function ve() {
|
|
1067
|
+
try {
|
|
1068
|
+
return new le();
|
|
1069
|
+
} catch {
|
|
1070
|
+
}
|
|
1071
|
+
return new be();
|
|
1072
|
+
}
|
|
1073
|
+
function _e(s) {
|
|
1074
|
+
return function() {
|
|
1075
|
+
o.enableLogging && s.apply(console, Array.prototype.slice.call(arguments));
|
|
1076
|
+
};
|
|
1077
|
+
}
|
|
1078
|
+
}
|
|
1079
|
+
const keycloakInstance = new Keycloak(), Login = (a, o) => {
|
|
1080
|
+
keycloakInstance.init({ onLoad: "login-required" }).then(async (d) => {
|
|
1081
|
+
d && await FetchUserInfo(), a();
|
|
1082
|
+
}).catch((d) => {
|
|
1083
|
+
o(d);
|
|
1084
|
+
});
|
|
1085
|
+
}, FetchUserInfo = async () => {
|
|
1086
|
+
const a = await keycloakInstance.loadUserInfo();
|
|
1087
|
+
AuthService.User.email = a.email ?? "", AuthService.User.emailVerified = a.email_verified === !0, AuthService.User.firstName = a.given_name ?? "", AuthService.User.lastName = a.family_name ?? "", AuthService.User.name = a.name ?? "", AuthService.User.sub = a.sub ?? "", AuthService.User.username = a.preferred_username ?? "", AuthService.User.roles = [...a.role ?? []], AuthService.User.groups = [...a.group ?? []], AuthService.User.IsInRole = (o) => AuthService.User.roles.includes(o);
|
|
1088
|
+
}, Logout = () => {
|
|
1089
|
+
keycloakInstance.logout({
|
|
1090
|
+
redirectUri: location.origin
|
|
1091
|
+
}).then(() => {
|
|
1092
|
+
sessionStorage.removeItem("user-info");
|
|
1093
|
+
});
|
|
1094
|
+
}, AuthService = {
|
|
1095
|
+
Instance: keycloakInstance,
|
|
1096
|
+
User: {},
|
|
1097
|
+
CallLogin: Login,
|
|
1098
|
+
CallLogout: Logout
|
|
1099
|
+
};
|
|
1100
|
+
class NavMenuService {
|
|
1101
|
+
constructor() {
|
|
1102
|
+
Ze(this, "_visible", ref(!1));
|
|
1103
|
+
}
|
|
1104
|
+
get IsVisible() {
|
|
1105
|
+
return this._visible.value === !0;
|
|
1106
|
+
}
|
|
1107
|
+
Toggle() {
|
|
1108
|
+
this._visible.value = !this._visible.value;
|
|
1109
|
+
}
|
|
1110
|
+
Close() {
|
|
1111
|
+
this._visible.value = !1;
|
|
1112
|
+
}
|
|
1113
|
+
Open() {
|
|
1114
|
+
this._visible.value = !0;
|
|
1115
|
+
}
|
|
1116
|
+
}
|
|
1117
|
+
const LkNavMenuService = new NavMenuService(), UseNavMenuService = () => LkNavMenuService;
|
|
1118
|
+
var Cor = /* @__PURE__ */ ((a) => (a.Primary = "primary", a.Secondary = "secondary", a.Info = "info", a.Success = "success", a.Help = "help", a.Warn = "warn", a.Error = "error", a))(Cor || {}), Tamanho = /* @__PURE__ */ ((a) => (a.Pequeno = "sm", a.Medio = "md", a.Grande = "lg", a))(Tamanho || {});
|
|
1119
|
+
const _export_sfc = (a, o) => {
|
|
1120
|
+
const d = a.__vccOpts || a;
|
|
1121
|
+
for (const [f, y] of o)
|
|
1122
|
+
d[f] = y;
|
|
1123
|
+
return d;
|
|
1124
|
+
}, _sfc_main$8 = {}, _hoisted_1$6 = { class: "sf-loading-circle" }, _hoisted_2$6 = /* @__PURE__ */ createElementVNode("div", null, [
|
|
1125
|
+
/* @__PURE__ */ createElementVNode("svg", { viewBox: "25 25 50 50" }, [
|
|
1126
|
+
/* @__PURE__ */ createElementVNode("circle", {
|
|
1127
|
+
cx: "50",
|
|
1128
|
+
cy: "50",
|
|
1129
|
+
r: "20",
|
|
1130
|
+
fill: "none",
|
|
1131
|
+
"stroke-width": "4",
|
|
1132
|
+
"stroke-miterlimit": "10"
|
|
1133
|
+
})
|
|
1134
|
+
])
|
|
1135
|
+
], -1), _hoisted_3$3 = [
|
|
1136
|
+
_hoisted_2$6
|
|
1137
|
+
];
|
|
1138
|
+
function _sfc_render$2(a, o) {
|
|
1139
|
+
return openBlock(), createElementBlock("div", _hoisted_1$6, _hoisted_3$3);
|
|
1140
|
+
}
|
|
1141
|
+
const LoadingCircle = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["render", _sfc_render$2]]);
|
|
1142
|
+
class CssClassBuilder {
|
|
1143
|
+
/**
|
|
1144
|
+
* Creates a new instance of the CssClassBuilder class.
|
|
1145
|
+
* @param value The initial value of the CSS class string.
|
|
1146
|
+
*/
|
|
1147
|
+
constructor(o) {
|
|
1148
|
+
Ze(this, "retorno");
|
|
1149
|
+
this.retorno = o ?? "";
|
|
1150
|
+
}
|
|
1151
|
+
/**
|
|
1152
|
+
* Concatenates a new CSS class to the existing string.
|
|
1153
|
+
* @param value The CSS class to concatenate.
|
|
1154
|
+
* @returns The current instance of the CssClassBuilder class.
|
|
1155
|
+
*/
|
|
1156
|
+
Concat(o) {
|
|
1157
|
+
return o && o.trim().length && (this.retorno += ` ${o}`), this;
|
|
1158
|
+
}
|
|
1159
|
+
/**
|
|
1160
|
+
* Adds a new CSS class to the string if the specified condition is true.
|
|
1161
|
+
* @param value The CSS class to add.
|
|
1162
|
+
* @param when The condition that determines whether to add the CSS class.
|
|
1163
|
+
* @returns The current instance of the CssClassBuilder class.
|
|
1164
|
+
*/
|
|
1165
|
+
AddClass(o, d = !0) {
|
|
1166
|
+
return d ? this.Concat(o) : this;
|
|
1167
|
+
}
|
|
1168
|
+
/**
|
|
1169
|
+
* Builds the final CSS class string.
|
|
1170
|
+
* @returns The final CSS class string.
|
|
1171
|
+
*/
|
|
1172
|
+
Build() {
|
|
1173
|
+
return this.retorno.trim();
|
|
1174
|
+
}
|
|
1175
|
+
}
|
|
1176
|
+
const _hoisted_1$5 = ["disabled", "tabindex"], _hoisted_2$5 = ["data-color"], _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
1177
|
+
__name: "Icon",
|
|
1178
|
+
props: {
|
|
1179
|
+
icone: {},
|
|
1180
|
+
visible: { type: Boolean, default: !0 },
|
|
1181
|
+
class: { default: "" },
|
|
1182
|
+
style: { default: "" },
|
|
1183
|
+
disabled: { type: Boolean },
|
|
1184
|
+
loading: { type: Boolean },
|
|
1185
|
+
button: { type: Boolean },
|
|
1186
|
+
tamanho: { default: Tamanho.Medio },
|
|
1187
|
+
dot: { type: Boolean },
|
|
1188
|
+
dotColor: { default: Cor.Error },
|
|
1189
|
+
buttonProps: {}
|
|
1190
|
+
},
|
|
1191
|
+
setup(a) {
|
|
1192
|
+
const o = a;
|
|
1193
|
+
function d() {
|
|
1194
|
+
return new CssClassBuilder(`${o.class} sf-icon`).AddClass("sf-component-loading", o.loading).AddClass("sf-component-disabled", o.disabled).AddClass("sf-icon-button", o.button).AddClass("sf-icon-small", o.tamanho === Tamanho.Pequeno).AddClass("sf-icon-medium", o.tamanho === Tamanho.Medio).AddClass("sf-icon-large", o.tamanho === Tamanho.Grande).AddClass("sf-ripple", o.button === !0).Build();
|
|
1195
|
+
}
|
|
1196
|
+
return (f, y) => (openBlock(), createElementBlock("div", {
|
|
1197
|
+
style: normalizeStyle(o.style),
|
|
1198
|
+
class: normalizeClass(d())
|
|
1199
|
+
}, [
|
|
1200
|
+
createElementVNode("button", mergeProps({
|
|
1201
|
+
class: "material-symbols-outlined",
|
|
1202
|
+
disabled: o.disabled || o.loading
|
|
1203
|
+
}, o.buttonProps, {
|
|
1204
|
+
tabindex: o.button ? void 0 : -1
|
|
1205
|
+
}), [
|
|
1206
|
+
o.loading ? (openBlock(), createBlock(LoadingCircle, { key: 0 })) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
1207
|
+
createTextVNode(toDisplayString(o.icone), 1)
|
|
1208
|
+
], 64))
|
|
1209
|
+
], 16, _hoisted_1$5),
|
|
1210
|
+
o.dot ? (openBlock(), createElementBlock("span", {
|
|
1211
|
+
key: 0,
|
|
1212
|
+
"data-color": o.dotColor
|
|
1213
|
+
}, null, 8, _hoisted_2$5)) : createCommentVNode("", !0)
|
|
1214
|
+
], 6));
|
|
1215
|
+
}
|
|
1216
|
+
}), _sfc_main$6 = {}, _hoisted_1$4 = { class: "sf-internal-icon-button sf-ripple" }, _hoisted_2$4 = /* @__PURE__ */ createElementVNode("svg", {
|
|
1217
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1218
|
+
height: "48",
|
|
1219
|
+
viewBox: "0 -960 960 960",
|
|
1220
|
+
width: "48"
|
|
1221
|
+
}, [
|
|
1222
|
+
/* @__PURE__ */ createElementVNode("path", { d: "M194.694-124.001q-28.254 0-49.473-21.22-21.22-21.219-21.22-49.473v-570.612q0-28.254 21.22-49.473 21.219-21.22 49.473-21.22h285.075v58.384H194.694q-4.616 0-8.463 3.846-3.846 3.847-3.846 8.463v570.612q0 4.616 3.846 8.463 3.847 3.846 8.463 3.846h285.075v58.384H194.694Zm469.614-183.693-42.999-42.23 101.384-101.384H360.846v-58.384h360.616L620.078-611.076l42.615-41.615 173.306 173.499-171.691 171.498Z" })
|
|
1223
|
+
], -1), _hoisted_3$2 = [
|
|
1224
|
+
_hoisted_2$4
|
|
1225
|
+
];
|
|
1226
|
+
function _sfc_render$1(a, o) {
|
|
1227
|
+
return openBlock(), createElementBlock("button", _hoisted_1$4, _hoisted_3$2);
|
|
1228
|
+
}
|
|
1229
|
+
const LogoutIcon = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["render", _sfc_render$1]]), _sfc_main$5 = {}, _hoisted_1$3 = {
|
|
1230
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1231
|
+
height: "48",
|
|
1232
|
+
viewBox: "0 -960 960 960",
|
|
1233
|
+
width: "48",
|
|
1234
|
+
class: "sf-svg-icon"
|
|
1235
|
+
}, _hoisted_2$3 = /* @__PURE__ */ createElementVNode("path", { d: "m307.231-83.463-54.999-55.23 343.923-343.922-343.923-343.539 54.999-54.614 398.153 398.153L307.231-83.462Z" }, null, -1), _hoisted_3$1 = [
|
|
1236
|
+
_hoisted_2$3
|
|
1237
|
+
];
|
|
1238
|
+
function _sfc_render(a, o) {
|
|
1239
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$3, _hoisted_3$1);
|
|
1240
|
+
}
|
|
1241
|
+
const MenuIcon = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["render", _sfc_render]]);
|
|
1242
|
+
class ThemeToggle {
|
|
1243
|
+
get storedTheme() {
|
|
1244
|
+
return localStorage.getItem("lkVueTheme");
|
|
1245
|
+
}
|
|
1246
|
+
get IsDark() {
|
|
1247
|
+
return document.documentElement.classList.contains("dark");
|
|
1248
|
+
}
|
|
1249
|
+
Toggle() {
|
|
1250
|
+
this.IsDark ? this.EnableLightMode() : this.EnableDarkMode();
|
|
1251
|
+
}
|
|
1252
|
+
EnableDarkMode() {
|
|
1253
|
+
document.documentElement.classList.add("dark"), document.documentElement.classList.remove("light"), localStorage.setItem("lkVueTheme", "dark");
|
|
1254
|
+
}
|
|
1255
|
+
EnableLightMode() {
|
|
1256
|
+
document.documentElement.classList.remove("dark"), document.documentElement.classList.add("light"), localStorage.setItem("lkVueTheme", "light");
|
|
1257
|
+
}
|
|
1258
|
+
SetInitialTheme() {
|
|
1259
|
+
if (this.storedTheme === "light")
|
|
1260
|
+
return this.EnableLightMode();
|
|
1261
|
+
if (this.storedTheme === "dark")
|
|
1262
|
+
return this.EnableDarkMode();
|
|
1263
|
+
if (window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches)
|
|
1264
|
+
return this.EnableDarkMode();
|
|
1265
|
+
this.EnableLightMode();
|
|
1266
|
+
}
|
|
1267
|
+
}
|
|
1268
|
+
const ThemeToggleBase = (() => new ThemeToggle())(), _hoisted_1$2 = /* @__PURE__ */ createStaticVNode('<svg xmlns="http://www.w3.org/2000/svg" width="472.39" height="472.39" viewBox="0 0 472.39 472.39"><g class="toggle-sun"><path d="M403.21,167V69.18H305.38L236.2,0,167,69.18H69.18V167L0,236.2l69.18,69.18v97.83H167l69.18,69.18,69.18-69.18h97.83V305.38l69.18-69.18Zm-167,198.17a129,129,0,1,1,129-129A129,129,0,0,1,236.2,365.19Z"></path></g><g class="toggle-circle"><circle class="cls-1" cx="236.2" cy="236.2" r="103.78"></circle></g></svg>', 1), _hoisted_2$2 = [
|
|
1269
|
+
_hoisted_1$2
|
|
1270
|
+
], _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
1271
|
+
__name: "ThemeToggle",
|
|
1272
|
+
setup(a) {
|
|
1273
|
+
return (o, d) => (openBlock(), createElementBlock("button", {
|
|
1274
|
+
id: "sf-theme-toggle",
|
|
1275
|
+
onClick: d[0] || (d[0] = //@ts-ignore
|
|
1276
|
+
(...f) => unref(ThemeToggleBase).Toggle && unref(ThemeToggleBase).Toggle(...f))
|
|
1277
|
+
}, _hoisted_2$2));
|
|
1278
|
+
}
|
|
1279
|
+
}), _hoisted_1$1 = { id: "sf-layout" }, _hoisted_2$1 = /* @__PURE__ */ createElementVNode("div", { class: "sf-layout-menu-toggler-logo" }, null, -1), _hoisted_3 = { class: "title" }, _hoisted_4 = { class: "sf-layout-nav-header" }, _hoisted_5 = /* @__PURE__ */ createElementVNode("span", null, "Menu", -1), _hoisted_6 = { class: "sf-layout-nav-content" }, _hoisted_7 = /* @__PURE__ */ createElementVNode("section", { id: "sf-layout-page-title" }, null, -1), _hoisted_8 = { id: "sf-layout-content" }, _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
1280
|
+
__name: "Layout",
|
|
1281
|
+
setup(a) {
|
|
1282
|
+
const o = UseNavMenuService(), d = UseDialogService();
|
|
1283
|
+
async function f() {
|
|
1284
|
+
await d.ConfirmAsync({
|
|
1285
|
+
message: "Você deseja sair da sua conta?",
|
|
1286
|
+
confirmLabel: "sair"
|
|
1287
|
+
}) && AuthService.CallLogout();
|
|
1288
|
+
}
|
|
1289
|
+
return (y, l) => (openBlock(), createElementBlock("div", _hoisted_1$1, [
|
|
1290
|
+
createElementVNode("header", null, [
|
|
1291
|
+
createElementVNode("div", {
|
|
1292
|
+
class: normalizeClass([
|
|
1293
|
+
"sf-layout-menu-toggler",
|
|
1294
|
+
{ invert: unref(o).IsVisible }
|
|
1295
|
+
]),
|
|
1296
|
+
onClick: l[0] || (l[0] = (k) => unref(o).Toggle())
|
|
1297
|
+
}, [
|
|
1298
|
+
_hoisted_2$1,
|
|
1299
|
+
createVNode(MenuIcon)
|
|
1300
|
+
], 2),
|
|
1301
|
+
createElementVNode("div", _hoisted_3, [
|
|
1302
|
+
renderSlot(y.$slots, "title")
|
|
1303
|
+
]),
|
|
1304
|
+
renderSlot(y.$slots, "action"),
|
|
1305
|
+
createVNode(_sfc_main$4),
|
|
1306
|
+
createVNode(LogoutIcon, { onClick: f })
|
|
1307
|
+
]),
|
|
1308
|
+
createElementVNode("nav", {
|
|
1309
|
+
class: normalizeClass({ visible: unref(o).IsVisible })
|
|
1310
|
+
}, [
|
|
1311
|
+
createElementVNode("div", _hoisted_4, [
|
|
1312
|
+
_hoisted_5,
|
|
1313
|
+
createVNode(_sfc_main$7, {
|
|
1314
|
+
icone: "close",
|
|
1315
|
+
button: "",
|
|
1316
|
+
onClick: l[1] || (l[1] = (k) => unref(o).Close())
|
|
1317
|
+
})
|
|
1318
|
+
]),
|
|
1319
|
+
createElementVNode("div", _hoisted_6, [
|
|
1320
|
+
renderSlot(y.$slots, "menu")
|
|
1321
|
+
])
|
|
1322
|
+
], 2),
|
|
1323
|
+
createElementVNode("main", {
|
|
1324
|
+
class: normalizeClass({ "menu-visible": unref(o).IsVisible })
|
|
1325
|
+
}, [
|
|
1326
|
+
_hoisted_7,
|
|
1327
|
+
createElementVNode("section", _hoisted_8, [
|
|
1328
|
+
renderSlot(y.$slots, "content")
|
|
1329
|
+
])
|
|
1330
|
+
], 2)
|
|
1331
|
+
]));
|
|
1332
|
+
}
|
|
1333
|
+
}), _hoisted_1 = ["href", "data-active", "onClick"], _hoisted_2 = { class: "sf-navmenulink-text" }, _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
1334
|
+
__name: "NavMenuLink",
|
|
1335
|
+
props: {
|
|
1336
|
+
href: {},
|
|
1337
|
+
text: {},
|
|
1338
|
+
icon: {}
|
|
1339
|
+
},
|
|
1340
|
+
setup(a) {
|
|
1341
|
+
const o = a, d = UseNavMenuService();
|
|
1342
|
+
function f(y, l) {
|
|
1343
|
+
y.preventDefault();
|
|
1344
|
+
const g = y.target.closest(".sf-layout-nav-content");
|
|
1345
|
+
l(), g && g.clientWidth + 10 > document.body.clientWidth && d.Close();
|
|
1346
|
+
}
|
|
1347
|
+
return (y, l) => {
|
|
1348
|
+
const k = resolveComponent("router-link");
|
|
1349
|
+
return openBlock(), createBlock(k, {
|
|
1350
|
+
to: o.href,
|
|
1351
|
+
custom: ""
|
|
1352
|
+
}, {
|
|
1353
|
+
default: withCtx(({ href: g, navigate: _, isExactActive: H }) => [
|
|
1354
|
+
createElementVNode("a", {
|
|
1355
|
+
class: "sf-navmenulink",
|
|
1356
|
+
href: g,
|
|
1357
|
+
"data-active": H,
|
|
1358
|
+
onClick: (M) => f(M, _)
|
|
1359
|
+
}, [
|
|
1360
|
+
o.icon ? (openBlock(), createBlock(_sfc_main$7, {
|
|
1361
|
+
key: 0,
|
|
1362
|
+
icone: o.icon,
|
|
1363
|
+
"button-props": { tabindex: -1 }
|
|
1364
|
+
}, null, 8, ["icone"])) : createCommentVNode("", !0),
|
|
1365
|
+
createElementVNode("span", _hoisted_2, toDisplayString(o.text), 1)
|
|
1366
|
+
], 8, _hoisted_1)
|
|
1367
|
+
]),
|
|
1368
|
+
_: 1
|
|
1369
|
+
}, 8, ["to"]);
|
|
1370
|
+
};
|
|
1371
|
+
}
|
|
1372
|
+
}), _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
1373
|
+
__name: "ScrollToTop",
|
|
1374
|
+
setup(a) {
|
|
1375
|
+
const o = ref(!1), d = `--${+/* @__PURE__ */ new Date()}`;
|
|
1376
|
+
let f = null;
|
|
1377
|
+
function y() {
|
|
1378
|
+
f == null || f.scrollTo(0, 0);
|
|
1379
|
+
}
|
|
1380
|
+
return onMounted(() => {
|
|
1381
|
+
var l;
|
|
1382
|
+
f = ((l = document.getElementById(d)) == null ? void 0 : l.parentElement) ?? null, f && f.addEventListener("scroll", function() {
|
|
1383
|
+
o.value = this.scrollTop - this.clientHeight > 0;
|
|
1384
|
+
});
|
|
1385
|
+
}), (l, k) => (openBlock(), createElementBlock("button", {
|
|
1386
|
+
id: d,
|
|
1387
|
+
class: normalizeClass(["sf-scrollToTop", { "sf-scrollToTop-visible": o.value }]),
|
|
1388
|
+
onClick: y
|
|
1389
|
+
}, null, 2));
|
|
1390
|
+
}
|
|
1391
|
+
}), _sfc_main = /* @__PURE__ */ defineComponent({
|
|
1392
|
+
__name: "Content",
|
|
1393
|
+
props: {
|
|
1394
|
+
class: {},
|
|
1395
|
+
style: {},
|
|
1396
|
+
disableBodyPadding: { type: Boolean },
|
|
1397
|
+
disableHeaderPadding: { type: Boolean },
|
|
1398
|
+
disableFooterPadding: { type: Boolean }
|
|
1399
|
+
},
|
|
1400
|
+
setup(a) {
|
|
1401
|
+
const o = a;
|
|
1402
|
+
function d() {
|
|
1403
|
+
return new CssClassBuilder("sf-content").AddClass(o.class, !!o.class).Build();
|
|
1404
|
+
}
|
|
1405
|
+
function f() {
|
|
1406
|
+
return new CssClassBuilder("sf-content-body").AddClass("sf-content-no-padding", o.disableBodyPadding).Build();
|
|
1407
|
+
}
|
|
1408
|
+
function y() {
|
|
1409
|
+
return new CssClassBuilder("sf-content-header").AddClass("sf-content-no-padding", o.disableHeaderPadding).Build();
|
|
1410
|
+
}
|
|
1411
|
+
function l() {
|
|
1412
|
+
return new CssClassBuilder("sf-content-footer").AddClass("sf-content-no-padding", o.disableFooterPadding).Build();
|
|
1413
|
+
}
|
|
1414
|
+
return (k, g) => (openBlock(), createElementBlock("div", {
|
|
1415
|
+
class: normalizeClass(d()),
|
|
1416
|
+
style: normalizeStyle(o.style)
|
|
1417
|
+
}, [
|
|
1418
|
+
createElementVNode("div", {
|
|
1419
|
+
class: normalizeClass(y())
|
|
1420
|
+
}, [
|
|
1421
|
+
renderSlot(k.$slots, "header")
|
|
1422
|
+
], 2),
|
|
1423
|
+
createElementVNode("div", {
|
|
1424
|
+
class: normalizeClass(f())
|
|
1425
|
+
}, [
|
|
1426
|
+
renderSlot(k.$slots, "default"),
|
|
1427
|
+
createVNode(_sfc_main$1)
|
|
1428
|
+
], 2),
|
|
1429
|
+
createElementVNode("div", {
|
|
1430
|
+
class: normalizeClass(l())
|
|
1431
|
+
}, [
|
|
1432
|
+
renderSlot(k.$slots, "footer")
|
|
1433
|
+
], 2)
|
|
1434
|
+
], 6));
|
|
1435
|
+
}
|
|
1436
|
+
});
|
|
1437
|
+
var sweetalert2 = { exports: {} };
|
|
1438
|
+
/*!
|
|
1439
|
+
* sweetalert2 v11.4.8
|
|
1440
|
+
* Released under the MIT License.
|
|
1441
|
+
*/
|
|
1442
|
+
(function(a, o) {
|
|
1443
|
+
(function(d, f) {
|
|
1444
|
+
a.exports = f();
|
|
1445
|
+
})(commonjsGlobal, function() {
|
|
1446
|
+
const d = "SweetAlert2:", f = (e) => {
|
|
1447
|
+
const t = [];
|
|
1448
|
+
for (let n = 0; n < e.length; n++)
|
|
1449
|
+
t.indexOf(e[n]) === -1 && t.push(e[n]);
|
|
1450
|
+
return t;
|
|
1451
|
+
}, y = (e) => e.charAt(0).toUpperCase() + e.slice(1), l = (e) => Array.prototype.slice.call(e), k = (e) => {
|
|
1452
|
+
console.warn("".concat(d, " ").concat(typeof e == "object" ? e.join(" ") : e));
|
|
1453
|
+
}, g = (e) => {
|
|
1454
|
+
console.error("".concat(d, " ").concat(e));
|
|
1455
|
+
}, _ = [], H = (e) => {
|
|
1456
|
+
_.includes(e) || (_.push(e), k(e));
|
|
1457
|
+
}, M = (e, t) => {
|
|
1458
|
+
H('"'.concat(e, '" is deprecated and will be removed in the next major release. Please use "').concat(t, '" instead.'));
|
|
1459
|
+
}, O = (e) => typeof e == "function" ? e() : e, W = (e) => e && typeof e.toPromise == "function", B = (e) => W(e) ? e.toPromise() : Promise.resolve(e), J = (e) => e && Promise.resolve(e) === e, V = {
|
|
1460
|
+
title: "",
|
|
1461
|
+
titleText: "",
|
|
1462
|
+
text: "",
|
|
1463
|
+
html: "",
|
|
1464
|
+
footer: "",
|
|
1465
|
+
icon: void 0,
|
|
1466
|
+
iconColor: void 0,
|
|
1467
|
+
iconHtml: void 0,
|
|
1468
|
+
template: void 0,
|
|
1469
|
+
toast: !1,
|
|
1470
|
+
showClass: {
|
|
1471
|
+
popup: "swal2-show",
|
|
1472
|
+
backdrop: "swal2-backdrop-show",
|
|
1473
|
+
icon: "swal2-icon-show"
|
|
1474
|
+
},
|
|
1475
|
+
hideClass: {
|
|
1476
|
+
popup: "swal2-hide",
|
|
1477
|
+
backdrop: "swal2-backdrop-hide",
|
|
1478
|
+
icon: "swal2-icon-hide"
|
|
1479
|
+
},
|
|
1480
|
+
customClass: {},
|
|
1481
|
+
target: "body",
|
|
1482
|
+
color: void 0,
|
|
1483
|
+
backdrop: !0,
|
|
1484
|
+
heightAuto: !0,
|
|
1485
|
+
allowOutsideClick: !0,
|
|
1486
|
+
allowEscapeKey: !0,
|
|
1487
|
+
allowEnterKey: !0,
|
|
1488
|
+
stopKeydownPropagation: !0,
|
|
1489
|
+
keydownListenerCapture: !1,
|
|
1490
|
+
showConfirmButton: !0,
|
|
1491
|
+
showDenyButton: !1,
|
|
1492
|
+
showCancelButton: !1,
|
|
1493
|
+
preConfirm: void 0,
|
|
1494
|
+
preDeny: void 0,
|
|
1495
|
+
confirmButtonText: "OK",
|
|
1496
|
+
confirmButtonAriaLabel: "",
|
|
1497
|
+
confirmButtonColor: void 0,
|
|
1498
|
+
denyButtonText: "No",
|
|
1499
|
+
denyButtonAriaLabel: "",
|
|
1500
|
+
denyButtonColor: void 0,
|
|
1501
|
+
cancelButtonText: "Cancel",
|
|
1502
|
+
cancelButtonAriaLabel: "",
|
|
1503
|
+
cancelButtonColor: void 0,
|
|
1504
|
+
buttonsStyling: !0,
|
|
1505
|
+
reverseButtons: !1,
|
|
1506
|
+
focusConfirm: !0,
|
|
1507
|
+
focusDeny: !1,
|
|
1508
|
+
focusCancel: !1,
|
|
1509
|
+
returnFocus: !0,
|
|
1510
|
+
showCloseButton: !1,
|
|
1511
|
+
closeButtonHtml: "×",
|
|
1512
|
+
closeButtonAriaLabel: "Close this dialog",
|
|
1513
|
+
loaderHtml: "",
|
|
1514
|
+
showLoaderOnConfirm: !1,
|
|
1515
|
+
showLoaderOnDeny: !1,
|
|
1516
|
+
imageUrl: void 0,
|
|
1517
|
+
imageWidth: void 0,
|
|
1518
|
+
imageHeight: void 0,
|
|
1519
|
+
imageAlt: "",
|
|
1520
|
+
timer: void 0,
|
|
1521
|
+
timerProgressBar: !1,
|
|
1522
|
+
width: void 0,
|
|
1523
|
+
padding: void 0,
|
|
1524
|
+
background: void 0,
|
|
1525
|
+
input: void 0,
|
|
1526
|
+
inputPlaceholder: "",
|
|
1527
|
+
inputLabel: "",
|
|
1528
|
+
inputValue: "",
|
|
1529
|
+
inputOptions: {},
|
|
1530
|
+
inputAutoTrim: !0,
|
|
1531
|
+
inputAttributes: {},
|
|
1532
|
+
inputValidator: void 0,
|
|
1533
|
+
returnInputValueOnDeny: !1,
|
|
1534
|
+
validationMessage: void 0,
|
|
1535
|
+
grow: !1,
|
|
1536
|
+
position: "center",
|
|
1537
|
+
progressSteps: [],
|
|
1538
|
+
currentProgressStep: void 0,
|
|
1539
|
+
progressStepsDistance: void 0,
|
|
1540
|
+
willOpen: void 0,
|
|
1541
|
+
didOpen: void 0,
|
|
1542
|
+
didRender: void 0,
|
|
1543
|
+
willClose: void 0,
|
|
1544
|
+
didClose: void 0,
|
|
1545
|
+
didDestroy: void 0,
|
|
1546
|
+
scrollbarPadding: !0
|
|
1547
|
+
}, D = ["allowEscapeKey", "allowOutsideClick", "background", "buttonsStyling", "cancelButtonAriaLabel", "cancelButtonColor", "cancelButtonText", "closeButtonAriaLabel", "closeButtonHtml", "color", "confirmButtonAriaLabel", "confirmButtonColor", "confirmButtonText", "currentProgressStep", "customClass", "denyButtonAriaLabel", "denyButtonColor", "denyButtonText", "didClose", "didDestroy", "footer", "hideClass", "html", "icon", "iconColor", "iconHtml", "imageAlt", "imageHeight", "imageUrl", "imageWidth", "preConfirm", "preDeny", "progressSteps", "returnFocus", "reverseButtons", "showCancelButton", "showCloseButton", "showConfirmButton", "showDenyButton", "text", "title", "titleText", "willClose"], he = {}, Q = ["allowOutsideClick", "allowEnterKey", "backdrop", "focusConfirm", "focusDeny", "focusCancel", "returnFocus", "heightAuto", "keydownListenerCapture"], ie = (e) => Object.prototype.hasOwnProperty.call(V, e), Se = (e) => D.indexOf(e) !== -1, de = (e) => he[e], Ae = (e) => {
|
|
1548
|
+
ie(e) || k('Unknown parameter "'.concat(e, '"'));
|
|
1549
|
+
}, Ie = (e) => {
|
|
1550
|
+
Q.includes(e) && k('The parameter "'.concat(e, '" is incompatible with toasts'));
|
|
1551
|
+
}, ae = (e) => {
|
|
1552
|
+
de(e) && M(e, de(e));
|
|
1553
|
+
}, Oe = (e) => {
|
|
1554
|
+
!e.backdrop && e.allowOutsideClick && k('"allowOutsideClick" parameter requires `backdrop` parameter to be set to `true`');
|
|
1555
|
+
for (const t in e)
|
|
1556
|
+
Ae(t), e.toast && Ie(t), ae(t);
|
|
1557
|
+
}, Fe = "swal2-", R = (e) => {
|
|
1558
|
+
const t = {};
|
|
1559
|
+
for (const n in e)
|
|
1560
|
+
t[e[n]] = Fe + e[n];
|
|
1561
|
+
return t;
|
|
1562
|
+
}, u = R(["container", "shown", "height-auto", "iosfix", "popup", "modal", "no-backdrop", "no-transition", "toast", "toast-shown", "show", "hide", "close", "title", "html-container", "actions", "confirm", "deny", "cancel", "default-outline", "footer", "icon", "icon-content", "image", "input", "file", "range", "select", "radio", "checkbox", "label", "textarea", "inputerror", "input-label", "validation-message", "progress-steps", "active-progress-step", "progress-step", "progress-step-line", "loader", "loading", "styled", "top", "top-start", "top-end", "top-left", "top-right", "center", "center-start", "center-end", "center-left", "center-right", "bottom", "bottom-start", "bottom-end", "bottom-left", "bottom-right", "grow-row", "grow-column", "grow-fullscreen", "rtl", "timer-progress-bar", "timer-progress-bar-container", "scrollbar-measure", "icon-success", "icon-warning", "icon-info", "icon-question", "icon-error"]), ce = R(["success", "warning", "info", "question", "error"]), N = () => document.body.querySelector(".".concat(u.container)), re = (e) => {
|
|
1563
|
+
const t = N();
|
|
1564
|
+
return t ? t.querySelector(e) : null;
|
|
1565
|
+
}, Y = (e) => re(".".concat(e)), I = () => Y(u.popup), le = () => Y(u.icon), be = () => Y(u.title), ve = () => Y(u["html-container"]), _e = () => Y(u.image), s = () => Y(u["progress-steps"]), c = () => Y(u["validation-message"]), m = () => re(".".concat(u.actions, " .").concat(u.confirm)), w = () => re(".".concat(u.actions, " .").concat(u.deny)), p = () => Y(u["input-label"]), C = () => re(".".concat(u.loader)), b = () => re(".".concat(u.actions, " .").concat(u.cancel)), v = () => Y(u.actions), S = () => Y(u.footer), x = () => Y(u["timer-progress-bar"]), E = () => Y(u.close), L = `
|
|
1566
|
+
a[href],
|
|
1567
|
+
area[href],
|
|
1568
|
+
input:not([disabled]),
|
|
1569
|
+
select:not([disabled]),
|
|
1570
|
+
textarea:not([disabled]),
|
|
1571
|
+
button:not([disabled]),
|
|
1572
|
+
iframe,
|
|
1573
|
+
object,
|
|
1574
|
+
embed,
|
|
1575
|
+
[tabindex="0"],
|
|
1576
|
+
[contenteditable],
|
|
1577
|
+
audio[controls],
|
|
1578
|
+
video[controls],
|
|
1579
|
+
summary
|
|
1580
|
+
`, G = () => {
|
|
1581
|
+
const e = l(I().querySelectorAll('[tabindex]:not([tabindex="-1"]):not([tabindex="0"])')).sort((n, r) => {
|
|
1582
|
+
const h = parseInt(n.getAttribute("tabindex")), A = parseInt(r.getAttribute("tabindex"));
|
|
1583
|
+
return h > A ? 1 : h < A ? -1 : 0;
|
|
1584
|
+
}), t = l(I().querySelectorAll(L)).filter((n) => n.getAttribute("tabindex") !== "-1");
|
|
1585
|
+
return f(e.concat(t)).filter((n) => ee(n));
|
|
1586
|
+
}, ne = () => ue(document.body, u.shown) && !ue(document.body, u["toast-shown"]) && !ue(document.body, u["no-backdrop"]), j = () => I() && ue(I(), u.toast), pe = () => I().hasAttribute("data-loading"), we = {
|
|
1587
|
+
previousBodyPadding: null
|
|
1588
|
+
}, $ = (e, t) => {
|
|
1589
|
+
if (e.textContent = "", t) {
|
|
1590
|
+
const r = new DOMParser().parseFromString(t, "text/html");
|
|
1591
|
+
l(r.querySelector("head").childNodes).forEach((h) => {
|
|
1592
|
+
e.appendChild(h);
|
|
1593
|
+
}), l(r.querySelector("body").childNodes).forEach((h) => {
|
|
1594
|
+
e.appendChild(h);
|
|
1595
|
+
});
|
|
1596
|
+
}
|
|
1597
|
+
}, ue = (e, t) => {
|
|
1598
|
+
if (!t)
|
|
1599
|
+
return !1;
|
|
1600
|
+
const n = t.split(/\s+/);
|
|
1601
|
+
for (let r = 0; r < n.length; r++)
|
|
1602
|
+
if (!e.classList.contains(n[r]))
|
|
1603
|
+
return !1;
|
|
1604
|
+
return !0;
|
|
1605
|
+
}, Ft = (e, t) => {
|
|
1606
|
+
l(e.classList).forEach((n) => {
|
|
1607
|
+
!Object.values(u).includes(n) && !Object.values(ce).includes(n) && !Object.values(t.showClass).includes(n) && e.classList.remove(n);
|
|
1608
|
+
});
|
|
1609
|
+
}, oe = (e, t, n) => {
|
|
1610
|
+
if (Ft(e, t), t.customClass && t.customClass[n]) {
|
|
1611
|
+
if (typeof t.customClass[n] != "string" && !t.customClass[n].forEach)
|
|
1612
|
+
return k("Invalid type of customClass.".concat(n, '! Expected string or iterable object, got "').concat(typeof t.customClass[n], '"'));
|
|
1613
|
+
F(e, t.customClass[n]);
|
|
1614
|
+
}
|
|
1615
|
+
}, Ne = (e, t) => {
|
|
1616
|
+
if (!t)
|
|
1617
|
+
return null;
|
|
1618
|
+
switch (t) {
|
|
1619
|
+
case "select":
|
|
1620
|
+
case "textarea":
|
|
1621
|
+
case "file":
|
|
1622
|
+
return e.querySelector(".".concat(u.popup, " > .").concat(u[t]));
|
|
1623
|
+
case "checkbox":
|
|
1624
|
+
return e.querySelector(".".concat(u.popup, " > .").concat(u.checkbox, " input"));
|
|
1625
|
+
case "radio":
|
|
1626
|
+
return e.querySelector(".".concat(u.popup, " > .").concat(u.radio, " input:checked")) || e.querySelector(".".concat(u.popup, " > .").concat(u.radio, " input:first-child"));
|
|
1627
|
+
case "range":
|
|
1628
|
+
return e.querySelector(".".concat(u.popup, " > .").concat(u.range, " input"));
|
|
1629
|
+
default:
|
|
1630
|
+
return e.querySelector(".".concat(u.popup, " > .").concat(u.input));
|
|
1631
|
+
}
|
|
1632
|
+
}, Qe = (e) => {
|
|
1633
|
+
if (e.focus(), e.type !== "file") {
|
|
1634
|
+
const t = e.value;
|
|
1635
|
+
e.value = "", e.value = t;
|
|
1636
|
+
}
|
|
1637
|
+
}, et = (e, t, n) => {
|
|
1638
|
+
!e || !t || (typeof t == "string" && (t = t.split(/\s+/).filter(Boolean)), t.forEach((r) => {
|
|
1639
|
+
Array.isArray(e) ? e.forEach((h) => {
|
|
1640
|
+
n ? h.classList.add(r) : h.classList.remove(r);
|
|
1641
|
+
}) : n ? e.classList.add(r) : e.classList.remove(r);
|
|
1642
|
+
}));
|
|
1643
|
+
}, F = (e, t) => {
|
|
1644
|
+
et(e, t, !0);
|
|
1645
|
+
}, se = (e, t) => {
|
|
1646
|
+
et(e, t, !1);
|
|
1647
|
+
}, fe = (e, t) => {
|
|
1648
|
+
const n = l(e.childNodes);
|
|
1649
|
+
for (let r = 0; r < n.length; r++)
|
|
1650
|
+
if (ue(n[r], t))
|
|
1651
|
+
return n[r];
|
|
1652
|
+
}, Ee = (e, t, n) => {
|
|
1653
|
+
n === "".concat(parseInt(n)) && (n = parseInt(n)), n || parseInt(n) === 0 ? e.style[t] = typeof n == "number" ? "".concat(n, "px") : n : e.style.removeProperty(t);
|
|
1654
|
+
}, X = function(e) {
|
|
1655
|
+
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "flex";
|
|
1656
|
+
e.style.display = t;
|
|
1657
|
+
}, q = (e) => {
|
|
1658
|
+
e.style.display = "none";
|
|
1659
|
+
}, tt = (e, t, n, r) => {
|
|
1660
|
+
const h = e.querySelector(t);
|
|
1661
|
+
h && (h.style[n] = r);
|
|
1662
|
+
}, Le = (e, t, n) => {
|
|
1663
|
+
t ? X(e, n) : q(e);
|
|
1664
|
+
}, ee = (e) => !!(e && (e.offsetWidth || e.offsetHeight || e.getClientRects().length)), Lt = () => !ee(m()) && !ee(w()) && !ee(b()), nt = (e) => e.scrollHeight > e.clientHeight, ot = (e) => {
|
|
1665
|
+
const t = window.getComputedStyle(e), n = parseFloat(t.getPropertyValue("animation-duration") || "0"), r = parseFloat(t.getPropertyValue("transition-duration") || "0");
|
|
1666
|
+
return n > 0 || r > 0;
|
|
1667
|
+
}, Ve = function(e) {
|
|
1668
|
+
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1;
|
|
1669
|
+
const n = x();
|
|
1670
|
+
ee(n) && (t && (n.style.transition = "none", n.style.width = "100%"), setTimeout(() => {
|
|
1671
|
+
n.style.transition = "width ".concat(e / 1e3, "s linear"), n.style.width = "0%";
|
|
1672
|
+
}, 10));
|
|
1673
|
+
}, Rt = () => {
|
|
1674
|
+
const e = x(), t = parseInt(window.getComputedStyle(e).width);
|
|
1675
|
+
e.style.removeProperty("transition"), e.style.width = "100%";
|
|
1676
|
+
const n = parseInt(window.getComputedStyle(e).width), r = t / n * 100;
|
|
1677
|
+
e.style.removeProperty("transition"), e.style.width = "".concat(r, "%");
|
|
1678
|
+
}, rt = () => typeof window > "u" || typeof document > "u", Ut = 100, T = {}, Mt = () => {
|
|
1679
|
+
T.previousActiveElement && T.previousActiveElement.focus ? (T.previousActiveElement.focus(), T.previousActiveElement = null) : document.body && document.body.focus();
|
|
1680
|
+
}, Ot = (e) => new Promise((t) => {
|
|
1681
|
+
if (!e)
|
|
1682
|
+
return t();
|
|
1683
|
+
const n = window.scrollX, r = window.scrollY;
|
|
1684
|
+
T.restoreFocusTimeout = setTimeout(() => {
|
|
1685
|
+
Mt(), t();
|
|
1686
|
+
}, Ut), window.scrollTo(n, r);
|
|
1687
|
+
}), Nt = `
|
|
1688
|
+
<div aria-labelledby="`.concat(u.title, '" aria-describedby="').concat(u["html-container"], '" class="').concat(u.popup, `" tabindex="-1">
|
|
1689
|
+
<button type="button" class="`).concat(u.close, `"></button>
|
|
1690
|
+
<ul class="`).concat(u["progress-steps"], `"></ul>
|
|
1691
|
+
<div class="`).concat(u.icon, `"></div>
|
|
1692
|
+
<img class="`).concat(u.image, `" />
|
|
1693
|
+
<h2 class="`).concat(u.title, '" id="').concat(u.title, `"></h2>
|
|
1694
|
+
<div class="`).concat(u["html-container"], '" id="').concat(u["html-container"], `"></div>
|
|
1695
|
+
<input class="`).concat(u.input, `" />
|
|
1696
|
+
<input type="file" class="`).concat(u.file, `" />
|
|
1697
|
+
<div class="`).concat(u.range, `">
|
|
1698
|
+
<input type="range" />
|
|
1699
|
+
<output></output>
|
|
1700
|
+
</div>
|
|
1701
|
+
<select class="`).concat(u.select, `"></select>
|
|
1702
|
+
<div class="`).concat(u.radio, `"></div>
|
|
1703
|
+
<label for="`).concat(u.checkbox, '" class="').concat(u.checkbox, `">
|
|
1704
|
+
<input type="checkbox" />
|
|
1705
|
+
<span class="`).concat(u.label, `"></span>
|
|
1706
|
+
</label>
|
|
1707
|
+
<textarea class="`).concat(u.textarea, `"></textarea>
|
|
1708
|
+
<div class="`).concat(u["validation-message"], '" id="').concat(u["validation-message"], `"></div>
|
|
1709
|
+
<div class="`).concat(u.actions, `">
|
|
1710
|
+
<div class="`).concat(u.loader, `"></div>
|
|
1711
|
+
<button type="button" class="`).concat(u.confirm, `"></button>
|
|
1712
|
+
<button type="button" class="`).concat(u.deny, `"></button>
|
|
1713
|
+
<button type="button" class="`).concat(u.cancel, `"></button>
|
|
1714
|
+
</div>
|
|
1715
|
+
<div class="`).concat(u.footer, `"></div>
|
|
1716
|
+
<div class="`).concat(u["timer-progress-bar-container"], `">
|
|
1717
|
+
<div class="`).concat(u["timer-progress-bar"], `"></div>
|
|
1718
|
+
</div>
|
|
1719
|
+
</div>
|
|
1720
|
+
`).replace(/(^|\n)\s*/g, ""), Vt = () => {
|
|
1721
|
+
const e = N();
|
|
1722
|
+
return e ? (e.remove(), se([document.documentElement, document.body], [u["no-backdrop"], u["toast-shown"], u["has-column"]]), !0) : !1;
|
|
1723
|
+
}, me = () => {
|
|
1724
|
+
T.currentInstance.resetValidationMessage();
|
|
1725
|
+
}, Dt = () => {
|
|
1726
|
+
const e = I(), t = fe(e, u.input), n = fe(e, u.file), r = e.querySelector(".".concat(u.range, " input")), h = e.querySelector(".".concat(u.range, " output")), A = fe(e, u.select), U = e.querySelector(".".concat(u.checkbox, " input")), te = fe(e, u.textarea);
|
|
1727
|
+
t.oninput = me, n.onchange = me, A.onchange = me, U.onchange = me, te.oninput = me, r.oninput = () => {
|
|
1728
|
+
me(), h.value = r.value;
|
|
1729
|
+
}, r.onchange = () => {
|
|
1730
|
+
me(), r.nextSibling.value = r.value;
|
|
1731
|
+
};
|
|
1732
|
+
}, jt = (e) => typeof e == "string" ? document.querySelector(e) : e, Xt = (e) => {
|
|
1733
|
+
const t = I();
|
|
1734
|
+
t.setAttribute("role", e.toast ? "alert" : "dialog"), t.setAttribute("aria-live", e.toast ? "polite" : "assertive"), e.toast || t.setAttribute("aria-modal", "true");
|
|
1735
|
+
}, $t = (e) => {
|
|
1736
|
+
window.getComputedStyle(e).direction === "rtl" && F(N(), u.rtl);
|
|
1737
|
+
}, qt = (e) => {
|
|
1738
|
+
const t = Vt();
|
|
1739
|
+
if (rt()) {
|
|
1740
|
+
g("SweetAlert2 requires document to initialize");
|
|
1741
|
+
return;
|
|
1742
|
+
}
|
|
1743
|
+
const n = document.createElement("div");
|
|
1744
|
+
n.className = u.container, t && F(n, u["no-transition"]), $(n, Nt);
|
|
1745
|
+
const r = jt(e.target);
|
|
1746
|
+
r.appendChild(n), Xt(e), $t(r), Dt();
|
|
1747
|
+
}, De = (e, t) => {
|
|
1748
|
+
e instanceof HTMLElement ? t.appendChild(e) : typeof e == "object" ? Kt(e, t) : e && $(t, e);
|
|
1749
|
+
}, Kt = (e, t) => {
|
|
1750
|
+
e.jquery ? zt(t, e) : $(t, e.toString());
|
|
1751
|
+
}, zt = (e, t) => {
|
|
1752
|
+
if (e.textContent = "", 0 in t)
|
|
1753
|
+
for (let n = 0; n in t; n++)
|
|
1754
|
+
e.appendChild(t[n].cloneNode(!0));
|
|
1755
|
+
else
|
|
1756
|
+
e.appendChild(t.cloneNode(!0));
|
|
1757
|
+
}, Te = (() => {
|
|
1758
|
+
if (rt())
|
|
1759
|
+
return !1;
|
|
1760
|
+
const e = document.createElement("div"), t = {
|
|
1761
|
+
WebkitAnimation: "webkitAnimationEnd",
|
|
1762
|
+
// Chrome, Safari and Opera
|
|
1763
|
+
animation: "animationend"
|
|
1764
|
+
// Standard syntax
|
|
1765
|
+
};
|
|
1766
|
+
for (const n in t)
|
|
1767
|
+
if (Object.prototype.hasOwnProperty.call(t, n) && typeof e.style[n] < "u")
|
|
1768
|
+
return t[n];
|
|
1769
|
+
return !1;
|
|
1770
|
+
})(), Wt = () => {
|
|
1771
|
+
const e = document.createElement("div");
|
|
1772
|
+
e.className = u["scrollbar-measure"], document.body.appendChild(e);
|
|
1773
|
+
const t = e.getBoundingClientRect().width - e.clientWidth;
|
|
1774
|
+
return document.body.removeChild(e), t;
|
|
1775
|
+
}, Jt = (e, t) => {
|
|
1776
|
+
const n = v(), r = C();
|
|
1777
|
+
!t.showConfirmButton && !t.showDenyButton && !t.showCancelButton ? q(n) : X(n), oe(n, t, "actions"), Yt(n, r, t), $(r, t.loaderHtml), oe(r, t, "loader");
|
|
1778
|
+
};
|
|
1779
|
+
function Yt(e, t, n) {
|
|
1780
|
+
const r = m(), h = w(), A = b();
|
|
1781
|
+
je(r, "confirm", n), je(h, "deny", n), je(A, "cancel", n), Gt(r, h, A, n), n.reverseButtons && (n.toast ? (e.insertBefore(A, r), e.insertBefore(h, r)) : (e.insertBefore(A, t), e.insertBefore(h, t), e.insertBefore(r, t)));
|
|
1782
|
+
}
|
|
1783
|
+
function Gt(e, t, n, r) {
|
|
1784
|
+
if (!r.buttonsStyling)
|
|
1785
|
+
return se([e, t, n], u.styled);
|
|
1786
|
+
F([e, t, n], u.styled), r.confirmButtonColor && (e.style.backgroundColor = r.confirmButtonColor, F(e, u["default-outline"])), r.denyButtonColor && (t.style.backgroundColor = r.denyButtonColor, F(t, u["default-outline"])), r.cancelButtonColor && (n.style.backgroundColor = r.cancelButtonColor, F(n, u["default-outline"]));
|
|
1787
|
+
}
|
|
1788
|
+
function je(e, t, n) {
|
|
1789
|
+
Le(e, n["show".concat(y(t), "Button")], "inline-block"), $(e, n["".concat(t, "ButtonText")]), e.setAttribute("aria-label", n["".concat(t, "ButtonAriaLabel")]), e.className = u[t], oe(e, n, "".concat(t, "Button")), F(e, n["".concat(t, "ButtonClass")]);
|
|
1790
|
+
}
|
|
1791
|
+
function Zt(e, t) {
|
|
1792
|
+
typeof t == "string" ? e.style.background = t : t || F([document.documentElement, document.body], u["no-backdrop"]);
|
|
1793
|
+
}
|
|
1794
|
+
function Qt(e, t) {
|
|
1795
|
+
t in u ? F(e, u[t]) : (k('The "position" parameter is not valid, defaulting to "center"'), F(e, u.center));
|
|
1796
|
+
}
|
|
1797
|
+
function en(e, t) {
|
|
1798
|
+
if (t && typeof t == "string") {
|
|
1799
|
+
const n = "grow-".concat(t);
|
|
1800
|
+
n in u && F(e, u[n]);
|
|
1801
|
+
}
|
|
1802
|
+
}
|
|
1803
|
+
const tn = (e, t) => {
|
|
1804
|
+
const n = N();
|
|
1805
|
+
n && (Zt(n, t.backdrop), Qt(n, t.position), en(n, t.grow), oe(n, t, "container"));
|
|
1806
|
+
};
|
|
1807
|
+
var P = {
|
|
1808
|
+
awaitingPromise: /* @__PURE__ */ new WeakMap(),
|
|
1809
|
+
promise: /* @__PURE__ */ new WeakMap(),
|
|
1810
|
+
innerParams: /* @__PURE__ */ new WeakMap(),
|
|
1811
|
+
domCache: /* @__PURE__ */ new WeakMap()
|
|
1812
|
+
};
|
|
1813
|
+
const nn = ["input", "file", "range", "select", "radio", "checkbox", "textarea"], on = (e, t) => {
|
|
1814
|
+
const n = I(), r = P.innerParams.get(e), h = !r || t.input !== r.input;
|
|
1815
|
+
nn.forEach((A) => {
|
|
1816
|
+
const U = u[A], te = fe(n, U);
|
|
1817
|
+
an(A, t.inputAttributes), te.className = U, h && q(te);
|
|
1818
|
+
}), t.input && (h && rn(t), cn(t));
|
|
1819
|
+
}, rn = (e) => {
|
|
1820
|
+
if (!Z[e.input])
|
|
1821
|
+
return g('Unexpected type of input! Expected "text", "email", "password", "number", "tel", "select", "radio", "checkbox", "textarea", "file" or "url", got "'.concat(e.input, '"'));
|
|
1822
|
+
const t = st(e.input), n = Z[e.input](t, e);
|
|
1823
|
+
X(n), setTimeout(() => {
|
|
1824
|
+
Qe(n);
|
|
1825
|
+
});
|
|
1826
|
+
}, sn = (e) => {
|
|
1827
|
+
for (let t = 0; t < e.attributes.length; t++) {
|
|
1828
|
+
const n = e.attributes[t].name;
|
|
1829
|
+
["type", "value", "style"].includes(n) || e.removeAttribute(n);
|
|
1830
|
+
}
|
|
1831
|
+
}, an = (e, t) => {
|
|
1832
|
+
const n = Ne(I(), e);
|
|
1833
|
+
if (n) {
|
|
1834
|
+
sn(n);
|
|
1835
|
+
for (const r in t)
|
|
1836
|
+
n.setAttribute(r, t[r]);
|
|
1837
|
+
}
|
|
1838
|
+
}, cn = (e) => {
|
|
1839
|
+
const t = st(e.input);
|
|
1840
|
+
e.customClass && F(t, e.customClass.input);
|
|
1841
|
+
}, Xe = (e, t) => {
|
|
1842
|
+
(!e.placeholder || t.inputPlaceholder) && (e.placeholder = t.inputPlaceholder);
|
|
1843
|
+
}, Be = (e, t, n) => {
|
|
1844
|
+
if (n.inputLabel) {
|
|
1845
|
+
e.id = u.input;
|
|
1846
|
+
const r = document.createElement("label"), h = u["input-label"];
|
|
1847
|
+
r.setAttribute("for", e.id), r.className = h, F(r, n.customClass.inputLabel), r.innerText = n.inputLabel, t.insertAdjacentElement("beforebegin", r);
|
|
1848
|
+
}
|
|
1849
|
+
}, st = (e) => {
|
|
1850
|
+
const t = u[e] ? u[e] : u.input;
|
|
1851
|
+
return fe(I(), t);
|
|
1852
|
+
}, Z = {};
|
|
1853
|
+
Z.text = Z.email = Z.password = Z.number = Z.tel = Z.url = (e, t) => (typeof t.inputValue == "string" || typeof t.inputValue == "number" ? e.value = t.inputValue : J(t.inputValue) || k('Unexpected type of inputValue! Expected "string", "number" or "Promise", got "'.concat(typeof t.inputValue, '"')), Be(e, e, t), Xe(e, t), e.type = t.input, e), Z.file = (e, t) => (Be(e, e, t), Xe(e, t), e), Z.range = (e, t) => {
|
|
1854
|
+
const n = e.querySelector("input"), r = e.querySelector("output");
|
|
1855
|
+
return n.value = t.inputValue, n.type = t.input, r.value = t.inputValue, Be(n, e, t), e;
|
|
1856
|
+
}, Z.select = (e, t) => {
|
|
1857
|
+
if (e.textContent = "", t.inputPlaceholder) {
|
|
1858
|
+
const n = document.createElement("option");
|
|
1859
|
+
$(n, t.inputPlaceholder), n.value = "", n.disabled = !0, n.selected = !0, e.appendChild(n);
|
|
1860
|
+
}
|
|
1861
|
+
return Be(e, e, t), e;
|
|
1862
|
+
}, Z.radio = (e) => (e.textContent = "", e), Z.checkbox = (e, t) => {
|
|
1863
|
+
const n = Ne(I(), "checkbox");
|
|
1864
|
+
n.value = "1", n.id = u.checkbox, n.checked = !!t.inputValue;
|
|
1865
|
+
const r = e.querySelector("span");
|
|
1866
|
+
return $(r, t.inputPlaceholder), e;
|
|
1867
|
+
}, Z.textarea = (e, t) => {
|
|
1868
|
+
e.value = t.inputValue, Xe(e, t), Be(e, e, t);
|
|
1869
|
+
const n = (r) => parseInt(window.getComputedStyle(r).marginLeft) + parseInt(window.getComputedStyle(r).marginRight);
|
|
1870
|
+
return setTimeout(() => {
|
|
1871
|
+
if ("MutationObserver" in window) {
|
|
1872
|
+
const r = parseInt(window.getComputedStyle(I()).width), h = () => {
|
|
1873
|
+
const A = e.offsetWidth + n(e);
|
|
1874
|
+
A > r ? I().style.width = "".concat(A, "px") : I().style.width = null;
|
|
1875
|
+
};
|
|
1876
|
+
new MutationObserver(h).observe(e, {
|
|
1877
|
+
attributes: !0,
|
|
1878
|
+
attributeFilter: ["style"]
|
|
1879
|
+
});
|
|
1880
|
+
}
|
|
1881
|
+
}), e;
|
|
1882
|
+
};
|
|
1883
|
+
const ln = (e, t) => {
|
|
1884
|
+
const n = ve();
|
|
1885
|
+
oe(n, t, "htmlContainer"), t.html ? (De(t.html, n), X(n, "block")) : t.text ? (n.textContent = t.text, X(n, "block")) : q(n), on(e, t);
|
|
1886
|
+
}, un = (e, t) => {
|
|
1887
|
+
const n = S();
|
|
1888
|
+
Le(n, t.footer), t.footer && De(t.footer, n), oe(n, t, "footer");
|
|
1889
|
+
}, dn = (e, t) => {
|
|
1890
|
+
const n = E();
|
|
1891
|
+
$(n, t.closeButtonHtml), oe(n, t, "closeButton"), Le(n, t.showCloseButton), n.setAttribute("aria-label", t.closeButtonAriaLabel);
|
|
1892
|
+
}, fn = (e, t) => {
|
|
1893
|
+
const n = P.innerParams.get(e), r = le();
|
|
1894
|
+
if (n && t.icon === n.icon) {
|
|
1895
|
+
at(r, t), it(r, t);
|
|
1896
|
+
return;
|
|
1897
|
+
}
|
|
1898
|
+
if (!t.icon && !t.iconHtml)
|
|
1899
|
+
return q(r);
|
|
1900
|
+
if (t.icon && Object.keys(ce).indexOf(t.icon) === -1)
|
|
1901
|
+
return g('Unknown icon! Expected "success", "error", "warning", "info" or "question", got "'.concat(t.icon, '"')), q(r);
|
|
1902
|
+
X(r), at(r, t), it(r, t), F(r, t.showClass.icon);
|
|
1903
|
+
}, it = (e, t) => {
|
|
1904
|
+
for (const n in ce)
|
|
1905
|
+
t.icon !== n && se(e, ce[n]);
|
|
1906
|
+
F(e, ce[t.icon]), gn(e, t), hn(), oe(e, t, "icon");
|
|
1907
|
+
}, hn = () => {
|
|
1908
|
+
const e = I(), t = window.getComputedStyle(e).getPropertyValue("background-color"), n = e.querySelectorAll("[class^=swal2-success-circular-line], .swal2-success-fix");
|
|
1909
|
+
for (let r = 0; r < n.length; r++)
|
|
1910
|
+
n[r].style.backgroundColor = t;
|
|
1911
|
+
}, pn = `
|
|
1912
|
+
<div class="swal2-success-circular-line-left"></div>
|
|
1913
|
+
<span class="swal2-success-line-tip"></span> <span class="swal2-success-line-long"></span>
|
|
1914
|
+
<div class="swal2-success-ring"></div> <div class="swal2-success-fix"></div>
|
|
1915
|
+
<div class="swal2-success-circular-line-right"></div>
|
|
1916
|
+
`, mn = `
|
|
1917
|
+
<span class="swal2-x-mark">
|
|
1918
|
+
<span class="swal2-x-mark-line-left"></span>
|
|
1919
|
+
<span class="swal2-x-mark-line-right"></span>
|
|
1920
|
+
</span>
|
|
1921
|
+
`, at = (e, t) => {
|
|
1922
|
+
e.textContent = "", t.iconHtml ? $(e, ct(t.iconHtml)) : t.icon === "success" ? $(e, pn) : t.icon === "error" ? $(e, mn) : $(e, ct({
|
|
1923
|
+
question: "?",
|
|
1924
|
+
warning: "!",
|
|
1925
|
+
info: "i"
|
|
1926
|
+
}[t.icon]));
|
|
1927
|
+
}, gn = (e, t) => {
|
|
1928
|
+
if (t.iconColor) {
|
|
1929
|
+
e.style.color = t.iconColor, e.style.borderColor = t.iconColor;
|
|
1930
|
+
for (const n of [".swal2-success-line-tip", ".swal2-success-line-long", ".swal2-x-mark-line-left", ".swal2-x-mark-line-right"])
|
|
1931
|
+
tt(e, n, "backgroundColor", t.iconColor);
|
|
1932
|
+
tt(e, ".swal2-success-ring", "borderColor", t.iconColor);
|
|
1933
|
+
}
|
|
1934
|
+
}, ct = (e) => '<div class="'.concat(u["icon-content"], '">').concat(e, "</div>"), bn = (e, t) => {
|
|
1935
|
+
const n = _e();
|
|
1936
|
+
if (!t.imageUrl)
|
|
1937
|
+
return q(n);
|
|
1938
|
+
X(n, ""), n.setAttribute("src", t.imageUrl), n.setAttribute("alt", t.imageAlt), Ee(n, "width", t.imageWidth), Ee(n, "height", t.imageHeight), n.className = u.image, oe(n, t, "image");
|
|
1939
|
+
}, vn = (e) => {
|
|
1940
|
+
const t = document.createElement("li");
|
|
1941
|
+
return F(t, u["progress-step"]), $(t, e), t;
|
|
1942
|
+
}, wn = (e) => {
|
|
1943
|
+
const t = document.createElement("li");
|
|
1944
|
+
return F(t, u["progress-step-line"]), e.progressStepsDistance && (t.style.width = e.progressStepsDistance), t;
|
|
1945
|
+
}, yn = (e, t) => {
|
|
1946
|
+
const n = s();
|
|
1947
|
+
if (!t.progressSteps || t.progressSteps.length === 0)
|
|
1948
|
+
return q(n);
|
|
1949
|
+
X(n), n.textContent = "", t.currentProgressStep >= t.progressSteps.length && k("Invalid currentProgressStep parameter, it should be less than progressSteps.length (currentProgressStep like JS arrays starts from 0)"), t.progressSteps.forEach((r, h) => {
|
|
1950
|
+
const A = vn(r);
|
|
1951
|
+
if (n.appendChild(A), h === t.currentProgressStep && F(A, u["active-progress-step"]), h !== t.progressSteps.length - 1) {
|
|
1952
|
+
const U = wn(t);
|
|
1953
|
+
n.appendChild(U);
|
|
1954
|
+
}
|
|
1955
|
+
});
|
|
1956
|
+
}, kn = (e, t) => {
|
|
1957
|
+
const n = be();
|
|
1958
|
+
Le(n, t.title || t.titleText, "block"), t.title && De(t.title, n), t.titleText && (n.innerText = t.titleText), oe(n, t, "title");
|
|
1959
|
+
}, Cn = (e, t) => {
|
|
1960
|
+
const n = N(), r = I();
|
|
1961
|
+
t.toast ? (Ee(n, "width", t.width), r.style.width = "100%", r.insertBefore(C(), le())) : Ee(r, "width", t.width), Ee(r, "padding", t.padding), t.color && (r.style.color = t.color), t.background && (r.style.background = t.background), q(c()), xn(r, t);
|
|
1962
|
+
}, xn = (e, t) => {
|
|
1963
|
+
e.className = "".concat(u.popup, " ").concat(ee(e) ? t.showClass.popup : ""), t.toast ? (F([document.documentElement, document.body], u["toast-shown"]), F(e, u.toast)) : F(e, u.modal), oe(e, t, "popup"), typeof t.customClass == "string" && F(e, t.customClass), t.icon && F(e, u["icon-".concat(t.icon)]);
|
|
1964
|
+
}, lt = (e, t) => {
|
|
1965
|
+
Cn(e, t), tn(e, t), yn(e, t), fn(e, t), bn(e, t), kn(e, t), dn(e, t), ln(e, t), Jt(e, t), un(e, t), typeof t.didRender == "function" && t.didRender(I());
|
|
1966
|
+
}, ye = Object.freeze({
|
|
1967
|
+
cancel: "cancel",
|
|
1968
|
+
backdrop: "backdrop",
|
|
1969
|
+
close: "close",
|
|
1970
|
+
esc: "esc",
|
|
1971
|
+
timer: "timer"
|
|
1972
|
+
}), Sn = () => {
|
|
1973
|
+
l(document.body.children).forEach((t) => {
|
|
1974
|
+
t === N() || t.contains(N()) || (t.hasAttribute("aria-hidden") && t.setAttribute("data-previous-aria-hidden", t.getAttribute("aria-hidden")), t.setAttribute("aria-hidden", "true"));
|
|
1975
|
+
});
|
|
1976
|
+
}, ut = () => {
|
|
1977
|
+
l(document.body.children).forEach((t) => {
|
|
1978
|
+
t.hasAttribute("data-previous-aria-hidden") ? (t.setAttribute("aria-hidden", t.getAttribute("data-previous-aria-hidden")), t.removeAttribute("data-previous-aria-hidden")) : t.removeAttribute("aria-hidden");
|
|
1979
|
+
});
|
|
1980
|
+
}, dt = ["swal-title", "swal-html", "swal-footer"], An = (e) => {
|
|
1981
|
+
const t = typeof e.template == "string" ? document.querySelector(e.template) : e.template;
|
|
1982
|
+
if (!t)
|
|
1983
|
+
return {};
|
|
1984
|
+
const n = t.content;
|
|
1985
|
+
return In(n), Object.assign(_n(n), En(n), Tn(n), Bn(n), Pn(n), Hn(n, dt));
|
|
1986
|
+
}, _n = (e) => {
|
|
1987
|
+
const t = {};
|
|
1988
|
+
return l(e.querySelectorAll("swal-param")).forEach((n) => {
|
|
1989
|
+
ge(n, ["name", "value"]);
|
|
1990
|
+
const r = n.getAttribute("name"), h = n.getAttribute("value");
|
|
1991
|
+
typeof V[r] == "boolean" && h === "false" && (t[r] = !1), typeof V[r] == "object" && (t[r] = JSON.parse(h));
|
|
1992
|
+
}), t;
|
|
1993
|
+
}, En = (e) => {
|
|
1994
|
+
const t = {};
|
|
1995
|
+
return l(e.querySelectorAll("swal-button")).forEach((n) => {
|
|
1996
|
+
ge(n, ["type", "color", "aria-label"]);
|
|
1997
|
+
const r = n.getAttribute("type");
|
|
1998
|
+
t["".concat(r, "ButtonText")] = n.innerHTML, t["show".concat(y(r), "Button")] = !0, n.hasAttribute("color") && (t["".concat(r, "ButtonColor")] = n.getAttribute("color")), n.hasAttribute("aria-label") && (t["".concat(r, "ButtonAriaLabel")] = n.getAttribute("aria-label"));
|
|
1999
|
+
}), t;
|
|
2000
|
+
}, Tn = (e) => {
|
|
2001
|
+
const t = {}, n = e.querySelector("swal-image");
|
|
2002
|
+
return n && (ge(n, ["src", "width", "height", "alt"]), n.hasAttribute("src") && (t.imageUrl = n.getAttribute("src")), n.hasAttribute("width") && (t.imageWidth = n.getAttribute("width")), n.hasAttribute("height") && (t.imageHeight = n.getAttribute("height")), n.hasAttribute("alt") && (t.imageAlt = n.getAttribute("alt"))), t;
|
|
2003
|
+
}, Bn = (e) => {
|
|
2004
|
+
const t = {}, n = e.querySelector("swal-icon");
|
|
2005
|
+
return n && (ge(n, ["type", "color"]), n.hasAttribute("type") && (t.icon = n.getAttribute("type")), n.hasAttribute("color") && (t.iconColor = n.getAttribute("color")), t.iconHtml = n.innerHTML), t;
|
|
2006
|
+
}, Pn = (e) => {
|
|
2007
|
+
const t = {}, n = e.querySelector("swal-input");
|
|
2008
|
+
n && (ge(n, ["type", "label", "placeholder", "value"]), t.input = n.getAttribute("type") || "text", n.hasAttribute("label") && (t.inputLabel = n.getAttribute("label")), n.hasAttribute("placeholder") && (t.inputPlaceholder = n.getAttribute("placeholder")), n.hasAttribute("value") && (t.inputValue = n.getAttribute("value")));
|
|
2009
|
+
const r = e.querySelectorAll("swal-input-option");
|
|
2010
|
+
return r.length && (t.inputOptions = {}, l(r).forEach((h) => {
|
|
2011
|
+
ge(h, ["value"]);
|
|
2012
|
+
const A = h.getAttribute("value"), U = h.innerHTML;
|
|
2013
|
+
t.inputOptions[A] = U;
|
|
2014
|
+
})), t;
|
|
2015
|
+
}, Hn = (e, t) => {
|
|
2016
|
+
const n = {};
|
|
2017
|
+
for (const r in t) {
|
|
2018
|
+
const h = t[r], A = e.querySelector(h);
|
|
2019
|
+
A && (ge(A, []), n[h.replace(/^swal-/, "")] = A.innerHTML.trim());
|
|
2020
|
+
}
|
|
2021
|
+
return n;
|
|
2022
|
+
}, In = (e) => {
|
|
2023
|
+
const t = dt.concat(["swal-param", "swal-button", "swal-image", "swal-icon", "swal-input", "swal-input-option"]);
|
|
2024
|
+
l(e.children).forEach((n) => {
|
|
2025
|
+
const r = n.tagName.toLowerCase();
|
|
2026
|
+
t.indexOf(r) === -1 && k("Unrecognized element <".concat(r, ">"));
|
|
2027
|
+
});
|
|
2028
|
+
}, ge = (e, t) => {
|
|
2029
|
+
l(e.attributes).forEach((n) => {
|
|
2030
|
+
t.indexOf(n.name) === -1 && k(['Unrecognized attribute "'.concat(n.name, '" on <').concat(e.tagName.toLowerCase(), ">."), "".concat(t.length ? "Allowed attributes are: ".concat(t.join(", ")) : "To set the value, use HTML within the element.")]);
|
|
2031
|
+
});
|
|
2032
|
+
};
|
|
2033
|
+
var ft = {
|
|
2034
|
+
email: (e, t) => /^[a-zA-Z0-9.+_-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9-]{2,24}$/.test(e) ? Promise.resolve() : Promise.resolve(t || "Invalid email address"),
|
|
2035
|
+
url: (e, t) => /^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-z]{2,63}\b([-a-zA-Z0-9@:%_+.~#?&/=]*)$/.test(e) ? Promise.resolve() : Promise.resolve(t || "Invalid URL")
|
|
2036
|
+
};
|
|
2037
|
+
function Fn(e) {
|
|
2038
|
+
e.inputValidator || Object.keys(ft).forEach((t) => {
|
|
2039
|
+
e.input === t && (e.inputValidator = ft[t]);
|
|
2040
|
+
});
|
|
2041
|
+
}
|
|
2042
|
+
function Ln(e) {
|
|
2043
|
+
(!e.target || typeof e.target == "string" && !document.querySelector(e.target) || typeof e.target != "string" && !e.target.appendChild) && (k('Target parameter is not valid, defaulting to "body"'), e.target = "body");
|
|
2044
|
+
}
|
|
2045
|
+
function Rn(e) {
|
|
2046
|
+
Fn(e), e.showLoaderOnConfirm && !e.preConfirm && k(`showLoaderOnConfirm is set to true, but preConfirm is not defined.
|
|
2047
|
+
showLoaderOnConfirm should be used together with preConfirm, see usage example:
|
|
2048
|
+
https://sweetalert2.github.io/#ajax-request`), Ln(e), typeof e.title == "string" && (e.title = e.title.split(`
|
|
2049
|
+
`).join("<br />")), qt(e);
|
|
2050
|
+
}
|
|
2051
|
+
class Un {
|
|
2052
|
+
constructor(t, n) {
|
|
2053
|
+
this.callback = t, this.remaining = n, this.running = !1, this.start();
|
|
2054
|
+
}
|
|
2055
|
+
start() {
|
|
2056
|
+
return this.running || (this.running = !0, this.started = /* @__PURE__ */ new Date(), this.id = setTimeout(this.callback, this.remaining)), this.remaining;
|
|
2057
|
+
}
|
|
2058
|
+
stop() {
|
|
2059
|
+
return this.running && (this.running = !1, clearTimeout(this.id), this.remaining -= (/* @__PURE__ */ new Date()).getTime() - this.started.getTime()), this.remaining;
|
|
2060
|
+
}
|
|
2061
|
+
increase(t) {
|
|
2062
|
+
const n = this.running;
|
|
2063
|
+
return n && this.stop(), this.remaining += t, n && this.start(), this.remaining;
|
|
2064
|
+
}
|
|
2065
|
+
getTimerLeft() {
|
|
2066
|
+
return this.running && (this.stop(), this.start()), this.remaining;
|
|
2067
|
+
}
|
|
2068
|
+
isRunning() {
|
|
2069
|
+
return this.running;
|
|
2070
|
+
}
|
|
2071
|
+
}
|
|
2072
|
+
const Mn = () => {
|
|
2073
|
+
we.previousBodyPadding === null && document.body.scrollHeight > window.innerHeight && (we.previousBodyPadding = parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right")), document.body.style.paddingRight = "".concat(we.previousBodyPadding + Wt(), "px"));
|
|
2074
|
+
}, On = () => {
|
|
2075
|
+
we.previousBodyPadding !== null && (document.body.style.paddingRight = "".concat(we.previousBodyPadding, "px"), we.previousBodyPadding = null);
|
|
2076
|
+
}, Nn = () => {
|
|
2077
|
+
if (// @ts-ignore
|
|
2078
|
+
(/iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream || navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1) && !ue(document.body, u.iosfix)) {
|
|
2079
|
+
const t = document.body.scrollTop;
|
|
2080
|
+
document.body.style.top = "".concat(t * -1, "px"), F(document.body, u.iosfix), Dn(), Vn();
|
|
2081
|
+
}
|
|
2082
|
+
}, Vn = () => {
|
|
2083
|
+
const e = navigator.userAgent, t = !!e.match(/iPad/i) || !!e.match(/iPhone/i), n = !!e.match(/WebKit/i);
|
|
2084
|
+
t && n && !e.match(/CriOS/i) && I().scrollHeight > window.innerHeight - 44 && (N().style.paddingBottom = "".concat(44, "px"));
|
|
2085
|
+
}, Dn = () => {
|
|
2086
|
+
const e = N();
|
|
2087
|
+
let t;
|
|
2088
|
+
e.ontouchstart = (n) => {
|
|
2089
|
+
t = jn(n);
|
|
2090
|
+
}, e.ontouchmove = (n) => {
|
|
2091
|
+
t && (n.preventDefault(), n.stopPropagation());
|
|
2092
|
+
};
|
|
2093
|
+
}, jn = (e) => {
|
|
2094
|
+
const t = e.target, n = N();
|
|
2095
|
+
return Xn(e) || $n(e) ? !1 : t === n || !nt(n) && t.tagName !== "INPUT" && // #1603
|
|
2096
|
+
t.tagName !== "TEXTAREA" && // #2266
|
|
2097
|
+
!(nt(ve()) && // #1944
|
|
2098
|
+
ve().contains(t));
|
|
2099
|
+
}, Xn = (e) => e.touches && e.touches.length && e.touches[0].touchType === "stylus", $n = (e) => e.touches && e.touches.length > 1, qn = () => {
|
|
2100
|
+
if (ue(document.body, u.iosfix)) {
|
|
2101
|
+
const e = parseInt(document.body.style.top, 10);
|
|
2102
|
+
se(document.body, u.iosfix), document.body.style.top = "", document.body.scrollTop = e * -1;
|
|
2103
|
+
}
|
|
2104
|
+
}, ht = 10, Kn = (e) => {
|
|
2105
|
+
const t = N(), n = I();
|
|
2106
|
+
typeof e.willOpen == "function" && e.willOpen(n);
|
|
2107
|
+
const h = window.getComputedStyle(document.body).overflowY;
|
|
2108
|
+
Jn(t, n, e), setTimeout(() => {
|
|
2109
|
+
zn(t, n);
|
|
2110
|
+
}, ht), ne() && (Wn(t, e.scrollbarPadding, h), Sn()), !j() && !T.previousActiveElement && (T.previousActiveElement = document.activeElement), typeof e.didOpen == "function" && setTimeout(() => e.didOpen(n)), se(t, u["no-transition"]);
|
|
2111
|
+
}, pt = (e) => {
|
|
2112
|
+
const t = I();
|
|
2113
|
+
if (e.target !== t)
|
|
2114
|
+
return;
|
|
2115
|
+
const n = N();
|
|
2116
|
+
t.removeEventListener(Te, pt), n.style.overflowY = "auto";
|
|
2117
|
+
}, zn = (e, t) => {
|
|
2118
|
+
Te && ot(t) ? (e.style.overflowY = "hidden", t.addEventListener(Te, pt)) : e.style.overflowY = "auto";
|
|
2119
|
+
}, Wn = (e, t, n) => {
|
|
2120
|
+
Nn(), t && n !== "hidden" && Mn(), setTimeout(() => {
|
|
2121
|
+
e.scrollTop = 0;
|
|
2122
|
+
});
|
|
2123
|
+
}, Jn = (e, t, n) => {
|
|
2124
|
+
F(e, n.showClass.backdrop), t.style.setProperty("opacity", "0", "important"), X(t, "grid"), setTimeout(() => {
|
|
2125
|
+
F(t, n.showClass.popup), t.style.removeProperty("opacity");
|
|
2126
|
+
}, ht), F([document.documentElement, document.body], u.shown), n.heightAuto && n.backdrop && !n.toast && F([document.documentElement, document.body], u["height-auto"]);
|
|
2127
|
+
}, ke = (e) => {
|
|
2128
|
+
let t = I();
|
|
2129
|
+
t || new Me(), t = I();
|
|
2130
|
+
const n = C();
|
|
2131
|
+
j() ? q(le()) : Yn(t, e), X(n), t.setAttribute("data-loading", !0), t.setAttribute("aria-busy", !0), t.focus();
|
|
2132
|
+
}, Yn = (e, t) => {
|
|
2133
|
+
const n = v(), r = C();
|
|
2134
|
+
!t && ee(m()) && (t = m()), X(n), t && (q(t), r.setAttribute("data-button-to-replace", t.className)), r.parentNode.insertBefore(r, t), F([e, n], u.loading);
|
|
2135
|
+
}, Gn = (e, t) => {
|
|
2136
|
+
t.input === "select" || t.input === "radio" ? no(e, t) : ["text", "email", "number", "tel", "textarea"].includes(t.input) && (W(t.inputValue) || J(t.inputValue)) && (ke(m()), oo(e, t));
|
|
2137
|
+
}, Zn = (e, t) => {
|
|
2138
|
+
const n = e.getInput();
|
|
2139
|
+
if (!n)
|
|
2140
|
+
return null;
|
|
2141
|
+
switch (t.input) {
|
|
2142
|
+
case "checkbox":
|
|
2143
|
+
return Qn(n);
|
|
2144
|
+
case "radio":
|
|
2145
|
+
return eo(n);
|
|
2146
|
+
case "file":
|
|
2147
|
+
return to(n);
|
|
2148
|
+
default:
|
|
2149
|
+
return t.inputAutoTrim ? n.value.trim() : n.value;
|
|
2150
|
+
}
|
|
2151
|
+
}, Qn = (e) => e.checked ? 1 : 0, eo = (e) => e.checked ? e.value : null, to = (e) => e.files.length ? e.getAttribute("multiple") !== null ? e.files : e.files[0] : null, no = (e, t) => {
|
|
2152
|
+
const n = I(), r = (h) => ro[t.input](n, $e(h), t);
|
|
2153
|
+
W(t.inputOptions) || J(t.inputOptions) ? (ke(m()), B(t.inputOptions).then((h) => {
|
|
2154
|
+
e.hideLoading(), r(h);
|
|
2155
|
+
})) : typeof t.inputOptions == "object" ? r(t.inputOptions) : g("Unexpected type of inputOptions! Expected object, Map or Promise, got ".concat(typeof t.inputOptions));
|
|
2156
|
+
}, oo = (e, t) => {
|
|
2157
|
+
const n = e.getInput();
|
|
2158
|
+
q(n), B(t.inputValue).then((r) => {
|
|
2159
|
+
n.value = t.input === "number" ? parseFloat(r) || 0 : "".concat(r), X(n), n.focus(), e.hideLoading();
|
|
2160
|
+
}).catch((r) => {
|
|
2161
|
+
g("Error in inputValue promise: ".concat(r)), n.value = "", X(n), n.focus(), e.hideLoading();
|
|
2162
|
+
});
|
|
2163
|
+
}, ro = {
|
|
2164
|
+
select: (e, t, n) => {
|
|
2165
|
+
const r = fe(e, u.select), h = (A, U, te) => {
|
|
2166
|
+
const z = document.createElement("option");
|
|
2167
|
+
z.value = te, $(z, U), z.selected = mt(te, n.inputValue), A.appendChild(z);
|
|
2168
|
+
};
|
|
2169
|
+
t.forEach((A) => {
|
|
2170
|
+
const U = A[0], te = A[1];
|
|
2171
|
+
if (Array.isArray(te)) {
|
|
2172
|
+
const z = document.createElement("optgroup");
|
|
2173
|
+
z.label = U, z.disabled = !1, r.appendChild(z), te.forEach((xe) => h(z, xe[1], xe[0]));
|
|
2174
|
+
} else
|
|
2175
|
+
h(r, te, U);
|
|
2176
|
+
}), r.focus();
|
|
2177
|
+
},
|
|
2178
|
+
radio: (e, t, n) => {
|
|
2179
|
+
const r = fe(e, u.radio);
|
|
2180
|
+
t.forEach((A) => {
|
|
2181
|
+
const U = A[0], te = A[1], z = document.createElement("input"), xe = document.createElement("label");
|
|
2182
|
+
z.type = "radio", z.name = u.radio, z.value = U, mt(U, n.inputValue) && (z.checked = !0);
|
|
2183
|
+
const Ge = document.createElement("span");
|
|
2184
|
+
$(Ge, te), Ge.className = u.label, xe.appendChild(z), xe.appendChild(Ge), r.appendChild(xe);
|
|
2185
|
+
});
|
|
2186
|
+
const h = r.querySelectorAll("input");
|
|
2187
|
+
h.length && h[0].focus();
|
|
2188
|
+
}
|
|
2189
|
+
}, $e = (e) => {
|
|
2190
|
+
const t = [];
|
|
2191
|
+
return typeof Map < "u" && e instanceof Map ? e.forEach((n, r) => {
|
|
2192
|
+
let h = n;
|
|
2193
|
+
typeof h == "object" && (h = $e(h)), t.push([r, h]);
|
|
2194
|
+
}) : Object.keys(e).forEach((n) => {
|
|
2195
|
+
let r = e[n];
|
|
2196
|
+
typeof r == "object" && (r = $e(r)), t.push([n, r]);
|
|
2197
|
+
}), t;
|
|
2198
|
+
}, mt = (e, t) => t && t.toString() === e.toString();
|
|
2199
|
+
function gt() {
|
|
2200
|
+
const e = P.innerParams.get(this);
|
|
2201
|
+
if (!e)
|
|
2202
|
+
return;
|
|
2203
|
+
const t = P.domCache.get(this);
|
|
2204
|
+
q(t.loader), j() ? e.icon && X(le()) : so(t), se([t.popup, t.actions], u.loading), t.popup.removeAttribute("aria-busy"), t.popup.removeAttribute("data-loading"), t.confirmButton.disabled = !1, t.denyButton.disabled = !1, t.cancelButton.disabled = !1;
|
|
2205
|
+
}
|
|
2206
|
+
const so = (e) => {
|
|
2207
|
+
const t = e.popup.getElementsByClassName(e.loader.getAttribute("data-button-to-replace"));
|
|
2208
|
+
t.length ? X(t[0], "inline-block") : Lt() && q(e.actions);
|
|
2209
|
+
};
|
|
2210
|
+
function io(e) {
|
|
2211
|
+
const t = P.innerParams.get(e || this), n = P.domCache.get(e || this);
|
|
2212
|
+
return n ? Ne(n.popup, t.input) : null;
|
|
2213
|
+
}
|
|
2214
|
+
var Pe = {
|
|
2215
|
+
swalPromiseResolve: /* @__PURE__ */ new WeakMap(),
|
|
2216
|
+
swalPromiseReject: /* @__PURE__ */ new WeakMap()
|
|
2217
|
+
};
|
|
2218
|
+
const ao = () => ee(I()), bt = () => m() && m().click(), co = () => w() && w().click(), lo = () => b() && b().click(), vt = (e) => {
|
|
2219
|
+
e.keydownTarget && e.keydownHandlerAdded && (e.keydownTarget.removeEventListener("keydown", e.keydownHandler, {
|
|
2220
|
+
capture: e.keydownListenerCapture
|
|
2221
|
+
}), e.keydownHandlerAdded = !1);
|
|
2222
|
+
}, uo = (e, t, n, r) => {
|
|
2223
|
+
vt(t), n.toast || (t.keydownHandler = (h) => ho(e, h, r), t.keydownTarget = n.keydownListenerCapture ? window : I(), t.keydownListenerCapture = n.keydownListenerCapture, t.keydownTarget.addEventListener("keydown", t.keydownHandler, {
|
|
2224
|
+
capture: t.keydownListenerCapture
|
|
2225
|
+
}), t.keydownHandlerAdded = !0);
|
|
2226
|
+
}, qe = (e, t, n) => {
|
|
2227
|
+
const r = G();
|
|
2228
|
+
if (r.length)
|
|
2229
|
+
return t = t + n, t === r.length ? t = 0 : t === -1 && (t = r.length - 1), r[t].focus();
|
|
2230
|
+
I().focus();
|
|
2231
|
+
}, wt = ["ArrowRight", "ArrowDown"], fo = ["ArrowLeft", "ArrowUp"], ho = (e, t, n) => {
|
|
2232
|
+
const r = P.innerParams.get(e);
|
|
2233
|
+
r && (t.isComposing || t.keyCode === 229 || (r.stopKeydownPropagation && t.stopPropagation(), t.key === "Enter" ? po(e, t, r) : t.key === "Tab" ? mo(t, r) : [...wt, ...fo].includes(t.key) ? go(t.key) : t.key === "Escape" && bo(t, r, n)));
|
|
2234
|
+
}, po = (e, t, n) => {
|
|
2235
|
+
if (O(n.allowEnterKey) && t.target && e.getInput() && t.target.outerHTML === e.getInput().outerHTML) {
|
|
2236
|
+
if (["textarea", "file"].includes(n.input))
|
|
2237
|
+
return;
|
|
2238
|
+
bt(), t.preventDefault();
|
|
2239
|
+
}
|
|
2240
|
+
}, mo = (e, t) => {
|
|
2241
|
+
const n = e.target, r = G();
|
|
2242
|
+
let h = -1;
|
|
2243
|
+
for (let A = 0; A < r.length; A++)
|
|
2244
|
+
if (n === r[A]) {
|
|
2245
|
+
h = A;
|
|
2246
|
+
break;
|
|
2247
|
+
}
|
|
2248
|
+
e.shiftKey ? qe(t, h, -1) : qe(t, h, 1), e.stopPropagation(), e.preventDefault();
|
|
2249
|
+
}, go = (e) => {
|
|
2250
|
+
const t = m(), n = w(), r = b();
|
|
2251
|
+
if (![t, n, r].includes(document.activeElement))
|
|
2252
|
+
return;
|
|
2253
|
+
const h = wt.includes(e) ? "nextElementSibling" : "previousElementSibling";
|
|
2254
|
+
let A = document.activeElement;
|
|
2255
|
+
for (let U = 0; U < v().children.length; U++) {
|
|
2256
|
+
if (A = A[h], !A)
|
|
2257
|
+
return;
|
|
2258
|
+
if (ee(A) && A instanceof HTMLButtonElement)
|
|
2259
|
+
break;
|
|
2260
|
+
}
|
|
2261
|
+
A instanceof HTMLButtonElement && A.focus();
|
|
2262
|
+
}, bo = (e, t, n) => {
|
|
2263
|
+
O(t.allowEscapeKey) && (e.preventDefault(), n(ye.esc));
|
|
2264
|
+
};
|
|
2265
|
+
function yt(e, t, n, r) {
|
|
2266
|
+
j() ? kt(e, r) : (Ot(n).then(() => kt(e, r)), vt(T)), /^((?!chrome|android).)*safari/i.test(navigator.userAgent) ? (t.setAttribute("style", "display:none !important"), t.removeAttribute("class"), t.innerHTML = "") : t.remove(), ne() && (On(), qn(), ut()), vo();
|
|
2267
|
+
}
|
|
2268
|
+
function vo() {
|
|
2269
|
+
se([document.documentElement, document.body], [u.shown, u["height-auto"], u["no-backdrop"], u["toast-shown"]]);
|
|
2270
|
+
}
|
|
2271
|
+
function Re(e) {
|
|
2272
|
+
e = Co(e);
|
|
2273
|
+
const t = Pe.swalPromiseResolve.get(this), n = yo(this);
|
|
2274
|
+
this.isAwaitingPromise() ? e.isDismissed || (He(this), t(e)) : n && t(e);
|
|
2275
|
+
}
|
|
2276
|
+
function wo() {
|
|
2277
|
+
return !!P.awaitingPromise.get(this);
|
|
2278
|
+
}
|
|
2279
|
+
const yo = (e) => {
|
|
2280
|
+
const t = I();
|
|
2281
|
+
if (!t)
|
|
2282
|
+
return !1;
|
|
2283
|
+
const n = P.innerParams.get(e);
|
|
2284
|
+
if (!n || ue(t, n.hideClass.popup))
|
|
2285
|
+
return !1;
|
|
2286
|
+
se(t, n.showClass.popup), F(t, n.hideClass.popup);
|
|
2287
|
+
const r = N();
|
|
2288
|
+
return se(r, n.showClass.backdrop), F(r, n.hideClass.backdrop), xo(e, t, n), !0;
|
|
2289
|
+
};
|
|
2290
|
+
function ko(e) {
|
|
2291
|
+
const t = Pe.swalPromiseReject.get(this);
|
|
2292
|
+
He(this), t && t(e);
|
|
2293
|
+
}
|
|
2294
|
+
const He = (e) => {
|
|
2295
|
+
e.isAwaitingPromise() && (P.awaitingPromise.delete(e), P.innerParams.get(e) || e._destroy());
|
|
2296
|
+
}, Co = (e) => typeof e > "u" ? {
|
|
2297
|
+
isConfirmed: !1,
|
|
2298
|
+
isDenied: !1,
|
|
2299
|
+
isDismissed: !0
|
|
2300
|
+
} : Object.assign({
|
|
2301
|
+
isConfirmed: !1,
|
|
2302
|
+
isDenied: !1,
|
|
2303
|
+
isDismissed: !1
|
|
2304
|
+
}, e), xo = (e, t, n) => {
|
|
2305
|
+
const r = N(), h = Te && ot(t);
|
|
2306
|
+
typeof n.willClose == "function" && n.willClose(t), h ? So(e, t, r, n.returnFocus, n.didClose) : yt(e, r, n.returnFocus, n.didClose);
|
|
2307
|
+
}, So = (e, t, n, r, h) => {
|
|
2308
|
+
T.swalCloseEventFinishedCallback = yt.bind(null, e, n, r, h), t.addEventListener(Te, function(A) {
|
|
2309
|
+
A.target === t && (T.swalCloseEventFinishedCallback(), delete T.swalCloseEventFinishedCallback);
|
|
2310
|
+
});
|
|
2311
|
+
}, kt = (e, t) => {
|
|
2312
|
+
setTimeout(() => {
|
|
2313
|
+
typeof t == "function" && t.bind(e.params)(), e._destroy();
|
|
2314
|
+
});
|
|
2315
|
+
};
|
|
2316
|
+
function Ct(e, t, n) {
|
|
2317
|
+
const r = P.domCache.get(e);
|
|
2318
|
+
t.forEach((h) => {
|
|
2319
|
+
r[h].disabled = n;
|
|
2320
|
+
});
|
|
2321
|
+
}
|
|
2322
|
+
function xt(e, t) {
|
|
2323
|
+
if (!e)
|
|
2324
|
+
return !1;
|
|
2325
|
+
if (e.type === "radio") {
|
|
2326
|
+
const r = e.parentNode.parentNode.querySelectorAll("input");
|
|
2327
|
+
for (let h = 0; h < r.length; h++)
|
|
2328
|
+
r[h].disabled = t;
|
|
2329
|
+
} else
|
|
2330
|
+
e.disabled = t;
|
|
2331
|
+
}
|
|
2332
|
+
function Ao() {
|
|
2333
|
+
Ct(this, ["confirmButton", "denyButton", "cancelButton"], !1);
|
|
2334
|
+
}
|
|
2335
|
+
function _o() {
|
|
2336
|
+
Ct(this, ["confirmButton", "denyButton", "cancelButton"], !0);
|
|
2337
|
+
}
|
|
2338
|
+
function Eo() {
|
|
2339
|
+
return xt(this.getInput(), !1);
|
|
2340
|
+
}
|
|
2341
|
+
function To() {
|
|
2342
|
+
return xt(this.getInput(), !0);
|
|
2343
|
+
}
|
|
2344
|
+
function Bo(e) {
|
|
2345
|
+
const t = P.domCache.get(this), n = P.innerParams.get(this);
|
|
2346
|
+
$(t.validationMessage, e), t.validationMessage.className = u["validation-message"], n.customClass && n.customClass.validationMessage && F(t.validationMessage, n.customClass.validationMessage), X(t.validationMessage);
|
|
2347
|
+
const r = this.getInput();
|
|
2348
|
+
r && (r.setAttribute("aria-invalid", !0), r.setAttribute("aria-describedby", u["validation-message"]), Qe(r), F(r, u.inputerror));
|
|
2349
|
+
}
|
|
2350
|
+
function Po() {
|
|
2351
|
+
const e = P.domCache.get(this);
|
|
2352
|
+
e.validationMessage && q(e.validationMessage);
|
|
2353
|
+
const t = this.getInput();
|
|
2354
|
+
t && (t.removeAttribute("aria-invalid"), t.removeAttribute("aria-describedby"), se(t, u.inputerror));
|
|
2355
|
+
}
|
|
2356
|
+
function Ho() {
|
|
2357
|
+
return P.domCache.get(this).progressSteps;
|
|
2358
|
+
}
|
|
2359
|
+
function Io(e) {
|
|
2360
|
+
const t = I(), n = P.innerParams.get(this);
|
|
2361
|
+
if (!t || ue(t, n.hideClass.popup))
|
|
2362
|
+
return k("You're trying to update the closed or closing popup, that won't work. Use the update() method in preConfirm parameter or show a new popup.");
|
|
2363
|
+
const r = Fo(e), h = Object.assign({}, n, r);
|
|
2364
|
+
lt(this, h), P.innerParams.set(this, h), Object.defineProperties(this, {
|
|
2365
|
+
params: {
|
|
2366
|
+
value: Object.assign({}, this.params, e),
|
|
2367
|
+
writable: !1,
|
|
2368
|
+
enumerable: !0
|
|
2369
|
+
}
|
|
2370
|
+
});
|
|
2371
|
+
}
|
|
2372
|
+
const Fo = (e) => {
|
|
2373
|
+
const t = {};
|
|
2374
|
+
return Object.keys(e).forEach((n) => {
|
|
2375
|
+
Se(n) ? t[n] = e[n] : k('Invalid parameter to update: "'.concat(n, `". Updatable params are listed here: https://github.com/sweetalert2/sweetalert2/blob/master/src/utils/params.js
|
|
2376
|
+
|
|
2377
|
+
If you think this parameter should be updatable, request it here: https://github.com/sweetalert2/sweetalert2/issues/new?template=02_feature_request.md`));
|
|
2378
|
+
}), t;
|
|
2379
|
+
};
|
|
2380
|
+
function Lo() {
|
|
2381
|
+
const e = P.domCache.get(this), t = P.innerParams.get(this);
|
|
2382
|
+
if (!t) {
|
|
2383
|
+
St(this);
|
|
2384
|
+
return;
|
|
2385
|
+
}
|
|
2386
|
+
e.popup && T.swalCloseEventFinishedCallback && (T.swalCloseEventFinishedCallback(), delete T.swalCloseEventFinishedCallback), T.deferDisposalTimer && (clearTimeout(T.deferDisposalTimer), delete T.deferDisposalTimer), typeof t.didDestroy == "function" && t.didDestroy(), Ro(this);
|
|
2387
|
+
}
|
|
2388
|
+
const Ro = (e) => {
|
|
2389
|
+
St(e), delete e.params, delete T.keydownHandler, delete T.keydownTarget, delete T.currentInstance;
|
|
2390
|
+
}, St = (e) => {
|
|
2391
|
+
e.isAwaitingPromise() ? (Ke(P, e), P.awaitingPromise.set(e, !0)) : (Ke(Pe, e), Ke(P, e));
|
|
2392
|
+
}, Ke = (e, t) => {
|
|
2393
|
+
for (const n in e)
|
|
2394
|
+
e[n].delete(t);
|
|
2395
|
+
};
|
|
2396
|
+
var At = /* @__PURE__ */ Object.freeze({
|
|
2397
|
+
hideLoading: gt,
|
|
2398
|
+
disableLoading: gt,
|
|
2399
|
+
getInput: io,
|
|
2400
|
+
close: Re,
|
|
2401
|
+
isAwaitingPromise: wo,
|
|
2402
|
+
rejectPromise: ko,
|
|
2403
|
+
handleAwaitingPromise: He,
|
|
2404
|
+
closePopup: Re,
|
|
2405
|
+
closeModal: Re,
|
|
2406
|
+
closeToast: Re,
|
|
2407
|
+
enableButtons: Ao,
|
|
2408
|
+
disableButtons: _o,
|
|
2409
|
+
enableInput: Eo,
|
|
2410
|
+
disableInput: To,
|
|
2411
|
+
showValidationMessage: Bo,
|
|
2412
|
+
resetValidationMessage: Po,
|
|
2413
|
+
getProgressSteps: Ho,
|
|
2414
|
+
update: Io,
|
|
2415
|
+
_destroy: Lo
|
|
2416
|
+
});
|
|
2417
|
+
const Uo = (e) => {
|
|
2418
|
+
const t = P.innerParams.get(e);
|
|
2419
|
+
e.disableButtons(), t.input ? _t(e, "confirm") : We(e, !0);
|
|
2420
|
+
}, Mo = (e) => {
|
|
2421
|
+
const t = P.innerParams.get(e);
|
|
2422
|
+
e.disableButtons(), t.returnInputValueOnDeny ? _t(e, "deny") : ze(e, !1);
|
|
2423
|
+
}, Oo = (e, t) => {
|
|
2424
|
+
e.disableButtons(), t(ye.cancel);
|
|
2425
|
+
}, _t = (e, t) => {
|
|
2426
|
+
const n = P.innerParams.get(e);
|
|
2427
|
+
if (!n.input)
|
|
2428
|
+
return g('The "input" parameter is needed to be set when using returnInputValueOn'.concat(y(t)));
|
|
2429
|
+
const r = Zn(e, n);
|
|
2430
|
+
n.inputValidator ? No(e, r, t) : e.getInput().checkValidity() ? t === "deny" ? ze(e, r) : We(e, r) : (e.enableButtons(), e.showValidationMessage(n.validationMessage));
|
|
2431
|
+
}, No = (e, t, n) => {
|
|
2432
|
+
const r = P.innerParams.get(e);
|
|
2433
|
+
e.disableInput(), Promise.resolve().then(() => B(r.inputValidator(t, r.validationMessage))).then((A) => {
|
|
2434
|
+
e.enableButtons(), e.enableInput(), A ? e.showValidationMessage(A) : n === "deny" ? ze(e, t) : We(e, t);
|
|
2435
|
+
});
|
|
2436
|
+
}, ze = (e, t) => {
|
|
2437
|
+
const n = P.innerParams.get(e || void 0);
|
|
2438
|
+
n.showLoaderOnDeny && ke(w()), n.preDeny ? (P.awaitingPromise.set(e || void 0, !0), Promise.resolve().then(() => B(n.preDeny(t, n.validationMessage))).then((h) => {
|
|
2439
|
+
h === !1 ? (e.hideLoading(), He(e)) : e.closePopup({
|
|
2440
|
+
isDenied: !0,
|
|
2441
|
+
value: typeof h > "u" ? t : h
|
|
2442
|
+
});
|
|
2443
|
+
}).catch((h) => Tt(e || void 0, h))) : e.closePopup({
|
|
2444
|
+
isDenied: !0,
|
|
2445
|
+
value: t
|
|
2446
|
+
});
|
|
2447
|
+
}, Et = (e, t) => {
|
|
2448
|
+
e.closePopup({
|
|
2449
|
+
isConfirmed: !0,
|
|
2450
|
+
value: t
|
|
2451
|
+
});
|
|
2452
|
+
}, Tt = (e, t) => {
|
|
2453
|
+
e.rejectPromise(t);
|
|
2454
|
+
}, We = (e, t) => {
|
|
2455
|
+
const n = P.innerParams.get(e || void 0);
|
|
2456
|
+
n.showLoaderOnConfirm && ke(), n.preConfirm ? (e.resetValidationMessage(), P.awaitingPromise.set(e || void 0, !0), Promise.resolve().then(() => B(n.preConfirm(t, n.validationMessage))).then((h) => {
|
|
2457
|
+
ee(c()) || h === !1 ? (e.hideLoading(), He(e)) : Et(e, typeof h > "u" ? t : h);
|
|
2458
|
+
}).catch((h) => Tt(e || void 0, h))) : Et(e, t);
|
|
2459
|
+
}, Vo = (e, t, n) => {
|
|
2460
|
+
P.innerParams.get(e).toast ? Do(e, t, n) : (Xo(t), $o(t), qo(e, t, n));
|
|
2461
|
+
}, Do = (e, t, n) => {
|
|
2462
|
+
t.popup.onclick = () => {
|
|
2463
|
+
const r = P.innerParams.get(e);
|
|
2464
|
+
r && (jo(r) || r.timer || r.input) || n(ye.close);
|
|
2465
|
+
};
|
|
2466
|
+
}, jo = (e) => e.showConfirmButton || e.showDenyButton || e.showCancelButton || e.showCloseButton;
|
|
2467
|
+
let Ue = !1;
|
|
2468
|
+
const Xo = (e) => {
|
|
2469
|
+
e.popup.onmousedown = () => {
|
|
2470
|
+
e.container.onmouseup = function(t) {
|
|
2471
|
+
e.container.onmouseup = void 0, t.target === e.container && (Ue = !0);
|
|
2472
|
+
};
|
|
2473
|
+
};
|
|
2474
|
+
}, $o = (e) => {
|
|
2475
|
+
e.container.onmousedown = () => {
|
|
2476
|
+
e.popup.onmouseup = function(t) {
|
|
2477
|
+
e.popup.onmouseup = void 0, (t.target === e.popup || e.popup.contains(t.target)) && (Ue = !0);
|
|
2478
|
+
};
|
|
2479
|
+
};
|
|
2480
|
+
}, qo = (e, t, n) => {
|
|
2481
|
+
t.container.onclick = (r) => {
|
|
2482
|
+
const h = P.innerParams.get(e);
|
|
2483
|
+
if (Ue) {
|
|
2484
|
+
Ue = !1;
|
|
2485
|
+
return;
|
|
2486
|
+
}
|
|
2487
|
+
r.target === t.container && O(h.allowOutsideClick) && n(ye.backdrop);
|
|
2488
|
+
};
|
|
2489
|
+
}, Ko = (e) => typeof e == "object" && e.jquery, Bt = (e) => e instanceof Element || Ko(e), zo = (e) => {
|
|
2490
|
+
const t = {};
|
|
2491
|
+
return typeof e[0] == "object" && !Bt(e[0]) ? Object.assign(t, e[0]) : ["title", "html", "icon"].forEach((n, r) => {
|
|
2492
|
+
const h = e[r];
|
|
2493
|
+
typeof h == "string" || Bt(h) ? t[n] = h : h !== void 0 && g("Unexpected type of ".concat(n, '! Expected "string" or "Element", got ').concat(typeof h));
|
|
2494
|
+
}), t;
|
|
2495
|
+
};
|
|
2496
|
+
function Wo() {
|
|
2497
|
+
const e = this;
|
|
2498
|
+
for (var t = arguments.length, n = new Array(t), r = 0; r < t; r++)
|
|
2499
|
+
n[r] = arguments[r];
|
|
2500
|
+
return new e(...n);
|
|
2501
|
+
}
|
|
2502
|
+
function Jo(e) {
|
|
2503
|
+
class t extends this {
|
|
2504
|
+
_main(r, h) {
|
|
2505
|
+
return super._main(r, Object.assign({}, e, h));
|
|
2506
|
+
}
|
|
2507
|
+
}
|
|
2508
|
+
return t;
|
|
2509
|
+
}
|
|
2510
|
+
const Yo = () => T.timeout && T.timeout.getTimerLeft(), Pt = () => {
|
|
2511
|
+
if (T.timeout)
|
|
2512
|
+
return Rt(), T.timeout.stop();
|
|
2513
|
+
}, Ht = () => {
|
|
2514
|
+
if (T.timeout) {
|
|
2515
|
+
const e = T.timeout.start();
|
|
2516
|
+
return Ve(e), e;
|
|
2517
|
+
}
|
|
2518
|
+
}, Go = () => {
|
|
2519
|
+
const e = T.timeout;
|
|
2520
|
+
return e && (e.running ? Pt() : Ht());
|
|
2521
|
+
}, Zo = (e) => {
|
|
2522
|
+
if (T.timeout) {
|
|
2523
|
+
const t = T.timeout.increase(e);
|
|
2524
|
+
return Ve(t, !0), t;
|
|
2525
|
+
}
|
|
2526
|
+
}, Qo = () => T.timeout && T.timeout.isRunning();
|
|
2527
|
+
let It = !1;
|
|
2528
|
+
const Je = {};
|
|
2529
|
+
function er() {
|
|
2530
|
+
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "data-swal-template";
|
|
2531
|
+
Je[e] = this, It || (document.body.addEventListener("click", tr), It = !0);
|
|
2532
|
+
}
|
|
2533
|
+
const tr = (e) => {
|
|
2534
|
+
for (let t = e.target; t && t !== document; t = t.parentNode)
|
|
2535
|
+
for (const n in Je) {
|
|
2536
|
+
const r = t.getAttribute(n);
|
|
2537
|
+
if (r) {
|
|
2538
|
+
Je[n].fire({
|
|
2539
|
+
template: r
|
|
2540
|
+
});
|
|
2541
|
+
return;
|
|
2542
|
+
}
|
|
2543
|
+
}
|
|
2544
|
+
};
|
|
2545
|
+
var nr = /* @__PURE__ */ Object.freeze({
|
|
2546
|
+
isValidParameter: ie,
|
|
2547
|
+
isUpdatableParameter: Se,
|
|
2548
|
+
isDeprecatedParameter: de,
|
|
2549
|
+
argsToParams: zo,
|
|
2550
|
+
isVisible: ao,
|
|
2551
|
+
clickConfirm: bt,
|
|
2552
|
+
clickDeny: co,
|
|
2553
|
+
clickCancel: lo,
|
|
2554
|
+
getContainer: N,
|
|
2555
|
+
getPopup: I,
|
|
2556
|
+
getTitle: be,
|
|
2557
|
+
getHtmlContainer: ve,
|
|
2558
|
+
getImage: _e,
|
|
2559
|
+
getIcon: le,
|
|
2560
|
+
getInputLabel: p,
|
|
2561
|
+
getCloseButton: E,
|
|
2562
|
+
getActions: v,
|
|
2563
|
+
getConfirmButton: m,
|
|
2564
|
+
getDenyButton: w,
|
|
2565
|
+
getCancelButton: b,
|
|
2566
|
+
getLoader: C,
|
|
2567
|
+
getFooter: S,
|
|
2568
|
+
getTimerProgressBar: x,
|
|
2569
|
+
getFocusableElements: G,
|
|
2570
|
+
getValidationMessage: c,
|
|
2571
|
+
isLoading: pe,
|
|
2572
|
+
fire: Wo,
|
|
2573
|
+
mixin: Jo,
|
|
2574
|
+
showLoading: ke,
|
|
2575
|
+
enableLoading: ke,
|
|
2576
|
+
getTimerLeft: Yo,
|
|
2577
|
+
stopTimer: Pt,
|
|
2578
|
+
resumeTimer: Ht,
|
|
2579
|
+
toggleTimer: Go,
|
|
2580
|
+
increaseTimer: Zo,
|
|
2581
|
+
isTimerRunning: Qo,
|
|
2582
|
+
bindClickHandler: er
|
|
2583
|
+
});
|
|
2584
|
+
let Ye;
|
|
2585
|
+
class Ce {
|
|
2586
|
+
constructor() {
|
|
2587
|
+
if (typeof window > "u")
|
|
2588
|
+
return;
|
|
2589
|
+
Ye = this;
|
|
2590
|
+
for (var t = arguments.length, n = new Array(t), r = 0; r < t; r++)
|
|
2591
|
+
n[r] = arguments[r];
|
|
2592
|
+
const h = Object.freeze(this.constructor.argsToParams(n));
|
|
2593
|
+
Object.defineProperties(this, {
|
|
2594
|
+
params: {
|
|
2595
|
+
value: h,
|
|
2596
|
+
writable: !1,
|
|
2597
|
+
enumerable: !0,
|
|
2598
|
+
configurable: !0
|
|
2599
|
+
}
|
|
2600
|
+
});
|
|
2601
|
+
const A = this._main(this.params);
|
|
2602
|
+
P.promise.set(this, A);
|
|
2603
|
+
}
|
|
2604
|
+
_main(t) {
|
|
2605
|
+
let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
2606
|
+
Oe(Object.assign({}, n, t)), T.currentInstance && (T.currentInstance._destroy(), ne() && ut()), T.currentInstance = this;
|
|
2607
|
+
const r = rr(t, n);
|
|
2608
|
+
Rn(r), Object.freeze(r), T.timeout && (T.timeout.stop(), delete T.timeout), clearTimeout(T.restoreFocusTimeout);
|
|
2609
|
+
const h = sr(this);
|
|
2610
|
+
return lt(this, r), P.innerParams.set(this, r), or(this, h, r);
|
|
2611
|
+
}
|
|
2612
|
+
// `catch` cannot be the name of a module export, so we define our thenable methods here instead
|
|
2613
|
+
then(t) {
|
|
2614
|
+
return P.promise.get(this).then(t);
|
|
2615
|
+
}
|
|
2616
|
+
finally(t) {
|
|
2617
|
+
return P.promise.get(this).finally(t);
|
|
2618
|
+
}
|
|
2619
|
+
}
|
|
2620
|
+
const or = (e, t, n) => new Promise((r, h) => {
|
|
2621
|
+
const A = (U) => {
|
|
2622
|
+
e.closePopup({
|
|
2623
|
+
isDismissed: !0,
|
|
2624
|
+
dismiss: U
|
|
2625
|
+
});
|
|
2626
|
+
};
|
|
2627
|
+
Pe.swalPromiseResolve.set(e, r), Pe.swalPromiseReject.set(e, h), t.confirmButton.onclick = () => Uo(e), t.denyButton.onclick = () => Mo(e), t.cancelButton.onclick = () => Oo(e, A), t.closeButton.onclick = () => A(ye.close), Vo(e, t, A), uo(e, T, n, A), Gn(e, n), Kn(n), ir(T, n, A), ar(t, n), setTimeout(() => {
|
|
2628
|
+
t.container.scrollTop = 0;
|
|
2629
|
+
});
|
|
2630
|
+
}), rr = (e, t) => {
|
|
2631
|
+
const n = An(e), r = Object.assign({}, V, t, n, e);
|
|
2632
|
+
return r.showClass = Object.assign({}, V.showClass, r.showClass), r.hideClass = Object.assign({}, V.hideClass, r.hideClass), r;
|
|
2633
|
+
}, sr = (e) => {
|
|
2634
|
+
const t = {
|
|
2635
|
+
popup: I(),
|
|
2636
|
+
container: N(),
|
|
2637
|
+
actions: v(),
|
|
2638
|
+
confirmButton: m(),
|
|
2639
|
+
denyButton: w(),
|
|
2640
|
+
cancelButton: b(),
|
|
2641
|
+
loader: C(),
|
|
2642
|
+
closeButton: E(),
|
|
2643
|
+
validationMessage: c(),
|
|
2644
|
+
progressSteps: s()
|
|
2645
|
+
};
|
|
2646
|
+
return P.domCache.set(e, t), t;
|
|
2647
|
+
}, ir = (e, t, n) => {
|
|
2648
|
+
const r = x();
|
|
2649
|
+
q(r), t.timer && (e.timeout = new Un(() => {
|
|
2650
|
+
n("timer"), delete e.timeout;
|
|
2651
|
+
}, t.timer), t.timerProgressBar && (X(r), oe(r, t, "timerProgressBar"), setTimeout(() => {
|
|
2652
|
+
e.timeout && e.timeout.running && Ve(t.timer);
|
|
2653
|
+
})));
|
|
2654
|
+
}, ar = (e, t) => {
|
|
2655
|
+
if (!t.toast) {
|
|
2656
|
+
if (!O(t.allowEnterKey))
|
|
2657
|
+
return lr();
|
|
2658
|
+
cr(e, t) || qe(t, -1, 1);
|
|
2659
|
+
}
|
|
2660
|
+
}, cr = (e, t) => t.focusDeny && ee(e.denyButton) ? (e.denyButton.focus(), !0) : t.focusCancel && ee(e.cancelButton) ? (e.cancelButton.focus(), !0) : t.focusConfirm && ee(e.confirmButton) ? (e.confirmButton.focus(), !0) : !1, lr = () => {
|
|
2661
|
+
document.activeElement instanceof HTMLElement && typeof document.activeElement.blur == "function" && document.activeElement.blur();
|
|
2662
|
+
};
|
|
2663
|
+
Object.assign(Ce.prototype, At), Object.assign(Ce, nr), Object.keys(At).forEach((e) => {
|
|
2664
|
+
Ce[e] = function() {
|
|
2665
|
+
if (Ye)
|
|
2666
|
+
return Ye[e](...arguments);
|
|
2667
|
+
};
|
|
2668
|
+
}), Ce.DismissReason = ye, Ce.version = "11.4.8";
|
|
2669
|
+
const Me = Ce;
|
|
2670
|
+
return Me.default = Me, Me;
|
|
2671
|
+
}), typeof commonjsGlobal < "u" && commonjsGlobal.Sweetalert2 && (commonjsGlobal.swal = commonjsGlobal.sweetAlert = commonjsGlobal.Swal = commonjsGlobal.SweetAlert = commonjsGlobal.Sweetalert2);
|
|
2672
|
+
})(sweetalert2);
|
|
2673
|
+
var sweetalert2Exports = sweetalert2.exports;
|
|
2674
|
+
const Swal = /* @__PURE__ */ getDefaultExportFromCjs(sweetalert2Exports);
|
|
2675
|
+
class DialogService {
|
|
2676
|
+
get IsVisible() {
|
|
2677
|
+
return Swal.isVisible();
|
|
2678
|
+
}
|
|
2679
|
+
async ConfirmAsync(o) {
|
|
2680
|
+
return new Promise((d) => {
|
|
2681
|
+
Swal.fire({
|
|
2682
|
+
showCancelButton: !0,
|
|
2683
|
+
allowEscapeKey: !1,
|
|
2684
|
+
allowOutsideClick: !1,
|
|
2685
|
+
icon: "question",
|
|
2686
|
+
title: o.header,
|
|
2687
|
+
text: o.message,
|
|
2688
|
+
confirmButtonText: o.confirmLabel ?? "confirmar",
|
|
2689
|
+
cancelButtonText: o.rejectLabel ?? "cancelar"
|
|
2690
|
+
}).then((f) => {
|
|
2691
|
+
d(f.isConfirmed === !0);
|
|
2692
|
+
});
|
|
2693
|
+
});
|
|
2694
|
+
}
|
|
2695
|
+
}
|
|
2696
|
+
const service = new DialogService(), UseDialogService = () => service, tema = "", componentes = "";
|
|
2697
|
+
(() => {
|
|
2698
|
+
function a() {
|
|
2699
|
+
nextTick(() => {
|
|
2700
|
+
setTimeout(() => {
|
|
2701
|
+
var d;
|
|
2702
|
+
const o = document.querySelector(":root");
|
|
2703
|
+
o && // @ts-ignore
|
|
2704
|
+
o.style.setProperty(
|
|
2705
|
+
"--window-height",
|
|
2706
|
+
`${((d = window.visualViewport) == null ? void 0 : d.height) ?? window.innerHeight}px`
|
|
2707
|
+
);
|
|
2708
|
+
}, 1);
|
|
2709
|
+
});
|
|
2710
|
+
}
|
|
2711
|
+
a(), window.addEventListener("resize", a);
|
|
2712
|
+
})();
|
|
2713
|
+
ThemeToggleBase.SetInitialTheme();
|
|
2714
|
+
export {
|
|
2715
|
+
AuthService,
|
|
2716
|
+
Cor,
|
|
2717
|
+
_sfc_main as SfContent,
|
|
2718
|
+
_sfc_main$7 as SfIcon,
|
|
2719
|
+
_sfc_main$3 as SfLayout,
|
|
2720
|
+
_sfc_main$2 as SfNavMenuLink,
|
|
2721
|
+
Tamanho,
|
|
2722
|
+
UseDialogService,
|
|
2723
|
+
UseNavMenuService
|
|
2724
|
+
};
|