@jupyterlite/pyodide-kernel 0.8.3 → 0.9.0-alpha.1
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/lib/_pypi.d.ts +2 -2
- package/lib/_pypi.js +2 -2
- package/lib/coincident.worker.js +8 -13
- package/lib/coincident.worker.js.map +4 -4
- package/lib/comlink.worker.js +5 -5
- package/lib/comlink.worker.js.map +3 -3
- package/lib/kernel.js +8 -3
- package/package.json +9 -9
- package/pypi/all.json +33 -33
- package/pypi/ipykernel-6.9.2-py3-none-any.whl +0 -0
- package/pypi/{piplite-0.8.3-py3-none-any.whl → piplite-0.9.0a1-py3-none-any.whl} +0 -0
- package/pypi/{pyodide_kernel-0.8.3-py3-none-any.whl → pyodide_kernel-0.9.0a1-py3-none-any.whl} +0 -0
- package/pypi/widgetsnbextension-3.6.999-py3-none-any.whl +0 -0
- package/pypi/widgetsnbextension-4.0.999-py3-none-any.whl +0 -0
package/lib/_pypi.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export * as allJSONUrl from '../pypi/all.json';
|
|
2
2
|
export * as ipykernelWheelUrl from '../pypi/ipykernel-6.9.2-py3-none-any.whl';
|
|
3
|
-
export * as pipliteWheelUrl from '../pypi/piplite-0.
|
|
4
|
-
export * as pyodide_kernelWheelUrl from '../pypi/pyodide_kernel-0.
|
|
3
|
+
export * as pipliteWheelUrl from '../pypi/piplite-0.9.0a1-py3-none-any.whl';
|
|
4
|
+
export * as pyodide_kernelWheelUrl from '../pypi/pyodide_kernel-0.9.0a1-py3-none-any.whl';
|
|
5
5
|
export * as widgetsnbextensionWheelUrl from '../pypi/widgetsnbextension-3.6.999-py3-none-any.whl';
|
|
6
6
|
export * as widgetsnbextensionWheelUrl1 from '../pypi/widgetsnbextension-4.0.999-py3-none-any.whl';
|
package/lib/_pypi.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// this file is autogenerated from the wheels described in ../package.json
|
|
2
2
|
export * as allJSONUrl from '../pypi/all.json';
|
|
3
3
|
export * as ipykernelWheelUrl from '../pypi/ipykernel-6.9.2-py3-none-any.whl';
|
|
4
|
-
export * as pipliteWheelUrl from '../pypi/piplite-0.
|
|
5
|
-
export * as pyodide_kernelWheelUrl from '../pypi/pyodide_kernel-0.
|
|
4
|
+
export * as pipliteWheelUrl from '../pypi/piplite-0.9.0a1-py3-none-any.whl';
|
|
5
|
+
export * as pyodide_kernelWheelUrl from '../pypi/pyodide_kernel-0.9.0a1-py3-none-any.whl';
|
|
6
6
|
export * as widgetsnbextensionWheelUrl from '../pypi/widgetsnbextension-3.6.999-py3-none-any.whl';
|
|
7
7
|
export * as widgetsnbextensionWheelUrl1 from '../pypi/widgetsnbextension-4.0.999-py3-none-any.whl';
|
package/lib/coincident.worker.js
CHANGED
|
@@ -1,19 +1,14 @@
|
|
|
1
|
-
var Ze=Object.create;var he=Object.defineProperty;var Qe=Object.getOwnPropertyDescriptor;var et=Object.getOwnPropertyNames;var tt=Object.getPrototypeOf,it=Object.prototype.hasOwnProperty;var Me=(u,e)=>()=>(u&&(e=u(u=0)),e);var Se=(u,e)=>()=>(e||u((e={exports:{}}).exports,e),e.exports),nt=(u,e)=>{for(var t in e)he(u,t,{get:e[t],enumerable:!0})},rt=(u,e,t,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let l of et(e))!it.call(u,l)&&l!==t&&he(u,l,{get:()=>e[l],enumerable:!(o=Qe(e,l))||o.enumerable});return u};var st=(u,e,t)=>(t=u!=null?Ze(tt(u)):{},rt(e||!u||!u.__esModule?he(t,"default",{value:u,enumerable:!0}):t,u));var Fe=Se((oe,Ce)=>{(function(u,e){typeof oe=="object"&&typeof Ce!="undefined"?e(oe):typeof define=="function"&&define.amd?define(["exports"],e):(u=typeof globalThis!="undefined"?globalThis:u||self,e(u.lumino_algorithm={}))})(oe,function(u){"use strict";u.ArrayExt=void 0,function(d){function p(f,h,n=0,i=-1){let r=f.length;if(r===0)return-1;n<0?n=Math.max(0,n+r):n=Math.min(n,r-1),i<0?i=Math.max(0,i+r):i=Math.min(i,r-1);let m;i<n?m=i+1+(r-n):m=i-n+1;for(let P=0;P<m;++P){let C=(n+P)%r;if(f[C]===h)return C}return-1}d.firstIndexOf=p;function _(f,h,n=-1,i=0){let r=f.length;if(r===0)return-1;n<0?n=Math.max(0,n+r):n=Math.min(n,r-1),i<0?i=Math.max(0,i+r):i=Math.min(i,r-1);let m;n<i?m=n+1+(r-i):m=n-i+1;for(let P=0;P<m;++P){let C=(n-P+r)%r;if(f[C]===h)return C}return-1}d.lastIndexOf=_;function y(f,h,n=0,i=-1){let r=f.length;if(r===0)return-1;n<0?n=Math.max(0,n+r):n=Math.min(n,r-1),i<0?i=Math.max(0,i+r):i=Math.min(i,r-1);let m;i<n?m=i+1+(r-n):m=i-n+1;for(let P=0;P<m;++P){let C=(n+P)%r;if(h(f[C],C))return C}return-1}d.findFirstIndex=y;function x(f,h,n=-1,i=0){let r=f.length;if(r===0)return-1;n<0?n=Math.max(0,n+r):n=Math.min(n,r-1),i<0?i=Math.max(0,i+r):i=Math.min(i,r-1);let m;n<i?m=n+1+(r-i):m=n-i+1;for(let P=0;P<m;++P){let C=(n-P+r)%r;if(h(f[C],C))return C}return-1}d.findLastIndex=x;function U(f,h,n=0,i=-1){let r=y(f,h,n,i);return r!==-1?f[r]:void 0}d.findFirstValue=U;function I(f,h,n=-1,i=0){let r=x(f,h,n,i);return r!==-1?f[r]:void 0}d.findLastValue=I;function N(f,h,n,i=0,r=-1){let m=f.length;if(m===0)return 0;i<0?i=Math.max(0,i+m):i=Math.min(i,m-1),r<0?r=Math.max(0,r+m):r=Math.min(r,m-1);let P=i,C=r-i+1;for(;C>0;){let Y=C>>1,te=P+Y;n(f[te],h)<0?(P=te+1,C-=Y+1):C=Y}return P}d.lowerBound=N;function $(f,h,n,i=0,r=-1){let m=f.length;if(m===0)return 0;i<0?i=Math.max(0,i+m):i=Math.min(i,m-1),r<0?r=Math.max(0,r+m):r=Math.min(r,m-1);let P=i,C=r-i+1;for(;C>0;){let Y=C>>1,te=P+Y;n(f[te],h)>0?C=Y:(P=te+1,C-=Y+1)}return P}d.upperBound=$;function j(f,h,n){if(f===h)return!0;if(f.length!==h.length)return!1;for(let i=0,r=f.length;i<r;++i)if(n?!n(f[i],h[i]):f[i]!==h[i])return!1;return!0}d.shallowEqual=j;function H(f,h={}){let{start:n,stop:i,step:r}=h;if(r===void 0&&(r=1),r===0)throw new Error("Slice `step` cannot be zero.");let m=f.length;n===void 0?n=r<0?m-1:0:n<0?n=Math.max(n+m,r<0?-1:0):n>=m&&(n=r<0?m-1:m),i===void 0?i=r<0?-1:m:i<0?i=Math.max(i+m,r<0?-1:0):i>=m&&(i=r<0?m-1:m);let P;r<0&&i>=n||r>0&&n>=i?P=0:r<0?P=Math.floor((i-n+1)/r+1):P=Math.floor((i-n-1)/r+1);let C=[];for(let Y=0;Y<P;++Y)C[Y]=f[n+Y*r];return C}d.slice=H;function z(f,h,n){let i=f.length;if(i<=1||(h<0?h=Math.max(0,h+i):h=Math.min(h,i-1),n<0?n=Math.max(0,n+i):n=Math.min(n,i-1),h===n))return;let r=f[h],m=h<n?1:-1;for(let P=h;P!==n;P+=m)f[P]=f[P+m];f[n]=r}d.move=z;function V(f,h=0,n=-1){let i=f.length;if(!(i<=1))for(h<0?h=Math.max(0,h+i):h=Math.min(h,i-1),n<0?n=Math.max(0,n+i):n=Math.min(n,i-1);h<n;){let r=f[h],m=f[n];f[h++]=m,f[n--]=r}}d.reverse=V;function G(f,h,n=0,i=-1){let r=f.length;if(r<=1||(n<0?n=Math.max(0,n+r):n=Math.min(n,r-1),i<0?i=Math.max(0,i+r):i=Math.min(i,r-1),n>=i))return;let m=i-n+1;if(h>0?h=h%m:h<0&&(h=(h%m+m)%m),h===0)return;let P=n+h;V(f,n,P-1),V(f,P,i),V(f,n,i)}d.rotate=G;function X(f,h,n=0,i=-1){let r=f.length;if(r===0)return;n<0?n=Math.max(0,n+r):n=Math.min(n,r-1),i<0?i=Math.max(0,i+r):i=Math.min(i,r-1);let m;i<n?m=i+1+(r-n):m=i-n+1;for(let P=0;P<m;++P)f[(n+P)%r]=h}d.fill=X;function Ke(f,h,n){let i=f.length;h<0?h=Math.max(0,h+i):h=Math.min(h,i);for(let r=i;r>h;--r)f[r]=f[r-1];f[h]=n}d.insert=Ke;function ee(f,h){let n=f.length;if(h<0&&(h+=n),h<0||h>=n)return;let i=f[h];for(let r=h+1;r<n;++r)f[r-1]=f[r];return f.length=n-1,i}d.removeAt=ee;function Be(f,h,n=0,i=-1){let r=p(f,h,n,i);return r!==-1&&ee(f,r),r}d.removeFirstOf=Be;function Ve(f,h,n=-1,i=0){let r=_(f,h,n,i);return r!==-1&&ee(f,r),r}d.removeLastOf=Ve;function Ye(f,h,n=0,i=-1){let r=f.length;if(r===0)return 0;n<0?n=Math.max(0,n+r):n=Math.min(n,r-1),i<0?i=Math.max(0,i+r):i=Math.min(i,r-1);let m=0;for(let P=0;P<r;++P)n<=i&&P>=n&&P<=i&&f[P]===h||i<n&&(P<=i||P>=n)&&f[P]===h?m++:m>0&&(f[P-m]=f[P]);return m>0&&(f.length=r-m),m}d.removeAllOf=Ye;function Ge(f,h,n=0,i=-1){let r,m=y(f,h,n,i);return m!==-1&&(r=ee(f,m)),{index:m,value:r}}d.removeFirstWhere=Ge;function Je(f,h,n=-1,i=0){let r,m=x(f,h,n,i);return m!==-1&&(r=ee(f,m)),{index:m,value:r}}d.removeLastWhere=Je;function Xe(f,h,n=0,i=-1){let r=f.length;if(r===0)return 0;n<0?n=Math.max(0,n+r):n=Math.min(n,r-1),i<0?i=Math.max(0,i+r):i=Math.min(i,r-1);let m=0;for(let P=0;P<r;++P)n<=i&&P>=n&&P<=i&&h(f[P],P)||i<n&&(P<=i||P>=n)&&h(f[P],P)?m++:m>0&&(f[P-m]=f[P]);return m>0&&(f.length=r-m),m}d.removeAllWhere=Xe}(u.ArrayExt||(u.ArrayExt={}));function*e(...d){for(let p of d)yield*p}function*t(){}function*o(d,p=0){for(let _ of d)yield[p++,_]}function*l(d,p){let _=0;for(let y of d)p(y,_++)&&(yield y)}function c(d,p){let _=0;for(let y of d)if(p(y,_++))return y}function v(d,p){let _=0;for(let y of d)if(p(y,_++))return _-1;return-1}function k(d,p){let _;for(let y of d){if(_===void 0){_=y;continue}p(y,_)<0&&(_=y)}return _}function F(d,p){let _;for(let y of d){if(_===void 0){_=y;continue}p(y,_)>0&&(_=y)}return _}function M(d,p){let _=!0,y,x;for(let U of d)_?(y=U,x=U,_=!1):p(U,y)<0?y=U:p(U,x)>0&&(x=U);return _?void 0:[y,x]}function a(d){return Array.from(d)}function s(d){let p={};for(let[_,y]of d)p[_]=y;return p}function g(d,p){let _=0;for(let y of d)if(p(y,_++)===!1)return}function E(d,p){let _=0;for(let y of d)if(p(y,_++)===!1)return!1;return!0}function b(d,p){let _=0;for(let y of d)if(p(y,_++))return!0;return!1}function*T(d,p){let _=0;for(let y of d)yield p(y,_++)}function*S(d,p,_){p===void 0?(p=d,d=0,_=1):_===void 0&&(_=1);let y=D.rangeLength(d,p,_);for(let x=0;x<y;x++)yield d+_*x}var D;(function(d){function p(_,y,x){return x===0?1/0:_>y&&x>0||_<y&&x<0?0:Math.ceil((y-_)/x)}d.rangeLength=p})(D||(D={}));function A(d,p,_){let y=d[Symbol.iterator](),x=0,U=y.next();if(U.done&&_===void 0)throw new TypeError("Reduce of empty iterable with no initial value.");if(U.done)return _;let I=y.next();if(I.done&&_===void 0)return U.value;if(I.done)return p(_,U.value,x++);let N;_===void 0?N=p(U.value,I.value,x++):N=p(p(_,U.value,x++),I.value,x++);let $;for(;!($=y.next()).done;)N=p(N,$.value,x++);return N}function*w(d,p){for(;0<p--;)yield d}function*R(d){yield d}function*O(d){if(typeof d.retro=="function")yield*d.retro();else for(let p=d.length-1;p>-1;p--)yield d[p]}function L(d){let p=[],_=new Set,y=new Map;for(let I of d)x(I);for(let[I]of y)U(I);return p;function x(I){let[N,$]=I,j=y.get($);j?j.push(N):y.set($,[N])}function U(I){if(_.has(I))return;_.add(I);let N=y.get(I);if(N)for(let $ of N)U($);p.push(I)}}function*K(d,p){let _=0;for(let y of d)_++%p===0&&(yield y)}u.StringExt=void 0,function(d){function p(I,N,$=0){let j=new Array(N.length);for(let H=0,z=$,V=N.length;H<V;++H,++z){if(z=I.indexOf(N[H],z),z===-1)return null;j[H]=z}return j}d.findIndices=p;function _(I,N,$=0){let j=p(I,N,$);if(!j)return null;let H=0;for(let z=0,V=j.length;z<V;++z){let G=j[z]-$;H+=G*G}return{score:H,indices:j}}d.matchSumOfSquares=_;function y(I,N,$=0){let j=p(I,N,$);if(!j)return null;let H=0,z=$-1;for(let V=0,G=j.length;V<G;++V){let X=j[V];H+=X-z-1,z=X}return{score:H,indices:j}}d.matchSumOfDeltas=y;function x(I,N,$){let j=[],H=0,z=0,V=N.length;for(;H<V;){let G=N[H],X=N[H];for(;++H<V&&N[H]===X+1;)X++;z<G&&j.push(I.slice(z,G)),G<X+1&&j.push($(I.slice(G,X+1))),z=X+1}return z<I.length&&j.push(I.slice(z)),j}d.highlight=x;function U(I,N){return I<N?-1:I>N?1:0}d.cmp=U}(u.StringExt||(u.StringExt={}));function*W(d,p){if(p<1)return;let _=d[Symbol.iterator](),y;for(;0<p--&&!(y=_.next()).done;)yield y.value}function*J(...d){let p=d.map(y=>y[Symbol.iterator]()),_=p.map(y=>y.next());for(;E(_,y=>!y.done);_=p.map(y=>y.next()))yield _.map(y=>y.value)}u.chain=e,u.each=g,u.empty=t,u.enumerate=o,u.every=E,u.filter=l,u.find=c,u.findIndex=v,u.map=T,u.max=F,u.min=k,u.minmax=M,u.once=R,u.range=S,u.reduce=A,u.repeat=w,u.retro=O,u.some=b,u.stride=K,u.take=W,u.toArray=a,u.toObject=s,u.topologicSort=L,u.zip=J})});var We=Se((le,Le)=>{(function(u,e){typeof le=="object"&&typeof Le!="undefined"?e(le,Fe()):typeof define=="function"&&define.amd?define(["exports","@lumino/algorithm"],e):(u=typeof globalThis!="undefined"?globalThis:u||self,e(u.lumino_coreutils={},u.lumino_algorithm))})(le,function(u,e){"use strict";u.JSONExt=void 0,function(M){M.emptyObject=Object.freeze({}),M.emptyArray=Object.freeze([]);function a(w){return w===null||typeof w=="boolean"||typeof w=="number"||typeof w=="string"}M.isPrimitive=a;function s(w){return Array.isArray(w)}M.isArray=s;function g(w){return!a(w)&&!s(w)}M.isObject=g;function E(w,R){if(w===R)return!0;if(a(w)||a(R))return!1;let O=s(w),L=s(R);return O!==L?!1:O&&L?T(w,R):S(w,R)}M.deepEqual=E;function b(w){return a(w)?w:s(w)?D(w):A(w)}M.deepCopy=b;function T(w,R){if(w===R)return!0;if(w.length!==R.length)return!1;for(let O=0,L=w.length;O<L;++O)if(!E(w[O],R[O]))return!1;return!0}function S(w,R){if(w===R)return!0;for(let O in w)if(w[O]!==void 0&&!(O in R))return!1;for(let O in R)if(R[O]!==void 0&&!(O in w))return!1;for(let O in w){let L=w[O],K=R[O];if(!(L===void 0&&K===void 0)&&(L===void 0||K===void 0||!E(L,K)))return!1}return!0}function D(w){let R=new Array(w.length);for(let O=0,L=w.length;O<L;++O)R[O]=b(w[O]);return R}function A(w){let R={};for(let O in w){let L=w[O];L!==void 0&&(R[O]=b(L))}return R}}(u.JSONExt||(u.JSONExt={}));class t{constructor(){this._types=[],this._values=[]}types(){return this._types.slice()}hasData(a){return this._types.indexOf(a)!==-1}getData(a){let s=this._types.indexOf(a);return s!==-1?this._values[s]:void 0}setData(a,s){this.clearData(a),this._types.push(a),this._values.push(s)}clearData(a){let s=this._types.indexOf(a);s!==-1&&(this._types.splice(s,1),this._values.splice(s,1))}clear(){this._types.length=0,this._values.length=0}}class o{constructor(a={}){this._application=null,this._validatePlugin=()=>!0,this._plugins=new Map,this._services=new Map,a.validatePlugin&&(console.info("Plugins may be rejected by the custom validation plugin method."),this._validatePlugin=a.validatePlugin)}get application(){return this._application}set application(a){if(this._application!==null)throw Error("PluginRegistry.application is already set. It cannot be overridden.");this._application=a}get deferredPlugins(){return Array.from(this._plugins).filter(([a,s])=>s.autoStart==="defer").map(([a,s])=>a)}getPluginDescription(a){var s,g;return(g=(s=this._plugins.get(a))===null||s===void 0?void 0:s.description)!==null&&g!==void 0?g:""}hasPlugin(a){return this._plugins.has(a)}isPluginActivated(a){var s,g;return(g=(s=this._plugins.get(a))===null||s===void 0?void 0:s.activated)!==null&&g!==void 0?g:!1}listPlugins(){return Array.from(this._plugins.keys())}registerPlugin(a){if(this._plugins.has(a.id))throw new TypeError(`Plugin '${a.id}' is already registered.`);if(!this._validatePlugin(a))throw new Error(`Plugin '${a.id}' is not valid.`);let s=l.createPluginData(a);l.ensureNoCycle(s,this._plugins,this._services),s.provides&&this._services.set(s.provides,s.id),this._plugins.set(s.id,s)}registerPlugins(a){for(let s of a)this.registerPlugin(s)}deregisterPlugin(a,s){let g=this._plugins.get(a);if(g){if(g.activated&&!s)throw new Error(`Plugin '${a}' is still active.`);this._plugins.delete(a)}}async activatePlugin(a){let s=this._plugins.get(a);if(!s)throw new ReferenceError(`Plugin '${a}' is not registered.`);if(s.activated)return;if(s.promise)return s.promise;let g=s.requires.map(b=>this.resolveRequiredService(b)),E=s.optional.map(b=>this.resolveOptionalService(b));return s.promise=Promise.all([...g,...E]).then(b=>s.activate.apply(void 0,[this.application,...b])).then(b=>{s.service=b,s.activated=!0,s.promise=null}).catch(b=>{throw s.promise=null,b}),s.promise}async activatePlugins(a,s={}){switch(a){case"defer":{let g=this.deferredPlugins.filter(E=>this._plugins.get(E).autoStart).map(E=>this.activatePlugin(E));await Promise.all(g);break}case"startUp":{let E=l.collectStartupPlugins(this._plugins,s).map(async b=>{try{return await this.activatePlugin(b)}catch(T){console.error(`Plugin '${b}' failed to activate.`,T)}});await Promise.all(E);break}}}async deactivatePlugin(a){let s=this._plugins.get(a);if(!s)throw new ReferenceError(`Plugin '${a}' is not registered.`);if(!s.activated)return[];if(!s.deactivate)throw new TypeError(`Plugin '${a}'#deactivate() method missing`);let g=l.findDependents(a,this._plugins,this._services),E=g.map(b=>this._plugins.get(b));for(let b of E)if(!b.deactivate)throw new TypeError(`Plugin ${b.id}#deactivate() method missing (depends on ${a})`);for(let b of E){let T=[...b.requires,...b.optional].map(S=>{let D=this._services.get(S);return D?this._plugins.get(D).service:null});await b.deactivate(this.application,...T),b.service=null,b.activated=!1}return g.pop(),g}async resolveRequiredService(a){let s=this._services.get(a);if(!s)throw new TypeError(`No provider for: ${a.name}.`);let g=this._plugins.get(s);return g.activated||await this.activatePlugin(s),g.service}async resolveOptionalService(a){let s=this._services.get(a);if(!s)return null;let g=this._plugins.get(s);if(!g.activated)try{await this.activatePlugin(s)}catch(E){return console.error(E),null}return g.service}}var l;(function(M){class a{constructor(S){var D,A,w,R;this._activated=!1,this._promise=null,this._service=null,this.id=S.id,this.description=(D=S.description)!==null&&D!==void 0?D:"",this.activate=S.activate,this.deactivate=(A=S.deactivate)!==null&&A!==void 0?A:null,this.provides=(w=S.provides)!==null&&w!==void 0?w:null,this.autoStart=(R=S.autoStart)!==null&&R!==void 0?R:!1,this.requires=S.requires?S.requires.slice():[],this.optional=S.optional?S.optional.slice():[]}get activated(){return this._activated}set activated(S){this._activated=S}get service(){return this._service}set service(S){this._service=S}get promise(){return this._promise}set promise(S){this._promise=S}}function s(T){return new a(T)}M.createPluginData=s;function g(T,S,D){let A=[...T.requires,...T.optional],w=O=>{if(O===T.provides)return!0;let L=D.get(O);if(!L)return!1;let K=S.get(L),W=[...K.requires,...K.optional];return W.length===0?!1:(R.push(L),W.some(w)?!0:(R.pop(),!1))};if(!T.provides||A.length===0)return;let R=[T.id];if(A.some(w))throw new ReferenceError(`Cycle detected: ${R.join(" -> ")}.`)}M.ensureNoCycle=g;function E(T,S,D){let A=new Array,w=W=>{let J=S.get(W),d=[...J.requires,...J.optional];A.push(...d.reduce((p,_)=>{let y=D.get(_);return y&&p.push([W,y]),p},[]))};for(let W of S.keys())w(W);let R=A.filter(W=>W[1]===T),O=0;for(;R.length>O;){let W=R.length,J=new Set(R.map(d=>d[0]));for(let d of J)A.filter(p=>p[1]===d).forEach(p=>{R.includes(p)||R.push(p)});O=W}let L=e.topologicSort(R),K=L.findIndex(W=>W===T);return K===-1?[T]:L.slice(0,K+1)}M.findDependents=E;function b(T,S){let D=new Set;for(let A of T.keys())T.get(A).autoStart===!0&&D.add(A);if(S.startPlugins)for(let A of S.startPlugins)D.add(A);if(S.ignorePlugins)for(let A of S.ignorePlugins)D.delete(A);return Array.from(D)}M.collectStartupPlugins=b})(l||(l={}));class c{constructor(){this.promise=new Promise((a,s)=>{this._resolve=a,this._reject=s})}resolve(a){let s=this._resolve;s(a)}reject(a){let s=this._reject;s(a)}}class v{constructor(a,s){this.name=a,this.description=s!=null?s:"",this._tokenStructuralPropertyT=null}}function k(M){let a=0;for(let s=0,g=M.length;s<g;++s)s%4===0&&(a=Math.random()*4294967295>>>0),M[s]=a&255,a>>>=8}u.Random=void 0,function(M){M.getRandomValues=(()=>{let a=typeof window!="undefined"&&(window.crypto||window.msCrypto)||null;return a&&typeof a.getRandomValues=="function"?function(g){return a.getRandomValues(g)}:k})()}(u.Random||(u.Random={}));function F(M){let a=new Uint8Array(16),s=new Array(256);for(let g=0;g<16;++g)s[g]="0"+g.toString(16);for(let g=16;g<256;++g)s[g]=g.toString(16);return function(){return M(a),a[6]=64|a[6]&15,a[8]=128|a[8]&63,s[a[0]]+s[a[1]]+s[a[2]]+s[a[3]]+"-"+s[a[4]]+s[a[5]]+"-"+s[a[6]]+s[a[7]]+"-"+s[a[8]]+s[a[9]]+"-"+s[a[10]]+s[a[11]]+s[a[12]]+s[a[13]]+s[a[14]]+s[a[15]]}}u.UUID=void 0,function(M){M.uuid4=F(u.Random.getRandomValues)}(u.UUID||(u.UUID={})),u.MimeData=t,u.PluginRegistry=o,u.PromiseDelegate=c,u.Token=v})});function je(u){return"node"in u}var qe=Me(()=>{});var $e={};nt($e,{BLOCK_SIZE:()=>mt,ContentsAPI:()=>Q,DRIVE_SEPARATOR:()=>ze,DriveFS:()=>se,DriveFSEmscriptenNodeOps:()=>de,DriveFSEmscriptenStreamOps:()=>ue,ServiceWorkerContentsAPI:()=>ce});var Ue,ze,mt,pt,gt,ae,ue,de,Q,ce,se,Ee=Me(()=>{Ue=st(We());qe();ze=":",mt=4096,pt=new TextEncoder,gt=new TextDecoder("utf-8"),ae={0:!1,1:!0,2:!0,64:!0,65:!0,66:!0,129:!0,193:!0,514:!0,577:!0,578:!0,705:!0,706:!0,1024:!0,1025:!0,1026:!0,1089:!0,1090:!0,1153:!0,1154:!0,1217:!0,1218:!0,4096:!0,4098:!0},ue=class{constructor(e){this.fs=e}open(e){var t;let o=this.fs.realPath(e.node);if(this.fs.FS.isFile(e.node.mode))try{let l=this.fs.API.get(o);e.file=l}catch{let l=(t=e.flags)!==null&&t!==void 0?t:e.shared.flags,c=typeof l=="string"?parseInt(l,10):l;c&=8191;let v=!0;if(c in ae&&(v=ae[c]),v){e.node=this.fs.node_ops.mknod(e.node.parent,e.node.name,e.node.mode,0);let k=this.fs.API.get(o);e.file=k}else throw new this.fs.FS.ErrnoError(this.fs.ERRNO_CODES.ENOENT)}}close(e){var t;if(!this.fs.FS.isFile(e.node.mode)||!e.file)return;let o=this.fs.realPath(e.node),l=(t=e.flags)!==null&&t!==void 0?t:e.shared.flags,c=typeof l=="string"?parseInt(l,10):l;c&=8191;let v=!0;c in ae&&(v=ae[c]),v&&this.fs.API.put(o,e.file),e.file=void 0}read(e,t,o,l,c){if(l<=0||e.file===void 0||c>=(e.file.data.length||0))return 0;let v=Math.min(e.file.data.length-c,l);return t.set(e.file.data.subarray(c,c+v),o),v}write(e,t,o,l,c){var v;if(l<=0||e.file===void 0)return 0;let k=Date.now();if(e.node.timestamp=k,e.node.atime=k,e.node.mtime=k,e.node.ctime=k,c+l>(((v=e.file)===null||v===void 0?void 0:v.data.length)||0)){let F=e.file.data?e.file.data:new Uint8Array;e.file.data=new Uint8Array(c+l),e.file.data.set(F)}return e.file.data.set(t.subarray(o,o+l),c),l}llseek(e,t,o){var l;let c=t;if(o===1)c+=(l=e.position)!==null&&l!==void 0?l:e.shared.position;else if(o===2&&this.fs.FS.isFile(e.node.mode))if(e.file!==void 0)c+=e.file.data.length;else throw new this.fs.FS.ErrnoError(this.fs.ERRNO_CODES.EPERM);if(c<0)throw new this.fs.FS.ErrnoError(this.fs.ERRNO_CODES.EINVAL);return c}},de=class{constructor(e){this.node=t=>je(t)?t.node:t,this.getattr=t=>{let o=this.node(t);return{...this.fs.API.getattr(this.fs.realPath(o)),mode:o.mode,ino:o.id}},this.setattr=(t,o)=>{let l=this.node(t);for(let[c,v]of Object.entries(o))switch(c){case"mode":l.mode=v;break;case"timestamp":l.timestamp=v;break;case"atime":l.atime=v;break;case"mtime":l.mtime=v;break;case"ctime":l.ctime=v;break;case"size":{let k=v,F=this.fs.realPath(l);if(this.fs.FS.isFile(l.mode)&&k>=0){let M;try{M=this.fs.API.get(F)}catch{break}let a=M.data?M.data:new Uint8Array;k!==a.length&&(k<a.length?M.data=M.data.slice(0,k):(M.data=new Uint8Array(k),M.data.set(a)),this.fs.API.put(F,M))}else console.warn("setattr size of",k,"on",l,"not yet implemented");break}case"dontFollow":break;default:console.warn("setattr",c,"of",v,"on",l,"not yet implemented");break}},this.lookup=(t,o)=>{let l=this.node(t),c=this.fs.PATH.join2(this.fs.realPath(l),o),v=this.fs.API.lookup(c);if(!v.ok)throw new this.fs.FS.ErrnoError(this.fs.ERRNO_CODES.ENOENT);return this.fs.createNode(l,o,v.mode,0)},this.mknod=(t,o,l,c)=>{let v=this.node(t),k=this.fs.PATH.join2(this.fs.realPath(v),o);return this.fs.API.mknod(k,l),this.fs.createNode(v,o,l,c)},this.rename=(t,o,l)=>{let c=this.node(t),v=this.node(o);this.fs.API.rename(c.parent?this.fs.PATH.join2(this.fs.realPath(c.parent),c.name):c.name,this.fs.PATH.join2(this.fs.realPath(v),l)),c.name=l,c.parent=v},this.unlink=(t,o)=>this.fs.API.rmdir(this.fs.PATH.join2(this.fs.realPath(this.node(t)),o)),this.rmdir=(t,o)=>this.fs.API.rmdir(this.fs.PATH.join2(this.fs.realPath(this.node(t)),o)),this.readdir=t=>this.fs.API.readdir(this.fs.realPath(this.node(t))),this.symlink=(t,o,l)=>{throw new this.fs.FS.ErrnoError(this.fs.ERRNO_CODES.EPERM)},this.readlink=t=>{throw new this.fs.FS.ErrnoError(this.fs.ERRNO_CODES.EINVAL)},this.fs=e}},Q=class{constructor(e){this._driveName=e.driveName,this._mountpoint=e.mountpoint,this.FS=e.FS,this.ERRNO_CODES=e.ERRNO_CODES}lookup(e){return this.request({method:"lookup",path:this.normalizePath(e)})}getmode(e){return this.request({method:"getmode",path:this.normalizePath(e)})}mknod(e,t){return this.request({method:"mknod",path:this.normalizePath(e),data:{mode:t}})}rename(e,t){return this.request({method:"rename",path:this.normalizePath(e),data:{newPath:this.normalizePath(t)}})}readdir(e){let t=this.request({method:"readdir",path:this.normalizePath(e)});return t.push("."),t.push(".."),t}rmdir(e){return this.request({method:"rmdir",path:this.normalizePath(e)})}get(e){let t=this.request({method:"get",path:this.normalizePath(e)});if(!t)throw new this.FS.ErrnoError(this.ERRNO_CODES.ENOENT);let o=t.content,l=t.format;switch(l){case"json":case"text":return{data:pt.encode(o),format:l};case"base64":{let c=atob(o),v=c.length,k=new Uint8Array(v);for(let F=0;F<v;F++)k[F]=c.charCodeAt(F);return{data:k,format:l}}default:throw new this.FS.ErrnoError(this.ERRNO_CODES.ENOENT)}}put(e,t){switch(t.format){case"json":case"text":return this.request({method:"put",path:this.normalizePath(e),data:{format:t.format,data:gt.decode(t.data)}});case"base64":{let o="";for(let l=0;l<t.data.byteLength;l++)o+=String.fromCharCode(t.data[l]);return this.request({method:"put",path:this.normalizePath(e),data:{format:t.format,data:btoa(o)}})}}}getattr(e){let t=this.request({method:"getattr",path:this.normalizePath(e)}),o=new Date(0);return t.atime=t.atime?new Date(t.atime):o,t.mtime=t.mtime?new Date(t.mtime):o,t.ctime=t.ctime?new Date(t.ctime):o,t.size=t.size||0,t}normalizePath(e){return e.startsWith(this._mountpoint)&&(e=e.slice(this._mountpoint.length)),this._driveName&&(e=`${this._driveName}${ze}${e}`),e}},ce=class extends Q{constructor(e){super(e),this._baseUrl=e.baseUrl,this._browsingContextId=e.browsingContextId||""}request(e){let t=new XMLHttpRequest;t.open("POST",encodeURI(this.endpoint),!1);let o=Ue.UUID.uuid4(),l={data:{...e,requestId:o},browsingContextId:this._browsingContextId,requestId:o};try{t.send(JSON.stringify(l))}catch(c){console.error(c)}if(t.status>=400)throw new this.FS.ErrnoError(this.ERRNO_CODES.EINVAL);return JSON.parse(t.responseText)}get endpoint(){return`${this._baseUrl}api/drive`}},se=class{constructor(e){this.FS=e.FS,this.PATH=e.PATH,this.ERRNO_CODES=e.ERRNO_CODES,this.API=this.createAPI(e),this.driveName=e.driveName,this.node_ops=new de(this),this.stream_ops=new ue(this)}createAPI(e){if(!e.browsingContextId||!e.baseUrl)throw new Error("Cannot create service-worker API without current browsingContextId");return new ce(e)}mount(e){return this.createNode(null,e.mountpoint,16895,0)}createNode(e,t,o,l){let c=this.FS;if(!c.isDir(o)&&!c.isFile(o))throw new c.ErrnoError(this.ERRNO_CODES.EINVAL);let v=c.createNode(e,t,o,l);return v.node_ops=this.node_ops,v.stream_ops=this.stream_ops,v}getMode(e){return this.API.getmode(e)}realPath(e){let t=[],o=e;for(t.push(o.name);o.parent!==o;)o=o.parent,t.push(o.name);return t.reverse(),this.PATH.join.apply(null,t)}}});var me="function";var Z="64e10b34-2bf7-4616-9668-f99de5aa046e",wt="M"+Z,Et="T"+Z;var Oe="get";var Ie="has";var Te="set";var{isArray:ie}=Array,{SharedArrayBuffer:ne,window:ot}=globalThis,{notify:pe,wait:ge,waitAsync:re}=Atomics,_e=null;re||(re=u=>({value:new Promise(e=>{let t=new Worker("data:application/javascript,onmessage%3D(%7Bdata%3Ab%7D)%3D%3E(Atomics.wait(b%2C0)%2CpostMessage(0))");t.onmessage=e,t.postMessage(u)})}));try{new ne(4)}catch{ne=ArrayBuffer;let e=new WeakMap;if(ot){let t=new Map,{prototype:{postMessage:o}}=Worker,l=c=>{var k;let v=(k=c.data)==null?void 0:k[Z];if(!ie(v)){c.stopImmediatePropagation();let{id:F,sb:M}=v;t.get(F)(M)}};_e=function(c,...v){let k=c==null?void 0:c[Z];if(ie(k)){let[F,M]=k;e.set(M,F),this.addEventListener("message",l)}return o.call(this,c,...v)},re=c=>({value:new Promise(v=>{t.set(e.get(c),v)}).then(v=>{t.delete(e.get(c)),e.delete(c);for(let k=0;k<v.length;k++)c[k]=v[k];return"ok"})})}else{let t=(o,l)=>({[Z]:{id:o,sb:l}});pe=o=>{postMessage(t(e.get(o),o))},addEventListener("message",o=>{var c;let l=(c=o.data)==null?void 0:c[Z];if(ie(l)){let[v,k]=l;e.set(k,v)}})}}var{Int32Array:ve,Map:Ne,Uint16Array:Pe}=globalThis,{BYTES_PER_ELEMENT:De}=ve,{BYTES_PER_ELEMENT:lt}=Pe,at=(u,e,t)=>{for(;ge(u,0,0,e)==="timed-out";)t()},we=new WeakSet,ye=new WeakMap,ut={value:{then:u=>u()}},dt=0,Ae=(u,{parse:e=JSON.parse,stringify:t=JSON.stringify,transform:o,interrupt:l}=JSON)=>{if(!ye.has(u)){let c=_e||u.postMessage,v=(g,...E)=>c.call(u,{[Z]:E},{transfer:g}),k=typeof l===me?l:l==null?void 0:l.handler,F=(l==null?void 0:l.delay)||42,M=new TextDecoder("utf-16"),a=(g,E)=>g?re(E,0):(k?at(E,F,k):ge(E,0),ut),s=!1;ye.set(u,new Proxy(new Ne,{[Ie]:(g,E)=>typeof E=="string"&&!E.startsWith("_"),[Oe]:(g,E)=>E==="then"?null:(...b)=>{let T=dt++,S=new ve(new ne(De*2)),D=[];we.has(b.at(-1)||D)&&we.delete(D=b.pop()),v(D,T,S,E,o?b.map(o):b);let A=u!==globalThis,w=0;return s&&A&&(w=setTimeout(console.warn,1e3,`\u{1F480}\u{1F512} - Possible deadlock if proxy.${E}(...args) is awaited`)),a(A,S).value.then(()=>{clearTimeout(w);let R=S[1];if(!R)return;let O=lt*R;return S=new ve(new ne(O+O%De)),v([],T,S),a(A,S).value.then(()=>e(M.decode(new Pe(S.buffer).slice(0,R))))})},[Te](g,E,b){let T=typeof b;if(T!==me)throw new Error(`Unable to assign ${E} as ${T}`);if(!g.size){let S=new Ne;u.addEventListener("message",async D=>{var w;let A=(w=D.data)==null?void 0:w[Z];if(ie(A)){D.stopImmediatePropagation();let[R,O,...L]=A,K;if(L.length){let[W,J]=L;if(g.has(W)){s=!0;try{let d=await g.get(W)(...J);if(d!==void 0){let p=t(o?o(d):d);S.set(R,p),O[1]=p.length}}catch(d){K=d}finally{s=!1}}else K=new Error(`Unsupported action: ${W}`);O[0]=1}else{let W=S.get(R);S.delete(R);for(let J=new Pe(O.buffer),d=0;d<W.length;d++)J[d]=W.charCodeAt(d)}if(pe(O,0),K)throw K}})}return!!g.set(E,b)}}))}return ye.get(u)};Ae.transfer=(...u)=>(we.add(u),u);var xe=Ae;Ee();async function He(u){return new Function("url","return import(url)")(u)}var fe=class{constructor(){this._options=null;this._initializer=null;this._pyodide=null;this._localPath="";this._driveName="";this._driveFS=null;this._sendWorkerMessage=()=>{};this._logMessage=()=>{};this._initialized=new Promise((e,t)=>{this._initializer={resolve:e,reject:t}})}async initialize(e){var t;if(this._options=e,e.location.includes(":")){let o=e.location.split(":");this._driveName=o[0],this._localPath=o[1]}else this._driveName="",this._localPath=e.location;await this.initRuntime(e),await this.initFilesystem(e),await this.initPackageManager(e),await this.initKernel(e),await this.initGlobals(e),(t=this._initializer)==null||t.resolve()}async initRuntime(e){let{pyodideUrl:t,indexUrl:o}=e,{loadPyodide:l}=await He(t);this._pyodide=await l({indexURL:o,stdout:c=>{console.log(c),this._logMessage({type:"text",level:"info",data:c})},stderr:c=>{console.error(c),this._logMessage({type:"text",level:"critical",data:c})},...e.loadPyodideOptions}),this._pyodide._api.on_fatal=async c=>{let v="";c.name==="Exit"?v="Pyodide has exited and can no longer be used.":v=`Pyodide has suffered a fatal error. Please report this to the Pyodide maintainers.
|
|
2
|
-
The cause of the error was: ${
|
|
3
|
-
${
|
|
1
|
+
var en=Object.create;var Me=Object.defineProperty;var tn=Object.getOwnPropertyDescriptor;var nn=Object.getOwnPropertyNames;var rn=Object.getPrototypeOf,sn=Object.prototype.hasOwnProperty;var Be=(n,e)=>()=>(n&&(e=n(n=0)),e);var je=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports),on=(n,e)=>{for(var t in e)Me(n,t,{get:e[t],enumerable:!0})},an=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of nn(e))!sn.call(n,a)&&a!==t&&Me(n,a,{get:()=>e[a],enumerable:!(i=tn(e,a))||i.enumerable});return n};var ln=(n,e,t)=>(t=n!=null?en(rn(n)):{},an(e||!n||!n.__esModule?Me(t,"default",{value:n,enumerable:!0}):t,n));var Lt=je((_e,Ut)=>{(function(n,e){typeof _e=="object"&&typeof Ut<"u"?e(_e):typeof define=="function"&&define.amd?define(["exports"],e):(n=typeof globalThis<"u"?globalThis:n||self,e(n.lumino_algorithm={}))})(_e,function(n){"use strict";n.ArrayExt=void 0,function(f){function y(h,m,s=0,r=-1){let c=h.length;if(c===0)return-1;s<0?s=Math.max(0,s+c):s=Math.min(s,c-1),r<0?r=Math.max(0,r+c):r=Math.min(r,c-1);let p;r<s?p=r+1+(c-s):p=r-s+1;for(let P=0;P<p;++P){let U=(s+P)%c;if(h[U]===m)return U}return-1}f.firstIndexOf=y;function _(h,m,s=-1,r=0){let c=h.length;if(c===0)return-1;s<0?s=Math.max(0,s+c):s=Math.min(s,c-1),r<0?r=Math.max(0,r+c):r=Math.min(r,c-1);let p;s<r?p=s+1+(c-r):p=s-r+1;for(let P=0;P<p;++P){let U=(s-P+c)%c;if(h[U]===m)return U}return-1}f.lastIndexOf=_;function v(h,m,s=0,r=-1){let c=h.length;if(c===0)return-1;s<0?s=Math.max(0,s+c):s=Math.min(s,c-1),r<0?r=Math.max(0,r+c):r=Math.min(r,c-1);let p;r<s?p=r+1+(c-s):p=r-s+1;for(let P=0;P<p;++P){let U=(s+P)%c;if(m(h[U],U))return U}return-1}f.findFirstIndex=v;function C(h,m,s=-1,r=0){let c=h.length;if(c===0)return-1;s<0?s=Math.max(0,s+c):s=Math.min(s,c-1),r<0?r=Math.max(0,r+c):r=Math.min(r,c-1);let p;s<r?p=s+1+(c-r):p=s-r+1;for(let P=0;P<p;++P){let U=(s-P+c)%c;if(m(h[U],U))return U}return-1}f.findLastIndex=C;function $(h,m,s=0,r=-1){let c=v(h,m,s,r);return c!==-1?h[c]:void 0}f.findFirstValue=$;function A(h,m,s=-1,r=0){let c=C(h,m,s,r);return c!==-1?h[c]:void 0}f.findLastValue=A;function T(h,m,s,r=0,c=-1){let p=h.length;if(p===0)return 0;r<0?r=Math.max(0,r+p):r=Math.min(r,p-1),c<0?c=Math.max(0,c+p):c=Math.min(c,p-1);let P=r,U=c-r+1;for(;U>0;){let ee=U>>1,ue=P+ee;s(h[ue],m)<0?(P=ue+1,U-=ee+1):U=ee}return P}f.lowerBound=T;function V(h,m,s,r=0,c=-1){let p=h.length;if(p===0)return 0;r<0?r=Math.max(0,r+p):r=Math.min(r,p-1),c<0?c=Math.max(0,c+p):c=Math.min(c,p-1);let P=r,U=c-r+1;for(;U>0;){let ee=U>>1,ue=P+ee;s(h[ue],m)>0?U=ee:(P=ue+1,U-=ee+1)}return P}f.upperBound=V;function W(h,m,s){if(h===m)return!0;if(h.length!==m.length)return!1;for(let r=0,c=h.length;r<c;++r)if(s?!s(h[r],m[r]):h[r]!==m[r])return!1;return!0}f.shallowEqual=W;function H(h,m={}){let{start:s,stop:r,step:c}=m;if(c===void 0&&(c=1),c===0)throw new Error("Slice `step` cannot be zero.");let p=h.length;s===void 0?s=c<0?p-1:0:s<0?s=Math.max(s+p,c<0?-1:0):s>=p&&(s=c<0?p-1:p),r===void 0?r=c<0?-1:p:r<0?r=Math.max(r+p,c<0?-1:0):r>=p&&(r=c<0?p-1:p);let P;c<0&&r>=s||c>0&&s>=r?P=0:c<0?P=Math.floor((r-s+1)/c+1):P=Math.floor((r-s-1)/c+1);let U=[];for(let ee=0;ee<P;++ee)U[ee]=h[s+ee*c];return U}f.slice=H;function K(h,m,s){let r=h.length;if(r<=1||(m<0?m=Math.max(0,m+r):m=Math.min(m,r-1),s<0?s=Math.max(0,s+r):s=Math.min(s,r-1),m===s))return;let c=h[m],p=m<s?1:-1;for(let P=m;P!==s;P+=p)h[P]=h[P+p];h[s]=c}f.move=K;function J(h,m=0,s=-1){let r=h.length;if(!(r<=1))for(m<0?m=Math.max(0,m+r):m=Math.min(m,r-1),s<0?s=Math.max(0,s+r):s=Math.min(s,r-1);m<s;){let c=h[m],p=h[s];h[m++]=p,h[s--]=c}}f.reverse=J;function te(h,m,s=0,r=-1){let c=h.length;if(c<=1||(s<0?s=Math.max(0,s+c):s=Math.min(s,c-1),r<0?r=Math.max(0,r+c):r=Math.min(r,c-1),s>=r))return;let p=r-s+1;if(m>0?m=m%p:m<0&&(m=(m%p+p)%p),m===0)return;let P=s+m;J(h,s,P-1),J(h,P,r),J(h,s,r)}f.rotate=te;function ne(h,m,s=0,r=-1){let c=h.length;if(c===0)return;s<0?s=Math.max(0,s+c):s=Math.min(s,c-1),r<0?r=Math.max(0,r+c):r=Math.min(r,c-1);let p;r<s?p=r+1+(c-s):p=r-s+1;for(let P=0;P<p;++P)h[(s+P)%c]=m}f.fill=ne;function Ht(h,m,s){let r=h.length;m<0?m=Math.max(0,m+r):m=Math.min(m,r);for(let c=r;c>m;--c)h[c]=h[c-1];h[m]=s}f.insert=Ht;function ce(h,m){let s=h.length;if(m<0&&(m+=s),m<0||m>=s)return;let r=h[m];for(let c=m+1;c<s;++c)h[c-1]=h[c];return h.length=s-1,r}f.removeAt=ce;function Gt(h,m,s=0,r=-1){let c=y(h,m,s,r);return c!==-1&&ce(h,c),c}f.removeFirstOf=Gt;function Yt(h,m,s=-1,r=0){let c=_(h,m,s,r);return c!==-1&&ce(h,c),c}f.removeLastOf=Yt;function Jt(h,m,s=0,r=-1){let c=h.length;if(c===0)return 0;s<0?s=Math.max(0,s+c):s=Math.min(s,c-1),r<0?r=Math.max(0,r+c):r=Math.min(r,c-1);let p=0;for(let P=0;P<c;++P)s<=r&&P>=s&&P<=r&&h[P]===m||r<s&&(P<=r||P>=s)&&h[P]===m?p++:p>0&&(h[P-p]=h[P]);return p>0&&(h.length=c-p),p}f.removeAllOf=Jt;function Xt(h,m,s=0,r=-1){let c,p=v(h,m,s,r);return p!==-1&&(c=ce(h,p)),{index:p,value:c}}f.removeFirstWhere=Xt;function Zt(h,m,s=-1,r=0){let c,p=C(h,m,s,r);return p!==-1&&(c=ce(h,p)),{index:p,value:c}}f.removeLastWhere=Zt;function Qt(h,m,s=0,r=-1){let c=h.length;if(c===0)return 0;s<0?s=Math.max(0,s+c):s=Math.min(s,c-1),r<0?r=Math.max(0,r+c):r=Math.min(r,c-1);let p=0;for(let P=0;P<c;++P)s<=r&&P>=s&&P<=r&&m(h[P],P)||r<s&&(P<=r||P>=s)&&m(h[P],P)?p++:p>0&&(h[P-p]=h[P]);return p>0&&(h.length=c-p),p}f.removeAllWhere=Qt}(n.ArrayExt||(n.ArrayExt={}));function*e(...f){for(let y of f)yield*y}function*t(){}function*i(f,y=0){for(let _ of f)yield[y++,_]}function*a(f,y){let _=0;for(let v of f)y(v,_++)&&(yield v)}function u(f,y){let _=0;for(let v of f)if(y(v,_++))return v}function g(f,y){let _=0;for(let v of f)if(y(v,_++))return _-1;return-1}function I(f,y){let _;for(let v of f){if(_===void 0){_=v;continue}y(v,_)<0&&(_=v)}return _}function D(f,y){let _;for(let v of f){if(_===void 0){_=v;continue}y(v,_)>0&&(_=v)}return _}function R(f,y){let _=!0,v,C;for(let $ of f)_?(v=$,C=$,_=!1):y($,v)<0?v=$:y($,C)>0&&(C=$);return _?void 0:[v,C]}function l(f){return Array.from(f)}function o(f){let y={};for(let[_,v]of f)y[_]=v;return y}function d(f,y){let _=0;for(let v of f)if(y(v,_++)===!1)return}function w(f,y){let _=0;for(let v of f)if(y(v,_++)===!1)return!1;return!0}function E(f,y){let _=0;for(let v of f)if(y(v,_++))return!0;return!1}function*O(f,y){let _=0;for(let v of f)yield y(v,_++)}function*x(f,y,_){y===void 0?(y=f,f=0,_=1):_===void 0&&(_=1);let v=B.rangeLength(f,y,_);for(let C=0;C<v;C++)yield f+_*C}var B;(function(f){function y(_,v,C){return C===0?1/0:_>v&&C>0||_<v&&C<0?0:Math.ceil((v-_)/C)}f.rangeLength=y})(B||(B={}));function j(f,y,_){let v=f[Symbol.iterator](),C=0,$=v.next();if($.done&&_===void 0)throw new TypeError("Reduce of empty iterable with no initial value.");if($.done)return _;let A=v.next();if(A.done&&_===void 0)return $.value;if(A.done)return y(_,$.value,C++);let T;_===void 0?T=y($.value,A.value,C++):T=y(y(_,$.value,C++),A.value,C++);let V;for(;!(V=v.next()).done;)T=y(T,V.value,C++);return T}function*b(f,y){for(;0<y--;)yield f}function*M(f){yield f}function*S(f){if(typeof f.retro=="function")yield*f.retro();else for(let y=f.length-1;y>-1;y--)yield f[y]}function N(f){let y=[],_=new Set,v=new Map;for(let A of f)C(A);for(let[A]of v)$(A);return y;function C(A){let[T,V]=A,W=v.get(V);W?W.push(T):v.set(V,[T])}function $(A){if(_.has(A))return;_.add(A);let T=v.get(A);if(T)for(let V of T)$(V);y.push(A)}}function*Y(f,y){let _=0;for(let v of f)_++%y===0&&(yield v)}n.StringExt=void 0,function(f){function y(A,T,V=0){let W=new Array(T.length);for(let H=0,K=V,J=T.length;H<J;++H,++K){if(K=A.indexOf(T[H],K),K===-1)return null;W[H]=K}return W}f.findIndices=y;function _(A,T,V=0){let W=y(A,T,V);if(!W)return null;let H=0;for(let K=0,J=W.length;K<J;++K){let te=W[K]-V;H+=te*te}return{score:H,indices:W}}f.matchSumOfSquares=_;function v(A,T,V=0){let W=y(A,T,V);if(!W)return null;let H=0,K=V-1;for(let J=0,te=W.length;J<te;++J){let ne=W[J];H+=ne-K-1,K=ne}return{score:H,indices:W}}f.matchSumOfDeltas=v;function C(A,T,V){let W=[],H=0,K=0,J=T.length;for(;H<J;){let te=T[H],ne=T[H];for(;++H<J&&T[H]===ne+1;)ne++;K<te&&W.push(A.slice(K,te)),te<ne+1&&W.push(V(A.slice(te,ne+1))),K=ne+1}return K<A.length&&W.push(A.slice(K)),W}f.highlight=C;function $(A,T){return A<T?-1:A>T?1:0}f.cmp=$}(n.StringExt||(n.StringExt={}));function*z(f,y){if(y<1)return;let _=f[Symbol.iterator](),v;for(;0<y--&&!(v=_.next()).done;)yield v.value}function*Q(...f){let y=f.map(v=>v[Symbol.iterator]()),_=y.map(v=>v.next());for(;w(_,v=>!v.done);_=y.map(v=>v.next()))yield _.map(v=>v.value)}n.chain=e,n.each=d,n.empty=t,n.enumerate=i,n.every=w,n.filter=a,n.find=u,n.findIndex=g,n.map=O,n.max=D,n.min=I,n.minmax=R,n.once=M,n.range=x,n.reduce=j,n.repeat=b,n.retro=S,n.some=E,n.stride=Y,n.take=z,n.toArray=l,n.toObject=o,n.topologicSort=N,n.zip=Q})});var jt=je((ve,Bt)=>{(function(n,e){typeof ve=="object"&&typeof Bt<"u"?e(ve,Lt()):typeof define=="function"&&define.amd?define(["exports","@lumino/algorithm"],e):(n=typeof globalThis<"u"?globalThis:n||self,e(n.lumino_coreutils={},n.lumino_algorithm))})(ve,function(n,e){"use strict";n.JSONExt=void 0,function(R){R.emptyObject=Object.freeze({}),R.emptyArray=Object.freeze([]);function l(b){return b===null||typeof b=="boolean"||typeof b=="number"||typeof b=="string"}R.isPrimitive=l;function o(b){return Array.isArray(b)}R.isArray=o;function d(b){return!l(b)&&!o(b)}R.isObject=d;function w(b,M){if(b===M)return!0;if(l(b)||l(M))return!1;let S=o(b),N=o(M);return S!==N?!1:S&&N?O(b,M):x(b,M)}R.deepEqual=w;function E(b){return l(b)?b:o(b)?B(b):j(b)}R.deepCopy=E;function O(b,M){if(b===M)return!0;if(b.length!==M.length)return!1;for(let S=0,N=b.length;S<N;++S)if(!w(b[S],M[S]))return!1;return!0}function x(b,M){if(b===M)return!0;for(let S in b)if(b[S]!==void 0&&!(S in M))return!1;for(let S in M)if(M[S]!==void 0&&!(S in b))return!1;for(let S in b){let N=b[S],Y=M[S];if(!(N===void 0&&Y===void 0)&&(N===void 0||Y===void 0||!w(N,Y)))return!1}return!0}function B(b){let M=new Array(b.length);for(let S=0,N=b.length;S<N;++S)M[S]=E(b[S]);return M}function j(b){let M={};for(let S in b){let N=b[S];N!==void 0&&(M[S]=E(N))}return M}}(n.JSONExt||(n.JSONExt={}));class t{constructor(){this._types=[],this._values=[]}types(){return this._types.slice()}hasData(l){return this._types.indexOf(l)!==-1}getData(l){let o=this._types.indexOf(l);return o!==-1?this._values[o]:void 0}setData(l,o){this.clearData(l),this._types.push(l),this._values.push(o)}clearData(l){let o=this._types.indexOf(l);o!==-1&&(this._types.splice(o,1),this._values.splice(o,1))}clear(){this._types.length=0,this._values.length=0}}class i{constructor(l={}){this._application=null,this._validatePlugin=()=>!0,this._plugins=new Map,this._services=new Map,l.validatePlugin&&(console.info("Plugins may be rejected by the custom validation plugin method."),this._validatePlugin=l.validatePlugin)}get application(){return this._application}set application(l){if(this._application!==null)throw Error("PluginRegistry.application is already set. It cannot be overridden.");this._application=l}get deferredPlugins(){return Array.from(this._plugins).filter(([l,o])=>o.autoStart==="defer").map(([l,o])=>l)}getPluginDescription(l){var o,d;return(d=(o=this._plugins.get(l))===null||o===void 0?void 0:o.description)!==null&&d!==void 0?d:""}hasPlugin(l){return this._plugins.has(l)}isPluginActivated(l){var o,d;return(d=(o=this._plugins.get(l))===null||o===void 0?void 0:o.activated)!==null&&d!==void 0?d:!1}listPlugins(){return Array.from(this._plugins.keys())}registerPlugin(l){if(this._plugins.has(l.id))throw new TypeError(`Plugin '${l.id}' is already registered.`);if(!this._validatePlugin(l))throw new Error(`Plugin '${l.id}' is not valid.`);let o=a.createPluginData(l);a.ensureNoCycle(o,this._plugins,this._services),o.provides&&this._services.set(o.provides,o.id),this._plugins.set(o.id,o)}registerPlugins(l){for(let o of l)this.registerPlugin(o)}deregisterPlugin(l,o){let d=this._plugins.get(l);if(d){if(d.activated&&!o)throw new Error(`Plugin '${l}' is still active.`);this._plugins.delete(l)}}async activatePlugin(l){let o=this._plugins.get(l);if(!o)throw new ReferenceError(`Plugin '${l}' is not registered.`);if(o.activated)return;if(o.promise)return o.promise;let d=o.requires.map(E=>this.resolveRequiredService(E)),w=o.optional.map(E=>this.resolveOptionalService(E));return o.promise=Promise.all([...d,...w]).then(E=>o.activate.apply(void 0,[this.application,...E])).then(E=>{o.service=E,o.activated=!0,o.promise=null}).catch(E=>{throw o.promise=null,E}),o.promise}async activatePlugins(l,o={}){switch(l){case"defer":{let d=this.deferredPlugins.filter(w=>this._plugins.get(w).autoStart).map(w=>this.activatePlugin(w));await Promise.all(d);break}case"startUp":{let w=a.collectStartupPlugins(this._plugins,o).map(async E=>{try{return await this.activatePlugin(E)}catch(O){console.error(`Plugin '${E}' failed to activate.`,O)}});await Promise.all(w);break}}}async deactivatePlugin(l){let o=this._plugins.get(l);if(!o)throw new ReferenceError(`Plugin '${l}' is not registered.`);if(!o.activated)return[];if(!o.deactivate)throw new TypeError(`Plugin '${l}'#deactivate() method missing`);let d=a.findDependents(l,this._plugins,this._services),w=d.map(E=>this._plugins.get(E));for(let E of w)if(!E.deactivate)throw new TypeError(`Plugin ${E.id}#deactivate() method missing (depends on ${l})`);for(let E of w){let O=[...E.requires,...E.optional].map(x=>{let B=this._services.get(x);return B?this._plugins.get(B).service:null});await E.deactivate(this.application,...O),E.service=null,E.activated=!1}return d.pop(),d}async resolveRequiredService(l){let o=this._services.get(l);if(!o)throw new TypeError(`No provider for: ${l.name}.`);let d=this._plugins.get(o);return d.activated||await this.activatePlugin(o),d.service}async resolveOptionalService(l){let o=this._services.get(l);if(!o)return null;let d=this._plugins.get(o);if(!d.activated)try{await this.activatePlugin(o)}catch(w){return console.error(w),null}return d.service}}var a;(function(R){class l{constructor(x){var B,j,b,M;this._activated=!1,this._promise=null,this._service=null,this.id=x.id,this.description=(B=x.description)!==null&&B!==void 0?B:"",this.activate=x.activate,this.deactivate=(j=x.deactivate)!==null&&j!==void 0?j:null,this.provides=(b=x.provides)!==null&&b!==void 0?b:null,this.autoStart=(M=x.autoStart)!==null&&M!==void 0?M:!1,this.requires=x.requires?x.requires.slice():[],this.optional=x.optional?x.optional.slice():[]}get activated(){return this._activated}set activated(x){this._activated=x}get service(){return this._service}set service(x){this._service=x}get promise(){return this._promise}set promise(x){this._promise=x}}function o(O){return new l(O)}R.createPluginData=o;function d(O,x,B){let j=[...O.requires,...O.optional],b=S=>{if(S===O.provides)return!0;let N=B.get(S);if(!N)return!1;let Y=x.get(N),z=[...Y.requires,...Y.optional];return z.length===0?!1:(M.push(N),z.some(b)?!0:(M.pop(),!1))};if(!O.provides||j.length===0)return;let M=[O.id];if(j.some(b))throw new ReferenceError(`Cycle detected: ${M.join(" -> ")}.`)}R.ensureNoCycle=d;function w(O,x,B){let j=new Array,b=z=>{let Q=x.get(z),f=[...Q.requires,...Q.optional];j.push(...f.reduce((y,_)=>{let v=B.get(_);return v&&y.push([z,v]),y},[]))};for(let z of x.keys())b(z);let M=j.filter(z=>z[1]===O),S=0;for(;M.length>S;){let z=M.length,Q=new Set(M.map(f=>f[0]));for(let f of Q)j.filter(y=>y[1]===f).forEach(y=>{M.includes(y)||M.push(y)});S=z}let N=e.topologicSort(M),Y=N.findIndex(z=>z===O);return Y===-1?[O]:N.slice(0,Y+1)}R.findDependents=w;function E(O,x){let B=new Set;for(let j of O.keys())O.get(j).autoStart===!0&&B.add(j);if(x.startPlugins)for(let j of x.startPlugins)B.add(j);if(x.ignorePlugins)for(let j of x.ignorePlugins)B.delete(j);return Array.from(B)}R.collectStartupPlugins=E})(a||(a={}));class u{constructor(){this.promise=new Promise((l,o)=>{this._resolve=l,this._reject=o})}resolve(l){let o=this._resolve;o(l)}reject(l){let o=this._reject;o(l)}}class g{constructor(l,o){this.name=l,this.description=o??"",this._tokenStructuralPropertyT=null}}function I(R){let l=0;for(let o=0,d=R.length;o<d;++o)o%4===0&&(l=Math.random()*4294967295>>>0),R[o]=l&255,l>>>=8}n.Random=void 0,function(R){R.getRandomValues=(()=>{let l=typeof window<"u"&&(window.crypto||window.msCrypto)||null;return l&&typeof l.getRandomValues=="function"?function(d){return l.getRandomValues(d)}:I})()}(n.Random||(n.Random={}));function D(R){let l=new Uint8Array(16),o=new Array(256);for(let d=0;d<16;++d)o[d]="0"+d.toString(16);for(let d=16;d<256;++d)o[d]=d.toString(16);return function(){return R(l),l[6]=64|l[6]&15,l[8]=128|l[8]&63,o[l[0]]+o[l[1]]+o[l[2]]+o[l[3]]+"-"+o[l[4]]+o[l[5]]+"-"+o[l[6]]+o[l[7]]+"-"+o[l[8]]+o[l[9]]+"-"+o[l[10]]+o[l[11]]+o[l[12]]+o[l[13]]+o[l[14]]+o[l[15]]}}n.UUID=void 0,function(R){R.uuid4=D(n.Random.getRandomValues)}(n.UUID||(n.UUID={})),n.MimeData=t,n.PluginRegistry=i,n.PromiseDelegate=u,n.Token=g})});function Wt(n){return"node"in n}var qt=Be(()=>{});var Kt={};on(Kt,{BLOCK_SIZE:()=>Rn,ContentsAPI:()=>le,DRIVE_SEPARATOR:()=>$t,DriveFS:()=>fe,DriveFSEmscriptenNodeOps:()=>Re,DriveFSEmscriptenStreamOps:()=>Pe,ServiceWorkerContentsAPI:()=>be});var zt,$t,Rn,bn,En,we,Pe,Re,le,be,fe,Fe=Be(()=>{zt=ln(jt());qt();$t=":",Rn=4096,bn=new TextEncoder,En=new TextDecoder("utf-8"),we={0:!1,1:!0,2:!0,64:!0,65:!0,66:!0,129:!0,193:!0,514:!0,577:!0,578:!0,705:!0,706:!0,1024:!0,1025:!0,1026:!0,1089:!0,1090:!0,1153:!0,1154:!0,1217:!0,1218:!0,4096:!0,4098:!0},Pe=class{constructor(e){this.fs=e}open(e){var t;let i=this.fs.realPath(e.node);if(this.fs.FS.isFile(e.node.mode))try{let a=this.fs.API.get(i);e.file=a}catch{let a=(t=e.flags)!==null&&t!==void 0?t:e.shared.flags,u=typeof a=="string"?parseInt(a,10):a;u&=8191;let g=!0;if(u in we&&(g=we[u]),g){e.node=this.fs.node_ops.mknod(e.node.parent,e.node.name,e.node.mode,0);let I=this.fs.API.get(i);e.file=I}else throw new this.fs.FS.ErrnoError(this.fs.ERRNO_CODES.ENOENT)}}close(e){var t;if(!this.fs.FS.isFile(e.node.mode)||!e.file)return;let i=this.fs.realPath(e.node),a=(t=e.flags)!==null&&t!==void 0?t:e.shared.flags,u=typeof a=="string"?parseInt(a,10):a;u&=8191;let g=!0;u in we&&(g=we[u]),g&&this.fs.API.put(i,e.file),e.file=void 0}read(e,t,i,a,u){if(a<=0||e.file===void 0||u>=(e.file.data.length||0))return 0;let g=Math.min(e.file.data.length-u,a);return t.set(e.file.data.subarray(u,u+g),i),g}write(e,t,i,a,u){var g;if(a<=0||e.file===void 0)return 0;let I=Date.now();if(e.node.timestamp=I,e.node.atime=I,e.node.mtime=I,e.node.ctime=I,u+a>(((g=e.file)===null||g===void 0?void 0:g.data.length)||0)){let D=e.file.data?e.file.data:new Uint8Array;e.file.data=new Uint8Array(u+a),e.file.data.set(D)}return e.file.data.set(t.subarray(i,i+a),u),a}llseek(e,t,i){var a;let u=t;if(i===1)u+=(a=e.position)!==null&&a!==void 0?a:e.shared.position;else if(i===2&&this.fs.FS.isFile(e.node.mode))if(e.file!==void 0)u+=e.file.data.length;else throw new this.fs.FS.ErrnoError(this.fs.ERRNO_CODES.EPERM);if(u<0)throw new this.fs.FS.ErrnoError(this.fs.ERRNO_CODES.EINVAL);return u}},Re=class{constructor(e){this.node=t=>Wt(t)?t.node:t,this.getattr=t=>{let i=this.node(t);return{...this.fs.API.getattr(this.fs.realPath(i)),mode:i.mode,ino:i.id}},this.setattr=(t,i)=>{let a=this.node(t);for(let[u,g]of Object.entries(i))switch(u){case"mode":a.mode=g;break;case"timestamp":a.timestamp=g;break;case"atime":a.atime=g;break;case"mtime":a.mtime=g;break;case"ctime":a.ctime=g;break;case"size":{let I=g,D=this.fs.realPath(a);if(this.fs.FS.isFile(a.mode)&&I>=0){let R;try{R=this.fs.API.get(D)}catch{break}let l=R.data?R.data:new Uint8Array;I!==l.length&&(I<l.length?R.data=R.data.slice(0,I):(R.data=new Uint8Array(I),R.data.set(l)),this.fs.API.put(D,R))}else console.warn("setattr size of",I,"on",a,"not yet implemented");break}case"dontFollow":break;default:console.warn("setattr",u,"of",g,"on",a,"not yet implemented");break}},this.lookup=(t,i)=>{let a=this.node(t),u=this.fs.PATH.join2(this.fs.realPath(a),i),g=this.fs.API.lookup(u);if(!g.ok)throw new this.fs.FS.ErrnoError(this.fs.ERRNO_CODES.ENOENT);return this.fs.createNode(a,i,g.mode,0)},this.mknod=(t,i,a,u)=>{let g=this.node(t),I=this.fs.PATH.join2(this.fs.realPath(g),i);return this.fs.API.mknod(I,a),this.fs.createNode(g,i,a,u)},this.rename=(t,i,a)=>{let u=this.node(t),g=this.node(i);this.fs.API.rename(u.parent?this.fs.PATH.join2(this.fs.realPath(u.parent),u.name):u.name,this.fs.PATH.join2(this.fs.realPath(g),a)),u.name=a,u.parent=g},this.unlink=(t,i)=>this.fs.API.rmdir(this.fs.PATH.join2(this.fs.realPath(this.node(t)),i)),this.rmdir=(t,i)=>this.fs.API.rmdir(this.fs.PATH.join2(this.fs.realPath(this.node(t)),i)),this.readdir=t=>this.fs.API.readdir(this.fs.realPath(this.node(t))),this.symlink=(t,i,a)=>{throw new this.fs.FS.ErrnoError(this.fs.ERRNO_CODES.EPERM)},this.readlink=t=>{throw new this.fs.FS.ErrnoError(this.fs.ERRNO_CODES.EINVAL)},this.fs=e}},le=class{constructor(e){this._driveName=e.driveName,this._mountpoint=e.mountpoint,this.FS=e.FS,this.ERRNO_CODES=e.ERRNO_CODES}lookup(e){return this.request({method:"lookup",path:this.normalizePath(e)})}getmode(e){return this.request({method:"getmode",path:this.normalizePath(e)})}mknod(e,t){return this.request({method:"mknod",path:this.normalizePath(e),data:{mode:t}})}rename(e,t){return this.request({method:"rename",path:this.normalizePath(e),data:{newPath:this.normalizePath(t)}})}readdir(e){let t=this.request({method:"readdir",path:this.normalizePath(e)});return t.push("."),t.push(".."),t}rmdir(e){return this.request({method:"rmdir",path:this.normalizePath(e)})}get(e){let t=this.request({method:"get",path:this.normalizePath(e)});if(!t)throw new this.FS.ErrnoError(this.ERRNO_CODES.ENOENT);let i=t.content,a=t.format;switch(a){case"json":case"text":return{data:bn.encode(i),format:a};case"base64":{let u=atob(i),g=u.length,I=new Uint8Array(g);for(let D=0;D<g;D++)I[D]=u.charCodeAt(D);return{data:I,format:a}}default:throw new this.FS.ErrnoError(this.ERRNO_CODES.ENOENT)}}put(e,t){switch(t.format){case"json":case"text":return this.request({method:"put",path:this.normalizePath(e),data:{format:t.format,data:En.decode(t.data)}});case"base64":{let i="";for(let a=0;a<t.data.byteLength;a++)i+=String.fromCharCode(t.data[a]);return this.request({method:"put",path:this.normalizePath(e),data:{format:t.format,data:btoa(i)}})}}}getattr(e){let t=this.request({method:"getattr",path:this.normalizePath(e)}),i=new Date(0);return t.atime=t.atime?new Date(t.atime):i,t.mtime=t.mtime?new Date(t.mtime):i,t.ctime=t.ctime?new Date(t.ctime):i,t.size=t.size||0,t}normalizePath(e){return e.startsWith(this._mountpoint)&&(e=e.slice(this._mountpoint.length)),this._driveName&&(e=`${this._driveName}${$t}${e}`),e}},be=class extends le{constructor(e){super(e),this._baseUrl=e.baseUrl,this._browsingContextId=e.browsingContextId||""}request(e){let t=new XMLHttpRequest;t.open("POST",encodeURI(this.endpoint),!1);let i=zt.UUID.uuid4(),a={data:{...e,requestId:i},browsingContextId:this._browsingContextId,requestId:i};try{t.send(JSON.stringify(a))}catch(u){console.error(u)}if(t.status>=400)throw new this.FS.ErrnoError(this.ERRNO_CODES.EINVAL);return JSON.parse(t.responseText)}get endpoint(){return`${this._baseUrl}api/drive`}},fe=class{constructor(e){this.FS=e.FS,this.PATH=e.PATH,this.ERRNO_CODES=e.ERRNO_CODES,this.API=this.createAPI(e),this.driveName=e.driveName,this.node_ops=new Re(this),this.stream_ops=new Pe(this)}createAPI(e){if(!e.browsingContextId||!e.baseUrl)throw new Error("Cannot create service-worker API without current browsingContextId");return new be(e)}mount(e){return this.createNode(null,e.mountpoint,16895,0)}createNode(e,t,i,a){let u=this.FS;if(!u.isDir(i)&&!u.isFile(i))throw new u.ErrnoError(this.ERRNO_CODES.EINVAL);let g=u.createNode(e,t,i,a);return g.node_ops=this.node_ops,g.stream_ops=this.stream_ops,g}getMode(e){return this.API.getmode(e)}realPath(e){let t=[],i=e;for(t.push(i.name);i.parent!==i;)i=i.parent,t.push(i.name);return t.reverse(),this.PATH.join.apply(null,t)}}});var cn=Promise.withResolvers||function(){var e,t,i=new this((a,u)=>{e=a,t=u});return{resolve:e,reject:t,promise:i}},se=cn.bind(Promise);var We=(n=0)=>{let e=new Int32Array([n]);return()=>e[0]++};var qe=We;var he=(n=e=>e)=>{let e=new Map,t=qe();return[()=>{let i;do i=n(t());while(e.has(i));let a=se();return e.set(i,a),[i,a.promise]},(i,a,u)=>{let g=e.get(i);e.delete(i),u?g?.reject(u):g?.resolve(a)}]};var F=0,ze=F++,$e=F++,Fn=F++,Ke=F++,Ve=F++,He=F++,Ge=F++,Ye=F++,Je=F++,Xe=F++,Ze=F++,Qe=F++,et=F++,tt=F++,nt=F++,it=F++,rt=F++,st=F++,ot=F++,at=F++,lt=F++,ct=F++,ut=F++,dt=F++,ft=F++,ht=F++,mt=F++,pt=F++;var Ie=class{},gt=globalThis.ImageData||Ie;var yt=new TextDecoder,Ln=new TextEncoder;var Wn=new Map(Reflect.ownKeys(Symbol).map(n=>[Symbol[n],`@${String(n)}`]));var xe=n=>{switch(n[0]){case"@":return Symbol[n.slice(1)];case"#":return Symbol.for(n.slice(1));case"!":return Symbol(n.slice(1));default:return Symbol()}};var _t=Object.defineProperty;var Gn=Array.from,vt=Array.isArray,Yn=ArrayBuffer.isView;var wt=new ArrayBuffer(8),de=new DataView(wt),X=new Uint8Array(wt);var Z=(n,e,t)=>(n.set(e,t),t),Se=n=>{X[0]=n[k++],X[1]=n[k++],X[2]=n[k++],X[3]=n[k++],X[4]=n[k++],X[5]=n[k++],X[6]=n[k++],X[7]=n[k++]},re=n=>(X[0]=n[k++],X[1]=n[k++],X[2]=n[k++],X[3]=n[k++],de.getUint32(0,!0)),L=(n,e)=>{switch(n[k++]){case Ve:return Se(n),de.getFloat64(0,!0);case He:return n[k++];case lt:{let t=Z(e,k-1,{});for(let i=0,a=re(n);i<a;i++)t[L(n,e)]=L(n,e);return t}case it:{let t=Z(e,k-1,[]);for(let i=0,a=re(n);i<a;i++)t.push(L(n,e));return t}case dt:{let t=k-1,i=L(n,e);return Z(e,t,new globalThis[i](L(n,e)))}case rt:{let t=k-1,i=re(n);return Z(e,t,n.slice(k,k+=i).buffer)}case tt:{let t=k-1,i=re(n);return Z(e,t,yt.decode(n.slice(k,k+=i)))}case st:return Z(e,k-1,new Date(L(n,e)));case at:{let t=Z(e,k-1,new Map);for(let i=0,a=re(n);i<a;i++)t.set(L(n,e),L(n,e));return t}case ut:{let t=Z(e,k-1,new Set);for(let i=0,a=re(n);i<a;i++)t.add(L(n,e));return t}case ot:{let t=k-1,i=L(n,e),a=L(n,e),u=L(n,e),g=globalThis[i]||Error,I=new g(a);return Z(e,t,_t(I,"stack",{value:u}))}case ft:{let t=k-1,i=L(n,e),a=L(n,e),u=L(n,e),g=L(n,e),I=L(n,e),D={colorSpace:g,pixelFormat:I};return Z(e,t,new gt(i,a,u,D))}case ct:{let t=k-1,i=L(n,e),a=L(n,e);return Z(e,t,new RegExp(i,a))}case ze:return!1;case $e:return!0;case Ge:return NaN;case Ye:return 1/0;case Je:return-1/0;case Xe:return 0;case Ze:return-0;case Ke:return null;case Qe:return Se(n),de.getBigInt64(0,!0);case et:return Se(n),de.getBigUint64(0,!0);case nt:return xe(L(n,e));case pt:return e.get(re(n));case ht:{let t=k-1,i=L(n,e),a=L(n,e);return Z(e,t,new Blob([n.slice(k,k+=a)],{type:i}))}case mt:{let t=k-1,i=L(n,e),a=L(n,e),u=L(n,e);return Z(e,t,new File([u],i,{type:u.type,lastModified:a}))}default:return}},k=0,un=n=>(k=0,L(n,new Map)),Pt=({byteOffset:n=0}={})=>(e,t)=>un(new Uint8Array(t,n,e));var dn=[],ke=new WeakSet,Rt=(n,e)=>{let t=dn;return n&&vt(e.at(-1))&&ke.has(e.at(-1))&&(t=e.pop(),ke.delete(t)),t},bt=(...n)=>(ke.add(n),n);var Et="dc78209b-186c-4f83-80e9-406becb7d9f3";var{SharedArrayBuffer:me}=globalThis,ie=!0;try{new me(4,{maxByteLength:8})}catch{ie=!1,me=class extends ArrayBuffer{get growable(){return super.resizable}grow(t){super.resize(t)}}}var{assign:ui,create:Mt}=Object,It=`coincident-${ie?crypto.randomUUID():Math.random().toString(36).substring(2)}`,hn=2*Int32Array.BYTES_PER_ELEMENT,xt=32767,St=16777216,kt={byteOffset:hn},Ot=async(n,e,t)=>{try{let i=await e[n[1]].apply(null,n[2]);n[1]=t?t(i):i,n[2]=null}catch(i){n[2]=i}},At=(n,e,t)=>{let i=e!=="then";return i&&(n[e]=t),i},pe=n=>{n.stopImmediatePropagation(),n.preventDefault()};var{defineProperty:mn}=Object,[pn,Oe]=he(),[Ae,oe]=pn(),Te=()=>oe,De=()=>{},{Atomics:ae,MessageChannel:Tt,MessagePort:ge,SharedArrayBuffer:Ne,Worker:Dt,postMessage:ye}=globalThis;if(ie)Oe(Ae);else{Ne=me;let n=new Map,e=(t,...i)=>{t.addEventListener(...i)};if("importScripts"in globalThis){De=d=>{n.set(d,null)};let t=d=>{let w=d[0],E=o++;return n.set(w,E),[E,w,d]},i=ye;ye=function(w,E){if(l){let O={ID:w.ID,data:t(w.data)};i(O,E)}else oe.then(()=>this.postMessage(w,E))},ge=class extends ge{postMessage(d,w){l?super.postMessage(t(d),w):oe.then(()=>this.postMessage(d,w))}},e(globalThis,"message",d=>{pe(d),Oe(Ae,d.data)},{once:!0});let{wait:a}=ae,{parse:u}=JSON,g=d=>{let w=new XMLHttpRequest;try{if(w.timeout=3e3,w.open("POST",`${R}?sabayon`,!1),w.setRequestHeader("Content-Type","application/json"),w.send(`["${D}",${n.get(d)}]`),w.status===200)return w;throw w}catch{return w.abort(),g(d)}},I=(d,w)=>(d.set(u(w.responseText)),"ok");ae={wait:(d,...w)=>n.has(d)?I(d,g(d)):a(d,...w)};let D,R,l=!1,o=Math.random();oe=oe.then(d=>{[D,R]=d,l=!0})}else{let t=[It,Math.random()].join("-").replace(/\W/g,"-"),i=new BroadcastChannel(Et);i.onmessage=async R=>{let[l,o,d]=R.data;if(o===t){for(let[w,[E,O]]of n)if(E===d){await O.promise;let x=w.length;for(;x--&&!w[x];);i.postMessage([l,w.slice(0,x+1)]);break}}};let a=R=>{let[l,o,d]=R.data;n.set(o,[l,se()]),mn(R,"data",{value:d})};Tt=class extends Tt{constructor(){super(),e(this.port1,"message",a)}},Dt=class extends Dt{constructor(R,l){super(R,l),super.postMessage([t,g])}};let{notify:u}=ae;ae={notify(R,...l){let o=n.get(R);return o?(o[1].resolve(),0):u(R,...l)}};let g="",I=null,D=(R,l)=>{let o,d=!0;R.getRegistration(g).then(w=>w??R.register(g,l)).then(function w(E){let{controller:O}=R;if(d=d&&!!O,o=E.installing||E.waiting||E.active,o.state==="activated"){if(d){if(O.scriptURL===g)return Oe(Ae);E.unregister()}location.reload()}else e(o,"statechange",()=>w(E),{once:!0})})};Te=(R,l)=>{if(!I){let o=new URL(R,location.href);g=`${o.protocol}//${o.host}${o.pathname}`,D(navigator.serviceWorker,l),I=oe}return I}}}var{setPrototypeOf:yn}=Reflect,{postMessage:Nt}=globalThis,Ft=se(),_n=ge.prototype;addEventListener("message",n=>{pe(n);let[e,t,i]=n.data,[a]=n.ports;t&&(yn(a,_n),e&&(Nt=ye)),Ft.resolve([e,t,i,a])},{once:!0});var Ct=async n=>{let[e,t,i,a]=await Te().then(()=>Ft.promise),u=!!e,g=ie||!!t,I=n?.transform,D=(n?.decoder||Pt)(kt),R=n?.transfer!==!1,l,o,d,w;if(g){let b=t?Ne:SharedArrayBuffer,M=new b(n?.minByteLength||xt,{maxByteLength:n?.maxByteLength||St});l=new Int32Array(M),t?({wait:w}=ae,De(l)):({load:o,pause:d,wait:w}=Atomics,d&&(w=(S,N)=>{do d();while(o(S,N)<1)}))}let[E,O]=he(String),x=new Map,B=Mt(null),j=new Proxy(B,{get(b,M){if(M==="then")return;let S=x.get(M);return S||x.set(M,S=(...N)=>{let Y=Rt(R,N),z=[l,M,I?N.map(I):N];if(g){u?Nt({ID:e,data:z},Y):a.postMessage(z,Y),w(l,0),l[0]=0;let Q=l[1]?D(l[1],l.buffer):void 0;if(Q instanceof Error)throw Q;return Q}else{let[Q,f]=E();return z[0]=Q,a.postMessage(z,Y),f}}),S},set:At});return a.addEventListener("message",async({data:b})=>{typeof b[0]=="string"?O.apply(null,b):(await Ot(b,B,I),a.postMessage(b))}),a.start(),{native:ie,proxy:j,ffi_timeout:i,sync:g,transfer:bt}};Fe();async function Vt(n){return new Function("url","return import(url)")(n)}var Ee=class{constructor(){this._options=null;this._initializer=null;this._pyodide=null;this._localPath="";this._driveName="";this._driveFS=null;this._sendWorkerMessage=()=>{};this._logMessage=()=>{};this._initialized=new Promise((e,t)=>{this._initializer={resolve:e,reject:t}})}async initialize(e){if(this._options=e,e.location.includes(":")){let t=e.location.split(":");this._driveName=t[0],this._localPath=t[1]}else this._driveName="",this._localPath=e.location;await this.initRuntime(e),await this.initFilesystem(e),await this.initPackageManager(e),await this.initKernel(e),await this.initGlobals(e),this._initializer?.resolve()}async initRuntime(e){let{pyodideUrl:t,indexUrl:i}=e,{loadPyodide:a}=await Vt(t);this._pyodide=await a({indexURL:i,stdout:u=>{console.log(u),this._logMessage({type:"text",level:"info",data:u})},stderr:u=>{console.error(u),this._logMessage({type:"text",level:"critical",data:u})},...e.loadPyodideOptions}),this._pyodide._api.on_fatal=async u=>{let g="";u.name==="Exit"?g="Pyodide has exited and can no longer be used.":g=`Pyodide has suffered a fatal error. Please report this to the Pyodide maintainers.
|
|
2
|
+
The cause of the error was: ${u.name}
|
|
3
|
+
${u.message}
|
|
4
4
|
Stack trace:
|
|
5
|
-
${
|
|
5
|
+
${u.stack}`,this._logMessage({type:"text",level:"critical",data:g})}}async initPackageManager(e){if(!this._options)throw new Error("Uninitialized");let{pipliteWheelUrl:t,disablePyPIFallback:i,pipliteUrls:a,loadPyodideOptions:u}=this._options,g=(u||{}).packages||[];g.includes("micropip")||await this._pyodide.loadPackage(["micropip"]),g.includes("piplite")||await this._pyodide.runPythonAsync(`
|
|
6
6
|
import micropip
|
|
7
7
|
await micropip.install('${t}', keep_going=True)
|
|
8
8
|
`),await this._pyodide.runPythonAsync(`
|
|
9
9
|
import piplite.piplite
|
|
10
|
-
piplite.piplite._PIPLITE_DISABLE_PYPI = ${
|
|
11
|
-
piplite.piplite._PIPLITE_URLS = ${JSON.stringify(
|
|
12
|
-
`)}async initKernel(e){let t=(e.loadPyodideOptions||{}).packages||[],
|
|
13
|
-
`))}async initGlobals(e){let{globals:t}=this._pyodide;this._kernel=t.get("pyodide_kernel").kernel_instance.copy(),this._stdout_stream=t.get("pyodide_kernel").stdout_stream.copy(),this._stderr_stream=t.get("pyodide_kernel").stderr_stream.copy(),this._interpreter=this._kernel.interpreter.copy(),this._interpreter.send_comm=this.sendComm.bind(this)}async initFilesystem(e){if(e.mountDrive){let t="/drive",{FS:
|
|
14
|
-
/*! Bundled license information:
|
|
15
|
-
|
|
16
|
-
coincident/esm/index.js:
|
|
17
|
-
(*! (c) Andrea Giammarchi - ISC *)
|
|
18
|
-
*/
|
|
10
|
+
piplite.piplite._PIPLITE_DISABLE_PYPI = ${i?"True":"False"}
|
|
11
|
+
piplite.piplite._PIPLITE_URLS = ${JSON.stringify(a)}
|
|
12
|
+
`)}async initKernel(e){let t=(e.loadPyodideOptions||{}).packages||[],i=["ipykernel","comm","pyodide-kernel","jedi","ipython"],a=[];for(let u of i)t.includes(u)||a.push(`await piplite.install('${u}', keep_going=True)`);a.push("import pyodide_kernel"),e.mountDrive&&this._localPath&&a.push("import os",`os.chdir("${this._localPath}")`),await this._pyodide.runPythonAsync(a.join(`
|
|
13
|
+
`))}async initGlobals(e){let{globals:t}=this._pyodide;this._kernel=t.get("pyodide_kernel").kernel_instance.copy(),this._stdout_stream=t.get("pyodide_kernel").stdout_stream.copy(),this._stderr_stream=t.get("pyodide_kernel").stderr_stream.copy(),this._interpreter=this._kernel.interpreter.copy(),this._interpreter.send_comm=this.sendComm.bind(this)}async initFilesystem(e){if(e.mountDrive){let t="/drive",{FS:i,PATH:a,ERRNO_CODES:u}=this._pyodide,{baseUrl:g}=e,{DriveFS:I}=await Promise.resolve().then(()=>(Fe(),Kt)),D=new I({FS:i,PATH:a,ERRNO_CODES:u,baseUrl:g,driveName:this._driveName,mountpoint:t,browsingContextId:this._browsingContextId});i.mkdirTree(t),i.mount(D,{},t),i.chdir(t),this._driveFS=D}}mapToObject(e){let t=e instanceof Array?[]:{},i=e instanceof Map?e.entries():Object.entries(e);for(let[a,u]of i)t[a]=u instanceof Map||u instanceof Array?this.mapToObject(u):u;return t}formatResult(e){if(!(e instanceof this._pyodide.ffi.PyProxy))return e;let t=e.toJs();return this.mapToObject(t)}registerWorkerMessageCallback(e){this._sendWorkerMessage=e}registerLogMessageCallback(e){this._logMessage=e}async setup(e){await this._initialized,this._kernel._parent_header=this._pyodide.toPy(e)}async execute(e,t){await this.setup(t);let i=(o,d,w)=>{let E={execution_count:o,data:this.formatResult(d),metadata:this.formatResult(w)};this._sendWorkerMessage({parentHeader:this.formatResult(this._kernel._parent_header).header,bundle:E,type:"execute_result"})},a=(o,d,w)=>{let E={ename:o,evalue:d,traceback:w};this._sendWorkerMessage({parentHeader:this.formatResult(this._kernel._parent_header).header,bundle:E,type:"execute_error"})},u=o=>{let d={wait:this.formatResult(o)};this._sendWorkerMessage({parentHeader:this.formatResult(this._kernel._parent_header).header,bundle:d,type:"clear_output"})},g=(o,d,w)=>{let E={data:this.formatResult(o),metadata:this.formatResult(d),transient:this.formatResult(w)};this._sendWorkerMessage({parentHeader:this.formatResult(this._kernel._parent_header).header,bundle:E,type:"display_data"})},I=(o,d,w)=>{let E={data:this.formatResult(o),metadata:this.formatResult(d),transient:this.formatResult(w)};this._sendWorkerMessage({parentHeader:this.formatResult(this._kernel._parent_header).header,bundle:E,type:"update_display_data"})},D=(o,d)=>{let w={name:this.formatResult(o),text:this.formatResult(d)};this._sendWorkerMessage({parentHeader:this.formatResult(this._kernel._parent_header).header,bundle:w,type:"stream"})};this._stdout_stream.publish_stream_callback=D,this._stderr_stream.publish_stream_callback=D,this._interpreter.display_pub.clear_output_callback=u,this._interpreter.display_pub.display_data_callback=g,this._interpreter.display_pub.update_display_data_callback=I,this._interpreter.displayhook.publish_execution_result=i,this._interpreter.input=this.input.bind(this),this._interpreter.getpass=this.getpass.bind(this);let R=await this._kernel.run(e.code),l=this.formatResult(R);return l.status==="error"&&a(l.ename,l.evalue,l.traceback),l}async complete(e,t){await this.setup(t);let i=this._kernel.complete(e.code,e.cursor_pos);return this.formatResult(i)}async inspect(e,t){await this.setup(t);let i=this._kernel.inspect(e.code,e.cursor_pos,e.detail_level);return this.formatResult(i)}async isComplete(e,t){await this.setup(t);let i=this._kernel.is_complete(e.code);return this.formatResult(i)}async commInfo(e,t){await this.setup(t);let i=this._kernel.comm_info(e.target_name);return{comms:this.formatResult(i),status:"ok"}}async commOpen(e,t){await this.setup(t);let i=this._kernel.comm_manager.comm_open(this._pyodide.toPy(null),this._pyodide.toPy(null),this._pyodide.toPy(e));return this.formatResult(i)}async commMsg(e,t){await this.setup(t);let i=this._kernel.comm_manager.comm_msg(this._pyodide.toPy(null),this._pyodide.toPy(null),this._pyodide.toPy(e));return this.formatResult(i)}async commClose(e,t){await this.setup(t);let i=this._kernel.comm_manager.comm_close(this._pyodide.toPy(null),this._pyodide.toPy(null),this._pyodide.toPy(e));return this.formatResult(i)}async inputReply(e,t){}getpass(e){return e=typeof e>"u"?"":e,this.sendInputRequest(e,!0)}input(e){return e=typeof e>"u"?"":e,this.sendInputRequest(e,!1)}async sendComm(e,t,i,a,u){this._sendWorkerMessage({type:e,content:this.formatResult(t),metadata:this.formatResult(i),ident:this.formatResult(a),buffers:this.formatResult(u),parentHeader:this.formatResult(this._kernel._parent_header).header})}};var G=(await Ct()).proxy,Ce=class extends le{request(e){return G.processDriveRequest(e)}},Ue=class extends fe{createAPI(e){return new Ce(e)}},Le=class extends Ee{async initFilesystem(e){if(e.mountDrive){let t="/drive",{FS:i,PATH:a,ERRNO_CODES:u}=this._pyodide,{baseUrl:g}=e,I=new Ue({FS:i,PATH:a,ERRNO_CODES:u,baseUrl:g,driveName:this._driveName,mountpoint:t});i.mkdirTree(t),i.mount(I,{},t),i.chdir(t),this._driveFS=I}}sendInputRequest(e,t){return G.processStdinRequest({prompt:e,password:t})}},q=new Le,Mn=G.processWorkerMessage.bind(G);q.registerWorkerMessageCallback(Mn);var In=G.processLogMessage.bind(G);q.registerLogMessageCallback(In);G.initialize=q.initialize.bind(q);G.execute=q.execute.bind(q);G.complete=q.complete.bind(q);G.inspect=q.inspect.bind(q);G.isComplete=q.isComplete.bind(q);G.commInfo=q.commInfo.bind(q);G.commOpen=q.commOpen.bind(q);G.commMsg=q.commMsg.bind(q);G.commClose=q.commClose.bind(q);G.inputReply=q.inputReply.bind(q);export{Le as PyodideCoincidentKernel,Ce as SharedBufferContentsAPI};
|
|
19
14
|
//# sourceMappingURL=coincident.worker.js.map
|