mirror of
https://github.com/kanidm/kanidm.git
synced 2025-02-24 04:57:00 +01:00
878 lines
34 KiB
JavaScript
878 lines
34 KiB
JavaScript
import { modal_hide_by_id } from '/pkg/wasmloader.js';
|
|
|
|
let wasm;
|
|
|
|
const heap = new Array(32).fill(undefined);
|
|
|
|
heap.push(undefined, null, true, false);
|
|
|
|
function getObject(idx) { return heap[idx]; }
|
|
|
|
let WASM_VECTOR_LEN = 0;
|
|
|
|
let cachedUint8Memory0 = new Uint8Array();
|
|
|
|
function getUint8Memory0() {
|
|
if (cachedUint8Memory0.byteLength === 0) {
|
|
cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
|
|
}
|
|
return cachedUint8Memory0;
|
|
}
|
|
|
|
const cachedTextEncoder = new TextEncoder('utf-8');
|
|
|
|
const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
|
|
? function (arg, view) {
|
|
return cachedTextEncoder.encodeInto(arg, view);
|
|
}
|
|
: function (arg, view) {
|
|
const buf = cachedTextEncoder.encode(arg);
|
|
view.set(buf);
|
|
return {
|
|
read: arg.length,
|
|
written: buf.length
|
|
};
|
|
});
|
|
|
|
function passStringToWasm0(arg, malloc, realloc) {
|
|
|
|
if (realloc === undefined) {
|
|
const buf = cachedTextEncoder.encode(arg);
|
|
const ptr = malloc(buf.length);
|
|
getUint8Memory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
WASM_VECTOR_LEN = buf.length;
|
|
return ptr;
|
|
}
|
|
|
|
let len = arg.length;
|
|
let ptr = malloc(len);
|
|
|
|
const mem = getUint8Memory0();
|
|
|
|
let offset = 0;
|
|
|
|
for (; offset < len; offset++) {
|
|
const code = arg.charCodeAt(offset);
|
|
if (code > 0x7F) break;
|
|
mem[ptr + offset] = code;
|
|
}
|
|
|
|
if (offset !== len) {
|
|
if (offset !== 0) {
|
|
arg = arg.slice(offset);
|
|
}
|
|
ptr = realloc(ptr, len, len = offset + arg.length * 3);
|
|
const view = getUint8Memory0().subarray(ptr + offset, ptr + len);
|
|
const ret = encodeString(arg, view);
|
|
|
|
offset += ret.written;
|
|
}
|
|
|
|
WASM_VECTOR_LEN = offset;
|
|
return ptr;
|
|
}
|
|
|
|
let cachedInt32Memory0 = new Int32Array();
|
|
|
|
function getInt32Memory0() {
|
|
if (cachedInt32Memory0.byteLength === 0) {
|
|
cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
|
|
}
|
|
return cachedInt32Memory0;
|
|
}
|
|
|
|
function isLikeNone(x) {
|
|
return x === undefined || x === null;
|
|
}
|
|
|
|
let heap_next = heap.length;
|
|
|
|
function addHeapObject(obj) {
|
|
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
const idx = heap_next;
|
|
heap_next = heap[idx];
|
|
|
|
heap[idx] = obj;
|
|
return idx;
|
|
}
|
|
|
|
const cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
|
|
cachedTextDecoder.decode();
|
|
|
|
function getStringFromWasm0(ptr, len) {
|
|
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
|
}
|
|
|
|
function dropObject(idx) {
|
|
if (idx < 36) return;
|
|
heap[idx] = heap_next;
|
|
heap_next = idx;
|
|
}
|
|
|
|
function takeObject(idx) {
|
|
const ret = getObject(idx);
|
|
dropObject(idx);
|
|
return ret;
|
|
}
|
|
|
|
let cachedFloat64Memory0 = new Float64Array();
|
|
|
|
function getFloat64Memory0() {
|
|
if (cachedFloat64Memory0.byteLength === 0) {
|
|
cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer);
|
|
}
|
|
return cachedFloat64Memory0;
|
|
}
|
|
|
|
function debugString(val) {
|
|
// primitive types
|
|
const type = typeof val;
|
|
if (type == 'number' || type == 'boolean' || val == null) {
|
|
return `${val}`;
|
|
}
|
|
if (type == 'string') {
|
|
return `"${val}"`;
|
|
}
|
|
if (type == 'symbol') {
|
|
const description = val.description;
|
|
if (description == null) {
|
|
return 'Symbol';
|
|
} else {
|
|
return `Symbol(${description})`;
|
|
}
|
|
}
|
|
if (type == 'function') {
|
|
const name = val.name;
|
|
if (typeof name == 'string' && name.length > 0) {
|
|
return `Function(${name})`;
|
|
} else {
|
|
return 'Function';
|
|
}
|
|
}
|
|
// objects
|
|
if (Array.isArray(val)) {
|
|
const length = val.length;
|
|
let debug = '[';
|
|
if (length > 0) {
|
|
debug += debugString(val[0]);
|
|
}
|
|
for(let i = 1; i < length; i++) {
|
|
debug += ', ' + debugString(val[i]);
|
|
}
|
|
debug += ']';
|
|
return debug;
|
|
}
|
|
// Test for built-in
|
|
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
|
let className;
|
|
if (builtInMatches.length > 1) {
|
|
className = builtInMatches[1];
|
|
} else {
|
|
// Failed to match the standard '[object ClassName]'
|
|
return toString.call(val);
|
|
}
|
|
if (className == 'Object') {
|
|
// we're a user defined class or Object
|
|
// JSON.stringify avoids problems with cycles, and is generally much
|
|
// easier than looping through ownProperties of `val`.
|
|
try {
|
|
return 'Object(' + JSON.stringify(val) + ')';
|
|
} catch (_) {
|
|
return 'Object';
|
|
}
|
|
}
|
|
// errors
|
|
if (val instanceof Error) {
|
|
return `${val.name}: ${val.message}\n${val.stack}`;
|
|
}
|
|
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
return className;
|
|
}
|
|
|
|
function makeMutClosure(arg0, arg1, dtor, f) {
|
|
const state = { a: arg0, b: arg1, cnt: 1, dtor };
|
|
const real = (...args) => {
|
|
// First up with a closure we increment the internal reference
|
|
// count. This ensures that the Rust closure environment won't
|
|
// be deallocated while we're invoking it.
|
|
state.cnt++;
|
|
const a = state.a;
|
|
state.a = 0;
|
|
try {
|
|
return f(a, state.b, ...args);
|
|
} finally {
|
|
if (--state.cnt === 0) {
|
|
wasm.__wbindgen_export_2.get(state.dtor)(a, state.b);
|
|
|
|
} else {
|
|
state.a = a;
|
|
}
|
|
}
|
|
};
|
|
real.original = state;
|
|
|
|
return real;
|
|
}
|
|
|
|
let stack_pointer = 32;
|
|
|
|
function addBorrowedObject(obj) {
|
|
if (stack_pointer == 1) throw new Error('out of js stack');
|
|
heap[--stack_pointer] = obj;
|
|
return stack_pointer;
|
|
}
|
|
function __wbg_adapter_30(arg0, arg1, arg2) {
|
|
try {
|
|
wasm._dyn_core__ops__function__FnMut___A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h0f7357f2a774775d(arg0, arg1, addBorrowedObject(arg2));
|
|
} finally {
|
|
heap[stack_pointer++] = undefined;
|
|
}
|
|
}
|
|
|
|
function makeClosure(arg0, arg1, dtor, f) {
|
|
const state = { a: arg0, b: arg1, cnt: 1, dtor };
|
|
const real = (...args) => {
|
|
// First up with a closure we increment the internal reference
|
|
// count. This ensures that the Rust closure environment won't
|
|
// be deallocated while we're invoking it.
|
|
state.cnt++;
|
|
try {
|
|
return f(state.a, state.b, ...args);
|
|
} finally {
|
|
if (--state.cnt === 0) {
|
|
wasm.__wbindgen_export_2.get(state.dtor)(state.a, state.b);
|
|
state.a = 0;
|
|
|
|
}
|
|
}
|
|
};
|
|
real.original = state;
|
|
|
|
return real;
|
|
}
|
|
function __wbg_adapter_33(arg0, arg1, arg2) {
|
|
wasm._dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h207c5c753184291b(arg0, arg1, addHeapObject(arg2));
|
|
}
|
|
|
|
function __wbg_adapter_36(arg0, arg1, arg2) {
|
|
wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hae7ad8c3f91d439a(arg0, arg1, addHeapObject(arg2));
|
|
}
|
|
|
|
/**
|
|
*/
|
|
export function run_app() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.run_app(retptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
if (r1) {
|
|
throw takeObject(r0);
|
|
}
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
|
|
let cachedUint32Memory0 = new Uint32Array();
|
|
|
|
function getUint32Memory0() {
|
|
if (cachedUint32Memory0.byteLength === 0) {
|
|
cachedUint32Memory0 = new Uint32Array(wasm.memory.buffer);
|
|
}
|
|
return cachedUint32Memory0;
|
|
}
|
|
|
|
function getArrayJsValueFromWasm0(ptr, len) {
|
|
const mem = getUint32Memory0();
|
|
const slice = mem.subarray(ptr / 4, ptr / 4 + len);
|
|
const result = [];
|
|
for (let i = 0; i < slice.length; i++) {
|
|
result.push(takeObject(slice[i]));
|
|
}
|
|
return result;
|
|
}
|
|
|
|
function handleError(f, args) {
|
|
try {
|
|
return f.apply(this, args);
|
|
} catch (e) {
|
|
wasm.__wbindgen_exn_store(addHeapObject(e));
|
|
}
|
|
}
|
|
|
|
async function load(module, imports) {
|
|
if (typeof Response === 'function' && module instanceof Response) {
|
|
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
try {
|
|
return await WebAssembly.instantiateStreaming(module, imports);
|
|
|
|
} catch (e) {
|
|
if (module.headers.get('Content-Type') != 'application/wasm') {
|
|
console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
|
|
|
|
} else {
|
|
throw e;
|
|
}
|
|
}
|
|
}
|
|
|
|
const bytes = await module.arrayBuffer();
|
|
return await WebAssembly.instantiate(bytes, imports);
|
|
|
|
} else {
|
|
const instance = await WebAssembly.instantiate(module, imports);
|
|
|
|
if (instance instanceof WebAssembly.Instance) {
|
|
return { instance, module };
|
|
|
|
} else {
|
|
return instance;
|
|
}
|
|
}
|
|
}
|
|
|
|
function getImports() {
|
|
const imports = {};
|
|
imports.wbg = {};
|
|
imports.wbg.__wbindgen_json_serialize = function(arg0, arg1) {
|
|
const obj = getObject(arg1);
|
|
const ret = JSON.stringify(obj === undefined ? null : obj);
|
|
const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
getInt32Memory0()[arg0 / 4 + 1] = len0;
|
|
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
|
|
};
|
|
imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
|
|
const obj = getObject(arg1);
|
|
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
var ptr0 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
var len0 = WASM_VECTOR_LEN;
|
|
getInt32Memory0()[arg0 / 4 + 1] = len0;
|
|
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
|
|
};
|
|
imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
|
|
const ret = getObject(arg0);
|
|
return addHeapObject(ret);
|
|
};
|
|
imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
|
|
const ret = getStringFromWasm0(arg0, arg1);
|
|
return addHeapObject(ret);
|
|
};
|
|
imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
|
|
takeObject(arg0);
|
|
};
|
|
imports.wbg.__wbindgen_cb_drop = function(arg0) {
|
|
const obj = takeObject(arg0).original;
|
|
if (obj.cnt-- == 1) {
|
|
obj.a = 0;
|
|
return true;
|
|
}
|
|
const ret = false;
|
|
return ret;
|
|
};
|
|
imports.wbg.__wbg_modalhidebyid_b9efcd5f48cb1c79 = function(arg0, arg1) {
|
|
modal_hide_by_id(getStringFromWasm0(arg0, arg1));
|
|
};
|
|
imports.wbg.__wbindgen_boolean_get = function(arg0) {
|
|
const v = getObject(arg0);
|
|
const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
|
|
return ret;
|
|
};
|
|
imports.wbg.__wbindgen_is_undefined = function(arg0) {
|
|
const ret = getObject(arg0) === undefined;
|
|
return ret;
|
|
};
|
|
imports.wbg.__wbindgen_json_parse = function(arg0, arg1) {
|
|
const ret = JSON.parse(getStringFromWasm0(arg0, arg1));
|
|
return addHeapObject(ret);
|
|
};
|
|
imports.wbg.__wbindgen_number_new = function(arg0) {
|
|
const ret = arg0;
|
|
return addHeapObject(ret);
|
|
};
|
|
imports.wbg.__wbindgen_number_get = function(arg0, arg1) {
|
|
const obj = getObject(arg1);
|
|
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret;
|
|
getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
|
|
};
|
|
imports.wbg.__wbg_new_693216e109162396 = function() {
|
|
const ret = new Error();
|
|
return addHeapObject(ret);
|
|
};
|
|
imports.wbg.__wbg_stack_0ddaca5d1abfb52f = function(arg0, arg1) {
|
|
const ret = getObject(arg1).stack;
|
|
const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
getInt32Memory0()[arg0 / 4 + 1] = len0;
|
|
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
|
|
};
|
|
imports.wbg.__wbg_error_09919627ac0992f5 = function(arg0, arg1) {
|
|
try {
|
|
console.error(getStringFromWasm0(arg0, arg1));
|
|
} finally {
|
|
wasm.__wbindgen_free(arg0, arg1);
|
|
}
|
|
};
|
|
imports.wbg.__wbg_debug_5a27eb2cb0d074ba = function(arg0, arg1) {
|
|
var v0 = getArrayJsValueFromWasm0(arg0, arg1).slice();
|
|
wasm.__wbindgen_free(arg0, arg1 * 4);
|
|
console.debug(...v0);
|
|
};
|
|
imports.wbg.__wbg_error_1a35d3879f286b52 = function(arg0, arg1) {
|
|
var v0 = getArrayJsValueFromWasm0(arg0, arg1).slice();
|
|
wasm.__wbindgen_free(arg0, arg1 * 4);
|
|
console.error(...v0);
|
|
};
|
|
imports.wbg.__wbg_warn_2aa0e7178e1d35f6 = function(arg0, arg1) {
|
|
var v0 = getArrayJsValueFromWasm0(arg0, arg1).slice();
|
|
wasm.__wbindgen_free(arg0, arg1 * 4);
|
|
console.warn(...v0);
|
|
};
|
|
imports.wbg.__wbg_instanceof_Window_42f092928baaee84 = function(arg0) {
|
|
const ret = getObject(arg0) instanceof Window;
|
|
return ret;
|
|
};
|
|
imports.wbg.__wbg_document_15b2e504fb1556d6 = function(arg0) {
|
|
const ret = getObject(arg0).document;
|
|
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
};
|
|
imports.wbg.__wbg_location_312161fbd0cf64f0 = function(arg0) {
|
|
const ret = getObject(arg0).location;
|
|
return addHeapObject(ret);
|
|
};
|
|
imports.wbg.__wbg_history_cb2cdfbe20fef7ad = function() { return handleError(function (arg0) {
|
|
const ret = getObject(arg0).history;
|
|
return addHeapObject(ret);
|
|
}, arguments) };
|
|
imports.wbg.__wbg_navigator_9be277c167dac7dc = function(arg0) {
|
|
const ret = getObject(arg0).navigator;
|
|
return addHeapObject(ret);
|
|
};
|
|
imports.wbg.__wbg_localStorage_ef2b9820e472266b = function() { return handleError(function (arg0) {
|
|
const ret = getObject(arg0).localStorage;
|
|
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
}, arguments) };
|
|
imports.wbg.__wbg_sessionStorage_c3fe261def7429e6 = function() { return handleError(function (arg0) {
|
|
const ret = getObject(arg0).sessionStorage;
|
|
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
}, arguments) };
|
|
imports.wbg.__wbg_fetch_9a5cb9d8a96004d0 = function(arg0, arg1) {
|
|
const ret = getObject(arg0).fetch(getObject(arg1));
|
|
return addHeapObject(ret);
|
|
};
|
|
imports.wbg.__wbg_body_5e6efc7a3c1b65f3 = function(arg0) {
|
|
const ret = getObject(arg0).body;
|
|
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
};
|
|
imports.wbg.__wbg_createElement_28fc3740fb11defb = function() { return handleError(function (arg0, arg1, arg2) {
|
|
const ret = getObject(arg0).createElement(getStringFromWasm0(arg1, arg2));
|
|
return addHeapObject(ret);
|
|
}, arguments) };
|
|
imports.wbg.__wbg_createElementNS_dd6cca2457c8c16c = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
|
|
const ret = getObject(arg0).createElementNS(arg1 === 0 ? undefined : getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
|
|
return addHeapObject(ret);
|
|
}, arguments) };
|
|
imports.wbg.__wbg_createTextNode_2ab1e3ebc34e2641 = function(arg0, arg1, arg2) {
|
|
const ret = getObject(arg0).createTextNode(getStringFromWasm0(arg1, arg2));
|
|
return addHeapObject(ret);
|
|
};
|
|
imports.wbg.__wbg_getElementById_927eae2597d26692 = function(arg0, arg1, arg2) {
|
|
const ret = getObject(arg0).getElementById(getStringFromWasm0(arg1, arg2));
|
|
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
};
|
|
imports.wbg.__wbg_querySelector_73feab41810011dc = function() { return handleError(function (arg0, arg1, arg2) {
|
|
const ret = getObject(arg0).querySelector(getStringFromWasm0(arg1, arg2));
|
|
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
}, arguments) };
|
|
imports.wbg.__wbg_getItem_1db55b1eb4116c1e = function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
const ret = getObject(arg1).getItem(getStringFromWasm0(arg2, arg3));
|
|
var ptr0 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
var len0 = WASM_VECTOR_LEN;
|
|
getInt32Memory0()[arg0 / 4 + 1] = len0;
|
|
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
|
|
}, arguments) };
|
|
imports.wbg.__wbg_removeItem_ab938a8b66f6d422 = function() { return handleError(function (arg0, arg1, arg2) {
|
|
getObject(arg0).removeItem(getStringFromWasm0(arg1, arg2));
|
|
}, arguments) };
|
|
imports.wbg.__wbg_setItem_1f474989a35f4c9f = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
|
|
getObject(arg0).setItem(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
|
|
}, arguments) };
|
|
imports.wbg.__wbg_get_aab8f8a9b87125ad = function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
const ret = getObject(arg1).get(getStringFromWasm0(arg2, arg3));
|
|
var ptr0 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
var len0 = WASM_VECTOR_LEN;
|
|
getInt32Memory0()[arg0 / 4 + 1] = len0;
|
|
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
|
|
}, arguments) };
|
|
imports.wbg.__wbg_set_b5c36262f65fae92 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
|
|
getObject(arg0).set(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
|
|
}, arguments) };
|
|
imports.wbg.__wbg_pathname_8ed2fc02f98aeaaf = function(arg0, arg1) {
|
|
const ret = getObject(arg1).pathname;
|
|
const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
getInt32Memory0()[arg0 / 4 + 1] = len0;
|
|
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
|
|
};
|
|
imports.wbg.__wbg_new_d1d1300265e34170 = function() { return handleError(function (arg0, arg1) {
|
|
const ret = new URL(getStringFromWasm0(arg0, arg1));
|
|
return addHeapObject(ret);
|
|
}, arguments) };
|
|
imports.wbg.__wbg_value_eb32f706ae6bfab2 = function(arg0, arg1) {
|
|
const ret = getObject(arg1).value;
|
|
const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
getInt32Memory0()[arg0 / 4 + 1] = len0;
|
|
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
|
|
};
|
|
imports.wbg.__wbg_setvalue_3dd349be116107ce = function(arg0, arg1, arg2) {
|
|
getObject(arg0).value = getStringFromWasm0(arg1, arg2);
|
|
};
|
|
imports.wbg.__wbg_headers_0aeca08d4e61e2e7 = function(arg0) {
|
|
const ret = getObject(arg0).headers;
|
|
return addHeapObject(ret);
|
|
};
|
|
imports.wbg.__wbg_newwithstrandinit_de7c409ec8538105 = function() { return handleError(function (arg0, arg1, arg2) {
|
|
const ret = new Request(getStringFromWasm0(arg0, arg1), getObject(arg2));
|
|
return addHeapObject(ret);
|
|
}, arguments) };
|
|
imports.wbg.__wbg_add_a1fa1336c6b306df = function() { return handleError(function (arg0, arg1, arg2) {
|
|
getObject(arg0).add(getStringFromWasm0(arg1, arg2));
|
|
}, arguments) };
|
|
imports.wbg.__wbg_remove_dce5eca3c9fcea70 = function() { return handleError(function (arg0, arg1, arg2) {
|
|
getObject(arg0).remove(getStringFromWasm0(arg1, arg2));
|
|
}, arguments) };
|
|
imports.wbg.__wbg_create_2c518207ce8a6157 = function() { return handleError(function (arg0, arg1) {
|
|
const ret = getObject(arg0).create(getObject(arg1));
|
|
return addHeapObject(ret);
|
|
}, arguments) };
|
|
imports.wbg.__wbg_get_5ec74cdfbbefe775 = function() { return handleError(function (arg0, arg1) {
|
|
const ret = getObject(arg0).get(getObject(arg1));
|
|
return addHeapObject(ret);
|
|
}, arguments) };
|
|
imports.wbg.__wbg_href_cae04ee9562fc683 = function(arg0, arg1) {
|
|
const ret = getObject(arg1).href;
|
|
const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
getInt32Memory0()[arg0 / 4 + 1] = len0;
|
|
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
|
|
};
|
|
imports.wbg.__wbg_instanceof_HtmlInputElement_3fad42774bc62388 = function(arg0) {
|
|
const ret = getObject(arg0) instanceof HTMLInputElement;
|
|
return ret;
|
|
};
|
|
imports.wbg.__wbg_setchecked_a450b330df6b3fa5 = function(arg0, arg1) {
|
|
getObject(arg0).checked = arg1 !== 0;
|
|
};
|
|
imports.wbg.__wbg_value_30770021ca38e0db = function(arg0, arg1) {
|
|
const ret = getObject(arg1).value;
|
|
const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
getInt32Memory0()[arg0 / 4 + 1] = len0;
|
|
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
|
|
};
|
|
imports.wbg.__wbg_setvalue_7b7950dacc5eb607 = function(arg0, arg1, arg2) {
|
|
getObject(arg0).value = getStringFromWasm0(arg1, arg2);
|
|
};
|
|
imports.wbg.__wbg_instanceof_Element_1714e50f9bda1d15 = function(arg0) {
|
|
const ret = getObject(arg0) instanceof Element;
|
|
return ret;
|
|
};
|
|
imports.wbg.__wbg_namespaceURI_b343a4afa454dd59 = function(arg0, arg1) {
|
|
const ret = getObject(arg1).namespaceURI;
|
|
var ptr0 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
var len0 = WASM_VECTOR_LEN;
|
|
getInt32Memory0()[arg0 / 4 + 1] = len0;
|
|
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
|
|
};
|
|
imports.wbg.__wbg_classList_965edecde8dc2a79 = function(arg0) {
|
|
const ret = getObject(arg0).classList;
|
|
return addHeapObject(ret);
|
|
};
|
|
imports.wbg.__wbg_setinnerHTML_fe7eeed1b320a302 = function(arg0, arg1, arg2) {
|
|
getObject(arg0).innerHTML = getStringFromWasm0(arg1, arg2);
|
|
};
|
|
imports.wbg.__wbg_removeAttribute_2d6e56b2f03aa57e = function() { return handleError(function (arg0, arg1, arg2) {
|
|
getObject(arg0).removeAttribute(getStringFromWasm0(arg1, arg2));
|
|
}, arguments) };
|
|
imports.wbg.__wbg_setAttribute_8cfc462c0dedd03b = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
|
|
getObject(arg0).setAttribute(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
|
|
}, arguments) };
|
|
imports.wbg.__wbg_instanceof_HtmlElement_057bfd3477e9b9b6 = function(arg0) {
|
|
const ret = getObject(arg0) instanceof HTMLElement;
|
|
return ret;
|
|
};
|
|
imports.wbg.__wbg_focus_66bb7c767837cd51 = function() { return handleError(function (arg0) {
|
|
getObject(arg0).focus();
|
|
}, arguments) };
|
|
imports.wbg.__wbg_instanceof_Event_8c74064684d03e14 = function(arg0) {
|
|
const ret = getObject(arg0) instanceof Event;
|
|
return ret;
|
|
};
|
|
imports.wbg.__wbg_target_68a5c10e2732a79e = function(arg0) {
|
|
const ret = getObject(arg0).target;
|
|
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
};
|
|
imports.wbg.__wbg_cancelBubble_aa216b328c490cb1 = function(arg0) {
|
|
const ret = getObject(arg0).cancelBubble;
|
|
return ret;
|
|
};
|
|
imports.wbg.__wbg_preventDefault_b4d36c8196fbe491 = function(arg0) {
|
|
getObject(arg0).preventDefault();
|
|
};
|
|
imports.wbg.__wbg_credentials_c3a25c2c25bfa304 = function(arg0) {
|
|
const ret = getObject(arg0).credentials;
|
|
return addHeapObject(ret);
|
|
};
|
|
imports.wbg.__wbg_getClientExtensionResults_93d06fddc73f65f9 = function(arg0) {
|
|
const ret = getObject(arg0).getClientExtensionResults();
|
|
return addHeapObject(ret);
|
|
};
|
|
imports.wbg.__wbg_addEventListener_ec92ea1297eefdfc = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
|
|
getObject(arg0).addEventListener(getStringFromWasm0(arg1, arg2), getObject(arg3), getObject(arg4));
|
|
}, arguments) };
|
|
imports.wbg.__wbg_removeEventListener_bfe676215a590711 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
|
|
getObject(arg0).removeEventListener(getStringFromWasm0(arg1, arg2), getObject(arg3), arg4 !== 0);
|
|
}, arguments) };
|
|
imports.wbg.__wbg_parentElement_14138ef2ff0b9c88 = function(arg0) {
|
|
const ret = getObject(arg0).parentElement;
|
|
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
};
|
|
imports.wbg.__wbg_lastChild_2d1fa5efd0e0edcc = function(arg0) {
|
|
const ret = getObject(arg0).lastChild;
|
|
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
};
|
|
imports.wbg.__wbg_setnodeValue_59d46f408f89fd0b = function(arg0, arg1, arg2) {
|
|
getObject(arg0).nodeValue = arg1 === 0 ? undefined : getStringFromWasm0(arg1, arg2);
|
|
};
|
|
imports.wbg.__wbg_appendChild_d21bac021b5bbfde = function() { return handleError(function (arg0, arg1) {
|
|
const ret = getObject(arg0).appendChild(getObject(arg1));
|
|
return addHeapObject(ret);
|
|
}, arguments) };
|
|
imports.wbg.__wbg_insertBefore_26dfd5eb687a3438 = function() { return handleError(function (arg0, arg1, arg2) {
|
|
const ret = getObject(arg0).insertBefore(getObject(arg1), getObject(arg2));
|
|
return addHeapObject(ret);
|
|
}, arguments) };
|
|
imports.wbg.__wbg_removeChild_94b0c126b878241b = function() { return handleError(function (arg0, arg1) {
|
|
const ret = getObject(arg0).removeChild(getObject(arg1));
|
|
return addHeapObject(ret);
|
|
}, arguments) };
|
|
imports.wbg.__wbg_pushState_65b5fb0f30ca9d61 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5) {
|
|
getObject(arg0).pushState(getObject(arg1), getStringFromWasm0(arg2, arg3), arg4 === 0 ? undefined : getStringFromWasm0(arg4, arg5));
|
|
}, arguments) };
|
|
imports.wbg.__wbg_pathname_c08f1ef51f6ebba9 = function() { return handleError(function (arg0, arg1) {
|
|
const ret = getObject(arg1).pathname;
|
|
const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
getInt32Memory0()[arg0 / 4 + 1] = len0;
|
|
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
|
|
}, arguments) };
|
|
imports.wbg.__wbg_search_91c67a620520f3b6 = function() { return handleError(function (arg0, arg1) {
|
|
const ret = getObject(arg1).search;
|
|
const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
getInt32Memory0()[arg0 / 4 + 1] = len0;
|
|
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
|
|
}, arguments) };
|
|
imports.wbg.__wbg_replace_99a138c4b78f08d0 = function() { return handleError(function (arg0, arg1, arg2) {
|
|
getObject(arg0).replace(getStringFromWasm0(arg1, arg2));
|
|
}, arguments) };
|
|
imports.wbg.__wbg_instanceof_Response_240e67e5796c3c6b = function(arg0) {
|
|
const ret = getObject(arg0) instanceof Response;
|
|
return ret;
|
|
};
|
|
imports.wbg.__wbg_status_9067c6a4fdd064c9 = function(arg0) {
|
|
const ret = getObject(arg0).status;
|
|
return ret;
|
|
};
|
|
imports.wbg.__wbg_headers_aa309e800cf75016 = function(arg0) {
|
|
const ret = getObject(arg0).headers;
|
|
return addHeapObject(ret);
|
|
};
|
|
imports.wbg.__wbg_json_30d916f3f34485ab = function() { return handleError(function (arg0) {
|
|
const ret = getObject(arg0).json();
|
|
return addHeapObject(ret);
|
|
}, arguments) };
|
|
imports.wbg.__wbg_text_64ed39439c06af3f = function() { return handleError(function (arg0) {
|
|
const ret = getObject(arg0).text();
|
|
return addHeapObject(ret);
|
|
}, arguments) };
|
|
imports.wbg.__wbg_new_ee1a3da85465d621 = function() {
|
|
const ret = new Array();
|
|
return addHeapObject(ret);
|
|
};
|
|
imports.wbg.__wbg_newnoargs_971e9a5abe185139 = function(arg0, arg1) {
|
|
const ret = new Function(getStringFromWasm0(arg0, arg1));
|
|
return addHeapObject(ret);
|
|
};
|
|
imports.wbg.__wbg_get_72332cd2bc57924c = function() { return handleError(function (arg0, arg1) {
|
|
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
|
return addHeapObject(ret);
|
|
}, arguments) };
|
|
imports.wbg.__wbg_call_33d7bcddbbfa394a = function() { return handleError(function (arg0, arg1) {
|
|
const ret = getObject(arg0).call(getObject(arg1));
|
|
return addHeapObject(ret);
|
|
}, arguments) };
|
|
imports.wbg.__wbg_new_e6a9fecc2bf26696 = function() {
|
|
const ret = new Object();
|
|
return addHeapObject(ret);
|
|
};
|
|
imports.wbg.__wbg_self_fd00a1ef86d1b2ed = function() { return handleError(function () {
|
|
const ret = self.self;
|
|
return addHeapObject(ret);
|
|
}, arguments) };
|
|
imports.wbg.__wbg_window_6f6e346d8bbd61d7 = function() { return handleError(function () {
|
|
const ret = window.window;
|
|
return addHeapObject(ret);
|
|
}, arguments) };
|
|
imports.wbg.__wbg_globalThis_3348936ac49df00a = function() { return handleError(function () {
|
|
const ret = globalThis.globalThis;
|
|
return addHeapObject(ret);
|
|
}, arguments) };
|
|
imports.wbg.__wbg_global_67175caf56f55ca9 = function() { return handleError(function () {
|
|
const ret = global.global;
|
|
return addHeapObject(ret);
|
|
}, arguments) };
|
|
imports.wbg.__wbg_push_0bc7fce4a139a883 = function(arg0, arg1) {
|
|
const ret = getObject(arg0).push(getObject(arg1));
|
|
return ret;
|
|
};
|
|
imports.wbg.__wbg_instanceof_Error_2082612c1902c887 = function(arg0) {
|
|
const ret = getObject(arg0) instanceof Error;
|
|
return ret;
|
|
};
|
|
imports.wbg.__wbg_message_924b46658b69b295 = function(arg0) {
|
|
const ret = getObject(arg0).message;
|
|
return addHeapObject(ret);
|
|
};
|
|
imports.wbg.__wbg_name_e88a3b3a0f6b23c2 = function(arg0) {
|
|
const ret = getObject(arg0).name;
|
|
return addHeapObject(ret);
|
|
};
|
|
imports.wbg.__wbg_toString_dc4768002eeae1b0 = function(arg0) {
|
|
const ret = getObject(arg0).toString();
|
|
return addHeapObject(ret);
|
|
};
|
|
imports.wbg.__wbg_valueOf_f83bee79f23e7b05 = function(arg0) {
|
|
const ret = getObject(arg0).valueOf();
|
|
return ret;
|
|
};
|
|
imports.wbg.__wbg_is_43eb2f9708e964a9 = function(arg0, arg1) {
|
|
const ret = Object.is(getObject(arg0), getObject(arg1));
|
|
return ret;
|
|
};
|
|
imports.wbg.__wbg_resolve_0107b3a501450ba0 = function(arg0) {
|
|
const ret = Promise.resolve(getObject(arg0));
|
|
return addHeapObject(ret);
|
|
};
|
|
imports.wbg.__wbg_then_18da6e5453572fc8 = function(arg0, arg1) {
|
|
const ret = getObject(arg0).then(getObject(arg1));
|
|
return addHeapObject(ret);
|
|
};
|
|
imports.wbg.__wbg_then_e5489f796341454b = function(arg0, arg1, arg2) {
|
|
const ret = getObject(arg0).then(getObject(arg1), getObject(arg2));
|
|
return addHeapObject(ret);
|
|
};
|
|
imports.wbg.__wbg_buffer_34f5ec9f8a838ba0 = function(arg0) {
|
|
const ret = getObject(arg0).buffer;
|
|
return addHeapObject(ret);
|
|
};
|
|
imports.wbg.__wbg_newwithbyteoffsetandlength_88fdad741db1b182 = function(arg0, arg1, arg2) {
|
|
const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
|
|
return addHeapObject(ret);
|
|
};
|
|
imports.wbg.__wbg_new_cda198d9dbc6d7ea = function(arg0) {
|
|
const ret = new Uint8Array(getObject(arg0));
|
|
return addHeapObject(ret);
|
|
};
|
|
imports.wbg.__wbg_set_1a930cfcda1a8067 = function(arg0, arg1, arg2) {
|
|
getObject(arg0).set(getObject(arg1), arg2 >>> 0);
|
|
};
|
|
imports.wbg.__wbg_length_51f19f73d6d9eff3 = function(arg0) {
|
|
const ret = getObject(arg0).length;
|
|
return ret;
|
|
};
|
|
imports.wbg.__wbg_set_2762e698c2f5b7e0 = function() { return handleError(function (arg0, arg1, arg2) {
|
|
const ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2));
|
|
return ret;
|
|
}, arguments) };
|
|
imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
|
|
const ret = debugString(getObject(arg1));
|
|
const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
getInt32Memory0()[arg0 / 4 + 1] = len0;
|
|
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
|
|
};
|
|
imports.wbg.__wbindgen_throw = function(arg0, arg1) {
|
|
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
};
|
|
imports.wbg.__wbindgen_memory = function() {
|
|
const ret = wasm.memory;
|
|
return addHeapObject(ret);
|
|
};
|
|
imports.wbg.__wbindgen_closure_wrapper4809 = function(arg0, arg1, arg2) {
|
|
const ret = makeMutClosure(arg0, arg1, 1273, __wbg_adapter_30);
|
|
return addHeapObject(ret);
|
|
};
|
|
imports.wbg.__wbindgen_closure_wrapper4914 = function(arg0, arg1, arg2) {
|
|
const ret = makeClosure(arg0, arg1, 1306, __wbg_adapter_33);
|
|
return addHeapObject(ret);
|
|
};
|
|
imports.wbg.__wbindgen_closure_wrapper5180 = function(arg0, arg1, arg2) {
|
|
const ret = makeMutClosure(arg0, arg1, 1359, __wbg_adapter_36);
|
|
return addHeapObject(ret);
|
|
};
|
|
|
|
return imports;
|
|
}
|
|
|
|
function initMemory(imports, maybe_memory) {
|
|
|
|
}
|
|
|
|
function finalizeInit(instance, module) {
|
|
wasm = instance.exports;
|
|
init.__wbindgen_wasm_module = module;
|
|
cachedFloat64Memory0 = new Float64Array();
|
|
cachedInt32Memory0 = new Int32Array();
|
|
cachedUint32Memory0 = new Uint32Array();
|
|
cachedUint8Memory0 = new Uint8Array();
|
|
|
|
|
|
return wasm;
|
|
}
|
|
|
|
function initSync(bytes) {
|
|
const imports = getImports();
|
|
|
|
initMemory(imports);
|
|
|
|
const module = new WebAssembly.Module(bytes);
|
|
const instance = new WebAssembly.Instance(module, imports);
|
|
|
|
return finalizeInit(instance, module);
|
|
}
|
|
|
|
async function init(input) {
|
|
if (typeof input === 'undefined') {
|
|
input = new URL('kanidmd_web_ui_bg.wasm', import.meta.url);
|
|
}
|
|
const imports = getImports();
|
|
|
|
if (typeof input === 'string' || (typeof Request === 'function' && input instanceof Request) || (typeof URL === 'function' && input instanceof URL)) {
|
|
input = fetch(input);
|
|
}
|
|
|
|
initMemory(imports);
|
|
|
|
const { instance, module } = await load(await input, imports);
|
|
|
|
return finalizeInit(instance, module);
|
|
}
|
|
|
|
export { initSync }
|
|
export default init;
|