"use strict";(self.webpackChunkfrog=self.webpackChunkfrog||[]).push([[8674],{14132:(t,e,n)=>{n.d(e,{R:()=>a});var r=n(36212),s=n(27033);const i="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";BigInt(0);const o=BigInt(58);function a(t){const e=(0,r.q5)(t);let n=(0,s.Dg)(e),a="";for(;n;)a=i[Number(n%o)]+a,n/=o;for(let t=0;t{n.d(e,{J:()=>u});var r=n(36212),s=n(57339);function i(t){let e=t.toString(16);for(;e.length<2;)e="0"+e;return"0x"+e}function o(t,e,n){let r=0;for(let s=0;s{(0,s.vA)(e<=t.length,"data short segment too short","BUFFER_OVERRUN",{buffer:t,length:t.length,offset:e})};if(t[e]>=248){const r=t[e]-247;n(e+1+r);const s=o(t,e+1,r);return n(e+1+r+s),a(t,e,e+1+r,r+s)}if(t[e]>=192){const r=t[e]-192;return n(e+1+r),a(t,e,e+1,r)}if(t[e]>=184){const s=t[e]-183;n(e+1+s);const i=o(t,e+1,s);n(e+1+s+i);return{consumed:1+s+i,result:(0,r.c$)(t.slice(e+1+s,e+1+s+i))}}if(t[e]>=128){const s=t[e]-128;n(e+1+s);return{consumed:1+s,result:(0,r.c$)(t.slice(e+1,e+1+s))}}return{consumed:1,result:i(t[e])}}function u(t){const e=(0,r.q5)(t,"data"),n=l(e,0);return(0,s.MR)(n.consumed===e.length,"unexpected junk after rlp payload","data",t),n.result}},26976:(t,e,n)=>{n.d(e,{ui:()=>y});var r=n(36212);var s=n(57339),i=n(88081),o=n(87303);function a(t){return async function(t,e){(0,s.vA)(null==e||!e.cancelled,"request cancelled before sending","CANCELLED");const n=t.url.split(":")[0].toLowerCase();(0,s.vA)("http"===n||"https"===n,`unsupported protocol ${n}`,"UNSUPPORTED_OPERATION",{info:{protocol:n},operation:"request"}),(0,s.vA)("https"===n||!t.credentials||t.allowInsecureAuthentication,"insecure authorized connections unsupported","UNSUPPORTED_OPERATION",{operation:"request"});let r=null;const i=new AbortController,o=setTimeout((()=>{r=(0,s.xz)("request timeout","TIMEOUT"),i.abort()}),t.timeout);e&&e.addListener((()=>{r=(0,s.xz)("request cancelled","CANCELLED"),i.abort()}));const a={method:t.method,headers:new Headers(Array.from(t)),body:t.body||void 0,signal:i.signal};let l;try{l=await fetch(t.url,a)}catch(t){if(clearTimeout(o),r)throw r;throw t}clearTimeout(o);const u={};l.headers.forEach(((t,e)=>{u[e.toLowerCase()]=t}));const c=await l.arrayBuffer(),h=null==c?null:new Uint8Array(c);return{statusCode:l.status,statusMessage:l.statusText,headers:u,body:h}}}a();let l=a();const u=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),c=new RegExp("^ipfs://(ipfs/)?(.*)$","i");let h=!1;async function f(t,e){try{const e=t.match(u);if(!e)throw new Error("invalid data");return new b(200,"OK",{"content-type":e[1]||"text/plain"},e[2]?function(t){t=atob(t);const e=new Uint8Array(t.length);for(let n=0;nString.fromCharCode(parseInt(e,16)))))))}catch(e){return new b(599,"BAD REQUEST (invalid data: URI)",{},null,new y(t))}var n}function d(t){return async function(e,n){try{const n=e.match(c);if(!n)throw new Error("invalid link");return new y(`${t}${n[2]}`)}catch(t){return new b(599,"BAD REQUEST (invalid IPFS URI)",{},null,new y(e))}}}const g={data:f,ipfs:d("https://gateway.ipfs.io/ipfs/")},m=new WeakMap;class p{#t;#e;constructor(t){this.#t=[],this.#e=!1,m.set(t,(()=>{if(!this.#e){this.#e=!0;for(const t of this.#t)setTimeout((()=>{t()}),0);this.#t=[]}}))}addListener(t){(0,s.vA)(!this.#e,"singal already cancelled","UNSUPPORTED_OPERATION",{operation:"fetchCancelSignal.addCancelListener"}),this.#t.push(t)}get cancelled(){return this.#e}checkSignal(){(0,s.vA)(!this.cancelled,"cancelled","CANCELLED",{})}}function v(t){if(null==t)throw new Error("missing signal; should not happen");return t.checkSignal(),t}class y{#n;#r;#s;#i;#o;#a;#l;#u;#c;#h;#f;#d;#g;#m;#p;get url(){return this.#a}set url(t){this.#a=String(t)}get body(){return null==this.#l?null:new Uint8Array(this.#l)}set body(t){if(null==t)this.#l=void 0,this.#u=void 0;else if("string"==typeof t)this.#l=(0,o.YW)(t),this.#u="text/plain";else if(t instanceof Uint8Array)this.#l=t,this.#u="application/octet-stream";else{if("object"!=typeof t)throw new Error("invalid body");this.#l=(0,o.YW)(JSON.stringify(t)),this.#u="application/json"}}hasBody(){return null!=this.#l}get method(){return this.#i?this.#i:this.hasBody()?"POST":"GET"}set method(t){null==t&&(t=""),this.#i=String(t).toUpperCase()}get headers(){const t=Object.assign({},this.#s);return this.#c&&(t.authorization=`Basic ${function(t){const e=(0,r.q5)(t);let n="";for(let t=0;t{if(n=0,"timeout must be non-zero","timeout",t),this.#o=t}get preflightFunc(){return this.#h||null}set preflightFunc(t){this.#h=t}get processFunc(){return this.#f||null}set processFunc(t){this.#f=t}get retryFunc(){return this.#d||null}set retryFunc(t){this.#d=t}get getUrlFunc(){return this.#p||l}set getUrlFunc(t){this.#p=t}constructor(t){this.#a=String(t),this.#n=!1,this.#r=!0,this.#s={},this.#i="",this.#o=3e5,this.#m={slotInterval:250,maxAttempts:12},this.#p=null}toString(){return``}setThrottleParams(t){null!=t.slotInterval&&(this.#m.slotInterval=t.slotInterval),null!=t.maxAttempts&&(this.#m.maxAttempts=t.maxAttempts)}async#v(t,e,n,r,i){if(t>=this.#m.maxAttempts)return i.makeServerError("exceeded maximum retry limit");(0,s.vA)(w()<=e,"timeout","TIMEOUT",{operation:"request.send",reason:"timeout",request:r}),n>0&&await function(t){return new Promise((e=>setTimeout(e,t)))}(n);let o=this.clone();const a=(o.url.split(":")[0]||"").toLowerCase();if(a in g){const t=await g[a](o.url,v(r.#g));if(t instanceof b){let e=t;if(this.processFunc){v(r.#g);try{e=await this.processFunc(o,e)}catch(t){null!=t.throttle&&"number"==typeof t.stall||e.makeServerError("error in post-processing function",t).assertOk()}}return e}o=t}this.preflightFunc&&(o=await this.preflightFunc(o));const l=await this.getUrlFunc(o,v(r.#g));let u=new b(l.statusCode,l.statusMessage,l.headers,l.body,r);if(301===u.statusCode||302===u.statusCode){try{const n=u.headers.location||"";return o.redirect(n).#v(t+1,e,0,r,u)}catch(t){}return u}if(429===u.statusCode&&(null==this.retryFunc||await this.retryFunc(o,u,t))){const n=u.headers["retry-after"];let s=this.#m.slotInterval*Math.trunc(Math.random()*Math.pow(2,t));return"string"==typeof n&&n.match(/^[1-9][0-9]*$/)&&(s=parseInt(n)),o.clone().#v(t+1,e,s,r,u)}if(this.processFunc){v(r.#g);try{u=await this.processFunc(o,u)}catch(n){null!=n.throttle&&"number"==typeof n.stall||u.makeServerError("error in post-processing function",n).assertOk();let s=this.#m.slotInterval*Math.trunc(Math.random()*Math.pow(2,t));return n.stall>=0&&(s=n.stall),o.clone().#v(t+1,e,s,r,u)}}return u}send(){return(0,s.vA)(null==this.#g,"request already sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.send"}),this.#g=new p(this),this.#v(0,w()+this.timeout,0,this,new b(0,"",{},null,this))}cancel(){(0,s.vA)(null!=this.#g,"request has not been sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.cancel"});const t=m.get(this);if(!t)throw new Error("missing signal; should not happen");t()}redirect(t){const e=this.url.split(":")[0].toLowerCase(),n=t.split(":")[0].toLowerCase();(0,s.vA)("GET"===this.method&&("https"!==e||"http"!==n)&&t.match(/^https?:/),"unsupported redirect","UNSUPPORTED_OPERATION",{operation:`redirect(${this.method} ${JSON.stringify(this.url)} => ${JSON.stringify(t)})`});const r=new y(t);return r.method="GET",r.allowGzip=this.allowGzip,r.timeout=this.timeout,r.#s=Object.assign({},this.#s),this.#l&&(r.#l=new Uint8Array(this.#l)),r.#u=this.#u,r}clone(){const t=new y(this.url);return t.#i=this.#i,this.#l&&(t.#l=this.#l),t.#u=this.#u,t.#s=Object.assign({},this.#s),t.#c=this.#c,this.allowGzip&&(t.allowGzip=!0),t.timeout=this.timeout,this.allowInsecureAuthentication&&(t.allowInsecureAuthentication=!0),t.#h=this.#h,t.#f=this.#f,t.#d=this.#d,t.#m=Object.assign({},this.#m),t.#p=this.#p,t}static lockConfig(){h=!0}static getGateway(t){return g[t.toLowerCase()]||null}static registerGateway(t,e){if("http"===(t=t.toLowerCase())||"https"===t)throw new Error(`cannot intercept ${t}; use registerGetUrl`);if(h)throw new Error("gateways locked");g[t]=e}static registerGetUrl(t){if(h)throw new Error("gateways locked");l=t}static createGetUrlFunc(t){return a()}static createDataGateway(){return f}static createIpfsGatewayFunc(t){return d(t)}}class b{#y;#b;#s;#l;#w;#E;toString(){return``}get statusCode(){return this.#y}get statusMessage(){return this.#b}get headers(){return Object.assign({},this.#s)}get body(){return null==this.#l?null:new Uint8Array(this.#l)}get bodyText(){try{return null==this.#l?"":(0,o._v)(this.#l)}catch(t){(0,s.vA)(!1,"response body is not valid UTF-8 data","UNSUPPORTED_OPERATION",{operation:"bodyText",info:{response:this}})}}get bodyJson(){try{return JSON.parse(this.bodyText)}catch(t){(0,s.vA)(!1,"response body is not valid JSON","UNSUPPORTED_OPERATION",{operation:"bodyJson",info:{response:this}})}}[Symbol.iterator](){const t=this.headers,e=Object.keys(t);let n=0;return{next:()=>{if(n(t[e.toLowerCase()]=String(n[e]),t)),{}),this.#l=null==r?null:new Uint8Array(r),this.#w=s||null,this.#E={message:""}}makeServerError(t,e){let n;n=t?`CLIENT ESCALATED SERVER ERROR (${this.statusCode} ${this.statusMessage}; ${t})`:`CLIENT ESCALATED SERVER ERROR (${t=`${this.statusCode} ${this.statusMessage}`})`;const r=new b(599,n,this.headers,this.body,this.#w||void 0);return r.#E={message:t,error:e},r}throwThrottleError(t,e){null==e?e=-1:(0,s.MR)(Number.isInteger(e)&&e>=0,"invalid stall timeout","stall",e);const n=new Error(t||"throttling requests");throw(0,i.n)(n,{stall:e,throttle:!0}),n}getHeader(t){return this.headers[t.toLowerCase()]}hasBody(){return null!=this.#l}get request(){return this.#w}ok(){return""===this.#E.message&&this.statusCode>=200&&this.statusCode<300}assertOk(){if(this.ok())return;let{message:t,error:e}=this.#E;""===t&&(t=`server response ${this.statusCode} ${this.statusMessage}`);let n=null;this.request&&(n=this.request.url);let r=null;try{this.#l&&(r=(0,o._v)(this.#l))}catch(t){}(0,s.vA)(!1,t,"SERVER_ERROR",{request:this.request||"unknown request",response:this,error:e,info:{requestUrl:n,responseBody:r,responseStatus:`${this.statusCode} ${this.statusMessage}`}})}}function w(){return(new Date).getTime()}},27033:(t,e,n)=>{n.d(e,{Ab:()=>h,Dg:()=>g,JJ:()=>u,Ro:()=>p,ST:()=>l,WZ:()=>m,c4:()=>y,dK:()=>c,nD:()=>b,up:()=>v});var r=n(36212),s=n(57339);const i=BigInt(0),o=BigInt(1),a=9007199254740991;function l(t,e){const n=f(t,"value"),r=BigInt(m(e,"width"));if((0,s.vA)(n>>r===i,"overflow","NUMERIC_FAULT",{operation:"fromTwos",fault:"overflow",value:t}),n>>r-o){return-((~n&(o<=-a&&t<=a,"overflow",e||"value",t),BigInt(t);case"string":try{if(""===t)throw new Error("empty string");return"-"===t[0]&&"-"!==t[1]?-BigInt(t.substring(1)):BigInt(t)}catch(n){(0,s.MR)(!1,`invalid BigNumberish string: ${n.message}`,e||"value",t)}}(0,s.MR)(!1,"invalid BigNumberish value",e||"value",t)}function f(t,e){const n=h(t,e);return(0,s.vA)(n>=i,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:t}),n}const d="0123456789abcdef";function g(t){if(t instanceof Uint8Array){let e="0x0";for(const n of t)e+=d[n>>4],e+=d[15&n];return BigInt(e)}return h(t)}function m(t,e){switch(typeof t){case"bigint":return(0,s.MR)(t>=-a&&t<=a,"overflow",e||"value",t),Number(t);case"number":return(0,s.MR)(Number.isInteger(t),"underflow",e||"value",t),(0,s.MR)(t>=-a&&t<=a,"overflow",e||"value",t),t;case"string":try{if(""===t)throw new Error("empty string");return m(BigInt(t),e)}catch(n){(0,s.MR)(!1,`invalid numeric string: ${n.message}`,e||"value",t)}}(0,s.MR)(!1,"invalid numeric value",e||"value",t)}function p(t){return m(g(t))}function v(t,e){let n=f(t,"value").toString(16);if(null==e)n.length%2&&(n="0"+n);else{const r=m(e,"width");for((0,s.vA)(2*r>=n.length,`value exceeds width (${r} bytes)`,"NUMERIC_FAULT",{operation:"toBeHex",fault:"overflow",value:t});n.length<2*r;)n="0"+n}return"0x"+n}function y(t){const e=f(t,"value");if(e===i)return new Uint8Array([]);let n=e.toString(16);n.length%2&&(n="0"+n);const r=new Uint8Array(n.length/2);for(let t=0;t{n.d(e,{Lm:()=>o,Lo:()=>a,X_:()=>p,ZG:()=>d,c$:()=>c,f:()=>l,nx:()=>m,pO:()=>f,q5:()=>i,xW:()=>h});var r=n(57339);function s(t,e,n){if(t instanceof Uint8Array)return n?new Uint8Array(t):t;if("string"==typeof t&&t.match(/^0x(?:[0-9a-f][0-9a-f])*$/i)){const e=new Uint8Array((t.length-2)/2);let n=2;for(let r=0;r>4]+u[15&r]}return n}function h(t){return"0x"+t.map((t=>c(t).substring(2))).join("")}function f(t){return a(t,!0)?(t.length-2)/2:i(t).length}function d(t,e,n){const s=i(t);return null!=n&&n>s.length&&(0,r.vA)(!1,"cannot slice beyond data bounds","BUFFER_OVERRUN",{buffer:s,length:s.length,offset:n}),c(s.slice(null==e?0:e,null==n?s.length:n))}function g(t,e,n){const s=i(t);(0,r.vA)(e>=s.length,"padding exceeds data length","BUFFER_OVERRUN",{buffer:new Uint8Array(s),length:e,offset:e+1});const o=new Uint8Array(e);return o.fill(0),n?o.set(s,e-s.length):o.set(s,0),c(o)}function m(t,e){return g(t,e,!0)}function p(t,e){return g(t,e,!1)}},57339:(t,e,n)=>{n.d(e,{E:()=>a,MR:()=>c,SP:()=>d,bJ:()=>o,dd:()=>h,gk:()=>g,vA:()=>u,xz:()=>l});var r=n(99529),s=n(88081);function i(t){if(null==t)return"null";if(Array.isArray(t))return"[ "+t.map(i).join(", ")+" ]";if(t instanceof Uint8Array){const e="0123456789abcdef";let n="0x";for(let r=0;r>4],n+=e[15&t[r]];return n}if("object"==typeof t&&"function"==typeof t.toJSON)return i(t.toJSON());switch(typeof t){case"boolean":case"symbol":case"number":return t.toString();case"bigint":return BigInt(t).toString();case"string":return JSON.stringify(t);case"object":{const e=Object.keys(t);return e.sort(),"{ "+e.map((e=>`${i(e)}: ${i(t[e])}`)).join(", ")+" }"}}return"[ COULD NOT SERIALIZE ]"}function o(t,e){return t&&t.code===e}function a(t){return o(t,"CALL_EXCEPTION")}function l(t,e,n){let o,a=t;{const s=[];if(n){if("message"in n||"code"in n||"name"in n)throw new Error(`value will overwrite populated values: ${i(n)}`);for(const t in n){if("shortMessage"===t)continue;const e=n[t];s.push(t+"="+i(e))}}s.push(`code=${e}`),s.push(`version=${r.r}`),s.length&&(t+=" ("+s.join(", ")+")")}switch(e){case"INVALID_ARGUMENT":o=new TypeError(t);break;case"NUMERIC_FAULT":case"BUFFER_OVERRUN":o=new RangeError(t);break;default:o=new Error(t)}return(0,s.n)(o,{code:e}),n&&Object.assign(o,n),null==o.shortMessage&&(0,s.n)(o,{shortMessage:a}),o}function u(t,e,n,r){if(!t)throw l(e,n,r)}function c(t,e,n,r){u(t,e,"INVALID_ARGUMENT",{argument:n,value:r})}function h(t,e,n){null==n&&(n=""),n&&(n=": "+n),u(t>=e,"missing argument"+n,"MISSING_ARGUMENT",{count:t,expectedCount:e}),u(t<=e,"too many arguments"+n,"UNEXPECTED_ARGUMENT",{count:t,expectedCount:e})}const f=["NFD","NFC","NFKD","NFKC"].reduce(((t,e)=>{try{if("test"!=="test".normalize(e))throw new Error("bad");if("NFD"===e){const t=String.fromCharCode(233).normalize("NFD");if(t!==String.fromCharCode(101,769))throw new Error("broken")}t.push(e)}catch(t){}return t}),[]);function d(t){u(f.indexOf(t)>=0,"platform missing String.prototype.normalize","UNSUPPORTED_OPERATION",{operation:"String.prototype.normalize",info:{form:t}})}function g(t,e,n){if(null==n&&(n=""),t!==e){let t=n,e="new";n&&(t+=".",e+=" "+n),u(!1,`private constructor; use ${t}from* methods`,"UNSUPPORTED_OPERATION",{operation:e})}}},65735:(t,e,n)=>{n.d(e,{R:()=>a});var r=n(36212);function s(t){const e=[];for(;t;)e.unshift(255&t),t>>=8;return e}function i(t){if(Array.isArray(t)){let e=[];if(t.forEach((function(t){e=e.concat(i(t))})),e.length<=55)return e.unshift(192+e.length),e;const n=s(e.length);return n.unshift(247+n.length),n.concat(e)}const e=Array.prototype.slice.call((0,r.q5)(t,"object"));if(1===e.length&&e[0]<=127)return e;if(e.length<=55)return e.unshift(128+e.length),e;const n=s(e.length);return n.unshift(183+n.length),n.concat(e)}const o="0123456789abcdef";function a(t){let e="0x";for(const n of i(t))e+=o[n>>4],e+=o[15&n];return e}},87303:(t,e,n)=>{n.d(e,{YW:()=>l,_v:()=>u});var r=n(36212),s=n(57339);function i(t,e,n,r,s){if("BAD_PREFIX"===t||"UNEXPECTED_CONTINUE"===t){let t=0;for(let r=e+1;r>6==2;r++)t++;return t}return"OVERRUN"===t?n.length-e-1:0}const o=Object.freeze({error:function(t,e,n,r,i){(0,s.MR)(!1,`invalid codepoint at offset ${e}; ${t}`,"bytes",n)},ignore:i,replace:function(t,e,n,r,o){return"OVERLONG"===t?((0,s.MR)("number"==typeof o,"invalid bad code point for replacement","badCodepoint",o),r.push(o),0):(r.push(65533),i(t,e,n))}});function a(t,e){null==e&&(e=o.error);const n=(0,r.q5)(t,"bytes"),s=[];let i=0;for(;i>7)){s.push(t);continue}let r=null,o=null;if(192==(224&t))r=1,o=127;else if(224==(240&t))r=2,o=2047;else{if(240!=(248&t)){i+=e(128==(192&t)?"UNEXPECTED_CONTINUE":"BAD_PREFIX",i-1,n,s);continue}r=3,o=65535}if(i-1+r>=n.length){i+=e("OVERRUN",i-1,n,s);continue}let a=t&(1<<8-r-1)-1;for(let t=0;t1114111?i+=e("OUT_OF_RANGE",i-1-r,n,s,a):a>=55296&&a<=57343?i+=e("UTF16_SURROGATE",i-1-r,n,s,a):a<=o?i+=e("OVERLONG",i-1-r,n,s,a):s.push(a))}return s}function l(t,e){(0,s.MR)("string"==typeof t,"invalid string value","str",t),null!=e&&((0,s.SP)(e),t=t.normalize(e));let n=[];for(let e=0;e>6|192),n.push(63&r|128);else if(55296==(64512&r)){e++;const i=t.charCodeAt(e);(0,s.MR)(e>18|240),n.push(o>>12&63|128),n.push(o>>6&63|128),n.push(63&o|128)}else n.push(r>>12|224),n.push(r>>6&63|128),n.push(63&r|128)}return new Uint8Array(n)}function u(t,e){return a(t,e).map((t=>t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode(55296+(t>>10&1023),56320+(1023&t))))).join("")}},88081:(t,e,n)=>{function r(t,e,n){const r=e.split("|").map((t=>t.trim()));for(let n=0;nPromise.resolve(t[e]))))).reduce(((t,n,r)=>(t[e[r]]=n,t)),{})}function i(t,e,n){for(let s in e){let i=e[s];const o=n?n[s]:null;o&&r(i,o,s),Object.defineProperty(t,s,{enumerable:!0,value:i,writable:!1})}}n.d(e,{k:()=>s,n:()=>i})},99381:(t,e,n)=>{n.d(e,{z:()=>s});var r=n(88081);class s{filter;emitter;#R;constructor(t,e,n){this.#R=e,(0,r.n)(this,{emitter:t,filter:n})}async removeListener(){null!=this.#R&&await this.emitter.off(this.filter,this.#R)}}},99770:(t,e,n)=>{n.d(e,{ck:()=>w,Js:()=>y,g5:()=>E,XS:()=>b});var r=n(57339),s=n(36212),i=n(27033),o=n(88081);const a=BigInt(-1),l=BigInt(0),u=BigInt(1),c=BigInt(5),h={};let f="0000";for(;f.length<80;)f+=f;function d(t){let e=f;for(;e.length=-e&&tl?(0,i.ST)((0,i.dK)(t,s),s):-(0,i.ST)((0,i.dK)(-t,s),s)}else{const e=u<=0&&tnull==i[t]?n:((0,r.MR)(typeof i[t]===e,"invalid fixed format ("+t+" not "+e+")","format."+t,i[t]),i[t]);e=o("signed","boolean",e),n=o("width","number",n),s=o("decimals","number",s)}(0,r.MR)(n%8==0,"invalid FixedNumber width (not byte aligned)","format.width",n),(0,r.MR)(s<=80,"invalid FixedNumber decimals (too large)","format.decimals",s);return{signed:e,width:n,decimals:s,name:(e?"":"u")+"fixed"+String(n)+"x"+String(s)}}class p{format;#U;#A;#N;_value;constructor(t,e,n){(0,r.gk)(t,h,"FixedNumber"),this.#A=e,this.#U=n;const s=function(t,e){let n="";t0?n*=d(r):r<0&&(e*=d(-r)),en?1:0}eq(t){return 0===this.cmp(t)}lt(t){return this.cmp(t)<0}lte(t){return this.cmp(t)<=0}gt(t){return this.cmp(t)>0}gte(t){return this.cmp(t)>=0}floor(){let t=this.#A;return this.#Al&&(t+=this.#N-u),t=this.#A/this.#N*this.#N,this.#I(t,"ceiling")}round(t){if(null==t&&(t=0),t>=this.decimals)return this;const e=this.decimals-t,n=c*d(e-1);let r=this.value+n;const s=d(e);return r=r/s*s,g(r,this.#U,"round"),new p(h,r,this.#U)}isZero(){return this.#A===l}isNegative(){return this.#A0){const e=d(u);(0,r.vA)(a%e===l,"value loses precision for format","NUMERIC_FAULT",{operation:"fromValue",fault:"underflow",value:t}),a/=e}else u<0&&(a*=d(-u));return g(a,o,"fromValue"),new p(h,a,o)}static fromString(t,e){const n=t.match(/^(-?)([0-9]*)\.?([0-9]*)$/);(0,r.MR)(n&&n[2].length+n[3].length>0,"invalid FixedNumber string value","value",t);const s=m(e);let i=n[2]||"0",o=n[3]||"";for(;o.length=0,"invalid unit","unit",e),n=3*t}else null!=e&&(n=(0,i.WZ)(e,"unit"));return p.fromValue(t,n,{decimals:n,width:512}).toString()}function b(t,e){(0,r.MR)("string"==typeof t,"value must be a string","value",t);let n=18;if("string"==typeof e){const t=v.indexOf(e);(0,r.MR)(t>=0,"invalid unit","unit",e),n=3*t}else null!=e&&(n=(0,i.WZ)(e,"unit"));return p.fromString(t,{decimals:n,width:512}).value}function w(t){return y(t,18)}function E(t){return b(t,18)}}}]);