import{s as q,e as p,c as d,b as x,m as O,f,N as P,r as b,O as k,o as H,i as D,h,P as y,H as E,n as I,I as L,p as M,Q,a as N,t as T,g as w,d as S,j}from"../chunks/scheduler.VqJF7Vna.js";import{S as V,i as $,c as z,a as A,m as B,t as F,b as G,d as J}from"../chunks/index.Ddm4CqKS.js";import{r as K}from"../chunks/Ledger_Info.API.JyzJYuRQ.js";function R(c){let e,t,a,r="mainnet",n,m="devnet",s,_="testnet",o,l="custom",i,g;return{c(){e=p("div"),t=p("select"),a=p("option"),a.textContent=r,n=p("option"),n.textContent=m,s=p("option"),s.textContent=_,o=p("option"),o.textContent=l,this.h()},l(u){e=d(u,"DIV",{style:!0});var v=x(e);t=d(v,"SELECT",{"nets-choices":!0,class:!0});var C=x(t);a=d(C,"OPTION",{"data-svelte-h":!0}),O(a)!=="svelte-1sx3bry"&&(a.textContent=r),n=d(C,"OPTION",{"data-svelte-h":!0}),O(n)!=="svelte-3ac022"&&(n.textContent=m),s=d(C,"OPTION",{"data-svelte-h":!0}),O(s)!=="svelte-14n6jr0"&&(s.textContent=_),o=d(C,"OPTION",{"data-svelte-h":!0}),O(o)!=="svelte-28xsy2"&&(o.textContent=l),C.forEach(f),v.forEach(f),this.h()},h(){a.__value="mainnet",P(a,a.__value),n.__value="devnet",P(n,n.__value),s.__value="testnet",P(s,s.__value),o.__value="custom",P(o,o.__value),b(t,"nets-choices",""),b(t,"class","select"),c[0]===void 0&&k(()=>c[3].call(t)),H(e,"max-width","200px")},m(u,v){D(u,e,v),h(e,t),h(t,a),h(t,n),h(t,s),h(t,o),y(t,c[0],!0),i||(g=[E(t,"change",c[3]),E(t,"change",c[1])],i=!0)},p(u,[v]){v&1&&y(t,u[0])},i:I,o:I,d(u){u&&f(e),i=!1,L(g)}}}function U(c,e,t){let{on_change:a}=e;const r={mainnet:{name:"mainnet",path:"https://api.mainnet.aptoslabs.com/v1"},testnet:{name:"testnet",path:"https://api.testnet.aptoslabs.com/v1"},devnet:{name:"devnet",path:"https://api.devnet.aptoslabs.com/v1"},custom:{name:"custom",path:""}};let{net_name:n="mainnet"}=e;const m=async _=>{console.log("net_name",n);const o=r[n];if(n==="custom"){a({net:o});return}const{enhanced:l}=await K({net_path:o.path}),{chain_id:i}=l;a({net:o,chain_id:i})};M(()=>{m()});function s(){n=Q(this),t(0,n)}return c.$$set=_=>{"on_change"in _&&t(2,a=_.on_change),"net_name"in _&&t(0,n=_.net_name)},[n,m,a,s]}class W extends V{constructor(e){super(),$(this,e,U,R,q,{on_change:2,net_name:0})}}function X(c){let e,t,a,r,n,m,s,_,o;return t=new W({props:{on_change:c[2]}}),{c(){e=p("div"),z(t.$$.fragment),a=N(),r=p("p"),n=T(c[0]),m=N(),s=p("p"),_=T(c[1])},l(l){e=d(l,"DIV",{});var i=x(e);A(t.$$.fragment,i),a=w(i),r=d(i,"P",{});var g=x(r);n=S(g,c[0]),g.forEach(f),m=w(i),s=d(i,"P",{});var u=x(s);_=S(u,c[1]),u.forEach(f),i.forEach(f)},m(l,i){D(l,e,i),B(t,e,null),h(e,a),h(e,r),h(r,n),h(e,m),h(e,s),h(s,_),o=!0},p(l,[i]){(!o||i&1)&&j(n,l[0]),(!o||i&2)&&j(_,l[1])},i(l){o||(F(t.$$.fragment,l),o=!0)},o(l){G(t.$$.fragment,l),o=!1},d(l){l&&f(e),J(t)}}}function Y(c,e,t){let a="",r="";return[a,r,({net:m,chain_id:s})=>{console.log("on_change",{net:m,_chain_id:s}),t(0,a=m.path),t(1,r=s)}]}class nt extends V{constructor(e){super(),$(this,e,Y,X,q,{})}}export{nt as component};
//# sourceMappingURL=19.BCJfQTzu.js.map
