@elixir-playground/runtime 0.0.0-stage → 1.0.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.
Files changed (71) hide show
  1. package/LICENSE +73 -0
  2. package/NOTICE.md +44 -0
  3. package/chunks/ansi-styles-Bkz3XA_r.js +1 -0
  4. package/chunks/browser-iHf7-8M7.js +113 -0
  5. package/chunks/dist-0mSzsNc8.js +10 -0
  6. package/chunks/fs-GnBaZCKr.js +1 -0
  7. package/chunks/git-remote-DnEba0y9.js +16 -0
  8. package/chunks/lookup-NMT_UyaB.js +1 -0
  9. package/chunks/manifest-DOTdOkY7.js +2 -0
  10. package/chunks/preload-helper-DHhhL8Zf.js +1 -0
  11. package/chunks/semver-CK47NiDu.js +1 -0
  12. package/chunks/slice-ansi-CtePLJj8.js +1 -0
  13. package/chunks/string-width-Dyomz-Kx.js +1 -0
  14. package/chunks/strip-ansi-B9O1Kiar.js +1 -0
  15. package/chunks/wasi-M0pSoirQ.js +1 -0
  16. package/chunks/wrap-ansi-v-UhTxgf.js +9 -0
  17. package/claude.html +10 -0
  18. package/exec.html +10 -0
  19. package/files.js +2 -0
  20. package/frames/browser-C6dmTjO4.js +682 -0
  21. package/frames/browser-CpIeD-9w.js +682 -0
  22. package/frames/claude-BdzjrDKT.js +1 -0
  23. package/frames/esbuild-DJd0QPVm.wasm +0 -0
  24. package/frames/exec-DcNLuXnX.js +1 -0
  25. package/frames/host-gpGAUuqR.js +1969 -0
  26. package/frames/relay-CFTN70Gw.js +9 -0
  27. package/frames/site-Bq_qZN66.js +1 -0
  28. package/frames/worker-PmIsqqyU.js +16 -0
  29. package/git.js +1 -0
  30. package/licenses/abort-controller-3.0.0/LICENSE +21 -0
  31. package/licenses/ansi-regex-6.4.0/license +9 -0
  32. package/licenses/ansi-styles-6.2.3/license +9 -0
  33. package/licenses/base64-js-1.5.1/LICENSE +21 -0
  34. package/licenses/buffer-6.0.3/LICENSE +21 -0
  35. package/licenses/elixir-playground-playground/LICENSE +73 -0
  36. package/licenses/elixir-playground-playground/NOTICE +11 -0
  37. package/licenses/esbuild-wasm-0.25.4/LICENSE.md +21 -0
  38. package/licenses/events-3.3.0/LICENSE +22 -0
  39. package/licenses/fflate-0.8.2/LICENSE +21 -0
  40. package/licenses/fzstd-0.1.1/LICENSE +21 -0
  41. package/licenses/get-east-asian-width-1.7.0/license +9 -0
  42. package/licenses/ieee754-1.2.1/LICENSE +11 -0
  43. package/licenses/index.json +304 -0
  44. package/licenses/is-fullwidth-code-point-5.1.0/license +9 -0
  45. package/licenses/jridgewell_gen-mapping-0.3.13/LICENSE +19 -0
  46. package/licenses/jridgewell_resolve-uri-3.1.2/LICENSE +19 -0
  47. package/licenses/jridgewell_sourcemap-codec-1.6.0/LICENSE +19 -0
  48. package/licenses/jridgewell_trace-mapping-0.3.31/LICENSE +19 -0
  49. package/licenses/lines-and-columns-1.2.4/LICENSE +21 -0
  50. package/licenses/noble_hashes-2.0.1/LICENSE +21 -0
  51. package/licenses/readable-stream-4.7.0/LICENSE +47 -0
  52. package/licenses/safe-buffer-5.2.1/LICENSE +21 -0
  53. package/licenses/semver-7.7.3/LICENSE +15 -0
  54. package/licenses/slice-ansi-9.0.1/license +10 -0
  55. package/licenses/smol-toml-1.9.1/LICENSE +24 -0
  56. package/licenses/string-width-8.3.0/license +9 -0
  57. package/licenses/string_decoder-1.3.0/LICENSE +48 -0
  58. package/licenses/strip-ansi-7.2.0/license +9 -0
  59. package/licenses/sucrase-3.35.0/LICENSE +21 -0
  60. package/licenses/tailwindcss-4.3.3/LICENSE +21 -0
  61. package/licenses/ts-interface-checker-0.1.13/LICENSE +201 -0
  62. package/licenses/vite-8.3.4/LICENSE.md +2265 -0
  63. package/licenses/wrap-ansi-10.0.2/license +9 -0
  64. package/licenses/yaml-2.9.1/LICENSE +13 -0
  65. package/nodejs.js +181 -0
  66. package/package.json +50 -4
  67. package/relay.html +10 -0
  68. package/root/relay.html +30 -0
  69. package/root/sw.js +1 -0
  70. package/worker.js +15 -0
  71. package/README.md +0 -3
@@ -0,0 +1,9 @@
1
+ import{n as e,r as t,t as n}from"./site-Bq_qZN66.js";var r=`playground-cookies`;function i(e,t){let[n,...r]=t.split(`;`),i=n.indexOf(`=`);if(i<0)return;let a=n.slice(0,i).trim(),o=n.slice(i+1).trim(),s=null,c=null;for(let e of r){let[t,n=``]=e.trim().split(`=`);t.toLowerCase()===`max-age`?s=Date.now()+Number(n)*1e3:t.toLowerCase()===`expires`&&(c=Date.parse(n))}let l=s??c;l!==null&&!(l>Date.now())?delete e[a]:e[a]={value:o,expires:l}}function a(){let e={};try{e=JSON.parse(localStorage.getItem(`playground-cookies`)??`{}`)}catch{}for(let t of Object.keys(e)){let n=e[t].expires;n!==null&&n<=Date.now()&&delete e[t]}return e}function o(e){try{localStorage.setItem(r,JSON.stringify(e))}catch{}}var s=e=>Object.entries(e).map(([e,{value:t}])=>`${e}=${t}`).join(`; `);function c(e,t){let n=()=>{let e={};try{e=JSON.parse(localStorage.getItem(t)??`{}`)}catch{return{}}for(let t of Object.keys(e)){let n=e[t].expires;n!==null&&n<=Date.now()&&delete e[t]}return e};Object.defineProperty(Document.prototype,"cookie",{configurable:!0,get:()=>Object.entries(n()).map(([e,{value:t}])=>`${e}=${t}`).join(`; `),set:r=>{let i=n();e(i,String(r));try{localStorage.setItem(t,JSON.stringify(i))}catch{}}})}var l=null;function u(e){if(!l)try{l=new Set((globalThis.localStorage?.getItem(`playground-trace`)??``).split(`,`))}catch{l=new Set}return l.has(e)}function d(e,...t){u(e)&&console.debug(`[${e}] ${new Date().toISOString().slice(11,23)}`,...t)}function f(e){let t={CONNECTING:0,OPEN:1,CLOSING:2,CLOSED:3};class n extends EventTarget{constructor(t,n=[]){super(),this.url=new URL(t,location.href).href,this.readyState=0,this.protocol=``,this.extensions=``,this.bufferedAmount=0,this.binaryType=`blob`;for(let e of[`open`,`message`,`close`,`error`])this[`on${e}`]=null;let r=new MessageChannel;this.port=r.port1,this.port.onmessage=({data:e})=>this.receive(e);let i=new URL(this.url);navigator.serviceWorker.controller.postMessage({kind:`websocket`,protocol:e,path:i.pathname+i.search,subprotocols:[].concat(n)},[r.port2])}emit(e){this.dispatchEvent(e);let t=this[`on${e.type}`];t&&t.call(this,e)}receive(e){if(`open`in e)this.readyState=1,this.protocol=e.open,this.emit(new Event(`open`));else if(`message`in e){let t=e.message;typeof t!=`string`&&this.binaryType===`blob`&&(t=new Blob([t])),this.emit(new MessageEvent(`message`,{data:t,origin:new URL(this.url).origin}))}else if(`close`in e){if(this.readyState===3)return;this.readyState=3,e.close.clean||this.emit(new Event(`error`)),this.emit(new CloseEvent(`close`,{code:e.close.code,reason:e.close.reason,wasClean:e.close.clean})),this.port.close()}}send(e){if(this.readyState===0)throw new DOMException(`Still in CONNECTING state.`,`InvalidStateError`);this.readyState===1&&(e instanceof Blob?e.arrayBuffer().then(e=>this.port.postMessage({send:e})):ArrayBuffer.isView(e)?this.port.postMessage({send:e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}):this.port.postMessage({send:e instanceof ArrayBuffer?e:String(e)}))}close(e=1e3,t=``){this.readyState>=2||(this.readyState=2,this.port.postMessage({close:{code:e,reason:t}}))}}Object.assign(n,t),Object.assign(n.prototype,t),window.WebSocket=n}function p(e,t,n){let r=window;r.playgroundApp=!0;let i=t?RegExp(`^`+t.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`).replace(`\\{port\\}`,`(\\d+)`)+`$`):null,a=e=>i!==null&&i.test(e.origin),o=e=>e.origin===location.origin||a(e)||e.protocol===`http:`&&[`localhost`,`127.0.0.1`].includes(e.hostname),s=e=>{try{return e.parent!==e&&e.parent.playgroundApp?e.parent:null}catch{return null}},c=()=>{let e=window;for(let t=s(e);t;t=s(e))e=t;return e},l=e=>e.pathname+e.search+e.hash,u=n=>{if(n.origin===location.origin||a(n))return n.origin===location.origin?l(n):n.href;let r=Number(n.port||80);return r===e?l(n):t?t.replace(`{port}`,String(r))+l(n):`/__playground/port/${r}${l(n)}`};if(addEventListener(`click`,e=>{if(e.defaultPrevented||e.button!==0)return;let t=e.composedPath().find(e=>e.tagName===`A`);if(!t?.href)return;let n=new URL(t.href,location.href),r=(t.target||document.querySelector(`base[target]`)?.getAttribute(`target`)||``).toLowerCase(),i=r===`_top`||r===`_parent`;if(!o(n)){i&&(e.preventDefault(),open(n.href,`_blank`,`noopener`));return}if(n.origin!==location.origin&&(t.href=u(n)),!i)return;let a=r===`_top`?c():s(window)??window;a===window?t.target=`_self`:(e.preventDefault(),a.location.assign(u(n)))},!0),addEventListener(`submit`,e=>{let t=e.target,n=new URL(t.action,location.href);o(n)&&n.origin!==location.origin&&(t.action=u(n))},!0),window.parent===window||s(window))return;let d=()=>window.parent.postMessage({kind:`playground-location`,port:e,path:l(new URL(location.href))},n);for(let e of[`pushState`,`replaceState`]){let t=history[e];history[e]=function(...e){t.apply(this,e),d()}}addEventListener(`popstate`,d),addEventListener(`hashchange`,d),d(),addEventListener(`message`,e=>{e.source===window.parent&&e.data?.kind===`playground-snapshot`&&e.origin===n&&window.parent.postMessage({kind:`playground-snapshot`,id:e.data.id,title:document.title,text:document.body?.innerText??``},n)})}var m=5e3,h=/^\/__playground\/port\/(\d+)(\/.*)?$/,g=(e,t,n)=>`<script>${t?`(${c})(${i}, ${JSON.stringify(r)});`:``}(${f})(1);(${p})(${e}, ${JSON.stringify(t)}, ${JSON.stringify(n)})<\/script>`;function _(e){let t=new Uint8Array(e.reduce((e,t)=>e+t.length,0)),n=0;for(let r of e)t.set(r,n),n+=r.length;return t}function v(e){let t=[],n=0,r=new TextDecoder(`latin1`);for(;;){let i=e.indexOf(13,n);if(i<0)break;let a=parseInt(r.decode(e.subarray(n,i)),16);if(!a)break;t.push(e.subarray(i+2,i+2+a)),n=i+2+a+2}return _(t)}var y=class{flights=new Map;nextFlight=1;debug(){return[...this.flights.values()].map(({started:e,...t})=>({...t,age:`${((Date.now()-e)/1e3).toFixed(1)} s`}))}flight(e,t){let n={kind:e,what:t,started:Date.now(),bytes:0,state:`connecting`},r=this.nextFlight++;return this.flights.set(r,n),d(`net`,`bridge ${e} ${r}: ${t}`),Object.assign(n,{done:()=>{this.flights.delete(r),d(`net`,`bridge ${e} ${r}: done (${n.state}, ${n.bytes} bytes)`)}})}constructor(e,t=4e3,n=null,r=location.origin){this.node=e,this.port=t,this.origins=n,this.ide=r,this.onport=null,this.cookies=new Map,navigator.serviceWorker?.addEventListener(`message`,async e=>{if(e.data?.kind===`websocket`){this.websocket(e.data,e.ports[0]);return}if(e.data?.kind!==`http`)return;let t=await this.request(e.data);e.ports[0].postMessage(t,t.body?[t.body.buffer]:[])})}cookieHeader(e){let t=[...this.cookies].map(([e,t])=>`${e}=${t}`),n=e??(typeof document<`u`?document.cookie:``);return n&&t.push(n),t.length?`cookie: ${t.join(`; `)}`:null}websocket({path:e,subprotocols:t,port:n=this.port,cookie:r},i){let a=this.flight(`websocket`,e),o=this.node.connect(n),s=btoa(String.fromCharCode(...crypto.getRandomValues(new Uint8Array(16)))),c=[`GET ${e} HTTP/1.1`,`host: localhost:${n}`,`upgrade: websocket`,`connection: Upgrade`,`sec-websocket-key: ${s}`,`sec-websocket-version: 13`,`origin: http://localhost:${n}`];t.length&&c.push(`sec-websocket-protocol: ${t.join(`, `)}`);let l=this.cookieHeader(r);l&&c.push(l),o.write(new TextEncoder().encode(c.join(`\r
2
+ `)+`\r
3
+ \r
4
+ `));let u=new Uint8Array,d=!1,f=!1,p=[],m=0,h=(e,t,n)=>{f||(f=!0,a.state=`closed ${e}`,a.done(),i.postMessage({close:{code:e,reason:t,clean:n}}),i.close(),o.close())},g=(e,t)=>{let n=crypto.getRandomValues(new Uint8Array(4)),r=t.length,i=r<126?[128|e,128|r]:r<65536?[128|e,254,r>>8,r&255]:[128|e,255,0,0,0,0,r>>>24&255,r>>16&255,r>>8&255,r&255],a=new Uint8Array(i.length+4+r);a.set(i),a.set(n,i.length);for(let e=0;e<r;e++)a[i.length+4+e]=t[e]^n[e&3];o.write(a)};i.onmessage=({data:e})=>{if(!f){if(`send`in e)typeof e.send==`string`?g(1,new TextEncoder().encode(e.send)):g(2,new Uint8Array(e.send));else if(`close`in e){let t=new TextEncoder().encode(e.close.reason??``);g(8,new Uint8Array([e.close.code>>8,e.close.code&255,...t]))}}};let v=()=>{for(;;){if(u.length<2)return;let e=u[0]&128,t=u[0]&15,n=u[1]&127,r=2;if(n===126){if(u.length<4)return;n=u[2]<<8|u[3],r=4}else if(n===127){if(u.length<10)return;n=Number(new DataView(u.buffer,u.byteOffset+2,8).getBigUint64(0)),r=10}if(u[1]&128&&(r+=4),u.length<r+n)return;let a=u.slice(r,r+n);if(u=u.slice(r+n),t===8){let e=a.length>=2?a[0]<<8|a[1]:1005;g(8,a.slice(0,2)),h(e,new TextDecoder().decode(a.slice(2)),!0);return}if(t===9&&g(10,a),t>=8||(t!==0&&(m=t),p.push(a),!e))continue;let o=_(p);p=[],i.postMessage({message:m===1?new TextDecoder().decode(o):o.buffer})}};o.ondata=e=>{if(a.bytes+=e.length,u=_([u,e]),!d){let e=-1;for(let t=0;t+3<u.length;t++)if(u[t]===13&&u[t+1]===10&&u[t+2]===13&&u[t+3]===10){e=t;break}if(e<0)return;let t=new TextDecoder(`latin1`).decode(u.subarray(0,e)).split(`\r
5
+ `);if(u=u.slice(e+4),!/^HTTP\/1\.1 101/.test(t[0])){h(1006,``,!1);return}for(let e of t.slice(1)){let[t,...n]=e.split(`:`);t.trim().toLowerCase()===`set-cookie`&&this.remember(n.join(`:`).trim())}let n=t.find(e=>/^sec-websocket-protocol:/i.test(e))?.split(`:`)[1].trim()??``;d=!0,a.state=`open`,i.postMessage({open:n})}v()},o.onend=()=>h(1006,``,!1),o.onclose=()=>h(1006,``,!1)}static async register(e=`sw.js`,t=`./`){let n=await navigator.serviceWorker.register(e,{scope:t});navigator.serviceWorker.addEventListener(`message`,e=>{let t=e.data;t?.kind===`hosted`&&t.protocol===null&&n.update()});let{active:r}=await navigator.serviceWorker.ready;navigator.serviceWorker.controller||r.postMessage(`claim`);let i={kind:`host`,protocol:1};navigator.serviceWorker.controller||await new Promise(e=>navigator.serviceWorker.addEventListener(`controllerchange`,e,{once:!0}));let a=new Promise(e=>{let t=setTimeout(e,m),n=r=>{let i=r.data;i?.kind===`hosted`&&i.protocol!==null&&(navigator.serviceWorker.removeEventListener(`message`,n),clearTimeout(t),e())};navigator.serviceWorker.addEventListener(`message`,n)});navigator.serviceWorker.controller.postMessage(i),navigator.serviceWorker.addEventListener(`controllerchange`,()=>navigator.serviceWorker.controller?.postMessage(i)),await a}request({method:e,path:t,headers:n,body:r,destination:i,port:a,cookie:o}){let s=a===void 0&&t.match(h),c=a??this.port;return s?(this.port=Number(s[1]),this.onport?.(this.port),Promise.resolve({status:302,reason:`Found`,headers:[[`location`,s[2]??`/`]],body:new Uint8Array})):new Promise(a=>{let s=[`${e} ${t} HTTP/1.1`,`host: localhost:${c}`,`connection: close`,`accept-encoding: gzip`];for(let[e,t]of n)[`host`,`connection`,`cookie`,`accept-encoding`,`content-length`].includes(e)||s.push(`${e}: ${t}`);let l=this.cookieHeader(o);l&&s.push(l);let u=r?new Uint8Array(r):null;u&&s.push(`content-length: ${u.length}`);let d=[],f=this.flight(`http`,`${e} ${t}`),p=this.node.connect(c);f.state=`waiting for the answer`;let m=!1,h=e=>{if(m)return;if(m=!0,f.state=e?`refused`:d.length?`answered`:`closed without an answer`,f.done(),e||!d.length){a({status:502,reason:`Bad Gateway`,headers:[[`content-type`,`text/html`]],body:new TextEncoder().encode(`<meta http-equiv="refresh" content="2"><p style="font-family:system-ui">Waiting for the Phoenix server to start…</p>`)});return}let t=i===void 0||[`document`,`iframe`,`frame`].includes(i);this.parse(_(d),c,o===void 0?void 0:[],t).then(a)};p.ondata=e=>{f.bytes+=e.length,f.state=`receiving (until the node ends the connection)`,d.push(e)},p.onend=()=>{h(!1),p.close()},p.onclose=e=>h(e===`refused`),p.write(new TextEncoder().encode(s.join(`\r
6
+ `)+`\r
7
+ \r
8
+ `)),u&&p.write(u)})}async parse(e,t=this.port,n,r=!0){let i=-1;for(let t=0;t+3<e.length;t++)if(e[t]===13&&e[t+1]===10&&e[t+2]===13&&e[t+3]===10){i=t;break}let a=new TextDecoder(`latin1`).decode(e.subarray(0,i<0?e.length:i)).split(`\r
9
+ `),o=i<0?new Uint8Array:e.slice(i+4),[,s,c]=a[0].match(/^HTTP\/1\.[01] (\d+) ?(.*)$/)||[null,`502`,`Bad Gateway`],l=[];for(let e of a.slice(1)){let r=e.indexOf(`:`);if(r<0)continue;let i=e.slice(0,r).trim().toLowerCase(),a=e.slice(r+1).trim();if(i===`set-cookie`&&this.remember(a,n),i===`location`){let e=a.match(/^http:\/\/(?:localhost|127\.0\.0\.1)(?::(\d+))?(\/.*)?$/);if(e){let n=Number(e[1]??80),r=e[2]??`/`;l.push([i,n===t?r:this.elsewhere(n,r)]);continue}}this.origins&&i===`x-frame-options`&&/^sameorigin$/i.test(a)||(this.origins&&i===`content-security-policy`?l.push([i,a.replace(/frame-ancestors([^;]*)/i,(e,t)=>/'none'/.test(t)?e:`${e} ${this.ide}`)]):l.push([i,a]))}l.some(([e,t])=>e===`transfer-encoding`&&/chunked/i.test(t))&&(o=v(o));let u=l.findIndex(([e,t])=>e===`content-encoding`&&t===`gzip`);if(u>=0){let e=new Blob([o]).stream().pipeThrough(new DecompressionStream(`gzip`));o=new Uint8Array(await new Response(e).arrayBuffer()),l.splice(u,1)}let d=l.find(([e])=>e===`content-type`)?.[1]??``;if(r&&d.startsWith(`text/html`)){let e=new TextDecoder().decode(o),n=e.search(/<head[^>]*>/i),r=g(t,this.origins,this.ide),i=n<0?r+e:e.replace(/<head[^>]*>/i,e=>e+r);o=new TextEncoder().encode(i)}return{status:Number(s),reason:c,headers:l,body:o,cookies:n}}elsewhere(e,t){return this.origins?this.origins.replace(`{port}`,String(e))+t:`/__playground/port/${e}${t}`}remember(e,t){let[n,...r]=e.split(`;`),i=n.indexOf(`=`),a=n.slice(0,i).trim(),o=n.slice(i+1).trim(),s=r.map(e=>e.trim().split(`=`)[0].toLowerCase()),c=r.some(e=>{let[t,n]=e.trim().split(`=`);return t.toLowerCase()===`max-age`&&Number(n)<=0||t.toLowerCase()===`expires`&&Date.parse(n)<Date.now()});if(s.includes(`httponly`)||typeof document>`u`&&!t){c?this.cookies.delete(a):this.cookies.set(a,o);let e=r.map(e=>e.trim()).find(e=>/^path=/i.test(e))??`path=/`;t?t.push(`${a}=; ${e}; max-age=0`):typeof document<`u`&&b(a)&&(document.cookie=`${a}=; ${e}; max-age=0`);return}this.cookies.delete(a);let l=r.map(e=>e.trim()).filter(e=>!/^(secure|samesite|domain)/i.test(e)),u=[`${a}=${o}`,...l,...c?[`max-age=0`]:[]].join(`; `);t?t.push(u):document.cookie=u}};function b(e){return document.cookie.split(`;`).some(t=>t.split(`=`)[0].trim()===e)}await n();var x=t(),S=new Set(e()),C=()=>s(a());async function w(e,t){navigator.serviceWorker.addEventListener(`message`,e=>{let n=e.data;if(n?.kind===`http`){let r=e.ports[0],s=new MessageChannel;s.port1.onmessage=({data:e})=>{if(s.port1.close(),e.cookies?.length){let t=a();for(let n of e.cookies)i(t,n);o(t)}r.postMessage(e,[e.body.buffer])},t.postMessage({...n,port:n.port??x.port,cookie:C()},[s.port2])}else n?.kind===`websocket`&&t.postMessage({...n,port:x.port,cookie:C()},[e.ports[0]])}),await y.register(`/sw.js`,`/`),e.postMessage({kind:`ready`})}if(x){let e=!1;addEventListener(`message`,t=>{t.source===window.parent&&!e&&S.has(t.origin)&&t.data?.kind===`playground-relay`&&t.ports[1]&&(e=!0,w(t.ports[0],t.ports[1]))}),window.parent.postMessage({kind:`playground-relay-loaded`},`*`)}
@@ -0,0 +1 @@
1
+ var e=/^[a-z0-9]{10}$/;function t(t){return e.test(t)}var n={domain:null,usercontent:null,preview:null,moved:null,stray:!1,embedders:[]},r=/^v-([a-z0-9]{10})-(\d{1,5})$/;function i(e){let n=e.match(r),i=n?Number(n[2]):0;return n&&t(n[1])&&i>0&&i<65536?{project:n[1],port:i}:null}function a(e){let n=e.match(/^p-([a-z0-9]{10})$/)?.[1];return n&&t(n)?`/${n}/`:e.startsWith(`l-`)&&location.pathname.startsWith(`/live/`)?location.pathname:null}async function o(){let e=await fetch(`/playground.json`,{cache:`no-cache`}).then(e=>e.ok?e.json():{}).catch(()=>({})),t=typeof e.domain==`string`&&e.domain?e.domain:null,r=typeof e.usercontent==`string`&&e.usercontent?e.usercontent:null;n={domain:t,usercontent:r,preview:null,moved:null,stray:!1,embedders:Array.isArray(e.embedders)?e.embedders.filter(e=>typeof e==`string`):[]};let o=location.host;r&&o.endsWith(`.${r}`)?(n.preview=i(o.slice(0,-r.length-1)),n.stray=!n.preview):t&&o.endsWith(`.${t}`)&&(n.moved=a(o.slice(0,-t.length-1)),n.stray=!n.moved)}var s=()=>[u(),...n.embedders],c=()=>n.preview;function l(e){return n.domain?`${location.protocol}//${n.domain}${e}`:e}var u=()=>new URL(l(`/`),location.href).origin;export{s as n,c as r,o as t};
@@ -0,0 +1,16 @@
1
+ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,o)=>(o=n==null?{}:e(i(n)),s(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n)),l=class{value;transfer;constructor(e,t){this.value=e,this.transfer=t}};const u=(e,t)=>new l(e,t);var d=class{port;next=1;waiting=/* @__PURE__ */ new Map;handlers={};listeners=/* @__PURE__ */ new Map;constructor(e){this.port=e,e.onmessage=({data:e})=>void this.receive(e)}handle(e){return Object.assign(this.handlers,e),this}call(e,t=[],n=[]){let r=this.next++;return new Promise((i,a)=>{this.waiting.set(r,{resolve:i,reject:a}),this.port.postMessage({call:r,method:e,args:t},n)})}emit(e,t,n=[]){this.port.postMessage({event:e,data:t},n)}on(e,t){let n=this.listeners.get(e);return n||this.listeners.set(e,n=/* @__PURE__ */ new Set),n.add(t),()=>n.delete(t)}close(){for(let{reject:e}of this.waiting.values())e(/* @__PURE__ */ Error(`closed`));this.waiting.clear(),this.port.close()}async receive(e){if(`reply`in e){let t=this.waiting.get(e.reply);this.waiting.delete(e.reply),e.error===void 0?t?.resolve(e.value):t?.reject(Object.assign(Error(e.error),{code:e.code}))}else if(`call`in e)try{let t=this.handlers[e.method];if(!t)throw Error(`no such call: ${e.method}`);let n=await t(...e.args),[r,i]=n instanceof l?[n.value,n.transfer]:[n,[]];this.port.postMessage({reply:e.call,value:r},i)}catch(t){let n=t?.code;this.port.postMessage({reply:e.call,error:t instanceof Error?t.message:String(t),...typeof n==`string`?{code:n}:{}})}else for(let t of this.listeners.get(e.event)??[])t(e.data)}};
2
+ /*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
3
+ function f(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name===`Uint8Array`}function p(e,t,n=``){let r=f(e),i=e?.length,a=t!==void 0;if(!r||a&&i!==t){let o=n&&`"${n}" `,s=a?` of length ${t}`:``,c=r?`length=${i}`:`type=${typeof e}`;throw Error(o+`expected Uint8Array`+s+`, got `+c)}return e}function m(e,t=!0){if(e.destroyed)throw Error(`Hash instance has been destroyed`);if(t&&e.finished)throw Error(`Hash#digest() has already been called`)}function h(e,t){p(e,void 0,`digestInto() output`);let n=t.outputLen;if(e.length<n)throw Error(`"digestInto() output" expected to be of length >=`+n)}function g(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function _(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function v(e,t={}){let n=(t,n)=>e(n).update(t).digest(),r=e(void 0);return n.outputLen=r.outputLen,n.blockLen=r.blockLen,n.create=t=>e(t),Object.assign(n,t),Object.freeze(n)}const y=e=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,e])});var b=class{blockLen;outputLen;padOffset;isLE;buffer;view;finished=!1;length=0;pos=0;destroyed=!1;constructor(e,t,n,r){this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=r,this.buffer=new Uint8Array(e),this.view=_(this.buffer)}update(e){m(this),p(e);let{view:t,buffer:n,blockLen:r}=this,i=e.length;for(let a=0;a<i;){let o=Math.min(r-this.pos,i-a);if(o===r){let t=_(e);for(;r<=i-a;a+=r)this.process(t,a)}else n.set(e.subarray(a,a+o),this.pos),this.pos+=o,a+=o,this.pos===r&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){m(this),h(e,this),this.finished=!0;let{buffer:t,view:n,blockLen:r,isLE:i}=this,{pos:a}=this;t[a++]=128,g(this.buffer.subarray(a)),this.padOffset>r-a&&(this.process(n,0),a=0);for(let e=a;e<r;e++)t[e]=0;n.setBigUint64(r-8,BigInt(this.length*8),i),this.process(n,0);let o=_(e),s=this.outputLen;if(s%4)throw Error(`_sha2: outputLen must be aligned to 32bit`);let c=s/4,l=this.get();if(c>l.length)throw Error(`_sha2: outputLen bigger than state`);for(let e=0;e<c;e++)o.setUint32(4*e,l[e],i)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let n=e.slice(0,t);return this.destroy(),n}_cloneInto(e){e||=new this.constructor,e.set(...this.get());let{blockLen:t,buffer:n,length:r,finished:i,destroyed:a,pos:o}=this;return e.destroyed=a,e.finished=i,e.length=r,e.pos=o,r%t&&e.buffer.set(n),e}clone(){return this._cloneInto()}};const x=/* @__PURE__ */ Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]),S=/* @__PURE__ */ BigInt(2**32-1),C=/* @__PURE__ */ BigInt(32);function w(e,t=!1){return t?{h:Number(e&S),l:Number(e>>C&S)}:{h:Number(e>>C&S)|0,l:Number(e&S)|0}}function T(e,t=!1){let n=e.length,r=new Uint32Array(n),i=new Uint32Array(n);for(let a=0;a<n;a++){let{h:n,l:o}=w(e[a],t);[r[a],i[a]]=[n,o]}return[r,i]}const E=(e,t,n)=>e>>>n,D=(e,t,n)=>e<<32-n|t>>>n,O=(e,t,n)=>e>>>n|t<<32-n,k=(e,t,n)=>e<<32-n|t>>>n,A=(e,t,n)=>e<<64-n|t>>>n-32,j=(e,t,n)=>e>>>n-32|t<<64-n;function M(e,t,n,r){let i=(t>>>0)+(r>>>0);return{h:e+n+(i/2**32|0)|0,l:i|0}}const N=(e,t,n)=>(e>>>0)+(t>>>0)+(n>>>0),P=(e,t,n,r)=>t+n+r+(e/2**32|0)|0,F=(e,t,n,r)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0),ee=(e,t,n,r,i)=>t+n+r+i+(e/2**32|0)|0,te=(e,t,n,r,i)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0)+(i>>>0),I=(e,t,n,r,i,a)=>t+n+r+i+a+(e/2**32|0)|0,ne=/* @__PURE__ */ T((/* @__PURE__ */ `0x428a2f98d728ae22.0x7137449123ef65cd.0xb5c0fbcfec4d3b2f.0xe9b5dba58189dbbc.0x3956c25bf348b538.0x59f111f1b605d019.0x923f82a4af194f9b.0xab1c5ed5da6d8118.0xd807aa98a3030242.0x12835b0145706fbe.0x243185be4ee4b28c.0x550c7dc3d5ffb4e2.0x72be5d74f27b896f.0x80deb1fe3b1696b1.0x9bdc06a725c71235.0xc19bf174cf692694.0xe49b69c19ef14ad2.0xefbe4786384f25e3.0x0fc19dc68b8cd5b5.0x240ca1cc77ac9c65.0x2de92c6f592b0275.0x4a7484aa6ea6e483.0x5cb0a9dcbd41fbd4.0x76f988da831153b5.0x983e5152ee66dfab.0xa831c66d2db43210.0xb00327c898fb213f.0xbf597fc7beef0ee4.0xc6e00bf33da88fc2.0xd5a79147930aa725.0x06ca6351e003826f.0x142929670a0e6e70.0x27b70a8546d22ffc.0x2e1b21385c26c926.0x4d2c6dfc5ac42aed.0x53380d139d95b3df.0x650a73548baf63de.0x766a0abb3c77b2a8.0x81c2c92e47edaee6.0x92722c851482353b.0xa2bfe8a14cf10364.0xa81a664bbc423001.0xc24b8b70d0f89791.0xc76c51a30654be30.0xd192e819d6ef5218.0xd69906245565a910.0xf40e35855771202a.0x106aa07032bbd1b8.0x19a4c116b8d2d0c8.0x1e376c085141ab53.0x2748774cdf8eeb99.0x34b0bcb5e19b48a8.0x391c0cb3c5c95a63.0x4ed8aa4ae3418acb.0x5b9cca4f7763e373.0x682e6ff3d6b2b8a3.0x748f82ee5defb2fc.0x78a5636f43172f60.0x84c87814a1f0ab72.0x8cc702081a6439ec.0x90befffa23631e28.0xa4506cebde82bde9.0xbef9a3f7b2c67915.0xc67178f2e372532b.0xca273eceea26619c.0xd186b8c721c0c207.0xeada7dd6cde0eb1e.0xf57d4f7fee6ed178.0x06f067aa72176fba.0x0a637dc5a2c898a6.0x113f9804bef90dae.0x1b710b35131c471b.0x28db77f523047d84.0x32caab7b40c72493.0x3c9ebe0a15c9bebc.0x431d67c49c100d4c.0x4cc5d4becb3e42b6.0x597f299cfc657e2a.0x5fcb6fab3ad6faec.0x6c44198c4a475817`.split(`.`)).map(e=>BigInt(e))),re=ne[0],ie=ne[1],L=/* @__PURE__ */ new Uint32Array(80),R=/* @__PURE__ */ new Uint32Array(80);var z=class extends b{constructor(e){super(128,e,16,!1)}get(){let{Ah:e,Al:t,Bh:n,Bl:r,Ch:i,Cl:a,Dh:o,Dl:s,Eh:c,El:l,Fh:u,Fl:d,Gh:f,Gl:p,Hh:m,Hl:h}=this;return[e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h]}set(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h){this.Ah=e|0,this.Al=t|0,this.Bh=n|0,this.Bl=r|0,this.Ch=i|0,this.Cl=a|0,this.Dh=o|0,this.Dl=s|0,this.Eh=c|0,this.El=l|0,this.Fh=u|0,this.Fl=d|0,this.Gh=f|0,this.Gl=p|0,this.Hh=m|0,this.Hl=h|0}process(e,t){for(let n=0;n<16;n++,t+=4)L[n]=e.getUint32(t),R[n]=e.getUint32(t+=4);for(let e=16;e<80;e++){let t=L[e-15]|0,n=R[e-15]|0,r=O(t,n,1)^O(t,n,8)^E(t,n,7),i=k(t,n,1)^k(t,n,8)^D(t,n,7),a=L[e-2]|0,o=R[e-2]|0,s=O(a,o,19)^A(a,o,61)^E(a,o,6),c=k(a,o,19)^j(a,o,61)^D(a,o,6),l=F(i,c,R[e-7],R[e-16]),u=ee(l,r,s,L[e-7],L[e-16]);L[e]=u|0,R[e]=l|0}let{Ah:n,Al:r,Bh:i,Bl:a,Ch:o,Cl:s,Dh:c,Dl:l,Eh:u,El:d,Fh:f,Fl:p,Gh:m,Gl:h,Hh:g,Hl:_}=this;for(let e=0;e<80;e++){let t=O(u,d,14)^O(u,d,18)^A(u,d,41),v=k(u,d,14)^k(u,d,18)^j(u,d,41),y=u&f^~u&m,b=d&p^~d&h,x=te(_,v,b,ie[e],R[e]),S=I(x,g,t,y,re[e],L[e]),C=x|0,w=O(n,r,28)^A(n,r,34)^A(n,r,39),T=k(n,r,28)^j(n,r,34)^j(n,r,39),E=n&i^n&o^i&o,D=r&a^r&s^a&s;g=m|0,_=h|0,m=f|0,h=p|0,f=u|0,p=d|0,{h:u,l:d}=M(c|0,l|0,S|0,C|0),c=o|0,l=s|0,o=i|0,s=a|0,i=n|0,a=r|0;let F=N(C,T,D);n=P(F,S,w,E),r=F|0}({h:n,l:r}=M(this.Ah|0,this.Al|0,n|0,r|0)),{h:i,l:a}=M(this.Bh|0,this.Bl|0,i|0,a|0),{h:o,l:s}=M(this.Ch|0,this.Cl|0,o|0,s|0),{h:c,l}=M(this.Dh|0,this.Dl|0,c|0,l|0),{h:u,l:d}=M(this.Eh|0,this.El|0,u|0,d|0),{h:f,l:p}=M(this.Fh|0,this.Fl|0,f|0,p|0),{h:m,l:h}=M(this.Gh|0,this.Gl|0,m|0,h|0),{h:g,l:_}=M(this.Hh|0,this.Hl|0,g|0,_|0),this.set(n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_)}roundClean(){g(L,R)}destroy(){g(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}},B=class extends z{Ah=x[0]|0;Al=x[1]|0;Bh=x[2]|0;Bl=x[3]|0;Ch=x[4]|0;Cl=x[5]|0;Dh=x[6]|0;Dl=x[7]|0;Eh=x[8]|0;El=x[9]|0;Fh=x[10]|0;Fl=x[11]|0;Gh=x[12]|0;Gl=x[13]|0;Hh=x[14]|0;Hl=x[15]|0;constructor(){super(64)}};const V=/* @__PURE__ */ v(()=>new B,/* @__PURE__ */ y(3));var H=ArrayBuffer,U=Uint8Array,ae=Uint16Array,W=Int16Array,G=Int32Array,oe=function(e,t,n){if(U.prototype.slice)return U.prototype.slice.call(e,t,n);(t==null||t<0)&&(t=0),(n==null||n>e.length)&&(n=e.length);var r=new U(n-t);return r.set(e.subarray(t,n)),r},K=function(e,t,n,r){if(U.prototype.fill)return U.prototype.fill.call(e,t,n,r);for((n==null||n<0)&&(n=0),(r==null||r>e.length)&&(r=e.length);n<r;++n)e[n]=t;return e},se=function(e,t,n,r){if(U.prototype.copyWithin)return U.prototype.copyWithin.call(e,t,n,r);for((n==null||n<0)&&(n=0),(r==null||r>e.length)&&(r=e.length);n<r;)e[t++]=e[n++]},ce=[`invalid zstd data`,`window size too large (>2046MB)`,`invalid block type`,`FSE accuracy too high`,`match distance too far back`,`unexpected EOF`],q=function(e,t,n){var r=Error(t||ce[e]);if(r.code=e,Error.captureStackTrace&&Error.captureStackTrace(r,q),!n)throw r;return r},le=function(e,t,n){for(var r=0,i=0;r<n;++r)i|=e[t++]<<(r<<3);return i},ue=function(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0},de=function(e,t){var n=e[0]|e[1]<<8|e[2]<<16;if(n==3126568&&e[3]==253){var r=e[4],i=r>>5&1,a=r>>2&1,o=r&3,s=r>>6;r&8&&q(0);var c=6-i,l=o==3?4:o,u=le(e,c,l);c+=l;var d=s?1<<s:i,f=le(e,c,d)+(s==1&&256),p=f;if(!i){var m=1<<10+(e[5]>>3);p=m+(m>>3)*(e[5]&7)}p>2145386496&&q(1);var h=new U((t==1?f||p:t?0:p)+12);return h[0]=1,h[4]=4,h[8]=8,{b:c+d,y:0,l:0,d:u,w:t&&t!=1?t:h.subarray(12),e:p,o:new G(h.buffer,0,3),u:f,c:a,m:Math.min(131072,p)}}if((n>>4|e[3]<<20)==25481893)return ue(e,4)+8;q(0)},J=function(e){for(var t=0;1<<t<=e;++t);return t-1},Y=function(e,t,n){var r=(t<<3)+4,i=(e[t]&15)+5;i>n&&q(3);for(var a=1<<i,o=a,s=-1,c=-1,l=-1,u=a,d=new H(512+(a<<2)),f=new W(d,0,256),p=new ae(d,0,256),m=new ae(d,512,a),h=512+(a<<1),g=new U(d,h,a),_=new U(d,h+a);s<255&&o>0;){var v=J(o+1),y=r>>3,b=(1<<v+1)-1,x=(e[y]|e[y+1]<<8|e[y+2]<<16)>>(r&7)&b,S=(1<<v)-1,C=b-o-1,w=x&S;if(w<C?(r+=v,x=w):(r+=v+1,x>S&&(x-=C)),f[++s]=--x,x==-1?(o+=x,g[--u]=s):o-=x,!x)do{var T=r>>3;c=(e[T]|e[T+1]<<8)>>(r&7)&3,r+=2,s+=c}while(c==3)}(s>255||o)&&q(0);for(var E=0,D=(a>>1)+(a>>3)+3,O=a-1,k=0;k<=s;++k){var A=f[k];if(A<1)p[k]=-A;else for(l=0;l<A;++l){g[E]=k;do E=E+D&O;while(E>=u)}}for(E&&q(0),l=0;l<a;++l){var j=p[g[l]]++,M=_[l]=i-J(j);m[l]=(j<<M)-a}return[r+7>>3,{b:i,s:g,n:_,t:m}]},fe=function(e,t){var n=0,r=-1,i=new U(292),a=e[t],o=i.subarray(0,256),s=i.subarray(256,268),c=new ae(i.buffer,268);if(a<128){var l=Y(e,t+1,6),u=l[0],d=l[1];t+=a;var f=u<<3,p=e[t];p||q(0);for(var m=0,h=0,g=d.b,_=g,v=(++t<<3)-8+J(p);v-=g,!(v<f);){var y=v>>3;if(m+=(e[y]|e[y+1]<<8)>>(v&7)&(1<<g)-1,o[++r]=d.s[m],v-=_,v<f)break;y=v>>3,h+=(e[y]|e[y+1]<<8)>>(v&7)&(1<<_)-1,o[++r]=d.s[h],g=d.n[m],m=d.t[m],_=d.n[h],h=d.t[h]}++r>255&&q(0)}else{for(r=a-127;n<r;n+=2){var b=e[++t];o[n]=b>>4,o[n+1]=b&15}++t}var x=0;for(n=0;n<r;++n){var S=o[n];S>11&&q(0),x+=S&&1<<S-1}var C=J(x)+1,w=1<<C,T=w-x;for(T&T-1&&q(0),o[r++]=J(T)+1,n=0;n<r;++n){var S=o[n];++s[o[n]=S&&C+1-S]}var E=new U(w<<1),D=E.subarray(0,w),O=E.subarray(w);for(c[C]=0,n=C;n>0;--n){var k=c[n];K(O,n,k,c[n-1]=k+s[n]*(1<<C-n))}for(c[0]!=w&&q(0),n=0;n<r;++n){var A=o[n];if(A){var j=c[A];K(D,n,j,c[A]=j+(1<<C-A))}}return[t,{n:O,b:C,s:D}]},pe=(/*#__PURE__*/ Y(/*#__PURE__*/ new U([81,16,99,140,49,198,24,99,12,33,196,24,99,102,102,134,70,146,4]),0,6))[1],me=(/*#__PURE__*/ Y(/*#__PURE__*/ new U([33,20,196,24,99,140,33,132,16,66,8,33,132,16,66,8,33,68,68,68,68,68,68,68,68,36,9]),0,6))[1],he=(/*#__PURE__ */ Y(/*#__PURE__*/ new U([32,132,16,66,102,70,68,68,68,68,36,73,2]),0,5))[1],ge=function(e,t){for(var n=e.length,r=new G(n),i=0;i<n;++i)r[i]=t,t+=1<<e[i];return r},_e=/*#__PURE__ */ new U((/*#__PURE__ */ new G([0,0,0,0,16843009,50528770,134678020,202050057,269422093])).buffer,0,36),ve=/*#__PURE__ */ ge(_e,0),ye=/*#__PURE__ */ new U((/*#__PURE__ */ new G([0,0,0,0,0,0,0,0,16843009,50528770,117769220,185207048,252579084,16])).buffer,0,53),be=/*#__PURE__ */ ge(ye,3),X=function(e,t,n){var r=e.length,i=t.length,a=e[r-1],o=(1<<n.b)-1,s=-n.b;a||q(0);for(var c=0,l=n.b,u=(r<<3)-8+J(a)-l,d=-1;u>s&&d<i;){var f=u>>3,p=(e[f]|e[f+1]<<8|e[f+2]<<16)>>(u&7);c=(c<<l|p)&o,t[++d]=n.s[c],u-=l=n.n[c]}(u!=s||d+1!=i)&&q(0)},xe=function(e,t,n){var r=6,i=t.length+3>>2,a=i<<1,o=i+a;X(e.subarray(r,r+=e[0]|e[1]<<8),t.subarray(0,i),n),X(e.subarray(r,r+=e[2]|e[3]<<8),t.subarray(i,a),n),X(e.subarray(r,r+=e[4]|e[5]<<8),t.subarray(a,o),n),X(e.subarray(r),t.subarray(o),n)},Se=function(e,t,n){var r,i=t.b,a=e[i],o=a>>1&3;t.l=a&1;var s=a>>3|e[i+1]<<5|e[i+2]<<13,c=(i+=3)+s;if(o==1)return i>=e.length?void 0:(t.b=i+1,n?(K(n,e[i],t.y,t.y+=s),n):K(new U(s),e[i]));if(!(c>e.length)){if(o==0)return t.b=c,n?(n.set(e.subarray(i,c),t.y),t.y+=s,n):oe(e,i,c);if(o==2){var l=e[i],u=l&3,d=l>>2&3,f=l>>4,p=0,m=0;u<2?d&1?f|=e[++i]<<4|(d&2&&e[++i]<<12):f=l>>3:(m=d,d<2?(f|=(e[++i]&63)<<4,p=e[i]>>6|e[++i]<<2):d==2?(f|=e[++i]<<4|(e[++i]&3)<<12,p=e[i]>>2|e[++i]<<6):(f|=e[++i]<<4|(e[++i]&63)<<12,p=e[i]>>6|e[++i]<<2|e[++i]<<10)),++i;var h=n?n.subarray(t.y,t.y+t.m):new U(t.m),g=h.length-f;if(u==0)h.set(e.subarray(i,i+=f),g);else if(u==1)K(h,e[i++],g);else{var _=t.h;if(u==2){var v=fe(e,i);p+=i-(i=v[0]),t.h=_=v[1]}else _||q(0);(m?xe:X)(e.subarray(i,i+=p),h.subarray(g),_)}var y=e[i++];if(y){y==255?y=(e[i++]|e[i++]<<8)+32512:y>127&&(y=y-128<<8|e[i++]);var b=e[i++];b&3&&q(0);for(var x=[me,he,pe],S=2;S>-1;--S){var C=b>>(S<<1)+2&3;if(C==1){var w=new U([0,0,e[i++]]);x[S]={s:w.subarray(2,3),n:w.subarray(0,1),t:new ae(w.buffer,0,1),b:0}}else C==2?(r=Y(e,i,9-(S&1)),i=r[0],x[S]=r[1]):C==3&&(t.t||q(0),x[S]=t.t[S])}var T=t.t=x,E=T[0],D=T[1],O=T[2],k=e[c-1];k||q(0);var A=(c<<3)-8+J(k)-O.b,j=A>>3,M=0,N=(e[j]|e[j+1]<<8)>>(A&7)&(1<<O.b)-1;j=(A-=D.b)>>3;var P=(e[j]|e[j+1]<<8)>>(A&7)&(1<<D.b)-1;j=(A-=E.b)>>3;var F=(e[j]|e[j+1]<<8)>>(A&7)&(1<<E.b)-1;for(++y;--y;){var ee=O.s[N],te=O.n[N],I=E.s[F],ne=E.n[F],re=D.s[P],ie=D.n[P];j=(A-=re)>>3;var L=1<<re,R=L+((e[j]|e[j+1]<<8|e[j+2]<<16|e[j+3]<<24)>>>(A&7)&L-1);j=(A-=ye[I])>>3;var z=be[I]+((e[j]|e[j+1]<<8|e[j+2]<<16)>>(A&7)&(1<<ye[I])-1);j=(A-=_e[ee])>>3;var B=ve[ee]+((e[j]|e[j+1]<<8|e[j+2]<<16)>>(A&7)&(1<<_e[ee])-1);if(j=(A-=te)>>3,N=O.t[N]+((e[j]|e[j+1]<<8)>>(A&7)&(1<<te)-1),j=(A-=ne)>>3,F=E.t[F]+((e[j]|e[j+1]<<8)>>(A&7)&(1<<ne)-1),j=(A-=ie)>>3,P=D.t[P]+((e[j]|e[j+1]<<8)>>(A&7)&(1<<ie)-1),R>3)t.o[2]=t.o[1],t.o[1]=t.o[0],t.o[0]=R-=3;else{var V=R-(B!=0);V?(R=V==3?t.o[0]-1:t.o[V],V>1&&(t.o[2]=t.o[1]),t.o[1]=t.o[0],t.o[0]=R):R=t.o[0]}for(var S=0;S<B;++S)h[M+S]=h[g+S];M+=B,g+=B;var H=M-R;if(H<0){var W=-H,G=t.e+H;W>z&&(W=z);for(var S=0;S<W;++S)h[M+S]=t.w[G+S];M+=W,z-=W,H=0}for(var S=0;S<z;++S)h[M+S]=h[H+S];M+=z}if(M!=g)for(;g<h.length;)h[M++]=h[g++];else M=h.length;n?t.y+=M:h=oe(h,0,M)}else if(n){if(t.y+=f,g)for(var S=0;S<f;++S)h[S]=h[g+S]}else g&&(h=oe(h,g));return t.b=c,h}q(2)}},Ce=function(e,t){if(e.length==1)return e[0];for(var n=new U(t),r=0,i=0;r<e.length;++r){var a=e[r];n.set(a,i),i+=a.length}return n};function we(e,t){for(var n=[],r=+!t,i=0,a=0;e.length;){var o=de(e,r||t);if(typeof o==`object`){for(r?(t=null,o.w.length==o.u&&(n.push(t=o.w),a+=o.u)):(n.push(t),o.e=0);!o.l;){var s=Se(e,o,t);s||q(5),t?o.e=o.y:(n.push(s),a+=s.length,se(o.w,0,s.length),o.w.set(s,o.w.length-s.length))}i=o.b+o.c*4}else i=o;e=e.subarray(i)}return Ce(n,a)}const Te=new TextEncoder().encode(`
4
+ ---- Bun! ----
5
+ `),Ee=`/$bunfs/root/`,De=[40,181,47,253],Oe=/* @__PURE__ */ new Set([0,1,2,3]);function ke(e,t){outer:for(let n=e.length-t.length;n>=0;n--){for(let r=0;r<t.length;r++)if(e[n+r]!==t[r])continue outer;return n}return-1}function Ae(e){let t=e=>{throw Error(`not a Bun executable this playground can read: ${e}`)},n=e.subarray(Math.max(0,e.length-(1<<20))),r=ke(n,Te);r<0&&t(`no module graph`);let i=e.length-n.length+r,a=new DataView(e.buffer,e.byteOffset,e.byteLength),o=i-32,s=Number(a.getBigUint64(o,!0)),c=a.getUint32(o+8,!0),l=a.getUint32(o+12,!0),u=a.getUint32(o+16,!0),d=o-s;(d<0||c+l>s)&&t(`its offsets are out of range`),l%52&&t(`its module list is not of 52-byte records`);let f=e.subarray(d,o),p=(e,n)=>(e+n>f.length&&t(`a module is out of range`),f.subarray(e,e+n)),m=new DataView(f.buffer,f.byteOffset,f.byteLength),h=new TextDecoder(`latin1`),g=[];for(let e=c;e<c+l;e+=52){let n=t=>m.getUint32(e+4*t,!0),r=h.decode(p(n(0),n(1)));r.startsWith(Ee)||t(`a module named ${JSON.stringify(r.slice(0,40))}`),g.push({name:r.slice(13),contents:p(n(2),n(3)),encoding:f[e+48],loader:f[e+49]})}return u>=g.length&&t(`no entry point`),{modules:g,entry:u}}function je(e){let{modules:t,entry:n}=Ae(e),r={1:new TextDecoder(`latin1`),2:new TextDecoder(`utf-8`)},i=/* @__PURE__ */ new Map,a=[];return t.forEach(({name:e,contents:t,encoding:o,loader:s},c)=>{if(s===10)return;if(!Oe.has(s)){let n=De.every((e,n)=>t[n]===e);a.push({name:e,data:n?we(t):t.slice()});return}let l=(r[o]??r[1]).decode(t);i.set(c===n?`cli.js`:e,l.replaceAll(`"${Ee}`,`"${Me(e)}`).replaceAll(`import.meta.require`,`require`).replace(/import\.meta\.dir\b(?!name)/g,`import.meta.dirname`))}),{modules:i,assets:a}}function Me(e){let t=e.split(`/`).length-1;return t?`../`.repeat(t):`./`}var Ne=new URL(`esbuild-DJd0QPVm.wasm`,import.meta.url).href;new TextDecoder;let Pe=null;function Fe(){return Pe??=import(`./browser-CpIeD-9w.js`).then(e=>/* @__PURE__ */ c(e.default,1)).then(async e=>(await e.initialize({wasmURL:Ne,worker:!0}),e)),Pe}new TextDecoder;const Z={version:`2.1.306`,tarball:`https://registry.npmjs.org/@anthropic-ai/claude-code-linux-x64/-/claude-code-linux-x64-2.1.306.tgz`,integrity:`sha512-4gsb0IQhxzi1NhoUETXkNZb1t6wJ9tnfAYBKmb0+NmsAwOG37Dacq7bLqsooEkusaT0PyQRFUMt0SgWxx9LEEA==`,binary:`package/claude`},Q=`versions`,Ie=[{name:`node_modules/ws/index.js`,data:new TextEncoder().encode(`class WebSocket { constructor() { throw new Error('ws: not in the playground'); } }
6
+ module.exports = WebSocket;
7
+ module.exports.WebSocket = WebSocket;
8
+ module.exports.WebSocketServer = WebSocket;
9
+ `)},{name:`package.json`,data:new TextEncoder().encode(`{"type":"commonjs"}
10
+ `)},{name:`node_modules/node-fetch/index.js`,data:new TextEncoder().encode(`module.exports = (...args) => fetch(...args);
11
+ module.exports.default = module.exports;
12
+ Object.assign(module.exports, { Headers, Request, Response });
13
+ `)}];async function Le(e,t){let n=await Fe(),r=new TextEncoder,i=[...e.keys()],a=[],o=-1;for(let s=0;s<i.length;s+=32){let c=i.slice(s,s+32),l=await Promise.all(c.map(t=>n.transform(e.get(t),{loader:`js`,format:`cjs`,platform:`node`,target:`es2022`,sourcefile:`/opt/claude-code/${t}`,minifyWhitespace:!0,logLevel:`silent`,banner:`require=globalThis.__bunRequire(require);var __bunImportMetaUrl=require("url").pathToFileURL(__filename).href;`,define:{"import.meta.url":`__bunImportMetaUrl`,"import.meta.dirname":`__dirname`,"import.meta.filename":`__filename`}})));c.forEach((e,t)=>a.push({name:e,data:r.encode(l[t].code)}));let u=Math.floor(a.length/i.length*10)*10;u>o&&t(`\rclaude: compiling its modules ${o=u}%`)}return t(`
14
+ `),a}function $(e){return new Promise((t,n)=>{e.onsuccess=()=>t(e.result),e.onerror=()=>n(e.error)})}function Re(){let e=indexedDB.open(`playground-claude-code`,1);return e.onupgradeneeded=()=>e.result.createObjectStore(Q),$(e)}async function ze(e){let t=await Re();try{return await $(t.transaction(Q).objectStore(Q).get(e))??null}finally{t.close()}}async function Be(e,t){let n=await Re();try{let r=n.transaction(Q,`readwrite`).objectStore(Q);for(let t of await $(r.getAllKeys()))t!==e&&r.delete(t);await $(r.put(t,e))}finally{n.close()}}async function Ve(e){let t=await fetch(Z.tarball);if(!t.ok||!t.body)throw Error(`${Z.tarball} answered ${t.status}`);let n=Number(t.headers.get(`content-length`))||0,r=V.create(),i=0,a=-1,o=await He(t.body.pipeThrough(new TransformStream({transform(t,o){r.update(t),i+=t.length;let s=n?Math.floor(i/n*100):0;n&&s>=a+10&&(a=s-s%10,e(`\rclaude: downloading Claude Code ${Z.version} (${Math.round(n/1048576)} MB) ${a}%`)),o.enqueue(t)}})).pipeThrough(new DecompressionStream(`gzip`)).getReader(),Z.binary);e(`
15
+ `);let s=r.digest(),c=``;for(let e of s)c+=String.fromCharCode(e);if(`sha512-${btoa(c)}`!==Z.integrity)throw Error(`${Z.tarball}: does not match its integrity`);if(!o)throw Error(`${Z.tarball}: has no ${Z.binary}`);return o}async function He(e,t){let n=/* @__PURE__ */ new Uint8Array,r=!1,i=async t=>{for(;n.length<t&&!r;){let t=await e.read();if(t.done)r=!0;else{let e=new Uint8Array(n.length+t.value.length);e.set(n),e.set(t.value,n.length),n=e}}},a=e=>{let t=e.indexOf(0);return new TextDecoder().decode(t<0?e:e.subarray(0,t))},o=null,s=null;for(;await i(512),!(n.length<512||n[0]===0);){let e=n.subarray(0,512),r=a(e.subarray(345,500)),c=s??(r?`${r}/`:``)+a(e.subarray(0,100));s=null;let l=parseInt(a(e.subarray(124,136)).trim()||`0`,8),u=String.fromCharCode(e[156]);n=n.slice(512);let d=Math.ceil(l/512)*512,f=c===t&&(u===`0`||u===`\0`)?new Uint8Array(l):null,p=u===`x`||u===`L`?new Uint8Array(l):null,m=0;for(;m<d;){if(await i(1),!n.length)throw Error(`the tarball ends early`);let e=Math.min(n.length,d-m),t=n.subarray(0,Math.min(e,Math.max(0,l-m)));t.length&&(f??p)?.set(t,m),m+=e,n=n.slice(e)}if(u===`L`&&p&&(s=a(p)),u===`x`&&p){let e=/(?:^|\n)\d+ path=([^\n]*)\n/.exec(new TextDecoder().decode(p));e&&(s=e[1])}f&&(o=f)}for(;!r;)r=(await e.read()).done;return o}async function Ue(e){let t=`${Z.version}/4`,n=await ze(t).catch(()=>null);if(n)return n;let r=await Ve(e);e(`claude: reading Claude Code's JavaScript out of its executable
16
+ `);let{modules:i,assets:a}=je(r),o=[...a,...Ie,...await Le(i,e)];return await Be(t,o).catch(t=>e(`claude: could not keep it for the next run (${t.message})\n`)),o}const We=/* @__PURE__ */ new Set,Ge=e=>{for(let t of We)t(e)};self.onmessage=({data:e,ports:t})=>{if(e?.kind!==`playground-claude`||!t[0])return;let n=new d(t[0]).handle({async files(){let e=e=>n.emit(`progress`,e);We.add(e);try{let e=await navigator.locks.request(`playground-claude-code`,()=>Ue(Ge)),t=[...new Set(e.map(e=>e.data.buffer))];return u({version:Z.version,files:e},t)}finally{We.delete(e)}}})};export{o as t};
package/git.js ADDED
@@ -0,0 +1 @@
1
+ import{_ as e,n as t,o as n}from"./chunks/fs-GnBaZCKr.js";import{d as r}from"./chunks/wasi-M0pSoirQ.js";import{_ as i,a,d as o,i as s,m as c,n as l,r as u,t as d,y as f}from"./chunks/git-remote-DnEba0y9.js";var p=[`/work`,`/tmp`,`/home`,`/shared`],m=null,h=[],g=!1,_=e=>{let t=new Uint8Array(e.reduce((e,t)=>e+t.length,0)),n=0;for(let r of e)t.set(r,n),n+=r.length;return t},v=e=>({stream:!0,sink:t=>void e.push(t.slice())});async function y({id:e,args:t,cwd:n,env:r,stdin:o}){let s=[],l=[],u=c(o??new Uint8Array),d=m.spawn({program:`git`,args:t,cwd:n,env:{...a,...r,PWD:n},stdio:[u,v(s),v(l)]});return i(u),d?{id:e,code:await m.wait(d.pid,0)??1,stdout:_(s),stderr:_(l)}:{id:e,code:127,stdout:new Uint8Array,stderr:new Uint8Array}}async function b(){if(!g){for(g=!0;h.length;){let e=h.shift(),t;try{t=await y(e)}catch(n){let r=new TextEncoder().encode(`git: ${String(n)}\n`);t={id:e.id,code:1,stdout:new Uint8Array,stderr:r}}postMessage(t,{transfer:[t.stdout.buffer,t.stderr.buffer]})}g=!1}}onmessage=({data:i})=>{if(i.kind===`start`){let a=new t;for(let e of[...p.map(e=>e.slice(1)),`home/user`])a.mkdirs(e);a.mkdirs(`usr/share/git-core/templates`),a.put(`dev/urandom`,e()),a.put(`dev/null`,n());let c={prefixes:p,call:r(i.files.doorbell,i.files.channel)},h=()=>new Uint8Array;m=new o((e,t)=>{let n=e.split(`/`).pop();return n===`git`&&/^remote-https?$/.test(t[0]??``)?u(s(location.origin)):n!==`git`&&!l.has(n)?null:f(m,i.git,{root:a,fetch:h,shared:c,argv0:n,defaults:{GIT_PAGER:`cat`,...d}})})}else h.push(i),b()};
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2017 Toru Nagashima
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,9 @@
1
+ MIT License
2
+
3
+ Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,9 @@
1
+ MIT License
2
+
3
+ Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2014 Jameson Little
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) Feross Aboukhadijeh, and other contributors.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,73 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
10
+
11
+ "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
12
+
13
+ "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
14
+
15
+ "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
16
+
17
+ "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
18
+
19
+ "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
20
+
21
+ "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
22
+
23
+ "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
24
+
25
+ "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
26
+
27
+ "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
28
+
29
+ 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
30
+
31
+ 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
32
+
33
+ 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
34
+
35
+ (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and
36
+
37
+ (b) You must cause any modified files to carry prominent notices stating that You changed the files; and
38
+
39
+ (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
40
+
41
+ (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
42
+
43
+ You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
44
+
45
+ 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
46
+
47
+ 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
48
+
49
+ 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
50
+
51
+ 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
52
+
53
+ 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
54
+
55
+ END OF TERMS AND CONDITIONS
56
+
57
+ APPENDIX: How to apply the Apache License to your work.
58
+
59
+ To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives.
60
+
61
+ Copyright [yyyy] [name of copyright owner]
62
+
63
+ Licensed under the Apache License, Version 2.0 (the "License");
64
+ you may not use this file except in compliance with the License.
65
+ You may obtain a copy of the License at
66
+
67
+ http://www.apache.org/licenses/LICENSE-2.0
68
+
69
+ Unless required by applicable law or agreed to in writing, software
70
+ distributed under the License is distributed on an "AS IS" BASIS,
71
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
72
+ See the License for the specific language governing permissions and
73
+ limitations under the License.
@@ -0,0 +1,11 @@
1
+ Elixir Playground (run-elixir.dev)
2
+ Copyright 2026 The Elixir Playground Authors
3
+
4
+ Licensed under the Apache License, Version 2.0 (LICENSE), except where a
5
+ file or directory says otherwise: tools/wasi-compat/ is MIT (its LICENSE),
6
+ and the patches to third-party code (beam/patches/, brush/patches/,
7
+ tools/*/patches/) are under the license of the code they patch.
8
+
9
+ What the site serves bundles third-party software under its own licenses.
10
+ Each package lists it in NOTICE.md and licenses/, and the site's
11
+ /licenses/ page lists everything a deploy serves (docs/licenses.md).
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2020 Evan Wallace
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,22 @@
1
+ MIT
2
+
3
+ Copyright Joyent, Inc. and other Node contributors.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a
6
+ copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to permit
10
+ persons to whom the Software is furnished to do so, subject to the
11
+ following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included
14
+ in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
17
+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
19
+ NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
20
+ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
21
+ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
22
+ USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023 Arjun Barrett
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2020 Arjun Barrett
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,9 @@
1
+ MIT License
2
+
3
+ Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,11 @@
1
+ Copyright 2008 Fair Oaks Labs, Inc.
2
+
3
+ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
4
+
5
+ 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
6
+
7
+ 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
8
+
9
+ 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
10
+
11
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.