-
Notifications
You must be signed in to change notification settings - Fork 81
/
Copy path304.fed478b20183b113f417.js
3 lines (3 loc) · 8.57 KB
/
304.fed478b20183b113f417.js
1
2
3
/*! For license information please see 304.fed478b20183b113f417.js.LICENSE.txt */
(self.webpackChunk_jupyterlite_pyodide_kernel_extension=self.webpackChunk_jupyterlite_pyodide_kernel_extension||[]).push([[304],{32:(e,t,n)=>{"use strict";n.d(t,{c:()=>T});const r="function",s="64e10b34-2bf7-4616-9668-f99de5aa046e",{isArray:o}=Array;let{SharedArrayBuffer:a,window:i}=globalThis,{notify:c,wait:u,waitAsync:l}=Atomics,f=null;l||(l=e=>({value:new Promise((t=>{let n=new Worker("data:application/javascript,onmessage%3D(%7Bdata%3Ab%7D)%3D%3E(Atomics.wait(b%2C0)%2CpostMessage(0))");n.onmessage=t,n.postMessage(e)}))}));try{new a(4)}catch(e){a=ArrayBuffer;const t=new WeakMap;if(i){const e=new Map,{prototype:{postMessage:n}}=Worker,r=t=>{const n=t.data?.[s];if(!o(n)){t.stopImmediatePropagation();const{id:r,sb:s}=n;e.get(r)(s)}};f=function(e,...a){const i=e?.[s];if(o(i)){const[e,n]=i;t.set(n,e),this.addEventListener("message",r)}return n.call(this,e,...a)},l=n=>({value:new Promise((r=>{e.set(t.get(n),r)})).then((r=>{e.delete(t.get(n)),t.delete(n);for(let e=0;e<r.length;e++)n[e]=r[e];return"ok"}))})}else{const e=(e,t)=>({[s]:{id:e,sb:t}});c=n=>{postMessage(e(t.get(n),n))},addEventListener("message",(e=>{const n=e.data?.[s];if(o(n)){const[e,r]=n;t.set(r,e)}}))}}const{Int32Array:p,Map:h,Uint16Array:d}=globalThis,{BYTES_PER_ELEMENT:g}=p,{BYTES_PER_ELEMENT:m}=d,y=new WeakSet,w=new WeakMap,E={value:{then:e=>e()}};let b=0;const v=(e,{parse:t=JSON.parse,stringify:n=JSON.stringify,transform:i,interrupt:v}=JSON)=>{if(!w.has(e)){const T=f||e.postMessage,k=(t,...n)=>T.call(e,{[s]:n},{transfer:t}),A=typeof v===r?v:v?.handler,M=v?.delay||42,S=new TextDecoder("utf-16"),L=(e,t)=>e?l(t,0):(A?((e,t,n)=>{for(;"timed-out"===u(e,0,0,t);)n()})(t,M,A):u(t,0),E);let P=!1;w.set(e,new Proxy(new h,{has:(e,t)=>"string"==typeof t&&!t.startsWith("_"),get:(n,r)=>"then"===r?null:(...n)=>{const s=b++;let o=new p(new a(2*g)),c=[];y.has(n.at(-1)||c)&&y.delete(c=n.pop()),k(c,s,o,r,i?n.map(i):n);const u=e!==globalThis;let l=0;return P&&u&&(l=setTimeout(console.warn,1e3,`💀🔒 - Possible deadlock if proxy.${r}(...args) is awaited`)),L(u,o).value.then((()=>{clearTimeout(l);const e=o[1];if(!e)return;const n=m*e;return o=new p(new a(n+n%g)),k([],s,o),L(u,o).value.then((()=>t(S.decode(new d(o.buffer).slice(0,e)))))}))},set(t,a,u){const l=typeof u;if(l!==r)throw new Error(`Unable to assign ${a} as ${l}`);if(!t.size){const r=new h;e.addEventListener("message",(async e=>{const a=e.data?.[s];if(o(a)){e.stopImmediatePropagation();const[s,o,...u]=a;let l;if(u.length){const[e,a]=u;if(t.has(e)){P=!0;try{const c=await t.get(e)(...a);if(void 0!==c){const e=n(i?i(c):c);r.set(s,e),o[1]=e.length}}catch(e){l=e}finally{P=!1}}else l=new Error(`Unsupported action: ${e}`);o[0]=1}else{const e=r.get(s);r.delete(s);for(let t=new d(o.buffer),n=0;n<e.length;n++)t[n]=e.charCodeAt(n)}if(c(o,0),l)throw l}}))}return!!t.set(a,u)}}))}return w.get(e)};v.transfer=(...e)=>(y.add(e),e);const T=v},83:(e,t,n)=>{"use strict";n.d(t,{em:()=>p});const r=Symbol("Comlink.proxy"),s=Symbol("Comlink.endpoint"),o=Symbol("Comlink.releaseProxy"),a=Symbol("Comlink.finalizer"),i=Symbol("Comlink.thrown"),c=e=>"object"==typeof e&&null!==e||"function"==typeof e,u=new Map([["proxy",{canHandle:e=>c(e)&&e[r],serialize(e){const{port1:t,port2:n}=new MessageChannel;return l(e,t),[n,[n]]},deserialize:e=>(e.start(),p(e))}],["throw",{canHandle:e=>c(e)&&i in e,serialize({value:e}){let t;return t=e instanceof Error?{isError:!0,value:{message:e.message,name:e.name,stack:e.stack}}:{isError:!1,value:e},[t,[]]},deserialize(e){if(e.isError)throw Object.assign(new Error(e.value.message),e.value);throw e.value}}]]);function l(e,t=globalThis,n=["*"]){t.addEventListener("message",(function s(o){if(!o||!o.data)return;if(!function(e,t){for(const n of e){if(t===n||"*"===n)return!0;if(n instanceof RegExp&&n.test(t))return!0}return!1}(n,o.origin))return void console.warn(`Invalid origin '${o.origin}' for comlink proxy`);const{id:c,type:u,path:p}=Object.assign({path:[]},o.data),h=(o.data.argumentList||[]).map(v);let d;try{const t=p.slice(0,-1).reduce(((e,t)=>e[t]),e),n=p.reduce(((e,t)=>e[t]),e);switch(u){case"GET":d=n;break;case"SET":t[p.slice(-1)[0]]=v(o.data.value),d=!0;break;case"APPLY":d=n.apply(t,h);break;case"CONSTRUCT":d=function(e){return Object.assign(e,{[r]:!0})}(new n(...h));break;case"ENDPOINT":{const{port1:t,port2:n}=new MessageChannel;l(e,n),d=function(e,t){return E.set(e,t),e}(t,[t])}break;case"RELEASE":d=void 0;break;default:return}}catch(e){d={value:e,[i]:0}}Promise.resolve(d).catch((e=>({value:e,[i]:0}))).then((n=>{const[r,o]=b(n);t.postMessage(Object.assign(Object.assign({},r),{id:c}),o),"RELEASE"===u&&(t.removeEventListener("message",s),f(t),a in e&&"function"==typeof e[a]&&e[a]())})).catch((e=>{const[n,r]=b({value:new TypeError("Unserializable return value"),[i]:0});t.postMessage(Object.assign(Object.assign({},n),{id:c}),r)}))})),t.start&&t.start()}function f(e){(function(e){return"MessagePort"===e.constructor.name})(e)&&e.close()}function p(e,t){const n=new Map;return e.addEventListener("message",(function(e){const{data:t}=e;if(!t||!t.id)return;const r=n.get(t.id);if(r)try{r(t)}finally{n.delete(t.id)}})),y(e,n,[],t)}function h(e){if(e)throw new Error("Proxy has been released and is not useable")}function d(e){return T(e,new Map,{type:"RELEASE"}).then((()=>{f(e)}))}const g=new WeakMap,m="FinalizationRegistry"in globalThis&&new FinalizationRegistry((e=>{const t=(g.get(e)||0)-1;g.set(e,t),0===t&&d(e)}));function y(e,t,n=[],r=function(){}){let a=!1;const i=new Proxy(r,{get(r,s){if(h(a),s===o)return()=>{!function(e){m&&m.unregister(e)}(i),d(e),t.clear(),a=!0};if("then"===s){if(0===n.length)return{then:()=>i};const r=T(e,t,{type:"GET",path:n.map((e=>e.toString()))}).then(v);return r.then.bind(r)}return y(e,t,[...n,s])},set(r,s,o){h(a);const[i,c]=b(o);return T(e,t,{type:"SET",path:[...n,s].map((e=>e.toString())),value:i},c).then(v)},apply(r,o,i){h(a);const c=n[n.length-1];if(c===s)return T(e,t,{type:"ENDPOINT"}).then(v);if("bind"===c)return y(e,t,n.slice(0,-1));const[u,l]=w(i);return T(e,t,{type:"APPLY",path:n.map((e=>e.toString())),argumentList:u},l).then(v)},construct(r,s){h(a);const[o,i]=w(s);return T(e,t,{type:"CONSTRUCT",path:n.map((e=>e.toString())),argumentList:o},i).then(v)}});return function(e,t){const n=(g.get(t)||0)+1;g.set(t,n),m&&m.register(e,t,e)}(i,e),i}function w(e){const t=e.map(b);return[t.map((e=>e[0])),(n=t.map((e=>e[1])),Array.prototype.concat.apply([],n))];var n}const E=new WeakMap;function b(e){for(const[t,n]of u)if(n.canHandle(e)){const[r,s]=n.serialize(e);return[{type:"HANDLER",name:t,value:r},s]}return[{type:"RAW",value:e},E.get(e)||[]]}function v(e){switch(e.type){case"HANDLER":return u.get(e.name).deserialize(e.value);case"RAW":return e.value}}function T(e,t,n,r){return new Promise((s=>{const o=new Array(4).fill(0).map((()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16))).join("-");t.set(o,s),e.start&&e.start(),e.postMessage(Object.assign({id:o},n),r)}))}},664:e=>{var t,n,r=e.exports={};function s(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function a(e){if(t===setTimeout)return setTimeout(e,0);if((t===s||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:s}catch(e){t=s}try{n="function"==typeof clearTimeout?clearTimeout:o}catch(e){n=o}}();var i,c=[],u=!1,l=-1;function f(){u&&i&&(u=!1,i.length?c=i.concat(c):l=-1,c.length&&p())}function p(){if(!u){var e=a(f);u=!0;for(var t=c.length;t;){for(i=c,c=[];++l<t;)i&&i[l].run();l=-1,t=c.length}i=null,u=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===o||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{return n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function h(e,t){this.fun=e,this.array=t}function d(){}r.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];c.push(new h(e,t)),1!==c.length||u||a(p)},h.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={},r.on=d,r.addListener=d,r.once=d,r.off=d,r.removeListener=d,r.removeAllListeners=d,r.emit=d,r.prependListener=d,r.prependOnceListener=d,r.listeners=function(e){return[]},r.binding=function(e){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(e){throw new Error("process.chdir is not supported")},r.umask=function(){return 0}}}]);
//# sourceMappingURL=304.fed478b20183b113f417.js.map?v=fed478b20183b113f417