@marimo-team/frontend 0.9.18-dev9 → 0.9.19-dev10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{ConnectedDataExplorerComponent-ZTeYnZhB.js → ConnectedDataExplorerComponent-C8eXES-G.js} +1 -1
- package/dist/assets/{VegaLite-IluBr0p0.js → VegaLite-Cfpetgzq.js} +1 -1
- package/dist/assets/__vite-browser-external-CIEyP2s7.js +1 -0
- package/dist/assets/{_baseEach-BOJ7rr2z.js → _baseEach-BHl1PZWW.js} +1 -1
- package/dist/assets/_baseMap-B3y8VhTw.js +1 -0
- package/dist/assets/{_baseUniq-Da35M4Ot.js → _baseUniq-DjNHqzUu.js} +1 -1
- package/dist/assets/{any-language-editor-Bbbh9ujK.js → any-language-editor-D5tiiG_0.js} +1 -1
- package/dist/assets/{architectureDiagram-IFBEXTG3-B1eONMm-.js → architectureDiagram-IFBEXTG3-BujjHxjJ.js} +1 -1
- package/dist/assets/{blockDiagram-TCMKQVZ6-BpbXYLgk.js → blockDiagram-TCMKQVZ6-CneJp760.js} +1 -1
- package/dist/assets/{c4Diagram-ZCSEYPFN-BKMTAdfA.js → c4Diagram-ZCSEYPFN-C6-Xd7er.js} +1 -1
- package/dist/assets/channel-DSXZUaBJ.js +1 -0
- package/dist/assets/{chunk-4LC2V6XN-D4kCS8j6.js → chunk-4LC2V6XN-DidNLHjV.js} +1 -1
- package/dist/assets/{chunk-5RIWM3LS-DS12e7Ja.js → chunk-5RIWM3LS-CWv8gwrP.js} +1 -1
- package/dist/assets/{chunk-6JKP7OK7-4YW4YieP.js → chunk-6JKP7OK7-BPIu-3AS.js} +1 -1
- package/dist/assets/{chunk-NGC4727B-BRjQAEaF.js → chunk-NGC4727B-BiCE2Jpw.js} +1 -1
- package/dist/assets/{chunk-REEJFE46-BxFM3TYY.js → chunk-REEJFE46-BNafjELz.js} +1 -1
- package/dist/assets/{chunk-RYO7GUH3-CPaqUW9l.js → chunk-RYO7GUH3-CpXp6hLG.js} +1 -1
- package/dist/assets/{chunk-V35ELUW5-c2PThOse.js → chunk-V35ELUW5-CrxgLydM.js} +1 -1
- package/dist/assets/{classDiagram-Q73GJZWF-BOXErcur.js → classDiagram-Q73GJZWF-D7KqtVMg.js} +1 -1
- package/dist/assets/{classDiagram-v2-C6QPLPW4-Cx2_bb6w.js → classDiagram-v2-C6QPLPW4-DzzgKFjP.js} +1 -1
- package/dist/assets/clone-BQdCp9Zf.js +1 -0
- package/dist/assets/{dagre-7KT5K2WU-Cw6q2K10.js → dagre-7KT5K2WU-rErnC1CP.js} +1 -1
- package/dist/assets/{data-editor-C1laN8VB.js → data-editor-Df2nSIm5.js} +1 -1
- package/dist/assets/{diagram-AVGMFHF7-CvL9AeMs.js → diagram-AVGMFHF7-NqCbSgtG.js} +1 -1
- package/dist/assets/{edit-page-BUF6Pcqz.js → edit-page-CvhH-WqW.js} +3 -3
- package/dist/assets/{erDiagram-DKC2X5TE-CWu1FsyX.js → erDiagram-DKC2X5TE-I-jxZ7tp.js} +1 -1
- package/dist/assets/{flowDiagram-NWEUNK3L-BYg9FXpZ.js → flowDiagram-NWEUNK3L-f-lcBL7Z.js} +1 -1
- package/dist/assets/{ganttDiagram-HLVPPPRE-CLzHU7Ew.js → ganttDiagram-HLVPPPRE-Dz9rXzWD.js} +1 -1
- package/dist/assets/{gitGraph-YCYPL57B-BVcf3MJN.js → gitGraph-YCYPL57B-miO51RDX.js} +1 -1
- package/dist/assets/{gitGraphDiagram-JPZ3KUXI-P6y89FyT.js → gitGraphDiagram-JPZ3KUXI-CkyU1-5s.js} +1 -1
- package/dist/assets/{graph-CTr8fmHD.js → graph-fmmsxDHj.js} +1 -1
- package/dist/assets/{home-page-x8SC-AEM.js → home-page-B_TEi4H8.js} +1 -1
- package/dist/assets/{index-CpPRvJ8u.js → index-A8UrqOs5.js} +1 -1
- package/dist/assets/{index-BqW-O5_5.js → index-BUM0am5T.js} +1 -1
- package/dist/assets/{index-x8gnePyn.js → index-Bc6PfGJk.js} +1 -1
- package/dist/assets/{index-cLsZznd0.js → index-BhohDy-s.js} +1 -1
- package/dist/assets/{index-4NE4TUfK.js → index-C4UHzXGc.js} +1 -1
- package/dist/assets/{index-Clx5QXsl.js → index-C5bGvM-7.js} +1 -1
- package/dist/assets/{index-tmZmhbUF.js → index-CFx0qknj.js} +1 -1
- package/dist/assets/{index-BhC7C3ji.js → index-CN7spTmQ.js} +1 -1
- package/dist/assets/{index-smzK0Z-Y.js → index-CP1ax0JU.js} +6 -6
- package/dist/assets/{index-CtOfOzW2.js → index-CfY2W1mQ.js} +1 -1
- package/dist/assets/{index-C3cJ6m14.js → index-CiPsGTzp.js} +1 -1
- package/dist/assets/{index-BCaDr8sq.js → index-D-yS8BfK.js} +1 -1
- package/dist/assets/{index-g6NwUTpV.js → index-D4OmREUI.js} +1 -1
- package/dist/assets/index-DDmWaUfc.css +1 -0
- package/dist/assets/{index-B-vZ6Qcg.js → index-EVD0n6QN.js} +1 -1
- package/dist/assets/{index-Rrwl4RC2.js → index-LCRHo9eo.js} +1 -1
- package/dist/assets/{index-BmjDRuG-.js → index-RW5yFOEC.js} +1 -1
- package/dist/assets/{index-Av8By3Vq.js → index-vUUYxDq9.js} +1 -1
- package/dist/assets/{infoDiagram-RZZSJVI2-Bs2GmHdo.js → infoDiagram-RZZSJVI2-DJ9cxsKh.js} +1 -1
- package/dist/assets/{journeyDiagram-BLD6N6MZ-CL5THg0T.js → journeyDiagram-BLD6N6MZ-D1Bdct-h.js} +1 -1
- package/dist/assets/{json-BDaO8uff.js → json-CO6GECCH.js} +1 -1
- package/dist/assets/{layout-IvWkkQiv.js → layout-B4FV4a6B.js} +1 -1
- package/dist/assets/{linear-DYe2SjHl.js → linear-0LMYqfku.js} +1 -1
- package/dist/assets/{mermaid-CrKddFRb.js → mermaid-D6xfmtI0.js} +3 -3
- package/dist/assets/{min-BksYOAAE.js → min-CKHvpo_E.js} +1 -1
- package/dist/assets/{mindmap-definition-OEB2RXX2-CuxJvPxZ.js → mindmap-definition-OEB2RXX2-Vzdg2GCL.js} +1 -1
- package/dist/assets/{pieDiagram-X7YZ5ZEZ-Cc3EtSTT.js → pieDiagram-X7YZ5ZEZ-CwtrQq_Y.js} +1 -1
- package/dist/assets/{quadrantDiagram-F36EZAVT-DfV2phao.js → quadrantDiagram-F36EZAVT-v21GCfZp.js} +1 -1
- package/dist/assets/{react-plotly-DezLJMw0.js → react-plotly-Dg0gY635.js} +1 -1
- package/dist/assets/{requirementDiagram-JG2LMPGF-qRmdy3mz.js → requirementDiagram-JG2LMPGF-1vgBt5Yg.js} +1 -1
- package/dist/assets/run-page-B1R0LNsd.js +1 -0
- package/dist/assets/{sankeyDiagram-ATFNWWW6-D5Na1fCR.js → sankeyDiagram-ATFNWWW6-CSG6Bx0h.js} +1 -1
- package/dist/assets/save-worker-YNsgmLVY.js +1 -0
- package/dist/assets/{sequenceDiagram-WK7YDQ3N-CZK3gaW4.js → sequenceDiagram-WK7YDQ3N-YO9Nyjv_.js} +1 -1
- package/dist/assets/{slides-component-BAOBXZYZ.js → slides-component-ev9ssPUQ.js} +1 -1
- package/dist/assets/{sortBy-FLjdmHpR.js → sortBy-D4vSd4nA.js} +1 -1
- package/dist/assets/{stateDiagram-4JV6CC6H-C6qfHJ3s.js → stateDiagram-4JV6CC6H-BVLRSThV.js} +1 -1
- package/dist/assets/stateDiagram-v2-7KT6RKTD-DUh0_MbP.js +1 -0
- package/dist/assets/{terminal-Df50lxD3.js → terminal-Q05Nq2Cb.js} +1 -1
- package/dist/assets/{time-Dh3-rksV.js → time-mfDZi-TL.js} +1 -1
- package/dist/assets/{timeline-definition-3ZMEY6HS-Bk2B_NwR.js → timeline-definition-3ZMEY6HS-yCCPlOwU.js} +1 -1
- package/dist/assets/{transform-CaCRavvA.js → transform-Dxpz-TVF.js} +1 -1
- package/dist/assets/tree-D73j0nFg.js +13 -0
- package/dist/assets/{useMarimoWebSocket-RLB8CYwc.js → useMarimoWebSocket-CFypwdrI.js} +5 -5
- package/dist/assets/{vega-component-CSmMnBPm.js → vega-component-B7s-A1V7.js} +1 -1
- package/dist/assets/worker-DWEzam7I.js +1 -0
- package/dist/assets/worker-P6zQAE9_.js +1 -0
- package/dist/assets/{xychartDiagram-KECQ2H5Q-DoZoRcNO.js → xychartDiagram-KECQ2H5Q-BeAFcuA3.js} +1 -1
- package/dist/index.html +2 -2
- package/package.json +1 -1
- package/dist/assets/_baseMap-BrMUQBgb.js +0 -1
- package/dist/assets/channel-Cbjx4FBL.js +0 -1
- package/dist/assets/clone-BVBe7VA3.js +0 -1
- package/dist/assets/index-VLbIWGNK.css +0 -1
- package/dist/assets/run-page-Bd1Gbne_.js +0 -1
- package/dist/assets/save-worker-BsXz6Pdg.js +0 -1
- package/dist/assets/stateDiagram-v2-7KT6RKTD-CEVkzzPp.js +0 -1
- package/dist/assets/tree-C-aoWkvl.js +0 -13
- package/dist/assets/worker--4VCqOSN.js +0 -1
- package/dist/assets/worker--sgb-8qZ.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{D as e,F as t,G as o,H as s,J as a,K as n,M as r,O as i,P as l,Q as c,S as m,T as d,U as h,V as b,W as f,X as x,Y as y,Z as p,_ as u,$ as _,a0 as j,a1 as g,a2 as k,a3 as w}from"./index-smzK0Z-Y.js";import{u as S,A as v,R as N,a as C,C as I}from"./useMarimoWebSocket-RLB8CYwc.js";const T=r=>{const l=e(14),{appConfig:c}=r,{setCells:m}=t();let d,h,b;l[0]===Symbol.for("react.memo_cache_sentinel")?(d=[],l[0]=d):d=l[0],o.useEffect(W,d),l[1]===Symbol.for("react.memo_cache_sentinel")?(h=i(),l[1]=h):h=l[1],l[2]!==m?(b={autoInstantiate:!0,setCells:m,sessionId:h},l[2]=m,l[3]=b):b=l[3];const{connection:f}=S(b),x=s(a);let y,p,u;return l[4]!==f?(y=n.jsx(C,{connection:f,className:"sm:pt-8"}),l[4]=f,l[5]=y):y=l[5],l[6]!==c?(p=n.jsx(I,{appConfig:c,mode:"read"}),l[6]=c,l[7]=p):p=l[7],l[8]!==f.state||l[9]!==x||l[10]!==c.width||l[11]!==y||l[12]!==p?(u=n.jsxs(v,{connectionState:f.state,isRunning:x,width:c.width,children:[y,p]}),l[8]=f.state,l[9]=x,l[10]=c.width,l[11]=y,l[12]=p,l[13]=u):u=l[13],u};function A(){N.INSTANCE.stop()}function W(){return N.INSTANCE.start(r),A}const D=()=>{const t=e(4);if(!l())return null;let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=c(),t[0]=o):o=t[0];const s=o;if(!s)return null;let a,r,i;return t[1]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx("a",{href:"https://github.com/marimo-team/marimo",target:"_blank",className:"underline",rel:"noreferrer",children:"marimo"}),t[1]=a):a=t[1],t[2]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsxs("span",{children:["This is a static Python notebook built using"," ",a,".",n.jsx("br",{}),"Some interactive features may not work, see ways to run or edit this."]}),t[2]=r):r=t[2],t[3]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsxs("div",{className:"px-4 py-2 bg-[var(--sky-2)] border-b border-[var(--sky-7)] text-md text-[var(--sky-11)] font-semibold flex justify-between items-center gap-4 no-print",children:[r,n.jsx("span",{className:"flex-shrink-0",children:n.jsx(E,{code:s})})]}),t[3]=i):i=t[3],i},E=t=>{const o=e(81),{code:s}=t;let a;if(o[0]===Symbol.for("react.memo_cache_sentinel")){a=m()||"notebook.py";const e=a.lastIndexOf("/");-1!==e&&(a=a.slice(e+1)),o[0]=a}else a=o[0];const r=window.location.href;let i,l,c,S,v,N,C,I,T,A,W,D,E,F,P,R,M,O,Y,B,G,H,J,K,Q,U,V,X,Z,$,q,z,L,ee,te,oe,se;if(o[1]!==s){const e=d({code:s});let t;H=h,o[25]===Symbol.for("react.memo_cache_sentinel")?(J=n.jsx(b,{asChild:!0,children:n.jsx(f,{"data-testid":"static-notebook-dialog-trigger",variant:"secondary",children:"Run or edit this notebook"})}),o[25]=J):J=o[25],G=x,Y=y,o[26]===Symbol.for("react.memo_cache_sentinel")?(B=n.jsx(p,{children:a}),o[26]=B):B=o[26],N=u,C="pt-4 text-md text-left",I="This is a static notebook built using",T=" ",o[27]===Symbol.for("react.memo_cache_sentinel")?(A=n.jsx("a",{href:"https://github.com/marimo-team/marimo",target:"_blank",className:"text-link hover:underline",rel:"noreferrer",children:"marimo"}),o[27]=A):A=o[27],W=". marimo is an open-source next-generation Python notebook.",o[28]===Symbol.for("react.memo_cache_sentinel")?(D=n.jsx("hr",{className:"my-3"}),o[28]=D):D=o[28],E="In order to edit this notebook, you will need to download the code locally, install marimo, and run the following in your terminal:",o[29]===Symbol.for("react.memo_cache_sentinel")?(t=n.jsx("br",{}),o[29]=t):t=o[29],o[30]===Symbol.for("react.memo_cache_sentinel")?(F=n.jsxs("div",{className:"font-mono text-sm bg-[var(--sky-2)] rounded-md my-3 p-2 border border-[var(--sky-7)]",children:["pip install marimo",t,"marimo edit ",a]}),P=!r.endsWith(".html")&&n.jsxs(n.Fragment,{children:["or",n.jsxs("div",{className:"font-mono text-sm bg-[var(--sky-2)] rounded-md my-3 p-2 border border-[var(--sky-7)] break-all",children:["marimo edit ",window.location.href]})]}),R=n.jsx("hr",{className:"my-3"}),o[30]=F,o[31]=P,o[32]=R):(F=o[30],P=o[31],R=o[32]),M="You may also be able to run this notebook entirely in the browser via WebAssembly at:",O=" ",i=e,l="_blank",c="text-link hover:underline",S="noreferrer",v=e.slice(0,40),o[1]=s,o[2]=i,o[3]=l,o[4]=c,o[5]=S,o[6]=v,o[7]=N,o[8]=C,o[9]=I,o[10]=T,o[11]=A,o[12]=W,o[13]=D,o[14]=E,o[15]=F,o[16]=P,o[17]=R,o[18]=M,o[19]=O,o[20]=Y,o[21]=B,o[22]=G,o[23]=H,o[24]=J}else i=o[2],l=o[3],c=o[4],S=o[5],v=o[6],N=o[7],C=o[8],I=o[9],T=o[10],A=o[11],W=o[12],D=o[13],E=o[14],F=o[15],P=o[16],R=o[17],M=o[18],O=o[19],Y=o[20],B=o[21],G=o[22],H=o[23],J=o[24];return o[33]!==i||o[34]!==l||o[35]!==c||o[36]!==S||o[37]!==v?(K=n.jsxs("a",{href:i,target:l,className:c,rel:S,children:[v,"..."]}),o[33]=i,o[34]=l,o[35]=c,o[36]=S,o[37]=v,o[38]=K):K=o[38],o[39]===Symbol.for("react.memo_cache_sentinel")?(Q=n.jsx("br",{}),o[39]=Q):Q=o[39],o[40]===Symbol.for("react.memo_cache_sentinel")?(U=n.jsxs("div",{className:"text-sm text-muted-foreground pt-2",children:[n.jsx("strong",{children:"Note:"})," This feature is experimental and may not work for all notebooks. Additionally, some dependencies may not be available in the browser."]}),o[40]=U):U=o[40],o[41]!==N||o[42]!==C||o[43]!==I||o[44]!==T||o[45]!==A||o[46]!==W||o[47]!==D||o[48]!==E||o[49]!==F||o[50]!==P||o[51]!==R||o[52]!==M||o[53]!==O||o[54]!==K?(V=n.jsxs(N,{className:C,children:[I,T,A,W,D,E,F,P,R,M,O,K,Q,U]}),o[41]=N,o[42]=C,o[43]=I,o[44]=T,o[45]=A,o[46]=W,o[47]=D,o[48]=E,o[49]=F,o[50]=P,o[51]=R,o[52]=M,o[53]=O,o[54]=K,o[55]=V):V=o[55],o[56]!==Y||o[57]!==B||o[58]!==V?(X=n.jsxs(Y,{children:[B,V]}),o[56]=Y,o[57]=B,o[58]=V,o[59]=X):X=o[59],o[60]!==s?(Z=async()=>{await _(s),j({title:"Copied to clipboard"})},o[60]=s,o[61]=Z):Z=o[61],o[62]===Symbol.for("react.memo_cache_sentinel")?($=n.jsx(g,{className:"w-4 h-4 mr-1"}),o[62]=$):$=o[62],o[63]!==Z?(q=n.jsxs(f,{"data-testid":"copy-static-notebook-dialog-button",variant:"secondary",onClick:Z,children:[$,"Copy code"]}),o[63]=Z,o[64]=q):q=o[64],o[65]!==s?(z=()=>{k(new Blob([s],{type:"text/plain"}),a)},o[65]=s,o[66]=z):z=o[66],o[67]===Symbol.for("react.memo_cache_sentinel")?(L=n.jsx(w,{className:"w-4 h-4 mr-1"}),o[67]=L):L=o[67],o[68]!==z?(ee=n.jsxs(f,{"data-testid":"download-static-notebook-dialog-button",variant:"secondary",onClick:z,children:[L,"Download code"]}),o[68]=z,o[69]=ee):ee=o[69],o[70]!==q||o[71]!==ee?(te=n.jsxs("div",{className:"flex gap-4 flex-wrap",children:[q,ee]}),o[70]=q,o[71]=ee,o[72]=te):te=o[72],o[73]!==G||o[74]!==X||o[75]!==te?(oe=n.jsxs(G,{children:[X,te]}),o[73]=G,o[74]=X,o[75]=te,o[76]=oe):oe=o[76],o[77]!==H||o[78]!==J||o[79]!==oe?(se=n.jsxs(H,{children:[J,oe]}),o[77]=H,o[78]=J,o[79]=oe,o[80]=se):se=o[80],se},F=t=>{const o=e(3);let s,a;return o[0]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx(D,{}),o[0]=s):s=o[0],o[1]!==t.appConfig?(a=n.jsxs(n.Fragment,{children:[s,n.jsx(T,{appConfig:t.appConfig})]}),o[1]=t.appConfig,o[2]=a):a=o[2],a};export{F as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
!function(){"use strict";var e,t,n;(t=e||(e={})).assertEqual=e=>e,t.assertIs=function(e){},t.assertNever=function(e){throw new Error},t.arrayToEnum=e=>{const t={};for(const n of e)t[n]=n;return t},t.getValidEnumValues=e=>{const n=t.objectKeys(e).filter((t=>"number"!=typeof e[e[t]])),s={};for(const t of n)s[t]=e[t];return t.objectValues(s)},t.objectValues=e=>t.objectKeys(e).map((function(t){return e[t]})),t.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},t.find=(e,t)=>{for(const n of e)if(t(n))return n},t.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&isFinite(e)&&Math.floor(e)===e,t.joinValues=function(e,t=" | "){return e.map((e=>"string"==typeof e?`'${e}'`:e)).join(t)},t.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t,(n||(n={})).mergeShapes=(e,t)=>({...e,...t});const s=e.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),a=e=>{switch(typeof e){case"undefined":return s.undefined;case"string":return s.string;case"number":return isNaN(e)?s.nan:s.number;case"boolean":return s.boolean;case"function":return s.function;case"bigint":return s.bigint;case"symbol":return s.symbol;case"object":return Array.isArray(e)?s.array:null===e?s.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?s.promise:"undefined"!=typeof Map&&e instanceof Map?s.map:"undefined"!=typeof Set&&e instanceof Set?s.set:"undefined"!=typeof Date&&e instanceof Date?s.date:s.object;default:return s.unknown}},r=e.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class i extends Error{constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const t=e||function(e){return e.message},n={_errors:[]},s=e=>{for(const a of e.issues)if("invalid_union"===a.code)a.unionErrors.map(s);else if("invalid_return_type"===a.code)s(a.returnTypeError);else if("invalid_arguments"===a.code)s(a.argumentsError);else if(0===a.path.length)n._errors.push(t(a));else{let e=n,s=0;for(;s<a.path.length;){const n=a.path[s];s===a.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(a))):e[n]=e[n]||{_errors:[]},e=e[n],s++}}};return s(this),n}static assert(e){if(!(e instanceof i))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,e.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=e=>e.message){const t={},n=[];for(const s of this.issues)s.path.length>0?(t[s.path[0]]=t[s.path[0]]||[],t[s.path[0]].push(e(s))):n.push(e(s));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}}i.create=e=>new i(e);const o=(t,n)=>{let a;switch(t.code){case r.invalid_type:a=t.received===s.undefined?"Required":`Expected ${t.expected}, received ${t.received}`;break;case r.invalid_literal:a=`Invalid literal value, expected ${JSON.stringify(t.expected,e.jsonStringifyReplacer)}`;break;case r.unrecognized_keys:a=`Unrecognized key(s) in object: ${e.joinValues(t.keys,", ")}`;break;case r.invalid_union:a="Invalid input";break;case r.invalid_union_discriminator:a=`Invalid discriminator value. Expected ${e.joinValues(t.options)}`;break;case r.invalid_enum_value:a=`Invalid enum value. Expected ${e.joinValues(t.options)}, received '${t.received}'`;break;case r.invalid_arguments:a="Invalid function arguments";break;case r.invalid_return_type:a="Invalid function return type";break;case r.invalid_date:a="Invalid date";break;case r.invalid_string:"object"==typeof t.validation?"includes"in t.validation?(a=`Invalid input: must include "${t.validation.includes}"`,"number"==typeof t.validation.position&&(a=`${a} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?a=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?a=`Invalid input: must end with "${t.validation.endsWith}"`:e.assertNever(t.validation):a="regex"!==t.validation?`Invalid ${t.validation}`:"Invalid";break;case r.too_small:a="array"===t.type?`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:"string"===t.type?`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:"number"===t.type?`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:"date"===t.type?`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:"Invalid input";break;case r.too_big:a="array"===t.type?`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:"string"===t.type?`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:"number"===t.type?`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:"bigint"===t.type?`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:"date"===t.type?`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:"Invalid input";break;case r.custom:a="Invalid input";break;case r.invalid_intersection_types:a="Intersection results could not be merged";break;case r.not_multiple_of:a=`Number must be a multiple of ${t.multipleOf}`;break;case r.not_finite:a="Number must be finite";break;default:a=n.defaultError,e.assertNever(t)}return{message:a}};let d=o;function c(){return d}const u=e=>{const{data:t,path:n,errorMaps:s,issueData:a}=e,r=[...n,...a.path||[]],i={...a,path:r};if(void 0!==a.message)return{...a,path:r,message:a.message};let o="";const d=s.filter((e=>!!e)).slice().reverse();for(const c of d)o=c(i,{data:t,defaultError:o}).message;return{...a,path:r,message:o}};function l(e,t){const n=c(),s=u({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===o?void 0:o].filter((e=>!!e))});e.common.issues.push(s)}class p{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){const n=[];for(const s of t){if("aborted"===s.status)return h;"dirty"===s.status&&e.dirty(),n.push(s.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){const n=[];for(const s of t){const e=await s.key,t=await s.value;n.push({key:e,value:t})}return p.mergeObjectSync(e,n)}static mergeObjectSync(e,t){const n={};for(const s of t){const{key:t,value:a}=s;if("aborted"===t.status)return h;if("aborted"===a.status)return h;"dirty"===t.status&&e.dirty(),"dirty"===a.status&&e.dirty(),"__proto__"===t.value||void 0===a.value&&!s.alwaysSet||(n[t.value]=a.value)}return{status:e.value,value:n}}}const h=Object.freeze({status:"aborted"}),m=e=>({status:"dirty",value:e}),f=e=>({status:"valid",value:e}),y=e=>"aborted"===e.status,g=e=>"dirty"===e.status,_=e=>"valid"===e.status,v=e=>"undefined"!=typeof Promise&&e instanceof Promise;function k(e,t,n,s){if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t.get(e)}function w(e,t,n,s,a){if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,n),n}var b,x,Z,T;"function"==typeof SuppressedError&&SuppressedError,(x=b||(b={})).errToObj=e=>"string"==typeof e?{message:e}:e||{},x.toString=e=>"string"==typeof e?e:null==e?void 0:e.message;class S{constructor(e,t,n,s){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=s}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const O=(e,t)=>{if(_(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new i(e.common.issues);return this._error=t,this._error}}};function C(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:s,description:a}=e;if(t&&(n||s))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');if(t)return{errorMap:t,description:a};return{errorMap:(t,a)=>{var r,i;const{message:o}=e;return"invalid_enum_value"===t.code?{message:null!=o?o:a.defaultError}:void 0===a.data?{message:null!==(r=null!=o?o:s)&&void 0!==r?r:a.defaultError}:"invalid_type"!==t.code?{message:a.defaultError}:{message:null!==(i=null!=o?o:n)&&void 0!==i?i:a.defaultError}},description:a}}class N{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return a(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:a(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new p,ctx:{common:e.parent.common,data:e.data,parsedType:a(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(v(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){var n;const s={common:{issues:[],async:null!==(n=null==t?void 0:t.async)&&void 0!==n&&n,contextualErrorMap:null==t?void 0:t.errorMap},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:a(e)},r=this._parseSync({data:e,path:s.path,parent:s});return O(s,r)}async parseAsync(e,t){const n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){const n={common:{issues:[],contextualErrorMap:null==t?void 0:t.errorMap,async:!0},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:a(e)},s=this._parse({data:e,path:n.path,parent:n}),r=await(v(s)?s:Promise.resolve(s));return O(n,r)}refine(e,t){const n=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement(((t,s)=>{const a=e(t),i=()=>s.addIssue({code:r.custom,...n(t)});return"undefined"!=typeof Promise&&a instanceof Promise?a.then((e=>!!e||(i(),!1))):!!a||(i(),!1)}))}refinement(e,t){return this._refinement(((n,s)=>!!e(n)||(s.addIssue("function"==typeof t?t(n,s):t),!1)))}_refinement(e){return new xe({schema:this,typeName:Re.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Ze.create(this,this._def)}nullable(){return Te.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ae.create(this,this._def)}promise(){return be.create(this,this._def)}or(e){return oe.create([this,e],this._def)}and(e){return le.create(this,e,this._def)}transform(e){return new xe({...C(this._def),schema:this,typeName:Re.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new Se({...C(this._def),innerType:this,defaultValue:t,typeName:Re.ZodDefault})}brand(){return new Pe({typeName:Re.ZodBranded,type:this,...C(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new Oe({...C(this._def),innerType:this,catchValue:t,typeName:Re.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return je.create(this,e)}readonly(){return Ee.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const P=/^c[^\s-]{8,}$/i,j=/^[0-9a-z]+$/,E=/^[0-9A-HJKMNP-TV-Z]{26}$/,I=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,$=/^[a-z0-9_-]{21}$/i,R=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,A=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let M;const D=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,L=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,q=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,z="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",V=new RegExp(`^${z}$`);function F(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`),t}function U(e){let t=`${z}T${F(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}class K extends N{_parse(t){this._def.coerce&&(t.data=String(t.data));if(this._getType(t)!==s.string){const e=this._getOrReturnCtx(t);return l(e,{code:r.invalid_type,expected:s.string,received:e.parsedType}),h}const n=new p;let a;for(const s of this._def.checks)if("min"===s.kind)t.data.length<s.value&&(a=this._getOrReturnCtx(t,a),l(a,{code:r.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if("max"===s.kind)t.data.length>s.value&&(a=this._getOrReturnCtx(t,a),l(a,{code:r.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if("length"===s.kind){const e=t.data.length>s.value,i=t.data.length<s.value;(e||i)&&(a=this._getOrReturnCtx(t,a),e?l(a,{code:r.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):i&&l(a,{code:r.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),n.dirty())}else if("email"===s.kind)A.test(t.data)||(a=this._getOrReturnCtx(t,a),l(a,{validation:"email",code:r.invalid_string,message:s.message}),n.dirty());else if("emoji"===s.kind)M||(M=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),M.test(t.data)||(a=this._getOrReturnCtx(t,a),l(a,{validation:"emoji",code:r.invalid_string,message:s.message}),n.dirty());else if("uuid"===s.kind)I.test(t.data)||(a=this._getOrReturnCtx(t,a),l(a,{validation:"uuid",code:r.invalid_string,message:s.message}),n.dirty());else if("nanoid"===s.kind)$.test(t.data)||(a=this._getOrReturnCtx(t,a),l(a,{validation:"nanoid",code:r.invalid_string,message:s.message}),n.dirty());else if("cuid"===s.kind)P.test(t.data)||(a=this._getOrReturnCtx(t,a),l(a,{validation:"cuid",code:r.invalid_string,message:s.message}),n.dirty());else if("cuid2"===s.kind)j.test(t.data)||(a=this._getOrReturnCtx(t,a),l(a,{validation:"cuid2",code:r.invalid_string,message:s.message}),n.dirty());else if("ulid"===s.kind)E.test(t.data)||(a=this._getOrReturnCtx(t,a),l(a,{validation:"ulid",code:r.invalid_string,message:s.message}),n.dirty());else if("url"===s.kind)try{new URL(t.data)}catch(d){a=this._getOrReturnCtx(t,a),l(a,{validation:"url",code:r.invalid_string,message:s.message}),n.dirty()}else if("regex"===s.kind){s.regex.lastIndex=0;s.regex.test(t.data)||(a=this._getOrReturnCtx(t,a),l(a,{validation:"regex",code:r.invalid_string,message:s.message}),n.dirty())}else if("trim"===s.kind)t.data=t.data.trim();else if("includes"===s.kind)t.data.includes(s.value,s.position)||(a=this._getOrReturnCtx(t,a),l(a,{code:r.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),n.dirty());else if("toLowerCase"===s.kind)t.data=t.data.toLowerCase();else if("toUpperCase"===s.kind)t.data=t.data.toUpperCase();else if("startsWith"===s.kind)t.data.startsWith(s.value)||(a=this._getOrReturnCtx(t,a),l(a,{code:r.invalid_string,validation:{startsWith:s.value},message:s.message}),n.dirty());else if("endsWith"===s.kind)t.data.endsWith(s.value)||(a=this._getOrReturnCtx(t,a),l(a,{code:r.invalid_string,validation:{endsWith:s.value},message:s.message}),n.dirty());else if("datetime"===s.kind){U(s).test(t.data)||(a=this._getOrReturnCtx(t,a),l(a,{code:r.invalid_string,validation:"datetime",message:s.message}),n.dirty())}else if("date"===s.kind){V.test(t.data)||(a=this._getOrReturnCtx(t,a),l(a,{code:r.invalid_string,validation:"date",message:s.message}),n.dirty())}else if("time"===s.kind){new RegExp(`^${F(s)}$`).test(t.data)||(a=this._getOrReturnCtx(t,a),l(a,{code:r.invalid_string,validation:"time",message:s.message}),n.dirty())}else"duration"===s.kind?R.test(t.data)||(a=this._getOrReturnCtx(t,a),l(a,{validation:"duration",code:r.invalid_string,message:s.message}),n.dirty()):"ip"===s.kind?(i=t.data,("v4"!==(o=s.version)&&o||!D.test(i))&&("v6"!==o&&o||!L.test(i))&&(a=this._getOrReturnCtx(t,a),l(a,{validation:"ip",code:r.invalid_string,message:s.message}),n.dirty())):"base64"===s.kind?q.test(t.data)||(a=this._getOrReturnCtx(t,a),l(a,{validation:"base64",code:r.invalid_string,message:s.message}),n.dirty()):e.assertNever(s);var i,o;return{status:n.value,value:t.data}}_regex(e,t,n){return this.refinement((t=>e.test(t)),{validation:t,code:r.invalid_string,...b.errToObj(n)})}_addCheck(e){return new K({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...b.errToObj(e)})}url(e){return this._addCheck({kind:"url",...b.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...b.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...b.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...b.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...b.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...b.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...b.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...b.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...b.errToObj(e)})}datetime(e){var t,n;return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,offset:null!==(t=null==e?void 0:e.offset)&&void 0!==t&&t,local:null!==(n=null==e?void 0:e.local)&&void 0!==n&&n,...b.errToObj(null==e?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return"string"==typeof e?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,...b.errToObj(null==e?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...b.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...b.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:null==t?void 0:t.position,...b.errToObj(null==t?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...b.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...b.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...b.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...b.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...b.errToObj(t)})}nonempty(e){return this.min(1,b.errToObj(e))}trim(){return new K({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new K({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new K({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((e=>"datetime"===e.kind))}get isDate(){return!!this._def.checks.find((e=>"date"===e.kind))}get isTime(){return!!this._def.checks.find((e=>"time"===e.kind))}get isDuration(){return!!this._def.checks.find((e=>"duration"===e.kind))}get isEmail(){return!!this._def.checks.find((e=>"email"===e.kind))}get isURL(){return!!this._def.checks.find((e=>"url"===e.kind))}get isEmoji(){return!!this._def.checks.find((e=>"emoji"===e.kind))}get isUUID(){return!!this._def.checks.find((e=>"uuid"===e.kind))}get isNANOID(){return!!this._def.checks.find((e=>"nanoid"===e.kind))}get isCUID(){return!!this._def.checks.find((e=>"cuid"===e.kind))}get isCUID2(){return!!this._def.checks.find((e=>"cuid2"===e.kind))}get isULID(){return!!this._def.checks.find((e=>"ulid"===e.kind))}get isIP(){return!!this._def.checks.find((e=>"ip"===e.kind))}get isBase64(){return!!this._def.checks.find((e=>"base64"===e.kind))}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}function B(e,t){const n=(e.toString().split(".")[1]||"").length,s=(t.toString().split(".")[1]||"").length,a=n>s?n:s;return parseInt(e.toFixed(a).replace(".",""))%parseInt(t.toFixed(a).replace(".",""))/Math.pow(10,a)}K.create=e=>{var t;return new K({checks:[],typeName:Re.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...C(e)})};class W extends N{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){this._def.coerce&&(t.data=Number(t.data));if(this._getType(t)!==s.number){const e=this._getOrReturnCtx(t);return l(e,{code:r.invalid_type,expected:s.number,received:e.parsedType}),h}let n;const a=new p;for(const s of this._def.checks)if("int"===s.kind)e.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),l(n,{code:r.invalid_type,expected:"integer",received:"float",message:s.message}),a.dirty());else if("min"===s.kind){(s.inclusive?t.data<s.value:t.data<=s.value)&&(n=this._getOrReturnCtx(t,n),l(n,{code:r.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),a.dirty())}else if("max"===s.kind){(s.inclusive?t.data>s.value:t.data>=s.value)&&(n=this._getOrReturnCtx(t,n),l(n,{code:r.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),a.dirty())}else"multipleOf"===s.kind?0!==B(t.data,s.value)&&(n=this._getOrReturnCtx(t,n),l(n,{code:r.not_multiple_of,multipleOf:s.value,message:s.message}),a.dirty()):"finite"===s.kind?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),l(n,{code:r.not_finite,message:s.message}),a.dirty()):e.assertNever(s);return{status:a.value,value:t.data}}gte(e,t){return this.setLimit("min",e,!0,b.toString(t))}gt(e,t){return this.setLimit("min",e,!1,b.toString(t))}lte(e,t){return this.setLimit("max",e,!0,b.toString(t))}lt(e,t){return this.setLimit("max",e,!1,b.toString(t))}setLimit(e,t,n,s){return new W({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:b.toString(s)}]})}_addCheck(e){return new W({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:b.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:b.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:b.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:b.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:b.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:b.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:b.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:b.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:b.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find((t=>"int"===t.kind||"multipleOf"===t.kind&&e.isInteger(t.value)))}get isFinite(){let e=null,t=null;for(const n of this._def.checks){if("finite"===n.kind||"int"===n.kind||"multipleOf"===n.kind)return!0;"min"===n.kind?(null===t||n.value>t)&&(t=n.value):"max"===n.kind&&(null===e||n.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}}W.create=e=>new W({checks:[],typeName:Re.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...C(e)});class H extends N{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){this._def.coerce&&(t.data=BigInt(t.data));if(this._getType(t)!==s.bigint){const e=this._getOrReturnCtx(t);return l(e,{code:r.invalid_type,expected:s.bigint,received:e.parsedType}),h}let n;const a=new p;for(const s of this._def.checks)if("min"===s.kind){(s.inclusive?t.data<s.value:t.data<=s.value)&&(n=this._getOrReturnCtx(t,n),l(n,{code:r.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),a.dirty())}else if("max"===s.kind){(s.inclusive?t.data>s.value:t.data>=s.value)&&(n=this._getOrReturnCtx(t,n),l(n,{code:r.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),a.dirty())}else"multipleOf"===s.kind?t.data%s.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),l(n,{code:r.not_multiple_of,multipleOf:s.value,message:s.message}),a.dirty()):e.assertNever(s);return{status:a.value,value:t.data}}gte(e,t){return this.setLimit("min",e,!0,b.toString(t))}gt(e,t){return this.setLimit("min",e,!1,b.toString(t))}lte(e,t){return this.setLimit("max",e,!0,b.toString(t))}lt(e,t){return this.setLimit("max",e,!1,b.toString(t))}setLimit(e,t,n,s){return new H({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:b.toString(s)}]})}_addCheck(e){return new H({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:b.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:b.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:b.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:b.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:b.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}H.create=e=>{var t;return new H({checks:[],typeName:Re.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...C(e)})};class J extends N{_parse(e){this._def.coerce&&(e.data=Boolean(e.data));if(this._getType(e)!==s.boolean){const t=this._getOrReturnCtx(e);return l(t,{code:r.invalid_type,expected:s.boolean,received:t.parsedType}),h}return f(e.data)}}J.create=e=>new J({typeName:Re.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...C(e)});class Y extends N{_parse(t){this._def.coerce&&(t.data=new Date(t.data));if(this._getType(t)!==s.date){const e=this._getOrReturnCtx(t);return l(e,{code:r.invalid_type,expected:s.date,received:e.parsedType}),h}if(isNaN(t.data.getTime())){return l(this._getOrReturnCtx(t),{code:r.invalid_date}),h}const n=new p;let a;for(const s of this._def.checks)"min"===s.kind?t.data.getTime()<s.value&&(a=this._getOrReturnCtx(t,a),l(a,{code:r.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),n.dirty()):"max"===s.kind?t.data.getTime()>s.value&&(a=this._getOrReturnCtx(t,a),l(a,{code:r.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),n.dirty()):e.assertNever(s);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(e){return new Y({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:b.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:b.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}Y.create=e=>new Y({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:Re.ZodDate,...C(e)});class G extends N{_parse(e){if(this._getType(e)!==s.symbol){const t=this._getOrReturnCtx(e);return l(t,{code:r.invalid_type,expected:s.symbol,received:t.parsedType}),h}return f(e.data)}}G.create=e=>new G({typeName:Re.ZodSymbol,...C(e)});class X extends N{_parse(e){if(this._getType(e)!==s.undefined){const t=this._getOrReturnCtx(e);return l(t,{code:r.invalid_type,expected:s.undefined,received:t.parsedType}),h}return f(e.data)}}X.create=e=>new X({typeName:Re.ZodUndefined,...C(e)});class Q extends N{_parse(e){if(this._getType(e)!==s.null){const t=this._getOrReturnCtx(e);return l(t,{code:r.invalid_type,expected:s.null,received:t.parsedType}),h}return f(e.data)}}Q.create=e=>new Q({typeName:Re.ZodNull,...C(e)});class ee extends N{constructor(){super(...arguments),this._any=!0}_parse(e){return f(e.data)}}ee.create=e=>new ee({typeName:Re.ZodAny,...C(e)});class te extends N{constructor(){super(...arguments),this._unknown=!0}_parse(e){return f(e.data)}}te.create=e=>new te({typeName:Re.ZodUnknown,...C(e)});class ne extends N{_parse(e){const t=this._getOrReturnCtx(e);return l(t,{code:r.invalid_type,expected:s.never,received:t.parsedType}),h}}ne.create=e=>new ne({typeName:Re.ZodNever,...C(e)});class se extends N{_parse(e){if(this._getType(e)!==s.undefined){const t=this._getOrReturnCtx(e);return l(t,{code:r.invalid_type,expected:s.void,received:t.parsedType}),h}return f(e.data)}}se.create=e=>new se({typeName:Re.ZodVoid,...C(e)});class ae extends N{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),a=this._def;if(t.parsedType!==s.array)return l(t,{code:r.invalid_type,expected:s.array,received:t.parsedType}),h;if(null!==a.exactLength){const e=t.data.length>a.exactLength.value,s=t.data.length<a.exactLength.value;(e||s)&&(l(t,{code:e?r.too_big:r.too_small,minimum:s?a.exactLength.value:void 0,maximum:e?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),n.dirty())}if(null!==a.minLength&&t.data.length<a.minLength.value&&(l(t,{code:r.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),n.dirty()),null!==a.maxLength&&t.data.length>a.maxLength.value&&(l(t,{code:r.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map(((e,n)=>a.type._parseAsync(new S(t,e,t.path,n))))).then((e=>p.mergeArray(n,e)));const i=[...t.data].map(((e,n)=>a.type._parseSync(new S(t,e,t.path,n))));return p.mergeArray(n,i)}get element(){return this._def.type}min(e,t){return new ae({...this._def,minLength:{value:e,message:b.toString(t)}})}max(e,t){return new ae({...this._def,maxLength:{value:e,message:b.toString(t)}})}length(e,t){return new ae({...this._def,exactLength:{value:e,message:b.toString(t)}})}nonempty(e){return this.min(1,e)}}function re(e){if(e instanceof ie){const t={};for(const n in e.shape){const s=e.shape[n];t[n]=Ze.create(re(s))}return new ie({...e._def,shape:()=>t})}return e instanceof ae?new ae({...e._def,type:re(e.element)}):e instanceof Ze?Ze.create(re(e.unwrap())):e instanceof Te?Te.create(re(e.unwrap())):e instanceof pe?pe.create(e.items.map((e=>re(e)))):e}ae.create=(e,t)=>new ae({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Re.ZodArray,...C(t)});class ie extends N{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const t=this._def.shape(),n=e.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(e){if(this._getType(e)!==s.object){const t=this._getOrReturnCtx(e);return l(t,{code:r.invalid_type,expected:s.object,received:t.parsedType}),h}const{status:t,ctx:n}=this._processInputParams(e),{shape:a,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof ne&&"strip"===this._def.unknownKeys))for(const s in n.data)i.includes(s)||o.push(s);const d=[];for(const s of i){const e=a[s],t=n.data[s];d.push({key:{status:"valid",value:s},value:e._parse(new S(n,t,n.path,s)),alwaysSet:s in n.data})}if(this._def.catchall instanceof ne){const e=this._def.unknownKeys;if("passthrough"===e)for(const t of o)d.push({key:{status:"valid",value:t},value:{status:"valid",value:n.data[t]}});else if("strict"===e)o.length>0&&(l(n,{code:r.unrecognized_keys,keys:o}),t.dirty());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of o){const s=n.data[t];d.push({key:{status:"valid",value:t},value:e._parse(new S(n,s,n.path,t)),alwaysSet:t in n.data})}}return n.common.async?Promise.resolve().then((async()=>{const e=[];for(const t of d){const n=await t.key,s=await t.value;e.push({key:n,value:s,alwaysSet:t.alwaysSet})}return e})).then((e=>p.mergeObjectSync(t,e))):p.mergeObjectSync(t,d)}get shape(){return this._def.shape()}strict(e){return b.errToObj,new ie({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,n)=>{var s,a,r,i;const o=null!==(r=null===(a=(s=this._def).errorMap)||void 0===a?void 0:a.call(s,t,n).message)&&void 0!==r?r:n.defaultError;return"unrecognized_keys"===t.code?{message:null!==(i=b.errToObj(e).message)&&void 0!==i?i:o}:{message:o}}}:{}})}strip(){return new ie({...this._def,unknownKeys:"strip"})}passthrough(){return new ie({...this._def,unknownKeys:"passthrough"})}extend(e){return new ie({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new ie({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Re.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new ie({...this._def,catchall:e})}pick(t){const n={};return e.objectKeys(t).forEach((e=>{t[e]&&this.shape[e]&&(n[e]=this.shape[e])})),new ie({...this._def,shape:()=>n})}omit(t){const n={};return e.objectKeys(this.shape).forEach((e=>{t[e]||(n[e]=this.shape[e])})),new ie({...this._def,shape:()=>n})}deepPartial(){return re(this)}partial(t){const n={};return e.objectKeys(this.shape).forEach((e=>{const s=this.shape[e];t&&!t[e]?n[e]=s:n[e]=s.optional()})),new ie({...this._def,shape:()=>n})}required(t){const n={};return e.objectKeys(this.shape).forEach((e=>{if(t&&!t[e])n[e]=this.shape[e];else{let t=this.shape[e];for(;t instanceof Ze;)t=t._def.innerType;n[e]=t}})),new ie({...this._def,shape:()=>n})}keyof(){return ve(e.objectKeys(this.shape))}}ie.create=(e,t)=>new ie({shape:()=>e,unknownKeys:"strip",catchall:ne.create(),typeName:Re.ZodObject,...C(t)}),ie.strictCreate=(e,t)=>new ie({shape:()=>e,unknownKeys:"strict",catchall:ne.create(),typeName:Re.ZodObject,...C(t)}),ie.lazycreate=(e,t)=>new ie({shape:e,unknownKeys:"strip",catchall:ne.create(),typeName:Re.ZodObject,...C(t)});class oe extends N{_parse(e){const{ctx:t}=this._processInputParams(e),n=this._def.options;if(t.common.async)return Promise.all(n.map((async e=>{const n={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:n}),ctx:n}}))).then((function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const s of e)if("dirty"===s.result.status)return t.common.issues.push(...s.ctx.common.issues),s.result;const n=e.map((e=>new i(e.ctx.common.issues)));return l(t,{code:r.invalid_union,unionErrors:n}),h}));{let e;const s=[];for(const r of n){const n={...t,common:{...t.common,issues:[]},parent:null},a=r._parseSync({data:t.data,path:t.path,parent:n});if("valid"===a.status)return a;"dirty"!==a.status||e||(e={result:a,ctx:n}),n.common.issues.length&&s.push(n.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const a=s.map((e=>new i(e)));return l(t,{code:r.invalid_union,unionErrors:a}),h}}get options(){return this._def.options}}oe.create=(e,t)=>new oe({options:e,typeName:Re.ZodUnion,...C(t)});const de=t=>t instanceof ge?de(t.schema):t instanceof xe?de(t.innerType()):t instanceof _e?[t.value]:t instanceof ke?t.options:t instanceof we?e.objectValues(t.enum):t instanceof Se?de(t._def.innerType):t instanceof X?[void 0]:t instanceof Q?[null]:t instanceof Ze?[void 0,...de(t.unwrap())]:t instanceof Te?[null,...de(t.unwrap())]:t instanceof Pe||t instanceof Ee?de(t.unwrap()):t instanceof Oe?de(t._def.innerType):[];class ce extends N{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==s.object)return l(t,{code:r.invalid_type,expected:s.object,received:t.parsedType}),h;const n=this.discriminator,a=t.data[n],i=this.optionsMap.get(a);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):(l(t,{code:r.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),h)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,n){const s=new Map;for(const a of t){const t=de(a.shape[e]);if(!t.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const n of t){if(s.has(n))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(n)}`);s.set(n,a)}}return new ce({typeName:Re.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:s,...C(n)})}}function ue(t,n){const r=a(t),i=a(n);if(t===n)return{valid:!0,data:t};if(r===s.object&&i===s.object){const s=e.objectKeys(n),a=e.objectKeys(t).filter((e=>-1!==s.indexOf(e))),r={...t,...n};for(const e of a){const s=ue(t[e],n[e]);if(!s.valid)return{valid:!1};r[e]=s.data}return{valid:!0,data:r}}if(r===s.array&&i===s.array){if(t.length!==n.length)return{valid:!1};const e=[];for(let s=0;s<t.length;s++){const a=ue(t[s],n[s]);if(!a.valid)return{valid:!1};e.push(a.data)}return{valid:!0,data:e}}return r===s.date&&i===s.date&&+t==+n?{valid:!0,data:t}:{valid:!1}}class le extends N{_parse(e){const{status:t,ctx:n}=this._processInputParams(e),s=(e,s)=>{if(y(e)||y(s))return h;const a=ue(e.value,s.value);return a.valid?((g(e)||g(s))&&t.dirty(),{status:t.value,value:a.data}):(l(n,{code:r.invalid_intersection_types}),h)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then((([e,t])=>s(e,t))):s(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}le.create=(e,t,n)=>new le({left:e,right:t,typeName:Re.ZodIntersection,...C(n)});class pe extends N{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==s.array)return l(n,{code:r.invalid_type,expected:s.array,received:n.parsedType}),h;if(n.data.length<this._def.items.length)return l(n,{code:r.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),h;!this._def.rest&&n.data.length>this._def.items.length&&(l(n,{code:r.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const a=[...n.data].map(((e,t)=>{const s=this._def.items[t]||this._def.rest;return s?s._parse(new S(n,e,n.path,t)):null})).filter((e=>!!e));return n.common.async?Promise.all(a).then((e=>p.mergeArray(t,e))):p.mergeArray(t,a)}get items(){return this._def.items}rest(e){return new pe({...this._def,rest:e})}}pe.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new pe({items:e,typeName:Re.ZodTuple,rest:null,...C(t)})};class he extends N{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==s.object)return l(n,{code:r.invalid_type,expected:s.object,received:n.parsedType}),h;const a=[],i=this._def.keyType,o=this._def.valueType;for(const s in n.data)a.push({key:i._parse(new S(n,s,n.path,s)),value:o._parse(new S(n,n.data[s],n.path,s)),alwaysSet:s in n.data});return n.common.async?p.mergeObjectAsync(t,a):p.mergeObjectSync(t,a)}get element(){return this._def.valueType}static create(e,t,n){return new he(t instanceof N?{keyType:e,valueType:t,typeName:Re.ZodRecord,...C(n)}:{keyType:K.create(),valueType:e,typeName:Re.ZodRecord,...C(t)})}}class me extends N{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==s.map)return l(n,{code:r.invalid_type,expected:s.map,received:n.parsedType}),h;const a=this._def.keyType,i=this._def.valueType,o=[...n.data.entries()].map((([e,t],s)=>({key:a._parse(new S(n,e,n.path,[s,"key"])),value:i._parse(new S(n,t,n.path,[s,"value"]))})));if(n.common.async){const e=new Map;return Promise.resolve().then((async()=>{for(const n of o){const s=await n.key,a=await n.value;if("aborted"===s.status||"aborted"===a.status)return h;"dirty"!==s.status&&"dirty"!==a.status||t.dirty(),e.set(s.value,a.value)}return{status:t.value,value:e}}))}{const e=new Map;for(const n of o){const s=n.key,a=n.value;if("aborted"===s.status||"aborted"===a.status)return h;"dirty"!==s.status&&"dirty"!==a.status||t.dirty(),e.set(s.value,a.value)}return{status:t.value,value:e}}}}me.create=(e,t,n)=>new me({valueType:t,keyType:e,typeName:Re.ZodMap,...C(n)});class fe extends N{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==s.set)return l(n,{code:r.invalid_type,expected:s.set,received:n.parsedType}),h;const a=this._def;null!==a.minSize&&n.data.size<a.minSize.value&&(l(n,{code:r.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),t.dirty()),null!==a.maxSize&&n.data.size>a.maxSize.value&&(l(n,{code:r.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),t.dirty());const i=this._def.valueType;function o(e){const n=new Set;for(const s of e){if("aborted"===s.status)return h;"dirty"===s.status&&t.dirty(),n.add(s.value)}return{status:t.value,value:n}}const d=[...n.data.values()].map(((e,t)=>i._parse(new S(n,e,n.path,t))));return n.common.async?Promise.all(d).then((e=>o(e))):o(d)}min(e,t){return new fe({...this._def,minSize:{value:e,message:b.toString(t)}})}max(e,t){return new fe({...this._def,maxSize:{value:e,message:b.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}fe.create=(e,t)=>new fe({valueType:e,minSize:null,maxSize:null,typeName:Re.ZodSet,...C(t)});class ye extends N{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==s.function)return l(t,{code:r.invalid_type,expected:s.function,received:t.parsedType}),h;function n(e,n){return u({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,c(),o].filter((e=>!!e)),issueData:{code:r.invalid_arguments,argumentsError:n}})}function a(e,n){return u({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,c(),o].filter((e=>!!e)),issueData:{code:r.invalid_return_type,returnTypeError:n}})}const d={errorMap:t.common.contextualErrorMap},p=t.data;if(this._def.returns instanceof be){const e=this;return f((async function(...t){const s=new i([]),r=await e._def.args.parseAsync(t,d).catch((e=>{throw s.addIssue(n(t,e)),s})),o=await Reflect.apply(p,this,r);return await e._def.returns._def.type.parseAsync(o,d).catch((e=>{throw s.addIssue(a(o,e)),s}))}))}{const e=this;return f((function(...t){const s=e._def.args.safeParse(t,d);if(!s.success)throw new i([n(t,s.error)]);const r=Reflect.apply(p,this,s.data),o=e._def.returns.safeParse(r,d);if(!o.success)throw new i([a(r,o.error)]);return o.data}))}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new ye({...this._def,args:pe.create(e).rest(te.create())})}returns(e){return new ye({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new ye({args:e||pe.create([]).rest(te.create()),returns:t||te.create(),typeName:Re.ZodFunction,...C(n)})}}class ge extends N{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}ge.create=(e,t)=>new ge({getter:e,typeName:Re.ZodLazy,...C(t)});class _e extends N{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return l(t,{received:t.data,code:r.invalid_literal,expected:this._def.value}),h}return{status:"valid",value:e.data}}get value(){return this._def.value}}function ve(e,t){return new ke({values:e,typeName:Re.ZodEnum,...C(t)})}_e.create=(e,t)=>new _e({value:e,typeName:Re.ZodLiteral,...C(t)});class ke extends N{constructor(){super(...arguments),Z.set(this,void 0)}_parse(t){if("string"!=typeof t.data){const n=this._getOrReturnCtx(t),s=this._def.values;return l(n,{expected:e.joinValues(s),received:n.parsedType,code:r.invalid_type}),h}if(k(this,Z)||w(this,Z,new Set(this._def.values)),!k(this,Z).has(t.data)){const e=this._getOrReturnCtx(t),n=this._def.values;return l(e,{received:e.data,code:r.invalid_enum_value,options:n}),h}return f(t.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return ke.create(e,{...this._def,...t})}exclude(e,t=this._def){return ke.create(this.options.filter((t=>!e.includes(t))),{...this._def,...t})}}Z=new WeakMap,ke.create=ve;class we extends N{constructor(){super(...arguments),T.set(this,void 0)}_parse(t){const n=e.getValidEnumValues(this._def.values),a=this._getOrReturnCtx(t);if(a.parsedType!==s.string&&a.parsedType!==s.number){const t=e.objectValues(n);return l(a,{expected:e.joinValues(t),received:a.parsedType,code:r.invalid_type}),h}if(k(this,T)||w(this,T,new Set(e.getValidEnumValues(this._def.values))),!k(this,T).has(t.data)){const t=e.objectValues(n);return l(a,{received:a.data,code:r.invalid_enum_value,options:t}),h}return f(t.data)}get enum(){return this._def.values}}T=new WeakMap,we.create=(e,t)=>new we({values:e,typeName:Re.ZodNativeEnum,...C(t)});class be extends N{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==s.promise&&!1===t.common.async)return l(t,{code:r.invalid_type,expected:s.promise,received:t.parsedType}),h;const n=t.parsedType===s.promise?t.data:Promise.resolve(t.data);return f(n.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}be.create=(e,t)=>new be({type:e,typeName:Re.ZodPromise,...C(t)});class xe extends N{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Re.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:s}=this._processInputParams(t),a=this._def.effect||null,r={addIssue:e=>{l(s,e),e.fatal?n.abort():n.dirty()},get path(){return s.path}};if(r.addIssue=r.addIssue.bind(r),"preprocess"===a.type){const e=a.transform(s.data,r);if(s.common.async)return Promise.resolve(e).then((async e=>{if("aborted"===n.value)return h;const t=await this._def.schema._parseAsync({data:e,path:s.path,parent:s});return"aborted"===t.status?h:"dirty"===t.status||"dirty"===n.value?m(t.value):t}));{if("aborted"===n.value)return h;const t=this._def.schema._parseSync({data:e,path:s.path,parent:s});return"aborted"===t.status?h:"dirty"===t.status||"dirty"===n.value?m(t.value):t}}if("refinement"===a.type){const e=e=>{const t=a.refinement(e,r);if(s.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===s.common.async){const t=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});return"aborted"===t.status?h:("dirty"===t.status&&n.dirty(),e(t.value),{status:n.value,value:t.value})}return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then((t=>"aborted"===t.status?h:("dirty"===t.status&&n.dirty(),e(t.value).then((()=>({status:n.value,value:t.value}))))))}if("transform"===a.type){if(!1===s.common.async){const e=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});if(!_(e))return e;const t=a.transform(e.value,r);if(t instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:t}}return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then((e=>_(e)?Promise.resolve(a.transform(e.value,r)).then((e=>({status:n.value,value:e}))):e))}e.assertNever(a)}}xe.create=(e,t,n)=>new xe({schema:e,typeName:Re.ZodEffects,effect:t,...C(n)}),xe.createWithPreprocess=(e,t,n)=>new xe({schema:t,effect:{type:"preprocess",transform:e},typeName:Re.ZodEffects,...C(n)});class Ze extends N{_parse(e){return this._getType(e)===s.undefined?f(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Ze.create=(e,t)=>new Ze({innerType:e,typeName:Re.ZodOptional,...C(t)});class Te extends N{_parse(e){return this._getType(e)===s.null?f(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Te.create=(e,t)=>new Te({innerType:e,typeName:Re.ZodNullable,...C(t)});class Se extends N{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===s.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}Se.create=(e,t)=>new Se({innerType:e,typeName:Re.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...C(t)});class Oe extends N{_parse(e){const{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},s=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return v(s)?s.then((e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new i(n.common.issues)},input:n.data})}))):{status:"valid",value:"valid"===s.status?s.value:this._def.catchValue({get error(){return new i(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}Oe.create=(e,t)=>new Oe({innerType:e,typeName:Re.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...C(t)});class Ce extends N{_parse(e){if(this._getType(e)!==s.nan){const t=this._getOrReturnCtx(e);return l(t,{code:r.invalid_type,expected:s.nan,received:t.parsedType}),h}return{status:"valid",value:e.data}}}Ce.create=e=>new Ce({typeName:Re.ZodNaN,...C(e)});const Ne=Symbol("zod_brand");class Pe extends N{_parse(e){const{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}}class je extends N{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.common.async){return(async()=>{const e=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return"aborted"===e.status?h:"dirty"===e.status?(t.dirty(),m(e.value)):this._def.out._parseAsync({data:e.value,path:n.path,parent:n})})()}{const e=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===e.status?h:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:n.path,parent:n})}}static create(e,t){return new je({in:e,out:t,typeName:Re.ZodPipeline})}}class Ee extends N{_parse(e){const t=this._def.innerType._parse(e),n=e=>(_(e)&&(e.value=Object.freeze(e.value)),e);return v(t)?t.then((e=>n(e))):n(t)}unwrap(){return this._def.innerType}}function Ie(e,t={},n){return e?ee.create().superRefine(((s,a)=>{var r,i;if(!e(s)){const e="function"==typeof t?t(s):"string"==typeof t?{message:t}:t,o=null===(i=null!==(r=e.fatal)&&void 0!==r?r:n)||void 0===i||i,d="string"==typeof e?{message:e}:e;a.addIssue({code:"custom",...d,fatal:o})}})):ee.create()}Ee.create=(e,t)=>new Ee({innerType:e,typeName:Re.ZodReadonly,...C(t)});const $e={object:ie.lazycreate};var Re,Ae;(Ae=Re||(Re={})).ZodString="ZodString",Ae.ZodNumber="ZodNumber",Ae.ZodNaN="ZodNaN",Ae.ZodBigInt="ZodBigInt",Ae.ZodBoolean="ZodBoolean",Ae.ZodDate="ZodDate",Ae.ZodSymbol="ZodSymbol",Ae.ZodUndefined="ZodUndefined",Ae.ZodNull="ZodNull",Ae.ZodAny="ZodAny",Ae.ZodUnknown="ZodUnknown",Ae.ZodNever="ZodNever",Ae.ZodVoid="ZodVoid",Ae.ZodArray="ZodArray",Ae.ZodObject="ZodObject",Ae.ZodUnion="ZodUnion",Ae.ZodDiscriminatedUnion="ZodDiscriminatedUnion",Ae.ZodIntersection="ZodIntersection",Ae.ZodTuple="ZodTuple",Ae.ZodRecord="ZodRecord",Ae.ZodMap="ZodMap",Ae.ZodSet="ZodSet",Ae.ZodFunction="ZodFunction",Ae.ZodLazy="ZodLazy",Ae.ZodLiteral="ZodLiteral",Ae.ZodEnum="ZodEnum",Ae.ZodEffects="ZodEffects",Ae.ZodNativeEnum="ZodNativeEnum",Ae.ZodOptional="ZodOptional",Ae.ZodNullable="ZodNullable",Ae.ZodDefault="ZodDefault",Ae.ZodCatch="ZodCatch",Ae.ZodPromise="ZodPromise",Ae.ZodBranded="ZodBranded",Ae.ZodPipeline="ZodPipeline",Ae.ZodReadonly="ZodReadonly";const Me=K.create,De=W.create,Le=Ce.create,qe=H.create,ze=J.create,Ve=Y.create,Fe=G.create,Ue=X.create,Ke=Q.create,Be=ee.create,We=te.create,He=ne.create,Je=se.create,Ye=ae.create,Ge=ie.create,Xe=ie.strictCreate,Qe=oe.create,et=ce.create,tt=le.create,nt=pe.create,st=he.create,at=me.create,rt=fe.create,it=ye.create,ot=ge.create,dt=_e.create,ct=ke.create,ut=we.create,lt=be.create,pt=xe.create,ht=Ze.create,mt=Te.create,ft=xe.createWithPreprocess,yt=je.create,gt={string:e=>K.create({...e,coerce:!0}),number:e=>W.create({...e,coerce:!0}),boolean:e=>J.create({...e,coerce:!0}),bigint:e=>H.create({...e,coerce:!0}),date:e=>Y.create({...e,coerce:!0})},_t=h;var vt=Object.freeze({__proto__:null,defaultErrorMap:o,setErrorMap:function(e){d=e},getErrorMap:c,makeIssue:u,EMPTY_PATH:[],addIssueToContext:l,ParseStatus:p,INVALID:h,DIRTY:m,OK:f,isAborted:y,isDirty:g,isValid:_,isAsync:v,get util(){return e},get objectUtil(){return n},ZodParsedType:s,getParsedType:a,ZodType:N,datetimeRegex:U,ZodString:K,ZodNumber:W,ZodBigInt:H,ZodBoolean:J,ZodDate:Y,ZodSymbol:G,ZodUndefined:X,ZodNull:Q,ZodAny:ee,ZodUnknown:te,ZodNever:ne,ZodVoid:se,ZodArray:ae,ZodObject:ie,ZodUnion:oe,ZodDiscriminatedUnion:ce,ZodIntersection:le,ZodTuple:pe,ZodRecord:he,ZodMap:me,ZodSet:fe,ZodFunction:ye,ZodLazy:ge,ZodLiteral:_e,ZodEnum:ke,ZodNativeEnum:we,ZodPromise:be,ZodEffects:xe,ZodTransformer:xe,ZodOptional:Ze,ZodNullable:Te,ZodDefault:Se,ZodCatch:Oe,ZodNaN:Ce,BRAND:Ne,ZodBranded:Pe,ZodPipeline:je,ZodReadonly:Ee,custom:Ie,Schema:N,ZodSchema:N,late:$e,get ZodFirstPartyTypeKind(){return Re},coerce:gt,any:Be,array:Ye,bigint:qe,boolean:ze,date:Ve,discriminatedUnion:et,effect:pt,enum:ct,function:it,instanceof:(e,t={message:`Input not instance of ${e.name}`})=>Ie((t=>t instanceof e),t),intersection:tt,lazy:ot,literal:dt,map:at,nan:Le,nativeEnum:ut,never:He,null:Ke,nullable:mt,number:De,object:Ge,oboolean:()=>ze().optional(),onumber:()=>De().optional(),optional:ht,ostring:()=>Me().optional(),pipeline:yt,preprocess:ft,promise:lt,record:st,set:rt,strictObject:Xe,string:Me,symbol:Fe,transformer:pt,tuple:nt,undefined:Ue,union:Qe,unknown:We,void:Je,NEVER:_t,ZodIssueCode:r,quotelessJson:e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),ZodError:i});const kt=vt.object({detail:vt.string()});function wt(e){if(!e)return"Unknown error";if(e instanceof Error){const t=kt.safeParse(e.cause);return t.success?t.data.detail:function(e){const t=function(e){try{return JSON.parse(e)}catch{return e}}(e);if(!t)return e;const n=kt.safeParse(t);if(n.success)return n.data.detail;return e}(e.message)}if("object"==typeof e){const t=kt.safeParse(e);return t.success?t.data.detail:JSON.stringify(e)}try{return JSON.stringify(e)}catch{return String(e)}}const bt=1e3;function xt(e,t){const n=e.map((e=>`"${e}"`)).join(", ");return new Error(`This RPC instance cannot ${t} because the transport did not provide one or more of these methods: ${n}`)}function Zt(e={}){let t={};function n(e){t=e}let s,a={};function r(e){var t;a.unregisterHandler&&a.unregisterHandler(),a=e,null==(t=a.registerHandler)||t.call(a,v)}function i(e){s="function"!=typeof e?(t,n)=>{const s=e[t];if(s)return s(n);const a=e._;if(!a)throw new Error(`The requested method has no handler: ${t}`);return a(t,n)}:e}const{maxRequestTime:o=bt}=e;e.transport&&r(e.transport),e.requestHandler&&i(e.requestHandler),e._debugHooks&&n(e._debugHooks);let d=0;const c=new Map,u=new Map;function l(e,...n){const s=n[0];return new Promise(((n,r)=>{var i;if(!a.send)throw xt(["send"],"make requests");const l=d<=1e10?++d:d=0,p={type:"request",id:l,method:e,params:s};c.set(l,{resolve:n,reject:r}),o!==1/0&&u.set(l,setTimeout((()=>{u.delete(l),r(new Error("RPC request timed out."))}),o)),null==(i=t.onSend)||i.call(t,p),a.send(p)}))}const p=new Proxy(l,{get:(e,t,n)=>t in e?Reflect.get(e,t,n):e=>l(t,e)}),h=p;function m(e,...n){var s;const r=n[0];if(!a.send)throw xt(["send"],"send messages");const i={type:"message",id:e,payload:r};null==(s=t.onSend)||s.call(t,i),a.send(i)}const f=new Proxy(m,{get:(e,t,n)=>t in e?Reflect.get(e,t,n):e=>m(t,e)}),y=f,g=new Map,_=new Set;async function v(e){var n,r;if(null==(n=t.onReceive)||n.call(t,e),!("type"in e))throw new Error("Message does not contain a type.");if("request"===e.type){if(!a.send||!s)throw xt(["send","requestHandler"],"handle requests");const{id:n,method:o,params:d}=e;let c;try{c={type:"response",id:n,success:!0,payload:await s(o,d)}}catch(i){if(!(i instanceof Error))throw i;c={type:"response",id:n,success:!1,error:i.message}}return null==(r=t.onSend)||r.call(t,c),void a.send(c)}if("response"!==e.type){if("message"!==e.type)throw new Error(`Unexpected RPC message type: ${e.type}`);{for(const n of _)n(e.id,e.payload);const t=g.get(e.id);if(!t)return;for(const n of t)n(e.payload)}}else{const t=u.get(e.id);null!=t&&clearTimeout(t);const{resolve:n,reject:s}=c.get(e.id)??{};e.success?null==n||n(e.payload):null==s||s(new Error(e.error))}}return{setTransport:r,setRequestHandler:i,request:p,requestProxy:h,send:f,sendProxy:y,addMessageListener:function(e,t){var n;if(!a.registerHandler)throw xt(["registerHandler"],"register message listeners");"*"!==e?(g.has(e)||g.set(e,new Set),null==(n=g.get(e))||n.add(t)):_.add(t)},removeMessageListener:function(e,t){var n,s;"*"!==e?(null==(n=g.get(e))||n.delete(t),0===(null==(s=g.get(e))?void 0:s.size)&&g.delete(e)):_.delete(t)},proxy:{send:y,request:h},_setDebugHooks:n}}const Tt="[transport-id]";function St(e,t={}){const{transportId:n,filter:s,remotePort:a}=t,r=e,i=a??e;let o;return{send(e){i.postMessage(function(e,t){const{transportId:n}=t;return null!=n?{[Tt]:n,data:e}:e}(e,{transportId:n}))},registerHandler(e){o=t=>{const a=t.data,[r,i]=function(e,t){const{transportId:n,filter:s}=t,a=null==s?void 0:s();if(null!=n&&null!=a)throw new Error("Cannot use both `transportId` and `filter` at the same time");let r=e;if(n){if(e[Tt]!==n)return[!0];r=e.data}return!1===a?[!0]:[!1,r]}(a,{transportId:n,filter:()=>null==s?void 0:s(t)});r||e(i)},r.addEventListener("message",o)},unregisterHandler(){o&&r.removeEventListener("message",o)}}}const Ot={debug:(...e)=>{},log:(...e)=>{console.log(...e)},warn:(...e)=>{console.warn(...e)},error:(...e)=>{console.error(...e)},trace:(...e)=>{console.trace(...e)}};const Ct="undefined"!=typeof window&&window.Logger||Ot;function Nt(e){return e.FS}const Pt="notebook.py",jt="/marimo",Et=Pt,It=e=>{const t=Nt(e);try{t.mkdir(jt)}catch{}t.chdir(jt)},$t=e=>{Nt(e).mount(e.FS.filesystems.IDBFS,{root:"."},jt)},Rt=async e=>{await Lt(e,!0)},At=async e=>{await Lt(e,!1)},Mt=e=>{const t=Nt(e),n=`${jt}/${Pt}`;return t.readFile(n,{encoding:"utf8"})},Dt=e=>{const{pyodide:t,filename:n,code:s}=e,a=Nt(t);if(n&&n!==Pt){const e=(e=>{try{return a.readFile(e,{encoding:"utf8"})}catch{return null}})(n);if(e)return{code:e,filename:n}}return a.writeFile(Pt,s),{code:s,filename:Pt}};function Lt(e,t){return new Promise(((n,s)=>{Nt(e).syncfs(t,(e=>{e?s(e):n()}))}))}function qt(e){return e?"local"===e?"http://localhost:8000/dist/marimo-latest-py3-none-any.whl":"latest"===e?"marimo-base":`marimo-base==${e}`:"marimo-base>=0.9.0"}const zt=new class{constructor(){this.spans=[]}startSpan(e,t={}){const n={name:e,startTime:Date.now(),attributes:t,end:(e="ok")=>this.endSpan(n,e)};return this.spans.push(n),n}endSpan(e,t="ok"){e.endTime=Date.now(),e.status=t}getSpans(){return this.spans}wrap(e,t,n={}){const s=this.startSpan(t||e.name,n);try{const t=e();return this.endSpan(s),t}catch(a){throw this.endSpan(s,"error"),a}}wrapAsync(e,t,n={}){return async(...s)=>{const a=this.startSpan(t||e.name,n);try{const t=await e(...s);return this.endSpan(a),t}catch(r){throw this.endSpan(a,"error"),r}}}logSpans(){}};globalThis.t=zt;class Vt{constructor(){this.pyodide=null}get requirePyodide(){return function(e,t){if(!e)throw new Error(t)}(this.pyodide,"Pyodide not loaded"),this.pyodide}async bootstrap(e){const t=await this.loadPyodideAndPackages(e.pyodideVersion),{version:n}=e;return n.includes("dev")?(await this.installDevMarimoAndDeps(t,n),t):(await this.installMarimoAndDeps(t,n),t)}async loadPyodideAndPackages(e){if(!loadPyodide)throw new Error("loadPyodide is not defined");const t=zt.startSpan("loadPyodide"),n=await loadPyodide({packages:["micropip"],indexURL:`https://cdn.jsdelivr.net/pyodide/${e}/full/`});return this.pyodide=n,t.end("ok"),n}async installDevMarimoAndDeps(e,t){const n=zt.startSpan("installDevMarimoAndDeps");await Promise.all([e.runPythonAsync(`\n import micropip\n await micropip.install(\n [\n "${qt(t)}",\n ],\n deps=False,\n index_urls="https://test.pypi.org/pypi/{package_name}/json"\n );\n `),e.runPythonAsync('\n import micropip\n await micropip.install(\n [\n "Markdown==3.6",\n "pymdown-extensions==10.8.1",\n "narwhals==1.9.2",\n ],\n deps=False,\n );\n ')]),n.end("ok")}async installMarimoAndDeps(e,t){const n=zt.startSpan("installMarimoAndDeps");await e.runPythonAsync(`\n import micropip\n await micropip.install(\n [\n "${qt(t)}",\n "Markdown==3.6",\n "pymdown-extensions==10.8.1",\n "narwhals==1.9.2",\n ],\n deps=False,\n );\n `),n.end("ok")}async mountFilesystem(e){const t=zt.startSpan("mountFilesystem");return It(this.requirePyodide),$t(this.requirePyodide),await Rt(this.requirePyodide),t.end("ok"),Dt({pyodide:this.requirePyodide,code:e.code,filename:e.filename})}async startSession(e){const{code:t,filename:n,onMessage:s,queryParameters:a,userConfig:r}=e;self.messenger={callback:s},self.query_params=a,self.user_config=r;const i=zt.startSpan("startSession.runPython"),o=n||Et,[d,c,u]=this.requirePyodide.runPython(`\n print("[py] Starting marimo...")\n import asyncio\n import js\n from marimo._pyodide.bootstrap import create_session, instantiate\n\n assert js.messenger, "messenger is not defined"\n assert js.query_params, "query_params is not defined"\n\n session, bridge = create_session(\n filename="${o}",\n query_params=js.query_params.to_py(),\n message_callback=js.messenger.callback,\n user_config=js.user_config.to_py(),\n )\n\n def init(auto_instantiate=True):\n if auto_instantiate:\n instantiate(session)\n asyncio.create_task(session.start())\n\n # Find the packages to install\n with open("${o}", "r") as f:\n packages = session.find_packages(f.read())\n\n bridge, init, packages`);i.end();const l=new Set(u.toJs());return this.loadNotebookDeps(t,l).then((()=>c(r.runtime.auto_instantiate))),d}async loadNotebookDeps(e,t){const n=this.requirePyodide;e.includes("mo.sql")&&(e=`import duckdb\n${e=`import pandas\n${e}`}`),e=`import pyodide_http\n${e=`import jedi\n${e=`import pygments\n${e=`import docutils\n${e}`}`}`}`;const s=[...t];let a=zt.startSpan("pyodide.loadPackage");await n.loadPackagesFromImports(e,{errorCallback:Ct.error,messageCallback:Ct.log}),a.end(),a=zt.startSpan("micropip.install");const r=s.filter((e=>!n.loadedPackages[e]));r.length>0&&await n.runPythonAsync(`\n import micropip\n import sys\n # Filter out builtins\n missing = [p for p in ${JSON.stringify(r)} if p not in sys.modules]\n print("Loaded from micropip:", missing)\n await micropip.install(missing)\n `).catch((e=>{Ct.error("Failed to load packages from micropip",e)})),a.end()}}const Ft=async function(){var e;try{const t=self.name,n=function(e){return e.includes("dev"),"v0.26.2"}(t);await async function(e){return e.includes("dev"),await import("https://cdn.jsdelivr.net/pyodide/v0.26.2/full/pyodide.js")}(t);const s=await async function(e){try{return await import(`/wasm/controller.js?version=${e}`)}catch{return new Vt}}(t);self.controller=s,self.pyodide=await s.bootstrap({version:t,pyodideVersion:n}),await(null==(e=s.mountFilesystem)?void 0:e.call(s,{code:"",filename:null})),Kt.send.initialized({})}catch(t){Ct.error("Error bootstrapping",t),Kt.send.initializedError({error:wt(t)})}}(),Ut={readFile:async e=>{await Ft;return self.pyodide.FS.readFile(e,{encoding:"utf8"})},readNotebook:async()=>(await Ft,Mt(self.pyodide)),saveNotebook:async e=>{await Ft;const t=self.pyodide.runPython("\n from marimo._pyodide.bootstrap import save_file\n\n save_file\n ");await t(JSON.stringify(e),Et),await At(self.pyodide)}},Kt=function(e){return Zt(e)}({transport:(Bt={transportId:"marimo-transport"},St(self,Bt)),requestHandler:Ut});var Bt;Kt.send("ready",{})}();
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{s as r,a as s,c as t,b as a}from"./chunk-5RIWM3LS-DS12e7Ja.js";import{_ as e}from"./mermaid-CrKddFRb.js";import"./transform-CaCRavvA.js";import"./chunk-4LC2V6XN-D4kCS8j6.js";import"./index-smzK0Z-Y.js";import"./step-CNn2V7Th.js";import"./timer-CK-RIWfW.js";var o={parser:r,db:s,renderer:t,styles:a,init:e((r=>{r.state||(r.state={}),r.state.arrowMarkerAbsolute=r.arrowMarkerAbsolute,s.clear()}),"init")};export{o as diagram};
|