import{g as t,f as n}from"./p-879b0f88.js";const e=(t,n,e)=>{const s=t.get(n);if(!s){t.set(n,[e])}else if(!s.includes(e)){s.push(e)}};const s=(t,n)=>{let e;return(...s)=>{if(e){clearTimeout(e)}e=setTimeout((()=>{e=0;t(...s)}),n)}};const o=t=>!("isConnected"in t)||t.isConnected;const r=s((t=>{for(let n of t.keys()){t.set(n,t.get(n).filter(o))}}),2e3);const c=()=>{if(typeof t!=="function"){return{}}const s=new Map;return{dispose:()=>s.clear(),get:n=>{const o=t();if(o){e(s,n,o)}},set:t=>{const e=s.get(t);if(e){s.set(t,e.filter(n))}r(s)},reset:()=>{s.forEach((t=>t.forEach(n)));r(s)}}};const i=t=>typeof t==="function"?t():t;const u=(t,n=((t,n)=>t!==n))=>{const e=i(t);let s=new Map(Object.entries(e!==null&&e!==void 0?e:{}));const o={dispose:[],get:[],set:[],reset:[]};const r=()=>{var n;s=new Map(Object.entries((n=i(t))!==null&&n!==void 0?n:{}));o.reset.forEach((t=>t()))};const c=()=>{o.dispose.forEach((t=>t()));r()};const u=t=>{o.get.forEach((n=>n(t)));return s.get(t)};const f=(t,e)=>{const r=s.get(t);if(n(e,r,t)){s.set(t,e);o.set.forEach((n=>n(t,e,r)))}};const l=typeof Proxy==="undefined"?{}:new Proxy(e,{get(t,n){return u(n)},ownKeys(t){return Array.from(s.keys())},getOwnPropertyDescriptor(){return{enumerable:true,configurable:true}},has(t,n){return s.has(n)},set(t,n,e){f(n,e);return true}});const p=(t,n)=>{o[t].push(n);return()=>{a(o[t],n)}};const g=(n,e)=>{const s=p("set",((t,s)=>{if(t===n){e(s)}}));const o=p("reset",(()=>e(i(t)[n])));return()=>{s();o()}};const d=(...t)=>{const n=t.reduce(((t,n)=>{if(n.set){t.push(p("set",n.set))}if(n.get){t.push(p("get",n.get))}if(n.reset){t.push(p("reset",n.reset))}if(n.dispose){t.push(p("dispose",n.dispose))}return t}),[]);return()=>n.forEach((t=>t()))};const m=t=>{const n=s.get(t);o.set.forEach((e=>e(t,n,n)))};return{state:l,get:u,set:f,on:p,onChange:g,use:d,dispose:c,reset:r,forceUpdate:m}};const a=(t,n)=>{const e=t.indexOf(n);if(e>=0){t[e]=t[t.length-1];t.length--}};const f=(t,n)=>{const e=u(t,n);e.use(c());return e};const l={isLoading:true,isWaitingForSignature:false,commonData:{data:"",gasLimit:"",gasPrice:"",transactionsCount:0,egldLabel:"",feeLimit:"",feeInFiatLimit:"",currentIndex:0,receiver:"",ppuOptions:[]},nftTransaction:null,sftTransaction:null,tokenTransaction:null,onCancel:null,onBack:null,onConfirm:null,onSetPpu:null};const p=f(Object.assign({},l));const g=p.state;const d=()=>Object.assign(Object.assign({},g),l);export{d as r,g as s};
//# sourceMappingURL=p-193b5e65.js.map