@malloy-publisher/server 0.0.86 → 0.0.87
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app/assets/{RenderedResult-BAZuT25g-_eLjVkSo.js → RenderedResult-BAZuT25g-BMU632YI.js} +2 -2
- package/dist/app/assets/index-2xWCh-ya.css +1 -0
- package/dist/app/assets/{index-BvRGZn2o.js → index-BbW5TZg_.js} +211 -206
- package/dist/app/assets/{index-EI2L5apg.js → index-C7whj6wK.js} +3 -3
- package/dist/app/assets/index-CIfV3yj1.js +211 -0
- package/dist/app/assets/index.umd-x-naS8R7.js +2105 -0
- package/dist/app/index.html +2 -2
- package/package.json +1 -1
- package/dist/app/assets/index-C-lp8bCy.js +0 -210
- package/dist/app/assets/index-RMQQYOAi.css +0 -1
- package/dist/app/assets/index.umd-DBkg1U_t.js +0 -2078
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/angular-html-0fTdLuKf-C_Z-qPys.js","assets/html-B0P_v3yU-5FUQOWqS.js","assets/javascript-fa8UlHZE-ySlJ1b_l.js","assets/css-D1aVdRIU-BPhBrDlE.js","assets/angular-ts-wkniW60G-CLxf_aqD.js","assets/scss-DhHc4lxB-DOVe6m7U.js","assets/apl-TLDHFJX6-4Ja2pao0.js","assets/xml-ChBsf5uy-CRY5u_dA.js","assets/java-B7odJ7Ap-xI-RfyKK.js","assets/json-71t8ZF9g-BQoSv7ci.js","assets/astro-Uf8_VxKJ-CLNq6E27.js","assets/typescript-buWNZFwO-Dj6nwHGl.js","assets/postcss-BZ3MNRIJ-B3ZDOciz.js","assets/blade-BtR00Gx0-BH_u9bLw.js","assets/sql-DCkt643--COK4E0Yg.js","assets/bsl-BIXPNqL4-B7NuXuWJ.js","assets/sdbl-BBamrXFL-BLhTXw86.js","assets/cairo-tXZKA2PT-BLBT-6ii.js","assets/python-xYxLFJY--DhUJRlN_.js","assets/cobol-DMssKNmC-B2fukI-w.js","assets/coffee-D_GzM8k1-4lliG68M.js","assets/cpp-CJF2i3ah-pZOsOWe_.js","assets/regexp-GiFkbxS--DWJ3fJO_.js","assets/glsl-XLGYNq5B-BsoackK0.js","assets/c-DASdrs7p-C3t2pwGQ.js","assets/crystal-BKWnaU3g-DLUiimt9.js","assets/shellscript-Dn0-btNd-atvbtKCR.js","assets/edge-CgxR-qhM-C4-j-4jN.js","assets/html-derivative-D59SHfh8-CSkG6UyS.js","assets/elixir-DZkeSPwW-CcKXTVRL.js","assets/elm-BKuV1HE1-DhehEoOI.js","assets/erb-BLwkpXUJ-ChmaBI6f.js","assets/ruby-DcPLUUK3-ComHSJZD.js","assets/haml-CMN0hQaL-P2mc1-Uz.js","assets/graphql-DWpQF4JI-Bg_kbUNo.js","assets/jsx-Bkesy5tT-BAng5TT0.js","assets/tsx-DiGsgWT8-B6W0miNI.js","assets/lua-BVfhNLDr-CWJMHgTQ.js","assets/yaml-Bbg74JKr-CVw76BM1.js","assets/fortran-fixed-form-s9Hnb3av-DpX1AVnn.js","assets/fortran-free-form-CNDsBFUj-DKXYxT9g.js","assets/fsharp-Cv0x43wb-Dg8cqrY9.js","assets/markdown-B6guhLWd-UIAJJxZW.js","assets/gdresource-CMcKXvgJ-CWt23EK3.js","assets/gdshader-BGJEsM2Z-SKMF96pI.js","assets/gdscript-D7aheHm--DfxzS6Rs.js","assets/git-commit-BspYIY3P-n1pa9hpQ.js","assets/diff-XmNrvgM1-BgYniUM_.js","assets/git-rebase--zLBTjUa-D_BU2XLr.js","assets/glimmer-js-DhY9umHJ-VrvmblrN.js","assets/glimmer-ts-CCrHcYH5-JtH9P_df.js","assets/hack-CQrV-ytR-DsU69WFl.js","assets/handlebars-Cc-7fXX5-1wmMMko9.js","assets/http-Dcjm_K1m-BIoBBtFi.js","assets/hxml-BNKImryz-C86vEiUs.js","assets/haxe-CZZ33vZw-C5wWYbrZ.js","assets/imba-Drd0AMDo-ClNo5Aft.js","assets/jinja-CCSYduCH-DYrHgqe4.js","assets/jison-BygvlveW-CnxAXEK_.js","assets/julia-CiahampL-V7UYV-sq.js","assets/r-F-9I-ITZ-CwjWoCRV.js","assets/latex-LfGCYGw5-BH0TQ0ei.js","assets/tex-mHs7a43s-GNY7iZwJ.js","assets/liquid-CvufO3kO-CDc-Ahzk.js","assets/marko-CHlMS8w5-BMD3FaEa.js","assets/less-DQA4v-Nm-BfCpw3nA.js","assets/mdc-4K6B6lHG-BAGHtNo-.js","assets/nginx-Can2eAjw-CdY2tLiv.js","assets/nim-B3r2RtQZ-VfCbv_TB.js","assets/perl-DaMQyPwp-C4BFOiY3.js","assets/php-BL3EfPBi-BMN5eA9q.js","assets/pug-HKe4Luo3-BjTLA0bL.js","assets/qml-FlMIyjU9-DSnJ_WBo.js","assets/razor-CeqqNtyB-CTLKKD1r.js","assets/csharp-CYWRhZ2R-D9R-vmeu.js","assets/rst-C3D6-dqL-DnZbUBhI.js","assets/cmake-Dr-A3iJx-DbXoA79R.js","assets/sas-tDSYjXcL-BoaRjvJ1.js","assets/shaderlab-CvqEIoL0-D4Zbm5h2.js","assets/hlsl-3-lv4gi7-ifBTmRxC.js","assets/shellsession-8OLo3sB6-BcsC7Rtk.js","assets/soy-EwHMOVPj-g2bfMTqc.js","assets/sparql-DhuelBut-DSDXMn9h.js","assets/turtle-BJ2wmjPc-BMR_PYu6.js","assets/stata-Dok6hMw0-Dx5Z5W33.js","assets/svelte-01qw6Rxm-BPq1Epw_.js","assets/templ-Hmy8U0DD-bZJvPZVc.js","assets/go-BErP6iv1-B1SYOhNW.js","assets/ts-tags-DYZ4SGcN-DHCrqCAy.js","assets/twig-BmytkGQV-gxvDbPvi.js","assets/vue-Bl1uVNsA-B0HO5ROf.js","assets/vue-html-DHr5wjBG-BZddcMPi.js","assets/xsl-BefjlXrd-kO2fudRX.js","assets/index-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/angular-html-0fTdLuKf-C_Z-qPys.js","assets/html-B0P_v3yU-5FUQOWqS.js","assets/javascript-fa8UlHZE-ySlJ1b_l.js","assets/css-D1aVdRIU-BPhBrDlE.js","assets/angular-ts-wkniW60G-CLxf_aqD.js","assets/scss-DhHc4lxB-DOVe6m7U.js","assets/apl-TLDHFJX6-4Ja2pao0.js","assets/xml-ChBsf5uy-CRY5u_dA.js","assets/java-B7odJ7Ap-xI-RfyKK.js","assets/json-71t8ZF9g-BQoSv7ci.js","assets/astro-Uf8_VxKJ-CLNq6E27.js","assets/typescript-buWNZFwO-Dj6nwHGl.js","assets/postcss-BZ3MNRIJ-B3ZDOciz.js","assets/blade-BtR00Gx0-BH_u9bLw.js","assets/sql-DCkt643--COK4E0Yg.js","assets/bsl-BIXPNqL4-B7NuXuWJ.js","assets/sdbl-BBamrXFL-BLhTXw86.js","assets/cairo-tXZKA2PT-BLBT-6ii.js","assets/python-xYxLFJY--DhUJRlN_.js","assets/cobol-DMssKNmC-B2fukI-w.js","assets/coffee-D_GzM8k1-4lliG68M.js","assets/cpp-CJF2i3ah-pZOsOWe_.js","assets/regexp-GiFkbxS--DWJ3fJO_.js","assets/glsl-XLGYNq5B-BsoackK0.js","assets/c-DASdrs7p-C3t2pwGQ.js","assets/crystal-BKWnaU3g-DLUiimt9.js","assets/shellscript-Dn0-btNd-atvbtKCR.js","assets/edge-CgxR-qhM-C4-j-4jN.js","assets/html-derivative-D59SHfh8-CSkG6UyS.js","assets/elixir-DZkeSPwW-CcKXTVRL.js","assets/elm-BKuV1HE1-DhehEoOI.js","assets/erb-BLwkpXUJ-ChmaBI6f.js","assets/ruby-DcPLUUK3-ComHSJZD.js","assets/haml-CMN0hQaL-P2mc1-Uz.js","assets/graphql-DWpQF4JI-Bg_kbUNo.js","assets/jsx-Bkesy5tT-BAng5TT0.js","assets/tsx-DiGsgWT8-B6W0miNI.js","assets/lua-BVfhNLDr-CWJMHgTQ.js","assets/yaml-Bbg74JKr-CVw76BM1.js","assets/fortran-fixed-form-s9Hnb3av-DpX1AVnn.js","assets/fortran-free-form-CNDsBFUj-DKXYxT9g.js","assets/fsharp-Cv0x43wb-Dg8cqrY9.js","assets/markdown-B6guhLWd-UIAJJxZW.js","assets/gdresource-CMcKXvgJ-CWt23EK3.js","assets/gdshader-BGJEsM2Z-SKMF96pI.js","assets/gdscript-D7aheHm--DfxzS6Rs.js","assets/git-commit-BspYIY3P-n1pa9hpQ.js","assets/diff-XmNrvgM1-BgYniUM_.js","assets/git-rebase--zLBTjUa-D_BU2XLr.js","assets/glimmer-js-DhY9umHJ-VrvmblrN.js","assets/glimmer-ts-CCrHcYH5-JtH9P_df.js","assets/hack-CQrV-ytR-DsU69WFl.js","assets/handlebars-Cc-7fXX5-1wmMMko9.js","assets/http-Dcjm_K1m-BIoBBtFi.js","assets/hxml-BNKImryz-C86vEiUs.js","assets/haxe-CZZ33vZw-C5wWYbrZ.js","assets/imba-Drd0AMDo-ClNo5Aft.js","assets/jinja-CCSYduCH-DYrHgqe4.js","assets/jison-BygvlveW-CnxAXEK_.js","assets/julia-CiahampL-V7UYV-sq.js","assets/r-F-9I-ITZ-CwjWoCRV.js","assets/latex-LfGCYGw5-BH0TQ0ei.js","assets/tex-mHs7a43s-GNY7iZwJ.js","assets/liquid-CvufO3kO-CDc-Ahzk.js","assets/marko-CHlMS8w5-BMD3FaEa.js","assets/less-DQA4v-Nm-BfCpw3nA.js","assets/mdc-4K6B6lHG-BAGHtNo-.js","assets/nginx-Can2eAjw-CdY2tLiv.js","assets/nim-B3r2RtQZ-VfCbv_TB.js","assets/perl-DaMQyPwp-C4BFOiY3.js","assets/php-BL3EfPBi-BMN5eA9q.js","assets/pug-HKe4Luo3-BjTLA0bL.js","assets/qml-FlMIyjU9-DSnJ_WBo.js","assets/razor-CeqqNtyB-CTLKKD1r.js","assets/csharp-CYWRhZ2R-D9R-vmeu.js","assets/rst-C3D6-dqL-DnZbUBhI.js","assets/cmake-Dr-A3iJx-DbXoA79R.js","assets/sas-tDSYjXcL-BoaRjvJ1.js","assets/shaderlab-CvqEIoL0-D4Zbm5h2.js","assets/hlsl-3-lv4gi7-ifBTmRxC.js","assets/shellsession-8OLo3sB6-BcsC7Rtk.js","assets/soy-EwHMOVPj-g2bfMTqc.js","assets/sparql-DhuelBut-DSDXMn9h.js","assets/turtle-BJ2wmjPc-BMR_PYu6.js","assets/stata-Dok6hMw0-Dx5Z5W33.js","assets/svelte-01qw6Rxm-BPq1Epw_.js","assets/templ-Hmy8U0DD-bZJvPZVc.js","assets/go-BErP6iv1-B1SYOhNW.js","assets/ts-tags-DYZ4SGcN-DHCrqCAy.js","assets/twig-BmytkGQV-gxvDbPvi.js","assets/vue-Bl1uVNsA-B0HO5ROf.js","assets/vue-html-DHr5wjBG-BZddcMPi.js","assets/xsl-BefjlXrd-kO2fudRX.js","assets/index-CIfV3yj1.js","assets/index-BbW5TZg_.js","assets/index.umd-x-naS8R7.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
function OF(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 s of a.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).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 UEe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function LN(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var O1={exports:{}},xf={};/**
|
|
3
3
|
* @license React
|
|
4
4
|
* react-jsx-runtime.production.js
|
|
@@ -263,7 +263,7 @@ export default theme;`}function eT(e={},...t){const{breakpoints:n,mixins:r={},sp
|
|
|
263
263
|
\f\r "&'<=>\``.split("")],[`\0
|
|
264
264
|
\f\r "&'<=>\``.split(""),`\0
|
|
265
265
|
\f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function vae(e,t,n,r){const o=r.schema,a=o.space==="svg"?!1:r.settings.omitOptionalTags;let s=o.space==="svg"?r.settings.closeEmptyElements:r.settings.voids.includes(e.tagName.toLowerCase());const l=[];let u;o.space==="html"&&e.tagName==="svg"&&(r.schema=as);const d=Eae(r,e.properties),p=r.all(o.space==="html"&&e.tagName==="template"?e.content:e);return r.schema=o,p&&(s=!1),(d||!a||!pae(e,t,n))&&(l.push("<",e.tagName,d?" "+d:""),s&&(o.space==="svg"||r.settings.closeSelfClosing)&&(u=d.charAt(d.length-1),(!r.settings.tightSelfClosing||u==="/"||u&&u!=='"'&&u!=="'")&&l.push(" "),l.push("/")),l.push(">")),l.push(p),!s&&(!a||!CC(e,t,n))&&l.push("</"+e.tagName+">"),l.join("")}function Eae(e,t){const n=[];let r=-1,o;if(t){for(o in t)if(t[o]!==null&&t[o]!==void 0){const a=xae(e,o,t[o]);a&&n.push(a)}}for(;++r<n.length;){const a=e.settings.tightAttributes?n[r].charAt(n[r].length-1):void 0;r!==n.length-1&&a!=='"'&&a!=="'"&&(n[r]+=" ")}return n.join("")}function xae(e,t,n){const r=Hh(e.schema,t),o=e.settings.allowParseErrors&&e.schema.space==="html"?0:1,a=e.settings.allowDangerousCharacters?0:1;let s=e.quote,l;if(r.overloadedBoolean&&(n===r.attribute||n==="")?n=!0:(r.boolean||r.overloadedBoolean)&&(typeof n!="string"||n===r.attribute||n==="")&&(n=!!n),n==null||n===!1||typeof n=="number"&&Number.isNaN(n))return"";const u=Nu(r.attribute,Object.assign({},e.settings.characterReferences,{subset:Cg.name[o][a]}));return n===!0||(n=Array.isArray(n)?(r.commaSeparated?db:fb)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?u:(e.settings.preferUnquoted&&(l=Nu(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:Cg.unquoted[o][a]}))),l!==n&&(e.settings.quoteSmart&&$y(n,s)>$y(n,e.alternative)&&(s=e.alternative),l=s+Nu(n,Object.assign({},e.settings.characterReferences,{subset:(s==="'"?Cg.single:Cg.double)[o][a],attribute:!0}))+s),u+(l&&"="+l))}const Tae=["<","&"];function oL(e,t,n,r){return n&&n.type==="element"&&(n.tagName==="script"||n.tagName==="style")?e.value:Nu(e.value,Object.assign({},r.settings.characterReferences,{subset:Tae}))}function Sae(e,t,n,r){return r.settings.allowDangerousHtml?e.value:oL(e,t,n,r)}function Cae(e,t,n,r){return r.all(e)}const _ae=ub("type",{invalid:Aae,unknown:kae,handlers:{comment:Qoe,doctype:Xoe,element:vae,raw:Sae,root:Cae,text:oL}});function Aae(e){throw new Error("Expected node, not `"+e+"`")}function kae(e){const t=e;throw new Error("Cannot compile unknown node `"+t.type+"`")}const wae={},Dae={},Rae=[];function Iae(e,t){const n=wae,r=n.quote||'"',o=r==='"'?"'":'"';if(r!=='"'&&r!=="'")throw new Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:Oae,all:Nae,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||G4,characterReferences:n.characterReferences||Dae,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?as:gd,quote:r,alternative:o}.one(Array.isArray(e)?{type:"root",children:e}:e,void 0,void 0)}function Oae(e,t,n){return _ae(e,t,n,this)}function Nae(e){const t=[],n=e&&e.children||Rae;let r=-1;for(;++r<n.length;)t[r]=this.one(n[r],r,e);return t.join("")}function Pae(e){return Array.isArray(e)?e:[e]}function pb(e,t=!1){const n=e.split(/(\r?\n)/g);let r=0;const o=[];for(let a=0;a<n.length;a+=2){const s=t?n[a]+(n[a+1]||""):n[a];o.push([s,r]),r+=n[a].length,r+=n[a+1]?.length||0}return o}function _C(e){return!e||["plaintext","txt","text","plain"].includes(e)}function aL(e){return e==="ansi"||_C(e)}function AC(e){return e==="none"}function iL(e){return AC(e)}function sL(e,t){if(!t)return e;e.properties||={},e.properties.class||=[],typeof e.properties.class=="string"&&(e.properties.class=e.properties.class.split(/\s+/g)),Array.isArray(e.properties.class)||(e.properties.class=[]);const n=Array.isArray(t)?t:t.split(/\s+/g);for(const r of n)r&&!e.properties.class.includes(r)&&e.properties.class.push(r);return e}function Lae(e,t){let n=0;const r=[];for(const o of t)o>n&&r.push({...e,content:e.content.slice(n,o),offset:e.offset+n}),n=o;return n<e.content.length&&r.push({...e,content:e.content.slice(n),offset:e.offset+n}),r}function Mae(e,t){const n=Array.from(t instanceof Set?t:new Set(t)).sort((r,o)=>r-o);return n.length?e.map(r=>r.flatMap(o=>{const a=n.filter(s=>o.offset<s&&s<o.offset+o.content.length).map(s=>s-o.offset).sort((s,l)=>s-l);return a.length?Lae(o,a):o})):e}async function lL(e){return Promise.resolve(typeof e=="function"?e():e).then(t=>t.default||t)}function Vy(e,t){const n=typeof e=="string"?{}:{...e.colorReplacements},r=typeof e=="string"?e:e.name;for(const[o,a]of Object.entries(t?.colorReplacements||{}))typeof a=="string"?n[o]=a:o===r&&Object.assign(n,a);return n}function jl(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function cL(e){const t={};return e.color&&(t.color=e.color),e.bgColor&&(t["background-color"]=e.bgColor),e.fontStyle&&(e.fontStyle&Qi.Italic&&(t["font-style"]="italic"),e.fontStyle&Qi.Bold&&(t["font-weight"]="bold"),e.fontStyle&Qi.Underline&&(t["text-decoration"]="underline")),t}function Fae(e){return typeof e=="string"?e:Object.entries(e).map(([t,n])=>`${t}:${n}`).join(";")}function Bae(e){const t=pb(e,!0).map(([o])=>o);function n(o){if(o===e.length)return{line:t.length-1,character:t[t.length-1].length};let a=o,s=0;for(const l of t){if(a<l.length)break;a-=l.length,s++}return{line:s,character:a}}function r(o,a){let s=0;for(let l=0;l<o;l++)s+=t[l].length;return s+=a,s}return{lines:t,indexToPos:n,posToIndex:r}}class ao extends Error{constructor(t){super(t),this.name="ShikiError"}}const uL=new WeakMap;function hb(e,t){uL.set(e,t)}function ch(e){return uL.get(e)}class yd{_stacks={};lang;get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(t,n){return new yd(Object.fromEntries(Pae(n).map(r=>[r,lT])),t)}constructor(...t){if(t.length===2){const[n,r]=t;this.lang=r,this._stacks=n}else{const[n,r,o]=t;this.lang=r,this._stacks={[o]:n}}}getInternalStack(t=this.theme){return this._stacks[t]}get scopes(){return jI(this._stacks[this.theme])}getScopes(t=this.theme){return jI(this._stacks[t])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.scopes}}}function jI(e){const t=[],n=new Set;function r(o){if(n.has(o))return;n.add(o);const a=o?.nameScopesList?.scopeName;a&&t.push(a),o.parent&&r(o.parent)}return r(e),t}function jae(e,t){if(!(e instanceof yd))throw new ao("Invalid grammar state");return e.getInternalStack(t)}function Uae(){const e=new WeakMap;function t(n){if(!e.has(n.meta)){let r=function(s){if(typeof s=="number"){if(s<0||s>n.source.length)throw new ao(`Invalid decoration offset: ${s}. Code length: ${n.source.length}`);return{...o.indexToPos(s),offset:s}}else{const l=o.lines[s.line];if(l===void 0)throw new ao(`Invalid decoration position ${JSON.stringify(s)}. Lines length: ${o.lines.length}`);if(s.character<0||s.character>l.length)throw new ao(`Invalid decoration position ${JSON.stringify(s)}. Line ${s.line} length: ${l.length}`);return{...s,offset:o.posToIndex(s.line,s.character)}}};const o=Bae(n.source),a=(n.options.decorations||[]).map(s=>({...s,start:r(s.start),end:r(s.end)}));Hae(a),e.set(n.meta,{decorations:a,converter:o,source:n.source})}return e.get(n.meta)}return{name:"shiki:decorations",tokens(n){if(!this.options.decorations?.length)return;const r=t(this).decorations.flatMap(o=>[o.start.offset,o.end.offset]);return Mae(n,r)},code(n){if(!this.options.decorations?.length)return;const r=t(this),o=Array.from(n.children).filter(p=>p.type==="element"&&p.tagName==="span");if(o.length!==r.converter.lines.length)throw new ao(`Number of lines in code element (${o.length}) does not match the number of lines in the source (${r.converter.lines.length}). Failed to apply decorations.`);function a(p,h,g,y){const b=o[p];let x="",S=-1,T=-1;if(h===0&&(S=0),g===0&&(T=0),g===Number.POSITIVE_INFINITY&&(T=b.children.length),S===-1||T===-1)for(let w=0;w<b.children.length;w++)x+=dL(b.children[w]),S===-1&&x.length===h&&(S=w+1),T===-1&&x.length===g&&(T=w+1);if(S===-1)throw new ao(`Failed to find start index for decoration ${JSON.stringify(y.start)}`);if(T===-1)throw new ao(`Failed to find end index for decoration ${JSON.stringify(y.end)}`);const D=b.children.slice(S,T);if(!y.alwaysWrap&&D.length===b.children.length)l(b,y,"line");else if(!y.alwaysWrap&&D.length===1&&D[0].type==="element")l(D[0],y,"token");else{const w={type:"element",tagName:"span",properties:{},children:D};l(w,y,"wrapper"),b.children.splice(S,D.length,w)}}function s(p,h){o[p]=l(o[p],h,"line")}function l(p,h,g){const y=h.properties||{},b=h.transform||(x=>x);return p.tagName=h.tagName||"span",p.properties={...p.properties,...y,class:p.properties.class},h.properties?.class&&sL(p,h.properties.class),p=b(p,g)||p,p}const u=[],d=r.decorations.sort((p,h)=>h.start.offset-p.start.offset);for(const p of d){const{start:h,end:g}=p;if(h.line===g.line)a(h.line,h.character,g.character,p);else if(h.line<g.line){a(h.line,h.character,Number.POSITIVE_INFINITY,p);for(let y=h.line+1;y<g.line;y++)u.unshift(()=>s(y,p));a(g.line,0,g.character,p)}}u.forEach(p=>p())}}}function Hae(e){for(let t=0;t<e.length;t++){const n=e[t];if(n.start.offset>n.end.offset)throw new ao(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let r=t+1;r<e.length;r++){const o=e[r],a=n.start.offset<o.start.offset&&o.start.offset<n.end.offset,s=n.start.offset<o.end.offset&&o.end.offset<n.end.offset,l=o.start.offset<n.start.offset&&n.start.offset<o.end.offset,u=o.start.offset<n.end.offset&&n.end.offset<o.end.offset;if(a||s||l||u){if(s&&s||l&&u)continue;throw new ao(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(o.start)} intersect.`)}}}}function dL(e){return e.type==="text"?e.value:e.type==="element"?e.children.map(dL).join(""):""}const zae=[Uae()];function Gy(e){return[...e.transformers||[],...zae]}var Ul=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],wE={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",9:"strikethrough"};function $ae(e,t){const n=e.indexOf("\x1B[",t);if(n!==-1){const r=e.indexOf("m",n);return{sequence:e.substring(n+2,r).split(";"),startPosition:n,position:r+1}}return{position:e.length}}function UI(e,t){let n=1;const r=e[t+n++];let o;if(r==="2"){const a=[e[t+n++],e[t+n++],e[t+n]].map(s=>Number.parseInt(s));a.length===3&&!a.some(s=>Number.isNaN(s))&&(o={type:"rgb",rgb:a})}else if(r==="5"){const a=Number.parseInt(e[t+n]);Number.isNaN(a)||(o={type:"table",index:Number(a)})}return[n,o]}function Vae(e){const t=[];for(let n=0;n<e.length;n++){const r=e[n],o=Number.parseInt(r);if(!Number.isNaN(o))if(o===0)t.push({type:"resetAll"});else if(o<=9)wE[o]&&t.push({type:"setDecoration",value:wE[o]});else if(o<=29){const a=wE[o-20];a&&t.push({type:"resetDecoration",value:a})}else if(o<=37)t.push({type:"setForegroundColor",value:{type:"named",name:Ul[o-30]}});else if(o===38){const[a,s]=UI(e,n);s&&t.push({type:"setForegroundColor",value:s}),n+=a}else if(o===39)t.push({type:"resetForegroundColor"});else if(o<=47)t.push({type:"setBackgroundColor",value:{type:"named",name:Ul[o-40]}});else if(o===48){const[a,s]=UI(e,n);s&&t.push({type:"setBackgroundColor",value:s}),n+=a}else o===49?t.push({type:"resetBackgroundColor"}):o>=90&&o<=97?t.push({type:"setForegroundColor",value:{type:"named",name:Ul[o-90+8]}}):o>=100&&o<=107&&t.push({type:"setBackgroundColor",value:{type:"named",name:Ul[o-100+8]}})}return t}function Gae(){let e=null,t=null,n=new Set;return{parse(r){const o=[];let a=0;do{const s=$ae(r,a),l=s.sequence?r.substring(a,s.startPosition):r.substring(a);if(l.length>0&&o.push({value:l,foreground:e,background:t,decorations:new Set(n)}),s.sequence){const u=Vae(s.sequence);for(const d of u)d.type==="resetAll"?(e=null,t=null,n.clear()):d.type==="resetForegroundColor"?e=null:d.type==="resetBackgroundColor"?t=null:d.type==="resetDecoration"&&n.delete(d.value);for(const d of u)d.type==="setForegroundColor"?e=d.value:d.type==="setBackgroundColor"?t=d.value:d.type==="setDecoration"&&n.add(d.value)}a=s.position}while(a<r.length);return o}}}var qae={black:"#000000",red:"#bb0000",green:"#00bb00",yellow:"#bbbb00",blue:"#0000bb",magenta:"#ff00ff",cyan:"#00bbbb",white:"#eeeeee",brightBlack:"#555555",brightRed:"#ff5555",brightGreen:"#00ff00",brightYellow:"#ffff55",brightBlue:"#5555ff",brightMagenta:"#ff55ff",brightCyan:"#55ffff",brightWhite:"#ffffff"};function Wae(e=qae){function t(l){return e[l]}function n(l){return`#${l.map(u=>Math.max(0,Math.min(u,255)).toString(16).padStart(2,"0")).join("")}`}let r;function o(){if(r)return r;r=[];for(let d=0;d<Ul.length;d++)r.push(t(Ul[d]));let l=[0,95,135,175,215,255];for(let d=0;d<6;d++)for(let p=0;p<6;p++)for(let h=0;h<6;h++)r.push(n([l[d],l[p],l[h]]));let u=8;for(let d=0;d<24;d++,u+=10)r.push(n([u,u,u]));return r}function a(l){return o()[l]}function s(l){switch(l.type){case"named":return t(l.name);case"rgb":return n(l.rgb);case"table":return a(l.index)}}return{value:s}}function Yae(e,t,n){const r=Vy(e,n),o=pb(t),a=Wae(Object.fromEntries(Ul.map(l=>[l,e.colors?.[`terminal.ansi${l[0].toUpperCase()}${l.substring(1)}`]]))),s=Gae();return o.map(l=>s.parse(l[0]).map(u=>{let d,p;u.decorations.has("reverse")?(d=u.background?a.value(u.background):e.bg,p=u.foreground?a.value(u.foreground):e.fg):(d=u.foreground?a.value(u.foreground):e.fg,p=u.background?a.value(u.background):void 0),d=jl(d,r),p=jl(p,r),u.decorations.has("dim")&&(d=Kae(d));let h=Qi.None;return u.decorations.has("bold")&&(h|=Qi.Bold),u.decorations.has("italic")&&(h|=Qi.Italic),u.decorations.has("underline")&&(h|=Qi.Underline),{content:u.value,offset:l[1],color:d,bgColor:p,fontStyle:h}}))}function Kae(e){const t=e.match(/#([0-9a-f]{3})([0-9a-f]{3})?([0-9a-f]{2})?/);if(t)if(t[3]){const r=Math.round(Number.parseInt(t[3],16)/2).toString(16).padStart(2,"0");return`#${t[1]}${t[2]}${r}`}else return t[2]?`#${t[1]}${t[2]}80`:`#${Array.from(t[1]).map(r=>`${r}${r}`).join("")}80`;const n=e.match(/var\((--[\w-]+-ansi-[\w-]+)\)/);return n?`var(${n[1]}-dim)`:e}function kC(e,t,n={}){const{lang:r="text",theme:o=e.getLoadedThemes()[0]}=n;if(_C(r)||AC(o))return pb(t).map(u=>[{content:u[0],offset:u[1]}]);const{theme:a,colorMap:s}=e.setTheme(o);if(r==="ansi")return Yae(a,t,n);const l=e.getLanguage(r);if(n.grammarState){if(n.grammarState.lang!==l.name)throw new ts(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${l.name}"`);if(!n.grammarState.themes.includes(a.name))throw new ts(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${a.name}"`)}return Xae(t,l,a,s,n)}function Qae(...e){if(e.length===2)return ch(e[1]);const[t,n,r={}]=e,{lang:o="text",theme:a=t.getLoadedThemes()[0]}=r;if(_C(o)||AC(a))throw new ts("Plain language does not have grammar state");if(o==="ansi")throw new ts("ANSI language does not have grammar state");const{theme:s,colorMap:l}=t.setTheme(a),u=t.getLanguage(o);return new yd(qy(n,u,s,l,r).stateStack,u.name,s.name)}function Xae(e,t,n,r,o){const a=qy(e,t,n,r,o),s=new yd(qy(e,t,n,r,o).stateStack,t.name,n.name);return hb(a.tokens,s),a.tokens}function qy(e,t,n,r,o){const a=Vy(n,o),{tokenizeMaxLineLength:s=0,tokenizeTimeLimit:l=500}=o,u=pb(e);let d=o.grammarState?jae(o.grammarState,n.name)??lT:o.grammarContextCode!=null?qy(o.grammarContextCode,t,n,r,{...o,grammarState:void 0,grammarContextCode:void 0}).stateStack:lT,p=[];const h=[];for(let g=0,y=u.length;g<y;g++){const[b,x]=u[g];if(b===""){p=[],h.push([]);continue}if(s>0&&b.length>=s){p=[],h.push([{content:b,offset:x,color:"",fontStyle:0}]);continue}let S,T,D;o.includeExplanation&&(S=t.tokenizeLine(b,d),T=S.tokens,D=0);const w=t.tokenizeLine2(b,d,l),R=w.tokens.length/2;for(let I=0;I<R;I++){const O=w.tokens[2*I],F=I+1<R?w.tokens[2*I+2]:b.length;if(O===F)continue;const j=w.tokens[2*I+1],H=jl(r[Qu.getForeground(j)],a),C=Qu.getFontStyle(j),M={content:b.substring(O,F),offset:x+O,color:H,fontStyle:C};if(o.includeExplanation){const $=[];if(o.includeExplanation!=="scopeName")for(const q of n.settings){let Y;switch(typeof q.scope){case"string":Y=q.scope.split(/,/).map(B=>B.trim());break;case"object":Y=q.scope;break;default:continue}$.push({settings:q,selectors:Y.map(B=>B.split(/ /))})}M.explanation=[];let z=0;for(;O+z<F;){const q=T[D],Y=b.substring(q.startIndex,q.endIndex);z+=Y.length,M.explanation.push({content:Y,scopes:o.includeExplanation==="scopeName"?Zae(q.scopes):Jae($,q.scopes)}),D+=1}}p.push(M)}h.push(p),p=[],d=w.ruleStack}return{tokens:h,stateStack:d}}function Zae(e){return e.map(t=>({scopeName:t}))}function Jae(e,t){const n=[];for(let r=0,o=t.length;r<o;r++){const a=t[r];n[r]={scopeName:a,themeMatches:tie(e,a,t.slice(0,r))}}return n}function HI(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]==="."}function eie(e,t,n){if(!HI(e[e.length-1],t))return!1;let r=e.length-2,o=n.length-1;for(;r>=0&&o>=0;)HI(e[r],n[o])&&(r-=1),o-=1;return r===-1}function tie(e,t,n){const r=[];for(const{selectors:o,settings:a}of e)for(const s of o)if(eie(s,t,n)){r.push(a);break}return r}function fL(e,t,n){const r=Object.entries(n.themes).filter(u=>u[1]).map(u=>({color:u[0],theme:u[1]})),o=r.map(u=>{const d=kC(e,t,{...n,theme:u.theme}),p=ch(d),h=typeof u.theme=="string"?u.theme:u.theme.name;return{tokens:d,state:p,theme:h}}),a=nie(...o.map(u=>u.tokens)),s=a[0].map((u,d)=>u.map((p,h)=>{const g={content:p.content,variants:{},offset:p.offset};return"includeExplanation"in n&&n.includeExplanation&&(g.explanation=p.explanation),a.forEach((y,b)=>{const{content:x,explanation:S,offset:T,...D}=y[d][h];g.variants[r[b].color]=D}),g})),l=o[0].state?new yd(Object.fromEntries(o.map(u=>[u.theme,u.state?.getInternalStack(u.theme)])),o[0].state.lang):void 0;return l&&hb(s,l),s}function nie(...e){const t=e.map(()=>[]),n=e.length;for(let r=0;r<e[0].length;r++){const o=e.map(u=>u[r]),a=t.map(()=>[]);t.forEach((u,d)=>u.push(a[d]));const s=o.map(()=>0),l=o.map(u=>u[0]);for(;l.every(u=>u);){const u=Math.min(...l.map(d=>d.content.length));for(let d=0;d<n;d++){const p=l[d];p.content.length===u?(a[d].push(p),s[d]+=1,l[d]=o[d][s[d]]):(a[d].push({...p,content:p.content.slice(0,u)}),l[d]={...p,content:p.content.slice(u),offset:p.offset+u})}}}return t}function Wy(e,t,n){let r,o,a,s,l,u;if("themes"in n){const{defaultColor:d="light",cssVariablePrefix:p="--shiki-"}=n,h=Object.entries(n.themes).filter(S=>S[1]).map(S=>({color:S[0],theme:S[1]})).sort((S,T)=>S.color===d?-1:T.color===d?1:0);if(h.length===0)throw new ts("`themes` option must not be empty");const g=fL(e,t,n);if(u=ch(g),d&&!h.find(S=>S.color===d))throw new ts(`\`themes\` option must contain the defaultColor key \`${d}\``);const y=h.map(S=>e.getTheme(S.theme)),b=h.map(S=>S.color);a=g.map(S=>S.map(T=>rie(T,b,p,d))),u&&hb(a,u);const x=h.map(S=>Vy(S.theme,n));o=h.map((S,T)=>(T===0&&d?"":`${p+S.color}:`)+(jl(y[T].fg,x[T])||"inherit")).join(";"),r=h.map((S,T)=>(T===0&&d?"":`${p+S.color}-bg:`)+(jl(y[T].bg,x[T])||"inherit")).join(";"),s=`shiki-themes ${y.map(S=>S.name).join(" ")}`,l=d?void 0:[o,r].join(";")}else if("theme"in n){const d=Vy(n.theme,n);a=kC(e,t,n);const p=e.getTheme(n.theme);r=jl(p.bg,d),o=jl(p.fg,d),s=p.name,u=ch(a)}else throw new ts("Invalid options, either `theme` or `themes` must be provided");return{tokens:a,fg:o,bg:r,themeName:s,rootStyle:l,grammarState:u}}function rie(e,t,n,r){const o={content:e.content,explanation:e.explanation,offset:e.offset},a=t.map(u=>cL(e.variants[u])),s=new Set(a.flatMap(u=>Object.keys(u))),l={};return a.forEach((u,d)=>{for(const p of s){const h=u[p]||"inherit";if(d===0&&r)l[p]=h;else{const g=p==="color"?"":p==="background-color"?"-bg":`-${p}`,y=n+t[d]+(p==="color"?"":g);l[y]=h}}}),o.htmlStyle=l,o}function Yy(e,t,n,r={meta:{},options:n,codeToHast:(o,a)=>Yy(e,o,a),codeToTokens:(o,a)=>Wy(e,o,a)}){let o=t;for(const y of Gy(n))o=y.preprocess?.call(r,o,n)||o;let{tokens:a,fg:s,bg:l,themeName:u,rootStyle:d,grammarState:p}=Wy(e,o,n);const{mergeWhitespaces:h=!0}=n;h===!0?a=aie(a):h==="never"&&(a=iie(a));const g={...r,get source(){return o}};for(const y of Gy(n))a=y.tokens?.call(g,a)||a;return oie(a,{...n,fg:s,bg:l,themeName:u,rootStyle:d},g,p)}function oie(e,t,n,r=ch(e)){const o=Gy(t),a=[],s={type:"root",children:[]},{structure:l="classic",tabindex:u="0"}=t;let d={type:"element",tagName:"pre",properties:{class:`shiki ${t.themeName||""}`,style:t.rootStyle||`background-color:${t.bg};color:${t.fg}`,...u!==!1&&u!=null?{tabindex:u.toString()}:{},...Object.fromEntries(Array.from(Object.entries(t.meta||{})).filter(([b])=>!b.startsWith("_")))},children:[]},p={type:"element",tagName:"code",properties:{},children:a};const h=[],g={...n,structure:l,addClassToHast:sL,get source(){return n.source},get tokens(){return e},get options(){return t},get root(){return s},get pre(){return d},get code(){return p},get lines(){return h}};if(e.forEach((b,x)=>{x&&(l==="inline"?s.children.push({type:"element",tagName:"br",properties:{},children:[]}):l==="classic"&&a.push({type:"text",value:`
|
|
266
|
-
`}));let S={type:"element",tagName:"span",properties:{class:"line"},children:[]},T=0;for(const D of b){let w={type:"element",tagName:"span",properties:{...D.htmlAttrs},children:[{type:"text",value:D.content}]};D.htmlStyle;const R=Fae(D.htmlStyle||cL(D));R&&(w.properties.style=R);for(const I of o)w=I?.span?.call(g,w,x+1,T,S,D)||w;l==="inline"?s.children.push(w):l==="classic"&&S.children.push(w),T+=D.content.length}if(l==="classic"){for(const D of o)S=D?.line?.call(g,S,x+1)||S;h.push(S),a.push(S)}}),l==="classic"){for(const b of o)p=b?.code?.call(g,p)||p;d.children.push(p);for(const b of o)d=b?.pre?.call(g,d)||d;s.children.push(d)}let y=s;for(const b of o)y=b?.root?.call(g,y)||y;return r&&hb(y,r),y}function aie(e){return e.map(t=>{const n=[];let r="",o=0;return t.forEach((a,s)=>{const l=!(a.fontStyle&&a.fontStyle&Qi.Underline);l&&a.content.match(/^\s+$/)&&t[s+1]?(o||(o=a.offset),r+=a.content):r?(l?n.push({...a,offset:o,content:r+a.content}):n.push({content:r,offset:o},a),o=0,r=""):n.push(a)}),n})}function iie(e){return e.map(t=>t.flatMap(n=>{if(n.content.match(/^\s+$/))return n;const r=n.content.match(/^(\s*)(.*?)(\s*)$/);if(!r)return n;const[,o,a,s]=r;if(!o&&!s)return n;const l=[{...n,offset:n.offset+o.length,content:a}];return o&&l.unshift({content:o,offset:n.offset}),s&&l.push({content:s,offset:n.offset+o.length+a.length}),l}))}function sie(e,t,n){const r={meta:{},options:n,codeToHast:(a,s)=>Yy(e,a,s),codeToTokens:(a,s)=>Wy(e,a,s)};let o=Iae(Yy(e,t,n,r));for(const a of Gy(n))o=a.postprocess?.call(r,o,n)||o;return o}const zI={light:"#333333",dark:"#bbbbbb"},$I={light:"#fffffe",dark:"#1e1e1e"},VI="__shiki_resolved";function wC(e){if(e?.[VI])return e;const t={...e};t.tokenColors&&!t.settings&&(t.settings=t.tokenColors,delete t.tokenColors),t.type||="dark",t.colorReplacements={...t.colorReplacements},t.settings||=[];let{bg:n,fg:r}=t;if(!n||!r){const l=t.settings?t.settings.find(u=>!u.name&&!u.scope):void 0;l?.settings?.foreground&&(r=l.settings.foreground),l?.settings?.background&&(n=l.settings.background),!r&&t?.colors?.["editor.foreground"]&&(r=t.colors["editor.foreground"]),!n&&t?.colors?.["editor.background"]&&(n=t.colors["editor.background"]),r||(r=t.type==="light"?zI.light:zI.dark),n||(n=t.type==="light"?$I.light:$I.dark),t.fg=r,t.bg=n}t.settings[0]&&t.settings[0].settings&&!t.settings[0].scope||t.settings.unshift({settings:{foreground:t.fg,background:t.bg}});let o=0;const a=new Map;function s(l){if(a.has(l))return a.get(l);o+=1;const u=`#${o.toString(16).padStart(8,"0").toLowerCase()}`;return t.colorReplacements?.[`#${u}`]?s(l):(a.set(l,u),u)}t.settings=t.settings.map(l=>{const u=l.settings?.foreground&&!l.settings.foreground.startsWith("#"),d=l.settings?.background&&!l.settings.background.startsWith("#");if(!u&&!d)return l;const p={...l,settings:{...l.settings}};if(u){const h=s(l.settings.foreground);t.colorReplacements[h]=l.settings.foreground,p.settings.foreground=h}if(d){const h=s(l.settings.background);t.colorReplacements[h]=l.settings.background,p.settings.background=h}return p});for(const l of Object.keys(t.colors||{}))if((l==="editor.foreground"||l==="editor.background"||l.startsWith("terminal.ansi"))&&!t.colors[l]?.startsWith("#")){const u=s(t.colors[l]);t.colorReplacements[u]=t.colors[l],t.colors[l]=u}return Object.defineProperty(t,VI,{enumerable:!1,writable:!1,value:!0}),t}async function pL(e){return Array.from(new Set((await Promise.all(e.filter(t=>!aL(t)).map(async t=>await lL(t).then(n=>Array.isArray(n)?n:[n])))).flat()))}async function hL(e){return(await Promise.all(e.map(async t=>iL(t)?null:wC(await lL(t))))).filter(t=>!!t)}class lie extends Toe{constructor(t,n,r,o={}){super(t),this._resolver=t,this._themes=n,this._langs=r,this._alias=o,this._themes.map(a=>this.loadTheme(a)),this.loadLanguages(this._langs)}_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;getTheme(t){return typeof t=="string"?this._resolvedThemes.get(t):this.loadTheme(t)}loadTheme(t){const n=wC(t);return n.name&&(this._resolvedThemes.set(n.name,n),this._loadedThemesCache=null),n}getLoadedThemes(){return this._loadedThemesCache||(this._loadedThemesCache=[...this._resolvedThemes.keys()]),this._loadedThemesCache}setTheme(t){let n=this._textmateThemeCache.get(t);n||(n=By.createFromRawTheme(t),this._textmateThemeCache.set(t,n)),this._syncRegistry.setTheme(n)}getGrammar(t){if(this._alias[t]){const n=new Set([t]);for(;this._alias[t];){if(t=this._alias[t],n.has(t))throw new ao(`Circular alias \`${Array.from(n).join(" -> ")} -> ${t}\``);n.add(t)}}return this._resolvedGrammars.get(t)}loadLanguage(t){if(this.getGrammar(t.name))return;const n=new Set([...this._langMap.values()].filter(a=>a.embeddedLangsLazy?.includes(t.name)));this._resolver.addLanguage(t);const r={balancedBracketSelectors:t.balancedBracketSelectors||["*"],unbalancedBracketSelectors:t.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(t.scopeName,t);const o=this.loadGrammarWithConfiguration(t.scopeName,1,r);if(o.name=t.name,this._resolvedGrammars.set(t.name,o),t.aliases&&t.aliases.forEach(a=>{this._alias[a]=t.name}),this._loadedLanguagesCache=null,n.size)for(const a of n)this._resolvedGrammars.delete(a.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(a.scopeName),this._syncRegistry?._grammars?.delete(a.scopeName),this.loadLanguage(this._langMap.get(a.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(t){for(const o of t)this.resolveEmbeddedLanguages(o);const n=Array.from(this._langGraph.entries()),r=n.filter(([o,a])=>!a);if(r.length){const o=n.filter(([a,s])=>s&&s.embeddedLangs?.some(l=>r.map(([u])=>u).includes(l))).filter(a=>!r.includes(a));throw new ao(`Missing languages ${r.map(([a])=>`\`${a}\``).join(", ")}, required by ${o.map(([a])=>`\`${a}\``).join(", ")}`)}for(const[o,a]of n)this._resolver.addLanguage(a);for(const[o,a]of n)this.loadLanguage(a)}getLoadedLanguages(){return this._loadedLanguagesCache||(this._loadedLanguagesCache=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])]),this._loadedLanguagesCache}resolveEmbeddedLanguages(t){if(this._langMap.set(t.name,t),this._langGraph.set(t.name,t),t.embeddedLangs)for(const n of t.embeddedLangs)this._langGraph.set(n,this._langMap.get(n))}}class cie{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(t,n){this._onigLib={createOnigScanner:r=>t.createScanner(r),createOnigString:r=>t.createString(r)},n.forEach(r=>this.addLanguage(r))}get onigLib(){return this._onigLib}getLangRegistration(t){return this._langs.get(t)}loadGrammar(t){return this._scopeToLang.get(t)}addLanguage(t){this._langs.set(t.name,t),t.aliases&&t.aliases.forEach(n=>{this._langs.set(n,t)}),this._scopeToLang.set(t.scopeName,t),t.injectTo&&t.injectTo.forEach(n=>{this._injections.get(n)||this._injections.set(n,[]),this._injections.get(n).push(t.scopeName)})}getInjections(t){const n=t.split(".");let r=[];for(let o=1;o<=n.length;o++){const a=n.slice(0,o).join(".");r=[...r,...this._injections.get(a)||[]]}return r}}let zf=0;function uie(e){zf+=1,e.warnings!==!1&&zf>=10&&zf%10===0&&console.warn(`[Shiki] ${zf} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let t=!1;if(!e.engine)throw new ao("`engine` option is required for synchronous mode");const n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(wC),o=new cie(e.engine,n),a=new lie(o,r,n,e.langAlias);let s;function l(D){S();const w=a.getGrammar(typeof D=="string"?D:D.name);if(!w)throw new ao(`Language \`${D}\` not found, you may need to load it first`);return w}function u(D){if(D==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};S();const w=a.getTheme(D);if(!w)throw new ao(`Theme \`${D}\` not found, you may need to load it first`);return w}function d(D){S();const w=u(D);s!==D&&(a.setTheme(w),s=D);const R=a.getColorMap();return{theme:w,colorMap:R}}function p(){return S(),a.getLoadedThemes()}function h(){return S(),a.getLoadedLanguages()}function g(...D){S(),a.loadLanguages(D.flat(1))}async function y(...D){return g(await pL(D))}function b(...D){S();for(const w of D.flat(1))a.loadTheme(w)}async function x(...D){return S(),b(await hL(D))}function S(){if(t)throw new ao("Shiki instance has been disposed")}function T(){t||(t=!0,a.dispose(),zf-=1)}return{setTheme:d,getTheme:u,getLanguage:l,getLoadedThemes:p,getLoadedLanguages:h,loadLanguage:y,loadLanguageSync:g,loadTheme:x,loadThemeSync:b,dispose:T,[Symbol.dispose]:T}}async function die(e={}){e.loadWasm;const[t,n,r]=await Promise.all([hL(e.themes||[]),pL(e.langs||[]),e.engine||D4(e.loadWasm||Mre())]);return uie({...e,themes:t,langs:n,engine:r})}async function fie(e={}){const t=await die(e);return{getLastGrammarState:(...n)=>Qae(t,...n),codeToTokensBase:(n,r)=>kC(t,n,r),codeToTokensWithThemes:(n,r)=>fL(t,n,r),codeToTokens:(n,r)=>Wy(t,n,r),codeToHast:(n,r)=>Yy(t,n,r),codeToHtml:(n,r)=>sie(t,n,r),...t,getInternalContext:()=>t}}function pie(e,t,n){let r,o,a;{const l=e;r=l.langs,o=l.themes,a=l.engine}async function s(l){function u(y){if(typeof y=="string"){if(aL(y))return[];const b=r[y];if(!b)throw new ts(`Language \`${y}\` is not included in this bundle. You may want to load it from external source.`);return b}return y}function d(y){if(iL(y))return"none";if(typeof y=="string"){const b=o[y];if(!b)throw new ts(`Theme \`${y}\` is not included in this bundle. You may want to load it from external source.`);return b}return y}const p=(l.themes??[]).map(y=>d(y)),h=(l.langs??[]).map(y=>u(y)),g=await fie({engine:l.engine??a(),...l,themes:p,langs:h});return{...g,loadLanguage(...y){return g.loadLanguage(...y.map(u))},loadTheme(...y){return g.loadTheme(...y.map(d))}}}return s}const hie=pie({langs:gre,themes:bre,engine:()=>D4(G(()=>import("./wasm-DQxwEHae-CG6Dc4jp.js"),[]))}),DE={scopeName:"source.malloy",patterns:[{include:"#malloy-language"}],repository:{"malloy-language":{patterns:[{include:"#sql-string"},{include:"#comments"},{include:"#tags"},{include:"#strings"},{include:"#numbers"},{include:"#keywords"},{include:"#properties"},{include:"#functions"},{include:"#datetimes"},{include:"#identifiers-quoted"},{include:"#types"},{include:"#constants"},{include:"#timeframes"},{include:"#identifiers-unquoted"}]},"malloy-matched":{begin:"{",end:"}",patterns:[{include:"#malloy-matched"},{include:"#malloy-language"}]},"malloy-in-sql":{begin:"%{",name:"source.malloy-in-sql",end:"}%?",patterns:[{include:"#malloy-matched"},{include:"#malloy-language"}]},"sql-string":{patterns:[{begin:'(\\b[A-Za-z_][A-Za-z_0-9]*)(\\s*\\.\\s*)(sql)(\\s*\\(\\s*)(""")',end:'"""',beginCaptures:{1:{name:"variable.other"},3:{name:"keyword.control.sql"},5:{name:"punctuation.sql-block.open"}},endCaptures:{0:{name:"punctuation.sql-block.close"}},name:"source.sql",patterns:[{include:"#malloy-in-sql"},{include:"source.sql"}]}]},functions:{patterns:[{match:"(?i)\\b(count)(\\s*\\()(distinct)",captures:{1:{name:"entity.name.function"},3:{name:"entity.name.function.modifier"}}},{match:"(?i)\\b(AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE|UNGROUPED)(\\s*\\()",captures:{1:{name:"entity.name.function"}}},{match:"(?i)\\b([a-zA-Z_][a-zA-Z_0-9]*)(\\s*\\()",captures:{1:{name:"entity.name.function"}}},{match:"(?i)\\b([a-zA-Z_][a-zA-Z_0-9]*)(!)(timestamp|number|string|boolean|date)?(\\s*\\()",captures:{1:{name:"entity.name.function"},3:{name:"entity.name.type"}}}]},datetimes:{patterns:[{match:"(?i)@[0-9]{4}-[0-9]{2}-[0-9]{2}[ T][0-9]{2}:[0-9]{2}((:[0-9]{2})(([\\.,][0-9]+)(\\[[A-Za-z_/]+\\])?)?)?",name:"constant.numeric.timestamp"},{match:"(?i)@[0-9]{4}(-Q[1-4]|-[0-9]{2}(-[0-9]{2}(-WK)?)?)?",name:"constant.numeric.date"}]},"identifiers-quoted":{patterns:[{match:"`[^`]*`",name:"variable.other.quoted"}]},"identifiers-unquoted":{patterns:[{match:"(?i)\\b[A-Za-z_][A-Za-z_0-9]*\\b",name:"variable.other"}]},timeframes:{patterns:[{match:"(?i)\\b((year|quarter|month|week|day|hour|minute|second)s?)\\b",name:"keyword.other.timeframe"},{match:"(?i)\\b(day_of_year|day_of_month)\\b",name:"keyword.other.timeframe"}]},comments:{patterns:[{begin:"/\\*",end:"\\*/",beginCaptures:{0:{name:"punctuation.definition.comment.begin"}},endCaptures:{0:{name:"punctuation.definition.comment.end"}},name:"comment.block"},{begin:"//",end:"\\n",beginCaptures:{0:{name:"punctuation.definition.comment"}},name:"comment.line.double-slash"},{begin:"--",end:"\\n",beginCaptures:{0:{name:"punctuation.definition.comment"}},name:"comment.line.double-hyphen"}]},tags:{patterns:[{match:"##\\n",name:"string.quoted",captures:{0:{name:"string.quoted"}}},{begin:'#"',end:"\\n",beginCaptures:{0:{name:"punctuation.definition.comment"}},name:"comment.line.double-slash"},{match:"#\\n",name:"string.quoted",captures:{0:{name:"string.quoted"}}},{begin:"#\\s",end:"\\n",beginCaptures:{0:{name:"support.type.property-name.json"}},name:"comment.line.double-slash",patterns:[{include:"#tag-values"}]},{begin:"##\\s",end:"\\n",beginCaptures:{0:{name:"support.type.property-name.json"}},name:"comment.line.double-slash",patterns:[{include:"#tag-values"}]},{begin:"#",end:"\\n",beginCaptures:{0:{name:"string.quoted"}},name:"string.quoted"}],repository:{"tag-values":{name:"support.type.property-name.json",match:'(-)?((?:[^\\s=#]+)|(?:"[^#]+"))(?:\\s*(=)\\s*((?:[^\\s=#]+)|(?:"[^#]+")))?',captures:{1:{name:"keyword.control.negate"},2:{name:"support.type.property-name.json"},3:{name:"keyword.operator.comparison.ts"},4:{name:"string.quoted"}}}}},strings:{patterns:[{begin:"'",end:"'",beginCaptures:{0:{name:"punctuation.definition.string.begin"}},endCaptures:{0:{name:"punctuation.definition.string.end"}},name:"string.quoted.single",patterns:[{include:"#escapes"}]},{begin:'"',end:'"',beginCaptures:{0:{name:"punctuation.definition.string.begin"}},endCaptures:{0:{name:"punctuation.definition.string.end"}},name:"string.quoted.double",patterns:[{include:"#escapes"}]},{begin:'"""',end:'"""',beginCaptures:{0:{name:"punctuation.definition.string.begin"}},endCaptures:{0:{name:"punctuation.definition.string.end"}},name:"string.quoted.triple"},{begin:"(?i)[r|/]'",end:"'",name:"string.regexp",patterns:[{include:"#regex-escapes"}]}],repository:{escapes:{name:"constant.character.escape",match:"\\\\(u[A-Fa-f0-9]{4}|.)",captures:{0:{name:"constant.character.escape"}}},"regex-escapes":{name:"constant.character.escape",match:"\\\\.",captures:{0:{name:"constant.character.escape"}}}}},numbers:{match:"(?i)(\\b((0|[1-9][0-9]*)(E[+-]?[0-9]+|\\.[0-9]*)?)|\\.[0-9]+)",name:"constant.numeric"},constants:{patterns:[{match:"(?i)\\bnull\\b",name:"constant.language.null"},{match:"(?i)\\btrue\\b",name:"constant.language.true"},{match:"(?i)\\bfalse\\b",name:"constant.language.false"}]},types:{patterns:[{match:"(?i)\\bstring\\b",name:"entity.name.type.string"},{match:"(?i)\\bnumber\\b",name:"entity.name.type.number"},{match:"(?i)\\bdate\\b",name:"entity.name.type.date"},{match:"(?i)\\btimestamp\\b",name:"entity.name.type.timestamp"},{match:"(?i)\\bboolean\\b",name:"entity.name.type.boolean"}]},properties:{patterns:[{match:"(?i)\\baccept\\b",name:"keyword.control.accept"},{match:"(?i)\\bselect\\b",name:"keyword.control.select"},{match:"(?i)\\bconnection\\b",name:"keyword.control.connection"},{match:"(?i)\\brun\\b",name:"keyword.control.run"},{match:"(?i)\\bextend\\b",name:"keyword.control.extend"},{match:"(?i)\\brefine\\b",name:"keyword.control.refine"},{match:"(?i)\\baggregate\\b",name:"keyword.control.aggregate"},{match:"(?i)\\bsample\\b",name:"keyword.control.sample"},{match:"(?i)\\bcalculate\\b",name:"keyword.control.calculate"},{match:"(?i)\\btimezone\\b",name:"keyword.control.timezone"},{match:"(?i)\\bdimension\\b",name:"keyword.control.dimension"},{match:"(?i)\\bexcept\\b",name:"keyword.control.except"},{match:"(?i)\\bsource\\b",name:"keyword.control.source"},{match:"(?i)\\bgroup_by\\b",name:"keyword.control.group_by"},{match:"(?i)\\bhaving\\b",name:"keyword.control.having"},{match:"(?i)\\bindex\\b",name:"keyword.control.index"},{match:"(?i)\\bjoin_one\\b",name:"keyword.control.join_one"},{match:"(?i)\\bwith\\b",name:"keyword.control.with"},{match:"(?i)\\bjoin_many\\b",name:"keyword.control.join_many"},{match:"(?i)\\bjoin_cross\\b",name:"keyword.control.join_cross"},{match:"(?i)\\blimit\\b",name:"keyword.control.limit"},{match:"(?i)\\bmeasure\\b",name:"keyword.control.measure"},{match:"(?i)\\bnest\\b",name:"keyword.control.nest"},{match:"(?i)\\border_by\\b",name:"keyword.control.order_by"},{match:"(?i)\\bpartition_by\\b",name:"keyword.control.partition_by"},{match:"(?i)\\bprimary_key\\b",name:"keyword.control.primary_key"},{match:"(?i)\\bproject\\b",name:"keyword.control.project"},{match:"(?i)\\bquery\\b",name:"keyword.control.query"},{match:"(?i)\\brename\\b",name:"keyword.control.rename"},{match:"(?i)\\btop\\b",name:"keyword.control.top"},{match:"(?i)\\bview\\b",name:"keyword.control.view"},{match:"(?i)\\bwhere\\b",name:"keyword.control.where"},{match:"(?i)\\bdeclare\\b",name:"keyword.control.declare"}]},keywords:{patterns:[{match:"(?i)\\bis\\b",name:"keyword.control.is"},{match:"(?i)\\bon\\b",name:"keyword.control.on"},{match:"(?i)\\bnot\\b",name:"keyword.other.not"},{match:"(?i)\\bor\\b",name:"keyword.other.or"},{match:"(?i)\\bdesc\\b",name:"keyword.control.desc"},{match:"(?i)\\bby\\b",name:"keyword.control.by"},{match:"(?i)\\band\\b",name:"keyword.other.and"},{match:"(?i)\\basc\\b",name:"keyword.control.asc"},{match:"(?i)\\bfor\\b",name:"keyword.other.for"},{match:"(?i)\\belse\\b",name:"keyword.other.else"},{match:"(?i)\\bto\\b",name:"keyword.other.to"},{match:"(?i)\\bwhen\\b",name:"keyword.other.when"},{match:"(?i)\\bpick\\b",name:"keyword.other.pick"},{match:"(?i)\\bimport\\b",name:"keyword.control.import"}]}}},mie={...DE,patterns:[...DE.patterns,{include:"#docvar"}],repository:{...DE.repository,docvar:{patterns:[{match:"\\<\\<[^(\\>\\>)]*\\>\\>",beginCaptures:{0:{name:"punctuation.definition.comment.begin"}},endCaptures:{0:{name:"punctuation.definition.comment.end"}},name:"markup.italic.markdown"}]}}},gie={name:"Malloy SQL",scopeName:"source.malloy-sql",patterns:[{include:"#malloysql-sql"}],repository:{"malloysql-sql":{beginCaptures:{0:{name:"entity.other.attribute.malloy-sql"},1:{name:"entity.other.attribute.malloy-sql"},3:{name:"comment.line.double-slash"}},name:"meta.embedded.block.malloysql.sql",patterns:[{include:"#comments"},{begin:"%{",end:"}%",beginCaptures:{0:{name:"punctuation.definition.malloy-sql"}},endCaptures:{0:{name:"punctuation.definition.malloy-sql"}},name:"meta.embedded.block.malloy",patterns:[{include:"source.malloy"}]},{include:"source.sql"}]},comments:{patterns:[{begin:"/\\*",end:"\\*/",beginCaptures:{0:{name:"punctuation.definition.comment.begin"}},endCaptures:{0:{name:"punctuation.definition.comment.end"}},name:"comment.block"},{begin:"//",end:"\\n",beginCaptures:{0:{name:"punctuation.definition.comment"}},name:"comment.line.double-slash"},{begin:"--",end:"\\n",beginCaptures:{0:{name:"punctuation.definition.comment"}},name:"comment.line.double-hyphen"}]}}},mL="catppuccin-latte",yie=hie({themes:[mL],langs:["sql","json","typescript",{name:"malloy",scopeName:"source.malloy",embeddedLangs:["sql"],...mie},{name:"malloysql",scopeName:"source.malloy-sql",embeddedLangs:["sql"],...gie}]});async function ac(e,t){return(await yie).codeToHtml(e,{lang:t,theme:mL})}const Ar=ke(bu)({display:"flex",flexDirection:"column",height:"100%"}),Ko=ke(vu)({display:"flex",flexDirection:"column",padding:"10px",flexGrow:1}),DC=ke(uq)({padding:"10px"}),bie=ke("div")({height:"100%"});ke("div")({height:"30px",backgroundColor:"rgba(225, 240, 255, 1)",display:"flex",padding:"4px",alignItems:"center"});const gL=ke("div")({height:"75vh",width:"100%",overflowY:"auto"});ke("div")({position:"relative",height:"100%",flex:"0 0 auto"});function $r({error:e,context:t}){const n=e.data?.message||"Unknown Error";return v.jsxs(v.Fragment,{children:[t&&v.jsx(He,{variant:"body2",sx:{p:"10px",m:"auto"},children:t}),v.jsx("pre",{style:{whiteSpace:"pre-wrap",color:"red",padding:"10px",margin:"auto"},children:n})]})}function Zr({text:e,size:t=20,color:n="primary",thickness:r=3.6,centered:o=!0,spacing:a=2,textVariant:s="body2"}){const l=v.jsxs(Nt,{sx:{display:"flex",flexDirection:"column",alignItems:"center",gap:a},children:[v.jsx(ES,{size:t,color:n,thickness:r}),e&&v.jsx(He,{variant:s,color:"text.secondary",children:e})]});return o?v.jsx(Nt,{sx:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:"200px",width:"100%"},children:l}):l}const vie=Rn([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-2m0 16H5V5h14z"},"0"),v.jsx("path",{d:"M7 12h2v5H7zm8-5h2v10h-2zm-4 7h2v3h-2zm0-4h2v2h-2z"},"1")]),wn="http://localhost/api/v0".replace(/\/+$/,"");class al{constructor(t,n=wn,r=Rt){this.basePath=n,this.axios=r,t&&(this.configuration=t,this.basePath=t.basePath??n)}configuration}class Eie extends Error{constructor(t,n){super(n),this.field=t,this.name="RequiredError"}}const Pn={},Ln="https://example.com",St=function(e,t,n){if(n==null)throw new Eie(t,`Required parameter ${t} was null or undefined when calling ${e}.`)};function pT(e,t,n=""){t!=null&&(typeof t=="object"?Array.isArray(t)?t.forEach(r=>pT(e,r,n)):Object.keys(t).forEach(r=>pT(e,t[r],`${n}${n!==""?".":""}${r}`)):e.has(n)?e.append(n,t):e.set(n,t))}const Mn=function(e,...t){const n=new URLSearchParams(e.search);pT(n,t),e.search=n.toString()},Ky=function(e,t,n){const r=typeof e!="string";return(r&&n&&n.isJsonMime?n.isJsonMime(t.headers["Content-Type"]):r)?JSON.stringify(e!==void 0?e:{}):e||""},Fn=function(e){return e.pathname+e.search+e.hash},Bn=function(e,t,n,r){return(o=t,a=n)=>{const s={...e.options,url:(o.defaults.baseURL?"":r?.basePath??a)+e.url};return o.request(s)}},xie=function(e){return{getConnection:async(t,n,r={})=>{St("getConnection","projectName",t),St("getConnection","connectionName",n);const o="/projects/{projectName}/connections/{connectionName}".replace("{projectName}",encodeURIComponent(String(t))).replace("{connectionName}",encodeURIComponent(String(n))),a=new URL(o,Ln);let s;e&&(s=e.baseOptions);const l={method:"GET",...s,...r},u={};Mn(a,{});let d=s&&s.headers?s.headers:{};return l.headers={...u,...d,...r.headers},{url:Fn(a),options:l}},getQuerydata:async(t,n,r,o,a={})=>{St("getQuerydata","projectName",t),St("getQuerydata","connectionName",n);const s="/projects/{projectName}/connections/{connectionName}/queryData".replace("{projectName}",encodeURIComponent(String(t))).replace("{connectionName}",encodeURIComponent(String(n))),l=new URL(s,Ln);let u;e&&(u=e.baseOptions);const d={method:"GET",...u,...a},p={},h={};r!==void 0&&(h.sqlStatement=r),o!==void 0&&(h.options=o),Mn(l,h);let g=u&&u.headers?u.headers:{};return d.headers={...p,...g,...a.headers},{url:Fn(l),options:d}},getSqlsource:async(t,n,r,o={})=>{St("getSqlsource","projectName",t),St("getSqlsource","connectionName",n);const a="/projects/{projectName}/connections/{connectionName}/sqlSource".replace("{projectName}",encodeURIComponent(String(t))).replace("{connectionName}",encodeURIComponent(String(n))),s=new URL(a,Ln);let l;e&&(l=e.baseOptions);const u={method:"GET",...l,...o},d={},p={};r!==void 0&&(p.sqlStatement=r),Mn(s,p);let h=l&&l.headers?l.headers:{};return u.headers={...d,...h,...o.headers},{url:Fn(s),options:u}},getTablesource:async(t,n,r,o,a={})=>{St("getTablesource","projectName",t),St("getTablesource","connectionName",n);const s="/projects/{projectName}/connections/{connectionName}/tableSource".replace("{projectName}",encodeURIComponent(String(t))).replace("{connectionName}",encodeURIComponent(String(n))),l=new URL(s,Ln);let u;e&&(u=e.baseOptions);const d={method:"GET",...u,...a},p={},h={};r!==void 0&&(h.tableKey=r),o!==void 0&&(h.tablePath=o),Mn(l,h);let g=u&&u.headers?u.headers:{};return d.headers={...p,...g,...a.headers},{url:Fn(l),options:d}},getTemporarytable:async(t,n,r,o={})=>{St("getTemporarytable","projectName",t),St("getTemporarytable","connectionName",n);const a="/projects/{projectName}/connections/{connectionName}/temporaryTable".replace("{projectName}",encodeURIComponent(String(t))).replace("{connectionName}",encodeURIComponent(String(n))),s=new URL(a,Ln);let l;e&&(l=e.baseOptions);const u={method:"GET",...l,...o},d={},p={};r!==void 0&&(p.sqlStatement=r),Mn(s,p);let h=l&&l.headers?l.headers:{};return u.headers={...d,...h,...o.headers},{url:Fn(s),options:u}},getTest:async(t,n,r={})=>{St("getTest","projectName",t),St("getTest","connectionName",n);const o="/projects/{projectName}/connections/{connectionName}/test".replace("{projectName}",encodeURIComponent(String(t))).replace("{connectionName}",encodeURIComponent(String(n))),a=new URL(o,Ln);let s;e&&(s=e.baseOptions);const l={method:"GET",...s,...r},u={};Mn(a,{});let d=s&&s.headers?s.headers:{};return l.headers={...u,...d,...r.headers},{url:Fn(a),options:l}},listConnections:async(t,n={})=>{St("listConnections","projectName",t);const r="/projects/{projectName}/connections".replace("{projectName}",encodeURIComponent(String(t))),o=new URL(r,Ln);let a;e&&(a=e.baseOptions);const s={method:"GET",...a,...n},l={};Mn(o,{});let u=a&&a.headers?a.headers:{};return s.headers={...l,...u,...n.headers},{url:Fn(o),options:s}},listSchemas:async(t,n,r={})=>{St("listSchemas","projectName",t),St("listSchemas","connectionName",n);const o="/projects/{projectName}/connections/{connectionName}/schemas".replace("{projectName}",encodeURIComponent(String(t))).replace("{connectionName}",encodeURIComponent(String(n))),a=new URL(o,Ln);let s;e&&(s=e.baseOptions);const l={method:"GET",...s,...r},u={};Mn(a,{});let d=s&&s.headers?s.headers:{};return l.headers={...u,...d,...r.headers},{url:Fn(a),options:l}},listTables:async(t,n,r,o={})=>{St("listTables","projectName",t),St("listTables","connectionName",n),St("listTables","schemaName",r);const a="/projects/{projectName}/connections/{connectionName}/schemas/{schemaName}/tables".replace("{projectName}",encodeURIComponent(String(t))).replace("{connectionName}",encodeURIComponent(String(n))).replace("{schemaName}",encodeURIComponent(String(r))),s=new URL(a,Ln);let l;e&&(l=e.baseOptions);const u={method:"GET",...l,...o},d={};Mn(s,{});let p=l&&l.headers?l.headers:{};return u.headers={...d,...p,...o.headers},{url:Fn(s),options:u}}}},zi=function(e){const t=xie(e);return{async getConnection(n,r,o){const a=await t.getConnection(n,r,o),s=e?.serverIndex??0,l=Pn["ConnectionsApi.getConnection"]?.[s]?.url;return(u,d)=>Bn(a,Rt,wn,e)(u,l||d)},async getQuerydata(n,r,o,a,s){const l=await t.getQuerydata(n,r,o,a,s),u=e?.serverIndex??0,d=Pn["ConnectionsApi.getQuerydata"]?.[u]?.url;return(p,h)=>Bn(l,Rt,wn,e)(p,d||h)},async getSqlsource(n,r,o,a){const s=await t.getSqlsource(n,r,o,a),l=e?.serverIndex??0,u=Pn["ConnectionsApi.getSqlsource"]?.[l]?.url;return(d,p)=>Bn(s,Rt,wn,e)(d,u||p)},async getTablesource(n,r,o,a,s){const l=await t.getTablesource(n,r,o,a,s),u=e?.serverIndex??0,d=Pn["ConnectionsApi.getTablesource"]?.[u]?.url;return(p,h)=>Bn(l,Rt,wn,e)(p,d||h)},async getTemporarytable(n,r,o,a){const s=await t.getTemporarytable(n,r,o,a),l=e?.serverIndex??0,u=Pn["ConnectionsApi.getTemporarytable"]?.[l]?.url;return(d,p)=>Bn(s,Rt,wn,e)(d,u||p)},async getTest(n,r,o){const a=await t.getTest(n,r,o),s=e?.serverIndex??0,l=Pn["ConnectionsApi.getTest"]?.[s]?.url;return(u,d)=>Bn(a,Rt,wn,e)(u,l||d)},async listConnections(n,r){const o=await t.listConnections(n,r),a=e?.serverIndex??0,s=Pn["ConnectionsApi.listConnections"]?.[a]?.url;return(l,u)=>Bn(o,Rt,wn,e)(l,s||u)},async listSchemas(n,r,o){const a=await t.listSchemas(n,r,o),s=e?.serverIndex??0,l=Pn["ConnectionsApi.listSchemas"]?.[s]?.url;return(u,d)=>Bn(a,Rt,wn,e)(u,l||d)},async listTables(n,r,o,a){const s=await t.listTables(n,r,o,a),l=e?.serverIndex??0,u=Pn["ConnectionsApi.listTables"]?.[l]?.url;return(d,p)=>Bn(s,Rt,wn,e)(d,u||p)}}};class yL extends al{getConnection(t,n,r){return zi(this.configuration).getConnection(t,n,r).then(o=>o(this.axios,this.basePath))}getQuerydata(t,n,r,o,a){return zi(this.configuration).getQuerydata(t,n,r,o,a).then(s=>s(this.axios,this.basePath))}getSqlsource(t,n,r,o){return zi(this.configuration).getSqlsource(t,n,r,o).then(a=>a(this.axios,this.basePath))}getTablesource(t,n,r,o,a){return zi(this.configuration).getTablesource(t,n,r,o,a).then(s=>s(this.axios,this.basePath))}getTemporarytable(t,n,r,o){return zi(this.configuration).getTemporarytable(t,n,r,o).then(a=>a(this.axios,this.basePath))}getTest(t,n,r){return zi(this.configuration).getTest(t,n,r).then(o=>o(this.axios,this.basePath))}listConnections(t,n){return zi(this.configuration).listConnections(t,n).then(r=>r(this.axios,this.basePath))}listSchemas(t,n,r){return zi(this.configuration).listSchemas(t,n,r).then(o=>o(this.axios,this.basePath))}listTables(t,n,r,o){return zi(this.configuration).listTables(t,n,r,o).then(a=>a(this.axios,this.basePath))}}const Tie=function(e){return{listDatabases:async(t,n,r,o={})=>{St("listDatabases","projectName",t),St("listDatabases","packageName",n);const a="/projects/{projectName}/packages/{packageName}/databases".replace("{projectName}",encodeURIComponent(String(t))).replace("{packageName}",encodeURIComponent(String(n))),s=new URL(a,Ln);let l;e&&(l=e.baseOptions);const u={method:"GET",...l,...o},d={},p={};r!==void 0&&(p.versionId=r),Mn(s,p);let h=l&&l.headers?l.headers:{};return u.headers={...d,...h,...o.headers},{url:Fn(s),options:u}}}},Sie=function(e){const t=Tie(e);return{async listDatabases(n,r,o,a){const s=await t.listDatabases(n,r,o,a),l=e?.serverIndex??0,u=Pn["DatabasesApi.listDatabases"]?.[l]?.url;return(d,p)=>Bn(s,Rt,wn,e)(d,u||p)}}};class Cie extends al{listDatabases(t,n,r,o){return Sie(this.configuration).listDatabases(t,n,r,o).then(a=>a(this.axios,this.basePath))}}const _ie=function(e){return{getModel:async(t,n,r,o,a={})=>{St("getModel","projectName",t),St("getModel","packageName",n),St("getModel","path",r);const s="/projects/{projectName}/packages/{packageName}/models/{path}".replace("{projectName}",encodeURIComponent(String(t))).replace("{packageName}",encodeURIComponent(String(n))).replace("{path}",encodeURIComponent(String(r))),l=new URL(s,Ln);let u;e&&(u=e.baseOptions);const d={method:"GET",...u,...a},p={},h={};o!==void 0&&(h.versionId=o),Mn(l,h);let g=u&&u.headers?u.headers:{};return d.headers={...p,...g,...a.headers},{url:Fn(l),options:d}},listModels:async(t,n,r,o={})=>{St("listModels","projectName",t),St("listModels","packageName",n);const a="/projects/{projectName}/packages/{packageName}/models".replace("{projectName}",encodeURIComponent(String(t))).replace("{packageName}",encodeURIComponent(String(n))),s=new URL(a,Ln);let l;e&&(l=e.baseOptions);const u={method:"GET",...l,...o},d={},p={};r!==void 0&&(p.versionId=r),Mn(s,p);let h=l&&l.headers?l.headers:{};return u.headers={...d,...h,...o.headers},{url:Fn(s),options:u}}}},GI=function(e){const t=_ie(e);return{async getModel(n,r,o,a,s){const l=await t.getModel(n,r,o,a,s),u=e?.serverIndex??0,d=Pn["ModelsApi.getModel"]?.[u]?.url;return(p,h)=>Bn(l,Rt,wn,e)(p,d||h)},async listModels(n,r,o,a){const s=await t.listModels(n,r,o,a),l=e?.serverIndex??0,u=Pn["ModelsApi.listModels"]?.[l]?.url;return(d,p)=>Bn(s,Rt,wn,e)(d,u||p)}}};class mb extends al{getModel(t,n,r,o,a){return GI(this.configuration).getModel(t,n,r,o,a).then(s=>s(this.axios,this.basePath))}listModels(t,n,r,o){return GI(this.configuration).listModels(t,n,r,o).then(a=>a(this.axios,this.basePath))}}const Aie=function(e){return{getNotebook:async(t,n,r,o,a={})=>{St("getNotebook","projectName",t),St("getNotebook","packageName",n),St("getNotebook","path",r);const s="/projects/{projectName}/packages/{packageName}/notebooks/{path}".replace("{projectName}",encodeURIComponent(String(t))).replace("{packageName}",encodeURIComponent(String(n))).replace("{path}",encodeURIComponent(String(r))),l=new URL(s,Ln);let u;e&&(u=e.baseOptions);const d={method:"GET",...u,...a},p={},h={};o!==void 0&&(h.versionId=o),Mn(l,h);let g=u&&u.headers?u.headers:{};return d.headers={...p,...g,...a.headers},{url:Fn(l),options:d}},listNotebooks:async(t,n,r,o={})=>{St("listNotebooks","projectName",t),St("listNotebooks","packageName",n);const a="/projects/{projectName}/packages/{packageName}/notebooks".replace("{projectName}",encodeURIComponent(String(t))).replace("{packageName}",encodeURIComponent(String(n))),s=new URL(a,Ln);let l;e&&(l=e.baseOptions);const u={method:"GET",...l,...o},d={},p={};r!==void 0&&(p.versionId=r),Mn(s,p);let h=l&&l.headers?l.headers:{};return u.headers={...d,...h,...o.headers},{url:Fn(s),options:u}}}},qI=function(e){const t=Aie(e);return{async getNotebook(n,r,o,a,s){const l=await t.getNotebook(n,r,o,a,s),u=e?.serverIndex??0,d=Pn["NotebooksApi.getNotebook"]?.[u]?.url;return(p,h)=>Bn(l,Rt,wn,e)(p,d||h)},async listNotebooks(n,r,o,a){const s=await t.listNotebooks(n,r,o,a),l=e?.serverIndex??0,u=Pn["NotebooksApi.listNotebooks"]?.[l]?.url;return(d,p)=>Bn(s,Rt,wn,e)(d,u||p)}}};class bL extends al{getNotebook(t,n,r,o,a){return qI(this.configuration).getNotebook(t,n,r,o,a).then(s=>s(this.axios,this.basePath))}listNotebooks(t,n,r,o){return qI(this.configuration).listNotebooks(t,n,r,o).then(a=>a(this.axios,this.basePath))}}const kie=function(e){return{createPackage:async(t,n,r={})=>{St("createPackage","projectName",t),St("createPackage","body",n);const o="/projects/{projectName}/packages".replace("{projectName}",encodeURIComponent(String(t))),a=new URL(o,Ln);let s;e&&(s=e.baseOptions);const l={method:"POST",...s,...r},u={},d={};u["Content-Type"]="application/json",Mn(a,d);let p=s&&s.headers?s.headers:{};return l.headers={...u,...p,...r.headers},l.data=Ky(n,l,e),{url:Fn(a),options:l}},deletePackage:async(t,n,r={})=>{St("deletePackage","projectName",t),St("deletePackage","packageName",n);const o="/projects/{projectName}/packages/{packageName}".replace("{projectName}",encodeURIComponent(String(t))).replace("{packageName}",encodeURIComponent(String(n))),a=new URL(o,Ln);let s;e&&(s=e.baseOptions);const l={method:"DELETE",...s,...r},u={};Mn(a,{});let d=s&&s.headers?s.headers:{};return l.headers={...u,...d,...r.headers},{url:Fn(a),options:l}},getPackage:async(t,n,r,o,a={})=>{St("getPackage","projectName",t),St("getPackage","packageName",n);const s="/projects/{projectName}/packages/{packageName}".replace("{projectName}",encodeURIComponent(String(t))).replace("{packageName}",encodeURIComponent(String(n))),l=new URL(s,Ln);let u;e&&(u=e.baseOptions);const d={method:"GET",...u,...a},p={},h={};r!==void 0&&(h.versionId=r),o!==void 0&&(h.reload=o),Mn(l,h);let g=u&&u.headers?u.headers:{};return d.headers={...p,...g,...a.headers},{url:Fn(l),options:d}},listPackages:async(t,n={})=>{St("listPackages","projectName",t);const r="/projects/{projectName}/packages".replace("{projectName}",encodeURIComponent(String(t))),o=new URL(r,Ln);let a;e&&(a=e.baseOptions);const s={method:"GET",...a,...n},l={};Mn(o,{});let u=a&&a.headers?a.headers:{};return s.headers={...l,...u,...n.headers},{url:Fn(o),options:s}},updatePackage:async(t,n,r,o={})=>{St("updatePackage","projectName",t),St("updatePackage","packageName",n),St("updatePackage","body",r);const a="/projects/{projectName}/packages/{packageName}".replace("{projectName}",encodeURIComponent(String(t))).replace("{packageName}",encodeURIComponent(String(n))),s=new URL(a,Ln);let l;e&&(l=e.baseOptions);const u={method:"PATCH",...l,...o},d={},p={};d["Content-Type"]="application/json",Mn(s,p);let h=l&&l.headers?l.headers:{};return u.headers={...d,...h,...o.headers},u.data=Ky(r,u,e),{url:Fn(s),options:u}}}},$f=function(e){const t=kie(e);return{async createPackage(n,r,o){const a=await t.createPackage(n,r,o),s=e?.serverIndex??0,l=Pn["PackagesApi.createPackage"]?.[s]?.url;return(u,d)=>Bn(a,Rt,wn,e)(u,l||d)},async deletePackage(n,r,o){const a=await t.deletePackage(n,r,o),s=e?.serverIndex??0,l=Pn["PackagesApi.deletePackage"]?.[s]?.url;return(u,d)=>Bn(a,Rt,wn,e)(u,l||d)},async getPackage(n,r,o,a,s){const l=await t.getPackage(n,r,o,a,s),u=e?.serverIndex??0,d=Pn["PackagesApi.getPackage"]?.[u]?.url;return(p,h)=>Bn(l,Rt,wn,e)(p,d||h)},async listPackages(n,r){const o=await t.listPackages(n,r),a=e?.serverIndex??0,s=Pn["PackagesApi.listPackages"]?.[a]?.url;return(l,u)=>Bn(o,Rt,wn,e)(l,s||u)},async updatePackage(n,r,o,a){const s=await t.updatePackage(n,r,o,a),l=e?.serverIndex??0,u=Pn["PackagesApi.updatePackage"]?.[l]?.url;return(d,p)=>Bn(s,Rt,wn,e)(d,u||p)}}};class vL extends al{createPackage(t,n,r){return $f(this.configuration).createPackage(t,n,r).then(o=>o(this.axios,this.basePath))}deletePackage(t,n,r){return $f(this.configuration).deletePackage(t,n,r).then(o=>o(this.axios,this.basePath))}getPackage(t,n,r,o,a){return $f(this.configuration).getPackage(t,n,r,o,a).then(s=>s(this.axios,this.basePath))}listPackages(t,n){return $f(this.configuration).listPackages(t,n).then(r=>r(this.axios,this.basePath))}updatePackage(t,n,r,o){return $f(this.configuration).updatePackage(t,n,r,o).then(a=>a(this.axios,this.basePath))}}const wie=function(e){return{createProject:async(t,n={})=>{St("createProject","body",t);const r="/projects",o=new URL(r,Ln);let a;e&&(a=e.baseOptions);const s={method:"POST",...a,...n},l={},u={};l["Content-Type"]="application/json",Mn(o,u);let d=a&&a.headers?a.headers:{};return s.headers={...l,...d,...n.headers},s.data=Ky(t,s,e),{url:Fn(o),options:s}},deleteProject:async(t,n={})=>{St("deleteProject","projectName",t);const r="/projects/{projectName}".replace("{projectName}",encodeURIComponent(String(t))),o=new URL(r,Ln);let a;e&&(a=e.baseOptions);const s={method:"DELETE",...a,...n},l={};Mn(o,{});let u=a&&a.headers?a.headers:{};return s.headers={...l,...u,...n.headers},{url:Fn(o),options:s}},getProject:async(t,n,r={})=>{St("getProject","projectName",t);const o="/projects/{projectName}".replace("{projectName}",encodeURIComponent(String(t))),a=new URL(o,Ln);let s;e&&(s=e.baseOptions);const l={method:"GET",...s,...r},u={},d={};n!==void 0&&(d.reload=n),Mn(a,d);let p=s&&s.headers?s.headers:{};return l.headers={...u,...p,...r.headers},{url:Fn(a),options:l}},listProjects:async(t={})=>{const n="/projects",r=new URL(n,Ln);let o;e&&(o=e.baseOptions);const a={method:"GET",...o,...t},s={};Mn(r,{});let l=o&&o.headers?o.headers:{};return a.headers={...s,...l,...t.headers},{url:Fn(r),options:a}},updateProject:async(t,n,r={})=>{St("updateProject","projectName",t),St("updateProject","body",n);const o="/projects/{projectName}".replace("{projectName}",encodeURIComponent(String(t))),a=new URL(o,Ln);let s;e&&(s=e.baseOptions);const l={method:"PATCH",...s,...r},u={},d={};u["Content-Type"]="application/json",Mn(a,d);let p=s&&s.headers?s.headers:{};return l.headers={...u,...p,...r.headers},l.data=Ky(n,l,e),{url:Fn(a),options:l}}}},Vf=function(e){const t=wie(e);return{async createProject(n,r){const o=await t.createProject(n,r),a=e?.serverIndex??0,s=Pn["ProjectsApi.createProject"]?.[a]?.url;return(l,u)=>Bn(o,Rt,wn,e)(l,s||u)},async deleteProject(n,r){const o=await t.deleteProject(n,r),a=e?.serverIndex??0,s=Pn["ProjectsApi.deleteProject"]?.[a]?.url;return(l,u)=>Bn(o,Rt,wn,e)(l,s||u)},async getProject(n,r,o){const a=await t.getProject(n,r,o),s=e?.serverIndex??0,l=Pn["ProjectsApi.getProject"]?.[s]?.url;return(u,d)=>Bn(a,Rt,wn,e)(u,l||d)},async listProjects(n){const r=await t.listProjects(n),o=e?.serverIndex??0,a=Pn["ProjectsApi.listProjects"]?.[o]?.url;return(s,l)=>Bn(r,Rt,wn,e)(s,a||l)},async updateProject(n,r,o){const a=await t.updateProject(n,r,o),s=e?.serverIndex??0,l=Pn["ProjectsApi.updateProject"]?.[s]?.url;return(u,d)=>Bn(a,Rt,wn,e)(u,l||d)}}};class EL extends al{createProject(t,n){return Vf(this.configuration).createProject(t,n).then(r=>r(this.axios,this.basePath))}deleteProject(t,n){return Vf(this.configuration).deleteProject(t,n).then(r=>r(this.axios,this.basePath))}getProject(t,n,r){return Vf(this.configuration).getProject(t,n,r).then(o=>o(this.axios,this.basePath))}listProjects(t){return Vf(this.configuration).listProjects(t).then(n=>n(this.axios,this.basePath))}updateProject(t,n,r){return Vf(this.configuration).updateProject(t,n,r).then(o=>o(this.axios,this.basePath))}}const Die=function(e){return{executeQuery:async(t,n,r,o,a,s,l,u={})=>{St("executeQuery","projectName",t),St("executeQuery","packageName",n),St("executeQuery","path",r);const d="/projects/{projectName}/packages/{packageName}/queryResults/{path}".replace("{projectName}",encodeURIComponent(String(t))).replace("{packageName}",encodeURIComponent(String(n))).replace("{path}",encodeURIComponent(String(r))),p=new URL(d,Ln);let h;e&&(h=e.baseOptions);const g={method:"GET",...h,...u},y={},b={};o!==void 0&&(b.query=o),a!==void 0&&(b.sourceName=a),s!==void 0&&(b.queryName=s),l!==void 0&&(b.versionId=l),Mn(p,b);let x=h&&h.headers?h.headers:{};return g.headers={...y,...x,...u.headers},{url:Fn(p),options:g}}}},Rie=function(e){const t=Die(e);return{async executeQuery(n,r,o,a,s,l,u,d){const p=await t.executeQuery(n,r,o,a,s,l,u,d),h=e?.serverIndex??0,g=Pn["QueryresultsApi.executeQuery"]?.[h]?.url;return(y,b)=>Bn(p,Rt,wn,e)(y,g||b)}}};class RC extends al{executeQuery(t,n,r,o,a,s,l,u){return Rie(this.configuration).executeQuery(t,n,r,o,a,s,l,u).then(d=>d(this.axios,this.basePath))}}const Iie=function(e){return{listSchedules:async(t,n,r,o={})=>{St("listSchedules","projectName",t),St("listSchedules","packageName",n);const a="/projects/{projectName}/packages/{packageName}/schedules".replace("{projectName}",encodeURIComponent(String(t))).replace("{packageName}",encodeURIComponent(String(n))),s=new URL(a,Ln);let l;e&&(l=e.baseOptions);const u={method:"GET",...l,...o},d={},p={};r!==void 0&&(p.versionId=r),Mn(s,p);let h=l&&l.headers?l.headers:{};return u.headers={...d,...h,...o.headers},{url:Fn(s),options:u}}}},Oie=function(e){const t=Iie(e);return{async listSchedules(n,r,o,a){const s=await t.listSchedules(n,r,o,a),l=e?.serverIndex??0,u=Pn["SchedulesApi.listSchedules"]?.[l]?.url;return(d,p)=>Bn(s,Rt,wn,e)(d,u||p)}}};class Nie extends al{listSchedules(t,n,r,o){return Oie(this.configuration).listSchedules(t,n,r,o).then(a=>a(this.axios,this.basePath))}}class Vr{apiKey;username;password;accessToken;basePath;serverIndex;baseOptions;formDataCtor;constructor(t={}){this.apiKey=t.apiKey,this.username=t.username,this.password=t.password,this.accessToken=t.accessToken,this.basePath=t.basePath,this.serverIndex=t.serverIndex,this.baseOptions={...t.baseOptions,headers:{...t.baseOptions?.headers}},this.formDataCtor=t.formDataCtor}isJsonMime(t){const n=new RegExp("^(application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(;.*)?$","i");return t!==null&&(n.test(t)||t.toLowerCase()==="application/json-patch+json")}}const xL=k.createContext(void 0),uh=({projectName:e,packageName:t,versionId:n,children:r})=>v.jsx(xL.Provider,{value:{projectName:e,packageName:t,versionId:n},children:r});function uo(e=!0){const t=k.useContext(xL);if(!t&&e)throw new Error("usePackage must be used within a PackageProvider");return t}const TL=new GX({defaultOptions:{queries:{retry:!1,throwOnError:!1},mutations:{retry:!1,throwOnError:!1}}}),IC=async(e,t)=>{const n=t?await t():void 0,r=n?{Authorization:`Bearer ${n}`}:{};return{baseURL:e,withCredentials:!!n,headers:r}};function Jr(e){const{server:t,getAccessToken:n}=zC(),r={...e,queryKey:[...e.queryKey,t],queryFn:async()=>{try{const o=await IC(t,n);return await e.queryFn(o)}catch(o){if(o&&typeof o=="object"&&"response"in o){const a=o;if(a.response?.data){const s=new Error(a.response.data.message||a.message);throw s.status=a.response.status,s.data=a.response.data,s}}throw o}},retry:!1,throwOnError:!1};return lZ(r,TL)}function Pie(e){const{server:t,getAccessToken:n}=zC(),r={...e,mutationFn:async o=>{try{const a=await IC(t,n);return await e.mutationFn(o,a)}catch(a){if(a&&typeof a=="object"&&"response"in a){const s=a;if(s.response?.data){const l=new Error(s.response.data.message||s.message);throw l.status=s.response.status,l.data=s.response.data,l}}throw a}},retry:!1,throwOnError:!1};return cZ(r,TL)}const Lie=k.lazy(()=>G(()=>import("./RenderedResult-BAZuT25g-_eLjVkSo.js"),[])),Mie=new RC(new Vr);function SL(e){const{optionalProjectName:t,optionalPackageName:n}=e;if(!t||!n)throw new Error("Project and Package name must be provided for query embedding.");return JSON.stringify({...e})}function Fie({modelPath:e,query:t,sourceName:n,queryName:r,optionalProjectName:o,optionalPackageName:a,optionalVersionId:s}){const l=uo(!1),u=o||l?.projectName,d=a||l?.packageName,p=s||l?.versionId;if(!u||!d)throw new Error("No project or package name provided. Must be set in props or via PackageProvider");const{data:h,isSuccess:g,isError:y,error:b}=Jr({queryKey:["queryResult",u,d,e,p,t,n,r],queryFn:x=>Mie.executeQuery(u,d,e,t,n,r,p,x)});return v.jsxs(v.Fragment,{children:[!g&&!y&&v.jsx(Zr,{text:"Fetching Query Results..."}),g&&v.jsx(k.Suspense,{fallback:v.jsx("div",{children:"Loading..."}),children:v.jsx(Lie,{result:h.data.result})}),y&&v.jsx($r,{context:`${u} > ${d} > ${e}`,error:b})]})}const CL=Rn(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"})),Bie=k.lazy(()=>G(()=>import("./RenderedResult-BAZuT25g-_eLjVkSo.js"),[]));function _L({result:e,minHeight:t,maxHeight:n}){const[r,o]=k.useState(!1),[a,s]=k.useState(0),[l,u]=k.useState(!1),d=k.useRef(null),p=k.useRef(null),[h,g]=k.useState(void 0),[y,b]=k.useState(!1),x=k.useCallback(()=>{const R=r;o(!r),R&&p.current&&setTimeout(()=>{p.current?.scrollIntoView({behavior:"smooth",block:"start"})},100)},[r]),S=k.useCallback(R=>{s(R)},[]);if(k.useEffect(()=>{if(y){u(!0);return}if(a===0){u(!1);return}const R=t-20,I=a>R;a<R&&g(a+20),u(I)},[a,y,t]),!e)return null;const T=v.jsx(Zr,{text:"Loading...",centered:!0,size:32}),D=y?r?n-40:t-40:void 0,w=h?{minHeight:`${h}px`,height:"100%"}:{height:"100%"};return v.jsx(v.Fragment,{children:v.jsxs(Nt,{ref:p,sx:{position:"relative",minHeight:`${t}px`,maxHeight:`${r?n:t}px`,border:"0px",borderRadius:0,overflow:"hidden",display:"flex",flexDirection:"column",...w},children:[v.jsx(Nt,{ref:d,sx:{flex:1,overflow:r?"auto":"hidden",p:0,pb:l?"40px":1},children:e&&v.jsx(k.Suspense,{fallback:T,children:v.jsx(Bie,{result:e,height:D,isFillElement:R=>{b(R)},onSizeChange:S})})||T}),l&&v.jsx(Nt,{sx:{position:"absolute",bottom:0,left:0,right:0,height:"32px",backgroundColor:"rgba(255,255,255,0.75)",display:"flex",alignItems:"center",justifyContent:"center"},children:v.jsx(or,{size:"small",onClick:x,sx:{color:"text.secondary","&:hover":{backgroundColor:"rgba(0, 0, 0, 0.04)"}},title:r?"Collapse to original size":"Expand to full size",children:r?v.jsx(bJ,{sx:{fontSize:30}}):v.jsx(vJ,{sx:{fontSize:30}})})})]})})}const jie=`
|
|
266
|
+
`}));let S={type:"element",tagName:"span",properties:{class:"line"},children:[]},T=0;for(const D of b){let w={type:"element",tagName:"span",properties:{...D.htmlAttrs},children:[{type:"text",value:D.content}]};D.htmlStyle;const R=Fae(D.htmlStyle||cL(D));R&&(w.properties.style=R);for(const I of o)w=I?.span?.call(g,w,x+1,T,S,D)||w;l==="inline"?s.children.push(w):l==="classic"&&S.children.push(w),T+=D.content.length}if(l==="classic"){for(const D of o)S=D?.line?.call(g,S,x+1)||S;h.push(S),a.push(S)}}),l==="classic"){for(const b of o)p=b?.code?.call(g,p)||p;d.children.push(p);for(const b of o)d=b?.pre?.call(g,d)||d;s.children.push(d)}let y=s;for(const b of o)y=b?.root?.call(g,y)||y;return r&&hb(y,r),y}function aie(e){return e.map(t=>{const n=[];let r="",o=0;return t.forEach((a,s)=>{const l=!(a.fontStyle&&a.fontStyle&Qi.Underline);l&&a.content.match(/^\s+$/)&&t[s+1]?(o||(o=a.offset),r+=a.content):r?(l?n.push({...a,offset:o,content:r+a.content}):n.push({content:r,offset:o},a),o=0,r=""):n.push(a)}),n})}function iie(e){return e.map(t=>t.flatMap(n=>{if(n.content.match(/^\s+$/))return n;const r=n.content.match(/^(\s*)(.*?)(\s*)$/);if(!r)return n;const[,o,a,s]=r;if(!o&&!s)return n;const l=[{...n,offset:n.offset+o.length,content:a}];return o&&l.unshift({content:o,offset:n.offset}),s&&l.push({content:s,offset:n.offset+o.length+a.length}),l}))}function sie(e,t,n){const r={meta:{},options:n,codeToHast:(a,s)=>Yy(e,a,s),codeToTokens:(a,s)=>Wy(e,a,s)};let o=Iae(Yy(e,t,n,r));for(const a of Gy(n))o=a.postprocess?.call(r,o,n)||o;return o}const zI={light:"#333333",dark:"#bbbbbb"},$I={light:"#fffffe",dark:"#1e1e1e"},VI="__shiki_resolved";function wC(e){if(e?.[VI])return e;const t={...e};t.tokenColors&&!t.settings&&(t.settings=t.tokenColors,delete t.tokenColors),t.type||="dark",t.colorReplacements={...t.colorReplacements},t.settings||=[];let{bg:n,fg:r}=t;if(!n||!r){const l=t.settings?t.settings.find(u=>!u.name&&!u.scope):void 0;l?.settings?.foreground&&(r=l.settings.foreground),l?.settings?.background&&(n=l.settings.background),!r&&t?.colors?.["editor.foreground"]&&(r=t.colors["editor.foreground"]),!n&&t?.colors?.["editor.background"]&&(n=t.colors["editor.background"]),r||(r=t.type==="light"?zI.light:zI.dark),n||(n=t.type==="light"?$I.light:$I.dark),t.fg=r,t.bg=n}t.settings[0]&&t.settings[0].settings&&!t.settings[0].scope||t.settings.unshift({settings:{foreground:t.fg,background:t.bg}});let o=0;const a=new Map;function s(l){if(a.has(l))return a.get(l);o+=1;const u=`#${o.toString(16).padStart(8,"0").toLowerCase()}`;return t.colorReplacements?.[`#${u}`]?s(l):(a.set(l,u),u)}t.settings=t.settings.map(l=>{const u=l.settings?.foreground&&!l.settings.foreground.startsWith("#"),d=l.settings?.background&&!l.settings.background.startsWith("#");if(!u&&!d)return l;const p={...l,settings:{...l.settings}};if(u){const h=s(l.settings.foreground);t.colorReplacements[h]=l.settings.foreground,p.settings.foreground=h}if(d){const h=s(l.settings.background);t.colorReplacements[h]=l.settings.background,p.settings.background=h}return p});for(const l of Object.keys(t.colors||{}))if((l==="editor.foreground"||l==="editor.background"||l.startsWith("terminal.ansi"))&&!t.colors[l]?.startsWith("#")){const u=s(t.colors[l]);t.colorReplacements[u]=t.colors[l],t.colors[l]=u}return Object.defineProperty(t,VI,{enumerable:!1,writable:!1,value:!0}),t}async function pL(e){return Array.from(new Set((await Promise.all(e.filter(t=>!aL(t)).map(async t=>await lL(t).then(n=>Array.isArray(n)?n:[n])))).flat()))}async function hL(e){return(await Promise.all(e.map(async t=>iL(t)?null:wC(await lL(t))))).filter(t=>!!t)}class lie extends Toe{constructor(t,n,r,o={}){super(t),this._resolver=t,this._themes=n,this._langs=r,this._alias=o,this._themes.map(a=>this.loadTheme(a)),this.loadLanguages(this._langs)}_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;getTheme(t){return typeof t=="string"?this._resolvedThemes.get(t):this.loadTheme(t)}loadTheme(t){const n=wC(t);return n.name&&(this._resolvedThemes.set(n.name,n),this._loadedThemesCache=null),n}getLoadedThemes(){return this._loadedThemesCache||(this._loadedThemesCache=[...this._resolvedThemes.keys()]),this._loadedThemesCache}setTheme(t){let n=this._textmateThemeCache.get(t);n||(n=By.createFromRawTheme(t),this._textmateThemeCache.set(t,n)),this._syncRegistry.setTheme(n)}getGrammar(t){if(this._alias[t]){const n=new Set([t]);for(;this._alias[t];){if(t=this._alias[t],n.has(t))throw new ao(`Circular alias \`${Array.from(n).join(" -> ")} -> ${t}\``);n.add(t)}}return this._resolvedGrammars.get(t)}loadLanguage(t){if(this.getGrammar(t.name))return;const n=new Set([...this._langMap.values()].filter(a=>a.embeddedLangsLazy?.includes(t.name)));this._resolver.addLanguage(t);const r={balancedBracketSelectors:t.balancedBracketSelectors||["*"],unbalancedBracketSelectors:t.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(t.scopeName,t);const o=this.loadGrammarWithConfiguration(t.scopeName,1,r);if(o.name=t.name,this._resolvedGrammars.set(t.name,o),t.aliases&&t.aliases.forEach(a=>{this._alias[a]=t.name}),this._loadedLanguagesCache=null,n.size)for(const a of n)this._resolvedGrammars.delete(a.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(a.scopeName),this._syncRegistry?._grammars?.delete(a.scopeName),this.loadLanguage(this._langMap.get(a.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(t){for(const o of t)this.resolveEmbeddedLanguages(o);const n=Array.from(this._langGraph.entries()),r=n.filter(([o,a])=>!a);if(r.length){const o=n.filter(([a,s])=>s&&s.embeddedLangs?.some(l=>r.map(([u])=>u).includes(l))).filter(a=>!r.includes(a));throw new ao(`Missing languages ${r.map(([a])=>`\`${a}\``).join(", ")}, required by ${o.map(([a])=>`\`${a}\``).join(", ")}`)}for(const[o,a]of n)this._resolver.addLanguage(a);for(const[o,a]of n)this.loadLanguage(a)}getLoadedLanguages(){return this._loadedLanguagesCache||(this._loadedLanguagesCache=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])]),this._loadedLanguagesCache}resolveEmbeddedLanguages(t){if(this._langMap.set(t.name,t),this._langGraph.set(t.name,t),t.embeddedLangs)for(const n of t.embeddedLangs)this._langGraph.set(n,this._langMap.get(n))}}class cie{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(t,n){this._onigLib={createOnigScanner:r=>t.createScanner(r),createOnigString:r=>t.createString(r)},n.forEach(r=>this.addLanguage(r))}get onigLib(){return this._onigLib}getLangRegistration(t){return this._langs.get(t)}loadGrammar(t){return this._scopeToLang.get(t)}addLanguage(t){this._langs.set(t.name,t),t.aliases&&t.aliases.forEach(n=>{this._langs.set(n,t)}),this._scopeToLang.set(t.scopeName,t),t.injectTo&&t.injectTo.forEach(n=>{this._injections.get(n)||this._injections.set(n,[]),this._injections.get(n).push(t.scopeName)})}getInjections(t){const n=t.split(".");let r=[];for(let o=1;o<=n.length;o++){const a=n.slice(0,o).join(".");r=[...r,...this._injections.get(a)||[]]}return r}}let zf=0;function uie(e){zf+=1,e.warnings!==!1&&zf>=10&&zf%10===0&&console.warn(`[Shiki] ${zf} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let t=!1;if(!e.engine)throw new ao("`engine` option is required for synchronous mode");const n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(wC),o=new cie(e.engine,n),a=new lie(o,r,n,e.langAlias);let s;function l(D){S();const w=a.getGrammar(typeof D=="string"?D:D.name);if(!w)throw new ao(`Language \`${D}\` not found, you may need to load it first`);return w}function u(D){if(D==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};S();const w=a.getTheme(D);if(!w)throw new ao(`Theme \`${D}\` not found, you may need to load it first`);return w}function d(D){S();const w=u(D);s!==D&&(a.setTheme(w),s=D);const R=a.getColorMap();return{theme:w,colorMap:R}}function p(){return S(),a.getLoadedThemes()}function h(){return S(),a.getLoadedLanguages()}function g(...D){S(),a.loadLanguages(D.flat(1))}async function y(...D){return g(await pL(D))}function b(...D){S();for(const w of D.flat(1))a.loadTheme(w)}async function x(...D){return S(),b(await hL(D))}function S(){if(t)throw new ao("Shiki instance has been disposed")}function T(){t||(t=!0,a.dispose(),zf-=1)}return{setTheme:d,getTheme:u,getLanguage:l,getLoadedThemes:p,getLoadedLanguages:h,loadLanguage:y,loadLanguageSync:g,loadTheme:x,loadThemeSync:b,dispose:T,[Symbol.dispose]:T}}async function die(e={}){e.loadWasm;const[t,n,r]=await Promise.all([hL(e.themes||[]),pL(e.langs||[]),e.engine||D4(e.loadWasm||Mre())]);return uie({...e,themes:t,langs:n,engine:r})}async function fie(e={}){const t=await die(e);return{getLastGrammarState:(...n)=>Qae(t,...n),codeToTokensBase:(n,r)=>kC(t,n,r),codeToTokensWithThemes:(n,r)=>fL(t,n,r),codeToTokens:(n,r)=>Wy(t,n,r),codeToHast:(n,r)=>Yy(t,n,r),codeToHtml:(n,r)=>sie(t,n,r),...t,getInternalContext:()=>t}}function pie(e,t,n){let r,o,a;{const l=e;r=l.langs,o=l.themes,a=l.engine}async function s(l){function u(y){if(typeof y=="string"){if(aL(y))return[];const b=r[y];if(!b)throw new ts(`Language \`${y}\` is not included in this bundle. You may want to load it from external source.`);return b}return y}function d(y){if(iL(y))return"none";if(typeof y=="string"){const b=o[y];if(!b)throw new ts(`Theme \`${y}\` is not included in this bundle. You may want to load it from external source.`);return b}return y}const p=(l.themes??[]).map(y=>d(y)),h=(l.langs??[]).map(y=>u(y)),g=await fie({engine:l.engine??a(),...l,themes:p,langs:h});return{...g,loadLanguage(...y){return g.loadLanguage(...y.map(u))},loadTheme(...y){return g.loadTheme(...y.map(d))}}}return s}const hie=pie({langs:gre,themes:bre,engine:()=>D4(G(()=>import("./wasm-DQxwEHae-CG6Dc4jp.js"),[]))}),DE={scopeName:"source.malloy",patterns:[{include:"#malloy-language"}],repository:{"malloy-language":{patterns:[{include:"#sql-string"},{include:"#comments"},{include:"#tags"},{include:"#strings"},{include:"#numbers"},{include:"#keywords"},{include:"#properties"},{include:"#functions"},{include:"#datetimes"},{include:"#identifiers-quoted"},{include:"#types"},{include:"#constants"},{include:"#timeframes"},{include:"#identifiers-unquoted"}]},"malloy-matched":{begin:"{",end:"}",patterns:[{include:"#malloy-matched"},{include:"#malloy-language"}]},"malloy-in-sql":{begin:"%{",name:"source.malloy-in-sql",end:"}%?",patterns:[{include:"#malloy-matched"},{include:"#malloy-language"}]},"sql-string":{patterns:[{begin:'(\\b[A-Za-z_][A-Za-z_0-9]*)(\\s*\\.\\s*)(sql)(\\s*\\(\\s*)(""")',end:'"""',beginCaptures:{1:{name:"variable.other"},3:{name:"keyword.control.sql"},5:{name:"punctuation.sql-block.open"}},endCaptures:{0:{name:"punctuation.sql-block.close"}},name:"source.sql",patterns:[{include:"#malloy-in-sql"},{include:"source.sql"}]}]},functions:{patterns:[{match:"(?i)\\b(count)(\\s*\\()(distinct)",captures:{1:{name:"entity.name.function"},3:{name:"entity.name.function.modifier"}}},{match:"(?i)\\b(AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE|UNGROUPED)(\\s*\\()",captures:{1:{name:"entity.name.function"}}},{match:"(?i)\\b([a-zA-Z_][a-zA-Z_0-9]*)(\\s*\\()",captures:{1:{name:"entity.name.function"}}},{match:"(?i)\\b([a-zA-Z_][a-zA-Z_0-9]*)(!)(timestamp|number|string|boolean|date)?(\\s*\\()",captures:{1:{name:"entity.name.function"},3:{name:"entity.name.type"}}}]},datetimes:{patterns:[{match:"(?i)@[0-9]{4}-[0-9]{2}-[0-9]{2}[ T][0-9]{2}:[0-9]{2}((:[0-9]{2})(([\\.,][0-9]+)(\\[[A-Za-z_/]+\\])?)?)?",name:"constant.numeric.timestamp"},{match:"(?i)@[0-9]{4}(-Q[1-4]|-[0-9]{2}(-[0-9]{2}(-WK)?)?)?",name:"constant.numeric.date"}]},"identifiers-quoted":{patterns:[{match:"`[^`]*`",name:"variable.other.quoted"}]},"identifiers-unquoted":{patterns:[{match:"(?i)\\b[A-Za-z_][A-Za-z_0-9]*\\b",name:"variable.other"}]},timeframes:{patterns:[{match:"(?i)\\b((year|quarter|month|week|day|hour|minute|second)s?)\\b",name:"keyword.other.timeframe"},{match:"(?i)\\b(day_of_year|day_of_month)\\b",name:"keyword.other.timeframe"}]},comments:{patterns:[{begin:"/\\*",end:"\\*/",beginCaptures:{0:{name:"punctuation.definition.comment.begin"}},endCaptures:{0:{name:"punctuation.definition.comment.end"}},name:"comment.block"},{begin:"//",end:"\\n",beginCaptures:{0:{name:"punctuation.definition.comment"}},name:"comment.line.double-slash"},{begin:"--",end:"\\n",beginCaptures:{0:{name:"punctuation.definition.comment"}},name:"comment.line.double-hyphen"}]},tags:{patterns:[{match:"##\\n",name:"string.quoted",captures:{0:{name:"string.quoted"}}},{begin:'#"',end:"\\n",beginCaptures:{0:{name:"punctuation.definition.comment"}},name:"comment.line.double-slash"},{match:"#\\n",name:"string.quoted",captures:{0:{name:"string.quoted"}}},{begin:"#\\s",end:"\\n",beginCaptures:{0:{name:"support.type.property-name.json"}},name:"comment.line.double-slash",patterns:[{include:"#tag-values"}]},{begin:"##\\s",end:"\\n",beginCaptures:{0:{name:"support.type.property-name.json"}},name:"comment.line.double-slash",patterns:[{include:"#tag-values"}]},{begin:"#",end:"\\n",beginCaptures:{0:{name:"string.quoted"}},name:"string.quoted"}],repository:{"tag-values":{name:"support.type.property-name.json",match:'(-)?((?:[^\\s=#]+)|(?:"[^#]+"))(?:\\s*(=)\\s*((?:[^\\s=#]+)|(?:"[^#]+")))?',captures:{1:{name:"keyword.control.negate"},2:{name:"support.type.property-name.json"},3:{name:"keyword.operator.comparison.ts"},4:{name:"string.quoted"}}}}},strings:{patterns:[{begin:"'",end:"'",beginCaptures:{0:{name:"punctuation.definition.string.begin"}},endCaptures:{0:{name:"punctuation.definition.string.end"}},name:"string.quoted.single",patterns:[{include:"#escapes"}]},{begin:'"',end:'"',beginCaptures:{0:{name:"punctuation.definition.string.begin"}},endCaptures:{0:{name:"punctuation.definition.string.end"}},name:"string.quoted.double",patterns:[{include:"#escapes"}]},{begin:'"""',end:'"""',beginCaptures:{0:{name:"punctuation.definition.string.begin"}},endCaptures:{0:{name:"punctuation.definition.string.end"}},name:"string.quoted.triple"},{begin:"(?i)[r|/]'",end:"'",name:"string.regexp",patterns:[{include:"#regex-escapes"}]}],repository:{escapes:{name:"constant.character.escape",match:"\\\\(u[A-Fa-f0-9]{4}|.)",captures:{0:{name:"constant.character.escape"}}},"regex-escapes":{name:"constant.character.escape",match:"\\\\.",captures:{0:{name:"constant.character.escape"}}}}},numbers:{match:"(?i)(\\b((0|[1-9][0-9]*)(E[+-]?[0-9]+|\\.[0-9]*)?)|\\.[0-9]+)",name:"constant.numeric"},constants:{patterns:[{match:"(?i)\\bnull\\b",name:"constant.language.null"},{match:"(?i)\\btrue\\b",name:"constant.language.true"},{match:"(?i)\\bfalse\\b",name:"constant.language.false"}]},types:{patterns:[{match:"(?i)\\bstring\\b",name:"entity.name.type.string"},{match:"(?i)\\bnumber\\b",name:"entity.name.type.number"},{match:"(?i)\\bdate\\b",name:"entity.name.type.date"},{match:"(?i)\\btimestamp\\b",name:"entity.name.type.timestamp"},{match:"(?i)\\bboolean\\b",name:"entity.name.type.boolean"}]},properties:{patterns:[{match:"(?i)\\baccept\\b",name:"keyword.control.accept"},{match:"(?i)\\bselect\\b",name:"keyword.control.select"},{match:"(?i)\\bconnection\\b",name:"keyword.control.connection"},{match:"(?i)\\brun\\b",name:"keyword.control.run"},{match:"(?i)\\bextend\\b",name:"keyword.control.extend"},{match:"(?i)\\brefine\\b",name:"keyword.control.refine"},{match:"(?i)\\baggregate\\b",name:"keyword.control.aggregate"},{match:"(?i)\\bsample\\b",name:"keyword.control.sample"},{match:"(?i)\\bcalculate\\b",name:"keyword.control.calculate"},{match:"(?i)\\btimezone\\b",name:"keyword.control.timezone"},{match:"(?i)\\bdimension\\b",name:"keyword.control.dimension"},{match:"(?i)\\bexcept\\b",name:"keyword.control.except"},{match:"(?i)\\bsource\\b",name:"keyword.control.source"},{match:"(?i)\\bgroup_by\\b",name:"keyword.control.group_by"},{match:"(?i)\\bhaving\\b",name:"keyword.control.having"},{match:"(?i)\\bindex\\b",name:"keyword.control.index"},{match:"(?i)\\bjoin_one\\b",name:"keyword.control.join_one"},{match:"(?i)\\bwith\\b",name:"keyword.control.with"},{match:"(?i)\\bjoin_many\\b",name:"keyword.control.join_many"},{match:"(?i)\\bjoin_cross\\b",name:"keyword.control.join_cross"},{match:"(?i)\\blimit\\b",name:"keyword.control.limit"},{match:"(?i)\\bmeasure\\b",name:"keyword.control.measure"},{match:"(?i)\\bnest\\b",name:"keyword.control.nest"},{match:"(?i)\\border_by\\b",name:"keyword.control.order_by"},{match:"(?i)\\bpartition_by\\b",name:"keyword.control.partition_by"},{match:"(?i)\\bprimary_key\\b",name:"keyword.control.primary_key"},{match:"(?i)\\bproject\\b",name:"keyword.control.project"},{match:"(?i)\\bquery\\b",name:"keyword.control.query"},{match:"(?i)\\brename\\b",name:"keyword.control.rename"},{match:"(?i)\\btop\\b",name:"keyword.control.top"},{match:"(?i)\\bview\\b",name:"keyword.control.view"},{match:"(?i)\\bwhere\\b",name:"keyword.control.where"},{match:"(?i)\\bdeclare\\b",name:"keyword.control.declare"}]},keywords:{patterns:[{match:"(?i)\\bis\\b",name:"keyword.control.is"},{match:"(?i)\\bon\\b",name:"keyword.control.on"},{match:"(?i)\\bnot\\b",name:"keyword.other.not"},{match:"(?i)\\bor\\b",name:"keyword.other.or"},{match:"(?i)\\bdesc\\b",name:"keyword.control.desc"},{match:"(?i)\\bby\\b",name:"keyword.control.by"},{match:"(?i)\\band\\b",name:"keyword.other.and"},{match:"(?i)\\basc\\b",name:"keyword.control.asc"},{match:"(?i)\\bfor\\b",name:"keyword.other.for"},{match:"(?i)\\belse\\b",name:"keyword.other.else"},{match:"(?i)\\bto\\b",name:"keyword.other.to"},{match:"(?i)\\bwhen\\b",name:"keyword.other.when"},{match:"(?i)\\bpick\\b",name:"keyword.other.pick"},{match:"(?i)\\bimport\\b",name:"keyword.control.import"}]}}},mie={...DE,patterns:[...DE.patterns,{include:"#docvar"}],repository:{...DE.repository,docvar:{patterns:[{match:"\\<\\<[^(\\>\\>)]*\\>\\>",beginCaptures:{0:{name:"punctuation.definition.comment.begin"}},endCaptures:{0:{name:"punctuation.definition.comment.end"}},name:"markup.italic.markdown"}]}}},gie={name:"Malloy SQL",scopeName:"source.malloy-sql",patterns:[{include:"#malloysql-sql"}],repository:{"malloysql-sql":{beginCaptures:{0:{name:"entity.other.attribute.malloy-sql"},1:{name:"entity.other.attribute.malloy-sql"},3:{name:"comment.line.double-slash"}},name:"meta.embedded.block.malloysql.sql",patterns:[{include:"#comments"},{begin:"%{",end:"}%",beginCaptures:{0:{name:"punctuation.definition.malloy-sql"}},endCaptures:{0:{name:"punctuation.definition.malloy-sql"}},name:"meta.embedded.block.malloy",patterns:[{include:"source.malloy"}]},{include:"source.sql"}]},comments:{patterns:[{begin:"/\\*",end:"\\*/",beginCaptures:{0:{name:"punctuation.definition.comment.begin"}},endCaptures:{0:{name:"punctuation.definition.comment.end"}},name:"comment.block"},{begin:"//",end:"\\n",beginCaptures:{0:{name:"punctuation.definition.comment"}},name:"comment.line.double-slash"},{begin:"--",end:"\\n",beginCaptures:{0:{name:"punctuation.definition.comment"}},name:"comment.line.double-hyphen"}]}}},mL="catppuccin-latte",yie=hie({themes:[mL],langs:["sql","json","typescript",{name:"malloy",scopeName:"source.malloy",embeddedLangs:["sql"],...mie},{name:"malloysql",scopeName:"source.malloy-sql",embeddedLangs:["sql"],...gie}]});async function ac(e,t){return(await yie).codeToHtml(e,{lang:t,theme:mL})}const Ar=ke(bu)({display:"flex",flexDirection:"column",height:"100%"}),Ko=ke(vu)({display:"flex",flexDirection:"column",padding:"10px",flexGrow:1}),DC=ke(uq)({padding:"10px"}),bie=ke("div")({height:"100%"});ke("div")({height:"30px",backgroundColor:"rgba(225, 240, 255, 1)",display:"flex",padding:"4px",alignItems:"center"});const gL=ke("div")({height:"75vh",width:"100%",overflowY:"auto"});ke("div")({position:"relative",height:"100%",flex:"0 0 auto"});function $r({error:e,context:t}){const n=e.data?.message||"Unknown Error";return v.jsxs(v.Fragment,{children:[t&&v.jsx(He,{variant:"body2",sx:{p:"10px",m:"auto"},children:t}),v.jsx("pre",{style:{whiteSpace:"pre-wrap",color:"red",padding:"10px",margin:"auto"},children:n})]})}function Zr({text:e,size:t=20,color:n="primary",thickness:r=3.6,centered:o=!0,spacing:a=2,textVariant:s="body2"}){const l=v.jsxs(Nt,{sx:{display:"flex",flexDirection:"column",alignItems:"center",gap:a},children:[v.jsx(ES,{size:t,color:n,thickness:r}),e&&v.jsx(He,{variant:s,color:"text.secondary",children:e})]});return o?v.jsx(Nt,{sx:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:"200px",width:"100%"},children:l}):l}const vie=Rn([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-2m0 16H5V5h14z"},"0"),v.jsx("path",{d:"M7 12h2v5H7zm8-5h2v10h-2zm-4 7h2v3h-2zm0-4h2v2h-2z"},"1")]),wn="http://localhost/api/v0".replace(/\/+$/,"");class al{constructor(t,n=wn,r=Rt){this.basePath=n,this.axios=r,t&&(this.configuration=t,this.basePath=t.basePath??n)}configuration}class Eie extends Error{constructor(t,n){super(n),this.field=t,this.name="RequiredError"}}const Pn={},Ln="https://example.com",St=function(e,t,n){if(n==null)throw new Eie(t,`Required parameter ${t} was null or undefined when calling ${e}.`)};function pT(e,t,n=""){t!=null&&(typeof t=="object"?Array.isArray(t)?t.forEach(r=>pT(e,r,n)):Object.keys(t).forEach(r=>pT(e,t[r],`${n}${n!==""?".":""}${r}`)):e.has(n)?e.append(n,t):e.set(n,t))}const Mn=function(e,...t){const n=new URLSearchParams(e.search);pT(n,t),e.search=n.toString()},Ky=function(e,t,n){const r=typeof e!="string";return(r&&n&&n.isJsonMime?n.isJsonMime(t.headers["Content-Type"]):r)?JSON.stringify(e!==void 0?e:{}):e||""},Fn=function(e){return e.pathname+e.search+e.hash},Bn=function(e,t,n,r){return(o=t,a=n)=>{const s={...e.options,url:(o.defaults.baseURL?"":r?.basePath??a)+e.url};return o.request(s)}},xie=function(e){return{getConnection:async(t,n,r={})=>{St("getConnection","projectName",t),St("getConnection","connectionName",n);const o="/projects/{projectName}/connections/{connectionName}".replace("{projectName}",encodeURIComponent(String(t))).replace("{connectionName}",encodeURIComponent(String(n))),a=new URL(o,Ln);let s;e&&(s=e.baseOptions);const l={method:"GET",...s,...r},u={};Mn(a,{});let d=s&&s.headers?s.headers:{};return l.headers={...u,...d,...r.headers},{url:Fn(a),options:l}},getQuerydata:async(t,n,r,o,a={})=>{St("getQuerydata","projectName",t),St("getQuerydata","connectionName",n);const s="/projects/{projectName}/connections/{connectionName}/queryData".replace("{projectName}",encodeURIComponent(String(t))).replace("{connectionName}",encodeURIComponent(String(n))),l=new URL(s,Ln);let u;e&&(u=e.baseOptions);const d={method:"GET",...u,...a},p={},h={};r!==void 0&&(h.sqlStatement=r),o!==void 0&&(h.options=o),Mn(l,h);let g=u&&u.headers?u.headers:{};return d.headers={...p,...g,...a.headers},{url:Fn(l),options:d}},getSqlsource:async(t,n,r,o={})=>{St("getSqlsource","projectName",t),St("getSqlsource","connectionName",n);const a="/projects/{projectName}/connections/{connectionName}/sqlSource".replace("{projectName}",encodeURIComponent(String(t))).replace("{connectionName}",encodeURIComponent(String(n))),s=new URL(a,Ln);let l;e&&(l=e.baseOptions);const u={method:"GET",...l,...o},d={},p={};r!==void 0&&(p.sqlStatement=r),Mn(s,p);let h=l&&l.headers?l.headers:{};return u.headers={...d,...h,...o.headers},{url:Fn(s),options:u}},getTablesource:async(t,n,r,o,a={})=>{St("getTablesource","projectName",t),St("getTablesource","connectionName",n);const s="/projects/{projectName}/connections/{connectionName}/tableSource".replace("{projectName}",encodeURIComponent(String(t))).replace("{connectionName}",encodeURIComponent(String(n))),l=new URL(s,Ln);let u;e&&(u=e.baseOptions);const d={method:"GET",...u,...a},p={},h={};r!==void 0&&(h.tableKey=r),o!==void 0&&(h.tablePath=o),Mn(l,h);let g=u&&u.headers?u.headers:{};return d.headers={...p,...g,...a.headers},{url:Fn(l),options:d}},getTemporarytable:async(t,n,r,o={})=>{St("getTemporarytable","projectName",t),St("getTemporarytable","connectionName",n);const a="/projects/{projectName}/connections/{connectionName}/temporaryTable".replace("{projectName}",encodeURIComponent(String(t))).replace("{connectionName}",encodeURIComponent(String(n))),s=new URL(a,Ln);let l;e&&(l=e.baseOptions);const u={method:"GET",...l,...o},d={},p={};r!==void 0&&(p.sqlStatement=r),Mn(s,p);let h=l&&l.headers?l.headers:{};return u.headers={...d,...h,...o.headers},{url:Fn(s),options:u}},getTest:async(t,n,r={})=>{St("getTest","projectName",t),St("getTest","connectionName",n);const o="/projects/{projectName}/connections/{connectionName}/test".replace("{projectName}",encodeURIComponent(String(t))).replace("{connectionName}",encodeURIComponent(String(n))),a=new URL(o,Ln);let s;e&&(s=e.baseOptions);const l={method:"GET",...s,...r},u={};Mn(a,{});let d=s&&s.headers?s.headers:{};return l.headers={...u,...d,...r.headers},{url:Fn(a),options:l}},listConnections:async(t,n={})=>{St("listConnections","projectName",t);const r="/projects/{projectName}/connections".replace("{projectName}",encodeURIComponent(String(t))),o=new URL(r,Ln);let a;e&&(a=e.baseOptions);const s={method:"GET",...a,...n},l={};Mn(o,{});let u=a&&a.headers?a.headers:{};return s.headers={...l,...u,...n.headers},{url:Fn(o),options:s}},listSchemas:async(t,n,r={})=>{St("listSchemas","projectName",t),St("listSchemas","connectionName",n);const o="/projects/{projectName}/connections/{connectionName}/schemas".replace("{projectName}",encodeURIComponent(String(t))).replace("{connectionName}",encodeURIComponent(String(n))),a=new URL(o,Ln);let s;e&&(s=e.baseOptions);const l={method:"GET",...s,...r},u={};Mn(a,{});let d=s&&s.headers?s.headers:{};return l.headers={...u,...d,...r.headers},{url:Fn(a),options:l}},listTables:async(t,n,r,o={})=>{St("listTables","projectName",t),St("listTables","connectionName",n),St("listTables","schemaName",r);const a="/projects/{projectName}/connections/{connectionName}/schemas/{schemaName}/tables".replace("{projectName}",encodeURIComponent(String(t))).replace("{connectionName}",encodeURIComponent(String(n))).replace("{schemaName}",encodeURIComponent(String(r))),s=new URL(a,Ln);let l;e&&(l=e.baseOptions);const u={method:"GET",...l,...o},d={};Mn(s,{});let p=l&&l.headers?l.headers:{};return u.headers={...d,...p,...o.headers},{url:Fn(s),options:u}}}},zi=function(e){const t=xie(e);return{async getConnection(n,r,o){const a=await t.getConnection(n,r,o),s=e?.serverIndex??0,l=Pn["ConnectionsApi.getConnection"]?.[s]?.url;return(u,d)=>Bn(a,Rt,wn,e)(u,l||d)},async getQuerydata(n,r,o,a,s){const l=await t.getQuerydata(n,r,o,a,s),u=e?.serverIndex??0,d=Pn["ConnectionsApi.getQuerydata"]?.[u]?.url;return(p,h)=>Bn(l,Rt,wn,e)(p,d||h)},async getSqlsource(n,r,o,a){const s=await t.getSqlsource(n,r,o,a),l=e?.serverIndex??0,u=Pn["ConnectionsApi.getSqlsource"]?.[l]?.url;return(d,p)=>Bn(s,Rt,wn,e)(d,u||p)},async getTablesource(n,r,o,a,s){const l=await t.getTablesource(n,r,o,a,s),u=e?.serverIndex??0,d=Pn["ConnectionsApi.getTablesource"]?.[u]?.url;return(p,h)=>Bn(l,Rt,wn,e)(p,d||h)},async getTemporarytable(n,r,o,a){const s=await t.getTemporarytable(n,r,o,a),l=e?.serverIndex??0,u=Pn["ConnectionsApi.getTemporarytable"]?.[l]?.url;return(d,p)=>Bn(s,Rt,wn,e)(d,u||p)},async getTest(n,r,o){const a=await t.getTest(n,r,o),s=e?.serverIndex??0,l=Pn["ConnectionsApi.getTest"]?.[s]?.url;return(u,d)=>Bn(a,Rt,wn,e)(u,l||d)},async listConnections(n,r){const o=await t.listConnections(n,r),a=e?.serverIndex??0,s=Pn["ConnectionsApi.listConnections"]?.[a]?.url;return(l,u)=>Bn(o,Rt,wn,e)(l,s||u)},async listSchemas(n,r,o){const a=await t.listSchemas(n,r,o),s=e?.serverIndex??0,l=Pn["ConnectionsApi.listSchemas"]?.[s]?.url;return(u,d)=>Bn(a,Rt,wn,e)(u,l||d)},async listTables(n,r,o,a){const s=await t.listTables(n,r,o,a),l=e?.serverIndex??0,u=Pn["ConnectionsApi.listTables"]?.[l]?.url;return(d,p)=>Bn(s,Rt,wn,e)(d,u||p)}}};class yL extends al{getConnection(t,n,r){return zi(this.configuration).getConnection(t,n,r).then(o=>o(this.axios,this.basePath))}getQuerydata(t,n,r,o,a){return zi(this.configuration).getQuerydata(t,n,r,o,a).then(s=>s(this.axios,this.basePath))}getSqlsource(t,n,r,o){return zi(this.configuration).getSqlsource(t,n,r,o).then(a=>a(this.axios,this.basePath))}getTablesource(t,n,r,o,a){return zi(this.configuration).getTablesource(t,n,r,o,a).then(s=>s(this.axios,this.basePath))}getTemporarytable(t,n,r,o){return zi(this.configuration).getTemporarytable(t,n,r,o).then(a=>a(this.axios,this.basePath))}getTest(t,n,r){return zi(this.configuration).getTest(t,n,r).then(o=>o(this.axios,this.basePath))}listConnections(t,n){return zi(this.configuration).listConnections(t,n).then(r=>r(this.axios,this.basePath))}listSchemas(t,n,r){return zi(this.configuration).listSchemas(t,n,r).then(o=>o(this.axios,this.basePath))}listTables(t,n,r,o){return zi(this.configuration).listTables(t,n,r,o).then(a=>a(this.axios,this.basePath))}}const Tie=function(e){return{listDatabases:async(t,n,r,o={})=>{St("listDatabases","projectName",t),St("listDatabases","packageName",n);const a="/projects/{projectName}/packages/{packageName}/databases".replace("{projectName}",encodeURIComponent(String(t))).replace("{packageName}",encodeURIComponent(String(n))),s=new URL(a,Ln);let l;e&&(l=e.baseOptions);const u={method:"GET",...l,...o},d={},p={};r!==void 0&&(p.versionId=r),Mn(s,p);let h=l&&l.headers?l.headers:{};return u.headers={...d,...h,...o.headers},{url:Fn(s),options:u}}}},Sie=function(e){const t=Tie(e);return{async listDatabases(n,r,o,a){const s=await t.listDatabases(n,r,o,a),l=e?.serverIndex??0,u=Pn["DatabasesApi.listDatabases"]?.[l]?.url;return(d,p)=>Bn(s,Rt,wn,e)(d,u||p)}}};class Cie extends al{listDatabases(t,n,r,o){return Sie(this.configuration).listDatabases(t,n,r,o).then(a=>a(this.axios,this.basePath))}}const _ie=function(e){return{getModel:async(t,n,r,o,a={})=>{St("getModel","projectName",t),St("getModel","packageName",n),St("getModel","path",r);const s="/projects/{projectName}/packages/{packageName}/models/{path}".replace("{projectName}",encodeURIComponent(String(t))).replace("{packageName}",encodeURIComponent(String(n))).replace("{path}",encodeURIComponent(String(r))),l=new URL(s,Ln);let u;e&&(u=e.baseOptions);const d={method:"GET",...u,...a},p={},h={};o!==void 0&&(h.versionId=o),Mn(l,h);let g=u&&u.headers?u.headers:{};return d.headers={...p,...g,...a.headers},{url:Fn(l),options:d}},listModels:async(t,n,r,o={})=>{St("listModels","projectName",t),St("listModels","packageName",n);const a="/projects/{projectName}/packages/{packageName}/models".replace("{projectName}",encodeURIComponent(String(t))).replace("{packageName}",encodeURIComponent(String(n))),s=new URL(a,Ln);let l;e&&(l=e.baseOptions);const u={method:"GET",...l,...o},d={},p={};r!==void 0&&(p.versionId=r),Mn(s,p);let h=l&&l.headers?l.headers:{};return u.headers={...d,...h,...o.headers},{url:Fn(s),options:u}}}},GI=function(e){const t=_ie(e);return{async getModel(n,r,o,a,s){const l=await t.getModel(n,r,o,a,s),u=e?.serverIndex??0,d=Pn["ModelsApi.getModel"]?.[u]?.url;return(p,h)=>Bn(l,Rt,wn,e)(p,d||h)},async listModels(n,r,o,a){const s=await t.listModels(n,r,o,a),l=e?.serverIndex??0,u=Pn["ModelsApi.listModels"]?.[l]?.url;return(d,p)=>Bn(s,Rt,wn,e)(d,u||p)}}};class mb extends al{getModel(t,n,r,o,a){return GI(this.configuration).getModel(t,n,r,o,a).then(s=>s(this.axios,this.basePath))}listModels(t,n,r,o){return GI(this.configuration).listModels(t,n,r,o).then(a=>a(this.axios,this.basePath))}}const Aie=function(e){return{getNotebook:async(t,n,r,o,a={})=>{St("getNotebook","projectName",t),St("getNotebook","packageName",n),St("getNotebook","path",r);const s="/projects/{projectName}/packages/{packageName}/notebooks/{path}".replace("{projectName}",encodeURIComponent(String(t))).replace("{packageName}",encodeURIComponent(String(n))).replace("{path}",encodeURIComponent(String(r))),l=new URL(s,Ln);let u;e&&(u=e.baseOptions);const d={method:"GET",...u,...a},p={},h={};o!==void 0&&(h.versionId=o),Mn(l,h);let g=u&&u.headers?u.headers:{};return d.headers={...p,...g,...a.headers},{url:Fn(l),options:d}},listNotebooks:async(t,n,r,o={})=>{St("listNotebooks","projectName",t),St("listNotebooks","packageName",n);const a="/projects/{projectName}/packages/{packageName}/notebooks".replace("{projectName}",encodeURIComponent(String(t))).replace("{packageName}",encodeURIComponent(String(n))),s=new URL(a,Ln);let l;e&&(l=e.baseOptions);const u={method:"GET",...l,...o},d={},p={};r!==void 0&&(p.versionId=r),Mn(s,p);let h=l&&l.headers?l.headers:{};return u.headers={...d,...h,...o.headers},{url:Fn(s),options:u}}}},qI=function(e){const t=Aie(e);return{async getNotebook(n,r,o,a,s){const l=await t.getNotebook(n,r,o,a,s),u=e?.serverIndex??0,d=Pn["NotebooksApi.getNotebook"]?.[u]?.url;return(p,h)=>Bn(l,Rt,wn,e)(p,d||h)},async listNotebooks(n,r,o,a){const s=await t.listNotebooks(n,r,o,a),l=e?.serverIndex??0,u=Pn["NotebooksApi.listNotebooks"]?.[l]?.url;return(d,p)=>Bn(s,Rt,wn,e)(d,u||p)}}};class bL extends al{getNotebook(t,n,r,o,a){return qI(this.configuration).getNotebook(t,n,r,o,a).then(s=>s(this.axios,this.basePath))}listNotebooks(t,n,r,o){return qI(this.configuration).listNotebooks(t,n,r,o).then(a=>a(this.axios,this.basePath))}}const kie=function(e){return{createPackage:async(t,n,r={})=>{St("createPackage","projectName",t),St("createPackage","body",n);const o="/projects/{projectName}/packages".replace("{projectName}",encodeURIComponent(String(t))),a=new URL(o,Ln);let s;e&&(s=e.baseOptions);const l={method:"POST",...s,...r},u={},d={};u["Content-Type"]="application/json",Mn(a,d);let p=s&&s.headers?s.headers:{};return l.headers={...u,...p,...r.headers},l.data=Ky(n,l,e),{url:Fn(a),options:l}},deletePackage:async(t,n,r={})=>{St("deletePackage","projectName",t),St("deletePackage","packageName",n);const o="/projects/{projectName}/packages/{packageName}".replace("{projectName}",encodeURIComponent(String(t))).replace("{packageName}",encodeURIComponent(String(n))),a=new URL(o,Ln);let s;e&&(s=e.baseOptions);const l={method:"DELETE",...s,...r},u={};Mn(a,{});let d=s&&s.headers?s.headers:{};return l.headers={...u,...d,...r.headers},{url:Fn(a),options:l}},getPackage:async(t,n,r,o,a={})=>{St("getPackage","projectName",t),St("getPackage","packageName",n);const s="/projects/{projectName}/packages/{packageName}".replace("{projectName}",encodeURIComponent(String(t))).replace("{packageName}",encodeURIComponent(String(n))),l=new URL(s,Ln);let u;e&&(u=e.baseOptions);const d={method:"GET",...u,...a},p={},h={};r!==void 0&&(h.versionId=r),o!==void 0&&(h.reload=o),Mn(l,h);let g=u&&u.headers?u.headers:{};return d.headers={...p,...g,...a.headers},{url:Fn(l),options:d}},listPackages:async(t,n={})=>{St("listPackages","projectName",t);const r="/projects/{projectName}/packages".replace("{projectName}",encodeURIComponent(String(t))),o=new URL(r,Ln);let a;e&&(a=e.baseOptions);const s={method:"GET",...a,...n},l={};Mn(o,{});let u=a&&a.headers?a.headers:{};return s.headers={...l,...u,...n.headers},{url:Fn(o),options:s}},updatePackage:async(t,n,r,o={})=>{St("updatePackage","projectName",t),St("updatePackage","packageName",n),St("updatePackage","body",r);const a="/projects/{projectName}/packages/{packageName}".replace("{projectName}",encodeURIComponent(String(t))).replace("{packageName}",encodeURIComponent(String(n))),s=new URL(a,Ln);let l;e&&(l=e.baseOptions);const u={method:"PATCH",...l,...o},d={},p={};d["Content-Type"]="application/json",Mn(s,p);let h=l&&l.headers?l.headers:{};return u.headers={...d,...h,...o.headers},u.data=Ky(r,u,e),{url:Fn(s),options:u}}}},$f=function(e){const t=kie(e);return{async createPackage(n,r,o){const a=await t.createPackage(n,r,o),s=e?.serverIndex??0,l=Pn["PackagesApi.createPackage"]?.[s]?.url;return(u,d)=>Bn(a,Rt,wn,e)(u,l||d)},async deletePackage(n,r,o){const a=await t.deletePackage(n,r,o),s=e?.serverIndex??0,l=Pn["PackagesApi.deletePackage"]?.[s]?.url;return(u,d)=>Bn(a,Rt,wn,e)(u,l||d)},async getPackage(n,r,o,a,s){const l=await t.getPackage(n,r,o,a,s),u=e?.serverIndex??0,d=Pn["PackagesApi.getPackage"]?.[u]?.url;return(p,h)=>Bn(l,Rt,wn,e)(p,d||h)},async listPackages(n,r){const o=await t.listPackages(n,r),a=e?.serverIndex??0,s=Pn["PackagesApi.listPackages"]?.[a]?.url;return(l,u)=>Bn(o,Rt,wn,e)(l,s||u)},async updatePackage(n,r,o,a){const s=await t.updatePackage(n,r,o,a),l=e?.serverIndex??0,u=Pn["PackagesApi.updatePackage"]?.[l]?.url;return(d,p)=>Bn(s,Rt,wn,e)(d,u||p)}}};class vL extends al{createPackage(t,n,r){return $f(this.configuration).createPackage(t,n,r).then(o=>o(this.axios,this.basePath))}deletePackage(t,n,r){return $f(this.configuration).deletePackage(t,n,r).then(o=>o(this.axios,this.basePath))}getPackage(t,n,r,o,a){return $f(this.configuration).getPackage(t,n,r,o,a).then(s=>s(this.axios,this.basePath))}listPackages(t,n){return $f(this.configuration).listPackages(t,n).then(r=>r(this.axios,this.basePath))}updatePackage(t,n,r,o){return $f(this.configuration).updatePackage(t,n,r,o).then(a=>a(this.axios,this.basePath))}}const wie=function(e){return{createProject:async(t,n={})=>{St("createProject","body",t);const r="/projects",o=new URL(r,Ln);let a;e&&(a=e.baseOptions);const s={method:"POST",...a,...n},l={},u={};l["Content-Type"]="application/json",Mn(o,u);let d=a&&a.headers?a.headers:{};return s.headers={...l,...d,...n.headers},s.data=Ky(t,s,e),{url:Fn(o),options:s}},deleteProject:async(t,n={})=>{St("deleteProject","projectName",t);const r="/projects/{projectName}".replace("{projectName}",encodeURIComponent(String(t))),o=new URL(r,Ln);let a;e&&(a=e.baseOptions);const s={method:"DELETE",...a,...n},l={};Mn(o,{});let u=a&&a.headers?a.headers:{};return s.headers={...l,...u,...n.headers},{url:Fn(o),options:s}},getProject:async(t,n,r={})=>{St("getProject","projectName",t);const o="/projects/{projectName}".replace("{projectName}",encodeURIComponent(String(t))),a=new URL(o,Ln);let s;e&&(s=e.baseOptions);const l={method:"GET",...s,...r},u={},d={};n!==void 0&&(d.reload=n),Mn(a,d);let p=s&&s.headers?s.headers:{};return l.headers={...u,...p,...r.headers},{url:Fn(a),options:l}},listProjects:async(t={})=>{const n="/projects",r=new URL(n,Ln);let o;e&&(o=e.baseOptions);const a={method:"GET",...o,...t},s={};Mn(r,{});let l=o&&o.headers?o.headers:{};return a.headers={...s,...l,...t.headers},{url:Fn(r),options:a}},updateProject:async(t,n,r={})=>{St("updateProject","projectName",t),St("updateProject","body",n);const o="/projects/{projectName}".replace("{projectName}",encodeURIComponent(String(t))),a=new URL(o,Ln);let s;e&&(s=e.baseOptions);const l={method:"PATCH",...s,...r},u={},d={};u["Content-Type"]="application/json",Mn(a,d);let p=s&&s.headers?s.headers:{};return l.headers={...u,...p,...r.headers},l.data=Ky(n,l,e),{url:Fn(a),options:l}}}},Vf=function(e){const t=wie(e);return{async createProject(n,r){const o=await t.createProject(n,r),a=e?.serverIndex??0,s=Pn["ProjectsApi.createProject"]?.[a]?.url;return(l,u)=>Bn(o,Rt,wn,e)(l,s||u)},async deleteProject(n,r){const o=await t.deleteProject(n,r),a=e?.serverIndex??0,s=Pn["ProjectsApi.deleteProject"]?.[a]?.url;return(l,u)=>Bn(o,Rt,wn,e)(l,s||u)},async getProject(n,r,o){const a=await t.getProject(n,r,o),s=e?.serverIndex??0,l=Pn["ProjectsApi.getProject"]?.[s]?.url;return(u,d)=>Bn(a,Rt,wn,e)(u,l||d)},async listProjects(n){const r=await t.listProjects(n),o=e?.serverIndex??0,a=Pn["ProjectsApi.listProjects"]?.[o]?.url;return(s,l)=>Bn(r,Rt,wn,e)(s,a||l)},async updateProject(n,r,o){const a=await t.updateProject(n,r,o),s=e?.serverIndex??0,l=Pn["ProjectsApi.updateProject"]?.[s]?.url;return(u,d)=>Bn(a,Rt,wn,e)(u,l||d)}}};class EL extends al{createProject(t,n){return Vf(this.configuration).createProject(t,n).then(r=>r(this.axios,this.basePath))}deleteProject(t,n){return Vf(this.configuration).deleteProject(t,n).then(r=>r(this.axios,this.basePath))}getProject(t,n,r){return Vf(this.configuration).getProject(t,n,r).then(o=>o(this.axios,this.basePath))}listProjects(t){return Vf(this.configuration).listProjects(t).then(n=>n(this.axios,this.basePath))}updateProject(t,n,r){return Vf(this.configuration).updateProject(t,n,r).then(o=>o(this.axios,this.basePath))}}const Die=function(e){return{executeQuery:async(t,n,r,o,a,s,l,u={})=>{St("executeQuery","projectName",t),St("executeQuery","packageName",n),St("executeQuery","path",r);const d="/projects/{projectName}/packages/{packageName}/queryResults/{path}".replace("{projectName}",encodeURIComponent(String(t))).replace("{packageName}",encodeURIComponent(String(n))).replace("{path}",encodeURIComponent(String(r))),p=new URL(d,Ln);let h;e&&(h=e.baseOptions);const g={method:"GET",...h,...u},y={},b={};o!==void 0&&(b.query=o),a!==void 0&&(b.sourceName=a),s!==void 0&&(b.queryName=s),l!==void 0&&(b.versionId=l),Mn(p,b);let x=h&&h.headers?h.headers:{};return g.headers={...y,...x,...u.headers},{url:Fn(p),options:g}}}},Rie=function(e){const t=Die(e);return{async executeQuery(n,r,o,a,s,l,u,d){const p=await t.executeQuery(n,r,o,a,s,l,u,d),h=e?.serverIndex??0,g=Pn["QueryresultsApi.executeQuery"]?.[h]?.url;return(y,b)=>Bn(p,Rt,wn,e)(y,g||b)}}};class RC extends al{executeQuery(t,n,r,o,a,s,l,u){return Rie(this.configuration).executeQuery(t,n,r,o,a,s,l,u).then(d=>d(this.axios,this.basePath))}}const Iie=function(e){return{listSchedules:async(t,n,r,o={})=>{St("listSchedules","projectName",t),St("listSchedules","packageName",n);const a="/projects/{projectName}/packages/{packageName}/schedules".replace("{projectName}",encodeURIComponent(String(t))).replace("{packageName}",encodeURIComponent(String(n))),s=new URL(a,Ln);let l;e&&(l=e.baseOptions);const u={method:"GET",...l,...o},d={},p={};r!==void 0&&(p.versionId=r),Mn(s,p);let h=l&&l.headers?l.headers:{};return u.headers={...d,...h,...o.headers},{url:Fn(s),options:u}}}},Oie=function(e){const t=Iie(e);return{async listSchedules(n,r,o,a){const s=await t.listSchedules(n,r,o,a),l=e?.serverIndex??0,u=Pn["SchedulesApi.listSchedules"]?.[l]?.url;return(d,p)=>Bn(s,Rt,wn,e)(d,u||p)}}};class Nie extends al{listSchedules(t,n,r,o){return Oie(this.configuration).listSchedules(t,n,r,o).then(a=>a(this.axios,this.basePath))}}class Vr{apiKey;username;password;accessToken;basePath;serverIndex;baseOptions;formDataCtor;constructor(t={}){this.apiKey=t.apiKey,this.username=t.username,this.password=t.password,this.accessToken=t.accessToken,this.basePath=t.basePath,this.serverIndex=t.serverIndex,this.baseOptions={...t.baseOptions,headers:{...t.baseOptions?.headers}},this.formDataCtor=t.formDataCtor}isJsonMime(t){const n=new RegExp("^(application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(;.*)?$","i");return t!==null&&(n.test(t)||t.toLowerCase()==="application/json-patch+json")}}const xL=k.createContext(void 0),uh=({projectName:e,packageName:t,versionId:n,children:r})=>v.jsx(xL.Provider,{value:{projectName:e,packageName:t,versionId:n},children:r});function uo(e=!0){const t=k.useContext(xL);if(!t&&e)throw new Error("usePackage must be used within a PackageProvider");return t}const TL=new GX({defaultOptions:{queries:{retry:!1,throwOnError:!1},mutations:{retry:!1,throwOnError:!1}}}),IC=async(e,t)=>{const n=t?await t():void 0,r=n?{Authorization:`Bearer ${n}`}:{};return{baseURL:e,withCredentials:!!n,headers:r}};function Jr(e){const{server:t,getAccessToken:n}=zC(),r={...e,queryKey:[...e.queryKey,t],queryFn:async()=>{try{const o=await IC(t,n);return await e.queryFn(o)}catch(o){if(o&&typeof o=="object"&&"response"in o){const a=o;if(a.response?.data){const s=new Error(a.response.data.message||a.message);throw s.status=a.response.status,s.data=a.response.data,s}}throw o}},retry:!1,throwOnError:!1};return lZ(r,TL)}function Pie(e){const{server:t,getAccessToken:n}=zC(),r={...e,mutationFn:async o=>{try{const a=await IC(t,n);return await e.mutationFn(o,a)}catch(a){if(a&&typeof a=="object"&&"response"in a){const s=a;if(s.response?.data){const l=new Error(s.response.data.message||s.message);throw l.status=s.response.status,l.data=s.response.data,l}}throw a}},retry:!1,throwOnError:!1};return cZ(r,TL)}const Lie=k.lazy(()=>G(()=>import("./RenderedResult-BAZuT25g-BMU632YI.js"),[])),Mie=new RC(new Vr);function SL(e){const{optionalProjectName:t,optionalPackageName:n}=e;if(!t||!n)throw new Error("Project and Package name must be provided for query embedding.");return JSON.stringify({...e})}function Fie({modelPath:e,query:t,sourceName:n,queryName:r,optionalProjectName:o,optionalPackageName:a,optionalVersionId:s}){const l=uo(!1),u=o||l?.projectName,d=a||l?.packageName,p=s||l?.versionId;if(!u||!d)throw new Error("No project or package name provided. Must be set in props or via PackageProvider");const{data:h,isSuccess:g,isError:y,error:b}=Jr({queryKey:["queryResult",u,d,e,p,t,n,r],queryFn:x=>Mie.executeQuery(u,d,e,t,n,r,p,x)});return v.jsxs(v.Fragment,{children:[!g&&!y&&v.jsx(Zr,{text:"Fetching Query Results..."}),g&&v.jsx(k.Suspense,{fallback:v.jsx("div",{children:"Loading..."}),children:v.jsx(Lie,{result:h.data.result})}),y&&v.jsx($r,{context:`${u} > ${d} > ${e}`,error:b})]})}const CL=Rn(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"})),Bie=k.lazy(()=>G(()=>import("./RenderedResult-BAZuT25g-BMU632YI.js"),[]));function _L({result:e,minHeight:t,maxHeight:n}){const[r,o]=k.useState(!1),[a,s]=k.useState(0),[l,u]=k.useState(!1),d=k.useRef(null),p=k.useRef(null),[h,g]=k.useState(void 0),[y,b]=k.useState(!1),x=k.useCallback(()=>{const R=r;o(!r),R&&p.current&&setTimeout(()=>{p.current?.scrollIntoView({behavior:"smooth",block:"start"})},100)},[r]),S=k.useCallback(R=>{s(R)},[]);if(k.useEffect(()=>{if(y){u(!0);return}if(a===0){u(!1);return}const R=t-20,I=a>R;a<R&&g(a+20),u(I)},[a,y,t]),!e)return null;const T=v.jsx(Zr,{text:"Loading...",centered:!0,size:32}),D=y?r?n-40:t-40:void 0,w=h?{minHeight:`${h}px`,height:"100%"}:{height:"100%"};return v.jsx(v.Fragment,{children:v.jsxs(Nt,{ref:p,sx:{position:"relative",minHeight:`${t}px`,maxHeight:`${r?n:t}px`,border:"0px",borderRadius:0,overflow:"hidden",display:"flex",flexDirection:"column",...w},children:[v.jsx(Nt,{ref:d,sx:{flex:1,overflow:r?"auto":"hidden",p:0,pb:l?"40px":1},children:e&&v.jsx(k.Suspense,{fallback:T,children:v.jsx(Bie,{result:e,height:D,isFillElement:R=>{b(R)},onSizeChange:S})})||T}),l&&v.jsx(Nt,{sx:{position:"absolute",bottom:0,left:0,right:0,height:"32px",backgroundColor:"rgba(255,255,255,0.75)",display:"flex",alignItems:"center",justifyContent:"center"},children:v.jsx(or,{size:"small",onClick:x,sx:{color:"text.secondary","&:hover":{backgroundColor:"rgba(0, 0, 0, 0.04)"}},title:r?"Collapse to original size":"Expand to full size",children:r?v.jsx(bJ,{sx:{fontSize:30}}):v.jsx(vJ,{sx:{fontSize:30}})})})]})})}const jie=`
|
|
267
267
|
.code-display pre {
|
|
268
268
|
margin: 0;
|
|
269
269
|
padding: 0;
|
|
@@ -350,7 +350,7 @@ export default theme;`}function eT(e={},...t){const{breakpoints:n,mixins:r={},sp
|
|
|
350
350
|
`));if(o[g]!=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: "${g}"`].join(`
|
|
351
351
|
`));const y=n?n(d):d.label;if(y==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(`
|
|
352
352
|
`));o[g]={id:g,label:y,parentId:h,idAttribute:void 0,expandable:!!d.children?.length,disabled:t?t(d):!1,depth:p},a[g]=d;const b=h??Tu;s[b]||(s[b]=[]),s[b].push(g),d.children?.forEach(x=>l(x,p+1,g))};e.forEach(d=>l(d,0,null));const u={};return Object.keys(s).forEach(d=>{u[d]=ece(s[d])}),{itemMetaMap:o,itemMap:a,itemOrderedChildrenIds:s,itemChildrenIndexes:u}},Vh=({instance:e,params:t,state:n,setState:r,experimentalFeatures:o})=>{const a=k.useCallback(S=>n.items.itemMetaMap[S],[n.items.itemMetaMap]),s=k.useCallback(S=>n.items.itemMap[S],[n.items.itemMap]),l=k.useCallback(()=>{const S=T=>{const D=n.items.itemMap[T],w=Xi(D,tce),R=n.items.itemOrderedChildrenIds[T];return R&&(w.children=R.map(S)),w};return n.items.itemOrderedChildrenIds[Tu].map(S)},[n.items.itemMap,n.items.itemOrderedChildrenIds]),u=k.useCallback(S=>{if(S==null)return!1;let T=e.getItemMeta(S);if(!T)return!1;if(T.disabled)return!0;for(;T.parentId!=null;)if(T=e.getItemMeta(T.parentId),T.disabled)return!0;return!1},[e]),d=k.useCallback(S=>{const T=e.getItemMeta(S).parentId??Tu;return n.items.itemChildrenIndexes[T][S]},[e,n.items.itemChildrenIndexes]),p=k.useCallback(S=>n.items.itemOrderedChildrenIds[S??Tu]??[],[n.items.itemOrderedChildrenIds]),h=S=>{const T=e.getItemMeta(S);return T==null?null:document.getElementById(FC({treeId:n.id.treeId,itemId:S,id:T.idAttribute}))},g=S=>t.disabledItemsFocusable?!0:!e.isItemDisabled(S),y=k.useRef(!1),b=k.useCallback(()=>{y.current=!0},[]),x=k.useCallback(()=>y.current,[]);return k.useEffect(()=>{e.areItemUpdatesPrevented()||r(S=>{const T=QL({items:t.items,isItemDisabled:t.isItemDisabled,getItemId:t.getItemId,getItemLabel:t.getItemLabel});return Object.values(S.items.itemMetaMap).forEach(D=>{T.itemMetaMap[D.id]||Jle(e,"removeItem",{id:D.id})}),at({},S,{items:T})})},[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:s,getItemDOMElement:h,getItemTree:l,getItemOrderedChildrenIds:p},instance:{getItemMeta:a,getItem:s,getItemTree:l,getItemsToRender:()=>{const S=T=>{const D=n.items.itemMetaMap[T];return{label:D.label,itemId:D.id,id:D.idAttribute,children:n.items.itemOrderedChildrenIds[T]?.map(S)}};return n.items.itemOrderedChildrenIds[Tu].map(S)},getItemIndex:d,getItemDOMElement:h,getItemOrderedChildrenIds:p,isItemDisabled:u,isItemNavigable:g,preventItemUpdates:b,areItemUpdatesPrevented:x},contextValue:{items:{onItemClick:t.onItemClick,disabledItemsFocusable:t.disabledItemsFocusable,indentationAtItemLevel:o.indentationAtItemLevel??!1}}}};Vh.getInitialState=e=>({items:QL({items:e.items,isItemDisabled:e.isItemDisabled,getItemId:e.getItemId,getItemLabel:e.getItemLabel})});Vh.getDefaultizedParams=({params:e})=>at({},e,{disabledItemsFocusable:e.disabledItemsFocusable??!1,itemChildrenIndentation:e.itemChildrenIndentation??"12px"});Vh.wrapRoot=({children:e,instance:t})=>v.jsx(MC.Provider,{value:n=>t.getItemMeta(n)?.depth??0,children:e});Vh.params={disabledItemsFocusable:!0,items:!0,isItemDisabled:!0,getItemLabel:!0,getItemId:!0,onItemClick:!0,itemChildrenIndentation:!0};const nce=typeof window<"u"?k.useLayoutEffect:k.useEffect;function Pu(e){const t=k.useRef(e);return nce(()=>{t.current=e}),k.useRef((...n)=>(0,t.current)(...n)).current}const gb=({instance:e,params:t,models:n})=>{const r=k.useMemo(()=>{const h=new Map;return n.expandedItems.value.forEach(g=>{h.set(g,!0)}),h},[n.expandedItems.value]),o=(h,g)=>{t.onExpandedItemsChange?.(h,g),n.expandedItems.setControlledValue(g)},a=k.useCallback(h=>r.has(h),[r]),s=k.useCallback(h=>!!e.getItemMeta(h)?.expandable,[e]),l=Pu((h,g)=>{const y=e.isItemExpanded(g);e.setItemExpansion(h,g,!y)}),u=Pu((h,g,y)=>{if(e.isItemExpanded(g)===y)return;let b;y?b=[g].concat(n.expandedItems.value):b=n.expandedItems.value.filter(x=>x!==g),t.onItemExpansionToggle&&t.onItemExpansionToggle(h,g,y),o(h,b)}),d=(h,g)=>{const y=e.getItemMeta(g),b=e.getItemOrderedChildrenIds(y.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=k.useMemo(()=>t.expansionTrigger?t.expansionTrigger:e.isTreeViewEditable?"iconContainer":"content",[t.expansionTrigger,e.isTreeViewEditable]);return{publicAPI:{setItemExpansion:u},instance:{isItemExpanded:a,isItemExpandable:s,setItemExpansion:u,toggleItemExpansion:l,expandAllSiblings:d},contextValue:{expansion:{expansionTrigger:p}}}};gb.models={expandedItems:{getDefaultValue:e=>e.defaultExpandedItems}};const rce=[];gb.getDefaultizedParams=({params:e})=>at({},e,{defaultExpandedItems:e.defaultExpandedItems??rce});gb.params={expandedItems:!0,defaultExpandedItems:!0,onExpandedItemsChange:!0,onItemExpansionToggle:!0,expansionTrigger:!0};const ty=e=>Array.isArray(e)?e:e!=null?[e]:[],IE=e=>{const t={};return e.forEach(n=>{t[n]=!0}),t},yb=({instance:e,params:t,models:n})=>{const r=k.useRef(null),o=k.useRef({}),a=k.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]),s=(p,h)=>{if(t.onItemSelectionToggle)if(t.multiSelect){const g=h.filter(b=>!e.isItemSelected(b)),y=n.selectedItems.value.filter(b=>!h.includes(b));g.forEach(b=>{t.onItemSelectionToggle(p,b,!0)}),y.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:g=!1,shouldBeSelected:y})=>{if(t.disableSelection)return;let b;if(g){const x=ty(n.selectedItems.value),S=e.isItemSelected(h);S&&(y===!1||y==null)?b=x.filter(T=>T!==h):!S&&(y===!0||y==null)?b=[h].concat(x):b=x}else y===!1||y==null&&e.isItemSelected(h)?b=t.multiSelect?[]:null:b=t.multiSelect?[h]:h;s(p,b),r.current=h,o.current={}},d=(p,[h,g])=>{if(t.disableSelection||!t.multiSelect)return;let y=ty(n.selectedItems.value).slice();Object.keys(o.current).length>0&&(y=y.filter(T=>!o.current[T]));const b=IE(y),x=hle(e,h,g),S=x.filter(T=>!b[T]);y=y.concat(S),s(p,y),o.current=IE(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=mle(e);s(p,h),o.current=IE(h)},expandSelectionRange:(p,h)=>{if(r.current!=null){const[g,y]=zL(e,h,r.current);d(p,[g,y])}},selectRangeFromStartToItem:(p,h)=>{d(p,[fh(e),h])},selectRangeFromItemToEnd:(p,h)=>{d(p,[h,HL(e)])},selectItemFromArrowNavigation:(p,h,g)=>{if(t.disableSelection||!t.multiSelect)return;let y=ty(n.selectedItems.value).slice();Object.keys(o.current).length===0?(y.push(g),o.current={[h]:!0,[g]:!0}):(o.current[h]||(o.current={}),o.current[g]?(y=y.filter(b=>b!==h),delete o.current[h]):(y.push(g),o.current[g]=!0)),s(p,y)}},contextValue:{selection:{multiSelect:t.multiSelect,checkboxSelection:t.checkboxSelection,disableSelection:t.disableSelection}}}};yb.models={selectedItems:{getDefaultValue:e=>e.defaultSelectedItems}};const oce=[];yb.getDefaultizedParams=({params:e})=>at({},e,{disableSelection:e.disableSelection??!1,multiSelect:e.multiSelect??!1,checkboxSelection:e.checkboxSelection??!1,defaultSelectedItems:e.defaultSelectedItems??(e.multiSelect?oce:null)});yb.params={disableSelection:!0,multiSelect:!0,checkboxSelection:!0,defaultSelectedItems:!0,selectedItems:!0,onSelectedItemsChange:!0,onItemSelectionToggle:!0};function ace(e){return e&&e.ownerDocument||document}const nO=1e3;class ice{constructor(t=nO){this.timeouts=new Map,this.cleanupTimeout=nO,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 sce{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 lce{}function cce(e){let t=0;return function(n,r,o){e.registry===null&&(e.registry=typeof FinalizationRegistry<"u"?new sce:new ice);const[a]=k.useState(new lce),s=k.useRef(null),l=k.useRef(void 0);l.current=o;const u=k.useRef(null);if(!s.current&&l.current){const d=(p,h)=>{h.defaultMuiPrevented||l.current?.(p,h)};s.current=n.$$subscribeEvent(r,d),t+=1,u.current={cleanupToken:t},e.registry.register(a,()=>{s.current?.(),s.current=null,u.current=null},u.current)}else!l.current&&s.current&&(s.current(),s.current=null,u.current&&(e.registry.unregister(u.current),u.current=null));k.useEffect(()=>{if(!s.current&&l.current){const d=(p,h)=>{h.defaultMuiPrevented||l.current?.(p,h)};s.current=n.$$subscribeEvent(r,d)}return u.current&&e.registry&&(e.registry.unregister(u.current),u.current=null),()=>{s.current?.(),s.current=null}},[n,r])}}const uce={registry:null},dce=cce(uce),XL=(e=document)=>{const t=e.activeElement;return t?t.shadowRoot?XL(t.shadowRoot):t:null},fce=(e,t)=>{let n=ty(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=fh(e)),n},HC=({instance:e,params:t,state:n,setState:r,models:o,rootRef:a})=>{const s=fce(e,o.selectedItems.value),l=Pu(S=>{const T=typeof S=="function"?S(n.focusedItemId):S;n.focusedItemId!==T&&r(D=>at({},D,{focusedItemId:T}))}),u=k.useCallback(()=>!!a.current&&a.current.contains(XL(ace(a.current))),[a]),d=k.useCallback(S=>n.focusedItemId===S&&u(),[n.focusedItemId,u]),p=S=>{const T=e.getItemMeta(S);return T&&(T.parentId==null||e.isItemExpanded(T.parentId))},h=(S,T)=>{const D=e.getItemDOMElement(T);D&&D.focus(),l(T),t.onItemFocus&&t.onItemFocus(S,T)},g=Pu((S,T)=>{p(T)&&h(S,T)}),y=Pu(()=>{if(n.focusedItemId!=null){if(e.getItemMeta(n.focusedItemId)){const S=e.getItemDOMElement(n.focusedItemId);S&&S.blur()}l(null)}}),b=S=>S===s;dce(e,"removeItem",({id:S})=>{n.focusedItemId===S&&h(null,s)});const x=S=>T=>{S.onFocus?.(T),!T.defaultMuiPrevented&&T.target===T.currentTarget&&h(T,s)};return{getRootProps:S=>({onFocus:x(S)}),publicAPI:{focusItem:g},instance:{isItemFocused:d,canItemBeTabbed:b,focusItem:g,removeFocusedItem:y}}};HC.getInitialState=()=>({focusedItemId:null});HC.params={onItemFocus:!0};function pce(e){return!!e&&e.length===1&&!!e.match(/\S/)}const ZL=({instance:e,params:t,state:n})=>{const r=hne(),o=k.useRef({}),a=Pu(d=>{o.current=d(o.current)});k.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 s=(d,p)=>{const h=p.toLowerCase(),g=S=>{const T=ey(e,S);return T===null?fh(e):T};let y=null,b=g(d);const x={};for(;y==null&&!x[b];)o.current[b]===h?y=b:(x[b]=!0,b=g(b));return y},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||ph(d.target,d.currentTarget))return;const h=d.ctrlKey||d.metaKey,g=d.key;switch(!0){case(g===" "&&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 g==="Enter":{Yl(e,xa)&&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 g==="ArrowDown":{const y=ey(e,p);y&&(d.preventDefault(),e.focusItem(d,y),t.multiSelect&&d.shiftKey&&l(y)&&e.selectItemFromArrowNavigation(d,p,y));break}case g==="ArrowUp":{const y=UL(e,p);y&&(d.preventDefault(),e.focusItem(d,y),t.multiSelect&&d.shiftKey&&l(y)&&e.selectItemFromArrowNavigation(d,p,y));break}case(g==="ArrowRight"&&!r||g==="ArrowLeft"&&r):{if(h)return;if(e.isItemExpanded(p)){const y=ey(e,p);y&&(e.focusItem(d,y),d.preventDefault())}else u(p)&&(e.toggleItemExpansion(d,p),d.preventDefault());break}case(g==="ArrowLeft"&&!r||g==="ArrowRight"&&r):{if(h)return;if(u(p)&&e.isItemExpanded(p))e.toggleItemExpansion(d,p),d.preventDefault();else{const y=e.getItemMeta(p).parentId;y&&(e.focusItem(d,y),d.preventDefault())}break}case g==="Home":{l(p)&&t.multiSelect&&h&&d.shiftKey?e.selectRangeFromStartToItem(d,p):e.focusItem(d,fh(e)),d.preventDefault();break}case g==="End":{l(p)&&t.multiSelect&&h&&d.shiftKey?e.selectRangeFromItemToEnd(d,p):e.focusItem(d,HL(e)),d.preventDefault();break}case g==="*":{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&&pce(g)):{const y=s(p,g);y!=null&&(e.focusItem(d,y),d.preventDefault());break}}}}}};ZL.params={};const JL=({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}}}});JL.params={};const hce=[Vh,gb,yb,HC,ZL,JL,xa],mce=["ownerState"];function gce({slots:e,slotProps:t,label:n,id:r,itemId:o,itemsToRender:a}){const s=e?.item??Mle,l=zl({elementType:s,externalSlotProps:t?.item,additionalProps:{itemId:o,id:r,label:n},ownerState:{itemId:o,label:n}}),u=Xi(l,mce),d=k.useMemo(()=>a?v.jsx(eM,{itemsToRender:a,slots:e,slotProps:t}):null,[a,e,t]);return v.jsx(s,at({},u,{children:d}))}function eM(e){const{itemsToRender:t,slots:n,slotProps:r}=e;return v.jsx(k.Fragment,{children:t.map(o=>v.jsx(gce,{slots:n,slotProps:r,label:o.label,id:o.id,itemId:o.itemId,itemsToRender:o.children},o.itemId))})}const yce=ML(),bce=e=>{const{classes:t}=e;return LL({root:["root"]},$le,t)},vce=Un("ul",{name:"MuiRichTreeView",slot:"Root",overridesResolver:(e,t)=>t.root})({padding:0,margin:0,listStyle:"none",outline:0,position:"relative"}),Ece=k.forwardRef(function(e,t){const n=yce({props:e,name:"MuiRichTreeView"}),{getRootProps:r,contextValue:o,instance:a}=Zle({plugins:hce,rootRef:t,props:n}),{slots:s,slotProps:l}=n,u=bce(n),d=s?.root??vce,p=zl({elementType:d,externalSlotProps:l?.root,className:u.root,getSlotProps:r,ownerState:n});return v.jsx(dle,{value:o,children:v.jsx(d,at({},p,{children:v.jsx(eM,{slots:s,slotProps:l,itemsToRender:a.getItemsToRender()})}))})}),xce=Rn(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"})),Tce=Rn([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")]),Sce=Rn(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"})),Cce=Rn(v.jsx("path",{d:"M15 4v2h3v12h-3v2h5V4zM4 20h5v-2H6V6h3V4H4z"}));function tM({items:e,defaultExpandedItems:t,navigate:n}){return v.jsx(Ece,{items:Dce(e,n),defaultExpandedItems:t,slots:{item:wce}})}const _ce=Hee(dh);function Ace(e){const t=kee({to:{opacity:e.in?1:0,transform:`translate3d(0,${e.in?0:20}px,0)`}});return v.jsx(_ce,{style:t,...e})}function kce({item:e,...t}){const n=v.jsxs(Hle,{...t,sx:{display:"flex",alignItems:"center",color:e.error?"error.main":"grey.600"},children:[e.fileType==="directory"&&v.jsx(xce,{})||e.fileType==="notebook"&&v.jsx(Tce,{})||e.fileType==="model"&&v.jsx(Cce,{})||e.fileType=="database"&&v.jsx(Sce,{})||v.jsx(kL,{}),v.jsx(He,{variant:"body2",sx:{marginLeft:"5px"},color:e.error?"error.main":e.link?"primary.main":"grey.600",children:e.label})]});return e.error?v.jsx(lr,{title:e.error,placement:"right",children:n}):n}const wce=k.forwardRef(function(e,t){const{id:n,itemId:r,label:o,children:a,disabled:s,...l}=e,{getRootProps:u,getContentProps:d,getLabelProps:p,getIconContainerProps:h,getGroupTransitionProps:g,status:y,publicAPI:b}=ble({id:n,itemId:r,children:a,label:o,disabled:s,rootRef:t}),x=b.getItem(r);return y.selected=!1,y.focused=!1,v.jsx(jC,{itemId:r,children:v.jsxs(jle,{...u(l),children:[v.jsxs(Ule,{...d(),...x.link&&{onClick:S=>x.link(S)},sx:{pointerEvents:!x.selectable&&"none"},children:[v.jsx(zle,{...h(),children:v.jsx(Fle,{status:y})}),v.jsx(kce,{...p({item:x})})]}),a&&v.jsx(Ace,{...g()})]})})});function Dce(e,t){const n=new Map;return e.map(r=>{let o=n;const a=r.path.split("/");a.forEach((s,l)=>{l===a.length-1?o.set(s,r):(o.has(s)||o.set(s,new Map),o=o.get(s))})}),nM(n,"",t)}function nM(e,t,n){const r=[];return e.forEach((o,a)=>{const s=a.endsWith(".malloy")&&"model"||a.endsWith(".malloynb")&&"notebook"||a.endsWith(".parquet")&&"database"||"unknown";if(s!=="unknown"){const l=o;r.push({id:t+a,label:a,fileType:s,link:s==="model"||s==="notebook"?u=>n(t+a,u):void 0,selectable:s==="model"||s==="notebook",error:"error"in l?l.error:void 0})}else t+=`${a}/`,r.push({id:t,label:a,fileType:"directory",selectable:!0,link:void 0,children:nM(o,t,n)})}),r}const Rce=new mb(new Vr),Ice=["notebooks/","models/"];function Oce({navigate:e}){const{projectName:t,packageName:n,versionId:r}=uo(),{data:o,isError:a,error:s,isSuccess:l}=Jr({queryKey:["models",t,n,r],queryFn:u=>Rce.listModels(t,n,r,u)});return v.jsx(Ar,{variant:"outlined",sx:{width:"100%"},children:v.jsxs(Ko,{children:[v.jsx(He,{variant:"overline",fontWeight:"bold",children:"Semantic Models"}),v.jsx(Er,{}),v.jsxs(Nt,{sx:{maxHeight:"200px",overflowY:"auto"},children:[!l&&!a&&v.jsx(Zr,{text:"Fetching Models..."}),a&&v.jsx($r,{error:s,context:`${t} > ${n} > Models`}),l&&o.data.length>0&&v.jsx(tM,{items:o.data.sort((u,d)=>u.path.localeCompare(d.path)),navigate:e,defaultExpandedItems:Ice}),l&&o.data.length===0&&v.jsx(He,{variant:"body2",children:"No models found"})]})]})})}const Nce=new bL(new Vr),Pce=["notebooks/"];function Lce({navigate:e}){const{projectName:t,packageName:n,versionId:r}=uo(),{data:o,isError:a,error:s,isSuccess:l}=Jr({queryKey:["notebooks",t,n,r],queryFn:u=>Nce.listNotebooks(t,n,r,u)});return v.jsx(Ar,{variant:"outlined",sx:{width:"100%"},children:v.jsxs(Ko,{children:[v.jsx(He,{variant:"overline",fontWeight:"bold",children:"Notebooks"}),v.jsx(Er,{}),v.jsxs(Nt,{sx:{maxHeight:"200px",overflowY:"auto"},children:[!l&&!a&&v.jsx(Zr,{text:"Fetching Notebooks..."}),a&&v.jsx($r,{error:s,context:`${t} > ${n} > Notebooks`}),l&&o.data.length>0&&v.jsx(tM,{items:o.data.sort((u,d)=>u.path.localeCompare(d.path)),defaultExpandedItems:Pce,navigate:e}),l&&o.data.length===0&&v.jsx(He,{variant:"body2",children:"No notebooks found"})]})]})})}const Mce=new Nie(new Vr);function Fce(){const{projectName:e,packageName:t,versionId:n}=uo(),{data:r,isError:o,isLoading:a,error:s}=Jr({queryKey:["schedules",e,t,n],queryFn:l=>Mce.listSchedules(e,t,n,l)});return a?v.jsx(Zr,{text:"Fetching Schedules..."}):o?v.jsx($r,{error:s,context:`${e} > ${t} > Schedules`}):r.data.length?v.jsx(Ar,{variant:"outlined",sx:{padding:"10px",width:"100%"},children:v.jsxs(Ko,{children:[v.jsx(He,{variant:"overline",fontWeight:"bold",children:"Scheduler"}),v.jsx(Er,{}),v.jsx(Nt,{sx:{mt:"10px",maxHeight:"200px",overflowY:"auto"},children:v.jsx(FS,{component:Ji,children:v.jsxs(Gp,{sx:{minWidth:300},size:"small",children:[v.jsx(_y,{children:v.jsxs(ui,{children:[v.jsx(xn,{align:"left",children:"Resource"}),v.jsx(xn,{align:"left",children:"Schedule"}),v.jsx(xn,{align:"left",children:"Action"}),v.jsx(xn,{align:"left",children:"Connection"}),v.jsx(xn,{align:"left",children:"Last Run"}),v.jsx(xn,{align:"left",children:"Status"})]})}),v.jsx(qp,{children:r.data.map(l=>v.jsxs(ui,{sx:{"&:last-child td, &:last-child th":{border:0}},children:[v.jsx(xn,{align:"left",children:l.resource}),v.jsx(xn,{align:"left",children:l.schedule}),v.jsx(xn,{align:"left",children:l.action}),v.jsx(xn,{align:"left",children:l.connection}),v.jsx(xn,{align:"left",children:l.lastRunTime?new Date(l.lastRunTime).toLocaleString():"n/a"}),v.jsx(xn,{align:"left",children:l.lastRunStatus})]},l.resource))})]})})})]})}):null}const Bce="README.malloynb";function jce({navigate:e}){return e||(e=t=>{window.location.href=t}),v.jsxs(Kn,{container:!0,spacing:2,columns:12,children:[v.jsx(Kn,{size:{xs:12,md:4},children:v.jsx(Vie,{})}),v.jsx(Kn,{size:{xs:12,md:4},children:v.jsx(Lce,{navigate:e})}),v.jsx(Kn,{size:{xs:12,md:4},children:v.jsx(Oce,{navigate:e})}),v.jsx(Kn,{size:{xs:12,md:6},children:v.jsx(ose,{})}),v.jsx(Kn,{size:{xs:12,md:6},children:v.jsx(nse,{})}),v.jsx(Kn,{size:{xs:12,md:12},children:v.jsx(Fce,{})}),v.jsx(Kn,{size:{xs:12,md:12},children:v.jsx(AL,{notebookPath:Bce,hideEmbeddingIcons:!0})})]})}const Uce=ke(bu)({display:"flex",flexDirection:"column",height:"100%"});function Hce({modelPath:e,sourceName:t,queryName:n,expandResult:r,hideResultIcon:o,expandEmbedding:a,hideEmbeddingIcon:s,noView:l,annotations:u}){const[d,p]=Fe.useState(r),[h,g]=Fe.useState(a),[y,b]=Fe.useState(),[x,S]=Fe.useState(),{packageName:T,projectName:D}=uo(),w=SL({modelPath:e,sourceName:t,queryName:n,optionalPackageName:T,optionalProjectName:D});return k.useEffect(()=>{ac(w,"typescript").then(R=>{b(R)})},[h,w]),k.useEffect(()=>{if(u&&u.length>0){const R=u.map(I=>`// ${I}`).join(`
|
|
353
|
-
`);ac(R,"typescript").then(I=>{S(I)})}},[u]),v.jsx(v.Fragment,{children:v.jsxs(Uce,{variant:"outlined",sx:{padding:"0px 10px 0px 10px",borderRadius:"0px"},children:[v.jsxs(fn,{sx:{display:"flex",flexDirection:"row",justifyContent:"space-between",width:"100%"},children:[v.jsx(He,{variant:"subtitle2",sx:{mt:"auto",mb:"auto"},children:`${l?"":"View >"} ${n}`}),v.jsxs(N0,{sx:{padding:"0px"},children:[!o&&v.jsx(lr,{title:d?"Hide Results":"Show Results",children:v.jsx(or,{size:"small",onClick:()=>{p(!d)},children:v.jsx(vie,{})})}),!s&&v.jsx(lr,{title:h?"Hide Sharing":"Show Sharing",children:v.jsx(or,{size:"small",onClick:()=>{g(!h)},children:v.jsx(Fh,{})})})]})]}),v.jsxs(Ma,{in:h,timeout:"auto",unmountOnExit:!0,children:[v.jsx(Er,{}),v.jsxs(fn,{sx:{p:"10px",borderRadius:0,flexDirection:"row",justifyContent:"space-between"},children:[v.jsx(He,{sx:{fontSize:"12px","& .line":{textWrap:"wrap"}},children:v.jsx("div",{dangerouslySetInnerHTML:{__html:y}})}),v.jsx(lr,{title:"Copy Embeddable Code",children:v.jsx(or,{sx:{width:"24px",height:"24px"},onClick:()=>{navigator.clipboard.writeText(w)},children:v.jsx(lb,{})})})]})]}),v.jsxs(Ma,{in:d,timeout:"auto",unmountOnExit:!0,children:[v.jsx(Er,{sx:{mb:"4px"}}),x&&v.jsxs(v.Fragment,{children:[v.jsx(fn,{sx:{borderRadius:0,flexDirection:"row",justifyContent:"space-between"},children:v.jsx(He,{fontSize:"12px",sx:{fontSize:"12px","& .line":{textWrap:"wrap"}},children:v.jsx("div",{className:"content",dangerouslySetInnerHTML:{__html:x}})})}),v.jsx(Er,{sx:{mb:"4px"}})]}),v.jsx(vu,{children:v.jsx(Fie,{modelPath:e,sourceName:t,queryName:n})})]})]})})}const zce=new RC(new Vr),$ce=Un(O3)(({theme:e})=>({display:"flex",flexWrap:"wrap",gap:e.spacing(.5),borderBottom:`1px solid ${e.palette.divider}`,minHeight:36})),Vce=Un(Hr)(({theme:e,selected:t})=>({minHeight:36,padding:e.spacing(.5,2),borderRadius:e.shape.borderRadius,background:t?e.palette.action.selected:"none",color:t?e.palette.primary.main:e.palette.text.primary,fontWeight:t?600:400,border:t?`1px solid ${e.palette.primary.main}`:"1px solid transparent",boxShadow:t?e.shadows[1]:"none",textTransform:"uppercase","&:hover":{background:e.palette.action.hover,border:`1px solid ${e.palette.primary.light}`}}));function rM({sourceAndPaths:e,existingQuery:t,existingSourceName:n,onQueryChange:r,onSourceChange:o}){const[a,s]=Fe.useState(n?e.findIndex(d=>d.sourceInfo.name===n):0),[l,u]=Fe.useState(t||Sp());return Fe.useEffect(()=>{o&&o(a)},[a,o]),v.jsxs(Ar,{variant:"outlined",children:[v.jsx(Ko,{children:v.jsx(tD,{sx:{flexDirection:"row",justifyContent:"space-between"},children:e.length>0&&v.jsx($ce,{children:e.map((d,p)=>v.jsx(Vce,{selected:a===p,onClick:()=>s(p),children:d.sourceInfo.name||`Source ${p+1}`},d.sourceInfo.name||p))})})}),v.jsx(DC,{children:v.jsxs(tD,{spacing:2,component:"section",children:[v.jsx(oM,{sourceAndPath:e[a],existingQuery:l,onChange:d=>{u(d),r&&r(d)}}),v.jsx(O3,{height:"5px"})]})})]})}function Sp(){return{query:void 0,malloyQuery:void 0,malloyResult:void 0}}function Gce({sourceAndPath:e,onChange:t,existingQuery:n,explorerComponents:r,QueryBuilder:o}){const[a,s]=Fe.useState(n||Sp()),[l,u]=Fe.useState([]),{MalloyExplorerProvider:d,QueryPanel:p,ResizableCollapsiblePanel:h,ResultPanel:g,SourcePanel:y}=r;Fe.useEffect(()=>{t&&t(a)},[t,a]);const{projectName:b,packageName:x,versionId:S}=uo(),T=Pie({mutationFn:(I,O)=>{const F=new o.ASTQuery({source:e.sourceInfo,query:a?.malloyQuery}).toMalloy();return s({...a,query:F}),zce.executeQuery(b,x,e.modelPath,F,void 0,void 0,S,O)},onSuccess:I=>{if(I){const O=JSON.parse(I.data.result);s({...a,malloyResult:O})}}}),[D,w]=Fe.useState(e.sourceInfo.name);Fe.useEffect(()=>{D!==e.sourceInfo.name&&(w(e.sourceInfo.name),s(Sp()))},[e,D]);const R=Fe.useCallback(I=>{s({...a,malloyQuery:I,malloyResult:void 0})},[a]);return D!==e.sourceInfo.name?v.jsx("div",{children:"Loading..."}):v.jsx(gL,{children:v.jsx(d,{source:e.sourceInfo,query:a?.malloyQuery,onQueryChange:R,focusedNestViewPath:l,onFocusedNestViewPathChange:u,onDrill:I=>{console.info(I)},children:v.jsxs("div",{style:{display:"flex",height:"100%",overflowY:"auto"},children:[v.jsx(h,{isInitiallyExpanded:!0,initialWidth:180,minWidth:180,icon:"database",title:e.sourceInfo.name,children:v.jsx(y,{onRefresh:()=>s(Sp())})}),v.jsx(h,{isInitiallyExpanded:!0,initialWidth:280,minWidth:280,icon:"filterSliders",title:"Query",children:v.jsx(p,{runQuery:()=>{T.mutate()}})}),v.jsx(g,{source:e.sourceInfo,draftQuery:a?.malloyQuery,setDraftQuery:I=>s({...a,malloyQuery:I}),submittedQuery:a?.malloyQuery?{executionState:T.isPending?"running":"finished",response:{result:a.malloyResult},query:a.malloyQuery,queryResolutionStartMillis:Date.now(),onCancel:T.reset}:void 0,options:{showRawQuery:!0}})]})})},e.sourceInfo.name)}function oM(e){const[t,n]=k.useState(null),[r,o]=k.useState(null),[a,s]=k.useState(!0);return k.useEffect(()=>{let l=!0;return Promise.all([G(()=>import("./index-
|
|
353
|
+
`);ac(R,"typescript").then(I=>{S(I)})}},[u]),v.jsx(v.Fragment,{children:v.jsxs(Uce,{variant:"outlined",sx:{padding:"0px 10px 0px 10px",borderRadius:"0px"},children:[v.jsxs(fn,{sx:{display:"flex",flexDirection:"row",justifyContent:"space-between",width:"100%"},children:[v.jsx(He,{variant:"subtitle2",sx:{mt:"auto",mb:"auto"},children:`${l?"":"View >"} ${n}`}),v.jsxs(N0,{sx:{padding:"0px"},children:[!o&&v.jsx(lr,{title:d?"Hide Results":"Show Results",children:v.jsx(or,{size:"small",onClick:()=>{p(!d)},children:v.jsx(vie,{})})}),!s&&v.jsx(lr,{title:h?"Hide Sharing":"Show Sharing",children:v.jsx(or,{size:"small",onClick:()=>{g(!h)},children:v.jsx(Fh,{})})})]})]}),v.jsxs(Ma,{in:h,timeout:"auto",unmountOnExit:!0,children:[v.jsx(Er,{}),v.jsxs(fn,{sx:{p:"10px",borderRadius:0,flexDirection:"row",justifyContent:"space-between"},children:[v.jsx(He,{sx:{fontSize:"12px","& .line":{textWrap:"wrap"}},children:v.jsx("div",{dangerouslySetInnerHTML:{__html:y}})}),v.jsx(lr,{title:"Copy Embeddable Code",children:v.jsx(or,{sx:{width:"24px",height:"24px"},onClick:()=>{navigator.clipboard.writeText(w)},children:v.jsx(lb,{})})})]})]}),v.jsxs(Ma,{in:d,timeout:"auto",unmountOnExit:!0,children:[v.jsx(Er,{sx:{mb:"4px"}}),x&&v.jsxs(v.Fragment,{children:[v.jsx(fn,{sx:{borderRadius:0,flexDirection:"row",justifyContent:"space-between"},children:v.jsx(He,{fontSize:"12px",sx:{fontSize:"12px","& .line":{textWrap:"wrap"}},children:v.jsx("div",{className:"content",dangerouslySetInnerHTML:{__html:x}})})}),v.jsx(Er,{sx:{mb:"4px"}})]}),v.jsx(vu,{children:v.jsx(Fie,{modelPath:e,sourceName:t,queryName:n})})]})]})})}const zce=new RC(new Vr),$ce=Un(O3)(({theme:e})=>({display:"flex",flexWrap:"wrap",gap:e.spacing(.5),borderBottom:`1px solid ${e.palette.divider}`,minHeight:36})),Vce=Un(Hr)(({theme:e,selected:t})=>({minHeight:36,padding:e.spacing(.5,2),borderRadius:e.shape.borderRadius,background:t?e.palette.action.selected:"none",color:t?e.palette.primary.main:e.palette.text.primary,fontWeight:t?600:400,border:t?`1px solid ${e.palette.primary.main}`:"1px solid transparent",boxShadow:t?e.shadows[1]:"none",textTransform:"uppercase","&:hover":{background:e.palette.action.hover,border:`1px solid ${e.palette.primary.light}`}}));function rM({sourceAndPaths:e,existingQuery:t,existingSourceName:n,onQueryChange:r,onSourceChange:o}){const[a,s]=Fe.useState(n?e.findIndex(d=>d.sourceInfo.name===n):0),[l,u]=Fe.useState(t||Sp());return Fe.useEffect(()=>{o&&o(a)},[a,o]),v.jsxs(Ar,{variant:"outlined",children:[v.jsx(Ko,{children:v.jsx(tD,{sx:{flexDirection:"row",justifyContent:"space-between"},children:e.length>0&&v.jsx($ce,{children:e.map((d,p)=>v.jsx(Vce,{selected:a===p,onClick:()=>s(p),children:d.sourceInfo.name||`Source ${p+1}`},d.sourceInfo.name||p))})})}),v.jsx(DC,{children:v.jsxs(tD,{spacing:2,component:"section",children:[v.jsx(oM,{sourceAndPath:e[a],existingQuery:l,onChange:d=>{u(d),r&&r(d)}}),v.jsx(O3,{height:"5px"})]})})]})}function Sp(){return{query:void 0,malloyQuery:void 0,malloyResult:void 0}}function Gce({sourceAndPath:e,onChange:t,existingQuery:n,explorerComponents:r,QueryBuilder:o}){const[a,s]=Fe.useState(n||Sp()),[l,u]=Fe.useState([]),{MalloyExplorerProvider:d,QueryPanel:p,ResizableCollapsiblePanel:h,ResultPanel:g,SourcePanel:y}=r;Fe.useEffect(()=>{t&&t(a)},[t,a]);const{projectName:b,packageName:x,versionId:S}=uo(),T=Pie({mutationFn:(I,O)=>{const F=new o.ASTQuery({source:e.sourceInfo,query:a?.malloyQuery}).toMalloy();return s({...a,query:F}),zce.executeQuery(b,x,e.modelPath,F,void 0,void 0,S,O)},onSuccess:I=>{if(I){const O=JSON.parse(I.data.result);s({...a,malloyResult:O})}}}),[D,w]=Fe.useState(e.sourceInfo.name);Fe.useEffect(()=>{D!==e.sourceInfo.name&&(w(e.sourceInfo.name),s(Sp()))},[e,D]);const R=Fe.useCallback(I=>{s({...a,malloyQuery:I,malloyResult:void 0})},[a]);return D!==e.sourceInfo.name?v.jsx("div",{children:"Loading..."}):v.jsx(gL,{children:v.jsx(d,{source:e.sourceInfo,query:a?.malloyQuery,onQueryChange:R,focusedNestViewPath:l,onFocusedNestViewPathChange:u,onDrill:I=>{console.info(I)},children:v.jsxs("div",{style:{display:"flex",height:"100%",overflowY:"auto"},children:[v.jsx(h,{isInitiallyExpanded:!0,initialWidth:180,minWidth:180,icon:"database",title:e.sourceInfo.name,children:v.jsx(y,{onRefresh:()=>s(Sp())})}),v.jsx(h,{isInitiallyExpanded:!0,initialWidth:280,minWidth:280,icon:"filterSliders",title:"Query",children:v.jsx(p,{runQuery:()=>{T.mutate()}})}),v.jsx(g,{source:e.sourceInfo,draftQuery:a?.malloyQuery,setDraftQuery:I=>s({...a,malloyQuery:I}),submittedQuery:a?.malloyQuery?{executionState:T.isPending?"running":"finished",response:{result:a.malloyResult},query:a.malloyQuery,queryResolutionStartMillis:Date.now(),onCancel:T.reset}:void 0,options:{showRawQuery:!0}})]})})},e.sourceInfo.name)}function oM(e){const[t,n]=k.useState(null),[r,o]=k.useState(null),[a,s]=k.useState(!0);return k.useEffect(()=>{let l=!0;return Promise.all([G(()=>import("./index-CIfV3yj1.js"),__vite__mapDeps([93,94,95])),G(()=>import("./index-BbW5TZg_.js").then(u=>u.i),[])]).then(([u,d])=>{l&&(n(u),o(d),s(!1))}).catch(u=>{console.error("Failed to load Malloy components:",u),l&&s(!1)}),()=>{l=!1}},[]),a||!t||!r?v.jsx(bie,{children:v.jsx(gL,{children:v.jsx("div",{style:{alignItems:"center",justifyContent:"center",height:"200px",color:"#666"},children:"Loading explorer..."})})}):v.jsx(Gce,{...e,explorerComponents:t,QueryBuilder:r})}const qce=new mb(new Vr);function aM(e,t){const{projectName:n,packageName:r,versionId:o}=uo(),a=t||o;return Jr({queryKey:["package",n,r,e,a],queryFn:async s=>(await qce.getModel(n,r,e,a,s)).data})}function Wce({modelPath:e,versionId:t,expandResults:n,hideResultIcons:r,expandEmbeddings:o,hideEmbeddingIcons:a,onChange:s}){const[l,u]=Fe.useState(0),{data:d,isError:p,isLoading:h,error:g}=aM(e,t);return h?v.jsx(Zr,{text:"Fetching Model..."}):p?(console.log("error",g),v.jsx($r,{error:g,context:`ModelExplorer > ${e}`})):v.jsxs(fn,{spacing:2,component:"section",children:[Array.isArray(d.sourceInfos)&&d.sourceInfos.length>0&&v.jsx(fn,{sx:{flexDirection:"row",justifyContent:"flex-start"},children:v.jsx(YK,{value:l,onChange:(y,b)=>u(b),variant:"scrollable",scrollButtons:"auto",sx:{borderBottom:1,borderColor:"divider",minHeight:36},children:d.sourceInfos.map((y,b)=>{let x;try{x=JSON.parse(y)}catch{x={name:String(b)}}return v.jsx(oK,{label:x.name||`Source ${b+1}`,sx:{minHeight:36}},x.name||b)})})}),Array.isArray(d.sourceInfos)&&d.sourceInfos.length>0&&v.jsx(oM,{sourceAndPath:{modelPath:e,sourceInfo:JSON.parse(d.sourceInfos[l])},onChange:s}),d.queries?.length>0&&v.jsxs(Ar,{variant:"outlined",sx:{padding:"0px 10px 0px 10px"},children:[v.jsx(Ko,{sx:{p:"10px"},children:v.jsx(He,{variant:"subtitle1",children:"Named Queries"})}),v.jsx(fn,{spacing:1,component:"section",children:d.queries.map(y=>v.jsx(Hce,{modelPath:e,queryName:y.name,expandResult:n,hideResultIcon:r,expandEmbedding:o,hideEmbeddingIcon:a,noView:!0,annotations:y.annotations},y.name))}),v.jsx(Nt,{height:"10px"})]}),v.jsx(Nt,{height:"5px"})]})}function Yce({modelPath:e,versionId:t,expandResults:n,hideResultIcons:r,expandEmbeddings:o,hideEmbeddingIcons:a,onChange:s}){const[l,u]=Fe.useState(!1),[d,p]=Fe.useState(),{isError:h,isLoading:g,error:y}=aM(e,t),b=Kce(e);return k.useEffect(()=>{ac(b,"typescript").then(x=>{p(x)})},[l,b]),g?v.jsx(Zr,{text:"Fetching Model..."}):h?(console.log("error",y),v.jsx($r,{error:y,context:`Model > ${e}`})):v.jsxs(Ar,{variant:"outlined",children:[v.jsxs(Ko,{children:[v.jsx(fn,{sx:{flexDirection:"row",justifyContent:"flex-end"},children:!a&&v.jsx(N0,{sx:{padding:"0px 10px 0px 10px",mb:"auto",mt:"auto"},children:v.jsx(lr,{title:l?"Hide Embedding":"View Embedding",children:v.jsx(or,{size:"small",onClick:()=>{u(!l)},children:v.jsx(Fh,{})})})})}),v.jsxs(Ma,{in:l,timeout:"auto",unmountOnExit:!0,children:[v.jsx(Er,{}),v.jsxs(fn,{sx:{p:"10px",borderRadius:0,flexDirection:"row",justifyContent:"space-between"},children:[v.jsx(He,{sx:{fontSize:"12px","& .line":{textWrap:"wrap"}},children:v.jsx("div",{dangerouslySetInnerHTML:{__html:d}})}),v.jsx(lr,{title:"Copy Embeddable Code",children:v.jsx(or,{sx:{width:"24px",height:"24px"},onClick:()=>{navigator.clipboard.writeText(b)},children:v.jsx(lb,{})})})]})]}),v.jsx(Er,{})]}),v.jsx(Wce,{modelPath:e,versionId:t,expandResults:n,hideResultIcons:r,expandEmbeddings:o,hideEmbeddingIcons:a,onChange:s})]})}function Kce(e){return`<Model
|
|
354
354
|
modelPath="${e}"
|
|
355
355
|
accessToken={accessToken}
|
|
356
356
|
/>`}const Qce=Rn(v.jsx("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z"})),cu=hS({createStyledComponent:Un("div",{name:"MuiStack",slot:"Root"}),useThemeProps:e=>pd({props:e,name:"MuiStack"})});function bd(){const e=VT();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")}}class Cp{constructor(t,n,r){this.workbookData=r,this.workbookStorage=t,this.packageContext=n,this.workbookData?this.isSaved=!0:(this.workbookData={models:[],cells:[],workbookPath:void 0},this.isSaved=!1)}isSaved;workbookStorage;packageContext;getWorkbookData(){return this.workbookData}getWorkbookPath(){return this.workbookData.workbookPath}async renameWorkbook(t){if(this.workbookData.workbookPath.path!==t)try{await this.workbookStorage.moveWorkbook(this.packageContext,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.packageContext,this.workbookData.workbookPath,JSON.stringify(this.workbookData)),this.isSaved=!0}return new Cp(this.workbookStorage,this.packageContext,this.workbookData)}toMalloyWorkbook(){return this.workbookData.cells.map(t=>t.isMarkdown?`>>>markdown
|