@olenbetong/appframe-core 2.0.3 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/af.common.js +115 -293
- package/dist/esm/af.common.legacy.js +119 -290
- package/dist/esm/af.common.legacy.min.js +1 -47
- package/dist/esm/af.common.legacy.min.js.map +4 -4
- package/dist/esm/af.common.min.js +1 -47
- package/dist/esm/af.common.min.js.map +4 -4
- package/dist/iife/af.common.js +118 -294
- package/dist/iife/af.common.legacy.js +122 -293
- package/dist/iife/af.common.legacy.min.js +1 -47
- package/dist/iife/af.common.legacy.min.js.map +4 -4
- package/dist/iife/af.common.min.js +1 -47
- package/dist/iife/af.common.min.js.map +4 -4
- package/es/SessionHandler.d.ts +2 -7
- package/es/SessionHandler.js +34 -135
- package/es/UserSession.d.ts +1 -2
- package/es/UserSession.js +1 -2
- package/es/downloadRequest.js +1 -4
- package/es/expose.d.ts +1 -1
- package/es/expose.js +4 -5
- package/es/getLocalizedString.d.ts +6 -7
- package/es/getLocalizedString.js +9 -82
- package/es/index.d.ts +3 -2
- package/es/index.js +4 -3
- package/es/localize.d.ts +14 -0
- package/es/localize.js +25 -0
- package/es/parseFunc.d.ts +1 -1
- package/es/parseFunc.js +1 -1
- package/es/requireNamespace.d.ts +1 -1
- package/es/requireNamespace.js +1 -7
- package/package.json +2 -2
- package/src/SessionHandler.ts +38 -156
- package/src/UserSession.ts +1 -2
- package/src/downloadRequest.ts +1 -4
- package/src/expose.ts +4 -5
- package/src/getLocalizedString.ts +22 -110
- package/src/index.ts +3 -2
- package/src/localize.ts +29 -0
- package/src/parseFunc.ts +1 -1
- package/src/requireNamespace.ts +1 -5
- package/es/warn.d.ts +0 -1
- package/es/warn.js +0 -4
- package/src/warn.ts +0 -4
|
@@ -2,7 +2,7 @@ var __defProp = Object.defineProperty;
|
|
|
2
2
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
3
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
4
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var __defNormalProp = (obj,
|
|
5
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
6
|
var __spreadValues = (a, b) => {
|
|
7
7
|
for (var prop in b || (b = {}))
|
|
8
8
|
if (__hasOwnProp.call(b, prop))
|
|
@@ -14,8 +14,8 @@ var __spreadValues = (a, b) => {
|
|
|
14
14
|
}
|
|
15
15
|
return a;
|
|
16
16
|
};
|
|
17
|
-
var __publicField = (obj,
|
|
18
|
-
__defNormalProp(obj, typeof
|
|
17
|
+
var __publicField = (obj, key, value) => {
|
|
18
|
+
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
19
19
|
return value;
|
|
20
20
|
};
|
|
21
21
|
|
|
@@ -61,262 +61,44 @@ function mitt_default(n) {
|
|
|
61
61
|
} };
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
// src/has.ts
|
|
65
|
-
function has(obj, key2) {
|
|
66
|
-
return Object.prototype.hasOwnProperty.call(obj, key2);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
// src/getLocalizedString.ts
|
|
70
|
-
async function getLocalizedStringAsync(text) {
|
|
71
|
-
try {
|
|
72
|
-
let response = await fetch(`/api/user/localize/new/${af.article.id}`, {
|
|
73
|
-
body: JSON.stringify({ text }),
|
|
74
|
-
headers: {
|
|
75
|
-
Accept: "application/json; */*",
|
|
76
|
-
"Content-Type": "application/json",
|
|
77
|
-
"X-Requested-With": "XMLHttpRequest"
|
|
78
|
-
},
|
|
79
|
-
method: "POST"
|
|
80
|
-
});
|
|
81
|
-
if (response.ok) {
|
|
82
|
-
return await response.json();
|
|
83
|
-
}
|
|
84
|
-
} catch (error) {
|
|
85
|
-
}
|
|
86
|
-
return text;
|
|
87
|
-
}
|
|
88
|
-
function afGetLocalizedString(string, wait) {
|
|
89
|
-
var _a;
|
|
90
|
-
if (typeof string === "string" && string.trim().length === 0) {
|
|
91
|
-
return string;
|
|
92
|
-
}
|
|
93
|
-
if (string === void 0 || string === "" || string === null) {
|
|
94
|
-
return;
|
|
95
|
-
}
|
|
96
|
-
if (((_a = af == null ? void 0 : af.article) == null ? void 0 : _a.i18n) !== void 0) {
|
|
97
|
-
if (!has(af.article.i18n, string)) {
|
|
98
|
-
af.article.i18n[string] = string;
|
|
99
|
-
let promise = getLocalizedStringAsync(string).then((text) => {
|
|
100
|
-
af.article.i18n[string] = text;
|
|
101
|
-
return text;
|
|
102
|
-
});
|
|
103
|
-
if (wait) {
|
|
104
|
-
return promise;
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
return af.article.i18n[string];
|
|
108
|
-
} else {
|
|
109
|
-
return string;
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
var key = "__UNLOCALIZED_STRINGS__";
|
|
113
|
-
var localizeSet = window[key] || /* @__PURE__ */ new Set();
|
|
114
|
-
if (!window[key]) {
|
|
115
|
-
window[key] = localizeSet;
|
|
116
|
-
}
|
|
117
|
-
function handleReadyStateChange() {
|
|
118
|
-
if (document.readyState !== "loading") {
|
|
119
|
-
addDeveloperUtils();
|
|
120
|
-
document.removeEventListener("readystatechange", handleReadyStateChange);
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
if (document.readyState !== "loading") {
|
|
124
|
-
addDeveloperUtils();
|
|
125
|
-
} else {
|
|
126
|
-
document.addEventListener("readystatechange", handleReadyStateChange);
|
|
127
|
-
}
|
|
128
|
-
function isDeveloper() {
|
|
129
|
-
const { af: af2 } = window;
|
|
130
|
-
return af2 && af2.userSession && af2.userSession.isDeveloper;
|
|
131
|
-
}
|
|
132
|
-
function addDeveloperUtils() {
|
|
133
|
-
if (isDeveloper()) {
|
|
134
|
-
if (typeof window.__doNothingWithStrings === "function") {
|
|
135
|
-
const addedStrings = window.__doNothingWithStrings();
|
|
136
|
-
for (let string of Object.keys(addedStrings)) {
|
|
137
|
-
localizeSet.add(string);
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
if (!window[key]) {
|
|
141
|
-
window[key] = localizeSet;
|
|
142
|
-
}
|
|
143
|
-
if (!window.__getUnlocalizedStrings) {
|
|
144
|
-
window.__getUnlocalizedStrings = function(forCustomRoute) {
|
|
145
|
-
const strings = [];
|
|
146
|
-
for (let string of localizeSet) {
|
|
147
|
-
if (string) {
|
|
148
|
-
const escaped = string.replace(/'/g, "\\'");
|
|
149
|
-
if (forCustomRoute) {
|
|
150
|
-
const localized = afGetLocalizedString(string).replaceAll(/'/g, "\\'");
|
|
151
|
-
strings.push(`'${escaped}': '${localized}',`);
|
|
152
|
-
} else {
|
|
153
|
-
strings.push(
|
|
154
|
-
`s['${escaped}'] = @Html(@context.AddLocalizableString("${string.replaceAll('"', '\\"')}"));`
|
|
155
|
-
);
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
if (forCustomRoute) {
|
|
160
|
-
return `// Localization hack, since it AddLocalizableString doesn't work properly when custom routes is used
|
|
161
|
-
if (af.userSession.uiculture === 'nb-NO') {
|
|
162
|
-
const strings = {
|
|
163
|
-
${strings.join("\n ")}
|
|
164
|
-
};
|
|
165
|
-
af.article.i18n = af.article.i18n || {};
|
|
166
|
-
Object.assign(af.article.i18n, strings);
|
|
167
|
-
}`;
|
|
168
|
-
}
|
|
169
|
-
return `<script type="text/javascript">
|
|
170
|
-
function __doNothingWithStrings() {
|
|
171
|
-
@{
|
|
172
|
-
var context = @Appframe.Web.Context.RequestContext.Current;
|
|
173
|
-
}
|
|
174
|
-
let s = {};
|
|
175
|
-
${strings.join("\n")}
|
|
176
|
-
return s;
|
|
177
|
-
}
|
|
178
|
-
<\/script>`;
|
|
179
|
-
};
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
function getLocalizedString(string) {
|
|
184
|
-
const localized = afGetLocalizedString(string);
|
|
185
|
-
if (localized === string && !localizeSet.has(string)) {
|
|
186
|
-
localizeSet.add(string);
|
|
187
|
-
}
|
|
188
|
-
return localized;
|
|
189
|
-
}
|
|
190
|
-
|
|
191
64
|
// src/SessionHandler.ts
|
|
192
|
-
var
|
|
65
|
+
var SessionHandler = class {
|
|
193
66
|
constructor() {
|
|
194
67
|
__publicField(this, "eventHandler", mitt_default());
|
|
195
|
-
__publicField(this, "showingDialog", false);
|
|
196
|
-
__publicField(this, "dialog", null);
|
|
197
68
|
}
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
<div class="form-group">
|
|
224
|
-
<label for="password">${getLocalizedString("Password")}</label>
|
|
225
|
-
<input type="password" autocomplete="password" class="form-control" id="password" >
|
|
226
|
-
</div>
|
|
227
|
-
<div class="form-group">
|
|
228
|
-
<div>
|
|
229
|
-
<button type="submit" class="btn btn-default sign-in">
|
|
230
|
-
${getLocalizedString("Log in")}
|
|
231
|
-
</button>
|
|
232
|
-
</div>
|
|
233
|
-
</div>
|
|
234
|
-
</div>
|
|
235
|
-
</div>
|
|
236
|
-
<div class="row">
|
|
237
|
-
<div class="" style="display:none; margin: 0px 30px;">
|
|
238
|
-
<div class="alert alert-warning" role="alert" style="margin-top:10px;"></div>
|
|
239
|
-
</div>
|
|
240
|
-
</div>
|
|
241
|
-
</div>
|
|
242
|
-
`;
|
|
243
|
-
const message = af.userSession.login ? _SessionHandler.messages.relog : _SessionHandler.messages.login;
|
|
244
|
-
const messageElem = contentContainer.querySelector(".message");
|
|
245
|
-
const statusElem = contentContainer.querySelector(".alert-warning");
|
|
246
|
-
const userElem = contentContainer.querySelector("input[type=text]");
|
|
247
|
-
const signInElem = contentContainer.querySelector(".sign-in");
|
|
248
|
-
const passwordElem = contentContainer.querySelector("input[type=password]");
|
|
249
|
-
if (messageElem !== null && userElem !== null && statusElem !== null && userElem !== null && signInElem !== null && passwordElem !== null) {
|
|
250
|
-
messageElem.innerText = getLocalizedString(message);
|
|
251
|
-
userElem.value = af.userSession.login || "";
|
|
252
|
-
userElem.disabled = !!af.userSession.login;
|
|
253
|
-
userElem.readOnly = !!af.userSession.login;
|
|
254
|
-
document.body.appendChild(contentContainer);
|
|
255
|
-
const doLogin = async () => {
|
|
256
|
-
passwordElem.disabled = true;
|
|
257
|
-
const request = new Request("/login", {
|
|
258
|
-
body: JSON.stringify({
|
|
259
|
-
username: userElem.value,
|
|
260
|
-
password: passwordElem.value,
|
|
261
|
-
remember: false
|
|
262
|
-
}),
|
|
263
|
-
headers: {
|
|
264
|
-
Accept: "application/json",
|
|
265
|
-
"Content-Type": "application/json; charset=utf-8",
|
|
266
|
-
"X-Requested-With": "XMLHttpRequest"
|
|
267
|
-
},
|
|
268
|
-
method: "POST"
|
|
269
|
-
});
|
|
270
|
-
try {
|
|
271
|
-
const response = await fetch(request);
|
|
272
|
-
const json = await response.json();
|
|
273
|
-
if (json.success) {
|
|
274
|
-
document.body.removeChild(contentContainer);
|
|
275
|
-
this.showingDialog = false;
|
|
276
|
-
this.eventHandler.emit("onAuthenticated");
|
|
277
|
-
if (statusElem.parentNode) {
|
|
278
|
-
statusElem.parentNode.style.display = "none";
|
|
279
|
-
}
|
|
280
|
-
} else {
|
|
281
|
-
throw new Error(json.error);
|
|
282
|
-
}
|
|
283
|
-
} catch (err) {
|
|
284
|
-
if (err && typeof err === "object") {
|
|
285
|
-
let error = err;
|
|
286
|
-
passwordElem.disabled = false;
|
|
287
|
-
passwordElem.classList.toggle("invalid", true);
|
|
288
|
-
passwordElem.value = "";
|
|
289
|
-
passwordElem.focus();
|
|
290
|
-
statusElem.innerText = error.message ? error.message : String(error);
|
|
291
|
-
if (statusElem.parentNode) {
|
|
292
|
-
statusElem.parentNode.style.display = "initial";
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
};
|
|
297
|
-
signInElem.addEventListener("click", doLogin);
|
|
298
|
-
passwordElem.addEventListener("keyup", (evt) => {
|
|
299
|
-
if (evt.key === "Enter") {
|
|
300
|
-
doLogin();
|
|
301
|
-
}
|
|
302
|
-
});
|
|
303
|
-
passwordElem.addEventListener("change", (evt) => {
|
|
304
|
-
if (evt.key === "Enter") {
|
|
305
|
-
doLogin();
|
|
306
|
-
}
|
|
307
|
-
});
|
|
308
|
-
userElem.addEventListener("keyup", (evt) => {
|
|
309
|
-
if (evt.key === "Enter") {
|
|
310
|
-
doLogin();
|
|
311
|
-
}
|
|
312
|
-
});
|
|
313
|
-
userElem.addEventListener("change", (evt) => {
|
|
314
|
-
if (evt.key === "Enter") {
|
|
315
|
-
doLogin();
|
|
316
|
-
}
|
|
317
|
-
});
|
|
318
|
-
passwordElem.focus();
|
|
69
|
+
authenticated() {
|
|
70
|
+
this.eventHandler.emit("onAuthenticated");
|
|
71
|
+
}
|
|
72
|
+
async expired(callback, type) {
|
|
73
|
+
let authPromise = new Promise((resolve) => {
|
|
74
|
+
let eventHandler = () => {
|
|
75
|
+
this.eventHandler.off("onAuthenticated", eventHandler);
|
|
76
|
+
callback == null ? void 0 : callback();
|
|
77
|
+
resolve();
|
|
78
|
+
};
|
|
79
|
+
this.eventHandler.on("onAuthenticated", eventHandler);
|
|
80
|
+
});
|
|
81
|
+
let dialog = document.querySelector("dialog.session-expired-dialog");
|
|
82
|
+
if (!dialog) {
|
|
83
|
+
dialog = document.createElement("dialog");
|
|
84
|
+
dialog.className = "session-expired-dialog";
|
|
85
|
+
dialog.style.display = "flex";
|
|
86
|
+
dialog.style.padding = "0";
|
|
87
|
+
dialog.style.left = "50%";
|
|
88
|
+
dialog.style.transform = "translateX(-50%)";
|
|
89
|
+
let link = "/login?ReturnUrl=%2fapi/sessionexpired/remove";
|
|
90
|
+
if (type !== "RequireTwoFactor") {
|
|
91
|
+
await fetch("/logout", { method: "POST" });
|
|
92
|
+
} else {
|
|
93
|
+
link = "/login?RequireTwoFactor=1&ReturnUrl=%2fapi/sessionexpired/remove";
|
|
319
94
|
}
|
|
95
|
+
dialog.innerHTML = `<iframe sandbox="allow-same-origin allow-scripts allow-modals allow-top-navigation-by-user-activation allow-forms" src="${link}" style="border:0;width:min(500px,100vw);height:min(700px, 100vh);"></iframe>`;
|
|
96
|
+
document.body.append(dialog);
|
|
97
|
+
dialog.showModal();
|
|
98
|
+
await authPromise;
|
|
99
|
+
dialog.remove();
|
|
100
|
+
} else {
|
|
101
|
+
await authPromise;
|
|
320
102
|
}
|
|
321
103
|
}
|
|
322
104
|
attachEvent(eventName, handler) {
|
|
@@ -326,11 +108,6 @@ var _SessionHandler = class {
|
|
|
326
108
|
return this.eventHandler.off(eventName, handler);
|
|
327
109
|
}
|
|
328
110
|
};
|
|
329
|
-
var SessionHandler = _SessionHandler;
|
|
330
|
-
__publicField(SessionHandler, "messages", {
|
|
331
|
-
login: "Log in",
|
|
332
|
-
relog: "Session expired - log in"
|
|
333
|
-
});
|
|
334
111
|
|
|
335
112
|
// src/UserSession.ts
|
|
336
113
|
var UserSession = class extends SessionHandler {
|
|
@@ -355,7 +132,6 @@ var UserSession = class extends SessionHandler {
|
|
|
355
132
|
__publicField(this, "shortDateFormat", "dd.MM.yyyy");
|
|
356
133
|
__publicField(this, "culture", "en-GB");
|
|
357
134
|
__publicField(this, "uiculture", "en-GB");
|
|
358
|
-
__publicField(this, "expired", () => null);
|
|
359
135
|
this.formats = {};
|
|
360
136
|
Object.assign(this, userData);
|
|
361
137
|
}
|
|
@@ -425,7 +201,6 @@ async function downloadRequest(request, { fileName, signal, onProgress }) {
|
|
|
425
201
|
});
|
|
426
202
|
response = new Response(stream);
|
|
427
203
|
} catch (error) {
|
|
428
|
-
console.warn("Failed to replace response stream to log download progress.");
|
|
429
204
|
}
|
|
430
205
|
const blob = await response.blob();
|
|
431
206
|
reportProgress({ bytesReceived, status: "downloaded" });
|
|
@@ -440,6 +215,11 @@ async function downloadRequest(request, { fileName, signal, onProgress }) {
|
|
|
440
215
|
}
|
|
441
216
|
}
|
|
442
217
|
|
|
218
|
+
// src/has.ts
|
|
219
|
+
function has(obj, key) {
|
|
220
|
+
return Object.prototype.hasOwnProperty.call(obj, key);
|
|
221
|
+
}
|
|
222
|
+
|
|
443
223
|
// src/parseFunc.ts
|
|
444
224
|
var funcRegex = /^function(?:\s+([a-zA-Z$_][a-zA-Z0-9$_]*))?\s*\(((?:(?:\s*[a-zA-Z$_][a-zA-Z0-9$_]*)(?:\s*,\s*[a-zA-Z$_][a-zA-Z0-9$_]*)*)?)\s*\)\s*\{((?:.|\n|\r)*)\}$/;
|
|
445
225
|
function parseFunc(func) {
|
|
@@ -468,19 +248,10 @@ function requireNamespace(root, namespace) {
|
|
|
468
248
|
current = current[namespace[i]] = current[namespace[i]] || new Namespace_default();
|
|
469
249
|
}
|
|
470
250
|
return current;
|
|
471
|
-
} else {
|
|
472
|
-
throw new TypeError("Invalid type of parameter 'namespace'");
|
|
473
251
|
}
|
|
474
|
-
} else {
|
|
475
|
-
throw new TypeError("Invalid type of parameter 'root'");
|
|
476
252
|
}
|
|
477
253
|
}
|
|
478
254
|
|
|
479
|
-
// src/warn.ts
|
|
480
|
-
function warn(message, fallbackToAlert) {
|
|
481
|
-
console.warn(message);
|
|
482
|
-
}
|
|
483
|
-
|
|
484
255
|
// src/expose.ts
|
|
485
256
|
function expose(name, value) {
|
|
486
257
|
if (arguments.length !== 2) {
|
|
@@ -516,38 +287,95 @@ function expose(name, value) {
|
|
|
516
287
|
throw new TypeError("Invalid typeof parameter 'name', or unable to parse pValue!");
|
|
517
288
|
}
|
|
518
289
|
if (has(namespace, keyName)) {
|
|
519
|
-
warn([name, keyName].join(".") + " is already defined!");
|
|
290
|
+
console.warn([name, keyName].join(".") + " is already defined!");
|
|
520
291
|
} else {
|
|
521
292
|
namespace[keyName] = value;
|
|
522
293
|
}
|
|
523
294
|
}
|
|
524
295
|
}
|
|
525
296
|
|
|
297
|
+
// src/getLocalizedString.ts
|
|
298
|
+
async function fetchLocalizedString(text) {
|
|
299
|
+
try {
|
|
300
|
+
let response = await fetch(`/api/user/localize/new/${af.article.id}`, {
|
|
301
|
+
body: JSON.stringify({ text }),
|
|
302
|
+
headers: {
|
|
303
|
+
Accept: "application/json; */*",
|
|
304
|
+
"Content-Type": "application/json",
|
|
305
|
+
"X-Requested-With": "XMLHttpRequest"
|
|
306
|
+
},
|
|
307
|
+
method: "POST"
|
|
308
|
+
});
|
|
309
|
+
if (response.ok) {
|
|
310
|
+
return await response.json();
|
|
311
|
+
}
|
|
312
|
+
} catch (error) {
|
|
313
|
+
}
|
|
314
|
+
return text;
|
|
315
|
+
}
|
|
316
|
+
function getLocalizedString(string, wait) {
|
|
317
|
+
var _a;
|
|
318
|
+
if (typeof string === "string" && string.trim().length === 0) {
|
|
319
|
+
return string;
|
|
320
|
+
}
|
|
321
|
+
if (string === void 0 || string === "" || string === null) {
|
|
322
|
+
return;
|
|
323
|
+
}
|
|
324
|
+
if (((_a = af == null ? void 0 : af.article) == null ? void 0 : _a.i18n) !== void 0) {
|
|
325
|
+
if (!has(af.article.i18n, string)) {
|
|
326
|
+
af.article.i18n[string] = string;
|
|
327
|
+
let promise = fetchLocalizedString(string).then((text) => {
|
|
328
|
+
af.article.i18n[string] = text;
|
|
329
|
+
return text;
|
|
330
|
+
});
|
|
331
|
+
if (wait) {
|
|
332
|
+
return promise;
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
return af.article.i18n[string];
|
|
336
|
+
} else {
|
|
337
|
+
return string;
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
// src/localize.ts
|
|
342
|
+
function localize(stringParts, ...args) {
|
|
343
|
+
if (!Array.isArray(stringParts) || (stringParts == null ? void 0 : stringParts.length) || stringParts.length !== args.length + 1) {
|
|
344
|
+
throw TypeError("Method 'localize' must be used as a tag function");
|
|
345
|
+
}
|
|
346
|
+
let stringToLocalize = stringParts.map((s, i) => i === stringParts.length - 1 ? s : `${s}$${i}`).join("");
|
|
347
|
+
let localized = getLocalizedString(stringToLocalize);
|
|
348
|
+
args.forEach((arg, index) => {
|
|
349
|
+
localized = localized.replace("$" + index, arg);
|
|
350
|
+
});
|
|
351
|
+
return localized;
|
|
352
|
+
}
|
|
353
|
+
|
|
526
354
|
// src/localStorage.ts
|
|
527
|
-
function getLocalKey(
|
|
355
|
+
function getLocalKey(key) {
|
|
528
356
|
var _a;
|
|
529
|
-
return [((_a = af == null ? void 0 : af.article) == null ? void 0 : _a.id) || "", "common",
|
|
357
|
+
return [((_a = af == null ? void 0 : af.article) == null ? void 0 : _a.id) || "", "common", key].join(".");
|
|
530
358
|
}
|
|
531
359
|
var LocalStorage = class {
|
|
532
360
|
isPersisted() {
|
|
533
361
|
return true;
|
|
534
362
|
}
|
|
535
|
-
getLocalStorageKey(
|
|
536
|
-
return global ? ["common",
|
|
363
|
+
getLocalStorageKey(key, global) {
|
|
364
|
+
return global ? ["common", key].join(".") : getLocalKey(key);
|
|
537
365
|
}
|
|
538
|
-
get(
|
|
539
|
-
const lsKey = this.getLocalStorageKey(
|
|
366
|
+
get(key, defaultValue, global) {
|
|
367
|
+
const lsKey = this.getLocalStorageKey(key, global);
|
|
540
368
|
const value = localStorage.getItem(lsKey);
|
|
541
369
|
return value !== null ? JSON.parse(value) : defaultValue;
|
|
542
370
|
}
|
|
543
|
-
set(
|
|
371
|
+
set(key, value, global) {
|
|
544
372
|
localStorage.setItem(
|
|
545
|
-
this.getLocalStorageKey(
|
|
373
|
+
this.getLocalStorageKey(key, global),
|
|
546
374
|
JSON.stringify(value)
|
|
547
375
|
);
|
|
548
376
|
}
|
|
549
|
-
remove(
|
|
550
|
-
const lsKey = this.getLocalStorageKey(
|
|
377
|
+
remove(key, global) {
|
|
378
|
+
const lsKey = this.getLocalStorageKey(key, global);
|
|
551
379
|
if (localStorage.getItem(lsKey) !== null) {
|
|
552
380
|
localStorage.removeItem(lsKey);
|
|
553
381
|
return true;
|
|
@@ -557,9 +385,9 @@ var LocalStorage = class {
|
|
|
557
385
|
}
|
|
558
386
|
clear() {
|
|
559
387
|
const baseKey = getLocalKey("");
|
|
560
|
-
for (let
|
|
561
|
-
if (
|
|
562
|
-
localStorage.removeItem(
|
|
388
|
+
for (let key in localStorage) {
|
|
389
|
+
if (key.slice(0, baseKey.length) === baseKey) {
|
|
390
|
+
localStorage.removeItem(key);
|
|
563
391
|
}
|
|
564
392
|
}
|
|
565
393
|
}
|
|
@@ -574,8 +402,8 @@ function getKey(article) {
|
|
|
574
402
|
function getSettings(setting, article) {
|
|
575
403
|
if (!(af == null ? void 0 : af.userSession))
|
|
576
404
|
return null;
|
|
577
|
-
const
|
|
578
|
-
const settings = JSON.parse(localStorage.getItem(
|
|
405
|
+
const key = getKey(article);
|
|
406
|
+
const settings = JSON.parse(localStorage.getItem(key) || "{}");
|
|
579
407
|
if (setting) {
|
|
580
408
|
return settings[setting] || null;
|
|
581
409
|
}
|
|
@@ -584,18 +412,18 @@ function getSettings(setting, article) {
|
|
|
584
412
|
function saveSettings(setting, value, article) {
|
|
585
413
|
if (!(af == null ? void 0 : af.userSession))
|
|
586
414
|
return;
|
|
587
|
-
const
|
|
588
|
-
let userSettings = JSON.parse(localStorage.getItem(
|
|
415
|
+
const key = getKey(article);
|
|
416
|
+
let userSettings = JSON.parse(localStorage.getItem(key) || "{}");
|
|
589
417
|
if (typeof value !== "undefined") {
|
|
590
418
|
userSettings[setting] = value;
|
|
591
419
|
} else {
|
|
592
420
|
userSettings = setting;
|
|
593
421
|
}
|
|
594
|
-
localStorage.setItem(
|
|
422
|
+
localStorage.setItem(key, JSON.stringify(userSettings));
|
|
595
423
|
}
|
|
596
424
|
|
|
597
425
|
// src/index.ts
|
|
598
|
-
var version = "2.0
|
|
426
|
+
var version = "2.1.0";
|
|
599
427
|
export {
|
|
600
428
|
SessionHandler,
|
|
601
429
|
UserSession,
|
|
@@ -606,6 +434,7 @@ export {
|
|
|
606
434
|
getSettings,
|
|
607
435
|
has,
|
|
608
436
|
localStorage_default as localStorage,
|
|
437
|
+
localize,
|
|
609
438
|
mitt_default as mitt,
|
|
610
439
|
saveSettings,
|
|
611
440
|
version
|
|
@@ -1,48 +1,2 @@
|
|
|
1
|
-
var
|
|
2
|
-
if (af.userSession.uiculture === 'nb-NO') {
|
|
3
|
-
const strings = {
|
|
4
|
-
${e.join(`
|
|
5
|
-
`)}
|
|
6
|
-
};
|
|
7
|
-
af.article.i18n = af.article.i18n || {};
|
|
8
|
-
Object.assign(af.article.i18n, strings);
|
|
9
|
-
}`:`<script type="text/javascript">
|
|
10
|
-
function __doNothingWithStrings() {
|
|
11
|
-
@{
|
|
12
|
-
var context = @Appframe.Web.Context.RequestContext.Current;
|
|
13
|
-
}
|
|
14
|
-
let s = {};
|
|
15
|
-
${e.join(`
|
|
16
|
-
`)}
|
|
17
|
-
return s;
|
|
18
|
-
}
|
|
19
|
-
<\/script>`})}}function h(t){let e=O(t);return e===t&&!y.has(t)&&y.add(t),e}var b=class{constructor(){i(this,"eventHandler",_());i(this,"showingDialog",!1);i(this,"dialog",null)}expired(e){if(af.userSession=af.userSession||{login:null},typeof e!="function")throw new TypeError("Parameter pCallback passed to the expired function must be a function!");let n=()=>{this.detachEvent("onAuthenticated",n),e()};if(this.attachEvent("onAuthenticated",n),this.showingDialog!==!0){this.showingDialog=!0;let r=document.createElement("div");r.className="session-expired-container",r.innerHTML=`
|
|
20
|
-
<div class="session-expired-log-in" style="margin-top: 20px;">
|
|
21
|
-
<div class="row">
|
|
22
|
-
<div class="sessionExpired">
|
|
23
|
-
<h4 class="message">Frakoblet - tidsavbrudd</h4>
|
|
24
|
-
<div class="form-group">
|
|
25
|
-
<label for="username">${h("Username")}</label>
|
|
26
|
-
<input type="text" class="form-control" id="username" autofocus>
|
|
27
|
-
</div>
|
|
28
|
-
<div class="form-group">
|
|
29
|
-
<label for="password">${h("Password")}</label>
|
|
30
|
-
<input type="password" autocomplete="password" class="form-control" id="password" >
|
|
31
|
-
</div>
|
|
32
|
-
<div class="form-group">
|
|
33
|
-
<div>
|
|
34
|
-
<button type="submit" class="btn btn-default sign-in">
|
|
35
|
-
${h("Log in")}
|
|
36
|
-
</button>
|
|
37
|
-
</div>
|
|
38
|
-
</div>
|
|
39
|
-
</div>
|
|
40
|
-
</div>
|
|
41
|
-
<div class="row">
|
|
42
|
-
<div class="" style="display:none; margin: 0px 30px;">
|
|
43
|
-
<div class="alert alert-warning" role="alert" style="margin-top:10px;"></div>
|
|
44
|
-
</div>
|
|
45
|
-
</div>
|
|
46
|
-
</div>
|
|
47
|
-
`;let o=af.userSession.login?b.messages.relog:b.messages.login,l=r.querySelector(".message"),a=r.querySelector(".alert-warning"),s=r.querySelector("input[type=text]"),f=r.querySelector(".sign-in"),c=r.querySelector("input[type=password]");if(l!==null&&s!==null&&a!==null&&s!==null&&f!==null&&c!==null){l.innerText=h(o),s.value=af.userSession.login||"",s.disabled=!!af.userSession.login,s.readOnly=!!af.userSession.login,document.body.appendChild(r);let g=async()=>{c.disabled=!0;let d=new Request("/login",{body:JSON.stringify({username:s.value,password:c.value,remember:!1}),headers:{Accept:"application/json","Content-Type":"application/json; charset=utf-8","X-Requested-With":"XMLHttpRequest"},method:"POST"});try{let u=await(await fetch(d)).json();if(u.success)document.body.removeChild(r),this.showingDialog=!1,this.eventHandler.emit("onAuthenticated"),a.parentNode&&(a.parentNode.style.display="none");else throw new Error(u.error)}catch(p){if(p&&typeof p=="object"){let u=p;c.disabled=!1,c.classList.toggle("invalid",!0),c.value="",c.focus(),a.innerText=u.message?u.message:String(u),a.parentNode&&(a.parentNode.style.display="initial")}}};f.addEventListener("click",g),c.addEventListener("keyup",d=>{d.key==="Enter"&&g()}),c.addEventListener("change",d=>{d.key==="Enter"&&g()}),s.addEventListener("keyup",d=>{d.key==="Enter"&&g()}),s.addEventListener("change",d=>{d.key==="Enter"&&g()}),c.focus()}}}attachEvent(e,n){return this.eventHandler.on(e,n)}detachEvent(e,n){return this.eventHandler.off(e,n)}},m=b;i(m,"messages",{login:"Log in",relog:"Session expired - log in"});var v=class extends m{constructor(n){super();i(this,"amDesignator","a.m.");i(this,"dayNames",["sunday","monday","tuesday","wednesday","thursday","friday","saturday"]);i(this,"dayNamesShort",["sun","mon","tue","wed","thu","fri","sat"]);i(this,"decimalSeparator",".");i(this,"domain","OB");i(this,"email");i(this,"formats");i(this,"groupSeparator",null);i(this,"integratedSecurity",!1);i(this,"isDeveloper",!1);i(this,"login","");i(this,"loginType");i(this,"monthNames",["january","february","march","april","may","june","july","august","september","october","november","december",""]);i(this,"monthNamesShort",["jan","feb","mar","apr","may","jun","jul","augt","sep","oct","nov","dec",""]);i(this,"name");i(this,"pmDesignator","p.m.");i(this,"shortDateFormat","dd.MM.yyyy");i(this,"culture","en-GB");i(this,"uiculture","en-GB");i(this,"expired",()=>null);this.formats={},Object.assign(this,n)}};function A(t,e){return new Promise(function(n,r){try{let o=URL.createObjectURL(t),l=document.body,a=document.createElement("a");a.setAttribute("download",e),a.href=o,l.append(a),a.click(),l.removeChild(a),setTimeout(function(){URL.revokeObjectURL(o),n()},250)}catch(o){r(o)}})}async function le(t,{fileName:e,signal:n,onProgress:r}){var a;function o(s){typeof r=="function"&&r(k({},s))}let l=0;o({status:"requested"});try{let s=await fetch(t);if(!s.ok||!s.body){if((a=s.headers.get("content-type"))!=null&&a.includes("application/json")){let c=await s.json();if(c.error)throw new Error(c.error)}throw new Error(`${s.status} ${s.statusText}`)}try{let c=s.body.getReader(),g=new ReadableStream({start:function(d){function p(){return c.read().then(function(u){if(u.done){d.close();return}return l+=u.value.length,o({bytesReceived:l,status:"downloading"}),d.enqueue(u.value),p()})}return p()}});s=new Response(g)}catch(c){console.warn("Failed to replace response stream to log download progress.")}let f=await s.blob();o({bytesReceived:l,status:"downloaded"}),await A(f,e),o({bytesReceived:l,status:"completed"})}catch(s){n!=null&&n.aborted?o({status:"cancelled"}):o({error:s.message,status:"error"})}}var W=/^function(?:\s+([a-zA-Z$_][a-zA-Z0-9$_]*))?\s*\(((?:(?:\s*[a-zA-Z$_][a-zA-Z0-9$_]*)(?:\s*,\s*[a-zA-Z$_][a-zA-Z0-9$_]*)*)?)\s*\)\s*\{((?:.|\n|\r)*)\}$/;function x(t){var e=t.toString().match(W);if(e===null)throw new TypeError("Unable to parse function!");return{name:e[1],args:e[2].split(","),body:e[3]}}function H(){}H.prototype=Object.create(null);var q=H;function E(t,e){if(typeof t=="object")if(typeof e=="string"){let n=e.split(".");return E(t,n)}else if(Array.isArray(e)){let n=t;for(let r=0;r<e.length;r++)n=n[e[r]]=n[e[r]]||new q;return n}else throw new TypeError("Invalid type of parameter 'namespace'");else throw new TypeError("Invalid type of parameter 'root'")}function N(t,e){console.warn(t)}function j(t,e){if(arguments.length!==2)throw new Error("Incorrect number of arguments passed to the expose function!");if(Array.isArray(e))for(let n of e){let{name:r}=x(n);if(r)j(t,n);else throw new Error("Unable to detect name of function! Name it, or only supply one function and include name in first parameter.")}else{let n,r;if(typeof e=="function"&&(n=x(e).name),typeof t=="string"){let o=t.split(".");n||(n=o[o.length-1],o=o.slice(0,o.length-1)),r=E(window,o)}else if(n&&(typeof t=="object"||typeof t=="function"))r=t;else throw new TypeError("Invalid typeof parameter 'name', or unable to parse pValue!");S(r,n)?N([t,n].join(".")+" is already defined!"):r[n]=e}}function $(t){var e;return[((e=af==null?void 0:af.article)==null?void 0:e.id)||"","common",t].join(".")}var T=class{isPersisted(){return!0}getLocalStorageKey(e,n){return n?["common",e].join("."):$(e)}get(e,n,r){let o=this.getLocalStorageKey(e,r),l=localStorage.getItem(o);return l!==null?JSON.parse(l):n}set(e,n,r){localStorage.setItem(this.getLocalStorageKey(e,r),JSON.stringify(n))}remove(e,n){let r=this.getLocalStorageKey(e,n);return localStorage.getItem(r)!==null?(localStorage.removeItem(r),!0):!1}clear(){let e=$("");for(let n in localStorage)n.slice(0,e.length)===e&&localStorage.removeItem(n)}},F=new T;function D(t){return`${t||af.article.id}.${af.userSession.login}`}function xe(t,e){if(!(af!=null&&af.userSession))return null;let n=D(e),r=JSON.parse(localStorage.getItem(n)||"{}");return t?r[t]||null:r}function Ee(t,e,n){if(!(af!=null&&af.userSession))return;let r=D(n),o=JSON.parse(localStorage.getItem(r)||"{}");typeof e<"u"?o[t]=e:o=t,localStorage.setItem(r,JSON.stringify(o))}var Ne="2.0.3";export{m as SessionHandler,v as UserSession,A as downloadBlob,le as downloadRequest,j as expose,h as getLocalizedString,xe as getSettings,S as has,F as localStorage,_ as mitt,Ee as saveSettings,Ne as version};
|
|
1
|
+
var H=Object.defineProperty;var L=Object.getOwnPropertySymbols;var _=Object.prototype.hasOwnProperty,$=Object.prototype.propertyIsEnumerable;var p=(t,e,r)=>e in t?H(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,j=(t,e)=>{for(var r in e||(e={}))_.call(e,r)&&p(t,r,e[r]);if(L)for(var r of L(e))$.call(e,r)&&p(t,r,e[r]);return t};var a=(t,e,r)=>(p(t,typeof e!="symbol"?e+"":e,r),r);window.addEventListener("error",t=>{var e,r,n,o,i,l,s;try{let d={error:(n=(r=(e=t.error)==null?void 0:e.message)!=null?r:t.message)!=null?n:null,file:t.filename,line:(o=t.lineno)!=null?o:0,column:(i=t.colno)!=null?i:0,stack:(s=(l=t.error)==null?void 0:l.stack)!=null?s:null};fetch("/data/Logger/LogError",{body:JSON.stringify(d),headers:{Accept:"application/json","Content-Type":"application/json; charset=utf-8","X-Requested-With":"XMLHttpRequest"},method:"POST"})}catch(d){}});function m(t){return{all:t=t||new Map,on:function(e,r){var n=t.get(e);n?n.push(r):t.set(e,[r])},off:function(e,r){var n=t.get(e);n&&(r?n.splice(n.indexOf(r)>>>0,1):t.set(e,[]))},emit:function(e,r){var n=t.get(e);n&&n.slice().map(function(o){o(r)}),(n=t.get("*"))&&n.slice().map(function(o){o(e,r)})}}}var c=class{constructor(){a(this,"eventHandler",m())}authenticated(){this.eventHandler.emit("onAuthenticated")}async expired(e,r){let n=new Promise(i=>{let l=()=>{this.eventHandler.off("onAuthenticated",l),e==null||e(),i()};this.eventHandler.on("onAuthenticated",l)}),o=document.querySelector("dialog.session-expired-dialog");if(o)await n;else{o=document.createElement("dialog"),o.className="session-expired-dialog",o.style.display="flex",o.style.padding="0",o.style.left="50%",o.style.transform="translateX(-50%)";let i="/login?ReturnUrl=%2fapi/sessionexpired/remove";r!=="RequireTwoFactor"?await fetch("/logout",{method:"POST"}):i="/login?RequireTwoFactor=1&ReturnUrl=%2fapi/sessionexpired/remove",o.innerHTML=`<iframe sandbox="allow-same-origin allow-scripts allow-modals allow-top-navigation-by-user-activation allow-forms" src="${i}" style="border:0;width:min(500px,100vw);height:min(700px, 100vh);"></iframe>`,document.body.append(o),o.showModal(),await n,o.remove()}}attachEvent(e,r){return this.eventHandler.on(e,r)}detachEvent(e,r){return this.eventHandler.off(e,r)}};var y=class extends c{constructor(r){super();a(this,"amDesignator","a.m.");a(this,"dayNames",["sunday","monday","tuesday","wednesday","thursday","friday","saturday"]);a(this,"dayNamesShort",["sun","mon","tue","wed","thu","fri","sat"]);a(this,"decimalSeparator",".");a(this,"domain","OB");a(this,"email");a(this,"formats");a(this,"groupSeparator",null);a(this,"integratedSecurity",!1);a(this,"isDeveloper",!1);a(this,"login","");a(this,"loginType");a(this,"monthNames",["january","february","march","april","may","june","july","august","september","october","november","december",""]);a(this,"monthNamesShort",["jan","feb","mar","apr","may","jun","jul","augt","sep","oct","nov","dec",""]);a(this,"name");a(this,"pmDesignator","p.m.");a(this,"shortDateFormat","dd.MM.yyyy");a(this,"culture","en-GB");a(this,"uiculture","en-GB");this.formats={},Object.assign(this,r)}};function h(t,e){return new Promise(function(r,n){try{let o=URL.createObjectURL(t),i=document.body,l=document.createElement("a");l.setAttribute("download",e),l.href=o,i.append(l),l.click(),i.removeChild(l),setTimeout(function(){URL.revokeObjectURL(o),r()},250)}catch(o){n(o)}})}async function G(t,{fileName:e,signal:r,onProgress:n}){var l;function o(s){typeof n=="function"&&n(j({},s))}let i=0;o({status:"requested"});try{let s=await fetch(t);if(!s.ok||!s.body){if((l=s.headers.get("content-type"))!=null&&l.includes("application/json")){let u=await s.json();if(u.error)throw new Error(u.error)}throw new Error(`${s.status} ${s.statusText}`)}try{let u=s.body.getReader(),O=new ReadableStream({start:function(v){function A(){return u.read().then(function(g){if(g.done){v.close();return}return i+=g.value.length,o({bytesReceived:i,status:"downloading"}),v.enqueue(g.value),A()})}return A()}});s=new Response(O)}catch(u){}let d=await s.blob();o({bytesReceived:i,status:"downloaded"}),await h(d,e),o({bytesReceived:i,status:"completed"})}catch(s){r!=null&&r.aborted?o({status:"cancelled"}):o({error:s.message,status:"error"})}}function f(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var q=/^function(?:\s+([a-zA-Z$_][a-zA-Z0-9$_]*))?\s*\(((?:(?:\s*[a-zA-Z$_][a-zA-Z0-9$_]*)(?:\s*,\s*[a-zA-Z$_][a-zA-Z0-9$_]*)*)?)\s*\)\s*\{((?:.|\n|\r)*)\}$/;function w(t){var e=t.toString().match(q);if(e===null)throw new TypeError("Unable to parse function!");return{name:e[1],args:e[2].split(","),body:e[3]}}function E(){}E.prototype=Object.create(null);var z=E;function S(t,e){if(typeof t=="object"){if(typeof e=="string"){let r=e.split(".");return S(t,r)}else if(Array.isArray(e)){let r=t;for(let n=0;n<e.length;n++)r=r[e[n]]=r[e[n]]||new z;return r}}}function R(t,e){if(arguments.length!==2)throw new Error("Incorrect number of arguments passed to the expose function!");if(Array.isArray(e))for(let r of e){let{name:n}=w(r);if(n)R(t,r);else throw new Error("Unable to detect name of function! Name it, or only supply one function and include name in first parameter.")}else{let r,n;if(typeof e=="function"&&(r=w(e).name),typeof t=="string"){let o=t.split(".");r||(r=o[o.length-1],o=o.slice(0,o.length-1)),n=S(window,o)}else if(r&&(typeof t=="object"||typeof t=="function"))n=t;else throw new TypeError("Invalid typeof parameter 'name', or unable to parse pValue!");f(n,r)?console.warn([t,r].join(".")+" is already defined!"):n[r]=e}}async function I(t){try{let e=await fetch(`/api/user/localize/new/${af.article.id}`,{body:JSON.stringify({text:t}),headers:{Accept:"application/json; */*","Content-Type":"application/json","X-Requested-With":"XMLHttpRequest"},method:"POST"});if(e.ok)return await e.json()}catch(e){}return t}function b(t,e){var r;if(typeof t=="string"&&t.trim().length===0)return t;if(!(t===void 0||t===""||t===null))if(((r=af==null?void 0:af.article)==null?void 0:r.i18n)!==void 0){if(!f(af.article.i18n,t)){af.article.i18n[t]=t;let n=I(t).then(o=>(af.article.i18n[t]=o,o));if(e)return n}return af.article.i18n[t]}else return t}function D(t,...e){if(!Array.isArray(t)||(t==null?void 0:t.length)||t.length!==e.length+1)throw TypeError("Method 'localize' must be used as a tag function");let r=t.map((o,i)=>i===t.length-1?o:`${o}$${i}`).join(""),n=b(r);return e.forEach((o,i)=>{n=n.replace("$"+i,o)}),n}function N(t){var e;return[((e=af==null?void 0:af.article)==null?void 0:e.id)||"","common",t].join(".")}var x=class{isPersisted(){return!0}getLocalStorageKey(e,r){return r?["common",e].join("."):N(e)}get(e,r,n){let o=this.getLocalStorageKey(e,n),i=localStorage.getItem(o);return i!==null?JSON.parse(i):r}set(e,r,n){localStorage.setItem(this.getLocalStorageKey(e,n),JSON.stringify(r))}remove(e,r){let n=this.getLocalStorageKey(e,r);return localStorage.getItem(n)!==null?(localStorage.removeItem(n),!0):!1}clear(){let e=N("");for(let r in localStorage)r.slice(0,e.length)===e&&localStorage.removeItem(r)}},K=new x;function T(t){return`${t||af.article.id}.${af.userSession.login}`}function pe(t,e){if(!(af!=null&&af.userSession))return null;let r=T(e),n=JSON.parse(localStorage.getItem(r)||"{}");return t?n[t]||null:n}function me(t,e,r){if(!(af!=null&&af.userSession))return;let n=T(r),o=JSON.parse(localStorage.getItem(n)||"{}");typeof e<"u"?o[t]=e:o=t,localStorage.setItem(n,JSON.stringify(o))}var Se="2.1.0";export{c as SessionHandler,y as UserSession,h as downloadBlob,G as downloadRequest,R as expose,b as getLocalizedString,pe as getSettings,f as has,K as localStorage,D as localize,m as mitt,me as saveSettings,Se as version};
|
|
48
2
|
//# sourceMappingURL=af.common.legacy.min.js.map
|