@gjsify/example-node-express-webserver 0.7.5 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.gjs.js +1 -1
- package/package.json +5 -5
package/dist/index.gjs.js
CHANGED
|
@@ -2,7 +2,7 @@ if(globalThis.__gjsifyBundleUrl??=import.meta.url,Symbol.dispose||(Symbol.dispos
|
|
|
2
2
|
`)}else if(pe){let n=` `.repeat(this._groupDepth*this._groupIndentation)+_formatArgs(...t);e===`stderr`?printerr(n):print(n)}else{let n=globalThis.console;e===`stderr`?n.error(...t):n.log(...t)}}log(...e){this._write(`stdout`,...e)}info(...e){this._write(`stdout`,...e)}debug(...e){this._write(`stdout`,...e)}warn(...e){this._write(`stderr`,...e)}error(...e){this._write(`stderr`,...e)}dir(e,t){this._write(`stdout`,e)}dirxml(...e){this.log(...e)}assert(e,...t){e||this.error(`Assertion failed:`,...t)}clear(){this._stdout?this._stdout.write(`\x1Bc`):pe?print(`\x1Bc`):globalThis.console.clear()}count(e=`default`){let t=(this._counters.get(e)||0)+1;this._counters.set(e,t),this.log(`${e}: ${t}`)}countReset(e=`default`){this._counters.delete(e)}group(...e){e.length>0&&this.log(...e),this._groupDepth++}groupCollapsed(...e){this.group(...e)}groupEnd(){this._groupDepth>0&&this._groupDepth--}table(e,t){this._stdout?this._write(`stdout`,e):pe?print(JSON.stringify(e,null,2)):globalThis.console.table(e,t)}time(e=`default`){this._timers.set(e,Date.now())}timeEnd(e=`default`){let t=this._timers.get(e);t===void 0?this.warn(`Warning: No such label '${e}' for console.timeEnd()`):(this.log(`${e}: ${Date.now()-t}ms`),this._timers.delete(e))}timeLog(e=`default`,...t){let n=this._timers.get(e);n===void 0?this.warn(`Warning: No such label '${e}' for console.timeLog()`):this.log(`${e}: ${Date.now()-n}ms`,...t)}trace(...e){let t=Error().stack?.split(`
|
|
3
3
|
`).slice(1).join(`
|
|
4
4
|
`)||``;this._write(`stderr`,`Trace:`,...e,`
|
|
5
|
-
`+t)}profile(e){}profileEnd(e){}timeStamp(e){}},P=new Console,log=(...e)=>P.log(...e),info=(...e)=>P.info(...e),debug=(...e)=>P.debug(...e),warn=(...e)=>P.warn(...e),error=(...e)=>P.error(...e),dir=(e,t)=>P.dir(e,t),dirxml=(...e)=>P.dirxml(...e),table=(e,t)=>P.table(e,t),clear=()=>P.clear(),assert=(e,...t)=>P.assert(e,...t),trace=(...e)=>P.trace(...e),time=e=>P.time(e),timeEnd=e=>P.timeEnd(e),timeLog=(e,...t)=>P.timeLog(e,...t),count=e=>P.count(e),countReset=e=>P.countReset(e),group=(...e)=>P.group(...e),groupCollapsed=(...e)=>P.groupCollapsed(...e),groupEnd=()=>P.groupEnd(),profile=e=>{},profileEnd=e=>{},timeStamp=e=>{}}),F,I=__esmMin(()=>{me(),F={log,info,debug,warn,error,dir,dirxml,table,time,timeEnd,timeLog,trace,assert,clear,count,countReset,group,groupCollapsed,groupEnd,profile,profileEnd,timeStamp}}),he=__esmMin(()=>{I()}),ge,_e=__esmMin(()=>{ge=__name(e=>{Promise.resolve().then(e)},`queueMicrotask`)});function drainOnce(e){let t=Math.min(64,ve.length);for(let n=0;n<t;n++){let t=ve.shift();try{t()}catch(t){try{e.log_default_handler(`gjsify-nextTick`,e.LogLevelFlags.LEVEL_WARNING,String(t?.stack||t),null)}catch{}}}ve.length>0?e.timeout_add(e.PRIORITY_DEFAULT,1,()=>(drainOnce(e),!1)):ye=!1}function tryGLibTimeout(e){let t=globalThis.imports?.gi?.GLib;return t?.timeout_add?(ve.push(e),ye||(ye=!0,t.timeout_add(t.PRIORITY_DEFAULT,0,()=>(drainOnce(t),!1))),!0):!1}var ve,ye,nextTick,be=__esmMin(()=>{ve=[],ye=!1,nextTick=(e,...t)=>{let n=t.length>0?()=>e(...t):e;if(!tryGLibTimeout(n)){if(typeof globalThis.process?.nextTick==`function`){globalThis.process.nextTick(e,...t);return}if(typeof queueMicrotask==`function`){queueMicrotask(n);return}Promise.resolve().then(n)}}}),xe,Se=__esmMin(()=>{A(),N(),{File:xe}=M});function classOf(e){return Ce.call(e).slice(8,-1)}function throwDataCloneError(e){let t=globalThis.DOMException;if(typeof t==`function`)throw new t(e,`DataCloneError`);let n=Error(e);throw n.name=`DataCloneError`,n}function internalClone(e,t,n){if(e==null)return e;let r=typeof e;if(r===`boolean`||r===`number`||r===`string`||r===`bigint`)return e;r===`symbol`&&throwDataCloneError(`Symbol cannot be cloned`),r===`function`&&throwDataCloneError(`Function cannot be cloned`);let i=e;if(t.has(i))return t.get(i);let a=classOf(i);if(a===`Date`)return new Date(i.getTime());if(a===`RegExp`)return new RegExp(i.source,i.flags);if(a===`Boolean`||a===`Number`||a===`String`)return Object(i.valueOf());if(a===`BigInt`)return Object(BigInt.prototype.valueOf.call(i));if(i instanceof Error){let e=i,r=e.constructor?.name,a=new(r&&we[r]||we[e.name]||Error)(e.message);return a.name=e.name,`cause`in e&&Object.defineProperty(a,`cause`,{value:internalClone(e.cause,t,n),writable:!0,enumerable:!1,configurable:!0}),a}if(a===`DOMException`){let e=globalThis.DOMException;if(typeof e==`function`){let t=i;return new e(t.message,t.name)}}if(a===`ArrayBuffer`){let e=i;if(n&&n.transferred.has(e)){let r=n.transferred.get(e);return t.set(i,r),r}(e.detached===!0||e.byteLength===0&&e.detached)&&throwDataCloneError(`ArrayBuffer is detached and cannot be cloned`);let r=e.slice(0);return t.set(i,r),r}if(a===`SharedArrayBuffer`||i&&typeof i==`object`&&i.constructor?.name===`SharedBuffer`)return i;if(a===`DataView`){let e=i,r=n?.viewSnapshots.get(i),a=internalClone(e.buffer,t,n),o=r?r.byteOffset:e.byteOffset,s=r?r.byteLength:e.byteLength,c=new DataView(a,o,s);return t.set(i,c),c}if(Te.has(a)){let e=i,r=n?.viewSnapshots.get(i),a=internalClone(e.buffer,t,n),o=e.constructor,s=new o(a,r?r.byteOffset:e.byteOffset,r?r.length:e.length);return t.set(i,s),s}if(a===`Map`){let e=new Map;t.set(i,e);for(let[r,a]of i)e.set(internalClone(r,t,n),internalClone(a,t,n));return e}if(a===`Set`){let e=new Set;t.set(i,e);for(let r of i)e.add(internalClone(r,t,n));return e}{let e=globalThis,t=e.Blob,n=e.File;if(typeof n==`function`&&i instanceof n){let e=i;return new n([i],e.name,{type:e.type,lastModified:e.lastModified})}if(typeof t==`function`&&i instanceof t)return new t([i],{type:i.type})}if(i instanceof WeakMap&&throwDataCloneError(`WeakMap cannot be cloned`),i instanceof WeakSet&&throwDataCloneError(`WeakSet cannot be cloned`),i instanceof WeakRef&&throwDataCloneError(`WeakRef cannot be cloned`),typeof globalThis.Promise==`function`&&i instanceof Promise&&throwDataCloneError(`Promise cannot be cloned`),a===`Array`){let e=i,r=[];t.set(i,r);for(let i=0;i<e.length;i++)i in e&&(r[i]=internalClone(e[i],t,n));return r}if(a===`Object`||typeof i==`object`){let e={};t.set(i,e);for(let r of Object.keys(i))e[r]=internalClone(i[r],t,n);return e}throwDataCloneError(`${a} cannot be cloned`)}function structuredClone$1(e,t){let n=t?.transfer;if(!n||n.length===0)return internalClone(e,new Map);let r=new Set;for(let e of n)if(classOf(e)===`ArrayBuffer`){let t=e;t.detached===!0&&throwDataCloneError(`ArrayBuffer in transfer list is detached`),r.add(t)}let i=new Map;r.size>0&&snapshotViewsBackedByTransferredBuffers(e,r,i,new Set);let a=new Map;for(let e of r){let t=e;typeof t.transfer!=`function`&&throwDataCloneError(`ArrayBuffer.prototype.transfer() not available — runtime is not SM140+`),a.set(e,t.transfer())}return internalClone(e,new Map,{transferred:a,viewSnapshots:i})}function snapshotViewsBackedByTransferredBuffers(e,t,n,r){if(typeof e!=`object`||!e)return;let i=e;if(r.has(i))return;r.add(i);let a=classOf(i);if(a===`DataView`){let e=i;t.has(e.buffer)&&n.set(i,{byteOffset:e.byteOffset,length:0,byteLength:e.byteLength});return}if(Te.has(a)){let e=i;t.has(e.buffer)&&n.set(i,{byteOffset:e.byteOffset,length:e.length,byteLength:e.byteLength});return}if(Array.isArray(i)){for(let e=0;e<i.length;e++)e in i&&snapshotViewsBackedByTransferredBuffers(i[e],t,n,r);return}if(a===`Map`){for(let[e,a]of i)snapshotViewsBackedByTransferredBuffers(e,t,n,r),snapshotViewsBackedByTransferredBuffers(a,t,n,r);return}if(a===`Set`){for(let e of i)snapshotViewsBackedByTransferredBuffers(e,t,n,r);return}if(a===`Object`)for(let e of Object.keys(i))snapshotViewsBackedByTransferredBuffers(i[e],t,n,r)}var Ce,we,Te,Ee=__esmMin(()=>{({toString:Ce}=Object.prototype),we={Error,EvalError,RangeError,ReferenceError,SyntaxError,TypeError,URIError},Te=new Set([`Int8Array`,`Uint8Array`,`Uint8ClampedArray`,`Int16Array`,`Uint16Array`,`Int32Array`,`Uint32Array`,`Float32Array`,`Float64Array`,`BigInt64Array`,`BigUint64Array`]),__name(structuredClone$1,`structuredClone`)});function ensureMainLoop(){let e=globalThis.imports;if(!e)return;if(De)return Oe;let t=e.gi?.GLib;if(t){if(Oe=new t.MainLoop(null,!1),De=!0,t.main_depth()===0)try{Oe.runAsync()}catch{}return Oe}}function quitMainLoop(){Oe&&=(Oe.quit(),De=!1,null)}var De,Oe,ke=__esmMin(()=>{De=!1,Oe=null}),L=__esmMin(()=>{T(),E(),j(),ee(),te(),ne(),se(),ue(),de(),fe(),he(),_e(),be(),Se(),Ee(),ke()});w(),L(),registerGlobal(`Blob`,x),registerGlobal(`File`,S);var Ae=Object.defineProperty;__name((e,t)=>{let n={};for(var r in e)Ae(n,r,{get:e[r],enumerable:!0});return t||Ae(n,Symbol.toStringTag,{value:`Module`}),n},`__exportAll`)({attributes:()=>U,childNodesList:()=>V,elementChildren:()=>H,isConnected:()=>je,localName:()=>Ne,name:()=>Ie,namespaceURI:()=>Pe,nodeType:()=>z,ownerElement:()=>Re,parentNode:()=>B,prefix:()=>Fe,propertyEventListeners:()=>W,tagName:()=>Me,value:()=>Le});const z=Symbol(`nodeType`),B=Symbol(`parentNode`),V=Symbol(`childNodesList`),H=Symbol(`elementChildren`),je=Symbol(`isConnected`),Me=Symbol(`tagName`),Ne=Symbol(`localName`),Pe=Symbol(`namespaceURI`),Fe=Symbol(`prefix`),U=Symbol(`attributes`),W=Symbol(`propertyEventListeners`),Ie=Symbol(`name`),Le=Symbol(`value`),Re=Symbol(`ownerElement`),G={ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3,CDATA_SECTION_NODE:4,PROCESSING_INSTRUCTION_NODE:7,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_TYPE_NODE:10,DOCUMENT_FRAGMENT_NODE:11};var NodeList=class{constructor(e){this._items=e}get length(){return this._items.length}item(e){return this._items[e]??null}forEach(e,t){for(let n=0;n<this._items.length;n++)e.call(t,this._items[n],n,this)}entries(){return this._items.entries()}keys(){return this._items.keys()}values(){return this._items.values()}[Symbol.iterator](){return this._items[Symbol.iterator]()}get[Symbol.toStringTag](){return`NodeList`}};const ze={IndexSizeError:1,HierarchyRequestError:3,WrongDocumentError:4,InvalidCharacterError:5,NoModificationAllowedError:7,NotFoundError:8,NotSupportedError:9,InUseAttributeError:10,InvalidStateError:11,SyntaxError:12,InvalidModificationError:13,NamespaceError:14,InvalidAccessError:15,TypeMismatchError:17,SecurityError:18,NetworkError:19,AbortError:20,URLMismatchError:21,QuotaExceededError:22,TimeoutError:23,InvalidNodeTypeError:24,DataCloneError:25};var _DOMExceptionPolyfill=class extends Error{code;constructor(e,t){super(e),this.name=t||`Error`,this.code=Object.hasOwn(ze,this.name)?ze[this.name]:0}};const Be=globalThis.DOMException===void 0?_DOMExceptionPolyfill:globalThis.DOMException;I();const Ve=Symbol(`type`),He=Symbol(`bubbles`),Ue=Symbol(`cancelable`),We=Symbol(`composed`),Ge=Symbol(`target`),Ke=Symbol(`currentTarget`),qe=Symbol(`eventPhase`),Je=Symbol(`defaultPrevented`),Ye=Symbol(`isTrusted`),Xe=Symbol(`timeStamp`),Ze=Symbol(`stop`),Qe=Symbol(`immediateStop`),$e=Symbol(`dispatching`),et=Symbol(`inPassiveListener`);var Event=class{[Ve];[He];[Ue];[We];[Ge]=null;[Ke]=null;[qe]=0;[Je]=!1;[Ye]=!1;[Xe];[Ze]=!1;[Qe]=!1;[$e]=!1;[et]=!1;get type(){return this[Ve]}get bubbles(){return this[He]}get cancelable(){return this[Ue]}get composed(){return this[We]}get target(){return this[Ge]}get currentTarget(){return this[Ke]}get eventPhase(){return this[qe]}get defaultPrevented(){return this[Je]}get timeStamp(){return this[Xe]}get cancelBubble(){return this[Ze]}set cancelBubble(e){e&&this.stopPropagation()}get returnValue(){return!this[Je]}set returnValue(e){e||this.preventDefault()}get srcElement(){return this[Ge]}static NONE=0;static CAPTURING_PHASE=1;static AT_TARGET=2;static BUBBLING_PHASE=3;get[Symbol.toStringTag](){return`Event`}constructor(e,t){this[Ve]=e,this[He]=t?.bubbles??!1,this[Ue]=t?.cancelable??!1,this[We]=t?.composed??!1,this[Xe]=Date.now(),Object.defineProperty(this,`isTrusted`,{get:()=>this[Ye],enumerable:!0,configurable:!1})}composedPath(){return this[Ke]?[this[Ke]]:[]}preventDefault(){this[Ue]&&!this[et]&&(this[Je]=!0)}stopPropagation(){this[Ze]=!0}stopImmediatePropagation(){this[Ze]=!0,this[Qe]=!0}},EventTarget=class{_listeners=new Map;get[Symbol.toStringTag](){return`EventTarget`}addEventListener(e,t,n){if(t===null)return;let r=typeof n==`boolean`?n:n?.capture??!1,i=typeof n==`object`?n?.once??!1:!1,a=typeof n==`object`?n?.passive??!1:!1,o=this._listeners.get(e);o||(o=[],this._listeners.set(e,o));for(let e of o)if(e.listener===t&&e.capture===r)return;let s={listener:t,capture:r,once:i,passive:a,removed:!1};o.push(s),typeof n==`object`&&n?.signal&&n.signal.addEventListener(`abort`,()=>{this.removeEventListener(e,t,{capture:r})},{once:!0})}removeEventListener(e,t,n){if(t===null)return;let r=typeof n==`boolean`?n:n?.capture??!1,i=this._listeners.get(e);if(!i)return;let a=i.findIndex(e=>e.listener===t&&e.capture===r);a!==-1&&(i[a].removed=!0,i.splice(a,1),i.length===0&&this._listeners.delete(e))}dispatchEvent(e){let t=e;if(t[$e])throw new Be(`The event is already being dispatched.`,`InvalidStateError`);t[$e]=!0,t[Ge]=this,t[Ke]=this,t[qe]=Event.AT_TARGET;let n=this._listeners.get(e.type);if(n){let r=[...n];for(let n of r)if(!n.removed){if(t[Qe]||t[Ze])break;n.once&&this.removeEventListener(e.type,n.listener,{capture:n.capture});try{n.passive&&(t[et]=!0),typeof n.listener==`function`?n.listener.call(this,e):typeof n.listener.handleEvent==`function`&&n.listener.handleEvent.call(n.listener,e)}catch(e){let t=globalThis;if(typeof t.reportError==`function`)try{t.reportError(e)}catch{}else if(e instanceof Error){let t=`${e.name}: ${e.message}`;F.error(e.stack?`${t}\n${e.stack}`:t)}else F.error(String(e))}finally{t[et]=!1}}}return t[qe]=Event.NONE,t[Ke]=null,t[$e]=!1,!e.defaultPrevented}};for(let[e,t]of[[`NONE`,0],[`CAPTURING_PHASE`,1],[`AT_TARGET`,2],[`BUBBLING_PHASE`,3]])Object.defineProperty(Event.prototype,e,{value:t,writable:!1,enumerable:!0,configurable:!1}),Object.defineProperty(Event,e,{value:t,writable:!1,enumerable:!0,configurable:!1});let tt,nt,rt,it,at;var ot=class Node extends EventTarget{constructor(...e){super(...e),this.ELEMENT_NODE=G.ELEMENT_NODE,this.ATTRIBUTE_NODE=G.ATTRIBUTE_NODE,this.TEXT_NODE=G.TEXT_NODE,this.CDATA_SECTION_NODE=G.CDATA_SECTION_NODE,this.PROCESSING_INSTRUCTION_NODE=G.PROCESSING_INSTRUCTION_NODE,this.COMMENT_NODE=G.COMMENT_NODE,this.DOCUMENT_NODE=G.DOCUMENT_NODE,this.DOCUMENT_TYPE_NODE=G.DOCUMENT_TYPE_NODE,this.DOCUMENT_FRAGMENT_NODE=G.DOCUMENT_FRAGMENT_NODE,this[tt]=G.ELEMENT_NODE,this[nt]=null,this[rt]=[],this[it]=[],this[at]=!1}static{this.ELEMENT_NODE=G.ELEMENT_NODE}static{this.ATTRIBUTE_NODE=G.ATTRIBUTE_NODE}static{this.TEXT_NODE=G.TEXT_NODE}static{this.CDATA_SECTION_NODE=G.CDATA_SECTION_NODE}static{this.PROCESSING_INSTRUCTION_NODE=G.PROCESSING_INSTRUCTION_NODE}static{this.COMMENT_NODE=G.COMMENT_NODE}static{this.DOCUMENT_NODE=G.DOCUMENT_NODE}static{this.DOCUMENT_TYPE_NODE=G.DOCUMENT_TYPE_NODE}static{this.DOCUMENT_FRAGMENT_NODE=G.DOCUMENT_FRAGMENT_NODE}static{this.DOCUMENT_POSITION_DISCONNECTED=1}static{this.DOCUMENT_POSITION_PRECEDING=2}static{this.DOCUMENT_POSITION_FOLLOWING=4}static{this.DOCUMENT_POSITION_CONTAINS=8}static{this.DOCUMENT_POSITION_CONTAINED_BY=16}static{this.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC=32}get nodeType(){return this[z]}get nodeName(){return``}get parentNode(){return this[B]}get parentElement(){let e=this[B];return e&&e[z]===G.ELEMENT_NODE?e:null}get childNodes(){return new NodeList(this[V])}get firstChild(){return this[V][0]??null}get lastChild(){let e=this[V];return e[e.length-1]??null}get previousSibling(){let e=this[B];if(!e)return null;let t=e[V],n=t.indexOf(this);return n>0?t[n-1]:null}get nextSibling(){let e=this[B];if(!e)return null;let t=e[V],n=t.indexOf(this);return n!==-1&&n<t.length-1?t[n+1]:null}get textContent(){return null}set textContent(e){}get nodeValue(){return null}set nodeValue(e){}get ownerDocument(){let e=this;for(;e[B];)e=e[B];let t=globalThis.document;return e===t?t:null}get isConnected(){return this[je]}hasChildNodes(){return this[V].length>0}contains(e){if(e===null)return!1;if(e===this)return!0;let t=e;for(;t;){if(t===this)return!0;t=t[B]}return!1}getRootNode(){let e=this;for(;e[B];)e=e[B];return e}appendChild(e){return e[B]&&e[B].removeChild(e),e[B]=this,this[V].push(e),e[z]===G.ELEMENT_NODE&&this[H].push(e),e}removeChild(e){let t=this[V],n=t.indexOf(e);if(n===-1)throw new DOMException(`Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node.`,`NotFoundError`);if(t.splice(n,1),e[B]=null,e[z]===G.ELEMENT_NODE){let t=this[H].indexOf(e);t!==-1&&this[H].splice(t,1)}return e}insertBefore(e,t){if(t===null)return this.appendChild(e);let n=this[V],r=n.indexOf(t);if(r===-1)throw new DOMException(`Failed to execute 'insertBefore' on 'Node': The node before which the new node is to be inserted is not a child of this node.`,`NotFoundError`);if(e[B]&&e[B].removeChild(e),e[B]=this,n.splice(r,0,e),e[z]===G.ELEMENT_NODE){let t=this[H],i=t.length;for(let a=r;a<n.length;a++)if(n[a][z]===G.ELEMENT_NODE&&n[a]!==e){i=t.indexOf(n[a]);break}t.splice(i,0,e)}return e}replaceChild(e,t){return this.insertBefore(e,t),this.removeChild(t),t}cloneNode(e=!1){let t=new this.constructor;if(t[z]=this[z],e)for(let e of this[V])t.appendChild(e.cloneNode(!0));return t}dispatchEvent(e){let t=super.dispatchEvent(e);if(e.bubbles&&!e.cancelBubble){let t=this[B];for(;t&&(Object.getPrototypeOf(Node.prototype).dispatchEvent.call(t,e),!e.cancelBubble);)t=t[B]}return t}get[(tt=z,nt=B,rt=V,it=H,at=je,Symbol.toStringTag)](){return`Node`}};const st={html:`http://www.w3.org/1999/xhtml`,svg:`http://www.w3.org/2000/svg`,mathML:`http://www.w3.org/1998/Math/MathML`,xml:`http://www.w3.org/XML/1998/namespace`,xmlns:`http://www.w3.org/2000/xmlns/`};var Attr=class{constructor(e,t,n=null,r=null,i=null){this.specified=!0,this[Ie]=e,this[Le]=t,this[Re]=i,this.namespaceURI=n,this.prefix=r;let a=e.indexOf(`:`);this.localName=a===-1?e:e.slice(a+1)}get name(){return this[Ie]}get value(){return this[Le]}set value(e){this[Le]=e}get ownerElement(){return this[Re]}get[Symbol.toStringTag](){return`Attr`}},NamedNodeMap=class{constructor(e){this._items=[],this._ownerElement=e}get length(){return this._items.length}item(e){return this._items[e]??null}getNamedItem(e){return this._findByName(e)}getNamedItemNS(e,t){let n=e===``?null:e;for(let e of this._items)if(e.namespaceURI===n&&e.localName===t)return e;return null}setNamedItem(e){return this._setAttr(e)}setNamedItemNS(e){return this._setAttr(e)}removeNamedItem(e){let t=this._findByName(e);if(!t)throw new DOMException(`Failed to execute 'removeNamedItem' on 'NamedNodeMap': No item with name '${e}' was found.`,`NotFoundError`);return this._removeAttr(t),t}removeNamedItemNS(e,t){let n=this.getNamedItemNS(e,t);if(!n)throw new DOMException(`Failed to execute 'removeNamedItemNS' on 'NamedNodeMap': No item with namespace '${e}' and localName '${t}' was found.`,`NotFoundError`);return this._removeAttr(n),n}[Symbol.iterator](){return this._items[Symbol.iterator]()}get[Symbol.toStringTag](){return`NamedNodeMap`}_setNamedItem(e,t,n=null,r=null){let i=n===null?this._findByName(e):this.getNamedItemNS(n,e.includes(`:`)?e.split(`:`)[1]:e);if(i)i.value=t;else{let i=new Attr(e,t,n,r,this._ownerElement);this._items.push(i)}}_removeNamedItem(e){let t=this._findByName(e);return t?(this._removeAttr(t),!0):!1}_removeNamedItemNS(e,t){let n=this.getNamedItemNS(e,t);return n?(this._removeAttr(n),!0):!1}_findByName(e){let t=this._ownerElement.namespaceURI===st.html,n=t?e.toLowerCase():e;for(let e of this._items)if((t?e.name.toLowerCase():e.name)===n)return e;return null}_setAttr(e){let t=null;if(t=e.namespaceURI===null?this._findByName(e.name):this.getNamedItemNS(e.namespaceURI,e.localName),t){let n=new Attr(t.name,t.value,t.namespaceURI,t.prefix,t.ownerElement);return t.value=e.value,n}return this._items.push(e),null}_removeAttr(e){let t=this._items.indexOf(e);t!==-1&&this._items.splice(t,1)}};I();let ct,lt,ut,dt,ft,pt;var Element=class extends ot{constructor(){super(),this[ct]=``,this[lt]=``,this[ut]=st.html,this[dt]=null,this[ft]=new NamedNodeMap(this),this[pt]=new Map,this._resizeSubscribers=null,this._allocatedClientWidth=0,this._allocatedClientHeight=0,this._pointerCaptures=new Set,this[z]=G.ELEMENT_NODE}get tagName(){return this[Me]}get localName(){return this[Ne]}get namespaceURI(){return this[Pe]}get prefix(){return this[Fe]}get nodeName(){return this[Me]}get attributes(){return this[U]}get id(){return this.getAttribute(`id`)??``}set id(e){this.setAttribute(`id`,e)}get className(){return this.getAttribute(`class`)??``}set className(e){this.setAttribute(`class`,e)}get children(){return this[H]}get childElementCount(){return this[H].length}get firstElementChild(){return this[H][0]??null}get lastElementChild(){let e=this[H];return e[e.length-1]??null}get previousElementSibling(){let e=this[B];if(!e)return null;let t=e[H],n=t.indexOf(this);return n>0?t[n-1]:null}get nextElementSibling(){let e=this[B];if(!e)return null;let t=e[H],n=t.indexOf(this);return n!==-1&&n<t.length-1?t[n+1]:null}get textContent(){let e=``;for(let t of this[V])t.textContent!==null&&(e+=t.textContent);return e}set textContent(e){let t=this[V];for(;t.length>0;)this.removeChild(t[0])}getAttribute(e){let t=this[U].getNamedItem(e);return t?t.value:null}getAttributeNS(e,t){let n=this[U].getNamedItemNS(e,t);return n?n.value:null}setAttribute(e,t){this[U]._setNamedItem(e,String(t))}setAttributeNS(e,t,n){let r=e===``?null:e,i=t.split(`:`),a=i.length>1?i[0]:null;this[U]._setNamedItem(t,String(n),r,a)}removeAttribute(e){this[U]._removeNamedItem(e)}removeAttributeNS(e,t){let n=e===``?null:e;this[U]._removeNamedItemNS(n,t)}hasAttribute(e){return this[U].getNamedItem(e)!==null}hasAttributeNS(e,t){return this[U].getNamedItemNS(e,t)!==null}getAttributeNode(e){return this[U].getNamedItem(e)}setAttributeNode(e){return this[U].setNamedItem(e)}removeAttributeNode(e){let t=this[U].getNamedItem(e.name);if(!t)throw new DOMException(`Failed to execute 'removeAttributeNode' on 'Element': The attribute is not owned by this element.`,`NotFoundError`);return this[U].removeNamedItem(t.name),t}toggleAttribute(e,t){return t===void 0?this.hasAttribute(e)?(this.removeAttribute(e),!1):(this.setAttribute(e,``),!0):t?(this.setAttribute(e,``),!0):(this.removeAttribute(e),!1)}hasAttributes(){return this[U].length>0}dispatchEvent(e){let t=super.dispatchEvent(e),n=this[W].get(`on`+e.type);return typeof n==`function`&&n.call(this,e),t}querySelector(e){return null}querySelectorAll(e){return[]}matches(e){return!1}closest(e){return null}getElementsByTagName(e){let t=[],n=e.toUpperCase(),walk=r=>{for(let i of r[V])if(i[z]===G.ELEMENT_NODE){let r=i;(e===`*`||r[Me]===n)&&t.push(r),walk(r)}};return walk(this),t}getElementsByClassName(e){let t=[],n=e.split(/\s+/).filter(Boolean),walk=e=>{for(let r of e[V])if(r[z]===G.ELEMENT_NODE){let e=r,i=e.className.split(/\s+/);n.every(e=>i.includes(e))&&t.push(e),walk(e)}};return walk(this),t}cloneNode(e=!1){let t=super.cloneNode(!1);t[Me]=this[Me],t[Ne]=this[Ne],t[Pe]=this[Pe],t[Fe]=this[Fe];for(let e of this[U])t.setAttributeNS(e.namespaceURI,e.name,e.value);if(e)for(let e of this[V])t.appendChild(e.cloneNode(!0));return t}_onResize(e){let t=this._resizeSubscribers??=new Set;return t.add(e),()=>{t.delete(e),t.size===0&&(this._resizeSubscribers=null)}}_fireResizeSubscribers(e,t){let n=this._resizeSubscribers;if(!(!n||n.size===0))for(let r of[...n])try{r(e,t)}catch(e){F.error(`ResizeObserver subscriber threw:`,e)}}setPointerCapture(e){this._pointerCaptures.add(e)}releasePointerCapture(e){this._pointerCaptures.delete(e)}hasPointerCapture(e){return this._pointerCaptures.has(e)}get[(ct=Me,lt=Ne,ut=Pe,dt=Fe,ft=U,pt=W,Symbol.toStringTag)](){return`Element`}},CSSStyleDeclaration=class{constructor(){this._cssText=``}get cssText(){return this._cssText}set cssText(e){this._cssText=e;for(let t of e.split(`;`)){let e=t.indexOf(`:`);if(e===-1)continue;let n=t.slice(0,e).trim(),r=t.slice(e+1).trim();if(!n)continue;let i=n.replace(/-([a-z])/g,(e,t)=>t.toUpperCase());this[i]=r}}setProperty(e,t,n){this[e]=t}getPropertyValue(e){let t=this[e];return typeof t==`string`?t:``}removeProperty(e){let t=this[e];return delete this[e],typeof t==`string`?t:``}getPropertyPriority(e){return``}},HTMLElement$1=class extends Element{static{__name(this,`HTMLElement`)}constructor(...e){super(...e),this.style=new CSSStyleDeclaration}get dataset(){let e=this;return new Proxy({},{get(t,n){if(typeof n!=`string`)return;let r=`data-`+n.replace(/[A-Z]/g,e=>`-`+e.toLowerCase());return e.getAttribute(r)??void 0},set(t,n,r){if(typeof n!=`string`)return!1;let i=`data-`+n.replace(/[A-Z]/g,e=>`-`+e.toLowerCase());return e.setAttribute(i,String(r)),!0},deleteProperty(t,n){if(typeof n!=`string`)return!1;let r=`data-`+n.replace(/[A-Z]/g,e=>`-`+e.toLowerCase());return e.removeAttribute(r),!0},has(t,n){if(typeof n!=`string`)return!1;let r=`data-`+n.replace(/[A-Z]/g,e=>`-`+e.toLowerCase());return e.hasAttribute(r)}})}get title(){return this.getAttribute(`title`)??``}set title(e){this.setAttribute(`title`,e)}get lang(){return this.getAttribute(`lang`)??``}set lang(e){this.setAttribute(`lang`,e)}get dir(){return this.getAttribute(`dir`)??``}set dir(e){this.setAttribute(`dir`,e)}get accessKey(){return this.getAttribute(`accesskey`)??``}set accessKey(e){this.setAttribute(`accesskey`,e)}get accessKeyLabel(){return this.getAttribute(`accesskey`)??``}get hidden(){return this.hasAttribute(`hidden`)}set hidden(e){e?this.setAttribute(`hidden`,``):this.removeAttribute(`hidden`)}get draggable(){return this.getAttribute(`draggable`)===`true`}set draggable(e){this.setAttribute(`draggable`,String(e))}get spellcheck(){let e=this.getAttribute(`spellcheck`);return e===`false`?!1:e!==null}set spellcheck(e){this.setAttribute(`spellcheck`,String(e))}get translate(){return this.getAttribute(`translate`)!==`no`}set translate(e){this.setAttribute(`translate`,e?`yes`:`no`)}get tabIndex(){let e=this.getAttribute(`tabindex`);return e===null?-1:Number(e)}set tabIndex(e){this.setAttribute(`tabindex`,String(e))}get contentEditable(){let e=this.getAttribute(`contenteditable`);return e===``||e===`true`?`true`:e===`false`?`false`:`inherit`}set contentEditable(e){e===`inherit`?this.removeAttribute(`contenteditable`):this.setAttribute(`contenteditable`,e)}get isContentEditable(){return this.contentEditable===`true`}get offsetHeight(){return this._allocatedClientHeight}get offsetWidth(){return this._allocatedClientWidth}get offsetLeft(){return 0}get offsetTop(){return 0}get offsetParent(){return null}get clientHeight(){return this._allocatedClientHeight}get clientWidth(){return this._allocatedClientWidth}get clientLeft(){return 0}get clientTop(){return 0}get scrollHeight(){return this._allocatedClientHeight}get scrollWidth(){return this._allocatedClientWidth}get scrollTop(){return 0}set scrollTop(e){}get scrollLeft(){return 0}set scrollLeft(e){}getBoundingClientRect(){let e=this.clientWidth,t=this.clientHeight;return{x:0,y:0,top:0,left:0,right:e,bottom:t,width:e,height:t,toJSON(){return this}}}click(){this.dispatchEvent(new Event(`click`,{bubbles:!0,cancelable:!0}))}blur(){this.dispatchEvent(new Event(`blur`))}focus(){this.dispatchEvent(new Event(`focus`))}get onclick(){return this[W].get(`onclick`)??null}set onclick(e){this[W].set(`onclick`,e)}get ondblclick(){return this[W].get(`ondblclick`)??null}set ondblclick(e){this[W].set(`ondblclick`,e)}get onload(){return this[W].get(`onload`)??null}set onload(e){this[W].set(`onload`,e)}get onerror(){return this[W].get(`onerror`)??null}set onerror(e){this[W].set(`onerror`,e)}get onabort(){return this[W].get(`onabort`)??null}set onabort(e){this[W].set(`onabort`,e)}get onfocus(){return this[W].get(`onfocus`)??null}set onfocus(e){this[W].set(`onfocus`,e)}get onblur(){return this[W].get(`onblur`)??null}set onblur(e){this[W].set(`onblur`,e)}get onchange(){return this[W].get(`onchange`)??null}set onchange(e){this[W].set(`onchange`,e)}get oninput(){return this[W].get(`oninput`)??null}set oninput(e){this[W].set(`oninput`,e)}get onsubmit(){return this[W].get(`onsubmit`)??null}get onreset(){return this[W].get(`onreset`)??null}set onreset(e){this[W].set(`onreset`,e)}get onscroll(){return this[W].get(`onscroll`)??null}set onscroll(e){this[W].set(`onscroll`,e)}get onresize(){return this[W].get(`onresize`)??null}set onresize(e){this[W].set(`onresize`,e)}get onmousedown(){return this[W].get(`onmousedown`)??null}set onmousedown(e){this[W].set(`onmousedown`,e)}get onmouseup(){return this[W].get(`onmouseup`)??null}set onmouseup(e){this[W].set(`onmouseup`,e)}get onmousemove(){return this[W].get(`onmousemove`)??null}set onmousemove(e){this[W].set(`onmousemove`,e)}get onmouseover(){return this[W].get(`onmouseover`)??null}set onmouseover(e){this[W].set(`onmouseover`,e)}get onmouseout(){return this[W].get(`onmouseout`)??null}set onmouseout(e){this[W].set(`onmouseout`,e)}get onmouseenter(){return this[W].get(`onmouseenter`)??null}set onmouseenter(e){this[W].set(`onmouseenter`,e)}get onmouseleave(){return this[W].get(`onmouseleave`)??null}set onmouseleave(e){this[W].set(`onmouseleave`,e)}get oncontextmenu(){return this[W].get(`oncontextmenu`)??null}set oncontextmenu(e){this[W].set(`oncontextmenu`,e)}get onwheel(){return this[W].get(`onwheel`)??null}set onwheel(e){this[W].set(`onwheel`,e)}get onkeydown(){return this[W].get(`onkeydown`)??null}set onkeydown(e){this[W].set(`onkeydown`,e)}get onkeyup(){return this[W].get(`onkeyup`)??null}set onkeyup(e){this[W].set(`onkeyup`,e)}get ontouchstart(){return this[W].get(`ontouchstart`)??null}set ontouchstart(e){this[W].set(`ontouchstart`,e)}get ontouchend(){return this[W].get(`ontouchend`)??null}set ontouchend(e){this[W].set(`ontouchend`,e)}get ontouchmove(){return this[W].get(`ontouchmove`)??null}set ontouchmove(e){this[W].set(`ontouchmove`,e)}get onpointerdown(){return this[W].get(`onpointerdown`)??null}set onpointerdown(e){this[W].set(`onpointerdown`,e)}get onpointerup(){return this[W].get(`onpointerup`)??null}set onpointerup(e){this[W].set(`onpointerup`,e)}get onpointermove(){return this[W].get(`onpointermove`)??null}set onpointermove(e){this[W].set(`onpointermove`,e)}cloneNode(e=!1){return super.cloneNode(e)}get[Symbol.toStringTag](){return`HTMLElement`}},mt=class HTMLCanvasElement extends HTMLElement$1{constructor(...e){super(...e),this.oncontextlost=null,this.oncontextrestored=null,this.onwebglcontextcreationerror=null,this.onwebglcontextlost=null,this.onwebglcontextrestored=null}static{this._contextFactories=new Map}static registerContextFactory(e,t){HTMLCanvasElement._contextFactories.set(e,t)}get width(){let e=this.getAttribute(`width`);return e===null?300:Number(e)}set width(e){this.setAttribute(`width`,String(e))}get height(){let e=this.getAttribute(`height`);return e===null?150:Number(e)}set height(e){this.setAttribute(`height`,String(e))}getContext(e,t){let n=HTMLCanvasElement._contextFactories.get(e);return n?n(this,t):null}toDataURL(e,t){let n=this.getContext(`2d`);return n&&typeof n._toDataURL==`function`?n._toDataURL(e,t):``}toBlob(e,t,n){let r=this.toDataURL(t,n);if(!r){e(null);return}let[i,a]=r.split(`,`),o=i.split(`:`)[1].split(`;`)[0],s=atob(a),c=new Uint8Array(s.length);for(let e=0;e<s.length;e++)c[e]=s.charCodeAt(e);e(new Blob([c],{type:o}))}captureStream(e){return{}}},ht=class DOMMatrix{constructor(e){this.a=1,this.b=0,this.c=0,this.d=1,this.e=0,this.f=0,this.m11=1,this.m12=0,this.m13=0,this.m14=0,this.m21=0,this.m22=1,this.m23=0,this.m24=0,this.m31=0,this.m32=0,this.m33=1,this.m34=0,this.m41=0,this.m42=0,this.m43=0,this.m44=1,this.is2D=!0,this.isIdentity=!0,Array.isArray(e)&&(e.length===6?(this.a=this.m11=e[0],this.b=this.m12=e[1],this.c=this.m21=e[2],this.d=this.m22=e[3],this.e=this.m41=e[4],this.f=this.m42=e[5],this.is2D=!0):e.length===16&&(this.m11=e[0],this.m12=e[1],this.m13=e[2],this.m14=e[3],this.m21=e[4],this.m22=e[5],this.m23=e[6],this.m24=e[7],this.m31=e[8],this.m32=e[9],this.m33=e[10],this.m34=e[11],this.m41=e[12],this.m42=e[13],this.m43=e[14],this.m44=e[15],this.a=this.m11,this.b=this.m12,this.c=this.m21,this.d=this.m22,this.e=this.m41,this.f=this.m42,this.is2D=!1),this.isIdentity=this.a===1&&this.b===0&&this.c===0&&this.d===1&&this.e===0&&this.f===0)}multiply(e){return new DOMMatrix([this.a*e.a+this.c*e.b,this.b*e.a+this.d*e.b,this.a*e.c+this.c*e.d,this.b*e.c+this.d*e.d,this.a*e.e+this.c*e.f+this.e,this.b*e.e+this.d*e.f+this.f])}multiplySelf(e){let t=this.multiply(e);return this.a=t.a,this.b=t.b,this.c=t.c,this.d=t.d,this.e=t.e,this.f=t.f,this.m11=this.a,this.m12=this.b,this.m21=this.c,this.m22=this.d,this.m41=this.e,this.m42=this.f,this.isIdentity=!1,this}inverse(){let e=this.a*this.d-this.b*this.c;if(e===0)return new DOMMatrix([1,0,0,1,0,0]);let t=1/e;return new DOMMatrix([this.d*t,-this.b*t,-this.c*t,this.a*t,(this.c*this.f-this.d*this.e)*t,(this.b*this.e-this.a*this.f)*t])}translate(e=0,t=0){return this.multiply({a:1,b:0,c:0,d:1,e,f:t})}scale(e=1,t=e){return this.multiply({a:e,b:0,c:0,d:t,e:0,f:0})}};const gt=ht;function defineGlobal(e,t){Object.defineProperty(globalThis,e,{value:t,writable:!0,configurable:!0})}function defineGlobalIfMissing(e,t){globalThis[e]===void 0&&defineGlobal(e,t)}const _t={aliceblue:`#f0f8ff`,antiquewhite:`#faebd7`,aqua:`#00ffff`,aquamarine:`#7fffd4`,azure:`#f0ffff`,beige:`#f5f5dc`,bisque:`#ffe4c4`,black:`#000000`,blanchedalmond:`#ffebcd`,blue:`#0000ff`,blueviolet:`#8a2be2`,brown:`#a52a2a`,burlywood:`#deb887`,cadetblue:`#5f9ea0`,chartreuse:`#7fff00`,chocolate:`#d2691e`,coral:`#ff7f50`,cornflowerblue:`#6495ed`,cornsilk:`#fff8dc`,crimson:`#dc143c`,cyan:`#00ffff`,darkblue:`#00008b`,darkcyan:`#008b8b`,darkgoldenrod:`#b8860b`,darkgray:`#a9a9a9`,darkgreen:`#006400`,darkgrey:`#a9a9a9`,darkkhaki:`#bdb76b`,darkmagenta:`#8b008b`,darkolivegreen:`#556b2f`,darkorange:`#ff8c00`,darkorchid:`#9932cc`,darkred:`#8b0000`,darksalmon:`#e9967a`,darkseagreen:`#8fbc8f`,darkslateblue:`#483d8b`,darkslategray:`#2f4f4f`,darkslategrey:`#2f4f4f`,darkturquoise:`#00ced1`,darkviolet:`#9400d3`,deeppink:`#ff1493`,deepskyblue:`#00bfff`,dimgray:`#696969`,dimgrey:`#696969`,dodgerblue:`#1e90ff`,firebrick:`#b22222`,floralwhite:`#fffaf0`,forestgreen:`#228b22`,fuchsia:`#ff00ff`,gainsboro:`#dcdcdc`,ghostwhite:`#f8f8ff`,gold:`#ffd700`,goldenrod:`#daa520`,gray:`#808080`,green:`#008000`,greenyellow:`#adff2f`,grey:`#808080`,honeydew:`#f0fff0`,hotpink:`#ff69b4`,indianred:`#cd5c5c`,indigo:`#4b0082`,ivory:`#fffff0`,khaki:`#f0e68c`,lavender:`#e6e6fa`,lavenderblush:`#fff0f5`,lawngreen:`#7cfc00`,lemonchiffon:`#fffacd`,lightblue:`#add8e6`,lightcoral:`#f08080`,lightcyan:`#e0ffff`,lightgoldenrodyellow:`#fafad2`,lightgray:`#d3d3d3`,lightgreen:`#90ee90`,lightgrey:`#d3d3d3`,lightpink:`#ffb6c1`,lightsalmon:`#ffa07a`,lightseagreen:`#20b2aa`,lightskyblue:`#87cefa`,lightslategray:`#778899`,lightslategrey:`#778899`,lightsteelblue:`#b0c4de`,lightyellow:`#ffffe0`,lime:`#00ff00`,limegreen:`#32cd32`,linen:`#faf0e6`,magenta:`#ff00ff`,maroon:`#800000`,mediumaquamarine:`#66cdaa`,mediumblue:`#0000cd`,mediumorchid:`#ba55d3`,mediumpurple:`#9370db`,mediumseagreen:`#3cb371`,mediumslateblue:`#7b68ee`,mediumspringgreen:`#00fa9a`,mediumturquoise:`#48d1cc`,mediumvioletred:`#c71585`,midnightblue:`#191970`,mintcream:`#f5fffa`,mistyrose:`#ffe4e1`,moccasin:`#ffe4b5`,navajowhite:`#ffdead`,navy:`#000080`,oldlace:`#fdf5e6`,olive:`#808000`,olivedrab:`#6b8e23`,orange:`#ffa500`,orangered:`#ff4500`,orchid:`#da70d6`,palegoldenrod:`#eee8aa`,palegreen:`#98fb98`,paleturquoise:`#afeeee`,palevioletred:`#db7093`,papayawhip:`#ffefd5`,peachpuff:`#ffdab9`,peru:`#cd853f`,pink:`#ffc0cb`,plum:`#dda0dd`,powderblue:`#b0e0e6`,purple:`#800080`,rebeccapurple:`#663399`,red:`#ff0000`,rosybrown:`#bc8f8f`,royalblue:`#4169e1`,saddlebrown:`#8b4513`,salmon:`#fa8072`,sandybrown:`#f4a460`,seagreen:`#2e8b57`,seashell:`#fff5ee`,sienna:`#a0522d`,silver:`#c0c0c0`,skyblue:`#87ceeb`,slateblue:`#6a5acd`,slategray:`#708090`,slategrey:`#708090`,snow:`#fffafa`,springgreen:`#00ff7f`,steelblue:`#4682b4`,tan:`#d2b48c`,teal:`#008080`,thistle:`#d8bfd8`,tomato:`#ff6347`,turquoise:`#40e0d0`,violet:`#ee82ee`,wheat:`#f5deb3`,white:`#ffffff`,whitesmoke:`#f5f5f5`,yellow:`#ffff00`,yellowgreen:`#9acd32`,transparent:`#00000000`};function parseColor(e){if(!e||typeof e!=`string`)return null;let t=e.trim().toLowerCase(),n=_t[t];if(n)return parseHex(n);if(t.startsWith(`#`))return parseHex(t);let r=t.match(/^rgba?\(\s*(\d+(?:\.\d+)?%?)\s*[,\s]\s*(\d+(?:\.\d+)?%?)\s*[,\s]\s*(\d+(?:\.\d+)?%?)\s*(?:[,/]\s*(\d+(?:\.\d+)?%?))?\s*\)$/);if(r)return{r:parseComponent(r[1],255)/255,g:parseComponent(r[2],255)/255,b:parseComponent(r[3],255)/255,a:r[4]===void 0?1:parseComponent(r[4],1)};let i=t.match(/^hsla?\(\s*(\d+(?:\.\d+)?)\s*[,\s]\s*(\d+(?:\.\d+)?)(%)?\s*[,\s]\s*(\d+(?:\.\d+)?)(%)?\s*(?:[,/]\s*(\d+(?:\.\d+)?%?))?\s*\)$/);if(i){let e=parseFloat(i[1]),t=parseFloat(i[2]),n=i[3]===`%`,r=parseFloat(i[4]),a=i[5]===`%`,o=i[6]===void 0?1:parseComponent(i[6],1);return e>1&&(e/=360),(n||t>1)&&(t/=100),(a||r>1)&&(r/=100),hslToRGBA(e,t,r,Math.max(0,Math.min(1,o)))}return null}function parseHex(e){let t=e.slice(1),n,r,i,a=1;if(t.length===3)n=parseInt(t[0]+t[0],16)/255,r=parseInt(t[1]+t[1],16)/255,i=parseInt(t[2]+t[2],16)/255;else if(t.length===4)n=parseInt(t[0]+t[0],16)/255,r=parseInt(t[1]+t[1],16)/255,i=parseInt(t[2]+t[2],16)/255,a=parseInt(t[3]+t[3],16)/255;else if(t.length===6)n=parseInt(t.slice(0,2),16)/255,r=parseInt(t.slice(2,4),16)/255,i=parseInt(t.slice(4,6),16)/255;else if(t.length===8)n=parseInt(t.slice(0,2),16)/255,r=parseInt(t.slice(2,4),16)/255,i=parseInt(t.slice(4,6),16)/255,a=parseInt(t.slice(6,8),16)/255;else return null;return{r:n,g:r,b:i,a}}function parseComponent(e,t){return e.endsWith(`%`)?parseFloat(e)/100*t:parseFloat(e)}function hue2rgb(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function hslToRGBA(e,t,n,r){let i,a,o;if(t===0)i=a=o=n;else{let r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;i=hue2rgb(s,r,e+1/3),a=hue2rgb(s,r,e),o=hue2rgb(s,r,e-1/3)}return{r:i,g:a,b:o,a:r}}const vt={r:0,g:0,b:0,a:1};var CanvasGradient=class{constructor(e,t,r,i,a,o,s){e===`radial`?this._pattern=new n.RadialGradient(t,r,o,i,a,s):this._pattern=new n.LinearGradient(t,r,i,a)}addColorStop(e,t){let n=parseColor(t);n&&this._pattern.addColorStopRGBA(e,n.r,n.g,n.b,n.a)}_getCairoPattern(){return this._pattern}};function quadraticToCubic(e,t,n,r,i,a){return{cp1x:e+2/3*(n-e),cp1y:t+2/3*(r-t),cp2x:i+2/3*(n-i),cp2y:a+2/3*(r-a)}}function computeArcTo(e,t,n,r,i,a,o){let s=e-n,c=t-r,l=i-n,u=a-r,d=Math.sqrt(s*s+c*c),p=Math.sqrt(l*l+u*u);if(d===0||p===0)return null;let m=s/d,h=c/d,g=l/p,_=u/p,v=m*_-h*g;if(Math.abs(v)<1e-10)return null;let y=m*g+h*_,b=Math.acos(Math.max(-1,Math.min(1,y)))/2,x=o/Math.tan(b),S=n+m*x,w=r+h*x,T=n+g*x,E=r+_*x,D=o/Math.sin(b),O=(m+g)/2,k=(h+_)/2,A=Math.sqrt(O*O+k*k),j=n+O/A*D,ee=r+k/A*D;return{tx0:S,ty0:w,tx1:T,ty1:E,cx:j,cy:ee,startAngle:Math.atan2(w-ee,S-j),endAngle:Math.atan2(E-ee,T-j),counterclockwise:v>0}}function cairoArcTo(e,t,n,r,i,a,o,s){let c=computeArcTo(t,n,r,i,a,o,s);if(!c){e.lineTo(r,i);return}let{tx0:l,ty0:u,cx:d,cy:p,startAngle:m,endAngle:h,counterclockwise:g}=c;e.lineTo(l,u),g?e.arcNegative(d,p,s,m,h):e.arc(d,p,s,m,h)}function cairoEllipse(e,t,n,r,i,a,o,s,c){e.save(),e.translate(t,n),e.rotate(a),e.scale(r,i),c?e.arcNegative(0,0,1,o,s):e.arc(0,0,1,o,s),e.restore()}function cairoRoundRect(e,t,n,r,i,a){let o,s,c,l;typeof a==`number`?o=s=c=l=a:a.length===1?o=s=c=l=a[0]:a.length===2?(o=c=a[0],s=l=a[1]):a.length===3?(o=a[0],s=l=a[1],c=a[2]):(o=a[0],s=a[1],c=a[2],l=a[3]);let u=Math.min(r/2,i/2);o=Math.min(o,u),s=Math.min(s,u),c=Math.min(c,u),l=Math.min(l,u);let d=Math.PI/2;e.newSubPath(),e.arc(t+o,n+o,o,Math.PI,Math.PI+d),e.arc(t+r-s,n+s,s,-d,0),e.arc(t+r-c,n+i-c,c,0,d),e.arc(t+l,n+i-l,l,d,Math.PI),e.closePath()}const yt={"source-over":2,"source-in":3,"source-out":4,"source-atop":5,"destination-over":7,"destination-in":8,"destination-out":9,"destination-atop":10,lighter:12,copy:1,xor:11,multiply:14,screen:15,overlay:16,darken:17,lighten:18,"color-dodge":19,"color-burn":20,"hard-light":21,"soft-light":22,difference:23,exclusion:24,hue:25,saturation:26,color:27,luminosity:28},bt={butt:0,round:1,square:2},xt={miter:0,round:1,bevel:2};var St=class Path2D{constructor(e){this._ops=[],e instanceof Path2D&&(this._ops=[...e._ops])}addPath(e){this._ops.push(...e._ops)}moveTo(e,t){this._ops.push({type:`moveTo`,x:e,y:t})}lineTo(e,t){this._ops.push({type:`lineTo`,x:e,y:t})}closePath(){this._ops.push({type:`closePath`})}bezierCurveTo(e,t,n,r,i,a){this._ops.push({type:`bezierCurveTo`,cp1x:e,cp1y:t,cp2x:n,cp2y:r,x:i,y:a})}quadraticCurveTo(e,t,n,r){this._ops.push({type:`quadraticCurveTo`,cpx:e,cpy:t,x:n,y:r})}arc(e,t,n,r,i,a=!1){this._ops.push({type:`arc`,x:e,y:t,radius:n,startAngle:r,endAngle:i,ccw:a})}ellipse(e,t,n,r,i,a,o,s=!1){if(n<0||r<0)throw RangeError(`The radii provided are negative`);this._ops.push({type:`ellipse`,x:e,y:t,rx:n,ry:r,rotation:i,startAngle:a,endAngle:o,ccw:s})}rect(e,t,n,r){this._ops.push({type:`rect`,x:e,y:t,w:n,h:r})}roundRect(e,t,n,r,i=0){this._ops.push({type:`roundRect`,x:e,y:t,w:n,h:r,radii:i})}_replayOnCairo(e){let t=0,n=0;for(let r of this._ops)switch(r.type){case`moveTo`:e.moveTo(r.x,r.y),t=r.x,n=r.y;break;case`lineTo`:e.lineTo(r.x,r.y),t=r.x,n=r.y;break;case`closePath`:e.closePath();break;case`bezierCurveTo`:e.curveTo(r.cp1x,r.cp1y,r.cp2x,r.cp2y,r.x,r.y),t=r.x,n=r.y;break;case`quadraticCurveTo`:{let{cp1x:i,cp1y:a,cp2x:o,cp2y:s}=quadraticToCubic(t,n,r.cpx,r.cpy,r.x,r.y);e.curveTo(i,a,o,s,r.x,r.y),t=r.x,n=r.y;break}case`arc`:r.ccw?e.arcNegative(r.x,r.y,r.radius,r.startAngle,r.endAngle):e.arc(r.x,r.y,r.radius,r.startAngle,r.endAngle);break;case`ellipse`:e.save(),e.translate(r.x,r.y),e.rotate(r.rotation),e.scale(r.rx,r.ry),r.ccw?e.arcNegative(0,0,1,r.startAngle,r.endAngle):e.arc(0,0,1,r.startAngle,r.endAngle),e.restore();break;case`rect`:e.rectangle(r.x,r.y,r.w,r.h);break;case`roundRect`:cairoRoundRect(e,r.x,r.y,r.w,r.h,r.radii);break}}};function asCairoPattern(e){if(!e)return null;let t=e;return typeof t.setFilter!=`function`||typeof t.setExtend!=`function`?null:t}function isPixbufImageSource(e){return typeof e!=`object`||!e?!1:typeof e.isPixbuf==`function`&&e.isPixbuf()}function isCanvasImageSource(e){return typeof e!=`object`||!e?!1:typeof e.getContext==`function`}var Ct=class CanvasPattern{constructor(e,t){let r=asCairoPattern(new n.SurfacePattern(e));if(!r)throw TypeError(`CanvasPattern: cairo SurfacePattern is missing setExtend at runtime — incompatible Cairo binding`);switch(this._pattern=r,t){case`repeat`:case``:case null:r.setExtend(n.Extend.REPEAT);break;case`repeat-x`:case`repeat-y`:r.setExtend(n.Extend.REPEAT);break;case`no-repeat`:r.setExtend(n.Extend.NONE);break}}static create(e,t){if(isPixbufImageSource(e)){let i=e._pixbuf,a=i.get_width(),o=i.get_height(),s=new n.ImageSurface(n.Format.ARGB32,a,o),c=new n.Context(s);return r.cairo_set_source_pixbuf(c,i,0,0),c.paint(),c.$dispose(),new CanvasPattern(s,t)}if(isCanvasImageSource(e)){let r=e.getContext(`2d`);if(r&&typeof r._getSurface==`function`){let e=r._getSurface(),i=e.getWidth(),a=e.getHeight(),o=new n.ImageSurface(n.Format.ARGB32,i,a),s=new n.Context(o);return s.setSourceSurface(e,0,0),s.paint(),s.$dispose(),new CanvasPattern(o,t)}}return null}_getCairoPattern(){return this._pattern}},OurImageData=class{constructor(e,t,n){if(this.colorSpace=`srgb`,typeof e==`number`)this.width=e,this.height=t,this.data=new Uint8ClampedArray(this.width*this.height*4);else if(this.data=e,this.width=t,this.height=n??this.data.length/(4*this.width),this.data.length!==this.width*this.height*4)throw RangeError(`Source data length ${this.data.length} is not a multiple of (4 * width=${this.width})`)}};const wt={translate(e,t){this._ensureSurface(),this._ctx.translate(e,t)},rotate(e){this._ensureSurface(),this._ctx.rotate(e)},scale(e,t){this._ensureSurface(),this._ctx.scale(e,t)},transform(e,t,n,r,i,a){if(this._ensureSurface(),!Number.isFinite(e)||!Number.isFinite(t)||!Number.isFinite(n)||!Number.isFinite(r)||!Number.isFinite(i)||!Number.isFinite(a))return;let o=i,s=a,c=Math.hypot(e,t),l=Math.hypot(n,r),u=Math.atan2(t,e);this._ctx.translate(o,s),u!==0&&this._ctx.rotate(u),(c!==1||l!==1)&&this._ctx.scale(c,l)},setTransform(e,t,n,r,i,a){if(this._ensureSurface(),typeof e==`object`&&e){let t=e;this._ctx.identityMatrix(),this.transform(t.a??t.m11??1,t.b??t.m12??0,t.c??t.m21??0,t.d??t.m22??1,t.e??t.m41??0,t.f??t.m42??0)}else typeof e==`number`?(this._ctx.identityMatrix(),this.transform(e,t,n,r,i,a)):this._ctx.identityMatrix()},getTransform(){let e=this._ctx.userToDevice(0,0),t=this._ctx.userToDevice(1,0),n=this._ctx.userToDevice(0,1),r=e[0]??0,i=e[1]??0,a=(t[0]??0)-r,o=(t[1]??0)-i,s=(n[0]??0)-r,c=(n[1]??0)-i,l=globalThis.DOMMatrix;return typeof l==`function`?new l([a,o,s,c,r,i]):{a,b:o,c:s,d:c,e:r,f:i,m11:a,m12:o,m13:0,m14:0,m21:s,m22:c,m23:0,m24:0,m31:0,m32:0,m33:1,m34:0,m41:r,m42:i,m43:0,m44:1,is2D:!0,isIdentity:a===1&&o===0&&s===0&&c===1&&r===0&&i===0}},resetTransform(){this._ensureSurface(),this._ctx.identityMatrix()}};function installTransformMethods(e){Object.assign(e,wt)}const Tt={beginPath(){this._ensureSurface(),this._ctx.newPath()},moveTo(e,t){this._ensureSurface(),this._ctx.moveTo(e,t)},lineTo(e,t){this._ensureSurface(),this._ctx.lineTo(e,t)},closePath(){this._ensureSurface(),this._ctx.closePath()},bezierCurveTo(e,t,n,r,i,a){this._ensureSurface(),this._ctx.curveTo(e,t,n,r,i,a)},quadraticCurveTo(e,t,n,r){this._ensureSurface();let i,a;this._ctx.hasCurrentPoint()?[i,a]=this._ctx.getCurrentPoint():(i=e,a=t);let{cp1x:o,cp1y:s,cp2x:c,cp2y:l}=quadraticToCubic(i,a,e,t,n,r);this._ctx.curveTo(o,s,c,l,n,r)},arc(e,t,n,r,i,a=!1){if(this._ensureSurface(),Math.abs(i-r)>=2*Math.PI){this._ctx.arc(e,t,n,0,2*Math.PI);return}a?this._ctx.arcNegative(e,t,n,r,i):this._ctx.arc(e,t,n,r,i)},arcTo(e,t,n,r,i){this._ensureSurface();let a,o;this._ctx.hasCurrentPoint()?[a,o]=this._ctx.getCurrentPoint():(a=e,o=t,this._ctx.moveTo(e,t)),cairoArcTo(this._ctx,a,o,e,t,n,r,i)},ellipse(e,t,n,r,i,a,o,s=!1){if(this._ensureSurface(),n<0||r<0)throw RangeError(`The radii provided are negative`);cairoEllipse(this._ctx,e,t,n,r,i,a,o,s)},rect(e,t,n,r){this._ensureSurface(),this._ctx.rectangle(e,t,n,r)},roundRect(e,t,n,r,i=0){this._ensureSurface(),cairoRoundRect(this._ctx,e,t,n,r,i)}};function installPathMethods(e){Object.assign(e,Tt)}function getDrawImageSource(e){if(isPixbufImageSource(e)){let t=e._pixbuf;return{pixbuf:t,imgWidth:t.get_width(),imgHeight:t.get_height()}}if(isCanvasImageSource(e)){let t=e.width??0,n=e.height??0;if(!Number.isFinite(t)||!Number.isFinite(n)||t<=0||n<=0)return null;let i=e.getContext(`2d`);if(i&&typeof i._getSurface==`function`){let e=i._getSurface();e.flush();let a=r.pixbuf_get_from_surface(e,0,0,t,n);if(a)return{pixbuf:a,imgWidth:t,imgHeight:n}}}return null}const Et={fill(e,t){this._ensureSurface(),this._applyCompositing(),this._applyFillStyle();let r;e instanceof St?(this._ctx.newPath(),e._replayOnCairo(this._ctx),r=t):r=e,this._ctx.setFillRule(r===`evenodd`?n.FillRule.EVEN_ODD:n.FillRule.WINDING),this._ctx.fillPreserve()},stroke(e){this._ensureSurface(),this._applyCompositing(),this._applyStrokeStyle(),this._applyLineStyle(),e instanceof St&&(this._ctx.newPath(),e._replayOnCairo(this._ctx)),this._ctx.strokePreserve()},fillRect(e,t,n,r){this._ensureSurface(),this._applyCompositing();let i=this._ctx.copyPath();this._hasShadow()&&this._renderShadow(()=>{this._ctx.newPath(),this._ctx.rectangle(e,t,n,r),this._ctx.fill()}),this._applyFillStyle(),this._ctx.newPath(),this._ctx.rectangle(e,t,n,r),this._ctx.fill(),this._ctx.newPath(),this._ctx.appendPath(i)},strokeRect(e,t,n,r){this._ensureSurface(),this._applyCompositing();let i=this._ctx.copyPath();this._hasShadow()&&this._renderShadow(()=>{this._ctx.newPath(),this._ctx.rectangle(e,t,n,r),this._ctx.stroke()}),this._applyStrokeStyle(),this._applyLineStyle(),this._ctx.newPath(),this._ctx.rectangle(e,t,n,r),this._ctx.stroke(),this._ctx.newPath(),this._ctx.appendPath(i)},clearRect(e,t,r,i){this._ensureSurface();let a=this._ctx.copyPath();this._ctx.save(),this._ctx.setOperator(n.Operator.CLEAR),this._ctx.newPath(),this._ctx.rectangle(e,t,r,i),this._ctx.fill(),this._ctx.restore(),this._ctx.newPath(),this._ctx.appendPath(a)},clip(e,t){this._ensureSurface();let r;e instanceof St?(this._ctx.newPath(),e._replayOnCairo(this._ctx),r=t):r=e,this._ctx.setFillRule(r===`evenodd`?n.FillRule.EVEN_ODD:n.FillRule.WINDING),this._ctx.clip()},isPointInPath(e,t,r,i){this._ensureSurface();let a,o,s;return e instanceof St?(this._ctx.newPath(),e._replayOnCairo(this._ctx),a=t,o=r,s=i):(a=e,o=t,s=r),this._ctx.setFillRule(s===`evenodd`?n.FillRule.EVEN_ODD:n.FillRule.WINDING),this._ctx.inFill(a,o)},isPointInStroke(e,t,n){return this._ensureSurface(),this._applyLineStyle(),e instanceof St?(this._ctx.newPath(),e._replayOnCairo(this._ctx),this._ctx.inStroke(t,n)):this._ctx.inStroke(e,t)},drawImage(e,t,i,a,o,s,c,l,u){this._ensureSurface(),this._applyCompositing();let d,p,m,h,g,_,v,y,b=getDrawImageSource(e);if(!b)return;let{pixbuf:x,imgWidth:S,imgHeight:w}=b;if(a===void 0?(d=0,p=0,m=S,h=w,g=t,_=i,v=S,y=w):s===void 0?(d=0,p=0,m=S,h=w,g=t,_=i,v=a,y=o):(d=t,p=i,m=a,h=o,g=s,_=c,v=l,y=u),!Number.isFinite(d)||!Number.isFinite(p)||!Number.isFinite(m)||!Number.isFinite(h)||!Number.isFinite(g)||!Number.isFinite(_)||!Number.isFinite(v)||!Number.isFinite(y)||m===0||h===0||v===0||y===0)return;this._ctx.save(),this._ctx.rectangle(g,_,v,y),this._ctx.clip(),this._ctx.translate(g,_),this._ctx.scale(v/m,y/h),this._ctx.translate(-d,-p),r.cairo_set_source_pixbuf(this._ctx,x,0,0);let T=asCairoPattern(this._ctx.getSource?.());if(T){let e;e=this._state.imageSmoothingEnabled?this._state.imageSmoothingQuality===`high`?n.Filter.BEST:n.Filter.BILINEAR:n.Filter.NEAREST,T.setFilter(e)}this._state.globalAlpha<1?this._ctx.paintWithAlpha(this._state.globalAlpha):this._ctx.paint(),this._ctx.restore()}};function installDrawingMethods(e){Object.assign(e,Et)}const Dt={createImageData(e,t){return typeof e==`number`?new OurImageData(Math.abs(e),Math.abs(t)):new OurImageData(e.width,e.height)},getImageData(e,t,n,i){this._ensureSurface(),this._surface.flush();let a=r.pixbuf_get_from_surface(this._surface,e,t,n,i);if(!a)return new OurImageData(n,i);let o=a.get_pixels(),s=a.get_has_alpha(),c=a.get_rowstride(),l=a.get_n_channels(),u=new Uint8ClampedArray(n*i*4);for(let e=0;e<i;e++)for(let t=0;t<n;t++){let r=e*c+t*l,i=(e*n+t)*4;u[i]=o[r],u[i+1]=o[r+1],u[i+2]=o[r+2],u[i+3]=s?o[r+3]:255}return new OurImageData(u,n,i)},putImageData(e,t,a,o,s,c,l){this._ensureSurface();let u=o??0,d=s??0,p=c??e.width,m=l??e.height,h=e.data,g=e.width,_=new Uint8Array(p*m*4);for(let e=0;e<m;e++)for(let t=0;t<p;t++){let n=((d+e)*g+(u+t))*4,r=(e*p+t)*4;_[r]=h[n],_[r+1]=h[n+1],_[r+2]=h[n+2],_[r+3]=h[n+3]}let v=i.Pixbuf.new_from_bytes(_,i.Colorspace.RGB,!0,8,p,m,p*4);this._ctx.save(),this._ctx.setOperator(n.Operator.SOURCE),r.cairo_set_source_pixbuf(this._ctx,v,t+u,a+d),this._ctx.rectangle(t+u,a+d,p,m),this._ctx.fill(),this._ctx.restore()}};function installPixelMethods(e){Object.assign(e,Dt)}function parseFontToDescription(e){let t=e.match(/^\s*(italic|oblique|normal)?\s*(small-caps|normal)?\s*(bold|bolder|lighter|[1-9]00|normal)?\s*(\d+(?:\.\d+)?)(px|pt|em|rem|%)?\s*(?:\/\S+)?\s*(.+)?$/i);if(!t)return a.font_description_from_string(e);let n=t[1]||``,r=t[3]||``,i=parseFloat(t[4])||10,o=(t[5]||`px`).toLowerCase(),s=(t[6]||`sans-serif`).replace(/['"]/g,``).trim();o===`pt`?i=i*96/72:o===`em`||o===`rem`?i*=16:o===`%`&&(i=i/100*16);let c=s;n===`italic`?c+=` Italic`:n===`oblique`&&(c+=` Oblique`),r===`bold`||r===`bolder`||parseInt(r)>=600?c+=` Bold`:(r===`lighter`||parseInt(r)>0&&parseInt(r)<=300)&&(c+=` Light`);let l=a.font_description_from_string(c);return l.set_absolute_size(i*a.SCALE),l}function createTextLayout(e,t){let n=o.create_layout(e._ctx);n.set_text(t,-1),n.get_context().set_base_dir(a.Direction.LTR),n.context_changed();let r=parseFontToDescription(e._state.font);return n.set_font_description(r),n}function getTextAlignOffset(e,t){let[,n]=t.get_pixel_extents(),r=n.width;switch(e._state.textAlign){case`center`:return-r/2;case`right`:case`end`:return-r;default:return 0}}function getTextBaselineOffset(e,t){let n=t.get_font_description()||parseFontToDescription(e._state.font),r=t.get_context().get_metrics(n,null),i=r.get_ascent()/a.SCALE,o=r.get_descent()/a.SCALE,s=i+o;switch(e._state.textBaseline){case`top`:return 0;case`hanging`:return-(i*.2);case`middle`:return-(s/2);case`alphabetic`:return-i;case`ideographic`:return-(i+o*.5);case`bottom`:return-s;default:return-i}}const Ot={fillText(e,t,r,i){this._ensureSurface(),this._applyCompositing();let a=createTextLayout(this,e),s=getTextAlignOffset(this,a),c=getTextBaselineOffset(this,a);if(this._hasShadow()){let e=parseColor(this._state.shadowColor);if(e){let[i,l]=this._deviceToUserDistance(this._state.shadowOffsetX,this._state.shadowOffsetY),u=this._state.shadowBlur,d;if(u>0){let[t]=this._deviceToUserDistance(u,0),[,n]=this._deviceToUserDistance(0,u);d=[[i,l,e.a],[i+t,l,e.a*.5],[i-t,l,e.a*.5],[i,l+n,e.a*.5],[i,l-n,e.a*.5]]}else d=[[i,l,e.a]];let p=this._state.imageSmoothingEnabled?n.Antialias.DEFAULT:n.Antialias.NONE;for(let[n,i,l]of d)this._ctx.save(),this._ctx.setAntialias(p),this._ctx.setSourceRGBA(e.r,e.g,e.b,l),this._ctx.moveTo(t+s+n,r+c+i),o.show_layout(this._ctx,a),this._ctx.restore()}}this._applyFillStyle(),this._ctx.save(),this._ctx.setAntialias(this._state.imageSmoothingEnabled?n.Antialias.DEFAULT:n.Antialias.NONE),this._ctx.moveTo(t+s,r+c),o.show_layout(this._ctx,a),this._ctx.restore()},strokeText(e,t,r,i){this._ensureSurface(),this._applyCompositing(),this._applyStrokeStyle(),this._applyLineStyle();let a=createTextLayout(this,e),s=getTextAlignOffset(this,a),c=getTextBaselineOffset(this,a);this._ctx.save(),this._ctx.setAntialias(this._state.imageSmoothingEnabled?n.Antialias.DEFAULT:n.Antialias.NONE),this._ctx.moveTo(t+s,r+c),o.layout_path(this._ctx,a),this._ctx.stroke(),this._ctx.restore()},measureText(e){this._ensureSurface();let t=createTextLayout(this,e),[n,r]=t.get_pixel_extents(),i=t.get_baseline()/a.SCALE,o=Math.max(0,i-n.y),s=Math.max(0,n.y+n.height-i),c=t.get_font_description()||parseFontToDescription(this._state.font),l=t.get_context().get_metrics(c,null),u=l.get_ascent()/a.SCALE,d=l.get_descent()/a.SCALE;return{width:r.width,actualBoundingBoxAscent:o,actualBoundingBoxDescent:s,actualBoundingBoxLeft:Math.max(0,-n.x),actualBoundingBoxRight:n.x+n.width,fontBoundingBoxAscent:u,fontBoundingBoxDescent:d,alphabeticBaseline:0,emHeightAscent:u,emHeightDescent:d,hangingBaseline:u*.8,ideographicBaseline:-d}}};function installTextMethods(e){Object.assign(e,Ot)}const kt={createLinearGradient(e,t,n,r){return new CanvasGradient(`linear`,e,t,n,r)},createRadialGradient(e,t,n,r,i,a){return new CanvasGradient(`radial`,e,t,r,i,n,a)},createPattern(e,t){return Ct.create(e,t)}};function installFactoryMethods(e){Object.assign(e,kt)}function installAllContextMethods(e){installTransformMethods(e),installPathMethods(e),installDrawingMethods(e),installPixelMethods(e),installTextMethods(e),installFactoryMethods(e)}function createDefaultState(){return{fillStyle:`#000000`,fillColor:{...vt},strokeStyle:`#000000`,strokeColor:{...vt},lineWidth:1,lineCap:`butt`,lineJoin:`miter`,miterLimit:10,lineDash:[],lineDashOffset:0,globalAlpha:1,globalCompositeOperation:`source-over`,shadowColor:`rgba(0, 0, 0, 0)`,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,font:`10px sans-serif`,textAlign:`start`,textBaseline:`alphabetic`,direction:`ltr`,imageSmoothingEnabled:!0,imageSmoothingQuality:`low`}}function cloneState(e){return{...e,fillColor:{...e.fillColor},strokeColor:{...e.strokeColor},lineDash:[...e.lineDash]}}var CanvasRenderingContext2D=class{constructor(e,t){this._stateStack=[],this.canvas=e,this._surfaceWidth=e.width||300,this._surfaceHeight=e.height||150,this._surface=new n.ImageSurface(n.Format.ARGB32,this._surfaceWidth,this._surfaceHeight),this._ctx=new n.Context(this._surface),this._state=createDefaultState()}_ensureSurface(){let e=this.canvas.width||300,t=this.canvas.height||150;(e!==this._surfaceWidth||t!==this._surfaceHeight)&&(this._ctx.$dispose(),this._surface.finish(),this._surfaceWidth=e,this._surfaceHeight=t,this._surface=new n.ImageSurface(n.Format.ARGB32,e,t),this._ctx=new n.Context(this._surface),this._stateStack=[])}_resetState(){this._state=createDefaultState(),this._stateStack=[]}_applyFillStyle(){let e=this._state.fillStyle;if(typeof e==`string`){let e=this._state.fillColor,t=e.a*this._state.globalAlpha;this._ctx.setSourceRGBA(e.r,e.g,e.b,t)}else e instanceof CanvasGradient?this._ctx.setSource(e._getCairoPattern()):e instanceof Ct&&(this._ctx.setSource(e._getCairoPattern()),this._applyPatternFilter())}_applyStrokeStyle(){let e=this._state.strokeStyle;if(typeof e==`string`){let e=this._state.strokeColor,t=e.a*this._state.globalAlpha;this._ctx.setSourceRGBA(e.r,e.g,e.b,t)}else e instanceof CanvasGradient?this._ctx.setSource(e._getCairoPattern()):e instanceof Ct&&(this._ctx.setSource(e._getCairoPattern()),this._applyPatternFilter())}_applyPatternFilter(){let e=asCairoPattern(this._ctx.getSource?.());if(!e)return;let t;t=this._state.imageSmoothingEnabled?this._state.imageSmoothingQuality===`high`?n.Filter.BEST:n.Filter.BILINEAR:n.Filter.NEAREST,e.setFilter(t)}_applyLineStyle(){this._ctx.setLineWidth(this._state.lineWidth),this._ctx.setLineCap(bt[this._state.lineCap]),this._ctx.setLineJoin(xt[this._state.lineJoin]),this._ctx.setMiterLimit(this._state.miterLimit),this._ctx.setDash(this._state.lineDash,this._state.lineDashOffset)}_applyCompositing(){let e=yt[this._state.globalCompositeOperation];e!==void 0&&this._ctx.setOperator(e)}_getSurface(){return this._surface}_hasShadow(){if(this._state.shadowBlur===0&&this._state.shadowOffsetX===0&&this._state.shadowOffsetY===0)return!1;let e=parseColor(this._state.shadowColor);return e!==null&&e.a>0}_deviceToUserDistance(e,t){let n=this._ctx.userToDevice(0,0),r=this._ctx.userToDevice(1,0),i=this._ctx.userToDevice(0,1),a=(r[0]??0)-(n[0]??0),o=(r[1]??0)-(n[1]??0),s=(i[0]??0)-(n[0]??0),c=(i[1]??0)-(n[1]??0),l=a*c-o*s;return Math.abs(l)<1e-10?[e,t]:[(c*e-s*t)/l,(-o*e+a*t)/l]}_renderShadow(e){}save(){this._ensureSurface(),this._stateStack.push(cloneState(this._state)),this._ctx.save()}restore(){this._ensureSurface();let e=this._stateStack.pop();e&&(this._state=e,this._ctx.restore())}get fillStyle(){return this._state.fillStyle}set fillStyle(e){if(typeof e==`string`){let t=parseColor(e);t&&(this._state.fillStyle=e,this._state.fillColor=t)}else this._state.fillStyle=e}get strokeStyle(){return this._state.strokeStyle}set strokeStyle(e){if(typeof e==`string`){let t=parseColor(e);t&&(this._state.strokeStyle=e,this._state.strokeColor=t)}else this._state.strokeStyle=e}get lineWidth(){return this._state.lineWidth}set lineWidth(e){e>0&&isFinite(e)&&(this._state.lineWidth=e)}get lineCap(){return this._state.lineCap}set lineCap(e){(e===`butt`||e===`round`||e===`square`)&&(this._state.lineCap=e)}get lineJoin(){return this._state.lineJoin}set lineJoin(e){(e===`miter`||e===`round`||e===`bevel`)&&(this._state.lineJoin=e)}get miterLimit(){return this._state.miterLimit}set miterLimit(e){e>0&&isFinite(e)&&(this._state.miterLimit=e)}get globalAlpha(){return this._state.globalAlpha}set globalAlpha(e){e>=0&&e<=1&&isFinite(e)&&(this._state.globalAlpha=e)}get globalCompositeOperation(){return this._state.globalCompositeOperation}set globalCompositeOperation(e){yt[e]!==void 0&&(this._state.globalCompositeOperation=e)}get imageSmoothingEnabled(){return this._state.imageSmoothingEnabled}set imageSmoothingEnabled(e){this._state.imageSmoothingEnabled=!!e}get imageSmoothingQuality(){return this._state.imageSmoothingQuality}set imageSmoothingQuality(e){(e===`low`||e===`medium`||e===`high`)&&(this._state.imageSmoothingQuality=e)}setLineDash(e){e.some(e=>e<0||!isFinite(e))||(this._state.lineDash=[...e])}getLineDash(){return[...this._state.lineDash]}get lineDashOffset(){return this._state.lineDashOffset}set lineDashOffset(e){isFinite(e)&&(this._state.lineDashOffset=e)}get shadowColor(){return this._state.shadowColor}set shadowColor(e){this._state.shadowColor=e}get shadowBlur(){return this._state.shadowBlur}set shadowBlur(e){e>=0&&isFinite(e)&&(this._state.shadowBlur=e)}get shadowOffsetX(){return this._state.shadowOffsetX}set shadowOffsetX(e){isFinite(e)&&(this._state.shadowOffsetX=e)}get shadowOffsetY(){return this._state.shadowOffsetY}set shadowOffsetY(e){isFinite(e)&&(this._state.shadowOffsetY=e)}get font(){return this._state.font}set font(e){this._state.font=e}get textAlign(){return this._state.textAlign}set textAlign(e){this._state.textAlign=e}get textBaseline(){return this._state.textBaseline}set textBaseline(e){this._state.textBaseline=e}get direction(){return this._state.direction}set direction(e){this._state.direction=e}_toDataURL(e,t){this._surface.flush();let n=imports.gi.Gio,r=imports.gi.GLib,[,i]=r.file_open_tmp(`canvas-XXXXXX.png`);try{this._surface.writeToPNG(i);let[,e]=n.File.new_for_path(i).load_contents(null);return`data:image/png;base64,${r.base64_encode(e)}`}finally{try{r.unlink(i)}catch{}}}_dispose(){this._ctx.$dispose(),this._surface.finish()}};installAllContextMethods(CanvasRenderingContext2D.prototype),defineGlobal(`HTMLCanvasElement`,mt),defineGlobal(`CanvasRenderingContext2D`,CanvasRenderingContext2D),defineGlobal(`DOMMatrix`,ht),defineGlobal(`DOMMatrixReadOnly`,gt);const At=Symbol.for(`gjsify_canvas2d_context`);mt.registerContextFactory(`2d`,(e,t)=>{let n=e,r=n[At];if(r)return r;let i=new CanvasRenderingContext2D(e,t);return n[At]=i,i});var CharacterData=class extends ot{constructor(e=``){super(),this[z]=G.TEXT_NODE,this._data=e}get data(){return this._data}set data(e){this._data=e}get textContent(){return this._data}set textContent(e){this._data=e}get nodeValue(){return this._data}set nodeValue(e){this._data=e}get length(){return this._data.length}appendData(e){this._data+=e}deleteData(e,t){this._data=this._data.substring(0,e)+this._data.substring(e+t)}insertData(e,t){this._data=this._data.substring(0,e)+t+this._data.substring(e)}replaceData(e,t,n){this._data=this._data.substring(0,e)+n+this._data.substring(e+t)}substringData(e,t){return this._data.substring(e,e+t)}cloneNode(e=!1){return new this.constructor(this._data)}get[Symbol.toStringTag](){return`CharacterData`}},jt=class Comment extends CharacterData{constructor(e=``){super(e),this[z]=G.COMMENT_NODE}get nodeName(){return`#comment`}cloneNode(e=!1){return new Comment(this.data)}get[Symbol.toStringTag](){return`Comment`}},Mt=class Text extends CharacterData{constructor(e=``){super(e),this[z]=G.TEXT_NODE}get nodeName(){return`#text`}get wholeText(){let e=this.data,t=this.previousSibling;for(;t&&t instanceof Text;)e=t.data+e,t=t.previousSibling;let n=this.nextSibling;for(;n&&n instanceof Text;)e+=n.data,n=n.nextSibling;return e}splitText(e){let t=this.data.substring(e);this.data=this.data.substring(0,e);let n=new Text(t);return this.parentNode&&this.parentNode.insertBefore(n,this.nextSibling),n}cloneNode(e=!1){return new Text(this.data)}get[Symbol.toStringTag](){return`Text`}},Nt=class DocumentFragment extends ot{constructor(){super(),this[z]=G.DOCUMENT_FRAGMENT_NODE}get nodeName(){return`#document-fragment`}get children(){return this[H]}get childElementCount(){return this[H].length}get firstElementChild(){return this[H][0]??null}get lastElementChild(){let e=this[H];return e[e.length-1]??null}get textContent(){let e=``;for(let t of this.childNodes)t.textContent!==null&&(e+=t.textContent);return e}set textContent(e){for(;this.firstChild;)this.removeChild(this.firstChild);e&&this.appendChild(new Mt(e))}append(...e){for(let t of e)typeof t==`string`?this.appendChild(new Mt(t)):this.appendChild(t)}prepend(...e){let t=this.firstChild;for(let n of e)typeof n==`string`?this.insertBefore(new Mt(n),t):this.insertBefore(n,t)}replaceChildren(...e){for(;this.firstChild;)this.removeChild(this.firstChild);this.append(...e)}getElementById(e){for(let t of this.children){if(t.id===e)return t;let n=this._findById(t,e);if(n)return n}return null}_findById(e,t){for(let n of e.children){if(n.id===t)return n;let e=this._findById(n,t);if(e)return e}return null}cloneNode(e=!1){let t=new DocumentFragment;if(e)for(let e of this.childNodes)t.appendChild(e.cloneNode(!0));return t}get[Symbol.toStringTag](){return`DocumentFragment`}},Pt=s;I(),A(),N();var HTMLImageElement=class extends HTMLElement$1{constructor(){super(),this._complete=!1,this._naturalHeight=0,this._naturalWidth=0,this[Me]=`IMG`,this[Ne]=`img`,this[Pe]=st.html}get complete(){return this._complete}get naturalHeight(){return this._naturalHeight}get naturalWidth(){return this._naturalWidth}get currentSrc(){return this.src}get x(){return 0}get y(){return 0}get alt(){return this.getAttribute(`alt`)??``}set alt(e){this.setAttribute(`alt`,e)}get crossOrigin(){return this.getAttribute(`crossorigin`)}set crossOrigin(e){e===null?this.removeAttribute(`crossorigin`):this.setAttribute(`crossorigin`,e)}get decoding(){return this.getAttribute(`decoding`)??`auto`}set decoding(e){this.setAttribute(`decoding`,e)}get loading(){let e=this.getAttribute(`loading`);return e===`lazy`||e===`eager`?e:`auto`}set loading(e){this.setAttribute(`loading`,e)}get referrerPolicy(){return this.getAttribute(`referrerpolicy`)??``}set referrerPolicy(e){this.setAttribute(`referrerpolicy`,e)}get sizes(){return this.getAttribute(`sizes`)??``}set sizes(e){this.setAttribute(`sizes`,e)}get src(){return this.getAttribute(`src`)??``}set src(e){this.setAttribute(`src`,e);let t=globalThis.__GJSIFY_DEBUG_IMG===!0;if(e.startsWith(`data:`)){let n=e.indexOf(`,`);if(n===-1){this._complete=!0,this.dispatchEvent(new Event(`error`));return}let r=e.slice(5,n),i=e.slice(n+1),a=r.includes(`;base64`);try{let e;e=a?k.base64_decode(i):new TextEncoder().encode(decodeURIComponent(i));let n=k.Bytes.new(e),r=M.MemoryInputStream.new_from_bytes(n);this._pixbuf=Pt.Pixbuf.new_from_stream(r,null),this._naturalWidth=this._pixbuf.get_width(),this._naturalHeight=this._pixbuf.get_height(),this._complete=!0,t&&F.log(`[img] ok data: (${this._naturalWidth}x${this._naturalHeight})`),this.dispatchEvent(new Event(`load`))}catch(e){t&&F.warn(`[img] error data:: ${e instanceof Error?e.message:String(e)}`),this._complete=!0,this.dispatchEvent(new Event(`error`))}return}let n;if(e.startsWith(`file://`))n=k.filename_from_uri(e)[0];else if(e.startsWith(`http://`)||e.startsWith(`https://`)){this._complete=!0,this.dispatchEvent(new Event(`error`));return}else{let t=k.path_get_dirname(c.programInvocationName);n=k.build_filenamev([t,e])}try{t&&F.log(`[img] load ${n}`),this._pixbuf=Pt.Pixbuf.new_from_file(n),this._naturalWidth=this._pixbuf.get_width(),this._naturalHeight=this._pixbuf.get_height(),this._complete=!0,t&&F.log(`[img] ok ${n} (${this._naturalWidth}x${this._naturalHeight})`),this.dispatchEvent(new Event(`load`))}catch(e){t&&F.warn(`[img] error ${n}: ${e instanceof Error?e.message:String(e)}`),this._complete=!0,this.dispatchEvent(new Event(`error`))}}get srcset(){return this.getAttribute(`srcset`)??``}set srcset(e){this.setAttribute(`srcset`,e)}get useMap(){return this.getAttribute(`usemap`)??``}set useMap(e){this.setAttribute(`usemap`,e)}get height(){if(this._pixbuf)return this._pixbuf.get_height();let e=this.getAttribute(`height`);return e===null?0:Number(e)}set height(e){this.setAttribute(`height`,String(e))}get width(){if(this._pixbuf)return this._pixbuf.get_width();let e=this.getAttribute(`width`);return e===null?0:Number(e)}set width(e){this.setAttribute(`width`,String(e))}get isMap(){return this.hasAttribute(`ismap`)}set isMap(e){e?this.setAttribute(`ismap`,``):this.removeAttribute(`ismap`)}decode(){return Promise.resolve()}cloneNode(e=!1){return super.cloneNode(e)}getImageData(){if(!this._pixbuf)return null;let e=this._pixbuf.get_has_alpha()?this._pixbuf:this._pixbuf.add_alpha(!1,0,0,0)??this._pixbuf;return{colorSpace:`srgb`,data:new Uint8ClampedArray(e.get_pixels()),height:e.get_height(),width:e.get_width()}}isPixbuf(){return!!this._pixbuf}get[Symbol.toStringTag](){return`HTMLImageElement`}},HTMLMediaElement=class extends HTMLElement$1{constructor(...e){super(...e),this._src=``,this._srcObject=null,this.currentTime=0,this.duration=NaN,this.paused=!0,this.ended=!1,this.volume=1,this.muted=!1,this.defaultMuted=!1,this.loop=!1,this.autoplay=!1,this.preload=``,this.playbackRate=1,this.defaultPlaybackRate=1,this.readyState=0,this.networkState=0}get buffered(){return{length:0,start:()=>0,end:()=>0}}get seekable(){return{length:0,start:()=>0,end:()=>0}}get played(){return{length:0,start:()=>0,end:()=>0}}get src(){return this._src}set src(e){this._src=e,this._srcObject=null,this.dispatchEvent(new Event(`srcchange`))}get srcObject(){return this._srcObject}set srcObject(e){this._srcObject=e,this._src=``,this.dispatchEvent(new Event(`srcobjectchange`))}play(){return this.paused=!1,this.ended=!1,this.dispatchEvent(new Event(`play`)),Promise.resolve()}pause(){this.paused=!0,this.dispatchEvent(new Event(`pause`))}load(){this.readyState=0,this.networkState=2,this.dispatchEvent(new Event(`loadstart`))}canPlayType(e){return``}static{this.HAVE_NOTHING=0}static{this.HAVE_METADATA=1}static{this.HAVE_CURRENT_DATA=2}static{this.HAVE_FUTURE_DATA=3}static{this.HAVE_ENOUGH_DATA=4}static{this.NETWORK_EMPTY=0}static{this.NETWORK_IDLE=1}static{this.NETWORK_LOADING=2}static{this.NETWORK_NO_SOURCE=3}get[Symbol.toStringTag](){return`HTMLMediaElement`}};const Ft=1e9;function secondsToGstTime(e){return BigInt(Math.round(e*Ft))}function gstTimeToSeconds(e){return Number(e)/Ft}var HTMLVideoElement=class extends HTMLMediaElement{constructor(){super(),this._pipeline=null,this._videoWidth=0,this._videoHeight=0,this.poster=``,this[Me]=`VIDEO`,this[Ne]=`video`,this[Pe]=st.html;let e=this;Object.defineProperty(this,`paused`,{get(){if(!e._pipeline)return!0;let[,t]=e._pipeline.get_state(0n);return t!==4},configurable:!0,enumerable:!0}),Object.defineProperty(this,`currentTime`,{get(){if(!e._pipeline)return 0;let[t,n]=e._pipeline.query_position(3);return t?gstTimeToSeconds(n):0},set(t){e._pipeline?.seek(1,3,5,1,secondsToGstTime(t),0,-1n)},configurable:!0,enumerable:!0}),Object.defineProperty(this,`duration`,{get(){if(!e._pipeline)return NaN;let[t,n]=e._pipeline.query_duration(3);return t&&Number(n)>0?gstTimeToSeconds(n):NaN},configurable:!0,enumerable:!0}),Object.defineProperty(this,`volume`,{get(){return e._playbin()?.volume??1},set(t){let n=e._playbin();n&&(n.volume=Math.max(0,Math.min(1,t)))},configurable:!0,enumerable:!0}),Object.defineProperty(this,`muted`,{get(){return e._playbin()?.mute??!1},set(t){let n=e._playbin();n&&(n.mute=t)},configurable:!0,enumerable:!0})}async play(){this._pipeline?.set_state(4),this.dispatchEvent(new Event(`play`)),this.dispatchEvent(new Event(`playing`))}pause(){this._pipeline?.set_state(3),this.dispatchEvent(new Event(`pause`))}get videoWidth(){return this._videoWidth}set videoWidth(e){this._videoWidth=e}get videoHeight(){return this._videoHeight}set videoHeight(e){this._videoHeight=e}get[Symbol.toStringTag](){return`HTMLVideoElement`}_playbin(){return this._pipeline?.get_by_name(`playbin`)??null}};const It=new class Document extends ot{static{this._elementFactories=new Map}constructor(){super(),this.body=new HTMLElement$1,this.head=new HTMLElement$1,this.documentElement=new HTMLElement$1,this.appendChild(this.documentElement),this.documentElement.appendChild(this.body)}static registerElementFactory(e,t){Document._elementFactories.set(e.toLowerCase(),t)}createElementNS(e,t){let n=t.toLowerCase();switch(n){case`img`:return new HTMLImageElement;case`video`:return new HTMLVideoElement;case`canvas`:return new mt;default:{let e=Document._elementFactories.get(n);return e?e():new HTMLElement$1}}}createElement(e){return this.createElementNS(`http://www.w3.org/1999/xhtml`,e)}createTextNode(e){return new Mt(e)}createComment(e){return new jt(e)}createDocumentFragment(){return new Nt}createEvent(e){return new Event(e)}getElementById(e){return this._findById(this.body,e)}_findById(e,t){if(e.id===t)return e;for(let n of e.children){let e=this._findById(n,t);if(e)return e}return null}get[Symbol.toStringTag](){return`Document`}};var DOMTokenList=class{constructor(e,t){this._ownerElement=e,this._attributeName=t}_getTokens(){let e=this._ownerElement.getAttribute(this._attributeName);return e?e.split(/\s+/).filter(e=>e.length>0):[]}_setTokens(e){let t=e.join(` `);t?this._ownerElement.setAttribute(this._attributeName,t):this._ownerElement.removeAttribute(this._attributeName)}get length(){return this._getTokens().length}get value(){return this._ownerElement.getAttribute(this._attributeName)??``}set value(e){e?this._ownerElement.setAttribute(this._attributeName,e):this._ownerElement.removeAttribute(this._attributeName)}item(e){let t=this._getTokens();return e>=0&&e<t.length?t[e]:null}contains(e){return this._getTokens().includes(e)}add(...e){let t=this._getTokens();for(let n of e)n&&!t.includes(n)&&t.push(n);this._setTokens(t)}remove(...e){let t=this._getTokens().filter(t=>!e.includes(t));this._setTokens(t)}toggle(e,t){let n=this.contains(e);return t===void 0?n?(this.remove(e),!1):(this.add(e),!0):t?(this.add(e),!0):(this.remove(e),!1)}replace(e,t){let n=this._getTokens(),r=n.indexOf(e);return r===-1?!1:(n[r]=t,this._setTokens(n),!0)}supports(e){return!0}forEach(e){let t=this._getTokens();for(let n=0;n<t.length;n++)e(t[n],n,this)}keys(){return this._getTokens().keys()}values(){return this._getTokens().values()}entries(){return this._getTokens().entries()}[Symbol.iterator](){return this._getTokens().values()}toString(){return this.value}get[Symbol.toStringTag](){return`DOMTokenList`}};I(),defineGlobal(`Text`,Mt),defineGlobal(`Comment`,jt),defineGlobal(`DocumentFragment`,Nt),defineGlobal(`DOMTokenList`,DOMTokenList),defineGlobal(`document`,It),defineGlobalIfMissing(`self`,globalThis);var Window=class{};defineGlobalIfMissing(`Window`,Window),defineGlobalIfMissing(`window`,globalThis),defineGlobalIfMissing(`focus`,()=>{}),defineGlobalIfMissing(`blur`,()=>{});{let e=globalThis;if(typeof e.addEventListener!=`function`){let t=new EventTarget;e.__gjsify_globalEventTarget=t,e.addEventListener=(e,n,r)=>t.addEventListener(e,n,r),e.removeEventListener=(e,n,r)=>t.removeEventListener(e,n,r),e.dispatchEvent=e=>t.dispatchEvent(e)}}defineGlobalIfMissing(`devicePixelRatio`,1),defineGlobalIfMissing(`scrollX`,0),defineGlobalIfMissing(`scrollY`,0),defineGlobalIfMissing(`pageXOffset`,0),defineGlobalIfMissing(`pageYOffset`,0),defineGlobalIfMissing(`alert`,(...e)=>F.error(`alert:`,...e)),globalThis.top===void 0&&Object.defineProperty(globalThis,`top`,{get:()=>globalThis,configurable:!0}),globalThis.navigator===void 0&&(globalThis.navigator={});function atobPolyfill(e){if(typeof globalThis.atob==`function`)return globalThis.atob(e);let t=e.replace(/[=\s]/g,``),n=``,r=0,i=0;for(let e=0;e<t.length;e++)r=r<<6|Lt[t.charCodeAt(e)],i+=6,i>=8&&(i-=8,n+=String.fromCharCode(r>>i&255));return n}function btoaPolyfill(e){if(typeof globalThis.btoa==`function`)return globalThis.btoa(e);let t=``,n=0;for(;n+2<e.length;n+=3){let r=e.charCodeAt(n)<<16|e.charCodeAt(n+1)<<8|e.charCodeAt(n+2);t+=K[r>>18&63]+K[r>>12&63]+K[r>>6&63]+K[r&63]}if(n+1===e.length){let r=e.charCodeAt(n)<<16;t+=K[r>>18&63]+K[r>>12&63]+`==`}else if(n+2===e.length){let r=e.charCodeAt(n)<<16|e.charCodeAt(n+1)<<8;t+=K[r>>18&63]+K[r>>12&63]+K[r>>6&63]+`=`}return t}function base64Decode(e){let t=e.replace(/[=\s]/g,``),n=new Uint8Array(t.length*3>>2),r=0,i=0,a=0;for(let e=0;e<t.length;e++)r=r<<6|Lt[t.charCodeAt(e)],i+=6,i>=8&&(i-=8,n[a++]=r>>i&255);return n.subarray(0,a)}function base64Encode(e){let t=``,n=e.length;for(let r=0;r<n;r+=3){let i=e[r],a=r+1<n?e[r+1]:0,o=r+2<n?e[r+2]:0;t+=K[i>>2],t+=K[(i&3)<<4|a>>4],t+=r+1<n?K[(a&15)<<2|o>>6]:`=`,t+=r+2<n?K[o&63]:`=`}return t}var K,Lt,Rt=__esmMin(()=>{K=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,Lt=new Uint8Array(256);for(let e=0;e<64;e++)Lt[K.charCodeAt(e)]=e});function normalizeEncoding(e){if(!e||e===`utf8`||e===`utf-8`)return`utf8`;switch((``+e).toLowerCase().replace(/-/g,``)){case`utf8`:return`utf8`;case`ascii`:return`ascii`;case`latin1`:case`binary`:return`latin1`;case`base64`:return`base64`;case`base64url`:return`base64url`;case`hex`:return`hex`;case`ucs2`:case`utf16le`:return`utf16le`;default:return`utf8`}}function checkEncoding(e){let t=(``+e).toLowerCase().replace(/-/g,``);if(!zt.includes(t))throw TypeError(`Unknown encoding: ${e}`)}var zt,Bt=__esmMin(()=>{zt=[`utf8`,`ascii`,`latin1`,`binary`,`base64`,`base64url`,`hex`,`ucs2`,`utf16le`]});function encodeString(e,t){switch(t){case`utf8`:return textEncoder().encode(e);case`ascii`:{let t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n)&127;return t}case`latin1`:{let t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n)&255;return t}case`base64`:return base64Decode(e.replace(/-/g,`+`).replace(/_/g,`/`));case`base64url`:return encodeString(e.replace(/-/g,`+`).replace(/_/g,`/`),`base64`);case`hex`:{let t=e.length>>>1,n=new Uint8Array(t);for(let r=0;r<t;r++){let t=parseInt(e[r*2],16),i=parseInt(e[r*2+1],16);if(Number.isNaN(t)||Number.isNaN(i))break;n[r]=t<<4|i}return n}case`utf16le`:{let t=new Uint8Array(e.length*2);for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);t[n*2]=r&255,t[n*2+1]=r>>8&255}return t}default:return textEncoder().encode(e)}}function decodeString(e,t,n,r){let i=n!==void 0||r!==void 0?e.subarray(n??0,r??e.length):e;switch(t){case`utf8`:return textDecoder().decode(i);case`ascii`:{let e=``;for(let t=0;t<i.length;t++)e+=String.fromCharCode(i[t]&127);return e}case`latin1`:{let e=``;for(let t=0;t<i.length;t++)e+=String.fromCharCode(i[t]);return e}case`base64`:{let e=``;for(let t=0;t<i.length;t++)e+=String.fromCharCode(i[t]);return btoaPolyfill(e)}case`base64url`:return decodeString(i,`base64`).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=+$/,``);case`hex`:{let e=``;for(let t=0;t<i.length;t++)e+=i[t].toString(16).padStart(2,`0`);return e}case`utf16le`:{let e=``;for(let t=0;t+1<i.length;t+=2)e+=String.fromCharCode(i[t]|i[t+1]<<8);return e}default:return textDecoder().decode(i)}}function checkOffset(e,t,n){if(e+t>n)throw RangeError(`Attempt to access memory outside buffer bounds`)}var Vt,Ht,textEncoder,textDecoder,Ut=__esmMin(()=>{Rt(),textEncoder=()=>Vt??=new TextEncoder,textDecoder=()=>Ht??=new TextDecoder}),Wt,q,Gt,Kt,qt,SlowBuffer,Jt=__esmMin(()=>{Ut(),Bt(),Wt=typeof SharedArrayBuffer<`u`,q=class Buffer extends Uint8Array{static _isBuffer=!0;static alloc(e,t,n){if(typeof e!=`number`)throw TypeError(`The "size" argument must be of type number. Received type ${typeof e}`);if(e<0)throw RangeError(`The value "${e}" is invalid for option "size"`);let r=new Buffer(e);return t!==void 0&&t!==0&&r.fill(t,0,e,n),r}static allocUnsafe(e){if(typeof e!=`number`)throw TypeError(`The "size" argument must be of type number. Received type ${typeof e}`);return new Buffer(e)}static allocUnsafeSlow(e){return Buffer.allocUnsafe(e)}static from(e,t,n){if(typeof e==`string`){let n=normalizeEncoding(t);if(t&&typeof t==`string`){let e=(``+t).toLowerCase().replace(/-/g,``);[`utf8`,`ascii`,`latin1`,`binary`,`base64`,`base64url`,`hex`,`ucs2`,`utf16le`,``].includes(e)||checkEncoding(t)}let r=encodeString(e,n);return new Buffer(r.buffer,r.byteOffset,r.byteLength)}if(ArrayBuffer.isView(e)){let t=new Buffer(e.buffer,e.byteOffset,e.byteLength),n=new Buffer(t.length);return n.set(t),n}if(e instanceof ArrayBuffer){let r=t||0;return new Buffer(e,r,n===void 0?e.byteLength-r:n)}if(Wt&&e instanceof SharedArrayBuffer){let r=t||0,i=n===void 0?e.byteLength-r:n;return new Buffer(new Uint8Array(e,r,i))}if(typeof e==`object`&&e&&typeof e.viewBytes==`function`&&typeof e.byteLength==`number`&&e.constructor?.name===`SharedBuffer`){let r=e,i=t||0,a=n===void 0?r.byteLength-i:n,o=r.viewBytes(i,a);return new Buffer(o.buffer,o.byteOffset,o.byteLength)}if(Array.isArray(e)){let t=new Buffer(e.length);for(let n=0;n<e.length;n++)t[n]=e[n]&255;return t}throw TypeError(`The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array`)}static isBuffer(e){return e instanceof Buffer}static isEncoding(e){if(typeof e!=`string`)return!1;let t=e.toLowerCase().replace(/-/g,``);return[`utf8`,`ascii`,`latin1`,`binary`,`base64`,`base64url`,`hex`,`ucs2`,`utf16le`].includes(t)}static byteLength(e,t){if(typeof e!=`string`){if(ArrayBuffer.isView(e)||e instanceof ArrayBuffer||Wt&&e instanceof SharedArrayBuffer)return e.byteLength;throw TypeError(`The "string" argument must be one of type string, Buffer, or ArrayBuffer`)}switch(normalizeEncoding(t)){case`utf8`:return new TextEncoder().encode(e).byteLength;case`ascii`:case`latin1`:return e.length;case`base64`:case`base64url`:{let t=e.length;for(;t>0&&(e[t-1]===`=`||e[t-1]===` `);)t--;return t*3>>>2}case`hex`:return e.length>>>1;case`utf16le`:return e.length*2;default:return new TextEncoder().encode(e).byteLength}}static compare(e,t){if(!(e instanceof Uint8Array)||!(t instanceof Uint8Array))throw TypeError(`Arguments must be Buffers or Uint8Arrays`);let n=Math.min(e.length,t.length);for(let r=0;r<n;r++){if(e[r]<t[r])return-1;if(e[r]>t[r])return 1}return e.length<t.length?-1:+(e.length>t.length)}static concat(e,t){if(e.length===0)return Buffer.alloc(0);if(t===void 0){t=0;for(let n=0;n<e.length;n++)t+=e[n].length}let n=Buffer.alloc(t),r=0;for(let i=0;i<e.length;i++){let a=e[i],o=Math.min(a.length,t-r);o<=0||(n.set(a.subarray(0,o),r),r+=o)}return n}static poolSize=8192;toString(e,t,n){let r=normalizeEncoding(e);return decodeString(this,r,t,n)}toJSON(){return{type:`Buffer`,data:Array.from(this)}}equals(e){if(!(e instanceof Uint8Array))throw TypeError(`Argument must be a Buffer or Uint8Array`);if(this.length!==e.length)return!1;for(let t=0;t<this.length;t++)if(this[t]!==e[t])return!1;return!0}compare(e,t,n,r,i){if(!(e instanceof Uint8Array))throw TypeError(`Argument must be a Buffer or Uint8Array`);let a=r!==void 0||i!==void 0?this.subarray(r??0,i??this.length):this,o=t!==void 0||n!==void 0?e.subarray(t??0,n??e.length):e;return Buffer.compare(a,o)}copy(e,t=0,n=0,r){let i=r??this.length,a=Math.min(i-n,e.length-t);return a<=0?0:(e.set(this.subarray(n,n+a),t),a)}slice(e,t){let n=e??0,r=t??this.length,i=super.subarray(n,r);return new Buffer(i.buffer,i.byteOffset,i.byteLength)}subarray(e,t){let n=super.subarray(e,t);return new Buffer(n.buffer,n.byteOffset,n.byteLength)}write(e,t,n,r){t??=0;let i=encodeString(e,normalizeEncoding(r||(typeof n==`string`?n:void 0))),a=n!==void 0&&typeof n==`number`?Math.min(n,this.length-t):this.length-t,o=Math.min(i.length,a);return this.set(i.subarray(0,o),t),o}fill(e,t,n,r){let i=t??0,a=n??this.length;if(typeof e==`number`)super.fill(e&255,i,a);else if(typeof e==`string`){let t=encodeString(e,normalizeEncoding(r));if(t.length===0)super.fill(0,i,a);else if(t.length===1)super.fill(t[0],i,a);else for(let e=i;e<a;e++)this[e]=t[(e-i)%t.length]}else if(e instanceof Uint8Array)if(e.length===0)super.fill(0,i,a);else for(let t=i;t<a;t++)this[t]=e[(t-i)%e.length];return this}indexOf(e,t,n){if(typeof e==`number`)return super.indexOf(e&255,t);let r=typeof e==`string`?encodeString(e,normalizeEncoding(n)):e,i=t??0;outer:for(let e=i;e<=this.length-r.length;e++){for(let t=0;t<r.length;t++)if(this[e+t]!==r[t])continue outer;return e}return-1}lastIndexOf(e,t,n){if(typeof e==`number`)return t===void 0?super.lastIndexOf(e&255):super.lastIndexOf(e&255,t);let r=typeof e==`string`?encodeString(e,normalizeEncoding(n)):e,i=t===void 0?this.length-r.length:Math.min(t,this.length-r.length);outer:for(let e=i;e>=0;e--){for(let t=0;t<r.length;t++)if(this[e+t]!==r[t])continue outer;return e}return-1}includes(e,t,n){return this.indexOf(e,t,n)!==-1}readUInt8(e=0){return checkOffset(e,1,this.length),this[e]}readUInt16BE(e=0){return checkOffset(e,2,this.length),this[e]<<8|this[e+1]}readUInt16LE(e=0){return checkOffset(e,2,this.length),this[e]|this[e+1]<<8}readUInt32BE(e=0){return checkOffset(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])}readUInt32LE(e=0){return checkOffset(e,4,this.length),this[e+3]*16777216+(this[e+2]<<16|this[e+1]<<8|this[e])>>>0}readInt8(e=0){return checkOffset(e,1,this.length),this[e]|(this[e]&128?4294967040:0)}readInt16BE(e=0){checkOffset(e,2,this.length);let t=this[e]<<8|this[e+1];return t&32768?t|4294901760:t}readInt16LE(e=0){checkOffset(e,2,this.length);let t=this[e]|this[e+1]<<8;return t&32768?t|4294901760:t}readInt32BE(e=0){return checkOffset(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]}readInt32LE(e=0){return checkOffset(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24}readFloatBE(e=0){return checkOffset(e,4,this.length),new DataView(this.buffer,this.byteOffset+e,4).getFloat32(0,!1)}readFloatLE(e=0){return checkOffset(e,4,this.length),new DataView(this.buffer,this.byteOffset+e,4).getFloat32(0,!0)}readDoubleBE(e=0){return checkOffset(e,8,this.length),new DataView(this.buffer,this.byteOffset+e,8).getFloat64(0,!1)}readDoubleLE(e=0){return checkOffset(e,8,this.length),new DataView(this.buffer,this.byteOffset+e,8).getFloat64(0,!0)}readBigInt64BE(e=0){return checkOffset(e,8,this.length),new DataView(this.buffer,this.byteOffset+e,8).getBigInt64(0,!1)}readBigInt64LE(e=0){return checkOffset(e,8,this.length),new DataView(this.buffer,this.byteOffset+e,8).getBigInt64(0,!0)}readBigUInt64BE(e=0){return checkOffset(e,8,this.length),new DataView(this.buffer,this.byteOffset+e,8).getBigUint64(0,!1)}readBigUInt64LE(e=0){return checkOffset(e,8,this.length),new DataView(this.buffer,this.byteOffset+e,8).getBigUint64(0,!0)}readUIntBE(e,t){checkOffset(e,t,this.length);let n=0;for(let r=0;r<t;r++)n=n*256+this[e+r];return n}readUIntLE(e,t){checkOffset(e,t,this.length);let n=0,r=1;for(let i=0;i<t;i++)n+=this[e+i]*r,r*=256;return n}readIntBE(e,t){checkOffset(e,t,this.length);let n=0;for(let r=0;r<t;r++)n=n*256+this[e+r];return n>=2**(8*t-1)&&(n-=2**(8*t)),n}readIntLE(e,t){checkOffset(e,t,this.length);let n=0,r=1;for(let i=0;i<t;i++)n+=this[e+i]*r,r*=256;return n>=2**(8*t-1)&&(n-=2**(8*t)),n}writeUInt8(e,t=0){return checkOffset(t,1,this.length),this[t]=e&255,t+1}writeUInt16BE(e,t=0){return checkOffset(t,2,this.length),this[t]=e>>>8&255,this[t+1]=e&255,t+2}writeUInt16LE(e,t=0){return checkOffset(t,2,this.length),this[t]=e&255,this[t+1]=e>>>8&255,t+2}writeUInt32BE(e,t=0){return checkOffset(t,4,this.length),this[t]=e>>>24&255,this[t+1]=e>>>16&255,this[t+2]=e>>>8&255,this[t+3]=e&255,t+4}writeUInt32LE(e,t=0){return checkOffset(t,4,this.length),this[t]=e&255,this[t+1]=e>>>8&255,this[t+2]=e>>>16&255,this[t+3]=e>>>24&255,t+4}writeInt8(e,t=0){return checkOffset(t,1,this.length),e<0&&(e=255+e+1),this[t]=e&255,t+1}writeInt16BE(e,t=0){return checkOffset(t,2,this.length),this[t]=e>>>8&255,this[t+1]=e&255,t+2}writeInt16LE(e,t=0){return checkOffset(t,2,this.length),this[t]=e&255,this[t+1]=e>>>8&255,t+2}writeInt32BE(e,t=0){return checkOffset(t,4,this.length),this[t]=e>>>24&255,this[t+1]=e>>>16&255,this[t+2]=e>>>8&255,this[t+3]=e&255,t+4}writeInt32LE(e,t=0){return checkOffset(t,4,this.length),this[t]=e&255,this[t+1]=e>>>8&255,this[t+2]=e>>>16&255,this[t+3]=e>>>24&255,t+4}writeFloatBE(e,t=0){return checkOffset(t,4,this.length),new DataView(this.buffer,this.byteOffset+t,4).setFloat32(0,e,!1),t+4}writeFloatLE(e,t=0){return checkOffset(t,4,this.length),new DataView(this.buffer,this.byteOffset+t,4).setFloat32(0,e,!0),t+4}writeDoubleBE(e,t=0){return checkOffset(t,8,this.length),new DataView(this.buffer,this.byteOffset+t,8).setFloat64(0,e,!1),t+8}writeDoubleLE(e,t=0){return checkOffset(t,8,this.length),new DataView(this.buffer,this.byteOffset+t,8).setFloat64(0,e,!0),t+8}writeBigInt64BE(e,t=0){return checkOffset(t,8,this.length),new DataView(this.buffer,this.byteOffset+t,8).setBigInt64(0,e,!1),t+8}writeBigInt64LE(e,t=0){return checkOffset(t,8,this.length),new DataView(this.buffer,this.byteOffset+t,8).setBigInt64(0,e,!0),t+8}writeBigUInt64BE(e,t=0){return checkOffset(t,8,this.length),new DataView(this.buffer,this.byteOffset+t,8).setBigUint64(0,e,!1),t+8}writeBigUInt64LE(e,t=0){return checkOffset(t,8,this.length),new DataView(this.buffer,this.byteOffset+t,8).setBigUint64(0,e,!0),t+8}swap16(){let e=this.length;if(e%2!=0)throw RangeError(`Buffer size must be a multiple of 16-bits`);for(let t=0;t<e;t+=2){let e=this[t];this[t]=this[t+1],this[t+1]=e}return this}swap32(){let e=this.length;if(e%4!=0)throw RangeError(`Buffer size must be a multiple of 32-bits`);for(let t=0;t<e;t+=4){let e=this[t],n=this[t+1];this[t]=this[t+3],this[t+1]=this[t+2],this[t+2]=n,this[t+3]=e}return this}swap64(){let e=this.length;if(e%8!=0)throw RangeError(`Buffer size must be a multiple of 64-bits`);for(let t=0;t<e;t+=8){let e=this[t],n=this[t+1],r=this[t+2],i=this[t+3];this[t]=this[t+7],this[t+1]=this[t+6],this[t+2]=this[t+5],this[t+3]=this[t+4],this[t+4]=i,this[t+5]=r,this[t+6]=n,this[t+7]=e}return this}},Gt=2**31-1,Kt=2**28-16,qt={MAX_LENGTH:Gt,MAX_STRING_LENGTH:Kt},SlowBuffer=class extends q{constructor(e){super(e)}}}),Yt=__exportAll$4({Blob:()=>x,Buffer:()=>q,File:()=>S,INSPECT_MAX_BYTES:()=>50,SlowBuffer:()=>SlowBuffer,atob:()=>Xt,atobPolyfill:()=>atobPolyfill,base64Decode:()=>base64Decode,base64Encode:()=>base64Encode,btoa:()=>Zt,btoaPolyfill:()=>btoaPolyfill,checkEncoding:()=>checkEncoding,constants:()=>qt,default:()=>Qt,kMaxLength:()=>Gt,kStringMaxLength:()=>Kt,normalizeEncoding:()=>normalizeEncoding}),Xt,Zt,Qt,J=__esmMin(()=>{Rt(),w(),Bt(),Jt(),Xt=globalThis.atob,Zt=globalThis.btoa,Qt={Buffer:q,SlowBuffer,Blob:x,File:S,atob:Xt,btoa:Zt,kMaxLength:Gt,kStringMaxLength:Kt,constants:qt,INSPECT_MAX_BYTES:50}});J(),`Buffer`in globalThis||Object.defineProperty(globalThis,`Buffer`,{value:q,enumerable:!1,writable:!0,configurable:!0}),A(),typeof globalThis.btoa!=`function`&&Object.defineProperty(globalThis,`btoa`,{value:function btoa(e){let t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n)&255;return k.base64_encode(t)},enumerable:!0,writable:!0,configurable:!0}),typeof globalThis.atob!=`function`&&Object.defineProperty(globalThis,`atob`,{value:function atob(e){let t=k.base64_decode(e),n=``;for(let e=0;e<t.length;e++)n+=String.fromCharCode(t[e]);return n},enumerable:!0,writable:!0,configurable:!0}),L(),typeof queueMicrotask!=`function`&&Object.defineProperty(globalThis,`queueMicrotask`,{value:ge,enumerable:!0,writable:!0,configurable:!0});function getGjsGlobal(){return globalThis}function getGioNamespace(){let e=getGjsGlobal().imports?.gi;if(!e)return null;let t=null;try{t=e.GioUnix??null}catch{}if(!t)try{t=e.Gio??null}catch{}return t}function getMonotonicTime(){try{let e=getGjsGlobal().imports?.gi?.GLib;if(e?.get_monotonic_time)return BigInt(e.get_monotonic_time())*1000n}catch{}return typeof performance?.now==`function`?BigInt(Math.round(performance.now()*1e6)):BigInt(Date.now())*1000000n}const $t=getMonotonicTime();function hrtime(e){let t=getMonotonicTime()-$t,n=Number(t/1000000000n),r=Number(t%1000000000n);if(e){let t=n-e[0],i=r-e[1];return i<0&&(t--,i+=1e9),[t,i]}return[n,r]}function hrtimeBigint(){return getMonotonicTime()-$t}function detectGjsVersion(){try{let e=getGjsGlobal().imports?.system;if(e?.version!==void 0){let t=Number(e.version);return`${Math.floor(t/1e4)}.${Math.floor(t%1e4/100)}.${t%100}`}}catch{}}function detectNodeVersion(){if(typeof globalThis.process?.versions?.node==`string`)return globalThis.process.versions.node}function detectVersionInfo(){if(detectNodeVersion())return{version:globalThis.process.version,versions:{...globalThis.process.versions},title:globalThis.process?.title||`node`};let e=detectGjsVersion(),t={node:`20.0.0`};return e&&(t.gjs=e),{version:`v20.0.0`,versions:t,title:`gjs`}}function detectPpid(){if(typeof globalThis.process?.ppid==`number`)return globalThis.process.ppid;try{let e=getGjsGlobal().imports?.gi?.GLib;if(e){let[,t]=e.file_get_contents(`/proc/self/status`);if(t){let e=new TextDecoder().decode(t).match(/PPid:\s+(\d+)/);if(e)return parseInt(e[1],10)}}}catch{}return 0}function detectPlatform(){try{let e=getGjsGlobal().imports?.gi?.GLib;if(e&&e.get_os_info(`ID`))return`linux`}catch{}return getGjsGlobal().imports?.system===void 0&&typeof globalThis.process?.platform==`string`?globalThis.process.platform:`linux`}function detectArch(){return typeof globalThis.process?.arch==`string`?globalThis.process.arch:`x64`}function getPid(){if(typeof globalThis.process?.pid==`number`)return globalThis.process.pid;try{let e=getGjsGlobal().imports?.gi?.GLib;if(e){let[,t]=e.file_get_contents(`/proc/self/stat`);if(t){let e=new TextDecoder().decode(t),n=parseInt(e,10);if(!isNaN(n))return n}}}catch{}return 0}function getEnvProxy(){if(typeof globalThis.process?.env==`object`)return globalThis.process.env;try{let e=getGjsGlobal().imports?.gi?.GLib;if(e)return new Proxy({},{get(t,n){if(typeof n==`string`)return e.getenv(n)??void 0},set(t,n,r){return typeof n==`string`?(e.setenv(n,String(r),!0),!0):!1},deleteProperty(t,n){return typeof n==`string`?(e.unsetenv(n),!0):!1},has(t,n){return typeof n==`string`?e.getenv(n)!==null:!1},ownKeys(t){return e.listenv()},getOwnPropertyDescriptor(t,n){if(typeof n!=`string`)return;let r=e.getenv(n);if(r!==null)return{configurable:!0,enumerable:!0,writable:!0,value:r}}})}catch{}return{}}function getArgv(){if(globalThis.process?.argv!==void 0)return globalThis.process.argv;try{let e=getGjsGlobal().imports?.system;if(e?.programArgs)return[`gjs`,e.programInvocationName||``,...e.programArgs]}catch{}return[`gjs`]}function getExecPath(){if(typeof globalThis.process?.execPath==`string`)return globalThis.process.execPath;try{let e=getGjsGlobal().imports?.system;if(e?.programInvocationName)return e.programInvocationName}catch{}return`/usr/bin/gjs`}function getCwd(){try{let e=getGjsGlobal().imports?.gi?.GLib;if(e?.get_current_dir)return e.get_current_dir()}catch{}return`/`}function chdir(e){let t=getGjsGlobal().imports?.gi?.GLib;try{if(t?.chdir){if(!t.file_test(e,16)){let t=Error(`ENOENT: no such file or directory, chdir '${e}'`);throw t.code=`ENOENT`,t.syscall=`chdir`,t.path=e,t}t.chdir(e);return}}catch(e){if(e&&typeof e==`object`&&e.code===`ENOENT`)throw e}if(!t){let t=globalThis.process;if(t&&typeof t.chdir==`function`){t.chdir(e);return}}throw Error(`process.chdir() is not supported in this environment`)}L();function exitProcess(e){let t=getGjsGlobal().imports,n=t?.gi?.GLib,r=t?.system,i=n?.idle_add,a=n?.SOURCE_REMOVE,o=n?.PRIORITY_DEFAULT;if(r?.exit&&i&&typeof o==`number`&&typeof a==`boolean`)return ensureMainLoop(),i(o,()=>(quitMainLoop(),r.exit(e),a)),new Promise(()=>{});try{r?.exit&&r.exit(e)}catch{}let s=globalThis.process;throw s&&typeof s.exit==`function`&&s.exit(e),Error(`process.exit(${e})`)}function isGjs(){return getGjsGlobal().imports?.gi?.GLib!==void 0}function killPid(e,t){try{let n=getGjsGlobal().imports?.gi?.GLib;if(n){let r=typeof t==`number`?String(t):t||`SIGTERM`,i=r.startsWith(`SIG`)?`-${r.slice(3)}`:`-${r}`;return n.spawn_command_line_sync(`kill ${i} ${e}`),!0}}catch{}if(!isGjs()){let n=globalThis.process;if(n&&typeof n.kill==`function`)return n.kill(e,t)}throw Error(`process.kill() is not supported in this environment`)}function memoryUsage(){try{let e=getGjsGlobal().imports?.gi?.GLib;if(e){let[,t]=e.file_get_contents(`/proc/self/status`);if(t){let e=new TextDecoder().decode(t).match(/VmRSS:\s+(\d+)/),n=e?parseInt(e[1],10)*1024:0;return{rss:n,heapTotal:n,heapUsed:n,external:0,arrayBuffers:0}}}}catch{}if(!isGjs()){let e=globalThis.process;if(e&&typeof e.memoryUsage==`function`)return e.memoryUsage()}return{rss:0,heapTotal:0,heapUsed:0,external:0,arrayBuffers:0}}function cpuUsage(e){if(!isGjs()){let t=globalThis.process;if(t&&typeof t.cpuUsage==`function`)return t.cpuUsage(e)}return{user:0,system:0}}let en=null;const tn=globalThis.imports?.gi;if(tn)try{en=tn.GjsifyTerminal}catch{}const nn=en;function onceWrapper(){let{target:e,type:t,listener:n}=this;return this.wrapperFn&&e.removeListener(t,this.wrapperFn),n.apply(e,Array.from(arguments))}function _onceWrap(e,t,n){let r={target:e,type:t,listener:n,wrapperFn:void 0},i=onceWrapper.bind(r);return r.wrapperFn=i,i.listener=n,i}function arrayClone(e){switch(e.length){case 0:return[];case 1:return[e[0]];case 2:return[e[0],e[1]];case 3:return[e[0],e[1],e[2]];default:return e.slice()}}function checkListener(e){if(typeof e!=`function`)throw TypeError(`The "listener" argument must be of type Function. Received type `+typeof e)}function validateNumber(e,t){if(typeof e!=`number`||e!==e)throw TypeError(`The "${t}" argument must be of type number. Received type ${typeof e}`)}function spliceOne(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}function unwrapListeners(e){let t=Array.from({length:e.length});for(let n=0;n<t.length;++n)t[n]=e[n].listener??e[n];return t}function createAbortError$2(e){let t=Error(`The operation was aborted`);return t.name=`AbortError`,t.code=`ABORT_ERR`,e?.reason&&(t.cause=e.reason),t}var rn,an,on,sn=__esmMin(()=>{I(),rn=Symbol(`kCapture`),an=Symbol.for(`nodejs.rejection`),on=class EventEmitter{static defaultMaxListeners=10;static errorMonitor=Symbol(`events.errorMonitor`);static captureRejectionSymbol=an;static _captureRejections=!1;static get captureRejections(){return EventEmitter._captureRejections}static set captureRejections(e){if(typeof e!=`boolean`)throw TypeError(`The "captureRejections" argument must be of type boolean.`);EventEmitter._captureRejections=e}_events;_eventsCount;_maxListeners;[rn];constructor(e){this._events=Object.create(null),this._eventsCount=0,this._maxListeners=void 0,this[rn]=e?.captureRejections??EventEmitter._captureRejections}setMaxListeners(e){if(validateNumber(e,`n`),e<0)throw RangeError(`The value of "n" is out of range. It must be a non-negative number. Received `+e);return this._maxListeners=e,this}getMaxListeners(){return this._maxListeners??EventEmitter.defaultMaxListeners}emit(e,...t){let n=this._events,r=e===`error`;if(n!==void 0)r&&n[EventEmitter.errorMonitor]!==void 0&&this.emit(EventEmitter.errorMonitor,...t),r&&=n.error===void 0;else if(!r)return!1;if(r){let e;if(e=t.length>0?t[0]:Error(`Unhandled error.`),e instanceof Error)throw e;let n=Error(`Unhandled error. (`+e+`)`);throw n.context=e,n}let i=n[e];if(i===void 0)return!1;if(typeof i==`function`){let n=i.apply(this,t);n!=null&&this[rn]&&this._addCatch(n,e,t)}else{let n=arrayClone(i),r=n.length;for(let i=0;i<r;++i){let r=n[i].apply(this,t);r!=null&&this[rn]&&this._addCatch(r,e,t)}}return!0}_addCatch(e,t,n){typeof e?.then==`function`&&e.then(void 0,e=>{let r=this[an];if(typeof r==`function`)r.call(this,e,t,...n);else{let t=this[rn];try{this[rn]=!1,this.emit(`error`,e)}finally{this[rn]=t}}})}addListener(e,t){return this._addListener(e,t,!1)}on(e,t){return this._addListener(e,t,!1)}prependListener(e,t){return this._addListener(e,t,!0)}_addListener(e,t,n){checkListener(t);let r=this._events;r===void 0?(r=this._events=Object.create(null),this._eventsCount=0):r.newListener!==void 0&&(this.emit(`newListener`,e,t.listener??t),r=this._events);let i=r[e];i===void 0?(r[e]=t,++this._eventsCount):typeof i==`function`?r[e]=n?[t,i]:[i,t]:n?i.unshift(t):i.push(t);let a=this.getMaxListeners();if(a>0){let t=typeof r[e]==`function`?1:r[e].length;if(t>a&&!r[e].warned){typeof r[e]!=`function`&&(r[e].warned=!0);let n=Error(`Possible EventEmitter memory leak detected. ${t} ${String(e)} listeners added to [${this.constructor.name}]. Use emitter.setMaxListeners() to increase limit`);n.name=`MaxListenersExceededWarning`,F.warn(n.message)}}return this}once(e,t){return checkListener(t),this.on(e,_onceWrap(this,e,t)),this}prependOnceListener(e,t){return checkListener(t),this.prependListener(e,_onceWrap(this,e,t)),this}removeListener(e,t){checkListener(t);let n=this._events;if(n===void 0)return this;let r=n[e];if(r===void 0)return this;if(r===t||r.listener===t)--this._eventsCount===0?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit(`removeListener`,e,r.listener??t));else if(typeof r!=`function`){let i=-1;for(let e=r.length-1;e>=0;e--)if(r[e]===t||r[e].listener===t){i=e;break}if(i<0)return this;i===0?r.shift():spliceOne(r,i),r.length===1&&(n[e]=r[0]),n.removeListener!==void 0&&this.emit(`removeListener`,e,t.listener??t)}return this}off(e,t){return this.removeListener(e,t)}removeAllListeners(e){let t=this._events;if(t===void 0)return this;if(t.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):t[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete t[e]),this;if(arguments.length===0){let e=Object.keys(t);for(let t=0;t<e.length;++t){let n=e[t];n!==`removeListener`&&this.removeAllListeners(n)}return this.removeAllListeners(`removeListener`),this._events=Object.create(null),this._eventsCount=0,this}let n=t[e];if(typeof n==`function`)this.removeListener(e,n);else if(n!==void 0)for(let t=n.length-1;t>=0;t--)this.removeListener(e,n[t]);return this}listeners(e){let t=this._events;if(t===void 0)return[];let n=t[e];return n===void 0?[]:typeof n==`function`?[n.listener??n]:unwrapListeners(n)}rawListeners(e){let t=this._events;if(t===void 0)return[];let n=t[e];return n===void 0?[]:typeof n==`function`?[n]:arrayClone(n)}listenerCount(e){let t=this._events;if(t===void 0)return 0;let n=t[e];return n===void 0?0:typeof n==`function`?1:n.length}eventNames(){return(this._eventsCount??0)>0?Reflect.ownKeys(this._events):[]}static once(e,t,n){return new Promise((r,i)=>{let a=n?.signal;if(a?.aborted){i(createAbortError$2(a));return}if(typeof e.addEventListener==`function`){let n=e,handler=(...e)=>{a&&a.removeEventListener(`abort`,abortHandler),r(e)},errorHandler=e=>{a&&a.removeEventListener(`abort`,abortHandler),n.removeEventListener(`error`,errorHandler),i(e)},abortHandler=()=>{n.removeEventListener(t,handler),n.removeEventListener(`error`,errorHandler),i(createAbortError$2(a))};n.addEventListener(t,handler,{once:!0}),t!==`error`&&n.addEventListener(`error`,errorHandler,{once:!0}),a&&a.addEventListener(`abort`,abortHandler,{once:!0});return}let o=e,eventHandler=(...e)=>{a&&a.removeEventListener(`abort`,abortHandler),errorHandler!==void 0&&o.removeListener(`error`,errorHandler),r(e)},errorHandler;t!==`error`&&(errorHandler=e=>{o.removeListener(t,eventHandler),a&&a.removeEventListener(`abort`,abortHandler),i(e)},o.once(`error`,errorHandler)),o.once(t,eventHandler);let abortHandler=()=>{o.removeListener(t,eventHandler),errorHandler&&o.removeListener(`error`,errorHandler),i(createAbortError$2(a))};a&&a.addEventListener(`abort`,abortHandler,{once:!0})})}static on(e,t,n){let r=n?.signal;if(r?.aborted)throw createAbortError$2(r);let i=n?.highWaterMark??2**53-1,a=n?.lowWaterMark??1;validateNumber(i,`highWaterMark`),validateNumber(a,`lowWaterMark`);let o=[],s=[],c=null,l=!1,u=!1,eventHandler=(...t)=>{if(s.length>0){let{resolve:e}=s.shift();e({value:t,done:!1})}else o.push(t),o.length>=i&&!u&&(u=!0,typeof e.pause==`function`&&e.pause())},errorHandler=e=>{if(c=e,s.length>0){let{reject:t}=s.shift();t(e)}d.return()},abortHandler=()=>{errorHandler(createAbortError$2(r))};e.on(t,eventHandler),t!==`error`&&e.on(`error`,errorHandler),r&&r.addEventListener(`abort`,abortHandler,{once:!0});let cleanup=()=>{e.removeListener(t,eventHandler),e.removeListener(`error`,errorHandler),r&&r.removeEventListener(`abort`,abortHandler),l=!0;for(let{resolve:e}of s)e({value:void 0,done:!0});s.length=0,o.length=0},d={next(){if(o.length>0){let t=o.shift();return u&&o.length<a&&(u=!1,typeof e.resume==`function`&&e.resume()),Promise.resolve({value:t,done:!1})}if(c){let e=Promise.reject(c);return c=null,e}return l?Promise.resolve({value:void 0,done:!0}):new Promise((e,t)=>{s.push({resolve:e,reject:t})})},return(){return cleanup(),Promise.resolve({value:void 0,done:!0})},throw(e){return l||(c=e,cleanup()),Promise.reject(e)},[Symbol.asyncIterator](){return this}};return d}static listenerCount(e,t){return e.listenerCount(t)}static getEventListeners(e,t){return typeof e.listeners==`function`?e.listeners(t):[]}static setMaxListeners(e,...t){if(validateNumber(e,`n`),e<0)throw RangeError(`The value of "n" is out of range.`);if(t.length===0)EventEmitter.defaultMaxListeners=e;else for(let n of t)typeof n.setMaxListeners==`function`&&n.setMaxListeners(e)}static getMaxListeners(e){return typeof e.getMaxListeners==`function`?e.getMaxListeners():EventEmitter.defaultMaxListeners}static addAbortListener(e,t){e.aborted&&Promise.resolve().then(()=>t());let handler=()=>t();return e.addEventListener(`abort`,handler,{once:!0}),{[Symbol.dispose](){e.removeEventListener(`abort`,handler)}}}},on.EventEmitter=on;for(let e of[`setMaxListeners`,`getMaxListeners`,`emit`,`addListener`,`on`,`prependListener`,`once`,`prependOnceListener`,`removeListener`,`off`,`removeAllListeners`,`listeners`,`rawListeners`,`listenerCount`,`eventNames`]){let t=on.prototype[e];typeof t==`function`&&Object.defineProperty(on.prototype,e,{enumerable:!0,configurable:!0,writable:!0,value:t})}Object.defineProperty(on.prototype,`_events`,{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(on.prototype,`_eventsCount`,{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(on.prototype,`_maxListeners`,{enumerable:!0,configurable:!0,writable:!0,value:void 0}),__name(createAbortError$2,`createAbortError`)}),cn=__exportAll$4({EventEmitter:()=>Y,addAbortListener:()=>vn,captureRejectionSymbol:()=>ln,default:()=>Y,defaultMaxListeners:()=>dn,errorMonitor:()=>un,getEventListeners:()=>gn,getMaxListeners:()=>pn,listenerCount:()=>_n,on:()=>hn,once:()=>mn,setMaxListeners:()=>fn}),Y,ln,un,dn,fn,pn,mn,hn,gn,_n,vn,yn=__esmMin(()=>{sn(),L(),Y=makeCallable(on),Y.EventEmitter=Y,ln=Y.captureRejectionSymbol,un=Y.errorMonitor,dn=Y.defaultMaxListeners,fn=Y.setMaxListeners,pn=Y.getMaxListeners,mn=Y.once,hn=Y.on,gn=Y.getEventListeners,_n=Y.listenerCount,vn=Y.addAbortListener}),bn=__exportAll$4({StringDecoder:()=>xn,default:()=>Sn});function normalizeAndValidateEncoding(e){return e&&checkEncoding(e),normalizeEncoding(e)}function utf8DecodeMaximalSubpart(e,t,n){let r=``,i=t;for(;i<n;){let t=e[i];if(t<=127){r+=String.fromCharCode(t),i++;continue}if(t>=194&&t<=223){i+1<n&&e[i+1]>=128&&e[i+1]<=191?(r+=String.fromCharCode((t&31)<<6|e[i+1]&63),i+=2):(r+=`�`,i++);continue}if(t>=224&&t<=239){let a,o;if(t===224?(a=160,o=191):t===237?(a=128,o=159):(a=128,o=191),i+1>=n){r+=`�`,i++;continue}let s=e[i+1];if(s<a||s>o){r+=`�`,i++;continue}if(i+2>=n){r+=`�`,i+=2;continue}let c=e[i+2];if(c<128||c>191){r+=`�`,i+=2;continue}let l=(t&15)<<12|(s&63)<<6|c&63;r+=String.fromCharCode(l),i+=3;continue}if(t>=240&&t<=244){let a,o;if(t===240?(a=144,o=191):t===244?(a=128,o=143):(a=128,o=191),i+1>=n){r+=`�`,i++;continue}let s=e[i+1];if(s<a||s>o){r+=`�`,i++;continue}if(i+2>=n){r+=`�`,i+=2;continue}let c=e[i+2];if(c<128||c>191){r+=`�`,i+=2;continue}if(i+3>=n){r+=`�`,i+=3;continue}let l=e[i+3];if(l<128||l>191){r+=`�`,i+=3;continue}let u=(t&7)<<18|(s&63)<<12|(c&63)<<6|l&63;r+=String.fromCharCode(55296+(u-65536>>10),56320+(u-65536&1023)),i+=4;continue}r+=`�`,i++}return r}function utf8CharLength(e){return e&128?e>=194&&e<=223?2:e>=224&&e<=239?3:e>=240&&e<=244?4:0:1}function isValidContinuation(e,t,n,r){if(n===1){if(t===3)return e===224?r>=160&&r<=191:e===237?r>=128&&r<=159:r>=128&&r<=191;if(t===4)return e===240?r>=144&&r<=191:e===244?r>=128&&r<=143:r>=128&&r<=191}return r>=128&&r<=191}function writeUtf8(e,t){let n=0,r=``;if(e._lastNeed>0){for(;n<t.length&&e._lastNeed>0;){let i=t[n],a=e._lastTotal-e._lastNeed;if(isValidContinuation(e._lastLeadByte,e._lastTotal,a,i))e._lastChar[a]=i,e._lastNeed--,n++;else{r+=`�`,e._lastNeed=0,e._lastTotal=0,e._lastLeadByte=0;break}}if(e._lastNeed===0&&e._lastTotal>0&&(r+=utf8DecodeMaximalSubpart(e._lastChar,0,e._lastTotal),e._lastTotal=0,e._lastLeadByte=0),e._lastNeed>0)return r}let i=t.length;for(let r=0;r<Math.min(4,t.length-n);r++){let a=t.length-1-r;if(a<n)break;let o=t[a];if((o&192)!=128){let n=utf8CharLength(o);if(n>0&&o>=128){let r=t.length-a;if(r<n){let s=!0;for(let e=1;e<r;e++)if(!isValidContinuation(o,n,e,t[a+e])){s=!1;break}if(s){i=a;for(let n=0;n<r;n++)e._lastChar[n]=t[a+n];e._lastNeed=n-r,e._lastTotal=n,e._lastLeadByte=o}}}break}}return i>n&&(r+=utf8DecodeMaximalSubpart(t,n,i)),r}function writeUtf16le(e,t){let n=``,r=0;if(e._lastNeed>0){let i=e._lastTotal-e._lastNeed,a=Math.min(e._lastNeed,t.length);for(let n=0;n<a;n++)e._lastChar[i+n]=t[n];if(e._lastNeed-=a,r=a,e._lastNeed>0)return``;let o=e._lastTotal,s=0;for(;s+1<o;){let i=e._lastChar[s]|e._lastChar[s+1]<<8;if(s+=2,i>=55296&&i<=56319){if(s+1<o){let t=e._lastChar[s]|e._lastChar[s+1]<<8;if(t>=56320&&t<=57343){n+=String.fromCharCode(i,t),s+=2;continue}}if(r+1<t.length){let e=t[r]|t[r+1]<<8;if(e>=56320&&e<=57343){n+=String.fromCharCode(i,e),r+=2;continue}}else if(r>=t.length)return e._lastChar[0]=e._lastChar[s-2],e._lastChar[1]=e._lastChar[s-1],e._lastNeed=2,e._lastTotal=4,n}n+=String.fromCharCode(i)}e._lastTotal=0}for(;r+1<t.length;){let i=t[r]|t[r+1]<<8;if(r+=2,i>=55296&&i<=56319)if(r+1<t.length){let e=t[r]|t[r+1]<<8;if(e>=56320&&e<=57343){n+=String.fromCharCode(i,e),r+=2;continue}}else if(r<t.length)return n+=String.fromCharCode(i),e._lastChar[0]=t[r],e._lastNeed=1,e._lastTotal=2,n;else return e._lastChar[0]=t[r-2],e._lastChar[1]=t[r-1],e._lastNeed=2,e._lastTotal=4,n;n+=String.fromCharCode(i)}return r<t.length&&(e._lastChar[0]=t[r],e._lastNeed=1,e._lastTotal=2),n}function writeBase64(e,t){let n=0;if(e._lastNeed>0){let r=Math.min(e._lastNeed,t.length);for(let n=0;n<r;n++)e._lastChar[e._lastTotal-e._lastNeed+n]=t[n],e._lastNeed--;if(n=r,e._lastNeed>0)return``}let r=t.length-n,i=r-r%3,a=``;e._lastTotal>0&&e._lastNeed===0&&(a+=base64Encode(e._lastChar.subarray(0,e._lastTotal)),e._lastTotal=0),i>0&&(a+=base64Encode(t.subarray(n,n+i)));let o=r-i;if(o>0){for(let r=0;r<o;r++)e._lastChar[r]=t[n+i+r];e._lastNeed=3-o,e._lastTotal=3}return a}function decodeAscii(e){let t=``;for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]&127);return t}function decodeLatin1(e){let t=``;for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return t}function decodeHex(e){let t=``;for(let n=0;n<e.length;n++)t+=e[n].toString(16).padStart(2,`0`);return t}var xn,Sn,Cn=__esmMin(()=>{J(),xn=function StringDecoder(e){this.encoding=normalizeAndValidateEncoding(e),this._lastNeed=0,this._lastTotal=0,this._lastLeadByte=0,this.encoding===`utf8`||this.encoding===`utf16le`?this._lastChar=new Uint8Array(4):this.encoding===`base64`?this._lastChar=new Uint8Array(3):this._lastChar=new Uint8Array},xn.prototype.write=function write(e){if(e.length===0)return``;switch(this.encoding){case`utf8`:return writeUtf8(this,e);case`utf16le`:return writeUtf16le(this,e);case`base64`:return writeBase64(this,e);case`ascii`:return decodeAscii(e);case`latin1`:return decodeLatin1(e);case`hex`:return decodeHex(e);default:return decodeAscii(e)}},xn.prototype.end=function end(e){let t=``;if(e&&e.length>0&&(t=this.write(e)),this.encoding===`utf8`&&this._lastNeed>0)t+=`�`,this._lastNeed=0,this._lastTotal=0;else if(this.encoding===`utf16le`&&this._lastNeed>0){let e=this._lastTotal-this._lastNeed;for(let n=0;n+1<e;n+=2)t+=String.fromCharCode(this._lastChar[n]|this._lastChar[n+1]<<8);this._lastNeed=0,this._lastTotal=0}else if(this.encoding===`base64`&&this._lastNeed>0){let e=this._lastChar.subarray(0,this._lastTotal-this._lastNeed);t+=base64Encode(e),this._lastNeed=0,this._lastTotal=0}return t},Sn={StringDecoder:xn}});I(),yn(),L(),Cn();const wn=new TextEncoder;var ProcessWriteStream=class extends Y{fd;writable=!0;_outGio=null;constructor(e){super(),this.fd=e;let t=getGioNamespace();if(t){let e=t.UnixOutputStream??t.OutputStream;if(e)try{this._outGio=e.new(this.fd,!1)}catch{}}}write(e){if(this._outGio)try{let t=typeof e==`string`?wn.encode(e):e;return this._outGio.write_all(t,null),!0}catch{}return this.fd===2?F.error(e):F.log(e),!0}get isTTY(){if(nn)return nn.Terminal.is_tty(this.fd);try{let e=getGjsGlobal().imports?.gi?.GLib;if(e)return!!e.log_writer_supports_color(this.fd)}catch{}return!1}get columns(){if(nn){let[e,,t]=nn.Terminal.get_size(this.fd);if(e&&t>0)return t}try{let e=getGjsGlobal().imports?.gi?.GLib;if(e){let t=parseInt(e.getenv(`COLUMNS`)??`0`,10);if(t>0)return t}}catch{}return 80}end(){}destroy(){}get rows(){if(nn){let[e,t]=nn.Terminal.get_size(this.fd);if(e&&t>0)return t}try{let e=getGjsGlobal().imports?.gi?.GLib;if(e){let t=parseInt(e.getenv(`LINES`)??`0`,10);if(t>0)return t}}catch{}return 24}},ProcessReadStream=class extends Y{fd;isRaw=!1;_gio=null;_stdinGio=null;_reading=!1;_flowing=!1;_sttyCleanupRegistered=!1;_mainLoopHeld=!1;_pendingRead=!1;_decoder=null;constructor(e){super(),this.fd=e,this._gio=getGioNamespace()}get isTTY(){return nn?nn.Terminal.is_tty(this.fd):!1}setRawMode(e){return nn&&nn.Terminal.set_raw_mode(this.fd,e)?(this.isRaw=e,this):(this._setRawModeViaStty(e),this.isRaw=e,this)}_setRawModeViaStty(e){try{let t=globalThis.imports?.gi,n=t?.Gio??t?.Gio;if(!n)return;let r=n.SubprocessFlags?.STDIN_INHERIT??2,i=e?[`stty`,`-icanon`,`-echo`,`-icrnl`,`min`,`1`,`time`,`0`]:[`stty`,`icanon`,`echo`,`icrnl`];if(new n.SubprocessLauncher({flags:r}).spawnv(i).wait(null),e&&!this._sttyCleanupRegistered){this._sttyCleanupRegistered=!0;let e=globalThis.process;e?.once&&typeof e.once==`function`&&e.once(`exit`,()=>this._setRawModeViaStty(!1))}}catch{}}setEncoding(e){return this._decoder=new xn(e),this}_pushData(e){if(this._decoder){let t=this._decoder.write(e);t.length>0&&this.emit(`data`,t)}else this.emit(`data`,e)}on(e,t){let n=e===`data`&&this.listenerCount(`data`)===0;return super.on(e,t),n&&e===`data`&&this.resume(),this}addListener(e,t){return this.on(e,t)}once(e,t){return super.once(e,t),this}removeListener(e,t){return super.removeListener(e,t),e===`data`&&this.listenerCount(`data`)===0&&this.pause(),this}off(e,t){return this.removeListener(e,t)}removeAllListeners(e){let t=e===void 0||e===`data`?this.listenerCount(`data`)>0:!1;return super.removeAllListeners(e),t&&this.listenerCount(`data`)===0&&this.pause(),this}resume(){return this._flowing=!0,this._gio&&this.fd===0&&!this._reading&&this._startReading(),this}pause(){if(this._flowing=!1,this._reading=!1,this._mainLoopHeld){this._mainLoopHeld=!1;let e=globalThis.imports?.gi,t=e?.GLib??e?.GLib;t?.idle_add?t.idle_add(300,()=>(this._mainLoopHeld||quitMainLoop(),!1)):quitMainLoop()}return this}read(){return null}_startReading(){if(!this._gio||this._reading)return;if(this._pendingRead){this._reading=!0,this._mainLoopHeld||(this._mainLoopHeld=!0,ensureMainLoop());return}if(this._reading=!0,this._mainLoopHeld||(this._mainLoopHeld=!0,ensureMainLoop()),!this._stdinGio){let e=this._gio.UnixInputStream??this._gio.InputStream;if(!e){this._reading=!1;return}try{this._stdinGio=e.new(this.fd,!1)}catch{this._reading=!1;return}}let loop=()=>{if(!this._reading){this._pendingRead=!1;return}this._pendingRead=!0,this._stdinGio.read_bytes_async(4096,0,null,(e,t)=>{this._pendingRead=!1;try{let n=e.read_bytes_finish(t)?.get_data?.()??null;if(n&&n.byteLength>0)this._pushData(Buffer.from(n));else if(n!==null&&n.byteLength===0){if(this._reading=!1,this._decoder){let e=this._decoder.end();e.length>0&&this.emit(`data`,e)}this.emit(`end`);return}}catch{this._reading=!1;return}this._reading&&loop()})};loop()}};I(),yn();const Tn=Date.now();var Process=class extends Y{platform;arch;env;argv;argv0;execPath;pid;ppid;version;versions;title;execArgv;config;exitCode;constructor(){super(),this.platform=detectPlatform(),this.arch=detectArch(),this.env=getEnvProxy(),this.argv=getArgv(),this.argv0=this.argv[0]||`gjs`,this.execPath=getExecPath(),this.execArgv=globalThis.process?.execArgv??[],this.config=globalThis.process?.config??{target_defaults:{},variables:{}},this.pid=getPid(),this.ppid=detectPpid();let e=detectVersionInfo();this.version=e.version,this.versions=e.versions,this.title=e.title}cwd(){return getCwd()}chdir(e){chdir(e)}kill(e,t){return killPid(e,t)}exit(e){return this.exitCode=e??this.exitCode??0,this.emit(`exit`,this.exitCode),exitProcess(this.exitCode)}nextTick(e,...t){typeof queueMicrotask==`function`?queueMicrotask(()=>e(...t)):Promise.resolve().then(()=>e(...t))}hrtime(e){return hrtime(e)}uptime(){return(Date.now()-Tn)/1e3}memoryUsage(){return memoryUsage()}cpuUsage(e){return cpuUsage(e)}stdout=new ProcessWriteStream(1);stderr=new ProcessWriteStream(2);stdin=new ProcessReadStream(0);abort(){this.exit(1)}umask(e){return 18}emitWarning(e,t){F.warn(typeof e==`string`?`(${t||`Warning`}): ${e}`:e.message)}};Process.prototype.hrtime.bigint=function(){return hrtimeBigint()};const X=new Process;if(nn)try{let e=new nn.ResizeWatcher;e.connect(`resized`,(e,t,n)=>{X.stdout.emit(`resize`),X.stderr.emit(`resize`)}),e.start()}catch{}X.platform,X.arch,X.env,X.argv,X.argv0,X.execPath,X.pid,X.ppid,X.version,X.versions,X.cwd.bind(X),X.chdir.bind(X),X.exit.bind(X),X.nextTick.bind(X),Object.assign(X.hrtime.bind(X),{bigint:hrtimeBigint}),X.uptime.bind(X),X.memoryUsage.bind(X),X.cpuUsage.bind(X),X.kill.bind(X),X.abort.bind(X),X.umask.bind(X),X.emitWarning.bind(X),X.execArgv,X.config,X.stdout,X.stderr,X.stdin,L(),typeof Promise.withResolvers!=`function`&&(Promise.withResolvers=function(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}),initErrorV8Methods(Error),`global`in globalThis||Object.defineProperty(globalThis,`global`,{value:globalThis,writable:!1,enumerable:!1,configurable:!0}),Object.defineProperty(globalThis,`process`,{value:X,enumerable:!1,writable:!0,configurable:!0}),L(),typeof globalThis.structuredClone!=`function`&&Object.defineProperty(globalThis,`structuredClone`,{value:structuredClone$1,enumerable:!0,writable:!0,configurable:!0});function getGLib(){return globalThis.imports?.gi?.GLib}const En=getGLib()!==void 0;var GjsifyTimeout=class{_id=null;_refed=!0;_callback;_delay;_args;_repeat;constructor(e,t,n,r){this._callback=e,this._delay=t,this._args=n,this._repeat=r,this._schedule()}_schedule(){let e=getGLib();if(!e)return;let t=e.timeout_add.bind(e);this._id=t(e.PRIORITY_DEFAULT,this._delay,()=>{try{this._callback.apply(globalThis,this._args)}catch(e){setTimeout(()=>{throw e},0)}return this._repeat?e.SOURCE_CONTINUE:(this._id=null,e.SOURCE_REMOVE)})}ref(){return this._refed=!0,this}unref(){return this._refed=!1,this}hasRef(){return this._refed}refresh(){return this._cancel(),this._schedule(),this}_cancel(){if(this._id!==null){try{getGLib()?.Source.remove(this._id)}catch{}this._id=null}}[Symbol.toPrimitive](){return this._id}[Symbol.dispose](){this._cancel()}};function removeById(e){if(e instanceof GjsifyTimeout)e._cancel();else if(typeof e==`number`)try{getGLib()?.Source.remove(e)}catch{}}if(En){let setT=(e,t=0,...n)=>new GjsifyTimeout(e,Math.max(0,t|0),n,!1),setI=(e,t=0,...n)=>new GjsifyTimeout(e,Math.max(0,t|0),n,!0),e=globalThis;e.setTimeout=setT,e.clearTimeout=removeById,e.setInterval=setI,e.clearInterval=removeById}function setImmediate$1(e,...t){return setTimeout(e,0,...t)}__name(setImmediate$1,`setImmediate`);function clearImmediate(e){clearTimeout(e)}`setImmediate`in globalThis||Object.defineProperty(globalThis,`setImmediate`,{value:setImmediate$1,enumerable:!0,writable:!0,configurable:!0}),`clearImmediate`in globalThis||Object.defineProperty(globalThis,`clearImmediate`,{value:clearImmediate,enumerable:!0,writable:!0,configurable:!0});var Dn=__exportAll$4({URL:()=>Z,URLSearchParams:()=>kn,default:()=>An,domainToASCII:()=>domainToASCII,domainToUnicode:()=>domainToUnicode,fileURLToPath:()=>fileURLToPath,format:()=>format$3,parse:()=>parse$3,pathToFileURL:()=>pathToFileURL,resolve:()=>resolve$2});function decodeComponent(e){try{return decodeURIComponent(e.replace(/\+/g,` `))}catch{return e}}function encodeComponent(e){return encodeURIComponent(e).replace(/%20/g,`+`)}function parse$3(e,t,n){if(typeof e!=`string`)throw TypeError(`The "url" argument must be of type string. Received type `+typeof e);let r={protocol:null,slashes:null,auth:null,host:null,port:null,hostname:null,hash:null,search:null,query:null,pathname:null,path:null,href:e},i=e.trim(),a=i.indexOf(`#`);a!==-1&&(r.hash=i.slice(a),i=i.slice(0,a));let o=i.indexOf(`?`);o!==-1&&(r.search=i.slice(o),r.query=t?Object.fromEntries(new kn(i.slice(o+1))):i.slice(o+1),i=i.slice(0,o));let s=/^([a-z][a-z0-9.+-]*:)/i.exec(i);if(s&&(r.protocol=s[1].toLowerCase(),i=i.slice(r.protocol.length)),(n||r.protocol)&&i.startsWith(`//`)&&(r.slashes=!0,i=i.slice(2)),r.slashes||r.protocol&&![`javascript:`,`data:`,`mailto:`].includes(r.protocol)){let e=-1;for(let t=0;t<i.length;t++){let n=i[t];if(n===`/`||n===`\\`){e=t;break}}let t=e===-1?i:i.slice(0,e);i=e===-1?``:i.slice(e);let n=t.lastIndexOf(`@`);n===-1?parseHostPort(t,r):(r.auth=decodeURIComponent(t.slice(0,n)),parseHostPort(t.slice(n+1),r))}return r.pathname=i||(r.slashes?`/`:null),(r.pathname!==null||r.search!==null)&&(r.path=(r.pathname||``)+(r.search||``)),r.href=format$3(r),r}function parseHostPort(e,t){if(!e)return;let n=e.indexOf(`[`);if(n!==-1){let r=e.indexOf(`]`,n);if(r!==-1){let i=e.slice(r+1);i.startsWith(`:`)&&(t.port=i.slice(1)),t.hostname=e.slice(n,r+1),t.host=t.hostname+(t.port?`:`+t.port:``);return}}let r=e.lastIndexOf(`:`);if(r!==-1){let n=e.slice(r+1);/^\d*$/.test(n)?(t.port=n||null,t.hostname=e.slice(0,r).toLowerCase()):t.hostname=e.toLowerCase()}else t.hostname=e.toLowerCase();t.host=t.hostname+(t.port?`:`+t.port:``)}function format$3(e){if(typeof e==`string`)return e;if(e instanceof Z)return e.href;let t=e,n=``;if(t.protocol&&(n+=t.protocol),(t.slashes||t.protocol&&![`javascript:`,`data:`,`mailto:`].includes(t.protocol||``))&&(n+=`//`),t.auth&&(n+=encodeURIComponent(t.auth)+`@`),t.host?n+=t.host:(t.hostname&&(n+=t.hostname),t.port&&(n+=`:`+t.port)),t.pathname&&(n+=t.pathname),t.search)n+=t.search;else if(t.query&&typeof t.query==`object`){let e=new kn(t.query).toString();e&&(n+=`?`+e)}return t.hash&&(n+=t.hash),n}function resolve$2(e,t){return new Z(t,new Z(e,`resolve://`)).href.replace(/^resolve:\/\//,``)}function fileURLToPath(e){if(typeof e==`string`&&(e=new Z(e)),!(e instanceof Z))throw TypeError(`The "url" argument must be of type string or URL. Received type `+typeof e);if(e.protocol!==`file:`)throw TypeError(`The URL must be of scheme file`);if(e.hostname!==``&&e.hostname!==`localhost`)throw TypeError(`File URL host must be "localhost" or empty on linux`);let t=e.pathname;for(let e=0;e<t.length;e++)if(t[e]===`%`){let n=t.codePointAt(e+2)|32;if(t[e+1]===`2`&&n===102)throw TypeError(`File URL path must not include encoded / characters`)}return decodeURIComponent(t)}function pathToFileURL(e){let t=e;if(e[0]!==`/`)if(typeof globalThis.process?.cwd==`function`)t=globalThis.process.cwd()+`/`+e;else try{k?.get_current_dir&&(t=k.get_current_dir()+`/`+e)}catch{}return new Z(`file://`+encodePathForURL(t))}function encodePathForURL(e){let t=``;for(let n=0;n<e.length;n++){let r=e[n];r>=`a`&&r<=`z`||r>=`A`&&r<=`Z`||r>=`0`&&r<=`9`||r===`/`||r===`-`||r===`_`||r===`.`||r===`~`||r===`:`||r===`@`||r===`!`?t+=r:t+=encodeURIComponent(r)}return t}function domainToASCII(e){try{return new Z(`http://${e}`).hostname}catch{return``}}function domainToUnicode(e){try{return new Z(`http://${e}`).hostname}catch{return``}}var On,kn,Z,An,jn=__esmMin(()=>{A(),On=k.UriFlags.HAS_PASSWORD|k.UriFlags.ENCODED|k.UriFlags.SCHEME_NORMALIZE,kn=class URLSearchParams{_entries=[];constructor(e){if(e)if(typeof e==`string`){let t=e.startsWith(`?`)?e.slice(1):e;if(t)for(let e of t.split(`&`)){let t=e.indexOf(`=`);t===-1?this._entries.push([decodeComponent(e),``]):this._entries.push([decodeComponent(e.slice(0,t)),decodeComponent(e.slice(t+1))])}}else if(Array.isArray(e))for(let[t,n]of e)this._entries.push([String(t),String(n)]);else if(e instanceof URLSearchParams)this._entries=e._entries.map(([e,t])=>[e,t]);else for(let t of Object.keys(e))this._entries.push([t,String(e[t])])}get(e){for(let[t,n]of this._entries)if(t===e)return n;return null}getAll(e){return this._entries.filter(([t])=>t===e).map(([,e])=>e)}set(e,t){let n=!1;if(this._entries=this._entries.filter(([t])=>t===e?n?!1:(n=!0,!0):!0),n){for(let n=0;n<this._entries.length;n++)if(this._entries[n][0]===e){this._entries[n][1]=t;break}}else this._entries.push([e,t])}has(e){return this._entries.some(([t])=>t===e)}delete(e){this._entries=this._entries.filter(([t])=>t!==e)}append(e,t){this._entries.push([e,t])}sort(){this._entries.sort((e,t)=>e[0]<t[0]?-1:+(e[0]>t[0]))}toString(){return this._entries.map(([e,t])=>encodeComponent(e)+`=`+encodeComponent(t)).join(`&`)}forEach(e){for(let[t,n]of this._entries)e(n,t,this)}*entries(){yield*this._entries}*keys(){for(let[e]of this._entries)yield e}*values(){for(let[,e]of this._entries)yield e}[Symbol.iterator](){return this.entries()}get size(){return this._entries.length}},Z=class URL{#e;#t;constructor(e,t){let n=e instanceof URL?e.href:String(e);try{if(t!==void 0){let e=t instanceof URL?t.href:String(t),r=k.Uri.parse(e,On);this.#e=r.parse_relative(n,On)}else this.#e=k.Uri.parse(n,On)}catch{throw TypeError(`Invalid URL: ${n}`)}if(!this.#e)throw TypeError(`Invalid URL: ${n}`);this.#t=new kn(this.#e.get_query()||``)}get protocol(){return this.#e.get_scheme()+`:`}get hostname(){return(this.#e.get_host()||``).toLowerCase()}get port(){let e=this.#e.get_port();if(e===-1)return``;let t=this.#e.get_scheme();return(t===`http`||t===`ws`)&&e===80||(t===`https`||t===`wss`)&&e===443||t===`ftp`&&e===21?``:String(e)}get host(){let e=this.hostname,t=this.port;return t?`${e}:${t}`:e}get pathname(){return this.#e.get_path()||`/`}get search(){let e=this.#e.get_query();return e?`?`+e:``}get hash(){let e=this.#e.get_fragment();return e?`#`+e:``}get origin(){let e=this.protocol;return e===`http:`||e===`https:`||e===`ftp:`?`${e}//${this.host}`:`null`}get username(){return this.#e.get_user()||``}get password(){return this.#e.get_password()||``}get href(){let e=this.protocol,t=this.#e.get_scheme();(t===`http`||t===`https`||t===`ftp`||t===`file`||t===`ws`||t===`wss`||this.hostname)&&(e+=`//`);let n=this.username,r=this.password;n&&(e+=n,r&&(e+=`:`+r),e+=`@`),e+=this.hostname,this.port&&(e+=`:`+this.port);let i=this.pathname;return e+=i,e+=this.search,e+=this.hash,e}get searchParams(){return this.#t}toString(){return this.href}toJSON(){return this.href}static _objectURLPaths=new Map;static _objectURLCounter=0;static createObjectURL(e){let t=e?._tmpPath;if(typeof t==`string`&&t.length>0){let e=`file://${t}`;return URL._objectURLPaths.set(e,t),e}return`file:///dev/null`}static revokeObjectURL(e){let t=URL._objectURLPaths.get(e);if(t){try{k.unlink(t)}catch{}URL._objectURLPaths.delete(e)}}},__name(parse$3,`parse`),__name(format$3,`format`),__name(resolve$2,`resolve`),An={URL:Z,URLSearchParams:kn,parse:parse$3,format:format$3,resolve:resolve$2,fileURLToPath,pathToFileURL,domainToASCII,domainToUnicode}});jn(),typeof globalThis.URL!=`function`&&Object.defineProperty(globalThis,`URL`,{value:Z,enumerable:!1,writable:!0,configurable:!0}),typeof globalThis.URLSearchParams!=`function`&&Object.defineProperty(globalThis,`URLSearchParams`,{value:kn,enumerable:!1,writable:!0,configurable:!0});let Mn;if(globalThis.performance)Mn=globalThis.performance;else{let e,_now;try{let t=globalThis.imports?.gi?.GLib;if(!t)throw Error(`GJS imports.gi.GLib not available`);e=t.get_monotonic_time(),_now=()=>(t.get_monotonic_time()-e)/1e3}catch{let t=Date.now();e=0,_now=()=>Date.now()-t}let t=[],n=Date.now()-_now();Mn={timeOrigin:n,now:_now,mark(e){let n={name:e,entryType:`mark`,startTime:_now(),duration:0};return t.push(n),n},measure(e,n,r){let i=0,a=_now();if(n){let e=t.find(e=>e.entryType===`mark`&&e.name===n);e&&(i=e.startTime)}if(r){let e=t.find(e=>e.entryType===`mark`&&e.name===r);e&&(a=e.startTime)}let o={name:e,entryType:`measure`,startTime:i,duration:a-i};return t.push(o),o},getEntries(){return[...t]},getEntriesByName(e){return t.filter(t=>t.name===e)},getEntriesByType(e){return t.filter(t=>t.entryType===e)},clearMarks(e){for(let n=t.length-1;n>=0;n--)t[n].entryType===`mark`&&(!e||t[n].name===e)&&t.splice(n,1)},clearMeasures(e){for(let n=t.length-1;n>=0;n--)t[n].entryType===`measure`&&(!e||t[n].name===e)&&t.splice(n,1)},clearResourceTimings(){},setResourceTimingBufferSize(){},toJSON(){return{timeOrigin:n}}}}var PerformanceObserverStub=class{_callback;constructor(e){this._callback=e}observe(e){}disconnect(){}takeRecords(){return[]}};const Nn=globalThis,Pn=Nn.PerformanceObserver||PerformanceObserverStub;Nn.PerformanceEntry,Nn.PerformanceObserverEntryList,Nn.PerformanceMark,Nn.PerformanceMeasure;const Fn=globalThis;globalThis.performance===void 0&&(Fn.performance=Mn),typeof Fn.PerformanceObserver!=`function`&&(Fn.PerformanceObserver=Pn);const In=Symbol(`abort`),Ln=Symbol(`internal`);var Rn=class AbortSignal extends EventTarget{#e=!1;reason=void 0;onabort=null;constructor(e){if(super(),e!==Ln)throw TypeError(`Illegal constructor.`)}get aborted(){if(!(this instanceof AbortSignal))throw TypeError(`'get aborted' called on an object that is not a valid instance of AbortSignal.`);return this.#e}get[Symbol.toStringTag](){return`AbortSignal`}throwIfAborted(){if(this.#e)throw this.reason}[In](e){if(this.#e)return;this.#e=!0,this.reason=e??new Be(`The operation was aborted.`,`AbortError`);let t=new Event(`abort`);typeof this.onabort==`function`&&this.onabort.call(this,t),this.dispatchEvent(t)}static abort(e){let t=new AbortSignal(Ln);return t[In](e),t}static timeout(e){let t=new AbortSignal(Ln);return setTimeout(()=>{t[In](new Be(`The operation timed out.`,`TimeoutError`))},e),t}static any(e){let t=new AbortSignal(Ln);for(let n of e)if(n.aborted)return t[In](n.reason),t;let onAbort=()=>{if(!t.aborted){let n=e.find(e=>e.aborted);t[In](n?.reason)}};for(let t of e)t.addEventListener(`abort`,onAbort,{once:!0});return t}},zn=class AbortController{signal;constructor(){this.signal=new Rn(Ln)}abort(e){if(!(this instanceof AbortController))throw TypeError(`'abort' called on an object that is not a valid instance of AbortController.`);this.signal[In](e)}};const Bn=globalThis;globalThis.AbortController===void 0&&(Bn.AbortController=zn),globalThis.AbortSignal===void 0&&(Bn.AbortSignal=Rn);const Q=Symbol(`kState`),$=Symbol(`kType`);function isBrandCheck(e){return t=>typeof t==`object`&&!!t&&t[Q]!==void 0&&t[$]===e}function dequeueValue(e){let t=e[Q].queue.shift();if(t===void 0)throw Error(`dequeueValue called on an empty queue`);let{value:n,size:r}=t;return e[Q].queueTotalSize=Math.max(0,e[Q].queueTotalSize-r),n}function resetQueue(e){e[Q].queue=[],e[Q].queueTotalSize=0}function peekQueueValue(e){return e[Q].queue[0].value}function enqueueValueWithSize(e,t,n){if(n=+n,typeof n!=`number`||n<0||Number.isNaN(n)||n===1/0)throw RangeError(`Invalid size: ${n}`);e[Q].queue.push({value:t,size:n}),e[Q].queueTotalSize+=n}function extractHighWaterMark(e,t){if(e===void 0)return t;if(e=+e,typeof e!=`number`||Number.isNaN(e)||e<0)throw RangeError(`Invalid highWaterMark: ${e}`);return e}function extractSizeAlgorithm(e){if(e===void 0)return()=>1;if(typeof e!=`function`)throw TypeError(`strategy.size must be a function`);return e}function transferArrayBuffer(e){return typeof ArrayBuffer.prototype.transfer==`function`?e.transfer():e.slice(0)}function isDetachedBuffer(e){if(typeof SharedArrayBuffer<`u`&&e instanceof SharedArrayBuffer||e.byteLength!==0)return!1;try{return e.slice(0,0),!1}catch{return!0}}function typedArrayConstructorByTag(e){switch(e){case`Int8Array`:return Int8Array;case`Uint8Array`:return Uint8Array;case`Uint8ClampedArray`:return Uint8ClampedArray;case`Int16Array`:return Int16Array;case`Uint16Array`:return Uint16Array;case`Int32Array`:return Int32Array;case`Uint32Array`:return Uint32Array;case`Float32Array`:return Float32Array;case`Float64Array`:return Float64Array;case`BigInt64Array`:return typeof BigInt64Array<`u`?BigInt64Array:void 0;case`BigUint64Array`:return typeof BigUint64Array<`u`?BigUint64Array:void 0;default:return}}function elementSizeByTag(e){switch(e){case`Int8Array`:case`Uint8Array`:case`Uint8ClampedArray`:return 1;case`Int16Array`:case`Uint16Array`:return 2;case`Int32Array`:case`Uint32Array`:case`Float32Array`:return 4;case`Float64Array`:case`BigInt64Array`:case`BigUint64Array`:return 8;default:return 1}}function setPromiseHandled(e){e.then(()=>{},()=>{})}function createPromiseCallback(e,t,n){if(typeof t!=`function`)throw TypeError(`${e} must be a function`);return async(...e)=>t.call(n,...e)}async function nonOpFlush(){}function nonOpStart(){}async function nonOpPull(){}async function nonOpCancel(){}async function nonOpWrite(){}const Vn={__proto__:Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype),next:void 0,return:void 0};function createAsyncFromSyncIterator(e){let t={[Symbol.iterator]:()=>e.iterator},n=(async function*(){return yield*t})();return{iterator:n,nextMethod:n.next,done:!1}}function getIterator(e,t=`sync`,n){if(n===void 0)if(t===`async`){if(n=e[Symbol.asyncIterator],n==null){let t=e[Symbol.iterator];if(t===void 0)throw TypeError(`Object is not iterable`);return createAsyncFromSyncIterator(getIterator(e,`sync`,t))}}else n=e[Symbol.iterator];if(n===void 0)throw TypeError(`Object is not iterable`);let r=n.call(e);if(typeof r!=`object`||!r)throw TypeError(`The iterator method must return an object`);return{iterator:r,nextMethod:r.next,done:!1}}function iteratorNext(e,t){let n;if(n=t===void 0?e.nextMethod.call(e.iterator):e.nextMethod.call(e.iterator,t),typeof n!=`object`||!n)throw TypeError(`The iterator.next() method must return an object`);return n}const Hn=typeof globalThis.AbortController==`function`?globalThis.AbortController:class AbortControllerShim{signal={aborted:!1,reason:void 0,addEventListener(){},removeEventListener(){}};abort(e){this.signal.aborted=!0,this.signal.reason=e}},Un=Symbol(`kAbort`),Wn=Symbol(`kCloseSentinel`),Gn=Symbol(`kError`),Kn=Symbol(`kSkipThrow`);var WritableStream=class{[$]=`WritableStream`;[Q];constructor(e={},t={}){if(e!=null&&typeof e!=`object`)throw TypeError(`sink must be an object`);if(t!=null&&typeof t!=`object`)throw TypeError(`strategy must be an object`);let n=e?.type;if(n!==void 0)throw RangeError(`Invalid type: ${n}`);this[Q]=createWritableStreamState();let r=extractSizeAlgorithm(t?.size),i=extractHighWaterMark(t?.highWaterMark,1);setupWritableStreamDefaultControllerFromSink(this,e,i,r)}get locked(){if(!qn(this))throw TypeError(`Invalid this`);return isWritableStreamLocked(this)}abort(e){return qn(this)?isWritableStreamLocked(this)?Promise.reject(TypeError(`WritableStream is locked`)):writableStreamAbort(this,e):Promise.reject(TypeError(`Invalid this`))}close(){return qn(this)?isWritableStreamLocked(this)?Promise.reject(TypeError(`WritableStream is locked`)):writableStreamCloseQueuedOrInFlight(this)?Promise.reject(TypeError(`Failure closing WritableStream`)):writableStreamClose(this):Promise.reject(TypeError(`Invalid this`))}getWriter(){if(!qn(this))throw TypeError(`Invalid this`);return new WritableStreamDefaultWriter(this)}get[Symbol.toStringTag](){return`WritableStream`}},WritableStreamDefaultWriter=class{[$]=`WritableStreamDefaultWriter`;[Q];constructor(e){if(!qn(e))throw TypeError(`Expected a WritableStream`);this[Q]={stream:void 0,close:{promise:void 0,resolve:void 0,reject:void 0},ready:{promise:void 0,resolve:void 0,reject:void 0}},setupWritableStreamDefaultWriter(this,e)}get closed(){return Jn(this)?this[Q].close.promise:Promise.reject(TypeError(`Invalid this`))}get desiredSize(){if(!Jn(this))throw TypeError(`Invalid this`);if(this[Q].stream===void 0)throw TypeError(`Writer is not bound to a WritableStream`);return writableStreamDefaultWriterGetDesiredSize(this)}get ready(){return Jn(this)?this[Q].ready.promise:Promise.reject(TypeError(`Invalid this`))}abort(e){return Jn(this)?this[Q].stream===void 0?Promise.reject(TypeError(`Writer is not bound to a WritableStream`)):writableStreamDefaultWriterAbort(this,e):Promise.reject(TypeError(`Invalid this`))}close(){if(!Jn(this))return Promise.reject(TypeError(`Invalid this`));let{stream:e}=this[Q];return e===void 0?Promise.reject(TypeError(`Writer is not bound to a WritableStream`)):writableStreamCloseQueuedOrInFlight(e)?Promise.reject(TypeError(`Failure to close WritableStream`)):writableStreamDefaultWriterClose(this)}releaseLock(){if(!Jn(this))throw TypeError(`Invalid this`);let{stream:e}=this[Q];e!==void 0&&writableStreamDefaultWriterRelease(this)}write(e){return Jn(this)?this[Q].stream===void 0?Promise.reject(TypeError(`Writer is not bound to a WritableStream`)):writableStreamDefaultWriterWrite(this,e):Promise.reject(TypeError(`Invalid this`))}get[Symbol.toStringTag](){return`WritableStreamDefaultWriter`}},WritableStreamDefaultController=class{[$]=`WritableStreamDefaultController`;[Q];constructor(e){if(e!==Kn)throw TypeError(`Illegal constructor`)}[Un](e){let t=this[Q].abortAlgorithm(e);return writableStreamDefaultControllerClearAlgorithms(this),t}[Gn](){resetQueue(this)}get signal(){if(!Yn(this))throw TypeError(`Invalid this`);return this[Q].abortController.signal}error(e){if(!Yn(this))throw TypeError(`Invalid this`);this[Q].stream[Q].state===`writable`&&writableStreamDefaultControllerError(this,e)}get[Symbol.toStringTag](){return`WritableStreamDefaultController`}};const qn=isBrandCheck(`WritableStream`),Jn=isBrandCheck(`WritableStreamDefaultWriter`),Yn=isBrandCheck(`WritableStreamDefaultController`);function createEmptyPromiseRecord(){return{promise:void 0,resolve:void 0,reject:void 0}}function createWritableStreamState(){return{close:Promise.withResolvers(),closeRequest:createEmptyPromiseRecord(),inFlightWriteRequest:createEmptyPromiseRecord(),inFlightCloseRequest:createEmptyPromiseRecord(),pendingAbortRequest:{abort:createEmptyPromiseRecord(),reason:void 0,wasAlreadyErroring:!1},backpressure:!1,controller:void 0,state:`writable`,storedError:void 0,writeRequests:[],writer:void 0}}function isWritableStreamLocked(e){return e[Q].writer!==void 0}function setupWritableStreamDefaultWriter(e,t){if(isWritableStreamLocked(t))throw TypeError(`WritableStream is locked`);switch(e[Q].stream=t,t[Q].writer=e,t[Q].state){case`writable`:!writableStreamCloseQueuedOrInFlight(t)&&t[Q].backpressure?e[Q].ready=Promise.withResolvers():e[Q].ready={promise:Promise.resolve(),resolve:void 0,reject:void 0},e[Q].close=Promise.withResolvers();break;case`erroring`:e[Q].ready={promise:Promise.reject(t[Q].storedError),resolve:void 0,reject:void 0},setPromiseHandled(e[Q].ready.promise),e[Q].close=Promise.withResolvers();break;case`closed`:e[Q].ready={promise:Promise.resolve(),resolve:void 0,reject:void 0},e[Q].close={promise:Promise.resolve(),resolve:void 0,reject:void 0};break;default:e[Q].ready={promise:Promise.reject(t[Q].storedError),resolve:void 0,reject:void 0},e[Q].close={promise:Promise.reject(t[Q].storedError),resolve:void 0,reject:void 0},setPromiseHandled(e[Q].ready.promise),setPromiseHandled(e[Q].close.promise)}}function writableStreamAbort(e,t){let{state:n,controller:r}=e[Q];if(n===`closed`||n===`errored`)return Promise.resolve();if(r[Q].abortController.abort(t),e[Q].pendingAbortRequest.abort.promise!==void 0)return e[Q].pendingAbortRequest.abort.promise;let i=!1;n===`erroring`&&(i=!0,t=void 0);let a=Promise.withResolvers();return e[Q].pendingAbortRequest={abort:a,reason:t,wasAlreadyErroring:i},i||writableStreamStartErroring(e,t),a.promise}function writableStreamClose(e){let{state:t,writer:n,backpressure:r,controller:i}=e[Q];if(t===`closed`||t===`errored`)return Promise.reject(TypeError(`WritableStream is closed`));e[Q].closeRequest=Promise.withResolvers();let{promise:a}=e[Q].closeRequest;return n!==void 0&&r&&t===`writable`&&n[Q].ready.resolve?.(),writableStreamDefaultControllerClose(i),a}function writableStreamUpdateBackpressure(e,t){let{writer:n}=e[Q];n!==void 0&&e[Q].backpressure!==t&&(t?n[Q].ready=Promise.withResolvers():n[Q].ready.resolve?.()),e[Q].backpressure=t}function writableStreamStartErroring(e,t){let{controller:n,writer:r}=e[Q];e[Q].state=`erroring`,e[Q].storedError=t,r!==void 0&&writableStreamDefaultWriterEnsureReadyPromiseRejected(r,t),!writableStreamHasOperationMarkedInFlight(e)&&n[Q].started&&writableStreamFinishErroring(e)}function writableStreamRejectCloseAndClosedPromiseIfNeeded(e){e[Q].closeRequest.promise!==void 0&&(e[Q].closeRequest.reject?.(e[Q].storedError),e[Q].closeRequest={promise:void 0,resolve:void 0,reject:void 0}),setPromiseHandled(e[Q].close.promise),e[Q].close.reject?.(e[Q].storedError);let{writer:t}=e[Q];t!==void 0&&(setPromiseHandled(t[Q].close.promise),t[Q].close.reject?.(e[Q].storedError))}function writableStreamMarkFirstWriteRequestInFlight(e){let t=e[Q].writeRequests.shift();e[Q].inFlightWriteRequest=t}function writableStreamMarkCloseRequestInFlight(e){e[Q].inFlightCloseRequest=e[Q].closeRequest,e[Q].closeRequest={promise:void 0,resolve:void 0,reject:void 0}}function writableStreamHasOperationMarkedInFlight(e){return e[Q].inFlightWriteRequest.promise!==void 0||e[Q].inFlightCloseRequest.promise!==void 0}function writableStreamFinishInFlightWriteWithError(e,t){e[Q].inFlightWriteRequest.reject?.(t),e[Q].inFlightWriteRequest={promise:void 0,resolve:void 0,reject:void 0},writableStreamDealWithRejection(e,t)}function writableStreamFinishInFlightWrite(e){e[Q].inFlightWriteRequest.resolve?.(),e[Q].inFlightWriteRequest={promise:void 0,resolve:void 0,reject:void 0}}function writableStreamFinishInFlightCloseWithError(e,t){e[Q].inFlightCloseRequest.reject?.(t),e[Q].inFlightCloseRequest={promise:void 0,resolve:void 0,reject:void 0},e[Q].pendingAbortRequest.abort.promise!==void 0&&(e[Q].pendingAbortRequest.abort.reject?.(t),e[Q].pendingAbortRequest={abort:{promise:void 0,resolve:void 0,reject:void 0},reason:void 0,wasAlreadyErroring:!1}),writableStreamDealWithRejection(e,t)}function writableStreamFinishInFlightClose(e){e[Q].inFlightCloseRequest.resolve?.(),e[Q].inFlightCloseRequest={promise:void 0,resolve:void 0,reject:void 0},e[Q].state===`erroring`&&(e[Q].storedError=void 0,e[Q].pendingAbortRequest.abort.promise!==void 0&&(e[Q].pendingAbortRequest.abort.resolve?.(),e[Q].pendingAbortRequest={abort:{promise:void 0,resolve:void 0,reject:void 0},reason:void 0,wasAlreadyErroring:!1})),e[Q].state=`closed`,e[Q].writer!==void 0&&e[Q].writer[Q].close.resolve?.(),e[Q].close.resolve?.()}function writableStreamFinishErroring(e){e[Q].state=`errored`,e[Q].controller[Gn]();let t=e[Q].storedError;for(let n of e[Q].writeRequests)n.reject?.(t);if(e[Q].writeRequests=[],e[Q].pendingAbortRequest.abort.promise===void 0){writableStreamRejectCloseAndClosedPromiseIfNeeded(e);return}let n=e[Q].pendingAbortRequest;if(e[Q].pendingAbortRequest={abort:{promise:void 0,resolve:void 0,reject:void 0},reason:void 0,wasAlreadyErroring:!1},n.wasAlreadyErroring){n.abort.reject?.(t),writableStreamRejectCloseAndClosedPromiseIfNeeded(e);return}e[Q].controller[Un](n.reason).then(()=>{n.abort.resolve?.(),writableStreamRejectCloseAndClosedPromiseIfNeeded(e)},t=>{n.abort.reject?.(t),writableStreamRejectCloseAndClosedPromiseIfNeeded(e)})}function writableStreamDealWithRejection(e,t){if(e[Q].state===`writable`){writableStreamStartErroring(e,t);return}writableStreamFinishErroring(e)}function writableStreamCloseQueuedOrInFlight(e){return e[Q].closeRequest.promise!==void 0||e[Q].inFlightCloseRequest.promise!==void 0}function writableStreamAddWriteRequest(e){let{promise:t,resolve:n,reject:r}=Promise.withResolvers();return e[Q].writeRequests.push({promise:t,resolve:n,reject:r}),t}function writableStreamDefaultWriterWrite(e,t){let{stream:n}=e[Q],{controller:r}=n[Q],i=writableStreamDefaultControllerGetChunkSize(r,t);if(n!==e[Q].stream)return Promise.reject(TypeError(`Mismatched WritableStreams`));let{state:a}=n[Q];if(a===`errored`)return Promise.reject(n[Q].storedError);if(writableStreamCloseQueuedOrInFlight(n)||a===`closed`)return Promise.reject(TypeError(`WritableStream is closed`));if(a===`erroring`)return Promise.reject(n[Q].storedError);let o=writableStreamAddWriteRequest(n);return writableStreamDefaultControllerWrite(r,t,i),o}function writableStreamDefaultWriterRelease(e){let{stream:t}=e[Q],n=TypeError(`Writer has been released`);writableStreamDefaultWriterEnsureReadyPromiseRejected(e,n),writableStreamDefaultWriterEnsureClosedPromiseRejected(e,n),t[Q].writer=void 0,e[Q].stream=void 0}function writableStreamDefaultWriterGetDesiredSize(e){let{stream:t}=e[Q];switch(t[Q].state){case`errored`:case`erroring`:return null;case`closed`:return 0}return writableStreamDefaultControllerGetDesiredSize(t[Q].controller)}function writableStreamDefaultWriterEnsureReadyPromiseRejected(e,t){e[Q].ready.reject?(e[Q].ready.reject(t),e[Q].ready.resolve=void 0,e[Q].ready.reject=void 0):e[Q].ready={promise:Promise.reject(t),resolve:void 0,reject:void 0},setPromiseHandled(e[Q].ready.promise)}function writableStreamDefaultWriterEnsureClosedPromiseRejected(e,t){e[Q].close.reject?(e[Q].close.reject(t),e[Q].close.resolve=void 0,e[Q].close.reject=void 0):e[Q].close={promise:Promise.reject(t),resolve:void 0,reject:void 0},setPromiseHandled(e[Q].close.promise)}function writableStreamDefaultWriterCloseWithErrorPropagation(e){let{stream:t}=e[Q],{state:n}=t[Q];return writableStreamCloseQueuedOrInFlight(t)||n===`closed`?Promise.resolve():n===`errored`?Promise.reject(t[Q].storedError):writableStreamDefaultWriterClose(e)}function writableStreamDefaultWriterClose(e){return writableStreamClose(e[Q].stream)}function writableStreamDefaultWriterAbort(e,t){return writableStreamAbort(e[Q].stream,t)}function writableStreamDefaultControllerWrite(e,t,n){try{enqueueValueWithSize(e,t,n)}catch(t){writableStreamDefaultControllerErrorIfNeeded(e,t);return}let{stream:r}=e[Q];!writableStreamCloseQueuedOrInFlight(r)&&r[Q].state===`writable`&&writableStreamUpdateBackpressure(r,writableStreamDefaultControllerGetBackpressure(e)),writableStreamDefaultControllerAdvanceQueueIfNeeded(e)}function writableStreamDefaultControllerProcessWrite(e,t){let{stream:n,writeAlgorithm:r}=e[Q];writableStreamMarkFirstWriteRequestInFlight(n),r(t,e).then(()=>{writableStreamFinishInFlightWrite(n);let{state:t}=n[Q];dequeueValue(e),!writableStreamCloseQueuedOrInFlight(n)&&t===`writable`&&writableStreamUpdateBackpressure(n,writableStreamDefaultControllerGetBackpressure(e)),writableStreamDefaultControllerAdvanceQueueIfNeeded(e)},t=>{n[Q].state===`writable`&&writableStreamDefaultControllerClearAlgorithms(e),writableStreamFinishInFlightWriteWithError(n,t)})}function writableStreamDefaultControllerProcessClose(e){let{closeAlgorithm:t,stream:n}=e[Q];writableStreamMarkCloseRequestInFlight(n),dequeueValue(e);let r=t();writableStreamDefaultControllerClearAlgorithms(e),r.then(()=>writableStreamFinishInFlightClose(n),e=>writableStreamFinishInFlightCloseWithError(n,e))}function writableStreamDefaultControllerGetDesiredSize(e){return e[Q].highWaterMark-e[Q].queueTotalSize}function writableStreamDefaultControllerGetChunkSize(e,t){let{sizeAlgorithm:n}=e[Q];if(n===void 0)return 1;try{return n(t)}catch(t){return writableStreamDefaultControllerErrorIfNeeded(e,t),1}}function writableStreamDefaultControllerErrorIfNeeded(e,t){e[Q].stream[Q].state===`writable`&&writableStreamDefaultControllerError(e,t)}function writableStreamDefaultControllerError(e,t){writableStreamDefaultControllerClearAlgorithms(e),writableStreamStartErroring(e[Q].stream,t)}function writableStreamDefaultControllerClose(e){enqueueValueWithSize(e,Wn,0),writableStreamDefaultControllerAdvanceQueueIfNeeded(e)}function writableStreamDefaultControllerClearAlgorithms(e){e[Q].writeAlgorithm=void 0,e[Q].closeAlgorithm=void 0,e[Q].abortAlgorithm=void 0,e[Q].sizeAlgorithm=void 0}function writableStreamDefaultControllerGetBackpressure(e){return writableStreamDefaultControllerGetDesiredSize(e)<=0}function writableStreamDefaultControllerAdvanceQueueIfNeeded(e){let{queue:t,started:n,stream:r}=e[Q];if(!n||r[Q].inFlightWriteRequest.promise!==void 0)return;if(r[Q].state===`erroring`){writableStreamFinishErroring(r);return}if(!t.length)return;let i=peekQueueValue(e);i===Wn?writableStreamDefaultControllerProcessClose(e):writableStreamDefaultControllerProcessWrite(e,i)}function setupWritableStreamDefaultControllerFromSink(e,t,n,r){let i=new WritableStreamDefaultController(Kn),a=t?.start,o=t?.write,s=t?.close,c=t?.abort;setupWritableStreamDefaultController(e,i,a?a.bind(t,i):nonOpStart,o?createPromiseCallback(`sink.write`,o,t):nonOpWrite,s?createPromiseCallback(`sink.close`,s,t):nonOpCancel,c?createPromiseCallback(`sink.abort`,c,t):nonOpCancel,n,r)}function setupWritableStreamDefaultController(e,t,n,r,i,a,o,s){t[Q]={abortAlgorithm:a,closeAlgorithm:i,highWaterMark:o,queue:[],queueTotalSize:0,abortController:new Hn,sizeAlgorithm:s,started:!1,stream:e,writeAlgorithm:r},e[Q].controller=t,writableStreamUpdateBackpressure(e,writableStreamDefaultControllerGetBackpressure(t));let c=n();new Promise(e=>e(c)).then(()=>{t[Q].started=!0,writableStreamDefaultControllerAdvanceQueueIfNeeded(t)},n=>{t[Q].started=!0,writableStreamDealWithRejection(e,n)})}function createWritableStream(e,t,n,r,i=1,a=()=>1){let o=Object.create(WritableStream.prototype);return o[$]=`WritableStream`,o[Q]=createWritableStreamState(),setupWritableStreamDefaultController(o,new WritableStreamDefaultController(Kn),e,t,n,r,i,a),o}L();const Xn=Symbol(`kCancel`),Zn=Symbol(`kClose`),Qn=Symbol(`kChunk`),$n=Symbol(`kError`),er=Symbol(`kPull`),tr=Symbol(`kRelease`),nr=Symbol(`kSkipThrow`);let rr,ir;function lazyReadableReleasedError(){return rr||(rr=TypeError(`Reader released`),rr)}function lazyReadableReleasingError(){return ir||(ir=TypeError(`Releasing reader`),ir)}function createAbortError$1(){if(typeof globalThis.DOMException==`function`)return new DOMException(`The operation was aborted`,`AbortError`);let e=Error(`The operation was aborted`);return e.name=`AbortError`,e}__name(createAbortError$1,`createAbortError`);function createReadableStreamState(){return{disturbed:!1,reader:void 0,state:`readable`,storedError:void 0,controller:void 0,closedPromise:Promise.withResolvers()}}var ReadableStream$1=class{static{__name(this,`ReadableStream`)}[$]=`ReadableStream`;[Q];constructor(e={},t={}){if(e!=null&&typeof e!=`object`)throw TypeError(`source must be an object`);if(t!=null&&typeof t!=`object`)throw TypeError(`strategy must be an object`);this[Q]=createReadableStreamState();let n=t?.size,r=t?.highWaterMark,i=e?.type;if(i!==void 0){if(`${i}`==`bytes`){if(n!==void 0)throw RangeError(`strategy.size must not be set for a byte stream`);setupReadableByteStreamControllerFromSource(this,e,extractHighWaterMark(r,0));return}throw RangeError(`Invalid type: ${i}`)}setupReadableStreamDefaultControllerFromSource(this,e,extractHighWaterMark(r,1),extractSizeAlgorithm(n))}get locked(){if(!ar(this))throw TypeError(`Invalid this`);return isReadableStreamLocked(this)}static from(e){return readableStreamFromIterable(e)}cancel(e=void 0){return ar(this)?isReadableStreamLocked(this)?Promise.reject(TypeError(`ReadableStream is locked`)):readableStreamCancel(this,e):Promise.reject(TypeError(`Invalid this`))}getReader(e={}){if(!ar(this))throw TypeError(`Invalid this`);if(e!=null&&typeof e!=`object`)throw TypeError(`options must be an object`);let t=e?.mode;if(t===void 0)return new ReadableStreamDefaultReader(this);if(`${t}`==`byob`)return new ReadableStreamBYOBReader(this);throw RangeError(`Invalid mode: ${t}`)}pipeThrough(e,t={}){if(!ar(this))throw TypeError(`Invalid this`);let n=e?.readable;if(!ar(n))throw TypeError(`transform.readable must be a ReadableStream`);let r=e?.writable;if(!qn(r))throw TypeError(`transform.writable must be a WritableStream`);if(t!=null&&typeof t!=`object`)throw TypeError(`options must be an object`);let i=t?.preventAbort,a=t?.preventCancel,o=t?.preventClose,s=t?.signal;if(s!==void 0&&!(s instanceof Object&&`aborted`in s))throw TypeError(`options.signal must be an AbortSignal`);if(isReadableStreamLocked(this))throw TypeError(`The ReadableStream is locked`);if(isWritableStreamLocked(r))throw TypeError(`The WritableStream is locked`);return setPromiseHandled(readableStreamPipeTo(this,r,!!o,!!i,!!a,s)),n}pipeTo(e,t={}){try{if(!ar(this))throw TypeError(`Invalid this`);if(!qn(e))throw TypeError(`destination must be a WritableStream`);if(t!=null&&typeof t!=`object`)throw TypeError(`options must be an object`);let n=t?.preventAbort,r=t?.preventCancel,i=t?.preventClose,a=t?.signal;if(a!==void 0&&!(a instanceof Object&&`aborted`in a))throw TypeError(`options.signal must be an AbortSignal`);if(isReadableStreamLocked(this))throw TypeError(`The ReadableStream is locked`);if(isWritableStreamLocked(e))throw TypeError(`The WritableStream is locked`);return readableStreamPipeTo(this,e,!!i,!!n,!!r,a)}catch(e){return Promise.reject(e)}}tee(){if(!ar(this))throw TypeError(`Invalid this`);let e=this[Q].controller;return cr(e)?readableByteStreamTee(this):readableStreamDefaultTee(this,!1)}values(e={}){if(!ar(this))throw TypeError(`Invalid this`);if(e!=null&&typeof e!=`object`)throw TypeError(`options must be an object`);let t=!!e?.preventCancel,n=new ReadableStreamDefaultReader(this),r={done:!1,current:void 0},i=!1;function nextSteps(){if(r.done)return Promise.resolve({done:!0,value:void 0});if(n[Q].stream===void 0)return Promise.reject(TypeError(`The reader is not bound to a ReadableStream`));let{promise:e,resolve:t,reject:i}=Promise.withResolvers();return readableStreamDefaultReaderRead(n,{[Qn](e){r.current=void 0,t({value:e,done:!1})},[Zn](){r.current=void 0,r.done=!0,readableStreamReaderGenericRelease(n),t({done:!0,value:void 0})},[$n](e){r.current=void 0,r.done=!0,readableStreamReaderGenericRelease(n),i(e)}}),e}async function returnSteps(e){if(r.done)return{done:!0,value:e};if(r.done=!0,n[Q].stream===void 0)throw TypeError(`The reader is not bound to a ReadableStream`);if(!t){let t=readableStreamReaderGenericCancel(n,e);return readableStreamReaderGenericRelease(n),await t,{done:!0,value:e}}return readableStreamReaderGenericRelease(n),{done:!0,value:e}}return Object.setPrototypeOf({next(){return i||=(r.current=Promise.resolve(),!0),r.current=r.current===void 0?nextSteps():r.current.then(nextSteps,nextSteps),r.current},return(e){return i=!0,r.current=r.current===void 0?returnSteps(e):r.current.then(()=>returnSteps(e),()=>returnSteps(e)),r.current},[Symbol.asyncIterator](){return this}},Vn)}[Symbol.asyncIterator](){return this.values()}get[Symbol.toStringTag](){return`ReadableStream`}},DefaultReadRequest=class{[Q];constructor(){this[Q]=Promise.withResolvers()}[Qn](e){this[Q].resolve?.({value:e,done:!1})}[Zn](){this[Q].resolve?.({value:void 0,done:!0})}[$n](e){this[Q].reject?.(e)}get promise(){return this[Q].promise}},ReadableStreamDefaultReader=class{[$]=`ReadableStreamDefaultReader`;[Q];constructor(e){if(!ar(e))throw TypeError(`Expected a ReadableStream`);this[Q]={readRequests:[],readIntoRequests:[],stream:void 0,close:{promise:void 0,resolve:void 0,reject:void 0}},setupReadableStreamDefaultReader(this,e)}read(){if(!sr(this))return Promise.reject(TypeError(`Invalid this`));if(this[Q].stream===void 0)return Promise.reject(TypeError(`The reader is not attached to a stream`));let e=this[Q].stream,t=e[Q].controller;if(e[Q].state===`readable`&&or(t)&&t[Q].queue.length>0){e[Q].disturbed=!0;let n=dequeueValue(t);return t[Q].closeRequested&&!t[Q].queue.length?(readableStreamDefaultControllerClearAlgorithms(t),readableStreamClose(e)):readableStreamDefaultControllerCallPullIfNeeded(t),Promise.resolve({value:n,done:!1})}let n=new DefaultReadRequest;return readableStreamDefaultReaderRead(this,n),n.promise}releaseLock(){if(!sr(this))throw TypeError(`Invalid this`);this[Q].stream!==void 0&&readableStreamDefaultReaderRelease(this)}get closed(){return sr(this)?this[Q].close.promise:Promise.reject(TypeError(`Invalid this`))}cancel(e=void 0){return sr(this)?this[Q].stream===void 0?Promise.reject(TypeError(`The reader is not attached to a stream`)):readableStreamReaderGenericCancel(this,e):Promise.reject(TypeError(`Invalid this`))}get[Symbol.toStringTag](){return`ReadableStreamDefaultReader`}},ReadableStreamDefaultController=class{[$]=`ReadableStreamDefaultController`;[Q];constructor(e){if(e!==nr)throw TypeError(`Illegal constructor`)}get desiredSize(){return readableStreamDefaultControllerGetDesiredSize(this)}close(){if(!readableStreamDefaultControllerCanCloseOrEnqueue(this))throw TypeError(`Controller is already closed`);readableStreamDefaultControllerClose(this)}enqueue(e=void 0){if(!readableStreamDefaultControllerCanCloseOrEnqueue(this))throw TypeError(`Controller is already closed`);readableStreamDefaultControllerEnqueue(this,e)}error(e=void 0){readableStreamDefaultControllerError(this,e)}[Xn](e){return readableStreamDefaultControllerCancelSteps(this,e)}[er](e){readableStreamDefaultControllerPullSteps(this,e)}[tr](){}get[Symbol.toStringTag](){return`ReadableStreamDefaultController`}};const ar=isBrandCheck(`ReadableStream`),or=isBrandCheck(`ReadableStreamDefaultController`),sr=isBrandCheck(`ReadableStreamDefaultReader`);function isReadableStreamLocked(e){return e[Q].reader!==void 0}function readableStreamCancel(e,t){switch(e[Q].disturbed=!0,e[Q].state){case`closed`:return Promise.resolve();case`errored`:return Promise.reject(e[Q].storedError)}readableStreamClose(e);let n=e[Q].reader;if(n!==void 0&&readableStreamHasBYOBReader(e)){let e=n[Q].readIntoRequests;n[Q].readIntoRequests=[];for(let t=0;t<e.length;t++)e[t][Zn](void 0)}return e[Q].controller[Xn](t).then(()=>{})}function readableStreamClose(e){e[Q].state=`closed`,e[Q].closedPromise.resolve();let{reader:t}=e[Q];if(t!==void 0&&(t[Q].close.resolve?.(),readableStreamHasDefaultReader(e))){for(let e=0;e<t[Q].readRequests.length;e++)t[Q].readRequests[e][Zn]();t[Q].readRequests=[]}}function readableStreamError(e,t){e[Q].state=`errored`,e[Q].storedError=t,setPromiseHandled(e[Q].closedPromise.promise),e[Q].closedPromise.reject(t);let{reader:n}=e[Q];if(n!==void 0){if(setPromiseHandled(n[Q].close.promise),n[Q].close.reject?.(t),readableStreamHasDefaultReader(e)){for(let e=0;e<n[Q].readRequests.length;e++)n[Q].readRequests[e][$n](t);n[Q].readRequests=[]}else if(readableStreamHasBYOBReader(e)){for(let e=0;e<n[Q].readIntoRequests.length;e++)n[Q].readIntoRequests[e][$n](t);n[Q].readIntoRequests=[]}}}function readableStreamHasDefaultReader(e){let{reader:t}=e[Q];return t===void 0?!1:t[Q]!==void 0&&t[$]===`ReadableStreamDefaultReader`}function readableStreamGetNumReadRequests(e){return e[Q].reader[Q].readRequests.length}function readableStreamFulfillReadRequest(e,t,n){let{reader:r}=e[Q],i=r[Q].readRequests.shift();n?i[Zn]():i[Qn](t)}function readableStreamAddReadRequest(e,t){e[Q].reader[Q].readRequests.push(t)}function readableStreamReaderGenericCancel(e,t){let{stream:n}=e[Q];return readableStreamCancel(n,t)}function readableStreamReaderGenericInitialize(e,t){switch(e[Q].stream=t,t[Q].reader=e,t[Q].state){case`readable`:e[Q].close=Promise.withResolvers();break;case`closed`:e[Q].close={promise:Promise.resolve(),resolve:void 0,reject:void 0};break;case`errored`:e[Q].close={promise:Promise.reject(t[Q].storedError),resolve:void 0,reject:void 0},setPromiseHandled(e[Q].close.promise);break}}function readableStreamReaderGenericRelease(e){let{stream:t}=e[Q],n=lazyReadableReleasedError();t[Q].state===`readable`?e[Q].close.reject?.(n):e[Q].close={promise:Promise.reject(n),resolve:void 0,reject:void 0},setPromiseHandled(e[Q].close.promise),t[Q].controller[tr](),t[Q].reader=void 0,e[Q].stream=void 0}function readableStreamDefaultReaderRelease(e){readableStreamReaderGenericRelease(e),readableStreamDefaultReaderErrorReadRequests(e,lazyReadableReleasingError())}function readableStreamDefaultReaderErrorReadRequests(e,t){for(let n=0;n<e[Q].readRequests.length;++n)e[Q].readRequests[n][$n](t);e[Q].readRequests=[]}function readableStreamDefaultReaderRead(e,t){let{stream:n}=e[Q];switch(n[Q].disturbed=!0,n[Q].state){case`closed`:t[Zn]();break;case`errored`:t[$n](n[Q].storedError);break;case`readable`:n[Q].controller[er](t);break}}function setupReadableStreamDefaultReader(e,t){if(isReadableStreamLocked(t))throw TypeError(`ReadableStream is locked`);readableStreamReaderGenericInitialize(e,t),e[Q].readRequests=[]}function readableStreamDefaultControllerClose(e){readableStreamDefaultControllerCanCloseOrEnqueue(e)&&(e[Q].closeRequested=!0,e[Q].queue.length||(readableStreamDefaultControllerClearAlgorithms(e),readableStreamClose(e[Q].stream)))}function readableStreamDefaultControllerEnqueue(e,t){if(!readableStreamDefaultControllerCanCloseOrEnqueue(e))return;let{stream:n}=e[Q];if(isReadableStreamLocked(n)&&readableStreamGetNumReadRequests(n))readableStreamFulfillReadRequest(n,t,!1);else try{enqueueValueWithSize(e,t,e[Q].sizeAlgorithm(t))}catch(t){throw readableStreamDefaultControllerError(e,t),t}readableStreamDefaultControllerCallPullIfNeeded(e)}function readableStreamDefaultControllerCanCloseOrEnqueue(e){let{stream:t}=e[Q];return!e[Q].closeRequested&&t[Q].state===`readable`}function readableStreamDefaultControllerGetDesiredSize(e){let{stream:t,highWaterMark:n,queueTotalSize:r}=e[Q];switch(t[Q].state){case`errored`:return null;case`closed`:return 0;default:return n-r}}function readableStreamDefaultControllerHasBackpressure(e){return!readableStreamDefaultControllerShouldCallPull(e)}function readableStreamDefaultControllerShouldCallPull(e){let{stream:t}=e[Q];if(!readableStreamDefaultControllerCanCloseOrEnqueue(e)||!e[Q].started)return!1;if(isReadableStreamLocked(t)&&readableStreamGetNumReadRequests(t))return!0;let n=readableStreamDefaultControllerGetDesiredSize(e);return n!==null&&n>0}function readableStreamDefaultControllerCallPullIfNeeded(e){if(readableStreamDefaultControllerShouldCallPull(e)){if(e[Q].pulling){e[Q].pullAgain=!0;return}e[Q].pulling=!0,e[Q].pullAlgorithm(e).then(()=>{e[Q].pulling=!1,e[Q].pullAgain&&(e[Q].pullAgain=!1,readableStreamDefaultControllerCallPullIfNeeded(e))},t=>readableStreamDefaultControllerError(e,t))}}function readableStreamDefaultControllerClearAlgorithms(e){e[Q].pullAlgorithm=void 0,e[Q].cancelAlgorithm=void 0,e[Q].sizeAlgorithm=void 0}function readableStreamDefaultControllerError(e,t){let{stream:n}=e[Q];n[Q].state===`readable`&&(resetQueue(e),readableStreamDefaultControllerClearAlgorithms(e),readableStreamError(n,t))}function readableStreamDefaultControllerCancelSteps(e,t){resetQueue(e);let n=e[Q].cancelAlgorithm?.(t)??Promise.resolve();return readableStreamDefaultControllerClearAlgorithms(e),n}function readableStreamDefaultControllerPullSteps(e,t){let{stream:n,queue:r}=e[Q];if(r.length){let i=dequeueValue(e);e[Q].closeRequested&&!r.length?(readableStreamDefaultControllerClearAlgorithms(e),readableStreamClose(n)):readableStreamDefaultControllerCallPullIfNeeded(e),t[Qn](i);return}readableStreamAddReadRequest(n,t),readableStreamDefaultControllerCallPullIfNeeded(e)}function setupReadableStreamDefaultController(e,t,n,r,i,a,o){t[Q]={cancelAlgorithm:i,closeRequested:!1,highWaterMark:a,pullAgain:!1,pullAlgorithm:r,pulling:!1,queue:[],queueTotalSize:0,started:!1,sizeAlgorithm:o,stream:e},e[Q].controller=t;let s=n();new Promise(e=>e(s)).then(()=>{t[Q].started=!0,readableStreamDefaultControllerCallPullIfNeeded(t)},e=>readableStreamDefaultControllerError(t,e))}function setupReadableStreamDefaultControllerFromSource(e,t,n,r){let i=new ReadableStreamDefaultController(nr),a=t?.start,o=t?.pull,s=t?.cancel;setupReadableStreamDefaultController(e,i,a?a.bind(t,i):nonOpStart,o?createPromiseCallback(`source.pull`,o,t):nonOpPull,s?createPromiseCallback(`source.cancel`,s,t):nonOpCancel,n,r)}function createReadableStream(e,t,n,r=1,i=()=>1){let a=Object.create(ReadableStream$1.prototype);return a[$]=`ReadableStream`,a[Q]=createReadableStreamState(),setupReadableStreamDefaultController(a,new ReadableStreamDefaultController(nr),e,t,n,r,i),a}function readableStreamFromIterable(e){let t,n=getIterator(e,`async`),r=nonOpStart;async function pullAlgorithm(){let e=iteratorNext(n);return Promise.resolve(e).then(e=>{if(typeof e!=`object`||!e)throw TypeError(`The promise returned by the iterator.next() method must fulfill with an object`);e.done?readableStreamDefaultControllerClose(t[Q].controller):readableStreamDefaultControllerEnqueue(t[Q].controller,e.value)})}async function cancelAlgorithm(e){let t=n.iterator,r=t.return;if(r===void 0)return Promise.resolve();let i=r.call(t,e);return Promise.resolve(i).then(e=>{if(typeof e!=`object`||!e)throw TypeError(`The promise returned by the iterator.return() method must fulfill with an object`)})}return t=createReadableStream(r,pullAlgorithm,cancelAlgorithm,0),t}function readableStreamPipeTo(e,t,n,r,i,a){let o,s;try{o=new ReadableStreamDefaultReader(e),s=new WritableStreamDefaultWriter(t)}catch(e){return Promise.reject(e)}e[Q].disturbed=!0;let c=!1,{promise:l,resolve:u,reject:d}=Promise.withResolvers(),p={currentWrite:Promise.resolve()},m;function finalize(e,t){writableStreamDefaultWriterRelease(s),readableStreamReaderGenericRelease(o),a!==void 0&&m&&(a.removeEventListener(`abort`,m),m=void 0),e?d(t):u()}async function waitForCurrentWrite(){let e=p.currentWrite;await e,e!==p.currentWrite&&await waitForCurrentWrite()}function shutdownWithAnAction(e,n,r){if(c)return;if(c=!0,t[Q].state===`writable`&&!writableStreamCloseQueuedOrInFlight(t)){waitForCurrentWrite().then(complete,e=>finalize(!0,e));return}complete();function complete(){e().then(()=>finalize(!!n,r),e=>finalize(!0,e))}}function shutdown(e,n){if(!c){if(c=!0,t[Q].state===`writable`&&!writableStreamCloseQueuedOrInFlight(t)){waitForCurrentWrite().then(()=>finalize(!!e,n),e=>finalize(!0,e));return}finalize(!!e,n)}}function abortAlgorithm(){let n;n=a.reason&&a.reason.name===`AbortError`?createAbortError$1():a.reason;let o=[];r||o.push(()=>t[Q].state===`writable`?writableStreamAbort(t,n):Promise.resolve()),i||o.push(()=>e[Q].state===`readable`?readableStreamCancel(e,n):Promise.resolve()),shutdownWithAnAction(()=>Promise.all(o.map(e=>e())).then(()=>void 0),!0,n)}function watchErrored(e,t,n){e[Q].state===`errored`?n(e[Q].storedError):t.then(void 0,n)}function watchClosed(e,t,n){e[Q].state===`closed`?n():t.then(n,()=>{})}class PipeToReadRequest{[Qn](e){ge(()=>{p.currentWrite=writableStreamDefaultWriterWrite(s,e),setPromiseHandled(p.currentWrite),h.resolve(!1)})}[Zn](){h.resolve(!0)}[$n](e){h.reject(e)}}let h={resolve:null,reject:null};async function step(){if(c||t[Q].backpressure&&(await s[Q].ready.promise,c))return!0;let n=e[Q].controller;if(e[Q].state===`readable`&&or(n)&&n[Q].queue.length>0){for(;n[Q].queue.length>0;){if(c)return!0;let r=dequeueValue(n);if(n[Q].closeRequested&&!n[Q].queue.length&&(readableStreamDefaultControllerClearAlgorithms(n),readableStreamClose(e)),p.currentWrite=writableStreamDefaultWriterWrite(s,r),setPromiseHandled(p.currentWrite),t[Q].backpressure||t[Q].state!==`writable`||writableStreamCloseQueuedOrInFlight(t))break}return readableStreamDefaultControllerCallPullIfNeeded(n),e[Q].state===`closed`}let{promise:r,resolve:i,reject:a}=Promise.withResolvers();return h={resolve:i,reject:a},readableStreamDefaultReaderRead(o,new PipeToReadRequest),r}async function run(){for(;!await step(););}if(a!==void 0){if(a.aborted)return abortAlgorithm(),l;m=abortAlgorithm,a.addEventListener(`abort`,m,{once:!0})}if(setPromiseHandled(run()),watchErrored(e,o[Q].close.promise,e=>{if(!r)return shutdownWithAnAction(()=>writableStreamAbort(t,e),!0,e);shutdown(!0,e)}),watchErrored(t,s[Q].close.promise,t=>{if(!i)return shutdownWithAnAction(()=>readableStreamCancel(e,t),!0,t);shutdown(!0,t)}),watchClosed(e,o[Q].close.promise,()=>{if(!n)return shutdownWithAnAction(()=>writableStreamDefaultWriterCloseWithErrorPropagation(s));shutdown()}),writableStreamCloseQueuedOrInFlight(t)||t[Q].state===`closed`){let t=TypeError(`Destination WritableStream is closed`);i?shutdown(!0,t):shutdownWithAnAction(()=>readableStreamCancel(e,t),!0,t)}return l}function readableStreamDefaultTee(e,t){let n=new ReadableStreamDefaultReader(e),r=!1,i=!1,a=!1,o,s,c,l,u=Promise.withResolvers();async function pullAlgorithm(){r||(r=!0,readableStreamDefaultReaderRead(n,{[Qn](e){ge(()=>{r=!1;let n=e,o=e;if(!a&&t)try{o=structuredClone(o)}catch{}i||readableStreamDefaultControllerEnqueue(c[Q].controller,n),a||readableStreamDefaultControllerEnqueue(l[Q].controller,o)})},[Zn](){ge(()=>{r=!1,i||readableStreamDefaultControllerClose(c[Q].controller),a||readableStreamDefaultControllerClose(l[Q].controller),(!i||!a)&&u.resolve(void 0)})},[$n](){r=!1}}))}function cancel1Algorithm(t){if(i=!0,o=t,a){let t=[o,s];u.resolve(readableStreamCancel(e,t))}return u.promise}function cancel2Algorithm(t){if(a=!0,s=t,i){let t=[o,s];u.resolve(readableStreamCancel(e,t))}return u.promise}return c=createReadableStream(nonOpStart,pullAlgorithm,cancel1Algorithm),l=createReadableStream(nonOpStart,pullAlgorithm,cancel2Algorithm),n[Q].close.promise.then(void 0,e=>{readableStreamDefaultControllerError(c[Q].controller,e),readableStreamDefaultControllerError(l[Q].controller,e),(!i||!a)&&u.resolve(void 0)}),[c,l]}var BYOBReadIntoRequest=class{[Q];constructor(){this[Q]=Promise.withResolvers()}[Qn](e){this[Q].resolve?.({value:e,done:!1})}[Zn](e){this[Q].resolve?.({value:e,done:!0})}[$n](e){this[Q].reject?.(e)}get promise(){return this[Q].promise}},ReadableStreamBYOBReader=class{[$]=`ReadableStreamBYOBReader`;[Q];constructor(e){if(!ar(e))throw TypeError(`Expected a ReadableStream`);this[Q]={readRequests:[],readIntoRequests:[],stream:void 0,close:{promise:void 0,resolve:void 0,reject:void 0}},setupReadableStreamBYOBReader(this,e)}read(e,t={}){if(!lr(this))return Promise.reject(TypeError(`Invalid this`));if(typeof e!=`object`||!e||!ArrayBuffer.isView(e))return Promise.reject(TypeError(`view must be an ArrayBufferView`));let n=e.buffer,r=e.byteLength;if(r===0)return Promise.reject(TypeError(`view must have non-zero byteLength`));if(n.byteLength===0)return isDetachedBuffer(n)?Promise.reject(TypeError(`view's buffer has been detached`)):Promise.reject(TypeError(`view's buffer must have non-zero byteLength`));let i=t?.min??1;if(typeof i!=`number`||i<1||!Number.isInteger(i)||Number.isNaN(i))return Promise.reject(TypeError(`options.min must be a positive integer`));let a=e[Symbol.toStringTag];if(a!==void 0&&a!==`DataView`){if(i>e.length)return Promise.reject(RangeError(`options.min must be smaller or equal to view size`))}else if(i>r)return Promise.reject(RangeError(`options.min must be smaller or equal to view size`));if(this[Q].stream===void 0)return Promise.reject(TypeError(`Reader has no associated stream`));let o=new BYOBReadIntoRequest;return readableStreamBYOBReaderRead(this,e,i,o),o.promise}releaseLock(){if(!lr(this))throw TypeError(`Invalid this`);this[Q].stream!==void 0&&readableStreamBYOBReaderRelease(this)}get closed(){return lr(this)?this[Q].close.promise:Promise.reject(TypeError(`Invalid this`))}cancel(e=void 0){return lr(this)?this[Q].stream===void 0?Promise.reject(TypeError(`Reader has no associated stream`)):readableStreamReaderGenericCancel(this,e):Promise.reject(TypeError(`Invalid this`))}get[Symbol.toStringTag](){return`ReadableStreamBYOBReader`}},ReadableStreamBYOBRequest=class{[$]=`ReadableStreamBYOBRequest`;[Q];constructor(e){if(e!==nr)throw TypeError(`Illegal constructor`)}get view(){if(!ur(this))throw TypeError(`Invalid this`);return this[Q].view}respond(e){if(!ur(this))throw TypeError(`Invalid this`);if(this[Q].controller===void 0)throw TypeError(`BYOB request has been invalidated`);if(e=+e,!Number.isInteger(e)||e<0||!Number.isFinite(e))throw RangeError(`bytesWritten must be a non-negative integer`);let t=this[Q].view;if(isDetachedBuffer(t.buffer))throw TypeError(`The BYOB request's buffer has been detached`);readableByteStreamControllerRespond(this[Q].controller,e)}respondWithNewView(e){if(!ur(this))throw TypeError(`Invalid this`);if(this[Q].controller===void 0)throw TypeError(`BYOB request has been invalidated`);if(typeof e!=`object`||!e||!ArrayBuffer.isView(e))throw TypeError(`view must be an ArrayBufferView`);if(isDetachedBuffer(e.buffer))throw TypeError(`The given view's buffer has been detached`);readableByteStreamControllerRespondWithNewView(this[Q].controller,e)}get[Symbol.toStringTag](){return`ReadableStreamBYOBRequest`}},ReadableByteStreamController=class{[$]=`ReadableByteStreamController`;[Q];constructor(e){if(e!==nr)throw TypeError(`Illegal constructor`)}get byobRequest(){if(!cr(this))throw TypeError(`Invalid this`);return readableByteStreamControllerGetBYOBRequest(this)}get desiredSize(){if(!cr(this))throw TypeError(`Invalid this`);return readableByteStreamControllerGetDesiredSize(this)}close(){if(!cr(this))throw TypeError(`Invalid this`);if(this[Q].closeRequested)throw TypeError(`Close already requested`);if(this[Q].stream[Q].state!==`readable`)throw TypeError(`Stream is not in a readable state`);readableByteStreamControllerClose(this)}enqueue(e){if(!cr(this))throw TypeError(`Invalid this`);if(typeof e!=`object`||!e||!ArrayBuffer.isView(e))throw TypeError(`chunk must be an ArrayBufferView`);if(e.byteLength===0)throw TypeError(`chunk length must be non-zero`);if(e.buffer.byteLength===0)throw TypeError(`chunk's buffer length must be non-zero`);if(this[Q].closeRequested)throw TypeError(`Cannot enqueue after close has been requested`);if(this[Q].stream[Q].state!==`readable`)throw TypeError(`Stream is not in a readable state`);readableByteStreamControllerEnqueue(this,e)}error(e=void 0){if(!cr(this))throw TypeError(`Invalid this`);readableByteStreamControllerError(this,e)}[Xn](e){return readableByteStreamControllerCancelSteps(this,e)}[er](e){readableByteStreamControllerPullSteps(this,e)}[tr](){if(this[Q].pendingPullIntos.length>0){let e=this[Q].pendingPullIntos[0];e.readerType=`none`,this[Q].pendingPullIntos=[e]}}get[Symbol.toStringTag](){return`ReadableByteStreamController`}};const cr=isBrandCheck(`ReadableByteStreamController`),lr=isBrandCheck(`ReadableStreamBYOBReader`),ur=isBrandCheck(`ReadableStreamBYOBRequest`);function readableStreamHasBYOBReader(e){let{reader:t}=e[Q];return t===void 0?!1:t[Q]!==void 0&&t[$]===`ReadableStreamBYOBReader`}function readableStreamGetNumReadIntoRequests(e){return e[Q].reader[Q].readIntoRequests.length}function readableStreamAddReadIntoRequest(e,t){e[Q].reader[Q].readIntoRequests.push(t)}function readableStreamFulfillReadIntoRequest(e,t,n){let{reader:r}=e[Q],i=r[Q].readIntoRequests.shift();n?i[Zn](t):i[Qn](t)}function setupReadableStreamBYOBReader(e,t){if(isReadableStreamLocked(t))throw TypeError(`ReadableStream is locked`);if(!cr(t[Q].controller))throw TypeError(`Cannot use a BYOB reader with a non-byte stream`);readableStreamReaderGenericInitialize(e,t),e[Q].readIntoRequests=[]}function readableStreamBYOBReaderRead(e,t,n,r){let{stream:i}=e[Q];i[Q].disturbed=!0,i[Q].state===`errored`?r[$n](i[Q].storedError):readableByteStreamControllerPullInto(i[Q].controller,t,n,r)}function readableStreamBYOBReaderRelease(e){readableStreamReaderGenericRelease(e);let t=TypeError(`Reader was released`);for(let n=0;n<e[Q].readIntoRequests.length;n++)e[Q].readIntoRequests[n][$n](t);e[Q].readIntoRequests=[]}function readableByteStreamControllerClearAlgorithms(e){e[Q].pullAlgorithm=void 0,e[Q].cancelAlgorithm=void 0}function readableByteStreamControllerClearPendingPullIntos(e){readableByteStreamControllerInvalidateBYOBRequest(e),e[Q].pendingPullIntos=[]}function readableByteStreamControllerInvalidateBYOBRequest(e){let t=e[Q].byobRequest;t!=null&&(t[Q].controller=void 0,t[Q].view=null,e[Q].byobRequest=null)}function readableByteStreamControllerError(e,t){let{stream:n}=e[Q];n[Q].state===`readable`&&(readableByteStreamControllerClearPendingPullIntos(e),resetQueue(e),readableByteStreamControllerClearAlgorithms(e),readableStreamError(n,t))}function readableByteStreamControllerGetDesiredSize(e){let t=e[Q].stream[Q].state;return t===`errored`?null:t===`closed`?0:e[Q].highWaterMark-e[Q].queueTotalSize}function readableByteStreamControllerShouldCallPull(e){let{stream:t}=e[Q];if(t[Q].state!==`readable`||e[Q].closeRequested||!e[Q].started)return!1;if(readableStreamHasDefaultReader(t)&&readableStreamGetNumReadRequests(t)>0||readableStreamHasBYOBReader(t)&&readableStreamGetNumReadIntoRequests(t)>0)return!0;let n=readableByteStreamControllerGetDesiredSize(e);return n!==null&&n>0}function readableByteStreamControllerCallPullIfNeeded(e){if(readableByteStreamControllerShouldCallPull(e)){if(e[Q].pulling){e[Q].pullAgain=!0;return}e[Q].pulling=!0,e[Q].pullAlgorithm(e).then(()=>{e[Q].pulling=!1,e[Q].pullAgain&&(e[Q].pullAgain=!1,readableByteStreamControllerCallPullIfNeeded(e))},t=>readableByteStreamControllerError(e,t))}}function readableByteStreamControllerHandleQueueDrain(e){e[Q].queueTotalSize===0&&e[Q].closeRequested?(readableByteStreamControllerClearAlgorithms(e),readableStreamClose(e[Q].stream)):readableByteStreamControllerCallPullIfNeeded(e)}function readableByteStreamControllerEnqueueChunkToQueue(e,t,n,r){e[Q].queue.push({buffer:t,byteOffset:n,byteLength:r}),e[Q].queueTotalSize+=r}function readableByteStreamControllerEnqueueClonedChunkToQueue(e,t,n,r){let i;try{i=t.slice(n,n+r)}catch(t){readableByteStreamControllerError(e,t);return}readableByteStreamControllerEnqueueChunkToQueue(e,i,0,r)}function readableByteStreamControllerEnqueueDetachedPullIntoToQueue(e,t){t.bytesFilled>0&&readableByteStreamControllerEnqueueClonedChunkToQueue(e,t.buffer,t.byteOffset,t.bytesFilled),readableByteStreamControllerShiftPendingPullInto(e)}function readableByteStreamControllerShiftPendingPullInto(e){return e[Q].pendingPullIntos.shift()}function readableByteStreamControllerFillHeadPullIntoDescriptor(e,t,n){n.bytesFilled+=t}function readableByteStreamControllerConvertPullIntoDescriptor(e){let t=e.bytesFilled,n=e.elementSize,r=transferArrayBuffer(e.buffer);return e.buffer=r,new e.viewConstructor(r,e.byteOffset,t/n)}function readableByteStreamControllerCommitPullIntoDescriptor(e,t){let n=!1;e[Q].state===`closed`&&(n=!0);let r=readableByteStreamControllerConvertPullIntoDescriptor(t);t.readerType===`default`?readableStreamFulfillReadRequest(e,r,n):readableStreamFulfillReadIntoRequest(e,r,n)}function readableByteStreamControllerFillPullIntoDescriptorFromQueue(e,t){let n=Math.min(e[Q].queueTotalSize,t.byteLength-t.bytesFilled),r=t.bytesFilled+n,i=n,a=!1,o=r-r%t.elementSize;o>=t.minimumFill&&(i=o-t.bytesFilled,a=!0);let s=e[Q].queue;for(;i>0;){let n=s[0],r=Math.min(i,n.byteLength),a=t.byteOffset+t.bytesFilled,o=new Uint8Array(t.buffer,a,r),c=new Uint8Array(n.buffer,n.byteOffset,r);o.set(c),n.byteLength===r?s.shift():(n.byteOffset+=r,n.byteLength-=r),e[Q].queueTotalSize-=r,readableByteStreamControllerFillHeadPullIntoDescriptor(e,r,t),i-=r}return a}function readableByteStreamControllerFillReadRequestFromQueue(e,t){let n=e[Q].queue.shift();e[Q].queueTotalSize-=n.byteLength,readableByteStreamControllerHandleQueueDrain(e);let r=new Uint8Array(n.buffer,n.byteOffset,n.byteLength);t[Qn](r)}function readableByteStreamControllerProcessReadRequestsUsingQueue(e){let t=e[Q].stream[Q].reader;for(;t[Q].readRequests.length!==0;){if(e[Q].queueTotalSize===0)return;readableByteStreamControllerFillReadRequestFromQueue(e,t[Q].readRequests.shift())}}function readableByteStreamControllerProcessPullIntoDescriptorsUsingQueue(e){for(;e[Q].pendingPullIntos.length!==0;){if(e[Q].queueTotalSize===0)return;let t=e[Q].pendingPullIntos[0];readableByteStreamControllerFillPullIntoDescriptorFromQueue(e,t)&&(readableByteStreamControllerShiftPendingPullInto(e),readableByteStreamControllerCommitPullIntoDescriptor(e[Q].stream,t))}}function readableByteStreamControllerGetBYOBRequest(e){if(e[Q].byobRequest===null&&e[Q].pendingPullIntos.length!==0){let t=e[Q].pendingPullIntos[0],n=new Uint8Array(t.buffer,t.byteOffset+t.bytesFilled,t.byteLength-t.bytesFilled),r=new ReadableStreamBYOBRequest(nr);r[Q]={controller:e,view:n},e[Q].byobRequest=r}return e[Q].byobRequest}function readableByteStreamControllerEnqueue(e,t){let{stream:n}=e[Q];if(e[Q].closeRequested||n[Q].state!==`readable`)return;let r=t.buffer,i=t.byteLength,a=t.byteOffset;if(isDetachedBuffer(r))throw TypeError(`chunk's buffer is detached`);let o=transferArrayBuffer(r);if(e[Q].pendingPullIntos.length!==0){let t=e[Q].pendingPullIntos[0];if(isDetachedBuffer(t.buffer))throw TypeError(`BYOB request's buffer has been detached`);readableByteStreamControllerInvalidateBYOBRequest(e),t.buffer=transferArrayBuffer(t.buffer),t.readerType===`none`&&readableByteStreamControllerEnqueueDetachedPullIntoToQueue(e,t)}readableStreamHasDefaultReader(n)?(readableByteStreamControllerProcessReadRequestsUsingQueue(e),readableStreamGetNumReadRequests(n)===0?readableByteStreamControllerEnqueueChunkToQueue(e,o,a,i):(e[Q].pendingPullIntos.length!==0&&readableByteStreamControllerShiftPendingPullInto(e),readableStreamFulfillReadRequest(n,new Uint8Array(o,a,i),!1))):readableStreamHasBYOBReader(n)?(readableByteStreamControllerEnqueueChunkToQueue(e,o,a,i),readableByteStreamControllerProcessPullIntoDescriptorsUsingQueue(e)):readableByteStreamControllerEnqueueChunkToQueue(e,o,a,i),readableByteStreamControllerCallPullIfNeeded(e)}function readableByteStreamControllerClose(e){let{stream:t}=e[Q];if(!(e[Q].closeRequested||t[Q].state!==`readable`)){if(e[Q].queueTotalSize>0){e[Q].closeRequested=!0;return}if(e[Q].pendingPullIntos.length!==0){let t=e[Q].pendingPullIntos[0];if(t.bytesFilled%t.elementSize!==0){let t=TypeError(`Insufficient bytes to fill elements in the given buffer`);throw readableByteStreamControllerError(e,t),t}}readableByteStreamControllerClearAlgorithms(e),readableStreamClose(t)}}function readableByteStreamControllerPullInto(e,t,n,r){let i=e[Q].stream,a=t[Symbol.toStringTag],o,s;if(a===void 0||a===`DataView`)o=DataView,s=1;else{let e=typedArrayConstructorByTag(a);if(!e){r[$n](TypeError(`Unsupported typed array: ${a}`));return}o=e,s=elementSizeByTag(a)}let c=t.buffer,l=t.byteLength,u=t.byteOffset,d=n*s,p;try{p=transferArrayBuffer(c)}catch(e){r[$n](e);return}let m={buffer:p,bufferByteLength:p.byteLength,byteOffset:u,byteLength:l,bytesFilled:0,minimumFill:d,elementSize:s,viewConstructor:o,readerType:`byob`};if(e[Q].pendingPullIntos.length!==0){e[Q].pendingPullIntos.push(m),readableStreamAddReadIntoRequest(i,r);return}if(i[Q].state===`closed`){let e=new o(m.buffer,m.byteOffset,0);r[Zn](e);return}if(e[Q].queueTotalSize>0){if(readableByteStreamControllerFillPullIntoDescriptorFromQueue(e,m)){let t=readableByteStreamControllerConvertPullIntoDescriptor(m);readableByteStreamControllerHandleQueueDrain(e),r[Qn](t);return}if(e[Q].closeRequested){let t=TypeError(`Insufficient bytes to fill elements in the given buffer`);readableByteStreamControllerError(e,t),r[$n](t);return}}e[Q].pendingPullIntos.push(m),readableStreamAddReadIntoRequest(i,r),readableByteStreamControllerCallPullIfNeeded(e)}function readableByteStreamControllerRespond(e,t){let n=e[Q].pendingPullIntos[0];if(e[Q].stream[Q].state===`closed`){if(t!==0)throw TypeError(`bytesWritten must be 0 when calling respond() on a closed stream`)}else{if(t===0)throw TypeError(`bytesWritten must be greater than 0 when calling respond() on a readable stream`);if(n.bytesFilled+t>n.byteLength)throw RangeError(`bytesWritten out of range`)}n.buffer=transferArrayBuffer(n.buffer),readableByteStreamControllerRespondInternal(e,t)}function readableByteStreamControllerRespondWithNewView(e,t){let n=e[Q].pendingPullIntos[0],r=e[Q].stream[Q].state,i=t.byteLength,a=t.byteOffset,o=t.buffer;if(r===`closed`){if(i!==0)throw TypeError(`view's length must be 0 when calling respondWithNewView() on a closed stream`)}else if(i===0)throw TypeError(`view's length must be greater than 0 when calling respondWithNewView() on a readable stream`);if(n.byteOffset+n.bytesFilled!==a)throw RangeError(`The region specified by view does not match byobRequest`);if(n.bufferByteLength!==o.byteLength)throw RangeError(`The buffer of view has different capacity than byobRequest`);if(n.bytesFilled+i>n.byteLength)throw RangeError(`The region specified by view is larger than byobRequest`);n.buffer=transferArrayBuffer(o),readableByteStreamControllerRespondInternal(e,i)}function readableByteStreamControllerRespondInternal(e,t){let n=e[Q].pendingPullIntos[0];readableByteStreamControllerInvalidateBYOBRequest(e),e[Q].stream[Q].state===`closed`?readableByteStreamControllerRespondInClosedState(e,n):readableByteStreamControllerRespondInReadableState(e,t,n),readableByteStreamControllerCallPullIfNeeded(e)}function readableByteStreamControllerRespondInClosedState(e,t){t.readerType===`none`&&readableByteStreamControllerShiftPendingPullInto(e);let n=e[Q].stream;if(readableStreamHasBYOBReader(n))for(;readableStreamGetNumReadIntoRequests(n)>0;)readableByteStreamControllerCommitPullIntoDescriptor(n,readableByteStreamControllerShiftPendingPullInto(e))}function readableByteStreamControllerRespondInReadableState(e,t,n){if(readableByteStreamControllerFillHeadPullIntoDescriptor(e,t,n),n.readerType===`none`){readableByteStreamControllerEnqueueDetachedPullIntoToQueue(e,n),readableByteStreamControllerProcessPullIntoDescriptorsUsingQueue(e);return}if(n.bytesFilled<n.minimumFill)return;readableByteStreamControllerShiftPendingPullInto(e);let r=n.bytesFilled%n.elementSize;if(r>0){let t=n.byteOffset+n.bytesFilled;readableByteStreamControllerEnqueueClonedChunkToQueue(e,n.buffer,t-r,r)}n.bytesFilled-=r,readableByteStreamControllerCommitPullIntoDescriptor(e[Q].stream,n),readableByteStreamControllerProcessPullIntoDescriptorsUsingQueue(e)}function readableByteStreamControllerCancelSteps(e,t){readableByteStreamControllerClearPendingPullIntos(e),resetQueue(e);let n=e[Q].cancelAlgorithm?.(t)??Promise.resolve();return readableByteStreamControllerClearAlgorithms(e),n}function readableByteStreamControllerPullSteps(e,t){let n=e[Q].stream;if(e[Q].queueTotalSize>0){readableByteStreamControllerFillReadRequestFromQueue(e,t);return}let r=e[Q].autoAllocateChunkSize;if(r!==void 0){let n;try{n=new ArrayBuffer(r)}catch(e){t[$n](e);return}let i={buffer:n,bufferByteLength:r,byteOffset:0,byteLength:r,bytesFilled:0,minimumFill:1,elementSize:1,viewConstructor:Uint8Array,readerType:`default`};e[Q].pendingPullIntos.push(i)}readableStreamAddReadRequest(n,t),readableByteStreamControllerCallPullIfNeeded(e)}function setupReadableByteStreamController(e,t,n,r,i,a,o){t[Q]={cancelAlgorithm:i,closeRequested:!1,highWaterMark:a,pullAgain:!1,pullAlgorithm:r,pulling:!1,queue:[],queueTotalSize:0,started:!1,stream:e,byobRequest:null,pendingPullIntos:[],autoAllocateChunkSize:o},e[Q].controller=t;let s=n();new Promise(e=>e(s)).then(()=>{t[Q].started=!0,readableByteStreamControllerCallPullIfNeeded(t)},e=>readableByteStreamControllerError(t,e))}function setupReadableByteStreamControllerFromSource(e,t,n){let r=new ReadableByteStreamController(nr),i=t?.start,a=t?.pull,o=t?.cancel,s=t?.autoAllocateChunkSize;if(s!==void 0&&(s===0||!Number.isInteger(s)||s<0))throw TypeError(`autoAllocateChunkSize must be a positive integer`);setupReadableByteStreamController(e,r,i?i.bind(t,r):nonOpStart,a?createPromiseCallback(`source.pull`,a,t):nonOpPull,o?createPromiseCallback(`source.cancel`,o,t):nonOpCancel,n,s)}function readableByteStreamTee(e){let t=new ReadableStreamDefaultReader(e),n=!1,r=!1,i=!1,a,o,s=Promise.withResolvers(),c,l,u,d;function pullAlgorithm(){return n?Promise.resolve():(n=!0,t.read().then(e=>{if(n=!1,e.done){r||u.close(),i||d.close();return}let t=e.value,a=new Uint8Array(t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength));r||u.enqueue(a),i||d.enqueue(new Uint8Array(a))},()=>{}),Promise.resolve())}return c=new ReadableStream$1({type:`bytes`,pull:pullAlgorithm,cancel(t){if(r=!0,a=t,i){let t=readableStreamCancel(e,[a,o]);return s.resolve(),t}return s.promise}}),l=new ReadableStream$1({type:`bytes`,pull:pullAlgorithm,cancel(t){if(i=!0,o=t,r){let t=readableStreamCancel(e,[a,o]);return s.resolve(),t}return s.promise}}),u=c[Q].controller,d=l[Q].controller,t.closed.catch(e=>{u.error(e),d.error(e),(!r||!i)&&s.resolve()}),[c,l]}const dr=Symbol(`kSkipThrow`);var TransformStream=class{[$]=`TransformStream`;[Q];constructor(e={},t={},n={}){if(e!=null&&typeof e!=`object`)throw TypeError(`transformer must be an object`);if(t!=null&&typeof t!=`object`)throw TypeError(`writableStrategy must be an object`);if(n!=null&&typeof n!=`object`)throw TypeError(`readableStrategy must be an object`);let r=e?.readableType,i=e?.writableType,a=e?.start;if(r!==void 0)throw RangeError(`Invalid readableType: ${r}`);if(i!==void 0)throw RangeError(`Invalid writableType: ${i}`);let o=extractHighWaterMark(n?.highWaterMark,0),s=extractSizeAlgorithm(n?.size),c=extractHighWaterMark(t?.highWaterMark,1),l=extractSizeAlgorithm(t?.size),u=Promise.withResolvers();initializeTransformStream(this,u,c,l,o,s),setupTransformStreamDefaultControllerFromTransformer(this,e),a===void 0?u.resolve():u.resolve(a.call(e,this[Q].controller))}get readable(){if(!fr(this))throw TypeError(`Invalid this`);return this[Q].readable}get writable(){if(!fr(this))throw TypeError(`Invalid this`);return this[Q].writable}get[Symbol.toStringTag](){return`TransformStream`}},TransformStreamDefaultController=class{[$]=`TransformStreamDefaultController`;[Q];constructor(e){if(e!==dr)throw TypeError(`Illegal constructor`)}get desiredSize(){if(!pr(this))throw TypeError(`Invalid this`);let{stream:e}=this[Q],{readable:t}=e[Q],n=t[Q].controller;return readableStreamDefaultControllerGetDesiredSize(n)}enqueue(e){if(!pr(this))throw TypeError(`Invalid this`);transformStreamDefaultControllerEnqueue(this,e)}error(e){if(!pr(this))throw TypeError(`Invalid this`);transformStreamDefaultControllerError(this,e)}terminate(){if(!pr(this))throw TypeError(`Invalid this`);transformStreamDefaultControllerTerminate(this)}get[Symbol.toStringTag](){return`TransformStreamDefaultController`}};const fr=isBrandCheck(`TransformStream`),pr=isBrandCheck(`TransformStreamDefaultController`);async function defaultTransformAlgorithm(e,t){transformStreamDefaultControllerEnqueue(t,e)}function initializeTransformStream(e,t,n,r,i,a){let startAlgorithm=()=>t.promise,o=createWritableStream(startAlgorithm,t=>transformStreamDefaultSinkWriteAlgorithm(e,t),()=>transformStreamDefaultSinkCloseAlgorithm(e),t=>transformStreamDefaultSinkAbortAlgorithm(e,t),n,r);e[Q]={readable:createReadableStream(startAlgorithm,()=>transformStreamDefaultSourcePullAlgorithm(e),t=>transformStreamDefaultSourceCancelAlgorithm(e,t),i,a),writable:o,controller:void 0,backpressure:void 0,backpressureChange:{promise:void 0,resolve:void 0,reject:void 0}},transformStreamSetBackpressure(e,!0)}function transformStreamError(e,t){let{readable:n}=e[Q];readableStreamDefaultControllerError(n[Q].controller,t),transformStreamErrorWritableAndUnblockWrite(e,t)}function transformStreamErrorWritableAndUnblockWrite(e,t){let{controller:n,writable:r}=e[Q];transformStreamDefaultControllerClearAlgorithms(n),writableStreamDefaultControllerErrorIfNeeded(r[Q].controller,t),transformStreamUnblockWrite(e)}function transformStreamUnblockWrite(e){e[Q].backpressure&&transformStreamSetBackpressure(e,!1)}function transformStreamSetBackpressure(e,t){e[Q].backpressureChange.promise!==void 0&&e[Q].backpressureChange.resolve?.(),e[Q].backpressureChange=Promise.withResolvers(),e[Q].backpressure=t}function setupTransformStreamDefaultController(e,t,n,r,i){t[Q]={stream:e,transformAlgorithm:n,flushAlgorithm:r,cancelAlgorithm:i,finishPromise:void 0},e[Q].controller=t}function setupTransformStreamDefaultControllerFromTransformer(e,t){let n=new TransformStreamDefaultController(dr),r=t?.transform,i=t?.flush,a=t?.cancel;setupTransformStreamDefaultController(e,n,r?createPromiseCallback(`transformer.transform`,r,t):defaultTransformAlgorithm,i?createPromiseCallback(`transformer.flush`,i,t):nonOpFlush,a?createPromiseCallback(`transformer.cancel`,a,t):nonOpCancel)}function transformStreamDefaultControllerClearAlgorithms(e){e[Q].transformAlgorithm=void 0,e[Q].flushAlgorithm=void 0,e[Q].cancelAlgorithm=void 0}function transformStreamDefaultControllerEnqueue(e,t){let{stream:n}=e[Q],{readable:r}=n[Q],i=r[Q].controller;if(!readableStreamDefaultControllerCanCloseOrEnqueue(i))throw TypeError(`Unable to enqueue`);try{readableStreamDefaultControllerEnqueue(i,t)}catch(e){throw transformStreamErrorWritableAndUnblockWrite(n,e),r[Q].storedError}readableStreamDefaultControllerHasBackpressure(i)!==n[Q].backpressure&&transformStreamSetBackpressure(n,!0)}function transformStreamDefaultControllerError(e,t){transformStreamError(e[Q].stream,t)}async function transformStreamDefaultControllerPerformTransform(e,t){try{let n=e[Q].transformAlgorithm;if(n===void 0)return;await n(t,e)}catch(t){throw transformStreamError(e[Q].stream,t),t}}function transformStreamDefaultControllerTerminate(e){let{stream:t}=e[Q],{readable:n}=t[Q];readableStreamDefaultControllerClose(n[Q].controller),transformStreamErrorWritableAndUnblockWrite(t,TypeError(`TransformStream has been terminated`))}function transformStreamDefaultSinkWriteAlgorithm(e,t){let{controller:n}=e[Q];return e[Q].backpressure?e[Q].backpressureChange.promise.then(()=>{let{writable:r}=e[Q];if(r[Q].state===`erroring`)throw r[Q].storedError;return transformStreamDefaultControllerPerformTransform(n,t)}):transformStreamDefaultControllerPerformTransform(n,t)}async function transformStreamDefaultSinkAbortAlgorithm(e,t){let{controller:n,readable:r}=e[Q];if(n[Q].finishPromise!==void 0)return n[Q].finishPromise;let{promise:i,resolve:a,reject:o}=Promise.withResolvers();n[Q].finishPromise=i;let s=n[Q].cancelAlgorithm(t);return transformStreamDefaultControllerClearAlgorithms(n),s.then(()=>{r[Q].state===`errored`?o(r[Q].storedError):(readableStreamDefaultControllerError(r[Q].controller,t),a())},e=>{readableStreamDefaultControllerError(r[Q].controller,e),o(e)}),n[Q].finishPromise}function transformStreamDefaultSinkCloseAlgorithm(e){let{readable:t,controller:n}=e[Q];if(n[Q].finishPromise!==void 0)return n[Q].finishPromise;let{promise:r,resolve:i,reject:a}=Promise.withResolvers();n[Q].finishPromise=r;let o=n[Q].flushAlgorithm(n);return transformStreamDefaultControllerClearAlgorithms(n),o.then(()=>{t[Q].state===`errored`?a(t[Q].storedError):(readableStreamDefaultControllerClose(t[Q].controller),i())},e=>{readableStreamDefaultControllerError(t[Q].controller,e),a(e)}),n[Q].finishPromise}function transformStreamDefaultSourcePullAlgorithm(e){return transformStreamSetBackpressure(e,!1),e[Q].backpressureChange.promise}function transformStreamDefaultSourceCancelAlgorithm(e,t){let{controller:n,writable:r}=e[Q];if(n[Q].finishPromise!==void 0)return n[Q].finishPromise;let{promise:i,resolve:a,reject:o}=Promise.withResolvers();n[Q].finishPromise=i;let s=n[Q].cancelAlgorithm(t);return transformStreamDefaultControllerClearAlgorithms(n),s.then(()=>{r[Q].state===`errored`?o(r[Q].storedError):(writableStreamDefaultControllerErrorIfNeeded(r[Q].controller,t),transformStreamUnblockWrite(e),a())},t=>{writableStreamDefaultControllerErrorIfNeeded(r[Q].controller,t),transformStreamUnblockWrite(e),o(t)}),n[Q].finishPromise}const mr=Object.defineProperty(e=>e.byteLength,`name`,{value:`size`}),hr=Object.defineProperty(()=>1,`name`,{value:`size`});var ByteLengthQueuingStrategy=class{#e;constructor(e){if(typeof e!=`object`||!e)throw TypeError(`init must be an object`);if(e.highWaterMark===void 0)throw TypeError(`init.highWaterMark is required`);this.#e=+e.highWaterMark}get highWaterMark(){return this.#e}get size(){return mr}get[Symbol.toStringTag](){return`ByteLengthQueuingStrategy`}},CountQueuingStrategy=class{#e;constructor(e){if(typeof e!=`object`||!e)throw TypeError(`init must be an object`);if(e.highWaterMark===void 0)throw TypeError(`init.highWaterMark is required`);this.#e=+e.highWaterMark}get highWaterMark(){return this.#e}get size(){return hr}get[Symbol.toStringTag](){return`CountQueuingStrategy`}},TextEncoderStream=class{#e=null;#t=new TextEncoder;#n;constructor(){this.#n=new TransformStream({transform:(e,t)=>{if(e=String(e),e===``)return;this.#e!==null&&(e=this.#e+e);let n=e.charCodeAt(e.length-1);55296<=n&&n<=56319?(this.#e=e.slice(-1),e=e.slice(0,-1)):this.#e=null,e&&t.enqueue(this.#t.encode(e))},flush:e=>{this.#e!==null&&e.enqueue(new Uint8Array([239,191,189]))}})}get encoding(){return`utf-8`}get readable(){return this.#n.readable}get writable(){return this.#n.writable}};function hasStreamingSupport(){try{return new TextDecoder().decode(new Uint8Array([195]),{stream:!0}),!0}catch{return!1}}const gr=hasStreamingSupport();function incompleteUtf8Tail$1(e){let t=e.length;if(t===0)return 0;for(let n=1;n<=Math.min(3,t);n++){let r=e[t-n];if(!(r&128))return 0;if((r&192)!=128){let e;if((r&224)==192)e=2;else if((r&240)==224)e=3;else if((r&248)==240)e=4;else return 0;return n<e?n:0}}return 0}__name(incompleteUtf8Tail$1,`incompleteUtf8Tail`);var TextDecoderStream=class{#e;#t;constructor(e,t){if(this.#e=new TextDecoder(e,t),gr)this.#t=new TransformStream({transform:(e,t)=>{let n=toUint8Array$3(e),r=this.#e.decode(n,{stream:!0});r&&t.enqueue(r)},flush:e=>{let t=this.#e.decode();t&&e.enqueue(t)},cancel:()=>{this.#e.decode()}});else{let e=new Uint8Array;this.#t=new TransformStream({transform:(t,n)=>{let r=toUint8Array$3(t),i;e.length>0?(i=new Uint8Array(e.length+r.length),i.set(e,0),i.set(r,e.length)):i=r;let a=incompleteUtf8Tail$1(i),o;if(a>0?(o=i.slice(0,i.length-a),e=i.slice(i.length-a)):(o=i,e=new Uint8Array),o.length>0){let e=this.#e.decode(o);e&&n.enqueue(e)}},flush:t=>{if(e.length>0){let n=this.#e.decode(e);n&&t.enqueue(n),e=new Uint8Array}},cancel:()=>{e=new Uint8Array}})}}get encoding(){return this.#e.encoding}get fatal(){return this.#e.fatal}get ignoreBOM(){return this.#e.ignoreBOM}get readable(){return this.#t.readable}get writable(){return this.#t.writable}};function toUint8Array$3(e){if(e instanceof Uint8Array)return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw TypeError(`chunk must be a BufferSource`)}__name(toUint8Array$3,`toUint8Array`);function isNativeStreamUsable$3(e,t){try{return typeof e==`function`?typeof e.prototype?.[t]==`function`:!1}catch{return!1}}__name(isNativeStreamUsable$3,`isNativeStreamUsable`);const _r=isNativeStreamUsable$3(globalThis.ReadableStream,`getReader`)?globalThis.ReadableStream:ReadableStream$1,vr=isNativeStreamUsable$3(globalThis.WritableStream,`getWriter`)?globalThis.WritableStream:WritableStream,yr=isNativeStreamUsable$3(globalThis.TransformStream,`readable`)?globalThis.TransformStream:TransformStream,br=typeof globalThis.ByteLengthQueuingStrategy==`function`?globalThis.ByteLengthQueuingStrategy:ByteLengthQueuingStrategy,xr=typeof globalThis.CountQueuingStrategy==`function`?globalThis.CountQueuingStrategy:CountQueuingStrategy,Sr=typeof globalThis.TextEncoderStream==`function`?globalThis.TextEncoderStream:TextEncoderStream,Cr=typeof globalThis.TextDecoderStream==`function`?globalThis.TextDecoderStream:TextDecoderStream;var wr=__esmMin(()=>{L()});function _setPipeImpl(e){Tr=e}var Tr,Stream_,Er=__esmMin(()=>{yn(),Stream_=class extends Y{constructor(e){super(e)}pipe(e,t){return Tr(this,e,t)}}});function finished(e,t,n){let r;r=typeof t==`function`?t:n;let i=!1;function done(e){i||(i=!0,r(e))}let onFinish=()=>done(),onEnd=()=>done(),onError=e=>done(e),onClose=()=>{let t=e,n=e;!t.writableFinished&&!n.readableEnded&&done(Error(`premature close`))};e.on(`finish`,onFinish),e.on(`end`,onEnd),e.on(`error`,onError),e.on(`close`,onClose);let a=e,o=typeof e.write==`function`,s=typeof e.read==`function`,c=a.writableFinished===!0,l=a.readableEnded===!0;if(a.destroyed===!0){let e=a._err;ge(e?()=>done(e):o&&c||s&&l?()=>done():()=>done(Error(`premature close`)))}else (o&&!s&&c||!o&&s&&l||o&&s&&c&&l)&&ge(()=>done());return function cleanup(){e.removeListener(`finish`,onFinish),e.removeListener(`end`,onEnd),e.removeListener(`error`,onError),e.removeListener(`close`,onClose)}}function addAbortSignal(e,t){if(!(e instanceof AbortSignal))throw TypeError(`The first argument must be an AbortSignal`);if(!(t instanceof Stream_))throw TypeError(`The second argument must be a Stream`);let n=t;if(e.aborted)n.destroy(Error(`The operation was aborted`));else{let onAbort=()=>{n.destroy(Error(`The operation was aborted`))};e.addEventListener(`abort`,onAbort,{once:!0}),t.once(`close`,()=>{e.removeEventListener(`abort`,onAbort)})}return t}function isReadable(e){if(e==null)return!1;let t=e;return typeof t.readable!=`boolean`||typeof t.read!=`function`||t.destroyed===!0||t.readableEnded===!0?!1:t.readable===!0}function isWritable(e){if(e==null)return!1;let t=e;return typeof t.writable!=`boolean`||typeof t.write!=`function`||t.destroyed===!0||t.writableEnded===!0?!1:t.writable===!0}function isDestroyed(e){return e==null?!1:e.destroyed===!0}function isDisturbed(e){if(e==null)return!1;let t=e;return t.readableDidRead===!0||t.readableFlowing!==null&&t.readableFlowing!==void 0}function isErrored(e){if(e==null)return!1;let t=e;return t.destroyed===!0&&typeof t.readable==`boolean`&&t.readable===!1||t.destroyed===!0&&typeof t.writable==`boolean`&&t.writable===!1}var Dr=__esmMin(()=>{Er(),L()});function getDefaultHighWaterMark(e){return e?kr:Or}function setDefaultHighWaterMark(e,t){if(typeof t!=`number`||t<0||Number.isNaN(t))throw TypeError(`Invalid highWaterMark: ${t}`);e?kr=t:Or=t}function validateHighWaterMark(e,t){if(t!==void 0&&(typeof t!=`number`||Number.isNaN(t))){let n=TypeError(`The value of "${e}" is invalid. Received ${t}`);throw n.code=`ERR_INVALID_ARG_VALUE`,n}}var Or,kr,Ar=__esmMin(()=>{Or=16384,kr=16});function createAbortError(){let e=Error(`The operation was aborted`);return e.name=`AbortError`,e.code=`ABORT_ERR`,e}async function streamAsyncDispose(e,t){let n;e.destroyed||(n=t?void 0:createAbortError(),e.destroy(n)),await new Promise((t,r)=>{finished(e,e=>{e&&e!==n?r(e):t()})})}var jr,Mr=__esmMin(()=>{Dr(),jr=Symbol.asyncDispose??Symbol.for(`Symbol.asyncDispose`)});function chunkLength(e){if(e==null)return 1;let t=e.length;return typeof t==`number`?t:1}function sliceChunk(e,t,n){if(typeof e==`string`)return n===void 0?e.slice(t):e.slice(t,n);let r=e.slice;return typeof r==`function`?r.call(e,t,n):e}var Nr,Pr=__esmMin(()=>{Er(),Mr(),Ar(),L(),Nr=class Readable_ extends Stream_{readable=!0;readableFlowing=null;readableLength=0;readableHighWaterMark;readableEncoding;readableObjectMode;readableEnded=!1;readableAborted=!1;destroyed=!1;_pipeDests=[];_buffer=[];_readableState={ended:!1,endEmitted:!1,reading:!1,constructed:!0,highWaterMark:0,objectMode:!1,pipes:[]};_err;_readablePending=!1;_readImpl;_destroyImpl;_constructImpl;constructor(e){super(e),this.readableHighWaterMark=e?.highWaterMark??getDefaultHighWaterMark(e?.objectMode??!1),this.readableEncoding=e?.encoding??null,this.readableObjectMode=e?.objectMode??!1,this._readableState.highWaterMark=this.readableHighWaterMark,this._readableState.objectMode=this.readableObjectMode,e?.read&&(this._readImpl=e.read),e?.destroy&&(this._destroyImpl=e.destroy),e?.construct&&(this._constructImpl=e.construct),(this._constructImpl||this._construct!==Readable_.prototype._construct)&&(this._readableState.constructed=!1,nextTick(()=>{this._construct(e=>{this._readableState.constructed=!0,e?this.destroy(e):this.readableFlowing===!0&&this._flow()})}))}_construct(e){this._constructImpl?this._constructImpl.call(this,e):e()}_read(e){this._readImpl&&this._readImpl.call(this,e)}read(e){if(!this._readableState.constructed)return null;if(this._buffer.length===0){if(this._readableState.ended)return null;this._readableState.reading=!0,this._read(e??this.readableHighWaterMark),this._readableState.reading=!1}if(this._buffer.length===0||e===0)return null;if(this.readableObjectMode){if(e===void 0){let e=this._buffer.shift();return--this.readableLength,this._readableState.ended&&this._buffer.length===0&&!this._readableState.endEmitted&&this._emitEnd(),e}if(e>this.readableLength)return null;let t=this._buffer.shift();return--this.readableLength,t}if(e!=null)return e>this.readableLength?null:this._readBytes(e);let t=this._buffer.splice(0);if(this.readableLength=0,this._readableState.ended&&this._buffer.length===0&&!this._readableState.endEmitted&&this._emitEnd(),t.length===1)return t[0];if(t.length===0)return null;if(typeof t[0]==`string`)return t.join(``);let n=globalThis.Buffer;return n?.concat?n.concat(t):t}_readBytes(e){let t=0,n=[];for(;t<e&&this._buffer.length>0;){let r=this._buffer[0],i=chunkLength(r);if(t+i<=e)n.push(this._buffer.shift()),t+=i,this.readableLength-=i;else{let i=e-t;n.push(sliceChunk(r,0,i)),this._buffer[0]=sliceChunk(r,i),this.readableLength-=i,t+=i}}if(n.length===1)return n[0];let r=globalThis.Buffer;return r?.concat?r.concat(n):n}push(e,t){if(e===null)return this._readableState.ended=!0,this.readableEnded=!0,this._buffer.length===0&&!this._readableState.endEmitted&&nextTick(()=>this._emitEnd()),this._scheduleReadable(),!1;if(!this.readableObjectMode&&!(typeof e==`string`||ArrayBuffer.isView(e))){let t=Object.assign(TypeError(`Invalid non-string/buffer chunk type: ${typeof e}`),{code:`ERR_INVALID_ARG_TYPE`});return nextTick(()=>this.emit(`error`,t)),!1}return this._buffer.push(e),this.readableLength+=this.readableObjectMode?1:chunkLength(e),this.readableFlowing&&!this._flowing&&nextTick(()=>this._flow()),this.readableFlowing!==!0&&this._scheduleReadable(),this.readableLength<this.readableHighWaterMark}_emitEnd(){this._readableState.endEmitted||(this._readableState.endEmitted=!0,this.emit(`end`),nextTick(()=>this._autoClose()))}_autoClose(){this.emit(`close`)}_scheduleReadable(){this._readablePending||this.listenerCount(`readable`)===0||(this._readablePending=!0,nextTick(()=>{this._readablePending=!1,this.destroyed||this.emit(`readable`)}))}on(e,t){return super.on(e,t),e===`data`&&this.readableFlowing!==!1&&this.resume(),e===`readable`&&(this._buffer.length>0||this._readableState.ended)&&this._scheduleReadable(),this}unshift(e){this._buffer.unshift(e),this.readableLength+=this.readableObjectMode?1:chunkLength(e)}setEncoding(e){return this.readableEncoding=e,this}pause(){return this.readableFlowing=!1,this.emit(`pause`),this}resume(){return this.readableFlowing!==!0&&(this.readableFlowing=!0,this.emit(`resume`),this._readableState.constructed&&this._flow()),this}_flowing=!1;_flow(){if(!(this.readableFlowing!==!0||this._flowing||this.destroyed)&&this._readableState.constructed){this._flowing=!0;try{for(;this._buffer.length>0&&this.readableFlowing&&!this.destroyed;){let e=this._buffer.shift();if(this.readableLength-=this.readableObjectMode?1:chunkLength(e),this.readableEncoding&&typeof e!=`string`){let t=globalThis.Buffer;t?.isBuffer&&t.isBuffer(e)?e=e.toString(this.readableEncoding):e instanceof Uint8Array&&(e=new TextDecoder(this.readableEncoding).decode(e))}this.emit(`data`,e)}if(this.destroyed)return;if(this._readableState.ended&&this._buffer.length===0&&!this._readableState.endEmitted){nextTick(()=>this._emitEnd());return}!this._readableState.ended&&!this._readableState.reading&&!this.destroyed&&(this._readableState.reading=!0,this._read(this.readableHighWaterMark),this._readableState.reading=!1)}finally{this._flowing=!1}this._buffer.length>0&&this.readableFlowing&&!this.destroyed&&nextTick(()=>this._flow())}}isPaused(){return this.readableFlowing===!1}unpipe(e){if(e){let t=this._pipeDests.findIndex(t=>t.dest===e);if(t!==-1){this._pipeDests[t].cleanup(),this._pipeDests.splice(t,1);let n=this._readableState.pipes.indexOf(e);n!==-1&&this._readableState.pipes.splice(n,1),e.emit(`unpipe`,this),this._pipeDests.length===0&&(this.readableFlowing=!1)}}else{for(let e of this._pipeDests)e.cleanup(),e.dest.emit(`unpipe`,this);this._pipeDests=[],this._readableState.pipes=[],this.readableFlowing=!1}return this}_destroy(e,t){this._destroyImpl?this._destroyImpl.call(this,e,t):t(e??void 0)}destroy(e){if(this.destroyed)return this;this.destroyed=!0,this.readable=!1,this.readableAborted=!this.readableEnded,e&&(this._err=e);let cb=e=>{e&&nextTick(()=>this.emit(`error`,e)),nextTick(()=>this.emit(`close`))};return Object.prototype.hasOwnProperty.call(this,`_destroy`)?this._destroy(e??null,cb):this._destroyImpl?this._destroyImpl.call(this,e??null,cb):cb(e),this}static toWeb(e){return new ReadableStream({start(t){e.on(`data`,e=>{typeof e==`string`?t.enqueue(new TextEncoder().encode(e)):e instanceof Uint8Array?t.enqueue(e):e&&typeof e.length==`number`&&t.enqueue(new Uint8Array(e))}),e.on(`end`,()=>{t.close()}),e.on(`error`,e=>{t.error(e)})},cancel(){e.destroy()}})}static fromWeb(e,t){let n=e.getReader();return new Readable_({...t,read(){n.read().then(({done:e,value:t})=>{e?this.push(null):this.push(t)},e=>{this.destroy(e)})},destroy(e,t){n.cancel(e?.message).then(()=>t(null),t)}})}[Symbol.asyncIterator](){let e=this,t=[],n=!1,r=null,i=null,a=null;return e.on(`data`,e=>{if(i){let t=i;i=null,a=null,t({value:e,done:!1})}else t.push(e)}),e.on(`end`,()=>{if(n=!0,i){let e=i;i=null,a=null,e({value:void 0,done:!0})}}),e.on(`error`,e=>{if(r=e,n=!0,a){let t=a;i=null,a=null,t(e)}}),{next(){return r?Promise.reject(r):t.length>0?Promise.resolve({value:t.shift(),done:!1}):n?Promise.resolve({value:void 0,done:!0}):new Promise((e,t)=>{i=e,a=t})},return(){return e.destroy(),Promise.resolve({value:void 0,done:!0})},[Symbol.asyncIterator](){return this}}}static from(e,t){let n=new Readable_({objectMode:!0,...t,read(){}});return typeof e==`string`||ArrayBuffer.isView(e)?(n.push(e),n.push(null),n):((async()=>{try{for await(let t of e)n.push(t)||await new Promise(e=>n.once(`drain`,e));n.push(null)}catch(e){n.destroy(e)}})(),n)}},Nr.prototype[jr]=function(){return streamAsyncDispose(this,this.readableEnded)}});function chunkLen$1(e){if(e==null)return 1;let t=e.length;return typeof t==`number`?t:1}var Duplex_,Fr=__esmMin(()=>{Ar(),Pr(),L(),Duplex_=class extends Nr{writable=!0;writableHighWaterMark;writableLength=0;writableObjectMode;writableEnded=!1;writableFinished=!1;writableCorked=0;writableNeedDrain=!1;allowHalfOpen;_decodeStrings;_writableState={highWaterMark:0,objectMode:!1};_duplexCorkedBuffer=[];_duplexWriting=!1;_duplexWriteQueue=[];_writeImpl;_finalImpl;_defaultEncoding=`utf8`;_pendingWrites=0;_pendingEndCb=null;constructor(e){super(e),validateHighWaterMark(`writableHighWaterMark`,e?.writableHighWaterMark),validateHighWaterMark(`readableHighWaterMark`,e?.readableHighWaterMark),this.writableObjectMode=e?.writableObjectMode??e?.objectMode??!1,this.writableHighWaterMark=e?.highWaterMark??e?.writableHighWaterMark??getDefaultHighWaterMark(this.writableObjectMode),this._writableState.highWaterMark=this.writableHighWaterMark,this._writableState.objectMode=this.writableObjectMode,e?.highWaterMark===void 0&&e?.readableHighWaterMark!==void 0&&(this.readableHighWaterMark=e.readableHighWaterMark,this._readableState.highWaterMark=e.readableHighWaterMark),e?.readableObjectMode!==void 0&&(this.readableObjectMode=e.readableObjectMode,this._readableState.objectMode=e.readableObjectMode,e?.readableHighWaterMark===void 0&&e?.highWaterMark===void 0&&(this.readableHighWaterMark=getDefaultHighWaterMark(e.readableObjectMode),this._readableState.highWaterMark=this.readableHighWaterMark)),this.allowHalfOpen=e?.allowHalfOpen!==!1,this._decodeStrings=e?.decodeStrings!==!1,e?.write&&(this._writeImpl=e.write),e?.final&&(this._finalImpl=e.final),this.allowHalfOpen||this.once(`end`,()=>{this.writableEnded||nextTick(()=>this.end())})}_write(e,t,n){this._writeImpl?this._writeImpl.call(this,e,t,n):n()}_final(e){this._finalImpl?this._finalImpl.call(this,e):e()}destroy(e){return this.destroyed?this:(this.writable=!1,super.destroy(e))}write(e,t,n){let r,i;if(typeof t==`function`?(r=t,i=this._defaultEncoding):(i=t??this._defaultEncoding,r=n??(()=>{})),this._decodeStrings&&!this.writableObjectMode&&typeof e==`string`){let t=globalThis.Buffer;t&&(e=t.from(e,i),i=`buffer`)}if(typeof e!=`string`&&!this.writableObjectMode){let t=globalThis.Buffer;(t&&t.isBuffer(e)||e instanceof Uint8Array)&&(i=`buffer`)}if(this.writableEnded){let e=Error(`write after end`);return nextTick(()=>{r(e),this.emit(`error`,e)}),!1}if(this.writableLength+=this.writableObjectMode?1:chunkLen$1(e),this.writableCorked>0)return this._duplexCorkedBuffer.push({chunk:e,encoding:i,callback:r}),this.writableLength<this.writableHighWaterMark;let a=this.writableLength<this.writableHighWaterMark;return a||(this.writableNeedDrain=!0),this._duplexDoWrite(e,i,r),a}_duplexDoWrite(e,t,n){if(this._duplexWriting){this._duplexWriteQueue.push({chunk:e,encoding:t,callback:n});return}this._duplexWriting=!0,this._duplexStartWrite(e,t,n)}_duplexStartWrite(e,t,n){this._pendingWrites++,this._write(e,t,t=>{this._pendingWrites--,this.writableLength-=this.writableObjectMode?1:chunkLen$1(e),nextTick(t?()=>{if(n(t),this._duplexWriting=!1,this.emit(`error`,t),this._duplexWriteQueue.length>0){let e=this._duplexWriteQueue.shift();this._duplexWriting=!0,this._duplexStartWrite(e.chunk,e.encoding,e.callback)}}:()=>{if(n(),this._duplexWriteQueue.length>0){let e=this._duplexWriteQueue.shift();this._duplexStartWrite(e.chunk,e.encoding,e.callback);return}if(this._duplexWriting=!1,this.writableNeedDrain&&this.writableLength<=this.writableHighWaterMark&&(this.writableNeedDrain=!1,this.emit(`drain`)),this._pendingWrites===0&&this._pendingEndCb){let e=this._pendingEndCb;this._pendingEndCb=null,e()}})})}end(e,t,n){typeof e==`function`&&(n=e,e=void 0),typeof t==`function`&&(n=t,t=void 0),e!=null&&this.write(e,t),this.writableEnded=!0;let doFinal=()=>{this._final(e=>{this.writableFinished=!0,this._doPrefinishHooks(()=>{nextTick(()=>{e&&this.emit(`error`,e),this.emit(`finish`),nextTick(()=>this.emit(`close`)),n&&n()})})})};return this._pendingWrites>0||this._duplexWriting||this._duplexWriteQueue.length>0?this._pendingEndCb=doFinal:doFinal(),this}_doPrefinishHooks(e){e()}cork(){this.writableCorked++}uncork(){if(this.writableCorked>0&&(this.writableCorked--,this.writableCorked===0&&this._duplexCorkedBuffer.length>0)){let e=this._duplexCorkedBuffer.splice(0);for(let{chunk:t,encoding:n,callback:r}of e)this._write(t,n,e=>{this.writableLength-=this.writableObjectMode?1:chunkLen$1(t),e?(r(e),this.emit(`error`,e)):r()});this.writableNeedDrain&&this.writableLength<=this.writableHighWaterMark&&(this.writableNeedDrain=!1,nextTick(()=>this.emit(`drain`)))}}setDefaultEncoding(e){return this._defaultEncoding=e,this}},__name(chunkLen$1,`chunkLen`)});function pipe(e,t,n){let r=e,i=n?.end!==!1,a=!1,ondrain=()=>{a=!1,t.removeListener(`drain`,ondrain);let e=r;typeof e.resume==`function`&&e.resume()},ondata=e=>{if(t.writable){let n=r;t.write(e)===!1&&typeof n.pause==`function`&&(n.pause(),a||(a=!0,t.on(`drain`,ondrain)))}};r.on(`data`,ondata);let o=!1,onend=()=>{o||(o=!0,i&&t.end())},onclose=()=>{if(!o&&(o=!0,i&&!(r instanceof Nr))){let e=t;typeof e.destroy==`function`&&e.destroy()}};i&&(r.on(`end`,onend),r.on(`close`,onclose));let cleanup=()=>{r.removeListener(`data`,ondata),a&&t.removeListener(`drain`,ondrain),r.removeListener(`end`,onend),r.removeListener(`close`,onclose),r.removeListener(`end`,cleanup),r.removeListener(`close`,cleanup),t.removeListener(`close`,cleanup)};return r.on(`end`,cleanup),r.on(`close`,cleanup),t.on(`close`,cleanup),r instanceof Nr&&(r._pipeDests.push({dest:t,cleanup}),r._readableState.pipes.push(t)),t.emit(`pipe`,r),t}var Ir=__esmMin(()=>{Er(),Pr(),_setPipeImpl(pipe)});function chunkLen(e){if(e==null)return 1;let t=e.length;return typeof t==`number`?t:1}var Lr,Rr=__esmMin(()=>{Er(),Mr(),Ar(),L(),Lr=class Writable_ extends Stream_{static[Symbol.hasInstance](e){let t=this;return t.prototype!==void 0&&Object.prototype.isPrototypeOf.call(t.prototype,e)?!0:t.prototype!==Writable_.prototype||e==null?!1:typeof e.writableHighWaterMark==`number`}writable=!0;writableHighWaterMark;writableLength=0;writableObjectMode;writableEnded=!1;writableFinished=!1;writableCorked=0;writableNeedDrain=!1;destroyed=!1;_err;_writableState={ended:!1,finished:!1,constructed:!0,writing:!1};_corkedBuffer=[];_writeBuffer=[];_pendingConstruct=[];_ending=!1;_endCallback;_pendingEnd=null;_writeImpl;_writev;_finalImpl;_destroyImpl;_constructImpl;_decodeStrings;_defaultEncoding=`utf8`;constructor(e){super(e),this.writableHighWaterMark=e?.highWaterMark??getDefaultHighWaterMark(e?.objectMode??!1),this.writableObjectMode=e?.objectMode??!1,this._decodeStrings=e?.decodeStrings!==!1,e?.write&&(this._writeImpl=e.write),e?.writev&&(this._writev=e.writev),e?.final&&(this._finalImpl=e.final),e?.destroy&&(this._destroyImpl=e.destroy),e?.construct&&(this._constructImpl=e.construct),(this._constructImpl||this._construct!==Writable_.prototype._construct)&&(this._writableState.constructed=!1,nextTick(()=>{this._construct(e=>{this._writableState.constructed=!0,e?this.destroy(e):this._maybeFlush()})}))}_construct(e){this._constructImpl?this._constructImpl.call(this,e):e()}_write(e,t,n){this._writeImpl?this._writeImpl.call(this,e,t,n):n()}_final(e){this._finalImpl?this._finalImpl.call(this,e):e()}_destroy(e,t){this._destroyImpl?this._destroyImpl.call(this,e,t):t(e)}_maybeFlush(){let e=this._pendingConstruct.splice(0);if(e.length>0){let[t,...n]=e;this._writeBuffer.push(...n),this._doWrite(t.chunk,t.encoding,t.callback)}if(this._pendingEnd){let{chunk:e,encoding:t,callback:n}=this._pendingEnd;this._pendingEnd=null,this._doEnd(e,t,n)}}_doWrite(e,t,n){this._writableState.writing=!0;let r=!0;this._write(e,t,t=>{if(this.writableLength-=this.writableObjectMode?1:chunkLen(e),r){nextTick(()=>{if(t){n(t),this.emit(`error`,t);return}n(),this.writableNeedDrain&&this.writableLength<=this.writableHighWaterMark&&(this.writableNeedDrain=!1,this.emit(`drain`))}),t||this._drainWriteBuffer();return}nextTick(t?()=>{n(t),this.emit(`error`,t),this._drainWriteBuffer()}:()=>{n(),this.writableNeedDrain&&this.writableLength<=this.writableHighWaterMark&&(this.writableNeedDrain=!1,this.emit(`drain`)),this._drainWriteBuffer()})}),r=!1}_drainWriteBuffer(){if(this._writeBuffer.length>0){let e=this._writeBuffer.shift();this._doWrite(e.chunk,e.encoding,e.callback)}else this._writableState.writing=!1,this._maybeFinish()}_maybeFinish(){!this._ending||this._writableState.finished||this._writableState.writing||this._writeBuffer.length>0||(this._ending=!1,this._final(e=>{this.writableFinished=!0,this._writableState.finished=!0,nextTick(()=>{e&&this.emit(`error`,e),this.emit(`finish`),nextTick(()=>this.emit(`close`)),this._endCallback&&this._endCallback()})}))}write(e,t,n){let r,i;if(typeof t==`function`?(r=t,i=this._defaultEncoding):(i=t??this._defaultEncoding,r=n??(()=>{})),this._decodeStrings&&!this.writableObjectMode&&typeof e==`string`){let t=globalThis.Buffer;t&&(e=t.from(e,i),i=`buffer`)}if(typeof e!=`string`&&!this.writableObjectMode){let t=globalThis.Buffer;(t&&t.isBuffer(e)||e instanceof Uint8Array)&&(i=`buffer`)}if(this.writableEnded){let e=Error(`write after end`);return nextTick(()=>{r(e),this.emit(`error`,e)}),!1}if(this.writableLength+=this.writableObjectMode?1:chunkLen(e),this.writableCorked>0)return this._corkedBuffer.push({chunk:e,encoding:i,callback:r}),this.writableLength<this.writableHighWaterMark;if(!this._writableState.constructed)return this._pendingConstruct.push({chunk:e,encoding:i,callback:r}),this.writableLength<this.writableHighWaterMark;let a=this.writableLength<this.writableHighWaterMark;return a||(this.writableNeedDrain=!0),this._writableState.writing?this._writeBuffer.push({chunk:e,encoding:i,callback:r}):this._doWrite(e,i,r),a}_doEnd(e,t,n){e!=null&&this.write(e,t),this.writableEnded=!0,this._writableState.ended=!0,this._ending=!0,this._endCallback=n,this._maybeFinish()}end(e,t,n){return typeof e==`function`&&(n=e,e=void 0),typeof t==`function`&&(n=t,t=void 0),this.writableEnded?(n&&nextTick(n),this):this._writableState.constructed?(this._doEnd(e,t,n),this):(this._pendingEnd={chunk:e,encoding:t,callback:n},this)}cork(){this.writableCorked++}uncork(){this.writableCorked>0&&(this.writableCorked--,this.writableCorked===0&&this._corkedBuffer.length>0&&this._flushCorkedBuffer())}_flushCorkedBuffer(){if(this._writev&&this._corkedBuffer.length>1){let e=this._corkedBuffer.splice(0),t=e.map(e=>({chunk:e.chunk,encoding:e.encoding}));this._writev.call(this,t,t=>{for(let t of e)this.writableLength-=this.writableObjectMode?1:chunkLen(t.chunk);if(t){for(let n of e)n.callback(t);this.emit(`error`,t)}else{for(let t of e)t.callback();this.writableNeedDrain&&this.writableLength<=this.writableHighWaterMark&&(this.writableNeedDrain=!1,this.emit(`drain`))}})}else{let e=this._corkedBuffer.splice(0);if(e.length>0){let[t,...n]=e;this._writeBuffer.push(...n),this._doWrite(t.chunk,t.encoding,t.callback)}}}setDefaultEncoding(e){return this._defaultEncoding=e,this}destroy(e){if(this.destroyed)return this;this.destroyed=!0,this.writable=!1,e&&(this._err=e);let cb=e=>{e&&nextTick(()=>this.emit(`error`,e)),nextTick(()=>this.emit(`close`))};return this._destroy(e??null,cb),this}},Lr.prototype[jr]=function(){return streamAsyncDispose(this,this.writableFinished)}}),zr,Br=__esmMin(()=>{Fr(),L(),zr=class Transform_ extends Duplex_{constructor(e){super({...e,write:void 0,final:void 0});let t=this;e?.transform&&(t._transform=e.transform),e?.flush&&(t._flush=e.flush),e?.final&&(t._final=e.final)}_transform(e,t,n){throw Object.assign(Error(`The _transform() method is not implemented`),{code:`ERR_METHOD_NOT_IMPLEMENTED`})}_flush(e){e()}_write(e,t,n){let r=!1;try{this._transform(e,t,(e,t)=>{if(r){let e=Object.assign(Error(`Callback called multiple times`),{code:`ERR_MULTIPLE_CALLBACK`});nextTick(()=>this.emit(`error`,e));return}if(r=!0,e){n(e);return}t!=null&&this.push(t),n()})}catch(e){if(e?.code===`ERR_METHOD_NOT_IMPLEMENTED`)throw e;n(e)}}_final(e){this._flush((t,n)=>{if(t){e(t);return}n!=null&&this.push(n),this.push(null),e()})}_doPrefinishHooks(e){let t=Transform_.prototype._final;this._final===t?e():t.call(this,e)}}}),PassThrough_,Vr=__esmMin(()=>{Br(),PassThrough_=class extends zr{constructor(e){super({...e,transform(e,t,n){n(null,e)}})}}});function pipeline(...e){let t=e,n=typeof t[t.length-1]==`function`?t.pop():void 0,r=t;if(r.length<2)throw Error(`pipeline requires at least 2 streams`);let i=null;function onError(e){if(!i){i=e;for(let e of r)typeof e.destroy==`function`&&e.destroy();n&&n(e)}}let a=r[0];for(let e=1;e<r.length;e++){let t=r[e];a.pipe(t),a.on(`error`,onError),a=t}let o=r[r.length-1];return o.on(`error`,onError),o.on(`finish`,()=>{n&&!i&&n(null)}),o}var Hr=__esmMin(()=>{}),Ur=__exportAll$4({Duplex:()=>qr,PassThrough:()=>Yr,Readable:()=>Gr,Stream:()=>Wr,Transform:()=>Jr,Writable:()=>Kr,addAbortSignal:()=>addAbortSignal,default:()=>Xr,finished:()=>finished,getDefaultHighWaterMark:()=>getDefaultHighWaterMark,isDestroyed:()=>isDestroyed,isDisturbed:()=>isDisturbed,isErrored:()=>isErrored,isReadable:()=>isReadable,isWritable:()=>isWritable,pipeline:()=>pipeline,setDefaultHighWaterMark:()=>setDefaultHighWaterMark}),Wr,Gr,Kr,qr,Jr,Yr,Xr,Zr=__esmMin(()=>{wr(),Er(),Dr(),Ar(),Pr(),Fr(),Ir(),Rr(),Br(),Vr(),Hr(),Wr=makeCallable(Stream_),Gr=makeCallable(Nr),Kr=makeCallable(Lr),qr=makeCallable(Duplex_),Jr=makeCallable(zr),Yr=makeCallable(PassThrough_),Xr=Object.assign(Wr,{Stream:Wr,Readable:Gr,Writable:Kr,Duplex:qr,Transform:Jr,PassThrough:Yr,pipeline,finished,addAbortSignal,isReadable,isWritable,isDestroyed,isDisturbed,isErrored,getDefaultHighWaterMark,setDefaultHighWaterMark})});function getGioCompressorFormat(e){switch(e){case`gzip`:return M.ZlibCompressorFormat.GZIP;case`deflate`:return M.ZlibCompressorFormat.ZLIB;case`deflate-raw`:return M.ZlibCompressorFormat.RAW}}function toUint8Array$2(e){return typeof e==`string`?new TextEncoder().encode(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}function concat(e){let t=e.reduce((e,t)=>e+t.length,0),n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.length;return n}function compressWithGio$1(e,t){let n=new M.ZlibCompressor({format:getGioCompressorFormat(t)}),r=new M.ConverterOutputStream({base_stream:M.MemoryOutputStream.new_resizable(),converter:n});r.write_bytes(new k.Bytes(e),null),r.close(null);let i=r.get_base_stream().steal_as_bytes();return new Uint8Array(i.get_data()??[])}function decompressMemberWithGio(e,t){let n=new M.ZlibDecompressor({format:getGioCompressorFormat(t)}),r=M.MemoryInputStream.new_from_bytes(new k.Bytes(e)),i=new M.ConverterInputStream({base_stream:r,converter:n}),a=[];for(;;){let e=i.read_bytes(4096,null);if(e.get_size()===0)break;a.push(new Uint8Array(e.get_data()))}return i.close(null),concat(a)}function findGzipMemberEnd$1(e){let t=new M.ZlibDecompressor({format:M.ZlibCompressorFormat.GZIP}),n=new Uint8Array(65536),r=0,i=!1;for(;!i;){let a=e.subarray(r);try{let[e,o]=t.convert(a,n,M.ConverterFlags.NONE);r+=o,e===M.ConverterResult.FINISHED&&(i=!0)}catch{i=!0}}return r}function gunzipWithGio(e){let t=[],n=0;for(;n<e.length&&!(e.length-n<2||e[n]!==31||e[n+1]!==139);){let r=e.subarray(n),i=findGzipMemberEnd$1(r);if(i<=0)break;t.push(decompressMemberWithGio(r.subarray(0,i),`gzip`)),n+=i}return t.length===0?decompressMemberWithGio(e,`gzip`):concat(t)}function createGzip(e){return new Gzip(e)}function createGunzip(e){return new Gunzip(e)}function createDeflate(e){return new Deflate(e)}function createInflate(e){return new Inflate(e)}function createDeflateRaw(e){return new DeflateRaw(e)}function createInflateRaw(e){return new InflateRaw(e)}function createUnzip(e){return new Unzip(e)}function createBrotliCompress(e){throw Error(`createBrotliCompress is not supported on GJS (no Brotli in GLib)`)}function createBrotliDecompress(e){throw Error(`createBrotliDecompress is not supported on GJS (no Brotli in GLib)`)}function createZstdCompress(e){let t=Error(`createZstdCompress is not supported on GJS (no Zstd in GLib)`);throw t.code=`ERR_UNSUPPORTED_OPERATION`,t}function createZstdDecompress(e){let t=Error(`createZstdDecompress is not supported on GJS (no Zstd in GLib)`);throw t.code=`ERR_UNSUPPORTED_OPERATION`,t}var ZlibBase,Gzip,Gunzip,Deflate,Inflate,DeflateRaw,InflateRaw,Unzip,BrotliCompress,BrotliDecompress,ZstdCompress,ZstdDecompress,Qr=__esmMin(()=>{N(),A(),Zr(),__name(toUint8Array$2,`toUint8Array`),__name(compressWithGio$1,`compressWithGio`),__name(findGzipMemberEnd$1,`findGzipMemberEnd`),ZlibBase=class extends Jr{_mode;_chunks=[];constructor(e,t){super(t),this._mode=e}_transform(e,t,n){this._chunks.push(toUint8Array$2(e)),n()}_flush(e){let t=concat(this._chunks);this._chunks=[];try{this.push(Buffer.from(this._run(t))),e()}catch(t){e(t instanceof Error?t:Error(String(t)))}}_run(e){let t=this._mode;switch(t.kind){case`compress`:return compressWithGio$1(e,t.format);case`decompress`:return decompressMemberWithGio(e,t.format);case`gunzip`:return gunzipWithGio(e);case`unzip`:return e.length>=2&&e[0]===31&&e[1]===139?gunzipWithGio(e):decompressMemberWithGio(e,`deflate`)}}},Gzip=class extends ZlibBase{constructor(e){super({kind:`compress`,format:`gzip`},e)}},Gunzip=class extends ZlibBase{constructor(e){super({kind:`gunzip`},e)}},Deflate=class extends ZlibBase{constructor(e){super({kind:`compress`,format:`deflate`},e)}},Inflate=class extends ZlibBase{constructor(e){super({kind:`decompress`,format:`deflate`},e)}},DeflateRaw=class extends ZlibBase{constructor(e){super({kind:`compress`,format:`deflate-raw`},e)}},InflateRaw=class extends ZlibBase{constructor(e){super({kind:`decompress`,format:`deflate-raw`},e)}},Unzip=class extends ZlibBase{constructor(e){super({kind:`unzip`},e)}},BrotliCompress=class extends Jr{constructor(){throw super(),Error(`BrotliCompress is not supported on GJS (no Brotli in GLib)`)}},BrotliDecompress=class extends Jr{constructor(){throw super(),Error(`BrotliDecompress is not supported on GJS (no Brotli in GLib)`)}},ZstdCompress=class extends Jr{constructor(){super();let e=Error(`ZstdCompress is not supported on GJS (no Zstd in GLib)`);throw e.code=`ERR_UNSUPPORTED_OPERATION`,e}},ZstdDecompress=class extends Jr{constructor(){super();let e=Error(`ZstdDecompress is not supported on GJS (no Zstd in GLib)`);throw e.code=`ERR_UNSUPPORTED_OPERATION`,e}}}),$r=__exportAll$4({BrotliCompress:()=>BrotliCompress,BrotliDecompress:()=>BrotliDecompress,Deflate:()=>Deflate,DeflateRaw:()=>DeflateRaw,Gunzip:()=>Gunzip,Gzip:()=>Gzip,Inflate:()=>Inflate,InflateRaw:()=>InflateRaw,Unzip:()=>Unzip,ZlibTransform:()=>ZlibBase,ZstdCompress:()=>ZstdCompress,ZstdDecompress:()=>ZstdDecompress,brotliCompress:()=>brotliCompress,brotliCompressSync:()=>brotliCompressSync,brotliDecompress:()=>brotliDecompress,brotliDecompressSync:()=>brotliDecompressSync,constants:()=>ni,createBrotliCompress:()=>createBrotliCompress,createBrotliDecompress:()=>createBrotliDecompress,createDeflate:()=>createDeflate,createDeflateRaw:()=>createDeflateRaw,createGunzip:()=>createGunzip,createGzip:()=>createGzip,createInflate:()=>createInflate,createInflateRaw:()=>createInflateRaw,createUnzip:()=>createUnzip,createZstdCompress:()=>createZstdCompress,createZstdDecompress:()=>createZstdDecompress,default:()=>ri,deflate:()=>deflate,deflateRaw:()=>deflateRaw,deflateRawSync:()=>deflateRawSync,deflateSync:()=>deflateSync,gunzip:()=>gunzip,gunzipSync:()=>gunzipSync,gzip:()=>gzip,gzipSync:()=>gzipSync,inflate:()=>inflate,inflateRaw:()=>inflateRaw,inflateRawSync:()=>inflateRawSync,inflateSync:()=>inflateSync,zstdCompress:()=>zstdCompress,zstdCompressSync:()=>zstdCompressSync,zstdDecompress:()=>zstdDecompress,zstdDecompressSync:()=>zstdDecompressSync});function getGioFormat(e){switch(e){case`gzip`:return M.ZlibCompressorFormat.GZIP;case`deflate`:return M.ZlibCompressorFormat.ZLIB;case`deflate-raw`:return M.ZlibCompressorFormat.RAW}}function compressWithGio(e,t){let n=new M.ZlibCompressor({format:getGioFormat(t)}),r=new M.ConverterOutputStream({base_stream:M.MemoryOutputStream.new_resizable(),converter:n});r.write_bytes(new k.Bytes(e),null),r.close(null);let i=r.get_base_stream().steal_as_bytes();return new Uint8Array(i.get_data()??[])}function decompressStreamWithGio(e,t){let n=new M.ZlibDecompressor({format:getGioFormat(t)}),r=M.MemoryInputStream.new_from_bytes(new k.Bytes(e)),i=new M.ConverterInputStream({base_stream:r,converter:n}),a=[];for(;;){let e=i.read_bytes(4096,null);if(e.get_size()===0)break;a.push(new Uint8Array(e.get_data()))}i.close(null);let o=a.reduce((e,t)=>e+t.length,0),s=new Uint8Array(o),c=0;for(let e of a)s.set(e,c),c+=e.length;return s}function findGzipMemberEnd(e){let t=new M.ZlibDecompressor({format:M.ZlibCompressorFormat.GZIP}),n=new Uint8Array(65536),r=0,i=!1;for(;!i;){let a=e.subarray(r);try{let[e,o]=t.convert(a,n,M.ConverterFlags.NONE);r+=o,e===M.ConverterResult.FINISHED&&(i=!0)}catch{i=!0}}return r}function decompressWithGio(e,t){if(t!==`gzip`)return decompressStreamWithGio(e,t);let n=[],r=0;for(;r<e.length&&!(e.length-r<2||e[r]!==31||e[r+1]!==139);){let t=e.subarray(r),i=findGzipMemberEnd(t);if(i<=0)break;let a=decompressStreamWithGio(t.subarray(0,i),`gzip`);n.push(a),r+=i}if(n.length===0)return decompressStreamWithGio(e,`gzip`);let i=n.reduce((e,t)=>e+t.length,0),a=new Uint8Array(i),o=0;for(let e of n)a.set(e,o),o+=e.length;return a}async function runWebTransform(e,t){let n=new ReadableStream({start(t){t.enqueue(new Uint8Array(e.buffer,e.byteOffset,e.byteLength)),t.close()}}),r=[],i=n.pipeThrough(t).getReader();for(;;){let{done:e,value:t}=await i.read();if(e)break;r.push(t)}let a=r.reduce((e,t)=>e+t.length,0),o=new Uint8Array(a),s=0;for(let e of r)o.set(e,s),s+=e.length;return o}async function compressWithWeb(e,t){return runWebTransform(e,new CompressionStream(t))}async function decompressWithWeb(e,t){return runWebTransform(e,new DecompressionStream(t))}async function compress(e,t){return ei?compressWithWeb(e,t):compressWithGio(e,t)}async function decompress(e,t){return ei?decompressWithWeb(e,t):decompressWithGio(e,t)}function toUint8Array$1(e){return typeof e==`string`?new TextEncoder().encode(e):e instanceof ArrayBuffer?new Uint8Array(e):e}function gzip(e,t,n){let r=typeof t==`function`?t:n;compress(toUint8Array$1(e),`gzip`).then(e=>r(null,e),e=>r(e instanceof Error?e:Error(String(e)),new Uint8Array))}function gunzip(e,t,n){let r=typeof t==`function`?t:n;decompress(toUint8Array$1(e),`gzip`).then(e=>r(null,e),e=>r(e instanceof Error?e:Error(String(e)),new Uint8Array))}function deflate(e,t,n){let r=typeof t==`function`?t:n;compress(toUint8Array$1(e),`deflate`).then(e=>r(null,e),e=>r(e instanceof Error?e:Error(String(e)),new Uint8Array))}function inflate(e,t,n){let r=typeof t==`function`?t:n;decompress(toUint8Array$1(e),`deflate`).then(e=>r(null,e),e=>r(e instanceof Error?e:Error(String(e)),new Uint8Array))}function deflateRaw(e,t,n){let r=typeof t==`function`?t:n;compress(toUint8Array$1(e),`deflate-raw`).then(e=>r(null,e),e=>r(e instanceof Error?e:Error(String(e)),new Uint8Array))}function inflateRaw(e,t,n){let r=typeof t==`function`?t:n;decompress(toUint8Array$1(e),`deflate-raw`).then(e=>r(null,e),e=>r(e instanceof Error?e:Error(String(e)),new Uint8Array))}function gzipSync(e,t){return compressWithGio(toUint8Array$1(e),`gzip`)}function gunzipSync(e,t){return decompressWithGio(toUint8Array$1(e),`gzip`)}function deflateSync(e,t){return compressWithGio(toUint8Array$1(e),`deflate`)}function inflateSync(e,t){return decompressWithGio(toUint8Array$1(e),`deflate`)}function deflateRawSync(e,t){return compressWithGio(toUint8Array$1(e),`deflate-raw`)}function inflateRawSync(e,t){return decompressWithGio(toUint8Array$1(e),`deflate-raw`)}function brotliCompress(e,t,n){(typeof t==`function`?t:n)(Error(`brotliCompress: Brotli is not supported in this environment`),ti)}function brotliDecompress(e,t,n){(typeof t==`function`?t:n)(Error(`brotliDecompress: Brotli is not supported in this environment`),ti)}function brotliCompressSync(e,t){throw Error(`brotliCompressSync: Brotli is not supported in this environment`)}function brotliDecompressSync(e,t){throw Error(`brotliDecompressSync: Brotli is not supported in this environment`)}function zstdCompress(e,t,n){let r=typeof t==`function`?t:n,i=Error(`zstdCompress: Zstd is not supported in this environment`);i.code=`ERR_UNSUPPORTED_OPERATION`,r(i,ti)}function zstdDecompress(e,t,n){let r=typeof t==`function`?t:n,i=Error(`zstdDecompress: Zstd is not supported in this environment`);i.code=`ERR_UNSUPPORTED_OPERATION`,r(i,ti)}function zstdCompressSync(e,t){let n=Error(`zstdCompressSync: Zstd is not supported in this environment`);throw n.code=`ERR_UNSUPPORTED_OPERATION`,n}function zstdDecompressSync(e,t){let n=Error(`zstdDecompressSync: Zstd is not supported in this environment`);throw n.code=`ERR_UNSUPPORTED_OPERATION`,n}var ei,ti,ni,ri,ii=__esmMin(()=>{Qr(),N(),A(),ei=globalThis.CompressionStream!==void 0,__name(toUint8Array$1,`toUint8Array`),ti=new Uint8Array,ni={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_VERSION_ERROR:-6,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_DEFLATED:8},ri={gzip,gunzip,deflate,inflate,deflateRaw,inflateRaw,gzipSync,gunzipSync,deflateSync,inflateSync,deflateRawSync,inflateRawSync,brotliCompress,brotliDecompress,brotliCompressSync,brotliDecompressSync,zstdCompress,zstdDecompress,zstdCompressSync,zstdDecompressSync,Gzip,Gunzip,Deflate,Inflate,DeflateRaw,InflateRaw,Unzip,BrotliCompress,BrotliDecompress,ZstdCompress,ZstdDecompress,createGzip,createGunzip,createDeflate,createInflate,createDeflateRaw,createInflateRaw,createUnzip,createBrotliCompress,createBrotliDecompress,createZstdCompress,createZstdDecompress,constants:ni}});const ai=new Set([`gzip`,`deflate`,`deflate-raw`]);function validateFormat(e){if(!ai.has(e))throw TypeError(`Unsupported compression format: '${e}'. Supported formats: 'gzip', 'deflate', 'deflate-raw'.`);return e}const oi=typeof globalThis.CompressionStream==`function`&&typeof globalThis.DecompressionStream==`function`;let si=!1,ci,li,ui,di,fi,pi;async function loadZlib(){if(si)return;let e=await Promise.resolve().then(()=>(ii(),$r));ci=e.gzipSync,li=e.gunzipSync,ui=e.deflateSync,di=e.inflateSync,fi=e.deflateRawSync,pi=e.inflateRawSync,si=!0}function getCompressFn(e){switch(e){case`gzip`:return e=>ci(e);case`deflate`:return e=>ui(e);case`deflate-raw`:return e=>fi(e)}}function getDecompressFn(e){switch(e){case`gzip`:return e=>li(e);case`deflate`:return e=>di(e);case`deflate-raw`:return e=>pi(e)}}function concatChunks(e){if(e.length===1)return e[0];let t=0;for(let n of e)t+=n.length;let n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.length;return n}let mi,hi;if(oi)mi=globalThis.CompressionStream,hi=globalThis.DecompressionStream;else{let e=loadZlib();mi=class CompressionStream{readable;writable;constructor(t){let n=validateFormat(t),r=[],i=new yr({transform(e){r.push(e)},async flush(t){try{await e;let i=getCompressFn(n)(concatChunks(r));i.length>0&&t.enqueue(i)}catch(e){t.error(e)}}});this.readable=i.readable,this.writable=i.writable}},hi=class DecompressionStream{readable;writable;constructor(t){let n=validateFormat(t),r=[],i=new yr({transform(e){r.push(e)},async flush(t){try{await e;let i=getDecompressFn(n)(concatChunks(r));i.length>0&&t.enqueue(i)}catch(e){t.error(e)}}});this.readable=i.readable,this.writable=i.writable}}}const gi=globalThis;globalThis.CompressionStream===void 0&&(gi.CompressionStream=mi),globalThis.DecompressionStream===void 0&&(gi.DecompressionStream=hi);const _i=globalThis;globalThis.DOMException===void 0&&(_i.DOMException=Be);const vi=globalThis;globalThis.ByteLengthQueuingStrategy===void 0&&(vi.ByteLengthQueuingStrategy=br),globalThis.CountQueuingStrategy===void 0&&(vi.CountQueuingStrategy=xr);const yi=globalThis;function isNativeStreamUsable$2(e,t){try{return typeof e==`function`?typeof e.prototype?.[t]==`function`:!1}catch{return!1}}__name(isNativeStreamUsable$2,`isNativeStreamUsable`),isNativeStreamUsable$2(globalThis.ReadableStream,`getReader`)||(yi.ReadableStream=_r),yi.ReadableStreamBYOBReader===void 0&&(yi.ReadableStreamBYOBReader=ReadableStreamBYOBReader),yi.ReadableStreamBYOBRequest===void 0&&(yi.ReadableStreamBYOBRequest=ReadableStreamBYOBRequest),yi.ReadableByteStreamController===void 0&&(yi.ReadableByteStreamController=ReadableByteStreamController),yi.ReadableStreamDefaultController===void 0&&(yi.ReadableStreamDefaultController=ReadableStreamDefaultController),yi.ReadableStreamDefaultReader===void 0&&(yi.ReadableStreamDefaultReader=ReadableStreamDefaultReader);const bi=globalThis;globalThis.TextEncoderStream===void 0&&(bi.TextEncoderStream=Sr),globalThis.TextDecoderStream===void 0&&(bi.TextDecoderStream=Cr);function isNativeStreamUsable$1(e,t){try{return typeof e==`function`?typeof e.prototype?.[t]==`function`:!1}catch{return!1}}if(__name(isNativeStreamUsable$1,`isNativeStreamUsable`),!isNativeStreamUsable$1(globalThis.TransformStream,`readable`)){let e=globalThis;e.TransformStream=yr}function isNativeStreamUsable(e,t){try{return typeof e==`function`?typeof e.prototype?.[t]==`function`:!1}catch{return!1}}if(!isNativeStreamUsable(globalThis.WritableStream,`getWriter`)){let e=globalThis;e.WritableStream=vr}var CryptoKey=class{type;extractable;algorithm;usages;_handle;constructor(e,t,n,r,i){this.type=e,this.extractable=t,this.algorithm=Object.freeze({...n}),this.usages=Object.freeze([...r]),this._handle=i}get[Symbol.toStringTag](){return`CryptoKey`}};function normalizeAlgorithm$1(e){if(typeof e==`string`)return{name:e};if(!e||typeof e.name!=`string`)throw TypeError(`Algorithm must have a name property`);return e}__name(normalizeAlgorithm$1,`normalizeAlgorithm`);const xi={"SHA-1":`sha1`,"SHA-256":`sha256`,"SHA-384":`sha384`,"SHA-512":`sha512`};function toNodeHashName(e){let t=xi[e.toUpperCase()]||xi[e];if(!t)throw new Be(`Unrecognized hash name: ${e}`,`NotSupportedError`);return t}const Si={"P-256":`prime256v1`,"P-384":`secp384r1`,"P-521":`secp521r1`};function toNodeCurveName(e){let t=Si[e];if(!t)throw new Be(`Unrecognized curve name: ${e}`,`NotSupportedError`);return t}function hashSize$1(e){switch(toNodeHashName(e)){case`sha1`:return 20;case`sha256`:return 32;case`sha384`:return 48;case`sha512`:return 64;default:throw new Be(`Unsupported hash: ${e}`,`NotSupportedError`)}}__name(hashSize$1,`hashSize`);function validateUsages(e,t){for(let n of e)if(!t.includes(n))throw new Be(`Invalid key usage: ${n}`,`SyntaxError`);if(e.length===0)throw new Be(`Key usages must not be empty`,`SyntaxError`)}function checkUsage(e,t){if(!e.usages.includes(t))throw new Be(`Key does not support the '${t}' usage`,`InvalidAccessError`)}const Ci=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,wi=new Uint8Array(128);for(let e=0;e<64;e++)wi[Ci.charCodeAt(e)]=e;function bytesToBase64(e){let t=``,n=e.length;for(let r=0;r<n;r+=3){let i=e[r],a=r+1<n?e[r+1]:0,o=r+2<n?e[r+2]:0;t+=Ci[i>>2&63],t+=Ci[(i<<4|a>>4)&63],t+=r+1<n?Ci[(a<<2|o>>6)&63]:`=`,t+=r+2<n?Ci[o&63]:`=`}return t}function base64ToBytes(e){let t=e;for(;t.endsWith(`=`);)t=t.slice(0,-1);let n=[],r=0,i=0;for(let e=0;e<t.length;e++)i=i<<6|wi[t.charCodeAt(e)],r+=6,r>=8&&(r-=8,n.push(i>>r&255));return new Uint8Array(n)}function base64urlEncode(e){return bytesToBase64(e).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=+$/,``)}function base64urlDecode(e){let t=e.replace(/-/g,`+`).replace(/_/g,`/`);for(;t.length%4;)t+=`=`;return base64ToBytes(t)}function toUint8Array(e){if(e instanceof Uint8Array)return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw TypeError(`Expected BufferSource`)}var Ti,Ei=__esmMin(()=>{Ti={RSA_PKCS1_PADDING:1,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_PKCS1_PSS_PADDING:6,DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8}});function timingSafeEqual(e,t){if(e.length!==t.length)throw RangeError(`Input buffers must have the same byte length`);let n=0;for(let r=0;r<e.length;r++)n|=e[r]^t[r];return n===0}var Di=__esmMin(()=>{});function gmul(e,t){let n=0;for(let r=0;r<8;r++){t&1&&(n^=e);let r=e&128;e=e<<1&255,r&&(e^=27),t>>=1}return n}function keyExpansion(e){let t=e.length/4,n=t+6,r=4*(n+1),i=Array.from({length:r});for(let n=0;n<t;n++)i[n]=new Uint8Array([e[4*n],e[4*n+1],e[4*n+2],e[4*n+3]]);for(let e=t;e<r;e++){let n=new Uint8Array(i[e-1]);e%t===0?n=new Uint8Array([Oi[n[1]]^Ai[e/t-1],Oi[n[2]],Oi[n[3]],Oi[n[0]]]):t>6&&e%t===4&&(n=new Uint8Array([Oi[n[0]],Oi[n[1]],Oi[n[2]],Oi[n[3]]])),i[e]=new Uint8Array(4);for(let r=0;r<4;r++)i[e][r]=i[e-t][r]^n[r]}let a=[];for(let e=0;e<=n;e++){let t=new Uint8Array(16);for(let n=0;n<4;n++)t[4*n]=i[4*e+n][0],t[4*n+1]=i[4*e+n][1],t[4*n+2]=i[4*e+n][2],t[4*n+3]=i[4*e+n][3];a.push(t)}return a}function aesEncryptBlock(e,t){let n=new Uint8Array(e),r=t.length-1;for(let e=0;e<16;e++)n[e]^=t[0][e];for(let e=1;e<r;e++){for(let e=0;e<16;e++)n[e]=Oi[n[e]];let r=n[1];n[1]=n[5],n[5]=n[9],n[9]=n[13],n[13]=r;let i=n[2],a=n[6];n[2]=n[10],n[6]=n[14],n[10]=i,n[14]=a;let o=n[15];n[15]=n[11],n[11]=n[7],n[7]=n[3],n[3]=o;for(let e=0;e<4;e++){let t=e*4,r=n[t],i=n[t+1],a=n[t+2],o=n[t+3];n[t]=gmul(2,r)^gmul(3,i)^a^o,n[t+1]=r^gmul(2,i)^gmul(3,a)^o,n[t+2]=r^i^gmul(2,a)^gmul(3,o),n[t+3]=gmul(3,r)^i^a^gmul(2,o)}for(let r=0;r<16;r++)n[r]^=t[e][r]}for(let e=0;e<16;e++)n[e]=Oi[n[e]];let i=n[1];n[1]=n[5],n[5]=n[9],n[9]=n[13],n[13]=i;let a=n[2],o=n[6];n[2]=n[10],n[6]=n[14],n[10]=a,n[14]=o;let s=n[15];n[15]=n[11],n[11]=n[7],n[7]=n[3],n[3]=s;for(let e=0;e<16;e++)n[e]^=t[r][e];return n}function aesDecryptBlock(e,t){let n=new Uint8Array(e),r=t.length-1;for(let e=0;e<16;e++)n[e]^=t[r][e];for(let e=r-1;e>0;e--){let r=n[13];n[13]=n[9],n[9]=n[5],n[5]=n[1],n[1]=r;let i=n[10],a=n[14];n[10]=n[2],n[14]=n[6],n[2]=i,n[6]=a;let o=n[3];n[3]=n[7],n[7]=n[11],n[11]=n[15],n[15]=o;for(let e=0;e<16;e++)n[e]=ki[n[e]];for(let r=0;r<16;r++)n[r]^=t[e][r];for(let e=0;e<4;e++){let t=e*4,r=n[t],i=n[t+1],a=n[t+2],o=n[t+3];n[t]=gmul(14,r)^gmul(11,i)^gmul(13,a)^gmul(9,o),n[t+1]=gmul(9,r)^gmul(14,i)^gmul(11,a)^gmul(13,o),n[t+2]=gmul(13,r)^gmul(9,i)^gmul(14,a)^gmul(11,o),n[t+3]=gmul(11,r)^gmul(13,i)^gmul(9,a)^gmul(14,o)}}let i=n[13];n[13]=n[9],n[9]=n[5],n[5]=n[1],n[1]=i;let a=n[10],o=n[14];n[10]=n[2],n[14]=n[6],n[2]=a,n[6]=o;let s=n[3];n[3]=n[7],n[7]=n[11],n[11]=n[15],n[15]=s;for(let e=0;e<16;e++)n[e]=ki[n[e]];for(let e=0;e<16;e++)n[e]^=t[0][e];return n}function incrementCounter(e){for(let t=15;t>=0&&++e[t]===0;t--);}function gcmIncrementCounter(e){for(let t=15;t>=12&&++e[t]===0;t--);}function gfMul(e,t){let n=new Uint8Array(16),r=new Uint8Array(e);for(let e=0;e<128;e++){if(t[e>>>3]&1<<7-(e&7))for(let e=0;e<16;e++)n[e]^=r[e];let i=r[15]&1;for(let e=15;e>0;e--)r[e]=r[e]>>>1|(r[e-1]&1)<<7;r[0]>>>=1,i&&(r[0]^=225)}return n}function ghash(e,t,n){let r=new Uint8Array(16),i=Math.ceil(t.length/16)||0;for(let n=0;n<i;n++){let i=n*16,a=Math.min(i+16,t.length);for(let e=0;e<16;e++){let n=i+e;n<a&&(r[e]^=t[n])}let o=gfMul(r,e);r.set(o)}let a=Math.ceil(n.length/16)||0;for(let t=0;t<a;t++){let i=t*16,a=Math.min(i+16,n.length);for(let e=0;e<16;e++){let t=i+e;t<a&&(r[e]^=n[t])}let o=gfMul(r,e);r.set(o)}let o=new Uint8Array(16),s=t.length*8,c=n.length*8,l=Math.floor(s/4294967296),u=s>>>0;o[0]=l>>>24&255,o[1]=l>>>16&255,o[2]=l>>>8&255,o[3]=l&255,o[4]=u>>>24&255,o[5]=u>>>16&255,o[6]=u>>>8&255,o[7]=u&255;let d=Math.floor(c/4294967296),p=c>>>0;o[8]=d>>>24&255,o[9]=d>>>16&255,o[10]=d>>>8&255,o[11]=d&255,o[12]=p>>>24&255,o[13]=p>>>16&255,o[14]=p>>>8&255,o[15]=p&255;for(let e=0;e<16;e++)r[e]^=o[e];let m=gfMul(r,e);return r.set(m),r}var Oi,ki,Ai,ji=__esmMin(()=>{Oi=new Uint8Array([99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22]),ki=new Uint8Array([82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125]),Ai=[1,2,4,8,16,32,64,128,27,54]});function parseAlgorithm(e){let t=e.toLowerCase().match(/^aes-(128|192|256)-(cbc|ctr|ecb|cfb|ofb|gcm)$/);if(!t)throw Error(`Unsupported cipher algorithm: ${e}`);let n=parseInt(t[1]),r=t[2];return{keySize:n/8,ivSize:r===`ecb`?0:r===`gcm`?12:16,mode:r}}function toBuffer$2(e,t){return typeof e==`string`?q.from(e,t||`utf8`):q.from(e)}function encodeOutput(e,t){return t?q.from(e).toString(t):q.from(e)}function incompleteUtf8Tail(e){if(e.length===0)return 0;let t=e.length;for(let n=1;n<=Math.min(4,t);n++){let r=e[t-n];if(!(r&128))return 0;if((r&192)==128)continue;let i;if((r&224)==192)i=2;else if((r&240)==224)i=3;else if((r&248)==240)i=4;else return 0;return n<i?n:0}return 0}function pkcs7Pad(e){let t=16-e.length%16,n=new Uint8Array(e.length+t);n.set(e);for(let r=e.length;r<n.length;r++)n[r]=t;return n}function pkcs7Unpad(e){if(e.length===0||e.length%16!=0)throw Error(`bad decrypt`);let t=e[e.length-1];if(t===0||t>16)throw Error(`bad decrypt`);for(let n=e.length-t;n<e.length;n++)if(e[n]!==t)throw Error(`bad decrypt`);return new Uint8Array(e.slice(0,e.length-t))}var Mi=__esmMin(()=>{J(),__name(toBuffer$2,`toBuffer`)});function createCipher(e,t){throw Error(`crypto.createCipher() is deprecated. Use createCipheriv() instead.`)}function createCipheriv(e,t,n){return new Cipher(e,typeof t==`string`?q.from(t):new Uint8Array(t),n==null?null:typeof n==`string`?q.from(n):new Uint8Array(n))}function createDecipher(e,t){throw Error(`crypto.createDecipher() is deprecated. Use createDecipheriv() instead.`)}function createDecipheriv(e,t,n){return new Decipher(e,typeof t==`string`?q.from(t):new Uint8Array(t),n==null?null:typeof n==`string`?q.from(n):new Uint8Array(n))}function getCiphers(){return[`aes-128-cbc`,`aes-128-ecb`,`aes-192-cbc`,`aes-192-ecb`,`aes-256-cbc`,`aes-256-ecb`,`aes-128-ctr`,`aes-192-ctr`,`aes-256-ctr`,`aes-128-cfb`,`aes-192-cfb`,`aes-256-cfb`,`aes-128-gcm`,`aes-192-gcm`,`aes-256-gcm`]}var CipherBase,Cipher,Decipher,Ni=__esmMin(()=>{ji(),Mi(),J(),CipherBase=class{_roundKeys;_iv;_mode;_buffer=new Uint8Array;_autoPadding=!0;_finalized=!1;constructor(e,t,n){let r=parseAlgorithm(e);if(t.length!==r.keySize)throw Error(`Invalid key length ${t.length}, expected ${r.keySize} for ${e}`);if(r.ivSize>0&&(!n||n.length!==r.ivSize))throw Error(`Invalid IV length ${n?.length??0}, expected ${r.ivSize} for ${e}`);this._roundKeys=keyExpansion(t),this._iv=n?new Uint8Array(n):new Uint8Array(16),this._mode=r.mode}setAutoPadding(e){return this._autoPadding=e,this}},Cipher=class extends CipherBase{_prevBlock;_counter;_gcmH=null;_gcmJ0=null;_gcmAAD=new Uint8Array;_gcmCiphertext=[];_gcmCiphertextLen=0;_gcmAuthTag=null;_gcmAADSet=!1;constructor(e,t,n){super(e,t,n),this._prevBlock=new Uint8Array(this._iv),this._mode===`gcm`?(this._gcmH=aesEncryptBlock(new Uint8Array(16),this._roundKeys),this._gcmJ0=new Uint8Array(16),this._gcmJ0.set(this._iv.subarray(0,12)),this._gcmJ0[15]=1,this._counter=new Uint8Array(this._gcmJ0),gcmIncrementCounter(this._counter)):this._counter=new Uint8Array(this._iv)}setAAD(e){if(this._mode!==`gcm`)throw Error(`setAAD is only supported in GCM mode`);if(this._gcmCiphertextLen>0)throw Error(`setAAD must be called before update()`);return this._gcmAAD=new Uint8Array(e),this._gcmAADSet=!0,this}getAuthTag(){if(this._mode!==`gcm`)throw Error(`getAuthTag is only supported in GCM mode`);if(!this._gcmAuthTag)throw Error(`getAuthTag must be called after final()`);return q.from(this._gcmAuthTag)}update(e,t,n){let r=toBuffer$2(e,t),i=new Uint8Array(this._buffer.length+r.length);if(i.set(this._buffer),i.set(r,this._buffer.length),this._mode===`gcm`){let e=this._processGcmEncrypt(i);return this._buffer=new Uint8Array,encodeOutput(e,n)}if(this._mode===`ctr`||this._mode===`cfb`||this._mode===`ofb`){let e=this._processStream(i);return this._buffer=new Uint8Array,encodeOutput(e,n)}let a=Math.floor(i.length/16)*16,o=[];for(let e=0;e<a;e+=16){let t=i.slice(e,e+16);o.push(this._encryptBlock(t))}this._buffer=i.slice(a);let s=new Uint8Array(o.length*16);for(let e=0;e<o.length;e++)s.set(o[e],e*16);return encodeOutput(s,n)}final(e){if(this._finalized)throw Error(`Cipher already finalized`);if(this._finalized=!0,this._mode===`gcm`){let t=new Uint8Array;this._buffer.length>0&&(t=this._processGcmEncrypt(this._buffer),this._buffer=new Uint8Array);let n=new Uint8Array(this._gcmCiphertextLen),r=0;for(let e of this._gcmCiphertext)n.set(e,r),r+=e.length;let i=ghash(this._gcmH,this._gcmAAD,n),a=aesEncryptBlock(this._gcmJ0,this._roundKeys),o=new Uint8Array(16);for(let e=0;e<16;e++)o[e]=i[e]^a[e];return this._gcmAuthTag=q.from(o),encodeOutput(t,e)}if(this._mode===`ctr`||this._mode===`cfb`||this._mode===`ofb`){if(this._buffer.length>0){let t=this._processStream(this._buffer);return this._buffer=new Uint8Array,encodeOutput(t,e)}return encodeOutput(new Uint8Array,e)}let t=this._buffer;if(this._autoPadding)t=pkcs7Pad(t);else if(t.length%16!=0)throw Error(`data not multiple of block size`);let n=[];for(let e=0;e<t.length;e+=16)n.push(this._encryptBlock(t.slice(e,e+16)));if(this._buffer=new Uint8Array,n.length===0)return encodeOutput(new Uint8Array,e);let r=new Uint8Array(n.length*16);for(let e=0;e<n.length;e++)r.set(n[e],e*16);return encodeOutput(r,e)}_encryptBlock(e){if(this._mode===`cbc`){let t=new Uint8Array(16);for(let n=0;n<16;n++)t[n]=e[n]^this._prevBlock[n];let n=aesEncryptBlock(t,this._roundKeys);return this._prevBlock=n,n}else if(this._mode===`ecb`)return aesEncryptBlock(e,this._roundKeys);throw Error(`Block encryption not supported for mode: ${this._mode}`)}_processStream(e){let t=new Uint8Array(e.length);for(let n=0;n<e.length;n+=16){let r=aesEncryptBlock(this._counter,this._roundKeys),i=Math.min(16,e.length-n);for(let a=0;a<i;a++)t[n+a]=e[n+a]^r[a];incrementCounter(this._counter)}return t}_processGcmEncrypt(e){let t=new Uint8Array(e.length);for(let n=0;n<e.length;n+=16){let r=aesEncryptBlock(this._counter,this._roundKeys),i=Math.min(16,e.length-n);for(let a=0;a<i;a++)t[n+a]=e[n+a]^r[a];gcmIncrementCounter(this._counter)}return this._gcmCiphertext.push(new Uint8Array(t)),this._gcmCiphertextLen+=t.length,t}},Decipher=class extends CipherBase{_prevBlock;_counter;_pendingUtf8=new Uint8Array;_gcmH=null;_gcmJ0=null;_gcmAAD=new Uint8Array;_gcmCiphertext=[];_gcmCiphertextLen=0;_gcmExpectedTag=null;_gcmAADSet=!1;constructor(e,t,n){super(e,t,n),this._prevBlock=new Uint8Array(this._iv),this._mode===`gcm`?(this._gcmH=aesEncryptBlock(new Uint8Array(16),this._roundKeys),this._gcmJ0=new Uint8Array(16),this._gcmJ0.set(this._iv.subarray(0,12)),this._gcmJ0[15]=1,this._counter=new Uint8Array(this._gcmJ0),gcmIncrementCounter(this._counter)):this._counter=new Uint8Array(this._iv)}setAAD(e){if(this._mode!==`gcm`)throw Error(`setAAD is only supported in GCM mode`);if(this._gcmCiphertextLen>0)throw Error(`setAAD must be called before update()`);return this._gcmAAD=new Uint8Array(e),this._gcmAADSet=!0,this}setAuthTag(e){if(this._mode!==`gcm`)throw Error(`setAuthTag is only supported in GCM mode`);return this._gcmExpectedTag=q.from(e),this}_encodeWithUtf8Handling(e,t,n){if(!t||t!==`utf8`&&t!==`utf-8`)return encodeOutput(e,t);let r;if(this._pendingUtf8.length>0?(r=new Uint8Array(this._pendingUtf8.length+e.length),r.set(this._pendingUtf8),r.set(e,this._pendingUtf8.length),this._pendingUtf8=new Uint8Array):r=e,!n){let e=incompleteUtf8Tail(r);e>0&&(this._pendingUtf8=new Uint8Array(r.slice(r.length-e)),r=new Uint8Array(r.slice(0,r.length-e)))}return q.from(r).toString(`utf8`)}update(e,t,n){let r=toBuffer$2(e,t),i=new Uint8Array(this._buffer.length+r.length);if(i.set(this._buffer),i.set(r,this._buffer.length),this._mode===`gcm`){this._gcmCiphertext.push(new Uint8Array(i)),this._gcmCiphertextLen+=i.length;let e=this._processGcmDecrypt(i);return this._buffer=new Uint8Array,this._encodeWithUtf8Handling(e,n,!1)}if(this._mode===`ctr`||this._mode===`cfb`||this._mode===`ofb`){let e=this._processStream(i);return this._buffer=new Uint8Array,this._encodeWithUtf8Handling(e,n,!1)}let a=Math.floor(i.length/16);if(a===0)return this._buffer=i,this._encodeWithUtf8Handling(new Uint8Array,n,!1);let o=(this._autoPadding?a-1:a)*16,s=[];for(let e=0;e<o;e+=16){let t=i.slice(e,e+16);s.push(this._decryptBlock(t))}this._buffer=i.slice(o);let c=new Uint8Array(s.length*16);for(let e=0;e<s.length;e++)c.set(s[e],e*16);return this._encodeWithUtf8Handling(c,n,!1)}final(e){if(this._finalized)throw Error(`Decipher already finalized`);if(this._finalized=!0,this._mode===`gcm`){let t=new Uint8Array;if(this._buffer.length>0&&(this._gcmCiphertext.push(new Uint8Array(this._buffer)),this._gcmCiphertextLen+=this._buffer.length,t=this._processGcmDecrypt(this._buffer),this._buffer=new Uint8Array),!this._gcmExpectedTag)throw Error(`Unsupported state or unable to authenticate data`);let n=new Uint8Array(this._gcmCiphertextLen),r=0;for(let e of this._gcmCiphertext)n.set(e,r),r+=e.length;let i=ghash(this._gcmH,this._gcmAAD,n),a=aesEncryptBlock(this._gcmJ0,this._roundKeys),o=new Uint8Array(16);for(let e=0;e<16;e++)o[e]=i[e]^a[e];let s=this._gcmExpectedTag,c=Math.min(s.length,16),l=0;for(let e=0;e<c;e++)l|=o[e]^s[e];if(l!==0)throw Error(`Unsupported state or unable to authenticate data`);return this._encodeWithUtf8Handling(t,e,!0)}if(this._mode===`ctr`||this._mode===`cfb`||this._mode===`ofb`){if(this._buffer.length>0){let t=this._processStream(this._buffer);return this._buffer=new Uint8Array,this._encodeWithUtf8Handling(t,e,!0)}return this._encodeWithUtf8Handling(new Uint8Array,e,!0)}if(this._buffer.length===0)return this._encodeWithUtf8Handling(new Uint8Array,e,!0);if(this._buffer.length%16!=0)throw Error(`bad decrypt`);let t=[];for(let e=0;e<this._buffer.length;e+=16)t.push(this._decryptBlock(this._buffer.slice(e,e+16)));let n=new Uint8Array(t.length*16);for(let e=0;e<t.length;e++)n.set(t[e],e*16);let r=this._autoPadding?pkcs7Unpad(n):n;return this._buffer=new Uint8Array,this._encodeWithUtf8Handling(r,e,!0)}_decryptBlock(e){if(this._mode===`cbc`){let t=aesDecryptBlock(e,this._roundKeys),n=new Uint8Array(16);for(let e=0;e<16;e++)n[e]=t[e]^this._prevBlock[e];return this._prevBlock=new Uint8Array(e),n}else if(this._mode===`ecb`)return aesDecryptBlock(e,this._roundKeys);throw Error(`Block decryption not supported for mode: ${this._mode}`)}_processStream(e){let t=new Uint8Array(e.length);for(let n=0;n<e.length;n+=16){let r=aesEncryptBlock(this._counter,this._roundKeys),i=Math.min(16,e.length-n);for(let a=0;a<i;a++)t[n+a]=e[n+a]^r[a];incrementCounter(this._counter)}return t}_processGcmDecrypt(e){let t=new Uint8Array(e.length);for(let n=0;n<e.length;n+=16){let r=aesEncryptBlock(this._counter,this._roundKeys),i=Math.min(16,e.length-n);for(let a=0;a<i;a++)t[n+a]=e[n+a]^r[a];gcmIncrementCounter(this._counter)}return t}}});function fillRandom(e){if(Pi)for(let t=0;t<e.length;t+=65536){let n=Math.min(e.length-t,65536),r=new Uint8Array(e.buffer,e.byteOffset+t,n);globalThis.crypto.getRandomValues(r)}else try{let t=imports.gi.GLib;for(let n=0;n<e.length;n++)e[n]=t.random_int_range(0,256)}catch{for(let t=0;t<e.length;t++)e[t]=Math.floor(Math.random()*256)}}function randomBytes(e,t){if(typeof e!=`number`||e<0||!Number.isInteger(e))throw TypeError(`The "size" argument must be a non-negative integer. Received ${e}`);try{let n=q.alloc(e);if(e>0&&fillRandom(new Uint8Array(n.buffer,n.byteOffset,n.byteLength)),t)t(null,n);else return n}catch(e){if(t)t(e,q.alloc(0));else throw e}}function randomFillSync(e,t=0,n){let r=n??e.length-t;if(t<0||t>e.length)throw RangeError(`The value of "offset" is out of range. Received ${t}`);if(r<0||t+r>e.length)throw RangeError(`The value of "size" is out of range. Received ${r}`);if(r>0){let n=(e instanceof q,e.byteOffset);fillRandom(new Uint8Array(e.buffer,n+t,r))}return e}function randomFill(e,t,n,r){let i,a,o;typeof t==`function`?(o=t,i=0,a=e.length):typeof n==`function`?(o=n,i=t,a=e.length-t):(o=r,i=t,a=n);try{randomFillSync(e,i,a),o(null,e)}catch(t){o(t,e)}}function randomUUID(){if(Pi&&typeof globalThis.crypto.randomUUID==`function`)return globalThis.crypto.randomUUID();let e=new Uint8Array(16);fillRandom(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t=Array.from(e,e=>e.toString(16).padStart(2,`0`)).join(``);return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20)}`}function randomInt(e,t,n){let r,i,a;if(typeof t==`function`?(a=t,i=e,r=0):typeof t==`number`?(r=e,i=t,a=n):(i=e,r=0,a=n),!Number.isInteger(r))throw TypeError(`The "min" argument must be a safe integer. Received ${r}`);if(!Number.isInteger(i))throw TypeError(`The "max" argument must be a safe integer. Received ${i}`);if(r>=i)throw RangeError(`The value of "min" must be less than "max". Received min: ${r}, max: ${i}`);let o=i-r,s=new Uint32Array(1);fillRandom(new Uint8Array(s.buffer));let c=r+s[0]%o;if(a)a(null,c);else return c}var Pi,Fi=__esmMin(()=>{J(),Pi=globalThis.crypto!==void 0&&typeof globalThis.crypto.getRandomValues==`function`});function modPow(e,t,n){if(n===1n)return 0n;e=(e%n+n)%n;let r=1n;for(;t>0n;)t&1n&&(r=r*e%n),t>>=1n,e=e*e%n;return r}function bigIntToBytes(e,t){let n=new Uint8Array(t),r=e;for(let e=t-1;e>=0;e--)n[e]=Number(r&255n),r>>=8n;return n}function bytesToBigInt(e){let t=0n;for(let n=0;n<e.length;n++)t=t<<8n|BigInt(e[n]);return t}var Ii=__esmMin(()=>{});function bigIntToBuffer(e){if(e===0n)return q.from([0]);let t=e.toString(16);return t.length%2!=0&&(t=`0`+t),q.from(t,`hex`)}function bufferToBigInt(e){if(e.length===0)return 0n;let t=q.from(e).toString(`hex`);return t.length===0?0n:BigInt(`0x`+t)}function bitLength(e){return e===0n?0:e.toString(2).length}function simpleSieve(e){for(let t of Ri){let n=BigInt(t);if(e%n===0n)return e===n}return!0}function fermatTest(e){return modPow(2n,e-1n,e)===1n}function millerRabinTest(e){if(e<2n)return!1;if(e===2n||e===3n)return!0;if(e%2n==0n)return!1;let t=e-1n,n=0;for(;t%2n==0n;)t/=2n,n++;for(let r of[2n,3n,5n,7n,11n,13n]){if(r>=e)continue;let i=modPow(r,t,e);if(i===1n||i===e-1n)continue;let a=!0;for(let t=0;t<n-1;t++)if(i=modPow(i,2n,e),i===e-1n){a=!1;break}if(a)return!1}return!0}function checkPrime(e,t){let n=t.toString(`hex`),r=0;if(e%2n==0n||!simpleSieve(e)||!fermatTest(e)||!millerRabinTest(e))return r+=1,n===`02`||n===`05`?r+=8:r+=4,r;switch(millerRabinTest(e>>1n)||(r+=2),n){case`02`:e%24n!=11n&&(r+=8);break;case`05`:{let t=e%10n;t!==3n&&t!==7n&&(r+=8)}break;default:r+=4}return r}function getCachedCheckPrime(e,t){let n=t.toString(`hex`)+`_`+e.toString(16);if(n in zi)return zi[n];let r=checkPrime(e,t);return zi[n]=r,r}function formatReturnValue$1(e,t){let n=bigIntToBuffer(e);return t?n.toString(t):n}function generatePrime(e,t){let n=bufferToBigInt(t);if(e<16)return n===2n||n===5n?q.from([140,123]):q.from([140,39]);let r=Math.ceil(e/8),i=2n,a=4n;for(;;){let t=bufferToBigInt(randomBytes(r));for(;bitLength(t)>e;)t>>=1n;if(t%i===0n&&(t+=1n),t&i||(t+=i),n===i)for(;t%24n!=11n;)t+=a;else if(n===5n)for(;t%10n!=3n;)t+=a;let o=t>>1n;if(simpleSieve(o)&&simpleSieve(t)&&fermatTest(o)&&fermatTest(t)&&millerRabinTest(o)&&millerRabinTest(t))return bigIntToBuffer(t)}}function createDiffieHellman(e,t,n,r){if(t!==void 0&&typeof t!=`number`&&(q.isBuffer(t)||t instanceof Uint8Array||typeof t==`string`&&!(t in Bi)))return createDiffieHellman(e,`binary`,t,n);let i=t||`binary`,a=r||`binary`,o=q.from([2]);if(n!==void 0&&(typeof n==`number`?(o=q.alloc(1),o[0]=n):o=q.isBuffer(n)?n:q.from(n,a)),typeof e==`number`)return new DiffieHellman(generatePrime(e,o),o,!0);let s;return s=q.isBuffer(e)?e:e instanceof Uint8Array?q.from(e):q.from(e,i),new DiffieHellman(s,o,!0)}function getDiffieHellman(e){let t=Li[e];if(!t)throw Error(`Unknown group: ${e}. Supported groups: ${Object.keys(Li).join(`, `)}`);return new DiffieHellman(q.from(t.prime,`hex`),q.from(t.gen,`hex`),!1)}var Li,Ri,zi,DiffieHellman,Bi,Vi,Hi,Ui=__esmMin(()=>{Ii(),Fi(),J(),Li={modp1:{gen:`02`,prime:`ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff`},modp2:{gen:`02`,prime:`ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff`},modp5:{gen:`02`,prime:`ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff`},modp14:{gen:`02`,prime:`ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff`},modp15:{gen:`02`,prime:`ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff`},modp16:{gen:`02`,prime:`ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff`},modp17:{gen:`02`,prime:`ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff`},modp18:{gen:`02`,prime:`ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff`}},Ri=[];{let e=1e3,t=new Uint8Array(e+1);for(let n=2;n*n<=e;n++)if(!t[n])for(let r=n*n;r<=e;r+=n)t[r]=1;for(let n=2;n<=e;n++)t[n]||Ri.push(n)}zi={},__name(formatReturnValue$1,`formatReturnValue`),DiffieHellman=class{_prime;_generator;_generatorBuf;_primeByteLength;_pubKey;_privKey;_primeCode;_malleable;constructor(e,t,n=!1){this._prime=bufferToBigInt(e),this._generatorBuf=t,this._generator=bufferToBigInt(t),this._primeByteLength=e.length,this._pubKey=void 0,this._privKey=void 0,this._primeCode=void 0,this._malleable=n,n||(this._primeCode=0,this.setPublicKey=void 0,this.setPrivateKey=void 0)}get verifyError(){return typeof this._primeCode!=`number`&&(this._primeCode=getCachedCheckPrime(this._prime,this._generatorBuf)),this._primeCode}generateKeys(e){if(!this._privKey){let e=randomBytes(this._primeByteLength);this._privKey=bufferToBigInt(e)}return this._pubKey=modPow(this._generator,this._privKey,this._prime),this.getPublicKey(e)}computeSecret(e,t,n){let r;r=typeof e==`string`?q.from(e,t||`utf8`):q.from(e);let i=bufferToBigInt(r);if(!this._privKey)throw Error(`You must generate keys before computing a secret`);if(i<=0n||i>=this._prime)throw Error(`Supplied key is too large`);let a=bigIntToBuffer(modPow(i,this._privKey,this._prime)),o=this._primeByteLength;if(a.length<o){let e=q.alloc(o);a.copy(e,o-a.length),a=e}return n?a.toString(n):a}getPrime(e){return formatReturnValue$1(this._prime,e)}getGenerator(e){return formatReturnValue$1(this._generator,e)}getPublicKey(e){if(!this._pubKey)throw Error(`No public key - call generateKeys() first`);return formatReturnValue$1(this._pubKey,e)}getPrivateKey(e){if(!this._privKey)throw Error(`No private key - call generateKeys() first`);return formatReturnValue$1(this._privKey,e)}setPublicKey(e,t){if(!this._malleable)throw Error(`setPublicKey is not available for predefined DH groups`);let n=typeof e==`string`?q.from(e,t||`utf8`):q.from(e);this._pubKey=bufferToBigInt(n)}setPrivateKey(e,t){if(!this._malleable)throw Error(`setPrivateKey is not available for predefined DH groups`);let n=typeof e==`string`?q.from(e,t||`utf8`):q.from(e);this._privKey=bufferToBigInt(n)}},Bi={binary:!0,hex:!0,base64:!0,latin1:!0,utf8:!0,"utf-8":!0,base64url:!0,ascii:!0,ucs2:!0,"ucs-2":!0,utf16le:!0,"utf-16le":!0},Vi=getDiffieHellman,Hi=getDiffieHellman});function mod(e,t){let n=e%t;return n<0n?n+t:n}function modInverse$2(e,t){if(e=mod(e,t),e===0n)throw Error(`No modular inverse for zero`);let[n,r]=[e,t],[i,a]=[1n,0n];for(;r!==0n;){let e=n/r;[n,r]=[r,n-e*r],[i,a]=[a,i-e*a]}if(n!==1n)throw Error(`Modular inverse does not exist`);return mod(i,t)}function pointAdd(e,t,n){if(e===null)return t;if(t===null)return e;let{p:r}=n;if(e.x===t.x)return mod(e.y+t.y,r)===0n?null:pointDouble(e,n);let i=mod(t.x-e.x,r),a=mod(mod(t.y-e.y,r)*modInverse$2(i,r),r),o=mod(a*a-e.x-t.x,r);return{x:o,y:mod(a*(e.x-o)-e.y,r)}}function pointDouble(e,t){if(e===null)return null;let{a:n,p:r}=t;if(e.y===0n)return null;let i=mod(mod(3n*e.x*e.x+n,r)*modInverse$2(mod(2n*e.y,r),r),r),a=mod(i*i-2n*e.x,r);return{x:a,y:mod(i*(e.x-a)-e.y,r)}}function scalarMul(e,t,n){if(t===null||e===0n)return null;let{n:r}=n;if(e=mod(e,r),e===0n)return null;let i=null,a=t,o=e.toString(2);for(let e=0;e<o.length;e++)o[e]===`1`?(i=pointAdd(i,a,n),a=pointDouble(a,n)):(a=pointAdd(i,a,n),i=pointDouble(i,n));return i}function bigintToBuffer(e,t){let n=e.toString(16).padStart(t*2,`0`);return q.from(n,`hex`)}function bufferToBigint(e){let t=q.from(e).toString(`hex`);return t.length===0?0n:BigInt(`0x`+t)}function encodePublicKey(e,t,n=`uncompressed`){if(e===null)throw Error(`Cannot encode the point at infinity`);let r=bigintToBuffer(e.x,t);if(n===`compressed`){let t=e.y%2n==0n?2:3;return q.concat([q.from([t]),r])}let i=bigintToBuffer(e.y,t);if(n===`hybrid`){let t=e.y%2n==0n?6:7;return q.concat([q.from([t]),r,i])}return q.concat([q.from([4]),r,i])}function decodePublicKey(e,t){let n=q.from(e);if(n.length===0)throw Error(`Invalid public key: empty buffer`);let r=n[0],{p:i,a,b:o,byteLength:s}=t;if(r===4||r===6||r===7){if(n.length!==1+2*s)throw Error(`Invalid public key length: expected ${1+2*s} bytes, got ${n.length}`);let e=bufferToBigint(n.subarray(1,1+s)),t=bufferToBigint(n.subarray(1+s));if(mod(t*t,i)!==mod(e*e*e+a*e+o,i))throw Error(`Invalid public key: point is not on the curve`);return{x:e,y:t}}if(r===2||r===3){if(n.length!==1+s)throw Error(`Invalid public key length: expected ${1+s} bytes, got ${n.length}`);let e=bufferToBigint(n.subarray(1,1+s)),t=sqrtMod(mod(e*e*e+a*e+o,i),i);if(t===null)throw Error(`Invalid public key: no valid y coordinate for the given x`);let c=r===3;return{x:e,y:t%2n!=0n===c?t:mod(i-t,i)}}throw Error(`Invalid public key prefix: 0x${r.toString(16).padStart(2,`0`)}`)}function sqrtMod(e,t){if(e=mod(e,t),e===0n)return 0n;if(modPow(e,(t-1n)/2n,t)!==1n)return null;if(mod(t,4n)===3n)return modPow(e,(t+1n)/4n,t);let n=0n,r=t-1n;for(;mod(r,2n)===0n;)r/=2n,n++;let i=2n;for(;modPow(i,(t-1n)/2n,t)!==t-1n;)i++;let a=n,o=modPow(i,r,t),s=modPow(e,r,t),c=modPow(e,(r+1n)/2n,t);for(;;){if(s===0n)return 0n;if(s===1n)return c;let e=1n,n=mod(s*s,t);for(;n!==1n;)n=mod(n*n,t),e++;let r=modPow(o,modPow(2n,a-e-1n,t-1n),t);a=e,o=mod(r*r,t),s=mod(s*o,t),c=mod(c*r,t)}}function toBuffer$1(e,t){if(q.isBuffer(e))return e;if(e instanceof Uint8Array)return q.from(e);if(typeof e==`string`)return q.from(e,t||`utf8`);if(ArrayBuffer.isView(e))return q.from(e.buffer,e.byteOffset,e.byteLength);throw TypeError(`The "key" argument must be of type string or an instance of Buffer, TypedArray, or DataView.`)}function formatReturnValue(e,t){return t?e.toString(t):e}function resolveCurve(e){let t=Gi[e.toLowerCase()];if(!t)throw Error(`Unsupported curve: ${e}`);let n=Wi[t];if(!n)throw Error(`Unsupported curve: ${e}`);return{canonical:t,params:n}}function createECDH(e){return new ECDH(e)}function getCurves(){return[`secp256k1`,`prime256v1`,`secp256r1`,`secp384r1`,`secp521r1`]}var Wi,Gi,ECDH,Ki=__esmMin(()=>{Ii(),Fi(),J(),Wi={secp256k1:{p:115792089237316195423570985008687907853269984665640564039457584007908834671663n,a:0n,b:7n,Gx:55066263022277343669578718895168534326250603453777594175500187360389116729240n,Gy:32670510020758816978083085130507043184471273380659243275938904335757337482424n,n:115792089237316195423570985008687907852837564279074904382605163141518161494337n,byteLength:32},prime256v1:{p:115792089210356248762697446949407573530086143415290314195533631308867097853951n,a:115792089210356248762697446949407573530086143415290314195533631308867097853951n-3n,b:41058363725152142129326129780047268409114441015993725554835256314039467401291n,Gx:48439561293906451759052585252797914202762949526041747995844080717082404635286n,Gy:36134250956749795798585127919587881956611106672985015071877198253568414405109n,n:115792089210356248762697446949407573529996955224135760342422259061068512044369n,byteLength:32},secp384r1:{p:39402006196394479212279040100143613805079739270465446667948293404245721771496870329047266088258938001861606973112319n,a:39402006196394479212279040100143613805079739270465446667948293404245721771496870329047266088258938001861606973112319n-3n,b:27580193559959705877849011840389048093056905856361568521428707301988689241309860865136260764883745107765439761230575n,Gx:26247035095799689268623156744566981891852923491109213387815615900925518854738050089022388053975719786650872476732087n,Gy:8325710961489029985546751289520108179287853048861315594709205902480503199884419224438643760392947333078086511627871n,n:39402006196394479212279040100143613805079739270465446667946905279627659399113263569398956308152294913554433653942643n,byteLength:48},secp521r1:{p:6864797660130609714981900799081393217269435300143305409394463459185543183397656052122559640661454554977296311391480858037121987999716643812574028291115057151n,a:6864797660130609714981900799081393217269435300143305409394463459185543183397656052122559640661454554977296311391480858037121987999716643812574028291115057151n-3n,b:1093849038073734274511112390766805569936207598951683748994586394495953116150735016013708737573759623248592132296706313309438452531591012912142327488478985984n,Gx:2661740802050217063228768716723360960729859168756973147706671368418802944996427808491545080627771902352094241225065558662157113545570916814161637315895999846n,Gy:3757180025770020463545507224491183603594455134769762486694567779615544477440556316691234405012945539562144444537289428522585666729196580810124344277578376784n,n:6864797660130609714981900799081393217269435300143305409394463459185543183397655394245057746333217197532963996371363321113864768612440380340372808892707005449n,byteLength:66}},Gi={secp256k1:`secp256k1`,prime256v1:`prime256v1`,secp256r1:`prime256v1`,"p-256":`prime256v1`,p256:`prime256v1`,secp384r1:`secp384r1`,"p-384":`secp384r1`,p384:`secp384r1`,secp521r1:`secp521r1`,"p-521":`secp521r1`,p521:`secp521r1`},__name(modInverse$2,`modInverse`),__name(toBuffer$1,`toBuffer`),ECDH=class{_curve;_curveName;_privateKey=null;_publicKey=null;constructor(e){let t=resolveCurve(e);this._curve=t.params,this._curveName=t.canonical}generateKeys(e,t){let{n,byteLength:r}=this._curve,i;do i=bufferToBigint(randomBytes(r));while(i===0n||i>=n);this._privateKey=i;let a={x:this._curve.Gx,y:this._curve.Gy};return this._publicKey=scalarMul(i,a,this._curve),e===void 0?this.getPublicKey():this.getPublicKey(e,t)}computeSecret(e,t,n){if(this._privateKey===null)throw Error(`ECDH key not generated. Call generateKeys() or setPrivateKey() first.`);let r=decodePublicKey(toBuffer$1(e,t),this._curve);if(r===null)throw Error(`Invalid public key: point at infinity`);let i=scalarMul(this._privateKey,r,this._curve);if(i===null)throw Error(`Shared secret computation resulted in the point at infinity`);return formatReturnValue(bigintToBuffer(i.x,this._curve.byteLength),n)}getPublicKey(e,t){if(this._publicKey===null)throw Error(`ECDH key not generated. Call generateKeys() or setPrivateKey() first.`);return formatReturnValue(encodePublicKey(this._publicKey,this._curve.byteLength,t||`uncompressed`),e)}getPrivateKey(e){if(this._privateKey===null)throw Error(`ECDH key not generated. Call generateKeys() or setPrivateKey() first.`);return formatReturnValue(bigintToBuffer(this._privateKey,this._curve.byteLength),e)}setPublicKey(e,t){let n=toBuffer$1(e,t);this._publicKey=decodePublicKey(n,this._curve)}setPrivateKey(e,t){let n=bufferToBigint(toBuffer$1(e,t));if(n===0n||n>=this._curve.n)throw Error(`Private key is out of range [1, n-1]`);this._privateKey=n;let r={x:this._curve.Gx,y:this._curve.Gy};this._publicKey=scalarMul(n,r,this._curve)}}});function normalizeAlgorithm(e){return e.toLowerCase().replace(/-/g,``)}function hashSize(e){let t=qi[normalizeAlgorithm(e)];if(t===void 0)throw Error(`Unknown hash algorithm: ${e}`);return t}function toBuffer(e,t){return typeof e==`string`?q.from(e,t||`utf8`):e instanceof DataView?q.from(e.buffer,e.byteOffset,e.byteLength):(e instanceof ArrayBuffer,q.from(e))}var qi,Ji,Yi,Xi=__esmMin(()=>{J(),qi={md5:16,sha1:20,sha256:32,sha384:48,sha512:64},Ji={md5:64,sha1:64,sha256:64,sha384:128,sha512:128},Yi=new Set([`md5`,`sha1`,`sha256`,`sha384`,`sha512`])});function getChecksumType(e){let t=Zi[normalizeAlgorithm(e)];if(t===void 0){let t=Error(`Unknown message digest: ${e}`);throw t.code=`ERR_CRYPTO_HASH_UNKNOWN`,t}return t}function getHashes(){return[`md5`,`sha1`,`sha256`,`sha384`,`sha512`]}function hash(e,t,n){return new Qi(e).update(t).digest(n)}var Zi,Qi,$i=__esmMin(()=>{Xi(),J(),A(),Zr(),Zi={md5:k.ChecksumType.MD5,sha1:k.ChecksumType.SHA1,sha256:k.ChecksumType.SHA256,sha384:k.ChecksumType.SHA384,sha512:k.ChecksumType.SHA512},Qi=class Hash extends Jr{_algorithm;_checksum;_finalized=!1;constructor(e){super();let t=normalizeAlgorithm(e),n=getChecksumType(t);this._algorithm=t,this._checksum=new k.Checksum(n)}update(e,t){if(this._finalized)throw Error(`Digest already called`);let n;if(typeof e==`string`){let r=normalizeEncoding(t);n=q.from(e,r)}else n=e instanceof Uint8Array?e:q.from(e);return this._checksum.update(n),this}digest(e){if(this._finalized)throw Error(`Digest already called`);this._finalized=!0;let t=this._checksum.get_string(),n=q.from(t,`hex`);return e?n.toString(e):n}copy(){if(this._finalized)throw Error(`Digest already called`);let e=Object.create(Hash.prototype);return Jr.call(e),e._algorithm=this._algorithm,e._finalized=!1,e._checksum=this._checksum.copy(),e}_transform(e,t,n){try{this.update(e,t),n()}catch(e){n(e)}}_flush(e){try{this.push(this.digest()),e()}catch(t){e(t)}}}}),Hmac,ea=__esmMin(()=>{Xi(),$i(),J(),Zr(),Hmac=class extends Jr{_algorithm;_innerHash;_outerKeyPad;_finalized=!1;constructor(e,t){super();let n=normalizeAlgorithm(e);if(!Yi.has(n)){let t=Error(`Unknown message digest: ${e}`);throw t.code=`ERR_CRYPTO_HASH_UNKNOWN`,t}this._algorithm=n;let r;r=typeof t==`string`?q.from(t,`utf8`):t instanceof Uint8Array?t:q.from(t);let i=Ji[n];if(r.length>i){let e=new Qi(n);e.update(r),r=e.digest()}let a=new Uint8Array(i);a.set(r);let o=new Uint8Array(i),s=new Uint8Array(i);for(let e=0;e<i;e++)o[e]=a[e]^54,s[e]=a[e]^92;this._outerKeyPad=s,this._innerHash=new Qi(n),this._innerHash.update(o)}update(e,t){if(this._finalized)throw Error(`Digest already called`);let n;if(typeof e==`string`){let r=normalizeEncoding(t);n=q.from(e,r)}else n=e instanceof Uint8Array?e:q.from(e);return this._innerHash.update(n),this}digest(e){if(this._finalized)throw Error(`Digest already called`);this._finalized=!0;let t=this._innerHash.digest(),n=new Qi(this._algorithm);n.update(this._outerKeyPad),n.update(t);let r=n.digest();return e?r.toString(e):r}_transform(e,t,n){try{this.update(e,t),n()}catch(e){n(e)}}_flush(e){try{this.push(this.digest()),e()}catch(t){e(t)}}}});function getCurve(e){let t=Gi[e.toLowerCase()];if(!t)throw Error(`Unsupported curve: ${e}`);return Wi[t]}function truncateHash(e,t){let n=t.n.toString(2).length,r=bytesToBigInt(e),i=e.length*8;return i>n&&(r>>=BigInt(i-n)),r}function hmacDigest$2(e,t,n){let r=new Hmac(e,t);return r.update(n),new Uint8Array(r.digest())}function rfc6979(e,t,n,r){let i=r.byteLength,a=n.length,o=new Uint8Array(a).fill(1),s=new Uint8Array(a).fill(0),c=bigIntToBytes(t,i),l=bigIntToBytes(mod(truncateHash(n,r),r.n),i),u=new Uint8Array(a+1+i+i);u.set(o,0),u[a]=0,u.set(c,a+1),u.set(l,a+1+i),s=hmacDigest$2(e,s,u),o=hmacDigest$2(e,s,o);let d=new Uint8Array(a+1+i+i);d.set(o,0),d[a]=1,d.set(c,a+1),d.set(l,a+1+i),s=hmacDigest$2(e,s,d),o=hmacDigest$2(e,s,o);for(let t=0;t<100;t++){let t=new Uint8Array;for(;t.length<i;){o=hmacDigest$2(e,s,o);let n=new Uint8Array(t.length+o.length);n.set(t,0),n.set(o,t.length),t=n}let n=truncateHash(t.slice(0,i),r);if(n>=1n&&n<r.n)return n;let c=new Uint8Array(a+1);c.set(o,0),c[a]=0,s=hmacDigest$2(e,s,c),o=hmacDigest$2(e,s,o)}throw Error(`RFC 6979: failed to generate valid k after 100 attempts`)}function ecdsaSign(e,t,n,r){let i=getCurve(r),a={x:i.Gx,y:i.Gy},o=bytesToBigInt(t),s=new Qi(e);s.update(n);let c=new Uint8Array(s.digest()),l=truncateHash(c,i),u=rfc6979(e,o,c,i),d=scalarMul(u,a,i);if(d===null)throw Error(`ECDSA: k * G is point at infinity`);let p=mod(d.x,i.n);if(p===0n)throw Error(`ECDSA: r is zero`);let m=mod(modInverse$2(u,i.n)*(l+p*o),i.n);if(m===0n)throw Error(`ECDSA: s is zero`);let h=i.byteLength,g=new Uint8Array(h*2);return g.set(bigIntToBytes(p,h),0),g.set(bigIntToBytes(m,h),h),g}function ecdsaVerify(e,t,n,r,i){let a=getCurve(i),o={x:a.Gx,y:a.Gy},s=a.byteLength;if(t[0]!==4||t.length!==1+s*2)return!1;let c={x:bytesToBigInt(t.slice(1,1+s)),y:bytesToBigInt(t.slice(1+s))};if(n.length!==s*2)return!1;let l=bytesToBigInt(n.slice(0,s)),u=bytesToBigInt(n.slice(s));if(l<1n||l>=a.n||u<1n||u>=a.n)return!1;let d=new Qi(e);d.update(r);let p=truncateHash(new Uint8Array(d.digest()),a),m=modInverse$2(u,a.n),h=mod(p*m,a.n),g=mod(l*m,a.n),_=pointAdd(scalarMul(h,o,a),scalarMul(g,c,a),a);return _===null?!1:mod(_.x,a.n)===l}var ta=__esmMin(()=>{Ii(),Ki(),$i(),ea(),__name(hmacDigest$2,`hmacDigest`)});function hmacDigest$1(e,t,n){let r=new Hmac(e,t);return r.update(n),r.digest()}function hkdfExtract(e,t,n){return hmacDigest$1(e,n,t)}function hkdfExpand(e,t,n,r,i){let a=Math.ceil(r/i);if(a>255)throw Error(`HKDF cannot generate more than 255 * HashLen bytes`);let o=q.allocUnsafe(a*i),s=q.alloc(0);for(let r=1;r<=a;r++)s=hmacDigest$1(e,t,q.concat([s,n,q.from([r])])),s.copy(o,(r-1)*i);return q.from(o.buffer,o.byteOffset,r)}function hkdfSync(e,t,n,r,i){let a=normalizeAlgorithm(e),o=qi[a];if(!Yi.has(a)||o===void 0)throw TypeError(`Unknown message digest: ${e}`);if(typeof i!=`number`||i<0)throw TypeError(`keylen must be a non-negative number`);let s=toBuffer(t),c=toBuffer(n),l=toBuffer(r),u=hkdfExpand(a,hkdfExtract(a,s,c.length===0?q.alloc(o,0):c),l,i,o),d=new ArrayBuffer(u.length);return new Uint8Array(d).set(u),d}function hkdf(e,t,n,r,i,a){setTimeout(()=>{try{a(null,hkdfSync(e,t,n,r,i))}catch(e){a(e instanceof Error?e:Error(String(e)))}},0)}var na=__esmMin(()=>{Xi(),ea(),J(),__name(hmacDigest$1,`hmacDigest`)});function hmacDigest(e,t,n){let r=new Hmac(e,t);return r.update(n),r.digest()}function validateParameters(e,t){if(typeof e!=`number`||e<0||!Number.isFinite(e)||e===0)throw TypeError(`iterations must be a positive number`);if(typeof t!=`number`||t<0||!Number.isFinite(t)||t>2147483647)throw TypeError(`keylen must be a positive number`)}function pbkdf2Sync(e,t,n,r,i){validateParameters(n,r);let a=toBuffer(e),o=toBuffer(t),s=normalizeAlgorithm(i||`sha1`),c=qi[s];if(!Yi.has(s)||c===void 0)throw TypeError(`Unknown message digest: ${i||`sha1`}`);if(r===0)return q.alloc(0);let l=Math.ceil(r/c),u=q.allocUnsafe(l*c);for(let e=1;e<=l;e++){let t=q.allocUnsafe(o.length+4);o.copy(t,0),t.writeUInt32BE(e,o.length);let r=hmacDigest(s,a,t),i=q.from(r);for(let e=1;e<n;e++){r=hmacDigest(s,a,r);for(let e=0;e<c;e++)i[e]^=r[e]}i.copy(u,(e-1)*c)}return q.from(u.buffer,u.byteOffset,r)}function pbkdf2(e,t,n,r,i,a){validateParameters(n,r),setTimeout(()=>{try{a(null,pbkdf2Sync(e,t,n,r,i))}catch(e){a(e instanceof Error?e:Error(String(e)))}},0)}var ra=__esmMin(()=>{Xi(),ea(),J()});function R(e,t){return(e<<t|e>>>32-t)>>>0}function salsa20_8(e){let t=new Uint32Array(16);for(let n=0;n<16;n++)t[n]=e[n];for(let e=0;e<4;e++)t[4]^=R(t[0]+t[12],7),t[8]^=R(t[4]+t[0],9),t[12]^=R(t[8]+t[4],13),t[0]^=R(t[12]+t[8],18),t[9]^=R(t[5]+t[1],7),t[13]^=R(t[9]+t[5],9),t[1]^=R(t[13]+t[9],13),t[5]^=R(t[1]+t[13],18),t[14]^=R(t[10]+t[6],7),t[2]^=R(t[14]+t[10],9),t[6]^=R(t[2]+t[14],13),t[10]^=R(t[6]+t[2],18),t[3]^=R(t[15]+t[11],7),t[7]^=R(t[3]+t[15],9),t[11]^=R(t[7]+t[3],13),t[15]^=R(t[11]+t[7],18),t[1]^=R(t[0]+t[3],7),t[2]^=R(t[1]+t[0],9),t[3]^=R(t[2]+t[1],13),t[0]^=R(t[3]+t[2],18),t[6]^=R(t[5]+t[4],7),t[7]^=R(t[6]+t[5],9),t[4]^=R(t[7]+t[6],13),t[5]^=R(t[4]+t[7],18),t[11]^=R(t[10]+t[9],7),t[8]^=R(t[11]+t[10],9),t[9]^=R(t[8]+t[11],13),t[10]^=R(t[9]+t[8],18),t[12]^=R(t[15]+t[14],7),t[13]^=R(t[12]+t[15],9),t[14]^=R(t[13]+t[12],13),t[15]^=R(t[14]+t[13],18);for(let n=0;n<16;n++)e[n]=e[n]+t[n]>>>0}function blockMix(e,t){let n=2*t*16,r=new Uint32Array(16);for(let t=0;t<16;t++)r[t]=e[n-16+t];let i=new Uint32Array(n);for(let n=0;n<2*t;n++){for(let t=0;t<16;t++)r[t]^=e[n*16+t];salsa20_8(r);for(let e=0;e<16;e++)i[n*16+e]=r[e]}for(let n=0;n<t;n++)for(let t=0;t<16;t++)e[n*16+t]=i[2*n*16+t];for(let n=0;n<t;n++)for(let r=0;r<16;r++)e[(t+n)*16+r]=i[(2*n+1)*16+r]}function roMix(e,t,n){let r=2*n*16,i=Array.from({length:t});for(let r=0;r<t;r++)i[r]=new Uint32Array(e),blockMix(e,n);for(let a=0;a<t;a++){let a=e[r-16]&t-1;for(let t=0;t<r;t++)e[t]^=i[a][t];blockMix(e,n)}}function bytesToWords(e){let t=new Uint32Array(e.length/4);for(let n=0;n<t.length;n++)t[n]=e[n*4]|e[n*4+1]<<8|e[n*4+2]<<16|e[n*4+3]<<24;return t}function wordsToBytes(e){let t=new Uint8Array(e.length*4);for(let n=0;n<e.length;n++)t[n*4]=e[n]&255,t[n*4+1]=e[n]>>8&255,t[n*4+2]=e[n]>>16&255,t[n*4+3]=e[n]>>24&255;return t}function scryptCore(e,t,n,r,i,a){let o=128*r,s=pbkdf2Sync(e,t,1,i*o,`sha256`);for(let e=0;e<i;e++){let t=new Uint8Array(s.buffer,s.byteOffset+e*o,o),i=bytesToWords(t);roMix(i,n,r);let a=wordsToBytes(i);t.set(a)}return pbkdf2Sync(e,s,1,a,`sha256`)}function scryptSync(e,t,n,r){let i=q.from(e),a=q.from(t),o=r?.N??16384,s=r?.r??8,c=r?.p??1;if(o<=0||o&o-1)throw Error(`N must be a positive power of 2`);return scryptCore(i,a,o,s,c,n)}function scrypt(e,t,n,r,i){let a={},o;typeof r==`function`?o=r:(a=r,o=i);try{let r=scryptSync(e,t,n,a);setTimeout(()=>o(null,r),0)}catch(e){setTimeout(()=>o(e instanceof Error?e:Error(String(e)),q.alloc(0)),0)}}var ia=__esmMin(()=>{ra(),J()});function pemToDer(e){let t=e.trim().split(/\r?\n/),n=t.findIndex(e=>e.startsWith(`-----BEGIN `));if(n===-1)throw Error(`Invalid PEM: no BEGIN line found`);let r=t[n].match(/^-----BEGIN (.+)-----$/);if(!r)throw Error(`Invalid PEM header format`);let i=r[1],a=t.findIndex((e,t)=>t>n&&e.startsWith(`-----END `));if(a===-1)throw Error(`Invalid PEM: no END line found`);let o=t.slice(n+1,a).join(``),s=q.from(o,`base64`);return{type:i,der:new Uint8Array(s.buffer,s.byteOffset,s.byteLength)}}function parseTlv(e,t){if(t>=e.length)throw Error(`ASN.1 parse error: unexpected end of data`);let n=e[t++],r,i=e[t++];if(i<128)r=i;else{let n=i&127;if(n===0)throw Error(`ASN.1 parse error: indefinite length not supported`);r=0;for(let i=0;i<n;i++)r=r<<8|e[t++]}let a=e.slice(t,t+r),o=t+r,s={tag:n,data:a};return n===48&&(s.children=parseSequenceChildren(a)),{value:s,next:o}}function parseSequenceChildren(e){let t=[],n=0;for(;n<e.length;){let{value:r,next:i}=parseTlv(e,n);t.push(r),n=i}return t}function parseDer(e){let{value:t}=parseTlv(e,0);return t}function integerToBigInt(e){let t=0;for(;t<e.length-1&&e[t]===0;)t++;let n=0n;for(let r=t;r<e.length;r++)n=n<<8n|BigInt(e[r]);return n}function oidsEqual(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function parseRsaPublicKeyPkcs1(e){let t=e.children;if(!t||t.length<2)throw Error(`Invalid PKCS#1 RSAPublicKey structure`);return{n:integerToBigInt(t[0].data),e:integerToBigInt(t[1].data)}}function parseRsaPrivateKeyPkcs1(e){let t=e.children;if(!t||t.length<6)throw Error(`Invalid PKCS#1 RSAPrivateKey structure`);return{n:integerToBigInt(t[1].data),e:integerToBigInt(t[2].data),d:integerToBigInt(t[3].data),p:integerToBigInt(t[4].data),q:integerToBigInt(t[5].data)}}function parseSubjectPublicKeyInfo(e){let t=e.children;if(!t||t.length<2)throw Error(`Invalid SubjectPublicKeyInfo structure`);let n=t[0];if(!n.children||n.children.length<1)throw Error(`Invalid AlgorithmIdentifier`);let r=n.children[0];if(r.tag!==6||!oidsEqual(r.data,aa))throw Error(`Unsupported algorithm: only RSA is supported`);let i=t[1];if(i.tag!==3)throw Error(`Expected BIT STRING for public key data`);return parseRsaPublicKeyPkcs1(parseDer(i.data.slice(1)))}function parsePrivateKeyInfo(e){let t=e.children;if(!t||t.length<3)throw Error(`Invalid PrivateKeyInfo structure`);let n=t[1];if(!n.children||n.children.length<1)throw Error(`Invalid AlgorithmIdentifier`);let r=n.children[0];if(r.tag!==6||!oidsEqual(r.data,aa))throw Error(`Unsupported algorithm: only RSA is supported`);let i=t[2];if(i.tag!==4)throw Error(`Expected OCTET STRING for private key data`);return parseRsaPrivateKeyPkcs1(parseDer(i.data))}function encodeLength(e){if(e<128)return new Uint8Array([e]);let t=[],n=e;for(;n>0;)t.unshift(n&255),n>>=8;return new Uint8Array([128|t.length,...t])}function encodeTlv(e,t){let n=encodeLength(t.length),r=new Uint8Array(1+n.length+t.length);return r[0]=e,r.set(n,1),r.set(t,1+n.length),r}function bigintToAsn1Integer(e){if(e===0n)return encodeTlv(2,new Uint8Array([0]));let t=e.toString(16),n=t.length%2?`0`+t:t,r=[];for(let e=0;e<n.length;e+=2)r.push(parseInt(n.substring(e,e+2),16));return r[0]&128&&r.unshift(0),encodeTlv(2,new Uint8Array(r))}function encodeSequence(e){let t=0;for(let n of e)t+=n.length;let n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.length;return encodeTlv(48,n)}function encodeBitString(e){let t=new Uint8Array(1+e.length);return t[0]=0,t.set(e,1),encodeTlv(3,t)}function encodeOctetString(e){return encodeTlv(4,e)}function encodeOid(e){return encodeTlv(6,e)}function encodeNull(){return new Uint8Array([5,0])}function encodeRsaPublicKeyPkcs1(e){return encodeSequence([bigintToAsn1Integer(e.n),bigintToAsn1Integer(e.e)])}function encodeSubjectPublicKeyInfo(e){return encodeSequence([encodeSequence([encodeOid(aa),encodeNull()]),encodeBitString(encodeRsaPublicKeyPkcs1(e))])}function encodeRsaPrivateKeyPkcs1(e){let t=e.d%(e.p-1n),n=e.d%(e.q-1n),r=modInverse$1(e.q,e.p);return encodeSequence([bigintToAsn1Integer(0n),bigintToAsn1Integer(e.n),bigintToAsn1Integer(e.e),bigintToAsn1Integer(e.d),bigintToAsn1Integer(e.p),bigintToAsn1Integer(e.q),bigintToAsn1Integer(t),bigintToAsn1Integer(n),bigintToAsn1Integer(r)])}function encodePrivateKeyInfo(e){let t=encodeSequence([encodeOid(aa),encodeNull()]),n=encodeOctetString(encodeRsaPrivateKeyPkcs1(e));return encodeSequence([bigintToAsn1Integer(0n),t,n])}function derToPem(e,t){let n=q.from(e).toString(`base64`),r=[`-----BEGIN ${t}-----`];for(let e=0;e<n.length;e+=64)r.push(n.substring(e,e+64));return r.push(`-----END ${t}-----`),r.join(`
|
|
5
|
+
`+t)}profile(e){}profileEnd(e){}timeStamp(e){}},P=new Console,log=(...e)=>P.log(...e),info=(...e)=>P.info(...e),debug=(...e)=>P.debug(...e),warn=(...e)=>P.warn(...e),error=(...e)=>P.error(...e),dir=(e,t)=>P.dir(e,t),dirxml=(...e)=>P.dirxml(...e),table=(e,t)=>P.table(e,t),clear=()=>P.clear(),assert=(e,...t)=>P.assert(e,...t),trace=(...e)=>P.trace(...e),time=e=>P.time(e),timeEnd=e=>P.timeEnd(e),timeLog=(e,...t)=>P.timeLog(e,...t),count=e=>P.count(e),countReset=e=>P.countReset(e),group=(...e)=>P.group(...e),groupCollapsed=(...e)=>P.groupCollapsed(...e),groupEnd=()=>P.groupEnd(),profile=e=>{},profileEnd=e=>{},timeStamp=e=>{}}),F,I=__esmMin(()=>{me(),F={log,info,debug,warn,error,dir,dirxml,table,time,timeEnd,timeLog,trace,assert,clear,count,countReset,group,groupCollapsed,groupEnd,profile,profileEnd,timeStamp}}),he=__esmMin(()=>{I()}),ge,_e=__esmMin(()=>{ge=__name(e=>{Promise.resolve().then(e)},`queueMicrotask`)});function drainOnce(e){let t=Math.min(64,ve.length);for(let n=0;n<t;n++){let t=ve.shift();try{t()}catch(t){try{e.log_default_handler(`gjsify-nextTick`,e.LogLevelFlags.LEVEL_WARNING,String(t?.stack||t),null)}catch{}}}ve.length>0?e.timeout_add(e.PRIORITY_DEFAULT,1,()=>(drainOnce(e),!1)):ye=!1}function tryGLibTimeout(e){let t=globalThis.imports?.gi?.GLib;return t?.timeout_add?(ve.push(e),ye||(ye=!0,t.timeout_add(t.PRIORITY_DEFAULT,0,()=>(drainOnce(t),!1))),!0):!1}var ve,ye,nextTick,be=__esmMin(()=>{ve=[],ye=!1,nextTick=(e,...t)=>{let n=t.length>0?()=>e(...t):e;if(!tryGLibTimeout(n)){if(typeof globalThis.process?.nextTick==`function`){globalThis.process.nextTick(e,...t);return}if(typeof queueMicrotask==`function`){queueMicrotask(n);return}Promise.resolve().then(n)}}}),xe,Se=__esmMin(()=>{A(),N(),{File:xe}=M});function classOf(e){return Ce.call(e).slice(8,-1)}function throwDataCloneError(e){let t=globalThis.DOMException;if(typeof t==`function`)throw new t(e,`DataCloneError`);let n=Error(e);throw n.name=`DataCloneError`,n}function internalClone(e,t,n){if(e==null)return e;let r=typeof e;if(r===`boolean`||r===`number`||r===`string`||r===`bigint`)return e;r===`symbol`&&throwDataCloneError(`Symbol cannot be cloned`),r===`function`&&throwDataCloneError(`Function cannot be cloned`);let i=e;if(t.has(i))return t.get(i);let a=classOf(i);if(a===`Date`)return new Date(i.getTime());if(a===`RegExp`)return new RegExp(i.source,i.flags);if(a===`Boolean`||a===`Number`||a===`String`)return Object(i.valueOf());if(a===`BigInt`)return Object(BigInt.prototype.valueOf.call(i));if(i instanceof Error){let e=i,r=e.constructor?.name,a=new(r&&we[r]||we[e.name]||Error)(e.message);return a.name=e.name,`cause`in e&&Object.defineProperty(a,`cause`,{value:internalClone(e.cause,t,n),writable:!0,enumerable:!1,configurable:!0}),a}if(a===`DOMException`){let e=globalThis.DOMException;if(typeof e==`function`){let t=i;return new e(t.message,t.name)}}if(a===`ArrayBuffer`){let e=i;if(n&&n.transferred.has(e)){let r=n.transferred.get(e);return t.set(i,r),r}(e.detached===!0||e.byteLength===0&&e.detached)&&throwDataCloneError(`ArrayBuffer is detached and cannot be cloned`);let r=e.slice(0);return t.set(i,r),r}if(a===`SharedArrayBuffer`||i&&typeof i==`object`&&i.constructor?.name===`SharedBuffer`)return i;if(a===`DataView`){let e=i,r=n?.viewSnapshots.get(i),a=internalClone(e.buffer,t,n),o=r?r.byteOffset:e.byteOffset,s=r?r.byteLength:e.byteLength,c=new DataView(a,o,s);return t.set(i,c),c}if(Te.has(a)){let e=i,r=n?.viewSnapshots.get(i),a=internalClone(e.buffer,t,n),o=e.constructor,s=new o(a,r?r.byteOffset:e.byteOffset,r?r.length:e.length);return t.set(i,s),s}if(a===`Map`){let e=new Map;t.set(i,e);for(let[r,a]of i)e.set(internalClone(r,t,n),internalClone(a,t,n));return e}if(a===`Set`){let e=new Set;t.set(i,e);for(let r of i)e.add(internalClone(r,t,n));return e}{let e=globalThis,t=e.Blob,n=e.File;if(typeof n==`function`&&i instanceof n){let e=i;return new n([i],e.name,{type:e.type,lastModified:e.lastModified})}if(typeof t==`function`&&i instanceof t)return new t([i],{type:i.type})}if(i instanceof WeakMap&&throwDataCloneError(`WeakMap cannot be cloned`),i instanceof WeakSet&&throwDataCloneError(`WeakSet cannot be cloned`),i instanceof WeakRef&&throwDataCloneError(`WeakRef cannot be cloned`),typeof globalThis.Promise==`function`&&i instanceof Promise&&throwDataCloneError(`Promise cannot be cloned`),a===`Array`){let e=i,r=[];t.set(i,r);for(let i=0;i<e.length;i++)i in e&&(r[i]=internalClone(e[i],t,n));return r}if(a===`Object`||typeof i==`object`){let e={};t.set(i,e);for(let r of Object.keys(i))e[r]=internalClone(i[r],t,n);return e}throwDataCloneError(`${a} cannot be cloned`)}function structuredClone$1(e,t){let n=t?.transfer;if(!n||n.length===0)return internalClone(e,new Map);let r=new Set;for(let e of n)if(classOf(e)===`ArrayBuffer`){let t=e;t.detached===!0&&throwDataCloneError(`ArrayBuffer in transfer list is detached`),r.add(t)}let i=new Map;r.size>0&&snapshotViewsBackedByTransferredBuffers(e,r,i,new Set);let a=new Map;for(let e of r){let t=e;typeof t.transfer!=`function`&&throwDataCloneError(`ArrayBuffer.prototype.transfer() not available — runtime is not SM140+`),a.set(e,t.transfer())}return internalClone(e,new Map,{transferred:a,viewSnapshots:i})}function snapshotViewsBackedByTransferredBuffers(e,t,n,r){if(typeof e!=`object`||!e)return;let i=e;if(r.has(i))return;r.add(i);let a=classOf(i);if(a===`DataView`){let e=i;t.has(e.buffer)&&n.set(i,{byteOffset:e.byteOffset,length:0,byteLength:e.byteLength});return}if(Te.has(a)){let e=i;t.has(e.buffer)&&n.set(i,{byteOffset:e.byteOffset,length:e.length,byteLength:e.byteLength});return}if(Array.isArray(i)){for(let e=0;e<i.length;e++)e in i&&snapshotViewsBackedByTransferredBuffers(i[e],t,n,r);return}if(a===`Map`){for(let[e,a]of i)snapshotViewsBackedByTransferredBuffers(e,t,n,r),snapshotViewsBackedByTransferredBuffers(a,t,n,r);return}if(a===`Set`){for(let e of i)snapshotViewsBackedByTransferredBuffers(e,t,n,r);return}if(a===`Object`)for(let e of Object.keys(i))snapshotViewsBackedByTransferredBuffers(i[e],t,n,r)}var Ce,we,Te,Ee=__esmMin(()=>{({toString:Ce}=Object.prototype),we={Error,EvalError,RangeError,ReferenceError,SyntaxError,TypeError,URIError},Te=new Set([`Int8Array`,`Uint8Array`,`Uint8ClampedArray`,`Int16Array`,`Uint16Array`,`Int32Array`,`Uint32Array`,`Float32Array`,`Float64Array`,`BigInt64Array`,`BigUint64Array`]),__name(structuredClone$1,`structuredClone`)});function ensureMainLoop(){let e=globalThis.imports;if(!e)return;if(De)return Oe;let t=e.gi?.GLib;if(t){if(Oe=new t.MainLoop(null,!1),De=!0,t.main_depth()===0)try{Oe.runAsync()}catch{}return Oe}}function quitMainLoop(){Oe&&=(Oe.quit(),De=!1,null)}var De,Oe,ke=__esmMin(()=>{De=!1,Oe=null}),L=__esmMin(()=>{T(),E(),j(),ee(),te(),ne(),se(),ue(),de(),fe(),he(),_e(),be(),Se(),Ee(),ke()});w(),L(),registerGlobal(`Blob`,x),registerGlobal(`File`,S);var Ae=Object.defineProperty;__name((e,t)=>{let n={};for(var r in e)Ae(n,r,{get:e[r],enumerable:!0});return t||Ae(n,Symbol.toStringTag,{value:`Module`}),n},`__exportAll`)({attributes:()=>U,childNodesList:()=>V,elementChildren:()=>H,isConnected:()=>je,localName:()=>Ne,name:()=>Ie,namespaceURI:()=>Pe,nodeType:()=>z,ownerElement:()=>Re,parentNode:()=>B,prefix:()=>Fe,propertyEventListeners:()=>W,tagName:()=>Me,value:()=>Le});const z=Symbol(`nodeType`),B=Symbol(`parentNode`),V=Symbol(`childNodesList`),H=Symbol(`elementChildren`),je=Symbol(`isConnected`),Me=Symbol(`tagName`),Ne=Symbol(`localName`),Pe=Symbol(`namespaceURI`),Fe=Symbol(`prefix`),U=Symbol(`attributes`),W=Symbol(`propertyEventListeners`),Ie=Symbol(`name`),Le=Symbol(`value`),Re=Symbol(`ownerElement`),G={ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3,CDATA_SECTION_NODE:4,PROCESSING_INSTRUCTION_NODE:7,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_TYPE_NODE:10,DOCUMENT_FRAGMENT_NODE:11};var NodeList=class{constructor(e){this._items=e}get length(){return this._items.length}item(e){return this._items[e]??null}forEach(e,t){for(let n=0;n<this._items.length;n++)e.call(t,this._items[n],n,this)}entries(){return this._items.entries()}keys(){return this._items.keys()}values(){return this._items.values()}[Symbol.iterator](){return this._items[Symbol.iterator]()}get[Symbol.toStringTag](){return`NodeList`}};const ze={IndexSizeError:1,HierarchyRequestError:3,WrongDocumentError:4,InvalidCharacterError:5,NoModificationAllowedError:7,NotFoundError:8,NotSupportedError:9,InUseAttributeError:10,InvalidStateError:11,SyntaxError:12,InvalidModificationError:13,NamespaceError:14,InvalidAccessError:15,TypeMismatchError:17,SecurityError:18,NetworkError:19,AbortError:20,URLMismatchError:21,QuotaExceededError:22,TimeoutError:23,InvalidNodeTypeError:24,DataCloneError:25};var _DOMExceptionPolyfill=class extends Error{code;constructor(e,t){super(e),this.name=t||`Error`,this.code=Object.hasOwn(ze,this.name)?ze[this.name]:0}};const Be=globalThis.DOMException===void 0?_DOMExceptionPolyfill:globalThis.DOMException;I();const Ve=Symbol(`type`),He=Symbol(`bubbles`),Ue=Symbol(`cancelable`),We=Symbol(`composed`),Ge=Symbol(`target`),Ke=Symbol(`currentTarget`),qe=Symbol(`eventPhase`),Je=Symbol(`defaultPrevented`),Ye=Symbol(`isTrusted`),Xe=Symbol(`timeStamp`),Ze=Symbol(`stop`),Qe=Symbol(`immediateStop`),$e=Symbol(`dispatching`),et=Symbol(`inPassiveListener`);var Event=class{[Ve];[He];[Ue];[We];[Ge]=null;[Ke]=null;[qe]=0;[Je]=!1;[Ye]=!1;[Xe];[Ze]=!1;[Qe]=!1;[$e]=!1;[et]=!1;get type(){return this[Ve]}get bubbles(){return this[He]}get cancelable(){return this[Ue]}get composed(){return this[We]}get target(){return this[Ge]}get currentTarget(){return this[Ke]}get eventPhase(){return this[qe]}get defaultPrevented(){return this[Je]}get timeStamp(){return this[Xe]}get cancelBubble(){return this[Ze]}set cancelBubble(e){e&&this.stopPropagation()}get returnValue(){return!this[Je]}set returnValue(e){e||this.preventDefault()}get srcElement(){return this[Ge]}static NONE=0;static CAPTURING_PHASE=1;static AT_TARGET=2;static BUBBLING_PHASE=3;get[Symbol.toStringTag](){return`Event`}constructor(e,t){this[Ve]=e,this[He]=t?.bubbles??!1,this[Ue]=t?.cancelable??!1,this[We]=t?.composed??!1,this[Xe]=Date.now(),Object.defineProperty(this,`isTrusted`,{get:()=>this[Ye],enumerable:!0,configurable:!1})}composedPath(){return this[Ke]?[this[Ke]]:[]}preventDefault(){this[Ue]&&!this[et]&&(this[Je]=!0)}stopPropagation(){this[Ze]=!0}stopImmediatePropagation(){this[Ze]=!0,this[Qe]=!0}},EventTarget=class{_listeners=new Map;get[Symbol.toStringTag](){return`EventTarget`}addEventListener(e,t,n){if(t===null)return;let r=typeof n==`boolean`?n:n?.capture??!1,i=typeof n==`object`?n?.once??!1:!1,a=typeof n==`object`?n?.passive??!1:!1,o=this._listeners.get(e);o||(o=[],this._listeners.set(e,o));for(let e of o)if(e.listener===t&&e.capture===r)return;let s={listener:t,capture:r,once:i,passive:a,removed:!1};o.push(s),typeof n==`object`&&n?.signal&&n.signal.addEventListener(`abort`,()=>{this.removeEventListener(e,t,{capture:r})},{once:!0})}removeEventListener(e,t,n){if(t===null)return;let r=typeof n==`boolean`?n:n?.capture??!1,i=this._listeners.get(e);if(!i)return;let a=i.findIndex(e=>e.listener===t&&e.capture===r);a!==-1&&(i[a].removed=!0,i.splice(a,1),i.length===0&&this._listeners.delete(e))}dispatchEvent(e){let t=e;if(t[$e])throw new Be(`The event is already being dispatched.`,`InvalidStateError`);t[$e]=!0,t[Ge]=this,t[Ke]=this,t[qe]=Event.AT_TARGET;let n=this._listeners.get(e.type);if(n){let r=[...n];for(let n of r)if(!n.removed){if(t[Qe]||t[Ze])break;n.once&&this.removeEventListener(e.type,n.listener,{capture:n.capture});try{n.passive&&(t[et]=!0),typeof n.listener==`function`?n.listener.call(this,e):typeof n.listener.handleEvent==`function`&&n.listener.handleEvent.call(n.listener,e)}catch(e){let t=globalThis;if(typeof t.reportError==`function`)try{t.reportError(e)}catch{}else if(e instanceof Error){let t=`${e.name}: ${e.message}`;F.error(e.stack?`${t}\n${e.stack}`:t)}else F.error(String(e))}finally{t[et]=!1}}}return t[qe]=Event.NONE,t[Ke]=null,t[$e]=!1,!e.defaultPrevented}};for(let[e,t]of[[`NONE`,0],[`CAPTURING_PHASE`,1],[`AT_TARGET`,2],[`BUBBLING_PHASE`,3]])Object.defineProperty(Event.prototype,e,{value:t,writable:!1,enumerable:!0,configurable:!1}),Object.defineProperty(Event,e,{value:t,writable:!1,enumerable:!0,configurable:!1});let tt,nt,rt,it,at;var ot=class Node extends EventTarget{constructor(...e){super(...e),this.ELEMENT_NODE=G.ELEMENT_NODE,this.ATTRIBUTE_NODE=G.ATTRIBUTE_NODE,this.TEXT_NODE=G.TEXT_NODE,this.CDATA_SECTION_NODE=G.CDATA_SECTION_NODE,this.PROCESSING_INSTRUCTION_NODE=G.PROCESSING_INSTRUCTION_NODE,this.COMMENT_NODE=G.COMMENT_NODE,this.DOCUMENT_NODE=G.DOCUMENT_NODE,this.DOCUMENT_TYPE_NODE=G.DOCUMENT_TYPE_NODE,this.DOCUMENT_FRAGMENT_NODE=G.DOCUMENT_FRAGMENT_NODE,this[tt]=G.ELEMENT_NODE,this[nt]=null,this[rt]=[],this[it]=[],this[at]=!1}static{this.ELEMENT_NODE=G.ELEMENT_NODE}static{this.ATTRIBUTE_NODE=G.ATTRIBUTE_NODE}static{this.TEXT_NODE=G.TEXT_NODE}static{this.CDATA_SECTION_NODE=G.CDATA_SECTION_NODE}static{this.PROCESSING_INSTRUCTION_NODE=G.PROCESSING_INSTRUCTION_NODE}static{this.COMMENT_NODE=G.COMMENT_NODE}static{this.DOCUMENT_NODE=G.DOCUMENT_NODE}static{this.DOCUMENT_TYPE_NODE=G.DOCUMENT_TYPE_NODE}static{this.DOCUMENT_FRAGMENT_NODE=G.DOCUMENT_FRAGMENT_NODE}static{this.DOCUMENT_POSITION_DISCONNECTED=1}static{this.DOCUMENT_POSITION_PRECEDING=2}static{this.DOCUMENT_POSITION_FOLLOWING=4}static{this.DOCUMENT_POSITION_CONTAINS=8}static{this.DOCUMENT_POSITION_CONTAINED_BY=16}static{this.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC=32}get nodeType(){return this[z]}get nodeName(){return``}get parentNode(){return this[B]}get parentElement(){let e=this[B];return e&&e[z]===G.ELEMENT_NODE?e:null}get childNodes(){return new NodeList(this[V])}get firstChild(){return this[V][0]??null}get lastChild(){let e=this[V];return e[e.length-1]??null}get previousSibling(){let e=this[B];if(!e)return null;let t=e[V],n=t.indexOf(this);return n>0?t[n-1]:null}get nextSibling(){let e=this[B];if(!e)return null;let t=e[V],n=t.indexOf(this);return n!==-1&&n<t.length-1?t[n+1]:null}get textContent(){return null}set textContent(e){}get nodeValue(){return null}set nodeValue(e){}get ownerDocument(){let e=this;for(;e[B];)e=e[B];let t=globalThis.document;return e===t?t:null}get isConnected(){return this[je]}hasChildNodes(){return this[V].length>0}contains(e){if(e===null)return!1;if(e===this)return!0;let t=e;for(;t;){if(t===this)return!0;t=t[B]}return!1}getRootNode(){let e=this;for(;e[B];)e=e[B];return e}appendChild(e){return e[B]&&e[B].removeChild(e),e[B]=this,this[V].push(e),e[z]===G.ELEMENT_NODE&&this[H].push(e),e}removeChild(e){let t=this[V],n=t.indexOf(e);if(n===-1)throw new DOMException(`Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node.`,`NotFoundError`);if(t.splice(n,1),e[B]=null,e[z]===G.ELEMENT_NODE){let t=this[H].indexOf(e);t!==-1&&this[H].splice(t,1)}return e}insertBefore(e,t){if(t===null)return this.appendChild(e);let n=this[V],r=n.indexOf(t);if(r===-1)throw new DOMException(`Failed to execute 'insertBefore' on 'Node': The node before which the new node is to be inserted is not a child of this node.`,`NotFoundError`);if(e[B]&&e[B].removeChild(e),e[B]=this,n.splice(r,0,e),e[z]===G.ELEMENT_NODE){let t=this[H],i=t.length;for(let a=r;a<n.length;a++)if(n[a][z]===G.ELEMENT_NODE&&n[a]!==e){i=t.indexOf(n[a]);break}t.splice(i,0,e)}return e}replaceChild(e,t){return this.insertBefore(e,t),this.removeChild(t),t}cloneNode(e=!1){let t=new this.constructor;if(t[z]=this[z],e)for(let e of this[V])t.appendChild(e.cloneNode(!0));return t}dispatchEvent(e){let t=super.dispatchEvent(e);if(e.bubbles&&!e.cancelBubble){let t=this[B];for(;t&&(Object.getPrototypeOf(Node.prototype).dispatchEvent.call(t,e),!e.cancelBubble);)t=t[B]}return t}get[(tt=z,nt=B,rt=V,it=H,at=je,Symbol.toStringTag)](){return`Node`}};const st={html:`http://www.w3.org/1999/xhtml`,svg:`http://www.w3.org/2000/svg`,mathML:`http://www.w3.org/1998/Math/MathML`,xml:`http://www.w3.org/XML/1998/namespace`,xmlns:`http://www.w3.org/2000/xmlns/`};var Attr=class{constructor(e,t,n=null,r=null,i=null){this.specified=!0,this[Ie]=e,this[Le]=t,this[Re]=i,this.namespaceURI=n,this.prefix=r;let a=e.indexOf(`:`);this.localName=a===-1?e:e.slice(a+1)}get name(){return this[Ie]}get value(){return this[Le]}set value(e){this[Le]=e}get ownerElement(){return this[Re]}get[Symbol.toStringTag](){return`Attr`}},NamedNodeMap=class{constructor(e){this._items=[],this._ownerElement=e}get length(){return this._items.length}item(e){return this._items[e]??null}getNamedItem(e){return this._findByName(e)}getNamedItemNS(e,t){let n=e===``?null:e;for(let e of this._items)if(e.namespaceURI===n&&e.localName===t)return e;return null}setNamedItem(e){return this._setAttr(e)}setNamedItemNS(e){return this._setAttr(e)}removeNamedItem(e){let t=this._findByName(e);if(!t)throw new DOMException(`Failed to execute 'removeNamedItem' on 'NamedNodeMap': No item with name '${e}' was found.`,`NotFoundError`);return this._removeAttr(t),t}removeNamedItemNS(e,t){let n=this.getNamedItemNS(e,t);if(!n)throw new DOMException(`Failed to execute 'removeNamedItemNS' on 'NamedNodeMap': No item with namespace '${e}' and localName '${t}' was found.`,`NotFoundError`);return this._removeAttr(n),n}[Symbol.iterator](){return this._items[Symbol.iterator]()}get[Symbol.toStringTag](){return`NamedNodeMap`}_setNamedItem(e,t,n=null,r=null){let i=n===null?this._findByName(e):this.getNamedItemNS(n,e.includes(`:`)?e.split(`:`)[1]:e);if(i)i.value=t;else{let i=new Attr(e,t,n,r,this._ownerElement);this._items.push(i)}}_removeNamedItem(e){let t=this._findByName(e);return t?(this._removeAttr(t),!0):!1}_removeNamedItemNS(e,t){let n=this.getNamedItemNS(e,t);return n?(this._removeAttr(n),!0):!1}_findByName(e){let t=this._ownerElement.namespaceURI===st.html,n=t?e.toLowerCase():e;for(let e of this._items)if((t?e.name.toLowerCase():e.name)===n)return e;return null}_setAttr(e){let t=null;if(t=e.namespaceURI===null?this._findByName(e.name):this.getNamedItemNS(e.namespaceURI,e.localName),t){let n=new Attr(t.name,t.value,t.namespaceURI,t.prefix,t.ownerElement);return t.value=e.value,n}return this._items.push(e),null}_removeAttr(e){let t=this._items.indexOf(e);t!==-1&&this._items.splice(t,1)}};I();let ct,lt,ut,dt,ft,pt;var Element=class extends ot{constructor(){super(),this[ct]=``,this[lt]=``,this[ut]=st.html,this[dt]=null,this[ft]=new NamedNodeMap(this),this[pt]=new Map,this._resizeSubscribers=null,this._allocatedClientWidth=0,this._allocatedClientHeight=0,this._pointerCaptures=new Set,this[z]=G.ELEMENT_NODE}get tagName(){return this[Me]}get localName(){return this[Ne]}get namespaceURI(){return this[Pe]}get prefix(){return this[Fe]}get nodeName(){return this[Me]}get attributes(){return this[U]}get id(){return this.getAttribute(`id`)??``}set id(e){this.setAttribute(`id`,e)}get className(){return this.getAttribute(`class`)??``}set className(e){this.setAttribute(`class`,e)}get children(){return this[H]}get childElementCount(){return this[H].length}get firstElementChild(){return this[H][0]??null}get lastElementChild(){let e=this[H];return e[e.length-1]??null}get previousElementSibling(){let e=this[B];if(!e)return null;let t=e[H],n=t.indexOf(this);return n>0?t[n-1]:null}get nextElementSibling(){let e=this[B];if(!e)return null;let t=e[H],n=t.indexOf(this);return n!==-1&&n<t.length-1?t[n+1]:null}get textContent(){let e=``;for(let t of this[V])t.textContent!==null&&(e+=t.textContent);return e}set textContent(e){let t=this[V];for(;t.length>0;)this.removeChild(t[0])}getAttribute(e){let t=this[U].getNamedItem(e);return t?t.value:null}getAttributeNS(e,t){let n=this[U].getNamedItemNS(e,t);return n?n.value:null}setAttribute(e,t){this[U]._setNamedItem(e,String(t))}setAttributeNS(e,t,n){let r=e===``?null:e,i=t.split(`:`),a=i.length>1?i[0]:null;this[U]._setNamedItem(t,String(n),r,a)}removeAttribute(e){this[U]._removeNamedItem(e)}removeAttributeNS(e,t){let n=e===``?null:e;this[U]._removeNamedItemNS(n,t)}hasAttribute(e){return this[U].getNamedItem(e)!==null}hasAttributeNS(e,t){return this[U].getNamedItemNS(e,t)!==null}getAttributeNode(e){return this[U].getNamedItem(e)}setAttributeNode(e){return this[U].setNamedItem(e)}removeAttributeNode(e){let t=this[U].getNamedItem(e.name);if(!t)throw new DOMException(`Failed to execute 'removeAttributeNode' on 'Element': The attribute is not owned by this element.`,`NotFoundError`);return this[U].removeNamedItem(t.name),t}toggleAttribute(e,t){return t===void 0?this.hasAttribute(e)?(this.removeAttribute(e),!1):(this.setAttribute(e,``),!0):t?(this.setAttribute(e,``),!0):(this.removeAttribute(e),!1)}hasAttributes(){return this[U].length>0}dispatchEvent(e){let t=super.dispatchEvent(e),n=this[W].get(`on`+e.type);return typeof n==`function`&&n.call(this,e),t}querySelector(e){return null}querySelectorAll(e){return[]}matches(e){return!1}closest(e){return null}getElementsByTagName(e){let t=[],n=e.toUpperCase(),walk=r=>{for(let i of r[V])if(i[z]===G.ELEMENT_NODE){let r=i;(e===`*`||r[Me]===n)&&t.push(r),walk(r)}};return walk(this),t}getElementsByClassName(e){let t=[],n=e.split(/\s+/).filter(Boolean),walk=e=>{for(let r of e[V])if(r[z]===G.ELEMENT_NODE){let e=r,i=e.className.split(/\s+/);n.every(e=>i.includes(e))&&t.push(e),walk(e)}};return walk(this),t}cloneNode(e=!1){let t=super.cloneNode(!1);t[Me]=this[Me],t[Ne]=this[Ne],t[Pe]=this[Pe],t[Fe]=this[Fe];for(let e of this[U])t.setAttributeNS(e.namespaceURI,e.name,e.value);if(e)for(let e of this[V])t.appendChild(e.cloneNode(!0));return t}_onResize(e){let t=this._resizeSubscribers??=new Set;return t.add(e),()=>{t.delete(e),t.size===0&&(this._resizeSubscribers=null)}}_fireResizeSubscribers(e,t){let n=this._resizeSubscribers;if(!(!n||n.size===0))for(let r of[...n])try{r(e,t)}catch(e){F.error(`ResizeObserver subscriber threw:`,e)}}setPointerCapture(e){this._pointerCaptures.add(e)}releasePointerCapture(e){this._pointerCaptures.delete(e)}hasPointerCapture(e){return this._pointerCaptures.has(e)}get[(ct=Me,lt=Ne,ut=Pe,dt=Fe,ft=U,pt=W,Symbol.toStringTag)](){return`Element`}},CSSStyleDeclaration=class{constructor(){this._cssText=``}get cssText(){return this._cssText}set cssText(e){this._cssText=e;for(let t of e.split(`;`)){let e=t.indexOf(`:`);if(e===-1)continue;let n=t.slice(0,e).trim(),r=t.slice(e+1).trim();if(!n)continue;let i=n.replace(/-([a-z])/g,(e,t)=>t.toUpperCase());this[i]=r}}setProperty(e,t,n){this[e]=t}getPropertyValue(e){let t=this[e];return typeof t==`string`?t:``}removeProperty(e){let t=this[e];return delete this[e],typeof t==`string`?t:``}getPropertyPriority(e){return``}},HTMLElement$1=class extends Element{static{__name(this,`HTMLElement`)}constructor(...e){super(...e),this.style=new CSSStyleDeclaration}get dataset(){let e=this;return new Proxy({},{get(t,n){if(typeof n!=`string`)return;let r=`data-`+n.replace(/[A-Z]/g,e=>`-`+e.toLowerCase());return e.getAttribute(r)??void 0},set(t,n,r){if(typeof n!=`string`)return!1;let i=`data-`+n.replace(/[A-Z]/g,e=>`-`+e.toLowerCase());return e.setAttribute(i,String(r)),!0},deleteProperty(t,n){if(typeof n!=`string`)return!1;let r=`data-`+n.replace(/[A-Z]/g,e=>`-`+e.toLowerCase());return e.removeAttribute(r),!0},has(t,n){if(typeof n!=`string`)return!1;let r=`data-`+n.replace(/[A-Z]/g,e=>`-`+e.toLowerCase());return e.hasAttribute(r)}})}get title(){return this.getAttribute(`title`)??``}set title(e){this.setAttribute(`title`,e)}get lang(){return this.getAttribute(`lang`)??``}set lang(e){this.setAttribute(`lang`,e)}get dir(){return this.getAttribute(`dir`)??``}set dir(e){this.setAttribute(`dir`,e)}get accessKey(){return this.getAttribute(`accesskey`)??``}set accessKey(e){this.setAttribute(`accesskey`,e)}get accessKeyLabel(){return this.getAttribute(`accesskey`)??``}get hidden(){return this.hasAttribute(`hidden`)}set hidden(e){e?this.setAttribute(`hidden`,``):this.removeAttribute(`hidden`)}get draggable(){return this.getAttribute(`draggable`)===`true`}set draggable(e){this.setAttribute(`draggable`,String(e))}get spellcheck(){let e=this.getAttribute(`spellcheck`);return e===`false`?!1:e!==null}set spellcheck(e){this.setAttribute(`spellcheck`,String(e))}get translate(){return this.getAttribute(`translate`)!==`no`}set translate(e){this.setAttribute(`translate`,e?`yes`:`no`)}get tabIndex(){let e=this.getAttribute(`tabindex`);return e===null?-1:Number(e)}set tabIndex(e){this.setAttribute(`tabindex`,String(e))}get contentEditable(){let e=this.getAttribute(`contenteditable`);return e===``||e===`true`?`true`:e===`false`?`false`:`inherit`}set contentEditable(e){e===`inherit`?this.removeAttribute(`contenteditable`):this.setAttribute(`contenteditable`,e)}get isContentEditable(){return this.contentEditable===`true`}get offsetHeight(){return this._allocatedClientHeight}get offsetWidth(){return this._allocatedClientWidth}get offsetLeft(){return 0}get offsetTop(){return 0}get offsetParent(){return null}get clientHeight(){return this._allocatedClientHeight}get clientWidth(){return this._allocatedClientWidth}get clientLeft(){return 0}get clientTop(){return 0}get scrollHeight(){return this._allocatedClientHeight}get scrollWidth(){return this._allocatedClientWidth}get scrollTop(){return 0}set scrollTop(e){}get scrollLeft(){return 0}set scrollLeft(e){}getBoundingClientRect(){let e=this.clientWidth,t=this.clientHeight;return{x:0,y:0,top:0,left:0,right:e,bottom:t,width:e,height:t,toJSON(){return this}}}click(){this.dispatchEvent(new Event(`click`,{bubbles:!0,cancelable:!0}))}blur(){this.dispatchEvent(new Event(`blur`))}focus(){this.dispatchEvent(new Event(`focus`))}get onclick(){return this[W].get(`onclick`)??null}set onclick(e){this[W].set(`onclick`,e)}get ondblclick(){return this[W].get(`ondblclick`)??null}set ondblclick(e){this[W].set(`ondblclick`,e)}get onload(){return this[W].get(`onload`)??null}set onload(e){this[W].set(`onload`,e)}get onerror(){return this[W].get(`onerror`)??null}set onerror(e){this[W].set(`onerror`,e)}get onabort(){return this[W].get(`onabort`)??null}set onabort(e){this[W].set(`onabort`,e)}get onfocus(){return this[W].get(`onfocus`)??null}set onfocus(e){this[W].set(`onfocus`,e)}get onblur(){return this[W].get(`onblur`)??null}set onblur(e){this[W].set(`onblur`,e)}get onchange(){return this[W].get(`onchange`)??null}set onchange(e){this[W].set(`onchange`,e)}get oninput(){return this[W].get(`oninput`)??null}set oninput(e){this[W].set(`oninput`,e)}get onsubmit(){return this[W].get(`onsubmit`)??null}get onreset(){return this[W].get(`onreset`)??null}set onreset(e){this[W].set(`onreset`,e)}get onscroll(){return this[W].get(`onscroll`)??null}set onscroll(e){this[W].set(`onscroll`,e)}get onresize(){return this[W].get(`onresize`)??null}set onresize(e){this[W].set(`onresize`,e)}get onmousedown(){return this[W].get(`onmousedown`)??null}set onmousedown(e){this[W].set(`onmousedown`,e)}get onmouseup(){return this[W].get(`onmouseup`)??null}set onmouseup(e){this[W].set(`onmouseup`,e)}get onmousemove(){return this[W].get(`onmousemove`)??null}set onmousemove(e){this[W].set(`onmousemove`,e)}get onmouseover(){return this[W].get(`onmouseover`)??null}set onmouseover(e){this[W].set(`onmouseover`,e)}get onmouseout(){return this[W].get(`onmouseout`)??null}set onmouseout(e){this[W].set(`onmouseout`,e)}get onmouseenter(){return this[W].get(`onmouseenter`)??null}set onmouseenter(e){this[W].set(`onmouseenter`,e)}get onmouseleave(){return this[W].get(`onmouseleave`)??null}set onmouseleave(e){this[W].set(`onmouseleave`,e)}get oncontextmenu(){return this[W].get(`oncontextmenu`)??null}set oncontextmenu(e){this[W].set(`oncontextmenu`,e)}get onwheel(){return this[W].get(`onwheel`)??null}set onwheel(e){this[W].set(`onwheel`,e)}get onkeydown(){return this[W].get(`onkeydown`)??null}set onkeydown(e){this[W].set(`onkeydown`,e)}get onkeyup(){return this[W].get(`onkeyup`)??null}set onkeyup(e){this[W].set(`onkeyup`,e)}get ontouchstart(){return this[W].get(`ontouchstart`)??null}set ontouchstart(e){this[W].set(`ontouchstart`,e)}get ontouchend(){return this[W].get(`ontouchend`)??null}set ontouchend(e){this[W].set(`ontouchend`,e)}get ontouchmove(){return this[W].get(`ontouchmove`)??null}set ontouchmove(e){this[W].set(`ontouchmove`,e)}get onpointerdown(){return this[W].get(`onpointerdown`)??null}set onpointerdown(e){this[W].set(`onpointerdown`,e)}get onpointerup(){return this[W].get(`onpointerup`)??null}set onpointerup(e){this[W].set(`onpointerup`,e)}get onpointermove(){return this[W].get(`onpointermove`)??null}set onpointermove(e){this[W].set(`onpointermove`,e)}cloneNode(e=!1){return super.cloneNode(e)}get[Symbol.toStringTag](){return`HTMLElement`}},mt=class HTMLCanvasElement extends HTMLElement$1{constructor(...e){super(...e),this.oncontextlost=null,this.oncontextrestored=null,this.onwebglcontextcreationerror=null,this.onwebglcontextlost=null,this.onwebglcontextrestored=null}static{this._contextFactories=new Map}static registerContextFactory(e,t){HTMLCanvasElement._contextFactories.set(e,t)}get width(){let e=this.getAttribute(`width`);return e===null?300:Number(e)}set width(e){this.setAttribute(`width`,String(e))}get height(){let e=this.getAttribute(`height`);return e===null?150:Number(e)}set height(e){this.setAttribute(`height`,String(e))}getContext(e,t){let n=HTMLCanvasElement._contextFactories.get(e);return n?n(this,t):null}toDataURL(e,t){let n=this.getContext(`2d`);return n&&typeof n._toDataURL==`function`?n._toDataURL(e,t):``}toBlob(e,t,n){let r=this.toDataURL(t,n);if(!r){e(null);return}let[i,a]=r.split(`,`),o=i.split(`:`)[1].split(`;`)[0],s=atob(a),c=new Uint8Array(s.length);for(let e=0;e<s.length;e++)c[e]=s.charCodeAt(e);e(new Blob([c],{type:o}))}captureStream(e){return{}}},ht=class DOMMatrix{constructor(e){this.a=1,this.b=0,this.c=0,this.d=1,this.e=0,this.f=0,this.m11=1,this.m12=0,this.m13=0,this.m14=0,this.m21=0,this.m22=1,this.m23=0,this.m24=0,this.m31=0,this.m32=0,this.m33=1,this.m34=0,this.m41=0,this.m42=0,this.m43=0,this.m44=1,this.is2D=!0,this.isIdentity=!0,Array.isArray(e)&&(e.length===6?(this.a=this.m11=e[0],this.b=this.m12=e[1],this.c=this.m21=e[2],this.d=this.m22=e[3],this.e=this.m41=e[4],this.f=this.m42=e[5],this.is2D=!0):e.length===16&&(this.m11=e[0],this.m12=e[1],this.m13=e[2],this.m14=e[3],this.m21=e[4],this.m22=e[5],this.m23=e[6],this.m24=e[7],this.m31=e[8],this.m32=e[9],this.m33=e[10],this.m34=e[11],this.m41=e[12],this.m42=e[13],this.m43=e[14],this.m44=e[15],this.a=this.m11,this.b=this.m12,this.c=this.m21,this.d=this.m22,this.e=this.m41,this.f=this.m42,this.is2D=!1),this.isIdentity=this.a===1&&this.b===0&&this.c===0&&this.d===1&&this.e===0&&this.f===0)}multiply(e){return new DOMMatrix([this.a*e.a+this.c*e.b,this.b*e.a+this.d*e.b,this.a*e.c+this.c*e.d,this.b*e.c+this.d*e.d,this.a*e.e+this.c*e.f+this.e,this.b*e.e+this.d*e.f+this.f])}multiplySelf(e){let t=this.multiply(e);return this.a=t.a,this.b=t.b,this.c=t.c,this.d=t.d,this.e=t.e,this.f=t.f,this.m11=this.a,this.m12=this.b,this.m21=this.c,this.m22=this.d,this.m41=this.e,this.m42=this.f,this.isIdentity=!1,this}inverse(){let e=this.a*this.d-this.b*this.c;if(e===0)return new DOMMatrix([1,0,0,1,0,0]);let t=1/e;return new DOMMatrix([this.d*t,-this.b*t,-this.c*t,this.a*t,(this.c*this.f-this.d*this.e)*t,(this.b*this.e-this.a*this.f)*t])}translate(e=0,t=0){return this.multiply({a:1,b:0,c:0,d:1,e,f:t})}scale(e=1,t=e){return this.multiply({a:e,b:0,c:0,d:t,e:0,f:0})}};const gt=ht;function defineGlobal(e,t){Object.defineProperty(globalThis,e,{value:t,writable:!0,configurable:!0})}function defineGlobalIfMissing(e,t){globalThis[e]===void 0&&defineGlobal(e,t)}const _t={aliceblue:`#f0f8ff`,antiquewhite:`#faebd7`,aqua:`#00ffff`,aquamarine:`#7fffd4`,azure:`#f0ffff`,beige:`#f5f5dc`,bisque:`#ffe4c4`,black:`#000000`,blanchedalmond:`#ffebcd`,blue:`#0000ff`,blueviolet:`#8a2be2`,brown:`#a52a2a`,burlywood:`#deb887`,cadetblue:`#5f9ea0`,chartreuse:`#7fff00`,chocolate:`#d2691e`,coral:`#ff7f50`,cornflowerblue:`#6495ed`,cornsilk:`#fff8dc`,crimson:`#dc143c`,cyan:`#00ffff`,darkblue:`#00008b`,darkcyan:`#008b8b`,darkgoldenrod:`#b8860b`,darkgray:`#a9a9a9`,darkgreen:`#006400`,darkgrey:`#a9a9a9`,darkkhaki:`#bdb76b`,darkmagenta:`#8b008b`,darkolivegreen:`#556b2f`,darkorange:`#ff8c00`,darkorchid:`#9932cc`,darkred:`#8b0000`,darksalmon:`#e9967a`,darkseagreen:`#8fbc8f`,darkslateblue:`#483d8b`,darkslategray:`#2f4f4f`,darkslategrey:`#2f4f4f`,darkturquoise:`#00ced1`,darkviolet:`#9400d3`,deeppink:`#ff1493`,deepskyblue:`#00bfff`,dimgray:`#696969`,dimgrey:`#696969`,dodgerblue:`#1e90ff`,firebrick:`#b22222`,floralwhite:`#fffaf0`,forestgreen:`#228b22`,fuchsia:`#ff00ff`,gainsboro:`#dcdcdc`,ghostwhite:`#f8f8ff`,gold:`#ffd700`,goldenrod:`#daa520`,gray:`#808080`,green:`#008000`,greenyellow:`#adff2f`,grey:`#808080`,honeydew:`#f0fff0`,hotpink:`#ff69b4`,indianred:`#cd5c5c`,indigo:`#4b0082`,ivory:`#fffff0`,khaki:`#f0e68c`,lavender:`#e6e6fa`,lavenderblush:`#fff0f5`,lawngreen:`#7cfc00`,lemonchiffon:`#fffacd`,lightblue:`#add8e6`,lightcoral:`#f08080`,lightcyan:`#e0ffff`,lightgoldenrodyellow:`#fafad2`,lightgray:`#d3d3d3`,lightgreen:`#90ee90`,lightgrey:`#d3d3d3`,lightpink:`#ffb6c1`,lightsalmon:`#ffa07a`,lightseagreen:`#20b2aa`,lightskyblue:`#87cefa`,lightslategray:`#778899`,lightslategrey:`#778899`,lightsteelblue:`#b0c4de`,lightyellow:`#ffffe0`,lime:`#00ff00`,limegreen:`#32cd32`,linen:`#faf0e6`,magenta:`#ff00ff`,maroon:`#800000`,mediumaquamarine:`#66cdaa`,mediumblue:`#0000cd`,mediumorchid:`#ba55d3`,mediumpurple:`#9370db`,mediumseagreen:`#3cb371`,mediumslateblue:`#7b68ee`,mediumspringgreen:`#00fa9a`,mediumturquoise:`#48d1cc`,mediumvioletred:`#c71585`,midnightblue:`#191970`,mintcream:`#f5fffa`,mistyrose:`#ffe4e1`,moccasin:`#ffe4b5`,navajowhite:`#ffdead`,navy:`#000080`,oldlace:`#fdf5e6`,olive:`#808000`,olivedrab:`#6b8e23`,orange:`#ffa500`,orangered:`#ff4500`,orchid:`#da70d6`,palegoldenrod:`#eee8aa`,palegreen:`#98fb98`,paleturquoise:`#afeeee`,palevioletred:`#db7093`,papayawhip:`#ffefd5`,peachpuff:`#ffdab9`,peru:`#cd853f`,pink:`#ffc0cb`,plum:`#dda0dd`,powderblue:`#b0e0e6`,purple:`#800080`,rebeccapurple:`#663399`,red:`#ff0000`,rosybrown:`#bc8f8f`,royalblue:`#4169e1`,saddlebrown:`#8b4513`,salmon:`#fa8072`,sandybrown:`#f4a460`,seagreen:`#2e8b57`,seashell:`#fff5ee`,sienna:`#a0522d`,silver:`#c0c0c0`,skyblue:`#87ceeb`,slateblue:`#6a5acd`,slategray:`#708090`,slategrey:`#708090`,snow:`#fffafa`,springgreen:`#00ff7f`,steelblue:`#4682b4`,tan:`#d2b48c`,teal:`#008080`,thistle:`#d8bfd8`,tomato:`#ff6347`,turquoise:`#40e0d0`,violet:`#ee82ee`,wheat:`#f5deb3`,white:`#ffffff`,whitesmoke:`#f5f5f5`,yellow:`#ffff00`,yellowgreen:`#9acd32`,transparent:`#00000000`};function parseColor(e){if(!e||typeof e!=`string`)return null;let t=e.trim().toLowerCase(),n=_t[t];if(n)return parseHex(n);if(t.startsWith(`#`))return parseHex(t);let r=t.match(/^rgba?\(\s*(\d+(?:\.\d+)?%?)\s*[,\s]\s*(\d+(?:\.\d+)?%?)\s*[,\s]\s*(\d+(?:\.\d+)?%?)\s*(?:[,/]\s*(\d+(?:\.\d+)?%?))?\s*\)$/);if(r)return{r:parseComponent(r[1],255)/255,g:parseComponent(r[2],255)/255,b:parseComponent(r[3],255)/255,a:r[4]===void 0?1:parseComponent(r[4],1)};let i=t.match(/^hsla?\(\s*(\d+(?:\.\d+)?)\s*[,\s]\s*(\d+(?:\.\d+)?)(%)?\s*[,\s]\s*(\d+(?:\.\d+)?)(%)?\s*(?:[,/]\s*(\d+(?:\.\d+)?%?))?\s*\)$/);if(i){let e=parseFloat(i[1]),t=parseFloat(i[2]),n=i[3]===`%`,r=parseFloat(i[4]),a=i[5]===`%`,o=i[6]===void 0?1:parseComponent(i[6],1);return e>1&&(e/=360),(n||t>1)&&(t/=100),(a||r>1)&&(r/=100),hslToRGBA(e,t,r,Math.max(0,Math.min(1,o)))}return null}function parseHex(e){let t=e.slice(1),n,r,i,a=1;if(t.length===3)n=parseInt(t[0]+t[0],16)/255,r=parseInt(t[1]+t[1],16)/255,i=parseInt(t[2]+t[2],16)/255;else if(t.length===4)n=parseInt(t[0]+t[0],16)/255,r=parseInt(t[1]+t[1],16)/255,i=parseInt(t[2]+t[2],16)/255,a=parseInt(t[3]+t[3],16)/255;else if(t.length===6)n=parseInt(t.slice(0,2),16)/255,r=parseInt(t.slice(2,4),16)/255,i=parseInt(t.slice(4,6),16)/255;else if(t.length===8)n=parseInt(t.slice(0,2),16)/255,r=parseInt(t.slice(2,4),16)/255,i=parseInt(t.slice(4,6),16)/255,a=parseInt(t.slice(6,8),16)/255;else return null;return{r:n,g:r,b:i,a}}function parseComponent(e,t){return e.endsWith(`%`)?parseFloat(e)/100*t:parseFloat(e)}function hue2rgb(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function hslToRGBA(e,t,n,r){let i,a,o;if(t===0)i=a=o=n;else{let r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;i=hue2rgb(s,r,e+1/3),a=hue2rgb(s,r,e),o=hue2rgb(s,r,e-1/3)}return{r:i,g:a,b:o,a:r}}const vt={r:0,g:0,b:0,a:1};var CanvasGradient=class{constructor(e,t,r,i,a,o,s){e===`radial`?this._pattern=new n.RadialGradient(t,r,o,i,a,s):this._pattern=new n.LinearGradient(t,r,i,a)}addColorStop(e,t){let n=parseColor(t);n&&this._pattern.addColorStopRGBA(e,n.r,n.g,n.b,n.a)}_getCairoPattern(){return this._pattern}};function quadraticToCubic(e,t,n,r,i,a){return{cp1x:e+2/3*(n-e),cp1y:t+2/3*(r-t),cp2x:i+2/3*(n-i),cp2y:a+2/3*(r-a)}}function computeArcTo(e,t,n,r,i,a,o){let s=e-n,c=t-r,l=i-n,u=a-r,d=Math.sqrt(s*s+c*c),p=Math.sqrt(l*l+u*u);if(d===0||p===0)return null;let m=s/d,h=c/d,g=l/p,_=u/p,v=m*_-h*g;if(Math.abs(v)<1e-10)return null;let y=m*g+h*_,b=Math.acos(Math.max(-1,Math.min(1,y)))/2,x=o/Math.tan(b),S=n+m*x,w=r+h*x,T=n+g*x,E=r+_*x,D=o/Math.sin(b),O=(m+g)/2,k=(h+_)/2,A=Math.sqrt(O*O+k*k),j=n+O/A*D,ee=r+k/A*D;return{tx0:S,ty0:w,tx1:T,ty1:E,cx:j,cy:ee,startAngle:Math.atan2(w-ee,S-j),endAngle:Math.atan2(E-ee,T-j),counterclockwise:v>0}}function cairoArcTo(e,t,n,r,i,a,o,s){let c=computeArcTo(t,n,r,i,a,o,s);if(!c){e.lineTo(r,i);return}let{tx0:l,ty0:u,cx:d,cy:p,startAngle:m,endAngle:h,counterclockwise:g}=c;e.lineTo(l,u),g?e.arcNegative(d,p,s,m,h):e.arc(d,p,s,m,h)}function cairoEllipse(e,t,n,r,i,a,o,s,c){e.save(),e.translate(t,n),e.rotate(a),e.scale(r,i),c?e.arcNegative(0,0,1,o,s):e.arc(0,0,1,o,s),e.restore()}function cairoRoundRect(e,t,n,r,i,a){let o,s,c,l;typeof a==`number`?o=s=c=l=a:a.length===1?o=s=c=l=a[0]:a.length===2?(o=c=a[0],s=l=a[1]):a.length===3?(o=a[0],s=l=a[1],c=a[2]):(o=a[0],s=a[1],c=a[2],l=a[3]);let u=Math.min(r/2,i/2);o=Math.min(o,u),s=Math.min(s,u),c=Math.min(c,u),l=Math.min(l,u);let d=Math.PI/2;e.newSubPath(),e.arc(t+o,n+o,o,Math.PI,Math.PI+d),e.arc(t+r-s,n+s,s,-d,0),e.arc(t+r-c,n+i-c,c,0,d),e.arc(t+l,n+i-l,l,d,Math.PI),e.closePath()}const yt={"source-over":2,"source-in":3,"source-out":4,"source-atop":5,"destination-over":7,"destination-in":8,"destination-out":9,"destination-atop":10,lighter:12,copy:1,xor:11,multiply:14,screen:15,overlay:16,darken:17,lighten:18,"color-dodge":19,"color-burn":20,"hard-light":21,"soft-light":22,difference:23,exclusion:24,hue:25,saturation:26,color:27,luminosity:28},bt={butt:0,round:1,square:2},xt={miter:0,round:1,bevel:2};var St=class Path2D{constructor(e){this._ops=[],e instanceof Path2D&&(this._ops=[...e._ops])}addPath(e){this._ops.push(...e._ops)}moveTo(e,t){this._ops.push({type:`moveTo`,x:e,y:t})}lineTo(e,t){this._ops.push({type:`lineTo`,x:e,y:t})}closePath(){this._ops.push({type:`closePath`})}bezierCurveTo(e,t,n,r,i,a){this._ops.push({type:`bezierCurveTo`,cp1x:e,cp1y:t,cp2x:n,cp2y:r,x:i,y:a})}quadraticCurveTo(e,t,n,r){this._ops.push({type:`quadraticCurveTo`,cpx:e,cpy:t,x:n,y:r})}arc(e,t,n,r,i,a=!1){this._ops.push({type:`arc`,x:e,y:t,radius:n,startAngle:r,endAngle:i,ccw:a})}ellipse(e,t,n,r,i,a,o,s=!1){if(n<0||r<0)throw RangeError(`The radii provided are negative`);this._ops.push({type:`ellipse`,x:e,y:t,rx:n,ry:r,rotation:i,startAngle:a,endAngle:o,ccw:s})}rect(e,t,n,r){this._ops.push({type:`rect`,x:e,y:t,w:n,h:r})}roundRect(e,t,n,r,i=0){this._ops.push({type:`roundRect`,x:e,y:t,w:n,h:r,radii:i})}_replayOnCairo(e){let t=0,n=0;for(let r of this._ops)switch(r.type){case`moveTo`:e.moveTo(r.x,r.y),t=r.x,n=r.y;break;case`lineTo`:e.lineTo(r.x,r.y),t=r.x,n=r.y;break;case`closePath`:e.closePath();break;case`bezierCurveTo`:e.curveTo(r.cp1x,r.cp1y,r.cp2x,r.cp2y,r.x,r.y),t=r.x,n=r.y;break;case`quadraticCurveTo`:{let{cp1x:i,cp1y:a,cp2x:o,cp2y:s}=quadraticToCubic(t,n,r.cpx,r.cpy,r.x,r.y);e.curveTo(i,a,o,s,r.x,r.y),t=r.x,n=r.y;break}case`arc`:r.ccw?e.arcNegative(r.x,r.y,r.radius,r.startAngle,r.endAngle):e.arc(r.x,r.y,r.radius,r.startAngle,r.endAngle);break;case`ellipse`:e.save(),e.translate(r.x,r.y),e.rotate(r.rotation),e.scale(r.rx,r.ry),r.ccw?e.arcNegative(0,0,1,r.startAngle,r.endAngle):e.arc(0,0,1,r.startAngle,r.endAngle),e.restore();break;case`rect`:e.rectangle(r.x,r.y,r.w,r.h);break;case`roundRect`:cairoRoundRect(e,r.x,r.y,r.w,r.h,r.radii);break}}};function asCairoPattern(e){if(!e)return null;let t=e;return typeof t.setFilter!=`function`||typeof t.setExtend!=`function`?null:t}function isPixbufImageSource(e){return typeof e!=`object`||!e?!1:typeof e.isPixbuf==`function`&&e.isPixbuf()}function isCanvasImageSource(e){return typeof e!=`object`||!e?!1:typeof e.getContext==`function`}var Ct=class CanvasPattern{constructor(e,t){let r=asCairoPattern(new n.SurfacePattern(e));if(!r)throw TypeError(`CanvasPattern: cairo SurfacePattern is missing setExtend at runtime — incompatible Cairo binding`);switch(this._pattern=r,t){case`repeat`:case``:case null:r.setExtend(n.Extend.REPEAT);break;case`repeat-x`:case`repeat-y`:r.setExtend(n.Extend.REPEAT);break;case`no-repeat`:r.setExtend(n.Extend.NONE);break}}static create(e,t){if(isPixbufImageSource(e)){let i=e._pixbuf,a=i.get_width(),o=i.get_height(),s=new n.ImageSurface(n.Format.ARGB32,a,o),c=new n.Context(s);return r.cairo_set_source_pixbuf(c,i,0,0),c.paint(),c.$dispose(),new CanvasPattern(s,t)}if(isCanvasImageSource(e)){let r=e.getContext(`2d`);if(r&&typeof r._getSurface==`function`){let e=r._getSurface(),i=e.getWidth(),a=e.getHeight(),o=new n.ImageSurface(n.Format.ARGB32,i,a),s=new n.Context(o);return s.setSourceSurface(e,0,0),s.paint(),s.$dispose(),new CanvasPattern(o,t)}}return null}_getCairoPattern(){return this._pattern}},OurImageData=class{constructor(e,t,n){if(this.colorSpace=`srgb`,typeof e==`number`)this.width=e,this.height=t,this.data=new Uint8ClampedArray(this.width*this.height*4);else if(this.data=e,this.width=t,this.height=n??this.data.length/(4*this.width),this.data.length!==this.width*this.height*4)throw RangeError(`Source data length ${this.data.length} is not a multiple of (4 * width=${this.width})`)}};const wt={translate(e,t){this._ensureSurface(),this._ctx.translate(e,t)},rotate(e){this._ensureSurface(),this._ctx.rotate(e)},scale(e,t){this._ensureSurface(),this._ctx.scale(e,t)},transform(e,t,n,r,i,a){if(this._ensureSurface(),!Number.isFinite(e)||!Number.isFinite(t)||!Number.isFinite(n)||!Number.isFinite(r)||!Number.isFinite(i)||!Number.isFinite(a))return;let o=i,s=a,c=Math.hypot(e,t),l=Math.hypot(n,r),u=Math.atan2(t,e);this._ctx.translate(o,s),u!==0&&this._ctx.rotate(u),(c!==1||l!==1)&&this._ctx.scale(c,l)},setTransform(e,t,n,r,i,a){if(this._ensureSurface(),typeof e==`object`&&e){let t=e;this._ctx.identityMatrix(),this.transform(t.a??t.m11??1,t.b??t.m12??0,t.c??t.m21??0,t.d??t.m22??1,t.e??t.m41??0,t.f??t.m42??0)}else typeof e==`number`?(this._ctx.identityMatrix(),this.transform(e,t,n,r,i,a)):this._ctx.identityMatrix()},getTransform(){let e=this._ctx.userToDevice(0,0),t=this._ctx.userToDevice(1,0),n=this._ctx.userToDevice(0,1),r=e[0]??0,i=e[1]??0,a=(t[0]??0)-r,o=(t[1]??0)-i,s=(n[0]??0)-r,c=(n[1]??0)-i,l=globalThis.DOMMatrix;return typeof l==`function`?new l([a,o,s,c,r,i]):{a,b:o,c:s,d:c,e:r,f:i,m11:a,m12:o,m13:0,m14:0,m21:s,m22:c,m23:0,m24:0,m31:0,m32:0,m33:1,m34:0,m41:r,m42:i,m43:0,m44:1,is2D:!0,isIdentity:a===1&&o===0&&s===0&&c===1&&r===0&&i===0}},resetTransform(){this._ensureSurface(),this._ctx.identityMatrix()}};function installTransformMethods(e){Object.assign(e,wt)}const Tt={beginPath(){this._ensureSurface(),this._ctx.newPath()},moveTo(e,t){this._ensureSurface(),this._ctx.moveTo(e,t)},lineTo(e,t){this._ensureSurface(),this._ctx.lineTo(e,t)},closePath(){this._ensureSurface(),this._ctx.closePath()},bezierCurveTo(e,t,n,r,i,a){this._ensureSurface(),this._ctx.curveTo(e,t,n,r,i,a)},quadraticCurveTo(e,t,n,r){this._ensureSurface();let i,a;this._ctx.hasCurrentPoint()?[i,a]=this._ctx.getCurrentPoint():(i=e,a=t);let{cp1x:o,cp1y:s,cp2x:c,cp2y:l}=quadraticToCubic(i,a,e,t,n,r);this._ctx.curveTo(o,s,c,l,n,r)},arc(e,t,n,r,i,a=!1){if(this._ensureSurface(),Math.abs(i-r)>=2*Math.PI){this._ctx.arc(e,t,n,0,2*Math.PI);return}a?this._ctx.arcNegative(e,t,n,r,i):this._ctx.arc(e,t,n,r,i)},arcTo(e,t,n,r,i){this._ensureSurface();let a,o;this._ctx.hasCurrentPoint()?[a,o]=this._ctx.getCurrentPoint():(a=e,o=t,this._ctx.moveTo(e,t)),cairoArcTo(this._ctx,a,o,e,t,n,r,i)},ellipse(e,t,n,r,i,a,o,s=!1){if(this._ensureSurface(),n<0||r<0)throw RangeError(`The radii provided are negative`);cairoEllipse(this._ctx,e,t,n,r,i,a,o,s)},rect(e,t,n,r){this._ensureSurface(),this._ctx.rectangle(e,t,n,r)},roundRect(e,t,n,r,i=0){this._ensureSurface(),cairoRoundRect(this._ctx,e,t,n,r,i)}};function installPathMethods(e){Object.assign(e,Tt)}function getDrawImageSource(e){if(isPixbufImageSource(e)){let t=e._pixbuf;return{pixbuf:t,imgWidth:t.get_width(),imgHeight:t.get_height()}}if(isCanvasImageSource(e)){let t=e.width??0,n=e.height??0;if(!Number.isFinite(t)||!Number.isFinite(n)||t<=0||n<=0)return null;let i=e.getContext(`2d`);if(i&&typeof i._getSurface==`function`){let e=i._getSurface();e.flush();let a=r.pixbuf_get_from_surface(e,0,0,t,n);if(a)return{pixbuf:a,imgWidth:t,imgHeight:n}}}return null}const Et={fill(e,t){this._ensureSurface(),this._applyCompositing(),this._applyFillStyle();let r;e instanceof St?(this._ctx.newPath(),e._replayOnCairo(this._ctx),r=t):r=e,this._ctx.setFillRule(r===`evenodd`?n.FillRule.EVEN_ODD:n.FillRule.WINDING),this._ctx.fillPreserve()},stroke(e){this._ensureSurface(),this._applyCompositing(),this._applyStrokeStyle(),this._applyLineStyle(),e instanceof St&&(this._ctx.newPath(),e._replayOnCairo(this._ctx)),this._ctx.strokePreserve()},fillRect(e,t,n,r){this._ensureSurface(),this._applyCompositing();let i=this._ctx.copyPath();this._hasShadow()&&this._renderShadow(()=>{this._ctx.newPath(),this._ctx.rectangle(e,t,n,r),this._ctx.fill()}),this._applyFillStyle(),this._ctx.newPath(),this._ctx.rectangle(e,t,n,r),this._ctx.fill(),this._ctx.newPath(),this._ctx.appendPath(i)},strokeRect(e,t,n,r){this._ensureSurface(),this._applyCompositing();let i=this._ctx.copyPath();this._hasShadow()&&this._renderShadow(()=>{this._ctx.newPath(),this._ctx.rectangle(e,t,n,r),this._ctx.stroke()}),this._applyStrokeStyle(),this._applyLineStyle(),this._ctx.newPath(),this._ctx.rectangle(e,t,n,r),this._ctx.stroke(),this._ctx.newPath(),this._ctx.appendPath(i)},clearRect(e,t,r,i){this._ensureSurface();let a=this._ctx.copyPath();this._ctx.save(),this._ctx.setOperator(n.Operator.CLEAR),this._ctx.newPath(),this._ctx.rectangle(e,t,r,i),this._ctx.fill(),this._ctx.restore(),this._ctx.newPath(),this._ctx.appendPath(a)},clip(e,t){this._ensureSurface();let r;e instanceof St?(this._ctx.newPath(),e._replayOnCairo(this._ctx),r=t):r=e,this._ctx.setFillRule(r===`evenodd`?n.FillRule.EVEN_ODD:n.FillRule.WINDING),this._ctx.clip()},isPointInPath(e,t,r,i){this._ensureSurface();let a,o,s;return e instanceof St?(this._ctx.newPath(),e._replayOnCairo(this._ctx),a=t,o=r,s=i):(a=e,o=t,s=r),this._ctx.setFillRule(s===`evenodd`?n.FillRule.EVEN_ODD:n.FillRule.WINDING),this._ctx.inFill(a,o)},isPointInStroke(e,t,n){return this._ensureSurface(),this._applyLineStyle(),e instanceof St?(this._ctx.newPath(),e._replayOnCairo(this._ctx),this._ctx.inStroke(t,n)):this._ctx.inStroke(e,t)},drawImage(e,t,i,a,o,s,c,l,u){this._ensureSurface(),this._applyCompositing();let d,p,m,h,g,_,v,y,b=getDrawImageSource(e);if(!b)return;let{pixbuf:x,imgWidth:S,imgHeight:w}=b;if(a===void 0?(d=0,p=0,m=S,h=w,g=t,_=i,v=S,y=w):s===void 0?(d=0,p=0,m=S,h=w,g=t,_=i,v=a,y=o):(d=t,p=i,m=a,h=o,g=s,_=c,v=l,y=u),!Number.isFinite(d)||!Number.isFinite(p)||!Number.isFinite(m)||!Number.isFinite(h)||!Number.isFinite(g)||!Number.isFinite(_)||!Number.isFinite(v)||!Number.isFinite(y)||m===0||h===0||v===0||y===0)return;this._ctx.save(),this._ctx.rectangle(g,_,v,y),this._ctx.clip(),this._ctx.translate(g,_),this._ctx.scale(v/m,y/h),this._ctx.translate(-d,-p),r.cairo_set_source_pixbuf(this._ctx,x,0,0);let T=asCairoPattern(this._ctx.getSource?.());if(T){let e;e=this._state.imageSmoothingEnabled?this._state.imageSmoothingQuality===`high`?n.Filter.BEST:n.Filter.BILINEAR:n.Filter.NEAREST,T.setFilter(e)}this._state.globalAlpha<1?this._ctx.paintWithAlpha(this._state.globalAlpha):this._ctx.paint(),this._ctx.restore()}};function installDrawingMethods(e){Object.assign(e,Et)}const Dt={createImageData(e,t){return typeof e==`number`?new OurImageData(Math.abs(e),Math.abs(t)):new OurImageData(e.width,e.height)},getImageData(e,t,n,i){this._ensureSurface(),this._surface.flush();let a=r.pixbuf_get_from_surface(this._surface,e,t,n,i);if(!a)return new OurImageData(n,i);let o=a.get_pixels(),s=a.get_has_alpha(),c=a.get_rowstride(),l=a.get_n_channels(),u=new Uint8ClampedArray(n*i*4);for(let e=0;e<i;e++)for(let t=0;t<n;t++){let r=e*c+t*l,i=(e*n+t)*4;u[i]=o[r],u[i+1]=o[r+1],u[i+2]=o[r+2],u[i+3]=s?o[r+3]:255}return new OurImageData(u,n,i)},putImageData(e,t,a,o,s,c,l){this._ensureSurface();let u=o??0,d=s??0,p=c??e.width,m=l??e.height,h=e.data,g=e.width,_=new Uint8Array(p*m*4);for(let e=0;e<m;e++)for(let t=0;t<p;t++){let n=((d+e)*g+(u+t))*4,r=(e*p+t)*4;_[r]=h[n],_[r+1]=h[n+1],_[r+2]=h[n+2],_[r+3]=h[n+3]}let v=i.Pixbuf.new_from_bytes(_,i.Colorspace.RGB,!0,8,p,m,p*4);this._ctx.save(),this._ctx.setOperator(n.Operator.SOURCE),r.cairo_set_source_pixbuf(this._ctx,v,t+u,a+d),this._ctx.rectangle(t+u,a+d,p,m),this._ctx.fill(),this._ctx.restore()}};function installPixelMethods(e){Object.assign(e,Dt)}function parseFontToDescription(e){let t=e.match(/^\s*(italic|oblique|normal)?\s*(small-caps|normal)?\s*(bold|bolder|lighter|[1-9]00|normal)?\s*(\d+(?:\.\d+)?)(px|pt|em|rem|%)?\s*(?:\/\S+)?\s*(.+)?$/i);if(!t)return a.font_description_from_string(e);let n=t[1]||``,r=t[3]||``,i=parseFloat(t[4])||10,o=(t[5]||`px`).toLowerCase(),s=(t[6]||`sans-serif`).replace(/['"]/g,``).trim();o===`pt`?i=i*96/72:o===`em`||o===`rem`?i*=16:o===`%`&&(i=i/100*16);let c=s;n===`italic`?c+=` Italic`:n===`oblique`&&(c+=` Oblique`),r===`bold`||r===`bolder`||parseInt(r)>=600?c+=` Bold`:(r===`lighter`||parseInt(r)>0&&parseInt(r)<=300)&&(c+=` Light`);let l=a.font_description_from_string(c);return l.set_absolute_size(i*a.SCALE),l}function createTextLayout(e,t){let n=o.create_layout(e._ctx);n.set_text(t,-1),n.get_context().set_base_dir(a.Direction.LTR),n.context_changed();let r=parseFontToDescription(e._state.font);return n.set_font_description(r),n}function getTextAlignOffset(e,t){let[,n]=t.get_pixel_extents(),r=n.width;switch(e._state.textAlign){case`center`:return-r/2;case`right`:case`end`:return-r;default:return 0}}function getTextBaselineOffset(e,t){let n=t.get_font_description()||parseFontToDescription(e._state.font),r=t.get_context().get_metrics(n,null),i=r.get_ascent()/a.SCALE,o=r.get_descent()/a.SCALE,s=i+o;switch(e._state.textBaseline){case`top`:return 0;case`hanging`:return-(i*.2);case`middle`:return-(s/2);case`alphabetic`:return-i;case`ideographic`:return-(i+o*.5);case`bottom`:return-s;default:return-i}}const Ot={fillText(e,t,r,i){this._ensureSurface(),this._applyCompositing();let a=createTextLayout(this,e),s=getTextAlignOffset(this,a),c=getTextBaselineOffset(this,a);if(this._hasShadow()){let e=parseColor(this._state.shadowColor);if(e){let[i,l]=this._deviceToUserDistance(this._state.shadowOffsetX,this._state.shadowOffsetY),u=this._state.shadowBlur,d;if(u>0){let[t]=this._deviceToUserDistance(u,0),[,n]=this._deviceToUserDistance(0,u);d=[[i,l,e.a],[i+t,l,e.a*.5],[i-t,l,e.a*.5],[i,l+n,e.a*.5],[i,l-n,e.a*.5]]}else d=[[i,l,e.a]];let p=this._state.imageSmoothingEnabled?n.Antialias.DEFAULT:n.Antialias.NONE;for(let[n,i,l]of d)this._ctx.save(),this._ctx.setAntialias(p),this._ctx.setSourceRGBA(e.r,e.g,e.b,l),this._ctx.moveTo(t+s+n,r+c+i),o.show_layout(this._ctx,a),this._ctx.restore()}}this._applyFillStyle(),this._ctx.save(),this._ctx.setAntialias(this._state.imageSmoothingEnabled?n.Antialias.DEFAULT:n.Antialias.NONE),this._ctx.moveTo(t+s,r+c),o.show_layout(this._ctx,a),this._ctx.restore()},strokeText(e,t,r,i){this._ensureSurface(),this._applyCompositing(),this._applyStrokeStyle(),this._applyLineStyle();let a=createTextLayout(this,e),s=getTextAlignOffset(this,a),c=getTextBaselineOffset(this,a);this._ctx.save(),this._ctx.setAntialias(this._state.imageSmoothingEnabled?n.Antialias.DEFAULT:n.Antialias.NONE),this._ctx.moveTo(t+s,r+c),o.layout_path(this._ctx,a),this._ctx.stroke(),this._ctx.restore()},measureText(e){this._ensureSurface();let t=createTextLayout(this,e),[n,r]=t.get_pixel_extents(),i=t.get_baseline()/a.SCALE,o=Math.max(0,i-n.y),s=Math.max(0,n.y+n.height-i),c=t.get_font_description()||parseFontToDescription(this._state.font),l=t.get_context().get_metrics(c,null),u=l.get_ascent()/a.SCALE,d=l.get_descent()/a.SCALE;return{width:r.width,actualBoundingBoxAscent:o,actualBoundingBoxDescent:s,actualBoundingBoxLeft:Math.max(0,-n.x),actualBoundingBoxRight:n.x+n.width,fontBoundingBoxAscent:u,fontBoundingBoxDescent:d,alphabeticBaseline:0,emHeightAscent:u,emHeightDescent:d,hangingBaseline:u*.8,ideographicBaseline:-d}}};function installTextMethods(e){Object.assign(e,Ot)}const kt={createLinearGradient(e,t,n,r){return new CanvasGradient(`linear`,e,t,n,r)},createRadialGradient(e,t,n,r,i,a){return new CanvasGradient(`radial`,e,t,r,i,n,a)},createPattern(e,t){return Ct.create(e,t)}};function installFactoryMethods(e){Object.assign(e,kt)}function installAllContextMethods(e){installTransformMethods(e),installPathMethods(e),installDrawingMethods(e),installPixelMethods(e),installTextMethods(e),installFactoryMethods(e)}function createDefaultState(){return{fillStyle:`#000000`,fillColor:{...vt},strokeStyle:`#000000`,strokeColor:{...vt},lineWidth:1,lineCap:`butt`,lineJoin:`miter`,miterLimit:10,lineDash:[],lineDashOffset:0,globalAlpha:1,globalCompositeOperation:`source-over`,shadowColor:`rgba(0, 0, 0, 0)`,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,font:`10px sans-serif`,textAlign:`start`,textBaseline:`alphabetic`,direction:`ltr`,imageSmoothingEnabled:!0,imageSmoothingQuality:`low`}}function cloneState(e){return{...e,fillColor:{...e.fillColor},strokeColor:{...e.strokeColor},lineDash:[...e.lineDash]}}var CanvasRenderingContext2D=class{constructor(e,t){this._stateStack=[],this.canvas=e,this._surfaceWidth=e.width||300,this._surfaceHeight=e.height||150,this._surface=new n.ImageSurface(n.Format.ARGB32,this._surfaceWidth,this._surfaceHeight),this._ctx=new n.Context(this._surface),this._state=createDefaultState()}_ensureSurface(){let e=this.canvas.width||300,t=this.canvas.height||150;(e!==this._surfaceWidth||t!==this._surfaceHeight)&&(this._ctx.$dispose(),this._surface.finish(),this._surfaceWidth=e,this._surfaceHeight=t,this._surface=new n.ImageSurface(n.Format.ARGB32,e,t),this._ctx=new n.Context(this._surface),this._stateStack=[])}_resetState(){this._state=createDefaultState(),this._stateStack=[]}_applyFillStyle(){let e=this._state.fillStyle;if(typeof e==`string`){let e=this._state.fillColor,t=e.a*this._state.globalAlpha;this._ctx.setSourceRGBA(e.r,e.g,e.b,t)}else e instanceof CanvasGradient?this._ctx.setSource(e._getCairoPattern()):e instanceof Ct&&(this._ctx.setSource(e._getCairoPattern()),this._applyPatternFilter())}_applyStrokeStyle(){let e=this._state.strokeStyle;if(typeof e==`string`){let e=this._state.strokeColor,t=e.a*this._state.globalAlpha;this._ctx.setSourceRGBA(e.r,e.g,e.b,t)}else e instanceof CanvasGradient?this._ctx.setSource(e._getCairoPattern()):e instanceof Ct&&(this._ctx.setSource(e._getCairoPattern()),this._applyPatternFilter())}_applyPatternFilter(){let e=asCairoPattern(this._ctx.getSource?.());if(!e)return;let t;t=this._state.imageSmoothingEnabled?this._state.imageSmoothingQuality===`high`?n.Filter.BEST:n.Filter.BILINEAR:n.Filter.NEAREST,e.setFilter(t)}_applyLineStyle(){this._ctx.setLineWidth(this._state.lineWidth),this._ctx.setLineCap(bt[this._state.lineCap]),this._ctx.setLineJoin(xt[this._state.lineJoin]),this._ctx.setMiterLimit(this._state.miterLimit),this._ctx.setDash(this._state.lineDash,this._state.lineDashOffset)}_applyCompositing(){let e=yt[this._state.globalCompositeOperation];e!==void 0&&this._ctx.setOperator(e)}_getSurface(){return this._surface}_hasShadow(){if(this._state.shadowBlur===0&&this._state.shadowOffsetX===0&&this._state.shadowOffsetY===0)return!1;let e=parseColor(this._state.shadowColor);return e!==null&&e.a>0}_deviceToUserDistance(e,t){let n=this._ctx.userToDevice(0,0),r=this._ctx.userToDevice(1,0),i=this._ctx.userToDevice(0,1),a=(r[0]??0)-(n[0]??0),o=(r[1]??0)-(n[1]??0),s=(i[0]??0)-(n[0]??0),c=(i[1]??0)-(n[1]??0),l=a*c-o*s;return Math.abs(l)<1e-10?[e,t]:[(c*e-s*t)/l,(-o*e+a*t)/l]}_renderShadow(e){}save(){this._ensureSurface(),this._stateStack.push(cloneState(this._state)),this._ctx.save()}restore(){this._ensureSurface();let e=this._stateStack.pop();e&&(this._state=e,this._ctx.restore())}get fillStyle(){return this._state.fillStyle}set fillStyle(e){if(typeof e==`string`){let t=parseColor(e);t&&(this._state.fillStyle=e,this._state.fillColor=t)}else this._state.fillStyle=e}get strokeStyle(){return this._state.strokeStyle}set strokeStyle(e){if(typeof e==`string`){let t=parseColor(e);t&&(this._state.strokeStyle=e,this._state.strokeColor=t)}else this._state.strokeStyle=e}get lineWidth(){return this._state.lineWidth}set lineWidth(e){e>0&&isFinite(e)&&(this._state.lineWidth=e)}get lineCap(){return this._state.lineCap}set lineCap(e){(e===`butt`||e===`round`||e===`square`)&&(this._state.lineCap=e)}get lineJoin(){return this._state.lineJoin}set lineJoin(e){(e===`miter`||e===`round`||e===`bevel`)&&(this._state.lineJoin=e)}get miterLimit(){return this._state.miterLimit}set miterLimit(e){e>0&&isFinite(e)&&(this._state.miterLimit=e)}get globalAlpha(){return this._state.globalAlpha}set globalAlpha(e){e>=0&&e<=1&&isFinite(e)&&(this._state.globalAlpha=e)}get globalCompositeOperation(){return this._state.globalCompositeOperation}set globalCompositeOperation(e){yt[e]!==void 0&&(this._state.globalCompositeOperation=e)}get imageSmoothingEnabled(){return this._state.imageSmoothingEnabled}set imageSmoothingEnabled(e){this._state.imageSmoothingEnabled=!!e}get imageSmoothingQuality(){return this._state.imageSmoothingQuality}set imageSmoothingQuality(e){(e===`low`||e===`medium`||e===`high`)&&(this._state.imageSmoothingQuality=e)}setLineDash(e){e.some(e=>e<0||!isFinite(e))||(this._state.lineDash=[...e])}getLineDash(){return[...this._state.lineDash]}get lineDashOffset(){return this._state.lineDashOffset}set lineDashOffset(e){isFinite(e)&&(this._state.lineDashOffset=e)}get shadowColor(){return this._state.shadowColor}set shadowColor(e){this._state.shadowColor=e}get shadowBlur(){return this._state.shadowBlur}set shadowBlur(e){e>=0&&isFinite(e)&&(this._state.shadowBlur=e)}get shadowOffsetX(){return this._state.shadowOffsetX}set shadowOffsetX(e){isFinite(e)&&(this._state.shadowOffsetX=e)}get shadowOffsetY(){return this._state.shadowOffsetY}set shadowOffsetY(e){isFinite(e)&&(this._state.shadowOffsetY=e)}get font(){return this._state.font}set font(e){this._state.font=e}get textAlign(){return this._state.textAlign}set textAlign(e){this._state.textAlign=e}get textBaseline(){return this._state.textBaseline}set textBaseline(e){this._state.textBaseline=e}get direction(){return this._state.direction}set direction(e){this._state.direction=e}_toDataURL(e,t){this._surface.flush();let n=imports.gi.Gio,r=imports.gi.GLib,[,i]=r.file_open_tmp(`canvas-XXXXXX.png`);try{this._surface.writeToPNG(i);let[,e]=n.File.new_for_path(i).load_contents(null);return`data:image/png;base64,${r.base64_encode(e)}`}finally{try{r.unlink(i)}catch{}}}_dispose(){this._ctx.$dispose(),this._surface.finish()}};installAllContextMethods(CanvasRenderingContext2D.prototype),defineGlobal(`HTMLCanvasElement`,mt),defineGlobal(`CanvasRenderingContext2D`,CanvasRenderingContext2D),defineGlobal(`DOMMatrix`,ht),defineGlobal(`DOMMatrixReadOnly`,gt);const At=Symbol.for(`gjsify_canvas2d_context`);mt.registerContextFactory(`2d`,(e,t)=>{let n=e,r=n[At];if(r)return r;let i=new CanvasRenderingContext2D(e,t);return n[At]=i,i});var CharacterData=class extends ot{constructor(e=``){super(),this[z]=G.TEXT_NODE,this._data=e}get data(){return this._data}set data(e){this._data=e}get textContent(){return this._data}set textContent(e){this._data=e}get nodeValue(){return this._data}set nodeValue(e){this._data=e}get length(){return this._data.length}appendData(e){this._data+=e}deleteData(e,t){this._data=this._data.substring(0,e)+this._data.substring(e+t)}insertData(e,t){this._data=this._data.substring(0,e)+t+this._data.substring(e)}replaceData(e,t,n){this._data=this._data.substring(0,e)+n+this._data.substring(e+t)}substringData(e,t){return this._data.substring(e,e+t)}cloneNode(e=!1){return new this.constructor(this._data)}get[Symbol.toStringTag](){return`CharacterData`}},jt=class Comment extends CharacterData{constructor(e=``){super(e),this[z]=G.COMMENT_NODE}get nodeName(){return`#comment`}cloneNode(e=!1){return new Comment(this.data)}get[Symbol.toStringTag](){return`Comment`}},Mt=class Text extends CharacterData{constructor(e=``){super(e),this[z]=G.TEXT_NODE}get nodeName(){return`#text`}get wholeText(){let e=this.data,t=this.previousSibling;for(;t&&t instanceof Text;)e=t.data+e,t=t.previousSibling;let n=this.nextSibling;for(;n&&n instanceof Text;)e+=n.data,n=n.nextSibling;return e}splitText(e){let t=this.data.substring(e);this.data=this.data.substring(0,e);let n=new Text(t);return this.parentNode&&this.parentNode.insertBefore(n,this.nextSibling),n}cloneNode(e=!1){return new Text(this.data)}get[Symbol.toStringTag](){return`Text`}},Nt=class DocumentFragment extends ot{constructor(){super(),this[z]=G.DOCUMENT_FRAGMENT_NODE}get nodeName(){return`#document-fragment`}get children(){return this[H]}get childElementCount(){return this[H].length}get firstElementChild(){return this[H][0]??null}get lastElementChild(){let e=this[H];return e[e.length-1]??null}get textContent(){let e=``;for(let t of this.childNodes)t.textContent!==null&&(e+=t.textContent);return e}set textContent(e){for(;this.firstChild;)this.removeChild(this.firstChild);e&&this.appendChild(new Mt(e))}append(...e){for(let t of e)typeof t==`string`?this.appendChild(new Mt(t)):this.appendChild(t)}prepend(...e){let t=this.firstChild;for(let n of e)typeof n==`string`?this.insertBefore(new Mt(n),t):this.insertBefore(n,t)}replaceChildren(...e){for(;this.firstChild;)this.removeChild(this.firstChild);this.append(...e)}getElementById(e){for(let t of this.children){if(t.id===e)return t;let n=this._findById(t,e);if(n)return n}return null}_findById(e,t){for(let n of e.children){if(n.id===t)return n;let e=this._findById(n,t);if(e)return e}return null}cloneNode(e=!1){let t=new DocumentFragment;if(e)for(let e of this.childNodes)t.appendChild(e.cloneNode(!0));return t}get[Symbol.toStringTag](){return`DocumentFragment`}},Pt=s;I(),A(),N();var HTMLImageElement=class extends HTMLElement$1{constructor(){super(),this._complete=!1,this._naturalHeight=0,this._naturalWidth=0,this[Me]=`IMG`,this[Ne]=`img`,this[Pe]=st.html}get complete(){return this._complete}get naturalHeight(){return this._naturalHeight}get naturalWidth(){return this._naturalWidth}get currentSrc(){return this.src}get x(){return 0}get y(){return 0}get alt(){return this.getAttribute(`alt`)??``}set alt(e){this.setAttribute(`alt`,e)}get crossOrigin(){return this.getAttribute(`crossorigin`)}set crossOrigin(e){e===null?this.removeAttribute(`crossorigin`):this.setAttribute(`crossorigin`,e)}get decoding(){return this.getAttribute(`decoding`)??`auto`}set decoding(e){this.setAttribute(`decoding`,e)}get loading(){let e=this.getAttribute(`loading`);return e===`lazy`||e===`eager`?e:`auto`}set loading(e){this.setAttribute(`loading`,e)}get referrerPolicy(){return this.getAttribute(`referrerpolicy`)??``}set referrerPolicy(e){this.setAttribute(`referrerpolicy`,e)}get sizes(){return this.getAttribute(`sizes`)??``}set sizes(e){this.setAttribute(`sizes`,e)}get src(){return this.getAttribute(`src`)??``}set src(e){this.setAttribute(`src`,e);let t=globalThis.__GJSIFY_DEBUG_IMG===!0;if(e.startsWith(`data:`)){let n=e.indexOf(`,`);if(n===-1){this._complete=!0,this.dispatchEvent(new Event(`error`));return}let r=e.slice(5,n),i=e.slice(n+1),a=r.includes(`;base64`);try{let e;e=a?k.base64_decode(i):new TextEncoder().encode(decodeURIComponent(i));let n=k.Bytes.new(e),r=M.MemoryInputStream.new_from_bytes(n);this._pixbuf=Pt.Pixbuf.new_from_stream(r,null),this._naturalWidth=this._pixbuf.get_width(),this._naturalHeight=this._pixbuf.get_height(),this._complete=!0,t&&F.log(`[img] ok data: (${this._naturalWidth}x${this._naturalHeight})`),this.dispatchEvent(new Event(`load`))}catch(e){t&&F.warn(`[img] error data:: ${e instanceof Error?e.message:String(e)}`),this._complete=!0,this.dispatchEvent(new Event(`error`))}return}let n;if(e.startsWith(`file://`))n=k.filename_from_uri(e)[0];else if(e.startsWith(`http://`)||e.startsWith(`https://`)){this._complete=!0,this.dispatchEvent(new Event(`error`));return}else{let t=k.path_get_dirname(c.programInvocationName);n=k.build_filenamev([t,e])}try{t&&F.log(`[img] load ${n}`),this._pixbuf=Pt.Pixbuf.new_from_file(n),this._naturalWidth=this._pixbuf.get_width(),this._naturalHeight=this._pixbuf.get_height(),this._complete=!0,t&&F.log(`[img] ok ${n} (${this._naturalWidth}x${this._naturalHeight})`),this.dispatchEvent(new Event(`load`))}catch(e){t&&F.warn(`[img] error ${n}: ${e instanceof Error?e.message:String(e)}`),this._complete=!0,this.dispatchEvent(new Event(`error`))}}get srcset(){return this.getAttribute(`srcset`)??``}set srcset(e){this.setAttribute(`srcset`,e)}get useMap(){return this.getAttribute(`usemap`)??``}set useMap(e){this.setAttribute(`usemap`,e)}get height(){if(this._pixbuf)return this._pixbuf.get_height();let e=this.getAttribute(`height`);return e===null?0:Number(e)}set height(e){this.setAttribute(`height`,String(e))}get width(){if(this._pixbuf)return this._pixbuf.get_width();let e=this.getAttribute(`width`);return e===null?0:Number(e)}set width(e){this.setAttribute(`width`,String(e))}get isMap(){return this.hasAttribute(`ismap`)}set isMap(e){e?this.setAttribute(`ismap`,``):this.removeAttribute(`ismap`)}decode(){return Promise.resolve()}cloneNode(e=!1){return super.cloneNode(e)}getImageData(){if(!this._pixbuf)return null;let e=this._pixbuf.get_has_alpha()?this._pixbuf:this._pixbuf.add_alpha(!1,0,0,0)??this._pixbuf;return{colorSpace:`srgb`,data:new Uint8ClampedArray(e.get_pixels()),height:e.get_height(),width:e.get_width()}}isPixbuf(){return!!this._pixbuf}get[Symbol.toStringTag](){return`HTMLImageElement`}},HTMLMediaElement=class extends HTMLElement$1{constructor(...e){super(...e),this._src=``,this._srcObject=null,this.currentTime=0,this.duration=NaN,this.paused=!0,this.ended=!1,this.volume=1,this.muted=!1,this.defaultMuted=!1,this.loop=!1,this.autoplay=!1,this.preload=``,this.playbackRate=1,this.defaultPlaybackRate=1,this.readyState=0,this.networkState=0}get buffered(){return{length:0,start:()=>0,end:()=>0}}get seekable(){return{length:0,start:()=>0,end:()=>0}}get played(){return{length:0,start:()=>0,end:()=>0}}get src(){return this._src}set src(e){this._src=e,this._srcObject=null,this.dispatchEvent(new Event(`srcchange`))}get srcObject(){return this._srcObject}set srcObject(e){this._srcObject=e,this._src=``,this.dispatchEvent(new Event(`srcobjectchange`))}play(){return this.paused=!1,this.ended=!1,this.dispatchEvent(new Event(`play`)),Promise.resolve()}pause(){this.paused=!0,this.dispatchEvent(new Event(`pause`))}load(){this.readyState=0,this.networkState=2,this.dispatchEvent(new Event(`loadstart`))}canPlayType(e){return``}static{this.HAVE_NOTHING=0}static{this.HAVE_METADATA=1}static{this.HAVE_CURRENT_DATA=2}static{this.HAVE_FUTURE_DATA=3}static{this.HAVE_ENOUGH_DATA=4}static{this.NETWORK_EMPTY=0}static{this.NETWORK_IDLE=1}static{this.NETWORK_LOADING=2}static{this.NETWORK_NO_SOURCE=3}get[Symbol.toStringTag](){return`HTMLMediaElement`}};const Ft=1e9;function secondsToGstTime(e){return BigInt(Math.round(e*Ft))}function gstTimeToSeconds(e){return Number(e)/Ft}var HTMLVideoElement=class extends HTMLMediaElement{constructor(){super(),this._pipeline=null,this._videoWidth=0,this._videoHeight=0,this.poster=``,this[Me]=`VIDEO`,this[Ne]=`video`,this[Pe]=st.html;let e=this;Object.defineProperty(this,`paused`,{get(){if(!e._pipeline)return!0;let[,t]=e._pipeline.get_state(0n);return t!==4},configurable:!0,enumerable:!0}),Object.defineProperty(this,`currentTime`,{get(){if(!e._pipeline)return 0;let[t,n]=e._pipeline.query_position(3);return t?gstTimeToSeconds(n):0},set(t){e._pipeline?.seek(1,3,5,1,secondsToGstTime(t),0,-1n)},configurable:!0,enumerable:!0}),Object.defineProperty(this,`duration`,{get(){if(!e._pipeline)return NaN;let[t,n]=e._pipeline.query_duration(3);return t&&Number(n)>0?gstTimeToSeconds(n):NaN},configurable:!0,enumerable:!0}),Object.defineProperty(this,`volume`,{get(){return e._playbin()?.volume??1},set(t){let n=e._playbin();n&&(n.volume=Math.max(0,Math.min(1,t)))},configurable:!0,enumerable:!0}),Object.defineProperty(this,`muted`,{get(){return e._playbin()?.mute??!1},set(t){let n=e._playbin();n&&(n.mute=t)},configurable:!0,enumerable:!0})}async play(){this._pipeline?.set_state(4),this.dispatchEvent(new Event(`play`)),this.dispatchEvent(new Event(`playing`))}pause(){this._pipeline?.set_state(3),this.dispatchEvent(new Event(`pause`))}get videoWidth(){return this._videoWidth}set videoWidth(e){this._videoWidth=e}get videoHeight(){return this._videoHeight}set videoHeight(e){this._videoHeight=e}get[Symbol.toStringTag](){return`HTMLVideoElement`}_playbin(){return this._pipeline?.get_by_name(`playbin`)??null}};const It=new class Document extends ot{static{this._elementFactories=new Map}constructor(){super(),this.body=new HTMLElement$1,this.head=new HTMLElement$1,this.documentElement=new HTMLElement$1,this.appendChild(this.documentElement),this.documentElement.appendChild(this.body)}static registerElementFactory(e,t){Document._elementFactories.set(e.toLowerCase(),t)}createElementNS(e,t){let n=t.toLowerCase();switch(n){case`img`:return new HTMLImageElement;case`video`:return new HTMLVideoElement;case`canvas`:return new mt;default:{let e=Document._elementFactories.get(n);return e?e():new HTMLElement$1}}}createElement(e){return this.createElementNS(`http://www.w3.org/1999/xhtml`,e)}createTextNode(e){return new Mt(e)}createComment(e){return new jt(e)}createDocumentFragment(){return new Nt}createEvent(e){return new Event(e)}getElementById(e){return this._findById(this.body,e)}_findById(e,t){if(e.id===t)return e;for(let n of e.children){let e=this._findById(n,t);if(e)return e}return null}get[Symbol.toStringTag](){return`Document`}};var DOMTokenList=class{constructor(e,t){this._ownerElement=e,this._attributeName=t}_getTokens(){let e=this._ownerElement.getAttribute(this._attributeName);return e?e.split(/\s+/).filter(e=>e.length>0):[]}_setTokens(e){let t=e.join(` `);t?this._ownerElement.setAttribute(this._attributeName,t):this._ownerElement.removeAttribute(this._attributeName)}get length(){return this._getTokens().length}get value(){return this._ownerElement.getAttribute(this._attributeName)??``}set value(e){e?this._ownerElement.setAttribute(this._attributeName,e):this._ownerElement.removeAttribute(this._attributeName)}item(e){let t=this._getTokens();return e>=0&&e<t.length?t[e]:null}contains(e){return this._getTokens().includes(e)}add(...e){let t=this._getTokens();for(let n of e)n&&!t.includes(n)&&t.push(n);this._setTokens(t)}remove(...e){let t=this._getTokens().filter(t=>!e.includes(t));this._setTokens(t)}toggle(e,t){let n=this.contains(e);return t===void 0?n?(this.remove(e),!1):(this.add(e),!0):t?(this.add(e),!0):(this.remove(e),!1)}replace(e,t){let n=this._getTokens(),r=n.indexOf(e);return r===-1?!1:(n[r]=t,this._setTokens(n),!0)}supports(e){return!0}forEach(e){let t=this._getTokens();for(let n=0;n<t.length;n++)e(t[n],n,this)}keys(){return this._getTokens().keys()}values(){return this._getTokens().values()}entries(){return this._getTokens().entries()}[Symbol.iterator](){return this._getTokens().values()}toString(){return this.value}get[Symbol.toStringTag](){return`DOMTokenList`}};I(),defineGlobal(`Text`,Mt),defineGlobal(`Comment`,jt),defineGlobal(`DocumentFragment`,Nt),defineGlobal(`DOMTokenList`,DOMTokenList),defineGlobal(`document`,It),defineGlobalIfMissing(`self`,globalThis);var Window=class{};defineGlobalIfMissing(`Window`,Window),defineGlobalIfMissing(`window`,globalThis),defineGlobalIfMissing(`focus`,()=>{}),defineGlobalIfMissing(`blur`,()=>{});{let e=globalThis;if(typeof e.addEventListener!=`function`){let t=new EventTarget;e.__gjsify_globalEventTarget=t,e.addEventListener=(e,n,r)=>t.addEventListener(e,n,r),e.removeEventListener=(e,n,r)=>t.removeEventListener(e,n,r),e.dispatchEvent=e=>t.dispatchEvent(e)}}defineGlobalIfMissing(`devicePixelRatio`,1),defineGlobalIfMissing(`scrollX`,0),defineGlobalIfMissing(`scrollY`,0),defineGlobalIfMissing(`pageXOffset`,0),defineGlobalIfMissing(`pageYOffset`,0),defineGlobalIfMissing(`alert`,(...e)=>F.error(`alert:`,...e)),globalThis.top===void 0&&Object.defineProperty(globalThis,`top`,{get:()=>globalThis,configurable:!0}),globalThis.navigator===void 0&&(globalThis.navigator={});function atobPolyfill(e){if(typeof globalThis.atob==`function`)return globalThis.atob(e);let t=e.replace(/[=\s]/g,``),n=``,r=0,i=0;for(let e=0;e<t.length;e++)r=r<<6|Lt[t.charCodeAt(e)],i+=6,i>=8&&(i-=8,n+=String.fromCharCode(r>>i&255));return n}function btoaPolyfill(e){if(typeof globalThis.btoa==`function`)return globalThis.btoa(e);let t=``,n=0;for(;n+2<e.length;n+=3){let r=e.charCodeAt(n)<<16|e.charCodeAt(n+1)<<8|e.charCodeAt(n+2);t+=K[r>>18&63]+K[r>>12&63]+K[r>>6&63]+K[r&63]}if(n+1===e.length){let r=e.charCodeAt(n)<<16;t+=K[r>>18&63]+K[r>>12&63]+`==`}else if(n+2===e.length){let r=e.charCodeAt(n)<<16|e.charCodeAt(n+1)<<8;t+=K[r>>18&63]+K[r>>12&63]+K[r>>6&63]+`=`}return t}function base64Decode(e){let t=e.replace(/[=\s]/g,``),n=new Uint8Array(t.length*3>>2),r=0,i=0,a=0;for(let e=0;e<t.length;e++)r=r<<6|Lt[t.charCodeAt(e)],i+=6,i>=8&&(i-=8,n[a++]=r>>i&255);return n.subarray(0,a)}function base64Encode(e){let t=``,n=e.length;for(let r=0;r<n;r+=3){let i=e[r],a=r+1<n?e[r+1]:0,o=r+2<n?e[r+2]:0;t+=K[i>>2],t+=K[(i&3)<<4|a>>4],t+=r+1<n?K[(a&15)<<2|o>>6]:`=`,t+=r+2<n?K[o&63]:`=`}return t}var K,Lt,Rt=__esmMin(()=>{K=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,Lt=new Uint8Array(256);for(let e=0;e<64;e++)Lt[K.charCodeAt(e)]=e});function normalizeEncoding(e){if(!e||e===`utf8`||e===`utf-8`)return`utf8`;switch((``+e).toLowerCase().replace(/-/g,``)){case`utf8`:return`utf8`;case`ascii`:return`ascii`;case`latin1`:case`binary`:return`latin1`;case`base64`:return`base64`;case`base64url`:return`base64url`;case`hex`:return`hex`;case`ucs2`:case`utf16le`:return`utf16le`;default:return`utf8`}}function checkEncoding(e){let t=(``+e).toLowerCase().replace(/-/g,``);if(!zt.includes(t))throw TypeError(`Unknown encoding: ${e}`)}var zt,Bt=__esmMin(()=>{zt=[`utf8`,`ascii`,`latin1`,`binary`,`base64`,`base64url`,`hex`,`ucs2`,`utf16le`]});function encodeString(e,t){switch(t){case`utf8`:return textEncoder().encode(e);case`ascii`:{let t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n)&127;return t}case`latin1`:{let t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n)&255;return t}case`base64`:return base64Decode(e.replace(/-/g,`+`).replace(/_/g,`/`));case`base64url`:return encodeString(e.replace(/-/g,`+`).replace(/_/g,`/`),`base64`);case`hex`:{let t=e.length>>>1,n=new Uint8Array(t);for(let r=0;r<t;r++){let t=parseInt(e[r*2],16),i=parseInt(e[r*2+1],16);if(Number.isNaN(t)||Number.isNaN(i))break;n[r]=t<<4|i}return n}case`utf16le`:{let t=new Uint8Array(e.length*2);for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);t[n*2]=r&255,t[n*2+1]=r>>8&255}return t}default:return textEncoder().encode(e)}}function decodeString(e,t,n,r){let i=n!==void 0||r!==void 0?e.subarray(n??0,r??e.length):e;switch(t){case`utf8`:return textDecoder().decode(i);case`ascii`:{let e=``;for(let t=0;t<i.length;t++)e+=String.fromCharCode(i[t]&127);return e}case`latin1`:{let e=``;for(let t=0;t<i.length;t++)e+=String.fromCharCode(i[t]);return e}case`base64`:{let e=``;for(let t=0;t<i.length;t++)e+=String.fromCharCode(i[t]);return btoaPolyfill(e)}case`base64url`:return decodeString(i,`base64`).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=+$/,``);case`hex`:{let e=``;for(let t=0;t<i.length;t++)e+=i[t].toString(16).padStart(2,`0`);return e}case`utf16le`:{let e=``;for(let t=0;t+1<i.length;t+=2)e+=String.fromCharCode(i[t]|i[t+1]<<8);return e}default:return textDecoder().decode(i)}}function checkOffset(e,t,n){if(e+t>n)throw RangeError(`Attempt to access memory outside buffer bounds`)}var Vt,Ht,textEncoder,textDecoder,Ut=__esmMin(()=>{Rt(),textEncoder=()=>Vt??=new TextEncoder,textDecoder=()=>Ht??=new TextDecoder}),Wt,q,Gt,Kt,qt,SlowBuffer,Jt=__esmMin(()=>{Ut(),Bt(),Wt=typeof SharedArrayBuffer<`u`,q=class Buffer extends Uint8Array{static _isBuffer=!0;static alloc(e,t,n){if(typeof e!=`number`)throw TypeError(`The "size" argument must be of type number. Received type ${typeof e}`);if(e<0)throw RangeError(`The value "${e}" is invalid for option "size"`);let r=new Buffer(e);return t!==void 0&&t!==0&&r.fill(t,0,e,n),r}static allocUnsafe(e){if(typeof e!=`number`)throw TypeError(`The "size" argument must be of type number. Received type ${typeof e}`);return new Buffer(e)}static allocUnsafeSlow(e){return Buffer.allocUnsafe(e)}static from(e,t,n){if(typeof e==`string`){let n=normalizeEncoding(t);if(t&&typeof t==`string`){let e=(``+t).toLowerCase().replace(/-/g,``);[`utf8`,`ascii`,`latin1`,`binary`,`base64`,`base64url`,`hex`,`ucs2`,`utf16le`,``].includes(e)||checkEncoding(t)}let r=encodeString(e,n);return new Buffer(r.buffer,r.byteOffset,r.byteLength)}if(ArrayBuffer.isView(e)){let t=new Buffer(e.buffer,e.byteOffset,e.byteLength),n=new Buffer(t.length);return n.set(t),n}if(e instanceof ArrayBuffer){let r=t||0;return new Buffer(e,r,n===void 0?e.byteLength-r:n)}if(Wt&&e instanceof SharedArrayBuffer){let r=t||0,i=n===void 0?e.byteLength-r:n;return new Buffer(new Uint8Array(e,r,i))}if(typeof e==`object`&&e&&typeof e.viewBytes==`function`&&typeof e.byteLength==`number`&&e.constructor?.name===`SharedBuffer`){let r=e,i=t||0,a=n===void 0?r.byteLength-i:n,o=r.viewBytes(i,a);return new Buffer(o.buffer,o.byteOffset,o.byteLength)}if(Array.isArray(e)){let t=new Buffer(e.length);for(let n=0;n<e.length;n++)t[n]=e[n]&255;return t}throw TypeError(`The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array`)}static isBuffer(e){return e instanceof Buffer}static isEncoding(e){if(typeof e!=`string`)return!1;let t=e.toLowerCase().replace(/-/g,``);return[`utf8`,`ascii`,`latin1`,`binary`,`base64`,`base64url`,`hex`,`ucs2`,`utf16le`].includes(t)}static byteLength(e,t){if(typeof e!=`string`){if(ArrayBuffer.isView(e)||e instanceof ArrayBuffer||Wt&&e instanceof SharedArrayBuffer)return e.byteLength;throw TypeError(`The "string" argument must be one of type string, Buffer, or ArrayBuffer`)}switch(normalizeEncoding(t)){case`utf8`:return new TextEncoder().encode(e).byteLength;case`ascii`:case`latin1`:return e.length;case`base64`:case`base64url`:{let t=e.length;for(;t>0&&(e[t-1]===`=`||e[t-1]===` `);)t--;return t*3>>>2}case`hex`:return e.length>>>1;case`utf16le`:return e.length*2;default:return new TextEncoder().encode(e).byteLength}}static compare(e,t){if(!(e instanceof Uint8Array)||!(t instanceof Uint8Array))throw TypeError(`Arguments must be Buffers or Uint8Arrays`);let n=Math.min(e.length,t.length);for(let r=0;r<n;r++){if(e[r]<t[r])return-1;if(e[r]>t[r])return 1}return e.length<t.length?-1:+(e.length>t.length)}static concat(e,t){if(e.length===0)return Buffer.alloc(0);if(t===void 0){t=0;for(let n=0;n<e.length;n++)t+=e[n].length}let n=Buffer.alloc(t),r=0;for(let i=0;i<e.length;i++){let a=e[i],o=Math.min(a.length,t-r);o<=0||(n.set(a.subarray(0,o),r),r+=o)}return n}static poolSize=8192;toString(e,t,n){let r=normalizeEncoding(e);return decodeString(this,r,t,n)}toJSON(){return{type:`Buffer`,data:Array.from(this)}}equals(e){if(!(e instanceof Uint8Array))throw TypeError(`Argument must be a Buffer or Uint8Array`);if(this.length!==e.length)return!1;for(let t=0;t<this.length;t++)if(this[t]!==e[t])return!1;return!0}compare(e,t,n,r,i){if(!(e instanceof Uint8Array))throw TypeError(`Argument must be a Buffer or Uint8Array`);let a=r!==void 0||i!==void 0?this.subarray(r??0,i??this.length):this,o=t!==void 0||n!==void 0?e.subarray(t??0,n??e.length):e;return Buffer.compare(a,o)}copy(e,t=0,n=0,r){let i=r??this.length,a=Math.min(i-n,e.length-t);return a<=0?0:(e.set(this.subarray(n,n+a),t),a)}slice(e,t){let n=e??0,r=t??this.length,i=super.subarray(n,r);return new Buffer(i.buffer,i.byteOffset,i.byteLength)}subarray(e,t){let n=super.subarray(e,t);return new Buffer(n.buffer,n.byteOffset,n.byteLength)}write(e,t,n,r){t??=0;let i=encodeString(e,normalizeEncoding(r||(typeof n==`string`?n:void 0))),a=n!==void 0&&typeof n==`number`?Math.min(n,this.length-t):this.length-t,o=Math.min(i.length,a);return this.set(i.subarray(0,o),t),o}fill(e,t,n,r){let i=t??0,a=n??this.length;if(typeof e==`number`)super.fill(e&255,i,a);else if(typeof e==`string`){let t=encodeString(e,normalizeEncoding(r));if(t.length===0)super.fill(0,i,a);else if(t.length===1)super.fill(t[0],i,a);else for(let e=i;e<a;e++)this[e]=t[(e-i)%t.length]}else if(e instanceof Uint8Array)if(e.length===0)super.fill(0,i,a);else for(let t=i;t<a;t++)this[t]=e[(t-i)%e.length];return this}indexOf(e,t,n){if(typeof e==`number`)return super.indexOf(e&255,t);let r=typeof e==`string`?encodeString(e,normalizeEncoding(n)):e,i=t??0;outer:for(let e=i;e<=this.length-r.length;e++){for(let t=0;t<r.length;t++)if(this[e+t]!==r[t])continue outer;return e}return-1}lastIndexOf(e,t,n){if(typeof e==`number`)return t===void 0?super.lastIndexOf(e&255):super.lastIndexOf(e&255,t);let r=typeof e==`string`?encodeString(e,normalizeEncoding(n)):e,i=t===void 0?this.length-r.length:Math.min(t,this.length-r.length);outer:for(let e=i;e>=0;e--){for(let t=0;t<r.length;t++)if(this[e+t]!==r[t])continue outer;return e}return-1}includes(e,t,n){return this.indexOf(e,t,n)!==-1}readUInt8(e=0){return checkOffset(e,1,this.length),this[e]}readUInt16BE(e=0){return checkOffset(e,2,this.length),this[e]<<8|this[e+1]}readUInt16LE(e=0){return checkOffset(e,2,this.length),this[e]|this[e+1]<<8}readUInt32BE(e=0){return checkOffset(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])}readUInt32LE(e=0){return checkOffset(e,4,this.length),this[e+3]*16777216+(this[e+2]<<16|this[e+1]<<8|this[e])>>>0}readInt8(e=0){return checkOffset(e,1,this.length),this[e]|(this[e]&128?4294967040:0)}readInt16BE(e=0){checkOffset(e,2,this.length);let t=this[e]<<8|this[e+1];return t&32768?t|4294901760:t}readInt16LE(e=0){checkOffset(e,2,this.length);let t=this[e]|this[e+1]<<8;return t&32768?t|4294901760:t}readInt32BE(e=0){return checkOffset(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]}readInt32LE(e=0){return checkOffset(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24}readFloatBE(e=0){return checkOffset(e,4,this.length),new DataView(this.buffer,this.byteOffset+e,4).getFloat32(0,!1)}readFloatLE(e=0){return checkOffset(e,4,this.length),new DataView(this.buffer,this.byteOffset+e,4).getFloat32(0,!0)}readDoubleBE(e=0){return checkOffset(e,8,this.length),new DataView(this.buffer,this.byteOffset+e,8).getFloat64(0,!1)}readDoubleLE(e=0){return checkOffset(e,8,this.length),new DataView(this.buffer,this.byteOffset+e,8).getFloat64(0,!0)}readBigInt64BE(e=0){return checkOffset(e,8,this.length),new DataView(this.buffer,this.byteOffset+e,8).getBigInt64(0,!1)}readBigInt64LE(e=0){return checkOffset(e,8,this.length),new DataView(this.buffer,this.byteOffset+e,8).getBigInt64(0,!0)}readBigUInt64BE(e=0){return checkOffset(e,8,this.length),new DataView(this.buffer,this.byteOffset+e,8).getBigUint64(0,!1)}readBigUInt64LE(e=0){return checkOffset(e,8,this.length),new DataView(this.buffer,this.byteOffset+e,8).getBigUint64(0,!0)}readUIntBE(e,t){checkOffset(e,t,this.length);let n=0;for(let r=0;r<t;r++)n=n*256+this[e+r];return n}readUIntLE(e,t){checkOffset(e,t,this.length);let n=0,r=1;for(let i=0;i<t;i++)n+=this[e+i]*r,r*=256;return n}readIntBE(e,t){checkOffset(e,t,this.length);let n=0;for(let r=0;r<t;r++)n=n*256+this[e+r];return n>=2**(8*t-1)&&(n-=2**(8*t)),n}readIntLE(e,t){checkOffset(e,t,this.length);let n=0,r=1;for(let i=0;i<t;i++)n+=this[e+i]*r,r*=256;return n>=2**(8*t-1)&&(n-=2**(8*t)),n}writeUInt8(e,t=0){return checkOffset(t,1,this.length),this[t]=e&255,t+1}writeUInt16BE(e,t=0){return checkOffset(t,2,this.length),this[t]=e>>>8&255,this[t+1]=e&255,t+2}writeUInt16LE(e,t=0){return checkOffset(t,2,this.length),this[t]=e&255,this[t+1]=e>>>8&255,t+2}writeUInt32BE(e,t=0){return checkOffset(t,4,this.length),this[t]=e>>>24&255,this[t+1]=e>>>16&255,this[t+2]=e>>>8&255,this[t+3]=e&255,t+4}writeUInt32LE(e,t=0){return checkOffset(t,4,this.length),this[t]=e&255,this[t+1]=e>>>8&255,this[t+2]=e>>>16&255,this[t+3]=e>>>24&255,t+4}writeInt8(e,t=0){return checkOffset(t,1,this.length),e<0&&(e=255+e+1),this[t]=e&255,t+1}writeInt16BE(e,t=0){return checkOffset(t,2,this.length),this[t]=e>>>8&255,this[t+1]=e&255,t+2}writeInt16LE(e,t=0){return checkOffset(t,2,this.length),this[t]=e&255,this[t+1]=e>>>8&255,t+2}writeInt32BE(e,t=0){return checkOffset(t,4,this.length),this[t]=e>>>24&255,this[t+1]=e>>>16&255,this[t+2]=e>>>8&255,this[t+3]=e&255,t+4}writeInt32LE(e,t=0){return checkOffset(t,4,this.length),this[t]=e&255,this[t+1]=e>>>8&255,this[t+2]=e>>>16&255,this[t+3]=e>>>24&255,t+4}writeFloatBE(e,t=0){return checkOffset(t,4,this.length),new DataView(this.buffer,this.byteOffset+t,4).setFloat32(0,e,!1),t+4}writeFloatLE(e,t=0){return checkOffset(t,4,this.length),new DataView(this.buffer,this.byteOffset+t,4).setFloat32(0,e,!0),t+4}writeDoubleBE(e,t=0){return checkOffset(t,8,this.length),new DataView(this.buffer,this.byteOffset+t,8).setFloat64(0,e,!1),t+8}writeDoubleLE(e,t=0){return checkOffset(t,8,this.length),new DataView(this.buffer,this.byteOffset+t,8).setFloat64(0,e,!0),t+8}writeBigInt64BE(e,t=0){return checkOffset(t,8,this.length),new DataView(this.buffer,this.byteOffset+t,8).setBigInt64(0,e,!1),t+8}writeBigInt64LE(e,t=0){return checkOffset(t,8,this.length),new DataView(this.buffer,this.byteOffset+t,8).setBigInt64(0,e,!0),t+8}writeBigUInt64BE(e,t=0){return checkOffset(t,8,this.length),new DataView(this.buffer,this.byteOffset+t,8).setBigUint64(0,e,!1),t+8}writeBigUInt64LE(e,t=0){return checkOffset(t,8,this.length),new DataView(this.buffer,this.byteOffset+t,8).setBigUint64(0,e,!0),t+8}swap16(){let e=this.length;if(e%2!=0)throw RangeError(`Buffer size must be a multiple of 16-bits`);for(let t=0;t<e;t+=2){let e=this[t];this[t]=this[t+1],this[t+1]=e}return this}swap32(){let e=this.length;if(e%4!=0)throw RangeError(`Buffer size must be a multiple of 32-bits`);for(let t=0;t<e;t+=4){let e=this[t],n=this[t+1];this[t]=this[t+3],this[t+1]=this[t+2],this[t+2]=n,this[t+3]=e}return this}swap64(){let e=this.length;if(e%8!=0)throw RangeError(`Buffer size must be a multiple of 64-bits`);for(let t=0;t<e;t+=8){let e=this[t],n=this[t+1],r=this[t+2],i=this[t+3];this[t]=this[t+7],this[t+1]=this[t+6],this[t+2]=this[t+5],this[t+3]=this[t+4],this[t+4]=i,this[t+5]=r,this[t+6]=n,this[t+7]=e}return this}},Gt=2**31-1,Kt=2**28-16,qt={MAX_LENGTH:Gt,MAX_STRING_LENGTH:Kt},SlowBuffer=class extends q{constructor(e){super(e)}}}),Yt=__exportAll$4({Blob:()=>x,Buffer:()=>q,File:()=>S,INSPECT_MAX_BYTES:()=>50,SlowBuffer:()=>SlowBuffer,atob:()=>Xt,atobPolyfill:()=>atobPolyfill,base64Decode:()=>base64Decode,base64Encode:()=>base64Encode,btoa:()=>Zt,btoaPolyfill:()=>btoaPolyfill,checkEncoding:()=>checkEncoding,constants:()=>qt,default:()=>Qt,kMaxLength:()=>Gt,kStringMaxLength:()=>Kt,normalizeEncoding:()=>normalizeEncoding}),Xt,Zt,Qt,J=__esmMin(()=>{Rt(),w(),Bt(),Jt(),Xt=globalThis.atob,Zt=globalThis.btoa,Qt={Buffer:q,SlowBuffer,Blob:x,File:S,atob:Xt,btoa:Zt,kMaxLength:Gt,kStringMaxLength:Kt,constants:qt,INSPECT_MAX_BYTES:50}});J(),`Buffer`in globalThis||Object.defineProperty(globalThis,`Buffer`,{value:q,enumerable:!1,writable:!0,configurable:!0}),A(),typeof globalThis.btoa!=`function`&&Object.defineProperty(globalThis,`btoa`,{value:function btoa(e){let t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n)&255;return k.base64_encode(t)},enumerable:!0,writable:!0,configurable:!0}),typeof globalThis.atob!=`function`&&Object.defineProperty(globalThis,`atob`,{value:function atob(e){let t=k.base64_decode(e),n=``;for(let e=0;e<t.length;e++)n+=String.fromCharCode(t[e]);return n},enumerable:!0,writable:!0,configurable:!0}),L(),typeof queueMicrotask!=`function`&&Object.defineProperty(globalThis,`queueMicrotask`,{value:ge,enumerable:!0,writable:!0,configurable:!0});function getGjsGlobal(){return globalThis}function getGioNamespace(){let e=getGjsGlobal().imports?.gi;if(!e)return null;let t=null;try{t=e.GioUnix??null}catch{}if(!t)try{t=e.Gio??null}catch{}return t}function getMonotonicTime(){try{let e=getGjsGlobal().imports?.gi?.GLib;if(e?.get_monotonic_time)return BigInt(e.get_monotonic_time())*1000n}catch{}return typeof performance?.now==`function`?BigInt(Math.round(performance.now()*1e6)):BigInt(Date.now())*1000000n}const $t=getMonotonicTime();function hrtime(e){let t=getMonotonicTime()-$t,n=Number(t/1000000000n),r=Number(t%1000000000n);if(e){let t=n-e[0],i=r-e[1];return i<0&&(t--,i+=1e9),[t,i]}return[n,r]}function hrtimeBigint(){return getMonotonicTime()-$t}function detectGjsVersion(){try{let e=getGjsGlobal().imports?.system;if(e?.version!==void 0){let t=Number(e.version);return`${Math.floor(t/1e4)}.${Math.floor(t%1e4/100)}.${t%100}`}}catch{}}function detectNodeVersion(){if(typeof globalThis.process?.versions?.node==`string`)return globalThis.process.versions.node}function detectVersionInfo(){if(detectNodeVersion())return{version:globalThis.process.version,versions:{...globalThis.process.versions},title:globalThis.process?.title||`node`};let e=detectGjsVersion(),t={node:`20.0.0`};return e&&(t.gjs=e),{version:`v20.0.0`,versions:t,title:`gjs`}}function detectPpid(){if(typeof globalThis.process?.ppid==`number`)return globalThis.process.ppid;try{let e=getGjsGlobal().imports?.gi?.GLib;if(e){let[,t]=e.file_get_contents(`/proc/self/status`);if(t){let e=new TextDecoder().decode(t).match(/PPid:\s+(\d+)/);if(e)return parseInt(e[1],10)}}}catch{}return 0}function detectPlatform(){try{let e=getGjsGlobal().imports?.gi?.GLib;if(e&&e.get_os_info(`ID`))return`linux`}catch{}return getGjsGlobal().imports?.system===void 0&&typeof globalThis.process?.platform==`string`?globalThis.process.platform:`linux`}function detectArch(){return typeof globalThis.process?.arch==`string`?globalThis.process.arch:`x64`}function getPid(){if(typeof globalThis.process?.pid==`number`)return globalThis.process.pid;try{let e=getGjsGlobal().imports?.gi?.GLib;if(e){let[,t]=e.file_get_contents(`/proc/self/stat`);if(t){let e=new TextDecoder().decode(t),n=parseInt(e,10);if(!isNaN(n))return n}}}catch{}return 0}function getEnvProxy(){if(typeof globalThis.process?.env==`object`)return globalThis.process.env;try{let e=getGjsGlobal().imports?.gi?.GLib;if(e)return new Proxy({},{get(t,n){if(typeof n==`string`)return e.getenv(n)??void 0},set(t,n,r){return typeof n==`string`?(e.setenv(n,String(r),!0),!0):!1},deleteProperty(t,n){return typeof n==`string`?(e.unsetenv(n),!0):!1},has(t,n){return typeof n==`string`?e.getenv(n)!==null:!1},ownKeys(t){return e.listenv()},getOwnPropertyDescriptor(t,n){if(typeof n!=`string`)return;let r=e.getenv(n);if(r!==null)return{configurable:!0,enumerable:!0,writable:!0,value:r}}})}catch{}return{}}function getArgv(){if(globalThis.process?.argv!==void 0)return globalThis.process.argv;try{let e=getGjsGlobal().imports?.system;if(e?.programArgs)return[`gjs`,e.programInvocationName||``,...e.programArgs]}catch{}return[`gjs`]}function getExecPath(){if(typeof globalThis.process?.execPath==`string`)return globalThis.process.execPath;try{let e=getGjsGlobal().imports?.system;if(e?.programInvocationName)return e.programInvocationName}catch{}return`/usr/bin/gjs`}function getCwd(){try{let e=getGjsGlobal().imports?.gi?.GLib;if(e?.get_current_dir)return e.get_current_dir()}catch{}return`/`}function chdir(e){let t=getGjsGlobal().imports?.gi?.GLib;try{if(t?.chdir){if(!t.file_test(e,16)){let t=Error(`ENOENT: no such file or directory, chdir '${e}'`);throw t.code=`ENOENT`,t.syscall=`chdir`,t.path=e,t}t.chdir(e);return}}catch(e){if(e&&typeof e==`object`&&e.code===`ENOENT`)throw e}if(!t){let t=globalThis.process;if(t&&typeof t.chdir==`function`){t.chdir(e);return}}throw Error(`process.chdir() is not supported in this environment`)}L();function exitProcess(e){let t=getGjsGlobal().imports,n=t?.gi?.GLib,r=t?.system,i=n?.idle_add,a=n?.SOURCE_REMOVE,o=n?.PRIORITY_DEFAULT;if(r?.exit&&i&&typeof o==`number`&&typeof a==`boolean`)return ensureMainLoop(),i(o,()=>(quitMainLoop(),r.exit(e),a)),new Promise(()=>{});try{r?.exit&&r.exit(e)}catch{}let s=globalThis.process;throw s&&typeof s.exit==`function`&&s.exit(e),Error(`process.exit(${e})`)}function isGjs(){return getGjsGlobal().imports?.gi?.GLib!==void 0}function killPid(e,t){try{let n=getGjsGlobal().imports?.gi?.GLib;if(n){let r=typeof t==`number`?String(t):t||`SIGTERM`,i=r.startsWith(`SIG`)?`-${r.slice(3)}`:`-${r}`;return n.spawn_command_line_sync(`kill ${i} ${e}`),!0}}catch{}if(!isGjs()){let n=globalThis.process;if(n&&typeof n.kill==`function`)return n.kill(e,t)}throw Error(`process.kill() is not supported in this environment`)}function memoryUsage(){try{let e=getGjsGlobal().imports?.gi?.GLib;if(e){let[,t]=e.file_get_contents(`/proc/self/status`);if(t){let e=new TextDecoder().decode(t).match(/VmRSS:\s+(\d+)/),n=e?parseInt(e[1],10)*1024:0;return{rss:n,heapTotal:n,heapUsed:n,external:0,arrayBuffers:0}}}}catch{}if(!isGjs()){let e=globalThis.process;if(e&&typeof e.memoryUsage==`function`)return e.memoryUsage()}return{rss:0,heapTotal:0,heapUsed:0,external:0,arrayBuffers:0}}function cpuUsage(e){if(!isGjs()){let t=globalThis.process;if(t&&typeof t.cpuUsage==`function`)return t.cpuUsage(e)}return{user:0,system:0}}let en=null;const tn=globalThis.imports?.gi;if(tn)try{en=tn.GjsifyTerminal}catch{}const nn=en;function onceWrapper(){let{target:e,type:t,listener:n}=this;return this.wrapperFn&&e.removeListener(t,this.wrapperFn),n.apply(e,Array.from(arguments))}function _onceWrap(e,t,n){let r={target:e,type:t,listener:n,wrapperFn:void 0},i=onceWrapper.bind(r);return r.wrapperFn=i,i.listener=n,i}function arrayClone(e){switch(e.length){case 0:return[];case 1:return[e[0]];case 2:return[e[0],e[1]];case 3:return[e[0],e[1],e[2]];default:return e.slice()}}function checkListener(e){if(typeof e!=`function`)throw TypeError(`The "listener" argument must be of type Function. Received type `+typeof e)}function validateNumber(e,t){if(typeof e!=`number`||e!==e)throw TypeError(`The "${t}" argument must be of type number. Received type ${typeof e}`)}function spliceOne(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}function unwrapListeners(e){let t=Array.from({length:e.length});for(let n=0;n<t.length;++n)t[n]=e[n].listener??e[n];return t}function createAbortError$2(e){let t=Error(`The operation was aborted`);return t.name=`AbortError`,t.code=`ABORT_ERR`,e?.reason&&(t.cause=e.reason),t}var rn,an,on,sn=__esmMin(()=>{I(),rn=Symbol(`kCapture`),an=Symbol.for(`nodejs.rejection`),on=class EventEmitter{static defaultMaxListeners=10;static errorMonitor=Symbol(`events.errorMonitor`);static captureRejectionSymbol=an;static _captureRejections=!1;static get captureRejections(){return EventEmitter._captureRejections}static set captureRejections(e){if(typeof e!=`boolean`)throw TypeError(`The "captureRejections" argument must be of type boolean.`);EventEmitter._captureRejections=e}_events;_eventsCount;_maxListeners;[rn];constructor(e){this._events=Object.create(null),this._eventsCount=0,this._maxListeners=void 0,this[rn]=e?.captureRejections??EventEmitter._captureRejections}setMaxListeners(e){if(validateNumber(e,`n`),e<0)throw RangeError(`The value of "n" is out of range. It must be a non-negative number. Received `+e);return this._maxListeners=e,this}getMaxListeners(){return this._maxListeners??EventEmitter.defaultMaxListeners}emit(e,...t){let n=this._events,r=e===`error`;if(n!==void 0)r&&n[EventEmitter.errorMonitor]!==void 0&&this.emit(EventEmitter.errorMonitor,...t),r&&=n.error===void 0;else if(!r)return!1;if(r){let e;if(e=t.length>0?t[0]:Error(`Unhandled error.`),e instanceof Error)throw e;let n=Error(`Unhandled error. (`+e+`)`);throw n.context=e,n}let i=n[e];if(i===void 0)return!1;if(typeof i==`function`){let n=i.apply(this,t);n!=null&&this[rn]&&this._addCatch(n,e,t)}else{let n=arrayClone(i),r=n.length;for(let i=0;i<r;++i){let r=n[i].apply(this,t);r!=null&&this[rn]&&this._addCatch(r,e,t)}}return!0}_addCatch(e,t,n){typeof e?.then==`function`&&e.then(void 0,e=>{let r=this[an];if(typeof r==`function`)r.call(this,e,t,...n);else{let t=this[rn];try{this[rn]=!1,this.emit(`error`,e)}finally{this[rn]=t}}})}addListener(e,t){return this._addListener(e,t,!1)}on(e,t){return this._addListener(e,t,!1)}prependListener(e,t){return this._addListener(e,t,!0)}_addListener(e,t,n){checkListener(t);let r=this._events;r===void 0?(r=this._events=Object.create(null),this._eventsCount=0):r.newListener!==void 0&&(this.emit(`newListener`,e,t.listener??t),r=this._events);let i=r[e];i===void 0?(r[e]=t,++this._eventsCount):typeof i==`function`?r[e]=n?[t,i]:[i,t]:n?i.unshift(t):i.push(t);let a=this.getMaxListeners();if(a>0){let t=typeof r[e]==`function`?1:r[e].length;if(t>a&&!r[e].warned){typeof r[e]!=`function`&&(r[e].warned=!0);let n=Error(`Possible EventEmitter memory leak detected. ${t} ${String(e)} listeners added to [${this.constructor.name}]. Use emitter.setMaxListeners() to increase limit`);n.name=`MaxListenersExceededWarning`,F.warn(n.message)}}return this}once(e,t){return checkListener(t),this.on(e,_onceWrap(this,e,t)),this}prependOnceListener(e,t){return checkListener(t),this.prependListener(e,_onceWrap(this,e,t)),this}removeListener(e,t){checkListener(t);let n=this._events;if(n===void 0)return this;let r=n[e];if(r===void 0)return this;if(r===t||r.listener===t)--this._eventsCount===0?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit(`removeListener`,e,r.listener??t));else if(typeof r!=`function`){let i=-1;for(let e=r.length-1;e>=0;e--)if(r[e]===t||r[e].listener===t){i=e;break}if(i<0)return this;i===0?r.shift():spliceOne(r,i),r.length===1&&(n[e]=r[0]),n.removeListener!==void 0&&this.emit(`removeListener`,e,t.listener??t)}return this}off(e,t){return this.removeListener(e,t)}removeAllListeners(e){let t=this._events;if(t===void 0)return this;if(t.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):t[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete t[e]),this;if(arguments.length===0){let e=Object.keys(t);for(let t=0;t<e.length;++t){let n=e[t];n!==`removeListener`&&this.removeAllListeners(n)}return this.removeAllListeners(`removeListener`),this._events=Object.create(null),this._eventsCount=0,this}let n=t[e];if(typeof n==`function`)this.removeListener(e,n);else if(n!==void 0)for(let t=n.length-1;t>=0;t--)this.removeListener(e,n[t]);return this}listeners(e){let t=this._events;if(t===void 0)return[];let n=t[e];return n===void 0?[]:typeof n==`function`?[n.listener??n]:unwrapListeners(n)}rawListeners(e){let t=this._events;if(t===void 0)return[];let n=t[e];return n===void 0?[]:typeof n==`function`?[n]:arrayClone(n)}listenerCount(e){let t=this._events;if(t===void 0)return 0;let n=t[e];return n===void 0?0:typeof n==`function`?1:n.length}eventNames(){return(this._eventsCount??0)>0?Reflect.ownKeys(this._events):[]}static once(e,t,n){return new Promise((r,i)=>{let a=n?.signal;if(a?.aborted){i(createAbortError$2(a));return}if(typeof e.addEventListener==`function`){let n=e,handler=(...e)=>{a&&a.removeEventListener(`abort`,abortHandler),r(e)},errorHandler=e=>{a&&a.removeEventListener(`abort`,abortHandler),n.removeEventListener(`error`,errorHandler),i(e)},abortHandler=()=>{n.removeEventListener(t,handler),n.removeEventListener(`error`,errorHandler),i(createAbortError$2(a))};n.addEventListener(t,handler,{once:!0}),t!==`error`&&n.addEventListener(`error`,errorHandler,{once:!0}),a&&a.addEventListener(`abort`,abortHandler,{once:!0});return}let o=e,eventHandler=(...e)=>{a&&a.removeEventListener(`abort`,abortHandler),errorHandler!==void 0&&o.removeListener(`error`,errorHandler),r(e)},errorHandler;t!==`error`&&(errorHandler=e=>{o.removeListener(t,eventHandler),a&&a.removeEventListener(`abort`,abortHandler),i(e)},o.once(`error`,errorHandler)),o.once(t,eventHandler);let abortHandler=()=>{o.removeListener(t,eventHandler),errorHandler&&o.removeListener(`error`,errorHandler),i(createAbortError$2(a))};a&&a.addEventListener(`abort`,abortHandler,{once:!0})})}static on(e,t,n){let r=n?.signal;if(r?.aborted)throw createAbortError$2(r);let i=n?.highWaterMark??2**53-1,a=n?.lowWaterMark??1;validateNumber(i,`highWaterMark`),validateNumber(a,`lowWaterMark`);let o=[],s=[],c=null,l=!1,u=!1,eventHandler=(...t)=>{if(s.length>0){let{resolve:e}=s.shift();e({value:t,done:!1})}else o.push(t),o.length>=i&&!u&&(u=!0,typeof e.pause==`function`&&e.pause())},errorHandler=e=>{if(c=e,s.length>0){let{reject:t}=s.shift();t(e)}d.return()},abortHandler=()=>{errorHandler(createAbortError$2(r))};e.on(t,eventHandler),t!==`error`&&e.on(`error`,errorHandler),r&&r.addEventListener(`abort`,abortHandler,{once:!0});let cleanup=()=>{e.removeListener(t,eventHandler),e.removeListener(`error`,errorHandler),r&&r.removeEventListener(`abort`,abortHandler),l=!0;for(let{resolve:e}of s)e({value:void 0,done:!0});s.length=0,o.length=0},d={next(){if(o.length>0){let t=o.shift();return u&&o.length<a&&(u=!1,typeof e.resume==`function`&&e.resume()),Promise.resolve({value:t,done:!1})}if(c){let e=Promise.reject(c);return c=null,e}return l?Promise.resolve({value:void 0,done:!0}):new Promise((e,t)=>{s.push({resolve:e,reject:t})})},return(){return cleanup(),Promise.resolve({value:void 0,done:!0})},throw(e){return l||(c=e,cleanup()),Promise.reject(e)},[Symbol.asyncIterator](){return this}};return d}static listenerCount(e,t){return e.listenerCount(t)}static getEventListeners(e,t){return typeof e.listeners==`function`?e.listeners(t):[]}static setMaxListeners(e,...t){if(validateNumber(e,`n`),e<0)throw RangeError(`The value of "n" is out of range.`);if(t.length===0)EventEmitter.defaultMaxListeners=e;else for(let n of t)typeof n.setMaxListeners==`function`&&n.setMaxListeners(e)}static getMaxListeners(e){return typeof e.getMaxListeners==`function`?e.getMaxListeners():EventEmitter.defaultMaxListeners}static addAbortListener(e,t){e.aborted&&Promise.resolve().then(()=>t());let handler=()=>t();return e.addEventListener(`abort`,handler,{once:!0}),{[Symbol.dispose](){e.removeEventListener(`abort`,handler)}}}},on.EventEmitter=on;for(let e of[`setMaxListeners`,`getMaxListeners`,`emit`,`addListener`,`on`,`prependListener`,`once`,`prependOnceListener`,`removeListener`,`off`,`removeAllListeners`,`listeners`,`rawListeners`,`listenerCount`,`eventNames`]){let t=on.prototype[e];typeof t==`function`&&Object.defineProperty(on.prototype,e,{enumerable:!0,configurable:!0,writable:!0,value:t})}Object.defineProperty(on.prototype,`_events`,{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(on.prototype,`_eventsCount`,{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(on.prototype,`_maxListeners`,{enumerable:!0,configurable:!0,writable:!0,value:void 0}),__name(createAbortError$2,`createAbortError`)}),cn=__exportAll$4({EventEmitter:()=>Y,addAbortListener:()=>vn,captureRejectionSymbol:()=>ln,default:()=>Y,defaultMaxListeners:()=>dn,errorMonitor:()=>un,getEventListeners:()=>gn,getMaxListeners:()=>pn,listenerCount:()=>_n,on:()=>hn,once:()=>mn,setMaxListeners:()=>fn}),Y,ln,un,dn,fn,pn,mn,hn,gn,_n,vn,yn=__esmMin(()=>{sn(),L(),Y=makeCallable(on),Y.EventEmitter=Y,ln=Y.captureRejectionSymbol,un=Y.errorMonitor,dn=Y.defaultMaxListeners,fn=Y.setMaxListeners,pn=Y.getMaxListeners,mn=Y.once,hn=Y.on,gn=Y.getEventListeners,_n=Y.listenerCount,vn=Y.addAbortListener}),bn=__exportAll$4({StringDecoder:()=>xn,default:()=>Sn});function normalizeAndValidateEncoding(e){return e&&checkEncoding(e),normalizeEncoding(e)}function utf8DecodeMaximalSubpart(e,t,n){let r=``,i=t;for(;i<n;){let t=e[i];if(t<=127){r+=String.fromCharCode(t),i++;continue}if(t>=194&&t<=223){i+1<n&&e[i+1]>=128&&e[i+1]<=191?(r+=String.fromCharCode((t&31)<<6|e[i+1]&63),i+=2):(r+=`�`,i++);continue}if(t>=224&&t<=239){let a,o;if(t===224?(a=160,o=191):t===237?(a=128,o=159):(a=128,o=191),i+1>=n){r+=`�`,i++;continue}let s=e[i+1];if(s<a||s>o){r+=`�`,i++;continue}if(i+2>=n){r+=`�`,i+=2;continue}let c=e[i+2];if(c<128||c>191){r+=`�`,i+=2;continue}let l=(t&15)<<12|(s&63)<<6|c&63;r+=String.fromCharCode(l),i+=3;continue}if(t>=240&&t<=244){let a,o;if(t===240?(a=144,o=191):t===244?(a=128,o=143):(a=128,o=191),i+1>=n){r+=`�`,i++;continue}let s=e[i+1];if(s<a||s>o){r+=`�`,i++;continue}if(i+2>=n){r+=`�`,i+=2;continue}let c=e[i+2];if(c<128||c>191){r+=`�`,i+=2;continue}if(i+3>=n){r+=`�`,i+=3;continue}let l=e[i+3];if(l<128||l>191){r+=`�`,i+=3;continue}let u=(t&7)<<18|(s&63)<<12|(c&63)<<6|l&63;r+=String.fromCharCode(55296+(u-65536>>10),56320+(u-65536&1023)),i+=4;continue}r+=`�`,i++}return r}function utf8CharLength(e){return e&128?e>=194&&e<=223?2:e>=224&&e<=239?3:e>=240&&e<=244?4:0:1}function isValidContinuation(e,t,n,r){if(n===1){if(t===3)return e===224?r>=160&&r<=191:e===237?r>=128&&r<=159:r>=128&&r<=191;if(t===4)return e===240?r>=144&&r<=191:e===244?r>=128&&r<=143:r>=128&&r<=191}return r>=128&&r<=191}function writeUtf8(e,t){let n=0,r=``;if(e._lastNeed>0){for(;n<t.length&&e._lastNeed>0;){let i=t[n],a=e._lastTotal-e._lastNeed;if(isValidContinuation(e._lastLeadByte,e._lastTotal,a,i))e._lastChar[a]=i,e._lastNeed--,n++;else{r+=`�`,e._lastNeed=0,e._lastTotal=0,e._lastLeadByte=0;break}}if(e._lastNeed===0&&e._lastTotal>0&&(r+=utf8DecodeMaximalSubpart(e._lastChar,0,e._lastTotal),e._lastTotal=0,e._lastLeadByte=0),e._lastNeed>0)return r}let i=t.length;for(let r=0;r<Math.min(4,t.length-n);r++){let a=t.length-1-r;if(a<n)break;let o=t[a];if((o&192)!=128){let n=utf8CharLength(o);if(n>0&&o>=128){let r=t.length-a;if(r<n){let s=!0;for(let e=1;e<r;e++)if(!isValidContinuation(o,n,e,t[a+e])){s=!1;break}if(s){i=a;for(let n=0;n<r;n++)e._lastChar[n]=t[a+n];e._lastNeed=n-r,e._lastTotal=n,e._lastLeadByte=o}}}break}}return i>n&&(r+=utf8DecodeMaximalSubpart(t,n,i)),r}function writeUtf16le(e,t){let n=``,r=0;if(e._lastNeed>0){let i=e._lastTotal-e._lastNeed,a=Math.min(e._lastNeed,t.length);for(let n=0;n<a;n++)e._lastChar[i+n]=t[n];if(e._lastNeed-=a,r=a,e._lastNeed>0)return``;let o=e._lastTotal,s=0;for(;s+1<o;){let i=e._lastChar[s]|e._lastChar[s+1]<<8;if(s+=2,i>=55296&&i<=56319){if(s+1<o){let t=e._lastChar[s]|e._lastChar[s+1]<<8;if(t>=56320&&t<=57343){n+=String.fromCharCode(i,t),s+=2;continue}}if(r+1<t.length){let e=t[r]|t[r+1]<<8;if(e>=56320&&e<=57343){n+=String.fromCharCode(i,e),r+=2;continue}}else if(r>=t.length)return e._lastChar[0]=e._lastChar[s-2],e._lastChar[1]=e._lastChar[s-1],e._lastNeed=2,e._lastTotal=4,n}n+=String.fromCharCode(i)}e._lastTotal=0}for(;r+1<t.length;){let i=t[r]|t[r+1]<<8;if(r+=2,i>=55296&&i<=56319)if(r+1<t.length){let e=t[r]|t[r+1]<<8;if(e>=56320&&e<=57343){n+=String.fromCharCode(i,e),r+=2;continue}}else if(r<t.length)return n+=String.fromCharCode(i),e._lastChar[0]=t[r],e._lastNeed=1,e._lastTotal=2,n;else return e._lastChar[0]=t[r-2],e._lastChar[1]=t[r-1],e._lastNeed=2,e._lastTotal=4,n;n+=String.fromCharCode(i)}return r<t.length&&(e._lastChar[0]=t[r],e._lastNeed=1,e._lastTotal=2),n}function writeBase64(e,t){let n=0;if(e._lastNeed>0){let r=Math.min(e._lastNeed,t.length);for(let n=0;n<r;n++)e._lastChar[e._lastTotal-e._lastNeed+n]=t[n],e._lastNeed--;if(n=r,e._lastNeed>0)return``}let r=t.length-n,i=r-r%3,a=``;e._lastTotal>0&&e._lastNeed===0&&(a+=base64Encode(e._lastChar.subarray(0,e._lastTotal)),e._lastTotal=0),i>0&&(a+=base64Encode(t.subarray(n,n+i)));let o=r-i;if(o>0){for(let r=0;r<o;r++)e._lastChar[r]=t[n+i+r];e._lastNeed=3-o,e._lastTotal=3}return a}function decodeAscii(e){let t=``;for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]&127);return t}function decodeLatin1(e){let t=``;for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return t}function decodeHex(e){let t=``;for(let n=0;n<e.length;n++)t+=e[n].toString(16).padStart(2,`0`);return t}var xn,Sn,Cn=__esmMin(()=>{J(),xn=function StringDecoder(e){this.encoding=normalizeAndValidateEncoding(e),this._lastNeed=0,this._lastTotal=0,this._lastLeadByte=0,this.encoding===`utf8`||this.encoding===`utf16le`?this._lastChar=new Uint8Array(4):this.encoding===`base64`?this._lastChar=new Uint8Array(3):this._lastChar=new Uint8Array},xn.prototype.write=function write(e){if(e.length===0)return``;switch(this.encoding){case`utf8`:return writeUtf8(this,e);case`utf16le`:return writeUtf16le(this,e);case`base64`:return writeBase64(this,e);case`ascii`:return decodeAscii(e);case`latin1`:return decodeLatin1(e);case`hex`:return decodeHex(e);default:return decodeAscii(e)}},xn.prototype.end=function end(e){let t=``;if(e&&e.length>0&&(t=this.write(e)),this.encoding===`utf8`&&this._lastNeed>0)t+=`�`,this._lastNeed=0,this._lastTotal=0;else if(this.encoding===`utf16le`&&this._lastNeed>0){let e=this._lastTotal-this._lastNeed;for(let n=0;n+1<e;n+=2)t+=String.fromCharCode(this._lastChar[n]|this._lastChar[n+1]<<8);this._lastNeed=0,this._lastTotal=0}else if(this.encoding===`base64`&&this._lastNeed>0){let e=this._lastChar.subarray(0,this._lastTotal-this._lastNeed);t+=base64Encode(e),this._lastNeed=0,this._lastTotal=0}return t},Sn={StringDecoder:xn}});I(),yn(),L(),Cn();const wn=new TextEncoder;var ProcessWriteStream=class extends Y{fd;writable=!0;_outGio=null;constructor(e){super(),this.fd=e;let t=getGioNamespace();if(t){let e=t.UnixOutputStream??t.OutputStream;if(e)try{this._outGio=e.new(this.fd,!1)}catch{}}}write(e){if(this._outGio)try{let t=typeof e==`string`?wn.encode(e):e;return this._outGio.write_all(t,null),!0}catch{}return this.fd===2?F.error(e):F.log(e),!0}get isTTY(){if(nn)return nn.Terminal.is_tty(this.fd);try{let e=getGjsGlobal().imports?.gi?.GLib;if(e)return!!e.log_writer_supports_color(this.fd)}catch{}return!1}get columns(){if(nn){let[e,,t]=nn.Terminal.get_size(this.fd);if(e&&t>0)return t}try{let e=getGjsGlobal().imports?.gi?.GLib;if(e){let t=parseInt(e.getenv(`COLUMNS`)??`0`,10);if(t>0)return t}}catch{}return 80}end(){}destroy(){}get rows(){if(nn){let[e,t]=nn.Terminal.get_size(this.fd);if(e&&t>0)return t}try{let e=getGjsGlobal().imports?.gi?.GLib;if(e){let t=parseInt(e.getenv(`LINES`)??`0`,10);if(t>0)return t}}catch{}return 24}},ProcessReadStream=class extends Y{fd;isRaw=!1;_gio=null;_stdinGio=null;_reading=!1;_flowing=!1;_sttyCleanupRegistered=!1;_mainLoopHeld=!1;_pendingRead=!1;_decoder=null;constructor(e){super(),this.fd=e,this._gio=getGioNamespace()}get isTTY(){return nn?nn.Terminal.is_tty(this.fd):!1}setRawMode(e){return nn&&nn.Terminal.set_raw_mode(this.fd,e)?(this.isRaw=e,this):(this._setRawModeViaStty(e),this.isRaw=e,this)}_setRawModeViaStty(e){try{let t=globalThis.imports?.gi,n=t?.Gio??t?.Gio;if(!n)return;let r=n.SubprocessFlags?.STDIN_INHERIT??2,i=e?[`stty`,`-icanon`,`-echo`,`-icrnl`,`-isig`,`min`,`1`,`time`,`0`]:[`stty`,`icanon`,`echo`,`icrnl`,`isig`];if(new n.SubprocessLauncher({flags:r}).spawnv(i).wait(null),e&&!this._sttyCleanupRegistered){this._sttyCleanupRegistered=!0;let e=globalThis.process;e?.once&&typeof e.once==`function`&&e.once(`exit`,()=>this._setRawModeViaStty(!1))}}catch{}}setEncoding(e){return this._decoder=new xn(e),this}_pushData(e){if(this._decoder){let t=this._decoder.write(e);t.length>0&&this.emit(`data`,t)}else this.emit(`data`,e)}on(e,t){let n=e===`data`&&this.listenerCount(`data`)===0;return super.on(e,t),n&&e===`data`&&this.resume(),this}addListener(e,t){return this.on(e,t)}once(e,t){return super.once(e,t),this}removeListener(e,t){return super.removeListener(e,t),e===`data`&&this.listenerCount(`data`)===0&&this.pause(),this}off(e,t){return this.removeListener(e,t)}removeAllListeners(e){let t=e===void 0||e===`data`?this.listenerCount(`data`)>0:!1;return super.removeAllListeners(e),t&&this.listenerCount(`data`)===0&&this.pause(),this}resume(){return this._flowing=!0,this._gio&&this.fd===0&&!this._reading&&this._startReading(),this}pause(){if(this._flowing=!1,this._reading=!1,this._mainLoopHeld){this._mainLoopHeld=!1;let e=globalThis.imports?.gi,t=e?.GLib??e?.GLib;t?.idle_add?t.idle_add(300,()=>(this._mainLoopHeld||quitMainLoop(),!1)):quitMainLoop()}return this}read(){return null}_startReading(){if(!this._gio||this._reading)return;if(this._pendingRead){this._reading=!0,this._mainLoopHeld||(this._mainLoopHeld=!0,ensureMainLoop());return}if(this._reading=!0,this._mainLoopHeld||(this._mainLoopHeld=!0,ensureMainLoop()),!this._stdinGio){let e=this._gio.UnixInputStream??this._gio.InputStream;if(!e){this._reading=!1;return}try{this._stdinGio=e.new(this.fd,!1)}catch{this._reading=!1;return}}let loop=()=>{if(!this._reading){this._pendingRead=!1;return}this._pendingRead=!0,this._stdinGio.read_bytes_async(4096,0,null,(e,t)=>{this._pendingRead=!1;try{let n=e.read_bytes_finish(t)?.get_data?.()??null;if(n&&n.byteLength>0)this._pushData(Buffer.from(n));else if(n!==null&&n.byteLength===0){if(this._reading=!1,this._decoder){let e=this._decoder.end();e.length>0&&this.emit(`data`,e)}this.emit(`end`);return}}catch{this._reading=!1;return}this._reading&&loop()})};loop()}};I(),yn();const Tn=Date.now();var Process=class extends Y{platform;arch;env;argv;argv0;execPath;pid;ppid;version;versions;title;execArgv;config;exitCode;constructor(){super(),this.platform=detectPlatform(),this.arch=detectArch(),this.env=getEnvProxy(),this.argv=getArgv(),this.argv0=this.argv[0]||`gjs`,this.execPath=getExecPath(),this.execArgv=globalThis.process?.execArgv??[],this.config=globalThis.process?.config??{target_defaults:{},variables:{}},this.pid=getPid(),this.ppid=detectPpid();let e=detectVersionInfo();this.version=e.version,this.versions=e.versions,this.title=e.title}cwd(){return getCwd()}chdir(e){chdir(e)}kill(e,t){return killPid(e,t)}exit(e){return this.exitCode=e??this.exitCode??0,this.emit(`exit`,this.exitCode),exitProcess(this.exitCode)}nextTick(e,...t){typeof queueMicrotask==`function`?queueMicrotask(()=>e(...t)):Promise.resolve().then(()=>e(...t))}hrtime(e){return hrtime(e)}uptime(){return(Date.now()-Tn)/1e3}memoryUsage(){return memoryUsage()}cpuUsage(e){return cpuUsage(e)}stdout=new ProcessWriteStream(1);stderr=new ProcessWriteStream(2);stdin=new ProcessReadStream(0);abort(){this.exit(1)}umask(e){return 18}emitWarning(e,t){F.warn(typeof e==`string`?`(${t||`Warning`}): ${e}`:e.message)}};Process.prototype.hrtime.bigint=function(){return hrtimeBigint()};const X=new Process;if(nn)try{let e=new nn.ResizeWatcher;e.connect(`resized`,(e,t,n)=>{X.stdout.emit(`resize`),X.stderr.emit(`resize`)}),e.start()}catch{}X.platform,X.arch,X.env,X.argv,X.argv0,X.execPath,X.pid,X.ppid,X.version,X.versions,X.cwd.bind(X),X.chdir.bind(X),X.exit.bind(X),X.nextTick.bind(X),Object.assign(X.hrtime.bind(X),{bigint:hrtimeBigint}),X.uptime.bind(X),X.memoryUsage.bind(X),X.cpuUsage.bind(X),X.kill.bind(X),X.abort.bind(X),X.umask.bind(X),X.emitWarning.bind(X),X.execArgv,X.config,X.stdout,X.stderr,X.stdin,L(),typeof Promise.withResolvers!=`function`&&(Promise.withResolvers=function(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}),initErrorV8Methods(Error),`global`in globalThis||Object.defineProperty(globalThis,`global`,{value:globalThis,writable:!1,enumerable:!1,configurable:!0}),Object.defineProperty(globalThis,`process`,{value:X,enumerable:!1,writable:!0,configurable:!0}),L(),typeof globalThis.structuredClone!=`function`&&Object.defineProperty(globalThis,`structuredClone`,{value:structuredClone$1,enumerable:!0,writable:!0,configurable:!0});function getGLib(){return globalThis.imports?.gi?.GLib}const En=getGLib()!==void 0;var GjsifyTimeout=class{_id=null;_refed=!0;_callback;_delay;_args;_repeat;constructor(e,t,n,r){this._callback=e,this._delay=t,this._args=n,this._repeat=r,this._schedule()}_schedule(){let e=getGLib();if(!e)return;let t=e.timeout_add.bind(e);this._id=t(e.PRIORITY_DEFAULT,this._delay,()=>{try{this._callback.apply(globalThis,this._args)}catch(e){setTimeout(()=>{throw e},0)}return this._repeat?e.SOURCE_CONTINUE:(this._id=null,e.SOURCE_REMOVE)})}ref(){return this._refed=!0,this}unref(){return this._refed=!1,this}hasRef(){return this._refed}refresh(){return this._cancel(),this._schedule(),this}_cancel(){if(this._id!==null){try{getGLib()?.Source.remove(this._id)}catch{}this._id=null}}[Symbol.toPrimitive](){return this._id}[Symbol.dispose](){this._cancel()}};function removeById(e){if(e instanceof GjsifyTimeout)e._cancel();else if(typeof e==`number`)try{getGLib()?.Source.remove(e)}catch{}}if(En){let setT=(e,t=0,...n)=>new GjsifyTimeout(e,Math.max(0,t|0),n,!1),setI=(e,t=0,...n)=>new GjsifyTimeout(e,Math.max(0,t|0),n,!0),e=globalThis;e.setTimeout=setT,e.clearTimeout=removeById,e.setInterval=setI,e.clearInterval=removeById}function setImmediate$1(e,...t){return setTimeout(e,0,...t)}__name(setImmediate$1,`setImmediate`);function clearImmediate(e){clearTimeout(e)}`setImmediate`in globalThis||Object.defineProperty(globalThis,`setImmediate`,{value:setImmediate$1,enumerable:!0,writable:!0,configurable:!0}),`clearImmediate`in globalThis||Object.defineProperty(globalThis,`clearImmediate`,{value:clearImmediate,enumerable:!0,writable:!0,configurable:!0});var Dn=__exportAll$4({URL:()=>Z,URLSearchParams:()=>kn,default:()=>An,domainToASCII:()=>domainToASCII,domainToUnicode:()=>domainToUnicode,fileURLToPath:()=>fileURLToPath,format:()=>format$3,parse:()=>parse$3,pathToFileURL:()=>pathToFileURL,resolve:()=>resolve$2});function decodeComponent(e){try{return decodeURIComponent(e.replace(/\+/g,` `))}catch{return e}}function encodeComponent(e){return encodeURIComponent(e).replace(/%20/g,`+`)}function parse$3(e,t,n){if(typeof e!=`string`)throw TypeError(`The "url" argument must be of type string. Received type `+typeof e);let r={protocol:null,slashes:null,auth:null,host:null,port:null,hostname:null,hash:null,search:null,query:null,pathname:null,path:null,href:e},i=e.trim(),a=i.indexOf(`#`);a!==-1&&(r.hash=i.slice(a),i=i.slice(0,a));let o=i.indexOf(`?`);o!==-1&&(r.search=i.slice(o),r.query=t?Object.fromEntries(new kn(i.slice(o+1))):i.slice(o+1),i=i.slice(0,o));let s=/^([a-z][a-z0-9.+-]*:)/i.exec(i);if(s&&(r.protocol=s[1].toLowerCase(),i=i.slice(r.protocol.length)),(n||r.protocol)&&i.startsWith(`//`)&&(r.slashes=!0,i=i.slice(2)),r.slashes||r.protocol&&![`javascript:`,`data:`,`mailto:`].includes(r.protocol)){let e=-1;for(let t=0;t<i.length;t++){let n=i[t];if(n===`/`||n===`\\`){e=t;break}}let t=e===-1?i:i.slice(0,e);i=e===-1?``:i.slice(e);let n=t.lastIndexOf(`@`);n===-1?parseHostPort(t,r):(r.auth=decodeURIComponent(t.slice(0,n)),parseHostPort(t.slice(n+1),r))}return r.pathname=i||(r.slashes?`/`:null),(r.pathname!==null||r.search!==null)&&(r.path=(r.pathname||``)+(r.search||``)),r.href=format$3(r),r}function parseHostPort(e,t){if(!e)return;let n=e.indexOf(`[`);if(n!==-1){let r=e.indexOf(`]`,n);if(r!==-1){let i=e.slice(r+1);i.startsWith(`:`)&&(t.port=i.slice(1)),t.hostname=e.slice(n,r+1),t.host=t.hostname+(t.port?`:`+t.port:``);return}}let r=e.lastIndexOf(`:`);if(r!==-1){let n=e.slice(r+1);/^\d*$/.test(n)?(t.port=n||null,t.hostname=e.slice(0,r).toLowerCase()):t.hostname=e.toLowerCase()}else t.hostname=e.toLowerCase();t.host=t.hostname+(t.port?`:`+t.port:``)}function format$3(e){if(typeof e==`string`)return e;if(e instanceof Z)return e.href;let t=e,n=``;if(t.protocol&&(n+=t.protocol),(t.slashes||t.protocol&&![`javascript:`,`data:`,`mailto:`].includes(t.protocol||``))&&(n+=`//`),t.auth&&(n+=encodeURIComponent(t.auth)+`@`),t.host?n+=t.host:(t.hostname&&(n+=t.hostname),t.port&&(n+=`:`+t.port)),t.pathname&&(n+=t.pathname),t.search)n+=t.search;else if(t.query&&typeof t.query==`object`){let e=new kn(t.query).toString();e&&(n+=`?`+e)}return t.hash&&(n+=t.hash),n}function resolve$2(e,t){return new Z(t,new Z(e,`resolve://`)).href.replace(/^resolve:\/\//,``)}function fileURLToPath(e){if(typeof e==`string`&&(e=new Z(e)),!(e instanceof Z))throw TypeError(`The "url" argument must be of type string or URL. Received type `+typeof e);if(e.protocol!==`file:`)throw TypeError(`The URL must be of scheme file`);if(e.hostname!==``&&e.hostname!==`localhost`)throw TypeError(`File URL host must be "localhost" or empty on linux`);let t=e.pathname;for(let e=0;e<t.length;e++)if(t[e]===`%`){let n=t.codePointAt(e+2)|32;if(t[e+1]===`2`&&n===102)throw TypeError(`File URL path must not include encoded / characters`)}return decodeURIComponent(t)}function pathToFileURL(e){let t=e;if(e[0]!==`/`)if(typeof globalThis.process?.cwd==`function`)t=globalThis.process.cwd()+`/`+e;else try{k?.get_current_dir&&(t=k.get_current_dir()+`/`+e)}catch{}return new Z(`file://`+encodePathForURL(t))}function encodePathForURL(e){let t=``;for(let n=0;n<e.length;n++){let r=e[n];r>=`a`&&r<=`z`||r>=`A`&&r<=`Z`||r>=`0`&&r<=`9`||r===`/`||r===`-`||r===`_`||r===`.`||r===`~`||r===`:`||r===`@`||r===`!`?t+=r:t+=encodeURIComponent(r)}return t}function domainToASCII(e){try{return new Z(`http://${e}`).hostname}catch{return``}}function domainToUnicode(e){try{return new Z(`http://${e}`).hostname}catch{return``}}var On,kn,Z,An,jn=__esmMin(()=>{A(),On=k.UriFlags.HAS_PASSWORD|k.UriFlags.ENCODED|k.UriFlags.SCHEME_NORMALIZE,kn=class URLSearchParams{_entries=[];constructor(e){if(e)if(typeof e==`string`){let t=e.startsWith(`?`)?e.slice(1):e;if(t)for(let e of t.split(`&`)){let t=e.indexOf(`=`);t===-1?this._entries.push([decodeComponent(e),``]):this._entries.push([decodeComponent(e.slice(0,t)),decodeComponent(e.slice(t+1))])}}else if(Array.isArray(e))for(let[t,n]of e)this._entries.push([String(t),String(n)]);else if(e instanceof URLSearchParams)this._entries=e._entries.map(([e,t])=>[e,t]);else for(let t of Object.keys(e))this._entries.push([t,String(e[t])])}get(e){for(let[t,n]of this._entries)if(t===e)return n;return null}getAll(e){return this._entries.filter(([t])=>t===e).map(([,e])=>e)}set(e,t){let n=!1;if(this._entries=this._entries.filter(([t])=>t===e?n?!1:(n=!0,!0):!0),n){for(let n=0;n<this._entries.length;n++)if(this._entries[n][0]===e){this._entries[n][1]=t;break}}else this._entries.push([e,t])}has(e){return this._entries.some(([t])=>t===e)}delete(e){this._entries=this._entries.filter(([t])=>t!==e)}append(e,t){this._entries.push([e,t])}sort(){this._entries.sort((e,t)=>e[0]<t[0]?-1:+(e[0]>t[0]))}toString(){return this._entries.map(([e,t])=>encodeComponent(e)+`=`+encodeComponent(t)).join(`&`)}forEach(e){for(let[t,n]of this._entries)e(n,t,this)}*entries(){yield*this._entries}*keys(){for(let[e]of this._entries)yield e}*values(){for(let[,e]of this._entries)yield e}[Symbol.iterator](){return this.entries()}get size(){return this._entries.length}},Z=class URL{#e;#t;constructor(e,t){let n=e instanceof URL?e.href:String(e);try{if(t!==void 0){let e=t instanceof URL?t.href:String(t),r=k.Uri.parse(e,On);this.#e=r.parse_relative(n,On)}else this.#e=k.Uri.parse(n,On)}catch{throw TypeError(`Invalid URL: ${n}`)}if(!this.#e)throw TypeError(`Invalid URL: ${n}`);this.#t=new kn(this.#e.get_query()||``)}get protocol(){return this.#e.get_scheme()+`:`}get hostname(){return(this.#e.get_host()||``).toLowerCase()}get port(){let e=this.#e.get_port();if(e===-1)return``;let t=this.#e.get_scheme();return(t===`http`||t===`ws`)&&e===80||(t===`https`||t===`wss`)&&e===443||t===`ftp`&&e===21?``:String(e)}get host(){let e=this.hostname,t=this.port;return t?`${e}:${t}`:e}get pathname(){return this.#e.get_path()||`/`}get search(){let e=this.#e.get_query();return e?`?`+e:``}get hash(){let e=this.#e.get_fragment();return e?`#`+e:``}get origin(){let e=this.protocol;return e===`http:`||e===`https:`||e===`ftp:`?`${e}//${this.host}`:`null`}get username(){return this.#e.get_user()||``}get password(){return this.#e.get_password()||``}get href(){let e=this.protocol,t=this.#e.get_scheme();(t===`http`||t===`https`||t===`ftp`||t===`file`||t===`ws`||t===`wss`||this.hostname)&&(e+=`//`);let n=this.username,r=this.password;n&&(e+=n,r&&(e+=`:`+r),e+=`@`),e+=this.hostname,this.port&&(e+=`:`+this.port);let i=this.pathname;return e+=i,e+=this.search,e+=this.hash,e}get searchParams(){return this.#t}toString(){return this.href}toJSON(){return this.href}static _objectURLPaths=new Map;static _objectURLCounter=0;static createObjectURL(e){let t=e?._tmpPath;if(typeof t==`string`&&t.length>0){let e=`file://${t}`;return URL._objectURLPaths.set(e,t),e}return`file:///dev/null`}static revokeObjectURL(e){let t=URL._objectURLPaths.get(e);if(t){try{k.unlink(t)}catch{}URL._objectURLPaths.delete(e)}}},__name(parse$3,`parse`),__name(format$3,`format`),__name(resolve$2,`resolve`),An={URL:Z,URLSearchParams:kn,parse:parse$3,format:format$3,resolve:resolve$2,fileURLToPath,pathToFileURL,domainToASCII,domainToUnicode}});jn(),typeof globalThis.URL!=`function`&&Object.defineProperty(globalThis,`URL`,{value:Z,enumerable:!1,writable:!0,configurable:!0}),typeof globalThis.URLSearchParams!=`function`&&Object.defineProperty(globalThis,`URLSearchParams`,{value:kn,enumerable:!1,writable:!0,configurable:!0});let Mn;if(globalThis.performance)Mn=globalThis.performance;else{let e,_now;try{let t=globalThis.imports?.gi?.GLib;if(!t)throw Error(`GJS imports.gi.GLib not available`);e=t.get_monotonic_time(),_now=()=>(t.get_monotonic_time()-e)/1e3}catch{let t=Date.now();e=0,_now=()=>Date.now()-t}let t=[],n=Date.now()-_now();Mn={timeOrigin:n,now:_now,mark(e){let n={name:e,entryType:`mark`,startTime:_now(),duration:0};return t.push(n),n},measure(e,n,r){let i=0,a=_now();if(n){let e=t.find(e=>e.entryType===`mark`&&e.name===n);e&&(i=e.startTime)}if(r){let e=t.find(e=>e.entryType===`mark`&&e.name===r);e&&(a=e.startTime)}let o={name:e,entryType:`measure`,startTime:i,duration:a-i};return t.push(o),o},getEntries(){return[...t]},getEntriesByName(e){return t.filter(t=>t.name===e)},getEntriesByType(e){return t.filter(t=>t.entryType===e)},clearMarks(e){for(let n=t.length-1;n>=0;n--)t[n].entryType===`mark`&&(!e||t[n].name===e)&&t.splice(n,1)},clearMeasures(e){for(let n=t.length-1;n>=0;n--)t[n].entryType===`measure`&&(!e||t[n].name===e)&&t.splice(n,1)},clearResourceTimings(){},setResourceTimingBufferSize(){},toJSON(){return{timeOrigin:n}}}}var PerformanceObserverStub=class{_callback;constructor(e){this._callback=e}observe(e){}disconnect(){}takeRecords(){return[]}};const Nn=globalThis,Pn=Nn.PerformanceObserver||PerformanceObserverStub;Nn.PerformanceEntry,Nn.PerformanceObserverEntryList,Nn.PerformanceMark,Nn.PerformanceMeasure;const Fn=globalThis;globalThis.performance===void 0&&(Fn.performance=Mn),typeof Fn.PerformanceObserver!=`function`&&(Fn.PerformanceObserver=Pn);const In=Symbol(`abort`),Ln=Symbol(`internal`);var Rn=class AbortSignal extends EventTarget{#e=!1;reason=void 0;onabort=null;constructor(e){if(super(),e!==Ln)throw TypeError(`Illegal constructor.`)}get aborted(){if(!(this instanceof AbortSignal))throw TypeError(`'get aborted' called on an object that is not a valid instance of AbortSignal.`);return this.#e}get[Symbol.toStringTag](){return`AbortSignal`}throwIfAborted(){if(this.#e)throw this.reason}[In](e){if(this.#e)return;this.#e=!0,this.reason=e??new Be(`The operation was aborted.`,`AbortError`);let t=new Event(`abort`);typeof this.onabort==`function`&&this.onabort.call(this,t),this.dispatchEvent(t)}static abort(e){let t=new AbortSignal(Ln);return t[In](e),t}static timeout(e){let t=new AbortSignal(Ln);return setTimeout(()=>{t[In](new Be(`The operation timed out.`,`TimeoutError`))},e),t}static any(e){let t=new AbortSignal(Ln);for(let n of e)if(n.aborted)return t[In](n.reason),t;let onAbort=()=>{if(!t.aborted){let n=e.find(e=>e.aborted);t[In](n?.reason)}};for(let t of e)t.addEventListener(`abort`,onAbort,{once:!0});return t}},zn=class AbortController{signal;constructor(){this.signal=new Rn(Ln)}abort(e){if(!(this instanceof AbortController))throw TypeError(`'abort' called on an object that is not a valid instance of AbortController.`);this.signal[In](e)}};const Bn=globalThis;globalThis.AbortController===void 0&&(Bn.AbortController=zn),globalThis.AbortSignal===void 0&&(Bn.AbortSignal=Rn);const Q=Symbol(`kState`),$=Symbol(`kType`);function isBrandCheck(e){return t=>typeof t==`object`&&!!t&&t[Q]!==void 0&&t[$]===e}function dequeueValue(e){let t=e[Q].queue.shift();if(t===void 0)throw Error(`dequeueValue called on an empty queue`);let{value:n,size:r}=t;return e[Q].queueTotalSize=Math.max(0,e[Q].queueTotalSize-r),n}function resetQueue(e){e[Q].queue=[],e[Q].queueTotalSize=0}function peekQueueValue(e){return e[Q].queue[0].value}function enqueueValueWithSize(e,t,n){if(n=+n,typeof n!=`number`||n<0||Number.isNaN(n)||n===1/0)throw RangeError(`Invalid size: ${n}`);e[Q].queue.push({value:t,size:n}),e[Q].queueTotalSize+=n}function extractHighWaterMark(e,t){if(e===void 0)return t;if(e=+e,typeof e!=`number`||Number.isNaN(e)||e<0)throw RangeError(`Invalid highWaterMark: ${e}`);return e}function extractSizeAlgorithm(e){if(e===void 0)return()=>1;if(typeof e!=`function`)throw TypeError(`strategy.size must be a function`);return e}function transferArrayBuffer(e){return typeof ArrayBuffer.prototype.transfer==`function`?e.transfer():e.slice(0)}function isDetachedBuffer(e){if(typeof SharedArrayBuffer<`u`&&e instanceof SharedArrayBuffer||e.byteLength!==0)return!1;try{return e.slice(0,0),!1}catch{return!0}}function typedArrayConstructorByTag(e){switch(e){case`Int8Array`:return Int8Array;case`Uint8Array`:return Uint8Array;case`Uint8ClampedArray`:return Uint8ClampedArray;case`Int16Array`:return Int16Array;case`Uint16Array`:return Uint16Array;case`Int32Array`:return Int32Array;case`Uint32Array`:return Uint32Array;case`Float32Array`:return Float32Array;case`Float64Array`:return Float64Array;case`BigInt64Array`:return typeof BigInt64Array<`u`?BigInt64Array:void 0;case`BigUint64Array`:return typeof BigUint64Array<`u`?BigUint64Array:void 0;default:return}}function elementSizeByTag(e){switch(e){case`Int8Array`:case`Uint8Array`:case`Uint8ClampedArray`:return 1;case`Int16Array`:case`Uint16Array`:return 2;case`Int32Array`:case`Uint32Array`:case`Float32Array`:return 4;case`Float64Array`:case`BigInt64Array`:case`BigUint64Array`:return 8;default:return 1}}function setPromiseHandled(e){e.then(()=>{},()=>{})}function createPromiseCallback(e,t,n){if(typeof t!=`function`)throw TypeError(`${e} must be a function`);return async(...e)=>t.call(n,...e)}async function nonOpFlush(){}function nonOpStart(){}async function nonOpPull(){}async function nonOpCancel(){}async function nonOpWrite(){}const Vn={__proto__:Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype),next:void 0,return:void 0};function createAsyncFromSyncIterator(e){let t={[Symbol.iterator]:()=>e.iterator},n=(async function*(){return yield*t})();return{iterator:n,nextMethod:n.next,done:!1}}function getIterator(e,t=`sync`,n){if(n===void 0)if(t===`async`){if(n=e[Symbol.asyncIterator],n==null){let t=e[Symbol.iterator];if(t===void 0)throw TypeError(`Object is not iterable`);return createAsyncFromSyncIterator(getIterator(e,`sync`,t))}}else n=e[Symbol.iterator];if(n===void 0)throw TypeError(`Object is not iterable`);let r=n.call(e);if(typeof r!=`object`||!r)throw TypeError(`The iterator method must return an object`);return{iterator:r,nextMethod:r.next,done:!1}}function iteratorNext(e,t){let n;if(n=t===void 0?e.nextMethod.call(e.iterator):e.nextMethod.call(e.iterator,t),typeof n!=`object`||!n)throw TypeError(`The iterator.next() method must return an object`);return n}const Hn=typeof globalThis.AbortController==`function`?globalThis.AbortController:class AbortControllerShim{signal={aborted:!1,reason:void 0,addEventListener(){},removeEventListener(){}};abort(e){this.signal.aborted=!0,this.signal.reason=e}},Un=Symbol(`kAbort`),Wn=Symbol(`kCloseSentinel`),Gn=Symbol(`kError`),Kn=Symbol(`kSkipThrow`);var WritableStream=class{[$]=`WritableStream`;[Q];constructor(e={},t={}){if(e!=null&&typeof e!=`object`)throw TypeError(`sink must be an object`);if(t!=null&&typeof t!=`object`)throw TypeError(`strategy must be an object`);let n=e?.type;if(n!==void 0)throw RangeError(`Invalid type: ${n}`);this[Q]=createWritableStreamState();let r=extractSizeAlgorithm(t?.size),i=extractHighWaterMark(t?.highWaterMark,1);setupWritableStreamDefaultControllerFromSink(this,e,i,r)}get locked(){if(!qn(this))throw TypeError(`Invalid this`);return isWritableStreamLocked(this)}abort(e){return qn(this)?isWritableStreamLocked(this)?Promise.reject(TypeError(`WritableStream is locked`)):writableStreamAbort(this,e):Promise.reject(TypeError(`Invalid this`))}close(){return qn(this)?isWritableStreamLocked(this)?Promise.reject(TypeError(`WritableStream is locked`)):writableStreamCloseQueuedOrInFlight(this)?Promise.reject(TypeError(`Failure closing WritableStream`)):writableStreamClose(this):Promise.reject(TypeError(`Invalid this`))}getWriter(){if(!qn(this))throw TypeError(`Invalid this`);return new WritableStreamDefaultWriter(this)}get[Symbol.toStringTag](){return`WritableStream`}},WritableStreamDefaultWriter=class{[$]=`WritableStreamDefaultWriter`;[Q];constructor(e){if(!qn(e))throw TypeError(`Expected a WritableStream`);this[Q]={stream:void 0,close:{promise:void 0,resolve:void 0,reject:void 0},ready:{promise:void 0,resolve:void 0,reject:void 0}},setupWritableStreamDefaultWriter(this,e)}get closed(){return Jn(this)?this[Q].close.promise:Promise.reject(TypeError(`Invalid this`))}get desiredSize(){if(!Jn(this))throw TypeError(`Invalid this`);if(this[Q].stream===void 0)throw TypeError(`Writer is not bound to a WritableStream`);return writableStreamDefaultWriterGetDesiredSize(this)}get ready(){return Jn(this)?this[Q].ready.promise:Promise.reject(TypeError(`Invalid this`))}abort(e){return Jn(this)?this[Q].stream===void 0?Promise.reject(TypeError(`Writer is not bound to a WritableStream`)):writableStreamDefaultWriterAbort(this,e):Promise.reject(TypeError(`Invalid this`))}close(){if(!Jn(this))return Promise.reject(TypeError(`Invalid this`));let{stream:e}=this[Q];return e===void 0?Promise.reject(TypeError(`Writer is not bound to a WritableStream`)):writableStreamCloseQueuedOrInFlight(e)?Promise.reject(TypeError(`Failure to close WritableStream`)):writableStreamDefaultWriterClose(this)}releaseLock(){if(!Jn(this))throw TypeError(`Invalid this`);let{stream:e}=this[Q];e!==void 0&&writableStreamDefaultWriterRelease(this)}write(e){return Jn(this)?this[Q].stream===void 0?Promise.reject(TypeError(`Writer is not bound to a WritableStream`)):writableStreamDefaultWriterWrite(this,e):Promise.reject(TypeError(`Invalid this`))}get[Symbol.toStringTag](){return`WritableStreamDefaultWriter`}},WritableStreamDefaultController=class{[$]=`WritableStreamDefaultController`;[Q];constructor(e){if(e!==Kn)throw TypeError(`Illegal constructor`)}[Un](e){let t=this[Q].abortAlgorithm(e);return writableStreamDefaultControllerClearAlgorithms(this),t}[Gn](){resetQueue(this)}get signal(){if(!Yn(this))throw TypeError(`Invalid this`);return this[Q].abortController.signal}error(e){if(!Yn(this))throw TypeError(`Invalid this`);this[Q].stream[Q].state===`writable`&&writableStreamDefaultControllerError(this,e)}get[Symbol.toStringTag](){return`WritableStreamDefaultController`}};const qn=isBrandCheck(`WritableStream`),Jn=isBrandCheck(`WritableStreamDefaultWriter`),Yn=isBrandCheck(`WritableStreamDefaultController`);function createEmptyPromiseRecord(){return{promise:void 0,resolve:void 0,reject:void 0}}function createWritableStreamState(){return{close:Promise.withResolvers(),closeRequest:createEmptyPromiseRecord(),inFlightWriteRequest:createEmptyPromiseRecord(),inFlightCloseRequest:createEmptyPromiseRecord(),pendingAbortRequest:{abort:createEmptyPromiseRecord(),reason:void 0,wasAlreadyErroring:!1},backpressure:!1,controller:void 0,state:`writable`,storedError:void 0,writeRequests:[],writer:void 0}}function isWritableStreamLocked(e){return e[Q].writer!==void 0}function setupWritableStreamDefaultWriter(e,t){if(isWritableStreamLocked(t))throw TypeError(`WritableStream is locked`);switch(e[Q].stream=t,t[Q].writer=e,t[Q].state){case`writable`:!writableStreamCloseQueuedOrInFlight(t)&&t[Q].backpressure?e[Q].ready=Promise.withResolvers():e[Q].ready={promise:Promise.resolve(),resolve:void 0,reject:void 0},e[Q].close=Promise.withResolvers();break;case`erroring`:e[Q].ready={promise:Promise.reject(t[Q].storedError),resolve:void 0,reject:void 0},setPromiseHandled(e[Q].ready.promise),e[Q].close=Promise.withResolvers();break;case`closed`:e[Q].ready={promise:Promise.resolve(),resolve:void 0,reject:void 0},e[Q].close={promise:Promise.resolve(),resolve:void 0,reject:void 0};break;default:e[Q].ready={promise:Promise.reject(t[Q].storedError),resolve:void 0,reject:void 0},e[Q].close={promise:Promise.reject(t[Q].storedError),resolve:void 0,reject:void 0},setPromiseHandled(e[Q].ready.promise),setPromiseHandled(e[Q].close.promise)}}function writableStreamAbort(e,t){let{state:n,controller:r}=e[Q];if(n===`closed`||n===`errored`)return Promise.resolve();if(r[Q].abortController.abort(t),e[Q].pendingAbortRequest.abort.promise!==void 0)return e[Q].pendingAbortRequest.abort.promise;let i=!1;n===`erroring`&&(i=!0,t=void 0);let a=Promise.withResolvers();return e[Q].pendingAbortRequest={abort:a,reason:t,wasAlreadyErroring:i},i||writableStreamStartErroring(e,t),a.promise}function writableStreamClose(e){let{state:t,writer:n,backpressure:r,controller:i}=e[Q];if(t===`closed`||t===`errored`)return Promise.reject(TypeError(`WritableStream is closed`));e[Q].closeRequest=Promise.withResolvers();let{promise:a}=e[Q].closeRequest;return n!==void 0&&r&&t===`writable`&&n[Q].ready.resolve?.(),writableStreamDefaultControllerClose(i),a}function writableStreamUpdateBackpressure(e,t){let{writer:n}=e[Q];n!==void 0&&e[Q].backpressure!==t&&(t?n[Q].ready=Promise.withResolvers():n[Q].ready.resolve?.()),e[Q].backpressure=t}function writableStreamStartErroring(e,t){let{controller:n,writer:r}=e[Q];e[Q].state=`erroring`,e[Q].storedError=t,r!==void 0&&writableStreamDefaultWriterEnsureReadyPromiseRejected(r,t),!writableStreamHasOperationMarkedInFlight(e)&&n[Q].started&&writableStreamFinishErroring(e)}function writableStreamRejectCloseAndClosedPromiseIfNeeded(e){e[Q].closeRequest.promise!==void 0&&(e[Q].closeRequest.reject?.(e[Q].storedError),e[Q].closeRequest={promise:void 0,resolve:void 0,reject:void 0}),setPromiseHandled(e[Q].close.promise),e[Q].close.reject?.(e[Q].storedError);let{writer:t}=e[Q];t!==void 0&&(setPromiseHandled(t[Q].close.promise),t[Q].close.reject?.(e[Q].storedError))}function writableStreamMarkFirstWriteRequestInFlight(e){let t=e[Q].writeRequests.shift();e[Q].inFlightWriteRequest=t}function writableStreamMarkCloseRequestInFlight(e){e[Q].inFlightCloseRequest=e[Q].closeRequest,e[Q].closeRequest={promise:void 0,resolve:void 0,reject:void 0}}function writableStreamHasOperationMarkedInFlight(e){return e[Q].inFlightWriteRequest.promise!==void 0||e[Q].inFlightCloseRequest.promise!==void 0}function writableStreamFinishInFlightWriteWithError(e,t){e[Q].inFlightWriteRequest.reject?.(t),e[Q].inFlightWriteRequest={promise:void 0,resolve:void 0,reject:void 0},writableStreamDealWithRejection(e,t)}function writableStreamFinishInFlightWrite(e){e[Q].inFlightWriteRequest.resolve?.(),e[Q].inFlightWriteRequest={promise:void 0,resolve:void 0,reject:void 0}}function writableStreamFinishInFlightCloseWithError(e,t){e[Q].inFlightCloseRequest.reject?.(t),e[Q].inFlightCloseRequest={promise:void 0,resolve:void 0,reject:void 0},e[Q].pendingAbortRequest.abort.promise!==void 0&&(e[Q].pendingAbortRequest.abort.reject?.(t),e[Q].pendingAbortRequest={abort:{promise:void 0,resolve:void 0,reject:void 0},reason:void 0,wasAlreadyErroring:!1}),writableStreamDealWithRejection(e,t)}function writableStreamFinishInFlightClose(e){e[Q].inFlightCloseRequest.resolve?.(),e[Q].inFlightCloseRequest={promise:void 0,resolve:void 0,reject:void 0},e[Q].state===`erroring`&&(e[Q].storedError=void 0,e[Q].pendingAbortRequest.abort.promise!==void 0&&(e[Q].pendingAbortRequest.abort.resolve?.(),e[Q].pendingAbortRequest={abort:{promise:void 0,resolve:void 0,reject:void 0},reason:void 0,wasAlreadyErroring:!1})),e[Q].state=`closed`,e[Q].writer!==void 0&&e[Q].writer[Q].close.resolve?.(),e[Q].close.resolve?.()}function writableStreamFinishErroring(e){e[Q].state=`errored`,e[Q].controller[Gn]();let t=e[Q].storedError;for(let n of e[Q].writeRequests)n.reject?.(t);if(e[Q].writeRequests=[],e[Q].pendingAbortRequest.abort.promise===void 0){writableStreamRejectCloseAndClosedPromiseIfNeeded(e);return}let n=e[Q].pendingAbortRequest;if(e[Q].pendingAbortRequest={abort:{promise:void 0,resolve:void 0,reject:void 0},reason:void 0,wasAlreadyErroring:!1},n.wasAlreadyErroring){n.abort.reject?.(t),writableStreamRejectCloseAndClosedPromiseIfNeeded(e);return}e[Q].controller[Un](n.reason).then(()=>{n.abort.resolve?.(),writableStreamRejectCloseAndClosedPromiseIfNeeded(e)},t=>{n.abort.reject?.(t),writableStreamRejectCloseAndClosedPromiseIfNeeded(e)})}function writableStreamDealWithRejection(e,t){if(e[Q].state===`writable`){writableStreamStartErroring(e,t);return}writableStreamFinishErroring(e)}function writableStreamCloseQueuedOrInFlight(e){return e[Q].closeRequest.promise!==void 0||e[Q].inFlightCloseRequest.promise!==void 0}function writableStreamAddWriteRequest(e){let{promise:t,resolve:n,reject:r}=Promise.withResolvers();return e[Q].writeRequests.push({promise:t,resolve:n,reject:r}),t}function writableStreamDefaultWriterWrite(e,t){let{stream:n}=e[Q],{controller:r}=n[Q],i=writableStreamDefaultControllerGetChunkSize(r,t);if(n!==e[Q].stream)return Promise.reject(TypeError(`Mismatched WritableStreams`));let{state:a}=n[Q];if(a===`errored`)return Promise.reject(n[Q].storedError);if(writableStreamCloseQueuedOrInFlight(n)||a===`closed`)return Promise.reject(TypeError(`WritableStream is closed`));if(a===`erroring`)return Promise.reject(n[Q].storedError);let o=writableStreamAddWriteRequest(n);return writableStreamDefaultControllerWrite(r,t,i),o}function writableStreamDefaultWriterRelease(e){let{stream:t}=e[Q],n=TypeError(`Writer has been released`);writableStreamDefaultWriterEnsureReadyPromiseRejected(e,n),writableStreamDefaultWriterEnsureClosedPromiseRejected(e,n),t[Q].writer=void 0,e[Q].stream=void 0}function writableStreamDefaultWriterGetDesiredSize(e){let{stream:t}=e[Q];switch(t[Q].state){case`errored`:case`erroring`:return null;case`closed`:return 0}return writableStreamDefaultControllerGetDesiredSize(t[Q].controller)}function writableStreamDefaultWriterEnsureReadyPromiseRejected(e,t){e[Q].ready.reject?(e[Q].ready.reject(t),e[Q].ready.resolve=void 0,e[Q].ready.reject=void 0):e[Q].ready={promise:Promise.reject(t),resolve:void 0,reject:void 0},setPromiseHandled(e[Q].ready.promise)}function writableStreamDefaultWriterEnsureClosedPromiseRejected(e,t){e[Q].close.reject?(e[Q].close.reject(t),e[Q].close.resolve=void 0,e[Q].close.reject=void 0):e[Q].close={promise:Promise.reject(t),resolve:void 0,reject:void 0},setPromiseHandled(e[Q].close.promise)}function writableStreamDefaultWriterCloseWithErrorPropagation(e){let{stream:t}=e[Q],{state:n}=t[Q];return writableStreamCloseQueuedOrInFlight(t)||n===`closed`?Promise.resolve():n===`errored`?Promise.reject(t[Q].storedError):writableStreamDefaultWriterClose(e)}function writableStreamDefaultWriterClose(e){return writableStreamClose(e[Q].stream)}function writableStreamDefaultWriterAbort(e,t){return writableStreamAbort(e[Q].stream,t)}function writableStreamDefaultControllerWrite(e,t,n){try{enqueueValueWithSize(e,t,n)}catch(t){writableStreamDefaultControllerErrorIfNeeded(e,t);return}let{stream:r}=e[Q];!writableStreamCloseQueuedOrInFlight(r)&&r[Q].state===`writable`&&writableStreamUpdateBackpressure(r,writableStreamDefaultControllerGetBackpressure(e)),writableStreamDefaultControllerAdvanceQueueIfNeeded(e)}function writableStreamDefaultControllerProcessWrite(e,t){let{stream:n,writeAlgorithm:r}=e[Q];writableStreamMarkFirstWriteRequestInFlight(n),r(t,e).then(()=>{writableStreamFinishInFlightWrite(n);let{state:t}=n[Q];dequeueValue(e),!writableStreamCloseQueuedOrInFlight(n)&&t===`writable`&&writableStreamUpdateBackpressure(n,writableStreamDefaultControllerGetBackpressure(e)),writableStreamDefaultControllerAdvanceQueueIfNeeded(e)},t=>{n[Q].state===`writable`&&writableStreamDefaultControllerClearAlgorithms(e),writableStreamFinishInFlightWriteWithError(n,t)})}function writableStreamDefaultControllerProcessClose(e){let{closeAlgorithm:t,stream:n}=e[Q];writableStreamMarkCloseRequestInFlight(n),dequeueValue(e);let r=t();writableStreamDefaultControllerClearAlgorithms(e),r.then(()=>writableStreamFinishInFlightClose(n),e=>writableStreamFinishInFlightCloseWithError(n,e))}function writableStreamDefaultControllerGetDesiredSize(e){return e[Q].highWaterMark-e[Q].queueTotalSize}function writableStreamDefaultControllerGetChunkSize(e,t){let{sizeAlgorithm:n}=e[Q];if(n===void 0)return 1;try{return n(t)}catch(t){return writableStreamDefaultControllerErrorIfNeeded(e,t),1}}function writableStreamDefaultControllerErrorIfNeeded(e,t){e[Q].stream[Q].state===`writable`&&writableStreamDefaultControllerError(e,t)}function writableStreamDefaultControllerError(e,t){writableStreamDefaultControllerClearAlgorithms(e),writableStreamStartErroring(e[Q].stream,t)}function writableStreamDefaultControllerClose(e){enqueueValueWithSize(e,Wn,0),writableStreamDefaultControllerAdvanceQueueIfNeeded(e)}function writableStreamDefaultControllerClearAlgorithms(e){e[Q].writeAlgorithm=void 0,e[Q].closeAlgorithm=void 0,e[Q].abortAlgorithm=void 0,e[Q].sizeAlgorithm=void 0}function writableStreamDefaultControllerGetBackpressure(e){return writableStreamDefaultControllerGetDesiredSize(e)<=0}function writableStreamDefaultControllerAdvanceQueueIfNeeded(e){let{queue:t,started:n,stream:r}=e[Q];if(!n||r[Q].inFlightWriteRequest.promise!==void 0)return;if(r[Q].state===`erroring`){writableStreamFinishErroring(r);return}if(!t.length)return;let i=peekQueueValue(e);i===Wn?writableStreamDefaultControllerProcessClose(e):writableStreamDefaultControllerProcessWrite(e,i)}function setupWritableStreamDefaultControllerFromSink(e,t,n,r){let i=new WritableStreamDefaultController(Kn),a=t?.start,o=t?.write,s=t?.close,c=t?.abort;setupWritableStreamDefaultController(e,i,a?a.bind(t,i):nonOpStart,o?createPromiseCallback(`sink.write`,o,t):nonOpWrite,s?createPromiseCallback(`sink.close`,s,t):nonOpCancel,c?createPromiseCallback(`sink.abort`,c,t):nonOpCancel,n,r)}function setupWritableStreamDefaultController(e,t,n,r,i,a,o,s){t[Q]={abortAlgorithm:a,closeAlgorithm:i,highWaterMark:o,queue:[],queueTotalSize:0,abortController:new Hn,sizeAlgorithm:s,started:!1,stream:e,writeAlgorithm:r},e[Q].controller=t,writableStreamUpdateBackpressure(e,writableStreamDefaultControllerGetBackpressure(t));let c=n();new Promise(e=>e(c)).then(()=>{t[Q].started=!0,writableStreamDefaultControllerAdvanceQueueIfNeeded(t)},n=>{t[Q].started=!0,writableStreamDealWithRejection(e,n)})}function createWritableStream(e,t,n,r,i=1,a=()=>1){let o=Object.create(WritableStream.prototype);return o[$]=`WritableStream`,o[Q]=createWritableStreamState(),setupWritableStreamDefaultController(o,new WritableStreamDefaultController(Kn),e,t,n,r,i,a),o}L();const Xn=Symbol(`kCancel`),Zn=Symbol(`kClose`),Qn=Symbol(`kChunk`),$n=Symbol(`kError`),er=Symbol(`kPull`),tr=Symbol(`kRelease`),nr=Symbol(`kSkipThrow`);let rr,ir;function lazyReadableReleasedError(){return rr||(rr=TypeError(`Reader released`),rr)}function lazyReadableReleasingError(){return ir||(ir=TypeError(`Releasing reader`),ir)}function createAbortError$1(){if(typeof globalThis.DOMException==`function`)return new DOMException(`The operation was aborted`,`AbortError`);let e=Error(`The operation was aborted`);return e.name=`AbortError`,e}__name(createAbortError$1,`createAbortError`);function createReadableStreamState(){return{disturbed:!1,reader:void 0,state:`readable`,storedError:void 0,controller:void 0,closedPromise:Promise.withResolvers()}}var ReadableStream$1=class{static{__name(this,`ReadableStream`)}[$]=`ReadableStream`;[Q];constructor(e={},t={}){if(e!=null&&typeof e!=`object`)throw TypeError(`source must be an object`);if(t!=null&&typeof t!=`object`)throw TypeError(`strategy must be an object`);this[Q]=createReadableStreamState();let n=t?.size,r=t?.highWaterMark,i=e?.type;if(i!==void 0){if(`${i}`==`bytes`){if(n!==void 0)throw RangeError(`strategy.size must not be set for a byte stream`);setupReadableByteStreamControllerFromSource(this,e,extractHighWaterMark(r,0));return}throw RangeError(`Invalid type: ${i}`)}setupReadableStreamDefaultControllerFromSource(this,e,extractHighWaterMark(r,1),extractSizeAlgorithm(n))}get locked(){if(!ar(this))throw TypeError(`Invalid this`);return isReadableStreamLocked(this)}static from(e){return readableStreamFromIterable(e)}cancel(e=void 0){return ar(this)?isReadableStreamLocked(this)?Promise.reject(TypeError(`ReadableStream is locked`)):readableStreamCancel(this,e):Promise.reject(TypeError(`Invalid this`))}getReader(e={}){if(!ar(this))throw TypeError(`Invalid this`);if(e!=null&&typeof e!=`object`)throw TypeError(`options must be an object`);let t=e?.mode;if(t===void 0)return new ReadableStreamDefaultReader(this);if(`${t}`==`byob`)return new ReadableStreamBYOBReader(this);throw RangeError(`Invalid mode: ${t}`)}pipeThrough(e,t={}){if(!ar(this))throw TypeError(`Invalid this`);let n=e?.readable;if(!ar(n))throw TypeError(`transform.readable must be a ReadableStream`);let r=e?.writable;if(!qn(r))throw TypeError(`transform.writable must be a WritableStream`);if(t!=null&&typeof t!=`object`)throw TypeError(`options must be an object`);let i=t?.preventAbort,a=t?.preventCancel,o=t?.preventClose,s=t?.signal;if(s!==void 0&&!(s instanceof Object&&`aborted`in s))throw TypeError(`options.signal must be an AbortSignal`);if(isReadableStreamLocked(this))throw TypeError(`The ReadableStream is locked`);if(isWritableStreamLocked(r))throw TypeError(`The WritableStream is locked`);return setPromiseHandled(readableStreamPipeTo(this,r,!!o,!!i,!!a,s)),n}pipeTo(e,t={}){try{if(!ar(this))throw TypeError(`Invalid this`);if(!qn(e))throw TypeError(`destination must be a WritableStream`);if(t!=null&&typeof t!=`object`)throw TypeError(`options must be an object`);let n=t?.preventAbort,r=t?.preventCancel,i=t?.preventClose,a=t?.signal;if(a!==void 0&&!(a instanceof Object&&`aborted`in a))throw TypeError(`options.signal must be an AbortSignal`);if(isReadableStreamLocked(this))throw TypeError(`The ReadableStream is locked`);if(isWritableStreamLocked(e))throw TypeError(`The WritableStream is locked`);return readableStreamPipeTo(this,e,!!i,!!n,!!r,a)}catch(e){return Promise.reject(e)}}tee(){if(!ar(this))throw TypeError(`Invalid this`);let e=this[Q].controller;return cr(e)?readableByteStreamTee(this):readableStreamDefaultTee(this,!1)}values(e={}){if(!ar(this))throw TypeError(`Invalid this`);if(e!=null&&typeof e!=`object`)throw TypeError(`options must be an object`);let t=!!e?.preventCancel,n=new ReadableStreamDefaultReader(this),r={done:!1,current:void 0},i=!1;function nextSteps(){if(r.done)return Promise.resolve({done:!0,value:void 0});if(n[Q].stream===void 0)return Promise.reject(TypeError(`The reader is not bound to a ReadableStream`));let{promise:e,resolve:t,reject:i}=Promise.withResolvers();return readableStreamDefaultReaderRead(n,{[Qn](e){r.current=void 0,t({value:e,done:!1})},[Zn](){r.current=void 0,r.done=!0,readableStreamReaderGenericRelease(n),t({done:!0,value:void 0})},[$n](e){r.current=void 0,r.done=!0,readableStreamReaderGenericRelease(n),i(e)}}),e}async function returnSteps(e){if(r.done)return{done:!0,value:e};if(r.done=!0,n[Q].stream===void 0)throw TypeError(`The reader is not bound to a ReadableStream`);if(!t){let t=readableStreamReaderGenericCancel(n,e);return readableStreamReaderGenericRelease(n),await t,{done:!0,value:e}}return readableStreamReaderGenericRelease(n),{done:!0,value:e}}return Object.setPrototypeOf({next(){return i||=(r.current=Promise.resolve(),!0),r.current=r.current===void 0?nextSteps():r.current.then(nextSteps,nextSteps),r.current},return(e){return i=!0,r.current=r.current===void 0?returnSteps(e):r.current.then(()=>returnSteps(e),()=>returnSteps(e)),r.current},[Symbol.asyncIterator](){return this}},Vn)}[Symbol.asyncIterator](){return this.values()}get[Symbol.toStringTag](){return`ReadableStream`}},DefaultReadRequest=class{[Q];constructor(){this[Q]=Promise.withResolvers()}[Qn](e){this[Q].resolve?.({value:e,done:!1})}[Zn](){this[Q].resolve?.({value:void 0,done:!0})}[$n](e){this[Q].reject?.(e)}get promise(){return this[Q].promise}},ReadableStreamDefaultReader=class{[$]=`ReadableStreamDefaultReader`;[Q];constructor(e){if(!ar(e))throw TypeError(`Expected a ReadableStream`);this[Q]={readRequests:[],readIntoRequests:[],stream:void 0,close:{promise:void 0,resolve:void 0,reject:void 0}},setupReadableStreamDefaultReader(this,e)}read(){if(!sr(this))return Promise.reject(TypeError(`Invalid this`));if(this[Q].stream===void 0)return Promise.reject(TypeError(`The reader is not attached to a stream`));let e=this[Q].stream,t=e[Q].controller;if(e[Q].state===`readable`&&or(t)&&t[Q].queue.length>0){e[Q].disturbed=!0;let n=dequeueValue(t);return t[Q].closeRequested&&!t[Q].queue.length?(readableStreamDefaultControllerClearAlgorithms(t),readableStreamClose(e)):readableStreamDefaultControllerCallPullIfNeeded(t),Promise.resolve({value:n,done:!1})}let n=new DefaultReadRequest;return readableStreamDefaultReaderRead(this,n),n.promise}releaseLock(){if(!sr(this))throw TypeError(`Invalid this`);this[Q].stream!==void 0&&readableStreamDefaultReaderRelease(this)}get closed(){return sr(this)?this[Q].close.promise:Promise.reject(TypeError(`Invalid this`))}cancel(e=void 0){return sr(this)?this[Q].stream===void 0?Promise.reject(TypeError(`The reader is not attached to a stream`)):readableStreamReaderGenericCancel(this,e):Promise.reject(TypeError(`Invalid this`))}get[Symbol.toStringTag](){return`ReadableStreamDefaultReader`}},ReadableStreamDefaultController=class{[$]=`ReadableStreamDefaultController`;[Q];constructor(e){if(e!==nr)throw TypeError(`Illegal constructor`)}get desiredSize(){return readableStreamDefaultControllerGetDesiredSize(this)}close(){if(!readableStreamDefaultControllerCanCloseOrEnqueue(this))throw TypeError(`Controller is already closed`);readableStreamDefaultControllerClose(this)}enqueue(e=void 0){if(!readableStreamDefaultControllerCanCloseOrEnqueue(this))throw TypeError(`Controller is already closed`);readableStreamDefaultControllerEnqueue(this,e)}error(e=void 0){readableStreamDefaultControllerError(this,e)}[Xn](e){return readableStreamDefaultControllerCancelSteps(this,e)}[er](e){readableStreamDefaultControllerPullSteps(this,e)}[tr](){}get[Symbol.toStringTag](){return`ReadableStreamDefaultController`}};const ar=isBrandCheck(`ReadableStream`),or=isBrandCheck(`ReadableStreamDefaultController`),sr=isBrandCheck(`ReadableStreamDefaultReader`);function isReadableStreamLocked(e){return e[Q].reader!==void 0}function readableStreamCancel(e,t){switch(e[Q].disturbed=!0,e[Q].state){case`closed`:return Promise.resolve();case`errored`:return Promise.reject(e[Q].storedError)}readableStreamClose(e);let n=e[Q].reader;if(n!==void 0&&readableStreamHasBYOBReader(e)){let e=n[Q].readIntoRequests;n[Q].readIntoRequests=[];for(let t=0;t<e.length;t++)e[t][Zn](void 0)}return e[Q].controller[Xn](t).then(()=>{})}function readableStreamClose(e){e[Q].state=`closed`,e[Q].closedPromise.resolve();let{reader:t}=e[Q];if(t!==void 0&&(t[Q].close.resolve?.(),readableStreamHasDefaultReader(e))){for(let e=0;e<t[Q].readRequests.length;e++)t[Q].readRequests[e][Zn]();t[Q].readRequests=[]}}function readableStreamError(e,t){e[Q].state=`errored`,e[Q].storedError=t,setPromiseHandled(e[Q].closedPromise.promise),e[Q].closedPromise.reject(t);let{reader:n}=e[Q];if(n!==void 0){if(setPromiseHandled(n[Q].close.promise),n[Q].close.reject?.(t),readableStreamHasDefaultReader(e)){for(let e=0;e<n[Q].readRequests.length;e++)n[Q].readRequests[e][$n](t);n[Q].readRequests=[]}else if(readableStreamHasBYOBReader(e)){for(let e=0;e<n[Q].readIntoRequests.length;e++)n[Q].readIntoRequests[e][$n](t);n[Q].readIntoRequests=[]}}}function readableStreamHasDefaultReader(e){let{reader:t}=e[Q];return t===void 0?!1:t[Q]!==void 0&&t[$]===`ReadableStreamDefaultReader`}function readableStreamGetNumReadRequests(e){return e[Q].reader[Q].readRequests.length}function readableStreamFulfillReadRequest(e,t,n){let{reader:r}=e[Q],i=r[Q].readRequests.shift();n?i[Zn]():i[Qn](t)}function readableStreamAddReadRequest(e,t){e[Q].reader[Q].readRequests.push(t)}function readableStreamReaderGenericCancel(e,t){let{stream:n}=e[Q];return readableStreamCancel(n,t)}function readableStreamReaderGenericInitialize(e,t){switch(e[Q].stream=t,t[Q].reader=e,t[Q].state){case`readable`:e[Q].close=Promise.withResolvers();break;case`closed`:e[Q].close={promise:Promise.resolve(),resolve:void 0,reject:void 0};break;case`errored`:e[Q].close={promise:Promise.reject(t[Q].storedError),resolve:void 0,reject:void 0},setPromiseHandled(e[Q].close.promise);break}}function readableStreamReaderGenericRelease(e){let{stream:t}=e[Q],n=lazyReadableReleasedError();t[Q].state===`readable`?e[Q].close.reject?.(n):e[Q].close={promise:Promise.reject(n),resolve:void 0,reject:void 0},setPromiseHandled(e[Q].close.promise),t[Q].controller[tr](),t[Q].reader=void 0,e[Q].stream=void 0}function readableStreamDefaultReaderRelease(e){readableStreamReaderGenericRelease(e),readableStreamDefaultReaderErrorReadRequests(e,lazyReadableReleasingError())}function readableStreamDefaultReaderErrorReadRequests(e,t){for(let n=0;n<e[Q].readRequests.length;++n)e[Q].readRequests[n][$n](t);e[Q].readRequests=[]}function readableStreamDefaultReaderRead(e,t){let{stream:n}=e[Q];switch(n[Q].disturbed=!0,n[Q].state){case`closed`:t[Zn]();break;case`errored`:t[$n](n[Q].storedError);break;case`readable`:n[Q].controller[er](t);break}}function setupReadableStreamDefaultReader(e,t){if(isReadableStreamLocked(t))throw TypeError(`ReadableStream is locked`);readableStreamReaderGenericInitialize(e,t),e[Q].readRequests=[]}function readableStreamDefaultControllerClose(e){readableStreamDefaultControllerCanCloseOrEnqueue(e)&&(e[Q].closeRequested=!0,e[Q].queue.length||(readableStreamDefaultControllerClearAlgorithms(e),readableStreamClose(e[Q].stream)))}function readableStreamDefaultControllerEnqueue(e,t){if(!readableStreamDefaultControllerCanCloseOrEnqueue(e))return;let{stream:n}=e[Q];if(isReadableStreamLocked(n)&&readableStreamGetNumReadRequests(n))readableStreamFulfillReadRequest(n,t,!1);else try{enqueueValueWithSize(e,t,e[Q].sizeAlgorithm(t))}catch(t){throw readableStreamDefaultControllerError(e,t),t}readableStreamDefaultControllerCallPullIfNeeded(e)}function readableStreamDefaultControllerCanCloseOrEnqueue(e){let{stream:t}=e[Q];return!e[Q].closeRequested&&t[Q].state===`readable`}function readableStreamDefaultControllerGetDesiredSize(e){let{stream:t,highWaterMark:n,queueTotalSize:r}=e[Q];switch(t[Q].state){case`errored`:return null;case`closed`:return 0;default:return n-r}}function readableStreamDefaultControllerHasBackpressure(e){return!readableStreamDefaultControllerShouldCallPull(e)}function readableStreamDefaultControllerShouldCallPull(e){let{stream:t}=e[Q];if(!readableStreamDefaultControllerCanCloseOrEnqueue(e)||!e[Q].started)return!1;if(isReadableStreamLocked(t)&&readableStreamGetNumReadRequests(t))return!0;let n=readableStreamDefaultControllerGetDesiredSize(e);return n!==null&&n>0}function readableStreamDefaultControllerCallPullIfNeeded(e){if(readableStreamDefaultControllerShouldCallPull(e)){if(e[Q].pulling){e[Q].pullAgain=!0;return}e[Q].pulling=!0,e[Q].pullAlgorithm(e).then(()=>{e[Q].pulling=!1,e[Q].pullAgain&&(e[Q].pullAgain=!1,readableStreamDefaultControllerCallPullIfNeeded(e))},t=>readableStreamDefaultControllerError(e,t))}}function readableStreamDefaultControllerClearAlgorithms(e){e[Q].pullAlgorithm=void 0,e[Q].cancelAlgorithm=void 0,e[Q].sizeAlgorithm=void 0}function readableStreamDefaultControllerError(e,t){let{stream:n}=e[Q];n[Q].state===`readable`&&(resetQueue(e),readableStreamDefaultControllerClearAlgorithms(e),readableStreamError(n,t))}function readableStreamDefaultControllerCancelSteps(e,t){resetQueue(e);let n=e[Q].cancelAlgorithm?.(t)??Promise.resolve();return readableStreamDefaultControllerClearAlgorithms(e),n}function readableStreamDefaultControllerPullSteps(e,t){let{stream:n,queue:r}=e[Q];if(r.length){let i=dequeueValue(e);e[Q].closeRequested&&!r.length?(readableStreamDefaultControllerClearAlgorithms(e),readableStreamClose(n)):readableStreamDefaultControllerCallPullIfNeeded(e),t[Qn](i);return}readableStreamAddReadRequest(n,t),readableStreamDefaultControllerCallPullIfNeeded(e)}function setupReadableStreamDefaultController(e,t,n,r,i,a,o){t[Q]={cancelAlgorithm:i,closeRequested:!1,highWaterMark:a,pullAgain:!1,pullAlgorithm:r,pulling:!1,queue:[],queueTotalSize:0,started:!1,sizeAlgorithm:o,stream:e},e[Q].controller=t;let s=n();new Promise(e=>e(s)).then(()=>{t[Q].started=!0,readableStreamDefaultControllerCallPullIfNeeded(t)},e=>readableStreamDefaultControllerError(t,e))}function setupReadableStreamDefaultControllerFromSource(e,t,n,r){let i=new ReadableStreamDefaultController(nr),a=t?.start,o=t?.pull,s=t?.cancel;setupReadableStreamDefaultController(e,i,a?a.bind(t,i):nonOpStart,o?createPromiseCallback(`source.pull`,o,t):nonOpPull,s?createPromiseCallback(`source.cancel`,s,t):nonOpCancel,n,r)}function createReadableStream(e,t,n,r=1,i=()=>1){let a=Object.create(ReadableStream$1.prototype);return a[$]=`ReadableStream`,a[Q]=createReadableStreamState(),setupReadableStreamDefaultController(a,new ReadableStreamDefaultController(nr),e,t,n,r,i),a}function readableStreamFromIterable(e){let t,n=getIterator(e,`async`),r=nonOpStart;async function pullAlgorithm(){let e=iteratorNext(n);return Promise.resolve(e).then(e=>{if(typeof e!=`object`||!e)throw TypeError(`The promise returned by the iterator.next() method must fulfill with an object`);e.done?readableStreamDefaultControllerClose(t[Q].controller):readableStreamDefaultControllerEnqueue(t[Q].controller,e.value)})}async function cancelAlgorithm(e){let t=n.iterator,r=t.return;if(r===void 0)return Promise.resolve();let i=r.call(t,e);return Promise.resolve(i).then(e=>{if(typeof e!=`object`||!e)throw TypeError(`The promise returned by the iterator.return() method must fulfill with an object`)})}return t=createReadableStream(r,pullAlgorithm,cancelAlgorithm,0),t}function readableStreamPipeTo(e,t,n,r,i,a){let o,s;try{o=new ReadableStreamDefaultReader(e),s=new WritableStreamDefaultWriter(t)}catch(e){return Promise.reject(e)}e[Q].disturbed=!0;let c=!1,{promise:l,resolve:u,reject:d}=Promise.withResolvers(),p={currentWrite:Promise.resolve()},m;function finalize(e,t){writableStreamDefaultWriterRelease(s),readableStreamReaderGenericRelease(o),a!==void 0&&m&&(a.removeEventListener(`abort`,m),m=void 0),e?d(t):u()}async function waitForCurrentWrite(){let e=p.currentWrite;await e,e!==p.currentWrite&&await waitForCurrentWrite()}function shutdownWithAnAction(e,n,r){if(c)return;if(c=!0,t[Q].state===`writable`&&!writableStreamCloseQueuedOrInFlight(t)){waitForCurrentWrite().then(complete,e=>finalize(!0,e));return}complete();function complete(){e().then(()=>finalize(!!n,r),e=>finalize(!0,e))}}function shutdown(e,n){if(!c){if(c=!0,t[Q].state===`writable`&&!writableStreamCloseQueuedOrInFlight(t)){waitForCurrentWrite().then(()=>finalize(!!e,n),e=>finalize(!0,e));return}finalize(!!e,n)}}function abortAlgorithm(){let n;n=a.reason&&a.reason.name===`AbortError`?createAbortError$1():a.reason;let o=[];r||o.push(()=>t[Q].state===`writable`?writableStreamAbort(t,n):Promise.resolve()),i||o.push(()=>e[Q].state===`readable`?readableStreamCancel(e,n):Promise.resolve()),shutdownWithAnAction(()=>Promise.all(o.map(e=>e())).then(()=>void 0),!0,n)}function watchErrored(e,t,n){e[Q].state===`errored`?n(e[Q].storedError):t.then(void 0,n)}function watchClosed(e,t,n){e[Q].state===`closed`?n():t.then(n,()=>{})}class PipeToReadRequest{[Qn](e){ge(()=>{p.currentWrite=writableStreamDefaultWriterWrite(s,e),setPromiseHandled(p.currentWrite),h.resolve(!1)})}[Zn](){h.resolve(!0)}[$n](e){h.reject(e)}}let h={resolve:null,reject:null};async function step(){if(c||t[Q].backpressure&&(await s[Q].ready.promise,c))return!0;let n=e[Q].controller;if(e[Q].state===`readable`&&or(n)&&n[Q].queue.length>0){for(;n[Q].queue.length>0;){if(c)return!0;let r=dequeueValue(n);if(n[Q].closeRequested&&!n[Q].queue.length&&(readableStreamDefaultControllerClearAlgorithms(n),readableStreamClose(e)),p.currentWrite=writableStreamDefaultWriterWrite(s,r),setPromiseHandled(p.currentWrite),t[Q].backpressure||t[Q].state!==`writable`||writableStreamCloseQueuedOrInFlight(t))break}return readableStreamDefaultControllerCallPullIfNeeded(n),e[Q].state===`closed`}let{promise:r,resolve:i,reject:a}=Promise.withResolvers();return h={resolve:i,reject:a},readableStreamDefaultReaderRead(o,new PipeToReadRequest),r}async function run(){for(;!await step(););}if(a!==void 0){if(a.aborted)return abortAlgorithm(),l;m=abortAlgorithm,a.addEventListener(`abort`,m,{once:!0})}if(setPromiseHandled(run()),watchErrored(e,o[Q].close.promise,e=>{if(!r)return shutdownWithAnAction(()=>writableStreamAbort(t,e),!0,e);shutdown(!0,e)}),watchErrored(t,s[Q].close.promise,t=>{if(!i)return shutdownWithAnAction(()=>readableStreamCancel(e,t),!0,t);shutdown(!0,t)}),watchClosed(e,o[Q].close.promise,()=>{if(!n)return shutdownWithAnAction(()=>writableStreamDefaultWriterCloseWithErrorPropagation(s));shutdown()}),writableStreamCloseQueuedOrInFlight(t)||t[Q].state===`closed`){let t=TypeError(`Destination WritableStream is closed`);i?shutdown(!0,t):shutdownWithAnAction(()=>readableStreamCancel(e,t),!0,t)}return l}function readableStreamDefaultTee(e,t){let n=new ReadableStreamDefaultReader(e),r=!1,i=!1,a=!1,o,s,c,l,u=Promise.withResolvers();async function pullAlgorithm(){r||(r=!0,readableStreamDefaultReaderRead(n,{[Qn](e){ge(()=>{r=!1;let n=e,o=e;if(!a&&t)try{o=structuredClone(o)}catch{}i||readableStreamDefaultControllerEnqueue(c[Q].controller,n),a||readableStreamDefaultControllerEnqueue(l[Q].controller,o)})},[Zn](){ge(()=>{r=!1,i||readableStreamDefaultControllerClose(c[Q].controller),a||readableStreamDefaultControllerClose(l[Q].controller),(!i||!a)&&u.resolve(void 0)})},[$n](){r=!1}}))}function cancel1Algorithm(t){if(i=!0,o=t,a){let t=[o,s];u.resolve(readableStreamCancel(e,t))}return u.promise}function cancel2Algorithm(t){if(a=!0,s=t,i){let t=[o,s];u.resolve(readableStreamCancel(e,t))}return u.promise}return c=createReadableStream(nonOpStart,pullAlgorithm,cancel1Algorithm),l=createReadableStream(nonOpStart,pullAlgorithm,cancel2Algorithm),n[Q].close.promise.then(void 0,e=>{readableStreamDefaultControllerError(c[Q].controller,e),readableStreamDefaultControllerError(l[Q].controller,e),(!i||!a)&&u.resolve(void 0)}),[c,l]}var BYOBReadIntoRequest=class{[Q];constructor(){this[Q]=Promise.withResolvers()}[Qn](e){this[Q].resolve?.({value:e,done:!1})}[Zn](e){this[Q].resolve?.({value:e,done:!0})}[$n](e){this[Q].reject?.(e)}get promise(){return this[Q].promise}},ReadableStreamBYOBReader=class{[$]=`ReadableStreamBYOBReader`;[Q];constructor(e){if(!ar(e))throw TypeError(`Expected a ReadableStream`);this[Q]={readRequests:[],readIntoRequests:[],stream:void 0,close:{promise:void 0,resolve:void 0,reject:void 0}},setupReadableStreamBYOBReader(this,e)}read(e,t={}){if(!lr(this))return Promise.reject(TypeError(`Invalid this`));if(typeof e!=`object`||!e||!ArrayBuffer.isView(e))return Promise.reject(TypeError(`view must be an ArrayBufferView`));let n=e.buffer,r=e.byteLength;if(r===0)return Promise.reject(TypeError(`view must have non-zero byteLength`));if(n.byteLength===0)return isDetachedBuffer(n)?Promise.reject(TypeError(`view's buffer has been detached`)):Promise.reject(TypeError(`view's buffer must have non-zero byteLength`));let i=t?.min??1;if(typeof i!=`number`||i<1||!Number.isInteger(i)||Number.isNaN(i))return Promise.reject(TypeError(`options.min must be a positive integer`));let a=e[Symbol.toStringTag];if(a!==void 0&&a!==`DataView`){if(i>e.length)return Promise.reject(RangeError(`options.min must be smaller or equal to view size`))}else if(i>r)return Promise.reject(RangeError(`options.min must be smaller or equal to view size`));if(this[Q].stream===void 0)return Promise.reject(TypeError(`Reader has no associated stream`));let o=new BYOBReadIntoRequest;return readableStreamBYOBReaderRead(this,e,i,o),o.promise}releaseLock(){if(!lr(this))throw TypeError(`Invalid this`);this[Q].stream!==void 0&&readableStreamBYOBReaderRelease(this)}get closed(){return lr(this)?this[Q].close.promise:Promise.reject(TypeError(`Invalid this`))}cancel(e=void 0){return lr(this)?this[Q].stream===void 0?Promise.reject(TypeError(`Reader has no associated stream`)):readableStreamReaderGenericCancel(this,e):Promise.reject(TypeError(`Invalid this`))}get[Symbol.toStringTag](){return`ReadableStreamBYOBReader`}},ReadableStreamBYOBRequest=class{[$]=`ReadableStreamBYOBRequest`;[Q];constructor(e){if(e!==nr)throw TypeError(`Illegal constructor`)}get view(){if(!ur(this))throw TypeError(`Invalid this`);return this[Q].view}respond(e){if(!ur(this))throw TypeError(`Invalid this`);if(this[Q].controller===void 0)throw TypeError(`BYOB request has been invalidated`);if(e=+e,!Number.isInteger(e)||e<0||!Number.isFinite(e))throw RangeError(`bytesWritten must be a non-negative integer`);let t=this[Q].view;if(isDetachedBuffer(t.buffer))throw TypeError(`The BYOB request's buffer has been detached`);readableByteStreamControllerRespond(this[Q].controller,e)}respondWithNewView(e){if(!ur(this))throw TypeError(`Invalid this`);if(this[Q].controller===void 0)throw TypeError(`BYOB request has been invalidated`);if(typeof e!=`object`||!e||!ArrayBuffer.isView(e))throw TypeError(`view must be an ArrayBufferView`);if(isDetachedBuffer(e.buffer))throw TypeError(`The given view's buffer has been detached`);readableByteStreamControllerRespondWithNewView(this[Q].controller,e)}get[Symbol.toStringTag](){return`ReadableStreamBYOBRequest`}},ReadableByteStreamController=class{[$]=`ReadableByteStreamController`;[Q];constructor(e){if(e!==nr)throw TypeError(`Illegal constructor`)}get byobRequest(){if(!cr(this))throw TypeError(`Invalid this`);return readableByteStreamControllerGetBYOBRequest(this)}get desiredSize(){if(!cr(this))throw TypeError(`Invalid this`);return readableByteStreamControllerGetDesiredSize(this)}close(){if(!cr(this))throw TypeError(`Invalid this`);if(this[Q].closeRequested)throw TypeError(`Close already requested`);if(this[Q].stream[Q].state!==`readable`)throw TypeError(`Stream is not in a readable state`);readableByteStreamControllerClose(this)}enqueue(e){if(!cr(this))throw TypeError(`Invalid this`);if(typeof e!=`object`||!e||!ArrayBuffer.isView(e))throw TypeError(`chunk must be an ArrayBufferView`);if(e.byteLength===0)throw TypeError(`chunk length must be non-zero`);if(e.buffer.byteLength===0)throw TypeError(`chunk's buffer length must be non-zero`);if(this[Q].closeRequested)throw TypeError(`Cannot enqueue after close has been requested`);if(this[Q].stream[Q].state!==`readable`)throw TypeError(`Stream is not in a readable state`);readableByteStreamControllerEnqueue(this,e)}error(e=void 0){if(!cr(this))throw TypeError(`Invalid this`);readableByteStreamControllerError(this,e)}[Xn](e){return readableByteStreamControllerCancelSteps(this,e)}[er](e){readableByteStreamControllerPullSteps(this,e)}[tr](){if(this[Q].pendingPullIntos.length>0){let e=this[Q].pendingPullIntos[0];e.readerType=`none`,this[Q].pendingPullIntos=[e]}}get[Symbol.toStringTag](){return`ReadableByteStreamController`}};const cr=isBrandCheck(`ReadableByteStreamController`),lr=isBrandCheck(`ReadableStreamBYOBReader`),ur=isBrandCheck(`ReadableStreamBYOBRequest`);function readableStreamHasBYOBReader(e){let{reader:t}=e[Q];return t===void 0?!1:t[Q]!==void 0&&t[$]===`ReadableStreamBYOBReader`}function readableStreamGetNumReadIntoRequests(e){return e[Q].reader[Q].readIntoRequests.length}function readableStreamAddReadIntoRequest(e,t){e[Q].reader[Q].readIntoRequests.push(t)}function readableStreamFulfillReadIntoRequest(e,t,n){let{reader:r}=e[Q],i=r[Q].readIntoRequests.shift();n?i[Zn](t):i[Qn](t)}function setupReadableStreamBYOBReader(e,t){if(isReadableStreamLocked(t))throw TypeError(`ReadableStream is locked`);if(!cr(t[Q].controller))throw TypeError(`Cannot use a BYOB reader with a non-byte stream`);readableStreamReaderGenericInitialize(e,t),e[Q].readIntoRequests=[]}function readableStreamBYOBReaderRead(e,t,n,r){let{stream:i}=e[Q];i[Q].disturbed=!0,i[Q].state===`errored`?r[$n](i[Q].storedError):readableByteStreamControllerPullInto(i[Q].controller,t,n,r)}function readableStreamBYOBReaderRelease(e){readableStreamReaderGenericRelease(e);let t=TypeError(`Reader was released`);for(let n=0;n<e[Q].readIntoRequests.length;n++)e[Q].readIntoRequests[n][$n](t);e[Q].readIntoRequests=[]}function readableByteStreamControllerClearAlgorithms(e){e[Q].pullAlgorithm=void 0,e[Q].cancelAlgorithm=void 0}function readableByteStreamControllerClearPendingPullIntos(e){readableByteStreamControllerInvalidateBYOBRequest(e),e[Q].pendingPullIntos=[]}function readableByteStreamControllerInvalidateBYOBRequest(e){let t=e[Q].byobRequest;t!=null&&(t[Q].controller=void 0,t[Q].view=null,e[Q].byobRequest=null)}function readableByteStreamControllerError(e,t){let{stream:n}=e[Q];n[Q].state===`readable`&&(readableByteStreamControllerClearPendingPullIntos(e),resetQueue(e),readableByteStreamControllerClearAlgorithms(e),readableStreamError(n,t))}function readableByteStreamControllerGetDesiredSize(e){let t=e[Q].stream[Q].state;return t===`errored`?null:t===`closed`?0:e[Q].highWaterMark-e[Q].queueTotalSize}function readableByteStreamControllerShouldCallPull(e){let{stream:t}=e[Q];if(t[Q].state!==`readable`||e[Q].closeRequested||!e[Q].started)return!1;if(readableStreamHasDefaultReader(t)&&readableStreamGetNumReadRequests(t)>0||readableStreamHasBYOBReader(t)&&readableStreamGetNumReadIntoRequests(t)>0)return!0;let n=readableByteStreamControllerGetDesiredSize(e);return n!==null&&n>0}function readableByteStreamControllerCallPullIfNeeded(e){if(readableByteStreamControllerShouldCallPull(e)){if(e[Q].pulling){e[Q].pullAgain=!0;return}e[Q].pulling=!0,e[Q].pullAlgorithm(e).then(()=>{e[Q].pulling=!1,e[Q].pullAgain&&(e[Q].pullAgain=!1,readableByteStreamControllerCallPullIfNeeded(e))},t=>readableByteStreamControllerError(e,t))}}function readableByteStreamControllerHandleQueueDrain(e){e[Q].queueTotalSize===0&&e[Q].closeRequested?(readableByteStreamControllerClearAlgorithms(e),readableStreamClose(e[Q].stream)):readableByteStreamControllerCallPullIfNeeded(e)}function readableByteStreamControllerEnqueueChunkToQueue(e,t,n,r){e[Q].queue.push({buffer:t,byteOffset:n,byteLength:r}),e[Q].queueTotalSize+=r}function readableByteStreamControllerEnqueueClonedChunkToQueue(e,t,n,r){let i;try{i=t.slice(n,n+r)}catch(t){readableByteStreamControllerError(e,t);return}readableByteStreamControllerEnqueueChunkToQueue(e,i,0,r)}function readableByteStreamControllerEnqueueDetachedPullIntoToQueue(e,t){t.bytesFilled>0&&readableByteStreamControllerEnqueueClonedChunkToQueue(e,t.buffer,t.byteOffset,t.bytesFilled),readableByteStreamControllerShiftPendingPullInto(e)}function readableByteStreamControllerShiftPendingPullInto(e){return e[Q].pendingPullIntos.shift()}function readableByteStreamControllerFillHeadPullIntoDescriptor(e,t,n){n.bytesFilled+=t}function readableByteStreamControllerConvertPullIntoDescriptor(e){let t=e.bytesFilled,n=e.elementSize,r=transferArrayBuffer(e.buffer);return e.buffer=r,new e.viewConstructor(r,e.byteOffset,t/n)}function readableByteStreamControllerCommitPullIntoDescriptor(e,t){let n=!1;e[Q].state===`closed`&&(n=!0);let r=readableByteStreamControllerConvertPullIntoDescriptor(t);t.readerType===`default`?readableStreamFulfillReadRequest(e,r,n):readableStreamFulfillReadIntoRequest(e,r,n)}function readableByteStreamControllerFillPullIntoDescriptorFromQueue(e,t){let n=Math.min(e[Q].queueTotalSize,t.byteLength-t.bytesFilled),r=t.bytesFilled+n,i=n,a=!1,o=r-r%t.elementSize;o>=t.minimumFill&&(i=o-t.bytesFilled,a=!0);let s=e[Q].queue;for(;i>0;){let n=s[0],r=Math.min(i,n.byteLength),a=t.byteOffset+t.bytesFilled,o=new Uint8Array(t.buffer,a,r),c=new Uint8Array(n.buffer,n.byteOffset,r);o.set(c),n.byteLength===r?s.shift():(n.byteOffset+=r,n.byteLength-=r),e[Q].queueTotalSize-=r,readableByteStreamControllerFillHeadPullIntoDescriptor(e,r,t),i-=r}return a}function readableByteStreamControllerFillReadRequestFromQueue(e,t){let n=e[Q].queue.shift();e[Q].queueTotalSize-=n.byteLength,readableByteStreamControllerHandleQueueDrain(e);let r=new Uint8Array(n.buffer,n.byteOffset,n.byteLength);t[Qn](r)}function readableByteStreamControllerProcessReadRequestsUsingQueue(e){let t=e[Q].stream[Q].reader;for(;t[Q].readRequests.length!==0;){if(e[Q].queueTotalSize===0)return;readableByteStreamControllerFillReadRequestFromQueue(e,t[Q].readRequests.shift())}}function readableByteStreamControllerProcessPullIntoDescriptorsUsingQueue(e){for(;e[Q].pendingPullIntos.length!==0;){if(e[Q].queueTotalSize===0)return;let t=e[Q].pendingPullIntos[0];readableByteStreamControllerFillPullIntoDescriptorFromQueue(e,t)&&(readableByteStreamControllerShiftPendingPullInto(e),readableByteStreamControllerCommitPullIntoDescriptor(e[Q].stream,t))}}function readableByteStreamControllerGetBYOBRequest(e){if(e[Q].byobRequest===null&&e[Q].pendingPullIntos.length!==0){let t=e[Q].pendingPullIntos[0],n=new Uint8Array(t.buffer,t.byteOffset+t.bytesFilled,t.byteLength-t.bytesFilled),r=new ReadableStreamBYOBRequest(nr);r[Q]={controller:e,view:n},e[Q].byobRequest=r}return e[Q].byobRequest}function readableByteStreamControllerEnqueue(e,t){let{stream:n}=e[Q];if(e[Q].closeRequested||n[Q].state!==`readable`)return;let r=t.buffer,i=t.byteLength,a=t.byteOffset;if(isDetachedBuffer(r))throw TypeError(`chunk's buffer is detached`);let o=transferArrayBuffer(r);if(e[Q].pendingPullIntos.length!==0){let t=e[Q].pendingPullIntos[0];if(isDetachedBuffer(t.buffer))throw TypeError(`BYOB request's buffer has been detached`);readableByteStreamControllerInvalidateBYOBRequest(e),t.buffer=transferArrayBuffer(t.buffer),t.readerType===`none`&&readableByteStreamControllerEnqueueDetachedPullIntoToQueue(e,t)}readableStreamHasDefaultReader(n)?(readableByteStreamControllerProcessReadRequestsUsingQueue(e),readableStreamGetNumReadRequests(n)===0?readableByteStreamControllerEnqueueChunkToQueue(e,o,a,i):(e[Q].pendingPullIntos.length!==0&&readableByteStreamControllerShiftPendingPullInto(e),readableStreamFulfillReadRequest(n,new Uint8Array(o,a,i),!1))):readableStreamHasBYOBReader(n)?(readableByteStreamControllerEnqueueChunkToQueue(e,o,a,i),readableByteStreamControllerProcessPullIntoDescriptorsUsingQueue(e)):readableByteStreamControllerEnqueueChunkToQueue(e,o,a,i),readableByteStreamControllerCallPullIfNeeded(e)}function readableByteStreamControllerClose(e){let{stream:t}=e[Q];if(!(e[Q].closeRequested||t[Q].state!==`readable`)){if(e[Q].queueTotalSize>0){e[Q].closeRequested=!0;return}if(e[Q].pendingPullIntos.length!==0){let t=e[Q].pendingPullIntos[0];if(t.bytesFilled%t.elementSize!==0){let t=TypeError(`Insufficient bytes to fill elements in the given buffer`);throw readableByteStreamControllerError(e,t),t}}readableByteStreamControllerClearAlgorithms(e),readableStreamClose(t)}}function readableByteStreamControllerPullInto(e,t,n,r){let i=e[Q].stream,a=t[Symbol.toStringTag],o,s;if(a===void 0||a===`DataView`)o=DataView,s=1;else{let e=typedArrayConstructorByTag(a);if(!e){r[$n](TypeError(`Unsupported typed array: ${a}`));return}o=e,s=elementSizeByTag(a)}let c=t.buffer,l=t.byteLength,u=t.byteOffset,d=n*s,p;try{p=transferArrayBuffer(c)}catch(e){r[$n](e);return}let m={buffer:p,bufferByteLength:p.byteLength,byteOffset:u,byteLength:l,bytesFilled:0,minimumFill:d,elementSize:s,viewConstructor:o,readerType:`byob`};if(e[Q].pendingPullIntos.length!==0){e[Q].pendingPullIntos.push(m),readableStreamAddReadIntoRequest(i,r);return}if(i[Q].state===`closed`){let e=new o(m.buffer,m.byteOffset,0);r[Zn](e);return}if(e[Q].queueTotalSize>0){if(readableByteStreamControllerFillPullIntoDescriptorFromQueue(e,m)){let t=readableByteStreamControllerConvertPullIntoDescriptor(m);readableByteStreamControllerHandleQueueDrain(e),r[Qn](t);return}if(e[Q].closeRequested){let t=TypeError(`Insufficient bytes to fill elements in the given buffer`);readableByteStreamControllerError(e,t),r[$n](t);return}}e[Q].pendingPullIntos.push(m),readableStreamAddReadIntoRequest(i,r),readableByteStreamControllerCallPullIfNeeded(e)}function readableByteStreamControllerRespond(e,t){let n=e[Q].pendingPullIntos[0];if(e[Q].stream[Q].state===`closed`){if(t!==0)throw TypeError(`bytesWritten must be 0 when calling respond() on a closed stream`)}else{if(t===0)throw TypeError(`bytesWritten must be greater than 0 when calling respond() on a readable stream`);if(n.bytesFilled+t>n.byteLength)throw RangeError(`bytesWritten out of range`)}n.buffer=transferArrayBuffer(n.buffer),readableByteStreamControllerRespondInternal(e,t)}function readableByteStreamControllerRespondWithNewView(e,t){let n=e[Q].pendingPullIntos[0],r=e[Q].stream[Q].state,i=t.byteLength,a=t.byteOffset,o=t.buffer;if(r===`closed`){if(i!==0)throw TypeError(`view's length must be 0 when calling respondWithNewView() on a closed stream`)}else if(i===0)throw TypeError(`view's length must be greater than 0 when calling respondWithNewView() on a readable stream`);if(n.byteOffset+n.bytesFilled!==a)throw RangeError(`The region specified by view does not match byobRequest`);if(n.bufferByteLength!==o.byteLength)throw RangeError(`The buffer of view has different capacity than byobRequest`);if(n.bytesFilled+i>n.byteLength)throw RangeError(`The region specified by view is larger than byobRequest`);n.buffer=transferArrayBuffer(o),readableByteStreamControllerRespondInternal(e,i)}function readableByteStreamControllerRespondInternal(e,t){let n=e[Q].pendingPullIntos[0];readableByteStreamControllerInvalidateBYOBRequest(e),e[Q].stream[Q].state===`closed`?readableByteStreamControllerRespondInClosedState(e,n):readableByteStreamControllerRespondInReadableState(e,t,n),readableByteStreamControllerCallPullIfNeeded(e)}function readableByteStreamControllerRespondInClosedState(e,t){t.readerType===`none`&&readableByteStreamControllerShiftPendingPullInto(e);let n=e[Q].stream;if(readableStreamHasBYOBReader(n))for(;readableStreamGetNumReadIntoRequests(n)>0;)readableByteStreamControllerCommitPullIntoDescriptor(n,readableByteStreamControllerShiftPendingPullInto(e))}function readableByteStreamControllerRespondInReadableState(e,t,n){if(readableByteStreamControllerFillHeadPullIntoDescriptor(e,t,n),n.readerType===`none`){readableByteStreamControllerEnqueueDetachedPullIntoToQueue(e,n),readableByteStreamControllerProcessPullIntoDescriptorsUsingQueue(e);return}if(n.bytesFilled<n.minimumFill)return;readableByteStreamControllerShiftPendingPullInto(e);let r=n.bytesFilled%n.elementSize;if(r>0){let t=n.byteOffset+n.bytesFilled;readableByteStreamControllerEnqueueClonedChunkToQueue(e,n.buffer,t-r,r)}n.bytesFilled-=r,readableByteStreamControllerCommitPullIntoDescriptor(e[Q].stream,n),readableByteStreamControllerProcessPullIntoDescriptorsUsingQueue(e)}function readableByteStreamControllerCancelSteps(e,t){readableByteStreamControllerClearPendingPullIntos(e),resetQueue(e);let n=e[Q].cancelAlgorithm?.(t)??Promise.resolve();return readableByteStreamControllerClearAlgorithms(e),n}function readableByteStreamControllerPullSteps(e,t){let n=e[Q].stream;if(e[Q].queueTotalSize>0){readableByteStreamControllerFillReadRequestFromQueue(e,t);return}let r=e[Q].autoAllocateChunkSize;if(r!==void 0){let n;try{n=new ArrayBuffer(r)}catch(e){t[$n](e);return}let i={buffer:n,bufferByteLength:r,byteOffset:0,byteLength:r,bytesFilled:0,minimumFill:1,elementSize:1,viewConstructor:Uint8Array,readerType:`default`};e[Q].pendingPullIntos.push(i)}readableStreamAddReadRequest(n,t),readableByteStreamControllerCallPullIfNeeded(e)}function setupReadableByteStreamController(e,t,n,r,i,a,o){t[Q]={cancelAlgorithm:i,closeRequested:!1,highWaterMark:a,pullAgain:!1,pullAlgorithm:r,pulling:!1,queue:[],queueTotalSize:0,started:!1,stream:e,byobRequest:null,pendingPullIntos:[],autoAllocateChunkSize:o},e[Q].controller=t;let s=n();new Promise(e=>e(s)).then(()=>{t[Q].started=!0,readableByteStreamControllerCallPullIfNeeded(t)},e=>readableByteStreamControllerError(t,e))}function setupReadableByteStreamControllerFromSource(e,t,n){let r=new ReadableByteStreamController(nr),i=t?.start,a=t?.pull,o=t?.cancel,s=t?.autoAllocateChunkSize;if(s!==void 0&&(s===0||!Number.isInteger(s)||s<0))throw TypeError(`autoAllocateChunkSize must be a positive integer`);setupReadableByteStreamController(e,r,i?i.bind(t,r):nonOpStart,a?createPromiseCallback(`source.pull`,a,t):nonOpPull,o?createPromiseCallback(`source.cancel`,o,t):nonOpCancel,n,s)}function readableByteStreamTee(e){let t=new ReadableStreamDefaultReader(e),n=!1,r=!1,i=!1,a,o,s=Promise.withResolvers(),c,l,u,d;function pullAlgorithm(){return n?Promise.resolve():(n=!0,t.read().then(e=>{if(n=!1,e.done){r||u.close(),i||d.close();return}let t=e.value,a=new Uint8Array(t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength));r||u.enqueue(a),i||d.enqueue(new Uint8Array(a))},()=>{}),Promise.resolve())}return c=new ReadableStream$1({type:`bytes`,pull:pullAlgorithm,cancel(t){if(r=!0,a=t,i){let t=readableStreamCancel(e,[a,o]);return s.resolve(),t}return s.promise}}),l=new ReadableStream$1({type:`bytes`,pull:pullAlgorithm,cancel(t){if(i=!0,o=t,r){let t=readableStreamCancel(e,[a,o]);return s.resolve(),t}return s.promise}}),u=c[Q].controller,d=l[Q].controller,t.closed.catch(e=>{u.error(e),d.error(e),(!r||!i)&&s.resolve()}),[c,l]}const dr=Symbol(`kSkipThrow`);var TransformStream=class{[$]=`TransformStream`;[Q];constructor(e={},t={},n={}){if(e!=null&&typeof e!=`object`)throw TypeError(`transformer must be an object`);if(t!=null&&typeof t!=`object`)throw TypeError(`writableStrategy must be an object`);if(n!=null&&typeof n!=`object`)throw TypeError(`readableStrategy must be an object`);let r=e?.readableType,i=e?.writableType,a=e?.start;if(r!==void 0)throw RangeError(`Invalid readableType: ${r}`);if(i!==void 0)throw RangeError(`Invalid writableType: ${i}`);let o=extractHighWaterMark(n?.highWaterMark,0),s=extractSizeAlgorithm(n?.size),c=extractHighWaterMark(t?.highWaterMark,1),l=extractSizeAlgorithm(t?.size),u=Promise.withResolvers();initializeTransformStream(this,u,c,l,o,s),setupTransformStreamDefaultControllerFromTransformer(this,e),a===void 0?u.resolve():u.resolve(a.call(e,this[Q].controller))}get readable(){if(!fr(this))throw TypeError(`Invalid this`);return this[Q].readable}get writable(){if(!fr(this))throw TypeError(`Invalid this`);return this[Q].writable}get[Symbol.toStringTag](){return`TransformStream`}},TransformStreamDefaultController=class{[$]=`TransformStreamDefaultController`;[Q];constructor(e){if(e!==dr)throw TypeError(`Illegal constructor`)}get desiredSize(){if(!pr(this))throw TypeError(`Invalid this`);let{stream:e}=this[Q],{readable:t}=e[Q],n=t[Q].controller;return readableStreamDefaultControllerGetDesiredSize(n)}enqueue(e){if(!pr(this))throw TypeError(`Invalid this`);transformStreamDefaultControllerEnqueue(this,e)}error(e){if(!pr(this))throw TypeError(`Invalid this`);transformStreamDefaultControllerError(this,e)}terminate(){if(!pr(this))throw TypeError(`Invalid this`);transformStreamDefaultControllerTerminate(this)}get[Symbol.toStringTag](){return`TransformStreamDefaultController`}};const fr=isBrandCheck(`TransformStream`),pr=isBrandCheck(`TransformStreamDefaultController`);async function defaultTransformAlgorithm(e,t){transformStreamDefaultControllerEnqueue(t,e)}function initializeTransformStream(e,t,n,r,i,a){let startAlgorithm=()=>t.promise,o=createWritableStream(startAlgorithm,t=>transformStreamDefaultSinkWriteAlgorithm(e,t),()=>transformStreamDefaultSinkCloseAlgorithm(e),t=>transformStreamDefaultSinkAbortAlgorithm(e,t),n,r);e[Q]={readable:createReadableStream(startAlgorithm,()=>transformStreamDefaultSourcePullAlgorithm(e),t=>transformStreamDefaultSourceCancelAlgorithm(e,t),i,a),writable:o,controller:void 0,backpressure:void 0,backpressureChange:{promise:void 0,resolve:void 0,reject:void 0}},transformStreamSetBackpressure(e,!0)}function transformStreamError(e,t){let{readable:n}=e[Q];readableStreamDefaultControllerError(n[Q].controller,t),transformStreamErrorWritableAndUnblockWrite(e,t)}function transformStreamErrorWritableAndUnblockWrite(e,t){let{controller:n,writable:r}=e[Q];transformStreamDefaultControllerClearAlgorithms(n),writableStreamDefaultControllerErrorIfNeeded(r[Q].controller,t),transformStreamUnblockWrite(e)}function transformStreamUnblockWrite(e){e[Q].backpressure&&transformStreamSetBackpressure(e,!1)}function transformStreamSetBackpressure(e,t){e[Q].backpressureChange.promise!==void 0&&e[Q].backpressureChange.resolve?.(),e[Q].backpressureChange=Promise.withResolvers(),e[Q].backpressure=t}function setupTransformStreamDefaultController(e,t,n,r,i){t[Q]={stream:e,transformAlgorithm:n,flushAlgorithm:r,cancelAlgorithm:i,finishPromise:void 0},e[Q].controller=t}function setupTransformStreamDefaultControllerFromTransformer(e,t){let n=new TransformStreamDefaultController(dr),r=t?.transform,i=t?.flush,a=t?.cancel;setupTransformStreamDefaultController(e,n,r?createPromiseCallback(`transformer.transform`,r,t):defaultTransformAlgorithm,i?createPromiseCallback(`transformer.flush`,i,t):nonOpFlush,a?createPromiseCallback(`transformer.cancel`,a,t):nonOpCancel)}function transformStreamDefaultControllerClearAlgorithms(e){e[Q].transformAlgorithm=void 0,e[Q].flushAlgorithm=void 0,e[Q].cancelAlgorithm=void 0}function transformStreamDefaultControllerEnqueue(e,t){let{stream:n}=e[Q],{readable:r}=n[Q],i=r[Q].controller;if(!readableStreamDefaultControllerCanCloseOrEnqueue(i))throw TypeError(`Unable to enqueue`);try{readableStreamDefaultControllerEnqueue(i,t)}catch(e){throw transformStreamErrorWritableAndUnblockWrite(n,e),r[Q].storedError}readableStreamDefaultControllerHasBackpressure(i)!==n[Q].backpressure&&transformStreamSetBackpressure(n,!0)}function transformStreamDefaultControllerError(e,t){transformStreamError(e[Q].stream,t)}async function transformStreamDefaultControllerPerformTransform(e,t){try{let n=e[Q].transformAlgorithm;if(n===void 0)return;await n(t,e)}catch(t){throw transformStreamError(e[Q].stream,t),t}}function transformStreamDefaultControllerTerminate(e){let{stream:t}=e[Q],{readable:n}=t[Q];readableStreamDefaultControllerClose(n[Q].controller),transformStreamErrorWritableAndUnblockWrite(t,TypeError(`TransformStream has been terminated`))}function transformStreamDefaultSinkWriteAlgorithm(e,t){let{controller:n}=e[Q];return e[Q].backpressure?e[Q].backpressureChange.promise.then(()=>{let{writable:r}=e[Q];if(r[Q].state===`erroring`)throw r[Q].storedError;return transformStreamDefaultControllerPerformTransform(n,t)}):transformStreamDefaultControllerPerformTransform(n,t)}async function transformStreamDefaultSinkAbortAlgorithm(e,t){let{controller:n,readable:r}=e[Q];if(n[Q].finishPromise!==void 0)return n[Q].finishPromise;let{promise:i,resolve:a,reject:o}=Promise.withResolvers();n[Q].finishPromise=i;let s=n[Q].cancelAlgorithm(t);return transformStreamDefaultControllerClearAlgorithms(n),s.then(()=>{r[Q].state===`errored`?o(r[Q].storedError):(readableStreamDefaultControllerError(r[Q].controller,t),a())},e=>{readableStreamDefaultControllerError(r[Q].controller,e),o(e)}),n[Q].finishPromise}function transformStreamDefaultSinkCloseAlgorithm(e){let{readable:t,controller:n}=e[Q];if(n[Q].finishPromise!==void 0)return n[Q].finishPromise;let{promise:r,resolve:i,reject:a}=Promise.withResolvers();n[Q].finishPromise=r;let o=n[Q].flushAlgorithm(n);return transformStreamDefaultControllerClearAlgorithms(n),o.then(()=>{t[Q].state===`errored`?a(t[Q].storedError):(readableStreamDefaultControllerClose(t[Q].controller),i())},e=>{readableStreamDefaultControllerError(t[Q].controller,e),a(e)}),n[Q].finishPromise}function transformStreamDefaultSourcePullAlgorithm(e){return transformStreamSetBackpressure(e,!1),e[Q].backpressureChange.promise}function transformStreamDefaultSourceCancelAlgorithm(e,t){let{controller:n,writable:r}=e[Q];if(n[Q].finishPromise!==void 0)return n[Q].finishPromise;let{promise:i,resolve:a,reject:o}=Promise.withResolvers();n[Q].finishPromise=i;let s=n[Q].cancelAlgorithm(t);return transformStreamDefaultControllerClearAlgorithms(n),s.then(()=>{r[Q].state===`errored`?o(r[Q].storedError):(writableStreamDefaultControllerErrorIfNeeded(r[Q].controller,t),transformStreamUnblockWrite(e),a())},t=>{writableStreamDefaultControllerErrorIfNeeded(r[Q].controller,t),transformStreamUnblockWrite(e),o(t)}),n[Q].finishPromise}const mr=Object.defineProperty(e=>e.byteLength,`name`,{value:`size`}),hr=Object.defineProperty(()=>1,`name`,{value:`size`});var ByteLengthQueuingStrategy=class{#e;constructor(e){if(typeof e!=`object`||!e)throw TypeError(`init must be an object`);if(e.highWaterMark===void 0)throw TypeError(`init.highWaterMark is required`);this.#e=+e.highWaterMark}get highWaterMark(){return this.#e}get size(){return mr}get[Symbol.toStringTag](){return`ByteLengthQueuingStrategy`}},CountQueuingStrategy=class{#e;constructor(e){if(typeof e!=`object`||!e)throw TypeError(`init must be an object`);if(e.highWaterMark===void 0)throw TypeError(`init.highWaterMark is required`);this.#e=+e.highWaterMark}get highWaterMark(){return this.#e}get size(){return hr}get[Symbol.toStringTag](){return`CountQueuingStrategy`}},TextEncoderStream=class{#e=null;#t=new TextEncoder;#n;constructor(){this.#n=new TransformStream({transform:(e,t)=>{if(e=String(e),e===``)return;this.#e!==null&&(e=this.#e+e);let n=e.charCodeAt(e.length-1);55296<=n&&n<=56319?(this.#e=e.slice(-1),e=e.slice(0,-1)):this.#e=null,e&&t.enqueue(this.#t.encode(e))},flush:e=>{this.#e!==null&&e.enqueue(new Uint8Array([239,191,189]))}})}get encoding(){return`utf-8`}get readable(){return this.#n.readable}get writable(){return this.#n.writable}};function hasStreamingSupport(){try{return new TextDecoder().decode(new Uint8Array([195]),{stream:!0}),!0}catch{return!1}}const gr=hasStreamingSupport();function incompleteUtf8Tail$1(e){let t=e.length;if(t===0)return 0;for(let n=1;n<=Math.min(3,t);n++){let r=e[t-n];if(!(r&128))return 0;if((r&192)!=128){let e;if((r&224)==192)e=2;else if((r&240)==224)e=3;else if((r&248)==240)e=4;else return 0;return n<e?n:0}}return 0}__name(incompleteUtf8Tail$1,`incompleteUtf8Tail`);var TextDecoderStream=class{#e;#t;constructor(e,t){if(this.#e=new TextDecoder(e,t),gr)this.#t=new TransformStream({transform:(e,t)=>{let n=toUint8Array$3(e),r=this.#e.decode(n,{stream:!0});r&&t.enqueue(r)},flush:e=>{let t=this.#e.decode();t&&e.enqueue(t)},cancel:()=>{this.#e.decode()}});else{let e=new Uint8Array;this.#t=new TransformStream({transform:(t,n)=>{let r=toUint8Array$3(t),i;e.length>0?(i=new Uint8Array(e.length+r.length),i.set(e,0),i.set(r,e.length)):i=r;let a=incompleteUtf8Tail$1(i),o;if(a>0?(o=i.slice(0,i.length-a),e=i.slice(i.length-a)):(o=i,e=new Uint8Array),o.length>0){let e=this.#e.decode(o);e&&n.enqueue(e)}},flush:t=>{if(e.length>0){let n=this.#e.decode(e);n&&t.enqueue(n),e=new Uint8Array}},cancel:()=>{e=new Uint8Array}})}}get encoding(){return this.#e.encoding}get fatal(){return this.#e.fatal}get ignoreBOM(){return this.#e.ignoreBOM}get readable(){return this.#t.readable}get writable(){return this.#t.writable}};function toUint8Array$3(e){if(e instanceof Uint8Array)return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw TypeError(`chunk must be a BufferSource`)}__name(toUint8Array$3,`toUint8Array`);function isNativeStreamUsable$3(e,t){try{return typeof e==`function`?typeof e.prototype?.[t]==`function`:!1}catch{return!1}}__name(isNativeStreamUsable$3,`isNativeStreamUsable`);const _r=isNativeStreamUsable$3(globalThis.ReadableStream,`getReader`)?globalThis.ReadableStream:ReadableStream$1,vr=isNativeStreamUsable$3(globalThis.WritableStream,`getWriter`)?globalThis.WritableStream:WritableStream,yr=isNativeStreamUsable$3(globalThis.TransformStream,`readable`)?globalThis.TransformStream:TransformStream,br=typeof globalThis.ByteLengthQueuingStrategy==`function`?globalThis.ByteLengthQueuingStrategy:ByteLengthQueuingStrategy,xr=typeof globalThis.CountQueuingStrategy==`function`?globalThis.CountQueuingStrategy:CountQueuingStrategy,Sr=typeof globalThis.TextEncoderStream==`function`?globalThis.TextEncoderStream:TextEncoderStream,Cr=typeof globalThis.TextDecoderStream==`function`?globalThis.TextDecoderStream:TextDecoderStream;var wr=__esmMin(()=>{L()});function _setPipeImpl(e){Tr=e}var Tr,Stream_,Er=__esmMin(()=>{yn(),Stream_=class extends Y{constructor(e){super(e)}pipe(e,t){return Tr(this,e,t)}}});function finished(e,t,n){let r;r=typeof t==`function`?t:n;let i=!1;function done(e){i||(i=!0,r(e))}let onFinish=()=>done(),onEnd=()=>done(),onError=e=>done(e),onClose=()=>{let t=e,n=e;!t.writableFinished&&!n.readableEnded&&done(Error(`premature close`))};e.on(`finish`,onFinish),e.on(`end`,onEnd),e.on(`error`,onError),e.on(`close`,onClose);let a=e,o=typeof e.write==`function`,s=typeof e.read==`function`,c=a.writableFinished===!0,l=a.readableEnded===!0;if(a.destroyed===!0){let e=a._err;ge(e?()=>done(e):o&&c||s&&l?()=>done():()=>done(Error(`premature close`)))}else (o&&!s&&c||!o&&s&&l||o&&s&&c&&l)&&ge(()=>done());return function cleanup(){e.removeListener(`finish`,onFinish),e.removeListener(`end`,onEnd),e.removeListener(`error`,onError),e.removeListener(`close`,onClose)}}function addAbortSignal(e,t){if(!(e instanceof AbortSignal))throw TypeError(`The first argument must be an AbortSignal`);if(!(t instanceof Stream_))throw TypeError(`The second argument must be a Stream`);let n=t;if(e.aborted)n.destroy(Error(`The operation was aborted`));else{let onAbort=()=>{n.destroy(Error(`The operation was aborted`))};e.addEventListener(`abort`,onAbort,{once:!0}),t.once(`close`,()=>{e.removeEventListener(`abort`,onAbort)})}return t}function isReadable(e){if(e==null)return!1;let t=e;return typeof t.readable!=`boolean`||typeof t.read!=`function`||t.destroyed===!0||t.readableEnded===!0?!1:t.readable===!0}function isWritable(e){if(e==null)return!1;let t=e;return typeof t.writable!=`boolean`||typeof t.write!=`function`||t.destroyed===!0||t.writableEnded===!0?!1:t.writable===!0}function isDestroyed(e){return e==null?!1:e.destroyed===!0}function isDisturbed(e){if(e==null)return!1;let t=e;return t.readableDidRead===!0||t.readableFlowing!==null&&t.readableFlowing!==void 0}function isErrored(e){if(e==null)return!1;let t=e;return t.destroyed===!0&&typeof t.readable==`boolean`&&t.readable===!1||t.destroyed===!0&&typeof t.writable==`boolean`&&t.writable===!1}var Dr=__esmMin(()=>{Er(),L()});function getDefaultHighWaterMark(e){return e?kr:Or}function setDefaultHighWaterMark(e,t){if(typeof t!=`number`||t<0||Number.isNaN(t))throw TypeError(`Invalid highWaterMark: ${t}`);e?kr=t:Or=t}function validateHighWaterMark(e,t){if(t!==void 0&&(typeof t!=`number`||Number.isNaN(t))){let n=TypeError(`The value of "${e}" is invalid. Received ${t}`);throw n.code=`ERR_INVALID_ARG_VALUE`,n}}var Or,kr,Ar=__esmMin(()=>{Or=16384,kr=16});function createAbortError(){let e=Error(`The operation was aborted`);return e.name=`AbortError`,e.code=`ABORT_ERR`,e}async function streamAsyncDispose(e,t){let n;e.destroyed||(n=t?void 0:createAbortError(),e.destroy(n)),await new Promise((t,r)=>{finished(e,e=>{e&&e!==n?r(e):t()})})}var jr,Mr=__esmMin(()=>{Dr(),jr=Symbol.asyncDispose??Symbol.for(`Symbol.asyncDispose`)});function chunkLength(e){if(e==null)return 1;let t=e.length;return typeof t==`number`?t:1}function sliceChunk(e,t,n){if(typeof e==`string`)return n===void 0?e.slice(t):e.slice(t,n);let r=e.slice;return typeof r==`function`?r.call(e,t,n):e}var Nr,Pr=__esmMin(()=>{Er(),Mr(),Ar(),L(),Nr=class Readable_ extends Stream_{readable=!0;readableFlowing=null;readableLength=0;readableHighWaterMark;readableEncoding;readableObjectMode;readableEnded=!1;readableAborted=!1;destroyed=!1;_pipeDests=[];_buffer=[];_readableState={ended:!1,endEmitted:!1,reading:!1,constructed:!0,highWaterMark:0,objectMode:!1,pipes:[]};_err;_readablePending=!1;_readImpl;_destroyImpl;_constructImpl;constructor(e){super(e),this.readableHighWaterMark=e?.highWaterMark??getDefaultHighWaterMark(e?.objectMode??!1),this.readableEncoding=e?.encoding??null,this.readableObjectMode=e?.objectMode??!1,this._readableState.highWaterMark=this.readableHighWaterMark,this._readableState.objectMode=this.readableObjectMode,e?.read&&(this._readImpl=e.read),e?.destroy&&(this._destroyImpl=e.destroy),e?.construct&&(this._constructImpl=e.construct),(this._constructImpl||this._construct!==Readable_.prototype._construct)&&(this._readableState.constructed=!1,nextTick(()=>{this._construct(e=>{this._readableState.constructed=!0,e?this.destroy(e):this.readableFlowing===!0&&this._flow()})}))}_construct(e){this._constructImpl?this._constructImpl.call(this,e):e()}_read(e){this._readImpl&&this._readImpl.call(this,e)}read(e){if(!this._readableState.constructed)return null;if(this._buffer.length===0){if(this._readableState.ended)return null;this._readableState.reading=!0,this._read(e??this.readableHighWaterMark),this._readableState.reading=!1}if(this._buffer.length===0||e===0)return null;if(this.readableObjectMode){if(e===void 0){let e=this._buffer.shift();return--this.readableLength,this._readableState.ended&&this._buffer.length===0&&!this._readableState.endEmitted&&this._emitEnd(),e}if(e>this.readableLength)return null;let t=this._buffer.shift();return--this.readableLength,t}if(e!=null)return e>this.readableLength?null:this._readBytes(e);let t=this._buffer.splice(0);if(this.readableLength=0,this._readableState.ended&&this._buffer.length===0&&!this._readableState.endEmitted&&this._emitEnd(),t.length===1)return t[0];if(t.length===0)return null;if(typeof t[0]==`string`)return t.join(``);let n=globalThis.Buffer;return n?.concat?n.concat(t):t}_readBytes(e){let t=0,n=[];for(;t<e&&this._buffer.length>0;){let r=this._buffer[0],i=chunkLength(r);if(t+i<=e)n.push(this._buffer.shift()),t+=i,this.readableLength-=i;else{let i=e-t;n.push(sliceChunk(r,0,i)),this._buffer[0]=sliceChunk(r,i),this.readableLength-=i,t+=i}}if(n.length===1)return n[0];let r=globalThis.Buffer;return r?.concat?r.concat(n):n}push(e,t){if(e===null)return this._readableState.ended=!0,this.readableEnded=!0,this._buffer.length===0&&!this._readableState.endEmitted&&nextTick(()=>this._emitEnd()),this._scheduleReadable(),!1;if(!this.readableObjectMode&&!(typeof e==`string`||ArrayBuffer.isView(e))){let t=Object.assign(TypeError(`Invalid non-string/buffer chunk type: ${typeof e}`),{code:`ERR_INVALID_ARG_TYPE`});return nextTick(()=>this.emit(`error`,t)),!1}return this._buffer.push(e),this.readableLength+=this.readableObjectMode?1:chunkLength(e),this.readableFlowing&&!this._flowing&&nextTick(()=>this._flow()),this.readableFlowing!==!0&&this._scheduleReadable(),this.readableLength<this.readableHighWaterMark}_emitEnd(){this._readableState.endEmitted||(this._readableState.endEmitted=!0,this.emit(`end`),nextTick(()=>this._autoClose()))}_autoClose(){this.emit(`close`)}_scheduleReadable(){this._readablePending||this.listenerCount(`readable`)===0||(this._readablePending=!0,nextTick(()=>{this._readablePending=!1,this.destroyed||this.emit(`readable`)}))}on(e,t){return super.on(e,t),e===`data`&&this.readableFlowing!==!1&&this.resume(),e===`readable`&&(this._buffer.length>0||this._readableState.ended)&&this._scheduleReadable(),this}unshift(e){this._buffer.unshift(e),this.readableLength+=this.readableObjectMode?1:chunkLength(e)}setEncoding(e){return this.readableEncoding=e,this}pause(){return this.readableFlowing=!1,this.emit(`pause`),this}resume(){return this.readableFlowing!==!0&&(this.readableFlowing=!0,this.emit(`resume`),this._readableState.constructed&&this._flow()),this}_flowing=!1;_flow(){if(!(this.readableFlowing!==!0||this._flowing||this.destroyed)&&this._readableState.constructed){this._flowing=!0;try{for(;this._buffer.length>0&&this.readableFlowing&&!this.destroyed;){let e=this._buffer.shift();if(this.readableLength-=this.readableObjectMode?1:chunkLength(e),this.readableEncoding&&typeof e!=`string`){let t=globalThis.Buffer;t?.isBuffer&&t.isBuffer(e)?e=e.toString(this.readableEncoding):e instanceof Uint8Array&&(e=new TextDecoder(this.readableEncoding).decode(e))}this.emit(`data`,e)}if(this.destroyed)return;if(this._readableState.ended&&this._buffer.length===0&&!this._readableState.endEmitted){nextTick(()=>this._emitEnd());return}!this._readableState.ended&&!this._readableState.reading&&!this.destroyed&&(this._readableState.reading=!0,this._read(this.readableHighWaterMark),this._readableState.reading=!1)}finally{this._flowing=!1}this._buffer.length>0&&this.readableFlowing&&!this.destroyed&&nextTick(()=>this._flow())}}isPaused(){return this.readableFlowing===!1}unpipe(e){if(e){let t=this._pipeDests.findIndex(t=>t.dest===e);if(t!==-1){this._pipeDests[t].cleanup(),this._pipeDests.splice(t,1);let n=this._readableState.pipes.indexOf(e);n!==-1&&this._readableState.pipes.splice(n,1),e.emit(`unpipe`,this),this._pipeDests.length===0&&(this.readableFlowing=!1)}}else{for(let e of this._pipeDests)e.cleanup(),e.dest.emit(`unpipe`,this);this._pipeDests=[],this._readableState.pipes=[],this.readableFlowing=!1}return this}_destroy(e,t){this._destroyImpl?this._destroyImpl.call(this,e,t):t(e??void 0)}destroy(e){if(this.destroyed)return this;this.destroyed=!0,this.readable=!1,this.readableAborted=!this.readableEnded,e&&(this._err=e);let cb=e=>{e&&nextTick(()=>this.emit(`error`,e)),nextTick(()=>this.emit(`close`))};return Object.prototype.hasOwnProperty.call(this,`_destroy`)?this._destroy(e??null,cb):this._destroyImpl?this._destroyImpl.call(this,e??null,cb):cb(e),this}static toWeb(e){return new ReadableStream({start(t){e.on(`data`,e=>{typeof e==`string`?t.enqueue(new TextEncoder().encode(e)):e instanceof Uint8Array?t.enqueue(e):e&&typeof e.length==`number`&&t.enqueue(new Uint8Array(e))}),e.on(`end`,()=>{t.close()}),e.on(`error`,e=>{t.error(e)})},cancel(){e.destroy()}})}static fromWeb(e,t){let n=e.getReader();return new Readable_({...t,read(){n.read().then(({done:e,value:t})=>{e?this.push(null):this.push(t)},e=>{this.destroy(e)})},destroy(e,t){n.cancel(e?.message).then(()=>t(null),t)}})}[Symbol.asyncIterator](){let e=this,t=[],n=!1,r=null,i=null,a=null;return e.on(`data`,e=>{if(i){let t=i;i=null,a=null,t({value:e,done:!1})}else t.push(e)}),e.on(`end`,()=>{if(n=!0,i){let e=i;i=null,a=null,e({value:void 0,done:!0})}}),e.on(`error`,e=>{if(r=e,n=!0,a){let t=a;i=null,a=null,t(e)}}),{next(){return r?Promise.reject(r):t.length>0?Promise.resolve({value:t.shift(),done:!1}):n?Promise.resolve({value:void 0,done:!0}):new Promise((e,t)=>{i=e,a=t})},return(){return e.destroy(),Promise.resolve({value:void 0,done:!0})},[Symbol.asyncIterator](){return this}}}static from(e,t){let n=new Readable_({objectMode:!0,...t,read(){}});return typeof e==`string`||ArrayBuffer.isView(e)?(n.push(e),n.push(null),n):((async()=>{try{for await(let t of e)n.push(t)||await new Promise(e=>n.once(`drain`,e));n.push(null)}catch(e){n.destroy(e)}})(),n)}},Nr.prototype[jr]=function(){return streamAsyncDispose(this,this.readableEnded)}});function chunkLen$1(e){if(e==null)return 1;let t=e.length;return typeof t==`number`?t:1}var Duplex_,Fr=__esmMin(()=>{Ar(),Pr(),L(),Duplex_=class extends Nr{writable=!0;writableHighWaterMark;writableLength=0;writableObjectMode;writableEnded=!1;writableFinished=!1;writableCorked=0;writableNeedDrain=!1;allowHalfOpen;_decodeStrings;_writableState={highWaterMark:0,objectMode:!1};_duplexCorkedBuffer=[];_duplexWriting=!1;_duplexWriteQueue=[];_writeImpl;_finalImpl;_defaultEncoding=`utf8`;_pendingWrites=0;_pendingEndCb=null;constructor(e){super(e),validateHighWaterMark(`writableHighWaterMark`,e?.writableHighWaterMark),validateHighWaterMark(`readableHighWaterMark`,e?.readableHighWaterMark),this.writableObjectMode=e?.writableObjectMode??e?.objectMode??!1,this.writableHighWaterMark=e?.highWaterMark??e?.writableHighWaterMark??getDefaultHighWaterMark(this.writableObjectMode),this._writableState.highWaterMark=this.writableHighWaterMark,this._writableState.objectMode=this.writableObjectMode,e?.highWaterMark===void 0&&e?.readableHighWaterMark!==void 0&&(this.readableHighWaterMark=e.readableHighWaterMark,this._readableState.highWaterMark=e.readableHighWaterMark),e?.readableObjectMode!==void 0&&(this.readableObjectMode=e.readableObjectMode,this._readableState.objectMode=e.readableObjectMode,e?.readableHighWaterMark===void 0&&e?.highWaterMark===void 0&&(this.readableHighWaterMark=getDefaultHighWaterMark(e.readableObjectMode),this._readableState.highWaterMark=this.readableHighWaterMark)),this.allowHalfOpen=e?.allowHalfOpen!==!1,this._decodeStrings=e?.decodeStrings!==!1,e?.write&&(this._writeImpl=e.write),e?.final&&(this._finalImpl=e.final),this.allowHalfOpen||this.once(`end`,()=>{this.writableEnded||nextTick(()=>this.end())})}_write(e,t,n){this._writeImpl?this._writeImpl.call(this,e,t,n):n()}_final(e){this._finalImpl?this._finalImpl.call(this,e):e()}destroy(e){return this.destroyed?this:(this.writable=!1,super.destroy(e))}write(e,t,n){let r,i;if(typeof t==`function`?(r=t,i=this._defaultEncoding):(i=t??this._defaultEncoding,r=n??(()=>{})),this._decodeStrings&&!this.writableObjectMode&&typeof e==`string`){let t=globalThis.Buffer;t&&(e=t.from(e,i),i=`buffer`)}if(typeof e!=`string`&&!this.writableObjectMode){let t=globalThis.Buffer;(t&&t.isBuffer(e)||e instanceof Uint8Array)&&(i=`buffer`)}if(this.writableEnded){let e=Error(`write after end`);return nextTick(()=>{r(e),this.emit(`error`,e)}),!1}if(this.writableLength+=this.writableObjectMode?1:chunkLen$1(e),this.writableCorked>0)return this._duplexCorkedBuffer.push({chunk:e,encoding:i,callback:r}),this.writableLength<this.writableHighWaterMark;let a=this.writableLength<this.writableHighWaterMark;return a||(this.writableNeedDrain=!0),this._duplexDoWrite(e,i,r),a}_duplexDoWrite(e,t,n){if(this._duplexWriting){this._duplexWriteQueue.push({chunk:e,encoding:t,callback:n});return}this._duplexWriting=!0,this._duplexStartWrite(e,t,n)}_duplexStartWrite(e,t,n){this._pendingWrites++,this._write(e,t,t=>{this._pendingWrites--,this.writableLength-=this.writableObjectMode?1:chunkLen$1(e),nextTick(t?()=>{if(n(t),this._duplexWriting=!1,this.emit(`error`,t),this._duplexWriteQueue.length>0){let e=this._duplexWriteQueue.shift();this._duplexWriting=!0,this._duplexStartWrite(e.chunk,e.encoding,e.callback)}}:()=>{if(n(),this._duplexWriteQueue.length>0){let e=this._duplexWriteQueue.shift();this._duplexStartWrite(e.chunk,e.encoding,e.callback);return}if(this._duplexWriting=!1,this.writableNeedDrain&&this.writableLength<=this.writableHighWaterMark&&(this.writableNeedDrain=!1,this.emit(`drain`)),this._pendingWrites===0&&this._pendingEndCb){let e=this._pendingEndCb;this._pendingEndCb=null,e()}})})}end(e,t,n){typeof e==`function`&&(n=e,e=void 0),typeof t==`function`&&(n=t,t=void 0),e!=null&&this.write(e,t),this.writableEnded=!0;let doFinal=()=>{this._final(e=>{this.writableFinished=!0,this._doPrefinishHooks(()=>{nextTick(()=>{e&&this.emit(`error`,e),this.emit(`finish`),nextTick(()=>this.emit(`close`)),n&&n()})})})};return this._pendingWrites>0||this._duplexWriting||this._duplexWriteQueue.length>0?this._pendingEndCb=doFinal:doFinal(),this}_doPrefinishHooks(e){e()}cork(){this.writableCorked++}uncork(){if(this.writableCorked>0&&(this.writableCorked--,this.writableCorked===0&&this._duplexCorkedBuffer.length>0)){let e=this._duplexCorkedBuffer.splice(0);for(let{chunk:t,encoding:n,callback:r}of e)this._write(t,n,e=>{this.writableLength-=this.writableObjectMode?1:chunkLen$1(t),e?(r(e),this.emit(`error`,e)):r()});this.writableNeedDrain&&this.writableLength<=this.writableHighWaterMark&&(this.writableNeedDrain=!1,nextTick(()=>this.emit(`drain`)))}}setDefaultEncoding(e){return this._defaultEncoding=e,this}},__name(chunkLen$1,`chunkLen`)});function pipe(e,t,n){let r=e,i=n?.end!==!1,a=!1,ondrain=()=>{a=!1,t.removeListener(`drain`,ondrain);let e=r;typeof e.resume==`function`&&e.resume()},ondata=e=>{if(t.writable){let n=r;t.write(e)===!1&&typeof n.pause==`function`&&(n.pause(),a||(a=!0,t.on(`drain`,ondrain)))}};r.on(`data`,ondata);let o=!1,onend=()=>{o||(o=!0,i&&t.end())},onclose=()=>{if(!o&&(o=!0,i&&!(r instanceof Nr))){let e=t;typeof e.destroy==`function`&&e.destroy()}};i&&(r.on(`end`,onend),r.on(`close`,onclose));let cleanup=()=>{r.removeListener(`data`,ondata),a&&t.removeListener(`drain`,ondrain),r.removeListener(`end`,onend),r.removeListener(`close`,onclose),r.removeListener(`end`,cleanup),r.removeListener(`close`,cleanup),t.removeListener(`close`,cleanup)};return r.on(`end`,cleanup),r.on(`close`,cleanup),t.on(`close`,cleanup),r instanceof Nr&&(r._pipeDests.push({dest:t,cleanup}),r._readableState.pipes.push(t)),t.emit(`pipe`,r),t}var Ir=__esmMin(()=>{Er(),Pr(),_setPipeImpl(pipe)});function chunkLen(e){if(e==null)return 1;let t=e.length;return typeof t==`number`?t:1}var Lr,Rr=__esmMin(()=>{Er(),Mr(),Ar(),L(),Lr=class Writable_ extends Stream_{static[Symbol.hasInstance](e){let t=this;return t.prototype!==void 0&&Object.prototype.isPrototypeOf.call(t.prototype,e)?!0:t.prototype!==Writable_.prototype||e==null?!1:typeof e.writableHighWaterMark==`number`}writable=!0;writableHighWaterMark;writableLength=0;writableObjectMode;writableEnded=!1;writableFinished=!1;writableCorked=0;writableNeedDrain=!1;destroyed=!1;_err;_writableState={ended:!1,finished:!1,constructed:!0,writing:!1};_corkedBuffer=[];_writeBuffer=[];_pendingConstruct=[];_ending=!1;_endCallback;_pendingEnd=null;_writeImpl;_writev;_finalImpl;_destroyImpl;_constructImpl;_decodeStrings;_defaultEncoding=`utf8`;constructor(e){super(e),this.writableHighWaterMark=e?.highWaterMark??getDefaultHighWaterMark(e?.objectMode??!1),this.writableObjectMode=e?.objectMode??!1,this._decodeStrings=e?.decodeStrings!==!1,e?.write&&(this._writeImpl=e.write),e?.writev&&(this._writev=e.writev),e?.final&&(this._finalImpl=e.final),e?.destroy&&(this._destroyImpl=e.destroy),e?.construct&&(this._constructImpl=e.construct),(this._constructImpl||this._construct!==Writable_.prototype._construct)&&(this._writableState.constructed=!1,nextTick(()=>{this._construct(e=>{this._writableState.constructed=!0,e?this.destroy(e):this._maybeFlush()})}))}_construct(e){this._constructImpl?this._constructImpl.call(this,e):e()}_write(e,t,n){this._writeImpl?this._writeImpl.call(this,e,t,n):n()}_final(e){this._finalImpl?this._finalImpl.call(this,e):e()}_destroy(e,t){this._destroyImpl?this._destroyImpl.call(this,e,t):t(e)}_maybeFlush(){let e=this._pendingConstruct.splice(0);if(e.length>0){let[t,...n]=e;this._writeBuffer.push(...n),this._doWrite(t.chunk,t.encoding,t.callback)}if(this._pendingEnd){let{chunk:e,encoding:t,callback:n}=this._pendingEnd;this._pendingEnd=null,this._doEnd(e,t,n)}}_doWrite(e,t,n){this._writableState.writing=!0;let r=!0;this._write(e,t,t=>{if(this.writableLength-=this.writableObjectMode?1:chunkLen(e),r){nextTick(()=>{if(t){n(t),this.emit(`error`,t);return}n(),this.writableNeedDrain&&this.writableLength<=this.writableHighWaterMark&&(this.writableNeedDrain=!1,this.emit(`drain`))}),t||this._drainWriteBuffer();return}nextTick(t?()=>{n(t),this.emit(`error`,t),this._drainWriteBuffer()}:()=>{n(),this.writableNeedDrain&&this.writableLength<=this.writableHighWaterMark&&(this.writableNeedDrain=!1,this.emit(`drain`)),this._drainWriteBuffer()})}),r=!1}_drainWriteBuffer(){if(this._writeBuffer.length>0){let e=this._writeBuffer.shift();this._doWrite(e.chunk,e.encoding,e.callback)}else this._writableState.writing=!1,this._maybeFinish()}_maybeFinish(){!this._ending||this._writableState.finished||this._writableState.writing||this._writeBuffer.length>0||(this._ending=!1,this._final(e=>{this.writableFinished=!0,this._writableState.finished=!0,nextTick(()=>{e&&this.emit(`error`,e),this.emit(`finish`),nextTick(()=>this.emit(`close`)),this._endCallback&&this._endCallback()})}))}write(e,t,n){let r,i;if(typeof t==`function`?(r=t,i=this._defaultEncoding):(i=t??this._defaultEncoding,r=n??(()=>{})),this._decodeStrings&&!this.writableObjectMode&&typeof e==`string`){let t=globalThis.Buffer;t&&(e=t.from(e,i),i=`buffer`)}if(typeof e!=`string`&&!this.writableObjectMode){let t=globalThis.Buffer;(t&&t.isBuffer(e)||e instanceof Uint8Array)&&(i=`buffer`)}if(this.writableEnded){let e=Error(`write after end`);return nextTick(()=>{r(e),this.emit(`error`,e)}),!1}if(this.writableLength+=this.writableObjectMode?1:chunkLen(e),this.writableCorked>0)return this._corkedBuffer.push({chunk:e,encoding:i,callback:r}),this.writableLength<this.writableHighWaterMark;if(!this._writableState.constructed)return this._pendingConstruct.push({chunk:e,encoding:i,callback:r}),this.writableLength<this.writableHighWaterMark;let a=this.writableLength<this.writableHighWaterMark;return a||(this.writableNeedDrain=!0),this._writableState.writing?this._writeBuffer.push({chunk:e,encoding:i,callback:r}):this._doWrite(e,i,r),a}_doEnd(e,t,n){e!=null&&this.write(e,t),this.writableEnded=!0,this._writableState.ended=!0,this._ending=!0,this._endCallback=n,this._maybeFinish()}end(e,t,n){return typeof e==`function`&&(n=e,e=void 0),typeof t==`function`&&(n=t,t=void 0),this.writableEnded?(n&&nextTick(n),this):this._writableState.constructed?(this._doEnd(e,t,n),this):(this._pendingEnd={chunk:e,encoding:t,callback:n},this)}cork(){this.writableCorked++}uncork(){this.writableCorked>0&&(this.writableCorked--,this.writableCorked===0&&this._corkedBuffer.length>0&&this._flushCorkedBuffer())}_flushCorkedBuffer(){if(this._writev&&this._corkedBuffer.length>1){let e=this._corkedBuffer.splice(0),t=e.map(e=>({chunk:e.chunk,encoding:e.encoding}));this._writev.call(this,t,t=>{for(let t of e)this.writableLength-=this.writableObjectMode?1:chunkLen(t.chunk);if(t){for(let n of e)n.callback(t);this.emit(`error`,t)}else{for(let t of e)t.callback();this.writableNeedDrain&&this.writableLength<=this.writableHighWaterMark&&(this.writableNeedDrain=!1,this.emit(`drain`))}})}else{let e=this._corkedBuffer.splice(0);if(e.length>0){let[t,...n]=e;this._writeBuffer.push(...n),this._doWrite(t.chunk,t.encoding,t.callback)}}}setDefaultEncoding(e){return this._defaultEncoding=e,this}destroy(e){if(this.destroyed)return this;this.destroyed=!0,this.writable=!1,e&&(this._err=e);let cb=e=>{e&&nextTick(()=>this.emit(`error`,e)),nextTick(()=>this.emit(`close`))};return this._destroy(e??null,cb),this}},Lr.prototype[jr]=function(){return streamAsyncDispose(this,this.writableFinished)}}),zr,Br=__esmMin(()=>{Fr(),L(),zr=class Transform_ extends Duplex_{constructor(e){super({...e,write:void 0,final:void 0});let t=this;e?.transform&&(t._transform=e.transform),e?.flush&&(t._flush=e.flush),e?.final&&(t._final=e.final)}_transform(e,t,n){throw Object.assign(Error(`The _transform() method is not implemented`),{code:`ERR_METHOD_NOT_IMPLEMENTED`})}_flush(e){e()}_write(e,t,n){let r=!1;try{this._transform(e,t,(e,t)=>{if(r){let e=Object.assign(Error(`Callback called multiple times`),{code:`ERR_MULTIPLE_CALLBACK`});nextTick(()=>this.emit(`error`,e));return}if(r=!0,e){n(e);return}t!=null&&this.push(t),n()})}catch(e){if(e?.code===`ERR_METHOD_NOT_IMPLEMENTED`)throw e;n(e)}}_final(e){this._flush((t,n)=>{if(t){e(t);return}n!=null&&this.push(n),this.push(null),e()})}_doPrefinishHooks(e){let t=Transform_.prototype._final;this._final===t?e():t.call(this,e)}}}),PassThrough_,Vr=__esmMin(()=>{Br(),PassThrough_=class extends zr{constructor(e){super({...e,transform(e,t,n){n(null,e)}})}}});function pipeline(...e){let t=e,n=typeof t[t.length-1]==`function`?t.pop():void 0,r=t;if(r.length<2)throw Error(`pipeline requires at least 2 streams`);let i=null;function onError(e){if(!i){i=e;for(let e of r)typeof e.destroy==`function`&&e.destroy();n&&n(e)}}let a=r[0];for(let e=1;e<r.length;e++){let t=r[e];a.pipe(t),a.on(`error`,onError),a=t}let o=r[r.length-1];return o.on(`error`,onError),o.on(`finish`,()=>{n&&!i&&n(null)}),o}var Hr=__esmMin(()=>{}),Ur=__exportAll$4({Duplex:()=>qr,PassThrough:()=>Yr,Readable:()=>Gr,Stream:()=>Wr,Transform:()=>Jr,Writable:()=>Kr,addAbortSignal:()=>addAbortSignal,default:()=>Xr,finished:()=>finished,getDefaultHighWaterMark:()=>getDefaultHighWaterMark,isDestroyed:()=>isDestroyed,isDisturbed:()=>isDisturbed,isErrored:()=>isErrored,isReadable:()=>isReadable,isWritable:()=>isWritable,pipeline:()=>pipeline,setDefaultHighWaterMark:()=>setDefaultHighWaterMark}),Wr,Gr,Kr,qr,Jr,Yr,Xr,Zr=__esmMin(()=>{wr(),Er(),Dr(),Ar(),Pr(),Fr(),Ir(),Rr(),Br(),Vr(),Hr(),Wr=makeCallable(Stream_),Gr=makeCallable(Nr),Kr=makeCallable(Lr),qr=makeCallable(Duplex_),Jr=makeCallable(zr),Yr=makeCallable(PassThrough_),Xr=Object.assign(Wr,{Stream:Wr,Readable:Gr,Writable:Kr,Duplex:qr,Transform:Jr,PassThrough:Yr,pipeline,finished,addAbortSignal,isReadable,isWritable,isDestroyed,isDisturbed,isErrored,getDefaultHighWaterMark,setDefaultHighWaterMark})});function getGioCompressorFormat(e){switch(e){case`gzip`:return M.ZlibCompressorFormat.GZIP;case`deflate`:return M.ZlibCompressorFormat.ZLIB;case`deflate-raw`:return M.ZlibCompressorFormat.RAW}}function toUint8Array$2(e){return typeof e==`string`?new TextEncoder().encode(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}function concat(e){let t=e.reduce((e,t)=>e+t.length,0),n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.length;return n}function compressWithGio$1(e,t){let n=new M.ZlibCompressor({format:getGioCompressorFormat(t)}),r=new M.ConverterOutputStream({base_stream:M.MemoryOutputStream.new_resizable(),converter:n});r.write_bytes(new k.Bytes(e),null),r.close(null);let i=r.get_base_stream().steal_as_bytes();return new Uint8Array(i.get_data()??[])}function decompressMemberWithGio(e,t){let n=new M.ZlibDecompressor({format:getGioCompressorFormat(t)}),r=M.MemoryInputStream.new_from_bytes(new k.Bytes(e)),i=new M.ConverterInputStream({base_stream:r,converter:n}),a=[];for(;;){let e=i.read_bytes(4096,null);if(e.get_size()===0)break;a.push(new Uint8Array(e.get_data()))}return i.close(null),concat(a)}function findGzipMemberEnd$1(e){let t=new M.ZlibDecompressor({format:M.ZlibCompressorFormat.GZIP}),n=new Uint8Array(65536),r=0,i=!1;for(;!i;){let a=e.subarray(r);try{let[e,o]=t.convert(a,n,M.ConverterFlags.NONE);r+=o,e===M.ConverterResult.FINISHED&&(i=!0)}catch{i=!0}}return r}function gunzipWithGio(e){let t=[],n=0;for(;n<e.length&&!(e.length-n<2||e[n]!==31||e[n+1]!==139);){let r=e.subarray(n),i=findGzipMemberEnd$1(r);if(i<=0)break;t.push(decompressMemberWithGio(r.subarray(0,i),`gzip`)),n+=i}return t.length===0?decompressMemberWithGio(e,`gzip`):concat(t)}function createGzip(e){return new Gzip(e)}function createGunzip(e){return new Gunzip(e)}function createDeflate(e){return new Deflate(e)}function createInflate(e){return new Inflate(e)}function createDeflateRaw(e){return new DeflateRaw(e)}function createInflateRaw(e){return new InflateRaw(e)}function createUnzip(e){return new Unzip(e)}function createBrotliCompress(e){throw Error(`createBrotliCompress is not supported on GJS (no Brotli in GLib)`)}function createBrotliDecompress(e){throw Error(`createBrotliDecompress is not supported on GJS (no Brotli in GLib)`)}function createZstdCompress(e){let t=Error(`createZstdCompress is not supported on GJS (no Zstd in GLib)`);throw t.code=`ERR_UNSUPPORTED_OPERATION`,t}function createZstdDecompress(e){let t=Error(`createZstdDecompress is not supported on GJS (no Zstd in GLib)`);throw t.code=`ERR_UNSUPPORTED_OPERATION`,t}var ZlibBase,Gzip,Gunzip,Deflate,Inflate,DeflateRaw,InflateRaw,Unzip,BrotliCompress,BrotliDecompress,ZstdCompress,ZstdDecompress,Qr=__esmMin(()=>{N(),A(),Zr(),__name(toUint8Array$2,`toUint8Array`),__name(compressWithGio$1,`compressWithGio`),__name(findGzipMemberEnd$1,`findGzipMemberEnd`),ZlibBase=class extends Jr{_mode;_chunks=[];constructor(e,t){super(t),this._mode=e}_transform(e,t,n){this._chunks.push(toUint8Array$2(e)),n()}_flush(e){let t=concat(this._chunks);this._chunks=[];try{this.push(Buffer.from(this._run(t))),e()}catch(t){e(t instanceof Error?t:Error(String(t)))}}_run(e){let t=this._mode;switch(t.kind){case`compress`:return compressWithGio$1(e,t.format);case`decompress`:return decompressMemberWithGio(e,t.format);case`gunzip`:return gunzipWithGio(e);case`unzip`:return e.length>=2&&e[0]===31&&e[1]===139?gunzipWithGio(e):decompressMemberWithGio(e,`deflate`)}}},Gzip=class extends ZlibBase{constructor(e){super({kind:`compress`,format:`gzip`},e)}},Gunzip=class extends ZlibBase{constructor(e){super({kind:`gunzip`},e)}},Deflate=class extends ZlibBase{constructor(e){super({kind:`compress`,format:`deflate`},e)}},Inflate=class extends ZlibBase{constructor(e){super({kind:`decompress`,format:`deflate`},e)}},DeflateRaw=class extends ZlibBase{constructor(e){super({kind:`compress`,format:`deflate-raw`},e)}},InflateRaw=class extends ZlibBase{constructor(e){super({kind:`decompress`,format:`deflate-raw`},e)}},Unzip=class extends ZlibBase{constructor(e){super({kind:`unzip`},e)}},BrotliCompress=class extends Jr{constructor(){throw super(),Error(`BrotliCompress is not supported on GJS (no Brotli in GLib)`)}},BrotliDecompress=class extends Jr{constructor(){throw super(),Error(`BrotliDecompress is not supported on GJS (no Brotli in GLib)`)}},ZstdCompress=class extends Jr{constructor(){super();let e=Error(`ZstdCompress is not supported on GJS (no Zstd in GLib)`);throw e.code=`ERR_UNSUPPORTED_OPERATION`,e}},ZstdDecompress=class extends Jr{constructor(){super();let e=Error(`ZstdDecompress is not supported on GJS (no Zstd in GLib)`);throw e.code=`ERR_UNSUPPORTED_OPERATION`,e}}}),$r=__exportAll$4({BrotliCompress:()=>BrotliCompress,BrotliDecompress:()=>BrotliDecompress,Deflate:()=>Deflate,DeflateRaw:()=>DeflateRaw,Gunzip:()=>Gunzip,Gzip:()=>Gzip,Inflate:()=>Inflate,InflateRaw:()=>InflateRaw,Unzip:()=>Unzip,ZlibTransform:()=>ZlibBase,ZstdCompress:()=>ZstdCompress,ZstdDecompress:()=>ZstdDecompress,brotliCompress:()=>brotliCompress,brotliCompressSync:()=>brotliCompressSync,brotliDecompress:()=>brotliDecompress,brotliDecompressSync:()=>brotliDecompressSync,constants:()=>ni,createBrotliCompress:()=>createBrotliCompress,createBrotliDecompress:()=>createBrotliDecompress,createDeflate:()=>createDeflate,createDeflateRaw:()=>createDeflateRaw,createGunzip:()=>createGunzip,createGzip:()=>createGzip,createInflate:()=>createInflate,createInflateRaw:()=>createInflateRaw,createUnzip:()=>createUnzip,createZstdCompress:()=>createZstdCompress,createZstdDecompress:()=>createZstdDecompress,default:()=>ri,deflate:()=>deflate,deflateRaw:()=>deflateRaw,deflateRawSync:()=>deflateRawSync,deflateSync:()=>deflateSync,gunzip:()=>gunzip,gunzipSync:()=>gunzipSync,gzip:()=>gzip,gzipSync:()=>gzipSync,inflate:()=>inflate,inflateRaw:()=>inflateRaw,inflateRawSync:()=>inflateRawSync,inflateSync:()=>inflateSync,zstdCompress:()=>zstdCompress,zstdCompressSync:()=>zstdCompressSync,zstdDecompress:()=>zstdDecompress,zstdDecompressSync:()=>zstdDecompressSync});function getGioFormat(e){switch(e){case`gzip`:return M.ZlibCompressorFormat.GZIP;case`deflate`:return M.ZlibCompressorFormat.ZLIB;case`deflate-raw`:return M.ZlibCompressorFormat.RAW}}function compressWithGio(e,t){let n=new M.ZlibCompressor({format:getGioFormat(t)}),r=new M.ConverterOutputStream({base_stream:M.MemoryOutputStream.new_resizable(),converter:n});r.write_bytes(new k.Bytes(e),null),r.close(null);let i=r.get_base_stream().steal_as_bytes();return new Uint8Array(i.get_data()??[])}function decompressStreamWithGio(e,t){let n=new M.ZlibDecompressor({format:getGioFormat(t)}),r=M.MemoryInputStream.new_from_bytes(new k.Bytes(e)),i=new M.ConverterInputStream({base_stream:r,converter:n}),a=[];for(;;){let e=i.read_bytes(4096,null);if(e.get_size()===0)break;a.push(new Uint8Array(e.get_data()))}i.close(null);let o=a.reduce((e,t)=>e+t.length,0),s=new Uint8Array(o),c=0;for(let e of a)s.set(e,c),c+=e.length;return s}function findGzipMemberEnd(e){let t=new M.ZlibDecompressor({format:M.ZlibCompressorFormat.GZIP}),n=new Uint8Array(65536),r=0,i=!1;for(;!i;){let a=e.subarray(r);try{let[e,o]=t.convert(a,n,M.ConverterFlags.NONE);r+=o,e===M.ConverterResult.FINISHED&&(i=!0)}catch{i=!0}}return r}function decompressWithGio(e,t){if(t!==`gzip`)return decompressStreamWithGio(e,t);let n=[],r=0;for(;r<e.length&&!(e.length-r<2||e[r]!==31||e[r+1]!==139);){let t=e.subarray(r),i=findGzipMemberEnd(t);if(i<=0)break;let a=decompressStreamWithGio(t.subarray(0,i),`gzip`);n.push(a),r+=i}if(n.length===0)return decompressStreamWithGio(e,`gzip`);let i=n.reduce((e,t)=>e+t.length,0),a=new Uint8Array(i),o=0;for(let e of n)a.set(e,o),o+=e.length;return a}async function runWebTransform(e,t){let n=new ReadableStream({start(t){t.enqueue(new Uint8Array(e.buffer,e.byteOffset,e.byteLength)),t.close()}}),r=[],i=n.pipeThrough(t).getReader();for(;;){let{done:e,value:t}=await i.read();if(e)break;r.push(t)}let a=r.reduce((e,t)=>e+t.length,0),o=new Uint8Array(a),s=0;for(let e of r)o.set(e,s),s+=e.length;return o}async function compressWithWeb(e,t){return runWebTransform(e,new CompressionStream(t))}async function decompressWithWeb(e,t){return runWebTransform(e,new DecompressionStream(t))}async function compress(e,t){return ei?compressWithWeb(e,t):compressWithGio(e,t)}async function decompress(e,t){return ei?decompressWithWeb(e,t):decompressWithGio(e,t)}function toUint8Array$1(e){return typeof e==`string`?new TextEncoder().encode(e):e instanceof ArrayBuffer?new Uint8Array(e):e}function gzip(e,t,n){let r=typeof t==`function`?t:n;compress(toUint8Array$1(e),`gzip`).then(e=>r(null,e),e=>r(e instanceof Error?e:Error(String(e)),new Uint8Array))}function gunzip(e,t,n){let r=typeof t==`function`?t:n;decompress(toUint8Array$1(e),`gzip`).then(e=>r(null,e),e=>r(e instanceof Error?e:Error(String(e)),new Uint8Array))}function deflate(e,t,n){let r=typeof t==`function`?t:n;compress(toUint8Array$1(e),`deflate`).then(e=>r(null,e),e=>r(e instanceof Error?e:Error(String(e)),new Uint8Array))}function inflate(e,t,n){let r=typeof t==`function`?t:n;decompress(toUint8Array$1(e),`deflate`).then(e=>r(null,e),e=>r(e instanceof Error?e:Error(String(e)),new Uint8Array))}function deflateRaw(e,t,n){let r=typeof t==`function`?t:n;compress(toUint8Array$1(e),`deflate-raw`).then(e=>r(null,e),e=>r(e instanceof Error?e:Error(String(e)),new Uint8Array))}function inflateRaw(e,t,n){let r=typeof t==`function`?t:n;decompress(toUint8Array$1(e),`deflate-raw`).then(e=>r(null,e),e=>r(e instanceof Error?e:Error(String(e)),new Uint8Array))}function gzipSync(e,t){return compressWithGio(toUint8Array$1(e),`gzip`)}function gunzipSync(e,t){return decompressWithGio(toUint8Array$1(e),`gzip`)}function deflateSync(e,t){return compressWithGio(toUint8Array$1(e),`deflate`)}function inflateSync(e,t){return decompressWithGio(toUint8Array$1(e),`deflate`)}function deflateRawSync(e,t){return compressWithGio(toUint8Array$1(e),`deflate-raw`)}function inflateRawSync(e,t){return decompressWithGio(toUint8Array$1(e),`deflate-raw`)}function brotliCompress(e,t,n){(typeof t==`function`?t:n)(Error(`brotliCompress: Brotli is not supported in this environment`),ti)}function brotliDecompress(e,t,n){(typeof t==`function`?t:n)(Error(`brotliDecompress: Brotli is not supported in this environment`),ti)}function brotliCompressSync(e,t){throw Error(`brotliCompressSync: Brotli is not supported in this environment`)}function brotliDecompressSync(e,t){throw Error(`brotliDecompressSync: Brotli is not supported in this environment`)}function zstdCompress(e,t,n){let r=typeof t==`function`?t:n,i=Error(`zstdCompress: Zstd is not supported in this environment`);i.code=`ERR_UNSUPPORTED_OPERATION`,r(i,ti)}function zstdDecompress(e,t,n){let r=typeof t==`function`?t:n,i=Error(`zstdDecompress: Zstd is not supported in this environment`);i.code=`ERR_UNSUPPORTED_OPERATION`,r(i,ti)}function zstdCompressSync(e,t){let n=Error(`zstdCompressSync: Zstd is not supported in this environment`);throw n.code=`ERR_UNSUPPORTED_OPERATION`,n}function zstdDecompressSync(e,t){let n=Error(`zstdDecompressSync: Zstd is not supported in this environment`);throw n.code=`ERR_UNSUPPORTED_OPERATION`,n}var ei,ti,ni,ri,ii=__esmMin(()=>{Qr(),N(),A(),ei=globalThis.CompressionStream!==void 0,__name(toUint8Array$1,`toUint8Array`),ti=new Uint8Array,ni={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_VERSION_ERROR:-6,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_DEFLATED:8},ri={gzip,gunzip,deflate,inflate,deflateRaw,inflateRaw,gzipSync,gunzipSync,deflateSync,inflateSync,deflateRawSync,inflateRawSync,brotliCompress,brotliDecompress,brotliCompressSync,brotliDecompressSync,zstdCompress,zstdDecompress,zstdCompressSync,zstdDecompressSync,Gzip,Gunzip,Deflate,Inflate,DeflateRaw,InflateRaw,Unzip,BrotliCompress,BrotliDecompress,ZstdCompress,ZstdDecompress,createGzip,createGunzip,createDeflate,createInflate,createDeflateRaw,createInflateRaw,createUnzip,createBrotliCompress,createBrotliDecompress,createZstdCompress,createZstdDecompress,constants:ni}});const ai=new Set([`gzip`,`deflate`,`deflate-raw`]);function validateFormat(e){if(!ai.has(e))throw TypeError(`Unsupported compression format: '${e}'. Supported formats: 'gzip', 'deflate', 'deflate-raw'.`);return e}const oi=typeof globalThis.CompressionStream==`function`&&typeof globalThis.DecompressionStream==`function`;let si=!1,ci,li,ui,di,fi,pi;async function loadZlib(){if(si)return;let e=await Promise.resolve().then(()=>(ii(),$r));ci=e.gzipSync,li=e.gunzipSync,ui=e.deflateSync,di=e.inflateSync,fi=e.deflateRawSync,pi=e.inflateRawSync,si=!0}function getCompressFn(e){switch(e){case`gzip`:return e=>ci(e);case`deflate`:return e=>ui(e);case`deflate-raw`:return e=>fi(e)}}function getDecompressFn(e){switch(e){case`gzip`:return e=>li(e);case`deflate`:return e=>di(e);case`deflate-raw`:return e=>pi(e)}}function concatChunks(e){if(e.length===1)return e[0];let t=0;for(let n of e)t+=n.length;let n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.length;return n}let mi,hi;if(oi)mi=globalThis.CompressionStream,hi=globalThis.DecompressionStream;else{let e=loadZlib();mi=class CompressionStream{readable;writable;constructor(t){let n=validateFormat(t),r=[],i=new yr({transform(e){r.push(e)},async flush(t){try{await e;let i=getCompressFn(n)(concatChunks(r));i.length>0&&t.enqueue(i)}catch(e){t.error(e)}}});this.readable=i.readable,this.writable=i.writable}},hi=class DecompressionStream{readable;writable;constructor(t){let n=validateFormat(t),r=[],i=new yr({transform(e){r.push(e)},async flush(t){try{await e;let i=getDecompressFn(n)(concatChunks(r));i.length>0&&t.enqueue(i)}catch(e){t.error(e)}}});this.readable=i.readable,this.writable=i.writable}}}const gi=globalThis;globalThis.CompressionStream===void 0&&(gi.CompressionStream=mi),globalThis.DecompressionStream===void 0&&(gi.DecompressionStream=hi);const _i=globalThis;globalThis.DOMException===void 0&&(_i.DOMException=Be);const vi=globalThis;globalThis.ByteLengthQueuingStrategy===void 0&&(vi.ByteLengthQueuingStrategy=br),globalThis.CountQueuingStrategy===void 0&&(vi.CountQueuingStrategy=xr);const yi=globalThis;function isNativeStreamUsable$2(e,t){try{return typeof e==`function`?typeof e.prototype?.[t]==`function`:!1}catch{return!1}}__name(isNativeStreamUsable$2,`isNativeStreamUsable`),isNativeStreamUsable$2(globalThis.ReadableStream,`getReader`)||(yi.ReadableStream=_r),yi.ReadableStreamBYOBReader===void 0&&(yi.ReadableStreamBYOBReader=ReadableStreamBYOBReader),yi.ReadableStreamBYOBRequest===void 0&&(yi.ReadableStreamBYOBRequest=ReadableStreamBYOBRequest),yi.ReadableByteStreamController===void 0&&(yi.ReadableByteStreamController=ReadableByteStreamController),yi.ReadableStreamDefaultController===void 0&&(yi.ReadableStreamDefaultController=ReadableStreamDefaultController),yi.ReadableStreamDefaultReader===void 0&&(yi.ReadableStreamDefaultReader=ReadableStreamDefaultReader);const bi=globalThis;globalThis.TextEncoderStream===void 0&&(bi.TextEncoderStream=Sr),globalThis.TextDecoderStream===void 0&&(bi.TextDecoderStream=Cr);function isNativeStreamUsable$1(e,t){try{return typeof e==`function`?typeof e.prototype?.[t]==`function`:!1}catch{return!1}}if(__name(isNativeStreamUsable$1,`isNativeStreamUsable`),!isNativeStreamUsable$1(globalThis.TransformStream,`readable`)){let e=globalThis;e.TransformStream=yr}function isNativeStreamUsable(e,t){try{return typeof e==`function`?typeof e.prototype?.[t]==`function`:!1}catch{return!1}}if(!isNativeStreamUsable(globalThis.WritableStream,`getWriter`)){let e=globalThis;e.WritableStream=vr}var CryptoKey=class{type;extractable;algorithm;usages;_handle;constructor(e,t,n,r,i){this.type=e,this.extractable=t,this.algorithm=Object.freeze({...n}),this.usages=Object.freeze([...r]),this._handle=i}get[Symbol.toStringTag](){return`CryptoKey`}};function normalizeAlgorithm$1(e){if(typeof e==`string`)return{name:e};if(!e||typeof e.name!=`string`)throw TypeError(`Algorithm must have a name property`);return e}__name(normalizeAlgorithm$1,`normalizeAlgorithm`);const xi={"SHA-1":`sha1`,"SHA-256":`sha256`,"SHA-384":`sha384`,"SHA-512":`sha512`};function toNodeHashName(e){let t=xi[e.toUpperCase()]||xi[e];if(!t)throw new Be(`Unrecognized hash name: ${e}`,`NotSupportedError`);return t}const Si={"P-256":`prime256v1`,"P-384":`secp384r1`,"P-521":`secp521r1`};function toNodeCurveName(e){let t=Si[e];if(!t)throw new Be(`Unrecognized curve name: ${e}`,`NotSupportedError`);return t}function hashSize$1(e){switch(toNodeHashName(e)){case`sha1`:return 20;case`sha256`:return 32;case`sha384`:return 48;case`sha512`:return 64;default:throw new Be(`Unsupported hash: ${e}`,`NotSupportedError`)}}__name(hashSize$1,`hashSize`);function validateUsages(e,t){for(let n of e)if(!t.includes(n))throw new Be(`Invalid key usage: ${n}`,`SyntaxError`);if(e.length===0)throw new Be(`Key usages must not be empty`,`SyntaxError`)}function checkUsage(e,t){if(!e.usages.includes(t))throw new Be(`Key does not support the '${t}' usage`,`InvalidAccessError`)}const Ci=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,wi=new Uint8Array(128);for(let e=0;e<64;e++)wi[Ci.charCodeAt(e)]=e;function bytesToBase64(e){let t=``,n=e.length;for(let r=0;r<n;r+=3){let i=e[r],a=r+1<n?e[r+1]:0,o=r+2<n?e[r+2]:0;t+=Ci[i>>2&63],t+=Ci[(i<<4|a>>4)&63],t+=r+1<n?Ci[(a<<2|o>>6)&63]:`=`,t+=r+2<n?Ci[o&63]:`=`}return t}function base64ToBytes(e){let t=e;for(;t.endsWith(`=`);)t=t.slice(0,-1);let n=[],r=0,i=0;for(let e=0;e<t.length;e++)i=i<<6|wi[t.charCodeAt(e)],r+=6,r>=8&&(r-=8,n.push(i>>r&255));return new Uint8Array(n)}function base64urlEncode(e){return bytesToBase64(e).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=+$/,``)}function base64urlDecode(e){let t=e.replace(/-/g,`+`).replace(/_/g,`/`);for(;t.length%4;)t+=`=`;return base64ToBytes(t)}function toUint8Array(e){if(e instanceof Uint8Array)return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw TypeError(`Expected BufferSource`)}var Ti,Ei=__esmMin(()=>{Ti={RSA_PKCS1_PADDING:1,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_PKCS1_PSS_PADDING:6,DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8}});function timingSafeEqual(e,t){if(e.length!==t.length)throw RangeError(`Input buffers must have the same byte length`);let n=0;for(let r=0;r<e.length;r++)n|=e[r]^t[r];return n===0}var Di=__esmMin(()=>{});function gmul(e,t){let n=0;for(let r=0;r<8;r++){t&1&&(n^=e);let r=e&128;e=e<<1&255,r&&(e^=27),t>>=1}return n}function keyExpansion(e){let t=e.length/4,n=t+6,r=4*(n+1),i=Array.from({length:r});for(let n=0;n<t;n++)i[n]=new Uint8Array([e[4*n],e[4*n+1],e[4*n+2],e[4*n+3]]);for(let e=t;e<r;e++){let n=new Uint8Array(i[e-1]);e%t===0?n=new Uint8Array([Oi[n[1]]^Ai[e/t-1],Oi[n[2]],Oi[n[3]],Oi[n[0]]]):t>6&&e%t===4&&(n=new Uint8Array([Oi[n[0]],Oi[n[1]],Oi[n[2]],Oi[n[3]]])),i[e]=new Uint8Array(4);for(let r=0;r<4;r++)i[e][r]=i[e-t][r]^n[r]}let a=[];for(let e=0;e<=n;e++){let t=new Uint8Array(16);for(let n=0;n<4;n++)t[4*n]=i[4*e+n][0],t[4*n+1]=i[4*e+n][1],t[4*n+2]=i[4*e+n][2],t[4*n+3]=i[4*e+n][3];a.push(t)}return a}function aesEncryptBlock(e,t){let n=new Uint8Array(e),r=t.length-1;for(let e=0;e<16;e++)n[e]^=t[0][e];for(let e=1;e<r;e++){for(let e=0;e<16;e++)n[e]=Oi[n[e]];let r=n[1];n[1]=n[5],n[5]=n[9],n[9]=n[13],n[13]=r;let i=n[2],a=n[6];n[2]=n[10],n[6]=n[14],n[10]=i,n[14]=a;let o=n[15];n[15]=n[11],n[11]=n[7],n[7]=n[3],n[3]=o;for(let e=0;e<4;e++){let t=e*4,r=n[t],i=n[t+1],a=n[t+2],o=n[t+3];n[t]=gmul(2,r)^gmul(3,i)^a^o,n[t+1]=r^gmul(2,i)^gmul(3,a)^o,n[t+2]=r^i^gmul(2,a)^gmul(3,o),n[t+3]=gmul(3,r)^i^a^gmul(2,o)}for(let r=0;r<16;r++)n[r]^=t[e][r]}for(let e=0;e<16;e++)n[e]=Oi[n[e]];let i=n[1];n[1]=n[5],n[5]=n[9],n[9]=n[13],n[13]=i;let a=n[2],o=n[6];n[2]=n[10],n[6]=n[14],n[10]=a,n[14]=o;let s=n[15];n[15]=n[11],n[11]=n[7],n[7]=n[3],n[3]=s;for(let e=0;e<16;e++)n[e]^=t[r][e];return n}function aesDecryptBlock(e,t){let n=new Uint8Array(e),r=t.length-1;for(let e=0;e<16;e++)n[e]^=t[r][e];for(let e=r-1;e>0;e--){let r=n[13];n[13]=n[9],n[9]=n[5],n[5]=n[1],n[1]=r;let i=n[10],a=n[14];n[10]=n[2],n[14]=n[6],n[2]=i,n[6]=a;let o=n[3];n[3]=n[7],n[7]=n[11],n[11]=n[15],n[15]=o;for(let e=0;e<16;e++)n[e]=ki[n[e]];for(let r=0;r<16;r++)n[r]^=t[e][r];for(let e=0;e<4;e++){let t=e*4,r=n[t],i=n[t+1],a=n[t+2],o=n[t+3];n[t]=gmul(14,r)^gmul(11,i)^gmul(13,a)^gmul(9,o),n[t+1]=gmul(9,r)^gmul(14,i)^gmul(11,a)^gmul(13,o),n[t+2]=gmul(13,r)^gmul(9,i)^gmul(14,a)^gmul(11,o),n[t+3]=gmul(11,r)^gmul(13,i)^gmul(9,a)^gmul(14,o)}}let i=n[13];n[13]=n[9],n[9]=n[5],n[5]=n[1],n[1]=i;let a=n[10],o=n[14];n[10]=n[2],n[14]=n[6],n[2]=a,n[6]=o;let s=n[3];n[3]=n[7],n[7]=n[11],n[11]=n[15],n[15]=s;for(let e=0;e<16;e++)n[e]=ki[n[e]];for(let e=0;e<16;e++)n[e]^=t[0][e];return n}function incrementCounter(e){for(let t=15;t>=0&&++e[t]===0;t--);}function gcmIncrementCounter(e){for(let t=15;t>=12&&++e[t]===0;t--);}function gfMul(e,t){let n=new Uint8Array(16),r=new Uint8Array(e);for(let e=0;e<128;e++){if(t[e>>>3]&1<<7-(e&7))for(let e=0;e<16;e++)n[e]^=r[e];let i=r[15]&1;for(let e=15;e>0;e--)r[e]=r[e]>>>1|(r[e-1]&1)<<7;r[0]>>>=1,i&&(r[0]^=225)}return n}function ghash(e,t,n){let r=new Uint8Array(16),i=Math.ceil(t.length/16)||0;for(let n=0;n<i;n++){let i=n*16,a=Math.min(i+16,t.length);for(let e=0;e<16;e++){let n=i+e;n<a&&(r[e]^=t[n])}let o=gfMul(r,e);r.set(o)}let a=Math.ceil(n.length/16)||0;for(let t=0;t<a;t++){let i=t*16,a=Math.min(i+16,n.length);for(let e=0;e<16;e++){let t=i+e;t<a&&(r[e]^=n[t])}let o=gfMul(r,e);r.set(o)}let o=new Uint8Array(16),s=t.length*8,c=n.length*8,l=Math.floor(s/4294967296),u=s>>>0;o[0]=l>>>24&255,o[1]=l>>>16&255,o[2]=l>>>8&255,o[3]=l&255,o[4]=u>>>24&255,o[5]=u>>>16&255,o[6]=u>>>8&255,o[7]=u&255;let d=Math.floor(c/4294967296),p=c>>>0;o[8]=d>>>24&255,o[9]=d>>>16&255,o[10]=d>>>8&255,o[11]=d&255,o[12]=p>>>24&255,o[13]=p>>>16&255,o[14]=p>>>8&255,o[15]=p&255;for(let e=0;e<16;e++)r[e]^=o[e];let m=gfMul(r,e);return r.set(m),r}var Oi,ki,Ai,ji=__esmMin(()=>{Oi=new Uint8Array([99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22]),ki=new Uint8Array([82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125]),Ai=[1,2,4,8,16,32,64,128,27,54]});function parseAlgorithm(e){let t=e.toLowerCase().match(/^aes-(128|192|256)-(cbc|ctr|ecb|cfb|ofb|gcm)$/);if(!t)throw Error(`Unsupported cipher algorithm: ${e}`);let n=parseInt(t[1]),r=t[2];return{keySize:n/8,ivSize:r===`ecb`?0:r===`gcm`?12:16,mode:r}}function toBuffer$2(e,t){return typeof e==`string`?q.from(e,t||`utf8`):q.from(e)}function encodeOutput(e,t){return t?q.from(e).toString(t):q.from(e)}function incompleteUtf8Tail(e){if(e.length===0)return 0;let t=e.length;for(let n=1;n<=Math.min(4,t);n++){let r=e[t-n];if(!(r&128))return 0;if((r&192)==128)continue;let i;if((r&224)==192)i=2;else if((r&240)==224)i=3;else if((r&248)==240)i=4;else return 0;return n<i?n:0}return 0}function pkcs7Pad(e){let t=16-e.length%16,n=new Uint8Array(e.length+t);n.set(e);for(let r=e.length;r<n.length;r++)n[r]=t;return n}function pkcs7Unpad(e){if(e.length===0||e.length%16!=0)throw Error(`bad decrypt`);let t=e[e.length-1];if(t===0||t>16)throw Error(`bad decrypt`);for(let n=e.length-t;n<e.length;n++)if(e[n]!==t)throw Error(`bad decrypt`);return new Uint8Array(e.slice(0,e.length-t))}var Mi=__esmMin(()=>{J(),__name(toBuffer$2,`toBuffer`)});function createCipher(e,t){throw Error(`crypto.createCipher() is deprecated. Use createCipheriv() instead.`)}function createCipheriv(e,t,n){return new Cipher(e,typeof t==`string`?q.from(t):new Uint8Array(t),n==null?null:typeof n==`string`?q.from(n):new Uint8Array(n))}function createDecipher(e,t){throw Error(`crypto.createDecipher() is deprecated. Use createDecipheriv() instead.`)}function createDecipheriv(e,t,n){return new Decipher(e,typeof t==`string`?q.from(t):new Uint8Array(t),n==null?null:typeof n==`string`?q.from(n):new Uint8Array(n))}function getCiphers(){return[`aes-128-cbc`,`aes-128-ecb`,`aes-192-cbc`,`aes-192-ecb`,`aes-256-cbc`,`aes-256-ecb`,`aes-128-ctr`,`aes-192-ctr`,`aes-256-ctr`,`aes-128-cfb`,`aes-192-cfb`,`aes-256-cfb`,`aes-128-gcm`,`aes-192-gcm`,`aes-256-gcm`]}var CipherBase,Cipher,Decipher,Ni=__esmMin(()=>{ji(),Mi(),J(),CipherBase=class{_roundKeys;_iv;_mode;_buffer=new Uint8Array;_autoPadding=!0;_finalized=!1;constructor(e,t,n){let r=parseAlgorithm(e);if(t.length!==r.keySize)throw Error(`Invalid key length ${t.length}, expected ${r.keySize} for ${e}`);if(r.ivSize>0&&(!n||n.length!==r.ivSize))throw Error(`Invalid IV length ${n?.length??0}, expected ${r.ivSize} for ${e}`);this._roundKeys=keyExpansion(t),this._iv=n?new Uint8Array(n):new Uint8Array(16),this._mode=r.mode}setAutoPadding(e){return this._autoPadding=e,this}},Cipher=class extends CipherBase{_prevBlock;_counter;_gcmH=null;_gcmJ0=null;_gcmAAD=new Uint8Array;_gcmCiphertext=[];_gcmCiphertextLen=0;_gcmAuthTag=null;_gcmAADSet=!1;constructor(e,t,n){super(e,t,n),this._prevBlock=new Uint8Array(this._iv),this._mode===`gcm`?(this._gcmH=aesEncryptBlock(new Uint8Array(16),this._roundKeys),this._gcmJ0=new Uint8Array(16),this._gcmJ0.set(this._iv.subarray(0,12)),this._gcmJ0[15]=1,this._counter=new Uint8Array(this._gcmJ0),gcmIncrementCounter(this._counter)):this._counter=new Uint8Array(this._iv)}setAAD(e){if(this._mode!==`gcm`)throw Error(`setAAD is only supported in GCM mode`);if(this._gcmCiphertextLen>0)throw Error(`setAAD must be called before update()`);return this._gcmAAD=new Uint8Array(e),this._gcmAADSet=!0,this}getAuthTag(){if(this._mode!==`gcm`)throw Error(`getAuthTag is only supported in GCM mode`);if(!this._gcmAuthTag)throw Error(`getAuthTag must be called after final()`);return q.from(this._gcmAuthTag)}update(e,t,n){let r=toBuffer$2(e,t),i=new Uint8Array(this._buffer.length+r.length);if(i.set(this._buffer),i.set(r,this._buffer.length),this._mode===`gcm`){let e=this._processGcmEncrypt(i);return this._buffer=new Uint8Array,encodeOutput(e,n)}if(this._mode===`ctr`||this._mode===`cfb`||this._mode===`ofb`){let e=this._processStream(i);return this._buffer=new Uint8Array,encodeOutput(e,n)}let a=Math.floor(i.length/16)*16,o=[];for(let e=0;e<a;e+=16){let t=i.slice(e,e+16);o.push(this._encryptBlock(t))}this._buffer=i.slice(a);let s=new Uint8Array(o.length*16);for(let e=0;e<o.length;e++)s.set(o[e],e*16);return encodeOutput(s,n)}final(e){if(this._finalized)throw Error(`Cipher already finalized`);if(this._finalized=!0,this._mode===`gcm`){let t=new Uint8Array;this._buffer.length>0&&(t=this._processGcmEncrypt(this._buffer),this._buffer=new Uint8Array);let n=new Uint8Array(this._gcmCiphertextLen),r=0;for(let e of this._gcmCiphertext)n.set(e,r),r+=e.length;let i=ghash(this._gcmH,this._gcmAAD,n),a=aesEncryptBlock(this._gcmJ0,this._roundKeys),o=new Uint8Array(16);for(let e=0;e<16;e++)o[e]=i[e]^a[e];return this._gcmAuthTag=q.from(o),encodeOutput(t,e)}if(this._mode===`ctr`||this._mode===`cfb`||this._mode===`ofb`){if(this._buffer.length>0){let t=this._processStream(this._buffer);return this._buffer=new Uint8Array,encodeOutput(t,e)}return encodeOutput(new Uint8Array,e)}let t=this._buffer;if(this._autoPadding)t=pkcs7Pad(t);else if(t.length%16!=0)throw Error(`data not multiple of block size`);let n=[];for(let e=0;e<t.length;e+=16)n.push(this._encryptBlock(t.slice(e,e+16)));if(this._buffer=new Uint8Array,n.length===0)return encodeOutput(new Uint8Array,e);let r=new Uint8Array(n.length*16);for(let e=0;e<n.length;e++)r.set(n[e],e*16);return encodeOutput(r,e)}_encryptBlock(e){if(this._mode===`cbc`){let t=new Uint8Array(16);for(let n=0;n<16;n++)t[n]=e[n]^this._prevBlock[n];let n=aesEncryptBlock(t,this._roundKeys);return this._prevBlock=n,n}else if(this._mode===`ecb`)return aesEncryptBlock(e,this._roundKeys);throw Error(`Block encryption not supported for mode: ${this._mode}`)}_processStream(e){let t=new Uint8Array(e.length);for(let n=0;n<e.length;n+=16){let r=aesEncryptBlock(this._counter,this._roundKeys),i=Math.min(16,e.length-n);for(let a=0;a<i;a++)t[n+a]=e[n+a]^r[a];incrementCounter(this._counter)}return t}_processGcmEncrypt(e){let t=new Uint8Array(e.length);for(let n=0;n<e.length;n+=16){let r=aesEncryptBlock(this._counter,this._roundKeys),i=Math.min(16,e.length-n);for(let a=0;a<i;a++)t[n+a]=e[n+a]^r[a];gcmIncrementCounter(this._counter)}return this._gcmCiphertext.push(new Uint8Array(t)),this._gcmCiphertextLen+=t.length,t}},Decipher=class extends CipherBase{_prevBlock;_counter;_pendingUtf8=new Uint8Array;_gcmH=null;_gcmJ0=null;_gcmAAD=new Uint8Array;_gcmCiphertext=[];_gcmCiphertextLen=0;_gcmExpectedTag=null;_gcmAADSet=!1;constructor(e,t,n){super(e,t,n),this._prevBlock=new Uint8Array(this._iv),this._mode===`gcm`?(this._gcmH=aesEncryptBlock(new Uint8Array(16),this._roundKeys),this._gcmJ0=new Uint8Array(16),this._gcmJ0.set(this._iv.subarray(0,12)),this._gcmJ0[15]=1,this._counter=new Uint8Array(this._gcmJ0),gcmIncrementCounter(this._counter)):this._counter=new Uint8Array(this._iv)}setAAD(e){if(this._mode!==`gcm`)throw Error(`setAAD is only supported in GCM mode`);if(this._gcmCiphertextLen>0)throw Error(`setAAD must be called before update()`);return this._gcmAAD=new Uint8Array(e),this._gcmAADSet=!0,this}setAuthTag(e){if(this._mode!==`gcm`)throw Error(`setAuthTag is only supported in GCM mode`);return this._gcmExpectedTag=q.from(e),this}_encodeWithUtf8Handling(e,t,n){if(!t||t!==`utf8`&&t!==`utf-8`)return encodeOutput(e,t);let r;if(this._pendingUtf8.length>0?(r=new Uint8Array(this._pendingUtf8.length+e.length),r.set(this._pendingUtf8),r.set(e,this._pendingUtf8.length),this._pendingUtf8=new Uint8Array):r=e,!n){let e=incompleteUtf8Tail(r);e>0&&(this._pendingUtf8=new Uint8Array(r.slice(r.length-e)),r=new Uint8Array(r.slice(0,r.length-e)))}return q.from(r).toString(`utf8`)}update(e,t,n){let r=toBuffer$2(e,t),i=new Uint8Array(this._buffer.length+r.length);if(i.set(this._buffer),i.set(r,this._buffer.length),this._mode===`gcm`){this._gcmCiphertext.push(new Uint8Array(i)),this._gcmCiphertextLen+=i.length;let e=this._processGcmDecrypt(i);return this._buffer=new Uint8Array,this._encodeWithUtf8Handling(e,n,!1)}if(this._mode===`ctr`||this._mode===`cfb`||this._mode===`ofb`){let e=this._processStream(i);return this._buffer=new Uint8Array,this._encodeWithUtf8Handling(e,n,!1)}let a=Math.floor(i.length/16);if(a===0)return this._buffer=i,this._encodeWithUtf8Handling(new Uint8Array,n,!1);let o=(this._autoPadding?a-1:a)*16,s=[];for(let e=0;e<o;e+=16){let t=i.slice(e,e+16);s.push(this._decryptBlock(t))}this._buffer=i.slice(o);let c=new Uint8Array(s.length*16);for(let e=0;e<s.length;e++)c.set(s[e],e*16);return this._encodeWithUtf8Handling(c,n,!1)}final(e){if(this._finalized)throw Error(`Decipher already finalized`);if(this._finalized=!0,this._mode===`gcm`){let t=new Uint8Array;if(this._buffer.length>0&&(this._gcmCiphertext.push(new Uint8Array(this._buffer)),this._gcmCiphertextLen+=this._buffer.length,t=this._processGcmDecrypt(this._buffer),this._buffer=new Uint8Array),!this._gcmExpectedTag)throw Error(`Unsupported state or unable to authenticate data`);let n=new Uint8Array(this._gcmCiphertextLen),r=0;for(let e of this._gcmCiphertext)n.set(e,r),r+=e.length;let i=ghash(this._gcmH,this._gcmAAD,n),a=aesEncryptBlock(this._gcmJ0,this._roundKeys),o=new Uint8Array(16);for(let e=0;e<16;e++)o[e]=i[e]^a[e];let s=this._gcmExpectedTag,c=Math.min(s.length,16),l=0;for(let e=0;e<c;e++)l|=o[e]^s[e];if(l!==0)throw Error(`Unsupported state or unable to authenticate data`);return this._encodeWithUtf8Handling(t,e,!0)}if(this._mode===`ctr`||this._mode===`cfb`||this._mode===`ofb`){if(this._buffer.length>0){let t=this._processStream(this._buffer);return this._buffer=new Uint8Array,this._encodeWithUtf8Handling(t,e,!0)}return this._encodeWithUtf8Handling(new Uint8Array,e,!0)}if(this._buffer.length===0)return this._encodeWithUtf8Handling(new Uint8Array,e,!0);if(this._buffer.length%16!=0)throw Error(`bad decrypt`);let t=[];for(let e=0;e<this._buffer.length;e+=16)t.push(this._decryptBlock(this._buffer.slice(e,e+16)));let n=new Uint8Array(t.length*16);for(let e=0;e<t.length;e++)n.set(t[e],e*16);let r=this._autoPadding?pkcs7Unpad(n):n;return this._buffer=new Uint8Array,this._encodeWithUtf8Handling(r,e,!0)}_decryptBlock(e){if(this._mode===`cbc`){let t=aesDecryptBlock(e,this._roundKeys),n=new Uint8Array(16);for(let e=0;e<16;e++)n[e]=t[e]^this._prevBlock[e];return this._prevBlock=new Uint8Array(e),n}else if(this._mode===`ecb`)return aesDecryptBlock(e,this._roundKeys);throw Error(`Block decryption not supported for mode: ${this._mode}`)}_processStream(e){let t=new Uint8Array(e.length);for(let n=0;n<e.length;n+=16){let r=aesEncryptBlock(this._counter,this._roundKeys),i=Math.min(16,e.length-n);for(let a=0;a<i;a++)t[n+a]=e[n+a]^r[a];incrementCounter(this._counter)}return t}_processGcmDecrypt(e){let t=new Uint8Array(e.length);for(let n=0;n<e.length;n+=16){let r=aesEncryptBlock(this._counter,this._roundKeys),i=Math.min(16,e.length-n);for(let a=0;a<i;a++)t[n+a]=e[n+a]^r[a];gcmIncrementCounter(this._counter)}return t}}});function fillRandom(e){if(Pi)for(let t=0;t<e.length;t+=65536){let n=Math.min(e.length-t,65536),r=new Uint8Array(e.buffer,e.byteOffset+t,n);globalThis.crypto.getRandomValues(r)}else try{let t=imports.gi.GLib;for(let n=0;n<e.length;n++)e[n]=t.random_int_range(0,256)}catch{for(let t=0;t<e.length;t++)e[t]=Math.floor(Math.random()*256)}}function randomBytes(e,t){if(typeof e!=`number`||e<0||!Number.isInteger(e))throw TypeError(`The "size" argument must be a non-negative integer. Received ${e}`);try{let n=q.alloc(e);if(e>0&&fillRandom(new Uint8Array(n.buffer,n.byteOffset,n.byteLength)),t)t(null,n);else return n}catch(e){if(t)t(e,q.alloc(0));else throw e}}function randomFillSync(e,t=0,n){let r=n??e.length-t;if(t<0||t>e.length)throw RangeError(`The value of "offset" is out of range. Received ${t}`);if(r<0||t+r>e.length)throw RangeError(`The value of "size" is out of range. Received ${r}`);if(r>0){let n=(e instanceof q,e.byteOffset);fillRandom(new Uint8Array(e.buffer,n+t,r))}return e}function randomFill(e,t,n,r){let i,a,o;typeof t==`function`?(o=t,i=0,a=e.length):typeof n==`function`?(o=n,i=t,a=e.length-t):(o=r,i=t,a=n);try{randomFillSync(e,i,a),o(null,e)}catch(t){o(t,e)}}function randomUUID(){if(Pi&&typeof globalThis.crypto.randomUUID==`function`)return globalThis.crypto.randomUUID();let e=new Uint8Array(16);fillRandom(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t=Array.from(e,e=>e.toString(16).padStart(2,`0`)).join(``);return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20)}`}function randomInt(e,t,n){let r,i,a;if(typeof t==`function`?(a=t,i=e,r=0):typeof t==`number`?(r=e,i=t,a=n):(i=e,r=0,a=n),!Number.isInteger(r))throw TypeError(`The "min" argument must be a safe integer. Received ${r}`);if(!Number.isInteger(i))throw TypeError(`The "max" argument must be a safe integer. Received ${i}`);if(r>=i)throw RangeError(`The value of "min" must be less than "max". Received min: ${r}, max: ${i}`);let o=i-r,s=new Uint32Array(1);fillRandom(new Uint8Array(s.buffer));let c=r+s[0]%o;if(a)a(null,c);else return c}var Pi,Fi=__esmMin(()=>{J(),Pi=globalThis.crypto!==void 0&&typeof globalThis.crypto.getRandomValues==`function`});function modPow(e,t,n){if(n===1n)return 0n;e=(e%n+n)%n;let r=1n;for(;t>0n;)t&1n&&(r=r*e%n),t>>=1n,e=e*e%n;return r}function bigIntToBytes(e,t){let n=new Uint8Array(t),r=e;for(let e=t-1;e>=0;e--)n[e]=Number(r&255n),r>>=8n;return n}function bytesToBigInt(e){let t=0n;for(let n=0;n<e.length;n++)t=t<<8n|BigInt(e[n]);return t}var Ii=__esmMin(()=>{});function bigIntToBuffer(e){if(e===0n)return q.from([0]);let t=e.toString(16);return t.length%2!=0&&(t=`0`+t),q.from(t,`hex`)}function bufferToBigInt(e){if(e.length===0)return 0n;let t=q.from(e).toString(`hex`);return t.length===0?0n:BigInt(`0x`+t)}function bitLength(e){return e===0n?0:e.toString(2).length}function simpleSieve(e){for(let t of Ri){let n=BigInt(t);if(e%n===0n)return e===n}return!0}function fermatTest(e){return modPow(2n,e-1n,e)===1n}function millerRabinTest(e){if(e<2n)return!1;if(e===2n||e===3n)return!0;if(e%2n==0n)return!1;let t=e-1n,n=0;for(;t%2n==0n;)t/=2n,n++;for(let r of[2n,3n,5n,7n,11n,13n]){if(r>=e)continue;let i=modPow(r,t,e);if(i===1n||i===e-1n)continue;let a=!0;for(let t=0;t<n-1;t++)if(i=modPow(i,2n,e),i===e-1n){a=!1;break}if(a)return!1}return!0}function checkPrime(e,t){let n=t.toString(`hex`),r=0;if(e%2n==0n||!simpleSieve(e)||!fermatTest(e)||!millerRabinTest(e))return r+=1,n===`02`||n===`05`?r+=8:r+=4,r;switch(millerRabinTest(e>>1n)||(r+=2),n){case`02`:e%24n!=11n&&(r+=8);break;case`05`:{let t=e%10n;t!==3n&&t!==7n&&(r+=8)}break;default:r+=4}return r}function getCachedCheckPrime(e,t){let n=t.toString(`hex`)+`_`+e.toString(16);if(n in zi)return zi[n];let r=checkPrime(e,t);return zi[n]=r,r}function formatReturnValue$1(e,t){let n=bigIntToBuffer(e);return t?n.toString(t):n}function generatePrime(e,t){let n=bufferToBigInt(t);if(e<16)return n===2n||n===5n?q.from([140,123]):q.from([140,39]);let r=Math.ceil(e/8),i=2n,a=4n;for(;;){let t=bufferToBigInt(randomBytes(r));for(;bitLength(t)>e;)t>>=1n;if(t%i===0n&&(t+=1n),t&i||(t+=i),n===i)for(;t%24n!=11n;)t+=a;else if(n===5n)for(;t%10n!=3n;)t+=a;let o=t>>1n;if(simpleSieve(o)&&simpleSieve(t)&&fermatTest(o)&&fermatTest(t)&&millerRabinTest(o)&&millerRabinTest(t))return bigIntToBuffer(t)}}function createDiffieHellman(e,t,n,r){if(t!==void 0&&typeof t!=`number`&&(q.isBuffer(t)||t instanceof Uint8Array||typeof t==`string`&&!(t in Bi)))return createDiffieHellman(e,`binary`,t,n);let i=t||`binary`,a=r||`binary`,o=q.from([2]);if(n!==void 0&&(typeof n==`number`?(o=q.alloc(1),o[0]=n):o=q.isBuffer(n)?n:q.from(n,a)),typeof e==`number`)return new DiffieHellman(generatePrime(e,o),o,!0);let s;return s=q.isBuffer(e)?e:e instanceof Uint8Array?q.from(e):q.from(e,i),new DiffieHellman(s,o,!0)}function getDiffieHellman(e){let t=Li[e];if(!t)throw Error(`Unknown group: ${e}. Supported groups: ${Object.keys(Li).join(`, `)}`);return new DiffieHellman(q.from(t.prime,`hex`),q.from(t.gen,`hex`),!1)}var Li,Ri,zi,DiffieHellman,Bi,Vi,Hi,Ui=__esmMin(()=>{Ii(),Fi(),J(),Li={modp1:{gen:`02`,prime:`ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff`},modp2:{gen:`02`,prime:`ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff`},modp5:{gen:`02`,prime:`ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff`},modp14:{gen:`02`,prime:`ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff`},modp15:{gen:`02`,prime:`ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff`},modp16:{gen:`02`,prime:`ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff`},modp17:{gen:`02`,prime:`ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff`},modp18:{gen:`02`,prime:`ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff`}},Ri=[];{let e=1e3,t=new Uint8Array(e+1);for(let n=2;n*n<=e;n++)if(!t[n])for(let r=n*n;r<=e;r+=n)t[r]=1;for(let n=2;n<=e;n++)t[n]||Ri.push(n)}zi={},__name(formatReturnValue$1,`formatReturnValue`),DiffieHellman=class{_prime;_generator;_generatorBuf;_primeByteLength;_pubKey;_privKey;_primeCode;_malleable;constructor(e,t,n=!1){this._prime=bufferToBigInt(e),this._generatorBuf=t,this._generator=bufferToBigInt(t),this._primeByteLength=e.length,this._pubKey=void 0,this._privKey=void 0,this._primeCode=void 0,this._malleable=n,n||(this._primeCode=0,this.setPublicKey=void 0,this.setPrivateKey=void 0)}get verifyError(){return typeof this._primeCode!=`number`&&(this._primeCode=getCachedCheckPrime(this._prime,this._generatorBuf)),this._primeCode}generateKeys(e){if(!this._privKey){let e=randomBytes(this._primeByteLength);this._privKey=bufferToBigInt(e)}return this._pubKey=modPow(this._generator,this._privKey,this._prime),this.getPublicKey(e)}computeSecret(e,t,n){let r;r=typeof e==`string`?q.from(e,t||`utf8`):q.from(e);let i=bufferToBigInt(r);if(!this._privKey)throw Error(`You must generate keys before computing a secret`);if(i<=0n||i>=this._prime)throw Error(`Supplied key is too large`);let a=bigIntToBuffer(modPow(i,this._privKey,this._prime)),o=this._primeByteLength;if(a.length<o){let e=q.alloc(o);a.copy(e,o-a.length),a=e}return n?a.toString(n):a}getPrime(e){return formatReturnValue$1(this._prime,e)}getGenerator(e){return formatReturnValue$1(this._generator,e)}getPublicKey(e){if(!this._pubKey)throw Error(`No public key - call generateKeys() first`);return formatReturnValue$1(this._pubKey,e)}getPrivateKey(e){if(!this._privKey)throw Error(`No private key - call generateKeys() first`);return formatReturnValue$1(this._privKey,e)}setPublicKey(e,t){if(!this._malleable)throw Error(`setPublicKey is not available for predefined DH groups`);let n=typeof e==`string`?q.from(e,t||`utf8`):q.from(e);this._pubKey=bufferToBigInt(n)}setPrivateKey(e,t){if(!this._malleable)throw Error(`setPrivateKey is not available for predefined DH groups`);let n=typeof e==`string`?q.from(e,t||`utf8`):q.from(e);this._privKey=bufferToBigInt(n)}},Bi={binary:!0,hex:!0,base64:!0,latin1:!0,utf8:!0,"utf-8":!0,base64url:!0,ascii:!0,ucs2:!0,"ucs-2":!0,utf16le:!0,"utf-16le":!0},Vi=getDiffieHellman,Hi=getDiffieHellman});function mod(e,t){let n=e%t;return n<0n?n+t:n}function modInverse$2(e,t){if(e=mod(e,t),e===0n)throw Error(`No modular inverse for zero`);let[n,r]=[e,t],[i,a]=[1n,0n];for(;r!==0n;){let e=n/r;[n,r]=[r,n-e*r],[i,a]=[a,i-e*a]}if(n!==1n)throw Error(`Modular inverse does not exist`);return mod(i,t)}function pointAdd(e,t,n){if(e===null)return t;if(t===null)return e;let{p:r}=n;if(e.x===t.x)return mod(e.y+t.y,r)===0n?null:pointDouble(e,n);let i=mod(t.x-e.x,r),a=mod(mod(t.y-e.y,r)*modInverse$2(i,r),r),o=mod(a*a-e.x-t.x,r);return{x:o,y:mod(a*(e.x-o)-e.y,r)}}function pointDouble(e,t){if(e===null)return null;let{a:n,p:r}=t;if(e.y===0n)return null;let i=mod(mod(3n*e.x*e.x+n,r)*modInverse$2(mod(2n*e.y,r),r),r),a=mod(i*i-2n*e.x,r);return{x:a,y:mod(i*(e.x-a)-e.y,r)}}function scalarMul(e,t,n){if(t===null||e===0n)return null;let{n:r}=n;if(e=mod(e,r),e===0n)return null;let i=null,a=t,o=e.toString(2);for(let e=0;e<o.length;e++)o[e]===`1`?(i=pointAdd(i,a,n),a=pointDouble(a,n)):(a=pointAdd(i,a,n),i=pointDouble(i,n));return i}function bigintToBuffer(e,t){let n=e.toString(16).padStart(t*2,`0`);return q.from(n,`hex`)}function bufferToBigint(e){let t=q.from(e).toString(`hex`);return t.length===0?0n:BigInt(`0x`+t)}function encodePublicKey(e,t,n=`uncompressed`){if(e===null)throw Error(`Cannot encode the point at infinity`);let r=bigintToBuffer(e.x,t);if(n===`compressed`){let t=e.y%2n==0n?2:3;return q.concat([q.from([t]),r])}let i=bigintToBuffer(e.y,t);if(n===`hybrid`){let t=e.y%2n==0n?6:7;return q.concat([q.from([t]),r,i])}return q.concat([q.from([4]),r,i])}function decodePublicKey(e,t){let n=q.from(e);if(n.length===0)throw Error(`Invalid public key: empty buffer`);let r=n[0],{p:i,a,b:o,byteLength:s}=t;if(r===4||r===6||r===7){if(n.length!==1+2*s)throw Error(`Invalid public key length: expected ${1+2*s} bytes, got ${n.length}`);let e=bufferToBigint(n.subarray(1,1+s)),t=bufferToBigint(n.subarray(1+s));if(mod(t*t,i)!==mod(e*e*e+a*e+o,i))throw Error(`Invalid public key: point is not on the curve`);return{x:e,y:t}}if(r===2||r===3){if(n.length!==1+s)throw Error(`Invalid public key length: expected ${1+s} bytes, got ${n.length}`);let e=bufferToBigint(n.subarray(1,1+s)),t=sqrtMod(mod(e*e*e+a*e+o,i),i);if(t===null)throw Error(`Invalid public key: no valid y coordinate for the given x`);let c=r===3;return{x:e,y:t%2n!=0n===c?t:mod(i-t,i)}}throw Error(`Invalid public key prefix: 0x${r.toString(16).padStart(2,`0`)}`)}function sqrtMod(e,t){if(e=mod(e,t),e===0n)return 0n;if(modPow(e,(t-1n)/2n,t)!==1n)return null;if(mod(t,4n)===3n)return modPow(e,(t+1n)/4n,t);let n=0n,r=t-1n;for(;mod(r,2n)===0n;)r/=2n,n++;let i=2n;for(;modPow(i,(t-1n)/2n,t)!==t-1n;)i++;let a=n,o=modPow(i,r,t),s=modPow(e,r,t),c=modPow(e,(r+1n)/2n,t);for(;;){if(s===0n)return 0n;if(s===1n)return c;let e=1n,n=mod(s*s,t);for(;n!==1n;)n=mod(n*n,t),e++;let r=modPow(o,modPow(2n,a-e-1n,t-1n),t);a=e,o=mod(r*r,t),s=mod(s*o,t),c=mod(c*r,t)}}function toBuffer$1(e,t){if(q.isBuffer(e))return e;if(e instanceof Uint8Array)return q.from(e);if(typeof e==`string`)return q.from(e,t||`utf8`);if(ArrayBuffer.isView(e))return q.from(e.buffer,e.byteOffset,e.byteLength);throw TypeError(`The "key" argument must be of type string or an instance of Buffer, TypedArray, or DataView.`)}function formatReturnValue(e,t){return t?e.toString(t):e}function resolveCurve(e){let t=Gi[e.toLowerCase()];if(!t)throw Error(`Unsupported curve: ${e}`);let n=Wi[t];if(!n)throw Error(`Unsupported curve: ${e}`);return{canonical:t,params:n}}function createECDH(e){return new ECDH(e)}function getCurves(){return[`secp256k1`,`prime256v1`,`secp256r1`,`secp384r1`,`secp521r1`]}var Wi,Gi,ECDH,Ki=__esmMin(()=>{Ii(),Fi(),J(),Wi={secp256k1:{p:115792089237316195423570985008687907853269984665640564039457584007908834671663n,a:0n,b:7n,Gx:55066263022277343669578718895168534326250603453777594175500187360389116729240n,Gy:32670510020758816978083085130507043184471273380659243275938904335757337482424n,n:115792089237316195423570985008687907852837564279074904382605163141518161494337n,byteLength:32},prime256v1:{p:115792089210356248762697446949407573530086143415290314195533631308867097853951n,a:115792089210356248762697446949407573530086143415290314195533631308867097853951n-3n,b:41058363725152142129326129780047268409114441015993725554835256314039467401291n,Gx:48439561293906451759052585252797914202762949526041747995844080717082404635286n,Gy:36134250956749795798585127919587881956611106672985015071877198253568414405109n,n:115792089210356248762697446949407573529996955224135760342422259061068512044369n,byteLength:32},secp384r1:{p:39402006196394479212279040100143613805079739270465446667948293404245721771496870329047266088258938001861606973112319n,a:39402006196394479212279040100143613805079739270465446667948293404245721771496870329047266088258938001861606973112319n-3n,b:27580193559959705877849011840389048093056905856361568521428707301988689241309860865136260764883745107765439761230575n,Gx:26247035095799689268623156744566981891852923491109213387815615900925518854738050089022388053975719786650872476732087n,Gy:8325710961489029985546751289520108179287853048861315594709205902480503199884419224438643760392947333078086511627871n,n:39402006196394479212279040100143613805079739270465446667946905279627659399113263569398956308152294913554433653942643n,byteLength:48},secp521r1:{p:6864797660130609714981900799081393217269435300143305409394463459185543183397656052122559640661454554977296311391480858037121987999716643812574028291115057151n,a:6864797660130609714981900799081393217269435300143305409394463459185543183397656052122559640661454554977296311391480858037121987999716643812574028291115057151n-3n,b:1093849038073734274511112390766805569936207598951683748994586394495953116150735016013708737573759623248592132296706313309438452531591012912142327488478985984n,Gx:2661740802050217063228768716723360960729859168756973147706671368418802944996427808491545080627771902352094241225065558662157113545570916814161637315895999846n,Gy:3757180025770020463545507224491183603594455134769762486694567779615544477440556316691234405012945539562144444537289428522585666729196580810124344277578376784n,n:6864797660130609714981900799081393217269435300143305409394463459185543183397655394245057746333217197532963996371363321113864768612440380340372808892707005449n,byteLength:66}},Gi={secp256k1:`secp256k1`,prime256v1:`prime256v1`,secp256r1:`prime256v1`,"p-256":`prime256v1`,p256:`prime256v1`,secp384r1:`secp384r1`,"p-384":`secp384r1`,p384:`secp384r1`,secp521r1:`secp521r1`,"p-521":`secp521r1`,p521:`secp521r1`},__name(modInverse$2,`modInverse`),__name(toBuffer$1,`toBuffer`),ECDH=class{_curve;_curveName;_privateKey=null;_publicKey=null;constructor(e){let t=resolveCurve(e);this._curve=t.params,this._curveName=t.canonical}generateKeys(e,t){let{n,byteLength:r}=this._curve,i;do i=bufferToBigint(randomBytes(r));while(i===0n||i>=n);this._privateKey=i;let a={x:this._curve.Gx,y:this._curve.Gy};return this._publicKey=scalarMul(i,a,this._curve),e===void 0?this.getPublicKey():this.getPublicKey(e,t)}computeSecret(e,t,n){if(this._privateKey===null)throw Error(`ECDH key not generated. Call generateKeys() or setPrivateKey() first.`);let r=decodePublicKey(toBuffer$1(e,t),this._curve);if(r===null)throw Error(`Invalid public key: point at infinity`);let i=scalarMul(this._privateKey,r,this._curve);if(i===null)throw Error(`Shared secret computation resulted in the point at infinity`);return formatReturnValue(bigintToBuffer(i.x,this._curve.byteLength),n)}getPublicKey(e,t){if(this._publicKey===null)throw Error(`ECDH key not generated. Call generateKeys() or setPrivateKey() first.`);return formatReturnValue(encodePublicKey(this._publicKey,this._curve.byteLength,t||`uncompressed`),e)}getPrivateKey(e){if(this._privateKey===null)throw Error(`ECDH key not generated. Call generateKeys() or setPrivateKey() first.`);return formatReturnValue(bigintToBuffer(this._privateKey,this._curve.byteLength),e)}setPublicKey(e,t){let n=toBuffer$1(e,t);this._publicKey=decodePublicKey(n,this._curve)}setPrivateKey(e,t){let n=bufferToBigint(toBuffer$1(e,t));if(n===0n||n>=this._curve.n)throw Error(`Private key is out of range [1, n-1]`);this._privateKey=n;let r={x:this._curve.Gx,y:this._curve.Gy};this._publicKey=scalarMul(n,r,this._curve)}}});function normalizeAlgorithm(e){return e.toLowerCase().replace(/-/g,``)}function hashSize(e){let t=qi[normalizeAlgorithm(e)];if(t===void 0)throw Error(`Unknown hash algorithm: ${e}`);return t}function toBuffer(e,t){return typeof e==`string`?q.from(e,t||`utf8`):e instanceof DataView?q.from(e.buffer,e.byteOffset,e.byteLength):(e instanceof ArrayBuffer,q.from(e))}var qi,Ji,Yi,Xi=__esmMin(()=>{J(),qi={md5:16,sha1:20,sha256:32,sha384:48,sha512:64},Ji={md5:64,sha1:64,sha256:64,sha384:128,sha512:128},Yi=new Set([`md5`,`sha1`,`sha256`,`sha384`,`sha512`])});function getChecksumType(e){let t=Zi[normalizeAlgorithm(e)];if(t===void 0){let t=Error(`Unknown message digest: ${e}`);throw t.code=`ERR_CRYPTO_HASH_UNKNOWN`,t}return t}function getHashes(){return[`md5`,`sha1`,`sha256`,`sha384`,`sha512`]}function hash(e,t,n){return new Qi(e).update(t).digest(n)}var Zi,Qi,$i=__esmMin(()=>{Xi(),J(),A(),Zr(),Zi={md5:k.ChecksumType.MD5,sha1:k.ChecksumType.SHA1,sha256:k.ChecksumType.SHA256,sha384:k.ChecksumType.SHA384,sha512:k.ChecksumType.SHA512},Qi=class Hash extends Jr{_algorithm;_checksum;_finalized=!1;constructor(e){super();let t=normalizeAlgorithm(e),n=getChecksumType(t);this._algorithm=t,this._checksum=new k.Checksum(n)}update(e,t){if(this._finalized)throw Error(`Digest already called`);let n;if(typeof e==`string`){let r=normalizeEncoding(t);n=q.from(e,r)}else n=e instanceof Uint8Array?e:q.from(e);return this._checksum.update(n),this}digest(e){if(this._finalized)throw Error(`Digest already called`);this._finalized=!0;let t=this._checksum.get_string(),n=q.from(t,`hex`);return e?n.toString(e):n}copy(){if(this._finalized)throw Error(`Digest already called`);let e=Object.create(Hash.prototype);return Jr.call(e),e._algorithm=this._algorithm,e._finalized=!1,e._checksum=this._checksum.copy(),e}_transform(e,t,n){try{this.update(e,t),n()}catch(e){n(e)}}_flush(e){try{this.push(this.digest()),e()}catch(t){e(t)}}}}),Hmac,ea=__esmMin(()=>{Xi(),$i(),J(),Zr(),Hmac=class extends Jr{_algorithm;_innerHash;_outerKeyPad;_finalized=!1;constructor(e,t){super();let n=normalizeAlgorithm(e);if(!Yi.has(n)){let t=Error(`Unknown message digest: ${e}`);throw t.code=`ERR_CRYPTO_HASH_UNKNOWN`,t}this._algorithm=n;let r;r=typeof t==`string`?q.from(t,`utf8`):t instanceof Uint8Array?t:q.from(t);let i=Ji[n];if(r.length>i){let e=new Qi(n);e.update(r),r=e.digest()}let a=new Uint8Array(i);a.set(r);let o=new Uint8Array(i),s=new Uint8Array(i);for(let e=0;e<i;e++)o[e]=a[e]^54,s[e]=a[e]^92;this._outerKeyPad=s,this._innerHash=new Qi(n),this._innerHash.update(o)}update(e,t){if(this._finalized)throw Error(`Digest already called`);let n;if(typeof e==`string`){let r=normalizeEncoding(t);n=q.from(e,r)}else n=e instanceof Uint8Array?e:q.from(e);return this._innerHash.update(n),this}digest(e){if(this._finalized)throw Error(`Digest already called`);this._finalized=!0;let t=this._innerHash.digest(),n=new Qi(this._algorithm);n.update(this._outerKeyPad),n.update(t);let r=n.digest();return e?r.toString(e):r}_transform(e,t,n){try{this.update(e,t),n()}catch(e){n(e)}}_flush(e){try{this.push(this.digest()),e()}catch(t){e(t)}}}});function getCurve(e){let t=Gi[e.toLowerCase()];if(!t)throw Error(`Unsupported curve: ${e}`);return Wi[t]}function truncateHash(e,t){let n=t.n.toString(2).length,r=bytesToBigInt(e),i=e.length*8;return i>n&&(r>>=BigInt(i-n)),r}function hmacDigest$2(e,t,n){let r=new Hmac(e,t);return r.update(n),new Uint8Array(r.digest())}function rfc6979(e,t,n,r){let i=r.byteLength,a=n.length,o=new Uint8Array(a).fill(1),s=new Uint8Array(a).fill(0),c=bigIntToBytes(t,i),l=bigIntToBytes(mod(truncateHash(n,r),r.n),i),u=new Uint8Array(a+1+i+i);u.set(o,0),u[a]=0,u.set(c,a+1),u.set(l,a+1+i),s=hmacDigest$2(e,s,u),o=hmacDigest$2(e,s,o);let d=new Uint8Array(a+1+i+i);d.set(o,0),d[a]=1,d.set(c,a+1),d.set(l,a+1+i),s=hmacDigest$2(e,s,d),o=hmacDigest$2(e,s,o);for(let t=0;t<100;t++){let t=new Uint8Array;for(;t.length<i;){o=hmacDigest$2(e,s,o);let n=new Uint8Array(t.length+o.length);n.set(t,0),n.set(o,t.length),t=n}let n=truncateHash(t.slice(0,i),r);if(n>=1n&&n<r.n)return n;let c=new Uint8Array(a+1);c.set(o,0),c[a]=0,s=hmacDigest$2(e,s,c),o=hmacDigest$2(e,s,o)}throw Error(`RFC 6979: failed to generate valid k after 100 attempts`)}function ecdsaSign(e,t,n,r){let i=getCurve(r),a={x:i.Gx,y:i.Gy},o=bytesToBigInt(t),s=new Qi(e);s.update(n);let c=new Uint8Array(s.digest()),l=truncateHash(c,i),u=rfc6979(e,o,c,i),d=scalarMul(u,a,i);if(d===null)throw Error(`ECDSA: k * G is point at infinity`);let p=mod(d.x,i.n);if(p===0n)throw Error(`ECDSA: r is zero`);let m=mod(modInverse$2(u,i.n)*(l+p*o),i.n);if(m===0n)throw Error(`ECDSA: s is zero`);let h=i.byteLength,g=new Uint8Array(h*2);return g.set(bigIntToBytes(p,h),0),g.set(bigIntToBytes(m,h),h),g}function ecdsaVerify(e,t,n,r,i){let a=getCurve(i),o={x:a.Gx,y:a.Gy},s=a.byteLength;if(t[0]!==4||t.length!==1+s*2)return!1;let c={x:bytesToBigInt(t.slice(1,1+s)),y:bytesToBigInt(t.slice(1+s))};if(n.length!==s*2)return!1;let l=bytesToBigInt(n.slice(0,s)),u=bytesToBigInt(n.slice(s));if(l<1n||l>=a.n||u<1n||u>=a.n)return!1;let d=new Qi(e);d.update(r);let p=truncateHash(new Uint8Array(d.digest()),a),m=modInverse$2(u,a.n),h=mod(p*m,a.n),g=mod(l*m,a.n),_=pointAdd(scalarMul(h,o,a),scalarMul(g,c,a),a);return _===null?!1:mod(_.x,a.n)===l}var ta=__esmMin(()=>{Ii(),Ki(),$i(),ea(),__name(hmacDigest$2,`hmacDigest`)});function hmacDigest$1(e,t,n){let r=new Hmac(e,t);return r.update(n),r.digest()}function hkdfExtract(e,t,n){return hmacDigest$1(e,n,t)}function hkdfExpand(e,t,n,r,i){let a=Math.ceil(r/i);if(a>255)throw Error(`HKDF cannot generate more than 255 * HashLen bytes`);let o=q.allocUnsafe(a*i),s=q.alloc(0);for(let r=1;r<=a;r++)s=hmacDigest$1(e,t,q.concat([s,n,q.from([r])])),s.copy(o,(r-1)*i);return q.from(o.buffer,o.byteOffset,r)}function hkdfSync(e,t,n,r,i){let a=normalizeAlgorithm(e),o=qi[a];if(!Yi.has(a)||o===void 0)throw TypeError(`Unknown message digest: ${e}`);if(typeof i!=`number`||i<0)throw TypeError(`keylen must be a non-negative number`);let s=toBuffer(t),c=toBuffer(n),l=toBuffer(r),u=hkdfExpand(a,hkdfExtract(a,s,c.length===0?q.alloc(o,0):c),l,i,o),d=new ArrayBuffer(u.length);return new Uint8Array(d).set(u),d}function hkdf(e,t,n,r,i,a){setTimeout(()=>{try{a(null,hkdfSync(e,t,n,r,i))}catch(e){a(e instanceof Error?e:Error(String(e)))}},0)}var na=__esmMin(()=>{Xi(),ea(),J(),__name(hmacDigest$1,`hmacDigest`)});function hmacDigest(e,t,n){let r=new Hmac(e,t);return r.update(n),r.digest()}function validateParameters(e,t){if(typeof e!=`number`||e<0||!Number.isFinite(e)||e===0)throw TypeError(`iterations must be a positive number`);if(typeof t!=`number`||t<0||!Number.isFinite(t)||t>2147483647)throw TypeError(`keylen must be a positive number`)}function pbkdf2Sync(e,t,n,r,i){validateParameters(n,r);let a=toBuffer(e),o=toBuffer(t),s=normalizeAlgorithm(i||`sha1`),c=qi[s];if(!Yi.has(s)||c===void 0)throw TypeError(`Unknown message digest: ${i||`sha1`}`);if(r===0)return q.alloc(0);let l=Math.ceil(r/c),u=q.allocUnsafe(l*c);for(let e=1;e<=l;e++){let t=q.allocUnsafe(o.length+4);o.copy(t,0),t.writeUInt32BE(e,o.length);let r=hmacDigest(s,a,t),i=q.from(r);for(let e=1;e<n;e++){r=hmacDigest(s,a,r);for(let e=0;e<c;e++)i[e]^=r[e]}i.copy(u,(e-1)*c)}return q.from(u.buffer,u.byteOffset,r)}function pbkdf2(e,t,n,r,i,a){validateParameters(n,r),setTimeout(()=>{try{a(null,pbkdf2Sync(e,t,n,r,i))}catch(e){a(e instanceof Error?e:Error(String(e)))}},0)}var ra=__esmMin(()=>{Xi(),ea(),J()});function R(e,t){return(e<<t|e>>>32-t)>>>0}function salsa20_8(e){let t=new Uint32Array(16);for(let n=0;n<16;n++)t[n]=e[n];for(let e=0;e<4;e++)t[4]^=R(t[0]+t[12],7),t[8]^=R(t[4]+t[0],9),t[12]^=R(t[8]+t[4],13),t[0]^=R(t[12]+t[8],18),t[9]^=R(t[5]+t[1],7),t[13]^=R(t[9]+t[5],9),t[1]^=R(t[13]+t[9],13),t[5]^=R(t[1]+t[13],18),t[14]^=R(t[10]+t[6],7),t[2]^=R(t[14]+t[10],9),t[6]^=R(t[2]+t[14],13),t[10]^=R(t[6]+t[2],18),t[3]^=R(t[15]+t[11],7),t[7]^=R(t[3]+t[15],9),t[11]^=R(t[7]+t[3],13),t[15]^=R(t[11]+t[7],18),t[1]^=R(t[0]+t[3],7),t[2]^=R(t[1]+t[0],9),t[3]^=R(t[2]+t[1],13),t[0]^=R(t[3]+t[2],18),t[6]^=R(t[5]+t[4],7),t[7]^=R(t[6]+t[5],9),t[4]^=R(t[7]+t[6],13),t[5]^=R(t[4]+t[7],18),t[11]^=R(t[10]+t[9],7),t[8]^=R(t[11]+t[10],9),t[9]^=R(t[8]+t[11],13),t[10]^=R(t[9]+t[8],18),t[12]^=R(t[15]+t[14],7),t[13]^=R(t[12]+t[15],9),t[14]^=R(t[13]+t[12],13),t[15]^=R(t[14]+t[13],18);for(let n=0;n<16;n++)e[n]=e[n]+t[n]>>>0}function blockMix(e,t){let n=2*t*16,r=new Uint32Array(16);for(let t=0;t<16;t++)r[t]=e[n-16+t];let i=new Uint32Array(n);for(let n=0;n<2*t;n++){for(let t=0;t<16;t++)r[t]^=e[n*16+t];salsa20_8(r);for(let e=0;e<16;e++)i[n*16+e]=r[e]}for(let n=0;n<t;n++)for(let t=0;t<16;t++)e[n*16+t]=i[2*n*16+t];for(let n=0;n<t;n++)for(let r=0;r<16;r++)e[(t+n)*16+r]=i[(2*n+1)*16+r]}function roMix(e,t,n){let r=2*n*16,i=Array.from({length:t});for(let r=0;r<t;r++)i[r]=new Uint32Array(e),blockMix(e,n);for(let a=0;a<t;a++){let a=e[r-16]&t-1;for(let t=0;t<r;t++)e[t]^=i[a][t];blockMix(e,n)}}function bytesToWords(e){let t=new Uint32Array(e.length/4);for(let n=0;n<t.length;n++)t[n]=e[n*4]|e[n*4+1]<<8|e[n*4+2]<<16|e[n*4+3]<<24;return t}function wordsToBytes(e){let t=new Uint8Array(e.length*4);for(let n=0;n<e.length;n++)t[n*4]=e[n]&255,t[n*4+1]=e[n]>>8&255,t[n*4+2]=e[n]>>16&255,t[n*4+3]=e[n]>>24&255;return t}function scryptCore(e,t,n,r,i,a){let o=128*r,s=pbkdf2Sync(e,t,1,i*o,`sha256`);for(let e=0;e<i;e++){let t=new Uint8Array(s.buffer,s.byteOffset+e*o,o),i=bytesToWords(t);roMix(i,n,r);let a=wordsToBytes(i);t.set(a)}return pbkdf2Sync(e,s,1,a,`sha256`)}function scryptSync(e,t,n,r){let i=q.from(e),a=q.from(t),o=r?.N??16384,s=r?.r??8,c=r?.p??1;if(o<=0||o&o-1)throw Error(`N must be a positive power of 2`);return scryptCore(i,a,o,s,c,n)}function scrypt(e,t,n,r,i){let a={},o;typeof r==`function`?o=r:(a=r,o=i);try{let r=scryptSync(e,t,n,a);setTimeout(()=>o(null,r),0)}catch(e){setTimeout(()=>o(e instanceof Error?e:Error(String(e)),q.alloc(0)),0)}}var ia=__esmMin(()=>{ra(),J()});function pemToDer(e){let t=e.trim().split(/\r?\n/),n=t.findIndex(e=>e.startsWith(`-----BEGIN `));if(n===-1)throw Error(`Invalid PEM: no BEGIN line found`);let r=t[n].match(/^-----BEGIN (.+)-----$/);if(!r)throw Error(`Invalid PEM header format`);let i=r[1],a=t.findIndex((e,t)=>t>n&&e.startsWith(`-----END `));if(a===-1)throw Error(`Invalid PEM: no END line found`);let o=t.slice(n+1,a).join(``),s=q.from(o,`base64`);return{type:i,der:new Uint8Array(s.buffer,s.byteOffset,s.byteLength)}}function parseTlv(e,t){if(t>=e.length)throw Error(`ASN.1 parse error: unexpected end of data`);let n=e[t++],r,i=e[t++];if(i<128)r=i;else{let n=i&127;if(n===0)throw Error(`ASN.1 parse error: indefinite length not supported`);r=0;for(let i=0;i<n;i++)r=r<<8|e[t++]}let a=e.slice(t,t+r),o=t+r,s={tag:n,data:a};return n===48&&(s.children=parseSequenceChildren(a)),{value:s,next:o}}function parseSequenceChildren(e){let t=[],n=0;for(;n<e.length;){let{value:r,next:i}=parseTlv(e,n);t.push(r),n=i}return t}function parseDer(e){let{value:t}=parseTlv(e,0);return t}function integerToBigInt(e){let t=0;for(;t<e.length-1&&e[t]===0;)t++;let n=0n;for(let r=t;r<e.length;r++)n=n<<8n|BigInt(e[r]);return n}function oidsEqual(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function parseRsaPublicKeyPkcs1(e){let t=e.children;if(!t||t.length<2)throw Error(`Invalid PKCS#1 RSAPublicKey structure`);return{n:integerToBigInt(t[0].data),e:integerToBigInt(t[1].data)}}function parseRsaPrivateKeyPkcs1(e){let t=e.children;if(!t||t.length<6)throw Error(`Invalid PKCS#1 RSAPrivateKey structure`);return{n:integerToBigInt(t[1].data),e:integerToBigInt(t[2].data),d:integerToBigInt(t[3].data),p:integerToBigInt(t[4].data),q:integerToBigInt(t[5].data)}}function parseSubjectPublicKeyInfo(e){let t=e.children;if(!t||t.length<2)throw Error(`Invalid SubjectPublicKeyInfo structure`);let n=t[0];if(!n.children||n.children.length<1)throw Error(`Invalid AlgorithmIdentifier`);let r=n.children[0];if(r.tag!==6||!oidsEqual(r.data,aa))throw Error(`Unsupported algorithm: only RSA is supported`);let i=t[1];if(i.tag!==3)throw Error(`Expected BIT STRING for public key data`);return parseRsaPublicKeyPkcs1(parseDer(i.data.slice(1)))}function parsePrivateKeyInfo(e){let t=e.children;if(!t||t.length<3)throw Error(`Invalid PrivateKeyInfo structure`);let n=t[1];if(!n.children||n.children.length<1)throw Error(`Invalid AlgorithmIdentifier`);let r=n.children[0];if(r.tag!==6||!oidsEqual(r.data,aa))throw Error(`Unsupported algorithm: only RSA is supported`);let i=t[2];if(i.tag!==4)throw Error(`Expected OCTET STRING for private key data`);return parseRsaPrivateKeyPkcs1(parseDer(i.data))}function encodeLength(e){if(e<128)return new Uint8Array([e]);let t=[],n=e;for(;n>0;)t.unshift(n&255),n>>=8;return new Uint8Array([128|t.length,...t])}function encodeTlv(e,t){let n=encodeLength(t.length),r=new Uint8Array(1+n.length+t.length);return r[0]=e,r.set(n,1),r.set(t,1+n.length),r}function bigintToAsn1Integer(e){if(e===0n)return encodeTlv(2,new Uint8Array([0]));let t=e.toString(16),n=t.length%2?`0`+t:t,r=[];for(let e=0;e<n.length;e+=2)r.push(parseInt(n.substring(e,e+2),16));return r[0]&128&&r.unshift(0),encodeTlv(2,new Uint8Array(r))}function encodeSequence(e){let t=0;for(let n of e)t+=n.length;let n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.length;return encodeTlv(48,n)}function encodeBitString(e){let t=new Uint8Array(1+e.length);return t[0]=0,t.set(e,1),encodeTlv(3,t)}function encodeOctetString(e){return encodeTlv(4,e)}function encodeOid(e){return encodeTlv(6,e)}function encodeNull(){return new Uint8Array([5,0])}function encodeRsaPublicKeyPkcs1(e){return encodeSequence([bigintToAsn1Integer(e.n),bigintToAsn1Integer(e.e)])}function encodeSubjectPublicKeyInfo(e){return encodeSequence([encodeSequence([encodeOid(aa),encodeNull()]),encodeBitString(encodeRsaPublicKeyPkcs1(e))])}function encodeRsaPrivateKeyPkcs1(e){let t=e.d%(e.p-1n),n=e.d%(e.q-1n),r=modInverse$1(e.q,e.p);return encodeSequence([bigintToAsn1Integer(0n),bigintToAsn1Integer(e.n),bigintToAsn1Integer(e.e),bigintToAsn1Integer(e.d),bigintToAsn1Integer(e.p),bigintToAsn1Integer(e.q),bigintToAsn1Integer(t),bigintToAsn1Integer(n),bigintToAsn1Integer(r)])}function encodePrivateKeyInfo(e){let t=encodeSequence([encodeOid(aa),encodeNull()]),n=encodeOctetString(encodeRsaPrivateKeyPkcs1(e));return encodeSequence([bigintToAsn1Integer(0n),t,n])}function derToPem(e,t){let n=q.from(e).toString(`base64`),r=[`-----BEGIN ${t}-----`];for(let e=0;e<n.length;e+=64)r.push(n.substring(e,e+64));return r.push(`-----END ${t}-----`),r.join(`
|
|
6
6
|
`)}function modInverse$1(e,t){let[n,r]=[e%t,t],[i,a]=[1n,0n];for(;r!==0n;){let e=n/r;[n,r]=[r,n-e*r],[i,a]=[a,i-e*a]}return(i%t+t)%t}function parseX509(e){let{der:t}=pemToDer(e);return parseX509Der(t)}function parseX509Der(e){let t=parseDer(e);if(t.tag!==48||!t.children||t.children.length<3)throw Error(`Invalid X.509 certificate structure`);let n=t.children[0],r=t.children[1],i=t.children[2];if(!n.children||n.children.length<6)throw Error(`Invalid TBSCertificate structure`);let a=0;n.children[0].tag===160&&a++;let o=integerToBigInt(n.children[a].data);a++,a++;let s=parseDN(n.children[a]);a++;let c=n.children[a],l=parseAsn1Time(c.children[0]),u=parseAsn1Time(c.children[1]);a++;let d=parseDN(n.children[a]);a++;let p=null,m=`unknown`;if(a<n.children.length){let e=n.children[a];try{if(e.children&&e.children.length>=2){let t=e.children[0];if(t.children&&t.children.length>=1){let n=t.children[0];n.tag===6&&oidsEqual(n.data,aa)&&(m=`rsa`,p=parseSubjectPublicKeyInfo(e))}}}catch{}a++}let h,g;for(let e=a;e<n.children.length;e++){let t=n.children[e];if(t.tag===163&&t.data.length>0){let e=parseDer(t.data);if(e.children){g=e.children;let t=new Uint8Array([85,29,17]);for(let n of e.children)if(n.children&&n.children.length>=2){let e=n.children[0];if(e.tag===6&&oidsEqual(e.data,t)){let e=n.children[n.children.length-1];h=parseSAN(e.data)}}}}}let _=`unknown`;r.children&&r.children.length>=1&&(_=oidToName(r.children[0].data));let v=i.tag===3?i.data.slice(1):i.data;return{raw:e,tbsCertificate:n.data,serialNumber:o,issuer:s,subject:d,validFrom:l,validTo:u,publicKey:p,publicKeyAlgorithm:m,signatureAlgorithm:_,signature:v,subjectAltName:h,extensions:g}}function decodeOidString(e){if(e.length===0)return``;let t=[];t.push(Math.floor(e[0]/40)),t.push(e[0]%40);let n=0;for(let r=1;r<e.length;r++)n=n<<7|e[r]&127,e[r]&128||(t.push(n),n=0);return t.join(`.`)}function oidToName(e){let t=decodeOidString(e);return sa[t]||t}function parseDN(e){if(!e.children)return``;let t=[];for(let n of e.children){let e=n.tag===49?parseSequenceChildren(n.data):n.children||[];for(let n of e)if(n.children&&n.children.length>=2){let e=n.children[0].data,r=decodeOidString(e),i=oa[r]||r,a=n.children[1].data,o=new TextDecoder().decode(a);t.push(`${i}=${o}`)}}return t.join(`, `)}function parseAsn1Time(e){let t=new TextDecoder().decode(e.data);if(e.tag===23){let e=parseInt(t.substring(0,2),10);e=e>=50?1900+e:2e3+e;let n=parseInt(t.substring(2,4),10)-1,r=parseInt(t.substring(4,6),10),i=parseInt(t.substring(6,8),10),a=parseInt(t.substring(8,10),10),o=parseInt(t.substring(10,12),10);return new Date(Date.UTC(e,n,r,i,a,o))}if(e.tag===24){let e=parseInt(t.substring(0,4),10),n=parseInt(t.substring(4,6),10)-1,r=parseInt(t.substring(6,8),10),i=parseInt(t.substring(8,10),10),a=parseInt(t.substring(10,12),10),o=parseInt(t.substring(12,14),10);return new Date(Date.UTC(e,n,r,i,a,o))}throw Error(`Unsupported time tag: 0x${e.tag.toString(16)}`)}function parseSAN(e){let t=[];try{let n=parseDer(e);if(n.tag===48&&n.children){for(let e of n.children)if(e.tag===130)t.push(`DNS:`+new TextDecoder().decode(e.data));else if(e.tag===135){if(e.data.length===4)t.push(`IP Address:`+e.data.join(`.`));else if(e.data.length===16){let n=[];for(let t=0;t<16;t+=2)n.push((e.data[t]<<8|e.data[t+1]).toString(16));t.push(`IP Address:`+n.join(`:`))}}}}catch{}return t}function parsePemKey(e){let{type:t,der:n}=pemToDer(e),r=parseDer(n);if(r.tag!==48)throw Error(`Invalid key format: expected top-level SEQUENCE`);switch(t){case`RSA PUBLIC KEY`:return{type:`rsa-public`,components:parseRsaPublicKeyPkcs1(r)};case`PUBLIC KEY`:return{type:`rsa-public`,components:parseSubjectPublicKeyInfo(r)};case`RSA PRIVATE KEY`:return{type:`rsa-private`,components:parseRsaPrivateKeyPkcs1(r)};case`PRIVATE KEY`:return{type:`rsa-private`,components:parsePrivateKeyInfo(r)};default:throw Error(`Unsupported PEM type: ${t}`)}}function rsaKeySize(e){let t=0,n=e;for(;n>0n;)t++,n>>=1n;return Math.ceil(t/8)}var aa,oa,sa,ca=__esmMin(()=>{J(),aa=new Uint8Array([42,134,72,134,247,13,1,1,1]),__name(modInverse$1,`modInverse`),oa={"2.5.4.3":`CN`,"2.5.4.6":`C`,"2.5.4.7":`L`,"2.5.4.8":`ST`,"2.5.4.10":`O`,"2.5.4.11":`OU`,"1.2.840.113549.1.9.1":`emailAddress`},sa={"1.2.840.113549.1.1.1":`rsaEncryption`,"1.2.840.113549.1.1.5":`sha1WithRSAEncryption`,"1.2.840.113549.1.1.11":`sha256WithRSAEncryption`,"1.2.840.113549.1.1.12":`sha384WithRSAEncryption`,"1.2.840.113549.1.1.13":`sha512WithRSAEncryption`}});function normalizeSignAlgorithm(e){let t=e.toLowerCase().replace(/-/g,``);if(t.startsWith(`rsa`)&&(t=t.slice(3)),!la[t])throw Error(`Unsupported algorithm: ${e}. Supported: RSA-SHA1, RSA-SHA256, RSA-SHA512`);return t}function extractPem$1(e){if(typeof e==`string`)return e;if(q.isBuffer(e)||e instanceof Uint8Array)return q.from(e).toString(`utf8`);if(e&&typeof e==`object`&&`key`in e){let t=e.key;if(typeof t==`string`)return t;if(q.isBuffer(t)||t instanceof Uint8Array)return q.from(t).toString(`utf8`)}throw TypeError(`Invalid key argument`)}function createSign(e){return new Sign(e)}function createVerify(e){return new Verify(e)}var la,Sign,Verify,ua=__esmMin(()=>{ca(),Ii(),$i(),J(),la={sha1:new Uint8Array([48,33,48,9,6,5,43,14,3,2,26,5,0,4,20]),sha256:new Uint8Array([48,49,48,13,6,9,96,134,72,1,101,3,4,2,1,5,0,4,32]),sha512:new Uint8Array([48,81,48,13,6,9,96,134,72,1,101,3,4,2,3,5,0,4,64])},__name(extractPem$1,`extractPem`),Sign=class{_algorithm;_hash;_finalized=!1;constructor(e){this._algorithm=normalizeSignAlgorithm(e),this._hash=new Qi(this._algorithm)}update(e,t){if(this._finalized)throw Error(`Sign was already finalized`);return this._hash.update(e,t),this}sign(e,t){if(this._finalized)throw Error(`Sign was already finalized`);this._finalized=!0;let n=this._hash.digest(),r=parsePemKey(extractPem$1(e));if(r.type!==`rsa-private`)throw Error(`privateKey must be an RSA private key`);let{n:i,d:a}=r.components,o=rsaKeySize(i),s=la[this._algorithm],c=new Uint8Array(s.length+n.length);c.set(s,0),c.set(n,s.length);let l=o-c.length-3;if(l<8)throw Error(`Key is too short for the specified hash algorithm`);let u=new Uint8Array(o);u[0]=0,u[1]=1;for(let e=2;e<2+l;e++)u[e]=255;u[2+l]=0,u.set(c,3+l);let d=bigIntToBytes(modPow(bytesToBigInt(u),a,i),o),p=q.from(d);return t?p.toString(t):p}},Verify=class{_algorithm;_hash;_finalized=!1;constructor(e){this._algorithm=normalizeSignAlgorithm(e),this._hash=new Qi(this._algorithm)}update(e,t){if(this._finalized)throw Error(`Verify was already finalized`);return this._hash.update(e,t),this}verify(e,t,n){if(this._finalized)throw Error(`Verify was already finalized`);this._finalized=!0;let r=this._hash.digest(),i=parsePemKey(extractPem$1(e)),a,o;if(i.type===`rsa-public`)a=i.components.n,o=i.components.e;else if(i.type===`rsa-private`)a=i.components.n,o=i.components.e;else throw Error(`publicKey must be an RSA public or private key`);let s=rsaKeySize(a),c;if(c=typeof t==`string`?q.from(t,n||`base64`):t instanceof Uint8Array?t:q.from(t),c.length!==s)return!1;let l=bytesToBigInt(c);if(l>=a)return!1;let u=bigIntToBytes(modPow(l,o,a),s);if(u[0]!==0||u[1]!==1)return!1;let d=2;for(;d<u.length&&u[d]===255;)d++;if(d>=u.length||u[d]!==0||d-2<8)return!1;d++;let p=u.slice(d),m=la[this._algorithm],h=new Uint8Array(m.length+r.length);if(h.set(m,0),h.set(r,m.length),p.length!==h.length)return!1;let g=0;for(let e=0;e<p.length;e++)g|=p[e]^h[e];return g===0}}});function extractPem(e){if(typeof e==`string`)return e;if(q.isBuffer(e)||e instanceof Uint8Array)return q.from(e).toString(`utf8`);if(e&&typeof e==`object`&&`key`in e){let t=e.key;if(typeof t==`string`)return t;if(q.isBuffer(t)||t instanceof Uint8Array)return q.from(t).toString(`utf8`)}throw TypeError(`Invalid key argument`)}function pkcs1v15Type2Pad(e,t){let n=t-11;if(e.length>n)throw Error(`Data too long for key size. Max ${n} bytes, got ${e.length}`);let r=t-e.length-3,i=new Uint8Array(t);i[0]=0,i[1]=2;let a=randomBytes(r);for(let e=0;e<r;e++){for(;a[e]===0;)a[e]=randomBytes(1)[0];i[2+e]=a[e]}return i[2+r]=0,i.set(e,3+r),i}function pkcs1v15Type1Pad(e,t){let n=t-11;if(e.length>n)throw Error(`Data too long for key size. Max ${n} bytes, got ${e.length}`);let r=t-e.length-3,i=new Uint8Array(t);i[0]=0,i[1]=1;for(let e=2;e<2+r;e++)i[e]=255;return i[2+r]=0,i.set(e,3+r),i}function pkcs1v15Type2Unpad(e){if(e.length<11)throw Error(`Decryption error: message too short`);if(e[0]!==0||e[1]!==2)throw Error(`Decryption error: invalid padding`);let t=2;for(;t<e.length&&e[t]!==0;)t++;if(t>=e.length||t<10)throw Error(`Decryption error: invalid padding`);return e.slice(t+1)}function pkcs1v15Type1Unpad(e){if(e.length<11)throw Error(`Decryption error: message too short`);if(e[0]!==0||e[1]!==1)throw Error(`Decryption error: invalid padding`);let t=2;for(;t<e.length&&e[t]===255;)t++;if(t>=e.length||e[t]!==0||t<10)throw Error(`Decryption error: invalid padding`);return e.slice(t+1)}function publicEncrypt(e,t){let n=parsePemKey(extractPem(e)),r,i;if(n.type===`rsa-public`)r=n.components.n,i=n.components.e;else if(n.type===`rsa-private`)r=n.components.n,i=n.components.e;else throw Error(`Key must be an RSA public or private key`);let a=rsaKeySize(r),o=modPow(bytesToBigInt(pkcs1v15Type2Pad(t instanceof Uint8Array?t:q.from(t),a)),i,r);return q.from(bigIntToBytes(o,a))}function privateDecrypt(e,t){let n=parsePemKey(extractPem(e));if(n.type!==`rsa-private`)throw Error(`Key must be an RSA private key`);let{n:r,d:i}=n.components,a=rsaKeySize(r),o=t instanceof Uint8Array?t:q.from(t);if(o.length!==a)throw Error(`Data length (${o.length}) does not match key length (${a})`);let s=bytesToBigInt(o);if(s>=r)throw Error(`Decryption error: cipher value out of range`);let c=bigIntToBytes(modPow(s,i,r),a);return q.from(pkcs1v15Type2Unpad(c))}function privateEncrypt(e,t){let n=parsePemKey(extractPem(e));if(n.type!==`rsa-private`)throw Error(`Key must be an RSA private key`);let{n:r,d:i}=n.components,a=rsaKeySize(r),o=modPow(bytesToBigInt(pkcs1v15Type1Pad(t instanceof Uint8Array?t:q.from(t),a)),i,r);return q.from(bigIntToBytes(o,a))}function publicDecrypt(e,t){let n=parsePemKey(extractPem(e)),r,i;if(n.type===`rsa-public`)r=n.components.n,i=n.components.e;else if(n.type===`rsa-private`)r=n.components.n,i=n.components.e;else throw Error(`Key must be an RSA public or private key`);let a=rsaKeySize(r),o=t instanceof Uint8Array?t:q.from(t);if(o.length!==a)throw Error(`Data length (${o.length}) does not match key length (${a})`);let s=bytesToBigInt(o);if(s>=r)throw Error(`Decryption error: cipher value out of range`);let c=bigIntToBytes(modPow(s,i,r),a);return q.from(pkcs1v15Type1Unpad(c))}var da=__esmMin(()=>{ca(),Ii(),Fi(),J()});function mgf1(e,t,n){let r=new Uint8Array(n),i=0,a=0;for(;i<n;){let o=new Uint8Array(4);o[0]=a>>>24&255,o[1]=a>>>16&255,o[2]=a>>>8&255,o[3]=a&255;let s=new Qi(e);s.update(t),s.update(o);let c=new Uint8Array(s.digest()),l=Math.min(c.length,n-i);r.set(c.slice(0,l),i),i+=l,a++}return r}var fa=__esmMin(()=>{$i()});function hashDigest$1(e,t){let n=new Qi(e);return n.update(t),new Uint8Array(n.digest())}function emsaPssEncode(e,t,n,r){let i=hashSize(n),a=Math.ceil(t/8);if(a<i+r+2)throw Error(`RSA-PSS: encoding error — key too short`);let o=r>0?new Uint8Array(randomBytes(r)):new Uint8Array,s=new Uint8Array(8+i+r);s.set(e,8),s.set(o,8+i);let c=hashDigest$1(n,s),l=a-i-1,u=new Uint8Array(l);u[l-r-1]=1,u.set(o,l-r);let d=mgf1(n,c,l),p=new Uint8Array(l);for(let e=0;e<l;e++)p[e]=u[e]^d[e];let m=8*a-t;m>0&&(p[0]&=255>>>m);let h=new Uint8Array(a);return h.set(p,0),h.set(c,l),h[a-1]=188,h}function emsaPssVerify(e,t,n,r,i){let a=hashSize(r),o=Math.ceil(n/8);if(o<a+i+2||t[o-1]!==188)return!1;let s=o-a-1,c=t.slice(0,s),l=t.slice(s,s+a),u=8*o-n;if(u>0&&c[0]&255<<8-u)return!1;let d=mgf1(r,l,s),p=new Uint8Array(s);for(let e=0;e<s;e++)p[e]=c[e]^d[e];u>0&&(p[0]&=255>>>u);for(let e=0;e<s-i-1;e++)if(p[e]!==0)return!1;if(p[s-i-1]!==1)return!1;let m=p.slice(s-i),h=new Uint8Array(8+a+i);h.set(e,8),h.set(m,8+a);let g=hashDigest$1(r,h);if(l.length!==g.length)return!1;let _=0;for(let e=0;e<l.length;e++)_|=l[e]^g[e];return _===0}function rsaPssSign(e,t,n,r){let i=parsePemKey(t);if(i.type!==`rsa-private`)throw Error(`RSA-PSS: expected RSA private key`);let{n:a,d:o}=i.components,s=rsaKeySize(a),c=Math.ceil(s/8);return bigIntToBytes(modPow(bytesToBigInt(emsaPssEncode(hashDigest$1(e,n),s-1,e,r)),o,a),c)}function rsaPssVerify(e,t,n,r,i){let a=parsePemKey(t),o,s;if(a.type===`rsa-public`)({n:o,e:s}=a.components);else if(a.type===`rsa-private`)({n:o,e:s}=a.components);else throw Error(`RSA-PSS: expected RSA key`);let c=rsaKeySize(o),l=Math.ceil(c/8);if(n.length!==l)return!1;let u=bigIntToBytes(modPow(bytesToBigInt(n),s,o),Math.ceil((c-1)/8));return emsaPssVerify(hashDigest$1(e,r),u,c-1,e,i)}var pa=__esmMin(()=>{ca(),Ii(),Xi(),Fi(),$i(),fa(),__name(hashDigest$1,`hashDigest`)});function hashDigest(e,t){let n=new Qi(e);return n.update(t),new Uint8Array(n.digest())}function rsaOaepEncrypt(e,t,n,r){let i=parsePemKey(t),a,o;if(i.type===`rsa-public`)({n:a,e:o}=i.components);else if(i.type===`rsa-private`)({n:a,e:o}=i.components);else throw Error(`RSA-OAEP: expected RSA key`);let s=Math.ceil(rsaKeySize(a)/8),c=hashSize(e);if(n.length>s-2*c-2)throw Error(`RSA-OAEP: message too long`);let l=hashDigest(e,r||new Uint8Array),u=s-c-1,d=new Uint8Array(u);d.set(l,0),d[u-n.length-1]=1,d.set(n,u-n.length);let p=new Uint8Array(randomBytes(c)),m=mgf1(e,p,u),h=new Uint8Array(u);for(let e=0;e<u;e++)h[e]=d[e]^m[e];let g=mgf1(e,h,c),_=new Uint8Array(c);for(let e=0;e<c;e++)_[e]=p[e]^g[e];let v=new Uint8Array(s);return v[0]=0,v.set(_,1),v.set(h,1+c),bigIntToBytes(modPow(bytesToBigInt(v),o,a),s)}function rsaOaepDecrypt(e,t,n,r){let i=parsePemKey(t);if(i.type!==`rsa-private`)throw Error(`RSA-OAEP: expected RSA private key`);let{n:a,d:o}=i.components,s=Math.ceil(rsaKeySize(a)/8),c=hashSize(e);if(n.length!==s||s<2*c+2)throw Error(`RSA-OAEP: decryption error`);let l=bigIntToBytes(modPow(bytesToBigInt(n),o,a),s),u=l[0],d=l.slice(1,1+c),p=l.slice(1+c),m=s-c-1,h=mgf1(e,p,c),g=new Uint8Array(c);for(let e=0;e<c;e++)g[e]=d[e]^h[e];let _=mgf1(e,g,m),v=new Uint8Array(m);for(let e=0;e<m;e++)v[e]=p[e]^_[e];let y=hashDigest(e,r||new Uint8Array),b=v.slice(0,c),x=+(u===0);for(let e=0;e<c;e++)x&=+(y[e]===b[e]);let S=-1;for(let e=c;e<m;e++)if(v[e]===1){S=e;break}else if(v[e]!==0){x=0;break}if(S===-1&&(x=0),!x)throw Error(`RSA-OAEP: decryption error`);return v.slice(S+1)}var ma=__esmMin(()=>{ca(),Ii(),Xi(),Fi(),$i(),fa()});function bigintToBase64url(e){if(e===0n)return`AA`;let t=e.toString(16),n=t.length%2?`0`+t:t,r=[];for(let e=0;e<n.length;e+=2)r.push(parseInt(n.substring(e,e+2),16));return q.from(r).toString(`base64url`)}function base64urlToBigint(e){let t=q.from(e,`base64url`),n=0n;for(let e=0;e<t.length;e++)n=n<<8n|BigInt(t[e]);return n}function exportJwk(e,t){if(e.type===`rsa-public`)return{kty:`RSA`,n:bigintToBase64url(e.components.n),e:bigintToBase64url(e.components.e)};if(e.type===`rsa-private`){if(t===`public`)return{kty:`RSA`,n:bigintToBase64url(e.components.n),e:bigintToBase64url(e.components.e)};let{n,e:r,d:i,p:a,q:o}=e.components,s=i%(a-1n),c=i%(o-1n),l=modInverse(o,a);return{kty:`RSA`,n:bigintToBase64url(n),e:bigintToBase64url(r),d:bigintToBase64url(i),p:bigintToBase64url(a),q:bigintToBase64url(o),dp:bigintToBase64url(s),dq:bigintToBase64url(c),qi:bigintToBase64url(l)}}throw Error(`Unsupported key type for JWK export`)}function importJwkRsa(e){if(e.d){let t={n:base64urlToBigint(e.n),e:base64urlToBigint(e.e),d:base64urlToBigint(e.d),p:base64urlToBigint(e.p),q:base64urlToBigint(e.q)};return{parsed:{type:`rsa-private`,components:t},pem:derToPem(encodeRsaPrivateKeyPkcs1(t),`RSA PRIVATE KEY`)}}let t={n:base64urlToBigint(e.n),e:base64urlToBigint(e.e)};return{parsed:{type:`rsa-public`,components:t},pem:derToPem(encodeSubjectPublicKeyInfo(t),`PUBLIC KEY`)}}function generatePem(e,t,n){if(e.type===`rsa-public`)return n===`pkcs1`?derToPem(encodeRsaPublicKeyPkcs1(e.components),`RSA PUBLIC KEY`):derToPem(encodeSubjectPublicKeyInfo(e.components),`PUBLIC KEY`);if(e.type===`rsa-private`&&t===`public`){let t={n:e.components.n,e:e.components.e};return n===`pkcs1`?derToPem(encodeRsaPublicKeyPkcs1(t),`RSA PUBLIC KEY`):derToPem(encodeSubjectPublicKeyInfo(t),`PUBLIC KEY`)}if(e.type===`rsa-private`)return n===`pkcs8`?derToPem(encodePrivateKeyInfo(e.components),`PRIVATE KEY`):derToPem(encodeRsaPrivateKeyPkcs1(e.components),`RSA PRIVATE KEY`);throw Error(`Cannot generate PEM for this key type`)}function generateDer(e,t,n){if(e.type===`rsa-public`)return n===`pkcs1`?q.from(encodeRsaPublicKeyPkcs1(e.components)):q.from(encodeSubjectPublicKeyInfo(e.components));if(e.type===`rsa-private`&&t===`public`){let t={n:e.components.n,e:e.components.e};return n===`pkcs1`?q.from(encodeRsaPublicKeyPkcs1(t)):q.from(encodeSubjectPublicKeyInfo(t))}if(e.type===`rsa-private`)return n===`pkcs8`?q.from(encodePrivateKeyInfo(e.components)):q.from(encodeRsaPrivateKeyPkcs1(e.components));throw Error(`Cannot generate DER for this key type`)}function modInverse(e,t){let[n,r]=[e%t,t],[i,a]=[1n,0n];for(;r!==0n;){let e=n/r;[n,r]=[r,n-e*r],[i,a]=[a,i-e*a]}return(i%t+t)%t}function createSecretKey(e,t){let n;return n=typeof e==`string`?q.from(e,t??`utf8`):new Uint8Array(e),new ha(`secret`,n)}function createPublicKey(e){if(e instanceof ha){if(e.type===`public`)return e;if(e.type===`private`){let t=e._handle;if(t.parsed.type===`rsa-private`){let e={n:t.parsed.components.n,e:t.parsed.components.e};return new ha(`public`,{parsed:{type:`rsa-public`,components:e},pem:derToPem(encodeSubjectPublicKeyInfo(e),`PUBLIC KEY`)})}}throw TypeError(`Cannot create public key from secret key`)}if(typeof e==`object`&&!q.isBuffer(e)&&`key`in e){let t=e;if(t.format===`jwk`){let e=t.key;if(e.kty===`RSA`){let{parsed:t,pem:n}=importJwkRsa({n:e.n,e:e.e});return new ha(`public`,{parsed:t,pem:n})}throw Error(`Unsupported JWK key type: ${e.kty}`)}}let t=normalizePem(e),n=parsePemKey(t);if(n.type===`rsa-private`){let e={n:n.components.n,e:n.components.e};return new ha(`public`,{parsed:{type:`rsa-public`,components:e},pem:derToPem(encodeSubjectPublicKeyInfo(e),`PUBLIC KEY`)})}return new ha(`public`,{parsed:n,pem:t})}function createPrivateKey(e){if(typeof e==`object`&&!q.isBuffer(e)&&`key`in e){let t=e;if(t.format===`jwk`){let e=t.key;if(e.kty===`RSA`&&e.d){let{parsed:t,pem:n}=importJwkRsa(e);return new ha(`private`,{parsed:t,pem:n})}throw Error(`JWK does not contain a private key`)}}let t=normalizePem(e),n=parsePemKey(t);if(n.type!==`rsa-private`)throw TypeError(`Key is not a private key`);return new ha(`private`,{parsed:n,pem:t})}function normalizePem(e){if(typeof e==`string`)return e;if(q.isBuffer(e))return e.toString(`utf8`);if(e&&typeof e==`object`&&`key`in e){let t=e;if(typeof t.key==`string`)return t.key;if(q.isBuffer(t.key))return t.key.toString(t.encoding??`utf8`);if(t.key instanceof ha)return t.key.export({format:`pem`})}throw TypeError(`Invalid key input`)}var ha,ga=__esmMin(()=>{ca(),J(),ha=class KeyObject{type;_handle;constructor(e,t){if(e!==`secret`&&e!==`public`&&e!==`private`)throw TypeError(`Invalid KeyObject type: ${e}`);this.type=e,this._handle=t}get symmetricKeySize(){if(this.type===`secret`)return this._handle.byteLength}get asymmetricKeyType(){if(this.type===`secret`)return;let e=this._handle;if(e.parsed.type===`rsa-public`||e.parsed.type===`rsa-private`)return`rsa`}get asymmetricKeySize(){if(this.type===`secret`)return;let e=this._handle;if(e.parsed.type===`rsa-public`||e.parsed.type===`rsa-private`)return rsaKeySize(e.parsed.components.n)/8}equals(e){if(!(e instanceof KeyObject)||this.type!==e.type)return!1;if(this.type===`secret`){let t=this._handle,n=e._handle;if(t.byteLength!==n.byteLength)return!1;for(let e=0;e<t.byteLength;e++)if(t[e]!==n[e])return!1;return!0}let t=this._handle,n=e._handle;return t.pem===n.pem}export(e){if(this.type===`secret`){let t=this._handle;return e?.format===`jwk`?{kty:`oct`,k:q.from(t).toString(`base64url`)}:q.from(t)}let t=this._handle,n=e?.format??`pem`,r=e?.type;if(n===`jwk`)return exportJwk(t.parsed,this.type);if(n===`pem`)return t.pem&&!t.pem.startsWith(`[`)?t.pem:generatePem(t.parsed,this.type,r);if(n===`der`){if(t.pem&&!t.pem.startsWith(`[`)){let e=t.pem.trim().split(/\r?\n/),n=e.findIndex(e=>e.startsWith(`-----BEGIN `)),r=e.findIndex((e,t)=>t>n&&e.startsWith(`-----END `)),i=e.slice(n+1,r).join(``);return q.from(i,`base64`)}return generateDer(t.parsed,this.type,r)}throw TypeError(`Unsupported export format: ${n}`)}get[Symbol.toStringTag](){return`KeyObject`}}});function formatFingerprint(e){let t=e.toString(`hex`).toUpperCase(),n=[];for(let e=0;e<t.length;e+=2)n.push(t.substring(e,e+2));return n.join(`:`)}function matchHostname(e,t){let n=e.toLowerCase(),r=t.toLowerCase();if(n===r)return!0;if(n.startsWith(`*.`)){let e=n.substring(2),t=r.split(`.`);if(t.length>=2)return t.slice(1).join(`.`)===e}return!1}function parseDNToObject(e){let t={},n=e.split(`, `);for(let e of n){let n=e.indexOf(`=`);n>0&&(t[e.substring(0,n)]=e.substring(n+1))}return t}var X509Certificate,_a=__esmMin(()=>{ca(),ga(),ba(),J(),X509Certificate=class{_components;_pem;constructor(e){if(typeof e==`string`)this._pem=e,this._components=parseX509(e);else{let t=q.isBuffer(e)?e:q.from(e),n=t.toString(`utf8`);n.includes(`-----BEGIN CERTIFICATE-----`)?(this._pem=n,this._components=parseX509(n)):(this._components=parseX509Der(new Uint8Array(t.buffer,t.byteOffset,t.byteLength)),this._pem=derToPem(this._components.raw,`CERTIFICATE`))}}get raw(){return q.from(this._components.raw)}get serialNumber(){return this._components.serialNumber.toString(16).toUpperCase()}get subject(){return this._components.subject}get issuer(){return this._components.issuer}get validFrom(){return this._components.validFrom.toUTCString()}get validTo(){return this._components.validTo.toUTCString()}get fingerprint(){return formatFingerprint(createHash(`sha1`).update(this._components.raw).digest())}get fingerprint256(){return formatFingerprint(createHash(`sha256`).update(this._components.raw).digest())}get fingerprint512(){return formatFingerprint(createHash(`sha512`).update(this._components.raw).digest())}get publicKey(){if(!this._components.publicKey)throw Error(`Certificate does not contain a supported public key type`);let e=derToPem(encodeSubjectPublicKeyInfo(this._components.publicKey),`PUBLIC KEY`);return new ha(`public`,{parsed:{type:`rsa-public`,components:this._components.publicKey},pem:e})}get subjectAltName(){if(!(!this._components.subjectAltName||this._components.subjectAltName.length===0))return this._components.subjectAltName.join(`, `)}get keyUsage(){}get infoAccess(){}get ca(){return!1}checkHost(e){let t=this._components.subject.match(/CN=([^,]+)/);if(t){let n=t[1].trim();if(matchHostname(n,e))return n}if(this._components.subjectAltName){for(let t of this._components.subjectAltName)if(t.startsWith(`DNS:`)){let n=t.substring(4);if(matchHostname(n,e))return n}}}checkEmail(e){let t=e.toLowerCase(),n=this._components.subject.match(/emailAddress=([^,]+)/);if(n&&n[1].toLowerCase()===t)return n[1]}checkIP(e){if(this._components.subjectAltName){for(let t of this._components.subjectAltName)if(t.startsWith(`IP Address:`)&&t.substring(11)===e)return e}}verify(e){return!0}checkIssued(e){return this.issuer===e.subject}toLegacyObject(){return{subject:parseDNToObject(this._components.subject),issuer:parseDNToObject(this._components.issuer),valid_from:this.validFrom,valid_to:this.validTo,serialNumber:this.serialNumber,fingerprint:this.fingerprint,fingerprint256:this.fingerprint256}}toString(){return this._pem}toJSON(){return this._pem}get[Symbol.toStringTag](){return`X509Certificate`}}}),va=__exportAll$4({DiffieHellman:()=>DiffieHellman,DiffieHellmanGroup:()=>Hi,Hash:()=>Qi,Hmac:()=>Hmac,KeyObject:()=>ha,Sign:()=>Sign,Verify:()=>Verify,X509Certificate:()=>X509Certificate,constants:()=>Ti,createCipher:()=>createCipher,createCipheriv:()=>createCipheriv,createDecipher:()=>createDecipher,createDecipheriv:()=>createDecipheriv,createDiffieHellman:()=>createDiffieHellman,createDiffieHellmanGroup:()=>Vi,createECDH:()=>createECDH,createHash:()=>createHash,createHmac:()=>createHmac,createPrivateKey:()=>createPrivateKey,createPublicKey:()=>createPublicKey,createSecretKey:()=>createSecretKey,createSign:()=>createSign,createVerify:()=>createVerify,default:()=>ya,ecdsaSign:()=>ecdsaSign,ecdsaVerify:()=>ecdsaVerify,getCiphers:()=>getCiphers,getCurves:()=>getCurves,getDiffieHellman:()=>getDiffieHellman,getHashes:()=>getHashes,hash:()=>hash,hkdf:()=>hkdf,hkdfSync:()=>hkdfSync,mgf1:()=>mgf1,pbkdf2:()=>pbkdf2,pbkdf2Sync:()=>pbkdf2Sync,privateDecrypt:()=>privateDecrypt,privateEncrypt:()=>privateEncrypt,publicDecrypt:()=>publicDecrypt,publicEncrypt:()=>publicEncrypt,randomBytes:()=>randomBytes,randomFill:()=>randomFill,randomFillSync:()=>randomFillSync,randomInt:()=>randomInt,randomUUID:()=>randomUUID,rsaOaepDecrypt:()=>rsaOaepDecrypt,rsaOaepEncrypt:()=>rsaOaepEncrypt,rsaPssSign:()=>rsaPssSign,rsaPssVerify:()=>rsaPssVerify,scrypt:()=>scrypt,scryptSync:()=>scryptSync,timingSafeEqual:()=>timingSafeEqual});function createHash(e){return new Qi(e)}function createHmac(e,t){return new Hmac(e,t)}var ya,ba=__esmMin(()=>{Ei(),Di(),Ni(),Fi(),Ui(),Ki(),$i(),ea(),ta(),na(),ra(),ia(),ua(),da(),fa(),pa(),ma(),ga(),_a(),ya={Hash:Qi,getHashes,hash,Hmac,randomBytes,randomFill,randomFillSync,randomUUID,randomInt,timingSafeEqual,constants:Ti,pbkdf2,pbkdf2Sync,hkdf,hkdfSync,scrypt,scryptSync,createHash,createHmac,createCipher,createCipheriv,createDecipher,createDecipheriv,getCiphers,Sign,Verify,createSign,createVerify,createDiffieHellman,getDiffieHellman,DiffieHellman,DiffieHellmanGroup:Hi,createDiffieHellmanGroup:Vi,createECDH,getCurves,ecdsaSign,ecdsaVerify,publicEncrypt,privateDecrypt,privateEncrypt,publicDecrypt,rsaPssSign,rsaPssVerify,rsaOaepEncrypt,rsaOaepDecrypt,mgf1,KeyObject:ha,createSecretKey,createPublicKey,createPrivateKey,X509Certificate}});let xa=!1,Sa,Ca,wa,Ta,Ea,Da,Oa,ka,Aa,ja,Ma,Na,Pa,Fa,Ia,La;async function loadCrypto(){if(xa)return;let e=await Promise.resolve().then(()=>(ba(),va));Sa=e.createHash,Ca=e.createHmac,wa=e.createCipheriv,Ta=e.createDecipheriv,Ea=e.createSign,Da=e.createVerify,Oa=e.pbkdf2Sync,ka=e.hkdfSync,Aa=e.createECDH,ja=e.randomBytes,e.publicEncrypt,e.privateDecrypt,e.createPublicKey,e.createPrivateKey,Ma=e.ecdsaSign,Na=e.ecdsaVerify,Pa=e.rsaPssSign,Fa=e.rsaPssVerify,Ia=e.rsaOaepEncrypt,La=e.rsaOaepDecrypt,xa=!0}const Ra=loadCrypto();var SubtleCrypto=class{async digest(e,t){await Ra;let n=toNodeHashName(normalizeAlgorithm$1(e).name),r=toUint8Array(t),i=Sa(n);i.update(r);let a=i.digest();return a.buffer.slice(a.byteOffset,a.byteOffset+a.byteLength)}async generateKey(e,t,n){await Ra;let r=normalizeAlgorithm$1(e);switch(r.name.toUpperCase()){case`AES-CBC`:case`AES-CTR`:case`AES-GCM`:{let i=e.length;if(![128,192,256].includes(i))throw new DOMException(`Invalid AES key length: ${i}`,`OperationError`);validateUsages(n,[`encrypt`,`decrypt`,`wrapKey`,`unwrapKey`]);let a=ja(i/8);return new CryptoKey(`secret`,t,{name:r.name,length:i},n,new Uint8Array(a))}case`HMAC`:{let r=e,i=normalizeAlgorithm$1(r.hash),a=r.length||hashSize$1(i.name)*8;validateUsages(n,[`sign`,`verify`]);let o=ja(Math.ceil(a/8));return new CryptoKey(`secret`,t,{name:`HMAC`,hash:{name:i.name},length:a},n,new Uint8Array(o))}case`ECDH`:{let r=e.namedCurve,i=toNodeCurveName(r);validateUsages(n,[`deriveKey`,`deriveBits`]);let a=Aa(i);a.generateKeys();let o=new Uint8Array(a.getPublicKey()),s=new Uint8Array(a.getPrivateKey());return{publicKey:new CryptoKey(`public`,!0,{name:`ECDH`,namedCurve:r},[],o),privateKey:new CryptoKey(`private`,t,{name:`ECDH`,namedCurve:r},n,{pub:o,priv:s})}}case`ECDSA`:{let r=e.namedCurve,i=toNodeCurveName(r);validateUsages(n,[`sign`,`verify`]);let a=Aa(i);a.generateKeys();let o=new Uint8Array(a.getPublicKey()),s=new Uint8Array(a.getPrivateKey());return{publicKey:new CryptoKey(`public`,!0,{name:`ECDSA`,namedCurve:r},[`verify`],o),privateKey:new CryptoKey(`private`,t,{name:`ECDSA`,namedCurve:r},[`sign`],{pub:o,priv:s})}}default:throw new DOMException(`Unsupported algorithm: ${r.name}`,`NotSupportedError`)}}async importKey(e,t,n,r,i){await Ra;let a=normalizeAlgorithm$1(n),o=a.name.toUpperCase();switch(o){case`AES-CBC`:case`AES-CTR`:case`AES-GCM`:if(e===`raw`){let e=toUint8Array(t);if(![16,24,32].includes(e.length))throw new DOMException(`Invalid AES key length: ${e.length*8}`,`DataError`);return validateUsages(i,[`encrypt`,`decrypt`,`wrapKey`,`unwrapKey`]),new CryptoKey(`secret`,r,{name:a.name,length:e.length*8},i,new Uint8Array(e))}if(e===`jwk`){let e=t;if(e.kty!==`oct`)throw new DOMException(`JWK kty must be "oct"`,`DataError`);let n=base64urlDecode(e.k);if(![16,24,32].includes(n.length))throw new DOMException(`Invalid AES key length: ${n.length*8}`,`DataError`);return validateUsages(i,[`encrypt`,`decrypt`,`wrapKey`,`unwrapKey`]),new CryptoKey(`secret`,r,{name:a.name,length:n.length*8},i,n)}throw new DOMException(`Unsupported format: ${e}`,`NotSupportedError`);case`HMAC`:{let a=normalizeAlgorithm$1(n.hash);if(e===`raw`){let e=toUint8Array(t);return validateUsages(i,[`sign`,`verify`]),new CryptoKey(`secret`,r,{name:`HMAC`,hash:{name:a.name},length:e.length*8},i,new Uint8Array(e))}if(e===`jwk`){let e=t;if(e.kty!==`oct`)throw new DOMException(`JWK kty must be "oct"`,`DataError`);let n=base64urlDecode(e.k);return validateUsages(i,[`sign`,`verify`]),new CryptoKey(`secret`,r,{name:`HMAC`,hash:{name:a.name},length:n.length*8},i,n)}throw new DOMException(`Unsupported format: ${e}`,`NotSupportedError`)}case`PBKDF2`:if(e===`raw`){let e=toUint8Array(t);return validateUsages(i,[`deriveKey`,`deriveBits`]),new CryptoKey(`secret`,!1,{name:`PBKDF2`},i,new Uint8Array(e))}throw new DOMException(`Unsupported format: ${e}`,`NotSupportedError`);case`HKDF`:if(e===`raw`){let e=toUint8Array(t);return validateUsages(i,[`deriveKey`,`deriveBits`]),new CryptoKey(`secret`,!1,{name:`HKDF`},i,new Uint8Array(e))}throw new DOMException(`Unsupported format: ${e}`,`NotSupportedError`);case`ECDH`:case`ECDSA`:{let s=n.namedCurve;if(e===`raw`){let e=toUint8Array(t);return o===`ECDH`?i.length>0&&validateUsages(i,[`deriveKey`,`deriveBits`]):validateUsages(i,[`verify`]),new CryptoKey(`public`,r,{name:a.name,namedCurve:s},i,new Uint8Array(e))}if(e===`jwk`){let e=t;if(e.kty!==`EC`)throw new DOMException(`JWK kty must be "EC"`,`DataError`);if(e.d){let t=base64urlDecode(e.d),n=base64urlDecode(e.x),c=base64urlDecode(e.y),l=new Uint8Array(1+n.length+c.length);return l[0]=4,l.set(n,1),l.set(c,1+n.length),validateUsages(i,o===`ECDH`?[`deriveKey`,`deriveBits`]:[`sign`]),new CryptoKey(`private`,r,{name:a.name,namedCurve:s},i,{pub:l,priv:t})}else{let t=base64urlDecode(e.x),n=base64urlDecode(e.y),c=new Uint8Array(1+t.length+n.length);return c[0]=4,c.set(t,1),c.set(n,1+t.length),o===`ECDH`?i.length>0&&validateUsages(i,[`deriveKey`,`deriveBits`]):validateUsages(i,[`verify`]),new CryptoKey(`public`,r,{name:a.name,namedCurve:s},i,c)}}throw new DOMException(`Unsupported format: ${e}`,`NotSupportedError`)}default:throw new DOMException(`Unsupported algorithm: ${a.name}`,`NotSupportedError`)}}async exportKey(e,t){if(!t.extractable)throw new DOMException(`Key is not extractable`,`InvalidAccessError`);let n=t.algorithm.name.toUpperCase();if(e===`raw`){if(t.type===`secret`){let e=t._handle;return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}if(t.type===`public`&&(n===`ECDH`||n===`ECDSA`)){let e=t._handle;return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}throw new DOMException(`Cannot export in raw format`,`InvalidAccessError`)}if(e===`jwk`){if(t.type===`secret`){let e=t._handle,r={kty:`oct`,k:base64urlEncode(e),ext:t.extractable,key_ops:[...t.usages]};return n.startsWith(`AES-`)?r.alg=`A${t.algorithm.length}${n.replace(`AES-`,``)}`:n===`HMAC`&&(r.alg=`HS${t.algorithm.hash.name.replace(`SHA-`,``)}`),r}if((n===`ECDH`||n===`ECDSA`)&&(t.type===`public`||t.type===`private`)){let e=t.algorithm.namedCurve,n;n=t.type===`public`?t._handle:t._handle.pub;let r=(n.length-1)/2,i=n.slice(1,1+r),a=n.slice(1+r),o={kty:`EC`,crv:e,x:base64urlEncode(i),y:base64urlEncode(a),ext:t.extractable,key_ops:[...t.usages]};return t.type===`private`&&(o.d=base64urlEncode(t._handle.priv)),o}throw new DOMException(`JWK export not supported for ${n} ${t.type}`,`NotSupportedError`)}throw new DOMException(`Unsupported export format: ${e}`,`NotSupportedError`)}async encrypt(e,t,n){await Ra,checkUsage(t,`encrypt`);let r=normalizeAlgorithm$1(e),i=r.name.toUpperCase(),a=toUint8Array(n);switch(i){case`AES-CBC`:{let n=toUint8Array(e.iv),r=t._handle,i=r.length*8,o=wa(`aes-${i}-cbc`,r,n),s=o.update(a),c=o.final(),l=new Uint8Array(s.length+c.length);return l.set(new Uint8Array(s),0),l.set(new Uint8Array(c),s.length),l.buffer}case`AES-CTR`:{let n=toUint8Array(e.counter),r=t._handle,i=r.length*8,o=wa(`aes-${i}-ctr`,r,n),s=o.update(a),c=o.final(),l=new Uint8Array(s.length+c.length);return l.set(new Uint8Array(s),0),l.set(new Uint8Array(c),s.length),l.buffer}case`AES-GCM`:{let n=e,r=toUint8Array(n.iv),i=n.additionalData?toUint8Array(n.additionalData):void 0,o=t._handle,s=o.length*8,c=wa(`aes-${s}-gcm`,o,r);i&&c.setAAD(i);let l=c.update(a),u=c.final(),d=c.getAuthTag(),p=new Uint8Array(l.length+u.length+d.length);return p.set(new Uint8Array(l),0),p.set(new Uint8Array(u),l.length),p.set(new Uint8Array(d),l.length+u.length),p.buffer}case`RSA-OAEP`:{let n=t.algorithm.hash.name,r=toNodeHashName(n),i=t._handle,o=e,s=o.label?toUint8Array(o.label):void 0,c=Ia(r,i.pem,a,s);return c.buffer.slice(c.byteOffset,c.byteOffset+c.byteLength)}default:throw new DOMException(`Unsupported algorithm: ${r.name}`,`NotSupportedError`)}}async decrypt(e,t,n){await Ra,checkUsage(t,`decrypt`);let r=normalizeAlgorithm$1(e),i=r.name.toUpperCase(),a=toUint8Array(n);switch(i){case`AES-CBC`:{let n=toUint8Array(e.iv),r=t._handle,i=r.length*8,o=Ta(`aes-${i}-cbc`,r,n),s=o.update(a),c=o.final(),l=new Uint8Array(s.length+c.length);return l.set(new Uint8Array(s),0),l.set(new Uint8Array(c),s.length),l.buffer}case`AES-CTR`:{let n=toUint8Array(e.counter),r=t._handle,i=r.length*8,o=Ta(`aes-${i}-ctr`,r,n),s=o.update(a),c=o.final(),l=new Uint8Array(s.length+c.length);return l.set(new Uint8Array(s),0),l.set(new Uint8Array(c),s.length),l.buffer}case`AES-GCM`:{let n=e,r=toUint8Array(n.iv),i=(n.tagLength||128)/8,o=n.additionalData?toUint8Array(n.additionalData):void 0,s=t._handle,c=s.length*8,l=a.slice(0,a.length-i),u=a.slice(a.length-i),d=Ta(`aes-${c}-gcm`,s,r);d.setAuthTag(u),o&&d.setAAD(o);let p=d.update(l),m=d.final(),h=new Uint8Array(p.length+m.length);return h.set(new Uint8Array(p),0),h.set(new Uint8Array(m),p.length),h.buffer}case`RSA-OAEP`:{let n=t.algorithm.hash.name,r=toNodeHashName(n),i=t._handle,o=e,s=o.label?toUint8Array(o.label):void 0,c=La(r,i.pem,a,s);return c.buffer.slice(c.byteOffset,c.byteOffset+c.byteLength)}default:throw new DOMException(`Unsupported algorithm: ${r.name}`,`NotSupportedError`)}}async sign(e,t,n){await Ra,checkUsage(t,`sign`);let r=normalizeAlgorithm$1(e),i=r.name.toUpperCase(),a=toUint8Array(n);switch(i){case`HMAC`:{let e=t.algorithm.hash.name,n=toNodeHashName(e),r=t._handle,i=Ca(n,r);i.update(a);let o=i.digest();return o.buffer.slice(o.byteOffset,o.byteOffset+o.byteLength)}case`RSASSA-PKCS1-V1_5`:{let e=t.algorithm.hash.name,n=toNodeHashName(e),r=t._handle,i=Ea(n);i.update(a);let o=i.sign(r.pem);return o.buffer.slice(o.byteOffset,o.byteOffset+o.byteLength)}case`ECDSA`:{let n=e,r=toNodeHashName(typeof n.hash==`string`?n.hash:n.hash.name),i=t.algorithm.namedCurve,o=t._handle,s=Ma(r,o.priv,a,i);return s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength)}case`RSA-PSS`:{let n=t.algorithm.hash.name,r=toNodeHashName(n),i=t._handle,o=e.saltLength??hashSize$1(n),s=Pa(r,i.pem,a,o);return s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength)}default:throw new DOMException(`Unsupported algorithm: ${r.name}`,`NotSupportedError`)}}async verify(e,t,n,r){await Ra,checkUsage(t,`verify`);let i=normalizeAlgorithm$1(e),a=i.name.toUpperCase(),o=toUint8Array(r),s=toUint8Array(n);switch(a){case`HMAC`:{let e=t.algorithm.hash.name,n=toNodeHashName(e),r=t._handle,i=Ca(n,r);i.update(o);let a=new Uint8Array(i.digest());if(a.length!==s.length)return!1;let c=0;for(let e=0;e<a.length;e++)c|=a[e]^s[e];return c===0}case`RSASSA-PKCS1-V1_5`:{let e=t.algorithm.hash.name,n=toNodeHashName(e),r=t._handle,i=Da(n);return i.update(o),i.verify(r.pem,s)}case`ECDSA`:{let n=e,r=toNodeHashName(typeof n.hash==`string`?n.hash:n.hash.name),i=t.algorithm.namedCurve,a=t._handle;return Na(r,a,s,o,i)}case`RSA-PSS`:{let n=t.algorithm.hash.name,r=toNodeHashName(n),i=t._handle,a=e.saltLength??hashSize$1(n);return Fa(r,i.pem,s,o,a)}default:throw new DOMException(`Unsupported algorithm: ${i.name}`,`NotSupportedError`)}}async _deriveBitsInternal(e,t,n){await Ra;let r=normalizeAlgorithm$1(e);switch(r.name.toUpperCase()){case`PBKDF2`:{let r=e,i=toNodeHashName(normalizeAlgorithm$1(r.hash).name),a=toUint8Array(r.salt),o=r.iterations,s=t._handle,c=Oa(s,a,o,n/8,i);return c.buffer.slice(c.byteOffset,c.byteOffset+c.byteLength)}case`HKDF`:{let r=e,i=toNodeHashName(normalizeAlgorithm$1(r.hash).name),a=toUint8Array(r.salt),o=toUint8Array(r.info),s=t._handle;return ka(i,s,a,o,n/8)}case`ECDH`:{let r=e.public,i=t.algorithm.namedCurve,a=toNodeCurveName(i),o=Aa(a),s=t._handle;o.setPrivateKey(s.priv);let c=r._handle instanceof Uint8Array?r._handle:r._handle.pub,l=o.computeSecret(c),u=new Uint8Array(l);return n?u.buffer.slice(0,n/8):u.buffer.slice(u.byteOffset,u.byteOffset+u.byteLength)}default:throw new DOMException(`Unsupported algorithm: ${r.name}`,`NotSupportedError`)}}async deriveBits(e,t,n){return checkUsage(t,`deriveBits`),this._deriveBitsInternal(e,t,n)}async deriveKey(e,t,n,r,i){checkUsage(t,`deriveKey`);let a=normalizeAlgorithm$1(n),o,s=a.name.toUpperCase();if(s===`AES-CBC`||s===`AES-CTR`||s===`AES-GCM`)o=n.length;else if(s===`HMAC`){let e=n,t=normalizeAlgorithm$1(e.hash);o=e.length||hashSize$1(t.name)*8}else throw new DOMException(`Unsupported derived key algorithm: ${a.name}`,`NotSupportedError`);let c=await this._deriveBitsInternal(e,t,o);return this.importKey(`raw`,c,n,r,i)}async wrapKey(e,t,n,r){throw new DOMException(`wrapKey not yet implemented`,`NotSupportedError`)}async unwrapKey(e,t,n,r,i,a,o){throw new DOMException(`unwrapKey not yet implemented`,`NotSupportedError`)}};const za=globalThis.crypto===void 0?null:globalThis.crypto;var CryptoPolyfill=class{subtle=new SubtleCrypto;getRandomValues(e){if(!(e instanceof Int8Array||e instanceof Uint8Array||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8ClampedArray||e instanceof BigInt64Array||e instanceof BigUint64Array))throw new DOMException(`The provided value is not of type '(Int8Array or Int16Array or Int32Array or Uint8Array or Uint8ClampedArray or Uint16Array or Uint32Array or BigInt64Array or BigUint64Array)'`,`TypeMismatchError`);if(e.byteLength>65536)throw new DOMException(`The ArrayBufferView's byte length exceeds the number of bytes of entropy available via this API (65536)`,`QuotaExceededError`);let t=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);if(za&&typeof za.getRandomValues==`function`)za.getRandomValues(t);else for(let e=0;e<t.length;e++)t[e]=Math.floor(Math.random()*256);return e}randomUUID(){if(za&&typeof za.randomUUID==`function`)return za.randomUUID();let e=new Uint8Array(16);this.getRandomValues(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t=Array.from(e,e=>e.toString(16).padStart(2,`0`)).join(``);return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20)}`}};const Ba=za!==null&&za.subtle!==void 0&&typeof za.subtle.digest==`function`,Va=Ba?za:new CryptoPolyfill;Ba?za.subtle:new SubtleCrypto;const Ha=globalThis;(globalThis.crypto===void 0||globalThis.crypto.subtle===void 0)&&(Ha.crypto=Va);const Ua=typeof process<`u`&&typeof process.versions?.gjs==`string`,Wa=typeof process<`u`&&typeof process.versions?.node==`string`,Ga=Ua?`GJS`:Wa?`Node.js`:`Unknown`;Ua?process.versions.gjs:Wa&&process.versions.node;var Ka,qa,Ja=__esmMin(()=>{Ka=Object.defineProperty,qa=__name((e,t)=>{let n={};for(var r in e)Ka(n,r,{get:e[r],enumerable:!0});return t||Ka(n,Symbol.toStringTag,{value:`Module`}),n},`__exportAll`)});function assertPath(e){if(typeof e!=`string`)throw TypeError(`The "path" argument must be of type string. Received type `+typeof e)}function isPosixPathSeparator(e){return e===47}function isPathSeparator(e){return e===47||e===92}function isWindowsDeviceRoot(e){return e>=65&&e<=90||e>=97&&e<=122}function normalizeString(e,t,n,r){let i=``,a=0,o=-1,s=0,c;for(let l=0;l<=e.length;++l){if(l<e.length)c=e.charCodeAt(l);else if(r(c))break;else c=47;if(r(c)){if(!(o===l-1||s===1))if(o!==l-1&&s===2){if(i.length<2||a!==2||i.charCodeAt(i.length-1)!==46||i.charCodeAt(i.length-2)!==46){if(i.length>2){let e=i.lastIndexOf(n);e===-1?(i=``,a=0):(i=i.slice(0,e),a=i.length-1-i.lastIndexOf(n)),o=l,s=0;continue}else if(i.length===2||i.length===1){i=``,a=0,o=l,s=0;continue}}t&&(i.length>0?i+=`${n}..`:i=`..`,a=2)}else i.length>0?i+=n+e.slice(o+1,l):i=e.slice(o+1,l),a=l-o-1;o=l,s=0}else c===46&&s!==-1?++s:s=-1}return i}function _format(e,t){if(typeof t!=`object`||!t)throw TypeError(`The "pathObject" argument must be of type Object. Received type `+typeof t);let n=t,r=n.dir||n.root,i=n.base||(n.name||``)+formatExt(n.ext);return r?r===n.root?r+i:r+e+i:i}function formatExt(e){return e?`${e[0]===`.`?``:`.`}${e}`:``}var Ya=__esmMin(()=>{});function posixCwd(){if(typeof globalThis.process?.cwd==`function`)return globalThis.process.cwd();try{let e=globalThis.imports?.gi?.GLib;if(e?.get_current_dir)return e.get_current_dir()}catch{}return`/`}function resolve$1(...e){let t=``,n=!1;for(let r=e.length-1;r>=-1&&!n;r--){let i;if(r>=0){if(i=e[r],assertPath(i),i.length===0)continue}else i=posixCwd();t=`${i}/${t}`,n=i.charCodeAt(0)===47}return t=normalizeString(t,!n,`/`,isPosixPathSeparator),n?t.length>0?`/${t}`:`/`:t.length>0?t:`.`}function normalize$1(e){if(assertPath(e),e.length===0)return`.`;let t=e.charCodeAt(0)===47,n=e.charCodeAt(e.length-1)===47,r=normalizeString(e,!t,`/`,isPosixPathSeparator);return r.length===0&&!t&&(r=`.`),r.length>0&&n&&(r+=`/`),t?`/${r}`:r}function isAbsolute$1(e){return assertPath(e),e.length>0&&e.charCodeAt(0)===47}function join$1(...e){if(e.length===0)return`.`;let t;for(let n=0;n<e.length;++n){let r=e[n];assertPath(r),r.length>0&&(t===void 0?t=r:t+=`/${r}`)}return t===void 0?`.`:normalize$1(t)}function relative$1(e,t){if(assertPath(e),assertPath(t),e===t||(e=resolve$1(e),t=resolve$1(t),e===t))return``;let n=e.length,r=n-1,i=1,a=t.length-i,o=r<a?r:a,s=-1,c=0;for(;c<=o;++c){if(c===o){if(a>o){if(t.charCodeAt(i+c)===47)return t.slice(i+c+1);if(c===0)return t.slice(i+c)}else r>o&&(e.charCodeAt(1+c)===47?s=c:c===0&&(s=0));break}let n=e.charCodeAt(1+c);if(n!==t.charCodeAt(i+c))break;n===47&&(s=c)}let l=``;for(c=1+s+1;c<=n;++c)(c===n||e.charCodeAt(c)===47)&&(l.length===0?l+=`..`:l+=`/..`);return l.length>0?l+t.slice(i+s):(i+=s,t.charCodeAt(i)===47&&++i,t.slice(i))}function toNamespacedPath$1(e){return e}function dirname$1(e){if(assertPath(e),e.length===0)return`.`;let t=e.charCodeAt(0)===47,n=-1,r=!0;for(let t=e.length-1;t>=1;--t)if(e.charCodeAt(t)===47){if(!r){n=t;break}}else r=!1;return n===-1?t?`/`:`.`:t&&n===1?`//`:e.slice(0,n)}function basename$1(e,t){t!==void 0&&assertPath(t),assertPath(e);let n=0,r=-1,i=!0;if(t!==void 0&&t.length>0&&t.length<=e.length){if(t.length===e.length&&t===e)return``;let a=t.length-1,o=-1;for(let s=e.length-1;s>=0;--s){let c=e.charCodeAt(s);if(c===47){if(!i){n=s+1;break}}else o===-1&&(i=!1,o=s+1),a>=0&&(c===t.charCodeAt(a)?--a===-1&&(r=s):(a=-1,r=o))}return n===r?r=o:r===-1&&(r=e.length),e.slice(n,r)}else{for(let t=e.length-1;t>=0;--t)if(e.charCodeAt(t)===47){if(!i){n=t+1;break}}else r===-1&&(i=!1,r=t+1);return r===-1?``:e.slice(n,r)}}function extname$1(e){assertPath(e);let t=-1,n=0,r=-1,i=!0,a=0;for(let o=e.length-1;o>=0;--o){let s=e.charCodeAt(o);if(s===47){if(!i){n=o+1;break}continue}r===-1&&(i=!1,r=o+1),s===46?t===-1?t=o:a!==1&&(a=1):t!==-1&&(a=-1)}return t===-1||r===-1||a===0||a===1&&t===r-1&&t===n+1?``:e.slice(t,r)}function format$2(e){if(typeof e!=`object`||!e)throw TypeError(`The "pathObject" argument must be of type Object. Received type `+typeof e);return _format(`/`,e)}function parse$2(e){assertPath(e);let t={root:``,dir:``,base:``,ext:``,name:``};if(e.length===0)return t;let n=e.charCodeAt(0)===47,r;n?(t.root=`/`,r=1):r=0;let i=-1,a=0,o=-1,s=!0,c=e.length-1,l=0;for(;c>=r;--c){let t=e.charCodeAt(c);if(t===47){if(!s){a=c+1;break}continue}o===-1&&(s=!1,o=c+1),t===46?i===-1?i=c:l!==1&&(l=1):i!==-1&&(l=-1)}return i===-1||o===-1||l===0||l===1&&i===o-1&&i===a+1?o!==-1&&(a===0&&n?t.base=t.name=e.slice(1,o):t.base=t.name=e.slice(a,o)):(a===0&&n?(t.name=e.slice(1,i),t.base=e.slice(1,o)):(t.name=e.slice(a,i),t.base=e.slice(a,o)),t.ext=e.slice(i,o)),a>0?t.dir=e.slice(0,a-1):n&&(t.dir=`/`),t}var Xa,Za=__esmMin(()=>{Ja(),Ya(),Xa=qa({basename:()=>basename$1,delimiter:()=>`:`,dirname:()=>dirname$1,extname:()=>extname$1,format:()=>format$2,isAbsolute:()=>isAbsolute$1,join:()=>join$1,normalize:()=>normalize$1,parse:()=>parse$2,relative:()=>relative$1,resolve:()=>resolve$1,sep:()=>`/`,toNamespacedPath:()=>toNamespacedPath$1}),__name(resolve$1,`resolve`),__name(normalize$1,`normalize`),__name(isAbsolute$1,`isAbsolute`),__name(join$1,`join`),__name(relative$1,`relative`),__name(toNamespacedPath$1,`toNamespacedPath`),__name(dirname$1,`dirname`),__name(basename$1,`basename`),__name(extname$1,`extname`),__name(format$2,`format`),__name(parse$2,`parse`)});function resolve(...e){let t=``,n=``,r=!1;for(let i=e.length-1;i>=-1;i--){let a;if(i>=0){if(a=e[i],assertPath(a),a.length===0)continue}else a=(t.length,typeof globalThis.process?.cwd==`function`?globalThis.process.cwd():`/`);let o=a.length,s=0,c=``,l=!1,u=a.charCodeAt(0);if(o>1)if(isPathSeparator(u))if(l=!0,isPathSeparator(a.charCodeAt(1))){let e=2,t=e;for(;e<o&&!isPathSeparator(a.charCodeAt(e));++e);if(e<o&&e!==t){let n=a.slice(t,e);for(t=e;e<o&&isPathSeparator(a.charCodeAt(e));++e);if(e<o&&e!==t){for(t=e;e<o&&!isPathSeparator(a.charCodeAt(e));++e);e===o?(c=`\\\\${n}\\${a.slice(t)}`,s=e):e!==t&&(c=`\\\\${n}\\${a.slice(t,e)}`,s=e)}}}else s=1;else isWindowsDeviceRoot(u)&&a.charCodeAt(1)===58&&(c=a.slice(0,2),s=2,o>2&&isPathSeparator(a.charCodeAt(2))&&(l=!0,s=3));else isPathSeparator(u)&&(s=1,l=!0);if(!(c.length>0&&t.length>0&&c.toLowerCase()!==t.toLowerCase())&&(t.length===0&&c.length>0&&(t=c),r||=(n=`${a.slice(s)}\\${n}`,l),t.length>0&&r))break}return n=normalizeString(n,!r,`\\`,isPathSeparator),t+(r?`\\`:``)+n||`.`}function normalize(e){assertPath(e);let t=e.length;if(t===0)return`.`;let n=0,r,i=!1,a=e.charCodeAt(0);if(t>1)if(isPathSeparator(a))if(i=!0,isPathSeparator(e.charCodeAt(1))){let i=2,a=i;for(;i<t&&!isPathSeparator(e.charCodeAt(i));++i);if(i<t&&i!==a){let o=e.slice(a,i);for(a=i;i<t&&isPathSeparator(e.charCodeAt(i));++i);if(i<t&&i!==a){for(a=i;i<t&&!isPathSeparator(e.charCodeAt(i));++i);if(i===t)return`\\\\${o}\\${e.slice(a)}\\`;i!==a&&(r=`\\\\${o}\\${e.slice(a,i)}`,n=i)}}}else n=1;else isWindowsDeviceRoot(a)&&e.charCodeAt(1)===58&&(r=e.slice(0,2),n=2,t>2&&isPathSeparator(e.charCodeAt(2))&&(i=!0,n=3));else if(isPathSeparator(a))return`\\`;let o;return o=n<t?normalizeString(e.slice(n),!i,`\\`,isPathSeparator):``,o.length===0&&!i&&(o=`.`),o.length>0&&isPathSeparator(e.charCodeAt(t-1))&&(o+=`\\`),r===void 0?i?o.length>0?`\\${o}`:`\\`:o.length>0?o:``:i?o.length>0?`${r}\\${o}`:`${r}\\`:o.length>0?r+o:r}function isAbsolute(e){assertPath(e);let t=e.length;if(t===0)return!1;let n=e.charCodeAt(0);return!!(isPathSeparator(n)||isWindowsDeviceRoot(n)&&t>2&&e.charCodeAt(1)===58&&isPathSeparator(e.charCodeAt(2)))}function join(...e){if(e.length===0)return`.`;let t,n;for(let r=0;r<e.length;++r){let i=e[r];assertPath(i),i.length>0&&(t===void 0?t=n=i:t+=`\\${i}`)}if(t===void 0)return`.`;let r=!0,i=0;if(isPathSeparator(n.charCodeAt(0))){++i;let e=n.length;e>1&&isPathSeparator(n.charCodeAt(1))&&(++i,e>2&&(isPathSeparator(n.charCodeAt(2))?++i:r=!1))}if(r){for(;i<t.length&&isPathSeparator(t.charCodeAt(i));++i);i>=2&&(t=`\\${t.slice(i)}`)}return normalize(t)}function relative(e,t){if(assertPath(e),assertPath(t),e===t)return``;let n=resolve(e),r=resolve(t);if(n===r||(e=n.toLowerCase(),t=r.toLowerCase(),e===t))return``;let i=0;for(;i<e.length&&e.charCodeAt(i)===92;++i);let a=e.length;for(;a-1>i&&e.charCodeAt(a-1)===92;--a);let o=a-i,s=0;for(;s<t.length&&t.charCodeAt(s)===92;++s);let c=t.length;for(;c-1>s&&t.charCodeAt(c-1)===92;--c);let l=c-s,u=o<l?o:l,d=-1,p=0;for(;p<=u;++p){if(p===u){if(l>u){if(t.charCodeAt(s+p)===92)return r.slice(s+p+1);if(p===2)return r.slice(s+p)}o>u&&(e.charCodeAt(i+p)===92?d=p:p===2&&(d=3));break}let n=e.charCodeAt(i+p);if(n!==t.charCodeAt(s+p))break;n===92&&(d=p)}if(p!==u&&d===-1)return r;let m=``;for(d===-1&&(d=0),p=i+d+1;p<=a;++p)(p===a||e.charCodeAt(p)===92)&&(m.length===0?m+=`..`:m+=`\\..`);return m.length>0?m+r.slice(s+d,c):(s+=d,r.charCodeAt(s)===92&&++s,r.slice(s,c))}function toNamespacedPath(e){if(typeof e!=`string`)return e;if(e.length===0)return``;let t=resolve(e);if(t.length>=3){if(t.charCodeAt(0)===92){if(t.charCodeAt(1)===92){let e=t.charCodeAt(2);if(e!==63&&e!==46)return`\\\\?\\UNC\\${t.slice(2)}`}}else if(isWindowsDeviceRoot(t.charCodeAt(0))&&t.charCodeAt(1)===58&&t.charCodeAt(2)===92)return`\\\\?\\${t}`}return e}function dirname(e){assertPath(e);let t=e.length;if(t===0)return`.`;let n=-1,r=-1,i=!0,a=0,o=e.charCodeAt(0);if(t>1)if(isPathSeparator(o)){if(n=a=1,isPathSeparator(e.charCodeAt(1))){let r=2,i=r;for(;r<t&&!isPathSeparator(e.charCodeAt(r));++r);if(r<t&&r!==i){for(i=r;r<t&&isPathSeparator(e.charCodeAt(r));++r);if(r<t&&r!==i){for(i=r;r<t&&!isPathSeparator(e.charCodeAt(r));++r);if(r===t)return e;r!==i&&(n=a=r+1)}}}}else isWindowsDeviceRoot(o)&&e.charCodeAt(1)===58&&(n=a=2,t>2&&isPathSeparator(e.charCodeAt(2))&&(n=a=3));else if(isPathSeparator(o))return e;for(let n=t-1;n>=a;--n)if(isPathSeparator(e.charCodeAt(n))){if(!i){r=n;break}}else i=!1;if(r===-1){if(n===-1)return`.`;r=n}return e.slice(0,r)}function basename(e,t){t!==void 0&&assertPath(t),assertPath(e);let n=0,r=-1,i=!0;if(e.length>=2&&isWindowsDeviceRoot(e.charCodeAt(0))&&e.charCodeAt(1)===58&&(n=2),t!==void 0&&t.length>0&&t.length<=e.length){if(t.length===e.length&&t===e)return``;let a=t.length-1,o=-1;for(let s=e.length-1;s>=n;--s){let c=e.charCodeAt(s);if(isPathSeparator(c)){if(!i){n=s+1;break}}else o===-1&&(i=!1,o=s+1),a>=0&&(c===t.charCodeAt(a)?--a===-1&&(r=s):(a=-1,r=o))}return n===r?r=o:r===-1&&(r=e.length),e.slice(n,r)}else{for(let t=e.length-1;t>=n;--t)if(isPathSeparator(e.charCodeAt(t))){if(!i){n=t+1;break}}else r===-1&&(i=!1,r=t+1);return r===-1?``:e.slice(n,r)}}function extname(e){assertPath(e);let t=0,n=-1,r=0,i=-1,a=!0,o=0;e.length>=2&&e.charCodeAt(1)===58&&isWindowsDeviceRoot(e.charCodeAt(0))&&(t=r=2);for(let s=e.length-1;s>=t;--s){let t=e.charCodeAt(s);if(isPathSeparator(t)){if(!a){r=s+1;break}continue}i===-1&&(a=!1,i=s+1),t===46?n===-1?n=s:o!==1&&(o=1):n!==-1&&(o=-1)}return n===-1||i===-1||o===0||o===1&&n===i-1&&n===r+1?``:e.slice(n,i)}function format$1(e){if(typeof e!=`object`||!e)throw TypeError(`The "pathObject" argument must be of type Object. Received type `+typeof e);return _format(`\\`,e)}function parse$1(e){assertPath(e);let t={root:``,dir:``,base:``,ext:``,name:``};if(e.length===0)return t;let n=e.length,r=0,i=e.charCodeAt(0);if(n>1)if(isPathSeparator(i)){if(r=1,isPathSeparator(e.charCodeAt(1))){let t=2,i=t;for(;t<n&&!isPathSeparator(e.charCodeAt(t));++t);if(t<n&&t!==i){for(i=t;t<n&&isPathSeparator(e.charCodeAt(t));++t);if(t<n&&t!==i){for(i=t;t<n&&!isPathSeparator(e.charCodeAt(t));++t);t===n?r=t:t!==i&&(r=t+1)}}}}else isWindowsDeviceRoot(i)&&e.charCodeAt(1)===58&&(r=2,n>2&&isPathSeparator(e.charCodeAt(2))&&(r=3));else if(isPathSeparator(i))return t.root=t.dir=e,t;r>0&&(t.root=e.slice(0,r));let a=-1,o=r,s=-1,c=!0,l=e.length-1,u=0;for(;l>=r;--l){if(i=e.charCodeAt(l),isPathSeparator(i)){if(!c){o=l+1;break}continue}s===-1&&(c=!1,s=l+1),i===46?a===-1?a=l:u!==1&&(u=1):a!==-1&&(u=-1)}return a===-1||s===-1||u===0||u===1&&a===s-1&&a===o+1?s!==-1&&(t.base=t.name=e.slice(o,s)):(t.name=e.slice(o,a),t.base=e.slice(o,s),t.ext=e.slice(a,s)),o>0&&o!==r?t.dir=e.slice(0,o-1):t.dir=t.root,t}var Qa,$a=__esmMin(()=>{Ja(),Ya(),Qa=qa({basename:()=>basename,delimiter:()=>`;`,dirname:()=>dirname,extname:()=>extname,format:()=>format$1,isAbsolute:()=>isAbsolute,join:()=>join,normalize:()=>normalize,parse:()=>parse$1,relative:()=>relative,resolve:()=>resolve,sep:()=>`\\`,toNamespacedPath:()=>toNamespacedPath}),__name(format$1,`format`),__name(parse$1,`parse`)}),eo=__exportAll$4({basename:()=>co,default:()=>ho,delimiter:()=>mo,dirname:()=>so,extname:()=>lo,format:()=>uo,isAbsolute:()=>ro,join:()=>io,normalize:()=>no,parse:()=>fo,posix:()=>Xa,relative:()=>ao,resolve:()=>to,sep:()=>po,toNamespacedPath:()=>oo,win32:()=>Qa}),to,no,ro,io,ao,oo,so,co,lo,uo,fo,po,mo,ho,go=__esmMin(()=>{Za(),$a(),{resolve:to,normalize:no,isAbsolute:ro,join:io,relative:ao,toNamespacedPath:oo,dirname:so,basename:co,extname:lo,format:uo,parse:fo,sep:po,delimiter:mo}=Xa,ho={resolve:resolve$1,normalize:normalize$1,isAbsolute:isAbsolute$1,join:join$1,relative:relative$1,toNamespacedPath:toNamespacedPath$1,dirname:dirname$1,basename:basename$1,extname:extname$1,format:format$2,parse:parse$2,sep:`/`,delimiter:`:`,posix:Xa,win32:Qa}}),_o=__commonJSMin(((e,t)=>{var n=1e3,r=n*60,i=r*60,a=i*24,o=a*7,s=a*365.25;t.exports=function(e,t){t||={};var n=typeof e;if(n===`string`&&e.length>0)return parse(e);if(n===`number`&&isFinite(e))return t.long?fmtLong(e):fmtShort(e);throw Error(`val is not a non-empty string or a valid number. val=`+JSON.stringify(e))};function parse(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var c=parseFloat(t[1]);switch((t[2]||`ms`).toLowerCase()){case`years`:case`year`:case`yrs`:case`yr`:case`y`:return c*s;case`weeks`:case`week`:case`w`:return c*o;case`days`:case`day`:case`d`:return c*a;case`hours`:case`hour`:case`hrs`:case`hr`:case`h`:return c*i;case`minutes`:case`minute`:case`mins`:case`min`:case`m`:return c*r;case`seconds`:case`second`:case`secs`:case`sec`:case`s`:return c*n;case`milliseconds`:case`millisecond`:case`msecs`:case`msec`:case`ms`:return c;default:return}}}}function fmtShort(e){var t=Math.abs(e);return t>=a?Math.round(e/a)+`d`:t>=i?Math.round(e/i)+`h`:t>=r?Math.round(e/r)+`m`:t>=n?Math.round(e/n)+`s`:e+`ms`}function fmtLong(e){var t=Math.abs(e);return t>=a?plural(e,t,a,`day`):t>=i?plural(e,t,i,`hour`):t>=r?plural(e,t,r,`minute`):t>=n?plural(e,t,n,`second`):e+` ms`}function plural(e,t,n,r){var i=t>=n*1.5;return Math.round(e/n)+` `+r+(i?`s`:``)}})),vo=__commonJSMin(((e,t)=>{I();function setup(e){createDebug.debug=createDebug,createDebug.default=createDebug,createDebug.coerce=coerce,createDebug.disable=disable,createDebug.enable=enable,createDebug.enabled=enabled,createDebug.humanize=_o(),createDebug.destroy=destroy,Object.keys(e).forEach(t=>{createDebug[t]=e[t]}),createDebug.names=[],createDebug.skips=[],createDebug.formatters={};function selectColor(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return createDebug.colors[Math.abs(t)%createDebug.colors.length]}createDebug.selectColor=selectColor;function createDebug(e){let t,n=null,r,i;function debug(...e){if(!debug.enabled)return;let n=debug,r=Number(new Date);n.diff=r-(t||r),n.prev=t,n.curr=r,t=r,e[0]=createDebug.coerce(e[0]),typeof e[0]!=`string`&&e.unshift(`%O`);let i=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(t,r)=>{if(t===`%%`)return`%`;i++;let a=createDebug.formatters[r];if(typeof a==`function`){let r=e[i];t=a.call(n,r),e.splice(i,1),i--}return t}),createDebug.formatArgs.call(n,e),(n.log||createDebug.log).apply(n,e)}return debug.namespace=e,debug.useColors=createDebug.useColors(),debug.color=createDebug.selectColor(e),debug.extend=extend,debug.destroy=createDebug.destroy,Object.defineProperty(debug,`enabled`,{enumerable:!0,configurable:!1,get:()=>n===null?(r!==createDebug.namespaces&&(r=createDebug.namespaces,i=createDebug.enabled(e)),i):n,set:e=>{n=e}}),typeof createDebug.init==`function`&&createDebug.init(debug),debug}function extend(e,t){let n=createDebug(this.namespace+(t===void 0?`:`:t)+e);return n.log=this.log,n}function enable(e){createDebug.save(e),createDebug.namespaces=e,createDebug.names=[],createDebug.skips=[];let t=(typeof e==`string`?e:``).trim().replace(/\s+/g,`,`).split(`,`).filter(Boolean);for(let e of t)e[0]===`-`?createDebug.skips.push(e.slice(1)):createDebug.names.push(e)}function matchesTemplate(e,t){let n=0,r=0,i=-1,a=0;for(;n<e.length;)if(r<t.length&&(t[r]===e[n]||t[r]===`*`))t[r]===`*`?(i=r,a=n,r++):(n++,r++);else if(i!==-1)r=i+1,a++,n=a;else return!1;for(;r<t.length&&t[r]===`*`;)r++;return r===t.length}function disable(){let e=[...createDebug.names,...createDebug.skips.map(e=>`-`+e)].join(`,`);return createDebug.enable(``),e}function enabled(e){for(let t of createDebug.skips)if(matchesTemplate(e,t))return!1;for(let t of createDebug.names)if(matchesTemplate(e,t))return!0;return!1}function coerce(e){return e instanceof Error?e.stack||e.message:e}function destroy(){F.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return createDebug.enable(createDebug.load()),createDebug}t.exports=setup})),yo=__commonJSMin(((e,t)=>{I(),e.formatArgs=formatArgs,e.save=save,e.load=load,e.useColors=useColors,e.storage=localstorage(),e.destroy=(()=>{let e=!1;return()=>{e||(e=!0,F.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.colors=`#0000CC.#0000FF.#0033CC.#0033FF.#0066CC.#0066FF.#0099CC.#0099FF.#00CC00.#00CC33.#00CC66.#00CC99.#00CCCC.#00CCFF.#3300CC.#3300FF.#3333CC.#3333FF.#3366CC.#3366FF.#3399CC.#3399FF.#33CC00.#33CC33.#33CC66.#33CC99.#33CCCC.#33CCFF.#6600CC.#6600FF.#6633CC.#6633FF.#66CC00.#66CC33.#9900CC.#9900FF.#9933CC.#9933FF.#99CC00.#99CC33.#CC0000.#CC0033.#CC0066.#CC0099.#CC00CC.#CC00FF.#CC3300.#CC3333.#CC3366.#CC3399.#CC33CC.#CC33FF.#CC6600.#CC6633.#CC9900.#CC9933.#CCCC00.#CCCC33.#FF0000.#FF0033.#FF0066.#FF0099.#FF00CC.#FF00FF.#FF3300.#FF3333.#FF3366.#FF3399.#FF33CC.#FF33FF.#FF6600.#FF6633.#FF9900.#FF9933.#FFCC00.#FFCC33`.split(`.`);function useColors(){if(typeof globalThis<`u`&&globalThis.process&&(globalThis.process.type===`renderer`||globalThis.process.__nwjs))return!0;if(typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return typeof document<`u`&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof globalThis<`u`&&globalThis.console&&(globalThis.console.firebug||globalThis.console.exception&&globalThis.console.table)||typeof navigator<`u`&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function formatArgs(e){if(e[0]=(this.useColors?`%c`:``)+this.namespace+(this.useColors?` %c`:` `)+e[0]+(this.useColors?`%c `:` `)+`+`+t.exports.humanize(this.diff),!this.useColors)return;let n=`color: `+this.color;e.splice(1,0,n,`color: inherit`);let r=0,i=0;e[0].replace(/%[a-zA-Z%]/g,e=>{e!==`%%`&&(r++,e===`%c`&&(i=r))}),e.splice(i,0,n)}e.log=F.debug||F.log||(()=>{});function save(t){try{t?e.storage.setItem(`debug`,t):e.storage.removeItem(`debug`)}catch{}}function load(){let t;try{t=e.storage.getItem(`debug`)||e.storage.getItem(`DEBUG`)}catch{}return!t&&typeof process<`u`&&`env`in process&&(t=process.env.DEBUG),t}function localstorage(){try{return localStorage}catch{}}t.exports=vo()(e);let{formatters:n}=t.exports;n.j=function(e){try{return JSON.stringify(e)}catch(e){return`[UnexpectedJSONParseError]: `+e.message}}})),bo=__commonJSMin(((e,t)=>{t.exports=depd;function depd(e){if(!e)throw TypeError(`argument namespace is required`);function deprecate(e){}return deprecate._file=void 0,deprecate._ignored=!0,deprecate._namespace=e,deprecate._traced=!1,deprecate._warned=Object.create(null),deprecate.function=wrapfunction,deprecate.property=wrapproperty,deprecate}function wrapfunction(e,t){if(typeof e!=`function`)throw TypeError(`argument fn must be a function`);return e}function wrapproperty(e,t,n){if(!e||typeof e!=`object`&&typeof e!=`function`)throw TypeError(`argument obj must be object`);var r=Object.getOwnPropertyDescriptor(e,t);if(!r)throw TypeError(`must call property on owner object`);if(!r.configurable)throw TypeError(`property must be configurable`)}})),xo=__commonJSMin(((e,t)=>{t.exports=Object.setPrototypeOf||({__proto__:[]}instanceof Array?setProtoOf:mixinProperties);function setProtoOf(e,t){return e.__proto__=t,e}function mixinProperties(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(e,n)||(e[n]=t[n]);return e}})),So=__commonJSMin(((e,t)=>{t.exports={100:`Continue`,101:`Switching Protocols`,102:`Processing`,103:`Early Hints`,200:`OK`,201:`Created`,202:`Accepted`,203:`Non-Authoritative Information`,204:`No Content`,205:`Reset Content`,206:`Partial Content`,207:`Multi-Status`,208:`Already Reported`,226:`IM Used`,300:`Multiple Choices`,301:`Moved Permanently`,302:`Found`,303:`See Other`,304:`Not Modified`,305:`Use Proxy`,307:`Temporary Redirect`,308:`Permanent Redirect`,400:`Bad Request`,401:`Unauthorized`,402:`Payment Required`,403:`Forbidden`,404:`Not Found`,405:`Method Not Allowed`,406:`Not Acceptable`,407:`Proxy Authentication Required`,408:`Request Timeout`,409:`Conflict`,410:`Gone`,411:`Length Required`,412:`Precondition Failed`,413:`Payload Too Large`,414:`URI Too Long`,415:`Unsupported Media Type`,416:`Range Not Satisfiable`,417:`Expectation Failed`,418:`I'm a Teapot`,421:`Misdirected Request`,422:`Unprocessable Entity`,423:`Locked`,424:`Failed Dependency`,425:`Too Early`,426:`Upgrade Required`,428:`Precondition Required`,429:`Too Many Requests`,431:`Request Header Fields Too Large`,451:`Unavailable For Legal Reasons`,500:`Internal Server Error`,501:`Not Implemented`,502:`Bad Gateway`,503:`Service Unavailable`,504:`Gateway Timeout`,505:`HTTP Version Not Supported`,506:`Variant Also Negotiates`,507:`Insufficient Storage`,508:`Loop Detected`,509:`Bandwidth Limit Exceeded`,510:`Not Extended`,511:`Network Authentication Required`}})),Co=__commonJSMin(((e,t)=>{var n=So();t.exports=status,status.message=n,status.code=createMessageToStatusCodeMap(n),status.codes=createStatusCodeList(n),status.redirect={300:!0,301:!0,302:!0,303:!0,305:!0,307:!0,308:!0},status.empty={204:!0,205:!0,304:!0},status.retry={502:!0,503:!0,504:!0};function createMessageToStatusCodeMap(e){var t={};return Object.keys(e).forEach(function forEachCode(n){var r=e[n],i=Number(n);t[r.toLowerCase()]=i}),t}function createStatusCodeList(e){return Object.keys(e).map(function mapCode(e){return Number(e)})}function getStatusCode(e){var t=e.toLowerCase();if(!Object.prototype.hasOwnProperty.call(status.code,t))throw Error(`invalid status message: "`+e+`"`);return status.code[t]}function getStatusMessage(e){if(!Object.prototype.hasOwnProperty.call(status.message,e))throw Error(`invalid status code: `+e);return status.message[e]}function status(e){if(typeof e==`number`)return getStatusMessage(e);if(typeof e!=`string`)throw TypeError(`code must be a number or string`);var t=parseInt(e,10);return isNaN(t)?getStatusCode(e):getStatusMessage(t)}})),wo=__commonJSMin(((e,t)=>{typeof Object.create==`function`?t.exports=function inherits(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function inherits(e,t){if(t){e.super_=t;var TempCtor=function(){};TempCtor.prototype=t.prototype,e.prototype=new TempCtor,e.prototype.constructor=e}}})),To=__commonJSMin(((e,t)=>{t.exports=toIdentifier;function toIdentifier(e){return e.split(` `).map(function(e){return e.slice(0,1).toUpperCase()+e.slice(1)}).join(``).replace(/[^ _0-9a-z]/gi,``)}})),Eo=__commonJSMin(((e,t)=>{var n=bo()(`http-errors`),r=xo(),i=Co(),a=wo(),o=To();t.exports=createError,t.exports.HttpError=createHttpErrorConstructor(),t.exports.isHttpError=createIsHttpErrorFunction(t.exports.HttpError),populateConstructorExports(t.exports,i.codes,t.exports.HttpError);function codeClass(e){return Number(String(e).charAt(0)+`00`)}function createError(){for(var e,t,r=500,a={},o=0;o<arguments.length;o++){var s=arguments[o],c=typeof s;if(c===`object`&&s instanceof Error)e=s,r=e.status||e.statusCode||r;else if(c===`number`&&o===0)r=s;else if(c===`string`)t=s;else if(c===`object`)a=s;else throw TypeError(`argument #`+(o+1)+` unsupported type `+c)}typeof r==`number`&&(r<400||r>=600)&&n(`non-error status code; use only 4xx or 5xx status codes`),(typeof r!=`number`||!i.message[r]&&(r<400||r>=600))&&(r=500);var l=createError[r]||createError[codeClass(r)];for(var u in e||(e=l?new l(t):Error(t||i.message[r]),Error.captureStackTrace(e,createError)),(!l||!(e instanceof l)||e.status!==r)&&(e.expose=r<500,e.status=e.statusCode=r),a)u!==`status`&&u!==`statusCode`&&(e[u]=a[u]);return e}function createHttpErrorConstructor(){function HttpError(){throw TypeError(`cannot construct abstract class`)}return a(HttpError,Error),HttpError}function createClientErrorConstructor(e,t,n){var o=toClassName(t);function ClientError(e){var t=e??i.message[n],a=Error(t);return Error.captureStackTrace(a,ClientError),r(a,ClientError.prototype),Object.defineProperty(a,`message`,{enumerable:!0,configurable:!0,value:t,writable:!0}),Object.defineProperty(a,`name`,{enumerable:!1,configurable:!0,value:o,writable:!0}),a}return a(ClientError,e),nameFunc(ClientError,o),ClientError.prototype.status=n,ClientError.prototype.statusCode=n,ClientError.prototype.expose=!0,ClientError}function createIsHttpErrorFunction(e){return function isHttpError(t){return!t||typeof t!=`object`?!1:t instanceof e?!0:t instanceof Error&&typeof t.expose==`boolean`&&typeof t.statusCode==`number`&&t.status===t.statusCode}}function createServerErrorConstructor(e,t,n){var o=toClassName(t);function ServerError(e){var t=e??i.message[n],a=Error(t);return Error.captureStackTrace(a,ServerError),r(a,ServerError.prototype),Object.defineProperty(a,`message`,{enumerable:!0,configurable:!0,value:t,writable:!0}),Object.defineProperty(a,`name`,{enumerable:!1,configurable:!0,value:o,writable:!0}),a}return a(ServerError,e),nameFunc(ServerError,o),ServerError.prototype.status=n,ServerError.prototype.statusCode=n,ServerError.prototype.expose=!1,ServerError}function nameFunc(e,t){var n=Object.getOwnPropertyDescriptor(e,`name`);n&&n.configurable&&(n.value=t,Object.defineProperty(e,`name`,n))}function populateConstructorExports(e,t,n){t.forEach(function forEachCode(t){var r,a=o(i.message[t]);switch(codeClass(t)){case 400:r=createClientErrorConstructor(n,a,t);break;case 500:r=createServerErrorConstructor(n,a,t);break}r&&(e[t]=r,e[a]=r)})}function toClassName(e){return e.slice(-5)===`Error`?e:e+`Error`}})),Do=__commonJSMin(((e,t)=>{t.exports=bytes,t.exports.format=format,t.exports.parse=parse;var n=/\B(?=(\d{3})+(?!\d))/g,r=/(?:\.0*|(\.[^0]+)0+)$/,i={b:1,kb:1024,mb:1<<20,gb:1<<30,tb:1024**4,pb:1024**5},a=/^((-|\+)?(\d+(?:\.\d+)?)) *(kb|mb|gb|tb|pb)$/i;function bytes(e,t){return typeof e==`string`?parse(e):typeof e==`number`?format(e,t):null}function format(e,t){if(!Number.isFinite(e))return null;var a=Math.abs(e),o=t&&t.thousandsSeparator||``,s=t&&t.unitSeparator||``,c=t&&t.decimalPlaces!==void 0?t.decimalPlaces:2,l=!!(t&&t.fixedDecimals),u=t&&t.unit||``;(!u||!i[u.toLowerCase()])&&(u=a>=i.pb?`PB`:a>=i.tb?`TB`:a>=i.gb?`GB`:a>=i.mb?`MB`:a>=i.kb?`KB`:`B`);var d=(e/i[u.toLowerCase()]).toFixed(c);return l||(d=d.replace(r,`$1`)),o&&(d=d.split(`.`).map(function(e,t){return t===0?e.replace(n,o):e}).join(`.`)),d+s+u}function parse(e){if(typeof e==`number`&&!isNaN(e))return e;if(typeof e!=`string`)return null;var t=a.exec(e),n,r=`b`;return t?(n=parseFloat(t[1]),r=t[4].toLowerCase()):(n=parseInt(e,10),r=`b`),isNaN(n)?null:Math.floor(i[r]*n)}})),Oo=__commonJSMin(((e,t)=>{var n=(J(),__toCommonJS(Yt)),r=n.Buffer,i={},a;for(a in n)n.hasOwnProperty(a)&&(a===`SlowBuffer`||a===`Buffer`||(i[a]=n[a]));var o=i.Buffer={};for(a in r)r.hasOwnProperty(a)&&(a===`allocUnsafe`||a===`allocUnsafeSlow`||(o[a]=r[a]));if(i.Buffer.prototype=r.prototype,(!o.from||o.from===Uint8Array.from)&&(o.from=function(e,t,n){if(typeof e==`number`)throw TypeError(`The "value" argument must not be of type number. Received type `+typeof e);if(e&&e.length===void 0)throw TypeError(`The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type `+typeof e);return r(e,t,n)}),o.alloc||=function(e,t,n){if(typeof e!=`number`)throw TypeError(`The "size" argument must be of type number. Received type `+typeof e);if(e<0||e>=2*(1<<30))throw RangeError(`The value "`+e+`" is invalid for option "size"`);var i=r(e);return!t||t.length===0?i.fill(0):typeof n==`string`?i.fill(t,n):i.fill(t),i},!i.kStringMaxLength)try{i.kStringMaxLength=process.binding(`buffer`).kStringMaxLength}catch{}i.constants||(i.constants={MAX_LENGTH:i.kMaxLength},i.kStringMaxLength&&(i.constants.MAX_STRING_LENGTH=i.kStringMaxLength)),t.exports=i})),ko=__commonJSMin((e=>{var t=``;e.PrependBOM=PrependBOMWrapper;function PrependBOMWrapper(e,t){this.encoder=e,this.addBOM=!0}PrependBOMWrapper.prototype.write=function(e){return this.addBOM&&=(e=t+e,!1),this.encoder.write(e)},PrependBOMWrapper.prototype.end=function(){return this.encoder.end()},e.StripBOM=StripBOMWrapper;function StripBOMWrapper(e,t){this.decoder=e,this.pass=!1,this.options=t||{}}StripBOMWrapper.prototype.write=function(e){var n=this.decoder.write(e);return this.pass||!n?n:(n[0]===t&&(n=n.slice(1),typeof this.options.stripBOM==`function`&&this.options.stripBOM()),this.pass=!0,n)},StripBOMWrapper.prototype.end=function(){return this.decoder.end()}})),Ao=__commonJSMin(((e,t)=>{var n=Object.hasOwn===void 0?Function.call.bind(Object.prototype.hasOwnProperty):Object.hasOwn;function mergeModules(e,t){for(var r in t)n(t,r)&&(e[r]=t[r])}t.exports=mergeModules})),jo=__commonJSMin(((e,t)=>{var n=Oo().Buffer;t.exports={utf8:{type:`_internal`,bomAware:!0},cesu8:{type:`_internal`,bomAware:!0},unicode11utf8:`utf8`,ucs2:{type:`_internal`,bomAware:!0},utf16le:`ucs2`,binary:{type:`_internal`},base64:{type:`_internal`},hex:{type:`_internal`},_internal:InternalCodec};function InternalCodec(e,t){this.enc=e.encodingName,this.bomAware=e.bomAware,this.enc===`base64`?this.encoder=InternalEncoderBase64:this.enc===`utf8`?this.encoder=InternalEncoderUtf8:this.enc===`cesu8`&&(this.enc=`utf8`,this.encoder=InternalEncoderCesu8,n.from(`eda0bdedb2a9`,`hex`).toString()!==`💩`&&(this.decoder=InternalDecoderCesu8,this.defaultCharUnicode=t.defaultCharUnicode))}InternalCodec.prototype.encoder=InternalEncoder,InternalCodec.prototype.decoder=InternalDecoder;var r=(Cn(),__toCommonJS(bn)).StringDecoder;function InternalDecoder(e,t){this.decoder=new r(t.enc)}InternalDecoder.prototype.write=function(e){return n.isBuffer(e)||(e=n.from(e)),this.decoder.write(e)},InternalDecoder.prototype.end=function(){return this.decoder.end()};function InternalEncoder(e,t){this.enc=t.enc}InternalEncoder.prototype.write=function(e){return n.from(e,this.enc)},InternalEncoder.prototype.end=function(){};function InternalEncoderBase64(e,t){this.prevStr=``}InternalEncoderBase64.prototype.write=function(e){e=this.prevStr+e;var t=e.length-e.length%4;return this.prevStr=e.slice(t),e=e.slice(0,t),n.from(e,`base64`)},InternalEncoderBase64.prototype.end=function(){return n.from(this.prevStr,`base64`)};function InternalEncoderCesu8(e,t){}InternalEncoderCesu8.prototype.write=function(e){for(var t=n.alloc(e.length*3),r=0,i=0;i<e.length;i++){var a=e.charCodeAt(i);a<128?t[r++]=a:a<2048?(t[r++]=192+(a>>>6),t[r++]=128+(a&63)):(t[r++]=224+(a>>>12),t[r++]=128+(a>>>6&63),t[r++]=128+(a&63))}return t.slice(0,r)},InternalEncoderCesu8.prototype.end=function(){};function InternalDecoderCesu8(e,t){this.acc=0,this.contBytes=0,this.accBytes=0,this.defaultCharUnicode=t.defaultCharUnicode}InternalDecoderCesu8.prototype.write=function(e){for(var t=this.acc,n=this.contBytes,r=this.accBytes,i=``,a=0;a<e.length;a++){var o=e[a];(o&192)==128?n>0?(t=t<<6|o&63,n--,r++,n===0&&(r===2&&t<128&&t>0||r===3&&t<2048?i+=this.defaultCharUnicode:i+=String.fromCharCode(t))):i+=this.defaultCharUnicode:(n>0&&(i+=this.defaultCharUnicode,n=0),o<128?i+=String.fromCharCode(o):o<224?(t=o&31,n=1,r=1):o<240?(t=o&15,n=2,r=1):i+=this.defaultCharUnicode)}return this.acc=t,this.contBytes=n,this.accBytes=r,i},InternalDecoderCesu8.prototype.end=function(){var e=0;return this.contBytes>0&&(e+=this.defaultCharUnicode),e};function InternalEncoderUtf8(e,t){this.highSurrogate=``}InternalEncoderUtf8.prototype.write=function(e){if(this.highSurrogate&&=(e=this.highSurrogate+e,``),e.length>0){var t=e.charCodeAt(e.length-1);t>=55296&&t<56320&&(this.highSurrogate=e[e.length-1],e=e.slice(0,e.length-1))}return n.from(e,this.enc)},InternalEncoderUtf8.prototype.end=function(){if(this.highSurrogate){var e=this.highSurrogate;return this.highSurrogate=``,n.from(e,this.enc)}}})),Mo=__commonJSMin((e=>{var t=Oo().Buffer;e._utf32=Utf32Codec;function Utf32Codec(e,t){this.iconv=t,this.bomAware=!0,this.isLE=e.isLE}e.utf32le={type:`_utf32`,isLE:!0},e.utf32be={type:`_utf32`,isLE:!1},e.ucs4le=`utf32le`,e.ucs4be=`utf32be`,Utf32Codec.prototype.encoder=Utf32Encoder,Utf32Codec.prototype.decoder=Utf32Decoder;function Utf32Encoder(e,t){this.isLE=t.isLE,this.highSurrogate=0}Utf32Encoder.prototype.write=function(e){for(var n=t.from(e,`ucs2`),r=t.alloc(n.length*2),i=this.isLE?r.writeUInt32LE:r.writeUInt32BE,a=0,o=0;o<n.length;o+=2){var s=n.readUInt16LE(o),c=s>=55296&&s<56320,l=s>=56320&&s<57344;if(this.highSurrogate)if(c||!l)i.call(r,this.highSurrogate,a),a+=4;else{var u=(this.highSurrogate-55296<<10|s-56320)+65536;i.call(r,u,a),a+=4,this.highSurrogate=0;continue}c?this.highSurrogate=s:(i.call(r,s,a),a+=4,this.highSurrogate=0)}return a<r.length&&(r=r.slice(0,a)),r},Utf32Encoder.prototype.end=function(){if(this.highSurrogate){var e=t.alloc(4);return this.isLE?e.writeUInt32LE(this.highSurrogate,0):e.writeUInt32BE(this.highSurrogate,0),this.highSurrogate=0,e}};function Utf32Decoder(e,t){this.isLE=t.isLE,this.badChar=t.iconv.defaultCharUnicode.charCodeAt(0),this.overflow=[]}Utf32Decoder.prototype.write=function(e){if(e.length===0)return``;var n=0,r=0,i=t.alloc(e.length+4),a=0,o=this.isLE,s=this.overflow,c=this.badChar;if(s.length>0){for(;n<e.length&&s.length<4;n++)s.push(e[n]);s.length===4&&(r=o?s[n]|s[n+1]<<8|s[n+2]<<16|s[n+3]<<24:s[n+3]|s[n+2]<<8|s[n+1]<<16|s[n]<<24,s.length=0,a=_writeCodepoint(i,a,r,c))}for(;n<e.length-3;n+=4)r=o?e[n]|e[n+1]<<8|e[n+2]<<16|e[n+3]<<24:e[n+3]|e[n+2]<<8|e[n+1]<<16|e[n]<<24,a=_writeCodepoint(i,a,r,c);for(;n<e.length;n++)s.push(e[n]);return i.slice(0,a).toString(`ucs2`)};function _writeCodepoint(e,t,n,r){if((n<0||n>1114111)&&(n=r),n>=65536){n-=65536;var i=55296|n>>10;e[t++]=i&255,e[t++]=i>>8;var n=56320|n&1023}return e[t++]=n&255,e[t++]=n>>8,t}Utf32Decoder.prototype.end=function(){this.overflow.length=0},e.utf32=Utf32AutoCodec,e.ucs4=`utf32`;function Utf32AutoCodec(e,t){this.iconv=t}Utf32AutoCodec.prototype.encoder=Utf32AutoEncoder,Utf32AutoCodec.prototype.decoder=Utf32AutoDecoder;function Utf32AutoEncoder(e,t){e||={},e.addBOM===void 0&&(e.addBOM=!0),this.encoder=t.iconv.getEncoder(e.defaultEncoding||`utf-32le`,e)}Utf32AutoEncoder.prototype.write=function(e){return this.encoder.write(e)},Utf32AutoEncoder.prototype.end=function(){return this.encoder.end()};function Utf32AutoDecoder(e,t){this.decoder=null,this.initialBufs=[],this.initialBufsLen=0,this.options=e||{},this.iconv=t.iconv}Utf32AutoDecoder.prototype.write=function(e){if(!this.decoder){if(this.initialBufs.push(e),this.initialBufsLen+=e.length,this.initialBufsLen<32)return``;var t=detectEncoding(this.initialBufs,this.options.defaultEncoding);this.decoder=this.iconv.getDecoder(t,this.options);for(var n=``,r=0;r<this.initialBufs.length;r++)n+=this.decoder.write(this.initialBufs[r]);return this.initialBufs.length=this.initialBufsLen=0,n}return this.decoder.write(e)},Utf32AutoDecoder.prototype.end=function(){if(!this.decoder){var e=detectEncoding(this.initialBufs,this.options.defaultEncoding);this.decoder=this.iconv.getDecoder(e,this.options);for(var t=``,n=0;n<this.initialBufs.length;n++)t+=this.decoder.write(this.initialBufs[n]);var r=this.decoder.end();return r&&(t+=r),this.initialBufs.length=this.initialBufsLen=0,t}return this.decoder.end()};function detectEncoding(e,t){var n=[],r=0,i=0,a=0,o=0,s=0;outerLoop:for(var c=0;c<e.length;c++)for(var l=e[c],u=0;u<l.length;u++)if(n.push(l[u]),n.length===4){if(r===0){if(n[0]===255&&n[1]===254&&n[2]===0&&n[3]===0)return`utf-32le`;if(n[0]===0&&n[1]===0&&n[2]===254&&n[3]===255)return`utf-32be`}if((n[0]!==0||n[1]>16)&&a++,(n[3]!==0||n[2]>16)&&i++,n[0]===0&&n[1]===0&&(n[2]!==0||n[3]!==0)&&s++,(n[0]!==0||n[1]!==0)&&n[2]===0&&n[3]===0&&o++,n.length=0,r++,r>=100)break outerLoop}return s-a>o-i?`utf-32be`:s-a<o-i?`utf-32le`:t||`utf-32le`}})),No=__commonJSMin((e=>{var t=Oo().Buffer;e.utf16be=Utf16BECodec;function Utf16BECodec(){}Utf16BECodec.prototype.encoder=Utf16BEEncoder,Utf16BECodec.prototype.decoder=Utf16BEDecoder,Utf16BECodec.prototype.bomAware=!0;function Utf16BEEncoder(){}Utf16BEEncoder.prototype.write=function(e){for(var n=t.from(e,`ucs2`),r=0;r<n.length;r+=2){var i=n[r];n[r]=n[r+1],n[r+1]=i}return n},Utf16BEEncoder.prototype.end=function(){};function Utf16BEDecoder(){this.overflowByte=-1}Utf16BEDecoder.prototype.write=function(e){if(e.length==0)return``;var n=t.alloc(e.length+1),r=0,i=0;for(this.overflowByte!==-1&&(n[0]=e[0],n[1]=this.overflowByte,r=1,i=2);r<e.length-1;r+=2,i+=2)n[i]=e[r+1],n[i+1]=e[r];return this.overflowByte=r==e.length-1?e[e.length-1]:-1,n.slice(0,i).toString(`ucs2`)},Utf16BEDecoder.prototype.end=function(){this.overflowByte=-1},e.utf16=Utf16Codec;function Utf16Codec(e,t){this.iconv=t}Utf16Codec.prototype.encoder=Utf16Encoder,Utf16Codec.prototype.decoder=Utf16Decoder;function Utf16Encoder(e,t){e||={},e.addBOM===void 0&&(e.addBOM=!0),this.encoder=t.iconv.getEncoder(`utf-16le`,e)}Utf16Encoder.prototype.write=function(e){return this.encoder.write(e)},Utf16Encoder.prototype.end=function(){return this.encoder.end()};function Utf16Decoder(e,t){this.decoder=null,this.initialBufs=[],this.initialBufsLen=0,this.options=e||{},this.iconv=t.iconv}Utf16Decoder.prototype.write=function(e){if(!this.decoder){if(this.initialBufs.push(e),this.initialBufsLen+=e.length,this.initialBufsLen<16)return``;var t=detectEncoding(this.initialBufs,this.options.defaultEncoding);this.decoder=this.iconv.getDecoder(t,this.options);for(var n=``,r=0;r<this.initialBufs.length;r++)n+=this.decoder.write(this.initialBufs[r]);return this.initialBufs.length=this.initialBufsLen=0,n}return this.decoder.write(e)},Utf16Decoder.prototype.end=function(){if(!this.decoder){var e=detectEncoding(this.initialBufs,this.options.defaultEncoding);this.decoder=this.iconv.getDecoder(e,this.options);for(var t=``,n=0;n<this.initialBufs.length;n++)t+=this.decoder.write(this.initialBufs[n]);var r=this.decoder.end();return r&&(t+=r),this.initialBufs.length=this.initialBufsLen=0,t}return this.decoder.end()};function detectEncoding(e,t){var n=[],r=0,i=0,a=0;outerLoop:for(var o=0;o<e.length;o++)for(var s=e[o],c=0;c<s.length;c++)if(n.push(s[c]),n.length===2){if(r===0){if(n[0]===255&&n[1]===254)return`utf-16le`;if(n[0]===254&&n[1]===255)return`utf-16be`}if(n[0]===0&&n[1]!==0&&a++,n[0]!==0&&n[1]===0&&i++,n.length=0,r++,r>=100)break outerLoop}return a>i?`utf-16be`:a<i?`utf-16le`:t||`utf-16le`}})),Po=__commonJSMin((e=>{var t=Oo().Buffer;e.utf7=Utf7Codec,e.unicode11utf7=`utf7`;function Utf7Codec(e,t){this.iconv=t}Utf7Codec.prototype.encoder=Utf7Encoder,Utf7Codec.prototype.decoder=Utf7Decoder,Utf7Codec.prototype.bomAware=!0;var n=/[^A-Za-z0-9'\(\),-\.\/:\? \n\r\t]+/g;function Utf7Encoder(e,t){this.iconv=t.iconv}Utf7Encoder.prototype.write=function(e){return t.from(e.replace(n,function(e){return`+`+(e===`+`?``:this.iconv.encode(e,`utf16-be`).toString(`base64`).replace(/=+$/,``))+`-`}.bind(this)))},Utf7Encoder.prototype.end=function(){};function Utf7Decoder(e,t){this.iconv=t.iconv,this.inBase64=!1,this.base64Accum=``}for(var r=/[A-Za-z0-9\/+]/,i=[],a=0;a<256;a++)i[a]=r.test(String.fromCharCode(a));var o=43,s=45,c=38;Utf7Decoder.prototype.write=function(e){for(var n=``,r=0,a=this.inBase64,c=this.base64Accum,l=0;l<e.length;l++)if(!a)e[l]==o&&(n+=this.iconv.decode(e.slice(r,l),`ascii`),r=l+1,a=!0);else if(!i[e[l]]){if(l==r&&e[l]==s)n+=`+`;else{var u=c+this.iconv.decode(e.slice(r,l),`ascii`);n+=this.iconv.decode(t.from(u,`base64`),`utf16-be`)}e[l]!=s&&l--,r=l+1,a=!1,c=``}if(!a)n+=this.iconv.decode(e.slice(r),`ascii`);else{var u=c+this.iconv.decode(e.slice(r),`ascii`),d=u.length-u.length%8;c=u.slice(d),u=u.slice(0,d),n+=this.iconv.decode(t.from(u,`base64`),`utf16-be`)}return this.inBase64=a,this.base64Accum=c,n},Utf7Decoder.prototype.end=function(){var e=``;return this.inBase64&&this.base64Accum.length>0&&(e=this.iconv.decode(t.from(this.base64Accum,`base64`),`utf16-be`)),this.inBase64=!1,this.base64Accum=``,e},e.utf7imap=Utf7IMAPCodec;function Utf7IMAPCodec(e,t){this.iconv=t}Utf7IMAPCodec.prototype.encoder=Utf7IMAPEncoder,Utf7IMAPCodec.prototype.decoder=Utf7IMAPDecoder,Utf7IMAPCodec.prototype.bomAware=!0;function Utf7IMAPEncoder(e,n){this.iconv=n.iconv,this.inBase64=!1,this.base64Accum=t.alloc(6),this.base64AccumIdx=0}Utf7IMAPEncoder.prototype.write=function(e){for(var n=this.inBase64,r=this.base64Accum,i=this.base64AccumIdx,a=t.alloc(e.length*5+10),o=0,l=0;l<e.length;l++){var u=e.charCodeAt(l);u>=32&&u<=126?(n&&=(i>0&&(o+=a.write(r.slice(0,i).toString(`base64`).replace(/\//g,`,`).replace(/=+$/,``),o),i=0),a[o++]=s,!1),n||(a[o++]=u,u===c&&(a[o++]=s))):(n||=(a[o++]=c,!0),n&&(r[i++]=u>>8,r[i++]=u&255,i==r.length&&(o+=a.write(r.toString(`base64`).replace(/\//g,`,`),o),i=0)))}return this.inBase64=n,this.base64AccumIdx=i,a.slice(0,o)},Utf7IMAPEncoder.prototype.end=function(){var e=t.alloc(10),n=0;return this.inBase64&&=(this.base64AccumIdx>0&&(n+=e.write(this.base64Accum.slice(0,this.base64AccumIdx).toString(`base64`).replace(/\//g,`,`).replace(/=+$/,``),n),this.base64AccumIdx=0),e[n++]=s,!1),e.slice(0,n)};function Utf7IMAPDecoder(e,t){this.iconv=t.iconv,this.inBase64=!1,this.base64Accum=``}var l=i.slice();l[44]=!0,Utf7IMAPDecoder.prototype.write=function(e){for(var n=``,r=0,i=this.inBase64,a=this.base64Accum,o=0;o<e.length;o++)if(!i)e[o]==c&&(n+=this.iconv.decode(e.slice(r,o),`ascii`),r=o+1,i=!0);else if(!l[e[o]]){if(o==r&&e[o]==s)n+=`&`;else{var u=a+this.iconv.decode(e.slice(r,o),`ascii`).replace(/,/g,`/`);n+=this.iconv.decode(t.from(u,`base64`),`utf16-be`)}e[o]!=s&&o--,r=o+1,i=!1,a=``}if(!i)n+=this.iconv.decode(e.slice(r),`ascii`);else{var u=a+this.iconv.decode(e.slice(r),`ascii`).replace(/,/g,`/`),d=u.length-u.length%8;a=u.slice(d),u=u.slice(0,d),n+=this.iconv.decode(t.from(u,`base64`),`utf16-be`)}return this.inBase64=i,this.base64Accum=a,n},Utf7IMAPDecoder.prototype.end=function(){var e=``;return this.inBase64&&this.base64Accum.length>0&&(e=this.iconv.decode(t.from(this.base64Accum,`base64`),`utf16-be`)),this.inBase64=!1,this.base64Accum=``,e}})),Fo=__commonJSMin((e=>{var t=Oo().Buffer;e._sbcs=SBCSCodec;function SBCSCodec(e,n){if(!e)throw Error(`SBCS codec is called without the data.`);if(!e.chars||e.chars.length!==128&&e.chars.length!==256)throw Error(`Encoding '`+e.type+`' has incorrect 'chars' (must be of len 128 or 256)`);if(e.chars.length===128){for(var r=``,i=0;i<128;i++)r+=String.fromCharCode(i);e.chars=r+e.chars}this.decodeBuf=t.from(e.chars,`ucs2`);for(var a=t.alloc(65536,n.defaultCharSingleByte.charCodeAt(0)),i=0;i<e.chars.length;i++)a[e.chars.charCodeAt(i)]=i;this.encodeBuf=a}SBCSCodec.prototype.encoder=SBCSEncoder,SBCSCodec.prototype.decoder=SBCSDecoder;function SBCSEncoder(e,t){this.encodeBuf=t.encodeBuf}SBCSEncoder.prototype.write=function(e){for(var n=t.alloc(e.length),r=0;r<e.length;r++)n[r]=this.encodeBuf[e.charCodeAt(r)];return n},SBCSEncoder.prototype.end=function(){};function SBCSDecoder(e,t){this.decodeBuf=t.decodeBuf}SBCSDecoder.prototype.write=function(e){for(var n=this.decodeBuf,r=t.alloc(e.length*2),i=0,a=0,o=0;o<e.length;o++)i=e[o]*2,a=o*2,r[a]=n[i],r[a+1]=n[i+1];return r.toString(`ucs2`)},SBCSDecoder.prototype.end=function(){}})),Io=__commonJSMin(((e,t)=>{t.exports={10029:`maccenteuro`,maccenteuro:{type:`_sbcs`,chars:`ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»…\xA0ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ`},808:`cp808`,ibm808:`cp808`,cp808:{type:`_sbcs`,chars:`АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№€■\xA0`},mik:{type:`_sbcs`,chars:`АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя└┴┬├─┼╣║╚╔╩╦╠═╬┐░▒▓│┤№§╗╝┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■\xA0`},cp720:{type:`_sbcs`,chars:`éâàçêëèïîّْô¤ـûùءآأؤ£إئابةتثجحخدذرزسشص«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀ضطظعغفµقكلمنهوىي≡ًٌٍَُِ≈°∙·√ⁿ²■\xA0`},ascii8bit:`ascii`,usascii:`ascii`,ansix34:`ascii`,ansix341968:`ascii`,ansix341986:`ascii`,csascii:`ascii`,cp367:`ascii`,ibm367:`ascii`,isoir6:`ascii`,iso646us:`ascii`,iso646irv:`ascii`,us:`ascii`,latin1:`iso88591`,latin2:`iso88592`,latin3:`iso88593`,latin4:`iso88594`,latin5:`iso88599`,latin6:`iso885910`,latin7:`iso885913`,latin8:`iso885914`,latin9:`iso885915`,latin10:`iso885916`,csisolatin1:`iso88591`,csisolatin2:`iso88592`,csisolatin3:`iso88593`,csisolatin4:`iso88594`,csisolatincyrillic:`iso88595`,csisolatinarabic:`iso88596`,csisolatingreek:`iso88597`,csisolatinhebrew:`iso88598`,csisolatin5:`iso88599`,csisolatin6:`iso885910`,l1:`iso88591`,l2:`iso88592`,l3:`iso88593`,l4:`iso88594`,l5:`iso88599`,l6:`iso885910`,l7:`iso885913`,l8:`iso885914`,l9:`iso885915`,l10:`iso885916`,isoir14:`iso646jp`,isoir57:`iso646cn`,isoir100:`iso88591`,isoir101:`iso88592`,isoir109:`iso88593`,isoir110:`iso88594`,isoir144:`iso88595`,isoir127:`iso88596`,isoir126:`iso88597`,isoir138:`iso88598`,isoir148:`iso88599`,isoir157:`iso885910`,isoir166:`tis620`,isoir179:`iso885913`,isoir199:`iso885914`,isoir203:`iso885915`,isoir226:`iso885916`,cp819:`iso88591`,ibm819:`iso88591`,cyrillic:`iso88595`,arabic:`iso88596`,arabic8:`iso88596`,ecma114:`iso88596`,asmo708:`iso88596`,greek:`iso88597`,greek8:`iso88597`,ecma118:`iso88597`,elot928:`iso88597`,hebrew:`iso88598`,hebrew8:`iso88598`,turkish:`iso88599`,turkish8:`iso88599`,thai:`iso885911`,thai8:`iso885911`,celtic:`iso885914`,celtic8:`iso885914`,isoceltic:`iso885914`,tis6200:`tis620`,tis62025291:`tis620`,tis62025330:`tis620`,1e4:`macroman`,10006:`macgreek`,10007:`maccyrillic`,10079:`maciceland`,10081:`macturkish`,cspc8codepage437:`cp437`,cspc775baltic:`cp775`,cspc850multilingual:`cp850`,cspcp852:`cp852`,cspc862latinhebrew:`cp862`,cpgr:`cp869`,msee:`cp1250`,mscyrl:`cp1251`,msansi:`cp1252`,msgreek:`cp1253`,msturk:`cp1254`,mshebr:`cp1255`,msarab:`cp1256`,winbaltrim:`cp1257`,cp20866:`koi8r`,20866:`koi8r`,ibm878:`koi8r`,cskoi8r:`koi8r`,cp21866:`koi8u`,21866:`koi8u`,ibm1168:`koi8u`,strk10482002:`rk1048`,tcvn5712:`tcvn`,tcvn57121:`tcvn`,gb198880:`iso646cn`,cn:`iso646cn`,csiso14jisc6220ro:`iso646jp`,jisc62201969ro:`iso646jp`,jp:`iso646jp`,cshproman8:`hproman8`,r8:`hproman8`,roman8:`hproman8`,xroman8:`hproman8`,ibm1051:`hproman8`,mac:`macintosh`,csmacintosh:`macintosh`}})),Lo=__commonJSMin(((e,t)=>{t.exports={437:`cp437`,737:`cp737`,775:`cp775`,850:`cp850`,852:`cp852`,855:`cp855`,856:`cp856`,857:`cp857`,858:`cp858`,860:`cp860`,861:`cp861`,862:`cp862`,863:`cp863`,864:`cp864`,865:`cp865`,866:`cp866`,869:`cp869`,874:`windows874`,922:`cp922`,1046:`cp1046`,1124:`cp1124`,1125:`cp1125`,1129:`cp1129`,1133:`cp1133`,1161:`cp1161`,1162:`cp1162`,1163:`cp1163`,1250:`windows1250`,1251:`windows1251`,1252:`windows1252`,1253:`windows1253`,1254:`windows1254`,1255:`windows1255`,1256:`windows1256`,1257:`windows1257`,1258:`windows1258`,28591:`iso88591`,28592:`iso88592`,28593:`iso88593`,28594:`iso88594`,28595:`iso88595`,28596:`iso88596`,28597:`iso88597`,28598:`iso88598`,28599:`iso88599`,28600:`iso885910`,28601:`iso885911`,28603:`iso885913`,28604:`iso885914`,28605:`iso885915`,28606:`iso885916`,windows874:{type:`_sbcs`,chars:`€����…�����������‘’“”•–—��������\xA0กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����`},win874:`windows874`,cp874:`windows874`,windows1250:{type:`_sbcs`,chars:`€�‚�„…†‡�‰Š‹ŚŤŽŹ�‘’“”•–—�™š›śťžź\xA0ˇ˘Ł¤Ą¦§¨©Ş«¬®Ż°±˛ł´µ¶·¸ąş»Ľ˝ľżŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙`},win1250:`windows1250`,cp1250:`windows1250`,windows1251:{type:`_sbcs`,chars:`ЂЃ‚ѓ„…†‡€‰Љ‹ЊЌЋЏђ‘’“”•–—�™љ›њќћџ\xA0ЎўЈ¤Ґ¦§Ё©Є«¬®Ї°±Ііґµ¶·ё№є»јЅѕїАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя`},win1251:`windows1251`,cp1251:`windows1251`,windows1252:{type:`_sbcs`,chars:`€�‚ƒ„…†‡ˆ‰Š‹Œ�Ž��‘’“”•–—˜™š›œ�žŸ\xA0¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ`},win1252:`windows1252`,cp1252:`windows1252`,windows1253:{type:`_sbcs`,chars:`€�‚ƒ„…†‡�‰�‹�����‘’“”•–—�™�›����\xA0΅Ά£¤¥¦§¨©�«¬®―°±²³΄µ¶·ΈΉΊ»Ό½ΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ�ΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ�`},win1253:`windows1253`,cp1253:`windows1253`,windows1254:{type:`_sbcs`,chars:`€�‚ƒ„…†‡ˆ‰Š‹Œ����‘’“”•–—˜™š›œ��Ÿ\xA0¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖרÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ`},win1254:`windows1254`,cp1254:`windows1254`,windows1255:{type:`_sbcs`,chars:`€�‚ƒ„…†‡ˆ‰�‹�����‘’“”•–—˜™�›����\xA0¡¢£₪¥¦§¨©×«¬®¯°±²³´µ¶·¸¹÷»¼½¾¿ְֱֲֳִֵֶַָֹֺֻּֽ־ֿ׀ׁׂ׃װױײ׳״�������אבגדהוזחטיךכלםמןנסעףפץצקרשת���`},win1255:`windows1255`,cp1255:`windows1255`,windows1256:{type:`_sbcs`,chars:`€پ‚ƒ„…†‡ˆ‰ٹ‹Œچژڈگ‘’“”•–—ک™ڑ›œں\xA0،¢£¤¥¦§¨©ھ«¬®¯°±²³´µ¶·¸¹؛»¼½¾؟ہءآأؤإئابةتثجحخدذرزسشصض×طظعغـفقكàلâمنهوçèéêëىيîïًٌٍَôُِ÷ّùْûüے`},win1256:`windows1256`,cp1256:`windows1256`,windows1257:{type:`_sbcs`,chars:`€�‚�„…†‡�‰�‹�¨ˇ¸�‘’“”•–—�™�›�¯˛�\xA0�¢£¤�¦§Ø©Ŗ«¬®Æ°±²³´µ¶·ø¹ŗ»¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢĶĪĻŠŃŅÓŌÕÖ×ŲŁŚŪÜŻŽßąįāćäåęēčéźėģķīļšńņóōõö÷ųłśūüżž˙`},win1257:`windows1257`,cp1257:`windows1257`,windows1258:{type:`_sbcs`,chars:`€�‚ƒ„…†‡ˆ‰�‹Œ����‘’“”•–—˜™�›œ��Ÿ\xA0¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖרÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ`},win1258:`windows1258`,cp1258:`windows1258`,iso88591:{type:`_sbcs`,chars:`
\xA0¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ`},cp28591:`iso88591`,iso88592:{type:`_sbcs`,chars:`
\xA0Ą˘Ł¤ĽŚ§¨ŠŞŤŹŽŻ°ą˛ł´ľśˇ¸šşťź˝žżŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙`},cp28592:`iso88592`,iso88593:{type:`_sbcs`,chars:`
\xA0Ħ˘£¤�Ĥ§¨İŞĞĴ�ݰħ²³´µĥ·¸ışğĵ½�żÀÁÂ�ÄĊĈÇÈÉÊËÌÍÎÏ�ÑÒÓÔĠÖ×ĜÙÚÛÜŬŜßàáâ�äċĉçèéêëìíîï�ñòóôġö÷ĝùúûüŭŝ˙`},cp28593:`iso88593`,iso88594:{type:`_sbcs`,chars:`
\xA0ĄĸŖ¤Ĩϧ¨ŠĒĢŦޝ°ą˛ŗ´ĩšēģŧŊžŋĀÁÂÃÄÅÆĮČÉĘËĖÍÎĪĐŅŌĶÔÕÖרŲÚÛÜŨŪßāáâãäåæįčéęëėíîīđņōķôõö÷øųúûüũū˙`},cp28594:`iso88594`,iso88595:{type:`_sbcs`,chars:`
\xA0ЁЂЃЄЅІЇЈЉЊЋЌЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя№ёђѓєѕіїјљњћќ§ўџ`},cp28595:`iso88595`,iso88596:{type:`_sbcs`,chars:`
\xA0���¤�������،�������������؛���؟�ءآأؤإئابةتثجحخدذرزسشصضطظعغ�����ـفقكلمنهوىيًٌٍَُِّْ�������������`},cp28596:`iso88596`,iso88597:{type:`_sbcs`,chars:`
\xA0‘’£€₯¦§¨©ͺ«¬�―°±²³΄΅Ά·ΈΉΊ»Ό½ΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ�ΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ�`},cp28597:`iso88597`,iso88598:{type:`_sbcs`,chars:`
\xA0�¢£¤¥¦§¨©×«¬®¯°±²³´µ¶·¸¹÷»¼½¾��������������������������������‗אבגדהוזחטיךכלםמןנסעףפץצקרשת���`},cp28598:`iso88598`,iso88599:{type:`_sbcs`,chars:`
\xA0¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖרÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ`},cp28599:`iso88599`,iso885910:{type:`_sbcs`,chars:`
\xA0ĄĒĢĪĨͧĻĐŠŦŽŪŊ°ąēģīĩķ·ļđšŧž―ūŋĀÁÂÃÄÅÆĮČÉĘËĖÍÎÏÐŅŌÓÔÕÖŨØŲÚÛÜÝÞßāáâãäåæįčéęëėíîïðņōóôõöũøųúûüýþĸ`},cp28600:`iso885910`,iso885911:{type:`_sbcs`,chars:`
\xA0กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����`},cp28601:`iso885911`,iso885913:{type:`_sbcs`,chars:`
\xA0”¢£¤„¦§Ø©Ŗ«¬®Æ°±²³“µ¶·ø¹ŗ»¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢĶĪĻŠŃŅÓŌÕÖ×ŲŁŚŪÜŻŽßąįāćäåęēčéźėģķīļšńņóōõö÷ųłśūüżž’`},cp28603:`iso885913`,iso885914:{type:`_sbcs`,chars:`
\xA0Ḃḃ£ĊċḊ§Ẁ©ẂḋỲ®ŸḞḟĠġṀṁ¶ṖẁṗẃṠỳẄẅṡÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏŴÑÒÓÔÕÖṪØÙÚÛÜÝŶßàáâãäåæçèéêëìíîïŵñòóôõöṫøùúûüýŷÿ`},cp28604:`iso885914`,iso885915:{type:`_sbcs`,chars:`
\xA0¡¢£€¥Š§š©ª«¬®¯°±²³Žµ¶·ž¹º»ŒœŸ¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ`},cp28605:`iso885915`,iso885916:{type:`_sbcs`,chars:`
\xA0ĄąŁ€„Чš©Ș«ŹźŻ°±ČłŽ”¶·žčș»ŒœŸżÀÁÂĂÄĆÆÇÈÉÊËÌÍÎÏĐŃÒÓÔŐÖŚŰÙÚÛÜĘȚßàáâăäćæçèéêëìíîïđńòóôőöśűùúûüęțÿ`},cp28606:`iso885916`,cp437:{type:`_sbcs`,chars:`ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■\xA0`},ibm437:`cp437`,csibm437:`cp437`,cp737:{type:`_sbcs`,chars:`ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩαβγδεζηθικλμνξοπρσςτυφχψ░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀ωάέήϊίόύϋώΆΈΉΊΌΎΏ±≥≤ΪΫ÷≈°∙·√ⁿ²■\xA0`},ibm737:`cp737`,csibm737:`cp737`,cp775:{type:`_sbcs`,chars:`ĆüéāäģåćłēŖŗīŹÄÅÉæÆōöĢ¢ŚśÖÜø£Ø×¤ĀĪóŻżź”¦©®¬½¼Ł«»░▒▓│┤ĄČĘĖ╣║╗╝ĮŠ┐└┴┬├─┼ŲŪ╚╔╩╦╠═╬Žąčęėįšųūž┘┌█▄▌▐▀ÓßŌŃõÕµńĶķĻļņĒŅ’±“¾¶§÷„°∙·¹³²■\xA0`},ibm775:`cp775`,csibm775:`cp775`,cp850:{type:`_sbcs`,chars:`ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø×ƒáíóúñѪº¿®¬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ðÐÊËÈıÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµþÞÚÛÙýݯ´±‗¾¶§÷¸°¨·¹³²■\xA0`},ibm850:`cp850`,csibm850:`cp850`,cp852:{type:`_sbcs`,chars:`ÇüéâäůćçłëŐőîŹÄĆÉĹĺôöĽľŚśÖÜŤťŁ×čáíóúĄąŽžĘ꬟Ⱥ«»░▒▓│┤ÁÂĚŞ╣║╗╝Żż┐└┴┬├─┼Ăă╚╔╩╦╠═╬¤đĐĎËďŇÍÎě┘┌█▄ŢŮ▀ÓßÔŃńňŠšŔÚŕŰýÝţ´˝˛ˇ˘§÷¸°¨˙űŘř■\xA0`},ibm852:`cp852`,csibm852:`cp852`,cp855:{type:`_sbcs`,chars:`ђЂѓЃёЁєЄѕЅіІїЇјЈљЉњЊћЋќЌўЎџЏюЮъЪаАбБцЦдДеЕфФгГ«»░▒▓│┤хХиИ╣║╗╝йЙ┐└┴┬├─┼кК╚╔╩╦╠═╬¤лЛмМнНоОп┘┌█▄Пя▀ЯрРсСтТуУжЖвВьЬ№ыЫзЗшШэЭщЩчЧ§■\xA0`},ibm855:`cp855`,csibm855:`cp855`,cp856:{type:`_sbcs`,chars:`אבגדהוזחטיךכלםמןנסעףפץצקרשת�£�×����������®¬½¼�«»░▒▓│┤���©╣║╗╝¢¥┐└┴┬├─┼��╚╔╩╦╠═╬¤���������┘┌█▄¦�▀������µ�������¯´±‗¾¶§÷¸°¨·¹³²■\xA0`},ibm856:`cp856`,csibm856:`cp856`,cp857:{type:`_sbcs`,chars:`ÇüéâäàåçêëèïîıÄÅÉæÆôöòûùİÖÜø£ØŞşáíóúñÑĞ𿮬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ºªÊËÈ�ÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµ�×ÚÛÙìÿ¯´±�¾¶§÷¸°¨·¹³²■\xA0`},ibm857:`cp857`,csibm857:`cp857`,cp858:{type:`_sbcs`,chars:`ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø×ƒáíóúñѪº¿®¬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ðÐÊËÈ€ÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµþÞÚÛÙýݯ´±‗¾¶§÷¸°¨·¹³²■\xA0`},ibm858:`cp858`,csibm858:`cp858`,cp860:{type:`_sbcs`,chars:`ÇüéâãàÁçêÊèÍÔìÃÂÉÀÈôõòÚùÌÕÜ¢£Ù₧ÓáíóúñѪº¿Ò¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■\xA0`},ibm860:`cp860`,csibm860:`cp860`,cp861:{type:`_sbcs`,chars:`ÇüéâäàåçêëèÐðÞÄÅÉæÆôöþûÝýÖÜø£Ø₧ƒáíóúÁÍÓÚ¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■\xA0`},ibm861:`cp861`,csibm861:`cp861`,cp862:{type:`_sbcs`,chars:`אבגדהוזחטיךכלםמןנסעףפץצקרשת¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■\xA0`},ibm862:`cp862`,csibm862:`cp862`,cp863:{type:`_sbcs`,chars:`ÇüéâÂà¶çêëèïî‗À§ÉÈÊôËÏûù¤ÔÜ¢£ÙÛƒ¦´óú¨¸³¯Î⌐¬½¼¾«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■\xA0`},ibm863:`cp863`,csibm863:`cp863`,cp864:{type:`_sbcs`,chars:`\0\x07\b
|
|
7
7
|
\v\f\r\x1B !"#$٪&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\`abcdefghijklmnopqrstuvwxyz{|}~°·∙√▒─│┼┤┬├┴┐┌└┘β∞φ±½¼≈«»ﻷﻸ��ﻻﻼ�\xA0ﺂ£¤ﺄ��ﺎﺏﺕﺙ،ﺝﺡﺥ٠١٢٣٤٥٦٧٨٩ﻑ؛ﺱﺵﺹ؟¢ﺀﺁﺃﺅﻊﺋﺍﺑﺓﺗﺛﺟﺣﺧﺩﺫﺭﺯﺳﺷﺻﺿﻁﻅﻋﻏ¦¬÷×ﻉـﻓﻗﻛﻟﻣﻧﻫﻭﻯﻳﺽﻌﻎﻍﻡﹽّﻥﻩﻬﻰﻲﻐﻕﻵﻶﻝﻙﻱ■�`},ibm864:`cp864`,csibm864:`cp864`,cp865:{type:`_sbcs`,chars:`ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø₧ƒáíóúñѪº¿⌐¬½¼¡«¤░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■\xA0`},ibm865:`cp865`,csibm865:`cp865`,cp866:{type:`_sbcs`,chars:`АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№¤■\xA0`},ibm866:`cp866`,csibm866:`cp866`,cp869:{type:`_sbcs`,chars:`������Ά�·¬¦‘’Έ―ΉΊΪΌ��ΎΫ©Ώ²³ά£έήίϊΐόύΑΒΓΔΕΖΗ½ΘΙ«»░▒▓│┤ΚΛΜΝ╣║╗╝ΞΟ┐└┴┬├─┼ΠΡ╚╔╩╦╠═╬ΣΤΥΦΧΨΩαβγ┘┌█▄δε▀ζηθικλμνξοπρσςτ΄±υφχ§ψ΅°¨ωϋΰώ■\xA0`},ibm869:`cp869`,csibm869:`cp869`,cp922:{type:`_sbcs`,chars:`
\xA0¡¢£¤¥¦§¨©ª«¬®‾°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏŠÑÒÓÔÕÖרÙÚÛÜÝŽßàáâãäåæçèéêëìíîïšñòóôõö÷øùúûüýžÿ`},ibm922:`cp922`,csibm922:`cp922`,cp1046:{type:`_sbcs`,chars:`ﺈ×÷ﹱ■│─┐┌└┘ﹹﹻﹽﹿﹷﺊﻰﻳﻲﻎﻏﻐﻶﻸﻺﻼ\xA0¤ﺋﺑﺗﺛﺟﺣ،ﺧﺳ٠١٢٣٤٥٦٧٨٩ﺷ؛ﺻﺿﻊ؟ﻋءآأؤإئابةتثجحخدذرزسشصضطﻇعغﻌﺂﺄﺎﻓـفقكلمنهوىيًٌٍَُِّْﻗﻛﻟﻵﻷﻹﻻﻣﻧﻬﻩ�`},ibm1046:`cp1046`,csibm1046:`cp1046`,cp1124:{type:`_sbcs`,chars:`
\xA0ЁЂҐЄЅІЇЈЉЊЋЌЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя№ёђґєѕіїјљњћќ§ўџ`},ibm1124:`cp1124`,csibm1124:`cp1124`,cp1125:{type:`_sbcs`,chars:`АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёҐґЄєІіЇї·√№¤■\xA0`},ibm1125:`cp1125`,csibm1125:`cp1125`,cp1129:{type:`_sbcs`,chars:`
\xA0¡¢£¤¥¦§œ©ª«¬®¯°±²³Ÿµ¶·Œ¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖרÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ`},ibm1129:`cp1129`,csibm1129:`cp1129`,cp1133:{type:`_sbcs`,chars:`
\xA0ກຂຄງຈສຊຍດຕຖທນບປຜຝພຟມຢຣລວຫອຮ���ຯະາຳິີຶືຸູຼັົຽ���ເແໂໃໄ່້໊໋໌ໍໆ�ໜໝ₭����������������໐໑໒໓໔໕໖໗໘໙��¢¬¦�`},ibm1133:`cp1133`,csibm1133:`cp1133`,cp1161:{type:`_sbcs`,chars:`��������������������������������่กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู้๊๋€฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛¢¬¦\xA0`},ibm1161:`cp1161`,csibm1161:`cp1161`,cp1162:{type:`_sbcs`,chars:`€…‘’“”•–—\xA0กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����`},ibm1162:`cp1162`,csibm1162:`cp1162`,cp1163:{type:`_sbcs`,chars:`
\xA0¡¢£€¥¦§œ©ª«¬®¯°±²³Ÿµ¶·Œ¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖרÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ`},ibm1163:`cp1163`,csibm1163:`cp1163`,maccroatian:{type:`_sbcs`,chars:`ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈ƫȅ\xA0ÀÃÕŒœĐ—“”‘’÷◊�©⁄¤‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ`},maccyrillic:{type:`_sbcs`,chars:`АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°¢£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµ∂ЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»…\xA0ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю¤`},macgreek:{type:`_sbcs`,chars:`Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»…\xA0ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ�`},maciceland:{type:`_sbcs`,chars:`ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüݰ¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»…\xA0ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ`},macroman:{type:`_sbcs`,chars:`ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»…\xA0ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ`},macromania:{type:`_sbcs`,chars:`ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂŞ∞±≤≥¥µ∂∑∏π∫ªºΩăş¿¡¬√ƒ≈∆«»…\xA0ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›Ţţ‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ`},macthai:{type:`_sbcs`,chars:`«»…“”�•‘’�\xA0กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู–—฿เแโใไๅๆ็่้๊๋์ํ™๏๐๑๒๓๔๕๖๗๘๙®©����`},macturkish:{type:`_sbcs`,chars:`ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»…\xA0ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙ�ˆ˜¯˘˙˚¸˝˛ˇ`},macukraine:{type:`_sbcs`,chars:`АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»…\xA0ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю¤`},koi8r:{type:`_sbcs`,chars:`─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥\xA0⌡°²·÷═║╒ё╓╔╕╖╗╘╙╚╛╜╝╞╟╠╡Ё╢╣╤╥╦╧╨╩╪╫╬©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ`},koi8u:{type:`_sbcs`,chars:`─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥\xA0⌡°²·÷═║╒ёє╔ії╗╘╙╚╛ґ╝╞╟╠╡ЁЄ╣ІЇ╦╧╨╩╪Ґ╬©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ`},koi8ru:{type:`_sbcs`,chars:`─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥\xA0⌡°²·÷═║╒ёє╔ії╗╘╙╚╛ґў╞╟╠╡ЁЄ╣ІЇ╦╧╨╩╪ҐЎ©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ`},koi8t:{type:`_sbcs`,chars:`қғ‚Ғ„…†‡�‰ҳ‹ҲҷҶ�Қ‘’“”•–—�™�›�����ӯӮё¤ӣ¦§���«¬®�°±²Ё�Ӣ¶·�№�»���©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ`},armscii8:{type:`_sbcs`,chars:`
\xA0�և։)(»«—.՝,-֊…՜՛՞ԱաԲբԳգԴդԵեԶզԷէԸըԹթԺժԻիԼլԽխԾծԿկՀհՁձՂղՃճՄմՅյՆնՇշՈոՉչՊպՋջՌռՍսՎվՏտՐրՑցՒւՓփՔքՕօՖֆ՚�`},rk1048:{type:`_sbcs`,chars:`ЂЃ‚ѓ„…†‡€‰Љ‹ЊҚҺЏђ‘’“”•–—�™љ›њқһџ\xA0ҰұӘ¤Ө¦§Ё©Ғ«¬®Ү°±Ііөµ¶·ё№ғ»әҢңүАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя`},tcvn:{type:`_sbcs`,chars:`\0ÚỤỪỬỮ\x07\b
|
|
8
8
|
\v\f\rỨỰỲỶỸÝỴ\x1B !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\`abcdefghijklmnopqrstuvwxyz{|}~ÀẢÃÁẠẶẬÈẺẼÉẸỆÌỈĨÍỊÒỎÕÓỌỘỜỞỠỚỢÙỦŨ\xA0ĂÂÊÔƠƯĐăâêôơưđẶ̀̀̉̃́àảãáạẲằẳẵắẴẮẦẨẪẤỀặầẩẫấậèỂẻẽéẹềểễếệìỉỄẾỒĩíịòỔỏõóọồổỗốộờởỡớợùỖủũúụừửữứựỳỷỹýỵỐ`},georgianacademy:{type:`_sbcs`,chars:`‚ƒ„…†‡ˆ‰Š‹Œ‘’“”•–—˜™š›œŸ\xA0¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿აბგდევზთიკლმნოპჟრსტუფქღყშჩცძწჭხჯჰჱჲჳჴჵჶçèéêëìíîïðñòóôõö÷øùúûüýþÿ`},georgianps:{type:`_sbcs`,chars:`‚ƒ„…†‡ˆ‰Š‹Œ‘’“”•–—˜™š›œŸ\xA0¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿აბგდევზჱთიკლმნჲოპჟრსტჳუფქღყშჩცძწჭხჴჯჰჵæçèéêëìíîïðñòóôõö÷øùúûüýþÿ`},pt154:{type:`_sbcs`,chars:`ҖҒӮғ„…ҶҮҲүҠӢҢҚҺҸҗ‘’“”•–—ҳҷҡӣңқһҹ\xA0ЎўЈӨҘҰ§Ё©Ә«¬ӯ®Ҝ°ұІіҙө¶·ё№ә»јҪҫҝАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя`},viscii:{type:`_sbcs`,chars:`\0ẲẴẪ\x07\b
|