pyrepl-web 0.2.0 → 0.3.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/README.md +24 -39
- package/dist/{chunk-zvesc6aa.js → chunk-2pt85e47.js} +1 -1
- package/dist/chunk-9z51gwd8.js +3 -0
- package/dist/{chunk-az66snk4.js → chunk-axra9g7f.js} +1 -1
- package/dist/{chunk-p8z2rk6s.js → chunk-brqq1jg0.js} +1 -1
- package/dist/{chunk-1qs0a4h5.js → chunk-f2vnq91h.js} +1 -1
- package/dist/chunk-s9w2hb4g.js +2 -0
- package/dist/pyrepl.esm.js +12 -10
- package/package.json +2 -2
- package/dist/chunk-b4v3wyq6.js +0 -3
- package/dist/chunk-q8xkh3ym.js +0 -2
package/README.md
CHANGED
|
@@ -35,10 +35,32 @@ That's it! No install needed.
|
|
|
35
35
|
| `theme` | Color theme name (builtin or registered via `window.pyreplThemes`) | `catppuccin-mocha` |
|
|
36
36
|
| `packages` | Comma-separated list of PyPI packages to preload | none |
|
|
37
37
|
| `repl-title` | Custom title in the header bar | `Python REPL` |
|
|
38
|
-
| `src` | Path to a Python script
|
|
38
|
+
| `src` | Path to a Python startup script (see below) | none |
|
|
39
39
|
| `no-header` | Hide the header bar (boolean attribute) | not set |
|
|
40
40
|
| `no-buttons` | Hide copy/clear buttons in header (boolean attribute) | not set |
|
|
41
41
|
| `readonly` | Disable input, display only (boolean attribute) | not set |
|
|
42
|
+
| `no-banner` | Hide the "Python 3.13" startup banner (boolean attribute) | not set |
|
|
43
|
+
|
|
44
|
+
### Startup Scripts
|
|
45
|
+
|
|
46
|
+
Use `src` to preload a Python script that sets up the environment:
|
|
47
|
+
|
|
48
|
+
```html
|
|
49
|
+
<py-repl src="/scripts/setup.py" packages="pandas"></py-repl>
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
The script runs silently to populate the namespace. If you define a `setup()` function, it will be called after loading and its output is visible in the terminal:
|
|
53
|
+
|
|
54
|
+
```python
|
|
55
|
+
# setup.py
|
|
56
|
+
import pandas as pd
|
|
57
|
+
|
|
58
|
+
df = pd.DataFrame({'name': ['Alice', 'Bob'], 'age': [30, 25]})
|
|
59
|
+
|
|
60
|
+
def setup():
|
|
61
|
+
print("DataFrame loaded:")
|
|
62
|
+
print(df)
|
|
63
|
+
```
|
|
42
64
|
|
|
43
65
|
### Theming
|
|
44
66
|
|
|
@@ -105,41 +127,4 @@ window.pyreplThemes = {
|
|
|
105
127
|
}
|
|
106
128
|
};
|
|
107
129
|
</script>
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
### Legacy API
|
|
111
|
-
|
|
112
|
-
The legacy `<div class="pyrepl">` API is still supported for backwards compatibility:
|
|
113
|
-
|
|
114
|
-
```html
|
|
115
|
-
<div class="pyrepl"
|
|
116
|
-
data-theme="catppuccin-mocha"
|
|
117
|
-
data-packages="numpy"
|
|
118
|
-
data-title="My REPL"
|
|
119
|
-
data-src="/demo.py"
|
|
120
|
-
data-header="true"
|
|
121
|
-
data-buttons="true"
|
|
122
|
-
data-readonly="false">
|
|
123
|
-
</div>
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
## Development
|
|
127
|
-
|
|
128
|
-
```bash
|
|
129
|
-
# Install dependencies
|
|
130
|
-
bun install
|
|
131
|
-
|
|
132
|
-
# Run dev server
|
|
133
|
-
bun run src/server.ts
|
|
134
|
-
|
|
135
|
-
# Build for production
|
|
136
|
-
bun run build.ts
|
|
137
|
-
```
|
|
138
|
-
|
|
139
|
-
## How it works
|
|
140
|
-
|
|
141
|
-
pyrepl-web uses:
|
|
142
|
-
- [Pyodide](https://pyodide.org/) - CPython port to WebAssembly
|
|
143
|
-
- [xterm.js](https://xtermjs.org/) - Terminal emulator
|
|
144
|
-
- [Pygments](https://pygments.org/) - Syntax highlighting
|
|
145
|
-
- [Catppuccin](https://github.com/catppuccin/catppuccin) - Color themes
|
|
130
|
+
```
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"./chunk-
|
|
1
|
+
import"./chunk-s9w2hb4g.js";var{URL:J,URLSearchParams:X}=globalThis;function F(s){return typeof s==="string"}function K(s){return typeof s==="object"&&s!==null}function w(s){return s===null}function Y(s){return s==null}function m(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var S=/^([a-z0-9.+-]+:)/i,k=/:[0-9]*$/,H=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,Q=["<",">",'"',"`"," ","\r",`
|
|
2
2
|
`,"\t"],E=["{","}","|","\\","^","`"].concat(Q),N=["'"].concat(E),M=["%","/","?",";","#"].concat(N),D=["/","?","#"],tt=255,G=/^[+a-z0-9A-Z_-]{0,63}$/,st=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,ht={javascript:!0,"javascript:":!0},Z={javascript:!0,"javascript:":!0},R={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},B={parse(s){var o=decodeURIComponent;return(s+"").replace(/\+/g," ").split("&").filter(Boolean).reduce(function(t,n,a){var l=n.split("="),f=o(l[0]||""),h=o(l[1]||""),g=t[f];return t[f]=g===void 0?h:[].concat(g,h),t},{})},stringify(s){var o=encodeURIComponent;return Object.keys(s||{}).reduce(function(t,n){return[].concat(s[n]).forEach(function(a){t.push(o(n)+"="+o(a))}),t},[]).join("&").replace(/\s/g,"+")}};function I(s,o,t){if(s&&K(s)&&s instanceof m)return s;var n=new m;return n.parse(s,o,t),n}m.prototype.parse=function(s,o,t){if(!F(s))throw TypeError("Parameter 'url' must be a string, not "+typeof s);var n=s.indexOf("?"),a=n!==-1&&n<s.indexOf("#")?"?":"#",l=s.split(a),f=/\\/g;l[0]=l[0].replace(f,"/"),s=l.join(a);var h=s;if(h=h.trim(),!t&&s.split("#").length===1){var g=H.exec(h);if(g){if(this.path=h,this.href=h,this.pathname=g[1],g[2])if(this.search=g[2],o)this.query=B.parse(this.search.substr(1));else this.query=this.search.substr(1);else if(o)this.search="",this.query={};return this}}var p=S.exec(h);if(p){p=p[0];var A=p.toLowerCase();this.protocol=A,h=h.substr(p.length)}if(t||p||h.match(/^\/\/[^@\/]+@[^@\/]+/)){var C=h.substr(0,2)==="//";if(C&&!(p&&Z[p]))h=h.substr(2),this.slashes=!0}if(!Z[p]&&(C||p&&!R[p])){var c=-1;for(var r=0;r<D.length;r++){var b=h.indexOf(D[r]);if(b!==-1&&(c===-1||b<c))c=b}var P,u;if(c===-1)u=h.lastIndexOf("@");else u=h.lastIndexOf("@",c);if(u!==-1)P=h.slice(0,u),h=h.slice(u+1),this.auth=decodeURIComponent(P);c=-1;for(var r=0;r<M.length;r++){var b=h.indexOf(M[r]);if(b!==-1&&(c===-1||b<c))c=b}if(c===-1)c=h.length;this.host=h.slice(0,c),h=h.slice(c),this.parseHost(),this.hostname=this.hostname||"";var U=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!U){var e=this.hostname.split(/\./);for(var r=0,i=e.length;r<i;r++){var d=e[r];if(!d)continue;if(!d.match(G)){var y="";for(var O=0,L=d.length;O<L;O++)if(d.charCodeAt(O)>127)y+="x";else y+=d[O];if(!y.match(G)){var x=e.slice(0,r),q=e.slice(r+1),j=d.match(st);if(j)x.push(j[1]),q.unshift(j[2]);if(q.length)h="/"+q.join(".")+h;this.hostname=x.join(".");break}}}}if(this.hostname.length>tt)this.hostname="";else this.hostname=this.hostname.toLowerCase();if(!U)this.hostname=new J(`https://${this.hostname}`).hostname;var $=this.port?":"+this.port:"",V=this.hostname||"";if(this.host=V+$,this.href+=this.host,U){if(this.hostname=this.hostname.substr(1,this.hostname.length-2),h[0]!=="/")h="/"+h}}if(!ht[A])for(var r=0,i=N.length;r<i;r++){var v=N[r];if(h.indexOf(v)===-1)continue;var z=encodeURIComponent(v);if(z===v)z=escape(v);h=h.split(v).join(z)}var T=h.indexOf("#");if(T!==-1)this.hash=h.substr(T),h=h.slice(0,T);var _=h.indexOf("?");if(_!==-1){if(this.search=h.substr(_),this.query=h.substr(_+1),o)this.query=B.parse(this.query);h=h.slice(0,_)}else if(o)this.search="",this.query={};if(h)this.pathname=h;if(R[A]&&this.hostname&&!this.pathname)this.pathname="/";if(this.pathname||this.search){var $=this.pathname||"",W=this.search||"";this.path=$+W}return this.href=this.format(),this};function et(s){if(F(s))s=I(s);if(!(s instanceof m))return m.prototype.format.call(s);return s.format()}m.prototype.format=function(){var s=this.auth||"";if(s)s=encodeURIComponent(s),s=s.replace(/%3A/i,":"),s+="@";var o=this.protocol||"",t=this.pathname||"",n=this.hash||"",a=!1,l="";if(this.host)a=s+this.host;else if(this.hostname){if(a=s+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port)a+=":"+this.port}if(this.query&&K(this.query)&&Object.keys(this.query).length)l=B.stringify(this.query);var f=this.search||l&&"?"+l||"";if(o&&o.substr(-1)!==":")o+=":";if(this.slashes||(!o||R[o])&&a!==!1){if(a="//"+(a||""),t&&t.charAt(0)!=="/")t="/"+t}else if(!a)a="";if(n&&n.charAt(0)!=="#")n="#"+n;if(f&&f.charAt(0)!=="?")f="?"+f;return t=t.replace(/[?#]/g,function(h){return encodeURIComponent(h)}),f=f.replace("#","%23"),o+a+t+f+n};function ot(s,o){return I(s,!1,!0).resolve(o)}m.prototype.resolve=function(s){return this.resolveObject(I(s,!1,!0)).format()};function nt(s,o){if(!s)return o;return I(s,!1,!0).resolveObject(o)}m.prototype.resolveObject=function(s){if(F(s)){var o=new m;o.parse(s,!1,!0),s=o}var t=new m,n=Object.keys(this);for(var a=0;a<n.length;a++){var l=n[a];t[l]=this[l]}if(t.hash=s.hash,s.href==="")return t.href=t.format(),t;if(s.slashes&&!s.protocol){var f=Object.keys(s);for(var h=0;h<f.length;h++){var g=f[h];if(g!=="protocol")t[g]=s[g]}if(R[t.protocol]&&t.hostname&&!t.pathname)t.path=t.pathname="/";return t.href=t.format(),t}if(s.protocol&&s.protocol!==t.protocol){if(!R[s.protocol]){var p=Object.keys(s);for(var A=0;A<p.length;A++){var C=p[A];t[C]=s[C]}return t.href=t.format(),t}if(t.protocol=s.protocol,!s.host&&!Z[s.protocol]){var i=(s.pathname||"").split("/");while(i.length&&!(s.host=i.shift()));if(!s.host)s.host="";if(!s.hostname)s.hostname="";if(i[0]!=="")i.unshift("");if(i.length<2)i.unshift("");t.pathname=i.join("/")}else t.pathname=s.pathname;if(t.search=s.search,t.query=s.query,t.host=s.host||"",t.auth=s.auth,t.hostname=s.hostname||s.host,t.port=s.port,t.pathname||t.search){var c=t.pathname||"",r=t.search||"";t.path=c+r}return t.slashes=t.slashes||s.slashes,t.href=t.format(),t}var b=t.pathname&&t.pathname.charAt(0)==="/",P=s.host||s.pathname&&s.pathname.charAt(0)==="/",u=P||b||t.host&&s.pathname,U=u,e=t.pathname&&t.pathname.split("/")||[],i=s.pathname&&s.pathname.split("/")||[],d=t.protocol&&!R[t.protocol];if(d){if(t.hostname="",t.port=null,t.host)if(e[0]==="")e[0]=t.host;else e.unshift(t.host);if(t.host="",s.protocol){if(s.hostname=null,s.port=null,s.host)if(i[0]==="")i[0]=s.host;else i.unshift(s.host);s.host=null}u=u&&(i[0]===""||e[0]==="")}if(P)t.host=s.host||s.host===""?s.host:t.host,t.hostname=s.hostname||s.hostname===""?s.hostname:t.hostname,t.search=s.search,t.query=s.query,e=i;else if(i.length){if(!e)e=[];e.pop(),e=e.concat(i),t.search=s.search,t.query=s.query}else if(!Y(s.search)){if(d){t.hostname=t.host=e.shift();var y=t.host&&t.host.indexOf("@")>0?t.host.split("@"):!1;if(y)t.auth=y.shift(),t.host=t.hostname=y.shift()}if(t.search=s.search,t.query=s.query,!w(t.pathname)||!w(t.search))t.path=(t.pathname?t.pathname:"")+(t.search?t.search:"");return t.href=t.format(),t}if(!e.length){if(t.pathname=null,t.search)t.path="/"+t.search;else t.path=null;return t.href=t.format(),t}var O=e.slice(-1)[0],L=(t.host||s.host||e.length>1)&&(O==="."||O==="..")||O==="",x=0;for(var q=e.length;q>=0;q--)if(O=e[q],O===".")e.splice(q,1);else if(O==="..")e.splice(q,1),x++;else if(x)e.splice(q,1),x--;if(!u&&!U)for(;x--;x)e.unshift("..");if(u&&e[0]!==""&&(!e[0]||e[0].charAt(0)!=="/"))e.unshift("");if(L&&e.join("/").substr(-1)!=="/")e.push("");var j=e[0]===""||e[0]&&e[0].charAt(0)==="/";if(d){t.hostname=t.host=j?"":e.length?e.shift():"";var y=t.host&&t.host.indexOf("@")>0?t.host.split("@"):!1;if(y)t.auth=y.shift(),t.host=t.hostname=y.shift()}if(u=u||t.host&&e.length,u&&!j)e.unshift("");if(!e.length)t.pathname=null,t.path=null;else t.pathname=e.join("/");if(!w(t.pathname)||!w(t.search))t.path=(t.pathname?t.pathname:"")+(t.search?t.search:"");return t.auth=s.auth||t.auth,t.slashes=t.slashes||s.slashes,t.href=t.format(),t};m.prototype.parseHost=function(){var s=this.host,o=k.exec(s);if(o){if(o=o[0],o!==":")this.port=o.substr(1);s=s.substr(0,s.length-o.length)}if(s)this.hostname=s};var at={parse:I,resolve:ot,resolveObject:nt,format:et,Url:m,URL:J,URLSearchParams:X};export{nt as resolveObject,ot as resolve,I as parse,et as format,at as default,m as Url,X as URLSearchParams,J as URL};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{f as j}from"./chunk-s9w2hb4g.js";var __dirname="/home/runner/work/pyrepl-web/pyrepl-web/node_modules/pyodide";var L0=Object.defineProperty,B=(G,Q)=>L0(G,"name",{value:Q,configurable:!0}),p=((G)=>j)(function(G){return j.apply(this,arguments)}),U0=(()=>{for(var G=new Uint8Array(128),Q=0;Q<64;Q++)G[Q<26?Q+65:Q<52?Q+71:Q<62?Q-4:Q*4-205]=Q;return(W)=>{for(var z=W.length,X=new Uint8Array((z-(W[z-1]=="=")-(W[z-2]=="="))*3/4|0),Z=0,H=0;Z<z;){var J=G[W.charCodeAt(Z++)],K=G[W.charCodeAt(Z++)],M=G[W.charCodeAt(Z++)],V=G[W.charCodeAt(Z++)];X[H++]=J<<2|K>>4,X[H++]=K<<4|M>>2,X[H++]=M<<6|V}return X}})();function f(G){return!isNaN(parseFloat(G))&&isFinite(G)}B(f,"_isNumber");function O(G){return G.charAt(0).toUpperCase()+G.substring(1)}B(O,"_capitalize");function E(G){return function(){return this[G]}}B(E,"_getter");var U=["isConstructor","isEval","isNative","isToplevel"],F=["columnNumber","lineNumber"],k=["fileName","functionName","source"],F0=["args"],k0=["evalOrigin"],w=U.concat(F,k,F0,k0);function C(G){if(G)for(var Q=0;Q<w.length;Q++)G[w[Q]]!==void 0&&this["set"+O(w[Q])](G[w[Q]])}B(C,"StackFrame");C.prototype={getArgs:B(function(){return this.args},"getArgs"),setArgs:B(function(G){if(Object.prototype.toString.call(G)!=="[object Array]")throw TypeError("Args must be an Array");this.args=G},"setArgs"),getEvalOrigin:B(function(){return this.evalOrigin},"getEvalOrigin"),setEvalOrigin:B(function(G){if(G instanceof C)this.evalOrigin=G;else if(G instanceof Object)this.evalOrigin=new C(G);else throw TypeError("Eval Origin must be an Object or StackFrame")},"setEvalOrigin"),toString:B(function(){var G=this.getFileName()||"",Q=this.getLineNumber()||"",W=this.getColumnNumber()||"",z=this.getFunctionName()||"";return this.getIsEval()?G?"[eval] ("+G+":"+Q+":"+W+")":"[eval]:"+Q+":"+W:z?z+" ("+G+":"+Q+":"+W+")":G+":"+Q+":"+W},"toString")};C.fromString=B(function(G){var Q=G.indexOf("("),W=G.lastIndexOf(")"),z=G.substring(0,Q),X=G.substring(Q+1,W).split(","),Z=G.substring(W+1);if(Z.indexOf("@")===0)var H=/@(.+?)(?::(\d+))?(?::(\d+))?$/.exec(Z,""),J=H[1],K=H[2],M=H[3];return new C({functionName:z,args:X||void 0,fileName:J,lineNumber:K||void 0,columnNumber:M||void 0})},"StackFrame$$fromString");for(q=0;q<U.length;q++)C.prototype["get"+O(U[q])]=E(U[q]),C.prototype["set"+O(U[q])]=function(G){return function(Q){this[G]=!!Q}}(U[q]);var q;for(x=0;x<F.length;x++)C.prototype["get"+O(F[x])]=E(F[x]),C.prototype["set"+O(F[x])]=function(G){return function(Q){if(!f(Q))throw TypeError(G+" must be a Number");this[G]=Number(Q)}}(F[x]);var x;for(A=0;A<k.length;A++)C.prototype["get"+O(k[A])]=E(k[A]),C.prototype["set"+O(k[A])]=function(G){return function(Q){this[G]=String(Q)}}(k[A]);var A,b=C;function u(){var G=/^\s*at .*(\S+:\d+|\(native\))/m,Q=/^(eval@)?(\[native code])?$/;return{parse:B(function(W){if(W.stack&&W.stack.match(G))return this.parseV8OrIE(W);if(W.stack)return this.parseFFOrSafari(W);throw Error("Cannot parse given Error object")},"ErrorStackParser$$parse"),extractLocation:B(function(W){if(W.indexOf(":")===-1)return[W];var z=/(.+?)(?::(\d+))?(?::(\d+))?$/,X=z.exec(W.replace(/[()]/g,""));return[X[1],X[2]||void 0,X[3]||void 0]},"ErrorStackParser$$extractLocation"),parseV8OrIE:B(function(W){var z=W.stack.split(`
|
|
2
|
+
`).filter(function(X){return!!X.match(G)},this);return z.map(function(X){X.indexOf("(eval ")>-1&&(X=X.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(,.*$)/g,""));var Z=X.replace(/^\s+/,"").replace(/\(eval code/g,"(").replace(/^.*?\s+/,""),H=Z.match(/ (\(.+\)$)/);Z=H?Z.replace(H[0],""):Z;var J=this.extractLocation(H?H[1]:Z),K=H&&Z||void 0,M=["eval","<anonymous>"].indexOf(J[0])>-1?void 0:J[0];return new b({functionName:K,fileName:M,lineNumber:J[1],columnNumber:J[2],source:X})},this)},"ErrorStackParser$$parseV8OrIE"),parseFFOrSafari:B(function(W){var z=W.stack.split(`
|
|
3
|
+
`).filter(function(X){return!X.match(Q)},this);return z.map(function(X){if(X.indexOf(" > eval")>-1&&(X=X.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),X.indexOf("@")===-1&&X.indexOf(":")===-1)return new b({functionName:X});var Z=/((.*".+"[^@]*)?[^@]*)(?:@)/,H=X.match(Z),J=H&&H[1]?H[1]:void 0,K=this.extractLocation(X.replace(Z,""));return new b({functionName:J,fileName:K[0],lineNumber:K[1],columnNumber:K[2],source:X})},this)},"ErrorStackParser$$parseFFOrSafari")}}B(u,"ErrorStackParser");var I0=new u,N0=I0;function c(){if(typeof API<"u"&&API!==globalThis.API)return API.runtimeEnv;let G=typeof Bun<"u",Q=typeof Deno<"u",W=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string"&&!1,z=typeof navigator=="object"&&typeof navigator.userAgent=="string"&&navigator.userAgent.indexOf("Chrome")===-1&&navigator.userAgent.indexOf("Safari")>-1;return d({IN_BUN:G,IN_DENO:Q,IN_NODE:W,IN_SAFARI:z,IN_SHELL:typeof read=="function"&&typeof load=="function"})}B(c,"getGlobalRuntimeEnv");var Y=c();function d(G){let Q=G.IN_NODE&&typeof m<"u"&&g0&&typeof p=="function"&&typeof __dirname=="string",W=G.IN_NODE&&!Q,z=!G.IN_NODE&&!G.IN_DENO&&!G.IN_BUN,X=z&&typeof window<"u"&&typeof window.document<"u"&&typeof document.createElement=="function"&&"sessionStorage"in window&&typeof globalThis.importScripts!="function",Z=z&&typeof globalThis.WorkerGlobalScope<"u"&&typeof globalThis.self<"u"&&globalThis.self instanceof globalThis.WorkerGlobalScope;return{...G,IN_BROWSER:z,IN_BROWSER_MAIN_THREAD:X,IN_BROWSER_WEB_WORKER:Z,IN_NODE_COMMONJS:Q,IN_NODE_ESM:W}}B(d,"calculateDerivedFlags");var l,g,s,_,h;async function v(){if(!Y.IN_NODE||(l=(await import("./chunk-2pt85e47.js")).default,_=await import("node:fs"),h=await import("node:fs/promises"),s=(await import("node:vm")).default,g=await import("./chunk-axra9g7f.js"),y=g.sep,typeof p<"u"))return;let G=_,Q=await import("./chunk-brqq1jg0.js"),W=await import("ws"),z=await import("node:child_process"),X={fs:G,crypto:Q,ws:W,child_process:z};globalThis.require=function(Z){return X[Z]}}B(v,"initNodeModules");function a(G,Q){return g.resolve(Q||".",G)}B(a,"node_resolvePath");function i(G,Q){return Q===void 0&&(Q=location),new URL(G,Q).toString()}B(i,"browser_resolvePath");var R;Y.IN_NODE?R=a:Y.IN_SHELL?R=B((G)=>G,"resolvePath"):R=i;var y;Y.IN_NODE||(y="/");function o(G,Q){return G.startsWith("file://")&&(G=G.slice(7)),G.includes("://")?{response:fetch(G)}:{binary:h.readFile(G).then((W)=>new Uint8Array(W.buffer,W.byteOffset,W.byteLength))}}B(o,"node_getBinaryResponse");function n(G,Q){if(G.startsWith("file://")&&(G=G.slice(7)),G.includes("://"))throw Error("Shell cannot fetch urls");return{binary:Promise.resolve(new Uint8Array(readbuffer(G)))}}B(n,"shell_getBinaryResponse");function r(G,Q){let W=new URL(G,location);return{response:fetch(W,Q?{integrity:Q}:{})}}B(r,"browser_getBinaryResponse");var S;Y.IN_NODE?S=o:Y.IN_SHELL?S=n:S=r;async function t(G,Q){let{response:W,binary:z}=S(G,Q);if(z)return z;let X=await W;if(!X.ok)throw Error(`Failed to load '${G}': request failed.`);return new Uint8Array(await X.arrayBuffer())}B(t,"loadBinaryFile");var I;if(Y.IN_BROWSER_MAIN_THREAD)I=B(async(G)=>await import(G),"loadScript");else if(Y.IN_BROWSER_WEB_WORKER)I=B(async(G)=>{try{globalThis.importScripts(G)}catch(Q){if(Q instanceof TypeError)await import(G);else throw Q}},"loadScript");else if(Y.IN_NODE)I=e;else if(Y.IN_SHELL)I=load;else throw Error("Cannot determine runtime environment");async function e(G){G.startsWith("file://")&&(G=G.slice(7)),G.includes("://")?s.runInThisContext(await(await fetch(G)).text()):await import(l.pathToFileURL(G).href)}B(e,"nodeLoadScript");async function G0(G){if(Y.IN_NODE){await v();let Q=await h.readFile(G,{encoding:"utf8"});return JSON.parse(Q)}else if(Y.IN_SHELL){let Q=read(G);return JSON.parse(Q)}else return await(await fetch(G)).json()}B(G0,"loadLockFile");async function Q0(){if(Y.IN_NODE_COMMONJS)return __dirname;let G;try{throw Error()}catch(z){G=z}let Q=N0.parse(G)[0].fileName;if(Y.IN_NODE&&!Q.startsWith("file://")&&(Q=`file://${Q}`),Y.IN_NODE_ESM){let z=await import("./chunk-axra9g7f.js");return(await import("./chunk-2pt85e47.js")).fileURLToPath(z.dirname(Q))}let W=Q.lastIndexOf(y);if(W===-1)throw Error("Could not extract indexURL path from pyodide module location. Please pass the indexURL explicitly to loadPyodide.");return Q.slice(0,W)}B(Q0,"calculateDirname");function W0(G){return G.substring(0,G.lastIndexOf("/")+1)||globalThis.location?.toString()||"."}B(W0,"calculateInstallBaseUrl");function X0(G){let Q=G.FS,W=G.FS.filesystems.MEMFS,z=G.PATH,X={DIR_MODE:16895,FILE_MODE:33279,mount:B(function(Z){if(!Z.opts.fileSystemHandle)throw Error("opts.fileSystemHandle is required");return W.mount.apply(null,arguments)},"mount"),syncfs:B(async(Z,H,J)=>{try{let K=X.getLocalSet(Z),M=await X.getRemoteSet(Z),V=H?M:K,D=H?K:M;await X.reconcile(Z,V,D),J(null)}catch(K){J(K)}},"syncfs"),getLocalSet:B((Z)=>{let H=Object.create(null);function J(V){return V!=="."&&V!==".."}B(J,"isRealDir");function K(V){return(D)=>z.join2(V,D)}B(K,"toAbsolute");let M=Q.readdir(Z.mountpoint).filter(J).map(K(Z.mountpoint));for(;M.length;){let V=M.pop(),D=Q.stat(V);Q.isDir(D.mode)&&M.push.apply(M,Q.readdir(V).filter(J).map(K(V))),H[V]={timestamp:D.mtime,mode:D.mode}}return{type:"local",entries:H}},"getLocalSet"),getRemoteSet:B(async(Z)=>{let H=Object.create(null),J=await R0(Z.opts.fileSystemHandle);for(let[K,M]of J)K!=="."&&(H[z.join2(Z.mountpoint,K)]={timestamp:M.kind==="file"?new Date((await M.getFile()).lastModified):new Date,mode:M.kind==="file"?X.FILE_MODE:X.DIR_MODE});return{type:"remote",entries:H,handles:J}},"getRemoteSet"),loadLocalEntry:B((Z)=>{let H=Q.lookupPath(Z,{}).node,J=Q.stat(Z);if(Q.isDir(J.mode))return{timestamp:J.mtime,mode:J.mode};if(Q.isFile(J.mode))return H.contents=W.getFileDataAsTypedArray(H),{timestamp:J.mtime,mode:J.mode,contents:H.contents};throw Error("node type not supported")},"loadLocalEntry"),storeLocalEntry:B((Z,H)=>{if(Q.isDir(H.mode))Q.mkdirTree(Z,H.mode);else if(Q.isFile(H.mode))Q.writeFile(Z,H.contents,{canOwn:!0});else throw Error("node type not supported");Q.chmod(Z,H.mode),Q.utime(Z,H.timestamp,H.timestamp)},"storeLocalEntry"),removeLocalEntry:B((Z)=>{var H=Q.stat(Z);Q.isDir(H.mode)?Q.rmdir(Z):Q.isFile(H.mode)&&Q.unlink(Z)},"removeLocalEntry"),loadRemoteEntry:B(async(Z)=>{if(Z.kind==="file"){let H=await Z.getFile();return{contents:new Uint8Array(await H.arrayBuffer()),mode:X.FILE_MODE,timestamp:new Date(H.lastModified)}}else{if(Z.kind==="directory")return{mode:X.DIR_MODE,timestamp:new Date};throw Error("unknown kind: "+Z.kind)}},"loadRemoteEntry"),storeRemoteEntry:B(async(Z,H,J)=>{let K=Z.get(z.dirname(H)),M=Q.isFile(J.mode)?await K.getFileHandle(z.basename(H),{create:!0}):await K.getDirectoryHandle(z.basename(H),{create:!0});if(M.kind==="file"){let V=await M.createWritable();await V.write(J.contents),await V.close()}Z.set(H,M)},"storeRemoteEntry"),removeRemoteEntry:B(async(Z,H)=>{await Z.get(z.dirname(H)).removeEntry(z.basename(H)),Z.delete(H)},"removeRemoteEntry"),reconcile:B(async(Z,H,J)=>{let K=0,M=[];Object.keys(H.entries).forEach(function($){let T=H.entries[$],L=J.entries[$];(!L||Q.isFile(T.mode)&&T.timestamp.getTime()>L.timestamp.getTime())&&(M.push($),K++)}),M.sort();let V=[];if(Object.keys(J.entries).forEach(function($){H.entries[$]||(V.push($),K++)}),V.sort().reverse(),!K)return;let D=H.type==="remote"?H.handles:J.handles;for(let $ of M){let T=z.normalize($.replace(Z.mountpoint,"/")).substring(1);if(J.type==="local"){let L=D.get(T),A0=await X.loadRemoteEntry(L);X.storeLocalEntry($,A0)}else{let L=X.loadLocalEntry($);await X.storeRemoteEntry(D,T,L)}}for(let $ of V)if(J.type==="local")X.removeLocalEntry($);else{let T=z.normalize($.replace(Z.mountpoint,"/")).substring(1);await X.removeRemoteEntry(D,T)}},"reconcile")};G.FS.filesystems.NATIVEFS_ASYNC=X}B(X0,"initializeNativeFS");var R0=B(async(G)=>{let Q=[];async function W(X){for await(let Z of X.values())Q.push(Z),Z.kind==="directory"&&await W(Z)}B(W,"collect"),await W(G);let z=new Map;z.set(".",G);for(let X of Q){let Z=(await G.resolve(X)).join("/");z.set(Z,X)}return z},"getFsHandles"),S0=U0("AGFzbQEAAAABDANfAGAAAW9gAW8BfwMDAgECByECD2NyZWF0ZV9zZW50aW5lbAAAC2lzX3NlbnRpbmVsAAEKEwIHAPsBAPsbCwkAIAD7GvsUAAs="),w0=async function(){if(!(globalThis.navigator&&(/iPad|iPhone|iPod/.test(navigator.userAgent)||navigator.platform==="MacIntel"&&typeof navigator.maxTouchPoints<"u"&&navigator.maxTouchPoints>1)))try{let G=await WebAssembly.compile(S0);return await WebAssembly.instantiate(G)}catch(G){if(G instanceof WebAssembly.CompileError)return;throw G}}();async function Z0(){let G=await w0;if(G)return G.exports;let Q=Symbol("error marker");return{create_sentinel:B(()=>Q,"create_sentinel"),is_sentinel:B((W)=>W===Q,"is_sentinel")}}B(Z0,"getSentinelImport");function z0(G){let Q={config:G,runtimeEnv:Y},W={noImageDecoding:!0,noAudioDecoding:!0,noWasmDecoding:!1,preRun:V0(G),print:G.stdout,printErr:G.stderr,onExit(z){W.exitCode=z},thisProgram:G._sysExecutable,arguments:G.args,API:Q,locateFile:B((z)=>G.indexURL+z,"locateFile"),instantiateWasm:Y0(G.indexURL)};return W}B(z0,"createSettings");function B0(G){return function(Q){let W="/";try{Q.FS.mkdirTree(G)}catch(z){console.error(`Error occurred while making a home directory '${G}':`),console.error(z),console.error(`Using '${W}' for a home directory instead`),G=W}Q.FS.chdir(G)}}B(B0,"createHomeDirectory");function H0(G){return function(Q){Object.assign(Q.ENV,G)}}B(H0,"setEnvironment");function J0(G){return G?[async(Q)=>{Q.addRunDependency("fsInitHook");try{await G(Q.FS,{sitePackages:Q.API.sitePackages})}finally{Q.removeRunDependency("fsInitHook")}}]:[]}B(J0,"callFsInitHook");function K0(G){let Q=G.HEAPU32[G._Py_Version>>>2],W=Q>>>24&255,z=Q>>>16&255,X=Q>>>8&255;return[W,z,X]}B(K0,"computeVersionTuple");function M0(G){let Q=t(G);return async(W)=>{W.API.pyVersionTuple=K0(W);let[z,X]=W.API.pyVersionTuple;W.FS.mkdirTree("/lib"),W.API.sitePackages=`/lib/python${z}.${X}/site-packages`,W.FS.mkdirTree(W.API.sitePackages),W.addRunDependency("install-stdlib");try{let Z=await Q;W.FS.writeFile(`/lib/python${z}${X}.zip`,Z)}catch(Z){console.error("Error occurred while installing the standard library:"),console.error(Z)}finally{W.removeRunDependency("install-stdlib")}}}B(M0,"installStdlib");function V0(G){let Q;return G.stdLibURL!=null?Q=G.stdLibURL:Q=G.indexURL+"python_stdlib.zip",[M0(Q),B0(G.env.HOME),H0(G.env),X0,...J0(G.fsInit)]}B(V0,"getFileSystemInitializationFuncs");function Y0(G){if(typeof WasmOffsetConverter<"u")return;let{binary:Q,response:W}=S(G+"pyodide.asm.wasm"),z=Z0();return function(X,Z){return async function(){X.sentinel=await z;try{let H;W?H=await WebAssembly.instantiateStreaming(W,X):H=await WebAssembly.instantiate(await Q,X);let{instance:J,module:K}=H;Z(J,K)}catch(H){console.warn("wasm instantiation failed!"),console.warn(H)}}(),{}}}B(Y0,"getInstantiateWasmFunc");var E0="0.29.2";function N(G){return G===void 0||G.endsWith("/")?G:G+"/"}B(N,"withTrailingSlash");var P=E0;async function $0(G={}){if(await v(),G.lockFileContents&&G.lockFileURL)throw Error("Can't pass both lockFileContents and lockFileURL");let Q=G.indexURL||await Q0();if(Q=N(R(Q)),G.packageBaseUrl=N(G.packageBaseUrl),G.cdnUrl=N(G.packageBaseUrl??`https://cdn.jsdelivr.net/pyodide/v${P}/full/`),!G.lockFileContents){let X=G.lockFileURL??Q+"pyodide-lock.json";G.lockFileContents=G0(X),G.packageBaseUrl??=W0(X)}G.indexURL=Q,G.packageCacheDir&&(G.packageCacheDir=N(R(G.packageCacheDir)));let W={fullStdLib:!1,jsglobals:globalThis,stdin:globalThis.prompt?()=>globalThis.prompt():void 0,args:[],env:{},packages:[],packageCacheDir:G.packageBaseUrl,enableRunUntilComplete:!0,checkAPIVersion:!0,BUILD_ID:"02af97d1069c4309880e46f2948861ea1faae5dbb49c20d5d5970aa9ae912fd4"},z=Object.assign(W,G);return z.env.HOME??="/home/pyodide",z.env.PYTHONINSPECT??="1",z}B($0,"initializeConfiguration");function j0(G){let Q=z0(G),W=Q.API;return W.lockFilePromise=Promise.resolve(G.lockFileContents),Q}B(j0,"createEmscriptenSettings");async function C0(G){if(typeof _createPyodideModule!="function"){let Q=`${G.indexURL}pyodide.asm.js`;await I(Q)}}B(C0,"loadWasmScript");async function D0(G,Q){if(!G._loadSnapshot)return;let W=await G._loadSnapshot,z=ArrayBuffer.isView(W)?W:new Uint8Array(W);return Q.noInitialRun=!0,Q.INITIAL_MEMORY=z.length,z}B(D0,"prepareSnapshot");async function O0(G){let Q=await _createPyodideModule(G);if(G.exitCode!==void 0)throw new Q.ExitStatus(G.exitCode);return Q}B(O0,"createPyodideModule");function T0(G,Q){let W=G.API;if(Q.pyproxyToStringRepr&&W.setPyProxyToStringMethod(!0),Q.convertNullToNone&&W.setCompatNullToNone(!0),Q.toJsLiteralMap&&W.setCompatToJsLiteralMap(!0),W.version!==P&&Q.checkAPIVersion)throw Error(`Pyodide version does not match: '${P}' <==> '${W.version}'. If you updated the Pyodide version, make sure you also updated the 'indexURL' parameter passed to loadPyodide.`);G.locateFile=(z)=>{throw z.endsWith(".so")?Error(`Failed to find dynamic library "${z}"`):Error(`Unexpected call to locateFile("${z}")`)}}B(T0,"configureAPI");function q0(G,Q,W){let z=G.API,X;return Q&&(X=z.restoreSnapshot(Q)),z.finalizeBootstrap(X,W._snapshotDeserializer)}B(q0,"bootstrapPyodide");async function x0(G,Q){let W=G._api;return W.sys.path.insert(0,""),W._pyodide.set_excepthook(),await W.packageIndexReady,W.initializeStreams(Q.stdin,Q.stdout,Q.stderr),G}B(x0,"finalizeSetup");async function b0(G={}){let Q=await $0(G),W=j0(Q);await C0(Q);let z=await D0(Q,W),X=await O0(W);T0(X,Q);let Z=q0(X,z,Q);return await x0(Z,Q)}B(b0,"loadPyodide");export{P as version,b0 as loadPyodide};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./chunk-
|
|
1
|
+
import"./chunk-s9w2hb4g.js";function a(e){if(typeof e!=="string")throw TypeError("Path must be a string. Received "+JSON.stringify(e))}function A(e,r){var n="",l=0,f=-1,i=0,s;for(var t=0;t<=e.length;++t){if(t<e.length)s=e.charCodeAt(t);else if(s===47)break;else s=47;if(s===47){if(f===t-1||i===1);else if(f!==t-1&&i===2){if(n.length<2||l!==2||n.charCodeAt(n.length-1)!==46||n.charCodeAt(n.length-2)!==46){if(n.length>2){var u=n.lastIndexOf("/");if(u!==n.length-1){if(u===-1)n="",l=0;else n=n.slice(0,u),l=n.length-1-n.lastIndexOf("/");f=t,i=0;continue}}else if(n.length===2||n.length===1){n="",l=0,f=t,i=0;continue}}if(r){if(n.length>0)n+="/..";else n="..";l=2}}else{if(n.length>0)n+="/"+e.slice(f+1,t);else n=e.slice(f+1,t);l=t-f-1}f=t,i=0}else if(s===46&&i!==-1)++i;else i=-1}return n}function h(e,r){var n=r.dir||r.root,l=r.base||(r.name||"")+(r.ext||"");if(!n)return l;if(n===r.root)return n+l;return n+e+l}function d(){var e="",r=!1,n;for(var l=arguments.length-1;l>=-1&&!r;l--){var f;if(l>=0)f=arguments[l];else{if(n===void 0)n=process.cwd();f=n}if(a(f),f.length===0)continue;e=f+"/"+e,r=f.charCodeAt(0)===47}if(e=A(e,!r),r)if(e.length>0)return"/"+e;else return"/";else if(e.length>0)return e;else return"."}function m(e){if(a(e),e.length===0)return".";var r=e.charCodeAt(0)===47,n=e.charCodeAt(e.length-1)===47;if(e=A(e,!r),e.length===0&&!r)e=".";if(e.length>0&&n)e+="/";if(r)return"/"+e;return e}function b(e){return a(e),e.length>0&&e.charCodeAt(0)===47}function k(){if(arguments.length===0)return".";var e;for(var r=0;r<arguments.length;++r){var n=arguments[r];if(a(n),n.length>0)if(e===void 0)e=n;else e+="/"+n}if(e===void 0)return".";return m(e)}function y(e,r){if(a(e),a(r),e===r)return"";if(e=d(e),r=d(r),e===r)return"";var n=1;for(;n<e.length;++n)if(e.charCodeAt(n)!==47)break;var l=e.length,f=l-n,i=1;for(;i<r.length;++i)if(r.charCodeAt(i)!==47)break;var s=r.length,t=s-i,u=f<t?f:t,c=-1,o=0;for(;o<=u;++o){if(o===u){if(t>u){if(r.charCodeAt(i+o)===47)return r.slice(i+o+1);else if(o===0)return r.slice(i+o)}else if(f>u){if(e.charCodeAt(n+o)===47)c=o;else if(o===0)c=0}break}var v=e.charCodeAt(n+o),C=r.charCodeAt(i+o);if(v!==C)break;else if(v===47)c=o}var g="";for(o=n+c+1;o<=l;++o)if(o===l||e.charCodeAt(o)===47)if(g.length===0)g+="..";else g+="/..";if(g.length>0)return g+r.slice(i+c);else{if(i+=c,r.charCodeAt(i)===47)++i;return r.slice(i)}}function S(e){return e}function w(e){if(a(e),e.length===0)return".";var r=e.charCodeAt(0),n=r===47,l=-1,f=!0;for(var i=e.length-1;i>=1;--i)if(r=e.charCodeAt(i),r===47){if(!f){l=i;break}}else f=!1;if(l===-1)return n?"/":".";if(n&&l===1)return"//";return e.slice(0,l)}function P(e,r){if(r!==void 0&&typeof r!=="string")throw TypeError('"ext" argument must be a string');a(e);var n=0,l=-1,f=!0,i;if(r!==void 0&&r.length>0&&r.length<=e.length){if(r.length===e.length&&r===e)return"";var s=r.length-1,t=-1;for(i=e.length-1;i>=0;--i){var u=e.charCodeAt(i);if(u===47){if(!f){n=i+1;break}}else{if(t===-1)f=!1,t=i+1;if(s>=0)if(u===r.charCodeAt(s)){if(--s===-1)l=i}else s=-1,l=t}}if(n===l)l=t;else if(l===-1)l=e.length;return e.slice(n,l)}else{for(i=e.length-1;i>=0;--i)if(e.charCodeAt(i)===47){if(!f){n=i+1;break}}else if(l===-1)f=!1,l=i+1;if(l===-1)return"";return e.slice(n,l)}}function D(e){a(e);var r=-1,n=0,l=-1,f=!0,i=0;for(var s=e.length-1;s>=0;--s){var t=e.charCodeAt(s);if(t===47){if(!f){n=s+1;break}continue}if(l===-1)f=!1,l=s+1;if(t===46){if(r===-1)r=s;else if(i!==1)i=1}else if(r!==-1)i=-1}if(r===-1||l===-1||i===0||i===1&&r===l-1&&r===n+1)return"";return e.slice(r,l)}function L(e){if(e===null||typeof e!=="object")throw TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return h("/",e)}function T(e){a(e);var r={root:"",dir:"",base:"",ext:"",name:""};if(e.length===0)return r;var n=e.charCodeAt(0),l=n===47,f;if(l)r.root="/",f=1;else f=0;var i=-1,s=0,t=-1,u=!0,c=e.length-1,o=0;for(;c>=f;--c){if(n=e.charCodeAt(c),n===47){if(!u){s=c+1;break}continue}if(t===-1)u=!1,t=c+1;if(n===46){if(i===-1)i=c;else if(o!==1)o=1}else if(i!==-1)o=-1}if(i===-1||t===-1||o===0||o===1&&i===t-1&&i===s+1){if(t!==-1)if(s===0&&l)r.base=r.name=e.slice(1,t);else r.base=r.name=e.slice(s,t)}else{if(s===0&&l)r.name=e.slice(1,i),r.base=e.slice(1,t);else r.name=e.slice(s,i),r.base=e.slice(s,t);r.ext=e.slice(i,t)}if(s>0)r.dir=e.slice(0,s-1);else if(l)r.dir="/";return r}var R="/",_=":",z=((e)=>(e.posix=e,e))({resolve:d,normalize:m,isAbsolute:b,join:k,relative:y,_makeLong:S,dirname:w,basename:P,extname:D,format:L,parse:T,sep:R,delimiter:_,win32:null,posix:null}),E=z;export{R as sep,d as resolve,y as relative,z as posix,T as parse,m as normalize,k as join,b as isAbsolute,L as format,D as extname,w as dirname,_ as delimiter,E as default,P as basename,S as _makeLong};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as h0,c as iY,d as $X,f as KX,g as GJ}from"./chunk-q8xkh3ym.js";var FU={};$X(FU,{transcode:()=>qY,resolveObjectURL:()=>MY,kStringMaxLength:()=>zZ,kMaxLength:()=>rU,isUtf8:()=>SY,isAscii:()=>RY,default:()=>PY,constants:()=>rQ,btoa:()=>nQ,atob:()=>mQ,INSPECT_MAX_BYTES:()=>DZ,File:()=>sQ,Buffer:()=>$0,Blob:()=>tQ});function uQ(I){var O=I.length;if(O%4>0)throw Error("Invalid string. Length must be a multiple of 4");var F=I.indexOf("=");if(F===-1)F=O;var T=F===O?0:4-F%4;return[F,T]}function bQ(I,O){return(I+O)*3/4-O}function lQ(I){var O,F=uQ(I),T=F[0],H=F[1],E=new Uint8Array(bQ(T,H)),V=0,P=H>0?T-4:T,q;for(q=0;q<P;q+=4)O=PU[I.charCodeAt(q)]<<18|PU[I.charCodeAt(q+1)]<<12|PU[I.charCodeAt(q+2)]<<6|PU[I.charCodeAt(q+3)],E[V++]=O>>16&255,E[V++]=O>>8&255,E[V++]=O&255;if(H===2)O=PU[I.charCodeAt(q)]<<2|PU[I.charCodeAt(q+1)]>>4,E[V++]=O&255;if(H===1)O=PU[I.charCodeAt(q)]<<10|PU[I.charCodeAt(q+1)]<<4|PU[I.charCodeAt(q+2)]>>2,E[V++]=O>>8&255,E[V++]=O&255;return E}function dQ(I){return jU[I>>18&63]+jU[I>>12&63]+jU[I>>6&63]+jU[I&63]}function oQ(I,O,F){var T,H=[];for(var E=O;E<F;E+=3)T=(I[E]<<16&16711680)+(I[E+1]<<8&65280)+(I[E+2]&255),H.push(dQ(T));return H.join("")}function WZ(I){var O,F=I.length,T=F%3,H=[],E=16383;for(var V=0,P=F-T;V<P;V+=E)H.push(oQ(I,V,V+E>P?P:V+E));if(T===1)O=I[F-1],H.push(jU[O>>2]+jU[O<<4&63]+"==");else if(T===2)O=(I[F-2]<<8)+I[F-1],H.push(jU[O>>10]+jU[O>>4&63]+jU[O<<2&63]+"=");return H.join("")}function OX(I,O,F,T,H){var E,V,P=H*8-T-1,q=(1<<P)-1,L=q>>1,z=-7,C=F?H-1:0,D=F?-1:1,S=I[O+C];C+=D,E=S&(1<<-z)-1,S>>=-z,z+=P;for(;z>0;E=E*256+I[O+C],C+=D,z-=8);V=E&(1<<-z)-1,E>>=-z,z+=T;for(;z>0;V=V*256+I[O+C],C+=D,z-=8);if(E===0)E=1-L;else if(E===q)return V?NaN:(S?-1:1)*(1/0);else V=V+Math.pow(2,T),E=E-L;return(S?-1:1)*V*Math.pow(2,E-T)}function TZ(I,O,F,T,H,E){var V,P,q,L=E*8-H-1,z=(1<<L)-1,C=z>>1,D=H===23?Math.pow(2,-24)-Math.pow(2,-77):0,S=T?0:E-1,R=T?1:-1,v=O<0||O===0&&1/O<0?1:0;if(O=Math.abs(O),isNaN(O)||O===1/0)P=isNaN(O)?1:0,V=z;else{if(V=Math.floor(Math.log(O)/Math.LN2),O*(q=Math.pow(2,-V))<1)V--,q*=2;if(V+C>=1)O+=D/q;else O+=D*Math.pow(2,1-C);if(O*q>=2)V++,q/=2;if(V+C>=z)P=0,V=z;else if(V+C>=1)P=(O*q-1)*Math.pow(2,H),V=V+C;else P=O*Math.pow(2,C-1)*Math.pow(2,H),V=0}for(;H>=8;I[F+S]=P&255,S+=R,P/=256,H-=8);V=V<<H|P,L+=H;for(;L>0;I[F+S]=V&255,S+=R,V/=256,L-=8);I[F+S-R]|=v*128}function BU(I){if(I>rU)throw RangeError('The value "'+I+'" is invalid for option "size"');let O=new Uint8Array(I);return Object.setPrototypeOf(O,$0.prototype),O}function wX(I,O,F){return class extends F{constructor(){super();Object.defineProperty(this,"message",{value:O.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${I}]`,this.stack,delete this.name}get code(){return I}set code(T){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:T,writable:!0})}toString(){return`${this.name} [${I}]: ${this.message}`}}}function $0(I,O,F){if(typeof I==="number"){if(typeof O==="string")throw TypeError('The "string" argument must be of type string. Received type number');return yX(I)}return LZ(I,O,F)}function LZ(I,O,F){if(typeof I==="string")return UY(I,O);if(ArrayBuffer.isView(I))return XY(I);if(I==null)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof I);if(vU(I,ArrayBuffer)||I&&vU(I.buffer,ArrayBuffer))return NX(I,O,F);if(typeof SharedArrayBuffer<"u"&&(vU(I,SharedArrayBuffer)||I&&vU(I.buffer,SharedArrayBuffer)))return NX(I,O,F);if(typeof I==="number")throw TypeError('The "value" argument must not be of type number. Received type number');let T=I.valueOf&&I.valueOf();if(T!=null&&T!==I)return $0.from(T,O,F);let H=ZY(I);if(H)return H;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof I[Symbol.toPrimitive]==="function")return $0.from(I[Symbol.toPrimitive]("string"),O,F);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof I)}function EZ(I){if(typeof I!=="number")throw TypeError('"size" argument must be of type number');else if(I<0)throw RangeError('The value "'+I+'" is invalid for option "size"')}function iQ(I,O,F){if(EZ(I),I<=0)return BU(I);if(O!==void 0)return typeof F==="string"?BU(I).fill(O,F):BU(I).fill(O);return BU(I)}function yX(I){return EZ(I),BU(I<0?0:fX(I)|0)}function UY(I,O){if(typeof O!=="string"||O==="")O="utf8";if(!$0.isEncoding(O))throw TypeError("Unknown encoding: "+O);let F=MZ(I,O)|0,T=BU(F),H=T.write(I,O);if(H!==F)T=T.slice(0,H);return T}function xX(I){let O=I.length<0?0:fX(I.length)|0,F=BU(O);for(let T=0;T<O;T+=1)F[T]=I[T]&255;return F}function XY(I){if(vU(I,Uint8Array)){let O=new Uint8Array(I);return NX(O.buffer,O.byteOffset,O.byteLength)}return xX(I)}function NX(I,O,F){if(O<0||I.byteLength<O)throw RangeError('"offset" is outside of buffer bounds');if(I.byteLength<O+(F||0))throw RangeError('"length" is outside of buffer bounds');let T;if(O===void 0&&F===void 0)T=new Uint8Array(I);else if(F===void 0)T=new Uint8Array(I,O);else T=new Uint8Array(I,O,F);return Object.setPrototypeOf(T,$0.prototype),T}function ZY(I){if($0.isBuffer(I)){let O=fX(I.length)|0,F=BU(O);if(F.length===0)return F;return I.copy(F,0,0,O),F}if(I.length!==void 0){if(typeof I.length!=="number"||Number.isNaN(I.length))return BU(0);return xX(I)}if(I.type==="Buffer"&&Array.isArray(I.data))return xX(I.data)}function fX(I){if(I>=rU)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+rU.toString(16)+" bytes");return I|0}function MZ(I,O){if($0.isBuffer(I))return I.length;if(ArrayBuffer.isView(I)||vU(I,ArrayBuffer))return I.byteLength;if(typeof I!=="string")throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof I);let F=I.length,T=arguments.length>2&&arguments[2]===!0;if(!T&&F===0)return 0;let H=!1;for(;;)switch(O){case"ascii":case"latin1":case"binary":return F;case"utf8":case"utf-8":return gX(I).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return F*2;case"hex":return F>>>1;case"base64":return BZ(I).length;default:if(H)return T?-1:gX(I).length;O=(""+O).toLowerCase(),H=!0}}function QY(I,O,F){let T=!1;if(O===void 0||O<0)O=0;if(O>this.length)return"";if(F===void 0||F>this.length)F=this.length;if(F<=0)return"";if(F>>>=0,O>>>=0,F<=O)return"";if(!I)I="utf8";while(!0)switch(I){case"hex":return FY(this,O,F);case"utf8":case"utf-8":return RZ(this,O,F);case"ascii":return OY(this,O,F);case"latin1":case"binary":return WY(this,O,F);case"base64":return $Y(this,O,F);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return HY(this,O,F);default:if(T)throw TypeError("Unknown encoding: "+I);I=(I+"").toLowerCase(),T=!0}}function hU(I,O,F){let T=I[O];I[O]=I[F],I[F]=T}function SZ(I,O,F,T,H){if(I.length===0)return-1;if(typeof F==="string")T=F,F=0;else if(F>2147483647)F=2147483647;else if(F<-2147483648)F=-2147483648;if(F=+F,Number.isNaN(F))F=H?0:I.length-1;if(F<0)F=I.length+F;if(F>=I.length)if(H)return-1;else F=I.length-1;else if(F<0)if(H)F=0;else return-1;if(typeof O==="string")O=$0.from(O,T);if($0.isBuffer(O)){if(O.length===0)return-1;return HZ(I,O,F,T,H)}else if(typeof O==="number"){if(O=O&255,typeof Uint8Array.prototype.indexOf==="function")if(H)return Uint8Array.prototype.indexOf.call(I,O,F);else return Uint8Array.prototype.lastIndexOf.call(I,O,F);return HZ(I,[O],F,T,H)}throw TypeError("val must be string, number or Buffer")}function HZ(I,O,F,T,H){let E=1,V=I.length,P=O.length;if(T!==void 0){if(T=String(T).toLowerCase(),T==="ucs2"||T==="ucs-2"||T==="utf16le"||T==="utf-16le"){if(I.length<2||O.length<2)return-1;E=2,V/=2,P/=2,F/=2}}function q(z,C){if(E===1)return z[C];else return z.readUInt16BE(C*E)}let L;if(H){let z=-1;for(L=F;L<V;L++)if(q(I,L)===q(O,z===-1?0:L-z)){if(z===-1)z=L;if(L-z+1===P)return z*E}else{if(z!==-1)L-=L-z;z=-1}}else{if(F+P>V)F=V-P;for(L=F;L>=0;L--){let z=!0;for(let C=0;C<P;C++)if(q(I,L+C)!==q(O,C)){z=!1;break}if(z)return L}}return-1}function YY(I,O,F,T){F=Number(F)||0;let H=I.length-F;if(!T)T=H;else if(T=Number(T),T>H)T=H;let E=O.length;if(T>E/2)T=E/2;let V;for(V=0;V<T;++V){let P=parseInt(O.substr(V*2,2),16);if(Number.isNaN(P))return V;I[F+V]=P}return V}function JY(I,O,F,T){return WX(gX(O,I.length-F),I,F,T)}function VY(I,O,F,T){return WX(DY(O),I,F,T)}function GY(I,O,F,T){return WX(BZ(O),I,F,T)}function IY(I,O,F,T){return WX(zY(O,I.length-F),I,F,T)}function $Y(I,O,F){if(O===0&&F===I.length)return WZ(I);else return WZ(I.slice(O,F))}function RZ(I,O,F){F=Math.min(I.length,F);let T=[],H=O;while(H<F){let E=I[H],V=null,P=E>239?4:E>223?3:E>191?2:1;if(H+P<=F){let q,L,z,C;switch(P){case 1:if(E<128)V=E;break;case 2:if(q=I[H+1],(q&192)===128){if(C=(E&31)<<6|q&63,C>127)V=C}break;case 3:if(q=I[H+1],L=I[H+2],(q&192)===128&&(L&192)===128){if(C=(E&15)<<12|(q&63)<<6|L&63,C>2047&&(C<55296||C>57343))V=C}break;case 4:if(q=I[H+1],L=I[H+2],z=I[H+3],(q&192)===128&&(L&192)===128&&(z&192)===128){if(C=(E&15)<<18|(q&63)<<12|(L&63)<<6|z&63,C>65535&&C<1114112)V=C}}}if(V===null)V=65533,P=1;else if(V>65535)V-=65536,T.push(V>>>10&1023|55296),V=56320|V&1023;T.push(V),H+=P}return KY(T)}function KY(I){let O=I.length;if(O<=CZ)return String.fromCharCode.apply(String,I);let F="",T=0;while(T<O)F+=String.fromCharCode.apply(String,I.slice(T,T+=CZ));return F}function OY(I,O,F){let T="";F=Math.min(I.length,F);for(let H=O;H<F;++H)T+=String.fromCharCode(I[H]&127);return T}function WY(I,O,F){let T="";F=Math.min(I.length,F);for(let H=O;H<F;++H)T+=String.fromCharCode(I[H]);return T}function FY(I,O,F){let T=I.length;if(!O||O<0)O=0;if(!F||F<0||F>T)F=T;let H="";for(let E=O;E<F;++E)H+=LY[I[E]];return H}function HY(I,O,F){let T=I.slice(O,F),H="";for(let E=0;E<T.length-1;E+=2)H+=String.fromCharCode(T[E]+T[E+1]*256);return H}function WU(I,O,F){if(I%1!==0||I<0)throw RangeError("offset is not uint");if(I+O>F)throw RangeError("Trying to access beyond buffer length")}function EU(I,O,F,T,H,E){if(!$0.isBuffer(I))throw TypeError('"buffer" argument must be a Buffer instance');if(O>H||O<E)throw RangeError('"value" argument is out of bounds');if(F+T>I.length)throw RangeError("Index out of range")}function qZ(I,O,F,T,H){_Z(O,T,H,I,F,7);let E=Number(O&BigInt(4294967295));I[F++]=E,E=E>>8,I[F++]=E,E=E>>8,I[F++]=E,E=E>>8,I[F++]=E;let V=Number(O>>BigInt(32)&BigInt(4294967295));return I[F++]=V,V=V>>8,I[F++]=V,V=V>>8,I[F++]=V,V=V>>8,I[F++]=V,F}function PZ(I,O,F,T,H){_Z(O,T,H,I,F,7);let E=Number(O&BigInt(4294967295));I[F+7]=E,E=E>>8,I[F+6]=E,E=E>>8,I[F+5]=E,E=E>>8,I[F+4]=E;let V=Number(O>>BigInt(32)&BigInt(4294967295));return I[F+3]=V,V=V>>8,I[F+2]=V,V=V>>8,I[F+1]=V,V=V>>8,I[F]=V,F+8}function kZ(I,O,F,T,H,E){if(F+T>I.length)throw RangeError("Index out of range");if(F<0)throw RangeError("Index out of range")}function jZ(I,O,F,T,H){if(O=+O,F=F>>>0,!H)kZ(I,O,F,4,340282346638528860000000000000000000000,-340282346638528860000000000000000000000);return TZ(I,O,F,T,23,4),F+4}function vZ(I,O,F,T,H){if(O=+O,F=F>>>0,!H)kZ(I,O,F,8,179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000,-179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000);return TZ(I,O,F,T,52,8),F+8}function AZ(I){let O="",F=I.length,T=I[0]==="-"?1:0;for(;F>=T+4;F-=3)O=`_${I.slice(F-3,F)}${O}`;return`${I.slice(0,F)}${O}`}function CY(I,O,F){if(oU(O,"offset"),I[O]===void 0||I[O+F]===void 0)aU(O,I.length-(F+1))}function _Z(I,O,F,T,H,E){if(I>F||I<O){let V=typeof O==="bigint"?"n":"",P;if(E>3)if(O===0||O===BigInt(0))P=`>= 0${V} and < 2${V} ** ${(E+1)*8}${V}`;else P=`>= -(2${V} ** ${(E+1)*8-1}${V}) and < 2 ** ${(E+1)*8-1}${V}`;else P=`>= ${O}${V} and <= ${F}${V}`;throw new BX("value",P,I)}CY(T,H,E)}function oU(I,O){if(typeof I!=="number")throw new eQ(O,"number",I)}function aU(I,O,F){if(Math.floor(I)!==I)throw oU(I,F),new BX(F||"offset","an integer",I);if(O<0)throw new aQ;throw new BX(F||"offset",`>= ${F?1:0} and <= ${O}`,I)}function TY(I){if(I=I.split("=")[0],I=I.trim().replace(AY,""),I.length<2)return"";while(I.length%4!==0)I=I+"=";return I}function gX(I,O){O=O||1/0;let F,T=I.length,H=null,E=[];for(let V=0;V<T;++V){if(F=I.charCodeAt(V),F>55295&&F<57344){if(!H){if(F>56319){if((O-=3)>-1)E.push(239,191,189);continue}else if(V+1===T){if((O-=3)>-1)E.push(239,191,189);continue}H=F;continue}if(F<56320){if((O-=3)>-1)E.push(239,191,189);H=F;continue}F=(H-55296<<10|F-56320)+65536}else if(H){if((O-=3)>-1)E.push(239,191,189)}if(H=null,F<128){if((O-=1)<0)break;E.push(F)}else if(F<2048){if((O-=2)<0)break;E.push(F>>6|192,F&63|128)}else if(F<65536){if((O-=3)<0)break;E.push(F>>12|224,F>>6&63|128,F&63|128)}else if(F<1114112){if((O-=4)<0)break;E.push(F>>18|240,F>>12&63|128,F>>6&63|128,F&63|128)}else throw Error("Invalid code point")}return E}function DY(I){let O=[];for(let F=0;F<I.length;++F)O.push(I.charCodeAt(F)&255);return O}function zY(I,O){let F,T,H,E=[];for(let V=0;V<I.length;++V){if((O-=2)<0)break;F=I.charCodeAt(V),T=F>>8,H=F%256,E.push(H),E.push(T)}return E}function BZ(I){return lQ(TY(I))}function WX(I,O,F,T){let H;for(H=0;H<T;++H){if(H+F>=O.length||H>=I.length)break;O[H+F]=I[H]}return H}function vU(I,O){return I instanceof O||I!=null&&I.constructor!=null&&I.constructor.name!=null&&I.constructor.name===O.name}function wU(I){return typeof BigInt>"u"?EY:I}function EY(){throw Error("BigInt not supported")}function cX(I){return()=>{throw Error(I+" is not implemented for node:buffer browser polyfill")}}var jU,PU,_X="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",pU,OZ,FZ,DZ=50,rU=2147483647,zZ=536870888,nQ,mQ,sQ,tQ,rQ,aQ,eQ,BX,CZ=4096,AY,LY,MY,SY,RY=(I)=>{for(let O of I)if(O.charCodeAt(0)>127)return!1;return!0},qY,PY;var HU=KX(()=>{jU=[],PU=[];for(pU=0,OZ=_X.length;pU<OZ;++pU)jU[pU]=_X[pU],PU[_X.charCodeAt(pU)]=pU;PU[45]=62;PU[95]=63;FZ=typeof Symbol==="function"&&typeof Symbol.for==="function"?Symbol.for("nodejs.util.inspect.custom"):null,nQ=globalThis.btoa,mQ=globalThis.atob,sQ=globalThis.File,tQ=globalThis.Blob,rQ={MAX_LENGTH:rU,MAX_STRING_LENGTH:zZ};aQ=wX("ERR_BUFFER_OUT_OF_BOUNDS",function(I){if(I)return`${I} is outside of buffer bounds`;return"Attempt to access memory outside buffer bounds"},RangeError),eQ=wX("ERR_INVALID_ARG_TYPE",function(I,O){return`The "${I}" argument must be of type number. Received type ${typeof O}`},TypeError),BX=wX("ERR_OUT_OF_RANGE",function(I,O,F){let T=`The value of "${I}" is out of range.`,H=F;if(Number.isInteger(F)&&Math.abs(F)>4294967296)H=AZ(String(F));else if(typeof F==="bigint"){if(H=String(F),F>BigInt(2)**BigInt(32)||F<-(BigInt(2)**BigInt(32)))H=AZ(H);H+="n"}return T+=` It must be ${O}. Received ${H}`,T},RangeError);Object.defineProperty($0.prototype,"parent",{enumerable:!0,get:function(){if(!$0.isBuffer(this))return;return this.buffer}});Object.defineProperty($0.prototype,"offset",{enumerable:!0,get:function(){if(!$0.isBuffer(this))return;return this.byteOffset}});$0.poolSize=8192;$0.from=function(I,O,F){return LZ(I,O,F)};Object.setPrototypeOf($0.prototype,Uint8Array.prototype);Object.setPrototypeOf($0,Uint8Array);$0.alloc=function(I,O,F){return iQ(I,O,F)};$0.allocUnsafe=function(I){return yX(I)};$0.allocUnsafeSlow=function(I){return yX(I)};$0.isBuffer=function(I){return I!=null&&I._isBuffer===!0&&I!==$0.prototype};$0.compare=function(I,O){if(vU(I,Uint8Array))I=$0.from(I,I.offset,I.byteLength);if(vU(O,Uint8Array))O=$0.from(O,O.offset,O.byteLength);if(!$0.isBuffer(I)||!$0.isBuffer(O))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(I===O)return 0;let F=I.length,T=O.length;for(let H=0,E=Math.min(F,T);H<E;++H)if(I[H]!==O[H]){F=I[H],T=O[H];break}if(F<T)return-1;if(T<F)return 1;return 0};$0.isEncoding=function(I){switch(String(I).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};$0.concat=function(I,O){if(!Array.isArray(I))throw TypeError('"list" argument must be an Array of Buffers');if(I.length===0)return $0.alloc(0);let F;if(O===void 0){O=0;for(F=0;F<I.length;++F)O+=I[F].length}let T=$0.allocUnsafe(O),H=0;for(F=0;F<I.length;++F){let E=I[F];if(vU(E,Uint8Array))if(H+E.length>T.length){if(!$0.isBuffer(E))E=$0.from(E);E.copy(T,H)}else Uint8Array.prototype.set.call(T,E,H);else if(!$0.isBuffer(E))throw TypeError('"list" argument must be an Array of Buffers');else E.copy(T,H);H+=E.length}return T};$0.byteLength=MZ;$0.prototype._isBuffer=!0;$0.prototype.swap16=function(){let I=this.length;if(I%2!==0)throw RangeError("Buffer size must be a multiple of 16-bits");for(let O=0;O<I;O+=2)hU(this,O,O+1);return this};$0.prototype.swap32=function(){let I=this.length;if(I%4!==0)throw RangeError("Buffer size must be a multiple of 32-bits");for(let O=0;O<I;O+=4)hU(this,O,O+3),hU(this,O+1,O+2);return this};$0.prototype.swap64=function(){let I=this.length;if(I%8!==0)throw RangeError("Buffer size must be a multiple of 64-bits");for(let O=0;O<I;O+=8)hU(this,O,O+7),hU(this,O+1,O+6),hU(this,O+2,O+5),hU(this,O+3,O+4);return this};$0.prototype.toString=function(){let I=this.length;if(I===0)return"";if(arguments.length===0)return RZ(this,0,I);return QY.apply(this,arguments)};$0.prototype.toLocaleString=$0.prototype.toString;$0.prototype.equals=function(I){if(!$0.isBuffer(I))throw TypeError("Argument must be a Buffer");if(this===I)return!0;return $0.compare(this,I)===0};$0.prototype.inspect=function(){let I="",O=DZ;if(I=this.toString("hex",0,O).replace(/(.{2})/g,"$1 ").trim(),this.length>O)I+=" ... ";return"<Buffer "+I+">"};if(FZ)$0.prototype[FZ]=$0.prototype.inspect;$0.prototype.compare=function(I,O,F,T,H){if(vU(I,Uint8Array))I=$0.from(I,I.offset,I.byteLength);if(!$0.isBuffer(I))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof I);if(O===void 0)O=0;if(F===void 0)F=I?I.length:0;if(T===void 0)T=0;if(H===void 0)H=this.length;if(O<0||F>I.length||T<0||H>this.length)throw RangeError("out of range index");if(T>=H&&O>=F)return 0;if(T>=H)return-1;if(O>=F)return 1;if(O>>>=0,F>>>=0,T>>>=0,H>>>=0,this===I)return 0;let E=H-T,V=F-O,P=Math.min(E,V),q=this.slice(T,H),L=I.slice(O,F);for(let z=0;z<P;++z)if(q[z]!==L[z]){E=q[z],V=L[z];break}if(E<V)return-1;if(V<E)return 1;return 0};$0.prototype.includes=function(I,O,F){return this.indexOf(I,O,F)!==-1};$0.prototype.indexOf=function(I,O,F){return SZ(this,I,O,F,!0)};$0.prototype.lastIndexOf=function(I,O,F){return SZ(this,I,O,F,!1)};$0.prototype.write=function(I,O,F,T){if(O===void 0)T="utf8",F=this.length,O=0;else if(F===void 0&&typeof O==="string")T=O,F=this.length,O=0;else if(isFinite(O))if(O=O>>>0,isFinite(F)){if(F=F>>>0,T===void 0)T="utf8"}else T=F,F=void 0;else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let H=this.length-O;if(F===void 0||F>H)F=H;if(I.length>0&&(F<0||O<0)||O>this.length)throw RangeError("Attempt to write outside buffer bounds");if(!T)T="utf8";let E=!1;for(;;)switch(T){case"hex":return YY(this,I,O,F);case"utf8":case"utf-8":return JY(this,I,O,F);case"ascii":case"latin1":case"binary":return VY(this,I,O,F);case"base64":return GY(this,I,O,F);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return IY(this,I,O,F);default:if(E)throw TypeError("Unknown encoding: "+T);T=(""+T).toLowerCase(),E=!0}};$0.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};$0.prototype.slice=function(I,O){let F=this.length;if(I=~~I,O=O===void 0?F:~~O,I<0){if(I+=F,I<0)I=0}else if(I>F)I=F;if(O<0){if(O+=F,O<0)O=0}else if(O>F)O=F;if(O<I)O=I;let T=this.subarray(I,O);return Object.setPrototypeOf(T,$0.prototype),T};$0.prototype.readUintLE=$0.prototype.readUIntLE=function(I,O,F){if(I=I>>>0,O=O>>>0,!F)WU(I,O,this.length);let T=this[I],H=1,E=0;while(++E<O&&(H*=256))T+=this[I+E]*H;return T};$0.prototype.readUintBE=$0.prototype.readUIntBE=function(I,O,F){if(I=I>>>0,O=O>>>0,!F)WU(I,O,this.length);let T=this[I+--O],H=1;while(O>0&&(H*=256))T+=this[I+--O]*H;return T};$0.prototype.readUint8=$0.prototype.readUInt8=function(I,O){if(I=I>>>0,!O)WU(I,1,this.length);return this[I]};$0.prototype.readUint16LE=$0.prototype.readUInt16LE=function(I,O){if(I=I>>>0,!O)WU(I,2,this.length);return this[I]|this[I+1]<<8};$0.prototype.readUint16BE=$0.prototype.readUInt16BE=function(I,O){if(I=I>>>0,!O)WU(I,2,this.length);return this[I]<<8|this[I+1]};$0.prototype.readUint32LE=$0.prototype.readUInt32LE=function(I,O){if(I=I>>>0,!O)WU(I,4,this.length);return(this[I]|this[I+1]<<8|this[I+2]<<16)+this[I+3]*16777216};$0.prototype.readUint32BE=$0.prototype.readUInt32BE=function(I,O){if(I=I>>>0,!O)WU(I,4,this.length);return this[I]*16777216+(this[I+1]<<16|this[I+2]<<8|this[I+3])};$0.prototype.readBigUInt64LE=wU(function(I){I=I>>>0,oU(I,"offset");let O=this[I],F=this[I+7];if(O===void 0||F===void 0)aU(I,this.length-8);let T=O+this[++I]*256+this[++I]*65536+this[++I]*16777216,H=this[++I]+this[++I]*256+this[++I]*65536+F*16777216;return BigInt(T)+(BigInt(H)<<BigInt(32))});$0.prototype.readBigUInt64BE=wU(function(I){I=I>>>0,oU(I,"offset");let O=this[I],F=this[I+7];if(O===void 0||F===void 0)aU(I,this.length-8);let T=O*16777216+this[++I]*65536+this[++I]*256+this[++I],H=this[++I]*16777216+this[++I]*65536+this[++I]*256+F;return(BigInt(T)<<BigInt(32))+BigInt(H)});$0.prototype.readIntLE=function(I,O,F){if(I=I>>>0,O=O>>>0,!F)WU(I,O,this.length);let T=this[I],H=1,E=0;while(++E<O&&(H*=256))T+=this[I+E]*H;if(H*=128,T>=H)T-=Math.pow(2,8*O);return T};$0.prototype.readIntBE=function(I,O,F){if(I=I>>>0,O=O>>>0,!F)WU(I,O,this.length);let T=O,H=1,E=this[I+--T];while(T>0&&(H*=256))E+=this[I+--T]*H;if(H*=128,E>=H)E-=Math.pow(2,8*O);return E};$0.prototype.readInt8=function(I,O){if(I=I>>>0,!O)WU(I,1,this.length);if(!(this[I]&128))return this[I];return(255-this[I]+1)*-1};$0.prototype.readInt16LE=function(I,O){if(I=I>>>0,!O)WU(I,2,this.length);let F=this[I]|this[I+1]<<8;return F&32768?F|4294901760:F};$0.prototype.readInt16BE=function(I,O){if(I=I>>>0,!O)WU(I,2,this.length);let F=this[I+1]|this[I]<<8;return F&32768?F|4294901760:F};$0.prototype.readInt32LE=function(I,O){if(I=I>>>0,!O)WU(I,4,this.length);return this[I]|this[I+1]<<8|this[I+2]<<16|this[I+3]<<24};$0.prototype.readInt32BE=function(I,O){if(I=I>>>0,!O)WU(I,4,this.length);return this[I]<<24|this[I+1]<<16|this[I+2]<<8|this[I+3]};$0.prototype.readBigInt64LE=wU(function(I){I=I>>>0,oU(I,"offset");let O=this[I],F=this[I+7];if(O===void 0||F===void 0)aU(I,this.length-8);let T=this[I+4]+this[I+5]*256+this[I+6]*65536+(F<<24);return(BigInt(T)<<BigInt(32))+BigInt(O+this[++I]*256+this[++I]*65536+this[++I]*16777216)});$0.prototype.readBigInt64BE=wU(function(I){I=I>>>0,oU(I,"offset");let O=this[I],F=this[I+7];if(O===void 0||F===void 0)aU(I,this.length-8);let T=(O<<24)+this[++I]*65536+this[++I]*256+this[++I];return(BigInt(T)<<BigInt(32))+BigInt(this[++I]*16777216+this[++I]*65536+this[++I]*256+F)});$0.prototype.readFloatLE=function(I,O){if(I=I>>>0,!O)WU(I,4,this.length);return OX(this,I,!0,23,4)};$0.prototype.readFloatBE=function(I,O){if(I=I>>>0,!O)WU(I,4,this.length);return OX(this,I,!1,23,4)};$0.prototype.readDoubleLE=function(I,O){if(I=I>>>0,!O)WU(I,8,this.length);return OX(this,I,!0,52,8)};$0.prototype.readDoubleBE=function(I,O){if(I=I>>>0,!O)WU(I,8,this.length);return OX(this,I,!1,52,8)};$0.prototype.writeUintLE=$0.prototype.writeUIntLE=function(I,O,F,T){if(I=+I,O=O>>>0,F=F>>>0,!T){let V=Math.pow(2,8*F)-1;EU(this,I,O,F,V,0)}let H=1,E=0;this[O]=I&255;while(++E<F&&(H*=256))this[O+E]=I/H&255;return O+F};$0.prototype.writeUintBE=$0.prototype.writeUIntBE=function(I,O,F,T){if(I=+I,O=O>>>0,F=F>>>0,!T){let V=Math.pow(2,8*F)-1;EU(this,I,O,F,V,0)}let H=F-1,E=1;this[O+H]=I&255;while(--H>=0&&(E*=256))this[O+H]=I/E&255;return O+F};$0.prototype.writeUint8=$0.prototype.writeUInt8=function(I,O,F){if(I=+I,O=O>>>0,!F)EU(this,I,O,1,255,0);return this[O]=I&255,O+1};$0.prototype.writeUint16LE=$0.prototype.writeUInt16LE=function(I,O,F){if(I=+I,O=O>>>0,!F)EU(this,I,O,2,65535,0);return this[O]=I&255,this[O+1]=I>>>8,O+2};$0.prototype.writeUint16BE=$0.prototype.writeUInt16BE=function(I,O,F){if(I=+I,O=O>>>0,!F)EU(this,I,O,2,65535,0);return this[O]=I>>>8,this[O+1]=I&255,O+2};$0.prototype.writeUint32LE=$0.prototype.writeUInt32LE=function(I,O,F){if(I=+I,O=O>>>0,!F)EU(this,I,O,4,4294967295,0);return this[O+3]=I>>>24,this[O+2]=I>>>16,this[O+1]=I>>>8,this[O]=I&255,O+4};$0.prototype.writeUint32BE=$0.prototype.writeUInt32BE=function(I,O,F){if(I=+I,O=O>>>0,!F)EU(this,I,O,4,4294967295,0);return this[O]=I>>>24,this[O+1]=I>>>16,this[O+2]=I>>>8,this[O+3]=I&255,O+4};$0.prototype.writeBigUInt64LE=wU(function(I,O=0){return qZ(this,I,O,BigInt(0),BigInt("0xffffffffffffffff"))});$0.prototype.writeBigUInt64BE=wU(function(I,O=0){return PZ(this,I,O,BigInt(0),BigInt("0xffffffffffffffff"))});$0.prototype.writeIntLE=function(I,O,F,T){if(I=+I,O=O>>>0,!T){let P=Math.pow(2,8*F-1);EU(this,I,O,F,P-1,-P)}let H=0,E=1,V=0;this[O]=I&255;while(++H<F&&(E*=256)){if(I<0&&V===0&&this[O+H-1]!==0)V=1;this[O+H]=(I/E>>0)-V&255}return O+F};$0.prototype.writeIntBE=function(I,O,F,T){if(I=+I,O=O>>>0,!T){let P=Math.pow(2,8*F-1);EU(this,I,O,F,P-1,-P)}let H=F-1,E=1,V=0;this[O+H]=I&255;while(--H>=0&&(E*=256)){if(I<0&&V===0&&this[O+H+1]!==0)V=1;this[O+H]=(I/E>>0)-V&255}return O+F};$0.prototype.writeInt8=function(I,O,F){if(I=+I,O=O>>>0,!F)EU(this,I,O,1,127,-128);if(I<0)I=255+I+1;return this[O]=I&255,O+1};$0.prototype.writeInt16LE=function(I,O,F){if(I=+I,O=O>>>0,!F)EU(this,I,O,2,32767,-32768);return this[O]=I&255,this[O+1]=I>>>8,O+2};$0.prototype.writeInt16BE=function(I,O,F){if(I=+I,O=O>>>0,!F)EU(this,I,O,2,32767,-32768);return this[O]=I>>>8,this[O+1]=I&255,O+2};$0.prototype.writeInt32LE=function(I,O,F){if(I=+I,O=O>>>0,!F)EU(this,I,O,4,2147483647,-2147483648);return this[O]=I&255,this[O+1]=I>>>8,this[O+2]=I>>>16,this[O+3]=I>>>24,O+4};$0.prototype.writeInt32BE=function(I,O,F){if(I=+I,O=O>>>0,!F)EU(this,I,O,4,2147483647,-2147483648);if(I<0)I=4294967295+I+1;return this[O]=I>>>24,this[O+1]=I>>>16,this[O+2]=I>>>8,this[O+3]=I&255,O+4};$0.prototype.writeBigInt64LE=wU(function(I,O=0){return qZ(this,I,O,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});$0.prototype.writeBigInt64BE=wU(function(I,O=0){return PZ(this,I,O,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});$0.prototype.writeFloatLE=function(I,O,F){return jZ(this,I,O,!0,F)};$0.prototype.writeFloatBE=function(I,O,F){return jZ(this,I,O,!1,F)};$0.prototype.writeDoubleLE=function(I,O,F){return vZ(this,I,O,!0,F)};$0.prototype.writeDoubleBE=function(I,O,F){return vZ(this,I,O,!1,F)};$0.prototype.copy=function(I,O,F,T){if(!$0.isBuffer(I))throw TypeError("argument should be a Buffer");if(!F)F=0;if(!T&&T!==0)T=this.length;if(O>=I.length)O=I.length;if(!O)O=0;if(T>0&&T<F)T=F;if(T===F)return 0;if(I.length===0||this.length===0)return 0;if(O<0)throw RangeError("targetStart out of bounds");if(F<0||F>=this.length)throw RangeError("Index out of range");if(T<0)throw RangeError("sourceEnd out of bounds");if(T>this.length)T=this.length;if(I.length-O<T-F)T=I.length-O+F;let H=T-F;if(this===I&&typeof Uint8Array.prototype.copyWithin==="function")this.copyWithin(O,F,T);else Uint8Array.prototype.set.call(I,this.subarray(F,T),O);return H};$0.prototype.fill=function(I,O,F,T){if(typeof I==="string"){if(typeof O==="string")T=O,O=0,F=this.length;else if(typeof F==="string")T=F,F=this.length;if(T!==void 0&&typeof T!=="string")throw TypeError("encoding must be a string");if(typeof T==="string"&&!$0.isEncoding(T))throw TypeError("Unknown encoding: "+T);if(I.length===1){let E=I.charCodeAt(0);if(T==="utf8"&&E<128||T==="latin1")I=E}}else if(typeof I==="number")I=I&255;else if(typeof I==="boolean")I=Number(I);if(O<0||this.length<O||this.length<F)throw RangeError("Out of range index");if(F<=O)return this;if(O=O>>>0,F=F===void 0?this.length:F>>>0,!I)I=0;let H;if(typeof I==="number")for(H=O;H<F;++H)this[H]=I;else{let E=$0.isBuffer(I)?I:$0.from(I,T),V=E.length;if(V===0)throw TypeError('The value "'+I+'" is invalid for argument "value"');for(H=0;H<F-O;++H)this[H+O]=E[H%V]}return this};AY=/[^+/0-9A-Za-z-_]/g;LY=function(){let I=Array(256);for(let O=0;O<16;++O){let F=O*16;for(let T=0;T<16;++T)I[F+T]="0123456789abcdef"[O]+"0123456789abcdef"[T]}return I}();MY=cX("resolveObjectURL"),SY=cX("isUtf8"),qY=cX("transcode"),PY=$0});var uZ={};$X(uZ,{types:()=>yY,promisify:()=>fZ,log:()=>gZ,isUndefined:()=>nU,isSymbol:()=>cY,isString:()=>DX,isRegExp:()=>FX,isPrimitive:()=>pY,isObject:()=>mU,isNumber:()=>NZ,isNullOrUndefined:()=>fY,isNull:()=>TX,isFunction:()=>CX,isError:()=>HX,isDate:()=>bX,isBuffer:()=>hY,isBoolean:()=>dX,isArray:()=>xZ,inspect:()=>uU,inherits:()=>wZ,format:()=>lX,deprecate:()=>jY,default:()=>lY,debuglog:()=>vY,callbackifyOnRejected:()=>mX,callbackify:()=>cZ,_extend:()=>nX,TextEncoder:()=>pZ,TextDecoder:()=>hZ});function lX(I,...O){if(!DX(I)){var F=[I];for(var T=0;T<O.length;T++)F.push(uU(O[T]));return F.join(" ")}var T=0,H=O.length,E=String(I).replace(kY,function(P){if(P==="%%")return"%";if(T>=H)return P;switch(P){case"%s":return String(O[T++]);case"%d":return Number(O[T++]);case"%j":try{return JSON.stringify(O[T++])}catch(q){return"[Circular]"}default:return P}});for(var V=O[T];T<H;V=O[++T])if(TX(V)||!mU(V))E+=" "+V;else E+=" "+uU(V);return E}function jY(I,O){if(typeof process>"u"||process?.noDeprecation===!0)return I;var F=!1;function T(...H){if(!F){if(process.throwDeprecation)throw Error(O);else if(process.traceDeprecation)console.trace(O);else console.error(O);F=!0}return I.apply(this,...H)}return T}function _Y(I,O){var F=uU.styles[O];if(F)return"\x1B["+uU.colors[F][0]+"m"+I+"\x1B["+uU.colors[F][1]+"m";else return I}function BY(I,O){return I}function xY(I){var O={};return I.forEach(function(F,T){O[F]=!0}),O}function AX(I,O,F){if(I.customInspect&&O&&CX(O.inspect)&&O.inspect!==uU&&!(O.constructor&&O.constructor.prototype===O)){var T=O.inspect(F,I);if(!DX(T))T=AX(I,T,F);return T}var H=NY(I,O);if(H)return H;var E=Object.keys(O),V=xY(E);if(I.showHidden)E=Object.getOwnPropertyNames(O);if(HX(O)&&(E.indexOf("message")>=0||E.indexOf("description")>=0))return pX(O);if(E.length===0){if(CX(O)){var P=O.name?": "+O.name:"";return I.stylize("[Function"+P+"]","special")}if(FX(O))return I.stylize(RegExp.prototype.toString.call(O),"regexp");if(bX(O))return I.stylize(Date.prototype.toString.call(O),"date");if(HX(O))return pX(O)}var q="",L=!1,z=["{","}"];if(xZ(O))L=!0,z=["[","]"];if(CX(O)){var C=O.name?": "+O.name:"";q=" [Function"+C+"]"}if(FX(O))q=" "+RegExp.prototype.toString.call(O);if(bX(O))q=" "+Date.prototype.toUTCString.call(O);if(HX(O))q=" "+pX(O);if(E.length===0&&(!L||O.length==0))return z[0]+q+z[1];if(F<0)if(FX(O))return I.stylize(RegExp.prototype.toString.call(O),"regexp");else return I.stylize("[Object]","special");I.seen.push(O);var D;if(L)D=gY(I,O,F,V,E);else D=E.map(function(S){return uX(I,O,F,V,S,L)});return I.seen.pop(),wY(D,q,z)}function NY(I,O){if(nU(O))return I.stylize("undefined","undefined");if(DX(O)){var F="'"+JSON.stringify(O).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return I.stylize(F,"string")}if(NZ(O))return I.stylize(""+O,"number");if(dX(O))return I.stylize(""+O,"boolean");if(TX(O))return I.stylize("null","null")}function pX(I){return"["+Error.prototype.toString.call(I)+"]"}function gY(I,O,F,T,H){var E=[];for(var V=0,P=O.length;V<P;++V)if(yZ(O,String(V)))E.push(uX(I,O,F,T,String(V),!0));else E.push("");return H.forEach(function(q){if(!q.match(/^\d+$/))E.push(uX(I,O,F,T,q,!0))}),E}function uX(I,O,F,T,H,E){var V,P,q;if(q=Object.getOwnPropertyDescriptor(O,H)||{value:O[H]},q.get)if(q.set)P=I.stylize("[Getter/Setter]","special");else P=I.stylize("[Getter]","special");else if(q.set)P=I.stylize("[Setter]","special");if(!yZ(T,H))V="["+H+"]";if(!P)if(I.seen.indexOf(q.value)<0){if(TX(F))P=AX(I,q.value,null);else P=AX(I,q.value,F-1);if(P.indexOf(`
|
|
1
|
+
import{a as h0,b as iY,c as $X,e as KX,f as GJ}from"./chunk-s9w2hb4g.js";var FU={};$X(FU,{transcode:()=>qY,resolveObjectURL:()=>MY,kStringMaxLength:()=>zZ,kMaxLength:()=>rU,isUtf8:()=>SY,isAscii:()=>RY,default:()=>PY,constants:()=>rQ,btoa:()=>nQ,atob:()=>mQ,INSPECT_MAX_BYTES:()=>DZ,File:()=>sQ,Buffer:()=>$0,Blob:()=>tQ});function uQ(I){var O=I.length;if(O%4>0)throw Error("Invalid string. Length must be a multiple of 4");var F=I.indexOf("=");if(F===-1)F=O;var T=F===O?0:4-F%4;return[F,T]}function bQ(I,O){return(I+O)*3/4-O}function lQ(I){var O,F=uQ(I),T=F[0],H=F[1],E=new Uint8Array(bQ(T,H)),V=0,P=H>0?T-4:T,q;for(q=0;q<P;q+=4)O=PU[I.charCodeAt(q)]<<18|PU[I.charCodeAt(q+1)]<<12|PU[I.charCodeAt(q+2)]<<6|PU[I.charCodeAt(q+3)],E[V++]=O>>16&255,E[V++]=O>>8&255,E[V++]=O&255;if(H===2)O=PU[I.charCodeAt(q)]<<2|PU[I.charCodeAt(q+1)]>>4,E[V++]=O&255;if(H===1)O=PU[I.charCodeAt(q)]<<10|PU[I.charCodeAt(q+1)]<<4|PU[I.charCodeAt(q+2)]>>2,E[V++]=O>>8&255,E[V++]=O&255;return E}function dQ(I){return jU[I>>18&63]+jU[I>>12&63]+jU[I>>6&63]+jU[I&63]}function oQ(I,O,F){var T,H=[];for(var E=O;E<F;E+=3)T=(I[E]<<16&16711680)+(I[E+1]<<8&65280)+(I[E+2]&255),H.push(dQ(T));return H.join("")}function WZ(I){var O,F=I.length,T=F%3,H=[],E=16383;for(var V=0,P=F-T;V<P;V+=E)H.push(oQ(I,V,V+E>P?P:V+E));if(T===1)O=I[F-1],H.push(jU[O>>2]+jU[O<<4&63]+"==");else if(T===2)O=(I[F-2]<<8)+I[F-1],H.push(jU[O>>10]+jU[O>>4&63]+jU[O<<2&63]+"=");return H.join("")}function OX(I,O,F,T,H){var E,V,P=H*8-T-1,q=(1<<P)-1,L=q>>1,z=-7,C=F?H-1:0,D=F?-1:1,S=I[O+C];C+=D,E=S&(1<<-z)-1,S>>=-z,z+=P;for(;z>0;E=E*256+I[O+C],C+=D,z-=8);V=E&(1<<-z)-1,E>>=-z,z+=T;for(;z>0;V=V*256+I[O+C],C+=D,z-=8);if(E===0)E=1-L;else if(E===q)return V?NaN:(S?-1:1)*(1/0);else V=V+Math.pow(2,T),E=E-L;return(S?-1:1)*V*Math.pow(2,E-T)}function TZ(I,O,F,T,H,E){var V,P,q,L=E*8-H-1,z=(1<<L)-1,C=z>>1,D=H===23?Math.pow(2,-24)-Math.pow(2,-77):0,S=T?0:E-1,R=T?1:-1,v=O<0||O===0&&1/O<0?1:0;if(O=Math.abs(O),isNaN(O)||O===1/0)P=isNaN(O)?1:0,V=z;else{if(V=Math.floor(Math.log(O)/Math.LN2),O*(q=Math.pow(2,-V))<1)V--,q*=2;if(V+C>=1)O+=D/q;else O+=D*Math.pow(2,1-C);if(O*q>=2)V++,q/=2;if(V+C>=z)P=0,V=z;else if(V+C>=1)P=(O*q-1)*Math.pow(2,H),V=V+C;else P=O*Math.pow(2,C-1)*Math.pow(2,H),V=0}for(;H>=8;I[F+S]=P&255,S+=R,P/=256,H-=8);V=V<<H|P,L+=H;for(;L>0;I[F+S]=V&255,S+=R,V/=256,L-=8);I[F+S-R]|=v*128}function BU(I){if(I>rU)throw RangeError('The value "'+I+'" is invalid for option "size"');let O=new Uint8Array(I);return Object.setPrototypeOf(O,$0.prototype),O}function wX(I,O,F){return class extends F{constructor(){super();Object.defineProperty(this,"message",{value:O.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${I}]`,this.stack,delete this.name}get code(){return I}set code(T){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:T,writable:!0})}toString(){return`${this.name} [${I}]: ${this.message}`}}}function $0(I,O,F){if(typeof I==="number"){if(typeof O==="string")throw TypeError('The "string" argument must be of type string. Received type number');return yX(I)}return LZ(I,O,F)}function LZ(I,O,F){if(typeof I==="string")return UY(I,O);if(ArrayBuffer.isView(I))return XY(I);if(I==null)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof I);if(vU(I,ArrayBuffer)||I&&vU(I.buffer,ArrayBuffer))return NX(I,O,F);if(typeof SharedArrayBuffer<"u"&&(vU(I,SharedArrayBuffer)||I&&vU(I.buffer,SharedArrayBuffer)))return NX(I,O,F);if(typeof I==="number")throw TypeError('The "value" argument must not be of type number. Received type number');let T=I.valueOf&&I.valueOf();if(T!=null&&T!==I)return $0.from(T,O,F);let H=ZY(I);if(H)return H;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof I[Symbol.toPrimitive]==="function")return $0.from(I[Symbol.toPrimitive]("string"),O,F);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof I)}function EZ(I){if(typeof I!=="number")throw TypeError('"size" argument must be of type number');else if(I<0)throw RangeError('The value "'+I+'" is invalid for option "size"')}function iQ(I,O,F){if(EZ(I),I<=0)return BU(I);if(O!==void 0)return typeof F==="string"?BU(I).fill(O,F):BU(I).fill(O);return BU(I)}function yX(I){return EZ(I),BU(I<0?0:fX(I)|0)}function UY(I,O){if(typeof O!=="string"||O==="")O="utf8";if(!$0.isEncoding(O))throw TypeError("Unknown encoding: "+O);let F=MZ(I,O)|0,T=BU(F),H=T.write(I,O);if(H!==F)T=T.slice(0,H);return T}function xX(I){let O=I.length<0?0:fX(I.length)|0,F=BU(O);for(let T=0;T<O;T+=1)F[T]=I[T]&255;return F}function XY(I){if(vU(I,Uint8Array)){let O=new Uint8Array(I);return NX(O.buffer,O.byteOffset,O.byteLength)}return xX(I)}function NX(I,O,F){if(O<0||I.byteLength<O)throw RangeError('"offset" is outside of buffer bounds');if(I.byteLength<O+(F||0))throw RangeError('"length" is outside of buffer bounds');let T;if(O===void 0&&F===void 0)T=new Uint8Array(I);else if(F===void 0)T=new Uint8Array(I,O);else T=new Uint8Array(I,O,F);return Object.setPrototypeOf(T,$0.prototype),T}function ZY(I){if($0.isBuffer(I)){let O=fX(I.length)|0,F=BU(O);if(F.length===0)return F;return I.copy(F,0,0,O),F}if(I.length!==void 0){if(typeof I.length!=="number"||Number.isNaN(I.length))return BU(0);return xX(I)}if(I.type==="Buffer"&&Array.isArray(I.data))return xX(I.data)}function fX(I){if(I>=rU)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+rU.toString(16)+" bytes");return I|0}function MZ(I,O){if($0.isBuffer(I))return I.length;if(ArrayBuffer.isView(I)||vU(I,ArrayBuffer))return I.byteLength;if(typeof I!=="string")throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof I);let F=I.length,T=arguments.length>2&&arguments[2]===!0;if(!T&&F===0)return 0;let H=!1;for(;;)switch(O){case"ascii":case"latin1":case"binary":return F;case"utf8":case"utf-8":return gX(I).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return F*2;case"hex":return F>>>1;case"base64":return BZ(I).length;default:if(H)return T?-1:gX(I).length;O=(""+O).toLowerCase(),H=!0}}function QY(I,O,F){let T=!1;if(O===void 0||O<0)O=0;if(O>this.length)return"";if(F===void 0||F>this.length)F=this.length;if(F<=0)return"";if(F>>>=0,O>>>=0,F<=O)return"";if(!I)I="utf8";while(!0)switch(I){case"hex":return FY(this,O,F);case"utf8":case"utf-8":return RZ(this,O,F);case"ascii":return OY(this,O,F);case"latin1":case"binary":return WY(this,O,F);case"base64":return $Y(this,O,F);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return HY(this,O,F);default:if(T)throw TypeError("Unknown encoding: "+I);I=(I+"").toLowerCase(),T=!0}}function hU(I,O,F){let T=I[O];I[O]=I[F],I[F]=T}function SZ(I,O,F,T,H){if(I.length===0)return-1;if(typeof F==="string")T=F,F=0;else if(F>2147483647)F=2147483647;else if(F<-2147483648)F=-2147483648;if(F=+F,Number.isNaN(F))F=H?0:I.length-1;if(F<0)F=I.length+F;if(F>=I.length)if(H)return-1;else F=I.length-1;else if(F<0)if(H)F=0;else return-1;if(typeof O==="string")O=$0.from(O,T);if($0.isBuffer(O)){if(O.length===0)return-1;return HZ(I,O,F,T,H)}else if(typeof O==="number"){if(O=O&255,typeof Uint8Array.prototype.indexOf==="function")if(H)return Uint8Array.prototype.indexOf.call(I,O,F);else return Uint8Array.prototype.lastIndexOf.call(I,O,F);return HZ(I,[O],F,T,H)}throw TypeError("val must be string, number or Buffer")}function HZ(I,O,F,T,H){let E=1,V=I.length,P=O.length;if(T!==void 0){if(T=String(T).toLowerCase(),T==="ucs2"||T==="ucs-2"||T==="utf16le"||T==="utf-16le"){if(I.length<2||O.length<2)return-1;E=2,V/=2,P/=2,F/=2}}function q(z,C){if(E===1)return z[C];else return z.readUInt16BE(C*E)}let L;if(H){let z=-1;for(L=F;L<V;L++)if(q(I,L)===q(O,z===-1?0:L-z)){if(z===-1)z=L;if(L-z+1===P)return z*E}else{if(z!==-1)L-=L-z;z=-1}}else{if(F+P>V)F=V-P;for(L=F;L>=0;L--){let z=!0;for(let C=0;C<P;C++)if(q(I,L+C)!==q(O,C)){z=!1;break}if(z)return L}}return-1}function YY(I,O,F,T){F=Number(F)||0;let H=I.length-F;if(!T)T=H;else if(T=Number(T),T>H)T=H;let E=O.length;if(T>E/2)T=E/2;let V;for(V=0;V<T;++V){let P=parseInt(O.substr(V*2,2),16);if(Number.isNaN(P))return V;I[F+V]=P}return V}function JY(I,O,F,T){return WX(gX(O,I.length-F),I,F,T)}function VY(I,O,F,T){return WX(DY(O),I,F,T)}function GY(I,O,F,T){return WX(BZ(O),I,F,T)}function IY(I,O,F,T){return WX(zY(O,I.length-F),I,F,T)}function $Y(I,O,F){if(O===0&&F===I.length)return WZ(I);else return WZ(I.slice(O,F))}function RZ(I,O,F){F=Math.min(I.length,F);let T=[],H=O;while(H<F){let E=I[H],V=null,P=E>239?4:E>223?3:E>191?2:1;if(H+P<=F){let q,L,z,C;switch(P){case 1:if(E<128)V=E;break;case 2:if(q=I[H+1],(q&192)===128){if(C=(E&31)<<6|q&63,C>127)V=C}break;case 3:if(q=I[H+1],L=I[H+2],(q&192)===128&&(L&192)===128){if(C=(E&15)<<12|(q&63)<<6|L&63,C>2047&&(C<55296||C>57343))V=C}break;case 4:if(q=I[H+1],L=I[H+2],z=I[H+3],(q&192)===128&&(L&192)===128&&(z&192)===128){if(C=(E&15)<<18|(q&63)<<12|(L&63)<<6|z&63,C>65535&&C<1114112)V=C}}}if(V===null)V=65533,P=1;else if(V>65535)V-=65536,T.push(V>>>10&1023|55296),V=56320|V&1023;T.push(V),H+=P}return KY(T)}function KY(I){let O=I.length;if(O<=CZ)return String.fromCharCode.apply(String,I);let F="",T=0;while(T<O)F+=String.fromCharCode.apply(String,I.slice(T,T+=CZ));return F}function OY(I,O,F){let T="";F=Math.min(I.length,F);for(let H=O;H<F;++H)T+=String.fromCharCode(I[H]&127);return T}function WY(I,O,F){let T="";F=Math.min(I.length,F);for(let H=O;H<F;++H)T+=String.fromCharCode(I[H]);return T}function FY(I,O,F){let T=I.length;if(!O||O<0)O=0;if(!F||F<0||F>T)F=T;let H="";for(let E=O;E<F;++E)H+=LY[I[E]];return H}function HY(I,O,F){let T=I.slice(O,F),H="";for(let E=0;E<T.length-1;E+=2)H+=String.fromCharCode(T[E]+T[E+1]*256);return H}function WU(I,O,F){if(I%1!==0||I<0)throw RangeError("offset is not uint");if(I+O>F)throw RangeError("Trying to access beyond buffer length")}function EU(I,O,F,T,H,E){if(!$0.isBuffer(I))throw TypeError('"buffer" argument must be a Buffer instance');if(O>H||O<E)throw RangeError('"value" argument is out of bounds');if(F+T>I.length)throw RangeError("Index out of range")}function qZ(I,O,F,T,H){_Z(O,T,H,I,F,7);let E=Number(O&BigInt(4294967295));I[F++]=E,E=E>>8,I[F++]=E,E=E>>8,I[F++]=E,E=E>>8,I[F++]=E;let V=Number(O>>BigInt(32)&BigInt(4294967295));return I[F++]=V,V=V>>8,I[F++]=V,V=V>>8,I[F++]=V,V=V>>8,I[F++]=V,F}function PZ(I,O,F,T,H){_Z(O,T,H,I,F,7);let E=Number(O&BigInt(4294967295));I[F+7]=E,E=E>>8,I[F+6]=E,E=E>>8,I[F+5]=E,E=E>>8,I[F+4]=E;let V=Number(O>>BigInt(32)&BigInt(4294967295));return I[F+3]=V,V=V>>8,I[F+2]=V,V=V>>8,I[F+1]=V,V=V>>8,I[F]=V,F+8}function kZ(I,O,F,T,H,E){if(F+T>I.length)throw RangeError("Index out of range");if(F<0)throw RangeError("Index out of range")}function jZ(I,O,F,T,H){if(O=+O,F=F>>>0,!H)kZ(I,O,F,4,340282346638528860000000000000000000000,-340282346638528860000000000000000000000);return TZ(I,O,F,T,23,4),F+4}function vZ(I,O,F,T,H){if(O=+O,F=F>>>0,!H)kZ(I,O,F,8,179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000,-179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000);return TZ(I,O,F,T,52,8),F+8}function AZ(I){let O="",F=I.length,T=I[0]==="-"?1:0;for(;F>=T+4;F-=3)O=`_${I.slice(F-3,F)}${O}`;return`${I.slice(0,F)}${O}`}function CY(I,O,F){if(oU(O,"offset"),I[O]===void 0||I[O+F]===void 0)aU(O,I.length-(F+1))}function _Z(I,O,F,T,H,E){if(I>F||I<O){let V=typeof O==="bigint"?"n":"",P;if(E>3)if(O===0||O===BigInt(0))P=`>= 0${V} and < 2${V} ** ${(E+1)*8}${V}`;else P=`>= -(2${V} ** ${(E+1)*8-1}${V}) and < 2 ** ${(E+1)*8-1}${V}`;else P=`>= ${O}${V} and <= ${F}${V}`;throw new BX("value",P,I)}CY(T,H,E)}function oU(I,O){if(typeof I!=="number")throw new eQ(O,"number",I)}function aU(I,O,F){if(Math.floor(I)!==I)throw oU(I,F),new BX(F||"offset","an integer",I);if(O<0)throw new aQ;throw new BX(F||"offset",`>= ${F?1:0} and <= ${O}`,I)}function TY(I){if(I=I.split("=")[0],I=I.trim().replace(AY,""),I.length<2)return"";while(I.length%4!==0)I=I+"=";return I}function gX(I,O){O=O||1/0;let F,T=I.length,H=null,E=[];for(let V=0;V<T;++V){if(F=I.charCodeAt(V),F>55295&&F<57344){if(!H){if(F>56319){if((O-=3)>-1)E.push(239,191,189);continue}else if(V+1===T){if((O-=3)>-1)E.push(239,191,189);continue}H=F;continue}if(F<56320){if((O-=3)>-1)E.push(239,191,189);H=F;continue}F=(H-55296<<10|F-56320)+65536}else if(H){if((O-=3)>-1)E.push(239,191,189)}if(H=null,F<128){if((O-=1)<0)break;E.push(F)}else if(F<2048){if((O-=2)<0)break;E.push(F>>6|192,F&63|128)}else if(F<65536){if((O-=3)<0)break;E.push(F>>12|224,F>>6&63|128,F&63|128)}else if(F<1114112){if((O-=4)<0)break;E.push(F>>18|240,F>>12&63|128,F>>6&63|128,F&63|128)}else throw Error("Invalid code point")}return E}function DY(I){let O=[];for(let F=0;F<I.length;++F)O.push(I.charCodeAt(F)&255);return O}function zY(I,O){let F,T,H,E=[];for(let V=0;V<I.length;++V){if((O-=2)<0)break;F=I.charCodeAt(V),T=F>>8,H=F%256,E.push(H),E.push(T)}return E}function BZ(I){return lQ(TY(I))}function WX(I,O,F,T){let H;for(H=0;H<T;++H){if(H+F>=O.length||H>=I.length)break;O[H+F]=I[H]}return H}function vU(I,O){return I instanceof O||I!=null&&I.constructor!=null&&I.constructor.name!=null&&I.constructor.name===O.name}function wU(I){return typeof BigInt>"u"?EY:I}function EY(){throw Error("BigInt not supported")}function cX(I){return()=>{throw Error(I+" is not implemented for node:buffer browser polyfill")}}var jU,PU,_X="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",pU,OZ,FZ,DZ=50,rU=2147483647,zZ=536870888,nQ,mQ,sQ,tQ,rQ,aQ,eQ,BX,CZ=4096,AY,LY,MY,SY,RY=(I)=>{for(let O of I)if(O.charCodeAt(0)>127)return!1;return!0},qY,PY;var HU=KX(()=>{jU=[],PU=[];for(pU=0,OZ=_X.length;pU<OZ;++pU)jU[pU]=_X[pU],PU[_X.charCodeAt(pU)]=pU;PU[45]=62;PU[95]=63;FZ=typeof Symbol==="function"&&typeof Symbol.for==="function"?Symbol.for("nodejs.util.inspect.custom"):null,nQ=globalThis.btoa,mQ=globalThis.atob,sQ=globalThis.File,tQ=globalThis.Blob,rQ={MAX_LENGTH:rU,MAX_STRING_LENGTH:zZ};aQ=wX("ERR_BUFFER_OUT_OF_BOUNDS",function(I){if(I)return`${I} is outside of buffer bounds`;return"Attempt to access memory outside buffer bounds"},RangeError),eQ=wX("ERR_INVALID_ARG_TYPE",function(I,O){return`The "${I}" argument must be of type number. Received type ${typeof O}`},TypeError),BX=wX("ERR_OUT_OF_RANGE",function(I,O,F){let T=`The value of "${I}" is out of range.`,H=F;if(Number.isInteger(F)&&Math.abs(F)>4294967296)H=AZ(String(F));else if(typeof F==="bigint"){if(H=String(F),F>BigInt(2)**BigInt(32)||F<-(BigInt(2)**BigInt(32)))H=AZ(H);H+="n"}return T+=` It must be ${O}. Received ${H}`,T},RangeError);Object.defineProperty($0.prototype,"parent",{enumerable:!0,get:function(){if(!$0.isBuffer(this))return;return this.buffer}});Object.defineProperty($0.prototype,"offset",{enumerable:!0,get:function(){if(!$0.isBuffer(this))return;return this.byteOffset}});$0.poolSize=8192;$0.from=function(I,O,F){return LZ(I,O,F)};Object.setPrototypeOf($0.prototype,Uint8Array.prototype);Object.setPrototypeOf($0,Uint8Array);$0.alloc=function(I,O,F){return iQ(I,O,F)};$0.allocUnsafe=function(I){return yX(I)};$0.allocUnsafeSlow=function(I){return yX(I)};$0.isBuffer=function(I){return I!=null&&I._isBuffer===!0&&I!==$0.prototype};$0.compare=function(I,O){if(vU(I,Uint8Array))I=$0.from(I,I.offset,I.byteLength);if(vU(O,Uint8Array))O=$0.from(O,O.offset,O.byteLength);if(!$0.isBuffer(I)||!$0.isBuffer(O))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(I===O)return 0;let F=I.length,T=O.length;for(let H=0,E=Math.min(F,T);H<E;++H)if(I[H]!==O[H]){F=I[H],T=O[H];break}if(F<T)return-1;if(T<F)return 1;return 0};$0.isEncoding=function(I){switch(String(I).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};$0.concat=function(I,O){if(!Array.isArray(I))throw TypeError('"list" argument must be an Array of Buffers');if(I.length===0)return $0.alloc(0);let F;if(O===void 0){O=0;for(F=0;F<I.length;++F)O+=I[F].length}let T=$0.allocUnsafe(O),H=0;for(F=0;F<I.length;++F){let E=I[F];if(vU(E,Uint8Array))if(H+E.length>T.length){if(!$0.isBuffer(E))E=$0.from(E);E.copy(T,H)}else Uint8Array.prototype.set.call(T,E,H);else if(!$0.isBuffer(E))throw TypeError('"list" argument must be an Array of Buffers');else E.copy(T,H);H+=E.length}return T};$0.byteLength=MZ;$0.prototype._isBuffer=!0;$0.prototype.swap16=function(){let I=this.length;if(I%2!==0)throw RangeError("Buffer size must be a multiple of 16-bits");for(let O=0;O<I;O+=2)hU(this,O,O+1);return this};$0.prototype.swap32=function(){let I=this.length;if(I%4!==0)throw RangeError("Buffer size must be a multiple of 32-bits");for(let O=0;O<I;O+=4)hU(this,O,O+3),hU(this,O+1,O+2);return this};$0.prototype.swap64=function(){let I=this.length;if(I%8!==0)throw RangeError("Buffer size must be a multiple of 64-bits");for(let O=0;O<I;O+=8)hU(this,O,O+7),hU(this,O+1,O+6),hU(this,O+2,O+5),hU(this,O+3,O+4);return this};$0.prototype.toString=function(){let I=this.length;if(I===0)return"";if(arguments.length===0)return RZ(this,0,I);return QY.apply(this,arguments)};$0.prototype.toLocaleString=$0.prototype.toString;$0.prototype.equals=function(I){if(!$0.isBuffer(I))throw TypeError("Argument must be a Buffer");if(this===I)return!0;return $0.compare(this,I)===0};$0.prototype.inspect=function(){let I="",O=DZ;if(I=this.toString("hex",0,O).replace(/(.{2})/g,"$1 ").trim(),this.length>O)I+=" ... ";return"<Buffer "+I+">"};if(FZ)$0.prototype[FZ]=$0.prototype.inspect;$0.prototype.compare=function(I,O,F,T,H){if(vU(I,Uint8Array))I=$0.from(I,I.offset,I.byteLength);if(!$0.isBuffer(I))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof I);if(O===void 0)O=0;if(F===void 0)F=I?I.length:0;if(T===void 0)T=0;if(H===void 0)H=this.length;if(O<0||F>I.length||T<0||H>this.length)throw RangeError("out of range index");if(T>=H&&O>=F)return 0;if(T>=H)return-1;if(O>=F)return 1;if(O>>>=0,F>>>=0,T>>>=0,H>>>=0,this===I)return 0;let E=H-T,V=F-O,P=Math.min(E,V),q=this.slice(T,H),L=I.slice(O,F);for(let z=0;z<P;++z)if(q[z]!==L[z]){E=q[z],V=L[z];break}if(E<V)return-1;if(V<E)return 1;return 0};$0.prototype.includes=function(I,O,F){return this.indexOf(I,O,F)!==-1};$0.prototype.indexOf=function(I,O,F){return SZ(this,I,O,F,!0)};$0.prototype.lastIndexOf=function(I,O,F){return SZ(this,I,O,F,!1)};$0.prototype.write=function(I,O,F,T){if(O===void 0)T="utf8",F=this.length,O=0;else if(F===void 0&&typeof O==="string")T=O,F=this.length,O=0;else if(isFinite(O))if(O=O>>>0,isFinite(F)){if(F=F>>>0,T===void 0)T="utf8"}else T=F,F=void 0;else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let H=this.length-O;if(F===void 0||F>H)F=H;if(I.length>0&&(F<0||O<0)||O>this.length)throw RangeError("Attempt to write outside buffer bounds");if(!T)T="utf8";let E=!1;for(;;)switch(T){case"hex":return YY(this,I,O,F);case"utf8":case"utf-8":return JY(this,I,O,F);case"ascii":case"latin1":case"binary":return VY(this,I,O,F);case"base64":return GY(this,I,O,F);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return IY(this,I,O,F);default:if(E)throw TypeError("Unknown encoding: "+T);T=(""+T).toLowerCase(),E=!0}};$0.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};$0.prototype.slice=function(I,O){let F=this.length;if(I=~~I,O=O===void 0?F:~~O,I<0){if(I+=F,I<0)I=0}else if(I>F)I=F;if(O<0){if(O+=F,O<0)O=0}else if(O>F)O=F;if(O<I)O=I;let T=this.subarray(I,O);return Object.setPrototypeOf(T,$0.prototype),T};$0.prototype.readUintLE=$0.prototype.readUIntLE=function(I,O,F){if(I=I>>>0,O=O>>>0,!F)WU(I,O,this.length);let T=this[I],H=1,E=0;while(++E<O&&(H*=256))T+=this[I+E]*H;return T};$0.prototype.readUintBE=$0.prototype.readUIntBE=function(I,O,F){if(I=I>>>0,O=O>>>0,!F)WU(I,O,this.length);let T=this[I+--O],H=1;while(O>0&&(H*=256))T+=this[I+--O]*H;return T};$0.prototype.readUint8=$0.prototype.readUInt8=function(I,O){if(I=I>>>0,!O)WU(I,1,this.length);return this[I]};$0.prototype.readUint16LE=$0.prototype.readUInt16LE=function(I,O){if(I=I>>>0,!O)WU(I,2,this.length);return this[I]|this[I+1]<<8};$0.prototype.readUint16BE=$0.prototype.readUInt16BE=function(I,O){if(I=I>>>0,!O)WU(I,2,this.length);return this[I]<<8|this[I+1]};$0.prototype.readUint32LE=$0.prototype.readUInt32LE=function(I,O){if(I=I>>>0,!O)WU(I,4,this.length);return(this[I]|this[I+1]<<8|this[I+2]<<16)+this[I+3]*16777216};$0.prototype.readUint32BE=$0.prototype.readUInt32BE=function(I,O){if(I=I>>>0,!O)WU(I,4,this.length);return this[I]*16777216+(this[I+1]<<16|this[I+2]<<8|this[I+3])};$0.prototype.readBigUInt64LE=wU(function(I){I=I>>>0,oU(I,"offset");let O=this[I],F=this[I+7];if(O===void 0||F===void 0)aU(I,this.length-8);let T=O+this[++I]*256+this[++I]*65536+this[++I]*16777216,H=this[++I]+this[++I]*256+this[++I]*65536+F*16777216;return BigInt(T)+(BigInt(H)<<BigInt(32))});$0.prototype.readBigUInt64BE=wU(function(I){I=I>>>0,oU(I,"offset");let O=this[I],F=this[I+7];if(O===void 0||F===void 0)aU(I,this.length-8);let T=O*16777216+this[++I]*65536+this[++I]*256+this[++I],H=this[++I]*16777216+this[++I]*65536+this[++I]*256+F;return(BigInt(T)<<BigInt(32))+BigInt(H)});$0.prototype.readIntLE=function(I,O,F){if(I=I>>>0,O=O>>>0,!F)WU(I,O,this.length);let T=this[I],H=1,E=0;while(++E<O&&(H*=256))T+=this[I+E]*H;if(H*=128,T>=H)T-=Math.pow(2,8*O);return T};$0.prototype.readIntBE=function(I,O,F){if(I=I>>>0,O=O>>>0,!F)WU(I,O,this.length);let T=O,H=1,E=this[I+--T];while(T>0&&(H*=256))E+=this[I+--T]*H;if(H*=128,E>=H)E-=Math.pow(2,8*O);return E};$0.prototype.readInt8=function(I,O){if(I=I>>>0,!O)WU(I,1,this.length);if(!(this[I]&128))return this[I];return(255-this[I]+1)*-1};$0.prototype.readInt16LE=function(I,O){if(I=I>>>0,!O)WU(I,2,this.length);let F=this[I]|this[I+1]<<8;return F&32768?F|4294901760:F};$0.prototype.readInt16BE=function(I,O){if(I=I>>>0,!O)WU(I,2,this.length);let F=this[I+1]|this[I]<<8;return F&32768?F|4294901760:F};$0.prototype.readInt32LE=function(I,O){if(I=I>>>0,!O)WU(I,4,this.length);return this[I]|this[I+1]<<8|this[I+2]<<16|this[I+3]<<24};$0.prototype.readInt32BE=function(I,O){if(I=I>>>0,!O)WU(I,4,this.length);return this[I]<<24|this[I+1]<<16|this[I+2]<<8|this[I+3]};$0.prototype.readBigInt64LE=wU(function(I){I=I>>>0,oU(I,"offset");let O=this[I],F=this[I+7];if(O===void 0||F===void 0)aU(I,this.length-8);let T=this[I+4]+this[I+5]*256+this[I+6]*65536+(F<<24);return(BigInt(T)<<BigInt(32))+BigInt(O+this[++I]*256+this[++I]*65536+this[++I]*16777216)});$0.prototype.readBigInt64BE=wU(function(I){I=I>>>0,oU(I,"offset");let O=this[I],F=this[I+7];if(O===void 0||F===void 0)aU(I,this.length-8);let T=(O<<24)+this[++I]*65536+this[++I]*256+this[++I];return(BigInt(T)<<BigInt(32))+BigInt(this[++I]*16777216+this[++I]*65536+this[++I]*256+F)});$0.prototype.readFloatLE=function(I,O){if(I=I>>>0,!O)WU(I,4,this.length);return OX(this,I,!0,23,4)};$0.prototype.readFloatBE=function(I,O){if(I=I>>>0,!O)WU(I,4,this.length);return OX(this,I,!1,23,4)};$0.prototype.readDoubleLE=function(I,O){if(I=I>>>0,!O)WU(I,8,this.length);return OX(this,I,!0,52,8)};$0.prototype.readDoubleBE=function(I,O){if(I=I>>>0,!O)WU(I,8,this.length);return OX(this,I,!1,52,8)};$0.prototype.writeUintLE=$0.prototype.writeUIntLE=function(I,O,F,T){if(I=+I,O=O>>>0,F=F>>>0,!T){let V=Math.pow(2,8*F)-1;EU(this,I,O,F,V,0)}let H=1,E=0;this[O]=I&255;while(++E<F&&(H*=256))this[O+E]=I/H&255;return O+F};$0.prototype.writeUintBE=$0.prototype.writeUIntBE=function(I,O,F,T){if(I=+I,O=O>>>0,F=F>>>0,!T){let V=Math.pow(2,8*F)-1;EU(this,I,O,F,V,0)}let H=F-1,E=1;this[O+H]=I&255;while(--H>=0&&(E*=256))this[O+H]=I/E&255;return O+F};$0.prototype.writeUint8=$0.prototype.writeUInt8=function(I,O,F){if(I=+I,O=O>>>0,!F)EU(this,I,O,1,255,0);return this[O]=I&255,O+1};$0.prototype.writeUint16LE=$0.prototype.writeUInt16LE=function(I,O,F){if(I=+I,O=O>>>0,!F)EU(this,I,O,2,65535,0);return this[O]=I&255,this[O+1]=I>>>8,O+2};$0.prototype.writeUint16BE=$0.prototype.writeUInt16BE=function(I,O,F){if(I=+I,O=O>>>0,!F)EU(this,I,O,2,65535,0);return this[O]=I>>>8,this[O+1]=I&255,O+2};$0.prototype.writeUint32LE=$0.prototype.writeUInt32LE=function(I,O,F){if(I=+I,O=O>>>0,!F)EU(this,I,O,4,4294967295,0);return this[O+3]=I>>>24,this[O+2]=I>>>16,this[O+1]=I>>>8,this[O]=I&255,O+4};$0.prototype.writeUint32BE=$0.prototype.writeUInt32BE=function(I,O,F){if(I=+I,O=O>>>0,!F)EU(this,I,O,4,4294967295,0);return this[O]=I>>>24,this[O+1]=I>>>16,this[O+2]=I>>>8,this[O+3]=I&255,O+4};$0.prototype.writeBigUInt64LE=wU(function(I,O=0){return qZ(this,I,O,BigInt(0),BigInt("0xffffffffffffffff"))});$0.prototype.writeBigUInt64BE=wU(function(I,O=0){return PZ(this,I,O,BigInt(0),BigInt("0xffffffffffffffff"))});$0.prototype.writeIntLE=function(I,O,F,T){if(I=+I,O=O>>>0,!T){let P=Math.pow(2,8*F-1);EU(this,I,O,F,P-1,-P)}let H=0,E=1,V=0;this[O]=I&255;while(++H<F&&(E*=256)){if(I<0&&V===0&&this[O+H-1]!==0)V=1;this[O+H]=(I/E>>0)-V&255}return O+F};$0.prototype.writeIntBE=function(I,O,F,T){if(I=+I,O=O>>>0,!T){let P=Math.pow(2,8*F-1);EU(this,I,O,F,P-1,-P)}let H=F-1,E=1,V=0;this[O+H]=I&255;while(--H>=0&&(E*=256)){if(I<0&&V===0&&this[O+H+1]!==0)V=1;this[O+H]=(I/E>>0)-V&255}return O+F};$0.prototype.writeInt8=function(I,O,F){if(I=+I,O=O>>>0,!F)EU(this,I,O,1,127,-128);if(I<0)I=255+I+1;return this[O]=I&255,O+1};$0.prototype.writeInt16LE=function(I,O,F){if(I=+I,O=O>>>0,!F)EU(this,I,O,2,32767,-32768);return this[O]=I&255,this[O+1]=I>>>8,O+2};$0.prototype.writeInt16BE=function(I,O,F){if(I=+I,O=O>>>0,!F)EU(this,I,O,2,32767,-32768);return this[O]=I>>>8,this[O+1]=I&255,O+2};$0.prototype.writeInt32LE=function(I,O,F){if(I=+I,O=O>>>0,!F)EU(this,I,O,4,2147483647,-2147483648);return this[O]=I&255,this[O+1]=I>>>8,this[O+2]=I>>>16,this[O+3]=I>>>24,O+4};$0.prototype.writeInt32BE=function(I,O,F){if(I=+I,O=O>>>0,!F)EU(this,I,O,4,2147483647,-2147483648);if(I<0)I=4294967295+I+1;return this[O]=I>>>24,this[O+1]=I>>>16,this[O+2]=I>>>8,this[O+3]=I&255,O+4};$0.prototype.writeBigInt64LE=wU(function(I,O=0){return qZ(this,I,O,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});$0.prototype.writeBigInt64BE=wU(function(I,O=0){return PZ(this,I,O,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});$0.prototype.writeFloatLE=function(I,O,F){return jZ(this,I,O,!0,F)};$0.prototype.writeFloatBE=function(I,O,F){return jZ(this,I,O,!1,F)};$0.prototype.writeDoubleLE=function(I,O,F){return vZ(this,I,O,!0,F)};$0.prototype.writeDoubleBE=function(I,O,F){return vZ(this,I,O,!1,F)};$0.prototype.copy=function(I,O,F,T){if(!$0.isBuffer(I))throw TypeError("argument should be a Buffer");if(!F)F=0;if(!T&&T!==0)T=this.length;if(O>=I.length)O=I.length;if(!O)O=0;if(T>0&&T<F)T=F;if(T===F)return 0;if(I.length===0||this.length===0)return 0;if(O<0)throw RangeError("targetStart out of bounds");if(F<0||F>=this.length)throw RangeError("Index out of range");if(T<0)throw RangeError("sourceEnd out of bounds");if(T>this.length)T=this.length;if(I.length-O<T-F)T=I.length-O+F;let H=T-F;if(this===I&&typeof Uint8Array.prototype.copyWithin==="function")this.copyWithin(O,F,T);else Uint8Array.prototype.set.call(I,this.subarray(F,T),O);return H};$0.prototype.fill=function(I,O,F,T){if(typeof I==="string"){if(typeof O==="string")T=O,O=0,F=this.length;else if(typeof F==="string")T=F,F=this.length;if(T!==void 0&&typeof T!=="string")throw TypeError("encoding must be a string");if(typeof T==="string"&&!$0.isEncoding(T))throw TypeError("Unknown encoding: "+T);if(I.length===1){let E=I.charCodeAt(0);if(T==="utf8"&&E<128||T==="latin1")I=E}}else if(typeof I==="number")I=I&255;else if(typeof I==="boolean")I=Number(I);if(O<0||this.length<O||this.length<F)throw RangeError("Out of range index");if(F<=O)return this;if(O=O>>>0,F=F===void 0?this.length:F>>>0,!I)I=0;let H;if(typeof I==="number")for(H=O;H<F;++H)this[H]=I;else{let E=$0.isBuffer(I)?I:$0.from(I,T),V=E.length;if(V===0)throw TypeError('The value "'+I+'" is invalid for argument "value"');for(H=0;H<F-O;++H)this[H+O]=E[H%V]}return this};AY=/[^+/0-9A-Za-z-_]/g;LY=function(){let I=Array(256);for(let O=0;O<16;++O){let F=O*16;for(let T=0;T<16;++T)I[F+T]="0123456789abcdef"[O]+"0123456789abcdef"[T]}return I}();MY=cX("resolveObjectURL"),SY=cX("isUtf8"),qY=cX("transcode"),PY=$0});var uZ={};$X(uZ,{types:()=>yY,promisify:()=>fZ,log:()=>gZ,isUndefined:()=>nU,isSymbol:()=>cY,isString:()=>DX,isRegExp:()=>FX,isPrimitive:()=>pY,isObject:()=>mU,isNumber:()=>NZ,isNullOrUndefined:()=>fY,isNull:()=>TX,isFunction:()=>CX,isError:()=>HX,isDate:()=>bX,isBuffer:()=>hY,isBoolean:()=>dX,isArray:()=>xZ,inspect:()=>uU,inherits:()=>wZ,format:()=>lX,deprecate:()=>jY,default:()=>lY,debuglog:()=>vY,callbackifyOnRejected:()=>mX,callbackify:()=>cZ,_extend:()=>nX,TextEncoder:()=>pZ,TextDecoder:()=>hZ});function lX(I,...O){if(!DX(I)){var F=[I];for(var T=0;T<O.length;T++)F.push(uU(O[T]));return F.join(" ")}var T=0,H=O.length,E=String(I).replace(kY,function(P){if(P==="%%")return"%";if(T>=H)return P;switch(P){case"%s":return String(O[T++]);case"%d":return Number(O[T++]);case"%j":try{return JSON.stringify(O[T++])}catch(q){return"[Circular]"}default:return P}});for(var V=O[T];T<H;V=O[++T])if(TX(V)||!mU(V))E+=" "+V;else E+=" "+uU(V);return E}function jY(I,O){if(typeof process>"u"||process?.noDeprecation===!0)return I;var F=!1;function T(...H){if(!F){if(process.throwDeprecation)throw Error(O);else if(process.traceDeprecation)console.trace(O);else console.error(O);F=!0}return I.apply(this,...H)}return T}function _Y(I,O){var F=uU.styles[O];if(F)return"\x1B["+uU.colors[F][0]+"m"+I+"\x1B["+uU.colors[F][1]+"m";else return I}function BY(I,O){return I}function xY(I){var O={};return I.forEach(function(F,T){O[F]=!0}),O}function AX(I,O,F){if(I.customInspect&&O&&CX(O.inspect)&&O.inspect!==uU&&!(O.constructor&&O.constructor.prototype===O)){var T=O.inspect(F,I);if(!DX(T))T=AX(I,T,F);return T}var H=NY(I,O);if(H)return H;var E=Object.keys(O),V=xY(E);if(I.showHidden)E=Object.getOwnPropertyNames(O);if(HX(O)&&(E.indexOf("message")>=0||E.indexOf("description")>=0))return pX(O);if(E.length===0){if(CX(O)){var P=O.name?": "+O.name:"";return I.stylize("[Function"+P+"]","special")}if(FX(O))return I.stylize(RegExp.prototype.toString.call(O),"regexp");if(bX(O))return I.stylize(Date.prototype.toString.call(O),"date");if(HX(O))return pX(O)}var q="",L=!1,z=["{","}"];if(xZ(O))L=!0,z=["[","]"];if(CX(O)){var C=O.name?": "+O.name:"";q=" [Function"+C+"]"}if(FX(O))q=" "+RegExp.prototype.toString.call(O);if(bX(O))q=" "+Date.prototype.toUTCString.call(O);if(HX(O))q=" "+pX(O);if(E.length===0&&(!L||O.length==0))return z[0]+q+z[1];if(F<0)if(FX(O))return I.stylize(RegExp.prototype.toString.call(O),"regexp");else return I.stylize("[Object]","special");I.seen.push(O);var D;if(L)D=gY(I,O,F,V,E);else D=E.map(function(S){return uX(I,O,F,V,S,L)});return I.seen.pop(),wY(D,q,z)}function NY(I,O){if(nU(O))return I.stylize("undefined","undefined");if(DX(O)){var F="'"+JSON.stringify(O).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return I.stylize(F,"string")}if(NZ(O))return I.stylize(""+O,"number");if(dX(O))return I.stylize(""+O,"boolean");if(TX(O))return I.stylize("null","null")}function pX(I){return"["+Error.prototype.toString.call(I)+"]"}function gY(I,O,F,T,H){var E=[];for(var V=0,P=O.length;V<P;++V)if(yZ(O,String(V)))E.push(uX(I,O,F,T,String(V),!0));else E.push("");return H.forEach(function(q){if(!q.match(/^\d+$/))E.push(uX(I,O,F,T,q,!0))}),E}function uX(I,O,F,T,H,E){var V,P,q;if(q=Object.getOwnPropertyDescriptor(O,H)||{value:O[H]},q.get)if(q.set)P=I.stylize("[Getter/Setter]","special");else P=I.stylize("[Getter]","special");else if(q.set)P=I.stylize("[Setter]","special");if(!yZ(T,H))V="["+H+"]";if(!P)if(I.seen.indexOf(q.value)<0){if(TX(F))P=AX(I,q.value,null);else P=AX(I,q.value,F-1);if(P.indexOf(`
|
|
2
2
|
`)>-1)if(E)P=P.split(`
|
|
3
3
|
`).map(function(L){return" "+L}).join(`
|
|
4
4
|
`).slice(2);else P=`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"./chunk-
|
|
1
|
+
import"./chunk-s9w2hb4g.js";var{defineProperty:j4,getOwnPropertyDescriptor:t4}=Object,e4=(q,G)=>{for(var Y in G)j4(q,Y,{get:G[Y],enumerable:!0})},a=(q,G,Y,H)=>{for(var F=H>1?void 0:H?t4(G,Y):G,Z=q.length-1,$;Z>=0;Z--)($=q[Z])&&(F=(H?$(G,Y,F):$(F))||F);return H&&F&&j4(G,Y,F),F},D=(q,G)=>(Y,H)=>G(Y,H,q),C3="Terminal input",L2={get:()=>C3,set:(q)=>C3=q},M3="Too much output to announce, navigate to rows manually to read",Q2={get:()=>M3,set:(q)=>M3=q};function q5(q){return q.replace(/\r?\n/g,"\r")}function G5(q,G){return G?"\x1B[200~"+q+"\x1B[201~":q}function Y5(q,G){q.clipboardData&&q.clipboardData.setData("text/plain",G.selectionText),q.preventDefault()}function H5(q,G,Y,H){if(q.stopPropagation(),q.clipboardData){let F=q.clipboardData.getData("text/plain");K4(F,G,Y,H)}}function K4(q,G,Y,H){q=q5(q),q=G5(q,Y.decPrivateModes.bracketedPasteMode&&H.rawOptions.ignoreBracketedPasteMode!==!0),Y.triggerDataEvent(q,!0),G.value=""}function W4(q,G,Y){let H=Y.getBoundingClientRect(),F=q.clientX-H.left-10,Z=q.clientY-H.top-10;G.style.width="20px",G.style.height="20px",G.style.left=`${F}px`,G.style.top=`${Z}px`,G.style.zIndex="1000",G.focus()}function z3(q,G,Y,H,F){W4(q,G,Y),F&&H.rightClickSelect(q),G.value=H.selectionText,G.select()}function h0(q){return q>65535?(q-=65536,String.fromCharCode((q>>10)+55296)+String.fromCharCode(q%1024+56320)):String.fromCharCode(q)}function q2(q,G=0,Y=q.length){let H="";for(let F=G;F<Y;++F){let Z=q[F];Z>65535?(Z-=65536,H+=String.fromCharCode((Z>>10)+55296)+String.fromCharCode(Z%1024+56320)):H+=String.fromCharCode(Z)}return H}var F5=class{constructor(){this._interim=0}clear(){this._interim=0}decode(q,G){let Y=q.length;if(!Y)return 0;let H=0,F=0;if(this._interim){let Z=q.charCodeAt(F++);56320<=Z&&Z<=57343?G[H++]=(this._interim-55296)*1024+Z-56320+65536:(G[H++]=this._interim,G[H++]=Z),this._interim=0}for(let Z=F;Z<Y;++Z){let $=q.charCodeAt(Z);if(55296<=$&&$<=56319){if(++Z>=Y)return this._interim=$,H;let V=q.charCodeAt(Z);56320<=V&&V<=57343?G[H++]=($-55296)*1024+V-56320+65536:(G[H++]=$,G[H++]=V);continue}$!==65279&&(G[H++]=$)}return H}},Z5=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(q,G){let Y=q.length;if(!Y)return 0;let H=0,F,Z,$,V,X=0,J=0;if(this.interim[0]){let j=!1,K=this.interim[0];K&=(K&224)===192?31:(K&240)===224?15:7;let z=0,W;for(;(W=this.interim[++z]&63)&&z<4;)K<<=6,K|=W;let P=(this.interim[0]&224)===192?2:(this.interim[0]&240)===224?3:4,x=P-z;for(;J<x;){if(J>=Y)return 0;if(W=q[J++],(W&192)!==128){J--,j=!0;break}else this.interim[z++]=W,K<<=6,K|=W&63}j||(P===2?K<128?J--:G[H++]=K:P===3?K<2048||K>=55296&&K<=57343||K===65279||(G[H++]=K):K<65536||K>1114111||(G[H++]=K)),this.interim.fill(0)}let M=Y-4,C=J;for(;C<Y;){for(;C<M&&!((F=q[C])&128)&&!((Z=q[C+1])&128)&&!(($=q[C+2])&128)&&!((V=q[C+3])&128);)G[H++]=F,G[H++]=Z,G[H++]=$,G[H++]=V,C+=4;if(F=q[C++],F<128)G[H++]=F;else if((F&224)===192){if(C>=Y)return this.interim[0]=F,H;if(Z=q[C++],(Z&192)!==128){C--;continue}if(X=(F&31)<<6|Z&63,X<128){C--;continue}G[H++]=X}else if((F&240)===224){if(C>=Y)return this.interim[0]=F,H;if(Z=q[C++],(Z&192)!==128){C--;continue}if(C>=Y)return this.interim[0]=F,this.interim[1]=Z,H;if($=q[C++],($&192)!==128){C--;continue}if(X=(F&15)<<12|(Z&63)<<6|$&63,X<2048||X>=55296&&X<=57343||X===65279)continue;G[H++]=X}else if((F&248)===240){if(C>=Y)return this.interim[0]=F,H;if(Z=q[C++],(Z&192)!==128){C--;continue}if(C>=Y)return this.interim[0]=F,this.interim[1]=Z,H;if($=q[C++],($&192)!==128){C--;continue}if(C>=Y)return this.interim[0]=F,this.interim[1]=Z,this.interim[2]=$,H;if(V=q[C++],(V&192)!==128){C--;continue}if(X=(F&7)<<18|(Z&63)<<12|($&63)<<6|V&63,X<65536||X>1114111)continue;G[H++]=X}}return H}},U4="",u0=" ",x1=class q{constructor(){this.fg=0,this.bg=0,this.extended=new a1}static toColorRGB(G){return[G>>>16&255,G>>>8&255,G&255]}static fromColorRGB(G){return(G[0]&255)<<16|(G[1]&255)<<8|G[2]&255}clone(){let G=new q;return G.fg=this.fg,G.bg=this.bg,G.extended=this.extended.clone(),G}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)===50331648}isBgRGB(){return(this.bg&50331648)===50331648}isFgPalette(){return(this.fg&50331648)===16777216||(this.fg&50331648)===33554432}isBgPalette(){return(this.bg&50331648)===16777216||(this.bg&50331648)===33554432}isFgDefault(){return(this.fg&50331648)===0}isBgDefault(){return(this.bg&50331648)===0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===16777216||(this.extended.underlineColor&50331648)===33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===0:this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},a1=class q{constructor(G=0,Y=0){this._ext=0,this._urlId=0,this._ext=G,this._urlId=Y}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(G){this._ext=G}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(G){this._ext&=-469762049,this._ext|=G<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(G){this._ext&=-67108864,this._ext|=G&67108863}get urlId(){return this._urlId}set urlId(G){this._urlId=G}get underlineVariantOffset(){let G=(this._ext&3758096384)>>29;return G<0?G^4294967288:G}set underlineVariantOffset(G){this._ext&=536870911,this._ext|=G<<29&3758096384}clone(){return new q(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},B0=class q extends x1{constructor(){super(...arguments);this.content=0,this.fg=0,this.bg=0,this.extended=new a1,this.combinedData=""}static fromCharData(G){let Y=new q;return Y.setFromCharData(G),Y}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?h0(this.content&2097151):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(G){this.fg=G[0],this.bg=0;let Y=!1;if(G[1].length>2)Y=!0;else if(G[1].length===2){let H=G[1].charCodeAt(0);if(55296<=H&&H<=56319){let F=G[1].charCodeAt(1);56320<=F&&F<=57343?this.content=(H-55296)*1024+F-56320+65536|G[2]<<22:Y=!0}else Y=!0}else this.content=G[1].charCodeAt(0)|G[2]<<22;Y&&(this.combinedData=G[1],this.content=2097152|G[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},j3="di$target",O2="di$dependencies",V2=new Map;function $5(q){return q[O2]||[]}function H0(q){if(V2.has(q))return V2.get(q);let G=function(Y,H,F){if(arguments.length!==3)throw Error("@IServiceName-decorator can only be used to decorate a parameter");J5(G,Y,F)};return G._id=q,V2.set(q,G),G}function J5(q,G,Y){G[j3]===G?G[O2].push({id:q,index:Y}):(G[O2]=[{id:q,index:Y}],G[j3]=G)}var X0=H0("BufferService"),N4=H0("CoreMouseService"),e0=H0("CoreService"),V5=H0("CharsetService"),q3=H0("InstantiationService"),B4=H0("LogService"),C0=H0("OptionsService"),A4=H0("OscLinkService"),X5=H0("UnicodeService"),w1=H0("DecorationService"),x2=class{constructor(q,G,Y){this._bufferService=q,this._optionsService=G,this._oscLinkService=Y}provideLinks(q,G){let Y=this._bufferService.buffer.lines.get(q-1);if(!Y){G(void 0);return}let H=[],F=this._optionsService.rawOptions.linkHandler,Z=new B0,$=Y.getTrimmedLength(),V=-1,X=-1,J=!1;for(let M=0;M<$;M++)if(!(X===-1&&!Y.hasContent(M))){if(Y.loadCell(M,Z),Z.hasExtendedAttrs()&&Z.extended.urlId)if(X===-1){X=M,V=Z.extended.urlId;continue}else J=Z.extended.urlId!==V;else X!==-1&&(J=!0);if(J||X!==-1&&M===$-1){let C=this._oscLinkService.getLinkData(V)?.uri;if(C){let j={start:{x:X+1,y:q},end:{x:M+(!J&&M===$-1?1:0),y:q}},K=!1;if(!F?.allowNonHttpProtocols)try{let z=new URL(C);["http:","https:"].includes(z.protocol)||(K=!0)}catch{K=!0}K||H.push({text:C,range:j,activate:(z,W)=>F?F.activate(z,W,j):C5(z,W),hover:(z,W)=>F?.hover?.(z,W,j),leave:(z,W)=>F?.leave?.(z,W,j)})}J=!1,Z.hasExtendedAttrs()&&Z.extended.urlId?(X=M,V=Z.extended.urlId):(X=-1,V=-1)}}G(H)}};x2=a([D(0,X0),D(1,C0),D(2,A4)],x2);function C5(q,G){if(confirm(`Do you want to navigate to ${G}?
|
|
2
2
|
|
|
3
3
|
WARNING: This link could potentially be dangerous`)){let Y=window.open();if(Y){try{Y.opener=null}catch{}Y.location.href=G}else console.warn("Opening link blocked as opener could not be cleared")}}var G2=H0("CharSizeService"),v0=H0("CoreBrowserService"),G3=H0("MouseService"),_0=H0("RenderService"),M5=H0("SelectionService"),R4=H0("CharacterJoinerService"),H1=H0("ThemeService"),D4=H0("LinkProviderService"),z5=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(q){setTimeout(()=>{throw q.stack?K3.isErrorNoTelemetry(q)?new K3(q.message+`
|
|
4
4
|
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var{defineProperty:i,getOwnPropertyNames:k,getOwnPropertyDescriptor:l}=Object,m=Object.prototype.hasOwnProperty;var j=new WeakMap,n=(b)=>{var a=j.get(b),c;if(a)return a;if(a=i({},"__esModule",{value:!0}),b&&typeof b==="object"||typeof b==="function")k(b).map((d)=>!m.call(a,d)&&i(a,d,{get:()=>b[d],enumerable:!(c=l(b,d))||c.enumerable}));return j.set(b,a),a},o=(b,a)=>()=>(a||b((a={exports:{}}).exports,a),a.exports);var p=(b,a)=>{for(var c in a)i(b,c,{get:a[c],enumerable:!0,configurable:!0,set:(d)=>a[c]=()=>d})};var q=function(b,a,c,d){var f=arguments.length,e=f<3?a:d===null?d=Object.getOwnPropertyDescriptor(a,c):d,g;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")e=Reflect.decorate(b,a,c,d);else for(var h=b.length-1;h>=0;h--)if(g=b[h])e=(f<3?g(e):f>3?g(a,c,e):g(a,c))||e;return f>3&&e&&Object.defineProperty(a,c,e),e};var r=(b,a)=>()=>(b&&(a=b(b=0)),a);var s=((b)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(b,{get:(a,c)=>(typeof require<"u"?require:a)[c]}):b)(function(b){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+b+'" is not supported')});
|
|
2
|
+
export{n as a,o as b,p as c,q as d,r as e,s as f};
|
package/dist/pyrepl.esm.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{d as Bn,f as kn}from"./chunk-s9w2hb4g.js";var I=globalThis,K=I.ShadowRoot&&(I.ShadyCSS===void 0||I.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,L=Symbol(),U=new WeakMap;class ${constructor(n,r,e){if(this._$cssResult$=!0,e!==L)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=n,this.t=r}get styleSheet(){let n=this.o,r=this.t;if(K&&n===void 0){let e=r!==void 0&&r.length===1;e&&(n=U.get(r)),n===void 0&&((this.o=n=new CSSStyleSheet).replaceSync(this.cssText),e&&U.set(r,n))}return n}toString(){return this.cssText}}var A=(n)=>new $(typeof n=="string"?n:n+"",void 0,L);var M=(n,r)=>{if(K)n.adoptedStyleSheets=r.map((e)=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of r){let l=document.createElement("style"),o=I.litNonce;o!==void 0&&l.setAttribute("nonce",o),l.textContent=e.cssText,n.appendChild(l)}},D=K?(n)=>n:(n)=>n instanceof CSSStyleSheet?((r)=>{let e="";for(let l of r.cssRules)e+=l.cssText;return A(e)})(n):n;var{is:Gn,defineProperty:Jn,getOwnPropertyDescriptor:Cn,getOwnPropertyNames:In,getOwnPropertySymbols:Kn,getPrototypeOf:On}=Object,W=globalThis,nn=W.trustedTypes,Wn=nn?nn.emptyScript:"",Yn=W.reactiveElementPolyfillSupport,k=(n,r)=>n,O={toAttribute(n,r){switch(r){case Boolean:n=n?Wn:null;break;case Object:case Array:n=n==null?n:JSON.stringify(n)}return n},fromAttribute(n,r){let e=n;switch(r){case Boolean:e=n!==null;break;case Number:e=n===null?null:Number(n);break;case Object:case Array:try{e=JSON.parse(n)}catch(l){e=null}}return e}},T=(n,r)=>!Gn(n,r),en={attribute:!0,type:String,converter:O,reflect:!1,useDefault:!1,hasChanged:T};Symbol.metadata??=Symbol("metadata"),W.litPropertyMetadata??=new WeakMap;class u extends HTMLElement{static addInitializer(n){this._$Ei(),(this.l??=[]).push(n)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(n,r=en){if(r.state&&(r.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(n)&&((r=Object.create(r)).wrapped=!0),this.elementProperties.set(n,r),!r.noAccessor){let e=Symbol(),l=this.getPropertyDescriptor(n,e,r);l!==void 0&&Jn(this.prototype,n,l)}}static getPropertyDescriptor(n,r,e){let{get:l,set:o}=Cn(this.prototype,n)??{get(){return this[r]},set(_){this[r]=_}};return{get:l,set(_){let s=l?.call(this);o?.call(this,_),this.requestUpdate(n,s,e)},configurable:!0,enumerable:!0}}static getPropertyOptions(n){return this.elementProperties.get(n)??en}static _$Ei(){if(this.hasOwnProperty(k("elementProperties")))return;let n=On(this);n.finalize(),n.l!==void 0&&(this.l=[...n.l]),this.elementProperties=new Map(n.elementProperties)}static finalize(){if(this.hasOwnProperty(k("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(k("properties"))){let r=this.properties,e=[...In(r),...Kn(r)];for(let l of e)this.createProperty(l,r[l])}let n=this[Symbol.metadata];if(n!==null){let r=litPropertyMetadata.get(n);if(r!==void 0)for(let[e,l]of r)this.elementProperties.set(e,l)}this._$Eh=new Map;for(let[r,e]of this.elementProperties){let l=this._$Eu(r,e);l!==void 0&&this._$Eh.set(l,r)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(n){let r=[];if(Array.isArray(n)){let e=new Set(n.flat(1/0).reverse());for(let l of e)r.unshift(D(l))}else n!==void 0&&r.push(D(n));return r}static _$Eu(n,r){let e=r.attribute;return e===!1?void 0:typeof e=="string"?e:typeof n=="string"?n.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((n)=>this.enableUpdating=n),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((n)=>n(this))}addController(n){(this._$EO??=new Set).add(n),this.renderRoot!==void 0&&this.isConnected&&n.hostConnected?.()}removeController(n){this._$EO?.delete(n)}_$E_(){let n=new Map,r=this.constructor.elementProperties;for(let e of r.keys())this.hasOwnProperty(e)&&(n.set(e,this[e]),delete this[e]);n.size>0&&(this._$Ep=n)}createRenderRoot(){let n=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return M(n,this.constructor.elementStyles),n}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((n)=>n.hostConnected?.())}enableUpdating(n){}disconnectedCallback(){this._$EO?.forEach((n)=>n.hostDisconnected?.())}attributeChangedCallback(n,r,e){this._$AK(n,e)}_$ET(n,r){let e=this.constructor.elementProperties.get(n),l=this.constructor._$Eu(n,e);if(l!==void 0&&e.reflect===!0){let o=(e.converter?.toAttribute!==void 0?e.converter:O).toAttribute(r,e.type);this._$Em=n,o==null?this.removeAttribute(l):this.setAttribute(l,o),this._$Em=null}}_$AK(n,r){let e=this.constructor,l=e._$Eh.get(n);if(l!==void 0&&this._$Em!==l){let o=e.getPropertyOptions(l),_=typeof o.converter=="function"?{fromAttribute:o.converter}:o.converter?.fromAttribute!==void 0?o.converter:O;this._$Em=l;let s=_.fromAttribute(r,o.type);this[l]=s??this._$Ej?.get(l)??s,this._$Em=null}}requestUpdate(n,r,e,l=!1,o){if(n!==void 0){let _=this.constructor;if(l===!1&&(o=this[n]),e??=_.getPropertyOptions(n),!((e.hasChanged??T)(o,r)||e.useDefault&&e.reflect&&o===this._$Ej?.get(n)&&!this.hasAttribute(_._$Eu(n,e))))return;this.C(n,r,e)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(n,r,{useDefault:e,reflect:l,wrapped:o},_){e&&!(this._$Ej??=new Map).has(n)&&(this._$Ej.set(n,_??r??this[n]),o!==!0||_!==void 0)||(this._$AL.has(n)||(this.hasUpdated||e||(r=void 0),this._$AL.set(n,r)),l===!0&&this._$Em!==n&&(this._$Eq??=new Set).add(n))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(r){Promise.reject(r)}let n=this.scheduleUpdate();return n!=null&&await n,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[l,o]of this._$Ep)this[l]=o;this._$Ep=void 0}let e=this.constructor.elementProperties;if(e.size>0)for(let[l,o]of e){let{wrapped:_}=o,s=this[l];_!==!0||this._$AL.has(l)||s===void 0||this.C(l,void 0,o,s)}}let n=!1,r=this._$AL;try{n=this.shouldUpdate(r),n?(this.willUpdate(r),this._$EO?.forEach((e)=>e.hostUpdate?.()),this.update(r)):this._$EM()}catch(e){throw n=!1,this._$EM(),e}n&&this._$AE(r)}willUpdate(n){}_$AE(n){this._$EO?.forEach((r)=>r.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(n)),this.updated(n)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(n){return!0}update(n){this._$Eq&&=this._$Eq.forEach((r)=>this._$ET(r,this[r])),this._$EM()}updated(n){}firstUpdated(n){}}u.elementStyles=[],u.shadowRootOptions={mode:"open"},u[k("elementProperties")]=new Map,u[k("finalized")]=new Map,Yn?.({ReactiveElement:u}),(W.reactiveElementVersions??=[]).push("2.1.2");var g=globalThis,rn=(n)=>n,Y=g.trustedTypes,ln=Y?Y.createPolicy("lit-html",{createHTML:(n)=>n}):void 0;var i=`lit$${Math.random().toFixed(9).slice(2)}$`,yn="?"+i,Xn=`<${yn}>`,t=document,N=()=>t.createComment(""),q=(n)=>n===null||typeof n!="object"&&typeof n!="function",V=Array.isArray,$n=(n)=>V(n)||typeof n?.[Symbol.iterator]=="function";var F=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,on=/-->/g,_n=/>/g,f=RegExp(`>|[
|
|
2
2
|
\f\r](?:([^\\s"'>=/]+)([
|
|
3
3
|
\f\r]*=[
|
|
4
4
|
\f\r]*(?:[^
|
|
5
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),sn=/'/g,pn=/"/g,
|
|
5
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),sn=/'/g,pn=/"/g,cn=/^(?:script|style|textarea|title)$/i,Z=(n)=>(r,...e)=>({_$litType$:n,strings:r,values:e}),dn=Z(1),ee=Z(2),re=Z(3),v=Symbol.for("lit-noChange"),c=Symbol.for("lit-nothing"),wn=new WeakMap,b=t.createTreeWalker(t,129);function xn(n,r){if(!V(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return ln!==void 0?ln.createHTML(r):r}var Dn=(n,r)=>{let e=n.length-1,l=[],o,_=r===2?"<svg>":r===3?"<math>":"",s=F;for(let p=0;p<e;p++){let w=n[p],a,y,d=-1,x=0;for(;x<w.length&&(s.lastIndex=x,y=s.exec(w),y!==null);)x=s.lastIndex,s===F?y[1]==="!--"?s=on:y[1]!==void 0?s=_n:y[2]!==void 0?(cn.test(y[2])&&(o=RegExp("</"+y[2],"g")),s=f):y[3]!==void 0&&(s=f):s===f?y[0]===">"?(s=o??F,d=-1):y[1]===void 0?d=-2:(d=s.lastIndex-y[2].length,a=y[1],s=y[3]===void 0?f:y[3]==='"'?pn:sn):s===pn||s===sn?s=f:s===on||s===_n?s=F:(s=f,o=void 0);let m=s===f&&n[p+1].startsWith("/>")?" ":"";_+=s===F?w+Xn:d>=0?(l.push(a),w.slice(0,d)+"$lit$"+w.slice(d)+i+m):w+i+(d===-2?p:m)}return[xn(n,_+(n[e]||"<?>")+(r===2?"</svg>":r===3?"</math>":"")),l]};class B{constructor({strings:n,_$litType$:r},e){let l;this.parts=[];let o=0,_=0,s=n.length-1,p=this.parts,[w,a]=Dn(n,r);if(this.el=B.createElement(w,e),b.currentNode=this.el.content,r===2||r===3){let y=this.el.content.firstChild;y.replaceWith(...y.childNodes)}for(;(l=b.nextNode())!==null&&p.length<s;){if(l.nodeType===1){if(l.hasAttributes())for(let y of l.getAttributeNames())if(y.endsWith("$lit$")){let d=a[_++],x=l.getAttribute(y).split(i),m=/([.?@])?(.*)/.exec(d);p.push({type:1,index:o,name:m[2],strings:x,ctor:m[1]==="."?an:m[1]==="?"?un:m[1]==="@"?fn:J}),l.removeAttribute(y)}else y.startsWith(i)&&(p.push({type:6,index:o}),l.removeAttribute(y));if(cn.test(l.tagName)){let y=l.textContent.split(i),d=y.length-1;if(d>0){l.textContent=Y?Y.emptyScript:"";for(let x=0;x<d;x++)l.append(y[x],N()),b.nextNode(),p.push({type:2,index:++o});l.append(y[d],N())}}}else if(l.nodeType===8)if(l.data===yn)p.push({type:2,index:o});else{let y=-1;for(;(y=l.data.indexOf(i,y+1))!==-1;)p.push({type:7,index:o}),y+=i.length-1}o++}}static createElement(n,r){let e=t.createElement("template");return e.innerHTML=n,e}}function S(n,r,e=n,l){if(r===v)return r;let o=l!==void 0?e._$Co?.[l]:e._$Cl,_=q(r)?void 0:r._$litDirective$;return o?.constructor!==_&&(o?._$AO?.(!1),_===void 0?o=void 0:(o=new _(n),o._$AT(n,e,l)),l!==void 0?(e._$Co??=[])[l]=o:e._$Cl=o),o!==void 0&&(r=S(n,o._$AS(n,r.values),o,l)),r}class mn{constructor(n,r){this._$AV=[],this._$AN=void 0,this._$AD=n,this._$AM=r}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(n){let{el:{content:r},parts:e}=this._$AD,l=(n?.creationScope??t).importNode(r,!0);b.currentNode=l;let o=b.nextNode(),_=0,s=0,p=e[0];for(;p!==void 0;){if(_===p.index){let w;p.type===2?w=new G(o,o.nextSibling,this,n):p.type===1?w=new p.ctor(o,p.name,p.strings,this,n):p.type===6&&(w=new bn(o,this,n)),this._$AV.push(w),p=e[++s]}_!==p?.index&&(o=b.nextNode(),_++)}return b.currentNode=t,l}p(n){let r=0;for(let e of this._$AV)e!==void 0&&(e.strings!==void 0?(e._$AI(n,e,r),r+=e.strings.length-2):e._$AI(n[r])),r++}}class G{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(n,r,e,l){this.type=2,this._$AH=c,this._$AN=void 0,this._$AA=n,this._$AB=r,this._$AM=e,this.options=l,this._$Cv=l?.isConnected??!0}get parentNode(){let n=this._$AA.parentNode,r=this._$AM;return r!==void 0&&n?.nodeType===11&&(n=r.parentNode),n}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(n,r=this){n=S(this,n,r),q(n)?n===c||n==null||n===""?(this._$AH!==c&&this._$AR(),this._$AH=c):n!==this._$AH&&n!==v&&this._(n):n._$litType$!==void 0?this.$(n):n.nodeType!==void 0?this.T(n):$n(n)?this.k(n):this._(n)}O(n){return this._$AA.parentNode.insertBefore(n,this._$AB)}T(n){this._$AH!==n&&(this._$AR(),this._$AH=this.O(n))}_(n){this._$AH!==c&&q(this._$AH)?this._$AA.nextSibling.data=n:this.T(t.createTextNode(n)),this._$AH=n}$(n){let{values:r,_$litType$:e}=n,l=typeof e=="number"?this._$AC(n):(e.el===void 0&&(e.el=B.createElement(xn(e.h,e.h[0]),this.options)),e);if(this._$AH?._$AD===l)this._$AH.p(r);else{let o=new mn(l,this),_=o.u(this.options);o.p(r),this.T(_),this._$AH=o}}_$AC(n){let r=wn.get(n.strings);return r===void 0&&wn.set(n.strings,r=new B(n)),r}k(n){V(this._$AH)||(this._$AH=[],this._$AR());let r=this._$AH,e,l=0;for(let o of n)l===r.length?r.push(e=new G(this.O(N()),this.O(N()),this,this.options)):e=r[l],e._$AI(o),l++;l<r.length&&(this._$AR(e&&e._$AB.nextSibling,l),r.length=l)}_$AR(n=this._$AA.nextSibling,r){for(this._$AP?.(!1,!0,r);n!==this._$AB;){let e=rn(n).nextSibling;rn(n).remove(),n=e}}setConnected(n){this._$AM===void 0&&(this._$Cv=n,this._$AP?.(n))}}class J{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(n,r,e,l,o){this.type=1,this._$AH=c,this._$AN=void 0,this.element=n,this.name=r,this._$AM=l,this.options=o,e.length>2||e[0]!==""||e[1]!==""?(this._$AH=Array(e.length-1).fill(new String),this.strings=e):this._$AH=c}_$AI(n,r=this,e,l){let o=this.strings,_=!1;if(o===void 0)n=S(this,n,r,0),_=!q(n)||n!==this._$AH&&n!==v,_&&(this._$AH=n);else{let s=n,p,w;for(n=o[0],p=0;p<o.length-1;p++)w=S(this,s[e+p],r,p),w===v&&(w=this._$AH[p]),_||=!q(w)||w!==this._$AH[p],w===c?n=c:n!==c&&(n+=(w??"")+o[p+1]),this._$AH[p]=w}_&&!l&&this.j(n)}j(n){n===c?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,n??"")}}class an extends J{constructor(){super(...arguments),this.type=3}j(n){this.element[this.name]=n===c?void 0:n}}class un extends J{constructor(){super(...arguments),this.type=4}j(n){this.element.toggleAttribute(this.name,!!n&&n!==c)}}class fn extends J{constructor(n,r,e,l,o){super(n,r,e,l,o),this.type=5}_$AI(n,r=this){if((n=S(this,n,r,0)??c)===v)return;let e=this._$AH,l=n===c&&e!==c||n.capture!==e.capture||n.once!==e.once||n.passive!==e.passive,o=n!==c&&(e===c||l);l&&this.element.removeEventListener(this.name,this,e),o&&this.element.addEventListener(this.name,this,n),this._$AH=n}handleEvent(n){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,n):this._$AH.handleEvent(n)}}class bn{constructor(n,r,e){this.element=n,this.type=6,this._$AN=void 0,this._$AM=r,this.options=e}get _$AU(){return this._$AM._$AU}_$AI(n){S(this,n)}}var Tn=g.litHtmlPolyfillSupport;Tn?.(B,G),(g.litHtmlVersions??=[]).push("3.3.2");var tn=(n,r,e)=>{let l=e?.renderBefore??r,o=l._$litPart$;if(o===void 0){let _=e?.renderBefore??null;l._$litPart$=o=new G(r.insertBefore(N(),_),_,void 0,e??{})}return o._$AI(n),o};var z=globalThis;class h extends u{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let n=super.createRenderRoot();return this.renderOptions.renderBefore??=n.firstChild,n}update(n){let r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(n),this._$Do=tn(r,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return v}}h._$litElement$=!0,h.finalized=!0,z.litElementHydrateSupport?.({LitElement:h});var gn=z.litElementPolyfillSupport;gn?.({LitElement:h});(z.litElementVersions??=[]).push("4.2.2");var vn=(n)=>(r,e)=>{e!==void 0?e.addInitializer(()=>{customElements.define(n,r)}):customElements.define(n,r)};var hn=`from codeop import compile_command
|
|
6
6
|
import sys
|
|
7
7
|
from _pyrepl.console import Console, Event
|
|
8
8
|
from collections import deque
|
|
@@ -149,6 +149,7 @@ async def start_repl():
|
|
|
149
149
|
theme_name = getattr(js, "pyreplTheme", "catppuccin-mocha")
|
|
150
150
|
pygments_fallback = getattr(js, "pyreplPygmentsFallback", "catppuccin-mocha")
|
|
151
151
|
info_line = getattr(js, "pyreplInfo", "Python 3.13 (Pyodide)")
|
|
152
|
+
show_banner = getattr(js, "pyreplBanner", True)
|
|
152
153
|
readonly = getattr(js, "pyreplReadonly", False)
|
|
153
154
|
prompt_color = getattr(js, "pyreplPromptColor", None) or "green"
|
|
154
155
|
pygments_style_js = getattr(js, "pyreplPygmentsStyle", None)
|
|
@@ -258,7 +259,8 @@ async def start_repl():
|
|
|
258
259
|
|
|
259
260
|
def clear():
|
|
260
261
|
browser_console.clear()
|
|
261
|
-
|
|
262
|
+
if show_banner:
|
|
263
|
+
browser_console.term.write(f"\\x1b[90m{info_line}\\x1b[0m\\r\\n")
|
|
262
264
|
|
|
263
265
|
class Exit:
|
|
264
266
|
def __repr__(self):
|
|
@@ -501,7 +503,7 @@ async def start_repl():
|
|
|
501
503
|
browser_console.term.write("\\r\\x1b[K") # Go to start, clear line
|
|
502
504
|
prompt = PS1 if len(lines) == 0 else PS2
|
|
503
505
|
browser_console.term.write(prompt + syntax_highlight(current_line))
|
|
504
|
-
`;var Q=null,
|
|
506
|
+
`;var Q=null,j=null,P=Promise.resolve(),C={"catppuccin-mocha":{background:"#1e1e2e",foreground:"#cdd6f4",cursor:"#f5e0dc",cursorAccent:"#1e1e2e",selectionBackground:"#585b70",black:"#45475a",red:"#f38ba8",green:"#a6e3a1",yellow:"#f9e2af",blue:"#89b4fa",magenta:"#f5c2e7",cyan:"#94e2d5",white:"#bac2de",brightBlack:"#585b70",brightRed:"#f38ba8",brightGreen:"#a6e3a1",brightYellow:"#f9e2af",brightBlue:"#89b4fa",brightMagenta:"#f5c2e7",brightCyan:"#94e2d5",brightWhite:"#a6adc8",headerBackground:"#181825",headerForeground:"#6c7086"},"catppuccin-latte":{background:"#eff1f5",foreground:"#4c4f69",cursor:"#dc8a78",cursorAccent:"#eff1f5",selectionBackground:"#acb0be",black:"#5c5f77",red:"#d20f39",green:"#40a02b",yellow:"#df8e1d",blue:"#1e66f5",magenta:"#ea76cb",cyan:"#179299",white:"#acb0be",brightBlack:"#6c6f85",brightRed:"#d20f39",brightGreen:"#40a02b",brightYellow:"#df8e1d",brightBlue:"#1e66f5",brightMagenta:"#ea76cb",brightCyan:"#179299",brightWhite:"#bcc0cc",headerBackground:"#dce0e8",headerForeground:"#8c8fa1"}},E="catppuccin-mocha";function Fn(n){if(!n.startsWith("#"))return!0;let r=n.slice(1),e=parseInt(r.slice(0,2),16),l=parseInt(r.slice(2,4),16),o=parseInt(r.slice(4,6),16);return(0.299*e+0.587*l+0.114*o)/255<0.5}function Sn(n){if("black"in n&&"red"in n)return n;let r=Fn(n.background)?"catppuccin-mocha":"catppuccin-latte",e=C[r];return{cursor:e.cursor,cursorAccent:e.cursorAccent,selectionBackground:e.selectionBackground,black:e.black,red:e.red,green:e.green,yellow:e.yellow,blue:e.blue,magenta:e.magenta,cyan:e.cyan,white:e.white,brightBlack:e.brightBlack,brightRed:e.brightRed,brightGreen:e.brightGreen,brightYellow:e.brightYellow,brightBlue:e.brightBlue,brightMagenta:e.brightMagenta,brightCyan:e.brightCyan,brightWhite:e.brightWhite,background:n.background,foreground:n.foreground,headerBackground:n.headerBackground??e.headerBackground,headerForeground:n.headerForeground??e.headerForeground,promptColor:n.promptColor,pygmentsStyle:n.pygmentsStyle}}var En={copy:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path></svg>',clear:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 6h18"></path><path d="M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"></path><path d="M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"></path></svg>'};function Vn(n){let r,e,l=n.dataset.themeConfig;if(l)try{let s=JSON.parse(l);r=Sn(s),e="custom"}catch{console.warn("pyrepl-web: invalid data-theme-config JSON, falling back to default"),r=C[E],e=E}else{e=n.dataset.theme||E;let s=window.pyreplThemes?.[e]||C[e]||C[E];if(r=Sn(s),!window.pyreplThemes?.[e]&&!C[e])console.warn(`pyrepl-web: unknown theme "${e}", falling back to default`),e=E}let o=n.dataset.packages,_=o?o.split(",").map((s)=>s.trim()).filter(Boolean):[];return{theme:r,themeName:e,showHeader:n.dataset.header!=="false",showButtons:n.dataset.buttons!=="false",title:n.dataset.title||"python",packages:_,src:n.dataset.src||null,readonly:n.dataset.readonly==="true",showBanner:n.dataset.noBanner!=="true"}}async function Zn(){if(!Q){let{loadPyodide:n}=await import("./chunk-9z51gwd8.js");Q=n({indexURL:"https://cdn.jsdelivr.net/pyodide/v0.29.2/full/",stdout:()=>{},stderr:()=>{}})}return await Q}function zn(){if(!j)j=Promise.resolve(hn);return j}class H{container;theme;packages;readonly;src;showHeader;showButtons;title;showBanner;constructor(n){this.container=n.container,this.theme=n.theme||E,this.packages=n.packages||[],this.readonly=n.readonly||!1,this.src=n.src,this.showHeader=n.showHeader!==void 0?n.showHeader:!0,this.showButtons=n.showButtons!==void 0?n.showButtons:!0,this.title=n.title||"python",this.showBanner=n.showBanner!==void 0?n.showBanner:!0}async init(){if(this.container.dataset.theme=this.theme,this.container.dataset.packages=this.packages.join(","),this.container.dataset.readonly=this.readonly?"true":"false",this.src)this.container.dataset.src=this.src;this.container.dataset.header=this.showHeader?"true":"false",this.container.dataset.buttons=this.showButtons?"true":"false",this.container.dataset.title=this.title,this.container.dataset.noBanner=this.showBanner?"false":"true";let{term:n,config:r}=await Nn(this.container);P=P.then(()=>qn(this.container,n,r)),await P}}function Qn(){if(document.readyState==="loading")document.addEventListener("DOMContentLoaded",Pn);else Pn()}function jn(){if(document.getElementById("pyrepl-styles"))return;let n=document.createElement("link");n.rel="stylesheet",n.href="https://cdn.jsdelivr.net/npm/@xterm/xterm/css/xterm.css",document.head.appendChild(n);let r=document.createElement("style");r.id="pyrepl-styles",r.textContent=`
|
|
505
507
|
.pyrepl {
|
|
506
508
|
display: inline-block;
|
|
507
509
|
border-radius: 8px;
|
|
@@ -580,14 +582,14 @@ async def start_repl():
|
|
|
580
582
|
scrollbar-width: none;
|
|
581
583
|
background-color: var(--pyrepl-bg) !important;
|
|
582
584
|
}
|
|
583
|
-
`,document.head.appendChild(
|
|
585
|
+
`,document.head.appendChild(r)}function Hn(n,r){let e=r.headerBackground||r.black,l=r.headerForeground||r.brightBlack;n.style.setProperty("--pyrepl-bg",r.background),n.style.setProperty("--pyrepl-header-bg",e),n.style.setProperty("--pyrepl-header-title",l),n.style.setProperty("--pyrepl-red",r.red),n.style.setProperty("--pyrepl-yellow",r.yellow),n.style.setProperty("--pyrepl-green",r.green),n.style.setProperty("--pyrepl-shadow","0 4px 24px rgba(0, 0, 0, 0.3)")}function Rn(n){let r=document.createElement("div");r.className="pyrepl-header";let e=document.createElement("div");e.className="pyrepl-header-dots",e.innerHTML=`
|
|
584
586
|
<div class="pyrepl-header-dot red"></div>
|
|
585
587
|
<div class="pyrepl-header-dot yellow"></div>
|
|
586
588
|
<div class="pyrepl-header-dot green"></div>
|
|
587
|
-
`;let l=document.createElement("div");if(l.className="pyrepl-header-title",l.textContent=n.title,
|
|
589
|
+
`;let l=document.createElement("div");if(l.className="pyrepl-header-title",l.textContent=n.title,r.appendChild(e),r.appendChild(l),n.showButtons){let o=document.createElement("div");o.className="pyrepl-header-buttons",o.innerHTML=`
|
|
588
590
|
<button class="pyrepl-header-btn" data-action="copy" title="Copy output">${En.copy}</button>
|
|
589
591
|
<button class="pyrepl-header-btn" data-action="clear" title="Clear terminal">${En.clear}</button>
|
|
590
|
-
`,
|
|
591
|
-
`)
|
|
592
|
-
`}navigator.clipboard.writeText(d.trimEnd())}),
|
|
593
|
-
`)
|
|
592
|
+
`,r.appendChild(o)}else{let o=document.createElement("div");o.style.width="48px",r.appendChild(o)}return r}async function Nn(n){jn();let r=Vn(n);if(Hn(n,r.theme),r.showHeader)n.appendChild(Rn(r));let e=await import("./chunk-f2vnq91h.js"),l=document.createElement("div");n.appendChild(l);let o=new e.Terminal({cursorBlink:!r.readonly,cursorStyle:r.readonly?"bar":"block",fontSize:14,fontFamily:"monospace",theme:r.theme,disableStdin:r.readonly});return o.open(l),{term:o,config:r}}async function qn(n,r,e){let l=await Zn();if(await l.loadPackage("micropip"),e.packages.length>0)await l.pyimport("micropip").install(e.packages);let _=`Python 3.13${e.packages.length>0?` (installed packages: ${e.packages.join(", ")})`:""}`;if(e.showBanner)r.write(`\x1B[90m${_}\x1B[0m\r
|
|
593
|
+
`);if(globalThis.term=r,globalThis.pyreplTheme=e.themeName,globalThis.pyreplPygmentsFallback=Fn(e.theme.background)?"catppuccin-mocha":"catppuccin-latte",globalThis.pyreplInfo=_,globalThis.pyreplReadonly=e.readonly,globalThis.pyreplPromptColor=e.theme.promptColor||"green",globalThis.pyreplPygmentsStyle=e.theme.pygmentsStyle,globalThis.pyreplBanner=e.showBanner,e.src)try{let w=await fetch(e.src);if(w.ok)globalThis.pyreplStartupScript=await w.text();else console.warn(`pyrepl-web: failed to fetch script from ${e.src}`)}catch(w){console.warn(`pyrepl-web: error fetching script from ${e.src}`,w)}let s=await zn();l.runPython(s),l.runPythonAsync("await start_repl()");while(!globalThis.currentBrowserConsole)await new Promise((w)=>setTimeout(w,10));let p=globalThis.currentBrowserConsole;if(globalThis.currentBrowserConsole=null,globalThis.term=null,globalThis.pyreplStartupScript=void 0,globalThis.pyreplTheme="",globalThis.pyreplPygmentsFallback="",globalThis.pyreplInfo="",globalThis.pyreplReadonly=!1,globalThis.pyreplPromptColor="",globalThis.pyreplPygmentsStyle=void 0,globalThis.pyreplBanner=!1,!e.readonly)r.onData((w)=>{for(let a of w)p.push_char(a.charCodeAt(0))});if(e.showHeader&&e.showButtons){let w=n.querySelector('[data-action="copy"]'),a=n.querySelector('[data-action="clear"]');w?.addEventListener("click",()=>{let y=r.buffer.active,d="";for(let x=0;x<y.length;x++){let m=y.getLine(x);if(m)d+=`${m.translateToString(!0)}
|
|
594
|
+
`}navigator.clipboard.writeText(d.trimEnd())}),a?.addEventListener("click",()=>{if(r.reset(),e.showBanner)r.write(`\x1B[90m${_}\x1B[0m\r
|
|
595
|
+
`);r.write("\x1B[32m>>> \x1B[0m")})}}async function Pn(){let n=document.querySelectorAll(".pyrepl"),r=Array.from(n).filter((l)=>!l.closest("py-repl")&&!l.dataset.pyreplInitialized);if(r.length===0)return;for(let l of r)l.dataset.pyreplInitialized="true";let e=await Promise.all(Array.from(r).map(async(l)=>({container:l,...await Nn(l)})));for(let{container:l,term:o,config:_}of e)P=P.then(()=>qn(l,o,_));await P}Qn();class R extends h{static properties={theme:{type:String},packages:{type:String},replTitle:{type:String,attribute:"repl-title"},noBanner:{type:Boolean,attribute:"no-banner"},isReadonly:{type:Boolean,attribute:"readonly"},noButtons:{type:Boolean,attribute:"no-buttons"},noHeader:{type:Boolean,attribute:"no-header"},src:{type:String}};constructor(){super();this.theme="catppuccin-mocha",this.packages="",this.replTitle="Python REPL",this.noBanner=!1,this.isReadonly=!1,this.noButtons=!1,this.noHeader=!1,this.src=""}createRenderRoot(){return this}firstUpdated(n){super.firstUpdated(n);let r=this.querySelector(".pyrepl");if(!r){console.error("pyrepl-web: .pyrepl container not found in <py-repl>");return}r.dataset.pyreplInitialized="true",new H({container:r,theme:this.theme,packages:this.packages.split(",").map((l)=>l.trim()).filter((l)=>l.length>0),readonly:this.isReadonly,src:this.src||void 0,showHeader:!this.noHeader,showButtons:!this.noButtons,title:this.replTitle,showBanner:!this.noBanner}).init()}render(){return dn`<div class="pyrepl"></div>`}}R=Bn([vn("py-repl")],R);export{R as PyRepl};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pyrepl-web",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "An embeddable Python REPL powered by Pyodide",
|
|
5
5
|
"main": "dist/pyrepl.js",
|
|
6
6
|
"files": [
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"README.md"
|
|
9
9
|
],
|
|
10
10
|
"scripts": {
|
|
11
|
-
"dev": "bun run src/server.ts",
|
|
11
|
+
"dev": "bun run build && bun --hot src/server.ts --watch",
|
|
12
12
|
"build": "bun run build.ts",
|
|
13
13
|
"prepare": "husky"
|
|
14
14
|
},
|
package/dist/chunk-b4v3wyq6.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{a as O,g as j}from"./chunk-q8xkh3ym.js";var __dirname="/home/runner/work/pyrepl-web/pyrepl-web/node_modules/pyodide";var U0=Object.defineProperty,B=(G,Q)=>U0(G,"name",{value:Q,configurable:!0}),f=((G)=>j)(function(G){return j.apply(this,arguments)}),F0=(()=>{for(var G=new Uint8Array(128),Q=0;Q<64;Q++)G[Q<26?Q+65:Q<52?Q+71:Q<62?Q-4:Q*4-205]=Q;return(W)=>{for(var z=W.length,X=new Uint8Array((z-(W[z-1]=="=")-(W[z-2]=="="))*3/4|0),Z=0,H=0;Z<z;){var J=G[W.charCodeAt(Z++)],K=G[W.charCodeAt(Z++)],M=G[W.charCodeAt(Z++)],V=G[W.charCodeAt(Z++)];X[H++]=J<<2|K>>4,X[H++]=K<<4|M>>2,X[H++]=M<<6|V}return X}})();function u(G){return!isNaN(parseFloat(G))&&isFinite(G)}B(u,"_isNumber");function T(G){return G.charAt(0).toUpperCase()+G.substring(1)}B(T,"_capitalize");function b(G){return function(){return this[G]}}B(b,"_getter");var F=["isConstructor","isEval","isNative","isToplevel"],k=["columnNumber","lineNumber"],I=["fileName","functionName","source"],k0=["args"],I0=["evalOrigin"],E=F.concat(k,I,k0,I0);function C(G){if(G)for(var Q=0;Q<E.length;Q++)G[E[Q]]!==void 0&&this["set"+T(E[Q])](G[E[Q]])}B(C,"StackFrame");C.prototype={getArgs:B(function(){return this.args},"getArgs"),setArgs:B(function(G){if(Object.prototype.toString.call(G)!=="[object Array]")throw TypeError("Args must be an Array");this.args=G},"setArgs"),getEvalOrigin:B(function(){return this.evalOrigin},"getEvalOrigin"),setEvalOrigin:B(function(G){if(G instanceof C)this.evalOrigin=G;else if(G instanceof Object)this.evalOrigin=new C(G);else throw TypeError("Eval Origin must be an Object or StackFrame")},"setEvalOrigin"),toString:B(function(){var G=this.getFileName()||"",Q=this.getLineNumber()||"",W=this.getColumnNumber()||"",z=this.getFunctionName()||"";return this.getIsEval()?G?"[eval] ("+G+":"+Q+":"+W+")":"[eval]:"+Q+":"+W:z?z+" ("+G+":"+Q+":"+W+")":G+":"+Q+":"+W},"toString")};C.fromString=B(function(G){var Q=G.indexOf("("),W=G.lastIndexOf(")"),z=G.substring(0,Q),X=G.substring(Q+1,W).split(","),Z=G.substring(W+1);if(Z.indexOf("@")===0)var H=/@(.+?)(?::(\d+))?(?::(\d+))?$/.exec(Z,""),J=H[1],K=H[2],M=H[3];return new C({functionName:z,args:X||void 0,fileName:J,lineNumber:K||void 0,columnNumber:M||void 0})},"StackFrame$$fromString");for(x=0;x<F.length;x++)C.prototype["get"+T(F[x])]=b(F[x]),C.prototype["set"+T(F[x])]=function(G){return function(Q){this[G]=!!Q}}(F[x]);var x;for(A=0;A<k.length;A++)C.prototype["get"+T(k[A])]=b(k[A]),C.prototype["set"+T(k[A])]=function(G){return function(Q){if(!u(Q))throw TypeError(G+" must be a Number");this[G]=Number(Q)}}(k[A]);var A;for(L=0;L<I.length;L++)C.prototype["get"+T(I[L])]=b(I[L]),C.prototype["set"+T(I[L])]=function(G){return function(Q){this[G]=String(Q)}}(I[L]);var L,g=C;function c(){var G=/^\s*at .*(\S+:\d+|\(native\))/m,Q=/^(eval@)?(\[native code])?$/;return{parse:B(function(W){if(W.stack&&W.stack.match(G))return this.parseV8OrIE(W);if(W.stack)return this.parseFFOrSafari(W);throw Error("Cannot parse given Error object")},"ErrorStackParser$$parse"),extractLocation:B(function(W){if(W.indexOf(":")===-1)return[W];var z=/(.+?)(?::(\d+))?(?::(\d+))?$/,X=z.exec(W.replace(/[()]/g,""));return[X[1],X[2]||void 0,X[3]||void 0]},"ErrorStackParser$$extractLocation"),parseV8OrIE:B(function(W){var z=W.stack.split(`
|
|
2
|
-
`).filter(function(X){return!!X.match(G)},this);return z.map(function(X){X.indexOf("(eval ")>-1&&(X=X.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(,.*$)/g,""));var Z=X.replace(/^\s+/,"").replace(/\(eval code/g,"(").replace(/^.*?\s+/,""),H=Z.match(/ (\(.+\)$)/);Z=H?Z.replace(H[0],""):Z;var J=this.extractLocation(H?H[1]:Z),K=H&&Z||void 0,M=["eval","<anonymous>"].indexOf(J[0])>-1?void 0:J[0];return new g({functionName:K,fileName:M,lineNumber:J[1],columnNumber:J[2],source:X})},this)},"ErrorStackParser$$parseV8OrIE"),parseFFOrSafari:B(function(W){var z=W.stack.split(`
|
|
3
|
-
`).filter(function(X){return!X.match(Q)},this);return z.map(function(X){if(X.indexOf(" > eval")>-1&&(X=X.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),X.indexOf("@")===-1&&X.indexOf(":")===-1)return new g({functionName:X});var Z=/((.*".+"[^@]*)?[^@]*)(?:@)/,H=X.match(Z),J=H&&H[1]?H[1]:void 0,K=this.extractLocation(X.replace(Z,""));return new g({functionName:J,fileName:K[0],lineNumber:K[1],columnNumber:K[2],source:X})},this)},"ErrorStackParser$$parseFFOrSafari")}}B(c,"ErrorStackParser");var N0=new c,R0=N0;function d(){if(typeof API<"u"&&API!==globalThis.API)return API.runtimeEnv;let G=typeof Bun<"u",Q=typeof Deno<"u",W=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string"&&!1,z=typeof navigator=="object"&&typeof navigator.userAgent=="string"&&navigator.userAgent.indexOf("Chrome")===-1&&navigator.userAgent.indexOf("Safari")>-1;return l({IN_BUN:G,IN_DENO:Q,IN_NODE:W,IN_SAFARI:z,IN_SHELL:typeof read=="function"&&typeof load=="function"})}B(d,"getGlobalRuntimeEnv");var Y=d();function l(G){let Q=G.IN_NODE&&typeof p<"u"&&P0&&typeof f=="function"&&typeof __dirname=="string",W=G.IN_NODE&&!Q,z=!G.IN_NODE&&!G.IN_DENO&&!G.IN_BUN,X=z&&typeof window<"u"&&typeof window.document<"u"&&typeof document.createElement=="function"&&"sessionStorage"in window&&typeof globalThis.importScripts!="function",Z=z&&typeof globalThis.WorkerGlobalScope<"u"&&typeof globalThis.self<"u"&&globalThis.self instanceof globalThis.WorkerGlobalScope;return{...G,IN_BROWSER:z,IN_BROWSER_MAIN_THREAD:X,IN_BROWSER_WEB_WORKER:Z,IN_NODE_COMMONJS:Q,IN_NODE_ESM:W}}B(l,"calculateDerivedFlags");var s,P,a,m,v;async function y(){if(!Y.IN_NODE||(s=(await import("./chunk-zvesc6aa.js")).default,m=await import("node:fs"),v=await import("node:fs/promises"),a=(await import("node:vm")).default,P=await import("./chunk-az66snk4.js"),_=P.sep,typeof f<"u"))return;let G=m,Q=await import("./chunk-p8z2rk6s.js"),W=await import("ws"),z=await import("node:child_process"),X={fs:G,crypto:Q,ws:W,child_process:z};globalThis.require=function(Z){return X[Z]}}B(y,"initNodeModules");function i(G,Q){return P.resolve(Q||".",G)}B(i,"node_resolvePath");function o(G,Q){return Q===void 0&&(Q=location),new URL(G,Q).toString()}B(o,"browser_resolvePath");var S;Y.IN_NODE?S=i:Y.IN_SHELL?S=B((G)=>G,"resolvePath"):S=o;var _;Y.IN_NODE||(_="/");function n(G,Q){return G.startsWith("file://")&&(G=G.slice(7)),G.includes("://")?{response:fetch(G)}:{binary:v.readFile(G).then((W)=>new Uint8Array(W.buffer,W.byteOffset,W.byteLength))}}B(n,"node_getBinaryResponse");function r(G,Q){if(G.startsWith("file://")&&(G=G.slice(7)),G.includes("://"))throw Error("Shell cannot fetch urls");return{binary:Promise.resolve(new Uint8Array(readbuffer(G)))}}B(r,"shell_getBinaryResponse");function t(G,Q){let W=new URL(G,location);return{response:fetch(W,Q?{integrity:Q}:{})}}B(t,"browser_getBinaryResponse");var w;Y.IN_NODE?w=n:Y.IN_SHELL?w=r:w=t;async function e(G,Q){let{response:W,binary:z}=w(G,Q);if(z)return z;let X=await W;if(!X.ok)throw Error(`Failed to load '${G}': request failed.`);return new Uint8Array(await X.arrayBuffer())}B(e,"loadBinaryFile");var N;if(Y.IN_BROWSER_MAIN_THREAD)N=B(async(G)=>await import(G),"loadScript");else if(Y.IN_BROWSER_WEB_WORKER)N=B(async(G)=>{try{globalThis.importScripts(G)}catch(Q){if(Q instanceof TypeError)await import(G);else throw Q}},"loadScript");else if(Y.IN_NODE)N=G0;else if(Y.IN_SHELL)N=load;else throw Error("Cannot determine runtime environment");async function G0(G){G.startsWith("file://")&&(G=G.slice(7)),G.includes("://")?a.runInThisContext(await(await fetch(G)).text()):await import(s.pathToFileURL(G).href)}B(G0,"nodeLoadScript");async function Q0(G){if(Y.IN_NODE){await y();let Q=await v.readFile(G,{encoding:"utf8"});return JSON.parse(Q)}else if(Y.IN_SHELL){let Q=read(G);return JSON.parse(Q)}else return await(await fetch(G)).json()}B(Q0,"loadLockFile");async function W0(){if(Y.IN_NODE_COMMONJS)return __dirname;let G;try{throw Error()}catch(z){G=z}let Q=R0.parse(G)[0].fileName;if(Y.IN_NODE&&!Q.startsWith("file://")&&(Q=`file://${Q}`),Y.IN_NODE_ESM){let z=await import("./chunk-az66snk4.js");return(await import("./chunk-zvesc6aa.js")).fileURLToPath(z.dirname(Q))}let W=Q.lastIndexOf(_);if(W===-1)throw Error("Could not extract indexURL path from pyodide module location. Please pass the indexURL explicitly to loadPyodide.");return Q.slice(0,W)}B(W0,"calculateDirname");function X0(G){return G.substring(0,G.lastIndexOf("/")+1)||globalThis.location?.toString()||"."}B(X0,"calculateInstallBaseUrl");function Z0(G){let Q=G.FS,W=G.FS.filesystems.MEMFS,z=G.PATH,X={DIR_MODE:16895,FILE_MODE:33279,mount:B(function(Z){if(!Z.opts.fileSystemHandle)throw Error("opts.fileSystemHandle is required");return W.mount.apply(null,arguments)},"mount"),syncfs:B(async(Z,H,J)=>{try{let K=X.getLocalSet(Z),M=await X.getRemoteSet(Z),V=H?M:K,D=H?K:M;await X.reconcile(Z,V,D),J(null)}catch(K){J(K)}},"syncfs"),getLocalSet:B((Z)=>{let H=Object.create(null);function J(V){return V!=="."&&V!==".."}B(J,"isRealDir");function K(V){return(D)=>z.join2(V,D)}B(K,"toAbsolute");let M=Q.readdir(Z.mountpoint).filter(J).map(K(Z.mountpoint));for(;M.length;){let V=M.pop(),D=Q.stat(V);Q.isDir(D.mode)&&M.push.apply(M,Q.readdir(V).filter(J).map(K(V))),H[V]={timestamp:D.mtime,mode:D.mode}}return{type:"local",entries:H}},"getLocalSet"),getRemoteSet:B(async(Z)=>{let H=Object.create(null),J=await S0(Z.opts.fileSystemHandle);for(let[K,M]of J)K!=="."&&(H[z.join2(Z.mountpoint,K)]={timestamp:M.kind==="file"?new Date((await M.getFile()).lastModified):new Date,mode:M.kind==="file"?X.FILE_MODE:X.DIR_MODE});return{type:"remote",entries:H,handles:J}},"getRemoteSet"),loadLocalEntry:B((Z)=>{let H=Q.lookupPath(Z,{}).node,J=Q.stat(Z);if(Q.isDir(J.mode))return{timestamp:J.mtime,mode:J.mode};if(Q.isFile(J.mode))return H.contents=W.getFileDataAsTypedArray(H),{timestamp:J.mtime,mode:J.mode,contents:H.contents};throw Error("node type not supported")},"loadLocalEntry"),storeLocalEntry:B((Z,H)=>{if(Q.isDir(H.mode))Q.mkdirTree(Z,H.mode);else if(Q.isFile(H.mode))Q.writeFile(Z,H.contents,{canOwn:!0});else throw Error("node type not supported");Q.chmod(Z,H.mode),Q.utime(Z,H.timestamp,H.timestamp)},"storeLocalEntry"),removeLocalEntry:B((Z)=>{var H=Q.stat(Z);Q.isDir(H.mode)?Q.rmdir(Z):Q.isFile(H.mode)&&Q.unlink(Z)},"removeLocalEntry"),loadRemoteEntry:B(async(Z)=>{if(Z.kind==="file"){let H=await Z.getFile();return{contents:new Uint8Array(await H.arrayBuffer()),mode:X.FILE_MODE,timestamp:new Date(H.lastModified)}}else{if(Z.kind==="directory")return{mode:X.DIR_MODE,timestamp:new Date};throw Error("unknown kind: "+Z.kind)}},"loadRemoteEntry"),storeRemoteEntry:B(async(Z,H,J)=>{let K=Z.get(z.dirname(H)),M=Q.isFile(J.mode)?await K.getFileHandle(z.basename(H),{create:!0}):await K.getDirectoryHandle(z.basename(H),{create:!0});if(M.kind==="file"){let V=await M.createWritable();await V.write(J.contents),await V.close()}Z.set(H,M)},"storeRemoteEntry"),removeRemoteEntry:B(async(Z,H)=>{await Z.get(z.dirname(H)).removeEntry(z.basename(H)),Z.delete(H)},"removeRemoteEntry"),reconcile:B(async(Z,H,J)=>{let K=0,M=[];Object.keys(H.entries).forEach(function($){let q=H.entries[$],U=J.entries[$];(!U||Q.isFile(q.mode)&&q.timestamp.getTime()>U.timestamp.getTime())&&(M.push($),K++)}),M.sort();let V=[];if(Object.keys(J.entries).forEach(function($){H.entries[$]||(V.push($),K++)}),V.sort().reverse(),!K)return;let D=H.type==="remote"?H.handles:J.handles;for(let $ of M){let q=z.normalize($.replace(Z.mountpoint,"/")).substring(1);if(J.type==="local"){let U=D.get(q),L0=await X.loadRemoteEntry(U);X.storeLocalEntry($,L0)}else{let U=X.loadLocalEntry($);await X.storeRemoteEntry(D,q,U)}}for(let $ of V)if(J.type==="local")X.removeLocalEntry($);else{let q=z.normalize($.replace(Z.mountpoint,"/")).substring(1);await X.removeRemoteEntry(D,q)}},"reconcile")};G.FS.filesystems.NATIVEFS_ASYNC=X}B(Z0,"initializeNativeFS");var S0=B(async(G)=>{let Q=[];async function W(X){for await(let Z of X.values())Q.push(Z),Z.kind==="directory"&&await W(Z)}B(W,"collect"),await W(G);let z=new Map;z.set(".",G);for(let X of Q){let Z=(await G.resolve(X)).join("/");z.set(Z,X)}return z},"getFsHandles"),w0=F0("AGFzbQEAAAABDANfAGAAAW9gAW8BfwMDAgECByECD2NyZWF0ZV9zZW50aW5lbAAAC2lzX3NlbnRpbmVsAAEKEwIHAPsBAPsbCwkAIAD7GvsUAAs="),E0=async function(){if(!(globalThis.navigator&&(/iPad|iPhone|iPod/.test(navigator.userAgent)||navigator.platform==="MacIntel"&&typeof navigator.maxTouchPoints<"u"&&navigator.maxTouchPoints>1)))try{let G=await WebAssembly.compile(w0);return await WebAssembly.instantiate(G)}catch(G){if(G instanceof WebAssembly.CompileError)return;throw G}}();async function z0(){let G=await E0;if(G)return G.exports;let Q=Symbol("error marker");return{create_sentinel:B(()=>Q,"create_sentinel"),is_sentinel:B((W)=>W===Q,"is_sentinel")}}B(z0,"getSentinelImport");function B0(G){let Q={config:G,runtimeEnv:Y},W={noImageDecoding:!0,noAudioDecoding:!0,noWasmDecoding:!1,preRun:Y0(G),print:G.stdout,printErr:G.stderr,onExit(z){W.exitCode=z},thisProgram:G._sysExecutable,arguments:G.args,API:Q,locateFile:B((z)=>G.indexURL+z,"locateFile"),instantiateWasm:$0(G.indexURL)};return W}B(B0,"createSettings");function H0(G){return function(Q){let W="/";try{Q.FS.mkdirTree(G)}catch(z){console.error(`Error occurred while making a home directory '${G}':`),console.error(z),console.error(`Using '${W}' for a home directory instead`),G=W}Q.FS.chdir(G)}}B(H0,"createHomeDirectory");function J0(G){return function(Q){Object.assign(Q.ENV,G)}}B(J0,"setEnvironment");function K0(G){return G?[async(Q)=>{Q.addRunDependency("fsInitHook");try{await G(Q.FS,{sitePackages:Q.API.sitePackages})}finally{Q.removeRunDependency("fsInitHook")}}]:[]}B(K0,"callFsInitHook");function M0(G){let Q=G.HEAPU32[G._Py_Version>>>2],W=Q>>>24&255,z=Q>>>16&255,X=Q>>>8&255;return[W,z,X]}B(M0,"computeVersionTuple");function V0(G){let Q=e(G);return async(W)=>{W.API.pyVersionTuple=M0(W);let[z,X]=W.API.pyVersionTuple;W.FS.mkdirTree("/lib"),W.API.sitePackages=`/lib/python${z}.${X}/site-packages`,W.FS.mkdirTree(W.API.sitePackages),W.addRunDependency("install-stdlib");try{let Z=await Q;W.FS.writeFile(`/lib/python${z}${X}.zip`,Z)}catch(Z){console.error("Error occurred while installing the standard library:"),console.error(Z)}finally{W.removeRunDependency("install-stdlib")}}}B(V0,"installStdlib");function Y0(G){let Q;return G.stdLibURL!=null?Q=G.stdLibURL:Q=G.indexURL+"python_stdlib.zip",[V0(Q),H0(G.env.HOME),J0(G.env),Z0,...K0(G.fsInit)]}B(Y0,"getFileSystemInitializationFuncs");function $0(G){if(typeof WasmOffsetConverter<"u")return;let{binary:Q,response:W}=w(G+"pyodide.asm.wasm"),z=z0();return function(X,Z){return async function(){X.sentinel=await z;try{let H;W?H=await WebAssembly.instantiateStreaming(W,X):H=await WebAssembly.instantiate(await Q,X);let{instance:J,module:K}=H;Z(J,K)}catch(H){console.warn("wasm instantiation failed!"),console.warn(H)}}(),{}}}B($0,"getInstantiateWasmFunc");var b0="0.29.2";function R(G){return G===void 0||G.endsWith("/")?G:G+"/"}B(R,"withTrailingSlash");var h=b0;async function j0(G={}){if(await y(),G.lockFileContents&&G.lockFileURL)throw Error("Can't pass both lockFileContents and lockFileURL");let Q=G.indexURL||await W0();if(Q=R(S(Q)),G.packageBaseUrl=R(G.packageBaseUrl),G.cdnUrl=R(G.packageBaseUrl??`https://cdn.jsdelivr.net/pyodide/v${h}/full/`),!G.lockFileContents){let X=G.lockFileURL??Q+"pyodide-lock.json";G.lockFileContents=Q0(X),G.packageBaseUrl??=X0(X)}G.indexURL=Q,G.packageCacheDir&&(G.packageCacheDir=R(S(G.packageCacheDir)));let W={fullStdLib:!1,jsglobals:globalThis,stdin:globalThis.prompt?()=>globalThis.prompt():void 0,args:[],env:{},packages:[],packageCacheDir:G.packageBaseUrl,enableRunUntilComplete:!0,checkAPIVersion:!0,BUILD_ID:"02af97d1069c4309880e46f2948861ea1faae5dbb49c20d5d5970aa9ae912fd4"},z=Object.assign(W,G);return z.env.HOME??="/home/pyodide",z.env.PYTHONINSPECT??="1",z}B(j0,"initializeConfiguration");function C0(G){let Q=B0(G),W=Q.API;return W.lockFilePromise=Promise.resolve(G.lockFileContents),Q}B(C0,"createEmscriptenSettings");async function D0(G){if(typeof _createPyodideModule!="function"){let Q=`${G.indexURL}pyodide.asm.js`;await N(Q)}}B(D0,"loadWasmScript");async function O0(G,Q){if(!G._loadSnapshot)return;let W=await G._loadSnapshot,z=ArrayBuffer.isView(W)?W:new Uint8Array(W);return Q.noInitialRun=!0,Q.INITIAL_MEMORY=z.length,z}B(O0,"prepareSnapshot");async function T0(G){let Q=await _createPyodideModule(G);if(G.exitCode!==void 0)throw new Q.ExitStatus(G.exitCode);return Q}B(T0,"createPyodideModule");function q0(G,Q){let W=G.API;if(Q.pyproxyToStringRepr&&W.setPyProxyToStringMethod(!0),Q.convertNullToNone&&W.setCompatNullToNone(!0),Q.toJsLiteralMap&&W.setCompatToJsLiteralMap(!0),W.version!==h&&Q.checkAPIVersion)throw Error(`Pyodide version does not match: '${h}' <==> '${W.version}'. If you updated the Pyodide version, make sure you also updated the 'indexURL' parameter passed to loadPyodide.`);G.locateFile=(z)=>{throw z.endsWith(".so")?Error(`Failed to find dynamic library "${z}"`):Error(`Unexpected call to locateFile("${z}")`)}}B(q0,"configureAPI");function x0(G,Q,W){let z=G.API,X;return Q&&(X=z.restoreSnapshot(Q)),z.finalizeBootstrap(X,W._snapshotDeserializer)}B(x0,"bootstrapPyodide");async function A0(G,Q){let W=G._api;return W.sys.path.insert(0,""),W._pyodide.set_excepthook(),await W.packageIndexReady,W.initializeStreams(Q.stdin,Q.stdout,Q.stderr),G}B(A0,"finalizeSetup");async function g0(G={}){let Q=await j0(G),W=C0(Q);await D0(Q);let z=await O0(Q,W),X=await T0(W);q0(X,Q);let Z=x0(X,z,Q);return await A0(Z,Q)}B(g0,"loadPyodide");export{h as version,g0 as loadPyodide};
|
package/dist/chunk-q8xkh3ym.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
var m=Object.create;var{getPrototypeOf:n,defineProperty:g,getOwnPropertyNames:k,getOwnPropertyDescriptor:o}=Object,l=Object.prototype.hasOwnProperty;var p=(a,b,c)=>{c=a!=null?m(n(a)):{};let d=b||!a||!a.__esModule?g(c,"default",{value:a,enumerable:!0}):c;for(let e of k(a))if(!l.call(d,e))g(d,e,{get:()=>a[e],enumerable:!0});return d},j=new WeakMap,q=(a)=>{var b=j.get(a),c;if(b)return b;if(b=g({},"__esModule",{value:!0}),a&&typeof a==="object"||typeof a==="function")k(a).map((d)=>!l.call(b,d)&&g(b,d,{get:()=>a[d],enumerable:!(c=o(a,d))||c.enumerable}));return j.set(a,b),b},r=(a,b)=>()=>(b||a((b={exports:{}}).exports,b),b.exports);var s=(a,b)=>{for(var c in b)g(a,c,{get:b[c],enumerable:!0,configurable:!0,set:(d)=>b[c]=()=>d})};var t=function(a,b,c,d){var e=arguments.length,f=e<3?b:d===null?d=Object.getOwnPropertyDescriptor(b,c):d,h;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")f=Reflect.decorate(a,b,c,d);else for(var i=a.length-1;i>=0;i--)if(h=a[i])f=(e<3?h(f):e>3?h(b,c,f):h(b,c))||f;return e>3&&f&&Object.defineProperty(b,c,f),f};var u=(a,b)=>()=>(a&&(b=a(a=0)),b);var v=((a)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(a,{get:(b,c)=>(typeof require<"u"?require:b)[c]}):a)(function(a){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+a+'" is not supported')});
|
|
2
|
-
export{p as a,q as b,r as c,s as d,t as e,u as f,v as g};
|