import{S as H,i as L,s as M,e as E,j as O,k as z,c as j,a as S,m as N,d as h,n as A,b as V,J as C,f as X,K as v,o as R,W as Q,x as b,u as y,v as q,w as T,l as Y,P as Z,O as B,X as F,Y as U,r as x,Z as ee}from"../chunks/vendor-cb8fe21e.js";import{E as K}from"../chunks/editor-045a54b8.js";import{E as re}from"../chunks/error-ce582bf2.js";import"../chunks/preload-helper-ec9aa979.js";function se(a){let r,s,e,t,l,f,$,d,g,u,w,m,_,D;function c(o){a[9](o)}let p={language:"json",schema:ee};a[4]!==void 0&&(p.value=a[4]),e=new K({props:p}),a[8](e),F.push(()=>U(e,"value",c)),e.$on("save",a[10]);let n=!!a[2]&&G(a);return u=new K({props:{language:"json",fontSize:"10px",isReadonly:!0,value:JSON.stringify(a[3].reverse(),null,2)}}),_=new re({props:{error:a[1]}}),{c(){r=E("div"),s=E("div"),O(e.$$.fragment),l=z(),f=E("div"),n&&n.c(),$=z(),d=E("div"),g=E("div"),O(u.$$.fragment),w=z(),m=E("div"),O(_.$$.fragment),this.h()},l(o){r=j(o,"DIV",{class:!0,style:!0});var i=S(r);s=j(i,"DIV",{class:!0,style:!0});var I=S(s);N(e.$$.fragment,I),I.forEach(h),l=A(i),f=j(i,"DIV",{class:!0,style:!0});var J=S(f);n&&n.l(J),J.forEach(h),$=A(i),d=j(i,"DIV",{class:!0});var k=S(d);g=j(k,"DIV",{class:!0});var P=S(g);N(u.$$.fragment,P),P.forEach(h),w=A(k),m=j(k,"DIV",{class:!0,style:!0});var W=S(m);N(_.$$.fragment,W),W.forEach(h),k.forEach(h),i.forEach(h),this.h()},h(){V(s,"class","w-4/12 border-r-2"),C(s,"border-color","#171812"),V(f,"class","w-4/12 border-r-2"),C(f,"border-color","#171812"),V(g,"class","w-full h-4/6"),V(m,"class","w-full h-2/6 border-t-2"),C(m,"border-color","#171812"),V(d,"class","w-4/12"),V(r,"class","flex flex-column h-screen"),C(r,"background-color","#272822")},m(o,i){X(o,r,i),v(r,s),R(e,s,null),v(r,l),v(r,f),n&&n.m(f,null),v(r,$),v(r,d),v(d,g),R(u,g,null),v(d,w),v(d,m),R(_,m,null),D=!0},p(o,i){const I={};!t&&i&16&&(t=!0,I.value=o[4],Q(()=>t=!1)),e.$set(I),o[2]?n?(n.p(o,i),i&4&&b(n,1)):(n=G(o),n.c(),b(n,1),n.m(f,null)):n&&(x(),y(n,1,1,()=>{n=null}),T());const J={};i&8&&(J.value=JSON.stringify(o[3].reverse(),null,2)),u.$set(J);const k={};i&2&&(k.error=o[1]),_.$set(k)},i(o){D||(b(e.$$.fragment,o),b(n),b(u.$$.fragment,o),b(_.$$.fragment,o),D=!0)},o(o){y(e.$$.fragment,o),y(n),y(u.$$.fragment,o),y(_.$$.fragment,o),D=!1},d(o){o&&h(r),a[8](null),q(e),n&&n.d(),q(u),q(_)}}}function G(a){let r,s;return r=new K({props:{language:"json",isReadonly:!0,value:JSON.stringify(a[2],null,2)}}),{c(){O(r.$$.fragment)},l(e){N(r.$$.fragment,e)},m(e,t){R(r,e,t),s=!0},p(e,t){const l={};t&4&&(l.value=JSON.stringify(e[2],null,2)),r.$set(l)},i(e){s||(b(r.$$.fragment,e),s=!0)},o(e){y(r.$$.fragment,e),s=!1},d(e){q(r,e)}}}function te(a){let r,s,e=!!a[5]&&se(a);return{c(){e&&e.c(),r=Y()},l(t){e&&e.l(t),r=Y()},m(t,l){e&&e.m(t,l),X(t,r,l),s=!0},p(t,[l]){t[5]&&e.p(t,l)},i(t){s||(b(e),s=!0)},o(t){y(e),s=!1},d(t){e&&e.d(t),t&&h(r)}}}function ne(a,r,s){let e,t;const l=Z("stores").activeClient;B(a,l,c=>s(11,e=c));const f=Z("stores").editorValue;B(a,f,c=>s(4,t=c));let $,d,g,u=[];async function w(c){console.log("Running...",c),s(1,d=null),s(2,g=null),s(3,u=[]);try{const p=JSON.parse(c);console.log(p);const n=await e.aggregate(p,{logs:!0});s(2,g=n.data.aggregation),s(3,u=n.data.logs)}catch(p){console.error(p),s(1,d=p)}s(3,u=aggregator.logs)}function m(c){F[c?"unshift":"push"](()=>{$=c,s(0,$)})}function _(c){t=c,f.set(t)}return[$,d,g,u,t,l,f,w,m,_,()=>w(t)]}class ue extends H{constructor(r){super();L(this,r,ne,te,M,{})}}export{ue as default};
