@spaceandtimelabs/dapp-mi-space-time 0.1.0-beta.0 → 0.1.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- import{ju as o,j as e,r as t}from"./vendor-charts-1d8c8804.js";import{u as n,O as s,E as d,a as p}from"./index-b81d4b64.js";import"./vendor-editor-5747258a.js";import"./vendor-three-295ae070.js";const u=r=>{const a=o(),{height:i}=n();return e.jsx(t.Suspense,{fallback:s,children:e.jsx(d,{pageHeight:i,children:a?e.jsx(s,{}):e.jsx(p,{...r,hideSchemaSidebar:!1})})})};export{u as default};
1
+ import{ju as o,j as e,r as t}from"./vendor-charts-25f5f9f8.js";import{u as n,O as s,E as d,a as p}from"./index-79e0a273.js";import"./vendor-editor-fad92d61.js";import"./vendor-three-d85976a9.js";const u=r=>{const a=o(),{height:i}=n();return e.jsx(t.Suspense,{fallback:s,children:e.jsx(d,{pageHeight:i,children:a?e.jsx(s,{}):e.jsx(p,{...r,hideSchemaSidebar:!1})})})};export{u as default};
@@ -1,4 +1,4 @@
1
- import{h7 as zt,mp as Br,r as E,a8 as St,j as f,am as Tt,b3 as x,cL as vn,mq as Fr,cI as rn,mr as Kr,ms as Wr,b5 as dt,c$ as bt,ds as on,al as ht,kz as Dn,bZ as an,co as It,mt as Ur,mu as Vr,mv as zr,db as Y,dw as sr,a9 as ir,b_ as Ve,dy as $r,ce as Gr,lM as Xr,aZ as Zr,dd as Jr,g as sn,a as cr,mw as qr,R as g,mx as I,my as be,mz as Ce,mA as $t,mB as De,mC as eo,mD as $,mE as wn,mF as to,mG as Ct,mH as J,mI as Ye,mJ as Pe,mK as Gt,mL as Ae,mM as no,mN as ro,mO as ie,mP as ce,mQ as Le,mR as Xt,mS as he,mT as Ge,mU as Xe,A as oo,mV as ft,mW as Zt,mX as cn,mY as Rt,mZ as ao,m_ as kn,m$ as Sn,n0 as so,n1 as io,n2 as pr,n3 as bn,n4 as it,n5 as ct,n6 as co,n7 as po,n8 as lr,n9 as ur,na as lo,nb as uo,nc as ho,nd as fo,ne as mo,nf as go,ng as Ze,nh as yo,ni as vo,nj as mt,nk as gt,nl as yt,nm as Cn,nn as _n,no as Do,D as wo,np as ko,bd as dr,bb as So,dn as pt,dU as bo,nq as Co,dN as _o,ar as Eo,dY as xo,l$ as H,au as rt,bG as Fe,ea as En,dt as xn,bH as Yt,m0 as Mo,dq as Mn,e5 as No,e6 as ot,ac as Ke,nr as Pt,aW as Oo,ns as To,dp as jt,dm as Lt,e7 as Io,nt as Ro,nu as Yo}from"./vendor-charts-1d8c8804.js";import{u as _t,b as Po,c as jo,d as hr,e as pn,f as ln,r as Nn,g as un,C as On,h as Tn,M as Lo,V as dn,P as hn,i as Ao,H as Qo,j as fn,I as oe,B as ee,k as Ho,l as Bo,m as Fo,n as vt,N as At,o as ze,L as Ko,p as Wo,s as We,q as Uo,t as Vo,v as fr,w as mr,T as gr,x as zo,y as yr,z as vr,A as $o,D as Go,F as Xo,G as In,J as Zo,O as Jo,K as qo,R as Rn,S as ea,W as ta,U as Yn,X as Pn,Y as jn,Z as na,_ as ra,$ as oa,a0 as aa,a1 as sa,a2 as ia}from"./index-b81d4b64.js";import"./vendor-editor-5747258a.js";import"./vendor-three-295ae070.js";const ca="/assets/emptyHistory-39807386.png",pa="/assets/emptyHistory-e09c1ac9.webp",la="/assets/heartbeat-d012a4c0.png";zt.extend(Br);function ua({queryParams:o,setSortBy:s,setPageNumber:i,onPageChange:t,onPageSizeChange:e,defaultSize:r}){var T,G,X;const{height:p,headerHeight:n}=_t(),[a,c]=E.useState(!1),[d,m]=E.useState([]),[v,k]=E.useState(null),[w,S]=E.useState({areaChartConfig:[],lineChartConfig:[]}),[b,D]=E.useState(0),M=(T=Object.keys(w))==null?void 0:T.length,h=Po(),O=jo(),_=hr(),Q=pn(),R=ln(),j=Q||R,{totalPages:z=0,totalElements:q=0}=(O==null?void 0:O.pageable)||{},ae=St();E.useEffect(()=>()=>Nn(),[]),E.useEffect(()=>{var N,Z,ye,Be,yn;if((N=_==null?void 0:_.content)!=null&&N.length){const jr=(Z=_==null?void 0:_.content)==null?void 0:Z.map(U=>U==null?void 0:U.queryType),nt={};(jr??[]).forEach(U=>{nt[U]?nt[U]+=1:nt[U]=1});const Lr=(ye=Object.entries(nt))==null?void 0:ye.map(([U,Hr])=>({Source:U,Trafic:Hr}));m(Lr);const Ar=(Be=_==null?void 0:_.content)==null?void 0:Be.map(U=>({Timestamp:U.timestamp,Usage:U.usage,Runtime:U.runtime})),Qr=(yn=_==null?void 0:_.content)==null?void 0:yn.map(U=>({Timestamp:U.timestamp,Usage:U.usage,DataVolume:U.responseSize}));S({areaChartConfig:Ar,lineChartConfig:Qr}),(o==null?void 0:o.isRecent)==="false"&&D(0)}else m([])},[_==null?void 0:_.content,o]);const te=N=>i(N),_e=(N,Z)=>{if(N==="systemHeartbeat"||N==="CPUSkew")return;const ye=Z==="ASC"?"DESC":"ASC";Nn(),s(N,ye)},fe=N=>{ae.push("/queries/new?tabID=1"),Dn(N)},Ee=N=>{k(N),c(!0)},le=()=>{k(null),c(!1)},me=({timestamp:N})=>rn(N),xe=({runtime:N})=>Kr(N),Me=({responseSize:N=0})=>Wr(N),Ne=({cpuskew:N="59%"})=>f.jsx(Ao,{children:N}),ge=({systemHeartbeat:N="58"})=>f.jsxs(Qo,{children:[f.jsx("img",{src:la,alt:"system-heartbeat"}),f.jsx("span",{children:N})]}),ue=N=>f.jsx("span",{className:"text",children:N.queryType?N.queryType:"-"}),de=N=>f.jsx("span",{className:"text",children:N!=null&&N.usage?N.usage:"-"}),C=N=>f.jsxs(fn,{onClick:()=>Ee(N),className:"queryText",children:[f.jsx("span",{className:"text",children:N.sqlText}),f.jsx(oe,{tooltip:"Preview",children:f.jsx(dt,{})})]}),ne=N=>f.jsx(oe,{onClick:()=>{fe(N)},tooltip:x.VIEW_IN_EDITOR,children:f.jsx(bt,{})}),Ie=()=>f.jsx(on,{imgPath:ca,imgPathWebp:pa,title:!(o!=null&&o.tagName)&&!(o!=null&&o.searchKeyword)?x.EMPTY_QUERY_HISTORY:x.NO_RESULT_FOUND_ON_FILTER,children:!(o!=null&&o.tagName)&&!(o!=null&&o.searchKeyword)&&f.jsx(ht,{to:"/queries/new?tabID=1",children:f.jsx(ee,{variant:"contained",color:"primary",size:"large",children:x.CREATE_NEW_QUERY})})}),He=()=>p-n-230||300,Re=()=>{v&&Dn(v)},Nt=()=>f.jsx(an,{title:h,children:h});if((O==null?void 0:O.totalElements)===0)return Ie();if(h)return Nt();const qe=()=>{D(N=>N+1)},Ot=()=>{D(N=>N-1)},et=()=>{D(0)},tt=()=>{D(M-1)},y=()=>{var Be;let N,Z,ye;switch(b){case 1:b===1&&(N="Usage and Data Volume Variation over time",Z=It.column_chart,ye=zr);break;default:N="Usage and Runtime Trends Over Time",Z=It.area_chart,ye=Vr}return console.log("queryHistory",_.content),f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"cardHead",children:[f.jsx("span",{className:"cardHeadTitle",children:N}),f.jsx("span",{className:"cardHeadCount",children:(Be=_==null?void 0:_.content)==null?void 0:Be.length})]}),f.jsx("div",{className:"cardBody",children:f.jsx(vn,{isRunning:j,config:Tn({data:Z===It.area_chart?w.areaChartConfig:w.lineChartConfig,chartConfigurationData:ye}).config,type:Z})})]})};return f.jsxs(f.Fragment,{children:[f.jsx(un,{open:a,id:v==null?void 0:v.savedQueryId,text:v==null?void 0:v.sqlText,onClose:le,onClickView:Re,isHistory:!0}),(j||((G=_==null?void 0:_.content)==null?void 0:G.length)>0)&&(o==null?void 0:o.isRecent)==="false"&&f.jsxs(Tt,{container:!0,spacing:{xs:1,sm:3},children:[f.jsx(Tt,{item:!0,sm:5,xs:12,children:f.jsxs(On,{children:[f.jsxs("div",{className:"cardHead",children:[f.jsx("span",{className:"cardHeadTitle",children:x.TOTAL_QUERIES}),f.jsx("span",{className:"cardHeadCount",children:(X=_==null?void 0:_.content)==null?void 0:X.length})]}),f.jsx("div",{className:"cardBody",children:f.jsx(vn,{isRunning:j,config:Tn({data:d,chartConfigurationData:Ur}).config,type:"pie_chart"})})]})}),f.jsx(Tt,{item:!0,sm:7,xs:12,children:f.jsxs(On,{children:[y(),!j&&f.jsx(Lo,{maxSteps:M,activeStep:b,handleFirst:et,handleLast:tt,handleNext:qe,handlePrev:Ot})]})})]}),f.jsx(dn,{data:_==null?void 0:_.content,columns:Fr,isAction:!0,actionComponent:N=>ne(N),loading:j,rowRender:[{dataKey:"sqlText",func:C},{dataKey:"timestamp",func:me},{dataKey:"runtime",func:xe},{dataKey:"responseSize",func:Me},{dataKey:"systemHeartbeat",func:ge},{dataKey:"CPUSkew",func:Ne},{dataKey:"queryType",func:ue},{dataKey:"usage",func:de}],rowSize:75,bodyHeight:He(),onItemsSort:_e,sortBy:o==null?void 0:o.sortBy,sortOrder:(o==null?void 0:o.sortOrder)||""}),(j?!0:(_==null?void 0:_.length)!==0)&&f.jsx(hn,{onChange:te,count:z,page:o.pageNo,onPageChange:t,totalElements:q,onPageSizeChange:e,isGotoPage:!0,isPageSize:!0,pageSize:o.pageSize,defaultSize:r})]})}const da=o=>{const{row:s,handleClose:i,handlePublishCallback:t,open:e}=o,{id:r,queryName:p,visibility:n,slug:a}=s||{},[c,d]=E.useState(""),[m,v]=E.useState(!1),[k,w]=E.useState(!1),[S,b]=E.useState(!1),D=Ho()||(s==null?void 0:s.visibility),M=E.useRef(null),h=n===Y.public;E.useEffect(()=>{if(e&&n===Y.public){const j=window.location.origin+Ve.queriesSlug(r,a);d(j)}else d(""),b(!1),M.current=null},[e]);const O=j=>{var ae,te;const z=((te=(ae=j==null?void 0:j.target)==null?void 0:ae.value)==null?void 0:te.trim())||"",q=(z==null?void 0:z.length)>0&&$r(z);v(q),z!==c&&d(z)},_=async()=>{w(!0),await Wo(r,p,c,D,t)===x.RESPONSE_SUCCESS_STATUS&&i(),w(!1)},Q=j=>{switch(j){case Y.public:We(Y.public);break;case Y.private:We(Y.private);break;case Y.subscription:We(Y.subscription);break;default:We(Y.private)}},R=()=>{Gr(c).then(()=>{b(!0)})};return f.jsx(Bo,{title:x.QUERY_PUBLISH,visible:e,maxWidth:"sm",onClose:i,children:f.jsxs(Fo,{children:[f.jsxs("div",{className:"visibilityCheck",children:[f.jsx("div",{className:"label",children:"Choose the visibility for your query"}),f.jsxs(sr,{variant:"contained",className:`isPublicCheck ${n===Y.public&&"disabled"}`,children:[f.jsx(ee,{variant:"contained",onClick:()=>{Q(Y.private)},color:D===Y.public||D===Y.subscription?"secondary":"primary",disabled:n===Y.public,children:x.PRIVATE}),f.jsx(ee,{variant:"contained",onClick:()=>{Q(Y.subscription)},color:D===Y.subscription?"primary":"secondary",disabled:n===Y.public,children:x.PRIVATE_TO_MY_ORG}),f.jsx(ee,{variant:"contained",onClick:()=>{Q(Y.public)},color:D===Y.public?"primary":"secondary",children:x.PUBLIC})]})]}),D===Y.public&&f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"slugInput",children:f.jsx(vt,{autoFocus:!0,label:"Unique Query Name",required:!0,placeholder:"Enter slug name",ishelpertext:1,helperText:!h&&`${c==null?void 0:c.length}/${At}`,value:c,warningText:!h&&x.MAX_LENGTH_ERROR("slug name",At),hasMax:!0,maxValue:At,onChange:O,errorText:m&&x.VIEW_NAME_ERROR("Slug"),ref:M,inputProps:{readOnly:h},endAdornment:a?f.jsx(ir,{position:"end",children:f.jsx(oe,{onClick:()=>window.open(window.location.origin+Ve.queriesSlug(r,a),"_blank"),children:f.jsx(bt,{})})}):null})}),h&&f.jsx(ze,{message:x.PUBLISHED_TEXT("query")}),D===Y.public&&!h&&f.jsx(ze,{message:x.PUBLISH_CONFIRM_MESSAGE("Query")})]}),f.jsxs("div",{className:"btnRow",children:[f.jsx(ee,{disabled:k,variant:"contained",color:"secondary",onClick:i,className:"formBtn cancel",children:x.CANCEL}),!h&&f.jsx(ee,{disabled:m||(c==null?void 0:c.length)>=50||k||D===Y.public&&!(c!=null&&c.trim()),variant:"contained",color:"primary",onClick:_,className:"formBtn submit",children:k?f.jsx("img",{src:Ko,alt:"loading",height:36}):x.SUBMIT}),h&&f.jsx(ee,{type:"button",variant:"contained",color:"primary",onClick:R,children:S?x.COPIED:x.COPY_LINK})]})]})})};function ha({queryParams:o,setPageNumber:s,setSortBy:i,onPageChange:t,onPageSizeChange:e,deleteQuery:r,defaultSize:p,handlePublishCallback:n}){const a=St(),{height:c,headerHeight:d}=_t(),m=Uo(),v=Vo(),{totalPages:k=0,totalElements:w=0}=(v==null?void 0:v.pageable)||{},S=fr(),b=pn(),D=ln(),M=b||D,[h,O]=E.useState(!1),[_,Q]=E.useState({}),[R,j]=E.useState(!1),[z,q]=E.useState({}),ae=(C,ne)=>{i(C,ne==="ASC"?"DESC":"ASC")},te=C=>s(C),_e=C=>f.jsx(mr,{className:"queryName",onClick:()=>{a.push(`/queries/${C.id}`)},children:(C==null?void 0:C.name)||"Untitled Query"}),fe=C=>C&&rn(C==null?void 0:C.modified),Ee=C=>C&&f.jsx(gr,{tags:C==null?void 0:C.tags}),le=C=>{Q(C),O(!0)},me=C=>f.jsxs(fn,{onClick:()=>le(C),className:"queryText",children:[f.jsx("span",{className:"text",children:C.queryText}),f.jsx(oe,{tooltip:"Preview",children:f.jsx(dt,{})})]}),xe=()=>c-d-170||300,Me=()=>{j(!1),q({}),We("")},Ne=C=>f.jsxs(f.Fragment,{children:[f.jsx(Zr,{label:(C==null?void 0:C.visibility)===Y.public?x.PUBLISHED:x.PUBLISH("Query"),children:f.jsx("span",{className:"publishBtn",children:f.jsx(oe,{onClick:()=>{j(!0),q(C)},children:f.jsx(Jr,{})})})}),f.jsx(oe,{onClick:()=>{a.push(`/queries/${C.id}`)},tooltip:"View",children:f.jsx(bt,{})}),f.jsx(zo,{icon:!0,confirmButtonMessage:x.YES,cancelButtonMessage:x.NO,disabled:C.visibility===Y.public,tooltip:x.DELETE(""),title:x.DELETE("Query"),confirmMessage:x.DELETE_CONFIRM_MESSAGE(`'${C.name||""}' query`),description:x.DELETE_QUERY_DESCRIPTION,onConfirm:ne=>{ne.stopPropagation(),r(C.id,C.name)}},"expire")]}),ge=()=>f.jsx(on,{imgPath:yr,imgPathWebp:vr,title:!(o!=null&&o.tagName)&&!(o!=null&&o.searchPattern)&&!(o!=null&&o.status)?x.NO_QUERY_FOUND:x.NO_RESULT_FOUND_ON_FILTER,className:"emptyBlock",children:!(o!=null&&o.tagName)&&!(o!=null&&o.searchPattern)&&f.jsx(ht,{to:"/queries/new?tabID=1",children:f.jsx(ee,{variant:"contained",color:"primary",size:"large",children:x.CREATE_NEW_QUERY})})}),ue=()=>f.jsx(an,{title:m,children:m});if(k===0&&!M&&!m)return ge();if(m)return ue();const de=()=>{Q({}),O(!1)};return f.jsxs(f.Fragment,{children:[f.jsx(un,{open:h,id:_==null?void 0:_.id,text:_==null?void 0:_.queryText,queryPreview:_,onClose:de}),f.jsx(dn,{data:S,columns:Xr,isAction:!0,actionComponent:Ne,actionColumnName:"Actions",rowRender:[{dataKey:"name",func:_e},{dataKey:"modified",func:fe},{dataKey:"tags",func:Ee},{dataKey:"queryText",func:me}],loading:M,rowSize:75,bodyHeight:xe(),onItemsSort:ae,sortBy:(o==null?void 0:o.sortBy)||"",sortOrder:(o==null?void 0:o.sortOrder)||"",nonSortableColumns:{tags:!0}}),(M?!0:(S==null?void 0:S.length)!==0)&&f.jsx("div",{className:"queryPagePagination",children:f.jsx(hn,{onChange:te,count:k,page:(o==null?void 0:o.pageNo)||0,onPageChange:t,totalElements:w,onPageSizeChange:e,isGotoPage:!0,isPageSize:!0,pageSize:(o==null?void 0:o.pageSize)||0,defaultSize:p})}),f.jsx(da,{open:R,handleClose:Me,row:z,handlePublishCallback:n})]})}var Dr={exports:{}};/*!
1
+ import{h7 as zt,mp as Br,r as E,a8 as St,j as f,am as Tt,b3 as x,cL as vn,mq as Fr,cI as rn,mr as Kr,ms as Wr,b5 as dt,c$ as bt,ds as on,al as ht,kz as Dn,bZ as an,co as It,mt as Ur,mu as Vr,mv as zr,db as Y,dw as sr,a9 as ir,b_ as Ve,dy as $r,ce as Gr,lM as Xr,aZ as Zr,dd as Jr,g as sn,a as cr,mw as qr,R as g,mx as I,my as be,mz as Ce,mA as $t,mB as De,mC as eo,mD as $,mE as wn,mF as to,mG as Ct,mH as J,mI as Ye,mJ as Pe,mK as Gt,mL as Ae,mM as no,mN as ro,mO as ie,mP as ce,mQ as Le,mR as Xt,mS as he,mT as Ge,mU as Xe,A as oo,mV as ft,mW as Zt,mX as cn,mY as Rt,mZ as ao,m_ as kn,m$ as Sn,n0 as so,n1 as io,n2 as pr,n3 as bn,n4 as it,n5 as ct,n6 as co,n7 as po,n8 as lr,n9 as ur,na as lo,nb as uo,nc as ho,nd as fo,ne as mo,nf as go,ng as Ze,nh as yo,ni as vo,nj as mt,nk as gt,nl as yt,nm as Cn,nn as _n,no as Do,D as wo,np as ko,bd as dr,bb as So,dn as pt,dU as bo,nq as Co,dN as _o,ar as Eo,dY as xo,l$ as H,au as rt,bG as Fe,ea as En,dt as xn,bH as Yt,m0 as Mo,dq as Mn,e5 as No,e6 as ot,ac as Ke,nr as Pt,aW as Oo,ns as To,dp as jt,dm as Lt,e7 as Io,nt as Ro,nu as Yo}from"./vendor-charts-25f5f9f8.js";import{u as _t,b as Po,c as jo,d as hr,e as pn,f as ln,r as Nn,g as un,C as On,h as Tn,M as Lo,V as dn,P as hn,i as Ao,H as Qo,j as fn,I as oe,B as ee,k as Ho,l as Bo,m as Fo,n as vt,N as At,o as ze,L as Ko,p as Wo,s as We,q as Uo,t as Vo,v as fr,w as mr,T as gr,x as zo,y as yr,z as vr,A as $o,D as Go,F as Xo,G as In,J as Zo,O as Jo,K as qo,R as Rn,S as ea,W as ta,U as Yn,X as Pn,Y as jn,Z as na,_ as ra,$ as oa,a0 as aa,a1 as sa,a2 as ia}from"./index-79e0a273.js";import"./vendor-editor-fad92d61.js";import"./vendor-three-d85976a9.js";const ca="/assets/emptyHistory-39807386.png",pa="/assets/emptyHistory-e09c1ac9.webp",la="/assets/heartbeat-d012a4c0.png";zt.extend(Br);function ua({queryParams:o,setSortBy:s,setPageNumber:i,onPageChange:t,onPageSizeChange:e,defaultSize:r}){var T,G,X;const{height:p,headerHeight:n}=_t(),[a,c]=E.useState(!1),[d,m]=E.useState([]),[v,k]=E.useState(null),[w,S]=E.useState({areaChartConfig:[],lineChartConfig:[]}),[b,D]=E.useState(0),M=(T=Object.keys(w))==null?void 0:T.length,h=Po(),O=jo(),_=hr(),Q=pn(),R=ln(),j=Q||R,{totalPages:z=0,totalElements:q=0}=(O==null?void 0:O.pageable)||{},ae=St();E.useEffect(()=>()=>Nn(),[]),E.useEffect(()=>{var N,Z,ye,Be,yn;if((N=_==null?void 0:_.content)!=null&&N.length){const jr=(Z=_==null?void 0:_.content)==null?void 0:Z.map(U=>U==null?void 0:U.queryType),nt={};(jr??[]).forEach(U=>{nt[U]?nt[U]+=1:nt[U]=1});const Lr=(ye=Object.entries(nt))==null?void 0:ye.map(([U,Hr])=>({Source:U,Trafic:Hr}));m(Lr);const Ar=(Be=_==null?void 0:_.content)==null?void 0:Be.map(U=>({Timestamp:U.timestamp,Usage:U.usage,Runtime:U.runtime})),Qr=(yn=_==null?void 0:_.content)==null?void 0:yn.map(U=>({Timestamp:U.timestamp,Usage:U.usage,DataVolume:U.responseSize}));S({areaChartConfig:Ar,lineChartConfig:Qr}),(o==null?void 0:o.isRecent)==="false"&&D(0)}else m([])},[_==null?void 0:_.content,o]);const te=N=>i(N),_e=(N,Z)=>{if(N==="systemHeartbeat"||N==="CPUSkew")return;const ye=Z==="ASC"?"DESC":"ASC";Nn(),s(N,ye)},fe=N=>{ae.push("/queries/new?tabID=1"),Dn(N)},Ee=N=>{k(N),c(!0)},le=()=>{k(null),c(!1)},me=({timestamp:N})=>rn(N),xe=({runtime:N})=>Kr(N),Me=({responseSize:N=0})=>Wr(N),Ne=({cpuskew:N="59%"})=>f.jsx(Ao,{children:N}),ge=({systemHeartbeat:N="58"})=>f.jsxs(Qo,{children:[f.jsx("img",{src:la,alt:"system-heartbeat"}),f.jsx("span",{children:N})]}),ue=N=>f.jsx("span",{className:"text",children:N.queryType?N.queryType:"-"}),de=N=>f.jsx("span",{className:"text",children:N!=null&&N.usage?N.usage:"-"}),C=N=>f.jsxs(fn,{onClick:()=>Ee(N),className:"queryText",children:[f.jsx("span",{className:"text",children:N.sqlText}),f.jsx(oe,{tooltip:"Preview",children:f.jsx(dt,{})})]}),ne=N=>f.jsx(oe,{onClick:()=>{fe(N)},tooltip:x.VIEW_IN_EDITOR,children:f.jsx(bt,{})}),Ie=()=>f.jsx(on,{imgPath:ca,imgPathWebp:pa,title:!(o!=null&&o.tagName)&&!(o!=null&&o.searchKeyword)?x.EMPTY_QUERY_HISTORY:x.NO_RESULT_FOUND_ON_FILTER,children:!(o!=null&&o.tagName)&&!(o!=null&&o.searchKeyword)&&f.jsx(ht,{to:"/queries/new?tabID=1",children:f.jsx(ee,{variant:"contained",color:"primary",size:"large",children:x.CREATE_NEW_QUERY})})}),He=()=>p-n-230||300,Re=()=>{v&&Dn(v)},Nt=()=>f.jsx(an,{title:h,children:h});if((O==null?void 0:O.totalElements)===0)return Ie();if(h)return Nt();const qe=()=>{D(N=>N+1)},Ot=()=>{D(N=>N-1)},et=()=>{D(0)},tt=()=>{D(M-1)},y=()=>{var Be;let N,Z,ye;switch(b){case 1:b===1&&(N="Usage and Data Volume Variation over time",Z=It.column_chart,ye=zr);break;default:N="Usage and Runtime Trends Over Time",Z=It.area_chart,ye=Vr}return console.log("queryHistory",_.content),f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"cardHead",children:[f.jsx("span",{className:"cardHeadTitle",children:N}),f.jsx("span",{className:"cardHeadCount",children:(Be=_==null?void 0:_.content)==null?void 0:Be.length})]}),f.jsx("div",{className:"cardBody",children:f.jsx(vn,{isRunning:j,config:Tn({data:Z===It.area_chart?w.areaChartConfig:w.lineChartConfig,chartConfigurationData:ye}).config,type:Z})})]})};return f.jsxs(f.Fragment,{children:[f.jsx(un,{open:a,id:v==null?void 0:v.savedQueryId,text:v==null?void 0:v.sqlText,onClose:le,onClickView:Re,isHistory:!0}),(j||((G=_==null?void 0:_.content)==null?void 0:G.length)>0)&&(o==null?void 0:o.isRecent)==="false"&&f.jsxs(Tt,{container:!0,spacing:{xs:1,sm:3},children:[f.jsx(Tt,{item:!0,sm:5,xs:12,children:f.jsxs(On,{children:[f.jsxs("div",{className:"cardHead",children:[f.jsx("span",{className:"cardHeadTitle",children:x.TOTAL_QUERIES}),f.jsx("span",{className:"cardHeadCount",children:(X=_==null?void 0:_.content)==null?void 0:X.length})]}),f.jsx("div",{className:"cardBody",children:f.jsx(vn,{isRunning:j,config:Tn({data:d,chartConfigurationData:Ur}).config,type:"pie_chart"})})]})}),f.jsx(Tt,{item:!0,sm:7,xs:12,children:f.jsxs(On,{children:[y(),!j&&f.jsx(Lo,{maxSteps:M,activeStep:b,handleFirst:et,handleLast:tt,handleNext:qe,handlePrev:Ot})]})})]}),f.jsx(dn,{data:_==null?void 0:_.content,columns:Fr,isAction:!0,actionComponent:N=>ne(N),loading:j,rowRender:[{dataKey:"sqlText",func:C},{dataKey:"timestamp",func:me},{dataKey:"runtime",func:xe},{dataKey:"responseSize",func:Me},{dataKey:"systemHeartbeat",func:ge},{dataKey:"CPUSkew",func:Ne},{dataKey:"queryType",func:ue},{dataKey:"usage",func:de}],rowSize:75,bodyHeight:He(),onItemsSort:_e,sortBy:o==null?void 0:o.sortBy,sortOrder:(o==null?void 0:o.sortOrder)||""}),(j?!0:(_==null?void 0:_.length)!==0)&&f.jsx(hn,{onChange:te,count:z,page:o.pageNo,onPageChange:t,totalElements:q,onPageSizeChange:e,isGotoPage:!0,isPageSize:!0,pageSize:o.pageSize,defaultSize:r})]})}const da=o=>{const{row:s,handleClose:i,handlePublishCallback:t,open:e}=o,{id:r,queryName:p,visibility:n,slug:a}=s||{},[c,d]=E.useState(""),[m,v]=E.useState(!1),[k,w]=E.useState(!1),[S,b]=E.useState(!1),D=Ho()||(s==null?void 0:s.visibility),M=E.useRef(null),h=n===Y.public;E.useEffect(()=>{if(e&&n===Y.public){const j=window.location.origin+Ve.queriesSlug(r,a);d(j)}else d(""),b(!1),M.current=null},[e]);const O=j=>{var ae,te;const z=((te=(ae=j==null?void 0:j.target)==null?void 0:ae.value)==null?void 0:te.trim())||"",q=(z==null?void 0:z.length)>0&&$r(z);v(q),z!==c&&d(z)},_=async()=>{w(!0),await Wo(r,p,c,D,t)===x.RESPONSE_SUCCESS_STATUS&&i(),w(!1)},Q=j=>{switch(j){case Y.public:We(Y.public);break;case Y.private:We(Y.private);break;case Y.subscription:We(Y.subscription);break;default:We(Y.private)}},R=()=>{Gr(c).then(()=>{b(!0)})};return f.jsx(Bo,{title:x.QUERY_PUBLISH,visible:e,maxWidth:"sm",onClose:i,children:f.jsxs(Fo,{children:[f.jsxs("div",{className:"visibilityCheck",children:[f.jsx("div",{className:"label",children:"Choose the visibility for your query"}),f.jsxs(sr,{variant:"contained",className:`isPublicCheck ${n===Y.public&&"disabled"}`,children:[f.jsx(ee,{variant:"contained",onClick:()=>{Q(Y.private)},color:D===Y.public||D===Y.subscription?"secondary":"primary",disabled:n===Y.public,children:x.PRIVATE}),f.jsx(ee,{variant:"contained",onClick:()=>{Q(Y.subscription)},color:D===Y.subscription?"primary":"secondary",disabled:n===Y.public,children:x.PRIVATE_TO_MY_ORG}),f.jsx(ee,{variant:"contained",onClick:()=>{Q(Y.public)},color:D===Y.public?"primary":"secondary",children:x.PUBLIC})]})]}),D===Y.public&&f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"slugInput",children:f.jsx(vt,{autoFocus:!0,label:"Unique Query Name",required:!0,placeholder:"Enter slug name",ishelpertext:1,helperText:!h&&`${c==null?void 0:c.length}/${At}`,value:c,warningText:!h&&x.MAX_LENGTH_ERROR("slug name",At),hasMax:!0,maxValue:At,onChange:O,errorText:m&&x.VIEW_NAME_ERROR("Slug"),ref:M,inputProps:{readOnly:h},endAdornment:a?f.jsx(ir,{position:"end",children:f.jsx(oe,{onClick:()=>window.open(window.location.origin+Ve.queriesSlug(r,a),"_blank"),children:f.jsx(bt,{})})}):null})}),h&&f.jsx(ze,{message:x.PUBLISHED_TEXT("query")}),D===Y.public&&!h&&f.jsx(ze,{message:x.PUBLISH_CONFIRM_MESSAGE("Query")})]}),f.jsxs("div",{className:"btnRow",children:[f.jsx(ee,{disabled:k,variant:"contained",color:"secondary",onClick:i,className:"formBtn cancel",children:x.CANCEL}),!h&&f.jsx(ee,{disabled:m||(c==null?void 0:c.length)>=50||k||D===Y.public&&!(c!=null&&c.trim()),variant:"contained",color:"primary",onClick:_,className:"formBtn submit",children:k?f.jsx("img",{src:Ko,alt:"loading",height:36}):x.SUBMIT}),h&&f.jsx(ee,{type:"button",variant:"contained",color:"primary",onClick:R,children:S?x.COPIED:x.COPY_LINK})]})]})})};function ha({queryParams:o,setPageNumber:s,setSortBy:i,onPageChange:t,onPageSizeChange:e,deleteQuery:r,defaultSize:p,handlePublishCallback:n}){const a=St(),{height:c,headerHeight:d}=_t(),m=Uo(),v=Vo(),{totalPages:k=0,totalElements:w=0}=(v==null?void 0:v.pageable)||{},S=fr(),b=pn(),D=ln(),M=b||D,[h,O]=E.useState(!1),[_,Q]=E.useState({}),[R,j]=E.useState(!1),[z,q]=E.useState({}),ae=(C,ne)=>{i(C,ne==="ASC"?"DESC":"ASC")},te=C=>s(C),_e=C=>f.jsx(mr,{className:"queryName",onClick:()=>{a.push(`/queries/${C.id}`)},children:(C==null?void 0:C.name)||"Untitled Query"}),fe=C=>C&&rn(C==null?void 0:C.modified),Ee=C=>C&&f.jsx(gr,{tags:C==null?void 0:C.tags}),le=C=>{Q(C),O(!0)},me=C=>f.jsxs(fn,{onClick:()=>le(C),className:"queryText",children:[f.jsx("span",{className:"text",children:C.queryText}),f.jsx(oe,{tooltip:"Preview",children:f.jsx(dt,{})})]}),xe=()=>c-d-170||300,Me=()=>{j(!1),q({}),We("")},Ne=C=>f.jsxs(f.Fragment,{children:[f.jsx(Zr,{label:(C==null?void 0:C.visibility)===Y.public?x.PUBLISHED:x.PUBLISH("Query"),children:f.jsx("span",{className:"publishBtn",children:f.jsx(oe,{onClick:()=>{j(!0),q(C)},children:f.jsx(Jr,{})})})}),f.jsx(oe,{onClick:()=>{a.push(`/queries/${C.id}`)},tooltip:"View",children:f.jsx(bt,{})}),f.jsx(zo,{icon:!0,confirmButtonMessage:x.YES,cancelButtonMessage:x.NO,disabled:C.visibility===Y.public,tooltip:x.DELETE(""),title:x.DELETE("Query"),confirmMessage:x.DELETE_CONFIRM_MESSAGE(`'${C.name||""}' query`),description:x.DELETE_QUERY_DESCRIPTION,onConfirm:ne=>{ne.stopPropagation(),r(C.id,C.name)}},"expire")]}),ge=()=>f.jsx(on,{imgPath:yr,imgPathWebp:vr,title:!(o!=null&&o.tagName)&&!(o!=null&&o.searchPattern)&&!(o!=null&&o.status)?x.NO_QUERY_FOUND:x.NO_RESULT_FOUND_ON_FILTER,className:"emptyBlock",children:!(o!=null&&o.tagName)&&!(o!=null&&o.searchPattern)&&f.jsx(ht,{to:"/queries/new?tabID=1",children:f.jsx(ee,{variant:"contained",color:"primary",size:"large",children:x.CREATE_NEW_QUERY})})}),ue=()=>f.jsx(an,{title:m,children:m});if(k===0&&!M&&!m)return ge();if(m)return ue();const de=()=>{Q({}),O(!1)};return f.jsxs(f.Fragment,{children:[f.jsx(un,{open:h,id:_==null?void 0:_.id,text:_==null?void 0:_.queryText,queryPreview:_,onClose:de}),f.jsx(dn,{data:S,columns:Xr,isAction:!0,actionComponent:Ne,actionColumnName:"Actions",rowRender:[{dataKey:"name",func:_e},{dataKey:"modified",func:fe},{dataKey:"tags",func:Ee},{dataKey:"queryText",func:me}],loading:M,rowSize:75,bodyHeight:xe(),onItemsSort:ae,sortBy:(o==null?void 0:o.sortBy)||"",sortOrder:(o==null?void 0:o.sortOrder)||"",nonSortableColumns:{tags:!0}}),(M?!0:(S==null?void 0:S.length)!==0)&&f.jsx("div",{className:"queryPagePagination",children:f.jsx(hn,{onChange:te,count:k,page:(o==null?void 0:o.pageNo)||0,onPageChange:t,totalElements:w,onPageSizeChange:e,isGotoPage:!0,isPageSize:!0,pageSize:(o==null?void 0:o.pageSize)||0,defaultSize:p})}),f.jsx(da,{open:R,handleClose:Me,row:z,handlePublishCallback:n})]})}var Dr={exports:{}};/*!
2
2
  Copyright (c) 2018 Jed Watson.
3
3
  Licensed under the MIT License (MIT), see
4
4
  http://jedwatson.github.io/classnames
@@ -0,0 +1 @@
1
+ import{j as r,r as t}from"./vendor-charts-25f5f9f8.js";import{O as o,Q as a}from"./index-79e0a273.js";import"./vendor-editor-fad92d61.js";import"./vendor-three-d85976a9.js";function m(){return r.jsx(t.Suspense,{fallback:o,children:r.jsx(a,{})})}export{m as default};
@@ -1 +1 @@
1
- import{nC as m,nD as h,nE as R,a4 as V}from"./vendor-charts-1d8c8804.js";const o=m({history:["ConnectWallet"],view:"ConnectWallet",data:void 0}),N={state:o,subscribe(e){return h(o,()=>e(o))},push(e,t){e!==o.view&&(o.view=e,t&&(o.data=t),o.history.push(e))},reset(e){o.view=e,o.history=[e]},replace(e){o.history.length>1&&(o.history[o.history.length-1]=e,o.view=e)},goBack(){if(o.history.length>1){o.history.pop();const[e]=o.history.slice(-1);o.view=e}},setData(e){o.data=e}},a={WALLETCONNECT_DEEPLINK_CHOICE:"WALLETCONNECT_DEEPLINK_CHOICE",WCM_VERSION:"WCM_VERSION",RECOMMENDED_WALLET_AMOUNT:9,isMobile(){return typeof window<"u"?!!(window.matchMedia("(pointer:coarse)").matches||/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)):!1},isAndroid(){return a.isMobile()&&navigator.userAgent.toLowerCase().includes("android")},isIos(){const e=navigator.userAgent.toLowerCase();return a.isMobile()&&(e.includes("iphone")||e.includes("ipad"))},isHttpUrl(e){return e.startsWith("http://")||e.startsWith("https://")},isArray(e){return Array.isArray(e)&&e.length>0},isTelegram(){return typeof window<"u"&&(!!window.TelegramWebviewProxy||!!window.Telegram||!!window.TelegramWebviewProxyProto)},formatNativeUrl(e,t,s){if(a.isHttpUrl(e))return this.formatUniversalUrl(e,t,s);let n=e;n.includes("://")||(n=e.replaceAll("/","").replaceAll(":",""),n=`${n}://`),n.endsWith("/")||(n=`${n}/`),this.setWalletConnectDeepLink(n,s);const l=encodeURIComponent(t);return`${n}wc?uri=${l}`},formatUniversalUrl(e,t,s){if(!a.isHttpUrl(e))return this.formatNativeUrl(e,t,s);let n=e;if(n.startsWith("https://t.me")){const i=Buffer.from(t).toString("base64").replace(/[=]/g,"");n.endsWith("/")&&(n=n.slice(0,-1)),this.setWalletConnectDeepLink(n,s);const c=new URL(n);return c.searchParams.set("startapp",i),c.toString()}n.endsWith("/")||(n=`${n}/`),this.setWalletConnectDeepLink(n,s);const l=encodeURIComponent(t);return`${n}wc?uri=${l}`},async wait(e){return new Promise(t=>{setTimeout(t,e)})},openHref(e,t){const s=this.isTelegram()?"_blank":t;window.open(e,s,"noreferrer noopener")},setWalletConnectDeepLink(e,t){try{localStorage.setItem(a.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:e,name:t}))}catch{console.info("Unable to set WalletConnect deep link")}},setWalletConnectAndroidDeepLink(e){try{const[t]=e.split("?");localStorage.setItem(a.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:t,name:"Android"}))}catch{console.info("Unable to set WalletConnect android deep link")}},removeWalletConnectDeepLink(){try{localStorage.removeItem(a.WALLETCONNECT_DEEPLINK_CHOICE)}catch{console.info("Unable to remove WalletConnect deep link")}},setModalVersionInStorage(){try{typeof localStorage<"u"&&localStorage.setItem(a.WCM_VERSION,"2.7.0")}catch{console.info("Unable to set Web3Modal version in storage")}},getWalletRouterData(){var e;const t=(e=N.state.data)==null?void 0:e.Wallet;if(!t)throw new Error('Missing "Wallet" view data');return t}},B=typeof location<"u"&&(location.hostname.includes("localhost")||location.protocol.includes("https")),r=m({enabled:B,userSessionId:"",events:[],connectedWalletId:void 0}),H={state:r,subscribe(e){return h(r.events,()=>e(R(r.events[r.events.length-1])))},initialize(){r.enabled&&typeof(crypto==null?void 0:crypto.randomUUID)<"u"&&(r.userSessionId=crypto.randomUUID())},setConnectedWalletId(e){r.connectedWalletId=e},click(e){if(r.enabled){const t={type:"CLICK",name:e.name,userSessionId:r.userSessionId,timestamp:Date.now(),data:e};r.events.push(t)}},track(e){if(r.enabled){const t={type:"TRACK",name:e.name,userSessionId:r.userSessionId,timestamp:Date.now(),data:e};r.events.push(t)}},view(e){if(r.enabled){const t={type:"VIEW",name:e.name,userSessionId:r.userSessionId,timestamp:Date.now(),data:e};r.events.push(t)}}},u=m({chains:void 0,walletConnectUri:void 0,isAuth:!1,isCustomDesktop:!1,isCustomMobile:!1,isDataLoaded:!1,isUiLoaded:!1}),d={state:u,subscribe(e){return h(u,()=>e(u))},setChains(e){u.chains=e},setWalletConnectUri(e){u.walletConnectUri=e},setIsCustomDesktop(e){u.isCustomDesktop=e},setIsCustomMobile(e){u.isCustomMobile=e},setIsDataLoaded(e){u.isDataLoaded=e},setIsUiLoaded(e){u.isUiLoaded=e},setIsAuth(e){u.isAuth=e}},w=m({projectId:"",mobileWallets:void 0,desktopWallets:void 0,walletImages:void 0,chains:void 0,enableAuthMode:!1,enableExplorer:!0,explorerExcludedWalletIds:void 0,explorerRecommendedWalletIds:void 0,termsOfServiceUrl:void 0,privacyPolicyUrl:void 0}),C={state:w,subscribe(e){return h(w,()=>e(w))},setConfig(e){var t,s;H.initialize(),d.setChains(e.chains),d.setIsAuth(!!e.enableAuthMode),d.setIsCustomMobile(!!((t=e.mobileWallets)!=null&&t.length)),d.setIsCustomDesktop(!!((s=e.desktopWallets)!=null&&s.length)),a.setModalVersionInStorage(),Object.assign(w,e)}};var K=Object.defineProperty,M=Object.getOwnPropertySymbols,z=Object.prototype.hasOwnProperty,q=Object.prototype.propertyIsEnumerable,D=(e,t,s)=>t in e?K(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,J=(e,t)=>{for(var s in t||(t={}))z.call(t,s)&&D(e,s,t[s]);if(M)for(var s of M(t))q.call(t,s)&&D(e,s,t[s]);return e};const L="https://explorer-api.walletconnect.com",O="wcm",A="js-2.7.0";async function W(e,t){const s=J({sdkType:O,sdkVersion:A},t),n=new URL(e,L);return n.searchParams.append("projectId",C.state.projectId),Object.entries(s).forEach(([i,c])=>{c&&n.searchParams.append(i,String(c))}),(await fetch(n)).json()}const f={async getDesktopListings(e){return W("/w3m/v1/getDesktopListings",e)},async getMobileListings(e){return W("/w3m/v1/getMobileListings",e)},async getInjectedListings(e){return W("/w3m/v1/getInjectedListings",e)},async getAllListings(e){return W("/w3m/v1/getAllListings",e)},getWalletImageUrl(e){return`${L}/w3m/v1/getWalletImage/${e}?projectId=${C.state.projectId}&sdkType=${O}&sdkVersion=${A}`},getAssetImageUrl(e){return`${L}/w3m/v1/getAssetImage/${e}?projectId=${C.state.projectId}&sdkType=${O}&sdkVersion=${A}`}};var F=Object.defineProperty,U=Object.getOwnPropertySymbols,Y=Object.prototype.hasOwnProperty,G=Object.prototype.propertyIsEnumerable,S=(e,t,s)=>t in e?F(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,Q=(e,t)=>{for(var s in t||(t={}))Y.call(t,s)&&S(e,s,t[s]);if(U)for(var s of U(t))G.call(t,s)&&S(e,s,t[s]);return e};const T=a.isMobile(),p=m({wallets:{listings:[],total:0,page:1},search:{listings:[],total:0,page:1},recomendedWallets:[]}),re={state:p,async getRecomendedWallets(){const{explorerRecommendedWalletIds:e,explorerExcludedWalletIds:t}=C.state;if(e==="NONE"||t==="ALL"&&!e)return p.recomendedWallets;if(a.isArray(e)){const n={recommendedIds:e.join(",")},{listings:l}=await f.getAllListings(n),i=Object.values(l);i.sort((c,v)=>{const y=e.indexOf(c.id),_=e.indexOf(v.id);return y-_}),p.recomendedWallets=i}else{const{chains:s,isAuth:n}=d.state,l=s==null?void 0:s.join(","),i=a.isArray(t),c={page:1,sdks:n?"auth_v1":void 0,entries:a.RECOMMENDED_WALLET_AMOUNT,chains:l,version:2,excludedIds:i?t.join(","):void 0},{listings:v}=T?await f.getMobileListings(c):await f.getDesktopListings(c);p.recomendedWallets=Object.values(v)}return p.recomendedWallets},async getWallets(e){const t=Q({},e),{explorerRecommendedWalletIds:s,explorerExcludedWalletIds:n}=C.state,{recomendedWallets:l}=p;if(n==="ALL")return p.wallets;l.length?t.excludedIds=l.map(x=>x.id).join(","):a.isArray(s)&&(t.excludedIds=s.join(",")),a.isArray(n)&&(t.excludedIds=[t.excludedIds,n].filter(Boolean).join(",")),d.state.isAuth&&(t.sdks="auth_v1");const{page:i,search:c}=e,{listings:v,total:y}=T?await f.getMobileListings(t):await f.getDesktopListings(t),_=Object.values(v),P=c?"search":"wallets";return p[P]={listings:[...p[P].listings,..._],total:y,page:i??1},{listings:_,total:y}},getWalletImageUrl(e){return f.getWalletImageUrl(e)},getAssetImageUrl(e){return f.getAssetImageUrl(e)},resetSearch(){p.search={listings:[],total:0,page:1}}},I=m({open:!1}),E={state:I,subscribe(e){return h(I,()=>e(I))},async open(e){return new Promise(t=>{const{isUiLoaded:s,isDataLoaded:n}=d.state;if(a.removeWalletConnectDeepLink(),d.setWalletConnectUri(e==null?void 0:e.uri),d.setChains(e==null?void 0:e.chains),N.reset("ConnectWallet"),s&&n)I.open=!0,t();else{const l=setInterval(()=>{const i=d.state;i.isUiLoaded&&i.isDataLoaded&&(clearInterval(l),I.open=!0,t())},200)}})},close(){I.open=!1}};var X=Object.defineProperty,$=Object.getOwnPropertySymbols,Z=Object.prototype.hasOwnProperty,ee=Object.prototype.propertyIsEnumerable,j=(e,t,s)=>t in e?X(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,te=(e,t)=>{for(var s in t||(t={}))Z.call(t,s)&&j(e,s,t[s]);if($)for(var s of $(t))ee.call(t,s)&&j(e,s,t[s]);return e};function se(){return typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: dark)").matches}const b=m({themeMode:se()?"dark":"light"}),k={state:b,subscribe(e){return h(b,()=>e(b))},setThemeConfig(e){const{themeMode:t,themeVariables:s}=e;t&&(b.themeMode=t),s&&(b.themeVariables=te({},s))}},g=m({open:!1,message:"",variant:"success"}),ae={state:g,subscribe(e){return h(g,()=>e(g))},openToast(e,t){g.open=!0,g.message=e,g.variant=t},closeToast(){g.open=!1}};class ne{constructor(t){this.openModal=E.open,this.closeModal=E.close,this.subscribeModal=E.subscribe,this.setTheme=k.setThemeConfig,k.setThemeConfig(t),C.setConfig(t),this.initUi()}async initUi(){if(typeof window<"u"){await V(()=>import("./index-0ce80e3c.js"),["assets/index-0ce80e3c.js","assets/vendor-charts-1d8c8804.js"]);const t=document.createElement("wcm-modal");document.body.insertAdjacentElement("beforeend",t),d.setIsUiLoaded(!0)}}}const ie=Object.freeze(Object.defineProperty({__proto__:null,WalletConnectModal:ne},Symbol.toStringTag,{value:"Module"}));export{a as C,re as E,E as M,d as O,N as R,k as T,ae as a,H as b,C as c,ie as i};
1
+ import{nC as m,nD as h,nE as R,a4 as V}from"./vendor-charts-25f5f9f8.js";const o=m({history:["ConnectWallet"],view:"ConnectWallet",data:void 0}),N={state:o,subscribe(e){return h(o,()=>e(o))},push(e,t){e!==o.view&&(o.view=e,t&&(o.data=t),o.history.push(e))},reset(e){o.view=e,o.history=[e]},replace(e){o.history.length>1&&(o.history[o.history.length-1]=e,o.view=e)},goBack(){if(o.history.length>1){o.history.pop();const[e]=o.history.slice(-1);o.view=e}},setData(e){o.data=e}},a={WALLETCONNECT_DEEPLINK_CHOICE:"WALLETCONNECT_DEEPLINK_CHOICE",WCM_VERSION:"WCM_VERSION",RECOMMENDED_WALLET_AMOUNT:9,isMobile(){return typeof window<"u"?!!(window.matchMedia("(pointer:coarse)").matches||/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)):!1},isAndroid(){return a.isMobile()&&navigator.userAgent.toLowerCase().includes("android")},isIos(){const e=navigator.userAgent.toLowerCase();return a.isMobile()&&(e.includes("iphone")||e.includes("ipad"))},isHttpUrl(e){return e.startsWith("http://")||e.startsWith("https://")},isArray(e){return Array.isArray(e)&&e.length>0},isTelegram(){return typeof window<"u"&&(!!window.TelegramWebviewProxy||!!window.Telegram||!!window.TelegramWebviewProxyProto)},formatNativeUrl(e,t,s){if(a.isHttpUrl(e))return this.formatUniversalUrl(e,t,s);let n=e;n.includes("://")||(n=e.replaceAll("/","").replaceAll(":",""),n=`${n}://`),n.endsWith("/")||(n=`${n}/`),this.setWalletConnectDeepLink(n,s);const l=encodeURIComponent(t);return`${n}wc?uri=${l}`},formatUniversalUrl(e,t,s){if(!a.isHttpUrl(e))return this.formatNativeUrl(e,t,s);let n=e;if(n.startsWith("https://t.me")){const i=Buffer.from(t).toString("base64").replace(/[=]/g,"");n.endsWith("/")&&(n=n.slice(0,-1)),this.setWalletConnectDeepLink(n,s);const c=new URL(n);return c.searchParams.set("startapp",i),c.toString()}n.endsWith("/")||(n=`${n}/`),this.setWalletConnectDeepLink(n,s);const l=encodeURIComponent(t);return`${n}wc?uri=${l}`},async wait(e){return new Promise(t=>{setTimeout(t,e)})},openHref(e,t){const s=this.isTelegram()?"_blank":t;window.open(e,s,"noreferrer noopener")},setWalletConnectDeepLink(e,t){try{localStorage.setItem(a.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:e,name:t}))}catch{console.info("Unable to set WalletConnect deep link")}},setWalletConnectAndroidDeepLink(e){try{const[t]=e.split("?");localStorage.setItem(a.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:t,name:"Android"}))}catch{console.info("Unable to set WalletConnect android deep link")}},removeWalletConnectDeepLink(){try{localStorage.removeItem(a.WALLETCONNECT_DEEPLINK_CHOICE)}catch{console.info("Unable to remove WalletConnect deep link")}},setModalVersionInStorage(){try{typeof localStorage<"u"&&localStorage.setItem(a.WCM_VERSION,"2.7.0")}catch{console.info("Unable to set Web3Modal version in storage")}},getWalletRouterData(){var e;const t=(e=N.state.data)==null?void 0:e.Wallet;if(!t)throw new Error('Missing "Wallet" view data');return t}},B=typeof location<"u"&&(location.hostname.includes("localhost")||location.protocol.includes("https")),r=m({enabled:B,userSessionId:"",events:[],connectedWalletId:void 0}),H={state:r,subscribe(e){return h(r.events,()=>e(R(r.events[r.events.length-1])))},initialize(){r.enabled&&typeof(crypto==null?void 0:crypto.randomUUID)<"u"&&(r.userSessionId=crypto.randomUUID())},setConnectedWalletId(e){r.connectedWalletId=e},click(e){if(r.enabled){const t={type:"CLICK",name:e.name,userSessionId:r.userSessionId,timestamp:Date.now(),data:e};r.events.push(t)}},track(e){if(r.enabled){const t={type:"TRACK",name:e.name,userSessionId:r.userSessionId,timestamp:Date.now(),data:e};r.events.push(t)}},view(e){if(r.enabled){const t={type:"VIEW",name:e.name,userSessionId:r.userSessionId,timestamp:Date.now(),data:e};r.events.push(t)}}},u=m({chains:void 0,walletConnectUri:void 0,isAuth:!1,isCustomDesktop:!1,isCustomMobile:!1,isDataLoaded:!1,isUiLoaded:!1}),d={state:u,subscribe(e){return h(u,()=>e(u))},setChains(e){u.chains=e},setWalletConnectUri(e){u.walletConnectUri=e},setIsCustomDesktop(e){u.isCustomDesktop=e},setIsCustomMobile(e){u.isCustomMobile=e},setIsDataLoaded(e){u.isDataLoaded=e},setIsUiLoaded(e){u.isUiLoaded=e},setIsAuth(e){u.isAuth=e}},w=m({projectId:"",mobileWallets:void 0,desktopWallets:void 0,walletImages:void 0,chains:void 0,enableAuthMode:!1,enableExplorer:!0,explorerExcludedWalletIds:void 0,explorerRecommendedWalletIds:void 0,termsOfServiceUrl:void 0,privacyPolicyUrl:void 0}),C={state:w,subscribe(e){return h(w,()=>e(w))},setConfig(e){var t,s;H.initialize(),d.setChains(e.chains),d.setIsAuth(!!e.enableAuthMode),d.setIsCustomMobile(!!((t=e.mobileWallets)!=null&&t.length)),d.setIsCustomDesktop(!!((s=e.desktopWallets)!=null&&s.length)),a.setModalVersionInStorage(),Object.assign(w,e)}};var K=Object.defineProperty,M=Object.getOwnPropertySymbols,z=Object.prototype.hasOwnProperty,q=Object.prototype.propertyIsEnumerable,D=(e,t,s)=>t in e?K(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,J=(e,t)=>{for(var s in t||(t={}))z.call(t,s)&&D(e,s,t[s]);if(M)for(var s of M(t))q.call(t,s)&&D(e,s,t[s]);return e};const L="https://explorer-api.walletconnect.com",O="wcm",A="js-2.7.0";async function W(e,t){const s=J({sdkType:O,sdkVersion:A},t),n=new URL(e,L);return n.searchParams.append("projectId",C.state.projectId),Object.entries(s).forEach(([i,c])=>{c&&n.searchParams.append(i,String(c))}),(await fetch(n)).json()}const f={async getDesktopListings(e){return W("/w3m/v1/getDesktopListings",e)},async getMobileListings(e){return W("/w3m/v1/getMobileListings",e)},async getInjectedListings(e){return W("/w3m/v1/getInjectedListings",e)},async getAllListings(e){return W("/w3m/v1/getAllListings",e)},getWalletImageUrl(e){return`${L}/w3m/v1/getWalletImage/${e}?projectId=${C.state.projectId}&sdkType=${O}&sdkVersion=${A}`},getAssetImageUrl(e){return`${L}/w3m/v1/getAssetImage/${e}?projectId=${C.state.projectId}&sdkType=${O}&sdkVersion=${A}`}};var F=Object.defineProperty,U=Object.getOwnPropertySymbols,Y=Object.prototype.hasOwnProperty,G=Object.prototype.propertyIsEnumerable,S=(e,t,s)=>t in e?F(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,Q=(e,t)=>{for(var s in t||(t={}))Y.call(t,s)&&S(e,s,t[s]);if(U)for(var s of U(t))G.call(t,s)&&S(e,s,t[s]);return e};const T=a.isMobile(),p=m({wallets:{listings:[],total:0,page:1},search:{listings:[],total:0,page:1},recomendedWallets:[]}),re={state:p,async getRecomendedWallets(){const{explorerRecommendedWalletIds:e,explorerExcludedWalletIds:t}=C.state;if(e==="NONE"||t==="ALL"&&!e)return p.recomendedWallets;if(a.isArray(e)){const n={recommendedIds:e.join(",")},{listings:l}=await f.getAllListings(n),i=Object.values(l);i.sort((c,v)=>{const y=e.indexOf(c.id),_=e.indexOf(v.id);return y-_}),p.recomendedWallets=i}else{const{chains:s,isAuth:n}=d.state,l=s==null?void 0:s.join(","),i=a.isArray(t),c={page:1,sdks:n?"auth_v1":void 0,entries:a.RECOMMENDED_WALLET_AMOUNT,chains:l,version:2,excludedIds:i?t.join(","):void 0},{listings:v}=T?await f.getMobileListings(c):await f.getDesktopListings(c);p.recomendedWallets=Object.values(v)}return p.recomendedWallets},async getWallets(e){const t=Q({},e),{explorerRecommendedWalletIds:s,explorerExcludedWalletIds:n}=C.state,{recomendedWallets:l}=p;if(n==="ALL")return p.wallets;l.length?t.excludedIds=l.map(x=>x.id).join(","):a.isArray(s)&&(t.excludedIds=s.join(",")),a.isArray(n)&&(t.excludedIds=[t.excludedIds,n].filter(Boolean).join(",")),d.state.isAuth&&(t.sdks="auth_v1");const{page:i,search:c}=e,{listings:v,total:y}=T?await f.getMobileListings(t):await f.getDesktopListings(t),_=Object.values(v),P=c?"search":"wallets";return p[P]={listings:[...p[P].listings,..._],total:y,page:i??1},{listings:_,total:y}},getWalletImageUrl(e){return f.getWalletImageUrl(e)},getAssetImageUrl(e){return f.getAssetImageUrl(e)},resetSearch(){p.search={listings:[],total:0,page:1}}},I=m({open:!1}),E={state:I,subscribe(e){return h(I,()=>e(I))},async open(e){return new Promise(t=>{const{isUiLoaded:s,isDataLoaded:n}=d.state;if(a.removeWalletConnectDeepLink(),d.setWalletConnectUri(e==null?void 0:e.uri),d.setChains(e==null?void 0:e.chains),N.reset("ConnectWallet"),s&&n)I.open=!0,t();else{const l=setInterval(()=>{const i=d.state;i.isUiLoaded&&i.isDataLoaded&&(clearInterval(l),I.open=!0,t())},200)}})},close(){I.open=!1}};var X=Object.defineProperty,$=Object.getOwnPropertySymbols,Z=Object.prototype.hasOwnProperty,ee=Object.prototype.propertyIsEnumerable,j=(e,t,s)=>t in e?X(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,te=(e,t)=>{for(var s in t||(t={}))Z.call(t,s)&&j(e,s,t[s]);if($)for(var s of $(t))ee.call(t,s)&&j(e,s,t[s]);return e};function se(){return typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: dark)").matches}const b=m({themeMode:se()?"dark":"light"}),k={state:b,subscribe(e){return h(b,()=>e(b))},setThemeConfig(e){const{themeMode:t,themeVariables:s}=e;t&&(b.themeMode=t),s&&(b.themeVariables=te({},s))}},g=m({open:!1,message:"",variant:"success"}),ae={state:g,subscribe(e){return h(g,()=>e(g))},openToast(e,t){g.open=!0,g.message=e,g.variant=t},closeToast(){g.open=!1}};class ne{constructor(t){this.openModal=E.open,this.closeModal=E.close,this.subscribeModal=E.subscribe,this.setTheme=k.setThemeConfig,k.setThemeConfig(t),C.setConfig(t),this.initUi()}async initUi(){if(typeof window<"u"){await V(()=>import("./index-b40174d3.js"),["assets/index-b40174d3.js","assets/vendor-charts-25f5f9f8.js"]);const t=document.createElement("wcm-modal");document.body.insertAdjacentElement("beforeend",t),d.setIsUiLoaded(!0)}}}const ie=Object.freeze(Object.defineProperty({__proto__:null,WalletConnectModal:ne},Symbol.toStringTag,{value:"Module"}));export{a as C,re as E,E as M,d as O,N as R,k as T,ae as a,H as b,C as c,ie as i};