sliccy 1.26.0 → 1.26.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.
Files changed (26) hide show
  1. package/dist/ui/assets/{___vite-browser-external_commonjs-proxy-CHwSqyaL.js → ___vite-browser-external_commonjs-proxy-7U87kfBv.js} +1 -1
  2. package/dist/ui/assets/{anthropic-D8zI8Nff.js → anthropic-CfFsAbhs.js} +1 -1
  3. package/dist/ui/assets/{azure-openai-responses-Cn4_jzZn.js → azure-openai-responses-DX9SzdYk.js} +1 -1
  4. package/dist/ui/assets/{bsh-watchdog-Xz_nMzv3.js → bsh-watchdog-DthzjzbF.js} +1 -1
  5. package/dist/ui/assets/{google--oqRhLvu.js → google-Dgcj8p2Y.js} +1 -1
  6. package/dist/ui/assets/{google-gemini-cli-B6mB4wL_.js → google-gemini-cli-3EajcUec.js} +1 -1
  7. package/dist/ui/assets/{google-shared-r_CAb7zy.js → google-shared-D1yWx-8k.js} +1 -1
  8. package/dist/ui/assets/{google-vertex-CKlcmQCp.js → google-vertex-CWmtNuIQ.js} +1 -1
  9. package/dist/ui/assets/{index-BFFYFi3J.js → index-CgFkFStV.js} +1 -1
  10. package/dist/ui/assets/{index-CIrAhfog.js → index-DIookCYH.js} +1 -1
  11. package/dist/ui/assets/{index-W9ryXG_v.js → index-DJPmZw4a.js} +10 -10
  12. package/dist/ui/assets/{index-DM18cGzV.js → index-d-ZPN7pB.js} +1 -1
  13. package/dist/ui/assets/{index-CeFIcjS_.js → index-nEt-VnbM.js} +1 -1
  14. package/dist/ui/assets/{json-parse-DYeOImVX.js → json-parse-CRcpIgF_.js} +1 -1
  15. package/dist/ui/assets/{mistral-Bs98_Nne.js → mistral-B5PVshqk.js} +1 -1
  16. package/dist/ui/assets/{offscreen-client-Dn63QmN9.js → offscreen-client-Dj7EBRST.js} +1 -1
  17. package/dist/ui/assets/{openai-codex-responses-2iZbtSiB.js → openai-codex-responses-q2oyEW2I.js} +1 -1
  18. package/dist/ui/assets/{openai-completions-CbVbaGxp.js → openai-completions-DwmKL5b1.js} +1 -1
  19. package/dist/ui/assets/{openai-responses-3q4QP6Y1.js → openai-responses-I0hZgQNc.js} +1 -1
  20. package/dist/ui/assets/{openai-responses-shared-Ce1dVnHc.js → openai-responses-shared-DipKQ09W.js} +1 -1
  21. package/dist/ui/assets/pyodide-4ipJLcSu.js +3 -0
  22. package/dist/ui/assets/{sql-wasm-HmbifZVM.js → sql-wasm-xEgzZ1j4.js} +1 -1
  23. package/dist/ui/index.html +1 -1
  24. package/dist/ui/packages/webapp/index.html +1 -1
  25. package/package.json +3 -3
  26. package/dist/ui/assets/pyodide-CZ-fFl8u.js +0 -3
@@ -1,4 +1,4 @@
1
- import{O as C}from"./client-DFw1b8C8.js";import{t as S,A as M,g as I,b as q,s as b,d as O,a as P}from"./index-W9ryXG_v.js";import{p as v}from"./json-parse-DYeOImVX.js";import{s as x}from"./sanitize-unicode-cmozpu7l.js";import{h as N,b as F}from"./github-copilot-headers-CrHPofPv.js";var T={};function B(e){for(const s of e)if(s.role==="toolResult"||s.role==="assistant"&&s.content.some(t=>t.type==="toolCall"))return!0;return!1}const j=(e,s,t)=>{const n=new M;return(async()=>{const o={role:"assistant",content:[],api:e.api,provider:e.provider,model:e.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:"stop",timestamp:Date.now()};try{const r=t?.apiKey||I(e.provider)||"",i=D(e,s,r,t?.headers);let p=U(e,s,t);const g=await t?.onPayload?.(p,e);g!==void 0&&(p=g);const h=await i.chat.completions.create(p,{signal:t?.signal});n.push({type:"start",partial:o});let a=null;const d=o.content,R=()=>d.length-1,k=f=>{f&&(f.type==="text"?n.push({type:"text_end",contentIndex:R(),content:f.text,partial:o}):f.type==="thinking"?n.push({type:"thinking_end",contentIndex:R(),content:f.thinking,partial:o}):f.type==="toolCall"&&(f.arguments=v(f.partialArgs),delete f.partialArgs,n.push({type:"toolcall_end",contentIndex:R(),toolCall:f,partial:o})))};for await(const f of h){if(!f||typeof f!="object")continue;o.responseId||=f.id,f.usage&&(o.usage=E(f.usage,e));const c=Array.isArray(f.choices)?f.choices[0]:void 0;if(c){if(!f.usage&&c.usage&&(o.usage=E(c.usage,e)),c.finish_reason){const m=K(c.finish_reason);o.stopReason=m.stopReason,m.errorMessage&&(o.errorMessage=m.errorMessage)}if(c.delta){c.delta.content!==null&&c.delta.content!==void 0&&c.delta.content.length>0&&((!a||a.type!=="text")&&(k(a),a={type:"text",text:""},o.content.push(a),n.push({type:"text_start",contentIndex:R(),partial:o})),a.type==="text"&&(a.text+=c.delta.content,n.push({type:"text_delta",contentIndex:R(),delta:c.delta.content,partial:o})));const m=["reasoning_content","reasoning","reasoning_text"];let l=null;for(const u of m)if(c.delta[u]!==null&&c.delta[u]!==void 0&&c.delta[u].length>0&&!l){l=u;break}if(l&&((!a||a.type!=="thinking")&&(k(a),a={type:"thinking",thinking:"",thinkingSignature:l},o.content.push(a),n.push({type:"thinking_start",contentIndex:R(),partial:o})),a.type==="thinking")){const u=c.delta[l];a.thinking+=u,n.push({type:"thinking_delta",contentIndex:R(),delta:u,partial:o})}if(c?.delta?.tool_calls){for(const u of c.delta.tool_calls)if((!a||a.type!=="toolCall"||u.id&&a.id!==u.id)&&(k(a),a={type:"toolCall",id:u.id||"",name:u.function?.name||"",arguments:{},partialArgs:""},o.content.push(a),n.push({type:"toolcall_start",contentIndex:R(),partial:o})),a.type==="toolCall"){u.id&&(a.id=u.id),u.function?.name&&(a.name=u.function.name);let _="";u.function?.arguments&&(_=u.function.arguments,a.partialArgs+=u.function.arguments,a.arguments=v(a.partialArgs)),n.push({type:"toolcall_delta",contentIndex:R(),delta:_,partial:o})}}const y=c.delta.reasoning_details;if(y&&Array.isArray(y)){for(const u of y)if(u.type==="reasoning.encrypted"&&u.id&&u.data){const _=o.content.find(A=>A.type==="toolCall"&&A.id===u.id);_&&(_.thoughtSignature=JSON.stringify(u))}}}}}if(k(a),t?.signal?.aborted)throw new Error("Request was aborted");if(o.stopReason==="aborted")throw new Error("Request was aborted");if(o.stopReason==="error")throw new Error(o.errorMessage||"Provider returned an error stop reason");n.push({type:"done",reason:o.stopReason,message:o}),n.end()}catch(r){for(const p of o.content)delete p.index;o.stopReason=t?.signal?.aborted?"aborted":"error",o.errorMessage=r instanceof Error?r.message:JSON.stringify(r);const i=r?.error?.metadata?.raw;i&&(o.errorMessage+=`
1
+ import{O as C}from"./client-DFw1b8C8.js";import{t as S,A as M,g as I,b as q,s as b,d as O,a as P}from"./index-DJPmZw4a.js";import{p as v}from"./json-parse-CRcpIgF_.js";import{s as x}from"./sanitize-unicode-cmozpu7l.js";import{h as N,b as F}from"./github-copilot-headers-CrHPofPv.js";var T={};function B(e){for(const s of e)if(s.role==="toolResult"||s.role==="assistant"&&s.content.some(t=>t.type==="toolCall"))return!0;return!1}const j=(e,s,t)=>{const n=new M;return(async()=>{const o={role:"assistant",content:[],api:e.api,provider:e.provider,model:e.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:"stop",timestamp:Date.now()};try{const r=t?.apiKey||I(e.provider)||"",i=D(e,s,r,t?.headers);let p=U(e,s,t);const g=await t?.onPayload?.(p,e);g!==void 0&&(p=g);const h=await i.chat.completions.create(p,{signal:t?.signal});n.push({type:"start",partial:o});let a=null;const d=o.content,R=()=>d.length-1,k=f=>{f&&(f.type==="text"?n.push({type:"text_end",contentIndex:R(),content:f.text,partial:o}):f.type==="thinking"?n.push({type:"thinking_end",contentIndex:R(),content:f.thinking,partial:o}):f.type==="toolCall"&&(f.arguments=v(f.partialArgs),delete f.partialArgs,n.push({type:"toolcall_end",contentIndex:R(),toolCall:f,partial:o})))};for await(const f of h){if(!f||typeof f!="object")continue;o.responseId||=f.id,f.usage&&(o.usage=E(f.usage,e));const c=Array.isArray(f.choices)?f.choices[0]:void 0;if(c){if(!f.usage&&c.usage&&(o.usage=E(c.usage,e)),c.finish_reason){const m=K(c.finish_reason);o.stopReason=m.stopReason,m.errorMessage&&(o.errorMessage=m.errorMessage)}if(c.delta){c.delta.content!==null&&c.delta.content!==void 0&&c.delta.content.length>0&&((!a||a.type!=="text")&&(k(a),a={type:"text",text:""},o.content.push(a),n.push({type:"text_start",contentIndex:R(),partial:o})),a.type==="text"&&(a.text+=c.delta.content,n.push({type:"text_delta",contentIndex:R(),delta:c.delta.content,partial:o})));const m=["reasoning_content","reasoning","reasoning_text"];let l=null;for(const u of m)if(c.delta[u]!==null&&c.delta[u]!==void 0&&c.delta[u].length>0&&!l){l=u;break}if(l&&((!a||a.type!=="thinking")&&(k(a),a={type:"thinking",thinking:"",thinkingSignature:l},o.content.push(a),n.push({type:"thinking_start",contentIndex:R(),partial:o})),a.type==="thinking")){const u=c.delta[l];a.thinking+=u,n.push({type:"thinking_delta",contentIndex:R(),delta:u,partial:o})}if(c?.delta?.tool_calls){for(const u of c.delta.tool_calls)if((!a||a.type!=="toolCall"||u.id&&a.id!==u.id)&&(k(a),a={type:"toolCall",id:u.id||"",name:u.function?.name||"",arguments:{},partialArgs:""},o.content.push(a),n.push({type:"toolcall_start",contentIndex:R(),partial:o})),a.type==="toolCall"){u.id&&(a.id=u.id),u.function?.name&&(a.name=u.function.name);let _="";u.function?.arguments&&(_=u.function.arguments,a.partialArgs+=u.function.arguments,a.arguments=v(a.partialArgs)),n.push({type:"toolcall_delta",contentIndex:R(),delta:_,partial:o})}}const y=c.delta.reasoning_details;if(y&&Array.isArray(y)){for(const u of y)if(u.type==="reasoning.encrypted"&&u.id&&u.data){const _=o.content.find(A=>A.type==="toolCall"&&A.id===u.id);_&&(_.thoughtSignature=JSON.stringify(u))}}}}}if(k(a),t?.signal?.aborted)throw new Error("Request was aborted");if(o.stopReason==="aborted")throw new Error("Request was aborted");if(o.stopReason==="error")throw new Error(o.errorMessage||"Provider returned an error stop reason");n.push({type:"done",reason:o.stopReason,message:o}),n.end()}catch(r){for(const p of o.content)delete p.index;o.stopReason=t?.signal?.aborted?"aborted":"error",o.errorMessage=r instanceof Error?r.message:JSON.stringify(r);const i=r?.error?.metadata?.raw;i&&(o.errorMessage+=`
2
2
  ${i}`),n.push({type:"error",reason:o.stopReason,error:o}),n.end()}})(),n},X=(e,s,t)=>{const n=t?.apiKey||I(e.provider);if(!n)throw new Error(`No API key for provider: ${e.provider}`);const o=q(e,t,n),r=b(e)?t?.reasoning:O(t?.reasoning),i=t?.toolChoice;return j(e,s,{...o,reasoningEffort:r,toolChoice:i})};function D(e,s,t,n){if(!t){if(!T.OPENAI_API_KEY)throw new Error("OpenAI API key is required. Set OPENAI_API_KEY environment variable or pass it as an argument.");t=T.OPENAI_API_KEY}const o={...e.headers};if(e.provider==="github-copilot"){const r=N(s.messages),i=F({messages:s.messages,hasImages:r});Object.assign(o,i)}return n&&Object.assign(o,n),new C({apiKey:t,baseURL:e.baseUrl,dangerouslyAllowBrowser:!0,defaultHeaders:o})}function U(e,s,t){const n=W(e),o=z(e,s,n);G(e,o);const r={model:e.id,messages:o,stream:!0};if(n.supportsUsageInStreaming!==!1&&(r.stream_options={include_usage:!0}),n.supportsStore&&(r.store=!1),t?.maxTokens&&(n.maxTokensField==="max_tokens"?r.max_tokens=t.maxTokens:r.max_completion_tokens=t.maxTokens),t?.temperature!==void 0&&(r.temperature=t.temperature),s.tools?r.tools=$(s.tools,n):B(s.messages)&&(r.tools=[]),t?.toolChoice&&(r.tool_choice=t.toolChoice),n.thinkingFormat==="zai"&&e.reasoning)r.enable_thinking=!!t?.reasoningEffort;else if(n.thinkingFormat==="qwen"&&e.reasoning)r.enable_thinking=!!t?.reasoningEffort;else if(n.thinkingFormat==="qwen-chat-template"&&e.reasoning)r.chat_template_kwargs={enable_thinking:!!t?.reasoningEffort};else if(n.thinkingFormat==="openrouter"&&e.reasoning){const i=r;t?.reasoningEffort?i.reasoning={effort:w(t.reasoningEffort,n.reasoningEffortMap)}:i.reasoning={effort:"none"}}else t?.reasoningEffort&&e.reasoning&&n.supportsReasoningEffort&&(r.reasoning_effort=w(t.reasoningEffort,n.reasoningEffortMap));if(e.baseUrl.includes("openrouter.ai")&&e.compat?.openRouterRouting&&(r.provider=e.compat.openRouterRouting),e.baseUrl.includes("ai-gateway.vercel.sh")&&e.compat?.vercelGatewayRouting){const i=e.compat.vercelGatewayRouting;if(i.only||i.order){const p={};i.only&&(p.only=i.only),i.order&&(p.order=i.order),r.providerOptions={gateway:p}}}return r}function w(e,s){return s[e]??e}function G(e,s){if(!(e.provider!=="openrouter"||!e.id.startsWith("anthropic/")))for(let t=s.length-1;t>=0;t--){const n=s[t];if(n.role!=="user"&&n.role!=="assistant")continue;const o=n.content;if(typeof o=="string"){n.content=[Object.assign({type:"text",text:o},{cache_control:{type:"ephemeral"}})];return}if(Array.isArray(o))for(let r=o.length-1;r>=0;r--){const i=o[r];if(i?.type==="text"){Object.assign(i,{cache_control:{type:"ephemeral"}});return}}}}function z(e,s,t){const n=[],o=p=>{if(p.includes("|")){const[g]=p.split("|");return g.replace(/[^a-zA-Z0-9_-]/g,"_").slice(0,40)}return e.provider==="openai"&&p.length>40?p.slice(0,40):p},r=S(s.messages,e,p=>o(p));if(s.systemPrompt){const g=e.reasoning&&t.supportsDeveloperRole?"developer":"system";n.push({role:g,content:x(s.systemPrompt)})}let i=null;for(let p=0;p<r.length;p++){const g=r[p];if(t.requiresAssistantAfterToolResult&&i==="toolResult"&&g.role==="user"&&n.push({role:"assistant",content:"I have processed the tool results."}),g.role==="user")if(typeof g.content=="string")n.push({role:"user",content:x(g.content)});else{const h=g.content.map(d=>d.type==="text"?{type:"text",text:x(d.text)}:{type:"image_url",image_url:{url:`data:${d.mimeType};base64,${d.data}`}}),a=e.input.includes("image")?h:h.filter(d=>d.type!=="image_url");if(a.length===0)continue;n.push({role:"user",content:a})}else if(g.role==="assistant"){const h={role:"assistant",content:t.requiresAssistantAfterToolResult?"":null},d=g.content.filter(l=>l.type==="text").filter(l=>l.text&&l.text.trim().length>0);d.length>0&&(h.content=d.map(l=>x(l.text)).join(""));const k=g.content.filter(l=>l.type==="thinking").filter(l=>l.thinking&&l.thinking.trim().length>0);if(k.length>0)if(t.requiresThinkingAsText){const l=k.map(u=>u.thinking).join(`
3
3
 
4
4
  `),y=h.content;y?y.unshift({type:"text",text:l}):h.content=[{type:"text",text:l}]}else{const l=k[0].thinkingSignature;l&&l.length>0&&(h[l]=k.map(y=>y.thinking).join(`
@@ -1 +1 @@
1
- import{O as d}from"./client-DFw1b8C8.js";import{A as m,g as u,b as l,s as g,d as h}from"./index-W9ryXG_v.js";import{h as v,b as R}from"./github-copilot-headers-CrHPofPv.js";import{p as y,c as _,a as E}from"./openai-responses-shared-Ce1dVnHc.js";import"./hash-DMDecQcg.js";import"./json-parse-DYeOImVX.js";import"./sanitize-unicode-cmozpu7l.js";var c={};const w=new Set(["openai","openai-codex","opencode"]);function A(e){return e||(typeof process<"u"&&c.PI_CACHE_RETENTION==="long"?"long":"short")}function b(e,a){if(a==="long"&&e.includes("api.openai.com"))return"24h"}const I=(e,a,r)=>{const n=new m;return(async()=>{const t={role:"assistant",content:[],api:e.api,provider:e.provider,model:e.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:"stop",timestamp:Date.now()};try{const s=r?.apiKey||u(e.provider)||"",o=O(e,a,s,r?.headers);let i=P(e,a,r);const p=await r?.onPayload?.(i,e);p!==void 0&&(i=p);const f=await o.responses.create(i,r?.signal?{signal:r.signal}:void 0);if(n.push({type:"start",partial:t}),await y(f,t,n,e,{serviceTier:r?.serviceTier,applyServiceTierPricing:S}),r?.signal?.aborted)throw new Error("Request was aborted");if(t.stopReason==="aborted"||t.stopReason==="error")throw new Error("An unknown error occurred");n.push({type:"done",reason:t.stopReason,message:t}),n.end()}catch(s){for(const o of t.content)delete o.index;t.stopReason=r?.signal?.aborted?"aborted":"error",t.errorMessage=s instanceof Error?s.message:JSON.stringify(s),n.push({type:"error",reason:t.stopReason,error:t}),n.end()}})(),n},W=(e,a,r)=>{const n=r?.apiKey||u(e.provider);if(!n)throw new Error(`No API key for provider: ${e.provider}`);const t=l(e,r,n),s=g(e)?r?.reasoning:h(r?.reasoning);return I(e,a,{...t,reasoningEffort:s})};function O(e,a,r,n){if(!r){if(!c.OPENAI_API_KEY)throw new Error("OpenAI API key is required. Set OPENAI_API_KEY environment variable or pass it as an argument.");r=c.OPENAI_API_KEY}const t={...e.headers};if(e.provider==="github-copilot"){const s=v(a.messages),o=R({messages:a.messages,hasImages:s});Object.assign(t,o)}return n&&Object.assign(t,n),new d({apiKey:r,baseURL:e.baseUrl,dangerouslyAllowBrowser:!0,defaultHeaders:t})}function P(e,a,r){const n=_(e,a,w),t=A(r?.cacheRetention),s={model:e.id,input:n,stream:!0,prompt_cache_key:t==="none"?void 0:r?.sessionId,prompt_cache_retention:b(e.baseUrl,t),store:!1};return r?.maxTokens&&(s.max_output_tokens=r?.maxTokens),r?.temperature!==void 0&&(s.temperature=r?.temperature),r?.serviceTier!==void 0&&(s.service_tier=r.serviceTier),a.tools&&(s.tools=E(a.tools)),e.reasoning&&(r?.reasoningEffort||r?.reasoningSummary?(s.reasoning={effort:r?.reasoningEffort||"medium",summary:r?.reasoningSummary||"auto"},s.include=["reasoning.encrypted_content"]):s.reasoning={effort:"none"}),s}function T(e){switch(e){case"flex":return .5;case"priority":return 2;default:return 1}}function S(e,a){const r=T(a);r!==1&&(e.cost.input*=r,e.cost.output*=r,e.cost.cacheRead*=r,e.cost.cacheWrite*=r,e.cost.total=e.cost.input+e.cost.output+e.cost.cacheRead+e.cost.cacheWrite)}export{I as streamOpenAIResponses,W as streamSimpleOpenAIResponses};
1
+ import{O as d}from"./client-DFw1b8C8.js";import{A as m,g as u,b as l,s as g,d as h}from"./index-DJPmZw4a.js";import{h as v,b as R}from"./github-copilot-headers-CrHPofPv.js";import{p as y,c as _,a as E}from"./openai-responses-shared-DipKQ09W.js";import"./hash-DMDecQcg.js";import"./json-parse-CRcpIgF_.js";import"./sanitize-unicode-cmozpu7l.js";var c={};const w=new Set(["openai","openai-codex","opencode"]);function A(e){return e||(typeof process<"u"&&c.PI_CACHE_RETENTION==="long"?"long":"short")}function b(e,a){if(a==="long"&&e.includes("api.openai.com"))return"24h"}const I=(e,a,r)=>{const n=new m;return(async()=>{const t={role:"assistant",content:[],api:e.api,provider:e.provider,model:e.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:"stop",timestamp:Date.now()};try{const s=r?.apiKey||u(e.provider)||"",o=O(e,a,s,r?.headers);let i=P(e,a,r);const p=await r?.onPayload?.(i,e);p!==void 0&&(i=p);const f=await o.responses.create(i,r?.signal?{signal:r.signal}:void 0);if(n.push({type:"start",partial:t}),await y(f,t,n,e,{serviceTier:r?.serviceTier,applyServiceTierPricing:S}),r?.signal?.aborted)throw new Error("Request was aborted");if(t.stopReason==="aborted"||t.stopReason==="error")throw new Error("An unknown error occurred");n.push({type:"done",reason:t.stopReason,message:t}),n.end()}catch(s){for(const o of t.content)delete o.index;t.stopReason=r?.signal?.aborted?"aborted":"error",t.errorMessage=s instanceof Error?s.message:JSON.stringify(s),n.push({type:"error",reason:t.stopReason,error:t}),n.end()}})(),n},W=(e,a,r)=>{const n=r?.apiKey||u(e.provider);if(!n)throw new Error(`No API key for provider: ${e.provider}`);const t=l(e,r,n),s=g(e)?r?.reasoning:h(r?.reasoning);return I(e,a,{...t,reasoningEffort:s})};function O(e,a,r,n){if(!r){if(!c.OPENAI_API_KEY)throw new Error("OpenAI API key is required. Set OPENAI_API_KEY environment variable or pass it as an argument.");r=c.OPENAI_API_KEY}const t={...e.headers};if(e.provider==="github-copilot"){const s=v(a.messages),o=R({messages:a.messages,hasImages:s});Object.assign(t,o)}return n&&Object.assign(t,n),new d({apiKey:r,baseURL:e.baseUrl,dangerouslyAllowBrowser:!0,defaultHeaders:t})}function P(e,a,r){const n=_(e,a,w),t=A(r?.cacheRetention),s={model:e.id,input:n,stream:!0,prompt_cache_key:t==="none"?void 0:r?.sessionId,prompt_cache_retention:b(e.baseUrl,t),store:!1};return r?.maxTokens&&(s.max_output_tokens=r?.maxTokens),r?.temperature!==void 0&&(s.temperature=r?.temperature),r?.serviceTier!==void 0&&(s.service_tier=r.serviceTier),a.tools&&(s.tools=E(a.tools)),e.reasoning&&(r?.reasoningEffort||r?.reasoningSummary?(s.reasoning={effort:r?.reasoningEffort||"medium",summary:r?.reasoningSummary||"auto"},s.include=["reasoning.encrypted_content"]):s.reasoning={effort:"none"}),s}function T(e){switch(e){case"flex":return .5;case"priority":return 2;default:return 1}}function S(e,a){const r=T(a);r!==1&&(e.cost.input*=r,e.cost.output*=r,e.cost.cacheRead*=r,e.cost.cacheWrite*=r,e.cost.total=e.cost.input+e.cost.output+e.cost.cacheRead+e.cost.cacheWrite)}export{I as streamOpenAIResponses,W as streamSimpleOpenAIResponses};
@@ -1,4 +1,4 @@
1
- import{a as $,t as v}from"./index-W9ryXG_v.js";import{s as S}from"./hash-DMDecQcg.js";import{p as x}from"./json-parse-DYeOImVX.js";import{s as _}from"./sanitize-unicode-cmozpu7l.js";function C(o,t){const l={v:1,id:o};return t&&(l.phase=t),JSON.stringify(l)}function T(o){if(o){if(o.startsWith("{"))try{const t=JSON.parse(o);if(t.v===1&&typeof t.id=="string")return t.phase==="commentary"||t.phase==="final_answer"?{id:t.id,phase:t.phase}:{id:t.id}}catch{}return{id:o}}}function b(o,t,l,h){const y=[],s=n=>{const r=n.replace(/[^a-zA-Z0-9_-]/g,"_");return(r.length>64?r.slice(0,64):r).replace(/_+$/,"")},i=n=>{const r=`fc_${S(n)}`;return r.length>64?r.slice(0,64):r},k=(n,r,m)=>{if(!l.has(o.provider)||!n.includes("|"))return s(n);const[f,g]=n.split("|"),d=s(f);let p=m.provider!==o.provider||m.api!==o.api?i(g):s(g);return p.startsWith("fc_")||(p=s(`fc_${p}`)),`${d}|${p}`},u=v(t.messages,o,k);if((h?.includeSystemPrompt??!0)&&t.systemPrompt){const n=o.reasoning?"developer":"system";y.push({role:n,content:_(t.systemPrompt)})}let e=0;for(const n of u){if(n.role==="user")if(typeof n.content=="string")y.push({role:"user",content:[{type:"input_text",text:_(n.content)}]});else{const r=n.content.map(f=>f.type==="text"?{type:"input_text",text:_(f.text)}:{type:"input_image",detail:"auto",image_url:`data:${f.mimeType};base64,${f.data}`}),m=o.input.includes("image")?r:r.filter(f=>f.type!=="input_image");if(m.length===0)continue;y.push({role:"user",content:m})}else if(n.role==="assistant"){const r=[],m=n,f=m.model!==o.id&&m.provider===o.provider&&m.api===o.api;for(const g of n.content)if(g.type==="thinking"){if(g.thinkingSignature){const d=JSON.parse(g.thinkingSignature);r.push(d)}}else if(g.type==="text"){const d=g,c=T(d.textSignature);let p=c?.id;p?p.length>64&&(p=`msg_${S(p)}`):p=`msg_${e}`,r.push({type:"message",role:"assistant",content:[{type:"output_text",text:_(d.text),annotations:[]}],status:"completed",id:p,phase:c?.phase})}else if(g.type==="toolCall"){const d=g,[c,p]=d.id.split("|");let I=p;f&&I?.startsWith("fc_")&&(I=void 0),r.push({type:"function_call",id:I,call_id:c,name:d.name,arguments:JSON.stringify(d.arguments)})}if(r.length===0)continue;y.push(...r)}else if(n.role==="toolResult"){const r=n.content.filter(c=>c.type==="text").map(c=>c.text).join(`
1
+ import{a as $,t as v}from"./index-DJPmZw4a.js";import{s as S}from"./hash-DMDecQcg.js";import{p as x}from"./json-parse-CRcpIgF_.js";import{s as _}from"./sanitize-unicode-cmozpu7l.js";function C(o,t){const l={v:1,id:o};return t&&(l.phase=t),JSON.stringify(l)}function T(o){if(o){if(o.startsWith("{"))try{const t=JSON.parse(o);if(t.v===1&&typeof t.id=="string")return t.phase==="commentary"||t.phase==="final_answer"?{id:t.id,phase:t.phase}:{id:t.id}}catch{}return{id:o}}}function b(o,t,l,h){const y=[],s=n=>{const r=n.replace(/[^a-zA-Z0-9_-]/g,"_");return(r.length>64?r.slice(0,64):r).replace(/_+$/,"")},i=n=>{const r=`fc_${S(n)}`;return r.length>64?r.slice(0,64):r},k=(n,r,m)=>{if(!l.has(o.provider)||!n.includes("|"))return s(n);const[f,g]=n.split("|"),d=s(f);let p=m.provider!==o.provider||m.api!==o.api?i(g):s(g);return p.startsWith("fc_")||(p=s(`fc_${p}`)),`${d}|${p}`},u=v(t.messages,o,k);if((h?.includeSystemPrompt??!0)&&t.systemPrompt){const n=o.reasoning?"developer":"system";y.push({role:n,content:_(t.systemPrompt)})}let e=0;for(const n of u){if(n.role==="user")if(typeof n.content=="string")y.push({role:"user",content:[{type:"input_text",text:_(n.content)}]});else{const r=n.content.map(f=>f.type==="text"?{type:"input_text",text:_(f.text)}:{type:"input_image",detail:"auto",image_url:`data:${f.mimeType};base64,${f.data}`}),m=o.input.includes("image")?r:r.filter(f=>f.type!=="input_image");if(m.length===0)continue;y.push({role:"user",content:m})}else if(n.role==="assistant"){const r=[],m=n,f=m.model!==o.id&&m.provider===o.provider&&m.api===o.api;for(const g of n.content)if(g.type==="thinking"){if(g.thinkingSignature){const d=JSON.parse(g.thinkingSignature);r.push(d)}}else if(g.type==="text"){const d=g,c=T(d.textSignature);let p=c?.id;p?p.length>64&&(p=`msg_${S(p)}`):p=`msg_${e}`,r.push({type:"message",role:"assistant",content:[{type:"output_text",text:_(d.text),annotations:[]}],status:"completed",id:p,phase:c?.phase})}else if(g.type==="toolCall"){const d=g,[c,p]=d.id.split("|");let I=p;f&&I?.startsWith("fc_")&&(I=void 0),r.push({type:"function_call",id:I,call_id:c,name:d.name,arguments:JSON.stringify(d.arguments)})}if(r.length===0)continue;y.push(...r)}else if(n.role==="toolResult"){const r=n.content.filter(c=>c.type==="text").map(c=>c.text).join(`
2
2
  `),m=n.content.some(c=>c.type==="image"),f=r.length>0,[g]=n.toolCallId.split("|");let d;if(m&&o.input.includes("image")){const c=[];f&&c.push({type:"input_text",text:_(r)});for(const p of n.content)p.type==="image"&&c.push({type:"input_image",detail:"auto",image_url:`data:${p.mimeType};base64,${p.data}`});d=c}else d=_(f?r:"(see attached image)");y.push({type:"function_call_output",call_id:g,output:d})}e++}return y}function M(o,t){const l=t?.strict===void 0?!1:t.strict;return o.map(h=>({type:"function",name:h.name,description:h.description,parameters:h.parameters,strict:l}))}async function N(o,t,l,h,y){let s=null,i=null;const k=t.content,u=()=>k.length-1;for await(const a of o)if(a.type==="response.created")t.responseId=a.response.id;else if(a.type==="response.output_item.added"){const e=a.item;e.type==="reasoning"?(s=e,i={type:"thinking",thinking:""},t.content.push(i),l.push({type:"thinking_start",contentIndex:u(),partial:t})):e.type==="message"?(s=e,i={type:"text",text:""},t.content.push(i),l.push({type:"text_start",contentIndex:u(),partial:t})):e.type==="function_call"&&(s=e,i={type:"toolCall",id:`${e.call_id}|${e.id}`,name:e.name,arguments:{},partialJson:e.arguments||""},t.content.push(i),l.push({type:"toolcall_start",contentIndex:u(),partial:t}))}else if(a.type==="response.reasoning_summary_part.added")s&&s.type==="reasoning"&&(s.summary=s.summary||[],s.summary.push(a.part));else if(a.type==="response.reasoning_summary_text.delta"){if(s?.type==="reasoning"&&i?.type==="thinking"){s.summary=s.summary||[];const e=s.summary[s.summary.length-1];e&&(i.thinking+=a.delta,e.text+=a.delta,l.push({type:"thinking_delta",contentIndex:u(),delta:a.delta,partial:t}))}}else if(a.type==="response.reasoning_summary_part.done"){if(s?.type==="reasoning"&&i?.type==="thinking"){s.summary=s.summary||[];const e=s.summary[s.summary.length-1];e&&(i.thinking+=`
3
3
 
4
4
  `,e.text+=`
@@ -0,0 +1,3 @@
1
+ import{_ as h}from"./index-DJPmZw4a.js";var ve=Object.defineProperty,s=(e,t)=>ve(e,"name",{value:t,configurable:!0}),M=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')}),be=(()=>{for(var e=new Uint8Array(128),t=0;t<64;t++)e[t<26?t+65:t<52?t+71:t<62?t-4:t*4-205]=t;return r=>{for(var a=r.length,i=new Uint8Array((a-(r[a-1]=="=")-(r[a-2]=="="))*3/4|0),n=0,o=0;n<a;){var l=e[r.charCodeAt(n++)],c=e[r.charCodeAt(n++)],u=e[r.charCodeAt(n++)],d=e[r.charCodeAt(n++)];i[o++]=l<<2|c>>4,i[o++]=c<<4|u>>2,i[o++]=u<<6|d}return i}})();function $(e){return!isNaN(parseFloat(e))&&isFinite(e)}s($,"_isNumber");function g(e){return e.charAt(0).toUpperCase()+e.substring(1)}s(g,"_capitalize");function k(e){return function(){return this[e]}}s(k,"_getter");var N=["isConstructor","isEval","isNative","isToplevel"],I=["columnNumber","lineNumber"],A=["fileName","functionName","source"],Ne=["args"],Ie=["evalOrigin"],D=N.concat(I,A,Ne,Ie);function m(e){if(e)for(var t=0;t<D.length;t++)e[D[t]]!==void 0&&this["set"+g(D[t])](e[D[t]])}s(m,"StackFrame");m.prototype={getArgs:s(function(){return this.args},"getArgs"),setArgs:s(function(e){if(Object.prototype.toString.call(e)!=="[object Array]")throw new TypeError("Args must be an Array");this.args=e},"setArgs"),getEvalOrigin:s(function(){return this.evalOrigin},"getEvalOrigin"),setEvalOrigin:s(function(e){if(e instanceof m)this.evalOrigin=e;else if(e instanceof Object)this.evalOrigin=new m(e);else throw new TypeError("Eval Origin must be an Object or StackFrame")},"setEvalOrigin"),toString:s(function(){var e=this.getFileName()||"",t=this.getLineNumber()||"",r=this.getColumnNumber()||"",a=this.getFunctionName()||"";return this.getIsEval()?e?"[eval] ("+e+":"+t+":"+r+")":"[eval]:"+t+":"+r:a?a+" ("+e+":"+t+":"+r+")":e+":"+t+":"+r},"toString")};m.fromString=s(function(e){var t=e.indexOf("("),r=e.lastIndexOf(")"),a=e.substring(0,t),i=e.substring(t+1,r).split(","),n=e.substring(r+1);if(n.indexOf("@")===0)var o=/@(.+?)(?::(\d+))?(?::(\d+))?$/.exec(n,""),l=o[1],c=o[2],u=o[3];return new m({functionName:a,args:i||void 0,fileName:l,lineNumber:c||void 0,columnNumber:u||void 0})},"StackFrame$$fromString");for(w=0;w<N.length;w++)m.prototype["get"+g(N[w])]=k(N[w]),m.prototype["set"+g(N[w])]=(function(e){return function(t){this[e]=!!t}})(N[w]);var w;for(E=0;E<I.length;E++)m.prototype["get"+g(I[E])]=k(I[E]),m.prototype["set"+g(I[E])]=(function(e){return function(t){if(!$(t))throw new TypeError(e+" must be a Number");this[e]=Number(t)}})(I[E]);var E;for(v=0;v<A.length;v++)m.prototype["get"+g(A[v])]=k(A[v]),m.prototype["set"+g(A[v])]=(function(e){return function(t){this[e]=String(t)}})(A[v]);var v,F=m;function B(){var e=/^\s*at .*(\S+:\d+|\(native\))/m,t=/^(eval@)?(\[native code])?$/;return{parse:s(function(r){if(r.stack&&r.stack.match(e))return this.parseV8OrIE(r);if(r.stack)return this.parseFFOrSafari(r);throw new Error("Cannot parse given Error object")},"ErrorStackParser$$parse"),extractLocation:s(function(r){if(r.indexOf(":")===-1)return[r];var a=/(.+?)(?::(\d+))?(?::(\d+))?$/,i=a.exec(r.replace(/[()]/g,""));return[i[1],i[2]||void 0,i[3]||void 0]},"ErrorStackParser$$extractLocation"),parseV8OrIE:s(function(r){var a=r.stack.split(`
2
+ `).filter(function(i){return!!i.match(e)},this);return a.map(function(i){i.indexOf("(eval ")>-1&&(i=i.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(,.*$)/g,""));var n=i.replace(/^\s+/,"").replace(/\(eval code/g,"(").replace(/^.*?\s+/,""),o=n.match(/ (\(.+\)$)/);n=o?n.replace(o[0],""):n;var l=this.extractLocation(o?o[1]:n),c=o&&n||void 0,u=["eval","<anonymous>"].indexOf(l[0])>-1?void 0:l[0];return new F({functionName:c,fileName:u,lineNumber:l[1],columnNumber:l[2],source:i})},this)},"ErrorStackParser$$parseV8OrIE"),parseFFOrSafari:s(function(r){var a=r.stack.split(`
3
+ `).filter(function(i){return!i.match(t)},this);return a.map(function(i){if(i.indexOf(" > eval")>-1&&(i=i.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),i.indexOf("@")===-1&&i.indexOf(":")===-1)return new F({functionName:i});var n=/((.*".+"[^@]*)?[^@]*)(?:@)/,o=i.match(n),l=o&&o[1]?o[1]:void 0,c=this.extractLocation(i.replace(n,""));return new F({functionName:l,fileName:c[0],lineNumber:c[1],columnNumber:c[2],source:i})},this)},"ErrorStackParser$$parseFFOrSafari")}}s(B,"ErrorStackParser");var Ae=new B,Oe=Ae;function V(){if(typeof API<"u"&&API!==globalThis.API)return API.runtimeEnv;let e=typeof Bun<"u",t=typeof Deno<"u",r=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string"&&!process.browser,a=typeof navigator=="object"&&typeof navigator.userAgent=="string"&&navigator.userAgent.indexOf("Chrome")===-1&&navigator.userAgent.indexOf("Safari")>-1;return j({IN_BUN:e,IN_DENO:t,IN_NODE:r,IN_SAFARI:a,IN_SHELL:typeof read=="function"&&typeof load=="function"})}s(V,"getGlobalRuntimeEnv");var f=V();function j(e){let t=e.IN_NODE&&typeof module<"u"&&module.exports&&typeof M=="function"&&typeof __dirname=="string",r=e.IN_NODE&&!t,a=!e.IN_NODE&&!e.IN_DENO&&!e.IN_BUN,i=a&&typeof window<"u"&&typeof window.document<"u"&&typeof document.createElement=="function"&&"sessionStorage"in window&&typeof globalThis.importScripts!="function",n=a&&typeof globalThis.WorkerGlobalScope<"u"&&typeof globalThis.self<"u"&&globalThis.self instanceof globalThis.WorkerGlobalScope;return{...e,IN_BROWSER:a,IN_BROWSER_MAIN_THREAD:i,IN_BROWSER_WEB_WORKER:n,IN_NODE_COMMONJS:t,IN_NODE_ESM:r}}s(j,"calculateDerivedFlags");var H,L,z,W,x;async function U(){if(!f.IN_NODE||(H=(await h(async()=>{const{default:n}=await import("./__vite-browser-external-D7Ct-6yo.js").then(o=>o._);return{default:n}},[])).default,W=await h(()=>import("./__vite-browser-external-D7Ct-6yo.js").then(n=>n._),[]),x=await h(()=>import("./__vite-browser-external-D7Ct-6yo.js").then(n=>n._),[]),z=(await h(async()=>{const{default:n}=await import("./__vite-browser-external-D7Ct-6yo.js").then(o=>o._);return{default:n}},[])).default,L=await h(()=>import("./__vite-browser-external-D7Ct-6yo.js").then(n=>n._),[]),C=L.sep,typeof M<"u"))return;let e=W,t=await h(()=>import("./__vite-browser-external-D7Ct-6yo.js").then(n=>n._),[]),r=await h(()=>import("./__vite-browser-external-D7Ct-6yo.js").then(n=>n._),[]),a=await h(()=>import("./__vite-browser-external-D7Ct-6yo.js").then(n=>n._),[]),i={fs:e,crypto:t,ws:r,child_process:a};globalThis.require=function(n){return i[n]}}s(U,"initNodeModules");function q(e,t){return L.resolve(t||".",e)}s(q,"node_resolvePath");function G(e,t){return t===void 0&&(t=location),new URL(e,t).toString()}s(G,"browser_resolvePath");var R;f.IN_NODE?R=q:f.IN_SHELL?R=s(e=>e,"resolvePath"):R=G;var C;f.IN_NODE||(C="/");function J(e,t){return e.startsWith("file://")&&(e=e.slice(7)),e.includes("://")?{response:fetch(e)}:{binary:x.readFile(e).then(r=>new Uint8Array(r.buffer,r.byteOffset,r.byteLength))}}s(J,"node_getBinaryResponse");function K(e,t){if(e.startsWith("file://")&&(e=e.slice(7)),e.includes("://"))throw new Error("Shell cannot fetch urls");return{binary:Promise.resolve(new Uint8Array(readbuffer(e)))}}s(K,"shell_getBinaryResponse");function Y(e,t){let r=new URL(e,location);return{response:fetch(r,t?{integrity:t}:{})}}s(Y,"browser_getBinaryResponse");var P;f.IN_NODE?P=J:f.IN_SHELL?P=K:P=Y;async function Z(e,t){let{response:r,binary:a}=P(e,t);if(a)return a;let i=await r;if(!i.ok)throw new Error(`Failed to load '${e}': request failed.`);return new Uint8Array(await i.arrayBuffer())}s(Z,"loadBinaryFile");var O;if(f.IN_BROWSER_MAIN_THREAD)O=s(async e=>await import(e),"loadScript");else if(f.IN_BROWSER_WEB_WORKER)O=s(async e=>{try{globalThis.importScripts(e)}catch(t){if(t instanceof TypeError)await import(e);else throw t}},"loadScript");else if(f.IN_NODE)O=Q;else if(f.IN_SHELL)O=load;else throw new Error("Cannot determine runtime environment");async function Q(e){e.startsWith("file://")&&(e=e.slice(7)),e.includes("://")?z.runInThisContext(await(await fetch(e)).text()):await import(H.pathToFileURL(e).href)}s(Q,"nodeLoadScript");async function X(e){if(f.IN_NODE){await U();let t=await x.readFile(e,{encoding:"utf8"});return JSON.parse(t)}else if(f.IN_SHELL){let t=read(e);return JSON.parse(t)}else return await(await fetch(e)).json()}s(X,"loadLockFile");async function ee(){if(f.IN_NODE_COMMONJS)return __dirname;let e;try{throw new Error}catch(a){e=a}let t=Oe.parse(e)[0].fileName;if(f.IN_NODE&&!t.startsWith("file://")&&(t=`file://${t}`),f.IN_NODE_ESM){let a=await h(()=>import("./__vite-browser-external-D7Ct-6yo.js").then(i=>i._),[]);return(await h(async()=>{const{fileURLToPath:i}=await import("./__vite-browser-external-D7Ct-6yo.js").then(n=>n._);return{fileURLToPath:i}},[])).fileURLToPath(a.dirname(t))}let r=t.lastIndexOf(C);if(r===-1)throw new Error("Could not extract indexURL path from pyodide module location. Please pass the indexURL explicitly to loadPyodide.");return t.slice(0,r)}s(ee,"calculateDirname");function te(e){return e.substring(0,e.lastIndexOf("/")+1)||globalThis.location?.toString()||"."}s(te,"calculateInstallBaseUrl");function re(e){let t=e.FS,r=e.FS.filesystems.MEMFS,a=e.PATH,i={DIR_MODE:16895,FILE_MODE:33279,mount:s(function(n){if(!n.opts.fileSystemHandle)throw new Error("opts.fileSystemHandle is required");return r.mount.apply(null,arguments)},"mount"),syncfs:s(async(n,o,l)=>{try{let c=i.getLocalSet(n),u=await i.getRemoteSet(n),d=o?u:c,y=o?c:u;await i.reconcile(n,d,y),l(null)}catch(c){l(c)}},"syncfs"),getLocalSet:s(n=>{let o=Object.create(null);function l(d){return d!=="."&&d!==".."}s(l,"isRealDir");function c(d){return y=>a.join2(d,y)}s(c,"toAbsolute");let u=t.readdir(n.mountpoint).filter(l).map(c(n.mountpoint));for(;u.length;){let d=u.pop(),y=t.stat(d);t.isDir(y.mode)&&u.push.apply(u,t.readdir(d).filter(l).map(c(d))),o[d]={timestamp:y.mtime,mode:y.mode}}return{type:"local",entries:o}},"getLocalSet"),getRemoteSet:s(async n=>{let o=Object.create(null),l=await Se(n.opts.fileSystemHandle);for(let[c,u]of l)c!=="."&&(o[a.join2(n.mountpoint,c)]={timestamp:u.kind==="file"?new Date((await u.getFile()).lastModified):new Date,mode:u.kind==="file"?i.FILE_MODE:i.DIR_MODE});return{type:"remote",entries:o,handles:l}},"getRemoteSet"),loadLocalEntry:s(n=>{let o=t.lookupPath(n,{}).node,l=t.stat(n);if(t.isDir(l.mode))return{timestamp:l.mtime,mode:l.mode};if(t.isFile(l.mode))return o.contents=r.getFileDataAsTypedArray(o),{timestamp:l.mtime,mode:l.mode,contents:o.contents};throw new Error("node type not supported")},"loadLocalEntry"),storeLocalEntry:s((n,o)=>{if(t.isDir(o.mode))t.mkdirTree(n,o.mode);else if(t.isFile(o.mode))t.writeFile(n,o.contents,{canOwn:!0});else throw new Error("node type not supported");t.chmod(n,o.mode),t.utime(n,o.timestamp,o.timestamp)},"storeLocalEntry"),removeLocalEntry:s(n=>{var o=t.stat(n);t.isDir(o.mode)?t.rmdir(n):t.isFile(o.mode)&&t.unlink(n)},"removeLocalEntry"),loadRemoteEntry:s(async n=>{if(n.kind==="file"){let o=await n.getFile();return{contents:new Uint8Array(await o.arrayBuffer()),mode:i.FILE_MODE,timestamp:new Date(o.lastModified)}}else{if(n.kind==="directory")return{mode:i.DIR_MODE,timestamp:new Date};throw new Error("unknown kind: "+n.kind)}},"loadRemoteEntry"),storeRemoteEntry:s(async(n,o,l)=>{let c=n.get(a.dirname(o)),u=t.isFile(l.mode)?await c.getFileHandle(a.basename(o),{create:!0}):await c.getDirectoryHandle(a.basename(o),{create:!0});if(u.kind==="file"){let d=await u.createWritable();await d.write(l.contents),await d.close()}n.set(o,u)},"storeRemoteEntry"),removeRemoteEntry:s(async(n,o)=>{await n.get(a.dirname(o)).removeEntry(a.basename(o)),n.delete(o)},"removeRemoteEntry"),reconcile:s(async(n,o,l)=>{let c=0,u=[];Object.keys(o.entries).forEach(function(p){let _=o.entries[p],b=l.entries[p];(!b||t.isFile(_.mode)&&_.timestamp.getTime()>b.timestamp.getTime())&&(u.push(p),c++)}),u.sort();let d=[];if(Object.keys(l.entries).forEach(function(p){o.entries[p]||(d.push(p),c++)}),d.sort().reverse(),!c)return;let y=o.type==="remote"?o.handles:l.handles;for(let p of u){let _=a.normalize(p.replace(n.mountpoint,"/")).substring(1);if(l.type==="local"){let b=y.get(_),Ee=await i.loadRemoteEntry(b);i.storeLocalEntry(p,Ee)}else{let b=i.loadLocalEntry(p);await i.storeRemoteEntry(y,_,b)}}for(let p of d)if(l.type==="local")i.removeLocalEntry(p);else{let _=a.normalize(p.replace(n.mountpoint,"/")).substring(1);await i.removeRemoteEntry(y,_)}},"reconcile")};e.FS.filesystems.NATIVEFS_ASYNC=i}s(re,"initializeNativeFS");var Se=s(async e=>{let t=[];async function r(i){for await(let n of i.values())t.push(n),n.kind==="directory"&&await r(n)}s(r,"collect"),await r(e);let a=new Map;a.set(".",e);for(let i of t){let n=(await e.resolve(i)).join("/");a.set(n,i)}return a},"getFsHandles"),Re=be("AGFzbQEAAAABDANfAGAAAW9gAW8BfwMDAgECByECD2NyZWF0ZV9zZW50aW5lbAAAC2lzX3NlbnRpbmVsAAEKEwIHAPsBAPsbCwkAIAD7GvsUAAs="),Pe=(async function(){if(!(globalThis.navigator&&(/iPad|iPhone|iPod/.test(navigator.userAgent)||navigator.platform==="MacIntel"&&typeof navigator.maxTouchPoints<"u"&&navigator.maxTouchPoints>1)))try{let e=await WebAssembly.compile(Re);return await WebAssembly.instantiate(e)}catch(e){if(e instanceof WebAssembly.CompileError)return;throw e}})();async function ne(){let e=await Pe;if(e)return e.exports;let t=Symbol("error marker");return{create_sentinel:s(()=>t,"create_sentinel"),is_sentinel:s(r=>r===t,"is_sentinel")}}s(ne,"getSentinelImport");function ie(e){let t={config:e,runtimeEnv:f},r={noImageDecoding:!0,noAudioDecoding:!0,noWasmDecoding:!1,preRun:ue(e),print:e.stdout,printErr:e.stderr,onExit(a){r.exitCode=a},thisProgram:e._sysExecutable,arguments:e.args,API:t,locateFile:s(a=>e.indexURL+a,"locateFile"),instantiateWasm:de(e.indexURL)};return r}s(ie,"createSettings");function ae(e){return function(t){let r="/";try{t.FS.mkdirTree(e)}catch(a){console.error(`Error occurred while making a home directory '${e}':`),console.error(a),console.error(`Using '${r}' for a home directory instead`),e=r}t.FS.chdir(e)}}s(ae,"createHomeDirectory");function oe(e){return function(t){Object.assign(t.ENV,e)}}s(oe,"setEnvironment");function se(e){return e?[async t=>{t.addRunDependency("fsInitHook");try{await e(t.FS,{sitePackages:t.API.sitePackages})}finally{t.removeRunDependency("fsInitHook")}}]:[]}s(se,"callFsInitHook");function le(e){let t=e.HEAPU32[e._Py_Version>>>2],r=t>>>24&255,a=t>>>16&255,i=t>>>8&255;return[r,a,i]}s(le,"computeVersionTuple");function ce(e){let t=Z(e);return async r=>{r.API.pyVersionTuple=le(r);let[a,i]=r.API.pyVersionTuple;r.FS.mkdirTree("/lib"),r.API.sitePackages=`/lib/python${a}.${i}/site-packages`,r.FS.mkdirTree(r.API.sitePackages),r.addRunDependency("install-stdlib");try{let n=await t;r.FS.writeFile(`/lib/python${a}${i}.zip`,n)}catch(n){console.error("Error occurred while installing the standard library:"),console.error(n)}finally{r.removeRunDependency("install-stdlib")}}}s(ce,"installStdlib");function ue(e){let t;return e.stdLibURL!=null?t=e.stdLibURL:t=e.indexURL+"python_stdlib.zip",[ce(t),ae(e.env.HOME),oe(e.env),re,...se(e.fsInit)]}s(ue,"getFileSystemInitializationFuncs");function de(e){if(typeof WasmOffsetConverter<"u")return;let{binary:t,response:r}=P(e+"pyodide.asm.wasm"),a=ne();return function(i,n){return(async function(){i.sentinel=await a;try{let o;r?o=await WebAssembly.instantiateStreaming(r,i):o=await WebAssembly.instantiate(await t,i);let{instance:l,module:c}=o;n(l,c)}catch(o){console.warn("wasm instantiation failed!"),console.warn(o)}})(),{}}}s(de,"getInstantiateWasmFunc");var De="0.29.3";function S(e){return e===void 0||e.endsWith("/")?e:e+"/"}s(S,"withTrailingSlash");var T=De;async function fe(e={}){if(await U(),e.lockFileContents&&e.lockFileURL)throw new Error("Can't pass both lockFileContents and lockFileURL");let t=e.indexURL||await ee();if(t=S(R(t)),e.packageBaseUrl=S(e.packageBaseUrl),e.cdnUrl=S(e.packageBaseUrl??`https://cdn.jsdelivr.net/pyodide/v${T}/full/`),!e.lockFileContents){let i=e.lockFileURL??t+"pyodide-lock.json";e.lockFileContents=X(i),e.packageBaseUrl??=te(i)}e.indexURL=t,e.packageCacheDir&&(e.packageCacheDir=S(R(e.packageCacheDir)));let r={fullStdLib:!1,jsglobals:globalThis,stdin:globalThis.prompt?()=>globalThis.prompt():void 0,args:[],env:{},packages:[],packageCacheDir:e.packageBaseUrl,enableRunUntilComplete:!0,checkAPIVersion:!0,BUILD_ID:"b7b7b0f46eb68e65c029c0dc739270e8a5d35251e9aab6014ee1c2f630e5d1d0"},a=Object.assign(r,e);return a.env.HOME??="/home/pyodide",a.env.PYTHONINSPECT??="1",a}s(fe,"initializeConfiguration");function pe(e){let t=ie(e),r=t.API;return r.lockFilePromise=Promise.resolve(e.lockFileContents),t}s(pe,"createEmscriptenSettings");async function me(e){if(typeof _createPyodideModule!="function"){let t=`${e.indexURL}pyodide.asm.js`;await O(t)}}s(me,"loadWasmScript");async function ye(e,t){if(!e._loadSnapshot)return;let r=await e._loadSnapshot,a=ArrayBuffer.isView(r)?r:new Uint8Array(r);return t.noInitialRun=!0,t.INITIAL_MEMORY=a.length,a}s(ye,"prepareSnapshot");async function he(e){let t=await _createPyodideModule(e);if(e.exitCode!==void 0)throw new t.ExitStatus(e.exitCode);return t}s(he,"createPyodideModule");function ge(e,t){let r=e.API;if(t.pyproxyToStringRepr&&r.setPyProxyToStringMethod(!0),t.convertNullToNone&&r.setCompatNullToNone(!0),t.toJsLiteralMap&&r.setCompatToJsLiteralMap(!0),r.version!==T&&t.checkAPIVersion)throw new Error(`Pyodide version does not match: '${T}' <==> '${r.version}'. If you updated the Pyodide version, make sure you also updated the 'indexURL' parameter passed to loadPyodide.`);e.locateFile=a=>{throw a.endsWith(".so")?new Error(`Failed to find dynamic library "${a}"`):new Error(`Unexpected call to locateFile("${a}")`)}}s(ge,"configureAPI");function _e(e,t,r){let a=e.API,i;return t&&(i=a.restoreSnapshot(t)),a.finalizeBootstrap(i,r._snapshotDeserializer)}s(_e,"bootstrapPyodide");async function we(e,t){let r=e._api;return r.sys.path.insert(0,""),r._pyodide.set_excepthook(),await r.packageIndexReady,r.initializeStreams(t.stdin,t.stdout,t.stderr),e}s(we,"finalizeSetup");async function ke(e={}){let t=await fe(e),r=pe(t);await me(t);let a=await ye(t,r),i=await he(r);ge(i,t);let n=_e(i,a,t);return await we(n,t)}s(ke,"loadPyodide");export{ke as loadPyodide,T as version};
@@ -1,2 +1,2 @@
1
- import{G as nn}from"./index-W9ryXG_v.js";import{r as nt}from"./___vite-browser-external_commonjs-proxy-CHwSqyaL.js";function on(j,De){for(var z=0;z<De.length;z++){const Q=De[z];if(typeof Q!="string"&&!Array.isArray(Q)){for(const F in Q)if(F!=="default"&&!(F in j)){const ie=Object.getOwnPropertyDescriptor(Q,F);ie&&Object.defineProperty(j,F,ie.get?ie:{enumerable:!0,get:()=>Q[F]})}}}return Object.freeze(Object.defineProperty(j,Symbol.toStringTag,{value:"Module"}))}var hr={exports:{}},it;function an(){return it||(it=1,(function(j,De){var z=void 0,Q=function(F){return z||(z=new Promise(function(ie,at){var I=typeof F<"u"?F:{},mr=I.onAbort;I.onAbort=function(e){at(new Error(e)),mr&&mr(e)},I.postRun=I.postRun||[],I.postRun.push(function(){ie(I)}),j=void 0;var s;s||=typeof I<"u"?I:{};var ut=!!globalThis.window,Ie=!!globalThis.WorkerGlobalScope,de=globalThis.process?.versions?.node&&globalThis.process?.type!="renderer";s.onRuntimeInitialized=function(){function e(o,l){switch(typeof l){case"boolean":rn(o,l?1:0);break;case"number":Ht(o,l);break;case"string":Kt(o,l,-1,-1);break;case"object":if(l===null)Kr(o);else if(l.length!=null){var h=Le(l.length);q.set(l,h),en(o,h,l.length,-1),ce(h)}else Ue(o,"Wrong API use : tried to return a value of an unknown type ("+l+").",-1);break;default:Kr(o)}}function r(o,l){for(var h=[],m=0;m<o;m+=1){var w=W(l+4*m,"i32"),y=Yt(w);if(y===1||y===2)w=Jt(w);else if(y===3)w=Gt(w);else if(y===4){y=w,w=Ct(y),y=Zt(y);for(var T=new Uint8Array(w),L=0;L<w;L+=1)T[L]=q[y+L];w=T}else w=null;h.push(w)}return h}function t(o,l){this.Qa=o,this.db=l,this.Oa=1,this.lb=[]}function n(o,l){if(this.db=l,this.eb=Oe(o),this.eb===null)throw Error("Unable to allocate memory for the SQL string");this.kb=this.eb,this.Za=this.qb=null}function i(o){if(this.filename="dbfile_"+(4294967295*Math.random()>>>0),o!=null){var l=this.filename,h="/",m=l;if(h&&(h=typeof h=="string"?h:Je(h),m=l?Ce(h+"/"+l):h),l=qr(!0,!0),m=kt(m,l),o){if(typeof o=="string"){h=Array(o.length);for(var w=0,y=o.length;w<y;++w)h[w]=o.charCodeAt(w);o=h}Ne(m,l|146),h=ne(m,577),Qr(h,o,0,o.length,0),nr(h),Ne(m,l)}}this.handleError(c(this.filename,a)),this.db=W(a,"i32"),rt(this.db),this.fb={},this.Sa={}}var a=H(4),u=s.cwrap,c=u("sqlite3_open","number",["string","number"]),b=u("sqlite3_close_v2","number",["number"]),p=u("sqlite3_exec","number",["number","string","number","number","number"]),g=u("sqlite3_changes","number",["number"]),M=u("sqlite3_prepare_v2","number",["number","string","number","number","number"]),Cr=u("sqlite3_sql","string",["number"]),Ot=u("sqlite3_normalized_sql","string",["number"]),Gr=u("sqlite3_prepare_v2","number",["number","number","number","number","number"]),Lt=u("sqlite3_bind_text","number",["number","number","number","number","number"]),Zr=u("sqlite3_bind_blob","number",["number","number","number","number","number"]),xt=u("sqlite3_bind_double","number",["number","number","number"]),Tt=u("sqlite3_bind_int","number",["number","number","number"]),Pt=u("sqlite3_bind_parameter_index","number",["number","string"]),Ut=u("sqlite3_step","number",["number"]),Dt=u("sqlite3_errmsg","string",["number"]),It=u("sqlite3_column_count","number",["number"]),Wt=u("sqlite3_data_count","number",["number"]),jt=u("sqlite3_column_double","number",["number","number"]),Jr=u("sqlite3_column_text","string",["number","number"]),zt=u("sqlite3_column_blob","number",["number","number"]),Qt=u("sqlite3_column_bytes","number",["number","number"]),Ft=u("sqlite3_column_type","number",["number","number"]),$t=u("sqlite3_column_name","string",["number","number"]),Bt=u("sqlite3_reset","number",["number"]),Vt=u("sqlite3_clear_bindings","number",["number"]),Xt=u("sqlite3_finalize","number",["number"]),Hr=u("sqlite3_create_function_v2","number","number string number number number number number number number".split(" ")),Yt=u("sqlite3_value_type","number",["number"]),Ct=u("sqlite3_value_bytes","number",["number"]),Gt=u("sqlite3_value_text","string",["number"]),Zt=u("sqlite3_value_blob","number",["number"]),Jt=u("sqlite3_value_double","number",["number"]),Ht=u("sqlite3_result_double","",["number","number"]),Kr=u("sqlite3_result_null","",["number"]),Kt=u("sqlite3_result_text","",["number","string","number","number"]),en=u("sqlite3_result_blob","",["number","number","number","number"]),rn=u("sqlite3_result_int","",["number","number"]),Ue=u("sqlite3_result_error","",["number","string","number"]),et=u("sqlite3_aggregate_context","number",["number","number"]),rt=u("RegisterExtensionFunctions","number",["number"]),tt=u("sqlite3_update_hook","number",["number","number","number"]);t.prototype.bind=function(o){if(!this.Qa)throw"Statement closed";return this.reset(),Array.isArray(o)?this.Cb(o):o!=null&&typeof o=="object"?this.Db(o):!0},t.prototype.step=function(){if(!this.Qa)throw"Statement closed";this.Oa=1;var o=Ut(this.Qa);switch(o){case 100:return!0;case 101:return!1;default:throw this.db.handleError(o)}},t.prototype.wb=function(o){return o==null&&(o=this.Oa,this.Oa+=1),jt(this.Qa,o)},t.prototype.Gb=function(o){if(o==null&&(o=this.Oa,this.Oa+=1),o=Jr(this.Qa,o),typeof BigInt!="function")throw Error("BigInt is not supported");return BigInt(o)},t.prototype.Hb=function(o){return o==null&&(o=this.Oa,this.Oa+=1),Jr(this.Qa,o)},t.prototype.getBlob=function(o){o==null&&(o=this.Oa,this.Oa+=1);var l=Qt(this.Qa,o);o=zt(this.Qa,o);for(var h=new Uint8Array(l),m=0;m<l;m+=1)h[m]=q[o+m];return h},t.prototype.get=function(o,l){l=l||{},o!=null&&this.bind(o)&&this.step(),o=[];for(var h=Wt(this.Qa),m=0;m<h;m+=1)switch(Ft(this.Qa,m)){case 1:var w=l.useBigInt?this.Gb(m):this.wb(m);o.push(w);break;case 2:o.push(this.wb(m));break;case 3:o.push(this.Hb(m));break;case 4:o.push(this.getBlob(m));break;default:o.push(null)}return o},t.prototype.getColumnNames=function(){for(var o=[],l=It(this.Qa),h=0;h<l;h+=1)o.push($t(this.Qa,h));return o},t.prototype.getAsObject=function(o,l){o=this.get(o,l),l=this.getColumnNames();for(var h={},m=0;m<l.length;m+=1)h[l[m]]=o[m];return h},t.prototype.getSQL=function(){return Cr(this.Qa)},t.prototype.getNormalizedSQL=function(){return Ot(this.Qa)},t.prototype.run=function(o){return o!=null&&this.bind(o),this.step(),this.reset()},t.prototype.tb=function(o,l){l==null&&(l=this.Oa,this.Oa+=1),o=Oe(o),this.lb.push(o),this.db.handleError(Lt(this.Qa,l,o,-1,0))},t.prototype.Bb=function(o,l){l==null&&(l=this.Oa,this.Oa+=1);var h=Le(o.length);q.set(o,h),this.lb.push(h),this.db.handleError(Zr(this.Qa,l,h,o.length,0))},t.prototype.sb=function(o,l){l==null&&(l=this.Oa,this.Oa+=1),this.db.handleError((o===(o|0)?Tt:xt)(this.Qa,l,o))},t.prototype.Eb=function(o){o==null&&(o=this.Oa,this.Oa+=1),Zr(this.Qa,o,0,0,0)},t.prototype.ub=function(o,l){switch(l==null&&(l=this.Oa,this.Oa+=1),typeof o){case"string":this.tb(o,l);return;case"number":this.sb(o,l);return;case"bigint":this.tb(o.toString(),l);return;case"boolean":this.sb(o+0,l);return;case"object":if(o===null){this.Eb(l);return}if(o.length!=null){this.Bb(o,l);return}}throw"Wrong API use : tried to bind a value of an unknown type ("+o+")."},t.prototype.Db=function(o){var l=this;return Object.keys(o).forEach(function(h){var m=Pt(l.Qa,h);m!==0&&l.ub(o[h],m)}),!0},t.prototype.Cb=function(o){for(var l=0;l<o.length;l+=1)this.ub(o[l],l+1);return!0},t.prototype.reset=function(){return this.freemem(),Vt(this.Qa)===0&&Bt(this.Qa)===0},t.prototype.freemem=function(){for(var o;(o=this.lb.pop())!==void 0;)ce(o)},t.prototype.free=function(){this.freemem();var o=Xt(this.Qa)===0;return delete this.db.fb[this.Qa],this.Qa=0,o},n.prototype.next=function(){if(this.eb===null)return{done:!0};if(this.Za!==null&&(this.Za.free(),this.Za=null),!this.db.db)throw this.nb(),Error("Database closed");var o=Te(),l=H(4);le(a),le(l);try{this.db.handleError(Gr(this.db.db,this.kb,-1,a,l)),this.kb=W(l,"i32");var h=W(a,"i32");return h===0?(this.nb(),{done:!0}):(this.Za=new t(h,this.db),this.db.fb[h]=this.Za,{value:this.Za,done:!1})}catch(m){throw this.qb=E(this.kb),this.nb(),m}finally{xe(o)}},n.prototype.nb=function(){ce(this.eb),this.eb=null},n.prototype.getRemainingSQL=function(){return this.qb!==null?this.qb:E(this.kb)},typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"&&(n.prototype[Symbol.iterator]=function(){return this}),i.prototype.run=function(o,l){if(!this.db)throw"Database closed";if(l){o=this.prepare(o,l);try{o.step()}finally{o.free()}}else this.handleError(p(this.db,o,0,0,a));return this},i.prototype.exec=function(o,l,h){if(!this.db)throw"Database closed";var m=null,w=null,y=null;try{y=w=Oe(o);var T=H(4);for(o=[];W(y,"i8")!==0;){le(a),le(T),this.handleError(Gr(this.db,y,-1,a,T));var L=W(a,"i32");if(y=W(T,"i32"),L!==0){var R=null;for(m=new t(L,this),l!=null&&m.bind(l);m.step();)R===null&&(R={columns:m.getColumnNames(),values:[]},o.push(R)),R.values.push(m.get(null,h));m.free()}}return o}catch(P){throw m&&m.free(),P}finally{w&&ce(w)}},i.prototype.each=function(o,l,h,m,w){typeof l=="function"&&(m=h,h=l,l=void 0),o=this.prepare(o,l);try{for(;o.step();)h(o.getAsObject(null,w))}finally{o.free()}if(typeof m=="function")return m()},i.prototype.prepare=function(o,l){if(le(a),this.handleError(M(this.db,o,-1,a,0)),o=W(a,"i32"),o===0)throw"Nothing to prepare";var h=new t(o,this);return l!=null&&h.bind(l),this.fb[o]=h},i.prototype.iterateStatements=function(o){return new n(o,this)},i.prototype.export=function(){Object.values(this.fb).forEach(function(l){l.free()}),Object.values(this.Sa).forEach(V),this.Sa={},this.handleError(b(this.db));var o=Et(this.filename);return this.handleError(c(this.filename,a)),this.db=W(a,"i32"),rt(this.db),o},i.prototype.close=function(){this.db!==null&&(Object.values(this.fb).forEach(function(o){o.free()}),Object.values(this.Sa).forEach(V),this.Sa={},this.Ya&&(V(this.Ya),this.Ya=void 0),this.handleError(b(this.db)),Dr("/"+this.filename),this.db=null)},i.prototype.handleError=function(o){if(o===0)return null;throw o=Dt(this.db),Error(o)},i.prototype.getRowsModified=function(){return g(this.db)},i.prototype.create_function=function(o,l){Object.prototype.hasOwnProperty.call(this.Sa,o)&&(V(this.Sa[o]),delete this.Sa[o]);var h=me(function(m,w,y){w=r(w,y);try{var T=l.apply(null,w)}catch(L){Ue(m,L,-1);return}e(m,T)},"viii");return this.Sa[o]=h,this.handleError(Hr(this.db,o,l.length,1,0,h,0,0,0)),this},i.prototype.create_aggregate=function(o,l){var h=l.init||function(){return null},m=l.finalize||function(R){return R},w=l.step;if(!w)throw"An aggregate function must have a step function in "+o;var y={};Object.hasOwnProperty.call(this.Sa,o)&&(V(this.Sa[o]),delete this.Sa[o]),l=o+"__finalize",Object.hasOwnProperty.call(this.Sa,l)&&(V(this.Sa[l]),delete this.Sa[l]);var T=me(function(R,P,fr){var K=et(R,1);Object.hasOwnProperty.call(y,K)||(y[K]=h()),P=r(P,fr),P=[y[K]].concat(P);try{y[K]=w.apply(null,P)}catch(tn){delete y[K],Ue(R,tn,-1)}},"viii"),L=me(function(R){var P=et(R,1);try{var fr=m(y[P])}catch(K){delete y[P],Ue(R,K,-1);return}e(R,fr),delete y[P]},"vi");return this.Sa[o]=T,this.Sa[l]=L,this.handleError(Hr(this.db,o,w.length-1,1,0,0,T,L,0)),this},i.prototype.updateHook=function(o){return this.Ya&&(tt(this.db,0,0),V(this.Ya),this.Ya=void 0),o?(this.Ya=me(function(l,h,m,w,y){switch(h){case 18:l="insert";break;case 23:l="update";break;case 9:l="delete";break;default:throw"unknown operationCode in updateHook callback: "+h}if(m=E(m),w=E(w),y>Number.MAX_SAFE_INTEGER)throw"rowId too big to fit inside a Number";o(l,m,w,Number(y))},"viiiij"),tt(this.db,this.Ya,0),this):this},s.Database=i};var We="./this.program",pe=(e,r)=>{throw r},je=globalThis.document?.currentScript?.src;typeof __filename<"u"?je=__filename:Ie&&(je=self.location.href);var we="",ze,be;if(de){var Qe=nt;we=__dirname+"/",be=e=>(e=ve(e)?new URL(e):e,Qe.readFileSync(e)),ze=async e=>(e=ve(e)?new URL(e):e,Qe.readFileSync(e,void 0)),1<process.argv.length&&(We=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2),j.exports=s,pe=(e,r)=>{throw process.exitCode=e,r}}else if(ut||Ie){try{we=new URL(".",je).href}catch{}Ie&&(be=e=>{var r=new XMLHttpRequest;return r.open("GET",e,!1),r.responseType="arraybuffer",r.send(null),new Uint8Array(r.response)}),ze=async e=>{if(ve(e))return new Promise((t,n)=>{var i=new XMLHttpRequest;i.open("GET",e,!0),i.responseType="arraybuffer",i.onload=()=>{i.status==200||i.status==0&&i.response?t(i.response):n(i.status)},i.onerror=n,i.send(null)});var r=await fetch(e,{credentials:"same-origin"});if(r.ok)return r.arrayBuffer();throw Error(r.status+" : "+r.url)}}var Fe=console.log.bind(console),Y=console.error.bind(console),oe,ye=!1,$e,ve=e=>e.startsWith("file://"),q,N,ae,k,v,Be,Ve,x;function cr(){var e=Pe.buffer;q=new Int8Array(e),ae=new Int16Array(e),N=new Uint8Array(e),k=new Int32Array(e),v=new Uint32Array(e),Be=new Float32Array(e),Ve=new Float64Array(e),x=new BigInt64Array(e),new BigUint64Array(e)}function ue(e){throw s.onAbort?.(e),e="Aborted("+e+")",Y(e),ye=!0,new WebAssembly.RuntimeError(e+". Build with -sASSERTIONS for more info.")}var Xe;async function st(e){if(!oe)try{var r=await ze(e);return new Uint8Array(r)}catch{}if(e==Xe&&oe)e=new Uint8Array(oe);else if(be)e=be(e);else throw"both async and sync fetching of the wasm failed";return e}async function lt(e,r){try{var t=await st(e);return await WebAssembly.instantiate(t,r)}catch(n){Y(`failed to asynchronously prepare wasm: ${n}`),ue(n)}}async function ft(e){var r=Xe;if(!oe&&!ve(r)&&!de)try{var t=fetch(r,{credentials:"same-origin"});return await WebAssembly.instantiateStreaming(t,e)}catch(n){Y(`wasm streaming compile failed: ${n}`),Y("falling back to ArrayBuffer instantiation")}return lt(r,e)}class Ye{name="ExitStatus";constructor(r){this.message=`Program terminated with exit(${r})`,this.status=r}}var dr=e=>{for(;0<e.length;)e.shift()(s)},pr=[],wr=[],ht=()=>{var e=s.preRun.shift();wr.push(e)},C=0,se=null;function W(e,r="i8"){switch(r.endsWith("*")&&(r="*"),r){case"i1":return q[e];case"i8":return q[e];case"i16":return ae[e>>1];case"i32":return k[e>>2];case"i64":return x[e>>3];case"float":return Be[e>>2];case"double":return Ve[e>>3];case"*":return v[e>>2];default:ue(`invalid type for getValue: ${r}`)}}var _e=!0;function le(e){var r="i32";switch(r.endsWith("*")&&(r="*"),r){case"i1":q[e]=0;break;case"i8":q[e]=0;break;case"i16":ae[e>>1]=0;break;case"i32":k[e>>2]=0;break;case"i64":x[e>>3]=BigInt(0);break;case"float":Be[e>>2]=0;break;case"double":Ve[e>>3]=0;break;case"*":v[e>>2]=0;break;default:ue(`invalid type for setValue: ${r}`)}}var br=new TextDecoder,yr=(e,r,t,n)=>{if(t=r+t,n)return t;for(;e[r]&&!(r>=t);)++r;return r},E=(e,r,t)=>e?br.decode(N.subarray(e,yr(N,e,r,t))):"",vr=(e,r)=>{for(var t=0,n=e.length-1;0<=n;n--){var i=e[n];i==="."?e.splice(n,1):i===".."?(e.splice(n,1),t++):t&&(e.splice(n,1),t--)}if(r)for(;t;t--)e.unshift("..");return e},Ce=e=>{var r=e.charAt(0)==="/",t=e.slice(-1)==="/";return(e=vr(e.split("/").filter(n=>!!n),!r).join("/"))||r||(e="."),e&&t&&(e+="/"),(r?"/":"")+e},_r=e=>{var r=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1);return e=r[0],r=r[1],!e&&!r?".":(r&&=r.slice(0,-1),e+r)},ge=e=>e&&e.match(/([^\/]+|\/)\/*$/)[1],mt=()=>{if(de){var e=nt;return r=>e.randomFillSync(r)}return r=>crypto.getRandomValues(r)},gr=e=>{(gr=mt())(e)},ct=(...e)=>{for(var r="",t=!1,n=e.length-1;-1<=n&&!t;n--){if(t=0<=n?e[n]:"/",typeof t!="string")throw new TypeError("Arguments to path.resolve must be strings");if(!t)return"";r=t+"/"+r,t=t.charAt(0)==="/"}return r=vr(r.split("/").filter(i=>!!i),!t).join("/"),(t?"/":"")+r||"."},ke=e=>{var r=yr(e,0);return br.decode(e.buffer?e.subarray(0,r):new Uint8Array(e.slice(0,r)))},Ge=[],ee=e=>{for(var r=0,t=0;t<e.length;++t){var n=e.charCodeAt(t);127>=n?r++:2047>=n?r+=2:55296<=n&&57343>=n?(r+=4,++t):r+=3}return r},U=(e,r,t,n)=>{if(!(0<n))return 0;var i=t;n=t+n-1;for(var a=0;a<e.length;++a){var u=e.codePointAt(a);if(127>=u){if(t>=n)break;r[t++]=u}else if(2047>=u){if(t+1>=n)break;r[t++]=192|u>>6,r[t++]=128|u&63}else if(65535>=u){if(t+2>=n)break;r[t++]=224|u>>12,r[t++]=128|u>>6&63,r[t++]=128|u&63}else{if(t+3>=n)break;r[t++]=240|u>>18,r[t++]=128|u>>12&63,r[t++]=128|u>>6&63,r[t++]=128|u&63,a++}}return r[t]=0,t-i},kr=[];function Er(e,r){kr[e]={input:[],output:[],cb:r},rr(e,dt)}var dt={open(e){var r=kr[e.node.rdev];if(!r)throw new f(43);e.tty=r,e.seekable=!1},close(e){e.tty.cb.fsync(e.tty)},fsync(e){e.tty.cb.fsync(e.tty)},read(e,r,t,n){if(!e.tty||!e.tty.cb.xb)throw new f(60);for(var i=0,a=0;a<n;a++){try{var u=e.tty.cb.xb(e.tty)}catch{throw new f(29)}if(u===void 0&&i===0)throw new f(6);if(u==null)break;i++,r[t+a]=u}return i&&(e.node.atime=Date.now()),i},write(e,r,t,n){if(!e.tty||!e.tty.cb.rb)throw new f(60);try{for(var i=0;i<n;i++)e.tty.cb.rb(e.tty,r[t+i])}catch{throw new f(29)}return n&&(e.node.mtime=e.node.ctime=Date.now()),i}},pt={xb(){e:{if(!Ge.length){var e=null;if(de){var r=Buffer.alloc(256),t=0,n=process.stdin.fd;try{t=Qe.readSync(n,r,0,256)}catch(i){if(i.toString().includes("EOF"))t=0;else throw i}0<t&&(e=r.slice(0,t).toString("utf-8"))}else globalThis.window?.prompt&&(e=window.prompt("Input: "),e!==null&&(e+=`
1
+ import{G as nn}from"./index-DJPmZw4a.js";import{r as nt}from"./___vite-browser-external_commonjs-proxy-7U87kfBv.js";function on(j,De){for(var z=0;z<De.length;z++){const Q=De[z];if(typeof Q!="string"&&!Array.isArray(Q)){for(const F in Q)if(F!=="default"&&!(F in j)){const ie=Object.getOwnPropertyDescriptor(Q,F);ie&&Object.defineProperty(j,F,ie.get?ie:{enumerable:!0,get:()=>Q[F]})}}}return Object.freeze(Object.defineProperty(j,Symbol.toStringTag,{value:"Module"}))}var hr={exports:{}},it;function an(){return it||(it=1,(function(j,De){var z=void 0,Q=function(F){return z||(z=new Promise(function(ie,at){var I=typeof F<"u"?F:{},mr=I.onAbort;I.onAbort=function(e){at(new Error(e)),mr&&mr(e)},I.postRun=I.postRun||[],I.postRun.push(function(){ie(I)}),j=void 0;var s;s||=typeof I<"u"?I:{};var ut=!!globalThis.window,Ie=!!globalThis.WorkerGlobalScope,de=globalThis.process?.versions?.node&&globalThis.process?.type!="renderer";s.onRuntimeInitialized=function(){function e(o,l){switch(typeof l){case"boolean":rn(o,l?1:0);break;case"number":Ht(o,l);break;case"string":Kt(o,l,-1,-1);break;case"object":if(l===null)Kr(o);else if(l.length!=null){var h=Le(l.length);q.set(l,h),en(o,h,l.length,-1),ce(h)}else Ue(o,"Wrong API use : tried to return a value of an unknown type ("+l+").",-1);break;default:Kr(o)}}function r(o,l){for(var h=[],m=0;m<o;m+=1){var w=W(l+4*m,"i32"),y=Yt(w);if(y===1||y===2)w=Jt(w);else if(y===3)w=Gt(w);else if(y===4){y=w,w=Ct(y),y=Zt(y);for(var T=new Uint8Array(w),L=0;L<w;L+=1)T[L]=q[y+L];w=T}else w=null;h.push(w)}return h}function t(o,l){this.Qa=o,this.db=l,this.Oa=1,this.lb=[]}function n(o,l){if(this.db=l,this.eb=Oe(o),this.eb===null)throw Error("Unable to allocate memory for the SQL string");this.kb=this.eb,this.Za=this.qb=null}function i(o){if(this.filename="dbfile_"+(4294967295*Math.random()>>>0),o!=null){var l=this.filename,h="/",m=l;if(h&&(h=typeof h=="string"?h:Je(h),m=l?Ce(h+"/"+l):h),l=qr(!0,!0),m=kt(m,l),o){if(typeof o=="string"){h=Array(o.length);for(var w=0,y=o.length;w<y;++w)h[w]=o.charCodeAt(w);o=h}Ne(m,l|146),h=ne(m,577),Qr(h,o,0,o.length,0),nr(h),Ne(m,l)}}this.handleError(c(this.filename,a)),this.db=W(a,"i32"),rt(this.db),this.fb={},this.Sa={}}var a=H(4),u=s.cwrap,c=u("sqlite3_open","number",["string","number"]),b=u("sqlite3_close_v2","number",["number"]),p=u("sqlite3_exec","number",["number","string","number","number","number"]),g=u("sqlite3_changes","number",["number"]),M=u("sqlite3_prepare_v2","number",["number","string","number","number","number"]),Cr=u("sqlite3_sql","string",["number"]),Ot=u("sqlite3_normalized_sql","string",["number"]),Gr=u("sqlite3_prepare_v2","number",["number","number","number","number","number"]),Lt=u("sqlite3_bind_text","number",["number","number","number","number","number"]),Zr=u("sqlite3_bind_blob","number",["number","number","number","number","number"]),xt=u("sqlite3_bind_double","number",["number","number","number"]),Tt=u("sqlite3_bind_int","number",["number","number","number"]),Pt=u("sqlite3_bind_parameter_index","number",["number","string"]),Ut=u("sqlite3_step","number",["number"]),Dt=u("sqlite3_errmsg","string",["number"]),It=u("sqlite3_column_count","number",["number"]),Wt=u("sqlite3_data_count","number",["number"]),jt=u("sqlite3_column_double","number",["number","number"]),Jr=u("sqlite3_column_text","string",["number","number"]),zt=u("sqlite3_column_blob","number",["number","number"]),Qt=u("sqlite3_column_bytes","number",["number","number"]),Ft=u("sqlite3_column_type","number",["number","number"]),$t=u("sqlite3_column_name","string",["number","number"]),Bt=u("sqlite3_reset","number",["number"]),Vt=u("sqlite3_clear_bindings","number",["number"]),Xt=u("sqlite3_finalize","number",["number"]),Hr=u("sqlite3_create_function_v2","number","number string number number number number number number number".split(" ")),Yt=u("sqlite3_value_type","number",["number"]),Ct=u("sqlite3_value_bytes","number",["number"]),Gt=u("sqlite3_value_text","string",["number"]),Zt=u("sqlite3_value_blob","number",["number"]),Jt=u("sqlite3_value_double","number",["number"]),Ht=u("sqlite3_result_double","",["number","number"]),Kr=u("sqlite3_result_null","",["number"]),Kt=u("sqlite3_result_text","",["number","string","number","number"]),en=u("sqlite3_result_blob","",["number","number","number","number"]),rn=u("sqlite3_result_int","",["number","number"]),Ue=u("sqlite3_result_error","",["number","string","number"]),et=u("sqlite3_aggregate_context","number",["number","number"]),rt=u("RegisterExtensionFunctions","number",["number"]),tt=u("sqlite3_update_hook","number",["number","number","number"]);t.prototype.bind=function(o){if(!this.Qa)throw"Statement closed";return this.reset(),Array.isArray(o)?this.Cb(o):o!=null&&typeof o=="object"?this.Db(o):!0},t.prototype.step=function(){if(!this.Qa)throw"Statement closed";this.Oa=1;var o=Ut(this.Qa);switch(o){case 100:return!0;case 101:return!1;default:throw this.db.handleError(o)}},t.prototype.wb=function(o){return o==null&&(o=this.Oa,this.Oa+=1),jt(this.Qa,o)},t.prototype.Gb=function(o){if(o==null&&(o=this.Oa,this.Oa+=1),o=Jr(this.Qa,o),typeof BigInt!="function")throw Error("BigInt is not supported");return BigInt(o)},t.prototype.Hb=function(o){return o==null&&(o=this.Oa,this.Oa+=1),Jr(this.Qa,o)},t.prototype.getBlob=function(o){o==null&&(o=this.Oa,this.Oa+=1);var l=Qt(this.Qa,o);o=zt(this.Qa,o);for(var h=new Uint8Array(l),m=0;m<l;m+=1)h[m]=q[o+m];return h},t.prototype.get=function(o,l){l=l||{},o!=null&&this.bind(o)&&this.step(),o=[];for(var h=Wt(this.Qa),m=0;m<h;m+=1)switch(Ft(this.Qa,m)){case 1:var w=l.useBigInt?this.Gb(m):this.wb(m);o.push(w);break;case 2:o.push(this.wb(m));break;case 3:o.push(this.Hb(m));break;case 4:o.push(this.getBlob(m));break;default:o.push(null)}return o},t.prototype.getColumnNames=function(){for(var o=[],l=It(this.Qa),h=0;h<l;h+=1)o.push($t(this.Qa,h));return o},t.prototype.getAsObject=function(o,l){o=this.get(o,l),l=this.getColumnNames();for(var h={},m=0;m<l.length;m+=1)h[l[m]]=o[m];return h},t.prototype.getSQL=function(){return Cr(this.Qa)},t.prototype.getNormalizedSQL=function(){return Ot(this.Qa)},t.prototype.run=function(o){return o!=null&&this.bind(o),this.step(),this.reset()},t.prototype.tb=function(o,l){l==null&&(l=this.Oa,this.Oa+=1),o=Oe(o),this.lb.push(o),this.db.handleError(Lt(this.Qa,l,o,-1,0))},t.prototype.Bb=function(o,l){l==null&&(l=this.Oa,this.Oa+=1);var h=Le(o.length);q.set(o,h),this.lb.push(h),this.db.handleError(Zr(this.Qa,l,h,o.length,0))},t.prototype.sb=function(o,l){l==null&&(l=this.Oa,this.Oa+=1),this.db.handleError((o===(o|0)?Tt:xt)(this.Qa,l,o))},t.prototype.Eb=function(o){o==null&&(o=this.Oa,this.Oa+=1),Zr(this.Qa,o,0,0,0)},t.prototype.ub=function(o,l){switch(l==null&&(l=this.Oa,this.Oa+=1),typeof o){case"string":this.tb(o,l);return;case"number":this.sb(o,l);return;case"bigint":this.tb(o.toString(),l);return;case"boolean":this.sb(o+0,l);return;case"object":if(o===null){this.Eb(l);return}if(o.length!=null){this.Bb(o,l);return}}throw"Wrong API use : tried to bind a value of an unknown type ("+o+")."},t.prototype.Db=function(o){var l=this;return Object.keys(o).forEach(function(h){var m=Pt(l.Qa,h);m!==0&&l.ub(o[h],m)}),!0},t.prototype.Cb=function(o){for(var l=0;l<o.length;l+=1)this.ub(o[l],l+1);return!0},t.prototype.reset=function(){return this.freemem(),Vt(this.Qa)===0&&Bt(this.Qa)===0},t.prototype.freemem=function(){for(var o;(o=this.lb.pop())!==void 0;)ce(o)},t.prototype.free=function(){this.freemem();var o=Xt(this.Qa)===0;return delete this.db.fb[this.Qa],this.Qa=0,o},n.prototype.next=function(){if(this.eb===null)return{done:!0};if(this.Za!==null&&(this.Za.free(),this.Za=null),!this.db.db)throw this.nb(),Error("Database closed");var o=Te(),l=H(4);le(a),le(l);try{this.db.handleError(Gr(this.db.db,this.kb,-1,a,l)),this.kb=W(l,"i32");var h=W(a,"i32");return h===0?(this.nb(),{done:!0}):(this.Za=new t(h,this.db),this.db.fb[h]=this.Za,{value:this.Za,done:!1})}catch(m){throw this.qb=E(this.kb),this.nb(),m}finally{xe(o)}},n.prototype.nb=function(){ce(this.eb),this.eb=null},n.prototype.getRemainingSQL=function(){return this.qb!==null?this.qb:E(this.kb)},typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"&&(n.prototype[Symbol.iterator]=function(){return this}),i.prototype.run=function(o,l){if(!this.db)throw"Database closed";if(l){o=this.prepare(o,l);try{o.step()}finally{o.free()}}else this.handleError(p(this.db,o,0,0,a));return this},i.prototype.exec=function(o,l,h){if(!this.db)throw"Database closed";var m=null,w=null,y=null;try{y=w=Oe(o);var T=H(4);for(o=[];W(y,"i8")!==0;){le(a),le(T),this.handleError(Gr(this.db,y,-1,a,T));var L=W(a,"i32");if(y=W(T,"i32"),L!==0){var R=null;for(m=new t(L,this),l!=null&&m.bind(l);m.step();)R===null&&(R={columns:m.getColumnNames(),values:[]},o.push(R)),R.values.push(m.get(null,h));m.free()}}return o}catch(P){throw m&&m.free(),P}finally{w&&ce(w)}},i.prototype.each=function(o,l,h,m,w){typeof l=="function"&&(m=h,h=l,l=void 0),o=this.prepare(o,l);try{for(;o.step();)h(o.getAsObject(null,w))}finally{o.free()}if(typeof m=="function")return m()},i.prototype.prepare=function(o,l){if(le(a),this.handleError(M(this.db,o,-1,a,0)),o=W(a,"i32"),o===0)throw"Nothing to prepare";var h=new t(o,this);return l!=null&&h.bind(l),this.fb[o]=h},i.prototype.iterateStatements=function(o){return new n(o,this)},i.prototype.export=function(){Object.values(this.fb).forEach(function(l){l.free()}),Object.values(this.Sa).forEach(V),this.Sa={},this.handleError(b(this.db));var o=Et(this.filename);return this.handleError(c(this.filename,a)),this.db=W(a,"i32"),rt(this.db),o},i.prototype.close=function(){this.db!==null&&(Object.values(this.fb).forEach(function(o){o.free()}),Object.values(this.Sa).forEach(V),this.Sa={},this.Ya&&(V(this.Ya),this.Ya=void 0),this.handleError(b(this.db)),Dr("/"+this.filename),this.db=null)},i.prototype.handleError=function(o){if(o===0)return null;throw o=Dt(this.db),Error(o)},i.prototype.getRowsModified=function(){return g(this.db)},i.prototype.create_function=function(o,l){Object.prototype.hasOwnProperty.call(this.Sa,o)&&(V(this.Sa[o]),delete this.Sa[o]);var h=me(function(m,w,y){w=r(w,y);try{var T=l.apply(null,w)}catch(L){Ue(m,L,-1);return}e(m,T)},"viii");return this.Sa[o]=h,this.handleError(Hr(this.db,o,l.length,1,0,h,0,0,0)),this},i.prototype.create_aggregate=function(o,l){var h=l.init||function(){return null},m=l.finalize||function(R){return R},w=l.step;if(!w)throw"An aggregate function must have a step function in "+o;var y={};Object.hasOwnProperty.call(this.Sa,o)&&(V(this.Sa[o]),delete this.Sa[o]),l=o+"__finalize",Object.hasOwnProperty.call(this.Sa,l)&&(V(this.Sa[l]),delete this.Sa[l]);var T=me(function(R,P,fr){var K=et(R,1);Object.hasOwnProperty.call(y,K)||(y[K]=h()),P=r(P,fr),P=[y[K]].concat(P);try{y[K]=w.apply(null,P)}catch(tn){delete y[K],Ue(R,tn,-1)}},"viii"),L=me(function(R){var P=et(R,1);try{var fr=m(y[P])}catch(K){delete y[P],Ue(R,K,-1);return}e(R,fr),delete y[P]},"vi");return this.Sa[o]=T,this.Sa[l]=L,this.handleError(Hr(this.db,o,w.length-1,1,0,0,T,L,0)),this},i.prototype.updateHook=function(o){return this.Ya&&(tt(this.db,0,0),V(this.Ya),this.Ya=void 0),o?(this.Ya=me(function(l,h,m,w,y){switch(h){case 18:l="insert";break;case 23:l="update";break;case 9:l="delete";break;default:throw"unknown operationCode in updateHook callback: "+h}if(m=E(m),w=E(w),y>Number.MAX_SAFE_INTEGER)throw"rowId too big to fit inside a Number";o(l,m,w,Number(y))},"viiiij"),tt(this.db,this.Ya,0),this):this},s.Database=i};var We="./this.program",pe=(e,r)=>{throw r},je=globalThis.document?.currentScript?.src;typeof __filename<"u"?je=__filename:Ie&&(je=self.location.href);var we="",ze,be;if(de){var Qe=nt;we=__dirname+"/",be=e=>(e=ve(e)?new URL(e):e,Qe.readFileSync(e)),ze=async e=>(e=ve(e)?new URL(e):e,Qe.readFileSync(e,void 0)),1<process.argv.length&&(We=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2),j.exports=s,pe=(e,r)=>{throw process.exitCode=e,r}}else if(ut||Ie){try{we=new URL(".",je).href}catch{}Ie&&(be=e=>{var r=new XMLHttpRequest;return r.open("GET",e,!1),r.responseType="arraybuffer",r.send(null),new Uint8Array(r.response)}),ze=async e=>{if(ve(e))return new Promise((t,n)=>{var i=new XMLHttpRequest;i.open("GET",e,!0),i.responseType="arraybuffer",i.onload=()=>{i.status==200||i.status==0&&i.response?t(i.response):n(i.status)},i.onerror=n,i.send(null)});var r=await fetch(e,{credentials:"same-origin"});if(r.ok)return r.arrayBuffer();throw Error(r.status+" : "+r.url)}}var Fe=console.log.bind(console),Y=console.error.bind(console),oe,ye=!1,$e,ve=e=>e.startsWith("file://"),q,N,ae,k,v,Be,Ve,x;function cr(){var e=Pe.buffer;q=new Int8Array(e),ae=new Int16Array(e),N=new Uint8Array(e),k=new Int32Array(e),v=new Uint32Array(e),Be=new Float32Array(e),Ve=new Float64Array(e),x=new BigInt64Array(e),new BigUint64Array(e)}function ue(e){throw s.onAbort?.(e),e="Aborted("+e+")",Y(e),ye=!0,new WebAssembly.RuntimeError(e+". Build with -sASSERTIONS for more info.")}var Xe;async function st(e){if(!oe)try{var r=await ze(e);return new Uint8Array(r)}catch{}if(e==Xe&&oe)e=new Uint8Array(oe);else if(be)e=be(e);else throw"both async and sync fetching of the wasm failed";return e}async function lt(e,r){try{var t=await st(e);return await WebAssembly.instantiate(t,r)}catch(n){Y(`failed to asynchronously prepare wasm: ${n}`),ue(n)}}async function ft(e){var r=Xe;if(!oe&&!ve(r)&&!de)try{var t=fetch(r,{credentials:"same-origin"});return await WebAssembly.instantiateStreaming(t,e)}catch(n){Y(`wasm streaming compile failed: ${n}`),Y("falling back to ArrayBuffer instantiation")}return lt(r,e)}class Ye{name="ExitStatus";constructor(r){this.message=`Program terminated with exit(${r})`,this.status=r}}var dr=e=>{for(;0<e.length;)e.shift()(s)},pr=[],wr=[],ht=()=>{var e=s.preRun.shift();wr.push(e)},C=0,se=null;function W(e,r="i8"){switch(r.endsWith("*")&&(r="*"),r){case"i1":return q[e];case"i8":return q[e];case"i16":return ae[e>>1];case"i32":return k[e>>2];case"i64":return x[e>>3];case"float":return Be[e>>2];case"double":return Ve[e>>3];case"*":return v[e>>2];default:ue(`invalid type for getValue: ${r}`)}}var _e=!0;function le(e){var r="i32";switch(r.endsWith("*")&&(r="*"),r){case"i1":q[e]=0;break;case"i8":q[e]=0;break;case"i16":ae[e>>1]=0;break;case"i32":k[e>>2]=0;break;case"i64":x[e>>3]=BigInt(0);break;case"float":Be[e>>2]=0;break;case"double":Ve[e>>3]=0;break;case"*":v[e>>2]=0;break;default:ue(`invalid type for setValue: ${r}`)}}var br=new TextDecoder,yr=(e,r,t,n)=>{if(t=r+t,n)return t;for(;e[r]&&!(r>=t);)++r;return r},E=(e,r,t)=>e?br.decode(N.subarray(e,yr(N,e,r,t))):"",vr=(e,r)=>{for(var t=0,n=e.length-1;0<=n;n--){var i=e[n];i==="."?e.splice(n,1):i===".."?(e.splice(n,1),t++):t&&(e.splice(n,1),t--)}if(r)for(;t;t--)e.unshift("..");return e},Ce=e=>{var r=e.charAt(0)==="/",t=e.slice(-1)==="/";return(e=vr(e.split("/").filter(n=>!!n),!r).join("/"))||r||(e="."),e&&t&&(e+="/"),(r?"/":"")+e},_r=e=>{var r=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1);return e=r[0],r=r[1],!e&&!r?".":(r&&=r.slice(0,-1),e+r)},ge=e=>e&&e.match(/([^\/]+|\/)\/*$/)[1],mt=()=>{if(de){var e=nt;return r=>e.randomFillSync(r)}return r=>crypto.getRandomValues(r)},gr=e=>{(gr=mt())(e)},ct=(...e)=>{for(var r="",t=!1,n=e.length-1;-1<=n&&!t;n--){if(t=0<=n?e[n]:"/",typeof t!="string")throw new TypeError("Arguments to path.resolve must be strings");if(!t)return"";r=t+"/"+r,t=t.charAt(0)==="/"}return r=vr(r.split("/").filter(i=>!!i),!t).join("/"),(t?"/":"")+r||"."},ke=e=>{var r=yr(e,0);return br.decode(e.buffer?e.subarray(0,r):new Uint8Array(e.slice(0,r)))},Ge=[],ee=e=>{for(var r=0,t=0;t<e.length;++t){var n=e.charCodeAt(t);127>=n?r++:2047>=n?r+=2:55296<=n&&57343>=n?(r+=4,++t):r+=3}return r},U=(e,r,t,n)=>{if(!(0<n))return 0;var i=t;n=t+n-1;for(var a=0;a<e.length;++a){var u=e.codePointAt(a);if(127>=u){if(t>=n)break;r[t++]=u}else if(2047>=u){if(t+1>=n)break;r[t++]=192|u>>6,r[t++]=128|u&63}else if(65535>=u){if(t+2>=n)break;r[t++]=224|u>>12,r[t++]=128|u>>6&63,r[t++]=128|u&63}else{if(t+3>=n)break;r[t++]=240|u>>18,r[t++]=128|u>>12&63,r[t++]=128|u>>6&63,r[t++]=128|u&63,a++}}return r[t]=0,t-i},kr=[];function Er(e,r){kr[e]={input:[],output:[],cb:r},rr(e,dt)}var dt={open(e){var r=kr[e.node.rdev];if(!r)throw new f(43);e.tty=r,e.seekable=!1},close(e){e.tty.cb.fsync(e.tty)},fsync(e){e.tty.cb.fsync(e.tty)},read(e,r,t,n){if(!e.tty||!e.tty.cb.xb)throw new f(60);for(var i=0,a=0;a<n;a++){try{var u=e.tty.cb.xb(e.tty)}catch{throw new f(29)}if(u===void 0&&i===0)throw new f(6);if(u==null)break;i++,r[t+a]=u}return i&&(e.node.atime=Date.now()),i},write(e,r,t,n){if(!e.tty||!e.tty.cb.rb)throw new f(60);try{for(var i=0;i<n;i++)e.tty.cb.rb(e.tty,r[t+i])}catch{throw new f(29)}return n&&(e.node.mtime=e.node.ctime=Date.now()),i}},pt={xb(){e:{if(!Ge.length){var e=null;if(de){var r=Buffer.alloc(256),t=0,n=process.stdin.fd;try{t=Qe.readSync(n,r,0,256)}catch(i){if(i.toString().includes("EOF"))t=0;else throw i}0<t&&(e=r.slice(0,t).toString("utf-8"))}else globalThis.window?.prompt&&(e=window.prompt("Input: "),e!==null&&(e+=`
2
2
  `));if(!e){e=null;break e}r=Array(ee(e)+1),e=U(e,r,0,r.length),r.length=e,Ge=r}e=Ge.shift()}return e},rb(e,r){r===null||r===10?(Fe(ke(e.output)),e.output=[]):r!=0&&e.output.push(r)},fsync(e){0<e.output?.length&&(Fe(ke(e.output)),e.output=[])},Tb(){return{Ob:25856,Qb:5,Nb:191,Pb:35387,Mb:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}},Ub(){return 0},Vb(){return[24,80]}},wt={rb(e,r){r===null||r===10?(Y(ke(e.output)),e.output=[]):r!=0&&e.output.push(r)},fsync(e){0<e.output?.length&&(Y(ke(e.output)),e.output=[])}},d={Wa:null,Xa(){return d.createNode(null,"/",16895,0)},createNode(e,r,t,n){if((t&61440)===24576||(t&61440)===4096)throw new f(63);return d.Wa||(d.Wa={dir:{node:{Ta:d.La.Ta,Ua:d.La.Ua,lookup:d.La.lookup,hb:d.La.hb,rename:d.La.rename,unlink:d.La.unlink,rmdir:d.La.rmdir,readdir:d.La.readdir,symlink:d.La.symlink},stream:{Va:d.Ma.Va}},file:{node:{Ta:d.La.Ta,Ua:d.La.Ua},stream:{Va:d.Ma.Va,read:d.Ma.read,write:d.Ma.write,ib:d.Ma.ib,jb:d.Ma.jb}},link:{node:{Ta:d.La.Ta,Ua:d.La.Ua,readlink:d.La.readlink},stream:{}},vb:{node:{Ta:d.La.Ta,Ua:d.La.Ua},stream:gt}}),t=Rr(e,r,t,n),S(t.mode)?(t.La=d.Wa.dir.node,t.Ma=d.Wa.dir.stream,t.Na={}):(t.mode&61440)===32768?(t.La=d.Wa.file.node,t.Ma=d.Wa.file.stream,t.Ra=0,t.Na=null):(t.mode&61440)===40960?(t.La=d.Wa.link.node,t.Ma=d.Wa.link.stream):(t.mode&61440)===8192&&(t.La=d.Wa.vb.node,t.Ma=d.Wa.vb.stream),t.atime=t.mtime=t.ctime=Date.now(),e&&(e.Na[r]=t,e.atime=e.mtime=e.ctime=t.atime),t},Sb(e){return e.Na?e.Na.subarray?e.Na.subarray(0,e.Ra):new Uint8Array(e.Na):new Uint8Array(0)},La:{Ta(e){var r={};return r.dev=(e.mode&61440)===8192?e.id:1,r.ino=e.id,r.mode=e.mode,r.nlink=1,r.uid=0,r.gid=0,r.rdev=e.rdev,S(e.mode)?r.size=4096:(e.mode&61440)===32768?r.size=e.Ra:(e.mode&61440)===40960?r.size=e.link.length:r.size=0,r.atime=new Date(e.atime),r.mtime=new Date(e.mtime),r.ctime=new Date(e.ctime),r.blksize=4096,r.blocks=Math.ceil(r.size/r.blksize),r},Ua(e,r){for(var t of["mode","atime","mtime","ctime"])r[t]!=null&&(e[t]=r[t]);r.size!==void 0&&(r=r.size,e.Ra!=r&&(r==0?(e.Na=null,e.Ra=0):(t=e.Na,e.Na=new Uint8Array(r),t&&e.Na.set(t.subarray(0,Math.min(r,e.Ra))),e.Ra=r)))},lookup(){throw d.mb||(d.mb=new f(44),d.mb.stack="<generic error, no stack>"),d.mb},hb(e,r,t,n){return d.createNode(e,r,t,n)},rename(e,r,t){try{var n=G(r,t)}catch{}if(n){if(S(e.mode))for(var i in n.Na)throw new f(55);Ke(n)}delete e.parent.Na[e.name],r.Na[t]=e,e.name=t,r.ctime=r.mtime=e.parent.ctime=e.parent.mtime=Date.now()},unlink(e,r){delete e.Na[r],e.ctime=e.mtime=Date.now()},rmdir(e,r){var t=G(e,r),n;for(n in t.Na)throw new f(55);delete e.Na[r],e.ctime=e.mtime=Date.now()},readdir(e){return[".","..",...Object.keys(e.Na)]},symlink(e,r,t){return e=d.createNode(e,r,41471,0),e.link=t,e},readlink(e){if((e.mode&61440)!==40960)throw new f(28);return e.link}},Ma:{read(e,r,t,n,i){var a=e.node.Na;if(i>=e.node.Ra)return 0;if(e=Math.min(e.node.Ra-i,n),8<e&&a.subarray)r.set(a.subarray(i,i+e),t);else for(n=0;n<e;n++)r[t+n]=a[i+n];return e},write(e,r,t,n,i,a){if(r.buffer===q.buffer&&(a=!1),!n)return 0;if(e=e.node,e.mtime=e.ctime=Date.now(),r.subarray&&(!e.Na||e.Na.subarray)){if(a)return e.Na=r.subarray(t,t+n),e.Ra=n;if(e.Ra===0&&i===0)return e.Na=r.slice(t,t+n),e.Ra=n;if(i+n<=e.Ra)return e.Na.set(r.subarray(t,t+n),i),n}a=i+n;var u=e.Na?e.Na.length:0;if(u>=a||(a=Math.max(a,u*(1048576>u?2:1.125)>>>0),u!=0&&(a=Math.max(a,256)),u=e.Na,e.Na=new Uint8Array(a),0<e.Ra&&e.Na.set(u.subarray(0,e.Ra),0)),e.Na.subarray&&r.subarray)e.Na.set(r.subarray(t,t+n),i);else for(a=0;a<n;a++)e.Na[i+a]=r[t+a];return e.Ra=Math.max(e.Ra,i+n),n},Va(e,r,t){if(t===1?r+=e.position:t===2&&(e.node.mode&61440)===32768&&(r+=e.node.Ra),0>r)throw new f(28);return r},ib(e,r,t,n,i){if((e.node.mode&61440)!==32768)throw new f(43);if(e=e.node.Na,i&2||!e||e.buffer!==q.buffer){i=!0,n=65536*Math.ceil(r/65536);var a=Xr(65536,n);if(a&&N.fill(0,a,a+n),n=a,!n)throw new f(48);e&&((0<t||t+r<e.length)&&(e.subarray?e=e.subarray(t,t+r):e=Array.prototype.slice.call(e,t,t+r)),q.set(e,n))}else i=!1,n=e.byteOffset;return{Kb:n,Ab:i}},jb(e,r,t,n){return d.Ma.write(e,r,0,n,t,!1),0}}},qr=(e,r)=>{var t=0;return e&&(t|=365),r&&(t|=146),t},Ze=null,Mr={},re=[],bt=1,$=null,Nr=!1,Ar=!0,Sr={},f=class{name="ErrnoError";constructor(e){this.Pa=e}},yt=class{gb={};node=null;get flags(){return this.gb.flags}set flags(e){this.gb.flags=e}get position(){return this.gb.position}set position(e){this.gb.position=e}},vt=class{La={};Ma={};ab=null;constructor(e,r,t,n){e||=this,this.parent=e,this.Xa=e.Xa,this.id=bt++,this.name=r,this.mode=t,this.rdev=n,this.atime=this.mtime=this.ctime=Date.now()}get read(){return(this.mode&365)===365}set read(e){e?this.mode|=365:this.mode&=-366}get write(){return(this.mode&146)===146}set write(e){e?this.mode|=146:this.mode&=-147}};function O(e,r={}){if(!e)throw new f(44);r.ob??(r.ob=!0),e.charAt(0)==="/"||(e="//"+e);var t=0;e:for(;40>t;t++){e=e.split("/").filter(c=>!!c);for(var n=Ze,i="/",a=0;a<e.length;a++){var u=a===e.length-1;if(u&&r.parent)break;if(e[a]!==".")if(e[a]==="..")if(i=_r(i),n===n.parent){e=i+"/"+e.slice(a+1).join("/"),t--;continue e}else n=n.parent;else{i=Ce(i+"/"+e[a]);try{n=G(n,e[a])}catch(c){if(c?.Pa===44&&u&&r.Jb)return{path:i};throw c}if(!n.ab||u&&!r.ob||(n=n.ab.root),(n.mode&61440)===40960&&(!u||r.$a)){if(!n.La.readlink)throw new f(52);n=n.La.readlink(n),n.charAt(0)==="/"||(n=_r(i)+"/"+n),e=n+"/"+e.slice(a+1).join("/");continue e}}}return{path:i,node:n}}throw new f(32)}function Je(e){for(var r;;){if(e===e.parent)return e=e.Xa.zb,r?e[e.length-1]!=="/"?`${e}/${r}`:e+r:e;r=r?`${e.name}/${r}`:e.name,e=e.parent}}function He(e,r){for(var t=0,n=0;n<r.length;n++)t=(t<<5)-t+r.charCodeAt(n)|0;return(e+t>>>0)%$.length}function Ke(e){var r=He(e.parent.id,e.name);if($[r]===e)$[r]=e.bb;else for(r=$[r];r;){if(r.bb===e){r.bb=e.bb;break}r=r.bb}}function G(e,r){var t=S(e.mode)?(t=te(e,"x"))?t:e.La.lookup?0:2:54;if(t)throw new f(t);for(t=$[He(e.id,r)];t;t=t.bb){var n=t.name;if(t.parent.id===e.id&&n===r)return t}return e.La.lookup(e,r)}function Rr(e,r,t,n){return e=new vt(e,r,t,n),r=He(e.parent.id,e.name),e.bb=$[r],$[r]=e}function S(e){return(e&61440)===16384}function Or(e){var r=["r","w","rw"][e&3];return e&512&&(r+="w"),r}function te(e,r){if(Ar)return 0;if(!r.includes("r")||e.mode&292){if(r.includes("w")&&!(e.mode&146)||r.includes("x")&&!(e.mode&73))return 2}else return 2;return 0}function Lr(e,r){if(!S(e.mode))return 54;try{return G(e,r),20}catch{}return te(e,"wx")}function xr(e,r,t){try{var n=G(e,r)}catch(i){return i.Pa}if(e=te(e,"wx"))return e;if(t){if(!S(n.mode))return 54;if(n===n.parent||Je(n)==="/")return 10}else if(S(n.mode))return 31;return 0}function Ee(e){if(!e)throw new f(63);return e}function A(e){if(e=re[e],!e)throw new f(8);return e}function Tr(e,r=-1){if(e=Object.assign(new yt,e),r==-1)e:{for(r=0;4096>=r;r++)if(!re[r])break e;throw new f(33)}return e.fd=r,re[r]=e}function _t(e,r=-1){return e=Tr(e,r),e.Ma?.Rb?.(e),e}function er(e,r,t){var n=e?.Ma.Ua;e=n?e:r,n??=r.La.Ua,Ee(n),n(e,t)}var gt={open(e){e.Ma=Mr[e.node.rdev].Ma,e.Ma.open?.(e)},Va(){throw new f(70)}};function rr(e,r){Mr[e]={Ma:r}}function Pr(e,r){var t=r==="/";if(t&&Ze)throw new f(10);if(!t&&r){var n=O(r,{ob:!1});if(r=n.path,n=n.node,n.ab)throw new f(10);if(!S(n.mode))throw new f(54)}r={type:e,Wb:{},zb:r,Ib:[]},e=e.Xa(r),e.Xa=r,r.root=e,t?Ze=e:n&&(n.ab=r,n.Xa&&n.Xa.Ib.push(r))}function qe(e,r,t){var n=O(e,{parent:!0}).node;if(e=ge(e),!e)throw new f(28);if(e==="."||e==="..")throw new f(20);var i=Lr(n,e);if(i)throw new f(i);if(!n.La.hb)throw new f(63);return n.La.hb(n,e,r,t)}function kt(e,r=438){return qe(e,r&4095|32768,0)}function D(e,r=511){return qe(e,r&1023|16384,0)}function Me(e,r,t){typeof t>"u"&&(t=r,r=438),qe(e,r|8192,t)}function tr(e,r){if(!ct(e))throw new f(44);var t=O(r,{parent:!0}).node;if(!t)throw new f(44);r=ge(r);var n=Lr(t,r);if(n)throw new f(n);if(!t.La.symlink)throw new f(63);t.La.symlink(t,r,e)}function Ur(e){var r=O(e,{parent:!0}).node;e=ge(e);var t=G(r,e),n=xr(r,e,!0);if(n)throw new f(n);if(!r.La.rmdir)throw new f(63);if(t.ab)throw new f(10);r.La.rmdir(r,e),Ke(t)}function Dr(e){var r=O(e,{parent:!0}).node;if(!r)throw new f(44);e=ge(e);var t=G(r,e),n=xr(r,e,!1);if(n)throw new f(n);if(!r.La.unlink)throw new f(63);if(t.ab)throw new f(10);r.La.unlink(r,e),Ke(t)}function fe(e,r){return e=O(e,{$a:!r}).node,Ee(e.La.Ta)(e)}function Ir(e,r,t,n){er(e,r,{mode:t&4095|r.mode&-4096,ctime:Date.now(),Fb:n})}function Ne(e,r){e=typeof e=="string"?O(e,{$a:!0}).node:e,Ir(null,e,r)}function Wr(e,r,t){if(S(r.mode))throw new f(31);if((r.mode&61440)!==32768)throw new f(28);var n=te(r,"w");if(n)throw new f(n);er(e,r,{size:t,timestamp:Date.now()})}function ne(e,r,t=438){if(e==="")throw new f(44);if(typeof r=="string"){var n={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[r];if(typeof n>"u")throw Error(`Unknown file open mode: ${r}`);r=n}if(t=r&64?t&4095|32768:0,typeof e=="object")n=e;else{var i=e.endsWith("/");e=O(e,{$a:!(r&131072),Jb:!0}),n=e.node,e=e.path}var a=!1;if(r&64)if(n){if(r&128)throw new f(20)}else{if(i)throw new f(31);n=qe(e,t|511,0),a=!0}if(!n)throw new f(44);if((n.mode&61440)===8192&&(r&=-513),r&65536&&!S(n.mode))throw new f(54);if(!a&&(i=n?(n.mode&61440)===40960?32:S(n.mode)&&(Or(r)!=="r"||r&576)?31:te(n,Or(r)):44))throw new f(i);return r&512&&!a&&(i=n,i=typeof i=="string"?O(i,{$a:!0}).node:i,Wr(null,i,0)),r&=-131713,i=Tr({node:n,path:Je(n),flags:r,seekable:!0,position:0,Ma:n.Ma,Lb:[],error:!1}),i.Ma.open&&i.Ma.open(i),a&&Ne(n,t&511),!s.logReadFiles||r&1||e in Sr||(Sr[e]=1),i}function nr(e){if(e.fd===null)throw new f(8);e.pb&&(e.pb=null);try{e.Ma.close&&e.Ma.close(e)}catch(r){throw r}finally{re[e.fd]=null}e.fd=null}function jr(e,r,t){if(e.fd===null)throw new f(8);if(!e.seekable||!e.Ma.Va)throw new f(70);if(t!=0&&t!=1&&t!=2)throw new f(28);e.position=e.Ma.Va(e,r,t),e.Lb=[]}function zr(e,r,t,n,i){if(0>n||0>i)throw new f(28);if(e.fd===null)throw new f(8);if((e.flags&2097155)===1)throw new f(8);if(S(e.node.mode))throw new f(31);if(!e.Ma.read)throw new f(28);var a=typeof i<"u";if(!a)i=e.position;else if(!e.seekable)throw new f(70);return r=e.Ma.read(e,r,t,n,i),a||(e.position+=r),r}function Qr(e,r,t,n,i){if(0>n||0>i)throw new f(28);if(e.fd===null)throw new f(8);if((e.flags&2097155)===0)throw new f(8);if(S(e.node.mode))throw new f(31);if(!e.Ma.write)throw new f(28);e.seekable&&e.flags&1024&&jr(e,0,2);var a=typeof i<"u";if(!a)i=e.position;else if(!e.seekable)throw new f(70);return r=e.Ma.write(e,r,t,n,i,void 0),a||(e.position+=r),r}function Et(e){var r=r||0;r=ne(e,r),e=fe(e).size;var t=new Uint8Array(e);return zr(r,t,0,e,0),nr(r),t}function B(e,r,t){e=Ce("/dev/"+e);var n=qr(!!r,!!t);B.yb??(B.yb=64);var i=B.yb++<<8|0;rr(i,{open(a){a.seekable=!1},close(){t?.buffer?.length&&t(10)},read(a,u,c,b){for(var p=0,g=0;g<b;g++){try{var M=r()}catch{throw new f(29)}if(M===void 0&&p===0)throw new f(6);if(M==null)break;p++,u[c+g]=M}return p&&(a.node.atime=Date.now()),p},write(a,u,c,b){for(var p=0;p<b;p++)try{t(u[c+p])}catch{throw new f(29)}return b&&(a.node.mtime=a.node.ctime=Date.now()),p}}),Me(e,n,i)}var _={};function Z(e,r,t){if(r.charAt(0)==="/")return r;if(e=e===-100?"/":A(e).path,r.length==0){if(!t)throw new f(44);return e}return e+"/"+r}function Ae(e,r){v[e>>2]=r.dev,v[e+4>>2]=r.mode,v[e+8>>2]=r.nlink,v[e+12>>2]=r.uid,v[e+16>>2]=r.gid,v[e+20>>2]=r.rdev,x[e+24>>3]=BigInt(r.size),k[e+32>>2]=4096,k[e+36>>2]=r.blocks;var t=r.atime.getTime(),n=r.mtime.getTime(),i=r.ctime.getTime();return x[e+40>>3]=BigInt(Math.floor(t/1e3)),v[e+48>>2]=t%1e3*1e6,x[e+56>>3]=BigInt(Math.floor(n/1e3)),v[e+64>>2]=n%1e3*1e6,x[e+72>>3]=BigInt(Math.floor(i/1e3)),v[e+80>>2]=i%1e3*1e6,x[e+88>>3]=BigInt(r.ino),0}var Se=void 0,Re=()=>{var e=k[+Se>>2];return Se+=4,e},ir=0,qt=[0,31,60,91,121,152,182,213,244,274,305,335],Mt=[0,31,59,90,120,151,181,212,243,273,304,334],he={},Fr=e=>{$e=e,_e||0<ir||(s.onExit?.(e),ye=!0),pe(e,new Ye(e))},Nt=e=>{if(!ye)try{e()}catch(r){r instanceof Ye||r=="unwind"||pe(1,r)}finally{if(!(_e||0<ir))try{$e=e=$e,Fr(e)}catch(r){r instanceof Ye||r=="unwind"||pe(1,r)}}},or={},$r=()=>{if(!ar){var e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(globalThis.navigator?.language??"C").replace("-","_")+".UTF-8",_:We||"./this.program"},r;for(r in or)or[r]===void 0?delete e[r]:e[r]=or[r];var t=[];for(r in e)t.push(`${r}=${e[r]}`);ar=t}return ar},ar,At=(e,r,t,n)=>{var i={string:p=>{var g=0;if(p!=null&&p!==0){g=ee(p)+1;var M=H(g);U(p,N,M,g),g=M}return g},array:p=>{var g=H(p.length);return q.set(p,g),g}};e=s["_"+e];var a=[],u=0;if(n)for(var c=0;c<n.length;c++){var b=i[t[c]];b?(u===0&&(u=Te()),a[c]=b(n[c])):a[c]=n[c]}return t=e(...a),t=(function(p){return u!==0&&xe(u),r==="string"?E(p):r==="boolean"?!!p:p})(t)},Oe=e=>{var r=ee(e)+1,t=Le(r);return t&&U(e,N,t,r),t},J,ur=[],V=e=>{J.delete(X.get(e)),X.set(e,null),ur.push(e)},Br=e=>{const r=e.length;return[r%128|128,r>>7,...e]},St={i:127,p:127,j:126,f:125,d:124,e:111},Vr=e=>Br(Array.from(e,r=>St[r])),me=(e,r)=>{if(!J){J=new WeakMap;var t=X.length;if(J)for(var n=0;n<0+t;n++){var i=X.get(n);i&&J.set(i,n)}}if(t=J.get(e)||0)return t;t=ur.length?ur.pop():X.grow(1);try{X.set(t,e)}catch(a){if(!(a instanceof TypeError))throw a;r=Uint8Array.of(0,97,115,109,1,0,0,0,1,...Br([1,96,...Vr(r.slice(1)),...Vr(r[0]==="v"?"":r[0])]),2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0),r=new WebAssembly.Module(r),r=new WebAssembly.Instance(r,{e:{f:e}}).exports.f,X.set(t,r)}return J.set(e,t),t};if($=Array(4096),Pr(d,"/"),D("/tmp"),D("/home"),D("/home/web_user"),(function(){D("/dev"),rr(259,{read:()=>0,write:(n,i,a,u)=>u,Va:()=>0}),Me("/dev/null",259),Er(1280,pt),Er(1536,wt),Me("/dev/tty",1280),Me("/dev/tty1",1536);var e=new Uint8Array(1024),r=0,t=()=>(r===0&&(gr(e),r=e.byteLength),e[--r]);B("random",t),B("urandom",t),D("/dev/shm"),D("/dev/shm/tmp")})(),(function(){D("/proc");var e=D("/proc/self");D("/proc/self/fd"),Pr({Xa(){var r=Rr(e,"fd",16895,73);return r.Ma={Va:d.Ma.Va},r.La={lookup(t,n){t=+n;var i=A(t);return t={parent:null,Xa:{zb:"fake"},La:{readlink:()=>i.path},id:t+1},t.parent=t},readdir(){return Array.from(re.entries()).filter(([,t])=>t).map(([t])=>t.toString())}},r}},"/proc/self/fd")})(),s.noExitRuntime&&(_e=s.noExitRuntime),s.print&&(Fe=s.print),s.printErr&&(Y=s.printErr),s.wasmBinary&&(oe=s.wasmBinary),s.thisProgram&&(We=s.thisProgram),s.preInit)for(typeof s.preInit=="function"&&(s.preInit=[s.preInit]);0<s.preInit.length;)s.preInit.shift()();s.stackSave=()=>Te(),s.stackRestore=e=>xe(e),s.stackAlloc=e=>H(e),s.cwrap=(e,r,t,n)=>{var i=!t||t.every(a=>a==="number"||a==="boolean");return r!=="string"&&i&&!n?s["_"+e]:(...a)=>At(e,r,t,a)},s.addFunction=me,s.removeFunction=V,s.UTF8ToString=E,s.stringToNewUTF8=Oe,s.writeArrayToMemory=(e,r)=>{q.set(e,r)};var Le,ce,Xr,Yr,xe,H,Te,Pe,X,Rt={a:(e,r,t,n)=>ue(`Assertion failed: ${E(e)}, at: `+[r?E(r):"unknown filename",t,n?E(n):"unknown function"]),i:function(e,r){try{return e=E(e),Ne(e,r),0}catch(t){if(typeof _>"u"||t.name!=="ErrnoError")throw t;return-t.Pa}},L:function(e,r,t){try{if(r=E(r),r=Z(e,r),t&-8)return-28;var n=O(r,{$a:!0}).node;return n?(e="",t&4&&(e+="r"),t&2&&(e+="w"),t&1&&(e+="x"),e&&te(n,e)?-2:0):-44}catch(i){if(typeof _>"u"||i.name!=="ErrnoError")throw i;return-i.Pa}},j:function(e,r){try{var t=A(e);return Ir(t,t.node,r,!1),0}catch(n){if(typeof _>"u"||n.name!=="ErrnoError")throw n;return-n.Pa}},h:function(e){try{var r=A(e);return er(r,r.node,{timestamp:Date.now(),Fb:!1}),0}catch(t){if(typeof _>"u"||t.name!=="ErrnoError")throw t;return-t.Pa}},b:function(e,r,t){Se=t;try{var n=A(e);switch(r){case 0:var i=Re();if(0>i)break;for(;re[i];)i++;return _t(n,i).fd;case 1:case 2:return 0;case 3:return n.flags;case 4:return i=Re(),n.flags|=i,0;case 12:return i=Re(),ae[i+0>>1]=2,0;case 13:case 14:return 0}return-28}catch(a){if(typeof _>"u"||a.name!=="ErrnoError")throw a;return-a.Pa}},g:function(e,r){try{var t=A(e),n=t.node,i=t.Ma.Ta;e=i?t:n,i??=n.La.Ta,Ee(i);var a=i(e);return Ae(r,a)}catch(u){if(typeof _>"u"||u.name!=="ErrnoError")throw u;return-u.Pa}},H:function(e,r){r=-9007199254740992>r||9007199254740992<r?NaN:Number(r);try{if(isNaN(r))return-61;var t=A(e);if(0>r||(t.flags&2097155)===0)throw new f(28);return Wr(t,t.node,r),0}catch(n){if(typeof _>"u"||n.name!=="ErrnoError")throw n;return-n.Pa}},G:function(e,r){try{if(r===0)return-28;var t=ee("/")+1;return r<t?-68:(U("/",N,e,r),t)}catch(n){if(typeof _>"u"||n.name!=="ErrnoError")throw n;return-n.Pa}},K:function(e,r){try{return e=E(e),Ae(r,fe(e,!0))}catch(t){if(typeof _>"u"||t.name!=="ErrnoError")throw t;return-t.Pa}},C:function(e,r,t){try{return r=E(r),r=Z(e,r),D(r,t),0}catch(n){if(typeof _>"u"||n.name!=="ErrnoError")throw n;return-n.Pa}},J:function(e,r,t,n){try{r=E(r);var i=n&256;return r=Z(e,r,n&4096),Ae(t,i?fe(r,!0):fe(r))}catch(a){if(typeof _>"u"||a.name!=="ErrnoError")throw a;return-a.Pa}},x:function(e,r,t,n){Se=n;try{r=E(r),r=Z(e,r);var i=n?Re():0;return ne(r,t,i).fd}catch(a){if(typeof _>"u"||a.name!=="ErrnoError")throw a;return-a.Pa}},v:function(e,r,t,n){try{if(r=E(r),r=Z(e,r),0>=n)return-28;var i=O(r).node;if(!i)throw new f(44);if(!i.La.readlink)throw new f(28);var a=i.La.readlink(i),u=Math.min(n,ee(a)),c=q[t+u];return U(a,N,t,n+1),q[t+u]=c,u}catch(b){if(typeof _>"u"||b.name!=="ErrnoError")throw b;return-b.Pa}},u:function(e){try{return e=E(e),Ur(e),0}catch(r){if(typeof _>"u"||r.name!=="ErrnoError")throw r;return-r.Pa}},f:function(e,r){try{return e=E(e),Ae(r,fe(e))}catch(t){if(typeof _>"u"||t.name!=="ErrnoError")throw t;return-t.Pa}},r:function(e,r,t){try{if(r=E(r),r=Z(e,r),t)if(t===512)Ur(r);else return-28;else Dr(r);return 0}catch(n){if(typeof _>"u"||n.name!=="ErrnoError")throw n;return-n.Pa}},q:function(e,r,t){try{r=E(r),r=Z(e,r,!0);var n=Date.now(),i,a;if(t){var u=v[t>>2]+4294967296*k[t+4>>2],c=k[t+8>>2];c==1073741823?i=n:c==1073741822?i=null:i=1e3*u+c/1e6,t+=16,u=v[t>>2]+4294967296*k[t+4>>2],c=k[t+8>>2],c==1073741823?a=n:c==1073741822?a=null:a=1e3*u+c/1e6}else a=i=n;if((a??i)!==null){e=i;var b=O(r,{$a:!0}).node;Ee(b.La.Ua)(b,{atime:e,mtime:a})}return 0}catch(p){if(typeof _>"u"||p.name!=="ErrnoError")throw p;return-p.Pa}},m:()=>ue(""),l:()=>{_e=!1,ir=0},A:function(e,r){e=-9007199254740992>e||9007199254740992<e?NaN:Number(e),e=new Date(1e3*e),k[r>>2]=e.getSeconds(),k[r+4>>2]=e.getMinutes(),k[r+8>>2]=e.getHours(),k[r+12>>2]=e.getDate(),k[r+16>>2]=e.getMonth(),k[r+20>>2]=e.getFullYear()-1900,k[r+24>>2]=e.getDay();var t=e.getFullYear();k[r+28>>2]=(t%4!==0||t%100===0&&t%400!==0?Mt:qt)[e.getMonth()]+e.getDate()-1|0,k[r+36>>2]=-(60*e.getTimezoneOffset()),t=new Date(e.getFullYear(),6,1).getTimezoneOffset();var n=new Date(e.getFullYear(),0,1).getTimezoneOffset();k[r+32>>2]=(t!=n&&e.getTimezoneOffset()==Math.min(n,t))|0},y:function(e,r,t,n,i,a,u){i=-9007199254740992>i||9007199254740992<i?NaN:Number(i);try{var c=A(n);if((r&2)!==0&&(t&2)===0&&(c.flags&2097155)!==2)throw new f(2);if((c.flags&2097155)===1)throw new f(2);if(!c.Ma.ib)throw new f(43);if(!e)throw new f(28);var b=c.Ma.ib(c,e,i,r,t),p=b.Kb;return k[a>>2]=b.Ab,v[u>>2]=p,0}catch(g){if(typeof _>"u"||g.name!=="ErrnoError")throw g;return-g.Pa}},z:function(e,r,t,n,i,a){a=-9007199254740992>a||9007199254740992<a?NaN:Number(a);try{var u=A(i);if(t&2){if(t=a,(u.node.mode&61440)!==32768)throw new f(43);if(!(n&2)){var c=N.slice(e,e+r);u.Ma.jb&&u.Ma.jb(u,c,t,r,n)}}}catch(b){if(typeof _>"u"||b.name!=="ErrnoError")throw b;return-b.Pa}},n:(e,r)=>{if(he[e]&&(clearTimeout(he[e].id),delete he[e]),!r)return 0;var t=setTimeout(()=>{delete he[e],Nt(()=>Yr(e,performance.now()))},r);return he[e]={id:t,Xb:r},0},B:(e,r,t,n)=>{var i=new Date().getFullYear(),a=new Date(i,0,1).getTimezoneOffset();i=new Date(i,6,1).getTimezoneOffset(),v[e>>2]=60*Math.max(a,i),k[r>>2]=+(a!=i),r=u=>{var c=Math.abs(u);return`UTC${0<=u?"-":"+"}${String(Math.floor(c/60)).padStart(2,"0")}${String(c%60).padStart(2,"0")}`},e=r(a),r=r(i),i<a?(U(e,N,t,17),U(r,N,n,17)):(U(e,N,n,17),U(r,N,t,17))},d:()=>Date.now(),s:()=>2147483648,c:()=>performance.now(),o:e=>{var r=N.length;if(e>>>=0,2147483648<e)return!1;for(var t=1;4>=t;t*=2){var n=r*(1+.2/t);n=Math.min(n,e+100663296);e:{n=(Math.min(2147483648,65536*Math.ceil(Math.max(e,n)/65536))-Pe.buffer.byteLength+65535)/65536|0;try{Pe.grow(n),cr();var i=1;break e}catch{}i=void 0}if(i)return!0}return!1},E:(e,r)=>{var t=0,n=0,i;for(i of $r()){var a=r+t;v[e+n>>2]=a,t+=U(i,N,a,1/0)+1,n+=4}return 0},F:(e,r)=>{var t=$r();v[e>>2]=t.length,e=0;for(var n of t)e+=ee(n)+1;return v[r>>2]=e,0},e:function(e){try{var r=A(e);return nr(r),0}catch(t){if(typeof _>"u"||t.name!=="ErrnoError")throw t;return t.Pa}},p:function(e,r){try{var t=A(e);return q[r]=t.tty?2:S(t.mode)?3:(t.mode&61440)===40960?7:4,ae[r+2>>1]=0,x[r+8>>3]=BigInt(0),x[r+16>>3]=BigInt(0),0}catch(n){if(typeof _>"u"||n.name!=="ErrnoError")throw n;return n.Pa}},w:function(e,r,t,n){try{e:{var i=A(e);e=r;for(var a,u=r=0;u<t;u++){var c=v[e>>2],b=v[e+4>>2];e+=8;var p=zr(i,q,c,b,a);if(0>p){var g=-1;break e}if(r+=p,p<b)break;typeof a<"u"&&(a+=p)}g=r}return v[n>>2]=g,0}catch(M){if(typeof _>"u"||M.name!=="ErrnoError")throw M;return M.Pa}},D:function(e,r,t,n){r=-9007199254740992>r||9007199254740992<r?NaN:Number(r);try{if(isNaN(r))return 61;var i=A(e);return jr(i,r,t),x[n>>3]=BigInt(i.position),i.pb&&r===0&&t===0&&(i.pb=null),0}catch(a){if(typeof _>"u"||a.name!=="ErrnoError")throw a;return a.Pa}},I:function(e){try{var r=A(e);return r.Ma?.fsync?.(r)}catch(t){if(typeof _>"u"||t.name!=="ErrnoError")throw t;return t.Pa}},t:function(e,r,t,n){try{e:{var i=A(e);e=r;for(var a,u=r=0;u<t;u++){var c=v[e>>2],b=v[e+4>>2];e+=8;var p=Qr(i,q,c,b,a);if(0>p){var g=-1;break e}if(r+=p,p<b)break;typeof a<"u"&&(a+=p)}g=r}return v[n>>2]=g,0}catch(M){if(typeof _>"u"||M.name!=="ErrnoError")throw M;return M.Pa}},k:Fr};function sr(){function e(){if(s.calledRun=!0,!ye){if(!s.noFSInit&&!Nr){var r,t;Nr=!0,r??=s.stdin,t??=s.stdout,n??=s.stderr,r?B("stdin",r):tr("/dev/tty","/dev/stdin"),t?B("stdout",null,t):tr("/dev/tty","/dev/stdout"),n?B("stderr",null,n):tr("/dev/tty1","/dev/stderr"),ne("/dev/stdin",0),ne("/dev/stdout",1),ne("/dev/stderr",1)}if(lr.N(),Ar=!1,s.onRuntimeInitialized?.(),s.postRun)for(typeof s.postRun=="function"&&(s.postRun=[s.postRun]);s.postRun.length;){var n=s.postRun.shift();pr.push(n)}dr(pr)}}if(0<C)se=sr;else{if(s.preRun)for(typeof s.preRun=="function"&&(s.preRun=[s.preRun]);s.preRun.length;)ht();dr(wr),0<C?se=sr:s.setStatus?(s.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>s.setStatus(""),1),e()},1)):e()}}var lr;return(async function(){function e(t){return t=lr=t.exports,s._sqlite3_free=t.P,s._sqlite3_value_text=t.Q,s._sqlite3_prepare_v2=t.R,s._sqlite3_step=t.S,s._sqlite3_reset=t.T,s._sqlite3_exec=t.U,s._sqlite3_finalize=t.V,s._sqlite3_column_name=t.W,s._sqlite3_column_text=t.X,s._sqlite3_column_type=t.Y,s._sqlite3_errmsg=t.Z,s._sqlite3_clear_bindings=t._,s._sqlite3_value_blob=t.$,s._sqlite3_value_bytes=t.aa,s._sqlite3_value_double=t.ba,s._sqlite3_value_int=t.ca,s._sqlite3_value_type=t.da,s._sqlite3_result_blob=t.ea,s._sqlite3_result_double=t.fa,s._sqlite3_result_error=t.ga,s._sqlite3_result_int=t.ha,s._sqlite3_result_int64=t.ia,s._sqlite3_result_null=t.ja,s._sqlite3_result_text=t.ka,s._sqlite3_aggregate_context=t.la,s._sqlite3_column_count=t.ma,s._sqlite3_data_count=t.na,s._sqlite3_column_blob=t.oa,s._sqlite3_column_bytes=t.pa,s._sqlite3_column_double=t.qa,s._sqlite3_bind_blob=t.ra,s._sqlite3_bind_double=t.sa,s._sqlite3_bind_int=t.ta,s._sqlite3_bind_text=t.ua,s._sqlite3_bind_parameter_index=t.va,s._sqlite3_sql=t.wa,s._sqlite3_normalized_sql=t.xa,s._sqlite3_changes=t.ya,s._sqlite3_close_v2=t.za,s._sqlite3_create_function_v2=t.Aa,s._sqlite3_update_hook=t.Ba,s._sqlite3_open=t.Ca,Le=s._malloc=t.Da,ce=s._free=t.Ea,s._RegisterExtensionFunctions=t.Fa,Xr=t.Ga,Yr=t.Ha,xe=t.Ia,H=t.Ja,Te=t.Ka,Pe=t.M,X=t.O,cr(),C--,s.monitorRunDependencies?.(C),C==0&&se&&(t=se,se=null,t()),lr}C++,s.monitorRunDependencies?.(C);var r={a:Rt};return s.instantiateWasm?new Promise(t=>{s.instantiateWasm(r,(n,i)=>{t(e(n))})}):(Xe??=s.locateFile?s.locateFile("sql-wasm.wasm",we):we+"sql-wasm.wasm",e((await ft(r)).instance))})(),sr(),I}),z)};j.exports=Q,j.exports.default=Q})(hr)),hr.exports}var ot=an();const un=nn(ot),fn=on({__proto__:null,default:un},[ot]);export{fn as s};
@@ -5,7 +5,7 @@
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
6
  <title>slicc</title>
7
7
  <link rel="icon" type="image/png" href="/logos/sliccy-color-1scoops-32x32.png" />
8
- <script type="module" crossorigin src="/assets/index-W9ryXG_v.js"></script>
8
+ <script type="module" crossorigin src="/assets/index-DJPmZw4a.js"></script>
9
9
  <link rel="stylesheet" crossorigin href="/assets/index-BlSQnyL2.css">
10
10
  </head>
11
11
  <body>
@@ -5,7 +5,7 @@
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
6
  <title>slicc</title>
7
7
  <link rel="icon" type="image/png" href="/logos/sliccy-color-1scoops-32x32.png" />
8
- <script type="module" crossorigin src="/assets/index-W9ryXG_v.js"></script>
8
+ <script type="module" crossorigin src="/assets/index-DJPmZw4a.js"></script>
9
9
  <link rel="stylesheet" crossorigin href="/assets/index-BlSQnyL2.css">
10
10
  </head>
11
11
  <body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sliccy",
3
- "version": "1.26.0",
3
+ "version": "1.26.1",
4
4
  "description": "Browser-based coding agent with thin CLI server",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -48,7 +48,7 @@
48
48
  },
49
49
  "dependencies": {
50
50
  "express": "^4.21.2",
51
- "pyodide": "0.27.7",
51
+ "pyodide": "0.29.3",
52
52
  "ws": "^8.18.0"
53
53
  },
54
54
  "devDependencies": {
@@ -59,7 +59,7 @@
59
59
  "@semantic-release/github": "12.0.6",
60
60
  "@semantic-release/npm": "13.1.5",
61
61
  "@semantic-release/release-notes-generator": "14.1.0",
62
- "@types/node": "^22.13.0",
62
+ "@types/node": "^24.0.0",
63
63
  "eslint": "10.1.0",
64
64
  "eslint-config-prettier": "10.1.8",
65
65
  "globals": "17.4.0",
@@ -1,3 +0,0 @@
1
- import{_ as y}from"./index-W9ryXG_v.js";var le=Object.defineProperty,l=(e,t)=>le(e,"name",{value:t,configurable:!0}),U=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,n)=>(typeof require<"u"?require:t)[n]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')});function M(e){return!isNaN(parseFloat(e))&&isFinite(e)}l(M,"_isNumber");function w(e){return e.charAt(0).toUpperCase()+e.substring(1)}l(w,"_capitalize");function R(e){return function(){return this[e]}}l(R,"_getter");var S=["isConstructor","isEval","isNative","isToplevel"],O=["columnNumber","lineNumber"],F=["fileName","functionName","source"],ce=["args"],ue=["evalOrigin"],k=S.concat(O,F,ce,ue);function p(e){if(e)for(var t=0;t<k.length;t++)e[k[t]]!==void 0&&this["set"+w(k[t])](e[k[t]])}l(p,"StackFrame");p.prototype={getArgs:function(){return this.args},setArgs:function(e){if(Object.prototype.toString.call(e)!=="[object Array]")throw new TypeError("Args must be an Array");this.args=e},getEvalOrigin:function(){return this.evalOrigin},setEvalOrigin:function(e){if(e instanceof p)this.evalOrigin=e;else if(e instanceof Object)this.evalOrigin=new p(e);else throw new TypeError("Eval Origin must be an Object or StackFrame")},toString:function(){var e=this.getFileName()||"",t=this.getLineNumber()||"",n=this.getColumnNumber()||"",a=this.getFunctionName()||"";return this.getIsEval()?e?"[eval] ("+e+":"+t+":"+n+")":"[eval]:"+t+":"+n:a?a+" ("+e+":"+t+":"+n+")":e+":"+t+":"+n}};p.fromString=l(function(e){var t=e.indexOf("("),n=e.lastIndexOf(")"),a=e.substring(0,t),o=e.substring(t+1,n).split(","),r=e.substring(n+1);if(r.indexOf("@")===0)var i=/@(.+?)(?::(\d+))?(?::(\d+))?$/.exec(r,""),s=i[1],c=i[2],u=i[3];return new p({functionName:a,args:o||void 0,fileName:s,lineNumber:c||void 0,columnNumber:u||void 0})},"StackFrame$$fromString");for(g=0;g<S.length;g++)p.prototype["get"+w(S[g])]=R(S[g]),p.prototype["set"+w(S[g])]=(function(e){return function(t){this[e]=!!t}})(S[g]);var g;for(_=0;_<O.length;_++)p.prototype["get"+w(O[_])]=R(O[_]),p.prototype["set"+w(O[_])]=(function(e){return function(t){if(!M(t))throw new TypeError(e+" must be a Number");this[e]=Number(t)}})(O[_]);var _;for(E=0;E<F.length;E++)p.prototype["get"+w(F[E])]=R(F[E]),p.prototype["set"+w(F[E])]=(function(e){return function(t){this[e]=String(t)}})(F[E]);var E,I=p;function V(){var e=/^\s*at .*(\S+:\d+|\(native\))/m,t=/^(eval@)?(\[native code])?$/;return{parse:l(function(n){if(n.stack&&n.stack.match(e))return this.parseV8OrIE(n);if(n.stack)return this.parseFFOrSafari(n);throw new Error("Cannot parse given Error object")},"ErrorStackParser$$parse"),extractLocation:l(function(n){if(n.indexOf(":")===-1)return[n];var a=/(.+?)(?::(\d+))?(?::(\d+))?$/,o=a.exec(n.replace(/[()]/g,""));return[o[1],o[2]||void 0,o[3]||void 0]},"ErrorStackParser$$extractLocation"),parseV8OrIE:l(function(n){var a=n.stack.split(`
2
- `).filter(function(o){return!!o.match(e)},this);return a.map(function(o){o.indexOf("(eval ")>-1&&(o=o.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(,.*$)/g,""));var r=o.replace(/^\s+/,"").replace(/\(eval code/g,"(").replace(/^.*?\s+/,""),i=r.match(/ (\(.+\)$)/);r=i?r.replace(i[0],""):r;var s=this.extractLocation(i?i[1]:r),c=i&&r||void 0,u=["eval","<anonymous>"].indexOf(s[0])>-1?void 0:s[0];return new I({functionName:c,fileName:u,lineNumber:s[1],columnNumber:s[2],source:o})},this)},"ErrorStackParser$$parseV8OrIE"),parseFFOrSafari:l(function(n){var a=n.stack.split(`
3
- `).filter(function(o){return!o.match(t)},this);return a.map(function(o){if(o.indexOf(" > eval")>-1&&(o=o.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),o.indexOf("@")===-1&&o.indexOf(":")===-1)return new I({functionName:o});var r=/((.*".+"[^@]*)?[^@]*)(?:@)/,i=o.match(r),s=i&&i[1]?i[1]:void 0,c=this.extractLocation(o.replace(r,""));return new I({functionName:s,fileName:c[0],lineNumber:c[1],columnNumber:c[2],source:o})},this)},"ErrorStackParser$$parseFFOrSafari")}}l(V,"ErrorStackParser");var de=new V,fe=de,h=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string"&&!process.browser,H=h&&typeof module<"u"&&typeof module.exports<"u"&&typeof U<"u"&&typeof __dirname<"u",me=h&&!H,pe=typeof Deno<"u",C=!h&&!pe,ye=C&&typeof window=="object"&&typeof document=="object"&&typeof document.createElement=="function"&&"sessionStorage"in window&&typeof importScripts!="function",he=C&&typeof importScripts=="function"&&typeof self=="object";typeof navigator=="object"&&typeof navigator.userAgent=="string"&&navigator.userAgent.indexOf("Chrome")==-1&&navigator.userAgent.indexOf("Safari")>-1;var q,D,W,$,T;async function A(){if(!h||(q=(await y(async()=>{const{default:r}=await import("./__vite-browser-external-D7Ct-6yo.js").then(i=>i._);return{default:r}},[])).default,$=await y(()=>import("./__vite-browser-external-D7Ct-6yo.js").then(r=>r._),[]),T=await y(()=>import("./__vite-browser-external-D7Ct-6yo.js").then(r=>r._),[]),W=(await y(async()=>{const{default:r}=await import("./__vite-browser-external-D7Ct-6yo.js").then(i=>i._);return{default:r}},[])).default,D=await y(()=>import("./__vite-browser-external-D7Ct-6yo.js").then(r=>r._),[]),N=D.sep,typeof U<"u"))return;let e=$,t=await y(()=>import("./__vite-browser-external-D7Ct-6yo.js").then(r=>r._),[]),n=await y(()=>import("./__vite-browser-external-D7Ct-6yo.js").then(r=>r._),[]),a=await y(()=>import("./__vite-browser-external-D7Ct-6yo.js").then(r=>r._),[]),o={fs:e,crypto:t,ws:n,child_process:a};globalThis.require=function(r){return o[r]}}l(A,"initNodeModules");function z(e,t){return D.resolve(t||".",e)}l(z,"node_resolvePath");function B(e,t){return t===void 0&&(t=location),new URL(e,t).toString()}l(B,"browser_resolvePath");var x;h?x=z:x=B;var N;h||(N="/");function Y(e,t){return e.startsWith("file://")&&(e=e.slice(7)),e.includes("://")?{response:fetch(e)}:{binary:T.readFile(e).then(n=>new Uint8Array(n.buffer,n.byteOffset,n.byteLength))}}l(Y,"node_getBinaryResponse");function J(e,t){let n=new URL(e,location);return{response:fetch(n,t?{integrity:t}:{})}}l(J,"browser_getBinaryResponse");var P;h?P=Y:P=J;async function G(e,t){let{response:n,binary:a}=P(e,t);if(a)return a;let o=await n;if(!o.ok)throw new Error(`Failed to load '${e}': request failed.`);return new Uint8Array(await o.arrayBuffer())}l(G,"loadBinaryFile");var L;if(ye)L=l(async e=>await import(e),"loadScript");else if(he)L=l(async e=>{try{globalThis.importScripts(e)}catch(t){if(t instanceof TypeError)await import(e);else throw t}},"loadScript");else if(h)L=K;else throw new Error("Cannot determine runtime environment");async function K(e){e.startsWith("file://")&&(e=e.slice(7)),e.includes("://")?W.runInThisContext(await(await fetch(e)).text()):await import(q.pathToFileURL(e).href)}l(K,"nodeLoadScript");async function Q(e){if(h){await A();let t=await T.readFile(e,{encoding:"utf8"});return JSON.parse(t)}else return await(await fetch(e)).json()}l(Q,"loadLockFile");async function X(){if(H)return __dirname;let e;try{throw new Error}catch(a){e=a}let t=fe.parse(e)[0].fileName;if(h&&!t.startsWith("file://")&&(t=`file://${t}`),me){let a=await y(()=>import("./__vite-browser-external-D7Ct-6yo.js").then(o=>o._),[]);return(await y(async()=>{const{fileURLToPath:o}=await import("./__vite-browser-external-D7Ct-6yo.js").then(r=>r._);return{fileURLToPath:o}},[])).fileURLToPath(a.dirname(t))}let n=t.lastIndexOf(N);if(n===-1)throw new Error("Could not extract indexURL path from pyodide module location");return t.slice(0,n)}l(X,"calculateDirname");function Z(e){let t=e.FS,n=e.FS.filesystems.MEMFS,a=e.PATH,o={DIR_MODE:16895,FILE_MODE:33279,mount:function(r){if(!r.opts.fileSystemHandle)throw new Error("opts.fileSystemHandle is required");return n.mount.apply(null,arguments)},syncfs:async(r,i,s)=>{try{let c=o.getLocalSet(r),u=await o.getRemoteSet(r),d=i?u:c,m=i?c:u;await o.reconcile(r,d,m),s(null)}catch(c){s(c)}},getLocalSet:r=>{let i=Object.create(null);function s(d){return d!=="."&&d!==".."}l(s,"isRealDir");function c(d){return m=>a.join2(d,m)}l(c,"toAbsolute");let u=t.readdir(r.mountpoint).filter(s).map(c(r.mountpoint));for(;u.length;){let d=u.pop(),m=t.stat(d);t.isDir(m.mode)&&u.push.apply(u,t.readdir(d).filter(s).map(c(d))),i[d]={timestamp:m.mtime,mode:m.mode}}return{type:"local",entries:i}},getRemoteSet:async r=>{let i=Object.create(null),s=await we(r.opts.fileSystemHandle);for(let[c,u]of s)c!=="."&&(i[a.join2(r.mountpoint,c)]={timestamp:u.kind==="file"?new Date((await u.getFile()).lastModified):new Date,mode:u.kind==="file"?o.FILE_MODE:o.DIR_MODE});return{type:"remote",entries:i,handles:s}},loadLocalEntry:r=>{let i=t.lookupPath(r).node,s=t.stat(r);if(t.isDir(s.mode))return{timestamp:s.mtime,mode:s.mode};if(t.isFile(s.mode))return i.contents=n.getFileDataAsTypedArray(i),{timestamp:s.mtime,mode:s.mode,contents:i.contents};throw new Error("node type not supported")},storeLocalEntry:(r,i)=>{if(t.isDir(i.mode))t.mkdirTree(r,i.mode);else if(t.isFile(i.mode))t.writeFile(r,i.contents,{canOwn:!0});else throw new Error("node type not supported");t.chmod(r,i.mode),t.utime(r,i.timestamp,i.timestamp)},removeLocalEntry:r=>{var i=t.stat(r);t.isDir(i.mode)?t.rmdir(r):t.isFile(i.mode)&&t.unlink(r)},loadRemoteEntry:async r=>{if(r.kind==="file"){let i=await r.getFile();return{contents:new Uint8Array(await i.arrayBuffer()),mode:o.FILE_MODE,timestamp:new Date(i.lastModified)}}else{if(r.kind==="directory")return{mode:o.DIR_MODE,timestamp:new Date};throw new Error("unknown kind: "+r.kind)}},storeRemoteEntry:async(r,i,s)=>{let c=r.get(a.dirname(i)),u=t.isFile(s.mode)?await c.getFileHandle(a.basename(i),{create:!0}):await c.getDirectoryHandle(a.basename(i),{create:!0});if(u.kind==="file"){let d=await u.createWritable();await d.write(s.contents),await d.close()}r.set(i,u)},removeRemoteEntry:async(r,i)=>{await r.get(a.dirname(i)).removeEntry(a.basename(i)),r.delete(i)},reconcile:async(r,i,s)=>{let c=0,u=[];Object.keys(i.entries).forEach(function(f){let v=i.entries[f],b=s.entries[f];(!b||t.isFile(v.mode)&&v.timestamp.getTime()>b.timestamp.getTime())&&(u.push(f),c++)}),u.sort();let d=[];if(Object.keys(s.entries).forEach(function(f){i.entries[f]||(d.push(f),c++)}),d.sort().reverse(),!c)return;let m=i.type==="remote"?i.handles:s.handles;for(let f of u){let v=a.normalize(f.replace(r.mountpoint,"/")).substring(1);if(s.type==="local"){let b=m.get(v),se=await o.loadRemoteEntry(b);o.storeLocalEntry(f,se)}else{let b=o.loadLocalEntry(f);await o.storeRemoteEntry(m,v,b)}}for(let f of d)if(s.type==="local")o.removeLocalEntry(f);else{let v=a.normalize(f.replace(r.mountpoint,"/")).substring(1);await o.removeRemoteEntry(m,v)}}};e.FS.filesystems.NATIVEFS_ASYNC=o}l(Z,"initializeNativeFS");var we=l(async e=>{let t=[];async function n(o){for await(let r of o.values())t.push(r),r.kind==="directory"&&await n(r)}l(n,"collect"),await n(e);let a=new Map;a.set(".",e);for(let o of t){let r=(await e.resolve(o)).join("/");a.set(r,o)}return a},"getFsHandles");function ee(e){let t={noImageDecoding:!0,noAudioDecoding:!0,noWasmDecoding:!1,preRun:oe(e),quit(n,a){throw t.exited={status:n,toThrow:a},a},print:e.stdout,printErr:e.stderr,thisProgram:e._sysExecutable,arguments:e.args,API:{config:e},locateFile:n=>e.indexURL+n,instantiateWasm:ae(e.indexURL)};return t}l(ee,"createSettings");function te(e){return function(t){let n="/";try{t.FS.mkdirTree(e)}catch(a){console.error(`Error occurred while making a home directory '${e}':`),console.error(a),console.error(`Using '${n}' for a home directory instead`),e=n}t.FS.chdir(e)}}l(te,"createHomeDirectory");function re(e){return function(t){Object.assign(t.ENV,e)}}l(re,"setEnvironment");function ie(e){return e?[async t=>{t.addRunDependency("fsInitHook");try{await e(t.FS,{sitePackages:t.API.sitePackages})}finally{t.removeRunDependency("fsInitHook")}}]:[]}l(ie,"callFsInitHook");function ne(e){let t=G(e);return async n=>{let a=n._py_version_major(),o=n._py_version_minor();n.FS.mkdirTree("/lib"),n.API.sitePackages=`/lib/python${a}.${o}/site-packages`,n.FS.mkdirTree(n.API.sitePackages),n.addRunDependency("install-stdlib");try{let r=await t;n.FS.writeFile(`/lib/python${a}${o}.zip`,r)}catch(r){console.error("Error occurred while installing the standard library:"),console.error(r)}finally{n.removeRunDependency("install-stdlib")}}}l(ne,"installStdlib");function oe(e){let t;return e.stdLibURL!=null?t=e.stdLibURL:t=e.indexURL+"python_stdlib.zip",[...ie(e.fsInit),ne(t),te(e.env.HOME),re(e.env),Z]}l(oe,"getFileSystemInitializationFuncs");function ae(e){if(typeof WasmOffsetConverter<"u")return;let{binary:t,response:n}=P(e+"pyodide.asm.wasm");return function(a,o){return(async function(){try{let r;n?r=await WebAssembly.instantiateStreaming(n,a):r=await WebAssembly.instantiate(await t,a);let{instance:i,module:s}=r;o(i,s)}catch(r){console.warn("wasm instantiation failed!"),console.warn(r)}})(),{}}}l(ae,"getInstantiateWasmFunc");var j="0.27.7";async function ve(e={}){var t,n;await A();let a=e.indexURL||await X();a=x(a),a.endsWith("/")||(a+="/"),e.indexURL=a;let o={fullStdLib:!1,jsglobals:globalThis,stdin:globalThis.prompt?globalThis.prompt:void 0,lockFileURL:a+"pyodide-lock.json",args:[],env:{},packageCacheDir:a,packages:[],enableRunUntilComplete:!0,checkAPIVersion:!0,BUILD_ID:"e94377f5ce7dcf67e0417b69a0016733c2cfb6b4622ee8c490a6f17eb58e863b"},r=Object.assign(o,e);(t=r.env).HOME??(t.HOME="/home/pyodide"),(n=r.env).PYTHONINSPECT??(n.PYTHONINSPECT="1");let i=ee(r),s=i.API;if(s.lockFilePromise=Q(r.lockFileURL),typeof _createPyodideModule!="function"){let f=`${r.indexURL}pyodide.asm.js`;await L(f)}let c;if(e._loadSnapshot){let f=await e._loadSnapshot;ArrayBuffer.isView(f)?c=f:c=new Uint8Array(f),i.noInitialRun=!0,i.INITIAL_MEMORY=c.length}let u=await _createPyodideModule(i);if(i.exited)throw i.exited.toThrow;if(e.pyproxyToStringRepr&&s.setPyProxyToStringMethod(!0),s.version!==j&&r.checkAPIVersion)throw new Error(`Pyodide version does not match: '${j}' <==> '${s.version}'. If you updated the Pyodide version, make sure you also updated the 'indexURL' parameter passed to loadPyodide.`);u.locateFile=f=>{throw new Error("Didn't expect to load any more file_packager files!")};let d;c&&(d=s.restoreSnapshot(c));let m=s.finalizeBootstrap(d,e._snapshotDeserializer);return s.sys.path.insert(0,""),m.version.includes("dev")||s.setCdnUrl(`https://cdn.jsdelivr.net/pyodide/v${m.version}/full/`),s._pyodide.set_excepthook(),await s.packageIndexReady,s.initializeStreams(r.stdin,r.stdout,r.stderr),m}l(ve,"loadPyodide");export{ve as loadPyodide,j as version};