@ar.io/sdk 1.2.0-alpha.17 → 1.2.0-alpha.18

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.
@@ -218,7 +218,7 @@ ${C}`),A.pop(),`{${W}}`}case"number":return isFinite(T)?String(T):t?t(T):"null";
218
218
  `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){let h=new this(t);return r.forEach(o=>h.set(o)),h}static accessor(t){let h=(this[QL]=this[QL]={accessors:{}}).accessors,o=this.prototype;function l(c){let p=s2(c);h[p]||(Bht(o,c),h[p]=!0)}return Ke.isArray(t)?t.forEach(l):l(t),this}};Ld.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);Ke.reduceDescriptors(Ld.prototype,({value:i},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>i,set(h){this[r]=h}}});Ke.freezeMethods(Ld);var Zn=Ld;function h2(i,t){let r=this||Nd,h=t||r,o=Zn.from(h.headers),l=h.data;return Ke.forEach(i,function(p){l=p.call(r,l,o.normalize(),t?t.status:void 0)}),o.normalize(),l}Tt();Rt();xt();function f2(i){return!!(i&&i.__CANCEL__)}Tt();Rt();xt();function tD(i,t,r){Nr.call(this,i??"canceled",Nr.ERR_CANCELED,t,r),this.name="CanceledError"}Ke.inherits(tD,Nr,{__CANCEL__:!0});var sf=tD;Tt();Rt();xt();Tt();Rt();xt();Tt();Rt();xt();function u2(i,t,r){let h=r.config.validateStatus;!r.status||!h||h(r.status)?i(r):t(new Nr("Request failed with status code "+r.status,[Nr.ERR_BAD_REQUEST,Nr.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}Tt();Rt();xt();function o7(i){let t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(i);return t&&t[1]||""}Tt();Rt();xt();Tt();Rt();xt();function Oht(i,t){i=i||10;let r=new Array(i),h=new Array(i),o=0,l=0,c;return t=t!==void 0?t:1e3,function(w){let m=Date.now(),y=h[l];c||(c=m),r[o]=w,h[o]=m;let v=l,M=0;for(;v!==o;)M+=r[v++],v=v%i;if(o=(o+1)%i,o===l&&(l=(l+1)%i),m-c<t)return;let T=y&&m-y;return T?Math.round(M*1e3/T):void 0}}var eD=Oht;Tt();Rt();xt();function Cht(i,t){let r=0,h=1e3/t,o=null;return function(){let c=this===!0,p=Date.now();if(c||p-r>h)return o&&(clearTimeout(o),o=null),r=p,i.apply(null,arguments);o||(o=setTimeout(()=>(o=null,r=Date.now(),i.apply(null,arguments)),h-(p-r)))}}var rD=Cht;var Dd=(i,t,r=3)=>{let h=0,o=eD(50,250);return rD(l=>{let c=l.loaded,p=l.lengthComputable?l.total:void 0,w=c-h,m=o(w),y=c<=p;h=c;let v={loaded:c,total:p,progress:p?c/p:void 0,bytes:w,rate:m||void 0,estimated:m&&p&&y?(p-c)/m:void 0,event:l,lengthComputable:p!=null};v[t?"download":"upload"]=!0,i(v)},r)};Tt();Rt();xt();Tt();Rt();xt();var iD=fo.hasStandardBrowserEnv?function(){let t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a"),h;function o(l){let c=l;return t&&(r.setAttribute("href",c),c=r.href),r.setAttribute("href",c),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:r.pathname.charAt(0)==="/"?r.pathname:"/"+r.pathname}}return h=o(window.location.href),function(c){let p=Ke.isString(c)?o(c):c;return p.protocol===h.protocol&&p.host===h.host}}():function(){return function(){return!0}}();Tt();Rt();xt();var nD=fo.hasStandardBrowserEnv?{write(i,t,r,h,o,l){let c=[i+"="+encodeURIComponent(t)];Ke.isNumber(r)&&c.push("expires="+new Date(r).toGMTString()),Ke.isString(h)&&c.push("path="+h),Ke.isString(o)&&c.push("domain="+o),l===!0&&c.push("secure"),document.cookie=c.join("; ")},read(i){let t=document.cookie.match(new RegExp("(^|;\\s*)("+i+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(i){this.write(i,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};Tt();Rt();xt();Tt();Rt();xt();function a7(i){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(i)}Tt();Rt();xt();function s7(i,t){return t?i.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):i}function c2(i,t){return i&&!a7(t)?s7(i,t):t}Tt();Rt();xt();var oD=i=>i instanceof Zn?{...i}:i;function mh(i,t){t=t||{};let r={};function h(m,y,v){return Ke.isPlainObject(m)&&Ke.isPlainObject(y)?Ke.merge.call({caseless:v},m,y):Ke.isPlainObject(y)?Ke.merge({},y):Ke.isArray(y)?y.slice():y}function o(m,y,v){if(Ke.isUndefined(y)){if(!Ke.isUndefined(m))return h(void 0,m,v)}else return h(m,y,v)}function l(m,y){if(!Ke.isUndefined(y))return h(void 0,y)}function c(m,y){if(Ke.isUndefined(y)){if(!Ke.isUndefined(m))return h(void 0,m)}else return h(void 0,y)}function p(m,y,v){if(v in t)return h(m,y);if(v in i)return h(void 0,m)}let w={url:l,method:l,data:l,baseURL:c,transformRequest:c,transformResponse:c,paramsSerializer:c,timeout:c,timeoutMessage:c,withCredentials:c,withXSRFToken:c,adapter:c,responseType:c,xsrfCookieName:c,xsrfHeaderName:c,onUploadProgress:c,onDownloadProgress:c,decompress:c,maxContentLength:c,maxBodyLength:c,beforeRedirect:c,transport:c,httpAgent:c,httpsAgent:c,cancelToken:c,socketPath:c,responseEncoding:c,validateStatus:p,headers:(m,y)=>o(oD(m),oD(y),!0)};return Ke.forEach(Object.keys(Object.assign({},i,t)),function(y){let v=w[y]||o,M=v(i[y],t[y],y);Ke.isUndefined(M)&&v!==p||(r[y]=M)}),r}var Py=i=>{let t=mh({},i),{data:r,withXSRFToken:h,xsrfHeaderName:o,xsrfCookieName:l,headers:c,auth:p}=t;t.headers=c=Zn.from(c),t.url=a2(c2(t.baseURL,t.url),i.params,i.paramsSerializer),p&&c.set("Authorization","Basic "+btoa((p.username||"")+":"+(p.password?unescape(encodeURIComponent(p.password)):"")));let w;if(Ke.isFormData(r)){if(fo.hasStandardBrowserEnv||fo.hasStandardBrowserWebWorkerEnv)c.setContentType(void 0);else if((w=c.getContentType())!==!1){let[m,...y]=w?w.split(";").map(v=>v.trim()).filter(Boolean):[];c.setContentType([m||"multipart/form-data",...y].join("; "))}}if(fo.hasStandardBrowserEnv&&(h&&Ke.isFunction(h)&&(h=h(t)),h||h!==!1&&iD(t.url))){let m=o&&l&&nD.read(l);m&&c.set(o,m)}return t};var Pht=typeof XMLHttpRequest<"u",aD=Pht&&function(i){return new Promise(function(r,h){let o=Py(i),l=o.data,c=Zn.from(o.headers).normalize(),{responseType:p}=o,w;function m(){o.cancelToken&&o.cancelToken.unsubscribe(w),o.signal&&o.signal.removeEventListener("abort",w)}let y=new XMLHttpRequest;y.open(o.method.toUpperCase(),o.url,!0),y.timeout=o.timeout;function v(){if(!y)return;let T=Zn.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders()),R={data:!p||p==="text"||p==="json"?y.responseText:y.response,status:y.status,statusText:y.statusText,headers:T,config:i,request:y};u2(function(C){r(C),m()},function(C){h(C),m()},R),y=null}"onloadend"in y?y.onloadend=v:y.onreadystatechange=function(){!y||y.readyState!==4||y.status===0&&!(y.responseURL&&y.responseURL.indexOf("file:")===0)||setTimeout(v)},y.onabort=function(){y&&(h(new Nr("Request aborted",Nr.ECONNABORTED,o,y)),y=null)},y.onerror=function(){h(new Nr("Network Error",Nr.ERR_NETWORK,o,y)),y=null},y.ontimeout=function(){let A=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded",R=o.transitional||By;o.timeoutErrorMessage&&(A=o.timeoutErrorMessage),h(new Nr(A,R.clarifyTimeoutError?Nr.ETIMEDOUT:Nr.ECONNABORTED,o,y)),y=null},l===void 0&&c.setContentType(null),"setRequestHeader"in y&&Ke.forEach(c.toJSON(),function(A,R){y.setRequestHeader(R,A)}),Ke.isUndefined(o.withCredentials)||(y.withCredentials=!!o.withCredentials),p&&p!=="json"&&(y.responseType=o.responseType),typeof o.onDownloadProgress=="function"&&y.addEventListener("progress",Dd(o.onDownloadProgress,!0)),typeof o.onUploadProgress=="function"&&y.upload&&y.upload.addEventListener("progress",Dd(o.onUploadProgress)),(o.cancelToken||o.signal)&&(w=T=>{y&&(h(!T||T.type?new sf(null,i,y):T),y.abort(),y=null)},o.cancelToken&&o.cancelToken.subscribe(w),o.signal&&(o.signal.aborted?w():o.signal.addEventListener("abort",w)));let M=o7(o.url);if(M&&fo.protocols.indexOf(M)===-1){h(new Nr("Unsupported protocol "+M+":",Nr.ERR_BAD_REQUEST,i));return}y.send(l||null)})};Tt();Rt();xt();Tt();Rt();xt();var Nht=(i,t)=>{let r=new AbortController,h,o=function(w){if(!h){h=!0,c();let m=w instanceof Error?w:this.reason;r.abort(m instanceof Nr?m:new sf(m instanceof Error?m.message:m))}},l=t&&setTimeout(()=>{o(new Nr(`timeout ${t} of ms exceeded`,Nr.ETIMEDOUT))},t),c=()=>{i&&(l&&clearTimeout(l),l=null,i.forEach(w=>{w&&(w.removeEventListener?w.removeEventListener("abort",o):w.unsubscribe(o))}),i=null)};i.forEach(w=>w&&w.addEventListener&&w.addEventListener("abort",o));let{signal:p}=r;return p.unsubscribe=c,[p,()=>{l&&clearTimeout(l),l=null}]},sD=Nht;Tt();Rt();xt();var Lht=function*(i,t){let r=i.byteLength;if(!t||r<t){yield i;return}let h=0,o;for(;h<r;)o=h+t,yield i.slice(h,o),h=o},Dht=async function*(i,t,r){for await(let h of i)yield*Lht(ArrayBuffer.isView(h)?h:await r(String(h)),t)},h7=(i,t,r,h,o)=>{let l=Dht(i,t,o),c=0;return new ReadableStream({type:"bytes",async pull(p){let{done:w,value:m}=await l.next();if(w){p.close(),h();return}let y=m.byteLength;r&&r(c+=y),p.enqueue(new Uint8Array(m))},cancel(p){return h(p),l.return()}},{highWaterMark:2})};var hD=(i,t)=>{let r=i!=null;return h=>setTimeout(()=>t({lengthComputable:r,total:i,loaded:h}))},Ly=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",uD=Ly&&typeof ReadableStream=="function",f7=Ly&&(typeof TextEncoder=="function"?(i=>t=>i.encode(t))(new TextEncoder):async i=>new Uint8Array(await new Response(i).arrayBuffer())),$ht=uD&&(()=>{let i=!1,t=new Request(fo.origin,{body:new ReadableStream,method:"POST",get duplex(){return i=!0,"half"}}).headers.has("Content-Type");return i&&!t})(),fD=64*1024,u7=uD&&!!(()=>{try{return Ke.isReadableStream(new Response("").body)}catch{}})(),Ny={stream:u7&&(i=>i.body)};Ly&&(i=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!Ny[t]&&(Ny[t]=Ke.isFunction(i[t])?r=>r[t]():(r,h)=>{throw new Nr(`Response type '${t}' is not supported`,Nr.ERR_NOT_SUPPORT,h)})})})(new Response);var Uht=async i=>{if(i==null)return 0;if(Ke.isBlob(i))return i.size;if(Ke.isSpecCompliantForm(i))return(await new Request(i).arrayBuffer()).byteLength;if(Ke.isArrayBufferView(i))return i.byteLength;if(Ke.isURLSearchParams(i)&&(i=i+""),Ke.isString(i))return(await f7(i)).byteLength},qht=async(i,t)=>{let r=Ke.toFiniteNumber(i.getContentLength());return r??Uht(t)},cD=Ly&&(async i=>{let{url:t,method:r,data:h,signal:o,cancelToken:l,timeout:c,onDownloadProgress:p,onUploadProgress:w,responseType:m,headers:y,withCredentials:v="same-origin",fetchOptions:M}=Py(i);m=m?(m+"").toLowerCase():"text";let[T,A]=o||l||c?sD([o,l],c):[],R,B,C=()=>{!R&&setTimeout(()=>{T&&T.unsubscribe()}),R=!0},P;try{if(w&&$ht&&r!=="get"&&r!=="head"&&(P=await qht(y,h))!==0){let J=new Request(t,{method:"POST",body:h,duplex:"half"}),F;Ke.isFormData(h)&&(F=J.headers.get("content-type"))&&y.setContentType(F),J.body&&(h=h7(J.body,fD,hD(P,Dd(w)),null,f7))}Ke.isString(v)||(v=v?"cors":"omit"),B=new Request(t,{...M,signal:T,method:r.toUpperCase(),headers:y.normalize().toJSON(),body:h,duplex:"half",withCredentials:v});let N=await fetch(B),q=u7&&(m==="stream"||m==="response");if(u7&&(p||q)){let J={};["status","statusText","headers"].forEach(H=>{J[H]=N[H]});let F=Ke.toFiniteNumber(N.headers.get("content-length"));N=new Response(h7(N.body,fD,p&&hD(F,Dd(p,!0)),q&&C,f7),J)}m=m||"text";let W=await Ny[Ke.findKey(Ny,m)||"text"](N,i);return!q&&C(),A&&A(),await new Promise((J,F)=>{u2(J,F,{data:W,headers:Zn.from(N.headers),status:N.status,statusText:N.statusText,config:i,request:B})})}catch(N){throw C(),N&&N.name==="TypeError"&&/fetch/i.test(N.message)?Object.assign(new Nr("Network Error",Nr.ERR_NETWORK,i,B),{cause:N.cause||N}):Nr.from(N,N&&N.code,i,B)}});var c7={http:ky,xhr:aD,fetch:cD};Ke.forEach(c7,(i,t)=>{if(i){try{Object.defineProperty(i,"name",{value:t})}catch{}Object.defineProperty(i,"adapterName",{value:t})}});var lD=i=>`- ${i}`,Fht=i=>Ke.isFunction(i)||i===null||i===!1,Dy={getAdapter:i=>{i=Ke.isArray(i)?i:[i];let{length:t}=i,r,h,o={};for(let l=0;l<t;l++){r=i[l];let c;if(h=r,!Fht(r)&&(h=c7[(c=String(r)).toLowerCase()],h===void 0))throw new Nr(`Unknown adapter '${c}'`);if(h)break;o[c||"#"+l]=h}if(!h){let l=Object.entries(o).map(([p,w])=>`adapter ${p} `+(w===!1?"is not supported by the environment":"is not available in the build")),c=t?l.length>1?`since :
219
219
  `+l.map(lD).join(`
220
220
  `):" "+lD(l[0]):"as no adapter specified";throw new Nr("There is no suitable adapter to dispatch the request "+c,"ERR_NOT_SUPPORT")}return h},adapters:c7};function l7(i){if(i.cancelToken&&i.cancelToken.throwIfRequested(),i.signal&&i.signal.aborted)throw new sf(null,i)}function $y(i){return l7(i),i.headers=Zn.from(i.headers),i.data=h2.call(i,i.transformRequest),["post","put","patch"].indexOf(i.method)!==-1&&i.headers.setContentType("application/x-www-form-urlencoded",!1),Dy.getAdapter(i.adapter||Nd.adapter)(i).then(function(h){return l7(i),h.data=h2.call(i,i.transformResponse,h),h.headers=Zn.from(h.headers),h},function(h){return f2(h)||(l7(i),h&&h.response&&(h.response.data=h2.call(i,i.transformResponse,h.response),h.response.headers=Zn.from(h.response.headers))),Promise.reject(h)})}Tt();Rt();xt();Tt();Rt();xt();var Uy="1.7.2";var d7={};["object","boolean","number","function","string","symbol"].forEach((i,t)=>{d7[i]=function(h){return typeof h===i||"a"+(t<1?"n ":" ")+i}});var dD={};d7.transitional=function(t,r,h){function o(l,c){return"[Axios v"+Uy+"] Transitional option '"+l+"'"+c+(h?". "+h:"")}return(l,c,p)=>{if(t===!1)throw new Nr(o(c," has been removed"+(r?" in "+r:"")),Nr.ERR_DEPRECATED);return r&&!dD[c]&&(dD[c]=!0,console.warn(o(c," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(l,c,p):!0}};function jht(i,t,r){if(typeof i!="object")throw new Nr("options must be an object",Nr.ERR_BAD_OPTION_VALUE);let h=Object.keys(i),o=h.length;for(;o-- >0;){let l=h[o],c=t[l];if(c){let p=i[l],w=p===void 0||c(p,l,i);if(w!==!0)throw new Nr("option "+l+" must be "+w,Nr.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new Nr("Unknown option "+l,Nr.ERR_BAD_OPTION)}}var qy={assertOptions:jht,validators:d7};var dc=qy.validators,$d=class{constructor(t){this.defaults=t,this.interceptors={request:new Q5,response:new Q5}}async request(t,r){try{return await this._request(t,r)}catch(h){if(h instanceof Error){let o;Error.captureStackTrace?Error.captureStackTrace(o={}):o=new Error;let l=o.stack?o.stack.replace(/^.+\n/,""):"";try{h.stack?l&&!String(h.stack).endsWith(l.replace(/^.+\n.+\n/,""))&&(h.stack+=`
221
- `+l):h.stack=l}catch{}}throw h}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=mh(this.defaults,r);let{transitional:h,paramsSerializer:o,headers:l}=r;h!==void 0&&qy.assertOptions(h,{silentJSONParsing:dc.transitional(dc.boolean),forcedJSONParsing:dc.transitional(dc.boolean),clarifyTimeoutError:dc.transitional(dc.boolean)},!1),o!=null&&(Ke.isFunction(o)?r.paramsSerializer={serialize:o}:qy.assertOptions(o,{encode:dc.function,serialize:dc.function},!0)),r.method=(r.method||this.defaults.method||"get").toLowerCase();let c=l&&Ke.merge(l.common,l[r.method]);l&&Ke.forEach(["delete","get","head","post","put","patch","common"],A=>{delete l[A]}),r.headers=Zn.concat(c,l);let p=[],w=!0;this.interceptors.request.forEach(function(R){typeof R.runWhen=="function"&&R.runWhen(r)===!1||(w=w&&R.synchronous,p.unshift(R.fulfilled,R.rejected))});let m=[];this.interceptors.response.forEach(function(R){m.push(R.fulfilled,R.rejected)});let y,v=0,M;if(!w){let A=[$y.bind(this),void 0];for(A.unshift.apply(A,p),A.push.apply(A,m),M=A.length,y=Promise.resolve(r);v<M;)y=y.then(A[v++],A[v++]);return y}M=p.length;let T=r;for(v=0;v<M;){let A=p[v++],R=p[v++];try{T=A(T)}catch(B){R.call(this,B);break}}try{y=$y.call(this,T)}catch(A){return Promise.reject(A)}for(v=0,M=m.length;v<M;)y=y.then(m[v++],m[v++]);return y}getUri(t){t=mh(this.defaults,t);let r=c2(t.baseURL,t.url);return a2(r,t.params,t.paramsSerializer)}};Ke.forEach(["delete","get","head","options"],function(t){$d.prototype[t]=function(r,h){return this.request(mh(h||{},{method:t,url:r,data:(h||{}).data}))}});Ke.forEach(["post","put","patch"],function(t){function r(h){return function(l,c,p){return this.request(mh(p||{},{method:t,headers:h?{"Content-Type":"multipart/form-data"}:{},url:l,data:c}))}}$d.prototype[t]=r(),$d.prototype[t+"Form"]=r(!0)});var l2=$d;Tt();Rt();xt();var p7=class i{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(l){r=l});let h=this;this.promise.then(o=>{if(!h._listeners)return;let l=h._listeners.length;for(;l-- >0;)h._listeners[l](o);h._listeners=null}),this.promise.then=o=>{let l,c=new Promise(p=>{h.subscribe(p),l=p}).then(o);return c.cancel=function(){h.unsubscribe(l)},c},t(function(l,c,p){h.reason||(h.reason=new sf(l,c,p),r(h.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;let r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}static source(){let t;return{token:new i(function(o){t=o}),cancel:t}}},pD=p7;Tt();Rt();xt();function g7(i){return function(r){return i.apply(null,r)}}Tt();Rt();xt();function m7(i){return Ke.isObject(i)&&i.isAxiosError===!0}Tt();Rt();xt();var v7={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(v7).forEach(([i,t])=>{v7[t]=i});var gD=v7;function mD(i){let t=new l2(i),r=i2(l2.prototype.request,t);return Ke.extend(r,l2.prototype,t,{allOwnKeys:!0}),Ke.extend(r,t,null,{allOwnKeys:!0}),r.create=function(o){return mD(mh(i,o))},r}var Wn=mD(Nd);Wn.Axios=l2;Wn.CanceledError=sf;Wn.CancelToken=pD;Wn.isCancel=f2;Wn.VERSION=Uy;Wn.toFormData=lc;Wn.AxiosError=Nr;Wn.Cancel=Wn.CanceledError;Wn.all=function(t){return Promise.all(t)};Wn.spread=g7;Wn.isAxiosError=m7;Wn.mergeConfig=mh;Wn.AxiosHeaders=Zn;Wn.formToJSON=i=>Oy(Ke.isHTMLForm(i)?new FormData(i):i);Wn.getAdapter=Dy.getAdapter;Wn.HttpStatusCode=gD;Wn.default=Wn;var Fy=Wn;var{Axios:mLt,AxiosError:vLt,CanceledError:yLt,isCancel:bLt,CancelToken:wLt,VERSION:_Lt,all:MLt,Cancel:SLt,isAxiosError:ELt,spread:ALt,toFormData:TLt,AxiosHeaders:xLt,HttpStatusCode:RLt,formToJSON:kLt,getAdapter:ILt,mergeConfig:BLt}=Fy;Tt();Rt();xt();var wD=sc(yD(),1),y7="axios-retry";function _D(i){let t=["ERR_CANCELED","ECONNABORTED"];return i.response||!i.code||t.includes(i.code)?!1:(0,wD.default)(i)}var MD=["get","head","options"],Wht=MD.concat(["put","delete"]);function b7(i){return i.code!=="ECONNABORTED"&&(!i.response||i.response.status===429||i.response.status>=500&&i.response.status<=599)}function Kht(i){return i.config?.method?b7(i)&&MD.indexOf(i.config.method)!==-1:!1}function SD(i){return i.config?.method?b7(i)&&Wht.indexOf(i.config.method)!==-1:!1}function ED(i){return _D(i)||SD(i)}function AD(i=void 0){let t=i?.response?.headers["retry-after"];if(!t)return 0;let r=(Number(t)||0)*1e3;return r===0&&(r=(new Date(t).valueOf()||0)-Date.now()),Math.max(0,r)}function Hht(i=0,t=void 0){return Math.max(0,AD(t))}function Ght(i=0,t=void 0,r=100){let h=2**i*r,o=Math.max(h,AD(t)),l=o*.2*Math.random();return o+l}var Vht={retries:3,retryCondition:ED,retryDelay:Hht,shouldResetTimeout:!1,onRetry:()=>{},onMaxRetryTimesExceeded:()=>{},validateResponse:null};function Zht(i,t){return{...Vht,...t,...i[y7]}}function bD(i,t){let r=Zht(i,t||{});return r.retryCount=r.retryCount||0,r.lastRequestTime=r.lastRequestTime||Date.now(),i[y7]=r,r}function Jht(i,t){i.defaults.agent===t.agent&&delete t.agent,i.defaults.httpAgent===t.httpAgent&&delete t.httpAgent,i.defaults.httpsAgent===t.httpsAgent&&delete t.httpsAgent}async function Xht(i,t){let{retries:r,retryCondition:h}=i,o=(i.retryCount||0)<r&&h(t);if(typeof o=="object")try{return await o!==!1}catch{return!1}return o}async function Yht(i,t,r,h){t.retryCount+=1;let{retryDelay:o,shouldResetTimeout:l,onRetry:c}=t,p=o(t.retryCount,r);if(Jht(i,h),!l&&h.timeout&&t.lastRequestTime){let w=Date.now()-t.lastRequestTime,m=h.timeout-w-p;if(m<=0)return Promise.reject(r);h.timeout=m}return h.transformRequest=[w=>w],await c(t.retryCount,r,h),new Promise(w=>{setTimeout(()=>w(i(h)),p)})}async function Qht(i,t){i.retryCount>=i.retries&&await i.onMaxRetryTimesExceeded(t,i.retryCount)}var Il=(i,t)=>{let r=i.interceptors.request.use(o=>(bD(o,t),o[y7]?.validateResponse&&(o.validateStatus=()=>!1),o)),h=i.interceptors.response.use(null,async o=>{let{config:l}=o;if(!l)return Promise.reject(o);let c=bD(l,t);return o.response&&c.validateResponse?.(o.response)?o.response:await Xht(c,o)?Yht(i,c,o,l):(await Qht(c,o),Promise.reject(o))});return{requestInterceptorId:r,responseInterceptorId:h}};Il.isNetworkError=_D;Il.isSafeRequestError=Kht;Il.isIdempotentRequestError=SD;Il.isNetworkOrIdempotentRequestError=ED;Il.exponentialDelay=Ght;Il.isRetryableError=b7;var jy=Il;Tt();Rt();xt();var G9=sc(nF(),1);Tt();Rt();xt();var o1="1.2.0-alpha.16";var pa=class{logger;silent=!1;constructor({level:t="info"}={}){if(t==="none"){this.silent=!0;return}this.logger=G9.default.createLogger({level:t,name:"ar-io-sdk",version:o1,serializers:G9.default.stdSerializers})}info(t,...r){this.silent||this.logger.info(...r,t)}warn(t,...r){this.silent||this.logger.warn(...r,t)}error(t,...r){this.silent||this.logger.error(...r,t)}debug(t,...r){this.silent||this.logger.debug(...r,t)}setLogLevel(t){if(t==="none"){this.silent=!0;return}this.logger.level(t)}};var oF=({axiosConfig:i={},logger:t=new pa,retryConfig:r={retries:5,retryDelay:jy.exponentialDelay,retryCondition:h=>jy.isRetryableError(h),onRetry(h,o,l){t.error(`Retrying request ${l.url} attempt ${h}`,o)}}}={})=>{let h=Fy.create({...i,maxRedirects:0,headers:{...i.headers,"x-source-version":`${o1}`,"x-source-identifier":"ar-io-sdk"},validateStatus:()=>!0});return jy(h,r),h};Tt();Rt();xt();Tt();Rt();xt();Tt();Rt();xt();var wh=class extends Error{constructor(t){super(t),this.name=this.constructor.name}},O6=class extends wh{},aF=class extends wh{},Hl=class extends wh{constructor(t,r){super(`Failed request: ${t}: ${r}`)}},C6=class extends wh{},a1=class extends wh{},sF=class extends wh{constructor(){super("Invalid signer. Please provide a valid signer to interact with the contract.")}},No=class extends wh{constructor(){super("Invalid contract configuration")}},hF=class extends wh{constructor(){super("Invalid process configuration")}},s1=class extends wh{};var h1=100;async function Uqt({address:i,arweave:t,signal:r=AbortSignal.timeout(1e4)}){let h=!1,o,l=new Set;do{let c={query:`
221
+ `+l):h.stack=l}catch{}}throw h}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=mh(this.defaults,r);let{transitional:h,paramsSerializer:o,headers:l}=r;h!==void 0&&qy.assertOptions(h,{silentJSONParsing:dc.transitional(dc.boolean),forcedJSONParsing:dc.transitional(dc.boolean),clarifyTimeoutError:dc.transitional(dc.boolean)},!1),o!=null&&(Ke.isFunction(o)?r.paramsSerializer={serialize:o}:qy.assertOptions(o,{encode:dc.function,serialize:dc.function},!0)),r.method=(r.method||this.defaults.method||"get").toLowerCase();let c=l&&Ke.merge(l.common,l[r.method]);l&&Ke.forEach(["delete","get","head","post","put","patch","common"],A=>{delete l[A]}),r.headers=Zn.concat(c,l);let p=[],w=!0;this.interceptors.request.forEach(function(R){typeof R.runWhen=="function"&&R.runWhen(r)===!1||(w=w&&R.synchronous,p.unshift(R.fulfilled,R.rejected))});let m=[];this.interceptors.response.forEach(function(R){m.push(R.fulfilled,R.rejected)});let y,v=0,M;if(!w){let A=[$y.bind(this),void 0];for(A.unshift.apply(A,p),A.push.apply(A,m),M=A.length,y=Promise.resolve(r);v<M;)y=y.then(A[v++],A[v++]);return y}M=p.length;let T=r;for(v=0;v<M;){let A=p[v++],R=p[v++];try{T=A(T)}catch(B){R.call(this,B);break}}try{y=$y.call(this,T)}catch(A){return Promise.reject(A)}for(v=0,M=m.length;v<M;)y=y.then(m[v++],m[v++]);return y}getUri(t){t=mh(this.defaults,t);let r=c2(t.baseURL,t.url);return a2(r,t.params,t.paramsSerializer)}};Ke.forEach(["delete","get","head","options"],function(t){$d.prototype[t]=function(r,h){return this.request(mh(h||{},{method:t,url:r,data:(h||{}).data}))}});Ke.forEach(["post","put","patch"],function(t){function r(h){return function(l,c,p){return this.request(mh(p||{},{method:t,headers:h?{"Content-Type":"multipart/form-data"}:{},url:l,data:c}))}}$d.prototype[t]=r(),$d.prototype[t+"Form"]=r(!0)});var l2=$d;Tt();Rt();xt();var p7=class i{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(l){r=l});let h=this;this.promise.then(o=>{if(!h._listeners)return;let l=h._listeners.length;for(;l-- >0;)h._listeners[l](o);h._listeners=null}),this.promise.then=o=>{let l,c=new Promise(p=>{h.subscribe(p),l=p}).then(o);return c.cancel=function(){h.unsubscribe(l)},c},t(function(l,c,p){h.reason||(h.reason=new sf(l,c,p),r(h.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;let r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}static source(){let t;return{token:new i(function(o){t=o}),cancel:t}}},pD=p7;Tt();Rt();xt();function g7(i){return function(r){return i.apply(null,r)}}Tt();Rt();xt();function m7(i){return Ke.isObject(i)&&i.isAxiosError===!0}Tt();Rt();xt();var v7={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(v7).forEach(([i,t])=>{v7[t]=i});var gD=v7;function mD(i){let t=new l2(i),r=i2(l2.prototype.request,t);return Ke.extend(r,l2.prototype,t,{allOwnKeys:!0}),Ke.extend(r,t,null,{allOwnKeys:!0}),r.create=function(o){return mD(mh(i,o))},r}var Wn=mD(Nd);Wn.Axios=l2;Wn.CanceledError=sf;Wn.CancelToken=pD;Wn.isCancel=f2;Wn.VERSION=Uy;Wn.toFormData=lc;Wn.AxiosError=Nr;Wn.Cancel=Wn.CanceledError;Wn.all=function(t){return Promise.all(t)};Wn.spread=g7;Wn.isAxiosError=m7;Wn.mergeConfig=mh;Wn.AxiosHeaders=Zn;Wn.formToJSON=i=>Oy(Ke.isHTMLForm(i)?new FormData(i):i);Wn.getAdapter=Dy.getAdapter;Wn.HttpStatusCode=gD;Wn.default=Wn;var Fy=Wn;var{Axios:mLt,AxiosError:vLt,CanceledError:yLt,isCancel:bLt,CancelToken:wLt,VERSION:_Lt,all:MLt,Cancel:SLt,isAxiosError:ELt,spread:ALt,toFormData:TLt,AxiosHeaders:xLt,HttpStatusCode:RLt,formToJSON:kLt,getAdapter:ILt,mergeConfig:BLt}=Fy;Tt();Rt();xt();var wD=sc(yD(),1),y7="axios-retry";function _D(i){let t=["ERR_CANCELED","ECONNABORTED"];return i.response||!i.code||t.includes(i.code)?!1:(0,wD.default)(i)}var MD=["get","head","options"],Wht=MD.concat(["put","delete"]);function b7(i){return i.code!=="ECONNABORTED"&&(!i.response||i.response.status===429||i.response.status>=500&&i.response.status<=599)}function Kht(i){return i.config?.method?b7(i)&&MD.indexOf(i.config.method)!==-1:!1}function SD(i){return i.config?.method?b7(i)&&Wht.indexOf(i.config.method)!==-1:!1}function ED(i){return _D(i)||SD(i)}function AD(i=void 0){let t=i?.response?.headers["retry-after"];if(!t)return 0;let r=(Number(t)||0)*1e3;return r===0&&(r=(new Date(t).valueOf()||0)-Date.now()),Math.max(0,r)}function Hht(i=0,t=void 0){return Math.max(0,AD(t))}function Ght(i=0,t=void 0,r=100){let h=2**i*r,o=Math.max(h,AD(t)),l=o*.2*Math.random();return o+l}var Vht={retries:3,retryCondition:ED,retryDelay:Hht,shouldResetTimeout:!1,onRetry:()=>{},onMaxRetryTimesExceeded:()=>{},validateResponse:null};function Zht(i,t){return{...Vht,...t,...i[y7]}}function bD(i,t){let r=Zht(i,t||{});return r.retryCount=r.retryCount||0,r.lastRequestTime=r.lastRequestTime||Date.now(),i[y7]=r,r}function Jht(i,t){i.defaults.agent===t.agent&&delete t.agent,i.defaults.httpAgent===t.httpAgent&&delete t.httpAgent,i.defaults.httpsAgent===t.httpsAgent&&delete t.httpsAgent}async function Xht(i,t){let{retries:r,retryCondition:h}=i,o=(i.retryCount||0)<r&&h(t);if(typeof o=="object")try{return await o!==!1}catch{return!1}return o}async function Yht(i,t,r,h){t.retryCount+=1;let{retryDelay:o,shouldResetTimeout:l,onRetry:c}=t,p=o(t.retryCount,r);if(Jht(i,h),!l&&h.timeout&&t.lastRequestTime){let w=Date.now()-t.lastRequestTime,m=h.timeout-w-p;if(m<=0)return Promise.reject(r);h.timeout=m}return h.transformRequest=[w=>w],await c(t.retryCount,r,h),new Promise(w=>{setTimeout(()=>w(i(h)),p)})}async function Qht(i,t){i.retryCount>=i.retries&&await i.onMaxRetryTimesExceeded(t,i.retryCount)}var Il=(i,t)=>{let r=i.interceptors.request.use(o=>(bD(o,t),o[y7]?.validateResponse&&(o.validateStatus=()=>!1),o)),h=i.interceptors.response.use(null,async o=>{let{config:l}=o;if(!l)return Promise.reject(o);let c=bD(l,t);return o.response&&c.validateResponse?.(o.response)?o.response:await Xht(c,o)?Yht(i,c,o,l):(await Qht(c,o),Promise.reject(o))});return{requestInterceptorId:r,responseInterceptorId:h}};Il.isNetworkError=_D;Il.isSafeRequestError=Kht;Il.isIdempotentRequestError=SD;Il.isNetworkOrIdempotentRequestError=ED;Il.exponentialDelay=Ght;Il.isRetryableError=b7;var jy=Il;Tt();Rt();xt();var G9=sc(nF(),1);Tt();Rt();xt();var o1="1.2.0-alpha.17";var pa=class{logger;silent=!1;constructor({level:t="info"}={}){if(t==="none"){this.silent=!0;return}this.logger=G9.default.createLogger({level:t,name:"ar-io-sdk",version:o1,serializers:G9.default.stdSerializers})}info(t,...r){this.silent||this.logger.info(...r,t)}warn(t,...r){this.silent||this.logger.warn(...r,t)}error(t,...r){this.silent||this.logger.error(...r,t)}debug(t,...r){this.silent||this.logger.debug(...r,t)}setLogLevel(t){if(t==="none"){this.silent=!0;return}this.logger.level(t)}};var oF=({axiosConfig:i={},logger:t=new pa,retryConfig:r={retries:5,retryDelay:jy.exponentialDelay,retryCondition:h=>jy.isRetryableError(h),onRetry(h,o,l){t.error(`Retrying request ${l.url} attempt ${h}`,o)}}}={})=>{let h=Fy.create({...i,maxRedirects:0,headers:{...i.headers,"x-source-version":`${o1}`,"x-source-identifier":"ar-io-sdk"},validateStatus:()=>!0});return jy(h,r),h};Tt();Rt();xt();Tt();Rt();xt();Tt();Rt();xt();var wh=class extends Error{constructor(t){super(t),this.name=this.constructor.name}},O6=class extends wh{},aF=class extends wh{},Hl=class extends wh{constructor(t,r){super(`Failed request: ${t}: ${r}`)}},C6=class extends wh{},a1=class extends wh{},sF=class extends wh{constructor(){super("Invalid signer. Please provide a valid signer to interact with the contract.")}},No=class extends wh{constructor(){super("Invalid contract configuration")}},hF=class extends wh{constructor(){super("Invalid process configuration")}},s1=class extends wh{};var h1=100;async function Uqt({address:i,arweave:t,signal:r=AbortSignal.timeout(1e4)}){let h=!1,o,l=new Set;do{let c={query:`
222
222
  {
223
223
  transactions (
224
224
  owners:["${i}"]
@@ -376,7 +376,7 @@ ${C}`),A.pop(),`{${W}}`}case"number":return isFinite(T)?String(T):t?t(T):"null";
376
376
  }
377
377
  }
378
378
  }
379
- }`,o=Xe.object({data:Xe.object({transactions:Xe.object({edges:Xe.array(Xe.object({node:Xe.record(Xe.any())}))})})});return l=>ci(l).chain(rn(c=>i(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:h,variables:{transactionIds:[c]}})}).then(async p=>{if(p.ok)return p.json();throw r('Error Encountered when querying gateway for transaction "%s"',c),new Error(`${p.status}: ${await p.text()}`)}).then(o.parse).then(b9t(["data","transactions","edges","0","node"])))).toPromise()}var T_t=$R(F4t(),1),pet=(i="@permaweb/aoconnect")=>{let t=(0,T_t.default)(i);return t.child=r=>pet(`${t.namespace}:${r}`),t.tap=(r,...h)=>T9t((...o)=>t(r,...h,...o)),t},get=({url:i,path:t})=>t?t.startsWith("/")?get({url:i,path:t.slice(1)}):(i=new URL(i),i.pathname+=t,i.toString()):i;function x_t(i){return ep(b8([]),tp((t,r)=>ep(M9t([],r.name),ZR(r.value),Js(r.name,Nu,t))(t),{}),v8(t=>t.length>1?t:t[0]))(i)}function Vs(i,t){return r=>qtt(I7t([ftt(i,"name"),XR(VR(t),ftt(t,"value"),KR)]),r)}function ltt(i){return Jtt([[rm(String),V1(i)],[rm(Array),f9t(i)],[KR,U5t]])}function $0(i){let t;return rm(Zs,i)?(t=new Error(R_t(i)),t.stack+=i.stack):rm(Error,i)?t=i:a9t("message",i)?t=new Error(i.message):rm(String,i)?t=new Error(i):t=new Error("An error occurred"),t}function R_t(i){return ep(t=>function r(h,o,l){return tp((c,p)=>ep(Jtt([[V1(vr.invalid_arguments),()=>r(p.argumentsError,422,"Invalid Arguments")],[V1(vr.invalid_return_type),()=>r(p.returnTypeError,500,"Invalid Return")],[V1(vr.invalid_union),()=>H7t(w=>r(w,400,"Invalid Union"),p.unionErrors)],[KR,()=>[{...p,status:o,contextCode:l}]]]),JR(c))(p.code),[],h.issues)}(t,400,""),t=>tp((r,h)=>{let{message:o,path:l,contextCode:c}=h,p=l[1]||l[0],w=c?`${c} `:"";return r.push(`${w}'${p}': ${o}.`),r},[],t),g9t(" | "))(i)}var k_t=Xe.object({id:Xe.string().min(1,{message:"message is required to be a message id"}),processId:Xe.string().min(1,{message:"process is required to be a process id"})});function I_t(){return i=>ci(i).map(k_t.parse).map(()=>i)}var Mm=Xe.object({name:Xe.string(),value:Xe.string()}),B_t=Xe.function().args(Xe.object({Id:Xe.string(),Target:Xe.string(),Owner:Xe.string(),Anchor:Xe.string().optional(),Data:Xe.any().default("1234"),Tags:Xe.array(Xe.object({name:Xe.string(),value:Xe.string()}))})).returns(Xe.promise(Xe.any())),O_t=Xe.function().args(Xe.object({id:Xe.string().min(1,{message:"message id is required"}),processId:Xe.string().min(1,{message:"process id is required"})})).returns(Xe.promise(Xe.any())),C_t=Xe.function().args(Xe.object({process:Xe.string().min(1,{message:"process id is required"}),from:Xe.string().optional(),to:Xe.string().optional(),sort:Xe.enum(["ASC","DESC"]).default("ASC"),limit:Xe.number().optional()})).returns(Xe.promise(Xe.object({edges:Xe.array(Xe.object({cursor:Xe.string(),node:Xe.object({Output:Xe.any().optional(),Messages:Xe.array(Xe.any()).optional(),Spawns:Xe.array(Xe.any()).optional(),Error:Xe.any().optional()})}))}))),met=Xe.function().args(Xe.object({processId:Xe.string(),data:Xe.any(),tags:Xe.array(Mm),anchor:Xe.string().optional(),signer:Xe.any()})).returns(Xe.promise(Xe.object({messageId:Xe.string()}).passthrough())),P_t=Xe.function().args(Xe.object({data:Xe.any(),tags:Xe.array(Mm),signer:Xe.any()})).returns(Xe.promise(Xe.object({processId:Xe.string()}).passthrough())),N_t=Xe.function().args(Xe.object({process:Xe.string(),message:Xe.string(),baseLayer:Xe.boolean().optional(),exclude:Xe.array(Xe.string()).optional()})).returns(Xe.promise(Xe.object({assignmentId:Xe.string()}).passthrough())),vet=met,PWt=Xe.function().args(Xe.object({suUrl:Xe.string().url(),processId:Xe.string()})).returns(Xe.promise(Xe.object({tags:Xe.array(Mm)}).passthrough())),NWt=Xe.function().args(Xe.string()).returns(Xe.promise(Xe.object({url:Xe.string()}))),L_t=Xe.function().args(Xe.string()).returns(Xe.promise(Xe.boolean())),D_t=Xe.function().args(Xe.string()).returns(Xe.promise(Xe.object({tags:Xe.array(Mm)}).passthrough())),w8=Xe.function().args(Xe.object({data:Xe.any(),tags:Xe.array(Mm),target:Xe.string().optional(),anchor:Xe.string().optional()})).returns(Xe.promise(Xe.object({id:Xe.string(),raw:Xe.any()})));function $_t({loadResult:i}){return i=rn(O_t.implement(i)),t=>ci({id:t.id,processId:t.processId}).chain(i)}function U_t(i){let t=I_t(i),r=$_t(i);return({message:h,process:o})=>ci({id:h,processId:o}).chain(t).chain(r).map(i.logger.tap('readResult result for message "%s": %O',h)).map(l=>l).bimap($0,D0).toPromise()}var q_t=Xe.array(Xe.object({name:Xe.string(),value:Xe.string()}));function F_t(){return i=>ci(i.tags).map(b8([])).map(Vs("Data-Protocol","ao")).map(Vs("Variant")).map(Vs("Type")).map(Vs("SDK")).map(JR(Nu,[{name:"Data-Protocol",value:"ao"},{name:"Variant",value:"ao.TN.1"},{name:"Type",value:"Message"},{name:"SDK",value:"aoconnect"}])).map(q_t.parse).map(Js("tags",Nu,i))}function j_t({logger:i}){return t=>ci(t).chain(XR(VR(t.data),()=>O0(t),()=>O0(Math.random().toString().slice(-4)).map(Js("data",Nu,t)).map(r=>ep(L0("tags"),Vs("Content-Type"),ZR({name:"Content-Type",value:"text/plain"}),Js("tags",Nu,r))(r)).map(i.tap('added pseudo-random string as message "data"'))))}function z_t(i){let t=F_t(i),r=j_t(i),h=met.implement(i.deployMessage);return o=>ci(o).chain(t).chain(r).chain(rn(({id:l,data:c,tags:p,anchor:w,signer:m})=>h({processId:l,data:c,tags:p,anchor:w,signer:w8.implement(m)}))).map(l=>Js("messageId",l.messageId,o))}function W_t(i){let t=z_t(i);return({process:r,data:h,tags:o,anchor:l,signer:c})=>ci({id:r,data:h,tags:o,anchor:l,signer:c}).chain(t).map(p=>p.messageId).bimap($0,D0).toPromise()}var Xg=(i,t,r)=>h=>t(h[i])?O0(h):tl(`Tag '${i}': ${r}`);function K_t({loadTransactionMeta:i,logger:t}){return i=rn(D_t.implement(i)),r=>ci(r).chain(i).map(L0("tags")).map(x_t).chain(Xg("Data-Protocol",ltt("ao"),"value 'ao' was not found on module")).chain(Xg("Type",ltt("Module"),"value 'Module' was not found on module")).chain(Xg("Module-Format",yR,"was not found on module")).chain(Xg("Input-Encoding",yR,"was not found on module")).chain(Xg("Output-Encoding",yR,"was not found on module")).bimap(t.tap("Verifying module source failed: %s"),t.tap("Verified module source"))}function H_t({logger:i,validateScheduler:t}){return t=rn(L_t.implement(t)),r=>ci(r).chain(h=>t(h).chain(o=>o?O0(h):tl(`Valid Scheduler-Location owned by ${h} not found`))).bimap(i.tap("Verifying scheduler failed: %s"),i.tap("Verified scheduler"))}function G_t({logger:i}){return t=>ci(t).map(i.tap("Checking for signer")).chain(r=>r?O0(r):tl("signer not found"))}function V_t(i){let t=i.logger.child("verifyInput");i={...i,logger:t};let r=K_t(i),h=H_t(i),o=G_t(i);return l=>ci(l).chain(c=>r(c.module).map(()=>c)).chain(c=>h(c.scheduler)).map(()=>l).chain(c=>o(c.signer).map(()=>c)).bimap(t.tap("Error when verify input: %s"),t.tap("Successfully verified inputs"))}var Z_t=Xe.array(Xe.object({name:Xe.string(),value:Xe.string()}));function J_t(){return i=>ci(i).map(L0("tags")).map(b8([])).map(Vs("Data-Protocol","ao")).map(Vs("Variant")).map(Vs("Type")).map(Vs("Module")).map(Vs("Scheduler")).map(Vs("SDK")).map(JR(Nu,[{name:"Data-Protocol",value:"ao"},{name:"Variant",value:"ao.TN.1"},{name:"Type",value:"Process"},{name:"Module",value:i.module},{name:"Scheduler",value:i.scheduler},{name:"SDK",value:"aoconnect"}])).map(Z_t.parse).map(Js("tags",Nu,i))}function X_t({logger:i}){return t=>ci(t).chain(XR(VR(t.data),()=>O0(t),()=>O0(Math.random().toString().slice(-4)).map(Js("data",Nu,t)).map(r=>ep(L0("tags"),Vs("Content-Type"),ZR({name:"Content-Type",value:"text/plain"}),Js("tags",Nu,r))(r)).map(i.tap('added pseudo-random string as process "data"'))))}function Y_t(i){let t=i.logger.child("uploadProcess");i={...i,logger:t};let r=J_t(i),h=X_t(i),o=P_t.implement(i.deployProcess);return l=>ci(l).chain(r).chain(h).chain(rn(({data:c,tags:p,signer:w})=>o({data:c,tags:p,signer:w8.implement(w)}))).map(c=>Js("processId",c.processId,l))}function Q_t(i){let t=V_t(i),r=Y_t(i);return({module:h,scheduler:o,signer:l,tags:c,data:p})=>ci({module:h,scheduler:o,signer:l,tags:c,data:p}).chain(t).chain(r).map(w=>w.processId).bimap($0,D0).toPromise()}function tMt(i){let t=vet.implement(i.deployMonitor);return r=>ci(r).chain(rn(({id:h,signer:o})=>t({processId:h,signer:w8.implement(o),data:Math.random().toString().slice(-4),tags:[]}))).map(h=>Js("monitorId",h.messageId,r))}function eMt(i){let t=tMt(i);return({process:r,signer:h})=>ci({id:r,signer:h}).chain(t).map(o=>o.monitorId).bimap($0,D0).toPromise()}function rMt(i){let t=vet.implement(i.deployUnmonitor);return r=>ci(r).chain(rn(({id:h,signer:o})=>t({processId:h,signer:w8.implement(o),data:Math.random().toString().slice(-4),tags:[]}))).map(h=>Js("monitorId",h.messageId,r))}function iMt(i){let t=rMt(i);return({process:r,signer:h})=>ci({id:r,signer:h}).chain(t).map(o=>o.monitorId).bimap($0,D0).toPromise()}var nMt=Xe.object({process:Xe.string().min(1,{message:"process identifier is required"}),from:Xe.string().optional(),to:Xe.string().optional(),sort:Xe.enum(["ASC","DESC"]).default("ASC"),limit:Xe.number().optional()});function oMt(){return i=>ci(i).map(nMt.parse).map(()=>i)}function aMt({queryResults:i}){return i=rn(C_t.implement(i)),t=>ci({process:t.process,from:t.from,to:t.to,sort:t.sort,limit:t.limit}).chain(i)}function sMt(i){let t=oMt(i),r=aMt(i);return({process:h,from:o,to:l,sort:c,limit:p})=>ci({process:h,from:o,to:l,sort:c,limit:p}).chain(t).chain(r).map(i.logger.tap('readResults result for message "%s": %O',h)).map(w=>w).bimap($0,D0).toPromise()}var hMt=Xe.object({Id:Xe.string(),Target:Xe.string(),Owner:Xe.string(),Anchor:Xe.string().optional(),Data:Xe.any().default("1234"),Tags:Xe.array(Xe.object({name:Xe.string(),value:Xe.string()}))});function fMt(){return i=>ci(i).map(hMt.parse).map(t=>(t.Tags=t.Tags.concat([{name:"Data-Protocol",value:"ao"},{name:"Type",value:"Message"},{name:"Variant",value:"ao.TN.1"}]),t))}function uMt({dryrunFetch:i}){return rn(B_t.implement(i))}function cMt(i){let t=fMt(i),r=uMt(i);return h=>ci(h).map(lMt).chain(t).chain(r).toPromise()}function lMt({process:i,data:t,tags:r,anchor:h,...o}){return{Id:"1234",Owner:"1234",...o,Target:i,Data:t||"1234",Tags:r||[],Anchor:h||"0"}}function dMt(i){let t=N_t.implement(i.deployAssign);return r=>ci(r).chain(rn(({process:h,message:o,baseLayer:l,exclude:c})=>t({process:h,message:o,baseLayer:l,exclude:c}))).map(h=>Js("assignmentId",h.assignmentId,r))}function pMt(i){let t=dMt(i);return({process:r,message:h,baseLayer:o,exclude:l})=>ci({process:r,message:h,baseLayer:o,exclude:l}).chain(t).map(c=>c.assignmentId).bimap($0,D0).toPromise()}var gMt="https://arweave.net",mMt="https://mu.ao-testnet.xyz",vMt="https://cu.ao-testnet.xyz";function Sm({GRAPHQL_URL:i,GATEWAY_URL:t=gMt,MU_URL:r=mMt,CU_URL:h=vMt}={}){let o=pet();i||(i=get({url:t,path:"/graphql"}));let{validate:l}=Ltt({cacheSize:100,GRAPHQL_URL:i}),c=D5t({MAX_SIZE:25}),p=o.child("result"),w=U_t({loadResult:P5t({fetch,CU_URL:h,logger:p}),logger:p}),m=o.child("message"),y=W_t({loadProcessMeta:gR({fetch,cache:c,logger:m}),deployMessage:R5t({fetch,MU_URL:r,logger:m}),logger:m}),v=o.child("spawn"),M=Q_t({loadTransactionMeta:A_t({fetch,GRAPHQL_URL:i,logger:v}),validateScheduler:l,deployProcess:k5t({fetch,MU_URL:r,logger:v}),logger:v}),T=o.child("monitor"),A=eMt({loadProcessMeta:gR({fetch,cache:c,logger:T}),deployMonitor:I5t({fetch,MU_URL:r,logger:T}),logger:T}),R=o.child("unmonitor"),B=iMt({loadProcessMeta:gR({fetch,cache:c,logger:R}),deployUnmonitor:B5t({fetch,MU_URL:r,logger:R}),logger:T}),C=o.child("results"),P=sMt({queryResults:N5t({fetch,CU_URL:h,logger:C}),logger:C}),N=o.child("dryrun"),q=cMt({dryrunFetch:C5t({fetch,CU_URL:h,logger:N}),logger:N}),W=o.child("assign"),J=pMt({deployAssign:O5t({fetch,MU_URL:r,logger:W}),logger:m});return{result:w,results:P,message:y,spawn:M,monitor:A,unmonitor:B,dryrun:q,assign:J}}var yet={};gtt(yet,{createDataItemSigner:()=>jMt});var bet=$R(W4t(),1),wet={};gtt(wet,{AVSCTap:()=>Em,ArweaveSigner:()=>ek,DataItem:()=>ym,MAX_TAG_BYTES:()=>_8,MIN_BINARY_SIZE:()=>nk,SIG_CONFIG:()=>op,SignatureConfig:()=>Gs,Signer:()=>Aet,createData:()=>ket,default:()=>UMt,deserializeTags:()=>l8,indexToType:()=>rk,serializeTags:()=>ik,tagsExceedLimit:()=>Ret,warparbundles:()=>qMt});var yMt=Object.create,QR=Object.defineProperty,bMt=Object.getOwnPropertyDescriptor,wMt=Object.getOwnPropertyNames,_Mt=Object.getPrototypeOf,MMt=Object.prototype.hasOwnProperty,Du=(i,t)=>()=>(t||i((t={exports:{}}).exports,t),t.exports),SMt=(i,t)=>{for(var r in t)QR(i,r,{get:t[r],enumerable:!0})},EMt=(i,t,r,h)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of wMt(t))!MMt.call(i,o)&&o!==r&&QR(i,o,{get:()=>t[o],enumerable:!(h=bMt(t,o))||h.enumerable});return i},U0=(i,t,r)=>(r=i!=null?yMt(_Mt(i)):{},EMt(t||!i||!i.__esModule?QR(r,"default",{value:i,enumerable:!0}):r,i)),AMt=Du(i=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0});function t(r){var h=4,o=r.length,l=o%h;if(!l)return r;var c=o,p=h-l,w=o+p,m=ge.alloc(w);for(m.write(r);p--;)m.write("=",c++);return m.toString()}i.default=t}),TMt=Du(i=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0});var t=AMt();function r(w,m){return m===void 0&&(m="utf8"),ge.isBuffer(w)?l(w.toString("base64")):l(ge.from(w,m).toString("base64"))}function h(w,m){return m===void 0&&(m="utf8"),ge.from(o(w),"base64").toString(m)}function o(w){return w=w.toString(),t.default(w).replace(/\-/g,"+").replace(/_/g,"/")}function l(w){return w.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function c(w){return ge.from(o(w),"base64")}var p=r;p.encode=r,p.decode=h,p.toBase64=o,p.fromBase64=l,p.toBuffer=c,i.default=p}),tk=Du((i,t)=>{t.exports=TMt().default,t.exports.default=t.exports}),_et=Du(i=>{"use strict";i.byteLength=w,i.toByteArray=y,i.fromByteArray=T;var t=[],r=[],h=typeof Uint8Array<"u"?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(l=0,c=o.length;l<c;++l)t[l]=o[l],r[o.charCodeAt(l)]=l;var l,c;r[45]=62,r[95]=63;function p(A){var R=A.length;if(R%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var B=A.indexOf("=");B===-1&&(B=R);var C=B===R?0:4-B%4;return[B,C]}function w(A){var R=p(A),B=R[0],C=R[1];return(B+C)*3/4-C}function m(A,R,B){return(R+B)*3/4-B}function y(A){var R,B=p(A),C=B[0],P=B[1],N=new h(m(A,C,P)),q=0,W=P>0?C-4:C,J;for(J=0;J<W;J+=4)R=r[A.charCodeAt(J)]<<18|r[A.charCodeAt(J+1)]<<12|r[A.charCodeAt(J+2)]<<6|r[A.charCodeAt(J+3)],N[q++]=R>>16&255,N[q++]=R>>8&255,N[q++]=R&255;return P===2&&(R=r[A.charCodeAt(J)]<<2|r[A.charCodeAt(J+1)]>>4,N[q++]=R&255),P===1&&(R=r[A.charCodeAt(J)]<<10|r[A.charCodeAt(J+1)]<<4|r[A.charCodeAt(J+2)]>>2,N[q++]=R>>8&255,N[q++]=R&255),N}function v(A){return t[A>>18&63]+t[A>>12&63]+t[A>>6&63]+t[A&63]}function M(A,R,B){for(var C,P=[],N=R;N<B;N+=3)C=(A[N]<<16&16711680)+(A[N+1]<<8&65280)+(A[N+2]&255),P.push(v(C));return P.join("")}function T(A){for(var R,B=A.length,C=B%3,P=[],N=16383,q=0,W=B-C;q<W;q+=N)P.push(M(A,q,q+N>W?W:q+N));return C===1?(R=A[B-1],P.push(t[R>>2]+t[R<<4&63]+"==")):C===2&&(R=(A[B-2]<<8)+A[B-1],P.push(t[R>>10]+t[R>>4&63]+t[R<<2&63]+"=")),P.join("")}}),Met=Du(i=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.b64UrlDecode=i.b64UrlEncode=i.bufferTob64Url=i.bufferTob64=i.b64UrlToBuffer=i.stringToB64Url=i.stringToBuffer=i.bufferToString=i.b64UrlToString=i.concatBuffers=void 0;var t=_et();function r(M){let T=0;for(let B=0;B<M.length;B++)T+=M[B].byteLength;let A=new Uint8Array(T),R=0;A.set(new Uint8Array(M[0]),R),R+=M[0].byteLength;for(let B=1;B<M.length;B++)A.set(new Uint8Array(M[B]),R),R+=M[B].byteLength;return A}i.concatBuffers=r;function h(M){let T=p(M);return o(T)}i.b64UrlToString=h;function o(M){return new TextDecoder("utf-8",{fatal:!0}).decode(M)}i.bufferToString=o;function l(M){return new TextEncoder().encode(M)}i.stringToBuffer=l;function c(M){return m(l(M))}i.stringToB64Url=c;function p(M){return new Uint8Array(t.toByteArray(v(M)))}i.b64UrlToBuffer=p;function w(M){return t.fromByteArray(new Uint8Array(M))}i.bufferTob64=w;function m(M){return y(w(M))}i.bufferTob64Url=m;function y(M){return M.replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")}i.b64UrlEncode=y;function v(M){M=M.replace(/\-/g,"+").replace(/\_/g,"/");let T;return M.length%4==0?T=0:T=4-M.length%4,M.concat("=".repeat(T))}i.b64UrlDecode=v}),xMt=Du(i=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0});var t=Met(),r=class{keyLength=4096;publicExponent=65537;hashAlgorithm="sha256";driver;constructor(){if(!this.detectWebCrypto())throw new Error("SubtleCrypto not available!");this.driver=crypto.subtle}async generateJWK(){let h=await this.driver.generateKey({name:"RSA-PSS",modulusLength:4096,publicExponent:new Uint8Array([1,0,1]),hash:{name:"SHA-256"}},!0,["sign"]),o=await this.driver.exportKey("jwk",h.privateKey);return{kty:o.kty,e:o.e,n:o.n,d:o.d,p:o.p,q:o.q,dp:o.dp,dq:o.dq,qi:o.qi}}async sign(h,o,{saltLength:l}={}){let c=await this.driver.sign({name:"RSA-PSS",saltLength:32},await this.jwkToCryptoKey(h),o);return new Uint8Array(c)}async hash(h,o="SHA-256"){let l=await this.driver.digest(o,h);return new Uint8Array(l)}async verify(h,o,l){let c={kty:"RSA",e:"AQAB",n:h},p=await this.jwkToPublicCryptoKey(c),w=await this.driver.digest("SHA-256",o),m=await this.driver.verify({name:"RSA-PSS",saltLength:0},p,l,o),y=await this.driver.verify({name:"RSA-PSS",saltLength:32},p,l,o),v=await this.driver.verify({name:"RSA-PSS",saltLength:Math.ceil((p.algorithm.modulusLength-1)/8)-w.byteLength-2},p,l,o);return m||y||v}async jwkToCryptoKey(h){return this.driver.importKey("jwk",h,{name:"RSA-PSS",hash:{name:"SHA-256"}},!1,["sign"])}async jwkToPublicCryptoKey(h){return this.driver.importKey("jwk",h,{name:"RSA-PSS",hash:{name:"SHA-256"}},!1,["verify"])}detectWebCrypto(){if(typeof crypto>"u")return!1;let h=crypto?.subtle;return h===void 0?!1:["generateKey","importKey","exportKey","digest","sign"].every(o=>typeof h[o]=="function")}async encrypt(h,o,l){let c=await this.driver.importKey("raw",typeof o=="string"?t.stringToBuffer(o):o,{name:"PBKDF2",length:32},!1,["deriveKey"]),p=await this.driver.deriveKey({name:"PBKDF2",salt:l?t.stringToBuffer(l):t.stringToBuffer("salt"),iterations:1e5,hash:"SHA-256"},c,{name:"AES-CBC",length:256},!1,["encrypt","decrypt"]),w=new Uint8Array(16);crypto.getRandomValues(w);let m=await this.driver.encrypt({name:"AES-CBC",iv:w},p,h);return t.concatBuffers([w,m])}async decrypt(h,o,l){let c=await this.driver.importKey("raw",typeof o=="string"?t.stringToBuffer(o):o,{name:"PBKDF2",length:32},!1,["deriveKey"]),p=await this.driver.deriveKey({name:"PBKDF2",salt:l?t.stringToBuffer(l):t.stringToBuffer("salt"),iterations:1e5,hash:"SHA-256"},c,{name:"AES-CBC",length:256},!1,["encrypt","decrypt"]),w=h.slice(0,16),m=await this.driver.decrypt({name:"AES-CBC",iv:w},p,h.slice(16));return t.concatBuffers([m])}};i.default=r}),RMt=Du(i=>{i.read=function(t,r,h,o,l){var c,p,w=l*8-o-1,m=(1<<w)-1,y=m>>1,v=-7,M=h?l-1:0,T=h?-1:1,A=t[r+M];for(M+=T,c=A&(1<<-v)-1,A>>=-v,v+=w;v>0;c=c*256+t[r+M],M+=T,v-=8);for(p=c&(1<<-v)-1,c>>=-v,v+=o;v>0;p=p*256+t[r+M],M+=T,v-=8);if(c===0)c=1-y;else{if(c===m)return p?NaN:(A?-1:1)*(1/0);p=p+Math.pow(2,o),c=c-y}return(A?-1:1)*p*Math.pow(2,c-o)},i.write=function(t,r,h,o,l,c){var p,w,m,y=c*8-l-1,v=(1<<y)-1,M=v>>1,T=l===23?Math.pow(2,-24)-Math.pow(2,-77):0,A=o?0:c-1,R=o?1:-1,B=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(w=isNaN(r)?1:0,p=v):(p=Math.floor(Math.log(r)/Math.LN2),r*(m=Math.pow(2,-p))<1&&(p--,m*=2),p+M>=1?r+=T/m:r+=T*Math.pow(2,1-M),r*m>=2&&(p++,m/=2),p+M>=v?(w=0,p=v):p+M>=1?(w=(r*m-1)*Math.pow(2,l),p=p+M):(w=r*Math.pow(2,M-1)*Math.pow(2,l),p=0));l>=8;t[h+A]=w&255,A+=R,w/=256,l-=8);for(p=p<<l|w,y+=l;y>0;t[h+A]=p&255,A+=R,p/=256,y-=8);t[h+A-R]|=B*128}}),NR=Du(i=>{"use strict";var t=_et(),r=RMt(),h=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;i.Buffer=p,i.SlowBuffer=P,i.INSPECT_MAX_BYTES=50;var o=2147483647;i.kMaxLength=o,p.TYPED_ARRAY_SUPPORT=l(),!p.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function l(){try{let I=new Uint8Array(1),O={foo:function(){return 42}};return Object.setPrototypeOf(O,Uint8Array.prototype),Object.setPrototypeOf(I,O),I.foo()===42}catch{return!1}}Object.defineProperty(p.prototype,"parent",{enumerable:!0,get:function(){if(p.isBuffer(this))return this.buffer}}),Object.defineProperty(p.prototype,"offset",{enumerable:!0,get:function(){if(p.isBuffer(this))return this.byteOffset}});function c(I){if(I>o)throw new RangeError('The value "'+I+'" is invalid for option "size"');let O=new Uint8Array(I);return Object.setPrototypeOf(O,p.prototype),O}function p(I,O,L){if(typeof I=="number"){if(typeof O=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return v(I)}return w(I,O,L)}p.poolSize=8192;function w(I,O,L){if(typeof I=="string")return M(I,O);if(ArrayBuffer.isView(I))return A(I);if(I==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof I);if(mt(I,ArrayBuffer)||I&&mt(I.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(mt(I,SharedArrayBuffer)||I&&mt(I.buffer,SharedArrayBuffer)))return R(I,O,L);if(typeof I=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let V=I.valueOf&&I.valueOf();if(V!=null&&V!==I)return p.from(V,O,L);let st=B(I);if(st)return st;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof I[Symbol.toPrimitive]=="function")return p.from(I[Symbol.toPrimitive]("string"),O,L);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof I)}p.from=function(I,O,L){return w(I,O,L)},Object.setPrototypeOf(p.prototype,Uint8Array.prototype),Object.setPrototypeOf(p,Uint8Array);function m(I){if(typeof I!="number")throw new TypeError('"size" argument must be of type number');if(I<0)throw new RangeError('The value "'+I+'" is invalid for option "size"')}function y(I,O,L){return m(I),I<=0?c(I):O!==void 0?typeof L=="string"?c(I).fill(O,L):c(I).fill(O):c(I)}p.alloc=function(I,O,L){return y(I,O,L)};function v(I){return m(I),c(I<0?0:C(I)|0)}p.allocUnsafe=function(I){return v(I)},p.allocUnsafeSlow=function(I){return v(I)};function M(I,O){if((typeof O!="string"||O==="")&&(O="utf8"),!p.isEncoding(O))throw new TypeError("Unknown encoding: "+O);let L=N(I,O)|0,V=c(L),st=V.write(I,O);return st!==L&&(V=V.slice(0,st)),V}function T(I){let O=I.length<0?0:C(I.length)|0,L=c(O);for(let V=0;V<O;V+=1)L[V]=I[V]&255;return L}function A(I){if(mt(I,Uint8Array)){let O=new Uint8Array(I);return R(O.buffer,O.byteOffset,O.byteLength)}return T(I)}function R(I,O,L){if(O<0||I.byteLength<O)throw new RangeError('"offset" is outside of buffer bounds');if(I.byteLength<O+(L||0))throw new RangeError('"length" is outside of buffer bounds');let V;return O===void 0&&L===void 0?V=new Uint8Array(I):L===void 0?V=new Uint8Array(I,O):V=new Uint8Array(I,O,L),Object.setPrototypeOf(V,p.prototype),V}function B(I){if(p.isBuffer(I)){let O=C(I.length)|0,L=c(O);return L.length===0||I.copy(L,0,0,O),L}if(I.length!==void 0)return typeof I.length!="number"||wt(I.length)?c(0):T(I);if(I.type==="Buffer"&&Array.isArray(I.data))return T(I.data)}function C(I){if(I>=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return I|0}function P(I){return+I!=I&&(I=0),p.alloc(+I)}p.isBuffer=function(I){return I!=null&&I._isBuffer===!0&&I!==p.prototype},p.compare=function(I,O){if(mt(I,Uint8Array)&&(I=p.from(I,I.offset,I.byteLength)),mt(O,Uint8Array)&&(O=p.from(O,O.offset,O.byteLength)),!p.isBuffer(I)||!p.isBuffer(O))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(I===O)return 0;let L=I.length,V=O.length;for(let st=0,ft=Math.min(L,V);st<ft;++st)if(I[st]!==O[st]){L=I[st],V=O[st];break}return L<V?-1:V<L?1:0},p.isEncoding=function(I){switch(String(I).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},p.concat=function(I,O){if(!Array.isArray(I))throw new TypeError('"list" argument must be an Array of Buffers');if(I.length===0)return p.alloc(0);let L;if(O===void 0)for(O=0,L=0;L<I.length;++L)O+=I[L].length;let V=p.allocUnsafe(O),st=0;for(L=0;L<I.length;++L){let ft=I[L];if(mt(ft,Uint8Array))st+ft.length>V.length?(p.isBuffer(ft)||(ft=p.from(ft)),ft.copy(V,st)):Uint8Array.prototype.set.call(V,ft,st);else if(p.isBuffer(ft))ft.copy(V,st);else throw new TypeError('"list" argument must be an Array of Buffers');st+=ft.length}return V};function N(I,O){if(p.isBuffer(I))return I.length;if(ArrayBuffer.isView(I)||mt(I,ArrayBuffer))return I.byteLength;if(typeof I!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof I);let L=I.length,V=arguments.length>2&&arguments[2]===!0;if(!V&&L===0)return 0;let st=!1;for(;;)switch(O){case"ascii":case"latin1":case"binary":return L;case"utf8":case"utf-8":return ut(I).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L*2;case"hex":return L>>>1;case"base64":return bt(I).length;default:if(st)return V?-1:ut(I).length;O=(""+O).toLowerCase(),st=!0}}p.byteLength=N;function q(I,O,L){let V=!1;if((O===void 0||O<0)&&(O=0),O>this.length||((L===void 0||L>this.length)&&(L=this.length),L<=0)||(L>>>=0,O>>>=0,L<=O))return"";for(I||(I="utf8");;)switch(I){case"hex":return e(this,O,L);case"utf8":case"utf-8":return d(this,O,L);case"ascii":return x(this,O,L);case"latin1":case"binary":return a(this,O,L);case"base64":return f(this,O,L);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return u(this,O,L);default:if(V)throw new TypeError("Unknown encoding: "+I);I=(I+"").toLowerCase(),V=!0}}p.prototype._isBuffer=!0;function W(I,O,L){let V=I[O];I[O]=I[L],I[L]=V}p.prototype.swap16=function(){let I=this.length;if(I%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let O=0;O<I;O+=2)W(this,O,O+1);return this},p.prototype.swap32=function(){let I=this.length;if(I%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let O=0;O<I;O+=4)W(this,O,O+3),W(this,O+1,O+2);return this},p.prototype.swap64=function(){let I=this.length;if(I%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let O=0;O<I;O+=8)W(this,O,O+7),W(this,O+1,O+6),W(this,O+2,O+5),W(this,O+3,O+4);return this},p.prototype.toString=function(){let I=this.length;return I===0?"":arguments.length===0?d(this,0,I):q.apply(this,arguments)},p.prototype.toLocaleString=p.prototype.toString,p.prototype.equals=function(I){if(!p.isBuffer(I))throw new TypeError("Argument must be a Buffer");return this===I?!0:p.compare(this,I)===0},p.prototype.inspect=function(){let I="",O=i.INSPECT_MAX_BYTES;return I=this.toString("hex",0,O).replace(/(.{2})/g,"$1 ").trim(),this.length>O&&(I+=" ... "),"<Buffer "+I+">"},h&&(p.prototype[h]=p.prototype.inspect),p.prototype.compare=function(I,O,L,V,st){if(mt(I,Uint8Array)&&(I=p.from(I,I.offset,I.byteLength)),!p.isBuffer(I))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof I);if(O===void 0&&(O=0),L===void 0&&(L=I?I.length:0),V===void 0&&(V=0),st===void 0&&(st=this.length),O<0||L>I.length||V<0||st>this.length)throw new RangeError("out of range index");if(V>=st&&O>=L)return 0;if(V>=st)return-1;if(O>=L)return 1;if(O>>>=0,L>>>=0,V>>>=0,st>>>=0,this===I)return 0;let ft=st-V,ht=L-O,Et=Math.min(ft,ht),_t=this.slice(V,st),vt=I.slice(O,L);for(let Qt=0;Qt<Et;++Qt)if(_t[Qt]!==vt[Qt]){ft=_t[Qt],ht=vt[Qt];break}return ft<ht?-1:ht<ft?1:0};function J(I,O,L,V,st){if(I.length===0)return-1;if(typeof L=="string"?(V=L,L=0):L>2147483647?L=2147483647:L<-2147483648&&(L=-2147483648),L=+L,wt(L)&&(L=st?0:I.length-1),L<0&&(L=I.length+L),L>=I.length){if(st)return-1;L=I.length-1}else if(L<0)if(st)L=0;else return-1;if(typeof O=="string"&&(O=p.from(O,V)),p.isBuffer(O))return O.length===0?-1:F(I,O,L,V,st);if(typeof O=="number")return O=O&255,typeof Uint8Array.prototype.indexOf=="function"?st?Uint8Array.prototype.indexOf.call(I,O,L):Uint8Array.prototype.lastIndexOf.call(I,O,L):F(I,[O],L,V,st);throw new TypeError("val must be string, number or Buffer")}function F(I,O,L,V,st){let ft=1,ht=I.length,Et=O.length;if(V!==void 0&&(V=String(V).toLowerCase(),V==="ucs2"||V==="ucs-2"||V==="utf16le"||V==="utf-16le")){if(I.length<2||O.length<2)return-1;ft=2,ht/=2,Et/=2,L/=2}function _t(Qt,It){return ft===1?Qt[It]:Qt.readUInt16BE(It*ft)}let vt;if(st){let Qt=-1;for(vt=L;vt<ht;vt++)if(_t(I,vt)===_t(O,Qt===-1?0:vt-Qt)){if(Qt===-1&&(Qt=vt),vt-Qt+1===Et)return Qt*ft}else Qt!==-1&&(vt-=vt-Qt),Qt=-1}else for(L+Et>ht&&(L=ht-Et),vt=L;vt>=0;vt--){let Qt=!0;for(let It=0;It<Et;It++)if(_t(I,vt+It)!==_t(O,It)){Qt=!1;break}if(Qt)return vt}return-1}p.prototype.includes=function(I,O,L){return this.indexOf(I,O,L)!==-1},p.prototype.indexOf=function(I,O,L){return J(this,I,O,L,!0)},p.prototype.lastIndexOf=function(I,O,L){return J(this,I,O,L,!1)};function H(I,O,L,V){L=Number(L)||0;let st=I.length-L;V?(V=Number(V),V>st&&(V=st)):V=st;let ft=O.length;V>ft/2&&(V=ft/2);let ht;for(ht=0;ht<V;++ht){let Et=parseInt(O.substr(ht*2,2),16);if(wt(Et))return ht;I[L+ht]=Et}return ht}function Y(I,O,L,V){return lt(ut(O,I.length-L),I,L,V)}function E(I,O,L,V){return lt(pt(O),I,L,V)}function n(I,O,L,V){return lt(bt(O),I,L,V)}function s(I,O,L,V){return lt(St(O,I.length-L),I,L,V)}p.prototype.write=function(I,O,L,V){if(O===void 0)V="utf8",L=this.length,O=0;else if(L===void 0&&typeof O=="string")V=O,L=this.length,O=0;else if(isFinite(O))O=O>>>0,isFinite(L)?(L=L>>>0,V===void 0&&(V="utf8")):(V=L,L=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let st=this.length-O;if((L===void 0||L>st)&&(L=st),I.length>0&&(L<0||O<0)||O>this.length)throw new RangeError("Attempt to write outside buffer bounds");V||(V="utf8");let ft=!1;for(;;)switch(V){case"hex":return H(this,I,O,L);case"utf8":case"utf-8":return Y(this,I,O,L);case"ascii":case"latin1":case"binary":return E(this,I,O,L);case"base64":return n(this,I,O,L);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return s(this,I,O,L);default:if(ft)throw new TypeError("Unknown encoding: "+V);V=(""+V).toLowerCase(),ft=!0}},p.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function f(I,O,L){return O===0&&L===I.length?t.fromByteArray(I):t.fromByteArray(I.slice(O,L))}function d(I,O,L){L=Math.min(I.length,L);let V=[],st=O;for(;st<L;){let ft=I[st],ht=null,Et=ft>239?4:ft>223?3:ft>191?2:1;if(st+Et<=L){let _t,vt,Qt,It;switch(Et){case 1:ft<128&&(ht=ft);break;case 2:_t=I[st+1],(_t&192)===128&&(It=(ft&31)<<6|_t&63,It>127&&(ht=It));break;case 3:_t=I[st+1],vt=I[st+2],(_t&192)===128&&(vt&192)===128&&(It=(ft&15)<<12|(_t&63)<<6|vt&63,It>2047&&(It<55296||It>57343)&&(ht=It));break;case 4:_t=I[st+1],vt=I[st+2],Qt=I[st+3],(_t&192)===128&&(vt&192)===128&&(Qt&192)===128&&(It=(ft&15)<<18|(_t&63)<<12|(vt&63)<<6|Qt&63,It>65535&&It<1114112&&(ht=It))}}ht===null?(ht=65533,Et=1):ht>65535&&(ht-=65536,V.push(ht>>>10&1023|55296),ht=56320|ht&1023),V.push(ht),st+=Et}return S(V)}var g=4096;function S(I){let O=I.length;if(O<=g)return String.fromCharCode.apply(String,I);let L="",V=0;for(;V<O;)L+=String.fromCharCode.apply(String,I.slice(V,V+=g));return L}function x(I,O,L){let V="";L=Math.min(I.length,L);for(let st=O;st<L;++st)V+=String.fromCharCode(I[st]&127);return V}function a(I,O,L){let V="";L=Math.min(I.length,L);for(let st=O;st<L;++st)V+=String.fromCharCode(I[st]);return V}function e(I,O,L){let V=I.length;(!O||O<0)&&(O=0),(!L||L<0||L>V)&&(L=V);let st="";for(let ft=O;ft<L;++ft)st+=Mt[I[ft]];return st}function u(I,O,L){let V=I.slice(O,L),st="";for(let ft=0;ft<V.length-1;ft+=2)st+=String.fromCharCode(V[ft]+V[ft+1]*256);return st}p.prototype.slice=function(I,O){let L=this.length;I=~~I,O=O===void 0?L:~~O,I<0?(I+=L,I<0&&(I=0)):I>L&&(I=L),O<0?(O+=L,O<0&&(O=0)):O>L&&(O=L),O<I&&(O=I);let V=this.subarray(I,O);return Object.setPrototypeOf(V,p.prototype),V};function b(I,O,L){if(I%1!==0||I<0)throw new RangeError("offset is not uint");if(I+O>L)throw new RangeError("Trying to access beyond buffer length")}p.prototype.readUintLE=p.prototype.readUIntLE=function(I,O,L){I=I>>>0,O=O>>>0,L||b(I,O,this.length);let V=this[I],st=1,ft=0;for(;++ft<O&&(st*=256);)V+=this[I+ft]*st;return V},p.prototype.readUintBE=p.prototype.readUIntBE=function(I,O,L){I=I>>>0,O=O>>>0,L||b(I,O,this.length);let V=this[I+--O],st=1;for(;O>0&&(st*=256);)V+=this[I+--O]*st;return V},p.prototype.readUint8=p.prototype.readUInt8=function(I,O){return I=I>>>0,O||b(I,1,this.length),this[I]},p.prototype.readUint16LE=p.prototype.readUInt16LE=function(I,O){return I=I>>>0,O||b(I,2,this.length),this[I]|this[I+1]<<8},p.prototype.readUint16BE=p.prototype.readUInt16BE=function(I,O){return I=I>>>0,O||b(I,2,this.length),this[I]<<8|this[I+1]},p.prototype.readUint32LE=p.prototype.readUInt32LE=function(I,O){return I=I>>>0,O||b(I,4,this.length),(this[I]|this[I+1]<<8|this[I+2]<<16)+this[I+3]*16777216},p.prototype.readUint32BE=p.prototype.readUInt32BE=function(I,O){return I=I>>>0,O||b(I,4,this.length),this[I]*16777216+(this[I+1]<<16|this[I+2]<<8|this[I+3])},p.prototype.readBigUInt64LE=ne(function(I){I=I>>>0,j(I,"offset");let O=this[I],L=this[I+7];(O===void 0||L===void 0)&&rt(I,this.length-8);let V=O+this[++I]*2**8+this[++I]*2**16+this[++I]*2**24,st=this[++I]+this[++I]*2**8+this[++I]*2**16+L*2**24;return BigInt(V)+(BigInt(st)<<BigInt(32))}),p.prototype.readBigUInt64BE=ne(function(I){I=I>>>0,j(I,"offset");let O=this[I],L=this[I+7];(O===void 0||L===void 0)&&rt(I,this.length-8);let V=O*2**24+this[++I]*2**16+this[++I]*2**8+this[++I],st=this[++I]*2**24+this[++I]*2**16+this[++I]*2**8+L;return(BigInt(V)<<BigInt(32))+BigInt(st)}),p.prototype.readIntLE=function(I,O,L){I=I>>>0,O=O>>>0,L||b(I,O,this.length);let V=this[I],st=1,ft=0;for(;++ft<O&&(st*=256);)V+=this[I+ft]*st;return st*=128,V>=st&&(V-=Math.pow(2,8*O)),V},p.prototype.readIntBE=function(I,O,L){I=I>>>0,O=O>>>0,L||b(I,O,this.length);let V=O,st=1,ft=this[I+--V];for(;V>0&&(st*=256);)ft+=this[I+--V]*st;return st*=128,ft>=st&&(ft-=Math.pow(2,8*O)),ft},p.prototype.readInt8=function(I,O){return I=I>>>0,O||b(I,1,this.length),this[I]&128?(255-this[I]+1)*-1:this[I]},p.prototype.readInt16LE=function(I,O){I=I>>>0,O||b(I,2,this.length);let L=this[I]|this[I+1]<<8;return L&32768?L|4294901760:L},p.prototype.readInt16BE=function(I,O){I=I>>>0,O||b(I,2,this.length);let L=this[I+1]|this[I]<<8;return L&32768?L|4294901760:L},p.prototype.readInt32LE=function(I,O){return I=I>>>0,O||b(I,4,this.length),this[I]|this[I+1]<<8|this[I+2]<<16|this[I+3]<<24},p.prototype.readInt32BE=function(I,O){return I=I>>>0,O||b(I,4,this.length),this[I]<<24|this[I+1]<<16|this[I+2]<<8|this[I+3]},p.prototype.readBigInt64LE=ne(function(I){I=I>>>0,j(I,"offset");let O=this[I],L=this[I+7];(O===void 0||L===void 0)&&rt(I,this.length-8);let V=this[I+4]+this[I+5]*2**8+this[I+6]*2**16+(L<<24);return(BigInt(V)<<BigInt(32))+BigInt(O+this[++I]*2**8+this[++I]*2**16+this[++I]*2**24)}),p.prototype.readBigInt64BE=ne(function(I){I=I>>>0,j(I,"offset");let O=this[I],L=this[I+7];(O===void 0||L===void 0)&&rt(I,this.length-8);let V=(O<<24)+this[++I]*2**16+this[++I]*2**8+this[++I];return(BigInt(V)<<BigInt(32))+BigInt(this[++I]*2**24+this[++I]*2**16+this[++I]*2**8+L)}),p.prototype.readFloatLE=function(I,O){return I=I>>>0,O||b(I,4,this.length),r.read(this,I,!0,23,4)},p.prototype.readFloatBE=function(I,O){return I=I>>>0,O||b(I,4,this.length),r.read(this,I,!1,23,4)},p.prototype.readDoubleLE=function(I,O){return I=I>>>0,O||b(I,8,this.length),r.read(this,I,!0,52,8)},p.prototype.readDoubleBE=function(I,O){return I=I>>>0,O||b(I,8,this.length),r.read(this,I,!1,52,8)};function _(I,O,L,V,st,ft){if(!p.isBuffer(I))throw new TypeError('"buffer" argument must be a Buffer instance');if(O>st||O<ft)throw new RangeError('"value" argument is out of bounds');if(L+V>I.length)throw new RangeError("Index out of range")}p.prototype.writeUintLE=p.prototype.writeUIntLE=function(I,O,L,V){if(I=+I,O=O>>>0,L=L>>>0,!V){let ht=Math.pow(2,8*L)-1;_(this,I,O,L,ht,0)}let st=1,ft=0;for(this[O]=I&255;++ft<L&&(st*=256);)this[O+ft]=I/st&255;return O+L},p.prototype.writeUintBE=p.prototype.writeUIntBE=function(I,O,L,V){if(I=+I,O=O>>>0,L=L>>>0,!V){let ht=Math.pow(2,8*L)-1;_(this,I,O,L,ht,0)}let st=L-1,ft=1;for(this[O+st]=I&255;--st>=0&&(ft*=256);)this[O+st]=I/ft&255;return O+L},p.prototype.writeUint8=p.prototype.writeUInt8=function(I,O,L){return I=+I,O=O>>>0,L||_(this,I,O,1,255,0),this[O]=I&255,O+1},p.prototype.writeUint16LE=p.prototype.writeUInt16LE=function(I,O,L){return I=+I,O=O>>>0,L||_(this,I,O,2,65535,0),this[O]=I&255,this[O+1]=I>>>8,O+2},p.prototype.writeUint16BE=p.prototype.writeUInt16BE=function(I,O,L){return I=+I,O=O>>>0,L||_(this,I,O,2,65535,0),this[O]=I>>>8,this[O+1]=I&255,O+2},p.prototype.writeUint32LE=p.prototype.writeUInt32LE=function(I,O,L){return I=+I,O=O>>>0,L||_(this,I,O,4,4294967295,0),this[O+3]=I>>>24,this[O+2]=I>>>16,this[O+1]=I>>>8,this[O]=I&255,O+4},p.prototype.writeUint32BE=p.prototype.writeUInt32BE=function(I,O,L){return I=+I,O=O>>>0,L||_(this,I,O,4,4294967295,0),this[O]=I>>>24,this[O+1]=I>>>16,this[O+2]=I>>>8,this[O+3]=I&255,O+4};function k(I,O,L,V,st){U(O,V,st,I,L,7);let ft=Number(O&BigInt(4294967295));I[L++]=ft,ft=ft>>8,I[L++]=ft,ft=ft>>8,I[L++]=ft,ft=ft>>8,I[L++]=ft;let ht=Number(O>>BigInt(32)&BigInt(4294967295));return I[L++]=ht,ht=ht>>8,I[L++]=ht,ht=ht>>8,I[L++]=ht,ht=ht>>8,I[L++]=ht,L}function $(I,O,L,V,st){U(O,V,st,I,L,7);let ft=Number(O&BigInt(4294967295));I[L+7]=ft,ft=ft>>8,I[L+6]=ft,ft=ft>>8,I[L+5]=ft,ft=ft>>8,I[L+4]=ft;let ht=Number(O>>BigInt(32)&BigInt(4294967295));return I[L+3]=ht,ht=ht>>8,I[L+2]=ht,ht=ht>>8,I[L+1]=ht,ht=ht>>8,I[L]=ht,L+8}p.prototype.writeBigUInt64LE=ne(function(I,O=0){return k(this,I,O,BigInt(0),BigInt("0xffffffffffffffff"))}),p.prototype.writeBigUInt64BE=ne(function(I,O=0){return $(this,I,O,BigInt(0),BigInt("0xffffffffffffffff"))}),p.prototype.writeIntLE=function(I,O,L,V){if(I=+I,O=O>>>0,!V){let Et=Math.pow(2,8*L-1);_(this,I,O,L,Et-1,-Et)}let st=0,ft=1,ht=0;for(this[O]=I&255;++st<L&&(ft*=256);)I<0&&ht===0&&this[O+st-1]!==0&&(ht=1),this[O+st]=(I/ft>>0)-ht&255;return O+L},p.prototype.writeIntBE=function(I,O,L,V){if(I=+I,O=O>>>0,!V){let Et=Math.pow(2,8*L-1);_(this,I,O,L,Et-1,-Et)}let st=L-1,ft=1,ht=0;for(this[O+st]=I&255;--st>=0&&(ft*=256);)I<0&&ht===0&&this[O+st+1]!==0&&(ht=1),this[O+st]=(I/ft>>0)-ht&255;return O+L},p.prototype.writeInt8=function(I,O,L){return I=+I,O=O>>>0,L||_(this,I,O,1,127,-128),I<0&&(I=255+I+1),this[O]=I&255,O+1},p.prototype.writeInt16LE=function(I,O,L){return I=+I,O=O>>>0,L||_(this,I,O,2,32767,-32768),this[O]=I&255,this[O+1]=I>>>8,O+2},p.prototype.writeInt16BE=function(I,O,L){return I=+I,O=O>>>0,L||_(this,I,O,2,32767,-32768),this[O]=I>>>8,this[O+1]=I&255,O+2},p.prototype.writeInt32LE=function(I,O,L){return I=+I,O=O>>>0,L||_(this,I,O,4,2147483647,-2147483648),this[O]=I&255,this[O+1]=I>>>8,this[O+2]=I>>>16,this[O+3]=I>>>24,O+4},p.prototype.writeInt32BE=function(I,O,L){return I=+I,O=O>>>0,L||_(this,I,O,4,2147483647,-2147483648),I<0&&(I=4294967295+I+1),this[O]=I>>>24,this[O+1]=I>>>16,this[O+2]=I>>>8,this[O+3]=I&255,O+4},p.prototype.writeBigInt64LE=ne(function(I,O=0){return k(this,I,O,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),p.prototype.writeBigInt64BE=ne(function(I,O=0){return $(this,I,O,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function it(I,O,L,V,st,ft){if(L+V>I.length)throw new RangeError("Index out of range");if(L<0)throw new RangeError("Index out of range")}function Z(I,O,L,V,st){return O=+O,L=L>>>0,st||it(I,O,L,4,34028234663852886e22,-34028234663852886e22),r.write(I,O,L,V,23,4),L+4}p.prototype.writeFloatLE=function(I,O,L){return Z(this,I,O,!0,L)},p.prototype.writeFloatBE=function(I,O,L){return Z(this,I,O,!1,L)};function et(I,O,L,V,st){return O=+O,L=L>>>0,st||it(I,O,L,8,17976931348623157e292,-17976931348623157e292),r.write(I,O,L,V,52,8),L+8}p.prototype.writeDoubleLE=function(I,O,L){return et(this,I,O,!0,L)},p.prototype.writeDoubleBE=function(I,O,L){return et(this,I,O,!1,L)},p.prototype.copy=function(I,O,L,V){if(!p.isBuffer(I))throw new TypeError("argument should be a Buffer");if(L||(L=0),!V&&V!==0&&(V=this.length),O>=I.length&&(O=I.length),O||(O=0),V>0&&V<L&&(V=L),V===L||I.length===0||this.length===0)return 0;if(O<0)throw new RangeError("targetStart out of bounds");if(L<0||L>=this.length)throw new RangeError("Index out of range");if(V<0)throw new RangeError("sourceEnd out of bounds");V>this.length&&(V=this.length),I.length-O<V-L&&(V=I.length-O+L);let st=V-L;return this===I&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(O,L,V):Uint8Array.prototype.set.call(I,this.subarray(L,V),O),st},p.prototype.fill=function(I,O,L,V){if(typeof I=="string"){if(typeof O=="string"?(V=O,O=0,L=this.length):typeof L=="string"&&(V=L,L=this.length),V!==void 0&&typeof V!="string")throw new TypeError("encoding must be a string");if(typeof V=="string"&&!p.isEncoding(V))throw new TypeError("Unknown encoding: "+V);if(I.length===1){let ft=I.charCodeAt(0);(V==="utf8"&&ft<128||V==="latin1")&&(I=ft)}}else typeof I=="number"?I=I&255:typeof I=="boolean"&&(I=Number(I));if(O<0||this.length<O||this.length<L)throw new RangeError("Out of range index");if(L<=O)return this;O=O>>>0,L=L===void 0?this.length:L>>>0,I||(I=0);let st;if(typeof I=="number")for(st=O;st<L;++st)this[st]=I;else{let ft=p.isBuffer(I)?I:p.from(I,V),ht=ft.length;if(ht===0)throw new TypeError('The value "'+I+'" is invalid for argument "value"');for(st=0;st<L-O;++st)this[st+O]=ft[st%ht]}return this};var Q={};function z(I,O,L){Q[I]=class extends L{constructor(){super(),Object.defineProperty(this,"message",{value:O.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${I}]`,this.stack,delete this.name}get code(){return I}set code(V){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:V,writable:!0})}toString(){return`${this.name} [${I}]: ${this.message}`}}}z("ERR_BUFFER_OUT_OF_BOUNDS",function(I){return I?`${I} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),z("ERR_INVALID_ARG_TYPE",function(I,O){return`The "${I}" argument must be of type number. Received type ${typeof O}`},TypeError),z("ERR_OUT_OF_RANGE",function(I,O,L){let V=`The value of "${I}" is out of range.`,st=L;return Number.isInteger(L)&&Math.abs(L)>2**32?st=tt(String(L)):typeof L=="bigint"&&(st=String(L),(L>BigInt(2)**BigInt(32)||L<-(BigInt(2)**BigInt(32)))&&(st=tt(st)),st+="n"),V+=` It must be ${O}. Received ${st}`,V},RangeError);function tt(I){let O="",L=I.length,V=I[0]==="-"?1:0;for(;L>=V+4;L-=3)O=`_${I.slice(L-3,L)}${O}`;return`${I.slice(0,L)}${O}`}function X(I,O,L){j(O,"offset"),(I[O]===void 0||I[O+L]===void 0)&&rt(O,I.length-(L+1))}function U(I,O,L,V,st,ft){if(I>L||I<O){let ht=typeof O=="bigint"?"n":"",Et;throw ft>3?O===0||O===BigInt(0)?Et=`>= 0${ht} and < 2${ht} ** ${(ft+1)*8}${ht}`:Et=`>= -(2${ht} ** ${(ft+1)*8-1}${ht}) and < 2 ** ${(ft+1)*8-1}${ht}`:Et=`>= ${O}${ht} and <= ${L}${ht}`,new Q.ERR_OUT_OF_RANGE("value",Et,I)}X(V,st,ft)}function j(I,O){if(typeof I!="number")throw new Q.ERR_INVALID_ARG_TYPE(O,"number",I)}function rt(I,O,L){throw Math.floor(I)!==I?(j(I,L),new Q.ERR_OUT_OF_RANGE(L||"offset","an integer",I)):O<0?new Q.ERR_BUFFER_OUT_OF_BOUNDS:new Q.ERR_OUT_OF_RANGE(L||"offset",`>= ${L?1:0} and <= ${O}`,I)}var ot=/[^+/0-9A-Za-z-_]/g;function ct(I){if(I=I.split("=")[0],I=I.trim().replace(ot,""),I.length<2)return"";for(;I.length%4!==0;)I=I+"=";return I}function ut(I,O){O=O||1/0;let L,V=I.length,st=null,ft=[];for(let ht=0;ht<V;++ht){if(L=I.charCodeAt(ht),L>55295&&L<57344){if(!st){if(L>56319){(O-=3)>-1&&ft.push(239,191,189);continue}else if(ht+1===V){(O-=3)>-1&&ft.push(239,191,189);continue}st=L;continue}if(L<56320){(O-=3)>-1&&ft.push(239,191,189),st=L;continue}L=(st-55296<<10|L-56320)+65536}else st&&(O-=3)>-1&&ft.push(239,191,189);if(st=null,L<128){if((O-=1)<0)break;ft.push(L)}else if(L<2048){if((O-=2)<0)break;ft.push(L>>6|192,L&63|128)}else if(L<65536){if((O-=3)<0)break;ft.push(L>>12|224,L>>6&63|128,L&63|128)}else if(L<1114112){if((O-=4)<0)break;ft.push(L>>18|240,L>>12&63|128,L>>6&63|128,L&63|128)}else throw new Error("Invalid code point")}return ft}function pt(I){let O=[];for(let L=0;L<I.length;++L)O.push(I.charCodeAt(L)&255);return O}function St(I,O){let L,V,st,ft=[];for(let ht=0;ht<I.length&&!((O-=2)<0);++ht)L=I.charCodeAt(ht),V=L>>8,st=L%256,ft.push(st),ft.push(V);return ft}function bt(I){return t.toByteArray(ct(I))}function lt(I,O,L,V){let st;for(st=0;st<V&&!(st+L>=O.length||st>=I.length);++st)O[st+L]=I[st];return st}function mt(I,O){return I instanceof O||I!=null&&I.constructor!=null&&I.constructor.name!=null&&I.constructor.name===O.name}function wt(I){return I!==I}var Mt=function(){let I="0123456789abcdef",O=new Array(256);for(let L=0;L<16;++L){let V=L*16;for(let st=0;st<16;++st)O[V+st]=I[L]+I[st]}return O}();function ne(I){return typeof BigInt>"u"?nt:I}function nt(){throw new Error("BigInt not supported")}}),kMt=Du((i,t)=>{typeof window<"u"?(window.global=window,global.fetch=window.fetch,t.exports={Buffer:NR().Buffer,Crypto:window.crypto}):t.exports={Buffer:NR().Buffer,Crypto:crypto}}),Eet={};SMt(Eet,{AVSCTap:()=>Em,ArweaveSigner:()=>ek,DataItem:()=>ym,MAX_TAG_BYTES:()=>_8,MIN_BINARY_SIZE:()=>nk,SIG_CONFIG:()=>op,SignatureConfig:()=>Gs,Signer:()=>Aet,createData:()=>ket,deserializeTags:()=>l8,indexToType:()=>rk,serializeTags:()=>ik,tagsExceedLimit:()=>Ret});var Aet=class{signer;publicKey;signatureType;signatureLength;ownerLength;pem;static verify(i,t,r,h){throw new Error("You must implement verify method on child")}},IMt=U0(tk(),1),Wh=U0(Met(),1);async function Tet(i){if(Array.isArray(i)){let o=(0,Wh.concatBuffers)([(0,Wh.stringToBuffer)("list"),(0,Wh.stringToBuffer)(i.length.toString())]);return await xet(i,await Cu().hash(o,"SHA-384"))}let t=i,r=(0,Wh.concatBuffers)([(0,Wh.stringToBuffer)("blob"),(0,Wh.stringToBuffer)(t.byteLength.toString())]),h=(0,Wh.concatBuffers)([await Cu().hash(r,"SHA-384"),await Cu().hash(t,"SHA-384")]);return await Cu().hash(h,"SHA-384")}async function xet(i,t){if(i.length<1)return t;let r=(0,Wh.concatBuffers)([t,await Tet(i[0])]),h=await Cu().hash(r,"SHA-384");return await xet(i.slice(1),h)}var wR=U0(xMt(),1),BMt=wR.default.default?wR.default.default:wR.default,OMt=class extends BMt{getPublicKey(i){throw new Error("Unimplemented")}},CMt;function Cu(){return CMt??=new OMt}var Gs;(function(i){i[i.ARWEAVE=1]="ARWEAVE",i[i.ED25519=2]="ED25519",i[i.ETHEREUM=3]="ETHEREUM",i[i.SOLANA=4]="SOLANA",i[i.INJECTEDAPTOS=5]="INJECTEDAPTOS",i[i.MULTIAPTOS=6]="MULTIAPTOS",i[i.TYPEDETHEREUM=7]="TYPEDETHEREUM"})(Gs||(Gs={}));var op={[Gs.ARWEAVE]:{sigLength:512,pubLength:512,sigName:"arweave"},[Gs.ED25519]:{sigLength:64,pubLength:32,sigName:"ed25519"},[Gs.ETHEREUM]:{sigLength:65,pubLength:65,sigName:"ethereum"},[Gs.SOLANA]:{sigLength:64,pubLength:32,sigName:"solana"},[Gs.INJECTEDAPTOS]:{sigLength:64,pubLength:32,sigName:"injectedAptos"},[Gs.MULTIAPTOS]:{sigLength:64*32+4,pubLength:32*32+1,sigName:"multiAptos"},[Gs.TYPEDETHEREUM]:{sigLength:65,pubLength:42,sigName:"typedEthereum"}},ek=class{signatureType=1;ownerLength=op[1].pubLength;signatureLength=op[1].sigLength;jwk;pk;constructor(i){this.pk=i.n,this.jwk=i}get publicKey(){return IMt.default.toBuffer(this.pk)}sign(i){return Cu().sign(this.jwk,i)}static async verify(i,t,r){return await Cu().verify(i,t,r)}},rk={1:ek},Of=U0(tk(),1);async function LR(i){return Tet([(0,Wh.stringToBuffer)("dataitem"),(0,Wh.stringToBuffer)("1"),(0,Wh.stringToBuffer)(i.signatureType.toString()),i.rawOwner,i.rawTarget,i.rawAnchor,i.rawTags,i.rawData])}async function PMt(i,t){let r=await LR(i),h=await t.sign(r),o=await Cu().hash(h);return{signature:ge.from(h),id:ge.from(o)}}async function NMt(i,t){let{signature:r,id:h}=await PMt(i,t);return i.getRaw().set(r,2),h}var Em=class{buf;pos;constructor(i=ge.alloc(_8),t=0){this.buf=i,this.pos=t}writeTags(i){if(!Array.isArray(i))throw new Error("input must be array");let t=i.length,r;if(t)for(this.writeLong(t),r=0;r<t;r++){let h=i[r];if(h?.name===void 0||h?.value===void 0)throw new Error(`Invalid tag format for ${h}, expected {name:string, value: string}`);this.writeString(h.name),this.writeString(h.value)}this.writeLong(0)}toBuffer(){let i=ge.alloc(this.pos);if(this.pos>this.buf.length)throw new Error(`Too many tag bytes (${this.pos} > ${this.buf.length})`);return this.buf.copy(i,0,0,this.pos),i}tagsExceedLimit(){return this.pos>this.buf.length}writeLong(i){let t=this.buf,r,h;if(i>=-1073741824&&i<1073741824){h=i>=0?i<<1:~i<<1|1;do t[this.pos]=h&127,h>>=7;while(h&&(t[this.pos++]|=128))}else{r=i>=0?i*2:-i*2-1;do t[this.pos]=r&127,r/=128;while(r>=1&&(t[this.pos++]|=128))}this.pos++,this.buf=t}writeString(i){let t=ge.byteLength(i),r=this.buf;this.writeLong(t);let h=this.pos;if(this.pos+=t,!(this.pos>r.length)){if(t>64)this.buf.write(i,this.pos-t,t,"utf8");else{let o,l,c,p;for(o=0,l=t;o<l;o++)c=i.charCodeAt(o),c<128?r[h++]=c:c<2048?(r[h++]=c>>6|192,r[h++]=c&63|128):(c&64512)===55296&&((p=i.charCodeAt(o+1))&64512)===56320?(c=65536+((c&1023)<<10)+(p&1023),o++,r[h++]=c>>18|240,r[h++]=c>>12&63|128,r[h++]=c>>6&63|128,r[h++]=c&63|128):(r[h++]=c>>12|224,r[h++]=c>>6&63|128,r[h++]=c&63|128)}this.buf=r}}readLong(){let i=0,t=0,r=this.buf,h,o,l,c;do h=r[this.pos++],o=h&128,i|=(h&127)<<t,t+=7;while(o&&t<28);if(o){l=i,c=268435456;do h=r[this.pos++],l+=(h&127)*c,c*=128;while(h&128);return(l%2?-(l+1):l)/2}return i>>1^-(i&1)}skipLong(){let i=this.buf;for(;i[this.pos++]&128;);}readTags(){let i=[],t;for(;t=this.readLong();)for(t<0&&(t=-t,this.skipLong());t--;){let r=this.readString(),h=this.readString();i.push({name:r,value:h})}return i}readString(){let i=this.readLong(),t=this.pos,r=this.buf;if(this.pos+=i,!(this.pos>r.length))return this.buf.slice(t,t+i).toString()}};function ik(i){let t=new Em;return t.writeTags(i),t.toBuffer()}function Ret(i){let t=new Em;return t.writeTags(i),t.tagsExceedLimit()}function l8(i){return new Em(i).readTags()}function Jc(i){let t=0;for(let r=i.length-1;r>=0;r--)t=t*256+i[r];return t}function LMt(i){if(i>29)throw new Error("Short too long");let t=[0,0];for(let r=0;r<t.length;r++){let h=i&255;t[r]=h,i=(i-h)/256}return Uint8Array.from(t)}function dtt(i){let t=[0,0,0,0,0,0,0,0];for(let r=0;r<t.length;r++){let h=i&255;t[r]=h,i=(i-h)/256}return Uint8Array.from(t)}var DMt=U0(kMt(),1),H1=U0(NR(),1),_8=4096,nk=80,ym=class{binary;_id;constructor(i){this.binary=i}static isDataItem(i){return i.binary!==void 0}get signatureType(){let i=Jc(this.binary.subarray(0,2));if(Gs?.[i]!==void 0)return i;throw new Error("Unknown signature type: "+i)}async isValid(){return ym.verify(this.binary)}get id(){return(async()=>Of.default.encode(await this.rawId))()}set id(i){this._id=Of.default.toBuffer(i)}get rawId(){return(async()=>H1.Buffer.from(await DMt.Crypto.subtle.digest("SHA-256",this.rawSignature)))()}set rawId(i){this._id=i}get rawSignature(){return this.binary.subarray(2,2+this.signatureLength)}get signature(){return Of.default.encode(this.rawSignature)}set rawOwner(i){if(i.byteLength!=this.ownerLength)throw new Error(`Expected raw owner (pubkey) to be ${this.ownerLength} bytes, got ${i.byteLength} bytes.`);this.binary.set(i,2+this.signatureLength)}get rawOwner(){return this.binary.subarray(2+this.signatureLength,2+this.signatureLength+this.ownerLength)}get signatureLength(){return op[this.signatureType].sigLength}get owner(){return Of.default.encode(this.rawOwner)}get ownerLength(){return op[this.signatureType].pubLength}get rawTarget(){let i=this.getTargetStart();return this.binary[i]==1?this.binary.subarray(i+1,i+33):H1.Buffer.alloc(0)}get target(){return Of.default.encode(this.rawTarget)}get rawAnchor(){let i=this.getAnchorStart();return this.binary[i]==1?this.binary.subarray(i+1,i+33):H1.Buffer.alloc(0)}get anchor(){return this.rawAnchor.toString()}get rawTags(){let i=this.getTagsStart(),t=Jc(this.binary.subarray(i+8,i+16));return this.binary.subarray(i+16,i+16+t)}get tags(){let i=this.getTagsStart();if(Jc(this.binary.subarray(i,i+8))==0)return[];let t=Jc(this.binary.subarray(i+8,i+16));return l8(H1.Buffer.from(this.binary.subarray(i+16,i+16+t)))}get tagsB64Url(){return this.tags.map(i=>({name:Of.default.encode(i.name),value:Of.default.encode(i.value)}))}getStartOfData(){let i=this.getTagsStart(),t=this.binary.subarray(i+8,i+16),r=Jc(t);return i+16+r}get rawData(){let i=this.getTagsStart(),t=this.binary.subarray(i+8,i+16),r=Jc(t),h=i+16+r;return this.binary.subarray(h,this.binary.length)}get data(){return Of.default.encode(this.rawData)}getRaw(){return this.binary}async sign(i){return this._id=await NMt(this,i),this.rawId}async setSignature(i){this.binary.set(i,2),this._id=H1.Buffer.from(await Cu().hash(i))}isSigned(){return(this._id?.length??0)>0}toJSON(){return{signature:this.signature,owner:this.owner,target:this.target,tags:this.tags.map(i=>({name:Of.default.encode(i.name),value:Of.default.encode(i.value)})),data:this.data}}static async verify(i){if(i.byteLength<nk)return!1;let t=new ym(i),r=t.signatureType,h=t.getTagsStart(),o=Jc(i.subarray(h,h+8)),l=i.subarray(h+8,h+16),c=Jc(l);if(c>_8)return!1;if(o>0)try{if(l8(H1.Buffer.from(i.subarray(h+16,h+16+c))).length!==o)return!1}catch{return!1}let p=rk[r],w=await LR(t);return await p.verify(t.rawOwner,w,t.rawSignature)}async getSignatureData(){return LR(this)}getTagsStart(){let i=this.getTargetStart(),t=this.binary[i]==1,r=i+(t?33:1),h=this.binary[r]==1;return r+=h?33:1,r}getTargetStart(){return 2+this.signatureLength+this.ownerLength}getAnchorStart(){let i=this.getTargetStart()+1,t=this.binary[this.getTargetStart()]==1;return i+=t?32:0,i}},$Mt=U0(tk(),1);function ket(i,t,r){let h=t.publicKey,o=r?.target?$Mt.default.toBuffer(r.target):null,l=1+(o?.byteLength??0),c=r?.anchor?ge.from(r.anchor):null,p=1+(c?.byteLength??0),w=(r?.tags?.length??0)>0?ik(r.tags):null,m=16+(w?w.byteLength:0),y=ge.from(i),v=y.byteLength,M=2+t.signatureLength+t.ownerLength+l+p+m+v,T=ge.alloc(M);if(T.set(LMt(t.signatureType),0),T.set(new Uint8Array(t.signatureLength).fill(0),2),h.byteLength!==t.ownerLength)throw new Error(`Owner must be ${t.ownerLength} bytes, but was incorrectly ${h.byteLength}`);T.set(h,2+t.signatureLength);let A=2+t.signatureLength+t.ownerLength;if(T[A]=o?1:0,o){if(o.byteLength!==32)throw new Error(`Target must be 32 bytes but was incorrectly ${o.byteLength}`);T.set(o,A+1)}let R=A+l,B=R+1;if(T[R]=c?1:0,c){if(B+=c.byteLength,c.byteLength!==32)throw new Error("Anchor must be 32 bytes");T.set(c,R+1)}T.set(dtt(r?.tags?.length??0),B);let C=dtt(w?.byteLength??0);T.set(C,B+8),w&&T.set(w,B+16);let P=B+m;return T.set(y,P),new ym(T)}var ok={...Eet};globalThis.arbundles??=ok;var UMt=ok,qMt=ok;globalThis.Buffer||(globalThis.Buffer=bet.Buffer);var{DataItem:FMt}=wet;function jMt(i){return async({data:r,tags:h,target:o,anchor:l,createDataItem:c=p=>new FMt(p)})=>{let p=await i.signDataItem({data:r,tags:h,target:o,anchor:l}),w=c(bet.Buffer.from(p));return{id:await w.id,raw:await w.getRaw()}}}var zMt=globalThis.GATEWAY_URL||void 0,WMt=globalThis.MU_URL||void 0,KMt=globalThis.CU_URL||void 0,HMt=globalThis.GRAPHQL_URL||void 0,{result:LWt,results:DWt,message:$Wt,spawn:UWt,monitor:qWt,unmonitor:FWt,dryrun:jWt,assign:zWt}=Sm({GATEWAY_URL:zMt,MU_URL:WMt,CU_URL:KMt,GRAPHQL_URL:HMt}),WWt=yet.createDataItemSigner;var Iet=sc(z5(),1);Tt();Rt();xt();function ak(i){try{return JSON.parse(i)}catch{return i}}var Ys=class i{logger;processId;ao;constructor({processId:t,ao:r=Sm(),logger:h=new pa({level:"info"})}){this.processId=t,this.logger=h,this.ao=r}static async createAoSigner(t){return t.publicKey===void 0&&"setPublicKey"in t&&await t.setPublicKey(),async({data:h,tags:o,target:l,anchor:c})=>{let p=(0,Iet.createData)(h,t,{tags:o,target:l,anchor:c});return p.sign(t).then(async()=>({id:await p.id,raw:await p.getRaw()}))}}async read({tags:t,retries:r=3}){let h=0,o;for(;h<r;)try{this.logger.debug("Evaluating read interaction on contract",{tags:t});let l=await this.ao.dryrun({process:this.processId,tags:t});if(l.Messages.length===0)throw new Error(`Process ${this.processId} does not support provided action.`);let p=l.Messages[0].Tags.find(m=>m.name==="Error");if(p)throw new Error(`${p.Value}: ${l.Messages[0].Data}`);return this.logger.debug("Read interaction result",{result:l.Messages[0].Data}),l.Messages[0].Data===void 0?{}:ak(l.Messages[0].Data)}catch(l){h++,this.logger.debug(`Read attempt ${h} failed`,{error:l,tags:t}),o=l,await new Promise(c=>setTimeout(c,2**h*1e3))}throw o}async send({tags:t,data:r,signer:h,retries:o=3}){let l=0,c;for(;l<o;)try{this.logger.debug("Evaluating send interaction on contract",{tags:t,data:r,processId:this.processId});let p=await this.ao.message({process:this.processId,tags:[...t,{name:"AR-IO-SDK",value:o1}],data:typeof r!="string"?JSON.stringify(r):r,signer:await i.createAoSigner(h)});this.logger.debug("Sent message to process",{messageId:p,processId:this.processId});let w=await this.ao.result({message:p,process:this.processId});if(this.logger.debug("Message result",{output:w,messageId:p,processId:this.processId}),w.Messages?.length===0||w.Messages===void 0)return{id:p};let y=w.Messages[0].Tags.find(M=>M.name==="Error");if(y){let M=w.Messages[0].Data;throw new a1(`${y.Value}: ${M}`)}if(w.Messages.length===0)throw new Error(`Process ${this.processId} does not support provided action.`);if(w.Messages[0].Data===void 0)return{id:p};let v=ak(w.Messages[0].Data);return this.logger.debug("Message result data",{resultData:v,messageId:p,processId:this.processId}),{id:p,result:v}}catch(p){if(this.logger.error("Error sending message to process",{error:p.message,processId:this.processId,tags:t}),p.message.includes("500"))this.logger.debug("Retrying send interaction",{attempts:l,retries:o,error:p.message,processId:this.processId}),await new Promise(w=>setTimeout(w,2**l*2e3)),l++,c=p;else throw p}throw c}};var Am=class{static init(t){if(t&&t.signer){let{signer:r,...h}=t;return new sk({...h,signer:r})}return new M8(t)}},M8=class{process;arweave;constructor(t,r=Bet.default.init({})){if(!t)this.process=new Ys({processId:Od});else if(Rl(t))this.process=t.process;else if(kl(t))this.process=new Ys({processId:t.processId,logger:new pa({level:"info"})});else throw new No;this.arweave=r}async getEpoch(t){let h=[{name:"Action",value:"Epoch"},{name:"Timestamp",value:t.timestamp?.toString()??""},{name:"Block-Height",value:t?.blockHeight?.toString()},{name:"Epoch-Index",value:t?.epochIndex?.toString()}].filter(o=>o.value!==void 0);return h.length===1&&h.push({name:"Timestamp",value:(await this.arweave.blocks.getCurrent()).timestamp.toString()}),this.process.read({tags:h})}async getArNSRecord({name:t}){return this.process.read({tags:[{name:"Action",value:"Record"},{name:"Name",value:t}]})}async getArNSRecords(){return this.process.read({tags:[{name:"Action",value:"Records"}]})}async getArNSReservedNames(){return this.process.read({tags:[{name:"Action",value:"Reserved-Names"}]})}async getArNSReservedName({name:t}){return this.process.read({tags:[{name:"Action",value:"Reserved-Name"},{name:"Name",value:t}]})}async getBalance({address:t}){return this.process.read({tags:[{name:"Action",value:"Balance"},{name:"Address",value:t}]})}async getBalances(){return this.process.read({tags:[{name:"Action",value:"Balances"}]})}async getGateway({address:t}){return this.process.read({tags:[{name:"Action",value:"Gateway"},{name:"Address",value:t}]})}async getGateways(){return this.process.read({tags:[{name:"Action",value:"Gateways"}]})}async getCurrentEpoch(){return this.process.read({tags:[{name:"Action",value:"Epoch"},{name:"Timestamp",value:`${Date.now()}`}]})}async getPrescribedObservers(t){let h=[{name:"Action",value:"Epoch-Prescribed-Observers"},{name:"Timestamp",value:t.timestamp?.toString()},{name:"Block-Height",value:t?.blockHeight?.toString()},{name:"Epoch-Index",value:t?.epochIndex?.toString()}].filter(o=>o.value!==void 0);return h.length===1&&h.push({name:"Timestamp",value:`${Date.now()}`}),this.process.read({tags:h})}async getPrescribedNames(t){let h=[{name:"Action",value:"Epoch-Prescribed-Names"},{name:"Timestamp",value:t.timestamp?.toString()},{name:"Block-Height",value:t?.blockHeight?.toString()},{name:"Epoch-Index",value:t?.epochIndex?.toString()}].filter(o=>o.value!==void 0);return h.length===1&&h.push({name:"Timestamp",value:`${Date.now()}`}),this.process.read({tags:h})}async getObservations(t){let h=[{name:"Action",value:"Epoch-Observations"},{name:"Timestamp",value:t.timestamp?.toString()},{name:"Block-Height",value:t?.blockHeight?.toString()},{name:"Epoch-Index",value:t?.epochIndex?.toString()}].filter(o=>o.value!==void 0);return h.length===1&&h.push({name:"Timestamp",value:(await this.arweave.blocks.getCurrent()).timestamp.toString()}),this.process.read({tags:h})}async getDistributions(t){let h=[{name:"Action",value:"Epoch-Distributions"},{name:"Timestamp",value:t.timestamp?.toString()??""},{name:"Block-Height",value:t?.blockHeight?.toString()},{name:"Epoch-Index",value:t?.epochIndex?.toString()}].filter(o=>o.value!==void 0);return h.length===1&&h.push({name:"Timestamp",value:(await this.arweave.blocks.getCurrent()).timestamp.toString()}),this.process.read({tags:h})}async getTokenCost({intent:t,purchaseType:r,years:h,name:o,quantity:l}){let p=[{name:"Action",value:"Token-Cost"},{name:"Intent",value:t},{name:"Name",value:o},{name:"Years",value:h?.toString()},{name:"Quantity",value:l?.toString()},{name:"Purchase-Type",value:r},{name:"Timestamp",value:`${Date.now()}`}].filter(w=>w.value!==void 0);return this.process.read({tags:p})}},sk=class extends M8{signer;constructor({signer:t,...r}){if(Object.keys(r).length===0)super({process:new Ys({processId:Od})}),this.signer=t;else if(Rl(r))super({process:r.process}),this.signer=t;else if(kl(r))super({process:new Ys({processId:r.processId})}),this.signer=t;else throw new No}async transfer({target:t,qty:r},h){let{tags:o=[]}=h||{};return this.process.send({tags:[...o,{name:"Action",value:"Transfer"},{name:"Recipient",value:t},{name:"Quantity",value:r.valueOf().toString()}],signer:this.signer})}async joinNetwork({operatorStake:t,allowDelegatedStaking:r,delegateRewardShareRatio:h,fqdn:o,label:l,minDelegatedStake:c,note:p,port:w,properties:m,protocol:y,autoStake:v,observerAddress:M},T){let{tags:A=[]}=T||{},B=[...A,{name:"Action",value:"Join-Network"},{name:"Operator-Stake",value:t.valueOf().toString()},{name:"Allow-Delegated-Staking",value:r.toString()},{name:"Delegate-Reward-Share-Ratio",value:h.toString()},{name:"FQDN",value:o},{name:"Label",value:l},{name:"Min-Delegated-Stake",value:c.valueOf().toString()},{name:"Note",value:p},{name:"Port",value:w.toString()},{name:"Properties",value:m},{name:"Protocol",value:y},{name:"Auto-Stake",value:v.toString()},{name:"Observer-Address",value:M}].filter(C=>C.value!==void 0);return this.process.send({signer:this.signer,tags:B})}async updateGatewaySettings({allowDelegatedStaking:t,delegateRewardShareRatio:r,fqdn:h,label:o,minDelegatedStake:l,note:c,port:p,properties:w,protocol:m,autoStake:y,observerAddress:v},M){let{tags:T=[]}=M||{},R=[...T,{name:"Action",value:"Update-Gateway-Settings"},{name:"Label",value:o},{name:"Note",value:c},{name:"FQDN",value:h},{name:"Port",value:p?.toString()},{name:"Properties",value:w},{name:"Protocol",value:m},{name:"Observer-Address",value:v},{name:"Allow-Delegated-Staking",value:t?.toString()},{name:"Delegate-Reward-Share-Ratio",value:r?.toString()},{name:"Min-Delegated-Stake",value:l?.valueOf().toString()},{name:"Auto-Stake",value:y?.toString()}].filter(B=>B.value!==void 0);return this.process.send({signer:this.signer,tags:R})}async delegateStake(t,r){let{tags:h=[]}=r||{};return this.process.send({signer:this.signer,tags:[...h,{name:"Action",value:"Delegate-Stake"},{name:"Target",value:t.target},{name:"Quantity",value:t.stakeQty.valueOf().toString()}]})}async decreaseDelegateStake(t,r){let{tags:h=[]}=r||{};return this.process.send({signer:this.signer,tags:[...h,{name:"Action",value:"Decrease-Delegate-Stake"},{name:"Target",value:t.target},{name:"Quantity",value:t.decreaseQty.valueOf().toString()}]})}async increaseOperatorStake(t,r){let{tags:h=[]}=r||{};return this.process.send({signer:this.signer,tags:[...h,{name:"Action",value:"Increase-Operator-Stake"},{name:"Quantity",value:t.increaseQty.valueOf().toString()}]})}async decreaseOperatorStake(t,r){let{tags:h=[]}=r||{};return this.process.send({signer:this.signer,tags:[...h,{name:"Action",value:"Decrease-Operator-Stake"},{name:"Quantity",value:t.decreaseQty.valueOf().toString()}]})}async saveObservations(t,r){let{tags:h=[]}=r||{};return this.process.send({signer:this.signer,tags:[...h,{name:"Action",value:"Save-Observations"},{name:"Report-Tx-Id",value:t.reportTxId},{name:"Failed-Gateways",value:t.failedGateways.join(",")}],data:{reportTxId:t.reportTxId,failedGateways:t.failedGateways}})}async buyRecord(t,r){let{tags:h=[]}=r||{},l=[...h,{name:"Action",value:"Buy-Record"},{name:"Name",value:t.name},{name:"Years",value:t.years?.toString()??"1"},{name:"Process-Id",value:t.processId},{name:"Purchase-Type",value:t.type||"lease"}].filter(c=>c.value!==void 0);return this.process.send({signer:this.signer,tags:l})}async extendLease(t,r){let{tags:h=[]}=r||{};return this.process.send({signer:this.signer,tags:[...h,{name:"Action",value:"Extend-Lease"},{name:"Name",value:t.name},{name:"Years",value:t.years.toString()}]})}async increaseUndernameLimit(t,r){let{tags:h=[]}=r||{};return this.process.send({signer:this.signer,tags:[...h,{name:"Action",value:"Increase-Undername-Limit"},{name:"Name",value:t.name},{name:"Quantity",value:t.increaseCount.toString()}]})}};var lHt=async({address:i,contract:t=Am.init({processId:Od})})=>{let r=X9(50),h=await t.getArNSRecords().then(l=>Object.values(l).filter(c=>c.processId!==void 0).map(c=>c.processId)),o=await Promise.all(h.map(async l=>r(async()=>{let c=j2.init({processId:l}),{Owner:p,Controllers:w}=await c.getState();if(p===i||w.includes(i))return l})));return o.length===0?[]:[...new Set(o)]};function Oet(i,t){return new Promise((r,h)=>{let o=setTimeout(()=>{h(new Error("Timeout"))},i);t.then(l=>{clearTimeout(o),r(l)}).catch(l=>{clearTimeout(o),h(l)})})}var Cet=class extends Pet.default{contract;timeoutMs;throttle;constructor({contract:t=Am.init({processId:Od}),timeoutMs:r=6e4,concurrency:h=30}){super(),this.contract=t,this.timeoutMs=r,this.throttle=X9(h)}async fetchProcessesOwnedByWallet({address:t}){let r={};await Oet(this.timeoutMs,this.contract.getArNSRecords().catch(o=>(this.emit("error",`Error getting ArNS records: ${o}`),{}))).then(o=>{o&&Object.entries(o).forEach(([l,c])=>{c.processId!==void 0&&(r[c.processId]===void 0&&(r[c.processId]={state:void 0,names:{}}),r[c.processId].names[l]=c)})});let h=Object.keys(r).length;this.emit("progress",0,h),await Promise.all(Object.keys(r).map(async(o,l)=>this.throttle(async()=>{if(r[o].state!==void 0){this.emit("progress",l+1,h);return}let c=j2.init({processId:o}),p=await Oet(this.timeoutMs,c.getState()).catch(w=>{this.emit("error",`Error getting state for process ${o}: ${w}`)});(p?.Owner===t||p?.Controllers.includes(t))&&(r[o].state=p,this.emit("process",o,r[o])),this.emit("progress",l+1,h)}))),this.emit("end",r)}};Tt();Rt();xt();Tt();Rt();xt();var Net=sc(lR(),1),S8=Net.default.init({host:"arweave.net",port:443,protocol:"https"});async function BHt({signer:i,module:t=xL,luaCodeTxId:r=RL,ao:h=Sm(),scheduler:o=kL,state:l,stateContractTxId:c}){let p=await S8.transactions.getData(r,{decode:!0,string:!0}),w=await h.spawn({module:t,scheduler:o,signer:await Ys.createAoSigner(i)}),m=new Ys({processId:w,ao:h});return await m.send({tags:[{name:"Action",value:"Eval"},{name:"App-Name",value:"ArNS-ANT"},{name:"Source-Code-TX-ID",value:r}],data:p,signer:i}),l&&await m.send({tags:[{name:"Action",value:"Initialize-State"},...c!==void 0?[{name:"State-Contract-TX-ID",value:c}]:[]],data:JSON.stringify(l),signer:i}),w}var E8=class{axios;logger;constructor({url:t,logger:r=new pa}){this.logger=r,this.axios=oF({axiosConfig:{baseURL:t},logger:this.logger})}async get({endpoint:t,signal:r,allowedStatuses:h=[200,202],headers:o,params:l}){this.logger.debug(`Get request to endpoint: ${t} with params ${JSON.stringify(l,void 0,2)}`);let{status:c,statusText:p,data:w}=await this.axios.get(t,{headers:o,signal:r,params:l});if(this.logger.debug(`Response status: ${c} ${p}`),!h.includes(c))switch(c){case 404:throw new O6(p);case 400:throw new Hl(c,p);default:throw new C6(p)}return w}};var Gl=class{logger;http;contractTxId;cacheUrl;constructor({cacheUrl:t="https://api.arns.app",contractTxId:r,logger:h=new pa}){this.cacheUrl=t,this.contractTxId=r,this.logger=h,this.http=new E8({url:`${t}/v1/contract/${r}`})}configuration(){return{contractTxId:this.contractTxId,cacheUrl:this.cacheUrl}}async getState({evaluationOptions:t}={}){this.logger.debug("Fetching contract state",{contractTxId:this.contractTxId,evaluationOptions:t});let{state:r}=await this.http.get({endpoint:"",params:{...t?.evalTo}});return r}async readInteraction({functionName:t,inputs:r,evaluationOptions:h}){this.logger.debug("Evaluating read interaction on contract",{functionName:t,inputs:r,evaluationOptions:h});let{result:o}=await this.http.get({endpoint:`/read/${t}`,params:{...h?.evalTo,...r}});return o}};var Let=class{static createWriteableContract(t){if(!t||Object.keys(t).length===0)return new ga({contractTxId:Sy});if(Yf(t))return t.contract instanceof ga?t.contract:new ga(t.contract.configuration());if(Qf(t))return new ga({contractTxId:t.contractTxId});throw new No}static init(t){if(t&&t.signer!==void 0){let{signer:r,...h}=t,o=this.createWriteableContract(h);return new hk({signer:r,contract:o})}else return new A8(t)}},A8=class{contract;constructor(t){if(!t||t===void 0)this.contract=new Gl({contractTxId:Sy});else if(Yf(t))this.contract=t.contract;else if(Qf(t))this.contract=new Gl({contractTxId:t.contractTxId});else throw new No}async getState(t={}){return await this.contract.getState(t)}async getArNSRecord({domain:t,evaluationOptions:r}){return(await this.getArNSRecords({evaluationOptions:r}))[t]}async getArNSRecords({evaluationOptions:t}={}){return(await this.contract.getState({evaluationOptions:t})).records}async getArNSReservedNames({evaluationOptions:t}={}){return(await this.contract.getState({evaluationOptions:t})).reserved}async getArNSReservedName({domain:t,evaluationOptions:r}){return(await this.getArNSReservedNames({evaluationOptions:r}))[t]}async getBalance({address:t,evaluationOptions:r}){return(await this.getBalances({evaluationOptions:r}))[t]||0}async getBalances({evaluationOptions:t}={}){return(await this.contract.getState({evaluationOptions:t})).balances}async getGateway({address:t,evaluationOptions:r}){return this.contract.readInteraction({functionName:ho.GATEWAY,inputs:{target:t},evaluationOptions:r}).catch(()=>{})}async getGateways({evaluationOptions:t}={}){return this.contract.readInteraction({functionName:ho.GATEWAYS,evaluationOptions:t})}async getCurrentEpoch({evaluationOptions:t}={}){return this.contract.readInteraction({functionName:ho.EPOCH,evaluationOptions:t})}async getEpoch({blockHeight:t,evaluationOptions:r}){return this.contract.readInteraction({functionName:ho.EPOCH,inputs:{height:t},evaluationOptions:r})}async getPrescribedObservers({evaluationOptions:t}={}){return this.contract.readInteraction({functionName:ho.PRESCRIBED_OBSERVERS,evaluationOptions:t})}async getObservations({evaluationOptions:t}={}){let{observations:r}=await this.contract.getState({evaluationOptions:t});return r}async getDistributions({evaluationOptions:t}={}){let{distributions:r}=await this.contract.getState({evaluationOptions:t});return r}async getAuction({domain:t,type:r,evaluationOptions:h}){return this.contract.readInteraction({functionName:ho.AUCTION,inputs:{name:t,type:r},evaluationOptions:h})}async getAuctions({evaluationOptions:t}={}){let{auctions:r}=await this.contract.getState({evaluationOptions:t});return r}async getPriceForInteraction({interactionName:t,payload:r,evaluationOptions:h}){let{price:o}=await this.contract.readInteraction({functionName:ho.PRICE_FOR_INTERACTION,inputs:{interactionName:t,...r},evaluationOptions:h});return o}},hk=class extends A8{signer;constructor({signer:t,...r}){if(Object.keys(r).length===0)super({contract:new ga({contractTxId:Sy})}),this.signer=t;else if(Yf(r))super({contract:r.contract}),this.signer=t;else if(Qf(r))super({contract:new ga({contractTxId:r.contractTxId})}),this.signer=t;else throw new No}async transfer({target:t,qty:r,denomination:h="IO"},o){let l=r;return h==="IO"&&typeof r=="number"&&(l=new r2(r).toMIO()),this.contract.writeInteraction({functionName:ho.TRANSFER,inputs:{target:t,qty:l.valueOf()},signer:this.signer},o)}async joinNetwork({qty:t,allowDelegatedStaking:r,delegateRewardShareRatio:h,fqdn:o,label:l,minDelegatedStake:c,note:p,port:w,properties:m,protocol:y,autoStake:v,observerWallet:M},T){return this.contract.writeInteraction({functionName:ho.JOIN_NETWORK,inputs:{qty:t.valueOf(),allowDelegatedStaking:r,delegateRewardShareRatio:h,fqdn:o,label:l,minDelegatedStake:c.valueOf(),note:p,port:w,properties:m,protocol:y,autoStake:v,observerWallet:M},signer:this.signer},T)}async updateGatewaySettings({allowDelegatedStaking:t,delegateRewardShareRatio:r,fqdn:h,label:o,minDelegatedStake:l,note:c,port:p,properties:w,protocol:m,autoStake:y,observerWallet:v},M){return this.contract.writeInteraction({functionName:ho.UPDATE_GATEWAY_SETTINGS,inputs:{allowDelegatedStaking:t,delegateRewardShareRatio:r,fqdn:h,label:o,minDelegatedStake:l?.valueOf(),note:c,port:p,properties:w,protocol:m,autoStake:y,observerWallet:v},signer:this.signer},M)}async increaseDelegateStake(t,r){return this.contract.writeInteraction({functionName:ho.DELEGATE_STAKE,inputs:{target:t.target,qty:t.qty.valueOf()},signer:this.signer},r)}async decreaseDelegateStake(t,r){return this.contract.writeInteraction({functionName:ho.DECREASE_DELEGATE_STAKE,inputs:{target:t.target,qty:t.qty.valueOf()},signer:this.signer},r)}async increaseOperatorStake(t,r){return this.contract.writeInteraction({functionName:ho.INCREASE_OPERATOR_STAKE,inputs:{qty:t.qty.valueOf()},signer:this.signer},r)}async decreaseOperatorStake(t,r){return this.contract.writeInteraction({functionName:ho.DECREASE_OPERATOR_STAKE,inputs:{qty:t.qty.valueOf()},signer:this.signer},r)}async saveObservations(t,r){return this.contract.writeInteraction({functionName:ho.SAVE_OBSERVATIONS,inputs:{observerReportTxId:t.reportTxId,failedGateways:t.failedGateways},signer:this.signer},r)}async extendLease(t,r){return this.contract.writeInteraction({functionName:ho.EXTEND_RECORD,inputs:{name:t.domain,years:t.years},signer:this.signer},r)}async increaseUndernameLimit(t,r){return this.contract.writeInteraction({functionName:ho.INCREASE_UNDERNAME_COUNT,inputs:{name:t.domain,qty:t.qty},signer:this.signer},r)}};Tt();Rt();xt();Tt();Rt();xt();var or=sc(Zot(),1);var Cie=or.default.AbortError,Pie=or.default.AbstractContractHandler,Nie=or.default.ArweaveContractDefinitionLoader,Lie=or.default.ArweaveGatewayBundledContractDefinitionLoader,Die=or.default.ArweaveGatewayBundledInteractionLoader,$ie=or.default.ArweaveGatewayInteractionsLoader,Uie=or.default.ArweaveWrapper,qie=or.default.Benchmark,Fie=or.default.CacheKey,jie=or.default.CacheableInteractionsLoader,zie=or.default.CacheableStateEvaluator,Wie=or.default.ConsoleLogger,Kie=or.default.ConsoleLoggerFactory,Hie=or.default.ContractCache,Gie=or.default.ContractCallRecord,Vie=or.default.ContractError,Zie=or.default.ContractInteractionState,Jie=or.default.ContractMetadata,Xie=or.default.CustomEvent,Yie=or.default.DEFAULT_LEVEL_DB_LOCATION,Qie=or.default.DefaultEvaluationOptions,tne=or.default.DefaultStateEvaluator,ene=or.default.EvalStateResult,rne=or.default.EvaluationOptionsEvaluator,ine=or.default.HandlerBasedContract,nne=or.default.HandlerExecutorFactory,one=or.default.InnerWritesEvaluator,ane=or.default.InteractionCall,sne=or.default.InteractionCompleteEvent,hne=or.default.InteractionInput,fne=or.default.InteractionOutput,une=or.default.JsHandlerApi,cne=or.default.KV,lne=or.default.KnownErrors,dne=or.default.LevelDbCache,pne=or.default.LexicographicalInteractionsSorter,gne=or.default.LogLevelOrder,Jot=or.default.LoggerFactory,mne=or.default.MemCache,vne=or.default.NetworkCommunicationError,yne=or.default.NonWhitelistedSourceError,bne=or.default.PstContractImpl,wne=or.default.REGISTER_PROVIDER,_ne=or.default.SMART_WEAVE_TAGS,Mne=or.default.SUPPORTED_SRC_CONTENT_TYPES,Sne=or.default.SWBlock,Ene=or.default.SWTransaction,Ane=or.default.SWVrf,Xot=or.default.Signature,Tne=or.default.SmartWeaveError,xne=or.default.SmartWeaveErrorType,Rne=or.default.SmartWeaveGlobal,kne=or.default.SortKeyCacheResult,Ine=or.default.SourceType,Bne=or.default.SrcCache,Yot=or.default.Tag,One=or.default.TagsParser,Cne=or.default.Transaction,Pne=or.default.WARP_GW_URL,Nne=or.default.WARP_TAGS,Lne=or.default.Warp,Dne=or.default.WarpBuilder,Qot=or.default.WarpFactory,$ne=or.default.WarpFetchWrapper,Une=or.default.WarpGatewayContractDefinitionLoader,qne=or.default.WarpGatewayInteractionsLoader,Fne=or.default.WasmHandlerApi,jne=or.default.WasmSrc,zne=or.default.arrayToHex,Wne=or.default.asc,Kne=or.default.ascS,Hne=or.default.bufToBn,Gne=or.default.bundledTxsFilter,Vne=or.default.checkJsSrc,Zne=or.default.createDummyTx,Jne=or.default.createInteractionTagsList,Xne=or.default.createInteractionTx,Yne=or.default.deepCopy,Qne=or.default.defaultArweaveMs,tat=or.default.defaultCacheOptions,toe=or.default.defaultWarpGwOptions,eoe=or.default.desc,roe=or.default.descS,ioe=or.default.emptyTransfer,noe=or.default.genesisSortKey,ooe=or.default.getJsonResponse,aoe=or.default.indent,soe=or.default.isBrowser,hoe=or.default.isTxIdValid,foe=or.default.knownWarpPlugins,uoe=or.default.knownWarpPluginsPartial,coe=or.default.lastPossibleSortKey,loe=or.default.lvlToOrder,doe=or.default.mapReplacer,poe=or.default.mapReviver,goe=or.default.matchMutClosureDtor,moe=or.default.normalizeContractSource,voe=or.default.rustWasmImports,yoe=or.default.safeGet,boe=or.default.safeParseInt,woe=or.default.sleep,_oe=or.default.sortingFirst,Moe=or.default.sortingLast,Soe=or.default.stripTrailingSlash,Eoe=or.default.timeout;Tt();Rt();xt();qx();var hkt="+",fkt="/",ukt="-",ckt="_",lkt="=";function dkt(i){return i.replaceAll(hkt,ukt).replaceAll(fkt,ckt).replaceAll(lkt,"")}function wv(i){let t=i.toString("base64");return dkt(t)}function eat(i){return wv(Ux("sha256").update(i).digest())}Tt();Rt();xt();var rat=Qot.forMainnet({...tat,inMemory:!0},!0,S8);Jot.INST.logLevel("error");var ga=class{contract;contractTxId;cacheUrl;logger;warp;constructor({contractTxId:t,cacheUrl:r="https://api.arns.app",warp:h=rat,logger:o=new pa({level:"info"})}){this.contractTxId=t,this.contract=h.contract(t),this.cacheUrl=r,this.warp=h,this.logger=o}configuration(){return{contractTxId:this.contractTxId,cacheUrl:this.cacheUrl}}async createWarpSigner(t){return t.publicKey===void 0&&"setPublicKey"in t&&await t.setPublicKey(),new Xot(this.warp,{signer:async h=>{h.setOwner(wv(t.publicKey));let o=await h.getSignatureData(),l=await t.sign(o),c=ge.from(l),p=eat(c);h.setSignature({id:p,owner:wv(t.publicKey),signature:wv(c)})},type:"arweave"})}async getState({evaluationOptions:t={}}){await this.ensureContractInit();let r=t?.evalTo,h;r&&"sortKey"in r?h=r.sortKey:r&&"blockHeight"in r&&(h=r.blockHeight);let o=await this.contract.readState(h);if(!o.cachedValue.state)throw new Hl(502,"Failed to evaluate contract state");return o.cachedValue.state}async ensureContractInit({signer:t}={}){this.logger.debug("Checking contract initialized",{contractTxId:this.contractTxId}),this.logger.debug("Fetching contract manifest",{contractTxId:this.contractTxId});let{evaluationOptions:r={}}=await BL({arweave:this.warp.arweave,contractTxId:this.contractTxId});this.contract.setEvaluationOptions(r),t&&this.contract.connect(await this.createWarpSigner(t)),this.cacheUrl!==void 0&&(this.logger.debug("Syncing contract state",{contractTxId:this.contractTxId,remoteCacheUrl:this.cacheUrl}),await this.contract.syncState(`${this.cacheUrl}/v1/contract/${this.contractTxId}`,{validity:!0}))}async readInteraction({functionName:t,inputs:r}){await this.ensureContractInit(),this.logger.debug(`Read interaction: ${t}`,{contractTxId:this.contractTxId,inputs:r});let h=await this.contract.viewState({function:t,...r});if(h.result===void 0)throw new Hl(502,"Failed to evaluate contract read interaction: "+JSON.stringify({error:h.errorMessage,functionName:t,inputs:r},null,2));return this.logger.debug("Successfully evaluated contract read interaction",{contractTxId:this.contractTxId,result:h.result}),h.result}async writeInteraction({functionName:t,inputs:r,signer:h},o){try{this.logger.debug(`Write interaction: ${t}`,{contractTxId:this.contractTxId}),await this.ensureContractInit({signer:h});let l=await this.contract.dryWrite({function:t,...r});if(l.type!=="ok")throw new Error(`Failed to dry write contract interaction ${t}: ${l.errorMessage}`);let c=await this.contract.writeInteraction({function:t,...r},{disableBundling:!0,tags:o?.tags?.map(p=>new Yot(p.name,p.value))});if(!c?.interactionTx)throw new Error(`Failed to write contract interaction: ${t}`);return this.logger.debug("Successfully wrote contract interaction",{contractTxId:this.contractTxId,interactionTxId:c.originalTxId}),c.interactionTx}catch(l){throw this.logger.error(`Failed to write contract interaction: ${l.message}`,{contractTxId:this.contractTxId}),new a1(l)}}};Tt();Rt();xt();var z2=class{process;constructor(t){if(Rl(t))this.process=t.process;else if(kl(t))this.process=new Ys({processId:t.processId});else throw new No}async getState(){let t=[{name:"Action",value:"State"}];return await this.process.read({tags:t})}async getInfo(){let t=[{name:"Action",value:"Info"}];return await this.process.read({tags:t})}async getRecord({undername:t}){let r=[{name:"Sub-Domain",value:t},{name:"Action",value:"Record"}];return await this.process.read({tags:r})}async getRecords(){let t=[{name:"Action",value:"Records"}];return await this.process.read({tags:t})}async getOwner(){return(await this.getInfo()).Owner}async getControllers(){let t=[{name:"Action",value:"Controllers"}];return await this.process.read({tags:t})}async getName(){return(await this.getInfo()).Name}async getTicker(){return(await this.getInfo()).Ticker}async getBalances(){let t=[{name:"Action",value:"Balances"}];return await this.process.read({tags:t})}async getBalance({address:t}){let r=[{name:"Action",value:"Balance"},{name:"Recipient",value:t}];return await this.process.read({tags:r})}},L6=class extends z2{signer;constructor({signer:t,...r}){super(r),this.signer=t}async transfer({target:t}){let r=[{name:"Action",value:"Transfer"},{name:"Recipient",value:t}];return this.process.send({tags:r,data:{},signer:this.signer})}async addController({controller:t}){let r=[{name:"Action",value:"Add-Controller"},{name:"Controller",value:t}];return this.process.send({tags:r,data:{},signer:this.signer})}async removeController({controller:t}){let r=[{name:"Action",value:"Remove-Controller"},{name:"Controller",value:t}];return this.process.send({tags:r,data:{},signer:this.signer})}async setRecord({undername:t,transactionId:r,ttlSeconds:h}){return this.process.send({tags:[{name:"Action",value:"Set-Record"},{name:"Sub-Domain",value:t},{name:"Transaction-Id",value:r},{name:"TTL-Seconds",value:h.toString()}],data:{transactionId:r,ttlSeconds:h},signer:this.signer})}async removeRecord({undername:t}){return this.process.send({tags:[{name:"Action",value:"Remove-Record"},{name:"Sub-Domain",value:t}],data:{undername:t},signer:this.signer})}async setTicker({ticker:t}){return this.process.send({tags:[{name:"Action",value:"Set-Ticker"},{name:"Ticker",value:t}],data:{ticker:t},signer:this.signer})}async setName({name:t}){return this.process.send({tags:[{name:"Action",value:"Set-Name"},{name:"Name",value:t}],data:{name:t},signer:this.signer})}};var export_ArconnectSigner=iat.ArconnectSigner;var export_ArweaveSigner=iat.ArweaveSigner;export{j2 as ANT,N6 as ANTReadable,Y9 as ANTWritable,cc as ANT_CONTRACT_FUNCTIONS,RL as ANT_LUA_ID,Ys as AOProcess,xL as AOS_MODULE_ID,Hkt as ARNS_DEVNET_REGISTRY_TX,Sy as ARNS_TESTNET_REGISTRY_TX,AL as ARWEAVE_TX_REGEX,ho as AR_IO_CONTRACT_FUNCTIONS,s1 as AbortError,z2 as AoANTReadable,L6 as AoANTWriteable,Let as ArIO,A8 as ArIOReadable,hk as ArIOWritable,Cet as ArNSEventEmitter,export_ArconnectSigner as ArconnectSigner,export_ArweaveSigner as ArweaveSigner,aF as BadRequest,wh as BaseError,kL as DEFAULT_SCHEDULER_ID,EL as DENOMINATIONS,pa as DefaultLogger,Kkt as FQDN_REGEX,Hl as FailedRequestError,Am as IO,M8 as IOReadable,r2 as IOToken,sk as IOWriteable,No as InvalidContractConfigurationError,hF as InvalidProcessConfigurationError,sF as InvalidSignerError,h1 as MAX_REQUEST_SIZE,W5 as MIO_PER_IO,O6 as NotFound,Gl as RemoteContract,TL as SORT_KEY_REGEX,G5 as SmartWeaveSortKey,C6 as UnknownError,ga as WarpContract,a1 as WriteInteractionError,oF as createAxiosInstance,lHt as getANTProcessesOwnedByWallet,BL as getContractManifest,Fqt as getContractsTransferredToOrControlledByWallet,Uqt as getSmartweaveContractsFromGQL,qqt as getSmartweaveTransactionsFromGQL,Dkt as ioContractInteractions,Ist as ioContractReadInteractions,Bst as ioContractWriteInteractions,Od as ioDevnetProcessId,iIt as isBlockHeight,Yf as isContractConfiguration,Qf as isContractTxIdConfiguration,uIt as isLeasedArNSRecord,Rl as isProcessConfiguration,kl as isProcessIdConfiguration,TIt as isSortKey,nIt as isTransaction,H5 as mIOToken,ak as safeDecode,BHt as spawnANT,IL as tagsToObject,Ey as validateArweaveId};
379
+ }`,o=Xe.object({data:Xe.object({transactions:Xe.object({edges:Xe.array(Xe.object({node:Xe.record(Xe.any())}))})})});return l=>ci(l).chain(rn(c=>i(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:h,variables:{transactionIds:[c]}})}).then(async p=>{if(p.ok)return p.json();throw r('Error Encountered when querying gateway for transaction "%s"',c),new Error(`${p.status}: ${await p.text()}`)}).then(o.parse).then(b9t(["data","transactions","edges","0","node"])))).toPromise()}var T_t=$R(F4t(),1),pet=(i="@permaweb/aoconnect")=>{let t=(0,T_t.default)(i);return t.child=r=>pet(`${t.namespace}:${r}`),t.tap=(r,...h)=>T9t((...o)=>t(r,...h,...o)),t},get=({url:i,path:t})=>t?t.startsWith("/")?get({url:i,path:t.slice(1)}):(i=new URL(i),i.pathname+=t,i.toString()):i;function x_t(i){return ep(b8([]),tp((t,r)=>ep(M9t([],r.name),ZR(r.value),Js(r.name,Nu,t))(t),{}),v8(t=>t.length>1?t:t[0]))(i)}function Vs(i,t){return r=>qtt(I7t([ftt(i,"name"),XR(VR(t),ftt(t,"value"),KR)]),r)}function ltt(i){return Jtt([[rm(String),V1(i)],[rm(Array),f9t(i)],[KR,U5t]])}function $0(i){let t;return rm(Zs,i)?(t=new Error(R_t(i)),t.stack+=i.stack):rm(Error,i)?t=i:a9t("message",i)?t=new Error(i.message):rm(String,i)?t=new Error(i):t=new Error("An error occurred"),t}function R_t(i){return ep(t=>function r(h,o,l){return tp((c,p)=>ep(Jtt([[V1(vr.invalid_arguments),()=>r(p.argumentsError,422,"Invalid Arguments")],[V1(vr.invalid_return_type),()=>r(p.returnTypeError,500,"Invalid Return")],[V1(vr.invalid_union),()=>H7t(w=>r(w,400,"Invalid Union"),p.unionErrors)],[KR,()=>[{...p,status:o,contextCode:l}]]]),JR(c))(p.code),[],h.issues)}(t,400,""),t=>tp((r,h)=>{let{message:o,path:l,contextCode:c}=h,p=l[1]||l[0],w=c?`${c} `:"";return r.push(`${w}'${p}': ${o}.`),r},[],t),g9t(" | "))(i)}var k_t=Xe.object({id:Xe.string().min(1,{message:"message is required to be a message id"}),processId:Xe.string().min(1,{message:"process is required to be a process id"})});function I_t(){return i=>ci(i).map(k_t.parse).map(()=>i)}var Mm=Xe.object({name:Xe.string(),value:Xe.string()}),B_t=Xe.function().args(Xe.object({Id:Xe.string(),Target:Xe.string(),Owner:Xe.string(),Anchor:Xe.string().optional(),Data:Xe.any().default("1234"),Tags:Xe.array(Xe.object({name:Xe.string(),value:Xe.string()}))})).returns(Xe.promise(Xe.any())),O_t=Xe.function().args(Xe.object({id:Xe.string().min(1,{message:"message id is required"}),processId:Xe.string().min(1,{message:"process id is required"})})).returns(Xe.promise(Xe.any())),C_t=Xe.function().args(Xe.object({process:Xe.string().min(1,{message:"process id is required"}),from:Xe.string().optional(),to:Xe.string().optional(),sort:Xe.enum(["ASC","DESC"]).default("ASC"),limit:Xe.number().optional()})).returns(Xe.promise(Xe.object({edges:Xe.array(Xe.object({cursor:Xe.string(),node:Xe.object({Output:Xe.any().optional(),Messages:Xe.array(Xe.any()).optional(),Spawns:Xe.array(Xe.any()).optional(),Error:Xe.any().optional()})}))}))),met=Xe.function().args(Xe.object({processId:Xe.string(),data:Xe.any(),tags:Xe.array(Mm),anchor:Xe.string().optional(),signer:Xe.any()})).returns(Xe.promise(Xe.object({messageId:Xe.string()}).passthrough())),P_t=Xe.function().args(Xe.object({data:Xe.any(),tags:Xe.array(Mm),signer:Xe.any()})).returns(Xe.promise(Xe.object({processId:Xe.string()}).passthrough())),N_t=Xe.function().args(Xe.object({process:Xe.string(),message:Xe.string(),baseLayer:Xe.boolean().optional(),exclude:Xe.array(Xe.string()).optional()})).returns(Xe.promise(Xe.object({assignmentId:Xe.string()}).passthrough())),vet=met,PWt=Xe.function().args(Xe.object({suUrl:Xe.string().url(),processId:Xe.string()})).returns(Xe.promise(Xe.object({tags:Xe.array(Mm)}).passthrough())),NWt=Xe.function().args(Xe.string()).returns(Xe.promise(Xe.object({url:Xe.string()}))),L_t=Xe.function().args(Xe.string()).returns(Xe.promise(Xe.boolean())),D_t=Xe.function().args(Xe.string()).returns(Xe.promise(Xe.object({tags:Xe.array(Mm)}).passthrough())),w8=Xe.function().args(Xe.object({data:Xe.any(),tags:Xe.array(Mm),target:Xe.string().optional(),anchor:Xe.string().optional()})).returns(Xe.promise(Xe.object({id:Xe.string(),raw:Xe.any()})));function $_t({loadResult:i}){return i=rn(O_t.implement(i)),t=>ci({id:t.id,processId:t.processId}).chain(i)}function U_t(i){let t=I_t(i),r=$_t(i);return({message:h,process:o})=>ci({id:h,processId:o}).chain(t).chain(r).map(i.logger.tap('readResult result for message "%s": %O',h)).map(l=>l).bimap($0,D0).toPromise()}var q_t=Xe.array(Xe.object({name:Xe.string(),value:Xe.string()}));function F_t(){return i=>ci(i.tags).map(b8([])).map(Vs("Data-Protocol","ao")).map(Vs("Variant")).map(Vs("Type")).map(Vs("SDK")).map(JR(Nu,[{name:"Data-Protocol",value:"ao"},{name:"Variant",value:"ao.TN.1"},{name:"Type",value:"Message"},{name:"SDK",value:"aoconnect"}])).map(q_t.parse).map(Js("tags",Nu,i))}function j_t({logger:i}){return t=>ci(t).chain(XR(VR(t.data),()=>O0(t),()=>O0(Math.random().toString().slice(-4)).map(Js("data",Nu,t)).map(r=>ep(L0("tags"),Vs("Content-Type"),ZR({name:"Content-Type",value:"text/plain"}),Js("tags",Nu,r))(r)).map(i.tap('added pseudo-random string as message "data"'))))}function z_t(i){let t=F_t(i),r=j_t(i),h=met.implement(i.deployMessage);return o=>ci(o).chain(t).chain(r).chain(rn(({id:l,data:c,tags:p,anchor:w,signer:m})=>h({processId:l,data:c,tags:p,anchor:w,signer:w8.implement(m)}))).map(l=>Js("messageId",l.messageId,o))}function W_t(i){let t=z_t(i);return({process:r,data:h,tags:o,anchor:l,signer:c})=>ci({id:r,data:h,tags:o,anchor:l,signer:c}).chain(t).map(p=>p.messageId).bimap($0,D0).toPromise()}var Xg=(i,t,r)=>h=>t(h[i])?O0(h):tl(`Tag '${i}': ${r}`);function K_t({loadTransactionMeta:i,logger:t}){return i=rn(D_t.implement(i)),r=>ci(r).chain(i).map(L0("tags")).map(x_t).chain(Xg("Data-Protocol",ltt("ao"),"value 'ao' was not found on module")).chain(Xg("Type",ltt("Module"),"value 'Module' was not found on module")).chain(Xg("Module-Format",yR,"was not found on module")).chain(Xg("Input-Encoding",yR,"was not found on module")).chain(Xg("Output-Encoding",yR,"was not found on module")).bimap(t.tap("Verifying module source failed: %s"),t.tap("Verified module source"))}function H_t({logger:i,validateScheduler:t}){return t=rn(L_t.implement(t)),r=>ci(r).chain(h=>t(h).chain(o=>o?O0(h):tl(`Valid Scheduler-Location owned by ${h} not found`))).bimap(i.tap("Verifying scheduler failed: %s"),i.tap("Verified scheduler"))}function G_t({logger:i}){return t=>ci(t).map(i.tap("Checking for signer")).chain(r=>r?O0(r):tl("signer not found"))}function V_t(i){let t=i.logger.child("verifyInput");i={...i,logger:t};let r=K_t(i),h=H_t(i),o=G_t(i);return l=>ci(l).chain(c=>r(c.module).map(()=>c)).chain(c=>h(c.scheduler)).map(()=>l).chain(c=>o(c.signer).map(()=>c)).bimap(t.tap("Error when verify input: %s"),t.tap("Successfully verified inputs"))}var Z_t=Xe.array(Xe.object({name:Xe.string(),value:Xe.string()}));function J_t(){return i=>ci(i).map(L0("tags")).map(b8([])).map(Vs("Data-Protocol","ao")).map(Vs("Variant")).map(Vs("Type")).map(Vs("Module")).map(Vs("Scheduler")).map(Vs("SDK")).map(JR(Nu,[{name:"Data-Protocol",value:"ao"},{name:"Variant",value:"ao.TN.1"},{name:"Type",value:"Process"},{name:"Module",value:i.module},{name:"Scheduler",value:i.scheduler},{name:"SDK",value:"aoconnect"}])).map(Z_t.parse).map(Js("tags",Nu,i))}function X_t({logger:i}){return t=>ci(t).chain(XR(VR(t.data),()=>O0(t),()=>O0(Math.random().toString().slice(-4)).map(Js("data",Nu,t)).map(r=>ep(L0("tags"),Vs("Content-Type"),ZR({name:"Content-Type",value:"text/plain"}),Js("tags",Nu,r))(r)).map(i.tap('added pseudo-random string as process "data"'))))}function Y_t(i){let t=i.logger.child("uploadProcess");i={...i,logger:t};let r=J_t(i),h=X_t(i),o=P_t.implement(i.deployProcess);return l=>ci(l).chain(r).chain(h).chain(rn(({data:c,tags:p,signer:w})=>o({data:c,tags:p,signer:w8.implement(w)}))).map(c=>Js("processId",c.processId,l))}function Q_t(i){let t=V_t(i),r=Y_t(i);return({module:h,scheduler:o,signer:l,tags:c,data:p})=>ci({module:h,scheduler:o,signer:l,tags:c,data:p}).chain(t).chain(r).map(w=>w.processId).bimap($0,D0).toPromise()}function tMt(i){let t=vet.implement(i.deployMonitor);return r=>ci(r).chain(rn(({id:h,signer:o})=>t({processId:h,signer:w8.implement(o),data:Math.random().toString().slice(-4),tags:[]}))).map(h=>Js("monitorId",h.messageId,r))}function eMt(i){let t=tMt(i);return({process:r,signer:h})=>ci({id:r,signer:h}).chain(t).map(o=>o.monitorId).bimap($0,D0).toPromise()}function rMt(i){let t=vet.implement(i.deployUnmonitor);return r=>ci(r).chain(rn(({id:h,signer:o})=>t({processId:h,signer:w8.implement(o),data:Math.random().toString().slice(-4),tags:[]}))).map(h=>Js("monitorId",h.messageId,r))}function iMt(i){let t=rMt(i);return({process:r,signer:h})=>ci({id:r,signer:h}).chain(t).map(o=>o.monitorId).bimap($0,D0).toPromise()}var nMt=Xe.object({process:Xe.string().min(1,{message:"process identifier is required"}),from:Xe.string().optional(),to:Xe.string().optional(),sort:Xe.enum(["ASC","DESC"]).default("ASC"),limit:Xe.number().optional()});function oMt(){return i=>ci(i).map(nMt.parse).map(()=>i)}function aMt({queryResults:i}){return i=rn(C_t.implement(i)),t=>ci({process:t.process,from:t.from,to:t.to,sort:t.sort,limit:t.limit}).chain(i)}function sMt(i){let t=oMt(i),r=aMt(i);return({process:h,from:o,to:l,sort:c,limit:p})=>ci({process:h,from:o,to:l,sort:c,limit:p}).chain(t).chain(r).map(i.logger.tap('readResults result for message "%s": %O',h)).map(w=>w).bimap($0,D0).toPromise()}var hMt=Xe.object({Id:Xe.string(),Target:Xe.string(),Owner:Xe.string(),Anchor:Xe.string().optional(),Data:Xe.any().default("1234"),Tags:Xe.array(Xe.object({name:Xe.string(),value:Xe.string()}))});function fMt(){return i=>ci(i).map(hMt.parse).map(t=>(t.Tags=t.Tags.concat([{name:"Data-Protocol",value:"ao"},{name:"Type",value:"Message"},{name:"Variant",value:"ao.TN.1"}]),t))}function uMt({dryrunFetch:i}){return rn(B_t.implement(i))}function cMt(i){let t=fMt(i),r=uMt(i);return h=>ci(h).map(lMt).chain(t).chain(r).toPromise()}function lMt({process:i,data:t,tags:r,anchor:h,...o}){return{Id:"1234",Owner:"1234",...o,Target:i,Data:t||"1234",Tags:r||[],Anchor:h||"0"}}function dMt(i){let t=N_t.implement(i.deployAssign);return r=>ci(r).chain(rn(({process:h,message:o,baseLayer:l,exclude:c})=>t({process:h,message:o,baseLayer:l,exclude:c}))).map(h=>Js("assignmentId",h.assignmentId,r))}function pMt(i){let t=dMt(i);return({process:r,message:h,baseLayer:o,exclude:l})=>ci({process:r,message:h,baseLayer:o,exclude:l}).chain(t).map(c=>c.assignmentId).bimap($0,D0).toPromise()}var gMt="https://arweave.net",mMt="https://mu.ao-testnet.xyz",vMt="https://cu.ao-testnet.xyz";function Sm({GRAPHQL_URL:i,GATEWAY_URL:t=gMt,MU_URL:r=mMt,CU_URL:h=vMt}={}){let o=pet();i||(i=get({url:t,path:"/graphql"}));let{validate:l}=Ltt({cacheSize:100,GRAPHQL_URL:i}),c=D5t({MAX_SIZE:25}),p=o.child("result"),w=U_t({loadResult:P5t({fetch,CU_URL:h,logger:p}),logger:p}),m=o.child("message"),y=W_t({loadProcessMeta:gR({fetch,cache:c,logger:m}),deployMessage:R5t({fetch,MU_URL:r,logger:m}),logger:m}),v=o.child("spawn"),M=Q_t({loadTransactionMeta:A_t({fetch,GRAPHQL_URL:i,logger:v}),validateScheduler:l,deployProcess:k5t({fetch,MU_URL:r,logger:v}),logger:v}),T=o.child("monitor"),A=eMt({loadProcessMeta:gR({fetch,cache:c,logger:T}),deployMonitor:I5t({fetch,MU_URL:r,logger:T}),logger:T}),R=o.child("unmonitor"),B=iMt({loadProcessMeta:gR({fetch,cache:c,logger:R}),deployUnmonitor:B5t({fetch,MU_URL:r,logger:R}),logger:T}),C=o.child("results"),P=sMt({queryResults:N5t({fetch,CU_URL:h,logger:C}),logger:C}),N=o.child("dryrun"),q=cMt({dryrunFetch:C5t({fetch,CU_URL:h,logger:N}),logger:N}),W=o.child("assign"),J=pMt({deployAssign:O5t({fetch,MU_URL:r,logger:W}),logger:m});return{result:w,results:P,message:y,spawn:M,monitor:A,unmonitor:B,dryrun:q,assign:J}}var yet={};gtt(yet,{createDataItemSigner:()=>jMt});var bet=$R(W4t(),1),wet={};gtt(wet,{AVSCTap:()=>Em,ArweaveSigner:()=>ek,DataItem:()=>ym,MAX_TAG_BYTES:()=>_8,MIN_BINARY_SIZE:()=>nk,SIG_CONFIG:()=>op,SignatureConfig:()=>Gs,Signer:()=>Aet,createData:()=>ket,default:()=>UMt,deserializeTags:()=>l8,indexToType:()=>rk,serializeTags:()=>ik,tagsExceedLimit:()=>Ret,warparbundles:()=>qMt});var yMt=Object.create,QR=Object.defineProperty,bMt=Object.getOwnPropertyDescriptor,wMt=Object.getOwnPropertyNames,_Mt=Object.getPrototypeOf,MMt=Object.prototype.hasOwnProperty,Du=(i,t)=>()=>(t||i((t={exports:{}}).exports,t),t.exports),SMt=(i,t)=>{for(var r in t)QR(i,r,{get:t[r],enumerable:!0})},EMt=(i,t,r,h)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of wMt(t))!MMt.call(i,o)&&o!==r&&QR(i,o,{get:()=>t[o],enumerable:!(h=bMt(t,o))||h.enumerable});return i},U0=(i,t,r)=>(r=i!=null?yMt(_Mt(i)):{},EMt(t||!i||!i.__esModule?QR(r,"default",{value:i,enumerable:!0}):r,i)),AMt=Du(i=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0});function t(r){var h=4,o=r.length,l=o%h;if(!l)return r;var c=o,p=h-l,w=o+p,m=ge.alloc(w);for(m.write(r);p--;)m.write("=",c++);return m.toString()}i.default=t}),TMt=Du(i=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0});var t=AMt();function r(w,m){return m===void 0&&(m="utf8"),ge.isBuffer(w)?l(w.toString("base64")):l(ge.from(w,m).toString("base64"))}function h(w,m){return m===void 0&&(m="utf8"),ge.from(o(w),"base64").toString(m)}function o(w){return w=w.toString(),t.default(w).replace(/\-/g,"+").replace(/_/g,"/")}function l(w){return w.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function c(w){return ge.from(o(w),"base64")}var p=r;p.encode=r,p.decode=h,p.toBase64=o,p.fromBase64=l,p.toBuffer=c,i.default=p}),tk=Du((i,t)=>{t.exports=TMt().default,t.exports.default=t.exports}),_et=Du(i=>{"use strict";i.byteLength=w,i.toByteArray=y,i.fromByteArray=T;var t=[],r=[],h=typeof Uint8Array<"u"?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(l=0,c=o.length;l<c;++l)t[l]=o[l],r[o.charCodeAt(l)]=l;var l,c;r[45]=62,r[95]=63;function p(A){var R=A.length;if(R%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var B=A.indexOf("=");B===-1&&(B=R);var C=B===R?0:4-B%4;return[B,C]}function w(A){var R=p(A),B=R[0],C=R[1];return(B+C)*3/4-C}function m(A,R,B){return(R+B)*3/4-B}function y(A){var R,B=p(A),C=B[0],P=B[1],N=new h(m(A,C,P)),q=0,W=P>0?C-4:C,J;for(J=0;J<W;J+=4)R=r[A.charCodeAt(J)]<<18|r[A.charCodeAt(J+1)]<<12|r[A.charCodeAt(J+2)]<<6|r[A.charCodeAt(J+3)],N[q++]=R>>16&255,N[q++]=R>>8&255,N[q++]=R&255;return P===2&&(R=r[A.charCodeAt(J)]<<2|r[A.charCodeAt(J+1)]>>4,N[q++]=R&255),P===1&&(R=r[A.charCodeAt(J)]<<10|r[A.charCodeAt(J+1)]<<4|r[A.charCodeAt(J+2)]>>2,N[q++]=R>>8&255,N[q++]=R&255),N}function v(A){return t[A>>18&63]+t[A>>12&63]+t[A>>6&63]+t[A&63]}function M(A,R,B){for(var C,P=[],N=R;N<B;N+=3)C=(A[N]<<16&16711680)+(A[N+1]<<8&65280)+(A[N+2]&255),P.push(v(C));return P.join("")}function T(A){for(var R,B=A.length,C=B%3,P=[],N=16383,q=0,W=B-C;q<W;q+=N)P.push(M(A,q,q+N>W?W:q+N));return C===1?(R=A[B-1],P.push(t[R>>2]+t[R<<4&63]+"==")):C===2&&(R=(A[B-2]<<8)+A[B-1],P.push(t[R>>10]+t[R>>4&63]+t[R<<2&63]+"=")),P.join("")}}),Met=Du(i=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.b64UrlDecode=i.b64UrlEncode=i.bufferTob64Url=i.bufferTob64=i.b64UrlToBuffer=i.stringToB64Url=i.stringToBuffer=i.bufferToString=i.b64UrlToString=i.concatBuffers=void 0;var t=_et();function r(M){let T=0;for(let B=0;B<M.length;B++)T+=M[B].byteLength;let A=new Uint8Array(T),R=0;A.set(new Uint8Array(M[0]),R),R+=M[0].byteLength;for(let B=1;B<M.length;B++)A.set(new Uint8Array(M[B]),R),R+=M[B].byteLength;return A}i.concatBuffers=r;function h(M){let T=p(M);return o(T)}i.b64UrlToString=h;function o(M){return new TextDecoder("utf-8",{fatal:!0}).decode(M)}i.bufferToString=o;function l(M){return new TextEncoder().encode(M)}i.stringToBuffer=l;function c(M){return m(l(M))}i.stringToB64Url=c;function p(M){return new Uint8Array(t.toByteArray(v(M)))}i.b64UrlToBuffer=p;function w(M){return t.fromByteArray(new Uint8Array(M))}i.bufferTob64=w;function m(M){return y(w(M))}i.bufferTob64Url=m;function y(M){return M.replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")}i.b64UrlEncode=y;function v(M){M=M.replace(/\-/g,"+").replace(/\_/g,"/");let T;return M.length%4==0?T=0:T=4-M.length%4,M.concat("=".repeat(T))}i.b64UrlDecode=v}),xMt=Du(i=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0});var t=Met(),r=class{keyLength=4096;publicExponent=65537;hashAlgorithm="sha256";driver;constructor(){if(!this.detectWebCrypto())throw new Error("SubtleCrypto not available!");this.driver=crypto.subtle}async generateJWK(){let h=await this.driver.generateKey({name:"RSA-PSS",modulusLength:4096,publicExponent:new Uint8Array([1,0,1]),hash:{name:"SHA-256"}},!0,["sign"]),o=await this.driver.exportKey("jwk",h.privateKey);return{kty:o.kty,e:o.e,n:o.n,d:o.d,p:o.p,q:o.q,dp:o.dp,dq:o.dq,qi:o.qi}}async sign(h,o,{saltLength:l}={}){let c=await this.driver.sign({name:"RSA-PSS",saltLength:32},await this.jwkToCryptoKey(h),o);return new Uint8Array(c)}async hash(h,o="SHA-256"){let l=await this.driver.digest(o,h);return new Uint8Array(l)}async verify(h,o,l){let c={kty:"RSA",e:"AQAB",n:h},p=await this.jwkToPublicCryptoKey(c),w=await this.driver.digest("SHA-256",o),m=await this.driver.verify({name:"RSA-PSS",saltLength:0},p,l,o),y=await this.driver.verify({name:"RSA-PSS",saltLength:32},p,l,o),v=await this.driver.verify({name:"RSA-PSS",saltLength:Math.ceil((p.algorithm.modulusLength-1)/8)-w.byteLength-2},p,l,o);return m||y||v}async jwkToCryptoKey(h){return this.driver.importKey("jwk",h,{name:"RSA-PSS",hash:{name:"SHA-256"}},!1,["sign"])}async jwkToPublicCryptoKey(h){return this.driver.importKey("jwk",h,{name:"RSA-PSS",hash:{name:"SHA-256"}},!1,["verify"])}detectWebCrypto(){if(typeof crypto>"u")return!1;let h=crypto?.subtle;return h===void 0?!1:["generateKey","importKey","exportKey","digest","sign"].every(o=>typeof h[o]=="function")}async encrypt(h,o,l){let c=await this.driver.importKey("raw",typeof o=="string"?t.stringToBuffer(o):o,{name:"PBKDF2",length:32},!1,["deriveKey"]),p=await this.driver.deriveKey({name:"PBKDF2",salt:l?t.stringToBuffer(l):t.stringToBuffer("salt"),iterations:1e5,hash:"SHA-256"},c,{name:"AES-CBC",length:256},!1,["encrypt","decrypt"]),w=new Uint8Array(16);crypto.getRandomValues(w);let m=await this.driver.encrypt({name:"AES-CBC",iv:w},p,h);return t.concatBuffers([w,m])}async decrypt(h,o,l){let c=await this.driver.importKey("raw",typeof o=="string"?t.stringToBuffer(o):o,{name:"PBKDF2",length:32},!1,["deriveKey"]),p=await this.driver.deriveKey({name:"PBKDF2",salt:l?t.stringToBuffer(l):t.stringToBuffer("salt"),iterations:1e5,hash:"SHA-256"},c,{name:"AES-CBC",length:256},!1,["encrypt","decrypt"]),w=h.slice(0,16),m=await this.driver.decrypt({name:"AES-CBC",iv:w},p,h.slice(16));return t.concatBuffers([m])}};i.default=r}),RMt=Du(i=>{i.read=function(t,r,h,o,l){var c,p,w=l*8-o-1,m=(1<<w)-1,y=m>>1,v=-7,M=h?l-1:0,T=h?-1:1,A=t[r+M];for(M+=T,c=A&(1<<-v)-1,A>>=-v,v+=w;v>0;c=c*256+t[r+M],M+=T,v-=8);for(p=c&(1<<-v)-1,c>>=-v,v+=o;v>0;p=p*256+t[r+M],M+=T,v-=8);if(c===0)c=1-y;else{if(c===m)return p?NaN:(A?-1:1)*(1/0);p=p+Math.pow(2,o),c=c-y}return(A?-1:1)*p*Math.pow(2,c-o)},i.write=function(t,r,h,o,l,c){var p,w,m,y=c*8-l-1,v=(1<<y)-1,M=v>>1,T=l===23?Math.pow(2,-24)-Math.pow(2,-77):0,A=o?0:c-1,R=o?1:-1,B=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(w=isNaN(r)?1:0,p=v):(p=Math.floor(Math.log(r)/Math.LN2),r*(m=Math.pow(2,-p))<1&&(p--,m*=2),p+M>=1?r+=T/m:r+=T*Math.pow(2,1-M),r*m>=2&&(p++,m/=2),p+M>=v?(w=0,p=v):p+M>=1?(w=(r*m-1)*Math.pow(2,l),p=p+M):(w=r*Math.pow(2,M-1)*Math.pow(2,l),p=0));l>=8;t[h+A]=w&255,A+=R,w/=256,l-=8);for(p=p<<l|w,y+=l;y>0;t[h+A]=p&255,A+=R,p/=256,y-=8);t[h+A-R]|=B*128}}),NR=Du(i=>{"use strict";var t=_et(),r=RMt(),h=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;i.Buffer=p,i.SlowBuffer=P,i.INSPECT_MAX_BYTES=50;var o=2147483647;i.kMaxLength=o,p.TYPED_ARRAY_SUPPORT=l(),!p.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function l(){try{let I=new Uint8Array(1),O={foo:function(){return 42}};return Object.setPrototypeOf(O,Uint8Array.prototype),Object.setPrototypeOf(I,O),I.foo()===42}catch{return!1}}Object.defineProperty(p.prototype,"parent",{enumerable:!0,get:function(){if(p.isBuffer(this))return this.buffer}}),Object.defineProperty(p.prototype,"offset",{enumerable:!0,get:function(){if(p.isBuffer(this))return this.byteOffset}});function c(I){if(I>o)throw new RangeError('The value "'+I+'" is invalid for option "size"');let O=new Uint8Array(I);return Object.setPrototypeOf(O,p.prototype),O}function p(I,O,L){if(typeof I=="number"){if(typeof O=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return v(I)}return w(I,O,L)}p.poolSize=8192;function w(I,O,L){if(typeof I=="string")return M(I,O);if(ArrayBuffer.isView(I))return A(I);if(I==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof I);if(mt(I,ArrayBuffer)||I&&mt(I.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(mt(I,SharedArrayBuffer)||I&&mt(I.buffer,SharedArrayBuffer)))return R(I,O,L);if(typeof I=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let V=I.valueOf&&I.valueOf();if(V!=null&&V!==I)return p.from(V,O,L);let st=B(I);if(st)return st;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof I[Symbol.toPrimitive]=="function")return p.from(I[Symbol.toPrimitive]("string"),O,L);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof I)}p.from=function(I,O,L){return w(I,O,L)},Object.setPrototypeOf(p.prototype,Uint8Array.prototype),Object.setPrototypeOf(p,Uint8Array);function m(I){if(typeof I!="number")throw new TypeError('"size" argument must be of type number');if(I<0)throw new RangeError('The value "'+I+'" is invalid for option "size"')}function y(I,O,L){return m(I),I<=0?c(I):O!==void 0?typeof L=="string"?c(I).fill(O,L):c(I).fill(O):c(I)}p.alloc=function(I,O,L){return y(I,O,L)};function v(I){return m(I),c(I<0?0:C(I)|0)}p.allocUnsafe=function(I){return v(I)},p.allocUnsafeSlow=function(I){return v(I)};function M(I,O){if((typeof O!="string"||O==="")&&(O="utf8"),!p.isEncoding(O))throw new TypeError("Unknown encoding: "+O);let L=N(I,O)|0,V=c(L),st=V.write(I,O);return st!==L&&(V=V.slice(0,st)),V}function T(I){let O=I.length<0?0:C(I.length)|0,L=c(O);for(let V=0;V<O;V+=1)L[V]=I[V]&255;return L}function A(I){if(mt(I,Uint8Array)){let O=new Uint8Array(I);return R(O.buffer,O.byteOffset,O.byteLength)}return T(I)}function R(I,O,L){if(O<0||I.byteLength<O)throw new RangeError('"offset" is outside of buffer bounds');if(I.byteLength<O+(L||0))throw new RangeError('"length" is outside of buffer bounds');let V;return O===void 0&&L===void 0?V=new Uint8Array(I):L===void 0?V=new Uint8Array(I,O):V=new Uint8Array(I,O,L),Object.setPrototypeOf(V,p.prototype),V}function B(I){if(p.isBuffer(I)){let O=C(I.length)|0,L=c(O);return L.length===0||I.copy(L,0,0,O),L}if(I.length!==void 0)return typeof I.length!="number"||wt(I.length)?c(0):T(I);if(I.type==="Buffer"&&Array.isArray(I.data))return T(I.data)}function C(I){if(I>=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return I|0}function P(I){return+I!=I&&(I=0),p.alloc(+I)}p.isBuffer=function(I){return I!=null&&I._isBuffer===!0&&I!==p.prototype},p.compare=function(I,O){if(mt(I,Uint8Array)&&(I=p.from(I,I.offset,I.byteLength)),mt(O,Uint8Array)&&(O=p.from(O,O.offset,O.byteLength)),!p.isBuffer(I)||!p.isBuffer(O))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(I===O)return 0;let L=I.length,V=O.length;for(let st=0,ft=Math.min(L,V);st<ft;++st)if(I[st]!==O[st]){L=I[st],V=O[st];break}return L<V?-1:V<L?1:0},p.isEncoding=function(I){switch(String(I).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},p.concat=function(I,O){if(!Array.isArray(I))throw new TypeError('"list" argument must be an Array of Buffers');if(I.length===0)return p.alloc(0);let L;if(O===void 0)for(O=0,L=0;L<I.length;++L)O+=I[L].length;let V=p.allocUnsafe(O),st=0;for(L=0;L<I.length;++L){let ft=I[L];if(mt(ft,Uint8Array))st+ft.length>V.length?(p.isBuffer(ft)||(ft=p.from(ft)),ft.copy(V,st)):Uint8Array.prototype.set.call(V,ft,st);else if(p.isBuffer(ft))ft.copy(V,st);else throw new TypeError('"list" argument must be an Array of Buffers');st+=ft.length}return V};function N(I,O){if(p.isBuffer(I))return I.length;if(ArrayBuffer.isView(I)||mt(I,ArrayBuffer))return I.byteLength;if(typeof I!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof I);let L=I.length,V=arguments.length>2&&arguments[2]===!0;if(!V&&L===0)return 0;let st=!1;for(;;)switch(O){case"ascii":case"latin1":case"binary":return L;case"utf8":case"utf-8":return ut(I).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L*2;case"hex":return L>>>1;case"base64":return bt(I).length;default:if(st)return V?-1:ut(I).length;O=(""+O).toLowerCase(),st=!0}}p.byteLength=N;function q(I,O,L){let V=!1;if((O===void 0||O<0)&&(O=0),O>this.length||((L===void 0||L>this.length)&&(L=this.length),L<=0)||(L>>>=0,O>>>=0,L<=O))return"";for(I||(I="utf8");;)switch(I){case"hex":return e(this,O,L);case"utf8":case"utf-8":return d(this,O,L);case"ascii":return x(this,O,L);case"latin1":case"binary":return a(this,O,L);case"base64":return f(this,O,L);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return u(this,O,L);default:if(V)throw new TypeError("Unknown encoding: "+I);I=(I+"").toLowerCase(),V=!0}}p.prototype._isBuffer=!0;function W(I,O,L){let V=I[O];I[O]=I[L],I[L]=V}p.prototype.swap16=function(){let I=this.length;if(I%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let O=0;O<I;O+=2)W(this,O,O+1);return this},p.prototype.swap32=function(){let I=this.length;if(I%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let O=0;O<I;O+=4)W(this,O,O+3),W(this,O+1,O+2);return this},p.prototype.swap64=function(){let I=this.length;if(I%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let O=0;O<I;O+=8)W(this,O,O+7),W(this,O+1,O+6),W(this,O+2,O+5),W(this,O+3,O+4);return this},p.prototype.toString=function(){let I=this.length;return I===0?"":arguments.length===0?d(this,0,I):q.apply(this,arguments)},p.prototype.toLocaleString=p.prototype.toString,p.prototype.equals=function(I){if(!p.isBuffer(I))throw new TypeError("Argument must be a Buffer");return this===I?!0:p.compare(this,I)===0},p.prototype.inspect=function(){let I="",O=i.INSPECT_MAX_BYTES;return I=this.toString("hex",0,O).replace(/(.{2})/g,"$1 ").trim(),this.length>O&&(I+=" ... "),"<Buffer "+I+">"},h&&(p.prototype[h]=p.prototype.inspect),p.prototype.compare=function(I,O,L,V,st){if(mt(I,Uint8Array)&&(I=p.from(I,I.offset,I.byteLength)),!p.isBuffer(I))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof I);if(O===void 0&&(O=0),L===void 0&&(L=I?I.length:0),V===void 0&&(V=0),st===void 0&&(st=this.length),O<0||L>I.length||V<0||st>this.length)throw new RangeError("out of range index");if(V>=st&&O>=L)return 0;if(V>=st)return-1;if(O>=L)return 1;if(O>>>=0,L>>>=0,V>>>=0,st>>>=0,this===I)return 0;let ft=st-V,ht=L-O,Et=Math.min(ft,ht),_t=this.slice(V,st),vt=I.slice(O,L);for(let Qt=0;Qt<Et;++Qt)if(_t[Qt]!==vt[Qt]){ft=_t[Qt],ht=vt[Qt];break}return ft<ht?-1:ht<ft?1:0};function J(I,O,L,V,st){if(I.length===0)return-1;if(typeof L=="string"?(V=L,L=0):L>2147483647?L=2147483647:L<-2147483648&&(L=-2147483648),L=+L,wt(L)&&(L=st?0:I.length-1),L<0&&(L=I.length+L),L>=I.length){if(st)return-1;L=I.length-1}else if(L<0)if(st)L=0;else return-1;if(typeof O=="string"&&(O=p.from(O,V)),p.isBuffer(O))return O.length===0?-1:F(I,O,L,V,st);if(typeof O=="number")return O=O&255,typeof Uint8Array.prototype.indexOf=="function"?st?Uint8Array.prototype.indexOf.call(I,O,L):Uint8Array.prototype.lastIndexOf.call(I,O,L):F(I,[O],L,V,st);throw new TypeError("val must be string, number or Buffer")}function F(I,O,L,V,st){let ft=1,ht=I.length,Et=O.length;if(V!==void 0&&(V=String(V).toLowerCase(),V==="ucs2"||V==="ucs-2"||V==="utf16le"||V==="utf-16le")){if(I.length<2||O.length<2)return-1;ft=2,ht/=2,Et/=2,L/=2}function _t(Qt,It){return ft===1?Qt[It]:Qt.readUInt16BE(It*ft)}let vt;if(st){let Qt=-1;for(vt=L;vt<ht;vt++)if(_t(I,vt)===_t(O,Qt===-1?0:vt-Qt)){if(Qt===-1&&(Qt=vt),vt-Qt+1===Et)return Qt*ft}else Qt!==-1&&(vt-=vt-Qt),Qt=-1}else for(L+Et>ht&&(L=ht-Et),vt=L;vt>=0;vt--){let Qt=!0;for(let It=0;It<Et;It++)if(_t(I,vt+It)!==_t(O,It)){Qt=!1;break}if(Qt)return vt}return-1}p.prototype.includes=function(I,O,L){return this.indexOf(I,O,L)!==-1},p.prototype.indexOf=function(I,O,L){return J(this,I,O,L,!0)},p.prototype.lastIndexOf=function(I,O,L){return J(this,I,O,L,!1)};function H(I,O,L,V){L=Number(L)||0;let st=I.length-L;V?(V=Number(V),V>st&&(V=st)):V=st;let ft=O.length;V>ft/2&&(V=ft/2);let ht;for(ht=0;ht<V;++ht){let Et=parseInt(O.substr(ht*2,2),16);if(wt(Et))return ht;I[L+ht]=Et}return ht}function Y(I,O,L,V){return lt(ut(O,I.length-L),I,L,V)}function E(I,O,L,V){return lt(pt(O),I,L,V)}function n(I,O,L,V){return lt(bt(O),I,L,V)}function s(I,O,L,V){return lt(St(O,I.length-L),I,L,V)}p.prototype.write=function(I,O,L,V){if(O===void 0)V="utf8",L=this.length,O=0;else if(L===void 0&&typeof O=="string")V=O,L=this.length,O=0;else if(isFinite(O))O=O>>>0,isFinite(L)?(L=L>>>0,V===void 0&&(V="utf8")):(V=L,L=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let st=this.length-O;if((L===void 0||L>st)&&(L=st),I.length>0&&(L<0||O<0)||O>this.length)throw new RangeError("Attempt to write outside buffer bounds");V||(V="utf8");let ft=!1;for(;;)switch(V){case"hex":return H(this,I,O,L);case"utf8":case"utf-8":return Y(this,I,O,L);case"ascii":case"latin1":case"binary":return E(this,I,O,L);case"base64":return n(this,I,O,L);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return s(this,I,O,L);default:if(ft)throw new TypeError("Unknown encoding: "+V);V=(""+V).toLowerCase(),ft=!0}},p.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function f(I,O,L){return O===0&&L===I.length?t.fromByteArray(I):t.fromByteArray(I.slice(O,L))}function d(I,O,L){L=Math.min(I.length,L);let V=[],st=O;for(;st<L;){let ft=I[st],ht=null,Et=ft>239?4:ft>223?3:ft>191?2:1;if(st+Et<=L){let _t,vt,Qt,It;switch(Et){case 1:ft<128&&(ht=ft);break;case 2:_t=I[st+1],(_t&192)===128&&(It=(ft&31)<<6|_t&63,It>127&&(ht=It));break;case 3:_t=I[st+1],vt=I[st+2],(_t&192)===128&&(vt&192)===128&&(It=(ft&15)<<12|(_t&63)<<6|vt&63,It>2047&&(It<55296||It>57343)&&(ht=It));break;case 4:_t=I[st+1],vt=I[st+2],Qt=I[st+3],(_t&192)===128&&(vt&192)===128&&(Qt&192)===128&&(It=(ft&15)<<18|(_t&63)<<12|(vt&63)<<6|Qt&63,It>65535&&It<1114112&&(ht=It))}}ht===null?(ht=65533,Et=1):ht>65535&&(ht-=65536,V.push(ht>>>10&1023|55296),ht=56320|ht&1023),V.push(ht),st+=Et}return S(V)}var g=4096;function S(I){let O=I.length;if(O<=g)return String.fromCharCode.apply(String,I);let L="",V=0;for(;V<O;)L+=String.fromCharCode.apply(String,I.slice(V,V+=g));return L}function x(I,O,L){let V="";L=Math.min(I.length,L);for(let st=O;st<L;++st)V+=String.fromCharCode(I[st]&127);return V}function a(I,O,L){let V="";L=Math.min(I.length,L);for(let st=O;st<L;++st)V+=String.fromCharCode(I[st]);return V}function e(I,O,L){let V=I.length;(!O||O<0)&&(O=0),(!L||L<0||L>V)&&(L=V);let st="";for(let ft=O;ft<L;++ft)st+=Mt[I[ft]];return st}function u(I,O,L){let V=I.slice(O,L),st="";for(let ft=0;ft<V.length-1;ft+=2)st+=String.fromCharCode(V[ft]+V[ft+1]*256);return st}p.prototype.slice=function(I,O){let L=this.length;I=~~I,O=O===void 0?L:~~O,I<0?(I+=L,I<0&&(I=0)):I>L&&(I=L),O<0?(O+=L,O<0&&(O=0)):O>L&&(O=L),O<I&&(O=I);let V=this.subarray(I,O);return Object.setPrototypeOf(V,p.prototype),V};function b(I,O,L){if(I%1!==0||I<0)throw new RangeError("offset is not uint");if(I+O>L)throw new RangeError("Trying to access beyond buffer length")}p.prototype.readUintLE=p.prototype.readUIntLE=function(I,O,L){I=I>>>0,O=O>>>0,L||b(I,O,this.length);let V=this[I],st=1,ft=0;for(;++ft<O&&(st*=256);)V+=this[I+ft]*st;return V},p.prototype.readUintBE=p.prototype.readUIntBE=function(I,O,L){I=I>>>0,O=O>>>0,L||b(I,O,this.length);let V=this[I+--O],st=1;for(;O>0&&(st*=256);)V+=this[I+--O]*st;return V},p.prototype.readUint8=p.prototype.readUInt8=function(I,O){return I=I>>>0,O||b(I,1,this.length),this[I]},p.prototype.readUint16LE=p.prototype.readUInt16LE=function(I,O){return I=I>>>0,O||b(I,2,this.length),this[I]|this[I+1]<<8},p.prototype.readUint16BE=p.prototype.readUInt16BE=function(I,O){return I=I>>>0,O||b(I,2,this.length),this[I]<<8|this[I+1]},p.prototype.readUint32LE=p.prototype.readUInt32LE=function(I,O){return I=I>>>0,O||b(I,4,this.length),(this[I]|this[I+1]<<8|this[I+2]<<16)+this[I+3]*16777216},p.prototype.readUint32BE=p.prototype.readUInt32BE=function(I,O){return I=I>>>0,O||b(I,4,this.length),this[I]*16777216+(this[I+1]<<16|this[I+2]<<8|this[I+3])},p.prototype.readBigUInt64LE=ne(function(I){I=I>>>0,j(I,"offset");let O=this[I],L=this[I+7];(O===void 0||L===void 0)&&rt(I,this.length-8);let V=O+this[++I]*2**8+this[++I]*2**16+this[++I]*2**24,st=this[++I]+this[++I]*2**8+this[++I]*2**16+L*2**24;return BigInt(V)+(BigInt(st)<<BigInt(32))}),p.prototype.readBigUInt64BE=ne(function(I){I=I>>>0,j(I,"offset");let O=this[I],L=this[I+7];(O===void 0||L===void 0)&&rt(I,this.length-8);let V=O*2**24+this[++I]*2**16+this[++I]*2**8+this[++I],st=this[++I]*2**24+this[++I]*2**16+this[++I]*2**8+L;return(BigInt(V)<<BigInt(32))+BigInt(st)}),p.prototype.readIntLE=function(I,O,L){I=I>>>0,O=O>>>0,L||b(I,O,this.length);let V=this[I],st=1,ft=0;for(;++ft<O&&(st*=256);)V+=this[I+ft]*st;return st*=128,V>=st&&(V-=Math.pow(2,8*O)),V},p.prototype.readIntBE=function(I,O,L){I=I>>>0,O=O>>>0,L||b(I,O,this.length);let V=O,st=1,ft=this[I+--V];for(;V>0&&(st*=256);)ft+=this[I+--V]*st;return st*=128,ft>=st&&(ft-=Math.pow(2,8*O)),ft},p.prototype.readInt8=function(I,O){return I=I>>>0,O||b(I,1,this.length),this[I]&128?(255-this[I]+1)*-1:this[I]},p.prototype.readInt16LE=function(I,O){I=I>>>0,O||b(I,2,this.length);let L=this[I]|this[I+1]<<8;return L&32768?L|4294901760:L},p.prototype.readInt16BE=function(I,O){I=I>>>0,O||b(I,2,this.length);let L=this[I+1]|this[I]<<8;return L&32768?L|4294901760:L},p.prototype.readInt32LE=function(I,O){return I=I>>>0,O||b(I,4,this.length),this[I]|this[I+1]<<8|this[I+2]<<16|this[I+3]<<24},p.prototype.readInt32BE=function(I,O){return I=I>>>0,O||b(I,4,this.length),this[I]<<24|this[I+1]<<16|this[I+2]<<8|this[I+3]},p.prototype.readBigInt64LE=ne(function(I){I=I>>>0,j(I,"offset");let O=this[I],L=this[I+7];(O===void 0||L===void 0)&&rt(I,this.length-8);let V=this[I+4]+this[I+5]*2**8+this[I+6]*2**16+(L<<24);return(BigInt(V)<<BigInt(32))+BigInt(O+this[++I]*2**8+this[++I]*2**16+this[++I]*2**24)}),p.prototype.readBigInt64BE=ne(function(I){I=I>>>0,j(I,"offset");let O=this[I],L=this[I+7];(O===void 0||L===void 0)&&rt(I,this.length-8);let V=(O<<24)+this[++I]*2**16+this[++I]*2**8+this[++I];return(BigInt(V)<<BigInt(32))+BigInt(this[++I]*2**24+this[++I]*2**16+this[++I]*2**8+L)}),p.prototype.readFloatLE=function(I,O){return I=I>>>0,O||b(I,4,this.length),r.read(this,I,!0,23,4)},p.prototype.readFloatBE=function(I,O){return I=I>>>0,O||b(I,4,this.length),r.read(this,I,!1,23,4)},p.prototype.readDoubleLE=function(I,O){return I=I>>>0,O||b(I,8,this.length),r.read(this,I,!0,52,8)},p.prototype.readDoubleBE=function(I,O){return I=I>>>0,O||b(I,8,this.length),r.read(this,I,!1,52,8)};function _(I,O,L,V,st,ft){if(!p.isBuffer(I))throw new TypeError('"buffer" argument must be a Buffer instance');if(O>st||O<ft)throw new RangeError('"value" argument is out of bounds');if(L+V>I.length)throw new RangeError("Index out of range")}p.prototype.writeUintLE=p.prototype.writeUIntLE=function(I,O,L,V){if(I=+I,O=O>>>0,L=L>>>0,!V){let ht=Math.pow(2,8*L)-1;_(this,I,O,L,ht,0)}let st=1,ft=0;for(this[O]=I&255;++ft<L&&(st*=256);)this[O+ft]=I/st&255;return O+L},p.prototype.writeUintBE=p.prototype.writeUIntBE=function(I,O,L,V){if(I=+I,O=O>>>0,L=L>>>0,!V){let ht=Math.pow(2,8*L)-1;_(this,I,O,L,ht,0)}let st=L-1,ft=1;for(this[O+st]=I&255;--st>=0&&(ft*=256);)this[O+st]=I/ft&255;return O+L},p.prototype.writeUint8=p.prototype.writeUInt8=function(I,O,L){return I=+I,O=O>>>0,L||_(this,I,O,1,255,0),this[O]=I&255,O+1},p.prototype.writeUint16LE=p.prototype.writeUInt16LE=function(I,O,L){return I=+I,O=O>>>0,L||_(this,I,O,2,65535,0),this[O]=I&255,this[O+1]=I>>>8,O+2},p.prototype.writeUint16BE=p.prototype.writeUInt16BE=function(I,O,L){return I=+I,O=O>>>0,L||_(this,I,O,2,65535,0),this[O]=I>>>8,this[O+1]=I&255,O+2},p.prototype.writeUint32LE=p.prototype.writeUInt32LE=function(I,O,L){return I=+I,O=O>>>0,L||_(this,I,O,4,4294967295,0),this[O+3]=I>>>24,this[O+2]=I>>>16,this[O+1]=I>>>8,this[O]=I&255,O+4},p.prototype.writeUint32BE=p.prototype.writeUInt32BE=function(I,O,L){return I=+I,O=O>>>0,L||_(this,I,O,4,4294967295,0),this[O]=I>>>24,this[O+1]=I>>>16,this[O+2]=I>>>8,this[O+3]=I&255,O+4};function k(I,O,L,V,st){U(O,V,st,I,L,7);let ft=Number(O&BigInt(4294967295));I[L++]=ft,ft=ft>>8,I[L++]=ft,ft=ft>>8,I[L++]=ft,ft=ft>>8,I[L++]=ft;let ht=Number(O>>BigInt(32)&BigInt(4294967295));return I[L++]=ht,ht=ht>>8,I[L++]=ht,ht=ht>>8,I[L++]=ht,ht=ht>>8,I[L++]=ht,L}function $(I,O,L,V,st){U(O,V,st,I,L,7);let ft=Number(O&BigInt(4294967295));I[L+7]=ft,ft=ft>>8,I[L+6]=ft,ft=ft>>8,I[L+5]=ft,ft=ft>>8,I[L+4]=ft;let ht=Number(O>>BigInt(32)&BigInt(4294967295));return I[L+3]=ht,ht=ht>>8,I[L+2]=ht,ht=ht>>8,I[L+1]=ht,ht=ht>>8,I[L]=ht,L+8}p.prototype.writeBigUInt64LE=ne(function(I,O=0){return k(this,I,O,BigInt(0),BigInt("0xffffffffffffffff"))}),p.prototype.writeBigUInt64BE=ne(function(I,O=0){return $(this,I,O,BigInt(0),BigInt("0xffffffffffffffff"))}),p.prototype.writeIntLE=function(I,O,L,V){if(I=+I,O=O>>>0,!V){let Et=Math.pow(2,8*L-1);_(this,I,O,L,Et-1,-Et)}let st=0,ft=1,ht=0;for(this[O]=I&255;++st<L&&(ft*=256);)I<0&&ht===0&&this[O+st-1]!==0&&(ht=1),this[O+st]=(I/ft>>0)-ht&255;return O+L},p.prototype.writeIntBE=function(I,O,L,V){if(I=+I,O=O>>>0,!V){let Et=Math.pow(2,8*L-1);_(this,I,O,L,Et-1,-Et)}let st=L-1,ft=1,ht=0;for(this[O+st]=I&255;--st>=0&&(ft*=256);)I<0&&ht===0&&this[O+st+1]!==0&&(ht=1),this[O+st]=(I/ft>>0)-ht&255;return O+L},p.prototype.writeInt8=function(I,O,L){return I=+I,O=O>>>0,L||_(this,I,O,1,127,-128),I<0&&(I=255+I+1),this[O]=I&255,O+1},p.prototype.writeInt16LE=function(I,O,L){return I=+I,O=O>>>0,L||_(this,I,O,2,32767,-32768),this[O]=I&255,this[O+1]=I>>>8,O+2},p.prototype.writeInt16BE=function(I,O,L){return I=+I,O=O>>>0,L||_(this,I,O,2,32767,-32768),this[O]=I>>>8,this[O+1]=I&255,O+2},p.prototype.writeInt32LE=function(I,O,L){return I=+I,O=O>>>0,L||_(this,I,O,4,2147483647,-2147483648),this[O]=I&255,this[O+1]=I>>>8,this[O+2]=I>>>16,this[O+3]=I>>>24,O+4},p.prototype.writeInt32BE=function(I,O,L){return I=+I,O=O>>>0,L||_(this,I,O,4,2147483647,-2147483648),I<0&&(I=4294967295+I+1),this[O]=I>>>24,this[O+1]=I>>>16,this[O+2]=I>>>8,this[O+3]=I&255,O+4},p.prototype.writeBigInt64LE=ne(function(I,O=0){return k(this,I,O,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),p.prototype.writeBigInt64BE=ne(function(I,O=0){return $(this,I,O,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function it(I,O,L,V,st,ft){if(L+V>I.length)throw new RangeError("Index out of range");if(L<0)throw new RangeError("Index out of range")}function Z(I,O,L,V,st){return O=+O,L=L>>>0,st||it(I,O,L,4,34028234663852886e22,-34028234663852886e22),r.write(I,O,L,V,23,4),L+4}p.prototype.writeFloatLE=function(I,O,L){return Z(this,I,O,!0,L)},p.prototype.writeFloatBE=function(I,O,L){return Z(this,I,O,!1,L)};function et(I,O,L,V,st){return O=+O,L=L>>>0,st||it(I,O,L,8,17976931348623157e292,-17976931348623157e292),r.write(I,O,L,V,52,8),L+8}p.prototype.writeDoubleLE=function(I,O,L){return et(this,I,O,!0,L)},p.prototype.writeDoubleBE=function(I,O,L){return et(this,I,O,!1,L)},p.prototype.copy=function(I,O,L,V){if(!p.isBuffer(I))throw new TypeError("argument should be a Buffer");if(L||(L=0),!V&&V!==0&&(V=this.length),O>=I.length&&(O=I.length),O||(O=0),V>0&&V<L&&(V=L),V===L||I.length===0||this.length===0)return 0;if(O<0)throw new RangeError("targetStart out of bounds");if(L<0||L>=this.length)throw new RangeError("Index out of range");if(V<0)throw new RangeError("sourceEnd out of bounds");V>this.length&&(V=this.length),I.length-O<V-L&&(V=I.length-O+L);let st=V-L;return this===I&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(O,L,V):Uint8Array.prototype.set.call(I,this.subarray(L,V),O),st},p.prototype.fill=function(I,O,L,V){if(typeof I=="string"){if(typeof O=="string"?(V=O,O=0,L=this.length):typeof L=="string"&&(V=L,L=this.length),V!==void 0&&typeof V!="string")throw new TypeError("encoding must be a string");if(typeof V=="string"&&!p.isEncoding(V))throw new TypeError("Unknown encoding: "+V);if(I.length===1){let ft=I.charCodeAt(0);(V==="utf8"&&ft<128||V==="latin1")&&(I=ft)}}else typeof I=="number"?I=I&255:typeof I=="boolean"&&(I=Number(I));if(O<0||this.length<O||this.length<L)throw new RangeError("Out of range index");if(L<=O)return this;O=O>>>0,L=L===void 0?this.length:L>>>0,I||(I=0);let st;if(typeof I=="number")for(st=O;st<L;++st)this[st]=I;else{let ft=p.isBuffer(I)?I:p.from(I,V),ht=ft.length;if(ht===0)throw new TypeError('The value "'+I+'" is invalid for argument "value"');for(st=0;st<L-O;++st)this[st+O]=ft[st%ht]}return this};var Q={};function z(I,O,L){Q[I]=class extends L{constructor(){super(),Object.defineProperty(this,"message",{value:O.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${I}]`,this.stack,delete this.name}get code(){return I}set code(V){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:V,writable:!0})}toString(){return`${this.name} [${I}]: ${this.message}`}}}z("ERR_BUFFER_OUT_OF_BOUNDS",function(I){return I?`${I} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),z("ERR_INVALID_ARG_TYPE",function(I,O){return`The "${I}" argument must be of type number. Received type ${typeof O}`},TypeError),z("ERR_OUT_OF_RANGE",function(I,O,L){let V=`The value of "${I}" is out of range.`,st=L;return Number.isInteger(L)&&Math.abs(L)>2**32?st=tt(String(L)):typeof L=="bigint"&&(st=String(L),(L>BigInt(2)**BigInt(32)||L<-(BigInt(2)**BigInt(32)))&&(st=tt(st)),st+="n"),V+=` It must be ${O}. Received ${st}`,V},RangeError);function tt(I){let O="",L=I.length,V=I[0]==="-"?1:0;for(;L>=V+4;L-=3)O=`_${I.slice(L-3,L)}${O}`;return`${I.slice(0,L)}${O}`}function X(I,O,L){j(O,"offset"),(I[O]===void 0||I[O+L]===void 0)&&rt(O,I.length-(L+1))}function U(I,O,L,V,st,ft){if(I>L||I<O){let ht=typeof O=="bigint"?"n":"",Et;throw ft>3?O===0||O===BigInt(0)?Et=`>= 0${ht} and < 2${ht} ** ${(ft+1)*8}${ht}`:Et=`>= -(2${ht} ** ${(ft+1)*8-1}${ht}) and < 2 ** ${(ft+1)*8-1}${ht}`:Et=`>= ${O}${ht} and <= ${L}${ht}`,new Q.ERR_OUT_OF_RANGE("value",Et,I)}X(V,st,ft)}function j(I,O){if(typeof I!="number")throw new Q.ERR_INVALID_ARG_TYPE(O,"number",I)}function rt(I,O,L){throw Math.floor(I)!==I?(j(I,L),new Q.ERR_OUT_OF_RANGE(L||"offset","an integer",I)):O<0?new Q.ERR_BUFFER_OUT_OF_BOUNDS:new Q.ERR_OUT_OF_RANGE(L||"offset",`>= ${L?1:0} and <= ${O}`,I)}var ot=/[^+/0-9A-Za-z-_]/g;function ct(I){if(I=I.split("=")[0],I=I.trim().replace(ot,""),I.length<2)return"";for(;I.length%4!==0;)I=I+"=";return I}function ut(I,O){O=O||1/0;let L,V=I.length,st=null,ft=[];for(let ht=0;ht<V;++ht){if(L=I.charCodeAt(ht),L>55295&&L<57344){if(!st){if(L>56319){(O-=3)>-1&&ft.push(239,191,189);continue}else if(ht+1===V){(O-=3)>-1&&ft.push(239,191,189);continue}st=L;continue}if(L<56320){(O-=3)>-1&&ft.push(239,191,189),st=L;continue}L=(st-55296<<10|L-56320)+65536}else st&&(O-=3)>-1&&ft.push(239,191,189);if(st=null,L<128){if((O-=1)<0)break;ft.push(L)}else if(L<2048){if((O-=2)<0)break;ft.push(L>>6|192,L&63|128)}else if(L<65536){if((O-=3)<0)break;ft.push(L>>12|224,L>>6&63|128,L&63|128)}else if(L<1114112){if((O-=4)<0)break;ft.push(L>>18|240,L>>12&63|128,L>>6&63|128,L&63|128)}else throw new Error("Invalid code point")}return ft}function pt(I){let O=[];for(let L=0;L<I.length;++L)O.push(I.charCodeAt(L)&255);return O}function St(I,O){let L,V,st,ft=[];for(let ht=0;ht<I.length&&!((O-=2)<0);++ht)L=I.charCodeAt(ht),V=L>>8,st=L%256,ft.push(st),ft.push(V);return ft}function bt(I){return t.toByteArray(ct(I))}function lt(I,O,L,V){let st;for(st=0;st<V&&!(st+L>=O.length||st>=I.length);++st)O[st+L]=I[st];return st}function mt(I,O){return I instanceof O||I!=null&&I.constructor!=null&&I.constructor.name!=null&&I.constructor.name===O.name}function wt(I){return I!==I}var Mt=function(){let I="0123456789abcdef",O=new Array(256);for(let L=0;L<16;++L){let V=L*16;for(let st=0;st<16;++st)O[V+st]=I[L]+I[st]}return O}();function ne(I){return typeof BigInt>"u"?nt:I}function nt(){throw new Error("BigInt not supported")}}),kMt=Du((i,t)=>{typeof window<"u"?(window.global=window,global.fetch=window.fetch,t.exports={Buffer:NR().Buffer,Crypto:window.crypto}):t.exports={Buffer:NR().Buffer,Crypto:crypto}}),Eet={};SMt(Eet,{AVSCTap:()=>Em,ArweaveSigner:()=>ek,DataItem:()=>ym,MAX_TAG_BYTES:()=>_8,MIN_BINARY_SIZE:()=>nk,SIG_CONFIG:()=>op,SignatureConfig:()=>Gs,Signer:()=>Aet,createData:()=>ket,deserializeTags:()=>l8,indexToType:()=>rk,serializeTags:()=>ik,tagsExceedLimit:()=>Ret});var Aet=class{signer;publicKey;signatureType;signatureLength;ownerLength;pem;static verify(i,t,r,h){throw new Error("You must implement verify method on child")}},IMt=U0(tk(),1),Wh=U0(Met(),1);async function Tet(i){if(Array.isArray(i)){let o=(0,Wh.concatBuffers)([(0,Wh.stringToBuffer)("list"),(0,Wh.stringToBuffer)(i.length.toString())]);return await xet(i,await Cu().hash(o,"SHA-384"))}let t=i,r=(0,Wh.concatBuffers)([(0,Wh.stringToBuffer)("blob"),(0,Wh.stringToBuffer)(t.byteLength.toString())]),h=(0,Wh.concatBuffers)([await Cu().hash(r,"SHA-384"),await Cu().hash(t,"SHA-384")]);return await Cu().hash(h,"SHA-384")}async function xet(i,t){if(i.length<1)return t;let r=(0,Wh.concatBuffers)([t,await Tet(i[0])]),h=await Cu().hash(r,"SHA-384");return await xet(i.slice(1),h)}var wR=U0(xMt(),1),BMt=wR.default.default?wR.default.default:wR.default,OMt=class extends BMt{getPublicKey(i){throw new Error("Unimplemented")}},CMt;function Cu(){return CMt??=new OMt}var Gs;(function(i){i[i.ARWEAVE=1]="ARWEAVE",i[i.ED25519=2]="ED25519",i[i.ETHEREUM=3]="ETHEREUM",i[i.SOLANA=4]="SOLANA",i[i.INJECTEDAPTOS=5]="INJECTEDAPTOS",i[i.MULTIAPTOS=6]="MULTIAPTOS",i[i.TYPEDETHEREUM=7]="TYPEDETHEREUM"})(Gs||(Gs={}));var op={[Gs.ARWEAVE]:{sigLength:512,pubLength:512,sigName:"arweave"},[Gs.ED25519]:{sigLength:64,pubLength:32,sigName:"ed25519"},[Gs.ETHEREUM]:{sigLength:65,pubLength:65,sigName:"ethereum"},[Gs.SOLANA]:{sigLength:64,pubLength:32,sigName:"solana"},[Gs.INJECTEDAPTOS]:{sigLength:64,pubLength:32,sigName:"injectedAptos"},[Gs.MULTIAPTOS]:{sigLength:64*32+4,pubLength:32*32+1,sigName:"multiAptos"},[Gs.TYPEDETHEREUM]:{sigLength:65,pubLength:42,sigName:"typedEthereum"}},ek=class{signatureType=1;ownerLength=op[1].pubLength;signatureLength=op[1].sigLength;jwk;pk;constructor(i){this.pk=i.n,this.jwk=i}get publicKey(){return IMt.default.toBuffer(this.pk)}sign(i){return Cu().sign(this.jwk,i)}static async verify(i,t,r){return await Cu().verify(i,t,r)}},rk={1:ek},Of=U0(tk(),1);async function LR(i){return Tet([(0,Wh.stringToBuffer)("dataitem"),(0,Wh.stringToBuffer)("1"),(0,Wh.stringToBuffer)(i.signatureType.toString()),i.rawOwner,i.rawTarget,i.rawAnchor,i.rawTags,i.rawData])}async function PMt(i,t){let r=await LR(i),h=await t.sign(r),o=await Cu().hash(h);return{signature:ge.from(h),id:ge.from(o)}}async function NMt(i,t){let{signature:r,id:h}=await PMt(i,t);return i.getRaw().set(r,2),h}var Em=class{buf;pos;constructor(i=ge.alloc(_8),t=0){this.buf=i,this.pos=t}writeTags(i){if(!Array.isArray(i))throw new Error("input must be array");let t=i.length,r;if(t)for(this.writeLong(t),r=0;r<t;r++){let h=i[r];if(h?.name===void 0||h?.value===void 0)throw new Error(`Invalid tag format for ${h}, expected {name:string, value: string}`);this.writeString(h.name),this.writeString(h.value)}this.writeLong(0)}toBuffer(){let i=ge.alloc(this.pos);if(this.pos>this.buf.length)throw new Error(`Too many tag bytes (${this.pos} > ${this.buf.length})`);return this.buf.copy(i,0,0,this.pos),i}tagsExceedLimit(){return this.pos>this.buf.length}writeLong(i){let t=this.buf,r,h;if(i>=-1073741824&&i<1073741824){h=i>=0?i<<1:~i<<1|1;do t[this.pos]=h&127,h>>=7;while(h&&(t[this.pos++]|=128))}else{r=i>=0?i*2:-i*2-1;do t[this.pos]=r&127,r/=128;while(r>=1&&(t[this.pos++]|=128))}this.pos++,this.buf=t}writeString(i){let t=ge.byteLength(i),r=this.buf;this.writeLong(t);let h=this.pos;if(this.pos+=t,!(this.pos>r.length)){if(t>64)this.buf.write(i,this.pos-t,t,"utf8");else{let o,l,c,p;for(o=0,l=t;o<l;o++)c=i.charCodeAt(o),c<128?r[h++]=c:c<2048?(r[h++]=c>>6|192,r[h++]=c&63|128):(c&64512)===55296&&((p=i.charCodeAt(o+1))&64512)===56320?(c=65536+((c&1023)<<10)+(p&1023),o++,r[h++]=c>>18|240,r[h++]=c>>12&63|128,r[h++]=c>>6&63|128,r[h++]=c&63|128):(r[h++]=c>>12|224,r[h++]=c>>6&63|128,r[h++]=c&63|128)}this.buf=r}}readLong(){let i=0,t=0,r=this.buf,h,o,l,c;do h=r[this.pos++],o=h&128,i|=(h&127)<<t,t+=7;while(o&&t<28);if(o){l=i,c=268435456;do h=r[this.pos++],l+=(h&127)*c,c*=128;while(h&128);return(l%2?-(l+1):l)/2}return i>>1^-(i&1)}skipLong(){let i=this.buf;for(;i[this.pos++]&128;);}readTags(){let i=[],t;for(;t=this.readLong();)for(t<0&&(t=-t,this.skipLong());t--;){let r=this.readString(),h=this.readString();i.push({name:r,value:h})}return i}readString(){let i=this.readLong(),t=this.pos,r=this.buf;if(this.pos+=i,!(this.pos>r.length))return this.buf.slice(t,t+i).toString()}};function ik(i){let t=new Em;return t.writeTags(i),t.toBuffer()}function Ret(i){let t=new Em;return t.writeTags(i),t.tagsExceedLimit()}function l8(i){return new Em(i).readTags()}function Jc(i){let t=0;for(let r=i.length-1;r>=0;r--)t=t*256+i[r];return t}function LMt(i){if(i>29)throw new Error("Short too long");let t=[0,0];for(let r=0;r<t.length;r++){let h=i&255;t[r]=h,i=(i-h)/256}return Uint8Array.from(t)}function dtt(i){let t=[0,0,0,0,0,0,0,0];for(let r=0;r<t.length;r++){let h=i&255;t[r]=h,i=(i-h)/256}return Uint8Array.from(t)}var DMt=U0(kMt(),1),H1=U0(NR(),1),_8=4096,nk=80,ym=class{binary;_id;constructor(i){this.binary=i}static isDataItem(i){return i.binary!==void 0}get signatureType(){let i=Jc(this.binary.subarray(0,2));if(Gs?.[i]!==void 0)return i;throw new Error("Unknown signature type: "+i)}async isValid(){return ym.verify(this.binary)}get id(){return(async()=>Of.default.encode(await this.rawId))()}set id(i){this._id=Of.default.toBuffer(i)}get rawId(){return(async()=>H1.Buffer.from(await DMt.Crypto.subtle.digest("SHA-256",this.rawSignature)))()}set rawId(i){this._id=i}get rawSignature(){return this.binary.subarray(2,2+this.signatureLength)}get signature(){return Of.default.encode(this.rawSignature)}set rawOwner(i){if(i.byteLength!=this.ownerLength)throw new Error(`Expected raw owner (pubkey) to be ${this.ownerLength} bytes, got ${i.byteLength} bytes.`);this.binary.set(i,2+this.signatureLength)}get rawOwner(){return this.binary.subarray(2+this.signatureLength,2+this.signatureLength+this.ownerLength)}get signatureLength(){return op[this.signatureType].sigLength}get owner(){return Of.default.encode(this.rawOwner)}get ownerLength(){return op[this.signatureType].pubLength}get rawTarget(){let i=this.getTargetStart();return this.binary[i]==1?this.binary.subarray(i+1,i+33):H1.Buffer.alloc(0)}get target(){return Of.default.encode(this.rawTarget)}get rawAnchor(){let i=this.getAnchorStart();return this.binary[i]==1?this.binary.subarray(i+1,i+33):H1.Buffer.alloc(0)}get anchor(){return this.rawAnchor.toString()}get rawTags(){let i=this.getTagsStart(),t=Jc(this.binary.subarray(i+8,i+16));return this.binary.subarray(i+16,i+16+t)}get tags(){let i=this.getTagsStart();if(Jc(this.binary.subarray(i,i+8))==0)return[];let t=Jc(this.binary.subarray(i+8,i+16));return l8(H1.Buffer.from(this.binary.subarray(i+16,i+16+t)))}get tagsB64Url(){return this.tags.map(i=>({name:Of.default.encode(i.name),value:Of.default.encode(i.value)}))}getStartOfData(){let i=this.getTagsStart(),t=this.binary.subarray(i+8,i+16),r=Jc(t);return i+16+r}get rawData(){let i=this.getTagsStart(),t=this.binary.subarray(i+8,i+16),r=Jc(t),h=i+16+r;return this.binary.subarray(h,this.binary.length)}get data(){return Of.default.encode(this.rawData)}getRaw(){return this.binary}async sign(i){return this._id=await NMt(this,i),this.rawId}async setSignature(i){this.binary.set(i,2),this._id=H1.Buffer.from(await Cu().hash(i))}isSigned(){return(this._id?.length??0)>0}toJSON(){return{signature:this.signature,owner:this.owner,target:this.target,tags:this.tags.map(i=>({name:Of.default.encode(i.name),value:Of.default.encode(i.value)})),data:this.data}}static async verify(i){if(i.byteLength<nk)return!1;let t=new ym(i),r=t.signatureType,h=t.getTagsStart(),o=Jc(i.subarray(h,h+8)),l=i.subarray(h+8,h+16),c=Jc(l);if(c>_8)return!1;if(o>0)try{if(l8(H1.Buffer.from(i.subarray(h+16,h+16+c))).length!==o)return!1}catch{return!1}let p=rk[r],w=await LR(t);return await p.verify(t.rawOwner,w,t.rawSignature)}async getSignatureData(){return LR(this)}getTagsStart(){let i=this.getTargetStart(),t=this.binary[i]==1,r=i+(t?33:1),h=this.binary[r]==1;return r+=h?33:1,r}getTargetStart(){return 2+this.signatureLength+this.ownerLength}getAnchorStart(){let i=this.getTargetStart()+1,t=this.binary[this.getTargetStart()]==1;return i+=t?32:0,i}},$Mt=U0(tk(),1);function ket(i,t,r){let h=t.publicKey,o=r?.target?$Mt.default.toBuffer(r.target):null,l=1+(o?.byteLength??0),c=r?.anchor?ge.from(r.anchor):null,p=1+(c?.byteLength??0),w=(r?.tags?.length??0)>0?ik(r.tags):null,m=16+(w?w.byteLength:0),y=ge.from(i),v=y.byteLength,M=2+t.signatureLength+t.ownerLength+l+p+m+v,T=ge.alloc(M);if(T.set(LMt(t.signatureType),0),T.set(new Uint8Array(t.signatureLength).fill(0),2),h.byteLength!==t.ownerLength)throw new Error(`Owner must be ${t.ownerLength} bytes, but was incorrectly ${h.byteLength}`);T.set(h,2+t.signatureLength);let A=2+t.signatureLength+t.ownerLength;if(T[A]=o?1:0,o){if(o.byteLength!==32)throw new Error(`Target must be 32 bytes but was incorrectly ${o.byteLength}`);T.set(o,A+1)}let R=A+l,B=R+1;if(T[R]=c?1:0,c){if(B+=c.byteLength,c.byteLength!==32)throw new Error("Anchor must be 32 bytes");T.set(c,R+1)}T.set(dtt(r?.tags?.length??0),B);let C=dtt(w?.byteLength??0);T.set(C,B+8),w&&T.set(w,B+16);let P=B+m;return T.set(y,P),new ym(T)}var ok={...Eet};globalThis.arbundles??=ok;var UMt=ok,qMt=ok;globalThis.Buffer||(globalThis.Buffer=bet.Buffer);var{DataItem:FMt}=wet;function jMt(i){return async({data:r,tags:h,target:o,anchor:l,createDataItem:c=p=>new FMt(p)})=>{let p=await i.signDataItem({data:r,tags:h,target:o,anchor:l}),w=c(bet.Buffer.from(p));return{id:await w.id,raw:await w.getRaw()}}}var zMt=globalThis.GATEWAY_URL||void 0,WMt=globalThis.MU_URL||void 0,KMt=globalThis.CU_URL||void 0,HMt=globalThis.GRAPHQL_URL||void 0,{result:LWt,results:DWt,message:$Wt,spawn:UWt,monitor:qWt,unmonitor:FWt,dryrun:jWt,assign:zWt}=Sm({GATEWAY_URL:zMt,MU_URL:WMt,CU_URL:KMt,GRAPHQL_URL:HMt}),WWt=yet.createDataItemSigner;var Iet=sc(z5(),1);Tt();Rt();xt();function ak(i){try{return JSON.parse(i)}catch{return i}}var Ys=class i{logger;processId;ao;constructor({processId:t,ao:r=Sm(),logger:h=new pa({level:"info"})}){this.processId=t,this.logger=h,this.ao=r}static async createAoSigner(t){return t.publicKey===void 0&&"setPublicKey"in t&&await t.setPublicKey(),async({data:h,tags:o,target:l,anchor:c})=>{let p=(0,Iet.createData)(h,t,{tags:o,target:l,anchor:c});return p.sign(t).then(async()=>({id:await p.id,raw:await p.getRaw()}))}}async read({tags:t,retries:r=3}){let h=0,o;for(;h<r;)try{this.logger.debug("Evaluating read interaction on contract",{tags:t});let l=await this.ao.dryrun({process:this.processId,tags:t});if(l.Messages.length===0)throw new Error(`Process ${this.processId} does not support provided action.`);let p=l.Messages[0].Tags.find(m=>m.name==="Error");if(p)throw new Error(`${p.Value}: ${l.Messages[0].Data}`);return this.logger.debug("Read interaction result",{result:l.Messages[0].Data}),l.Messages[0].Data===void 0?{}:ak(l.Messages[0].Data)}catch(l){h++,this.logger.debug(`Read attempt ${h} failed`,{error:l,tags:t}),o=l,await new Promise(c=>setTimeout(c,2**h*1e3))}throw o}async send({tags:t,data:r,signer:h,retries:o=3}){let l=0,c;for(;l<o;)try{this.logger.debug("Evaluating send interaction on contract",{tags:t,data:r,processId:this.processId});let p=await this.ao.message({process:this.processId,tags:[...t,{name:"AR-IO-SDK",value:o1}],data:typeof r!="string"?JSON.stringify(r):r,signer:await i.createAoSigner(h)});this.logger.debug("Sent message to process",{messageId:p,processId:this.processId});let w=await this.ao.result({message:p,process:this.processId});if(this.logger.debug("Message result",{output:w,messageId:p,processId:this.processId}),w.Messages?.length===0||w.Messages===void 0)return{id:p};let y=w.Messages[0].Tags.find(M=>M.name==="Error");if(y){let M=w.Messages[0].Data;throw new a1(`${y.Value}: ${M}`)}if(w.Messages.length===0)throw new Error(`Process ${this.processId} does not support provided action.`);if(w.Messages[0].Data===void 0)return{id:p};let v=ak(w.Messages[0].Data);return this.logger.debug("Message result data",{resultData:v,messageId:p,processId:this.processId}),{id:p,result:v}}catch(p){if(this.logger.error("Error sending message to process",{error:p.message,processId:this.processId,tags:t}),p.message.includes("500"))this.logger.debug("Retrying send interaction",{attempts:l,retries:o,error:p.message,processId:this.processId}),await new Promise(w=>setTimeout(w,2**l*2e3)),l++,c=p;else throw p}throw c}};var Am=class{static init(t){if(t&&t.signer){let{signer:r,...h}=t;return new sk({...h,signer:r})}return new M8(t)}},M8=class{process;arweave;constructor(t,r=Bet.default.init({})){if(!t)this.process=new Ys({processId:Od});else if(Rl(t))this.process=t.process;else if(kl(t))this.process=new Ys({processId:t.processId,logger:new pa({level:"info"})});else throw new No;this.arweave=r}async getInfo(){return this.process.read({tags:[{name:"Action",value:"Info"}]})}async getEpoch(t){let h=[{name:"Action",value:"Epoch"},{name:"Timestamp",value:t.timestamp?.toString()??""},{name:"Block-Height",value:t?.blockHeight?.toString()},{name:"Epoch-Index",value:t?.epochIndex?.toString()}].filter(o=>o.value!==void 0);return h.length===1&&h.push({name:"Timestamp",value:(await this.arweave.blocks.getCurrent()).timestamp.toString()}),this.process.read({tags:h})}async getArNSRecord({name:t}){return this.process.read({tags:[{name:"Action",value:"Record"},{name:"Name",value:t}]})}async getArNSRecords(){return this.process.read({tags:[{name:"Action",value:"Records"}]})}async getArNSReservedNames(){return this.process.read({tags:[{name:"Action",value:"Reserved-Names"}]})}async getArNSReservedName({name:t}){return this.process.read({tags:[{name:"Action",value:"Reserved-Name"},{name:"Name",value:t}]})}async getBalance({address:t}){return this.process.read({tags:[{name:"Action",value:"Balance"},{name:"Address",value:t}]})}async getBalances(){return this.process.read({tags:[{name:"Action",value:"Balances"}]})}async getGateway({address:t}){return this.process.read({tags:[{name:"Action",value:"Gateway"},{name:"Address",value:t}]})}async getGateways(){return this.process.read({tags:[{name:"Action",value:"Gateways"}]})}async getCurrentEpoch(){return this.process.read({tags:[{name:"Action",value:"Epoch"},{name:"Timestamp",value:`${Date.now()}`}]})}async getPrescribedObservers(t){let h=[{name:"Action",value:"Epoch-Prescribed-Observers"},{name:"Timestamp",value:t.timestamp?.toString()},{name:"Block-Height",value:t?.blockHeight?.toString()},{name:"Epoch-Index",value:t?.epochIndex?.toString()}].filter(o=>o.value!==void 0);return h.length===1&&h.push({name:"Timestamp",value:`${Date.now()}`}),this.process.read({tags:h})}async getPrescribedNames(t){let h=[{name:"Action",value:"Epoch-Prescribed-Names"},{name:"Timestamp",value:t.timestamp?.toString()},{name:"Block-Height",value:t?.blockHeight?.toString()},{name:"Epoch-Index",value:t?.epochIndex?.toString()}].filter(o=>o.value!==void 0);return h.length===1&&h.push({name:"Timestamp",value:`${Date.now()}`}),this.process.read({tags:h})}async getObservations(t){let h=[{name:"Action",value:"Epoch-Observations"},{name:"Timestamp",value:t.timestamp?.toString()},{name:"Block-Height",value:t?.blockHeight?.toString()},{name:"Epoch-Index",value:t?.epochIndex?.toString()}].filter(o=>o.value!==void 0);return h.length===1&&h.push({name:"Timestamp",value:(await this.arweave.blocks.getCurrent()).timestamp.toString()}),this.process.read({tags:h})}async getDistributions(t){let h=[{name:"Action",value:"Epoch-Distributions"},{name:"Timestamp",value:t.timestamp?.toString()??""},{name:"Block-Height",value:t?.blockHeight?.toString()},{name:"Epoch-Index",value:t?.epochIndex?.toString()}].filter(o=>o.value!==void 0);return h.length===1&&h.push({name:"Timestamp",value:(await this.arweave.blocks.getCurrent()).timestamp.toString()}),this.process.read({tags:h})}async getTokenCost({intent:t,purchaseType:r,years:h,name:o,quantity:l}){let p=[{name:"Action",value:"Token-Cost"},{name:"Intent",value:t},{name:"Name",value:o},{name:"Years",value:h?.toString()},{name:"Quantity",value:l?.toString()},{name:"Purchase-Type",value:r},{name:"Timestamp",value:`${Date.now()}`}].filter(w=>w.value!==void 0);return this.process.read({tags:p})}},sk=class extends M8{signer;constructor({signer:t,...r}){if(Object.keys(r).length===0)super({process:new Ys({processId:Od})}),this.signer=t;else if(Rl(r))super({process:r.process}),this.signer=t;else if(kl(r))super({process:new Ys({processId:r.processId})}),this.signer=t;else throw new No}async transfer({target:t,qty:r},h){let{tags:o=[]}=h||{};return this.process.send({tags:[...o,{name:"Action",value:"Transfer"},{name:"Recipient",value:t},{name:"Quantity",value:r.valueOf().toString()}],signer:this.signer})}async joinNetwork({operatorStake:t,allowDelegatedStaking:r,delegateRewardShareRatio:h,fqdn:o,label:l,minDelegatedStake:c,note:p,port:w,properties:m,protocol:y,autoStake:v,observerAddress:M},T){let{tags:A=[]}=T||{},B=[...A,{name:"Action",value:"Join-Network"},{name:"Operator-Stake",value:t.valueOf().toString()},{name:"Allow-Delegated-Staking",value:r.toString()},{name:"Delegate-Reward-Share-Ratio",value:h.toString()},{name:"FQDN",value:o},{name:"Label",value:l},{name:"Min-Delegated-Stake",value:c.valueOf().toString()},{name:"Note",value:p},{name:"Port",value:w.toString()},{name:"Properties",value:m},{name:"Protocol",value:y},{name:"Auto-Stake",value:v.toString()},{name:"Observer-Address",value:M}].filter(C=>C.value!==void 0);return this.process.send({signer:this.signer,tags:B})}async updateGatewaySettings({allowDelegatedStaking:t,delegateRewardShareRatio:r,fqdn:h,label:o,minDelegatedStake:l,note:c,port:p,properties:w,protocol:m,autoStake:y,observerAddress:v},M){let{tags:T=[]}=M||{},R=[...T,{name:"Action",value:"Update-Gateway-Settings"},{name:"Label",value:o},{name:"Note",value:c},{name:"FQDN",value:h},{name:"Port",value:p?.toString()},{name:"Properties",value:w},{name:"Protocol",value:m},{name:"Observer-Address",value:v},{name:"Allow-Delegated-Staking",value:t?.toString()},{name:"Delegate-Reward-Share-Ratio",value:r?.toString()},{name:"Min-Delegated-Stake",value:l?.valueOf().toString()},{name:"Auto-Stake",value:y?.toString()}].filter(B=>B.value!==void 0);return this.process.send({signer:this.signer,tags:R})}async delegateStake(t,r){let{tags:h=[]}=r||{};return this.process.send({signer:this.signer,tags:[...h,{name:"Action",value:"Delegate-Stake"},{name:"Target",value:t.target},{name:"Quantity",value:t.stakeQty.valueOf().toString()}]})}async decreaseDelegateStake(t,r){let{tags:h=[]}=r||{};return this.process.send({signer:this.signer,tags:[...h,{name:"Action",value:"Decrease-Delegate-Stake"},{name:"Target",value:t.target},{name:"Quantity",value:t.decreaseQty.valueOf().toString()}]})}async increaseOperatorStake(t,r){let{tags:h=[]}=r||{};return this.process.send({signer:this.signer,tags:[...h,{name:"Action",value:"Increase-Operator-Stake"},{name:"Quantity",value:t.increaseQty.valueOf().toString()}]})}async decreaseOperatorStake(t,r){let{tags:h=[]}=r||{};return this.process.send({signer:this.signer,tags:[...h,{name:"Action",value:"Decrease-Operator-Stake"},{name:"Quantity",value:t.decreaseQty.valueOf().toString()}]})}async saveObservations(t,r){let{tags:h=[]}=r||{};return this.process.send({signer:this.signer,tags:[...h,{name:"Action",value:"Save-Observations"},{name:"Report-Tx-Id",value:t.reportTxId},{name:"Failed-Gateways",value:t.failedGateways.join(",")}],data:{reportTxId:t.reportTxId,failedGateways:t.failedGateways}})}async buyRecord(t,r){let{tags:h=[]}=r||{},l=[...h,{name:"Action",value:"Buy-Record"},{name:"Name",value:t.name},{name:"Years",value:t.years?.toString()??"1"},{name:"Process-Id",value:t.processId},{name:"Purchase-Type",value:t.type||"lease"}].filter(c=>c.value!==void 0);return this.process.send({signer:this.signer,tags:l})}async extendLease(t,r){let{tags:h=[]}=r||{};return this.process.send({signer:this.signer,tags:[...h,{name:"Action",value:"Extend-Lease"},{name:"Name",value:t.name},{name:"Years",value:t.years.toString()}]})}async increaseUndernameLimit(t,r){let{tags:h=[]}=r||{};return this.process.send({signer:this.signer,tags:[...h,{name:"Action",value:"Increase-Undername-Limit"},{name:"Name",value:t.name},{name:"Quantity",value:t.increaseCount.toString()}]})}};var lHt=async({address:i,contract:t=Am.init({processId:Od})})=>{let r=X9(50),h=await t.getArNSRecords().then(l=>Object.values(l).filter(c=>c.processId!==void 0).map(c=>c.processId)),o=await Promise.all(h.map(async l=>r(async()=>{let c=j2.init({processId:l}),{Owner:p,Controllers:w}=await c.getState();if(p===i||w.includes(i))return l})));return o.length===0?[]:[...new Set(o)]};function Oet(i,t){return new Promise((r,h)=>{let o=setTimeout(()=>{h(new Error("Timeout"))},i);t.then(l=>{clearTimeout(o),r(l)}).catch(l=>{clearTimeout(o),h(l)})})}var Cet=class extends Pet.default{contract;timeoutMs;throttle;constructor({contract:t=Am.init({processId:Od}),timeoutMs:r=6e4,concurrency:h=30}){super(),this.contract=t,this.timeoutMs=r,this.throttle=X9(h)}async fetchProcessesOwnedByWallet({address:t}){let r={};await Oet(this.timeoutMs,this.contract.getArNSRecords().catch(o=>(this.emit("error",`Error getting ArNS records: ${o}`),{}))).then(o=>{o&&Object.entries(o).forEach(([l,c])=>{c.processId!==void 0&&(r[c.processId]===void 0&&(r[c.processId]={state:void 0,names:{}}),r[c.processId].names[l]=c)})});let h=Object.keys(r).length;this.emit("progress",0,h),await Promise.all(Object.keys(r).map(async(o,l)=>this.throttle(async()=>{if(r[o].state!==void 0){this.emit("progress",l+1,h);return}let c=j2.init({processId:o}),p=await Oet(this.timeoutMs,c.getState()).catch(w=>{this.emit("error",`Error getting state for process ${o}: ${w}`)});(p?.Owner===t||p?.Controllers.includes(t))&&(r[o].state=p,this.emit("process",o,r[o])),this.emit("progress",l+1,h)}))),this.emit("end",r)}};Tt();Rt();xt();Tt();Rt();xt();var Net=sc(lR(),1),S8=Net.default.init({host:"arweave.net",port:443,protocol:"https"});async function BHt({signer:i,module:t=xL,luaCodeTxId:r=RL,ao:h=Sm(),scheduler:o=kL,state:l,stateContractTxId:c}){let p=await S8.transactions.getData(r,{decode:!0,string:!0}),w=await h.spawn({module:t,scheduler:o,signer:await Ys.createAoSigner(i)}),m=new Ys({processId:w,ao:h});return await m.send({tags:[{name:"Action",value:"Eval"},{name:"App-Name",value:"ArNS-ANT"},{name:"Source-Code-TX-ID",value:r}],data:p,signer:i}),l&&await m.send({tags:[{name:"Action",value:"Initialize-State"},...c!==void 0?[{name:"State-Contract-TX-ID",value:c}]:[]],data:JSON.stringify(l),signer:i}),w}var E8=class{axios;logger;constructor({url:t,logger:r=new pa}){this.logger=r,this.axios=oF({axiosConfig:{baseURL:t},logger:this.logger})}async get({endpoint:t,signal:r,allowedStatuses:h=[200,202],headers:o,params:l}){this.logger.debug(`Get request to endpoint: ${t} with params ${JSON.stringify(l,void 0,2)}`);let{status:c,statusText:p,data:w}=await this.axios.get(t,{headers:o,signal:r,params:l});if(this.logger.debug(`Response status: ${c} ${p}`),!h.includes(c))switch(c){case 404:throw new O6(p);case 400:throw new Hl(c,p);default:throw new C6(p)}return w}};var Gl=class{logger;http;contractTxId;cacheUrl;constructor({cacheUrl:t="https://api.arns.app",contractTxId:r,logger:h=new pa}){this.cacheUrl=t,this.contractTxId=r,this.logger=h,this.http=new E8({url:`${t}/v1/contract/${r}`})}configuration(){return{contractTxId:this.contractTxId,cacheUrl:this.cacheUrl}}async getState({evaluationOptions:t}={}){this.logger.debug("Fetching contract state",{contractTxId:this.contractTxId,evaluationOptions:t});let{state:r}=await this.http.get({endpoint:"",params:{...t?.evalTo}});return r}async readInteraction({functionName:t,inputs:r,evaluationOptions:h}){this.logger.debug("Evaluating read interaction on contract",{functionName:t,inputs:r,evaluationOptions:h});let{result:o}=await this.http.get({endpoint:`/read/${t}`,params:{...h?.evalTo,...r}});return o}};var Let=class{static createWriteableContract(t){if(!t||Object.keys(t).length===0)return new ga({contractTxId:Sy});if(Yf(t))return t.contract instanceof ga?t.contract:new ga(t.contract.configuration());if(Qf(t))return new ga({contractTxId:t.contractTxId});throw new No}static init(t){if(t&&t.signer!==void 0){let{signer:r,...h}=t,o=this.createWriteableContract(h);return new hk({signer:r,contract:o})}else return new A8(t)}},A8=class{contract;constructor(t){if(!t||t===void 0)this.contract=new Gl({contractTxId:Sy});else if(Yf(t))this.contract=t.contract;else if(Qf(t))this.contract=new Gl({contractTxId:t.contractTxId});else throw new No}async getState(t={}){return await this.contract.getState(t)}async getArNSRecord({domain:t,evaluationOptions:r}){return(await this.getArNSRecords({evaluationOptions:r}))[t]}async getArNSRecords({evaluationOptions:t}={}){return(await this.contract.getState({evaluationOptions:t})).records}async getArNSReservedNames({evaluationOptions:t}={}){return(await this.contract.getState({evaluationOptions:t})).reserved}async getArNSReservedName({domain:t,evaluationOptions:r}){return(await this.getArNSReservedNames({evaluationOptions:r}))[t]}async getBalance({address:t,evaluationOptions:r}){return(await this.getBalances({evaluationOptions:r}))[t]||0}async getBalances({evaluationOptions:t}={}){return(await this.contract.getState({evaluationOptions:t})).balances}async getGateway({address:t,evaluationOptions:r}){return this.contract.readInteraction({functionName:ho.GATEWAY,inputs:{target:t},evaluationOptions:r}).catch(()=>{})}async getGateways({evaluationOptions:t}={}){return this.contract.readInteraction({functionName:ho.GATEWAYS,evaluationOptions:t})}async getCurrentEpoch({evaluationOptions:t}={}){return this.contract.readInteraction({functionName:ho.EPOCH,evaluationOptions:t})}async getEpoch({blockHeight:t,evaluationOptions:r}){return this.contract.readInteraction({functionName:ho.EPOCH,inputs:{height:t},evaluationOptions:r})}async getPrescribedObservers({evaluationOptions:t}={}){return this.contract.readInteraction({functionName:ho.PRESCRIBED_OBSERVERS,evaluationOptions:t})}async getObservations({evaluationOptions:t}={}){let{observations:r}=await this.contract.getState({evaluationOptions:t});return r}async getDistributions({evaluationOptions:t}={}){let{distributions:r}=await this.contract.getState({evaluationOptions:t});return r}async getAuction({domain:t,type:r,evaluationOptions:h}){return this.contract.readInteraction({functionName:ho.AUCTION,inputs:{name:t,type:r},evaluationOptions:h})}async getAuctions({evaluationOptions:t}={}){let{auctions:r}=await this.contract.getState({evaluationOptions:t});return r}async getPriceForInteraction({interactionName:t,payload:r,evaluationOptions:h}){let{price:o}=await this.contract.readInteraction({functionName:ho.PRICE_FOR_INTERACTION,inputs:{interactionName:t,...r},evaluationOptions:h});return o}},hk=class extends A8{signer;constructor({signer:t,...r}){if(Object.keys(r).length===0)super({contract:new ga({contractTxId:Sy})}),this.signer=t;else if(Yf(r))super({contract:r.contract}),this.signer=t;else if(Qf(r))super({contract:new ga({contractTxId:r.contractTxId})}),this.signer=t;else throw new No}async transfer({target:t,qty:r,denomination:h="IO"},o){let l=r;return h==="IO"&&typeof r=="number"&&(l=new r2(r).toMIO()),this.contract.writeInteraction({functionName:ho.TRANSFER,inputs:{target:t,qty:l.valueOf()},signer:this.signer},o)}async joinNetwork({qty:t,allowDelegatedStaking:r,delegateRewardShareRatio:h,fqdn:o,label:l,minDelegatedStake:c,note:p,port:w,properties:m,protocol:y,autoStake:v,observerWallet:M},T){return this.contract.writeInteraction({functionName:ho.JOIN_NETWORK,inputs:{qty:t.valueOf(),allowDelegatedStaking:r,delegateRewardShareRatio:h,fqdn:o,label:l,minDelegatedStake:c.valueOf(),note:p,port:w,properties:m,protocol:y,autoStake:v,observerWallet:M},signer:this.signer},T)}async updateGatewaySettings({allowDelegatedStaking:t,delegateRewardShareRatio:r,fqdn:h,label:o,minDelegatedStake:l,note:c,port:p,properties:w,protocol:m,autoStake:y,observerWallet:v},M){return this.contract.writeInteraction({functionName:ho.UPDATE_GATEWAY_SETTINGS,inputs:{allowDelegatedStaking:t,delegateRewardShareRatio:r,fqdn:h,label:o,minDelegatedStake:l?.valueOf(),note:c,port:p,properties:w,protocol:m,autoStake:y,observerWallet:v},signer:this.signer},M)}async increaseDelegateStake(t,r){return this.contract.writeInteraction({functionName:ho.DELEGATE_STAKE,inputs:{target:t.target,qty:t.qty.valueOf()},signer:this.signer},r)}async decreaseDelegateStake(t,r){return this.contract.writeInteraction({functionName:ho.DECREASE_DELEGATE_STAKE,inputs:{target:t.target,qty:t.qty.valueOf()},signer:this.signer},r)}async increaseOperatorStake(t,r){return this.contract.writeInteraction({functionName:ho.INCREASE_OPERATOR_STAKE,inputs:{qty:t.qty.valueOf()},signer:this.signer},r)}async decreaseOperatorStake(t,r){return this.contract.writeInteraction({functionName:ho.DECREASE_OPERATOR_STAKE,inputs:{qty:t.qty.valueOf()},signer:this.signer},r)}async saveObservations(t,r){return this.contract.writeInteraction({functionName:ho.SAVE_OBSERVATIONS,inputs:{observerReportTxId:t.reportTxId,failedGateways:t.failedGateways},signer:this.signer},r)}async extendLease(t,r){return this.contract.writeInteraction({functionName:ho.EXTEND_RECORD,inputs:{name:t.domain,years:t.years},signer:this.signer},r)}async increaseUndernameLimit(t,r){return this.contract.writeInteraction({functionName:ho.INCREASE_UNDERNAME_COUNT,inputs:{name:t.domain,qty:t.qty},signer:this.signer},r)}};Tt();Rt();xt();Tt();Rt();xt();var or=sc(Zot(),1);var Cie=or.default.AbortError,Pie=or.default.AbstractContractHandler,Nie=or.default.ArweaveContractDefinitionLoader,Lie=or.default.ArweaveGatewayBundledContractDefinitionLoader,Die=or.default.ArweaveGatewayBundledInteractionLoader,$ie=or.default.ArweaveGatewayInteractionsLoader,Uie=or.default.ArweaveWrapper,qie=or.default.Benchmark,Fie=or.default.CacheKey,jie=or.default.CacheableInteractionsLoader,zie=or.default.CacheableStateEvaluator,Wie=or.default.ConsoleLogger,Kie=or.default.ConsoleLoggerFactory,Hie=or.default.ContractCache,Gie=or.default.ContractCallRecord,Vie=or.default.ContractError,Zie=or.default.ContractInteractionState,Jie=or.default.ContractMetadata,Xie=or.default.CustomEvent,Yie=or.default.DEFAULT_LEVEL_DB_LOCATION,Qie=or.default.DefaultEvaluationOptions,tne=or.default.DefaultStateEvaluator,ene=or.default.EvalStateResult,rne=or.default.EvaluationOptionsEvaluator,ine=or.default.HandlerBasedContract,nne=or.default.HandlerExecutorFactory,one=or.default.InnerWritesEvaluator,ane=or.default.InteractionCall,sne=or.default.InteractionCompleteEvent,hne=or.default.InteractionInput,fne=or.default.InteractionOutput,une=or.default.JsHandlerApi,cne=or.default.KV,lne=or.default.KnownErrors,dne=or.default.LevelDbCache,pne=or.default.LexicographicalInteractionsSorter,gne=or.default.LogLevelOrder,Jot=or.default.LoggerFactory,mne=or.default.MemCache,vne=or.default.NetworkCommunicationError,yne=or.default.NonWhitelistedSourceError,bne=or.default.PstContractImpl,wne=or.default.REGISTER_PROVIDER,_ne=or.default.SMART_WEAVE_TAGS,Mne=or.default.SUPPORTED_SRC_CONTENT_TYPES,Sne=or.default.SWBlock,Ene=or.default.SWTransaction,Ane=or.default.SWVrf,Xot=or.default.Signature,Tne=or.default.SmartWeaveError,xne=or.default.SmartWeaveErrorType,Rne=or.default.SmartWeaveGlobal,kne=or.default.SortKeyCacheResult,Ine=or.default.SourceType,Bne=or.default.SrcCache,Yot=or.default.Tag,One=or.default.TagsParser,Cne=or.default.Transaction,Pne=or.default.WARP_GW_URL,Nne=or.default.WARP_TAGS,Lne=or.default.Warp,Dne=or.default.WarpBuilder,Qot=or.default.WarpFactory,$ne=or.default.WarpFetchWrapper,Une=or.default.WarpGatewayContractDefinitionLoader,qne=or.default.WarpGatewayInteractionsLoader,Fne=or.default.WasmHandlerApi,jne=or.default.WasmSrc,zne=or.default.arrayToHex,Wne=or.default.asc,Kne=or.default.ascS,Hne=or.default.bufToBn,Gne=or.default.bundledTxsFilter,Vne=or.default.checkJsSrc,Zne=or.default.createDummyTx,Jne=or.default.createInteractionTagsList,Xne=or.default.createInteractionTx,Yne=or.default.deepCopy,Qne=or.default.defaultArweaveMs,tat=or.default.defaultCacheOptions,toe=or.default.defaultWarpGwOptions,eoe=or.default.desc,roe=or.default.descS,ioe=or.default.emptyTransfer,noe=or.default.genesisSortKey,ooe=or.default.getJsonResponse,aoe=or.default.indent,soe=or.default.isBrowser,hoe=or.default.isTxIdValid,foe=or.default.knownWarpPlugins,uoe=or.default.knownWarpPluginsPartial,coe=or.default.lastPossibleSortKey,loe=or.default.lvlToOrder,doe=or.default.mapReplacer,poe=or.default.mapReviver,goe=or.default.matchMutClosureDtor,moe=or.default.normalizeContractSource,voe=or.default.rustWasmImports,yoe=or.default.safeGet,boe=or.default.safeParseInt,woe=or.default.sleep,_oe=or.default.sortingFirst,Moe=or.default.sortingLast,Soe=or.default.stripTrailingSlash,Eoe=or.default.timeout;Tt();Rt();xt();qx();var hkt="+",fkt="/",ukt="-",ckt="_",lkt="=";function dkt(i){return i.replaceAll(hkt,ukt).replaceAll(fkt,ckt).replaceAll(lkt,"")}function wv(i){let t=i.toString("base64");return dkt(t)}function eat(i){return wv(Ux("sha256").update(i).digest())}Tt();Rt();xt();var rat=Qot.forMainnet({...tat,inMemory:!0},!0,S8);Jot.INST.logLevel("error");var ga=class{contract;contractTxId;cacheUrl;logger;warp;constructor({contractTxId:t,cacheUrl:r="https://api.arns.app",warp:h=rat,logger:o=new pa({level:"info"})}){this.contractTxId=t,this.contract=h.contract(t),this.cacheUrl=r,this.warp=h,this.logger=o}configuration(){return{contractTxId:this.contractTxId,cacheUrl:this.cacheUrl}}async createWarpSigner(t){return t.publicKey===void 0&&"setPublicKey"in t&&await t.setPublicKey(),new Xot(this.warp,{signer:async h=>{h.setOwner(wv(t.publicKey));let o=await h.getSignatureData(),l=await t.sign(o),c=ge.from(l),p=eat(c);h.setSignature({id:p,owner:wv(t.publicKey),signature:wv(c)})},type:"arweave"})}async getState({evaluationOptions:t={}}){await this.ensureContractInit();let r=t?.evalTo,h;r&&"sortKey"in r?h=r.sortKey:r&&"blockHeight"in r&&(h=r.blockHeight);let o=await this.contract.readState(h);if(!o.cachedValue.state)throw new Hl(502,"Failed to evaluate contract state");return o.cachedValue.state}async ensureContractInit({signer:t}={}){this.logger.debug("Checking contract initialized",{contractTxId:this.contractTxId}),this.logger.debug("Fetching contract manifest",{contractTxId:this.contractTxId});let{evaluationOptions:r={}}=await BL({arweave:this.warp.arweave,contractTxId:this.contractTxId});this.contract.setEvaluationOptions(r),t&&this.contract.connect(await this.createWarpSigner(t)),this.cacheUrl!==void 0&&(this.logger.debug("Syncing contract state",{contractTxId:this.contractTxId,remoteCacheUrl:this.cacheUrl}),await this.contract.syncState(`${this.cacheUrl}/v1/contract/${this.contractTxId}`,{validity:!0}))}async readInteraction({functionName:t,inputs:r}){await this.ensureContractInit(),this.logger.debug(`Read interaction: ${t}`,{contractTxId:this.contractTxId,inputs:r});let h=await this.contract.viewState({function:t,...r});if(h.result===void 0)throw new Hl(502,"Failed to evaluate contract read interaction: "+JSON.stringify({error:h.errorMessage,functionName:t,inputs:r},null,2));return this.logger.debug("Successfully evaluated contract read interaction",{contractTxId:this.contractTxId,result:h.result}),h.result}async writeInteraction({functionName:t,inputs:r,signer:h},o){try{this.logger.debug(`Write interaction: ${t}`,{contractTxId:this.contractTxId}),await this.ensureContractInit({signer:h});let l=await this.contract.dryWrite({function:t,...r});if(l.type!=="ok")throw new Error(`Failed to dry write contract interaction ${t}: ${l.errorMessage}`);let c=await this.contract.writeInteraction({function:t,...r},{disableBundling:!0,tags:o?.tags?.map(p=>new Yot(p.name,p.value))});if(!c?.interactionTx)throw new Error(`Failed to write contract interaction: ${t}`);return this.logger.debug("Successfully wrote contract interaction",{contractTxId:this.contractTxId,interactionTxId:c.originalTxId}),c.interactionTx}catch(l){throw this.logger.error(`Failed to write contract interaction: ${l.message}`,{contractTxId:this.contractTxId}),new a1(l)}}};Tt();Rt();xt();var z2=class{process;constructor(t){if(Rl(t))this.process=t.process;else if(kl(t))this.process=new Ys({processId:t.processId});else throw new No}async getState(){let t=[{name:"Action",value:"State"}];return await this.process.read({tags:t})}async getInfo(){let t=[{name:"Action",value:"Info"}];return await this.process.read({tags:t})}async getRecord({undername:t}){let r=[{name:"Sub-Domain",value:t},{name:"Action",value:"Record"}];return await this.process.read({tags:r})}async getRecords(){let t=[{name:"Action",value:"Records"}];return await this.process.read({tags:t})}async getOwner(){return(await this.getInfo()).Owner}async getControllers(){let t=[{name:"Action",value:"Controllers"}];return await this.process.read({tags:t})}async getName(){return(await this.getInfo()).Name}async getTicker(){return(await this.getInfo()).Ticker}async getBalances(){let t=[{name:"Action",value:"Balances"}];return await this.process.read({tags:t})}async getBalance({address:t}){let r=[{name:"Action",value:"Balance"},{name:"Recipient",value:t}];return await this.process.read({tags:r})}},L6=class extends z2{signer;constructor({signer:t,...r}){super(r),this.signer=t}async transfer({target:t}){let r=[{name:"Action",value:"Transfer"},{name:"Recipient",value:t}];return this.process.send({tags:r,data:{},signer:this.signer})}async addController({controller:t}){let r=[{name:"Action",value:"Add-Controller"},{name:"Controller",value:t}];return this.process.send({tags:r,data:{},signer:this.signer})}async removeController({controller:t}){let r=[{name:"Action",value:"Remove-Controller"},{name:"Controller",value:t}];return this.process.send({tags:r,data:{},signer:this.signer})}async setRecord({undername:t,transactionId:r,ttlSeconds:h}){return this.process.send({tags:[{name:"Action",value:"Set-Record"},{name:"Sub-Domain",value:t},{name:"Transaction-Id",value:r},{name:"TTL-Seconds",value:h.toString()}],data:{transactionId:r,ttlSeconds:h},signer:this.signer})}async removeRecord({undername:t}){return this.process.send({tags:[{name:"Action",value:"Remove-Record"},{name:"Sub-Domain",value:t}],data:{undername:t},signer:this.signer})}async setTicker({ticker:t}){return this.process.send({tags:[{name:"Action",value:"Set-Ticker"},{name:"Ticker",value:t}],data:{ticker:t},signer:this.signer})}async setName({name:t}){return this.process.send({tags:[{name:"Action",value:"Set-Name"},{name:"Name",value:t}],data:{name:t},signer:this.signer})}};var export_ArconnectSigner=iat.ArconnectSigner;var export_ArweaveSigner=iat.ArweaveSigner;export{j2 as ANT,N6 as ANTReadable,Y9 as ANTWritable,cc as ANT_CONTRACT_FUNCTIONS,RL as ANT_LUA_ID,Ys as AOProcess,xL as AOS_MODULE_ID,Hkt as ARNS_DEVNET_REGISTRY_TX,Sy as ARNS_TESTNET_REGISTRY_TX,AL as ARWEAVE_TX_REGEX,ho as AR_IO_CONTRACT_FUNCTIONS,s1 as AbortError,z2 as AoANTReadable,L6 as AoANTWriteable,Let as ArIO,A8 as ArIOReadable,hk as ArIOWritable,Cet as ArNSEventEmitter,export_ArconnectSigner as ArconnectSigner,export_ArweaveSigner as ArweaveSigner,aF as BadRequest,wh as BaseError,kL as DEFAULT_SCHEDULER_ID,EL as DENOMINATIONS,pa as DefaultLogger,Kkt as FQDN_REGEX,Hl as FailedRequestError,Am as IO,M8 as IOReadable,r2 as IOToken,sk as IOWriteable,No as InvalidContractConfigurationError,hF as InvalidProcessConfigurationError,sF as InvalidSignerError,h1 as MAX_REQUEST_SIZE,W5 as MIO_PER_IO,O6 as NotFound,Gl as RemoteContract,TL as SORT_KEY_REGEX,G5 as SmartWeaveSortKey,C6 as UnknownError,ga as WarpContract,a1 as WriteInteractionError,oF as createAxiosInstance,lHt as getANTProcessesOwnedByWallet,BL as getContractManifest,Fqt as getContractsTransferredToOrControlledByWallet,Uqt as getSmartweaveContractsFromGQL,qqt as getSmartweaveTransactionsFromGQL,Dkt as ioContractInteractions,Ist as ioContractReadInteractions,Bst as ioContractWriteInteractions,Od as ioDevnetProcessId,iIt as isBlockHeight,Yf as isContractConfiguration,Qf as isContractTxIdConfiguration,uIt as isLeasedArNSRecord,Rl as isProcessConfiguration,kl as isProcessIdConfiguration,TIt as isSortKey,nIt as isTransaction,H5 as mIOToken,ak as safeDecode,BHt as spawnANT,IL as tagsToObject,Ey as validateArweaveId};
380
380
  /*! Bundled license information:
381
381
 
382
382
  @jspm/core/nodelibs/browser/buffer.js:
@@ -64,6 +64,11 @@ class IOReadable {
64
64
  }
65
65
  this.arweave = arweave;
66
66
  }
67
+ async getInfo() {
68
+ return this.process.read({
69
+ tags: [{ name: 'Action', value: 'Info' }],
70
+ });
71
+ }
67
72
  async getEpoch(epoch) {
68
73
  const allTags = [
69
74
  { name: 'Action', value: 'Epoch' },
@@ -18,4 +18,4 @@
18
18
  Object.defineProperty(exports, "__esModule", { value: true });
19
19
  exports.version = void 0;
20
20
  // AUTOMATICALLY GENERATED FILE - DO NOT TOUCH
21
- exports.version = '1.2.0-alpha.17';
21
+ exports.version = '1.2.0-alpha.18';
@@ -57,6 +57,11 @@ export class IOReadable {
57
57
  }
58
58
  this.arweave = arweave;
59
59
  }
60
+ async getInfo() {
61
+ return this.process.read({
62
+ tags: [{ name: 'Action', value: 'Info' }],
63
+ });
64
+ }
60
65
  async getEpoch(epoch) {
61
66
  const allTags = [
62
67
  { name: 'Action', value: 'Epoch' },
@@ -15,4 +15,4 @@
15
15
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
16
16
  */
17
17
  // AUTOMATICALLY GENERATED FILE - DO NOT TOUCH
18
- export const version = '1.2.0-alpha.17';
18
+ export const version = '1.2.0-alpha.18';
@@ -43,6 +43,12 @@ export declare class IOReadable implements AoIORead {
43
43
  protected process: AOProcess;
44
44
  private arweave;
45
45
  constructor(config?: ProcessConfiguration, arweave?: Arweave);
46
+ getInfo(): Promise<{
47
+ Name: string;
48
+ Ticker: string;
49
+ Logo: string;
50
+ Denomination: number;
51
+ }>;
46
52
  getEpoch(epoch?: EpochInput): Promise<AoEpochData>;
47
53
  getArNSRecord({ name, }: {
48
54
  name: string;
package/lib/types/io.d.ts CHANGED
@@ -58,6 +58,12 @@ export interface AOContract {
58
58
  }>;
59
59
  }
60
60
  export interface AoIORead {
61
+ getInfo(): Promise<{
62
+ Ticker: string;
63
+ Name: string;
64
+ Logo: string;
65
+ Denomination: number;
66
+ }>;
61
67
  getGateway({ address, }: {
62
68
  address: WalletAddress;
63
69
  }): Promise<AoGateway | undefined>;
@@ -14,4 +14,4 @@
14
14
  * You should have received a copy of the GNU Affero General Public License
15
15
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
16
16
  */
17
- export declare const version = "1.2.0-alpha.16";
17
+ export declare const version = "1.2.0-alpha.17";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ar.io/sdk",
3
- "version": "1.2.0-alpha.17",
3
+ "version": "1.2.0-alpha.18",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/ar-io/ar-io-sdk.git"