@malloy-publisher/server 0.10.7 → 0.11.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/dist/app/api-doc.yaml +1014 -125
  2. package/dist/app/assets/{EnvironmentPage-B9Q9ZYYM.js → EnvironmentPage-Dfn26tY2.js} +1 -1
  3. package/dist/app/assets/{HomePage-CVbXvH7c.js → HomePage-CNuMPINA.js} +1 -1
  4. package/dist/app/assets/MainPage-DWjs4_e3.js +1 -0
  5. package/dist/app/assets/ModelPage-GZ6hXGgw.js +2 -0
  6. package/dist/app/assets/PackagePage-_5vFWxqm.js +1 -0
  7. package/dist/app/assets/PackageSplatRoute-CTxtXKZO.js +2 -0
  8. package/dist/app/assets/{RenderedResult-B_sW7neX.es-CFeRQyYD.js → RenderedResult-r3dg2xOJ.es-t-MnqNaH.js} +3 -3
  9. package/dist/app/assets/{RouteError-BYb6Nj48.js → RouteError-y4xkvszw.js} +1 -1
  10. package/dist/app/assets/{ThemeEditorPage-CYe_2MfI.js → ThemeEditorPage-BffGFYK5.js} +1 -1
  11. package/dist/app/assets/ToggleButtonGroup-BfTJg9cJ.js +1 -0
  12. package/dist/app/assets/documentRoutes-DnpGGXs4.js +1 -0
  13. package/dist/app/assets/editPageMounted-efTmRdGK.js +2 -0
  14. package/dist/app/assets/{index-DEj7hnfZ.js → index-CG6r_Zwr.js} +1 -1
  15. package/dist/app/assets/{index-DWhQwvJR.js → index-CW23I6Cr.js} +1 -1
  16. package/dist/app/assets/index-D8JKtZm5.js +483 -0
  17. package/dist/app/assets/{index-3fArIYYK.js → index-g1sInkiO.js} +1 -1
  18. package/dist/app/assets/{index.es-CMsNTB-h.js → index.es-AXVff-Xr.js} +5 -5
  19. package/dist/app/assets/usePackageLinkNavigate-DpGlRKnc.js +1 -0
  20. package/dist/app/assets/usePackageRoute-BUdFd5dP.js +1 -0
  21. package/dist/app/index.html +1 -1
  22. package/dist/instrumentation.mjs +1 -1
  23. package/dist/package_load_worker.mjs +238 -191
  24. package/dist/runtime/publisher.js +58 -1
  25. package/dist/server.mjs +4697 -1169
  26. package/package.json +1 -1
  27. package/dist/app/assets/MainPage-D1Fj4Wy1.js +0 -1
  28. package/dist/app/assets/ModelPage-DmYocpWT.js +0 -2
  29. package/dist/app/assets/PackagePage-4TwX_ajC.js +0 -1
  30. package/dist/app/assets/ToggleButtonGroup-b325mGmL.js +0 -1
  31. package/dist/app/assets/documentRoutes-D_C8snHV.js +0 -1
  32. package/dist/app/assets/editPageMounted-1X99LP7v.js +0 -2
  33. package/dist/app/assets/index-CGKV9Dxi.js +0 -483
@@ -1 +1 @@
1
- import{K as r,C as t,j as e,ab as i,aA as o}from"./index-CGKV9Dxi.js";function m(){const s=r(),{environmentName:n}=t();if(n){const a=i({environmentName:n});return e.jsx(o,{onSelectPackage:s,resourceUri:a})}else return e.jsx("div",{children:e.jsx("h2",{children:"Missing environment name"})})}export{m as default};
1
+ import{p as r,C as t,j as e,a7 as i,aa as o}from"./index-D8JKtZm5.js";function m(){const s=r(),{environmentName:n}=t();if(n){const a=i({environmentName:n});return e.jsx(o,{onSelectPackage:s,resourceUri:a})}else return e.jsx("div",{children:e.jsx("h2",{children:"Missing environment name"})})}export{m as default};
@@ -1 +1 @@
1
- import{K as t,j as o,c as a}from"./index-CGKV9Dxi.js";function s(){const n=t();return o.jsx(a,{onClickEnvironment:n})}export{s as default};
1
+ import{p as t,j as o,D as a}from"./index-D8JKtZm5.js";function s(){const n=t();return o.jsx(a,{onClickEnvironment:n})}export{s as default};
@@ -0,0 +1 @@
1
+ import{c as j,j as t,s as I,B as Ee,m as Q,e as ce,g as me,a as fe,r as x,u as ge,b as Me,d as W,f as ye,T as K,h as Z,i as ze,k as Ce,l as Ie,o as be,n as De,q as Te,t as de,v as Be,w as Re,x as O,y as $,M as He,P as Le,z as $e,S as Ne,A as G,C as J,E as Oe,F as Ae,G as We,Z as pe,H as Ve,p as ee,I as u,J as Fe,K as Y,L as V,N as te,O as Ue,Q as _e,R as ue,U as Xe,V as re,W as ne,X as oe,Y as Ye,_ as qe,$ as Qe,a0 as Ke}from"./index-D8JKtZm5.js";import{u as Ze,l as he}from"./editPageMounted-efTmRdGK.js";import{i as Ge,w as Je,a as et}from"./documentRoutes-DnpGGXs4.js";import{u as ve,p as tt}from"./usePackageRoute-BUdFd5dP.js";const rt=j(t.jsx("path",{d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"})),nt=I(Ee,{name:"MuiBreadcrumbCollapsed"})(Q(({theme:e})=>({display:"flex",marginLeft:`calc(${e.spacing(1)} * 0.5)`,marginRight:`calc(${e.spacing(1)} * 0.5)`,...e.palette.mode==="light"?{backgroundColor:e.palette.grey[100],color:e.palette.grey[700]}:{backgroundColor:e.palette.grey[700],color:e.palette.grey[100]},borderRadius:2,"&:hover, &:focus":{...e.palette.mode==="light"?{backgroundColor:e.palette.grey[200]}:{backgroundColor:e.palette.grey[600]}},"&:active":{boxShadow:e.shadows[0],...e.palette.mode==="light"?{backgroundColor:ce(e.palette.grey[200],.12)}:{backgroundColor:ce(e.palette.grey[600],.12)}}}))),ot=I(rt)({width:24,height:16});function st(e){const{slots:r={},slotProps:o={},...n}=e,s=e;return t.jsx("li",{children:t.jsx(nt,{focusRipple:!0,...n,ownerState:s,children:t.jsx(ot,{as:r.CollapsedIcon,ownerState:s,...o.collapsedIcon})})})}function at(e){return me("MuiBreadcrumbs",e)}const it=fe("MuiBreadcrumbs",["root","ol","li","separator"]),lt=e=>{const{classes:r}=e;return ye({root:["root"],li:["li"],ol:["ol"],separator:["separator"]},at,r)},ct=I(K,{name:"MuiBreadcrumbs",slot:"Root",overridesResolver:(e,r)=>[{[`& .${it.li}`]:r.li},r.root]})({}),dt=I("ol",{name:"MuiBreadcrumbs",slot:"Ol"})({display:"flex",flexWrap:"wrap",alignItems:"center",padding:0,margin:0,listStyle:"none"}),pt=I("li",{name:"MuiBreadcrumbs",slot:"Separator"})({display:"flex",userSelect:"none",marginLeft:8,marginRight:8});function ut(e,r,o,n){return e.reduce((s,a,i)=>(i<e.length-1?s=s.concat(a,t.jsx(pt,{"aria-hidden":!0,className:r,ownerState:n,children:o},`separator-${i}`)):s.push(a),s),[])}const ht=x.forwardRef(function(r,o){const n=ge({props:r,name:"MuiBreadcrumbs"}),{children:s,className:a,component:i="nav",slots:d={},slotProps:m={},expandText:p="Show path",itemsAfterCollapse:h=1,itemsBeforeCollapse:b=1,maxItems:g=8,separator:w="/",...D}=n,[k,S]=x.useState(!1),v={...n,component:i,expanded:k,expandText:p,itemsAfterCollapse:h,itemsBeforeCollapse:b,maxItems:g,separator:w},z=lt(v),T=Me({elementType:d.CollapsedIcon,externalSlotProps:m.collapsedIcon,ownerState:v}),P=x.useRef(null),E=c=>{const M=()=>{S(!0);const y=P.current.querySelector("a[href],button,[tabindex]");y&&y.focus()};return b+h>=c.length?c:[...c.slice(0,b),t.jsx(st,{"aria-label":p,slots:{CollapsedIcon:d.CollapsedIcon},slotProps:{collapsedIcon:T},onClick:M},"ellipsis"),...c.slice(c.length-h,c.length)]},B=x.Children.toArray(s).filter(c=>x.isValidElement(c)).map((c,M)=>t.jsx("li",{className:z.li,children:c},`child-${M}`));return t.jsx(ct,{ref:o,component:i,color:"textSecondary",className:W(z.root,a),ownerState:v,...D,children:t.jsx(dt,{className:z.ol,ref:P,ownerState:v,children:ut(k||g&&B.length<=g?B:E(B),z.separator,w,v)})})});function xt(e,r,o){const n=r.getBoundingClientRect(),s=o&&o.getBoundingClientRect(),a=be(r);let i;if(r.fakeTransform)i=r.fakeTransform;else{const p=a.getComputedStyle(r);i=p.getPropertyValue("-webkit-transform")||p.getPropertyValue("transform")}let d=0,m=0;if(i&&i!=="none"&&typeof i=="string"){const p=i.split("(")[1].split(")")[0].split(",");d=parseInt(p[4],10),m=parseInt(p[5],10)}return e==="left"?s?`translateX(${s.right+d-n.left}px)`:`translateX(${a.innerWidth+d-n.left}px)`:e==="right"?s?`translateX(-${n.right-s.left-d}px)`:`translateX(-${n.left+n.width-d}px)`:e==="up"?s?`translateY(${s.bottom+m-n.top}px)`:`translateY(${a.innerHeight+m-n.top}px)`:s?`translateY(-${n.top-s.top+n.height-m}px)`:`translateY(-${n.top+n.height-m}px)`}function mt(e){return typeof e=="function"?e():e}function A(e,r,o){const n=mt(o),s=xt(e,r,n);s&&(r.style.webkitTransform=s,r.style.transform=s)}const ft=x.forwardRef(function(r,o){const n=Z(),s={enter:n.transitions.easing.easeOut,exit:n.transitions.easing.sharp},a={enter:n.transitions.duration.enteringScreen,exit:n.transitions.duration.leavingScreen},{addEndListener:i,appear:d=!0,children:m,container:p,direction:h="down",easing:b=s,in:g,onEnter:w,onEntered:D,onEntering:k,onExit:S,onExited:v,onExiting:z,style:T,timeout:P=a,TransitionComponent:E=ze,...B}=r,c=x.useRef(null),M=Ce(Ie(m),c,o),y=l=>f=>{l&&(f===void 0?l(c.current):l(c.current,f))},F=y((l,f)=>{A(h,l,p),Te(l),w&&w(l,f)}),ae=y((l,f)=>{const L=de({timeout:P,style:T,easing:b},{mode:"enter"});l.style.webkitTransition=n.transitions.create("-webkit-transform",{...L}),l.style.transition=n.transitions.create("transform",{...L}),l.style.webkitTransform="none",l.style.transform="none",k&&k(l,f)}),R=y(D),H=y(z),C=y(l=>{const f=de({timeout:P,style:T,easing:b},{mode:"exit"});l.style.webkitTransition=n.transitions.create("-webkit-transform",f),l.style.transition=n.transitions.create("transform",f),A(h,l,p),S&&S(l)}),U=y(l=>{l.style.webkitTransition="",l.style.transition="",v&&v(l)}),_=l=>{i&&i(c.current,l)},N=x.useCallback(()=>{c.current&&A(h,c.current,p)},[h,p]);return x.useEffect(()=>{if(g||h==="down"||h==="right")return;const l=De(()=>{c.current&&A(h,c.current,p)}),f=be(c.current);return f.addEventListener("resize",l),()=>{l.clear(),f.removeEventListener("resize",l)}},[h,g,p]),x.useEffect(()=>{g||N()},[g,N]),t.jsx(E,{nodeRef:c,onEnter:F,onEntered:R,onEntering:ae,onExit:C,onExited:U,onExiting:H,addEndListener:_,appear:d,in:g,timeout:P,...B,children:(l,{ownerState:f,...L})=>x.cloneElement(m,{ref:M,style:{visibility:l==="exited"&&!g?"hidden":void 0,...T,...m.props.style},...L})})});function gt(e){return me("MuiDrawer",e)}fe("MuiDrawer",["root","docked","paper","anchorLeft","anchorRight","anchorTop","anchorBottom","paperAnchorLeft","paperAnchorRight","paperAnchorTop","paperAnchorBottom","paperAnchorDockedLeft","paperAnchorDockedRight","paperAnchorDockedTop","paperAnchorDockedBottom","modal"]);const je=(e,r)=>{const{ownerState:o}=e;return[r.root,(o.variant==="permanent"||o.variant==="persistent")&&r.docked,r.modal]},yt=e=>{const{classes:r,anchor:o,variant:n}=e,s={root:["root",`anchor${$(o)}`],docked:[(n==="permanent"||n==="persistent")&&"docked"],modal:["modal"],paper:["paper",`paperAnchor${$(o)}`,n!=="temporary"&&`paperAnchorDocked${$(o)}`]};return ye(s,gt,r)},bt=I(He,{name:"MuiDrawer",slot:"Root",overridesResolver:je})(Q(({theme:e})=>({zIndex:(e.vars||e).zIndex.drawer}))),vt=I("div",{shouldForwardProp:$e,name:"MuiDrawer",slot:"Docked",skipVariantsResolver:!1,overridesResolver:je})({flex:"0 0 auto"}),jt=I(Le,{name:"MuiDrawer",slot:"Paper",overridesResolver:(e,r)=>{const{ownerState:o}=e;return[r.paper,r[`paperAnchor${$(o.anchor)}`],o.variant!=="temporary"&&r[`paperAnchorDocked${$(o.anchor)}`]]}})(Q(({theme:e})=>({overflowY:"auto",display:"flex",flexDirection:"column",height:"100%",flex:"1 0 auto",zIndex:(e.vars||e).zIndex.drawer,WebkitOverflowScrolling:"touch",position:"fixed",top:0,outline:0,variants:[{props:{anchor:"left"},style:{left:0}},{props:{anchor:"top"},style:{top:0,left:0,right:0,height:"auto",maxHeight:"100%"}},{props:{anchor:"right"},style:{right:0}},{props:{anchor:"bottom"},style:{top:"auto",left:0,bottom:0,right:0,height:"auto",maxHeight:"100%"}},{props:({ownerState:r})=>r.anchor==="left"&&r.variant!=="temporary",style:{borderRight:`1px solid ${(e.vars||e).palette.divider}`}},{props:({ownerState:r})=>r.anchor==="top"&&r.variant!=="temporary",style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`}},{props:({ownerState:r})=>r.anchor==="right"&&r.variant!=="temporary",style:{borderLeft:`1px solid ${(e.vars||e).palette.divider}`}},{props:({ownerState:r})=>r.anchor==="bottom"&&r.variant!=="temporary",style:{borderTop:`1px solid ${(e.vars||e).palette.divider}`}}]}))),ke={left:"right",right:"left",top:"down",bottom:"up"};function kt(e){return["left","right"].includes(e)}function wt({direction:e},r){return e==="rtl"&&kt(r)?ke[r]:r}const St=x.forwardRef(function(r,o){const n=ge({props:r,name:"MuiDrawer"}),s=Z(),a=Be(),i={enter:s.transitions.duration.enteringScreen,exit:s.transitions.duration.leavingScreen},{anchor:d="left",BackdropProps:m,children:p,className:h,elevation:b=16,hideBackdrop:g=!1,ModalProps:{BackdropProps:w,...D}={},onClose:k,open:S=!1,PaperProps:v={},SlideProps:z,TransitionComponent:T,transitionDuration:P=i,variant:E="temporary",slots:B={},slotProps:c={},...M}=n,y=x.useRef(!1);x.useEffect(()=>{y.current=!0},[]);const F=wt({direction:a?"rtl":"ltr"},d),R={...n,anchor:d,elevation:b,open:S,variant:E,...M},H=yt(R),C={slots:{transition:T,...B},slotProps:{paper:v,transition:z,...c,backdrop:Re(c.backdrop||{...m,...w},{transitionDuration:P})}},[U,_]=O("root",{ref:o,elementType:bt,className:W(H.root,H.modal,h),shouldForwardComponentProp:!0,ownerState:R,externalForwardedProps:{...C,...M,...D},additionalProps:{open:S,onClose:k,hideBackdrop:g,slots:{backdrop:C.slots.backdrop},slotProps:{backdrop:C.slotProps.backdrop}}}),[N,l]=O("paper",{elementType:jt,shouldForwardComponentProp:!0,className:W(H.paper,v.className),ownerState:R,externalForwardedProps:C,additionalProps:{elevation:E==="temporary"?b:0,square:!0,...E==="temporary"&&{role:"dialog","aria-modal":"true"}}}),[f,L]=O("docked",{elementType:vt,ref:o,className:W(H.root,H.docked,h),ownerState:R,externalForwardedProps:C,additionalProps:M}),[Se,Pe]=O("transition",{elementType:ft,ownerState:R,externalForwardedProps:C,additionalProps:{in:S,direction:ke[F],timeout:P,appear:y.current}}),ie=t.jsx(N,{...l,children:p});if(E==="permanent")return t.jsx(f,{...L,children:ie});const le=t.jsx(Se,{...Pe,children:ie});return E==="persistent"?t.jsx(f,{...L,children:le}):t.jsx(U,{..._,children:le})}),Pt=j([t.jsx("path",{d:"M19 5v14H5V5zm0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2"},"0"),t.jsx("path",{d:"M14 17H7v-2h7zm3-4H7v-2h10zm0-4H7V7h10z"},"1")]),Et=j(t.jsx("path",{d:"M10.85 12.65h2.3L12 9zM20 8.69V4h-4.69L12 .69 8.69 4H4v4.69L.69 12 4 15.31V20h4.69L12 23.31 15.31 20H20v-4.69L23.31 12zM14.3 16l-.7-2h-3.2l-.7 2H7.8L11 7h2l3.2 9z"})),Mt=j(t.jsx("path",{d:"M9.4 16.6 4.8 12l4.6-4.6L8 6l-6 6 6 6zm5.2 0 4.6-4.6-4.6-4.6L16 6l6 6-6 6z"})),zt=j(t.jsx("path",{d:"M9.37 5.51c-.18.64-.27 1.31-.27 1.99 0 4.08 3.32 7.4 7.4 7.4.68 0 1.35-.09 1.99-.27C17.45 17.19 14.93 19 12 19c-3.86 0-7-3.14-7-7 0-2.93 1.81-5.45 4.37-6.49M12 3c-4.97 0-9 4.03-9 9s4.03 9 9 9 9-4.03 9-9c0-.46-.04-.92-.1-1.36-.98 1.37-2.58 2.26-4.4 2.26-2.98 0-5.4-2.42-5.4-5.4 0-1.81.89-3.42 2.26-4.4-.44-.06-.9-.1-1.36-.1"})),Ct=j(t.jsx("path",{d:"m14.06 9.02.92.92L5.92 19H5v-.92zM17.66 3c-.25 0-.51.1-.7.29l-1.83 1.83 3.75 3.75 1.83-1.83c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.2-.2-.45-.29-.71-.29m-3.6 3.19L3 17.25V21h3.75L17.81 9.94z"})),It=j(t.jsx("path",{d:"m9.17 6 2 2H20v10H4V6zM10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8z"})),Dt=j(t.jsx("path",{d:"m12 5.69 5 4.5V18h-2v-6H9v6H7v-7.81zM12 3 2 12h3v8h6v-6h2v6h6v-8h3z"})),Tt=j(t.jsx("path",{d:"M12 9c1.65 0 3 1.35 3 3s-1.35 3-3 3-3-1.35-3-3 1.35-3 3-3m0-2c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5M2 13h2c.55 0 1-.45 1-1s-.45-1-1-1H2c-.55 0-1 .45-1 1s.45 1 1 1m18 0h2c.55 0 1-.45 1-1s-.45-1-1-1h-2c-.55 0-1 .45-1 1s.45 1 1 1M11 2v2c0 .55.45 1 1 1s1-.45 1-1V2c0-.55-.45-1-1-1s-1 .45-1 1m0 18v2c0 .55.45 1 1 1s1-.45 1-1v-2c0-.55-.45-1-1-1s-1 .45-1 1M5.99 4.58c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0s.39-1.03 0-1.41zm12.37 12.37c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0 .39-.39.39-1.03 0-1.41zm1.06-10.96c.39-.39.39-1.03 0-1.41-.39-.39-1.03-.39-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0zM7.05 18.36c.39-.39.39-1.03 0-1.41-.39-.39-1.03-.39-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0z"})),Bt=j(t.jsx("path",{d:"M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3z"})),Rt=j([t.jsx("path",{d:"M12 22C6.49 22 2 17.51 2 12S6.49 2 12 2s10 4.04 10 9c0 3.31-2.69 6-6 6h-1.77c-.28 0-.5.22-.5.5 0 .12.05.23.13.33.41.47.64 1.06.64 1.67 0 1.38-1.12 2.5-2.5 2.5m0-18c-4.41 0-8 3.59-8 8s3.59 8 8 8c.28 0 .5-.22.5-.5 0-.16-.08-.28-.14-.35-.41-.46-.63-1.05-.63-1.65 0-1.38 1.12-2.5 2.5-2.5H16c2.21 0 4-1.79 4-4 0-3.86-3.59-7-8-7"},"0"),t.jsx("circle",{cx:"6.5",cy:"11.5",r:"1.5"},"1"),t.jsx("circle",{cx:"9.5",cy:"7.5",r:"1.5"},"2"),t.jsx("circle",{cx:"14.5",cy:"7.5",r:"1.5"},"3"),t.jsx("circle",{cx:"17.5",cy:"11.5",r:"1.5"},"4")]);function q(e){return t.jsxs(Ne,{...e,viewBox:"0 0 24 24",sx:{fill:"none",...e.sx},children:[t.jsx("rect",{x:"3.25",y:"4.75",width:"17.5",height:"14.5",rx:"2.25",stroke:"currentColor",strokeWidth:"1.5"}),t.jsx("line",{x1:"8.5",y1:"5",x2:"8.5",y2:"19",stroke:"currentColor",strokeWidth:"1.5"})]})}const Ht=/\.malloy(nb)?$/;function Lt(){const{pathname:e,search:r}=G(),o=J(),n=Oe(),s=Ae(),a=Ze(),i=o.environmentName??"",d=o.packageName??"",m=ve({always:!0}),p=m.path??"",h=i!==""&&d!==""&&p!==""&&m.writable&&!Ht.test(p),{reports:b,settled:g}=We(i,d,void 0,h);if(!h||s)return null;const w=p.replace(/\/$/,""),D=Ge(r),k=e.replace(/\/$/,"");return D?a?null:t.jsx(pe,{label:"View",onClick:()=>n(`${k}${Je(r)}`)}):(g?Ve(`${w}.malloy`,b):void 0)?.editable?t.jsx("span",{onPointerEnter:()=>void he(),onFocus:()=>void he(),children:t.jsx(pe,{label:"Edit",icon:t.jsx(Ct,{}),onClick:()=>n(`${k}${et(r)}`)})}):null}function X({label:e,onClick:r,current:o=!1}){return t.jsx(Fe,{clickable:!0,onClick:r,label:e,size:"small","aria-label":`Navigate to ${e}`,"aria-current":o?"page":void 0,sx:n=>({backgroundColor:"transparent",border:"none",color:o?"text.primary":"text.secondary",fontWeight:o?500:400,fontSize:13,height:28,cursor:"pointer",borderRadius:"6px",maxWidth:320,"& .MuiChip-label":{px:.75,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},"&:hover":{backgroundColor:n.palette.mode==="dark"?"rgba(255, 255, 255, 0.08)":"grey.100"}})})}function $t(){const e=J(),r=ve(),o=e.environmentName&&e.packageName?tt(e.environmentName,e.packageName,r.versionSegment):"",n=r.path?r.path.replace(/\/$/,""):void 0,s=ee();return!e.environmentName&&!e.packageName&&!n?null:t.jsx(u,{sx:{display:"flex",alignItems:"center",minWidth:0},children:t.jsxs(ht,{"aria-label":"breadcrumb",separator:t.jsx(u,{component:"span","aria-hidden":!0,sx:{color:"text.disabled"},children:"/"}),children:[e.environmentName&&t.jsx(X,{label:e.environmentName,current:!e.packageName&&!n,onClick:a=>s(`/${e.environmentName}/`,a)}),e.packageName&&t.jsx(X,{label:e.packageName,current:!n,onClick:a=>s(`${o}/`,a)}),n&&t.jsx(X,{label:n,current:!0,onClick:a=>s(`${o}/${n}`,a)})]})})}const Nt=260,Ot=64;function we({isCollapsed:e,onToggleCollapse:r,logoHeader:o}){return t.jsxs(u,{sx:{height:"100dvh",width:e?Ot:Nt,flexShrink:0,display:"flex",flexDirection:"column",backgroundColor:"background.paper",transition:"width 0.2s cubic-bezier(0.4, 0, 0.2, 1)",overflow:"hidden"},children:[t.jsx(At,{isCollapsed:e,onToggleCollapse:r,logoHeader:o}),t.jsxs(u,{sx:{flex:1,overflowY:"auto",overflowX:"hidden",py:1},children:[t.jsx(Wt,{isCollapsed:e}),t.jsx(Vt,{isCollapsed:e})]}),t.jsx(Ft,{isCollapsed:e})]})}function At({isCollapsed:e,onToggleCollapse:r,logoHeader:o}){const n=ee();return o?t.jsxs(u,{sx:{height:56,display:"flex",alignItems:"center",justifyContent:"space-between",px:e?0:2,flexShrink:0},children:[o,t.jsx(Y,{size:"small",onClick:r,"aria-label":e?"Expand sidebar":"Collapse sidebar",children:t.jsx(q,{fontSize:"small"})})]}):t.jsxs(u,{sx:{minHeight:56,display:"flex",flexDirection:e?"column":"row",alignItems:"center",justifyContent:e?"center":"space-between",gap:e?.5:0,py:e?1:0,px:e?0:2,flexShrink:0},children:[t.jsxs(u,{onClick:s=>n("/",s),sx:{display:"flex",alignItems:"center",gap:1,cursor:"pointer",minWidth:0},children:[t.jsx(u,{component:"img",src:"/logo.svg",alt:"Malloy",sx:{width:24,height:24,flexShrink:0}}),!e&&t.jsx(K,{variant:"subtitle1",sx:{color:"text.primary",fontWeight:500,letterSpacing:"-0.025em",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:"Malloy Publisher"})]}),t.jsx(V,{title:e?"Expand sidebar":"Collapse sidebar",placement:"right",children:t.jsx(Y,{size:"small",onClick:r,"aria-label":e?"Expand sidebar":"Collapse sidebar",children:t.jsx(q,{fontSize:"small"})})})]})}function Wt({isCollapsed:e}){const o=G().pathname==="/";return t.jsx(te,{sx:{py:0},children:t.jsx(se,{icon:t.jsx(Dt,{fontSize:"small"}),label:"Home",to:"/",selected:o,isCollapsed:e})})}function Vt({isCollapsed:e}){const{apiClients:r}=Ue(),o=J(),{data:n}=_e({queryKey:["environments"],queryFn:()=>r.environments.listEnvironments()}),s=n?.data??[];return s.length===0?null:t.jsxs(u,{sx:{mt:1},children:[!e&&t.jsx(K,{variant:"caption",sx:{display:"block",px:3,py:1,color:"text.secondary",fontWeight:500,textTransform:"uppercase",fontSize:"0.6875rem",letterSpacing:"0.5px"},children:"Environments"}),t.jsx(te,{sx:{py:0},children:s.map(a=>{const i=a.name??"";return t.jsx(se,{icon:t.jsx(It,{fontSize:"small"}),label:i,to:`/${i}`,selected:o.environmentName===i,isCollapsed:e},i)})})]})}function Ft({isCollapsed:e}){const{pathname:r}=G(),o=[{label:"Malloy Docs",href:ue.docsHome,icon:t.jsx(Pt,{fontSize:"small"}),external:!0},{label:"Publisher Docs",href:ue.publishing,icon:t.jsx(Bt,{fontSize:"small"}),external:!0},{label:"Publisher API",href:"/api-doc.html",icon:t.jsx(Mt,{fontSize:"small"}),external:!1}];return t.jsxs(te,{sx:{py:1},children:[t.jsx(se,{icon:t.jsx(Rt,{fontSize:"small"}),label:"Theme",to:"/settings/theme",selected:r.startsWith("/settings/theme"),isCollapsed:e}),t.jsx(Yt,{isCollapsed:e}),o.map(n=>t.jsx(Ut,{label:n.label,href:n.href,icon:n.icon,external:n.external,isCollapsed:e},n.label))]})}function se({icon:e,label:r,to:o,selected:n,isCollapsed:s}){const a=ee(),i=t.jsxs(re,{selected:n,onClick:d=>a(o,d),sx:{justifyContent:s?"center":"flex-start",px:s?0:2},children:[t.jsx(ne,{sx:{minWidth:s?0:36,justifyContent:"center",color:n?"text.primary":"text.secondary"},children:e}),!s&&t.jsx(oe,{primary:r,primaryTypographyProps:{variant:"body2",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}})]});return s?t.jsx(V,{title:r,placement:"right",children:t.jsx(u,{children:i})}):i}function Ut({label:e,href:r,icon:o,external:n,isCollapsed:s}){const a=t.jsxs(re,{component:"a",href:r,target:n?"_blank":void 0,rel:n?"noopener noreferrer":void 0,sx:{justifyContent:s?"center":"flex-start",px:s?0:2},children:[t.jsx(ne,{sx:{minWidth:s?0:36,justifyContent:"center",color:"text.secondary"},children:o}),!s&&t.jsx(oe,{primary:e,primaryTypographyProps:{variant:"body2",sx:{color:"text.secondary",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}})]});return s?t.jsx(V,{title:e,placement:"right",children:t.jsx(u,{children:a})}):a}const _t={light:"dark",dark:"auto",auto:"light"},Xt={light:"Light mode",dark:"Dark mode",auto:"Auto mode"},xe={light:"Light mode (click for dark)",dark:"Dark mode (click for auto)",auto:"Auto mode (follows OS, click for light)"};function Yt({isCollapsed:e}){const{mode:r,userChoice:o,setMode:n,allowUserToggle:s}=Xe();if(!s)return null;const a=o??r,i=a==="auto"?Et:a==="dark"?zt:Tt,d=t.jsxs(re,{"aria-label":xe[a],onClick:()=>n(_t[a]),sx:{justifyContent:e?"center":"flex-start",px:e?0:2},children:[t.jsx(ne,{sx:{minWidth:e?0:36,justifyContent:"center",color:"text.secondary"},children:t.jsx(i,{fontSize:"small"})}),!e&&t.jsx(oe,{primary:Xt[a],primaryTypographyProps:{variant:"body2",sx:{color:"text.secondary",whiteSpace:"nowrap"}}})]});return t.jsx(V,{title:xe[a],placement:"right",disableHoverListener:!e,children:t.jsx(u,{children:d})})}function qt({open:e,onClose:r,logoHeader:o}){return t.jsx(St,{anchor:"left",open:e,onClose:r,ModalProps:{keepMounted:!0},sx:{display:{xs:"block",md:"none"},"& .MuiDrawer-paper":{boxSizing:"border-box",width:260}},children:t.jsx(we,{isCollapsed:!1,onToggleCollapse:r,logoHeader:o})})}function Jt({headerProps:e}){const r=Z(),o=Ye(r.breakpoints.up("md")),[n,s]=x.useState(!1),[a,i]=x.useState(!1);return x.useEffect(()=>{o&&n&&s(!1)},[o,n]),t.jsxs(u,{sx:{height:"100dvh",display:"flex",flexDirection:"row",bgcolor:"background.default"},children:[o&&t.jsx(we,{isCollapsed:a,onToggleCollapse:()=>i(d=>!d),logoHeader:e?.logoHeader}),t.jsxs(u,{component:"main",sx:{flex:1,display:"flex",flexDirection:"column",minWidth:0},children:[t.jsxs(u,{sx:{flexShrink:0,display:"flex",alignItems:"center",justifyContent:"space-between",height:qe.headerHeight,px:{xs:1,md:3},backgroundColor:"background.default"},children:[t.jsx(u,{sx:{display:{xs:"flex",md:"none"},alignItems:"center",mr:1},children:t.jsx(Y,{size:"small",onClick:()=>s(!0),"aria-label":"Open navigation",children:t.jsx(q,{fontSize:"small"})})}),t.jsx(u,{sx:{flex:1,minWidth:0,display:"flex",alignItems:"center"},children:t.jsx($t,{})}),t.jsxs(u,{id:"header-actions-portal",sx:{display:"flex",alignItems:"center",flexShrink:0,gap:1},children:[t.jsx(Lt,{}),e?.endCap]})]}),t.jsx(u,{sx:{flex:1,overflow:"auto",minWidth:320,minHeight:0},children:t.jsx(x.Suspense,{fallback:t.jsx(Ke,{}),children:t.jsx(Qe,{})})})]}),t.jsx(qt,{open:n,onClose:()=>s(!1),logoHeader:e?.logoHeader})]})}export{Jt as default};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index.es-AXVff-Xr.js","assets/index-D8JKtZm5.js","assets/index-DUqldpo0.css","assets/ToggleButtonGroup-BfTJg9cJ.js"])))=>i.map(i=>d[i]);
2
+ import{g as oe,a as ae,d8 as E,d9 as ie,r as f,u as le,h as ce,j as n,d as de,y as V,f as ue,s as pe,T as C,m as fe,d7 as he,da as F,p as xe,G as I,db as me,dc as ye,dd as q,de as z,a5 as O,F as N,I as x,df as ge,a7 as R,dg as G,a4 as ve,aw as be,dh as je,bp as ke,di as we,E as Ce,A as D,dj as Ee,as as Re,a2 as H,a3 as X,dk as Se,dl as De,a6 as K,dm as $e,dn as Y,H as Le,dp as Ae,a1 as Te,a0 as P,dq as U,C as Me,O as Fe,dr as Pe,ds as B,dt as Ue}from"./index-D8JKtZm5.js";import{i as L,w as Be,a as Z,l as _e}from"./documentRoutes-DnpGGXs4.js";import{v as We,w as A,u as J}from"./usePackageRoute-BUdFd5dP.js";import{u as Ve}from"./usePackageLinkNavigate-DpGlRKnc.js";import{T as Q,P as $}from"./PackageSplatRoute-CTxtXKZO.js";import{a as Ie,l as ee}from"./editPageMounted-efTmRdGK.js";function qe(e){return oe("MuiLink",e)}const ze=ae("MuiLink",["root","underlineNone","underlineHover","underlineAlways","button","focusVisible"]),Oe=({theme:e,ownerState:t})=>{const s=t.color;if("colorSpace"in e&&e.colorSpace){const p=E(e,`palette.${s}.main`)||E(e,`palette.${s}`)||t.color;return e.alpha(p,.4)}const r=E(e,`palette.${s}.main`,!1)||E(e,`palette.${s}`,!1)||t.color,o=E(e,`palette.${s}.mainChannel`)||E(e,`palette.${s}Channel`);return"vars"in e&&o?`rgba(${o} / 0.4)`:ie(r,.4)},_={primary:!0,secondary:!0,error:!0,info:!0,success:!0,warning:!0,textPrimary:!0,textSecondary:!0,textDisabled:!0},Ne=e=>{const{classes:t,component:s,focusVisible:r,underline:o}=e,p={root:["root",`underline${V(o)}`,s==="button"&&"button",r&&"focusVisible"]};return ue(p,qe,t)},Ge=pe(C,{name:"MuiLink",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:s}=e;return[t.root,t[`underline${V(s.underline)}`],s.component==="button"&&t.button]}})(fe(({theme:e})=>({variants:[{props:{underline:"none"},style:{textDecoration:"none"}},{props:{underline:"hover"},style:{textDecoration:"none","&:hover":{textDecoration:"underline"}}},{props:{underline:"always"},style:{textDecoration:"underline","&:hover":{textDecorationColor:"inherit"}}},{props:({underline:t,ownerState:s})=>t==="always"&&s.color!=="inherit",style:{textDecorationColor:"var(--Link-underlineColor)"}},{props:({underline:t,ownerState:s})=>t==="always"&&s.color==="inherit",style:e.colorSpace?{textDecorationColor:e.alpha("currentColor",.4)}:null},...Object.entries(e.palette).filter(he()).map(([t])=>({props:{underline:"always",color:t},style:{"--Link-underlineColor":e.alpha((e.vars||e).palette[t].main,.4)}})),{props:{underline:"always",color:"textPrimary"},style:{"--Link-underlineColor":e.alpha((e.vars||e).palette.text.primary,.4)}},{props:{underline:"always",color:"textSecondary"},style:{"--Link-underlineColor":e.alpha((e.vars||e).palette.text.secondary,.4)}},{props:{underline:"always",color:"textDisabled"},style:{"--Link-underlineColor":(e.vars||e).palette.text.disabled}},{props:{component:"button"},style:{position:"relative",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none","&::-moz-focus-inner":{borderStyle:"none"},[`&.${ze.focusVisible}`]:{outline:"auto"}}}]}))),He=f.forwardRef(function(t,s){const r=le({props:t,name:"MuiLink"}),o=ce(),{className:p,color:a="primary",component:i="a",onBlur:l,onFocus:c,TypographyClasses:u,underline:d="always",variant:h="inherit",sx:y,...b}=r,[m,g]=f.useState(!1),v=w=>{F(w.target)||g(!1),l&&l(w)},S=w=>{F(w.target)&&g(!0),c&&c(w)},j={...r,color:a,component:i,focusVisible:m,underline:d,variant:h},k=Ne(j);return n.jsx(Ge,{color:a,className:de(k.root,p),classes:u,component:i,onBlur:v,onFocus:S,ref:s,ownerState:j,variant:h,...b,sx:[..._[a]===void 0?[{color:a}]:[],...Array.isArray(y)?y:[y]],style:{...b.style,...d==="always"&&a!=="inherit"&&!_[a]&&{"--Link-underlineColor":Oe({theme:o,ownerState:j})}}})});function Xe(e,t,s){const r=xe(),{reports:o,settled:p,isError:a}=I(e,t,We(s)),i=p&&!a;return f.useCallback((l,c)=>{const u=l.path;if(!me(u))return"malformed";const d=ye(u,o),h=A(q(e,t,d.kind==="path"?d.report.path:u),e,t,s),y=new URLSearchParams(l.givens).toString();return r(h+(y?`?${y}`:""),c),d.kind==="path"?"resolved":i?"unresolved":"unverified"},[r,e,t,s,o,i])}const Ke='[data-tile-kind="query"]',Ye=".malloy-render, .malloy-table, [role='alert'], .MuiAlert-root",Ze=3e3;function te(e,t,s,r){const o=f.useRef(s);o.current=s;const p=f.useRef(!1);f.useEffect(()=>{if(!o.current||p.current)return;let a=0;const i={},l=()=>{clearTimeout(u),i.beat!==void 0&&clearInterval(i.beat),cancelAnimationFrame(a),i.observer?.disconnect()},c=()=>{p.current||(p.current=!0,l(),o.current?.())},u=setTimeout(c,Ze);if(!t)return()=>clearTimeout(u);const d=()=>{const h=e.current;if(!h||r&&h.querySelector(r)===null)return;const y=window.innerHeight;[...h.querySelectorAll(Ke)].filter(m=>{if(m.getBoundingClientRect().top>=y)return!1;const v=m.querySelector(Ye);return!v||v.getBoundingClientRect().height<8}).length===0&&a===0&&(a=requestAnimationFrame(()=>{a=requestAnimationFrame(c)}))};return i.observer=new MutationObserver(d),e.current&&i.observer.observe(e.current,{childList:!0,subtree:!0}),i.beat=setInterval(d,50),d(),l},[t,e,r])}function ne({environmentName:e,packageName:t,versionId:s,path:r,editable:o=r.endsWith(".malloy"),onReady:p}){const a=f.useRef(null);te(a,!0,p,`.${be.report}`);const{params:i,onGivensChange:l}=z(),{versionSegment:c}=J(),u=Xe(e,t,c),d=Ve(e,t,c),h=f.useMemo(()=>O({environmentName:e,packageName:t}),[e,t]),y=N();return f.useEffect(()=>{if(!o||y)return;const b=()=>void ve(()=>import("./index.es-AXVff-Xr.js"),__vite__mapDeps([0,1,2,3])),m=window.requestIdleCallback;if(m){const v=m(b);return()=>window.cancelIdleCallback?.(v)}const g=setTimeout(b,1500);return()=>clearTimeout(g)},[o,y]),n.jsx(x,{ref:a,sx:Q,children:r.endsWith(".malloynb")?n.jsx(ge,{resourceUri:R({environmentName:e,packageName:t,modelPath:r,versionId:s}),givens:i,onGivensChange:l,onNavigate:d,onDrillNavigate:u,maxResultSize:1024*1024}):n.jsx(G,{resourceUri:R({environmentName:e,packageName:t,versionId:s}),path:r,givens:i,onGivensChange:l,onNavigate:u,onLinkNavigate:d,onEvent:h,maxResultSize:1024*1024})})}function Je(){const[e,t]=f.useState(!1),s=f.useRef(!1),r=f.useRef(!1),o=f.useCallback(l=>{s.current=l,t(l)},[]),p=f.useCallback(()=>{r.current=!0},[]),a=je(f.useCallback(({currentLocation:l,nextLocation:c})=>s.current&&!r.current&&(l.pathname!==c.pathname||L(l.search)!==L(c.search)),[]));f.useEffect(()=>{if(!e)return;const l=c=>{c.preventDefault(),c.returnValue=""};return window.addEventListener("beforeunload",l),()=>window.removeEventListener("beforeunload",l)},[e]);const i=n.jsx(ke,{open:a.state==="blocked",canSave:!1,onKeepEditing:()=>a.reset?.(),onDiscard:()=>a.proceed?.()});return{onDirtyChange:o,leaving:p,dialog:i}}const Qe=X.lazy(()=>ee().then(e=>({default:e.ReportEditor}))),et=X.lazy(()=>ee().then(e=>({default:e.BuilderBar})));function tt(){const[e,t]=f.useState(null);return f.useEffect(()=>{t(document.getElementById("header-actions-portal"))},[]),e}function se({environmentName:e,packageName:t,path:s,layout:r="grid",onReady:o,quietLoading:p=!1,offstage:a=!1}){const i=Je();Ie();const[l]=f.useState(we),c=Ce(),{pathname:u,search:d}=D(),h=tt(),[y,b]=f.useState(),m=f.useRef(null),g=N();te(m,y!==void 0||g,o);const v=()=>c(`${u.replace(/\/$/,"")}${Be(d)}`),S=f.useMemo(()=>O({environmentName:e,packageName:t}),[e,t]),j=n.jsx(G,{resourceUri:R({environmentName:e,packageName:t}),path:s,manifestStaleTime:1e4});return n.jsxs(x,{ref:m,sx:Q,children:[n.jsx(Ee,{children:n.jsx(f.Suspense,{fallback:p?null:j,children:n.jsx(Qe,{resourceUri:R({environmentName:e,packageName:t}),path:s,layout:r,keepDraft:l,onDirtyChange:i.onDirtyChange,onExit:v,onOpenModel:k=>c(`/${[e,t,...k.split("/")].map(encodeURIComponent).join("/")}`),onEvent:S,loading:p?null:j,onControlsChange:b},`${e}/${t}/${s}`)})}),i.dialog,h&&!a&&Re.createPortal(n.jsx(f.Suspense,{fallback:n.jsx(H,{variant:"contained",disableElevation:!0,onClick:v,children:"Done"}),children:n.jsx(et,{controls:y,onDone:v})}),h)]})}function nt({environmentName:e,packageName:t,versionSegment:s,routePath:r,edit:o,reports:p,children:a}){const{search:i}=D(),l=d=>A(q(e,t,d),e,t,s),c=Se(r);if(!c)return n.jsx(n.Fragment,{children:a});const u=De(c.name,p,c.prefer);return"found"in u?n.jsx(K,{replace:!0,to:`${l(u.found.path)}${o?Z(i):i}`}):"ambiguous"in u?n.jsxs(x,{sx:$,children:[n.jsxs(C,{variant:"h6",sx:{fontWeight:"fontWeightMedium"},children:["More than one report is named ",c.name]}),n.jsx(C,{variant:"body2",color:"text.secondary",sx:{mt:1},children:"This is an old link, which names a report by its file name alone. Open one by its path:"}),n.jsx(x,{component:"ul",sx:{mt:1},children:u.ambiguous.map(d=>n.jsx("li",{children:n.jsx($e,{to:l(d),style:{fontFamily:Y},children:d})},d))})]}):n.jsx(n.Fragment,{children:a})}function st({environmentName:e,packageName:t,routePath:s,edit:r,notFound:o,notFoundUntilListed:p=!1,versionId:a,versionSegment:i,readOnly:l=!1}){const{reports:c,settled:u,isFetching:d,isError:h,refetch:y}=I(e,t,a),{search:b}=D(),m=`${s}.malloy`,g=u?Le(m,c):void 0,v=u&&!d&&!h,[S,j]=f.useState();f.useEffect(()=>{v&&j(m)},[v,m]);const k=g!==void 0||v||S===m,w=Ae(e,t,m,r&&!l&&k&&!g),T=re=>n.jsx(nt,{environmentName:e,packageName:t,...i!==void 0?{versionSegment:i}:{},routePath:s,edit:r,reports:c,children:re});if(!k&&(p&&!r&&!g))return T(o);if(!k&&h&&!d)return n.jsx(x,{sx:$,children:n.jsxs(Te,{severity:"warning",action:n.jsx(H,{color:"inherit",size:"small",onClick:()=>void y(),children:"Retry"}),children:["Could not list this package's reports, so this page cannot tell what is at ",s,"."]})});if(!k)return n.jsx(P,{text:U.opening()});if(g)return n.jsx(rt,{environmentName:e,packageName:t,...a!==void 0?{versionId:a}:{},path:g.path,editable:l?!1:g.editable,layout:g.layout,edit:r&&!l});const M=r?void 0:_e(s);return M!==void 0?n.jsx(K,{replace:!0,to:`${A(`/${e}/${t}/${M.split("/").map(encodeURIComponent).join("/")}`,e,t,i)}${Z(b)}`}):T(r&&!l?w.settled?n.jsx(se,{environmentName:e,packageName:t,path:m,layout:w.layout??"grid"}):n.jsx(P,{text:U.opening()}):o)}function rt({environmentName:e,packageName:t,versionId:s,path:r,editable:o,layout:p,edit:a}){const[i,l]=f.useState(a?"editor":"reader"),c=a?"editor":"reader",u=c==="reader"||i==="reader",d=c==="editor"||i==="editor",h={position:"absolute",inset:0,visibility:"hidden",pointerEvents:"none",overflow:"hidden"};return n.jsxs(x,{sx:{position:"relative"},"data-switching":u&&d||void 0,children:[u&&n.jsx(x,{sx:i==="reader"?void 0:h,"aria-hidden":i!=="reader"||void 0,children:n.jsx(ne,{environmentName:e,packageName:t,...s!==void 0?{versionId:s}:{},path:r,...o!==void 0?{editable:o}:{},onReady:()=>{a||l("reader")}})},"reader"),d&&n.jsx(x,{sx:i==="editor"?void 0:h,"aria-hidden":i!=="editor"||void 0,children:n.jsx(se,{environmentName:e,packageName:t,path:r,...p?{layout:p}:{},quietLoading:u,offstage:c!=="editor"||i!=="editor",onReady:()=>{a&&l("editor")}})},"editor")]})}function pt(){const e=Me(),{search:t}=D(),{path:s,versionId:r,versionSegment:o,writable:p}=J({always:!0}),{server:a}=Fe(),{params:i,onGivensChange:l}=z();if(!e.environmentName)return n.jsx("div",{children:n.jsx("h2",{children:"Missing environment name"})});if(!e.packageName)return n.jsx("div",{children:n.jsx("h2",{children:"Missing package name"})});if(s!==void 0&&s!==""&&!s.endsWith(".malloy")&&!s.endsWith(".malloynb")){const u=s.replace(/\/$/,""),d=u.startsWith("data-apps/"),h=d?n.jsx(Pe,{resourceUri:R({environmentName:e.environmentName,packageName:e.packageName,modelPath:u.slice(10),versionId:r})}):n.jsx(W,{environmentName:e.environmentName,packageName:e.packageName,modelPath:s,staticUrl:B({server:a,environmentName:e.environmentName,packageName:e.packageName,path:s,...r!==void 0?{versionId:r}:{}})});return n.jsx(st,{environmentName:e.environmentName,packageName:e.packageName,...r!==void 0?{versionId:r}:{},...o!==void 0?{versionSegment:o}:{},readOnly:!p,routePath:u,edit:L(t),notFound:h,notFoundUntilListed:d})}const c=R({environmentName:e.environmentName,packageName:e.packageName,modelPath:s,versionId:r});return s?.endsWith(".malloy")?n.jsx(x,{sx:$,children:n.jsx(Ue,{resourceUri:c,runOnDemand:!0,maxResultSize:512*1024,givens:i,onGivensChange:l})}):s?.endsWith(".malloynb")?n.jsx(ne,{environmentName:e.environmentName,packageName:e.packageName,...r!==void 0?{versionId:r}:{},path:s,editable:!1}):n.jsx(W,{environmentName:e.environmentName,packageName:e.packageName,modelPath:s??"",staticUrl:B({server:a,environmentName:e.environmentName,packageName:e.packageName,path:s??"",...r!==void 0?{versionId:r}:{}})})}function W({packageName:e,modelPath:t,staticUrl:s}){const r=/\.[^./]+$/.test(t),o={fontFamily:Y};return n.jsxs(x,{sx:$,children:[n.jsx(C,{variant:"h6",sx:{fontWeight:"fontWeightMedium"},children:"Nothing to open at this path"}),n.jsxs(C,{variant:"body2",color:"text.secondary",sx:{mt:1},children:[n.jsx(x,{component:"span",sx:o,children:t})," ","does not name a report, a"," ",n.jsx(x,{component:"span",sx:o,children:".malloy"})," ","or a"," ",n.jsx(x,{component:"span",sx:o,children:".malloynb"})," ","file in package"," ",n.jsx(x,{component:"span",sx:o,children:e}),". This address opens reports by their path without"," ",n.jsx(x,{component:"span",sx:o,children:".malloy"}),", and"," ",n.jsx(x,{component:"span",sx:o,children:".malloy"})," ","and"," ",n.jsx(x,{component:"span",sx:o,children:".malloynb"})," ","files."]}),r&&n.jsxs(C,{variant:"body2",color:"text.secondary",sx:{mt:1},children:["A file from the package's"," ",n.jsx(x,{component:"span",sx:o,children:"public/"})," ","directory is served at ",n.jsx(He,{href:s,children:s}),"."]}),n.jsx(C,{variant:"body2",color:"text.secondary",sx:{mt:1},children:"The package lists its reports, models, and data apps."})]})}export{pt as default};
@@ -0,0 +1 @@
1
+ import{A as x,p as N,E as f,r as h,a5 as j,j as n,a6 as E,a7 as P,a8 as R}from"./index-D8JKtZm5.js";import{d as L}from"./documentRoutes-DnpGGXs4.js";import{u as M,p as r,L as c}from"./usePackageRoute-BUdFd5dP.js";import{u as S}from"./usePackageLinkNavigate-DpGlRKnc.js";function $(){const{environmentName:e,packageName:a,versionSegment:o,versionId:m,versioned:u}=M({always:!0}),{search:p}=x(),g=N(),v=f(),i=S(e??"",a??"",o),l=h.useMemo(()=>j({environmentName:e??"",packageName:a??""}),[e,a]);if(e){if(!a)return n.jsx("div",{children:n.jsx("h2",{children:"Missing package name"})})}else return n.jsx("div",{children:n.jsx("h2",{children:"Missing environment name"})});if(u&&o===void 0)return n.jsx(E,{to:`${r(e,a,c)}${p}`,replace:!0});const d=P({environmentName:e,packageName:a,versionId:m});return n.jsx(R,{onClickPackageFile:i,onOpenDocument:({path:s,mode:t},k)=>i(L(e,a,s,t),k),onSelectVersion:(s,t)=>g(r(e,a,s),t),onReplaceVersion:s=>v(r(e,a,s??c),{replace:!0}),resourceUri:d,onEvent:l})}export{$ as default};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ModelPage-GZ6hXGgw.js","assets/index-D8JKtZm5.js","assets/index-DUqldpo0.css","assets/documentRoutes-DnpGGXs4.js","assets/usePackageRoute-BUdFd5dP.js","assets/usePackageLinkNavigate-DpGlRKnc.js","assets/editPageMounted-efTmRdGK.js","assets/PackagePage-_5vFWxqm.js"])))=>i.map(i=>d[i]);
2
+ import{A as P,E as g,r as h,j as e,I as x,a1 as f,a2 as A,a3 as c,a4 as d}from"./index-D8JKtZm5.js";import{u as R,w as S,L as T}from"./usePackageRoute-BUdFd5dP.js";const j=1200,u={p:3,maxWidth:j,mx:"auto"},b={...u,pt:6},y=c.lazy(()=>d(()=>import("./ModelPage-GZ6hXGgw.js"),__vite__mapDeps([0,1,2,3,4,5,6]))),k=c.lazy(()=>d(()=>import("./PackagePage-_5vFWxqm.js"),__vite__mapDeps([7,1,2,3,4,5])));function L(){const{environmentName:l,packageName:_,versionSegment:s,path:a,versioned:p,deciding:m,undecided:E,retry:v}=R({always:!0}),{pathname:o,search:r,hash:n}=P(),i=g(),t=p&&s===void 0?S(o,l??"",_??"",T):void 0;return h.useEffect(()=>{t!==void 0&&t!==o&&i(`${t}${r}${n}`,{replace:!0})},[t,o,r,n,i]),m?null:E?e.jsx(x,{sx:u,children:e.jsx(f,{severity:"error",action:e.jsx(A,{color:"inherit",size:"small",onClick:v,children:"Retry"}),children:"Could not read this package's versions, so this address can't be opened yet."})}):s!==void 0&&(a===void 0||a===""||a==="/")?e.jsx(k,{}):e.jsx(y,{})}const z=Object.freeze(Object.defineProperty({__proto__:null,default:L},Symbol.toStringTag,{value:"Module"}));export{u as P,b as T,z as a};
@@ -1,5 +1,5 @@
1
- import{ae as fe,j as O,H as ie,r as g,aV as pe,U as ge,aW as ve,aH as we,aX as ke,aY as Z,aZ as H,a_ as xe,a$ as Ce,b0 as Ae,b1 as Se,b2 as Ee,b3 as ze,b4 as De,b5 as ue,b6 as se}from"./index-CGKV9Dxi.js";const v=fe.drillCell;function $e(e,t){const r=new Set;let a;try{a=e.getMetadata()?.getAllFields()??[]}catch{return r}const o=new Set;for(const n of a)!n||t(n)||n.tag?.tag("hidden")===void 0&&o.add(n.tag?.text("label")??n.name);for(const n of a){if(!n||!t(n))continue;const l=n.tag?.text("label")??n.name;o.has(l)||r.add(l)}return r}function L(e){const t=/^\s*(\d+)/.exec(e.style?.gridColumn??"");return t?t[1]:void 0}function je(e,t){if(t.size!==0)for(const r of e.querySelectorAll(".malloy-table")){const a=l=>l.closest(".malloy-table")===r,o=new Set;for(const l of r.querySelectorAll(".column-cell.th")){if(!a(l))continue;const i=(l.textContent??"").replace(/\u200b/g,"").trim(),b=L(l);b&&t.has(i)&&o.add(b)}if(o.size===0)continue;const n=new Set;for(const l of r.querySelectorAll(`.${v}[tabindex="0"]`)){if(!a(l))continue;const i=L(l);i&&(n.has(i)?l.tabIndex=-1:n.add(i))}for(const l of r.querySelectorAll(".column-cell.td")){if(!a(l))continue;const i=L(l),b=!l.querySelector(".value-null")&&(l.textContent??"").trim()!=="";if(i&&b&&o.has(i)&&!l.querySelector(".malloy-table")){if(l.classList.add(v),l.tabIndex===0)n.add(i);else{const f=n.has(i);f||n.add(i),l.tabIndex=f?-1:0}l.setAttribute("role","button")}}}}function Fe(e){const t=e.closest(".malloy-table"),r=L(e);return!t||!r?[]:Array.from(t.querySelectorAll(`.${v}`)).filter(a=>a.closest(".malloy-table")===t&&L(a)===r)}function de(e,t){const r=Fe(e),a=r.indexOf(e);if(a===-1)return;const o=t==="first"?r[0]:t==="last"?r[r.length-1]:r[Math.min(Math.max(a+t,0),r.length-1)];if(o){for(const n of r)n.tabIndex=n===o?0:-1;return o}}function Me(e){return{background:e.dashboardRoot,tableBackground:e.tableBackground,tableHeaderColor:e.tableHeader,tableBodyColor:e.tableBody,tableBorder:e.border,tablePinnedBackground:e.tableHeaderBackground,tablePinnedBorder:e.pinnedBorder,tableFontSize:`${e.font.size}px`,fontFamily:e.font.family,mapColor:e.mapColor}}function Re(e){const{foreground:t,axisFaint:r,gridline:a,font:o}=e,n={background:e.background,font:o.family,title:{color:t,font:o.family},axis:{labelColor:t,titleColor:t,domainColor:r,tickColor:r,gridColor:a,labelFont:o.family,titleFont:o.family},legend:{labelColor:t,titleColor:t,labelFont:o.family,titleFont:o.family},header:{labelColor:t,titleColor:t},range:{category:e.series}},l={...n,legend:{...n.legend,orient:"bottom"}};return i=>i==="shape_map"?l:n}function Te(e){if(!e)return;const t=e.tag("theme");if(!t)return;const r={},a=t.tag("palette");if(a){const n={},l=a.textArray("series");l&&l.length>0&&(n.series=l);for(const i of pe){const b=a.tag(i);if(!b)continue;const f={},x=b.text("light"),k=b.text("dark");x&&(f.light=x),k&&(f.dark=k),Object.keys(f).length>0&&(n[i]=f)}Object.keys(n).length>0&&(r.palette=n)}const o=t.tag("font");if(o){const n={},l=o.text("family");l&&(n.family=l);const i=o.numeric("size");typeof i=="number"&&Number.isFinite(i)&&(n.size=i),Object.keys(n).length>0&&(r.font=n)}return Object.keys(r).length>0?r:void 0}const G=e=>(e??[]).map(t=>t?.value).filter(t=>typeof t=="string");function _e(e){const t=e.replace(/[-_]+/g," ").replace(/\s+/g," ").trim();return t.charAt(0).toUpperCase()+t.slice(1)}const Oe=e=>G(e.annotations).some(t=>{const r=t.trim();return/^#[^("]/.test(r)&&/(?:^#|[\s{])label\s*=/.test(r)}),Be=e=>`"${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`,Le=e=>e.type?.element_type?.fields??e.type?.fields;function me(e,t){let r=!1;return{fields:e.map(a=>{const o=Le(a);if(o){const l=me(o,ue(G(a.annotations)));if(!l.changed)return a;r=!0;const i=a.type?.element_type?{...a.type,element_type:{...a.type.element_type,fields:l.fields}}:{...a.type,fields:l.fields};return{...a,type:i}}if(!t||!a.name||Oe(a))return a;const n=_e(a.name);return n===a.name?a:(r=!0,{...a,annotations:[{value:`# label=${Be(n)}
2
- `},...a.annotations??[]]})}),changed:r}}function Ie(e){if(!e||typeof e!="object")return e;const t=e,r=t.schema?.fields;if(!Array.isArray(r))return e;const{fields:a,changed:o}=me(r,ue(G(t.annotations)));return o?{...t,schema:{...t.schema,fields:a}}:e}const ce=320,qe=10,Ne=96,Pe=4e3;function Ye(e,t){if(e!=="bar"&&e!=="combo"&&e!=="line"&&e!=="chart"&&e!=="scatter_chart")return;if(e!=="bar"&&e!=="combo")return ce;const r=t?.data?.array_value?.length,a=r===void 0?0:r*qe+Ne;return Math.min(Math.max(ce,a),Pe)}function He(e){let t;return{onClick:r=>{const a={...r,...Ve(r)};t=a,queueMicrotask(()=>{t===a&&(t=void 0),e(a)})},onDrill:r=>{const a=t;t=void 0,a&&r.stableDrillClauses!==void 0&&(a.drillClauses=r.stableDrillClauses)}}}function Ve(e){const t=e.field;try{const r=t?.getEffectiveQueryTimezone?.();return r?{timezone:r}:{}}catch{return{}}}function Ue(e){const t=r=>{let a=!1;try{a=r.isArray?.()===!0}catch{a=!1}a&&"stableDrillFilters"in r&&Object.defineProperty(r,"stableDrillFilters",{configurable:!0,get:()=>[]});for(const o of r.fields??[])t(o)};e&&t(e)}const B="data-publisher-fill",We=async(e,t,r)=>{if(typeof window>"u")throw new Error("MalloyRenderer can only be used in browser environment");const{MalloyRenderer:a}=await Ce();return new a({onClick:t,...r?{onDrill:r,tableConfig:{enableDrill:!0}}:{},vegaConfigOverride:Re(e),theme:Me(e),onError:o=>{console.error("Error rendering visualization:",typeof o,o)}}).createViz()};async function Xe(e){if(!e||typeof e!="object")return;const t=e,r=[...Array.isArray(t.model_annotations)?t.model_annotations:[],...Array.isArray(t.source_annotations)?t.source_annotations:[],...Array.isArray(t.annotations)?t.annotations:[]].map(o=>typeof o?.value=="string"?o.value:void 0).filter(o=>!!o);if(r.length===0)return;let a;try{({parseAnnotation:a}=await xe())}catch{return}try{const{tag:o}=a(r);return Te(o)}catch(o){console.warn("Failed to parse # theme.* annotations; chart will render with the shell theme.",{error:o,lines:r});return}}function Ke(e,t,r){const a=Ae(t,r);for(const[o,n]of Object.entries(a))e.style.setProperty(o,n)}const Je=`
1
+ import{aw as fe,j as O,I as ie,r as g,ax as pe,U as ge,ay as ve,ah as we,az as ke,aA as G,aB as H,aC as xe,aD as Ce,aE as Ae,aF as De,aG as Ee,aH as Se,aI as ze,aJ as ue,aK as se}from"./index-D8JKtZm5.js";const v=fe.drillCell;function $e(e,t){const r=new Set;let a;try{a=e.getMetadata()?.getAllFields()??[]}catch{return r}const o=new Set;for(const n of a)!n||t(n)||n.tag?.tag("hidden")===void 0&&o.add(n.tag?.text("label")??n.name);for(const n of a){if(!n||!t(n))continue;const l=n.tag?.text("label")??n.name;o.has(l)||r.add(l)}return r}function I(e){const t=/^\s*(\d+)/.exec(e.style?.gridColumn??"");return t?t[1]:void 0}function Fe(e,t){if(t.size!==0)for(const r of e.querySelectorAll(".malloy-table")){const a=l=>l.closest(".malloy-table")===r,o=new Set;for(const l of r.querySelectorAll(".column-cell.th")){if(!a(l))continue;const i=(l.textContent??"").replace(/\u200b/g,"").trim(),b=I(l);b&&t.has(i)&&o.add(b)}if(o.size===0)continue;const n=new Set;for(const l of r.querySelectorAll(`.${v}[tabindex="0"]`)){if(!a(l))continue;const i=I(l);i&&(n.has(i)?l.tabIndex=-1:n.add(i))}for(const l of r.querySelectorAll(".column-cell.td")){if(!a(l))continue;const i=I(l),b=!l.querySelector(".value-null")&&(l.textContent??"").trim()!=="";if(i&&b&&o.has(i)&&!l.querySelector(".malloy-table")){if(l.classList.add(v),l.tabIndex===0)n.add(i);else{const f=n.has(i);f||n.add(i),l.tabIndex=f?-1:0}l.setAttribute("role","button")}}}}function je(e){const t=e.closest(".malloy-table"),r=I(e);return!t||!r?[]:Array.from(t.querySelectorAll(`.${v}`)).filter(a=>a.closest(".malloy-table")===t&&I(a)===r)}function de(e,t){const r=je(e),a=r.indexOf(e);if(a===-1)return;const o=t==="first"?r[0]:t==="last"?r[r.length-1]:r[Math.min(Math.max(a+t,0),r.length-1)];if(o){for(const n of r)n.tabIndex=n===o?0:-1;return o}}function Re(e){return{background:e.dashboardRoot,tableBackground:e.tableBackground,tableHeaderColor:e.tableHeader,tableBodyColor:e.tableBody,tableBorder:e.border,tablePinnedBackground:e.tableHeaderBackground,tablePinnedBorder:e.pinnedBorder,tableFontSize:`${e.font.size}px`,fontFamily:e.font.family,mapColor:e.mapColor}}function Me(e){const{foreground:t,axisFaint:r,gridline:a,font:o}=e,n={background:e.background,font:o.family,title:{color:t,font:o.family},axis:{labelColor:t,titleColor:t,domainColor:r,tickColor:r,gridColor:a,labelFont:o.family,titleFont:o.family},legend:{labelColor:t,titleColor:t,labelFont:o.family,titleFont:o.family},header:{labelColor:t,titleColor:t},range:{category:e.series}},l={...n,legend:{...n.legend,orient:"bottom"}};return i=>i==="shape_map"?l:n}function Te(e){if(!e)return;const t=e.tag("theme");if(!t)return;const r={},a=t.tag("palette");if(a){const n={},l=a.textArray("series");l&&l.length>0&&(n.series=l);for(const i of pe){const b=a.tag(i);if(!b)continue;const f={},x=b.text("light"),k=b.text("dark");x&&(f.light=x),k&&(f.dark=k),Object.keys(f).length>0&&(n[i]=f)}Object.keys(n).length>0&&(r.palette=n)}const o=t.tag("font");if(o){const n={},l=o.text("family");l&&(n.family=l);const i=o.numeric("size");typeof i=="number"&&Number.isFinite(i)&&(n.size=i),Object.keys(n).length>0&&(r.font=n)}return Object.keys(r).length>0?r:void 0}const Q=e=>(e??[]).map(t=>t?.value).filter(t=>typeof t=="string");function _e(e){const t=e.replace(/[-_]+/g," ").replace(/\s+/g," ").trim();return t.charAt(0).toUpperCase()+t.slice(1)}const Oe=e=>Q(e.annotations).some(t=>{const r=t.trim();return/^#[^("]/.test(r)&&/(?:^#|[\s{])label\s*=/.test(r)}),Be=e=>`"${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`,Ie=e=>e.type?.element_type?.fields??e.type?.fields;function me(e,t){let r=!1;return{fields:e.map(a=>{const o=Ie(a);if(o){const l=me(o,ue(Q(a.annotations)));if(!l.changed)return a;r=!0;const i=a.type?.element_type?{...a.type,element_type:{...a.type.element_type,fields:l.fields}}:{...a.type,fields:l.fields};return{...a,type:i}}if(!t||!a.name||Oe(a))return a;const n=_e(a.name);return n===a.name?a:(r=!0,{...a,annotations:[{value:`# label=${Be(n)}
2
+ `},...a.annotations??[]]})}),changed:r}}function Le(e){if(!e||typeof e!="object")return e;const t=e,r=t.schema?.fields;if(!Array.isArray(r))return e;const{fields:a,changed:o}=me(r,ue(Q(t.annotations)));return o?{...t,schema:{...t.schema,fields:a}}:e}const ce=320,qe=10,Ne=96,Pe=4e3;function Ye(e,t){if(e!=="bar"&&e!=="combo"&&e!=="line"&&e!=="chart"&&e!=="scatter_chart")return;if(e!=="bar"&&e!=="combo")return ce;const r=t?.data?.array_value?.length,a=r===void 0?0:r*qe+Ne;return Math.min(Math.max(ce,a),Pe)}function He(e){let t;return{onClick:r=>{const a={...r,...Ue(r)};t=a,queueMicrotask(()=>{t===a&&(t=void 0),e(a)})},onDrill:r=>{const a=t;t=void 0,a&&r.stableDrillClauses!==void 0&&(a.drillClauses=r.stableDrillClauses)}}}function Ue(e){const t=e.field;try{const r=t?.getEffectiveQueryTimezone?.();return r?{timezone:r}:{}}catch{return{}}}function Ve(e){const t=r=>{let a=!1;try{a=r.isArray?.()===!0}catch{a=!1}a&&"stableDrillFilters"in r&&Object.defineProperty(r,"stableDrillFilters",{configurable:!0,get:()=>[]});for(const o of r.fields??[])t(o)};e&&t(e)}const B="data-publisher-fill",Ke=async(e,t,r)=>{if(typeof window>"u")throw new Error("MalloyRenderer can only be used in browser environment");const{MalloyRenderer:a}=await Ce();return new a({onClick:t,...r?{onDrill:r,tableConfig:{enableDrill:!0}}:{},vegaConfigOverride:Me(e),theme:Re(e),onError:o=>{console.error("Error rendering visualization:",typeof o,o)}}).createViz()};async function We(e){if(!e||typeof e!="object")return;const t=e,r=[...Array.isArray(t.model_annotations)?t.model_annotations:[],...Array.isArray(t.source_annotations)?t.source_annotations:[],...Array.isArray(t.annotations)?t.annotations:[]].map(o=>typeof o?.value=="string"?o.value:void 0).filter(o=>!!o);if(r.length===0)return;let a;try{({parseAnnotation:a}=await xe())}catch{return}try{const{tag:o}=a(r);return Te(o)}catch(o){console.warn("Failed to parse # theme.* annotations; chart will render with the shell theme.",{error:o,lines:r});return}}function Je(e,t,r){const a=Ae(t,r);for(const[o,n]of Object.entries(a))e.style.setProperty(o,n)}const Xe=`
3
3
  /* Card geometry, through the renderer's OWN theme vars rather than over the top
4
4
  of them. It declares --malloy-theme--dashboard-* on .malloy-render itself and
5
5
  passes each through to the --malloy-render--* the card CSS reads, so a value
@@ -176,4 +176,4 @@ div.malloy-render .malloy-dashboard .dashboard-row-header {
176
176
  .malloy-render .malloy-table .td.highlight:not(.${v}) {
177
177
  cursor: inherit;
178
178
  }
179
- `,he="publisher-malloy-renderer-overrides";function Ze(){if(typeof document>"u"||document.getElementById(he))return;const e=document.createElement("style");e.id=he,e.textContent=Je,document.head.appendChild(e)}function Ge({result:e,height:t,drill:r,onSizeChange:a,onSizing:o,fill:n}){const l=g.useRef(null),i=g.useRef(r);i.current=r;const b=g.useMemo(()=>He(d=>i.current?.onClick(d)),[]),f=r!==void 0,x=g.useRef(!1),k=g.useRef(null),V=g.useRef(0),{theme:I,layers:U,mode:Q}=ge(),ee=g.useMemo(()=>({radius:I.ui.radius.tile,padding:`${ve}px`}),[I.ui.radius.tile]);return g.useEffect(()=>()=>{V.current+=1;const d=k.current;d?.viz.remove(),d?.node.remove(),k.current=null},[]),g.useLayoutEffect(()=>{if(!l.current||!e)return;Ze();const d=l.current,be=V.current+=1;let W=!1;const X=()=>!W&&be===V.current;let c,y,q=null,K=0,N=null,P=null,Y=null,F=null,M=null,R=null,te=null,re=0,z=null;x.current=!1;let p,D;const J=w=>{if(W||!w.firstElementChild||Z(p,D)==="container")return;const T=Se(p,D);if(x.current&&!T)return;const _=d.hasAttribute(B);_&&d.removeAttribute(B);const C=d.closest(`.${Ee}`),h=C?.style.overflowY;C&&(C.style.overflowY="hidden");const $=ze(w,se(p));C&&(C.style.overflowY=h??""),_&&d.setAttribute(B,""),$>0&&(x.current=!0,a&&$!==re&&(re=$,a($)));const A=De(w,se(p));T&&A&&te!==A&&(te=A,R?.disconnect(),R=new ResizeObserver(()=>J(w)),R.observe(A))};return(async()=>{let w;try{w=JSON.parse(e)}catch(m){console.error("Error parsing visualization result:",m);return}const T=await Xe(w),_=T?we([...U,ke(U,T)],Q):I;if(!X())return;try{y=await We(_,b.onClick,f?b.onDrill:void 0)}catch(m){console.error("Failed to create renderer:",m);return}if(!X()){y.remove(),y=void 0;return}const C=k.current;c=document.createElement("div"),c.style.width="100%",c.style.height="100%",Ke(c,_,ee),d.childElementCount>0&&(d.style.position="relative",c.style.position="absolute",c.style.inset="0",c.style.visibility="hidden"),d.appendChild(c);const h=c;F=new MutationObserver(()=>{M&&clearTimeout(M),M=setTimeout(()=>{J(h),x.current&&F?.disconnect()},100)}),F.observe(c,{childList:!0,subtree:!0,attributes:!0});const $=y;let A=!1;const ae=()=>{if(!(A||!X())){A=!0,z&&(clearTimeout(z),z=null),C?.viz.remove();for(const m of Array.from(d.children))m!==h&&d.removeChild(m);h.style.position="",h.style.inset="",h.style.visibility="",d.style.position="",k.current={viz:$,node:h},J(h)}};try{y.setResult(Ie(w));try{const S=y.getMetadata(),E=S?.getRootField();f&&Ue(E),p=E?.renderAs(),D=E?S?.getPluginsForField(E.key)?.[0]?.sizingStrategy:void 0}catch{p=void 0,D=void 0}o?.(Z(p,D),p),c.dataset.malloyRenderAs=p??"unknown",c.dataset.malloySizing=Z(p,D);const m=Ye(p,w);c.style.minWidth=m===void 0?"":`${m}px`,d.style.overflowX=m===void 0?"":"auto",d.style.overflowY=m===void 0?"":"hidden",y.render(c);const oe=i.current;try{if(oe){const S=$e(y,oe.canDrill),E=()=>{try{je(h,S)}catch(s){console.warn("Drill affordance skipped:",s)}};E();const ne=s=>{const u=s.querySelector(".cell-content")??s,j=u.getBoundingClientRect();u.dispatchEvent(new MouseEvent("click",{bubbles:!0,cancelable:!0,view:u.ownerDocument.defaultView,clientX:Math.round(j.left+j.width/2),clientY:Math.round(j.bottom)}))},le=s=>s.target?.closest?.(`.${v}`)??null,ye=(s,u)=>{de(s,u)?.focus()};N=s=>{const u=le(s);if(!u)return;const j=s.key==="ArrowDown"?1:s.key==="ArrowUp"?-1:s.key==="Home"?"first":s.key==="End"?"last":void 0;if(j!==void 0){s.preventDefault(),ye(u,j);return}s.key==="Enter"?(s.preventDefault(),ne(u)):s.key===" "&&s.preventDefault()},P=s=>{if(s.key!==" ")return;const u=le(s);u&&(s.preventDefault(),ne(u))},Y=s=>{const u=s.target?.closest?.(`.${v}`);u&&de(u,0)},h.addEventListener("keydown",N),h.addEventListener("keyup",P),h.addEventListener("focusin",Y),S.size>0&&typeof MutationObserver<"u"&&(q=new MutationObserver(()=>{cancelAnimationFrame(K),K=requestAnimationFrame(E)}),q.observe(h,{childList:!0,subtree:!0}))}}catch(S){console.warn("Drill affordance skipped:",S)}y.onReady(ae),z=setTimeout(ae,1e4)}catch(m){console.error("Error rendering visualization:",m),F?.disconnect(),R?.disconnect(),q?.disconnect(),y.remove(),y=void 0,h.parentNode===d&&d.removeChild(h)}})(),()=>{W=!0,F?.disconnect(),R?.disconnect(),M&&clearTimeout(M),z&&clearTimeout(z),c&&k.current?.node!==c&&(N&&c.removeEventListener("keydown",N),P&&c.removeEventListener("keyup",P),Y&&c.removeEventListener("focusin",Y),q?.disconnect(),cancelAnimationFrame(K),y?.remove(),c.parentNode===d&&d.removeChild(c),d.style.position="")}},[e,b,f,a,o,I,U,Q,ee]),O.jsx("div",{ref:l,...n?{[B]:""}:{},style:{width:"100%",height:t?`${t}px`:"400px"}})}function Qe(e){return typeof window>"u"?O.jsx(ie,{sx:{width:"100%",height:e.height?`${e.height}px`:"100%",display:"flex",alignItems:"center",justifyContent:"center",color:"text.secondary"},children:"Loading..."}):O.jsx(g.Suspense,{fallback:O.jsx(ie,{sx:{width:"100%",height:e.height?`${e.height}px`:"100%",display:"flex",alignItems:"center",justifyContent:"center",color:"text.secondary"},children:"Loading visualization..."}),children:O.jsx(Ge,{...e})})}const tt=Object.freeze(Object.defineProperty({__proto__:null,default:Qe},Symbol.toStringTag,{value:"Module"}));export{v as D,Qe as R,Re as a,Me as b,tt as c,$e as d,je as m,Te as r};
179
+ `,he="publisher-malloy-renderer-overrides";function Ge(){if(typeof document>"u"||document.getElementById(he))return;const e=document.createElement("style");e.id=he,e.textContent=Xe,document.head.appendChild(e)}function Qe({result:e,height:t,drill:r,onSizeChange:a,onSizing:o,fill:n}){const l=g.useRef(null),i=g.useRef(r);i.current=r;const b=g.useMemo(()=>He(d=>i.current?.onClick(d)),[]),f=r!==void 0,x=g.useRef(!1),k=g.useRef(null),U=g.useRef(0),{theme:L,layers:V,mode:Z}=ge(),ee=g.useMemo(()=>({radius:L.ui.radius.tile,padding:`${ve}px`}),[L.ui.radius.tile]);return g.useEffect(()=>()=>{U.current+=1;const d=k.current;d?.viz.remove(),d?.node.remove(),k.current=null},[]),g.useLayoutEffect(()=>{if(!l.current||!e)return;Ge();const d=l.current,be=U.current+=1;let K=!1;const W=()=>!K&&be===U.current;let c,y,q=null,J=0,N=null,P=null,Y=null,j=null,R=null,M=null,te=null,re=0,S=null;x.current=!1;let p,z;const X=w=>{if(K||!w.firstElementChild||G(p,z)==="container")return;const T=De(p,z);if(x.current&&!T)return;const _=d.hasAttribute(B);_&&d.removeAttribute(B);const C=d.closest(`.${Ee}`),h=C?.style.overflowY;C&&(C.style.overflowY="hidden");const $=Se(w,se(p));C&&(C.style.overflowY=h??""),_&&d.setAttribute(B,""),$>0&&(x.current=!0,a&&$!==re&&(re=$,a($)));const A=ze(w,se(p));T&&A&&te!==A&&(te=A,M?.disconnect(),M=new ResizeObserver(()=>X(w)),M.observe(A))};return(async()=>{let w;try{w=JSON.parse(e)}catch(m){console.error("Error parsing visualization result:",m);return}const T=await We(w),_=T?we([...V,ke(V,T)],Z):L;if(!W())return;try{y=await Ke(_,b.onClick,f?b.onDrill:void 0)}catch(m){console.error("Failed to create renderer:",m);return}if(!W()){y.remove(),y=void 0;return}const C=k.current;c=document.createElement("div"),c.style.width="100%",c.style.height="100%",Je(c,_,ee),d.childElementCount>0&&(d.style.position="relative",c.style.position="absolute",c.style.inset="0",c.style.visibility="hidden"),d.appendChild(c);const h=c;j=new MutationObserver(()=>{R&&clearTimeout(R),R=setTimeout(()=>{X(h),x.current&&j?.disconnect()},100)}),j.observe(c,{childList:!0,subtree:!0,attributes:!0});const $=y;let A=!1;const ae=()=>{if(!(A||!W())){A=!0,S&&(clearTimeout(S),S=null),C?.viz.remove();for(const m of Array.from(d.children))m!==h&&d.removeChild(m);h.style.position="",h.style.inset="",h.style.visibility="",d.style.position="",k.current={viz:$,node:h},X(h)}};try{y.setResult(Le(w));try{const D=y.getMetadata(),E=D?.getRootField();f&&Ve(E),p=E?.renderAs(),z=E?D?.getPluginsForField(E.key)?.[0]?.sizingStrategy:void 0}catch{p=void 0,z=void 0}o?.(G(p,z),p),c.dataset.malloyRenderAs=p??"unknown",c.dataset.malloySizing=G(p,z);const m=Ye(p,w);c.style.minWidth=m===void 0?"":`${m}px`,d.style.overflowX=m===void 0?"":"auto",d.style.overflowY=m===void 0?"":"hidden",y.render(c);const oe=i.current;try{if(oe){const D=$e(y,oe.canDrill),E=()=>{try{Fe(h,D)}catch(s){console.warn("Drill affordance skipped:",s)}};E();const ne=s=>{const u=s.querySelector(".cell-content")??s,F=u.getBoundingClientRect();u.dispatchEvent(new MouseEvent("click",{bubbles:!0,cancelable:!0,view:u.ownerDocument.defaultView,clientX:Math.round(F.left+F.width/2),clientY:Math.round(F.bottom)}))},le=s=>s.target?.closest?.(`.${v}`)??null,ye=(s,u)=>{de(s,u)?.focus()};N=s=>{const u=le(s);if(!u)return;const F=s.key==="ArrowDown"?1:s.key==="ArrowUp"?-1:s.key==="Home"?"first":s.key==="End"?"last":void 0;if(F!==void 0){s.preventDefault(),ye(u,F);return}s.key==="Enter"?(s.preventDefault(),ne(u)):s.key===" "&&s.preventDefault()},P=s=>{if(s.key!==" ")return;const u=le(s);u&&(s.preventDefault(),ne(u))},Y=s=>{const u=s.target?.closest?.(`.${v}`);u&&de(u,0)},h.addEventListener("keydown",N),h.addEventListener("keyup",P),h.addEventListener("focusin",Y),D.size>0&&typeof MutationObserver<"u"&&(q=new MutationObserver(()=>{cancelAnimationFrame(J),J=requestAnimationFrame(E)}),q.observe(h,{childList:!0,subtree:!0}))}}catch(D){console.warn("Drill affordance skipped:",D)}y.onReady(ae),S=setTimeout(ae,1e4)}catch(m){console.error("Error rendering visualization:",m),j?.disconnect(),M?.disconnect(),q?.disconnect(),y.remove(),y=void 0,h.parentNode===d&&d.removeChild(h)}})(),()=>{K=!0,j?.disconnect(),M?.disconnect(),R&&clearTimeout(R),S&&clearTimeout(S),c&&k.current?.node!==c&&(N&&c.removeEventListener("keydown",N),P&&c.removeEventListener("keyup",P),Y&&c.removeEventListener("focusin",Y),q?.disconnect(),cancelAnimationFrame(J),y?.remove(),c.parentNode===d&&d.removeChild(c),d.style.position="")}},[e,b,f,a,o,L,V,Z,ee]),O.jsx("div",{ref:l,...n?{[B]:""}:{},style:{width:"100%",height:t?`${t}px`:"400px"}})}function Ze(e){return typeof window>"u"?O.jsx(ie,{sx:{width:"100%",height:e.height?`${e.height}px`:"100%",display:"flex",alignItems:"center",justifyContent:"center",color:"text.secondary"},children:"Loading..."}):O.jsx(g.Suspense,{fallback:O.jsx(ie,{sx:{width:"100%",height:e.height?`${e.height}px`:"100%",display:"flex",alignItems:"center",justifyContent:"center",color:"text.secondary"},children:"Loading visualization..."}),children:O.jsx(Qe,{...e})})}const tt=Object.freeze(Object.defineProperty({__proto__:null,default:Ze},Symbol.toStringTag,{value:"Module"}));export{v as D,Ze as R,Me as a,Re as b,tt as c,$e as d,Fe as m,Te as r};
@@ -1 +1 @@
1
- import{aB as o,j as r,aC as s,aD as n,H as t,T as a}from"./index-CGKV9Dxi.js";function x(){const e=o();return console.error(e),r.jsx(s,{maxWidth:"lg",component:"main",sx:{display:"flex",flexDirection:"column",my:2,gap:0},children:r.jsxs(n,{sx:{m:"auto",flexDirection:"column"},children:[r.jsx(t,{sx:{height:"300px"}}),r.jsx("img",{src:"/error.png"}),r.jsx(a,{variant:"subtitle1",children:"An unexpected error occurred"})]})})}export{x as default};
1
+ import{ab as o,j as r,ac as s,ad as n,I as t,T as a}from"./index-D8JKtZm5.js";function x(){const e=o();return console.error(e),r.jsx(s,{maxWidth:"lg",component:"main",sx:{display:"flex",flexDirection:"column",my:2,gap:0},children:r.jsxs(n,{sx:{m:"auto",flexDirection:"column"},children:[r.jsx(t,{sx:{height:"300px"}}),r.jsx("img",{src:"/error.png"}),r.jsx(a,{variant:"subtitle1",children:"An unexpected error occurred"})]})})}export{x as default};