New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@titaniumnetwork-dev/ultraviolet

Package Overview
Dependencies
Maintainers
1
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@titaniumnetwork-dev/ultraviolet - npm Package Compare versions

Comparing version 1.0.9 to 1.0.10

2

dist/uv.client.js

@@ -1,2 +0,2 @@

(()=>{"use strict";var t={666:t=>{var e,r="object"==typeof Reflect?Reflect:null,i=r&&"function"==typeof r.apply?r.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};e=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var o=Number.isNaN||function(t){return t!=t};function s(){s.init.call(this)}t.exports=s,t.exports.once=function(t,e){return new Promise((function(r,i){function o(r){t.removeListener(e,s),i(r)}function s(){"function"==typeof t.removeListener&&t.removeListener("error",o),r([].slice.call(arguments))}v(t,e,s,{once:!0}),"error"!==e&&function(t,e,r){"function"==typeof t.on&&v(t,"error",e,r)}(t,o,{once:!0})}))},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var n=10;function a(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function h(t){return void 0===t._maxListeners?s.defaultMaxListeners:t._maxListeners}function l(t,e,r,i){var o,s,n,l;if(a(r),void 0===(s=t._events)?(s=t._events=Object.create(null),t._eventsCount=0):(void 0!==s.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),s=t._events),n=s[e]),void 0===n)n=s[e]=r,++t._eventsCount;else if("function"==typeof n?n=s[e]=i?[r,n]:[n,r]:i?n.unshift(r):n.push(r),(o=h(t))>0&&n.length>o&&!n.warned){n.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+n.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=t,c.type=e,c.count=n.length,l=c,console&&console.warn&&console.warn(l)}return t}function c(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(t,e,r){var i={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},o=c.bind(i);return o.listener=r,i.wrapFn=o,o}function u(t,e,r){var i=t._events;if(void 0===i)return[];var o=i[e];return void 0===o?[]:"function"==typeof o?r?[o.listener||o]:[o]:r?function(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}(o):w(o,o.length)}function p(t){var e=this._events;if(void 0!==e){var r=e[t];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function w(t,e){for(var r=new Array(e),i=0;i<e;++i)r[i]=t[i];return r}function v(t,e,r,i){if("function"==typeof t.on)i.once?t.once(e,r):t.on(e,r);else{if("function"!=typeof t.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t);t.addEventListener(e,(function o(s){i.once&&t.removeEventListener(e,o),r(s)}))}}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return n},set:function(t){if("number"!=typeof t||t<0||o(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");n=t}}),s.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||o(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},s.prototype.getMaxListeners=function(){return h(this)},s.prototype.emit=function(t){for(var e=[],r=1;r<arguments.length;r++)e.push(arguments[r]);var o="error"===t,s=this._events;if(void 0!==s)o=o&&void 0===s.error;else if(!o)return!1;if(o){var n;if(e.length>0&&(n=e[0]),n instanceof Error)throw n;var a=new Error("Unhandled error."+(n?" ("+n.message+")":""));throw a.context=n,a}var h=s[t];if(void 0===h)return!1;if("function"==typeof h)i(h,this,e);else{var l=h.length,c=w(h,l);for(r=0;r<l;++r)i(c[r],this,e)}return!0},s.prototype.addListener=function(t,e){return l(this,t,e,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(t,e){return l(this,t,e,!0)},s.prototype.once=function(t,e){return a(e),this.on(t,d(this,t,e)),this},s.prototype.prependOnceListener=function(t,e){return a(e),this.prependListener(t,d(this,t,e)),this},s.prototype.removeListener=function(t,e){var r,i,o,s,n;if(a(e),void 0===(i=this._events))return this;if(void 0===(r=i[t]))return this;if(r===e||r.listener===e)0==--this._eventsCount?this._events=Object.create(null):(delete i[t],i.removeListener&&this.emit("removeListener",t,r.listener||e));else if("function"!=typeof r){for(o=-1,s=r.length-1;s>=0;s--)if(r[s]===e||r[s].listener===e){n=r[s].listener,o=s;break}if(o<0)return this;0===o?r.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}(r,o),1===r.length&&(i[t]=r[0]),void 0!==i.removeListener&&this.emit("removeListener",t,n||e)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(t){var e,r,i;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[t]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[t]),this;if(0===arguments.length){var o,s=Object.keys(r);for(i=0;i<s.length;++i)"removeListener"!==(o=s[i])&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(e=r[t]))this.removeListener(t,e);else if(void 0!==e)for(i=e.length-1;i>=0;i--)this.removeListener(t,e[i]);return this},s.prototype.listeners=function(t){return u(this,t,!0)},s.prototype.rawListeners=function(t){return u(this,t,!1)},s.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):p.call(t,e)},s.prototype.listenerCount=p,s.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]}}},e={};function r(i){var o=e[i];if(void 0!==o)return o.exports;var s=e[i]={exports:{}};return t[i](s,s.exports,r),s.exports}(()=>{var t=r(666);const e=class{#t;#e;constructor(t={},e=null,r=null){this.#t=!1,this.#e=null,this.data=t,this.target=e,this.that=r}get intercepted(){return this.#t}get returnValue(){return this.#e}respondWith(t){this.#e=t,this.#t=!0}};const i=class extends t{constructor(t){super(),this.ctx=t,this.window=t.window,this.document=this.window.document,this.Document=this.window.Document||{},this.DOMParser=this.window.DOMParser||{},this.docProto=this.Document.prototype||{},this.domProto=this.DOMParser.prototype||{},this.title=t.nativeMethods.getOwnPropertyDescriptor(this.docProto,"title"),this.cookie=t.nativeMethods.getOwnPropertyDescriptor(this.docProto,"cookie"),this.referrer=t.nativeMethods.getOwnPropertyDescriptor(this.docProto,"referrer"),this.domain=t.nativeMethods.getOwnPropertyDescriptor(this.docProto,"domain"),this.documentURI=t.nativeMethods.getOwnPropertyDescriptor(this.docProto,"documentURI"),this.write=this.docProto.write,this.writeln=this.docProto.writeln,this.querySelector=this.docProto.querySelector,this.querySelectorAll=this.docProto.querySelectorAll,this.parseFromString=this.domProto.parseFromString,this.URL=t.nativeMethods.getOwnPropertyDescriptor(this.docProto,"URL")}overrideParseFromString(){this.ctx.override(this.domProto,"parseFromString",((t,r,i)=>{if(2>i.length)return t.apply(r,i);let[o,s]=i;const n=new e({string:o,type:s},t,r);return this.emit("parseFromString",n),n.intercepted?n.returnValue:n.target.call(n.that,n.data.string,n.data.type)}))}overrideQuerySelector(){this.ctx.override(this.docProto,"querySelector",((t,r,i)=>{if(!i.length)return t.apply(r,i);let[o]=i;const s=new e({selectors:o},t,r);return this.emit("querySelector",s),s.intercepted?s.returnValue:s.target.call(s.that,s.data.selectors)}))}overrideDomain(){this.ctx.overrideDescriptor(this.docProto,"domain",{get:(t,r)=>{const i=new e({value:t.call(r)},t,r);return this.emit("getDomain",i),i.intercepted?i.returnValue:i.data.value},set:(t,r,[i])=>{const o=new e({value:i},t,r);return this.emit("setDomain",o),o.intercepted?o.returnValue:o.target.call(o.that,o.data.value)}})}overrideReferrer(){this.ctx.overrideDescriptor(this.docProto,"referrer",{get:(t,r)=>{const i=new e({value:t.call(r)},t,r);return this.emit("referrer",i),i.intercepted?i.returnValue:i.data.value}})}overrideCreateTreeWalker(){this.ctx.override(this.docProto,"createTreeWalker",((t,r,i)=>{if(!i.length)return t.apply(r,i);let[o,s=4294967295,n,a]=i;const h=new e({root:o,show:s,filter:n,expandEntityReferences:a},t,r);return this.emit("createTreeWalker",h),h.intercepted?h.returnValue:h.target.call(h.that,h.data.root,h.data.show,h.data.filter,h.data.expandEntityReferences)}))}overrideWrite(){this.ctx.override(this.docProto,"write",((t,r,i)=>{if(!i.length)return t.apply(r,i);let[...o]=i;const s=new e({html:o},t,r);return this.emit("write",s),s.intercepted?s.returnValue:s.target.apply(s.that,s.data.html)})),this.ctx.override(this.docProto,"writeln",((t,r,i)=>{if(!i.length)return t.apply(r,i);let[...o]=i;const s=new e({html:o},t,r);return this.emit("writeln",s),s.intercepted?s.returnValue:s.target.apply(s.that,s.data.html)}))}overrideDocumentURI(){this.ctx.overrideDescriptor(this.docProto,"documentURI",{get:(t,r)=>{const i=new e({value:t.call(r)},t,r);return this.emit("documentURI",i),i.intercepted?i.returnValue:i.data.value}})}overrideURL(){this.ctx.overrideDescriptor(this.docProto,"URL",{get:(t,r)=>{const i=new e({value:t.call(r)},t,r);return this.emit("url",i),i.intercepted?i.returnValue:i.data.value}})}overrideCookie(){this.ctx.overrideDescriptor(this.docProto,"cookie",{get:(t,r)=>{const i=new e({value:t.call(r)},t,r);return this.emit("getCookie",i),i.intercepted?i.returnValue:i.data.value},set:(t,r,[i])=>{const o=new e({value:i},t,r);return this.emit("setCookie",o),o.intercepted?o.returnValue:o.target.call(o.that,o.data.value)}})}overrideTitle(){this.ctx.overrideDescriptor(this.docProto,"title",{get:(t,r)=>{const i=new e({value:t.call(r)},t,r);return this.emit("getTitle",i),i.intercepted?i.returnValue:i.data.value},set:(t,r,[i])=>{const o=new e({value:i},t,r);return this.emit("setTitle",o),o.intercepted?o.returnValue:o.target.call(o.that,o.data.value)}})}};const o=class extends t{constructor(t){super(),this.ctx=t,this.window=t.window,this.Audio=this.window.Audio,this.Element=this.window.Element,this.elemProto=this.Element?this.Element.prototype:{},this.innerHTML=t.nativeMethods.getOwnPropertyDescriptor(this.elemProto,"innerHTML"),this.outerHTML=t.nativeMethods.getOwnPropertyDescriptor(this.elemProto,"outerHTML"),this.setAttribute=this.elemProto.setAttribute,this.getAttribute=this.elemProto.getAttribute,this.removeAttribute=this.elemProto.removeAttribute,this.hasAttribute=this.elemProto.hasAttribute,this.querySelector=this.elemProto.querySelector,this.querySelectorAll=this.elemProto.querySelectorAll,this.insertAdjacentHTML=this.elemProto.insertAdjacentHTML,this.insertAdjacentText=this.elemProto.insertAdjacentText}overrideQuerySelector(){this.ctx.override(this.elemProto,"querySelector",((t,r,i)=>{if(!i.length)return t.apply(r,i);let[o]=i;const s=new e({selectors:o},t,r);return this.emit("querySelector",s),s.intercepted?s.returnValue:s.target.call(s.that,s.data.selectors)}))}overrideAttribute(){this.ctx.override(this.elemProto,"getAttribute",((t,r,i)=>{if(!i.length)return t.apply(r,i);let[o]=i;const s=new e({name:o},t,r);return this.emit("getAttribute",s),s.intercepted?s.returnValue:s.target.call(s.that,s.data.name)})),this.ctx.override(this.elemProto,"setAttribute",((t,r,i)=>{if(2>i.length)return t.apply(r,i);let[o,s]=i;const n=new e({name:o,value:s},t,r);return this.emit("setAttribute",n),n.intercepted?n.returnValue:n.target.call(n.that,n.data.name,n.data.value)})),this.ctx.override(this.elemProto,"hasAttribute",((t,r,i)=>{if(!i.length)return t.apply(r,i);let[o]=i;const s=new e({name:o},t,r);return this.emit("hasAttribute",s),s.intercepted?s.returnValue:s.target.call(s.that,s.data.name)})),this.ctx.override(this.elemProto,"removeAttribute",((t,r,i)=>{if(!i.length)return t.apply(r,i);let[o]=i;const s=new e({name:o},t,r);return this.emit("removeAttribute",s),s.intercepted?s.returnValue:s.target.call(s.that,s.data.name)}))}overrideAudio(){this.ctx.override(this.window,"Audio",((t,r,i)=>{if(!i.length)return new t(...i);let[o]=i;const s=new e({url:o},t,r);return this.emit("audio",s),s.intercepted?s.returnValue:new s.target(s.data.url)}),!0)}overrideHtml(){this.hookProperty(this.Element,"innerHTML",{get:(t,r)=>{const i=new e({value:t.call(r)},t,r);return this.emit("getInnerHTML",i),i.intercepted?i.returnValue:i.data.value},set:(t,r,[i])=>{const o=new e({value:i},t,r);if(this.emit("setInnerHTML",o),o.intercepted)return o.returnValue;t.call(r,o.data.value)}}),this.hookProperty(this.Element,"outerHTML",{get:(t,r)=>{const i=new e({value:t.call(r)},t,r);return this.emit("getOuterHTML",i),i.intercepted?i.returnValue:i.data.value},set:(t,r,[i])=>{const o=new e({value:i},t,r);if(this.emit("setOuterHTML",o),o.intercepted)return o.returnValue;t.call(r,o.data.value)}})}overrideInsertAdjacentHTML(){this.ctx.override(this.elemProto,"insertAdjacentHTML",((t,r,i)=>{if(2>i.length)return t.apply(r,i);let[o,s]=i;const n=new e({position:o,html:s},t,r);return this.emit("insertAdjacentHTML",n),n.intercepted?n.returnValue:n.target.call(n.that,n.data.position,n.data.html)}))}overrideInsertAdjacentText(){this.ctx.override(this.elemProto,"insertAdjacentText",((t,r,i)=>{if(2>i.length)return t.apply(r,i);let[o,s]=i;const n=new e({position:o,text:s},t,r);return this.emit("insertAdjacentText",n),n.intercepted?n.returnValue:n.target.call(n.that,n.data.position,n.data.text)}))}hookProperty(t,e,r){if(!t)return!1;if(this.ctx.nativeMethods.isArray(t)){for(const i of t)this.hookProperty(i,e,r);return!0}const i=t.prototype;return this.ctx.overrideDescriptor(i,e,r),!0}};const s=class extends t{constructor(t){super(),this.ctx=t,this.window=t.window,this.Node=t.window.Node||{},this.nodeProto=this.Node.prototype||{},this.compareDocumentPosition=this.nodeProto.compareDocumentPosition,this.contains=this.nodeProto.contains,this.insertBefore=this.nodeProto.insertBefore,this.replaceChild=this.nodeProto.replaceChild,this.append=this.nodeProto.append,this.appendChild=this.nodeProto.appendChild,this.removeChild=this.nodeProto.removeChild,this.textContent=t.nativeMethods.getOwnPropertyDescriptor(this.nodeProto,"textContent"),this.parentNode=t.nativeMethods.getOwnPropertyDescriptor(this.nodeProto,"parentNode"),this.parentElement=t.nativeMethods.getOwnPropertyDescriptor(this.nodeProto,"parentElement"),this.childNodes=t.nativeMethods.getOwnPropertyDescriptor(this.nodeProto,"childNodes"),this.baseURI=t.nativeMethods.getOwnPropertyDescriptor(this.nodeProto,"baseURI"),this.previousSibling=t.nativeMethods.getOwnPropertyDescriptor(this.nodeProto,"previousSibling"),this.ownerDocument=t.nativeMethods.getOwnPropertyDescriptor(this.nodeProto,"ownerDocument")}overrideTextContent(){this.ctx.overrideDescriptor(this.nodeProto,"textContent",{get:(t,r)=>{const i=new e({value:t.call(r)},t,r);return this.emit("getTextContent",i),i.intercepted?i.returnValue:i.data.value},set:(t,r,[i])=>{const o=new e({value:i},t,r);if(this.emit("setTextContent",o),o.intercepted)return o.returnValue;t.call(r,o.data.value)}})}overrideAppend(){this.ctx.override(this.nodeProto,"append",((t,r,[...i])=>{const o=new e({nodes:i},t,r);return this.emit("append",o),o.intercepted?o.returnValue:o.target.call(o.that,o.data.nodes)})),this.ctx.override(this.nodeProto,"appendChild",((t,r,i)=>{if(!i.length)return t.apply(r,i);let[o]=i;const s=new e({node:o},t,r);return this.emit("appendChild",s),s.intercepted?s.returnValue:s.target.call(s.that,s.data.node)}))}overrideBaseURI(){this.ctx.overrideDescriptor(this.nodeProto,"baseURI",{get:(t,r)=>{const i=new e({value:t.call(r)},t,r);return this.emit("baseURI",i),i.intercepted?i.returnValue:i.data.value}})}overrideParent(){this.ctx.overrideDescriptor(this.nodeProto,"parentNode",{get:(t,r)=>{const i=new e({node:t.call(r)},t,r);return this.emit("parentNode",i),i.intercepted?i.returnValue:i.data.node}}),this.ctx.overrideDescriptor(this.nodeProto,"parentElement",{get:(t,r)=>{const i=new e({element:t.call(r)},t,r);return this.emit("parentElement",i),i.intercepted?i.returnValue:i.data.node}})}overrideOwnerDocument(){this.ctx.overrideDescriptor(this.nodeProto,"ownerDocument",{get:(t,r)=>{const i=new e({document:t.call(r)},t,r);return this.emit("ownerDocument",i),i.intercepted?i.returnValue:i.data.document}})}overrideCompareDocumentPosit1ion(){this.ctx.override(this.nodeProto,"compareDocumentPosition",((t,r,i)=>{if(!i.length)return t.apply(r,i);let[o]=i;const s=new e({node:o},t,r);return s.intercepted?s.returnValue:s.target.call(s.that,s.data.node)}))}overrideChildMethods(){this.ctx.override(this.nodeProto,"removeChild")}};const n=class extends t{constructor(t){super(),this.ctx=t,this.window=t.window,this.Attr=this.window.Attr||{},this.attrProto=this.Attr.prototype||{},this.value=t.nativeMethods.getOwnPropertyDescriptor(this.attrProto,"value"),this.name=t.nativeMethods.getOwnPropertyDescriptor(this.attrProto,"name"),this.getNamedItem=this.attrProto.getNamedItem||null,this.setNamedItem=this.attrProto.setNamedItem||null,this.removeNamedItem=this.attrProto.removeNamedItem||null,this.getNamedItemNS=this.attrProto.getNamedItemNS||null,this.setNamedItemNS=this.attrProto.setNamedItemNS||null,this.removeNamedItemNS=this.attrProto.removeNamedItemNS||null,this.item=this.attrProto.item||null}overrideNameValue(){this.ctx.overrideDescriptor(this.attrProto,"name",{get:(t,r)=>{const i=new e({value:t.call(r)},t,r);return this.emit("name",i),i.intercepted?i.returnValue:i.data.value}}),this.ctx.overrideDescriptor(this.attrProto,"value",{get:(t,r)=>{const i=new e({name:this.name.get.call(r),value:t.call(r)},t,r);return this.emit("getValue",i),i.intercepted?i.returnValue:i.data.value},set:(t,r,[i])=>{const o=new e({name:this.name.get.call(r),value:i},t,r);if(this.emit("setValue",o),o.intercepted)return o.returnValue;o.target.call(o.that,o.data.value)}})}overrideItemMethods(){this.ctx.override(this.attrProto,"getNamedItem",((t,r,i)=>{if(!i.length)return t.apply(r,i);let[o]=i;const s=new e({name:o},t,r);return this.emit("getNamedItem",s),s.intercepted?s.returnValue:s.target.call(s.that,s.data.name)})),this.ctx.override(this.attrProto,"setNamedItem",((t,r,i)=>{if(2>i.length)return t.apply(r,i);let[o,s]=i;const n=new e({name:o,value:s},t,r);return this.emit("setNamedItem",n),n.intercepted?n.returnValue:n.target.call(n.that,n.data.name,n.data.value)})),this.ctx.override(this.attrProto,"removeNamedItem",((t,r,i)=>{if(!i.length)return t.apply(r,i);let[o]=i;const s=new e({name:o},t,r);return this.emit("removeNamedItem",s),s.intercepted?s.returnValue:s.target.call(s.that,s.data.name)})),this.ctx.override(this.attrProto,"item",((t,r,i)=>{if(!i.length)return t.apply(r,i);let[o]=i;const s=new e({index:o},t,r);return this.emit("item",s),s.intercepted?s.returnValue:s.target.call(s.that,s.data.name)})),this.ctx.override(this.attrProto,"getNamedItemNS",((t,r,i)=>{if(2>i.length)return t.apply(r,i);let[o,s]=i;const n=new e({namespace:o,localName:s},t,r);return this.emit("getNamedItemNS",n),n.intercepted?n.returnValue:n.target.call(n.that,n.data.namespace,n.data.localName)})),this.ctx.override(this.attrProto,"setNamedItemNS",((t,r,i)=>{if(!i.length)return t.apply(r,i);let[o]=i;const s=new e({attr:o},t,r);return this.emit("setNamedItemNS",s),s.intercepted?s.returnValue:s.target.call(s.that,s.data.name)})),this.ctx.override(this.attrProto,"removeNamedItemNS",((t,r,i)=>{if(2>i.length)return t.apply(r,i);let[o,s]=i;const n=new e({namespace:o,localName:s},t,r);return this.emit("removeNamedItemNS",n),n.intercepted?n.returnValue:n.target.call(n.that,n.data.namespace,n.data.localName)}))}};const a=class extends t{constructor(t){super(),this.ctx=t,this.window=t.window,this.Function=this.window.Function,this.fnProto=this.Function.prototype,this.toString=this.fnProto.toString,this.fnStrings=t.fnStrings,this.call=this.fnProto.call,this.apply=this.fnProto.apply,this.bind=this.fnProto.bind}overrideFunction(){this.ctx.override(this.window,"Function",((t,r,i)=>{if(!i.length)return t.apply(r,i);let o=i[i.length-1],s=[];for(let t=0;t<i.length-1;t++)s.push(i[t]);const n=new e({script:o,args:s},t,r);return this.emit("function",n),n.intercepted?n.returnValue:n.target.call(n.that,...n.data.args,n.data.script)}),!0)}overrideToString(){this.ctx.override(this.fnProto,"toString",((t,r)=>{const i=new e({fn:r},t,r);return this.emit("toString",i),i.intercepted?i.returnValue:i.target.call(i.data.fn)}))}};const h=class extends t{constructor(t){super(),this.ctx=t,this.window=t.window,this.Object=this.window.Object,this.getOwnPropertyDescriptors=this.Object.getOwnPropertyDescriptors,this.getOwnPropertyDescriptor=this.Object.getOwnPropertyDescriptor,this.getOwnPropertyNames=this.Object.getOwnPropertyNames}overrideGetPropertyNames(){this.ctx.override(this.Object,"getOwnPropertyNames",((t,r,i)=>{if(!i.length)return t.apply(r,i);let[o]=i;const s=new e({names:t.call(r,o)},t,r);return this.emit("getOwnPropertyNames",s),s.intercepted?s.returnValue:s.data.names}))}overrideGetOwnPropertyDescriptors(){this.ctx.override(this.Object,"getOwnPropertyDescriptors",((t,r,i)=>{if(!i.length)return t.apply(r,i);let[o]=i;const s=new e({descriptors:t.call(r,o)},t,r);return this.emit("getOwnPropertyDescriptors",s),s.intercepted?s.returnValue:s.data.descriptors}))}};const l=class extends t{constructor(t){super(),this.ctx=t,this.window=t.window,this.fetch=this.window.fetch,this.Request=this.window.Request,this.Response=this.window.Response,this.Headers=this.window.Headers,this.reqProto=this.Request?this.Request.prototype:{},this.resProto=this.Response?this.Response.prototype:{},this.headersProto=this.Headers?this.Headers.prototype:{},this.reqUrl=t.nativeMethods.getOwnPropertyDescriptor(this.reqProto,"url"),this.resUrl=t.nativeMethods.getOwnPropertyDescriptor(this.resProto,"url"),this.reqHeaders=t.nativeMethods.getOwnPropertyDescriptor(this.reqProto,"headers"),this.resHeaders=t.nativeMethods.getOwnPropertyDescriptor(this.resProto,"headers")}override(){return this.overrideRequest(),this.overrideUrl(),this.overrideHeaders(),!0}overrideRequest(){return!!this.fetch&&(this.ctx.override(this.window,"fetch",((t,r,i)=>{if(!i.length||i[0]instanceof this.Request)return t.apply(r,i);let[o,s={}]=i;const n=new e({input:o,options:s},t,r);return this.emit("request",n),n.intercepted?n.returnValue:n.target.call(n.that,n.data.input,n.data.options)})),this.ctx.override(this.window,"Request",((t,r,i)=>{if(!i.length)return new t(...i);let[o,s={}]=i;const n=new e({input:o,options:s},t);return this.emit("request",n),n.intercepted?n.returnValue:new n.target(n.data.input,n.data.options)}),!0),!0)}overrideUrl(){return this.ctx.overrideDescriptor(this.reqProto,"url",{get:(t,r)=>{const i=new e({value:t.call(r)},t,r);return this.emit("requestUrl",i),i.intercepted?i.returnValue:i.data.value}}),this.ctx.overrideDescriptor(this.resProto,"url",{get:(t,r)=>{const i=new e({value:t.call(r)},t,r);return this.emit("responseUrl",i),i.intercepted?i.returnValue:i.data.value}}),!0}overrideHeaders(){return!!this.Headers&&(this.ctx.overrideDescriptor(this.reqProto,"headers",{get:(t,r)=>{const i=new e({value:t.call(r)},t,r);return this.emit("requestHeaders",i),i.intercepted?i.returnValue:i.data.value}}),this.ctx.overrideDescriptor(this.resProto,"headers",{get:(t,r)=>{const i=new e({value:t.call(r)},t,r);return this.emit("responseHeaders",i),i.intercepted?i.returnValue:i.data.value}}),this.ctx.override(this.headersProto,"get",((t,r,[i])=>{if(!i)return t.call(r);const o=new e({name:i,value:t.call(r,i)},t,r);return this.emit("getHeader",o),o.intercepted?o.returnValue:o.data.value})),this.ctx.override(this.headersProto,"set",((t,r,i)=>{if(2>i.length)return t.apply(r,i);let[o,s]=i;const n=new e({name:o,value:s},t,r);return this.emit("setHeader",n),n.intercepted?n.returnValue:n.target.call(n.that,n.data.name,n.data.value)})),this.ctx.override(this.headersProto,"has",((t,r,i)=>{if(!i.length)return t.call(r);let[o]=i;const s=new e({name:o,value:t.call(r,o)},t,r);return this.emit("hasHeader",s),s.intercepted?s.returnValue:s.data})),this.ctx.override(this.headersProto,"append",((t,r,i)=>{if(2>i.length)return t.apply(r,i);let[o,s]=i;const n=new e({name:o,value:s},t,r);return this.emit("appendHeader",n),n.intercepted?n.returnValue:n.target.call(n.that,n.data.name,n.data.value)})),this.ctx.override(this.headersProto,"delete",((t,r,i)=>{if(!i.length)return t.apply(r,i);let[o]=i;const s=new e({name:o},t,r);return this.emit("deleteHeader",s),s.intercepted?s.returnValue:s.target.call(s.that,s.data.name)})),!0)}};const c=class extends t{constructor(t){super(),this.ctx=t,this.window=t.window,this.XMLHttpRequest=this.window.XMLHttpRequest,this.xhrProto=this.window.XMLHttpRequest?this.window.XMLHttpRequest.prototype:{},this.open=this.xhrProto.open,this.abort=this.xhrProto.abort,this.send=this.xhrProto.send,this.overrideMimeType=this.xhrProto.overrideMimeType,this.getAllResponseHeaders=this.xhrProto.getAllResponseHeaders,this.getResponseHeader=this.xhrProto.getResponseHeader,this.setRequestHeader=this.xhrProto.setRequestHeader,this.responseURL=t.nativeMethods.getOwnPropertyDescriptor(this.xhrProto,"responseURL"),this.responseText=t.nativeMethods.getOwnPropertyDescriptor(this.xhrProto,"responseText")}override(){this.overrideOpen(),this.overrideSend(),this.overrideMimeType(),this.overrideGetResHeader(),this.overrideGetResHeaders(),this.overrideSetReqHeader()}overrideOpen(){this.ctx.override(this.xhrProto,"open",((t,r,i)=>{if(2>i.length)return t.apply(r,i);let[o,s,n=!0,a=null,h=null]=i;const l=new e({method:o,input:s,async:n,user:a,password:h},t,r);return this.emit("open",l),l.intercepted?l.returnValue:l.target.call(l.that,l.data.method,l.data.input,l.data.async,l.data.user,l.data.password)}))}overrideResponseUrl(){this.ctx.overrideDescriptor(this.xhrProto,"responseURL",{get:(t,r)=>{const i=new e({value:t.call(r)},t,r);return this.emit("responseUrl",i),i.intercepted?i.returnValue:i.data.value}})}overrideSend(){this.ctx.override(this.xhrProto,"send",((t,r,[i=null])=>{const o=new e({body:i},t,r);return this.emit("send",o),o.intercepted?o.returnValue:o.target.call(o.that,o.data.body)}))}overrideSetReqHeader(){this.ctx.override(this.xhrProto,"setRequestHeader",((t,r,i)=>{if(2>i.length)return t.apply(r,i);let[o,s]=i;const n=new e({name:o,value:s},t,r);return this.emit("setReqHeader",n),n.intercepted?n.returnValue:n.target.call(n.that,n.data.name,n.data.value)}))}overrideGetResHeaders(){this.ctx.override(this.xhrProto,"getAllResponseHeaders",((t,r)=>{const i=new e({value:t.call(r)},t,r);return this.emit("getAllResponseHeaders",i),i.intercepted?i.returnValue:i.data.value}))}overrideGetResHeader(){this.ctx.override(this.xhrProto,"getResponseHeader",((t,r,i)=>{if(!i.length)return t.apply(r,i);let[o]=i;const s=new e({name:o,value:t.call(r,o)},t,r);return s.intercepted?s.returnValue:s.data.value}))}};const d=class extends t{constructor(t){super(),this.ctx=t,this.window=t.window,this.EventSource=this.window.EventSource||{},this.esProto=this.EventSource.prototype||{},this.url=t.nativeMethods.getOwnPropertyDescriptor(this.esProto,"url"),this.CONNECTING=0,this.OPEN=1,this.CLOSED=2}overrideConstruct(){this.ctx.override(this.window,"EventSource",((t,r,i)=>{if(!i.length)return new t(...i);let[o,s={}]=i;const n=new e({url:o,config:s},t,r);return this.emit("construct",n),n.intercepted?n.returnValue:new n.target(n.data.url,n.data.config)}),!0),"EventSource"in this.window&&(this.window.EventSource.CONNECTING=this.CONNECTING,this.window.EventSource.OPEN=this.OPEN,this.window.EventSource.CLOSED=this.CLOSED)}overrideUrl(){this.ctx.overrideDescriptor(this.esProto,"url",{get:(t,r)=>{const i=new e({value:t.call(r)},t,r);return this.emit("url",i),i.data.value}})}};const u=class extends t{constructor(t){super(),this.ctx=t,this.window=this.ctx.window,this.History=this.window.History,this.history=this.window.history,this.historyProto=this.History?this.History.prototype:{},this.pushState=this.historyProto.pushState,this.replaceState=this.historyProto.replaceState,this.go=this.historyProto.go,this.back=this.historyProto.back,this.forward=this.historyProto.forward}override(){this.overridePushState(),this.overrideReplaceState(),this.overrideGo(),this.overrideForward(),this.overrideBack()}overridePushState(){this.ctx.override(this.historyProto,"pushState",((t,r,i)=>{if(2>i.length)return t.apply(r,i);let[o,s,n=""]=i;const a=new e({state:o,title:s,url:n},t,r);return this.emit("pushState",a),a.intercepted?a.returnValue:a.target.call(a.that,a.data.state,a.data.title,a.data.url)}))}overrideReplaceState(){this.ctx.override(this.historyProto,"replaceState",((t,r,i)=>{if(2>i.length)return t.apply(r,i);let[o,s,n=""]=i;const a=new e({state:o,title:s,url:n},t,r);return this.emit("replaceState",a),a.intercepted?a.returnValue:a.target.call(a.that,a.data.state,a.data.title,a.data.url)}))}overrideGo(){this.ctx.override(this.historyProto,"go",((t,r,[i])=>{const o=new e({delta:i},t,r);return this.emit("go",o),o.intercepted?o.returnValue:o.target.call(o.that,o.data.delta)}))}overrideForward(){this.ctx.override(this.historyProto,"forward",((t,r)=>{const i=new e(null,t,r);return this.emit("forward",i),i.intercepted?i.returnValue:i.target.call(i.that)}))}overrideBack(){this.ctx.override(this.historyProto,"back",((t,r)=>{const i=new e(null,t,r);return this.emit("back",i),i.intercepted?i.returnValue:i.target.call(i.that)}))}};const p=class extends t{constructor(t){super(),this.ctx=t,this.window=t.window,this.location=this.window.location,this.WorkerLocation=this.ctx.worker?this.window.WorkerLocation:null,this.workerLocProto=this.WorkerLocation?this.WorkerLocation.prototype:{},this.keys=["href","protocol","host","hostname","port","pathname","search","hash","origin"],this.HashChangeEvent=this.window.HashChangeEvent||null,this.href=this.WorkerLocation?t.nativeMethods.getOwnPropertyDescriptor(this.workerLocProto,"href"):t.nativeMethods.getOwnPropertyDescriptor(this.location,"href")}overrideWorkerLocation(t){if(!this.WorkerLocation)return!1;const e=this;for(const r of this.keys)this.ctx.overrideDescriptor(this.workerLocProto,r,{get:()=>t(e.href.get.call(this.location))[r]});return!0}emulate(t,e){const r={},i=this;for(const o of i.keys)this.ctx.nativeMethods.defineProperty(r,o,{get:()=>t(i.href.get.call(i.location))[o],set:"origin"!==o?function(t){switch(o){case"href":i.location.href=e(t);break;case"hash":i.emit("hashchange",r.href,t.trim().startsWith("#")?new URL(t.trim(),r.href).href:new URL("#"+t.trim(),r.href).href,i);break;default:{const s=new URL(r.href);s[o]=t,i.location.href=e(s.href)}}}:void 0,configurable:!1,enumerable:!0});return"reload"in this.location&&this.ctx.nativeMethods.defineProperty(r,"reload",{value:this.ctx.wrap(this.location,"reload",((t,e)=>t.call(e===r?this.location:e))),writable:!1,enumerable:!0}),"replace"in this.location&&this.ctx.nativeMethods.defineProperty(r,"replace",{value:this.ctx.wrap(this.location,"assign",((t,i,o)=>{o.length&&i===r||t.call(i),i=this.location;let[s]=o;const n=new URL(s,r.href);return t.call(i===r?this.location:i,e(n.href))})),writable:!1,enumerable:!0}),"assign"in this.location&&this.ctx.nativeMethods.defineProperty(r,"assign",{value:this.ctx.wrap(this.location,"assign",((t,i,o)=>{o.length&&i===r||t.call(i),i=this.location;let[s]=o;const n=new URL(s,r.href);return t.call(i===r?this.location:i,e(n.href))})),writable:!1,enumerable:!0}),"ancestorOrigins"in this.location&&this.ctx.nativeMethods.defineProperty(r,"ancestorOrigins",{get(){const t=[];return i.window.DOMStringList&&i.ctx.nativeMethods.setPrototypeOf(t,i.window.DOMStringList.prototype),t},set:void 0,enumerable:!0}),this.ctx.nativeMethods.defineProperty(r,"toString",{value:this.ctx.wrap(this.location,"toString",(()=>r.href)),enumerable:!0,writable:!1}),this.ctx.nativeMethods.defineProperty(r,Symbol.toPrimitive,{value:()=>r.href,writable:!1,enumerable:!1}),this.ctx.window.Location&&this.ctx.nativeMethods.setPrototypeOf(r,this.ctx.window.Location.prototype),r}};const w=class extends t{constructor(t){super(),this.ctx=t,this.window=this.ctx.window,this.postMessage=this.window.postMessage,this.MessageEvent=this.window.MessageEvent||{},this.MessagePort=this.window.MessagePort||{},this.mpProto=this.MessagePort.prototype||{},this.mpPostMessage=this.mpProto.postMessage,this.messageProto=this.MessageEvent.prototype||{},this.messageData=t.nativeMethods.getOwnPropertyDescriptor(this.messageProto,"data"),this.messageOrigin=t.nativeMethods.getOwnPropertyDescriptor(this.messageProto,"origin")}overridePostMessage(){this.ctx.override(this.window,"postMessage",((t,r,i)=>{if(!i.length)return t.apply(r,i);let o,s,n;this.ctx.worker?[o,n=[]]=i:[o,s,n=[]]=i;const a=new e({message:o,origin:s,transfer:n,worker:this.ctx.worker},t,r);return this.emit("postMessage",a),a.intercepted?a.returnValue:this.ctx.worker?a.target.call(a.that,a.data.message,a.data.transfer):a.target.call(a.that,a.data.message,a.data.origin,a.data.transfer)}))}wrapPostMessage(t,r,i=!1){return this.ctx.wrap(t,r,((r,o,s)=>{if(this.ctx.worker?!s.length:2>s)return r.apply(o,s);let n,a,h;i?([n,h=[]]=s,a=null):[n,a,h=[]]=s;const l=new e({message:n,origin:a,transfer:h,worker:this.ctx.worker},r,t);return this.emit("postMessage",l),l.intercepted?l.returnValue:i?l.target.call(l.that,l.data.message,l.data.transfer):l.target.call(l.that,l.data.message,l.data.origin,l.data.transfer)}))}overrideMessageOrigin(){this.ctx.overrideDescriptor(this.messageProto,"origin",{get:(t,r)=>{const i=new e({value:t.call(r)},t,r);return this.emit("origin",i),i.intercepted?i.returnValue:i.data.value}})}overrideMessageData(){this.ctx.overrideDescriptor(this.messageProto,"data",{get:(t,r)=>{const i=new e({value:t.call(r)},t,r);return this.emit("data",i),i.intercepted?i.returnValue:i.data.value}})}};const v=class extends t{constructor(t){super(),this.ctx=t,this.window=t.window,this.navigator=this.window.navigator,this.Navigator=this.window.Navigator||{},this.navProto=this.Navigator.prototype||{},this.sendBeacon=this.navProto.sendBeacon}overrideSendBeacon(){this.ctx.override(this.navProto,"sendBeacon",((t,r,i)=>{if(!i.length)return t.apply(r,i);let[o,s=""]=i;const n=new e({url:o,data:s},t,r);return this.emit("sendBeacon",n),n.intercepted?n.returnValue:n.target.call(n.that,n.data.url,n.data.data)}))}};const m=class extends t{constructor(t){super(),this.ctx=t,this.window=t.window,this.Worker=this.window.Worker||{},this.Worklet=this.window.Worklet||{},this.workletProto=this.Worklet.prototype||{},this.workerProto=this.Worker.prototype||{},this.postMessage=this.workerProto.postMessage,this.terminate=this.workerProto.terminate,this.addModule=this.workletProto.addModule}overrideWorker(){this.ctx.override(this.window,"Worker",((t,r,i)=>{if(!i.length)return new t(...i);let[o,s={}]=i;const n=new e({url:o,options:s},t,r);return this.emit("worker",n),n.intercepted?n.returnValue:new n.target(...[n.data.url,n.data.options])}),!0)}overrideAddModule(){this.ctx.override(this.workletProto,"addModule",((t,r,i)=>{if(!i.length)return t.apply(r,i);let[o,s={}]=i;const n=new e({url:o,options:s},t,r);return this.emit("addModule",n),n.intercepted?n.returnValue:n.target.call(n.that,n.data.url,n.data.options)}))}overridePostMessage(){this.ctx.override(this.workerProto,"postMessage",((t,r,i)=>{if(!i.length)return t.apply(r,i);let[o,s=[]]=i;const n=new e({message:o,transfer:s},t,r);return this.emit("postMessage",n),n.intercepted?n.returnValue:n.target.call(n.that,n.data.message,n.data.transfer)}))}overrideImportScripts(){this.ctx.override(this.window,"importScripts",((t,r,i)=>{if(!i.length)return t.apply(r,i);const o=new e({scripts:i},t,r);return this.emit("importScripts",o),o.intercepted?o.returnValue:o.target.apply(o.that,o.data.scripts)}))}};const g=class extends t{constructor(t){super(),this.ctx=t,this.window=this.ctx.window,this.URL=this.window.URL||{},this.createObjectURL=this.URL.createObjectURL,this.revokeObjectURL=this.URL.revokeObjectURL}overrideObjectURL(){this.ctx.override(this.URL,"createObjectURL",((t,r,i)=>{if(!i.length)return t.apply(r,i);let[o]=i;const s=new e({object:o},t,r);return this.emit("createObjectURL",s),s.intercepted?s.returnValue:s.target.call(s.that,s.data.object)})),this.ctx.override(this.URL,"revokeObjectURL",((t,r,i)=>{if(!i.length)return t.apply(r,i);let[o]=i;const s=new e({url:o},t,r);return this.emit("revokeObjectURL",s),s.intercepted?s.returnValue:s.target.call(s.that,s.data.url)}))}};const y=class extends t{constructor(t){super(),this.ctx=t,this.window=t.window,this.localStorage=this.window.localStorage||null,this.sessionStorage=this.window.sessionStorage||null,this.Storage=this.window.Storage||{},this.storeProto=this.Storage.prototype||{},this.getItem=this.storeProto.getItem||null,this.setItem=this.storeProto.setItem||null,this.removeItem=this.storeProto.removeItem||null,this.clear=this.storeProto.clear||null,this.key=this.storeProto.key||null,this.methods=["key","getItem","setItem","removeItem","clear"],this.wrappers=new t.nativeMethods.Map}overrideMethods(){this.ctx.override(this.storeProto,"getItem",((t,r,i)=>{if(!i.length)return t.apply(this.wrappers.get(r)||r,i);let[o]=i;const s=new e({name:o},t,this.wrappers.get(r)||r);return this.emit("getItem",s),s.intercepted?s.returnValue:s.target.call(s.that,s.data.name)})),this.ctx.override(this.storeProto,"setItem",((t,r,i)=>{if(2>i.length)return t.apply(this.wrappers.get(r)||r,i);let[o,s]=i;const n=new e({name:o,value:s},t,this.wrappers.get(r)||r);return this.emit("setItem",n),n.intercepted?n.returnValue:n.target.call(n.that,n.data.name,n.data.value)})),this.ctx.override(this.storeProto,"removeItem",((t,r,i)=>{if(!i.length)return t.apply(this.wrappers.get(r)||r,i);let[o]=i;const s=new e({name:o},t,this.wrappers.get(r)||r);return this.emit("removeItem",s),s.intercepted?s.returnValue:s.target.call(s.that,s.data.name)})),this.ctx.override(this.storeProto,"clear",((t,r)=>{const i=new e(null,t,this.wrappers.get(r)||r);return this.emit("clear",i),i.intercepted?i.returnValue:i.target.call(i.that)})),this.ctx.override(this.storeProto,"key",((t,r,i)=>{if(!i.length)return t.apply(this.wrappers.get(r)||r,i);let[o]=i;const s=new e({index:o},t,this.wrappers.get(r)||r);return this.emit("key",s),s.intercepted?s.returnValue:s.target.call(s.that,s.data.index)}))}overrideLength(){this.ctx.overrideDescriptor(this.storeProto,"length",{get:(t,r)=>{const i=new e({length:t.call(this.wrappers.get(r)||r)},t,this.wrappers.get(r)||r);return this.emit("length",i),i.intercepted?i.returnValue:i.data.length}})}emulate(t,r={}){this.ctx.nativeMethods.setPrototypeOf(r,this.storeProto);const i=new this.ctx.window.Proxy(r,{get:(r,i)=>{if(i in this.storeProto||"symbol"==typeof i)return t[i];const o=new e({name:i},null,t);return this.emit("get",o),o.intercepted?o.returnValue:t[o.data.name]},set:(r,i,o)=>{if(i in this.storeProto||"symbol"==typeof i)return t[i]=o;const s=new e({name:i,value:o},null,t);return this.emit("set",s),s.intercepted?s.returnValue:t[s.data.name]=s.data.value},deleteProperty:(r,i)=>{if("symbol"==typeof i)return delete t[i];const o=new e({name:i},null,t);return this.emit("delete",o),o.intercepted?o.returnValue:delete t[o.data.name]}});return this.wrappers.set(i,t),this.ctx.nativeMethods.setPrototypeOf(i,this.storeProto),i}};const f=class extends t{constructor(t){super(),this.ctx=t,this.window=t.window,this.CSSStyleDeclaration=this.window.CSSStyleDeclaration||{},this.cssStyleProto=this.CSSStyleDeclaration.prototype||{},this.getPropertyValue=this.cssStyleProto.getPropertyValue||null,this.setProperty=this.cssStyleProto.setProperty||null,this.cssText,t.nativeMethods.getOwnPropertyDescriptors(this.cssStyleProto,"cssText"),this.urlProps=["background","backgroundImage","borderImage","borderImageSource","listStyle","listStyleImage","cursor"],this.dashedUrlProps=["background","background-image","border-image","border-image-source","list-style","list-style-image","cursor"],this.propToDashed={background:"background",backgroundImage:"background-image",borderImage:"border-image",borderImageSource:"border-image-source",listStyle:"list-style",listStyleImage:"list-style-image",cursor:"cursor"}}overrideSetGetProperty(){this.ctx.override(this.cssStyleProto,"getPropertyValue",((t,r,i)=>{if(!i.length)return t.apply(r,i);let[o]=i;const s=new e({property:o},t,r);return this.emit("getPropertyValue",s),s.intercepted?s.returnValue:s.target.call(s.that,s.data.property)})),this.ctx.override(this.cssStyleProto,"setProperty",((t,r,i)=>{if(2>i.length)return t.apply(r,i);let[o,s]=i;const n=new e({property:o,value:s},t,r);return this.emit("setProperty",n),n.intercepted?n.returnValue:n.target.call(n.that,n.data.property,n.data.value)}))}overrideCssText(){this.ctx.overrideDescriptor(this.cssStyleProto,"cssText",{get:(t,r)=>{const i=new e({value:t.call(r)},t,r);return this.emit("getCssText",i),i.intercepted?i.returnValue:i.data.value},set:(t,r,[i])=>{const o=new e({value:i},t,r);return this.emit("setCssText",o),o.intercepted?o.returnValue:o.target.call(o.that,o.data.value)}})}};class P extends t{constructor(t=self,e=!t.window){super(),this.window=t,this.nativeMethods={fnToString:this.window.Function.prototype.toString,defineProperty:this.window.Object.defineProperty,getOwnPropertyDescriptor:this.window.Object.getOwnPropertyDescriptor,getOwnPropertyDescriptors:this.window.Object.getOwnPropertyDescriptors,getOwnPropertyNames:this.window.Object.getOwnPropertyNames,keys:this.window.Object.keys,getOwnPropertySymbols:this.window.Object.getOwnPropertySymbols,isArray:this.window.Array.isArray,setPrototypeOf:this.window.Object.setPrototypeOf,isExtensible:this.window.Object.isExtensible,Map:this.window.Map,Proxy:this.window.Proxy},this.worker=e,this.fetch=new l(this),this.xhr=new c(this),this.history=new u(this),this.element=new o(this),this.node=new s(this),this.document=new i(this),this.function=new a(this),this.object=new h(this),this.message=new w(this),this.navigator=new v(this),this.eventSource=new d(this),this.attribute=new n(this),this.url=new g(this),this.workers=new m(this),this.location=new p(this),this.storage=new y(this),this.style=new f(this)}initLocation(t,e){this.location=new p(this,e,t,this.worker)}override(t,e,r,i){const o=this.wrap(t,e,r,i);return t[e]=o}overrideDescriptor(t,e,r={}){const i=this.wrapDescriptor(t,e,r);return i?(this.nativeMethods.defineProperty(t,e,i),i):{}}wrap(t,e,r,i){const o=t[e];if(!o)return o;const s="prototype"in o?function(){return r(o,this,[...arguments])}:{attach(){return r(o,this,[...arguments])}}.attach;return i&&(s.prototype=o.prototype,s.prototype.constructor=s),this.emit("wrap",o,s,!!i),s}wrapDescriptor(t,e,r={}){const i=this.nativeMethods.getOwnPropertyDescriptor(t,e);if(!i)return!1;for(let t in r)t in i&&(i[t]="get"===t||"set"===t?this.wrap(i,t,r[t]):"function"==typeof r[t]?r[t](i[t]):r[t]);return i}}"object"==typeof self&&(self.UVClient=P)})()})();
(()=>{"use strict";var t={666:t=>{var e,r="object"==typeof Reflect?Reflect:null,i=r&&"function"==typeof r.apply?r.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};e=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var o=Number.isNaN||function(t){return t!=t};function s(){s.init.call(this)}t.exports=s,t.exports.once=function(t,e){return new Promise((function(r,i){function o(r){t.removeListener(e,s),i(r)}function s(){"function"==typeof t.removeListener&&t.removeListener("error",o),r([].slice.call(arguments))}v(t,e,s,{once:!0}),"error"!==e&&function(t,e,r){"function"==typeof t.on&&v(t,"error",e,r)}(t,o,{once:!0})}))},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var n=10;function a(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function h(t){return void 0===t._maxListeners?s.defaultMaxListeners:t._maxListeners}function l(t,e,r,i){var o,s,n,l;if(a(r),void 0===(s=t._events)?(s=t._events=Object.create(null),t._eventsCount=0):(void 0!==s.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),s=t._events),n=s[e]),void 0===n)n=s[e]=r,++t._eventsCount;else if("function"==typeof n?n=s[e]=i?[r,n]:[n,r]:i?n.unshift(r):n.push(r),(o=h(t))>0&&n.length>o&&!n.warned){n.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+n.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=t,c.type=e,c.count=n.length,l=c,console&&console.warn&&console.warn(l)}return t}function c(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(t,e,r){var i={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},o=c.bind(i);return o.listener=r,i.wrapFn=o,o}function u(t,e,r){var i=t._events;if(void 0===i)return[];var o=i[e];return void 0===o?[]:"function"==typeof o?r?[o.listener||o]:[o]:r?function(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}(o):w(o,o.length)}function p(t){var e=this._events;if(void 0!==e){var r=e[t];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function w(t,e){for(var r=new Array(e),i=0;i<e;++i)r[i]=t[i];return r}function v(t,e,r,i){if("function"==typeof t.on)i.once?t.once(e,r):t.on(e,r);else{if("function"!=typeof t.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t);t.addEventListener(e,(function o(s){i.once&&t.removeEventListener(e,o),r(s)}))}}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return n},set:function(t){if("number"!=typeof t||t<0||o(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");n=t}}),s.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||o(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},s.prototype.getMaxListeners=function(){return h(this)},s.prototype.emit=function(t){for(var e=[],r=1;r<arguments.length;r++)e.push(arguments[r]);var o="error"===t,s=this._events;if(void 0!==s)o=o&&void 0===s.error;else if(!o)return!1;if(o){var n;if(e.length>0&&(n=e[0]),n instanceof Error)throw n;var a=new Error("Unhandled error."+(n?" ("+n.message+")":""));throw a.context=n,a}var h=s[t];if(void 0===h)return!1;if("function"==typeof h)i(h,this,e);else{var l=h.length,c=w(h,l);for(r=0;r<l;++r)i(c[r],this,e)}return!0},s.prototype.addListener=function(t,e){return l(this,t,e,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(t,e){return l(this,t,e,!0)},s.prototype.once=function(t,e){return a(e),this.on(t,d(this,t,e)),this},s.prototype.prependOnceListener=function(t,e){return a(e),this.prependListener(t,d(this,t,e)),this},s.prototype.removeListener=function(t,e){var r,i,o,s,n;if(a(e),void 0===(i=this._events))return this;if(void 0===(r=i[t]))return this;if(r===e||r.listener===e)0==--this._eventsCount?this._events=Object.create(null):(delete i[t],i.removeListener&&this.emit("removeListener",t,r.listener||e));else if("function"!=typeof r){for(o=-1,s=r.length-1;s>=0;s--)if(r[s]===e||r[s].listener===e){n=r[s].listener,o=s;break}if(o<0)return this;0===o?r.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}(r,o),1===r.length&&(i[t]=r[0]),void 0!==i.removeListener&&this.emit("removeListener",t,n||e)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(t){var e,r,i;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[t]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[t]),this;if(0===arguments.length){var o,s=Object.keys(r);for(i=0;i<s.length;++i)"removeListener"!==(o=s[i])&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(e=r[t]))this.removeListener(t,e);else if(void 0!==e)for(i=e.length-1;i>=0;i--)this.removeListener(t,e[i]);return this},s.prototype.listeners=function(t){return u(this,t,!0)},s.prototype.rawListeners=function(t){return u(this,t,!1)},s.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):p.call(t,e)},s.prototype.listenerCount=p,s.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]}}},e={};function r(i){var o=e[i];if(void 0!==o)return o.exports;var s=e[i]={exports:{}};return t[i](s,s.exports,r),s.exports}(()=>{var t=r(666);const e=class{#t;#e;constructor(t={},e=null,r=null){this.#t=!1,this.#e=null,this.data=t,this.target=e,this.that=r}get intercepted(){return this.#t}get returnValue(){return this.#e}respondWith(t){this.#e=t,this.#t=!0}};const i=class extends t{constructor(t){super(),this.ctx=t,this.window=t.window,this.document=this.window.document,this.Document=this.window.Document||{},this.DOMParser=this.window.DOMParser||{},this.docProto=this.Document.prototype||{},this.domProto=this.DOMParser.prototype||{},this.title=t.nativeMethods.getOwnPropertyDescriptor(this.docProto,"title"),this.cookie=t.nativeMethods.getOwnPropertyDescriptor(this.docProto,"cookie"),this.referrer=t.nativeMethods.getOwnPropertyDescriptor(this.docProto,"referrer"),this.domain=t.nativeMethods.getOwnPropertyDescriptor(this.docProto,"domain"),this.documentURI=t.nativeMethods.getOwnPropertyDescriptor(this.docProto,"documentURI"),this.write=this.docProto.write,this.writeln=this.docProto.writeln,this.querySelector=this.docProto.querySelector,this.querySelectorAll=this.docProto.querySelectorAll,this.parseFromString=this.domProto.parseFromString,this.URL=t.nativeMethods.getOwnPropertyDescriptor(this.docProto,"URL")}overrideParseFromString(){this.ctx.override(this.domProto,"parseFromString",((t,r,i)=>{if(2>i.length)return t.apply(r,i);let[o,s]=i;const n=new e({string:o,type:s},t,r);return this.emit("parseFromString",n),n.intercepted?n.returnValue:n.target.call(n.that,n.data.string,n.data.type)}))}overrideQuerySelector(){this.ctx.override(this.docProto,"querySelector",((t,r,i)=>{if(!i.length)return t.apply(r,i);let[o]=i;const s=new e({selectors:o},t,r);return this.emit("querySelector",s),s.intercepted?s.returnValue:s.target.call(s.that,s.data.selectors)}))}overrideDomain(){this.ctx.overrideDescriptor(this.docProto,"domain",{get:(t,r)=>{const i=new e({value:t.call(r)},t,r);return this.emit("getDomain",i),i.intercepted?i.returnValue:i.data.value},set:(t,r,[i])=>{const o=new e({value:i},t,r);return this.emit("setDomain",o),o.intercepted?o.returnValue:o.target.call(o.that,o.data.value)}})}overrideReferrer(){this.ctx.overrideDescriptor(this.docProto,"referrer",{get:(t,r)=>{const i=new e({value:t.call(r)},t,r);return this.emit("referrer",i),i.intercepted?i.returnValue:i.data.value}})}overrideCreateTreeWalker(){this.ctx.override(this.docProto,"createTreeWalker",((t,r,i)=>{if(!i.length)return t.apply(r,i);let[o,s=4294967295,n,a]=i;const h=new e({root:o,show:s,filter:n,expandEntityReferences:a},t,r);return this.emit("createTreeWalker",h),h.intercepted?h.returnValue:h.target.call(h.that,h.data.root,h.data.show,h.data.filter,h.data.expandEntityReferences)}))}overrideWrite(){this.ctx.override(this.docProto,"write",((t,r,i)=>{if(!i.length)return t.apply(r,i);let[...o]=i;const s=new e({html:o},t,r);return this.emit("write",s),s.intercepted?s.returnValue:s.target.apply(s.that,s.data.html)})),this.ctx.override(this.docProto,"writeln",((t,r,i)=>{if(!i.length)return t.apply(r,i);let[...o]=i;const s=new e({html:o},t,r);return this.emit("writeln",s),s.intercepted?s.returnValue:s.target.apply(s.that,s.data.html)}))}overrideDocumentURI(){this.ctx.overrideDescriptor(this.docProto,"documentURI",{get:(t,r)=>{const i=new e({value:t.call(r)},t,r);return this.emit("documentURI",i),i.intercepted?i.returnValue:i.data.value}})}overrideURL(){this.ctx.overrideDescriptor(this.docProto,"URL",{get:(t,r)=>{const i=new e({value:t.call(r)},t,r);return this.emit("url",i),i.intercepted?i.returnValue:i.data.value}})}overrideCookie(){this.ctx.overrideDescriptor(this.docProto,"cookie",{get:(t,r)=>{const i=new e({value:t.call(r)},t,r);return this.emit("getCookie",i),i.intercepted?i.returnValue:i.data.value},set:(t,r,[i])=>{const o=new e({value:i},t,r);return this.emit("setCookie",o),o.intercepted?o.returnValue:o.target.call(o.that,o.data.value)}})}overrideTitle(){this.ctx.overrideDescriptor(this.docProto,"title",{get:(t,r)=>{const i=new e({value:t.call(r)},t,r);return this.emit("getTitle",i),i.intercepted?i.returnValue:i.data.value},set:(t,r,[i])=>{const o=new e({value:i},t,r);return this.emit("setTitle",o),o.intercepted?o.returnValue:o.target.call(o.that,o.data.value)}})}};const o=class extends t{constructor(t){super(),this.ctx=t,this.window=t.window,this.Audio=this.window.Audio,this.Element=this.window.Element,this.elemProto=this.Element?this.Element.prototype:{},this.innerHTML=t.nativeMethods.getOwnPropertyDescriptor(this.elemProto,"innerHTML"),this.outerHTML=t.nativeMethods.getOwnPropertyDescriptor(this.elemProto,"outerHTML"),this.setAttribute=this.elemProto.setAttribute,this.getAttribute=this.elemProto.getAttribute,this.removeAttribute=this.elemProto.removeAttribute,this.hasAttribute=this.elemProto.hasAttribute,this.querySelector=this.elemProto.querySelector,this.querySelectorAll=this.elemProto.querySelectorAll,this.insertAdjacentHTML=this.elemProto.insertAdjacentHTML,this.insertAdjacentText=this.elemProto.insertAdjacentText}overrideQuerySelector(){this.ctx.override(this.elemProto,"querySelector",((t,r,i)=>{if(!i.length)return t.apply(r,i);let[o]=i;const s=new e({selectors:o},t,r);return this.emit("querySelector",s),s.intercepted?s.returnValue:s.target.call(s.that,s.data.selectors)}))}overrideAttribute(){this.ctx.override(this.elemProto,"getAttribute",((t,r,i)=>{if(!i.length)return t.apply(r,i);let[o]=i;const s=new e({name:o},t,r);return this.emit("getAttribute",s),s.intercepted?s.returnValue:s.target.call(s.that,s.data.name)})),this.ctx.override(this.elemProto,"setAttribute",((t,r,i)=>{if(2>i.length)return t.apply(r,i);let[o,s]=i;const n=new e({name:o,value:s},t,r);return this.emit("setAttribute",n),n.intercepted?n.returnValue:n.target.call(n.that,n.data.name,n.data.value)})),this.ctx.override(this.elemProto,"hasAttribute",((t,r,i)=>{if(!i.length)return t.apply(r,i);let[o]=i;const s=new e({name:o},t,r);return this.emit("hasAttribute",s),s.intercepted?s.returnValue:s.target.call(s.that,s.data.name)})),this.ctx.override(this.elemProto,"removeAttribute",((t,r,i)=>{if(!i.length)return t.apply(r,i);let[o]=i;const s=new e({name:o},t,r);return this.emit("removeAttribute",s),s.intercepted?s.returnValue:s.target.call(s.that,s.data.name)}))}overrideAudio(){this.ctx.override(this.window,"Audio",((t,r,i)=>{if(!i.length)return new t(...i);let[o]=i;const s=new e({url:o},t,r);return this.emit("audio",s),s.intercepted?s.returnValue:new s.target(s.data.url)}),!0)}overrideHtml(){this.hookProperty(this.Element,"innerHTML",{get:(t,r)=>{const i=new e({value:t.call(r)},t,r);return this.emit("getInnerHTML",i),i.intercepted?i.returnValue:i.data.value},set:(t,r,[i])=>{const o=new e({value:i},t,r);if(this.emit("setInnerHTML",o),o.intercepted)return o.returnValue;t.call(r,o.data.value)}}),this.hookProperty(this.Element,"outerHTML",{get:(t,r)=>{const i=new e({value:t.call(r)},t,r);return this.emit("getOuterHTML",i),i.intercepted?i.returnValue:i.data.value},set:(t,r,[i])=>{const o=new e({value:i},t,r);if(this.emit("setOuterHTML",o),o.intercepted)return o.returnValue;t.call(r,o.data.value)}})}overrideInsertAdjacentHTML(){this.ctx.override(this.elemProto,"insertAdjacentHTML",((t,r,i)=>{if(2>i.length)return t.apply(r,i);let[o,s]=i;const n=new e({position:o,html:s},t,r);return this.emit("insertAdjacentHTML",n),n.intercepted?n.returnValue:n.target.call(n.that,n.data.position,n.data.html)}))}overrideInsertAdjacentText(){this.ctx.override(this.elemProto,"insertAdjacentText",((t,r,i)=>{if(2>i.length)return t.apply(r,i);let[o,s]=i;const n=new e({position:o,text:s},t,r);return this.emit("insertAdjacentText",n),n.intercepted?n.returnValue:n.target.call(n.that,n.data.position,n.data.text)}))}hookProperty(t,e,r){if(!t)return!1;if(this.ctx.nativeMethods.isArray(t)){for(const i of t)this.hookProperty(i,e,r);return!0}const i=t.prototype;return this.ctx.overrideDescriptor(i,e,r),!0}};const s=class extends t{constructor(t){super(),this.ctx=t,this.window=t.window,this.Node=t.window.Node||{},this.nodeProto=this.Node.prototype||{},this.compareDocumentPosition=this.nodeProto.compareDocumentPosition,this.contains=this.nodeProto.contains,this.insertBefore=this.nodeProto.insertBefore,this.replaceChild=this.nodeProto.replaceChild,this.append=this.nodeProto.append,this.appendChild=this.nodeProto.appendChild,this.removeChild=this.nodeProto.removeChild,this.textContent=t.nativeMethods.getOwnPropertyDescriptor(this.nodeProto,"textContent"),this.parentNode=t.nativeMethods.getOwnPropertyDescriptor(this.nodeProto,"parentNode"),this.parentElement=t.nativeMethods.getOwnPropertyDescriptor(this.nodeProto,"parentElement"),this.childNodes=t.nativeMethods.getOwnPropertyDescriptor(this.nodeProto,"childNodes"),this.baseURI=t.nativeMethods.getOwnPropertyDescriptor(this.nodeProto,"baseURI"),this.previousSibling=t.nativeMethods.getOwnPropertyDescriptor(this.nodeProto,"previousSibling"),this.ownerDocument=t.nativeMethods.getOwnPropertyDescriptor(this.nodeProto,"ownerDocument")}overrideTextContent(){this.ctx.overrideDescriptor(this.nodeProto,"textContent",{get:(t,r)=>{const i=new e({value:t.call(r)},t,r);return this.emit("getTextContent",i),i.intercepted?i.returnValue:i.data.value},set:(t,r,[i])=>{const o=new e({value:i},t,r);if(this.emit("setTextContent",o),o.intercepted)return o.returnValue;t.call(r,o.data.value)}})}overrideAppend(){this.ctx.override(this.nodeProto,"append",((t,r,[...i])=>{const o=new e({nodes:i},t,r);return this.emit("append",o),o.intercepted?o.returnValue:o.target.call(o.that,o.data.nodes)})),this.ctx.override(this.nodeProto,"appendChild",((t,r,i)=>{if(!i.length)return t.apply(r,i);let[o]=i;const s=new e({node:o},t,r);return this.emit("appendChild",s),s.intercepted?s.returnValue:s.target.call(s.that,s.data.node)}))}overrideBaseURI(){this.ctx.overrideDescriptor(this.nodeProto,"baseURI",{get:(t,r)=>{const i=new e({value:t.call(r)},t,r);return this.emit("baseURI",i),i.intercepted?i.returnValue:i.data.value}})}overrideParent(){this.ctx.overrideDescriptor(this.nodeProto,"parentNode",{get:(t,r)=>{const i=new e({node:t.call(r)},t,r);return this.emit("parentNode",i),i.intercepted?i.returnValue:i.data.node}}),this.ctx.overrideDescriptor(this.nodeProto,"parentElement",{get:(t,r)=>{const i=new e({element:t.call(r)},t,r);return this.emit("parentElement",i),i.intercepted?i.returnValue:i.data.node}})}overrideOwnerDocument(){this.ctx.overrideDescriptor(this.nodeProto,"ownerDocument",{get:(t,r)=>{const i=new e({document:t.call(r)},t,r);return this.emit("ownerDocument",i),i.intercepted?i.returnValue:i.data.document}})}overrideCompareDocumentPosit1ion(){this.ctx.override(this.nodeProto,"compareDocumentPosition",((t,r,i)=>{if(!i.length)return t.apply(r,i);let[o]=i;const s=new e({node:o},t,r);return s.intercepted?s.returnValue:s.target.call(s.that,s.data.node)}))}overrideChildMethods(){this.ctx.override(this.nodeProto,"removeChild")}};const n=class extends t{constructor(t){super(),this.ctx=t,this.window=t.window,this.Attr=this.window.Attr||{},this.attrProto=this.Attr.prototype||{},this.value=t.nativeMethods.getOwnPropertyDescriptor(this.attrProto,"value"),this.name=t.nativeMethods.getOwnPropertyDescriptor(this.attrProto,"name"),this.getNamedItem=this.attrProto.getNamedItem||null,this.setNamedItem=this.attrProto.setNamedItem||null,this.removeNamedItem=this.attrProto.removeNamedItem||null,this.getNamedItemNS=this.attrProto.getNamedItemNS||null,this.setNamedItemNS=this.attrProto.setNamedItemNS||null,this.removeNamedItemNS=this.attrProto.removeNamedItemNS||null,this.item=this.attrProto.item||null}overrideNameValue(){this.ctx.overrideDescriptor(this.attrProto,"name",{get:(t,r)=>{const i=new e({value:t.call(r)},t,r);return this.emit("name",i),i.intercepted?i.returnValue:i.data.value}}),this.ctx.overrideDescriptor(this.attrProto,"value",{get:(t,r)=>{const i=new e({name:this.name.get.call(r),value:t.call(r)},t,r);return this.emit("getValue",i),i.intercepted?i.returnValue:i.data.value},set:(t,r,[i])=>{const o=new e({name:this.name.get.call(r),value:i},t,r);if(this.emit("setValue",o),o.intercepted)return o.returnValue;o.target.call(o.that,o.data.value)}})}overrideItemMethods(){this.ctx.override(this.attrProto,"getNamedItem",((t,r,i)=>{if(!i.length)return t.apply(r,i);let[o]=i;const s=new e({name:o},t,r);return this.emit("getNamedItem",s),s.intercepted?s.returnValue:s.target.call(s.that,s.data.name)})),this.ctx.override(this.attrProto,"setNamedItem",((t,r,i)=>{if(2>i.length)return t.apply(r,i);let[o,s]=i;const n=new e({name:o,value:s},t,r);return this.emit("setNamedItem",n),n.intercepted?n.returnValue:n.target.call(n.that,n.data.name,n.data.value)})),this.ctx.override(this.attrProto,"removeNamedItem",((t,r,i)=>{if(!i.length)return t.apply(r,i);let[o]=i;const s=new e({name:o},t,r);return this.emit("removeNamedItem",s),s.intercepted?s.returnValue:s.target.call(s.that,s.data.name)})),this.ctx.override(this.attrProto,"item",((t,r,i)=>{if(!i.length)return t.apply(r,i);let[o]=i;const s=new e({index:o},t,r);return this.emit("item",s),s.intercepted?s.returnValue:s.target.call(s.that,s.data.name)})),this.ctx.override(this.attrProto,"getNamedItemNS",((t,r,i)=>{if(2>i.length)return t.apply(r,i);let[o,s]=i;const n=new e({namespace:o,localName:s},t,r);return this.emit("getNamedItemNS",n),n.intercepted?n.returnValue:n.target.call(n.that,n.data.namespace,n.data.localName)})),this.ctx.override(this.attrProto,"setNamedItemNS",((t,r,i)=>{if(!i.length)return t.apply(r,i);let[o]=i;const s=new e({attr:o},t,r);return this.emit("setNamedItemNS",s),s.intercepted?s.returnValue:s.target.call(s.that,s.data.name)})),this.ctx.override(this.attrProto,"removeNamedItemNS",((t,r,i)=>{if(2>i.length)return t.apply(r,i);let[o,s]=i;const n=new e({namespace:o,localName:s},t,r);return this.emit("removeNamedItemNS",n),n.intercepted?n.returnValue:n.target.call(n.that,n.data.namespace,n.data.localName)}))}};const a=class extends t{constructor(t){super(),this.ctx=t,this.window=t.window,this.Function=this.window.Function,this.fnProto=this.Function.prototype,this.toString=this.fnProto.toString,this.fnStrings=t.fnStrings,this.call=this.fnProto.call,this.apply=this.fnProto.apply,this.bind=this.fnProto.bind}overrideFunction(){this.ctx.override(this.window,"Function",((t,r,i)=>{if(!i.length)return t.apply(r,i);let o=i[i.length-1],s=[];for(let t=0;t<i.length-1;t++)s.push(i[t]);const n=new e({script:o,args:s},t,r);return this.emit("function",n),n.intercepted?n.returnValue:n.target.call(n.that,...n.data.args,n.data.script)}),!0)}overrideToString(){this.ctx.override(this.fnProto,"toString",((t,r)=>{const i=new e({fn:r},t,r);return this.emit("toString",i),i.intercepted?i.returnValue:i.target.call(i.data.fn)}))}};const h=class extends t{constructor(t){super(),this.ctx=t,this.window=t.window,this.Object=this.window.Object,this.getOwnPropertyDescriptors=this.Object.getOwnPropertyDescriptors,this.getOwnPropertyDescriptor=this.Object.getOwnPropertyDescriptor,this.getOwnPropertyNames=this.Object.getOwnPropertyNames}overrideGetPropertyNames(){this.ctx.override(this.Object,"getOwnPropertyNames",((t,r,i)=>{if(!i.length)return t.apply(r,i);let[o]=i;const s=new e({names:t.call(r,o)},t,r);return this.emit("getOwnPropertyNames",s),s.intercepted?s.returnValue:s.data.names}))}overrideGetOwnPropertyDescriptors(){this.ctx.override(this.Object,"getOwnPropertyDescriptors",((t,r,i)=>{if(!i.length)return t.apply(r,i);let[o]=i;const s=new e({descriptors:t.call(r,o)},t,r);return this.emit("getOwnPropertyDescriptors",s),s.intercepted?s.returnValue:s.data.descriptors}))}};const l=class extends t{constructor(t){super(),this.ctx=t,this.window=t.window,this.fetch=this.window.fetch,this.Request=this.window.Request,this.Response=this.window.Response,this.Headers=this.window.Headers,this.reqProto=this.Request?this.Request.prototype:{},this.resProto=this.Response?this.Response.prototype:{},this.headersProto=this.Headers?this.Headers.prototype:{},this.reqUrl=t.nativeMethods.getOwnPropertyDescriptor(this.reqProto,"url"),this.resUrl=t.nativeMethods.getOwnPropertyDescriptor(this.resProto,"url"),this.reqHeaders=t.nativeMethods.getOwnPropertyDescriptor(this.reqProto,"headers"),this.resHeaders=t.nativeMethods.getOwnPropertyDescriptor(this.resProto,"headers")}override(){return this.overrideRequest(),this.overrideUrl(),this.overrideHeaders(),!0}overrideRequest(){return!!this.fetch&&(this.ctx.override(this.window,"fetch",((t,r,i)=>{if(!i.length||i[0]instanceof this.Request)return t.apply(r,i);let[o,s={}]=i;const n=new e({input:o,options:s},t,r);return this.emit("request",n),n.intercepted?n.returnValue:n.target.call(n.that,n.data.input,n.data.options)})),this.ctx.override(this.window,"Request",((t,r,i)=>{if(!i.length)return new t(...i);let[o,s={}]=i;const n=new e({input:o,options:s},t);return this.emit("request",n),n.intercepted?n.returnValue:new n.target(n.data.input,n.data.options)}),!0),!0)}overrideUrl(){return this.ctx.overrideDescriptor(this.reqProto,"url",{get:(t,r)=>{const i=new e({value:t.call(r)},t,r);return this.emit("requestUrl",i),i.intercepted?i.returnValue:i.data.value}}),this.ctx.overrideDescriptor(this.resProto,"url",{get:(t,r)=>{const i=new e({value:t.call(r)},t,r);return this.emit("responseUrl",i),i.intercepted?i.returnValue:i.data.value}}),!0}overrideHeaders(){return!!this.Headers&&(this.ctx.overrideDescriptor(this.reqProto,"headers",{get:(t,r)=>{const i=new e({value:t.call(r)},t,r);return this.emit("requestHeaders",i),i.intercepted?i.returnValue:i.data.value}}),this.ctx.overrideDescriptor(this.resProto,"headers",{get:(t,r)=>{const i=new e({value:t.call(r)},t,r);return this.emit("responseHeaders",i),i.intercepted?i.returnValue:i.data.value}}),this.ctx.override(this.headersProto,"get",((t,r,[i])=>{if(!i)return t.call(r);const o=new e({name:i,value:t.call(r,i)},t,r);return this.emit("getHeader",o),o.intercepted?o.returnValue:o.data.value})),this.ctx.override(this.headersProto,"set",((t,r,i)=>{if(2>i.length)return t.apply(r,i);let[o,s]=i;const n=new e({name:o,value:s},t,r);return this.emit("setHeader",n),n.intercepted?n.returnValue:n.target.call(n.that,n.data.name,n.data.value)})),this.ctx.override(this.headersProto,"has",((t,r,i)=>{if(!i.length)return t.call(r);let[o]=i;const s=new e({name:o,value:t.call(r,o)},t,r);return this.emit("hasHeader",s),s.intercepted?s.returnValue:s.data})),this.ctx.override(this.headersProto,"append",((t,r,i)=>{if(2>i.length)return t.apply(r,i);let[o,s]=i;const n=new e({name:o,value:s},t,r);return this.emit("appendHeader",n),n.intercepted?n.returnValue:n.target.call(n.that,n.data.name,n.data.value)})),this.ctx.override(this.headersProto,"delete",((t,r,i)=>{if(!i.length)return t.apply(r,i);let[o]=i;const s=new e({name:o},t,r);return this.emit("deleteHeader",s),s.intercepted?s.returnValue:s.target.call(s.that,s.data.name)})),!0)}};const c=class extends t{constructor(t){super(),this.ctx=t,this.window=t.window,this.XMLHttpRequest=this.window.XMLHttpRequest,this.xhrProto=this.window.XMLHttpRequest?this.window.XMLHttpRequest.prototype:{},this.open=this.xhrProto.open,this.abort=this.xhrProto.abort,this.send=this.xhrProto.send,this.overrideMimeType=this.xhrProto.overrideMimeType,this.getAllResponseHeaders=this.xhrProto.getAllResponseHeaders,this.getResponseHeader=this.xhrProto.getResponseHeader,this.setRequestHeader=this.xhrProto.setRequestHeader,this.responseURL=t.nativeMethods.getOwnPropertyDescriptor(this.xhrProto,"responseURL"),this.responseText=t.nativeMethods.getOwnPropertyDescriptor(this.xhrProto,"responseText")}override(){this.overrideOpen(),this.overrideSend(),this.overrideMimeType(),this.overrideGetResHeader(),this.overrideGetResHeaders(),this.overrideSetReqHeader()}overrideOpen(){this.ctx.override(this.xhrProto,"open",((t,r,i)=>{if(2>i.length)return t.apply(r,i);let[o,s,n=!0,a=null,h=null]=i;const l=new e({method:o,input:s,async:n,user:a,password:h},t,r);return this.emit("open",l),l.intercepted?l.returnValue:l.target.call(l.that,l.data.method,l.data.input,l.data.async,l.data.user,l.data.password)}))}overrideResponseUrl(){this.ctx.overrideDescriptor(this.xhrProto,"responseURL",{get:(t,r)=>{const i=new e({value:t.call(r)},t,r);return this.emit("responseUrl",i),i.intercepted?i.returnValue:i.data.value}})}overrideSend(){this.ctx.override(this.xhrProto,"send",((t,r,[i=null])=>{const o=new e({body:i},t,r);return this.emit("send",o),o.intercepted?o.returnValue:o.target.call(o.that,o.data.body)}))}overrideSetReqHeader(){this.ctx.override(this.xhrProto,"setRequestHeader",((t,r,i)=>{if(2>i.length)return t.apply(r,i);let[o,s]=i;const n=new e({name:o,value:s},t,r);return this.emit("setReqHeader",n),n.intercepted?n.returnValue:n.target.call(n.that,n.data.name,n.data.value)}))}overrideGetResHeaders(){this.ctx.override(this.xhrProto,"getAllResponseHeaders",((t,r)=>{const i=new e({value:t.call(r)},t,r);return this.emit("getAllResponseHeaders",i),i.intercepted?i.returnValue:i.data.value}))}overrideGetResHeader(){this.ctx.override(this.xhrProto,"getResponseHeader",((t,r,i)=>{if(!i.length)return t.apply(r,i);let[o]=i;const s=new e({name:o,value:t.call(r,o)},t,r);return s.intercepted?s.returnValue:s.data.value}))}};const d=class extends t{constructor(t){super(),this.ctx=t,this.window=t.window,this.EventSource=this.window.EventSource||{},this.esProto=this.EventSource.prototype||{},this.url=t.nativeMethods.getOwnPropertyDescriptor(this.esProto,"url"),this.CONNECTING=0,this.OPEN=1,this.CLOSED=2}overrideConstruct(){this.ctx.override(this.window,"EventSource",((t,r,i)=>{if(!i.length)return new t(...i);let[o,s={}]=i;const n=new e({url:o,config:s},t,r);return this.emit("construct",n),n.intercepted?n.returnValue:new n.target(n.data.url,n.data.config)}),!0),"EventSource"in this.window&&(this.window.EventSource.CONNECTING=this.CONNECTING,this.window.EventSource.OPEN=this.OPEN,this.window.EventSource.CLOSED=this.CLOSED)}overrideUrl(){this.ctx.overrideDescriptor(this.esProto,"url",{get:(t,r)=>{const i=new e({value:t.call(r)},t,r);return this.emit("url",i),i.data.value}})}};const u=class extends t{constructor(t){super(),this.ctx=t,this.window=this.ctx.window,this.History=this.window.History,this.history=this.window.history,this.historyProto=this.History?this.History.prototype:{},this.pushState=this.historyProto.pushState,this.replaceState=this.historyProto.replaceState,this.go=this.historyProto.go,this.back=this.historyProto.back,this.forward=this.historyProto.forward}override(){this.overridePushState(),this.overrideReplaceState(),this.overrideGo(),this.overrideForward(),this.overrideBack()}overridePushState(){this.ctx.override(this.historyProto,"pushState",((t,r,i)=>{if(2>i.length)return t.apply(r,i);let[o,s,n=""]=i;const a=new e({state:o,title:s,url:n},t,r);return this.emit("pushState",a),a.intercepted?a.returnValue:a.target.call(a.that,a.data.state,a.data.title,a.data.url)}))}overrideReplaceState(){this.ctx.override(this.historyProto,"replaceState",((t,r,i)=>{if(2>i.length)return t.apply(r,i);let[o,s,n=""]=i;const a=new e({state:o,title:s,url:n},t,r);return this.emit("replaceState",a),a.intercepted?a.returnValue:a.target.call(a.that,a.data.state,a.data.title,a.data.url)}))}overrideGo(){this.ctx.override(this.historyProto,"go",((t,r,[i])=>{const o=new e({delta:i},t,r);return this.emit("go",o),o.intercepted?o.returnValue:o.target.call(o.that,o.data.delta)}))}overrideForward(){this.ctx.override(this.historyProto,"forward",((t,r)=>{const i=new e(null,t,r);return this.emit("forward",i),i.intercepted?i.returnValue:i.target.call(i.that)}))}overrideBack(){this.ctx.override(this.historyProto,"back",((t,r)=>{const i=new e(null,t,r);return this.emit("back",i),i.intercepted?i.returnValue:i.target.call(i.that)}))}};const p=class extends t{constructor(t){super(),this.ctx=t,this.window=t.window,this.location=this.window.location,this.WorkerLocation=this.ctx.worker?this.window.WorkerLocation:null,this.workerLocProto=this.WorkerLocation?this.WorkerLocation.prototype:{},this.keys=["href","protocol","host","hostname","port","pathname","search","hash","origin"],this.HashChangeEvent=this.window.HashChangeEvent||null,this.href=this.WorkerLocation?t.nativeMethods.getOwnPropertyDescriptor(this.workerLocProto,"href"):t.nativeMethods.getOwnPropertyDescriptor(this.location,"href")}overrideWorkerLocation(t){if(!this.WorkerLocation)return!1;const e=this;for(const r of this.keys)this.ctx.overrideDescriptor(this.workerLocProto,r,{get:()=>t(e.href.get.call(this.location))[r]});return!0}emulate(t,e){const r={},i=this;for(const o of i.keys)this.ctx.nativeMethods.defineProperty(r,o,{get:()=>t(i.href.get.call(i.location))[o],set:"origin"!==o?function(t){switch(o){case"href":i.location.href=e(t);break;case"hash":i.emit("hashchange",r.href,t.trim().startsWith("#")?new URL(t.trim(),r.href).href:new URL("#"+t.trim(),r.href).href,i);break;default:{const s=new URL(r.href);s[o]=t,i.location.href=e(s.href)}}}:void 0,configurable:!1,enumerable:!0});return"reload"in this.location&&this.ctx.nativeMethods.defineProperty(r,"reload",{value:this.ctx.wrap(this.location,"reload",((t,e)=>t.call(e===r?this.location:e))),writable:!1,enumerable:!0}),"replace"in this.location&&this.ctx.nativeMethods.defineProperty(r,"replace",{value:this.ctx.wrap(this.location,"assign",((t,i,o)=>{o.length&&i===r||t.call(i),i=this.location;let[s]=o;const n=new URL(s,r.href);return t.call(i===r?this.location:i,e(n.href))})),writable:!1,enumerable:!0}),"assign"in this.location&&this.ctx.nativeMethods.defineProperty(r,"assign",{value:this.ctx.wrap(this.location,"assign",((t,i,o)=>{o.length&&i===r||t.call(i),i=this.location;let[s]=o;const n=new URL(s,r.href);return t.call(i===r?this.location:i,e(n.href))})),writable:!1,enumerable:!0}),"ancestorOrigins"in this.location&&this.ctx.nativeMethods.defineProperty(r,"ancestorOrigins",{get(){const t=[];return i.window.DOMStringList&&i.ctx.nativeMethods.setPrototypeOf(t,i.window.DOMStringList.prototype),t},set:void 0,enumerable:!0}),this.ctx.nativeMethods.defineProperty(r,"toString",{value:this.ctx.wrap(this.location,"toString",(()=>r.href)),enumerable:!0,writable:!1}),this.ctx.nativeMethods.defineProperty(r,Symbol.toPrimitive,{value:()=>r.href,writable:!1,enumerable:!1}),this.ctx.window.Location&&this.ctx.nativeMethods.setPrototypeOf(r,this.ctx.window.Location.prototype),r}};const w=class extends t{constructor(t){super(),this.ctx=t,this.window=this.ctx.window,this.postMessage=this.window.postMessage,this.MessageEvent=this.window.MessageEvent||{},this.MessagePort=this.window.MessagePort||{},this.mpProto=this.MessagePort.prototype||{},this.mpPostMessage=this.mpProto.postMessage,this.messageProto=this.MessageEvent.prototype||{},this.messageData=t.nativeMethods.getOwnPropertyDescriptor(this.messageProto,"data"),this.messageOrigin=t.nativeMethods.getOwnPropertyDescriptor(this.messageProto,"origin")}overridePostMessage(){this.ctx.override(this.window,"postMessage",((t,r,i)=>{if(!i.length)return t.apply(r,i);let o,s,n;this.ctx.worker?[o,n=[]]=i:[o,s,n=[]]=i;const a=new e({message:o,origin:s,transfer:n,worker:this.ctx.worker},t,r);return this.emit("postMessage",a),a.intercepted?a.returnValue:this.ctx.worker?a.target.call(a.that,a.data.message,a.data.transfer):a.target.call(a.that,a.data.message,a.data.origin,a.data.transfer)}))}wrapPostMessage(t,r,i=!1){return this.ctx.wrap(t,r,((r,o,s)=>{if(this.ctx.worker?!s.length:2>s)return r.apply(o,s);let n,a,h;i?([n,h=[]]=s,a=null):[n,a,h=[]]=s;const l=new e({message:n,origin:a,transfer:h,worker:this.ctx.worker},r,t);return this.emit("postMessage",l),l.intercepted?l.returnValue:i?l.target.call(l.that,l.data.message,l.data.transfer):l.target.call(l.that,l.data.message,l.data.origin,l.data.transfer)}))}overrideMessageOrigin(){this.ctx.overrideDescriptor(this.messageProto,"origin",{get:(t,r)=>{const i=new e({value:t.call(r)},t,r);return this.emit("origin",i),i.intercepted?i.returnValue:i.data.value}})}overrideMessageData(){this.ctx.overrideDescriptor(this.messageProto,"data",{get:(t,r)=>{const i=new e({value:t.call(r)},t,r);return this.emit("data",i),i.intercepted?i.returnValue:i.data.value}})}};const v=class extends t{constructor(t){super(),this.ctx=t,this.window=t.window,this.navigator=this.window.navigator,this.Navigator=this.window.Navigator||{},this.navProto=this.Navigator.prototype||{},this.sendBeacon=this.navProto.sendBeacon}overrideSendBeacon(){this.ctx.override(this.navProto,"sendBeacon",((t,r,i)=>{if(!i.length)return t.apply(r,i);let[o,s=""]=i;const n=new e({url:o,data:s},t,r);return this.emit("sendBeacon",n),n.intercepted?n.returnValue:n.target.call(n.that,n.data.url,n.data.data)}))}};const m=class extends t{constructor(t){super(),this.ctx=t,this.window=t.window,this.Worker=this.window.Worker||{},this.Worklet=this.window.Worklet||{},this.workletProto=this.Worklet.prototype||{},this.workerProto=this.Worker.prototype||{},this.postMessage=this.workerProto.postMessage,this.terminate=this.workerProto.terminate,this.addModule=this.workletProto.addModule}overrideWorker(){this.ctx.override(this.window,"Worker",((t,r,i)=>{if(!i.length)return new t(...i);let[o,s={}]=i;const n=new e({url:o,options:s},t,r);return this.emit("worker",n),n.intercepted?n.returnValue:new n.target(...[n.data.url,n.data.options])}),!0)}overrideAddModule(){this.ctx.override(this.workletProto,"addModule",((t,r,i)=>{if(!i.length)return t.apply(r,i);let[o,s={}]=i;const n=new e({url:o,options:s},t,r);return this.emit("addModule",n),n.intercepted?n.returnValue:n.target.call(n.that,n.data.url,n.data.options)}))}overridePostMessage(){this.ctx.override(this.workerProto,"postMessage",((t,r,i)=>{if(!i.length)return t.apply(r,i);let[o,s=[]]=i;const n=new e({message:o,transfer:s},t,r);return this.emit("postMessage",n),n.intercepted?n.returnValue:n.target.call(n.that,n.data.message,n.data.transfer)}))}overrideImportScripts(){this.ctx.override(this.window,"importScripts",((t,r,i)=>{if(!i.length)return t.apply(r,i);const o=new e({scripts:i},t,r);return this.emit("importScripts",o),o.intercepted?o.returnValue:o.target.apply(o.that,o.data.scripts)}))}};const g=class extends t{constructor(t){super(),this.ctx=t,this.window=this.ctx.window,this.URL=this.window.URL||{},this.createObjectURL=this.URL.createObjectURL,this.revokeObjectURL=this.URL.revokeObjectURL}overrideObjectURL(){this.ctx.override(this.URL,"createObjectURL",((t,r,i)=>{if(!i.length)return t.apply(r,i);let[o]=i;const s=new e({object:o},t,r);return this.emit("createObjectURL",s),s.intercepted?s.returnValue:s.target.call(s.that,s.data.object)})),this.ctx.override(this.URL,"revokeObjectURL",((t,r,i)=>{if(!i.length)return t.apply(r,i);let[o]=i;const s=new e({url:o},t,r);return this.emit("revokeObjectURL",s),s.intercepted?s.returnValue:s.target.call(s.that,s.data.url)}))}};const y=class extends t{constructor(t){super(),this.ctx=t,this.window=t.window,this.localStorage=this.window.localStorage||null,this.sessionStorage=this.window.sessionStorage||null,this.Storage=this.window.Storage||{},this.storeProto=this.Storage.prototype||{},this.getItem=this.storeProto.getItem||null,this.setItem=this.storeProto.setItem||null,this.removeItem=this.storeProto.removeItem||null,this.clear=this.storeProto.clear||null,this.key=this.storeProto.key||null,this.methods=["key","getItem","setItem","removeItem","clear"],this.wrappers=new t.nativeMethods.Map}overrideMethods(){this.ctx.override(this.storeProto,"getItem",((t,r,i)=>{if(!i.length)return t.apply(this.wrappers.get(r)||r,i);let[o]=i;const s=new e({name:o},t,this.wrappers.get(r)||r);return this.emit("getItem",s),s.intercepted?s.returnValue:s.target.call(s.that,s.data.name)})),this.ctx.override(this.storeProto,"setItem",((t,r,i)=>{if(2>i.length)return t.apply(this.wrappers.get(r)||r,i);let[o,s]=i;const n=new e({name:o,value:s},t,this.wrappers.get(r)||r);return this.emit("setItem",n),n.intercepted?n.returnValue:n.target.call(n.that,n.data.name,n.data.value)})),this.ctx.override(this.storeProto,"removeItem",((t,r,i)=>{if(!i.length)return t.apply(this.wrappers.get(r)||r,i);let[o]=i;const s=new e({name:o},t,this.wrappers.get(r)||r);return this.emit("removeItem",s),s.intercepted?s.returnValue:s.target.call(s.that,s.data.name)})),this.ctx.override(this.storeProto,"clear",((t,r)=>{const i=new e(null,t,this.wrappers.get(r)||r);return this.emit("clear",i),i.intercepted?i.returnValue:i.target.call(i.that)})),this.ctx.override(this.storeProto,"key",((t,r,i)=>{if(!i.length)return t.apply(this.wrappers.get(r)||r,i);let[o]=i;const s=new e({index:o},t,this.wrappers.get(r)||r);return this.emit("key",s),s.intercepted?s.returnValue:s.target.call(s.that,s.data.index)}))}overrideLength(){this.ctx.overrideDescriptor(this.storeProto,"length",{get:(t,r)=>{const i=new e({length:t.call(this.wrappers.get(r)||r)},t,this.wrappers.get(r)||r);return this.emit("length",i),i.intercepted?i.returnValue:i.data.length}})}emulate(t,r={}){this.ctx.nativeMethods.setPrototypeOf(r,this.storeProto);const i=new this.ctx.window.Proxy(r,{get:(r,i)=>{if(i in this.storeProto||"symbol"==typeof i)return t[i];const o=new e({name:i},null,t);return this.emit("get",o),o.intercepted?o.returnValue:t[o.data.name]},set:(r,i,o)=>{if(i in this.storeProto||"symbol"==typeof i)return t[i]=o;const s=new e({name:i,value:o},null,t);return this.emit("set",s),s.intercepted?s.returnValue:t[s.data.name]=s.data.value},deleteProperty:(r,i)=>{if("symbol"==typeof i)return delete t[i];const o=new e({name:i},null,t);return this.emit("delete",o),o.intercepted?o.returnValue:delete t[o.data.name]}});return this.wrappers.set(i,t),this.ctx.nativeMethods.setPrototypeOf(i,this.storeProto),i}};const f=class extends t{constructor(t){super(),this.ctx=t,this.window=t.window,this.CSSStyleDeclaration=this.window.CSSStyleDeclaration||{},this.cssStyleProto=this.CSSStyleDeclaration.prototype||{},this.getPropertyValue=this.cssStyleProto.getPropertyValue||null,this.setProperty=this.cssStyleProto.setProperty||null,this.cssText,t.nativeMethods.getOwnPropertyDescriptors(this.cssStyleProto,"cssText"),this.urlProps=["background","backgroundImage","borderImage","borderImageSource","listStyle","listStyleImage","cursor"],this.dashedUrlProps=["background","background-image","border-image","border-image-source","list-style","list-style-image","cursor"],this.propToDashed={background:"background",backgroundImage:"background-image",borderImage:"border-image",borderImageSource:"border-image-source",listStyle:"list-style",listStyleImage:"list-style-image",cursor:"cursor"}}overrideSetGetProperty(){this.ctx.override(this.cssStyleProto,"getPropertyValue",((t,r,i)=>{if(!i.length)return t.apply(r,i);let[o]=i;const s=new e({property:o},t,r);return this.emit("getPropertyValue",s),s.intercepted?s.returnValue:s.target.call(s.that,s.data.property)})),this.ctx.override(this.cssStyleProto,"setProperty",((t,r,i)=>{if(2>i.length)return t.apply(r,i);let[o,s]=i;const n=new e({property:o,value:s},t,r);return this.emit("setProperty",n),n.intercepted?n.returnValue:n.target.call(n.that,n.data.property,n.data.value)}))}overrideCssText(){this.ctx.overrideDescriptor(this.cssStyleProto,"cssText",{get:(t,r)=>{const i=new e({value:t.call(r)},t,r);return this.emit("getCssText",i),i.intercepted?i.returnValue:i.data.value},set:(t,r,[i])=>{const o=new e({value:i},t,r);return this.emit("setCssText",o),o.intercepted?o.returnValue:o.target.call(o.that,o.data.value)}})}};const P=class extends t{constructor(t){super(),this.ctx=t,this.window=this.ctx.window,this.IDBDatabase=this.window.IDBDatabase||{},this.idbDatabaseProto=this.IDBDatabase.prototype||{},this.IDBFactory=this.window.IDBFactory||{},this.idbFactoryProto=this.IDBFactory.prototype||{},this.open=this.idbFactoryProto.open}overrideOpen(){this.ctx.override(this.IDBFactory.prototype,"open",((t,r,i)=>{if(!i.length)return t.apply(r,i);if(!i.length)return t.apply(r,i);const[o,s]=i,n=new e({name:o,version:s},t,r);return this.emit("idbFactoryOpen",n),n.intercepted?n.returnValue:n.target.call(n.that,n.data.name,n.data.version)}))}overrideName(){this.ctx.overrideDescriptor(this.idbDatabaseProto,"name",{get:(t,r)=>{const i=new e({value:t.call(r)},t,r);return this.emit("idbFactoryName",i),i.intercepted?i.returnValue:i.data.value}})}};class x extends t{constructor(t=self,e=!t.window){super(),this.window=t,this.nativeMethods={fnToString:this.window.Function.prototype.toString,defineProperty:this.window.Object.defineProperty,getOwnPropertyDescriptor:this.window.Object.getOwnPropertyDescriptor,getOwnPropertyDescriptors:this.window.Object.getOwnPropertyDescriptors,getOwnPropertyNames:this.window.Object.getOwnPropertyNames,keys:this.window.Object.keys,getOwnPropertySymbols:this.window.Object.getOwnPropertySymbols,isArray:this.window.Array.isArray,setPrototypeOf:this.window.Object.setPrototypeOf,isExtensible:this.window.Object.isExtensible,Map:this.window.Map,Proxy:this.window.Proxy},this.worker=e,this.fetch=new l(this),this.xhr=new c(this),this.idb=new P(this),this.history=new u(this),this.element=new o(this),this.node=new s(this),this.document=new i(this),this.function=new a(this),this.object=new h(this),this.message=new w(this),this.navigator=new v(this),this.eventSource=new d(this),this.attribute=new n(this),this.url=new g(this),this.workers=new m(this),this.location=new p(this),this.storage=new y(this),this.style=new f(this)}initLocation(t,e){this.location=new p(this,e,t,this.worker)}override(t,e,r,i){const o=this.wrap(t,e,r,i);return t[e]=o,o}overrideDescriptor(t,e,r={}){const i=this.wrapDescriptor(t,e,r);return i?(this.nativeMethods.defineProperty(t,e,i),i):{}}wrap(t,e,r,i){const o=t[e];if(!o)return o;const s="prototype"in o?function(){return r(o,this,[...arguments])}:{attach(){return r(o,this,[...arguments])}}.attach;return i&&(s.prototype=o.prototype,s.prototype.constructor=s),this.emit("wrap",o,s,!!i),s}wrapDescriptor(t,e,r={}){const i=this.nativeMethods.getOwnPropertyDescriptor(t,e);if(!i)return!1;for(let t in r)t in i&&(i[t]="get"===t||"set"===t?this.wrap(i,t,r[t]):"function"==typeof r[t]?r[t](i[t]):r[t]);return i}}"object"==typeof self&&(self.UVClient=x)})()})();
//# sourceMappingURL=uv.client.js.map

@@ -1,2 +0,2 @@

(()=>{"use strict";const e=self.Ultraviolet,t=self.UVClient,a=self.__uv$config,r=self.__uv$bareData,o=self.__uv$bareURL,n=self.__uv$cookies;if("object"!=typeof r||"string"!=typeof o||"string"!=typeof n)throw new TypeError("Unable to load global UV data");function i(s){if("__uv"in s&&s.__uv instanceof e)return!1;s.document&&s.window&&s.document.querySelectorAll("script[__uv-script]").forEach((e=>e.remove()));const l=!s.window,c="__uv",d="__uv$",u=new e(a),h=new t(s),{HTMLMediaElement:m,HTMLScriptElement:p,HTMLAudioElement:g,HTMLVideoElement:v,HTMLInputElement:b,HTMLEmbedElement:f,HTMLTrackElement:y,HTMLAnchorElement:_,HTMLIFrameElement:w,HTMLAreaElement:S,HTMLLinkElement:P,HTMLBaseElement:k,HTMLFormElement:U,HTMLImageElement:M,HTMLSourceElement:O}=s;h.nativeMethods.defineProperty(s,"__uv",{value:u,enumerable:!1}),u.meta.origin=location.origin,u.location=h.location.emulate((e=>e.startsWith("about:")?new URL(e):(e.startsWith("blob:")&&(e=e.slice("blob:".length)),new URL(u.sourceUrl(e)))),(e=>u.rewriteUrl(e)));let x=n;u.meta.url=u.location,u.domain=u.meta.url.host,u.blobUrls=new s.Map,u.referrer="",u.cookies=[],u.localStorageObj={},u.sessionStorageObj={};const E=new e.BareClient(o,r);if(s.EventTarget&&(u.addEventListener=s.EventTarget.prototype.addEventListener,u.removeListener=s.EventTarget.prototype.removeListener,u.dispatchEvent=s.EventTarget.prototype.dispatchEvent),h.nativeMethods.defineProperty(h.storage.storeProto,"__uv$storageObj",{get(){return this===h.storage.sessionStorage?u.sessionStorageObj:this===h.storage.localStorage?u.localStorageObj:void 0},enumerable:!1}),s.localStorage){for(const e in s.localStorage)e.startsWith(d+u.location.origin+"@")&&(u.localStorageObj[e.slice((d+u.location.origin+"@").length)]=s.localStorage.getItem(e));u.lsWrap=h.storage.emulate(h.storage.localStorage,u.localStorageObj)}if(s.sessionStorage){for(const e in s.sessionStorage)e.startsWith(d+u.location.origin+"@")&&(u.sessionStorageObj[e.slice((d+u.location.origin+"@").length)]=s.sessionStorage.getItem(e));u.ssWrap=h.storage.emulate(h.storage.sessionStorage,u.sessionStorageObj)}let j=s.document?h.node.baseURI.get.call(s.document):s.location.href,$=u.sourceUrl(j);h.nativeMethods.defineProperty(u.meta,"base",{get:()=>s.document?(h.node.baseURI.get.call(s.document)!==j&&(j=h.node.baseURI.get.call(s.document),$=u.sourceUrl(j)),$):u.meta.url.href}),u.methods={setSource:"__uv$setSource",source:"__uv$source",location:"__uv$location",function:"__uv$function",string:"__uv$string",eval:"__uv$eval",parent:"__uv$parent",top:"__uv$top"},u.filterKeys=[c,u.methods.setSource,u.methods.source,u.methods.location,u.methods.function,u.methods.string,u.methods.eval,u.methods.parent,u.methods.top,"__uv$protocol","__uv$storageObj","__uv$url","__uv$modifiedStyle","__uv$config","__uv$dispatched","Ultraviolet","__uvHook"],h.on("wrap",((e,t)=>{h.nativeMethods.defineProperty(t,"name",h.nativeMethods.getOwnPropertyDescriptor(e,"name")),h.nativeMethods.defineProperty(t,"length",h.nativeMethods.getOwnPropertyDescriptor(e,"length")),h.nativeMethods.defineProperty(t,u.methods.string,{enumerable:!1,value:h.nativeMethods.fnToString.call(e)}),h.nativeMethods.defineProperty(t,u.methods.function,{enumerable:!1,value:e})})),h.fetch.on("request",(e=>{e.data.input=u.rewriteUrl(e.data.input)})),h.fetch.on("requestUrl",(e=>{e.data.value=u.sourceUrl(e.data.value)})),h.fetch.on("responseUrl",(e=>{e.data.value=u.sourceUrl(e.data.value)})),h.xhr.on("open",(e=>{e.data.input=u.rewriteUrl(e.data.input)})),h.xhr.on("responseUrl",(e=>{e.data.value=u.sourceUrl(e.data.value)})),h.workers.on("worker",(e=>{e.data.url=u.rewriteUrl(e.data.url)})),h.workers.on("addModule",(e=>{e.data.url=u.rewriteUrl(e.data.url)})),h.workers.on("importScripts",(e=>{for(const t in e.data.scripts)e.data.scripts[t]=u.rewriteUrl(e.data.scripts[t])})),h.workers.on("postMessage",(e=>{let t=e.data.origin;e.data.origin="*",e.data.message={__data:e.data.message,__origin:u.meta.url.origin,__to:t}})),h.navigator.on("sendBeacon",(e=>{e.data.url=u.rewriteUrl(e.data.url)})),h.document.on("getCookie",(e=>{e.data.value=x})),h.document.on("setCookie",(e=>{Promise.resolve(u.cookie.setCookies(e.data.value,u.db,u.meta)).then((()=>{u.cookie.db().then((e=>{u.cookie.getCookies(e).then((e=>{x=u.cookie.serialize(e,u.meta,!0)}))}))}));const t=u.cookie.setCookie(e.data.value)[0];t.path||(t.path="/"),t.domain||(t.domain=u.meta.url.hostname),u.cookie.validateCookie(t,u.meta,!0)&&(x.length&&(x+="; "),x+=`${t.name}=${t.value}`),e.respondWith(e.data.value)})),h.element.on("setInnerHTML",(e=>{switch(e.that.tagName){case"SCRIPT":e.data.value=u.js.rewrite(e.data.value);break;case"STYLE":e.data.value=u.rewriteCSS(e.data.value);break;default:e.data.value=u.rewriteHtml(e.data.value)}})),h.element.on("getInnerHTML",(e=>{if("SCRIPT"===e.that.tagName)e.data.value=u.js.source(e.data.value);else e.data.value=u.sourceHtml(e.data.value)})),h.element.on("setOuterHTML",(e=>{e.data.value=u.rewriteHtml(e.data.value,{document:"HTML"===e.that.tagName})})),h.element.on("getOuterHTML",(e=>{switch(e.that.tagName){case"HEAD":e.data.value=u.sourceHtml(e.data.value.replace(/<head(.*)>(.*)<\/head>/s,"<op-head$1>$2</op-head>")).replace(/<op-head(.*)>(.*)<\/op-head>/s,"<head$1>$2</head>");break;case"BODY":e.data.value=u.sourceHtml(e.data.value.replace(/<body(.*)>(.*)<\/body>/s,"<op-body$1>$2</op-body>")).replace(/<op-body(.*)>(.*)<\/op-body>/s,"<body$1>$2</body>");break;default:e.data.value=u.sourceHtml(e.data.value,{document:"HTML"===e.that.tagName})}})),h.document.on("write",(e=>{if(!e.data.html.length)return!1;e.data.html=[u.rewriteHtml(e.data.html.join(""))]})),h.document.on("writeln",(e=>{if(!e.data.html.length)return!1;e.data.html=[u.rewriteHtml(e.data.html.join(""))]})),h.element.on("insertAdjacentHTML",(e=>{e.data.html=u.rewriteHtml(e.data.html)})),h.eventSource.on("construct",(e=>{e.data.url=u.rewriteUrl(e.data.url)})),h.eventSource.on("url",(e=>{e.data.url=u.rewriteUrl(e.data.url)})),h.history.on("replaceState",(e=>{e.data.url&&(e.data.url=u.rewriteUrl(e.data.url,"__uv"in e.that?e.that.__uv.meta:u.meta))})),h.history.on("pushState",(e=>{e.data.url&&(e.data.url=u.rewriteUrl(e.data.url,"__uv"in e.that?e.that.__uv.meta:u.meta))})),h.element.on("getAttribute",(e=>{h.element.hasAttribute.call(e.that,u.attributePrefix+"-attr-"+e.data.name)&&e.respondWith(e.target.call(e.that,u.attributePrefix+"-attr-"+e.data.name))})),h.message.on("postMessage",(e=>{let t=e.data.origin,a=u.call;e.that&&(a=e.that.__uv$source.call),e.data.origin="*",e.data.message={__data:e.data.message,__origin:(e.that||e.target).__uv$source.location.origin,__to:t},e.respondWith(a(e.target,l?[e.data.message,e.data.transfer]:[e.data.message,e.data.origin,e.data.transfer],e.that))})),h.message.on("data",(e=>{const{value:t}=e.data;"object"==typeof t&&"__data"in t&&"__origin"in t&&e.respondWith(t.__data)})),h.message.on("origin",(e=>{const t=h.message.messageData.get.call(e.that);"object"==typeof t&&t.__data&&t.__origin&&e.respondWith(t.__origin)})),h.overrideDescriptor(s,"origin",{get:()=>u.location.origin}),h.node.on("baseURI",(e=>{e.data.value.startsWith(u.meta.origin)&&(e.data.value=u.sourceUrl(e.data.value))})),h.element.on("setAttribute",(e=>{if(e.that instanceof m&&"src"===e.data.name&&e.data.value.startsWith("blob:"))return e.target.call(e.that,u.attributePrefix+"-attr-"+e.data.name,e.data.value),void(e.data.value=u.blobUrls.get(e.data.value));u.attrs.isUrl(e.data.name)&&(e.target.call(e.that,u.attributePrefix+"-attr-"+e.data.name,e.data.value),e.data.value=u.rewriteUrl(e.data.value)),u.attrs.isStyle(e.data.name)&&(e.target.call(e.that,u.attributePrefix+"-attr-"+e.data.name,e.data.value),e.data.value=u.rewriteCSS(e.data.value,{context:"declarationList"})),u.attrs.isHtml(e.data.name)&&(e.target.call(e.that,u.attributePrefix+"-attr-"+e.data.name,e.data.value),e.data.value=u.rewriteHtml(e.data.value,{...u.meta,document:!0,injectHead:u.createHtmlInject(u.handlerScript,u.bundleScript,u.clientScript,u.configScript,o,r,x,s.location.href)})),u.attrs.isSrcset(e.data.name)&&(e.target.call(e.that,u.attributePrefix+"-attr-"+e.data.name,e.data.value),e.data.value=u.html.wrapSrcset(e.data.value.toString())),u.attrs.isForbidden(e.data.name)&&(e.data.name=u.attributePrefix+"-attr-"+e.data.name)})),h.element.on("audio",(e=>{e.data.url=u.rewriteUrl(e.data.url)})),h.element.hookProperty([_,S,P,k],"href",{get:(e,t)=>u.sourceUrl(e.call(t)),set:(e,t,[a])=>{h.element.setAttribute.call(t,u.attributePrefix+"-attr-href",a),e.call(t,u.rewriteUrl(a))}}),h.element.hookProperty([p,g,v,m,M,b,f,w,y,O],"src",{get:(e,t)=>u.sourceUrl(e.call(t)),set:(e,t,[a])=>{if(new String(a).toString().trim().startsWith("blob:")&&t instanceof m)return h.element.setAttribute.call(t,u.attributePrefix+"-attr-src",a),e.call(t,u.blobUrls.get(a)||a);h.element.setAttribute.call(t,u.attributePrefix+"-attr-src",a),e.call(t,u.rewriteUrl(a))}}),h.element.hookProperty([U],"action",{get:(e,t)=>u.sourceUrl(e.call(t)),set:(e,t,[a])=>{h.element.setAttribute.call(t,u.attributePrefix+"-attr-action",a),e.call(t,u.rewriteUrl(a))}}),h.element.hookProperty([M],"srcset",{get:(e,t)=>h.element.getAttribute.call(t,u.attributePrefix+"-attr-srcset")||e.call(t),set:(e,t,[a])=>{h.element.setAttribute.call(t,u.attributePrefix+"-attr-srcset",a),e.call(t,u.html.wrapSrcset(a.toString()))}}),h.element.hookProperty(p,"integrity",{get:(e,t)=>h.element.getAttribute.call(t,u.attributePrefix+"-attr-integrity"),set:(e,t,[a])=>{h.element.setAttribute.call(t,u.attributePrefix+"-attr-integrity",a)}}),h.element.hookProperty(w,"sandbox",{get:(e,t)=>h.element.getAttribute.call(t,u.attributePrefix+"-attr-sandbox")||e.call(t),set:(e,t,[a])=>{h.element.setAttribute.call(t,u.attributePrefix+"-attr-sandbox",a)}});const T=w&&Object.getOwnPropertyDescriptor(w.prototype,"contentWindow").get;function L(e){if(!e.__uv)try{i(e)}catch(e){console.error("catastrophic failure"),console.error(e)}}h.element.hookProperty(w,"contentWindow",{get:(e,t)=>{const a=T.call(t);return L(a),A(a)}}),h.element.hookProperty(w,"contentDocument",{get:(e,t)=>{const a=T.call(t);L(a);try{return A(a).document}catch(e){return null}}});const H=new WeakMap;function W(){throw new DOMException(`Blocked a frame with "${u.location.origin}" from accessing a cross-origin frame.`)}function R(e){!function(e){Reflect.setPrototypeOf(e,null);for(const t of C)Reflect.defineProperty(e,t,{value:void 0,writable:!1,enumerable:!1,configurable:!1});for(const[t,a]of Object.entries(Object.getOwnPropertyDescriptors(e)))a.configurable&&(a.enumerable=!1,a.configurable=!0,"value"in a&&(a.writable=!1),Reflect.defineProperty(e,t,a))}(e);const t={};return Reflect.setPrototypeOf(t,null),new Proxy(t,{get:(t,a,r)=>{const o=Reflect.getOwnPropertyDescriptor(e,a);return a in e&&("value"in o||"function"==typeof o.get)||W(),Reflect.get(t,a,r)},set:(t,a,r)=>{const o=Reflect.getOwnPropertyDescriptor(e,a);return a in e&&"function"==typeof o.set||W(),Reflect.set(t,a,r)},defineProperty:()=>{W()},getOwnPropertyDescriptor:(t,a,r)=>(a in e||W(),Reflect.getOwnPropertyDescriptor(t,a,r)),setPrototypeOf:()=>{W()},has:(t,a)=>(a in e||W(),!0)})}const C=["then",Symbol.toStringTag,Symbol.hasInstance,Symbol.isConcatSpreadable];function A(e){if(H.has(e))return H.get(e);if(new URL(e.__uv.meta.base).origin===new URL(s.__uv.meta.base).origin)return e;const t={get window(){return r},get location(){return a},set location(t){e.__uv.location.href=t},get closed(){return e.closed},get frames(){return r},get length(){return e.length},get top(){return e[u.methods.top]},get opener(){return A(e.opener)},get parent(){return A(e.parent)},blur(){e.blur()},close(){e.close()},focus(){e.focus()},postMessage(...t){e.__uv$setSource(u).postMessage(...t)}},a=function(e){return R({set href(t){e.__uv.location.href=t},replace(t){e.__uv.location.replace(t)}})}(e.location),r=R(t);return r}function D(e,t){const a=`on${t}`,r=new WeakMap;Reflect.defineProperty(e,a,{enumerable:!0,configurable:!0,get(){return r.has(this)?r.get(this):null},set(e){"function"==typeof e&&(r.has(this)&&this.removeEventListener(t,r.get(this)),r.set(this,e),this.addEventListener(t,e))}})}h.element.hookProperty(w,"srcdoc",{get:(e,t)=>h.element.getAttribute.call(t,u.attributePrefix+"-attr-srcdoc")||e.call(t),set:(e,t,[a])=>{e.call(t,u.rewriteHtml(a,{document:!0,injectHead:u.createHtmlInject(u.handlerScript,u.bundleScript,u.clientScript,u.configScript,o,r,x,s.location.href)}))}}),h.node.on("getTextContent",(e=>{"SCRIPT"===e.that.tagName&&(e.data.value=u.js.source(e.data.value))})),h.node.on("setTextContent",(e=>{"SCRIPT"===e.that.tagName&&(e.data.value=u.js.rewrite(e.data.value))})),"serviceWorker"in s.navigator&&delete s.Navigator.prototype.serviceWorker,h.document.on("getDomain",(e=>{e.data.value=u.domain})),h.document.on("setDomain",(e=>{if(!e.data.value.toString().endsWith(u.meta.url.hostname.split(".").slice(-2).join(".")))return e.respondWith("");e.respondWith(u.domain=e.data.value)})),h.document.on("url",(e=>{e.data.value=u.location.href})),h.document.on("documentURI",(e=>{e.data.value=u.location.href})),h.document.on("referrer",(e=>{e.data.value=u.referrer||u.sourceUrl(e.data.value)})),h.document.on("parseFromString",(e=>{if("text/html"!==e.data.type)return!1;e.data.string=u.rewriteHtml(e.data.string,{...u.meta,document:!0})})),h.attribute.on("getValue",(e=>{h.element.hasAttribute.call(e.that.ownerElement,u.attributePrefix+"-attr-"+e.data.name)&&(e.data.value=h.element.getAttribute.call(e.that.ownerElement,u.attributePrefix+"-attr-"+e.data.name))})),h.attribute.on("setValue",(e=>{u.attrs.isUrl(e.data.name)&&(h.element.setAttribute.call(e.that.ownerElement,u.attributePrefix+"-attr-"+e.data.name,e.data.value),e.data.value=u.rewriteUrl(e.data.value)),u.attrs.isStyle(e.data.name)&&(h.element.setAttribute.call(e.that.ownerElement,u.attributePrefix+"-attr-"+e.data.name,e.data.value),e.data.value=u.rewriteCSS(e.data.value,{context:"declarationList"})),u.attrs.isHtml(e.data.name)&&(h.element.setAttribute.call(e.that.ownerElement,u.attributePrefix+"-attr-"+e.data.name,e.data.value),e.data.value=u.rewriteHtml(e.data.value,{...u.meta,document:!0,injectHead:u.createHtmlInject(u.handlerScript,u.bundleScript,u.clientScript,u.configScript,o,r,x,s.location.href)})),u.attrs.isSrcset(e.data.name)&&(h.element.setAttribute.call(e.that.ownerElement,u.attributePrefix+"-attr-"+e.data.name,e.data.value),e.data.value=u.html.wrapSrcset(e.data.value.toString()))})),h.url.on("createObjectURL",(e=>{let t=e.target.call(e.that,e.data.object);if(t.startsWith("blob:"+location.origin)){let a="blob:"+("about:blank"!==u.meta.url.href?u.meta.url.origin:s.parent.__uv.meta.url.origin)+t.slice("blob:".length+location.origin.length);u.blobUrls.set(a,t),e.respondWith(a)}else e.respondWith(t)})),h.url.on("revokeObjectURL",(e=>{if(u.blobUrls.has(e.data.url)){const t=e.data.url;e.data.url=u.blobUrls.get(e.data.url),u.blobUrls.delete(t)}})),h.storage.on("get",(e=>{e.data.name=d+u.meta.url.origin+"@"+e.data.name})),h.storage.on("set",(e=>{e.that.__uv$storageObj&&(e.that.__uv$storageObj[e.data.name]=e.data.value),e.data.name=d+u.meta.url.origin+"@"+e.data.name})),h.storage.on("delete",(e=>{e.that.__uv$storageObj&&delete e.that.__uv$storageObj[e.data.name],e.data.name=d+u.meta.url.origin+"@"+e.data.name})),h.storage.on("getItem",(e=>{e.data.name=d+u.meta.url.origin+"@"+e.data.name})),h.storage.on("setItem",(e=>{e.that.__uv$storageObj&&(e.that.__uv$storageObj[e.data.name]=e.data.value),e.data.name=d+u.meta.url.origin+"@"+e.data.name})),h.storage.on("removeItem",(e=>{e.that.__uv$storageObj&&delete e.that.__uv$storageObj[e.data.name],e.data.name=d+u.meta.url.origin+"@"+e.data.name})),h.storage.on("clear",(e=>{if(e.that.__uv$storageObj)for(const t of h.nativeMethods.keys.call(null,e.that.__uv$storageObj))delete e.that.__uv$storageObj[t],h.storage.removeItem.call(e.that,d+u.meta.url.origin+"@"+t),e.respondWith()})),h.storage.on("length",(e=>{e.that.__uv$storageObj&&e.respondWith(h.nativeMethods.keys.call(null,e.that.__uv$storageObj).length)})),h.storage.on("key",(e=>{e.that.__uv$storageObj&&e.respondWith(h.nativeMethods.keys.call(null,e.that.__uv$storageObj)[e.data.index]||null)}));const I=["ws:","wss:"];class N extends EventTarget{#e;#t;#a="blob";#r="";#o="";#n="";async#i(e,t){const a={};Reflect.setPrototypeOf(a,null),a.Origin=u.meta.url.origin,a["User-Agent"]=navigator.userAgent,""!==x&&(a.Cookie=x.toString()),this.#e=await E.createWebSocket(e,a,t),this.#e.binaryType=this.#a,this.#e.addEventListener("message",(e=>{this.dispatchEvent(new MessageEvent("message",e))})),this.#e.addEventListener("open",(async e=>{this.dispatchEvent(new Event("open",e))})),this.#e.addEventListener("error",(e=>{this.dispatchEvent(new ErrorEvent("error",e))})),this.#e.addEventListener("close",(e=>{this.dispatchEvent(new Event("close",e))}));const r=await this.#e.meta;r.headers.has("sec-websocket-protocol")&&(this.#r=r.headers.get("sec-websocket-protocol")),r.headers.has("sec-websocket-extensions")&&(this.#o=r.headers.get("sec-websocket-extensions"));let o=r.rawHeaders["set-cookie"]||[];Array.isArray(o)||(o=[]);for(const e of o)document.cookie=e}get url(){return this.#n}constructor(...e){if(super(),!e.length)throw new DOMException("Failed to construct 'WebSocket': 1 argument required, but only 0 present.");const[t,a]=e;let r;try{r=new URL(t)}catch(e){throw new DOMException(`Faiiled to construct 'WebSocket': The URL '${t}' is invalid.`)}if(!I.includes(r.protocol))throw new DOMException(`Failed to construct 'WebSocket': The URL's scheme must be either 'ws' or 'wss'. '${r.protocol}' is not allowed.`);this.#t=this.#i(r,a)}get protocol(){return this.#r}get extensions(){return this.#o}get readyState(){return this.#e?this.#e.readyState:N.CONNECTING}get binaryType(){return this.#a}set binaryType(e){this.#a=e,this.#e&&(this.#e.binaryType=e)}send(e){if(!this.#e)throw new DOMException("Failed to execute 'send' on 'WebSocket': Still in CONNECTING state.");this.#e.send(e)}close(e,t){if(void 0!==e&&("number"!=typeof e&&(e=0),1e3!==e&&(e<3e3||e>4999)))throw new DOMException(`Failed to execute 'close' on 'WebSocket': The code must be either 1000, or between 3000 and 4999. ${e} is neither.`);this.#t.then((()=>this.#e.close(e,t)))}}D(N.prototype,"close"),D(N.prototype,"open"),D(N.prototype,"message"),D(N.prototype,"error");for(const e of["url","protocol","extensions","readyState","binaryType"]){const t=Object.getOwnPropertyDescriptor(s.WebSocket.prototype,e),a=Object.getOwnPropertyDescriptor(N.prototype,e);a?.get&&t?.get&&h.emit("wrap",a.get,t.get),a?.set&&t?.set&&h.emit("wrap",a.get,t.get)}if(h.emit("wrap",s.WebSocket.prototype.send,N.prototype.send),h.emit("wrap",s.WebSocket.prototype.close,N.prototype.close),h.override(s,"WebSocket",((e,t,a)=>new N(...a)),!0),N.prototype.constructor=s.WebSocket,h.function.on("function",(e=>{e.data.script=u.rewriteJS(e.data.script)})),h.function.on("toString",(e=>{u.methods.string in e.that&&e.respondWith(e.that[u.methods.string])})),h.object.on("getOwnPropertyNames",(e=>{e.data.names=e.data.names.filter((e=>!u.filterKeys.includes(e)))})),h.object.on("getOwnPropertyDescriptors",(e=>{for(const t of u.filterKeys)delete e.data.descriptors[t]})),h.style.on("setProperty",(e=>{h.style.dashedUrlProps.includes(e.data.property)&&(e.data.value=u.rewriteCSS(e.data.value,{context:"value",...u.meta}))})),h.style.on("getPropertyValue",(e=>{h.style.dashedUrlProps.includes(e.data.property)&&e.respondWith(u.sourceCSS(e.target.call(e.that,e.data.property),{context:"value",...u.meta}))})),"CSS2Properties"in s)for(const e of h.style.urlProps)h.overrideDescriptor(s.CSS2Properties.prototype,e,{get:(e,t)=>u.sourceCSS(e.call(t),{context:"value",...u.meta}),set:(e,t,a)=>{e.call(t,u.rewriteCSS(a,{context:"value",...u.meta}))}});else"HTMLElement"in s&&h.overrideDescriptor(s.HTMLElement.prototype,"style",{get:(e,t)=>{const a=e.call(t);if(!a.__uv$modifiedStyle)for(const e of h.style.urlProps)h.nativeMethods.defineProperty(a,e,{enumerable:!0,configurable:!0,get(){const t=h.style.getPropertyValue.call(this,e)||"";return u.sourceCSS(t,{context:"value",...u.meta})},set(t){h.style.setProperty.call(this,h.style.propToDashed[e]||e,u.rewriteCSS(t,{context:"value",...u.meta}))}}),h.nativeMethods.defineProperty(a,"__uv$modifiedStyle",{enumerable:!1,value:!0});return a}});h.style.on("setCssText",(e=>{e.data.value=u.rewriteCSS(e.data.value,{context:"declarationList",...u.meta})})),h.style.on("getCssText",(e=>{e.data.value=u.sourceCSS(e.data.value,{context:"declarationList",...u.meta})})),u.addEventListener.call(s,"hashchange",(e=>{if(e.__uv$dispatched)return!1;e.stopImmediatePropagation();const t=s.location.hash;h.history.replaceState.call(s.history,"","",e.oldURL),u.location.hash=t})),h.location.on("hashchange",((e,t,a)=>{if(a.HashChangeEvent&&h.history.replaceState){h.history.replaceState.call(s.history,"","",u.rewriteUrl(t));const r=new a.HashChangeEvent("hashchange",{newURL:t,oldURL:e});h.nativeMethods.defineProperty(r,"__uv$dispatched",{value:!0,enumerable:!1}),u.dispatchEvent.call(s,r)}})),h.fetch.overrideRequest(),h.fetch.overrideUrl(),h.xhr.overrideOpen(),h.xhr.overrideResponseUrl(),h.element.overrideHtml(),h.element.overrideAttribute(),h.element.overrideInsertAdjacentHTML(),h.element.overrideAudio(),h.node.overrideBaseURI(),h.node.overrideTextContent(),h.attribute.overrideNameValue(),h.document.overrideDomain(),h.document.overrideURL(),h.document.overrideDocumentURI(),h.document.overrideWrite(),h.document.overrideReferrer(),h.document.overrideParseFromString(),h.storage.overrideMethods(),h.storage.overrideLength(),h.object.overrideGetPropertyNames(),h.object.overrideGetOwnPropertyDescriptors(),h.history.overridePushState(),h.history.overrideReplaceState(),h.eventSource.overrideConstruct(),h.eventSource.overrideUrl(),h.url.overrideObjectURL(),h.document.overrideCookie(),h.message.overridePostMessage(),h.message.overrideMessageOrigin(),h.message.overrideMessageData(),h.workers.overrideWorker(),h.workers.overrideAddModule(),h.workers.overrideImportScripts(),h.workers.overridePostMessage(),h.style.overrideSetGetProperty(),h.style.overrideCssText(),h.navigator.overrideSendBeacon(),h.function.overrideFunction(),h.function.overrideToString(),h.location.overrideWorkerLocation((e=>new URL(u.sourceUrl(e)))),h.overrideDescriptor(s,"localStorage",{get:(e,t)=>(t||s).__uv.lsWrap}),h.overrideDescriptor(s,"sessionStorage",{get:(e,t)=>(t||s).__uv.ssWrap}),h.override(s,"open",((e,t,a)=>{if(!a.length)return e.apply(t,a);let[r]=a;return r=u.rewriteUrl(r),e.call(t,r)})),u.$wrap=function(e){return"location"===e?u.methods.location:"eval"===e?u.methods.eval:e},u.$get=function(e){return e===s.location?u.location:e===s.eval?u.eval:e===s.parent?s.__uv$parent:e===s.top?s.__uv$top:e},u.eval=h.wrap(s,"eval",((e,t,a)=>{if(!a.length||"string"!=typeof a[0])return e.apply(t,a);let[r]=a;return r=u.rewriteJS(r),e.call(t,r)})),u.call=function(e,t,a){return a?e.apply(a,t):e(...t)},u.call$=function(e,t,a=[]){return e[t].apply(e,a)},h.nativeMethods.defineProperty(s.Object.prototype,c,{get:()=>u,enumerable:!1}),h.nativeMethods.defineProperty(s.Object.prototype,u.methods.setSource,{value:function(e){return h.nativeMethods.isExtensible(this)?(h.nativeMethods.defineProperty(this,u.methods.source,{value:e,writable:!0,enumerable:!1}),this):this},enumerable:!1}),h.nativeMethods.defineProperty(s.Object.prototype,u.methods.source,{value:u,writable:!0,enumerable:!1}),h.nativeMethods.defineProperty(s.Object.prototype,u.methods.location,{configurable:!0,get(){return this===s.document||this===s?u.location:this.location},set(e){this===s.document||this===s?u.location.href=e:this.location=e}}),h.nativeMethods.defineProperty(s.Object.prototype,u.methods.parent,{configurable:!0,get(){const e=this.parent;if(this===s)try{return"__uv"in e?A(e):this}catch(e){return this}return e},set(e){this.parent=e}}),h.nativeMethods.defineProperty(s.Object.prototype,u.methods.top,{configurable:!0,get(){const e=this.top;if(this===s){if(e===this.parent)return this[u.methods.parent];try{if("__uv"in e)return e;{let t=this;for(;t.parent!==e;)t=t.parent;return"__uv"in t?t:this}}catch(e){return this}}return e},set(e){this.top=e}}),h.nativeMethods.defineProperty(s.Object.prototype,u.methods.eval,{configurable:!0,get(){return this===s?u.eval:this.eval},set(e){this.eval=e}})}self.__uv||i(self),self.__uvHook=i})();
(()=>{"use strict";const e=self.Ultraviolet,t=self.UVClient,a=self.__uv$config,r=self.__uv$bareData,o=self.__uv$bareURL,n=self.__uv$cookies;if("object"!=typeof r||"string"!=typeof o||"string"!=typeof n)throw new TypeError("Unable to load global UV data");function i(s){if("__uv"in s&&s.__uv instanceof e)return!1;s.document&&s.window&&s.document.querySelectorAll("script[__uv-script]").forEach((e=>e.remove()));const l=!s.window,d="__uv",c="__uv$",u=new e(a),h=new t(s),{HTMLMediaElement:m,HTMLScriptElement:v,HTMLAudioElement:p,HTMLVideoElement:g,HTMLInputElement:b,HTMLEmbedElement:f,HTMLTrackElement:y,HTMLAnchorElement:_,HTMLIFrameElement:w,HTMLAreaElement:S,HTMLLinkElement:k,HTMLBaseElement:P,HTMLFormElement:U,HTMLImageElement:M,HTMLSourceElement:x}=s;h.nativeMethods.defineProperty(s,"__uv",{value:u,enumerable:!1}),u.meta.origin=location.origin,u.location=h.location.emulate((e=>"about:srcdoc"===e?new URL(e):(e.startsWith("blob:")&&(e=e.slice("blob:".length)),new URL(u.sourceUrl(e)))),(e=>u.rewriteUrl(e)));let E=n;u.meta.url=u.location,u.domain=u.meta.url.host,u.blobUrls=new s.Map,u.referrer="",u.cookies=[],u.localStorageObj={},u.sessionStorageObj={};const O=new e.BareClient(o,r);if("about:srcdoc"===u.location.href&&(u.meta=s.parent.__uv.meta),s.EventTarget&&(u.addEventListener=s.EventTarget.prototype.addEventListener,u.removeListener=s.EventTarget.prototype.removeListener,u.dispatchEvent=s.EventTarget.prototype.dispatchEvent),h.nativeMethods.defineProperty(h.storage.storeProto,"__uv$storageObj",{get(){return this===h.storage.sessionStorage?u.sessionStorageObj:this===h.storage.localStorage?u.localStorageObj:void 0},enumerable:!1}),s.localStorage){for(const e in s.localStorage)e.startsWith(c+u.location.origin+"@")&&(u.localStorageObj[e.slice((c+u.location.origin+"@").length)]=s.localStorage.getItem(e));u.lsWrap=h.storage.emulate(h.storage.localStorage,u.localStorageObj)}if(s.sessionStorage){for(const e in s.sessionStorage)e.startsWith(c+u.location.origin+"@")&&(u.sessionStorageObj[e.slice((c+u.location.origin+"@").length)]=s.sessionStorage.getItem(e));u.ssWrap=h.storage.emulate(h.storage.sessionStorage,u.sessionStorageObj)}let $=s.document?h.node.baseURI.get.call(s.document):s.location.href,j=u.sourceUrl($);h.nativeMethods.defineProperty(u.meta,"base",{get:()=>s.document?(h.node.baseURI.get.call(s.document)!==$&&($=h.node.baseURI.get.call(s.document),j=u.sourceUrl($)),j):u.meta.url.href}),u.methods={setSource:"__uv$setSource",source:"__uv$source",location:"__uv$location",function:"__uv$function",string:"__uv$string",eval:"__uv$eval",parent:"__uv$parent",top:"__uv$top"},u.filterKeys=[d,u.methods.setSource,u.methods.source,u.methods.location,u.methods.function,u.methods.string,u.methods.eval,u.methods.parent,u.methods.top,"__uv$protocol","__uv$storageObj","__uv$url","__uv$modifiedStyle","__uv$config","__uv$dispatched","Ultraviolet","__uvHook"],h.on("wrap",((e,t)=>{h.nativeMethods.defineProperty(t,"name",h.nativeMethods.getOwnPropertyDescriptor(e,"name")),h.nativeMethods.defineProperty(t,"length",h.nativeMethods.getOwnPropertyDescriptor(e,"length")),h.nativeMethods.defineProperty(t,u.methods.string,{enumerable:!1,value:h.nativeMethods.fnToString.call(e)}),h.nativeMethods.defineProperty(t,u.methods.function,{enumerable:!1,value:e})})),h.fetch.on("request",(e=>{e.data.input=u.rewriteUrl(e.data.input)})),h.fetch.on("requestUrl",(e=>{e.data.value=u.sourceUrl(e.data.value)})),h.fetch.on("responseUrl",(e=>{e.data.value=u.sourceUrl(e.data.value)})),h.xhr.on("open",(e=>{e.data.input=u.rewriteUrl(e.data.input)})),h.xhr.on("responseUrl",(e=>{e.data.value=u.sourceUrl(e.data.value)})),h.workers.on("worker",(e=>{e.data.url=u.rewriteUrl(e.data.url)})),h.workers.on("addModule",(e=>{e.data.url=u.rewriteUrl(e.data.url)})),h.workers.on("importScripts",(e=>{for(const t in e.data.scripts)e.data.scripts[t]=u.rewriteUrl(e.data.scripts[t])})),h.workers.on("postMessage",(e=>{let t=e.data.origin;e.data.origin="*",e.data.message={__data:e.data.message,__origin:u.meta.url.origin,__to:t}})),h.navigator.on("sendBeacon",(e=>{e.data.url=u.rewriteUrl(e.data.url)})),h.document.on("getCookie",(e=>{e.data.value=E})),h.document.on("setCookie",(e=>{Promise.resolve(u.cookie.setCookies(e.data.value,u.db,u.meta)).then((()=>{u.cookie.db().then((e=>{u.cookie.getCookies(e).then((e=>{E=u.cookie.serialize(e,u.meta,!0)}))}))}));const t=u.cookie.setCookie(e.data.value)[0];t.path||(t.path="/"),t.domain||(t.domain=u.meta.url.hostname),u.cookie.validateCookie(t,u.meta,!0)&&(E.length&&(E+="; "),E+=`${t.name}=${t.value}`),e.respondWith(e.data.value)})),h.element.on("setInnerHTML",(e=>{switch(e.that.tagName){case"SCRIPT":e.data.value=u.js.rewrite(e.data.value);break;case"STYLE":e.data.value=u.rewriteCSS(e.data.value);break;default:e.data.value=u.rewriteHtml(e.data.value)}})),h.element.on("getInnerHTML",(e=>{if("SCRIPT"===e.that.tagName)e.data.value=u.js.source(e.data.value);else e.data.value=u.sourceHtml(e.data.value)})),h.element.on("setOuterHTML",(e=>{e.data.value=u.rewriteHtml(e.data.value,{document:"HTML"===e.that.tagName})})),h.element.on("getOuterHTML",(e=>{switch(e.that.tagName){case"HEAD":e.data.value=u.sourceHtml(e.data.value.replace(/<head(.*)>(.*)<\/head>/s,"<op-head$1>$2</op-head>")).replace(/<op-head(.*)>(.*)<\/op-head>/s,"<head$1>$2</head>");break;case"BODY":e.data.value=u.sourceHtml(e.data.value.replace(/<body(.*)>(.*)<\/body>/s,"<op-body$1>$2</op-body>")).replace(/<op-body(.*)>(.*)<\/op-body>/s,"<body$1>$2</body>");break;default:e.data.value=u.sourceHtml(e.data.value,{document:"HTML"===e.that.tagName})}})),h.document.on("write",(e=>{if(!e.data.html.length)return!1;e.data.html=[u.rewriteHtml(e.data.html.join(""))]})),h.document.on("writeln",(e=>{if(!e.data.html.length)return!1;e.data.html=[u.rewriteHtml(e.data.html.join(""))]})),h.element.on("insertAdjacentHTML",(e=>{e.data.html=u.rewriteHtml(e.data.html)})),h.eventSource.on("construct",(e=>{e.data.url=u.rewriteUrl(e.data.url)})),h.eventSource.on("url",(e=>{e.data.url=u.rewriteUrl(e.data.url)})),h.idb.on("idbFactoryOpen",(e=>{e.data.name=`${u.meta.url.origin}@${e.data.name}`})),h.idb.on("idbFactoryName",(e=>{e.data.value=e.data.value.slice(u.meta.url.origin.length+1)})),h.history.on("replaceState",(e=>{e.data.url&&(e.data.url=u.rewriteUrl(e.data.url,"__uv"in e.that?e.that.__uv.meta:u.meta))})),h.history.on("pushState",(e=>{e.data.url&&(e.data.url=u.rewriteUrl(e.data.url,"__uv"in e.that?e.that.__uv.meta:u.meta))})),h.element.on("getAttribute",(e=>{h.element.hasAttribute.call(e.that,u.attributePrefix+"-attr-"+e.data.name)&&e.respondWith(e.target.call(e.that,u.attributePrefix+"-attr-"+e.data.name))})),h.message.on("postMessage",(e=>{let t=e.data.origin,a=u.call;e.that&&(a=e.that.__uv$source.call),e.data.origin="*",e.data.message={__data:e.data.message,__origin:(e.that||e.target).__uv$source.location.origin,__to:t},e.respondWith(a(e.target,l?[e.data.message,e.data.transfer]:[e.data.message,e.data.origin,e.data.transfer],e.that))})),h.message.on("data",(e=>{const{value:t}=e.data;"object"==typeof t&&"__data"in t&&"__origin"in t&&e.respondWith(t.__data)})),h.message.on("origin",(e=>{const t=h.message.messageData.get.call(e.that);"object"==typeof t&&t.__data&&t.__origin&&e.respondWith(t.__origin)})),h.overrideDescriptor(s,"origin",{get:()=>u.location.origin}),h.node.on("baseURI",(e=>{e.data.value.startsWith(s.location.origin)&&(e.data.value=u.sourceUrl(e.data.value))})),h.element.on("setAttribute",(e=>{if(e.that instanceof m&&"src"===e.data.name&&e.data.value.startsWith("blob:"))return e.target.call(e.that,u.attributePrefix+"-attr-"+e.data.name,e.data.value),void(e.data.value=u.blobUrls.get(e.data.value));u.attrs.isUrl(e.data.name)&&(e.target.call(e.that,u.attributePrefix+"-attr-"+e.data.name,e.data.value),e.data.value=u.rewriteUrl(e.data.value)),u.attrs.isStyle(e.data.name)&&(e.target.call(e.that,u.attributePrefix+"-attr-"+e.data.name,e.data.value),e.data.value=u.rewriteCSS(e.data.value,{context:"declarationList"})),u.attrs.isHtml(e.data.name)&&(e.target.call(e.that,u.attributePrefix+"-attr-"+e.data.name,e.data.value),e.data.value=u.rewriteHtml(e.data.value,{...u.meta,document:!0,injectHead:u.createHtmlInject(u.handlerScript,u.bundleScript,u.clientScript,u.configScript,o,r,E,s.location.href)})),u.attrs.isSrcset(e.data.name)&&(e.target.call(e.that,u.attributePrefix+"-attr-"+e.data.name,e.data.value),e.data.value=u.html.wrapSrcset(e.data.value.toString())),u.attrs.isForbidden(e.data.name)&&(e.data.name=u.attributePrefix+"-attr-"+e.data.name)})),h.element.on("audio",(e=>{e.data.url=u.rewriteUrl(e.data.url)})),h.element.hookProperty([_,S,k,P],"href",{get:(e,t)=>u.sourceUrl(e.call(t)),set:(e,t,[a])=>{h.element.setAttribute.call(t,u.attributePrefix+"-attr-href",a),e.call(t,u.rewriteUrl(a))}}),h.element.hookProperty([v,p,g,m,M,b,f,w,y,x],"src",{get:(e,t)=>u.sourceUrl(e.call(t)),set:(e,t,[a])=>{if(new String(a).toString().trim().startsWith("blob:")&&t instanceof m)return h.element.setAttribute.call(t,u.attributePrefix+"-attr-src",a),e.call(t,u.blobUrls.get(a)||a);h.element.setAttribute.call(t,u.attributePrefix+"-attr-src",a),e.call(t,u.rewriteUrl(a))}}),h.element.hookProperty([U],"action",{get:(e,t)=>u.sourceUrl(e.call(t)),set:(e,t,[a])=>{h.element.setAttribute.call(t,u.attributePrefix+"-attr-action",a),e.call(t,u.rewriteUrl(a))}}),h.element.hookProperty([M],"srcset",{get:(e,t)=>h.element.getAttribute.call(t,u.attributePrefix+"-attr-srcset")||e.call(t),set:(e,t,[a])=>{h.element.setAttribute.call(t,u.attributePrefix+"-attr-srcset",a),e.call(t,u.html.wrapSrcset(a.toString()))}}),h.element.hookProperty(v,"integrity",{get:(e,t)=>h.element.getAttribute.call(t,u.attributePrefix+"-attr-integrity"),set:(e,t,[a])=>{h.element.setAttribute.call(t,u.attributePrefix+"-attr-integrity",a)}}),h.element.hookProperty(w,"sandbox",{get:(e,t)=>h.element.getAttribute.call(t,u.attributePrefix+"-attr-sandbox")||e.call(t),set:(e,t,[a])=>{h.element.setAttribute.call(t,u.attributePrefix+"-attr-sandbox",a)}});const T=w&&Object.getOwnPropertyDescriptor(w.prototype,"contentWindow").get;function L(e){const t=T.call(e);if(!t.__uv)try{i(t)}catch(e){console.error("catastrophic failure"),console.error(e)}}function H(e,t){const a=`on${t}`,r=new WeakMap;Reflect.defineProperty(e,a,{enumerable:!0,configurable:!0,get(){return r.has(this)?r.get(this):null},set(e){"function"==typeof e&&(r.has(this)&&this.removeEventListener(t,r.get(this)),r.set(this,e),this.addEventListener(t,e))}})}h.element.hookProperty(w,"contentWindow",{get:(e,t)=>(L(t),e.call(t))}),h.element.hookProperty(w,"contentDocument",{get:(e,t)=>(L(t),e.call(t))}),h.element.hookProperty(w,"srcdoc",{get:(e,t)=>h.element.getAttribute.call(t,u.attributePrefix+"-attr-srcdoc")||e.call(t),set:(e,t,[a])=>{e.call(t,u.rewriteHtml(a,{document:!0,injectHead:u.createHtmlInject(u.handlerScript,u.bundleScript,u.clientScript,u.configScript,o,r,E,s.location.href)}))}}),h.node.on("getTextContent",(e=>{"SCRIPT"===e.that.tagName&&(e.data.value=u.js.source(e.data.value))})),h.node.on("setTextContent",(e=>{"SCRIPT"===e.that.tagName&&(e.data.value=u.js.rewrite(e.data.value))})),"serviceWorker"in s.navigator&&delete s.Navigator.prototype.serviceWorker,h.document.on("getDomain",(e=>{e.data.value=u.domain})),h.document.on("setDomain",(e=>{if(!e.data.value.toString().endsWith(u.meta.url.hostname.split(".").slice(-2).join(".")))return e.respondWith("");e.respondWith(u.domain=e.data.value)})),h.document.on("url",(e=>{e.data.value=u.location.href})),h.document.on("documentURI",(e=>{e.data.value=u.location.href})),h.document.on("referrer",(e=>{e.data.value=u.referrer||u.sourceUrl(e.data.value)})),h.document.on("parseFromString",(e=>{if("text/html"!==e.data.type)return!1;e.data.string=u.rewriteHtml(e.data.string,{...u.meta,document:!0})})),h.attribute.on("getValue",(e=>{h.element.hasAttribute.call(e.that.ownerElement,u.attributePrefix+"-attr-"+e.data.name)&&(e.data.value=h.element.getAttribute.call(e.that.ownerElement,u.attributePrefix+"-attr-"+e.data.name))})),h.attribute.on("setValue",(e=>{u.attrs.isUrl(e.data.name)&&(h.element.setAttribute.call(e.that.ownerElement,u.attributePrefix+"-attr-"+e.data.name,e.data.value),e.data.value=u.rewriteUrl(e.data.value)),u.attrs.isStyle(e.data.name)&&(h.element.setAttribute.call(e.that.ownerElement,u.attributePrefix+"-attr-"+e.data.name,e.data.value),e.data.value=u.rewriteCSS(e.data.value,{context:"declarationList"})),u.attrs.isHtml(e.data.name)&&(h.element.setAttribute.call(e.that.ownerElement,u.attributePrefix+"-attr-"+e.data.name,e.data.value),e.data.value=u.rewriteHtml(e.data.value,{...u.meta,document:!0,injectHead:u.createHtmlInject(u.handlerScript,u.bundleScript,u.clientScript,u.configScript,o,r,E,s.location.href)})),u.attrs.isSrcset(e.data.name)&&(h.element.setAttribute.call(e.that.ownerElement,u.attributePrefix+"-attr-"+e.data.name,e.data.value),e.data.value=u.html.wrapSrcset(e.data.value.toString()))})),h.url.on("createObjectURL",(e=>{let t=e.target.call(e.that,e.data.object);if(t.startsWith("blob:"+location.origin)){let a="blob:"+("about:blank"!==u.meta.url.href?u.meta.url.origin:s.parent.__uv.meta.url.origin)+t.slice("blob:".length+location.origin.length);u.blobUrls.set(a,t),e.respondWith(a)}else e.respondWith(t)})),h.url.on("revokeObjectURL",(e=>{if(u.blobUrls.has(e.data.url)){const t=e.data.url;e.data.url=u.blobUrls.get(e.data.url),u.blobUrls.delete(t)}})),h.storage.on("get",(e=>{e.data.name=c+u.meta.url.origin+"@"+e.data.name})),h.storage.on("set",(e=>{e.that.__uv$storageObj&&(e.that.__uv$storageObj[e.data.name]=e.data.value),e.data.name=c+u.meta.url.origin+"@"+e.data.name})),h.storage.on("delete",(e=>{e.that.__uv$storageObj&&delete e.that.__uv$storageObj[e.data.name],e.data.name=c+u.meta.url.origin+"@"+e.data.name})),h.storage.on("getItem",(e=>{e.data.name=c+u.meta.url.origin+"@"+e.data.name})),h.storage.on("setItem",(e=>{e.that.__uv$storageObj&&(e.that.__uv$storageObj[e.data.name]=e.data.value),e.data.name=c+u.meta.url.origin+"@"+e.data.name})),h.storage.on("removeItem",(e=>{e.that.__uv$storageObj&&delete e.that.__uv$storageObj[e.data.name],e.data.name=c+u.meta.url.origin+"@"+e.data.name})),h.storage.on("clear",(e=>{if(e.that.__uv$storageObj)for(const t of h.nativeMethods.keys.call(null,e.that.__uv$storageObj))delete e.that.__uv$storageObj[t],h.storage.removeItem.call(e.that,c+u.meta.url.origin+"@"+t),e.respondWith()})),h.storage.on("length",(e=>{e.that.__uv$storageObj&&e.respondWith(h.nativeMethods.keys.call(null,e.that.__uv$storageObj).length)})),h.storage.on("key",(e=>{e.that.__uv$storageObj&&e.respondWith(h.nativeMethods.keys.call(null,e.that.__uv$storageObj)[e.data.index]||null)}));const W=["ws:","wss:"];class C extends EventTarget{#e;#t;#a="blob";#r="";#o="";#n="";async#i(e,t){const a={};Reflect.setPrototypeOf(a,null),a.Origin=u.meta.url.origin,a["User-Agent"]=navigator.userAgent,""!==E&&(a.Cookie=E.toString()),this.#e=await O.createWebSocket(e,a,t),this.#e.binaryType=this.#a,this.#e.addEventListener("message",(e=>{this.dispatchEvent(new MessageEvent("message",e))})),this.#e.addEventListener("open",(async e=>{this.dispatchEvent(new Event("open",e))})),this.#e.addEventListener("error",(e=>{this.dispatchEvent(new ErrorEvent("error",e))})),this.#e.addEventListener("close",(e=>{this.dispatchEvent(new Event("close",e))}));const r=await this.#e.meta;r.headers.has("sec-websocket-protocol")&&(this.#r=r.headers.get("sec-websocket-protocol")),r.headers.has("sec-websocket-extensions")&&(this.#o=r.headers.get("sec-websocket-extensions"));let o=r.rawHeaders["set-cookie"]||[];Array.isArray(o)||(o=[]);for(const e of o)document.cookie=e}get url(){return this.#n}constructor(...e){if(super(),!e.length)throw new DOMException("Failed to construct 'WebSocket': 1 argument required, but only 0 present.");const[t,a]=e;let r;try{r=new URL(t)}catch(e){throw new DOMException(`Faiiled to construct 'WebSocket': The URL '${t}' is invalid.`)}if(!W.includes(r.protocol))throw new DOMException(`Failed to construct 'WebSocket': The URL's scheme must be either 'ws' or 'wss'. '${r.protocol}' is not allowed.`);this.#t=this.#i(r,a)}get protocol(){return this.#r}get extensions(){return this.#o}get readyState(){return this.#e?this.#e.readyState:C.CONNECTING}get binaryType(){return this.#a}set binaryType(e){this.#a=e,this.#e&&(this.#e.binaryType=e)}send(e){if(!this.#e)throw new DOMException("Failed to execute 'send' on 'WebSocket': Still in CONNECTING state.");this.#e.send(e)}close(e,t){if(void 0!==e&&("number"!=typeof e&&(e=0),1e3!==e&&(e<3e3||e>4999)))throw new DOMException(`Failed to execute 'close' on 'WebSocket': The code must be either 1000, or between 3000 and 4999. ${e} is neither.`);this.#t.then((()=>this.#e.close(e,t)))}}H(C.prototype,"close"),H(C.prototype,"open"),H(C.prototype,"message"),H(C.prototype,"error");for(const e of["url","protocol","extensions","readyState","binaryType"]){const t=Object.getOwnPropertyDescriptor(s.WebSocket.prototype,e),a=Object.getOwnPropertyDescriptor(C.prototype,e);a?.get&&t?.get&&h.emit("wrap",a.get,t.get),a?.set&&t?.set&&h.emit("wrap",a.get,t.get)}if(h.emit("wrap",s.WebSocket.prototype.send,C.prototype.send),h.emit("wrap",s.WebSocket.prototype.close,C.prototype.close),h.override(s,"WebSocket",((e,t,a)=>new C(...a)),!0),C.prototype.constructor=s.WebSocket,h.function.on("function",(e=>{e.data.script=u.rewriteJS(e.data.script)})),h.function.on("toString",(e=>{u.methods.string in e.that&&e.respondWith(e.that[u.methods.string])})),h.object.on("getOwnPropertyNames",(e=>{e.data.names=e.data.names.filter((e=>!u.filterKeys.includes(e)))})),h.object.on("getOwnPropertyDescriptors",(e=>{for(const t of u.filterKeys)delete e.data.descriptors[t]})),h.style.on("setProperty",(e=>{h.style.dashedUrlProps.includes(e.data.property)&&(e.data.value=u.rewriteCSS(e.data.value,{context:"value",...u.meta}))})),h.style.on("getPropertyValue",(e=>{h.style.dashedUrlProps.includes(e.data.property)&&e.respondWith(u.sourceCSS(e.target.call(e.that,e.data.property),{context:"value",...u.meta}))})),"CSS2Properties"in s)for(const e of h.style.urlProps)h.overrideDescriptor(s.CSS2Properties.prototype,e,{get:(e,t)=>u.sourceCSS(e.call(t),{context:"value",...u.meta}),set:(e,t,a)=>{e.call(t,u.rewriteCSS(a,{context:"value",...u.meta}))}});else"HTMLElement"in s&&h.overrideDescriptor(s.HTMLElement.prototype,"style",{get:(e,t)=>{const a=e.call(t);if(!a.__uv$modifiedStyle)for(const e of h.style.urlProps)h.nativeMethods.defineProperty(a,e,{enumerable:!0,configurable:!0,get(){const t=h.style.getPropertyValue.call(this,e)||"";return u.sourceCSS(t,{context:"value",...u.meta})},set(t){h.style.setProperty.call(this,h.style.propToDashed[e]||e,u.rewriteCSS(t,{context:"value",...u.meta}))}}),h.nativeMethods.defineProperty(a,"__uv$modifiedStyle",{enumerable:!1,value:!0});return a}});h.style.on("setCssText",(e=>{e.data.value=u.rewriteCSS(e.data.value,{context:"declarationList",...u.meta})})),h.style.on("getCssText",(e=>{e.data.value=u.sourceCSS(e.data.value,{context:"declarationList",...u.meta})})),u.addEventListener.call(s,"hashchange",(e=>{if(e.__uv$dispatched)return!1;e.stopImmediatePropagation();const t=s.location.hash;h.history.replaceState.call(s.history,"","",e.oldURL),u.location.hash=t})),h.location.on("hashchange",((e,t,a)=>{if(a.HashChangeEvent&&h.history.replaceState){h.history.replaceState.call(s.history,"","",u.rewriteUrl(t));const r=new a.HashChangeEvent("hashchange",{newURL:t,oldURL:e});h.nativeMethods.defineProperty(r,"__uv$dispatched",{value:!0,enumerable:!1}),u.dispatchEvent.call(s,r)}})),h.fetch.overrideRequest(),h.fetch.overrideUrl(),h.xhr.overrideOpen(),h.xhr.overrideResponseUrl(),h.element.overrideHtml(),h.element.overrideAttribute(),h.element.overrideInsertAdjacentHTML(),h.element.overrideAudio(),h.node.overrideBaseURI(),h.node.overrideTextContent(),h.attribute.overrideNameValue(),h.document.overrideDomain(),h.document.overrideURL(),h.document.overrideDocumentURI(),h.document.overrideWrite(),h.document.overrideReferrer(),h.document.overrideParseFromString(),h.storage.overrideMethods(),h.storage.overrideLength(),h.object.overrideGetPropertyNames(),h.object.overrideGetOwnPropertyDescriptors(),h.idb.overrideName(),h.idb.overrideOpen(),h.history.overridePushState(),h.history.overrideReplaceState(),h.eventSource.overrideConstruct(),h.eventSource.overrideUrl(),h.url.overrideObjectURL(),h.document.overrideCookie(),h.message.overridePostMessage(),h.message.overrideMessageOrigin(),h.message.overrideMessageData(),h.workers.overrideWorker(),h.workers.overrideAddModule(),h.workers.overrideImportScripts(),h.workers.overridePostMessage(),h.style.overrideSetGetProperty(),h.style.overrideCssText(),h.navigator.overrideSendBeacon(),h.function.overrideFunction(),h.function.overrideToString(),h.location.overrideWorkerLocation((e=>new URL(u.sourceUrl(e)))),h.overrideDescriptor(s,"localStorage",{get:(e,t)=>(t||s).__uv.lsWrap}),h.overrideDescriptor(s,"sessionStorage",{get:(e,t)=>(t||s).__uv.ssWrap}),h.override(s,"open",((e,t,a)=>{if(!a.length)return e.apply(t,a);let[r]=a;return r=u.rewriteUrl(r),e.call(t,r)})),u.$wrap=function(e){return"location"===e?u.methods.location:"eval"===e?u.methods.eval:e},u.$get=function(e){return e===s.location?u.location:e===s.eval?u.eval:e===s.parent?s.__uv$parent:e===s.top?s.__uv$top:e},u.eval=h.wrap(s,"eval",((e,t,a)=>{if(!a.length||"string"!=typeof a[0])return e.apply(t,a);let[r]=a;return r=u.rewriteJS(r),e.call(t,r)})),u.call=function(e,t,a){return a?e.apply(a,t):e(...t)},u.call$=function(e,t,a=[]){return e[t].apply(e,a)},h.nativeMethods.defineProperty(s.Object.prototype,d,{get:()=>u,enumerable:!1}),h.nativeMethods.defineProperty(s.Object.prototype,u.methods.setSource,{value:function(e){return h.nativeMethods.isExtensible(this)?(h.nativeMethods.defineProperty(this,u.methods.source,{value:e,writable:!0,enumerable:!1}),this):this},enumerable:!1}),h.nativeMethods.defineProperty(s.Object.prototype,u.methods.source,{value:u,writable:!0,enumerable:!1}),h.nativeMethods.defineProperty(s.Object.prototype,u.methods.location,{configurable:!0,get(){return this===s.document||this===s?u.location:this.location},set(e){this===s.document||this===s?u.location.href=e:this.location=e}}),h.nativeMethods.defineProperty(s.Object.prototype,u.methods.parent,{configurable:!0,get(){const e=this.parent;if(this===s)try{return"__uv"in e?e:this}catch(e){return this}return e},set(e){this.parent=e}}),h.nativeMethods.defineProperty(s.Object.prototype,u.methods.top,{configurable:!0,get(){const e=this.top;if(this===s){if(e===this.parent)return this[u.methods.parent];try{if("__uv"in e)return e;{let t=this;for(;t.parent!==e;)t=t.parent;return"__uv"in t?t:this}}catch(e){return this}}return e},set(e){this.top=e}}),h.nativeMethods.defineProperty(s.Object.prototype,u.methods.eval,{configurable:!0,get(){return this===s?u.eval:this.eval},set(e){this.eval=e}})}self.__uv||i(self),self.__uvHook=i})();
//# sourceMappingURL=uv.handler.js.map

@@ -1,2 +0,2 @@

(()=>{"use strict";const e=self.Ultraviolet,t=["cross-origin-embedder-policy","cross-origin-opener-policy","cross-origin-resource-policy","content-security-policy","content-security-policy-report-only","expect-ct","feature-policy","origin-isolation","strict-transport-security","upgrade-insecure-requests","x-content-type-options","x-download-options","x-frame-options","x-permitted-cross-domain-policies","x-powered-by","x-xss-protection"],r=["GET","HEAD"];class i extends e.EventEmitter{constructor(t=__uv$config){super(),t.bare||(t.bare="/bare/"),t.prefix||(t.prefix="/service/"),this.config=t;const r=(Array.isArray(t.bare)?t.bare:[t.bare]).map((e=>new URL(e,location).toString()));this.address=r[~~(Math.random()*r.length)],this.bareClient=new e.BareClient(this.address)}async fetch({request:i}){let a;try{if(!i.url.startsWith(location.origin+this.config.prefix))return await fetch(i);const c=new e(this.config,this.address);"function"==typeof this.config.construct&&this.config.construct(c,"service");const l=await c.cookie.db();c.meta.origin=location.origin,c.meta.base=c.meta.url=new URL(c.sourceUrl(i.url));const d=new o(i,this,c,r.includes(i.method.toUpperCase())?null:await i.blob());if("blob:"===c.meta.url.protocol&&(d.blob=!0,d.base=d.url=new URL(d.url.pathname)),i.referrer&&i.referrer.startsWith(location.origin)){const e=new URL(c.sourceUrl(i.referrer));(d.headers.origin||c.meta.url.origin!==e.origin&&"cors"===i.mode)&&(d.headers.origin=e.origin),d.headers.referer=e.href}const h=await c.cookie.getCookies(l)||[],u=c.cookie.serialize(h,c.meta,!1);d.headers["user-agent"]=navigator.userAgent,u&&(d.headers.cookie=u);const p=new n(d,null,null);if(this.emit("request",p),p.intercepted)return p.returnValue;a=d.blob?"blob:"+location.origin+d.url.pathname:d.url;const m=await this.bareClient.fetch(a,{headers:d.headers,method:d.method,body:d.body,credentials:d.credentials,mode:location.origin!==d.address.origin?"cors":d.mode,cache:d.cache,redirect:d.redirect}),f=new s(d,m),b=new n(f,null,null);if(this.emit("beforemod",b),b.intercepted)return b.returnValue;for(const e of t)f.headers[e]&&delete f.headers[e];if(f.headers.location&&(f.headers.location=c.rewriteUrl(f.headers.location)),"document"===i.destination){const e=f.headers["content-disposition"];if(!/\s*?((inline|attachment);\s*?)filename=/i.test(e)){const t=/^\s*?attachment/i.test(e)?"attachment":"inline",[r]=new URL(m.finalURL).pathname.split("/").slice(-1);f.headers["content-disposition"]=`${t}; filename=${JSON.stringify(r)}`}}if(f.headers["set-cookie"]&&(Promise.resolve(c.cookie.setCookies(f.headers["set-cookie"],l,c.meta)).then((()=>{self.clients.matchAll().then((function(e){e.forEach((function(e){e.postMessage({msg:"updateCookies",url:c.meta.url.href})}))}))})),delete f.headers["set-cookie"]),f.body)switch(i.destination){case"script":case"worker":{const e=[c.bundleScript,c.clientScript,c.configScript,c.handlerScript].map((e=>JSON.stringify(e))).join(",");f.body=`if (!self.__uv && self.importScripts) { ${c.createJsInject(this.address,this.bareClient.data,c.cookie.serialize(h,c.meta,!0),i.referrer)} importScripts(${e}); }\n`,f.body+=c.js.rewrite(await m.text())}break;case"style":f.body=c.rewriteCSS(await m.text());break;case"iframe":case"document":(function(t,r=""){return"text/html"===(e.mime.contentType(r||t.pathname)||"text/html").split(";")[0]})(c.meta.url,f.headers["content-type"]||"")&&(f.body=c.rewriteHtml(await m.text(),{document:!0,injectHead:c.createHtmlInject(c.handlerScript,c.bundleScript,c.clientScript,c.configScript,this.address,this.bareClient.data,c.cookie.serialize(h,c.meta,!0),i.referrer)}))}return"text/event-stream"===d.headers.accept&&(f.headers["content-type"]="text/event-stream"),this.emit("response",b),b.intercepted?b.returnValue:new Response(f.body,{headers:f.headers,status:f.status,statusText:f.statusText})}catch(e){return["document","iframe"].includes(i.destination)?(console.error(e),function(e,t,r){let i,s,o,n,a="";!function(e){return e instanceof Error&&"object"==typeof e.body}(e)?(i=500,s="Error processing your request",n="Internal Server Error",o=e instanceof Error?e.name:"UNKNOWN"):(i=e.status,s="Error communicating with the Bare server",n=e.body.message,o=e.body.code,a=e.body.id);return new Response(function(e,t,r,i,s,o,n){if("The specified host could not be resolved."===i)return function(e,t){const r=new URL(e),i=`remoteHostname.textContent = ${JSON.stringify(r.hostname)};bareServer.href = ${JSON.stringify(t)};uvHostname.textContent = ${JSON.stringify(location.hostname)};reload.addEventListener("click", () => location.reload());uvVersion.textContent = ${JSON.stringify("1.0.9")};`;return`<!DOCTYPE html><html><head><meta charset='utf-8' /><title>Error</title></head><body><h1>This site can’t be reached</h1><hr /><p><b id="remoteHostname"></b>’s server IP address could not be found.</p><p>Try:</p><ul><li>Verifying you entered the correct address</li><li>Clearing the site data</li><li>Contacting <b id="uvHostname"></b>'s administrator</li><li>Verifying the <a id='bareServer' title='Bare server'>Bare server</a> isn't censored</li></ul><button id="reload">Reload</button><hr /><p><i>Ultraviolet v<span id="uvVersion"></span></i></p><script src="${"data:application/javascript,"+encodeURIComponent(i)}"><\/script></body></html>`}(o,n);const a=`errorTitle.textContent = ${JSON.stringify(e)};errorCode.textContent = ${JSON.stringify(t)};`+(r?`errorId.textContent = ${JSON.stringify(r)};`:"")+`errorMessage.textContent = ${JSON.stringify(i)};`+`errorTrace.value = ${JSON.stringify(s)};`+`fetchedURL.textContent = ${JSON.stringify(o)};`+`bareServer.href = ${JSON.stringify(n)};`+`for (const node of document.querySelectorAll("#uvHostname")) node.textContent = ${JSON.stringify(location.hostname)};reload.addEventListener("click", () => location.reload());`+`uvVersion.textContent = ${JSON.stringify("1.0.9")};`;return'<!DOCTYPE html><html><head><meta charset=\'utf-8\' /><title>Error</title></head><body><h1 id=\'errorTitle\'></h1><hr /><p>Failed to load <b id="fetchedURL"></b></p><p id="errorMessage"></p><table><tbody><tr><td>Code:</td><td id="errorCode"></td></tr>'+(r?'<tr><td>ID:</td><td id="errorId"></td></tr>':"")+'</tbody></table><textarea id="errorTrace" cols="40" rows="10" readonly></textarea><p>Try:</p><ul><li>Checking your internet connection</li><li>Verifying you entered the correct address</li><li>Clearing the site data</li><li>Contacting <b id="uvHostname"></b>\'s administrator</li><li>Verify the <a id=\'bareServer\' title=\'Bare server\'>Bare server</a> isn\'t censored</li></ul><p>If you\'re the administrator of <b id="uvHostname"></b>, try:</p><ul><li>Restarting your Bare server</li><li>Updating Ultraviolet</li><li>Troubleshooting the error on the <a href="https://github.com/titaniumnetwork-dev/Ultraviolet">GitHub repository</a></li></ul><button id="reload">Reload</button><hr /><p><i>Ultraviolet v<span id="uvVersion"></span></i></p>'+`<script src="${"data:application/javascript,"+encodeURIComponent(a)}"><\/script></body></html>`}(s,o,a,n,String(e),t,r),{status:i,headers:{"content-type":"text/html"}})}(e,a,this.address)):new Response(void 0,{status:500})}}static Ultraviolet=e}self.UVServiceWorker=i;class s{constructor(e,t){this.request=e,this.raw=t,this.ultraviolet=e.ultraviolet,this.headers={};for(const e in t.rawHeaders)this.headers[e.toLowerCase()]=t.rawHeaders[e];this.status=t.status,this.statusText=t.statusText,this.body=t.body}get url(){return this.request.url}get base(){return this.request.base}set base(e){this.request.base=e}}class o{constructor(e,t,r,i=null){this.ultraviolet=r,this.request=e,this.headers=Object.fromEntries(e.headers.entries()),this.method=e.method,this.address=t.address,this.body=i||null,this.cache=e.cache,this.redirect=e.redirect,this.credentials="omit",this.mode="cors"===e.mode?e.mode:"same-origin",this.blob=!1}get url(){return this.ultraviolet.meta.url}set url(e){this.ultraviolet.meta.url=e}get base(){return this.ultraviolet.meta.base}set base(e){this.ultraviolet.meta.base=e}}class n{#e;#t;constructor(e={},t=null,r=null){this.#e=!1,this.#t=null,this.data=e,this.target=t,this.that=r}get intercepted(){return this.#e}get returnValue(){return this.#t}respondWith(e){this.#t=e,this.#e=!0}}})();
(()=>{"use strict";const e=self.Ultraviolet,t=["cross-origin-embedder-policy","cross-origin-opener-policy","cross-origin-resource-policy","content-security-policy","content-security-policy-report-only","expect-ct","feature-policy","origin-isolation","strict-transport-security","upgrade-insecure-requests","x-content-type-options","x-download-options","x-frame-options","x-permitted-cross-domain-policies","x-powered-by","x-xss-protection"],r=["GET","HEAD"];class i extends e.EventEmitter{constructor(t=__uv$config){super(),t.bare||(t.bare="/bare/"),t.prefix||(t.prefix="/service/"),this.config=t;const r=(Array.isArray(t.bare)?t.bare:[t.bare]).map((e=>new URL(e,location).toString()));this.address=r[~~(Math.random()*r.length)],this.bareClient=new e.BareClient(this.address)}async fetch({request:i}){let a;try{if(!i.url.startsWith(location.origin+this.config.prefix))return await fetch(i);const c=new e(this.config,this.address);"function"==typeof this.config.construct&&this.config.construct(c,"service");const l=await c.cookie.db();c.meta.origin=location.origin,c.meta.base=c.meta.url=new URL(c.sourceUrl(i.url));const d=new o(i,this,c,r.includes(i.method.toUpperCase())?null:await i.blob());if("blob:"===c.meta.url.protocol&&(d.blob=!0,d.base=d.url=new URL(d.url.pathname)),i.referrer&&i.referrer.startsWith(location.origin)){const e=new URL(c.sourceUrl(i.referrer));(d.headers.origin||c.meta.url.origin!==e.origin&&"cors"===i.mode)&&(d.headers.origin=e.origin),d.headers.referer=e.href}const h=await c.cookie.getCookies(l)||[],u=c.cookie.serialize(h,c.meta,!1);d.headers["user-agent"]=navigator.userAgent,u&&(d.headers.cookie=u);const p=new n(d,null,null);if(this.emit("request",p),p.intercepted)return p.returnValue;a=d.blob?"blob:"+location.origin+d.url.pathname:d.url;const m=await this.bareClient.fetch(a,{headers:d.headers,method:d.method,body:d.body,credentials:d.credentials,mode:location.origin!==d.address.origin?"cors":d.mode,cache:d.cache,redirect:d.redirect}),f=new s(d,m),b=new n(f,null,null);if(this.emit("beforemod",b),b.intercepted)return b.returnValue;for(const e of t)f.headers[e]&&delete f.headers[e];if(f.headers.location&&(f.headers.location=c.rewriteUrl(f.headers.location)),"document"===i.destination){const e=f.headers["content-disposition"];if(!/\s*?((inline|attachment);\s*?)filename=/i.test(e)){const t=/^\s*?attachment/i.test(e)?"attachment":"inline",[r]=new URL(m.finalURL).pathname.split("/").slice(-1);f.headers["content-disposition"]=`${t}; filename=${JSON.stringify(r)}`}}if(f.headers["set-cookie"]&&(Promise.resolve(c.cookie.setCookies(f.headers["set-cookie"],l,c.meta)).then((()=>{self.clients.matchAll().then((function(e){e.forEach((function(e){e.postMessage({msg:"updateCookies",url:c.meta.url.href})}))}))})),delete f.headers["set-cookie"]),f.body)switch(i.destination){case"script":case"worker":{const e=[c.bundleScript,c.clientScript,c.configScript,c.handlerScript].map((e=>JSON.stringify(e))).join(",");f.body=`if (!self.__uv && self.importScripts) { ${c.createJsInject(this.address,this.bareClient.data,c.cookie.serialize(h,c.meta,!0),i.referrer)} importScripts(${e}); }\n`,f.body+=c.js.rewrite(await m.text())}break;case"style":f.body=c.rewriteCSS(await m.text());break;case"iframe":case"document":(function(t,r=""){return"text/html"===(e.mime.contentType(r||t.pathname)||"text/html").split(";")[0]})(c.meta.url,f.headers["content-type"]||"")&&(f.body=c.rewriteHtml(await m.text(),{document:!0,injectHead:c.createHtmlInject(c.handlerScript,c.bundleScript,c.clientScript,c.configScript,this.address,this.bareClient.data,c.cookie.serialize(h,c.meta,!0),i.referrer)}))}return"text/event-stream"===d.headers.accept&&(f.headers["content-type"]="text/event-stream"),this.emit("response",b),b.intercepted?b.returnValue:new Response(f.body,{headers:f.headers,status:f.status,statusText:f.statusText})}catch(e){return["document","iframe"].includes(i.destination)?(console.error(e),function(e,t,r){let i,s,o,n,a="";!function(e){return e instanceof Error&&"object"==typeof e.body}(e)?(i=500,s="Error processing your request",n="Internal Server Error",o=e instanceof Error?e.name:"UNKNOWN"):(i=e.status,s="Error communicating with the Bare server",n=e.body.message,o=e.body.code,a=e.body.id);return new Response(function(e,t,r,i,s,o,n){if("The specified host could not be resolved."===i)return function(e,t){const r=new URL(e),i=`remoteHostname.textContent = ${JSON.stringify(r.hostname)};bareServer.href = ${JSON.stringify(t)};uvHostname.textContent = ${JSON.stringify(location.hostname)};reload.addEventListener("click", () => location.reload());uvVersion.textContent = ${JSON.stringify("1.0.10")};`;return`<!DOCTYPE html><html><head><meta charset='utf-8' /><title>Error</title></head><body><h1>This site can’t be reached</h1><hr /><p><b id="remoteHostname"></b>’s server IP address could not be found.</p><p>Try:</p><ul><li>Verifying you entered the correct address</li><li>Clearing the site data</li><li>Contacting <b id="uvHostname"></b>'s administrator</li><li>Verifying the <a id='bareServer' title='Bare server'>Bare server</a> isn't censored</li></ul><button id="reload">Reload</button><hr /><p><i>Ultraviolet v<span id="uvVersion"></span></i></p><script src="${"data:application/javascript,"+encodeURIComponent(i)}"><\/script></body></html>`}(o,n);const a=`errorTitle.textContent = ${JSON.stringify(e)};errorCode.textContent = ${JSON.stringify(t)};`+(r?`errorId.textContent = ${JSON.stringify(r)};`:"")+`errorMessage.textContent = ${JSON.stringify(i)};`+`errorTrace.value = ${JSON.stringify(s)};`+`fetchedURL.textContent = ${JSON.stringify(o)};`+`bareServer.href = ${JSON.stringify(n)};`+`for (const node of document.querySelectorAll("#uvHostname")) node.textContent = ${JSON.stringify(location.hostname)};reload.addEventListener("click", () => location.reload());`+`uvVersion.textContent = ${JSON.stringify("1.0.10")};`;return'<!DOCTYPE html><html><head><meta charset=\'utf-8\' /><title>Error</title></head><body><h1 id=\'errorTitle\'></h1><hr /><p>Failed to load <b id="fetchedURL"></b></p><p id="errorMessage"></p><table><tbody><tr><td>Code:</td><td id="errorCode"></td></tr>'+(r?'<tr><td>ID:</td><td id="errorId"></td></tr>':"")+'</tbody></table><textarea id="errorTrace" cols="40" rows="10" readonly></textarea><p>Try:</p><ul><li>Checking your internet connection</li><li>Verifying you entered the correct address</li><li>Clearing the site data</li><li>Contacting <b id="uvHostname"></b>\'s administrator</li><li>Verify the <a id=\'bareServer\' title=\'Bare server\'>Bare server</a> isn\'t censored</li></ul><p>If you\'re the administrator of <b id="uvHostname"></b>, try:</p><ul><li>Restarting your Bare server</li><li>Updating Ultraviolet</li><li>Troubleshooting the error on the <a href="https://github.com/titaniumnetwork-dev/Ultraviolet">GitHub repository</a></li></ul><button id="reload">Reload</button><hr /><p><i>Ultraviolet v<span id="uvVersion"></span></i></p>'+`<script src="${"data:application/javascript,"+encodeURIComponent(a)}"><\/script></body></html>`}(s,o,a,n,String(e),t,r),{status:i,headers:{"content-type":"text/html"}})}(e,a,this.address)):new Response(void 0,{status:500})}}static Ultraviolet=e}self.UVServiceWorker=i;class s{constructor(e,t){this.request=e,this.raw=t,this.ultraviolet=e.ultraviolet,this.headers={};for(const e in t.rawHeaders)this.headers[e.toLowerCase()]=t.rawHeaders[e];this.status=t.status,this.statusText=t.statusText,this.body=t.body}get url(){return this.request.url}get base(){return this.request.base}set base(e){this.request.base=e}}class o{constructor(e,t,r,i=null){this.ultraviolet=r,this.request=e,this.headers=Object.fromEntries(e.headers.entries()),this.method=e.method,this.address=t.address,this.body=i||null,this.cache=e.cache,this.redirect=e.redirect,this.credentials="omit",this.mode="cors"===e.mode?e.mode:"same-origin",this.blob=!1}get url(){return this.ultraviolet.meta.url}set url(e){this.ultraviolet.meta.url=e}get base(){return this.ultraviolet.meta.base}set base(e){this.ultraviolet.meta.base=e}}class n{#e;#t;constructor(e={},t=null,r=null){this.#e=!1,this.#t=null,this.data=e,this.target=t,this.that=r}get intercepted(){return this.#e}get returnValue(){return this.#t}respondWith(e){this.#t=e,this.#e=!0}}})();
//# sourceMappingURL=uv.sw.js.map
{
"name": "@titaniumnetwork-dev/ultraviolet",
"version": "1.0.9",
"version": "1.0.10",
"description": "Highly sophisticated proxy used for evading internet censorship or accessing websites in a controlled sandbox using the power of service-workers and more!",

@@ -5,0 +5,0 @@ "main": "lib/index.cjs",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc