@malloy-publisher/app 0.0.129 → 0.0.130

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.
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/angular-html-D3aW1y6T.es-CRu3QO-y.js","assets/html-PSPajZka.es-BayZgXUb.js","assets/javascript-fa8UlHZE.es-ySlJ1b_l.js","assets/css-D1aVdRIU.es-BPhBrDlE.js","assets/angular-ts-Jud40GrY.es-ZQeME4ih.js","assets/scss-B_hSZppj.es-BurBaP11.js","assets/apl-pE3PRTDr.es-CQSepgku.js","assets/xml-Ch1q_kJp.es-af2B2Zxm.js","assets/java-B7odJ7Ap.es-xI-RfyKK.js","assets/json-71t8ZF9g.es-BQoSv7ci.js","assets/astro-Be6fybGX.es-fPsVT2Pm.js","assets/typescript-buWNZFwO.es-Dj6nwHGl.js","assets/postcss-BZ3MNRIJ.es-B3ZDOciz.js","assets/blade-DmXp5Zcz.es-D3zQbxlG.js","assets/sql-DCkt643-.es-COK4E0Yg.js","assets/bsl-NPX_d-bb.es-CKrxbqO6.js","assets/sdbl-BBamrXFL.es-BLhTXw86.js","assets/cairo-17kO8-kb.es-N2Uzg40c.js","assets/python-xYxLFJY-.es-DhUJRlN_.js","assets/cobol-BzcJm6ie.es-BWBq31KV.js","assets/coffee-q2iaxUnQ.es-B85jwlP6.js","assets/cpp-CPQtoCcU.es-D1V2BO11.js","assets/regexp-GiFkbxS-.es-DWJ3fJO_.js","assets/glsl-BYTq1Tfl.es-ELtdM8O0.js","assets/c-DASdrs7p.es-C3t2pwGQ.js","assets/crystal-BY_Cg265.es-H3j-N6XT.js","assets/shellscript-Dn0-btNd.es-atvbtKCR.js","assets/edge-DI6_BHKG.es-CysQ3joS.js","assets/html-derivative-Brb3b4aI.es-BOeRDW72.js","assets/elixir-ic9y5jcd.es-BhdVfZIc.js","assets/elm-DxnUqUaW.es-BM2_y8XT.js","assets/erb-Cbj2YePa.es-DRu4t7o3.js","assets/ruby-cs7BSa_9.es-CPbNUT0O.js","assets/haml-4TJ757dz.es-DgP9dPqU.js","assets/graphql-g3nHRc0M.es-DSxiSR3X.js","assets/jsx-Bkesy5tT.es-BAng5TT0.js","assets/tsx-DiGsgWT8.es-B6W0miNI.js","assets/lua-DeXVjwzF.es-Dr4fCD2G.js","assets/yaml-Bbg74JKr.es-CVw76BM1.js","assets/fortran-fixed-form-DECY15PY.es-DU-ZL2d9.js","assets/fortran-free-form-CNDsBFUj.es-DKXYxT9g.js","assets/fsharp-D2ZqviWP.es-BxlBxsP5.js","assets/markdown-B6guhLWd.es-UIAJJxZW.js","assets/gdresource-RIsK8sku.es-B20oF6eU.js","assets/gdshader-BGJEsM2Z.es-SKMF96pI.js","assets/gdscript-D7aheHm-.es-DfxzS6Rs.js","assets/git-commit-BRJ1E4Bx.es-BbGpbqw6.js","assets/diff-XmNrvgM1.es-BgYniUM_.js","assets/git-rebase-C3X7aMpn.es-BtbFLN_-.js","assets/glimmer-js-C4MQf3Na.es-BEVrinj1.js","assets/glimmer-ts-CoYpqZrZ.es-BREYyOZ9.js","assets/hack-wPAsyujS.es-BZgRSYeF.js","assets/handlebars-7GDLw__F.es-9gasINI1.js","assets/http-CWBcr-Ch.es-BydQIEc3.js","assets/hxml-DLduiIv3.es-KtyOMmRZ.js","assets/haxe-CZZ33vZw.es-C5wWYbrZ.js","assets/imba-BEYqRZzB.es-CMdLgtbc.js","assets/jinja-DKLHYjK0.es-Bc5vrI9a.js","assets/jison-CzPfUIvM.es-FIbl5Mke.js","assets/julia-B_r6juN7.es-UTBdB3hN.js","assets/r-F-9I-ITZ.es-CwjWoCRV.js","assets/latex-GxBxlqbc.es-BIcleNUg.js","assets/tex-B0y3cEZp.es-sNFHINbC.js","assets/liquid-BxBkR-z5.es-BPU8qCnT.js","assets/marko-DwPYPpB3.es-DWcUhJ8-.js","assets/less-DQA4v-Nm.es-BfCpw3nA.js","assets/mdc-X4YjkufV.es-CkjSLJEI.js","assets/nginx-ChI-VqNT.es-DWZcbbz-.js","assets/nim-BiJA-5u7.es-znXiz4wV.js","assets/perl-CkXYjL3t.es-BGcPZ9HO.js","assets/php-q40Yjh5d.es-BkXnuPYP.js","assets/pug-Br4hpvIv.es-DSNbVJpq.js","assets/qml-D5gi21kK.es-DPPvKkcg.js","assets/razor-Bt_t1YJb.es-CZnAzo4o.js","assets/csharp-CYWRhZ2R.es-D9R-vmeu.js","assets/rst-BmKw97ch.es-CR4pK9fb.js","assets/cmake-Dr-A3iJx.es-DbXoA79R.js","assets/sas-DgvHx4mL.es-CucEgNpN.js","assets/shaderlab-U9mqcu_f.es-BbQCwWDD.js","assets/hlsl-3-lv4gi7.es-ifBTmRxC.js","assets/shellsession-LvXGClmj.es-BA33EWkN.js","assets/soy-C0yEn39K.es-BwliuvcW.js","assets/sparql-CuZaxpno.es-DA2vjzn9.js","assets/turtle-BJ2wmjPc.es-BMR_PYu6.js","assets/stata-Dv81f34z.es-CMwo8ydZ.js","assets/svelte-SoJd35Jr.es-CClskEeK.js","assets/templ-C7he2afp.es-DoaZGgQ7.js","assets/go-BErP6iv1.es-B1SYOhNW.js","assets/ts-tags-C5-4VQhf.es-BAFqzONk.js","assets/twig-OmkATFdv.es-Bjz-OhEW.js","assets/vue-DCwwWMGI.es-Ctq8hiPI.js","assets/vue-html-sRE_Ny23.es-By6muIb_.js","assets/xsl-DyL8yqXw.es-DIeMqyL3.js","assets/index-LMhiPgJ7.js","assets/index-WCB9ETR1.js","assets/index.umd-CzfgaPy4.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/angular-html-D3aW1y6T.es-CRu3QO-y.js","assets/html-PSPajZka.es-BayZgXUb.js","assets/javascript-fa8UlHZE.es-ySlJ1b_l.js","assets/css-D1aVdRIU.es-BPhBrDlE.js","assets/angular-ts-Jud40GrY.es-ZQeME4ih.js","assets/scss-B_hSZppj.es-BurBaP11.js","assets/apl-pE3PRTDr.es-CQSepgku.js","assets/xml-Ch1q_kJp.es-af2B2Zxm.js","assets/java-B7odJ7Ap.es-xI-RfyKK.js","assets/json-71t8ZF9g.es-BQoSv7ci.js","assets/astro-Be6fybGX.es-fPsVT2Pm.js","assets/typescript-buWNZFwO.es-Dj6nwHGl.js","assets/postcss-BZ3MNRIJ.es-B3ZDOciz.js","assets/blade-DmXp5Zcz.es-D3zQbxlG.js","assets/sql-DCkt643-.es-COK4E0Yg.js","assets/bsl-NPX_d-bb.es-CKrxbqO6.js","assets/sdbl-BBamrXFL.es-BLhTXw86.js","assets/cairo-17kO8-kb.es-N2Uzg40c.js","assets/python-xYxLFJY-.es-DhUJRlN_.js","assets/cobol-BzcJm6ie.es-BWBq31KV.js","assets/coffee-q2iaxUnQ.es-B85jwlP6.js","assets/cpp-CPQtoCcU.es-D1V2BO11.js","assets/regexp-GiFkbxS-.es-DWJ3fJO_.js","assets/glsl-BYTq1Tfl.es-ELtdM8O0.js","assets/c-DASdrs7p.es-C3t2pwGQ.js","assets/crystal-BY_Cg265.es-H3j-N6XT.js","assets/shellscript-Dn0-btNd.es-atvbtKCR.js","assets/edge-DI6_BHKG.es-CysQ3joS.js","assets/html-derivative-Brb3b4aI.es-BOeRDW72.js","assets/elixir-ic9y5jcd.es-BhdVfZIc.js","assets/elm-DxnUqUaW.es-BM2_y8XT.js","assets/erb-Cbj2YePa.es-DRu4t7o3.js","assets/ruby-cs7BSa_9.es-CPbNUT0O.js","assets/haml-4TJ757dz.es-DgP9dPqU.js","assets/graphql-g3nHRc0M.es-DSxiSR3X.js","assets/jsx-Bkesy5tT.es-BAng5TT0.js","assets/tsx-DiGsgWT8.es-B6W0miNI.js","assets/lua-DeXVjwzF.es-Dr4fCD2G.js","assets/yaml-Bbg74JKr.es-CVw76BM1.js","assets/fortran-fixed-form-DECY15PY.es-DU-ZL2d9.js","assets/fortran-free-form-CNDsBFUj.es-DKXYxT9g.js","assets/fsharp-D2ZqviWP.es-BxlBxsP5.js","assets/markdown-B6guhLWd.es-UIAJJxZW.js","assets/gdresource-RIsK8sku.es-B20oF6eU.js","assets/gdshader-BGJEsM2Z.es-SKMF96pI.js","assets/gdscript-D7aheHm-.es-DfxzS6Rs.js","assets/git-commit-BRJ1E4Bx.es-BbGpbqw6.js","assets/diff-XmNrvgM1.es-BgYniUM_.js","assets/git-rebase-C3X7aMpn.es-BtbFLN_-.js","assets/glimmer-js-C4MQf3Na.es-BEVrinj1.js","assets/glimmer-ts-CoYpqZrZ.es-BREYyOZ9.js","assets/hack-wPAsyujS.es-BZgRSYeF.js","assets/handlebars-7GDLw__F.es-9gasINI1.js","assets/http-CWBcr-Ch.es-BydQIEc3.js","assets/hxml-DLduiIv3.es-KtyOMmRZ.js","assets/haxe-CZZ33vZw.es-C5wWYbrZ.js","assets/imba-BEYqRZzB.es-CMdLgtbc.js","assets/jinja-DKLHYjK0.es-Bc5vrI9a.js","assets/jison-CzPfUIvM.es-FIbl5Mke.js","assets/julia-B_r6juN7.es-UTBdB3hN.js","assets/r-F-9I-ITZ.es-CwjWoCRV.js","assets/latex-GxBxlqbc.es-BIcleNUg.js","assets/tex-B0y3cEZp.es-sNFHINbC.js","assets/liquid-BxBkR-z5.es-BPU8qCnT.js","assets/marko-DwPYPpB3.es-DWcUhJ8-.js","assets/less-DQA4v-Nm.es-BfCpw3nA.js","assets/mdc-X4YjkufV.es-CkjSLJEI.js","assets/nginx-ChI-VqNT.es-DWZcbbz-.js","assets/nim-BiJA-5u7.es-znXiz4wV.js","assets/perl-CkXYjL3t.es-BGcPZ9HO.js","assets/php-q40Yjh5d.es-BkXnuPYP.js","assets/pug-Br4hpvIv.es-DSNbVJpq.js","assets/qml-D5gi21kK.es-DPPvKkcg.js","assets/razor-Bt_t1YJb.es-CZnAzo4o.js","assets/csharp-CYWRhZ2R.es-D9R-vmeu.js","assets/rst-BmKw97ch.es-CR4pK9fb.js","assets/cmake-Dr-A3iJx.es-DbXoA79R.js","assets/sas-DgvHx4mL.es-CucEgNpN.js","assets/shaderlab-U9mqcu_f.es-BbQCwWDD.js","assets/hlsl-3-lv4gi7.es-ifBTmRxC.js","assets/shellsession-LvXGClmj.es-BA33EWkN.js","assets/soy-C0yEn39K.es-BwliuvcW.js","assets/sparql-CuZaxpno.es-DA2vjzn9.js","assets/turtle-BJ2wmjPc.es-BMR_PYu6.js","assets/stata-Dv81f34z.es-CMwo8ydZ.js","assets/svelte-SoJd35Jr.es-CClskEeK.js","assets/templ-C7he2afp.es-DoaZGgQ7.js","assets/go-BErP6iv1.es-B1SYOhNW.js","assets/ts-tags-C5-4VQhf.es-BAFqzONk.js","assets/twig-OmkATFdv.es-Bjz-OhEW.js","assets/vue-DCwwWMGI.es-Ctq8hiPI.js","assets/vue-html-sRE_Ny23.es-By6muIb_.js","assets/xsl-DyL8yqXw.es-DIeMqyL3.js","assets/index-B7sMhQDb.js","assets/index-BzxjSqrV.js","assets/index.umd-CUL-Q1Jn.js"])))=>i.map(i=>d[i]);
2
2
  function w9(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const o in r)if(o!=="default"&&!(o in e)){const a=Object.getOwnPropertyDescriptor(r,o);a&&Object.defineProperty(e,o,a.get?a:{enumerable:!0,get:()=>r[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const a of o)if(a.type==="childList")for(const i of a.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(o){const a={};return o.integrity&&(a.integrity=o.integrity),o.referrerPolicy&&(a.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?a.credentials="include":o.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(o){if(o.ep)return;o.ep=!0;const a=n(o);fetch(o.href,a)}})();var Pke=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function S3(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Lke(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:function(){return e[r]}})}),n}var sx={exports:{}},vf={};/**
3
3
  * @license React
4
4
  * react-jsx-runtime.production.js
@@ -361,7 +361,7 @@ export default theme;`}function DN(e){return typeof e=="number"?`${(e*100).toFix
361
361
  animation: ${cC} 1.4s ease-in-out infinite;
362
362
  `:null,vde=e=>{const{classes:t,variant:n,color:r,disableShrink:o}=e,a={root:["root",n,`color${Ze(r)}`],svg:["svg"],circle:["circle",`circle${Ze(n)}`,o&&"circleDisableShrink"]};return Jt(a,gde,t)},Ede=Ye("span",{name:"MuiCircularProgress",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`color${Ze(n.color)}`]]}})(hn(({theme:e})=>({display:"inline-block",variants:[{props:{variant:"determinate"},style:{transition:e.transitions.create("transform")}},{props:{variant:"indeterminate"},style:yde||{animation:`${lC} 1.4s linear infinite`}},...Object.entries(e.palette).filter(ko()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}}))]}))),xde=Ye("svg",{name:"MuiCircularProgress",slot:"Svg"})({display:"block"}),Sde=Ye("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.circle,t[`circle${Ze(n.variant)}`],n.disableShrink&&t.circleDisableShrink]}})(hn(({theme:e})=>({stroke:"currentColor",variants:[{props:{variant:"determinate"},style:{transition:e.transitions.create("stroke-dashoffset")}},{props:{variant:"indeterminate"},style:{strokeDasharray:"80px, 200px",strokeDashoffset:0}},{props:({ownerState:t})=>t.variant==="indeterminate"&&!t.disableShrink,style:bde||{animation:`${cC} 1.4s ease-in-out infinite`}}]}))),gF=A.forwardRef(function(e,t){const n=sn({props:e,name:"MuiCircularProgress"}),{className:r,color:o="primary",disableShrink:a=!1,size:i=40,style:l,thickness:u=3.6,value:d=0,variant:p="indeterminate",...h}=n,y={...n,color:o,disableShrink:a,size:i,thickness:u,value:d,variant:p},g=vde(y),b={},x={},S={};if(p==="determinate"){const E=2*Math.PI*((gl-u)/2);b.strokeDasharray=E.toFixed(3),S["aria-valuenow"]=Math.round(d),b.strokeDashoffset=`${((100-d)/100*E).toFixed(3)}px`,x.transform="rotate(-90deg)"}return v.jsx(Ede,{className:Tt(g.root,r),style:{width:i,height:i,...x,...l},ownerState:y,ref:t,role:"progressbar",...S,...h,children:v.jsx(xde,{className:g.svg,ownerState:y,viewBox:`${gl/2} ${gl/2} ${gl} ${gl}`,children:v.jsx(Sde,{className:g.circle,style:b,ownerState:y,cx:gl,cy:gl,r:(gl-u)/2,fill:"none",strokeWidth:u})})})});function Tde(e){return en("MuiIconButton",e)}const gP=Wt("MuiIconButton",["root","disabled","colorInherit","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","edgeStart","edgeEnd","sizeSmall","sizeMedium","sizeLarge","loading","loadingIndicator","loadingWrapper"]),Cde=e=>{const{classes:t,disabled:n,color:r,edge:o,size:a,loading:i}=e,l={root:["root",i&&"loading",n&&"disabled",r!=="default"&&`color${Ze(r)}`,o&&`edge${Ze(o)}`,`size${Ze(a)}`],loadingIndicator:["loadingIndicator"],loadingWrapper:["loadingWrapper"]};return Jt(l,Tde,t)},Ade=Ye(Kd,{name:"MuiIconButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.loading&&t.loading,n.color!=="default"&&t[`color${Ze(n.color)}`],n.edge&&t[`edge${Ze(n.edge)}`],t[`size${Ze(n.size)}`]]}})(hn(({theme:e})=>({textAlign:"center",flex:"0 0 auto",fontSize:e.typography.pxToRem(24),padding:8,borderRadius:"50%",color:(e.vars||e).palette.action.active,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest}),variants:[{props:t=>!t.disableRipple,style:{"--IconButton-hoverBg":e.alpha((e.vars||e).palette.action.active,(e.vars||e).palette.action.hoverOpacity),"&:hover":{backgroundColor:"var(--IconButton-hoverBg)","@media (hover: none)":{backgroundColor:"transparent"}}}},{props:{edge:"start"},style:{marginLeft:-12}},{props:{edge:"start",size:"small"},style:{marginLeft:-3}},{props:{edge:"end"},style:{marginRight:-12}},{props:{edge:"end",size:"small"},style:{marginRight:-3}}]})),hn(({theme:e})=>({variants:[{props:{color:"inherit"},style:{color:"inherit"}},...Object.entries(e.palette).filter(ko()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}})),...Object.entries(e.palette).filter(ko()).map(([t])=>({props:{color:t},style:{"--IconButton-hoverBg":e.alpha((e.vars||e).palette[t].main,(e.vars||e).palette.action.hoverOpacity)}})),{props:{size:"small"},style:{padding:5,fontSize:e.typography.pxToRem(18)}},{props:{size:"large"},style:{padding:12,fontSize:e.typography.pxToRem(28)}}],[`&.${gP.disabled}`]:{backgroundColor:"transparent",color:(e.vars||e).palette.action.disabled},[`&.${gP.loading}`]:{color:"transparent"}}))),_de=Ye("span",{name:"MuiIconButton",slot:"LoadingIndicator"})(({theme:e})=>({display:"none",position:"absolute",visibility:"visible",top:"50%",left:"50%",transform:"translate(-50%, -50%)",color:(e.vars||e).palette.action.disabled,variants:[{props:{loading:!0},style:{display:"flex"}}]})),Qd=A.forwardRef(function(e,t){const n=sn({props:e,name:"MuiIconButton"}),{edge:r=!1,children:o,className:a,color:i="default",disabled:l=!1,disableFocusRipple:u=!1,size:d="medium",id:p,loading:h=null,loadingIndicator:y,...g}=n,b=up(p),x=y??v.jsx(gF,{"aria-labelledby":b,color:"inherit",size:16}),S={...n,edge:r,color:i,disabled:l,disableFocusRipple:u,loading:h,loadingIndicator:x,size:d},E=Cde(S);return v.jsxs(Ade,{id:h?b:p,className:Tt(E.root,a),centerRipple:!0,focusRipple:!u,disabled:l||h,ref:t,...g,ownerState:S,children:[typeof h=="boolean"&&v.jsx("span",{className:E.loadingWrapper,style:{display:"contents"},children:v.jsx(_de,{className:E.loadingIndicator,ownerState:S,children:h&&x})}),o]})}),kde=On(v.jsx("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}));function wde(e){return en("MuiChip",e)}const dn=Wt("MuiChip",["root","sizeSmall","sizeMedium","colorDefault","colorError","colorInfo","colorPrimary","colorSecondary","colorSuccess","colorWarning","disabled","clickable","clickableColorPrimary","clickableColorSecondary","deletable","deletableColorPrimary","deletableColorSecondary","outlined","filled","outlinedPrimary","outlinedSecondary","filledPrimary","filledSecondary","avatar","avatarSmall","avatarMedium","avatarColorPrimary","avatarColorSecondary","icon","iconSmall","iconMedium","iconColorPrimary","iconColorSecondary","label","labelSmall","labelMedium","deleteIcon","deleteIconSmall","deleteIconMedium","deleteIconColorPrimary","deleteIconColorSecondary","deleteIconOutlinedColorPrimary","deleteIconOutlinedColorSecondary","deleteIconFilledColorPrimary","deleteIconFilledColorSecondary","focusVisible"]);function xn(e,t){const{className:n,elementType:r,ownerState:o,externalForwardedProps:a,internalForwardedProps:i,shouldForwardComponentProp:l=!1,...u}=t,{component:d,slots:p={[e]:void 0},slotProps:h={[e]:void 0},...y}=a,g=p[e]||r,b=Oi(h[e],o),{props:{component:x,...S},internalRef:E}=dF({className:n,...u,externalForwardedProps:e==="root"?y:void 0,externalSlotProps:b}),_=sr(E,b?.ref,t.ref),C=e==="root"?x||d:x,R=uF(g,{...e==="root"&&!d&&!p[e]&&i,...e!=="root"&&!p[e]&&i,...S,...C&&!l&&{as:C},...C&&l&&{component:C},ref:_},o);return[g,R]}const Rde=e=>{const{classes:t,disabled:n,size:r,color:o,iconColor:a,onDelete:i,clickable:l,variant:u}=e,d={root:["root",u,n&&"disabled",`size${Ze(r)}`,`color${Ze(o)}`,l&&"clickable",l&&`clickableColor${Ze(o)}`,i&&"deletable",i&&`deletableColor${Ze(o)}`,`${u}${Ze(o)}`],label:["label",`label${Ze(r)}`],avatar:["avatar",`avatar${Ze(r)}`,`avatarColor${Ze(o)}`],icon:["icon",`icon${Ze(r)}`,`iconColor${Ze(a)}`],deleteIcon:["deleteIcon",`deleteIcon${Ze(r)}`,`deleteIconColor${Ze(o)}`,`deleteIcon${Ze(u)}Color${Ze(o)}`]};return Jt(d,wde,t)},Dde=Ye("div",{name:"MuiChip",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e,{color:r,iconColor:o,clickable:a,onDelete:i,size:l,variant:u}=n;return[{[`& .${dn.avatar}`]:t.avatar},{[`& .${dn.avatar}`]:t[`avatar${Ze(l)}`]},{[`& .${dn.avatar}`]:t[`avatarColor${Ze(r)}`]},{[`& .${dn.icon}`]:t.icon},{[`& .${dn.icon}`]:t[`icon${Ze(l)}`]},{[`& .${dn.icon}`]:t[`iconColor${Ze(o)}`]},{[`& .${dn.deleteIcon}`]:t.deleteIcon},{[`& .${dn.deleteIcon}`]:t[`deleteIcon${Ze(l)}`]},{[`& .${dn.deleteIcon}`]:t[`deleteIconColor${Ze(r)}`]},{[`& .${dn.deleteIcon}`]:t[`deleteIcon${Ze(u)}Color${Ze(r)}`]},t.root,t[`size${Ze(l)}`],t[`color${Ze(r)}`],a&&t.clickable,a&&r!=="default"&&t[`clickableColor${Ze(r)})`],i&&t.deletable,i&&r!=="default"&&t[`deletableColor${Ze(r)}`],t[u],t[`${u}${Ze(r)}`]]}})(hn(({theme:e})=>{const t=e.palette.mode==="light"?e.palette.grey[700]:e.palette.grey[300];return{maxWidth:"100%",fontFamily:e.typography.fontFamily,fontSize:e.typography.pxToRem(13),display:"inline-flex",alignItems:"center",justifyContent:"center",height:32,lineHeight:1.5,color:(e.vars||e).palette.text.primary,backgroundColor:(e.vars||e).palette.action.selected,borderRadius:32/2,whiteSpace:"nowrap",transition:e.transitions.create(["background-color","box-shadow"]),cursor:"unset",outline:0,textDecoration:"none",border:0,padding:0,verticalAlign:"middle",boxSizing:"border-box",[`&.${dn.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity,pointerEvents:"none"},[`& .${dn.avatar}`]:{marginLeft:5,marginRight:-6,width:24,height:24,color:e.vars?e.vars.palette.Chip.defaultAvatarColor:t,fontSize:e.typography.pxToRem(12)},[`& .${dn.avatarColorPrimary}`]:{color:(e.vars||e).palette.primary.contrastText,backgroundColor:(e.vars||e).palette.primary.dark},[`& .${dn.avatarColorSecondary}`]:{color:(e.vars||e).palette.secondary.contrastText,backgroundColor:(e.vars||e).palette.secondary.dark},[`& .${dn.avatarSmall}`]:{marginLeft:4,marginRight:-4,width:18,height:18,fontSize:e.typography.pxToRem(10)},[`& .${dn.icon}`]:{marginLeft:5,marginRight:-6},[`& .${dn.deleteIcon}`]:{WebkitTapHighlightColor:"transparent",color:e.alpha((e.vars||e).palette.text.primary,.26),fontSize:22,cursor:"pointer",margin:"0 5px 0 -6px","&:hover":{color:e.alpha((e.vars||e).palette.text.primary,.4)}},variants:[{props:{size:"small"},style:{height:24,[`& .${dn.icon}`]:{fontSize:18,marginLeft:4,marginRight:-4},[`& .${dn.deleteIcon}`]:{fontSize:16,marginRight:4,marginLeft:-4}}},...Object.entries(e.palette).filter(ko(["contrastText"])).map(([n])=>({props:{color:n},style:{backgroundColor:(e.vars||e).palette[n].main,color:(e.vars||e).palette[n].contrastText,[`& .${dn.deleteIcon}`]:{color:e.alpha((e.vars||e).palette[n].contrastText,.7),"&:hover, &:active":{color:(e.vars||e).palette[n].contrastText}}}})),{props:n=>n.iconColor===n.color,style:{[`& .${dn.icon}`]:{color:e.vars?e.vars.palette.Chip.defaultIconColor:t}}},{props:n=>n.iconColor===n.color&&n.color!=="default",style:{[`& .${dn.icon}`]:{color:"inherit"}}},{props:{onDelete:!0},style:{[`&.${dn.focusVisible}`]:{backgroundColor:e.alpha((e.vars||e).palette.action.selected,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.focusOpacity}`)}}},...Object.entries(e.palette).filter(ko(["dark"])).map(([n])=>({props:{color:n,onDelete:!0},style:{[`&.${dn.focusVisible}`]:{background:(e.vars||e).palette[n].dark}}})),{props:{clickable:!0},style:{userSelect:"none",WebkitTapHighlightColor:"transparent",cursor:"pointer","&:hover":{backgroundColor:e.alpha((e.vars||e).palette.action.selected,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.hoverOpacity}`)},[`&.${dn.focusVisible}`]:{backgroundColor:e.alpha((e.vars||e).palette.action.selected,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.focusOpacity}`)},"&:active":{boxShadow:(e.vars||e).shadows[1]}}},...Object.entries(e.palette).filter(ko(["dark"])).map(([n])=>({props:{color:n,clickable:!0},style:{[`&:hover, &.${dn.focusVisible}`]:{backgroundColor:(e.vars||e).palette[n].dark}}})),{props:{variant:"outlined"},style:{backgroundColor:"transparent",border:e.vars?`1px solid ${e.vars.palette.Chip.defaultBorder}`:`1px solid ${e.palette.mode==="light"?e.palette.grey[400]:e.palette.grey[700]}`,[`&.${dn.clickable}:hover`]:{backgroundColor:(e.vars||e).palette.action.hover},[`&.${dn.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`& .${dn.avatar}`]:{marginLeft:4},[`& .${dn.avatarSmall}`]:{marginLeft:2},[`& .${dn.icon}`]:{marginLeft:4},[`& .${dn.iconSmall}`]:{marginLeft:2},[`& .${dn.deleteIcon}`]:{marginRight:5},[`& .${dn.deleteIconSmall}`]:{marginRight:3}}},...Object.entries(e.palette).filter(ko()).map(([n])=>({props:{variant:"outlined",color:n},style:{color:(e.vars||e).palette[n].main,border:`1px solid ${e.alpha((e.vars||e).palette[n].main,.7)}`,[`&.${dn.clickable}:hover`]:{backgroundColor:e.alpha((e.vars||e).palette[n].main,(e.vars||e).palette.action.hoverOpacity)},[`&.${dn.focusVisible}`]:{backgroundColor:e.alpha((e.vars||e).palette[n].main,(e.vars||e).palette.action.focusOpacity)},[`& .${dn.deleteIcon}`]:{color:e.alpha((e.vars||e).palette[n].main,.7),"&:hover, &:active":{color:(e.vars||e).palette[n].main}}}}))]}})),Ide=Ye("span",{name:"MuiChip",slot:"Label",overridesResolver:(e,t)=>{const{ownerState:n}=e,{size:r}=n;return[t.label,t[`label${Ze(r)}`]]}})({overflow:"hidden",textOverflow:"ellipsis",paddingLeft:12,paddingRight:12,whiteSpace:"nowrap",variants:[{props:{variant:"outlined"},style:{paddingLeft:11,paddingRight:11}},{props:{size:"small"},style:{paddingLeft:8,paddingRight:8}},{props:{size:"small",variant:"outlined"},style:{paddingLeft:7,paddingRight:7}}]});function yP(e){return e.key==="Backspace"||e.key==="Delete"}const Ode=A.forwardRef(function(e,t){const n=sn({props:e,name:"MuiChip"}),{avatar:r,className:o,clickable:a,color:i="default",component:l,deleteIcon:u,disabled:d=!1,icon:p,label:h,onClick:y,onDelete:g,onKeyDown:b,onKeyUp:x,size:S="medium",variant:E="filled",tabIndex:_,skipFocusWhenDisabled:C=!1,slots:R={},slotProps:O={},...I}=n,F=A.useRef(null),H=sr(F,t),z=ae=>{ae.stopPropagation(),g&&g(ae)},L=ae=>{ae.currentTarget===ae.target&&yP(ae)&&ae.preventDefault(),b&&b(ae)},$=ae=>{ae.currentTarget===ae.target&&g&&yP(ae)&&g(ae),x&&x(ae)},k=a!==!1&&y?!0:a,M=k||g?Kd:l||"div",j={...n,component:M,disabled:d,size:S,color:i,iconColor:A.isValidElement(p)&&p.props.color||i,onDelete:!!g,clickable:k,variant:E},V=Rde(j),B=M===Kd?{component:l||"div",focusVisibleClassName:V.focusVisible,...g&&{disableRipple:!0}}:{};let q=null;g&&(q=u&&A.isValidElement(u)?A.cloneElement(u,{className:Tt(u.props.className,V.deleteIcon),onClick:z}):v.jsx(kde,{className:V.deleteIcon,onClick:z}));let Y=null;r&&A.isValidElement(r)&&(Y=A.cloneElement(r,{className:Tt(V.avatar,r.props.className)}));let ee=null;p&&A.isValidElement(p)&&(ee=A.cloneElement(p,{className:Tt(V.icon,p.props.className)}));const N={slots:R,slotProps:O},[W,K]=xn("root",{elementType:Dde,externalForwardedProps:{...N,...I},ownerState:j,shouldForwardComponentProp:!0,ref:H,className:Tt(V.root,o),additionalProps:{disabled:k&&d?!0:void 0,tabIndex:C&&d?-1:_,...B},getSlotProps:ae=>({...ae,onClick:J=>{ae.onClick?.(J),y?.(J)},onKeyDown:J=>{ae.onKeyDown?.(J),L(J)},onKeyUp:J=>{ae.onKeyUp?.(J),$(J)}})}),[P,Z]=xn("label",{elementType:Ide,externalForwardedProps:N,ownerState:j,className:V.label});return v.jsxs(W,{as:M,...K,children:[Y||ee,v.jsx(P,{...Z,children:h}),q]})});function Py(e){return parseInt(e,10)||0}const Nde={shadow:{visibility:"hidden",position:"absolute",overflow:"hidden",height:0,top:0,left:0,transform:"translateZ(0)"}};function Pde(e){for(const t in e)return!1;return!0}function bP(e){return Pde(e)||e.outerHeightStyle===0&&!e.overflowing}const Lde=A.forwardRef(function(e,t){const{onChange:n,maxRows:r,minRows:o=1,style:a,value:i,...l}=e,{current:u}=A.useRef(i!=null),d=A.useRef(null),p=sr(t,d),h=A.useRef(null),y=A.useRef(null),g=A.useCallback(()=>{const _=d.current,C=y.current;if(!_||!C)return;const R=Ns(_).getComputedStyle(_);if(R.width==="0px")return{outerHeightStyle:0,overflowing:!1};C.style.width=R.width,C.value=_.value||e.placeholder||"x",C.value.slice(-1)===`
363
363
  `&&(C.value+=" ");const O=R.boxSizing,I=Py(R.paddingBottom)+Py(R.paddingTop),F=Py(R.borderBottomWidth)+Py(R.borderTopWidth),H=C.scrollHeight;C.value="x";const z=C.scrollHeight;let L=H;o&&(L=Math.max(Number(o)*z,L)),r&&(L=Math.min(Number(r)*z,L)),L=Math.max(L,z);const $=L+(O==="border-box"?I+F:0),k=Math.abs(L-H)<=1;return{outerHeightStyle:$,overflowing:k}},[r,o,e.placeholder]),b=Fr(()=>{const _=d.current,C=g();if(!_||!C||bP(C))return!1;const R=C.outerHeightStyle;return h.current!=null&&h.current!==R}),x=A.useCallback(()=>{const _=d.current,C=g();if(!_||!C||bP(C))return;const R=C.outerHeightStyle;h.current!==R&&(h.current=R,_.style.height=`${R}px`),_.style.overflow=C.overflowing?"hidden":""},[g]),S=A.useRef(-1);Gi(()=>{const _=c6(x),C=d?.current;if(!C)return;const R=Ns(C);R.addEventListener("resize",_);let O;return typeof ResizeObserver<"u"&&(O=new ResizeObserver(()=>{b()&&(O.unobserve(C),cancelAnimationFrame(S.current),x(),S.current=requestAnimationFrame(()=>{O.observe(C)}))}),O.observe(C)),()=>{_.clear(),cancelAnimationFrame(S.current),R.removeEventListener("resize",_),O&&O.disconnect()}},[g,x,b]),Gi(()=>{x()});const E=_=>{u||x();const C=_.target,R=C.value.length,O=C.value.endsWith(`
364
- `),I=C.selectionStart===R;O&&I&&C.setSelectionRange(R,R),n&&n(_)};return v.jsxs(A.Fragment,{children:[v.jsx("textarea",{value:i,onChange:E,ref:p,rows:o,style:a,...l}),v.jsx("textarea",{"aria-hidden":!0,className:e.className,readOnly:!0,ref:y,tabIndex:-1,style:{...Nde.shadow,...a,paddingTop:0,paddingBottom:0}})]})});function yp({props:e,states:t,muiFormControl:n}){return t.reduce((r,o)=>(r[o]=e[o],n&&typeof e[o]>"u"&&(r[o]=n[o]),r),{})}const I_=A.createContext(void 0);function uu(){return A.useContext(I_)}function vP(e){return e!=null&&!(Array.isArray(e)&&e.length===0)}function bb(e,t=!1){return e&&(vP(e.value)&&e.value!==""||t&&vP(e.defaultValue)&&e.defaultValue!=="")}function Mde(e){return e.startAdornment}function Fde(e){return en("MuiInputBase",e)}const ua=Wt("MuiInputBase",["root","formControl","focused","disabled","adornedStart","adornedEnd","error","sizeSmall","multiline","colorSecondary","fullWidth","hiddenLabel","readOnly","input","inputSizeSmall","inputMultiline","inputTypeSearch","inputAdornedStart","inputAdornedEnd","inputHiddenLabel"]);var EP;const zv=(e,t)=>{const{ownerState:n}=e;return[t.root,n.formControl&&t.formControl,n.startAdornment&&t.adornedStart,n.endAdornment&&t.adornedEnd,n.error&&t.error,n.size==="small"&&t.sizeSmall,n.multiline&&t.multiline,n.color&&t[`color${Ze(n.color)}`],n.fullWidth&&t.fullWidth,n.hiddenLabel&&t.hiddenLabel]},$v=(e,t)=>{const{ownerState:n}=e;return[t.input,n.size==="small"&&t.inputSizeSmall,n.multiline&&t.inputMultiline,n.type==="search"&&t.inputTypeSearch,n.startAdornment&&t.inputAdornedStart,n.endAdornment&&t.inputAdornedEnd,n.hiddenLabel&&t.inputHiddenLabel]},jde=e=>{const{classes:t,color:n,disabled:r,error:o,endAdornment:a,focused:i,formControl:l,fullWidth:u,hiddenLabel:d,multiline:p,readOnly:h,size:y,startAdornment:g,type:b}=e,x={root:["root",`color${Ze(n)}`,r&&"disabled",o&&"error",u&&"fullWidth",i&&"focused",l&&"formControl",y&&y!=="medium"&&`size${Ze(y)}`,p&&"multiline",g&&"adornedStart",a&&"adornedEnd",d&&"hiddenLabel",h&&"readOnly"],input:["input",r&&"disabled",b==="search"&&"inputTypeSearch",p&&"inputMultiline",y==="small"&&"inputSizeSmall",d&&"inputHiddenLabel",g&&"inputAdornedStart",a&&"inputAdornedEnd",h&&"readOnly"]};return Jt(x,Fde,t)},Hv=Ye("div",{name:"MuiInputBase",slot:"Root",overridesResolver:zv})(hn(({theme:e})=>({...e.typography.body1,color:(e.vars||e).palette.text.primary,lineHeight:"1.4375em",boxSizing:"border-box",position:"relative",cursor:"text",display:"inline-flex",alignItems:"center",[`&.${ua.disabled}`]:{color:(e.vars||e).palette.text.disabled,cursor:"default"},variants:[{props:({ownerState:t})=>t.multiline,style:{padding:"4px 0 5px"}},{props:({ownerState:t,size:n})=>t.multiline&&n==="small",style:{paddingTop:1}},{props:({ownerState:t})=>t.fullWidth,style:{width:"100%"}}]}))),Vv=Ye("input",{name:"MuiInputBase",slot:"Input",overridesResolver:$v})(hn(({theme:e})=>{const t=e.palette.mode==="light",n={color:"currentColor",...e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:t?.42:.5},transition:e.transitions.create("opacity",{duration:e.transitions.duration.shorter})},r={opacity:"0 !important"},o=e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:t?.42:.5};return{font:"inherit",letterSpacing:"inherit",color:"currentColor",padding:"4px 0 5px",border:0,boxSizing:"content-box",background:"none",height:"1.4375em",margin:0,WebkitTapHighlightColor:"transparent",display:"block",minWidth:0,width:"100%","&::-webkit-input-placeholder":n,"&::-moz-placeholder":n,"&::-ms-input-placeholder":n,"&:focus":{outline:0},"&:invalid":{boxShadow:"none"},"&::-webkit-search-decoration":{WebkitAppearance:"none"},[`label[data-shrink=false] + .${ua.formControl} &`]:{"&::-webkit-input-placeholder":r,"&::-moz-placeholder":r,"&::-ms-input-placeholder":r,"&:focus::-webkit-input-placeholder":o,"&:focus::-moz-placeholder":o,"&:focus::-ms-input-placeholder":o},[`&.${ua.disabled}`]:{opacity:1,WebkitTextFillColor:(e.vars||e).palette.text.disabled},variants:[{props:({ownerState:a})=>!a.disableInjectingGlobalStyles,style:{animationName:"mui-auto-fill-cancel",animationDuration:"10ms","&:-webkit-autofill":{animationDuration:"5000s",animationName:"mui-auto-fill"}}},{props:{size:"small"},style:{paddingTop:1}},{props:({ownerState:a})=>a.multiline,style:{height:"auto",resize:"none",padding:0,paddingTop:0}},{props:{type:"search"},style:{MozAppearance:"textfield"}}]}})),xP=eie({"@keyframes mui-auto-fill":{from:{display:"block"}},"@keyframes mui-auto-fill-cancel":{from:{display:"block"}}}),O_=A.forwardRef(function(e,t){const n=sn({props:e,name:"MuiInputBase"}),{"aria-describedby":r,autoComplete:o,autoFocus:a,className:i,color:l,components:u={},componentsProps:d={},defaultValue:p,disabled:h,disableInjectingGlobalStyles:y,endAdornment:g,error:b,fullWidth:x=!1,id:S,inputComponent:E="input",inputProps:_={},inputRef:C,margin:R,maxRows:O,minRows:I,multiline:F=!1,name:H,onBlur:z,onChange:L,onClick:$,onFocus:k,onKeyDown:M,onKeyUp:j,placeholder:V,readOnly:B,renderSuffix:q,rows:Y,size:ee,slotProps:N={},slots:W={},startAdornment:K,type:P="text",value:Z,...ae}=n,J=_.value!=null?_.value:Z,{current:pe}=A.useRef(J!=null),le=A.useRef(),Ee=A.useCallback(tt=>{},[]),Te=sr(le,C,_.ref,Ee),[Ae,Ue]=A.useState(!1),Re=uu(),ve=yp({props:n,muiFormControl:Re,states:["color","disabled","error","hiddenLabel","size","required","filled"]});ve.focused=Re?Re.focused:Ae,A.useEffect(()=>{!Re&&h&&Ae&&(Ue(!1),z&&z())},[Re,h,Ae,z]);const pt=Re&&Re.onFilled,ut=Re&&Re.onEmpty,ze=A.useCallback(tt=>{bb(tt)?pt&&pt():ut&&ut()},[pt,ut]);Gi(()=>{pe&&ze({value:J})},[J,ze,pe]);const $e=tt=>{k&&k(tt),_.onFocus&&_.onFocus(tt),Re&&Re.onFocus?Re.onFocus(tt):Ue(!0)},dt=tt=>{z&&z(tt),_.onBlur&&_.onBlur(tt),Re&&Re.onBlur?Re.onBlur(tt):Ue(!1)},Be=(tt,...qe)=>{if(!pe){const Ut=tt.target||le.current;if(Ut==null)throw new Error(Is(1));ze({value:Ut.value})}_.onChange&&_.onChange(tt,...qe),L&&L(tt,...qe)};A.useEffect(()=>{ze(le.current)},[]);const Fe=tt=>{le.current&&tt.currentTarget===tt.target&&le.current.focus(),$&&$(tt)};let Me=E,At=_;F&&Me==="input"&&(Y?At={type:void 0,minRows:Y,maxRows:Y,...At}:At={type:void 0,maxRows:O,minRows:I,...At},Me=Lde);const Dt=tt=>{ze(tt.animationName==="mui-auto-fill-cancel"?le.current:{value:"x"})};A.useEffect(()=>{Re&&Re.setAdornedStart(!!K)},[Re,K]);const gt={...n,color:ve.color||"primary",disabled:ve.disabled,endAdornment:g,error:ve.error,focused:ve.focused,formControl:Re,fullWidth:x,hiddenLabel:ve.hiddenLabel,multiline:F,size:ve.size,startAdornment:K,type:P},ue=jde(gt),ge=W.root||u.Root||Hv,He=N.root||d.root||{},rt=W.input||u.Input||Vv;return At={...At,...N.input??d.input},v.jsxs(A.Fragment,{children:[!y&&typeof xP=="function"&&(EP||(EP=v.jsx(xP,{}))),v.jsxs(ge,{...He,ref:t,onClick:Fe,...ae,...!mb(ge)&&{ownerState:{...gt,...He.ownerState}},className:Tt(ue.root,He.className,i,B&&"MuiInputBase-readOnly"),children:[K,v.jsx(I_.Provider,{value:null,children:v.jsx(rt,{"aria-invalid":ve.error,"aria-describedby":r,autoComplete:o,autoFocus:a,defaultValue:p,disabled:ve.disabled,id:S,onAnimationStart:Dt,name:H,placeholder:V,readOnly:B,required:ve.required,rows:Y,value:J,onKeyDown:M,onKeyUp:j,type:P,...At,...!mb(rt)&&{as:Me,ownerState:{...gt,...At.ownerState}},ref:Te,className:Tt(ue.input,At.className,B&&"MuiInputBase-readOnly"),onBlur:dt,onChange:Be,onFocus:$e})}),g,q?q({...ve,startAdornment:K}):null]})]})});function Bde(e){return en("MuiInput",e)}const Tl={...ua,...Wt("MuiInput",["root","underline","input"])};function Ude(e){return en("MuiOutlinedInput",e)}const Na={...ua,...Wt("MuiOutlinedInput",["root","notchedOutline","input"])};function zde(e){return en("MuiFilledInput",e)}const da={...ua,...Wt("MuiFilledInput",["root","underline","input","adornedStart","adornedEnd","sizeSmall","multiline","hiddenLabel"])},$de=On(v.jsx("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})),yF=On(v.jsx("path",{d:"M7 10l5 5 5-5z"}));function Hde(e){return en("MuiAutocomplete",e)}const tn=Wt("MuiAutocomplete",["root","expanded","fullWidth","focused","focusVisible","tag","tagSizeSmall","tagSizeMedium","hasPopupIcon","hasClearIcon","inputRoot","input","inputFocused","endAdornment","clearIndicator","popupIndicator","popupIndicatorOpen","popper","popperDisablePortal","paper","listbox","loading","noOptions","option","groupLabel","groupUl"]);var SP,TP;const Vde=e=>{const{classes:t,disablePortal:n,expanded:r,focused:o,fullWidth:a,hasClearIcon:i,hasPopupIcon:l,inputFocused:u,popupOpen:d,size:p}=e,h={root:["root",r&&"expanded",o&&"focused",a&&"fullWidth",i&&"hasClearIcon",l&&"hasPopupIcon"],inputRoot:["inputRoot"],input:["input",u&&"inputFocused"],tag:["tag",`tagSize${Ze(p)}`],endAdornment:["endAdornment"],clearIndicator:["clearIndicator"],popupIndicator:["popupIndicator",d&&"popupIndicatorOpen"],popper:["popper",n&&"popperDisablePortal"],paper:["paper"],listbox:["listbox"],loading:["loading"],noOptions:["noOptions"],option:["option"],groupLabel:["groupLabel"],groupUl:["groupUl"]};return Jt(h,Hde,t)},Gde=Ye("div",{name:"MuiAutocomplete",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e,{fullWidth:r,hasClearIcon:o,hasPopupIcon:a,inputFocused:i,size:l}=n;return[{[`& .${tn.tag}`]:t.tag},{[`& .${tn.tag}`]:t[`tagSize${Ze(l)}`]},{[`& .${tn.inputRoot}`]:t.inputRoot},{[`& .${tn.input}`]:t.input},{[`& .${tn.input}`]:i&&t.inputFocused},t.root,r&&t.fullWidth,a&&t.hasPopupIcon,o&&t.hasClearIcon]}})({[`&.${tn.focused} .${tn.clearIndicator}`]:{visibility:"visible"},"@media (pointer: fine)":{[`&:hover .${tn.clearIndicator}`]:{visibility:"visible"}},[`& .${tn.tag}`]:{margin:3,maxWidth:"calc(100% - 6px)"},[`& .${tn.inputRoot}`]:{[`.${tn.hasPopupIcon}&, .${tn.hasClearIcon}&`]:{paddingRight:30},[`.${tn.hasPopupIcon}.${tn.hasClearIcon}&`]:{paddingRight:56},[`& .${tn.input}`]:{width:0,minWidth:30}},[`& .${Tl.root}`]:{paddingBottom:1,"& .MuiInput-input":{padding:"4px 4px 4px 0px"}},[`& .${Tl.root}.${ua.sizeSmall}`]:{[`& .${Tl.input}`]:{padding:"2px 4px 3px 0"}},[`& .${Na.root}`]:{padding:9,[`.${tn.hasPopupIcon}&, .${tn.hasClearIcon}&`]:{paddingRight:39},[`.${tn.hasPopupIcon}.${tn.hasClearIcon}&`]:{paddingRight:65},[`& .${tn.input}`]:{padding:"7.5px 4px 7.5px 5px"},[`& .${tn.endAdornment}`]:{right:9}},[`& .${Na.root}.${ua.sizeSmall}`]:{paddingTop:6,paddingBottom:6,paddingLeft:6,[`& .${tn.input}`]:{padding:"2.5px 4px 2.5px 8px"}},[`& .${da.root}`]:{paddingTop:19,paddingLeft:8,[`.${tn.hasPopupIcon}&, .${tn.hasClearIcon}&`]:{paddingRight:39},[`.${tn.hasPopupIcon}.${tn.hasClearIcon}&`]:{paddingRight:65},[`& .${da.input}`]:{padding:"7px 4px"},[`& .${tn.endAdornment}`]:{right:9}},[`& .${da.root}.${ua.sizeSmall}`]:{paddingBottom:1,[`& .${da.input}`]:{padding:"2.5px 4px"}},[`& .${ua.hiddenLabel}`]:{paddingTop:8},[`& .${da.root}.${ua.hiddenLabel}`]:{paddingTop:0,paddingBottom:0,[`& .${tn.input}`]:{paddingTop:16,paddingBottom:17}},[`& .${da.root}.${ua.hiddenLabel}.${ua.sizeSmall}`]:{[`& .${tn.input}`]:{paddingTop:8,paddingBottom:9}},[`& .${tn.input}`]:{flexGrow:1,textOverflow:"ellipsis",opacity:0},variants:[{props:{fullWidth:!0},style:{width:"100%"}},{props:{size:"small"},style:{[`& .${tn.tag}`]:{margin:2,maxWidth:"calc(100% - 4px)"}}},{props:{inputFocused:!0},style:{[`& .${tn.input}`]:{opacity:1}}},{props:{multiple:!0},style:{[`& .${tn.inputRoot}`]:{flexWrap:"wrap"}}}]}),qde=Ye("div",{name:"MuiAutocomplete",slot:"EndAdornment"})({position:"absolute",right:0,top:"50%",transform:"translate(0, -50%)"}),Wde=Ye(Qd,{name:"MuiAutocomplete",slot:"ClearIndicator"})({marginRight:-2,padding:4,visibility:"hidden"}),Yde=Ye(Qd,{name:"MuiAutocomplete",slot:"PopupIndicator",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.popupIndicator,n.popupOpen&&t.popupIndicatorOpen]}})({padding:2,marginRight:-2,variants:[{props:{popupOpen:!0},style:{transform:"rotate(180deg)"}}]}),Kde=Ye(fF,{name:"MuiAutocomplete",slot:"Popper",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${tn.option}`]:t.option},t.popper,n.disablePortal&&t.popperDisablePortal]}})(hn(({theme:e})=>({zIndex:(e.vars||e).zIndex.modal,variants:[{props:{disablePortal:!0},style:{position:"absolute"}}]}))),Qde=Ye(gp,{name:"MuiAutocomplete",slot:"Paper"})(hn(({theme:e})=>({...e.typography.body1,overflow:"auto"}))),Xde=Ye("div",{name:"MuiAutocomplete",slot:"Loading"})(hn(({theme:e})=>({color:(e.vars||e).palette.text.secondary,padding:"14px 16px"}))),Zde=Ye("div",{name:"MuiAutocomplete",slot:"NoOptions"})(hn(({theme:e})=>({color:(e.vars||e).palette.text.secondary,padding:"14px 16px"}))),Jde=Ye("ul",{name:"MuiAutocomplete",slot:"Listbox"})(hn(({theme:e})=>({listStyle:"none",margin:0,padding:"8px 0",maxHeight:"40vh",overflow:"auto",position:"relative",[`& .${tn.option}`]:{minHeight:48,display:"flex",overflow:"hidden",justifyContent:"flex-start",alignItems:"center",cursor:"pointer",paddingTop:6,boxSizing:"border-box",outline:"0",WebkitTapHighlightColor:"transparent",paddingBottom:6,paddingLeft:16,paddingRight:16,[e.breakpoints.up("sm")]:{minHeight:"auto"},[`&.${tn.focused}`]:{backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},'&[aria-disabled="true"]':{opacity:(e.vars||e).palette.action.disabledOpacity,pointerEvents:"none"},[`&.${tn.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},'&[aria-selected="true"]':{backgroundColor:e.alpha((e.vars||e).palette.primary.main,(e.vars||e).palette.action.selectedOpacity),[`&.${tn.focused}`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.hoverOpacity}`),"@media (hover: none)":{backgroundColor:(e.vars||e).palette.action.selected}},[`&.${tn.focusVisible}`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.focusOpacity}`)}}}}))),epe=Ye(oC,{name:"MuiAutocomplete",slot:"GroupLabel"})(hn(({theme:e})=>({backgroundColor:(e.vars||e).palette.background.paper,top:-8}))),tpe=Ye("ul",{name:"MuiAutocomplete",slot:"GroupUl"})({padding:0,[`& .${tn.option}`]:{paddingLeft:24}}),npe=A.forwardRef(function(e,t){const n=sn({props:e,name:"MuiAutocomplete"}),{autoComplete:r=!1,autoHighlight:o=!1,autoSelect:a=!1,blurOnSelect:i=!1,ChipProps:l,className:u,clearIcon:d=SP||(SP=v.jsx($de,{fontSize:"small"})),clearOnBlur:p=!n.freeSolo,clearOnEscape:h=!1,clearText:y="Clear",closeText:g="Close",componentsProps:b,defaultValue:x=n.multiple?[]:null,disableClearable:S=!1,disableCloseOnSelect:E=!1,disabled:_=!1,disabledItemsFocusable:C=!1,disableListWrap:R=!1,disablePortal:O=!1,filterOptions:I,filterSelectedOptions:F=!1,forcePopupIcon:H="auto",freeSolo:z=!1,fullWidth:L=!1,getLimitTagsText:$=Vt=>`+${Vt}`,getOptionDisabled:k,getOptionKey:M,getOptionLabel:j,isOptionEqualToValue:V,groupBy:B,handleHomeEndKeys:q=!n.freeSolo,id:Y,includeInputInList:ee=!1,inputValue:N,limitTags:W=-1,ListboxComponent:K,ListboxProps:P,loading:Z=!1,loadingText:ae="Loading…",multiple:J=!1,noOptionsText:pe="No options",onChange:le,onClose:Ee,onHighlightChange:Te,onInputChange:Ae,onOpen:Ue,open:Re,openOnFocus:ve=!1,openText:pt="Open",options:ut,PaperComponent:ze,PopperComponent:$e,popupIcon:dt=TP||(TP=v.jsx(yF,{})),readOnly:Be=!1,renderGroup:Fe,renderInput:Me,renderOption:At,renderTags:Dt,renderValue:gt,selectOnFocus:ue=!n.freeSolo,size:ge="medium",slots:He={},slotProps:rt={},value:tt,...qe}=n,{getRootProps:Ut,getInputProps:Gt,getInputLabelProps:nt,getPopupIndicatorProps:se,getClearProps:he,getItemProps:at,getListboxProps:ft,getOptionProps:Nn,value:Jn,dirty:_r,expanded:zn,id:er,popupOpen:ar,focused:vn,focusedItem:fr,anchorEl:Ct,setAnchorEl:re,inputValue:de,groupedOptions:be}=Tce({...n,componentName:"Autocomplete"}),Pe=!S&&!_&&_r&&!Be,We=(!z||H===!0)&&H!==!1,{onMouseDown:yt}=Gt(),{ref:Et,...bt}=ft(),xt=j||(Vt=>Vt.label??Vt),ht={...n,disablePortal:O,expanded:zn,focused:vn,fullWidth:L,getOptionLabel:xt,hasClearIcon:Pe,hasPopupIcon:We,inputFocused:fr===-1,popupOpen:ar,size:ge},st=Vde(ht),mt={slots:{paper:ze,popper:$e,...He},slotProps:{chip:l,listbox:P,...b,...rt}},[qt,mn]=xn("listbox",{elementType:Jde,externalForwardedProps:mt,ownerState:ht,className:st.listbox,additionalProps:bt,ref:Et}),[$n,Hn]=xn("paper",{elementType:gp,externalForwardedProps:mt,ownerState:ht,className:st.paper}),[$t,xe]=xn("popper",{elementType:fF,externalForwardedProps:mt,ownerState:ht,className:st.popper,additionalProps:{disablePortal:O,style:{width:Ct?Ct.clientWidth:null},role:"presentation",anchorEl:Ct,open:ar}});let _e;const it=Vt=>({className:st.tag,disabled:_,...at(Vt)});if(J?Jn.length>0&&(Dt?_e=Dt(Jn,it,ht):gt?_e=gt(Jn,it,ht):_e=Jn.map((Vt,Gr)=>{const{key:Ft,...tr}=it({index:Gr});return v.jsx(Ode,{label:xt(Vt),size:ge,...tr,...mt.slotProps.chip},Ft)})):gt&&Jn!=null&&(_e=gt(Jn,it,ht)),W>-1&&Array.isArray(_e)){const Vt=_e.length-W;!vn&&Vt>0&&(_e=_e.splice(0,W),_e.push(v.jsx("span",{className:st.tag,children:$(Vt)},_e.length)))}const _t=Fe||(Vt=>v.jsxs("li",{children:[v.jsx(epe,{className:st.groupLabel,ownerState:ht,component:"div",children:Vt.group}),v.jsx(tpe,{className:st.groupUl,ownerState:ht,children:Vt.children})]},Vt.key)),Lt=At||((Vt,Gr)=>{const{key:Ft,...tr}=Vt;return v.jsx("li",{...tr,children:xt(Gr)},Ft)}),En=(Vt,Gr)=>{const Ft=Nn({option:Vt,index:Gr});return Lt({...Ft,className:st.option},Vt,{selected:Ft["aria-selected"],index:Gr,inputValue:de},ht)},Kn=mt.slotProps.clearIndicator,so=mt.slotProps.popupIndicator;return v.jsxs(A.Fragment,{children:[v.jsx(Gde,{ref:t,className:Tt(st.root,u),ownerState:ht,...Ut(qe),children:Me({id:er,disabled:_,fullWidth:!0,size:ge==="small"?"small":void 0,InputLabelProps:nt(),InputProps:{ref:re,className:st.inputRoot,startAdornment:_e,onMouseDown:Vt=>{Vt.target===Vt.currentTarget&&yt(Vt)},...(Pe||We)&&{endAdornment:v.jsxs(qde,{className:st.endAdornment,ownerState:ht,children:[Pe?v.jsx(Wde,{...he(),"aria-label":y,title:y,ownerState:ht,...Kn,className:Tt(st.clearIndicator,Kn?.className),children:d}):null,We?v.jsx(Yde,{...se(),disabled:_,"aria-label":ar?g:pt,title:ar?g:pt,ownerState:ht,...so,className:Tt(st.popupIndicator,so?.className),children:dt}):null]})}},inputProps:{className:st.input,disabled:_,readOnly:Be,...Gt()}})}),Ct?v.jsx(Kde,{as:$t,...xe,children:v.jsxs(Qde,{as:$n,...Hn,children:[Z&&be.length===0?v.jsx(Xde,{className:st.loading,ownerState:ht,children:ae}):null,be.length===0&&!z&&!Z?v.jsx(Zde,{className:st.noOptions,ownerState:ht,role:"presentation",onMouseDown:Vt=>{Vt.preventDefault()},children:pe}):null,be.length>0?v.jsx(qt,{as:K,...mn,children:be.map((Vt,Gr)=>B?_t({key:Vt.key,group:Vt.group,children:Vt.options.map((Ft,tr)=>En(Ft,Vt.index+tr))}):En(Vt,Gr))}):null]})}):null]})}),rpe=e=>{const{classes:t,disableUnderline:n}=e,r=Jt({root:["root",!n&&"underline"],input:["input"]},Bde,t);return{...t,...r}},ope=Ye(Hv,{shouldForwardProp:e=>Do(e)||e==="classes",name:"MuiInput",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[...zv(e,t),!n.disableUnderline&&t.underline]}})(hn(({theme:e})=>{let t=e.palette.mode==="light"?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return e.vars&&(t=e.alpha(e.vars.palette.common.onBackground,e.vars.opacity.inputUnderline)),{position:"relative",variants:[{props:({ownerState:n})=>n.formControl,style:{"label + &":{marginTop:16}}},{props:({ownerState:n})=>!n.disableUnderline,style:{"&::after":{left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${Tl.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${Tl.error}`]:{"&::before, &::after":{borderBottomColor:(e.vars||e).palette.error.main}},"&::before":{borderBottom:`1px solid ${t}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${Tl.disabled}, .${Tl.error}):before`]:{borderBottom:`2px solid ${(e.vars||e).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${t}`}},[`&.${Tl.disabled}:before`]:{borderBottomStyle:"dotted"}}},...Object.entries(e.palette).filter(ko()).map(([n])=>({props:{color:n,disableUnderline:!1},style:{"&::after":{borderBottom:`2px solid ${(e.vars||e).palette[n].main}`}}}))]}})),ape=Ye(Vv,{name:"MuiInput",slot:"Input",overridesResolver:$v})({}),N_=A.forwardRef(function(e,t){const n=sn({props:e,name:"MuiInput"}),{disableUnderline:r=!1,components:o={},componentsProps:a,fullWidth:i=!1,inputComponent:l="input",multiline:u=!1,slotProps:d,slots:p={},type:h="text",...y}=n,g=rpe(n),b={root:{ownerState:{disableUnderline:r}}},x=d??a?yo(d??a,b):b,S=p.root??o.Root??ope,E=p.input??o.Input??ape;return v.jsx(O_,{slots:{root:S,input:E},slotProps:x,fullWidth:i,inputComponent:l,multiline:u,ref:t,type:h,...y,classes:g})});N_.muiName="Input";const ipe=e=>{const{classes:t,disableUnderline:n,startAdornment:r,endAdornment:o,size:a,hiddenLabel:i,multiline:l}=e,u={root:["root",!n&&"underline",r&&"adornedStart",o&&"adornedEnd",a==="small"&&`size${Ze(a)}`,i&&"hiddenLabel",l&&"multiline"],input:["input"]},d=Jt(u,zde,t);return{...t,...d}},spe=Ye(Hv,{shouldForwardProp:e=>Do(e)||e==="classes",name:"MuiFilledInput",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[...zv(e,t),!n.disableUnderline&&t.underline]}})(hn(({theme:e})=>{const t=e.palette.mode==="light",n=t?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)",r=t?"rgba(0, 0, 0, 0.06)":"rgba(255, 255, 255, 0.09)",o=t?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.13)",a=t?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)";return{position:"relative",backgroundColor:e.vars?e.vars.palette.FilledInput.bg:r,borderTopLeftRadius:(e.vars||e).shape.borderRadius,borderTopRightRadius:(e.vars||e).shape.borderRadius,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),"&:hover":{backgroundColor:e.vars?e.vars.palette.FilledInput.hoverBg:o,"@media (hover: none)":{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:r}},[`&.${da.focused}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:r},[`&.${da.disabled}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.disabledBg:a},variants:[{props:({ownerState:i})=>!i.disableUnderline,style:{"&::after":{left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${da.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${da.error}`]:{"&::before, &::after":{borderBottomColor:(e.vars||e).palette.error.main}},"&::before":{borderBottom:`1px solid ${e.vars?e.alpha(e.vars.palette.common.onBackground,e.vars.opacity.inputUnderline):n}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${da.disabled}, .${da.error}):before`]:{borderBottom:`1px solid ${(e.vars||e).palette.text.primary}`},[`&.${da.disabled}:before`]:{borderBottomStyle:"dotted"}}},...Object.entries(e.palette).filter(ko()).map(([i])=>({props:{disableUnderline:!1,color:i},style:{"&::after":{borderBottom:`2px solid ${(e.vars||e).palette[i]?.main}`}}})),{props:({ownerState:i})=>i.startAdornment,style:{paddingLeft:12}},{props:({ownerState:i})=>i.endAdornment,style:{paddingRight:12}},{props:({ownerState:i})=>i.multiline,style:{padding:"25px 12px 8px"}},{props:({ownerState:i,size:l})=>i.multiline&&l==="small",style:{paddingTop:21,paddingBottom:4}},{props:({ownerState:i})=>i.multiline&&i.hiddenLabel,style:{paddingTop:16,paddingBottom:17}},{props:({ownerState:i})=>i.multiline&&i.hiddenLabel&&i.size==="small",style:{paddingTop:8,paddingBottom:9}}]}})),lpe=Ye(Vv,{name:"MuiFilledInput",slot:"Input",overridesResolver:$v})(hn(({theme:e})=>({paddingTop:25,paddingRight:12,paddingBottom:8,paddingLeft:12,...!e.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:e.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:e.palette.mode==="light"?null:"#fff",caretColor:e.palette.mode==="light"?null:"#fff",borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"}},...e.vars&&{"&:-webkit-autofill":{borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"},[e.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},variants:[{props:{size:"small"},style:{paddingTop:21,paddingBottom:4}},{props:({ownerState:t})=>t.hiddenLabel,style:{paddingTop:16,paddingBottom:17}},{props:({ownerState:t})=>t.startAdornment,style:{paddingLeft:0}},{props:({ownerState:t})=>t.endAdornment,style:{paddingRight:0}},{props:({ownerState:t})=>t.hiddenLabel&&t.size==="small",style:{paddingTop:8,paddingBottom:9}},{props:({ownerState:t})=>t.multiline,style:{paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:0}}]}))),P_=A.forwardRef(function(e,t){const n=sn({props:e,name:"MuiFilledInput"}),{disableUnderline:r=!1,components:o={},componentsProps:a,fullWidth:i=!1,hiddenLabel:l,inputComponent:u="input",multiline:d=!1,slotProps:p,slots:h={},type:y="text",...g}=n,b={...n,disableUnderline:r,fullWidth:i,inputComponent:u,multiline:d,type:y},x=ipe(n),S={root:{ownerState:b},input:{ownerState:b}},E=p??a?yo(S,p??a):S,_=h.root??o.Root??spe,C=h.input??o.Input??lpe;return v.jsx(O_,{slots:{root:_,input:C},slotProps:E,fullWidth:i,inputComponent:u,multiline:d,ref:t,type:y,...g,classes:x})});P_.muiName="Input";var CP;const cpe=Ye("fieldset",{name:"MuiNotchedOutlined",shouldForwardProp:Do})({textAlign:"left",position:"absolute",bottom:0,right:0,top:-5,left:0,margin:0,padding:"0 8px",pointerEvents:"none",borderRadius:"inherit",borderStyle:"solid",borderWidth:1,overflow:"hidden",minWidth:"0%"}),upe=Ye("legend",{name:"MuiNotchedOutlined",shouldForwardProp:Do})(hn(({theme:e})=>({float:"unset",width:"auto",overflow:"hidden",variants:[{props:({ownerState:t})=>!t.withLabel,style:{padding:0,lineHeight:"11px",transition:e.transitions.create("width",{duration:150,easing:e.transitions.easing.easeOut})}},{props:({ownerState:t})=>t.withLabel,style:{display:"block",padding:0,height:11,fontSize:"0.75em",visibility:"hidden",maxWidth:.01,transition:e.transitions.create("max-width",{duration:50,easing:e.transitions.easing.easeOut}),whiteSpace:"nowrap","& > span":{paddingLeft:5,paddingRight:5,display:"inline-block",opacity:0,visibility:"visible"}}},{props:({ownerState:t})=>t.withLabel&&t.notched,style:{maxWidth:"100%",transition:e.transitions.create("max-width",{duration:100,easing:e.transitions.easing.easeOut,delay:50})}}]})));function dpe(e){const{children:t,classes:n,className:r,label:o,notched:a,...i}=e,l=o!=null&&o!=="",u={...e,notched:a,withLabel:l};return v.jsx(cpe,{"aria-hidden":!0,className:r,ownerState:u,...i,children:v.jsx(upe,{ownerState:u,children:l?v.jsx("span",{children:o}):CP||(CP=v.jsx("span",{className:"notranslate","aria-hidden":!0,children:"​"}))})})}const ppe=e=>{const{classes:t}=e,n=Jt({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},Ude,t);return{...t,...n}},fpe=Ye(Hv,{shouldForwardProp:e=>Do(e)||e==="classes",name:"MuiOutlinedInput",slot:"Root",overridesResolver:zv})(hn(({theme:e})=>{const t=e.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{position:"relative",borderRadius:(e.vars||e).shape.borderRadius,[`&:hover .${Na.notchedOutline}`]:{borderColor:(e.vars||e).palette.text.primary},"@media (hover: none)":{[`&:hover .${Na.notchedOutline}`]:{borderColor:e.vars?e.alpha(e.vars.palette.common.onBackground,.23):t}},[`&.${Na.focused} .${Na.notchedOutline}`]:{borderWidth:2},variants:[...Object.entries(e.palette).filter(ko()).map(([n])=>({props:{color:n},style:{[`&.${Na.focused} .${Na.notchedOutline}`]:{borderColor:(e.vars||e).palette[n].main}}})),{props:{},style:{[`&.${Na.error} .${Na.notchedOutline}`]:{borderColor:(e.vars||e).palette.error.main},[`&.${Na.disabled} .${Na.notchedOutline}`]:{borderColor:(e.vars||e).palette.action.disabled}}},{props:({ownerState:n})=>n.startAdornment,style:{paddingLeft:14}},{props:({ownerState:n})=>n.endAdornment,style:{paddingRight:14}},{props:({ownerState:n})=>n.multiline,style:{padding:"16.5px 14px"}},{props:({ownerState:n,size:r})=>n.multiline&&r==="small",style:{padding:"8.5px 14px"}}]}})),hpe=Ye(dpe,{name:"MuiOutlinedInput",slot:"NotchedOutline"})(hn(({theme:e})=>{const t=e.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{borderColor:e.vars?e.alpha(e.vars.palette.common.onBackground,.23):t}})),mpe=Ye(Vv,{name:"MuiOutlinedInput",slot:"Input",overridesResolver:$v})(hn(({theme:e})=>({padding:"16.5px 14px",...!e.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:e.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:e.palette.mode==="light"?null:"#fff",caretColor:e.palette.mode==="light"?null:"#fff",borderRadius:"inherit"}},...e.vars&&{"&:-webkit-autofill":{borderRadius:"inherit"},[e.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},variants:[{props:{size:"small"},style:{padding:"8.5px 14px"}},{props:({ownerState:t})=>t.multiline,style:{padding:0}},{props:({ownerState:t})=>t.startAdornment,style:{paddingLeft:0}},{props:({ownerState:t})=>t.endAdornment,style:{paddingRight:0}}]}))),L_=A.forwardRef(function(e,t){const n=sn({props:e,name:"MuiOutlinedInput"}),{components:r={},fullWidth:o=!1,inputComponent:a="input",label:i,multiline:l=!1,notched:u,slots:d={},slotProps:p={},type:h="text",...y}=n,g=ppe(n),b=uu(),x=yp({props:n,muiFormControl:b,states:["color","disabled","error","focused","hiddenLabel","size","required"]}),S={...n,color:x.color||"primary",disabled:x.disabled,error:x.error,focused:x.focused,formControl:b,fullWidth:o,hiddenLabel:x.hiddenLabel,multiline:l,size:x.size,type:h},E=d.root??r.Root??fpe,_=d.input??r.Input??mpe,[C,R]=xn("notchedOutline",{elementType:hpe,className:g.notchedOutline,shouldForwardComponentProp:!0,ownerState:S,externalForwardedProps:{slots:d,slotProps:p},additionalProps:{label:i!=null&&i!==""&&x.required?v.jsxs(A.Fragment,{children:[i," ","*"]}):i}});return v.jsx(O_,{slots:{root:E,input:_},slotProps:p,renderSuffix:O=>v.jsx(C,{...R,notched:typeof u<"u"?u:!!(O.startAdornment||O.filled||O.focused)}),fullWidth:o,inputComponent:a,multiline:l,ref:t,type:h,...y,classes:{...g,notchedOutline:null}})});L_.muiName="Input";function gpe(e){return en("MuiFormLabel",e)}const Ah=Wt("MuiFormLabel",["root","colorSecondary","focused","disabled","error","filled","required","asterisk"]),ype=e=>{const{classes:t,color:n,focused:r,disabled:o,error:a,filled:i,required:l}=e,u={root:["root",`color${Ze(n)}`,o&&"disabled",a&&"error",i&&"filled",r&&"focused",l&&"required"],asterisk:["asterisk",a&&"error"]};return Jt(u,gpe,t)},bpe=Ye("label",{name:"MuiFormLabel",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.color==="secondary"&&t.colorSecondary,n.filled&&t.filled]}})(hn(({theme:e})=>({color:(e.vars||e).palette.text.secondary,...e.typography.body1,lineHeight:"1.4375em",padding:0,position:"relative",variants:[...Object.entries(e.palette).filter(ko()).map(([t])=>({props:{color:t},style:{[`&.${Ah.focused}`]:{color:(e.vars||e).palette[t].main}}})),{props:{},style:{[`&.${Ah.disabled}`]:{color:(e.vars||e).palette.text.disabled},[`&.${Ah.error}`]:{color:(e.vars||e).palette.error.main}}}]}))),vpe=Ye("span",{name:"MuiFormLabel",slot:"Asterisk"})(hn(({theme:e})=>({[`&.${Ah.error}`]:{color:(e.vars||e).palette.error.main}}))),Epe=A.forwardRef(function(e,t){const n=sn({props:e,name:"MuiFormLabel"}),{children:r,className:o,color:a,component:i="label",disabled:l,error:u,filled:d,focused:p,required:h,...y}=n,g=uu(),b=yp({props:n,muiFormControl:g,states:["color","required","focused","disabled","error","filled"]}),x={...n,color:b.color||"primary",component:i,disabled:b.disabled,error:b.error,filled:b.filled,focused:b.focused,required:b.required},S=ype(x);return v.jsxs(bpe,{as:i,ownerState:x,className:Tt(S.root,o),ref:t,...y,children:[r,b.required&&v.jsxs(vpe,{ownerState:x,"aria-hidden":!0,className:S.asterisk,children:[" ","*"]})]})});function xpe(e){return en("MuiInputLabel",e)}Wt("MuiInputLabel",["root","focused","disabled","error","required","asterisk","formControl","sizeSmall","shrink","animated","standard","filled","outlined"]);const Spe=e=>{const{classes:t,formControl:n,size:r,shrink:o,disableAnimation:a,variant:i,required:l}=e,u={root:["root",n&&"formControl",!a&&"animated",o&&"shrink",r&&r!=="medium"&&`size${Ze(r)}`,i],asterisk:[l&&"asterisk"]},d=Jt(u,xpe,t);return{...t,...d}},Tpe=Ye(Epe,{shouldForwardProp:e=>Do(e)||e==="classes",name:"MuiInputLabel",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${Ah.asterisk}`]:t.asterisk},t.root,n.formControl&&t.formControl,n.size==="small"&&t.sizeSmall,n.shrink&&t.shrink,!n.disableAnimation&&t.animated,n.focused&&t.focused,t[n.variant]]}})(hn(({theme:e})=>({display:"block",transformOrigin:"top left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%",variants:[{props:({ownerState:t})=>t.formControl,style:{position:"absolute",left:0,top:0,transform:"translate(0, 20px) scale(1)"}},{props:{size:"small"},style:{transform:"translate(0, 17px) scale(1)"}},{props:({ownerState:t})=>t.shrink,style:{transform:"translate(0, -1.5px) scale(0.75)",transformOrigin:"top left",maxWidth:"133%"}},{props:({ownerState:t})=>!t.disableAnimation,style:{transition:e.transitions.create(["color","transform","max-width"],{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut})}},{props:{variant:"filled"},style:{zIndex:1,pointerEvents:"none",transform:"translate(12px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"}},{props:{variant:"filled",size:"small"},style:{transform:"translate(12px, 13px) scale(1)"}},{props:({variant:t,ownerState:n})=>t==="filled"&&n.shrink,style:{userSelect:"none",pointerEvents:"auto",transform:"translate(12px, 7px) scale(0.75)",maxWidth:"calc(133% - 24px)"}},{props:({variant:t,ownerState:n,size:r})=>t==="filled"&&n.shrink&&r==="small",style:{transform:"translate(12px, 4px) scale(0.75)"}},{props:{variant:"outlined"},style:{zIndex:1,pointerEvents:"none",transform:"translate(14px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"}},{props:{variant:"outlined",size:"small"},style:{transform:"translate(14px, 9px) scale(1)"}},{props:({variant:t,ownerState:n})=>t==="outlined"&&n.shrink,style:{userSelect:"none",pointerEvents:"auto",maxWidth:"calc(133% - 32px)",transform:"translate(14px, -9px) scale(0.75)"}}]}))),Cpe=A.forwardRef(function(e,t){const n=sn({name:"MuiInputLabel",props:e}),{disableAnimation:r=!1,margin:o,shrink:a,variant:i,className:l,...u}=n,d=uu();let p=a;typeof p>"u"&&d&&(p=d.filled||d.focused||d.adornedStart);const h=yp({props:n,muiFormControl:d,states:["size","variant","required","focused"]}),y={...n,disableAnimation:r,formControl:d,shrink:p,size:h.size,variant:h.variant,required:h.required,focused:h.focused},g=Spe(y);return v.jsx(Tpe,{"data-shrink":p,ref:t,className:Tt(g.root,l),...u,ownerState:y,classes:g})});function Ape(e){return en("MuiFormControl",e)}Wt("MuiFormControl",["root","marginNone","marginNormal","marginDense","fullWidth","disabled"]);const _pe=e=>{const{classes:t,margin:n,fullWidth:r}=e,o={root:["root",n!=="none"&&`margin${Ze(n)}`,r&&"fullWidth"]};return Jt(o,Ape,t)},kpe=Ye("div",{name:"MuiFormControl",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`margin${Ze(n.margin)}`],n.fullWidth&&t.fullWidth]}})({display:"inline-flex",flexDirection:"column",position:"relative",minWidth:0,padding:0,margin:0,border:0,verticalAlign:"top",variants:[{props:{margin:"normal"},style:{marginTop:16,marginBottom:8}},{props:{margin:"dense"},style:{marginTop:8,marginBottom:4}},{props:{fullWidth:!0},style:{width:"100%"}}]}),wpe=A.forwardRef(function(e,t){const n=sn({props:e,name:"MuiFormControl"}),{children:r,className:o,color:a="primary",component:i="div",disabled:l=!1,error:u=!1,focused:d,fullWidth:p=!1,hiddenLabel:h=!1,margin:y="none",required:g=!1,size:b="medium",variant:x="outlined",...S}=n,E={...n,color:a,component:i,disabled:l,error:u,fullWidth:p,hiddenLabel:h,margin:y,required:g,size:b,variant:x},_=_pe(E),[C,R]=A.useState(()=>{let j=!1;return r&&A.Children.forEach(r,V=>{if(!Jx(V,["Input","Select"]))return;const B=Jx(V,["Select"])?V.props.input:V;B&&Mde(B.props)&&(j=!0)}),j}),[O,I]=A.useState(()=>{let j=!1;return r&&A.Children.forEach(r,V=>{Jx(V,["Input","Select"])&&(bb(V.props,!0)||bb(V.props.inputProps,!0))&&(j=!0)}),j}),[F,H]=A.useState(!1);l&&F&&H(!1);const z=d!==void 0&&!l?d:F;let L;A.useRef(!1);const $=A.useCallback(()=>{I(!0)},[]),k=A.useCallback(()=>{I(!1)},[]),M=A.useMemo(()=>({adornedStart:C,setAdornedStart:R,color:a,disabled:l,error:u,filled:O,focused:z,fullWidth:p,hiddenLabel:h,size:b,onBlur:()=>{H(!1)},onFocus:()=>{H(!0)},onEmpty:k,onFilled:$,registerEffect:L,required:g,variant:x}),[C,a,l,u,O,z,p,h,L,k,$,g,b,x]);return v.jsx(I_.Provider,{value:M,children:v.jsx(kpe,{as:i,ownerState:E,className:Tt(_.root,o),ref:t,...S,children:r})})});function Rpe(e){return en("MuiFormHelperText",e)}const AP=Wt("MuiFormHelperText",["root","error","disabled","sizeSmall","sizeMedium","contained","focused","filled","required"]);var _P;const Dpe=e=>{const{classes:t,contained:n,size:r,disabled:o,error:a,filled:i,focused:l,required:u}=e,d={root:["root",o&&"disabled",a&&"error",r&&`size${Ze(r)}`,n&&"contained",l&&"focused",i&&"filled",u&&"required"]};return Jt(d,Rpe,t)},Ipe=Ye("p",{name:"MuiFormHelperText",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.size&&t[`size${Ze(n.size)}`],n.contained&&t.contained,n.filled&&t.filled]}})(hn(({theme:e})=>({color:(e.vars||e).palette.text.secondary,...e.typography.caption,textAlign:"left",marginTop:3,marginRight:0,marginBottom:0,marginLeft:0,[`&.${AP.disabled}`]:{color:(e.vars||e).palette.text.disabled},[`&.${AP.error}`]:{color:(e.vars||e).palette.error.main},variants:[{props:{size:"small"},style:{marginTop:4}},{props:({ownerState:t})=>t.contained,style:{marginLeft:14,marginRight:14}}]}))),Ope=A.forwardRef(function(e,t){const n=sn({props:e,name:"MuiFormHelperText"}),{children:r,className:o,component:a="p",disabled:i,error:l,filled:u,focused:d,margin:p,required:h,variant:y,...g}=n,b=uu(),x=yp({props:n,muiFormControl:b,states:["variant","size","disabled","error","filled","focused","required"]}),S={...n,component:a,contained:x.variant==="filled"||x.variant==="outlined",variant:x.variant,size:x.size,disabled:x.disabled,error:x.error,filled:x.filled,focused:x.focused,required:x.required};delete S.ownerState;const E=Dpe(S);return v.jsx(Ipe,{as:a,className:Tt(E.root,o),ref:t,...g,ownerState:S,children:r===" "?_P||(_P=v.jsx("span",{className:"notranslate","aria-hidden":!0,children:"​"})):r})}),uC=A.createContext({});function Npe(e){return en("MuiList",e)}Wt("MuiList",["root","padding","dense","subheader"]);const Ppe=e=>{const{classes:t,disablePadding:n,dense:r,subheader:o}=e;return Jt({root:["root",!n&&"padding",r&&"dense",o&&"subheader"]},Npe,t)},Lpe=Ye("ul",{name:"MuiList",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,!n.disablePadding&&t.padding,n.dense&&t.dense,n.subheader&&t.subheader]}})({listStyle:"none",margin:0,padding:0,position:"relative",variants:[{props:({ownerState:e})=>!e.disablePadding,style:{paddingTop:8,paddingBottom:8}},{props:({ownerState:e})=>e.subheader,style:{paddingTop:0}}]}),Mpe=A.forwardRef(function(e,t){const n=sn({props:e,name:"MuiList"}),{children:r,className:o,component:a="ul",dense:i=!1,disablePadding:l=!1,subheader:u,...d}=n,p=A.useMemo(()=>({dense:i}),[i]),h={...n,component:a,dense:i,disablePadding:l},y=Ppe(h);return v.jsx(uC.Provider,{value:p,children:v.jsxs(Lpe,{as:a,className:Tt(y.root,o),ref:t,ownerState:h,...d,children:[u,r]})})});function bF(e=window){const t=e.document.documentElement.clientWidth;return e.innerWidth-t}function cS(e,t,n){return e===t?e.firstChild:t&&t.nextElementSibling?t.nextElementSibling:n?null:e.firstChild}function kP(e,t,n){return e===t?n?e.firstChild:e.lastChild:t&&t.previousElementSibling?t.previousElementSibling:n?null:e.lastChild}function vF(e,t){if(t===void 0)return!0;let n=e.innerText;return n===void 0&&(n=e.textContent),n=n.trim().toLowerCase(),n.length===0?!1:t.repeating?n[0]===t.keys[0]:n.startsWith(t.keys.join(""))}function $f(e,t,n,r,o,a){let i=!1,l=o(e,t,t?n:!1);for(;l;){if(l===e.firstChild){if(i)return!1;i=!0}const u=r?!1:l.disabled||l.getAttribute("aria-disabled")==="true";if(!l.hasAttribute("tabindex")||!vF(l,a)||u)l=o(e,l,n);else return l.focus(),!0}return!1}const Fpe=A.forwardRef(function(e,t){const{actions:n,autoFocus:r=!1,autoFocusItem:o=!1,children:a,className:i,disabledItemsFocusable:l=!1,disableListWrap:u=!1,onKeyDown:d,variant:p="selectedMenu",...h}=e,y=A.useRef(null),g=A.useRef({keys:[],repeating:!0,previousKeyMatched:!0,lastTime:null});Gi(()=>{r&&y.current.focus()},[r]),A.useImperativeHandle(n,()=>({adjustStyleForScrollbar:(_,{direction:C})=>{const R=!y.current.style.width;if(_.clientHeight<y.current.clientHeight&&R){const O=`${bF(Ns(_))}px`;y.current.style[C==="rtl"?"paddingLeft":"paddingRight"]=O,y.current.style.width=`calc(100% + ${O})`}return y.current}}),[]);const b=_=>{const C=y.current,R=_.key;if(_.ctrlKey||_.metaKey||_.altKey){d&&d(_);return}const O=ao(C).activeElement;if(R==="ArrowDown")_.preventDefault(),$f(C,O,u,l,cS);else if(R==="ArrowUp")_.preventDefault(),$f(C,O,u,l,kP);else if(R==="Home")_.preventDefault(),$f(C,null,u,l,cS);else if(R==="End")_.preventDefault(),$f(C,null,u,l,kP);else if(R.length===1){const I=g.current,F=R.toLowerCase(),H=performance.now();I.keys.length>0&&(H-I.lastTime>500?(I.keys=[],I.repeating=!0,I.previousKeyMatched=!0):I.repeating&&F!==I.keys[0]&&(I.repeating=!1)),I.lastTime=H,I.keys.push(F);const z=O&&!I.repeating&&vF(O,I);I.previousKeyMatched&&(z||$f(C,O,!1,l,cS,I))?_.preventDefault():I.previousKeyMatched=!1}d&&d(_)},x=sr(y,t);let S=-1;A.Children.forEach(a,(_,C)=>{if(!A.isValidElement(_)){S===C&&(S+=1,S>=a.length&&(S=-1));return}_.props.disabled||(p==="selectedMenu"&&_.props.selected||S===-1)&&(S=C),S===C&&(_.props.disabled||_.props.muiSkipListHighlight||_.type.muiSkipListHighlight)&&(S+=1,S>=a.length&&(S=-1))});const E=A.Children.map(a,(_,C)=>{if(C===S){const R={};return o&&(R.autoFocus=!0),_.props.tabIndex===void 0&&p==="selectedMenu"&&(R.tabIndex=0),A.cloneElement(_,R)}return _});return v.jsx(Mpe,{role:"menu",ref:x,className:i,onKeyDown:b,tabIndex:r?0:-1,...h,children:E})}),EF=e=>e.scrollTop;function Xd(e,t){const{timeout:n,easing:r,style:o={}}=e;return{duration:o.transitionDuration??(typeof n=="number"?n:n[t.mode]||0),easing:o.transitionTimingFunction??(typeof r=="object"?r[t.mode]:r),delay:o.transitionDelay}}function dC(e){return`scale(${e}, ${e**2})`}const jpe={entering:{opacity:1,transform:dC(1)},entered:{opacity:1,transform:"none"}},uS=typeof navigator<"u"&&/^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent)&&/(os |version\/)15(.|_)4/i.test(navigator.userAgent),vb=A.forwardRef(function(e,t){const{addEndListener:n,appear:r=!0,children:o,easing:a,in:i,onEnter:l,onEntered:u,onEntering:d,onExit:p,onExited:h,onExiting:y,style:g,timeout:b="auto",TransitionComponent:x=hi,...S}=e,E=Uv(),_=A.useRef(),C=dp(),R=A.useRef(null),O=sr(R,mp(o),t),I=M=>j=>{if(M){const V=R.current;j===void 0?M(V):M(V,j)}},F=I(d),H=I((M,j)=>{EF(M);const{duration:V,delay:B,easing:q}=Xd({style:g,timeout:b,easing:a},{mode:"enter"});let Y;b==="auto"?(Y=C.transitions.getAutoHeightDuration(M.clientHeight),_.current=Y):Y=V,M.style.transition=[C.transitions.create("opacity",{duration:Y,delay:B}),C.transitions.create("transform",{duration:uS?Y:Y*.666,delay:B,easing:q})].join(","),l&&l(M,j)}),z=I(u),L=I(y),$=I(M=>{const{duration:j,delay:V,easing:B}=Xd({style:g,timeout:b,easing:a},{mode:"exit"});let q;b==="auto"?(q=C.transitions.getAutoHeightDuration(M.clientHeight),_.current=q):q=j,M.style.transition=[C.transitions.create("opacity",{duration:q,delay:V}),C.transitions.create("transform",{duration:uS?q:q*.666,delay:uS?V:V||q*.333,easing:B})].join(","),M.style.opacity=0,M.style.transform=dC(.75),p&&p(M)}),k=I(h);return v.jsx(x,{appear:r,in:i,nodeRef:R,onEnter:H,onEntered:z,onEntering:F,onExit:$,onExited:k,onExiting:L,addEndListener:M=>{b==="auto"&&E.start(_.current||0,M),n&&n(R.current,M)},timeout:b==="auto"?null:b,...S,children:(M,{ownerState:j,...V})=>A.cloneElement(o,{style:{opacity:0,transform:dC(.75),visibility:M==="exited"&&!i?"hidden":void 0,...jpe[M],...g,...o.props.style},ref:O,...V})})});vb&&(vb.muiSupportAuto=!0);function Bpe(e){const t=ao(e);return t.body===e?Ns(e).innerWidth>t.documentElement.clientWidth:e.scrollHeight>e.clientHeight}function _h(e,t){t?e.setAttribute("aria-hidden","true"):e.removeAttribute("aria-hidden")}function wP(e){return parseInt(Ns(e).getComputedStyle(e).paddingRight,10)||0}function Upe(e){const t=["TEMPLATE","SCRIPT","STYLE","LINK","MAP","META","NOSCRIPT","PICTURE","COL","COLGROUP","PARAM","SLOT","SOURCE","TRACK"].includes(e.tagName),n=e.tagName==="INPUT"&&e.getAttribute("type")==="hidden";return t||n}function RP(e,t,n,r,o){const a=[t,n,...r];[].forEach.call(e.children,i=>{const l=!a.includes(i),u=!Upe(i);l&&u&&_h(i,o)})}function dS(e,t){let n=-1;return e.some((r,o)=>t(r)?(n=o,!0):!1),n}function zpe(e,t){const n=[],r=e.container;if(!t.disableScrollLock){if(Bpe(r)){const a=bF(Ns(r));n.push({value:r.style.paddingRight,property:"padding-right",el:r}),r.style.paddingRight=`${wP(r)+a}px`;const i=ao(r).querySelectorAll(".mui-fixed");[].forEach.call(i,l=>{n.push({value:l.style.paddingRight,property:"padding-right",el:l}),l.style.paddingRight=`${wP(l)+a}px`})}let o;if(r.parentNode instanceof DocumentFragment)o=ao(r).body;else{const a=r.parentElement,i=Ns(r);o=a?.nodeName==="HTML"&&i.getComputedStyle(a).overflowY==="scroll"?a:r}n.push({value:o.style.overflow,property:"overflow",el:o},{value:o.style.overflowX,property:"overflow-x",el:o},{value:o.style.overflowY,property:"overflow-y",el:o}),o.style.overflow="hidden"}return()=>{n.forEach(({value:o,el:a,property:i})=>{o?a.style.setProperty(i,o):a.style.removeProperty(i)})}}function $pe(e){const t=[];return[].forEach.call(e.children,n=>{n.getAttribute("aria-hidden")==="true"&&t.push(n)}),t}class Hpe{constructor(){this.modals=[],this.containers=[]}add(t,n){let r=this.modals.indexOf(t);if(r!==-1)return r;r=this.modals.length,this.modals.push(t),t.modalRef&&_h(t.modalRef,!1);const o=$pe(n);RP(n,t.mount,t.modalRef,o,!0);const a=dS(this.containers,i=>i.container===n);return a!==-1?(this.containers[a].modals.push(t),r):(this.containers.push({modals:[t],container:n,restore:null,hiddenSiblings:o}),r)}mount(t,n){const r=dS(this.containers,a=>a.modals.includes(t)),o=this.containers[r];o.restore||(o.restore=zpe(o,n))}remove(t,n=!0){const r=this.modals.indexOf(t);if(r===-1)return r;const o=dS(this.containers,i=>i.modals.includes(t)),a=this.containers[o];if(a.modals.splice(a.modals.indexOf(t),1),this.modals.splice(r,1),a.modals.length===0)a.restore&&a.restore(),t.modalRef&&_h(t.modalRef,n),RP(a.container,t.mount,t.modalRef,a.hiddenSiblings,!1),this.containers.splice(o,1);else{const i=a.modals[a.modals.length-1];i.modalRef&&_h(i.modalRef,!1)}return r}isTopModal(t){return this.modals.length>0&&this.modals[this.modals.length-1]===t}}const Vpe=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'].join(",");function Gpe(e){const t=parseInt(e.getAttribute("tabindex")||"",10);return Number.isNaN(t)?e.contentEditable==="true"||(e.nodeName==="AUDIO"||e.nodeName==="VIDEO"||e.nodeName==="DETAILS")&&e.getAttribute("tabindex")===null?0:e.tabIndex:t}function qpe(e){if(e.tagName!=="INPUT"||e.type!=="radio"||!e.name)return!1;const t=r=>e.ownerDocument.querySelector(`input[type="radio"]${r}`);let n=t(`[name="${e.name}"]:checked`);return n||(n=t(`[name="${e.name}"]`)),n!==e}function Wpe(e){return!(e.disabled||e.tagName==="INPUT"&&e.type==="hidden"||qpe(e))}function Ype(e){const t=[],n=[];return Array.from(e.querySelectorAll(Vpe)).forEach((r,o)=>{const a=Gpe(r);a===-1||!Wpe(r)||(a===0?t.push(r):n.push({documentOrder:o,tabIndex:a,node:r}))}),n.sort((r,o)=>r.tabIndex===o.tabIndex?r.documentOrder-o.documentOrder:r.tabIndex-o.tabIndex).map(r=>r.node).concat(t)}function Kpe(){return!0}function Qpe(e){const{children:t,disableAutoFocus:n=!1,disableEnforceFocus:r=!1,disableRestoreFocus:o=!1,getTabbable:a=Ype,isEnabled:i=Kpe,open:l}=e,u=A.useRef(!1),d=A.useRef(null),p=A.useRef(null),h=A.useRef(null),y=A.useRef(null),g=A.useRef(!1),b=A.useRef(null),x=sr(mp(t),b),S=A.useRef(null);A.useEffect(()=>{!l||!b.current||(g.current=!n)},[n,l]),A.useEffect(()=>{if(!l||!b.current)return;const C=ao(b.current);return b.current.contains(C.activeElement)||(b.current.hasAttribute("tabIndex")||b.current.setAttribute("tabIndex","-1"),g.current&&b.current.focus()),()=>{o||(h.current&&h.current.focus&&(u.current=!0,h.current.focus()),h.current=null)}},[l]),A.useEffect(()=>{if(!l||!b.current)return;const C=ao(b.current),R=F=>{S.current=F,!(r||!i()||F.key!=="Tab")&&C.activeElement===b.current&&F.shiftKey&&(u.current=!0,p.current&&p.current.focus())},O=()=>{const F=b.current;if(F===null)return;if(!C.hasFocus()||!i()||u.current){u.current=!1;return}if(F.contains(C.activeElement)||r&&C.activeElement!==d.current&&C.activeElement!==p.current)return;if(C.activeElement!==y.current)y.current=null;else if(y.current!==null)return;if(!g.current)return;let H=[];if((C.activeElement===d.current||C.activeElement===p.current)&&(H=a(b.current)),H.length>0){const z=!!(S.current?.shiftKey&&S.current?.key==="Tab"),L=H[0],$=H[H.length-1];typeof L!="string"&&typeof $!="string"&&(z?$.focus():L.focus())}else F.focus()};C.addEventListener("focusin",O),C.addEventListener("keydown",R,!0);const I=setInterval(()=>{C.activeElement&&C.activeElement.tagName==="BODY"&&O()},50);return()=>{clearInterval(I),C.removeEventListener("focusin",O),C.removeEventListener("keydown",R,!0)}},[n,r,o,i,l,a]);const E=C=>{h.current===null&&(h.current=C.relatedTarget),g.current=!0,y.current=C.target;const R=t.props.onFocus;R&&R(C)},_=C=>{h.current===null&&(h.current=C.relatedTarget),g.current=!0};return v.jsxs(A.Fragment,{children:[v.jsx("div",{tabIndex:l?0:-1,onFocus:_,ref:d,"data-testid":"sentinelStart"}),A.cloneElement(t,{ref:x,onFocus:E}),v.jsx("div",{tabIndex:l?0:-1,onFocus:_,ref:p,"data-testid":"sentinelEnd"})]})}const Xpe={entering:{opacity:1},entered:{opacity:1}},pC=A.forwardRef(function(e,t){const n=dp(),r={enter:n.transitions.duration.enteringScreen,exit:n.transitions.duration.leavingScreen},{addEndListener:o,appear:a=!0,children:i,easing:l,in:u,onEnter:d,onEntered:p,onEntering:h,onExit:y,onExited:g,onExiting:b,style:x,timeout:S=r,TransitionComponent:E=hi,..._}=e,C=A.useRef(null),R=sr(C,mp(i),t),O=k=>M=>{if(k){const j=C.current;M===void 0?k(j):k(j,M)}},I=O(h),F=O((k,M)=>{EF(k);const j=Xd({style:x,timeout:S,easing:l},{mode:"enter"});k.style.webkitTransition=n.transitions.create("opacity",j),k.style.transition=n.transitions.create("opacity",j),d&&d(k,M)}),H=O(p),z=O(b),L=O(k=>{const M=Xd({style:x,timeout:S,easing:l},{mode:"exit"});k.style.webkitTransition=n.transitions.create("opacity",M),k.style.transition=n.transitions.create("opacity",M),y&&y(k)}),$=O(g);return v.jsx(E,{appear:a,in:u,nodeRef:C,onEnter:F,onEntered:H,onEntering:I,onExit:L,onExited:$,onExiting:z,addEndListener:k=>{o&&o(C.current,k)},timeout:S,..._,children:(k,{ownerState:M,...j})=>A.cloneElement(i,{style:{opacity:0,visibility:k==="exited"&&!u?"hidden":void 0,...Xpe[k],...x,...i.props.style},ref:R,...j})})});function Zpe(e){return en("MuiBackdrop",e)}Wt("MuiBackdrop",["root","invisible"]);const Jpe=e=>{const{classes:t,invisible:n}=e;return Jt({root:["root",n&&"invisible"]},Zpe,t)},efe=Ye("div",{name:"MuiBackdrop",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.invisible&&t.invisible]}})({position:"fixed",display:"flex",alignItems:"center",justifyContent:"center",right:0,bottom:0,top:0,left:0,backgroundColor:"rgba(0, 0, 0, 0.5)",WebkitTapHighlightColor:"transparent",variants:[{props:{invisible:!0},style:{backgroundColor:"transparent"}}]}),xF=A.forwardRef(function(e,t){const n=sn({props:e,name:"MuiBackdrop"}),{children:r,className:o,component:a="div",invisible:i=!1,open:l,components:u={},componentsProps:d={},slotProps:p={},slots:h={},TransitionComponent:y,transitionDuration:g,...b}=n,x={...n,component:a,invisible:i},S=Jpe(x),E={transition:y,root:u.Root,...h},_={...d,...p},C={component:a,slots:E,slotProps:_},[R,O]=xn("root",{elementType:efe,externalForwardedProps:C,className:Tt(S.root,o),ownerState:x}),[I,F]=xn("transition",{elementType:pC,externalForwardedProps:C,ownerState:x});return v.jsx(I,{in:l,timeout:g,...b,...F,children:v.jsx(R,{"aria-hidden":!0,...O,classes:S,ref:t,children:r})})});function tfe(e){return typeof e=="function"?e():e}function nfe(e){return e?e.props.hasOwnProperty("in"):!1}const DP=()=>{},Ly=new Hpe;function rfe(e){const{container:t,disableEscapeKeyDown:n=!1,disableScrollLock:r=!1,closeAfterTransition:o=!1,onTransitionEnter:a,onTransitionExited:i,children:l,onClose:u,open:d,rootRef:p}=e,h=A.useRef({}),y=A.useRef(null),g=A.useRef(null),b=sr(g,p),[x,S]=A.useState(!d),E=nfe(l);let _=!0;(e["aria-hidden"]==="false"||e["aria-hidden"]===!1)&&(_=!1);const C=()=>ao(y.current),R=()=>(h.current.modalRef=g.current,h.current.mount=y.current,h.current),O=()=>{Ly.mount(R(),{disableScrollLock:r}),g.current&&(g.current.scrollTop=0)},I=Fr(()=>{const k=tfe(t)||C().body;Ly.add(R(),k),g.current&&O()}),F=()=>Ly.isTopModal(R()),H=Fr(k=>{y.current=k,k&&(d&&F()?O():g.current&&_h(g.current,_))}),z=A.useCallback(()=>{Ly.remove(R(),_)},[_]);A.useEffect(()=>()=>{z()},[z]),A.useEffect(()=>{d?I():(!E||!o)&&z()},[d,z,E,o,I]);const L=k=>M=>{k.onKeyDown?.(M),!(M.key!=="Escape"||M.which===229||!F())&&(n||(M.stopPropagation(),u&&u(M,"escapeKeyDown")))},$=k=>M=>{k.onClick?.(M),M.target===M.currentTarget&&u&&u(M,"backdropClick")};return{getRootProps:(k={})=>{const M=To(e);delete M.onTransitionEnter,delete M.onTransitionExited;const j={...M,...k};return{role:"presentation",...j,onKeyDown:L(j),ref:b}},getBackdropProps:(k={})=>{const M=k;return{"aria-hidden":!0,...M,onClick:$(M),open:d}},getTransitionProps:()=>{const k=()=>{S(!1),a&&a()},M=()=>{S(!0),i&&i(),o&&z()};return{onEnter:aN(k,l?.props.onEnter??DP),onExited:aN(M,l?.props.onExited??DP)}},rootRef:b,portalRef:H,isTopModal:F,exited:x,hasTransition:E}}function ofe(e){return en("MuiModal",e)}Wt("MuiModal",["root","hidden","backdrop"]);const afe=e=>{const{open:t,exited:n,classes:r}=e;return Jt({root:["root",!t&&n&&"hidden"],backdrop:["backdrop"]},ofe,r)},ife=Ye("div",{name:"MuiModal",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,!n.open&&n.exited&&t.hidden]}})(hn(({theme:e})=>({position:"fixed",zIndex:(e.vars||e).zIndex.modal,right:0,bottom:0,top:0,left:0,variants:[{props:({ownerState:t})=>!t.open&&t.exited,style:{visibility:"hidden"}}]}))),sfe=Ye(xF,{name:"MuiModal",slot:"Backdrop"})({zIndex:-1}),SF=A.forwardRef(function(e,t){const n=sn({name:"MuiModal",props:e}),{BackdropComponent:r=sfe,BackdropProps:o,classes:a,className:i,closeAfterTransition:l=!1,children:u,container:d,component:p,components:h={},componentsProps:y={},disableAutoFocus:g=!1,disableEnforceFocus:b=!1,disableEscapeKeyDown:x=!1,disablePortal:S=!1,disableRestoreFocus:E=!1,disableScrollLock:_=!1,hideBackdrop:C=!1,keepMounted:R=!1,onClose:O,onTransitionEnter:I,onTransitionExited:F,open:H,slotProps:z={},slots:L={},theme:$,...k}=n,M={...n,closeAfterTransition:l,disableAutoFocus:g,disableEnforceFocus:b,disableEscapeKeyDown:x,disablePortal:S,disableRestoreFocus:E,disableScrollLock:_,hideBackdrop:C,keepMounted:R},{getRootProps:j,getBackdropProps:V,getTransitionProps:B,portalRef:q,isTopModal:Y,exited:ee,hasTransition:N}=rfe({...M,rootRef:t}),W={...M,exited:ee},K=afe(W),P={};if(u.props.tabIndex===void 0&&(P.tabIndex="-1"),N){const{onEnter:Ee,onExited:Te}=B();P.onEnter=Ee,P.onExited=Te}const Z={slots:{root:h.Root,backdrop:h.Backdrop,...L},slotProps:{...y,...z}},[ae,J]=xn("root",{ref:t,elementType:ife,externalForwardedProps:{...Z,...k,component:p},getSlotProps:j,ownerState:W,className:Tt(i,K?.root,!W.open&&W.exited&&K?.hidden)}),[pe,le]=xn("backdrop",{ref:o?.ref,elementType:r,externalForwardedProps:Z,shouldForwardComponentProp:!0,additionalProps:o,getSlotProps:Ee=>V({...Ee,onClick:Te=>{Ee?.onClick&&Ee.onClick(Te)}}),className:Tt(o?.className,K?.backdrop),ownerState:W});return!R&&!H&&(!N||ee)?null:v.jsx(pF,{ref:q,container:d,disablePortal:S,children:v.jsxs(ae,{...J,children:[!C&&r?v.jsx(pe,{...le}):null,v.jsx(Qpe,{disableEnforceFocus:b,disableAutoFocus:g,disableRestoreFocus:E,isEnabled:Y,open:H,children:A.cloneElement(u,P)})]})})});function lfe(e){return en("MuiPopover",e)}Wt("MuiPopover",["root","paper"]);function IP(e,t){let n=0;return typeof t=="number"?n=t:t==="center"?n=e.height/2:t==="bottom"&&(n=e.height),n}function OP(e,t){let n=0;return typeof t=="number"?n=t:t==="center"?n=e.width/2:t==="right"&&(n=e.width),n}function NP(e){return[e.horizontal,e.vertical].map(t=>typeof t=="number"?`${t}px`:t).join(" ")}function My(e){return typeof e=="function"?e():e}const cfe=e=>{const{classes:t}=e;return Jt({root:["root"],paper:["paper"]},lfe,t)},ufe=Ye(SF,{name:"MuiPopover",slot:"Root"})({}),TF=Ye(gp,{name:"MuiPopover",slot:"Paper"})({position:"absolute",overflowY:"auto",overflowX:"hidden",minWidth:16,minHeight:16,maxWidth:"calc(100% - 32px)",maxHeight:"calc(100% - 32px)",outline:0}),dfe=A.forwardRef(function(e,t){const n=sn({props:e,name:"MuiPopover"}),{action:r,anchorEl:o,anchorOrigin:a={vertical:"top",horizontal:"left"},anchorPosition:i,anchorReference:l="anchorEl",children:u,className:d,container:p,elevation:h=8,marginThreshold:y=16,open:g,PaperProps:b={},slots:x={},slotProps:S={},transformOrigin:E={vertical:"top",horizontal:"left"},TransitionComponent:_,transitionDuration:C="auto",TransitionProps:R={},disableScrollLock:O=!1,...I}=n,F=A.useRef(),H={...n,anchorOrigin:a,anchorReference:l,elevation:h,marginThreshold:y,transformOrigin:E,TransitionComponent:_,transitionDuration:C,TransitionProps:R},z=cfe(H),L=A.useCallback(()=>{if(l==="anchorPosition")return i;const Ee=My(o),Te=(Ee&&Ee.nodeType===1?Ee:ao(F.current).body).getBoundingClientRect();return{top:Te.top+IP(Te,a.vertical),left:Te.left+OP(Te,a.horizontal)}},[o,a.horizontal,a.vertical,i,l]),$=A.useCallback(Ee=>({vertical:IP(Ee,E.vertical),horizontal:OP(Ee,E.horizontal)}),[E.horizontal,E.vertical]),k=A.useCallback(Ee=>{const Te={width:Ee.offsetWidth,height:Ee.offsetHeight},Ae=$(Te);if(l==="none")return{top:null,left:null,transformOrigin:NP(Ae)};const Ue=L();let Re=Ue.top-Ae.vertical,ve=Ue.left-Ae.horizontal;const pt=Re+Te.height,ut=ve+Te.width,ze=Ns(My(o)),$e=ze.innerHeight-y,dt=ze.innerWidth-y;if(y!==null&&Re<y){const Be=Re-y;Re-=Be,Ae.vertical+=Be}else if(y!==null&&pt>$e){const Be=pt-$e;Re-=Be,Ae.vertical+=Be}if(y!==null&&ve<y){const Be=ve-y;ve-=Be,Ae.horizontal+=Be}else if(ut>dt){const Be=ut-dt;ve-=Be,Ae.horizontal+=Be}return{top:`${Math.round(Re)}px`,left:`${Math.round(ve)}px`,transformOrigin:NP(Ae)}},[o,l,L,$,y]),[M,j]=A.useState(g),V=A.useCallback(()=>{const Ee=F.current;if(!Ee)return;const Te=k(Ee);Te.top!==null&&Ee.style.setProperty("top",Te.top),Te.left!==null&&(Ee.style.left=Te.left),Ee.style.transformOrigin=Te.transformOrigin,j(!0)},[k]);A.useEffect(()=>(O&&window.addEventListener("scroll",V),()=>window.removeEventListener("scroll",V)),[o,O,V]);const B=()=>{V()},q=()=>{j(!1)};A.useEffect(()=>{g&&V()}),A.useImperativeHandle(r,()=>g?{updatePosition:()=>{V()}}:null,[g,V]),A.useEffect(()=>{if(!g)return;const Ee=c6(()=>{V()}),Te=Ns(My(o));return Te.addEventListener("resize",Ee),()=>{Ee.clear(),Te.removeEventListener("resize",Ee)}},[o,g,V]);let Y=C;const ee={slots:{transition:_,...x},slotProps:{transition:R,paper:b,...S}},[N,W]=xn("transition",{elementType:vb,externalForwardedProps:ee,ownerState:H,getSlotProps:Ee=>({...Ee,onEntering:(Te,Ae)=>{Ee.onEntering?.(Te,Ae),B()},onExited:Te=>{Ee.onExited?.(Te),q()}}),additionalProps:{appear:!0,in:g}});C==="auto"&&!N.muiSupportAuto&&(Y=void 0);const K=p||(o?ao(My(o)).body:void 0),[P,{slots:Z,slotProps:ae,...J}]=xn("root",{ref:t,elementType:ufe,externalForwardedProps:{...ee,...I},shouldForwardComponentProp:!0,additionalProps:{slots:{backdrop:x.backdrop},slotProps:{backdrop:u6(typeof S.backdrop=="function"?S.backdrop(H):S.backdrop,{invisible:!0})},container:K,open:g},ownerState:H,className:Tt(z.root,d)}),[pe,le]=xn("paper",{ref:F,className:z.paper,elementType:TF,externalForwardedProps:ee,shouldForwardComponentProp:!0,additionalProps:{elevation:h,style:M?void 0:{opacity:0}},ownerState:H});return v.jsx(P,{...J,...!mb(P)&&{slots:Z,slotProps:ae,disableScrollLock:O},children:v.jsx(N,{...W,timeout:Y,children:v.jsx(pe,{...le,children:u})})})});function pfe(e){return en("MuiMenu",e)}Wt("MuiMenu",["root","paper","list"]);const ffe={vertical:"top",horizontal:"right"},hfe={vertical:"top",horizontal:"left"},mfe=e=>{const{classes:t}=e;return Jt({root:["root"],paper:["paper"],list:["list"]},pfe,t)},gfe=Ye(dfe,{shouldForwardProp:e=>Do(e)||e==="classes",name:"MuiMenu",slot:"Root"})({}),yfe=Ye(TF,{name:"MuiMenu",slot:"Paper"})({maxHeight:"calc(100% - 96px)",WebkitOverflowScrolling:"touch"}),bfe=Ye(Fpe,{name:"MuiMenu",slot:"List"})({outline:0}),vfe=A.forwardRef(function(e,t){const n=sn({props:e,name:"MuiMenu"}),{autoFocus:r=!0,children:o,className:a,disableAutoFocusItem:i=!1,MenuListProps:l={},onClose:u,open:d,PaperProps:p={},PopoverClasses:h,transitionDuration:y="auto",TransitionProps:{onEntering:g,...b}={},variant:x="selectedMenu",slots:S={},slotProps:E={},..._}=n,C=l_(),R={...n,autoFocus:r,disableAutoFocusItem:i,MenuListProps:l,onEntering:g,PaperProps:p,transitionDuration:y,TransitionProps:b,variant:x},O=mfe(R),I=r&&!i&&d,F=A.useRef(null),H=(Y,ee)=>{F.current&&F.current.adjustStyleForScrollbar(Y,{direction:C?"rtl":"ltr"}),g&&g(Y,ee)},z=Y=>{Y.key==="Tab"&&(Y.preventDefault(),u&&u(Y,"tabKeyDown"))};let L=-1;A.Children.map(o,(Y,ee)=>{A.isValidElement(Y)&&(Y.props.disabled||(x==="selectedMenu"&&Y.props.selected||L===-1)&&(L=ee))});const $={slots:S,slotProps:{list:l,transition:b,paper:p,...E}},k=Cs({elementType:S.root,externalSlotProps:E.root,ownerState:R,className:[O.root,a]}),[M,j]=xn("paper",{className:O.paper,elementType:yfe,externalForwardedProps:$,shouldForwardComponentProp:!0,ownerState:R}),[V,B]=xn("list",{className:Tt(O.list,l.className),elementType:bfe,shouldForwardComponentProp:!0,externalForwardedProps:$,getSlotProps:Y=>({...Y,onKeyDown:ee=>{z(ee),Y.onKeyDown?.(ee)}}),ownerState:R}),q=typeof $.slotProps.transition=="function"?$.slotProps.transition(R):$.slotProps.transition;return v.jsx(gfe,{onClose:u,anchorOrigin:{vertical:"bottom",horizontal:C?"right":"left"},transformOrigin:C?ffe:hfe,slots:{root:S.root,paper:M,backdrop:S.backdrop,...S.transition&&{transition:S.transition}},slotProps:{root:k,paper:j,backdrop:typeof E.backdrop=="function"?E.backdrop(R):E.backdrop,transition:{...q,onEntering:(...Y)=>{H(...Y),q?.onEntering?.(...Y)}}},open:d,ref:t,transitionDuration:y,ownerState:R,..._,classes:h,children:v.jsx(V,{actions:F,autoFocus:r&&(L===-1||i),autoFocusItem:I,variant:x,...B,children:o})})});function Efe(e){return en("MuiNativeSelect",e)}const M_=Wt("MuiNativeSelect",["root","select","multiple","filled","outlined","standard","disabled","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]),xfe=e=>{const{classes:t,variant:n,disabled:r,multiple:o,open:a,error:i}=e,l={select:["select",n,r&&"disabled",o&&"multiple",i&&"error"],icon:["icon",`icon${Ze(n)}`,a&&"iconOpen",r&&"disabled"]};return Jt(l,Efe,t)},CF=Ye("select",{name:"MuiNativeSelect"})(({theme:e})=>({MozAppearance:"none",WebkitAppearance:"none",userSelect:"none",borderRadius:0,cursor:"pointer","&:focus":{borderRadius:0},[`&.${M_.disabled}`]:{cursor:"default"},"&[multiple]":{height:"auto"},"&:not([multiple]) option, &:not([multiple]) optgroup":{backgroundColor:(e.vars||e).palette.background.paper},variants:[{props:({ownerState:t})=>t.variant!=="filled"&&t.variant!=="outlined",style:{"&&&":{paddingRight:24,minWidth:16}}},{props:{variant:"filled"},style:{"&&&":{paddingRight:32}}},{props:{variant:"outlined"},style:{borderRadius:(e.vars||e).shape.borderRadius,"&:focus":{borderRadius:(e.vars||e).shape.borderRadius},"&&&":{paddingRight:32}}}]})),Sfe=Ye(CF,{name:"MuiNativeSelect",slot:"Select",shouldForwardProp:Do,overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.select,t[n.variant],n.error&&t.error,{[`&.${M_.multiple}`]:t.multiple}]}})({}),AF=Ye("svg",{name:"MuiNativeSelect"})(({theme:e})=>({position:"absolute",right:0,top:"calc(50% - .5em)",pointerEvents:"none",color:(e.vars||e).palette.action.active,[`&.${M_.disabled}`]:{color:(e.vars||e).palette.action.disabled},variants:[{props:({ownerState:t})=>t.open,style:{transform:"rotate(180deg)"}},{props:{variant:"filled"},style:{right:7}},{props:{variant:"outlined"},style:{right:7}}]})),Tfe=Ye(AF,{name:"MuiNativeSelect",slot:"Icon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.icon,n.variant&&t[`icon${Ze(n.variant)}`],n.open&&t.iconOpen]}})({}),Cfe=A.forwardRef(function(e,t){const{className:n,disabled:r,error:o,IconComponent:a,inputRef:i,variant:l="standard",...u}=e,d={...e,disabled:r,variant:l,error:o},p=xfe(d);return v.jsxs(A.Fragment,{children:[v.jsx(Sfe,{ownerState:d,className:Tt(p.select,n),disabled:r,ref:i||t,...u}),e.multiple?null:v.jsx(Tfe,{as:a,ownerState:d,className:p.icon})]})});function _F(e){return en("MuiSelect",e)}const Hf=Wt("MuiSelect",["root","select","multiple","filled","outlined","standard","disabled","focused","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]);var PP;const Afe=Ye(CF,{name:"MuiSelect",slot:"Select",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`&.${Hf.select}`]:t.select},{[`&.${Hf.select}`]:t[n.variant]},{[`&.${Hf.error}`]:t.error},{[`&.${Hf.multiple}`]:t.multiple}]}})({[`&.${Hf.select}`]:{height:"auto",minHeight:"1.4375em",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}}),_fe=Ye(AF,{name:"MuiSelect",slot:"Icon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.icon,n.variant&&t[`icon${Ze(n.variant)}`],n.open&&t.iconOpen]}})({}),kfe=Ye("input",{shouldForwardProp:e=>l6(e)&&e!=="classes",name:"MuiSelect",slot:"NativeInput"})({bottom:0,left:0,position:"absolute",opacity:0,pointerEvents:"none",width:"100%",boxSizing:"border-box"});function LP(e,t){return typeof t=="object"&&t!==null?e===t:String(e)===String(t)}function wfe(e){return e==null||typeof e=="string"&&!e.trim()}const Rfe=e=>{const{classes:t,variant:n,disabled:r,multiple:o,open:a,error:i}=e,l={select:["select",n,r&&"disabled",o&&"multiple",i&&"error"],icon:["icon",`icon${Ze(n)}`,a&&"iconOpen",r&&"disabled"],nativeInput:["nativeInput"]};return Jt(l,_F,t)},Dfe=A.forwardRef(function(e,t){const{"aria-describedby":n,"aria-label":r,autoFocus:o,autoWidth:a,children:i,className:l,defaultOpen:u,defaultValue:d,disabled:p,displayEmpty:h,error:y=!1,IconComponent:g,inputRef:b,labelId:x,MenuProps:S={},multiple:E,name:_,onBlur:C,onChange:R,onClose:O,onFocus:I,onOpen:F,open:H,readOnly:z,renderValue:L,required:$,SelectDisplayProps:k={},tabIndex:M,type:j,value:V,variant:B="standard",...q}=e,[Y,ee]=kd({controlled:V,default:d,name:"Select"}),[N,W]=kd({controlled:H,default:u,name:"Select"}),K=A.useRef(null),P=A.useRef(null),[Z,ae]=A.useState(null),{current:J}=A.useRef(H!=null),[pe,le]=A.useState(),Ee=sr(t,b),Te=A.useCallback(nt=>{P.current=nt,nt&&ae(nt)},[]),Ae=Z?.parentNode;A.useImperativeHandle(Ee,()=>({focus:()=>{P.current.focus()},node:K.current,value:Y}),[Y]),A.useEffect(()=>{u&&N&&Z&&!J&&(le(a?null:Ae.clientWidth),P.current.focus())},[Z,a]),A.useEffect(()=>{o&&P.current.focus()},[o]),A.useEffect(()=>{if(!x)return;const nt=ao(P.current).getElementById(x);if(nt){const se=()=>{getSelection().isCollapsed&&P.current.focus()};return nt.addEventListener("click",se),()=>{nt.removeEventListener("click",se)}}},[x]);const Ue=(nt,se)=>{nt?F&&F(se):O&&O(se),J||(le(a?null:Ae.clientWidth),W(nt))},Re=nt=>{nt.button===0&&(nt.preventDefault(),P.current.focus(),Ue(!0,nt))},ve=nt=>{Ue(!1,nt)},pt=A.Children.toArray(i),ut=nt=>{const se=pt.find(he=>he.props.value===nt.target.value);se!==void 0&&(ee(se.props.value),R&&R(nt,se))},ze=nt=>se=>{let he;if(se.currentTarget.hasAttribute("tabindex")){if(E){he=Array.isArray(Y)?Y.slice():[];const at=Y.indexOf(nt.props.value);at===-1?he.push(nt.props.value):he.splice(at,1)}else he=nt.props.value;if(nt.props.onClick&&nt.props.onClick(se),Y!==he&&(ee(he),R)){const at=se.nativeEvent||se,ft=new at.constructor(at.type,at);Object.defineProperty(ft,"target",{writable:!0,value:{value:he,name:_}}),R(ft,nt)}E||Ue(!1,se)}},$e=nt=>{z||[" ","ArrowUp","ArrowDown","Enter"].includes(nt.key)&&(nt.preventDefault(),Ue(!0,nt))},dt=Z!==null&&N,Be=nt=>{!dt&&C&&(Object.defineProperty(nt,"target",{writable:!0,value:{value:Y,name:_}}),C(nt))};delete q["aria-invalid"];let Fe,Me;const At=[];let Dt=!1;(bb({value:Y})||h)&&(L?Fe=L(Y):Dt=!0);const gt=pt.map(nt=>{if(!A.isValidElement(nt))return null;let se;if(E){if(!Array.isArray(Y))throw new Error(Is(2));se=Y.some(he=>LP(he,nt.props.value)),se&&Dt&&At.push(nt.props.children)}else se=LP(Y,nt.props.value),se&&Dt&&(Me=nt.props.children);return A.cloneElement(nt,{"aria-selected":se?"true":"false",onClick:ze(nt),onKeyUp:he=>{he.key===" "&&he.preventDefault(),nt.props.onKeyUp&&nt.props.onKeyUp(he)},role:"option",selected:se,value:void 0,"data-value":nt.props.value})});Dt&&(E?At.length===0?Fe=null:Fe=At.reduce((nt,se,he)=>(nt.push(se),he<At.length-1&&nt.push(", "),nt),[]):Fe=Me);let ue=pe;!a&&J&&Z&&(ue=Ae.clientWidth);let ge;typeof M<"u"?ge=M:ge=p?null:0;const He=k.id||(_?`mui-component-select-${_}`:void 0),rt={...e,variant:B,value:Y,open:dt,error:y},tt=Rfe(rt),qe={...S.PaperProps,...typeof S.slotProps?.paper=="function"?S.slotProps.paper(rt):S.slotProps?.paper},Ut={...S.MenuListProps,...typeof S.slotProps?.list=="function"?S.slotProps.list(rt):S.slotProps?.list},Gt=up();return v.jsxs(A.Fragment,{children:[v.jsx(Afe,{as:"div",ref:Te,tabIndex:ge,role:"combobox","aria-controls":dt?Gt:void 0,"aria-disabled":p?"true":void 0,"aria-expanded":dt?"true":"false","aria-haspopup":"listbox","aria-label":r,"aria-labelledby":[x,He].filter(Boolean).join(" ")||void 0,"aria-describedby":n,"aria-required":$?"true":void 0,"aria-invalid":y?"true":void 0,onKeyDown:$e,onMouseDown:p||z?null:Re,onBlur:Be,onFocus:I,...k,ownerState:rt,className:Tt(k.className,tt.select,l),id:He,children:wfe(Fe)?PP||(PP=v.jsx("span",{className:"notranslate","aria-hidden":!0,children:"​"})):Fe}),v.jsx(kfe,{"aria-invalid":y,value:Array.isArray(Y)?Y.join(","):Y,name:_,ref:K,"aria-hidden":!0,onChange:ut,tabIndex:-1,disabled:p,className:tt.nativeInput,autoFocus:o,required:$,...q,ownerState:rt}),v.jsx(_fe,{as:g,className:tt.icon,ownerState:rt}),v.jsx(vfe,{id:`menu-${_||""}`,anchorEl:Ae,open:dt,onClose:ve,anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},...S,slotProps:{...S.slotProps,list:{"aria-labelledby":x,role:"listbox","aria-multiselectable":E?"true":void 0,disableListWrap:!0,id:Gt,...Ut},paper:{...qe,style:{minWidth:ue,...qe!=null?qe.style:null}}},children:gt})]})}),Ife=e=>{const{classes:t}=e,n=Jt({root:["root"]},_F,t);return{...t,...n}},F_={name:"MuiSelect",slot:"Root",shouldForwardProp:e=>Do(e)&&e!=="variant"},Ofe=Ye(N_,F_)(""),Nfe=Ye(L_,F_)(""),Pfe=Ye(P_,F_)(""),kF=A.forwardRef(function(e,t){const n=sn({name:"MuiSelect",props:e}),{autoWidth:r=!1,children:o,classes:a={},className:i,defaultOpen:l=!1,displayEmpty:u=!1,IconComponent:d=yF,id:p,input:h,inputProps:y,label:g,labelId:b,MenuProps:x,multiple:S=!1,native:E=!1,onClose:_,onOpen:C,open:R,renderValue:O,SelectDisplayProps:I,variant:F="outlined",...H}=n,z=E?Cfe:Dfe,L=uu(),$=yp({props:n,muiFormControl:L,states:["variant","error"]}),k=$.variant||F,M={...n,variant:k,classes:a},j=Ife(M),{root:V,...B}=j,q=h||{standard:v.jsx(Ofe,{ownerState:M}),outlined:v.jsx(Nfe,{label:g,ownerState:M}),filled:v.jsx(Pfe,{ownerState:M})}[k],Y=sr(t,mp(q));return v.jsx(A.Fragment,{children:A.cloneElement(q,{inputComponent:z,inputProps:{children:o,error:$.error,IconComponent:d,variant:k,type:void 0,multiple:S,...E?{id:p}:{autoWidth:r,defaultOpen:l,displayEmpty:u,labelId:b,MenuProps:x,onClose:_,onOpen:C,open:R,renderValue:O,SelectDisplayProps:{id:p,...I}},...y,classes:y?yo(B,y.classes):B,...h?h.props.inputProps:{}},...(S&&E||u)&&k==="outlined"?{notched:!0}:{},ref:Y,className:Tt(q.props.className,i,j.root),...!h&&{variant:k},...H})})});kF.muiName="Select";function Lfe(e){return en("MuiTextField",e)}Wt("MuiTextField",["root"]);const Mfe={standard:N_,filled:P_,outlined:L_},Ffe=e=>{const{classes:t}=e;return Jt({root:["root"]},Lfe,t)},jfe=Ye(wpe,{name:"MuiTextField",slot:"Root"})({}),bo=A.forwardRef(function(e,t){const n=sn({props:e,name:"MuiTextField"}),{autoComplete:r,autoFocus:o=!1,children:a,className:i,color:l="primary",defaultValue:u,disabled:d=!1,error:p=!1,FormHelperTextProps:h,fullWidth:y=!1,helperText:g,id:b,InputLabelProps:x,inputProps:S,InputProps:E,inputRef:_,label:C,maxRows:R,minRows:O,multiline:I=!1,name:F,onBlur:H,onChange:z,onFocus:L,placeholder:$,required:k=!1,rows:M,select:j=!1,SelectProps:V,slots:B={},slotProps:q={},type:Y,value:ee,variant:N="outlined",...W}=n,K={...n,autoFocus:o,color:l,disabled:d,error:p,fullWidth:y,multiline:I,required:k,select:j,variant:N},P=Ffe(K),Z=up(b),ae=g&&Z?`${Z}-helper-text`:void 0,J=C&&Z?`${Z}-label`:void 0,pe=Mfe[N],le={slots:B,slotProps:{input:E,inputLabel:x,htmlInput:S,formHelperText:h,select:V,...q}},Ee={},Te=le.slotProps.inputLabel;N==="outlined"&&(Te&&typeof Te.shrink<"u"&&(Ee.notched=Te.shrink),Ee.label=C),j&&((!V||!V.native)&&(Ee.id=void 0),Ee["aria-describedby"]=void 0);const[Ae,Ue]=xn("root",{elementType:jfe,shouldForwardComponentProp:!0,externalForwardedProps:{...le,...W},ownerState:K,className:Tt(P.root,i),ref:t,additionalProps:{disabled:d,error:p,fullWidth:y,required:k,color:l,variant:N}}),[Re,ve]=xn("input",{elementType:pe,externalForwardedProps:le,additionalProps:Ee,ownerState:K}),[pt,ut]=xn("inputLabel",{elementType:Cpe,externalForwardedProps:le,ownerState:K}),[ze,$e]=xn("htmlInput",{elementType:"input",externalForwardedProps:le,ownerState:K}),[dt,Be]=xn("formHelperText",{elementType:Ope,externalForwardedProps:le,ownerState:K}),[Fe,Me]=xn("select",{elementType:kF,externalForwardedProps:le,ownerState:K}),At=v.jsx(Re,{"aria-describedby":ae,autoComplete:r,autoFocus:o,defaultValue:u,fullWidth:y,multiline:I,name:F,rows:M,maxRows:R,minRows:O,type:Y,value:ee,id:Z,inputRef:_,onBlur:H,onChange:z,onFocus:L,placeholder:$,inputProps:$e,slots:{input:B.htmlInput?ze:void 0},...ve});return v.jsxs(Ae,{...Ue,children:[C!=null&&C!==""&&v.jsx(pt,{htmlFor:Z,id:J,...ut,children:C}),j?v.jsx(Fe,{"aria-describedby":ae,id:Z,labelId:J,value:ee,input:At,...Me,children:a}):At,g&&v.jsx(dt,{id:ae,...Be,children:g})]})});function wF({sourceAndPaths:e,selectedSourceIndex:t,existingQuery:n,onQueryChange:r,onSourceChange:o,resourceUri:a}){return Qe.useEffect(()=>{o&&o(t)},[t,o]),v.jsx(E_,{children:v.jsxs(cG,{spacing:2,component:"section",children:[v.jsx(Ufe,{sourceAndPath:e[t],existingQuery:n,onChange:i=>{r&&r(i)},resourceUri:a}),v.jsx(eV,{height:"5px"})]})})}function m0(){return{query:void 0,malloyQuery:void 0,malloyResult:void 0}}function Bfe({sourceAndPath:e,onChange:t,existingQuery:n,explorerComponents:r,QueryBuilder:o,resourceUri:a}){const[i,l]=Qe.useState(n||m0()),[u,d]=Qe.useState(void 0);Qe.useEffect(()=>{n&&l(n)},[n]);const[p,h]=Qe.useState([]),{MalloyExplorerProvider:y,QueryPanel:g,ResizableCollapsiblePanel:b,ResultPanel:x,SourcePanel:S}=r;Qe.useEffect(()=>{t&&t(i)},[t,i]);const{projectName:E,packageName:_,versionId:C}=yr(a),{apiClients:R}=Zn(),O=Ui({mutationFn:()=>{const z=typeof i?.malloyQuery=="string"?i.malloyQuery:new o.ASTQuery({source:e.sourceInfo,query:i?.malloyQuery}).toMalloy();return d({executionState:"running",query:i?.malloyQuery,queryResolutionStartMillis:Date.now(),onCancel:O.reset,response:{result:{}}}),l({...i,query:z}),R.models.executeQueryModel(E,_,e.modelPath,{query:z,sourceName:void 0,queryName:void 0,versionId:C})},onSuccess:z=>{if(z){const L=JSON.parse(z.data.result);l({...i,malloyResult:L}),d($=>$?{...$,executionState:"finished",response:{result:L}}:void 0)}}}),[I,F]=Qe.useState(e.sourceInfo.name);Qe.useEffect(()=>{I!==e.sourceInfo.name&&(F(e.sourceInfo.name),l(m0()),d(void 0))},[e,I]);const H=Qe.useCallback(z=>{l({...i,malloyQuery:z,malloyResult:void 0})},[i]);return I!==e.sourceInfo.name?v.jsx("div",{children:"Loading..."}):v.jsx(eF,{sx:{border:"1px solid #e0e0e0",borderRadius:"8px",overflow:"hidden"},children:v.jsx(y,{source:e.sourceInfo,query:i?.malloyQuery,topValues:[],onFocusedNestViewPathChange:h,focusedNestViewPath:p,onQueryChange:H,children:v.jsxs("div",{style:{display:"flex",height:"100%",overflowY:"auto"},children:[v.jsx(b,{isInitiallyExpanded:!0,initialWidth:180,minWidth:180,icon:"database",title:e.sourceInfo.name,children:v.jsx(S,{onRefresh:()=>l(m0())})}),v.jsx(b,{isInitiallyExpanded:!0,initialWidth:280,minWidth:280,icon:"filterSliders",title:"Query",children:v.jsx(g,{runQuery:()=>{console.log(`running query with: ${i?.malloyQuery}`);try{O.mutate()}catch(z){console.error("Error running query:",z)}}})}),v.jsx(x,{source:e.sourceInfo,draftQuery:i?.malloyQuery,setDraftQuery:z=>l({...i,malloyQuery:z}),submittedQuery:u,options:{showRawQuery:!0}})]})})},e.sourceInfo.name)}function Ufe(e){const[t,n]=A.useState(null),[r,o]=A.useState(null),[a,i]=A.useState(!0);return A.useEffect(()=>{let l=!0;return Promise.all([X(()=>import("./index-LMhiPgJ7.js"),__vite__mapDeps([93,94,95])),X(()=>import("./index-WCB9ETR1.js").then(u=>u.i),[])]).then(([u,d])=>{l&&(n(u),o(d),i(!1))}).catch(u=>{console.error("Failed to load Malloy components:",u),l&&i(!1)}),()=>{l=!1}},[]),a||!t||!r?v.jsx(mce,{children:v.jsx(eF,{children:v.jsx("div",{style:{alignItems:"center",justifyContent:"center",height:"200px",color:"#666"},children:"Loading explorer..."})})}):v.jsx(Bfe,{...e,explorerComponents:t,QueryBuilder:r,resourceUri:e.resourceUri})}function RF(e,t=!0){const{modelPath:n,projectName:r,packageName:o,versionId:a}=yr(e),{apiClients:i}=Zn();return Zo({queryKey:["package",r,o,n,a],queryFn:async()=>(await i.models.getModel(r,o,n,a)).data,enabled:t})}function DF({data:e,onChange:t,existingQuery:n,initialSelectedSourceIndex:r=0,onSourceChange:o,resourceUri:a}){const[i,l]=Qe.useState(r);Qe.useEffect(()=>{l(r)},[r]);const{data:u,isError:d,isLoading:p,error:h}=RF(a,!e),{modelPath:y}=yr(a),g=e||u;if(p&&!e)return v.jsx(Ko,{text:"Fetching Model..."});if(d&&!e)return console.log("error",h),v.jsx(Xo,{error:h,context:`ModelExplorer > ${y}`});if(!g)return v.jsx(Ko,{text:"Loading..."});const b=(g?.sourceInfos||[]).map((S,E)=>{try{return JSON.parse(S)?.name||`Source ${E+1}`}catch{return`Source ${E+1}`}}),x=b[i]||"";return v.jsxs(fb,{variant:"outlined",children:[v.jsx(J6,{children:v.jsx(Zr,{sx:{flexDirection:"row"},children:v.jsx(npe,{size:"small",id:"size-small-standard",disablePortal:!0,options:b,value:x,onChange:(S,E)=>{if(!E)return;const _=b.indexOf(E);_>=0&&(l(_),o?.(_))},renderInput:S=>v.jsx(bo,{...S}),style:{width:350,marginTop:"3px",marginLeft:"6px",marginBottom:"8px"}})})}),v.jsx(E_,{children:v.jsxs(Zr,{spacing:2,component:"section",children:[Array.isArray(g.sourceInfos)&&g.sourceInfos.length>0&&v.jsx(wF,{sourceAndPaths:g.sourceInfos.map(S=>({sourceInfo:JSON.parse(S),modelPath:y})),selectedSourceIndex:i,existingQuery:n,onQueryChange:t,resourceUri:a}),v.jsx(It,{height:"5px"})]})})]})}function IF({open:e,onClose:t,resourceUri:n,data:r,title:o="Data Sources",hasValidImport:a=!0,existingQuery:i,initialSelectedSourceIndex:l,onChange:u,onSourceChange:d}){return v.jsxs(Bl,{open:e,onClose:t,fullScreen:!0,children:[v.jsxs(zl,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[o,v.jsx(ir,{onClick:t,sx:{color:"#666666"},children:v.jsx(Vl,{})})]}),v.jsx(Ul,{children:a?v.jsx(DF,{resourceUri:n,data:r,existingQuery:i,initialSelectedSourceIndex:l,onChange:u,onSourceChange:d}):v.jsx("div",{children:"No valid import statement found in cell"})})]})}function fwe({onChange:e,resourceUri:t,runOnDemand:n=!1,maxResultSize:r=0}){const{modelPath:o}=yr(t),{data:a,isError:i,isLoading:l,error:u}=RF(t),[d,p]=Qe.useState(!1),[h,y]=Qe.useState(),[g,b]=Qe.useState(0),[x,S]=A.useState("");if(l)return v.jsx(Ko,{text:"Fetching Model..."});if(i)return console.log("error",u),v.jsx(Xo,{error:u,context:`Model > ${o}`});const E=R=>{y(R),e&&e(R)},_=R=>{b(R)},C=()=>{const R=window.location.href;navigator.clipboard.writeText(R).then(()=>S("URL copied to clipboard!")).catch(()=>S("Failed to copy URL"))};return v.jsxs(v.Fragment,{children:[v.jsxs(It,{sx:{position:"relative",maxWidth:"1200px",margin:"0 auto",paddingTop:"24px"},children:[Array.isArray(a?.sourceInfos)&&a.sourceInfos.length>0&&v.jsxs(Zr,{spacing:2,component:"section",children:[v.jsxs(It,{sx:{padding:"0 0 16px 0",display:"flex",alignItems:"center",justifyContent:"space-between"},children:[v.jsx(ct,{variant:"h1",sx:{fontSize:"28px",fontWeight:"600",color:"#1a1a1a",marginBottom:"8px",marginTop:"0",paddingLeft:"0"},children:"Sources"}),v.jsx(jo,{title:"Click to copy link",children:v.jsx(u_,{sx:{fontSize:"24px",color:"#666666",cursor:"pointer"},onClick:C})})]}),v.jsx(DF,{data:a,onChange:E,onSourceChange:_,existingQuery:h,initialSelectedSourceIndex:g,resourceUri:t}),v.jsx(ir,{sx:{position:"absolute",top:"90px",right:"4px",backgroundColor:"rgba(255, 255, 255, 0.9)","&:hover":{backgroundColor:"rgba(255, 255, 255, 1)"},width:"32px",height:"32px",zIndex:2},onClick:()=>p(!0),children:v.jsx(jo,{title:"Expanded view",children:v.jsx(iie,{sx:{fontSize:"18px",color:"#666666",marginBottom:"5px"}})})})]}),a?.queries?.length>0&&v.jsxs(Zr,{spacing:2,component:"section",sx:{marginTop:"24px"},children:[v.jsx(It,{sx:{padding:"0 0 16px 0"},children:v.jsx(ct,{variant:"h2",sx:{fontSize:"24px",fontWeight:"600",color:"#1a1a1a",marginBottom:"0",marginTop:"8px",paddingLeft:"0"},children:"Named Queries"})}),a.queries.map(R=>v.jsx(yce,{queryName:R.name,annotations:R.annotations,resourceUri:t,runOnDemand:n,maxResultSize:r},R.name))]}),v.jsx(IF,{open:d,onClose:()=>p(!1),resourceUri:t,data:a,title:`Model: ${o.split("/").pop()}`,existingQuery:h,initialSelectedSourceIndex:g,onChange:E,onSourceChange:_})]}),v.jsx(Ls,{open:x!=="",autoHideDuration:6e3,onClose:()=>S(""),message:x})]})}const OF=On(v.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"})),zfe=On(v.jsx("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2m0 16H8V7h11z"}));A.lazy(()=>Promise.resolve().then(()=>Sj));function $fe(e){const{projectName:t,packageName:n}=yr(e.resourceUri);if(!t||!n)throw new Error("Project and Package name must be provided for query embedding.");return JSON.stringify({...e})}function Hfe({cell:e,hideCodeCellIcon:t,hideEmbeddingIcon:n,resourceUri:r,index:o,maxResultSize:a}){const[i,l]=Qe.useState(!1),[u,d]=Qe.useState(!1),[p,h]=Qe.useState(!1),[y,g]=Qe.useState(),[b,x]=Qe.useState(),[S,E]=Qe.useState(!1),[_,C]=A.useState(""),R=/import\s*\{([^}]+)\}\s*from\s*['"`][^'"`]+['"`]/,O=/import\s*(?:\{[^}]*\}\s*from\s*)?['"`]([^'"`]+)['"`]/,I=!!e.text&&(R.test(e.text)||O.test(e.text)),F=()=>{if(!e.newSources||e.newSources.length===0)return 0;let $=[],k="";if(e.text){const M=e.text.match(R);M&&($=M[1].split(",").map(V=>V.trim()));const j=e.text.match(O);j&&(k=j[1].trim())}for(let M=0;M<e.newSources.length;M++)try{const j=JSON.parse(e.newSources[M]);if($.length>0&&$.includes(j.name)||k&&k===j.path)return M}catch{continue}return 0},H=e.newSources&&e.newSources.length>0?{sourceInfos:e.newSources,resource:r}:void 0,z=$fe({query:e.text,resourceUri:r});A.useEffect(()=>{e.type==="code"&&pb(e.text,"malloy").then($=>{g($)})},[e]),A.useEffect(()=>{pb(z,"typescript").then($=>{x($)})},[z]);const L=()=>{const $=window.location.href;navigator.clipboard.writeText($).then(()=>C("URL copied to clipboard!")).catch(()=>C("Failed to copy URL"))};return e.type==="markdown"&&v.jsx(JT,{children:v.jsxs(It,{sx:{"& h1, & h2, & h3, & h4, & h5, & h6":{fontWeight:"600",color:"#1a1a1a",marginBottom:"8px",marginTop:"16px"},"& h1":{fontSize:"28px"},"& h2":{fontSize:"24px"},"& h3":{fontSize:"20px"},"& p":{color:"#333333",lineHeight:"1.7",marginBottom:"8px",fontSize:"16px"},"& ul, & ol":{color:"#333333",lineHeight:"1.7",marginBottom:"8px",fontSize:"16px"},"& li":{marginBottom:"4px"}},children:[o===0?v.jsxs(Zr,{direction:"row",alignItems:"flex-start",justifyContent:"space-between",children:[v.jsx(W0,{children:e.text}),v.jsx(jo,{title:"Click to copy link",children:v.jsx(u_,{sx:{fontSize:"24px",color:"#666666",cursor:"pointer",marginTop:"26px"},onClick:L})})]}):v.jsx(W0,{children:e.text}),v.jsx(Ls,{open:_!=="",autoHideDuration:6e3,onClose:()=>C(""),message:_})]})})||e.type==="code"&&v.jsxs(JT,{children:[(!t||!n&&e.result||e.newSources&&e.newSources.length>0)&&v.jsx(Zr,{sx:{flexDirection:"column",gap:"8px",marginBottom:"16px"},children:e.newSources&&e.newSources.length>0&&I&&v.jsx(eC,{sx:{position:"relative",padding:"0"},children:v.jsxs(It,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingLeft:"24px",paddingRight:"8px"},children:[y&&v.jsx("span",{dangerouslySetInnerHTML:{__html:e.text.length>50&&y?`${y.substring(0,50)}...`:y},style:{fontFamily:"monospace",fontSize:"14px",flex:1,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",marginRight:"8px"}}),v.jsx(ir,{sx:{backgroundColor:"rgba(255, 255, 255, 0.9)","&:hover":{backgroundColor:"rgba(255, 255, 255, 1)"},width:"32px",height:"32px",flexShrink:0},onClick:()=>E(!0),children:v.jsx(im,{sx:{fontSize:"18px",color:"#666666"}})})]})})}),v.jsx(IF,{open:S,onClose:()=>E(!1),title:"Data Sources",hasValidImport:I,resourceUri:r,data:H,initialSelectedSourceIndex:F()}),v.jsxs(Bl,{open:i,onClose:()=>l(!1),maxWidth:"lg",fullWidth:!0,children:[v.jsxs(zl,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:["Malloy Code",v.jsx(ir,{onClick:()=>l(!1),sx:{color:"#666666"},children:v.jsx(Vl,{})})]}),v.jsx(Ul,{children:v.jsx(It,{sx:{border:"1px solid #e0e0e0",borderRadius:"8px",padding:"16px",fontFamily:"monospace",fontSize:"14px",lineHeight:"1.5",overflow:"auto",maxHeight:"70vh",backgroundColor:"#ffffff"},children:v.jsx("pre",{className:"code-display",style:{margin:0},dangerouslySetInnerHTML:{__html:y}})})})]}),v.jsxs(Bl,{open:u,onClose:()=>d(!1),maxWidth:"lg",fullWidth:!0,children:[v.jsxs(zl,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:["Embeddable Code",v.jsx(ir,{onClick:()=>d(!1),sx:{color:"#666666"},children:v.jsx(Vl,{})})]}),v.jsx(Ul,{children:v.jsxs(Zr,{sx:{flexDirection:"row",justifyContent:"space-between",alignItems:"flex-start"},children:[v.jsx(ct,{component:"div",sx:{fontSize:"12px",fontFamily:"monospace","& .line":{textWrap:"wrap"},flex:1},dangerouslySetInnerHTML:{__html:b}}),v.jsx(jo,{title:"Copy Embeddable Code",children:v.jsx(ir,{sx:{width:"24px",height:"24px",marginLeft:"8px",color:"#666666"},onClick:()=>{navigator.clipboard.writeText(z)},children:v.jsx(zfe,{})})})]})})]}),v.jsx(Z6,{open:p,onClose:()=>h(!1),result:e.result||"",title:"Results"}),e.result&&v.jsxs(eC,{sx:{position:"relative"},children:[v.jsx(It,{sx:{paddingTop:"24px"},children:v.jsx(jv,{result:e.result,minHeight:300,maxHeight:1e3,maxResultSize:a})}),v.jsx(It,{sx:{position:"absolute",bottom:0,left:0,right:0,height:"40px",background:"linear-gradient(transparent, rgba(255, 255, 255, 0.9))",pointerEvents:"none",zIndex:1}}),v.jsxs(Zr,{sx:{position:"absolute",top:"8px",right:"8px",flexDirection:"row",gap:"8px",alignItems:"center",zIndex:2},children:[!t&&v.jsx(ir,{sx:{backgroundColor:"rgba(255, 255, 255, 0.9)","&:hover":{backgroundColor:"rgba(255, 255, 255, 1)"},width:"32px",height:"32px"},onClick:$=>{$.stopPropagation(),l(!0)},children:v.jsx(OF,{sx:{fontSize:"18px",color:"#666666"}})}),v.jsx(ir,{sx:{backgroundColor:"rgba(255, 255, 255, 0.9)","&:hover":{backgroundColor:"rgba(255, 255, 255, 1)"},width:"32px",height:"32px"},onClick:()=>h(!0),children:v.jsx(im,{sx:{fontSize:"18px",color:"#666666"}})})]})]})]})}function Vfe({resourceUri:e,maxResultSize:t=0}){const{apiClients:n}=Zn(),{projectName:r,packageName:o,versionId:a,modelPath:i}=yr(e),{data:l,isSuccess:u,isError:d,error:p}=Zo({queryKey:[e],queryFn:async()=>(await n.notebooks.getNotebook(r,o,i,a)).data});return v.jsx(fce,{children:v.jsx(hce,{children:v.jsxs(Zr,{spacing:3,component:"section",children:[!u&&!d&&v.jsx(Ko,{text:"Fetching Notebook..."}),u&&l.notebookCells?.map((h,y)=>v.jsx(Hfe,{cell:h,index:y,resourceUri:e,maxResultSize:t},y)),d&&p.status===404&&v.jsxs(ct,{variant:"body2",sx:{color:"#666666"},children:[v.jsx("code",{children:`${r} > ${o} > ${i}`})," ","not found."]}),d&&p.status!==404&&v.jsx(Xo,{error:p,context:`${r} > ${o} > ${i}`})]})})})}const Gfe=On(v.jsx("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z"})),id=cA({createStyledComponent:Ye("div",{name:"MuiStack",slot:"Root"}),useThemeProps:e=>sn({props:e,name:"MuiStack"})});class kh{constructor(t,n){this.workbookData=n,this.workbookStorage=t,this.workbookData?this.isSaved=!0:(this.workbookData={models:[],cells:[],workbookPath:void 0},this.isSaved=!1)}isSaved;workbookStorage;getWorkbookData(){return this.workbookData}getWorkbookPath(){return this.workbookData.workbookPath}async renameWorkbook(t){if(this.workbookData.workbookPath.path!==t)try{await this.workbookStorage.moveWorkbook(this.workbookData.workbookPath,{path:t,workspace:this.workbookData.workbookPath.workspace})}catch{}return this.workbookData.workbookPath.path=t,this.isSaved=!1,await this.saveWorkbook()}getCells(){return this.workbookData.cells}deleteCell(t){return this.workbookData.cells=[...this.workbookData.cells.slice(0,t),...this.workbookData.cells.slice(t+1)],this.isSaved=!1,this}insertCell(t,n){return this.workbookData.cells=[...this.workbookData.cells.slice(0,t),n,...this.workbookData.cells.slice(t)],this.isSaved=!1,this}setCell(t,n){return this.workbookData.cells[t]=n,this.isSaved=!1,this}setModels(t){return this.workbookData.models=t,this.isSaved=!1,this}getModels(){return this.workbookData.models}updateWorkbookData(t){return this.workbookData=t,this.isSaved=!1,this}async saveWorkbook(){if(!this.isSaved){if(!this.workbookData.workbookPath)throw new Error("Workbook path is not set");await this.workbookStorage.saveWorkbook(this.workbookData.workbookPath,JSON.stringify(this.workbookData)),this.isSaved=!0}return new kh(this.workbookStorage,this.workbookData)}toMalloyWorkbook(){return this.workbookData.cells.map(t=>t.isMarkdown?`>>>markdown
364
+ `),I=C.selectionStart===R;O&&I&&C.setSelectionRange(R,R),n&&n(_)};return v.jsxs(A.Fragment,{children:[v.jsx("textarea",{value:i,onChange:E,ref:p,rows:o,style:a,...l}),v.jsx("textarea",{"aria-hidden":!0,className:e.className,readOnly:!0,ref:y,tabIndex:-1,style:{...Nde.shadow,...a,paddingTop:0,paddingBottom:0}})]})});function yp({props:e,states:t,muiFormControl:n}){return t.reduce((r,o)=>(r[o]=e[o],n&&typeof e[o]>"u"&&(r[o]=n[o]),r),{})}const I_=A.createContext(void 0);function uu(){return A.useContext(I_)}function vP(e){return e!=null&&!(Array.isArray(e)&&e.length===0)}function bb(e,t=!1){return e&&(vP(e.value)&&e.value!==""||t&&vP(e.defaultValue)&&e.defaultValue!=="")}function Mde(e){return e.startAdornment}function Fde(e){return en("MuiInputBase",e)}const ua=Wt("MuiInputBase",["root","formControl","focused","disabled","adornedStart","adornedEnd","error","sizeSmall","multiline","colorSecondary","fullWidth","hiddenLabel","readOnly","input","inputSizeSmall","inputMultiline","inputTypeSearch","inputAdornedStart","inputAdornedEnd","inputHiddenLabel"]);var EP;const zv=(e,t)=>{const{ownerState:n}=e;return[t.root,n.formControl&&t.formControl,n.startAdornment&&t.adornedStart,n.endAdornment&&t.adornedEnd,n.error&&t.error,n.size==="small"&&t.sizeSmall,n.multiline&&t.multiline,n.color&&t[`color${Ze(n.color)}`],n.fullWidth&&t.fullWidth,n.hiddenLabel&&t.hiddenLabel]},$v=(e,t)=>{const{ownerState:n}=e;return[t.input,n.size==="small"&&t.inputSizeSmall,n.multiline&&t.inputMultiline,n.type==="search"&&t.inputTypeSearch,n.startAdornment&&t.inputAdornedStart,n.endAdornment&&t.inputAdornedEnd,n.hiddenLabel&&t.inputHiddenLabel]},jde=e=>{const{classes:t,color:n,disabled:r,error:o,endAdornment:a,focused:i,formControl:l,fullWidth:u,hiddenLabel:d,multiline:p,readOnly:h,size:y,startAdornment:g,type:b}=e,x={root:["root",`color${Ze(n)}`,r&&"disabled",o&&"error",u&&"fullWidth",i&&"focused",l&&"formControl",y&&y!=="medium"&&`size${Ze(y)}`,p&&"multiline",g&&"adornedStart",a&&"adornedEnd",d&&"hiddenLabel",h&&"readOnly"],input:["input",r&&"disabled",b==="search"&&"inputTypeSearch",p&&"inputMultiline",y==="small"&&"inputSizeSmall",d&&"inputHiddenLabel",g&&"inputAdornedStart",a&&"inputAdornedEnd",h&&"readOnly"]};return Jt(x,Fde,t)},Hv=Ye("div",{name:"MuiInputBase",slot:"Root",overridesResolver:zv})(hn(({theme:e})=>({...e.typography.body1,color:(e.vars||e).palette.text.primary,lineHeight:"1.4375em",boxSizing:"border-box",position:"relative",cursor:"text",display:"inline-flex",alignItems:"center",[`&.${ua.disabled}`]:{color:(e.vars||e).palette.text.disabled,cursor:"default"},variants:[{props:({ownerState:t})=>t.multiline,style:{padding:"4px 0 5px"}},{props:({ownerState:t,size:n})=>t.multiline&&n==="small",style:{paddingTop:1}},{props:({ownerState:t})=>t.fullWidth,style:{width:"100%"}}]}))),Vv=Ye("input",{name:"MuiInputBase",slot:"Input",overridesResolver:$v})(hn(({theme:e})=>{const t=e.palette.mode==="light",n={color:"currentColor",...e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:t?.42:.5},transition:e.transitions.create("opacity",{duration:e.transitions.duration.shorter})},r={opacity:"0 !important"},o=e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:t?.42:.5};return{font:"inherit",letterSpacing:"inherit",color:"currentColor",padding:"4px 0 5px",border:0,boxSizing:"content-box",background:"none",height:"1.4375em",margin:0,WebkitTapHighlightColor:"transparent",display:"block",minWidth:0,width:"100%","&::-webkit-input-placeholder":n,"&::-moz-placeholder":n,"&::-ms-input-placeholder":n,"&:focus":{outline:0},"&:invalid":{boxShadow:"none"},"&::-webkit-search-decoration":{WebkitAppearance:"none"},[`label[data-shrink=false] + .${ua.formControl} &`]:{"&::-webkit-input-placeholder":r,"&::-moz-placeholder":r,"&::-ms-input-placeholder":r,"&:focus::-webkit-input-placeholder":o,"&:focus::-moz-placeholder":o,"&:focus::-ms-input-placeholder":o},[`&.${ua.disabled}`]:{opacity:1,WebkitTextFillColor:(e.vars||e).palette.text.disabled},variants:[{props:({ownerState:a})=>!a.disableInjectingGlobalStyles,style:{animationName:"mui-auto-fill-cancel",animationDuration:"10ms","&:-webkit-autofill":{animationDuration:"5000s",animationName:"mui-auto-fill"}}},{props:{size:"small"},style:{paddingTop:1}},{props:({ownerState:a})=>a.multiline,style:{height:"auto",resize:"none",padding:0,paddingTop:0}},{props:{type:"search"},style:{MozAppearance:"textfield"}}]}})),xP=eie({"@keyframes mui-auto-fill":{from:{display:"block"}},"@keyframes mui-auto-fill-cancel":{from:{display:"block"}}}),O_=A.forwardRef(function(e,t){const n=sn({props:e,name:"MuiInputBase"}),{"aria-describedby":r,autoComplete:o,autoFocus:a,className:i,color:l,components:u={},componentsProps:d={},defaultValue:p,disabled:h,disableInjectingGlobalStyles:y,endAdornment:g,error:b,fullWidth:x=!1,id:S,inputComponent:E="input",inputProps:_={},inputRef:C,margin:R,maxRows:O,minRows:I,multiline:F=!1,name:H,onBlur:z,onChange:L,onClick:$,onFocus:k,onKeyDown:M,onKeyUp:j,placeholder:V,readOnly:B,renderSuffix:q,rows:Y,size:ee,slotProps:N={},slots:W={},startAdornment:K,type:P="text",value:Z,...ae}=n,J=_.value!=null?_.value:Z,{current:pe}=A.useRef(J!=null),le=A.useRef(),Ee=A.useCallback(tt=>{},[]),Te=sr(le,C,_.ref,Ee),[Ae,Ue]=A.useState(!1),Re=uu(),ve=yp({props:n,muiFormControl:Re,states:["color","disabled","error","hiddenLabel","size","required","filled"]});ve.focused=Re?Re.focused:Ae,A.useEffect(()=>{!Re&&h&&Ae&&(Ue(!1),z&&z())},[Re,h,Ae,z]);const pt=Re&&Re.onFilled,ut=Re&&Re.onEmpty,ze=A.useCallback(tt=>{bb(tt)?pt&&pt():ut&&ut()},[pt,ut]);Gi(()=>{pe&&ze({value:J})},[J,ze,pe]);const $e=tt=>{k&&k(tt),_.onFocus&&_.onFocus(tt),Re&&Re.onFocus?Re.onFocus(tt):Ue(!0)},dt=tt=>{z&&z(tt),_.onBlur&&_.onBlur(tt),Re&&Re.onBlur?Re.onBlur(tt):Ue(!1)},Be=(tt,...qe)=>{if(!pe){const Ut=tt.target||le.current;if(Ut==null)throw new Error(Is(1));ze({value:Ut.value})}_.onChange&&_.onChange(tt,...qe),L&&L(tt,...qe)};A.useEffect(()=>{ze(le.current)},[]);const Fe=tt=>{le.current&&tt.currentTarget===tt.target&&le.current.focus(),$&&$(tt)};let Me=E,At=_;F&&Me==="input"&&(Y?At={type:void 0,minRows:Y,maxRows:Y,...At}:At={type:void 0,maxRows:O,minRows:I,...At},Me=Lde);const Dt=tt=>{ze(tt.animationName==="mui-auto-fill-cancel"?le.current:{value:"x"})};A.useEffect(()=>{Re&&Re.setAdornedStart(!!K)},[Re,K]);const gt={...n,color:ve.color||"primary",disabled:ve.disabled,endAdornment:g,error:ve.error,focused:ve.focused,formControl:Re,fullWidth:x,hiddenLabel:ve.hiddenLabel,multiline:F,size:ve.size,startAdornment:K,type:P},ue=jde(gt),ge=W.root||u.Root||Hv,He=N.root||d.root||{},rt=W.input||u.Input||Vv;return At={...At,...N.input??d.input},v.jsxs(A.Fragment,{children:[!y&&typeof xP=="function"&&(EP||(EP=v.jsx(xP,{}))),v.jsxs(ge,{...He,ref:t,onClick:Fe,...ae,...!mb(ge)&&{ownerState:{...gt,...He.ownerState}},className:Tt(ue.root,He.className,i,B&&"MuiInputBase-readOnly"),children:[K,v.jsx(I_.Provider,{value:null,children:v.jsx(rt,{"aria-invalid":ve.error,"aria-describedby":r,autoComplete:o,autoFocus:a,defaultValue:p,disabled:ve.disabled,id:S,onAnimationStart:Dt,name:H,placeholder:V,readOnly:B,required:ve.required,rows:Y,value:J,onKeyDown:M,onKeyUp:j,type:P,...At,...!mb(rt)&&{as:Me,ownerState:{...gt,...At.ownerState}},ref:Te,className:Tt(ue.input,At.className,B&&"MuiInputBase-readOnly"),onBlur:dt,onChange:Be,onFocus:$e})}),g,q?q({...ve,startAdornment:K}):null]})]})});function Bde(e){return en("MuiInput",e)}const Tl={...ua,...Wt("MuiInput",["root","underline","input"])};function Ude(e){return en("MuiOutlinedInput",e)}const Na={...ua,...Wt("MuiOutlinedInput",["root","notchedOutline","input"])};function zde(e){return en("MuiFilledInput",e)}const da={...ua,...Wt("MuiFilledInput",["root","underline","input","adornedStart","adornedEnd","sizeSmall","multiline","hiddenLabel"])},$de=On(v.jsx("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})),yF=On(v.jsx("path",{d:"M7 10l5 5 5-5z"}));function Hde(e){return en("MuiAutocomplete",e)}const tn=Wt("MuiAutocomplete",["root","expanded","fullWidth","focused","focusVisible","tag","tagSizeSmall","tagSizeMedium","hasPopupIcon","hasClearIcon","inputRoot","input","inputFocused","endAdornment","clearIndicator","popupIndicator","popupIndicatorOpen","popper","popperDisablePortal","paper","listbox","loading","noOptions","option","groupLabel","groupUl"]);var SP,TP;const Vde=e=>{const{classes:t,disablePortal:n,expanded:r,focused:o,fullWidth:a,hasClearIcon:i,hasPopupIcon:l,inputFocused:u,popupOpen:d,size:p}=e,h={root:["root",r&&"expanded",o&&"focused",a&&"fullWidth",i&&"hasClearIcon",l&&"hasPopupIcon"],inputRoot:["inputRoot"],input:["input",u&&"inputFocused"],tag:["tag",`tagSize${Ze(p)}`],endAdornment:["endAdornment"],clearIndicator:["clearIndicator"],popupIndicator:["popupIndicator",d&&"popupIndicatorOpen"],popper:["popper",n&&"popperDisablePortal"],paper:["paper"],listbox:["listbox"],loading:["loading"],noOptions:["noOptions"],option:["option"],groupLabel:["groupLabel"],groupUl:["groupUl"]};return Jt(h,Hde,t)},Gde=Ye("div",{name:"MuiAutocomplete",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e,{fullWidth:r,hasClearIcon:o,hasPopupIcon:a,inputFocused:i,size:l}=n;return[{[`& .${tn.tag}`]:t.tag},{[`& .${tn.tag}`]:t[`tagSize${Ze(l)}`]},{[`& .${tn.inputRoot}`]:t.inputRoot},{[`& .${tn.input}`]:t.input},{[`& .${tn.input}`]:i&&t.inputFocused},t.root,r&&t.fullWidth,a&&t.hasPopupIcon,o&&t.hasClearIcon]}})({[`&.${tn.focused} .${tn.clearIndicator}`]:{visibility:"visible"},"@media (pointer: fine)":{[`&:hover .${tn.clearIndicator}`]:{visibility:"visible"}},[`& .${tn.tag}`]:{margin:3,maxWidth:"calc(100% - 6px)"},[`& .${tn.inputRoot}`]:{[`.${tn.hasPopupIcon}&, .${tn.hasClearIcon}&`]:{paddingRight:30},[`.${tn.hasPopupIcon}.${tn.hasClearIcon}&`]:{paddingRight:56},[`& .${tn.input}`]:{width:0,minWidth:30}},[`& .${Tl.root}`]:{paddingBottom:1,"& .MuiInput-input":{padding:"4px 4px 4px 0px"}},[`& .${Tl.root}.${ua.sizeSmall}`]:{[`& .${Tl.input}`]:{padding:"2px 4px 3px 0"}},[`& .${Na.root}`]:{padding:9,[`.${tn.hasPopupIcon}&, .${tn.hasClearIcon}&`]:{paddingRight:39},[`.${tn.hasPopupIcon}.${tn.hasClearIcon}&`]:{paddingRight:65},[`& .${tn.input}`]:{padding:"7.5px 4px 7.5px 5px"},[`& .${tn.endAdornment}`]:{right:9}},[`& .${Na.root}.${ua.sizeSmall}`]:{paddingTop:6,paddingBottom:6,paddingLeft:6,[`& .${tn.input}`]:{padding:"2.5px 4px 2.5px 8px"}},[`& .${da.root}`]:{paddingTop:19,paddingLeft:8,[`.${tn.hasPopupIcon}&, .${tn.hasClearIcon}&`]:{paddingRight:39},[`.${tn.hasPopupIcon}.${tn.hasClearIcon}&`]:{paddingRight:65},[`& .${da.input}`]:{padding:"7px 4px"},[`& .${tn.endAdornment}`]:{right:9}},[`& .${da.root}.${ua.sizeSmall}`]:{paddingBottom:1,[`& .${da.input}`]:{padding:"2.5px 4px"}},[`& .${ua.hiddenLabel}`]:{paddingTop:8},[`& .${da.root}.${ua.hiddenLabel}`]:{paddingTop:0,paddingBottom:0,[`& .${tn.input}`]:{paddingTop:16,paddingBottom:17}},[`& .${da.root}.${ua.hiddenLabel}.${ua.sizeSmall}`]:{[`& .${tn.input}`]:{paddingTop:8,paddingBottom:9}},[`& .${tn.input}`]:{flexGrow:1,textOverflow:"ellipsis",opacity:0},variants:[{props:{fullWidth:!0},style:{width:"100%"}},{props:{size:"small"},style:{[`& .${tn.tag}`]:{margin:2,maxWidth:"calc(100% - 4px)"}}},{props:{inputFocused:!0},style:{[`& .${tn.input}`]:{opacity:1}}},{props:{multiple:!0},style:{[`& .${tn.inputRoot}`]:{flexWrap:"wrap"}}}]}),qde=Ye("div",{name:"MuiAutocomplete",slot:"EndAdornment"})({position:"absolute",right:0,top:"50%",transform:"translate(0, -50%)"}),Wde=Ye(Qd,{name:"MuiAutocomplete",slot:"ClearIndicator"})({marginRight:-2,padding:4,visibility:"hidden"}),Yde=Ye(Qd,{name:"MuiAutocomplete",slot:"PopupIndicator",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.popupIndicator,n.popupOpen&&t.popupIndicatorOpen]}})({padding:2,marginRight:-2,variants:[{props:{popupOpen:!0},style:{transform:"rotate(180deg)"}}]}),Kde=Ye(fF,{name:"MuiAutocomplete",slot:"Popper",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${tn.option}`]:t.option},t.popper,n.disablePortal&&t.popperDisablePortal]}})(hn(({theme:e})=>({zIndex:(e.vars||e).zIndex.modal,variants:[{props:{disablePortal:!0},style:{position:"absolute"}}]}))),Qde=Ye(gp,{name:"MuiAutocomplete",slot:"Paper"})(hn(({theme:e})=>({...e.typography.body1,overflow:"auto"}))),Xde=Ye("div",{name:"MuiAutocomplete",slot:"Loading"})(hn(({theme:e})=>({color:(e.vars||e).palette.text.secondary,padding:"14px 16px"}))),Zde=Ye("div",{name:"MuiAutocomplete",slot:"NoOptions"})(hn(({theme:e})=>({color:(e.vars||e).palette.text.secondary,padding:"14px 16px"}))),Jde=Ye("ul",{name:"MuiAutocomplete",slot:"Listbox"})(hn(({theme:e})=>({listStyle:"none",margin:0,padding:"8px 0",maxHeight:"40vh",overflow:"auto",position:"relative",[`& .${tn.option}`]:{minHeight:48,display:"flex",overflow:"hidden",justifyContent:"flex-start",alignItems:"center",cursor:"pointer",paddingTop:6,boxSizing:"border-box",outline:"0",WebkitTapHighlightColor:"transparent",paddingBottom:6,paddingLeft:16,paddingRight:16,[e.breakpoints.up("sm")]:{minHeight:"auto"},[`&.${tn.focused}`]:{backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},'&[aria-disabled="true"]':{opacity:(e.vars||e).palette.action.disabledOpacity,pointerEvents:"none"},[`&.${tn.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},'&[aria-selected="true"]':{backgroundColor:e.alpha((e.vars||e).palette.primary.main,(e.vars||e).palette.action.selectedOpacity),[`&.${tn.focused}`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.hoverOpacity}`),"@media (hover: none)":{backgroundColor:(e.vars||e).palette.action.selected}},[`&.${tn.focusVisible}`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.focusOpacity}`)}}}}))),epe=Ye(oC,{name:"MuiAutocomplete",slot:"GroupLabel"})(hn(({theme:e})=>({backgroundColor:(e.vars||e).palette.background.paper,top:-8}))),tpe=Ye("ul",{name:"MuiAutocomplete",slot:"GroupUl"})({padding:0,[`& .${tn.option}`]:{paddingLeft:24}}),npe=A.forwardRef(function(e,t){const n=sn({props:e,name:"MuiAutocomplete"}),{autoComplete:r=!1,autoHighlight:o=!1,autoSelect:a=!1,blurOnSelect:i=!1,ChipProps:l,className:u,clearIcon:d=SP||(SP=v.jsx($de,{fontSize:"small"})),clearOnBlur:p=!n.freeSolo,clearOnEscape:h=!1,clearText:y="Clear",closeText:g="Close",componentsProps:b,defaultValue:x=n.multiple?[]:null,disableClearable:S=!1,disableCloseOnSelect:E=!1,disabled:_=!1,disabledItemsFocusable:C=!1,disableListWrap:R=!1,disablePortal:O=!1,filterOptions:I,filterSelectedOptions:F=!1,forcePopupIcon:H="auto",freeSolo:z=!1,fullWidth:L=!1,getLimitTagsText:$=Vt=>`+${Vt}`,getOptionDisabled:k,getOptionKey:M,getOptionLabel:j,isOptionEqualToValue:V,groupBy:B,handleHomeEndKeys:q=!n.freeSolo,id:Y,includeInputInList:ee=!1,inputValue:N,limitTags:W=-1,ListboxComponent:K,ListboxProps:P,loading:Z=!1,loadingText:ae="Loading…",multiple:J=!1,noOptionsText:pe="No options",onChange:le,onClose:Ee,onHighlightChange:Te,onInputChange:Ae,onOpen:Ue,open:Re,openOnFocus:ve=!1,openText:pt="Open",options:ut,PaperComponent:ze,PopperComponent:$e,popupIcon:dt=TP||(TP=v.jsx(yF,{})),readOnly:Be=!1,renderGroup:Fe,renderInput:Me,renderOption:At,renderTags:Dt,renderValue:gt,selectOnFocus:ue=!n.freeSolo,size:ge="medium",slots:He={},slotProps:rt={},value:tt,...qe}=n,{getRootProps:Ut,getInputProps:Gt,getInputLabelProps:nt,getPopupIndicatorProps:se,getClearProps:he,getItemProps:at,getListboxProps:ft,getOptionProps:Nn,value:Jn,dirty:_r,expanded:zn,id:er,popupOpen:ar,focused:vn,focusedItem:fr,anchorEl:Ct,setAnchorEl:re,inputValue:de,groupedOptions:be}=Tce({...n,componentName:"Autocomplete"}),Pe=!S&&!_&&_r&&!Be,We=(!z||H===!0)&&H!==!1,{onMouseDown:yt}=Gt(),{ref:Et,...bt}=ft(),xt=j||(Vt=>Vt.label??Vt),ht={...n,disablePortal:O,expanded:zn,focused:vn,fullWidth:L,getOptionLabel:xt,hasClearIcon:Pe,hasPopupIcon:We,inputFocused:fr===-1,popupOpen:ar,size:ge},st=Vde(ht),mt={slots:{paper:ze,popper:$e,...He},slotProps:{chip:l,listbox:P,...b,...rt}},[qt,mn]=xn("listbox",{elementType:Jde,externalForwardedProps:mt,ownerState:ht,className:st.listbox,additionalProps:bt,ref:Et}),[$n,Hn]=xn("paper",{elementType:gp,externalForwardedProps:mt,ownerState:ht,className:st.paper}),[$t,xe]=xn("popper",{elementType:fF,externalForwardedProps:mt,ownerState:ht,className:st.popper,additionalProps:{disablePortal:O,style:{width:Ct?Ct.clientWidth:null},role:"presentation",anchorEl:Ct,open:ar}});let _e;const it=Vt=>({className:st.tag,disabled:_,...at(Vt)});if(J?Jn.length>0&&(Dt?_e=Dt(Jn,it,ht):gt?_e=gt(Jn,it,ht):_e=Jn.map((Vt,Gr)=>{const{key:Ft,...tr}=it({index:Gr});return v.jsx(Ode,{label:xt(Vt),size:ge,...tr,...mt.slotProps.chip},Ft)})):gt&&Jn!=null&&(_e=gt(Jn,it,ht)),W>-1&&Array.isArray(_e)){const Vt=_e.length-W;!vn&&Vt>0&&(_e=_e.splice(0,W),_e.push(v.jsx("span",{className:st.tag,children:$(Vt)},_e.length)))}const _t=Fe||(Vt=>v.jsxs("li",{children:[v.jsx(epe,{className:st.groupLabel,ownerState:ht,component:"div",children:Vt.group}),v.jsx(tpe,{className:st.groupUl,ownerState:ht,children:Vt.children})]},Vt.key)),Lt=At||((Vt,Gr)=>{const{key:Ft,...tr}=Vt;return v.jsx("li",{...tr,children:xt(Gr)},Ft)}),En=(Vt,Gr)=>{const Ft=Nn({option:Vt,index:Gr});return Lt({...Ft,className:st.option},Vt,{selected:Ft["aria-selected"],index:Gr,inputValue:de},ht)},Kn=mt.slotProps.clearIndicator,so=mt.slotProps.popupIndicator;return v.jsxs(A.Fragment,{children:[v.jsx(Gde,{ref:t,className:Tt(st.root,u),ownerState:ht,...Ut(qe),children:Me({id:er,disabled:_,fullWidth:!0,size:ge==="small"?"small":void 0,InputLabelProps:nt(),InputProps:{ref:re,className:st.inputRoot,startAdornment:_e,onMouseDown:Vt=>{Vt.target===Vt.currentTarget&&yt(Vt)},...(Pe||We)&&{endAdornment:v.jsxs(qde,{className:st.endAdornment,ownerState:ht,children:[Pe?v.jsx(Wde,{...he(),"aria-label":y,title:y,ownerState:ht,...Kn,className:Tt(st.clearIndicator,Kn?.className),children:d}):null,We?v.jsx(Yde,{...se(),disabled:_,"aria-label":ar?g:pt,title:ar?g:pt,ownerState:ht,...so,className:Tt(st.popupIndicator,so?.className),children:dt}):null]})}},inputProps:{className:st.input,disabled:_,readOnly:Be,...Gt()}})}),Ct?v.jsx(Kde,{as:$t,...xe,children:v.jsxs(Qde,{as:$n,...Hn,children:[Z&&be.length===0?v.jsx(Xde,{className:st.loading,ownerState:ht,children:ae}):null,be.length===0&&!z&&!Z?v.jsx(Zde,{className:st.noOptions,ownerState:ht,role:"presentation",onMouseDown:Vt=>{Vt.preventDefault()},children:pe}):null,be.length>0?v.jsx(qt,{as:K,...mn,children:be.map((Vt,Gr)=>B?_t({key:Vt.key,group:Vt.group,children:Vt.options.map((Ft,tr)=>En(Ft,Vt.index+tr))}):En(Vt,Gr))}):null]})}):null]})}),rpe=e=>{const{classes:t,disableUnderline:n}=e,r=Jt({root:["root",!n&&"underline"],input:["input"]},Bde,t);return{...t,...r}},ope=Ye(Hv,{shouldForwardProp:e=>Do(e)||e==="classes",name:"MuiInput",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[...zv(e,t),!n.disableUnderline&&t.underline]}})(hn(({theme:e})=>{let t=e.palette.mode==="light"?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return e.vars&&(t=e.alpha(e.vars.palette.common.onBackground,e.vars.opacity.inputUnderline)),{position:"relative",variants:[{props:({ownerState:n})=>n.formControl,style:{"label + &":{marginTop:16}}},{props:({ownerState:n})=>!n.disableUnderline,style:{"&::after":{left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${Tl.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${Tl.error}`]:{"&::before, &::after":{borderBottomColor:(e.vars||e).palette.error.main}},"&::before":{borderBottom:`1px solid ${t}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${Tl.disabled}, .${Tl.error}):before`]:{borderBottom:`2px solid ${(e.vars||e).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${t}`}},[`&.${Tl.disabled}:before`]:{borderBottomStyle:"dotted"}}},...Object.entries(e.palette).filter(ko()).map(([n])=>({props:{color:n,disableUnderline:!1},style:{"&::after":{borderBottom:`2px solid ${(e.vars||e).palette[n].main}`}}}))]}})),ape=Ye(Vv,{name:"MuiInput",slot:"Input",overridesResolver:$v})({}),N_=A.forwardRef(function(e,t){const n=sn({props:e,name:"MuiInput"}),{disableUnderline:r=!1,components:o={},componentsProps:a,fullWidth:i=!1,inputComponent:l="input",multiline:u=!1,slotProps:d,slots:p={},type:h="text",...y}=n,g=rpe(n),b={root:{ownerState:{disableUnderline:r}}},x=d??a?yo(d??a,b):b,S=p.root??o.Root??ope,E=p.input??o.Input??ape;return v.jsx(O_,{slots:{root:S,input:E},slotProps:x,fullWidth:i,inputComponent:l,multiline:u,ref:t,type:h,...y,classes:g})});N_.muiName="Input";const ipe=e=>{const{classes:t,disableUnderline:n,startAdornment:r,endAdornment:o,size:a,hiddenLabel:i,multiline:l}=e,u={root:["root",!n&&"underline",r&&"adornedStart",o&&"adornedEnd",a==="small"&&`size${Ze(a)}`,i&&"hiddenLabel",l&&"multiline"],input:["input"]},d=Jt(u,zde,t);return{...t,...d}},spe=Ye(Hv,{shouldForwardProp:e=>Do(e)||e==="classes",name:"MuiFilledInput",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[...zv(e,t),!n.disableUnderline&&t.underline]}})(hn(({theme:e})=>{const t=e.palette.mode==="light",n=t?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)",r=t?"rgba(0, 0, 0, 0.06)":"rgba(255, 255, 255, 0.09)",o=t?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.13)",a=t?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)";return{position:"relative",backgroundColor:e.vars?e.vars.palette.FilledInput.bg:r,borderTopLeftRadius:(e.vars||e).shape.borderRadius,borderTopRightRadius:(e.vars||e).shape.borderRadius,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),"&:hover":{backgroundColor:e.vars?e.vars.palette.FilledInput.hoverBg:o,"@media (hover: none)":{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:r}},[`&.${da.focused}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:r},[`&.${da.disabled}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.disabledBg:a},variants:[{props:({ownerState:i})=>!i.disableUnderline,style:{"&::after":{left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${da.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${da.error}`]:{"&::before, &::after":{borderBottomColor:(e.vars||e).palette.error.main}},"&::before":{borderBottom:`1px solid ${e.vars?e.alpha(e.vars.palette.common.onBackground,e.vars.opacity.inputUnderline):n}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${da.disabled}, .${da.error}):before`]:{borderBottom:`1px solid ${(e.vars||e).palette.text.primary}`},[`&.${da.disabled}:before`]:{borderBottomStyle:"dotted"}}},...Object.entries(e.palette).filter(ko()).map(([i])=>({props:{disableUnderline:!1,color:i},style:{"&::after":{borderBottom:`2px solid ${(e.vars||e).palette[i]?.main}`}}})),{props:({ownerState:i})=>i.startAdornment,style:{paddingLeft:12}},{props:({ownerState:i})=>i.endAdornment,style:{paddingRight:12}},{props:({ownerState:i})=>i.multiline,style:{padding:"25px 12px 8px"}},{props:({ownerState:i,size:l})=>i.multiline&&l==="small",style:{paddingTop:21,paddingBottom:4}},{props:({ownerState:i})=>i.multiline&&i.hiddenLabel,style:{paddingTop:16,paddingBottom:17}},{props:({ownerState:i})=>i.multiline&&i.hiddenLabel&&i.size==="small",style:{paddingTop:8,paddingBottom:9}}]}})),lpe=Ye(Vv,{name:"MuiFilledInput",slot:"Input",overridesResolver:$v})(hn(({theme:e})=>({paddingTop:25,paddingRight:12,paddingBottom:8,paddingLeft:12,...!e.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:e.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:e.palette.mode==="light"?null:"#fff",caretColor:e.palette.mode==="light"?null:"#fff",borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"}},...e.vars&&{"&:-webkit-autofill":{borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"},[e.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},variants:[{props:{size:"small"},style:{paddingTop:21,paddingBottom:4}},{props:({ownerState:t})=>t.hiddenLabel,style:{paddingTop:16,paddingBottom:17}},{props:({ownerState:t})=>t.startAdornment,style:{paddingLeft:0}},{props:({ownerState:t})=>t.endAdornment,style:{paddingRight:0}},{props:({ownerState:t})=>t.hiddenLabel&&t.size==="small",style:{paddingTop:8,paddingBottom:9}},{props:({ownerState:t})=>t.multiline,style:{paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:0}}]}))),P_=A.forwardRef(function(e,t){const n=sn({props:e,name:"MuiFilledInput"}),{disableUnderline:r=!1,components:o={},componentsProps:a,fullWidth:i=!1,hiddenLabel:l,inputComponent:u="input",multiline:d=!1,slotProps:p,slots:h={},type:y="text",...g}=n,b={...n,disableUnderline:r,fullWidth:i,inputComponent:u,multiline:d,type:y},x=ipe(n),S={root:{ownerState:b},input:{ownerState:b}},E=p??a?yo(S,p??a):S,_=h.root??o.Root??spe,C=h.input??o.Input??lpe;return v.jsx(O_,{slots:{root:_,input:C},slotProps:E,fullWidth:i,inputComponent:u,multiline:d,ref:t,type:y,...g,classes:x})});P_.muiName="Input";var CP;const cpe=Ye("fieldset",{name:"MuiNotchedOutlined",shouldForwardProp:Do})({textAlign:"left",position:"absolute",bottom:0,right:0,top:-5,left:0,margin:0,padding:"0 8px",pointerEvents:"none",borderRadius:"inherit",borderStyle:"solid",borderWidth:1,overflow:"hidden",minWidth:"0%"}),upe=Ye("legend",{name:"MuiNotchedOutlined",shouldForwardProp:Do})(hn(({theme:e})=>({float:"unset",width:"auto",overflow:"hidden",variants:[{props:({ownerState:t})=>!t.withLabel,style:{padding:0,lineHeight:"11px",transition:e.transitions.create("width",{duration:150,easing:e.transitions.easing.easeOut})}},{props:({ownerState:t})=>t.withLabel,style:{display:"block",padding:0,height:11,fontSize:"0.75em",visibility:"hidden",maxWidth:.01,transition:e.transitions.create("max-width",{duration:50,easing:e.transitions.easing.easeOut}),whiteSpace:"nowrap","& > span":{paddingLeft:5,paddingRight:5,display:"inline-block",opacity:0,visibility:"visible"}}},{props:({ownerState:t})=>t.withLabel&&t.notched,style:{maxWidth:"100%",transition:e.transitions.create("max-width",{duration:100,easing:e.transitions.easing.easeOut,delay:50})}}]})));function dpe(e){const{children:t,classes:n,className:r,label:o,notched:a,...i}=e,l=o!=null&&o!=="",u={...e,notched:a,withLabel:l};return v.jsx(cpe,{"aria-hidden":!0,className:r,ownerState:u,...i,children:v.jsx(upe,{ownerState:u,children:l?v.jsx("span",{children:o}):CP||(CP=v.jsx("span",{className:"notranslate","aria-hidden":!0,children:"​"}))})})}const ppe=e=>{const{classes:t}=e,n=Jt({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},Ude,t);return{...t,...n}},fpe=Ye(Hv,{shouldForwardProp:e=>Do(e)||e==="classes",name:"MuiOutlinedInput",slot:"Root",overridesResolver:zv})(hn(({theme:e})=>{const t=e.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{position:"relative",borderRadius:(e.vars||e).shape.borderRadius,[`&:hover .${Na.notchedOutline}`]:{borderColor:(e.vars||e).palette.text.primary},"@media (hover: none)":{[`&:hover .${Na.notchedOutline}`]:{borderColor:e.vars?e.alpha(e.vars.palette.common.onBackground,.23):t}},[`&.${Na.focused} .${Na.notchedOutline}`]:{borderWidth:2},variants:[...Object.entries(e.palette).filter(ko()).map(([n])=>({props:{color:n},style:{[`&.${Na.focused} .${Na.notchedOutline}`]:{borderColor:(e.vars||e).palette[n].main}}})),{props:{},style:{[`&.${Na.error} .${Na.notchedOutline}`]:{borderColor:(e.vars||e).palette.error.main},[`&.${Na.disabled} .${Na.notchedOutline}`]:{borderColor:(e.vars||e).palette.action.disabled}}},{props:({ownerState:n})=>n.startAdornment,style:{paddingLeft:14}},{props:({ownerState:n})=>n.endAdornment,style:{paddingRight:14}},{props:({ownerState:n})=>n.multiline,style:{padding:"16.5px 14px"}},{props:({ownerState:n,size:r})=>n.multiline&&r==="small",style:{padding:"8.5px 14px"}}]}})),hpe=Ye(dpe,{name:"MuiOutlinedInput",slot:"NotchedOutline"})(hn(({theme:e})=>{const t=e.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{borderColor:e.vars?e.alpha(e.vars.palette.common.onBackground,.23):t}})),mpe=Ye(Vv,{name:"MuiOutlinedInput",slot:"Input",overridesResolver:$v})(hn(({theme:e})=>({padding:"16.5px 14px",...!e.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:e.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:e.palette.mode==="light"?null:"#fff",caretColor:e.palette.mode==="light"?null:"#fff",borderRadius:"inherit"}},...e.vars&&{"&:-webkit-autofill":{borderRadius:"inherit"},[e.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},variants:[{props:{size:"small"},style:{padding:"8.5px 14px"}},{props:({ownerState:t})=>t.multiline,style:{padding:0}},{props:({ownerState:t})=>t.startAdornment,style:{paddingLeft:0}},{props:({ownerState:t})=>t.endAdornment,style:{paddingRight:0}}]}))),L_=A.forwardRef(function(e,t){const n=sn({props:e,name:"MuiOutlinedInput"}),{components:r={},fullWidth:o=!1,inputComponent:a="input",label:i,multiline:l=!1,notched:u,slots:d={},slotProps:p={},type:h="text",...y}=n,g=ppe(n),b=uu(),x=yp({props:n,muiFormControl:b,states:["color","disabled","error","focused","hiddenLabel","size","required"]}),S={...n,color:x.color||"primary",disabled:x.disabled,error:x.error,focused:x.focused,formControl:b,fullWidth:o,hiddenLabel:x.hiddenLabel,multiline:l,size:x.size,type:h},E=d.root??r.Root??fpe,_=d.input??r.Input??mpe,[C,R]=xn("notchedOutline",{elementType:hpe,className:g.notchedOutline,shouldForwardComponentProp:!0,ownerState:S,externalForwardedProps:{slots:d,slotProps:p},additionalProps:{label:i!=null&&i!==""&&x.required?v.jsxs(A.Fragment,{children:[i," ","*"]}):i}});return v.jsx(O_,{slots:{root:E,input:_},slotProps:p,renderSuffix:O=>v.jsx(C,{...R,notched:typeof u<"u"?u:!!(O.startAdornment||O.filled||O.focused)}),fullWidth:o,inputComponent:a,multiline:l,ref:t,type:h,...y,classes:{...g,notchedOutline:null}})});L_.muiName="Input";function gpe(e){return en("MuiFormLabel",e)}const Ah=Wt("MuiFormLabel",["root","colorSecondary","focused","disabled","error","filled","required","asterisk"]),ype=e=>{const{classes:t,color:n,focused:r,disabled:o,error:a,filled:i,required:l}=e,u={root:["root",`color${Ze(n)}`,o&&"disabled",a&&"error",i&&"filled",r&&"focused",l&&"required"],asterisk:["asterisk",a&&"error"]};return Jt(u,gpe,t)},bpe=Ye("label",{name:"MuiFormLabel",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.color==="secondary"&&t.colorSecondary,n.filled&&t.filled]}})(hn(({theme:e})=>({color:(e.vars||e).palette.text.secondary,...e.typography.body1,lineHeight:"1.4375em",padding:0,position:"relative",variants:[...Object.entries(e.palette).filter(ko()).map(([t])=>({props:{color:t},style:{[`&.${Ah.focused}`]:{color:(e.vars||e).palette[t].main}}})),{props:{},style:{[`&.${Ah.disabled}`]:{color:(e.vars||e).palette.text.disabled},[`&.${Ah.error}`]:{color:(e.vars||e).palette.error.main}}}]}))),vpe=Ye("span",{name:"MuiFormLabel",slot:"Asterisk"})(hn(({theme:e})=>({[`&.${Ah.error}`]:{color:(e.vars||e).palette.error.main}}))),Epe=A.forwardRef(function(e,t){const n=sn({props:e,name:"MuiFormLabel"}),{children:r,className:o,color:a,component:i="label",disabled:l,error:u,filled:d,focused:p,required:h,...y}=n,g=uu(),b=yp({props:n,muiFormControl:g,states:["color","required","focused","disabled","error","filled"]}),x={...n,color:b.color||"primary",component:i,disabled:b.disabled,error:b.error,filled:b.filled,focused:b.focused,required:b.required},S=ype(x);return v.jsxs(bpe,{as:i,ownerState:x,className:Tt(S.root,o),ref:t,...y,children:[r,b.required&&v.jsxs(vpe,{ownerState:x,"aria-hidden":!0,className:S.asterisk,children:[" ","*"]})]})});function xpe(e){return en("MuiInputLabel",e)}Wt("MuiInputLabel",["root","focused","disabled","error","required","asterisk","formControl","sizeSmall","shrink","animated","standard","filled","outlined"]);const Spe=e=>{const{classes:t,formControl:n,size:r,shrink:o,disableAnimation:a,variant:i,required:l}=e,u={root:["root",n&&"formControl",!a&&"animated",o&&"shrink",r&&r!=="medium"&&`size${Ze(r)}`,i],asterisk:[l&&"asterisk"]},d=Jt(u,xpe,t);return{...t,...d}},Tpe=Ye(Epe,{shouldForwardProp:e=>Do(e)||e==="classes",name:"MuiInputLabel",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${Ah.asterisk}`]:t.asterisk},t.root,n.formControl&&t.formControl,n.size==="small"&&t.sizeSmall,n.shrink&&t.shrink,!n.disableAnimation&&t.animated,n.focused&&t.focused,t[n.variant]]}})(hn(({theme:e})=>({display:"block",transformOrigin:"top left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%",variants:[{props:({ownerState:t})=>t.formControl,style:{position:"absolute",left:0,top:0,transform:"translate(0, 20px) scale(1)"}},{props:{size:"small"},style:{transform:"translate(0, 17px) scale(1)"}},{props:({ownerState:t})=>t.shrink,style:{transform:"translate(0, -1.5px) scale(0.75)",transformOrigin:"top left",maxWidth:"133%"}},{props:({ownerState:t})=>!t.disableAnimation,style:{transition:e.transitions.create(["color","transform","max-width"],{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut})}},{props:{variant:"filled"},style:{zIndex:1,pointerEvents:"none",transform:"translate(12px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"}},{props:{variant:"filled",size:"small"},style:{transform:"translate(12px, 13px) scale(1)"}},{props:({variant:t,ownerState:n})=>t==="filled"&&n.shrink,style:{userSelect:"none",pointerEvents:"auto",transform:"translate(12px, 7px) scale(0.75)",maxWidth:"calc(133% - 24px)"}},{props:({variant:t,ownerState:n,size:r})=>t==="filled"&&n.shrink&&r==="small",style:{transform:"translate(12px, 4px) scale(0.75)"}},{props:{variant:"outlined"},style:{zIndex:1,pointerEvents:"none",transform:"translate(14px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"}},{props:{variant:"outlined",size:"small"},style:{transform:"translate(14px, 9px) scale(1)"}},{props:({variant:t,ownerState:n})=>t==="outlined"&&n.shrink,style:{userSelect:"none",pointerEvents:"auto",maxWidth:"calc(133% - 32px)",transform:"translate(14px, -9px) scale(0.75)"}}]}))),Cpe=A.forwardRef(function(e,t){const n=sn({name:"MuiInputLabel",props:e}),{disableAnimation:r=!1,margin:o,shrink:a,variant:i,className:l,...u}=n,d=uu();let p=a;typeof p>"u"&&d&&(p=d.filled||d.focused||d.adornedStart);const h=yp({props:n,muiFormControl:d,states:["size","variant","required","focused"]}),y={...n,disableAnimation:r,formControl:d,shrink:p,size:h.size,variant:h.variant,required:h.required,focused:h.focused},g=Spe(y);return v.jsx(Tpe,{"data-shrink":p,ref:t,className:Tt(g.root,l),...u,ownerState:y,classes:g})});function Ape(e){return en("MuiFormControl",e)}Wt("MuiFormControl",["root","marginNone","marginNormal","marginDense","fullWidth","disabled"]);const _pe=e=>{const{classes:t,margin:n,fullWidth:r}=e,o={root:["root",n!=="none"&&`margin${Ze(n)}`,r&&"fullWidth"]};return Jt(o,Ape,t)},kpe=Ye("div",{name:"MuiFormControl",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`margin${Ze(n.margin)}`],n.fullWidth&&t.fullWidth]}})({display:"inline-flex",flexDirection:"column",position:"relative",minWidth:0,padding:0,margin:0,border:0,verticalAlign:"top",variants:[{props:{margin:"normal"},style:{marginTop:16,marginBottom:8}},{props:{margin:"dense"},style:{marginTop:8,marginBottom:4}},{props:{fullWidth:!0},style:{width:"100%"}}]}),wpe=A.forwardRef(function(e,t){const n=sn({props:e,name:"MuiFormControl"}),{children:r,className:o,color:a="primary",component:i="div",disabled:l=!1,error:u=!1,focused:d,fullWidth:p=!1,hiddenLabel:h=!1,margin:y="none",required:g=!1,size:b="medium",variant:x="outlined",...S}=n,E={...n,color:a,component:i,disabled:l,error:u,fullWidth:p,hiddenLabel:h,margin:y,required:g,size:b,variant:x},_=_pe(E),[C,R]=A.useState(()=>{let j=!1;return r&&A.Children.forEach(r,V=>{if(!Jx(V,["Input","Select"]))return;const B=Jx(V,["Select"])?V.props.input:V;B&&Mde(B.props)&&(j=!0)}),j}),[O,I]=A.useState(()=>{let j=!1;return r&&A.Children.forEach(r,V=>{Jx(V,["Input","Select"])&&(bb(V.props,!0)||bb(V.props.inputProps,!0))&&(j=!0)}),j}),[F,H]=A.useState(!1);l&&F&&H(!1);const z=d!==void 0&&!l?d:F;let L;A.useRef(!1);const $=A.useCallback(()=>{I(!0)},[]),k=A.useCallback(()=>{I(!1)},[]),M=A.useMemo(()=>({adornedStart:C,setAdornedStart:R,color:a,disabled:l,error:u,filled:O,focused:z,fullWidth:p,hiddenLabel:h,size:b,onBlur:()=>{H(!1)},onFocus:()=>{H(!0)},onEmpty:k,onFilled:$,registerEffect:L,required:g,variant:x}),[C,a,l,u,O,z,p,h,L,k,$,g,b,x]);return v.jsx(I_.Provider,{value:M,children:v.jsx(kpe,{as:i,ownerState:E,className:Tt(_.root,o),ref:t,...S,children:r})})});function Rpe(e){return en("MuiFormHelperText",e)}const AP=Wt("MuiFormHelperText",["root","error","disabled","sizeSmall","sizeMedium","contained","focused","filled","required"]);var _P;const Dpe=e=>{const{classes:t,contained:n,size:r,disabled:o,error:a,filled:i,focused:l,required:u}=e,d={root:["root",o&&"disabled",a&&"error",r&&`size${Ze(r)}`,n&&"contained",l&&"focused",i&&"filled",u&&"required"]};return Jt(d,Rpe,t)},Ipe=Ye("p",{name:"MuiFormHelperText",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.size&&t[`size${Ze(n.size)}`],n.contained&&t.contained,n.filled&&t.filled]}})(hn(({theme:e})=>({color:(e.vars||e).palette.text.secondary,...e.typography.caption,textAlign:"left",marginTop:3,marginRight:0,marginBottom:0,marginLeft:0,[`&.${AP.disabled}`]:{color:(e.vars||e).palette.text.disabled},[`&.${AP.error}`]:{color:(e.vars||e).palette.error.main},variants:[{props:{size:"small"},style:{marginTop:4}},{props:({ownerState:t})=>t.contained,style:{marginLeft:14,marginRight:14}}]}))),Ope=A.forwardRef(function(e,t){const n=sn({props:e,name:"MuiFormHelperText"}),{children:r,className:o,component:a="p",disabled:i,error:l,filled:u,focused:d,margin:p,required:h,variant:y,...g}=n,b=uu(),x=yp({props:n,muiFormControl:b,states:["variant","size","disabled","error","filled","focused","required"]}),S={...n,component:a,contained:x.variant==="filled"||x.variant==="outlined",variant:x.variant,size:x.size,disabled:x.disabled,error:x.error,filled:x.filled,focused:x.focused,required:x.required};delete S.ownerState;const E=Dpe(S);return v.jsx(Ipe,{as:a,className:Tt(E.root,o),ref:t,...g,ownerState:S,children:r===" "?_P||(_P=v.jsx("span",{className:"notranslate","aria-hidden":!0,children:"​"})):r})}),uC=A.createContext({});function Npe(e){return en("MuiList",e)}Wt("MuiList",["root","padding","dense","subheader"]);const Ppe=e=>{const{classes:t,disablePadding:n,dense:r,subheader:o}=e;return Jt({root:["root",!n&&"padding",r&&"dense",o&&"subheader"]},Npe,t)},Lpe=Ye("ul",{name:"MuiList",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,!n.disablePadding&&t.padding,n.dense&&t.dense,n.subheader&&t.subheader]}})({listStyle:"none",margin:0,padding:0,position:"relative",variants:[{props:({ownerState:e})=>!e.disablePadding,style:{paddingTop:8,paddingBottom:8}},{props:({ownerState:e})=>e.subheader,style:{paddingTop:0}}]}),Mpe=A.forwardRef(function(e,t){const n=sn({props:e,name:"MuiList"}),{children:r,className:o,component:a="ul",dense:i=!1,disablePadding:l=!1,subheader:u,...d}=n,p=A.useMemo(()=>({dense:i}),[i]),h={...n,component:a,dense:i,disablePadding:l},y=Ppe(h);return v.jsx(uC.Provider,{value:p,children:v.jsxs(Lpe,{as:a,className:Tt(y.root,o),ref:t,ownerState:h,...d,children:[u,r]})})});function bF(e=window){const t=e.document.documentElement.clientWidth;return e.innerWidth-t}function cS(e,t,n){return e===t?e.firstChild:t&&t.nextElementSibling?t.nextElementSibling:n?null:e.firstChild}function kP(e,t,n){return e===t?n?e.firstChild:e.lastChild:t&&t.previousElementSibling?t.previousElementSibling:n?null:e.lastChild}function vF(e,t){if(t===void 0)return!0;let n=e.innerText;return n===void 0&&(n=e.textContent),n=n.trim().toLowerCase(),n.length===0?!1:t.repeating?n[0]===t.keys[0]:n.startsWith(t.keys.join(""))}function $f(e,t,n,r,o,a){let i=!1,l=o(e,t,t?n:!1);for(;l;){if(l===e.firstChild){if(i)return!1;i=!0}const u=r?!1:l.disabled||l.getAttribute("aria-disabled")==="true";if(!l.hasAttribute("tabindex")||!vF(l,a)||u)l=o(e,l,n);else return l.focus(),!0}return!1}const Fpe=A.forwardRef(function(e,t){const{actions:n,autoFocus:r=!1,autoFocusItem:o=!1,children:a,className:i,disabledItemsFocusable:l=!1,disableListWrap:u=!1,onKeyDown:d,variant:p="selectedMenu",...h}=e,y=A.useRef(null),g=A.useRef({keys:[],repeating:!0,previousKeyMatched:!0,lastTime:null});Gi(()=>{r&&y.current.focus()},[r]),A.useImperativeHandle(n,()=>({adjustStyleForScrollbar:(_,{direction:C})=>{const R=!y.current.style.width;if(_.clientHeight<y.current.clientHeight&&R){const O=`${bF(Ns(_))}px`;y.current.style[C==="rtl"?"paddingLeft":"paddingRight"]=O,y.current.style.width=`calc(100% + ${O})`}return y.current}}),[]);const b=_=>{const C=y.current,R=_.key;if(_.ctrlKey||_.metaKey||_.altKey){d&&d(_);return}const O=ao(C).activeElement;if(R==="ArrowDown")_.preventDefault(),$f(C,O,u,l,cS);else if(R==="ArrowUp")_.preventDefault(),$f(C,O,u,l,kP);else if(R==="Home")_.preventDefault(),$f(C,null,u,l,cS);else if(R==="End")_.preventDefault(),$f(C,null,u,l,kP);else if(R.length===1){const I=g.current,F=R.toLowerCase(),H=performance.now();I.keys.length>0&&(H-I.lastTime>500?(I.keys=[],I.repeating=!0,I.previousKeyMatched=!0):I.repeating&&F!==I.keys[0]&&(I.repeating=!1)),I.lastTime=H,I.keys.push(F);const z=O&&!I.repeating&&vF(O,I);I.previousKeyMatched&&(z||$f(C,O,!1,l,cS,I))?_.preventDefault():I.previousKeyMatched=!1}d&&d(_)},x=sr(y,t);let S=-1;A.Children.forEach(a,(_,C)=>{if(!A.isValidElement(_)){S===C&&(S+=1,S>=a.length&&(S=-1));return}_.props.disabled||(p==="selectedMenu"&&_.props.selected||S===-1)&&(S=C),S===C&&(_.props.disabled||_.props.muiSkipListHighlight||_.type.muiSkipListHighlight)&&(S+=1,S>=a.length&&(S=-1))});const E=A.Children.map(a,(_,C)=>{if(C===S){const R={};return o&&(R.autoFocus=!0),_.props.tabIndex===void 0&&p==="selectedMenu"&&(R.tabIndex=0),A.cloneElement(_,R)}return _});return v.jsx(Mpe,{role:"menu",ref:x,className:i,onKeyDown:b,tabIndex:r?0:-1,...h,children:E})}),EF=e=>e.scrollTop;function Xd(e,t){const{timeout:n,easing:r,style:o={}}=e;return{duration:o.transitionDuration??(typeof n=="number"?n:n[t.mode]||0),easing:o.transitionTimingFunction??(typeof r=="object"?r[t.mode]:r),delay:o.transitionDelay}}function dC(e){return`scale(${e}, ${e**2})`}const jpe={entering:{opacity:1,transform:dC(1)},entered:{opacity:1,transform:"none"}},uS=typeof navigator<"u"&&/^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent)&&/(os |version\/)15(.|_)4/i.test(navigator.userAgent),vb=A.forwardRef(function(e,t){const{addEndListener:n,appear:r=!0,children:o,easing:a,in:i,onEnter:l,onEntered:u,onEntering:d,onExit:p,onExited:h,onExiting:y,style:g,timeout:b="auto",TransitionComponent:x=hi,...S}=e,E=Uv(),_=A.useRef(),C=dp(),R=A.useRef(null),O=sr(R,mp(o),t),I=M=>j=>{if(M){const V=R.current;j===void 0?M(V):M(V,j)}},F=I(d),H=I((M,j)=>{EF(M);const{duration:V,delay:B,easing:q}=Xd({style:g,timeout:b,easing:a},{mode:"enter"});let Y;b==="auto"?(Y=C.transitions.getAutoHeightDuration(M.clientHeight),_.current=Y):Y=V,M.style.transition=[C.transitions.create("opacity",{duration:Y,delay:B}),C.transitions.create("transform",{duration:uS?Y:Y*.666,delay:B,easing:q})].join(","),l&&l(M,j)}),z=I(u),L=I(y),$=I(M=>{const{duration:j,delay:V,easing:B}=Xd({style:g,timeout:b,easing:a},{mode:"exit"});let q;b==="auto"?(q=C.transitions.getAutoHeightDuration(M.clientHeight),_.current=q):q=j,M.style.transition=[C.transitions.create("opacity",{duration:q,delay:V}),C.transitions.create("transform",{duration:uS?q:q*.666,delay:uS?V:V||q*.333,easing:B})].join(","),M.style.opacity=0,M.style.transform=dC(.75),p&&p(M)}),k=I(h);return v.jsx(x,{appear:r,in:i,nodeRef:R,onEnter:H,onEntered:z,onEntering:F,onExit:$,onExited:k,onExiting:L,addEndListener:M=>{b==="auto"&&E.start(_.current||0,M),n&&n(R.current,M)},timeout:b==="auto"?null:b,...S,children:(M,{ownerState:j,...V})=>A.cloneElement(o,{style:{opacity:0,transform:dC(.75),visibility:M==="exited"&&!i?"hidden":void 0,...jpe[M],...g,...o.props.style},ref:O,...V})})});vb&&(vb.muiSupportAuto=!0);function Bpe(e){const t=ao(e);return t.body===e?Ns(e).innerWidth>t.documentElement.clientWidth:e.scrollHeight>e.clientHeight}function _h(e,t){t?e.setAttribute("aria-hidden","true"):e.removeAttribute("aria-hidden")}function wP(e){return parseInt(Ns(e).getComputedStyle(e).paddingRight,10)||0}function Upe(e){const t=["TEMPLATE","SCRIPT","STYLE","LINK","MAP","META","NOSCRIPT","PICTURE","COL","COLGROUP","PARAM","SLOT","SOURCE","TRACK"].includes(e.tagName),n=e.tagName==="INPUT"&&e.getAttribute("type")==="hidden";return t||n}function RP(e,t,n,r,o){const a=[t,n,...r];[].forEach.call(e.children,i=>{const l=!a.includes(i),u=!Upe(i);l&&u&&_h(i,o)})}function dS(e,t){let n=-1;return e.some((r,o)=>t(r)?(n=o,!0):!1),n}function zpe(e,t){const n=[],r=e.container;if(!t.disableScrollLock){if(Bpe(r)){const a=bF(Ns(r));n.push({value:r.style.paddingRight,property:"padding-right",el:r}),r.style.paddingRight=`${wP(r)+a}px`;const i=ao(r).querySelectorAll(".mui-fixed");[].forEach.call(i,l=>{n.push({value:l.style.paddingRight,property:"padding-right",el:l}),l.style.paddingRight=`${wP(l)+a}px`})}let o;if(r.parentNode instanceof DocumentFragment)o=ao(r).body;else{const a=r.parentElement,i=Ns(r);o=a?.nodeName==="HTML"&&i.getComputedStyle(a).overflowY==="scroll"?a:r}n.push({value:o.style.overflow,property:"overflow",el:o},{value:o.style.overflowX,property:"overflow-x",el:o},{value:o.style.overflowY,property:"overflow-y",el:o}),o.style.overflow="hidden"}return()=>{n.forEach(({value:o,el:a,property:i})=>{o?a.style.setProperty(i,o):a.style.removeProperty(i)})}}function $pe(e){const t=[];return[].forEach.call(e.children,n=>{n.getAttribute("aria-hidden")==="true"&&t.push(n)}),t}class Hpe{constructor(){this.modals=[],this.containers=[]}add(t,n){let r=this.modals.indexOf(t);if(r!==-1)return r;r=this.modals.length,this.modals.push(t),t.modalRef&&_h(t.modalRef,!1);const o=$pe(n);RP(n,t.mount,t.modalRef,o,!0);const a=dS(this.containers,i=>i.container===n);return a!==-1?(this.containers[a].modals.push(t),r):(this.containers.push({modals:[t],container:n,restore:null,hiddenSiblings:o}),r)}mount(t,n){const r=dS(this.containers,a=>a.modals.includes(t)),o=this.containers[r];o.restore||(o.restore=zpe(o,n))}remove(t,n=!0){const r=this.modals.indexOf(t);if(r===-1)return r;const o=dS(this.containers,i=>i.modals.includes(t)),a=this.containers[o];if(a.modals.splice(a.modals.indexOf(t),1),this.modals.splice(r,1),a.modals.length===0)a.restore&&a.restore(),t.modalRef&&_h(t.modalRef,n),RP(a.container,t.mount,t.modalRef,a.hiddenSiblings,!1),this.containers.splice(o,1);else{const i=a.modals[a.modals.length-1];i.modalRef&&_h(i.modalRef,!1)}return r}isTopModal(t){return this.modals.length>0&&this.modals[this.modals.length-1]===t}}const Vpe=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'].join(",");function Gpe(e){const t=parseInt(e.getAttribute("tabindex")||"",10);return Number.isNaN(t)?e.contentEditable==="true"||(e.nodeName==="AUDIO"||e.nodeName==="VIDEO"||e.nodeName==="DETAILS")&&e.getAttribute("tabindex")===null?0:e.tabIndex:t}function qpe(e){if(e.tagName!=="INPUT"||e.type!=="radio"||!e.name)return!1;const t=r=>e.ownerDocument.querySelector(`input[type="radio"]${r}`);let n=t(`[name="${e.name}"]:checked`);return n||(n=t(`[name="${e.name}"]`)),n!==e}function Wpe(e){return!(e.disabled||e.tagName==="INPUT"&&e.type==="hidden"||qpe(e))}function Ype(e){const t=[],n=[];return Array.from(e.querySelectorAll(Vpe)).forEach((r,o)=>{const a=Gpe(r);a===-1||!Wpe(r)||(a===0?t.push(r):n.push({documentOrder:o,tabIndex:a,node:r}))}),n.sort((r,o)=>r.tabIndex===o.tabIndex?r.documentOrder-o.documentOrder:r.tabIndex-o.tabIndex).map(r=>r.node).concat(t)}function Kpe(){return!0}function Qpe(e){const{children:t,disableAutoFocus:n=!1,disableEnforceFocus:r=!1,disableRestoreFocus:o=!1,getTabbable:a=Ype,isEnabled:i=Kpe,open:l}=e,u=A.useRef(!1),d=A.useRef(null),p=A.useRef(null),h=A.useRef(null),y=A.useRef(null),g=A.useRef(!1),b=A.useRef(null),x=sr(mp(t),b),S=A.useRef(null);A.useEffect(()=>{!l||!b.current||(g.current=!n)},[n,l]),A.useEffect(()=>{if(!l||!b.current)return;const C=ao(b.current);return b.current.contains(C.activeElement)||(b.current.hasAttribute("tabIndex")||b.current.setAttribute("tabIndex","-1"),g.current&&b.current.focus()),()=>{o||(h.current&&h.current.focus&&(u.current=!0,h.current.focus()),h.current=null)}},[l]),A.useEffect(()=>{if(!l||!b.current)return;const C=ao(b.current),R=F=>{S.current=F,!(r||!i()||F.key!=="Tab")&&C.activeElement===b.current&&F.shiftKey&&(u.current=!0,p.current&&p.current.focus())},O=()=>{const F=b.current;if(F===null)return;if(!C.hasFocus()||!i()||u.current){u.current=!1;return}if(F.contains(C.activeElement)||r&&C.activeElement!==d.current&&C.activeElement!==p.current)return;if(C.activeElement!==y.current)y.current=null;else if(y.current!==null)return;if(!g.current)return;let H=[];if((C.activeElement===d.current||C.activeElement===p.current)&&(H=a(b.current)),H.length>0){const z=!!(S.current?.shiftKey&&S.current?.key==="Tab"),L=H[0],$=H[H.length-1];typeof L!="string"&&typeof $!="string"&&(z?$.focus():L.focus())}else F.focus()};C.addEventListener("focusin",O),C.addEventListener("keydown",R,!0);const I=setInterval(()=>{C.activeElement&&C.activeElement.tagName==="BODY"&&O()},50);return()=>{clearInterval(I),C.removeEventListener("focusin",O),C.removeEventListener("keydown",R,!0)}},[n,r,o,i,l,a]);const E=C=>{h.current===null&&(h.current=C.relatedTarget),g.current=!0,y.current=C.target;const R=t.props.onFocus;R&&R(C)},_=C=>{h.current===null&&(h.current=C.relatedTarget),g.current=!0};return v.jsxs(A.Fragment,{children:[v.jsx("div",{tabIndex:l?0:-1,onFocus:_,ref:d,"data-testid":"sentinelStart"}),A.cloneElement(t,{ref:x,onFocus:E}),v.jsx("div",{tabIndex:l?0:-1,onFocus:_,ref:p,"data-testid":"sentinelEnd"})]})}const Xpe={entering:{opacity:1},entered:{opacity:1}},pC=A.forwardRef(function(e,t){const n=dp(),r={enter:n.transitions.duration.enteringScreen,exit:n.transitions.duration.leavingScreen},{addEndListener:o,appear:a=!0,children:i,easing:l,in:u,onEnter:d,onEntered:p,onEntering:h,onExit:y,onExited:g,onExiting:b,style:x,timeout:S=r,TransitionComponent:E=hi,..._}=e,C=A.useRef(null),R=sr(C,mp(i),t),O=k=>M=>{if(k){const j=C.current;M===void 0?k(j):k(j,M)}},I=O(h),F=O((k,M)=>{EF(k);const j=Xd({style:x,timeout:S,easing:l},{mode:"enter"});k.style.webkitTransition=n.transitions.create("opacity",j),k.style.transition=n.transitions.create("opacity",j),d&&d(k,M)}),H=O(p),z=O(b),L=O(k=>{const M=Xd({style:x,timeout:S,easing:l},{mode:"exit"});k.style.webkitTransition=n.transitions.create("opacity",M),k.style.transition=n.transitions.create("opacity",M),y&&y(k)}),$=O(g);return v.jsx(E,{appear:a,in:u,nodeRef:C,onEnter:F,onEntered:H,onEntering:I,onExit:L,onExited:$,onExiting:z,addEndListener:k=>{o&&o(C.current,k)},timeout:S,..._,children:(k,{ownerState:M,...j})=>A.cloneElement(i,{style:{opacity:0,visibility:k==="exited"&&!u?"hidden":void 0,...Xpe[k],...x,...i.props.style},ref:R,...j})})});function Zpe(e){return en("MuiBackdrop",e)}Wt("MuiBackdrop",["root","invisible"]);const Jpe=e=>{const{classes:t,invisible:n}=e;return Jt({root:["root",n&&"invisible"]},Zpe,t)},efe=Ye("div",{name:"MuiBackdrop",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.invisible&&t.invisible]}})({position:"fixed",display:"flex",alignItems:"center",justifyContent:"center",right:0,bottom:0,top:0,left:0,backgroundColor:"rgba(0, 0, 0, 0.5)",WebkitTapHighlightColor:"transparent",variants:[{props:{invisible:!0},style:{backgroundColor:"transparent"}}]}),xF=A.forwardRef(function(e,t){const n=sn({props:e,name:"MuiBackdrop"}),{children:r,className:o,component:a="div",invisible:i=!1,open:l,components:u={},componentsProps:d={},slotProps:p={},slots:h={},TransitionComponent:y,transitionDuration:g,...b}=n,x={...n,component:a,invisible:i},S=Jpe(x),E={transition:y,root:u.Root,...h},_={...d,...p},C={component:a,slots:E,slotProps:_},[R,O]=xn("root",{elementType:efe,externalForwardedProps:C,className:Tt(S.root,o),ownerState:x}),[I,F]=xn("transition",{elementType:pC,externalForwardedProps:C,ownerState:x});return v.jsx(I,{in:l,timeout:g,...b,...F,children:v.jsx(R,{"aria-hidden":!0,...O,classes:S,ref:t,children:r})})});function tfe(e){return typeof e=="function"?e():e}function nfe(e){return e?e.props.hasOwnProperty("in"):!1}const DP=()=>{},Ly=new Hpe;function rfe(e){const{container:t,disableEscapeKeyDown:n=!1,disableScrollLock:r=!1,closeAfterTransition:o=!1,onTransitionEnter:a,onTransitionExited:i,children:l,onClose:u,open:d,rootRef:p}=e,h=A.useRef({}),y=A.useRef(null),g=A.useRef(null),b=sr(g,p),[x,S]=A.useState(!d),E=nfe(l);let _=!0;(e["aria-hidden"]==="false"||e["aria-hidden"]===!1)&&(_=!1);const C=()=>ao(y.current),R=()=>(h.current.modalRef=g.current,h.current.mount=y.current,h.current),O=()=>{Ly.mount(R(),{disableScrollLock:r}),g.current&&(g.current.scrollTop=0)},I=Fr(()=>{const k=tfe(t)||C().body;Ly.add(R(),k),g.current&&O()}),F=()=>Ly.isTopModal(R()),H=Fr(k=>{y.current=k,k&&(d&&F()?O():g.current&&_h(g.current,_))}),z=A.useCallback(()=>{Ly.remove(R(),_)},[_]);A.useEffect(()=>()=>{z()},[z]),A.useEffect(()=>{d?I():(!E||!o)&&z()},[d,z,E,o,I]);const L=k=>M=>{k.onKeyDown?.(M),!(M.key!=="Escape"||M.which===229||!F())&&(n||(M.stopPropagation(),u&&u(M,"escapeKeyDown")))},$=k=>M=>{k.onClick?.(M),M.target===M.currentTarget&&u&&u(M,"backdropClick")};return{getRootProps:(k={})=>{const M=To(e);delete M.onTransitionEnter,delete M.onTransitionExited;const j={...M,...k};return{role:"presentation",...j,onKeyDown:L(j),ref:b}},getBackdropProps:(k={})=>{const M=k;return{"aria-hidden":!0,...M,onClick:$(M),open:d}},getTransitionProps:()=>{const k=()=>{S(!1),a&&a()},M=()=>{S(!0),i&&i(),o&&z()};return{onEnter:aN(k,l?.props.onEnter??DP),onExited:aN(M,l?.props.onExited??DP)}},rootRef:b,portalRef:H,isTopModal:F,exited:x,hasTransition:E}}function ofe(e){return en("MuiModal",e)}Wt("MuiModal",["root","hidden","backdrop"]);const afe=e=>{const{open:t,exited:n,classes:r}=e;return Jt({root:["root",!t&&n&&"hidden"],backdrop:["backdrop"]},ofe,r)},ife=Ye("div",{name:"MuiModal",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,!n.open&&n.exited&&t.hidden]}})(hn(({theme:e})=>({position:"fixed",zIndex:(e.vars||e).zIndex.modal,right:0,bottom:0,top:0,left:0,variants:[{props:({ownerState:t})=>!t.open&&t.exited,style:{visibility:"hidden"}}]}))),sfe=Ye(xF,{name:"MuiModal",slot:"Backdrop"})({zIndex:-1}),SF=A.forwardRef(function(e,t){const n=sn({name:"MuiModal",props:e}),{BackdropComponent:r=sfe,BackdropProps:o,classes:a,className:i,closeAfterTransition:l=!1,children:u,container:d,component:p,components:h={},componentsProps:y={},disableAutoFocus:g=!1,disableEnforceFocus:b=!1,disableEscapeKeyDown:x=!1,disablePortal:S=!1,disableRestoreFocus:E=!1,disableScrollLock:_=!1,hideBackdrop:C=!1,keepMounted:R=!1,onClose:O,onTransitionEnter:I,onTransitionExited:F,open:H,slotProps:z={},slots:L={},theme:$,...k}=n,M={...n,closeAfterTransition:l,disableAutoFocus:g,disableEnforceFocus:b,disableEscapeKeyDown:x,disablePortal:S,disableRestoreFocus:E,disableScrollLock:_,hideBackdrop:C,keepMounted:R},{getRootProps:j,getBackdropProps:V,getTransitionProps:B,portalRef:q,isTopModal:Y,exited:ee,hasTransition:N}=rfe({...M,rootRef:t}),W={...M,exited:ee},K=afe(W),P={};if(u.props.tabIndex===void 0&&(P.tabIndex="-1"),N){const{onEnter:Ee,onExited:Te}=B();P.onEnter=Ee,P.onExited=Te}const Z={slots:{root:h.Root,backdrop:h.Backdrop,...L},slotProps:{...y,...z}},[ae,J]=xn("root",{ref:t,elementType:ife,externalForwardedProps:{...Z,...k,component:p},getSlotProps:j,ownerState:W,className:Tt(i,K?.root,!W.open&&W.exited&&K?.hidden)}),[pe,le]=xn("backdrop",{ref:o?.ref,elementType:r,externalForwardedProps:Z,shouldForwardComponentProp:!0,additionalProps:o,getSlotProps:Ee=>V({...Ee,onClick:Te=>{Ee?.onClick&&Ee.onClick(Te)}}),className:Tt(o?.className,K?.backdrop),ownerState:W});return!R&&!H&&(!N||ee)?null:v.jsx(pF,{ref:q,container:d,disablePortal:S,children:v.jsxs(ae,{...J,children:[!C&&r?v.jsx(pe,{...le}):null,v.jsx(Qpe,{disableEnforceFocus:b,disableAutoFocus:g,disableRestoreFocus:E,isEnabled:Y,open:H,children:A.cloneElement(u,P)})]})})});function lfe(e){return en("MuiPopover",e)}Wt("MuiPopover",["root","paper"]);function IP(e,t){let n=0;return typeof t=="number"?n=t:t==="center"?n=e.height/2:t==="bottom"&&(n=e.height),n}function OP(e,t){let n=0;return typeof t=="number"?n=t:t==="center"?n=e.width/2:t==="right"&&(n=e.width),n}function NP(e){return[e.horizontal,e.vertical].map(t=>typeof t=="number"?`${t}px`:t).join(" ")}function My(e){return typeof e=="function"?e():e}const cfe=e=>{const{classes:t}=e;return Jt({root:["root"],paper:["paper"]},lfe,t)},ufe=Ye(SF,{name:"MuiPopover",slot:"Root"})({}),TF=Ye(gp,{name:"MuiPopover",slot:"Paper"})({position:"absolute",overflowY:"auto",overflowX:"hidden",minWidth:16,minHeight:16,maxWidth:"calc(100% - 32px)",maxHeight:"calc(100% - 32px)",outline:0}),dfe=A.forwardRef(function(e,t){const n=sn({props:e,name:"MuiPopover"}),{action:r,anchorEl:o,anchorOrigin:a={vertical:"top",horizontal:"left"},anchorPosition:i,anchorReference:l="anchorEl",children:u,className:d,container:p,elevation:h=8,marginThreshold:y=16,open:g,PaperProps:b={},slots:x={},slotProps:S={},transformOrigin:E={vertical:"top",horizontal:"left"},TransitionComponent:_,transitionDuration:C="auto",TransitionProps:R={},disableScrollLock:O=!1,...I}=n,F=A.useRef(),H={...n,anchorOrigin:a,anchorReference:l,elevation:h,marginThreshold:y,transformOrigin:E,TransitionComponent:_,transitionDuration:C,TransitionProps:R},z=cfe(H),L=A.useCallback(()=>{if(l==="anchorPosition")return i;const Ee=My(o),Te=(Ee&&Ee.nodeType===1?Ee:ao(F.current).body).getBoundingClientRect();return{top:Te.top+IP(Te,a.vertical),left:Te.left+OP(Te,a.horizontal)}},[o,a.horizontal,a.vertical,i,l]),$=A.useCallback(Ee=>({vertical:IP(Ee,E.vertical),horizontal:OP(Ee,E.horizontal)}),[E.horizontal,E.vertical]),k=A.useCallback(Ee=>{const Te={width:Ee.offsetWidth,height:Ee.offsetHeight},Ae=$(Te);if(l==="none")return{top:null,left:null,transformOrigin:NP(Ae)};const Ue=L();let Re=Ue.top-Ae.vertical,ve=Ue.left-Ae.horizontal;const pt=Re+Te.height,ut=ve+Te.width,ze=Ns(My(o)),$e=ze.innerHeight-y,dt=ze.innerWidth-y;if(y!==null&&Re<y){const Be=Re-y;Re-=Be,Ae.vertical+=Be}else if(y!==null&&pt>$e){const Be=pt-$e;Re-=Be,Ae.vertical+=Be}if(y!==null&&ve<y){const Be=ve-y;ve-=Be,Ae.horizontal+=Be}else if(ut>dt){const Be=ut-dt;ve-=Be,Ae.horizontal+=Be}return{top:`${Math.round(Re)}px`,left:`${Math.round(ve)}px`,transformOrigin:NP(Ae)}},[o,l,L,$,y]),[M,j]=A.useState(g),V=A.useCallback(()=>{const Ee=F.current;if(!Ee)return;const Te=k(Ee);Te.top!==null&&Ee.style.setProperty("top",Te.top),Te.left!==null&&(Ee.style.left=Te.left),Ee.style.transformOrigin=Te.transformOrigin,j(!0)},[k]);A.useEffect(()=>(O&&window.addEventListener("scroll",V),()=>window.removeEventListener("scroll",V)),[o,O,V]);const B=()=>{V()},q=()=>{j(!1)};A.useEffect(()=>{g&&V()}),A.useImperativeHandle(r,()=>g?{updatePosition:()=>{V()}}:null,[g,V]),A.useEffect(()=>{if(!g)return;const Ee=c6(()=>{V()}),Te=Ns(My(o));return Te.addEventListener("resize",Ee),()=>{Ee.clear(),Te.removeEventListener("resize",Ee)}},[o,g,V]);let Y=C;const ee={slots:{transition:_,...x},slotProps:{transition:R,paper:b,...S}},[N,W]=xn("transition",{elementType:vb,externalForwardedProps:ee,ownerState:H,getSlotProps:Ee=>({...Ee,onEntering:(Te,Ae)=>{Ee.onEntering?.(Te,Ae),B()},onExited:Te=>{Ee.onExited?.(Te),q()}}),additionalProps:{appear:!0,in:g}});C==="auto"&&!N.muiSupportAuto&&(Y=void 0);const K=p||(o?ao(My(o)).body:void 0),[P,{slots:Z,slotProps:ae,...J}]=xn("root",{ref:t,elementType:ufe,externalForwardedProps:{...ee,...I},shouldForwardComponentProp:!0,additionalProps:{slots:{backdrop:x.backdrop},slotProps:{backdrop:u6(typeof S.backdrop=="function"?S.backdrop(H):S.backdrop,{invisible:!0})},container:K,open:g},ownerState:H,className:Tt(z.root,d)}),[pe,le]=xn("paper",{ref:F,className:z.paper,elementType:TF,externalForwardedProps:ee,shouldForwardComponentProp:!0,additionalProps:{elevation:h,style:M?void 0:{opacity:0}},ownerState:H});return v.jsx(P,{...J,...!mb(P)&&{slots:Z,slotProps:ae,disableScrollLock:O},children:v.jsx(N,{...W,timeout:Y,children:v.jsx(pe,{...le,children:u})})})});function pfe(e){return en("MuiMenu",e)}Wt("MuiMenu",["root","paper","list"]);const ffe={vertical:"top",horizontal:"right"},hfe={vertical:"top",horizontal:"left"},mfe=e=>{const{classes:t}=e;return Jt({root:["root"],paper:["paper"],list:["list"]},pfe,t)},gfe=Ye(dfe,{shouldForwardProp:e=>Do(e)||e==="classes",name:"MuiMenu",slot:"Root"})({}),yfe=Ye(TF,{name:"MuiMenu",slot:"Paper"})({maxHeight:"calc(100% - 96px)",WebkitOverflowScrolling:"touch"}),bfe=Ye(Fpe,{name:"MuiMenu",slot:"List"})({outline:0}),vfe=A.forwardRef(function(e,t){const n=sn({props:e,name:"MuiMenu"}),{autoFocus:r=!0,children:o,className:a,disableAutoFocusItem:i=!1,MenuListProps:l={},onClose:u,open:d,PaperProps:p={},PopoverClasses:h,transitionDuration:y="auto",TransitionProps:{onEntering:g,...b}={},variant:x="selectedMenu",slots:S={},slotProps:E={},..._}=n,C=l_(),R={...n,autoFocus:r,disableAutoFocusItem:i,MenuListProps:l,onEntering:g,PaperProps:p,transitionDuration:y,TransitionProps:b,variant:x},O=mfe(R),I=r&&!i&&d,F=A.useRef(null),H=(Y,ee)=>{F.current&&F.current.adjustStyleForScrollbar(Y,{direction:C?"rtl":"ltr"}),g&&g(Y,ee)},z=Y=>{Y.key==="Tab"&&(Y.preventDefault(),u&&u(Y,"tabKeyDown"))};let L=-1;A.Children.map(o,(Y,ee)=>{A.isValidElement(Y)&&(Y.props.disabled||(x==="selectedMenu"&&Y.props.selected||L===-1)&&(L=ee))});const $={slots:S,slotProps:{list:l,transition:b,paper:p,...E}},k=Cs({elementType:S.root,externalSlotProps:E.root,ownerState:R,className:[O.root,a]}),[M,j]=xn("paper",{className:O.paper,elementType:yfe,externalForwardedProps:$,shouldForwardComponentProp:!0,ownerState:R}),[V,B]=xn("list",{className:Tt(O.list,l.className),elementType:bfe,shouldForwardComponentProp:!0,externalForwardedProps:$,getSlotProps:Y=>({...Y,onKeyDown:ee=>{z(ee),Y.onKeyDown?.(ee)}}),ownerState:R}),q=typeof $.slotProps.transition=="function"?$.slotProps.transition(R):$.slotProps.transition;return v.jsx(gfe,{onClose:u,anchorOrigin:{vertical:"bottom",horizontal:C?"right":"left"},transformOrigin:C?ffe:hfe,slots:{root:S.root,paper:M,backdrop:S.backdrop,...S.transition&&{transition:S.transition}},slotProps:{root:k,paper:j,backdrop:typeof E.backdrop=="function"?E.backdrop(R):E.backdrop,transition:{...q,onEntering:(...Y)=>{H(...Y),q?.onEntering?.(...Y)}}},open:d,ref:t,transitionDuration:y,ownerState:R,..._,classes:h,children:v.jsx(V,{actions:F,autoFocus:r&&(L===-1||i),autoFocusItem:I,variant:x,...B,children:o})})});function Efe(e){return en("MuiNativeSelect",e)}const M_=Wt("MuiNativeSelect",["root","select","multiple","filled","outlined","standard","disabled","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]),xfe=e=>{const{classes:t,variant:n,disabled:r,multiple:o,open:a,error:i}=e,l={select:["select",n,r&&"disabled",o&&"multiple",i&&"error"],icon:["icon",`icon${Ze(n)}`,a&&"iconOpen",r&&"disabled"]};return Jt(l,Efe,t)},CF=Ye("select",{name:"MuiNativeSelect"})(({theme:e})=>({MozAppearance:"none",WebkitAppearance:"none",userSelect:"none",borderRadius:0,cursor:"pointer","&:focus":{borderRadius:0},[`&.${M_.disabled}`]:{cursor:"default"},"&[multiple]":{height:"auto"},"&:not([multiple]) option, &:not([multiple]) optgroup":{backgroundColor:(e.vars||e).palette.background.paper},variants:[{props:({ownerState:t})=>t.variant!=="filled"&&t.variant!=="outlined",style:{"&&&":{paddingRight:24,minWidth:16}}},{props:{variant:"filled"},style:{"&&&":{paddingRight:32}}},{props:{variant:"outlined"},style:{borderRadius:(e.vars||e).shape.borderRadius,"&:focus":{borderRadius:(e.vars||e).shape.borderRadius},"&&&":{paddingRight:32}}}]})),Sfe=Ye(CF,{name:"MuiNativeSelect",slot:"Select",shouldForwardProp:Do,overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.select,t[n.variant],n.error&&t.error,{[`&.${M_.multiple}`]:t.multiple}]}})({}),AF=Ye("svg",{name:"MuiNativeSelect"})(({theme:e})=>({position:"absolute",right:0,top:"calc(50% - .5em)",pointerEvents:"none",color:(e.vars||e).palette.action.active,[`&.${M_.disabled}`]:{color:(e.vars||e).palette.action.disabled},variants:[{props:({ownerState:t})=>t.open,style:{transform:"rotate(180deg)"}},{props:{variant:"filled"},style:{right:7}},{props:{variant:"outlined"},style:{right:7}}]})),Tfe=Ye(AF,{name:"MuiNativeSelect",slot:"Icon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.icon,n.variant&&t[`icon${Ze(n.variant)}`],n.open&&t.iconOpen]}})({}),Cfe=A.forwardRef(function(e,t){const{className:n,disabled:r,error:o,IconComponent:a,inputRef:i,variant:l="standard",...u}=e,d={...e,disabled:r,variant:l,error:o},p=xfe(d);return v.jsxs(A.Fragment,{children:[v.jsx(Sfe,{ownerState:d,className:Tt(p.select,n),disabled:r,ref:i||t,...u}),e.multiple?null:v.jsx(Tfe,{as:a,ownerState:d,className:p.icon})]})});function _F(e){return en("MuiSelect",e)}const Hf=Wt("MuiSelect",["root","select","multiple","filled","outlined","standard","disabled","focused","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]);var PP;const Afe=Ye(CF,{name:"MuiSelect",slot:"Select",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`&.${Hf.select}`]:t.select},{[`&.${Hf.select}`]:t[n.variant]},{[`&.${Hf.error}`]:t.error},{[`&.${Hf.multiple}`]:t.multiple}]}})({[`&.${Hf.select}`]:{height:"auto",minHeight:"1.4375em",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}}),_fe=Ye(AF,{name:"MuiSelect",slot:"Icon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.icon,n.variant&&t[`icon${Ze(n.variant)}`],n.open&&t.iconOpen]}})({}),kfe=Ye("input",{shouldForwardProp:e=>l6(e)&&e!=="classes",name:"MuiSelect",slot:"NativeInput"})({bottom:0,left:0,position:"absolute",opacity:0,pointerEvents:"none",width:"100%",boxSizing:"border-box"});function LP(e,t){return typeof t=="object"&&t!==null?e===t:String(e)===String(t)}function wfe(e){return e==null||typeof e=="string"&&!e.trim()}const Rfe=e=>{const{classes:t,variant:n,disabled:r,multiple:o,open:a,error:i}=e,l={select:["select",n,r&&"disabled",o&&"multiple",i&&"error"],icon:["icon",`icon${Ze(n)}`,a&&"iconOpen",r&&"disabled"],nativeInput:["nativeInput"]};return Jt(l,_F,t)},Dfe=A.forwardRef(function(e,t){const{"aria-describedby":n,"aria-label":r,autoFocus:o,autoWidth:a,children:i,className:l,defaultOpen:u,defaultValue:d,disabled:p,displayEmpty:h,error:y=!1,IconComponent:g,inputRef:b,labelId:x,MenuProps:S={},multiple:E,name:_,onBlur:C,onChange:R,onClose:O,onFocus:I,onOpen:F,open:H,readOnly:z,renderValue:L,required:$,SelectDisplayProps:k={},tabIndex:M,type:j,value:V,variant:B="standard",...q}=e,[Y,ee]=kd({controlled:V,default:d,name:"Select"}),[N,W]=kd({controlled:H,default:u,name:"Select"}),K=A.useRef(null),P=A.useRef(null),[Z,ae]=A.useState(null),{current:J}=A.useRef(H!=null),[pe,le]=A.useState(),Ee=sr(t,b),Te=A.useCallback(nt=>{P.current=nt,nt&&ae(nt)},[]),Ae=Z?.parentNode;A.useImperativeHandle(Ee,()=>({focus:()=>{P.current.focus()},node:K.current,value:Y}),[Y]),A.useEffect(()=>{u&&N&&Z&&!J&&(le(a?null:Ae.clientWidth),P.current.focus())},[Z,a]),A.useEffect(()=>{o&&P.current.focus()},[o]),A.useEffect(()=>{if(!x)return;const nt=ao(P.current).getElementById(x);if(nt){const se=()=>{getSelection().isCollapsed&&P.current.focus()};return nt.addEventListener("click",se),()=>{nt.removeEventListener("click",se)}}},[x]);const Ue=(nt,se)=>{nt?F&&F(se):O&&O(se),J||(le(a?null:Ae.clientWidth),W(nt))},Re=nt=>{nt.button===0&&(nt.preventDefault(),P.current.focus(),Ue(!0,nt))},ve=nt=>{Ue(!1,nt)},pt=A.Children.toArray(i),ut=nt=>{const se=pt.find(he=>he.props.value===nt.target.value);se!==void 0&&(ee(se.props.value),R&&R(nt,se))},ze=nt=>se=>{let he;if(se.currentTarget.hasAttribute("tabindex")){if(E){he=Array.isArray(Y)?Y.slice():[];const at=Y.indexOf(nt.props.value);at===-1?he.push(nt.props.value):he.splice(at,1)}else he=nt.props.value;if(nt.props.onClick&&nt.props.onClick(se),Y!==he&&(ee(he),R)){const at=se.nativeEvent||se,ft=new at.constructor(at.type,at);Object.defineProperty(ft,"target",{writable:!0,value:{value:he,name:_}}),R(ft,nt)}E||Ue(!1,se)}},$e=nt=>{z||[" ","ArrowUp","ArrowDown","Enter"].includes(nt.key)&&(nt.preventDefault(),Ue(!0,nt))},dt=Z!==null&&N,Be=nt=>{!dt&&C&&(Object.defineProperty(nt,"target",{writable:!0,value:{value:Y,name:_}}),C(nt))};delete q["aria-invalid"];let Fe,Me;const At=[];let Dt=!1;(bb({value:Y})||h)&&(L?Fe=L(Y):Dt=!0);const gt=pt.map(nt=>{if(!A.isValidElement(nt))return null;let se;if(E){if(!Array.isArray(Y))throw new Error(Is(2));se=Y.some(he=>LP(he,nt.props.value)),se&&Dt&&At.push(nt.props.children)}else se=LP(Y,nt.props.value),se&&Dt&&(Me=nt.props.children);return A.cloneElement(nt,{"aria-selected":se?"true":"false",onClick:ze(nt),onKeyUp:he=>{he.key===" "&&he.preventDefault(),nt.props.onKeyUp&&nt.props.onKeyUp(he)},role:"option",selected:se,value:void 0,"data-value":nt.props.value})});Dt&&(E?At.length===0?Fe=null:Fe=At.reduce((nt,se,he)=>(nt.push(se),he<At.length-1&&nt.push(", "),nt),[]):Fe=Me);let ue=pe;!a&&J&&Z&&(ue=Ae.clientWidth);let ge;typeof M<"u"?ge=M:ge=p?null:0;const He=k.id||(_?`mui-component-select-${_}`:void 0),rt={...e,variant:B,value:Y,open:dt,error:y},tt=Rfe(rt),qe={...S.PaperProps,...typeof S.slotProps?.paper=="function"?S.slotProps.paper(rt):S.slotProps?.paper},Ut={...S.MenuListProps,...typeof S.slotProps?.list=="function"?S.slotProps.list(rt):S.slotProps?.list},Gt=up();return v.jsxs(A.Fragment,{children:[v.jsx(Afe,{as:"div",ref:Te,tabIndex:ge,role:"combobox","aria-controls":dt?Gt:void 0,"aria-disabled":p?"true":void 0,"aria-expanded":dt?"true":"false","aria-haspopup":"listbox","aria-label":r,"aria-labelledby":[x,He].filter(Boolean).join(" ")||void 0,"aria-describedby":n,"aria-required":$?"true":void 0,"aria-invalid":y?"true":void 0,onKeyDown:$e,onMouseDown:p||z?null:Re,onBlur:Be,onFocus:I,...k,ownerState:rt,className:Tt(k.className,tt.select,l),id:He,children:wfe(Fe)?PP||(PP=v.jsx("span",{className:"notranslate","aria-hidden":!0,children:"​"})):Fe}),v.jsx(kfe,{"aria-invalid":y,value:Array.isArray(Y)?Y.join(","):Y,name:_,ref:K,"aria-hidden":!0,onChange:ut,tabIndex:-1,disabled:p,className:tt.nativeInput,autoFocus:o,required:$,...q,ownerState:rt}),v.jsx(_fe,{as:g,className:tt.icon,ownerState:rt}),v.jsx(vfe,{id:`menu-${_||""}`,anchorEl:Ae,open:dt,onClose:ve,anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},...S,slotProps:{...S.slotProps,list:{"aria-labelledby":x,role:"listbox","aria-multiselectable":E?"true":void 0,disableListWrap:!0,id:Gt,...Ut},paper:{...qe,style:{minWidth:ue,...qe!=null?qe.style:null}}},children:gt})]})}),Ife=e=>{const{classes:t}=e,n=Jt({root:["root"]},_F,t);return{...t,...n}},F_={name:"MuiSelect",slot:"Root",shouldForwardProp:e=>Do(e)&&e!=="variant"},Ofe=Ye(N_,F_)(""),Nfe=Ye(L_,F_)(""),Pfe=Ye(P_,F_)(""),kF=A.forwardRef(function(e,t){const n=sn({name:"MuiSelect",props:e}),{autoWidth:r=!1,children:o,classes:a={},className:i,defaultOpen:l=!1,displayEmpty:u=!1,IconComponent:d=yF,id:p,input:h,inputProps:y,label:g,labelId:b,MenuProps:x,multiple:S=!1,native:E=!1,onClose:_,onOpen:C,open:R,renderValue:O,SelectDisplayProps:I,variant:F="outlined",...H}=n,z=E?Cfe:Dfe,L=uu(),$=yp({props:n,muiFormControl:L,states:["variant","error"]}),k=$.variant||F,M={...n,variant:k,classes:a},j=Ife(M),{root:V,...B}=j,q=h||{standard:v.jsx(Ofe,{ownerState:M}),outlined:v.jsx(Nfe,{label:g,ownerState:M}),filled:v.jsx(Pfe,{ownerState:M})}[k],Y=sr(t,mp(q));return v.jsx(A.Fragment,{children:A.cloneElement(q,{inputComponent:z,inputProps:{children:o,error:$.error,IconComponent:d,variant:k,type:void 0,multiple:S,...E?{id:p}:{autoWidth:r,defaultOpen:l,displayEmpty:u,labelId:b,MenuProps:x,onClose:_,onOpen:C,open:R,renderValue:O,SelectDisplayProps:{id:p,...I}},...y,classes:y?yo(B,y.classes):B,...h?h.props.inputProps:{}},...(S&&E||u)&&k==="outlined"?{notched:!0}:{},ref:Y,className:Tt(q.props.className,i,j.root),...!h&&{variant:k},...H})})});kF.muiName="Select";function Lfe(e){return en("MuiTextField",e)}Wt("MuiTextField",["root"]);const Mfe={standard:N_,filled:P_,outlined:L_},Ffe=e=>{const{classes:t}=e;return Jt({root:["root"]},Lfe,t)},jfe=Ye(wpe,{name:"MuiTextField",slot:"Root"})({}),bo=A.forwardRef(function(e,t){const n=sn({props:e,name:"MuiTextField"}),{autoComplete:r,autoFocus:o=!1,children:a,className:i,color:l="primary",defaultValue:u,disabled:d=!1,error:p=!1,FormHelperTextProps:h,fullWidth:y=!1,helperText:g,id:b,InputLabelProps:x,inputProps:S,InputProps:E,inputRef:_,label:C,maxRows:R,minRows:O,multiline:I=!1,name:F,onBlur:H,onChange:z,onFocus:L,placeholder:$,required:k=!1,rows:M,select:j=!1,SelectProps:V,slots:B={},slotProps:q={},type:Y,value:ee,variant:N="outlined",...W}=n,K={...n,autoFocus:o,color:l,disabled:d,error:p,fullWidth:y,multiline:I,required:k,select:j,variant:N},P=Ffe(K),Z=up(b),ae=g&&Z?`${Z}-helper-text`:void 0,J=C&&Z?`${Z}-label`:void 0,pe=Mfe[N],le={slots:B,slotProps:{input:E,inputLabel:x,htmlInput:S,formHelperText:h,select:V,...q}},Ee={},Te=le.slotProps.inputLabel;N==="outlined"&&(Te&&typeof Te.shrink<"u"&&(Ee.notched=Te.shrink),Ee.label=C),j&&((!V||!V.native)&&(Ee.id=void 0),Ee["aria-describedby"]=void 0);const[Ae,Ue]=xn("root",{elementType:jfe,shouldForwardComponentProp:!0,externalForwardedProps:{...le,...W},ownerState:K,className:Tt(P.root,i),ref:t,additionalProps:{disabled:d,error:p,fullWidth:y,required:k,color:l,variant:N}}),[Re,ve]=xn("input",{elementType:pe,externalForwardedProps:le,additionalProps:Ee,ownerState:K}),[pt,ut]=xn("inputLabel",{elementType:Cpe,externalForwardedProps:le,ownerState:K}),[ze,$e]=xn("htmlInput",{elementType:"input",externalForwardedProps:le,ownerState:K}),[dt,Be]=xn("formHelperText",{elementType:Ope,externalForwardedProps:le,ownerState:K}),[Fe,Me]=xn("select",{elementType:kF,externalForwardedProps:le,ownerState:K}),At=v.jsx(Re,{"aria-describedby":ae,autoComplete:r,autoFocus:o,defaultValue:u,fullWidth:y,multiline:I,name:F,rows:M,maxRows:R,minRows:O,type:Y,value:ee,id:Z,inputRef:_,onBlur:H,onChange:z,onFocus:L,placeholder:$,inputProps:$e,slots:{input:B.htmlInput?ze:void 0},...ve});return v.jsxs(Ae,{...Ue,children:[C!=null&&C!==""&&v.jsx(pt,{htmlFor:Z,id:J,...ut,children:C}),j?v.jsx(Fe,{"aria-describedby":ae,id:Z,labelId:J,value:ee,input:At,...Me,children:a}):At,g&&v.jsx(dt,{id:ae,...Be,children:g})]})});function wF({sourceAndPaths:e,selectedSourceIndex:t,existingQuery:n,onQueryChange:r,onSourceChange:o,resourceUri:a}){return Qe.useEffect(()=>{o&&o(t)},[t,o]),v.jsx(E_,{children:v.jsxs(cG,{spacing:2,component:"section",children:[v.jsx(Ufe,{sourceAndPath:e[t],existingQuery:n,onChange:i=>{r&&r(i)},resourceUri:a}),v.jsx(eV,{height:"5px"})]})})}function m0(){return{query:void 0,malloyQuery:void 0,malloyResult:void 0}}function Bfe({sourceAndPath:e,onChange:t,existingQuery:n,explorerComponents:r,QueryBuilder:o,resourceUri:a}){const[i,l]=Qe.useState(n||m0()),[u,d]=Qe.useState(void 0);Qe.useEffect(()=>{n&&l(n)},[n]);const[p,h]=Qe.useState([]),{MalloyExplorerProvider:y,QueryPanel:g,ResizableCollapsiblePanel:b,ResultPanel:x,SourcePanel:S}=r;Qe.useEffect(()=>{t&&t(i)},[t,i]);const{projectName:E,packageName:_,versionId:C}=yr(a),{apiClients:R}=Zn(),O=Ui({mutationFn:()=>{const z=typeof i?.malloyQuery=="string"?i.malloyQuery:new o.ASTQuery({source:e.sourceInfo,query:i?.malloyQuery}).toMalloy();return d({executionState:"running",query:i?.malloyQuery,queryResolutionStartMillis:Date.now(),onCancel:O.reset,response:{result:{}}}),l({...i,query:z}),R.models.executeQueryModel(E,_,e.modelPath,{query:z,sourceName:void 0,queryName:void 0,versionId:C})},onSuccess:z=>{if(z){const L=JSON.parse(z.data.result);l({...i,malloyResult:L}),d($=>$?{...$,executionState:"finished",response:{result:L}}:void 0)}}}),[I,F]=Qe.useState(e.sourceInfo.name);Qe.useEffect(()=>{I!==e.sourceInfo.name&&(F(e.sourceInfo.name),l(m0()),d(void 0))},[e,I]);const H=Qe.useCallback(z=>{l({...i,malloyQuery:z,malloyResult:void 0})},[i]);return I!==e.sourceInfo.name?v.jsx("div",{children:"Loading..."}):v.jsx(eF,{sx:{border:"1px solid #e0e0e0",borderRadius:"8px",overflow:"hidden"},children:v.jsx(y,{source:e.sourceInfo,query:i?.malloyQuery,topValues:[],onFocusedNestViewPathChange:h,focusedNestViewPath:p,onQueryChange:H,children:v.jsxs("div",{style:{display:"flex",height:"100%",overflowY:"auto"},children:[v.jsx(b,{isInitiallyExpanded:!0,initialWidth:180,minWidth:180,icon:"database",title:e.sourceInfo.name,children:v.jsx(S,{onRefresh:()=>l(m0())})}),v.jsx(b,{isInitiallyExpanded:!0,initialWidth:280,minWidth:280,icon:"filterSliders",title:"Query",children:v.jsx(g,{runQuery:()=>{console.log(`running query with: ${i?.malloyQuery}`);try{O.mutate()}catch(z){console.error("Error running query:",z)}}})}),v.jsx(x,{source:e.sourceInfo,draftQuery:i?.malloyQuery,setDraftQuery:z=>l({...i,malloyQuery:z}),submittedQuery:u,options:{showRawQuery:!0}})]})})},e.sourceInfo.name)}function Ufe(e){const[t,n]=A.useState(null),[r,o]=A.useState(null),[a,i]=A.useState(!0);return A.useEffect(()=>{let l=!0;return Promise.all([X(()=>import("./index-B7sMhQDb.js"),__vite__mapDeps([93,94,95])),X(()=>import("./index-BzxjSqrV.js").then(u=>u.i),[])]).then(([u,d])=>{l&&(n(u),o(d),i(!1))}).catch(u=>{console.error("Failed to load Malloy components:",u),l&&i(!1)}),()=>{l=!1}},[]),a||!t||!r?v.jsx(mce,{children:v.jsx(eF,{children:v.jsx("div",{style:{alignItems:"center",justifyContent:"center",height:"200px",color:"#666"},children:"Loading explorer..."})})}):v.jsx(Bfe,{...e,explorerComponents:t,QueryBuilder:r,resourceUri:e.resourceUri})}function RF(e,t=!0){const{modelPath:n,projectName:r,packageName:o,versionId:a}=yr(e),{apiClients:i}=Zn();return Zo({queryKey:["package",r,o,n,a],queryFn:async()=>(await i.models.getModel(r,o,n,a)).data,enabled:t})}function DF({data:e,onChange:t,existingQuery:n,initialSelectedSourceIndex:r=0,onSourceChange:o,resourceUri:a}){const[i,l]=Qe.useState(r);Qe.useEffect(()=>{l(r)},[r]);const{data:u,isError:d,isLoading:p,error:h}=RF(a,!e),{modelPath:y}=yr(a),g=e||u;if(p&&!e)return v.jsx(Ko,{text:"Fetching Model..."});if(d&&!e)return console.log("error",h),v.jsx(Xo,{error:h,context:`ModelExplorer > ${y}`});if(!g)return v.jsx(Ko,{text:"Loading..."});const b=(g?.sourceInfos||[]).map((S,E)=>{try{return JSON.parse(S)?.name||`Source ${E+1}`}catch{return`Source ${E+1}`}}),x=b[i]||"";return v.jsxs(fb,{variant:"outlined",children:[v.jsx(J6,{children:v.jsx(Zr,{sx:{flexDirection:"row"},children:v.jsx(npe,{size:"small",id:"size-small-standard",disablePortal:!0,options:b,value:x,onChange:(S,E)=>{if(!E)return;const _=b.indexOf(E);_>=0&&(l(_),o?.(_))},renderInput:S=>v.jsx(bo,{...S}),style:{width:350,marginTop:"3px",marginLeft:"6px",marginBottom:"8px"}})})}),v.jsx(E_,{children:v.jsxs(Zr,{spacing:2,component:"section",children:[Array.isArray(g.sourceInfos)&&g.sourceInfos.length>0&&v.jsx(wF,{sourceAndPaths:g.sourceInfos.map(S=>({sourceInfo:JSON.parse(S),modelPath:y})),selectedSourceIndex:i,existingQuery:n,onQueryChange:t,resourceUri:a}),v.jsx(It,{height:"5px"})]})})]})}function IF({open:e,onClose:t,resourceUri:n,data:r,title:o="Data Sources",hasValidImport:a=!0,existingQuery:i,initialSelectedSourceIndex:l,onChange:u,onSourceChange:d}){return v.jsxs(Bl,{open:e,onClose:t,fullScreen:!0,children:[v.jsxs(zl,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[o,v.jsx(ir,{onClick:t,sx:{color:"#666666"},children:v.jsx(Vl,{})})]}),v.jsx(Ul,{children:a?v.jsx(DF,{resourceUri:n,data:r,existingQuery:i,initialSelectedSourceIndex:l,onChange:u,onSourceChange:d}):v.jsx("div",{children:"No valid import statement found in cell"})})]})}function fwe({onChange:e,resourceUri:t,runOnDemand:n=!1,maxResultSize:r=0}){const{modelPath:o}=yr(t),{data:a,isError:i,isLoading:l,error:u}=RF(t),[d,p]=Qe.useState(!1),[h,y]=Qe.useState(),[g,b]=Qe.useState(0),[x,S]=A.useState("");if(l)return v.jsx(Ko,{text:"Fetching Model..."});if(i)return console.log("error",u),v.jsx(Xo,{error:u,context:`Model > ${o}`});const E=R=>{y(R),e&&e(R)},_=R=>{b(R)},C=()=>{const R=window.location.href;navigator.clipboard.writeText(R).then(()=>S("URL copied to clipboard!")).catch(()=>S("Failed to copy URL"))};return v.jsxs(v.Fragment,{children:[v.jsxs(It,{sx:{position:"relative",maxWidth:"1200px",margin:"0 auto",paddingTop:"24px"},children:[Array.isArray(a?.sourceInfos)&&a.sourceInfos.length>0&&v.jsxs(Zr,{spacing:2,component:"section",children:[v.jsxs(It,{sx:{padding:"0 0 16px 0",display:"flex",alignItems:"center",justifyContent:"space-between"},children:[v.jsx(ct,{variant:"h1",sx:{fontSize:"28px",fontWeight:"600",color:"#1a1a1a",marginBottom:"8px",marginTop:"0",paddingLeft:"0"},children:"Sources"}),v.jsx(jo,{title:"Click to copy link",children:v.jsx(u_,{sx:{fontSize:"24px",color:"#666666",cursor:"pointer"},onClick:C})})]}),v.jsx(DF,{data:a,onChange:E,onSourceChange:_,existingQuery:h,initialSelectedSourceIndex:g,resourceUri:t}),v.jsx(ir,{sx:{position:"absolute",top:"90px",right:"4px",backgroundColor:"rgba(255, 255, 255, 0.9)","&:hover":{backgroundColor:"rgba(255, 255, 255, 1)"},width:"32px",height:"32px",zIndex:2},onClick:()=>p(!0),children:v.jsx(jo,{title:"Expanded view",children:v.jsx(iie,{sx:{fontSize:"18px",color:"#666666",marginBottom:"5px"}})})})]}),a?.queries?.length>0&&v.jsxs(Zr,{spacing:2,component:"section",sx:{marginTop:"24px"},children:[v.jsx(It,{sx:{padding:"0 0 16px 0"},children:v.jsx(ct,{variant:"h2",sx:{fontSize:"24px",fontWeight:"600",color:"#1a1a1a",marginBottom:"0",marginTop:"8px",paddingLeft:"0"},children:"Named Queries"})}),a.queries.map(R=>v.jsx(yce,{queryName:R.name,annotations:R.annotations,resourceUri:t,runOnDemand:n,maxResultSize:r},R.name))]}),v.jsx(IF,{open:d,onClose:()=>p(!1),resourceUri:t,data:a,title:`Model: ${o.split("/").pop()}`,existingQuery:h,initialSelectedSourceIndex:g,onChange:E,onSourceChange:_})]}),v.jsx(Ls,{open:x!=="",autoHideDuration:6e3,onClose:()=>S(""),message:x})]})}const OF=On(v.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"})),zfe=On(v.jsx("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2m0 16H8V7h11z"}));A.lazy(()=>Promise.resolve().then(()=>Sj));function $fe(e){const{projectName:t,packageName:n}=yr(e.resourceUri);if(!t||!n)throw new Error("Project and Package name must be provided for query embedding.");return JSON.stringify({...e})}function Hfe({cell:e,hideCodeCellIcon:t,hideEmbeddingIcon:n,resourceUri:r,index:o,maxResultSize:a}){const[i,l]=Qe.useState(!1),[u,d]=Qe.useState(!1),[p,h]=Qe.useState(!1),[y,g]=Qe.useState(),[b,x]=Qe.useState(),[S,E]=Qe.useState(!1),[_,C]=A.useState(""),R=/import\s*\{([^}]+)\}\s*from\s*['"`][^'"`]+['"`]/,O=/import\s*(?:\{[^}]*\}\s*from\s*)?['"`]([^'"`]+)['"`]/,I=!!e.text&&(R.test(e.text)||O.test(e.text)),F=()=>{if(!e.newSources||e.newSources.length===0)return 0;let $=[],k="";if(e.text){const M=e.text.match(R);M&&($=M[1].split(",").map(V=>V.trim()));const j=e.text.match(O);j&&(k=j[1].trim())}for(let M=0;M<e.newSources.length;M++)try{const j=JSON.parse(e.newSources[M]);if($.length>0&&$.includes(j.name)||k&&k===j.path)return M}catch{continue}return 0},H=e.newSources&&e.newSources.length>0?{sourceInfos:e.newSources,resource:r}:void 0,z=$fe({query:e.text,resourceUri:r});A.useEffect(()=>{e.type==="code"&&pb(e.text,"malloy").then($=>{g($)})},[e]),A.useEffect(()=>{pb(z,"typescript").then($=>{x($)})},[z]);const L=()=>{const $=window.location.href;navigator.clipboard.writeText($).then(()=>C("URL copied to clipboard!")).catch(()=>C("Failed to copy URL"))};return e.type==="markdown"&&v.jsx(JT,{children:v.jsxs(It,{sx:{"& h1, & h2, & h3, & h4, & h5, & h6":{fontWeight:"600",color:"#1a1a1a",marginBottom:"8px",marginTop:"16px"},"& h1":{fontSize:"28px"},"& h2":{fontSize:"24px"},"& h3":{fontSize:"20px"},"& p":{color:"#333333",lineHeight:"1.7",marginBottom:"8px",fontSize:"16px"},"& ul, & ol":{color:"#333333",lineHeight:"1.7",marginBottom:"8px",fontSize:"16px"},"& li":{marginBottom:"4px"}},children:[o===0?v.jsxs(Zr,{direction:"row",alignItems:"flex-start",justifyContent:"space-between",children:[v.jsx(W0,{children:e.text}),v.jsx(jo,{title:"Click to copy link",children:v.jsx(u_,{sx:{fontSize:"24px",color:"#666666",cursor:"pointer",marginTop:"26px"},onClick:L})})]}):v.jsx(W0,{children:e.text}),v.jsx(Ls,{open:_!=="",autoHideDuration:6e3,onClose:()=>C(""),message:_})]})})||e.type==="code"&&v.jsxs(JT,{children:[(!t||!n&&e.result||e.newSources&&e.newSources.length>0)&&v.jsx(Zr,{sx:{flexDirection:"column",gap:"8px",marginBottom:"16px"},children:e.newSources&&e.newSources.length>0&&I&&v.jsx(eC,{sx:{position:"relative",padding:"0"},children:v.jsxs(It,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingLeft:"24px",paddingRight:"8px"},children:[y&&v.jsx("span",{dangerouslySetInnerHTML:{__html:e.text.length>50&&y?`${y.substring(0,50)}...`:y},style:{fontFamily:"monospace",fontSize:"14px",flex:1,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",marginRight:"8px"}}),v.jsx(ir,{sx:{backgroundColor:"rgba(255, 255, 255, 0.9)","&:hover":{backgroundColor:"rgba(255, 255, 255, 1)"},width:"32px",height:"32px",flexShrink:0},onClick:()=>E(!0),children:v.jsx(im,{sx:{fontSize:"18px",color:"#666666"}})})]})})}),v.jsx(IF,{open:S,onClose:()=>E(!1),title:"Data Sources",hasValidImport:I,resourceUri:r,data:H,initialSelectedSourceIndex:F()}),v.jsxs(Bl,{open:i,onClose:()=>l(!1),maxWidth:"lg",fullWidth:!0,children:[v.jsxs(zl,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:["Malloy Code",v.jsx(ir,{onClick:()=>l(!1),sx:{color:"#666666"},children:v.jsx(Vl,{})})]}),v.jsx(Ul,{children:v.jsx(It,{sx:{border:"1px solid #e0e0e0",borderRadius:"8px",padding:"16px",fontFamily:"monospace",fontSize:"14px",lineHeight:"1.5",overflow:"auto",maxHeight:"70vh",backgroundColor:"#ffffff"},children:v.jsx("pre",{className:"code-display",style:{margin:0},dangerouslySetInnerHTML:{__html:y}})})})]}),v.jsxs(Bl,{open:u,onClose:()=>d(!1),maxWidth:"lg",fullWidth:!0,children:[v.jsxs(zl,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:["Embeddable Code",v.jsx(ir,{onClick:()=>d(!1),sx:{color:"#666666"},children:v.jsx(Vl,{})})]}),v.jsx(Ul,{children:v.jsxs(Zr,{sx:{flexDirection:"row",justifyContent:"space-between",alignItems:"flex-start"},children:[v.jsx(ct,{component:"div",sx:{fontSize:"12px",fontFamily:"monospace","& .line":{textWrap:"wrap"},flex:1},dangerouslySetInnerHTML:{__html:b}}),v.jsx(jo,{title:"Copy Embeddable Code",children:v.jsx(ir,{sx:{width:"24px",height:"24px",marginLeft:"8px",color:"#666666"},onClick:()=>{navigator.clipboard.writeText(z)},children:v.jsx(zfe,{})})})]})})]}),v.jsx(Z6,{open:p,onClose:()=>h(!1),result:e.result||"",title:"Results"}),e.result&&v.jsxs(eC,{sx:{position:"relative"},children:[v.jsx(It,{sx:{paddingTop:"24px"},children:v.jsx(jv,{result:e.result,minHeight:300,maxHeight:1e3,maxResultSize:a})}),v.jsx(It,{sx:{position:"absolute",bottom:0,left:0,right:0,height:"40px",background:"linear-gradient(transparent, rgba(255, 255, 255, 0.9))",pointerEvents:"none",zIndex:1}}),v.jsxs(Zr,{sx:{position:"absolute",top:"8px",right:"8px",flexDirection:"row",gap:"8px",alignItems:"center",zIndex:2},children:[!t&&v.jsx(ir,{sx:{backgroundColor:"rgba(255, 255, 255, 0.9)","&:hover":{backgroundColor:"rgba(255, 255, 255, 1)"},width:"32px",height:"32px"},onClick:$=>{$.stopPropagation(),l(!0)},children:v.jsx(OF,{sx:{fontSize:"18px",color:"#666666"}})}),v.jsx(ir,{sx:{backgroundColor:"rgba(255, 255, 255, 0.9)","&:hover":{backgroundColor:"rgba(255, 255, 255, 1)"},width:"32px",height:"32px"},onClick:()=>h(!0),children:v.jsx(im,{sx:{fontSize:"18px",color:"#666666"}})})]})]})]})}function Vfe({resourceUri:e,maxResultSize:t=0}){const{apiClients:n}=Zn(),{projectName:r,packageName:o,versionId:a,modelPath:i}=yr(e),{data:l,isSuccess:u,isError:d,error:p}=Zo({queryKey:[e],queryFn:async()=>(await n.notebooks.getNotebook(r,o,i,a)).data});return v.jsx(fce,{children:v.jsx(hce,{children:v.jsxs(Zr,{spacing:3,component:"section",children:[!u&&!d&&v.jsx(Ko,{text:"Fetching Notebook..."}),u&&l.notebookCells?.map((h,y)=>v.jsx(Hfe,{cell:h,index:y,resourceUri:e,maxResultSize:t},y)),d&&p.status===404&&v.jsxs(ct,{variant:"body2",sx:{color:"#666666"},children:[v.jsx("code",{children:`${r} > ${o} > ${i}`})," ","not found."]}),d&&p.status!==404&&v.jsx(Xo,{error:p,context:`${r} > ${o} > ${i}`})]})})})}const Gfe=On(v.jsx("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z"})),id=cA({createStyledComponent:Ye("div",{name:"MuiStack",slot:"Root"}),useThemeProps:e=>sn({props:e,name:"MuiStack"})});class kh{constructor(t,n){this.workbookData=n,this.workbookStorage=t,this.workbookData?this.isSaved=!0:(this.workbookData={models:[],cells:[],workbookPath:void 0},this.isSaved=!1)}isSaved;workbookStorage;getWorkbookData(){return this.workbookData}getWorkbookPath(){return this.workbookData.workbookPath}async renameWorkbook(t){if(this.workbookData.workbookPath.path!==t)try{await this.workbookStorage.moveWorkbook(this.workbookData.workbookPath,{path:t,workspace:this.workbookData.workbookPath.workspace})}catch{}return this.workbookData.workbookPath.path=t,this.isSaved=!1,await this.saveWorkbook()}getCells(){return this.workbookData.cells}deleteCell(t){return this.workbookData.cells=[...this.workbookData.cells.slice(0,t),...this.workbookData.cells.slice(t+1)],this.isSaved=!1,this}insertCell(t,n){return this.workbookData.cells=[...this.workbookData.cells.slice(0,t),n,...this.workbookData.cells.slice(t)],this.isSaved=!1,this}setCell(t,n){return this.workbookData.cells[t]=n,this.isSaved=!1,this}setModels(t){return this.workbookData.models=t,this.isSaved=!1,this}getModels(){return this.workbookData.models}updateWorkbookData(t){return this.workbookData=t,this.isSaved=!1,this}async saveWorkbook(){if(!this.isSaved){if(!this.workbookData.workbookPath)throw new Error("Workbook path is not set");await this.workbookStorage.saveWorkbook(this.workbookData.workbookPath,JSON.stringify(this.workbookData)),this.isSaved=!0}return new kh(this.workbookStorage,this.workbookData)}toMalloyWorkbook(){return this.workbookData.cells.map(t=>t.isMarkdown?`>>>markdown
365
365
  `+t.value:`>>>malloy
366
366
  import {${t.sourceName}}" from '${t.modelPath}'"
367
367
  `+t.value+`
@@ -437,11 +437,11 @@ import {${t.sourceName}}" from '${t.modelPath}'"
437
437
  - [ ] `),/^\d+.\s/.test(i)&&(C=`
438
438
  `+(parseInt(i)+1)+". "),Id(r,C)}else if(e.code&&e.code.toLowerCase()==="keyd"&&e.ctrlKey){S0(e);var R={start:r.selectionStart,end:r.selectionEnd},O=R;R=Fh({text:r.value,selection:R});var I=r.value.slice(R.start,R.end);l.setSelectionRange({start:R.end,end:R.end}),Id(r,`
439
439
  `+I),l.setSelectionRange({start:O.start,end:O.end})}else e.code&&e.code.toLowerCase()==="arrowup"&&e.altKey?l3(e,-1):e.code&&e.code.toLowerCase()==="arrowdown"&&e.altKey&&l3(e,1)}var KTe=["prefixCls","onChange"],QTe=["markdown","commands","fullscreen","preview","highlightEnable","extraCommands","tabSize","defaultTabEnable","autoFocusEnd","textareaWarp","dispatch"];function XTe(e){var{prefixCls:t,onChange:n}=e,r=ho(e,KTe),o=A.useContext(Tp),{markdown:a,commands:i,fullscreen:l,preview:u,highlightEnable:d,extraCommands:p,tabSize:h,defaultTabEnable:y,autoFocusEnd:g,textareaWarp:b,dispatch:x}=o;ho(o,QTe);var S=Qe.useRef(null),E=Qe.useRef(),_=Qe.useRef({fullscreen:l,preview:u});A.useEffect(()=>{_.current={fullscreen:l,preview:u,highlightEnable:d}},[l,u,d]),A.useEffect(()=>{if(S.current&&x){var R=new dk(S.current);E.current=R,x({textarea:S.current,commandOrchestrator:R})}},[]),A.useEffect(()=>{if(g&&S.current&&b){S.current.focus();var R=S.current.value.length;S.current.setSelectionRange(R,R),setTimeout(()=>{b&&(b.scrollTop=b.scrollHeight),S.current&&(S.current.scrollTop=S.current.scrollHeight)},0)}},[b]);var C=R=>{YTe(R,h,y),z7(R,[...i||[],...p||[]],E.current,x,_.current)};return A.useEffect(()=>(S.current&&S.current.addEventListener("keydown",C),()=>{S.current&&S.current.removeEventListener("keydown",C)}),[]),v.jsx("textarea",Ke({autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1},r,{ref:S,className:t+"-text-input "+(r.className?r.className:""),value:a,onChange:R=>{x&&x({markdown:R.target.value}),n&&n(R)}}))}var ZTe=["prefixCls","className","onScroll","renderTextarea"];function JTe(e){var t=e||{},{prefixCls:n,className:r,onScroll:o,renderTextarea:a}=t,i=ho(t,ZTe),{markdown:l,scrollTop:u,commands:d,extraCommands:p,dispatch:h}=A.useContext(Tp),y=Qe.useRef(null),g=Qe.useRef(),b=Qe.createRef();A.useEffect(()=>{var S={};b.current&&(S.textareaWarp=b.current||void 0,b.current.scrollTop=u||0),h&&h(Ke({},S))},[]),A.useEffect(()=>{if(y.current&&h){var S=new dk(y.current);g.current=S,h({textarea:y.current,commandOrchestrator:S})}},[]);var x={WebkitTextFillColor:"initial",overflow:"auto"};return v.jsx("div",{ref:b,className:n+"-area "+(r||""),onScroll:o,children:v.jsx("div",{className:n+"-text",children:a?Qe.cloneElement(a(Ke({},i,{value:l,autoComplete:"off",autoCorrect:"off",spellCheck:"false",autoCapitalize:"off",className:n+"-text-input",style:{WebkitTextFillColor:"inherit",overflow:"auto"}}),{dispatch:h,onChange:i.onChange,shortcuts:z7,useContext:{commands:d,extraCommands:p,commandOrchestrator:g.current}}),{ref:y}):v.jsx(A.Fragment,{children:v.jsx(XTe,Ke({prefixCls:n},i,{style:x}))})})})}function eCe(e){var{prefixCls:t,groupName:n,commands:r,children:o}=e||{},{barPopup:a={}}=A.useContext(Tp);return A.useMemo(()=>v.jsx("div",{className:t+"-toolbar-child "+(n&&a[n]?"active":""),onClick:i=>i.stopPropagation(),children:Array.isArray(r)?v.jsx(q7,Ke({commands:r},e,{isChild:!0})):o}),[r,a,n,t])}function c3(e){var{prefixCls:t,overflow:n}=e,{fullscreen:r,preview:o,barPopup:a={},components:i,commandOrchestrator:l,dispatch:u}=A.useContext(Tp),d=A.useRef("");function p(h,y){if(u){var g={barPopup:Ke({},a)};h.keyCommand==="preview"&&(g.preview=h.value),h.keyCommand==="fullscreen"&&(g.fullscreen=!r),e.commands&&h.keyCommand==="group"?e.commands.forEach(b=>{y===b.groupName?g.barPopup[y]=!0:b.keyCommand&&(g.barPopup[b.groupName]=!1)}):(y||h.parent)&&Object.keys(g.barPopup||{}).forEach(b=>{g.barPopup[b]=!1}),Object.keys(g).length&&u(Ke({},g)),l&&l.executeCommand(h)}}return A.useEffect(()=>{document&&n&&(r?document.body.style.overflow="hidden":(d.current||(d.current=window.getComputedStyle(document.body,null).overflow),document.body.style.overflow=d.current))},[r,d,n]),v.jsx("ul",{children:(e.commands||[]).map((h,y)=>{if(h.keyCommand==="divider")return v.jsx("li",Ke({},h.liProps,{className:t+"-toolbar-divider"}),y);if(!h.keyCommand)return v.jsx(A.Fragment,{},y);var g=r&&h.keyCommand==="fullscreen"||h.keyCommand==="preview"&&o===h.value,b=h.children&&typeof h.children=="function"?h.children({getState:()=>l.getState(),textApi:l?l.textApi:void 0,close:()=>p({},h.groupName),execute:()=>p({execute:h.execute}),dispatch:u}):void 0,x=a&&o&&o==="preview"&&!/(preview|fullscreen)/.test(h.keyCommand),S=i?.toolbar||h.render,E=S&&typeof S=="function"?S(h,!!x,p,y):null;return v.jsxs("li",Ke({},h.liProps,{className:g?"active":"",children:[E&&Qe.isValidElement(E)&&E,!E&&!h.buttonProps&&h.icon,!E&&h.buttonProps&&Qe.createElement("button",Ke({type:"button",key:y,disabled:x,"data-name":h.name},h.buttonProps,{onClick:_=>{_.stopPropagation(),p(h,h.groupName)}}),h.icon),h.children&&v.jsx(eCe,{overflow:n,groupName:h.groupName,prefixCls:t,children:b,commands:Array.isArray(h.children)?h.children:void 0})]}),y)})})}function q7(e){e===void 0&&(e={});var{prefixCls:t,isChild:n,className:r}=e,{commands:o,extraCommands:a}=A.useContext(Tp);return v.jsxs("div",{className:t+"-toolbar "+r,children:[v.jsx(c3,Ke({},e,{commands:e.commands||o||[]})),!n&&v.jsx(c3,Ke({},e,{commands:a||[]}))]})}function u3(e){var{hideToolbar:t,toolbarBottom:n,placement:r,overflow:o,prefixCls:a}=e;if(t||r==="bottom"&&!n||r==="top"&&n)return null;var i=n?"bottom":"";return v.jsx(q7,{prefixCls:a,overflow:o,className:i})}var tCe=e=>{var{prefixCls:t,onChange:n}=e||{},r=A.useRef(null),o=A.useRef(),a=A.useRef(e.height);A.useEffect(()=>{a.current!==e.height&&(a.current=e.height)},[e.height]);function i(p){if(o.current){var h,y=p.clientY||((h=p.changedTouches[0])==null?void 0:h.clientY),g=o.current.height+y-o.current.dragY;g>=e.minHeight&&g<=e.maxHeight&&n&&n(o.current.height+(y-o.current.dragY))}}function l(){var p,h;o.current=void 0,document.removeEventListener("mousemove",i),document.removeEventListener("mouseup",l),(p=r.current)==null||p.removeEventListener("touchmove",i),(h=r.current)==null||h.removeEventListener("touchend",l)}function u(p){var h,y,g;p.preventDefault();var b=p.clientY||((h=p.changedTouches[0])==null?void 0:h.clientY);o.current={height:a.current,dragY:b},document.addEventListener("mousemove",i),document.addEventListener("mouseup",l),(y=r.current)==null||y.addEventListener("touchmove",i,{passive:!1}),(g=r.current)==null||g.addEventListener("touchend",l,{passive:!1})}A.useEffect(()=>{if(document){var p,h;(p=r.current)==null||p.addEventListener("touchstart",u,{passive:!1}),(h=r.current)==null||h.addEventListener("mousedown",u)}return()=>{if(document){var y;(y=r.current)==null||y.removeEventListener("touchstart",u),document.removeEventListener("mousemove",i)}}},[]);var d=A.useMemo(()=>v.jsx("svg",{viewBox:"0 0 512 512",height:"100%",children:v.jsx("path",{fill:"currentColor",d:"M304 256c0 26.5-21.5 48-48 48s-48-21.5-48-48 21.5-48 48-48 48 21.5 48 48zm120-48c-26.5 0-48 21.5-48 48s21.5 48 48 48 48-21.5 48-48-21.5-48-48-48zm-336 0c-26.5 0-48 21.5-48 48s21.5 48 48 48 48-21.5 48-48-21.5-48-48-48z"})}),[]);return v.jsx("div",{className:t+"-bar",ref:r,children:d})},nCe=["prefixCls","className","value","commands","commandsFilter","direction","extraCommands","height","enableScroll","visibleDragbar","highlightEnable","preview","fullscreen","overflow","previewOptions","textareaProps","maxHeight","minHeight","autoFocus","autoFocusEnd","tabSize","defaultTabEnable","onChange","onStatistics","onHeightChange","hideToolbar","toolbarBottom","components","renderTextarea"];function rCe(e){return e===void 0&&(e={}),Object.keys(e).forEach(t=>{e[t]=!1}),e}var oCe=Qe.forwardRef((e,t)=>{var n=e||{},{prefixCls:r="w-md-editor",className:o,value:a,commands:i=qTe(),commandsFilter:l,direction:u,extraCommands:d=WTe(),height:p=200,enableScroll:h=!0,visibleDragbar:y=typeof e.visiableDragbar=="boolean"?e.visiableDragbar:!0,highlightEnable:g=!0,preview:b="live",fullscreen:x=!1,overflow:S=!0,previewOptions:E={},textareaProps:_,maxHeight:C=1200,minHeight:R=100,autoFocus:O,autoFocusEnd:I=!1,tabSize:F=2,defaultTabEnable:H=!1,onChange:z,onStatistics:L,onHeightChange:$,hideToolbar:k,toolbarBottom:M=!1,components:j,renderTextarea:V}=n,B=ho(n,nCe),q=i.map(ze=>l?l(ze,!1):ze).filter(Boolean),Y=d.map(ze=>l?l(ze,!0):ze).filter(Boolean),[ee,N]=A.useReducer(fTe,{markdown:a,preview:b,components:j,height:p,minHeight:R,highlightEnable:g,tabSize:F,defaultTabEnable:H,scrollTop:0,scrollTopPreview:0,commands:q,extraCommands:Y,fullscreen:x,barPopup:{}}),W=A.useRef(null),K=A.useRef(null),P=A.useRef(h);A.useImperativeHandle(t,()=>Ke({},ee,{container:W.current,dispatch:N})),A.useMemo(()=>P.current=h,[h]),A.useEffect(()=>{var ze={};W.current&&(ze.container=W.current||void 0),ze.markdown=a||"",ze.barPopup={},N&&N(Ke({},ee,ze))},[]);var Z=[o,"wmde-markdown-var",u?r+"-"+u:null,r,ee.preview?r+"-show-"+ee.preview:null,ee.fullscreen?r+"-fullscreen":null].filter(Boolean).join(" ").trim();A.useMemo(()=>a!==ee.markdown&&N({markdown:a||""}),[a,ee.markdown]),A.useMemo(()=>b!==ee.preview&&N({preview:b}),[b]),A.useMemo(()=>F!==ee.tabSize&&N({tabSize:F}),[F]),A.useMemo(()=>g!==ee.highlightEnable&&N({highlightEnable:g}),[g]),A.useMemo(()=>O!==ee.autoFocus&&N({autoFocus:O}),[O]),A.useMemo(()=>I!==ee.autoFocusEnd&&N({autoFocusEnd:I}),[I]),A.useMemo(()=>x!==ee.fullscreen&&N({fullscreen:x}),[x]),A.useMemo(()=>p!==ee.height&&N({height:p}),[p]),A.useMemo(()=>p!==ee.height&&$&&$(ee.height,p,ee),[p,$,ee]),A.useMemo(()=>i!==ee.commands&&N({commands:q}),[e.commands]),A.useMemo(()=>d!==ee.extraCommands&&N({extraCommands:Y}),[e.extraCommands]);var ae=A.useRef(),J=A.useRef("preview"),pe=A.useRef(!1);A.useMemo(()=>{ae.current=ee.textareaWarp,ee.textareaWarp&&(ee.textareaWarp.addEventListener("mouseover",()=>{J.current="text"}),ee.textareaWarp.addEventListener("mouseleave",()=>{J.current="preview"}))},[ee.textareaWarp]);var le=(ze,$e)=>{if(P.current){var dt=ae.current,Be=K.current?K.current:void 0;if(pe.current||(J.current=$e,pe.current=!0),dt&&Be){var Fe=(dt.scrollHeight-dt.offsetHeight)/(Be.scrollHeight-Be.offsetHeight);ze.target===dt&&J.current==="text"&&(Be.scrollTop=dt.scrollTop/Fe),ze.target===Be&&J.current==="preview"&&(dt.scrollTop=Be.scrollTop*Fe);var Me=0;J.current==="text"?Me=dt.scrollTop||0:J.current==="preview"&&(Me=Be.scrollTop||0),N({scrollTop:Me})}}},Ee=r+"-preview "+(E.className||""),Te=ze=>le(ze,"preview"),Ae=A.useMemo(()=>v.jsx("div",{ref:K,className:Ee,children:v.jsx(B7,Ke({},E,{onScroll:Te,source:ee.markdown||""}))}),[Ee,E,ee.markdown]),Ue=j?.preview&&j?.preview(ee.markdown||"",ee,N);Ue&&Qe.isValidElement(Ue)&&(Ae=v.jsx("div",{className:Ee,ref:K,onScroll:Te,children:Ue}));var Re=Ke({},B.style,{height:ee.height||"100%"}),ve=()=>N({barPopup:Ke({},rCe(ee.barPopup))}),pt=ze=>N({height:ze}),ut=ze=>{if(z&&z(ze.target.value,ze,ee),_&&_.onChange&&_.onChange(ze),ee.textarea&&ee.textarea instanceof HTMLTextAreaElement&&L){var $e=new dk(ee.textarea),dt=$e.getState()||{};L(Ke({},dt,{lineCount:ze.target.value.split(`
440
- `).length,length:ze.target.value.length}))}};return v.jsx(Tp.Provider,{value:Ke({},ee,{dispatch:N}),children:v.jsxs("div",Ke({ref:W,className:Z},B,{onClick:ve,style:Re,children:[v.jsx(u3,{hideToolbar:k,toolbarBottom:M,prefixCls:r,overflow:S,placement:"top"}),v.jsxs("div",{className:r+"-content",children:[/(edit|live)/.test(ee.preview||"")&&v.jsx(JTe,Ke({className:r+"-input",prefixCls:r,autoFocus:O},_,{onChange:ut,renderTextarea:j?.textarea||V,onScroll:ze=>le(ze,"text")})),/(live|preview)/.test(ee.preview||"")&&Ae]}),y&&!ee.fullscreen&&v.jsx(tCe,{prefixCls:r,height:ee.height,maxHeight:C,minHeight:R,onChange:pt}),v.jsx(u3,{hideToolbar:k,toolbarBottom:M,prefixCls:r,overflow:S,placement:"bottom"})]}))})}),W7=oCe;W7.Markdown=B7;function aCe({cell:e,sourceAndPaths:t,resourceUri:n,onQueryChange:r,onSourceChange:o}){const a={query:e.value,malloyResult:e.result?JSON.parse(e.result):void 0,malloyQuery:e.queryInfo?JSON.parse(e.queryInfo):void 0},i=t.findIndex(l=>l.sourceInfo.name===e.sourceName);return v.jsx(wF,{resourceUri:n,sourceAndPaths:t,selectedSourceIndex:i>=0?i:0,existingQuery:a,onQueryChange:r,onSourceChange:o})}function iCe({cell:e,editingMalloy:t,editingMarkdown:n,sourceAndPaths:r,resourceUri:o,onCellChange:a,onClose:i,onEdit:l,onDelete:u,addButtonCallback:d}){const[p,h]=A.useState(e.value),[y,g]=Qe.useState(!1),[b,x]=Qe.useState(!1),[S,E]=Qe.useState(),[_]=Qe.useState(),[C,R]=Qe.useState(m0()),[O,I]=Qe.useState(!1),[F,H]=Qe.useState(e.sourceName?r.findIndex(W=>W.sourceInfo.name===e.sourceName):0);A.useEffect(()=>{e.isMarkdown||pb(e.value,"malloy").then(W=>{E(W)})},[e]),Qe.useEffect(()=>{document.documentElement.setAttribute("data-color-mode","light")});const[z,L]=A.useState(!1),$=()=>{u(),L(!1)},k=r.length===0,M=Qe.useCallback(()=>{const W=r[F],K=W?.modelPath||e.modelPath||"",P=W?.sourceInfo.name||e.sourceName||"";a({...e,value:e.isMarkdown?p:C.query,result:C.malloyResult?JSON.stringify(C.malloyResult):void 0,queryInfo:C.malloyQuery?JSON.stringify(C.malloyQuery):void 0,sourceName:P,modelPath:K})},[e,p,C,a,F,r]),j=v.jsx(jo,{title:"Delete Cell",children:v.jsx(ir,{size:"small",onClick:()=>L(!0),children:v.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:v.jsx("path",{d:"M3 6h18M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2m2 0v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6h14zM10 11v6M14 11v6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})}),V=v.jsxs(Bl,{open:z,onClose:()=>L(!1),children:[v.jsx(zl,{children:"Confirm Delete"}),v.jsx(Ul,{children:v.jsx(ct,{children:"Are you sure you want to delete this cell?"})}),v.jsxs(cM,{children:[v.jsx(ma,{onClick:()=>L(!1),children:"Cancel"}),v.jsx(ma,{onClick:$,color:"error",children:"Delete"})]})]}),B=()=>{M(),i()},q=e.isMarkdown?v.jsxs(v.Fragment,{children:[n?v.jsx(jo,{title:"Save",children:v.jsx(ir,{size:"small",onClick:B,children:v.jsx(Fy,{})})}):v.jsx(jo,{title:"Edit",children:v.jsx(ir,{size:"small",onClick:l,children:v.jsx(MP,{})})}),!n&&j]}):v.jsxs(v.Fragment,{children:[!t&&v.jsx(jo,{title:y?"Hide Code":"View Code",children:v.jsx(ir,{size:"small",onClick:()=>{g(!y)},children:v.jsx(OF,{})})}),!t&&e.result&&v.jsx(jo,{title:b?"Hide Embedding":"View Embedding",children:v.jsx(ir,{size:"small",onClick:()=>{x(!b)},children:v.jsx(u_,{})})}),t&&v.jsx(jo,{title:"Save",children:v.jsx(ir,{size:"small",onClick:B,children:v.jsx(Fy,{})})}),!t&&v.jsx(jo,{title:"Edit",children:v.jsx(ir,{size:"small",onClick:l,children:v.jsx(MP,{})})}),!t&&j]}),Y=t||n,ee=n?v.jsx(jo,{title:"Save",children:v.jsx(ir,{size:"small",onClick:B,children:v.jsx(Fy,{})})}):t?v.jsx(jo,{title:"Save",children:v.jsx(ir,{size:"small",onClick:B,children:v.jsx(Fy,{})})}):null,N=O&&v.jsx(It,{sx:{position:"absolute",top:"4px",right:"4px",display:"flex",gap:"8px",backgroundColor:"background.paper",border:"1px solid",borderColor:"divider",borderRadius:"8px",padding:"2px 4px",boxShadow:1,zIndex:10},children:!Y&&v.jsxs(v.Fragment,{children:[d(!0),d(!1),q]})||ee});return v.jsxs(fb,{sx:{position:"relative",marginTop:"5px",marginBottom:"5px",borderWidth:"1.5px",backgroundColor:"#fff",minHeight:"50px"},onMouseEnter:()=>I(!0),onMouseLeave:()=>{I(!1)},children:[N,e.isMarkdown?v.jsx(v.Fragment,{children:n?v.jsx(W7,{value:p,preview:"edit",autoFocus:!0,onChange:W=>{h(W),a({...e,value:W})},onBlur:()=>{M(),O||B()}}):v.jsx(It,{sx:{px:.5,pt:0,mt:0,"& h1, & h2, & h3, & h4, & h5, & h6":{mt:.5,mb:.5},"& p":{mt:.5,mb:.5},"& ul, & ol":{mt:.5,mb:.5},"& li":{mt:0,mb:0},"& pre, & code":{mt:.5,mb:.5},"& blockquote":{mt:.5,mb:.5}},children:e.value?v.jsx(It,{onClick:l,sx:{cursor:"pointer"},children:v.jsx(W0,{children:e.value})}):v.jsxs(It,{onClick:l,sx:{cursor:"pointer"},children:[v.jsx(ct,{sx:{p:2,textAlign:"center",variant:"subtitle2",fontWeight:"medium"},children:"Markdown is empty"}),v.jsx(ct,{sx:{mb:2,textAlign:"center",variant:"body2"},children:"Click to edit."})]})})}):v.jsxs(v.Fragment,{children:[v.jsx(M0,{in:b,timeout:"auto",unmountOnExit:!0,children:v.jsx(Zr,{sx:{p:"10px",borderRadius:0,flexDirection:"row",justifyContent:"space-between"},children:v.jsx(ct,{component:"div",sx:{fontSize:"12px","& .line":{textWrap:"wrap"}},dangerouslySetInnerHTML:{__html:_}})})}),v.jsx(M0,{in:y,timeout:"auto",unmountOnExit:!0,children:v.jsx(Zr,{sx:{p:"10px",borderRadius:0,flexDirection:"row",justifyContent:"space-between"},children:v.jsx(ct,{component:"div",className:"content",sx:{fontSize:"12px","& .line":{textWrap:"wrap"}},dangerouslySetInnerHTML:{__html:S}})})}),t&&(k?v.jsxs(v.Fragment,{children:[v.jsx(ct,{sx:{p:2,textAlign:"center",variant:"subtitle2",fontWeight:"medium"},children:"No Model Imports"}),v.jsx(ct,{sx:{mb:2,textAlign:"center",variant:"body2"},children:"Please add a model import above."})]}):v.jsx(aCe,{sourceAndPaths:r,resourceUri:o,onQueryChange:W=>{R(W)},onSourceChange:W=>{H(W)},cell:e})),!t&&e.result&&v.jsx(fb,{variant:"outlined",sx:{borderRadius:0},children:v.jsx(jv,{result:e.result,minHeight:300,maxHeight:800})}),!t&&!e.result&&v.jsxs(It,{onClick:l,sx:{cursor:"pointer"},children:[v.jsx(ct,{sx:{p:2,textAlign:"center",variant:"subtitle2",fontWeight:"medium"},children:"Explore is empty"}),v.jsx(ct,{sx:{mb:2,textAlign:"center",variant:"body2"},children:"Click to edit."})]})]}),z&&V]})}const Y7=A.createContext(void 0);function sCe({children:e,workbookStorage:t}){const n=A.useMemo(()=>({workbookStorage:t}),[t]);return v.jsx(Y7.Provider,{value:n,children:e})}function lCe(){const e=A.useContext(Y7);if(!e)throw new Error("useWorkbookStorage must be used within a WorkbookStorageProvider");return e}const cCe=On(v.jsx("path",{d:"M18 15v3H6v-3H4v3c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-3zM7 9l1.41 1.41L11 7.83V16h2V7.83l2.59 2.58L17 9l-5-5z"}));function uCe({initialSelectedModels:e,onModelChange:t,resourceUri:n}){const{projectName:r,packageName:o,versionId:a}=yr(n),{apiClients:i}=Zn(),{data:l,isLoading:u,isSuccess:d,isError:p,error:h}=Zo({queryKey:["models",r,o,a],queryFn:()=>i.models.listModels(r,o,a)}),[y,g]=Qe.useState(e||[]),[b,x]=Qe.useState(null);Qe.useEffect(()=>{g(e||[])},[e]);const S=C=>{const R=y.filter(O=>O!==C);g(R),t(R)},E=C=>{const R=[...y,C];g(R),t(R),x(null)};let _=[];return d&&l?.data&&(_=l.data.filter(C=>!y.includes(C.path)).map(C=>C.path)),p?v.jsx(Xo,{error:h,context:`${r} > ${o} > Model Picker`}):v.jsxs(v.Fragment,{children:[v.jsxs(uM,{fullWidth:!0,children:[u&&v.jsx(ct,{children:"Loading..."}),v.jsxs(Zr,{direction:"row",spacing:1,children:[y.map(C=>v.jsx(n0,{label:C,onDelete:()=>S(C),deleteIcon:v.jsx(Vl,{}),sx:{marginBottom:"5px"}},C)),v.jsx(ma,{size:"small",startIcon:v.jsx(cCe,{}),onClick:C=>x(C.currentTarget),disabled:u||p||_.length===0,children:"Add Model"})]})]}),v.jsxs(Im,{anchorEl:b,open:!!b,onClose:()=>x(null),children:[v.jsx(ct,{variant:"subtitle2",sx:{ml:1},children:"Models"}),v.jsx(Hi,{}),_.length===0?v.jsx($l,{disabled:!0,children:"No models available"}):_.map(C=>v.jsx($l,{onClick:()=>E(C),children:v.jsx(ct,{variant:"body2",children:C})},C))]})]})}function dCe(){const e=$3();return(t,n)=>{if(!n||!n.metaKey&&!n.ctrlKey&&!n.shiftKey&&n.button!==1){e(t);return}const r=new URL(t,window.location.href).href;(n.metaKey||n.ctrlKey||n.button===1||n.shiftKey)&&window.open(r,"_blank")}}function hwe({workbookPath:e,resourceUri:t}){const n=dCe(),{server:r,getAccessToken:o}=Zn(),{apiClients:a}=Zn(),{workbookStorage:i}=lCe(),{projectName:l,packageName:u}=yr(t),[d,p]=Qe.useState(void 0),[h,y]=Qe.useState(void 0);if(!i)throw new Error("Workbook storage be provided via WorkbookStorageProvider");const[g,b]=Qe.useState(),[x,S]=Qe.useState(),[E,_]=Qe.useState(),[C,R]=Qe.useState([]),[O,I]=Qe.useState(null),[F,H]=Qe.useState(null),z=!!O,L=()=>{I(null),H(null)},$=(W,K)=>{g&&(b(g.insertCell(K,{isMarkdown:W,value:""})),W?_(K):S(K),L(),console.log("handleAddCell",W,K))},[k,M]=Qe.useState(!1),j=()=>{M(!0)},V=async()=>{e&&i&&await i.deleteWorkbook(e).then(()=>{y(void 0),p(void 0)}).catch(W=>{y(`Error deleting workbook: ${W.message}`),p(void 0)}),M(!1),n(`/${l}/${u}`)},B=()=>{M(!1)},q=Qe.useCallback(async()=>{if(!g){console.log("No workbook data ref");return}try{b(await g.saveWorkbook()),y(void 0),p("Workbook saved")}catch(W){y(`Error saving workbook: ${W.message}`),p(void 0)}},[g]);if(Qe.useEffect(()=>{g&&(async()=>{const W=new Map(C.map(({modelPath:Z,sourceInfos:ae})=>[Z,ae])),K=[],P=[];for(const Z of g.getModels())W.has(Z)?K.push({modelPath:Z,sourceInfos:W.get(Z)}):(console.log("Fetching model from Publisher",Z),P.push(a.models.getModel(l,u,Z,void 0).then(ae=>({modelPath:Z,sourceInfos:ae.data.sourceInfos.map(J=>JSON.parse(J))}))));if(P.length>0){const Z=await Promise.all(P);R([...K,...Z])}else R(K)})()},[o,g,u,l,r]),Qe.useEffect(()=>{e&&kh.loadWorkbook(i,e).then(W=>{b(W)})},[e,i]),!g)return v.jsx("div",{children:"Loading..."});const Y=W=>{const K=[];for(const P of W)for(const Z of P.sourceInfos)K.push({modelPath:P.modelPath,sourceInfo:Z});return K},ee=(W,K)=>v.jsx(ma,{size:"small",startIcon:v.jsx(Gfe,{}),onClick:()=>$(W,K),variant:"contained",sx:{backgroundColor:"#fff",color:P=>P.palette.mode==="dark"?P.palette.grey[100]:P.palette.grey[700],boxShadow:"none","&:hover":{backgroundColor:P=>P.palette.mode==="dark"?P.palette.grey[500]:P.palette.grey[300],boxShadow:"none"}},children:W?"Markdown":"Explore"}),N=v.jsxs(It,{sx:{display:"flex",gap:1,justifyContent:"center",flex:2},children:[ee(!1,g.getCells().length),ee(!0,g.getCells().length)]});return v.jsxs(fb,{variant:"outlined",children:[v.jsxs(J6,{children:[v.jsx(It,{sx:{mb:2},children:v.jsx(It,{sx:{minHeight:"24px"},children:h?v.jsx(ct,{color:"error",variant:"body2",children:h}):d?v.jsx(ct,{color:"success",variant:"body2",children:d}):v.jsx("span",{children:" "})})}),v.jsxs(id,{sx:{flexDirection:"row",justifyContent:"space-between",alignItems:"center"},children:[v.jsxs(id,{direction:"row",spacing:1,alignItems:"center",children:[v.jsx(ct,{variant:"overline",sx:{fontSize:"13px",fontWeight:"bold",verticalAlign:"middle"},children:"Workbook"}),v.jsx(ct,{variant:"subtitle2",sx:{fontSize:"13px",fontWeight:"normal",verticalAlign:"middle",ml:1},children:`${e.workspace} > ${e.path}`})]}),v.jsxs(id,{sx:{display:"flex",flexDirection:"row",gap:1},children:[v.jsx(It,{sx:{display:"flex",alignItems:"center",mt:1,mb:1},children:v.jsx(pCe,{workbookData:g})}),v.jsxs(It,{sx:{display:"flex",alignItems:"center",mt:1,mb:1},children:[v.jsx(ma,{color:"error",onClick:j,size:"small",children:"Delete"}),v.jsxs(Bl,{open:k,onClose:B,children:[v.jsx(zl,{children:"Delete Workbook"}),v.jsx(Ul,{children:v.jsxs(HK,{children:['Are you sure you want to delete the workbook "',e.path,'"? This action cannot be undone.']})}),v.jsxs(cM,{children:[v.jsx(ma,{onClick:B,color:"primary",size:"small",children:"Cancel"}),v.jsx(ma,{onClick:V,color:"error",autoFocus:!0,size:"small",children:"Delete"})]})]})]})]})]}),v.jsx(Hi,{}),v.jsxs(id,{sx:{display:"flex",flexDirection:"row",width:"100%",mt:2},children:[v.jsx(It,{sx:{flex:1},children:v.jsx(uCe,{initialSelectedModels:g.getModels(),onModelChange:W=>{b(g.setModels(W)),q()},resourceUri:t})}),v.jsx(It,{sx:{flex:1}})]})]}),v.jsx(E_,{children:v.jsxs(id,{children:[g.getCells().length===0&&v.jsxs(v.Fragment,{children:[v.jsx(ct,{sx:{textAlign:"center",p:2,variant:"subtitle2",fontWeight:"medium"},children:"Workbook is empty"}),v.jsx(ct,{variant:"body2",sx:{textAlign:"center",mb:2,variant:"body2"},children:"Click the + buttons to add a markdown or code cell."})]}),g.getCells().map((W,K)=>v.jsx(Qe.Fragment,{children:v.jsx(iCe,{cell:W,resourceUri:t,addButtonCallback:P=>ee(P,K),sourceAndPaths:Y(C),editingMarkdown:E===K,editingMalloy:x===K,onDelete:()=>{b(g.deleteCell(K)),q()},onCellChange:P=>{b(g.setCell(K,P))},onEdit:()=>{W.isMarkdown?_(K):S(K)},onClose:()=>{W.isMarkdown?_(void 0):S(void 0),q()}},`${K}-${W.isMarkdown}-${e.workspace}-${e.path}`)},`${K}-${g.getCells().length}`)),N,v.jsxs(Im,{anchorEl:O,open:z,onClose:L,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:[v.jsx($l,{onClick:()=>$(!0,F??0),children:"Add Markdown"}),v.jsx($l,{onClick:()=>$(!1,F??0),children:"Add Malloy"})]}),v.jsx(id,{sx:{flexDirection:"row",justifyContent:"flex-end",p:1}})]})})]})}function pCe({workbookData:e}){const[t,n]=Qe.useState(!1);return v.jsx(ma,{color:"primary",onClick:async()=>{if(!e)return;const r=e.toMalloyWorkbook();try{await navigator.clipboard.writeText(r),n(!0),setTimeout(()=>n(!1),1500)}catch{n(!1),alert("Failed to copy to clipboard")}},size:"small",children:t?"Copied!":"Export"})}const d3="Local";class fCe{async listWorkspaces(t){return Promise.resolve([{name:d3,description:"Stored locally- only accessible to this browser",writeable:!0}])}async listWorkbooks(t){const n=[];for(let r=0;r<localStorage.length;r++){const o=localStorage.key(r);n.push({path:o,workspace:d3})}return n}async getWorkbook(t){const n=localStorage.getItem(t.path);if(n===null)throw new Error(`Notebook not found at path: ${t}`);return n}async deleteWorkbook(t){if(localStorage.getItem(t.path)===null)throw new Error(`Notebook not found at path: ${t}`);localStorage.removeItem(t.path)}async saveWorkbook(t,n){localStorage.setItem(t.path,n)}async moveWorkbook(t,n){const r=localStorage.getItem(t.path);if(r===null)throw new Error(`Notebook not found at path: ${t.path}`);localStorage.setItem(n.path,r),localStorage.removeItem(t.path)}}const K7=On(v.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-2h2zm0-4h-2V7h2z"}));function hCe({resourceUri:e}){const{apiClients:t}=Zn(),{projectName:n,packageName:r,versionId:o}=yr(e),{data:a,isSuccess:i,isError:l,error:u}=Zo({queryKey:["package",n,r,o],queryFn:()=>t.packages.getPackage(n,r,o,!1)});return v.jsx(Kl,{children:v.jsxs(Ql,{children:[v.jsx(cu,{children:"Package Config"}),v.jsx(It,{sx:{maxHeight:"200px",overflowY:"auto"},children:v.jsxs(tv,{dense:!0,disablePadding:!0,children:[v.jsx(Ey,{dense:!0,disablePadding:!0,children:v.jsx(As,{primary:"Name",primaryTypographyProps:{fontWeight:"500"},secondary:r})}),!i&&!l&&v.jsx(Ey,{children:v.jsx(Ko,{text:"Fetching Package Metadata..."})}),i&&(a.data&&v.jsx(Ey,{dense:!0,disablePadding:!0,children:v.jsx(As,{primary:"Description",primaryTypographyProps:{fontWeight:"500"},secondary:a.data.description})})||v.jsxs(Ey,{disablePadding:!0,dense:!0,sx:{mt:"20px"},children:[v.jsx(K7,{sx:{color:"grey.600",mr:"10px"}}),v.jsx(As,{primary:"No package manifest"})]})),l&&v.jsx(Xo,{error:u,context:`${n} > ${r} > ${o}`})]})})]})})}function mCe(e){return en("MuiButton",e)}const Ec=Wt("MuiButton",["root","text","textInherit","textPrimary","textSecondary","textSuccess","textError","textInfo","textWarning","outlined","outlinedInherit","outlinedPrimary","outlinedSecondary","outlinedSuccess","outlinedError","outlinedInfo","outlinedWarning","contained","containedInherit","containedPrimary","containedSecondary","containedSuccess","containedError","containedInfo","containedWarning","disableElevation","focusVisible","disabled","colorInherit","colorPrimary","colorSecondary","colorSuccess","colorError","colorInfo","colorWarning","textSizeSmall","textSizeMedium","textSizeLarge","outlinedSizeSmall","outlinedSizeMedium","outlinedSizeLarge","containedSizeSmall","containedSizeMedium","containedSizeLarge","sizeMedium","sizeSmall","sizeLarge","fullWidth","startIcon","endIcon","icon","iconSizeSmall","iconSizeMedium","iconSizeLarge","loading","loadingWrapper","loadingIconPlaceholder","loadingIndicator","loadingPositionCenter","loadingPositionStart","loadingPositionEnd"]),gCe=A.createContext({}),yCe=A.createContext(void 0),bCe=e=>{const{color:t,disableElevation:n,fullWidth:r,size:o,variant:a,loading:i,loadingPosition:l,classes:u}=e,d={root:["root",i&&"loading",a,`${a}${Ze(t)}`,`size${Ze(o)}`,`${a}Size${Ze(o)}`,`color${Ze(t)}`,n&&"disableElevation",r&&"fullWidth",i&&`loadingPosition${Ze(l)}`],startIcon:["icon","startIcon",`iconSize${Ze(o)}`],endIcon:["icon","endIcon",`iconSize${Ze(o)}`],loadingIndicator:["loadingIndicator"],loadingWrapper:["loadingWrapper"]},p=Jt(d,mCe,u);return{...u,...p}},Q7=[{props:{size:"small"},style:{"& > *:nth-of-type(1)":{fontSize:18}}},{props:{size:"medium"},style:{"& > *:nth-of-type(1)":{fontSize:20}}},{props:{size:"large"},style:{"& > *:nth-of-type(1)":{fontSize:22}}}],vCe=Ye(Kd,{shouldForwardProp:e=>Do(e)||e==="classes",name:"MuiButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`${n.variant}${Ze(n.color)}`],t[`size${Ze(n.size)}`],t[`${n.variant}Size${Ze(n.size)}`],n.color==="inherit"&&t.colorInherit,n.disableElevation&&t.disableElevation,n.fullWidth&&t.fullWidth,n.loading&&t.loading]}})(hn(({theme:e})=>{const t=e.palette.mode==="light"?e.palette.grey[300]:e.palette.grey[800],n=e.palette.mode==="light"?e.palette.grey.A100:e.palette.grey[700];return{...e.typography.button,minWidth:64,padding:"6px 16px",border:0,borderRadius:(e.vars||e).shape.borderRadius,transition:e.transitions.create(["background-color","box-shadow","border-color","color"],{duration:e.transitions.duration.short}),"&:hover":{textDecoration:"none"},[`&.${Ec.disabled}`]:{color:(e.vars||e).palette.action.disabled},variants:[{props:{variant:"contained"},style:{color:"var(--variant-containedColor)",backgroundColor:"var(--variant-containedBg)",boxShadow:(e.vars||e).shadows[2],"&:hover":{boxShadow:(e.vars||e).shadows[4],"@media (hover: none)":{boxShadow:(e.vars||e).shadows[2]}},"&:active":{boxShadow:(e.vars||e).shadows[8]},[`&.${Ec.focusVisible}`]:{boxShadow:(e.vars||e).shadows[6]},[`&.${Ec.disabled}`]:{color:(e.vars||e).palette.action.disabled,boxShadow:(e.vars||e).shadows[0],backgroundColor:(e.vars||e).palette.action.disabledBackground}}},{props:{variant:"outlined"},style:{padding:"5px 15px",border:"1px solid currentColor",borderColor:"var(--variant-outlinedBorder, currentColor)",backgroundColor:"var(--variant-outlinedBg)",color:"var(--variant-outlinedColor)",[`&.${Ec.disabled}`]:{border:`1px solid ${(e.vars||e).palette.action.disabledBackground}`}}},{props:{variant:"text"},style:{padding:"6px 8px",color:"var(--variant-textColor)",backgroundColor:"var(--variant-textBg)"}},...Object.entries(e.palette).filter(ko()).map(([r])=>({props:{color:r},style:{"--variant-textColor":(e.vars||e).palette[r].main,"--variant-outlinedColor":(e.vars||e).palette[r].main,"--variant-outlinedBorder":e.alpha((e.vars||e).palette[r].main,.5),"--variant-containedColor":(e.vars||e).palette[r].contrastText,"--variant-containedBg":(e.vars||e).palette[r].main,"@media (hover: hover)":{"&:hover":{"--variant-containedBg":(e.vars||e).palette[r].dark,"--variant-textBg":e.alpha((e.vars||e).palette[r].main,(e.vars||e).palette.action.hoverOpacity),"--variant-outlinedBorder":(e.vars||e).palette[r].main,"--variant-outlinedBg":e.alpha((e.vars||e).palette[r].main,(e.vars||e).palette.action.hoverOpacity)}}}})),{props:{color:"inherit"},style:{color:"inherit",borderColor:"currentColor","--variant-containedBg":e.vars?e.vars.palette.Button.inheritContainedBg:t,"@media (hover: hover)":{"&:hover":{"--variant-containedBg":e.vars?e.vars.palette.Button.inheritContainedHoverBg:n,"--variant-textBg":e.alpha((e.vars||e).palette.text.primary,(e.vars||e).palette.action.hoverOpacity),"--variant-outlinedBg":e.alpha((e.vars||e).palette.text.primary,(e.vars||e).palette.action.hoverOpacity)}}}},{props:{size:"small",variant:"text"},style:{padding:"4px 5px",fontSize:e.typography.pxToRem(13)}},{props:{size:"large",variant:"text"},style:{padding:"8px 11px",fontSize:e.typography.pxToRem(15)}},{props:{size:"small",variant:"outlined"},style:{padding:"3px 9px",fontSize:e.typography.pxToRem(13)}},{props:{size:"large",variant:"outlined"},style:{padding:"7px 21px",fontSize:e.typography.pxToRem(15)}},{props:{size:"small",variant:"contained"},style:{padding:"4px 10px",fontSize:e.typography.pxToRem(13)}},{props:{size:"large",variant:"contained"},style:{padding:"8px 22px",fontSize:e.typography.pxToRem(15)}},{props:{disableElevation:!0},style:{boxShadow:"none","&:hover":{boxShadow:"none"},[`&.${Ec.focusVisible}`]:{boxShadow:"none"},"&:active":{boxShadow:"none"},[`&.${Ec.disabled}`]:{boxShadow:"none"}}},{props:{fullWidth:!0},style:{width:"100%"}},{props:{loadingPosition:"center"},style:{transition:e.transitions.create(["background-color","box-shadow","border-color"],{duration:e.transitions.duration.short}),[`&.${Ec.loading}`]:{color:"transparent"}}}]}})),ECe=Ye("span",{name:"MuiButton",slot:"StartIcon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.startIcon,n.loading&&t.startIconLoadingStart,t[`iconSize${Ze(n.size)}`]]}})(({theme:e})=>({display:"inherit",marginRight:8,marginLeft:-4,variants:[{props:{size:"small"},style:{marginLeft:-2}},{props:{loadingPosition:"start",loading:!0},style:{transition:e.transitions.create(["opacity"],{duration:e.transitions.duration.short}),opacity:0}},{props:{loadingPosition:"start",loading:!0,fullWidth:!0},style:{marginRight:-8}},...Q7]})),xCe=Ye("span",{name:"MuiButton",slot:"EndIcon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.endIcon,n.loading&&t.endIconLoadingEnd,t[`iconSize${Ze(n.size)}`]]}})(({theme:e})=>({display:"inherit",marginRight:-4,marginLeft:8,variants:[{props:{size:"small"},style:{marginRight:-2}},{props:{loadingPosition:"end",loading:!0},style:{transition:e.transitions.create(["opacity"],{duration:e.transitions.duration.short}),opacity:0}},{props:{loadingPosition:"end",loading:!0,fullWidth:!0},style:{marginLeft:-8}},...Q7]})),SCe=Ye("span",{name:"MuiButton",slot:"LoadingIndicator"})(({theme:e})=>({display:"none",position:"absolute",visibility:"visible",variants:[{props:{loading:!0},style:{display:"flex"}},{props:{loadingPosition:"start"},style:{left:14}},{props:{loadingPosition:"start",size:"small"},style:{left:10}},{props:{variant:"text",loadingPosition:"start"},style:{left:6}},{props:{loadingPosition:"center"},style:{left:"50%",transform:"translate(-50%)",color:(e.vars||e).palette.action.disabled}},{props:{loadingPosition:"end"},style:{right:14}},{props:{loadingPosition:"end",size:"small"},style:{right:10}},{props:{variant:"text",loadingPosition:"end"},style:{right:6}},{props:{loadingPosition:"start",fullWidth:!0},style:{position:"relative",left:-10}},{props:{loadingPosition:"end",fullWidth:!0},style:{position:"relative",right:-10}}]})),p3=Ye("span",{name:"MuiButton",slot:"LoadingIconPlaceholder"})({display:"inline-block",width:"1em",height:"1em"}),Br=A.forwardRef(function(e,t){const n=A.useContext(gCe),r=A.useContext(yCe),o=am(n,e),a=sn({props:o,name:"MuiButton"}),{children:i,color:l="primary",component:u="button",className:d,disabled:p=!1,disableElevation:h=!1,disableFocusRipple:y=!1,endIcon:g,focusVisibleClassName:b,fullWidth:x=!1,id:S,loading:E=null,loadingIndicator:_,loadingPosition:C="center",size:R="medium",startIcon:O,type:I,variant:F="text",...H}=a,z=up(S),L=_??v.jsx(gF,{"aria-labelledby":z,color:"inherit",size:16}),$={...a,color:l,component:u,disabled:p,disableElevation:h,disableFocusRipple:y,fullWidth:x,loading:E,loadingIndicator:L,loadingPosition:C,size:R,type:I,variant:F},k=bCe($),M=(O||E&&C==="start")&&v.jsx(ECe,{className:k.startIcon,ownerState:$,children:O||v.jsx(p3,{className:k.loadingIconPlaceholder,ownerState:$})}),j=(g||E&&C==="end")&&v.jsx(xCe,{className:k.endIcon,ownerState:$,children:g||v.jsx(p3,{className:k.loadingIconPlaceholder,ownerState:$})}),V=r||"",B=typeof E=="boolean"?v.jsx("span",{className:k.loadingWrapper,style:{display:"contents"},children:E&&v.jsx(SCe,{className:k.loadingIndicator,ownerState:$,children:L})}):null;return v.jsxs(vCe,{ownerState:$,className:Tt(n.className,k.root,d,V),component:u,disabled:p||E,focusRipple:!y,focusVisibleClassName:Tt(k.focusVisible,b),ref:t,type:I,id:E?z:S,...H,classes:k,children:[M,C!=="end"&&B,i,C==="end"&&B,j]})});function TCe(e){return en("MuiDialog",e)}const FS=Wt("MuiDialog",["root","scrollPaper","scrollBody","container","paper","paperScrollPaper","paperScrollBody","paperWidthFalse","paperWidthXs","paperWidthSm","paperWidthMd","paperWidthLg","paperWidthXl","paperFullWidth","paperFullScreen"]),X7=A.createContext({}),CCe=Ye(xF,{name:"MuiDialog",slot:"Backdrop",overrides:(e,t)=>t.backdrop})({zIndex:-1}),ACe=e=>{const{classes:t,scroll:n,maxWidth:r,fullWidth:o,fullScreen:a}=e,i={root:["root"],container:["container",`scroll${Ze(n)}`],paper:["paper",`paperScroll${Ze(n)}`,`paperWidth${Ze(String(r))}`,o&&"paperFullWidth",a&&"paperFullScreen"]};return Jt(i,TCe,t)},_Ce=Ye(SF,{name:"MuiDialog",slot:"Root"})({"@media print":{position:"absolute !important"}}),kCe=Ye("div",{name:"MuiDialog",slot:"Container",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.container,t[`scroll${Ze(n.scroll)}`]]}})({height:"100%","@media print":{height:"auto"},outline:0,variants:[{props:{scroll:"paper"},style:{display:"flex",justifyContent:"center",alignItems:"center"}},{props:{scroll:"body"},style:{overflowY:"auto",overflowX:"hidden",textAlign:"center","&::after":{content:'""',display:"inline-block",verticalAlign:"middle",height:"100%",width:"0"}}}]}),wCe=Ye(gp,{name:"MuiDialog",slot:"Paper",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.paper,t[`scrollPaper${Ze(n.scroll)}`],t[`paperWidth${Ze(String(n.maxWidth))}`],n.fullWidth&&t.paperFullWidth,n.fullScreen&&t.paperFullScreen]}})(hn(({theme:e})=>({margin:32,position:"relative",overflowY:"auto","@media print":{overflowY:"visible",boxShadow:"none"},variants:[{props:{scroll:"paper"},style:{display:"flex",flexDirection:"column",maxHeight:"calc(100% - 64px)"}},{props:{scroll:"body"},style:{display:"inline-block",verticalAlign:"middle",textAlign:"initial"}},{props:({ownerState:t})=>!t.maxWidth,style:{maxWidth:"calc(100% - 64px)"}},{props:{maxWidth:"xs"},style:{maxWidth:e.breakpoints.unit==="px"?Math.max(e.breakpoints.values.xs,444):`max(${e.breakpoints.values.xs}${e.breakpoints.unit}, 444px)`,[`&.${FS.paperScrollBody}`]:{[e.breakpoints.down(Math.max(e.breakpoints.values.xs,444)+64)]:{maxWidth:"calc(100% - 64px)"}}}},...Object.keys(e.breakpoints.values).filter(t=>t!=="xs").map(t=>({props:{maxWidth:t},style:{maxWidth:`${e.breakpoints.values[t]}${e.breakpoints.unit}`,[`&.${FS.paperScrollBody}`]:{[e.breakpoints.down(e.breakpoints.values[t]+64)]:{maxWidth:"calc(100% - 64px)"}}}})),{props:({ownerState:t})=>t.fullWidth,style:{width:"calc(100% - 64px)"}},{props:({ownerState:t})=>t.fullScreen,style:{margin:0,width:"100%",maxWidth:"100%",height:"100%",maxHeight:"none",borderRadius:0,[`&.${FS.paperScrollBody}`]:{margin:0,maxWidth:"100%"}}}]}))),Bs=A.forwardRef(function(e,t){const n=sn({props:e,name:"MuiDialog"}),r=dp(),o={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{"aria-describedby":a,"aria-labelledby":i,"aria-modal":l=!0,BackdropComponent:u,BackdropProps:d,children:p,className:h,disableEscapeKeyDown:y=!1,fullScreen:g=!1,fullWidth:b=!1,maxWidth:x="sm",onClick:S,onClose:E,open:_,PaperComponent:C=gp,PaperProps:R={},scroll:O="paper",slots:I={},slotProps:F={},TransitionComponent:H=pC,transitionDuration:z=o,TransitionProps:L,...$}=n,k={...n,disableEscapeKeyDown:y,fullScreen:g,fullWidth:b,maxWidth:x,scroll:O},M=ACe(k),j=A.useRef(),V=Ue=>{j.current=Ue.target===Ue.currentTarget},B=Ue=>{S&&S(Ue),j.current&&(j.current=null,E&&E(Ue,"backdropClick"))},q=up(i),Y=A.useMemo(()=>({titleId:q}),[q]),ee={transition:H,...I},N={transition:L,paper:R,backdrop:d,...F},W={slots:ee,slotProps:N},[K,P]=xn("root",{elementType:_Ce,shouldForwardComponentProp:!0,externalForwardedProps:W,ownerState:k,className:Tt(M.root,h),ref:t}),[Z,ae]=xn("backdrop",{elementType:CCe,shouldForwardComponentProp:!0,externalForwardedProps:W,ownerState:k}),[J,pe]=xn("paper",{elementType:wCe,shouldForwardComponentProp:!0,externalForwardedProps:W,ownerState:k,className:Tt(M.paper,R.className)}),[le,Ee]=xn("container",{elementType:kCe,externalForwardedProps:W,ownerState:k,className:M.container}),[Te,Ae]=xn("transition",{elementType:pC,externalForwardedProps:W,ownerState:k,additionalProps:{appear:!0,in:_,timeout:z,role:"presentation"}});return v.jsx(K,{closeAfterTransition:!0,slots:{backdrop:Z},slotProps:{backdrop:{transitionDuration:z,as:u,...ae}},disableEscapeKeyDown:y,onClose:E,open:_,onClick:B,...P,...$,children:v.jsx(Te,{...Ae,children:v.jsx(le,{onMouseDown:V,...Ee,children:v.jsx(J,{as:C,elevation:24,role:"dialog","aria-describedby":a,"aria-labelledby":q,"aria-modal":l,...pe,children:v.jsx(X7.Provider,{value:Y,children:p})})})})})});function RCe(e){return en("MuiDialogActions",e)}Wt("MuiDialogActions",["root","spacing"]);const DCe=e=>{const{classes:t,disableSpacing:n}=e;return Jt({root:["root",!n&&"spacing"]},RCe,t)},ICe=Ye("div",{name:"MuiDialogActions",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,!n.disableSpacing&&t.spacing]}})({display:"flex",alignItems:"center",padding:8,justifyContent:"flex-end",flex:"0 0 auto",variants:[{props:({ownerState:e})=>!e.disableSpacing,style:{"& > :not(style) ~ :not(style)":{marginLeft:8}}}]}),Us=A.forwardRef(function(e,t){const n=sn({props:e,name:"MuiDialogActions"}),{className:r,disableSpacing:o=!1,...a}=n,i={...n,disableSpacing:o},l=DCe(i);return v.jsx(ICe,{className:Tt(l.root,r),ownerState:i,ref:t,...a})});function OCe(e){return en("MuiDialogContent",e)}Wt("MuiDialogContent",["root","dividers"]);function NCe(e){return en("MuiDialogTitle",e)}const PCe=Wt("MuiDialogTitle",["root"]),LCe=e=>{const{classes:t,dividers:n}=e;return Jt({root:["root",n&&"dividers"]},OCe,t)},MCe=Ye("div",{name:"MuiDialogContent",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.dividers&&t.dividers]}})(hn(({theme:e})=>({flex:"1 1 auto",WebkitOverflowScrolling:"touch",overflowY:"auto",padding:"20px 24px",variants:[{props:({ownerState:t})=>t.dividers,style:{padding:"16px 24px",borderTop:`1px solid ${(e.vars||e).palette.divider}`,borderBottom:`1px solid ${(e.vars||e).palette.divider}`}},{props:({ownerState:t})=>!t.dividers,style:{[`.${PCe.root} + &`]:{paddingTop:0}}}]}))),zs=A.forwardRef(function(e,t){const n=sn({props:e,name:"MuiDialogContent"}),{className:r,dividers:o=!1,...a}=n,i={...n,dividers:o},l=LCe(i);return v.jsx(MCe,{className:Tt(l.root,r),ownerState:i,ref:t,...a})});function FCe(e){return en("MuiTypography",e)}Wt("MuiTypography",["root","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"]);const jCe={primary:!0,secondary:!0,error:!0,info:!0,success:!0,warning:!0,textPrimary:!0,textSecondary:!0,textDisabled:!0},BCe=tie(),UCe=e=>{const{align:t,gutterBottom:n,noWrap:r,paragraph:o,variant:a,classes:i}=e,l={root:["root",a,e.align!=="inherit"&&`align${Ze(t)}`,n&&"gutterBottom",r&&"noWrap",o&&"paragraph"]};return Jt(l,FCe,i)},zCe=Ye("span",{name:"MuiTypography",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.variant&&t[n.variant],n.align!=="inherit"&&t[`align${Ze(n.align)}`],n.noWrap&&t.noWrap,n.gutterBottom&&t.gutterBottom,n.paragraph&&t.paragraph]}})(hn(({theme:e})=>({margin:0,variants:[{props:{variant:"inherit"},style:{font:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}},...Object.entries(e.typography).filter(([t,n])=>t!=="inherit"&&n&&typeof n=="object").map(([t,n])=>({props:{variant:t},style:n})),...Object.entries(e.palette).filter(ko()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}})),...Object.entries(e.palette?.text||{}).filter(([,t])=>typeof t=="string").map(([t])=>({props:{color:`text${Ze(t)}`},style:{color:(e.vars||e).palette.text[t]}})),{props:({ownerState:t})=>t.align!=="inherit",style:{textAlign:"var(--Typography-textAlign)"}},{props:({ownerState:t})=>t.noWrap,style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},{props:({ownerState:t})=>t.gutterBottom,style:{marginBottom:"0.35em"}},{props:({ownerState:t})=>t.paragraph,style:{marginBottom:16}}]}))),f3={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},Jm=A.forwardRef(function(e,t){const{color:n,...r}=sn({props:e,name:"MuiTypography"}),o=!jCe[n],a=BCe({...r,...o&&{color:n}}),{align:i="inherit",className:l,component:u,gutterBottom:d=!1,noWrap:p=!1,paragraph:h=!1,variant:y="body1",variantMapping:g=f3,...b}=a,x={...a,align:i,color:n,className:l,component:u,gutterBottom:d,noWrap:p,paragraph:h,variant:y,variantMapping:g},S=u||(h?"p":g[y]||f3[y])||"span",E=UCe(x);return v.jsx(zCe,{as:S,ref:t,className:Tt(E.root,l),...b,ownerState:x,style:{...i!=="inherit"&&{"--Typography-textAlign":i},...b.style}})});function $Ce(e){return en("MuiDialogContentText",e)}Wt("MuiDialogContentText",["root"]);const HCe=e=>{const{classes:t}=e,n=Jt({root:["root"]},$Ce,t);return{...t,...n}},VCe=Ye(Jm,{shouldForwardProp:e=>Do(e)||e==="classes",name:"MuiDialogContentText",slot:"Root"})({}),Ap=A.forwardRef(function(e,t){const n=sn({props:e,name:"MuiDialogContentText"}),{children:r,className:o,...a}=n,i=HCe(a);return v.jsx(VCe,{component:"p",variant:"body1",color:"textSecondary",ref:t,ownerState:a,className:Tt(i.root,o),...n,classes:i})}),GCe=e=>{const{classes:t}=e;return Jt({root:["root"]},NCe,t)},qCe=Ye(Jm,{name:"MuiDialogTitle",slot:"Root"})({padding:"16px 24px",flex:"0 0 auto"}),$s=A.forwardRef(function(e,t){const n=sn({props:e,name:"MuiDialogTitle"}),{className:r,id:o,...a}=n,i=n,l=GCe(i),{titleId:u=o}=A.useContext(X7);return v.jsx(qCe,{component:"h2",className:Tt(l.root,r),ownerState:i,ref:t,variant:"h6",id:o??u,...a})}),h3=Wt("MuiDivider",["root","absolute","fullWidth","inset","middle","flexItem","light","vertical","withChildren","withChildrenVertical","textAlignRight","textAlignLeft","wrapper","wrapperVertical"]),m3=Wt("MuiListItemIcon",["root","alignItemsFlexStart"]),g3=Wt("MuiListItemText",["root","multiline","dense","inset","primary","secondary"]);function WCe(e){return en("MuiMenuItem",e)}const Zf=Wt("MuiMenuItem",["root","focusVisible","dense","disabled","divider","gutters","selected"]),YCe=(e,t)=>{const{ownerState:n}=e;return[t.root,n.dense&&t.dense,n.divider&&t.divider,!n.disableGutters&&t.gutters]},KCe=e=>{const{disabled:t,dense:n,divider:r,disableGutters:o,selected:a,classes:i}=e,l=Jt({root:["root",n&&"dense",t&&"disabled",!o&&"gutters",r&&"divider",a&&"selected"]},WCe,i);return{...i,...l}},QCe=Ye(Kd,{shouldForwardProp:e=>Do(e)||e==="classes",name:"MuiMenuItem",slot:"Root",overridesResolver:YCe})(hn(({theme:e})=>({...e.typography.body1,display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minHeight:48,paddingTop:6,paddingBottom:6,boxSizing:"border-box",whiteSpace:"nowrap","&:hover":{textDecoration:"none",backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${Zf.selected}`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,(e.vars||e).palette.action.selectedOpacity),[`&.${Zf.focusVisible}`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.focusOpacity}`)}},[`&.${Zf.selected}:hover`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.hoverOpacity}`),"@media (hover: none)":{backgroundColor:e.alpha((e.vars||e).palette.primary.main,(e.vars||e).palette.action.selectedOpacity)}},[`&.${Zf.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${Zf.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity},[`& + .${h3.root}`]:{marginTop:e.spacing(1),marginBottom:e.spacing(1)},[`& + .${h3.inset}`]:{marginLeft:52},[`& .${g3.root}`]:{marginTop:0,marginBottom:0},[`& .${g3.inset}`]:{paddingLeft:36},[`& .${m3.root}`]:{minWidth:36},variants:[{props:({ownerState:t})=>!t.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:t})=>t.divider,style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,backgroundClip:"padding-box"}},{props:({ownerState:t})=>!t.dense,style:{[e.breakpoints.up("sm")]:{minHeight:"auto"}}},{props:({ownerState:t})=>t.dense,style:{minHeight:32,paddingTop:4,paddingBottom:4,...e.typography.body2,[`& .${m3.root} svg`]:{fontSize:"1.25rem"}}}]}))),Z7=A.forwardRef(function(e,t){const n=sn({props:e,name:"MuiMenuItem"}),{autoFocus:r=!1,component:o="li",dense:a=!1,divider:i=!1,disableGutters:l=!1,focusVisibleClassName:u,role:d="menuitem",tabIndex:p,className:h,...y}=n,g=A.useContext(uC),b=A.useMemo(()=>({dense:a||g.dense||!1,disableGutters:l}),[g.dense,a,l]),x=A.useRef(null);Gi(()=>{r&&x.current&&x.current.focus()},[r]);const S={...n,dense:b.dense,divider:i,disableGutters:l},E=KCe(n),_=sr(x,t);let C;return n.disabled||(C=p!==void 0?p:-1),v.jsx(uC.Provider,{value:b,children:v.jsx(QCe,{ref:_,role:d,tabIndex:C,component:o,focusVisibleClassName:Tt(E.focusVisible,u),className:Tt(E.root,h),...y,ownerState:S,classes:E})})}),Rb={postgres:[{label:"Host",name:"host",type:"text"},{label:"Port",name:"port",type:"number"},{label:"Database Name",name:"databaseName",type:"text"},{label:"User Name",name:"userName",type:"text"},{label:"Password",name:"password",type:"password"},{label:"Connection String",name:"connectionString",type:"text"}],bigquery:[{label:"Project ID",name:"defaultProjectId",type:"text"},{label:"Billing Project ID",name:"billingProjectId",type:"text"},{label:"Location",name:"location",type:"text"},{label:"Service Account Key JSON",name:"serviceAccountKeyJson",type:"text"},{label:"Maximum Bytes Billed",name:"maximumBytesBilled",type:"text"},{label:"Query Timeout Milliseconds",name:"queryTimeoutMilliseconds",type:"text"}],snowflake:[{label:"Account",name:"account",type:"text"},{label:"Username",name:"username",type:"text"},{label:"Password",name:"password",type:"password"},{label:"Role",name:"role",type:"text"},{label:"Warehouse",name:"warehouse",type:"text"},{label:"Database",name:"database",type:"text"},{label:"Schema",name:"schema",type:"text"},{label:"Response Timeout Milliseconds",name:"responseTimeoutMilliseconds",type:"text"}],trino:[{label:"Server",name:"server",type:"text"},{label:"Port",name:"port",type:"number"},{label:"Catalog",name:"catalog",type:"text"},{label:"Schema",name:"schema",type:"text"},{label:"User",name:"user",type:"text"},{label:"Password",name:"password",type:"password"},{label:"Peaka Key",name:"peakaKey",type:"password"}],mysql:[{label:"Host",name:"host",type:"text"},{label:"Port",name:"port",type:"number"},{label:"User",name:"user",type:"text"},{label:"Password",name:"password",type:"password"},{label:"Database",name:"database",type:"text"}],duckdb:[],motherduck:[{label:"Access Token",name:"accessToken",type:"text"},{label:"Database",name:"database",type:"text"}]},jS={postgres:"postgresConnection",bigquery:"bigqueryConnection",snowflake:"snowflakeConnection",trino:"trinoConnection",mysql:"mysqlConnection",duckdb:"duckdbConnection",motherduck:"motherduckConnection"};function XCe({onSubmit:e,isSubmitting:t}){const[n,r]=A.useState(!1),[o,a]=A.useState("postgres"),i=()=>{r(!0)},l=()=>{r(!1)},u=async d=>{d.preventDefault();const p=new FormData(d.currentTarget),h=p.get("name")?.toString(),y=p.get("type")?.toString(),g=Rb[y];if(!h)throw new Error("Name is required");if(!y)throw new Error("Type is required");const b={name:h,type:y,[{postgres:"postgresConnection",bigquery:"bigqueryConnection",snowflake:"snowflakeConnection",trino:"trinoConnection",mysql:"mysqlConnection",motherduck:"motherduckConnection"}[y]]:g.reduce((x,S)=>(x[S.name]=p.get(S.name)?.toString(),x),{})};await e(b),l()};return v.jsxs(Qe.Fragment,{children:[v.jsx(Br,{variant:"outlined",onClick:i,children:"Add Connection"}),v.jsxs(Bs,{open:n,onClose:l,children:[v.jsx($s,{children:"Create New Connection"}),v.jsxs(zs,{children:[v.jsx(Ap,{children:"Add a new connection to query your data database using Malloy."}),v.jsxs("form",{onSubmit:u,id:"connection-form",children:[v.jsx(bo,{autoFocus:!0,required:!0,margin:"dense",id:"name",name:"name",label:"Connection Name",type:"text",fullWidth:!0,variant:"standard"}),v.jsx(bo,{margin:"dense",id:"type",name:"type",label:"Connection Type",fullWidth:!0,variant:"standard",value:o,select:!0,onChange:d=>a(d.target.value),children:Object.values(r4).map(d=>v.jsx(Z7,{value:d,children:d},d))}),Rb[o].map(d=>v.jsx(bo,{margin:"dense",id:d.name,name:d.name,label:d.label,type:d.type,fullWidth:!0,variant:"standard"},d.name))]})]}),v.jsxs(Us,{children:[v.jsx(Br,{disabled:t,onClick:l,children:"Cancel"}),v.jsx(Br,{type:"submit",form:"connection-form",loading:t,children:"Create Connection"})]})]})]})}function ZCe({connection:e,onCloseDialog:t,isMutating:n,onDelete:r}){const[o,a]=A.useState(!1),[i,l]=A.useState(""),u=()=>{a(!0)},d=()=>{a(!1),t()};return v.jsxs(Qe.Fragment,{children:[v.jsx(Qd,{onClick:p=>{p.stopPropagation(),u()},children:v.jsx(jA,{})}),v.jsxs(Bs,{onClose:d,"aria-labelledby":"customized-dialog-title",open:o,children:[v.jsx($s,{sx:{m:0,p:2},id:"customized-dialog-title",children:"Delete Connection"}),v.jsx(Qd,{"aria-label":"close",onClick:d,sx:p=>({position:"absolute",right:8,top:8,color:p.palette.grey[500]}),children:v.jsx(Vl,{})}),v.jsx(zs,{dividers:!0,children:v.jsxs(Jm,{gutterBottom:!0,children:['Are you sure you want to delete "',e.name,'"? This action cannot be undone.']})}),v.jsx(Us,{children:v.jsx(Br,{loading:n,variant:"contained",autoFocus:!0,onClick:()=>r(),color:"error",children:"Delete"})}),v.jsx(Ls,{open:i!=="",autoHideDuration:6e3,onClose:()=>l(""),message:i})]})]})}function JCe({connection:e,onSubmit:t,isSubmitting:n}){const[r,o]=A.useState(!1),[a,i]=A.useState(e.type),l=()=>{o(!0)},u=()=>{o(!1)},d=async p=>{p.preventDefault();const h=new FormData(p.currentTarget),y=h.get("name")?.toString(),g=h.get("type")?.toString(),b=Rb[g];if(!y)throw new Error("Name is required");if(!g)throw new Error("Type is required");const x={name:y,type:g,[jS[g]]:b.reduce((S,E)=>(S[E.name]=h.get(E.name)?.toString()??e[jS[g]][E.name],S),{})};await t(x),u()};return v.jsxs(Qe.Fragment,{children:[v.jsx(ir,{onClick:p=>{p.preventDefault(),p.stopPropagation(),l()},children:v.jsx(BA,{})}),v.jsxs(Bs,{open:r,onClose:u,children:[v.jsx($s,{onClick:p=>{p.stopPropagation()},children:"Edit Connection"}),v.jsxs(zs,{onClick:p=>{p.stopPropagation()},children:[v.jsx(Ap,{children:"Edit a connection to query your data database using Malloy."}),v.jsxs("form",{onSubmit:d,id:"connection-form",children:[v.jsx(bo,{autoFocus:!0,required:!0,margin:"dense",id:"name",name:"name",label:"Connection Name",type:"text",fullWidth:!0,variant:"standard",value:e.name,defaultValue:e.name}),v.jsx(bo,{margin:"dense",id:"type",name:"type",label:"Connection Type",fullWidth:!0,variant:"standard",value:a,select:!0,onChange:p=>i(p.target.value),children:Object.values(r4).map(p=>v.jsx(Z7,{value:p,children:p},p))}),Rb[a].map(p=>v.jsx(bo,{margin:"dense",id:p.name,name:p.name,label:p.label,type:p.type,fullWidth:!0,variant:"standard",defaultValue:e?.[jS[a]??""]?.[p.name??""]??""},p.name))]})]}),v.jsxs(Us,{onClick:p=>{p.stopPropagation()},children:[v.jsx(Br,{disabled:n,onClick:u,children:"Cancel"}),v.jsx(Br,{type:"submit",form:"connection-form",loading:n,children:"Edit Connection"})]})]})]})}function eAe({connectionName:e,resourceUri:t,schema:n}){const{apiClients:r}=Zn(),{projectName:o}=yr(t),[a,i]=Qe.useState(void 0),[l,u]=Qe.useState(n||null),[d,p]=Qe.useState(!1),{data:h,isError:y,isLoading:g,error:b}=Zo({queryKey:["schemas",o,e],queryFn:()=>r.connections.listSchemas(o,e)}),x=h?.data||[];return v.jsxs(Ar,{container:!0,spacing:1,children:[!n&&v.jsx(Ar,{size:{xs:12,md:4},children:v.jsxs(Ol,{sx:{p:1,m:0},children:[v.jsxs(It,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:0},children:[v.jsx(ct,{variant:"overline",fontWeight:"bold",children:"Table Paths"}),v.jsx(iQ,{control:v.jsx(XX,{checked:d,onChange:S=>p(S.target.checked)}),label:"Hidden Schemas"})]}),v.jsx(Hi,{sx:{mt:"2px"}}),v.jsxs(It,{sx:{mt:"2px",maxHeight:"600px",overflowY:"auto"},children:[g&&v.jsx(Ko,{text:"Loading schemas..."}),y&&v.jsx(Xo,{error:b,context:`${o} > ${e} > Schemas`}),!g&&!y&&x.length===0&&v.jsx(ct,{variant:"body2",children:"No Schemas"}),!g&&!y&&x.length>0&&v.jsx(tv,{dense:!0,disablePadding:!0,children:x.map(S=>{const E=S.name;return S.isHidden&&!d?null:v.jsx(dM,{selected:l===E,onClick:()=>{u(E),i(void 0)},children:v.jsx(As,{primary:E})},E)})})]})]})}),v.jsx(Ar,{size:{xs:12,md:n?6:4},children:l&&v.jsx(Ol,{sx:{p:1,m:0},children:v.jsx(nAe,{connectionName:e,schemaName:l,onTableClick:S=>{i(S)},resourceUri:t})})}),v.jsx(Ar,{size:{xs:12,md:n?6:4},children:a&&v.jsx(Ol,{sx:{p:1,m:0},children:v.jsx(tAe,{table:a})})})]})}function tAe({table:e}){return v.jsxs(v.Fragment,{children:[v.jsxs(ct,{variant:"overline",fontWeight:"bold",children:["Schema: ",e.resource]}),v.jsx(Hi,{}),v.jsx(It,{sx:{mt:"10px",maxHeight:"600px",overflowY:"auto"},children:v.jsx(EM,{children:v.jsxs($0,{size:"small",sx:{"& .MuiTableCell-root":{padding:"10px"}},children:[v.jsx(xM,{children:v.jsxs(_l,{children:[v.jsx(Xr,{children:"NAME"}),v.jsx(Xr,{children:"TYPE"})]})}),v.jsx(H0,{children:e.columns?.sort((t,n)=>t.name.localeCompare(n.name))?.map(t=>v.jsxs(_l,{children:[v.jsx(Xr,{children:t.name}),v.jsx(Xr,{children:t.type})]},t.name))})]})})})]})}function nAe({connectionName:e,schemaName:t,onTableClick:n,resourceUri:r}){const{projectName:o}=yr(r),{apiClients:a}=Zn(),[i,l]=A.useState(""),{data:u,isSuccess:d,isError:p,error:h,isLoading:y}=Zo({queryKey:["tablesInSchema",o,e,t],queryFn:()=>a.connections.listTables(o,e,t)}),g=d&&u?.data?u.data.filter(b=>(b.resource.split(".").pop()?.toLowerCase()||"").includes(i.toLowerCase())).sort((b,x)=>{const S=b.resource.split(".").pop()||b.resource,E=x.resource.split(".").pop()||x.resource;return S.localeCompare(E)}):[];return v.jsxs(v.Fragment,{children:[v.jsxs(ct,{variant:"overline",fontWeight:"bold",children:["Tables in ",t]}),v.jsx(Hi,{}),v.jsx(It,{sx:{mt:1,mb:1},children:v.jsx(TZ,{size:"small",fullWidth:!0,placeholder:"Search tables...",value:i,onChange:b=>l(b.target.value),variant:"outlined"})}),v.jsx(Hi,{}),v.jsxs(It,{sx:{mt:"2px",maxHeight:"600px",overflowY:"auto"},children:[y&&v.jsx(Ko,{text:"Fetching Tables..."}),p&&v.jsx(Xo,{error:h,context:`${o} > ${e} > ${t}`}),d&&g.length===0&&v.jsx(ct,{variant:"body2",children:"No Tables"}),d&&u?.data&&u.data.length>0&&v.jsx(tv,{dense:!0,disablePadding:!0,children:g.map(b=>{const x=b.resource.split(".").pop()||b.resource;return v.jsx(dM,{onClick:()=>n(b),children:v.jsx(As,{primary:x,secondary:`${b.columns.length} columns`})},b.resource)})})]})]})}function rAe({connection:e,onClick:t,onEdit:n,onDelete:r,isMutating:o,mutable:a}){return v.jsxs(_l,{sx:{"&:hover":{backgroundColor:"action.hover"}},children:[v.jsx(Xr,{sx:{cursor:"pointer",flexGrow:1},onClick:t,children:v.jsxs(It,{sx:{display:"flex",alignItems:"center",gap:1},children:[v.jsx(ct,{variant:"body2",children:e.name}),v.jsx(im,{sx:{fontSize:"1rem",color:"action.active",opacity:.7}})]})}),v.jsx(Xr,{sx:{minWidth:"120px"},children:v.jsx(ct,{variant:"body2",children:e.type})}),a&&v.jsxs(Xr,{sx:{minWidth:"120px"},children:[v.jsx(JCe,{connection:e,onSubmit:n,isSubmitting:o}),v.jsx(ZCe,{connection:e,onCloseDialog:()=>{},isMutating:o,onDelete:()=>r(e)})]})]},e.name)}function oAe({resourceUri:e}){const{apiClients:t,mutable:n}=Zn(),r=Ms(),{projectName:o}=yr(e),[a,i]=A.useState(""),[l,u]=A.useState(null),d=d_({projectName:o,connectionName:l}),{data:p,isSuccess:h,isError:y,error:g}=Zo({queryKey:["connections",o],queryFn:()=>t.connections.listConnections(o)}),b=C=>{u(C)},x=()=>{u(null)},S=Ui({mutationFn:C=>t.projects.updateProject(o,{name:o,connections:[...p.data,C]}),onSuccess(){i("Connection added successfully"),r.invalidateQueries({queryKey:["connections",o]})},onError(C){i(C.message)}}),E=Ui({mutationFn:C=>t.projects.updateProject(o,{name:o,connections:p.data.map(R=>R.name===C.name?C:R)}),onSuccess(C,R){i(`Connection ${R.name} updated successfully`),r.invalidateQueries({queryKey:["connections",o]})},onError(C){i(C.message)}}),_=Ui({mutationFn:C=>t.projects.updateProject(o,{name:o,connections:p.data.filter(R=>R.name!==C.name)}),onSuccess(C,R){i(`Connection ${R.name} deleted successfully`),r.invalidateQueries({queryKey:["connections",o]})},onError(C){i(C.message)}});return v.jsxs(v.Fragment,{children:[v.jsx(Kl,{children:v.jsxs(Ql,{children:[v.jsx(cu,{children:"Database Connections"}),v.jsxs(It,{sx:{mb:1,maxHeight:"200px",overflowY:"auto"},children:[!h&&!y&&v.jsx(ct,{variant:"body2",sx:{m:"auto"},children:"Fetching Connections..."}),h&&p.data.length>0&&v.jsx($0,{size:"small",sx:{borderCollapse:"collapse","& .MuiTableRow-root":{display:"flex",width:"100%"},"& .MuiTableCell-root":{borderBottom:"1px solid #e0e0e0",display:"flex",alignItems:"center"},"& .MuiTableRow-root:last-child .MuiTableCell-root":{borderBottom:"none"}},children:v.jsxs(H0,{children:[v.jsxs(_l,{children:[v.jsx(Xr,{sx:{flexGrow:1},children:v.jsx(ct,{variant:"body2",fontWeight:"500",color:"text.secondary",children:"Connection Name"})}),v.jsx(Xr,{sx:{minWidth:"120px"},children:v.jsx(ct,{variant:"body2",fontWeight:"500",color:"text.secondary",children:"Type"})}),n&&v.jsx(Xr,{sx:{minWidth:"120px"},children:v.jsx(ct,{variant:"body2",fontWeight:"500",color:"text.secondary",sx:{mx:"auto"},children:"Actions"})})]}),p.data.map(C=>v.jsx(rAe,{connection:C,onClick:()=>b(C.name),onEdit:R=>E.mutateAsync(R),onDelete:R=>{d.startsWith("publisher:")?i("Cannot delete this connection (publisher: resource)"):_.mutateAsync(R)},isMutating:E.isPending||_.isPending,mutable:n},C.name))]})}),h&&p.data.length===0&&v.jsx(ct,{variant:"body2",children:"No Connections"}),y&&v.jsx(Xo,{error:g,context:`${o} > Connections`})]}),n&&v.jsx(It,{sx:{display:"flex",justifyContent:"flex-end"},children:v.jsx(XCe,{onSubmit:C=>S.mutateAsync(C),isSubmitting:S.isPending})})]})}),v.jsx(Ls,{open:a!=="",autoHideDuration:6e3,onClose:()=>i(""),message:a}),v.jsxs(Bl,{open:l!==null,onClose:x,maxWidth:"lg",fullWidth:!0,children:[v.jsxs(zl,{children:["Connection Explorer: ",l,v.jsx(ir,{"aria-label":"close",onClick:x,sx:{position:"absolute",right:8,top:8},children:v.jsx(It,{sx:{width:24,height:24,display:"flex",alignItems:"center",justifyContent:"center"},children:"X"})})]}),v.jsx(Ul,{children:l&&v.jsx(eAe,{resourceUri:d,connectionName:l})})]})]})}function aAe({resourceUri:e}){const{apiClients:t}=Zn(),{projectName:n,packageName:r,versionId:o}=yr(e),[a,i]=Qe.useState(!1),[l,u]=Qe.useState(null),d=S=>{u(S),i(!0)},p=()=>{i(!1),u(null)},{data:h,isError:y,error:g,isSuccess:b}=Zo({queryKey:["databases",n,r,o],queryFn:()=>t.databases.listDatabases(n,r,o)}),x=S=>S>=1024*1024*1024*1024?`${(S/(1024*1024*1024)).toFixed(2)} T`:S>=1024*1024*1024?`${(S/(1024*1024*1024)).toFixed(2)} G`:S>=1024*1024?`${(S/(1024*1024)).toFixed(2)} M`:`${(S/1024).toFixed(2)} K`;return v.jsxs(v.Fragment,{children:[v.jsx(Kl,{children:v.jsxs(Ql,{children:[v.jsx(cu,{children:"Embedded Databases"}),v.jsxs(It,{sx:{maxHeight:"200px",overflowY:"auto"},children:[!b&&!y&&v.jsx(Ko,{text:"Fetching Databases..."}),y&&v.jsx(Xo,{error:g,context:`${n} > ${r} > Databases`}),b&&h.data.length>0&&v.jsx($0,{size:"small",sx:{borderCollapse:"collapse","& .MuiTableCell-root":{borderBottom:"1px solid #e0e0e0"},"& .MuiTableRow-root:last-child .MuiTableCell-root":{borderBottom:"none"}},children:v.jsxs(H0,{children:[v.jsxs(_l,{children:[v.jsx(Xr,{children:v.jsx(ct,{variant:"body2",fontWeight:"500",color:"text.secondary",children:"Name"})}),v.jsx(Xr,{align:"right",children:v.jsx(ct,{variant:"body2",fontWeight:"500",color:"text.secondary",children:"Rows"})})]}),h.data.map(S=>v.jsxs(_l,{onClick:()=>d(S),sx:{cursor:"pointer","&:hover":{backgroundColor:"action.hover"}},children:[v.jsx(Xr,{component:"th",scope:"row",children:v.jsxs(It,{sx:{display:"flex",alignItems:"center",gap:1},children:[v.jsx(ct,{variant:"body2",children:S.path}),v.jsx(im,{sx:{fontSize:"1rem",color:"action.active",opacity:.7}})]})}),v.jsx(Xr,{align:"right",children:v.jsx(ct,{variant:"body2",children:x(S.info.rowCount)})})]},S.path))]})}),b&&h.data.length===0&&v.jsx(ct,{variant:"body2",sx:{m:"auto"},children:"No databases found"})]})]})}),v.jsxs(Bl,{open:a,onClose:p,maxWidth:"sm",fullWidth:!0,children:[v.jsxs(zl,{children:[l?.path,v.jsx(ir,{"aria-label":"close",onClick:p,sx:{position:"absolute",right:8,top:8},children:v.jsx(It,{sx:{width:24,height:24,display:"flex",alignItems:"center",justifyContent:"center"},children:"X"})})]}),v.jsx(Ul,{children:l?.info?.columns&&v.jsx(EM,{children:v.jsxs($0,{size:"small",children:[v.jsx(xM,{children:v.jsxs(_l,{children:[v.jsx(Xr,{children:"Column"}),v.jsx(Xr,{children:"Type"})]})}),v.jsx(H0,{children:l.info.columns.map(S=>v.jsxs(_l,{children:[v.jsx(Xr,{component:"th",scope:"row",children:S.name}),v.jsx(Xr,{children:S.type})]},S.name))})]})})})]})]})}function iAe(e){const{theme:t,name:n,props:r}=e;return!t||!t.components||!t.components[n]||!t.components[n].defaultProps?r:am(t.components[n].defaultProps,r)}function sAe({props:e,name:t,defaultTheme:n,themeId:r}){let o=hae(n);return o=o[r]||o,iAe({theme:o,name:t,props:e})}function lAe({props:e,name:t}){return sAe({props:e,name:t,defaultTheme:Dv,themeId:Iv})}function cAe(e){return en("MuiCollapse",e)}Wt("MuiCollapse",["root","horizontal","vertical","entered","hidden","wrapper","wrapperInner"]);const uAe=e=>{const{orientation:t,classes:n}=e,r={root:["root",`${t}`],entered:["entered"],hidden:["hidden"],wrapper:["wrapper",`${t}`],wrapperInner:["wrapperInner",`${t}`]};return Jt(r,cAe,n)},dAe=Ye("div",{name:"MuiCollapse",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.orientation],n.state==="entered"&&t.entered,n.state==="exited"&&!n.in&&n.collapsedSize==="0px"&&t.hidden]}})(hn(({theme:e})=>({height:0,overflow:"hidden",transition:e.transitions.create("height"),variants:[{props:{orientation:"horizontal"},style:{height:"auto",width:0,transition:e.transitions.create("width")}},{props:{state:"entered"},style:{height:"auto",overflow:"visible"}},{props:{state:"entered",orientation:"horizontal"},style:{width:"auto"}},{props:({ownerState:t})=>t.state==="exited"&&!t.in&&t.collapsedSize==="0px",style:{visibility:"hidden"}}]}))),pAe=Ye("div",{name:"MuiCollapse",slot:"Wrapper"})({display:"flex",width:"100%",variants:[{props:{orientation:"horizontal"},style:{width:"auto",height:"100%"}}]}),fAe=Ye("div",{name:"MuiCollapse",slot:"WrapperInner"})({width:"100%",variants:[{props:{orientation:"horizontal"},style:{width:"auto",height:"100%"}}]}),ym=A.forwardRef(function(e,t){const n=sn({props:e,name:"MuiCollapse"}),{addEndListener:r,children:o,className:a,collapsedSize:i="0px",component:l,easing:u,in:d,onEnter:p,onEntered:h,onEntering:y,onExit:g,onExited:b,onExiting:x,orientation:S="vertical",style:E,timeout:_=r6.standard,TransitionComponent:C=hi,...R}=n,O={...n,orientation:S,collapsedSize:i},I=uAe(O),F=dp(),H=Uv(),z=A.useRef(null),L=A.useRef(),$=typeof i=="number"?`${i}px`:i,k=S==="horizontal",M=k?"width":"height",j=A.useRef(null),V=sr(t,j),B=Z=>ae=>{if(Z){const J=j.current;ae===void 0?Z(J):Z(J,ae)}},q=()=>z.current?z.current[k?"clientWidth":"clientHeight"]:0,Y=B((Z,ae)=>{z.current&&k&&(z.current.style.position="absolute"),Z.style[M]=$,p&&p(Z,ae)}),ee=B((Z,ae)=>{const J=q();z.current&&k&&(z.current.style.position="");const{duration:pe,easing:le}=Xd({style:E,timeout:_,easing:u},{mode:"enter"});if(_==="auto"){const Ee=F.transitions.getAutoHeightDuration(J);Z.style.transitionDuration=`${Ee}ms`,L.current=Ee}else Z.style.transitionDuration=typeof pe=="string"?pe:`${pe}ms`;Z.style[M]=`${J}px`,Z.style.transitionTimingFunction=le,y&&y(Z,ae)}),N=B((Z,ae)=>{Z.style[M]="auto",h&&h(Z,ae)}),W=B(Z=>{Z.style[M]=`${q()}px`,g&&g(Z)}),K=B(b),P=B(Z=>{const ae=q(),{duration:J,easing:pe}=Xd({style:E,timeout:_,easing:u},{mode:"exit"});if(_==="auto"){const le=F.transitions.getAutoHeightDuration(ae);Z.style.transitionDuration=`${le}ms`,L.current=le}else Z.style.transitionDuration=typeof J=="string"?J:`${J}ms`;Z.style[M]=$,Z.style.transitionTimingFunction=pe,x&&x(Z)});return v.jsx(C,{in:d,onEnter:Y,onEntered:N,onEntering:ee,onExit:W,onExited:K,onExiting:P,addEndListener:Z=>{_==="auto"&&H.start(L.current||0,Z),r&&r(j.current,Z)},nodeRef:j,timeout:_==="auto"?null:_,...R,children:(Z,{ownerState:ae,...J})=>v.jsx(dAe,{as:l,className:Tt(I.root,a,{entered:I.entered,exited:!d&&$==="0px"&&I.hidden}[Z]),style:{[k?"minWidth":"minHeight"]:$,...E},ref:V,ownerState:{...O,state:Z},...J,children:v.jsx(pAe,{ownerState:{...O,state:Z},className:I.wrapper,ref:z,children:v.jsx(fAe,{ownerState:{...O,state:Z},className:I.wrapperInner,children:o})})})})});ym&&(ym.muiSupportAuto=!0);function hAe(e){return en("PrivateSwitchBase",e)}Wt("PrivateSwitchBase",["root","checked","disabled","input","edgeStart","edgeEnd"]);const mAe=e=>{const{classes:t,checked:n,disabled:r,edge:o}=e,a={root:["root",n&&"checked",r&&"disabled",o&&`edge${Ze(o)}`],input:["input"]};return Jt(a,hAe,t)},gAe=Ye(Kd,{name:"MuiSwitchBase"})({padding:9,borderRadius:"50%",variants:[{props:{edge:"start",size:"small"},style:{marginLeft:-3}},{props:({edge:e,ownerState:t})=>e==="start"&&t.size!=="small",style:{marginLeft:-12}},{props:{edge:"end",size:"small"},style:{marginRight:-3}},{props:({edge:e,ownerState:t})=>e==="end"&&t.size!=="small",style:{marginRight:-12}}]}),yAe=Ye("input",{name:"MuiSwitchBase",shouldForwardProp:Do})({cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}),bAe=A.forwardRef(function(e,t){const{autoFocus:n,checked:r,checkedIcon:o,defaultChecked:a,disabled:i,disableFocusRipple:l=!1,edge:u=!1,icon:d,id:p,inputProps:h,inputRef:y,name:g,onBlur:b,onChange:x,onFocus:S,readOnly:E,required:_=!1,tabIndex:C,type:R,value:O,slots:I={},slotProps:F={},...H}=e,[z,L]=kd({controlled:r,default:!!a,name:"SwitchBase",state:"checked"}),$=uu(),k=Z=>{S&&S(Z),$&&$.onFocus&&$.onFocus(Z)},M=Z=>{b&&b(Z),$&&$.onBlur&&$.onBlur(Z)},j=Z=>{if(Z.nativeEvent.defaultPrevented)return;const ae=Z.target.checked;L(ae),x&&x(Z,ae)};let V=i;$&&typeof V>"u"&&(V=$.disabled);const B=R==="checkbox"||R==="radio",q={...e,checked:z,disabled:V,disableFocusRipple:l,edge:u},Y=mAe(q),ee={slots:I,slotProps:{input:h,...F}},[N,W]=xn("root",{ref:t,elementType:gAe,className:Y.root,shouldForwardComponentProp:!0,externalForwardedProps:{...ee,component:"span",...H},getSlotProps:Z=>({...Z,onFocus:ae=>{Z.onFocus?.(ae),k(ae)},onBlur:ae=>{Z.onBlur?.(ae),M(ae)}}),ownerState:q,additionalProps:{centerRipple:!0,focusRipple:!l,disabled:V,role:void 0,tabIndex:null}}),[K,P]=xn("input",{ref:y,elementType:yAe,className:Y.input,externalForwardedProps:ee,getSlotProps:Z=>({...Z,onChange:ae=>{Z.onChange?.(ae),j(ae)}}),ownerState:q,additionalProps:{autoFocus:n,checked:r,defaultChecked:a,disabled:V,id:B?p:void 0,name:g,readOnly:E,required:_,tabIndex:C,type:R,...R==="checkbox"&&O===void 0?{}:{value:O}}});return v.jsxs(N,{...W,children:[v.jsx(K,{...P}),z?o:d]})}),vAe=On(v.jsx("path",{d:"M19 5v14H5V5h14m0-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-2z"})),EAe=On(v.jsx("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"})),xAe=On(v.jsx("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"}));function SAe(e){return en("MuiCheckbox",e)}const BS=Wt("MuiCheckbox",["root","checked","disabled","indeterminate","colorPrimary","colorSecondary","sizeSmall","sizeMedium"]),TAe=e=>{const{classes:t,indeterminate:n,color:r,size:o}=e,a={root:["root",n&&"indeterminate",`color${Ze(r)}`,`size${Ze(o)}`]},i=Jt(a,SAe,t);return{...t,...i}},CAe=Ye(bAe,{shouldForwardProp:e=>Do(e)||e==="classes",name:"MuiCheckbox",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.indeterminate&&t.indeterminate,t[`size${Ze(n.size)}`],n.color!=="default"&&t[`color${Ze(n.color)}`]]}})(hn(({theme:e})=>({color:(e.vars||e).palette.text.secondary,variants:[{props:{color:"default",disableRipple:!1},style:{"&:hover":{backgroundColor:e.alpha((e.vars||e).palette.action.active,(e.vars||e).palette.action.hoverOpacity)}}},...Object.entries(e.palette).filter(ko()).map(([t])=>({props:{color:t,disableRipple:!1},style:{"&:hover":{backgroundColor:e.alpha((e.vars||e).palette[t].main,(e.vars||e).palette.action.hoverOpacity)}}})),...Object.entries(e.palette).filter(ko()).map(([t])=>({props:{color:t},style:{[`&.${BS.checked}, &.${BS.indeterminate}`]:{color:(e.vars||e).palette[t].main},[`&.${BS.disabled}`]:{color:(e.vars||e).palette.action.disabled}}})),{props:{disableRipple:!1},style:{"&:hover":{"@media (hover: none)":{backgroundColor:"transparent"}}}}]}))),AAe=v.jsx(EAe,{}),_Ae=v.jsx(vAe,{}),kAe=v.jsx(xAe,{}),J7=A.forwardRef(function(e,t){const n=sn({props:e,name:"MuiCheckbox"}),{checkedIcon:r=AAe,color:o="primary",icon:a=_Ae,indeterminate:i=!1,indeterminateIcon:l=kAe,inputProps:u,size:d="medium",disableRipple:p=!1,className:h,slots:y={},slotProps:g={},...b}=n,x=i?l:a,S=i?l:r,E={...n,disableRipple:p,color:o,indeterminate:i,size:d},_=TAe(E),C=g.input??u,[R,O]=xn("root",{ref:t,elementType:CAe,className:Tt(_.root,h),shouldForwardComponentProp:!0,externalForwardedProps:{slots:y,slotProps:g,...b},ownerState:E,additionalProps:{type:"checkbox",icon:A.cloneElement(x,{fontSize:x.props.fontSize??d}),checkedIcon:A.cloneElement(S,{fontSize:S.props.fontSize??d}),disableRipple:p,slots:y,slotProps:{input:u6(typeof C=="function"?C(E):C,{"data-indeterminate":i})}}});return v.jsx(R,{...O,classes:_})});function ej(e){return lAe}const tj=A.createContext(null);function wAe(e){const{value:t,children:n}=e;return v.jsx(tj.Provider,{value:t,children:t.wrapRoot({children:n,instance:t.instance})})}const fu=()=>{const e=A.useContext(tj);if(e==null)throw new Error(["MUI X: Could not find the Tree View context.","It looks like you rendered your component outside of a SimpleTreeView or RichTreeView parent component.","This can also happen if you are bundling multiple versions of the Tree View."].join(`
440
+ `).length,length:ze.target.value.length}))}};return v.jsx(Tp.Provider,{value:Ke({},ee,{dispatch:N}),children:v.jsxs("div",Ke({ref:W,className:Z},B,{onClick:ve,style:Re,children:[v.jsx(u3,{hideToolbar:k,toolbarBottom:M,prefixCls:r,overflow:S,placement:"top"}),v.jsxs("div",{className:r+"-content",children:[/(edit|live)/.test(ee.preview||"")&&v.jsx(JTe,Ke({className:r+"-input",prefixCls:r,autoFocus:O},_,{onChange:ut,renderTextarea:j?.textarea||V,onScroll:ze=>le(ze,"text")})),/(live|preview)/.test(ee.preview||"")&&Ae]}),y&&!ee.fullscreen&&v.jsx(tCe,{prefixCls:r,height:ee.height,maxHeight:C,minHeight:R,onChange:pt}),v.jsx(u3,{hideToolbar:k,toolbarBottom:M,prefixCls:r,overflow:S,placement:"bottom"})]}))})}),W7=oCe;W7.Markdown=B7;function aCe({cell:e,sourceAndPaths:t,resourceUri:n,onQueryChange:r,onSourceChange:o}){const a={query:e.value,malloyResult:e.result?JSON.parse(e.result):void 0,malloyQuery:e.queryInfo?JSON.parse(e.queryInfo):void 0},i=t.findIndex(l=>l.sourceInfo.name===e.sourceName);return v.jsx(wF,{resourceUri:n,sourceAndPaths:t,selectedSourceIndex:i>=0?i:0,existingQuery:a,onQueryChange:r,onSourceChange:o})}function iCe({cell:e,editingMalloy:t,editingMarkdown:n,sourceAndPaths:r,resourceUri:o,onCellChange:a,onClose:i,onEdit:l,onDelete:u,addButtonCallback:d}){const[p,h]=A.useState(e.value),[y,g]=Qe.useState(!1),[b,x]=Qe.useState(!1),[S,E]=Qe.useState(),[_]=Qe.useState(),[C,R]=Qe.useState(m0()),[O,I]=Qe.useState(!1),[F,H]=Qe.useState(e.sourceName?r.findIndex(W=>W.sourceInfo.name===e.sourceName):0);A.useEffect(()=>{e.isMarkdown||pb(e.value,"malloy").then(W=>{E(W)})},[e]),Qe.useEffect(()=>{document.documentElement.setAttribute("data-color-mode","light")});const[z,L]=A.useState(!1),$=()=>{u(),L(!1)},k=r.length===0,M=Qe.useCallback(()=>{const W=r[F],K=W?.modelPath||e.modelPath||"",P=W?.sourceInfo.name||e.sourceName||"";a({...e,value:e.isMarkdown?p:C.query,result:C.malloyResult?JSON.stringify(C.malloyResult):void 0,queryInfo:C.malloyQuery?JSON.stringify(C.malloyQuery):void 0,sourceName:P,modelPath:K})},[e,p,C,a,F,r]),j=v.jsx(jo,{title:"Delete Cell",children:v.jsx(ir,{size:"small",onClick:()=>L(!0),children:v.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:v.jsx("path",{d:"M3 6h18M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2m2 0v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6h14zM10 11v6M14 11v6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})}),V=v.jsxs(Bl,{open:z,onClose:()=>L(!1),children:[v.jsx(zl,{children:"Confirm Delete"}),v.jsx(Ul,{children:v.jsx(ct,{children:"Are you sure you want to delete this cell?"})}),v.jsxs(cM,{children:[v.jsx(ma,{onClick:()=>L(!1),children:"Cancel"}),v.jsx(ma,{onClick:$,color:"error",children:"Delete"})]})]}),B=()=>{M(),i()},q=e.isMarkdown?v.jsxs(v.Fragment,{children:[n?v.jsx(jo,{title:"Save",children:v.jsx(ir,{size:"small",onClick:B,children:v.jsx(Fy,{})})}):v.jsx(jo,{title:"Edit",children:v.jsx(ir,{size:"small",onClick:l,children:v.jsx(MP,{})})}),!n&&j]}):v.jsxs(v.Fragment,{children:[!t&&v.jsx(jo,{title:y?"Hide Code":"View Code",children:v.jsx(ir,{size:"small",onClick:()=>{g(!y)},children:v.jsx(OF,{})})}),!t&&e.result&&v.jsx(jo,{title:b?"Hide Embedding":"View Embedding",children:v.jsx(ir,{size:"small",onClick:()=>{x(!b)},children:v.jsx(u_,{})})}),t&&v.jsx(jo,{title:"Save",children:v.jsx(ir,{size:"small",onClick:B,children:v.jsx(Fy,{})})}),!t&&v.jsx(jo,{title:"Edit",children:v.jsx(ir,{size:"small",onClick:l,children:v.jsx(MP,{})})}),!t&&j]}),Y=t||n,ee=n?v.jsx(jo,{title:"Save",children:v.jsx(ir,{size:"small",onClick:B,children:v.jsx(Fy,{})})}):t?v.jsx(jo,{title:"Save",children:v.jsx(ir,{size:"small",onClick:B,children:v.jsx(Fy,{})})}):null,N=O&&v.jsx(It,{sx:{position:"absolute",top:"4px",right:"4px",display:"flex",gap:"8px",backgroundColor:"background.paper",border:"1px solid",borderColor:"divider",borderRadius:"8px",padding:"2px 4px",boxShadow:1,zIndex:10},children:!Y&&v.jsxs(v.Fragment,{children:[d(!0),d(!1),q]})||ee});return v.jsxs(fb,{sx:{position:"relative",marginTop:"5px",marginBottom:"5px",borderWidth:"1.5px",backgroundColor:"#fff",minHeight:"50px"},onMouseEnter:()=>I(!0),onMouseLeave:()=>{I(!1)},children:[N,e.isMarkdown?v.jsx(v.Fragment,{children:n?v.jsx(W7,{value:p,preview:"edit",autoFocus:!0,onChange:W=>{h(W),a({...e,value:W})},onBlur:()=>{M(),O||B()}}):v.jsx(It,{sx:{px:.5,pt:0,mt:0,"& h1, & h2, & h3, & h4, & h5, & h6":{mt:.5,mb:.5},"& p":{mt:.5,mb:.5},"& ul, & ol":{mt:.5,mb:.5},"& li":{mt:0,mb:0},"& pre, & code":{mt:.5,mb:.5},"& blockquote":{mt:.5,mb:.5}},children:e.value?v.jsx(It,{onClick:l,sx:{cursor:"pointer"},children:v.jsx(W0,{children:e.value})}):v.jsxs(It,{onClick:l,sx:{cursor:"pointer"},children:[v.jsx(ct,{sx:{p:2,textAlign:"center",variant:"subtitle2",fontWeight:"medium"},children:"Markdown is empty"}),v.jsx(ct,{sx:{mb:2,textAlign:"center",variant:"body2"},children:"Click to edit."})]})})}):v.jsxs(v.Fragment,{children:[v.jsx(M0,{in:b,timeout:"auto",unmountOnExit:!0,children:v.jsx(Zr,{sx:{p:"10px",borderRadius:0,flexDirection:"row",justifyContent:"space-between"},children:v.jsx(ct,{component:"div",sx:{fontSize:"12px","& .line":{textWrap:"wrap"}},dangerouslySetInnerHTML:{__html:_}})})}),v.jsx(M0,{in:y,timeout:"auto",unmountOnExit:!0,children:v.jsx(Zr,{sx:{p:"10px",borderRadius:0,flexDirection:"row",justifyContent:"space-between"},children:v.jsx(ct,{component:"div",className:"content",sx:{fontSize:"12px","& .line":{textWrap:"wrap"}},dangerouslySetInnerHTML:{__html:S}})})}),t&&(k?v.jsxs(v.Fragment,{children:[v.jsx(ct,{sx:{p:2,textAlign:"center",variant:"subtitle2",fontWeight:"medium"},children:"No Model Imports"}),v.jsx(ct,{sx:{mb:2,textAlign:"center",variant:"body2"},children:"Please add a model import above."})]}):v.jsx(aCe,{sourceAndPaths:r,resourceUri:o,onQueryChange:W=>{R(W)},onSourceChange:W=>{H(W)},cell:e})),!t&&e.result&&v.jsx(fb,{variant:"outlined",sx:{borderRadius:0},children:v.jsx(jv,{result:e.result,minHeight:300,maxHeight:800})}),!t&&!e.result&&v.jsxs(It,{onClick:l,sx:{cursor:"pointer"},children:[v.jsx(ct,{sx:{p:2,textAlign:"center",variant:"subtitle2",fontWeight:"medium"},children:"Explore is empty"}),v.jsx(ct,{sx:{mb:2,textAlign:"center",variant:"body2"},children:"Click to edit."})]})]}),z&&V]})}const Y7=A.createContext(void 0);function sCe({children:e,workbookStorage:t}){const n=A.useMemo(()=>({workbookStorage:t}),[t]);return v.jsx(Y7.Provider,{value:n,children:e})}function lCe(){const e=A.useContext(Y7);if(!e)throw new Error("useWorkbookStorage must be used within a WorkbookStorageProvider");return e}const cCe=On(v.jsx("path",{d:"M18 15v3H6v-3H4v3c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-3zM7 9l1.41 1.41L11 7.83V16h2V7.83l2.59 2.58L17 9l-5-5z"}));function uCe({initialSelectedModels:e,onModelChange:t,resourceUri:n}){const{projectName:r,packageName:o,versionId:a}=yr(n),{apiClients:i}=Zn(),{data:l,isLoading:u,isSuccess:d,isError:p,error:h}=Zo({queryKey:["models",r,o,a],queryFn:()=>i.models.listModels(r,o,a)}),[y,g]=Qe.useState(e||[]),[b,x]=Qe.useState(null);Qe.useEffect(()=>{g(e||[])},[e]);const S=C=>{const R=y.filter(O=>O!==C);g(R),t(R)},E=C=>{const R=[...y,C];g(R),t(R),x(null)};let _=[];return d&&l?.data&&(_=l.data.filter(C=>!y.includes(C.path)).map(C=>C.path)),p?v.jsx(Xo,{error:h,context:`${r} > ${o} > Model Picker`}):v.jsxs(v.Fragment,{children:[v.jsxs(uM,{fullWidth:!0,children:[u&&v.jsx(ct,{children:"Loading..."}),v.jsxs(Zr,{direction:"row",spacing:1,children:[y.map(C=>v.jsx(n0,{label:C,onDelete:()=>S(C),deleteIcon:v.jsx(Vl,{}),sx:{marginBottom:"5px"}},C)),v.jsx(ma,{size:"small",startIcon:v.jsx(cCe,{}),onClick:C=>x(C.currentTarget),disabled:u||p||_.length===0,children:"Add Model"})]})]}),v.jsxs(Im,{anchorEl:b,open:!!b,onClose:()=>x(null),children:[v.jsx(ct,{variant:"subtitle2",sx:{ml:1},children:"Models"}),v.jsx(Hi,{}),_.length===0?v.jsx($l,{disabled:!0,children:"No models available"}):_.map(C=>v.jsx($l,{onClick:()=>E(C),children:v.jsx(ct,{variant:"body2",children:C})},C))]})]})}function dCe(){const e=$3();return(t,n)=>{if(!n||!n.metaKey&&!n.ctrlKey&&!n.shiftKey&&n.button!==1){e(t);return}const r=new URL(t,window.location.href).href;(n.metaKey||n.ctrlKey||n.button===1||n.shiftKey)&&window.open(r,"_blank")}}function hwe({workbookPath:e,resourceUri:t}){const n=dCe(),{server:r,getAccessToken:o}=Zn(),{apiClients:a}=Zn(),{workbookStorage:i}=lCe(),{projectName:l,packageName:u}=yr(t),[d,p]=Qe.useState(void 0),[h,y]=Qe.useState(void 0);if(!i)throw new Error("Workbook storage be provided via WorkbookStorageProvider");const[g,b]=Qe.useState(),[x,S]=Qe.useState(),[E,_]=Qe.useState(),[C,R]=Qe.useState([]),[O,I]=Qe.useState(null),[F,H]=Qe.useState(null),z=!!O,L=()=>{I(null),H(null)},$=(W,K)=>{g&&(b(g.insertCell(K,{isMarkdown:W,value:""})),W?_(K):S(K),L(),console.log("handleAddCell",W,K))},[k,M]=Qe.useState(!1),j=()=>{M(!0)},V=async()=>{e&&i&&await i.deleteWorkbook(e).then(()=>{y(void 0),p(void 0)}).catch(W=>{y(`Error deleting workbook: ${W.message}`),p(void 0)}),M(!1),n(`/${l}/${u}`)},B=()=>{M(!1)},q=Qe.useCallback(async()=>{if(!g){console.log("No workbook data ref");return}try{b(await g.saveWorkbook()),y(void 0),p("Workbook saved")}catch(W){y(`Error saving workbook: ${W.message}`),p(void 0)}},[g]);if(Qe.useEffect(()=>{g&&(async()=>{const W=new Map(C.map(({modelPath:Z,sourceInfos:ae})=>[Z,ae])),K=[],P=[];for(const Z of g.getModels())W.has(Z)?K.push({modelPath:Z,sourceInfos:W.get(Z)}):(console.log("Fetching model from Publisher",Z),P.push(a.models.getModel(l,u,Z,void 0).then(ae=>({modelPath:Z,sourceInfos:ae.data.sourceInfos.map(J=>JSON.parse(J))}))));if(P.length>0){const Z=await Promise.all(P);R([...K,...Z])}else R(K)})()},[o,g,u,l,r]),Qe.useEffect(()=>{e&&kh.loadWorkbook(i,e).then(W=>{b(W)})},[e,i]),!g)return v.jsx("div",{children:"Loading..."});const Y=W=>{const K=[];for(const P of W)for(const Z of P.sourceInfos)K.push({modelPath:P.modelPath,sourceInfo:Z});return K},ee=(W,K)=>v.jsx(ma,{size:"small",startIcon:v.jsx(Gfe,{}),onClick:()=>$(W,K),variant:"contained",sx:{backgroundColor:"#fff",color:P=>P.palette.mode==="dark"?P.palette.grey[100]:P.palette.grey[700],boxShadow:"none","&:hover":{backgroundColor:P=>P.palette.mode==="dark"?P.palette.grey[500]:P.palette.grey[300],boxShadow:"none"}},children:W?"Markdown":"Explore"}),N=v.jsxs(It,{sx:{display:"flex",gap:1,justifyContent:"center",flex:2},children:[ee(!1,g.getCells().length),ee(!0,g.getCells().length)]});return v.jsxs(fb,{variant:"outlined",children:[v.jsxs(J6,{children:[v.jsx(It,{sx:{mb:2},children:v.jsx(It,{sx:{minHeight:"24px"},children:h?v.jsx(ct,{color:"error",variant:"body2",children:h}):d?v.jsx(ct,{color:"success",variant:"body2",children:d}):v.jsx("span",{children:" "})})}),v.jsxs(id,{sx:{flexDirection:"row",justifyContent:"space-between",alignItems:"center"},children:[v.jsxs(id,{direction:"row",spacing:1,alignItems:"center",children:[v.jsx(ct,{variant:"overline",sx:{fontSize:"13px",fontWeight:"bold",verticalAlign:"middle"},children:"Workbook"}),v.jsx(ct,{variant:"subtitle2",sx:{fontSize:"13px",fontWeight:"normal",verticalAlign:"middle",ml:1},children:`${e.workspace} > ${e.path}`})]}),v.jsxs(id,{sx:{display:"flex",flexDirection:"row",gap:1},children:[v.jsx(It,{sx:{display:"flex",alignItems:"center",mt:1,mb:1},children:v.jsx(pCe,{workbookData:g})}),v.jsxs(It,{sx:{display:"flex",alignItems:"center",mt:1,mb:1},children:[v.jsx(ma,{color:"error",onClick:j,size:"small",children:"Delete"}),v.jsxs(Bl,{open:k,onClose:B,children:[v.jsx(zl,{children:"Delete Workbook"}),v.jsx(Ul,{children:v.jsxs(HK,{children:['Are you sure you want to delete the workbook "',e.path,'"? This action cannot be undone.']})}),v.jsxs(cM,{children:[v.jsx(ma,{onClick:B,color:"primary",size:"small",children:"Cancel"}),v.jsx(ma,{onClick:V,color:"error",autoFocus:!0,size:"small",children:"Delete"})]})]})]})]})]}),v.jsx(Hi,{}),v.jsxs(id,{sx:{display:"flex",flexDirection:"row",width:"100%",mt:2},children:[v.jsx(It,{sx:{flex:1},children:v.jsx(uCe,{initialSelectedModels:g.getModels(),onModelChange:W=>{b(g.setModels(W)),q()},resourceUri:t})}),v.jsx(It,{sx:{flex:1}})]})]}),v.jsx(E_,{children:v.jsxs(id,{children:[g.getCells().length===0&&v.jsxs(v.Fragment,{children:[v.jsx(ct,{sx:{textAlign:"center",p:2,variant:"subtitle2",fontWeight:"medium"},children:"Workbook is empty"}),v.jsx(ct,{variant:"body2",sx:{textAlign:"center",mb:2,variant:"body2"},children:"Click the + buttons to add a markdown or code cell."})]}),g.getCells().map((W,K)=>v.jsx(Qe.Fragment,{children:v.jsx(iCe,{cell:W,resourceUri:t,addButtonCallback:P=>ee(P,K),sourceAndPaths:Y(C),editingMarkdown:E===K,editingMalloy:x===K,onDelete:()=>{b(g.deleteCell(K)),q()},onCellChange:P=>{b(g.setCell(K,P))},onEdit:()=>{W.isMarkdown?_(K):S(K)},onClose:()=>{W.isMarkdown?_(void 0):S(void 0),q()}},`${K}-${W.isMarkdown}-${e.workspace}-${e.path}`)},`${K}-${g.getCells().length}`)),N,v.jsxs(Im,{anchorEl:O,open:z,onClose:L,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:[v.jsx($l,{onClick:()=>$(!0,F??0),children:"Add Markdown"}),v.jsx($l,{onClick:()=>$(!1,F??0),children:"Add Malloy"})]}),v.jsx(id,{sx:{flexDirection:"row",justifyContent:"flex-end",p:1}})]})})]})}function pCe({workbookData:e}){const[t,n]=Qe.useState(!1);return v.jsx(ma,{color:"primary",onClick:async()=>{if(!e)return;const r=e.toMalloyWorkbook();try{await navigator.clipboard.writeText(r),n(!0),setTimeout(()=>n(!1),1500)}catch{n(!1),alert("Failed to copy to clipboard")}},size:"small",children:t?"Copied!":"Export"})}const d3="Local";class fCe{async listWorkspaces(t){return Promise.resolve([{name:d3,description:"Stored locally- only accessible to this browser",writeable:!0}])}async listWorkbooks(t){const n=[];for(let r=0;r<localStorage.length;r++){const o=localStorage.key(r);n.push({path:o,workspace:d3})}return n}async getWorkbook(t){const n=localStorage.getItem(t.path);if(n===null)throw new Error(`Notebook not found at path: ${t}`);return n}async deleteWorkbook(t){if(localStorage.getItem(t.path)===null)throw new Error(`Notebook not found at path: ${t}`);localStorage.removeItem(t.path)}async saveWorkbook(t,n){localStorage.setItem(t.path,n)}async moveWorkbook(t,n){const r=localStorage.getItem(t.path);if(r===null)throw new Error(`Notebook not found at path: ${t.path}`);localStorage.setItem(n.path,r),localStorage.removeItem(t.path)}}const K7=On(v.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-2h2zm0-4h-2V7h2z"}));function hCe({resourceUri:e}){const{apiClients:t}=Zn(),{projectName:n,packageName:r,versionId:o}=yr(e),{data:a,isSuccess:i,isError:l,error:u}=Zo({queryKey:["package",n,r,o],queryFn:()=>t.packages.getPackage(n,r,o,!1)});return v.jsx(Kl,{children:v.jsxs(Ql,{children:[v.jsx(cu,{children:"Package Config"}),v.jsx(It,{sx:{maxHeight:"200px",overflowY:"auto"},children:v.jsxs(tv,{dense:!0,disablePadding:!0,children:[v.jsx(Ey,{dense:!0,disablePadding:!0,children:v.jsx(As,{primary:"Name",primaryTypographyProps:{fontWeight:"500"},secondary:r})}),!i&&!l&&v.jsx(Ey,{children:v.jsx(Ko,{text:"Fetching Package Metadata..."})}),i&&(a.data&&v.jsx(Ey,{dense:!0,disablePadding:!0,children:v.jsx(As,{primary:"Description",primaryTypographyProps:{fontWeight:"500"},secondary:a.data.description})})||v.jsxs(Ey,{disablePadding:!0,dense:!0,sx:{mt:"20px"},children:[v.jsx(K7,{sx:{color:"grey.600",mr:"10px"}}),v.jsx(As,{primary:"No package manifest"})]})),l&&v.jsx(Xo,{error:u,context:`${n} > ${r} > ${o}`})]})})]})})}function mCe(e){return en("MuiButton",e)}const Ec=Wt("MuiButton",["root","text","textInherit","textPrimary","textSecondary","textSuccess","textError","textInfo","textWarning","outlined","outlinedInherit","outlinedPrimary","outlinedSecondary","outlinedSuccess","outlinedError","outlinedInfo","outlinedWarning","contained","containedInherit","containedPrimary","containedSecondary","containedSuccess","containedError","containedInfo","containedWarning","disableElevation","focusVisible","disabled","colorInherit","colorPrimary","colorSecondary","colorSuccess","colorError","colorInfo","colorWarning","textSizeSmall","textSizeMedium","textSizeLarge","outlinedSizeSmall","outlinedSizeMedium","outlinedSizeLarge","containedSizeSmall","containedSizeMedium","containedSizeLarge","sizeMedium","sizeSmall","sizeLarge","fullWidth","startIcon","endIcon","icon","iconSizeSmall","iconSizeMedium","iconSizeLarge","loading","loadingWrapper","loadingIconPlaceholder","loadingIndicator","loadingPositionCenter","loadingPositionStart","loadingPositionEnd"]),gCe=A.createContext({}),yCe=A.createContext(void 0),bCe=e=>{const{color:t,disableElevation:n,fullWidth:r,size:o,variant:a,loading:i,loadingPosition:l,classes:u}=e,d={root:["root",i&&"loading",a,`${a}${Ze(t)}`,`size${Ze(o)}`,`${a}Size${Ze(o)}`,`color${Ze(t)}`,n&&"disableElevation",r&&"fullWidth",i&&`loadingPosition${Ze(l)}`],startIcon:["icon","startIcon",`iconSize${Ze(o)}`],endIcon:["icon","endIcon",`iconSize${Ze(o)}`],loadingIndicator:["loadingIndicator"],loadingWrapper:["loadingWrapper"]},p=Jt(d,mCe,u);return{...u,...p}},Q7=[{props:{size:"small"},style:{"& > *:nth-of-type(1)":{fontSize:18}}},{props:{size:"medium"},style:{"& > *:nth-of-type(1)":{fontSize:20}}},{props:{size:"large"},style:{"& > *:nth-of-type(1)":{fontSize:22}}}],vCe=Ye(Kd,{shouldForwardProp:e=>Do(e)||e==="classes",name:"MuiButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`${n.variant}${Ze(n.color)}`],t[`size${Ze(n.size)}`],t[`${n.variant}Size${Ze(n.size)}`],n.color==="inherit"&&t.colorInherit,n.disableElevation&&t.disableElevation,n.fullWidth&&t.fullWidth,n.loading&&t.loading]}})(hn(({theme:e})=>{const t=e.palette.mode==="light"?e.palette.grey[300]:e.palette.grey[800],n=e.palette.mode==="light"?e.palette.grey.A100:e.palette.grey[700];return{...e.typography.button,minWidth:64,padding:"6px 16px",border:0,borderRadius:(e.vars||e).shape.borderRadius,transition:e.transitions.create(["background-color","box-shadow","border-color","color"],{duration:e.transitions.duration.short}),"&:hover":{textDecoration:"none"},[`&.${Ec.disabled}`]:{color:(e.vars||e).palette.action.disabled},variants:[{props:{variant:"contained"},style:{color:"var(--variant-containedColor)",backgroundColor:"var(--variant-containedBg)",boxShadow:(e.vars||e).shadows[2],"&:hover":{boxShadow:(e.vars||e).shadows[4],"@media (hover: none)":{boxShadow:(e.vars||e).shadows[2]}},"&:active":{boxShadow:(e.vars||e).shadows[8]},[`&.${Ec.focusVisible}`]:{boxShadow:(e.vars||e).shadows[6]},[`&.${Ec.disabled}`]:{color:(e.vars||e).palette.action.disabled,boxShadow:(e.vars||e).shadows[0],backgroundColor:(e.vars||e).palette.action.disabledBackground}}},{props:{variant:"outlined"},style:{padding:"5px 15px",border:"1px solid currentColor",borderColor:"var(--variant-outlinedBorder, currentColor)",backgroundColor:"var(--variant-outlinedBg)",color:"var(--variant-outlinedColor)",[`&.${Ec.disabled}`]:{border:`1px solid ${(e.vars||e).palette.action.disabledBackground}`}}},{props:{variant:"text"},style:{padding:"6px 8px",color:"var(--variant-textColor)",backgroundColor:"var(--variant-textBg)"}},...Object.entries(e.palette).filter(ko()).map(([r])=>({props:{color:r},style:{"--variant-textColor":(e.vars||e).palette[r].main,"--variant-outlinedColor":(e.vars||e).palette[r].main,"--variant-outlinedBorder":e.alpha((e.vars||e).palette[r].main,.5),"--variant-containedColor":(e.vars||e).palette[r].contrastText,"--variant-containedBg":(e.vars||e).palette[r].main,"@media (hover: hover)":{"&:hover":{"--variant-containedBg":(e.vars||e).palette[r].dark,"--variant-textBg":e.alpha((e.vars||e).palette[r].main,(e.vars||e).palette.action.hoverOpacity),"--variant-outlinedBorder":(e.vars||e).palette[r].main,"--variant-outlinedBg":e.alpha((e.vars||e).palette[r].main,(e.vars||e).palette.action.hoverOpacity)}}}})),{props:{color:"inherit"},style:{color:"inherit",borderColor:"currentColor","--variant-containedBg":e.vars?e.vars.palette.Button.inheritContainedBg:t,"@media (hover: hover)":{"&:hover":{"--variant-containedBg":e.vars?e.vars.palette.Button.inheritContainedHoverBg:n,"--variant-textBg":e.alpha((e.vars||e).palette.text.primary,(e.vars||e).palette.action.hoverOpacity),"--variant-outlinedBg":e.alpha((e.vars||e).palette.text.primary,(e.vars||e).palette.action.hoverOpacity)}}}},{props:{size:"small",variant:"text"},style:{padding:"4px 5px",fontSize:e.typography.pxToRem(13)}},{props:{size:"large",variant:"text"},style:{padding:"8px 11px",fontSize:e.typography.pxToRem(15)}},{props:{size:"small",variant:"outlined"},style:{padding:"3px 9px",fontSize:e.typography.pxToRem(13)}},{props:{size:"large",variant:"outlined"},style:{padding:"7px 21px",fontSize:e.typography.pxToRem(15)}},{props:{size:"small",variant:"contained"},style:{padding:"4px 10px",fontSize:e.typography.pxToRem(13)}},{props:{size:"large",variant:"contained"},style:{padding:"8px 22px",fontSize:e.typography.pxToRem(15)}},{props:{disableElevation:!0},style:{boxShadow:"none","&:hover":{boxShadow:"none"},[`&.${Ec.focusVisible}`]:{boxShadow:"none"},"&:active":{boxShadow:"none"},[`&.${Ec.disabled}`]:{boxShadow:"none"}}},{props:{fullWidth:!0},style:{width:"100%"}},{props:{loadingPosition:"center"},style:{transition:e.transitions.create(["background-color","box-shadow","border-color"],{duration:e.transitions.duration.short}),[`&.${Ec.loading}`]:{color:"transparent"}}}]}})),ECe=Ye("span",{name:"MuiButton",slot:"StartIcon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.startIcon,n.loading&&t.startIconLoadingStart,t[`iconSize${Ze(n.size)}`]]}})(({theme:e})=>({display:"inherit",marginRight:8,marginLeft:-4,variants:[{props:{size:"small"},style:{marginLeft:-2}},{props:{loadingPosition:"start",loading:!0},style:{transition:e.transitions.create(["opacity"],{duration:e.transitions.duration.short}),opacity:0}},{props:{loadingPosition:"start",loading:!0,fullWidth:!0},style:{marginRight:-8}},...Q7]})),xCe=Ye("span",{name:"MuiButton",slot:"EndIcon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.endIcon,n.loading&&t.endIconLoadingEnd,t[`iconSize${Ze(n.size)}`]]}})(({theme:e})=>({display:"inherit",marginRight:-4,marginLeft:8,variants:[{props:{size:"small"},style:{marginRight:-2}},{props:{loadingPosition:"end",loading:!0},style:{transition:e.transitions.create(["opacity"],{duration:e.transitions.duration.short}),opacity:0}},{props:{loadingPosition:"end",loading:!0,fullWidth:!0},style:{marginLeft:-8}},...Q7]})),SCe=Ye("span",{name:"MuiButton",slot:"LoadingIndicator"})(({theme:e})=>({display:"none",position:"absolute",visibility:"visible",variants:[{props:{loading:!0},style:{display:"flex"}},{props:{loadingPosition:"start"},style:{left:14}},{props:{loadingPosition:"start",size:"small"},style:{left:10}},{props:{variant:"text",loadingPosition:"start"},style:{left:6}},{props:{loadingPosition:"center"},style:{left:"50%",transform:"translate(-50%)",color:(e.vars||e).palette.action.disabled}},{props:{loadingPosition:"end"},style:{right:14}},{props:{loadingPosition:"end",size:"small"},style:{right:10}},{props:{variant:"text",loadingPosition:"end"},style:{right:6}},{props:{loadingPosition:"start",fullWidth:!0},style:{position:"relative",left:-10}},{props:{loadingPosition:"end",fullWidth:!0},style:{position:"relative",right:-10}}]})),p3=Ye("span",{name:"MuiButton",slot:"LoadingIconPlaceholder"})({display:"inline-block",width:"1em",height:"1em"}),Br=A.forwardRef(function(e,t){const n=A.useContext(gCe),r=A.useContext(yCe),o=am(n,e),a=sn({props:o,name:"MuiButton"}),{children:i,color:l="primary",component:u="button",className:d,disabled:p=!1,disableElevation:h=!1,disableFocusRipple:y=!1,endIcon:g,focusVisibleClassName:b,fullWidth:x=!1,id:S,loading:E=null,loadingIndicator:_,loadingPosition:C="center",size:R="medium",startIcon:O,type:I,variant:F="text",...H}=a,z=up(S),L=_??v.jsx(gF,{"aria-labelledby":z,color:"inherit",size:16}),$={...a,color:l,component:u,disabled:p,disableElevation:h,disableFocusRipple:y,fullWidth:x,loading:E,loadingIndicator:L,loadingPosition:C,size:R,type:I,variant:F},k=bCe($),M=(O||E&&C==="start")&&v.jsx(ECe,{className:k.startIcon,ownerState:$,children:O||v.jsx(p3,{className:k.loadingIconPlaceholder,ownerState:$})}),j=(g||E&&C==="end")&&v.jsx(xCe,{className:k.endIcon,ownerState:$,children:g||v.jsx(p3,{className:k.loadingIconPlaceholder,ownerState:$})}),V=r||"",B=typeof E=="boolean"?v.jsx("span",{className:k.loadingWrapper,style:{display:"contents"},children:E&&v.jsx(SCe,{className:k.loadingIndicator,ownerState:$,children:L})}):null;return v.jsxs(vCe,{ownerState:$,className:Tt(n.className,k.root,d,V),component:u,disabled:p||E,focusRipple:!y,focusVisibleClassName:Tt(k.focusVisible,b),ref:t,type:I,id:E?z:S,...H,classes:k,children:[M,C!=="end"&&B,i,C==="end"&&B,j]})});function TCe(e){return en("MuiDialog",e)}const FS=Wt("MuiDialog",["root","scrollPaper","scrollBody","container","paper","paperScrollPaper","paperScrollBody","paperWidthFalse","paperWidthXs","paperWidthSm","paperWidthMd","paperWidthLg","paperWidthXl","paperFullWidth","paperFullScreen"]),X7=A.createContext({}),CCe=Ye(xF,{name:"MuiDialog",slot:"Backdrop",overrides:(e,t)=>t.backdrop})({zIndex:-1}),ACe=e=>{const{classes:t,scroll:n,maxWidth:r,fullWidth:o,fullScreen:a}=e,i={root:["root"],container:["container",`scroll${Ze(n)}`],paper:["paper",`paperScroll${Ze(n)}`,`paperWidth${Ze(String(r))}`,o&&"paperFullWidth",a&&"paperFullScreen"]};return Jt(i,TCe,t)},_Ce=Ye(SF,{name:"MuiDialog",slot:"Root"})({"@media print":{position:"absolute !important"}}),kCe=Ye("div",{name:"MuiDialog",slot:"Container",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.container,t[`scroll${Ze(n.scroll)}`]]}})({height:"100%","@media print":{height:"auto"},outline:0,variants:[{props:{scroll:"paper"},style:{display:"flex",justifyContent:"center",alignItems:"center"}},{props:{scroll:"body"},style:{overflowY:"auto",overflowX:"hidden",textAlign:"center","&::after":{content:'""',display:"inline-block",verticalAlign:"middle",height:"100%",width:"0"}}}]}),wCe=Ye(gp,{name:"MuiDialog",slot:"Paper",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.paper,t[`scrollPaper${Ze(n.scroll)}`],t[`paperWidth${Ze(String(n.maxWidth))}`],n.fullWidth&&t.paperFullWidth,n.fullScreen&&t.paperFullScreen]}})(hn(({theme:e})=>({margin:32,position:"relative",overflowY:"auto","@media print":{overflowY:"visible",boxShadow:"none"},variants:[{props:{scroll:"paper"},style:{display:"flex",flexDirection:"column",maxHeight:"calc(100% - 64px)"}},{props:{scroll:"body"},style:{display:"inline-block",verticalAlign:"middle",textAlign:"initial"}},{props:({ownerState:t})=>!t.maxWidth,style:{maxWidth:"calc(100% - 64px)"}},{props:{maxWidth:"xs"},style:{maxWidth:e.breakpoints.unit==="px"?Math.max(e.breakpoints.values.xs,444):`max(${e.breakpoints.values.xs}${e.breakpoints.unit}, 444px)`,[`&.${FS.paperScrollBody}`]:{[e.breakpoints.down(Math.max(e.breakpoints.values.xs,444)+64)]:{maxWidth:"calc(100% - 64px)"}}}},...Object.keys(e.breakpoints.values).filter(t=>t!=="xs").map(t=>({props:{maxWidth:t},style:{maxWidth:`${e.breakpoints.values[t]}${e.breakpoints.unit}`,[`&.${FS.paperScrollBody}`]:{[e.breakpoints.down(e.breakpoints.values[t]+64)]:{maxWidth:"calc(100% - 64px)"}}}})),{props:({ownerState:t})=>t.fullWidth,style:{width:"calc(100% - 64px)"}},{props:({ownerState:t})=>t.fullScreen,style:{margin:0,width:"100%",maxWidth:"100%",height:"100%",maxHeight:"none",borderRadius:0,[`&.${FS.paperScrollBody}`]:{margin:0,maxWidth:"100%"}}}]}))),Bs=A.forwardRef(function(e,t){const n=sn({props:e,name:"MuiDialog"}),r=dp(),o={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{"aria-describedby":a,"aria-labelledby":i,"aria-modal":l=!0,BackdropComponent:u,BackdropProps:d,children:p,className:h,disableEscapeKeyDown:y=!1,fullScreen:g=!1,fullWidth:b=!1,maxWidth:x="sm",onClick:S,onClose:E,open:_,PaperComponent:C=gp,PaperProps:R={},scroll:O="paper",slots:I={},slotProps:F={},TransitionComponent:H=pC,transitionDuration:z=o,TransitionProps:L,...$}=n,k={...n,disableEscapeKeyDown:y,fullScreen:g,fullWidth:b,maxWidth:x,scroll:O},M=ACe(k),j=A.useRef(),V=Ue=>{j.current=Ue.target===Ue.currentTarget},B=Ue=>{S&&S(Ue),j.current&&(j.current=null,E&&E(Ue,"backdropClick"))},q=up(i),Y=A.useMemo(()=>({titleId:q}),[q]),ee={transition:H,...I},N={transition:L,paper:R,backdrop:d,...F},W={slots:ee,slotProps:N},[K,P]=xn("root",{elementType:_Ce,shouldForwardComponentProp:!0,externalForwardedProps:W,ownerState:k,className:Tt(M.root,h),ref:t}),[Z,ae]=xn("backdrop",{elementType:CCe,shouldForwardComponentProp:!0,externalForwardedProps:W,ownerState:k}),[J,pe]=xn("paper",{elementType:wCe,shouldForwardComponentProp:!0,externalForwardedProps:W,ownerState:k,className:Tt(M.paper,R.className)}),[le,Ee]=xn("container",{elementType:kCe,externalForwardedProps:W,ownerState:k,className:M.container}),[Te,Ae]=xn("transition",{elementType:pC,externalForwardedProps:W,ownerState:k,additionalProps:{appear:!0,in:_,timeout:z,role:"presentation"}});return v.jsx(K,{closeAfterTransition:!0,slots:{backdrop:Z},slotProps:{backdrop:{transitionDuration:z,as:u,...ae}},disableEscapeKeyDown:y,onClose:E,open:_,onClick:B,...P,...$,children:v.jsx(Te,{...Ae,children:v.jsx(le,{onMouseDown:V,...Ee,children:v.jsx(J,{as:C,elevation:24,role:"dialog","aria-describedby":a,"aria-labelledby":q,"aria-modal":l,...pe,children:v.jsx(X7.Provider,{value:Y,children:p})})})})})});function RCe(e){return en("MuiDialogActions",e)}Wt("MuiDialogActions",["root","spacing"]);const DCe=e=>{const{classes:t,disableSpacing:n}=e;return Jt({root:["root",!n&&"spacing"]},RCe,t)},ICe=Ye("div",{name:"MuiDialogActions",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,!n.disableSpacing&&t.spacing]}})({display:"flex",alignItems:"center",padding:8,justifyContent:"flex-end",flex:"0 0 auto",variants:[{props:({ownerState:e})=>!e.disableSpacing,style:{"& > :not(style) ~ :not(style)":{marginLeft:8}}}]}),Us=A.forwardRef(function(e,t){const n=sn({props:e,name:"MuiDialogActions"}),{className:r,disableSpacing:o=!1,...a}=n,i={...n,disableSpacing:o},l=DCe(i);return v.jsx(ICe,{className:Tt(l.root,r),ownerState:i,ref:t,...a})});function OCe(e){return en("MuiDialogContent",e)}Wt("MuiDialogContent",["root","dividers"]);function NCe(e){return en("MuiDialogTitle",e)}const PCe=Wt("MuiDialogTitle",["root"]),LCe=e=>{const{classes:t,dividers:n}=e;return Jt({root:["root",n&&"dividers"]},OCe,t)},MCe=Ye("div",{name:"MuiDialogContent",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.dividers&&t.dividers]}})(hn(({theme:e})=>({flex:"1 1 auto",WebkitOverflowScrolling:"touch",overflowY:"auto",padding:"20px 24px",variants:[{props:({ownerState:t})=>t.dividers,style:{padding:"16px 24px",borderTop:`1px solid ${(e.vars||e).palette.divider}`,borderBottom:`1px solid ${(e.vars||e).palette.divider}`}},{props:({ownerState:t})=>!t.dividers,style:{[`.${PCe.root} + &`]:{paddingTop:0}}}]}))),zs=A.forwardRef(function(e,t){const n=sn({props:e,name:"MuiDialogContent"}),{className:r,dividers:o=!1,...a}=n,i={...n,dividers:o},l=LCe(i);return v.jsx(MCe,{className:Tt(l.root,r),ownerState:i,ref:t,...a})});function FCe(e){return en("MuiTypography",e)}Wt("MuiTypography",["root","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"]);const jCe={primary:!0,secondary:!0,error:!0,info:!0,success:!0,warning:!0,textPrimary:!0,textSecondary:!0,textDisabled:!0},BCe=tie(),UCe=e=>{const{align:t,gutterBottom:n,noWrap:r,paragraph:o,variant:a,classes:i}=e,l={root:["root",a,e.align!=="inherit"&&`align${Ze(t)}`,n&&"gutterBottom",r&&"noWrap",o&&"paragraph"]};return Jt(l,FCe,i)},zCe=Ye("span",{name:"MuiTypography",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.variant&&t[n.variant],n.align!=="inherit"&&t[`align${Ze(n.align)}`],n.noWrap&&t.noWrap,n.gutterBottom&&t.gutterBottom,n.paragraph&&t.paragraph]}})(hn(({theme:e})=>({margin:0,variants:[{props:{variant:"inherit"},style:{font:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}},...Object.entries(e.typography).filter(([t,n])=>t!=="inherit"&&n&&typeof n=="object").map(([t,n])=>({props:{variant:t},style:n})),...Object.entries(e.palette).filter(ko()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}})),...Object.entries(e.palette?.text||{}).filter(([,t])=>typeof t=="string").map(([t])=>({props:{color:`text${Ze(t)}`},style:{color:(e.vars||e).palette.text[t]}})),{props:({ownerState:t})=>t.align!=="inherit",style:{textAlign:"var(--Typography-textAlign)"}},{props:({ownerState:t})=>t.noWrap,style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},{props:({ownerState:t})=>t.gutterBottom,style:{marginBottom:"0.35em"}},{props:({ownerState:t})=>t.paragraph,style:{marginBottom:16}}]}))),f3={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},Jm=A.forwardRef(function(e,t){const{color:n,...r}=sn({props:e,name:"MuiTypography"}),o=!jCe[n],a=BCe({...r,...o&&{color:n}}),{align:i="inherit",className:l,component:u,gutterBottom:d=!1,noWrap:p=!1,paragraph:h=!1,variant:y="body1",variantMapping:g=f3,...b}=a,x={...a,align:i,color:n,className:l,component:u,gutterBottom:d,noWrap:p,paragraph:h,variant:y,variantMapping:g},S=u||(h?"p":g[y]||f3[y])||"span",E=UCe(x);return v.jsx(zCe,{as:S,ref:t,className:Tt(E.root,l),...b,ownerState:x,style:{...i!=="inherit"&&{"--Typography-textAlign":i},...b.style}})});function $Ce(e){return en("MuiDialogContentText",e)}Wt("MuiDialogContentText",["root"]);const HCe=e=>{const{classes:t}=e,n=Jt({root:["root"]},$Ce,t);return{...t,...n}},VCe=Ye(Jm,{shouldForwardProp:e=>Do(e)||e==="classes",name:"MuiDialogContentText",slot:"Root"})({}),Ap=A.forwardRef(function(e,t){const n=sn({props:e,name:"MuiDialogContentText"}),{children:r,className:o,...a}=n,i=HCe(a);return v.jsx(VCe,{component:"p",variant:"body1",color:"textSecondary",ref:t,ownerState:a,className:Tt(i.root,o),...n,classes:i})}),GCe=e=>{const{classes:t}=e;return Jt({root:["root"]},NCe,t)},qCe=Ye(Jm,{name:"MuiDialogTitle",slot:"Root"})({padding:"16px 24px",flex:"0 0 auto"}),$s=A.forwardRef(function(e,t){const n=sn({props:e,name:"MuiDialogTitle"}),{className:r,id:o,...a}=n,i=n,l=GCe(i),{titleId:u=o}=A.useContext(X7);return v.jsx(qCe,{component:"h2",className:Tt(l.root,r),ownerState:i,ref:t,variant:"h6",id:o??u,...a})}),h3=Wt("MuiDivider",["root","absolute","fullWidth","inset","middle","flexItem","light","vertical","withChildren","withChildrenVertical","textAlignRight","textAlignLeft","wrapper","wrapperVertical"]),m3=Wt("MuiListItemIcon",["root","alignItemsFlexStart"]),g3=Wt("MuiListItemText",["root","multiline","dense","inset","primary","secondary"]);function WCe(e){return en("MuiMenuItem",e)}const Zf=Wt("MuiMenuItem",["root","focusVisible","dense","disabled","divider","gutters","selected"]),YCe=(e,t)=>{const{ownerState:n}=e;return[t.root,n.dense&&t.dense,n.divider&&t.divider,!n.disableGutters&&t.gutters]},KCe=e=>{const{disabled:t,dense:n,divider:r,disableGutters:o,selected:a,classes:i}=e,l=Jt({root:["root",n&&"dense",t&&"disabled",!o&&"gutters",r&&"divider",a&&"selected"]},WCe,i);return{...i,...l}},QCe=Ye(Kd,{shouldForwardProp:e=>Do(e)||e==="classes",name:"MuiMenuItem",slot:"Root",overridesResolver:YCe})(hn(({theme:e})=>({...e.typography.body1,display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minHeight:48,paddingTop:6,paddingBottom:6,boxSizing:"border-box",whiteSpace:"nowrap","&:hover":{textDecoration:"none",backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${Zf.selected}`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,(e.vars||e).palette.action.selectedOpacity),[`&.${Zf.focusVisible}`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.focusOpacity}`)}},[`&.${Zf.selected}:hover`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.hoverOpacity}`),"@media (hover: none)":{backgroundColor:e.alpha((e.vars||e).palette.primary.main,(e.vars||e).palette.action.selectedOpacity)}},[`&.${Zf.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${Zf.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity},[`& + .${h3.root}`]:{marginTop:e.spacing(1),marginBottom:e.spacing(1)},[`& + .${h3.inset}`]:{marginLeft:52},[`& .${g3.root}`]:{marginTop:0,marginBottom:0},[`& .${g3.inset}`]:{paddingLeft:36},[`& .${m3.root}`]:{minWidth:36},variants:[{props:({ownerState:t})=>!t.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:t})=>t.divider,style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,backgroundClip:"padding-box"}},{props:({ownerState:t})=>!t.dense,style:{[e.breakpoints.up("sm")]:{minHeight:"auto"}}},{props:({ownerState:t})=>t.dense,style:{minHeight:32,paddingTop:4,paddingBottom:4,...e.typography.body2,[`& .${m3.root} svg`]:{fontSize:"1.25rem"}}}]}))),Z7=A.forwardRef(function(e,t){const n=sn({props:e,name:"MuiMenuItem"}),{autoFocus:r=!1,component:o="li",dense:a=!1,divider:i=!1,disableGutters:l=!1,focusVisibleClassName:u,role:d="menuitem",tabIndex:p,className:h,...y}=n,g=A.useContext(uC),b=A.useMemo(()=>({dense:a||g.dense||!1,disableGutters:l}),[g.dense,a,l]),x=A.useRef(null);Gi(()=>{r&&x.current&&x.current.focus()},[r]);const S={...n,dense:b.dense,divider:i,disableGutters:l},E=KCe(n),_=sr(x,t);let C;return n.disabled||(C=p!==void 0?p:-1),v.jsx(uC.Provider,{value:b,children:v.jsx(QCe,{ref:_,role:d,tabIndex:C,component:o,focusVisibleClassName:Tt(E.focusVisible,u),className:Tt(E.root,h),...y,ownerState:S,classes:E})})}),Rb={postgres:[{label:"Host",name:"host",type:"text"},{label:"Port",name:"port",type:"number"},{label:"Database Name",name:"databaseName",type:"text"},{label:"User Name",name:"userName",type:"text"},{label:"Password",name:"password",type:"password"},{label:"Connection String",name:"connectionString",type:"text"}],bigquery:[{label:"Project ID",name:"defaultProjectId",type:"text"},{label:"Billing Project ID",name:"billingProjectId",type:"text"},{label:"Location",name:"location",type:"text"},{label:"Service Account Key JSON",name:"serviceAccountKeyJson",type:"text"},{label:"Maximum Bytes Billed",name:"maximumBytesBilled",type:"text"},{label:"Query Timeout Milliseconds",name:"queryTimeoutMilliseconds",type:"text"}],snowflake:[{label:"Account",name:"account",type:"text"},{label:"Username",name:"username",type:"text"},{label:"Password",name:"password",type:"password"},{label:"Role",name:"role",type:"text"},{label:"Warehouse",name:"warehouse",type:"text"},{label:"Database",name:"database",type:"text"},{label:"Schema",name:"schema",type:"text"},{label:"Response Timeout Milliseconds",name:"responseTimeoutMilliseconds",type:"text"},{label:"Private Key",name:"privateKey",type:"password"},{label:"Private Key Passphrase",name:"privateKeyPass",type:"password"}],trino:[{label:"Server",name:"server",type:"text"},{label:"Port",name:"port",type:"number"},{label:"Catalog",name:"catalog",type:"text"},{label:"Schema",name:"schema",type:"text"},{label:"User",name:"user",type:"text"},{label:"Password",name:"password",type:"password"},{label:"Peaka Key",name:"peakaKey",type:"password"}],mysql:[{label:"Host",name:"host",type:"text"},{label:"Port",name:"port",type:"number"},{label:"User",name:"user",type:"text"},{label:"Password",name:"password",type:"password"},{label:"Database",name:"database",type:"text"}],duckdb:[],motherduck:[{label:"Access Token",name:"accessToken",type:"text"},{label:"Database",name:"database",type:"text"}]},jS={postgres:"postgresConnection",bigquery:"bigqueryConnection",snowflake:"snowflakeConnection",trino:"trinoConnection",mysql:"mysqlConnection",duckdb:"duckdbConnection",motherduck:"motherduckConnection"};function XCe({onSubmit:e,isSubmitting:t}){const[n,r]=A.useState(!1),[o,a]=A.useState("postgres"),i=()=>{r(!0)},l=()=>{r(!1)},u=async d=>{d.preventDefault();const p=new FormData(d.currentTarget),h=p.get("name")?.toString(),y=p.get("type")?.toString(),g=Rb[y];if(!h)throw new Error("Name is required");if(!y)throw new Error("Type is required");const b={name:h,type:y,[{postgres:"postgresConnection",bigquery:"bigqueryConnection",snowflake:"snowflakeConnection",trino:"trinoConnection",mysql:"mysqlConnection",motherduck:"motherduckConnection"}[y]]:g.reduce((x,S)=>(x[S.name]=p.get(S.name)?.toString(),x),{})};await e(b),l()};return v.jsxs(Qe.Fragment,{children:[v.jsx(Br,{variant:"outlined",onClick:i,children:"Add Connection"}),v.jsxs(Bs,{open:n,onClose:l,children:[v.jsx($s,{children:"Create New Connection"}),v.jsxs(zs,{children:[v.jsx(Ap,{children:"Add a new connection to query your data database using Malloy."}),v.jsxs("form",{onSubmit:u,id:"connection-form",children:[v.jsx(bo,{autoFocus:!0,required:!0,margin:"dense",id:"name",name:"name",label:"Connection Name",type:"text",fullWidth:!0,variant:"standard"}),v.jsx(bo,{margin:"dense",id:"type",name:"type",label:"Connection Type",fullWidth:!0,variant:"standard",value:o,select:!0,onChange:d=>a(d.target.value),children:Object.values(r4).map(d=>v.jsx(Z7,{value:d,children:d},d))}),Rb[o].map(d=>v.jsx(bo,{margin:"dense",id:d.name,name:d.name,label:d.label,type:d.type,fullWidth:!0,variant:"standard"},d.name))]})]}),v.jsxs(Us,{children:[v.jsx(Br,{disabled:t,onClick:l,children:"Cancel"}),v.jsx(Br,{type:"submit",form:"connection-form",loading:t,children:"Create Connection"})]})]})]})}function ZCe({connection:e,onCloseDialog:t,isMutating:n,onDelete:r}){const[o,a]=A.useState(!1),[i,l]=A.useState(""),u=()=>{a(!0)},d=()=>{a(!1),t()};return v.jsxs(Qe.Fragment,{children:[v.jsx(Qd,{onClick:p=>{p.stopPropagation(),u()},children:v.jsx(jA,{})}),v.jsxs(Bs,{onClose:d,"aria-labelledby":"customized-dialog-title",open:o,children:[v.jsx($s,{sx:{m:0,p:2},id:"customized-dialog-title",children:"Delete Connection"}),v.jsx(Qd,{"aria-label":"close",onClick:d,sx:p=>({position:"absolute",right:8,top:8,color:p.palette.grey[500]}),children:v.jsx(Vl,{})}),v.jsx(zs,{dividers:!0,children:v.jsxs(Jm,{gutterBottom:!0,children:['Are you sure you want to delete "',e.name,'"? This action cannot be undone.']})}),v.jsx(Us,{children:v.jsx(Br,{loading:n,variant:"contained",autoFocus:!0,onClick:()=>r(),color:"error",children:"Delete"})}),v.jsx(Ls,{open:i!=="",autoHideDuration:6e3,onClose:()=>l(""),message:i})]})]})}function JCe({connection:e,onSubmit:t,isSubmitting:n}){const[r,o]=A.useState(!1),[a,i]=A.useState(e.type),l=()=>{o(!0)},u=()=>{o(!1)},d=async p=>{p.preventDefault();const h=new FormData(p.currentTarget),y=h.get("name")?.toString(),g=h.get("type")?.toString(),b=Rb[g];if(!y)throw new Error("Name is required");if(!g)throw new Error("Type is required");const x={name:y,type:g,[jS[g]]:b.reduce((S,E)=>(S[E.name]=h.get(E.name)?.toString()??e[jS[g]][E.name],S),{})};await t(x),u()};return v.jsxs(Qe.Fragment,{children:[v.jsx(ir,{onClick:p=>{p.preventDefault(),p.stopPropagation(),l()},children:v.jsx(BA,{})}),v.jsxs(Bs,{open:r,onClose:u,children:[v.jsx($s,{onClick:p=>{p.stopPropagation()},children:"Edit Connection"}),v.jsxs(zs,{onClick:p=>{p.stopPropagation()},children:[v.jsx(Ap,{children:"Edit a connection to query your data database using Malloy."}),v.jsxs("form",{onSubmit:d,id:"connection-form",children:[v.jsx(bo,{autoFocus:!0,required:!0,margin:"dense",id:"name",name:"name",label:"Connection Name",type:"text",fullWidth:!0,variant:"standard",value:e.name,defaultValue:e.name}),v.jsx(bo,{margin:"dense",id:"type",name:"type",label:"Connection Type",fullWidth:!0,variant:"standard",value:a,select:!0,onChange:p=>i(p.target.value),children:Object.values(r4).map(p=>v.jsx(Z7,{value:p,children:p},p))}),Rb[a].map(p=>v.jsx(bo,{margin:"dense",id:p.name,name:p.name,label:p.label,type:p.type,fullWidth:!0,variant:"standard",defaultValue:e?.[jS[a]??""]?.[p.name??""]??""},p.name))]})]}),v.jsxs(Us,{onClick:p=>{p.stopPropagation()},children:[v.jsx(Br,{disabled:n,onClick:u,children:"Cancel"}),v.jsx(Br,{type:"submit",form:"connection-form",loading:n,children:"Edit Connection"})]})]})]})}function eAe({connectionName:e,resourceUri:t,schema:n}){const{apiClients:r}=Zn(),{projectName:o}=yr(t),[a,i]=Qe.useState(void 0),[l,u]=Qe.useState(n||null),[d,p]=Qe.useState(!1),{data:h,isError:y,isLoading:g,error:b}=Zo({queryKey:["schemas",o,e],queryFn:()=>r.connections.listSchemas(o,e)}),x=h?.data||[];return v.jsxs(Ar,{container:!0,spacing:1,children:[!n&&v.jsx(Ar,{size:{xs:12,md:4},children:v.jsxs(Ol,{sx:{p:1,m:0},children:[v.jsxs(It,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:0},children:[v.jsx(ct,{variant:"overline",fontWeight:"bold",children:"Table Paths"}),v.jsx(iQ,{control:v.jsx(XX,{checked:d,onChange:S=>p(S.target.checked)}),label:"Hidden Schemas"})]}),v.jsx(Hi,{sx:{mt:"2px"}}),v.jsxs(It,{sx:{mt:"2px",maxHeight:"600px",overflowY:"auto"},children:[g&&v.jsx(Ko,{text:"Loading schemas..."}),y&&v.jsx(Xo,{error:b,context:`${o} > ${e} > Schemas`}),!g&&!y&&x.length===0&&v.jsx(ct,{variant:"body2",children:"No Schemas"}),!g&&!y&&x.length>0&&v.jsx(tv,{dense:!0,disablePadding:!0,children:x.map(S=>{const E=S.name;return S.isHidden&&!d?null:v.jsx(dM,{selected:l===E,onClick:()=>{u(E),i(void 0)},children:v.jsx(As,{primary:E})},E)})})]})]})}),v.jsx(Ar,{size:{xs:12,md:n?6:4},children:l&&v.jsx(Ol,{sx:{p:1,m:0},children:v.jsx(nAe,{connectionName:e,schemaName:l,onTableClick:S=>{i(S)},resourceUri:t})})}),v.jsx(Ar,{size:{xs:12,md:n?6:4},children:a&&v.jsx(Ol,{sx:{p:1,m:0},children:v.jsx(tAe,{table:a})})})]})}function tAe({table:e}){return v.jsxs(v.Fragment,{children:[v.jsxs(ct,{variant:"overline",fontWeight:"bold",children:["Schema: ",e.resource]}),v.jsx(Hi,{}),v.jsx(It,{sx:{mt:"10px",maxHeight:"600px",overflowY:"auto"},children:v.jsx(EM,{children:v.jsxs($0,{size:"small",sx:{"& .MuiTableCell-root":{padding:"10px"}},children:[v.jsx(xM,{children:v.jsxs(_l,{children:[v.jsx(Xr,{children:"NAME"}),v.jsx(Xr,{children:"TYPE"})]})}),v.jsx(H0,{children:e.columns?.sort((t,n)=>t.name.localeCompare(n.name))?.map(t=>v.jsxs(_l,{children:[v.jsx(Xr,{children:t.name}),v.jsx(Xr,{children:t.type})]},t.name))})]})})})]})}function nAe({connectionName:e,schemaName:t,onTableClick:n,resourceUri:r}){const{projectName:o}=yr(r),{apiClients:a}=Zn(),[i,l]=A.useState(""),{data:u,isSuccess:d,isError:p,error:h,isLoading:y}=Zo({queryKey:["tablesInSchema",o,e,t],queryFn:()=>a.connections.listTables(o,e,t)}),g=d&&u?.data?u.data.filter(b=>(b.resource.split(".").pop()?.toLowerCase()||"").includes(i.toLowerCase())).sort((b,x)=>{const S=b.resource.split(".").pop()||b.resource,E=x.resource.split(".").pop()||x.resource;return S.localeCompare(E)}):[];return v.jsxs(v.Fragment,{children:[v.jsxs(ct,{variant:"overline",fontWeight:"bold",children:["Tables in ",t]}),v.jsx(Hi,{}),v.jsx(It,{sx:{mt:1,mb:1},children:v.jsx(TZ,{size:"small",fullWidth:!0,placeholder:"Search tables...",value:i,onChange:b=>l(b.target.value),variant:"outlined"})}),v.jsx(Hi,{}),v.jsxs(It,{sx:{mt:"2px",maxHeight:"600px",overflowY:"auto"},children:[y&&v.jsx(Ko,{text:"Fetching Tables..."}),p&&v.jsx(Xo,{error:h,context:`${o} > ${e} > ${t}`}),d&&g.length===0&&v.jsx(ct,{variant:"body2",children:"No Tables"}),d&&u?.data&&u.data.length>0&&v.jsx(tv,{dense:!0,disablePadding:!0,children:g.map(b=>{const x=b.resource.split(".").pop()||b.resource;return v.jsx(dM,{onClick:()=>n(b),children:v.jsx(As,{primary:x,secondary:`${b.columns.length} columns`})},b.resource)})})]})]})}function rAe({connection:e,onClick:t,onEdit:n,onDelete:r,isMutating:o,mutable:a}){return v.jsxs(_l,{sx:{"&:hover":{backgroundColor:"action.hover"}},children:[v.jsx(Xr,{sx:{cursor:"pointer",flexGrow:1},onClick:t,children:v.jsxs(It,{sx:{display:"flex",alignItems:"center",gap:1},children:[v.jsx(ct,{variant:"body2",children:e.name}),v.jsx(im,{sx:{fontSize:"1rem",color:"action.active",opacity:.7}})]})}),v.jsx(Xr,{sx:{minWidth:"120px"},children:v.jsx(ct,{variant:"body2",children:e.type})}),a&&v.jsxs(Xr,{sx:{minWidth:"120px"},children:[v.jsx(JCe,{connection:e,onSubmit:n,isSubmitting:o}),v.jsx(ZCe,{connection:e,onCloseDialog:()=>{},isMutating:o,onDelete:()=>r(e)})]})]},e.name)}function oAe({resourceUri:e}){const{apiClients:t,mutable:n}=Zn(),r=Ms(),{projectName:o}=yr(e),[a,i]=A.useState(""),[l,u]=A.useState(null),d=d_({projectName:o,connectionName:l}),{data:p,isSuccess:h,isError:y,error:g}=Zo({queryKey:["connections",o],queryFn:()=>t.connections.listConnections(o)}),b=C=>{u(C)},x=()=>{u(null)},S=Ui({mutationFn:C=>t.projects.updateProject(o,{name:o,connections:[...p.data,C]}),onSuccess(){i("Connection added successfully"),r.invalidateQueries({queryKey:["connections",o]})},onError(C){i(C.message)}}),E=Ui({mutationFn:C=>t.projects.updateProject(o,{name:o,connections:p.data.map(R=>R.name===C.name?C:R)}),onSuccess(C,R){i(`Connection ${R.name} updated successfully`),r.invalidateQueries({queryKey:["connections",o]})},onError(C){i(C.message)}}),_=Ui({mutationFn:C=>t.projects.updateProject(o,{name:o,connections:p.data.filter(R=>R.name!==C.name)}),onSuccess(C,R){i(`Connection ${R.name} deleted successfully`),r.invalidateQueries({queryKey:["connections",o]})},onError(C){i(C.message)}});return v.jsxs(v.Fragment,{children:[v.jsx(Kl,{children:v.jsxs(Ql,{children:[v.jsx(cu,{children:"Database Connections"}),v.jsxs(It,{sx:{mb:1,maxHeight:"200px",overflowY:"auto"},children:[!h&&!y&&v.jsx(ct,{variant:"body2",sx:{m:"auto"},children:"Fetching Connections..."}),h&&p.data.length>0&&v.jsx($0,{size:"small",sx:{borderCollapse:"collapse","& .MuiTableRow-root":{display:"flex",width:"100%"},"& .MuiTableCell-root":{borderBottom:"1px solid #e0e0e0",display:"flex",alignItems:"center"},"& .MuiTableRow-root:last-child .MuiTableCell-root":{borderBottom:"none"}},children:v.jsxs(H0,{children:[v.jsxs(_l,{children:[v.jsx(Xr,{sx:{flexGrow:1},children:v.jsx(ct,{variant:"body2",fontWeight:"500",color:"text.secondary",children:"Connection Name"})}),v.jsx(Xr,{sx:{minWidth:"120px"},children:v.jsx(ct,{variant:"body2",fontWeight:"500",color:"text.secondary",children:"Type"})}),n&&v.jsx(Xr,{sx:{minWidth:"120px"},children:v.jsx(ct,{variant:"body2",fontWeight:"500",color:"text.secondary",sx:{mx:"auto"},children:"Actions"})})]}),p.data.map(C=>v.jsx(rAe,{connection:C,onClick:()=>b(C.name),onEdit:R=>E.mutateAsync(R),onDelete:R=>{d.startsWith("publisher:")?i("Cannot delete this connection (publisher: resource)"):_.mutateAsync(R)},isMutating:E.isPending||_.isPending,mutable:n},C.name))]})}),h&&p.data.length===0&&v.jsx(ct,{variant:"body2",children:"No Connections"}),y&&v.jsx(Xo,{error:g,context:`${o} > Connections`})]}),n&&v.jsx(It,{sx:{display:"flex",justifyContent:"flex-end"},children:v.jsx(XCe,{onSubmit:C=>S.mutateAsync(C),isSubmitting:S.isPending})})]})}),v.jsx(Ls,{open:a!=="",autoHideDuration:6e3,onClose:()=>i(""),message:a}),v.jsxs(Bl,{open:l!==null,onClose:x,maxWidth:"lg",fullWidth:!0,children:[v.jsxs(zl,{children:["Connection Explorer: ",l,v.jsx(ir,{"aria-label":"close",onClick:x,sx:{position:"absolute",right:8,top:8},children:v.jsx(It,{sx:{width:24,height:24,display:"flex",alignItems:"center",justifyContent:"center"},children:"X"})})]}),v.jsx(Ul,{children:l&&v.jsx(eAe,{resourceUri:d,connectionName:l})})]})]})}function aAe({resourceUri:e}){const{apiClients:t}=Zn(),{projectName:n,packageName:r,versionId:o}=yr(e),[a,i]=Qe.useState(!1),[l,u]=Qe.useState(null),d=S=>{u(S),i(!0)},p=()=>{i(!1),u(null)},{data:h,isError:y,error:g,isSuccess:b}=Zo({queryKey:["databases",n,r,o],queryFn:()=>t.databases.listDatabases(n,r,o)}),x=S=>S>=1024*1024*1024*1024?`${(S/(1024*1024*1024)).toFixed(2)} T`:S>=1024*1024*1024?`${(S/(1024*1024*1024)).toFixed(2)} G`:S>=1024*1024?`${(S/(1024*1024)).toFixed(2)} M`:`${(S/1024).toFixed(2)} K`;return v.jsxs(v.Fragment,{children:[v.jsx(Kl,{children:v.jsxs(Ql,{children:[v.jsx(cu,{children:"Embedded Databases"}),v.jsxs(It,{sx:{maxHeight:"200px",overflowY:"auto"},children:[!b&&!y&&v.jsx(Ko,{text:"Fetching Databases..."}),y&&v.jsx(Xo,{error:g,context:`${n} > ${r} > Databases`}),b&&h.data.length>0&&v.jsx($0,{size:"small",sx:{borderCollapse:"collapse","& .MuiTableCell-root":{borderBottom:"1px solid #e0e0e0"},"& .MuiTableRow-root:last-child .MuiTableCell-root":{borderBottom:"none"}},children:v.jsxs(H0,{children:[v.jsxs(_l,{children:[v.jsx(Xr,{children:v.jsx(ct,{variant:"body2",fontWeight:"500",color:"text.secondary",children:"Name"})}),v.jsx(Xr,{align:"right",children:v.jsx(ct,{variant:"body2",fontWeight:"500",color:"text.secondary",children:"Rows"})})]}),h.data.map(S=>v.jsxs(_l,{onClick:()=>d(S),sx:{cursor:"pointer","&:hover":{backgroundColor:"action.hover"}},children:[v.jsx(Xr,{component:"th",scope:"row",children:v.jsxs(It,{sx:{display:"flex",alignItems:"center",gap:1},children:[v.jsx(ct,{variant:"body2",children:S.path}),v.jsx(im,{sx:{fontSize:"1rem",color:"action.active",opacity:.7}})]})}),v.jsx(Xr,{align:"right",children:v.jsx(ct,{variant:"body2",children:x(S.info.rowCount)})})]},S.path))]})}),b&&h.data.length===0&&v.jsx(ct,{variant:"body2",sx:{m:"auto"},children:"No databases found"})]})]})}),v.jsxs(Bl,{open:a,onClose:p,maxWidth:"sm",fullWidth:!0,children:[v.jsxs(zl,{children:[l?.path,v.jsx(ir,{"aria-label":"close",onClick:p,sx:{position:"absolute",right:8,top:8},children:v.jsx(It,{sx:{width:24,height:24,display:"flex",alignItems:"center",justifyContent:"center"},children:"X"})})]}),v.jsx(Ul,{children:l?.info?.columns&&v.jsx(EM,{children:v.jsxs($0,{size:"small",children:[v.jsx(xM,{children:v.jsxs(_l,{children:[v.jsx(Xr,{children:"Column"}),v.jsx(Xr,{children:"Type"})]})}),v.jsx(H0,{children:l.info.columns.map(S=>v.jsxs(_l,{children:[v.jsx(Xr,{component:"th",scope:"row",children:S.name}),v.jsx(Xr,{children:S.type})]},S.name))})]})})})]})]})}function iAe(e){const{theme:t,name:n,props:r}=e;return!t||!t.components||!t.components[n]||!t.components[n].defaultProps?r:am(t.components[n].defaultProps,r)}function sAe({props:e,name:t,defaultTheme:n,themeId:r}){let o=hae(n);return o=o[r]||o,iAe({theme:o,name:t,props:e})}function lAe({props:e,name:t}){return sAe({props:e,name:t,defaultTheme:Dv,themeId:Iv})}function cAe(e){return en("MuiCollapse",e)}Wt("MuiCollapse",["root","horizontal","vertical","entered","hidden","wrapper","wrapperInner"]);const uAe=e=>{const{orientation:t,classes:n}=e,r={root:["root",`${t}`],entered:["entered"],hidden:["hidden"],wrapper:["wrapper",`${t}`],wrapperInner:["wrapperInner",`${t}`]};return Jt(r,cAe,n)},dAe=Ye("div",{name:"MuiCollapse",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.orientation],n.state==="entered"&&t.entered,n.state==="exited"&&!n.in&&n.collapsedSize==="0px"&&t.hidden]}})(hn(({theme:e})=>({height:0,overflow:"hidden",transition:e.transitions.create("height"),variants:[{props:{orientation:"horizontal"},style:{height:"auto",width:0,transition:e.transitions.create("width")}},{props:{state:"entered"},style:{height:"auto",overflow:"visible"}},{props:{state:"entered",orientation:"horizontal"},style:{width:"auto"}},{props:({ownerState:t})=>t.state==="exited"&&!t.in&&t.collapsedSize==="0px",style:{visibility:"hidden"}}]}))),pAe=Ye("div",{name:"MuiCollapse",slot:"Wrapper"})({display:"flex",width:"100%",variants:[{props:{orientation:"horizontal"},style:{width:"auto",height:"100%"}}]}),fAe=Ye("div",{name:"MuiCollapse",slot:"WrapperInner"})({width:"100%",variants:[{props:{orientation:"horizontal"},style:{width:"auto",height:"100%"}}]}),ym=A.forwardRef(function(e,t){const n=sn({props:e,name:"MuiCollapse"}),{addEndListener:r,children:o,className:a,collapsedSize:i="0px",component:l,easing:u,in:d,onEnter:p,onEntered:h,onEntering:y,onExit:g,onExited:b,onExiting:x,orientation:S="vertical",style:E,timeout:_=r6.standard,TransitionComponent:C=hi,...R}=n,O={...n,orientation:S,collapsedSize:i},I=uAe(O),F=dp(),H=Uv(),z=A.useRef(null),L=A.useRef(),$=typeof i=="number"?`${i}px`:i,k=S==="horizontal",M=k?"width":"height",j=A.useRef(null),V=sr(t,j),B=Z=>ae=>{if(Z){const J=j.current;ae===void 0?Z(J):Z(J,ae)}},q=()=>z.current?z.current[k?"clientWidth":"clientHeight"]:0,Y=B((Z,ae)=>{z.current&&k&&(z.current.style.position="absolute"),Z.style[M]=$,p&&p(Z,ae)}),ee=B((Z,ae)=>{const J=q();z.current&&k&&(z.current.style.position="");const{duration:pe,easing:le}=Xd({style:E,timeout:_,easing:u},{mode:"enter"});if(_==="auto"){const Ee=F.transitions.getAutoHeightDuration(J);Z.style.transitionDuration=`${Ee}ms`,L.current=Ee}else Z.style.transitionDuration=typeof pe=="string"?pe:`${pe}ms`;Z.style[M]=`${J}px`,Z.style.transitionTimingFunction=le,y&&y(Z,ae)}),N=B((Z,ae)=>{Z.style[M]="auto",h&&h(Z,ae)}),W=B(Z=>{Z.style[M]=`${q()}px`,g&&g(Z)}),K=B(b),P=B(Z=>{const ae=q(),{duration:J,easing:pe}=Xd({style:E,timeout:_,easing:u},{mode:"exit"});if(_==="auto"){const le=F.transitions.getAutoHeightDuration(ae);Z.style.transitionDuration=`${le}ms`,L.current=le}else Z.style.transitionDuration=typeof J=="string"?J:`${J}ms`;Z.style[M]=$,Z.style.transitionTimingFunction=pe,x&&x(Z)});return v.jsx(C,{in:d,onEnter:Y,onEntered:N,onEntering:ee,onExit:W,onExited:K,onExiting:P,addEndListener:Z=>{_==="auto"&&H.start(L.current||0,Z),r&&r(j.current,Z)},nodeRef:j,timeout:_==="auto"?null:_,...R,children:(Z,{ownerState:ae,...J})=>v.jsx(dAe,{as:l,className:Tt(I.root,a,{entered:I.entered,exited:!d&&$==="0px"&&I.hidden}[Z]),style:{[k?"minWidth":"minHeight"]:$,...E},ref:V,ownerState:{...O,state:Z},...J,children:v.jsx(pAe,{ownerState:{...O,state:Z},className:I.wrapper,ref:z,children:v.jsx(fAe,{ownerState:{...O,state:Z},className:I.wrapperInner,children:o})})})})});ym&&(ym.muiSupportAuto=!0);function hAe(e){return en("PrivateSwitchBase",e)}Wt("PrivateSwitchBase",["root","checked","disabled","input","edgeStart","edgeEnd"]);const mAe=e=>{const{classes:t,checked:n,disabled:r,edge:o}=e,a={root:["root",n&&"checked",r&&"disabled",o&&`edge${Ze(o)}`],input:["input"]};return Jt(a,hAe,t)},gAe=Ye(Kd,{name:"MuiSwitchBase"})({padding:9,borderRadius:"50%",variants:[{props:{edge:"start",size:"small"},style:{marginLeft:-3}},{props:({edge:e,ownerState:t})=>e==="start"&&t.size!=="small",style:{marginLeft:-12}},{props:{edge:"end",size:"small"},style:{marginRight:-3}},{props:({edge:e,ownerState:t})=>e==="end"&&t.size!=="small",style:{marginRight:-12}}]}),yAe=Ye("input",{name:"MuiSwitchBase",shouldForwardProp:Do})({cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}),bAe=A.forwardRef(function(e,t){const{autoFocus:n,checked:r,checkedIcon:o,defaultChecked:a,disabled:i,disableFocusRipple:l=!1,edge:u=!1,icon:d,id:p,inputProps:h,inputRef:y,name:g,onBlur:b,onChange:x,onFocus:S,readOnly:E,required:_=!1,tabIndex:C,type:R,value:O,slots:I={},slotProps:F={},...H}=e,[z,L]=kd({controlled:r,default:!!a,name:"SwitchBase",state:"checked"}),$=uu(),k=Z=>{S&&S(Z),$&&$.onFocus&&$.onFocus(Z)},M=Z=>{b&&b(Z),$&&$.onBlur&&$.onBlur(Z)},j=Z=>{if(Z.nativeEvent.defaultPrevented)return;const ae=Z.target.checked;L(ae),x&&x(Z,ae)};let V=i;$&&typeof V>"u"&&(V=$.disabled);const B=R==="checkbox"||R==="radio",q={...e,checked:z,disabled:V,disableFocusRipple:l,edge:u},Y=mAe(q),ee={slots:I,slotProps:{input:h,...F}},[N,W]=xn("root",{ref:t,elementType:gAe,className:Y.root,shouldForwardComponentProp:!0,externalForwardedProps:{...ee,component:"span",...H},getSlotProps:Z=>({...Z,onFocus:ae=>{Z.onFocus?.(ae),k(ae)},onBlur:ae=>{Z.onBlur?.(ae),M(ae)}}),ownerState:q,additionalProps:{centerRipple:!0,focusRipple:!l,disabled:V,role:void 0,tabIndex:null}}),[K,P]=xn("input",{ref:y,elementType:yAe,className:Y.input,externalForwardedProps:ee,getSlotProps:Z=>({...Z,onChange:ae=>{Z.onChange?.(ae),j(ae)}}),ownerState:q,additionalProps:{autoFocus:n,checked:r,defaultChecked:a,disabled:V,id:B?p:void 0,name:g,readOnly:E,required:_,tabIndex:C,type:R,...R==="checkbox"&&O===void 0?{}:{value:O}}});return v.jsxs(N,{...W,children:[v.jsx(K,{...P}),z?o:d]})}),vAe=On(v.jsx("path",{d:"M19 5v14H5V5h14m0-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-2z"})),EAe=On(v.jsx("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"})),xAe=On(v.jsx("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"}));function SAe(e){return en("MuiCheckbox",e)}const BS=Wt("MuiCheckbox",["root","checked","disabled","indeterminate","colorPrimary","colorSecondary","sizeSmall","sizeMedium"]),TAe=e=>{const{classes:t,indeterminate:n,color:r,size:o}=e,a={root:["root",n&&"indeterminate",`color${Ze(r)}`,`size${Ze(o)}`]},i=Jt(a,SAe,t);return{...t,...i}},CAe=Ye(bAe,{shouldForwardProp:e=>Do(e)||e==="classes",name:"MuiCheckbox",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.indeterminate&&t.indeterminate,t[`size${Ze(n.size)}`],n.color!=="default"&&t[`color${Ze(n.color)}`]]}})(hn(({theme:e})=>({color:(e.vars||e).palette.text.secondary,variants:[{props:{color:"default",disableRipple:!1},style:{"&:hover":{backgroundColor:e.alpha((e.vars||e).palette.action.active,(e.vars||e).palette.action.hoverOpacity)}}},...Object.entries(e.palette).filter(ko()).map(([t])=>({props:{color:t,disableRipple:!1},style:{"&:hover":{backgroundColor:e.alpha((e.vars||e).palette[t].main,(e.vars||e).palette.action.hoverOpacity)}}})),...Object.entries(e.palette).filter(ko()).map(([t])=>({props:{color:t},style:{[`&.${BS.checked}, &.${BS.indeterminate}`]:{color:(e.vars||e).palette[t].main},[`&.${BS.disabled}`]:{color:(e.vars||e).palette.action.disabled}}})),{props:{disableRipple:!1},style:{"&:hover":{"@media (hover: none)":{backgroundColor:"transparent"}}}}]}))),AAe=v.jsx(EAe,{}),_Ae=v.jsx(vAe,{}),kAe=v.jsx(xAe,{}),J7=A.forwardRef(function(e,t){const n=sn({props:e,name:"MuiCheckbox"}),{checkedIcon:r=AAe,color:o="primary",icon:a=_Ae,indeterminate:i=!1,indeterminateIcon:l=kAe,inputProps:u,size:d="medium",disableRipple:p=!1,className:h,slots:y={},slotProps:g={},...b}=n,x=i?l:a,S=i?l:r,E={...n,disableRipple:p,color:o,indeterminate:i,size:d},_=TAe(E),C=g.input??u,[R,O]=xn("root",{ref:t,elementType:CAe,className:Tt(_.root,h),shouldForwardComponentProp:!0,externalForwardedProps:{slots:y,slotProps:g,...b},ownerState:E,additionalProps:{type:"checkbox",icon:A.cloneElement(x,{fontSize:x.props.fontSize??d}),checkedIcon:A.cloneElement(S,{fontSize:S.props.fontSize??d}),disableRipple:p,slots:y,slotProps:{input:u6(typeof C=="function"?C(E):C,{"data-indeterminate":i})}}});return v.jsx(R,{...O,classes:_})});function ej(e){return lAe}const tj=A.createContext(null);function wAe(e){const{value:t,children:n}=e;return v.jsx(tj.Provider,{value:t,children:t.wrapRoot({children:n,instance:t.instance})})}const fu=()=>{const e=A.useContext(tj);if(e==null)throw new Error(["MUI X: Could not find the Tree View context.","It looks like you rendered your component outside of a SimpleTreeView or RichTreeView parent component.","This can also happen if you are bundling multiple versions of the Tree View."].join(`
441
441
  `));return e},RAe=({props:e})=>{const{instance:t}=fu(),{label:n,itemId:r}=e,[o,a]=A.useState(n),i=t.isItemBeingEdited(r);return A.useEffect(()=>{i||a(n)},[i,n]),{propsEnhancers:{labelInput:({externalEventHandlers:l,interactions:u})=>t.isItemEditable(r)?{value:o??"","data-element":"labelInput",onChange:d=>{l.onChange?.(d),a(d.target.value)},onKeyDown:d=>{if(l.onKeyDown?.(d),d.defaultMuiPrevented)return;const p=d.target;d.key==="Enter"&&p.value?u.handleSaveItemLabel(d,p.value):d.key==="Escape"&&u.handleCancelItemLabelEditing(d)},onBlur:d=>{l.onBlur?.(d),!d.defaultMuiPrevented&&d.target.value&&u.handleSaveItemLabel(d,d.target.value)},autoFocus:!0,type:"text"}:{}}}},Wa=({instance:e,state:t,setState:n,params:r})=>{const o=A.useRef(t.editedItemId),a=h=>o.current===h,i=h=>{n(y=>Ke({},y,{editedItemId:h})),o.current=h},l=h=>h===t.editedItemId,u=!!r.isItemEditable,d=h=>{if(h==null||!u)return!1;const y=e.getItem(h);return y?typeof r.isItemEditable=="function"?r.isItemEditable(y):!!r.isItemEditable:!1},p=(h,y)=>{if(!y)throw new Error(["MUI X: The Tree View component requires all items to have a `label` property.","The label of an item cannot be empty.",h].join(`
442
442
  `));n(g=>{const b=g.items.itemMetaMap[h];return b.label!==y?Ke({},g,{items:Ke({},g.items,{itemMetaMap:Ke({},g.items.itemMetaMap,{[h]:Ke({},b,{label:y})})})}):g}),r.onItemLabelChange&&r.onItemLabelChange(h,y)};return{instance:{setEditedItemId:i,isItemBeingEdited:l,updateItemLabel:p,isItemEditable:d,isTreeViewEditable:u,isItemBeingEditedRef:a},publicAPI:{updateItemLabel:p}}};Wa.itemPlugin=RAe;Wa.getDefaultizedParams=({params:e,experimentalFeatures:t})=>{const n=t?.labelEditing;return Ke({},e,{isItemEditable:n?e.isItemEditable??!1:!1})};Wa.getInitialState=()=>({editedItemId:null});Wa.params={onItemLabelChange:!0,isItemEditable:!0};const Vc=(e,t)=>e.getAvailablePlugins().has(t),nj=e=>Array.isArray(e)?e.length>0&&e.some(nj):!!e,DAe=({itemId:e,children:t})=>{const{instance:n,selection:{multiSelect:r},publicAPI:o}=fu(),a={expandable:nj(t),expanded:n.isItemExpanded(e),focused:n.isItemFocused(e),selected:n.isItemSelected(e),disabled:n.isItemDisabled(e),editing:n?.isItemBeingEdited?n?.isItemBeingEdited(e):!1,editable:n.isItemEditable?n.isItemEditable(e):!1},i=p=>{if(a.disabled)return;a.focused||n.focusItem(p,e);const h=r&&(p.shiftKey||p.ctrlKey||p.metaKey);a.expandable&&!(h&&n.isItemExpanded(e))&&n.toggleItemExpansion(p,e)},l=p=>{a.disabled||(!a.focused&&!a.editing&&n.focusItem(p,e),r&&(p.shiftKey||p.ctrlKey||p.metaKey)?p.shiftKey?n.expandSelectionRange(p,e):n.selectItem({event:p,itemId:e,keepExistingSelection:!0}):n.selectItem({event:p,itemId:e,shouldBeSelected:!0}))},u=p=>{const h=p.nativeEvent.shiftKey;r&&h?n.expandSelectionRange(p,e):n.selectItem({event:p,itemId:e,keepExistingSelection:r,shouldBeSelected:p.target.checked})},d=()=>{Vc(n,Wa)&&n.isItemEditable(e)&&(n.isItemBeingEdited(e)?n.setEditedItemId(null):n.setEditedItemId(e))};return{interactions:{handleExpansion:i,handleSelection:l,handleCheckboxSelection:u,toggleItemEditing:d,handleSaveItemLabel:(p,h)=>{Vc(n,Wa)&&n.isItemBeingEditedRef(e)&&(n.updateItemLabel(e,h),d(),n.focusItem(p,e))},handleCancelItemLabelEditing:p=>{Vc(n,Wa)&&n.isItemBeingEditedRef(e)&&(d(),n.focusItem(p,e))}},status:a,publicAPI:o}},pk=A.createContext(()=>-1),rj=(e,t)=>{let n=t.length-1;for(;n>=0&&!e.isItemNavigable(t[n]);)n-=1;if(n!==-1)return t[n]},oj=(e,t)=>{const n=e.getItemMeta(t),r=e.getItemOrderedChildrenIds(n.parentId),o=e.getItemIndex(t);if(o===0)return n.parentId;let a=o-1;for(;!e.isItemNavigable(r[a])&&a>=0;)a-=1;if(a===-1)return n.parentId==null?null:oj(e,n.parentId);let i=r[a],l=rj(e,e.getItemOrderedChildrenIds(i));for(;e.isItemExpanded(i)&&l!=null;)i=l,l=e.getItemOrderedChildrenIds(i).find(e.isItemNavigable);return i},T0=(e,t)=>{if(e.isItemExpanded(t)){const r=e.getItemOrderedChildrenIds(t).find(e.isItemNavigable);if(r!=null)return r}let n=e.getItemMeta(t);for(;n!=null;){const r=e.getItemOrderedChildrenIds(n.parentId),o=e.getItemIndex(n.id);if(o<r.length-1){let a=o+1;for(;!e.isItemNavigable(r[a])&&a<r.length-1;)a+=1;if(e.isItemNavigable(r[a]))return r[a]}n=e.getItemMeta(n.parentId)}return null},aj=e=>{let t=null;for(;t==null||e.isItemExpanded(t);){const n=e.getItemOrderedChildrenIds(t),r=rj(e,n);if(r==null)return t;t=r}return t},bm=e=>e.getItemOrderedChildrenIds(null).find(e.isItemNavigable),ij=(e,t,n)=>{if(t===n)return[t,n];const r=e.getItemMeta(t),o=e.getItemMeta(n);if(r.parentId===o.id||o.parentId===r.id)return o.parentId===r.id?[r.id,o.id]:[o.id,r.id];const a=[r.id],i=[o.id];let l=r.parentId,u=o.parentId,d=i.indexOf(l)!==-1,p=a.indexOf(u)!==-1,h=!0,y=!0;for(;!p&&!d;)h&&(a.push(l),d=i.indexOf(l)!==-1,h=l!==null,!d&&h&&(l=e.getItemMeta(l).parentId)),y&&!d&&(i.push(u),p=a.indexOf(u)!==-1,y=u!==null,!p&&y&&(u=e.getItemMeta(u).parentId));const g=d?l:u,b=e.getItemOrderedChildrenIds(g),x=a[a.indexOf(g)-1],S=i[i.indexOf(g)-1];return b.indexOf(x)<b.indexOf(S)?[t,n]:[n,t]},IAe=(e,t,n)=>{const r=u=>{if(e.isItemExpandable(u)&&e.isItemExpanded(u))return e.getItemOrderedChildrenIds(u)[0];let d=e.getItemMeta(u);for(;d!=null;){const p=e.getItemOrderedChildrenIds(d.parentId),h=e.getItemIndex(d.id);if(h<p.length-1)return p[h+1];d=e.getItemMeta(d.parentId)}throw new Error("Invalid range")},[o,a]=ij(e,t,n),i=[o];let l=o;for(;l!==a;)l=r(l),e.isItemDisabled(l)||i.push(l);return i},OAe=e=>{let t=bm(e);const n=[];for(;t!=null;)n.push(t),t=T0(e,t);return n},vm=(e,t)=>t!==e.closest('*[role="treeitem"]');let y3=0;const NAe=()=>(y3+=1,`mui-tree-view-${y3}`),fk=({id:e,treeId:t="",itemId:n})=>e??`${t}-${n}`,PAe=e=>{const{runItemPlugins:t,items:{onItemClick:n,disabledItemsFocusable:r,indentationAtItemLevel:o},selection:{disableSelection:a,checkboxSelection:i},expansion:{expansionTrigger:l},treeId:u,instance:d,publicAPI:p}=fu(),h=A.useContext(pk),{id:y,itemId:g,label:b,children:x,rootRef:S}=e,{rootRef:E,contentRef:_,propsEnhancers:C}=t(e),{interactions:R,status:O}=DAe({itemId:g,children:x}),I=A.useRef(null),F=A.useRef(null),H=sr(S,E,I),z=sr(_,F),L=A.useRef(null),$=fk({itemId:g,treeId:u,id:y}),k=d.canItemBeTabbed(g)?0:-1,M={rootRefObject:I,contentRefObject:F,interactions:R},j=K=>P=>{if(K.onFocus?.(P),P.defaultMuiPrevented)return;const Z=!O.disabled||r;!O.focused&&Z&&P.currentTarget===P.target&&d.focusItem(P,g)},V=K=>P=>{if(K.onBlur?.(P),P.defaultMuiPrevented)return;const Z=d.getItemDOMElement(g);O.editing||P.relatedTarget&&vm(P.relatedTarget,Z)&&(P.target&&P.target?.dataset?.element==="labelInput"&&vm(P.target,Z)||P.relatedTarget?.dataset?.element==="labelInput")||d.removeFocusedItem()},B=K=>P=>{K.onKeyDown?.(P),!(P.defaultMuiPrevented||P.target?.dataset?.element==="labelInput")&&d.handleItemKeyDown(P,g)},q=K=>P=>{K.onDoubleClick?.(P),!P.defaultMuiPrevented&&R.toggleItemEditing()},Y=K=>P=>{K.onClick?.(P),n?.(P,g),!(P.defaultMuiPrevented||L.current?.contains(P.target))&&(l==="content"&&R.handleExpansion(P),i||R.handleSelection(P))},ee=K=>P=>{K.onMouseDown?.(P),!P.defaultMuiPrevented&&(P.shiftKey||P.ctrlKey||P.metaKey||O.disabled)&&P.preventDefault()},N=K=>P=>{K.onChange?.(P),!P.defaultMuiPrevented&&(a||O.disabled||R.handleCheckboxSelection(P))},W=K=>P=>{K.onClick?.(P),!P.defaultMuiPrevented&&l==="iconContainer"&&R.handleExpansion(P)};return{getRootProps:(K={})=>{const P=Ke({},To(e),To(K));let Z;O.selected?Z=!0:a||O.disabled?Z=void 0:Z=!1;const ae=Ke({},P,{ref:H,role:"treeitem",tabIndex:k,id:$,"aria-expanded":O.expandable?O.expanded:void 0,"aria-selected":Z,"aria-disabled":O.disabled||void 0},K,{onFocus:j(P),onBlur:V(P),onKeyDown:B(P)});o&&(ae.style={"--TreeView-itemDepth":typeof h=="function"?h(g):h});const J=C.root?.(Ke({},M,{externalEventHandlers:P}))??{};return Ke({},ae,J)},getContentProps:(K={})=>{const P=To(K),Z=Ke({},P,K,{ref:z,onClick:Y(P),onMouseDown:ee(P),status:O});o&&(Z.indentationAtItemLevel=!0);const ae=C.content?.(Ke({},M,{externalEventHandlers:P}))??{};return Ke({},Z,ae)},getGroupTransitionProps:(K={})=>{const P=To(K),Z=Ke({},P,{unmountOnExit:!0,component:"ul",role:"group",in:O.expanded,children:x},K);return o&&(Z.indentationAtItemLevel=!0),Z},getIconContainerProps:(K={})=>{const P=To(K);return Ke({},P,K,{onClick:W(P)})},getCheckboxProps:(K={})=>{const P=To(K);return Ke({},P,{visible:i,ref:L,checked:O.selected,disabled:a||O.disabled,tabIndex:-1},K,{onChange:N(P)})},getLabelProps:(K={})=>{const P=Ke({},To(K)),Z=Ke({},P,{children:b},K,{onDoubleClick:q(P)});return d.isTreeViewEditable&&(Z.editable=O.editable),Z},getLabelInputProps:(K={})=>{const P=To(K),Z=C.labelInput?.({rootRefObject:I,contentRefObject:F,externalEventHandlers:P,interactions:R})??{};return Ke({},K,Z)},getDragAndDropOverlayProps:(K={})=>{const P=To(K),Z=C.dragAndDropOverlay?.(Ke({},M,{externalEventHandlers:P}))??{};return Ke({},K,Z)},rootRef:H,status:O,publicAPI:p}},LAe=PAe;function sj(e){const{instance:t,items:{onItemClick:n},selection:{multiSelect:r,checkboxSelection:o,disableSelection:a},expansion:{expansionTrigger:i}}=fu(),l=t.isItemExpandable(e),u=t.isItemExpanded(e),d=t.isItemFocused(e),p=t.isItemSelected(e),h=t.isItemDisabled(e),y=t?.isItemBeingEdited?t?.isItemBeingEdited(e):!1,g=t.isItemEditable?t.isItemEditable(e):!1,b=C=>{if(!h){d||t.focusItem(C,e);const R=r&&(C.shiftKey||C.ctrlKey||C.metaKey);l&&!(R&&t.isItemExpanded(e))&&t.toggleItemExpansion(C,e)}},x=C=>{h||(!d&&!y&&t.focusItem(C,e),r&&(C.shiftKey||C.ctrlKey||C.metaKey)?C.shiftKey?t.expandSelectionRange(C,e):t.selectItem({event:C,itemId:e,keepExistingSelection:!0}):t.selectItem({event:C,itemId:e,shouldBeSelected:!0}))},S=C=>{if(a||h)return;const R=C.nativeEvent.shiftKey;r&&R?t.expandSelectionRange(C,e):t.selectItem({event:C,itemId:e,keepExistingSelection:r,shouldBeSelected:C.target.checked})},E=C=>{(C.shiftKey||C.ctrlKey||C.metaKey||h)&&C.preventDefault()},_=()=>{Vc(t,Wa)&&t.isItemEditable(e)&&(t.isItemBeingEdited(e)?t.setEditedItemId(null):t.setEditedItemId(e))};return{disabled:h,expanded:u,selected:p,focused:d,editable:g,editing:y,disableSelection:a,checkboxSelection:o,handleExpansion:b,handleSelection:x,handleCheckboxSelection:S,handleContentClick:n,preventSelection:E,expansionTrigger:i,toggleItemEditing:_,handleSaveItemLabel:(C,R)=>{Vc(t,Wa)&&t.isItemBeingEditedRef(e)&&(t.updateItemLabel(e,R),_(),t.focusItem(C,e))},handleCancelItemLabelEditing:C=>{Vc(t,Wa)&&t.isItemBeingEditedRef(e)&&(_(),t.focusItem(C,e))}}}const MAe=Ye("div",{name:"MuiTreeItem2DragAndDropOverlay",slot:"Root",overridesResolver:(e,t)=>t.root,shouldForwardProp:e=>Jy(e)&&e!=="action"})(({theme:e})=>({position:"absolute",left:0,display:"flex",top:0,bottom:0,right:0,pointerEvents:"none",variants:[{props:{action:"make-child"},style:{marginLeft:"calc(var(--TreeView-indentMultiplier) * var(--TreeView-itemDepth))",borderRadius:e.shape.borderRadius,backgroundColor:e.vars?`rgba(${e.vars.palette.primary.darkChannel} / ${e.vars.palette.action.focusOpacity})`:ha(e.palette.primary.dark,e.palette.action.focusOpacity)}},{props:{action:"reorder-above"},style:{marginLeft:"calc(var(--TreeView-indentMultiplier) * var(--TreeView-itemDepth))",borderTop:`1px solid ${(e.vars||e).palette.action.active}`}},{props:{action:"reorder-below"},style:{marginLeft:"calc(var(--TreeView-indentMultiplier) * var(--TreeView-itemDepth))",borderBottom:`1px solid ${(e.vars||e).palette.action.active}`}},{props:{action:"move-to-parent"},style:{marginLeft:"calc(var(--TreeView-indentMultiplier) * calc(var(--TreeView-itemDepth) - 1))",borderBottom:`1px solid ${(e.vars||e).palette.action.active}`}}]}));function FAe(e){return e.action==null?null:v.jsx(MAe,Ke({},e))}const jAe=Ye("input",{name:"MuiTreeItem2",slot:"LabelInput",overridesResolver:(e,t)=>t.labelInput})(({theme:e})=>Ke({},e.typography.body1,{width:"100%",backgroundColor:e.palette.background.paper,borderRadius:e.shape.borderRadius,border:"none",padding:"0 2px",boxSizing:"border-box","&:focus":{outline:`1px solid ${e.palette.primary.main}`}})),BAe=["classes","className","displayIcon","expansionIcon","icon","label","itemId","onClick","onMouseDown","dragAndDropOverlayProps","labelInputProps"],lj=A.forwardRef(function(e,t){const{classes:n,className:r,displayIcon:o,expansionIcon:a,icon:i,label:l,itemId:u,onClick:d,onMouseDown:p,dragAndDropOverlayProps:h,labelInputProps:y}=e,g=ho(e,BAe),{disabled:b,expanded:x,selected:S,focused:E,editing:_,editable:C,disableSelection:R,checkboxSelection:O,handleExpansion:I,handleSelection:F,handleCheckboxSelection:H,handleContentClick:z,preventSelection:L,expansionTrigger:$,toggleItemEditing:k}=sj(u),M=i||a||o,j=A.useRef(null),V=Y=>{L(Y),p&&p(Y)},B=Y=>{z?.(Y,u),!j.current?.contains(Y.target)&&($==="content"&&I(Y),O||F(Y),d&&d(Y))},q=Y=>{Y.defaultMuiPrevented||k()};return v.jsxs("div",Ke({},g,{className:Tt(n.root,r,x&&n.expanded,S&&n.selected,E&&n.focused,b&&n.disabled,_&&n.editing,C&&n.editable),onClick:B,onMouseDown:V,ref:t,children:[v.jsx("div",{className:n.iconContainer,children:M}),O&&v.jsx(J7,{className:n.checkbox,checked:S,onChange:H,disabled:b||R,ref:j,tabIndex:-1}),_?v.jsx(jAe,Ke({},y,{className:n.labelInput})):v.jsx("div",Ke({className:n.label},C&&{onDoubleClick:q},{children:l})),h&&v.jsx(FAe,Ke({},h))]}))});function UAe(e){return en("MuiTreeItem",e)}const Es=Wt("MuiTreeItem",["root","groupTransition","content","expanded","selected","focused","disabled","iconContainer","label","checkbox","labelInput","editable","editing","dragAndDropOverlay"]),cj=On(v.jsx("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"})),uj=On(v.jsx("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"}));function hk(e){const{children:t,itemId:n}=e,{wrapItem:r,instance:o}=fu();return r({children:t,itemId:n,instance:o})}hk.propTypes={children:uN.node,itemId:uN.string.isRequired};const zAe=["children","className","slots","slotProps","ContentComponent","ContentProps","itemId","id","label","onClick","onMouseDown","onFocus","onBlur","onKeyDown"],$Ae=["ownerState"],HAe=["ownerState"],VAe=["ownerState"],GAe=ej(),qAe=e=>{const{classes:t}=e;return Jt({root:["root"],content:["content"],expanded:["expanded"],selected:["selected"],focused:["focused"],disabled:["disabled"],iconContainer:["iconContainer"],checkbox:["checkbox"],label:["label"],labelInput:["labelInput"],editing:["editing"],editable:["editable"],groupTransition:["groupTransition"]},UAe,t)},WAe=Ye("li",{name:"MuiTreeItem",slot:"Root",overridesResolver:(e,t)=>t.root})({listStyle:"none",margin:0,padding:0,outline:0}),YAe=Ye(lj,{name:"MuiTreeItem",slot:"Content",overridesResolver:(e,t)=>[t.content,t.iconContainer&&{[`& .${Es.iconContainer}`]:t.iconContainer},t.label&&{[`& .${Es.label}`]:t.label}],shouldForwardProp:e=>Ll(e)&&e!=="indentationAtItemLevel"})(({theme:e})=>({padding:e.spacing(.5,1),borderRadius:e.shape.borderRadius,width:"100%",boxSizing:"border-box",position:"relative",display:"flex",alignItems:"center",gap:e.spacing(1),cursor:"pointer",WebkitTapHighlightColor:"transparent","&:hover":{backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${Es.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity,backgroundColor:"transparent"},[`&.${Es.focused}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${Es.selected}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:ha(e.palette.primary.main,e.palette.action.selectedOpacity),"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:ha(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:ha(e.palette.primary.main,e.palette.action.selectedOpacity)}},[`&.${Es.focused}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:ha(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}},[`& .${Es.iconContainer}`]:{width:16,display:"flex",flexShrink:0,justifyContent:"center","& svg":{fontSize:18}},[`& .${Es.label}`]:Ke({width:"100%",boxSizing:"border-box",minWidth:0,position:"relative"},e.typography.body1),[`& .${Es.checkbox}`]:{padding:0},variants:[{props:{indentationAtItemLevel:!0},style:{paddingLeft:`calc(${e.spacing(1)} + var(--TreeView-itemChildrenIndentation) * var(--TreeView-itemDepth))`}}]})),KAe=Ye(ym,{name:"MuiTreeItem",slot:"GroupTransition",overridesResolver:(e,t)=>t.groupTransition,shouldForwardProp:e=>Ll(e)&&e!=="indentationAtItemLevel"})({margin:0,padding:0,paddingLeft:"var(--TreeView-itemChildrenIndentation)",variants:[{props:{indentationAtItemLevel:!0},style:{paddingLeft:0}}]}),QAe=A.forwardRef(function(e,t){const{icons:n,runItemPlugins:r,items:{disabledItemsFocusable:o,indentationAtItemLevel:a},selection:{disableSelection:i},expansion:{expansionTrigger:l},treeId:u,instance:d}=fu(),p=A.useContext(pk),h=GAe({props:e,name:"MuiTreeItem"}),{children:y,className:g,slots:b,slotProps:x,ContentComponent:S=lj,ContentProps:E,itemId:_,id:C,label:R,onClick:O,onMouseDown:I,onBlur:F,onKeyDown:H}=h,z=ho(h,zAe),{expanded:L,focused:$,selected:k,disabled:M,editing:j,handleExpansion:V,handleCancelItemLabelEditing:B,handleSaveItemLabel:q}=sj(_),{contentRef:Y,rootRef:ee,propsEnhancers:N}=r(h),W=A.useRef(null),K=A.useRef(null),P=sr(t,ee,W),Z=sr(E?.ref,Y,K),ae={expandIcon:b?.expandIcon??n.slots.expandIcon??cj,collapseIcon:b?.collapseIcon??n.slots.collapseIcon??uj,endIcon:b?.endIcon??n.slots.endIcon,icon:b?.icon,groupTransition:b?.groupTransition},J=he=>Array.isArray(he)?he.length>0&&he.some(J):!!he,pe=J(y),le=Ke({},h,{expanded:L,focused:$,selected:k,disabled:M,indentationAtItemLevel:a}),Ee=qAe(le),Te=ae.groupTransition??void 0,Ae=Cs({elementType:Te,ownerState:{},externalSlotProps:x?.groupTransition,additionalProps:Ke({unmountOnExit:!0,in:L,component:"ul",role:"group"},a?{indentationAtItemLevel:!0}:{}),className:Ee.groupTransition}),Ue=he=>{l==="iconContainer"&&V(he)},Re=L?ae.collapseIcon:ae.expandIcon,ve=Cs({elementType:Re,ownerState:{},externalSlotProps:he=>L?Ke({},Oi(n.slotProps.collapseIcon,he),Oi(x?.collapseIcon,he)):Ke({},Oi(n.slotProps.expandIcon,he),Oi(x?.expandIcon,he)),additionalProps:{onClick:Ue}}),pt=ho(ve,$Ae),ut=pe&&Re?v.jsx(Re,Ke({},pt)):null,ze=pe?void 0:ae.endIcon,$e=Cs({elementType:ze,ownerState:{},externalSlotProps:he=>pe?{}:Ke({},Oi(n.slotProps.endIcon,he),Oi(x?.endIcon,he))}),dt=ho($e,HAe),Be=ze?v.jsx(ze,Ke({},dt)):null,Fe=ae.icon,Me=Cs({elementType:Fe,ownerState:{},externalSlotProps:x?.icon}),At=ho(Me,VAe),Dt=Fe?v.jsx(Fe,Ke({},At)):null;let gt;k?gt=!0:i||M?gt=void 0:gt=!1;function ue(he){!$&&(!M||o)&&he.currentTarget===he.target&&d.focusItem(he,_)}function ge(he){F?.(he),!(j||he.relatedTarget&&vm(he.relatedTarget,W.current)&&(he.target&&he.target?.dataset?.element==="labelInput"&&vm(he.target,W.current)||he.relatedTarget?.dataset?.element==="labelInput"))&&d.removeFocusedItem()}const He=he=>{H?.(he),he.target?.dataset?.element!=="labelInput"&&d.handleItemKeyDown(he,_)},rt=fk({itemId:_,treeId:u,id:C}),tt=d.canItemBeTabbed(_)?0:-1,qe={rootRefObject:W,contentRefObject:K,interactions:{handleSaveItemLabel:q,handleCancelItemLabelEditing:B}},Ut=N.root?.(Ke({},qe,{externalEventHandlers:To(z)}))??{},Gt=N.content?.(Ke({},qe,{externalEventHandlers:To(E)}))??{},nt=N.dragAndDropOverlay?.(Ke({},qe,{externalEventHandlers:{}}))??{},se=N.labelInput?.(Ke({},qe,{externalEventHandlers:{}}))??{};return v.jsx(hk,{itemId:_,children:v.jsxs(WAe,Ke({className:Tt(Ee.root,g),role:"treeitem","aria-expanded":pe?L:void 0,"aria-selected":gt,"aria-disabled":M||void 0,id:rt,tabIndex:tt},z,{ownerState:le,onFocus:ue,onBlur:ge,onKeyDown:He,ref:P,style:a?Ke({},z.style,{"--TreeView-itemDepth":typeof p=="function"?p(_):p}):z.style},Ut,{children:[v.jsx(YAe,Ke({as:S,classes:{root:Ee.content,expanded:Ee.expanded,selected:Ee.selected,focused:Ee.focused,disabled:Ee.disabled,editable:Ee.editable,editing:Ee.editing,iconContainer:Ee.iconContainer,label:Ee.label,labelInput:Ee.labelInput,checkbox:Ee.checkbox},label:R,itemId:_,onClick:O,onMouseDown:I,icon:Dt,expansionIcon:ut,displayIcon:Be,ownerState:le},E,Gt,nt.action==null?{}:{dragAndDropOverlayProps:nt},se.value==null?{}:{labelInputProps:se},{ref:Z})),y&&v.jsx(KAe,Ke({as:Te},Ae,{children:y}))]}))})});function XAe(e){const{slots:t,slotProps:n,status:r}=e,o=fu(),a=Ke({},o.icons.slots,{expandIcon:o.icons.slots.expandIcon??cj,collapseIcon:o.icons.slots.collapseIcon??uj}),i=o.icons.slotProps;let l;t?.icon?l="icon":r.expandable?r.expanded?l="collapseIcon":l="expandIcon":l="endIcon";const u=t?.[l]??a[l],d=Cs({elementType:u,externalSlotProps:p=>Ke({},Oi(i[l],p),Oi(n?.[l],p)),ownerState:{}});return u?v.jsx(u,Ke({},d)):null}const ZAe=["visible"],JAe=Ye("li",{name:"MuiTreeItem2",slot:"Root",overridesResolver:(e,t)=>t.root})({listStyle:"none",margin:0,padding:0,outline:0}),e_e=Ye("div",{name:"MuiTreeItem2",slot:"Content",overridesResolver:(e,t)=>t.content,shouldForwardProp:e=>Ll(e)&&e!=="status"&&e!=="indentationAtItemLevel"})(({theme:e})=>({padding:e.spacing(.5,1),borderRadius:e.shape.borderRadius,width:"100%",boxSizing:"border-box",position:"relative",display:"flex",alignItems:"center",gap:e.spacing(1),cursor:"pointer",WebkitTapHighlightColor:"transparent","&:hover":{backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},variants:[{props:{indentationAtItemLevel:!0},style:{paddingLeft:`calc(${e.spacing(1)} + var(--TreeView-itemChildrenIndentation) * var(--TreeView-itemDepth))`}},{props:({status:t})=>t.disabled,style:{opacity:(e.vars||e).palette.action.disabledOpacity,backgroundColor:"transparent"}},{props:({status:t})=>t.focused,style:{backgroundColor:(e.vars||e).palette.action.focus}},{props:({status:t})=>t.selected,style:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:ha(e.palette.primary.main,e.palette.action.selectedOpacity),"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:ha(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:ha(e.palette.primary.main,e.palette.action.selectedOpacity)}}}},{props:({status:t})=>t.selected&&t.focused,style:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:ha(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}}]})),t_e=Ye("div",{name:"MuiTreeItem2",slot:"Label",overridesResolver:(e,t)=>t.label,shouldForwardProp:e=>Ll(e)&&e!=="editable"})(({theme:e})=>Ke({width:"100%",boxSizing:"border-box",minWidth:0,position:"relative",overflow:"hidden"},e.typography.body1,{variants:[{props:({editable:t})=>t,style:{paddingLeft:"2px"}}]})),n_e=Ye("div",{name:"MuiTreeItem2",slot:"IconContainer",overridesResolver:(e,t)=>t.iconContainer})({width:16,display:"flex",flexShrink:0,justifyContent:"center","& svg":{fontSize:18}});Ye(ym,{name:"MuiTreeItem2",slot:"GroupTransition",overridesResolver:(e,t)=>t.groupTransition,shouldForwardProp:e=>Ll(e)&&e!=="indentationAtItemLevel"})({margin:0,padding:0,paddingLeft:"var(--TreeView-itemChildrenIndentation)",variants:[{props:{indentationAtItemLevel:!0},style:{paddingLeft:0}}]});Ye(A.forwardRef((e,t)=>{const{visible:n}=e,r=ho(e,ZAe);return n?v.jsx(J7,Ke({},r,{ref:t})):null}),{name:"MuiTreeItem2",slot:"Checkbox",overridesResolver:(e,t)=>t.checkbox})({padding:0});function r_e(e){return en("MuiRichTreeView",e)}Wt("MuiRichTreeView",["root"]);const o_e=(e,t)=>{const n=A.useRef({}),[r,o]=A.useState(()=>{const a={};return e.forEach(i=>{i.models&&Object.entries(i.models).forEach(([l,u])=>{n.current[l]={isControlled:t[l]!==void 0,getDefaultValue:u.getDefaultValue},a[l]=u.getDefaultValue(t)})}),a});return Object.fromEntries(Object.entries(n.current).map(([a,i])=>{const l=t[a]??r[a];return[a,{value:l,setControlledValue:u=>{i.isControlled||o(d=>Ke({},d,{[a]:u}))}}]}))};class a_e{constructor(){this.maxListeners=20,this.warnOnce=!1,this.events={}}on(t,n,r={}){let o=this.events[t];o||(o={highPriority:new Map,regular:new Map},this.events[t]=o),r.isFirst?o.highPriority.set(n,!0):o.regular.set(n,!0)}removeListener(t,n){this.events[t]&&(this.events[t].regular.delete(n),this.events[t].highPriority.delete(n))}removeAllListeners(){this.events={}}emit(t,...n){const r=this.events[t];if(!r)return;const o=Array.from(r.highPriority.keys()),a=Array.from(r.regular.keys());for(let i=o.length-1;i>=0;i-=1){const l=o[i];r.highPriority.has(l)&&l.apply(this,n)}for(let i=0;i<a.length;i+=1){const l=a[i];r.regular.has(l)&&l.apply(this,n)}}once(t,n){const r=this;this.on(t,function o(...a){r.removeListener(t,o),n.apply(r,a)})}}const i_e=e=>e.isPropagationStopped!==void 0,dj=()=>{const[e]=A.useState(()=>new a_e),t=A.useCallback((...r)=>{const[o,a,i={}]=r;i.defaultMuiPrevented=!1,!(i_e(i)&&i.isPropagationStopped())&&e.emit(o,a,i)},[e]),n=A.useCallback((r,o)=>(e.on(r,o),()=>{e.removeListener(r,o)}),[e]);return{instance:{$$publishEvent:t,$$subscribeEvent:n}}};dj.params={};const pj=({plugins:e})=>{const t=new Set(e);return{instance:{getAvailablePlugins:()=>t}}};pj.params={};const mk=({params:e,state:t,setState:n})=>{A.useEffect(()=>{n(o=>o.id.treeId===e.id&&o.id.treeId!==void 0?o:Ke({},o,{id:Ke({},o.id,{treeId:e.id??NAe()})}))},[n,e.id]);const r=e.id??t.id.treeId;return{getRootProps:()=>({id:r}),contextValue:{treeId:r}}};mk.params={id:!0};mk.getInitialState=({id:e})=>({id:{treeId:e??void 0}});const s_e=[dj,pj,mk],l_e=["slots","slotProps","apiRef","experimentalFeatures"],c_e=e=>{let{props:{slots:t,slotProps:n,apiRef:r,experimentalFeatures:o},plugins:a}=e,i=ho(e.props,l_e);const l={};a.forEach(y=>{Object.assign(l,y.params)});const u={},d={};Object.keys(i).forEach(y=>{const g=i[y];l[y]?u[y]=g:d[y]=g});const p=o??{},h=a.reduce((y,g)=>g.getDefaultizedParams?g.getDefaultizedParams({params:y,experimentalFeatures:p}):y,u);return{apiRef:r,forwardedProps:d,pluginParams:h,slots:t??{},slotProps:n??{},experimentalFeatures:p}},u_e=({plugins:e,instance:t,publicAPI:n,rootRef:r})=>({runItemPlugins:o=>{let a=null,i=null;const l=[],u={};e.forEach(h=>{if(!h.itemPlugin)return;const y=h.itemPlugin({props:o,rootRef:a,contentRef:i});y?.rootRef&&(a=y.rootRef),y?.contentRef&&(i=y.contentRef),y?.propsEnhancers&&(l.push(y.propsEnhancers),Object.keys(y.propsEnhancers).forEach(g=>{u[g]=!0}))});const d=h=>y=>{const g={};return l.forEach(b=>{const x=b[h];x!=null&&Object.assign(g,x(y))}),g},p=Object.fromEntries(Object.keys(u).map(h=>[h,d(h)]));return{contentRef:i,rootRef:a,propsEnhancers:p}},wrapItem:({itemId:o,children:a})=>{let i=a;for(let l=e.length-1;l>=0;l-=1){const u=e[l];u.wrapItem&&(i=u.wrapItem({itemId:o,children:i,instance:t}))}return i},wrapRoot:({children:o})=>{let a=o;for(let i=e.length-1;i>=0;i-=1){const l=e[i];l.wrapRoot&&(a=l.wrapRoot({children:a,instance:t}))}return a},instance:t,rootRef:r,publicAPI:n});function d_e(e){const t=A.useRef({});return e?(e.current==null&&(e.current={}),e.current):t.current}const p_e=({plugins:e,rootRef:t,props:n})=>{const r=[...s_e,...e],{pluginParams:o,forwardedProps:a,apiRef:i,experimentalFeatures:l,slots:u,slotProps:d}=c_e({plugins:r,props:n}),p=o_e(r,o),h=A.useRef({}).current,y=d_e(i),g=A.useRef(null),b=sr(g,t),x=u_e({plugins:r,instance:h,publicAPI:y,rootRef:g}),[S,E]=A.useState(()=>{const R={};return r.forEach(O=>{O.getInitialState&&Object.assign(R,O.getInitialState(o))}),R}),_=[],C=R=>{const O=R({instance:h,params:o,slots:u,slotProps:d,experimentalFeatures:l,state:S,setState:E,rootRef:g,models:p,plugins:r});O.getRootProps&&_.push(O.getRootProps),O.publicAPI&&Object.assign(y,O.publicAPI),O.instance&&Object.assign(h,O.instance),O.contextValue&&Object.assign(x,O.contextValue)};return r.forEach(C),{getRootProps:(R={})=>{const O=Ke({role:"tree"},a,R,{ref:b});return _.forEach(I=>{Object.assign(O,I(R))}),O},rootRef:b,contextValue:x,instance:h}},f_e=(e,t,n)=>{e.$$publishEvent(t,n)},yd="__TREE_VIEW_ROOT_PARENT_ID__",h_e=e=>{const t={};return e.forEach((n,r)=>{t[n]=r}),t},m_e=["children"],fj=({items:e,isItemDisabled:t,getItemLabel:n,getItemId:r})=>{const o={},a={},i={[yd]:[]},l=(d,p,h)=>{const y=r?r(d):d.id;if(y==null)throw new Error(["MUI X: The Tree View component requires all items to have a unique `id` property.","Alternatively, you can use the `getItemId` prop to specify a custom id for each item.","An item was provided without id in the `items` prop:",JSON.stringify(d)].join(`
443
443
  `));if(o[y]!=null)throw new Error(["MUI X: The Tree View component requires all items to have a unique `id` property.","Alternatively, you can use the `getItemId` prop to specify a custom id for each item.",`Two items were provided with the same id in the \`items\` prop: "${y}"`].join(`
444
444
  `));const g=n?n(d):d.label;if(g==null)throw new Error(["MUI X: The Tree View component requires all items to have a `label` property.","Alternatively, you can use the `getItemLabel` prop to specify a custom label for each item.","An item was provided without label in the `items` prop:",JSON.stringify(d)].join(`
445
445
  `));o[y]={id:y,label:g,parentId:h,idAttribute:void 0,expandable:!!d.children?.length,disabled:t?t(d):!1,depth:p},a[y]=d;const b=h??yd;i[b]||(i[b]=[]),i[b].push(y),d.children?.forEach(x=>l(x,p+1,y))};e.forEach(d=>l(d,0,null));const u={};return Object.keys(i).forEach(d=>{u[d]=h_e(i[d])}),{itemMetaMap:o,itemMap:a,itemOrderedChildrenIds:i,itemChildrenIndexes:u}},eg=({instance:e,params:t,state:n,setState:r,experimentalFeatures:o})=>{const a=A.useCallback(S=>n.items.itemMetaMap[S],[n.items.itemMetaMap]),i=A.useCallback(S=>n.items.itemMap[S],[n.items.itemMap]),l=A.useCallback(()=>{const S=E=>{const _=n.items.itemMap[E],C=ho(_,m_e),R=n.items.itemOrderedChildrenIds[E];return R&&(C.children=R.map(S)),C};return n.items.itemOrderedChildrenIds[yd].map(S)},[n.items.itemMap,n.items.itemOrderedChildrenIds]),u=A.useCallback(S=>{if(S==null)return!1;let E=e.getItemMeta(S);if(!E)return!1;if(E.disabled)return!0;for(;E.parentId!=null;)if(E=e.getItemMeta(E.parentId),E.disabled)return!0;return!1},[e]),d=A.useCallback(S=>{const E=e.getItemMeta(S).parentId??yd;return n.items.itemChildrenIndexes[E][S]},[e,n.items.itemChildrenIndexes]),p=A.useCallback(S=>n.items.itemOrderedChildrenIds[S??yd]??[],[n.items.itemOrderedChildrenIds]),h=S=>{const E=e.getItemMeta(S);return E==null?null:document.getElementById(fk({treeId:n.id.treeId,itemId:S,id:E.idAttribute}))},y=S=>t.disabledItemsFocusable?!0:!e.isItemDisabled(S),g=A.useRef(!1),b=A.useCallback(()=>{g.current=!0},[]),x=A.useCallback(()=>g.current,[]);return A.useEffect(()=>{e.areItemUpdatesPrevented()||r(S=>{const E=fj({items:t.items,isItemDisabled:t.isItemDisabled,getItemId:t.getItemId,getItemLabel:t.getItemLabel});return Object.values(S.items.itemMetaMap).forEach(_=>{E.itemMetaMap[_.id]||f_e(e,"removeItem",{id:_.id})}),Ke({},S,{items:E})})},[e,r,t.items,t.isItemDisabled,t.getItemId,t.getItemLabel]),{getRootProps:()=>({style:{"--TreeView-itemChildrenIndentation":typeof t.itemChildrenIndentation=="number"?`${t.itemChildrenIndentation}px`:t.itemChildrenIndentation}}),publicAPI:{getItem:i,getItemDOMElement:h,getItemTree:l,getItemOrderedChildrenIds:p},instance:{getItemMeta:a,getItem:i,getItemTree:l,getItemsToRender:()=>{const S=E=>{const _=n.items.itemMetaMap[E];return{label:_.label,itemId:_.id,id:_.idAttribute,children:n.items.itemOrderedChildrenIds[E]?.map(S)}};return n.items.itemOrderedChildrenIds[yd].map(S)},getItemIndex:d,getItemDOMElement:h,getItemOrderedChildrenIds:p,isItemDisabled:u,isItemNavigable:y,preventItemUpdates:b,areItemUpdatesPrevented:x},contextValue:{items:{onItemClick:t.onItemClick,disabledItemsFocusable:t.disabledItemsFocusable,indentationAtItemLevel:o.indentationAtItemLevel??!1}}}};eg.getInitialState=e=>({items:fj({items:e.items,isItemDisabled:e.isItemDisabled,getItemId:e.getItemId,getItemLabel:e.getItemLabel})});eg.getDefaultizedParams=({params:e})=>Ke({},e,{disabledItemsFocusable:e.disabledItemsFocusable??!1,itemChildrenIndentation:e.itemChildrenIndentation??"12px"});eg.wrapRoot=({children:e,instance:t})=>v.jsx(pk.Provider,{value:n=>t.getItemMeta(n)?.depth??0,children:e});eg.params={disabledItemsFocusable:!0,items:!0,isItemDisabled:!0,getItemLabel:!0,getItemId:!0,onItemClick:!0,itemChildrenIndentation:!0};const n1=({instance:e,params:t,models:n})=>{const r=A.useMemo(()=>{const h=new Map;return n.expandedItems.value.forEach(y=>{h.set(y,!0)}),h},[n.expandedItems.value]),o=(h,y)=>{t.onExpandedItemsChange?.(h,y),n.expandedItems.setControlledValue(y)},a=A.useCallback(h=>r.has(h),[r]),i=A.useCallback(h=>!!e.getItemMeta(h)?.expandable,[e]),l=Fr((h,y)=>{const g=e.isItemExpanded(y);e.setItemExpansion(h,y,!g)}),u=Fr((h,y,g)=>{if(e.isItemExpanded(y)===g)return;let b;g?b=[y].concat(n.expandedItems.value):b=n.expandedItems.value.filter(x=>x!==y),t.onItemExpansionToggle&&t.onItemExpansionToggle(h,y,g),o(h,b)}),d=(h,y)=>{const g=e.getItemMeta(y),b=e.getItemOrderedChildrenIds(g.parentId).filter(S=>e.isItemExpandable(S)&&!e.isItemExpanded(S)),x=n.expandedItems.value.concat(b);b.length>0&&(t.onItemExpansionToggle&&b.forEach(S=>{t.onItemExpansionToggle(h,S,!0)}),o(h,x))},p=A.useMemo(()=>t.expansionTrigger?t.expansionTrigger:e.isTreeViewEditable?"iconContainer":"content",[t.expansionTrigger,e.isTreeViewEditable]);return{publicAPI:{setItemExpansion:u},instance:{isItemExpanded:a,isItemExpandable:i,setItemExpansion:u,toggleItemExpansion:l,expandAllSiblings:d},contextValue:{expansion:{expansionTrigger:p}}}};n1.models={expandedItems:{getDefaultValue:e=>e.defaultExpandedItems}};const g_e=[];n1.getDefaultizedParams=({params:e})=>Ke({},e,{defaultExpandedItems:e.defaultExpandedItems??g_e});n1.params={expandedItems:!0,defaultExpandedItems:!0,onExpandedItemsChange:!0,onItemExpansionToggle:!0,expansionTrigger:!0};const C0=e=>Array.isArray(e)?e:e!=null?[e]:[],US=e=>{const t={};return e.forEach(n=>{t[n]=!0}),t},r1=({instance:e,params:t,models:n})=>{const r=A.useRef(null),o=A.useRef({}),a=A.useMemo(()=>{const p=new Map;return Array.isArray(n.selectedItems.value)?n.selectedItems.value.forEach(h=>{p.set(h,!0)}):n.selectedItems.value!=null&&p.set(n.selectedItems.value,!0),p},[n.selectedItems.value]),i=(p,h)=>{if(t.onItemSelectionToggle)if(t.multiSelect){const y=h.filter(b=>!e.isItemSelected(b)),g=n.selectedItems.value.filter(b=>!h.includes(b));y.forEach(b=>{t.onItemSelectionToggle(p,b,!0)}),g.forEach(b=>{t.onItemSelectionToggle(p,b,!1)})}else h!==n.selectedItems.value&&(n.selectedItems.value!=null&&t.onItemSelectionToggle(p,n.selectedItems.value,!1),h!=null&&t.onItemSelectionToggle(p,h,!0));t.onSelectedItemsChange&&t.onSelectedItemsChange(p,h),n.selectedItems.setControlledValue(h)},l=p=>a.has(p),u=({event:p,itemId:h,keepExistingSelection:y=!1,shouldBeSelected:g})=>{if(t.disableSelection)return;let b;if(y){const x=C0(n.selectedItems.value),S=e.isItemSelected(h);S&&(g===!1||g==null)?b=x.filter(E=>E!==h):!S&&(g===!0||g==null)?b=[h].concat(x):b=x}else g===!1||g==null&&e.isItemSelected(h)?b=t.multiSelect?[]:null:b=t.multiSelect?[h]:h;i(p,b),r.current=h,o.current={}},d=(p,[h,y])=>{if(t.disableSelection||!t.multiSelect)return;let g=C0(n.selectedItems.value).slice();Object.keys(o.current).length>0&&(g=g.filter(E=>!o.current[E]));const b=US(g),x=IAe(e,h,y),S=x.filter(E=>!b[E]);g=g.concat(S),i(p,g),o.current=US(x)};return{getRootProps:()=>({"aria-multiselectable":t.multiSelect}),publicAPI:{selectItem:u},instance:{isItemSelected:l,selectItem:u,selectAllNavigableItems:p=>{if(t.disableSelection||!t.multiSelect)return;const h=OAe(e);i(p,h),o.current=US(h)},expandSelectionRange:(p,h)=>{if(r.current!=null){const[y,g]=ij(e,h,r.current);d(p,[y,g])}},selectRangeFromStartToItem:(p,h)=>{d(p,[bm(e),h])},selectRangeFromItemToEnd:(p,h)=>{d(p,[h,aj(e)])},selectItemFromArrowNavigation:(p,h,y)=>{if(t.disableSelection||!t.multiSelect)return;let g=C0(n.selectedItems.value).slice();Object.keys(o.current).length===0?(g.push(y),o.current={[h]:!0,[y]:!0}):(o.current[h]||(o.current={}),o.current[y]?(g=g.filter(b=>b!==h),delete o.current[h]):(g.push(y),o.current[y]=!0)),i(p,g)}},contextValue:{selection:{multiSelect:t.multiSelect,checkboxSelection:t.checkboxSelection,disableSelection:t.disableSelection}}}};r1.models={selectedItems:{getDefaultValue:e=>e.defaultSelectedItems}};const y_e=[];r1.getDefaultizedParams=({params:e})=>Ke({},e,{disableSelection:e.disableSelection??!1,multiSelect:e.multiSelect??!1,checkboxSelection:e.checkboxSelection??!1,defaultSelectedItems:e.defaultSelectedItems??(e.multiSelect?y_e:null)});r1.params={disableSelection:!0,multiSelect:!0,checkboxSelection:!0,defaultSelectedItems:!0,selectedItems:!0,onSelectedItemsChange:!0,onItemSelectionToggle:!0};const b3=1e3;class b_e{constructor(t=b3){this.timeouts=new Map,this.cleanupTimeout=b3,this.cleanupTimeout=t}register(t,n,r){this.timeouts||(this.timeouts=new Map);const o=setTimeout(()=>{typeof n=="function"&&n(),this.timeouts.delete(r.cleanupToken)},this.cleanupTimeout);this.timeouts.set(r.cleanupToken,o)}unregister(t){const n=this.timeouts.get(t.cleanupToken);n&&(this.timeouts.delete(t.cleanupToken),clearTimeout(n))}reset(){this.timeouts&&(this.timeouts.forEach((t,n)=>{this.unregister({cleanupToken:n})}),this.timeouts=void 0)}}class v_e{constructor(){this.registry=new FinalizationRegistry(t=>{typeof t=="function"&&t()})}register(t,n,r){this.registry.register(t,n,r)}unregister(t){this.registry.unregister(t)}reset(){}}class E_e{}function x_e(e){let t=0;return function(n,r,o){e.registry===null&&(e.registry=typeof FinalizationRegistry<"u"?new v_e:new b_e);const[a]=A.useState(new E_e),i=A.useRef(null),l=A.useRef(void 0);l.current=o;const u=A.useRef(null);if(!i.current&&l.current){const d=(p,h)=>{h.defaultMuiPrevented||l.current?.(p,h)};i.current=n.$$subscribeEvent(r,d),t+=1,u.current={cleanupToken:t},e.registry.register(a,()=>{i.current?.(),i.current=null,u.current=null},u.current)}else!l.current&&i.current&&(i.current(),i.current=null,u.current&&(e.registry.unregister(u.current),u.current=null));A.useEffect(()=>{if(!i.current&&l.current){const d=(p,h)=>{h.defaultMuiPrevented||l.current?.(p,h)};i.current=n.$$subscribeEvent(r,d)}return u.current&&e.registry&&(e.registry.unregister(u.current),u.current=null),()=>{i.current?.(),i.current=null}},[n,r])}}const S_e={registry:null},T_e=x_e(S_e),hj=(e=document)=>{const t=e.activeElement;return t?t.shadowRoot?hj(t.shadowRoot):t:null},C_e=(e,t)=>{let n=C0(t).find(r=>{if(!e.isItemNavigable(r))return!1;const o=e.getItemMeta(r);return o&&(o.parentId==null||e.isItemExpanded(o.parentId))});return n==null&&(n=bm(e)),n},gk=({instance:e,params:t,state:n,setState:r,models:o,rootRef:a})=>{const i=C_e(e,o.selectedItems.value),l=Fr(S=>{const E=typeof S=="function"?S(n.focusedItemId):S;n.focusedItemId!==E&&r(_=>Ke({},_,{focusedItemId:E}))}),u=A.useCallback(()=>!!a.current&&a.current.contains(hj(ao(a.current))),[a]),d=A.useCallback(S=>n.focusedItemId===S&&u(),[n.focusedItemId,u]),p=S=>{const E=e.getItemMeta(S);return E&&(E.parentId==null||e.isItemExpanded(E.parentId))},h=(S,E)=>{const _=e.getItemDOMElement(E);_&&_.focus(),l(E),t.onItemFocus&&t.onItemFocus(S,E)},y=Fr((S,E)=>{p(E)&&h(S,E)}),g=Fr(()=>{if(n.focusedItemId!=null){if(e.getItemMeta(n.focusedItemId)){const S=e.getItemDOMElement(n.focusedItemId);S&&S.blur()}l(null)}}),b=S=>S===i;T_e(e,"removeItem",({id:S})=>{n.focusedItemId===S&&h(null,i)});const x=S=>E=>{S.onFocus?.(E),!E.defaultMuiPrevented&&E.target===E.currentTarget&&h(E,i)};return{getRootProps:S=>({onFocus:x(S)}),publicAPI:{focusItem:y},instance:{isItemFocused:d,canItemBeTabbed:b,focusItem:y,removeFocusedItem:g}}};gk.getInitialState=()=>({focusedItemId:null});gk.params={onItemFocus:!0};function A_e(e){return!!e&&e.length===1&&!!e.match(/\S/)}const mj=({instance:e,params:t,state:n})=>{const r=l_(),o=A.useRef({}),a=Fr(d=>{o.current=d(o.current)});A.useEffect(()=>{if(e.areItemUpdatesPrevented())return;const d={},p=h=>{d[h.id]=h.label.substring(0,1).toLowerCase()};Object.values(n.items.itemMetaMap).forEach(p),o.current=d},[n.items.itemMetaMap,t.getItemId,e]);const i=(d,p)=>{const h=p.toLowerCase(),y=S=>{const E=T0(e,S);return E===null?bm(e):E};let g=null,b=y(d);const x={};for(;g==null&&!x[b];)o.current[b]===h?g=b:(x[b]=!0,b=y(b));return g},l=d=>!t.disableSelection&&!e.isItemDisabled(d),u=d=>!e.isItemDisabled(d)&&e.isItemExpandable(d);return{instance:{updateFirstCharMap:a,handleItemKeyDown:(d,p)=>{if(d.defaultMuiPrevented||d.altKey||vm(d.target,d.currentTarget))return;const h=d.ctrlKey||d.metaKey,y=d.key;switch(!0){case(y===" "&&l(p)):{d.preventDefault(),t.multiSelect&&d.shiftKey?e.expandSelectionRange(d,p):e.selectItem({event:d,itemId:p,keepExistingSelection:t.multiSelect,shouldBeSelected:t.multiSelect?void 0:!0});break}case y==="Enter":{Vc(e,Wa)&&e.isItemEditable(p)&&!e.isItemBeingEdited(p)?e.setEditedItemId(p):u(p)?(e.toggleItemExpansion(d,p),d.preventDefault()):l(p)&&(t.multiSelect?(d.preventDefault(),e.selectItem({event:d,itemId:p,keepExistingSelection:!0})):e.isItemSelected(p)||(e.selectItem({event:d,itemId:p}),d.preventDefault()));break}case y==="ArrowDown":{const g=T0(e,p);g&&(d.preventDefault(),e.focusItem(d,g),t.multiSelect&&d.shiftKey&&l(g)&&e.selectItemFromArrowNavigation(d,p,g));break}case y==="ArrowUp":{const g=oj(e,p);g&&(d.preventDefault(),e.focusItem(d,g),t.multiSelect&&d.shiftKey&&l(g)&&e.selectItemFromArrowNavigation(d,p,g));break}case(y==="ArrowRight"&&!r||y==="ArrowLeft"&&r):{if(h)return;if(e.isItemExpanded(p)){const g=T0(e,p);g&&(e.focusItem(d,g),d.preventDefault())}else u(p)&&(e.toggleItemExpansion(d,p),d.preventDefault());break}case(y==="ArrowLeft"&&!r||y==="ArrowRight"&&r):{if(h)return;if(u(p)&&e.isItemExpanded(p))e.toggleItemExpansion(d,p),d.preventDefault();else{const g=e.getItemMeta(p).parentId;g&&(e.focusItem(d,g),d.preventDefault())}break}case y==="Home":{l(p)&&t.multiSelect&&h&&d.shiftKey?e.selectRangeFromStartToItem(d,p):e.focusItem(d,bm(e)),d.preventDefault();break}case y==="End":{l(p)&&t.multiSelect&&h&&d.shiftKey?e.selectRangeFromItemToEnd(d,p):e.focusItem(d,aj(e)),d.preventDefault();break}case y==="*":{e.expandAllSiblings(d,p),d.preventDefault();break}case(String.fromCharCode(d.keyCode)==="A"&&h&&t.multiSelect&&!t.disableSelection):{e.selectAllNavigableItems(d),d.preventDefault();break}case(!h&&!d.shiftKey&&A_e(y)):{const g=i(p,y);g!=null&&(e.focusItem(d,g),d.preventDefault());break}}}}}};mj.params={};const gj=({slots:e,slotProps:t})=>({contextValue:{icons:{slots:{collapseIcon:e.collapseIcon,expandIcon:e.expandIcon,endIcon:e.endIcon},slotProps:{collapseIcon:t.collapseIcon,expandIcon:t.expandIcon,endIcon:t.endIcon}}}});gj.params={};const __e=[eg,n1,r1,gk,mj,gj,Wa],k_e=["ownerState"];function w_e({slots:e,slotProps:t,label:n,id:r,itemId:o,itemsToRender:a}){const i=e?.item??QAe,l=Cs({elementType:i,externalSlotProps:t?.item,additionalProps:{itemId:o,id:r,label:n},ownerState:{itemId:o,label:n}}),u=ho(l,k_e),d=A.useMemo(()=>a?v.jsx(yj,{itemsToRender:a,slots:e,slotProps:t}):null,[a,e,t]);return v.jsx(i,Ke({},u,{children:d}))}function yj(e){const{itemsToRender:t,slots:n,slotProps:r}=e;return v.jsx(A.Fragment,{children:t.map(o=>v.jsx(w_e,{slots:n,slotProps:r,label:o.label,id:o.id,itemId:o.itemId,itemsToRender:o.children},o.itemId))})}const R_e=ej(),D_e=e=>{const{classes:t}=e;return Jt({root:["root"]},r_e,t)},I_e=Ye("ul",{name:"MuiRichTreeView",slot:"Root",overridesResolver:(e,t)=>t.root})({padding:0,margin:0,listStyle:"none",outline:0,position:"relative"}),O_e=A.forwardRef(function(e,t){const n=R_e({props:e,name:"MuiRichTreeView"}),{getRootProps:r,contextValue:o,instance:a}=p_e({plugins:__e,rootRef:t,props:n}),{slots:i,slotProps:l}=n,u=D_e(n),d=i?.root??I_e,p=Cs({elementType:d,externalSlotProps:l?.root,className:u.root,getSlotProps:r,ownerState:n});return v.jsx(wAe,{value:o,children:v.jsx(d,Ke({},p,{children:v.jsx(yj,{slots:i,slotProps:l,itemsToRender:a.getItemsToRender()})}))})}),N_e=On(v.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"})),P_e=On([v.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"),v.jsx("path",{d:"M14 17H7v-2h7zm3-4H7v-2h10zm0-4H7V7h10z"},"1")]),L_e=On(v.jsx("path",{d:"M19 15v4H5v-4zm1-2H4c-.55 0-1 .45-1 1v6c0 .55.45 1 1 1h16c.55 0 1-.45 1-1v-6c0-.55-.45-1-1-1M7 18.5c-.82 0-1.5-.67-1.5-1.5s.68-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5M19 5v4H5V5zm1-2H4c-.55 0-1 .45-1 1v6c0 .55.45 1 1 1h16c.55 0 1-.45 1-1V4c0-.55-.45-1-1-1M7 8.5c-.82 0-1.5-.67-1.5-1.5S6.18 5.5 7 5.5s1.5.68 1.5 1.5S7.83 8.5 7 8.5"})),M_e=On(v.jsx("path",{d:"M15 4v2h3v12h-3v2h5V4zM4 20h5v-2H6V6h3V4H4z"}));function bj({items:e,defaultExpandedItems:t,onClickTreeNode:n}){return v.jsx(O_e,{items:z_e(e,n),defaultExpandedItems:t,slots:{item:U_e}})}const F_e=Ore(ym);function j_e(e){const t=bre({to:{opacity:e.in?1:0,transform:`translate3d(0,${e.in?0:20}px,0)`}});return v.jsx(F_e,{style:t,...e})}function B_e({item:e,...t}){const n=v.jsxs(t_e,{...t,sx:{display:"flex",alignItems:"center",color:e.error?"error.main":"grey.600"},children:[e.fileType==="directory"&&v.jsx(N_e,{})||e.fileType==="notebook"&&v.jsx(P_e,{})||e.fileType==="model"&&v.jsx(M_e,{})||e.fileType=="database"&&v.jsx(L_e,{})||v.jsx(K7,{}),v.jsx(ct,{variant:"body2",sx:{marginLeft:"5px"},color:e.error?"error.main":e.link?"primary.main":"grey.600",children:e.label})]});return e.error?v.jsx(jo,{title:e.error,placement:"right",children:n}):n}const U_e=A.forwardRef(function(e,t){const{id:n,itemId:r,label:o,children:a,disabled:i,...l}=e,{getRootProps:u,getContentProps:d,getLabelProps:p,getIconContainerProps:h,getGroupTransitionProps:y,status:g,publicAPI:b}=LAe({id:n,itemId:r,children:a,label:o,disabled:i,rootRef:t}),x=b.getItem(r);return g.selected=!1,g.focused=!1,v.jsx(hk,{itemId:r,children:v.jsxs(JAe,{...u(l),children:[v.jsxs(e_e,{...d(),...x.link&&{onClick:S=>x.link(S)},sx:{pointerEvents:!x.selectable&&"none"},children:[v.jsx(n_e,{...h(),children:v.jsx(XAe,{status:g})}),v.jsx(B_e,{...p({item:x})})]}),a&&v.jsx(j_e,{...y()})]})})});function z_e(e,t){const n=new Map;return e.map(r=>{let o=n;const a=r.path.split("/");a.forEach((i,l)=>{l===a.length-1?o.set(i,r):(o.has(i)||o.set(i,new Map),o=o.get(i))})}),vj(n,"",t)}function vj(e,t,n){const r=[];return e.forEach((o,a)=>{const i=a.endsWith(".malloy")&&"model"||a.endsWith(".malloynb")&&"notebook"||a.endsWith(".parquet")&&"database"||"unknown";if(i!=="unknown"){const l=o;r.push({id:t+a,label:a,fileType:i,link:i==="model"||i==="notebook"?u=>n(t+a,u):void 0,selectable:i==="model"||i==="notebook",error:"error"in l?l.error:void 0})}else{const l=t+a+"/";r.push({id:l,label:a,fileType:"directory",selectable:!0,link:void 0,children:vj(o,l,n)})}}),r}const $_e=["notebooks/","models/"];function H_e({onClickModelFile:e,resourceUri:t}){const{projectName:n,packageName:r,versionId:o}=yr(t),{apiClients:a}=Zn(),{data:i,isError:l,error:u,isSuccess:d}=Zo({queryKey:["models",n,r,o],queryFn:()=>a.models.listModels(n,r,o)});return v.jsx(Kl,{children:v.jsxs(Ql,{children:[v.jsx(cu,{children:"Semantic Models"}),v.jsxs(It,{sx:{maxHeight:"200px",overflowY:"auto"},children:[!d&&!l&&v.jsx(Ko,{text:"Fetching Models..."}),l&&v.jsx(Xo,{error:u,context:`${n} > ${r} > Models`}),d&&i.data.length>0&&v.jsx(bj,{items:i.data.sort((p,h)=>p.path.localeCompare(h.path)),onClickTreeNode:e,defaultExpandedItems:$_e}),d&&i.data.length===0&&v.jsx(ct,{variant:"body2",children:"No models found"})]})]})})}const V_e=["notebooks/"];function G_e({onClickNotebookFile:e,resourceUri:t}){const{apiClients:n}=Zn(),{projectName:r,packageName:o,versionId:a}=yr(t),{data:i,isError:l,error:u,isSuccess:d}=Zo({queryKey:["notebooks",r,o,a],queryFn:()=>n.notebooks.listNotebooks(r,o,a)});return v.jsx(Kl,{children:v.jsxs(Ql,{children:[v.jsx(cu,{children:"Notebooks"}),v.jsxs(It,{sx:{maxHeight:"200px",overflowY:"auto"},children:[!d&&!l&&v.jsx(Ko,{text:"Fetching Notebooks..."}),l&&v.jsx(Xo,{error:u,context:`${r} > ${o} > Notebooks`}),d&&i.data.length>0&&v.jsx(bj,{items:i.data.sort((p,h)=>p.path.localeCompare(h.path)),defaultExpandedItems:V_e,onClickTreeNode:e}),d&&i.data.length===0&&v.jsx(ct,{variant:"body2",children:"No notebooks found"})]})]})})}const q_e="README.malloynb";function mwe({onClickPackageFile:e,resourceUri:t}){e||(e=r=>{window.location.href=r});const n=d_({...yr(t),modelPath:q_e});return v.jsx(v.Fragment,{children:v.jsxs(Ar,{container:!0,spacing:3,columns:12,children:[v.jsx(Ar,{size:{xs:12,md:4},children:v.jsx(hCe,{resourceUri:t})}),v.jsx(Ar,{size:{xs:12,md:4},children:v.jsx(G_e,{onClickNotebookFile:e,resourceUri:t})}),v.jsx(Ar,{size:{xs:12,md:4},children:v.jsx(H_e,{onClickModelFile:e,resourceUri:t})}),v.jsx(Ar,{size:{xs:12,md:6},children:v.jsx(aAe,{resourceUri:t})}),v.jsx(Ar,{size:{xs:12,md:6},children:v.jsx(oAe,{resourceUri:t})}),v.jsx(Ar,{size:{xs:12,md:12},children:v.jsx(Kl,{children:v.jsxs(Ql,{children:[v.jsx(cu,{children:"README"}),v.jsx(It,{sx:{mt:1},children:v.jsx(Vfe,{resourceUri:n})})]})})})]})})}function W_e({resourceUri:e}){const{projectName:t}=yr(e),{apiClients:n}=Zn(),[r,o]=A.useState(!1),a=90,{data:i,isSuccess:l,isError:u,error:d}=Zo({queryKey:["about",t],queryFn:()=>n.projects.getProject(t,!1)}),p=i?.data?.readme||"",h=p.split(/\s+/),y=h.length>a,g=h.slice(0,a).join(" ");return v.jsxs(v.Fragment,{children:[!l&&!u&&v.jsx(Ko,{text:"Fetching About..."}),l&&p&&v.jsx(Kl,{children:v.jsxs(Ql,{children:[v.jsx(cu,{children:"Readme"}),v.jsxs(It,{sx:{mt:1,fontSize:"0.875rem",lineHeight:1.6},children:[v.jsx(W0,{options:{overrides:{h1:{component:"p",props:{style:{fontSize:"inherit",fontWeight:"italic"}}},h2:{component:"p",props:{style:{fontSize:"inherit",fontWeight:"italic"}}},h3:{component:"p",props:{style:{fontSize:"inherit",fontWeight:"italic"}}}}},children:r||!y?p:g}),y&&v.jsxs(It,{sx:{mt:1},children:[" ",v.jsx(ma,{variant:"text",size:"small",onClick:()=>o(!r),children:r?"Read less":"Read more"})]})]})]})}),u&&v.jsx(Xo,{error:d,context:`${t} > About`})]})}function Y_e({resourceUri:e}){const[t,n]=A.useState(!1),{apiClients:r}=Zn(),o=Ms(),[a,i]=A.useState(""),l=()=>{n(!0)},u=()=>{n(!1)},{projectName:d}=yr(e),p=Ui({async mutationFn(y){return r.packages.createPackage(d,{name:y.name,description:y.description,location:y.location})},onSuccess(){u(),i("Package created successfully"),o.invalidateQueries({queryKey:["packages",d]})},onError(y){i(y instanceof Error?y.message:"An unknown error occurred")}}),h=y=>{y.preventDefault();const g=new FormData(y.currentTarget),b=g.get("name")?.toString(),x=g.get("description")?.toString(),S=g.get("location")?.toString();p.mutate({name:b,description:x,location:S})};return v.jsxs(Qe.Fragment,{children:[v.jsx(Br,{onClick:l,variant:"contained",color:"primary",startIcon:v.jsx(ete,{}),sx:{color:"white"},children:"Add Package"}),v.jsxs(Bs,{open:t,onClose:u,children:[v.jsx($s,{children:"Create New Package"}),v.jsxs(zs,{children:[v.jsxs(Ap,{children:["Create a new malloy package to start exploring your data.",v.jsx("br",{}),v.jsx("br",{}),"The location can be a GitHub/S3/GCP URL containing a package (Zipped or unzipped), or an absolute path to a directory that the publisher server has access to.",v.jsx("br",{}),v.jsx("br",{}),"Make sure to conform the"," ",v.jsx("a",{href:"https://github.com/malloydata/publisher/blob/main/README.md#architecture-overview",target:"_blank",rel:"noopener noreferrer",children:"Malloy Package Format"}),"."]}),v.jsxs("form",{onSubmit:h,id:"package-form",children:[v.jsx(bo,{autoFocus:!0,required:!0,margin:"dense",id:"name",name:"name",label:"Package Name",type:"text",fullWidth:!0,variant:"standard"}),v.jsx(bo,{id:"description",name:"description",label:"Description",multiline:!0,fullWidth:!0,rows:4,variant:"standard"}),v.jsx(bo,{id:"location",name:"location",label:"Location",type:"text",placeholder:"E.g. s3://my-bucket/my-package.zip",fullWidth:!0,variant:"standard"})]})]}),v.jsxs(Us,{children:[v.jsx(Br,{disabled:p.isPending,onClick:u,children:"Cancel"}),v.jsx(Br,{type:"submit",form:"package-form",loading:p.isPending,children:"Save Changes"})]})]}),v.jsx(Ls,{open:a!=="",autoHideDuration:6e3,onClose:()=>i(""),message:a})]})}function K_e({resourceUri:e,onCloseDialog:t}){const[n,r]=A.useState(!1),{apiClients:o}=Zn(),a=Ms(),[i,l]=A.useState(""),u=()=>{r(!0)},d=()=>{r(!1),t()},{projectName:p,packageName:h}=yr(e),y=Ui({mutationFn:()=>o.packages.deletePackage(p,h),onSuccess(){d(),a.invalidateQueries({queryKey:["packages"]}),l("Package deleted successfully")},onError(g){l(g instanceof Error?g.message:"An unknown error occurred")}});return v.jsxs(Qe.Fragment,{children:[v.jsxs($l,{onClick:u,children:[v.jsx(nv,{children:v.jsx(jA,{fontSize:"small"})}),v.jsx(As,{children:"Delete"})]}),v.jsxs(Bs,{onClose:d,"aria-labelledby":"customized-dialog-title",open:n,children:[v.jsx($s,{sx:{m:0,p:2},id:"customized-dialog-title",children:"Delete Package"}),v.jsx(Qd,{"aria-label":"close",onClick:d,sx:g=>({position:"absolute",right:8,top:8,color:g.palette.grey[500]}),children:v.jsx(Vl,{})}),v.jsx(zs,{dividers:!0,children:v.jsxs(Jm,{gutterBottom:!0,children:['Are you sure you want to delete "',h,'"? This action cannot be undone.']})}),v.jsxs(Us,{children:[v.jsx(Br,{variant:"outlined",onClick:d,style:{borderColor:"#14b3cb",color:"#14b3cb"},children:"Cancel"}),v.jsx(Br,{variant:"contained",autoFocus:!0,onClick:()=>y.mutate(),color:"error",loading:y.isPending,children:"Delete"})]}),v.jsx(Ls,{open:i!=="",autoHideDuration:6e3,onClose:()=>l(""),message:i})]})]})}function Q_e({package:e,resourceUri:t,onCloseDialog:n}){const[r,o]=A.useState(!1),{apiClients:a}=Zn(),i=Ms(),[l,u]=A.useState(""),d=()=>{o(!0)},p=()=>{o(!1),n()},{packageName:h,projectName:y}=yr(t),g=Ui({async mutationFn(x){return a.packages.updatePackage(y,h,{name:h,description:x.description})},onSuccess(){p(),u("Package updated successfully"),i.invalidateQueries({queryKey:["packages",y]})},onError(x){u(x instanceof Error?x.message:"An unknown error occurred")}}),b=x=>{x.preventDefault();const S=new FormData(x.currentTarget).get("description")?.toString();g.mutate({description:S})};return v.jsxs(Qe.Fragment,{children:[v.jsxs($l,{onClick:d,children:[v.jsx(nv,{children:v.jsx(BA,{fontSize:"small"})}),v.jsx(As,{children:"Edit"})]}),v.jsxs(Bs,{open:r,onClose:p,children:[v.jsx($s,{children:"Edit Package"}),v.jsxs(zs,{children:[v.jsxs(Ap,{children:['Update the details for "',e.name,'".']}),v.jsxs("form",{onSubmit:b,id:"package-form",children:[v.jsx(bo,{autoFocus:!0,required:!0,margin:"dense",id:"name",name:"name",label:"Package Name",disabled:!0,type:"text",fullWidth:!0,variant:"standard",defaultValue:e.name}),v.jsx(bo,{id:"description",name:"description",label:"Description",multiline:!0,fullWidth:!0,rows:4,defaultValue:e.description,variant:"standard"})]})]}),v.jsxs(Us,{children:[v.jsx(Br,{disabled:g.isPending,onClick:p,children:"Cancel"}),v.jsx(Br,{type:"submit",form:"package-form",loading:g.isPending,children:"Save Changes"})]})]}),v.jsx(Ls,{open:l!=="",autoHideDuration:6e3,onClose:()=>u(""),message:l})]})}const X_e=({package:e,resourceUri:t})=>{const{mutable:n}=Zn(),[r,o]=A.useState(null),a=!!r,i=u=>{o(u.currentTarget)},l=()=>{o(null)};return v.jsx(v.Fragment,{children:n&&v.jsxs(v.Fragment,{children:[v.jsx(ir,{onClick:u=>{u.stopPropagation(),i(u)},"aria-controls":a?"package-menu":void 0,"aria-haspopup":"true","aria-expanded":a?"true":void 0,children:v.jsx(a4,{fontSize:"small"})}),v.jsxs(Im,{id:"package-menu","aria-haspopup":"true","aria-expanded":a?"true":void 0,open:a,anchorEl:r,onClose:l,disableRestoreFocus:!0,anchorOrigin:{vertical:"top",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"right"},onClick:u=>{u.stopPropagation()},children:[v.jsx(Q_e,{package:e,resourceUri:t,onCloseDialog:l}),v.jsx(K_e,{resourceUri:t,onCloseDialog:l})]})]})})};function Z_e({onSelectPackage:e,resourceUri:t}){const{apiClients:n}=Zn(),{projectName:r}=yr(t),{data:o,isSuccess:a,isError:i,error:l}=Zo({queryKey:["packages",r],queryFn:()=>n.packages.listPackages(r)});return v.jsxs(v.Fragment,{children:[!a&&!i&&v.jsx(Ko,{text:"Fetching Packages..."}),a&&v.jsx(Ar,{container:!0,spacing:3,columns:12,children:o.data.sort((u,d)=>u.name.localeCompare(d.name)).map(u=>{const d=d_({projectName:r,packageName:u.name});return v.jsx(Ar,{size:{xs:12,sm:12,md:12,lg:4},children:v.jsx(Kl,{sx:{cursor:"pointer",transition:"all 0.2s ease-in-out",paddingTop:"8px","&:hover":{boxShadow:"0 2px 6px rgba(0, 0, 0, 0.08)",transform:"translateY(-1px)"}},onClick:p=>{e(u.name,p)},children:v.jsxs(Ql,{children:[v.jsxs(It,{display:"flex",alignItems:"center",justifyContent:"space-between",sx:{marginBottom:"8px"},children:[v.jsx(ct,{variant:"overline",sx:{fontSize:"12px",fontWeight:"600",color:"primary.main",textTransform:"uppercase",letterSpacing:"0.5px"},children:u.name}),v.jsx(X_e,{package:u,resourceUri:d})]}),v.jsx(Hi,{sx:{mb:2}}),v.jsx(It,{sx:{maxHeight:"120px",overflowY:"auto",mt:2},children:v.jsx(ct,{variant:"body2",children:u.description})})]})})},u.name)})}),i&&v.jsx(Xo,{error:l,context:`${r} > Packages`})]})}function gwe({onSelectPackage:e,resourceUri:t}){const{mutable:n}=Zn(),{projectName:r}=yr(t);return A.useEffect(()=>{window.scrollTo({top:0,behavior:"auto"})},[]),v.jsx(v.Fragment,{children:v.jsxs(gce,{children:[v.jsxs(It,{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2,children:[v.jsxs(ct,{variant:"h6",children:[r," packages"]}),n&&v.jsx(Y_e,{resourceUri:t})]}),v.jsxs(Ar,{container:!0,spacing:3,columns:12,children:[v.jsx(Ar,{size:{xs:12,md:12},children:v.jsx(Z_e,{onSelectPackage:e,resourceUri:t})}),v.jsx(Ar,{size:{xs:12,md:12},children:v.jsx(W_e,{resourceUri:t})})]})]})})}const J_e=On(v.jsx("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2M8 17c-.55 0-1-.45-1-1v-3c0-.55.45-1 1-1s1 .45 1 1v3c0 .55-.45 1-1 1m4 0c-.55 0-1-.45-1-1v-1c0-.55.45-1 1-1s1 .45 1 1v1c0 .55-.45 1-1 1m0-5c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1m4 5c-.55 0-1-.45-1-1V8c0-.55.45-1 1-1s1 .45 1 1v8c0 .55-.45 1-1 1"})),eke=On(v.jsx("path",{d:"M5 13h11.17l-4.88 4.88c-.39.39-.39 1.03 0 1.42s1.02.39 1.41 0l6.59-6.59c.39-.39.39-1.02 0-1.41l-6.58-6.6a.996.996 0 0 0-1.41 0c-.39.39-.39 1.02 0 1.41L16.17 11H5c-.55 0-1 .45-1 1s.45 1 1 1"})),v3=On(v.jsx("path",{d:"m19.46 8 .79-1.75L22 5.46c.39-.18.39-.73 0-.91l-1.75-.79L19.46 2c-.18-.39-.73-.39-.91 0l-.79 1.75-1.76.79c-.39.18-.39.73 0 .91l1.75.79.79 1.76c.18.39.74.39.92 0M11.5 9.5 9.91 6c-.35-.78-1.47-.78-1.82 0L6.5 9.5 3 11.09c-.78.36-.78 1.47 0 1.82l3.5 1.59L8.09 18c.36.78 1.47.78 1.82 0l1.59-3.5 3.5-1.59c.78-.36.78-1.47 0-1.82zm7.04 6.5-.79 1.75-1.75.79c-.39.18-.39.73 0 .91l1.75.79.79 1.76c.18.39.73.39.91 0l.79-1.75 1.76-.79c.39-.18.39-.73 0-.91l-1.75-.79-.79-1.76c-.18-.39-.74-.39-.92 0"})),tke=On(v.jsx("path",{d:"M8.7 15.9 4.8 12l3.9-3.9c.39-.39.39-1.01 0-1.4a.984.984 0 0 0-1.4 0l-4.59 4.59c-.39.39-.39 1.02 0 1.41l4.59 4.6c.39.39 1.01.39 1.4 0s.39-1.01 0-1.4m6.6 0 3.9-3.9-3.9-3.9a.984.984 0 0 1 0-1.4c.39-.39 1.01-.39 1.4 0l4.59 4.59c.39.39.39 1.02 0 1.41l-4.59 4.6c-.39.39-1.01.39-1.4 0a.984.984 0 0 1 0-1.4"})),nke=On(v.jsx("path",{d:"M12 10.9c-.61 0-1.1.49-1.1 1.1s.49 1.1 1.1 1.1 1.1-.49 1.1-1.1-.49-1.1-1.1-1.1M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m2.19 12.19L6 18l3.81-8.19L18 6z"})),rke=On([v.jsx("path",{d:"M13 8.57c-.79 0-1.43.64-1.43 1.43s.64 1.43 1.43 1.43 1.43-.64 1.43-1.43-.64-1.43-1.43-1.43"},"0"),v.jsx("path",{d:"M13.21 3c-3.84-.11-7 2.87-7.19 6.64L4.1 12.2c-.25.33-.01.8.4.8H6v3c0 1.1.9 2 2 2h1v2c0 .55.45 1 1 1h5c.55 0 1-.45 1-1v-3.68c2.44-1.16 4.1-3.68 4-6.58-.14-3.62-3.18-6.63-6.79-6.74M16 10c0 .13-.01.26-.02.39l.83.66c.08.06.1.16.05.25l-.8 1.39c-.05.09-.16.12-.24.09l-.99-.4c-.21.16-.43.29-.67.39L14 13.83c-.01.1-.1.17-.2.17h-1.6c-.1 0-.18-.07-.2-.17l-.15-1.06c-.25-.1-.47-.23-.68-.39l-.99.4c-.09.03-.2 0-.25-.09l-.8-1.39c-.05-.08-.03-.19.05-.25l.84-.66c-.01-.13-.02-.26-.02-.39s.02-.27.04-.39l-.85-.66c-.08-.06-.1-.16-.05-.26l.8-1.38c.05-.09.15-.12.24-.09l1 .4c.2-.15.43-.29.67-.39L12 6.17c.02-.1.1-.17.2-.17h1.6c.1 0 .18.07.2.17l.15 1.06c.24.1.46.23.67.39l1-.4c.09-.03.2 0 .24.09l.8 1.38c.05.09.03.2-.05.26l-.85.66c.03.12.04.25.04.39"},"1")]),E3=On(v.jsx("path",{d:"M4 20h16c1.1 0 2-.9 2-2s-.9-2-2-2H4c-1.1 0-2 .9-2 2s.9 2 2 2m0-3h2v2H4zM2 6c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2s-.9-2-2-2H4c-1.1 0-2 .9-2 2m4 1H4V5h2zm-2 7h16c1.1 0 2-.9 2-2s-.9-2-2-2H4c-1.1 0-2 .9-2 2s.9 2 2 2m0-3h2v2H4z"})),Ej=e=>{if(!e)return"Explore semantic models, run queries, and build dashboards";const t=e.replace(/^#+\s+/gm,"").replace(/\*\*(.*?)\*\*/g,"$1").replace(/\*(.*?)\*/g,"$1").replace(/\[([^\]]+)\]\([^)]+\)/g,"$1").replace(/`([^`]+)`/g,"$1").trim(),n=t.split(/\n\s*\n/)[1]||t;if(n.length<=120)return n;const r=n.substring(0,120).split(" ");return r.pop(),r.join(" ")+"..."},xj=(e,t)=>{const n=(e.readme||void 0)?.split(`
446
446
  `)??[];return n.length===0&&(n.push(`# ${e.name}`),n.push("")),(e.readme?.length??0)>0&&t?n.splice(2,1,t):t&&n.push(t),n.join(`
447
- `)};function oke(e={}){const{autoHideDuration:t=null,disableWindowBlurListener:n=!1,onClose:r,open:o,resumeHideDuration:a}=e,i=Uv();A.useEffect(()=>{if(!o)return;function S(E){E.defaultPrevented||E.key==="Escape"&&r?.(E,"escapeKeyDown")}return document.addEventListener("keydown",S),()=>{document.removeEventListener("keydown",S)}},[o,r]);const l=Fr((S,E)=>{r?.(S,E)}),u=Fr(S=>{!r||S==null||i.start(S,()=>{l(null,"timeout")})});A.useEffect(()=>(o&&u(t),i.clear),[o,t,u,i]);const d=S=>{r?.(S,"clickaway")},p=i.clear,h=A.useCallback(()=>{t!=null&&u(a??t*.5)},[t,a,u]),y=S=>E=>{const _=S.onBlur;_?.(E),h()},g=S=>E=>{const _=S.onFocus;_?.(E),p()},b=S=>E=>{const _=S.onMouseEnter;_?.(E),p()},x=S=>E=>{const _=S.onMouseLeave;_?.(E),h()};return A.useEffect(()=>{if(!n&&o)return window.addEventListener("focus",h),window.addEventListener("blur",p),()=>{window.removeEventListener("focus",h),window.removeEventListener("blur",p)}},[n,o,h,p]),{getRootProps:(S={})=>{const E={...To(e),...To(S)};return{role:"presentation",...S,...E,onBlur:y(E),onFocus:g(E),onMouseEnter:b(E),onMouseLeave:x(E)}},onClickAway:d}}function x3(e){return e.substring(2).toLowerCase()}function ake(e,t){return t.documentElement.clientWidth<e.clientX||t.documentElement.clientHeight<e.clientY}function ike(e){const{children:t,disableReactTree:n=!1,mouseEvent:r="onClick",onClickAway:o,touchEvent:a="onTouchEnd"}=e,i=A.useRef(!1),l=A.useRef(null),u=A.useRef(!1),d=A.useRef(!1);A.useEffect(()=>(setTimeout(()=>{u.current=!0},0),()=>{u.current=!1}),[]);const p=sr(mp(t),l),h=Fr(b=>{const x=d.current;d.current=!1;const S=ao(l.current);if(!u.current||!l.current||"clientX"in b&&ake(b,S))return;if(i.current){i.current=!1;return}let E;b.composedPath?E=b.composedPath().includes(l.current):E=!S.documentElement.contains(b.target)||l.current.contains(b.target),!E&&(n||!x)&&o(b)}),y=b=>x=>{d.current=!0;const S=t.props[b];S&&S(x)},g={ref:p};return a!==!1&&(g[a]=y(a)),A.useEffect(()=>{if(a!==!1){const b=x3(a),x=ao(l.current),S=()=>{i.current=!0};return x.addEventListener(b,h),x.addEventListener("touchmove",S),()=>{x.removeEventListener(b,h),x.removeEventListener("touchmove",S)}}},[h,a]),r!==!1&&(g[r]=y(r)),A.useEffect(()=>{if(r!==!1){const b=x3(r),x=ao(l.current);return x.addEventListener(b,h),()=>{x.removeEventListener(b,h)}}},[h,r]),A.cloneElement(t,g)}function ske(e){return en("MuiSnackbarContent",e)}Wt("MuiSnackbarContent",["root","message","action"]);const lke=e=>{const{classes:t}=e;return Jt({root:["root"],action:["action"],message:["message"]},ske,t)},cke=Ye(gp,{name:"MuiSnackbarContent",slot:"Root"})(hn(({theme:e})=>{const t=e.palette.mode==="light"?.8:.98;return{...e.typography.body2,color:e.vars?e.vars.palette.SnackbarContent.color:e.palette.getContrastText(LT(e.palette.background.default,t)),backgroundColor:e.vars?e.vars.palette.SnackbarContent.bg:LT(e.palette.background.default,t),display:"flex",alignItems:"center",flexWrap:"wrap",padding:"6px 16px",flexGrow:1,[e.breakpoints.up("sm")]:{flexGrow:"initial",minWidth:288}}})),uke=Ye("div",{name:"MuiSnackbarContent",slot:"Message"})({padding:"8px 0"}),dke=Ye("div",{name:"MuiSnackbarContent",slot:"Action"})({display:"flex",alignItems:"center",marginLeft:"auto",paddingLeft:16,marginRight:-8}),pke=A.forwardRef(function(e,t){const n=sn({props:e,name:"MuiSnackbarContent"}),{action:r,className:o,message:a,role:i="alert",...l}=n,u=n,d=lke(u);return v.jsxs(cke,{role:i,elevation:6,className:Tt(d.root,o),ownerState:u,ref:t,...l,children:[v.jsx(uke,{className:d.message,ownerState:u,children:a}),r?v.jsx(dke,{className:d.action,ownerState:u,children:r}):null]})});function fke(e){return en("MuiSnackbar",e)}Wt("MuiSnackbar",["root","anchorOriginTopCenter","anchorOriginBottomCenter","anchorOriginTopRight","anchorOriginBottomRight","anchorOriginTopLeft","anchorOriginBottomLeft"]);const hke=e=>{const{classes:t,anchorOrigin:n}=e,r={root:["root",`anchorOrigin${Ze(n.vertical)}${Ze(n.horizontal)}`]};return Jt(r,fke,t)},mke=Ye("div",{name:"MuiSnackbar",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`anchorOrigin${Ze(n.anchorOrigin.vertical)}${Ze(n.anchorOrigin.horizontal)}`]]}})(hn(({theme:e})=>({zIndex:(e.vars||e).zIndex.snackbar,position:"fixed",display:"flex",left:8,right:8,justifyContent:"center",alignItems:"center",variants:[{props:({ownerState:t})=>t.anchorOrigin.vertical==="top",style:{top:8,[e.breakpoints.up("sm")]:{top:24}}},{props:({ownerState:t})=>t.anchorOrigin.vertical!=="top",style:{bottom:8,[e.breakpoints.up("sm")]:{bottom:24}}},{props:({ownerState:t})=>t.anchorOrigin.horizontal==="left",style:{justifyContent:"flex-start",[e.breakpoints.up("sm")]:{left:24,right:"auto"}}},{props:({ownerState:t})=>t.anchorOrigin.horizontal==="right",style:{justifyContent:"flex-end",[e.breakpoints.up("sm")]:{right:24,left:"auto"}}},{props:({ownerState:t})=>t.anchorOrigin.horizontal==="center",style:{[e.breakpoints.up("sm")]:{left:"50%",right:"auto",transform:"translateX(-50%)"}}}]}))),gke=A.forwardRef(function(e,t){const n=sn({props:e,name:"MuiSnackbar"}),r=dp(),o={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{action:a,anchorOrigin:{vertical:i,horizontal:l}={vertical:"bottom",horizontal:"left"},autoHideDuration:u=null,children:d,className:p,ClickAwayListenerProps:h,ContentProps:y,disableWindowBlurListener:g=!1,message:b,onBlur:x,onClose:S,onFocus:E,onMouseEnter:_,onMouseLeave:C,open:R,resumeHideDuration:O,slots:I={},slotProps:F={},TransitionComponent:H,transitionDuration:z=o,TransitionProps:{onEnter:L,onExited:$,...k}={},...M}=n,j={...n,anchorOrigin:{vertical:i,horizontal:l},autoHideDuration:u,disableWindowBlurListener:g,TransitionComponent:H,transitionDuration:z},V=hke(j),{getRootProps:B,onClickAway:q}=oke({...j}),[Y,ee]=A.useState(!0),N=Ue=>{ee(!0),$&&$(Ue)},W=(Ue,Re)=>{ee(!1),L&&L(Ue,Re)},K={slots:{transition:H,...I},slotProps:{content:y,clickAwayListener:h,transition:k,...F}},[P,Z]=xn("root",{ref:t,className:[V.root,p],elementType:mke,getSlotProps:B,externalForwardedProps:{...K,...M},ownerState:j}),[ae,{ownerState:J,...pe}]=xn("clickAwayListener",{elementType:ike,externalForwardedProps:K,getSlotProps:Ue=>({onClickAway:(...Re)=>{const ve=Re[0];Ue.onClickAway?.(...Re),!ve?.defaultMuiPrevented&&q(...Re)}}),ownerState:j}),[le,Ee]=xn("content",{elementType:pke,shouldForwardComponentProp:!0,externalForwardedProps:K,additionalProps:{message:b,action:a},ownerState:j}),[Te,Ae]=xn("transition",{elementType:vb,externalForwardedProps:K,getSlotProps:Ue=>({onEnter:(...Re)=>{Ue.onEnter?.(...Re),W(...Re)},onExited:(...Re)=>{Ue.onExited?.(...Re),N(...Re)}}),additionalProps:{appear:!0,in:R,timeout:z,direction:i==="top"?"down":"up"},ownerState:j});return!R&&Y?null:v.jsx(ae,{...pe,...I.clickAwayListener&&{ownerState:J},children:v.jsx(P,{...Z,children:v.jsx(Te,{...Ae,children:d||v.jsx(le,{...Ee})})})})});function yke(){const[e,t]=A.useState(!1),{apiClients:n}=Zn(),[r,o]=A.useState(""),a=()=>{t(!0)},i=()=>{t(!1)},l=Ms(),u=Ui({async mutationFn(p){return n.projects.createProject({name:p.name,readme:xj({name:p.name,readme:""},p.description)})},onSuccess(){i(),l.invalidateQueries({queryKey:["projects"]}),o("Project created successfully")},onError(p){o(p instanceof Error?p.message:"An unknown error occurred")}}),d=async p=>{p.preventDefault();const h=new FormData(p.currentTarget),y=h.get("name")?.toString(),g=h.get("description")?.toString();if(!y)throw new Error("Name is required");u.mutate({name:y,description:g})};return v.jsxs(Qe.Fragment,{children:[v.jsx(Br,{variant:"contained",onClick:a,startIcon:v.jsx(tte,{}),sx:{mt:2,color:"white"},children:"Create New Project"}),v.jsxs(Bs,{open:e,onClose:i,children:[v.jsx($s,{children:"Create New Project"}),v.jsxs(zs,{children:[v.jsx(Ap,{children:"Add a new project to start exploring semantic models and analyzing data."}),v.jsxs("form",{onSubmit:d,id:"project-form",children:[v.jsx(bo,{autoFocus:!0,required:!0,margin:"dense",id:"name",name:"name",label:"Project Name",type:"text",fullWidth:!0,variant:"standard"}),v.jsx(bo,{margin:"dense",id:"description",name:"description",label:"Project Description",placeholder:"Explore semantic models, run queries, and build dashboards",type:"text",fullWidth:!0,variant:"standard"})]})]}),v.jsxs(Us,{children:[v.jsx(Br,{disabled:u.isPending,onClick:i,children:"Cancel"}),v.jsx(Br,{type:"submit",form:"project-form",loading:u.isPending,children:"Create Project"})]})]}),v.jsx(gke,{open:r!=="",autoHideDuration:6e3,onClose:()=>o(""),message:r})]})}function bke({project:e,onCloseDialog:t}){const[n,r]=A.useState(!1),{apiClients:o}=Zn(),a=Ms(),[i,l]=A.useState(""),u=()=>{r(!0)},d=()=>{r(!1),t()},p=Ui({mutationFn:()=>o.projects.deleteProject(e.name),onSuccess(){d(),a.invalidateQueries({queryKey:["projects"]}),l("Project deleted successfully")},onError(h){l(h instanceof Error?h.message:"An unknown error occurred")}});return v.jsxs(Qe.Fragment,{children:[v.jsxs($l,{onClick:u,children:[v.jsx(nv,{children:v.jsx(jA,{fontSize:"small"})}),v.jsx(As,{children:"Delete"})]}),v.jsxs(Bs,{onClose:d,"aria-labelledby":"customized-dialog-title",open:n,children:[v.jsx($s,{sx:{m:0,p:2},id:"customized-dialog-title",children:"Delete Project"}),v.jsx(Qd,{"aria-label":"close",onClick:d,sx:h=>({position:"absolute",right:8,top:8,color:h.palette.grey[500]}),children:v.jsx(Vl,{})}),v.jsx(zs,{dividers:!0,children:v.jsxs(Jm,{gutterBottom:!0,children:['Are you sure you want to delete "',e.name,'"? This action cannot be undone.']})}),v.jsxs(Us,{children:[v.jsx(Br,{variant:"outlined",onClick:d,style:{borderColor:"#14b3cb",color:"#14b3cb"},children:"Cancel"}),v.jsx(Br,{loading:p.isPending,variant:"contained",autoFocus:!0,onClick:()=>p.mutate(),color:"error",children:"Delete"})]}),v.jsx(Ls,{open:i!=="",autoHideDuration:6e3,onClose:()=>l(""),message:i})]})]})}function vke({project:e,onCloseDialog:t}){const[n,r]=A.useState(!1),{apiClients:o}=Zn(),a=Ms(),[i,l]=A.useState(""),u=()=>{r(!0)},d=()=>{r(!1),t()},p=Ui({async mutationFn(y){return o.projects.updateProject(e.name,{name:e.name,readme:xj({name:e.name,readme:e.readme},y.description)})},onSuccess(){d(),a.invalidateQueries({queryKey:["projects"]}),l("Project updated successfully")},onError(y){l(y instanceof Error?y.message:"An unknown error occurred")}}),h=y=>{y.preventDefault();const g=new FormData(y.currentTarget).get("description")?.toString();p.mutate({description:g})};return v.jsxs(Qe.Fragment,{children:[v.jsxs($l,{onClick:u,children:[v.jsx(nv,{children:v.jsx(BA,{fontSize:"small"})}),v.jsx(As,{children:"Edit"})]}),v.jsxs(Bs,{open:n,onClose:d,children:[v.jsx($s,{children:"Edit Project"}),v.jsxs(zs,{children:[v.jsx(Ap,{children:"Add a new project to start exploring semantic models and analyzing data."}),v.jsxs("form",{onSubmit:h,id:"project-form",children:[v.jsx(bo,{autoFocus:!0,required:!0,margin:"dense",id:"name",name:"name",label:"Project Name",disabled:!0,type:"text",fullWidth:!0,variant:"standard",defaultValue:e.name}),v.jsx(bo,{margin:"dense",id:"description",name:"description",label:"Project Description",type:"text",fullWidth:!0,variant:"standard",defaultValue:Ej(e.readme)})]})]}),v.jsxs(Us,{children:[v.jsx(Br,{disabled:p.isPending,onClick:d,children:"Cancel"}),v.jsx(Br,{type:"submit",form:"project-form",loading:p.isPending,children:"Save Changes"})]})]}),v.jsx(Ls,{open:i!=="",autoHideDuration:6e3,onClose:()=>l(""),message:i})]})}function ywe({onClickProject:e}){const{apiClients:t,mutable:n}=Zn(),{data:r,isSuccess:o,isError:a,error:i}=Zo({queryKey:["projects"],queryFn:()=>t.projects.listProjects()});return a?v.jsx(Xo,{error:i,context:"Projects List"}):o?v.jsxs(tK,{maxWidth:"lg",sx:{py:4},children:[v.jsxs(It,{sx:{textAlign:"center",mb:6},children:[v.jsxs(Zr,{direction:"row",justifyContent:"center",alignItems:"center",spacing:1,sx:{mb:2},children:[v.jsx(v3,{sx:{fontSize:32,color:"primary.main"}}),v.jsx(ct,{variant:"h3",component:"h1",fontWeight:700,children:"Publisher"})]}),v.jsx(ct,{variant:"h5",color:"text.secondary",sx:{mb:3,maxWidth:600,mx:"auto"},children:"The open-source semantic model server for the Malloy data language"}),v.jsx(ct,{variant:"body1",color:"text.secondary",sx:{maxWidth:800,mx:"auto"},children:"Define semantic models once — and use them everywhere. Publisher serves Malloy models through clean APIs, enabling consistent, interpretable, and AI-ready data access for tools, applications, and agents."})]}),v.jsxs(Ar,{container:!0,spacing:3,sx:{mb:6},children:[v.jsx(Ar,{size:{xs:12,md:4},children:v.jsx(Sd,{variant:"outlined",onClick:()=>{window.open("https://github.com/malloydata/publisher/blob/main/README.md#ad-hoc-data-analysis","_blank")},sx:{height:"100%",cursor:"pointer",transition:"all 0.2s ease","&:hover":{transform:"translateY(-2px)",boxShadow:2}},children:v.jsxs(Td,{sx:{p:3},children:[v.jsxs(Zr,{direction:"row",alignItems:"center",spacing:1,sx:{mb:2},children:[v.jsx(J_e,{sx:{color:"info.main",fontSize:28}}),v.jsx(ct,{variant:"h6",fontWeight:600,children:"Ad Hoc Analysis"})]}),v.jsx(ct,{variant:"body2",color:"text.secondary",sx:{mb:2},children:"Use Explorer, a visual query builder that allows analysts to browse semantic sources, build queries, and run nested logic — all without writing code."}),v.jsx(n0,{label:"No-code",size:"small",color:"primary",variant:"outlined"})]})})}),v.jsx(Ar,{size:{xs:12,md:4},children:v.jsx(Sd,{variant:"outlined",onClick:()=>{window.open("https://github.com/malloydata/publisher/blob/main/README.md#notebook-based-dashboards","_blank")},sx:{height:"100%",cursor:"pointer",transition:"all 0.2s ease","&:hover":{transform:"translateY(-2px)",boxShadow:2}},children:v.jsxs(Td,{sx:{p:3},children:[v.jsxs(Zr,{direction:"row",alignItems:"center",spacing:1,sx:{mb:2},children:[v.jsx(tke,{sx:{color:"warning.main",fontSize:28}}),v.jsx(ct,{variant:"h6",fontWeight:600,children:"Notebook Dashboards"})]}),v.jsx(ct,{variant:"body2",color:"text.secondary",sx:{mb:2},children:"Create shareable, code-first dashboards using Malloy notebooks. Include text, charts, and reusable views — all versioned alongside your models."}),v.jsx(n0,{label:"Versioned",size:"small",color:"warning",variant:"outlined"})]})})}),v.jsx(Ar,{size:{xs:12,md:4},children:v.jsx(Sd,{variant:"outlined",onClick:()=>{window.open("https://github.com/malloydata/publisher/blob/main/README.md#mcp-based-ai-data-agents","_blank")},sx:{height:"100%",cursor:"pointer",transition:"all 0.2s ease","&:hover":{transform:"translateY(-2px)",boxShadow:2}},children:v.jsxs(Td,{sx:{p:3},children:[v.jsxs(Zr,{direction:"row",alignItems:"center",spacing:1,sx:{mb:2},children:[v.jsx(rke,{sx:{color:"success.main",fontSize:28}}),v.jsx(ct,{variant:"h6",fontWeight:600,children:"AI Data Agents"})]}),v.jsx(ct,{variant:"body2",color:"text.secondary",sx:{mb:2},children:"Expose your semantic models via the Model Context Protocol (MCP), enabling AI agents to discover sources and ask well-formed questions."}),v.jsx(n0,{label:"AI-Ready",size:"small",color:"success",variant:"outlined"})]})})})]}),v.jsx(Hi,{sx:{my:4}}),r.data.length>0?v.jsxs(v.Fragment,{children:[v.jsxs(It,{sx:{textAlign:"center",mb:4},children:[v.jsxs(Zr,{direction:"row",justifyContent:"center",alignItems:"center",spacing:1,sx:{mb:2},children:[v.jsx(E3,{sx:{color:"primary.main",fontSize:24}}),v.jsx(ct,{variant:"h4",fontWeight:600,children:"Select a Project"})]}),v.jsx(ct,{variant:"body1",color:"text.secondary",children:"Choose a project to explore its semantic models and start analyzing your data"}),n&&v.jsx(yke,{})]}),v.jsx(Ar,{container:!0,spacing:3,justifyContent:"center",children:r.data.map(l=>v.jsx(Ar,{size:{xs:12,sm:6,md:4},children:v.jsx(Eke,{project:l,onClickProject:e})},l.name))})]}):v.jsxs(It,{sx:{textAlign:"center",mb:4},children:[v.jsxs(Zr,{direction:"row",justifyContent:"center",alignItems:"center",spacing:1,sx:{mb:2},children:[v.jsx(E3,{sx:{color:"primary.main",fontSize:24}}),v.jsx(ct,{variant:"h4",fontWeight:600,children:"Get Started"})]}),v.jsx(ct,{variant:"body1",color:"text.secondary",sx:{mb:3},children:"No projects found. Create your first Malloy project to start exploring semantic models and building data experiences."}),v.jsx(ma,{variant:"contained",size:"large",color:"primary",startIcon:v.jsx(v3,{}),href:"https://github.com/malloydata/publisher/blob/main/README.md#server-configuration",target:"_blank",rel:"noopener noreferrer",children:"Learn How to Create Models"})]}),v.jsx(It,{sx:{textAlign:"center",mt:6,pt:4,borderTop:1,borderColor:"divider"},children:v.jsxs(ct,{variant:"body2",color:"text.secondary",children:["Publisher is built on fully open infrastructure and designed for the AI era. Join the"," ",v.jsx("a",{href:"https://join.slack.com/t/malloy-community/shared_invite/zt-1kgfwgi5g-CrsdaRqs81QY67QW0~t_uw",target:"_blank",rel:"noopener noreferrer",style:{color:"primary.main",textDecoration:"underline"},children:"Malloy Slack community"})," ","to ask questions, share ideas, and contribute to the future of data modeling."]})})]}):v.jsx(Ko,{text:"Loading projects..."})}function Eke({project:e,onClickProject:t}){const{mutable:n}=Zn(),[r,o]=A.useState(null),a=!!r,i=u=>{o(u.currentTarget)},l=()=>{o(null)};return v.jsx("div",{children:v.jsxs(Sd,{variant:"outlined",sx:{height:"100%",transition:"all 0.2s ease","&:hover":{transform:"translateY(-2px)",boxShadow:2,borderColor:"primary.main"}},children:[n&&v.jsxs(v.Fragment,{children:[v.jsx(ir,{"aria-controls":a?"project-menu":void 0,"aria-haspopup":"true","aria-expanded":a?"true":void 0,onClick:i,sx:{position:"absolute",top:8,right:8},children:v.jsx(a4,{fontSize:"small"})}),v.jsxs(Im,{id:"project-menu","aria-haspopup":"true","aria-expanded":a?"true":void 0,open:a,anchorEl:r,onClose:l,disableRestoreFocus:!0,anchorOrigin:{vertical:"top",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"right"},children:[v.jsx(vke,{project:e,onCloseDialog:l}),v.jsx(bke,{project:e,onCloseDialog:l})]})]}),v.jsxs(Td,{sx:{p:3,textAlign:"center"},children:[v.jsx(nke,{sx:{fontSize:48,color:"primary.main",mb:2}}),v.jsx(ct,{variant:"h6",fontWeight:600,gutterBottom:!0,children:e.name}),v.jsx(ct,{variant:"body2",color:"text.secondary",sx:{mb:2,minHeight:"60px"},children:Ej(e.readme)}),v.jsx(ma,{variant:"contained",color:"secondary",endIcon:v.jsx(eke,{}),fullWidth:!0,onClick:u=>t(`/${e.name}/`,u),children:"Open Project"})]})]})})}const xke=async e=>{if(typeof window>"u")throw new Error("MalloyRenderer can only be used in browser environment");const{MalloyRenderer:t}=await X(async()=>{const{MalloyRenderer:n}=await import("./index.umd-CzfgaPy4.js").then(r=>r.i);return{MalloyRenderer:n}},[]);return new t({onClick:e,onError:n=>{console.error("Error rendering visualization:",typeof n,n)}}).createViz()};function Ske({result:e,height:t,isFillElement:n,onSizeChange:r,onDrill:o}){const a=A.useRef(null),[i,l]=A.useState(!1);return A.useLayoutEffect(()=>{if(!a.current||!e)return;let u=!0;const d=a.current;for(;d.firstChild;)d.removeChild(d.firstChild);return xke(o).then(p=>{if(!u)return;const h=new MutationObserver(y=>{for(const g of y)if(g.type==="childList"&&g.addedNodes.length>0&&Array.from(g.addedNodes).some(b=>b.nodeType===Node.ELEMENT_NODE)){h.disconnect(),setTimeout(()=>{u&&l(!0)},50);break}});h.observe(d,{childList:!0,subtree:!0,characterData:!0});try{p.setResult(JSON.parse(e)),p.render(d)}catch(y){console.error("Error rendering visualization:",y),h.disconnect(),u&&l(!0)}}).catch(p=>{console.error("Failed to create renderer:",p),u&&l(!0)}),()=>{u=!1}},[e,o]),A.useEffect(()=>{if(!a.current||!i)return;const u=a.current,d=()=>{if(u){const y=u.offsetHeight;y>0?r&&r(y):n&&u.firstChild&&(u.firstChild.offsetHeight==0?n(!0):n(!1))}},p=setTimeout(d,100);let h=null;return h=new MutationObserver(d),h.observe(u,{childList:!0,subtree:!0,attributes:!0}),()=>{clearTimeout(p),h?.disconnect()}},[r,e,n,i]),v.jsx("div",{ref:a,style:{width:"100%",height:t?`${t}px`:"100%"}})}function Tke(e){return typeof window>"u"?v.jsx("div",{style:{width:"100%",height:e.height?`${e.height}px`:"100%",display:"flex",alignItems:"center",justifyContent:"center",color:"#666"},children:"Loading..."}):v.jsx(A.Suspense,{fallback:v.jsx("div",{style:{width:"100%",height:e.height?`${e.height}px`:"100%",display:"flex",alignItems:"center",justifyContent:"center",color:"#666"},children:"Loading visualization..."}),children:v.jsx(Ske,{...e})})}const Sj=Object.freeze(Object.defineProperty({__proto__:null,default:Tke},Symbol.toStringTag,{value:"Module"}));Pt.defaults.baseURL="IfYouAreSeeingThis_baseURL_IsNotSet";const dr={primary:{main:"#14b3cb",light:"#22d3ee",dark:"#0e7490",50:"#ecfeff",100:"#cffafe",500:"#14b3cb",600:"#0891b2",700:"#0e7490"},secondary:{main:"#fbbb04",light:"#fde047",dark:"#eab308",50:"#fefce8",100:"#fef3c7",500:"#fbbb04",600:"#eab308",700:"#ca8a04"},grey:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827"},success:{main:"#059669",light:"#10b981",dark:"#047857"},warning:{main:"#d97706",light:"#f59e0b",dark:"#b45309"},error:{main:"#dc2626",light:"#ef4444",dark:"#b91c1c"},info:{main:"#0891b2",light:"#06b6d4",dark:"#0e7490"}},Cke=Yb({palette:{mode:"light",primary:dr.primary,secondary:dr.secondary,grey:dr.grey,success:dr.success,warning:dr.warning,error:dr.error,info:dr.info,background:{default:"#ffffff",paper:"#ffffff"},text:{primary:dr.grey[900],secondary:dr.grey[600]},divider:dr.grey[200]},typography:{fontFamily:'"Inter", "Roboto", "Helvetica", "Arial", sans-serif',h1:{fontWeight:700,letterSpacing:"-0.025em"},h2:{fontWeight:700,letterSpacing:"-0.025em"},h3:{fontWeight:600,letterSpacing:"-0.025em"},h4:{fontWeight:600,letterSpacing:"-0.025em"},h5:{fontWeight:600,letterSpacing:"-0.025em"},h6:{fontWeight:600,letterSpacing:"-0.025em"},subtitle1:{fontWeight:500,letterSpacing:"-0.025em"},subtitle2:{fontWeight:500,letterSpacing:"-0.025em"},body1:{letterSpacing:"-0.025em"},body2:{letterSpacing:"-0.025em"},button:{fontWeight:500,letterSpacing:"-0.025em",textTransform:"none"}},shape:{borderRadius:4},components:{MuiCssBaseline:{styleOverrides:{body:{scrollbarWidth:"thin",scrollbarColor:`${dr.grey[300]} ${dr.grey[100]}`,"&::-webkit-scrollbar":{width:"8px",height:"8px"},"&::-webkit-scrollbar-track":{background:dr.grey[100],borderRadius:"4px"},"&::-webkit-scrollbar-thumb":{background:dr.grey[300],borderRadius:"4px","&:hover":{background:dr.grey[400]}},"&::-webkit-scrollbar-corner":{background:dr.grey[100]}},"*":{scrollbarWidth:"thin",scrollbarColor:`${dr.grey[300]} ${dr.grey[100]}`,"&::-webkit-scrollbar":{width:"8px",height:"8px"},"&::-webkit-scrollbar-track":{background:dr.grey[100],borderRadius:"4px"},"&::-webkit-scrollbar-thumb":{background:dr.grey[300],borderRadius:"4px","&:hover":{background:dr.grey[400]}},"&::-webkit-scrollbar-corner":{background:dr.grey[100]}},"div[data-radix-popper-content-wrapper]":{zIndex:"1300 !important"}}},MuiButton:{styleOverrides:{root:{borderRadius:4,textTransform:"none",fontWeight:500,boxShadow:"none","&:hover":{boxShadow:"0 1px 3px rgba(0, 0, 0, 0.1)"}},contained:{"&:hover":{boxShadow:"0 2px 4px rgba(0, 0, 0, 0.1)"}}}},MuiCard:{styleOverrides:{root:{borderRadius:4,boxShadow:"0 1px 3px rgba(0, 0, 0, 0.1)",border:"1px solid",borderColor:"rgba(0, 0, 0, 0.05)"}}},MuiChip:{styleOverrides:{root:{borderRadius:4,fontWeight:500}}},MuiTextField:{styleOverrides:{root:{"& .MuiOutlinedInput-root":{borderRadius:4}}}},MuiDialog:{styleOverrides:{paper:{borderRadius:4,boxShadow:"0px 20px 25px -5px rgba(0, 0, 0, 0.1), 0px 10px 10px -5px rgba(0, 0, 0, 0.04)"}}},MuiMenu:{styleOverrides:{paper:{borderRadius:4,boxShadow:"0px 10px 15px -3px rgba(0, 0, 0, 0.1), 0px 4px 6px -2px rgba(0, 0, 0, 0.05)",border:"1px solid rgba(0, 0, 0, 0.05)"}}},MuiBreadcrumbs:{styleOverrides:{root:{"& .MuiBreadcrumbs-separator":{margin:"0 6px",color:dr.grey[400]}}}},MuiDivider:{styleOverrides:{root:{margin:"4px 0",borderColor:dr.grey[200]}},defaultProps:{sx:{my:1}}}}}),Ake=A.lazy(()=>X(()=>import("./HomePage-Qc68TNcO.js"),[])),_ke=A.lazy(()=>X(()=>import("./MainPage-BqJViErq.js"),[])),kke=A.lazy(()=>X(()=>import("./ModelPage-jy5aqW4h.js"),[])),wke=A.lazy(()=>X(()=>import("./PackagePage-HyA-5qLe.js"),[])),Rke=A.lazy(()=>X(()=>import("./ProjectPage-0v0w0clo.js"),[])),Dke=A.lazy(()=>X(()=>import("./RouteError-Cpci97vi.js"),[])),Ike=A.lazy(()=>X(()=>import("./WorkbookPage-B-ThNL_I.js"),[])),Oke=(e="/",t,n)=>Mz([{path:e,element:v.jsx(Jee,{children:v.jsx(sCe,{workbookStorage:t,children:v.jsxs(HG,{theme:Cke,children:[v.jsx(iK,{}),v.jsx(_ke,{headerProps:n})]})})}),errorElement:v.jsx(Dke,{}),children:[{path:"",element:v.jsx(Ake,{})},{path:":projectName",element:v.jsx(Rke,{})},{path:":projectName/:packageName",element:v.jsx(wke,{})},{path:":projectName/:packageName/*",element:v.jsx(kke,{})},{path:":projectName/:packageName/workbook/:workspace/:workbookPath",element:v.jsx(Ike,{})}]}]),Nke=Oke("/",new fCe,void 0);F9.createRoot(document.getElementById("root")).render(v.jsx(A.StrictMode,{children:v.jsx(Yz,{router:Nke})}));export{fwe as A,qc as B,n0 as C,Vfe as D,mwe as E,az as F,Lke as G,Qe as H,ir as I,Cl as J,Tm as K,ywe as L,Im as M,gwe as N,Fke as O,Ol as P,Pke as Q,A0 as R,Zr as S,ct as T,S3 as U,dCe as Y,hwe as _,va as a,wt as b,Ot as c,Nt as d,lt as e,Ve as f,lV as g,Rt as h,zo as i,v as j,Ki as k,QS as l,Ht as m,eM as n,Fi as o,Mke as p,It as q,A as r,Ne as s,$3 as t,JC as u,ql as v,$l as w,ma as x,tK as y,d_ as z};
447
+ `)};function oke(e={}){const{autoHideDuration:t=null,disableWindowBlurListener:n=!1,onClose:r,open:o,resumeHideDuration:a}=e,i=Uv();A.useEffect(()=>{if(!o)return;function S(E){E.defaultPrevented||E.key==="Escape"&&r?.(E,"escapeKeyDown")}return document.addEventListener("keydown",S),()=>{document.removeEventListener("keydown",S)}},[o,r]);const l=Fr((S,E)=>{r?.(S,E)}),u=Fr(S=>{!r||S==null||i.start(S,()=>{l(null,"timeout")})});A.useEffect(()=>(o&&u(t),i.clear),[o,t,u,i]);const d=S=>{r?.(S,"clickaway")},p=i.clear,h=A.useCallback(()=>{t!=null&&u(a??t*.5)},[t,a,u]),y=S=>E=>{const _=S.onBlur;_?.(E),h()},g=S=>E=>{const _=S.onFocus;_?.(E),p()},b=S=>E=>{const _=S.onMouseEnter;_?.(E),p()},x=S=>E=>{const _=S.onMouseLeave;_?.(E),h()};return A.useEffect(()=>{if(!n&&o)return window.addEventListener("focus",h),window.addEventListener("blur",p),()=>{window.removeEventListener("focus",h),window.removeEventListener("blur",p)}},[n,o,h,p]),{getRootProps:(S={})=>{const E={...To(e),...To(S)};return{role:"presentation",...S,...E,onBlur:y(E),onFocus:g(E),onMouseEnter:b(E),onMouseLeave:x(E)}},onClickAway:d}}function x3(e){return e.substring(2).toLowerCase()}function ake(e,t){return t.documentElement.clientWidth<e.clientX||t.documentElement.clientHeight<e.clientY}function ike(e){const{children:t,disableReactTree:n=!1,mouseEvent:r="onClick",onClickAway:o,touchEvent:a="onTouchEnd"}=e,i=A.useRef(!1),l=A.useRef(null),u=A.useRef(!1),d=A.useRef(!1);A.useEffect(()=>(setTimeout(()=>{u.current=!0},0),()=>{u.current=!1}),[]);const p=sr(mp(t),l),h=Fr(b=>{const x=d.current;d.current=!1;const S=ao(l.current);if(!u.current||!l.current||"clientX"in b&&ake(b,S))return;if(i.current){i.current=!1;return}let E;b.composedPath?E=b.composedPath().includes(l.current):E=!S.documentElement.contains(b.target)||l.current.contains(b.target),!E&&(n||!x)&&o(b)}),y=b=>x=>{d.current=!0;const S=t.props[b];S&&S(x)},g={ref:p};return a!==!1&&(g[a]=y(a)),A.useEffect(()=>{if(a!==!1){const b=x3(a),x=ao(l.current),S=()=>{i.current=!0};return x.addEventListener(b,h),x.addEventListener("touchmove",S),()=>{x.removeEventListener(b,h),x.removeEventListener("touchmove",S)}}},[h,a]),r!==!1&&(g[r]=y(r)),A.useEffect(()=>{if(r!==!1){const b=x3(r),x=ao(l.current);return x.addEventListener(b,h),()=>{x.removeEventListener(b,h)}}},[h,r]),A.cloneElement(t,g)}function ske(e){return en("MuiSnackbarContent",e)}Wt("MuiSnackbarContent",["root","message","action"]);const lke=e=>{const{classes:t}=e;return Jt({root:["root"],action:["action"],message:["message"]},ske,t)},cke=Ye(gp,{name:"MuiSnackbarContent",slot:"Root"})(hn(({theme:e})=>{const t=e.palette.mode==="light"?.8:.98;return{...e.typography.body2,color:e.vars?e.vars.palette.SnackbarContent.color:e.palette.getContrastText(LT(e.palette.background.default,t)),backgroundColor:e.vars?e.vars.palette.SnackbarContent.bg:LT(e.palette.background.default,t),display:"flex",alignItems:"center",flexWrap:"wrap",padding:"6px 16px",flexGrow:1,[e.breakpoints.up("sm")]:{flexGrow:"initial",minWidth:288}}})),uke=Ye("div",{name:"MuiSnackbarContent",slot:"Message"})({padding:"8px 0"}),dke=Ye("div",{name:"MuiSnackbarContent",slot:"Action"})({display:"flex",alignItems:"center",marginLeft:"auto",paddingLeft:16,marginRight:-8}),pke=A.forwardRef(function(e,t){const n=sn({props:e,name:"MuiSnackbarContent"}),{action:r,className:o,message:a,role:i="alert",...l}=n,u=n,d=lke(u);return v.jsxs(cke,{role:i,elevation:6,className:Tt(d.root,o),ownerState:u,ref:t,...l,children:[v.jsx(uke,{className:d.message,ownerState:u,children:a}),r?v.jsx(dke,{className:d.action,ownerState:u,children:r}):null]})});function fke(e){return en("MuiSnackbar",e)}Wt("MuiSnackbar",["root","anchorOriginTopCenter","anchorOriginBottomCenter","anchorOriginTopRight","anchorOriginBottomRight","anchorOriginTopLeft","anchorOriginBottomLeft"]);const hke=e=>{const{classes:t,anchorOrigin:n}=e,r={root:["root",`anchorOrigin${Ze(n.vertical)}${Ze(n.horizontal)}`]};return Jt(r,fke,t)},mke=Ye("div",{name:"MuiSnackbar",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`anchorOrigin${Ze(n.anchorOrigin.vertical)}${Ze(n.anchorOrigin.horizontal)}`]]}})(hn(({theme:e})=>({zIndex:(e.vars||e).zIndex.snackbar,position:"fixed",display:"flex",left:8,right:8,justifyContent:"center",alignItems:"center",variants:[{props:({ownerState:t})=>t.anchorOrigin.vertical==="top",style:{top:8,[e.breakpoints.up("sm")]:{top:24}}},{props:({ownerState:t})=>t.anchorOrigin.vertical!=="top",style:{bottom:8,[e.breakpoints.up("sm")]:{bottom:24}}},{props:({ownerState:t})=>t.anchorOrigin.horizontal==="left",style:{justifyContent:"flex-start",[e.breakpoints.up("sm")]:{left:24,right:"auto"}}},{props:({ownerState:t})=>t.anchorOrigin.horizontal==="right",style:{justifyContent:"flex-end",[e.breakpoints.up("sm")]:{right:24,left:"auto"}}},{props:({ownerState:t})=>t.anchorOrigin.horizontal==="center",style:{[e.breakpoints.up("sm")]:{left:"50%",right:"auto",transform:"translateX(-50%)"}}}]}))),gke=A.forwardRef(function(e,t){const n=sn({props:e,name:"MuiSnackbar"}),r=dp(),o={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{action:a,anchorOrigin:{vertical:i,horizontal:l}={vertical:"bottom",horizontal:"left"},autoHideDuration:u=null,children:d,className:p,ClickAwayListenerProps:h,ContentProps:y,disableWindowBlurListener:g=!1,message:b,onBlur:x,onClose:S,onFocus:E,onMouseEnter:_,onMouseLeave:C,open:R,resumeHideDuration:O,slots:I={},slotProps:F={},TransitionComponent:H,transitionDuration:z=o,TransitionProps:{onEnter:L,onExited:$,...k}={},...M}=n,j={...n,anchorOrigin:{vertical:i,horizontal:l},autoHideDuration:u,disableWindowBlurListener:g,TransitionComponent:H,transitionDuration:z},V=hke(j),{getRootProps:B,onClickAway:q}=oke({...j}),[Y,ee]=A.useState(!0),N=Ue=>{ee(!0),$&&$(Ue)},W=(Ue,Re)=>{ee(!1),L&&L(Ue,Re)},K={slots:{transition:H,...I},slotProps:{content:y,clickAwayListener:h,transition:k,...F}},[P,Z]=xn("root",{ref:t,className:[V.root,p],elementType:mke,getSlotProps:B,externalForwardedProps:{...K,...M},ownerState:j}),[ae,{ownerState:J,...pe}]=xn("clickAwayListener",{elementType:ike,externalForwardedProps:K,getSlotProps:Ue=>({onClickAway:(...Re)=>{const ve=Re[0];Ue.onClickAway?.(...Re),!ve?.defaultMuiPrevented&&q(...Re)}}),ownerState:j}),[le,Ee]=xn("content",{elementType:pke,shouldForwardComponentProp:!0,externalForwardedProps:K,additionalProps:{message:b,action:a},ownerState:j}),[Te,Ae]=xn("transition",{elementType:vb,externalForwardedProps:K,getSlotProps:Ue=>({onEnter:(...Re)=>{Ue.onEnter?.(...Re),W(...Re)},onExited:(...Re)=>{Ue.onExited?.(...Re),N(...Re)}}),additionalProps:{appear:!0,in:R,timeout:z,direction:i==="top"?"down":"up"},ownerState:j});return!R&&Y?null:v.jsx(ae,{...pe,...I.clickAwayListener&&{ownerState:J},children:v.jsx(P,{...Z,children:v.jsx(Te,{...Ae,children:d||v.jsx(le,{...Ee})})})})});function yke(){const[e,t]=A.useState(!1),{apiClients:n}=Zn(),[r,o]=A.useState(""),a=()=>{t(!0)},i=()=>{t(!1)},l=Ms(),u=Ui({async mutationFn(p){return n.projects.createProject({name:p.name,readme:xj({name:p.name,readme:""},p.description)})},onSuccess(){i(),l.invalidateQueries({queryKey:["projects"]}),o("Project created successfully")},onError(p){o(p instanceof Error?p.message:"An unknown error occurred")}}),d=async p=>{p.preventDefault();const h=new FormData(p.currentTarget),y=h.get("name")?.toString(),g=h.get("description")?.toString();if(!y)throw new Error("Name is required");u.mutate({name:y,description:g})};return v.jsxs(Qe.Fragment,{children:[v.jsx(Br,{variant:"contained",onClick:a,startIcon:v.jsx(tte,{}),sx:{mt:2,color:"white"},children:"Create New Project"}),v.jsxs(Bs,{open:e,onClose:i,children:[v.jsx($s,{children:"Create New Project"}),v.jsxs(zs,{children:[v.jsx(Ap,{children:"Add a new project to start exploring semantic models and analyzing data."}),v.jsxs("form",{onSubmit:d,id:"project-form",children:[v.jsx(bo,{autoFocus:!0,required:!0,margin:"dense",id:"name",name:"name",label:"Project Name",type:"text",fullWidth:!0,variant:"standard"}),v.jsx(bo,{margin:"dense",id:"description",name:"description",label:"Project Description",placeholder:"Explore semantic models, run queries, and build dashboards",type:"text",fullWidth:!0,variant:"standard"})]})]}),v.jsxs(Us,{children:[v.jsx(Br,{disabled:u.isPending,onClick:i,children:"Cancel"}),v.jsx(Br,{type:"submit",form:"project-form",loading:u.isPending,children:"Create Project"})]})]}),v.jsx(gke,{open:r!=="",autoHideDuration:6e3,onClose:()=>o(""),message:r})]})}function bke({project:e,onCloseDialog:t}){const[n,r]=A.useState(!1),{apiClients:o}=Zn(),a=Ms(),[i,l]=A.useState(""),u=()=>{r(!0)},d=()=>{r(!1),t()},p=Ui({mutationFn:()=>o.projects.deleteProject(e.name),onSuccess(){d(),a.invalidateQueries({queryKey:["projects"]}),l("Project deleted successfully")},onError(h){l(h instanceof Error?h.message:"An unknown error occurred")}});return v.jsxs(Qe.Fragment,{children:[v.jsxs($l,{onClick:u,children:[v.jsx(nv,{children:v.jsx(jA,{fontSize:"small"})}),v.jsx(As,{children:"Delete"})]}),v.jsxs(Bs,{onClose:d,"aria-labelledby":"customized-dialog-title",open:n,children:[v.jsx($s,{sx:{m:0,p:2},id:"customized-dialog-title",children:"Delete Project"}),v.jsx(Qd,{"aria-label":"close",onClick:d,sx:h=>({position:"absolute",right:8,top:8,color:h.palette.grey[500]}),children:v.jsx(Vl,{})}),v.jsx(zs,{dividers:!0,children:v.jsxs(Jm,{gutterBottom:!0,children:['Are you sure you want to delete "',e.name,'"? This action cannot be undone.']})}),v.jsxs(Us,{children:[v.jsx(Br,{variant:"outlined",onClick:d,style:{borderColor:"#14b3cb",color:"#14b3cb"},children:"Cancel"}),v.jsx(Br,{loading:p.isPending,variant:"contained",autoFocus:!0,onClick:()=>p.mutate(),color:"error",children:"Delete"})]}),v.jsx(Ls,{open:i!=="",autoHideDuration:6e3,onClose:()=>l(""),message:i})]})]})}function vke({project:e,onCloseDialog:t}){const[n,r]=A.useState(!1),{apiClients:o}=Zn(),a=Ms(),[i,l]=A.useState(""),u=()=>{r(!0)},d=()=>{r(!1),t()},p=Ui({async mutationFn(y){return o.projects.updateProject(e.name,{name:e.name,readme:xj({name:e.name,readme:e.readme},y.description)})},onSuccess(){d(),a.invalidateQueries({queryKey:["projects"]}),l("Project updated successfully")},onError(y){l(y instanceof Error?y.message:"An unknown error occurred")}}),h=y=>{y.preventDefault();const g=new FormData(y.currentTarget).get("description")?.toString();p.mutate({description:g})};return v.jsxs(Qe.Fragment,{children:[v.jsxs($l,{onClick:u,children:[v.jsx(nv,{children:v.jsx(BA,{fontSize:"small"})}),v.jsx(As,{children:"Edit"})]}),v.jsxs(Bs,{open:n,onClose:d,children:[v.jsx($s,{children:"Edit Project"}),v.jsxs(zs,{children:[v.jsx(Ap,{children:"Add a new project to start exploring semantic models and analyzing data."}),v.jsxs("form",{onSubmit:h,id:"project-form",children:[v.jsx(bo,{autoFocus:!0,required:!0,margin:"dense",id:"name",name:"name",label:"Project Name",disabled:!0,type:"text",fullWidth:!0,variant:"standard",defaultValue:e.name}),v.jsx(bo,{margin:"dense",id:"description",name:"description",label:"Project Description",type:"text",fullWidth:!0,variant:"standard",defaultValue:Ej(e.readme)})]})]}),v.jsxs(Us,{children:[v.jsx(Br,{disabled:p.isPending,onClick:d,children:"Cancel"}),v.jsx(Br,{type:"submit",form:"project-form",loading:p.isPending,children:"Save Changes"})]})]}),v.jsx(Ls,{open:i!=="",autoHideDuration:6e3,onClose:()=>l(""),message:i})]})}function ywe({onClickProject:e}){const{apiClients:t,mutable:n}=Zn(),{data:r,isSuccess:o,isError:a,error:i}=Zo({queryKey:["projects"],queryFn:()=>t.projects.listProjects()});return a?v.jsx(Xo,{error:i,context:"Projects List"}):o?v.jsxs(tK,{maxWidth:"lg",sx:{py:4},children:[v.jsxs(It,{sx:{textAlign:"center",mb:6},children:[v.jsxs(Zr,{direction:"row",justifyContent:"center",alignItems:"center",spacing:1,sx:{mb:2},children:[v.jsx(v3,{sx:{fontSize:32,color:"primary.main"}}),v.jsx(ct,{variant:"h3",component:"h1",fontWeight:700,children:"Publisher"})]}),v.jsx(ct,{variant:"h5",color:"text.secondary",sx:{mb:3,maxWidth:600,mx:"auto"},children:"The open-source semantic model server for the Malloy data language"}),v.jsx(ct,{variant:"body1",color:"text.secondary",sx:{maxWidth:800,mx:"auto"},children:"Define semantic models once — and use them everywhere. Publisher serves Malloy models through clean APIs, enabling consistent, interpretable, and AI-ready data access for tools, applications, and agents."})]}),v.jsxs(Ar,{container:!0,spacing:3,sx:{mb:6},children:[v.jsx(Ar,{size:{xs:12,md:4},children:v.jsx(Sd,{variant:"outlined",onClick:()=>{window.open("https://github.com/malloydata/publisher/blob/main/README.md#ad-hoc-data-analysis","_blank")},sx:{height:"100%",cursor:"pointer",transition:"all 0.2s ease","&:hover":{transform:"translateY(-2px)",boxShadow:2}},children:v.jsxs(Td,{sx:{p:3},children:[v.jsxs(Zr,{direction:"row",alignItems:"center",spacing:1,sx:{mb:2},children:[v.jsx(J_e,{sx:{color:"info.main",fontSize:28}}),v.jsx(ct,{variant:"h6",fontWeight:600,children:"Ad Hoc Analysis"})]}),v.jsx(ct,{variant:"body2",color:"text.secondary",sx:{mb:2},children:"Use Explorer, a visual query builder that allows analysts to browse semantic sources, build queries, and run nested logic — all without writing code."}),v.jsx(n0,{label:"No-code",size:"small",color:"primary",variant:"outlined"})]})})}),v.jsx(Ar,{size:{xs:12,md:4},children:v.jsx(Sd,{variant:"outlined",onClick:()=>{window.open("https://github.com/malloydata/publisher/blob/main/README.md#notebook-based-dashboards","_blank")},sx:{height:"100%",cursor:"pointer",transition:"all 0.2s ease","&:hover":{transform:"translateY(-2px)",boxShadow:2}},children:v.jsxs(Td,{sx:{p:3},children:[v.jsxs(Zr,{direction:"row",alignItems:"center",spacing:1,sx:{mb:2},children:[v.jsx(tke,{sx:{color:"warning.main",fontSize:28}}),v.jsx(ct,{variant:"h6",fontWeight:600,children:"Notebook Dashboards"})]}),v.jsx(ct,{variant:"body2",color:"text.secondary",sx:{mb:2},children:"Create shareable, code-first dashboards using Malloy notebooks. Include text, charts, and reusable views — all versioned alongside your models."}),v.jsx(n0,{label:"Versioned",size:"small",color:"warning",variant:"outlined"})]})})}),v.jsx(Ar,{size:{xs:12,md:4},children:v.jsx(Sd,{variant:"outlined",onClick:()=>{window.open("https://github.com/malloydata/publisher/blob/main/README.md#mcp-based-ai-data-agents","_blank")},sx:{height:"100%",cursor:"pointer",transition:"all 0.2s ease","&:hover":{transform:"translateY(-2px)",boxShadow:2}},children:v.jsxs(Td,{sx:{p:3},children:[v.jsxs(Zr,{direction:"row",alignItems:"center",spacing:1,sx:{mb:2},children:[v.jsx(rke,{sx:{color:"success.main",fontSize:28}}),v.jsx(ct,{variant:"h6",fontWeight:600,children:"AI Data Agents"})]}),v.jsx(ct,{variant:"body2",color:"text.secondary",sx:{mb:2},children:"Expose your semantic models via the Model Context Protocol (MCP), enabling AI agents to discover sources and ask well-formed questions."}),v.jsx(n0,{label:"AI-Ready",size:"small",color:"success",variant:"outlined"})]})})})]}),v.jsx(Hi,{sx:{my:4}}),r.data.length>0?v.jsxs(v.Fragment,{children:[v.jsxs(It,{sx:{textAlign:"center",mb:4},children:[v.jsxs(Zr,{direction:"row",justifyContent:"center",alignItems:"center",spacing:1,sx:{mb:2},children:[v.jsx(E3,{sx:{color:"primary.main",fontSize:24}}),v.jsx(ct,{variant:"h4",fontWeight:600,children:"Select a Project"})]}),v.jsx(ct,{variant:"body1",color:"text.secondary",children:"Choose a project to explore its semantic models and start analyzing your data"}),n&&v.jsx(yke,{})]}),v.jsx(Ar,{container:!0,spacing:3,justifyContent:"center",children:r.data.map(l=>v.jsx(Ar,{size:{xs:12,sm:6,md:4},children:v.jsx(Eke,{project:l,onClickProject:e})},l.name))})]}):v.jsxs(It,{sx:{textAlign:"center",mb:4},children:[v.jsxs(Zr,{direction:"row",justifyContent:"center",alignItems:"center",spacing:1,sx:{mb:2},children:[v.jsx(E3,{sx:{color:"primary.main",fontSize:24}}),v.jsx(ct,{variant:"h4",fontWeight:600,children:"Get Started"})]}),v.jsx(ct,{variant:"body1",color:"text.secondary",sx:{mb:3},children:"No projects found. Create your first Malloy project to start exploring semantic models and building data experiences."}),v.jsx(ma,{variant:"contained",size:"large",color:"primary",startIcon:v.jsx(v3,{}),href:"https://github.com/malloydata/publisher/blob/main/README.md#server-configuration",target:"_blank",rel:"noopener noreferrer",children:"Learn How to Create Models"})]}),v.jsx(It,{sx:{textAlign:"center",mt:6,pt:4,borderTop:1,borderColor:"divider"},children:v.jsxs(ct,{variant:"body2",color:"text.secondary",children:["Publisher is built on fully open infrastructure and designed for the AI era. Join the"," ",v.jsx("a",{href:"https://join.slack.com/t/malloy-community/shared_invite/zt-1kgfwgi5g-CrsdaRqs81QY67QW0~t_uw",target:"_blank",rel:"noopener noreferrer",style:{color:"primary.main",textDecoration:"underline"},children:"Malloy Slack community"})," ","to ask questions, share ideas, and contribute to the future of data modeling."]})})]}):v.jsx(Ko,{text:"Loading projects..."})}function Eke({project:e,onClickProject:t}){const{mutable:n}=Zn(),[r,o]=A.useState(null),a=!!r,i=u=>{o(u.currentTarget)},l=()=>{o(null)};return v.jsx("div",{children:v.jsxs(Sd,{variant:"outlined",sx:{height:"100%",transition:"all 0.2s ease","&:hover":{transform:"translateY(-2px)",boxShadow:2,borderColor:"primary.main"}},children:[n&&v.jsxs(v.Fragment,{children:[v.jsx(ir,{"aria-controls":a?"project-menu":void 0,"aria-haspopup":"true","aria-expanded":a?"true":void 0,onClick:i,sx:{position:"absolute",top:8,right:8},children:v.jsx(a4,{fontSize:"small"})}),v.jsxs(Im,{id:"project-menu","aria-haspopup":"true","aria-expanded":a?"true":void 0,open:a,anchorEl:r,onClose:l,disableRestoreFocus:!0,anchorOrigin:{vertical:"top",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"right"},children:[v.jsx(vke,{project:e,onCloseDialog:l}),v.jsx(bke,{project:e,onCloseDialog:l})]})]}),v.jsxs(Td,{sx:{p:3,textAlign:"center"},children:[v.jsx(nke,{sx:{fontSize:48,color:"primary.main",mb:2}}),v.jsx(ct,{variant:"h6",fontWeight:600,gutterBottom:!0,children:e.name}),v.jsx(ct,{variant:"body2",color:"text.secondary",sx:{mb:2,minHeight:"60px"},children:Ej(e.readme)}),v.jsx(ma,{variant:"contained",color:"secondary",endIcon:v.jsx(eke,{}),fullWidth:!0,onClick:u=>t(`/${e.name}/`,u),children:"Open Project"})]})]})})}const xke=async e=>{if(typeof window>"u")throw new Error("MalloyRenderer can only be used in browser environment");const{MalloyRenderer:t}=await X(async()=>{const{MalloyRenderer:n}=await import("./index.umd-CUL-Q1Jn.js").then(r=>r.i);return{MalloyRenderer:n}},[]);return new t({onClick:e,onError:n=>{console.error("Error rendering visualization:",typeof n,n)}}).createViz()};function Ske({result:e,height:t,isFillElement:n,onSizeChange:r,onDrill:o}){const a=A.useRef(null),[i,l]=A.useState(!1);return A.useLayoutEffect(()=>{if(!a.current||!e)return;let u=!0;const d=a.current;for(;d.firstChild;)d.removeChild(d.firstChild);return xke(o).then(p=>{if(!u)return;const h=new MutationObserver(y=>{for(const g of y)if(g.type==="childList"&&g.addedNodes.length>0&&Array.from(g.addedNodes).some(b=>b.nodeType===Node.ELEMENT_NODE)){h.disconnect(),setTimeout(()=>{u&&l(!0)},50);break}});h.observe(d,{childList:!0,subtree:!0,characterData:!0});try{p.setResult(JSON.parse(e)),p.render(d)}catch(y){console.error("Error rendering visualization:",y),h.disconnect(),u&&l(!0)}}).catch(p=>{console.error("Failed to create renderer:",p),u&&l(!0)}),()=>{u=!1}},[e,o]),A.useEffect(()=>{if(!a.current||!i)return;const u=a.current,d=()=>{if(u){const y=u.offsetHeight;y>0?r&&r(y):n&&u.firstChild&&(u.firstChild.offsetHeight==0?n(!0):n(!1))}},p=setTimeout(d,100);let h=null;return h=new MutationObserver(d),h.observe(u,{childList:!0,subtree:!0,attributes:!0}),()=>{clearTimeout(p),h?.disconnect()}},[r,e,n,i]),v.jsx("div",{ref:a,style:{width:"100%",height:t?`${t}px`:"100%"}})}function Tke(e){return typeof window>"u"?v.jsx("div",{style:{width:"100%",height:e.height?`${e.height}px`:"100%",display:"flex",alignItems:"center",justifyContent:"center",color:"#666"},children:"Loading..."}):v.jsx(A.Suspense,{fallback:v.jsx("div",{style:{width:"100%",height:e.height?`${e.height}px`:"100%",display:"flex",alignItems:"center",justifyContent:"center",color:"#666"},children:"Loading visualization..."}),children:v.jsx(Ske,{...e})})}const Sj=Object.freeze(Object.defineProperty({__proto__:null,default:Tke},Symbol.toStringTag,{value:"Module"}));Pt.defaults.baseURL="IfYouAreSeeingThis_baseURL_IsNotSet";const dr={primary:{main:"#14b3cb",light:"#22d3ee",dark:"#0e7490",50:"#ecfeff",100:"#cffafe",500:"#14b3cb",600:"#0891b2",700:"#0e7490"},secondary:{main:"#fbbb04",light:"#fde047",dark:"#eab308",50:"#fefce8",100:"#fef3c7",500:"#fbbb04",600:"#eab308",700:"#ca8a04"},grey:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827"},success:{main:"#059669",light:"#10b981",dark:"#047857"},warning:{main:"#d97706",light:"#f59e0b",dark:"#b45309"},error:{main:"#dc2626",light:"#ef4444",dark:"#b91c1c"},info:{main:"#0891b2",light:"#06b6d4",dark:"#0e7490"}},Cke=Yb({palette:{mode:"light",primary:dr.primary,secondary:dr.secondary,grey:dr.grey,success:dr.success,warning:dr.warning,error:dr.error,info:dr.info,background:{default:"#ffffff",paper:"#ffffff"},text:{primary:dr.grey[900],secondary:dr.grey[600]},divider:dr.grey[200]},typography:{fontFamily:'"Inter", "Roboto", "Helvetica", "Arial", sans-serif',h1:{fontWeight:700,letterSpacing:"-0.025em"},h2:{fontWeight:700,letterSpacing:"-0.025em"},h3:{fontWeight:600,letterSpacing:"-0.025em"},h4:{fontWeight:600,letterSpacing:"-0.025em"},h5:{fontWeight:600,letterSpacing:"-0.025em"},h6:{fontWeight:600,letterSpacing:"-0.025em"},subtitle1:{fontWeight:500,letterSpacing:"-0.025em"},subtitle2:{fontWeight:500,letterSpacing:"-0.025em"},body1:{letterSpacing:"-0.025em"},body2:{letterSpacing:"-0.025em"},button:{fontWeight:500,letterSpacing:"-0.025em",textTransform:"none"}},shape:{borderRadius:4},components:{MuiCssBaseline:{styleOverrides:{body:{scrollbarWidth:"thin",scrollbarColor:`${dr.grey[300]} ${dr.grey[100]}`,"&::-webkit-scrollbar":{width:"8px",height:"8px"},"&::-webkit-scrollbar-track":{background:dr.grey[100],borderRadius:"4px"},"&::-webkit-scrollbar-thumb":{background:dr.grey[300],borderRadius:"4px","&:hover":{background:dr.grey[400]}},"&::-webkit-scrollbar-corner":{background:dr.grey[100]}},"*":{scrollbarWidth:"thin",scrollbarColor:`${dr.grey[300]} ${dr.grey[100]}`,"&::-webkit-scrollbar":{width:"8px",height:"8px"},"&::-webkit-scrollbar-track":{background:dr.grey[100],borderRadius:"4px"},"&::-webkit-scrollbar-thumb":{background:dr.grey[300],borderRadius:"4px","&:hover":{background:dr.grey[400]}},"&::-webkit-scrollbar-corner":{background:dr.grey[100]}},"div[data-radix-popper-content-wrapper]":{zIndex:"1300 !important"}}},MuiButton:{styleOverrides:{root:{borderRadius:4,textTransform:"none",fontWeight:500,boxShadow:"none","&:hover":{boxShadow:"0 1px 3px rgba(0, 0, 0, 0.1)"}},contained:{"&:hover":{boxShadow:"0 2px 4px rgba(0, 0, 0, 0.1)"}}}},MuiCard:{styleOverrides:{root:{borderRadius:4,boxShadow:"0 1px 3px rgba(0, 0, 0, 0.1)",border:"1px solid",borderColor:"rgba(0, 0, 0, 0.05)"}}},MuiChip:{styleOverrides:{root:{borderRadius:4,fontWeight:500}}},MuiTextField:{styleOverrides:{root:{"& .MuiOutlinedInput-root":{borderRadius:4}}}},MuiDialog:{styleOverrides:{paper:{borderRadius:4,boxShadow:"0px 20px 25px -5px rgba(0, 0, 0, 0.1), 0px 10px 10px -5px rgba(0, 0, 0, 0.04)"}}},MuiMenu:{styleOverrides:{paper:{borderRadius:4,boxShadow:"0px 10px 15px -3px rgba(0, 0, 0, 0.1), 0px 4px 6px -2px rgba(0, 0, 0, 0.05)",border:"1px solid rgba(0, 0, 0, 0.05)"}}},MuiBreadcrumbs:{styleOverrides:{root:{"& .MuiBreadcrumbs-separator":{margin:"0 6px",color:dr.grey[400]}}}},MuiDivider:{styleOverrides:{root:{margin:"4px 0",borderColor:dr.grey[200]}},defaultProps:{sx:{my:1}}}}}),Ake=A.lazy(()=>X(()=>import("./HomePage-DY-5y7-O.js"),[])),_ke=A.lazy(()=>X(()=>import("./MainPage-TMtFLxWp.js"),[])),kke=A.lazy(()=>X(()=>import("./ModelPage-Bo88gQsL.js"),[])),wke=A.lazy(()=>X(()=>import("./PackagePage-Cd3jRo6g.js"),[])),Rke=A.lazy(()=>X(()=>import("./ProjectPage-CDlHDzlk.js"),[])),Dke=A.lazy(()=>X(()=>import("./RouteError-D6xdH0VE.js"),[])),Ike=A.lazy(()=>X(()=>import("./WorkbookPage-im0REJvX.js"),[])),Oke=(e="/",t,n)=>Mz([{path:e,element:v.jsx(Jee,{children:v.jsx(sCe,{workbookStorage:t,children:v.jsxs(HG,{theme:Cke,children:[v.jsx(iK,{}),v.jsx(_ke,{headerProps:n})]})})}),errorElement:v.jsx(Dke,{}),children:[{path:"",element:v.jsx(Ake,{})},{path:":projectName",element:v.jsx(Rke,{})},{path:":projectName/:packageName",element:v.jsx(wke,{})},{path:":projectName/:packageName/*",element:v.jsx(kke,{})},{path:":projectName/:packageName/workbook/:workspace/:workbookPath",element:v.jsx(Ike,{})}]}]),Nke=Oke("/",new fCe,void 0);F9.createRoot(document.getElementById("root")).render(v.jsx(A.StrictMode,{children:v.jsx(Yz,{router:Nke})}));export{fwe as A,qc as B,n0 as C,Vfe as D,mwe as E,az as F,Lke as G,Qe as H,ir as I,Cl as J,Tm as K,ywe as L,Im as M,gwe as N,Fke as O,Ol as P,Pke as Q,A0 as R,Zr as S,ct as T,S3 as U,dCe as Y,hwe as _,va as a,wt as b,Ot as c,Nt as d,lt as e,Ve as f,lV as g,Rt as h,zo as i,v as j,Ki as k,QS as l,Ht as m,eM as n,Fi as o,Mke as p,It as q,A as r,Ne as s,$3 as t,JC as u,ql as v,$l as w,ma as x,tK as y,d_ as z};