1"use strict";(globalThis.webpackChunkui_stellar_expert||=[]).push([[62],{7062(e,t,n){n.d(t,{C:()=>g});var r=n(9007),i=n(19742),s=n.n(i),o=n(15685),a=n(76257),c=n(11173),u=n(10708),h=n(68315),d=n(38047),l=n(17236),f=n(31479);function w(e){return"ed25519"===e||"contract"===e||"muxed"===e}function m({type:e,address:t,name:n}){const r=function(e){if(window.predefinedAccountDisplayNames)return window.predefinedAccountDisplayNames[e]}(t);let i,s=(0,u.hH)(!r&&!n&&w(e)&&t);return!1===n?null:r?`[${r}] `:(s&&(n=s.name,s.tags.includes("malicious")&&(i=(0,f.jsx)("i",{className:"icon icon-warning color-warning",title:"This account was reported for illicit or fraudulent activity. Do not send funds to this address and do not trust any person affiliated with it."}))),n||i?(0,f.jsxs)(f.Fragment,{children:[n?`[${n}] `:"",i]}):null)}const g=r.memo(function e({account:t,chars:n=8,name:i,link:u,style:g,className:p,icon:y,prefix:x,suffix:$,network:b,...v}){(0,d.Dr)();const k=(0,l.Yi)(t);if(!k)return null;let{type:j,address:S,muxedId:_,publicKey:A,payload:L}=k,P=g||void 0,O=S;n&&"all"!==n&&(S=(0,o.l)(t,n));const z=(0,f.jsxs)(f.Fragment,{children:[x,!1!==y&&w(j)&&(0,f.jsx)(a.V,{address:O},"identicon"),(0,f.jsx)(m,{type:j,address:O,name:i}),(0,f.jsx)("span",{className:"account-key",children:S}),void 0!==_&&(0,f.jsxs)(c.I,{icon:"icon-plus",children:["Subaccount of a custodial account",(0,f.jsx)("br",{}),(0,f.jsx)(e,{account:O,name:!1,chars:12}),(0,f.jsxs)("div",{className:"dimmed text-tiny micro-space",children:["Multiplexed id: ",_.toString()]})]}),void 0!==L&&(0,f.jsxs)(c.I,{icon:"icon-plus",children:["ED25519 payload signer",(0,f.jsx)("br",{}),(0,f.jsx)(e,{account:A,name:!1,chars:12}),(0,f.jsxs)("div",{className:"dimmed text-tiny micro-space",children:["Payload: ",L]})]}),$]}),J={title:t,"aria-label":t,className:s()("account-address",p),style:P,...v};let U="span";return!1!==u&&w(j)&&(U="a","string"==typeof u?J.href=u:(J.href=(0,h.Z)("contract"===j?"contract":"account",t,b),window.origin!==explorerFrontendOrigin&&(J.target="_blank"))),r.createElement(U,J,z)})},76257(e,t,n){n.d(t,{V:()=>a,O:()=>o});var r=n(9007),i=n(31479);const s={};function o(e,t=448){const n=function(e){const t=[];let n=8,r=0;return e.toUpperCase().split("").forEach(e=>{const i=255&s[e];n-=5,n>0?r|=i<<n:n<0?(t.push(r|i>>-n),n+=8,r=i<<n&255):(t.push(r|i),n=8,r=0)}),8!==n&&0!==r&&(t.push(r),n=8,r=0),t}(e).slice(2,16),r=Math.ceil(3.5),i=t/7,o=n.slice(1),a=`hsl(${360*n[0]/256|0},58%,52%)`,c=[],u=` width="${i}" height="${i}"`;for(let e=0;e<7;e++)for(let t=0;t<r;t++){const n=t+e*r;!!(o[n/8|0]&1<<7-n%8)&&(c.push(`<rect x="${i*t}" y="${i*e}"${u}/>`),c.push(`<rect x="${i*(7-t-1)}" y="${i*e}"${u}/>`))}return`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${t} ${t}" fill="${a}">${c.join("")}</svg>`}"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567".split("").map((e,t)=>s[e]=t);const a=r.memo(function({address:e,size:t}){const n={className:"identicon",src:"data:image/svg+xml;charset=utf-8,"+o(e),width:448,height:448};return t&&(n.style={width:t,height:t}),(0,i.jsx)("img",{...n})})},92340(e,t,n){async function r(e){const t=`${explorerApiOrigin}/explorer/${e}`;try{const e=await fetch(t);if(!e.ok){let t;try{t=await e.json()}catch(e){t={}}const n=new Error(t?.error||e.statusText||"Failed to fetch data from the server");throw n.status=e.status,n.ext=t,n}return await e.json()}catch(e){return console.error(e),e instanceof Error&&(e={error:e.message,status:e.status||500,ext:e.ext}),e.ext&&e.ext.status&&(e.status=e.ext.status),e}}n.d(t,{i:()=>r})},83694(e,t,n){n.d(t,{L:()=>i});var r=n(34817);class i{constructor(e,t){this.pendingRequests={},this.requestsQueue=[],this.fetchDataFromServer=(0,r.n)(500,this.fetchDataFromServer,{noLeading:!0}),this.fetchCallback=e,this.processResponseCallback=t}pendingRequests;requestsQueue=[];fetchCallback;processResponseCallback;loadEntry(e){const t=this.pendingRequests[e];if(t)return t;const n=new Promise(t=>{this.requestsQueue.push({key:e,finished:n=>{delete this.pendingRequests[e],t(n)}}),this.fetchDataFromServer()});return this.pendingRequests[e]=n,n}fetchDataFromServer(){if(!this.requestsQueue.length)return;const e=this.requestsQueue.splice(0,50);return e.length?this.fetchCallback(e.map(e=>e.key)).then(t=>{if(t.error)return;this.requestsQueue.length&&setTimeout(()=>this.fetchDataFromServer(),400);const n={};for(const{key:t,finished:r}of e)n[t]=r;for(const e of t._embedded.records){const{key:t}=this.processResponseCallback(e),r=n[t];r&&r(e),delete n[t],delete this.pendingRequests[t]}for(const e of Object.keys(n)){const t=n[e];t&&t(null),delete this.pendingRequests[e]}}).catch(t=>{console.error(t);for(const{key:t,finished:n}of e)n(null),delete this.pendingRequests[t]}):void 0}}},88495(e,t,n){n.d(t,{w:()=>i});
1class r{constructor(e,t,n){this.data=e,this.ts=t,this.ttl=n,Object.freeze(this)}data;ts;ttl;get isExpired(){return(new Date).getTime()/1e3>this.ts+this.ttl}get isStale(){return(new Date).getTime()/1e3>this.ts+3*this.ttl}toJSON(){return{data:this.data,ts:this.ts,ttl:this.ttl}}}class i{constructor(e=120){this.cleanupInterval="number"==typeof e&&e>0?e:120,this.storage={}}cleanupInterval;storage;formatKey(e){return e}has(e){return!!this.get(e)}get(e){const t=this.formatKey(e),n=this.storage[t];return n?n.isStale?(delete this.storage[t],null):n:null}set(e,t,n){const i=new r(t,Math.round((new Date).getTime()/1e3),n||this.cleanupInterval);return this.storage[this.formatKey(e)]=i,i}keys(){return this.prune(),Object.keys(this.storage)}delete(e){delete this.storage[this.formatKey(e)]}clear(){this.storage={}}prune(){for(const e of Object.keys(this.storage))this.storage[e].isStale&&delete this.storage[e]}}},11173(e,t,n){n.d(t,{I:()=>h});var r=n(9007),i=n(46846),s=n.n(i),o=n(19742),a=n.n(o),c=n(19908),u=n(31479);const h=r.memo(function({children:e,link:t,icon:n="icon-help",...r}){return(0,u.jsxs)(c.m,{trigger:(0,u.jsx)("i",{className:a()("trigger icon info-tooltip text-small text-justify",n),...r}),maxWidth:"30em",children:[e,!!t&&(0,u.jsx)("a",{href:t,className:"info-tooltip-link",target:"_blank",children:"Read moreâ¦"})]})});h.propTypes={children:s().any.isRequired,link:s().string}},19908(e,t,n){n.d(t,{m:()=>u});var r=n(9007),i=n(19742),s=n.n(i),o=n(31479);function a(e,t,n,r){const{width:i,height:s}=c(t),{width:o,height:a}=c(e),{mouseX:u,mouseY:h}=function(e){const{width:t,height:n,top:r,left:i}=c(e);return{mouseX:i+t/2|0,mouseY:r+n/2|0}}(e),{offsetX:d,offsetY:l}=function(e){let t=0,n=0;for(let r in Object.keys(e)){const i=parseInt(e[r]);"top"===r?n-=i:"bottom"===r?n+=i:"left"===r?t-=i:"right"===r&&(t+=i)}return{offsetX:t,offsetY:n}}(r),f=function(e,t,n,r){const i=4;return{top:{l:-n/2,r:n/2,t:-t/2-r+i,b:-t/2},bottom:{l:-n/2,r:n/2,t:t/2-i,b:t/2+r},left:{l:-n-e/2+i,r:-e/2+i,t:-r/2,b:r/2},right:{l:e/2-i/2,r:n+e/2,t:-r/2,b:r/2}}}(o,a,i,s);function w(e){return u+f[e].l+d}function m(e){return h+f[e].t+l}function g(e){return w(e)<0||function(e){return u+f[e].r+d}(e)>window.innerWidth||m(e)<0||function(e){return h+f[e].b+l}(e)>window.innerHeight}let p="top";if(g(n)){const e=["top","bottom","left","right"].filter(e=>!g(e));e.length>0&&g(n)&&(p=e[0]||"top")}else p=n||"top";return{place:p,position:{top:m(p)+window.scrollY|0,left:i>=window.innerWidth?0:w(p)+window.scrollX|0}}}function c(e){const{width:t,height:n,top:r,left:i}=e.getBoundingClientRect();return{width:0|t,height:0|n,top:0|r,left:0|i}}const u=r.memo(function({trigger:e,desiredPlace:t="top",offset:n={},activation:i="hover",children:c,maxWidth:u,...h}){const[d,l]=(0,r.useState)(!1),[f,w]=(0,r.useState)(!1),[m,g]=(0,r.useState)("top"),[p,y]=(0,r.useState)({top:0,left:0}),x=(0,r.useRef)(null);function $(e){if(d)return;const{currentTarget:r}=e;w(!0),x.current.showPopover(),setTimeout(()=>{if(d)return;const{place:e,position:i}=a(r,x.current,t,n);l(!0),y(i),g(e)},400)}const b={onMouseLeave:function(e){d&&(x.current.hidePopover(),l(!1),w(!1))},...h};"hover"===i?b.onMouseEnter=$:b.onClick=$;const v={left:p.left+"px",top:p.top+"px"};return u&&(v.width="100vw",v.maxWidth=u),r.cloneElement(e,b,(0,o.jsx)("div",{ref:x,className:"tooltip-wrapper",style:v,popover:"auto",children:(0,o.jsx)("div",{className:s()("tooltip",m,{visible:d}),children:(0,o.jsx)("div",{className:"tooltip-content",children:f?c:null})})}))})},10708(e,t,n){n.d(t,{EC:()=>w,hH:()=>f,iF:()=>l});var r=n(9007),i=n(78668),s=n(88495),o=n(78965),a=n(92340),c=n(83694);const u=new s.w;function h(e){return!!e&&!(!i.L8.isValidEd25519PublicKey(e)&&!i.L8.isValidContract(e))}const d=new c.L(e=>(0,a.i)("directory"+(0,o._)({address:e})),e=>(u.set(e.address,e),{key:e.address,info:e}));async function l(e,t){const{forceRefresh:n=!1,extended:r=!1}=t||{};if(!h(e))return null;if(r)return(0,a.i)(`directory/${e}`+(0,o._)({extended:!0,s:Math.random().toString(36).substr(2)})).catch(e=>(console.error(e),null));if(n){const t=u.get(e);if(t&&!t.isExpired)return t.data}return d.loadEntry(e)}function f(e,t){const{forceRefresh:n=!1}=t||{},[i,s]=(0,r.useState)(null);let o=!1;return(0,r.useEffect)(function(){if(h(e)){if(!n){const t=u.get(e);if(t&&!t.isStale&&!t.isExpired)return s(t.data)}return d.loadEntry(e).then(e=>{o||s(e)}
1),()=>{o=!0}}},[e,n]),i}function w(){const[e,t]=(0,r.useState)(()=>{const e=u.get("tags");return e&&!e.isExpired?e.data:((0,a.i)("directory/tags").then(e=>{u.set("tags",e,600),t(e)}).catch(e=>console.error(e)),[])});return e}},68315(e,t,n){n.d(t,{Z:()=>i});var r=n(38047);function i(e,t,n=null){if("function"==typeof window.explorerLinkFormatter){const r=window.explorerLinkFormatter(e,t,n);if(r)return r}const i=[explorerFrontendOrigin!==window.origin?explorerFrontendOrigin:"","explorer",n||(0,r.TV)()];return e&&i.push(e),t&&i.push(t),i.join("/")}},17236(e,t,n){n.d(t,{Yi:()=>s,i5:()=>a});var r=n(31837),i=n(78668);function s(e){if("string"!=typeof e)return null;const t=e[0];try{switch(t){case"G":return o(e),{type:"ed25519",address:e};case"C":return o(e),{type:"contract",address:e};case"M":return{type:"muxed",...a(e)};case"X":return o(e),{type:"hash",address:e};case"T":return o(e),{type:"tx",address:e};case"P":const t=i.L8.decodeSignedPayload(e),s=(n=32,c(t).getUint32(n));return{type:"signedPayload",address:e,publicKey:i.L8.encodeEd25519PublicKey(t.subarray(0,32)),payload:r.MW(t.subarray(36,36+s),"hex")};default:return console.error(new Error("Unknown key prefix: "+typeof e)),null}}catch(e){return console.error(e),null}var n}function o(e,t=56){if(e.length!==t)throw new Error("Invalid key length: "+e)}function a(e){const t=i.L8.decodeMed25519PublicKey(e);return{address:i.L8.encodeEd25519PublicKey(t.subarray(0,32)),muxedId:c(t).getBigInt64(32)}}function c(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}},79755(e,t,n){n.d(t,{DH:()=>W,Gk:()=>P,HA:()=>A,KB:()=>S,KC:()=>F,OZ:()=>U,QT:()=>k,Qb:()=>w,RZ:()=>z,S8:()=>M,VV:()=>N,YO:()=>g,Yj:()=>E,ZZ:()=>V,bj:()=>Z,lc:()=>$,mP:()=>l,rI:()=>ee,uK:()=>B,w3:()=>D,zj:()=>i});const r="XdrError";class i extends Error{constructor(e){super(e),this.name=r}static[Symbol.hasInstance](e){return e instanceof Error&&e.name===r}}function s(e){return(4-e%4)%4}function o(e){if("object"!=typeof e||null===e)return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}function a(e,t){if(!Number.isInteger(e)||e<0||e>4294967295)throw new i(`${t}: expected uint32 length`)}function c(e,t,n,r){if("number"!=typeof e||!Number.isInteger(e)||e<t||e>n)throw new i(`${r}: expected integer in range ${t}..${n}`)}function u(e,t,n,r){if("bigint"!=typeof e||e<t||e>n)throw new i(`${r}: expected bigint in range ${t}..${n}`)}function h(e,t){if(!(e instanceof Uint8Array))throw new i(`${t}: expected Uint8Array`);try{Uint8Array.prototype.at.call(e,0)}catch{throw new i(`${t}: Uint8Array is detached or out of bounds`)}}function d(e,t){if(!Array.isArray(e))throw new i(`${t}: expected array`)}class l{#e=0;#t=0;#n;#r;#i;bytes;constructor(e,t=1500){if(t<0||!Number.isInteger(t))throw new i(`invalid maxDepth ${t}`);if(this.#n=t,!ArrayBuffer.isView(e)||1!==e.BYTES_PER_ELEMENT)throw new TypeError("Reader expects a Uint8Array");this.bytes=Object.getPrototypeOf(e)===Uint8Array.prototype?e:0===e.byteLength?new Uint8Array(0):new Uint8Array(e.buffer,e.byteOffset,e.byteLength),this.#r=this.bytes.buffer?.detached?new DataView(new ArrayBuffer(0)):new DataView(this.bytes.buffer,this.bytes.byteOffset,this.bytes.byteLength),this.#i=this.#r.byteLength}#s(e,t){if(this.remaining<e)throw new i(`${t}: incomplete XDR data at offset ${this.#e}, expected ${e} byte(s)`);const n=this.#e;return this.#e+=e,n}get offset(){return this.#e}get remaining(){return this.#i-this.#e}enter(e){if(this.#t+=1,this.#t>this.#n)throw this.#t-=1,new i(`${e}: max recursion depth ${this.#n} exceeded`)}exit(){this.#t-=1}done(e){if(0!==this.remaining)throw new i(`${e}: trailing ${this.remaining} byte(s) after XDR value`)}readBytes(e,t){if(e<0||!Number.isInteger(e))throw new i(`${t}: invalid byte length ${e}`);if(this.remaining<e)throw new i(`${t}: incomplete XDR data at offset ${this.#e}, expected ${e} byte(s)`);const n=this.bytes.slice(this.#e,this.#e+e);if(n.length!==e)throw new i(`${t}: input shrank during decode`);return this.#e+=e,n}skipPadding(e,t){if(e<0||!Number.isInteger(e))throw new i(`${t}: invalid byte length ${e}`);const n=s(e);if(0===n)return;const r=this.#s(n,t);for(let e=0;e<n;e++)if(0!==this.bytes[r+e])throw this.#e=r,new i(`${t}: non-zero XDR padding`)}readInt32(e){return this.#r.getInt32(this.#s(4,e),!1)}readUint32(e){return this.#r.getUint32(this.#s(4,e),!1)}readBigInt64(e){return this.#r.getBigInt64(this.#s(8,e),!1)}readBigUint64(e){return this.#r.getBigUint64(this.#s(8,e),!1)}readFloat32(e){return this.#r.getFloat32(this.#s(4,e),!1)}readFloat64(e){return this.#r.getFloat64(this.#s(8,e),!1)}}class f{#o=new Uint8Array(8192);#r=new DataView(this.#o.buffer);#e=0;#t=0;#n;constructor(e=1500){if(e<0||!Number.isInteger(e))throw new i(`invali
1d maxDepth ${e}`);this.#n=e}get offset(){return this.#e}enter(e){if(this.#t+=1,this.#t>this.#n)throw this.#t-=1,new i(`${e}: max recursion depth ${this.#n} exceeded`)}exit(){this.#t-=1}writeBytes(e){this.#a(e.length),this.#o.set(e,this.#e),this.#e+=e.length}writePadding(e){const t=s(e);t>0&&(this.#a(t),this.#o.fill(0,this.#e,this.#e+t),this.#e+=t)}writeInt32(e){const t=this.#c(4);this.#r.setInt32(t,e,!1),this.#e+=4}writeUint32(e){const t=this.#c(4);this.#r.setUint32(t,e,!1),this.#e+=4}writeBigInt64(e){const t=this.#c(8);this.#r.setBigInt64(t,e,!1),this.#e+=8}writeBigUint64(e){const t=this.#c(8);this.#r.setBigUint64(t,e,!1),this.#e+=8}writeFloat32(e){const t=this.#c(4);this.#r.setFloat32(t,e,!1),this.#e+=4}writeFloat64(e){const t=this.#c(8);this.#r.setFloat64(t,e,!1),this.#e+=8}#c(e){return this.#a(e),this.#e}toUint8Array(){return this.#o.slice(0,this.#e)}#a(e){const t=this.#e+e;if(t<=this.#o.length)return;let n=this.#o.length;for(;n<t;)n*=2;const r=new Uint8Array(n);r.set(this.#o),this.#o=r,this.#r=new DataView(r.buffer)}}class w{name;constructor(e=void 0){this.name=e}encode(e,t){const n=new f(t?.maxDepth);return this._write(e,n,this.name??this.kind),n.toUint8Array()}decode(e,t){const n=new l(e,t?.maxDepth),r=this._read(n,this.name??this.kind);return n.done(this.name??this.kind),r}
1validateXdr(e,t){try{return this.decode(e,t),!0}catch(e){if(e instanceof i)return!1;throw e}}validate(e){try{const t=new f;return this._write(e,t,this.name??this.kind),!0}catch(e){if(e instanceof i)return!1;throw e}}}class m extends w{kind="array";element;maxLength;constructor(e,t){super(),a(t,"array maxLength"),this.element=e,this.maxLength=t}_read(e,t){e.enter(t);try{const n=e.readUint32(t);if(n>this.maxLength)throw new i(`${t}: array length ${n} exceeds maximum ${this.maxLength}`);if(n>e.remaining)throw new i(`${t}: array length ${n} exceeds remaining ${e.remaining} byte(s)`);return p(e,n,this.element,t)}finally{e.exit()}}_write(e,t,n){t.enter(n);try{if(d(e,n),e.length>this.maxLength)throw new i(`${n}: array length ${e.length} exceeds maximum ${this.maxLength}`);t.writeUint32(e.length),y(e,t,this.element,n)}finally{t.exit()}}}function g(e,t){return new m(e,t)}function p(e,t,n,r){const s=[];for(let o=0;o<t;o+=1){const t=e.offset,a=n._read(e,`${r}[${o}]`);if(e.offset===t)throw new i(`${r}[${o}]: element type '${n.name??n.kind}' consumed no input; an array element must encode to at least one byte`);s.push(a)}return s}function y(e,t,n,r){let s=0;for(const o of e){const e=t.offset;if(n._write(o,t,`${r}[${s}]`),t.offset===e)throw new i(`${r}[${s}]: element type '${n.name??n.kind}' encoded to zero bytes; an array element must encode to at least one byte`);s+=1}}const x=new class extends w{kind="bool";_read(e,t){const n=e.readUint32(t);if(0===n)return!1;if(1===n)return!0;throw new i(`${t}: invalid bool discriminant ${n}`)}_write(e,t,n){if("boolean"!=typeof e)throw new i(`${n}: expected boolean`);t.writeUint32(e?1:0)}};function $(){return x}const b=new Set(["__proto__","name","kind","encode","decode","validate","_read","_write","nameByValue"]);class v extends w{kind="enum";nameByValue;#u=new Set;constructor(e,t){super(e);const n=new Map;for(const[r,s]of Object.entries(t)){if(c(s,-2147483648,2147483647,`${e}.${r}`),this.#u.has(s))throw new i(`${e}: duplicate enum value ${s}`);this.#u.add(s),n.set(s,r)}this.nameByValue=n}_read(e,t){const n=e.readInt32(t);if(!this.#u.has(n))throw new i(`${t}: unknown enum value ${n}`);return n}_write(e,t,n){if("number"!=typeof e||!this.#u.has(e))throw new i(`${n}: unknown enum value ${String(e)}`);t.writeInt32(e)}}function k(e,t){for(const n of Object.getOwnPropertyNames(t))if(b.has(n))throw new i(`${e}: enum member name ${n} collides with reserved property`);const n=new v(e,t);return Object.assign(n,t)}class j extends w{kind="fixedArray";element;length;constructor(e,t){super(),a(t,"fixedArray length"),this.element=e,this.length=t}_read(e,t){e.enter(t);try{if(this.length>e.remaining)throw new i(`${t}: array length ${this.length} exceeds remaining ${e.remaining} byte(s)`);return p(e,this.length,this.element,t)}finally{e.exit()}}_write(e,t,n){t.enter(n);try{if(d(e,n),e.length!==this.length)throw new i(`${n}: expected array length ${this.length}, got ${e.length}`);y(e,t,this.element,n)}finally{t.exit()}}}function S(e,t){return new j(e,t)}class _ extends w{kind="int32";_read(e,t){return e.readInt32(t)}_write(e,t,n){c(e,-2147483648,2147483647,n),t.writeInt32(e)}}function A(){return new _}class L extends w{kind="int64";_read(e,t){return e.readBigInt64(t)}_write(e,t,n){u(e,-(1n<<63n),(1n<<63n)-1n,n),t.writeBigInt64(e)}}function P(){return new L}class O extends w{kind="lazy";getSchema;constructor(e){super(),this.getSchema=e}_read(e,t){e.enter(t);try{return this.getSchema()._read(e,t)}finally{e.exit()}}_write(e,t,n){t.enter(n);try{this.getSchema()._write(e,t,n)}finally{t.exit()}}}function z(e){return new O(()=>e())}class J extends w{constructor(e,t){super(t),this.length=e,a(e,"opaque length")}length;kind="opaque";_read(e,t){const n=e.readBytes(this.length,t);return e.skipPadding(this.length,t),n}_write(e,t,n){if(h(e,n),e.length!==this.length)throw new i(`${n}: expected ${this.length} byte(s), got ${e.length}`);t.writeBytes(e),t.writePadding(e.length)}}function U(e,t){return new J(e,t)}class I extends w{kind="option";element;constructor(e){super(),this.element=e}_read(e,t){e.enter(t);try{if(!x._read(e,`${t}.present`))return null;const n=this.element._read(e,`${t}.value`);if(null===n)throw new i(`${t}: present option decoded to null, which is how an absent option is represented; wrap the element in a single-field struct to distinguish the two`);return n}finally{e.exit()}}_write(e,t,n){t.enter(n);try{x._write(null!==e,t,`${n}.present`),null!==e&&this.element._write(e,t,`${n}.value`)}finally{t.exit()}}}function B(e){if("option"===e.kind)throw new i("option: cannot nest option directly inside option, since an absent outer option and a present-but-absent inner one are both `null`; wrap the inner option in a single-field struct instead");return new I(e)}class C extends w{constructor(e){super(),this.maxLength=e,a(e,"string maxLength")}maxLength;kind="string";_read(e,t){const n=e.readUint32(t);if(n>this.maxLength)throw new i(`${t}: string byte length ${n} exceeds maximum ${this.maxLength}`);const r=e.readBytes(n,t);return e.skipPadding(n,t),r}_write(e,t,n){if(h(e,n),e.length>this.maxLength)throw new i(`${n}: string byte length ${e.length} exceeds maximum ${this.maxLength}`);t.writeUint32(e.length),t.writeBytes(e),t.writePadding(e.length)}}function E(e){return new C(e)}class X extends w{kind="struct";entries;constructor(e,t){if(super(e),Object.getOwnPropertyNames(t).includes("__proto__"))throw new i(`${e}: struct field name '__proto__' is not allowed`);this.entries=Object.entries(t)}_read(e,t){e.enter(t);try{const n={};for(const[r,i]of this.entries)n[r]=i._read(e,`${t}.${r}`);return n}finally{e.exit()}}_write(e,t,n){t.enter(n);try{if(!o(e))throw new i(`${n}: expected plain object`);const r=e;for(const[e,s]of this.entries){if(!Object.prototype.hasOwnProperty.call(r,e))throw new i(`${n}.${e}: missing struct field`);s._write(r[e],t,`${n}.${e}`)}}finally{t.exit()}}}function D(e,t){return new X(e,t)}class K extends w{kind="uint32";_read(e,t){return e.readUint32(t)}_write(e,t,n){c(e,0,4294967295,n),t.writeUint32(e)}}function M(){return new K}class q extends w{kind="uint64";_read(e,t){return e.readBigUint64(t)}_write(e,t,n){u(e,0n,(1n<<64n)-1n,n),t.writeBigUint64(e)}}function N(){return new q}const T="default";class R extends w{kind="union";switchOn;cases;defaultArm;switchKey;#h=new Map;
1constructor(e,t,n,r,s){if(super(e),"__proto__"===s)throw new i(`${e}: switchKey '__proto__' is not allowed`);if(this.switchOn=t,this.cases=n,this.defaultArm=r,this.switchKey=s,0===n.length&&void 0===r)throw new i(`${e}: union needs at least one case or a default arm`);const o=new Set;for(const r of n){if(!t.validate(r.discriminant))throw new i(`${e}.${r.name}: case discriminator ${String(r.discriminant)} is not a valid ${t.name??t.kind} value`);if(o.has(r.name))throw new i(`${e}: duplicate union case name ${r.name}`);if(o.add(r.name),this.#h.has(r.discriminant))throw new i(`${e}: duplicate union discriminator ${String(r.discriminant)}`);Y(e,r.name,r.arm,s),this.#h.set(r.discriminant,r)}void 0!==r&&Y(e,T,r,s)}_read(e,t){e.enter(t);try{const n=this.switchOn._read(e,`${t}.${this.switchKey}`),r=this.#h.get(n),s=r?.arm??this.defaultArm;if(void 0===s)throw new i(`${t}: no case for union discriminator ${String(n)}`);return function(e,t,n,r,i){const s={};if(s[n]=e,Q(t))return s[t.name]=t.schema._read(r,`${i}.${t.name}`),s;return t._read(r,i),s}(n,s,this.switchKey,e,`${t}.${r?.name??T}`)}finally{e.exit()}}_write(e,t,n){t.enter(n);try{if(!o(e)||!Object.prototype.hasOwnProperty.call(e,this.switchKey))throw new i(`${n}: expected union object with ${this.switchKey} discriminator`);const r=e,s=r[this.switchKey],a=this.#h.get(s),c=a?.arm??this.defaultArm;if(void 0===c)throw new i(`${n}: no case for union discriminator ${String(s)}`);this.switchOn._write(s,t,`${n}.${this.switchKey}`),function(e,t,n,r){if(Q(t)){if(!Object.prototype.hasOwnProperty.call(e,t.name))throw new i(`${r}.${t.name}: missing union arm payload`);return void t.schema._write(e[t.name],n,`${r}.${t.name}`)}t._write(void 0,n,r)}(r,c,t,`${n}.${a?.name??T}`)}finally{t.exit()}}}function V(e,t){return{kind:"field",name:e,schema:t}}function W(e,t,n){return{name:e,discriminant:t,arm:n}}function F(e,t){const n=t.switchKey??"type";return new R(e,t.switchOn,t.cases,t.defaultArm,n)}function Y(e,t,n,r){if(Q(n)&&n.name===r)throw new i(`${e}.${t}: union arm payload field must not be named ${r}`);if(Q(n)&&"__proto__"===n.name)throw new i(`${e}.${t}: union arm payload field name '__proto__' is not allowed`)}function Q(e){return"schema"in e}class H extends w{constructor(e,t){super(t),this.maxLength=e,a(e,"varOpaque maxLength")}maxLength;kind="varOpaque";_read(e,t){const n=e.readUint32(t);if(n>this.maxLength)throw new i(`${t}: opaque length ${n} exceeds maximum ${this.maxLength}`);const r=e.readBytes(n,t);return e.skipPadding(n,t),r}_write(e,t,n){if(h(e,n),e.length>this.maxLength)throw new i(`${n}: opaque length ${e.length} exceeds maximum ${this.maxLength}`);t.writeUint32(e.length),t.writeBytes(e),t.writePadding(e.length)}}function Z(e,t){return new H(e,t)}class G extends w{kind="void";_read(){}_write(e,t,n){if(void 0!==e)throw new i(`${n}: expected void`)}}function ee(){return new G}n.d(t,["dp",0,4294967295])},6233(e,t,n){function r(e){if("string"!=typeof e)throw new TypeError(`Expected \`string\`, got \`${typeof e}\``);const t=e.includes("-")||e.includes("_")?e.replace(/-/g,"+").replace(/_/g,"/"):e,n=atob(t),r=new Uint8Array(n.length);for(let e=0;e<n.length;e+=1)r[e]=n.charCodeAt(e);return r}n.d(t,{E:()=>r,Y:()=>i});function i(e){if(!(e instanceof Uint8Array))throw new TypeError(`Expected \`Uint8Array\`, got \`${typeof e}\``);let t="";for(let n=0;n<e.length;n+=65535){const r=e.subarray(n,n+65535);t+=btoa(String.fromCharCode.apply(null,r))}return t}},60027(e,t,n){n.d(t,{Mp:()=>c,QC:()=>g,Qs:()=>w,Wr:()=>f,YE:()=>m,Zv:()=>d,o0:()=>u,qT:()=>a,wd:()=>l});var r=n(79755);const i=(1n<<64n)-1n,s=1n<<127n,o=1n<<255n;function a(e,t){const n=BigInt(t);if(e){const e=1n<<n-1n;return[-e,e-1n]}return[0n,(1n<<n)-1n]}function c(e,t,n,i){const[s,o]=a(t,n);if(e<s||e>o)throw new r.zj(`${i}: value ${e} out of range [${s}, ${o}]`)}function u(e,t,n){const i=Math.ceil(.30103*t)+2;if(e.length>i)throw new r.zj(`${n}: decimal string length ${e.length} exceeds the ${i}-character budget for a ${t}-bit integer`)}const h=/^[+-]?[0-9]+$/;function d(e,t){if(!h.test(e))throw new r.zj(`${t}: "${e}" is not a decimal integer string`)}function l(e,t,n,i){if(!Number.isInteger(e))throw new r.zj(`${i}: value ${e} is not an integer`);const s=t?2**(n-1)-1:2**n-1,o=t?-2147483648:0;if(e<o||e>s)throw new r.zj(`${i}: value ${e} out of range [${o}, ${s}]`)}function f(e,t){const n=t&&e<0n?e+2n*s:e,r=n&i,o=n>>64n&i;return{hi:t?p(o):o,lo:r}}function w(e,t){const n=(t?y(e.hi):e.hi)<<64n|e.lo&i;return t&&n>=s?n-2n*s:n}function m(e,t){const n=t&&e<0n?e+2n*o:e,r=n&i,s=n>>64n&i,a=n>>128n&i,c=n>>192n&i;return{hiHi:t?p(c):c,hiLo:a,loHi:s,loLo:r}}function g(e,t){const n=(t?y(e.hiHi):e.hiHi)<<192n|(e.hiLo&i)<<128n|(e.loHi&i)<<64n|e.loLo&i;return t&&n>=o?n-2n*o:n}function p(e){return e>=1n<<63n?e-(1n<<64n):e}function y(e){return e<0n?e+(1n<<64n):e}}
1,6815(e,t,n){n.d(t,{G:()=>u,u:()=>o});var r=n(65836),i=n(79755);const s="0123456789abcdef";class o{bytes;constructor(e){if(e instanceof o)this.bytes=e.bytes.slice();else if("string"==typeof e)this.bytes=(new TextEncoder).encode(e);else{if(!(e instanceof Uint8Array))throw new TypeError("XdrString: expected string, Uint8Array, or XdrString");this.bytes=e}}get length(){return this.bytes.length}toStringStrict(){return new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0}).decode(this.bytes)}toString(){return new TextDecoder("utf-8",{fatal:!1,ignoreBOM:!0}).decode(this.bytes)}asStringOrBytes(){try{return this.toStringStrict()}catch{return this.bytes}}toJson(){let e="";for(let t=0;t<this.bytes.length;t+=1){const n=this.bytes[t];switch(n){case 0:e+="\\0";break;case 9:e+="\\t";break;case 10:e+="\\n";break;case 13:e+="\\r";break;case 92:e+="\\\\";break;default:e+=n>=32&&n<=126?String.fromCharCode(n):"\\x"+s[n>>4&15]+s[15&n]}}return e}toJSON(){return this.toJson()}static fromJson(e){const t=[];for(let n=0;n<e.length;n+=1){const r=e.charCodeAt(n);if(92===r){switch(e.charCodeAt(n+1)){case 92:t.push(92),n+=1;break;case 48:t.push(0),n+=1;break;case 116:t.push(9),n+=1;break;case 110:t.push(10),n+=1;break;case 114:t.push(13),n+=1;break;case 120:case 88:{if(n+3>=e.length)throw new i.zj(`XdrString: truncated \\x escape at index ${n}`);const r=a(e.charCodeAt(n+2)),s=a(e.charCodeAt(n+3));if(r<0||s<0)throw new i.zj(`XdrString: invalid \\x escape "${e.slice(n,n+4)}"`);t.push(r<<4|s),n+=3;break}default:throw new i.zj(`XdrString: unsupported escape \\${e[n+1]??""}`)}}else{if(!(r>=32&&r<=126))throw new i.zj(`XdrString: non-ASCII char (code 0x${r.toString(16)}) at index ${n}`);t.push(r)}}return new o(Uint8Array.from(t))}equals(e){return this===e||e instanceof o&&(0,r.areUint8ArraysEqual)(this.bytes,e.bytes)}}function a(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-65+10:e>=97&&e<=102?e-97+10:-1}class c extends i.Qb{kind="string";maxLength;#d;constructor(e){super(),this.maxLength=e,this.#d=(0,i.Yj)(e)}_read(e,t){return new o(this.#d._read(e,t))}_write(e,t,n){if(!(e instanceof o||"string"==typeof e||e instanceof Uint8Array))throw new i.zj(`${n}: expected string, Uint8Array, or XdrString`);const r=e instanceof o?e:new o(e);this.#d._write(r.bytes,t,n)}}function u(e){return new c(e)}},31837(e,t,n){n.d(t,{SD:()=>C,yj:()=>M,Vn:()=>E,MW:()=>K});var r=n(65836),i=n(6233),s=n(79755),o=n(6815);function a(e){let t="";for(let n=0;n<e.length;n+=1){const r=e[n],i=n>0?e[n-1]:"",s=n+1<e.length?e[n+1]:"",o=p(r)&&(g(i)||y(i)),a=p(r)&&p(i)&&g(s);n>0&&(o||a)&&(t+="_"),t+=r.toLowerCase()}return t}const c=new Set(["type","ref","move","box","self","match","loop","fn","mod","in","as"]);function u(e){return a(e)}function h(e){const t=a(e);return c.has(t)?`${t}_`:void 0}const d=new WeakMap,l=new WeakMap,f=new WeakMap;function w(e,t){const n=d.get(t);if(n)return n;const r=new Map,i=new Map;for(const n of t.values()){const t=a(e&&n.startsWith(e)?n.slice(e.length):n);r.set(n,t),i.set(t,n)}const s={bySource:r,byJson:i};return d.set(t,s),s}function m(e){const t=l.get(e);if(t)return t;const n=function(e){const t=e.switchOn,n=new Map,r=new Map;if("enum"===t.kind&&t.nameByValue){const i=w(t.memberPrefix,t.nameByValue);for(const s of e.cases){const e=t.nameByValue.get(s.discriminant),o=(e&&i.bySource.get(e))??a(s.name);n.set(s.name,o),r.set(o,s.name)}return{bySource:n,byJson:r}}if("int32"===t.kind||"uint32"===t.kind){for(const t of e.cases){const e="number"==typeof t.discriminant?`v${t.discriminant}`:a(t.name);n.set(t.name,e),r.set(e,t.name)}return{bySource:n,byJson:r}}for(const t of e.cases){const e=a(t.name);n.set(t.name,e),r.set(e,t.name)}return{bySource:n,byJson:r}}(e);return l.set(e,n),n}function g(e){return e>="a"&&e<="z"}function p(e){return e>="A"&&e<="Z"}function y(e){return e>="0"&&e<="9"}var x=n(60027),$=n(78668);const b=new Map;function v(e,t){const n=t.name?b.get(t.name):void 0;if(n)return n.toJson(e);const i=t;switch(i.kind){case"bool":case"int32":case"uint32":case"float":case"double":return e;case"void":return null;case"int64":case"uint64":return e.toString();case"string":return e.toJson();case"opaque":case"varOpaque":return(0,r.uint8ArrayToHex)(e);case"enum":{const n=i,r=n.nameByValue.get(e);if(void 0===r)throw new s.zj(`${t.name??"enum"}: unknown enum value ${String(e)}`);return w(n.memberPrefix,n.nameByValue).bySource.get(r)??r}case"option":return null===e?null:v(e,i.element);case"array":case"fixedArray":return e.map(e=>v(e,i.element));case"struct":{const t=e,n={};for(const[e,r]of i.entries)n[u(e)]=v(t[e],r);return n}case"union":{const n=e,r=n[i.switchKey],o=i.cases.find(e=>e.discriminant===r);if(void 0===o){if(void 0!==i.defaultArm)throw new s.zj(`${t.name??"union"}: default arms are not supported in JSON`);throw new s.zj(`${t.name??"union"}: no case for discriminator ${String(r)}`)}const a=o.arm,c=m(i).bySource.get(o.name)??o.name;return j(a)?{[c]:v(n[a.name],a.schema)}:c}case"lazy":return v(e,i.getSchema());default:throw new s.zj(`${t.name??t.kind}: toJson unsupported for kind ${t.kind}`)}}function k(e,t){const n=t.name?b.get(t.name):void 0;if(n)return n.fromJson(e);const i=t;switch(i.kind){case"bool":return _(e,"boolean",t),e;case"void":return;case"int32":case"uint32":{_(e,"number",t);const n=e,r="int32"===i.kind,o=r?-2147483648:0,a=r?2**31-1:2**32-1;if(!Number.isInteger(n)||n<o||n>a)throw new s.zj(`${t.name??i.kind}: value ${n} is not a valid ${i.kind}`);return n}case"float":case"double":return _(e,"number",t),e;case"int64":case"uint64":{let n;_(e,"string",t),(0,x.o0)(e,64,t.name??i.kind),(0,x.Zv)(e,t.name??i.kind);try{n=BigInt(e)}catch{throw new s.zj(`${t.name??i.kind}: "${e}" is not a valid ${i.kind}`)}return(0,x.Mp)(n,"int64"===i.kind,64,t.name??i.kind),n}case"string":{_(e,"string",t);const n=o.u.fromJson(e);if(n.length>i.maxLength)throw new s.zj(`${t.name??"string"}: length ${n.length} exceeds max ${i.maxLength}`);return n}case"opaque":case"varOpaque":{let n;_(e,"string",t);try{n=(0,r.hexToUint8Array)(e)}catch{throw new s.zj(`${t.name??i.kind}: expected a hex string`)}if("opaque"===i.kind&&n.length!==i.length)throw new s.zj(`${t.name??"opaque"}: expected ${i.length} byte(s), got ${n.length}`);if("varOpaque"===i.kind&&n.length>i.maxLength)throw new s.zj(`${t.name??"varOpaque"}: length ${n.length} exceeds max ${i.maxLength}`);return n}case"enum":{const n=i;_(e,"string",t);const r=e,o=w(n.memberPrefix,n.nameByValue).byJson.get(r);if(void 0!==o)for(const[e,t]of n.nameByValue)if(t===o)return e;throw new s.zj(`${t.name??"enum"}: unknown enum name ${r}`)}case"option":return null===e?null:k(e,i.element);case"array":if(!Array.isArray(e))throw new s.zj(`${t.name??"array"}: expected JSON array, got ${typeof e}`);if(e.length>i.maxLength)throw new s.zj(`${t.name??"array"}: length ${e.length} exceeds max ${i.maxLength}`);return e.map(e=>k(e,i.element));case"fixedArray":if(!Array.isArray(e))throw new s.zj(`${t.name??"fixedArray"}: expected JSON array, got ${typeof e}`);if(e.length!==i.length)throw new s.zj(`${t.name??"fixedArray"}: expected length ${i.length}, got ${e.length}`);return e.map(e=>k(e,i.element));case"struct":{if(!A(e))throw new s.zj(`${t.name??"struct"}: expected JSON object`);const n=e,r={},o=function(e){const t=f.get(e);if(t)return t;const n=new Set;for(const[t]of e){n.add(u(t));const e=h(t);void 0!==e&&n.add(e)}return f.set(e,n),n}(i.entries);for(const e of Object.keys(n))if(!o.has(e))throw new s.zj(`${t.name??"struct"}: unknown field ${e}`);for(const[e,o]of i.entries){const i=u(e),a=h(e);if(void 0!==a&&Object.hasOwn(n,i)&&Object.hasOwn(n,a))throw new s.zj(`${t.name??"struct"}: field ${e} given as both ${i} and ${a}`);const c=Object.hasOwn(n,i)?i:void 0!==a&&Object.hasOwn(n,a)?a:void 0;if(void 0===c){if("option"===S(o).kind){r[e]=null;continue}throw new s.zj(`${t.name??"struct"}: missing field ${i}`)}r[e]=k(n[c],o)}return r}case"union":return function(e,t){let n,r;if("string"==typeof e)n=e;else{if(!A(e))throw new s.zj(`${t.name??"union"}: expected string or single-key object`);{const i=Object.keys(e);if(1!==i.length)throw new s.zj(`${t.name??"union"}: expected single-key object, got ${i.length}`);n=i[0],r=e[n]}}const i=m(t),o=i.byJson.get(n),a=void 0===o?void 0:t.cases.find(e=>e.name===o);if(void 0===a){if(void 0!==t.defaultArm)throw new s.zj(`${t.name??"union"}: default arms are not supported in JSON`);throw new s.zj(`${t.name??"union"}: unknown case ${n}`)}const c=a.arm,u=a.discriminant,h={[t.switchKey]:u};
1if(j(c)){if(void 0===r)throw new s.zj(`${t.name??"union"}.${n}: missing arm payload`);h[c.name]=k(r,c.schema)}else if(null!=r)throw new s.zj(`${t.name??"union"}.${n}: unexpected payload for void arm`);return h}(e,i);case"lazy":return k(e,i.getSchema());default:throw new s.zj(`${t.name??t.kind}: fromJson unsupported for kind ${t.kind}`)}}function j(e){return"object"==typeof e&&null!==e&&"schema"in e}function S(e){let t=e;for(;"lazy"===t.kind;)t=t.getSchema();return t}function _(e,t,n){if(typeof e!==t)throw new s.zj(`${n.name??n.kind}: expected JSON ${t}, got ${typeof e}`)}function A(e){return!("object"!=typeof e||null===e||Array.isArray(e)||e instanceof Uint8Array)}function L(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function P(e){const t=new Uint8Array(40);return t.set(e.ed25519,0),L(t).setBigUint64(32,e.id),$.L8.encodeMed25519PublicKey(t)}function O(e){const t=$.L8.decodeMed25519PublicKey(e);return{id:L(t).getBigUint64(32),ed25519:t.subarray(0,32)}}function z(e){const t=new Uint8Array(36+((n=e.payload.length)+(4-n%4)%4));var n;return t.set(e.ed25519,0),L(t).setUint32(32,e.payload.length),t.set(e.payload,36),$.L8.encodeSignedPayload(t)}function J(e){const t=$.L8.decodeSignedPayload(e);return{ed25519:t.subarray(0,32),payload:t.subarray(36,36+L(t).getUint32(32))}}b.set("PublicKey",{toJson(e){const t=e;if(0!==t.type)throw new s.zj(`PublicKey: unsupported variant ${t.type} for JSON output`);return $.L8.encodeEd25519PublicKey(t.ed25519)},fromJson(e){if("string"!=typeof e)throw new s.zj("PublicKey: expected G-strkey string");return{type:0,ed25519:$.L8.decodeEd25519PublicKey(e)}}}),b.set("MuxedAccount",{toJson(e){const t=e;return 0===t.type?$.L8.encodeEd25519PublicKey(t.ed25519):P(t.med25519)},fromJson(e){if("string"!=typeof e)throw new s.zj("MuxedAccount: expected strkey string");if(e.startsWith("G"))return{type:0,ed25519:$.L8.decodeEd25519PublicKey(e)};if(e.startsWith("M"))return{type:256,med25519:O(e)};throw new s.zj(`MuxedAccount: unsupported strkey prefix in ${e}`)}});const U={toJson:e=>P(e),fromJson(e){if("string"!=typeof e)throw new s.zj("med25519 account: expected M-strkey string");return O(e)}};function I(e,t){let n=e.length;for(;n>t&&0===e[n-1];)n-=1;return n===e.length?e:e.slice(0,n)}function B(e,t){if(e.length>=t)return e;const n=new Uint8Array(t);return n.set(e),n}b.set("MuxedEd25519Account",U),b.set("MuxedAccountMed25519",U),b.set("SignerKey",{toJson(e){const t=e;switch(t.type){case 0:return $.L8.encodeEd25519PublicKey(t.ed25519);case 1:return $.L8.encodePreAuthTx(t.preAuthTx);case 2:return $.L8.encodeSha256Hash(t.hashX);case 3:return z(t.ed25519SignedPayload)}},fromJson(e){if("string"!=typeof e)throw new s.zj("SignerKey: expected strkey string");if(e.startsWith("G"))return{type:0,ed25519:$.L8.decodeEd25519PublicKey(e)};if(e.startsWith("T"))return{type:1,preAuthTx:$.L8.decodePreAuthTx(e)};if(e.startsWith("X"))return{type:2,hashX:$.L8.decodeSha256Hash(e)};if(e.startsWith("P"))return{type:3,ed25519SignedPayload:J(e)};throw new s.zj(`SignerKey: unsupported strkey prefix in ${e}`)}}),b.set("SignerKeyEd25519SignedPayload",{toJson:e=>z(e),fromJson(e){if("string"!=typeof e)throw new s.zj("SignerKeyEd25519SignedPayload: expected P-strkey string");return J(e)}}),b.set("ScAddress",{toJson(e){const t=e;switch(t.type){case 0:return $.L8.encodeEd25519PublicKey(t.accountId.ed25519);case 1:return $.L8.encodeContract(t.contractId);case 2:return P(t.muxedAccount);case 3:{const e=t.claimableBalanceId,n=new Uint8Array(33);return n.set(e.v0,1),$.L8.encodeClaimableBalance(n)}case 4:return $.L8.encodeLiquidityPool(t.liquidityPoolId)}},fromJson(e){if("string"!=typeof e)throw new s.zj("ScAddress: expected strkey string");if(e.startsWith("G"))return{type:0,accountId:{type:0,ed25519:$.L8.decodeEd25519PublicKey(e)}};if(e.startsWith("C"))return{type:1,contractId:$.L8.decodeContract(e)};if(e.startsWith("M"))return{type:2,muxedAccount:O(e)};if(e.startsWith("B")){const t=$.L8.decodeClaimableBalance(e);return{type:3,claimableBalanceId:{type:t[0],v0:t.subarray(1)}}}if(e.startsWith("L"))return{type:4,liquidityPoolId:$.L8.decodeLiquidityPool(e)};throw new s.zj(`ScAddress: unsupported strkey prefix in ${e}`)}}),b.set("ClaimableBalanceId",{toJson(e){const t=e,n=new Uint8Array(33);return n.set(t.v0,1),$.L8.encodeClaimableBalance(n)},fromJson(e){if("string"!=typeof e)throw new s.zj("ClaimableBalanceId: expected B-strkey string");const t=$.L8.decodeClaimableBalance(e);return{type:t[0],v0:t.subarray(1)}}}),b.set("PoolId",{toJson:e=>$.L8.encodeLiquidityPool(e),fromJson(e){if("string"!=typeof e)throw new s.zj("PoolId: expected L-strkey string");return $.L8.decodeLiquidityPool(e)}}),b.set("ContractId",{toJson:e=>$.L8.encodeContract(e),fromJson(e){if("string"!=typeof e)throw new s.zj("ContractId: expected C-strkey string");return $.L8.decodeContract(e)}}),b.set("AssetCode4",{toJson:e=>new o.u(I(e,0)).toJson(),fromJson(e){if("string"!=typeof e)throw new s.zj("AssetCode4: expected escaped-string JSON");return B(o.u.fromJson(e).bytes,4)}}),b.set("AssetCode12",{toJson:e=>new o.u(I(e,5)).toJson(),fromJson(e){if("string"!=typeof e)throw new s.zj("AssetCode12: expected escaped-string JSON");const t=o.u.fromJson(e).bytes;if(t.length<5)throw new s.zj("AssetCode12: code must be at least 5 bytes; use AssetCode4 for shorter codes");return B(t,12)}}),b.set("AssetCode",{toJson(e){const t=e;return void 0!==t.assetCode4?new o.u(I(t.assetCode4,0)).toJson():new o.u(I(t.assetCode12,5)).toJson()},fromJson(e){if("string"!=typeof e)throw new s.zj("AssetCode: expected escaped-string JSON");const t=o.u.fromJson(e).bytes;return t.length<=4?{type:1,assetCode4:B(t,4)}:{type:2,assetCode12:B(t,12)}}}),b.set("Int128Parts",{toJson:e=>(0,x.Qs)(e,!0).toString(),fromJson(e){if("string"!=typeof e)throw new s.zj("Int128Parts: expected decimal string");(0,x.o0)(e,128,"Int128Parts"),(0,x.Zv)(e,"Int128Parts");const t=BigInt(e);return(0,x.Mp)(t,!0,128,"Int128Parts"),(0,x.Wr)(t,!0)}}),b.set("Uint128Parts",{toJson:e=>(0,x.Qs)(e,!1).toString(),fromJson(e){if("string"!=typeof e)throw new s.zj("Uint128Parts: expected decimal string");(0,x.o0)(e,128,"Uint128Parts"),(0,x.Zv)(e,"Uint128Parts");const t=BigInt(e);return(0,x.Mp)(t,!1,128,"Uint128Parts"),(0,x.Wr)(t,!1)}}),b.set("Int256Parts",{toJson:e=>(0,x.QC)(e,!0).toString(),fromJson(e){if("string"!=typeof e)throw new s.zj("Int256Parts: expected decimal string");(0,x.o0)(e,256,"Int256Parts"),(0,x.Zv)(e,"Int256Parts");const t=BigInt(e);return(0,x.Mp)(t,!0,256,"Int256Parts"),(0,x.YE)(t,!0)}}),b.set("Uint256Parts",{toJson:e=>(0,x.QC)(e,!1).toString(),fromJson(e){if("string"!=typeof e)throw new s.zj("Uint256Parts: expected decimal string");(0,x.o0)(e,256,"Uint256Parts"),(0,x.Zv)(e,"Uint256Parts");const t=BigInt(e);return(0,x.Mp)(t,!1,256,"Uint256Parts"),(0,x.YE)(t,!1)}});class C{toXdr(e="raw"){const t=this.constructor;if(!t.schema)throw new s.zj(`${t.name}: missing static schema`);return K(t.schema.encode(this.toXdrObject()),e)}toXDR(e="raw"){return K(this.toXdr(),e)}toString(){return(0,i.Y)(this.toXdr())}toJson(){const e=this.constructor;if(!e.schema)throw new s.zj(`${e.name}: missing static schema`);return v(this.toXdrObject(),e.schema)}toJSON(){return this.toJson()}equals(e){return this===e||null!=e&&e instanceof C&&(this.constructor===e.constructor&&(0,r.areUint8ArraysEqual)(this.toXdr(),e.toXdr()))}static fromXdr(e,t){D(this,"fromXdr",!0);const n=M(e,t);return this.fromXdrObject(this.schema.decode(n))}static fromXDR(e,t){const n=M(e,t);return this.fromXdrObject(this.schema.decode(n))}static validateXdr(e,t){let n;D(this,"validateXdr");try{n=M(e,t)}catch{return!1}return this.schema.validateXdr(n)}static validateXDR(e,t){let n;try{n=M(e,t)}catch{return!1}return this.schema.validateXdr(n)}static fromJson(e){return D(this,"fromJson",!0),this.fromXdrObject(k(e,this.schema))}}function E(e,t,n){D(e,"decodeStream",!0);const r=new s.mP(M(t,n)),i=e.schema.name??e.name,o=[];for(;r.remaining>0;)o.push(e.fromXdrObject(e.schema._read(r,i)));return o}function X(e){return"function"==typeof e?e.name||"an anonymous function or class":null==e?String(e):"object"==typeof e?`an instance of ${e.constructor?.name||"an anonymous object"}`:"string"==typeof e?`the string "${e}"`:`the ${typeof e} ${String(e)}`}function D(e,t,n=!1){if(!e?.schema)throw new TypeError(`${t}: ${X(e)} has no static schema, so it is not a usable XDR type. Pass a generated class such as xdr.ScVal, or declare \`static readonly schema\` on a class of your own.`);if(n&&"function"!=typeof e.fromXdrObject)throw new TypeError(`${t}: ${X(e)} has a static schema but no static fromXdrObject, so it can encode but not decode. Declare \`static fromXdrObject(wire)\` on it.`)}function K(e,t){switch(t){case"raw":return e;case"hex":return(0,r.uint8ArrayToHex)(e);case"base64":return(0,i.Y)(e);default:throw new s.zj(`toXdr: unknown format "${String(t)}"`)}}function M(e,t){if(e instanceof Uint8Array)return e;if("string"!=typeof e)throw new TypeError("fromXdr: expected a string or Uint8Array, got "+typeof e);if(void 0===t||"raw"===t)throw new s.zj("fromXdr: string input requires format ('hex' | 'base64')");if("hex"===t||"base64"===t)try{return"hex"===t?(0,r.hexToUint8Array)(e):(0,i.E)(e)}
1catch{throw new s.zj(`invalid ${t} input`)}throw new s.zj(`fromXdr: unknown format "${String(t)}"`)}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.