@marimo-team/frontend 0.19.5-dev4 → 0.19.5-dev7
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.
|
@@ -40,4 +40,4 @@ ${a}
|
|
|
40
40
|
- less than the value passed to \`max\` (or ${lu} if no \`max\` prop is set)
|
|
41
41
|
- \`null\` or \`undefined\` if the progress is indeterminate.
|
|
42
42
|
|
|
43
|
-
Defaulting to \`null\`.`}var y1=p1,z5=f1,O5=J(),b1=x.forwardRef((t,e)=>{let a=(0,O5.c)(13),r,n,i;a[0]===t?(r=a[1],n=a[2],i=a[3]):({className:r,value:i,...n}=t,a[0]=t,a[1]=r,a[2]=n,a[3]=i);let l;a[4]===r?l=a[5]:(l=U("relative h-2 w-full overflow-hidden rounded-full bg-primary/20",r),a[4]=r,a[5]=l);let o=`translateX(-${100-(i||0)}%)`,d;a[6]===o?d=a[7]:(d=(0,s.jsx)(z5,{className:"h-full w-full flex-1 bg-primary transition-all pulse",style:{transform:o}}),a[6]=o,a[7]=d);let u;return a[8]!==n||a[9]!==e||a[10]!==l||a[11]!==d?(u=(0,s.jsx)(y1,{ref:e,className:l,...n,children:d}),a[8]=n,a[9]=e,a[10]=l,a[11]=d,a[12]=u):u=a[12],u});b1.displayName=y1.displayName;var $5=J(),L5=class{constructor(){q(this,"tagName","marimo-progress");q(this,"validator",$({title:M().optional(),subtitle:M().optional(),progress:Se([Y(),W()]),total:Y().optional(),eta:Y().optional(),rate:Y().optional()}))}render(t){return(0,s.jsx)(B5,{...t.data})}};const B5=t=>{let e=(0,$5.c)(24),{title:a,subtitle:r,progress:n,total:i,eta:l,rate:o}=t,d=typeof n=="number"?"items-start":"items-center",u;e[0]!==n||e[1]!==i?(u=()=>typeof n=="number"&&i!=null&&i>0?(0,s.jsxs)("div",{className:"flex gap-3 text-sm text-muted-foreground items-baseline",children:[(0,s.jsx)(b1,{value:H5(n/i*100)}),(0,s.jsxs)("span",{className:"shrink-0",children:[n," / ",i]})]}):(0,s.jsx)($l,{className:"w-12 h-12 animate-spin text-primary mx-auto"}),e[0]=n,e[1]=i,e[2]=u):u=e[2];let c=u,p;e[3]!==l||e[4]!==n||e[5]!==o||e[6]!==i?(p=()=>{let j=typeof n=="number"&&i!=null&&n>=i,k=[];if(o&&(o<1?k.push((0,s.jsxs)("span",{children:[ou(1/o)," per iter"]},"rate")):k.push((0,s.jsxs)("span",{children:[o," iter/s"]},"rate")),k.push((0,s.jsx)("span",{children:"\xB7"},"spacer-rate"))),!j&&l&&k.push((0,s.jsxs)("span",{children:["ETA ",ou(l)]},"eta"),(0,s.jsx)("span",{children:"\xB7"},"spacer-eta")),j&&o){let N=n/o;k.push((0,s.jsxs)("span",{children:["Total time ",ou(N)]},"completed"),(0,s.jsx)("span",{children:"\xB7"},"spacer-completed"))}if(k.pop(),k.length>0)return(0,s.jsx)("div",{className:"flex gap-2 text-muted-foreground text-sm",children:k})},e[3]=l,e[4]=n,e[5]=o,e[6]=i,e[7]=p):p=e[7];let m=p,h=`flex flex-col ${d} max-w-sm p-6 mx-auto`,f;e[8]===a?f=e[9]:(f=a&&(0,s.jsx)("div",{className:"text-lg font-bold text-foreground/60",children:Me({html:a})}),e[8]=a,e[9]=f);let g;e[10]===r?g=e[11]:(g=r&&(0,s.jsx)("div",{className:"text-sm text-muted-foreground",children:Me({html:r})}),e[10]=r,e[11]=g);let v;e[12]===c?v=e[13]:(v=c(),e[12]=c,e[13]=v);let b;e[14]===m?b=e[15]:(b=m(),e[14]=m,e[15]=b);let w;e[16]!==v||e[17]!==b?(w=(0,s.jsxs)("div",{className:"mt-2 w-full flex flex-col gap-1",children:[v,b]}),e[16]=v,e[17]=b,e[18]=w):w=e[18];let D;return e[19]!==h||e[20]!==f||e[21]!==g||e[22]!==w?(D=(0,s.jsxs)("div",{className:h,children:[f,g,w]}),e[19]=h,e[20]=f,e[21]=g,e[22]=w,e[23]=D):D=e[23],D};function H5(t){return cT(t,0,100)}var W5=_5.default.humanizer({language:"shortEn",languages:{shortEn:{y:()=>"y",mo:()=>"mo",w:()=>"w",d:()=>"d",h:()=>"h",m:()=>"m",s:()=>"s",ms:()=>"ms"}}});function ou(t){return W5(t*1e3,{language:"shortEn",largest:2,spacer:"",maxDecimalPoints:t<10?2:0})}var U5=uu((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PathError=t.TokenData=void 0,t.match=c;var e="/",a=v=>v,r=/^[$_\p{ID_Start}]$/u,n=/^[$\u200c\u200d\p{ID_Continue}]$/u,i={"{":"{","}":"}","(":"(",")":")","[":"[","]":"]","+":"+","?":"?","!":"!"};function l(v){return v.replace(/[.+*?^${}()[\]|/\\]/g,"\\$&")}var o=class{constructor(v,b){this.tokens=v,this.originalPath=b}};t.TokenData=o;var d=class extends TypeError{constructor(v,b){let w=v;b&&(w+=`: ${b}`),w+="; visit https://git.new/pathToRegexpError for info",super(w),this.originalPath=b}};t.PathError=d;function u(v,b={}){let{encodePath:w=a}=b,D=[...v],j=[],k=0,N=0;function S(){let C="";if(r.test(D[k]))do C+=D[k++];while(n.test(D[k]));else if(D[k]==='"'){let _=k;for(;k++<D.length;){if(D[k]==='"'){k++,_=0;break}D[k]==="\\"&&k++,C+=D[k]}if(_)throw new d(`Unterminated quote at index ${_}`,v)}if(!C)throw new d(`Missing parameter name at index ${k}`,v);return C}for(;k<D.length;){let C=D[k],_=i[C];_?j.push({type:_,index:k++,value:C}):C==="\\"?j.push({type:"escape",index:k++,value:D[k++]}):C===":"?j.push({type:"param",index:k++,value:S()}):C==="*"?j.push({type:"wildcard",index:k++,value:S()}):j.push({type:"char",index:k++,value:C})}j.push({type:"end",index:k,value:""});function y(C){let _=[];for(;;){let E=j[N++];if(E.type===C)break;if(E.type==="char"||E.type==="escape"){let T=E.value,P=j[N];for(;P.type==="char"||P.type==="escape";)T+=P.value,P=j[++N];_.push({type:"text",value:w(T)});continue}if(E.type==="param"||E.type==="wildcard"){_.push({type:E.type,name:E.value});continue}if(E.type==="{"){_.push({type:"group",tokens:y("}")});continue}throw new d(`Unexpected ${E.type} at index ${E.index}, expected ${C}`,v)}return _}return new o(y("end"),v)}function c(v,b={}){let{decode:w=decodeURIComponent,delimiter:D=e}=b,{regexp:j,keys:k}=p(v,b),N=k.map(S=>w===!1?a:S.type==="param"?w:y=>y.split(D).map(w));return function(S){let y=j.exec(S);if(!y)return!1;let C=y[0],_=Object.create(null);for(let E=1;E<y.length;E++){if(y[E]===void 0)continue;let T=k[E-1],P=N[E-1];_[T.name]=P(y[E])}return{path:C,params:_}}}function p(v,b={}){let{delimiter:w=e,end:D=!0,sensitive:j=!1,trailing:k=!0}=b,N=[],S=j?"":"i",y=[];for(let _ of m(v,[])){let E=typeof _=="object"?_:u(_,b);for(let T of h(E.tokens,0,[]))y.push(f(T,w,N,E.originalPath))}let C=`^(?:${y.join("|")})`;return k&&(C+=`(?:${l(w)}$)?`),C+=D?"$":`(?=${l(w)}|$)`,{regexp:new RegExp(C,S),keys:N}}function m(v,b){if(Array.isArray(v))for(let w of v)m(w,b);else b.push(v);return b}function*h(v,b,w){if(b===v.length)return yield w;let D=v[b];if(D.type==="group")for(let j of h(D.tokens,0,w.slice()))yield*h(v,b+1,j);else w.push(D);yield*h(v,b+1,w)}function f(v,b,w,D){let j="",k="",N=!0;for(let S of v){if(S.type==="text"){j+=l(S.value),k+=S.value,N||(N=S.value.includes(b));continue}if(S.type==="param"||S.type==="wildcard"){if(!N&&!k)throw new d(`Missing text before "${S.name}" ${S.type}`,D);S.type==="param"?j+=`(${g(b,N?"":k)}+)`:j+="([\\s\\S]+)",w.push(S),k="",N=!1;continue}}return j}function g(v,b){return b.length<2?v.length<2?`[^${l(v+b)}]`:`(?:(?!${l(v)})[^${l(b)}])`:v.length<2?`(?:(?!${l(b)})[^${l(v)}])`:`(?:(?!${l(b)}|${l(v)})[\\s\\S])`}}))(),K5=class{constructor(t){this.routes=t.map(e=>({template:e,pathFunction:(0,U5.match)(e)}))}match(t){for(let{pathFunction:e,template:a}of this.routes){let r=e(t.hash)||e(t.pathname);if(r)return[r,a]}return!1}},Z5=J(),q5=class{constructor(){q(this,"tagName","marimo-routes");q(this,"validator",$({routes:ee(M())}))}render(t){return(0,s.jsx)(Y5,{...t.data,children:t.children})}},Y5=t=>{let e=(0,Z5.c)(14),{routes:a,children:r}=t,n=x.Children.count(r);if(n!==a.length)throw Error(`Expected ${a.length} children, but got ${n}`);let i;e[0]===a?i=e[1]:(i=new K5(a),e[0]=a,e[1]=i);let l=i,o;e[2]===l?o=e[3]:(o=()=>{let w=l.match(window.location);return w?w[1]:null},e[2]=l,e[3]=o);let[d,u]=(0,x.useState)(o),c;e[4]===l?c=e[5]:(c=w=>{let D=l.match(w);u(D?D[1]:null)},e[4]=l,e[5]=c);let p=Oe(c),m,h;if(e[6]===p?(m=e[7],h=e[8]):(m=()=>{let w=D=>{p(window.location)};return window.addEventListener("hashchange",w),window.addEventListener("popstate",w),()=>{window.removeEventListener("hashchange",w),window.removeEventListener("popstate",w)}},h=[p],e[6]=p,e[7]=m,e[8]=h),(0,x.useEffect)(m,h),!d){let w;return e[9]===Symbol.for("react.memo_cache_sentinel")?(w=(0,s.jsx)(s.Fragment,{}),e[9]=w):w=e[9],w}let f=a.indexOf(d),g;e[10]===r?g=e[11]:(g=x.Children.toArray(r),e[10]=r,e[11]=g);let v=g[f],b;return e[12]===v?b=e[13]:(b=(0,s.jsx)(s.Fragment,{children:v}),e[12]=v,e[13]=b),b},G5=J(),Q5=class{constructor(){q(this,"tagName","marimo-stat");q(this,"validator",$({value:Se([M(),Y(),W()]).optional(),label:M().optional(),caption:M().optional(),bordered:W().default(!1),direction:ye(["increase","decrease"]).optional(),target_direction:ye(["increase","decrease"]).default("increase"),slot:Ht().optional()}))}render({data:t}){return(0,s.jsx)(J5,{...t})}};const J5=t=>{let e=(0,G5.c)(31),{value:a,label:r,caption:n,bordered:i,direction:l,target_direction:o,slot:d}=t,{locale:u}=qe(),c;e[0]!==u||e[1]!==a?(c=()=>a==null?(0,s.jsx)("i",{children:"No value"}):typeof a=="string"?a:typeof a=="number"?TA(a,u):typeof a=="boolean"?a?"True":"False":String(a),e[0]=u,e[1]=a,e[2]=c):c=e[2];let p=c,m=l===o,h=m?"var(--grass-8)":"var(--red-8)",f=m?"var(--grass-9)":"var(--red-9)",g;e[3]===d?g=e[4]:(g=()=>{let E=W_(d);if(E!=null&&E[0]){let{mimetype:T,data:P}=E[0];return T!=="text/html"&&se.warn(`Expected text/html, got ${T}`),Me({html:P,alwaysSanitizeHtml:!0})}},e[3]=d,e[4]=g);let v=g,b=i&&"rounded-xl border shadow bg-card",w;e[5]===b?w=e[6]:(w=U("text-card-foreground p-6",b),e[5]=b,e[6]=w);let D;e[7]===r?D=e[8]:(D=r&&(0,s.jsx)("div",{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:(0,s.jsx)("h3",{className:"tracking-tight text-sm font-medium",children:r})}),e[7]=r,e[8]=D);let j;e[9]===p?j=e[10]:(j=p(),e[9]=p,e[10]=j);let k;e[11]===j?k=e[12]:(k=(0,s.jsx)("div",{className:"text-2xl font-bold",children:j}),e[11]=j,e[12]=k);let N;e[13]!==n||e[14]!==l||e[15]!==h||e[16]!==f?(N=n&&(0,s.jsxs)("p",{className:"pt-1 text-xs text-muted-foreground flex align-center whitespace-nowrap",children:[l==="increase"&&(0,s.jsx)(rc,{className:"w-4 h-4 mr-1 p-0.5",fill:h,stroke:f}),l==="decrease"&&(0,s.jsx)(rc,{className:"w-4 h-4 mr-1 p-0.5 transform rotate-180",fill:h,stroke:f}),n]}),e[13]=n,e[14]=l,e[15]=h,e[16]=f,e[17]=N):N=e[17];let S;e[18]!==k||e[19]!==N?(S=(0,s.jsxs)("div",{children:[k,N]}),e[18]=k,e[19]=N,e[20]=S):S=e[20];let y;e[21]!==v||e[22]!==d?(y=d&&(0,s.jsx)("div",{className:"[--slot:true]",children:v()}),e[21]=v,e[22]=d,e[23]=y):y=e[23];let C;e[24]!==y||e[25]!==S?(C=(0,s.jsxs)("div",{className:"pt-0 flex flex-row gap-3.5",children:[S,y]}),e[24]=y,e[25]=S,e[26]=C):C=e[26];let _;return e[27]!==C||e[28]!==w||e[29]!==D?(_=(0,s.jsxs)("div",{className:w,children:[D,C]}),e[27]=C,e[28]=w,e[29]=D,e[30]=_):_=e[30],_};var X5=J(),eE=class{constructor(){q(this,"tagName","marimo-tex");q(this,"validator",$({}))}render(t){return(0,s.jsx)(nE,{host:t.host,tex:t.host.textContent||t.host.innerHTML})}},tE=tv(async()=>(await vt(async()=>{let{default:t}=await import("./katex-D_p4uM5H.js").then(async e=>(await e.__tla,e));return{default:t}},__vite__mapDeps([379,152]),import.meta.url)).default),aE=tv(async()=>{await vt(()=>import("./mhchem-L2lUt6CA.js").then(async t=>(await t.__tla,t)),__vite__mapDeps([380,152]),import.meta.url)}),su={};async function rE(t,e){let[a]=await Promise.all([tE(),aE()]);e.startsWith("||(||(")&&e.endsWith("||)||)")?a.render(e.slice(6,-6),t,{displayMode:!0,globalGroup:!0,throwOnError:!1,macros:su}):e.startsWith("||(")&&e.endsWith("||)")?a.render(e.slice(3,-3),t,{displayMode:!1,globalGroup:!0,throwOnError:!1,macros:su}):e.startsWith("||[")&&e.endsWith("||]")&&a.render(e.slice(3,-3),t,{displayMode:!0,globalGroup:!0,throwOnError:!1,macros:su})}var nE=t=>{let e=(0,X5.c)(7),{host:a,tex:r}=t,n=(0,x.useRef)(null),[i,l]=(0,x.useState)(r),o,d;e[0]===a?(o=e[1],d=e[2]):(o=()=>{let m=new MutationObserver(()=>{l(a.textContent||a.innerHTML)});return m.observe(a,{childList:!0,characterData:!0,subtree:!0}),()=>{m.disconnect()}},d=[a],e[0]=a,e[1]=o,e[2]=d),(0,x.useLayoutEffect)(o,d);let u,c;e[3]===i?(u=e[4],c=e[5]):(u=()=>{n.current&&rE(n.current,i)},c=[i],e[3]=i,e[4]=u,e[5]=c),(0,x.useLayoutEffect)(u,c);let p;return e[6]===Symbol.for("react.memo_cache_sentinel")?(p=(0,s.jsx)("span",{ref:n}),e[6]=p):p=e[6],p};const iE=[new TD,new PD,wk,new Xk,new iS,new aS,new sS,new VD,new fS,new HS,$S,JS,new cN,new tC,new hN,new NN,new IN,new RN,new VN,new $N,new HN,new qN,new QN,new t5,new DN,KD,vS,VS,w5,f5,jD,aj,vN];var lE=[new r5,new o5,new p5,new v5,new y5,new j5,new C5,new iD,new E5,new L5,new q5,new Q5,new eE];function oE(){vD(),wD(),iE.forEach(n0),lE.forEach(n0)}async function sE(){if(typeof document>"u")return;let{onLCP:t,onINP:e,onCLS:a}=await vt(async()=>{let{onLCP:n,onINP:i,onCLS:l}=await import("./web-vitals-DATa1XxG.js").then(async o=>(await o.__tla,o));return{onLCP:n,onINP:i,onCLS:l}},[],import.meta.url);se.debug("Reporting vitals");let r=n=>{let i=n.rating==="good"?"green":n.rating==="needs-improvement"?"orange":"red";se.log(`%c [Metric ${n.name}] ${n.value}`,`background:${i}; color:white; padding:2px 0; border-radius:2px`)};a(r),e(r),t(r)}var dE=E1(),w1=!1;function uE(t,e){if(w1)return se.warn("marimo app has already been mounted."),Error("marimo app has already been mounted.");w1=!0;let a=(0,dE.createRoot)(e);try{UT(),oE(),N4(),Un()&&(F4(),z4(GE)),mE(t),a.render((0,s.jsx)(Tl,{store:ze,children:(0,s.jsx)(Lc,{children:(0,s.jsx)(jg,{})})}))}catch(r){return a.render((0,s.jsx)(Pl,{children:(0,s.jsx)(()=>{throw r},{})})),r}finally{sE()}}var du=zr({}).nullish().default({}).transform(t=>t||(typeof t=="string"?(se.warn("[marimo] received JSON string instead of object. Parsing..."),JSON.parse(t)):(se.warn("[marimo] missing config data"),{}))),cE=$({filename:M().nullish().transform(t=>t||(se.warn("No filename provided, using fallback"),wE())),code:M().nullish().transform(t=>t??z_()??""),version:M().nullish().transform(t=>t??"unknown"),mode:ye(["edit","read","home","run"]).transform(t=>t==="run"?"read":t),config:du,configOverrides:du,appConfig:du,view:$({showAppCode:W().default(!0)}).nullish().transform(t=>t??{showAppCode:!0}),serverToken:M().nullish().transform(t=>t??""),fileStores:ee(OE()).optional(),session:Se([or().optional(),zr({version:He("1"),metadata:Ht(),cells:ee(Ht())}).transform(t=>t)]),notebook:Se([or().optional(),zr({version:He("1"),metadata:Ht(),cells:ee(Ht())}).transform(t=>t)]),runtimeConfig:ee(zr({url:M(),lazy:W().default(!0),authToken:M().nullish()})).nullish().transform(t=>t??[])});function mE(t){let e=cE.safeParse(t);if(!e.success)throw se.error("Invalid marimo mount options",e.error),Error("Invalid marimo mount options");let a=e.data.mode;if(k4(a),e.data.fileStores&&e.data.fileStores.length>0){se.log("\u{1F5C4}\uFE0F Initializing file stores via mount...");for(let l=e.data.fileStores.length-1;l>=0;l--)d_.insert(0,e.data.fileStores[l]);se.log(`\u{1F5C4}\uFE0F Injected ${e.data.fileStores.length} file store(s) into notebookFileStore`)}ze.set(pT,M4()),ze.set(_E,e.data.filename),ze.set(SE,e.data.code),ze.set(iA,a),ze.set(F_,e.data.version),ze.set(I_,e.data.view.showAppCode);let r=new URL(window.location.href).searchParams.get(bu.viewAs)==="present",n=a==="edit"&&r?"present":a;if(ze.set(nA,{mode:n,cellAnchor:null}),ze.set(A_,e.data.serverToken),ze.set(w_,g_(e.data.configOverrides)),ze.set(j_,b_(e.data.config)),ze.set(y_,f_(e.data.appConfig)),e.data.runtimeConfig.length>0){let l=e.data.runtimeConfig[0];se.debug("\u26A1 Runtime URL",l.url),ze.set(K1,{...l,serverToken:e.data.serverToken}),!l.lazy&&!Un()&&ze.set(Z1,{state:W1.CONNECTING})}else ze.set(K1,{...T_,lazy:!1,serverToken:e.data.serverToken});let i=yy(e.data.session,e.data.notebook);i&&ze.set(R1,i)}var D1=document.getElementById("root");if(D1){if(!window.__MARIMO_MOUNT_CONFIG__)throw Error("[marimo] mount config not found");uE(window.__MARIMO_MOUNT_CONFIG__,D1)}else throw Error("[marimo] root element not found")});
|
|
43
|
+
Defaulting to \`null\`.`}var y1=p1,z5=f1,O5=J(),b1=x.forwardRef((t,e)=>{let a=(0,O5.c)(13),r,n,i;a[0]===t?(r=a[1],n=a[2],i=a[3]):({className:r,value:i,...n}=t,a[0]=t,a[1]=r,a[2]=n,a[3]=i);let l;a[4]===r?l=a[5]:(l=U("relative h-2 w-full overflow-hidden rounded-full bg-primary/20",r),a[4]=r,a[5]=l);let o=`translateX(-${100-(i||0)}%)`,d;a[6]===o?d=a[7]:(d=(0,s.jsx)(z5,{className:"h-full w-full flex-1 bg-primary transition-all pulse",style:{transform:o}}),a[6]=o,a[7]=d);let u;return a[8]!==n||a[9]!==e||a[10]!==l||a[11]!==d?(u=(0,s.jsx)(y1,{ref:e,className:l,...n,children:d}),a[8]=n,a[9]=e,a[10]=l,a[11]=d,a[12]=u):u=a[12],u});b1.displayName=y1.displayName;var $5=J(),L5=class{constructor(){q(this,"tagName","marimo-progress");q(this,"validator",$({title:M().optional(),subtitle:M().optional(),progress:Se([Y(),W()]),total:Y().optional(),eta:Y().optional(),rate:Y().optional()}))}render(t){return(0,s.jsx)(B5,{...t.data})}};const B5=t=>{let e=(0,$5.c)(24),{title:a,subtitle:r,progress:n,total:i,eta:l,rate:o}=t,d=typeof n=="number"?"items-start":"items-center",u;e[0]!==n||e[1]!==i?(u=()=>typeof n=="number"&&i!=null&&i>0?(0,s.jsxs)("div",{className:"flex gap-3 text-sm text-muted-foreground items-baseline",children:[(0,s.jsx)(b1,{value:H5(n/i*100)}),(0,s.jsxs)("span",{className:"shrink-0",children:[n," / ",i]})]}):(0,s.jsx)($l,{className:"w-12 h-12 animate-spin text-primary mx-auto"}),e[0]=n,e[1]=i,e[2]=u):u=e[2];let c=u,p;e[3]!==l||e[4]!==n||e[5]!==o||e[6]!==i?(p=()=>{let j=typeof n=="number"&&i!=null&&n>=i,k=[];if(o&&(o<1?k.push((0,s.jsxs)("span",{children:[ou(1/o)," per iter"]},"rate")):k.push((0,s.jsxs)("span",{children:[o," iter/s"]},"rate")),k.push((0,s.jsx)("span",{children:"\xB7"},"spacer-rate"))),!j&&l&&k.push((0,s.jsxs)("span",{children:["ETA ",ou(l)]},"eta"),(0,s.jsx)("span",{children:"\xB7"},"spacer-eta")),j&&o){let N=n/o;k.push((0,s.jsxs)("span",{children:["Total time ",ou(N)]},"completed"),(0,s.jsx)("span",{children:"\xB7"},"spacer-completed"))}if(k.pop(),k.length>0)return(0,s.jsx)("div",{className:"flex gap-2 text-muted-foreground text-sm",children:k})},e[3]=l,e[4]=n,e[5]=o,e[6]=i,e[7]=p):p=e[7];let m=p,h=`flex flex-col ${d} max-w-sm p-6 mx-auto`,f;e[8]===a?f=e[9]:(f=a&&(0,s.jsx)("div",{className:"text-lg font-bold text-foreground/60",children:Me({html:a})}),e[8]=a,e[9]=f);let g;e[10]===r?g=e[11]:(g=r&&(0,s.jsx)("div",{className:"text-sm text-muted-foreground",children:Me({html:r})}),e[10]=r,e[11]=g);let v;e[12]===c?v=e[13]:(v=c(),e[12]=c,e[13]=v);let b;e[14]===m?b=e[15]:(b=m(),e[14]=m,e[15]=b);let w;e[16]!==v||e[17]!==b?(w=(0,s.jsxs)("div",{className:"mt-2 w-full flex flex-col gap-1",children:[v,b]}),e[16]=v,e[17]=b,e[18]=w):w=e[18];let D;return e[19]!==h||e[20]!==f||e[21]!==g||e[22]!==w?(D=(0,s.jsxs)("div",{className:h,children:[f,g,w]}),e[19]=h,e[20]=f,e[21]=g,e[22]=w,e[23]=D):D=e[23],D};function H5(t){return cT(t,0,100)}var W5=_5.default.humanizer({language:"shortEn",languages:{shortEn:{y:()=>"y",mo:()=>"mo",w:()=>"w",d:()=>"d",h:()=>"h",m:()=>"m",s:()=>"s",ms:()=>"ms"}}});function ou(t){return W5(t*1e3,{language:"shortEn",largest:2,spacer:"",maxDecimalPoints:t<10?2:0})}var U5=uu((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PathError=t.TokenData=void 0,t.match=c;var e="/",a=v=>v,r=/^[$_\p{ID_Start}]$/u,n=/^[$\u200c\u200d\p{ID_Continue}]$/u,i={"{":"{","}":"}","(":"(",")":")","[":"[","]":"]","+":"+","?":"?","!":"!"};function l(v){return v.replace(/[.+*?^${}()[\]|/\\]/g,"\\$&")}var o=class{constructor(v,b){this.tokens=v,this.originalPath=b}};t.TokenData=o;var d=class extends TypeError{constructor(v,b){let w=v;b&&(w+=`: ${b}`),w+="; visit https://git.new/pathToRegexpError for info",super(w),this.originalPath=b}};t.PathError=d;function u(v,b={}){let{encodePath:w=a}=b,D=[...v],j=[],k=0,N=0;function S(){let C="";if(r.test(D[k]))do C+=D[k++];while(n.test(D[k]));else if(D[k]==='"'){let _=k;for(;k++<D.length;){if(D[k]==='"'){k++,_=0;break}D[k]==="\\"&&k++,C+=D[k]}if(_)throw new d(`Unterminated quote at index ${_}`,v)}if(!C)throw new d(`Missing parameter name at index ${k}`,v);return C}for(;k<D.length;){let C=D[k],_=i[C];_?j.push({type:_,index:k++,value:C}):C==="\\"?j.push({type:"escape",index:k++,value:D[k++]}):C===":"?j.push({type:"param",index:k++,value:S()}):C==="*"?j.push({type:"wildcard",index:k++,value:S()}):j.push({type:"char",index:k++,value:C})}j.push({type:"end",index:k,value:""});function y(C){let _=[];for(;;){let E=j[N++];if(E.type===C)break;if(E.type==="char"||E.type==="escape"){let T=E.value,P=j[N];for(;P.type==="char"||P.type==="escape";)T+=P.value,P=j[++N];_.push({type:"text",value:w(T)});continue}if(E.type==="param"||E.type==="wildcard"){_.push({type:E.type,name:E.value});continue}if(E.type==="{"){_.push({type:"group",tokens:y("}")});continue}throw new d(`Unexpected ${E.type} at index ${E.index}, expected ${C}`,v)}return _}return new o(y("end"),v)}function c(v,b={}){let{decode:w=decodeURIComponent,delimiter:D=e}=b,{regexp:j,keys:k}=p(v,b),N=k.map(S=>w===!1?a:S.type==="param"?w:y=>y.split(D).map(w));return function(S){let y=j.exec(S);if(!y)return!1;let C=y[0],_=Object.create(null);for(let E=1;E<y.length;E++){if(y[E]===void 0)continue;let T=k[E-1],P=N[E-1];_[T.name]=P(y[E])}return{path:C,params:_}}}function p(v,b={}){let{delimiter:w=e,end:D=!0,sensitive:j=!1,trailing:k=!0}=b,N=[],S=j?"":"i",y=[];for(let _ of m(v,[])){let E=typeof _=="object"?_:u(_,b);for(let T of h(E.tokens,0,[]))y.push(f(T,w,N,E.originalPath))}let C=`^(?:${y.join("|")})`;return k&&(C+=`(?:${l(w)}$)?`),C+=D?"$":`(?=${l(w)}|$)`,{regexp:new RegExp(C,S),keys:N}}function m(v,b){if(Array.isArray(v))for(let w of v)m(w,b);else b.push(v);return b}function*h(v,b,w){if(b===v.length)return yield w;let D=v[b];if(D.type==="group")for(let j of h(D.tokens,0,w.slice()))yield*h(v,b+1,j);else w.push(D);yield*h(v,b+1,w)}function f(v,b,w,D){let j="",k="",N=!0;for(let S of v){if(S.type==="text"){j+=l(S.value),k+=S.value,N||(N=S.value.includes(b));continue}if(S.type==="param"||S.type==="wildcard"){if(!N&&!k)throw new d(`Missing text before "${S.name}" ${S.type}`,D);S.type==="param"?j+=`(${g(b,N?"":k)}+)`:j+="([\\s\\S]+)",w.push(S),k="",N=!1;continue}}return j}function g(v,b){return b.length<2?v.length<2?`[^${l(v+b)}]`:`(?:(?!${l(v)})[^${l(b)}])`:v.length<2?`(?:(?!${l(b)})[^${l(v)}])`:`(?:(?!${l(b)}|${l(v)})[\\s\\S])`}}))(),K5=class{constructor(t){this.routes=t.map(e=>({template:e,pathFunction:(0,U5.match)(e)}))}match(t){for(let{pathFunction:e,template:a}of this.routes){let r=e(t.hash)||e(t.pathname);if(r)return[r,a]}return!1}},Z5=J(),q5=class{constructor(){q(this,"tagName","marimo-routes");q(this,"validator",$({routes:ee(M())}))}render(t){return(0,s.jsx)(Y5,{...t.data,children:t.children})}},Y5=t=>{let e=(0,Z5.c)(14),{routes:a,children:r}=t,n=x.Children.count(r);if(n!==a.length)throw Error(`Expected ${a.length} children, but got ${n}`);let i;e[0]===a?i=e[1]:(i=new K5(a),e[0]=a,e[1]=i);let l=i,o;e[2]===l?o=e[3]:(o=()=>{let w=l.match(window.location);return w?w[1]:null},e[2]=l,e[3]=o);let[d,u]=(0,x.useState)(o),c;e[4]===l?c=e[5]:(c=w=>{let D=l.match(w);u(D?D[1]:null)},e[4]=l,e[5]=c);let p=Oe(c),m,h;if(e[6]===p?(m=e[7],h=e[8]):(m=()=>{let w=D=>{p(window.location)};return window.addEventListener("hashchange",w),window.addEventListener("popstate",w),()=>{window.removeEventListener("hashchange",w),window.removeEventListener("popstate",w)}},h=[p],e[6]=p,e[7]=m,e[8]=h),(0,x.useEffect)(m,h),!d){let w;return e[9]===Symbol.for("react.memo_cache_sentinel")?(w=(0,s.jsx)(s.Fragment,{}),e[9]=w):w=e[9],w}let f=a.indexOf(d),g;e[10]===r?g=e[11]:(g=x.Children.toArray(r),e[10]=r,e[11]=g);let v=g[f],b;return e[12]===v?b=e[13]:(b=(0,s.jsx)(s.Fragment,{children:v}),e[12]=v,e[13]=b),b},G5=J(),Q5=class{constructor(){q(this,"tagName","marimo-stat");q(this,"validator",$({value:Se([M(),Y(),W()]).optional(),label:M().optional(),caption:M().optional(),bordered:W().default(!1),direction:ye(["increase","decrease"]).optional(),target_direction:ye(["increase","decrease"]).default("increase"),slot:Ht().optional()}))}render({data:t}){return(0,s.jsx)(J5,{...t})}};const J5=t=>{let e=(0,G5.c)(31),{value:a,label:r,caption:n,bordered:i,direction:l,target_direction:o,slot:d}=t,{locale:u}=qe(),c;e[0]!==u||e[1]!==a?(c=()=>a==null?(0,s.jsx)("i",{children:"No value"}):typeof a=="string"?a:typeof a=="number"?TA(a,u):typeof a=="boolean"?a?"True":"False":String(a),e[0]=u,e[1]=a,e[2]=c):c=e[2];let p=c,m=l===o,h=m?"var(--grass-8)":"var(--red-8)",f=m?"var(--grass-9)":"var(--red-9)",g;e[3]===d?g=e[4]:(g=()=>{let E=W_(d);if(E!=null&&E[0]){let{mimetype:T,data:P}=E[0];return T!=="text/html"&&se.warn(`Expected text/html, got ${T}`),Me({html:P,alwaysSanitizeHtml:!0})}},e[3]=d,e[4]=g);let v=g,b=i&&"rounded-xl border shadow bg-card",w;e[5]===b?w=e[6]:(w=U("text-card-foreground p-6",b),e[5]=b,e[6]=w);let D;e[7]===r?D=e[8]:(D=r&&(0,s.jsx)("div",{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:(0,s.jsx)("h3",{className:"tracking-tight text-sm font-medium",children:r})}),e[7]=r,e[8]=D);let j;e[9]===p?j=e[10]:(j=p(),e[9]=p,e[10]=j);let k;e[11]===j?k=e[12]:(k=(0,s.jsx)("div",{className:"text-2xl font-bold",children:j}),e[11]=j,e[12]=k);let N;e[13]!==n||e[14]!==l||e[15]!==h||e[16]!==f?(N=n&&(0,s.jsxs)("p",{className:"pt-1 text-xs text-muted-foreground flex align-center whitespace-nowrap",children:[l==="increase"&&(0,s.jsx)(rc,{className:"w-4 h-4 mr-1 p-0.5",fill:h,stroke:f}),l==="decrease"&&(0,s.jsx)(rc,{className:"w-4 h-4 mr-1 p-0.5 transform rotate-180",fill:h,stroke:f}),n]}),e[13]=n,e[14]=l,e[15]=h,e[16]=f,e[17]=N):N=e[17];let S;e[18]!==k||e[19]!==N?(S=(0,s.jsxs)("div",{children:[k,N]}),e[18]=k,e[19]=N,e[20]=S):S=e[20];let y;e[21]!==v||e[22]!==d?(y=d&&(0,s.jsx)("div",{className:"[--slot:true]",children:v()}),e[21]=v,e[22]=d,e[23]=y):y=e[23];let C;e[24]!==y||e[25]!==S?(C=(0,s.jsxs)("div",{className:"pt-0 flex flex-row gap-3.5",children:[S,y]}),e[24]=y,e[25]=S,e[26]=C):C=e[26];let _;return e[27]!==C||e[28]!==w||e[29]!==D?(_=(0,s.jsxs)("div",{className:w,children:[D,C]}),e[27]=C,e[28]=w,e[29]=D,e[30]=_):_=e[30],_};var X5=J(),eE=class{constructor(){q(this,"tagName","marimo-tex");q(this,"validator",$({}))}render(t){return(0,s.jsx)(nE,{host:t.host,tex:t.host.textContent||t.host.innerHTML})}},tE=tv(async()=>(await vt(async()=>{let{default:t}=await import("./katex-D_p4uM5H.js").then(async e=>(await e.__tla,e));return{default:t}},__vite__mapDeps([379,152]),import.meta.url)).default),aE=tv(async()=>{await vt(()=>import("./mhchem-L2lUt6CA.js").then(async t=>(await t.__tla,t)),__vite__mapDeps([380,152]),import.meta.url)}),su={};async function rE(t,e){let[a]=await Promise.all([tE(),aE()]);e.startsWith("||(||(")&&e.endsWith("||)||)")?a.render(e.slice(6,-6),t,{displayMode:!0,globalGroup:!0,throwOnError:!1,macros:su}):e.startsWith("||(")&&e.endsWith("||)")?a.render(e.slice(3,-3),t,{displayMode:!1,globalGroup:!0,throwOnError:!1,macros:su}):e.startsWith("||[")&&e.endsWith("||]")&&a.render(e.slice(3,-3),t,{displayMode:!0,globalGroup:!0,throwOnError:!1,macros:su})}var nE=t=>{var h;let e=(0,X5.c)(8),{host:a,tex:r}=t,n=(0,x.useRef)(null),[i,l]=(0,x.useState)(r),o,d;e[0]===a?(o=e[1],d=e[2]):(o=()=>{let f=new MutationObserver(()=>{l(a.textContent||a.innerHTML)});return f.observe(a,{childList:!0,characterData:!0,subtree:!0}),()=>{f.disconnect()}},d=[a],e[0]=a,e[1]=o,e[2]=d),(0,x.useLayoutEffect)(o,d);let u=((h=a.parentElement)==null?void 0:h.tagName.toLowerCase())==="marimo-tex",c,p;e[3]!==i||e[4]!==u?(c=()=>{n.current&&!u&&rE(n.current,i)},p=[i,u],e[3]=i,e[4]=u,e[5]=c,e[6]=p):(c=e[5],p=e[6]),(0,x.useLayoutEffect)(c,p);let m;return e[7]===Symbol.for("react.memo_cache_sentinel")?(m=(0,s.jsx)("span",{ref:n}),e[7]=m):m=e[7],m};const iE=[new TD,new PD,wk,new Xk,new iS,new aS,new sS,new VD,new fS,new HS,$S,JS,new cN,new tC,new hN,new NN,new IN,new RN,new VN,new $N,new HN,new qN,new QN,new t5,new DN,KD,vS,VS,w5,f5,jD,aj,vN];var lE=[new r5,new o5,new p5,new v5,new y5,new j5,new C5,new iD,new E5,new L5,new q5,new Q5,new eE];function oE(){vD(),wD(),iE.forEach(n0),lE.forEach(n0)}async function sE(){if(typeof document>"u")return;let{onLCP:t,onINP:e,onCLS:a}=await vt(async()=>{let{onLCP:n,onINP:i,onCLS:l}=await import("./web-vitals-DATa1XxG.js").then(async o=>(await o.__tla,o));return{onLCP:n,onINP:i,onCLS:l}},[],import.meta.url);se.debug("Reporting vitals");let r=n=>{let i=n.rating==="good"?"green":n.rating==="needs-improvement"?"orange":"red";se.log(`%c [Metric ${n.name}] ${n.value}`,`background:${i}; color:white; padding:2px 0; border-radius:2px`)};a(r),e(r),t(r)}var dE=E1(),w1=!1;function uE(t,e){if(w1)return se.warn("marimo app has already been mounted."),Error("marimo app has already been mounted.");w1=!0;let a=(0,dE.createRoot)(e);try{UT(),oE(),N4(),Un()&&(F4(),z4(GE)),mE(t),a.render((0,s.jsx)(Tl,{store:ze,children:(0,s.jsx)(Lc,{children:(0,s.jsx)(jg,{})})}))}catch(r){return a.render((0,s.jsx)(Pl,{children:(0,s.jsx)(()=>{throw r},{})})),r}finally{sE()}}var du=zr({}).nullish().default({}).transform(t=>t||(typeof t=="string"?(se.warn("[marimo] received JSON string instead of object. Parsing..."),JSON.parse(t)):(se.warn("[marimo] missing config data"),{}))),cE=$({filename:M().nullish().transform(t=>t||(se.warn("No filename provided, using fallback"),wE())),code:M().nullish().transform(t=>t??z_()??""),version:M().nullish().transform(t=>t??"unknown"),mode:ye(["edit","read","home","run"]).transform(t=>t==="run"?"read":t),config:du,configOverrides:du,appConfig:du,view:$({showAppCode:W().default(!0)}).nullish().transform(t=>t??{showAppCode:!0}),serverToken:M().nullish().transform(t=>t??""),fileStores:ee(OE()).optional(),session:Se([or().optional(),zr({version:He("1"),metadata:Ht(),cells:ee(Ht())}).transform(t=>t)]),notebook:Se([or().optional(),zr({version:He("1"),metadata:Ht(),cells:ee(Ht())}).transform(t=>t)]),runtimeConfig:ee(zr({url:M(),lazy:W().default(!0),authToken:M().nullish()})).nullish().transform(t=>t??[])});function mE(t){let e=cE.safeParse(t);if(!e.success)throw se.error("Invalid marimo mount options",e.error),Error("Invalid marimo mount options");let a=e.data.mode;if(k4(a),e.data.fileStores&&e.data.fileStores.length>0){se.log("\u{1F5C4}\uFE0F Initializing file stores via mount...");for(let l=e.data.fileStores.length-1;l>=0;l--)d_.insert(0,e.data.fileStores[l]);se.log(`\u{1F5C4}\uFE0F Injected ${e.data.fileStores.length} file store(s) into notebookFileStore`)}ze.set(pT,M4()),ze.set(_E,e.data.filename),ze.set(SE,e.data.code),ze.set(iA,a),ze.set(F_,e.data.version),ze.set(I_,e.data.view.showAppCode);let r=new URL(window.location.href).searchParams.get(bu.viewAs)==="present",n=a==="edit"&&r?"present":a;if(ze.set(nA,{mode:n,cellAnchor:null}),ze.set(A_,e.data.serverToken),ze.set(w_,g_(e.data.configOverrides)),ze.set(j_,b_(e.data.config)),ze.set(y_,f_(e.data.appConfig)),e.data.runtimeConfig.length>0){let l=e.data.runtimeConfig[0];se.debug("\u26A1 Runtime URL",l.url),ze.set(K1,{...l,serverToken:e.data.serverToken}),!l.lazy&&!Un()&&ze.set(Z1,{state:W1.CONNECTING})}else ze.set(K1,{...T_,lazy:!1,serverToken:e.data.serverToken});let i=yy(e.data.session,e.data.notebook);i&&ze.set(R1,i)}var D1=document.getElementById("root");if(D1){if(!window.__MARIMO_MOUNT_CONFIG__)throw Error("[marimo] mount config not found");uE(window.__MARIMO_MOUNT_CONFIG__,D1)}else throw Error("[marimo] root element not found")});
|