"use strict"; // Pre-declare all internal globals as non-enumerable so they are invisible // to Object.keys(window) / for-in enumeration. Must run before any var // declarations or property assignments below: once a property is defined // with enumerable:false here, subsequent `var x = value` assignments will // find the property already exists and only update the value, leaving the // descriptor intact. Direct globalThis.x = value assignments also only // update the value without touching enumerable when the property is // writable:true and configurable:true. (function _preHideInternals() { var _names = [ // runtime-set by Rust (runtime.rs / page.rs) '__obscura_errors', '__obscura_init', '__obscura_hide_list', '__obscura_objects', '__obscura_oid', '__obscura_ua', '__obscura_platform', '__obscura_ua_platform', '__obscura_ua_platform_version', '__obscura_stealth', '__obscura_markTrusted', '__documentReadyState__', '__currentUrl', // internal helpers (var-declared throughout the file) '__processDynScriptQueue', '_markNative', '_fpRand', '_fpNoise', '_fpCache', '_getFp', '_fp', '_splitAsciiWhitespace', '_getElementsByClassName', '_docEncoding', '_docIsUtf8', '_isSpecialScheme', '_applyDocQueryEncoding', '_anchorBase', '_elemHrefURL', '_setElemHrefPart', '_pad', '_daysInMonth', '_isoWeek1Monday', '_inputParseNumber', '_inputFormatNumber', '_htmlAttrName', '_convertNodes', '_elementClassFor', '_wrap', '_wrapEl', '_resolveUrl', '_registerIframe', '_base64ToUint8Array', '_bodyToUint8Array', '_arrayBufferFromBytes', '_installWasmStreamingFallback', '_urlParseOp', '_urlSetOp', '_urlResolveOp', '_decodeBodyWithCharset', '_utf8DecodeBytes', '_selectionFor', '_isConstructorCE', '_isValidCustomElementName', '_blobPartToBytes', '_bytesToBinaryString', '_formEncode', '_hexv', '_commonFonts', '_isXMLDocument', '_isValidPITarget', '_isHTMLEl', '_nodeList', '_rngNodeLength', '_rngNodeIndex', '_rngSame', '_rngRoot', '_rngAncestors', '_rngOrder', '_rngCmp', '_rngCheckOffset', '_idbRequest', '_idbObjectStore', '_idbTransaction', '_idbDatabase', '_makeListenerBox', ]; var _desc = { value: undefined, writable: true, enumerable: false, configurable: true }; for (var _i = 0; _i < _names.length; _i++) { try { Object.defineProperty(globalThis, _names[_i], _desc); } catch (_e) {} } })(); globalThis.__obscura_errors = []; globalThis.addEventListener = globalThis.addEventListener || function(){}; globalThis.onunhandledrejection = function(e) { if (e?.preventDefault) e.preventDefault(); }; globalThis.onerror = function(msg, src, line, col, error) { globalThis.__obscura_errors.push({msg: String(msg), src: String(src||""), line, error: String(error||"")}); }; globalThis.__windowListeners = {}; globalThis.addEventListener = function(type, fn) { if (!globalThis.__windowListeners[type]) globalThis.__windowListeners[type] = []; globalThis.__windowListeners[type].push(fn); }; globalThis.removeEventListener = function(type, fn) { if (globalThis.__windowListeners[type]) { globalThis.__windowListeners[type] = globalThis.__windowListeners[type].filter(h => h !== fn); } }; globalThis.dispatchEvent = function(event) { if (!event) return true; const handlers = globalThis.__windowListeners[event.type] || []; for (const h of handlers) { try { h.call(globalThis, event); } catch(e) { console.error(e); } } return !event.defaultPrevented; }; const _dom = (cmd, a1, a2) => Deno.core.ops.op_dom(cmd, String(a1 ?? ""), String(a2 ?? "")); const _nativeFns = new Set(); const _origToString = Function.prototype.toString; Function.prototype.toString = function() { if (_nativeFns.has(this)) { return `function ${this.name || ''}() { [native code] }`; } return _origToString.call(this); }; function _markNative(fn) { if (typeof fn === 'function') _nativeFns.add(fn); return fn; } _nativeFns.add(Function.prototype.toString); [Error, TypeError, ReferenceError, SyntaxError, RangeError, URIError, EvalError].forEach(E => { try { Object.defineProperty(E.prototype, 'name', { value: E.name, writable: true, enumerable: false, configurable: false, }); } catch(e) {} }); const _stackCache = new WeakMap(); const _origStackDesc = Object.getOwnPropertyDescriptor(Error.prototype, 'stack'); if (_origStackDesc && _origStackDesc.get) { Object.defineProperty(Error.prototype, 'stack', { configurable: false, enumerable: false, get: function() { if (!_stackCache.has(this)) _stackCache.set(this, _origStackDesc.get.call(this)); return _stackCache.get(this); } }); } let _fpSeed = 0; // Dynamic script import queue — serializes concurrent import() calls // to prevent re-entrant RefCell panic in deno_core's futures_unordered_driver // when SPAs dynamically insert multiple