diff --git a/docs/index.html b/docs/index.html index 95129cd..b8b8e8d 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1 +1 @@ -TON Multisig
Enter multisig address:
Multisig Address:
TON Balance:
Threshold:
Signers:
Proposers:
Order ID:
Order ID:
Order Type:
Order ID:
Signers:
Proposers:
Threshold:
Order ID:
Order Address:
TON Balance:
Executed:
Approvals:
Signers:
Expires At:
Actions:
or just send 0.1 TON with "approve" text comment to order address.
\ No newline at end of file +TON Multisig
Enter multisig address:
Multisig Address:
TON Balance:
Threshold:
Signers:
Proposers:
Order ID:
Order ID:
Order Type:
Order ID:
Signers:
Proposers:
Threshold:
Order ID:
Order Address:
TON Balance:
Executed:
Approvals:
Signers:
Expires At:
Actions:
or just send 0.1 TON with "approve" text comment to order address.
\ No newline at end of file diff --git a/docs/main.js b/docs/main.js index 2565f24..8f45ea6 100644 --- a/docs/main.js +++ b/docs/main.js @@ -1,5 +1,5 @@ /*! For license information please see main.js.LICENSE.txt */ -(()=>{var e={4061:function(e,t,r){"use strict";var n,i=r(8287).hp,o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ADNLAddress=void 0;const s=o(r(9107)),a=r(3721),l=r(2960);class c{static parseFriendly(e){if(55!==e.length)throw Error("Invalid address");e="f"+e;let t=(0,a.base32Decode)(e);if(45!==t[0])throw Error("Invalid address");let r=t.slice(33);if(!(0,l.crc16)(t.slice(0,33)).equals(r))throw Error("Invalid address");return new c(t.slice(1,33))}static parseRaw(e){const t=i.from(e,"base64");return new c(t)}constructor(e){if(this.toRaw=()=>this.address.toString("hex").toUpperCase(),this.toString=()=>{let e=i.concat([i.from([45]),this.address]),t=(0,l.crc16)(e);return e=i.concat([e,t]),(0,a.base32Encode)(e).slice(1)},this[n]=()=>this.toString(),32!==e.length)throw Error("Invalid address");this.address=e}equals(e){return this.address.equals(e.address)}}t.ADNLAddress=c,n=s.default},3512:function(e,t,r){"use strict";var n,i=r(8287).hp,o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.address=t.Address=void 0;const s=o(r(9107)),a=r(2960);function l(e){if("string"==typeof e&&!c.isFriendly(e))throw new Error("Unknown address type");const t=i.isBuffer(e)?e:i.from(e,"base64");if(36!==t.length)throw new Error("Unknown address type: byte length is not equal to 36");const r=t.subarray(0,34),n=t.subarray(34,36),o=(0,a.crc16)(r);if(o[0]!==n[0]||o[1]!==n[1])throw new Error("Invalid checksum: "+e);let s=r[0],l=!1,d=!1;if(128&s&&(l=!0,s^=128),17!==s&&81!==s)throw"Unknown address tag";d=17===s;let u=null;return u=255===r[1]?-1:r[1],{isTestOnly:l,isBounceable:d,workchain:u,hashPart:r.subarray(2,34)}}class c{static isAddress(e){return e instanceof c}static isFriendly(e){return 48===e.length&&!!/[A-Za-z0-9+/_-]+/.test(e)}static isRaw(e){if(-1===e.indexOf(":"))return!1;let[t,r]=e.split(":");return!!Number.isInteger(parseFloat(t))&&!!/[a-f0-9]+/.test(r.toLowerCase())&&64===r.length}static normalize(e){return"string"==typeof e?c.parse(e).toString():e.toString()}static parse(e){if(c.isFriendly(e))return this.parseFriendly(e).address;if(c.isRaw(e))return this.parseRaw(e);throw new Error("Unknown address type: "+e)}static parseRaw(e){let t=parseInt(e.split(":")[0]),r=i.from(e.split(":")[1],"hex");return new c(t,r)}static parseFriendly(e){if(i.isBuffer(e)){let t=l(e);return{isBounceable:t.isBounceable,isTestOnly:t.isTestOnly,address:new c(t.workchain,t.hashPart)}}{let t=l(e.replace(/\-/g,"+").replace(/_/g,"/"));return{isBounceable:t.isBounceable,isTestOnly:t.isTestOnly,address:new c(t.workchain,t.hashPart)}}}constructor(e,t){if(this.toRawString=()=>this.workChain+":"+this.hash.toString("hex"),this.toRaw=()=>{const e=i.alloc(36);return e.set(this.hash),e.set([this.workChain,this.workChain,this.workChain,this.workChain],32),e},this.toStringBuffer=e=>{let t=!(!e||void 0===e.testOnly)&&e.testOnly,r=!e||void 0===e.bounceable||e.bounceable?17:81;t&&(r|=128);const n=i.alloc(34);n[0]=r,n[1]=this.workChain,n.set(this.hash,2);const o=i.alloc(36);return o.set(n),o.set((0,a.crc16)(n),34),o},this.toString=e=>{let t=!e||void 0===e.urlSafe||e.urlSafe,r=this.toStringBuffer(e);return t?r.toString("base64").replace(/\+/g,"-").replace(/\//g,"_"):r.toString("base64")},this[n]=()=>this.toString(),32!==t.length)throw new Error("Invalid address hash length: "+t.length);this.workChain=e,this.hash=t,Object.freeze(this)}equals(e){return e.workChain===this.workChain&&e.hash.equals(this.hash)}}t.Address=c,n=s.default,t.address=function(e){return c.parse(e)}},1629:function(e,t,r){"use strict";var n,i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ExternalAddress=void 0;const o=i(r(9107));class s{static isAddress(e){return e instanceof s}constructor(e,t){this[n]=()=>this.toString(),this.value=e,this.bits=t}toString(){return`External<${this.bits}:${this.value}>`}}t.ExternalAddress=s,n=o.default},8986:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.contractAddress=void 0;const n=r(5871),i=r(2738),o=r(3512);t.contractAddress=function(e,t){let r=(0,n.beginCell)().store((0,i.storeStateInit)(t)).endCell().hash();return new o.Address(e,r)}},9924:(e,t,r)=>{"use strict";var n=r(8287).hp;Object.defineProperty(t,"__esModule",{value:!0}),t.BitBuilder=void 0;const i=r(3512),o=r(1629),s=r(2386);t.BitBuilder=class{constructor(e=1023){this._buffer=n.alloc(Math.ceil(e/8)),this._length=0}get length(){return this._length}writeBit(e){let t=this._length;if(t>8*this._buffer.length)throw new Error("BitBuilder overflow");("boolean"==typeof e&&!0===e||"number"==typeof e&&e>0)&&(this._buffer[t/8|0]|=1<<7-t%8),this._length++}writeBits(e){for(let t=0;t8*this._buffer.length)throw new Error("BitBuilder overflow");e.copy(this._buffer,this._length/8),this._length+=8*e.length}else for(let t=0;t=n)throw Error(`bitLength is too small for a value ${e}. Got ${t}`);if(this._length+t>8*this._buffer.length)throw new Error("BitBuilder overflow");const i=8-this._length%8;if(i>0){const e=Math.floor(this._length/8);if(t>BigInt(t-i));this._buffer[e]|=n,this._length+=i}}for(t-=i;t>0;)t>=8?(this._buffer[this._length/8]=Number(r>>BigInt(t-8)&0xffn),this._length+=8,t-=8):(this._buffer[this._length/8]=Number(r<=n)throw Error(`value is out of range for ${t} bits. Got ${e}`);r<0?(this.writeBit(!0),r=n+r):this.writeBit(!1),this.writeUint(r,t-1)}writeVarUint(e,t){let r=BigInt(e);if(t<0||!Number.isSafeInteger(t))throw Error(`invalid bit length. Got ${t}`);if(r<0)throw Error(`value is negative. Got ${e}`);if(0n===r)return void this.writeUint(0,t);const n=Math.ceil(r.toString(2).length/8),i=8*n;this.writeUint(n,t),this.writeUint(r,i)}writeVarInt(e,t){let r=BigInt(e);if(t<0||!Number.isSafeInteger(t))throw Error(`invalid bit length. Got ${t}`);if(0n===r)return void this.writeUint(0,t);let n=r>0?r:-r;const i=1+Math.ceil(n.toString(2).length/8),o=8*i;this.writeUint(i,t),this.writeInt(r,o)}writeCoins(e){this.writeVarUint(e,4)}writeAddress(e){if(null!=e){if(i.Address.isAddress(e))return this.writeUint(2,2),this.writeUint(0,1),this.writeInt(e.workChain,8),void this.writeBuffer(e.hash);if(o.ExternalAddress.isAddress(e))return this.writeUint(1,2),this.writeUint(e.bits,9),void this.writeUint(e.value,e.bits);throw Error(`Invalid address. Got ${e}`)}this.writeUint(0,2)}build(){return new s.BitString(this._buffer,0,this._length)}buffer(){if(this._length%8!=0)throw new Error("BitBuilder buffer is not byte aligned");return this._buffer.subarray(0,this._length/8)}}},3528:(e,t,r)=>{"use strict";var n=r(8287).hp;Object.defineProperty(t,"__esModule",{value:!0}),t.BitReader=void 0;const i=r(3512),o=r(1629);class s{constructor(e,t=0){this._checkpoints=[],this._bits=e,this._offset=t}get offset(){return this._offset}get remaining(){return this._bits.length-this._offset}skip(e){if(e<0||this._offset+e>this._bits.length)throw new Error(`Index ${this._offset+e} is out of bounds`);this._offset+=e}reset(){this._checkpoints.length>0?this._offset=this._checkpoints.pop():this._offset=0}save(){this._checkpoints.push(this._offset)}loadBit(){let e=this._bits.at(this._offset);return this._offset++,e}preloadBit(){return this._bits.at(this._offset)}loadBits(e){let t=this._bits.substring(this._offset,e);return this._offset+=e,t}preloadBits(e){return this._bits.substring(this._offset,e)}loadBuffer(e){let t=this._preloadBuffer(e,this._offset);return this._offset+=8*e,t}preloadBuffer(e){return this._preloadBuffer(e,this._offset)}loadUint(e){return Number(this.loadUintBig(e))}loadUintBig(e){let t=this.preloadUintBig(e);return this._offset+=e,t}preloadUint(e){return Number(this._preloadUint(e,this._offset))}preloadUintBig(e){return this._preloadUint(e,this._offset)}loadInt(e){let t=this._preloadInt(e,this._offset);return this._offset+=e,Number(t)}loadIntBig(e){let t=this._preloadInt(e,this._offset);return this._offset+=e,t}preloadInt(e){return Number(this._preloadInt(e,this._offset))}preloadIntBig(e){return this._preloadInt(e,this._offset)}loadVarUint(e){let t=Number(this.loadUint(e));return Number(this.loadUintBig(8*t))}loadVarUintBig(e){let t=Number(this.loadUint(e));return this.loadUintBig(8*t)}preloadVarUint(e){let t=Number(this._preloadUint(e,this._offset));return Number(this._preloadUint(8*t,this._offset+e))}preloadVarUintBig(e){let t=Number(this._preloadUint(e,this._offset));return this._preloadUint(8*t,this._offset+e)}loadVarInt(e){let t=Number(this.loadUint(e));return Number(this.loadIntBig(8*t))}loadVarIntBig(e){let t=Number(this.loadUint(e));return this.loadIntBig(8*t)}preloadVarInt(e){let t=Number(this._preloadUint(e,this._offset));return Number(this._preloadInt(8*t,this._offset+e))}preloadVarIntBig(e){let t=Number(this._preloadUint(e,this._offset));return this._preloadInt(8*t,this._offset+e)}loadCoins(){return this.loadVarUintBig(4)}preloadCoins(){return this.preloadVarUintBig(4)}loadAddress(){let e=Number(this._preloadUint(2,this._offset));if(2===e)return this._loadInternalAddress();throw new Error("Invalid address: "+e)}loadMaybeAddress(){let e=Number(this._preloadUint(2,this._offset));if(0===e)return this._offset+=2,null;if(2===e)return this._loadInternalAddress();throw new Error("Invalid address")}loadExternalAddress(){if(1===Number(this._preloadUint(2,this._offset)))return this._loadExternalAddress();throw new Error("Invalid address")}loadMaybeExternalAddress(){let e=Number(this._preloadUint(2,this._offset));if(0===e)return this._offset+=2,null;if(1===e)return this._loadExternalAddress();throw new Error("Invalid address")}loadAddressAny(){let e=Number(this._preloadUint(2,this._offset));if(0===e)return this._offset+=2,null;if(2===e)return this._loadInternalAddress();if(1===e)return this._loadExternalAddress();throw 3===e?Error("Unsupported"):Error("Unreachable")}loadPaddedBits(e){if(e%8!=0)throw new Error("Invalid number of bits");let t=e;for(;;){if(this._bits.at(this._offset+t-1)){t--;break}t--}let r=this._bits.substring(this._offset,t);return this._offset+=e,r}clone(){return new s(this._bits,this._offset)}_preloadInt(e,t){if(0==e)return 0n;let r=this._bits.at(t),n=0n;for(let r=0;rthis.toString(),r<0)throw new Error(`Length ${r} is out of bounds`);this._length=r,this._data=e,this._offset=t}get length(){return this._length}at(e){if(e>=this._length)throw new Error(`Index ${e} > ${this._length} is out of bounds`);if(e<0)throw new Error(`Index ${e} < 0 is out of bounds`);let t=this._offset+e>>3,r=7-(this._offset+e)%8;return!!(this._data[t]&1<this._length)throw new Error(`Offset(${e}) > ${this._length} is out of bounds`);if(e<0)throw new Error(`Offset(${e}) < 0 is out of bounds`);if(0===t)return l.EMPTY;if(e+t>this._length)throw new Error(`Offset ${e} + Length ${t} > ${this._length} is out of bounds`);return new l(this._data,this._offset+e,t)}subbuffer(e,t){if(e>this._length)throw new Error(`Offset ${e} is out of bounds`);if(e<0)throw new Error(`Offset ${e} is out of bounds`);if(e+t>this._length)throw new Error(`Offset + Lenght = ${e+t} is out of bounds`);if(t%8!=0)return null;if((this._offset+e)%8!=0)return null;let r=this._offset+e>>3,n=r+(t>>3);return this._data.subarray(r,n)}equals(e){if(this._length!==e._length)return!1;for(let t=0;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Builder=t.beginCell=void 0;const n=r(9924),i=r(6902),o=r(9556);function s(){return new a}t.beginCell=s;class a{constructor(){this._bits=new n.BitBuilder,this._refs=[]}get bits(){return this._bits.length}get refs(){return this._refs.length}get availableBits(){return 1023-this.bits}get availableRefs(){return 4-this.refs}storeBit(e){return this._bits.writeBit(e),this}storeBits(e){return this._bits.writeBits(e),this}storeBuffer(e,t){if(null!=t&&e.length!==t)throw Error(`Buffer length ${e.length} is not equal to ${t}`);return this._bits.writeBuffer(e),this}storeMaybeBuffer(e,t){return null!==e?(this.storeBit(1),this.storeBuffer(e,t)):this.storeBit(0),this}storeUint(e,t){return this._bits.writeUint(e,t),this}storeMaybeUint(e,t){return null!=e?(this.storeBit(1),this.storeUint(e,t)):this.storeBit(0),this}storeInt(e,t){return this._bits.writeInt(e,t),this}storeMaybeInt(e,t){return null!=e?(this.storeBit(1),this.storeInt(e,t)):this.storeBit(0),this}storeVarUint(e,t){return this._bits.writeVarUint(e,t),this}storeMaybeVarUint(e,t){return null!=e?(this.storeBit(1),this.storeVarUint(e,t)):this.storeBit(0),this}storeVarInt(e,t){return this._bits.writeVarInt(e,t),this}storeMaybeVarInt(e,t){return null!=e?(this.storeBit(1),this.storeVarInt(e,t)):this.storeBit(0),this}storeCoins(e){return this._bits.writeCoins(e),this}storeMaybeCoins(e){return null!=e?(this.storeBit(1),this.storeCoins(e)):this.storeBit(0),this}storeAddress(e){return this._bits.writeAddress(e),this}storeRef(e){if(this._refs.length>=4)throw new Error("Too many references");if(e instanceof i.Cell)this._refs.push(e);else{if(!(e instanceof a))throw new Error("Invalid argument");this._refs.push(e.endCell())}return this}storeMaybeRef(e){return e?(this.storeBit(1),this.storeRef(e)):this.storeBit(0),this}storeSlice(e){let t=e.clone();for(t.remainingBits>0&&this.storeBits(t.loadBits(t.remainingBits));t.remainingRefs>0;)this.storeRef(t.loadRef());return this}storeMaybeSlice(e){return e?(this.storeBit(1),this.storeSlice(e)):this.storeBit(0),this}storeBuilder(e){return this.storeSlice(e.endCell().beginParse())}storeMaybeBuilder(e){return e?(this.storeBit(1),this.storeBuilder(e)):this.storeBit(0),this}storeWritable(e){return"object"==typeof e?e.writeTo(this):e(this),this}storeMaybeWritable(e){return e?(this.storeBit(1),this.storeWritable(e)):this.storeBit(0),this}store(e){return this.storeWritable(e),this}storeStringTail(e){return(0,o.writeString)(e,this),this}storeMaybeStringTail(e){return null!=e?(this.storeBit(1),(0,o.writeString)(e,this)):this.storeBit(0),this}storeStringRefTail(e){return this.storeRef(s().storeStringTail(e)),this}storeMaybeStringRefTail(e){return null!=e?(this.storeBit(1),this.storeStringRefTail(e)):this.storeBit(0),this}storeDict(e,t,r){return e?e.store(this,t,r):this.storeBit(0),this}storeDictDirect(e,t,r){return e.storeDirect(this,t,r),this}endCell(e){return new i.Cell({bits:this._bits.build(),refs:this._refs,exotic:e?.exotic})}asCell(){return this.endCell()}asSlice(){return this.endCell().beginParse()}}t.Builder=a},6902:function(e,t,r){"use strict";var n,i=r(8287).hp,o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Cell=void 0;const s=o(r(9107)),a=r(2386),l=r(4654),c=r(6906),d=r(2231),u=r(2938),h=r(5229),f=r(3528),p=r(5871);class g{static fromBoc(e){return(0,h.deserializeBoc)(e)}static fromBase64(e){let t=g.fromBoc(i.from(e,"base64"));if(1!==t.length)throw new Error("Deserialized more than one cell");return t[0]}constructor(e){this._hashes=[],this._depths=[],this.beginParse=(e=!1)=>{if(this.isExotic&&!e)throw new Error("Exotic cells cannot be parsed");return new c.Slice(new f.BitReader(this.bits),this.refs)},this.hash=(e=3)=>this._hashes[Math.min(this._hashes.length-1,e)],this.depth=(e=3)=>this._depths[Math.min(this._depths.length-1,e)],this.level=()=>this.mask.level,this.equals=e=>this.hash().equals(e.hash()),this[n]=()=>this.toString();let t=a.BitString.EMPTY;e&&e.bits&&(t=e.bits);let r,i,o,s=[];e&&e.refs&&(s=[...e.refs]);let h=l.CellType.Ordinary;if(e&&e.exotic){let e=(0,d.resolveExotic)(t,s),n=(0,u.wonderCalculator)(e.type,t,s);o=n.mask,i=n.depths,r=n.hashes,h=e.type}else{if(s.length>4)throw new Error("Invalid number of references");if(t.length>1023)throw new Error(`Bits overflow: ${t.length} > 1023`);let e=(0,u.wonderCalculator)(l.CellType.Ordinary,t,s);o=e.mask,i=e.depths,r=e.hashes,h=l.CellType.Ordinary}this.type=h,this.bits=t,this.refs=s,this.mask=o,this._depths=i,this._hashes=r,Object.freeze(this),Object.freeze(this.refs),Object.freeze(this.bits),Object.freeze(this.mask),Object.freeze(this._depths),Object.freeze(this._hashes)}get isExotic(){return this.type!==l.CellType.Ordinary}toBoc(e){let t=!(!e||null===e.idx||void 0===e.idx)&&e.idx,r=!e||null===e.crc32||void 0===e.crc32||e.crc32;return(0,h.serializeBoc)(this,{idx:t,crc32:r})}toString(e){let t=e||"",r="x";this.isExotic&&(this.type===l.CellType.MerkleProof?r="p":this.type===l.CellType.MerkleUpdate?r="u":this.type===l.CellType.PrunedBranch&&(r="p"));let n=t+(this.isExotic?r:"x")+"{"+this.bits.toString()+"}";for(let e in this.refs)n+="\n"+this.refs[e].toString(t+" ");return n}asSlice(){return this.beginParse()}asBuilder(){return(0,p.beginCell)().storeSlice(this.asSlice())}}t.Cell=g,n=s.default,g.EMPTY=new g},4654:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.CellType=void 0,function(e){e[e.Ordinary=-1]="Ordinary",e[e.PrunedBranch=1]="PrunedBranch",e[e.Library=2]="Library",e[e.MerkleProof=3]="MerkleProof",e[e.MerkleUpdate=4]="MerkleUpdate"}(r||(t.CellType=r={}))},6906:function(e,t,r){"use strict";var n,i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Slice=void 0;const o=i(r(9107)),s=r(7590),a=r(5871),l=r(9556);class c{constructor(e,t){this[n]=()=>this.toString(),this._reader=e.clone(),this._refs=[...t],this._refsOffset=0}get remainingBits(){return this._reader.remaining}get offsetBits(){return this._reader.offset}get remainingRefs(){return this._refs.length-this._refsOffset}get offsetRefs(){return this._refsOffset}skip(e){return this._reader.skip(e),this}loadBit(){return this._reader.loadBit()}preloadBit(){return this._reader.preloadBit()}loadBoolean(){return this.loadBit()}loadMaybeBoolean(){return this.loadBit()?this.loadBoolean():null}loadBits(e){return this._reader.loadBits(e)}preloadBits(e){return this._reader.preloadBits(e)}loadUint(e){return this._reader.loadUint(e)}loadUintBig(e){return this._reader.loadUintBig(e)}preloadUint(e){return this._reader.preloadUint(e)}preloadUintBig(e){return this._reader.preloadUintBig(e)}loadMaybeUint(e){return this.loadBit()?this.loadUint(e):null}loadMaybeUintBig(e){return this.loadBit()?this.loadUintBig(e):null}loadInt(e){return this._reader.loadInt(e)}loadIntBig(e){return this._reader.loadIntBig(e)}preloadInt(e){return this._reader.preloadInt(e)}preloadIntBig(e){return this._reader.preloadIntBig(e)}loadMaybeInt(e){return this.loadBit()?this.loadInt(e):null}loadMaybeIntBig(e){return this.loadBit()?this.loadIntBig(e):null}loadVarUint(e){return this._reader.loadVarUint(e)}loadVarUintBig(e){return this._reader.loadVarUintBig(e)}preloadVarUint(e){return this._reader.preloadVarUint(e)}preloadVarUintBig(e){return this._reader.preloadVarUintBig(e)}loadVarInt(e){return this._reader.loadVarInt(e)}loadVarIntBig(e){return this._reader.loadVarIntBig(e)}preloadVarInt(e){return this._reader.preloadVarInt(e)}preloadVarIntBig(e){return this._reader.preloadVarIntBig(e)}loadCoins(){return this._reader.loadCoins()}preloadCoins(){return this._reader.preloadCoins()}loadMaybeCoins(){return this._reader.loadBit()?this._reader.loadCoins():null}loadAddress(){return this._reader.loadAddress()}loadMaybeAddress(){return this._reader.loadMaybeAddress()}loadExternalAddress(){return this._reader.loadExternalAddress()}loadMaybeExternalAddress(){return this._reader.loadMaybeExternalAddress()}loadAddressAny(){return this._reader.loadAddressAny()}loadRef(){if(this._refsOffset>=this._refs.length)throw new Error("No more references");return this._refs[this._refsOffset++]}preloadRef(){if(this._refsOffset>=this._refs.length)throw new Error("No more references");return this._refs[this._refsOffset]}loadMaybeRef(){return this.loadBit()?this.loadRef():null}preloadMaybeRef(){return this.preloadBit()?this.preloadRef():null}loadBuffer(e){return this._reader.loadBuffer(e)}preloadBuffer(e){return this._reader.preloadBuffer(e)}loadStringTail(){return(0,l.readString)(this)}loadMaybeStringTail(){return this.loadBit()?(0,l.readString)(this):null}loadStringRefTail(){return(0,l.readString)(this.loadRef().beginParse())}loadMaybeStringRefTail(){const e=this.loadMaybeRef();return e?(0,l.readString)(e.beginParse()):null}loadDict(e,t){return s.Dictionary.load(e,t,this)}loadDictDirect(e,t){return s.Dictionary.loadDirect(e,t,this)}endParse(){if(this.remainingBits>0||this.remainingRefs>0)throw new Error("Slice is not empty")}asCell(){return(0,a.beginCell)().storeSlice(this).endCell()}asBuilder(){return(0,a.beginCell)().storeSlice(this)}clone(e=!1){if(e){let e=this._reader.clone();return e.reset(),new c(e,this._refs)}{let e=new c(this._reader,this._refs);return e._refsOffset=this._refsOffset,e}}toString(){return this.asCell().toString()}}t.Slice=c,n=o.default},555:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LevelMask=void 0;class r{constructor(e=0){var t;this._mask=0,this._mask=e,this._hashIndex=(t=this._mask,16843009*((t=(858993459&(t-=t>>1&1431655765))+(t>>2&858993459))+(t>>4)&252645135)>>24),this._hashCount=this._hashIndex+1}get value(){return this._mask}get level(){return 32-Math.clz32(this._mask)}get hashIndex(){return this._hashIndex}get hashCount(){return this._hashCount}apply(e){return new r(this._mask&(1<>e-1)%2!=0}}t.LevelMask=r},9896:(e,t,r)=>{"use strict";var n=r(8287).hp;Object.defineProperty(t,"__esModule",{value:!0}),t.getRepr=t.getBitsDescriptor=t.getRefsDescriptor=void 0;const i=r(4654),o=r(4382);function s(e,t,r){return e.length+8*(r!==i.CellType.Ordinary?1:0)+32*t}function a(e){let t=e.length;return Math.ceil(t/8)+Math.floor(t/8)}t.getRefsDescriptor=s,t.getBitsDescriptor=a,t.getRepr=function(e,t,r,l,c,d){const u=Math.ceil(t.length/8),h=n.alloc(2+u+34*r.length);let f=0;h[f++]=s(r,c,d),h[f++]=a(e),(0,o.bitsToPaddedBuffer)(t).copy(h,f),f+=u;for(const e of r){let t;t=d==i.CellType.MerkleProof||d==i.CellType.MerkleUpdate?e.depth(l+1):e.depth(l),h[f++]=Math.floor(t/256),h[f++]=t%256}for(const e of r){let t;t=d==i.CellType.MerkleProof||d==i.CellType.MerkleUpdate?e.hash(l+1):e.hash(l),t.copy(h,f),f+=32}return h}},9368:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.exoticLibrary=void 0;const n=r(3528);t.exoticLibrary=function(e,t){const r=new n.BitReader(e);if(264!==e.length)throw new Error(`Library cell must have exactly (8 + 256) bits, got "${e.length}"`);let i=r.loadUint(8);if(2!==i)throw new Error(`Library cell must have type 2, got "${i}"`);return{}}},1459:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.exoticMerkleProof=void 0;const n=r(3528);t.exoticMerkleProof=function(e,t){const r=new n.BitReader(e);if(280!==e.length)throw new Error(`Merkle Proof cell must have exactly (8 + 256 + 16) bits, got "${e.length}"`);if(1!==t.length)throw new Error(`Merkle Proof cell must have exactly 1 ref, got "${t.length}"`);let i=r.loadUint(8);if(3!==i)throw new Error(`Merkle Proof cell must have type 3, got "${i}"`);const o=r.loadBuffer(32),s=r.loadUint(16),a=t[0].hash(0),l=t[0].depth(0);if(s!==l)throw new Error(`Merkle Proof cell ref depth must be exactly "${s}", got "${l}"`);if(!o.equals(a))throw new Error(`Merkle Proof cell ref hash must be exactly "${o.toString("hex")}", got "${a.toString("hex")}"`);return{proofDepth:s,proofHash:o}}},1408:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.exoticMerkleUpdate=void 0;const n=r(3528);t.exoticMerkleUpdate=function(e,t){const r=new n.BitReader(e);if(552!==e.length)throw new Error(`Merkle Update cell must have exactly (8 + (2 * (256 + 16))) bits, got "${e.length}"`);if(2!==t.length)throw new Error(`Merkle Update cell must have exactly 2 refs, got "${t.length}"`);let i=r.loadUint(8);if(4!==i)throw new Error(`Merkle Update cell type must be exactly 4, got "${i}"`);const o=r.loadBuffer(32),s=r.loadBuffer(32),a=r.loadUint(16),l=r.loadUint(16);if(a!==t[0].depth(0))throw new Error(`Merkle Update cell ref depth must be exactly "${a}", got "${t[0].depth(0)}"`);if(!o.equals(t[0].hash(0)))throw new Error(`Merkle Update cell ref hash must be exactly "${o.toString("hex")}", got "${t[0].hash(0).toString("hex")}"`);if(l!==t[1].depth(0))throw new Error(`Merkle Update cell ref depth must be exactly "${l}", got "${t[1].depth(0)}"`);if(!s.equals(t[1].hash(0)))throw new Error(`Merkle Update cell ref hash must be exactly "${s.toString("hex")}", got "${t[1].hash(0).toString("hex")}"`);return{proofDepth1:a,proofDepth2:l,proofHash1:o,proofHash2:s}}},9499:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.exoticPruned=void 0;const n=r(3528),i=r(555);t.exoticPruned=function(e,t){let r,o=new n.BitReader(e),s=o.loadUint(8);if(1!==s)throw new Error(`Pruned branch cell must have type 1, got "${s}"`);if(0!==t.length)throw new Error(`Pruned Branch cell can't has refs, got "${t.length}"`);if(280===e.length)r=new i.LevelMask(1);else{if(r=new i.LevelMask(o.loadUint(8)),r.level<1||r.level>3)throw new Error(`Pruned Branch cell level must be >= 1 and <= 3, got "${r.level}/${r.value}"`);const t=16+272*r.apply(r.level-1).hashCount;if(e.length!==t)throw new Error(`Pruned branch cell must have exactly ${t} bits, got "${e.length}"`)}let a=[],l=[],c=[];for(let e=0;e{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resolveExotic=void 0;const n=r(3528),i=r(4654),o=r(9368),s=r(1459),a=r(1408),l=r(9499),c=r(555);t.resolveExotic=function(e,t){let r=new n.BitReader(e).preloadUint(8);if(1===r)return function(e,t){let r=(0,l.exoticPruned)(e,t),n=[],o=[],s=new c.LevelMask(r.mask);for(let e=0;e>1);return{type:i.CellType.MerkleProof,depths:[],hashes:[],mask:r}}(e,t);if(4===r)return function(e,t){(0,a.exoticMerkleUpdate)(e,t);let r=new c.LevelMask((t[0].level()|t[1].level())>>1);return{type:i.CellType.MerkleUpdate,depths:[],hashes:[],mask:r}}(e,t);throw Error("Invalid exotic cell type: "+r)}},5229:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.serializeBoc=t.deserializeBoc=t.parseBoc=void 0;const n=r(3528),i=r(2386),o=r(6902),s=r(1080),a=r(6767),l=r(9924),c=r(9896),d=r(4382),u=r(9429);function h(e){return function(e){let t=0;for(let r=0;r<3;r++)t+=1&e,e>>=1;return t+1}(7&e)}function f(e,t){const r=e.loadUint(8),n=r%8,o=!!(8&r),s=e.loadUint(8),a=Math.ceil(s/2),l=!!(s%2),c=r>>5,d=!!(16&r),u=d?32*h(c):0,f=d?2*h(c):0;e.skip(8*u),e.skip(8*f);let p=i.BitString.EMPTY;a>0&&(p=l?e.loadPaddedBits(8*a):e.loadBits(8*a));let g=[];for(let r=0;r=0;e--){if(s[e].result)throw Error("Impossible");let t=[];for(let r of s[e].refs){if(!s[r].result)throw Error("Invalid BOC file");t.push(s[r].result)}s[e].result=new o.Cell({bits:s[e].bits,refs:t,exotic:s[e].exotic})}let a=[];for(let e=0;e{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.topologicalSort=void 0,t.topologicalSort=function(e){let t=[e],r=new Map,n=new Set,i=[];for(;t.length>0;){const e=[...t];t=[];for(let i of e){const e=i.hash().toString("hex");if(!r.has(e)){n.add(e),r.set(e,{cell:i,refs:i.refs.map((e=>e.hash().toString("hex")))});for(let e of i.refs)t.push(e)}}}let o=new Set;function s(e){if(!n.has(e))return;if(o.has(e))throw Error("Not a DAG");o.add(e);let t=r.get(e).refs;for(let e=t.length-1;e>=0;e--)s(t[e]);i.push(e),o.delete(e),n.delete(e)}for(;n.size>0;)s(Array.from(n)[0]);let a=new Map;for(let e=0;e=0;e--){let t=i[e];const n=r.get(t);l.push({cell:n.cell,refs:n.refs.map((e=>a.get(e)))})}return l}},2938:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.wonderCalculator=void 0;const n=r(2386),i=r(4654),o=r(555),s=r(9499),a=r(1459),l=r(9896),c=r(5269),d=r(1408),u=r(9368);t.wonderCalculator=function(e,t,r){let h,f=null;if(e===i.CellType.Ordinary){let e=0;for(let t of r)e|=t.mask.value;h=new o.LevelMask(e)}else if(e===i.CellType.PrunedBranch)f=(0,s.exoticPruned)(t,r),h=new o.LevelMask(f.mask);else if(e===i.CellType.MerkleProof)(0,a.exoticMerkleProof)(t,r),h=new o.LevelMask(r[0].mask.value>>1);else if(e===i.CellType.MerkleUpdate)(0,d.exoticMerkleUpdate)(t,r),h=new o.LevelMask((r[0].mask.value|r[1].mask.value)>>1);else{if(e!==i.CellType.Library)throw new Error("Unsupported exotic type");(0,u.exoticLibrary)(t,r),h=new o.LevelMask}let p=[],g=[],m=e===i.CellType.PrunedBranch?1:h.hashCount,y=h.hashCount-m;for(let o=0,s=0;o<=h.level;o++){if(!h.isSignificant(o))continue;if(s0&&d++;let u=(0,l.getRepr)(t,a,r,o,h.apply(o).value,e),f=(0,c.sha256_sync)(u),m=s-y;p[m]=d,g[m]=f,s++}let b=[],w=[];if(f)for(let e=0;e<4;e++){const{hashIndex:t}=h.apply(e),{hashIndex:r}=h;t!==r?(b.push(f.pruned[t].hash),w.push(f.pruned[t].depth)):(b.push(g[0]),w.push(p[0]))}else for(let e=0;e<4;e++)b.push(g[h.apply(e).hashIndex]),w.push(p[h.apply(e).hashIndex]);return{mask:h,hashes:b,depths:w}}},4382:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.paddedBufferToBits=t.bitsToPaddedBuffer=void 0;const n=r(9924),i=r(2386);t.bitsToPaddedBuffer=function(e){let t=new n.BitBuilder(8*Math.ceil(e.length/8));t.writeBits(e);let r=8*Math.ceil(e.length/8)-e.length;for(let e=0;e=0;r--)if(0!==e[r]){const n=e[r];let i=n&-n;1&i||(i=Math.log2(i)+1),r>0&&(t=r<<3),t+=8-i;break}return new i.BitString(e,0,t)}},9556:(e,t,r)=>{"use strict";var n=r(8287).hp;Object.defineProperty(t,"__esModule",{value:!0}),t.writeString=t.stringToCell=t.readString=void 0;const i=r(5871);function o(e){if(e.remainingBits%8!=0)throw new Error(`Invalid string length: ${e.remainingBits}`);if(0!==e.remainingRefs&&1!==e.remainingRefs)throw new Error(`invalid number of refs: ${e.remainingRefs}`);let t;return t=0===e.remainingBits?n.alloc(0):e.loadBuffer(e.remainingBits/8),1===e.remainingRefs&&(t=n.concat([t,o(e.loadRef().beginParse())])),t}function s(e,t){if(e.length>0){let r=Math.floor(t.availableBits/8);if(e.length>r){let n=e.subarray(0,r),o=e.subarray(r);t=t.storeBuffer(n);let a=(0,i.beginCell)();s(o,a),t=t.storeRef(a.endCell())}else t=t.storeBuffer(e)}}t.readString=function(e){return o(e).toString()},t.stringToCell=function(e){let t=(0,i.beginCell)();return s(n.from(e),t),t.endCell()},t.writeString=function(e,t){s(n.from(e),t)}},5121:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ComputeError=void 0;class r extends Error{constructor(e,t,n){super(e),this.exitCode=t,this.debugLogs=n&&n.debugLogs?n.debugLogs:null,this.logs=n&&n.logs?n.logs:null,Object.setPrototypeOf(this,r.prototype)}}t.ComputeError=r},4742:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.openContract=void 0;const n=r(3512),i=r(6902);t.openContract=function(e,t){let r,o=null;if(!n.Address.isAddress(e.address))throw Error("Invalid address");if(r=e.address,e.init){if(!(e.init.code instanceof i.Cell))throw Error("Invalid init.code");if(!(e.init.data instanceof i.Cell))throw Error("Invalid init.data");o=e.init}let s=t({address:r,init:o});return new Proxy(e,{get(e,t){const r=e[t];return"string"==typeof t&&(t.startsWith("get")||t.startsWith("send"))&&"function"==typeof r?(...t)=>r.apply(e,[s,...t]):r}})}},109:(e,t,r)=>{"use strict";var n=r(8287).hp;Object.defineProperty(t,"__esModule",{value:!0}),t.safeSignVerify=t.safeSign=void 0;const i=r(5269);function o(e,t){let r=n.from(t);if(r.length>64)throw Error("Seed can\t be longer than 64 bytes");if(r.length<8)throw Error("Seed must be at least 8 bytes");return(0,i.sha256_sync)(n.concat([n.from([255,255]),r,e.hash()]))}t.safeSign=function(e,t,r="ton-safe-sign-magic"){return(0,i.sign)(o(e,r),t)},t.safeSignVerify=function(e,t,r,n="ton-safe-sign-magic"){return(0,i.signVerify)(o(e,n),t,r)}},7590:(e,t,r)=>{"use strict";var n=r(8287).hp;Object.defineProperty(t,"__esModule",{value:!0}),t.Dictionary=void 0;const i=r(3512),o=r(5871),s=r(6902),a=r(2386),l=r(8981),c=r(2230),d=r(2979),u=r(3910),h=r(6278);class f{static empty(e,t){return e&&t?new f(new Map,e,t):new f(new Map,null,null)}static load(e,t,r){let n;if(r instanceof s.Cell){if(r.isExotic)return f.empty(e,t);n=r.beginParse()}else n=r;let i=n.loadMaybeRef();return i&&!i.isExotic?f.loadDirect(e,t,i.beginParse()):f.empty(e,t)}static loadDirect(e,t,r){if(!r)return f.empty(e,t);let n;n=r instanceof s.Cell?r.beginParse():r;let i=(0,d.parseDict)(n,e.bits,t.parse),o=new Map;for(let[t,r]of i)o.set((0,h.serializeInternalKey)(e.parse(t)),r);return new f(o,e,t)}constructor(e,t,r){this._key=t,this._value=r,this._map=e}get size(){return this._map.size}get(e){return this._map.get((0,h.serializeInternalKey)(e))}has(e){return this._map.has((0,h.serializeInternalKey)(e))}set(e,t){return this._map.set((0,h.serializeInternalKey)(e),t),this}delete(e){const t=(0,h.serializeInternalKey)(e);return this._map.delete(t)}clear(){this._map.clear()}*[Symbol.iterator](){for(const[e,t]of this._map){const r=(0,h.deserializeInternalKey)(e);yield[r,t]}}keys(){return Array.from(this._map.keys()).map((e=>(0,h.deserializeInternalKey)(e)))}values(){return Array.from(this._map.values())}store(e,t,r){if(0===this._map.size)e.storeBit(0);else{let n=this._key;null!=t&&(n=t);let i=this._value;if(null!=r&&(i=r),!n)throw Error("Key serializer is not defined");if(!i)throw Error("Value serializer is not defined");let s=new Map;for(const[e,t]of this._map)s.set(n.serialize((0,h.deserializeInternalKey)(e)),t);e.storeBit(1);let a=(0,o.beginCell)();(0,u.serializeDict)(s,n.bits,i.serialize,a),e.storeRef(a.endCell())}}storeDirect(e,t,r){if(0===this._map.size)throw Error("Cannot store empty dictionary directly");let n=this._key;null!=t&&(n=t);let i=this._value;if(null!=r&&(i=r),!n)throw Error("Key serializer is not defined");if(!i)throw Error("Value serializer is not defined");let o=new Map;for(const[e,t]of this._map)o.set(n.serialize((0,h.deserializeInternalKey)(e)),t);(0,u.serializeDict)(o,n.bits,i.serialize,e)}generateMerkleProof(e){return(0,l.generateMerkleProof)(this,e,this._key)}generateMerkleUpdate(e,t){return(0,c.generateMerkleUpdate)(this,e,this._key,t)}}t.Dictionary=f,f.Keys={Address:()=>({bits:267,serialize:e=>{if(!i.Address.isAddress(e))throw Error("Key is not an address");return(0,o.beginCell)().storeAddress(e).endCell().beginParse().preloadUintBig(267)},parse:e=>(0,o.beginCell)().storeUint(e,267).endCell().beginParse().loadAddress()}),BigInt:e=>function(e){return{bits:e,serialize:t=>{if("bigint"!=typeof t)throw Error("Key is not a bigint");return(0,o.beginCell)().storeInt(t,e).endCell().beginParse().loadUintBig(e)},parse:t=>(0,o.beginCell)().storeUint(t,e).endCell().beginParse().loadIntBig(e)}}(e),Int:e=>function(e){return{bits:e,serialize:t=>{if("number"!=typeof t)throw Error("Key is not a number");if(!Number.isSafeInteger(t))throw Error("Key is not a safe integer: "+t);return(0,o.beginCell)().storeInt(t,e).endCell().beginParse().loadUintBig(e)},parse:t=>(0,o.beginCell)().storeUint(t,e).endCell().beginParse().loadInt(e)}}(e),BigUint:e=>function(e){return{bits:e,serialize:t=>{if("bigint"!=typeof t)throw Error("Key is not a bigint");if(t<0)throw Error("Key is negative: "+t);return(0,o.beginCell)().storeUint(t,e).endCell().beginParse().loadUintBig(e)},parse:t=>(0,o.beginCell)().storeUint(t,e).endCell().beginParse().loadUintBig(e)}}(e),Uint:e=>function(e){return{bits:e,serialize:t=>{if("number"!=typeof t)throw Error("Key is not a number");if(!Number.isSafeInteger(t))throw Error("Key is not a safe integer: "+t);if(t<0)throw Error("Key is negative: "+t);return(0,o.beginCell)().storeUint(t,e).endCell().beginParse().loadUintBig(e)},parse:t=>Number((0,o.beginCell)().storeUint(t,e).endCell().beginParse().loadUint(e))}}(e),Buffer:e=>function(e){return{bits:8*e,serialize:t=>{if(!n.isBuffer(t))throw Error("Key is not a buffer");return(0,o.beginCell)().storeBuffer(t).endCell().beginParse().loadUintBig(8*e)},parse:t=>(0,o.beginCell)().storeUint(t,8*e).endCell().beginParse().loadBuffer(e)}}(e),BitString:e=>function(e){return{bits:e,serialize:t=>{if(!a.BitString.isBitString(t))throw Error("Key is not a BitString");return(0,o.beginCell)().storeBits(t).endCell().beginParse().loadUintBig(e)},parse:t=>(0,o.beginCell)().storeUint(t,e).endCell().beginParse().loadBits(e)}}(e)},f.Values={BigInt:e=>function(e){return{serialize:(t,r)=>{r.storeInt(t,e)},parse:t=>t.loadIntBig(e)}}(e),Int:e=>function(e){return{serialize:(t,r)=>{r.storeInt(t,e)},parse:t=>t.loadInt(e)}}(e),BigVarInt:e=>function(e){return{serialize:(t,r)=>{r.storeVarInt(t,e)},parse:t=>t.loadVarIntBig(e)}}(e),BigUint:e=>function(e){return{serialize:(t,r)=>{r.storeUint(t,e)},parse:t=>t.loadUintBig(e)}}(e),Uint:e=>function(e){return{serialize:(t,r)=>{r.storeUint(t,e)},parse:t=>t.loadUint(e)}}(e),BigVarUint:e=>function(e){return{serialize:(t,r)=>{r.storeVarUint(t,e)},parse:t=>t.loadVarUintBig(e)}}(e),Bool:()=>({serialize:(e,t)=>{t.storeBit(e)},parse:e=>e.loadBit()}),Address:()=>({serialize:(e,t)=>{t.storeAddress(e)},parse:e=>e.loadAddress()}),Cell:()=>({serialize:(e,t)=>{t.storeRef(e)},parse:e=>e.loadRef()}),Buffer:e=>{return t=e,{serialize:(e,r)=>{if(e.length!==t)throw Error("Invalid buffer size");r.storeBuffer(e)},parse:e=>e.loadBuffer(t)};var t},BitString:e=>function(e){return{serialize:(t,r)=>{if(t.length!==e)throw Error("Invalid BitString size");r.storeBits(t)},parse:t=>t.loadBits(e)}}(e),Dictionary:(e,t)=>function(e,t){return{serialize:(e,t)=>{e.store(t)},parse:r=>f.load(e,t,r)}}(e,t)}},8981:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.generateMerkleProof=void 0;const n=r(5871),i=r(421);function o(e){return(0,n.beginCell)().storeUint(1,8).storeUint(1,8).storeBuffer(e.hash(0)).storeUint(e.depth(0),16).endCell({exotic:!0})}function s(e,t,r,a){const l=t.asCell();let c=0,d=e;if(0==(t.loadBit()?1:0)){c=(0,i.readUnaryLength)(t);for(let e=0;e{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.generateMerkleUpdate=void 0;const n=r(5871),i=r(8981);t.generateMerkleUpdate=function(e,t,r,o){const s=(0,i.generateMerkleProof)(e,t,r).refs[0];e.set(t,o);return a=s,l=(0,i.generateMerkleProof)(e,t,r).refs[0],(0,n.beginCell)().storeUint(4,8).storeBuffer(a.hash(0)).storeBuffer(l.hash(0)).storeUint(a.depth(0),16).storeUint(l.depth(0),16).storeRef(a).storeRef(l).endCell({exotic:!0});var a,l}},2979:(e,t)=>{"use strict";function r(e,t,n,i,o){let s=0,a=e;if(0==(t.loadBit()?1:0)){s=function(e){let t=0;for(;e.loadBit();)t++;return t}(t);for(let e=0;e{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.serializeDict=t.detectLabelType=t.writeLabelSame=t.writeLabelLong=t.writeLabelShort=t.buildTree=void 0;const n=r(5871),i=r(7182);function o(e,t){for(;e.length0&&t.storeUint(BigInt("0b"+e),e.length),t}function d(e,t,r){r.storeBit(1),r.storeBit(0);let n=Math.ceil(Math.log2(t+1));return r.storeUint(e.length,n),e.length>0&&r.storeUint(BigInt("0b"+e),e.length),r}function u(e,t,r,n){n.storeBit(1),n.storeBit(1),n.storeBit(e);let i=Math.ceil(Math.log2(r+1));n.storeUint(t,i)}function h(e,t){let r="short",n=function(e){return 1+e.length+1+e.length}(e),i=function(e,t){return 2+Math.ceil(Math.log2(t+1))+e.length}(e,t);if(i{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.findCommonPrefix=void 0,t.findCommonPrefix=function(e,t=0){if(0===e.length)return"";let r=e[0].slice(t);for(let n=1;n{"use strict";var n=r(8287).hp;Object.defineProperty(t,"__esModule",{value:!0}),t.deserializeInternalKey=t.serializeInternalKey=void 0;const i=r(3512),o=r(2386),s=r(4382);t.serializeInternalKey=function(e){if("number"==typeof e){if(!Number.isSafeInteger(e))throw Error("Invalid key type: not a safe integer: "+e);return"n:"+e.toString(10)}if("bigint"==typeof e)return"b:"+e.toString(10);if(i.Address.isAddress(e))return"a:"+e.toString();if(n.isBuffer(e))return"f:"+e.toString("hex");if(o.BitString.isBitString(e))return"B:"+e.toString();throw Error("Invalid key type")},t.deserializeInternalKey=function(e){let t=e.slice(0,2),r=e.slice(2);if("n:"===t)return parseInt(r,10);if("b:"===t)return BigInt(r);if("a:"===t)return i.Address.parse(r);if("f:"===t)return n.from(r,"hex");if("B:"===t){const e="_"==r.slice(-1);if(e||r.length%2!=0){let t=e?r.length-1:r.length;const i=r.substr(0,t)+"0";return!e&&1&t?new o.BitString(n.from(i,"hex"),0,t<<2):(0,s.paddedBufferToBits)(n.from(i,"hex"))}return new o.BitString(n.from(r,"hex"),0,r.length<<2)}throw Error("Invalid key type: "+t)}},421:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.readUnaryLength=void 0,t.readUnaryLength=function(e){let t=0;for(;e.loadBit();)t++;return t}},1307:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.safeSignVerify=t.safeSign=t.getMethodId=t.base32Encode=t.base32Decode=t.crc32c=t.crc16=t.fromNano=t.toNano=t.ComputeError=t.openContract=t.TupleBuilder=t.TupleReader=t.serializeTuple=t.parseTuple=t.generateMerkleUpdate=t.generateMerkleProof=t.exoticPruned=t.exoticMerkleUpdate=t.exoticMerkleProof=t.Dictionary=t.Cell=t.CellType=t.Slice=t.beginCell=t.Builder=t.BitBuilder=t.BitReader=t.BitString=t.contractAddress=t.ADNLAddress=t.ExternalAddress=t.address=t.Address=void 0;var o=r(3512);Object.defineProperty(t,"Address",{enumerable:!0,get:function(){return o.Address}}),Object.defineProperty(t,"address",{enumerable:!0,get:function(){return o.address}});var s=r(1629);Object.defineProperty(t,"ExternalAddress",{enumerable:!0,get:function(){return s.ExternalAddress}});var a=r(4061);Object.defineProperty(t,"ADNLAddress",{enumerable:!0,get:function(){return a.ADNLAddress}});var l=r(8986);Object.defineProperty(t,"contractAddress",{enumerable:!0,get:function(){return l.contractAddress}});var c=r(2386);Object.defineProperty(t,"BitString",{enumerable:!0,get:function(){return c.BitString}});var d=r(3528);Object.defineProperty(t,"BitReader",{enumerable:!0,get:function(){return d.BitReader}});var u=r(9924);Object.defineProperty(t,"BitBuilder",{enumerable:!0,get:function(){return u.BitBuilder}});var h=r(5871);Object.defineProperty(t,"Builder",{enumerable:!0,get:function(){return h.Builder}}),Object.defineProperty(t,"beginCell",{enumerable:!0,get:function(){return h.beginCell}});var f=r(6906);Object.defineProperty(t,"Slice",{enumerable:!0,get:function(){return f.Slice}});var p=r(4654);Object.defineProperty(t,"CellType",{enumerable:!0,get:function(){return p.CellType}});var g=r(6902);Object.defineProperty(t,"Cell",{enumerable:!0,get:function(){return g.Cell}});var m=r(7590);Object.defineProperty(t,"Dictionary",{enumerable:!0,get:function(){return m.Dictionary}});var y=r(1459);Object.defineProperty(t,"exoticMerkleProof",{enumerable:!0,get:function(){return y.exoticMerkleProof}});var b=r(1408);Object.defineProperty(t,"exoticMerkleUpdate",{enumerable:!0,get:function(){return b.exoticMerkleUpdate}});var w=r(9499);Object.defineProperty(t,"exoticPruned",{enumerable:!0,get:function(){return w.exoticPruned}});var v=r(8981);Object.defineProperty(t,"generateMerkleProof",{enumerable:!0,get:function(){return v.generateMerkleProof}});var C=r(2230);Object.defineProperty(t,"generateMerkleUpdate",{enumerable:!0,get:function(){return C.generateMerkleUpdate}});var _=r(1640);Object.defineProperty(t,"parseTuple",{enumerable:!0,get:function(){return _.parseTuple}}),Object.defineProperty(t,"serializeTuple",{enumerable:!0,get:function(){return _.serializeTuple}});var k=r(1155);Object.defineProperty(t,"TupleReader",{enumerable:!0,get:function(){return k.TupleReader}});var x=r(4117);Object.defineProperty(t,"TupleBuilder",{enumerable:!0,get:function(){return x.TupleBuilder}}),i(r(3814),t);var A=r(4742);Object.defineProperty(t,"openContract",{enumerable:!0,get:function(){return A.openContract}});var S=r(5121);Object.defineProperty(t,"ComputeError",{enumerable:!0,get:function(){return S.ComputeError}});var B=r(7070);Object.defineProperty(t,"toNano",{enumerable:!0,get:function(){return B.toNano}}),Object.defineProperty(t,"fromNano",{enumerable:!0,get:function(){return B.fromNano}});var E=r(2960);Object.defineProperty(t,"crc16",{enumerable:!0,get:function(){return E.crc16}});var P=r(9429);Object.defineProperty(t,"crc32c",{enumerable:!0,get:function(){return P.crc32c}});var I=r(3721);Object.defineProperty(t,"base32Decode",{enumerable:!0,get:function(){return I.base32Decode}}),Object.defineProperty(t,"base32Encode",{enumerable:!0,get:function(){return I.base32Encode}});var M=r(5149);Object.defineProperty(t,"getMethodId",{enumerable:!0,get:function(){return M.getMethodId}});var U=r(109);Object.defineProperty(t,"safeSign",{enumerable:!0,get:function(){return U.safeSign}}),Object.defineProperty(t,"safeSignVerify",{enumerable:!0,get:function(){return U.safeSignVerify}})},4117:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TupleBuilder=void 0;const n=r(5871),i=r(6902),o=r(6906);t.TupleBuilder=class{constructor(){this._tuple=[]}writeNumber(e){null==e?this._tuple.push({type:"null"}):this._tuple.push({type:"int",value:BigInt(e)})}writeBoolean(e){null==e?this._tuple.push({type:"null"}):this._tuple.push({type:"int",value:e?-1n:0n})}writeBuffer(e){null==e?this._tuple.push({type:"null"}):this._tuple.push({type:"slice",cell:(0,n.beginCell)().storeBuffer(e).endCell()})}writeString(e){null==e?this._tuple.push({type:"null"}):this._tuple.push({type:"slice",cell:(0,n.beginCell)().storeStringTail(e).endCell()})}writeCell(e){null==e?this._tuple.push({type:"null"}):e instanceof i.Cell?this._tuple.push({type:"cell",cell:e}):e instanceof o.Slice&&this._tuple.push({type:"cell",cell:e.asCell()})}writeSlice(e){null==e?this._tuple.push({type:"null"}):e instanceof i.Cell?this._tuple.push({type:"slice",cell:e}):e instanceof o.Slice&&this._tuple.push({type:"slice",cell:e.asCell()})}writeBuilder(e){null==e?this._tuple.push({type:"null"}):e instanceof i.Cell?this._tuple.push({type:"builder",cell:e}):e instanceof o.Slice&&this._tuple.push({type:"builder",cell:e.asCell()})}writeTuple(e){null==e?this._tuple.push({type:"null"}):this._tuple.push({type:"tuple",items:e})}writeAddress(e){null==e?this._tuple.push({type:"null"}):this._tuple.push({type:"slice",cell:(0,n.beginCell)().storeAddress(e).endCell()})}build(){return[...this._tuple]}}},1155:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TupleReader=void 0;class r{constructor(e){this.items=[...e]}get remaining(){return this.items.length}peek(){if(0===this.items.length)throw Error("EOF");return this.items[0]}pop(){if(0===this.items.length)throw Error("EOF");let e=this.items[0];return this.items.splice(0,1),e}skip(e=1){for(let t=0;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseTuple=t.serializeTuple=void 0;const n=r(5871),i=BigInt("-9223372036854775808"),o=BigInt("9223372036854775807");function s(e,t){if("null"===e.type)t.storeUint(0,8);else if("int"===e.type)e.value<=o&&e.value>=i?(t.storeUint(1,8),t.storeInt(e.value,64)):(t.storeUint(256,15),t.storeInt(e.value,257));else if("nan"===e.type)t.storeInt(767,16);else if("cell"===e.type)t.storeUint(3,8),t.storeRef(e.cell);else if("slice"===e.type)t.storeUint(4,8),t.storeUint(0,10),t.storeUint(e.cell.bits.length,10),t.storeUint(0,3),t.storeUint(e.cell.refs.length,3),t.storeRef(e.cell);else if("builder"===e.type)t.storeUint(5,8),t.storeRef(e.cell);else{if("tuple"!==e.type)throw Error("Invalid value");{let r=null,i=null;for(let t=0;t1&&(r=(0,n.beginCell)().storeRef(i).storeRef(r).endCell());let a=(0,n.beginCell)();s(e.items[t],a),i=a.endCell()}t.storeUint(7,8),t.storeUint(e.items.length,16),r&&t.storeRef(r),i&&t.storeRef(i)}}}function a(e){let t=e.loadUint(8);if(0===t)return{type:"null"};if(1===t)return{type:"int",value:e.loadIntBig(64)};if(2===t)return 0===e.loadUint(7)?{type:"int",value:e.loadIntBig(257)}:(e.loadBit(),{type:"nan"});if(3===t)return{type:"cell",cell:e.loadRef()};if(4===t){let t=e.loadUint(10),r=e.loadUint(10),i=e.loadUint(3),o=e.loadUint(3),s=e.loadRef().beginParse();s.skip(t);let a=s.loadBits(r-t),l=(0,n.beginCell)().storeBits(a);if(i1){let n=e.loadRef().beginParse(),i=e.loadRef().beginParse();r.unshift(a(i));for(let e=0;e0){let r=(0,n.beginCell)();l(e.slice(0,e.length-1),r),t.storeRef(r.endCell()),s(e[e.length-1],t)}}t.serializeTuple=function(e){let t=(0,n.beginCell)();return t.storeUint(e.length,24),l([...e],t),t.endCell()},t.parseTuple=function(e){let t=[],r=e.beginParse(),n=r.loadUint(24);for(let e=0;e{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.storeAccount=t.loadAccount=void 0;const n=r(6161),i=r(5006);t.loadAccount=function(e){return{addr:e.loadAddress(),storageStats:(0,i.loadStorageInfo)(e),storage:(0,n.loadAccountStorage)(e)}},t.storeAccount=function(e){return t=>{t.storeAddress(e.addr),t.store((0,i.storeStorageInfo)(e.storageStats)),t.store((0,n.storeAccountStorage)(e.storage))}}},3049:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.storeAccountState=t.loadAccountState=void 0;const n=r(2738);t.loadAccountState=function(e){return e.loadBit()?{type:"active",state:(0,n.loadStateInit)(e)}:e.loadBit()?{type:"frozen",stateHash:e.loadUintBig(256)}:{type:"uninit"}},t.storeAccountState=function(e){return t=>{"active"===e.type?(t.storeBit(!0),t.store((0,n.storeStateInit)(e.state))):"frozen"===e.type?(t.storeBit(!1),t.storeBit(!0),t.storeUint(e.stateHash,256)):"uninit"===e.type&&(t.storeBit(!1),t.storeBit(!1))}}},7676:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.storeAccountStatus=t.loadAccountStatus=void 0,t.loadAccountStatus=function(e){const t=e.loadUint(2);if(0===t)return"uninitialized";if(1===t)return"frozen";if(2===t)return"active";if(3===t)return"non-existing";throw Error("Invalid data")},t.storeAccountStatus=function(e){return t=>{if("uninitialized"===e)t.storeUint(0,2);else if("frozen"===e)t.storeUint(1,2);else if("active"===e)t.storeUint(2,2);else{if("non-existing"!==e)throw Error("Invalid data");t.storeUint(3,2)}return t}}},2312:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.storeAccountStatusChange=t.loadAccountStatusChange=void 0,t.loadAccountStatusChange=function(e){return e.loadBit()?e.loadBit()?"deleted":"frozen":"unchanged"},t.storeAccountStatusChange=function(e){return t=>{if("unchanged"==e)t.storeBit(0);else if("frozen"===e)t.storeBit(1),t.storeBit(0);else{if("deleted"!==e)throw Error("Invalid account status change");t.storeBit(1),t.storeBit(1)}}}},6161:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.storeAccountStorage=t.loadAccountStorage=void 0;const n=r(3049),i=r(574);t.loadAccountStorage=function(e){return{lastTransLt:e.loadUintBig(64),balance:(0,i.loadCurrencyCollection)(e),state:(0,n.loadAccountState)(e)}},t.storeAccountStorage=function(e){return t=>{t.storeUint(e.lastTransLt,64),t.store((0,i.storeCurrencyCollection)(e.balance)),t.store((0,n.storeAccountState)(e.state))}}},445:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.storeCommonMessageInfo=t.loadCommonMessageInfo=void 0;const n=r(574);t.loadCommonMessageInfo=function(e){return e.loadBit()?e.loadBit()?{type:"external-out",src:e.loadAddress(),dest:e.loadMaybeExternalAddress(),createdLt:e.loadUintBig(64),createdAt:e.loadUint(32)}:{type:"external-in",src:e.loadMaybeExternalAddress(),dest:e.loadAddress(),importFee:e.loadCoins()}:{type:"internal",ihrDisabled:e.loadBit(),bounce:e.loadBit(),bounced:e.loadBit(),src:e.loadAddress(),dest:e.loadAddress(),value:(0,n.loadCurrencyCollection)(e),ihrFee:e.loadCoins(),forwardFee:e.loadCoins(),createdLt:e.loadUintBig(64),createdAt:e.loadUint(32)}},t.storeCommonMessageInfo=function(e){return t=>{if("internal"===e.type)t.storeBit(0),t.storeBit(e.ihrDisabled),t.storeBit(e.bounce),t.storeBit(e.bounced),t.storeAddress(e.src),t.storeAddress(e.dest),t.store((0,n.storeCurrencyCollection)(e.value)),t.storeCoins(e.ihrFee),t.storeCoins(e.forwardFee),t.storeUint(e.createdLt,64),t.storeUint(e.createdAt,32);else if("external-in"===e.type)t.storeBit(1),t.storeBit(0),t.storeAddress(e.src),t.storeAddress(e.dest),t.storeCoins(e.importFee);else{if("external-out"!==e.type)throw new Error("Unknown CommonMessageInfo type");t.storeBit(1),t.storeBit(1),t.storeAddress(e.src),t.storeAddress(e.dest),t.storeUint(e.createdLt,64),t.storeUint(e.createdAt,32)}}}},2234:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.storeCommonMessageInfoRelaxed=t.loadCommonMessageInfoRelaxed=void 0;const n=r(574);t.loadCommonMessageInfoRelaxed=function(e){if(!e.loadBit())return{type:"internal",ihrDisabled:e.loadBit(),bounce:e.loadBit(),bounced:e.loadBit(),src:e.loadMaybeAddress(),dest:e.loadAddress(),value:(0,n.loadCurrencyCollection)(e),ihrFee:e.loadCoins(),forwardFee:e.loadCoins(),createdLt:e.loadUintBig(64),createdAt:e.loadUint(32)};if(!e.loadBit())throw Error("External In message is not possible for CommonMessageInfoRelaxed");return{type:"external-out",src:e.loadMaybeAddress(),dest:e.loadMaybeExternalAddress(),createdLt:e.loadUintBig(64),createdAt:e.loadUint(32)}},t.storeCommonMessageInfoRelaxed=function(e){return t=>{if("internal"===e.type)t.storeBit(0),t.storeBit(e.ihrDisabled),t.storeBit(e.bounce),t.storeBit(e.bounced),t.storeAddress(e.src),t.storeAddress(e.dest),t.store((0,n.storeCurrencyCollection)(e.value)),t.storeCoins(e.ihrFee),t.storeCoins(e.forwardFee),t.storeUint(e.createdLt,64),t.storeUint(e.createdAt,32);else{if("external-out"!==e.type)throw new Error("Unknown CommonMessageInfo type");t.storeBit(1),t.storeBit(1),t.storeAddress(e.src),t.storeAddress(e.dest),t.storeUint(e.createdLt,64),t.storeUint(e.createdAt,32)}}}},3471:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.storeComputeSkipReason=t.loadComputeSkipReason=void 0,t.loadComputeSkipReason=function(e){let t=e.loadUint(2);if(0===t)return"no-state";if(1===t)return"bad-state";if(2===t)return"no-gas";throw new Error(`Unknown ComputeSkipReason: ${t}`)},t.storeComputeSkipReason=function(e){return t=>{if("no-state"===e)t.storeUint(0,2);else if("bad-state"===e)t.storeUint(1,2);else{if("no-gas"!==e)throw new Error(`Unknown ComputeSkipReason: ${e}`);t.storeUint(2,2)}}}},574:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.storeCurrencyCollection=t.loadCurrencyCollection=void 0;const n=r(7590);t.loadCurrencyCollection=function(e){const t=e.loadCoins(),r=e.loadDict(n.Dictionary.Keys.Uint(32),n.Dictionary.Values.BigVarUint(5));return 0===r.size?{coins:t}:{other:r,coins:t}},t.storeCurrencyCollection=function(e){return t=>{t.storeCoins(e.coins),e.other?t.storeDict(e.other):t.storeBit(0)}}},4458:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.storeDepthBalanceInfo=t.loadDepthBalanceInfo=void 0;const n=r(574);t.loadDepthBalanceInfo=function(e){return{splitDepth:e.loadUint(5),balance:(0,n.loadCurrencyCollection)(e)}},t.storeDepthBalanceInfo=function(e){return t=>{t.storeUint(e.splitDepth,5),t.store((0,n.storeCurrencyCollection)(e.balance))}}},4660:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.storeHashUpdate=t.loadHashUpdate=void 0,t.loadHashUpdate=function(e){if(114!==e.loadUint(8))throw Error("Invalid data");return{oldHash:e.loadBuffer(32),newHash:e.loadBuffer(32)}},t.storeHashUpdate=function(e){return t=>{t.storeUint(114,8),t.storeBuffer(e.oldHash),t.storeBuffer(e.newHash)}}},9039:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.loadMasterchainStateExtra=void 0;const n=r(7590),i=r(574);t.loadMasterchainStateExtra=function(e){if(52262!==e.loadUint(16))throw Error("Invalid data");e.loadBit()&&e.loadRef();let t=e.loadUintBig(256);return{config:n.Dictionary.load(n.Dictionary.Keys.Int(32),n.Dictionary.Values.Cell(),e),configAddress:t,globalBalance:(0,i.loadCurrencyCollection)(e)}}},8178:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MessageValue=t.storeMessage=t.loadMessage=void 0;const n=r(5871),i=r(445),o=r(2738);function s(e){const t=(0,i.loadCommonMessageInfo)(e);let r=null;return e.loadBit()&&(r=e.loadBit()?(0,o.loadStateInit)(e.loadRef().beginParse()):(0,o.loadStateInit)(e)),{info:t,init:r,body:e.loadBit()?e.loadRef():e.asCell()}}function a(e,t){return r=>{if(r.store((0,i.storeCommonMessageInfo)(e.info)),e.init){r.storeBit(!0);let i=(0,n.beginCell)().store((0,o.storeStateInit)(e.init)),s=!1;s=!(!t||!t.forceRef)||r.availableBits-24,s?(r.storeBit(!0),r.storeRef(e.body)):(r.storeBit(!1),r.storeBuilder(e.body.asBuilder()))}}t.loadMessage=s,t.storeMessage=a,t.MessageValue={serialize(e,t){t.storeRef((0,n.beginCell)().store(a(e)))},parse:e=>s(e.loadRef().beginParse())}},4143:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.storeMessageRelaxed=t.loadMessageRelaxed=void 0;const n=r(5871),i=r(2234),o=r(2738);t.loadMessageRelaxed=function(e){const t=(0,i.loadCommonMessageInfoRelaxed)(e);let r=null;return e.loadBit()&&(r=e.loadBit()?(0,o.loadStateInit)(e.loadRef().beginParse()):(0,o.loadStateInit)(e)),{info:t,init:r,body:e.loadBit()?e.loadRef():e.asCell()}},t.storeMessageRelaxed=function(e,t){return r=>{if(r.store((0,i.storeCommonMessageInfoRelaxed)(e.info)),e.init){r.storeBit(!0);let i=(0,n.beginCell)().store((0,o.storeStateInit)(e.init)),s=!1;s=!((!t||!t.forceRef)&&r.availableBits-2>=i.bits),s?(r.storeBit(!0),r.storeRef(i)):(r.storeBit(!1),r.storeBuilder(i))}else r.storeBit(!1);let s=!1;s=!(!t||!t.forceRef)||!(r.availableBits-1>=e.body.bits.length&&r.refs+e.body.refs.length<=4&&!e.body.isExotic),s?(r.storeBit(!0),r.storeRef(e.body)):(r.storeBit(!1),r.storeBuilder(e.body.asBuilder()))}}},3101:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.loadOutList=t.storeOutList=t.loadOutAction=t.storeOutAction=void 0;const n=r(4143),i=r(5871);function o(e){switch(e.type){case"sendMsg":return function(e){return t=>{t.storeUint(s,32).storeUint(e.mode,8).storeRef((0,i.beginCell)().store((0,n.storeMessageRelaxed)(e.outMsg)).endCell())}}(e);case"setCode":return function(e){return t=>{t.storeUint(a,32).storeRef(e.newCode)}}(e);default:throw new Error(`Unknown action type ${e.type}`)}}t.storeOutAction=o;const s=247711853,a=2907562126;function l(e){const t=e.loadUint(32);if(t===s)return{type:"sendMsg",mode:e.loadUint(8),outMsg:(0,n.loadMessageRelaxed)(e.loadRef().beginParse())};if(t===a)return{type:"setCode",newCode:e.loadRef()};throw new Error(`Unknown out action tag 0x${t.toString(16)}`)}t.loadOutAction=l,t.storeOutList=function(e){const t=e.reduce(((e,t)=>(0,i.beginCell)().storeRef(e).store(o(t)).endCell()),(0,i.beginCell)().endCell());return e=>{e.storeSlice(t.beginParse())}},t.loadOutList=function(e){const t=[];for(;e.remainingRefs;){const r=e.loadRef();t.push(l(e)),e=r.beginParse()}return t.reverse()}},4568:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.SendMode=void 0,function(e){e[e.CARRY_ALL_REMAINING_BALANCE=128]="CARRY_ALL_REMAINING_BALANCE",e[e.CARRY_ALL_REMAINING_INCOMING_VALUE=64]="CARRY_ALL_REMAINING_INCOMING_VALUE",e[e.DESTROY_ACCOUNT_IF_ZERO=32]="DESTROY_ACCOUNT_IF_ZERO",e[e.PAY_GAS_SEPARATELY=1]="PAY_GAS_SEPARATELY",e[e.IGNORE_ERRORS=2]="IGNORE_ERRORS",e[e.NONE=0]="NONE"}(r||(t.SendMode=r={}))},594:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.storeShardAccount=t.loadShardAccount=void 0;const n=r(5871),i=r(2142);t.loadShardAccount=function(e){let t,r=e.loadRef();if(!r.isExotic){let e=r.beginParse();e.loadBit()&&(t=(0,i.loadAccount)(e))}return{account:t,lastTransactionHash:e.loadUintBig(256),lastTransactionLt:e.loadUintBig(64)}},t.storeShardAccount=function(e){return t=>{e.account?t.storeRef((0,n.beginCell)().storeBit(!0).store((0,i.storeAccount)(e.account))):t.storeRef((0,n.beginCell)().storeBit(!1)),t.storeUint(e.lastTransactionHash,256),t.storeUint(e.lastTransactionLt,64)}}},8993:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.storeShardAccounts=t.loadShardAccounts=t.ShardAccountRefValue=void 0;const n=r(7590),i=r(4458),o=r(594);t.ShardAccountRefValue={parse:e=>({depthBalanceInfo:(0,i.loadDepthBalanceInfo)(e),shardAccount:(0,o.loadShardAccount)(e)}),serialize(e,t){t.store((0,i.storeDepthBalanceInfo)(e.depthBalanceInfo)),t.store((0,o.storeShardAccount)(e.shardAccount))}},t.loadShardAccounts=function(e){return n.Dictionary.load(n.Dictionary.Keys.BigUint(256),t.ShardAccountRefValue,e)},t.storeShardAccounts=function(e){return t=>{t.storeDict(e)}}},2423:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.storeShardIdent=t.loadShardIdent=void 0,t.loadShardIdent=function(e){if(0!==e.loadUint(2))throw Error("Invalid data");return{shardPrefixBits:e.loadUint(6),workchainId:e.loadInt(32),shardPrefix:e.loadUintBig(64)}},t.storeShardIdent=function(e){return t=>{t.storeUint(0,2),t.storeUint(e.shardPrefixBits,6),t.storeInt(e.workchainId,32),t.storeUint(e.shardPrefix,64)}}},5787:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.loadShardStateUnsplit=void 0;const n=r(9039),i=r(8993),o=r(2423);t.loadShardStateUnsplit=function(e){if(2418257890!==e.loadUint(32))throw Error("Invalid data");let t=e.loadInt(32),r=(0,o.loadShardIdent)(e),s=e.loadUint(32),a=e.loadUint(32),l=e.loadUint(32),c=e.loadUintBig(64),d=e.loadUint(32);e.loadRef();let u,h=e.loadBit(),f=e.loadRef();f.isExotic||(u=(0,i.loadShardAccounts)(f.beginParse())),e.loadRef();let p=null;if(e.loadBit()){let t=e.loadRef();t.isExotic||(p=(0,n.loadMasterchainStateExtra)(t.beginParse()))}return{globalId:t,shardId:r,seqno:s,vertSeqNo:a,genUtime:l,genLt:c,minRefMcSeqno:d,beforeSplit:h,accounts:u,extras:p}}},2672:(e,t)=>{"use strict";function r(e){return{public:e.loadBit(),root:e.loadRef()}}function n(e){return t=>{t.storeBit(e.public),t.storeRef(e.root)}}Object.defineProperty(t,"__esModule",{value:!0}),t.SimpleLibraryValue=t.storeSimpleLibrary=t.loadSimpleLibrary=void 0,t.loadSimpleLibrary=r,t.storeSimpleLibrary=n,t.SimpleLibraryValue={serialize(e,t){n(e)(t)},parse:e=>r(e)}},9589:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.storeSplitMergeInfo=t.loadSplitMergeInfo=void 0,t.loadSplitMergeInfo=function(e){return{currentShardPrefixLength:e.loadUint(6),accountSplitDepth:e.loadUint(6),thisAddress:e.loadUintBig(256),siblingAddress:e.loadUintBig(256)}},t.storeSplitMergeInfo=function(e){return t=>{t.storeUint(e.currentShardPrefixLength,6),t.storeUint(e.accountSplitDepth,6),t.storeUint(e.thisAddress,256),t.storeUint(e.siblingAddress,256)}}},2738:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.storeStateInit=t.loadStateInit=void 0;const n=r(7590),i=r(2672),o=r(4599);t.loadStateInit=function(e){let t,r;e.loadBit()&&(t=e.loadUint(5)),e.loadBit()&&(r=(0,o.loadTickTock)(e));let s=e.loadMaybeRef(),a=e.loadMaybeRef(),l=e.loadDict(n.Dictionary.Keys.BigUint(256),i.SimpleLibraryValue);return 0===l.size&&(l=void 0),{splitDepth:t,special:r,code:s,data:a,libraries:l}},t.storeStateInit=function(e){return t=>{null!==e.splitDepth&&void 0!==e.splitDepth?(t.storeBit(!0),t.storeUint(e.splitDepth,5)):t.storeBit(!1),null!==e.special&&void 0!==e.special?(t.storeBit(!0),t.store((0,o.storeTickTock)(e.special))):t.storeBit(!1),t.storeMaybeRef(e.code),t.storeMaybeRef(e.data),t.storeDict(e.libraries)}}},5006:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.storeStorageInfo=t.loadStorageInfo=void 0;const n=r(2577);t.loadStorageInfo=function(e){return{used:(0,n.loadStorageUsed)(e),lastPaid:e.loadUint(32),duePayment:e.loadMaybeCoins()}},t.storeStorageInfo=function(e){return t=>{t.store((0,n.storeStorageUsed)(e.used)),t.storeUint(e.lastPaid,32),t.storeMaybeCoins(e.duePayment)}}},2577:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.storeStorageUsed=t.loadStorageUsed=void 0,t.loadStorageUsed=function(e){return{cells:e.loadVarUintBig(3),bits:e.loadVarUintBig(3),publicCells:e.loadVarUintBig(3)}},t.storeStorageUsed=function(e){return t=>{t.storeVarUint(e.cells,3),t.storeVarUint(e.bits,3),t.storeVarUint(e.publicCells,3)}}},1143:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.storeStorageUsedShort=t.loadStorageUsedShort=void 0,t.loadStorageUsedShort=function(e){return{cells:e.loadVarUintBig(3),bits:e.loadVarUintBig(3)}},t.storeStorageUsedShort=function(e){return t=>{t.storeVarUint(e.cells,3),t.storeVarUint(e.bits,3)}}},4599:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.storeTickTock=t.loadTickTock=void 0,t.loadTickTock=function(e){return{tick:e.loadBit(),tock:e.loadBit()}},t.storeTickTock=function(e){return t=>{t.storeBit(e.tick),t.storeBit(e.tock)}}},6305:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.storeTransaction=t.loadTransaction=void 0;const n=r(5871),i=r(7590),o=r(7676),s=r(574),a=r(4660),l=r(8178),c=r(3543);t.loadTransaction=function(e){let t=e.asCell();if(7!==e.loadUint(4))throw Error("Invalid data");let r=e.loadUintBig(256),n=e.loadUintBig(64),d=e.loadUintBig(256),u=e.loadUintBig(64),h=e.loadUint(32),f=e.loadUint(15),p=(0,o.loadAccountStatus)(e),g=(0,o.loadAccountStatus)(e),m=e.loadRef().beginParse(),y=m.loadBit()?(0,l.loadMessage)(m.loadRef().beginParse()):void 0,b=m.loadDict(i.Dictionary.Keys.Uint(15),l.MessageValue);return m.endParse(),{address:r,lt:n,prevTransactionHash:d,prevTransactionLt:u,now:h,outMessagesCount:f,oldStatus:p,endStatus:g,inMessage:y,outMessages:b,totalFees:(0,s.loadCurrencyCollection)(e),stateUpdate:(0,a.loadHashUpdate)(e.loadRef().beginParse()),description:(0,c.loadTransactionDescription)(e.loadRef().beginParse()),raw:t,hash:()=>t.hash()}},t.storeTransaction=function(e){return t=>{t.storeUint(7,4),t.storeUint(e.address,256),t.storeUint(e.lt,64),t.storeUint(e.prevTransactionHash,256),t.storeUint(e.prevTransactionLt,64),t.storeUint(e.now,32),t.storeUint(e.outMessagesCount,15),t.store((0,o.storeAccountStatus)(e.oldStatus)),t.store((0,o.storeAccountStatus)(e.endStatus));let r=(0,n.beginCell)();e.inMessage?(r.storeBit(!0),r.storeRef((0,n.beginCell)().store((0,l.storeMessage)(e.inMessage)))):r.storeBit(!1),r.storeDict(e.outMessages),t.storeRef(r),t.store((0,s.storeCurrencyCollection)(e.totalFees)),t.storeRef((0,n.beginCell)().store((0,a.storeHashUpdate)(e.stateUpdate))),t.storeRef((0,n.beginCell)().store((0,c.storeTransactionDescription)(e.description)))}}},464:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.storeTransactionActionPhase=t.loadTransactionActionPhase=void 0;const n=r(2312),i=r(1143);t.loadTransactionActionPhase=function(e){return{success:e.loadBit(),valid:e.loadBit(),noFunds:e.loadBit(),statusChange:(0,n.loadAccountStatusChange)(e),totalFwdFees:e.loadBit()?e.loadCoins():void 0,totalActionFees:e.loadBit()?e.loadCoins():void 0,resultCode:e.loadInt(32),resultArg:e.loadBit()?e.loadInt(32):void 0,totalActions:e.loadUint(16),specActions:e.loadUint(16),skippedActions:e.loadUint(16),messagesCreated:e.loadUint(16),actionListHash:e.loadUintBig(256),totalMessageSize:(0,i.loadStorageUsedShort)(e)}},t.storeTransactionActionPhase=function(e){return t=>{t.storeBit(e.success),t.storeBit(e.valid),t.storeBit(e.noFunds),t.store((0,n.storeAccountStatusChange)(e.statusChange)),t.storeMaybeCoins(e.totalFwdFees),t.storeMaybeCoins(e.totalActionFees),t.storeInt(e.resultCode,32),t.storeMaybeInt(e.resultArg,32),t.storeUint(e.totalActions,16),t.storeUint(e.specActions,16),t.storeUint(e.skippedActions,16),t.storeUint(e.messagesCreated,16),t.storeUint(e.actionListHash,256),t.store((0,i.storeStorageUsedShort)(e.totalMessageSize))}}},5726:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.storeTransactionBouncePhase=t.loadTransactionBouncePhase=void 0;const n=r(1143);t.loadTransactionBouncePhase=function(e){return e.loadBit()?{type:"ok",messageSize:(0,n.loadStorageUsedShort)(e),messageFees:e.loadCoins(),forwardFees:e.loadCoins()}:e.loadBit()?{type:"no-funds",messageSize:(0,n.loadStorageUsedShort)(e),requiredForwardFees:e.loadCoins()}:{type:"negative-funds"}},t.storeTransactionBouncePhase=function(e){return t=>{if("ok"===e.type)t.storeBit(!0),t.store((0,n.storeStorageUsedShort)(e.messageSize)),t.storeCoins(e.messageFees),t.storeCoins(e.forwardFees);else if("negative-funds"===e.type)t.storeBit(!1),t.storeBit(!1);else{if("no-funds"!==e.type)throw new Error("Invalid TransactionBouncePhase type");t.storeBit(!1),t.storeBit(!0),t.store((0,n.storeStorageUsedShort)(e.messageSize)),t.storeCoins(e.requiredForwardFees)}}}},3857:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.storeTransactionComputePhase=t.loadTransactionComputePhase=void 0;const n=r(5871),i=r(3471);t.loadTransactionComputePhase=function(e){if(!e.loadBit())return{type:"skipped",reason:(0,i.loadComputeSkipReason)(e)};let t=e.loadBit(),r=e.loadBit(),n=e.loadBit(),o=e.loadCoins();const s=e.loadRef().beginParse();return{type:"vm",success:t,messageStateUsed:r,accountActivated:n,gasFees:o,gasUsed:s.loadVarUintBig(3),gasLimit:s.loadVarUintBig(3),gasCredit:s.loadBit()?s.loadVarUintBig(2):void 0,mode:s.loadUint(8),exitCode:s.loadInt(32),exitArg:s.loadBit()?s.loadInt(32):void 0,vmSteps:s.loadUint(32),vmInitStateHash:s.loadUintBig(256),vmFinalStateHash:s.loadUintBig(256)}},t.storeTransactionComputePhase=function(e){return t=>{if("skipped"===e.type)return t.storeBit(0),void t.store((0,i.storeComputeSkipReason)(e.reason));t.storeBit(1),t.storeBit(e.success),t.storeBit(e.messageStateUsed),t.storeBit(e.accountActivated),t.storeCoins(e.gasFees),t.storeRef((0,n.beginCell)().storeVarUint(e.gasUsed,3).storeVarUint(e.gasLimit,3).store((t=>void 0!==e.gasCredit&&null!==e.gasCredit?t.storeBit(1).storeVarUint(e.gasCredit,2):t.storeBit(0))).storeUint(e.mode,8).storeInt(e.exitCode,32).store((t=>void 0!==e.exitArg&&null!==e.exitArg?t.storeBit(1).storeInt(e.exitArg,32):t.storeBit(0))).storeUint(e.vmSteps,32).storeUint(e.vmInitStateHash,256).storeUint(e.vmFinalStateHash,256).endCell())}}},1065:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.storeTransactionCreditPhase=t.loadTransactionCreditPhase=void 0;const n=r(574);t.loadTransactionCreditPhase=function(e){return{dueFeesColelcted:e.loadBit()?e.loadCoins():void 0,credit:(0,n.loadCurrencyCollection)(e)}},t.storeTransactionCreditPhase=function(e){return t=>{null===e.dueFeesColelcted||void 0===e.dueFeesColelcted?t.storeBit(!1):(t.storeBit(!0),t.storeCoins(e.dueFeesColelcted)),t.store((0,n.storeCurrencyCollection)(e.credit))}}},3543:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.storeTransactionDescription=t.loadTransactionDescription=void 0;const n=r(5871),i=r(9589),o=r(6305),s=r(464),a=r(5726),l=r(3857),c=r(1065),d=r(8353);t.loadTransactionDescription=function(e){let t=e.loadUint(4);if(0===t){const t=e.loadBit();let r,n;e.loadBit()&&(r=(0,d.loadTransactionStoragePhase)(e)),e.loadBit()&&(n=(0,c.loadTransactionCreditPhase)(e));let i,o=(0,l.loadTransactionComputePhase)(e);e.loadBit()&&(i=(0,s.loadTransactionActionPhase)(e.loadRef().beginParse()));let u,h=e.loadBit();return e.loadBit()&&(u=(0,a.loadTransactionBouncePhase)(e)),{type:"generic",creditFirst:t,storagePhase:r,creditPhase:n,computePhase:o,actionPhase:i,bouncePhase:u,aborted:h,destroyed:e.loadBit()}}if(1===t)return{type:"storage",storagePhase:(0,d.loadTransactionStoragePhase)(e)};if(2===t||3===t){const r=3===t;let n,i=(0,d.loadTransactionStoragePhase)(e),o=(0,l.loadTransactionComputePhase)(e);return e.loadBit()&&(n=(0,s.loadTransactionActionPhase)(e.loadRef().beginParse())),{type:"tick-tock",isTock:r,storagePhase:i,computePhase:o,actionPhase:n,aborted:e.loadBit(),destroyed:e.loadBit()}}if(4===t){let t,r=(0,i.loadSplitMergeInfo)(e);e.loadBit()&&(t=(0,d.loadTransactionStoragePhase)(e));let n,o=(0,l.loadTransactionComputePhase)(e);return e.loadBit()&&(n=(0,s.loadTransactionActionPhase)(e.loadRef().beginParse())),{type:"split-prepare",splitInfo:r,storagePhase:t,computePhase:o,actionPhase:n,aborted:e.loadBit(),destroyed:e.loadBit()}}if(5===t)return{type:"split-install",splitInfo:(0,i.loadSplitMergeInfo)(e),prepareTransaction:(0,o.loadTransaction)(e.loadRef().beginParse()),installed:e.loadBit()};throw Error(`Unsupported transaction description type ${t}`)},t.storeTransactionDescription=function(e){return t=>{if("generic"===e.type)t.storeUint(0,4),t.storeBit(e.creditFirst),e.storagePhase?(t.storeBit(!0),t.store((0,d.storeTransactionsStoragePhase)(e.storagePhase))):t.storeBit(!1),e.creditPhase?(t.storeBit(!0),t.store((0,c.storeTransactionCreditPhase)(e.creditPhase))):t.storeBit(!1),t.store((0,l.storeTransactionComputePhase)(e.computePhase)),e.actionPhase?(t.storeBit(!0),t.storeRef((0,n.beginCell)().store((0,s.storeTransactionActionPhase)(e.actionPhase)))):t.storeBit(!1),t.storeBit(e.aborted),e.bouncePhase?(t.storeBit(!0),t.store((0,a.storeTransactionBouncePhase)(e.bouncePhase))):t.storeBit(!1),t.storeBit(e.destroyed);else if("storage"===e.type)t.storeUint(1,4),t.store((0,d.storeTransactionsStoragePhase)(e.storagePhase));else if("tick-tock"===e.type)t.storeUint(e.isTock?3:2,4),t.store((0,d.storeTransactionsStoragePhase)(e.storagePhase)),t.store((0,l.storeTransactionComputePhase)(e.computePhase)),e.actionPhase?(t.storeBit(!0),t.storeRef((0,n.beginCell)().store((0,s.storeTransactionActionPhase)(e.actionPhase)))):t.storeBit(!1),t.storeBit(e.aborted),t.storeBit(e.destroyed);else if("split-prepare"===e.type)t.storeUint(4,4),t.store((0,i.storeSplitMergeInfo)(e.splitInfo)),e.storagePhase?(t.storeBit(!0),t.store((0,d.storeTransactionsStoragePhase)(e.storagePhase))):t.storeBit(!1),t.store((0,l.storeTransactionComputePhase)(e.computePhase)),e.actionPhase?(t.storeBit(!0),t.store((0,s.storeTransactionActionPhase)(e.actionPhase))):t.storeBit(!1),t.storeBit(e.aborted),t.storeBit(e.destroyed);else{if("split-install"!==e.type)throw Error(`Unsupported transaction description type ${e.type}`);t.storeUint(5,4),t.store((0,i.storeSplitMergeInfo)(e.splitInfo)),t.storeRef((0,n.beginCell)().store((0,o.storeTransaction)(e.prepareTransaction))),t.storeBit(e.installed)}}}},8353:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.storeTransactionsStoragePhase=t.loadTransactionStoragePhase=void 0;const n=r(2312);t.loadTransactionStoragePhase=function(e){const t=e.loadCoins();let r;return e.loadBit()&&(r=e.loadCoins()),{storageFeesCollected:t,storageFeesDue:r,statusChange:(0,n.loadAccountStatusChange)(e)}},t.storeTransactionsStoragePhase=function(e){return t=>{t.storeCoins(e.storageFeesCollected),null===e.storageFeesDue||void 0===e.storageFeesDue?t.storeBit(!1):(t.storeBit(!0),t.storeCoins(e.storageFeesDue)),t.store((0,n.storeAccountStatusChange)(e.statusChange))}}},3814:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.loadStorageInfo=t.storeStateInit=t.loadStateInit=t.storeSplitMergeInfo=t.loadSplitMergeInfo=t.storeSimpleLibrary=t.loadSimpleLibrary=t.loadShardStateUnsplit=t.storeShardIdent=t.loadShardIdent=t.storeShardAccounts=t.loadShardAccounts=t.ShardAccountRefValue=t.storeShardAccount=t.loadShardAccount=t.SendMode=t.storeMessageRelaxed=t.loadMessageRelaxed=t.storeMessage=t.loadMessage=t.loadMasterchainStateExtra=t.storeHashUpdate=t.loadHashUpdate=t.storeDepthBalanceInfo=t.loadDepthBalanceInfo=t.storeCurrencyCollection=t.loadCurrencyCollection=t.storeComputeSkipReason=t.loadComputeSkipReason=t.storeCommonMessageInfoRelaxed=t.loadCommonMessageInfoRelaxed=t.storeCommonMessageInfo=t.loadCommonMessageInfo=t.storeOutList=t.loadOutList=t.storeOutAction=t.loadOutAction=t.storeAccountStorage=t.loadAccountStorage=t.storeAccountStatusChange=t.loadAccountStatusChange=t.storeAccountStatus=t.loadAccountStatus=t.storeAccountState=t.loadAccountState=t.storeAccount=t.loadAccount=t.comment=t.external=t.internal=void 0,t.storeTransactionsStoragePhase=t.loadTransactionStoragePhase=t.storeTransactionDescription=t.loadTransactionDescription=t.storeTransactionCreditPhase=t.loadTransactionCreditPhase=t.storeTransactionComputePhase=t.loadTransactionComputePhase=t.storeTransactionBouncePhase=t.loadTransactionBouncePhase=t.storeTransactionActionPhase=t.loadTransactionActionPhase=t.storeTransaction=t.loadTransaction=t.storeTickTock=t.loadTickTock=t.storeStorageUsedShort=t.loadStorageUsedShort=t.storeStorageUsed=t.loadStorageUsed=t.storeStorageInfo=void 0;var n=r(9447);Object.defineProperty(t,"internal",{enumerable:!0,get:function(){return n.internal}}),Object.defineProperty(t,"external",{enumerable:!0,get:function(){return n.external}}),Object.defineProperty(t,"comment",{enumerable:!0,get:function(){return n.comment}});var i=r(2142);Object.defineProperty(t,"loadAccount",{enumerable:!0,get:function(){return i.loadAccount}}),Object.defineProperty(t,"storeAccount",{enumerable:!0,get:function(){return i.storeAccount}});var o=r(3049);Object.defineProperty(t,"loadAccountState",{enumerable:!0,get:function(){return o.loadAccountState}}),Object.defineProperty(t,"storeAccountState",{enumerable:!0,get:function(){return o.storeAccountState}});var s=r(7676);Object.defineProperty(t,"loadAccountStatus",{enumerable:!0,get:function(){return s.loadAccountStatus}}),Object.defineProperty(t,"storeAccountStatus",{enumerable:!0,get:function(){return s.storeAccountStatus}});var a=r(2312);Object.defineProperty(t,"loadAccountStatusChange",{enumerable:!0,get:function(){return a.loadAccountStatusChange}}),Object.defineProperty(t,"storeAccountStatusChange",{enumerable:!0,get:function(){return a.storeAccountStatusChange}});var l=r(6161);Object.defineProperty(t,"loadAccountStorage",{enumerable:!0,get:function(){return l.loadAccountStorage}}),Object.defineProperty(t,"storeAccountStorage",{enumerable:!0,get:function(){return l.storeAccountStorage}});var c=r(3101);Object.defineProperty(t,"loadOutAction",{enumerable:!0,get:function(){return c.loadOutAction}}),Object.defineProperty(t,"storeOutAction",{enumerable:!0,get:function(){return c.storeOutAction}}),Object.defineProperty(t,"loadOutList",{enumerable:!0,get:function(){return c.loadOutList}}),Object.defineProperty(t,"storeOutList",{enumerable:!0,get:function(){return c.storeOutList}});var d=r(445);Object.defineProperty(t,"loadCommonMessageInfo",{enumerable:!0,get:function(){return d.loadCommonMessageInfo}}),Object.defineProperty(t,"storeCommonMessageInfo",{enumerable:!0,get:function(){return d.storeCommonMessageInfo}});var u=r(2234);Object.defineProperty(t,"loadCommonMessageInfoRelaxed",{enumerable:!0,get:function(){return u.loadCommonMessageInfoRelaxed}}),Object.defineProperty(t,"storeCommonMessageInfoRelaxed",{enumerable:!0,get:function(){return u.storeCommonMessageInfoRelaxed}});var h=r(3471);Object.defineProperty(t,"loadComputeSkipReason",{enumerable:!0,get:function(){return h.loadComputeSkipReason}}),Object.defineProperty(t,"storeComputeSkipReason",{enumerable:!0,get:function(){return h.storeComputeSkipReason}});var f=r(574);Object.defineProperty(t,"loadCurrencyCollection",{enumerable:!0,get:function(){return f.loadCurrencyCollection}}),Object.defineProperty(t,"storeCurrencyCollection",{enumerable:!0,get:function(){return f.storeCurrencyCollection}});var p=r(4458);Object.defineProperty(t,"loadDepthBalanceInfo",{enumerable:!0,get:function(){return p.loadDepthBalanceInfo}}),Object.defineProperty(t,"storeDepthBalanceInfo",{enumerable:!0,get:function(){return p.storeDepthBalanceInfo}});var g=r(4660);Object.defineProperty(t,"loadHashUpdate",{enumerable:!0,get:function(){return g.loadHashUpdate}}),Object.defineProperty(t,"storeHashUpdate",{enumerable:!0,get:function(){return g.storeHashUpdate}});var m=r(9039);Object.defineProperty(t,"loadMasterchainStateExtra",{enumerable:!0,get:function(){return m.loadMasterchainStateExtra}});var y=r(8178);Object.defineProperty(t,"loadMessage",{enumerable:!0,get:function(){return y.loadMessage}}),Object.defineProperty(t,"storeMessage",{enumerable:!0,get:function(){return y.storeMessage}});var b=r(4143);Object.defineProperty(t,"loadMessageRelaxed",{enumerable:!0,get:function(){return b.loadMessageRelaxed}}),Object.defineProperty(t,"storeMessageRelaxed",{enumerable:!0,get:function(){return b.storeMessageRelaxed}});var w=r(4568);Object.defineProperty(t,"SendMode",{enumerable:!0,get:function(){return w.SendMode}});var v=r(594);Object.defineProperty(t,"loadShardAccount",{enumerable:!0,get:function(){return v.loadShardAccount}}),Object.defineProperty(t,"storeShardAccount",{enumerable:!0,get:function(){return v.storeShardAccount}});var C=r(8993);Object.defineProperty(t,"ShardAccountRefValue",{enumerable:!0,get:function(){return C.ShardAccountRefValue}}),Object.defineProperty(t,"loadShardAccounts",{enumerable:!0,get:function(){return C.loadShardAccounts}}),Object.defineProperty(t,"storeShardAccounts",{enumerable:!0,get:function(){return C.storeShardAccounts}});var _=r(2423);Object.defineProperty(t,"loadShardIdent",{enumerable:!0,get:function(){return _.loadShardIdent}}),Object.defineProperty(t,"storeShardIdent",{enumerable:!0,get:function(){return _.storeShardIdent}});var k=r(5787);Object.defineProperty(t,"loadShardStateUnsplit",{enumerable:!0,get:function(){return k.loadShardStateUnsplit}});var x=r(2672);Object.defineProperty(t,"loadSimpleLibrary",{enumerable:!0,get:function(){return x.loadSimpleLibrary}}),Object.defineProperty(t,"storeSimpleLibrary",{enumerable:!0,get:function(){return x.storeSimpleLibrary}});var A=r(9589);Object.defineProperty(t,"loadSplitMergeInfo",{enumerable:!0,get:function(){return A.loadSplitMergeInfo}}),Object.defineProperty(t,"storeSplitMergeInfo",{enumerable:!0,get:function(){return A.storeSplitMergeInfo}});var S=r(2738);Object.defineProperty(t,"loadStateInit",{enumerable:!0,get:function(){return S.loadStateInit}}),Object.defineProperty(t,"storeStateInit",{enumerable:!0,get:function(){return S.storeStateInit}});var B=r(5006);Object.defineProperty(t,"loadStorageInfo",{enumerable:!0,get:function(){return B.loadStorageInfo}}),Object.defineProperty(t,"storeStorageInfo",{enumerable:!0,get:function(){return B.storeStorageInfo}});var E=r(2577);Object.defineProperty(t,"loadStorageUsed",{enumerable:!0,get:function(){return E.loadStorageUsed}}),Object.defineProperty(t,"storeStorageUsed",{enumerable:!0,get:function(){return E.storeStorageUsed}});var P=r(1143);Object.defineProperty(t,"loadStorageUsedShort",{enumerable:!0,get:function(){return P.loadStorageUsedShort}}),Object.defineProperty(t,"storeStorageUsedShort",{enumerable:!0,get:function(){return P.storeStorageUsedShort}});var I=r(4599);Object.defineProperty(t,"loadTickTock",{enumerable:!0,get:function(){return I.loadTickTock}}),Object.defineProperty(t,"storeTickTock",{enumerable:!0,get:function(){return I.storeTickTock}});var M=r(6305);Object.defineProperty(t,"loadTransaction",{enumerable:!0,get:function(){return M.loadTransaction}}),Object.defineProperty(t,"storeTransaction",{enumerable:!0,get:function(){return M.storeTransaction}});var U=r(464);Object.defineProperty(t,"loadTransactionActionPhase",{enumerable:!0,get:function(){return U.loadTransactionActionPhase}}),Object.defineProperty(t,"storeTransactionActionPhase",{enumerable:!0,get:function(){return U.storeTransactionActionPhase}});var T=r(5726);Object.defineProperty(t,"loadTransactionBouncePhase",{enumerable:!0,get:function(){return T.loadTransactionBouncePhase}}),Object.defineProperty(t,"storeTransactionBouncePhase",{enumerable:!0,get:function(){return T.storeTransactionBouncePhase}});var O=r(3857);Object.defineProperty(t,"loadTransactionComputePhase",{enumerable:!0,get:function(){return O.loadTransactionComputePhase}}),Object.defineProperty(t,"storeTransactionComputePhase",{enumerable:!0,get:function(){return O.storeTransactionComputePhase}});var R=r(1065);Object.defineProperty(t,"loadTransactionCreditPhase",{enumerable:!0,get:function(){return R.loadTransactionCreditPhase}}),Object.defineProperty(t,"storeTransactionCreditPhase",{enumerable:!0,get:function(){return R.storeTransactionCreditPhase}});var j=r(3543);Object.defineProperty(t,"loadTransactionDescription",{enumerable:!0,get:function(){return j.loadTransactionDescription}}),Object.defineProperty(t,"storeTransactionDescription",{enumerable:!0,get:function(){return j.storeTransactionDescription}});var L=r(8353);Object.defineProperty(t,"loadTransactionStoragePhase",{enumerable:!0,get:function(){return L.loadTransactionStoragePhase}}),Object.defineProperty(t,"storeTransactionsStoragePhase",{enumerable:!0,get:function(){return L.storeTransactionsStoragePhase}})},9447:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.comment=t.external=t.internal=void 0;const n=r(3512),i=r(6902),o=r(5871),s=r(7070);t.internal=function(e){let t,r,a=!0;if(null!==e.bounce&&void 0!==e.bounce&&(a=e.bounce),"string"==typeof e.to)t=n.Address.parse(e.to);else{if(!n.Address.isAddress(e.to))throw new Error(`Invalid address ${e.to}`);t=e.to}r="string"==typeof e.value?(0,s.toNano)(e.value):e.value;let l=i.Cell.EMPTY;return"string"==typeof e.body?l=(0,o.beginCell)().storeUint(0,32).storeStringTail(e.body).endCell():e.body&&(l=e.body),{info:{type:"internal",dest:t,value:{coins:r},bounce:a,ihrDisabled:!0,bounced:!1,ihrFee:0n,forwardFee:0n,createdAt:0,createdLt:0n},init:e.init??void 0,body:l}},t.external=function(e){let t;if("string"==typeof e.to)t=n.Address.parse(e.to);else{if(!n.Address.isAddress(e.to))throw new Error(`Invalid address ${e.to}`);t=e.to}return{info:{type:"external-in",dest:t,importFee:0n},init:e.init??void 0,body:e.body||i.Cell.EMPTY}},t.comment=function(e){return(0,o.beginCell)().storeUint(0,32).storeStringTail(e).endCell()}},3721:(e,t,r)=>{"use strict";var n=r(8287).hp;Object.defineProperty(t,"__esModule",{value:!0}),t.base32Decode=t.base32Encode=void 0;const i="abcdefghijklmnopqrstuvwxyz234567";function o(e,t){const r=e.indexOf(t);if(-1===r)throw new Error("Invalid character found: "+t);return r}t.base32Encode=function(e){const t=e.byteLength;let r=0,n=0,o="";for(let s=0;s=5;)o+=i[n>>>r-5&31],r-=5;return r>0&&(o+=i[n<<5-r&31]),o},t.base32Decode=function(e){let t;t=e.toLowerCase();const{length:r}=t;let s=0,a=0,l=0;const c=n.alloc(5*r/8|0);for(let e=0;e=8&&(c[l++]=a>>>s-8&255,s-=8);return c}},6767:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bitsForNumber=void 0,t.bitsForNumber=function(e,t){let r=BigInt(e);if("int"===t)return 0n===r||-1n===r?1:(r>0?r:-r).toString(2).length+1;if("uint"===t){if(r<0)throw Error(`value is negative. Got ${e}`);return r.toString(2).length}throw Error(`invalid mode. Got ${t}`)}},7070:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fromNano=t.toNano=void 0,t.toNano=function(e){if("bigint"==typeof e)return 1000000000n*e;{if("number"==typeof e){if(!Number.isFinite(e))throw Error("Invalid number");if(Math.log10(e)<=6)e=e.toLocaleString("en",{minimumFractionDigits:9,useGrouping:!1});else{if(e-Math.trunc(e)!=0)throw Error("Not enough precision for a number value. Use string value instead");e=e.toLocaleString("en",{maximumFractionDigits:0,useGrouping:!1})}}let t=!1;for(;e.startsWith("-");)t=!t,e=e.slice(1);if("."===e)throw Error("Invalid number");let r=e.split(".");if(r.length>2)throw Error("Invalid number");let n=r[0],i=r[1];if(n||(n="0"),i||(i="0"),i.length>9)throw Error("Invalid number");for(;i.length<9;)i+="0";let o=1000000000n*BigInt(n)+BigInt(i);return t&&(o=-o),o}},t.fromNano=function(e){let t=BigInt(e),r=!1;t<0&&(r=!0,t=-t);let n=(t%1000000000n).toString();for(;n.length<9;)n="0"+n;n=n.match(/^([0-9]*[1-9]|0)(0*)/)[1];let i=`${(t/1000000000n).toString()}${"0"===n?"":`.${n}`}`;return r&&(i="-"+i),i}},2960:(e,t,r)=>{"use strict";var n=r(8287).hp;Object.defineProperty(t,"__esModule",{value:!0}),t.crc16=void 0,t.crc16=function(e){let t=0;const r=n.alloc(e.length+2);r.set(e);for(let e of r){let r=128;for(;r>0;)t<<=1,e&r&&(t+=1),r>>=1,t>65535&&(t&=65535,t^=4129)}return n.from([Math.floor(t/256),t%256])}},9429:(e,t,r)=>{"use strict";var n=r(8287).hp;Object.defineProperty(t,"__esModule",{value:!0}),t.crc32c=void 0;const i=2197175160;t.crc32c=function(e){let t=-1;for(let r=0;r>>1^i:t>>>1,t=1&t?t>>>1^i:t>>>1,t=1&t?t>>>1^i:t>>>1,t=1&t?t>>>1^i:t>>>1,t=1&t?t>>>1^i:t>>>1,t=1&t?t>>>1^i:t>>>1,t=1&t?t>>>1^i:t>>>1,t=1&t?t>>>1^i:t>>>1;t^=4294967295;let r=n.alloc(4);return r.writeInt32LE(t),r}},5149:(e,t,r)=>{"use strict";var n=r(8287).hp;Object.defineProperty(t,"__esModule",{value:!0}),t.getMethodId=void 0;const i=new Int16Array([0,4129,8258,12387,16516,20645,24774,28903,33032,37161,41290,45419,49548,53677,57806,61935,4657,528,12915,8786,21173,17044,29431,25302,37689,33560,45947,41818,54205,50076,62463,58334,9314,13379,1056,5121,25830,29895,17572,21637,42346,46411,34088,38153,58862,62927,50604,54669,13907,9842,5649,1584,30423,26358,22165,18100,46939,42874,38681,34616,63455,59390,55197,51132,18628,22757,26758,30887,2112,6241,10242,14371,51660,55789,59790,63919,35144,39273,43274,47403,23285,19156,31415,27286,6769,2640,14899,10770,56317,52188,64447,60318,39801,35672,47931,43802,27814,31879,19684,23749,11298,15363,3168,7233,60846,64911,52716,56781,44330,48395,36200,40265,32407,28342,24277,20212,15891,11826,7761,3696,65439,61374,57309,53244,48923,44858,40793,36728,37256,33193,45514,41451,53516,49453,61774,57711,4224,161,12482,8419,20484,16421,28742,24679,33721,37784,41979,46042,49981,54044,58239,62302,689,4752,8947,13010,16949,21012,25207,29270,46570,42443,38312,34185,62830,58703,54572,50445,13538,9411,5280,1153,29798,25671,21540,17413,42971,47098,34713,38840,59231,63358,50973,55100,9939,14066,1681,5808,26199,30326,17941,22068,55628,51565,63758,59695,39368,35305,47498,43435,22596,18533,30726,26663,6336,2273,14466,10403,52093,56156,60223,64286,35833,39896,43963,48026,19061,23124,27191,31254,2801,6864,10931,14994,64814,60687,56684,52557,48554,44427,40424,36297,31782,27655,23652,19525,15522,11395,7392,3265,61215,65342,53085,57212,44955,49082,36825,40952,28183,32310,20053,24180,11923,16050,3793,7920]);t.getMethodId=function(e){return 65535&function(e){e instanceof n||(e=n.from(e));let t=0;for(let r=0;r>8^n)]^t<<8)}return t}(e)|65536}},2370:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sha512=t.sha256=t.pbkdf2_sha512=t.hmac_sha512=t.getSecureRandomWords=t.getSecureRandomBytes=void 0;var n=r(6307);Object.defineProperty(t,"getSecureRandomBytes",{enumerable:!0,get:function(){return n.getSecureRandomBytes}}),Object.defineProperty(t,"getSecureRandomWords",{enumerable:!0,get:function(){return n.getSecureRandomWords}});var i=r(9967);Object.defineProperty(t,"hmac_sha512",{enumerable:!0,get:function(){return i.hmac_sha512}});var o=r(2441);Object.defineProperty(t,"pbkdf2_sha512",{enumerable:!0,get:function(){return o.pbkdf2_sha512}});var s=r(3150);Object.defineProperty(t,"sha256",{enumerable:!0,get:function(){return s.sha256}});var a=r(3999);Object.defineProperty(t,"sha512",{enumerable:!0,get:function(){return a.sha512}})},6307:(e,t,r)=>{"use strict";var n=r(8287).hp;Object.defineProperty(t,"__esModule",{value:!0}),t.getSecureRandomWords=t.getSecureRandomBytes=void 0,t.getSecureRandomBytes=function(e){return n.from(window.crypto.getRandomValues(new Uint8Array(e)))},t.getSecureRandomWords=function(e){return window.crypto.getRandomValues(new Uint16Array(e))}},9967:(e,t,r)=>{"use strict";var n=r(8287).hp;Object.defineProperty(t,"__esModule",{value:!0}),t.hmac_sha512=void 0,t.hmac_sha512=async function(e,t){let r="string"==typeof e?n.from(e,"utf-8"):e,i="string"==typeof t?n.from(t,"utf-8"):t;const o={name:"HMAC",hash:"SHA-512"},s=await window.crypto.subtle.importKey("raw",r,o,!1,["sign"]);return n.from(await crypto.subtle.sign(o,s,i))}},2441:(e,t,r)=>{"use strict";var n=r(8287).hp;Object.defineProperty(t,"__esModule",{value:!0}),t.pbkdf2_sha512=void 0,t.pbkdf2_sha512=async function(e,t,r,i){const o="string"==typeof e?n.from(e,"utf-8"):e,s="string"==typeof t?n.from(t,"utf-8"):t,a=await window.crypto.subtle.importKey("raw",o,{name:"PBKDF2"},!1,["deriveBits"]),l=await window.crypto.subtle.deriveBits({name:"PBKDF2",hash:"SHA-512",salt:s,iterations:r},a,8*i);return n.from(l)}},3150:(e,t,r)=>{"use strict";var n=r(8287).hp;Object.defineProperty(t,"__esModule",{value:!0}),t.sha256=void 0,t.sha256=async function(e){return"string"==typeof e?n.from(await crypto.subtle.digest("SHA-256",n.from(e,"utf-8"))):n.from(await crypto.subtle.digest("SHA-256",e))}},3999:(e,t,r)=>{"use strict";var n=r(8287).hp;Object.defineProperty(t,"__esModule",{value:!0}),t.sha512=void 0,t.sha512=async function(e){return"string"==typeof e?n.from(await crypto.subtle.digest("SHA-512",n.from(e,"utf-8"))):n.from(await crypto.subtle.digest("SHA-512",e))}},5735:(e,t,r)=>{"use strict";var n=r(8287).hp;Object.defineProperty(t,"__esModule",{value:!0}),t.deriveEd25519Path=t.deriveED25519HardenedKey=t.getED25519MasterKeyFromSeed=void 0;const i=r(4870),o=2147483648;async function s(e){const t=await(0,i.hmac_sha512)("ed25519 seed",e);return{key:t.slice(0,32),chainCode:t.slice(32)}}async function a(e,t){if(t>=o)throw Error("Key index must be less than offset");const r=n.alloc(4);r.writeUInt32BE(t+o,0);const s=n.concat([n.alloc(1,0),e.key,r]),a=await(0,i.hmac_sha512)(e.chainCode,s);return{key:a.slice(0,32),chainCode:a.slice(32)}}t.getED25519MasterKeyFromSeed=s,t.deriveED25519HardenedKey=a,t.deriveEd25519Path=async function(e,t){let r=await s(e),n=[...t];for(;n.length>0;){let e=n[0];n=n.slice(1),r=await a(r,e)}return r.key}},6815:(e,t,r)=>{"use strict";var n=r(8287).hp;Object.defineProperty(t,"__esModule",{value:!0}),t.deriveMnemonicsPath=t.deriveMnemonicHardenedKey=t.getMnemonicsMasterKeyFromSeed=void 0;const i=r(132),o=r(4870),s=2147483648;async function a(e){const t=await(0,o.hmac_sha512)("TON Mnemonics HD seed",e);return{key:t.slice(0,32),chainCode:t.slice(32)}}async function l(e,t){if(t>=s)throw Error("Key index must be less than offset");const r=n.alloc(4);r.writeUInt32BE(t+s,0);const i=n.concat([n.alloc(1,0),e.key,r]),a=await(0,o.hmac_sha512)(e.chainCode,i);return{key:a.slice(0,32),chainCode:a.slice(32)}}t.getMnemonicsMasterKeyFromSeed=a,t.deriveMnemonicHardenedKey=l,t.deriveMnemonicsPath=async function(e,t,r=24,n){let o=await a(e),s=[...t];for(;s.length>0;){let e=s[0];s=s.slice(1),o=await l(o,e)}return await(0,i.mnemonicFromRandomSeed)(o.key,r,n)}},8117:(e,t,r)=>{"use strict";var n=r(8287).hp;Object.defineProperty(t,"__esModule",{value:!0}),t.deriveSymmetricPath=t.deriveSymmetricHardenedKey=t.getSymmetricMasterKeyFromSeed=void 0;const i=r(4870);async function o(e){const t=await(0,i.hmac_sha512)("Symmetric key seed",e);return{key:t.slice(32),chainCode:t.slice(0,32)}}async function s(e,t){const r=n.concat([n.alloc(1,0),n.from(t)]),o=await(0,i.hmac_sha512)(e.chainCode,r);return{key:o.slice(32),chainCode:o.slice(0,32)}}t.getSymmetricMasterKeyFromSeed=o,t.deriveSymmetricHardenedKey=s,t.deriveSymmetricPath=async function(e,t){let r=await o(e),n=[...t];for(;n.length>0;){let e=n[0];n=n.slice(1),r=await s(r,e)}return r.key}},5269:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getMnemonicsMasterKeyFromSeed=t.deriveMnemonicHardenedKey=t.deriveMnemonicsPath=t.deriveSymmetricPath=t.deriveSymmetricHardenedKey=t.getSymmetricMasterKeyFromSeed=t.deriveEd25519Path=t.deriveED25519HardenedKey=t.getED25519MasterKeyFromSeed=t.signVerify=t.sign=t.keyPairFromSecretKey=t.keyPairFromSeed=t.openBox=t.sealBox=t.mnemonicWordList=t.mnemonicToHDSeed=t.mnemonicToSeed=t.mnemonicToWalletKey=t.mnemonicToPrivateKey=t.mnemonicValidate=t.mnemonicNew=t.newSecurePassphrase=t.newSecureWords=t.getSecureRandomNumber=t.getSecureRandomWords=t.getSecureRandomBytes=t.hmac_sha512=t.pbkdf2_sha512=t.sha512_sync=t.sha512=t.sha256_sync=t.sha256=void 0;var n=r(3269);Object.defineProperty(t,"sha256",{enumerable:!0,get:function(){return n.sha256}}),Object.defineProperty(t,"sha256_sync",{enumerable:!0,get:function(){return n.sha256_sync}});var i=r(6224);Object.defineProperty(t,"sha512",{enumerable:!0,get:function(){return i.sha512}}),Object.defineProperty(t,"sha512_sync",{enumerable:!0,get:function(){return i.sha512_sync}});var o=r(9256);Object.defineProperty(t,"pbkdf2_sha512",{enumerable:!0,get:function(){return o.pbkdf2_sha512}});var s=r(4870);Object.defineProperty(t,"hmac_sha512",{enumerable:!0,get:function(){return s.hmac_sha512}});var a=r(1682);Object.defineProperty(t,"getSecureRandomBytes",{enumerable:!0,get:function(){return a.getSecureRandomBytes}}),Object.defineProperty(t,"getSecureRandomWords",{enumerable:!0,get:function(){return a.getSecureRandomWords}}),Object.defineProperty(t,"getSecureRandomNumber",{enumerable:!0,get:function(){return a.getSecureRandomNumber}});var l=r(6622);Object.defineProperty(t,"newSecureWords",{enumerable:!0,get:function(){return l.newSecureWords}});var c=r(2279);Object.defineProperty(t,"newSecurePassphrase",{enumerable:!0,get:function(){return c.newSecurePassphrase}});var d=r(132);Object.defineProperty(t,"mnemonicNew",{enumerable:!0,get:function(){return d.mnemonicNew}}),Object.defineProperty(t,"mnemonicValidate",{enumerable:!0,get:function(){return d.mnemonicValidate}}),Object.defineProperty(t,"mnemonicToPrivateKey",{enumerable:!0,get:function(){return d.mnemonicToPrivateKey}}),Object.defineProperty(t,"mnemonicToWalletKey",{enumerable:!0,get:function(){return d.mnemonicToWalletKey}}),Object.defineProperty(t,"mnemonicToSeed",{enumerable:!0,get:function(){return d.mnemonicToSeed}}),Object.defineProperty(t,"mnemonicToHDSeed",{enumerable:!0,get:function(){return d.mnemonicToHDSeed}});var u=r(4436);Object.defineProperty(t,"mnemonicWordList",{enumerable:!0,get:function(){return u.wordlist}});var h=r(7796);Object.defineProperty(t,"sealBox",{enumerable:!0,get:function(){return h.sealBox}}),Object.defineProperty(t,"openBox",{enumerable:!0,get:function(){return h.openBox}});var f=r(7796);Object.defineProperty(t,"keyPairFromSeed",{enumerable:!0,get:function(){return f.keyPairFromSeed}}),Object.defineProperty(t,"keyPairFromSecretKey",{enumerable:!0,get:function(){return f.keyPairFromSecretKey}}),Object.defineProperty(t,"sign",{enumerable:!0,get:function(){return f.sign}}),Object.defineProperty(t,"signVerify",{enumerable:!0,get:function(){return f.signVerify}});var p=r(5735);Object.defineProperty(t,"getED25519MasterKeyFromSeed",{enumerable:!0,get:function(){return p.getED25519MasterKeyFromSeed}}),Object.defineProperty(t,"deriveED25519HardenedKey",{enumerable:!0,get:function(){return p.deriveED25519HardenedKey}}),Object.defineProperty(t,"deriveEd25519Path",{enumerable:!0,get:function(){return p.deriveEd25519Path}});var g=r(8117);Object.defineProperty(t,"getSymmetricMasterKeyFromSeed",{enumerable:!0,get:function(){return g.getSymmetricMasterKeyFromSeed}}),Object.defineProperty(t,"deriveSymmetricHardenedKey",{enumerable:!0,get:function(){return g.deriveSymmetricHardenedKey}}),Object.defineProperty(t,"deriveSymmetricPath",{enumerable:!0,get:function(){return g.deriveSymmetricPath}});var m=r(6815);Object.defineProperty(t,"deriveMnemonicsPath",{enumerable:!0,get:function(){return m.deriveMnemonicsPath}}),Object.defineProperty(t,"deriveMnemonicHardenedKey",{enumerable:!0,get:function(){return m.deriveMnemonicHardenedKey}}),Object.defineProperty(t,"getMnemonicsMasterKeyFromSeed",{enumerable:!0,get:function(){return m.getMnemonicsMasterKeyFromSeed}})},132:function(e,t,r){"use strict";var n=r(8287).hp,i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.mnemonicFromRandomSeed=t.mnemonicIndexesToBytes=t.bytesToMnemonics=t.bytesToMnemonicIndexes=t.mnemonicNew=t.mnemonicValidate=t.mnemonicToHDSeed=t.mnemonicToWalletKey=t.mnemonicToPrivateKey=t.mnemonicToSeed=t.mnemonicToEntropy=void 0;const o=i(r(8947)),s=r(1682),a=r(4870),l=r(9256),c=r(2202),d=r(4436),u=1e5;async function h(e){const t=await g(e);return await async function(e){return 1==(await(0,l.pbkdf2_sha512)(e,"TON fast seed version",1,64))[0]}(t)&&!await p(t)}function f(e){return e.map((e=>e.toLowerCase().trim()))}async function p(e){return 0==(await(0,l.pbkdf2_sha512)(e,"TON seed version",Math.max(1,Math.floor(u/256)),64))[0]}async function g(e,t){return await(0,a.hmac_sha512)(e.join(" "),t&&t.length>0?t:"")}async function m(e,t,r){const n=await g(e,r);return await(0,l.pbkdf2_sha512)(n,t,u,64)}async function y(e,t){e=f(e);const r=await m(e,"TON default seed",t);let i=o.default.sign.keyPair.fromSeed(r.slice(0,32));return{publicKey:n.from(i.publicKey),secretKey:n.from(i.secretKey)}}async function b(e,t){e=f(e);for(let t of e)if(d.wordlist.indexOf(t)<0)return!1;return!(t&&t.length>0&&!await h(e))&&await p(await g(e,t))}function w(e,t){let r=(0,c.bytesToBits)(e),n=[];for(let e=0;e0)||await h(r))&&await p(await g(r,t)))break}return r},t.bytesToMnemonicIndexes=w,t.bytesToMnemonics=v,t.mnemonicIndexesToBytes=function(e){let t="";for(let r of e){if(!Number.isSafeInteger(r))throw Error("Invalid input");if(r<0||r>=2028)throw Error("Invalid input");t+=(0,c.lpad)(r.toString(2),"0",11)}for(;t.length%8!=0;)t+="0";return(0,c.bitsToBytes)(t)},t.mnemonicFromRandomSeed=async function(e,t=24,r){const n=Math.ceil(11*t/8);let i=e;for(;;){let e=await(0,l.pbkdf2_sha512)(i,"TON mnemonic seed",Math.max(1,Math.floor(u/256)),n),o=v(e,t);if(await b(o,r))return o;i=e}}},4436:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.wordlist=void 0,t.wordlist=["abandon","ability","able","about","above","absent","absorb","abstract","absurd","abuse","access","accident","account","accuse","achieve","acid","acoustic","acquire","across","act","action","actor","actress","actual","adapt","add","addict","address","adjust","admit","adult","advance","advice","aerobic","affair","afford","afraid","again","age","agent","agree","ahead","aim","air","airport","aisle","alarm","album","alcohol","alert","alien","all","alley","allow","almost","alone","alpha","already","also","alter","always","amateur","amazing","among","amount","amused","analyst","anchor","ancient","anger","angle","angry","animal","ankle","announce","annual","another","answer","antenna","antique","anxiety","any","apart","apology","appear","apple","approve","april","arch","arctic","area","arena","argue","arm","armed","armor","army","around","arrange","arrest","arrive","arrow","art","artefact","artist","artwork","ask","aspect","assault","asset","assist","assume","asthma","athlete","atom","attack","attend","attitude","attract","auction","audit","august","aunt","author","auto","autumn","average","avocado","avoid","awake","aware","away","awesome","awful","awkward","axis","baby","bachelor","bacon","badge","bag","balance","balcony","ball","bamboo","banana","banner","bar","barely","bargain","barrel","base","basic","basket","battle","beach","bean","beauty","because","become","beef","before","begin","behave","behind","believe","below","belt","bench","benefit","best","betray","better","between","beyond","bicycle","bid","bike","bind","biology","bird","birth","bitter","black","blade","blame","blanket","blast","bleak","bless","blind","blood","blossom","blouse","blue","blur","blush","board","boat","body","boil","bomb","bone","bonus","book","boost","border","boring","borrow","boss","bottom","bounce","box","boy","bracket","brain","brand","brass","brave","bread","breeze","brick","bridge","brief","bright","bring","brisk","broccoli","broken","bronze","broom","brother","brown","brush","bubble","buddy","budget","buffalo","build","bulb","bulk","bullet","bundle","bunker","burden","burger","burst","bus","business","busy","butter","buyer","buzz","cabbage","cabin","cable","cactus","cage","cake","call","calm","camera","camp","can","canal","cancel","candy","cannon","canoe","canvas","canyon","capable","capital","captain","car","carbon","card","cargo","carpet","carry","cart","case","cash","casino","castle","casual","cat","catalog","catch","category","cattle","caught","cause","caution","cave","ceiling","celery","cement","census","century","cereal","certain","chair","chalk","champion","change","chaos","chapter","charge","chase","chat","cheap","check","cheese","chef","cherry","chest","chicken","chief","child","chimney","choice","choose","chronic","chuckle","chunk","churn","cigar","cinnamon","circle","citizen","city","civil","claim","clap","clarify","claw","clay","clean","clerk","clever","click","client","cliff","climb","clinic","clip","clock","clog","close","cloth","cloud","clown","club","clump","cluster","clutch","coach","coast","coconut","code","coffee","coil","coin","collect","color","column","combine","come","comfort","comic","common","company","concert","conduct","confirm","congress","connect","consider","control","convince","cook","cool","copper","copy","coral","core","corn","correct","cost","cotton","couch","country","couple","course","cousin","cover","coyote","crack","cradle","craft","cram","crane","crash","crater","crawl","crazy","cream","credit","creek","crew","cricket","crime","crisp","critic","crop","cross","crouch","crowd","crucial","cruel","cruise","crumble","crunch","crush","cry","crystal","cube","culture","cup","cupboard","curious","current","curtain","curve","cushion","custom","cute","cycle","dad","damage","damp","dance","danger","daring","dash","daughter","dawn","day","deal","debate","debris","decade","december","decide","decline","decorate","decrease","deer","defense","define","defy","degree","delay","deliver","demand","demise","denial","dentist","deny","depart","depend","deposit","depth","deputy","derive","describe","desert","design","desk","despair","destroy","detail","detect","develop","device","devote","diagram","dial","diamond","diary","dice","diesel","diet","differ","digital","dignity","dilemma","dinner","dinosaur","direct","dirt","disagree","discover","disease","dish","dismiss","disorder","display","distance","divert","divide","divorce","dizzy","doctor","document","dog","doll","dolphin","domain","donate","donkey","donor","door","dose","double","dove","draft","dragon","drama","drastic","draw","dream","dress","drift","drill","drink","drip","drive","drop","drum","dry","duck","dumb","dune","during","dust","dutch","duty","dwarf","dynamic","eager","eagle","early","earn","earth","easily","east","easy","echo","ecology","economy","edge","edit","educate","effort","egg","eight","either","elbow","elder","electric","elegant","element","elephant","elevator","elite","else","embark","embody","embrace","emerge","emotion","employ","empower","empty","enable","enact","end","endless","endorse","enemy","energy","enforce","engage","engine","enhance","enjoy","enlist","enough","enrich","enroll","ensure","enter","entire","entry","envelope","episode","equal","equip","era","erase","erode","erosion","error","erupt","escape","essay","essence","estate","eternal","ethics","evidence","evil","evoke","evolve","exact","example","excess","exchange","excite","exclude","excuse","execute","exercise","exhaust","exhibit","exile","exist","exit","exotic","expand","expect","expire","explain","expose","express","extend","extra","eye","eyebrow","fabric","face","faculty","fade","faint","faith","fall","false","fame","family","famous","fan","fancy","fantasy","farm","fashion","fat","fatal","father","fatigue","fault","favorite","feature","february","federal","fee","feed","feel","female","fence","festival","fetch","fever","few","fiber","fiction","field","figure","file","film","filter","final","find","fine","finger","finish","fire","firm","first","fiscal","fish","fit","fitness","fix","flag","flame","flash","flat","flavor","flee","flight","flip","float","flock","floor","flower","fluid","flush","fly","foam","focus","fog","foil","fold","follow","food","foot","force","forest","forget","fork","fortune","forum","forward","fossil","foster","found","fox","fragile","frame","frequent","fresh","friend","fringe","frog","front","frost","frown","frozen","fruit","fuel","fun","funny","furnace","fury","future","gadget","gain","galaxy","gallery","game","gap","garage","garbage","garden","garlic","garment","gas","gasp","gate","gather","gauge","gaze","general","genius","genre","gentle","genuine","gesture","ghost","giant","gift","giggle","ginger","giraffe","girl","give","glad","glance","glare","glass","glide","glimpse","globe","gloom","glory","glove","glow","glue","goat","goddess","gold","good","goose","gorilla","gospel","gossip","govern","gown","grab","grace","grain","grant","grape","grass","gravity","great","green","grid","grief","grit","grocery","group","grow","grunt","guard","guess","guide","guilt","guitar","gun","gym","habit","hair","half","hammer","hamster","hand","happy","harbor","hard","harsh","harvest","hat","have","hawk","hazard","head","health","heart","heavy","hedgehog","height","hello","helmet","help","hen","hero","hidden","high","hill","hint","hip","hire","history","hobby","hockey","hold","hole","holiday","hollow","home","honey","hood","hope","horn","horror","horse","hospital","host","hotel","hour","hover","hub","huge","human","humble","humor","hundred","hungry","hunt","hurdle","hurry","hurt","husband","hybrid","ice","icon","idea","identify","idle","ignore","ill","illegal","illness","image","imitate","immense","immune","impact","impose","improve","impulse","inch","include","income","increase","index","indicate","indoor","industry","infant","inflict","inform","inhale","inherit","initial","inject","injury","inmate","inner","innocent","input","inquiry","insane","insect","inside","inspire","install","intact","interest","into","invest","invite","involve","iron","island","isolate","issue","item","ivory","jacket","jaguar","jar","jazz","jealous","jeans","jelly","jewel","job","join","joke","journey","joy","judge","juice","jump","jungle","junior","junk","just","kangaroo","keen","keep","ketchup","key","kick","kid","kidney","kind","kingdom","kiss","kit","kitchen","kite","kitten","kiwi","knee","knife","knock","know","lab","label","labor","ladder","lady","lake","lamp","language","laptop","large","later","latin","laugh","laundry","lava","law","lawn","lawsuit","layer","lazy","leader","leaf","learn","leave","lecture","left","leg","legal","legend","leisure","lemon","lend","length","lens","leopard","lesson","letter","level","liar","liberty","library","license","life","lift","light","like","limb","limit","link","lion","liquid","list","little","live","lizard","load","loan","lobster","local","lock","logic","lonely","long","loop","lottery","loud","lounge","love","loyal","lucky","luggage","lumber","lunar","lunch","luxury","lyrics","machine","mad","magic","magnet","maid","mail","main","major","make","mammal","man","manage","mandate","mango","mansion","manual","maple","marble","march","margin","marine","market","marriage","mask","mass","master","match","material","math","matrix","matter","maximum","maze","meadow","mean","measure","meat","mechanic","medal","media","melody","melt","member","memory","mention","menu","mercy","merge","merit","merry","mesh","message","metal","method","middle","midnight","milk","million","mimic","mind","minimum","minor","minute","miracle","mirror","misery","miss","mistake","mix","mixed","mixture","mobile","model","modify","mom","moment","monitor","monkey","monster","month","moon","moral","more","morning","mosquito","mother","motion","motor","mountain","mouse","move","movie","much","muffin","mule","multiply","muscle","museum","mushroom","music","must","mutual","myself","mystery","myth","naive","name","napkin","narrow","nasty","nation","nature","near","neck","need","negative","neglect","neither","nephew","nerve","nest","net","network","neutral","never","news","next","nice","night","noble","noise","nominee","noodle","normal","north","nose","notable","note","nothing","notice","novel","now","nuclear","number","nurse","nut","oak","obey","object","oblige","obscure","observe","obtain","obvious","occur","ocean","october","odor","off","offer","office","often","oil","okay","old","olive","olympic","omit","once","one","onion","online","only","open","opera","opinion","oppose","option","orange","orbit","orchard","order","ordinary","organ","orient","original","orphan","ostrich","other","outdoor","outer","output","outside","oval","oven","over","own","owner","oxygen","oyster","ozone","pact","paddle","page","pair","palace","palm","panda","panel","panic","panther","paper","parade","parent","park","parrot","party","pass","patch","path","patient","patrol","pattern","pause","pave","payment","peace","peanut","pear","peasant","pelican","pen","penalty","pencil","people","pepper","perfect","permit","person","pet","phone","photo","phrase","physical","piano","picnic","picture","piece","pig","pigeon","pill","pilot","pink","pioneer","pipe","pistol","pitch","pizza","place","planet","plastic","plate","play","please","pledge","pluck","plug","plunge","poem","poet","point","polar","pole","police","pond","pony","pool","popular","portion","position","possible","post","potato","pottery","poverty","powder","power","practice","praise","predict","prefer","prepare","present","pretty","prevent","price","pride","primary","print","priority","prison","private","prize","problem","process","produce","profit","program","project","promote","proof","property","prosper","protect","proud","provide","public","pudding","pull","pulp","pulse","pumpkin","punch","pupil","puppy","purchase","purity","purpose","purse","push","put","puzzle","pyramid","quality","quantum","quarter","question","quick","quit","quiz","quote","rabbit","raccoon","race","rack","radar","radio","rail","rain","raise","rally","ramp","ranch","random","range","rapid","rare","rate","rather","raven","raw","razor","ready","real","reason","rebel","rebuild","recall","receive","recipe","record","recycle","reduce","reflect","reform","refuse","region","regret","regular","reject","relax","release","relief","rely","remain","remember","remind","remove","render","renew","rent","reopen","repair","repeat","replace","report","require","rescue","resemble","resist","resource","response","result","retire","retreat","return","reunion","reveal","review","reward","rhythm","rib","ribbon","rice","rich","ride","ridge","rifle","right","rigid","ring","riot","ripple","risk","ritual","rival","river","road","roast","robot","robust","rocket","romance","roof","rookie","room","rose","rotate","rough","round","route","royal","rubber","rude","rug","rule","run","runway","rural","sad","saddle","sadness","safe","sail","salad","salmon","salon","salt","salute","same","sample","sand","satisfy","satoshi","sauce","sausage","save","say","scale","scan","scare","scatter","scene","scheme","school","science","scissors","scorpion","scout","scrap","screen","script","scrub","sea","search","season","seat","second","secret","section","security","seed","seek","segment","select","sell","seminar","senior","sense","sentence","series","service","session","settle","setup","seven","shadow","shaft","shallow","share","shed","shell","sheriff","shield","shift","shine","ship","shiver","shock","shoe","shoot","shop","short","shoulder","shove","shrimp","shrug","shuffle","shy","sibling","sick","side","siege","sight","sign","silent","silk","silly","silver","similar","simple","since","sing","siren","sister","situate","six","size","skate","sketch","ski","skill","skin","skirt","skull","slab","slam","sleep","slender","slice","slide","slight","slim","slogan","slot","slow","slush","small","smart","smile","smoke","smooth","snack","snake","snap","sniff","snow","soap","soccer","social","sock","soda","soft","solar","soldier","solid","solution","solve","someone","song","soon","sorry","sort","soul","sound","soup","source","south","space","spare","spatial","spawn","speak","special","speed","spell","spend","sphere","spice","spider","spike","spin","spirit","split","spoil","sponsor","spoon","sport","spot","spray","spread","spring","spy","square","squeeze","squirrel","stable","stadium","staff","stage","stairs","stamp","stand","start","state","stay","steak","steel","stem","step","stereo","stick","still","sting","stock","stomach","stone","stool","story","stove","strategy","street","strike","strong","struggle","student","stuff","stumble","style","subject","submit","subway","success","such","sudden","suffer","sugar","suggest","suit","summer","sun","sunny","sunset","super","supply","supreme","sure","surface","surge","surprise","surround","survey","suspect","sustain","swallow","swamp","swap","swarm","swear","sweet","swift","swim","swing","switch","sword","symbol","symptom","syrup","system","table","tackle","tag","tail","talent","talk","tank","tape","target","task","taste","tattoo","taxi","teach","team","tell","ten","tenant","tennis","tent","term","test","text","thank","that","theme","then","theory","there","they","thing","this","thought","three","thrive","throw","thumb","thunder","ticket","tide","tiger","tilt","timber","time","tiny","tip","tired","tissue","title","toast","tobacco","today","toddler","toe","together","toilet","token","tomato","tomorrow","tone","tongue","tonight","tool","tooth","top","topic","topple","torch","tornado","tortoise","toss","total","tourist","toward","tower","town","toy","track","trade","traffic","tragic","train","transfer","trap","trash","travel","tray","treat","tree","trend","trial","tribe","trick","trigger","trim","trip","trophy","trouble","truck","true","truly","trumpet","trust","truth","try","tube","tuition","tumble","tuna","tunnel","turkey","turn","turtle","twelve","twenty","twice","twin","twist","two","type","typical","ugly","umbrella","unable","unaware","uncle","uncover","under","undo","unfair","unfold","unhappy","uniform","unique","unit","universe","unknown","unlock","until","unusual","unveil","update","upgrade","uphold","upon","upper","upset","urban","urge","usage","use","used","useful","useless","usual","utility","vacant","vacuum","vague","valid","valley","valve","van","vanish","vapor","various","vast","vault","vehicle","velvet","vendor","venture","venue","verb","verify","version","very","vessel","veteran","viable","vibrant","vicious","victory","video","view","village","vintage","violin","virtual","virus","visa","visit","visual","vital","vivid","vocal","voice","void","volcano","volume","vote","voyage","wage","wagon","wait","walk","wall","walnut","want","warfare","warm","warrior","wash","wasp","waste","water","wave","way","wealth","weapon","wear","weasel","weather","web","wedding","weekend","weird","welcome","west","wet","whale","what","wheat","wheel","when","where","whip","whisper","wide","width","wife","wild","will","win","window","wine","wing","wink","winner","winter","wire","wisdom","wise","wish","witness","wolf","woman","wonder","wood","wool","word","work","world","worry","worth","wrap","wreck","wrestle","wrist","write","wrong","yard","year","yellow","you","young","youth","zebra","zero","zone","zoo"]},2279:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.newSecurePassphrase=void 0;const n=r(5269);t.newSecurePassphrase=async function(e=6){return(await(0,n.newSecureWords)(e)).join("-")}},6622:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.newSecureWords=void 0;const n=r(1682),i=r(706);t.newSecureWords=async function(e=6){let t=[];for(let r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.wordlist=void 0,t.wordlist=["abacus","abdomen","abdominal","abide","abiding","ability","ablaze","able","abnormal","abrasion","abrasive","abreast","abridge","abroad","abruptly","absence","absentee","absently","absinthe","absolute","absolve","abstain","abstract","absurd","accent","acclaim","acclimate","accompany","account","accuracy","accurate","accustom","acetone","achiness","aching","acid","acorn","acquaint","acquire","acre","acrobat","acronym","acting","action","activate","activator","active","activism","activist","activity","actress","acts","acutely","acuteness","aeration","aerobics","aerosol","aerospace","afar","affair","affected","affecting","affection","affidavit","affiliate","affirm","affix","afflicted","affluent","afford","affront","aflame","afloat","aflutter","afoot","afraid","afterglow","afterlife","aftermath","aftermost","afternoon","aged","ageless","agency","agenda","agent","aggregate","aghast","agile","agility","aging","agnostic","agonize","agonizing","agony","agreeable","agreeably","agreed","agreeing","agreement","aground","ahead","ahoy","aide","aids","aim","ajar","alabaster","alarm","albatross","album","alfalfa","algebra","algorithm","alias","alibi","alienable","alienate","aliens","alike","alive","alkaline","alkalize","almanac","almighty","almost","aloe","aloft","aloha","alone","alongside","aloof","alphabet","alright","although","altitude","alto","aluminum","alumni","always","amaretto","amaze","amazingly","amber","ambiance","ambiguity","ambiguous","ambition","ambitious","ambulance","ambush","amendable","amendment","amends","amenity","amiable","amicably","amid","amigo","amino","amiss","ammonia","ammonium","amnesty","amniotic","among","amount","amperage","ample","amplifier","amplify","amply","amuck","amulet","amusable","amused","amusement","amuser","amusing","anaconda","anaerobic","anagram","anatomist","anatomy","anchor","anchovy","ancient","android","anemia","anemic","aneurism","anew","angelfish","angelic","anger","angled","angler","angles","angling","angrily","angriness","anguished","angular","animal","animate","animating","animation","animator","anime","animosity","ankle","annex","annotate","announcer","annoying","annually","annuity","anointer","another","answering","antacid","antarctic","anteater","antelope","antennae","anthem","anthill","anthology","antibody","antics","antidote","antihero","antiquely","antiques","antiquity","antirust","antitoxic","antitrust","antiviral","antivirus","antler","antonym","antsy","anvil","anybody","anyhow","anymore","anyone","anyplace","anything","anytime","anyway","anywhere","aorta","apache","apostle","appealing","appear","appease","appeasing","appendage","appendix","appetite","appetizer","applaud","applause","apple","appliance","applicant","applied","apply","appointee","appraisal","appraiser","apprehend","approach","approval","approve","apricot","april","apron","aptitude","aptly","aqua","aqueduct","arbitrary","arbitrate","ardently","area","arena","arguable","arguably","argue","arise","armadillo","armband","armchair","armed","armful","armhole","arming","armless","armoire","armored","armory","armrest","army","aroma","arose","around","arousal","arrange","array","arrest","arrival","arrive","arrogance","arrogant","arson","art","ascend","ascension","ascent","ascertain","ashamed","ashen","ashes","ashy","aside","askew","asleep","asparagus","aspect","aspirate","aspire","aspirin","astonish","astound","astride","astrology","astronaut","astronomy","astute","atlantic","atlas","atom","atonable","atop","atrium","atrocious","atrophy","attach","attain","attempt","attendant","attendee","attention","attentive","attest","attic","attire","attitude","attractor","attribute","atypical","auction","audacious","audacity","audible","audibly","audience","audio","audition","augmented","august","authentic","author","autism","autistic","autograph","automaker","automated","automatic","autopilot","available","avalanche","avatar","avenge","avenging","avenue","average","aversion","avert","aviation","aviator","avid","avoid","await","awaken","award","aware","awhile","awkward","awning","awoke","awry","axis","babble","babbling","babied","baboon","backache","backboard","backboned","backdrop","backed","backer","backfield","backfire","backhand","backing","backlands","backlash","backless","backlight","backlit","backlog","backpack","backpedal","backrest","backroom","backshift","backside","backslid","backspace","backspin","backstab","backstage","backtalk","backtrack","backup","backward","backwash","backwater","backyard","bacon","bacteria","bacterium","badass","badge","badland","badly","badness","baffle","baffling","bagel","bagful","baggage","bagged","baggie","bagginess","bagging","baggy","bagpipe","baguette","baked","bakery","bakeshop","baking","balance","balancing","balcony","balmy","balsamic","bamboo","banana","banish","banister","banjo","bankable","bankbook","banked","banker","banking","banknote","bankroll","banner","bannister","banshee","banter","barbecue","barbed","barbell","barber","barcode","barge","bargraph","barista","baritone","barley","barmaid","barman","barn","barometer","barrack","barracuda","barrel","barrette","barricade","barrier","barstool","bartender","barterer","bash","basically","basics","basil","basin","basis","basket","batboy","batch","bath","baton","bats","battalion","battered","battering","battery","batting","battle","bauble","bazooka","blabber","bladder","blade","blah","blame","blaming","blanching","blandness","blank","blaspheme","blasphemy","blast","blatancy","blatantly","blazer","blazing","bleach","bleak","bleep","blemish","blend","bless","blighted","blimp","bling","blinked","blinker","blinking","blinks","blip","blissful","blitz","blizzard","bloated","bloating","blob","blog","bloomers","blooming","blooper","blot","blouse","blubber","bluff","bluish","blunderer","blunt","blurb","blurred","blurry","blurt","blush","blustery","boaster","boastful","boasting","boat","bobbed","bobbing","bobble","bobcat","bobsled","bobtail","bodacious","body","bogged","boggle","bogus","boil","bok","bolster","bolt","bonanza","bonded","bonding","bondless","boned","bonehead","boneless","bonelike","boney","bonfire","bonnet","bonsai","bonus","bony","boogeyman","boogieman","book","boondocks","booted","booth","bootie","booting","bootlace","bootleg","boots","boozy","borax","boring","borough","borrower","borrowing","boss","botanical","botanist","botany","botch","both","bottle","bottling","bottom","bounce","bouncing","bouncy","bounding","boundless","bountiful","bovine","boxcar","boxer","boxing","boxlike","boxy","breach","breath","breeches","breeching","breeder","breeding","breeze","breezy","brethren","brewery","brewing","briar","bribe","brick","bride","bridged","brigade","bright","brilliant","brim","bring","brink","brisket","briskly","briskness","bristle","brittle","broadband","broadcast","broaden","broadly","broadness","broadside","broadways","broiler","broiling","broken","broker","bronchial","bronco","bronze","bronzing","brook","broom","brought","browbeat","brownnose","browse","browsing","bruising","brunch","brunette","brunt","brush","brussels","brute","brutishly","bubble","bubbling","bubbly","buccaneer","bucked","bucket","buckle","buckshot","buckskin","bucktooth","buckwheat","buddhism","buddhist","budding","buddy","budget","buffalo","buffed","buffer","buffing","buffoon","buggy","bulb","bulge","bulginess","bulgur","bulk","bulldog","bulldozer","bullfight","bullfrog","bullhorn","bullion","bullish","bullpen","bullring","bullseye","bullwhip","bully","bunch","bundle","bungee","bunion","bunkbed","bunkhouse","bunkmate","bunny","bunt","busboy","bush","busily","busload","bust","busybody","buzz","cabana","cabbage","cabbie","cabdriver","cable","caboose","cache","cackle","cacti","cactus","caddie","caddy","cadet","cadillac","cadmium","cage","cahoots","cake","calamari","calamity","calcium","calculate","calculus","caliber","calibrate","calm","caloric","calorie","calzone","camcorder","cameo","camera","camisole","camper","campfire","camping","campsite","campus","canal","canary","cancel","candied","candle","candy","cane","canine","canister","cannabis","canned","canning","cannon","cannot","canola","canon","canopener","canopy","canteen","canyon","capable","capably","capacity","cape","capillary","capital","capitol","capped","capricorn","capsize","capsule","caption","captivate","captive","captivity","capture","caramel","carat","caravan","carbon","cardboard","carded","cardiac","cardigan","cardinal","cardstock","carefully","caregiver","careless","caress","caretaker","cargo","caring","carless","carload","carmaker","carnage","carnation","carnival","carnivore","carol","carpenter","carpentry","carpool","carport","carried","carrot","carrousel","carry","cartel","cartload","carton","cartoon","cartridge","cartwheel","carve","carving","carwash","cascade","case","cash","casing","casino","casket","cassette","casually","casualty","catacomb","catalog","catalyst","catalyze","catapult","cataract","catatonic","catcall","catchable","catcher","catching","catchy","caterer","catering","catfight","catfish","cathedral","cathouse","catlike","catnap","catnip","catsup","cattail","cattishly","cattle","catty","catwalk","caucasian","caucus","causal","causation","cause","causing","cauterize","caution","cautious","cavalier","cavalry","caviar","cavity","cedar","celery","celestial","celibacy","celibate","celtic","cement","census","ceramics","ceremony","certainly","certainty","certified","certify","cesarean","cesspool","chafe","chaffing","chain","chair","chalice","challenge","chamber","chamomile","champion","chance","change","channel","chant","chaos","chaperone","chaplain","chapped","chaps","chapter","character","charbroil","charcoal","charger","charging","chariot","charity","charm","charred","charter","charting","chase","chasing","chaste","chastise","chastity","chatroom","chatter","chatting","chatty","cheating","cheddar","cheek","cheer","cheese","cheesy","chef","chemicals","chemist","chemo","cherisher","cherub","chess","chest","chevron","chevy","chewable","chewer","chewing","chewy","chief","chihuahua","childcare","childhood","childish","childless","childlike","chili","chill","chimp","chip","chirping","chirpy","chitchat","chivalry","chive","chloride","chlorine","choice","chokehold","choking","chomp","chooser","choosing","choosy","chop","chosen","chowder","chowtime","chrome","chubby","chuck","chug","chummy","chump","chunk","churn","chute","cider","cilantro","cinch","cinema","cinnamon","circle","circling","circular","circulate","circus","citable","citadel","citation","citizen","citric","citrus","city","civic","civil","clad","claim","clambake","clammy","clamor","clamp","clamshell","clang","clanking","clapped","clapper","clapping","clarify","clarinet","clarity","clash","clasp","class","clatter","clause","clavicle","claw","clay","clean","clear","cleat","cleaver","cleft","clench","clergyman","clerical","clerk","clever","clicker","client","climate","climatic","cling","clinic","clinking","clip","clique","cloak","clobber","clock","clone","cloning","closable","closure","clothes","clothing","cloud","clover","clubbed","clubbing","clubhouse","clump","clumsily","clumsy","clunky","clustered","clutch","clutter","coach","coagulant","coastal","coaster","coasting","coastland","coastline","coat","coauthor","cobalt","cobbler","cobweb","cocoa","coconut","cod","coeditor","coerce","coexist","coffee","cofounder","cognition","cognitive","cogwheel","coherence","coherent","cohesive","coil","coke","cola","cold","coleslaw","coliseum","collage","collapse","collar","collected","collector","collide","collie","collision","colonial","colonist","colonize","colony","colossal","colt","coma","come","comfort","comfy","comic","coming","comma","commence","commend","comment","commerce","commode","commodity","commodore","common","commotion","commute","commuting","compacted","compacter","compactly","compactor","companion","company","compare","compel","compile","comply","component","composed","composer","composite","compost","composure","compound","compress","comprised","computer","computing","comrade","concave","conceal","conceded","concept","concerned","concert","conch","concierge","concise","conclude","concrete","concur","condense","condiment","condition","condone","conducive","conductor","conduit","cone","confess","confetti","confidant","confident","confider","confiding","configure","confined","confining","confirm","conflict","conform","confound","confront","confused","confusing","confusion","congenial","congested","congrats","congress","conical","conjoined","conjure","conjuror","connected","connector","consensus","consent","console","consoling","consonant","constable","constant","constrain","constrict","construct","consult","consumer","consuming","contact","container","contempt","contend","contented","contently","contents","contest","context","contort","contour","contrite","control","contusion","convene","convent","copartner","cope","copied","copier","copilot","coping","copious","copper","copy","coral","cork","cornball","cornbread","corncob","cornea","corned","corner","cornfield","cornflake","cornhusk","cornmeal","cornstalk","corny","coronary","coroner","corporal","corporate","corral","correct","corridor","corrode","corroding","corrosive","corsage","corset","cortex","cosigner","cosmetics","cosmic","cosmos","cosponsor","cost","cottage","cotton","couch","cough","could","countable","countdown","counting","countless","country","county","courier","covenant","cover","coveted","coveting","coyness","cozily","coziness","cozy","crabbing","crabgrass","crablike","crabmeat","cradle","cradling","crafter","craftily","craftsman","craftwork","crafty","cramp","cranberry","crane","cranial","cranium","crank","crate","crave","craving","crawfish","crawlers","crawling","crayfish","crayon","crazed","crazily","craziness","crazy","creamed","creamer","creamlike","crease","creasing","creatable","create","creation","creative","creature","credible","credibly","credit","creed","creme","creole","crepe","crept","crescent","crested","cresting","crestless","crevice","crewless","crewman","crewmate","crib","cricket","cried","crier","crimp","crimson","cringe","cringing","crinkle","crinkly","crisped","crisping","crisply","crispness","crispy","criteria","critter","croak","crock","crook","croon","crop","cross","crouch","crouton","crowbar","crowd","crown","crucial","crudely","crudeness","cruelly","cruelness","cruelty","crumb","crummiest","crummy","crumpet","crumpled","cruncher","crunching","crunchy","crusader","crushable","crushed","crusher","crushing","crust","crux","crying","cryptic","crystal","cubbyhole","cube","cubical","cubicle","cucumber","cuddle","cuddly","cufflink","culinary","culminate","culpable","culprit","cultivate","cultural","culture","cupbearer","cupcake","cupid","cupped","cupping","curable","curator","curdle","cure","curfew","curing","curled","curler","curliness","curling","curly","curry","curse","cursive","cursor","curtain","curtly","curtsy","curvature","curve","curvy","cushy","cusp","cussed","custard","custodian","custody","customary","customer","customize","customs","cut","cycle","cyclic","cycling","cyclist","cylinder","cymbal","cytoplasm","cytoplast","dab","dad","daffodil","dagger","daily","daintily","dainty","dairy","daisy","dallying","dance","dancing","dandelion","dander","dandruff","dandy","danger","dangle","dangling","daredevil","dares","daringly","darkened","darkening","darkish","darkness","darkroom","darling","darn","dart","darwinism","dash","dastardly","data","datebook","dating","daughter","daunting","dawdler","dawn","daybed","daybreak","daycare","daydream","daylight","daylong","dayroom","daytime","dazzler","dazzling","deacon","deafening","deafness","dealer","dealing","dealmaker","dealt","dean","debatable","debate","debating","debit","debrief","debtless","debtor","debug","debunk","decade","decaf","decal","decathlon","decay","deceased","deceit","deceiver","deceiving","december","decency","decent","deception","deceptive","decibel","decidable","decimal","decimeter","decipher","deck","declared","decline","decode","decompose","decorated","decorator","decoy","decrease","decree","dedicate","dedicator","deduce","deduct","deed","deem","deepen","deeply","deepness","deface","defacing","defame","default","defeat","defection","defective","defendant","defender","defense","defensive","deferral","deferred","defiance","defiant","defile","defiling","define","definite","deflate","deflation","deflator","deflected","deflector","defog","deforest","defraud","defrost","deftly","defuse","defy","degraded","degrading","degrease","degree","dehydrate","deity","dejected","delay","delegate","delegator","delete","deletion","delicacy","delicate","delicious","delighted","delirious","delirium","deliverer","delivery","delouse","delta","deluge","delusion","deluxe","demanding","demeaning","demeanor","demise","democracy","democrat","demote","demotion","demystify","denatured","deniable","denial","denim","denote","dense","density","dental","dentist","denture","deny","deodorant","deodorize","departed","departure","depict","deplete","depletion","deplored","deploy","deport","depose","depraved","depravity","deprecate","depress","deprive","depth","deputize","deputy","derail","deranged","derby","derived","desecrate","deserve","deserving","designate","designed","designer","designing","deskbound","desktop","deskwork","desolate","despair","despise","despite","destiny","destitute","destruct","detached","detail","detection","detective","detector","detention","detergent","detest","detonate","detonator","detoxify","detract","deuce","devalue","deviancy","deviant","deviate","deviation","deviator","device","devious","devotedly","devotee","devotion","devourer","devouring","devoutly","dexterity","dexterous","diabetes","diabetic","diabolic","diagnoses","diagnosis","diagram","dial","diameter","diaper","diaphragm","diary","dice","dicing","dictate","dictation","dictator","difficult","diffused","diffuser","diffusion","diffusive","dig","dilation","diligence","diligent","dill","dilute","dime","diminish","dimly","dimmed","dimmer","dimness","dimple","diner","dingbat","dinghy","dinginess","dingo","dingy","dining","dinner","diocese","dioxide","diploma","dipped","dipper","dipping","directed","direction","directive","directly","directory","direness","dirtiness","disabled","disagree","disallow","disarm","disarray","disaster","disband","disbelief","disburse","discard","discern","discharge","disclose","discolor","discount","discourse","discover","discuss","disdain","disengage","disfigure","disgrace","dish","disinfect","disjoin","disk","dislike","disliking","dislocate","dislodge","disloyal","dismantle","dismay","dismiss","dismount","disobey","disorder","disown","disparate","disparity","dispatch","dispense","dispersal","dispersed","disperser","displace","display","displease","disposal","dispose","disprove","dispute","disregard","disrupt","dissuade","distance","distant","distaste","distill","distinct","distort","distract","distress","district","distrust","ditch","ditto","ditzy","dividable","divided","dividend","dividers","dividing","divinely","diving","divinity","divisible","divisibly","division","divisive","divorcee","dizziness","dizzy","doable","docile","dock","doctrine","document","dodge","dodgy","doily","doing","dole","dollar","dollhouse","dollop","dolly","dolphin","domain","domelike","domestic","dominion","dominoes","donated","donation","donator","donor","donut","doodle","doorbell","doorframe","doorknob","doorman","doormat","doornail","doorpost","doorstep","doorstop","doorway","doozy","dork","dormitory","dorsal","dosage","dose","dotted","doubling","douche","dove","down","dowry","doze","drab","dragging","dragonfly","dragonish","dragster","drainable","drainage","drained","drainer","drainpipe","dramatic","dramatize","drank","drapery","drastic","draw","dreaded","dreadful","dreadlock","dreamboat","dreamily","dreamland","dreamless","dreamlike","dreamt","dreamy","drearily","dreary","drench","dress","drew","dribble","dried","drier","drift","driller","drilling","drinkable","drinking","dripping","drippy","drivable","driven","driver","driveway","driving","drizzle","drizzly","drone","drool","droop","drop-down","dropbox","dropkick","droplet","dropout","dropper","drove","drown","drowsily","drudge","drum","dry","dubbed","dubiously","duchess","duckbill","ducking","duckling","ducktail","ducky","duct","dude","duffel","dugout","duh","duke","duller","dullness","duly","dumping","dumpling","dumpster","duo","dupe","duplex","duplicate","duplicity","durable","durably","duration","duress","during","dusk","dust","dutiful","duty","duvet","dwarf","dweeb","dwelled","dweller","dwelling","dwindle","dwindling","dynamic","dynamite","dynasty","dyslexia","dyslexic","each","eagle","earache","eardrum","earflap","earful","earlobe","early","earmark","earmuff","earphone","earpiece","earplugs","earring","earshot","earthen","earthlike","earthling","earthly","earthworm","earthy","earwig","easeful","easel","easiest","easily","easiness","easing","eastbound","eastcoast","easter","eastward","eatable","eaten","eatery","eating","eats","ebay","ebony","ebook","ecard","eccentric","echo","eclair","eclipse","ecologist","ecology","economic","economist","economy","ecosphere","ecosystem","edge","edginess","edging","edgy","edition","editor","educated","education","educator","eel","effective","effects","efficient","effort","eggbeater","egging","eggnog","eggplant","eggshell","egomaniac","egotism","egotistic","either","eject","elaborate","elastic","elated","elbow","eldercare","elderly","eldest","electable","election","elective","elephant","elevate","elevating","elevation","elevator","eleven","elf","eligible","eligibly","eliminate","elite","elitism","elixir","elk","ellipse","elliptic","elm","elongated","elope","eloquence","eloquent","elsewhere","elude","elusive","elves","email","embargo","embark","embassy","embattled","embellish","ember","embezzle","emblaze","emblem","embody","embolism","emboss","embroider","emcee","emerald","emergency","emission","emit","emote","emoticon","emotion","empathic","empathy","emperor","emphases","emphasis","emphasize","emphatic","empirical","employed","employee","employer","emporium","empower","emptier","emptiness","empty","emu","enable","enactment","enamel","enchanted","enchilada","encircle","enclose","enclosure","encode","encore","encounter","encourage","encroach","encrust","encrypt","endanger","endeared","endearing","ended","ending","endless","endnote","endocrine","endorphin","endorse","endowment","endpoint","endurable","endurance","enduring","energetic","energize","energy","enforced","enforcer","engaged","engaging","engine","engorge","engraved","engraver","engraving","engross","engulf","enhance","enigmatic","enjoyable","enjoyably","enjoyer","enjoying","enjoyment","enlarged","enlarging","enlighten","enlisted","enquirer","enrage","enrich","enroll","enslave","ensnare","ensure","entail","entangled","entering","entertain","enticing","entire","entitle","entity","entomb","entourage","entrap","entree","entrench","entrust","entryway","entwine","enunciate","envelope","enviable","enviably","envious","envision","envoy","envy","enzyme","epic","epidemic","epidermal","epidermis","epidural","epilepsy","epileptic","epilogue","epiphany","episode","equal","equate","equation","equator","equinox","equipment","equity","equivocal","eradicate","erasable","erased","eraser","erasure","ergonomic","errand","errant","erratic","error","erupt","escalate","escalator","escapable","escapade","escapist","escargot","eskimo","esophagus","espionage","espresso","esquire","essay","essence","essential","establish","estate","esteemed","estimate","estimator","estranged","estrogen","etching","eternal","eternity","ethanol","ether","ethically","ethics","euphemism","evacuate","evacuee","evade","evaluate","evaluator","evaporate","evasion","evasive","even","everglade","evergreen","everybody","everyday","everyone","evict","evidence","evident","evil","evoke","evolution","evolve","exact","exalted","example","excavate","excavator","exceeding","exception","excess","exchange","excitable","exciting","exclaim","exclude","excluding","exclusion","exclusive","excretion","excretory","excursion","excusable","excusably","excuse","exemplary","exemplify","exemption","exerciser","exert","exes","exfoliate","exhale","exhaust","exhume","exile","existing","exit","exodus","exonerate","exorcism","exorcist","expand","expanse","expansion","expansive","expectant","expedited","expediter","expel","expend","expenses","expensive","expert","expire","expiring","explain","expletive","explicit","explode","exploit","explore","exploring","exponent","exporter","exposable","expose","exposure","express","expulsion","exquisite","extended","extending","extent","extenuate","exterior","external","extinct","extortion","extradite","extras","extrovert","extrude","extruding","exuberant","fable","fabric","fabulous","facebook","facecloth","facedown","faceless","facelift","faceplate","faceted","facial","facility","facing","facsimile","faction","factoid","factor","factsheet","factual","faculty","fade","fading","failing","falcon","fall","false","falsify","fame","familiar","family","famine","famished","fanatic","fancied","fanciness","fancy","fanfare","fang","fanning","fantasize","fantastic","fantasy","fascism","fastball","faster","fasting","fastness","faucet","favorable","favorably","favored","favoring","favorite","fax","feast","federal","fedora","feeble","feed","feel","feisty","feline","felt-tip","feminine","feminism","feminist","feminize","femur","fence","fencing","fender","ferment","fernlike","ferocious","ferocity","ferret","ferris","ferry","fervor","fester","festival","festive","festivity","fetal","fetch","fever","fiber","fiction","fiddle","fiddling","fidelity","fidgeting","fidgety","fifteen","fifth","fiftieth","fifty","figment","figure","figurine","filing","filled","filler","filling","film","filter","filth","filtrate","finale","finalist","finalize","finally","finance","financial","finch","fineness","finer","finicky","finished","finisher","finishing","finite","finless","finlike","fiscally","fit","five","flaccid","flagman","flagpole","flagship","flagstick","flagstone","flail","flakily","flaky","flame","flammable","flanked","flanking","flannels","flap","flaring","flashback","flashbulb","flashcard","flashily","flashing","flashy","flask","flatbed","flatfoot","flatly","flatness","flatten","flattered","flatterer","flattery","flattop","flatware","flatworm","flavored","flavorful","flavoring","flaxseed","fled","fleshed","fleshy","flick","flier","flight","flinch","fling","flint","flip","flirt","float","flock","flogging","flop","floral","florist","floss","flounder","flyable","flyaway","flyer","flying","flyover","flypaper","foam","foe","fog","foil","folic","folk","follicle","follow","fondling","fondly","fondness","fondue","font","food","fool","footage","football","footbath","footboard","footer","footgear","foothill","foothold","footing","footless","footman","footnote","footpad","footpath","footprint","footrest","footsie","footsore","footwear","footwork","fossil","foster","founder","founding","fountain","fox","foyer","fraction","fracture","fragile","fragility","fragment","fragrance","fragrant","frail","frame","framing","frantic","fraternal","frayed","fraying","frays","freckled","freckles","freebase","freebee","freebie","freedom","freefall","freehand","freeing","freeload","freely","freemason","freeness","freestyle","freeware","freeway","freewill","freezable","freezing","freight","french","frenzied","frenzy","frequency","frequent","fresh","fretful","fretted","friction","friday","fridge","fried","friend","frighten","frightful","frigidity","frigidly","frill","fringe","frisbee","frisk","fritter","frivolous","frolic","from","front","frostbite","frosted","frostily","frosting","frostlike","frosty","froth","frown","frozen","fructose","frugality","frugally","fruit","frustrate","frying","gab","gaffe","gag","gainfully","gaining","gains","gala","gallantly","galleria","gallery","galley","gallon","gallows","gallstone","galore","galvanize","gambling","game","gaming","gamma","gander","gangly","gangrene","gangway","gap","garage","garbage","garden","gargle","garland","garlic","garment","garnet","garnish","garter","gas","gatherer","gathering","gating","gauging","gauntlet","gauze","gave","gawk","gazing","gear","gecko","geek","geiger","gem","gender","generic","generous","genetics","genre","gentile","gentleman","gently","gents","geography","geologic","geologist","geology","geometric","geometry","geranium","gerbil","geriatric","germicide","germinate","germless","germproof","gestate","gestation","gesture","getaway","getting","getup","giant","gibberish","giblet","giddily","giddiness","giddy","gift","gigabyte","gigahertz","gigantic","giggle","giggling","giggly","gigolo","gilled","gills","gimmick","girdle","giveaway","given","giver","giving","gizmo","gizzard","glacial","glacier","glade","gladiator","gladly","glamorous","glamour","glance","glancing","glandular","glare","glaring","glass","glaucoma","glazing","gleaming","gleeful","glider","gliding","glimmer","glimpse","glisten","glitch","glitter","glitzy","gloater","gloating","gloomily","gloomy","glorified","glorifier","glorify","glorious","glory","gloss","glove","glowing","glowworm","glucose","glue","gluten","glutinous","glutton","gnarly","gnat","goal","goatskin","goes","goggles","going","goldfish","goldmine","goldsmith","golf","goliath","gonad","gondola","gone","gong","good","gooey","goofball","goofiness","goofy","google","goon","gopher","gore","gorged","gorgeous","gory","gosling","gossip","gothic","gotten","gout","gown","grab","graceful","graceless","gracious","gradation","graded","grader","gradient","grading","gradually","graduate","graffiti","grafted","grafting","grain","granddad","grandkid","grandly","grandma","grandpa","grandson","granite","granny","granola","grant","granular","grape","graph","grapple","grappling","grasp","grass","gratified","gratify","grating","gratitude","gratuity","gravel","graveness","graves","graveyard","gravitate","gravity","gravy","gray","grazing","greasily","greedily","greedless","greedy","green","greeter","greeting","grew","greyhound","grid","grief","grievance","grieving","grievous","grill","grimace","grimacing","grime","griminess","grimy","grinch","grinning","grip","gristle","grit","groggily","groggy","groin","groom","groove","grooving","groovy","grope","ground","grouped","grout","grove","grower","growing","growl","grub","grudge","grudging","grueling","gruffly","grumble","grumbling","grumbly","grumpily","grunge","grunt","guacamole","guidable","guidance","guide","guiding","guileless","guise","gulf","gullible","gully","gulp","gumball","gumdrop","gumminess","gumming","gummy","gurgle","gurgling","guru","gush","gusto","gusty","gutless","guts","gutter","guy","guzzler","gyration","habitable","habitant","habitat","habitual","hacked","hacker","hacking","hacksaw","had","haggler","haiku","half","halogen","halt","halved","halves","hamburger","hamlet","hammock","hamper","hamster","hamstring","handbag","handball","handbook","handbrake","handcart","handclap","handclasp","handcraft","handcuff","handed","handful","handgrip","handgun","handheld","handiness","handiwork","handlebar","handled","handler","handling","handmade","handoff","handpick","handprint","handrail","handsaw","handset","handsfree","handshake","handstand","handwash","handwork","handwoven","handwrite","handyman","hangnail","hangout","hangover","hangup","hankering","hankie","hanky","haphazard","happening","happier","happiest","happily","happiness","happy","harbor","hardcopy","hardcore","hardcover","harddisk","hardened","hardener","hardening","hardhat","hardhead","hardiness","hardly","hardness","hardship","hardware","hardwired","hardwood","hardy","harmful","harmless","harmonica","harmonics","harmonize","harmony","harness","harpist","harsh","harvest","hash","hassle","haste","hastily","hastiness","hasty","hatbox","hatchback","hatchery","hatchet","hatching","hatchling","hate","hatless","hatred","haunt","haven","hazard","hazelnut","hazily","haziness","hazing","hazy","headache","headband","headboard","headcount","headdress","headed","header","headfirst","headgear","heading","headlamp","headless","headlock","headphone","headpiece","headrest","headroom","headscarf","headset","headsman","headstand","headstone","headway","headwear","heap","heat","heave","heavily","heaviness","heaving","hedge","hedging","heftiness","hefty","helium","helmet","helper","helpful","helping","helpless","helpline","hemlock","hemstitch","hence","henchman","henna","herald","herbal","herbicide","herbs","heritage","hermit","heroics","heroism","herring","herself","hertz","hesitancy","hesitant","hesitate","hexagon","hexagram","hubcap","huddle","huddling","huff","hug","hula","hulk","hull","human","humble","humbling","humbly","humid","humiliate","humility","humming","hummus","humongous","humorist","humorless","humorous","humpback","humped","humvee","hunchback","hundredth","hunger","hungrily","hungry","hunk","hunter","hunting","huntress","huntsman","hurdle","hurled","hurler","hurling","hurray","hurricane","hurried","hurry","hurt","husband","hush","husked","huskiness","hut","hybrid","hydrant","hydrated","hydration","hydrogen","hydroxide","hyperlink","hypertext","hyphen","hypnoses","hypnosis","hypnotic","hypnotism","hypnotist","hypnotize","hypocrisy","hypocrite","ibuprofen","ice","iciness","icing","icky","icon","icy","idealism","idealist","idealize","ideally","idealness","identical","identify","identity","ideology","idiocy","idiom","idly","igloo","ignition","ignore","iguana","illicitly","illusion","illusive","image","imaginary","imagines","imaging","imbecile","imitate","imitation","immature","immerse","immersion","imminent","immobile","immodest","immorally","immortal","immovable","immovably","immunity","immunize","impaired","impale","impart","impatient","impeach","impeding","impending","imperfect","imperial","impish","implant","implement","implicate","implicit","implode","implosion","implosive","imply","impolite","important","importer","impose","imposing","impotence","impotency","impotent","impound","imprecise","imprint","imprison","impromptu","improper","improve","improving","improvise","imprudent","impulse","impulsive","impure","impurity","iodine","iodize","ion","ipad","iphone","ipod","irate","irk","iron","irregular","irrigate","irritable","irritably","irritant","irritate","islamic","islamist","isolated","isolating","isolation","isotope","issue","issuing","italicize","italics","item","itinerary","itunes","ivory","ivy","jab","jackal","jacket","jackknife","jackpot","jailbird","jailbreak","jailer","jailhouse","jalapeno","jam","janitor","january","jargon","jarring","jasmine","jaundice","jaunt","java","jawed","jawless","jawline","jaws","jaybird","jaywalker","jazz","jeep","jeeringly","jellied","jelly","jersey","jester","jet","jiffy","jigsaw","jimmy","jingle","jingling","jinx","jitters","jittery","job","jockey","jockstrap","jogger","jogging","john","joining","jokester","jokingly","jolliness","jolly","jolt","jot","jovial","joyfully","joylessly","joyous","joyride","joystick","jubilance","jubilant","judge","judgingly","judicial","judiciary","judo","juggle","juggling","jugular","juice","juiciness","juicy","jujitsu","jukebox","july","jumble","jumbo","jump","junction","juncture","june","junior","juniper","junkie","junkman","junkyard","jurist","juror","jury","justice","justifier","justify","justly","justness","juvenile","kabob","kangaroo","karaoke","karate","karma","kebab","keenly","keenness","keep","keg","kelp","kennel","kept","kerchief","kerosene","kettle","kick","kiln","kilobyte","kilogram","kilometer","kilowatt","kilt","kimono","kindle","kindling","kindly","kindness","kindred","kinetic","kinfolk","king","kinship","kinsman","kinswoman","kissable","kisser","kissing","kitchen","kite","kitten","kitty","kiwi","kleenex","knapsack","knee","knelt","knickers","knoll","koala","kooky","kosher","krypton","kudos","kung","labored","laborer","laboring","laborious","labrador","ladder","ladies","ladle","ladybug","ladylike","lagged","lagging","lagoon","lair","lake","lance","landed","landfall","landfill","landing","landlady","landless","landline","landlord","landmark","landmass","landmine","landowner","landscape","landside","landslide","language","lankiness","lanky","lantern","lapdog","lapel","lapped","lapping","laptop","lard","large","lark","lash","lasso","last","latch","late","lather","latitude","latrine","latter","latticed","launch","launder","laundry","laurel","lavender","lavish","laxative","lazily","laziness","lazy","lecturer","left","legacy","legal","legend","legged","leggings","legible","legibly","legislate","lego","legroom","legume","legwarmer","legwork","lemon","lend","length","lens","lent","leotard","lesser","letdown","lethargic","lethargy","letter","lettuce","level","leverage","levers","levitate","levitator","liability","liable","liberty","librarian","library","licking","licorice","lid","life","lifter","lifting","liftoff","ligament","likely","likeness","likewise","liking","lilac","lilly","lily","limb","limeade","limelight","limes","limit","limping","limpness","line","lingo","linguini","linguist","lining","linked","linoleum","linseed","lint","lion","lip","liquefy","liqueur","liquid","lisp","list","litigate","litigator","litmus","litter","little","livable","lived","lively","liver","livestock","lividly","living","lizard","lubricant","lubricate","lucid","luckily","luckiness","luckless","lucrative","ludicrous","lugged","lukewarm","lullaby","lumber","luminance","luminous","lumpiness","lumping","lumpish","lunacy","lunar","lunchbox","luncheon","lunchroom","lunchtime","lung","lurch","lure","luridness","lurk","lushly","lushness","luster","lustfully","lustily","lustiness","lustrous","lusty","luxurious","luxury","lying","lyrically","lyricism","lyricist","lyrics","macarena","macaroni","macaw","mace","machine","machinist","magazine","magenta","maggot","magical","magician","magma","magnesium","magnetic","magnetism","magnetize","magnifier","magnify","magnitude","magnolia","mahogany","maimed","majestic","majesty","majorette","majority","makeover","maker","makeshift","making","malformed","malt","mama","mammal","mammary","mammogram","manager","managing","manatee","mandarin","mandate","mandatory","mandolin","manger","mangle","mango","mangy","manhandle","manhole","manhood","manhunt","manicotti","manicure","manifesto","manila","mankind","manlike","manliness","manly","manmade","manned","mannish","manor","manpower","mantis","mantra","manual","many","map","marathon","marauding","marbled","marbles","marbling","march","mardi","margarine","margarita","margin","marigold","marina","marine","marital","maritime","marlin","marmalade","maroon","married","marrow","marry","marshland","marshy","marsupial","marvelous","marxism","mascot","masculine","mashed","mashing","massager","masses","massive","mastiff","matador","matchbook","matchbox","matcher","matching","matchless","material","maternal","maternity","math","mating","matriarch","matrimony","matrix","matron","matted","matter","maturely","maturing","maturity","mauve","maverick","maximize","maximum","maybe","mayday","mayflower","moaner","moaning","mobile","mobility","mobilize","mobster","mocha","mocker","mockup","modified","modify","modular","modulator","module","moisten","moistness","moisture","molar","molasses","mold","molecular","molecule","molehill","mollusk","mom","monastery","monday","monetary","monetize","moneybags","moneyless","moneywise","mongoose","mongrel","monitor","monkhood","monogamy","monogram","monologue","monopoly","monorail","monotone","monotype","monoxide","monsieur","monsoon","monstrous","monthly","monument","moocher","moodiness","moody","mooing","moonbeam","mooned","moonlight","moonlike","moonlit","moonrise","moonscape","moonshine","moonstone","moonwalk","mop","morale","morality","morally","morbidity","morbidly","morphine","morphing","morse","mortality","mortally","mortician","mortified","mortify","mortuary","mosaic","mossy","most","mothball","mothproof","motion","motivate","motivator","motive","motocross","motor","motto","mountable","mountain","mounted","mounting","mourner","mournful","mouse","mousiness","moustache","mousy","mouth","movable","move","movie","moving","mower","mowing","much","muck","mud","mug","mulberry","mulch","mule","mulled","mullets","multiple","multiply","multitask","multitude","mumble","mumbling","mumbo","mummified","mummify","mummy","mumps","munchkin","mundane","municipal","muppet","mural","murkiness","murky","murmuring","muscular","museum","mushily","mushiness","mushroom","mushy","music","musket","muskiness","musky","mustang","mustard","muster","mustiness","musty","mutable","mutate","mutation","mute","mutilated","mutilator","mutiny","mutt","mutual","muzzle","myself","myspace","mystified","mystify","myth","nacho","nag","nail","name","naming","nanny","nanometer","nape","napkin","napped","napping","nappy","narrow","nastily","nastiness","national","native","nativity","natural","nature","naturist","nautical","navigate","navigator","navy","nearby","nearest","nearly","nearness","neatly","neatness","nebula","nebulizer","nectar","negate","negation","negative","neglector","negligee","negligent","negotiate","nemeses","nemesis","neon","nephew","nerd","nervous","nervy","nest","net","neurology","neuron","neurosis","neurotic","neuter","neutron","never","next","nibble","nickname","nicotine","niece","nifty","nimble","nimbly","nineteen","ninetieth","ninja","nintendo","ninth","nuclear","nuclei","nucleus","nugget","nullify","number","numbing","numbly","numbness","numeral","numerate","numerator","numeric","numerous","nuptials","nursery","nursing","nurture","nutcase","nutlike","nutmeg","nutrient","nutshell","nuttiness","nutty","nuzzle","nylon","oaf","oak","oasis","oat","obedience","obedient","obituary","object","obligate","obliged","oblivion","oblivious","oblong","obnoxious","oboe","obscure","obscurity","observant","observer","observing","obsessed","obsession","obsessive","obsolete","obstacle","obstinate","obstruct","obtain","obtrusive","obtuse","obvious","occultist","occupancy","occupant","occupier","occupy","ocean","ocelot","octagon","octane","october","octopus","ogle","oil","oink","ointment","okay","old","olive","olympics","omega","omen","ominous","omission","omit","omnivore","onboard","oncoming","ongoing","onion","online","onlooker","only","onscreen","onset","onshore","onslaught","onstage","onto","onward","onyx","oops","ooze","oozy","opacity","opal","open","operable","operate","operating","operation","operative","operator","opium","opossum","opponent","oppose","opposing","opposite","oppressed","oppressor","opt","opulently","osmosis","other","otter","ouch","ought","ounce","outage","outback","outbid","outboard","outbound","outbreak","outburst","outcast","outclass","outcome","outdated","outdoors","outer","outfield","outfit","outflank","outgoing","outgrow","outhouse","outing","outlast","outlet","outline","outlook","outlying","outmatch","outmost","outnumber","outplayed","outpost","outpour","output","outrage","outrank","outreach","outright","outscore","outsell","outshine","outshoot","outsider","outskirts","outsmart","outsource","outspoken","outtakes","outthink","outward","outweigh","outwit","oval","ovary","oven","overact","overall","overarch","overbid","overbill","overbite","overblown","overboard","overbook","overbuilt","overcast","overcoat","overcome","overcook","overcrowd","overdraft","overdrawn","overdress","overdrive","overdue","overeager","overeater","overexert","overfed","overfeed","overfill","overflow","overfull","overgrown","overhand","overhang","overhaul","overhead","overhear","overheat","overhung","overjoyed","overkill","overlabor","overlaid","overlap","overlay","overload","overlook","overlord","overlying","overnight","overpass","overpay","overplant","overplay","overpower","overprice","overrate","overreach","overreact","override","overripe","overrule","overrun","overshoot","overshot","oversight","oversized","oversleep","oversold","overspend","overstate","overstay","overstep","overstock","overstuff","oversweet","overtake","overthrow","overtime","overtly","overtone","overture","overturn","overuse","overvalue","overview","overwrite","owl","oxford","oxidant","oxidation","oxidize","oxidizing","oxygen","oxymoron","oyster","ozone","paced","pacemaker","pacific","pacifier","pacifism","pacifist","pacify","padded","padding","paddle","paddling","padlock","pagan","pager","paging","pajamas","palace","palatable","palm","palpable","palpitate","paltry","pampered","pamperer","pampers","pamphlet","panama","pancake","pancreas","panda","pandemic","pang","panhandle","panic","panning","panorama","panoramic","panther","pantomime","pantry","pants","pantyhose","paparazzi","papaya","paper","paprika","papyrus","parabola","parachute","parade","paradox","paragraph","parakeet","paralegal","paralyses","paralysis","paralyze","paramedic","parameter","paramount","parasail","parasite","parasitic","parcel","parched","parchment","pardon","parish","parka","parking","parkway","parlor","parmesan","parole","parrot","parsley","parsnip","partake","parted","parting","partition","partly","partner","partridge","party","passable","passably","passage","passcode","passenger","passerby","passing","passion","passive","passivism","passover","passport","password","pasta","pasted","pastel","pastime","pastor","pastrami","pasture","pasty","patchwork","patchy","paternal","paternity","path","patience","patient","patio","patriarch","patriot","patrol","patronage","patronize","pauper","pavement","paver","pavestone","pavilion","paving","pawing","payable","payback","paycheck","payday","payee","payer","paying","payment","payphone","payroll","pebble","pebbly","pecan","pectin","peculiar","peddling","pediatric","pedicure","pedigree","pedometer","pegboard","pelican","pellet","pelt","pelvis","penalize","penalty","pencil","pendant","pending","penholder","penknife","pennant","penniless","penny","penpal","pension","pentagon","pentagram","pep","perceive","percent","perch","percolate","perennial","perfected","perfectly","perfume","periscope","perish","perjurer","perjury","perkiness","perky","perm","peroxide","perpetual","perplexed","persecute","persevere","persuaded","persuader","pesky","peso","pessimism","pessimist","pester","pesticide","petal","petite","petition","petri","petroleum","petted","petticoat","pettiness","petty","petunia","phantom","phobia","phoenix","phonebook","phoney","phonics","phoniness","phony","phosphate","photo","phrase","phrasing","placard","placate","placidly","plank","planner","plant","plasma","plaster","plastic","plated","platform","plating","platinum","platonic","platter","platypus","plausible","plausibly","playable","playback","player","playful","playgroup","playhouse","playing","playlist","playmaker","playmate","playoff","playpen","playroom","playset","plaything","playtime","plaza","pleading","pleat","pledge","plentiful","plenty","plethora","plexiglas","pliable","plod","plop","plot","plow","ploy","pluck","plug","plunder","plunging","plural","plus","plutonium","plywood","poach","pod","poem","poet","pogo","pointed","pointer","pointing","pointless","pointy","poise","poison","poker","poking","polar","police","policy","polio","polish","politely","polka","polo","polyester","polygon","polygraph","polymer","poncho","pond","pony","popcorn","pope","poplar","popper","poppy","popsicle","populace","popular","populate","porcupine","pork","porous","porridge","portable","portal","portfolio","porthole","portion","portly","portside","poser","posh","posing","possible","possibly","possum","postage","postal","postbox","postcard","posted","poster","posting","postnasal","posture","postwar","pouch","pounce","pouncing","pound","pouring","pout","powdered","powdering","powdery","power","powwow","pox","praising","prance","prancing","pranker","prankish","prankster","prayer","praying","preacher","preaching","preachy","preamble","precinct","precise","precision","precook","precut","predator","predefine","predict","preface","prefix","preflight","preformed","pregame","pregnancy","pregnant","preheated","prelaunch","prelaw","prelude","premiere","premises","premium","prenatal","preoccupy","preorder","prepaid","prepay","preplan","preppy","preschool","prescribe","preseason","preset","preshow","president","presoak","press","presume","presuming","preteen","pretended","pretender","pretense","pretext","pretty","pretzel","prevail","prevalent","prevent","preview","previous","prewar","prewashed","prideful","pried","primal","primarily","primary","primate","primer","primp","princess","print","prior","prism","prison","prissy","pristine","privacy","private","privatize","prize","proactive","probable","probably","probation","probe","probing","probiotic","problem","procedure","process","proclaim","procreate","procurer","prodigal","prodigy","produce","product","profane","profanity","professed","professor","profile","profound","profusely","progeny","prognosis","program","progress","projector","prologue","prolonged","promenade","prominent","promoter","promotion","prompter","promptly","prone","prong","pronounce","pronto","proofing","proofread","proofs","propeller","properly","property","proponent","proposal","propose","props","prorate","protector","protegee","proton","prototype","protozoan","protract","protrude","proud","provable","proved","proven","provided","provider","providing","province","proving","provoke","provoking","provolone","prowess","prowler","prowling","proximity","proxy","prozac","prude","prudishly","prune","pruning","pry","psychic","public","publisher","pucker","pueblo","pug","pull","pulmonary","pulp","pulsate","pulse","pulverize","puma","pumice","pummel","punch","punctual","punctuate","punctured","pungent","punisher","punk","pupil","puppet","puppy","purchase","pureblood","purebred","purely","pureness","purgatory","purge","purging","purifier","purify","purist","puritan","purity","purple","purplish","purposely","purr","purse","pursuable","pursuant","pursuit","purveyor","pushcart","pushchair","pusher","pushiness","pushing","pushover","pushpin","pushup","pushy","putdown","putt","puzzle","puzzling","pyramid","pyromania","python","quack","quadrant","quail","quaintly","quake","quaking","qualified","qualifier","qualify","quality","qualm","quantum","quarrel","quarry","quartered","quarterly","quarters","quartet","quench","query","quicken","quickly","quickness","quicksand","quickstep","quiet","quill","quilt","quintet","quintuple","quirk","quit","quiver","quizzical","quotable","quotation","quote","rabid","race","racing","racism","rack","racoon","radar","radial","radiance","radiantly","radiated","radiation","radiator","radio","radish","raffle","raft","rage","ragged","raging","ragweed","raider","railcar","railing","railroad","railway","raisin","rake","raking","rally","ramble","rambling","ramp","ramrod","ranch","rancidity","random","ranged","ranger","ranging","ranked","ranking","ransack","ranting","rants","rare","rarity","rascal","rash","rasping","ravage","raven","ravine","raving","ravioli","ravishing","reabsorb","reach","reacquire","reaction","reactive","reactor","reaffirm","ream","reanalyze","reappear","reapply","reappoint","reapprove","rearrange","rearview","reason","reassign","reassure","reattach","reawake","rebalance","rebate","rebel","rebirth","reboot","reborn","rebound","rebuff","rebuild","rebuilt","reburial","rebuttal","recall","recant","recapture","recast","recede","recent","recess","recharger","recipient","recital","recite","reckless","reclaim","recliner","reclining","recluse","reclusive","recognize","recoil","recollect","recolor","reconcile","reconfirm","reconvene","recopy","record","recount","recoup","recovery","recreate","rectal","rectangle","rectified","rectify","recycled","recycler","recycling","reemerge","reenact","reenter","reentry","reexamine","referable","referee","reference","refill","refinance","refined","refinery","refining","refinish","reflected","reflector","reflex","reflux","refocus","refold","reforest","reformat","reformed","reformer","reformist","refract","refrain","refreeze","refresh","refried","refueling","refund","refurbish","refurnish","refusal","refuse","refusing","refutable","refute","regain","regalia","regally","reggae","regime","region","register","registrar","registry","regress","regretful","regroup","regular","regulate","regulator","rehab","reheat","rehire","rehydrate","reimburse","reissue","reiterate","rejoice","rejoicing","rejoin","rekindle","relapse","relapsing","relatable","related","relation","relative","relax","relay","relearn","release","relenting","reliable","reliably","reliance","reliant","relic","relieve","relieving","relight","relish","relive","reload","relocate","relock","reluctant","rely","remake","remark","remarry","rematch","remedial","remedy","remember","reminder","remindful","remission","remix","remnant","remodeler","remold","remorse","remote","removable","removal","removed","remover","removing","rename","renderer","rendering","rendition","renegade","renewable","renewably","renewal","renewed","renounce","renovate","renovator","rentable","rental","rented","renter","reoccupy","reoccur","reopen","reorder","repackage","repacking","repaint","repair","repave","repaying","repayment","repeal","repeated","repeater","repent","rephrase","replace","replay","replica","reply","reporter","repose","repossess","repost","repressed","reprimand","reprint","reprise","reproach","reprocess","reproduce","reprogram","reps","reptile","reptilian","repugnant","repulsion","repulsive","repurpose","reputable","reputably","request","require","requisite","reroute","rerun","resale","resample","rescuer","reseal","research","reselect","reseller","resemble","resend","resent","reset","reshape","reshoot","reshuffle","residence","residency","resident","residual","residue","resigned","resilient","resistant","resisting","resize","resolute","resolved","resonant","resonate","resort","resource","respect","resubmit","result","resume","resupply","resurface","resurrect","retail","retainer","retaining","retake","retaliate","retention","rethink","retinal","retired","retiree","retiring","retold","retool","retorted","retouch","retrace","retract","retrain","retread","retreat","retrial","retrieval","retriever","retry","return","retying","retype","reunion","reunite","reusable","reuse","reveal","reveler","revenge","revenue","reverb","revered","reverence","reverend","reversal","reverse","reversing","reversion","revert","revisable","revise","revision","revisit","revivable","revival","reviver","reviving","revocable","revoke","revolt","revolver","revolving","reward","rewash","rewind","rewire","reword","rework","rewrap","rewrite","rhyme","ribbon","ribcage","rice","riches","richly","richness","rickety","ricotta","riddance","ridden","ride","riding","rifling","rift","rigging","rigid","rigor","rimless","rimmed","rind","rink","rinse","rinsing","riot","ripcord","ripeness","ripening","ripping","ripple","rippling","riptide","rise","rising","risk","risotto","ritalin","ritzy","rival","riverbank","riverbed","riverboat","riverside","riveter","riveting","roamer","roaming","roast","robbing","robe","robin","robotics","robust","rockband","rocker","rocket","rockfish","rockiness","rocking","rocklike","rockslide","rockstar","rocky","rogue","roman","romp","rope","roping","roster","rosy","rotten","rotting","rotunda","roulette","rounding","roundish","roundness","roundup","roundworm","routine","routing","rover","roving","royal","rubbed","rubber","rubbing","rubble","rubdown","ruby","ruckus","rudder","rug","ruined","rule","rumble","rumbling","rummage","rumor","runaround","rundown","runner","running","runny","runt","runway","rupture","rural","ruse","rush","rust","rut","sabbath","sabotage","sacrament","sacred","sacrifice","sadden","saddlebag","saddled","saddling","sadly","sadness","safari","safeguard","safehouse","safely","safeness","saffron","saga","sage","sagging","saggy","said","saint","sake","salad","salami","salaried","salary","saline","salon","saloon","salsa","salt","salutary","salute","salvage","salvaging","salvation","same","sample","sampling","sanction","sanctity","sanctuary","sandal","sandbag","sandbank","sandbar","sandblast","sandbox","sanded","sandfish","sanding","sandlot","sandpaper","sandpit","sandstone","sandstorm","sandworm","sandy","sanitary","sanitizer","sank","santa","sapling","sappiness","sappy","sarcasm","sarcastic","sardine","sash","sasquatch","sassy","satchel","satiable","satin","satirical","satisfied","satisfy","saturate","saturday","sauciness","saucy","sauna","savage","savanna","saved","savings","savior","savor","saxophone","say","scabbed","scabby","scalded","scalding","scale","scaling","scallion","scallop","scalping","scam","scandal","scanner","scanning","scant","scapegoat","scarce","scarcity","scarecrow","scared","scarf","scarily","scariness","scarring","scary","scavenger","scenic","schedule","schematic","scheme","scheming","schilling","schnapps","scholar","science","scientist","scion","scoff","scolding","scone","scoop","scooter","scope","scorch","scorebook","scorecard","scored","scoreless","scorer","scoring","scorn","scorpion","scotch","scoundrel","scoured","scouring","scouting","scouts","scowling","scrabble","scraggly","scrambled","scrambler","scrap","scratch","scrawny","screen","scribble","scribe","scribing","scrimmage","script","scroll","scrooge","scrounger","scrubbed","scrubber","scruffy","scrunch","scrutiny","scuba","scuff","sculptor","sculpture","scurvy","scuttle","secluded","secluding","seclusion","second","secrecy","secret","sectional","sector","secular","securely","security","sedan","sedate","sedation","sedative","sediment","seduce","seducing","segment","seismic","seizing","seldom","selected","selection","selective","selector","self","seltzer","semantic","semester","semicolon","semifinal","seminar","semisoft","semisweet","senate","senator","send","senior","senorita","sensation","sensitive","sensitize","sensually","sensuous","sepia","september","septic","septum","sequel","sequence","sequester","series","sermon","serotonin","serpent","serrated","serve","service","serving","sesame","sessions","setback","setting","settle","settling","setup","sevenfold","seventeen","seventh","seventy","severity","shabby","shack","shaded","shadily","shadiness","shading","shadow","shady","shaft","shakable","shakily","shakiness","shaking","shaky","shale","shallot","shallow","shame","shampoo","shamrock","shank","shanty","shape","shaping","share","sharpener","sharper","sharpie","sharply","sharpness","shawl","sheath","shed","sheep","sheet","shelf","shell","shelter","shelve","shelving","sherry","shield","shifter","shifting","shiftless","shifty","shimmer","shimmy","shindig","shine","shingle","shininess","shining","shiny","ship","shirt","shivering","shock","shone","shoplift","shopper","shopping","shoptalk","shore","shortage","shortcake","shortcut","shorten","shorter","shorthand","shortlist","shortly","shortness","shorts","shortwave","shorty","shout","shove","showbiz","showcase","showdown","shower","showgirl","showing","showman","shown","showoff","showpiece","showplace","showroom","showy","shrank","shrapnel","shredder","shredding","shrewdly","shriek","shrill","shrimp","shrine","shrink","shrivel","shrouded","shrubbery","shrubs","shrug","shrunk","shucking","shudder","shuffle","shuffling","shun","shush","shut","shy","siamese","siberian","sibling","siding","sierra","siesta","sift","sighing","silenced","silencer","silent","silica","silicon","silk","silliness","silly","silo","silt","silver","similarly","simile","simmering","simple","simplify","simply","sincere","sincerity","singer","singing","single","singular","sinister","sinless","sinner","sinuous","sip","siren","sister","sitcom","sitter","sitting","situated","situation","sixfold","sixteen","sixth","sixties","sixtieth","sixtyfold","sizable","sizably","size","sizing","sizzle","sizzling","skater","skating","skedaddle","skeletal","skeleton","skeptic","sketch","skewed","skewer","skid","skied","skier","skies","skiing","skilled","skillet","skillful","skimmed","skimmer","skimming","skimpily","skincare","skinhead","skinless","skinning","skinny","skintight","skipper","skipping","skirmish","skirt","skittle","skydiver","skylight","skyline","skype","skyrocket","skyward","slab","slacked","slacker","slacking","slackness","slacks","slain","slam","slander","slang","slapping","slapstick","slashed","slashing","slate","slather","slaw","sled","sleek","sleep","sleet","sleeve","slept","sliceable","sliced","slicer","slicing","slick","slider","slideshow","sliding","slighted","slighting","slightly","slimness","slimy","slinging","slingshot","slinky","slip","slit","sliver","slobbery","slogan","sloped","sloping","sloppily","sloppy","slot","slouching","slouchy","sludge","slug","slum","slurp","slush","sly","small","smartly","smartness","smasher","smashing","smashup","smell","smelting","smile","smilingly","smirk","smite","smith","smitten","smock","smog","smoked","smokeless","smokiness","smoking","smoky","smolder","smooth","smother","smudge","smudgy","smuggler","smuggling","smugly","smugness","snack","snagged","snaking","snap","snare","snarl","snazzy","sneak","sneer","sneeze","sneezing","snide","sniff","snippet","snipping","snitch","snooper","snooze","snore","snoring","snorkel","snort","snout","snowbird","snowboard","snowbound","snowcap","snowdrift","snowdrop","snowfall","snowfield","snowflake","snowiness","snowless","snowman","snowplow","snowshoe","snowstorm","snowsuit","snowy","snub","snuff","snuggle","snugly","snugness","speak","spearfish","spearhead","spearman","spearmint","species","specimen","specked","speckled","specks","spectacle","spectator","spectrum","speculate","speech","speed","spellbind","speller","spelling","spendable","spender","spending","spent","spew","sphere","spherical","sphinx","spider","spied","spiffy","spill","spilt","spinach","spinal","spindle","spinner","spinning","spinout","spinster","spiny","spiral","spirited","spiritism","spirits","spiritual","splashed","splashing","splashy","splatter","spleen","splendid","splendor","splice","splicing","splinter","splotchy","splurge","spoilage","spoiled","spoiler","spoiling","spoils","spoken","spokesman","sponge","spongy","sponsor","spoof","spookily","spooky","spool","spoon","spore","sporting","sports","sporty","spotless","spotlight","spotted","spotter","spotting","spotty","spousal","spouse","spout","sprain","sprang","sprawl","spray","spree","sprig","spring","sprinkled","sprinkler","sprint","sprite","sprout","spruce","sprung","spry","spud","spur","sputter","spyglass","squabble","squad","squall","squander","squash","squatted","squatter","squatting","squeak","squealer","squealing","squeamish","squeegee","squeeze","squeezing","squid","squiggle","squiggly","squint","squire","squirt","squishier","squishy","stability","stabilize","stable","stack","stadium","staff","stage","staging","stagnant","stagnate","stainable","stained","staining","stainless","stalemate","staleness","stalling","stallion","stamina","stammer","stamp","stand","stank","staple","stapling","starboard","starch","stardom","stardust","starfish","stargazer","staring","stark","starless","starlet","starlight","starlit","starring","starry","starship","starter","starting","startle","startling","startup","starved","starving","stash","state","static","statistic","statue","stature","status","statute","statutory","staunch","stays","steadfast","steadier","steadily","steadying","steam","steed","steep","steerable","steering","steersman","stegosaur","stellar","stem","stench","stencil","step","stereo","sterile","sterility","sterilize","sterling","sternness","sternum","stew","stick","stiffen","stiffly","stiffness","stifle","stifling","stillness","stilt","stimulant","stimulate","stimuli","stimulus","stinger","stingily","stinging","stingray","stingy","stinking","stinky","stipend","stipulate","stir","stitch","stock","stoic","stoke","stole","stomp","stonewall","stoneware","stonework","stoning","stony","stood","stooge","stool","stoop","stoplight","stoppable","stoppage","stopped","stopper","stopping","stopwatch","storable","storage","storeroom","storewide","storm","stout","stove","stowaway","stowing","straddle","straggler","strained","strainer","straining","strangely","stranger","strangle","strategic","strategy","stratus","straw","stray","streak","stream","street","strength","strenuous","strep","stress","stretch","strewn","stricken","strict","stride","strife","strike","striking","strive","striving","strobe","strode","stroller","strongbox","strongly","strongman","struck","structure","strudel","struggle","strum","strung","strut","stubbed","stubble","stubbly","stubborn","stucco","stuck","student","studied","studio","study","stuffed","stuffing","stuffy","stumble","stumbling","stump","stung","stunned","stunner","stunning","stunt","stupor","sturdily","sturdy","styling","stylishly","stylist","stylized","stylus","suave","subarctic","subatomic","subdivide","subdued","subduing","subfloor","subgroup","subheader","subject","sublease","sublet","sublevel","sublime","submarine","submerge","submersed","submitter","subpanel","subpar","subplot","subprime","subscribe","subscript","subsector","subside","subsiding","subsidize","subsidy","subsoil","subsonic","substance","subsystem","subtext","subtitle","subtly","subtotal","subtract","subtype","suburb","subway","subwoofer","subzero","succulent","such","suction","sudden","sudoku","suds","sufferer","suffering","suffice","suffix","suffocate","suffrage","sugar","suggest","suing","suitable","suitably","suitcase","suitor","sulfate","sulfide","sulfite","sulfur","sulk","sullen","sulphate","sulphuric","sultry","superbowl","superglue","superhero","superior","superjet","superman","supermom","supernova","supervise","supper","supplier","supply","support","supremacy","supreme","surcharge","surely","sureness","surface","surfacing","surfboard","surfer","surgery","surgical","surging","surname","surpass","surplus","surprise","surreal","surrender","surrogate","surround","survey","survival","survive","surviving","survivor","sushi","suspect","suspend","suspense","sustained","sustainer","swab","swaddling","swagger","swampland","swan","swapping","swarm","sway","swear","sweat","sweep","swell","swept","swerve","swifter","swiftly","swiftness","swimmable","swimmer","swimming","swimsuit","swimwear","swinger","swinging","swipe","swirl","switch","swivel","swizzle","swooned","swoop","swoosh","swore","sworn","swung","sycamore","sympathy","symphonic","symphony","symptom","synapse","syndrome","synergy","synopses","synopsis","synthesis","synthetic","syrup","system","t-shirt","tabasco","tabby","tableful","tables","tablet","tableware","tabloid","tackiness","tacking","tackle","tackling","tacky","taco","tactful","tactical","tactics","tactile","tactless","tadpole","taekwondo","tag","tainted","take","taking","talcum","talisman","tall","talon","tamale","tameness","tamer","tamper","tank","tanned","tannery","tanning","tantrum","tapeless","tapered","tapering","tapestry","tapioca","tapping","taps","tarantula","target","tarmac","tarnish","tarot","tartar","tartly","tartness","task","tassel","taste","tastiness","tasting","tasty","tattered","tattle","tattling","tattoo","taunt","tavern","thank","that","thaw","theater","theatrics","thee","theft","theme","theology","theorize","thermal","thermos","thesaurus","these","thesis","thespian","thicken","thicket","thickness","thieving","thievish","thigh","thimble","thing","think","thinly","thinner","thinness","thinning","thirstily","thirsting","thirsty","thirteen","thirty","thong","thorn","those","thousand","thrash","thread","threaten","threefold","thrift","thrill","thrive","thriving","throat","throbbing","throng","throttle","throwaway","throwback","thrower","throwing","thud","thumb","thumping","thursday","thus","thwarting","thyself","tiara","tibia","tidal","tidbit","tidiness","tidings","tidy","tiger","tighten","tightly","tightness","tightrope","tightwad","tigress","tile","tiling","till","tilt","timid","timing","timothy","tinderbox","tinfoil","tingle","tingling","tingly","tinker","tinkling","tinsel","tinsmith","tint","tinwork","tiny","tipoff","tipped","tipper","tipping","tiptoeing","tiptop","tiring","tissue","trace","tracing","track","traction","tractor","trade","trading","tradition","traffic","tragedy","trailing","trailside","train","traitor","trance","tranquil","transfer","transform","translate","transpire","transport","transpose","trapdoor","trapeze","trapezoid","trapped","trapper","trapping","traps","trash","travel","traverse","travesty","tray","treachery","treading","treadmill","treason","treat","treble","tree","trekker","tremble","trembling","tremor","trench","trend","trespass","triage","trial","triangle","tribesman","tribunal","tribune","tributary","tribute","triceps","trickery","trickily","tricking","trickle","trickster","tricky","tricolor","tricycle","trident","tried","trifle","trifocals","trillion","trilogy","trimester","trimmer","trimming","trimness","trinity","trio","tripod","tripping","triumph","trivial","trodden","trolling","trombone","trophy","tropical","tropics","trouble","troubling","trough","trousers","trout","trowel","truce","truck","truffle","trump","trunks","trustable","trustee","trustful","trusting","trustless","truth","try","tubby","tubeless","tubular","tucking","tuesday","tug","tuition","tulip","tumble","tumbling","tummy","turban","turbine","turbofan","turbojet","turbulent","turf","turkey","turmoil","turret","turtle","tusk","tutor","tutu","tux","tweak","tweed","tweet","tweezers","twelve","twentieth","twenty","twerp","twice","twiddle","twiddling","twig","twilight","twine","twins","twirl","twistable","twisted","twister","twisting","twisty","twitch","twitter","tycoon","tying","tyke","udder","ultimate","ultimatum","ultra","umbilical","umbrella","umpire","unabashed","unable","unadorned","unadvised","unafraid","unaired","unaligned","unaltered","unarmored","unashamed","unaudited","unawake","unaware","unbaked","unbalance","unbeaten","unbend","unbent","unbiased","unbitten","unblended","unblessed","unblock","unbolted","unbounded","unboxed","unbraided","unbridle","unbroken","unbuckled","unbundle","unburned","unbutton","uncanny","uncapped","uncaring","uncertain","unchain","unchanged","uncharted","uncheck","uncivil","unclad","unclaimed","unclamped","unclasp","uncle","unclip","uncloak","unclog","unclothed","uncoated","uncoiled","uncolored","uncombed","uncommon","uncooked","uncork","uncorrupt","uncounted","uncouple","uncouth","uncover","uncross","uncrown","uncrushed","uncured","uncurious","uncurled","uncut","undamaged","undated","undaunted","undead","undecided","undefined","underage","underarm","undercoat","undercook","undercut","underdog","underdone","underfed","underfeed","underfoot","undergo","undergrad","underhand","underline","underling","undermine","undermost","underpaid","underpass","underpay","underrate","undertake","undertone","undertook","undertow","underuse","underwear","underwent","underwire","undesired","undiluted","undivided","undocked","undoing","undone","undrafted","undress","undrilled","undusted","undying","unearned","unearth","unease","uneasily","uneasy","uneatable","uneaten","unedited","unelected","unending","unengaged","unenvied","unequal","unethical","uneven","unexpired","unexposed","unfailing","unfair","unfasten","unfazed","unfeeling","unfiled","unfilled","unfitted","unfitting","unfixable","unfixed","unflawed","unfocused","unfold","unfounded","unframed","unfreeze","unfrosted","unfrozen","unfunded","unglazed","ungloved","unglue","ungodly","ungraded","ungreased","unguarded","unguided","unhappily","unhappy","unharmed","unhealthy","unheard","unhearing","unheated","unhelpful","unhidden","unhinge","unhitched","unholy","unhook","unicorn","unicycle","unified","unifier","uniformed","uniformly","unify","unimpeded","uninjured","uninstall","uninsured","uninvited","union","uniquely","unisexual","unison","unissued","unit","universal","universe","unjustly","unkempt","unkind","unknotted","unknowing","unknown","unlaced","unlatch","unlawful","unleaded","unlearned","unleash","unless","unleveled","unlighted","unlikable","unlimited","unlined","unlinked","unlisted","unlit","unlivable","unloaded","unloader","unlocked","unlocking","unlovable","unloved","unlovely","unloving","unluckily","unlucky","unmade","unmanaged","unmanned","unmapped","unmarked","unmasked","unmasking","unmatched","unmindful","unmixable","unmixed","unmolded","unmoral","unmovable","unmoved","unmoving","unnamable","unnamed","unnatural","unneeded","unnerve","unnerving","unnoticed","unopened","unopposed","unpack","unpadded","unpaid","unpainted","unpaired","unpaved","unpeeled","unpicked","unpiloted","unpinned","unplanned","unplanted","unpleased","unpledged","unplowed","unplug","unpopular","unproven","unquote","unranked","unrated","unraveled","unreached","unread","unreal","unreeling","unrefined","unrelated","unrented","unrest","unretired","unrevised","unrigged","unripe","unrivaled","unroasted","unrobed","unroll","unruffled","unruly","unrushed","unsaddle","unsafe","unsaid","unsalted","unsaved","unsavory","unscathed","unscented","unscrew","unsealed","unseated","unsecured","unseeing","unseemly","unseen","unselect","unselfish","unsent","unsettled","unshackle","unshaken","unshaved","unshaven","unsheathe","unshipped","unsightly","unsigned","unskilled","unsliced","unsmooth","unsnap","unsocial","unsoiled","unsold","unsolved","unsorted","unspoiled","unspoken","unstable","unstaffed","unstamped","unsteady","unsterile","unstirred","unstitch","unstopped","unstuck","unstuffed","unstylish","unsubtle","unsubtly","unsuited","unsure","unsworn","untagged","untainted","untaken","untamed","untangled","untapped","untaxed","unthawed","unthread","untidy","untie","until","untimed","untimely","untitled","untoasted","untold","untouched","untracked","untrained","untreated","untried","untrimmed","untrue","untruth","unturned","untwist","untying","unusable","unused","unusual","unvalued","unvaried","unvarying","unveiled","unveiling","unvented","unviable","unvisited","unvocal","unwanted","unwarlike","unwary","unwashed","unwatched","unweave","unwed","unwelcome","unwell","unwieldy","unwilling","unwind","unwired","unwitting","unwomanly","unworldly","unworn","unworried","unworthy","unwound","unwoven","unwrapped","unwritten","unzip","upbeat","upchuck","upcoming","upcountry","update","upfront","upgrade","upheaval","upheld","uphill","uphold","uplifted","uplifting","upload","upon","upper","upright","uprising","upriver","uproar","uproot","upscale","upside","upstage","upstairs","upstart","upstate","upstream","upstroke","upswing","uptake","uptight","uptown","upturned","upward","upwind","uranium","urban","urchin","urethane","urgency","urgent","urging","urologist","urology","usable","usage","useable","used","uselessly","user","usher","usual","utensil","utility","utilize","utmost","utopia","utter","vacancy","vacant","vacate","vacation","vagabond","vagrancy","vagrantly","vaguely","vagueness","valiant","valid","valium","valley","valuables","value","vanilla","vanish","vanity","vanquish","vantage","vaporizer","variable","variably","varied","variety","various","varmint","varnish","varsity","varying","vascular","vaseline","vastly","vastness","veal","vegan","veggie","vehicular","velcro","velocity","velvet","vendetta","vending","vendor","veneering","vengeful","venomous","ventricle","venture","venue","venus","verbalize","verbally","verbose","verdict","verify","verse","version","versus","vertebrae","vertical","vertigo","very","vessel","vest","veteran","veto","vexingly","viability","viable","vibes","vice","vicinity","victory","video","viewable","viewer","viewing","viewless","viewpoint","vigorous","village","villain","vindicate","vineyard","vintage","violate","violation","violator","violet","violin","viper","viral","virtual","virtuous","virus","visa","viscosity","viscous","viselike","visible","visibly","vision","visiting","visitor","visor","vista","vitality","vitalize","vitally","vitamins","vivacious","vividly","vividness","vixen","vocalist","vocalize","vocally","vocation","voice","voicing","void","volatile","volley","voltage","volumes","voter","voting","voucher","vowed","vowel","voyage","wackiness","wad","wafer","waffle","waged","wager","wages","waggle","wagon","wake","waking","walk","walmart","walnut","walrus","waltz","wand","wannabe","wanted","wanting","wasabi","washable","washbasin","washboard","washbowl","washcloth","washday","washed","washer","washhouse","washing","washout","washroom","washstand","washtub","wasp","wasting","watch","water","waviness","waving","wavy","whacking","whacky","wham","wharf","wheat","whenever","whiff","whimsical","whinny","whiny","whisking","whoever","whole","whomever","whoopee","whooping","whoops","why","wick","widely","widen","widget","widow","width","wieldable","wielder","wife","wifi","wikipedia","wildcard","wildcat","wilder","wildfire","wildfowl","wildland","wildlife","wildly","wildness","willed","willfully","willing","willow","willpower","wilt","wimp","wince","wincing","wind","wing","winking","winner","winnings","winter","wipe","wired","wireless","wiring","wiry","wisdom","wise","wish","wisplike","wispy","wistful","wizard","wobble","wobbling","wobbly","wok","wolf","wolverine","womanhood","womankind","womanless","womanlike","womanly","womb","woof","wooing","wool","woozy","word","work","worried","worrier","worrisome","worry","worsening","worshiper","worst","wound","woven","wow","wrangle","wrath","wreath","wreckage","wrecker","wrecking","wrench","wriggle","wriggly","wrinkle","wrinkly","wrist","writing","written","wrongdoer","wronged","wrongful","wrongly","wrongness","wrought","xbox","xerox","yahoo","yam","yanking","yapping","yard","yarn","yeah","yearbook","yearling","yearly","yearning","yeast","yelling","yelp","yen","yesterday","yiddish","yield","yin","yippee","yo-yo","yodel","yoga","yogurt","yonder","yoyo","yummy","zap","zealous","zebra","zen","zeppelin","zero","zestfully","zesty","zigzagged","zipfile","zipping","zippy","zips","zit","zodiac","zombie","zone","zoning","zookeeper","zoologist","zoology","zoom"]},1682:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSecureRandomNumber=t.getSecureRandomWords=t.getSecureRandomBytes=void 0;const n=r(2370);async function i(e){return(0,n.getSecureRandomBytes)(e)}t.getSecureRandomBytes=i,t.getSecureRandomWords=async function e(t){return e(t)},t.getSecureRandomNumber=async function(e,t){let r=t-e;var n=Math.ceil(Math.log2(r));if(n>53)throw new Error("Range is too large");for(var o=Math.ceil(n/8),s=Math.pow(2,n)-1;;){let t=await i(n),l=8*(o-1),c=0;for(var a=0;a=r))return e+c}}},4870:function(e,t,r){"use strict";var n=r(8287).hp,i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.hmac_sha512=t.hmac_sha512_fallback=void 0;const o=i(r(8343)),s=r(2370);t.hmac_sha512_fallback=async function(e,t){let r="string"==typeof e?n.from(e,"utf-8"):e,i="string"==typeof t?n.from(t,"utf-8"):t;const s=new o.default("SHA-512","HEX",{hmacKey:{value:r.toString("hex"),format:"HEX"}});s.update(i.toString("hex"));const a=s.getHash("HEX");return n.from(a,"hex")},t.hmac_sha512=function(e,t){return(0,s.hmac_sha512)(e,t)}},7796:function(e,t,r){"use strict";var n=r(8287).hp,i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.openBox=t.sealBox=t.signVerify=t.sign=t.keyPairFromSeed=t.keyPairFromSecretKey=void 0;const o=i(r(8947));t.keyPairFromSecretKey=function(e){let t=o.default.sign.keyPair.fromSecretKey(new Uint8Array(e));return{publicKey:n.from(t.publicKey),secretKey:n.from(t.secretKey)}},t.keyPairFromSeed=function(e){let t=o.default.sign.keyPair.fromSeed(new Uint8Array(e));return{publicKey:n.from(t.publicKey),secretKey:n.from(t.secretKey)}},t.sign=function(e,t){return n.from(o.default.sign.detached(new Uint8Array(e),new Uint8Array(t)))},t.signVerify=function(e,t,r){return o.default.sign.detached.verify(new Uint8Array(e),new Uint8Array(t),new Uint8Array(r))},t.sealBox=function(e,t,r){return n.from(o.default.secretbox(e,t,r))},t.openBox=function(e,t,r){let i=o.default.secretbox.open(e,t,r);return i?n.from(i):null}},9256:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pbkdf2_sha512=void 0;const n=r(2370);t.pbkdf2_sha512=function(e,t,r,i){return(0,n.pbkdf2_sha512)(e,t,r,i)}},3269:function(e,t,r){"use strict";var n=r(8287).hp,i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.sha256=t.sha256_fallback=t.sha256_sync=void 0;const o=i(r(8343)),s=r(2370);function a(e){let t;t="string"==typeof e?n.from(e,"utf-8").toString("hex"):e.toString("hex");let r=new o.default("SHA-256","HEX");r.update(t);let i=r.getHash("HEX");return n.from(i,"hex")}t.sha256_sync=a,t.sha256_fallback=async function(e){return a(e)},t.sha256=function(e){return(0,s.sha256)(e)}},6224:function(e,t,r){"use strict";var n=r(8287).hp,i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.sha512=t.sha512_fallback=t.sha512_sync=void 0;const o=i(r(8343)),s=r(2370);function a(e){let t;t="string"==typeof e?n.from(e,"utf-8").toString("hex"):e.toString("hex");let r=new o.default("SHA-512","HEX");r.update(t);let i=r.getHash("HEX");return n.from(i,"hex")}t.sha512_sync=a,t.sha512_fallback=async function(e){return a(e)},t.sha512=async function(e){return(0,s.sha512)(e)}},2202:(e,t,r)=>{"use strict";var n=r(8287).hp;function i(e,t,r){for(;e.length0;)t.push(parseInt(e.slice(0,8),2)),e=e.slice(8);return n.from(t)}},8737:(e,t,r)=>{"use strict";var n=r(8287).hp;Object.defineProperty(t,"__esModule",{value:!0}),t.TonClient=void 0;const i=r(1972),o=r(1307);function s(e){switch(e["@type"]){case"tvm.stackEntryNumber":return{type:"int",value:BigInt(e.number.number)};case"tvm.stackEntryCell":return{type:"cell",cell:o.Cell.fromBase64(e.cell)};case"tvm.stackEntryTuple":return{type:"tuple",items:e.tuple.elements.map(s)};default:throw Error("Unsupported item type: "+e["@type"])}}function a(e){if("num"===e[0]){let t=e[1];return t.startsWith("-")?{type:"int",value:-BigInt(t.slice(1))}:{type:"int",value:BigInt(t)}}if("null"===e[0])return{type:"null"};if("cell"===e[0])return{type:"cell",cell:o.Cell.fromBoc(n.from(e[1].bytes,"base64"))[0]};if("slice"===e[0])return{type:"slice",cell:o.Cell.fromBoc(n.from(e[1].bytes,"base64"))[0]};if("builder"===e[0])return{type:"builder",cell:o.Cell.fromBoc(n.from(e[1].bytes,"base64"))[0]};if("tuple"===e[0]||"list"===e[0])return 0===e[1].elements.length?{type:"null"}:{type:e[0],items:e[1].elements.map(s)};throw Error("Unsupported stack item type: "+e[0])}function l(e){let t=[];for(let r of e)t.push(a(r));return new o.TupleReader(t)}function c(e,t,r){return{async getState(){let r,i=await e.getContractState(t),o=i.balance,s=i.lastTransaction?{lt:BigInt(i.lastTransaction.lt),hash:n.from(i.lastTransaction.hash,"base64")}:null;if("active"===i.state)r={type:"active",code:i.code?i.code:null,data:i.data?i.data:null};else if("uninitialized"===i.state)r={type:"uninit"};else{if("frozen"!==i.state)throw Error("Unsupported state");r={type:"frozen",stateHash:n.alloc(0)}}return{balance:o,last:s,state:r}},get:async(r,n)=>({stack:(await e.callGetMethod(t,r,n)).stack}),async external(n){let i=null;r&&!await e.isContractDeployed(t)&&(i=r);const s=(0,o.external)({to:t,init:i,body:n});let a=(0,o.beginCell)().store((0,o.storeMessage)(s)).endCell().toBoc();await e.sendFile(a)},async internal(n,i){let s=null;r&&!await e.isContractDeployed(t)&&(s=r);let a,l=!0;null!==i.bounce&&void 0!==i.bounce&&(l=i.bounce),a="string"==typeof i.value?(0,o.toNano)(i.value):i.value;let c=null;"string"==typeof i.body?c=(0,o.comment)(i.body):i.body&&(c=i.body),await n.send({to:t,value:a,bounce:l,sendMode:i.sendMode,init:s,body:c})},open:t=>(0,o.openContract)(t,(t=>c(e,t.address,t.init??null))),getTransactions:(t,r,n,i)=>e.getTransactions(t,{limit:i??100,lt:r.toString(),hash:n.toString("base64"),inclusive:!0})}}t.TonClient=class{constructor(e){this.parameters={endpoint:e.endpoint},this.api=new i.HttpApi(this.parameters.endpoint,{timeout:e.timeout,apiKey:e.apiKey,adapter:e.httpAdapter})}async getBalance(e){return(await this.getContractState(e)).balance}async runMethod(e,t,r=[]){let n=await this.api.callGetMethod(e,t,r);if(0!==n.exit_code)throw Error("Unable to execute get method. Got exit_code: "+n.exit_code);return{gas_used:n.gas_used,stack:l(n.stack)}}async callGetMethod(e,t,r=[]){return this.runMethod(e,t,r)}async runMethodWithError(e,t,r=[]){let n=await this.api.callGetMethod(e,t,r);return{gas_used:n.gas_used,stack:l(n.stack),exit_code:n.exit_code}}async callGetMethodWithError(e,t,r=[]){return this.runMethodWithError(e,t,r)}async getTransactions(e,t){let r=await this.api.getTransactions(e,t),i=[];for(let e of r)i.push((0,o.loadTransaction)(o.Cell.fromBoc(n.from(e.data,"base64"))[0].beginParse()));return i}async getTransaction(e,t,r){let i=await this.api.getTransaction(e,t,r);return i?(0,o.loadTransaction)(o.Cell.fromBoc(n.from(i.data,"base64"))[0].beginParse()):null}async tryLocateResultTx(e,t,r){let n=await this.api.tryLocateResultTx(e,t,r);return(0,o.loadTransaction)(o.Cell.fromBase64(n.data).beginParse())}async tryLocateSourceTx(e,t,r){let n=await this.api.tryLocateSourceTx(e,t,r);return(0,o.loadTransaction)(o.Cell.fromBase64(n.data).beginParse())}async getMasterchainInfo(){let e=await this.api.getMasterchainInfo();return{workchain:e.init.workchain,shard:e.last.shard,initSeqno:e.init.seqno,latestSeqno:e.last.seqno}}async getWorkchainShards(e){return(await this.api.getShards(e)).map((e=>({workchain:e.workchain,shard:e.shard,seqno:e.seqno})))}async getShardTransactions(e,t,r){let n=await this.api.getBlockTransactions(e,t,r);if(n.incomplete)throw Error("Unsupported");return n.transactions.map((e=>({account:o.Address.parseRaw(e.account),lt:e.lt,hash:e.hash})))}async sendMessage(e){const t=(0,o.beginCell)().store((0,o.storeMessage)(e)).endCell().toBoc();await this.api.sendBoc(t)}async sendFile(e){await this.api.sendBoc(e)}async estimateExternalMessageFee(e,t){return await this.api.estimateFee(e,{body:t.body,initCode:t.initCode,initData:t.initData,ignoreSignature:t.ignoreSignature})}async sendExternalMessage(e,t){if(await this.isContractDeployed(e.address)||!e.init){const r=(0,o.external)({to:e.address,body:t});await this.sendMessage(r)}else{const r=(0,o.external)({to:e.address,init:e.init,body:t});await this.sendMessage(r)}}async isContractDeployed(e){return"active"===(await this.getContractState(e)).state}async getContractState(e){let t=await this.api.getAddressInformation(e);return{balance:BigInt(t.balance),state:t.state,code:""!==t.code?n.from(t.code,"base64"):null,data:""!==t.data?n.from(t.data,"base64"):null,lastTransaction:"0"!==t.last_transaction_id.lt?{lt:t.last_transaction_id.lt,hash:t.last_transaction_id.hash}:null,blockId:{workchain:t.block_id.workchain,shard:t.block_id.shard,seqno:t.block_id.seqno},timestampt:t.sync_utime}}open(e){return(0,o.openContract)(e,(e=>c(this,e.address,e.init)))}provider(e,t){return c(this,e,t??null)}}},993:function(e,t,r){"use strict";var n,i,o,s=r(8287).hp,a=this&&this.__classPrivateFieldSet||function(e,t,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(e,r):i?i.value=r:t.set(e,r),r},l=this&&this.__classPrivateFieldGet||function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)},c=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.TonClient4=void 0;const d=c(r(6425)),u=r(1307),h=r(8546),f=r(1614);function p(e,t,r,n){return{async getState(){let n=t;null===n&&(n=(await e.getLastBlock()).last.seqno);let i,o=await e.getAccount(n,r),a=o.account.last?{lt:BigInt(o.account.last.lt),hash:s.from(o.account.last.hash,"base64")}:null;if("active"===o.account.state.type)i={type:"active",code:o.account.state.code?s.from(o.account.state.code,"base64"):null,data:o.account.state.data?s.from(o.account.state.data,"base64"):null};else if("uninit"===o.account.state.type)i={type:"uninit"};else{if("frozen"!==o.account.state.type)throw Error("Unsupported state");i={type:"frozen",stateHash:s.from(o.account.state.stateHash,"base64")}}return{balance:BigInt(o.account.balance.coins),last:a,state:i}},async get(n,i){let o=t;null===o&&(o=(await e.getLastBlock()).last.seqno);let s=await e.runMethod(o,r,n,i);if(0!==s.exitCode&&1!==s.exitCode)throw Error("Exit code: "+s.exitCode);return{stack:new u.TupleReader(s.result)}},async external(t){let i=await e.getLastBlock(),o=null;n&&"active"!==(await e.getAccountLite(i.last.seqno,r)).account.state.type&&(o=n);const s=(0,u.external)({to:r,init:o,body:t});let a=(0,u.beginCell)().store((0,u.storeMessage)(s)).endCell().toBoc();await e.sendMessage(a)},async internal(t,i){let o=await e.getLastBlock(),s=null;n&&"active"!==(await e.getAccountLite(o.last.seqno,r)).account.state.type&&(s=n);let a,l=!0;null!==i.bounce&&void 0!==i.bounce&&(l=i.bounce),a="string"==typeof i.value?(0,u.toNano)(i.value):i.value;let c=null;"string"==typeof i.body?c=(0,u.comment)(i.body):i.body&&(c=i.body),await t.send({to:r,value:a,bounce:l,sendMode:i.sendMode,init:s,body:c})},open:r=>(0,u.openContract)(r,(r=>p(e,t,r.address,r.init??null))),async getTransactions(t,r,n,i){const o="number"==typeof i;if(o&&i<=0)return[];let s=[];do{const i=await e.getAccountTransactions(t,r,n),o=i[0].tx,[a,l]=[o.lt,o.hash()];if(s.length>0&&a===r&&l.equals(n)&&i.shift(),0===i.length)break;const c=i[i.length-1].tx,[d,u]=[c.lt,c.hash()];if(d===r&&u.equals(n))break;s.push(...i.map((e=>e.tx))),r=d,n=u}while(o&&s.length0&&(r="/"+[...t].sort().join(","));let s=await d.default.get(l(this,n,"f")+"/block/"+e+"/config"+r,{adapter:l(this,o,"f"),timeout:l(this,i,"f")}),a=_.safeParse(s.data);if(!a.success)throw Error("Mailformed response");return a.data}async runMethod(e,t,r,a){let c=a&&a.length>0?"/"+(0,h.toUrlSafe)((0,u.serializeTuple)(a).toBoc({idx:!1,crc32:!1}).toString("base64")):"",f=l(this,n,"f")+"/block/"+e+"/"+t.toString({urlSafe:!0})+"/run/"+encodeURIComponent(r)+c,p=await d.default.get(f,{adapter:l(this,o,"f"),timeout:l(this,i,"f")}),g=C.safeParse(p.data);if(!g.success)throw Error("Mailformed response");let m=g.data.resultRaw?(0,u.parseTuple)(u.Cell.fromBoc(s.from(g.data.resultRaw,"base64"))[0]):[];return{exitCode:g.data.exitCode,result:m,resultRaw:g.data.resultRaw,block:g.data.block,shardBlock:g.data.shardBlock,reader:new u.TupleReader(m)}}async sendMessage(e){let t=await d.default.post(l(this,n,"f")+"/send",{boc:e.toString("base64")},{adapter:l(this,o,"f"),timeout:l(this,i,"f")});if(!k.safeParse(t.data).success)throw Error("Mailformed response");return{status:t.data.status}}open(e){return(0,u.openContract)(e,(e=>p(this,null,e.address,e.init)))}openAt(e,t){return(0,u.openContract)(t,(t=>p(this,e,t.address,t.init)))}provider(e,t){return p(this,null,e,t??null)}providerAt(e,t,r){return p(this,e,t,r??null)}},n=new WeakMap,i=new WeakMap,o=new WeakMap;const g=f.z.object({last:f.z.object({seqno:f.z.number(),shard:f.z.string(),workchain:f.z.number(),fileHash:f.z.string(),rootHash:f.z.string()}),init:f.z.object({fileHash:f.z.string(),rootHash:f.z.string()}),stateRootHash:f.z.string(),now:f.z.number()}),m=f.z.union([f.z.object({exist:f.z.literal(!1)}),f.z.object({exist:f.z.literal(!0),block:f.z.object({shards:f.z.array(f.z.object({workchain:f.z.number(),seqno:f.z.number(),shard:f.z.string(),rootHash:f.z.string(),fileHash:f.z.string(),transactions:f.z.array(f.z.object({account:f.z.string(),hash:f.z.string(),lt:f.z.string()}))}))})})]),y=f.z.object({lastPaid:f.z.number(),duePayment:f.z.union([f.z.null(),f.z.string()]),used:f.z.object({bits:f.z.number(),cells:f.z.number(),publicCells:f.z.number()})}),b=f.z.object({account:f.z.object({state:f.z.union([f.z.object({type:f.z.literal("uninit")}),f.z.object({type:f.z.literal("active"),code:f.z.union([f.z.string(),f.z.null()]),data:f.z.union([f.z.string(),f.z.null()])}),f.z.object({type:f.z.literal("frozen"),stateHash:f.z.string()})]),balance:f.z.object({coins:f.z.string()}),last:f.z.union([f.z.null(),f.z.object({lt:f.z.string(),hash:f.z.string()})]),storageStat:f.z.union([f.z.null(),y])}),block:f.z.object({workchain:f.z.number(),seqno:f.z.number(),shard:f.z.string(),rootHash:f.z.string(),fileHash:f.z.string()})}),w=f.z.object({account:f.z.object({state:f.z.union([f.z.object({type:f.z.literal("uninit")}),f.z.object({type:f.z.literal("active"),codeHash:f.z.string(),dataHash:f.z.string()}),f.z.object({type:f.z.literal("frozen"),stateHash:f.z.string()})]),balance:f.z.object({coins:f.z.string()}),last:f.z.union([f.z.null(),f.z.object({lt:f.z.string(),hash:f.z.string()})]),storageStat:f.z.union([f.z.null(),y])})}),v=f.z.object({changed:f.z.boolean(),block:f.z.object({workchain:f.z.number(),seqno:f.z.number(),shard:f.z.string(),rootHash:f.z.string(),fileHash:f.z.string()})}),C=f.z.object({exitCode:f.z.number(),resultRaw:f.z.union([f.z.string(),f.z.null()]),block:f.z.object({workchain:f.z.number(),seqno:f.z.number(),shard:f.z.string(),rootHash:f.z.string(),fileHash:f.z.string()}),shardBlock:f.z.object({workchain:f.z.number(),seqno:f.z.number(),shard:f.z.string(),rootHash:f.z.string(),fileHash:f.z.string()})}),_=f.z.object({config:f.z.object({cell:f.z.string(),address:f.z.string(),globalBalance:f.z.object({coins:f.z.string()})})}),k=f.z.object({status:f.z.number()}),x=f.z.array(f.z.object({workchain:f.z.number(),seqno:f.z.number(),shard:f.z.string(),rootHash:f.z.string(),fileHash:f.z.string()})),A=f.z.object({blocks:x,boc:f.z.string()}),S=f.z.object({bits:f.z.number(),data:f.z.string()}),B=f.z.union([f.z.object({type:f.z.literal("internal"),value:f.z.string(),dest:f.z.string(),src:f.z.string(),bounced:f.z.boolean(),bounce:f.z.boolean(),ihrDisabled:f.z.boolean(),createdAt:f.z.number(),createdLt:f.z.string(),fwdFee:f.z.string(),ihrFee:f.z.string()}),f.z.object({type:f.z.literal("external-in"),dest:f.z.string(),src:f.z.union([S,f.z.null()]),importFee:f.z.string()}),f.z.object({type:f.z.literal("external-out"),dest:f.z.union([S,f.z.null()])})]),E=f.z.object({splitDepth:f.z.union([f.z.number(),f.z.null()]),code:f.z.union([f.z.string(),f.z.null()]),data:f.z.union([f.z.string(),f.z.null()]),special:f.z.union([f.z.object({tick:f.z.boolean(),tock:f.z.boolean()}),f.z.null()])}),P=f.z.object({body:f.z.string(),info:B,init:f.z.union([E,f.z.null()])}),I=f.z.union([f.z.literal("uninitialized"),f.z.literal("frozen"),f.z.literal("active"),f.z.literal("non-existing")]),M=f.z.union([f.z.object({type:f.z.literal("comment"),comment:f.z.string()}),f.z.object({type:f.z.literal("payload"),cell:f.z.string()})]),U=f.z.union([f.z.object({kind:f.z.literal("ton"),amount:f.z.string()}),f.z.object({kind:f.z.literal("token"),amount:f.z.string()})]),T=f.z.union([f.z.literal("jetton::excesses"),f.z.literal("jetton::transfer"),f.z.literal("jetton::transfer_notification"),f.z.literal("deposit"),f.z.literal("deposit::ok"),f.z.literal("withdraw"),f.z.literal("withdraw::all"),f.z.literal("withdraw::delayed"),f.z.literal("withdraw::ok"),f.z.literal("airdrop")]),O=f.z.object({type:T,options:f.z.optional(f.z.record(f.z.string()))}),R=f.z.object({address:f.z.string(),comment:f.z.optional(f.z.string()),items:f.z.array(U),op:f.z.optional(O)}),j=f.z.object({address:f.z.string(),lt:f.z.string(),hash:f.z.string(),prevTransaction:f.z.object({lt:f.z.string(),hash:f.z.string()}),time:f.z.number(),outMessagesCount:f.z.number(),oldStatus:I,newStatus:I,fees:f.z.string(),update:f.z.object({oldHash:f.z.string(),newHash:f.z.string()}),inMessage:f.z.union([P,f.z.null()]),outMessages:f.z.array(P),parsed:f.z.object({seqno:f.z.union([f.z.number(),f.z.null()]),body:f.z.union([M,f.z.null()]),status:f.z.union([f.z.literal("success"),f.z.literal("failed"),f.z.literal("pending")]),dest:f.z.union([f.z.string(),f.z.null()]),kind:f.z.union([f.z.literal("out"),f.z.literal("in")]),amount:f.z.string(),resolvedAddress:f.z.string(),bounced:f.z.boolean(),mentioned:f.z.array(f.z.string())}),operation:R}),L=f.z.object({blocks:x,transactions:f.z.array(j)})},1972:function(e,t,r){"use strict";var n=r(8287).hp,i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.HttpApi=void 0;const o=r(2411),s=i(r(9302)),a=i(r(6425)),l=r(1614),c=r(8585).rE,d=l.z.object({"@type":l.z.literal("ton.blockIdExt"),workchain:l.z.number(),shard:l.z.string(),seqno:l.z.number(),root_hash:l.z.string(),file_hash:l.z.string()}),u=l.z.object({balance:l.z.union([l.z.number(),l.z.string()]),state:l.z.union([l.z.literal("active"),l.z.literal("uninitialized"),l.z.literal("frozen")]),data:l.z.string(),code:l.z.string(),last_transaction_id:l.z.object({"@type":l.z.literal("internal.transactionId"),lt:l.z.string(),hash:l.z.string()}),block_id:d,sync_utime:l.z.number()}),h=l.z.object({"@type":l.z.literal("ok")}),f=l.z.object({"@type":l.z.literal("query.fees"),source_fees:l.z.object({"@type":l.z.literal("fees"),in_fwd_fee:l.z.number(),storage_fee:l.z.number(),gas_fee:l.z.number(),fwd_fee:l.z.number()})}),p=l.z.object({gas_used:l.z.number(),exit_code:l.z.number(),stack:l.z.array(l.z.unknown())}),g=l.z.union([l.z.object({"@type":l.z.literal("msg.dataRaw"),body:l.z.string()}),l.z.object({"@type":l.z.literal("msg.dataText"),text:l.z.string()}),l.z.object({"@type":l.z.literal("msg.dataDecryptedText"),text:l.z.string()}),l.z.object({"@type":l.z.literal("msg.dataEncryptedText"),text:l.z.string()})]),m=l.z.object({source:l.z.string(),destination:l.z.string(),value:l.z.string(),fwd_fee:l.z.string(),ihr_fee:l.z.string(),created_lt:l.z.string(),body_hash:l.z.string(),msg_data:g,message:l.z.string()}),y=l.z.object({data:l.z.string(),utime:l.z.number(),transaction_id:l.z.object({lt:l.z.string(),hash:l.z.string()}),fee:l.z.string(),storage_fee:l.z.string(),other_fee:l.z.string(),in_msg:l.z.union([l.z.undefined(),m]),out_msgs:l.z.array(m)}),b=l.z.array(y),w=l.z.object({state_root_hash:l.z.string(),last:d,init:d}),v=l.z.object({shards:l.z.array(d)}),C=l.z.object({"@type":l.z.literal("blocks.shortTxId"),mode:l.z.number(),account:l.z.string(),lt:l.z.string(),hash:l.z.string()}),_=l.z.object({id:d,req_count:l.z.number(),incomplete:l.z.boolean(),transactions:l.z.array(C)});class k{constructor(e,t,r,n){this.namespace=e,this.cache=t,this.codec=r,this.keyEncoder=n}async get(e){let t=await this.cache.get(this.namespace,this.keyEncoder(e));if(t){let e=this.codec.safeParse(JSON.parse(t));if(e.success)return e.data}return null}async set(e,t){null!==t?await this.cache.set(this.namespace,this.keyEncoder(e),JSON.stringify(t)):await this.cache.set(this.namespace,this.keyEncoder(e),null)}}function x(e){let t=[];for(let r of e)if("int"===r.type)t.push(["num",r.value.toString()]);else if("cell"===r.type)t.push(["tvm.Cell",r.cell.toBoc().toString("base64")]);else if("slice"===r.type)t.push(["tvm.Slice",r.cell.toBoc().toString("base64")]);else{if("builder"!==r.type)throw Error("Unsupported stack item type: "+r.type);t.push(["tvm.Builder",r.cell.toBoc().toString("base64")])}return t}t.HttpApi=class{constructor(e,t){this.endpoint=e,this.cache=new o.InMemoryCache,this.parameters={timeout:t?.timeout||3e4,apiKey:t?.apiKey,adapter:t?.adapter},this.shardCache=new k("ton-shard",this.cache,l.z.array(d),(e=>e+"")),this.shardLoader=new s.default((async e=>await Promise.all(e.map((async e=>{const t=await this.shardCache.get(e);if(t)return t;let r=(await this.doCall("shards",{seqno:e},v)).shards;return await this.shardCache.set(e,r),r}))))),this.shardTransactionsCache=new k("ton-shard-tx",this.cache,_,(e=>e.workchain+":"+e.shard+":"+e.seqno)),this.shardTransactionsLoader=new s.default((async e=>await Promise.all(e.map((async e=>{const t=await this.shardTransactionsCache.get(e);if(t)return t;let r=await this.doCall("getBlockTransactions",{workchain:e.workchain,seqno:e.seqno,shard:e.shard},_);return await this.shardTransactionsCache.set(e,r),r})))),{cacheKeyFn:e=>e.workchain+":"+e.shard+":"+e.seqno})}getAddressInformation(e){return this.doCall("getAddressInformation",{address:e.toString()},u)}async getTransactions(e,t){const r=t.inclusive;let i;delete t.inclusive,t.hash&&(i=n.from(t.hash,"base64").toString("hex"));let o=t.limit;t.hash&&t.lt&&!0!==r&&o++;let s=await this.doCall("getTransactions",{address:e.toString(),...t,limit:o,hash:i},b);return s.length>o&&(s=s.slice(0,o)),t.hash&&t.lt&&!0!==r?(s.shift(),s):s}async getMasterchainInfo(){return await this.doCall("getMasterchainInfo",{},w)}async getShards(e){return await this.shardLoader.load(e)}async getBlockTransactions(e,t,r){return await this.shardTransactionsLoader.load({workchain:e,seqno:t,shard:r})}async getTransaction(e,t,r){let i=n.from(r,"base64").toString("hex");return(await this.doCall("getTransactions",{address:e.toString(),lt:t,hash:i,limit:1},b)).find((e=>e.transaction_id.lt===t&&e.transaction_id.hash===r))||null}async callGetMethod(e,t,r){return await this.doCall("runGetMethod",{address:e.toString(),method:t,stack:x(r)},p)}async sendBoc(e){await this.doCall("sendBoc",{boc:e.toString("base64")},h)}async estimateFee(e,t){return await this.doCall("estimateFee",{address:e.toString(),body:t.body.toBoc().toString("base64"),init_data:t.initData?t.initData.toBoc().toString("base64"):"",init_code:t.initCode?t.initCode.toBoc().toString("base64"):"",ignore_chksig:t.ignoreSignature},f)}async tryLocateResultTx(e,t,r){return await this.doCall("tryLocateResultTx",{source:e.toString(),destination:t.toString(),created_lt:r},y)}async tryLocateSourceTx(e,t,r){return await this.doCall("tryLocateSourceTx",{source:e.toString(),destination:t.toString(),created_lt:r},y)}async doCall(e,t,r){let n={"Content-Type":"application/json","X-Ton-Client-Version":c};this.parameters.apiKey&&(n["X-API-Key"]=this.parameters.apiKey);let i=await a.default.post(this.endpoint,JSON.stringify({id:"1",jsonrpc:"2.0",method:e,params:t}),{headers:n,timeout:this.parameters.timeout,adapter:this.parameters.adapter});if(200!==i.status||!i.data.ok)throw Error("Received error: "+JSON.stringify(i.data));let o=r.safeParse(i.data.result);if(o.success)return o.data;throw Error("Malformed response: "+o.error.format()._errors.join(", "))}}},2411:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InMemoryCache=void 0,t.InMemoryCache=class{constructor(){this.cache=new Map,this.set=async(e,t,r)=>{null!==r?this.cache.set(e+"$$"+t,r):this.cache.delete(e+"$$"+t)},this.get=async(e,t)=>{let r=this.cache.get(e+"$$"+t);return void 0!==r?r:null}}}},7017:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseFullConfig=t.loadConfigParamsAsSlice=t.loadConfigParamById=t.parseVotingSetup=t.parseProposalSetup=t.configParse29=t.configParse28=t.configParseMsgPrices=t.configParseGasLimitsPrices=t.configParseBridge=t.configParseValidatorSet=t.configParse12=t.configParseWorkchainDescriptor=t.configParse40=t.configParse8=t.configParse18=t.configParse17=t.configParse16=t.configParse15=t.configParse13=t.configParse5=t.configParseMasterAddressRequired=t.parseBridge=t.parseValidatorSet=t.configParseMasterAddress=void 0;const n=r(1307);function i(e){return e?new n.Address(-1,e.loadBuffer(32)):null}function o(e){if(2390828938!==e.loadUint(32))throw Error("Invalid config");return e.loadBuffer(32)}t.configParseMasterAddress=i;const s={serialize(e,t){throw Error("not implemented")},parse(e){const t=e.loadUint(8);if(83===t)return{publicKey:o(e),weight:e.loadUintBig(64),adnlAddress:null};if(115===t)return{publicKey:o(e),weight:e.loadUintBig(64),adnlAddress:e.loadBuffer(32)};throw Error("Invalid config")}};function a(e){const t=e.loadUint(8);return 17===t?{timeSince:e.loadUint(32),timeUntil:e.loadUint(32),total:e.loadUint(16),main:e.loadUint(16),totalWeight:null,list:e.loadDictDirect(n.Dictionary.Keys.Uint(16),s)}:18===t?{timeSince:e.loadUint(32),timeUntil:e.loadUint(32),total:e.loadUint(16),main:e.loadUint(16),totalWeight:e.loadUintBig(64),list:e.loadDict(n.Dictionary.Keys.Uint(16),s)}:void 0}function l(e){const t=new n.Address(-1,e.loadBuffer(32)),r=new n.Address(-1,e.loadBuffer(32)),i=e.loadDict(n.Dictionary.Keys.Buffer(32),n.Dictionary.Values.Buffer(32)),o=new Map;for(const[e,t]of i)o.set(new n.Address(-1,e).toString(),t);return{bridgeAddress:t,oracleMultisigAddress:r,oracles:o,externalChainAddress:e.loadBuffer(32)}}function c(e){if(!e)throw Error("Invalid config");return i(e)}function d(e){if(!e)throw Error("Invalid config");if(1===e.loadUint(8))return{blackholeAddr:e.loadBit()?new n.Address(-1,e.loadBuffer(32)):null,feeBurnNominator:e.loadUint(32),feeBurnDenominator:e.loadUint(32)};throw new Error("Invalid config")}function u(e){if(!e)throw Error("Invalid config");return{validatorsElectedFor:e.loadUint(32),electorsStartBefore:e.loadUint(32),electorsEndBefore:e.loadUint(32),stakeHeldFor:e.loadUint(32)}}function h(e){if(!e)throw Error("Invalid config");return{maxValidators:e.loadUint(16),maxMainValidators:e.loadUint(16),minValidators:e.loadUint(16)}}function f(e){if(!e)throw Error("Invalid config");return{minStake:e.loadCoins(),maxStake:e.loadCoins(),minTotalStake:e.loadCoins(),maxStakeFactor:e.loadUint(32)}}t.parseValidatorSet=a,t.parseBridge=l,t.configParseMasterAddressRequired=c,t.configParse5=d,t.configParse13=function(e){if(!e)throw Error("Invalid config");if(26===e.loadUint(8))return{deposit:e.loadCoins(),bitPrice:e.loadCoins(),cellPrice:e.loadCoins()};throw new Error("Invalid config")},t.configParse15=u,t.configParse16=h,t.configParse17=f;const p={serialize(e,t){throw Error("not implemented")},parse(e){if(204!==e.loadUint(8))throw Error("Invalid config");return{utime_since:e.loadUint(32),bit_price_ps:e.loadUintBig(64),cell_price_ps:e.loadUintBig(64),mc_bit_price_ps:e.loadUintBig(64),mc_cell_price_ps:e.loadUintBig(64)}}};function g(e){if(!e)throw Error("Invalid config");return e.loadDictDirect(n.Dictionary.Keys.Buffer(4),p).values()}function m(e){return e?{version:e.loadUint(32),capabilities:e.loadUintBig(64)}:{version:0,capabilities:0n}}function y(e){if(!e)return null;if(1!==e.loadUint(8))throw Error("Invalid config");return{defaultFlatFine:e.loadCoins(),defaultProportionaFine:e.loadCoins(),severityFlatMult:e.loadUint(16),severityProportionalMult:e.loadUint(16),unfunishableInterval:e.loadUint(16),longInterval:e.loadUint(16),longFlatMult:e.loadUint(16),longProportionalMult:e.loadUint(16),mediumInterval:e.loadUint(16),mediumFlatMult:e.loadUint(16),mediumProportionalMult:e.loadUint(16)}}t.configParse18=g,t.configParse8=m,t.configParse40=y,t.configParseWorkchainDescriptor=function(e){if(166!==e.loadUint(8))throw Error("Invalid config");const t=e.loadUint(32),r=e.loadUint(8),n=e.loadUint(8),i=e.loadUint(8),o=e.loadBit(),s=e.loadBit(),a=e.loadBit(),l=e.loadUint(13),c=e.loadBuffer(32),d=e.loadBuffer(32),u=e.loadUint(32);if(e.loadBit())throw Error("Invalid config");return{enabledSince:t,actialMinSplit:r,min_split:n,max_split:i,basic:o,active:s,accept_msgs:a,flags:l,zerostateRootHash:c,zerostateFileHash:d,version:u,format:{vmVersion:e.loadUint(32),vmMode:e.loadUintBig(64)}}};const b={serialize(e,t){throw Error("not implemented")},parse(e){if(166!==e.loadUint(8))throw Error("Invalid config");const t=e.loadUint(32),r=e.loadUint(8),n=e.loadUint(8),i=e.loadUint(8),o=e.loadBit(),s=e.loadBit(),a=e.loadBit(),l=e.loadUint(13),c=e.loadBuffer(32),d=e.loadBuffer(32),u=e.loadUint(32);if(e.loadBit())throw Error("Invalid config");return{enabledSince:t,actialMinSplit:r,min_split:n,max_split:i,basic:o,active:s,accept_msgs:a,flags:l,zerostateRootHash:c,zerostateFileHash:d,version:u,format:{vmVersion:e.loadUint(32),vmMode:e.loadUintBig(64)}}}};function w(e){if(!e)throw Error("Invalid config");const t=e.loadDict(n.Dictionary.Keys.Uint(32),b);if(t)return t;throw Error("No workchains exist")}function v(e){return e?a(e):null}function C(e){return e?l(e):null}function _(e){if(!e)throw Error("Invalid config");if(209===e.loadUint(8)){const t=e.loadUintBig(64),r=e.loadUintBig(64),n=function(e){const t=e.loadUint(8);if(222===t)return{gasPrice:e.loadUintBig(64),gasLimit:e.loadUintBig(64),specialGasLimit:e.loadUintBig(64),gasCredit:e.loadUintBig(64),blockGasLimit:e.loadUintBig(64),freezeDueLimit:e.loadUintBig(64),deleteDueLimit:e.loadUintBig(64)};if(221===t)return{gasPrice:e.loadUintBig(64),gasLimit:e.loadUintBig(64),gasCredit:e.loadUintBig(64),blockGasLimit:e.loadUintBig(64),freezeDueLimit:e.loadUintBig(64),deleteDueLimit:e.loadUintBig(64)};throw Error("Invalid config")}(e);return{flatLimit:t,flatGasPrice:r,other:n}}throw Error("Invalid config")}function k(e){if(!e)throw new Error("Invalid config");if(234!==e.loadUint(8))throw new Error("Invalid msg prices param");return{lumpPrice:e.loadUintBig(64),bitPrice:e.loadUintBig(64),cellPrice:e.loadUintBig(64),ihrPriceFactor:e.loadUint(32),firstFrac:e.loadUint(16),nextFrac:e.loadUint(16)}}function x(e){if(!e)throw new Error("Invalid config");const t=e.loadUint(8);if(193===t)return{masterCatchainLifetime:e.loadUint(32),shardCatchainLifetime:e.loadUint(32),shardValidatorsLifetime:e.loadUint(32),shardValidatorsCount:e.loadUint(32)};if(194===t)return{flags:e.loadUint(7),suffleMasterValidators:e.loadBit(),masterCatchainLifetime:e.loadUint(32),shardCatchainLifetime:e.loadUint(32),shardValidatorsLifetime:e.loadUint(32),shardValidatorsCount:e.loadUint(32)};throw new Error("Invalid config")}function A(e){if(!e)throw new Error("Invalid config");const t=e.loadUint(8);if(214===t)return{roundCandidates:e.loadUint(32),nextCandidateDelay:e.loadUint(32),consensusTimeout:e.loadUint(32),fastAttempts:e.loadUint(32),attemptDuration:e.loadUint(32),catchainMaxDeps:e.loadUint(32),maxBlockBytes:e.loadUint(32),maxColaltedBytes:e.loadUint(32)};if(215===t)return{flags:e.loadUint(7),newCatchainIds:e.loadBit(),roundCandidates:e.loadUint(8),nextCandidateDelay:e.loadUint(32),consensusTimeout:e.loadUint(32),fastAttempts:e.loadUint(32),attemptDuration:e.loadUint(32),catchainMaxDeps:e.loadUint(32),maxBlockBytes:e.loadUint(32),maxColaltedBytes:e.loadUint(32)};if(216===t)return{flags:e.loadUint(7),newCatchainIds:e.loadBit(),roundCandidates:e.loadUint(8),nextCandidateDelay:e.loadUint(32),consensusTimeout:e.loadUint(32),fastAttempts:e.loadUint(32),attemptDuration:e.loadUint(32),catchainMaxDeps:e.loadUint(32),maxBlockBytes:e.loadUint(32),maxColaltedBytes:e.loadUint(32),protoVersion:e.loadUint(16)};if(217===t)return{flags:e.loadUint(7),newCatchainIds:e.loadBit(),roundCandidates:e.loadUint(8),nextCandidateDelay:e.loadUint(32),consensusTimeout:e.loadUint(32),fastAttempts:e.loadUint(32),attemptDuration:e.loadUint(32),catchainMaxDeps:e.loadUint(32),maxBlockBytes:e.loadUint(32),maxColaltedBytes:e.loadUint(32),protoVersion:e.loadUint(16),catchainMaxBlocksCoeff:e.loadUint(32)};throw new Error("Invalid config")}function S(e){if(54!==e.loadUint(8))throw new Error("Invalid config");return{minTotalRounds:e.loadUint(8),maxTotalRounds:e.loadUint(8),minWins:e.loadUint(8),maxLoses:e.loadUint(8),minStoreSec:e.loadUint(32),maxStoreSec:e.loadUint(32),bitPrice:e.loadUint(32),cellPrice:e.loadUint(32)}}function B(e){if(!e)throw new Error("Invalid config");if(145!==e.loadUint(8))throw new Error("Invalid config");return{normalParams:S(e.loadRef().beginParse()),criticalParams:S(e.loadRef().beginParse())}}function E(e){return n.Cell.fromBase64(e).beginParse().loadDictDirect(n.Dictionary.Keys.Int(32),n.Dictionary.Values.Cell())}t.configParse12=w,t.configParseValidatorSet=v,t.configParseBridge=C,t.configParseGasLimitsPrices=_,t.configParseMsgPrices=k,t.configParse28=x,t.configParse29=A,t.parseProposalSetup=S,t.parseVotingSetup=B,t.loadConfigParamById=function(e,t){return E(e).get(t)},t.loadConfigParamsAsSlice=function(e){const t=E(e),r=new Map;for(const[e,n]of t)r.set(e,n.beginParse());return r},t.parseFullConfig=function(e){return{configAddress:c(e.get(0)),electorAddress:c(e.get(1)),minterAddress:i(e.get(2)),feeCollectorAddress:i(e.get(3)),dnsRootAddress:i(e.get(4)),burningConfig:d(e.get(5)),globalVersion:m(e.get(8)),workchains:w(e.get(12)),voting:B(e.get(11)),validators:{...u(e.get(15)),...h(e.get(16)),...f(e.get(17))},storagePrices:g(e.get(18)),gasPrices:{masterchain:_(e.get(20)),workchain:_(e.get(21))},msgPrices:{masterchain:k(e.get(24)),workchain:k(e.get(25))},validatorSets:{prevValidators:v(e.get(32)),prevTempValidators:v(e.get(33)),currentValidators:v(e.get(34)),currentTempValidators:v(e.get(35)),nextValidators:v(e.get(36)),nextTempValidators:v(e.get(37))},validatorsPunish:y(e.get(40)),bridges:{ethereum:C(e.get(71)),binance:C(e.get(72)),polygon:C(e.get(73))},catchain:x(e.get(28)),consensus:A(e.get(29))}}},8078:(e,t,r)=>{"use strict";var n=r(8287).hp;Object.defineProperty(t,"__esModule",{value:!0}),t.ElectorContract=void 0;const i=r(1307),o={serialize(e,t){throw Error("not implemented")},parse:e=>({address:new i.Address(-1,e.loadBuffer(32)),weight:e.loadUintBig(64),stake:e.loadCoins()})},s={serialize(e,t){throw Error("not implemented")},parse(e){const t=e.loadCoins();return e.skip(64),{stake:t,address:new i.Address(-1,e.loadBuffer(32)),adnl:e.loadBuffer(32)}}};class a{static create(){return new a}constructor(){this.address=i.Address.parseRaw("-1:3333333333333333333333333333333333333333333333333333333333333333")}async getReturnedStake(e,t){if(-1!==t.workChain)throw Error("Only masterchain addresses could have stake");return(await e.get("compute_returned_stake",[{type:"int",value:BigInt("0x"+t.hash.toString("hex"))}])).stack.readBigNumber()}async getPastElectionsList(e){const t=await e.get("past_elections_list",[]),r=new i.TupleReader(t.stack.readLispList()),n=[];for(;r.remaining>0;){const e=r.readTuple(),t=e.readNumber(),i=e.readNumber();e.pop();const o=e.readNumber();n.push({id:t,unfreezeAt:i,stakeHeld:o})}return n}async getPastElections(e){const t=await e.get("past_elections",[]),r=new i.TupleReader(t.stack.readLispList()),n=[];for(;r.remaining>0;){const e=r.readTuple(),t=e.readNumber(),s=e.readNumber(),a=e.readNumber();e.pop();const l=e.readCell(),c=e.readBigNumber(),d=e.readBigNumber();let u=new Map;const h=l.beginParse().loadDictDirect(i.Dictionary.Keys.Buffer(32),o);for(const[e,t]of h)u.set(BigInt("0x"+e.toString("hex")).toString(10),{address:t.address,weight:t.weight,stake:t.stake});n.push({id:t,unfreezeAt:s,stakeHeld:a,totalStake:c,bonuses:d,frozen:u})}return n}async getElectionEntities(e){const t=await e.getState();if("active"!==t.state.type)throw Error("Unexpected error");const r=i.Cell.fromBoc(t.state.data)[0].beginParse();if(!r.loadBit())return null;const n=r.loadRef().beginParse(),o=n.loadUint(32),a=n.loadUint(32),l=n.loadCoins(),c=n.loadCoins(),d=n.loadDict(i.Dictionary.Keys.Buffer(32),s);let u=[];if(d)for(const[e,t]of d)u.push({pubkey:e,stake:t.stake,address:t.address,adnl:t.adnl});return{minStake:l,allStakes:c,endElectionsTime:a,startWorkTime:o,entities:u}}async getActiveElectionId(e){const t=(await e.get("active_election_id",[])).stack.readNumber();return t>0?t:null}async getComplaints(e,t){const r=new i.TupleBuilder;r.writeNumber(t);const o=await e.get("list_complaints",r.build());if("null"===o.stack.peek().type)return[];const s=new i.TupleReader(o.stack.readLispList()),a=[];for(;s.remaining>0;){const e=s.readTuple(),t=e.readBigNumber(),r=e.readTuple(),o=r.readTuple(),l=n.from(o.readBigNumber().toString(16),"hex"),c=(o.readCell(),o.readNumber()),d=o.readNumber(),u=new i.Address(-1,n.from(o.readBigNumber().toString(16),"hex")),h=o.readBigNumber(),f=o.readBigNumber(),p=o.readBigNumber(),g=[],m=new i.TupleReader(r.readLispList());for(;m.remaining>0;)g.push(m.readNumber());const y=r.readBigNumber(),b=r.readBigNumber();a.push({id:t,publicKey:l,createdAt:c,severity:d,paid:h,suggestedFine:f,suggestedFinePart:p,rewardAddress:u,votes:g,remainingWeight:b,vsetId:y})}return a}}t.ElectorContract=a},3515:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.computeStorageFees=t.computeMessageForwardFees=t.computeGasPrices=t.computeFwdFees=t.computeExternalMessageFees=t.loadConfigParamsAsSlice=t.loadConfigParamById=t.parseFullConfig=t.parseVotingSetup=t.parseValidatorSet=t.parseProposalSetup=t.parseBridge=t.configParseWorkchainDescriptor=t.configParseValidatorSet=t.configParseMsgPrices=t.configParseMasterAddressRequired=t.configParseMasterAddress=t.configParseGasLimitsPrices=t.configParseBridge=t.configParse40=t.configParse29=t.configParse28=t.configParse18=t.configParse17=t.configParse16=t.configParse15=t.configParse13=t.configParse12=t.configParse8=t.configParse5=t.ElectorContract=t.MultisigWallet=t.MultisigOrderBuilder=t.MultisigOrder=t.JettonWallet=t.JettonMaster=t.WalletContractV4=t.WalletContractV3R2=t.WalletContractV3R1=t.WalletContractV2R2=t.WalletContractV2R1=t.WalletContractV1R3=t.WalletContractV1R2=t.WalletContractV1R1=t.TonClient4=t.TonClient=t.HttpApi=void 0,i(r(1307),t);var o=r(1972);Object.defineProperty(t,"HttpApi",{enumerable:!0,get:function(){return o.HttpApi}});var s=r(8737);Object.defineProperty(t,"TonClient",{enumerable:!0,get:function(){return s.TonClient}});var a=r(993);Object.defineProperty(t,"TonClient4",{enumerable:!0,get:function(){return a.TonClient4}});var l=r(4471);Object.defineProperty(t,"WalletContractV1R1",{enumerable:!0,get:function(){return l.WalletContractV1R1}});var c=r(746);Object.defineProperty(t,"WalletContractV1R2",{enumerable:!0,get:function(){return c.WalletContractV1R2}});var d=r(3273);Object.defineProperty(t,"WalletContractV1R3",{enumerable:!0,get:function(){return d.WalletContractV1R3}});var u=r(1902);Object.defineProperty(t,"WalletContractV2R1",{enumerable:!0,get:function(){return u.WalletContractV2R1}});var h=r(9579);Object.defineProperty(t,"WalletContractV2R2",{enumerable:!0,get:function(){return h.WalletContractV2R2}});var f=r(9145);Object.defineProperty(t,"WalletContractV3R1",{enumerable:!0,get:function(){return f.WalletContractV3R1}});var p=r(8784);Object.defineProperty(t,"WalletContractV3R2",{enumerable:!0,get:function(){return p.WalletContractV3R2}});var g=r(7941);Object.defineProperty(t,"WalletContractV4",{enumerable:!0,get:function(){return g.WalletContractV4}});var m=r(4440);Object.defineProperty(t,"JettonMaster",{enumerable:!0,get:function(){return m.JettonMaster}});var y=r(5411);Object.defineProperty(t,"JettonWallet",{enumerable:!0,get:function(){return y.JettonWallet}});var b=r(4204);Object.defineProperty(t,"MultisigOrder",{enumerable:!0,get:function(){return b.MultisigOrder}});var w=r(9673);Object.defineProperty(t,"MultisigOrderBuilder",{enumerable:!0,get:function(){return w.MultisigOrderBuilder}});var v=r(2227);Object.defineProperty(t,"MultisigWallet",{enumerable:!0,get:function(){return v.MultisigWallet}});var C=r(8078);Object.defineProperty(t,"ElectorContract",{enumerable:!0,get:function(){return C.ElectorContract}});var _=r(7017);Object.defineProperty(t,"configParse5",{enumerable:!0,get:function(){return _.configParse5}}),Object.defineProperty(t,"configParse8",{enumerable:!0,get:function(){return _.configParse8}}),Object.defineProperty(t,"configParse12",{enumerable:!0,get:function(){return _.configParse12}}),Object.defineProperty(t,"configParse13",{enumerable:!0,get:function(){return _.configParse13}}),Object.defineProperty(t,"configParse15",{enumerable:!0,get:function(){return _.configParse15}}),Object.defineProperty(t,"configParse16",{enumerable:!0,get:function(){return _.configParse16}}),Object.defineProperty(t,"configParse17",{enumerable:!0,get:function(){return _.configParse17}}),Object.defineProperty(t,"configParse18",{enumerable:!0,get:function(){return _.configParse18}}),Object.defineProperty(t,"configParse28",{enumerable:!0,get:function(){return _.configParse28}}),Object.defineProperty(t,"configParse29",{enumerable:!0,get:function(){return _.configParse29}}),Object.defineProperty(t,"configParse40",{enumerable:!0,get:function(){return _.configParse40}}),Object.defineProperty(t,"configParseBridge",{enumerable:!0,get:function(){return _.configParseBridge}}),Object.defineProperty(t,"configParseGasLimitsPrices",{enumerable:!0,get:function(){return _.configParseGasLimitsPrices}}),Object.defineProperty(t,"configParseMasterAddress",{enumerable:!0,get:function(){return _.configParseMasterAddress}}),Object.defineProperty(t,"configParseMasterAddressRequired",{enumerable:!0,get:function(){return _.configParseMasterAddressRequired}}),Object.defineProperty(t,"configParseMsgPrices",{enumerable:!0,get:function(){return _.configParseMsgPrices}}),Object.defineProperty(t,"configParseValidatorSet",{enumerable:!0,get:function(){return _.configParseValidatorSet}}),Object.defineProperty(t,"configParseWorkchainDescriptor",{enumerable:!0,get:function(){return _.configParseWorkchainDescriptor}}),Object.defineProperty(t,"parseBridge",{enumerable:!0,get:function(){return _.parseBridge}}),Object.defineProperty(t,"parseProposalSetup",{enumerable:!0,get:function(){return _.parseProposalSetup}}),Object.defineProperty(t,"parseValidatorSet",{enumerable:!0,get:function(){return _.parseValidatorSet}}),Object.defineProperty(t,"parseVotingSetup",{enumerable:!0,get:function(){return _.parseVotingSetup}}),Object.defineProperty(t,"parseFullConfig",{enumerable:!0,get:function(){return _.parseFullConfig}}),Object.defineProperty(t,"loadConfigParamById",{enumerable:!0,get:function(){return _.loadConfigParamById}}),Object.defineProperty(t,"loadConfigParamsAsSlice",{enumerable:!0,get:function(){return _.loadConfigParamsAsSlice}});var k=r(868);Object.defineProperty(t,"computeExternalMessageFees",{enumerable:!0,get:function(){return k.computeExternalMessageFees}}),Object.defineProperty(t,"computeFwdFees",{enumerable:!0,get:function(){return k.computeFwdFees}}),Object.defineProperty(t,"computeGasPrices",{enumerable:!0,get:function(){return k.computeGasPrices}}),Object.defineProperty(t,"computeMessageForwardFees",{enumerable:!0,get:function(){return k.computeMessageForwardFees}}),Object.defineProperty(t,"computeStorageFees",{enumerable:!0,get:function(){return k.computeStorageFees}})},4440:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.JettonMaster=void 0;const n=r(1307);class i{static create(e){return new i(e)}constructor(e){this.address=e}async getWalletAddress(e,t){return(await e.get("get_wallet_address",[{type:"slice",cell:(0,n.beginCell)().storeAddress(t).endCell()}])).stack.readAddress()}async getJettonData(e){let t=await e.get("get_jetton_data",[]);return{totalSupply:t.stack.readBigNumber(),mintable:t.stack.readBoolean(),adminAddress:t.stack.readAddress(),content:t.stack.readCell(),walletCode:t.stack.readCell()}}}t.JettonMaster=i},5411:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.JettonWallet=void 0;class r{static create(e){return new r(e)}constructor(e){this.address=e}async getBalance(e){return"active"!==(await e.getState()).state.type?0n:(await e.get("get_wallet_data",[])).stack.readBigNumber()}}t.JettonWallet=r},4204:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MultisigOrder=void 0;const n=r(5269),i=r(1307);class o{constructor(e){this.signatures={},this.payload=e}static fromCell(e){let t=e.beginParse(),r=t.loadMaybeRef()?.beginParse();const n=t.asCell();let i=new o(n);if(r){for(;r.remainingBits>0;){const e=r.loadBuffer(64),t=r.loadUint(8);i.signatures[t]=e,r.remainingRefs>0?r=r.loadRef().asSlice():r.skip(1)}r.endParse()}return i}static fromPayload(e){return new o(e)}addSignature(e,t,r){const i=this.payload.hash();if(!(0,n.signVerify)(i,t,r.owners.get(e).slice(0,-1)))throw Error("invalid signature");this.signatures[e]=t}sign(e,t){const r=this.payload.hash();return this.signatures[e]=(0,n.sign)(r,t),r}unionSignatures(e){this.signatures=Object.assign({},this.signatures,e.signatures)}clearSignatures(){this.signatures={}}toCell(e){let t=(0,i.beginCell)().storeBit(0);for(const e in this.signatures){const r=this.signatures[e];t=(0,i.beginCell)().storeBit(1).storeRef((0,i.beginCell)().storeBuffer(r).storeUint(parseInt(e),8).storeBuilder(t).endCell())}return(0,i.beginCell)().storeUint(e,8).storeBuilder(t).storeBuilder(this.payload.asBuilder()).endCell()}}t.MultisigOrder=o},9673:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MultisigOrderBuilder=void 0;const n=r(1307),i=r(4204);t.MultisigOrderBuilder=class{constructor(e,t){this.messages=(0,n.beginCell)(),this.queryId=0n,this.walletId=e,this.queryOffset=t||7200}addMessage(e,t){if(this.messages.refs>=4)throw Error("only 4 refs are allowed");this.updateQueryId(),this.messages.storeUint(t,8),this.messages.storeRef((0,n.beginCell)().store((0,n.storeMessageRelaxed)(e)).endCell())}clearMessages(){this.messages=(0,n.beginCell)()}build(){return i.MultisigOrder.fromPayload((0,n.beginCell)().storeUint(this.walletId,32).storeUint(this.queryId,64).storeBuilder(this.messages).endCell())}updateQueryId(){const e=BigInt(Math.floor(Date.now()/1e3+this.queryOffset));this.queryId=e<<32n}}},2227:(e,t,r)=>{"use strict";var n=r(8287).hp;Object.defineProperty(t,"__esModule",{value:!0}),t.MultisigWallet=void 0;const i=r(5269),o=r(1307),s=o.Cell.fromBase64("te6ccgECKwEABBgAART/APSkE/S88sgLAQIBIAIDAgFIBAUE2vIgxwCOgzDbPOCDCNcYIPkBAdMH2zwiwAAToVNxePQOb6Hyn9s8VBq6+RDyoAb0BCD5AQHTH1EYuvKq0z9wUwHwCgHCCAGDCryx8mhTFYBA9A5voSCYDqQgwgryZw7f+COqH1NAufJhVCOjU04gIyEiAgLMBgcCASAMDQIBIAgJAgFmCgsAA9GEAiPymAvHoHN9CYbZ5S7Z4BPHohwhJQAtAKkItdJEqCTItdKlwLUAdAT8ArobBKAATwhbpEx4CBukTDgAdAg10rDAJrUAvALyFjPFszJ4HHXI8gBzxb0AMmACASAODwIBIBQVARW77ZbVA0cFUg2zyCoCAUgQEQIBIBITAXOxHXQgwjXGCD5AQHTB4IB1MTtQ9hTIHj0Dm+h8p/XC/9eMfkQ8qCuAfQEIW6TW3Ey4PkBWNs8AaQBgJwA9rtqA6ADoAPoCAXoCEfyAgPyA3XlP+AXkegAA54tkwAAXrhlXP8EA1WZ2oexAAgEgFhcCASAYGQFRtyVbZ4YmRmpGEAgegc30McJNhFpAADMaYeYuAFrgJhwLb+4cC3d0bhAjAYm1WZtnhqvgb+2xxsoicAgej430pBHEoFpAADHDhBACGuQkuuBk9kUWE5kAOeLKhACQCB6IYFImHFImHFImXEA2YlzNijAjAgEgGhsAF7UGtc4QQDVZnah7EAIBIBwdAgOZOB4fARGsGm2eL4G2CUAjABWt+UEAzJV2oewYQAENqTbPBVfBYCMAFa3f3CCAarM7UPYgAiDbPALyZfgAUENxQxPbPO1UIyoACtP/0wcwBKDbPC+uUyCw8mISsQKkJbNTHLmwJYEA4aojoCi8sPJpggGGoPgBBZcCERACPj4wjo0REB/bPEDXePRDEL0F4lQWW1Rz51YQU9zbPFRxClR6vCQlKCYAIO1E0NMf0wfTB9M/9AT0BNEAXgGOGjDSAAHyo9MH0wdQA9cBIPkBBfkBFbrypFAD4GwhIddKqgIi10m68qtwVCATAAwByMv/ywcE1ts87VT4D3AlblOJvrGYEG4QLVDHXwePGzBUJANQTds8UFWgRlAQSRA6SwlTuds8UFQWf+L4AAeDJaGOLCaAQPSWb6UglDBTA7neII4WODk5CNIAAZfTBzAW8AcFkTDifwgHBZJsMeKz5jAGKicoKQBgcI4pA9CDCNcY0wf0BDBTFnj0Dm+h8qXXC/9URUT5EPKmrlIgsVIDvRShI27mbCIyAH5SML6OIF8D+ACTItdKmALTB9QC+wAC6DJwyMoAQBSAQPRDAvAHjhdxyMsAFMsHEssHWM8BWM8WQBOAQPRDAeIBII6KEEUQNEMA2zztVJJfBuIqABzIyx/LB8sHyz/0APQAyQ==");class a{constructor(e,t,r,i,a){this.provider=null,this.owners=o.Dictionary.empty(),this.workchain=t,this.walletId=r,this.k=i;for(let t=0;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.computeMessageForwardFees=t.computeExternalMessageFees=t.computeGasPrices=t.computeFwdFees=t.computeStorageFees=void 0;const n=r(1307);function i(e,t,r){return e.lumpPrice+s(e.bitPrice*r+e.cellPrice*t)}function o(e){let t=e.bits.length,r=1;for(let n of e.refs){let e=o(n);r+=e.cells,t+=e.bits}return{bits:t,cells:r}}function s(e){let t=e>>16n;return 0n!==e%65536n&&(t+=1n),t}t.computeStorageFees=function(e){const{lastPaid:t,now:r,storagePrices:n,storageStat:i,special:o,masterchain:a}=e;if(r<=t||0===n.length||r>16n)},t.computeExternalMessageFees=function(e,t){let r=o(t);return r.bits-=t.bits.length,r.cells-=1,i(e,BigInt(r.cells),BigInt(r.bits))},t.computeMessageForwardFees=function(e,t){let r=(0,n.loadMessageRelaxed)(t.beginParse()),s={bits:0,cells:0};if(r.init){const e=(new n.Cell).asBuilder();(0,n.storeStateInit)(r.init)(e);const t=e.endCell();let i=o(t);i.bits-=t.bits.length,i.cells-=1,s.bits+=i.bits,s.cells+=i.cells}let a=o(r.body);a.bits-=r.body.bits.length,a.cells-=1,s.bits+=a.bits,s.cells+=a.cells;let l=i(e,BigInt(s.cells),BigInt(s.bits)),c=l*BigInt(e.firstFrac)>>16n;return{fees:c,remaining:l-c}}},8546:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toUrlSafe=void 0,t.toUrlSafe=function(e){for(;e.indexOf("/")>=0;)e=e.replace("/","_");for(;e.indexOf("+")>=0;)e=e.replace("+","-");for(;e.indexOf("=")>=0;)e=e.replace("=","");return e}},4471:(e,t,r)=>{"use strict";var n=r(8287).hp;Object.defineProperty(t,"__esModule",{value:!0}),t.WalletContractV1R1=void 0;const i=r(1307),o=r(8193);class s{static create(e){return new s(e.workchain,e.publicKey)}constructor(e,t){this.workchain=e,this.publicKey=t;let r=i.Cell.fromBoc(n.from("te6cckEBAQEARAAAhP8AIN2k8mCBAgDXGCDXCx/tRNDTH9P/0VESuvKhIvkBVBBE+RDyovgAAdMfMSDXSpbTB9QC+wDe0aTIyx/L/8ntVEH98Ik=","base64"))[0],o=(0,i.beginCell)().storeUint(0,32).storeBuffer(t).endCell();this.init={code:r,data:o},this.address=(0,i.contractAddress)(e,{code:r,data:o})}async getBalance(e){return(await e.getState()).balance}async getSeqno(e){let t=await e.getState();return"active"===t.state.type?i.Cell.fromBoc(t.state.data)[0].beginParse().loadUint(32):0}async send(e,t){await e.external(t)}async sendTransfer(e,t){let r=this.createTransfer(t);await this.send(e,r)}createTransfer(e){let t=i.SendMode.PAY_GAS_SEPARATELY;return null!==e.sendMode&&void 0!==e.sendMode&&(t=e.sendMode),(0,o.createWalletTransferV1)({seqno:e.seqno,sendMode:t,secretKey:e.secretKey,message:e.message})}sender(e,t){return{send:async r=>{let n=await this.getSeqno(e),o=this.createTransfer({seqno:n,secretKey:t,sendMode:r.sendMode,message:(0,i.internal)({to:r.to,value:r.value,init:r.init,body:r.body,bounce:r.bounce})});await this.send(e,o)}}}}t.WalletContractV1R1=s},746:(e,t,r)=>{"use strict";var n=r(8287).hp;Object.defineProperty(t,"__esModule",{value:!0}),t.WalletContractV1R2=void 0;const i=r(1307),o=r(8193);class s{static create(e){return new s(e.workchain,e.publicKey)}constructor(e,t){this.workchain=e,this.publicKey=t;let r=i.Cell.fromBoc(n.from("te6cckEBAQEAUwAAov8AIN0gggFMl7qXMO1E0NcLH+Ck8mCBAgDXGCDXCx/tRNDTH9P/0VESuvKhIvkBVBBE+RDyovgAAdMfMSDXSpbTB9QC+wDe0aTIyx/L/8ntVNDieG8=","base64"))[0],o=(0,i.beginCell)().storeUint(0,32).storeBuffer(t).endCell();this.init={code:r,data:o},this.address=(0,i.contractAddress)(e,{code:r,data:o})}async getBalance(e){return(await e.getState()).balance}async getSeqno(e){return"active"===(await e.getState()).state.type?(await e.get("seqno",[])).stack.readNumber():0}async send(e,t){await e.external(t)}async sendTransfer(e,t){let r=this.createTransfer(t);await this.send(e,r)}createTransfer(e){let t=i.SendMode.PAY_GAS_SEPARATELY;return null!==e.sendMode&&void 0!==e.sendMode&&(t=e.sendMode),(0,o.createWalletTransferV1)({seqno:e.seqno,sendMode:t,secretKey:e.secretKey,message:e.message})}sender(e,t){return{send:async r=>{let n=await this.getSeqno(e),o=this.createTransfer({seqno:n,secretKey:t,sendMode:r.sendMode,message:(0,i.internal)({to:r.to,value:r.value,init:r.init,body:r.body,bounce:r.bounce})});await this.send(e,o)}}}}t.WalletContractV1R2=s},3273:(e,t,r)=>{"use strict";var n=r(8287).hp;Object.defineProperty(t,"__esModule",{value:!0}),t.WalletContractV1R3=void 0;const i=r(1307),o=r(8193);class s{static create(e){return new s(e.workchain,e.publicKey)}constructor(e,t){this.workchain=e,this.publicKey=t;let r=i.Cell.fromBoc(n.from("te6cckEBAQEAXwAAuv8AIN0gggFMl7ohggEznLqxnHGw7UTQ0x/XC//jBOCk8mCBAgDXGCDXCx/tRNDTH9P/0VESuvKhIvkBVBBE+RDyovgAAdMfMSDXSpbTB9QC+wDe0aTIyx/L/8ntVLW4bkI=","base64"))[0],o=(0,i.beginCell)().storeUint(0,32).storeBuffer(t).endCell();this.init={code:r,data:o},this.address=(0,i.contractAddress)(e,{code:r,data:o})}async getBalance(e){return(await e.getState()).balance}async getSeqno(e){return"active"===(await e.getState()).state.type?(await e.get("seqno",[])).stack.readNumber():0}async send(e,t){await e.external(t)}async sendTransfer(e,t){let r=this.createTransfer(t);await this.send(e,r)}createTransfer(e){let t=i.SendMode.PAY_GAS_SEPARATELY;return null!==e.sendMode&&void 0!==e.sendMode&&(t=e.sendMode),(0,o.createWalletTransferV1)({seqno:e.seqno,sendMode:t,secretKey:e.secretKey,message:e.message})}sender(e,t){return{send:async r=>{let n=await this.getSeqno(e),o=this.createTransfer({seqno:n,secretKey:t,sendMode:r.sendMode,message:(0,i.internal)({to:r.to,value:r.value,init:r.init,body:r.body,bounce:r.bounce})});await this.send(e,o)}}}}t.WalletContractV1R3=s},1902:(e,t,r)=>{"use strict";var n=r(8287).hp;Object.defineProperty(t,"__esModule",{value:!0}),t.WalletContractV2R1=void 0;const i=r(1307),o=r(8193);class s{static create(e){return new s(e.workchain,e.publicKey)}constructor(e,t){this.workchain=e,this.publicKey=t;let r=i.Cell.fromBoc(n.from("te6cckEBAQEAVwAAqv8AIN0gggFMl7qXMO1E0NcLH+Ck8mCDCNcYINMf0x8B+CO78mPtRNDTH9P/0VExuvKhA/kBVBBC+RDyovgAApMg10qW0wfUAvsA6NGkyMsfy//J7VShNwu2","base64"))[0],o=(0,i.beginCell)().storeUint(0,32).storeBuffer(t).endCell();this.init={code:r,data:o},this.address=(0,i.contractAddress)(e,{code:r,data:o})}async getBalance(e){return(await e.getState()).balance}async getSeqno(e){return"active"===(await e.getState()).state.type?(await e.get("seqno",[])).stack.readNumber():0}async send(e,t){await e.external(t)}async sendTransfer(e,t){let r=this.createTransfer(t);await this.send(e,r)}createTransfer(e){let t=i.SendMode.PAY_GAS_SEPARATELY;return null!==e.sendMode&&void 0!==e.sendMode&&(t=e.sendMode),(0,o.createWalletTransferV2)({seqno:e.seqno,sendMode:t,secretKey:e.secretKey,messages:e.messages,timeout:e.timeout})}sender(e,t){return{send:async r=>{let n=await this.getSeqno(e),o=this.createTransfer({seqno:n,secretKey:t,sendMode:r.sendMode,messages:[(0,i.internal)({to:r.to,value:r.value,init:r.init,body:r.body,bounce:r.bounce})]});await this.send(e,o)}}}}t.WalletContractV2R1=s},9579:(e,t,r)=>{"use strict";var n=r(8287).hp;Object.defineProperty(t,"__esModule",{value:!0}),t.WalletContractV2R2=void 0;const i=r(1307),o=r(8193);class s{static create(e){return new s(e.workchain,e.publicKey)}constructor(e,t){this.workchain=e,this.publicKey=t;let r=i.Cell.fromBoc(n.from("te6cckEBAQEAYwAAwv8AIN0gggFMl7ohggEznLqxnHGw7UTQ0x/XC//jBOCk8mCDCNcYINMf0x8B+CO78mPtRNDTH9P/0VExuvKhA/kBVBBC+RDyovgAApMg10qW0wfUAvsA6NGkyMsfy//J7VQETNeh","base64"))[0],o=(0,i.beginCell)().storeUint(0,32).storeBuffer(t).endCell();this.init={code:r,data:o},this.address=(0,i.contractAddress)(e,{code:r,data:o})}async getBalance(e){return(await e.getState()).balance}async getSeqno(e){return"active"===(await e.getState()).state.type?(await e.get("seqno",[])).stack.readNumber():0}async send(e,t){await e.external(t)}async sendTransfer(e,t){let r=this.createTransfer(t);await this.send(e,r)}createTransfer(e){let t=i.SendMode.PAY_GAS_SEPARATELY;return null!==e.sendMode&&void 0!==e.sendMode&&(t=e.sendMode),(0,o.createWalletTransferV2)({seqno:e.seqno,sendMode:t,secretKey:e.secretKey,messages:e.messages,timeout:e.timeout})}sender(e,t){return{send:async r=>{let n=await this.getSeqno(e),o=this.createTransfer({seqno:n,secretKey:t,sendMode:r.sendMode,messages:[(0,i.internal)({to:r.to,value:r.value,init:r.init,body:r.body,bounce:r.bounce})]});await this.send(e,o)}}}}t.WalletContractV2R2=s},9145:(e,t,r)=>{"use strict";var n=r(8287).hp;Object.defineProperty(t,"__esModule",{value:!0}),t.WalletContractV3R1=void 0;const i=r(1307),o=r(8193);class s{static create(e){return new s(e.workchain,e.publicKey,e.walletId)}constructor(e,t,r){this.workchain=e,this.publicKey=t,this.walletId=null!=r?r:698983191+e;let o=i.Cell.fromBoc(n.from("te6cckEBAQEAYgAAwP8AIN0gggFMl7qXMO1E0NcLH+Ck8mCDCNcYINMf0x/TH/gjE7vyY+1E0NMf0x/T/9FRMrryoVFEuvKiBPkBVBBV+RDyo/gAkyDXSpbTB9QC+wDo0QGkyMsfyx/L/8ntVD++buA=","base64"))[0],s=(0,i.beginCell)().storeUint(0,32).storeUint(this.walletId,32).storeBuffer(t).endCell();this.init={code:o,data:s},this.address=(0,i.contractAddress)(e,{code:o,data:s})}async getBalance(e){return(await e.getState()).balance}async getSeqno(e){return"active"===(await e.getState()).state.type?(await e.get("seqno",[])).stack.readNumber():0}async send(e,t){await e.external(t)}async sendTransfer(e,t){let r=this.createTransfer(t);await this.send(e,r)}createTransfer(e){let t=i.SendMode.PAY_GAS_SEPARATELY;return null!==e.sendMode&&void 0!==e.sendMode&&(t=e.sendMode),(0,o.createWalletTransferV3)({seqno:e.seqno,sendMode:t,secretKey:e.secretKey,messages:e.messages,timeout:e.timeout,walletId:this.walletId})}sender(e,t){return{send:async r=>{let n=await this.getSeqno(e),o=this.createTransfer({seqno:n,secretKey:t,sendMode:r.sendMode,messages:[(0,i.internal)({to:r.to,value:r.value,init:r.init,body:r.body,bounce:r.bounce})]});await this.send(e,o)}}}}t.WalletContractV3R1=s},8784:(e,t,r)=>{"use strict";var n=r(8287).hp;Object.defineProperty(t,"__esModule",{value:!0}),t.WalletContractV3R2=void 0;const i=r(1307),o=r(8193);class s{static create(e){return new s(e.workchain,e.publicKey,e.walletId)}constructor(e,t,r){this.workchain=e,this.publicKey=t,this.walletId=null!=r?r:698983191+e;let o=i.Cell.fromBoc(n.from("te6cckEBAQEAcQAA3v8AIN0gggFMl7ohggEznLqxn3Gw7UTQ0x/THzHXC//jBOCk8mCDCNcYINMf0x/TH/gjE7vyY+1E0NMf0x/T/9FRMrryoVFEuvKiBPkBVBBV+RDyo/gAkyDXSpbTB9QC+wDo0QGkyMsfyx/L/8ntVBC9ba0=","base64"))[0],s=(0,i.beginCell)().storeUint(0,32).storeUint(this.walletId,32).storeBuffer(t).endCell();this.init={code:o,data:s},this.address=(0,i.contractAddress)(e,{code:o,data:s})}async getBalance(e){return(await e.getState()).balance}async getSeqno(e){return"active"===(await e.getState()).state.type?(await e.get("seqno",[])).stack.readNumber():0}async send(e,t){await e.external(t)}async sendTransfer(e,t){let r=this.createTransfer(t);await this.send(e,r)}createTransfer(e){let t=i.SendMode.PAY_GAS_SEPARATELY;return null!==e.sendMode&&void 0!==e.sendMode&&(t=e.sendMode),(0,o.createWalletTransferV3)({seqno:e.seqno,sendMode:t,secretKey:e.secretKey,messages:e.messages,timeout:e.timeout,walletId:this.walletId})}sender(e,t){return{send:async r=>{let n=await this.getSeqno(e),o=this.createTransfer({seqno:n,secretKey:t,sendMode:r.sendMode,messages:[(0,i.internal)({to:r.to,value:r.value,init:r.init,body:r.body,bounce:r.bounce})]});await this.send(e,o)}}}}t.WalletContractV3R2=s},7941:(e,t,r)=>{"use strict";var n=r(8287).hp;Object.defineProperty(t,"__esModule",{value:!0}),t.WalletContractV4=void 0;const i=r(1307),o=r(8193);class s{static create(e){return new s(e.workchain,e.publicKey,e.walletId)}constructor(e,t,r){this.workchain=e,this.publicKey=t,this.walletId=null!=r?r:698983191+e;let o=i.Cell.fromBoc(n.from("te6ccgECFAEAAtQAART/APSkE/S88sgLAQIBIAIDAgFIBAUE+PKDCNcYINMf0x/THwL4I7vyZO1E0NMf0x/T//QE0VFDuvKhUVG68qIF+QFUEGT5EPKj+AAkpMjLH1JAyx9SMMv/UhD0AMntVPgPAdMHIcAAn2xRkyDXSpbTB9QC+wDoMOAhwAHjACHAAuMAAcADkTDjDQOkyMsfEssfy/8QERITAubQAdDTAyFxsJJfBOAi10nBIJJfBOAC0x8hghBwbHVnvSKCEGRzdHK9sJJfBeAD+kAwIPpEAcjKB8v/ydDtRNCBAUDXIfQEMFyBAQj0Cm+hMbOSXwfgBdM/yCWCEHBsdWe6kjgw4w0DghBkc3RyupJfBuMNBgcCASAICQB4AfoA9AQw+CdvIjBQCqEhvvLgUIIQcGx1Z4MesXCAGFAEywUmzxZY+gIZ9ADLaRfLH1Jgyz8gyYBA+wAGAIpQBIEBCPRZMO1E0IEBQNcgyAHPFvQAye1UAXKwjiOCEGRzdHKDHrFwgBhQBcsFUAPPFiP6AhPLassfyz/JgED7AJJfA+ICASAKCwBZvSQrb2omhAgKBrkPoCGEcNQICEekk30pkQzmkD6f+YN4EoAbeBAUiYcVnzGEAgFYDA0AEbjJftRNDXCx+AA9sp37UTQgQFA1yH0BDACyMoHy//J0AGBAQj0Cm+hMYAIBIA4PABmtznaiaEAga5Drhf/AABmvHfaiaEAQa5DrhY/AAG7SB/oA1NQi+QAFyMoHFcv/ydB3dIAYyMsFywIizxZQBfoCFMtrEszMyXP7AMhAFIEBCPRR8qcCAHCBAQjXGPoA0z/IVCBHgQEI9FHyp4IQbm90ZXB0gBjIywXLAlAGzxZQBPoCFMtqEssfyz/Jc/sAAgBsgQEI1xj6ANM/MFIkgQEI9Fnyp4IQZHN0cnB0gBjIywXLAlAFzxZQA/oCE8tqyx8Syz/Jc/sAAAr0AMntVA==","base64"))[0],s=(0,i.beginCell)().storeUint(0,32).storeUint(this.walletId,32).storeBuffer(this.publicKey).storeBit(0).endCell();this.init={code:o,data:s},this.address=(0,i.contractAddress)(e,{code:o,data:s})}async getBalance(e){return(await e.getState()).balance}async getSeqno(e){return"active"===(await e.getState()).state.type?(await e.get("seqno",[])).stack.readNumber():0}async send(e,t){await e.external(t)}async sendTransfer(e,t){let r=this.createTransfer(t);await this.send(e,r)}createTransfer(e){let t=i.SendMode.PAY_GAS_SEPARATELY;return null!==e.sendMode&&void 0!==e.sendMode&&(t=e.sendMode),(0,o.createWalletTransferV4)({seqno:e.seqno,sendMode:t,secretKey:e.secretKey,messages:e.messages,timeout:e.timeout,walletId:this.walletId})}sender(e,t){return{send:async r=>{let n=await this.getSeqno(e),o=this.createTransfer({seqno:n,secretKey:t,sendMode:r.sendMode,messages:[(0,i.internal)({to:r.to,value:r.value,init:r.init,body:r.body,bounce:r.bounce})]});await this.send(e,o)}}}}t.WalletContractV4=s},8193:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createWalletTransferV4=t.createWalletTransferV3=t.createWalletTransferV2=t.createWalletTransferV1=void 0;const n=r(1307),i=r(5269);t.createWalletTransferV1=function(e){let t=(0,n.beginCell)().storeUint(e.seqno,32);e.message&&(t.storeUint(e.sendMode,8),t.storeRef((0,n.beginCell)().store((0,n.storeMessageRelaxed)(e.message))));let r=(0,i.sign)(t.endCell().hash(),e.secretKey);return(0,n.beginCell)().storeBuffer(r).storeBuilder(t).endCell()},t.createWalletTransferV2=function(e){if(e.messages.length>4)throw Error("Maximum number of messages in a single transfer is 4");let t=(0,n.beginCell)().storeUint(e.seqno,32);if(0===e.seqno)for(let e=0;e<32;e++)t.storeBit(1);else t.storeUint(e.timeout||Math.floor(Date.now()/1e3)+60,32);for(let r of e.messages)t.storeUint(e.sendMode,8),t.storeRef((0,n.beginCell)().store((0,n.storeMessageRelaxed)(r)));let r=(0,i.sign)(t.endCell().hash(),e.secretKey);return(0,n.beginCell)().storeBuffer(r).storeBuilder(t).endCell()},t.createWalletTransferV3=function(e){if(e.messages.length>4)throw Error("Maximum number of messages in a single transfer is 4");let t=(0,n.beginCell)().storeUint(e.walletId,32);if(0===e.seqno)for(let e=0;e<32;e++)t.storeBit(1);else t.storeUint(e.timeout||Math.floor(Date.now()/1e3)+60,32);t.storeUint(e.seqno,32);for(let r of e.messages)t.storeUint(e.sendMode,8),t.storeRef((0,n.beginCell)().store((0,n.storeMessageRelaxed)(r)));let r=(0,i.sign)(t.endCell().hash(),e.secretKey);return(0,n.beginCell)().storeBuffer(r).storeBuilder(t).endCell()},t.createWalletTransferV4=function(e){if(e.messages.length>4)throw Error("Maximum number of messages in a single transfer is 4");let t=(0,n.beginCell)().storeUint(e.walletId,32);if(0===e.seqno)for(let e=0;e<32;e++)t.storeBit(1);else t.storeUint(e.timeout||Math.floor(Date.now()/1e3)+60,32);t.storeUint(e.seqno,32),t.storeUint(0,8);for(let r of e.messages)t.storeUint(e.sendMode,8),t.storeRef((0,n.beginCell)().store((0,n.storeMessageRelaxed)(r)));let r=(0,i.sign)(t.endCell().hash(),e.secretKey);return(0,n.beginCell)().storeBuffer(r).storeBuilder(t).endCell()}},7526:(e,t)=>{"use strict";t.byteLength=function(e){var t=a(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,o=a(e),s=o[0],l=o[1],c=new i(function(e,t,r){return 3*(t+r)/4-r}(0,s,l)),d=0,u=l>0?s-4:s;for(r=0;r>16&255,c[d++]=t>>8&255,c[d++]=255&t;return 2===l&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,c[d++]=255&t),1===l&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,c[d++]=t>>8&255,c[d++]=255&t),c},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,o=[],s=16383,a=0,c=n-i;ac?c:a+s));return 1===i?(t=e[n-1],o.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],o.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),o.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0;s<64;++s)r[s]=o[s],n[o.charCodeAt(s)]=s;function a(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function l(e,t,n){for(var i,o,s=[],a=t;a>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},8287:(e,t,r)=>{"use strict";var n=r(7526),i=r(251),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.hp=l,t.IS=50;var s=2147483647;function a(e){if(e>s)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,l.prototype),t}function l(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return u(e)}return c(e,t,r)}function c(e,t,r){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!l.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var r=0|g(e,t),n=a(r),i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if($(e,Uint8Array)){var t=new Uint8Array(e);return f(t.buffer,t.byteOffset,t.byteLength)}return h(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if($(e,ArrayBuffer)||e&&$(e.buffer,ArrayBuffer))return f(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&($(e,SharedArrayBuffer)||e&&$(e.buffer,SharedArrayBuffer)))return f(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return l.from(n,t,r);var i=function(e){if(l.isBuffer(e)){var t=0|p(e.length),r=a(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||F(e.length)?a(0):h(e):"Buffer"===e.type&&Array.isArray(e.data)?h(e.data):void 0}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return l.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function d(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function u(e){return d(e),a(e<0?0:0|p(e))}function h(e){for(var t=e.length<0?0:0|p(e.length),r=a(t),n=0;n=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|e}function g(e,t){if(l.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||$(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return z(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return N(e).length;default:if(i)return n?-1:z(e).length;t=(""+t).toLowerCase(),i=!0}}function m(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return I(this,t,r);case"utf8":case"utf-8":return S(this,t,r);case"ascii":return E(this,t,r);case"latin1":case"binary":return P(this,t,r);case"base64":return A(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function y(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function b(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),F(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=l.from(t,n)),l.isBuffer(t))return 0===t.length?-1:w(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):w(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function w(e,t,r,n,i){var o,s=1,a=e.length,l=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s=2,a/=2,l/=2,r/=2}function c(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){var d=-1;for(o=r;oa&&(r=a-l),o=r;o>=0;o--){for(var u=!0,h=0;hi&&(n=i):n=i;var o=t.length;n>o/2&&(n=o/2);for(var s=0;s>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function A(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function S(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i239?4:c>223?3:c>191?2:1;if(i+u<=r)switch(u){case 1:c<128&&(d=c);break;case 2:128==(192&(o=e[i+1]))&&(l=(31&c)<<6|63&o)>127&&(d=l);break;case 3:o=e[i+1],s=e[i+2],128==(192&o)&&128==(192&s)&&(l=(15&c)<<12|(63&o)<<6|63&s)>2047&&(l<55296||l>57343)&&(d=l);break;case 4:o=e[i+1],s=e[i+2],a=e[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(l=(15&c)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&l<1114112&&(d=l)}null===d?(d=65533,u=1):d>65535&&(d-=65536,n.push(d>>>10&1023|55296),d=56320|1023&d),n.push(d),i+=u}return function(e){var t=e.length;if(t<=B)return String.fromCharCode.apply(String,e);for(var r="",n=0;nn.length?l.from(o).copy(n,i):Uint8Array.prototype.set.call(n,o,i);else{if(!l.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,i)}i+=o.length}return n},l.byteLength=g,l.prototype._isBuffer=!0,l.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;tr&&(e+=" ... "),""},o&&(l.prototype[o]=l.prototype.inspect),l.prototype.compare=function(e,t,r,n,i){if($(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),!l.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(t>>>=0),a=Math.min(o,s),c=this.slice(n,i),d=e.slice(t,r),u=0;u>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return v(this,e,t,r);case"utf8":case"utf-8":return C(this,e,t,r);case"ascii":case"latin1":case"binary":return _(this,e,t,r);case"base64":return k(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var B=4096;function E(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;in)&&(r=n);for(var i="",o=t;or)throw new RangeError("Trying to access beyond buffer length")}function T(e,t,r,n,i,o){if(!l.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function O(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function R(e,t,r,n,o){return t=+t,r>>>=0,o||O(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function j(e,t,r,n,o){return t=+t,r>>>=0,o||O(e,0,r,8),i.write(e,t,r,n,52,8),r+8}l.prototype.slice=function(e,t){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t>>=0,t>>>=0,r||U(e,t,this.length);for(var n=this[e],i=1,o=0;++o>>=0,t>>>=0,r||U(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},l.prototype.readUint8=l.prototype.readUInt8=function(e,t){return e>>>=0,t||U(e,1,this.length),this[e]},l.prototype.readUint16LE=l.prototype.readUInt16LE=function(e,t){return e>>>=0,t||U(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUint16BE=l.prototype.readUInt16BE=function(e,t){return e>>>=0,t||U(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUint32LE=l.prototype.readUInt32LE=function(e,t){return e>>>=0,t||U(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},l.prototype.readUint32BE=l.prototype.readUInt32BE=function(e,t){return e>>>=0,t||U(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},l.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||U(e,t,this.length);for(var n=this[e],i=1,o=0;++o=(i*=128)&&(n-=Math.pow(2,8*t)),n},l.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||U(e,t,this.length);for(var n=t,i=1,o=this[e+--n];n>0&&(i*=256);)o+=this[e+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},l.prototype.readInt8=function(e,t){return e>>>=0,t||U(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},l.prototype.readInt16LE=function(e,t){e>>>=0,t||U(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt16BE=function(e,t){e>>>=0,t||U(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt32LE=function(e,t){return e>>>=0,t||U(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},l.prototype.readInt32BE=function(e,t){return e>>>=0,t||U(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},l.prototype.readFloatLE=function(e,t){return e>>>=0,t||U(e,4,this.length),i.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return e>>>=0,t||U(e,4,this.length),i.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return e>>>=0,t||U(e,8,this.length),i.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return e>>>=0,t||U(e,8,this.length),i.read(this,e,!1,52,8)},l.prototype.writeUintLE=l.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||T(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[t]=255&e;++o>>=0,r>>>=0,n||T(this,e,t,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},l.prototype.writeUint8=l.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,1,255,0),this[t]=255&e,t+1},l.prototype.writeUint16LE=l.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},l.prototype.writeUint16BE=l.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},l.prototype.writeUint32LE=l.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},l.prototype.writeUint32BE=l.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},l.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);T(this,e,t,r,i-1,-i)}var o=0,s=1,a=0;for(this[t]=255&e;++o>>=0,!n){var i=Math.pow(2,8*r-1);T(this,e,t,r,i-1,-i)}var o=r-1,s=1,a=0;for(this[t+o]=255&e;--o>=0&&(s*=256);)e<0&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/s|0)-a&255;return t+r},l.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},l.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},l.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},l.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},l.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},l.prototype.writeFloatLE=function(e,t,r){return R(this,e,t,!0,r)},l.prototype.writeFloatBE=function(e,t,r){return R(this,e,t,!1,r)},l.prototype.writeDoubleLE=function(e,t,r){return j(this,e,t,!0,r)},l.prototype.writeDoubleBE=function(e,t,r){return j(this,e,t,!1,r)},l.prototype.copy=function(e,t,r,n){if(!l.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(o=t;o55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function N(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(L,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function D(e,t,r,n){for(var i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function $(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function F(e){return e!=e}var K=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var n=16*r,i=0;i<16;++i)t[n+i]=e[r]+e[i];return t}()},9302:e=>{"use strict";var t,r=function(){function e(e,t){if("function"!=typeof e)throw new TypeError("DataLoader must be constructed with a function which accepts Array and returns Promise>, but got: "+e+".");this._batchLoadFn=e,this._maxBatchSize=function(e){if(!(!e||!1!==e.batch))return 1;var t=e&&e.maxBatchSize;if(void 0===t)return 1/0;if("number"!=typeof t||t<1)throw new TypeError("maxBatchSize must be a positive number: "+t);return t}(t),this._batchScheduleFn=function(e){var t=e&&e.batchScheduleFn;if(void 0===t)return n;if("function"!=typeof t)throw new TypeError("batchScheduleFn must be a function: "+t);return t}(t),this._cacheKeyFn=function(e){var t=e&&e.cacheKeyFn;if(void 0===t)return function(e){return e};if("function"!=typeof t)throw new TypeError("cacheKeyFn must be a function: "+t);return t}(t),this._cacheMap=function(e){if(!(!e||!1!==e.cache))return null;var t=e&&e.cacheMap;if(void 0===t)return new Map;if(null!==t){var r=["get","set","delete","clear"].filter((function(e){return t&&"function"!=typeof t[e]}));if(0!==r.length)throw new TypeError("Custom cacheMap missing methods: "+r.join(", "))}return t}(t),this._batch=null,this.name=function(e){return e&&e.name?e.name:null}(t)}var t=e.prototype;return t.load=function(e){if(null==e)throw new TypeError("The loader.load() function must be called with a value, but got: "+String(e)+".");var t=function(e){var t=e._batch;if(null!==t&&!t.hasDispatched&&t.keys.length and returns Promise>, but the function errored synchronously: "+String(r)+"."))}if(!r||"function"!=typeof r.then)return i(e,t,new TypeError("DataLoader must be constructed with a function which accepts Array and returns Promise>, but the function did not return a Promise: "+String(r)+"."));r.then((function(e){if(!s(e))throw new TypeError("DataLoader must be constructed with a function which accepts Array and returns Promise>, but the function did not return a Promise of an Array: "+String(e)+".");if(e.length!==t.keys.length)throw new TypeError("DataLoader must be constructed with a function which accepts Array and returns Promise>, but the function did not return a Promise of an Array of the same length as the Array of keys.\n\nKeys:\n"+String(t.keys)+"\n\nValues:\n"+String(e));o(t);for(var r=0;r but got: "+e+".");for(var t=[],r=0;r0&&Object.prototype.hasOwnProperty.call(e,e.length-1))}e.exports=r},4744:e=>{"use strict";var t=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===r}(e)}(e)},r="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function n(e,t){return!1!==t.clone&&t.isMergeableObject(e)?a((r=e,Array.isArray(r)?[]:{}),e,t):e;var r}function i(e,t,r){return e.concat(t).map((function(e){return n(e,r)}))}function o(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter((function(t){return Object.propertyIsEnumerable.call(e,t)})):[]}(e))}function s(e,t){try{return t in e}catch(e){return!1}}function a(e,r,l){(l=l||{}).arrayMerge=l.arrayMerge||i,l.isMergeableObject=l.isMergeableObject||t,l.cloneUnlessOtherwiseSpecified=n;var c=Array.isArray(r);return c===Array.isArray(e)?c?l.arrayMerge(e,r,l):function(e,t,r){var i={};return r.isMergeableObject(e)&&o(e).forEach((function(t){i[t]=n(e[t],r)})),o(t).forEach((function(o){(function(e,t){return s(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,o)||(s(e,o)&&r.isMergeableObject(t[o])?i[o]=function(e,t){if(!t.customMerge)return a;var r=t.customMerge(e);return"function"==typeof r?r:a}(o,r)(e[o],t[o],r):i[o]=n(t[o],r))})),i}(e,r,l):n(r,l)}a.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,r){return a(e,r,t)}),{})};var l=a;e.exports=l},251:(e,t)=>{t.read=function(e,t,r,n,i){var o,s,a=8*i-n-1,l=(1<>1,d=-7,u=r?i-1:0,h=r?-1:1,f=e[t+u];for(u+=h,o=f&(1<<-d)-1,f>>=-d,d+=a;d>0;o=256*o+e[t+u],u+=h,d-=8);for(s=o&(1<<-d)-1,o>>=-d,d+=n;d>0;s=256*s+e[t+u],u+=h,d-=8);if(0===o)o=1-c;else{if(o===l)return s?NaN:1/0*(f?-1:1);s+=Math.pow(2,n),o-=c}return(f?-1:1)*s*Math.pow(2,o-n)},t.write=function(e,t,r,n,i,o){var s,a,l,c=8*o-i-1,d=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:o-1,p=n?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=d):(s=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-s))<1&&(s--,l*=2),(t+=s+u>=1?h/l:h*Math.pow(2,1-u))*l>=2&&(s++,l/=2),s+u>=d?(a=0,s=d):s+u>=1?(a=(t*l-1)*Math.pow(2,i),s+=u):(a=t*Math.pow(2,u-1)*Math.pow(2,i),s=0));i>=8;e[r+f]=255&a,f+=p,a/=256,i-=8);for(s=s<0;e[r+f]=255&s,f+=p,s/=256,c-=8);e[r+f-p]|=128*g}},8343:function(e){e.exports=function(){"use strict";var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function t(e,t,r,n){var i,o,s,a=t||[0],l=(r=r||0)>>>3,c=-1===n?3:0;for(i=0;i>>2,a.length<=o&&a.push(0),a[o]|=e[i]<<8*(c+n*(s%4));return{value:a,binLen:8*e.length+r}}function r(r,n,i){switch(n){case"UTF8":case"UTF16BE":case"UTF16LE":break;default:throw new Error("encoding must be UTF8, UTF16BE, or UTF16LE")}switch(r){case"HEX":return function(e,t,r){return function(e,t,r,n){var i,o,s,a;if(0!=e.length%2)throw new Error("String of HEX type must be in byte increments");var l=t||[0],c=(r=r||0)>>>3,d=-1===n?3:0;for(i=0;i>>1)+c)>>>2;l.length<=s;)l.push(0);l[s]|=o<<8*(d+n*(a%4))}return{value:l,binLen:4*e.length+r}}(e,t,r,i)};case"TEXT":return function(e,t,r){return function(e,t,r,n,i){var o,s,a,l,c,d,u,h,f=0,p=r||[0],g=(n=n||0)>>>3;if("UTF8"===t)for(u=-1===i?3:0,a=0;a(o=e.charCodeAt(a))?s.push(o):2048>o?(s.push(192|o>>>6),s.push(128|63&o)):55296>o||57344<=o?s.push(224|o>>>12,128|o>>>6&63,128|63&o):(a+=1,o=65536+((1023&o)<<10|1023&e.charCodeAt(a)),s.push(240|o>>>18,128|o>>>12&63,128|o>>>6&63,128|63&o)),l=0;l>>2;p.length<=c;)p.push(0);p[c]|=s[l]<<8*(u+i*(d%4)),f+=1}else for(u=-1===i?2:0,h="UTF16LE"===t&&1!==i||"UTF16LE"!==t&&1===i,a=0;a>>8),c=(d=f+g)>>>2;p.length<=c;)p.push(0);p[c]|=o<<8*(u+i*(d%4)),f+=2}return{value:p,binLen:8*f+n}}(e,n,t,r,i)};case"B64":return function(t,r,n){return function(t,r,n,i){var o,s,a,l,c,d,u=0,h=r||[0],f=(n=n||0)>>>3,p=-1===i?3:0,g=t.indexOf("=");if(-1===t.search(/^[a-zA-Z0-9=+/]+$/))throw new Error("Invalid character in base-64 string");if(t=t.replace(/=/g,""),-1!==g&&g"bigint"==typeof t?t.toString():t}(r=t.util||(t.util={})),(t.objectUtil||(t.objectUtil={})).mergeShapes=(e,t)=>({...e,...t}),t.ZodParsedType=r.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),t.getParsedType=e=>{switch(typeof e){case"undefined":return t.ZodParsedType.undefined;case"string":return t.ZodParsedType.string;case"number":return isNaN(e)?t.ZodParsedType.nan:t.ZodParsedType.number;case"boolean":return t.ZodParsedType.boolean;case"function":return t.ZodParsedType.function;case"bigint":return t.ZodParsedType.bigint;case"symbol":return t.ZodParsedType.symbol;case"object":return Array.isArray(e)?t.ZodParsedType.array:null===e?t.ZodParsedType.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?t.ZodParsedType.promise:"undefined"!=typeof Map&&e instanceof Map?t.ZodParsedType.map:"undefined"!=typeof Set&&e instanceof Set?t.ZodParsedType.set:"undefined"!=typeof Date&&e instanceof Date?t.ZodParsedType.date:t.ZodParsedType.object;default:return t.ZodParsedType.unknown}}},1614:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},s=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.z=void 0;const a=o(r(6555));t.z=a,s(r(6555),t),t.default=a},8227:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(2146),i=r(6837);t.default=(e,t)=>{let r;switch(e.code){case i.ZodIssueCode.invalid_type:r=e.received===n.ZodParsedType.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case i.ZodIssueCode.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,n.util.jsonStringifyReplacer)}`;break;case i.ZodIssueCode.unrecognized_keys:r=`Unrecognized key(s) in object: ${n.util.joinValues(e.keys,", ")}`;break;case i.ZodIssueCode.invalid_union:r="Invalid input";break;case i.ZodIssueCode.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${n.util.joinValues(e.options)}`;break;case i.ZodIssueCode.invalid_enum_value:r=`Invalid enum value. Expected ${n.util.joinValues(e.options)}, received '${e.received}'`;break;case i.ZodIssueCode.invalid_arguments:r="Invalid function arguments";break;case i.ZodIssueCode.invalid_return_type:r="Invalid function return type";break;case i.ZodIssueCode.invalid_date:r="Invalid date";break;case i.ZodIssueCode.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:n.util.assertNever(e.validation):r="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case i.ZodIssueCode.too_small:r="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case i.ZodIssueCode.too_big:r="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case i.ZodIssueCode.custom:r="Invalid input";break;case i.ZodIssueCode.invalid_intersection_types:r="Intersection results could not be merged";break;case i.ZodIssueCode.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case i.ZodIssueCode.not_finite:r="Number must be finite";break;default:r=t.defaultError,n.util.assertNever(e)}return{message:r}}},2739:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.date=t.boolean=t.bigint=t.array=t.any=t.coerce=t.ZodFirstPartyTypeKind=t.late=t.ZodSchema=t.Schema=t.custom=t.ZodReadonly=t.ZodPipeline=t.ZodBranded=t.BRAND=t.ZodNaN=t.ZodCatch=t.ZodDefault=t.ZodNullable=t.ZodOptional=t.ZodTransformer=t.ZodEffects=t.ZodPromise=t.ZodNativeEnum=t.ZodEnum=t.ZodLiteral=t.ZodLazy=t.ZodFunction=t.ZodSet=t.ZodMap=t.ZodRecord=t.ZodTuple=t.ZodIntersection=t.ZodDiscriminatedUnion=t.ZodUnion=t.ZodObject=t.ZodArray=t.ZodVoid=t.ZodNever=t.ZodUnknown=t.ZodAny=t.ZodNull=t.ZodUndefined=t.ZodSymbol=t.ZodDate=t.ZodBoolean=t.ZodBigInt=t.ZodNumber=t.ZodString=t.ZodType=void 0,t.NEVER=t.void=t.unknown=t.union=t.undefined=t.tuple=t.transformer=t.symbol=t.string=t.strictObject=t.set=t.record=t.promise=t.preprocess=t.pipeline=t.ostring=t.optional=t.onumber=t.oboolean=t.object=t.number=t.nullable=t.null=t.never=t.nativeEnum=t.nan=t.map=t.literal=t.lazy=t.intersection=t.instanceof=t.function=t.enum=t.effect=t.discriminatedUnion=void 0;const n=r(627),i=r(9750),o=r(7231),s=r(2146),a=r(6837);class l{constructor(e,t,r,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=n}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const c=(e,t)=>{if((0,o.isValid)(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new a.ZodError(e.common.issues);return this._error=t,this._error}}};function d(e){if(!e)return{};const{errorMap:t,invalid_type_error:r,required_error:n,description:i}=e;if(t&&(r||n))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{errorMap:t,description:i}:{errorMap:(e,t)=>"invalid_type"!==e.code?{message:t.defaultError}:void 0===t.data?{message:null!=n?n:t.defaultError}:{message:null!=r?r:t.defaultError},description:i}}class u{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return(0,s.getParsedType)(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:(0,s.getParsedType)(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new o.ParseStatus,ctx:{common:e.parent.common,data:e.data,parsedType:(0,s.getParsedType)(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if((0,o.isAsync)(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){var r;const n={common:{issues:[],async:null!==(r=null==t?void 0:t.async)&&void 0!==r&&r,contextualErrorMap:null==t?void 0:t.errorMap},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:(0,s.getParsedType)(e)},i=this._parseSync({data:e,path:n.path,parent:n});return c(n,i)}async parseAsync(e,t){const r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){const r={common:{issues:[],contextualErrorMap:null==t?void 0:t.errorMap,async:!0},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:(0,s.getParsedType)(e)},n=this._parse({data:e,path:r.path,parent:r}),i=await((0,o.isAsync)(n)?n:Promise.resolve(n));return c(r,i)}refine(e,t){const r=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement(((t,n)=>{const i=e(t),o=()=>n.addIssue({code:a.ZodIssueCode.custom,...r(t)});return"undefined"!=typeof Promise&&i instanceof Promise?i.then((e=>!!e||(o(),!1))):!!i||(o(),!1)}))}refinement(e,t){return this._refinement(((r,n)=>!!e(r)||(n.addIssue("function"==typeof t?t(r,n):t),!1)))}_refinement(e){return new J({schema:this,typeName:ae.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return X.create(this,this._def)}nullable(){return ee.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return T.create(this,this._def)}promise(){return Q.create(this,this._def)}or(e){return j.create([this,e],this._def)}and(e){return D.create(this,e,this._def)}transform(e){return new J({...d(this._def),schema:this,typeName:ae.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new te({...d(this._def),innerType:this,defaultValue:t,typeName:ae.ZodDefault})}brand(){return new ie({typeName:ae.ZodBranded,type:this,...d(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new re({...d(this._def),innerType:this,catchValue:t,typeName:ae.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return oe.create(this,e)}readonly(){return se.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}t.ZodType=u,t.Schema=u,t.ZodSchema=u;const h=/^c[^\s-]{8,}$/i,f=/^[a-z][a-z0-9]*$/,p=/^[0-9A-HJKMNP-TV-Z]{26}$/,g=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,m=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let y;const b=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,w=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/;class v extends u{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==s.ZodParsedType.string){const t=this._getOrReturnCtx(e);return(0,o.addIssueToContext)(t,{code:a.ZodIssueCode.invalid_type,expected:s.ZodParsedType.string,received:t.parsedType}),o.INVALID}const t=new o.ParseStatus;let r;for(const c of this._def.checks)if("min"===c.kind)e.data.lengthc.value&&(r=this._getOrReturnCtx(e,r),(0,o.addIssueToContext)(r,{code:a.ZodIssueCode.too_big,maximum:c.value,type:"string",inclusive:!0,exact:!1,message:c.message}),t.dirty());else if("length"===c.kind){const n=e.data.length>c.value,i=e.data.lengthe.test(t)),{validation:t,code:a.ZodIssueCode.invalid_string,...i.errorUtil.errToObj(r)})}_addCheck(e){return new v({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...i.errorUtil.errToObj(e)})}url(e){return this._addCheck({kind:"url",...i.errorUtil.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...i.errorUtil.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...i.errorUtil.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...i.errorUtil.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...i.errorUtil.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...i.errorUtil.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...i.errorUtil.errToObj(e)})}datetime(e){var t;return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,offset:null!==(t=null==e?void 0:e.offset)&&void 0!==t&&t,...i.errorUtil.errToObj(null==e?void 0:e.message)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...i.errorUtil.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:null==t?void 0:t.position,...i.errorUtil.errToObj(null==t?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...i.errorUtil.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...i.errorUtil.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...i.errorUtil.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...i.errorUtil.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...i.errorUtil.errToObj(t)})}nonempty(e){return this.min(1,i.errorUtil.errToObj(e))}trim(){return new v({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new v({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new v({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((e=>"datetime"===e.kind))}get isEmail(){return!!this._def.checks.find((e=>"email"===e.kind))}get isURL(){return!!this._def.checks.find((e=>"url"===e.kind))}get isEmoji(){return!!this._def.checks.find((e=>"emoji"===e.kind))}get isUUID(){return!!this._def.checks.find((e=>"uuid"===e.kind))}get isCUID(){return!!this._def.checks.find((e=>"cuid"===e.kind))}get isCUID2(){return!!this._def.checks.find((e=>"cuid2"===e.kind))}get isULID(){return!!this._def.checks.find((e=>"ulid"===e.kind))}get isIP(){return!!this._def.checks.find((e=>"ip"===e.kind))}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.valuen?r:n;return parseInt(e.toFixed(i).replace(".",""))%parseInt(t.toFixed(i).replace(".",""))/Math.pow(10,i)}t.ZodString=v,v.create=e=>{var t;return new v({checks:[],typeName:ae.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...d(e)})};class _ extends u{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==s.ZodParsedType.number){const t=this._getOrReturnCtx(e);return(0,o.addIssueToContext)(t,{code:a.ZodIssueCode.invalid_type,expected:s.ZodParsedType.number,received:t.parsedType}),o.INVALID}let t;const r=new o.ParseStatus;for(const n of this._def.checks)"int"===n.kind?s.util.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),(0,o.addIssueToContext)(t,{code:a.ZodIssueCode.invalid_type,expected:"integer",received:"float",message:n.message}),r.dirty()):"min"===n.kind?(n.inclusive?e.datan.value:e.data>=n.value)&&(t=this._getOrReturnCtx(e,t),(0,o.addIssueToContext)(t,{code:a.ZodIssueCode.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),r.dirty()):"multipleOf"===n.kind?0!==C(e.data,n.value)&&(t=this._getOrReturnCtx(e,t),(0,o.addIssueToContext)(t,{code:a.ZodIssueCode.not_multiple_of,multipleOf:n.value,message:n.message}),r.dirty()):"finite"===n.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),(0,o.addIssueToContext)(t,{code:a.ZodIssueCode.not_finite,message:n.message}),r.dirty()):s.util.assertNever(n);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,i.errorUtil.toString(t))}gt(e,t){return this.setLimit("min",e,!1,i.errorUtil.toString(t))}lte(e,t){return this.setLimit("max",e,!0,i.errorUtil.toString(t))}lt(e,t){return this.setLimit("max",e,!1,i.errorUtil.toString(t))}setLimit(e,t,r,n){return new _({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:i.errorUtil.toString(n)}]})}_addCheck(e){return new _({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:i.errorUtil.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:i.errorUtil.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:i.errorUtil.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:i.errorUtil.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:i.errorUtil.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:i.errorUtil.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:i.errorUtil.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:i.errorUtil.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:i.errorUtil.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value"int"===e.kind||"multipleOf"===e.kind&&s.util.isInteger(e.value)))}get isFinite(){let e=null,t=null;for(const r of this._def.checks){if("finite"===r.kind||"int"===r.kind||"multipleOf"===r.kind)return!0;"min"===r.kind?(null===t||r.value>t)&&(t=r.value):"max"===r.kind&&(null===e||r.valuenew _({checks:[],typeName:ae.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...d(e)});class k extends u{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==s.ZodParsedType.bigint){const t=this._getOrReturnCtx(e);return(0,o.addIssueToContext)(t,{code:a.ZodIssueCode.invalid_type,expected:s.ZodParsedType.bigint,received:t.parsedType}),o.INVALID}let t;const r=new o.ParseStatus;for(const n of this._def.checks)"min"===n.kind?(n.inclusive?e.datan.value:e.data>=n.value)&&(t=this._getOrReturnCtx(e,t),(0,o.addIssueToContext)(t,{code:a.ZodIssueCode.too_big,type:"bigint",maximum:n.value,inclusive:n.inclusive,message:n.message}),r.dirty()):"multipleOf"===n.kind?e.data%n.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),(0,o.addIssueToContext)(t,{code:a.ZodIssueCode.not_multiple_of,multipleOf:n.value,message:n.message}),r.dirty()):s.util.assertNever(n);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,i.errorUtil.toString(t))}gt(e,t){return this.setLimit("min",e,!1,i.errorUtil.toString(t))}lte(e,t){return this.setLimit("max",e,!0,i.errorUtil.toString(t))}lt(e,t){return this.setLimit("max",e,!1,i.errorUtil.toString(t))}setLimit(e,t,r,n){return new k({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:i.errorUtil.toString(n)}]})}_addCheck(e){return new k({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:i.errorUtil.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:i.errorUtil.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:i.errorUtil.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:i.errorUtil.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:i.errorUtil.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value{var t;return new k({checks:[],typeName:ae.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...d(e)})};class x extends u{_parse(e){if(this._def.coerce&&(e.data=Boolean(e.data)),this._getType(e)!==s.ZodParsedType.boolean){const t=this._getOrReturnCtx(e);return(0,o.addIssueToContext)(t,{code:a.ZodIssueCode.invalid_type,expected:s.ZodParsedType.boolean,received:t.parsedType}),o.INVALID}return(0,o.OK)(e.data)}}t.ZodBoolean=x,x.create=e=>new x({typeName:ae.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...d(e)});class A extends u{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==s.ZodParsedType.date){const t=this._getOrReturnCtx(e);return(0,o.addIssueToContext)(t,{code:a.ZodIssueCode.invalid_type,expected:s.ZodParsedType.date,received:t.parsedType}),o.INVALID}if(isNaN(e.data.getTime())){const t=this._getOrReturnCtx(e);return(0,o.addIssueToContext)(t,{code:a.ZodIssueCode.invalid_date}),o.INVALID}const t=new o.ParseStatus;let r;for(const n of this._def.checks)"min"===n.kind?e.data.getTime()n.value&&(r=this._getOrReturnCtx(e,r),(0,o.addIssueToContext)(r,{code:a.ZodIssueCode.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:"date"}),t.dirty()):s.util.assertNever(n);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new A({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:i.errorUtil.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:i.errorUtil.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.valuenew A({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:ae.ZodDate,...d(e)});class S extends u{_parse(e){if(this._getType(e)!==s.ZodParsedType.symbol){const t=this._getOrReturnCtx(e);return(0,o.addIssueToContext)(t,{code:a.ZodIssueCode.invalid_type,expected:s.ZodParsedType.symbol,received:t.parsedType}),o.INVALID}return(0,o.OK)(e.data)}}t.ZodSymbol=S,S.create=e=>new S({typeName:ae.ZodSymbol,...d(e)});class B extends u{_parse(e){if(this._getType(e)!==s.ZodParsedType.undefined){const t=this._getOrReturnCtx(e);return(0,o.addIssueToContext)(t,{code:a.ZodIssueCode.invalid_type,expected:s.ZodParsedType.undefined,received:t.parsedType}),o.INVALID}return(0,o.OK)(e.data)}}t.ZodUndefined=B,B.create=e=>new B({typeName:ae.ZodUndefined,...d(e)});class E extends u{_parse(e){if(this._getType(e)!==s.ZodParsedType.null){const t=this._getOrReturnCtx(e);return(0,o.addIssueToContext)(t,{code:a.ZodIssueCode.invalid_type,expected:s.ZodParsedType.null,received:t.parsedType}),o.INVALID}return(0,o.OK)(e.data)}}t.ZodNull=E,E.create=e=>new E({typeName:ae.ZodNull,...d(e)});class P extends u{constructor(){super(...arguments),this._any=!0}_parse(e){return(0,o.OK)(e.data)}}t.ZodAny=P,P.create=e=>new P({typeName:ae.ZodAny,...d(e)});class I extends u{constructor(){super(...arguments),this._unknown=!0}_parse(e){return(0,o.OK)(e.data)}}t.ZodUnknown=I,I.create=e=>new I({typeName:ae.ZodUnknown,...d(e)});class M extends u{_parse(e){const t=this._getOrReturnCtx(e);return(0,o.addIssueToContext)(t,{code:a.ZodIssueCode.invalid_type,expected:s.ZodParsedType.never,received:t.parsedType}),o.INVALID}}t.ZodNever=M,M.create=e=>new M({typeName:ae.ZodNever,...d(e)});class U extends u{_parse(e){if(this._getType(e)!==s.ZodParsedType.undefined){const t=this._getOrReturnCtx(e);return(0,o.addIssueToContext)(t,{code:a.ZodIssueCode.invalid_type,expected:s.ZodParsedType.void,received:t.parsedType}),o.INVALID}return(0,o.OK)(e.data)}}t.ZodVoid=U,U.create=e=>new U({typeName:ae.ZodVoid,...d(e)});class T extends u{_parse(e){const{ctx:t,status:r}=this._processInputParams(e),n=this._def;if(t.parsedType!==s.ZodParsedType.array)return(0,o.addIssueToContext)(t,{code:a.ZodIssueCode.invalid_type,expected:s.ZodParsedType.array,received:t.parsedType}),o.INVALID;if(null!==n.exactLength){const e=t.data.length>n.exactLength.value,i=t.data.lengthn.maxLength.value&&((0,o.addIssueToContext)(t,{code:a.ZodIssueCode.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),r.dirty()),t.common.async)return Promise.all([...t.data].map(((e,r)=>n.type._parseAsync(new l(t,e,t.path,r))))).then((e=>o.ParseStatus.mergeArray(r,e)));const i=[...t.data].map(((e,r)=>n.type._parseSync(new l(t,e,t.path,r))));return o.ParseStatus.mergeArray(r,i)}get element(){return this._def.type}min(e,t){return new T({...this._def,minLength:{value:e,message:i.errorUtil.toString(t)}})}max(e,t){return new T({...this._def,maxLength:{value:e,message:i.errorUtil.toString(t)}})}length(e,t){return new T({...this._def,exactLength:{value:e,message:i.errorUtil.toString(t)}})}nonempty(e){return this.min(1,e)}}function O(e){if(e instanceof R){const t={};for(const r in e.shape){const n=e.shape[r];t[r]=X.create(O(n))}return new R({...e._def,shape:()=>t})}return e instanceof T?new T({...e._def,type:O(e.element)}):e instanceof X?X.create(O(e.unwrap())):e instanceof ee?ee.create(O(e.unwrap())):e instanceof $?$.create(e.items.map((e=>O(e)))):e}t.ZodArray=T,T.create=(e,t)=>new T({type:e,minLength:null,maxLength:null,exactLength:null,typeName:ae.ZodArray,...d(t)});class R extends u{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const e=this._def.shape(),t=s.util.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==s.ZodParsedType.object){const t=this._getOrReturnCtx(e);return(0,o.addIssueToContext)(t,{code:a.ZodIssueCode.invalid_type,expected:s.ZodParsedType.object,received:t.parsedType}),o.INVALID}const{status:t,ctx:r}=this._processInputParams(e),{shape:n,keys:i}=this._getCached(),c=[];if(!(this._def.catchall instanceof M&&"strip"===this._def.unknownKeys))for(const e in r.data)i.includes(e)||c.push(e);const d=[];for(const e of i){const t=n[e],i=r.data[e];d.push({key:{status:"valid",value:e},value:t._parse(new l(r,i,r.path,e)),alwaysSet:e in r.data})}if(this._def.catchall instanceof M){const e=this._def.unknownKeys;if("passthrough"===e)for(const e of c)d.push({key:{status:"valid",value:e},value:{status:"valid",value:r.data[e]}});else if("strict"===e)c.length>0&&((0,o.addIssueToContext)(r,{code:a.ZodIssueCode.unrecognized_keys,keys:c}),t.dirty());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of c){const n=r.data[t];d.push({key:{status:"valid",value:t},value:e._parse(new l(r,n,r.path,t)),alwaysSet:t in r.data})}}return r.common.async?Promise.resolve().then((async()=>{const e=[];for(const t of d){const r=await t.key;e.push({key:r,value:await t.value,alwaysSet:t.alwaysSet})}return e})).then((e=>o.ParseStatus.mergeObjectSync(t,e))):o.ParseStatus.mergeObjectSync(t,d)}get shape(){return this._def.shape()}strict(e){return i.errorUtil.errToObj,new R({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,r)=>{var n,o,s,a;const l=null!==(s=null===(o=(n=this._def).errorMap)||void 0===o?void 0:o.call(n,t,r).message)&&void 0!==s?s:r.defaultError;return"unrecognized_keys"===t.code?{message:null!==(a=i.errorUtil.errToObj(e).message)&&void 0!==a?a:l}:{message:l}}}:{}})}strip(){return new R({...this._def,unknownKeys:"strip"})}passthrough(){return new R({...this._def,unknownKeys:"passthrough"})}extend(e){return new R({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new R({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:ae.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new R({...this._def,catchall:e})}pick(e){const t={};return s.util.objectKeys(e).forEach((r=>{e[r]&&this.shape[r]&&(t[r]=this.shape[r])})),new R({...this._def,shape:()=>t})}omit(e){const t={};return s.util.objectKeys(this.shape).forEach((r=>{e[r]||(t[r]=this.shape[r])})),new R({...this._def,shape:()=>t})}deepPartial(){return O(this)}partial(e){const t={};return s.util.objectKeys(this.shape).forEach((r=>{const n=this.shape[r];e&&!e[r]?t[r]=n:t[r]=n.optional()})),new R({...this._def,shape:()=>t})}required(e){const t={};return s.util.objectKeys(this.shape).forEach((r=>{if(e&&!e[r])t[r]=this.shape[r];else{let e=this.shape[r];for(;e instanceof X;)e=e._def.innerType;t[r]=e}})),new R({...this._def,shape:()=>t})}keyof(){return W(s.util.objectKeys(this.shape))}}t.ZodObject=R,R.create=(e,t)=>new R({shape:()=>e,unknownKeys:"strip",catchall:M.create(),typeName:ae.ZodObject,...d(t)}),R.strictCreate=(e,t)=>new R({shape:()=>e,unknownKeys:"strict",catchall:M.create(),typeName:ae.ZodObject,...d(t)}),R.lazycreate=(e,t)=>new R({shape:e,unknownKeys:"strip",catchall:M.create(),typeName:ae.ZodObject,...d(t)});class j extends u{_parse(e){const{ctx:t}=this._processInputParams(e),r=this._def.options;if(t.common.async)return Promise.all(r.map((async e=>{const r={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:r}),ctx:r}}))).then((function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const r of e)if("dirty"===r.result.status)return t.common.issues.push(...r.ctx.common.issues),r.result;const r=e.map((e=>new a.ZodError(e.ctx.common.issues)));return(0,o.addIssueToContext)(t,{code:a.ZodIssueCode.invalid_union,unionErrors:r}),o.INVALID}));{let e;const n=[];for(const i of r){const r={...t,common:{...t.common,issues:[]},parent:null},o=i._parseSync({data:t.data,path:t.path,parent:r});if("valid"===o.status)return o;"dirty"!==o.status||e||(e={result:o,ctx:r}),r.common.issues.length&&n.push(r.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const i=n.map((e=>new a.ZodError(e)));return(0,o.addIssueToContext)(t,{code:a.ZodIssueCode.invalid_union,unionErrors:i}),o.INVALID}}get options(){return this._def.options}}t.ZodUnion=j,j.create=(e,t)=>new j({options:e,typeName:ae.ZodUnion,...d(t)});const L=e=>e instanceof H?L(e.schema):e instanceof J?L(e.innerType()):e instanceof Z?[e.value]:e instanceof G?e.options:e instanceof Y?Object.keys(e.enum):e instanceof te?L(e._def.innerType):e instanceof B?[void 0]:e instanceof E?[null]:null;class z extends u{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==s.ZodParsedType.object)return(0,o.addIssueToContext)(t,{code:a.ZodIssueCode.invalid_type,expected:s.ZodParsedType.object,received:t.parsedType}),o.INVALID;const r=this.discriminator,n=t.data[r],i=this.optionsMap.get(n);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):((0,o.addIssueToContext)(t,{code:a.ZodIssueCode.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),o.INVALID)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,r){const n=new Map;for(const r of t){const t=L(r.shape[e]);if(!t)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const i of t){if(n.has(i))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(i)}`);n.set(i,r)}}return new z({typeName:ae.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:n,...d(r)})}}function N(e,t){const r=(0,s.getParsedType)(e),n=(0,s.getParsedType)(t);if(e===t)return{valid:!0,data:e};if(r===s.ZodParsedType.object&&n===s.ZodParsedType.object){const r=s.util.objectKeys(t),n=s.util.objectKeys(e).filter((e=>-1!==r.indexOf(e))),i={...e,...t};for(const r of n){const n=N(e[r],t[r]);if(!n.valid)return{valid:!1};i[r]=n.data}return{valid:!0,data:i}}if(r===s.ZodParsedType.array&&n===s.ZodParsedType.array){if(e.length!==t.length)return{valid:!1};const r=[];for(let n=0;n{if((0,o.isAborted)(e)||(0,o.isAborted)(n))return o.INVALID;const i=N(e.value,n.value);return i.valid?(((0,o.isDirty)(e)||(0,o.isDirty)(n))&&t.dirty(),{status:t.value,value:i.data}):((0,o.addIssueToContext)(r,{code:a.ZodIssueCode.invalid_intersection_types}),o.INVALID)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then((([e,t])=>n(e,t))):n(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}t.ZodIntersection=D,D.create=(e,t,r)=>new D({left:e,right:t,typeName:ae.ZodIntersection,...d(r)});class $ extends u{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==s.ZodParsedType.array)return(0,o.addIssueToContext)(r,{code:a.ZodIssueCode.invalid_type,expected:s.ZodParsedType.array,received:r.parsedType}),o.INVALID;if(r.data.lengththis._def.items.length&&((0,o.addIssueToContext)(r,{code:a.ZodIssueCode.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const n=[...r.data].map(((e,t)=>{const n=this._def.items[t]||this._def.rest;return n?n._parse(new l(r,e,r.path,t)):null})).filter((e=>!!e));return r.common.async?Promise.all(n).then((e=>o.ParseStatus.mergeArray(t,e))):o.ParseStatus.mergeArray(t,n)}get items(){return this._def.items}rest(e){return new $({...this._def,rest:e})}}t.ZodTuple=$,$.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new $({items:e,typeName:ae.ZodTuple,rest:null,...d(t)})};class F extends u{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==s.ZodParsedType.object)return(0,o.addIssueToContext)(r,{code:a.ZodIssueCode.invalid_type,expected:s.ZodParsedType.object,received:r.parsedType}),o.INVALID;const n=[],i=this._def.keyType,c=this._def.valueType;for(const e in r.data)n.push({key:i._parse(new l(r,e,r.path,e)),value:c._parse(new l(r,r.data[e],r.path,e))});return r.common.async?o.ParseStatus.mergeObjectAsync(t,n):o.ParseStatus.mergeObjectSync(t,n)}get element(){return this._def.valueType}static create(e,t,r){return new F(t instanceof u?{keyType:e,valueType:t,typeName:ae.ZodRecord,...d(r)}:{keyType:v.create(),valueType:e,typeName:ae.ZodRecord,...d(t)})}}t.ZodRecord=F;class K extends u{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==s.ZodParsedType.map)return(0,o.addIssueToContext)(r,{code:a.ZodIssueCode.invalid_type,expected:s.ZodParsedType.map,received:r.parsedType}),o.INVALID;const n=this._def.keyType,i=this._def.valueType,c=[...r.data.entries()].map((([e,t],o)=>({key:n._parse(new l(r,e,r.path,[o,"key"])),value:i._parse(new l(r,t,r.path,[o,"value"]))})));if(r.common.async){const e=new Map;return Promise.resolve().then((async()=>{for(const r of c){const n=await r.key,i=await r.value;if("aborted"===n.status||"aborted"===i.status)return o.INVALID;"dirty"!==n.status&&"dirty"!==i.status||t.dirty(),e.set(n.value,i.value)}return{status:t.value,value:e}}))}{const e=new Map;for(const r of c){const n=r.key,i=r.value;if("aborted"===n.status||"aborted"===i.status)return o.INVALID;"dirty"!==n.status&&"dirty"!==i.status||t.dirty(),e.set(n.value,i.value)}return{status:t.value,value:e}}}}t.ZodMap=K,K.create=(e,t,r)=>new K({valueType:t,keyType:e,typeName:ae.ZodMap,...d(r)});class V extends u{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==s.ZodParsedType.set)return(0,o.addIssueToContext)(r,{code:a.ZodIssueCode.invalid_type,expected:s.ZodParsedType.set,received:r.parsedType}),o.INVALID;const n=this._def;null!==n.minSize&&r.data.sizen.maxSize.value&&((0,o.addIssueToContext)(r,{code:a.ZodIssueCode.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty());const i=this._def.valueType;function c(e){const r=new Set;for(const n of e){if("aborted"===n.status)return o.INVALID;"dirty"===n.status&&t.dirty(),r.add(n.value)}return{status:t.value,value:r}}const d=[...r.data.values()].map(((e,t)=>i._parse(new l(r,e,r.path,t))));return r.common.async?Promise.all(d).then((e=>c(e))):c(d)}min(e,t){return new V({...this._def,minSize:{value:e,message:i.errorUtil.toString(t)}})}max(e,t){return new V({...this._def,maxSize:{value:e,message:i.errorUtil.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}t.ZodSet=V,V.create=(e,t)=>new V({valueType:e,minSize:null,maxSize:null,typeName:ae.ZodSet,...d(t)});class q extends u{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==s.ZodParsedType.function)return(0,o.addIssueToContext)(t,{code:a.ZodIssueCode.invalid_type,expected:s.ZodParsedType.function,received:t.parsedType}),o.INVALID;function r(e,r){return(0,o.makeIssue)({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,(0,n.getErrorMap)(),n.defaultErrorMap].filter((e=>!!e)),issueData:{code:a.ZodIssueCode.invalid_arguments,argumentsError:r}})}function i(e,r){return(0,o.makeIssue)({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,(0,n.getErrorMap)(),n.defaultErrorMap].filter((e=>!!e)),issueData:{code:a.ZodIssueCode.invalid_return_type,returnTypeError:r}})}const l={errorMap:t.common.contextualErrorMap},c=t.data;if(this._def.returns instanceof Q){const e=this;return(0,o.OK)((async function(...t){const n=new a.ZodError([]),o=await e._def.args.parseAsync(t,l).catch((e=>{throw n.addIssue(r(t,e)),n})),s=await Reflect.apply(c,this,o);return await e._def.returns._def.type.parseAsync(s,l).catch((e=>{throw n.addIssue(i(s,e)),n}))}))}{const e=this;return(0,o.OK)((function(...t){const n=e._def.args.safeParse(t,l);if(!n.success)throw new a.ZodError([r(t,n.error)]);const o=Reflect.apply(c,this,n.data),s=e._def.returns.safeParse(o,l);if(!s.success)throw new a.ZodError([i(o,s.error)]);return s.data}))}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new q({...this._def,args:$.create(e).rest(I.create())})}returns(e){return new q({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,r){return new q({args:e||$.create([]).rest(I.create()),returns:t||I.create(),typeName:ae.ZodFunction,...d(r)})}}t.ZodFunction=q;class H extends u{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}t.ZodLazy=H,H.create=(e,t)=>new H({getter:e,typeName:ae.ZodLazy,...d(t)});class Z extends u{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return(0,o.addIssueToContext)(t,{received:t.data,code:a.ZodIssueCode.invalid_literal,expected:this._def.value}),o.INVALID}return{status:"valid",value:e.data}}get value(){return this._def.value}}function W(e,t){return new G({values:e,typeName:ae.ZodEnum,...d(t)})}t.ZodLiteral=Z,Z.create=(e,t)=>new Z({value:e,typeName:ae.ZodLiteral,...d(t)});class G extends u{_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),r=this._def.values;return(0,o.addIssueToContext)(t,{expected:s.util.joinValues(r),received:t.parsedType,code:a.ZodIssueCode.invalid_type}),o.INVALID}if(-1===this._def.values.indexOf(e.data)){const t=this._getOrReturnCtx(e),r=this._def.values;return(0,o.addIssueToContext)(t,{received:t.data,code:a.ZodIssueCode.invalid_enum_value,options:r}),o.INVALID}return(0,o.OK)(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e){return G.create(e)}exclude(e){return G.create(this.options.filter((t=>!e.includes(t))))}}t.ZodEnum=G,G.create=W;class Y extends u{_parse(e){const t=s.util.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==s.ZodParsedType.string&&r.parsedType!==s.ZodParsedType.number){const e=s.util.objectValues(t);return(0,o.addIssueToContext)(r,{expected:s.util.joinValues(e),received:r.parsedType,code:a.ZodIssueCode.invalid_type}),o.INVALID}if(-1===t.indexOf(e.data)){const e=s.util.objectValues(t);return(0,o.addIssueToContext)(r,{received:r.data,code:a.ZodIssueCode.invalid_enum_value,options:e}),o.INVALID}return(0,o.OK)(e.data)}get enum(){return this._def.values}}t.ZodNativeEnum=Y,Y.create=(e,t)=>new Y({values:e,typeName:ae.ZodNativeEnum,...d(t)});class Q extends u{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==s.ZodParsedType.promise&&!1===t.common.async)return(0,o.addIssueToContext)(t,{code:a.ZodIssueCode.invalid_type,expected:s.ZodParsedType.promise,received:t.parsedType}),o.INVALID;const r=t.parsedType===s.ZodParsedType.promise?t.data:Promise.resolve(t.data);return(0,o.OK)(r.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}t.ZodPromise=Q,Q.create=(e,t)=>new Q({type:e,typeName:ae.ZodPromise,...d(t)});class J extends u{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ae.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:r}=this._processInputParams(e),n=this._def.effect||null,i={addIssue:e=>{(0,o.addIssueToContext)(r,e),e.fatal?t.abort():t.dirty()},get path(){return r.path}};if(i.addIssue=i.addIssue.bind(i),"preprocess"===n.type){const e=n.transform(r.data,i);return r.common.issues.length?{status:"dirty",value:r.data}:r.common.async?Promise.resolve(e).then((e=>this._def.schema._parseAsync({data:e,path:r.path,parent:r}))):this._def.schema._parseSync({data:e,path:r.path,parent:r})}if("refinement"===n.type){const e=e=>{const t=n.refinement(e,i);if(r.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===r.common.async){const n=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===n.status?o.INVALID:("dirty"===n.status&&t.dirty(),e(n.value),{status:t.value,value:n.value})}return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then((r=>"aborted"===r.status?o.INVALID:("dirty"===r.status&&t.dirty(),e(r.value).then((()=>({status:t.value,value:r.value}))))))}if("transform"===n.type){if(!1===r.common.async){const e=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!(0,o.isValid)(e))return e;const s=n.transform(e.value,i);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:s}}return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then((e=>(0,o.isValid)(e)?Promise.resolve(n.transform(e.value,i)).then((e=>({status:t.value,value:e}))):e))}s.util.assertNever(n)}}t.ZodEffects=J,t.ZodTransformer=J,J.create=(e,t,r)=>new J({schema:e,typeName:ae.ZodEffects,effect:t,...d(r)}),J.createWithPreprocess=(e,t,r)=>new J({schema:t,effect:{type:"preprocess",transform:e},typeName:ae.ZodEffects,...d(r)});class X extends u{_parse(e){return this._getType(e)===s.ZodParsedType.undefined?(0,o.OK)(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}t.ZodOptional=X,X.create=(e,t)=>new X({innerType:e,typeName:ae.ZodOptional,...d(t)});class ee extends u{_parse(e){return this._getType(e)===s.ZodParsedType.null?(0,o.OK)(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}t.ZodNullable=ee,ee.create=(e,t)=>new ee({innerType:e,typeName:ae.ZodNullable,...d(t)});class te extends u{_parse(e){const{ctx:t}=this._processInputParams(e);let r=t.data;return t.parsedType===s.ZodParsedType.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}t.ZodDefault=te,te.create=(e,t)=>new te({innerType:e,typeName:ae.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...d(t)});class re extends u{_parse(e){const{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return(0,o.isAsync)(n)?n.then((e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new a.ZodError(r.common.issues)},input:r.data})}))):{status:"valid",value:"valid"===n.status?n.value:this._def.catchValue({get error(){return new a.ZodError(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}t.ZodCatch=re,re.create=(e,t)=>new re({innerType:e,typeName:ae.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...d(t)});class ne extends u{_parse(e){if(this._getType(e)!==s.ZodParsedType.nan){const t=this._getOrReturnCtx(e);return(0,o.addIssueToContext)(t,{code:a.ZodIssueCode.invalid_type,expected:s.ZodParsedType.nan,received:t.parsedType}),o.INVALID}return{status:"valid",value:e.data}}}t.ZodNaN=ne,ne.create=e=>new ne({typeName:ae.ZodNaN,...d(e)}),t.BRAND=Symbol("zod_brand");class ie extends u{_parse(e){const{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}}t.ZodBranded=ie;class oe extends u{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const e=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?o.INVALID:"dirty"===e.status?(t.dirty(),(0,o.DIRTY)(e.value)):this._def.out._parseAsync({data:e.value,path:r.path,parent:r})})();{const e=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?o.INVALID:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:r.path,parent:r})}}static create(e,t){return new oe({in:e,out:t,typeName:ae.ZodPipeline})}}t.ZodPipeline=oe;class se extends u{_parse(e){const t=this._def.innerType._parse(e);return(0,o.isValid)(t)&&(t.value=Object.freeze(t.value)),t}}var ae;t.ZodReadonly=se,se.create=(e,t)=>new se({innerType:e,typeName:ae.ZodReadonly,...d(t)}),t.custom=(e,t={},r)=>e?P.create().superRefine(((n,i)=>{var o,s;if(!e(n)){const e="function"==typeof t?t(n):"string"==typeof t?{message:t}:t,a=null===(s=null!==(o=e.fatal)&&void 0!==o?o:r)||void 0===s||s,l="string"==typeof e?{message:e}:e;i.addIssue({code:"custom",...l,fatal:a})}})):P.create(),t.late={object:R.lazycreate},function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"}(ae=t.ZodFirstPartyTypeKind||(t.ZodFirstPartyTypeKind={})),t.instanceof=(e,r={message:`Input not instance of ${e.name}`})=>(0,t.custom)((t=>t instanceof e),r);const le=v.create;t.string=le;const ce=_.create;t.number=ce;const de=ne.create;t.nan=de;const ue=k.create;t.bigint=ue;const he=x.create;t.boolean=he;const fe=A.create;t.date=fe;const pe=S.create;t.symbol=pe;const ge=B.create;t.undefined=ge;const me=E.create;t.null=me;const ye=P.create;t.any=ye;const be=I.create;t.unknown=be;const we=M.create;t.never=we;const ve=U.create;t.void=ve;const Ce=T.create;t.array=Ce;const _e=R.create;t.object=_e;const ke=R.strictCreate;t.strictObject=ke;const xe=j.create;t.union=xe;const Ae=z.create;t.discriminatedUnion=Ae;const Se=D.create;t.intersection=Se;const Be=$.create;t.tuple=Be;const Ee=F.create;t.record=Ee;const Pe=K.create;t.map=Pe;const Ie=V.create;t.set=Ie;const Me=q.create;t.function=Me;const Ue=H.create;t.lazy=Ue;const Te=Z.create;t.literal=Te;const Oe=G.create;t.enum=Oe;const Re=Y.create;t.nativeEnum=Re;const je=Q.create;t.promise=je;const Le=J.create;t.effect=Le,t.transformer=Le;const ze=X.create;t.optional=ze;const Ne=ee.create;t.nullable=Ne;const De=J.createWithPreprocess;t.preprocess=De;const $e=oe.create;t.pipeline=$e,t.ostring=()=>le().optional(),t.onumber=()=>ce().optional(),t.oboolean=()=>he().optional(),t.coerce={string:e=>v.create({...e,coerce:!0}),number:e=>_.create({...e,coerce:!0}),boolean:e=>x.create({...e,coerce:!0}),bigint:e=>k.create({...e,coerce:!0}),date:e=>A.create({...e,coerce:!0})},t.NEVER=o.INVALID},6443:()=>{},1281:()=>{},6425:(e,t,r)=>{"use strict";var n=r(8287).hp;function i(e,t){return function(){return e.apply(t,arguments)}}const{toString:o}=Object.prototype,{getPrototypeOf:s}=Object,a=(l=Object.create(null),e=>{const t=o.call(e);return l[t]||(l[t]=t.slice(8,-1).toLowerCase())});var l;const c=e=>(e=e.toLowerCase(),t=>a(t)===e),d=e=>t=>typeof t===e,{isArray:u}=Array,h=d("undefined"),f=c("ArrayBuffer"),p=d("string"),g=d("function"),m=d("number"),y=e=>null!==e&&"object"==typeof e,b=e=>{if("object"!==a(e))return!1;const t=s(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},w=c("Date"),v=c("File"),C=c("Blob"),_=c("FileList"),k=c("URLSearchParams");function x(e,t,{allOwnKeys:r=!1}={}){if(null==e)return;let n,i;if("object"!=typeof e&&(e=[e]),u(e))for(n=0,i=e.length;n0;)if(n=r[i],t===n.toLowerCase())return n;return null}const S="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:r.g,B=e=>!h(e)&&e!==S,E=(P="undefined"!=typeof Uint8Array&&s(Uint8Array),e=>P&&e instanceof P);var P;const I=c("HTMLFormElement"),M=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),U=c("RegExp"),T=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};x(r,((r,i)=>{let o;!1!==(o=t(r,i,e))&&(n[i]=o||r)})),Object.defineProperties(e,n)},O="abcdefghijklmnopqrstuvwxyz",R="0123456789",j={DIGIT:R,ALPHA:O,ALPHA_DIGIT:O+O.toUpperCase()+R},L=c("AsyncFunction");var z={isArray:u,isArrayBuffer:f,isBuffer:function(e){return null!==e&&!h(e)&&null!==e.constructor&&!h(e.constructor)&&g(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||g(e.append)&&("formdata"===(t=a(e))||"object"===t&&g(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&f(e.buffer),t},isString:p,isNumber:m,isBoolean:e=>!0===e||!1===e,isObject:y,isPlainObject:b,isUndefined:h,isDate:w,isFile:v,isBlob:C,isRegExp:U,isFunction:g,isStream:e=>y(e)&&g(e.pipe),isURLSearchParams:k,isTypedArray:E,isFileList:_,forEach:x,merge:function e(){const{caseless:t}=B(this)&&this||{},r={},n=(n,i)=>{const o=t&&A(r,i)||i;b(r[o])&&b(n)?r[o]=e(r[o],n):b(n)?r[o]=e({},n):u(n)?r[o]=n.slice():r[o]=n};for(let e=0,t=arguments.length;e(x(t,((t,n)=>{r&&g(t)?e[n]=i(t,r):e[n]=t}),{allOwnKeys:n}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},toFlatObject:(e,t,r,n)=>{let i,o,a;const l={};if(t=t||{},null==e)return t;do{for(i=Object.getOwnPropertyNames(e),o=i.length;o-- >0;)a=i[o],n&&!n(a,e,t)||l[a]||(t[a]=e[a],l[a]=!0);e=!1!==r&&s(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:a,kindOfTest:c,endsWith:(e,t,r)=>{e=String(e),(void 0===r||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return-1!==n&&n===r},toArray:e=>{if(!e)return null;if(u(e))return e;let t=e.length;if(!m(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},forEachEntry:(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let n;for(;(n=r.next())&&!n.done;){const r=n.value;t.call(e,r[0],r[1])}},matchAll:(e,t)=>{let r;const n=[];for(;null!==(r=e.exec(t));)n.push(r);return n},isHTMLForm:I,hasOwnProperty:M,hasOwnProp:M,reduceDescriptors:T,freezeMethods:e=>{T(e,((t,r)=>{if(g(e)&&-1!==["arguments","caller","callee"].indexOf(r))return!1;const n=e[r];g(n)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")}))}))},toObjectSet:(e,t)=>{const r={},n=e=>{e.forEach((e=>{r[e]=!0}))};return u(e)?n(e):n(String(e).split(t)),r},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,r){return t.toUpperCase()+r})),noop:()=>{},toFiniteNumber:(e,t)=>(e=+e,Number.isFinite(e)?e:t),findKey:A,global:S,isContextDefined:B,ALPHABET:j,generateString:(e=16,t=j.ALPHA_DIGIT)=>{let r="";const{length:n}=t;for(;e--;)r+=t[Math.random()*n|0];return r},isSpecCompliantForm:function(e){return!!(e&&g(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),r=(e,n)=>{if(y(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[n]=e;const i=u(e)?[]:{};return x(e,((e,t)=>{const o=r(e,n+1);!h(o)&&(i[t]=o)})),t[n]=void 0,i}}return e};return r(e,0)},isAsyncFn:L,isThenable:e=>e&&(y(e)||g(e))&&g(e.then)&&g(e.catch)};function N(e,t,r,n,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),i&&(this.response=i)}z.inherits(N,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:z.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const D=N.prototype,$={};function F(e){return z.isPlainObject(e)||z.isArray(e)}function K(e){return z.endsWith(e,"[]")?e.slice(0,-2):e}function V(e,t,r){return e?e.concat(t).map((function(e,t){return e=K(e),!r&&t?"["+e+"]":e})).join(r?".":""):t}["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{$[e]={value:e}})),Object.defineProperties(N,$),Object.defineProperty(D,"isAxiosError",{value:!0}),N.from=(e,t,r,n,i,o)=>{const s=Object.create(D);return z.toFlatObject(e,s,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),N.call(s,e.message,t,r,n,i),s.cause=e,s.name=e.name,o&&Object.assign(s,o),s};const q=z.toFlatObject(z,{},null,(function(e){return/^is[A-Z]/.test(e)}));function H(e,t,r){if(!z.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const i=(r=z.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!z.isUndefined(t[e])}))).metaTokens,o=r.visitor||d,s=r.dots,a=r.indexes,l=(r.Blob||"undefined"!=typeof Blob&&Blob)&&z.isSpecCompliantForm(t);if(!z.isFunction(o))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(z.isDate(e))return e.toISOString();if(!l&&z.isBlob(e))throw new N("Blob is not supported. Use a Buffer instead.");return z.isArrayBuffer(e)||z.isTypedArray(e)?l&&"function"==typeof Blob?new Blob([e]):n.from(e):e}function d(e,r,n){let o=e;if(e&&!n&&"object"==typeof e)if(z.endsWith(r,"{}"))r=i?r:r.slice(0,-2),e=JSON.stringify(e);else if(z.isArray(e)&&function(e){return z.isArray(e)&&!e.some(F)}(e)||(z.isFileList(e)||z.endsWith(r,"[]"))&&(o=z.toArray(e)))return r=K(r),o.forEach((function(e,n){!z.isUndefined(e)&&null!==e&&t.append(!0===a?V([r],n,s):null===a?r:r+"[]",c(e))})),!1;return!!F(e)||(t.append(V(n,r,s),c(e)),!1)}const u=[],h=Object.assign(q,{defaultVisitor:d,convertValue:c,isVisitable:F});if(!z.isObject(e))throw new TypeError("data must be an object");return function e(r,n){if(!z.isUndefined(r)){if(-1!==u.indexOf(r))throw Error("Circular reference detected in "+n.join("."));u.push(r),z.forEach(r,(function(r,i){!0===(!(z.isUndefined(r)||null===r)&&o.call(t,r,z.isString(i)?i.trim():i,n,h))&&e(r,n?n.concat(i):[i])})),u.pop()}}(e),t}function Z(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function W(e,t){this._pairs=[],e&&H(e,this,t)}const G=W.prototype;function Y(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Q(e,t,r){if(!t)return e;const n=r&&r.encode||Y,i=r&&r.serialize;let o;if(o=i?i(t,r):z.isURLSearchParams(t)?t.toString():new W(t,r).toString(n),o){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+o}return e}G.append=function(e,t){this._pairs.push([e,t])},G.toString=function(e){const t=e?function(t){return e.call(this,t,Z)}:Z;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};var J=class{constructor(){this.handlers=[]}use(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){z.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},X={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},ee={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:W,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const te="undefined"!=typeof window&&"undefined"!=typeof document,re=(ne="undefined"!=typeof navigator&&navigator.product,te&&["ReactNative","NativeScript","NS"].indexOf(ne)<0);var ne;const ie="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts;var oe={...Object.freeze({__proto__:null,hasBrowserEnv:te,hasStandardBrowserWebWorkerEnv:ie,hasStandardBrowserEnv:re}),...ee};function se(e){function t(e,r,n,i){let o=e[i++];if("__proto__"===o)return!0;const s=Number.isFinite(+o),a=i>=e.length;return o=!o&&z.isArray(n)?n.length:o,a?(z.hasOwnProp(n,o)?n[o]=[n[o],r]:n[o]=r,!s):(n[o]&&z.isObject(n[o])||(n[o]=[]),t(e,r,n[o],i)&&z.isArray(n[o])&&(n[o]=function(e){const t={},r=Object.keys(e);let n;const i=r.length;let o;for(n=0;n{t(function(e){return z.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),n,r,0)})),r}return null}const ae={transitional:X,adapter:["xhr","http"],transformRequest:[function(e,t){const r=t.getContentType()||"",n=r.indexOf("application/json")>-1,i=z.isObject(e);if(i&&z.isHTMLForm(e)&&(e=new FormData(e)),z.isFormData(e))return n?JSON.stringify(se(e)):e;if(z.isArrayBuffer(e)||z.isBuffer(e)||z.isStream(e)||z.isFile(e)||z.isBlob(e))return e;if(z.isArrayBufferView(e))return e.buffer;if(z.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let o;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return H(e,new oe.classes.URLSearchParams,Object.assign({visitor:function(e,t,r,n){return oe.isNode&&z.isBuffer(e)?(this.append(t,e.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((o=z.isFileList(e))||r.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return H(o?{"files[]":e}:e,t&&new t,this.formSerializer)}}return i||n?(t.setContentType("application/json",!1),function(e,t,r){if(z.isString(e))try{return(0,JSON.parse)(e),z.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||ae.transitional,r=t&&t.forcedJSONParsing,n="json"===this.responseType;if(e&&z.isString(e)&&(r&&!this.responseType||n)){const r=!(t&&t.silentJSONParsing)&&n;try{return JSON.parse(e)}catch(e){if(r){if("SyntaxError"===e.name)throw N.from(e,N.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:oe.classes.FormData,Blob:oe.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};z.forEach(["delete","get","head","post","put","patch"],(e=>{ae.headers[e]={}}));var le=ae;const ce=z.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),de=Symbol("internals");function ue(e){return e&&String(e).trim().toLowerCase()}function he(e){return!1===e||null==e?e:z.isArray(e)?e.map(he):String(e)}function fe(e,t,r,n,i){return z.isFunction(n)?n.call(this,t,r):(i&&(t=r),z.isString(t)?z.isString(n)?-1!==t.indexOf(n):z.isRegExp(n)?n.test(t):void 0:void 0)}class pe{constructor(e){e&&this.set(e)}set(e,t,r){const n=this;function i(e,t,r){const i=ue(t);if(!i)throw new Error("header name must be a non-empty string");const o=z.findKey(n,i);(!o||void 0===n[o]||!0===r||void 0===r&&!1!==n[o])&&(n[o||t]=he(e))}const o=(e,t)=>z.forEach(e,((e,r)=>i(e,r,t)));return z.isPlainObject(e)||e instanceof this.constructor?o(e,t):z.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim())?o((e=>{const t={};let r,n,i;return e&&e.split("\n").forEach((function(e){i=e.indexOf(":"),r=e.substring(0,i).trim().toLowerCase(),n=e.substring(i+1).trim(),!r||t[r]&&ce[r]||("set-cookie"===r?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)})),t})(e),t):null!=e&&i(t,e,r),this}get(e,t){if(e=ue(e)){const r=z.findKey(this,e);if(r){const e=this[r];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}(e);if(z.isFunction(t))return t.call(this,e,r);if(z.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=ue(e)){const r=z.findKey(this,e);return!(!r||void 0===this[r]||t&&!fe(0,this[r],r,t))}return!1}delete(e,t){const r=this;let n=!1;function i(e){if(e=ue(e)){const i=z.findKey(r,e);!i||t&&!fe(0,r[i],i,t)||(delete r[i],n=!0)}}return z.isArray(e)?e.forEach(i):i(e),n}clear(e){const t=Object.keys(this);let r=t.length,n=!1;for(;r--;){const i=t[r];e&&!fe(0,this[i],i,e,!0)||(delete this[i],n=!0)}return n}normalize(e){const t=this,r={};return z.forEach(this,((n,i)=>{const o=z.findKey(r,i);if(o)return t[o]=he(n),void delete t[i];const s=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,r)=>t.toUpperCase()+r))}(i):String(i).trim();s!==i&&delete t[i],t[s]=he(n),r[s]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return z.forEach(this,((r,n)=>{null!=r&&!1!==r&&(t[n]=e&&z.isArray(r)?r.join(", "):r)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const r=new this(e);return t.forEach((e=>r.set(e))),r}static accessor(e){const t=(this[de]=this[de]={accessors:{}}).accessors,r=this.prototype;function n(e){const n=ue(e);t[n]||(function(e,t){const r=z.toCamelCase(" "+t);["get","set","has"].forEach((n=>{Object.defineProperty(e,n+r,{value:function(e,r,i){return this[n].call(this,t,e,r,i)},configurable:!0})}))}(r,e),t[n]=!0)}return z.isArray(e)?e.forEach(n):n(e),this}}pe.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),z.reduceDescriptors(pe.prototype,(({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[r]=e}}})),z.freezeMethods(pe);var ge=pe;function me(e,t){const r=this||le,n=t||r,i=ge.from(n.headers);let o=n.data;return z.forEach(e,(function(e){o=e.call(r,o,i.normalize(),t?t.status:void 0)})),i.normalize(),o}function ye(e){return!(!e||!e.__CANCEL__)}function be(e,t,r){N.call(this,null==e?"canceled":e,N.ERR_CANCELED,t,r),this.name="CanceledError"}z.inherits(be,N,{__CANCEL__:!0});var we=oe.hasStandardBrowserEnv?{write(e,t,r,n,i,o){const s=[e+"="+encodeURIComponent(t)];z.isNumber(r)&&s.push("expires="+new Date(r).toGMTString()),z.isString(n)&&s.push("path="+n),z.isString(i)&&s.push("domain="+i),!0===o&&s.push("secure"),document.cookie=s.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function ve(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}var Ce=oe.hasStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let r;function n(r){let n=r;return e&&(t.setAttribute("href",n),n=t.href),t.setAttribute("href",n),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:"/"===t.pathname.charAt(0)?t.pathname:"/"+t.pathname}}return r=n(window.location.href),function(e){const t=z.isString(e)?n(e):e;return t.protocol===r.protocol&&t.host===r.host}}():function(){return!0};function _e(e,t){let r=0;const n=function(e,t){e=e||10;const r=new Array(e),n=new Array(e);let i,o=0,s=0;return t=void 0!==t?t:1e3,function(a){const l=Date.now(),c=n[s];i||(i=l),r[o]=a,n[o]=l;let d=s,u=0;for(;d!==o;)u+=r[d++],d%=e;if(o=(o+1)%e,o===s&&(s=(s+1)%e),l-i{const o=i.loaded,s=i.lengthComputable?i.total:void 0,a=o-r,l=n(a);r=o;const c={loaded:o,total:s,progress:s?o/s:void 0,bytes:a,rate:l||void 0,estimated:l&&s&&o<=s?(s-o)/l:void 0,event:i};c[t?"download":"upload"]=!0,e(c)}}const ke={http:null,xhr:"undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,r){let n=e.data;const i=ge.from(e.headers).normalize();let o,s,{responseType:a,withXSRFToken:l}=e;function c(){e.cancelToken&&e.cancelToken.unsubscribe(o),e.signal&&e.signal.removeEventListener("abort",o)}if(z.isFormData(n))if(oe.hasStandardBrowserEnv||oe.hasStandardBrowserWebWorkerEnv)i.setContentType(!1);else if(!1!==(s=i.getContentType())){const[e,...t]=s?s.split(";").map((e=>e.trim())).filter(Boolean):[];i.setContentType([e||"multipart/form-data",...t].join("; "))}let d=new XMLHttpRequest;if(e.auth){const t=e.auth.username||"",r=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";i.set("Authorization","Basic "+btoa(t+":"+r))}const u=ve(e.baseURL,e.url);function h(){if(!d)return;const n=ge.from("getAllResponseHeaders"in d&&d.getAllResponseHeaders());!function(e,t,r){const n=r.config.validateStatus;r.status&&n&&!n(r.status)?t(new N("Request failed with status code "+r.status,[N.ERR_BAD_REQUEST,N.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):e(r)}((function(e){t(e),c()}),(function(e){r(e),c()}),{data:a&&"text"!==a&&"json"!==a?d.response:d.responseText,status:d.status,statusText:d.statusText,headers:n,config:e,request:d}),d=null}if(d.open(e.method.toUpperCase(),Q(u,e.params,e.paramsSerializer),!0),d.timeout=e.timeout,"onloadend"in d?d.onloadend=h:d.onreadystatechange=function(){d&&4===d.readyState&&(0!==d.status||d.responseURL&&0===d.responseURL.indexOf("file:"))&&setTimeout(h)},d.onabort=function(){d&&(r(new N("Request aborted",N.ECONNABORTED,e,d)),d=null)},d.onerror=function(){r(new N("Network Error",N.ERR_NETWORK,e,d)),d=null},d.ontimeout=function(){let t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const n=e.transitional||X;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),r(new N(t,n.clarifyTimeoutError?N.ETIMEDOUT:N.ECONNABORTED,e,d)),d=null},oe.hasStandardBrowserEnv&&(l&&z.isFunction(l)&&(l=l(e)),l||!1!==l&&Ce(u))){const t=e.xsrfHeaderName&&e.xsrfCookieName&&we.read(e.xsrfCookieName);t&&i.set(e.xsrfHeaderName,t)}void 0===n&&i.setContentType(null),"setRequestHeader"in d&&z.forEach(i.toJSON(),(function(e,t){d.setRequestHeader(t,e)})),z.isUndefined(e.withCredentials)||(d.withCredentials=!!e.withCredentials),a&&"json"!==a&&(d.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&d.addEventListener("progress",_e(e.onDownloadProgress,!0)),"function"==typeof e.onUploadProgress&&d.upload&&d.upload.addEventListener("progress",_e(e.onUploadProgress)),(e.cancelToken||e.signal)&&(o=t=>{d&&(r(!t||t.type?new be(null,e,d):t),d.abort(),d=null)},e.cancelToken&&e.cancelToken.subscribe(o),e.signal&&(e.signal.aborted?o():e.signal.addEventListener("abort",o)));const f=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(u);f&&-1===oe.protocols.indexOf(f)?r(new N("Unsupported protocol "+f+":",N.ERR_BAD_REQUEST,e)):d.send(n||null)}))}};z.forEach(ke,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));const xe=e=>`- ${e}`,Ae=e=>z.isFunction(e)||null===e||!1===e;var Se=e=>{e=z.isArray(e)?e:[e];const{length:t}=e;let r,n;const i={};for(let o=0;o`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build")));throw new N("There is no suitable adapter to dispatch the request "+(t?e.length>1?"since :\n"+e.map(xe).join("\n"):" "+xe(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return n};function Be(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new be(null,e)}function Ee(e){return Be(e),e.headers=ge.from(e.headers),e.data=me.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Se(e.adapter||le.adapter)(e).then((function(t){return Be(e),t.data=me.call(e,e.transformResponse,t),t.headers=ge.from(t.headers),t}),(function(t){return ye(t)||(Be(e),t&&t.response&&(t.response.data=me.call(e,e.transformResponse,t.response),t.response.headers=ge.from(t.response.headers))),Promise.reject(t)}))}const Pe=e=>e instanceof ge?{...e}:e;function Ie(e,t){t=t||{};const r={};function n(e,t,r){return z.isPlainObject(e)&&z.isPlainObject(t)?z.merge.call({caseless:r},e,t):z.isPlainObject(t)?z.merge({},t):z.isArray(t)?t.slice():t}function i(e,t,r){return z.isUndefined(t)?z.isUndefined(e)?void 0:n(void 0,e,r):n(e,t,r)}function o(e,t){if(!z.isUndefined(t))return n(void 0,t)}function s(e,t){return z.isUndefined(t)?z.isUndefined(e)?void 0:n(void 0,e):n(void 0,t)}function a(r,i,o){return o in t?n(r,i):o in e?n(void 0,r):void 0}const l={url:o,method:o,data:o,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(e,t)=>i(Pe(e),Pe(t),!0)};return z.forEach(Object.keys(Object.assign({},e,t)),(function(n){const o=l[n]||i,s=o(e[n],t[n],n);z.isUndefined(s)&&o!==a||(r[n]=s)})),r}const Me={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{Me[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}}));const Ue={};Me.transitional=function(e,t,r){function n(e,t){return"[Axios v1.6.8] Transitional option '"+e+"'"+t+(r?". "+r:"")}return(r,i,o)=>{if(!1===e)throw new N(n(i," has been removed"+(t?" in "+t:"")),N.ERR_DEPRECATED);return t&&!Ue[i]&&(Ue[i]=!0,console.warn(n(i," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,i,o)}};var Te={assertOptions:function(e,t,r){if("object"!=typeof e)throw new N("options must be an object",N.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let i=n.length;for(;i-- >0;){const o=n[i],s=t[o];if(s){const t=e[o],r=void 0===t||s(t,o,e);if(!0!==r)throw new N("option "+o+" must be "+r,N.ERR_BAD_OPTION_VALUE)}else if(!0!==r)throw new N("Unknown option "+o,N.ERR_BAD_OPTION)}},validators:Me};const Oe=Te.validators;class Re{constructor(e){this.defaults=e,this.interceptors={request:new J,response:new J}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t;Error.captureStackTrace?Error.captureStackTrace(t={}):t=new Error;const r=t.stack?t.stack.replace(/^.+\n/,""):"";e.stack?r&&!String(e.stack).endsWith(r.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+r):e.stack=r}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Ie(this.defaults,t);const{transitional:r,paramsSerializer:n,headers:i}=t;void 0!==r&&Te.assertOptions(r,{silentJSONParsing:Oe.transitional(Oe.boolean),forcedJSONParsing:Oe.transitional(Oe.boolean),clarifyTimeoutError:Oe.transitional(Oe.boolean)},!1),null!=n&&(z.isFunction(n)?t.paramsSerializer={serialize:n}:Te.assertOptions(n,{encode:Oe.function,serialize:Oe.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase();let o=i&&z.merge(i.common,i[t.method]);i&&z.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete i[e]})),t.headers=ge.concat(o,i);const s=[];let a=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(a=a&&e.synchronous,s.unshift(e.fulfilled,e.rejected))}));const l=[];let c;this.interceptors.response.forEach((function(e){l.push(e.fulfilled,e.rejected)}));let d,u=0;if(!a){const e=[Ee.bind(this),void 0];for(e.unshift.apply(e,s),e.push.apply(e,l),d=e.length,c=Promise.resolve(t);u{if(!r._listeners)return;let t=r._listeners.length;for(;t-- >0;)r._listeners[t](e);r._listeners=null})),this.promise.then=e=>{let t;const n=new Promise((e=>{r.subscribe(e),t=e})).then(e);return n.cancel=function(){r.unsubscribe(t)},n},e((function(e,n,i){r.reason||(r.reason=new be(e,n,i),t(r.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}static source(){let e;return{token:new Le((function(t){e=t})),cancel:e}}}var ze=Le;const Ne={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(Ne).forEach((([e,t])=>{Ne[t]=e}));var De=Ne;const $e=function e(t){const r=new je(t),n=i(je.prototype.request,r);return z.extend(n,je.prototype,r,{allOwnKeys:!0}),z.extend(n,r,null,{allOwnKeys:!0}),n.create=function(r){return e(Ie(t,r))},n}(le);$e.Axios=je,$e.CanceledError=be,$e.CancelToken=ze,$e.isCancel=ye,$e.VERSION="1.6.8",$e.toFormData=H,$e.AxiosError=N,$e.Cancel=$e.CanceledError,$e.all=function(e){return Promise.all(e)},$e.spread=function(e){return function(t){return e.apply(null,t)}},$e.isAxiosError=function(e){return z.isObject(e)&&!0===e.isAxiosError},$e.mergeConfig=Ie,$e.AxiosHeaders=ge,$e.formToJSON=e=>se(z.isHTMLForm(e)?new FormData(e):e),$e.getAdapter=Se,$e.HttpStatusCode=De,$e.default=$e,e.exports=$e},6942:(e,t)=>{var r;!function(){"use strict";var n={}.hasOwnProperty;function i(){for(var e="",t=0;t{"use strict";e.exports={rE:"13.11.1"}}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var o=t[n]={exports:{}};return e[n].call(o.exports,o,o.exports,r),o.exports}r.amdO={},r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";var e,t,n,i,o,s,a=r(1307),l=r(6386),c=r(8947);!function(e){e[e.UNKNOWN_ERROR=0]="UNKNOWN_ERROR",e[e.BAD_REQUEST_ERROR=1]="BAD_REQUEST_ERROR",e[e.MANIFEST_NOT_FOUND_ERROR=2]="MANIFEST_NOT_FOUND_ERROR",e[e.MANIFEST_CONTENT_ERROR=3]="MANIFEST_CONTENT_ERROR",e[e.UNKNOWN_APP_ERROR=100]="UNKNOWN_APP_ERROR",e[e.USER_REJECTS_ERROR=300]="USER_REJECTS_ERROR",e[e.METHOD_NOT_SUPPORTED=400]="METHOD_NOT_SUPPORTED"}(e||(e={})),function(e){e[e.UNKNOWN_ERROR=0]="UNKNOWN_ERROR",e[e.METHOD_NOT_SUPPORTED=400]="METHOD_NOT_SUPPORTED"}(t||(t={})),function(e){e[e.UNKNOWN_ERROR=0]="UNKNOWN_ERROR",e[e.BAD_REQUEST_ERROR=1]="BAD_REQUEST_ERROR",e[e.UNKNOWN_APP_ERROR=100]="UNKNOWN_APP_ERROR",e[e.USER_REJECTS_ERROR=300]="USER_REJECTS_ERROR",e[e.METHOD_NOT_SUPPORTED=400]="METHOD_NOT_SUPPORTED"}(n||(n={})),function(e){e[e.UNKNOWN_ERROR=0]="UNKNOWN_ERROR",e[e.BAD_REQUEST_ERROR=1]="BAD_REQUEST_ERROR",e[e.UNKNOWN_APP_ERROR=100]="UNKNOWN_APP_ERROR",e[e.USER_REJECTS_ERROR=300]="USER_REJECTS_ERROR",e[e.METHOD_NOT_SUPPORTED=400]="METHOD_NOT_SUPPORTED"}(i||(i={})),function(e){e[e.UNKNOWN_ERROR=0]="UNKNOWN_ERROR",e[e.BAD_REQUEST_ERROR=1]="BAD_REQUEST_ERROR",e[e.UNKNOWN_APP_ERROR=100]="UNKNOWN_APP_ERROR",e[e.METHOD_NOT_SUPPORTED=400]="METHOD_NOT_SUPPORTED"}(o||(o={})),function(e){e.MAINNET="-239",e.TESTNET="-3"}(s||(s={}));const d=function(e,t=!1){let r;return e instanceof Uint8Array?r=e:("string"!=typeof e&&(e=JSON.stringify(e)),r=l.decodeUTF8(e)),function(e,t){const r=l.encodeBase64(e);return t?encodeURIComponent(r):r}(r,t)},u=function(e,t=!1){const r=function(e,t){return t&&(e=decodeURIComponent(e)),l.decodeBase64(e)}(e,t);return{toString:()=>l.encodeUTF8(r),toObject(){try{return JSON.parse(l.encodeUTF8(r))}catch(e){return null}},toUint8Array:()=>r}};function h(e){let t="";return e.forEach((e=>{t+=("0"+(255&e).toString(16)).slice(-2)})),t}function f(e){if(e.length%2!=0)throw new Error(`Cannot convert ${e} to bytesArray`);const t=new Uint8Array(e.length/2);for(let r=0;r=e.length)throw new Error("Index is out of buffer");return[e.slice(0,t),e.slice(t)]}(e,this.nonceLength),i=c.box.open(n,r,t,this.keyPair.secretKey);if(!i)throw new Error(`Decryption error: \n message: ${e.toString()} \n sender pubkey: ${t.toString()} \n keypair pubkey: ${this.keyPair.publicKey.toString()} \n keypair secretkey: ${this.keyPair.secretKey.toString()}`);return(new TextDecoder).decode(i)}stringifyKeypair(){return{publicKey:h(this.keyPair.publicKey),secretKey:h(this.keyPair.secretKey)}}}function g(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}l((n=n.apply(e,t||[])).next())}))}class m extends Error{constructor(e,t){super(e,t),this.message=`${m.prefix} ${this.constructor.name}${this.info?": "+this.info:""}${e?"\n"+e:""}`,Object.setPrototypeOf(this,m.prototype)}get info(){return""}}m.prefix="[TON_CONNECT_SDK_ERROR]";class y extends m{get info(){return"Passed DappMetadata is in incorrect format."}constructor(...e){super(...e),Object.setPrototypeOf(this,y.prototype)}}class b extends m{get info(){return"Passed `tonconnect-manifest.json` contains errors. Check format of your manifest. See more https://github.com/ton-connect/docs/blob/main/requests-responses.md#app-manifest"}constructor(...e){super(...e),Object.setPrototypeOf(this,b.prototype)}}class w extends m{get info(){return"Manifest not found. Make sure you added `tonconnect-manifest.json` to the root of your app or passed correct manifestUrl. See more https://github.com/ton-connect/docs/blob/main/requests-responses.md#app-manifest"}constructor(...e){super(...e),Object.setPrototypeOf(this,w.prototype)}}class v extends m{get info(){return"Wallet connection called but wallet already connected. To avoid the error, disconnect the wallet before doing a new connection."}constructor(...e){super(...e),Object.setPrototypeOf(this,v.prototype)}}class C extends m{get info(){return"Send transaction or other protocol methods called while wallet is not connected."}constructor(...e){super(...e),Object.setPrototypeOf(this,C.prototype)}}class _ extends m{get info(){return"User rejects the action in the wallet."}constructor(...e){super(...e),Object.setPrototypeOf(this,_.prototype)}}class k extends m{get info(){return"Request to the wallet contains errors."}constructor(...e){super(...e),Object.setPrototypeOf(this,k.prototype)}}class x extends m{get info(){return"App tries to send rpc request to the injected wallet while not connected."}constructor(...e){super(...e),Object.setPrototypeOf(this,x.prototype)}}class A extends m{get info(){return"There is an attempt to connect to the injected wallet while it is not exists in the webpage."}constructor(...e){super(...e),Object.setPrototypeOf(this,A.prototype)}}class S extends m{get info(){return"An error occurred while fetching the wallets list."}constructor(...e){super(...e),Object.setPrototypeOf(this,S.prototype)}}class B extends m{get info(){return"Passed address is in incorrect format."}constructor(...e){super(...e),Object.setPrototypeOf(this,B.prototype)}}class E extends m{get info(){return"Passed hex is in incorrect format."}constructor(...e){super(...e),Object.setPrototypeOf(this,E.prototype)}}class P extends m{constructor(...e){super(...e),Object.setPrototypeOf(this,P.prototype)}}const I={[e.UNKNOWN_ERROR]:P,[e.USER_REJECTS_ERROR]:_,[e.BAD_REQUEST_ERROR]:k,[e.UNKNOWN_APP_ERROR]:x,[e.MANIFEST_NOT_FOUND_ERROR]:w,[e.MANIFEST_CONTENT_ERROR]:b},M=new class{parseError(e){let t=P;return e.code in I&&(t=I[e.code]||P),new t(e.message)}};class U{isError(e){return"error"in e}}const T={[n.UNKNOWN_ERROR]:P,[n.USER_REJECTS_ERROR]:_,[n.BAD_REQUEST_ERROR]:k,[n.UNKNOWN_APP_ERROR]:x},O=new class extends U{convertToRpcRequest(e){return{method:"sendTransaction",params:[JSON.stringify(e)]}}parseAndThrowError(e){let t=P;throw e.error.code in T&&(t=T[e.error.code]||P),new t(e.error.message)}convertFromRpcResponse(e){return{boc:e.result}}};class R{constructor(e,t){this.storage=e,this.storeKey="ton-connect-storage_http-bridge-gateway::"+t}storeLastEventId(e){return g(this,void 0,void 0,(function*(){return this.storage.setItem(this.storeKey,e)}))}removeLastEventId(){return g(this,void 0,void 0,(function*(){return this.storage.removeItem(this.storeKey)}))}getLastEventId(){return g(this,void 0,void 0,(function*(){return(yield this.storage.getItem(this.storeKey))||null}))}}function j(e,t){return function(e){return"/"===e.slice(-1)?e.slice(0,-1):e}(e)+"/"+t}function L(e){if(!e)return!1;const t=new URL(e);return"tg:"===t.protocol||"t.me"===t.hostname}function z(e){return e.replaceAll(".","%2E").replaceAll("-","%2D").replaceAll("_","%5F").replaceAll("&","-").replaceAll("=","__").replaceAll("%","--")}class N{constructor(e,t,r,n,i){this.bridgeUrl=t,this.sessionId=r,this.listener=n,this.errorsListener=i,this.ssePath="events",this.postPath="message",this.heartbeatMessage="heartbeat",this.defaultTtl=300,this.isClosed=!1,this.bridgeGatewayStorage=new R(e,t)}registerSession(e){return g(this,void 0,void 0,(function*(){const t=new URL(j(this.bridgeUrl,this.ssePath));t.searchParams.append("client_id",this.sessionId);const r=yield this.bridgeGatewayStorage.getLastEventId();if(!this.isClosed)return r&&t.searchParams.append("last_event_id",r),this.eventSource=new EventSource(t.toString()),new Promise(((t,r)=>{const n=(null==e?void 0:e.openingDeadlineMS)?setTimeout((()=>{var e;(null===(e=this.eventSource)||void 0===e?void 0:e.readyState)!==EventSource.OPEN&&(r(new m("Bridge connection timeout")),this.close())}),e.openingDeadlineMS):void 0;this.eventSource.onerror=()=>r,this.eventSource.onopen=()=>{clearTimeout(n),this.isClosed=!1,this.eventSource.onerror=this.errorsHandler.bind(this),this.eventSource.onmessage=this.messagesHandler.bind(this),t()}}))}))}send(e,t,r,n){return g(this,void 0,void 0,(function*(){const i=new URL(j(this.bridgeUrl,this.postPath));i.searchParams.append("client_id",this.sessionId),i.searchParams.append("to",t),i.searchParams.append("ttl",(n||this.defaultTtl).toString()),i.searchParams.append("topic",r);const o=yield fetch(i,{method:"post",body:d(e)});if(!o.ok)throw new m(`Bridge send failed, status ${o.status}`)}))}pause(){var e;null===(e=this.eventSource)||void 0===e||e.close()}unPause(){return this.registerSession()}close(){var e;this.isClosed=!0,null===(e=this.eventSource)||void 0===e||e.close()}setListener(e){this.listener=e}setErrorsListener(e){this.errorsListener=e}errorsHandler(e){var t,r;if(!this.isClosed){if((null===(t=this.eventSource)||void 0===t?void 0:t.readyState)===EventSource.CLOSED)return this.eventSource.close(),void this.registerSession();if((null===(r=this.eventSource)||void 0===r?void 0:r.readyState)===EventSource.CONNECTING)return void console.debug("[TON_CONNET_SDK_ERROR]: Bridge error",JSON.stringify(e));this.errorsListener(e)}}messagesHandler(e){return g(this,void 0,void 0,(function*(){if(e.data!==this.heartbeatMessage&&(yield this.bridgeGatewayStorage.storeLastEventId(e.lastEventId),!this.isClosed)){let t;try{t=JSON.parse(e.data)}catch(e){throw new m(`Bridge message parse failed, message ${e.data}`)}this.listener(t)}}))}}function D(e){return!("connectEvent"in e)}class ${constructor(e){this.storage=e,this.storeKey="ton-connect-storage_bridge-connection"}storeConnection(e){return g(this,void 0,void 0,(function*(){if("injected"===e.type)return this.storage.setItem(this.storeKey,JSON.stringify(e));if(!D(e)){const t={sessionKeyPair:e.session.sessionCrypto.stringifyKeypair(),walletPublicKey:e.session.walletPublicKey,bridgeUrl:e.session.bridgeUrl},r={type:"http",connectEvent:e.connectEvent,session:t,lastWalletEventId:e.lastWalletEventId,nextRpcRequestId:e.nextRpcRequestId};return this.storage.setItem(this.storeKey,JSON.stringify(r))}const t={type:"http",connectionSource:e.connectionSource,sessionCrypto:e.sessionCrypto.stringifyKeypair()};return this.storage.setItem(this.storeKey,JSON.stringify(t))}))}removeConnection(){return g(this,void 0,void 0,(function*(){return this.storage.removeItem(this.storeKey)}))}getConnection(){return g(this,void 0,void 0,(function*(){const e=yield this.storage.getItem(this.storeKey);if(!e)return null;const t=JSON.parse(e);if("injected"===t.type)return t;if("connectEvent"in t){const e=new p(t.session.sessionKeyPair);return{type:"http",connectEvent:t.connectEvent,lastWalletEventId:t.lastWalletEventId,nextRpcRequestId:t.nextRpcRequestId,session:{sessionCrypto:e,bridgeUrl:t.session.bridgeUrl,walletPublicKey:t.session.walletPublicKey}}}return{type:"http",sessionCrypto:new p(t.sessionCrypto),connectionSource:t.connectionSource}}))}getHttpConnection(){return g(this,void 0,void 0,(function*(){const e=yield this.getConnection();if(!e)throw new m("Trying to read HTTP connection source while nothing is stored");if("injected"===e.type)throw new m("Trying to read HTTP connection source while injected connection is stored");return e}))}getHttpPendingConnection(){return g(this,void 0,void 0,(function*(){const e=yield this.getConnection();if(!e)throw new m("Trying to read HTTP connection source while nothing is stored");if("injected"===e.type)throw new m("Trying to read HTTP connection source while injected connection is stored");if(!D(e))throw new m("Trying to read HTTP-pending connection while http connection is stored");return e}))}getInjectedConnection(){return g(this,void 0,void 0,(function*(){const e=yield this.getConnection();if(!e)throw new m("Trying to read Injected bridge connection source while nothing is stored");if("http"===(null==e?void 0:e.type))throw new m("Trying to read Injected bridge connection source while HTTP connection is stored");return e}))}storedConnectionType(){return g(this,void 0,void 0,(function*(){const e=yield this.storage.getItem(this.storeKey);return e?JSON.parse(e).type:null}))}storeLastWalletEventId(e){return g(this,void 0,void 0,(function*(){const t=yield this.getConnection();if(t&&"http"===t.type&&!D(t))return t.lastWalletEventId=e,this.storeConnection(t)}))}getLastWalletEventId(){return g(this,void 0,void 0,(function*(){const e=yield this.getConnection();if(e&&"lastWalletEventId"in e)return e.lastWalletEventId}))}increaseNextRpcRequestId(){return g(this,void 0,void 0,(function*(){const e=yield this.getConnection();if(e&&"nextRpcRequestId"in e){const t=e.nextRpcRequestId||0;return e.nextRpcRequestId=t+1,this.storeConnection(e)}}))}getNextRpcRequestId(){return g(this,void 0,void 0,(function*(){const e=yield this.getConnection();return e&&"nextRpcRequestId"in e&&e.nextRpcRequestId||0}))}}function F(...e){try{console.debug("[TON_CONNECT_SDK]",...e)}catch(e){}}function K(...e){try{console.error("[TON_CONNECT_SDK]",...e)}catch(e){}}class V{constructor(e,t){this.storage=e,this.walletConnectionSource=t,this.type="http",this.standardUniversalLink="tc://",this.pendingRequests=new Map,this.session=null,this.gateway=null,this.pendingGateways=[],this.listeners=[],this.connectionStorage=new $(e)}static fromStorage(e){return g(this,void 0,void 0,(function*(){const t=new $(e),r=yield t.getHttpConnection();return D(r)?new V(e,r.connectionSource):new V(e,{bridgeUrl:r.session.bridgeUrl})}))}connect(e){this.closeGateways();const t=new p;this.session={sessionCrypto:t,bridgeUrl:"bridgeUrl"in this.walletConnectionSource?this.walletConnectionSource.bridgeUrl:""},this.connectionStorage.storeConnection({type:"http",connectionSource:this.walletConnectionSource,sessionCrypto:t}).then((()=>this.openGateways(t)));const r="universalLink"in this.walletConnectionSource&&this.walletConnectionSource.universalLink?this.walletConnectionSource.universalLink:this.standardUniversalLink;return this.generateUniversalLink(r,e)}restoreConnection(){return g(this,void 0,void 0,(function*(){this.closeGateways();const e=yield this.connectionStorage.getHttpConnection();if(e){if(D(e))return this.session={sessionCrypto:e.sessionCrypto,bridgeUrl:"bridgeUrl"in this.walletConnectionSource?this.walletConnectionSource.bridgeUrl:""},this.openGateways(e.sessionCrypto,{openingDeadlineMS:5e3});if(Array.isArray(this.walletConnectionSource))throw new m("Internal error. Connection source is array while WalletConnectionSourceHTTP was expected.");this.session=e.session,this.gateway=new N(this.storage,this.walletConnectionSource.bridgeUrl,e.session.sessionCrypto.sessionId,this.gatewayListener.bind(this),this.gatewayErrorsListener.bind(this));try{yield this.gateway.registerSession({openingDeadlineMS:5e3})}catch(e){return void(yield this.disconnect())}this.listeners.forEach((t=>t(e.connectEvent)))}}))}sendRequest(e,t){return new Promise(((r,n)=>g(this,void 0,void 0,(function*(){if(!this.gateway||!this.session||!("walletPublicKey"in this.session))throw new m("Trying to send bridge request without session");const i=(yield this.connectionStorage.getNextRpcRequestId()).toString();yield this.connectionStorage.increaseNextRpcRequestId(),F("Send http-bridge request:",Object.assign(Object.assign({},e),{id:i}));const o=this.session.sessionCrypto.encrypt(JSON.stringify(Object.assign(Object.assign({},e),{id:i})),f(this.session.walletPublicKey));try{yield this.gateway.send(o,this.session.walletPublicKey,e.method),null==t||t(),this.pendingRequests.set(i.toString(),r)}catch(e){n(e)}}))))}closeConnection(){this.closeGateways(),this.listeners=[],this.session=null,this.gateway=null}disconnect(){return g(this,void 0,void 0,(function*(){return new Promise((e=>g(this,void 0,void 0,(function*(){let t=!1;const r=()=>{t=!0,this.removeBridgeAndSession().then(e)};try{yield this.sendRequest({method:"disconnect",params:[]},r)}catch(r){console.debug(r),t||this.removeBridgeAndSession().then(e)}}))))}))}listen(e){return this.listeners.push(e),()=>this.listeners=this.listeners.filter((t=>t!==e))}pause(){var e;null===(e=this.gateway)||void 0===e||e.pause(),this.pendingGateways.forEach((e=>e.pause()))}unPause(){return g(this,void 0,void 0,(function*(){const e=this.pendingGateways.map((e=>e.unPause()));this.gateway&&e.push(this.gateway.unPause()),yield Promise.all(e)}))}pendingGatewaysListener(e,t,r){return g(this,void 0,void 0,(function*(){if(this.pendingGateways.includes(e))return this.closeGateways({except:e}),this.session.bridgeUrl=t,this.gateway=e,this.gateway.setErrorsListener(this.gatewayErrorsListener.bind(this)),this.gateway.setListener(this.gatewayListener.bind(this)),this.gatewayListener(r);e.close()}))}gatewayListener(e){return g(this,void 0,void 0,(function*(){const t=JSON.parse(this.session.sessionCrypto.decrypt(u(e.message).toUint8Array(),f(e.from)));if(F("Wallet message received:",t),!("event"in t)){const e=t.id.toString(),r=this.pendingRequests.get(e);return r?(r(t),void this.pendingRequests.delete(e)):void F(`Response id ${e} doesn't match any request's id`)}if(void 0!==t.id){const e=yield this.connectionStorage.getLastWalletEventId();if(void 0!==e&&t.id<=e)return void K(`Received event id (=${t.id}) must be greater than stored last wallet event id (=${e}) `);"connect"!==t.event&&(yield this.connectionStorage.storeLastWalletEventId(t.id))}const r=this.listeners;"connect"===t.event&&(yield this.updateSession(t,e.from)),"disconnect"===t.event&&(yield this.removeBridgeAndSession()),r.forEach((e=>e(t)))}))}gatewayErrorsListener(e){return g(this,void 0,void 0,(function*(){throw new m(`Bridge error ${JSON.stringify(e)}`)}))}updateSession(e,t){return g(this,void 0,void 0,(function*(){this.session=Object.assign(Object.assign({},this.session),{walletPublicKey:t});const r=e.payload.items.find((e=>"ton_addr"===e.name)),n=Object.assign(Object.assign({},e),{payload:Object.assign(Object.assign({},e.payload),{items:[r]})});yield this.connectionStorage.storeConnection({type:"http",session:this.session,lastWalletEventId:e.id,connectEvent:n,nextRpcRequestId:0})}))}removeBridgeAndSession(){return g(this,void 0,void 0,(function*(){this.closeConnection(),yield this.connectionStorage.removeConnection()}))}generateUniversalLink(e,t){return L(e)?this.generateTGUniversalLink(e,t):this.generateRegularUniversalLink(e,t)}generateRegularUniversalLink(e,t){const r=new URL(e);return r.searchParams.append("v",2..toString()),r.searchParams.append("id",this.session.sessionCrypto.sessionId),r.searchParams.append("r",JSON.stringify(t)),r.toString()}generateTGUniversalLink(e,t){const r="tonconnect-"+z(this.generateRegularUniversalLink("about:blank",t).split("?")[1]),n=this.convertToDirectLink(e),i=new URL(n);return i.searchParams.append("startapp",r),i.toString()}convertToDirectLink(e){const t=new URL(e);return t.searchParams.has("attach")&&(t.searchParams.delete("attach"),t.pathname+="/start"),t.toString()}openGateways(e,t){return g(this,void 0,void 0,(function*(){return Array.isArray(this.walletConnectionSource)?(this.pendingGateways=this.walletConnectionSource.map((t=>{const r=new N(this.storage,t.bridgeUrl,e.sessionId,(()=>{}),(e=>{console.error(e)}));return r.setListener((e=>this.pendingGatewaysListener(r,t.bridgeUrl,e))),r})),void(yield Promise.allSettled(this.pendingGateways.map((e=>e.registerSession(t)))))):(this.gateway=new N(this.storage,this.walletConnectionSource.bridgeUrl,e.sessionId,this.gatewayListener.bind(this),this.gatewayErrorsListener.bind(this)),this.gateway.registerSession(t))}))}closeGateways(e){var t;null===(t=this.gateway)||void 0===t||t.close(),this.pendingGateways.filter((t=>t!==(null==e?void 0:e.except))).forEach((e=>e.close())),this.pendingGateways=[]}}function q(e,t){return H(e,[t])}function H(e,t){return!(!e||"object"!=typeof e)&&t.every((t=>t in e))}class Z{constructor(){this.storage={}}static getInstance(){return Z.instance||(Z.instance=new Z),Z.instance}get length(){return Object.keys(this.storage).length}clear(){this.storage={}}getItem(e){var t;return null!==(t=this.storage[e])&&void 0!==t?t:null}key(e){var t;const r=Object.keys(this.storage);return e<0||e>=r.length?null:null!==(t=r[e])&&void 0!==t?t:null}removeItem(e){delete this.storage[e]}setItem(e,t){this.storage[e]=t}}function W(){if("undefined"!=typeof window)return window}function G(){if("undefined"!=typeof document)return document}function Y(){var e;const t=null===(e=W())||void 0===e?void 0:e.location.origin;return t?t+"/tonconnect-manifest.json":""}class Q{constructor(e,t){this.injectedWalletKey=t,this.type="injected",this.unsubscribeCallback=null,this.listenSubscriptions=!1,this.listeners=[];const r=Q.window;if(!Q.isWindowContainsWallet(r,t))throw new A;this.connectionStorage=new $(e),this.injectedWallet=r[t].tonconnect}static fromStorage(e){return g(this,void 0,void 0,(function*(){const t=new $(e),r=yield t.getInjectedConnection();return new Q(e,r.jsBridgeKey)}))}static isWalletInjected(e){return Q.isWindowContainsWallet(this.window,e)}static isInsideWalletBrowser(e){return!!Q.isWindowContainsWallet(this.window,e)&&this.window[e].tonconnect.isWalletBrowser}static getCurrentlyInjectedWallets(){return this.window?function(){const e=W();if(!e)return[];try{return Object.keys(e)}catch(e){return[]}}().filter((([e,t])=>function(e){try{return!(!q(e,"tonconnect")||!q(e.tonconnect,"walletInfo"))&&H(e.tonconnect.walletInfo,["name","app_name","image","about_url","platforms"])}catch(e){return!1}}(t))).map((([e,t])=>({name:t.tonconnect.walletInfo.name,appName:t.tonconnect.walletInfo.app_name,aboutUrl:t.tonconnect.walletInfo.about_url,imageUrl:t.tonconnect.walletInfo.image,tondns:t.tonconnect.walletInfo.tondns,jsBridgeKey:e,injected:!0,embedded:t.tonconnect.isWalletBrowser,platforms:t.tonconnect.walletInfo.platforms}))):[]}static isWindowContainsWallet(e,t){return!!e&&t in e&&"object"==typeof e[t]&&"tonconnect"in e[t]}connect(e){this._connect(2,e)}restoreConnection(){return g(this,void 0,void 0,(function*(){try{F("Injected Provider restoring connection...");const e=yield this.injectedWallet.restoreConnection();F("Injected Provider restoring connection response",e),"connect"===e.event?(this.makeSubscriptions(),this.listeners.forEach((t=>t(e)))):yield this.connectionStorage.removeConnection()}catch(e){yield this.connectionStorage.removeConnection(),console.error(e)}}))}closeConnection(){this.listenSubscriptions&&this.injectedWallet.disconnect(),this.closeAllListeners()}disconnect(){return g(this,void 0,void 0,(function*(){return new Promise((e=>{const t=()=>{this.closeAllListeners(),this.connectionStorage.removeConnection().then(e)};try{this.injectedWallet.disconnect(),t()}catch(e){F(e),this.sendRequest({method:"disconnect",params:[]},t)}}))}))}closeAllListeners(){var e;this.listenSubscriptions=!1,this.listeners=[],null===(e=this.unsubscribeCallback)||void 0===e||e.call(this)}listen(e){return this.listeners.push(e),()=>this.listeners=this.listeners.filter((t=>t!==e))}sendRequest(e,t){return g(this,void 0,void 0,(function*(){const r=(yield this.connectionStorage.getNextRpcRequestId()).toString();yield this.connectionStorage.increaseNextRpcRequestId(),F("Send injected-bridge request:",Object.assign(Object.assign({},e),{id:r}));const n=this.injectedWallet.send(Object.assign(Object.assign({},e),{id:r}));return n.then((e=>F("Wallet message received:",e))),null==t||t(),n}))}_connect(e,t){return g(this,void 0,void 0,(function*(){try{F(`Injected Provider connect request: protocolVersion: ${e}, message:`,t);const r=yield this.injectedWallet.connect(e,t);F("Injected Provider connect response:",r),"connect"===r.event&&(yield this.updateSession(),this.makeSubscriptions()),this.listeners.forEach((e=>e(r)))}catch(e){F(e);const t={event:"connect_error",payload:{code:0,message:null==e?void 0:e.toString()}};this.listeners.forEach((e=>e(t)))}}))}makeSubscriptions(){this.listenSubscriptions=!0,this.unsubscribeCallback=this.injectedWallet.listen((e=>{F("Wallet message received:",e),this.listenSubscriptions&&this.listeners.forEach((t=>t(e))),"disconnect"===e.event&&this.disconnect()}))}updateSession(){return this.connectionStorage.storeConnection({type:"injected",jsBridgeKey:this.injectedWalletKey,nextRpcRequestId:0})}}Q.window=W();class J{constructor(){this.localStorage=function(){if(function(){try{return"undefined"!=typeof localStorage}catch(e){return!1}}())return localStorage;if("undefined"!=typeof process&&null!=process.versions&&null!=process.versions.node)throw new m("`localStorage` is unavailable, but it is required for TonConnect. For more details, see https://github.com/ton-connect/sdk/tree/main/packages/sdk#init-connector");return Z.getInstance()}()}getItem(e){return g(this,void 0,void 0,(function*(){return this.localStorage.getItem(e)}))}removeItem(e){return g(this,void 0,void 0,(function*(){this.localStorage.removeItem(e)}))}setItem(e,t){return g(this,void 0,void 0,(function*(){this.localStorage.setItem(e,t)}))}}function X(e){return function(e){return"jsBridgeKey"in e}(e)&&e.injected}function ee(e){return X(e)&&e.embedded}function te(e){return"bridgeUrl"in e}const re=[{app_name:"telegram-wallet",name:"Wallet",image:"https://wallet.tg/images/logo-288.png",about_url:"https://wallet.tg/",universal_url:"https://t.me/wallet?attach=wallet",bridge:[{type:"sse",url:"https://bridge.tonapi.io/bridge"}],platforms:["ios","android","macos","windows","linux"]},{app_name:"tonkeeper",name:"Tonkeeper",image:"https://tonkeeper.com/assets/tonconnect-icon.png",tondns:"tonkeeper.ton",about_url:"https://tonkeeper.com",universal_url:"https://app.tonkeeper.com/ton-connect",deepLink:"tonkeeper-tc://",bridge:[{type:"sse",url:"https://bridge.tonapi.io/bridge"},{type:"js",key:"tonkeeper"}],platforms:["ios","android","chrome","firefox","macos"]},{app_name:"openmask",name:"OpenMask",image:"https://raw.githubusercontent.com/OpenProduct/openmask-extension/main/public/openmask-logo-288.png",about_url:"https://www.openmask.app/",bridge:[{type:"js",key:"openmask"}],platforms:["chrome"]},{app_name:"mytonwallet",name:"MyTonWallet",image:"https://mytonwallet.io/icon-256.png",about_url:"https://mytonwallet.io",universal_url:"https://connect.mytonwallet.org",bridge:[{type:"js",key:"mytonwallet"},{type:"sse",url:"https://tonconnectbridge.mytonwallet.org/bridge/"}],platforms:["chrome","windows","macos","linux"]},{app_name:"tonhub",name:"Tonhub",image:"https://tonhub.com/tonconnect_logo.png",about_url:"https://tonhub.com",universal_url:"https://tonhub.com/ton-connect",bridge:[{type:"js",key:"tonhub"},{type:"sse",url:"https://connect.tonhubapi.com/tonconnect"}],platforms:["ios","android"]},{app_name:"tonflow",name:"TonFlow",image:"https://tonflow.net/assets/images/tonflow_ico_192.png",about_url:"https://tonflow.net",bridge:[{type:"js",key:"tonflow"}],platforms:["chrome"]},{app_name:"dewallet",name:"DeWallet",image:"https://app.delabwallet.com/logo_black.png",about_url:"https://delabwallet.com",bridge:[{type:"js",key:"dewallet"}],platforms:["chrome"]},{app_name:"xtonwallet",name:"XTONWallet",image:"https://xtonwallet.com/assets/img/icon-256-back.png",about_url:"https://xtonwallet.com",bridge:[{type:"js",key:"xtonwallet"}],platforms:["chrome","firefox"]},{app_name:"tonwallet",name:"TON Wallet",image:"https://wallet.ton.org/assets/ui/qr-logo.png",about_url:"https://chrome.google.com/webstore/detail/ton-wallet/nphplpgoakhhjchkkhmiggakijnkhfnd",bridge:[{type:"js",key:"tonwallet"}],platforms:["chrome"]}];class ne{constructor(e){this.walletsListCache=null,this.walletsListCacheCreationTimestamp=null,this.walletsListSource="https://raw.githubusercontent.com/ton-blockchain/wallets-list/main/wallets-v2.json",(null==e?void 0:e.walletsListSource)&&(this.walletsListSource=e.walletsListSource),(null==e?void 0:e.cacheTTLMs)&&(this.cacheTTLMs=e.cacheTTLMs)}getWallets(){return g(this,void 0,void 0,(function*(){return this.cacheTTLMs&&this.walletsListCacheCreationTimestamp&&Date.now()>this.walletsListCacheCreationTimestamp+this.cacheTTLMs&&(this.walletsListCache=null),this.walletsListCache||(this.walletsListCache=this.fetchWalletsList(),this.walletsListCache.then((()=>{this.walletsListCacheCreationTimestamp=Date.now()})).catch((()=>{this.walletsListCache=null,this.walletsListCacheCreationTimestamp=null}))),this.walletsListCache}))}getEmbeddedWallet(){return g(this,void 0,void 0,(function*(){const e=(yield this.getWallets()).filter(ee);return 1!==e.length?null:e[0]}))}fetchWalletsList(){return g(this,void 0,void 0,(function*(){let e=[];try{const t=yield fetch(this.walletsListSource);if(e=yield t.json(),!Array.isArray(e))throw new S("Wrong wallets list format, wallets list must be an array.");const r=e.filter((e=>!this.isCorrectWalletConfigDTO(e)));r.length&&(K(`Wallet(s) ${r.map((e=>e.name)).join(", ")} config format is wrong. They were removed from the wallets list.`),e=e.filter((e=>this.isCorrectWalletConfigDTO(e))))}catch(t){K(t),e=re}let t=[];try{t=Q.getCurrentlyInjectedWallets()}catch(e){K(e)}return this.mergeWalletsLists(this.walletConfigDTOListToWalletConfigList(e),t)}))}walletConfigDTOListToWalletConfigList(e){return e.map((e=>{const t={name:e.name,appName:e.app_name,imageUrl:e.image,aboutUrl:e.about_url,tondns:e.tondns,platforms:e.platforms};return e.bridge.forEach((r=>{if("sse"===r.type&&(t.bridgeUrl=r.url,t.universalLink=e.universal_url,t.deepLink=e.deepLink),"js"===r.type){const e=r.key;t.jsBridgeKey=e,t.injected=Q.isWalletInjected(e),t.embedded=Q.isInsideWalletBrowser(e)}})),t}))}mergeWalletsLists(e,t){return[...new Set(e.concat(t).map((e=>e.name))).values()].map((r=>{const n=e.find((e=>e.name===r)),i=t.find((e=>e.name===r));return Object.assign(Object.assign({},n&&Object.assign({},n)),i&&Object.assign({},i))}))}isCorrectWalletConfigDTO(e){if(!e||"object"!=typeof e)return!1;if(!("name"in e&&"image"in e&&"about_url"in e&&"platforms"in e&&"app_name"in e))return!1;if(!e.platforms||!Array.isArray(e.platforms)||!e.platforms.length)return!1;if(!("bridge"in e)||!Array.isArray(e.bridge)||!e.bridge.length)return!1;const t=e.bridge;if(t.some((e=>!e||"object"!=typeof e||!("type"in e))))return!1;const r=t.find((e=>"sse"===e.type));if(r&&(!("url"in r)||!r.url||!e.universal_url))return!1;const n=t.find((e=>"js"===e.type));return!!(!n||"key"in n&&n.key)}}class ie extends m{get info(){return"Wallet doesn't support requested feature method."}constructor(...e){super(...e),Object.setPrototypeOf(this,ie.prototype)}}class oe{constructor(e){if(this.walletsList=new ne,this._wallet=null,this.provider=null,this.statusChangeSubscriptions=[],this.statusChangeErrorSubscriptions=[],this.dappSettings={manifestUrl:(null==e?void 0:e.manifestUrl)||Y(),storage:(null==e?void 0:e.storage)||new J},this.walletsList=new ne({walletsListSource:null==e?void 0:e.walletsListSource,cacheTTLMs:null==e?void 0:e.walletsListCacheTTLMs}),!this.dappSettings.manifestUrl)throw new y("Dapp tonconnect-manifest.json must be specified if window.location.origin is undefined. See more https://github.com/ton-connect/docs/blob/main/requests-responses.md#app-manifest");this.bridgeConnectionStorage=new $(this.dappSettings.storage),(null==e?void 0:e.disableAutoPauseConnection)||this.addWindowFocusAndBlurSubscriptions()}static getWallets(){return this.walletsList.getWallets()}get connected(){return null!==this._wallet}get account(){var e;return(null===(e=this._wallet)||void 0===e?void 0:e.account)||null}get wallet(){return this._wallet}set wallet(e){this._wallet=e,this.statusChangeSubscriptions.forEach((e=>e(this._wallet)))}getWallets(){return this.walletsList.getWallets()}onStatusChange(e,t){return this.statusChangeSubscriptions.push(e),t&&this.statusChangeErrorSubscriptions.push(t),()=>{this.statusChangeSubscriptions=this.statusChangeSubscriptions.filter((t=>t!==e)),t&&(this.statusChangeErrorSubscriptions=this.statusChangeErrorSubscriptions.filter((e=>e!==t)))}}connect(e,t){var r;if(this.connected)throw new v;return null===(r=this.provider)||void 0===r||r.closeConnection(),this.provider=this.createProvider(e),this.provider.connect(this.createConnectRequest(t))}restoreConnection(){return g(this,void 0,void 0,(function*(){const[e,t]=yield Promise.all([this.bridgeConnectionStorage.storedConnectionType(),this.walletsList.getEmbeddedWallet()]);try{switch(e){case"http":this.provider=yield V.fromStorage(this.dappSettings.storage);break;case"injected":this.provider=yield Q.fromStorage(this.dappSettings.storage);break;default:if(!t)return;this.provider=yield this.createProvider(t)}}catch(e){return yield this.bridgeConnectionStorage.removeConnection(),void(this.provider=null)}return this.provider.listen(this.walletEventsListener.bind(this)),this.provider.restoreConnection()}))}sendTransaction(e,t){return g(this,void 0,void 0,(function*(){this.checkConnection(),function(e,t){const r=e.includes("SendTransaction"),n=e.find((e=>e&&"object"==typeof e&&"SendTransaction"===e.name));if(!r&&!n)throw new ie("Wallet doesn't support SendTransaction feature.");if(n&&void 0!==n.maxMessages){if(n.maxMessages{e.hidden?this.pauseConnection():this.unPauseConnection()}))}catch(e){console.error("Cannot subscribe to the document.visibilitychange: ",e)}}createProvider(e){let t;return t=!Array.isArray(e)&&"jsBridgeKey"in e?new Q(this.dappSettings.storage,e.jsBridgeKey):new V(this.dappSettings.storage,e),t.listen(this.walletEventsListener.bind(this)),t}walletEventsListener(e){switch(e.event){case"connect":this.onWalletConnected(e.payload);break;case"connect_error":this.onWalletConnectError(e.payload);break;case"disconnect":this.onWalletDisconnected()}}onWalletConnected(e){const t=e.items.find((e=>"ton_addr"===e.name)),r=e.items.find((e=>"ton_proof"===e.name));if(!t)throw new m("ton_addr connection item was not found");const n={device:e.device,provider:this.provider.type,account:{address:t.address,chain:t.network,walletStateInit:t.walletStateInit,publicKey:t.publicKey}};r&&(n.connectItems={tonProof:r}),this.wallet=n}onWalletConnectError(e){const t=M.parseError(e);if(this.statusChangeErrorSubscriptions.forEach((e=>e(t))),console.debug(t),t instanceof w||t instanceof b)throw console.error(t),t}onWalletDisconnected(){this.wallet=null}checkConnection(){if(!this.connected)throw new C}createConnectRequest(e){const t=[{name:"ton_addr"}];return(null==e?void 0:e.tonProof)&&t.push({name:"ton_proof",payload:e.tonProof}),{manifestUrl:this.dappSettings.manifestUrl,items:t}}}function se(e,t=!1){const{wc:r,hex:n}=function(e){if(!e.includes(":"))throw new B(`Wrong address ${e}. Address must include ":".`);const t=e.split(":");if(2!==t.length)throw new B(`Wrong address ${e}. Address must include ":" only once.`);const r=parseInt(t[0]);if(0!==r&&-1!==r)throw new B(`Wrong address ${e}. WC must be eq 0 or -1, but ${r} received.`);const n=t[1];if(64!==(null==n?void 0:n.length))throw new B(`Wrong address ${e}. Hex part must be 64bytes length, but ${null==n?void 0:n.length} received.`);return{wc:r,hex:le(n)}}(e);let i=81;t&&(i|=128);const o=new Int8Array(34);o[0]=i,o[1]=r,o.set(n,2);const s=new Uint8Array(36);return s.set(o),s.set(function(e){let t=0;const r=new Uint8Array(e.length+2);r.set(e);for(let e of r){let r=128;for(;r>0;)t<<=1,e&r&&(t+=1),r>>=1,t>65535&&(t&=65535,t^=4129)}return new Uint8Array([Math.floor(t/256),t%256])}(o),34),d(s).replace(/\+/g,"-").replace(/\//g,"_")}oe.walletsList=new ne,oe.isWalletInjected=e=>Q.isWalletInjected(e),oe.isInsideWalletBrowser=e=>Q.isInsideWalletBrowser(e);const ae={};for(let e=0;e<=255;e++){let t=e.toString(16);t.length<2&&(t="0"+t),ae[t]=e}function le(e){const t=(e=e.toLowerCase()).length;if(t%2!=0)throw new E("Hex string must have length a multiple of 2: "+e);const r=t/2,n=new Uint8Array(r);for(let t=0;tt in e?ve(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Be=(e,t)=>{for(var r in t||(t={}))xe.call(t,r)&&Se(e,r,t[r]);if(ke)for(var r of ke(t))Ae.call(t,r)&&Se(e,r,t[r]);return e},Ee=(e,t)=>Ce(e,_e(t)),Pe=(e,t,r)=>(Se(e,"symbol"!=typeof t?t+"":t,r),r),Ie=(e,t,r)=>new Promise(((n,i)=>{var o=e=>{try{a(r.next(e))}catch(e){i(e)}},s=e=>{try{a(r.throw(e))}catch(e){i(e)}},a=e=>e.done?n(e.value):Promise.resolve(e.value).then(o,s);a((r=r.apply(e,t)).next())}));const Me={},Ue=Symbol("solid-proxy"),Te=Symbol("solid-track"),Oe={equals:(e,t)=>e===t};let Re=ut;const je=1,Le=2,ze={owned:null,cleanups:null,context:null,owner:null},Ne={};var De=null;let $e=null,Fe=null,Ke=null,Ve=null,qe=0;function He(e,t){const r=Fe,n=De,i=0===e.length,o=i?ze:{owned:null,cleanups:null,context:null,owner:void 0===t?n:t},s=i?e:()=>e((()=>Xe((()=>gt(o)))));De=o,Fe=null;try{return dt(s,!0)}finally{Fe=r,De=n}}function Ze(e,t){const r={value:e,observers:null,observerSlots:null,comparator:(t=t?Object.assign({},Oe,t):Oe).equals||void 0};return[ot.bind(r),e=>("function"==typeof e&&(e=e(r.value)),st(r,e))]}function We(e,t,r){at(lt(e,t,!0,je))}function Ge(e,t,r){at(lt(e,t,!1,je))}function Ye(e,t,r){Re=ht;const n=lt(e,t,!1,je);n.user=!0,Ve?Ve.push(n):at(n)}function Qe(e,t,r){r=r?Object.assign({},Oe,r):Oe;const n=lt(e,t,!0,0);return n.observers=null,n.observerSlots=null,n.comparator=r.equals||void 0,at(n),ot.bind(n)}function Je(e){return dt(e,!1)}function Xe(e){if(null===Fe)return e();const t=Fe;Fe=null;try{return e()}finally{Fe=t}}function et(e){return null===De||(null===De.cleanups?De.cleanups=[e]:De.cleanups.push(e)),e}function tt(){return Fe}function rt(e,t){const r=Symbol("context");return{id:r,Provider:vt(r),defaultValue:e}}function nt(e){let t;return void 0!==(t=bt(De,e.id))?t:e.defaultValue}function it(e){const t=Qe(e),r=Qe((()=>wt(t())));return r.toArray=()=>{const e=r();return Array.isArray(e)?e:null!=e?[e]:[]},r}function ot(){const e=$e;if(this.sources&&(this.state||e))if(this.state===je||e)at(this);else{const e=Ke;Ke=null,dt((()=>ft(this)),!1),Ke=e}if(Fe){const e=this.observers?this.observers.length:0;Fe.sources?(Fe.sources.push(this),Fe.sourceSlots.push(e)):(Fe.sources=[this],Fe.sourceSlots=[e]),this.observers?(this.observers.push(Fe),this.observerSlots.push(Fe.sources.length-1)):(this.observers=[Fe],this.observerSlots=[Fe.sources.length-1])}return this.value}function st(e,t,r){let n=e.value;return e.comparator&&e.comparator(n,t)||(e.value=t,e.observers&&e.observers.length&&dt((()=>{for(let t=0;t1e6)throw Ke=[],new Error}),!1)),t}function at(e){if(!e.fn)return;gt(e);const t=De,r=Fe,n=qe;Fe=De=e,function(e,t,r){let n;try{n=e.fn(t)}catch(t){e.pure&&(e.state=je,e.owned&&e.owned.forEach(gt),e.owned=null),yt(t)}(!e.updatedAt||e.updatedAt<=r)&&(null!=e.updatedAt&&"observers"in e?st(e,n):e.value=n,e.updatedAt=r)}(e,e.value,n),Fe=r,De=t}function lt(e,t,r,n=je,i){const o={fn:e,state:n,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:De,context:null,pure:r};return null===De||De!==ze&&(De.owned?De.owned.push(o):De.owned=[o]),o}function ct(e){const t=$e;if(0===e.state||t)return;if(e.state===Le||t)return ft(e);if(e.suspense&&Xe(e.suspense.inFallback))return e.suspense.effects.push(e);const r=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt=0;n--)if((e=r[n]).state===je||t)at(e);else if(e.state===Le||t){const t=Ke;Ke=null,dt((()=>ft(e,r[0])),!1),Ke=t}}function dt(e,t){if(Ke)return e();let r=!1;t||(Ke=[]),Ve?r=!0:Ve=[],qe++;try{const t=e();return function(e){if(Ke&&(ut(Ke),Ke=null),e)return;const t=Ve;Ve=null,t.length&&dt((()=>Re(t)),!1)}(r),t}catch(e){r||(Ve=null),Ke=null,yt(e)}}function ut(e){for(let t=0;tr=Xe((()=>(De.context={[e]:t.value},it((()=>t.children)))))),void 0),r}}const Ct=Symbol("fallback");function _t(e){for(let t=0;te(t||{})))}function xt(){return!0}const At={get:(e,t,r)=>t===Ue?r:e.get(t),has:(e,t)=>t===Ue||e.has(t),set:xt,deleteProperty:xt,getOwnPropertyDescriptor:(e,t)=>({configurable:!0,enumerable:!0,get:()=>e.get(t),set:xt,deleteProperty:xt}),ownKeys:e=>e.keys()};function St(e){return(e="function"==typeof e?e():e)?e:{}}function Bt(...e){let t=!1;for(let r=0;r=0;r--){const n=St(e[r])[t];if(void 0!==n)return n}},has(t){for(let r=e.length-1;r>=0;r--)if(t in St(e[r]))return!0;return!1},keys(){const t=[];for(let r=0;r=0;t--)if(e[t]){const n=Object.getOwnPropertyDescriptors(e[t]);for(const t in n)t in r||Object.defineProperty(r,t,{enumerable:!0,get(){for(let r=e.length-1;r>=0;r--){const n=(e[r]||{})[t];if(void 0!==n)return n}}})}return r}function Et(e,...t){const r=new Set(t.flat());if(Ue in e){const n=t.map((t=>new Proxy({get:r=>t.includes(r)?e[r]:void 0,has:r=>t.includes(r)&&r in e,keys:()=>t.filter((t=>t in e))},At)));return n.push(new Proxy({get:t=>r.has(t)?void 0:e[t],has:t=>!r.has(t)&&t in e,keys:()=>Object.keys(e).filter((e=>!r.has(e)))},At)),n}const n=Object.getOwnPropertyDescriptors(e);return t.push(Object.keys(n).filter((e=>!r.has(e)))),t.map((t=>{const r={};for(let i=0;ie[o],set:()=>!0,enumerable:!0})}return r}))}function Pt(e){const t="fallback"in e&&{fallback:()=>e.fallback};return Qe(function(e,t,r={}){let n=[],i=[],o=[],s=0,a=t.length>1?[]:null;return et((()=>_t(o))),()=>{let l,c,d=e()||[];return d[Te],Xe((()=>{let e,t,h,f,p,g,m,y,b,w=d.length;if(0===w)0!==s&&(_t(o),o=[],n=[],i=[],s=0,a&&(a=[])),r.fallback&&(n=[Ct],i[0]=He((e=>(o[0]=e,r.fallback()))),s=1);else if(0===s){for(i=new Array(w),c=0;c=g&&y>=g&&n[m]===d[y];m--,y--)h[y]=i[m],f[y]=o[m],a&&(p[y]=a[m]);for(e=new Map,t=new Array(y+1),c=y;c>=g;c--)b=d[c],l=e.get(b),t[c]=void 0===l?-1:l,e.set(b,c);for(l=g;l<=m;l++)b=n[l],c=e.get(b),void 0!==c&&-1!==c?(h[c]=i[l],f[c]=o[l],a&&(p[c]=a[l]),c=t[c],e.set(b,c)):o[l]();for(c=g;ce.each),e.children,t||void 0))}function It(e){let t=!1;const r=e.keyed,n=Qe((()=>e.when),void 0,{equals:(e,r)=>t?e===r:!e==!r});return Qe((()=>{const i=n();if(i){const n=e.children,o="function"==typeof n&&n.length>0;return t=r||o,o?Xe((()=>n(i))):n}return e.fallback}),void 0,void 0)}function Mt(e){let t=!1,r=!1;const n=it((()=>e.children)),i=Qe((()=>{let e=n();Array.isArray(e)||(e=[e]);for(let t=0;te[0]===r[0]&&(t?e[1]===r[1]:!e[1]==!r[1])&&e[2]===r[2]});return Qe((()=>{const[n,o,s]=i();if(n<0)return e.fallback;const a=s.children,l="function"==typeof a&&a.length>0;return t=r||l,l?Xe((()=>a(o))):a}),void 0,void 0)}function Ut(e){return e}const Tt=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline","allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected"]),Ot=new Set(["innerHTML","textContent","innerText","children"]),Rt=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),jt=Object.assign(Object.create(null),{class:"className",formnovalidate:"formNoValidate",ismap:"isMap",nomodule:"noModule",playsinline:"playsInline",readonly:"readOnly"}),Lt=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),zt=new Set(["altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","svg","switch","symbol","text","textPath","tref","tspan","use","view","vkern"]),Nt={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"},Dt="_$DX_DELEGATE";function $t(e,t,r){if("undefined"==typeof window)return null;const n=document.createElement("template");n.innerHTML=e;let i=n.content.firstChild;return r&&(i=i.firstChild),i}function Ft(e,t,r){null==r?e.removeAttribute(t):e.setAttribute(t,r)}function Kt(e,t){null==t?e.removeAttribute("class"):e.className=t}function Vt(e,t={},r,n){const i={};return n||Ge((()=>i.children=Yt(e,t.children,i.children))),Ge((()=>t.ref&&t.ref(e))),Ge((()=>function(e,t,r,n,i={},o=!1){t||(t={});for(const n in i)if(!(n in t)){if("children"===n)continue;i[n]=Wt(e,n,null,i[n],r,o)}for(const s in t){if("children"===s){n||Yt(e,t.children);continue}const a=t[s];i[s]=Wt(e,s,a,i[s],r,o)}}(e,t,r,!0,i,!0))),i}function qt(e,t,r){return Xe((()=>e(t,r)))}function Ht(e,t,r,n){if(void 0===r||n||(n=[]),"function"!=typeof t)return Yt(e,t,n,r);Ge((n=>Yt(e,t(),n,r)),n)}function Zt(e,t,r){const n=t.trim().split(/\s+/);for(let t=0,i=n.length;tn.call(e,r[1],t))}else e.addEventListener(t,r)}(e,i,r,o),o&&function(e,t=window.document){const r=t[Dt]||(t[Dt]=new Set);for(let n=0,i=e.length;nt.toUpperCase())))]=r;else{const n=i&&t.indexOf(":")>-1&&Nt[t.split(":")[0]];n?function(e,t,r,n){null==n?e.removeAttributeNS(t,r):e.setAttributeNS(t,r,n)}(e,n,t,r):Ft(e,Rt[t]||t,r)}var c;return r}function Gt(e){const t=`$$${e.type}`;let r=e.composedPath&&e.composedPath()[0]||e.target;for(e.target!==r&&Object.defineProperty(e,"target",{configurable:!0,value:r}),Object.defineProperty(e,"currentTarget",{configurable:!0,get:()=>r||document}),Me.registry&&!Me.done&&(Me.done=!0,document.querySelectorAll("[id^=pl-]").forEach((t=>{for(;t&&8!==t.nodeType&&t.nodeValue!=="pl-"+e;){let e=t.nextSibling;t.remove(),t=e}t&&t.remove()})));r;){const n=r[t];if(n&&!r.disabled){const i=r[`${t}Data`];if(void 0!==i?n.call(r,i,e):n.call(r,e),e.cancelBubble)return}r=r._$host||r.parentNode||r.host}}function Yt(e,t,r,n,i){for(Me.context&&!r&&(r=[...e.childNodes]);"function"==typeof r;)r=r();if(t===r)return r;const o=typeof t,s=void 0!==n;if(e=s&&r[0]&&r[0].parentNode||e,"string"===o||"number"===o){if(Me.context)return r;if("number"===o&&(t=t.toString()),s){let i=r[0];i&&3===i.nodeType?i.data=t:i=document.createTextNode(t),r=Xt(e,r,n,i)}else r=""!==r&&"string"==typeof r?e.firstChild.data=t:e.textContent=t}else if(null==t||"boolean"===o){if(Me.context)return r;r=Xt(e,r,n)}else{if("function"===o)return Ge((()=>{let i=t();for(;"function"==typeof i;)i=i();r=Yt(e,i,r,n)})),()=>r;if(Array.isArray(t)){const o=[],a=r&&Array.isArray(r);if(Qt(o,t,r,i))return Ge((()=>r=Yt(e,o,r,n,!0))),()=>r;if(Me.context){if(!o.length)return r;for(let e=0;en-a){const i=t[s];for(;a=0;o--){const s=t[o];if(i!==s){const t=s.parentNode===e;n||o?t&&s.remove():t?e.replaceChild(i,s):e.insertBefore(i,r)}else n=!0}}else e.insertBefore(i,r);return[i]}const er="http://www.w3.org/2000/svg";function tr(e,t=!1){return t?document.createElementNS(er,e):document.createElement(e)}function rr(e){const{useShadow:t}=e,r=document.createTextNode(""),n=e.mount||document.body;function i(){if(Me.context){const[t,r]=Ze(!1);return queueMicrotask((()=>r(!0))),()=>t()&&e.children}return()=>e.children}if(n instanceof HTMLHeadElement){const[e,t]=Ze(!1),r=()=>t(!0);He((t=>Ht(n,(()=>e()?t():i()()),null))),et((()=>{Me.context?queueMicrotask(r):r()}))}else{const o=tr(e.isSVG?"g":"div",e.isSVG),s=t&&o.attachShadow?o.attachShadow({mode:"open"}):o;Object.defineProperty(o,"_$host",{get:()=>r.parentNode,configurable:!0}),Ht(s,i()),n.appendChild(o),e.ref&&e.ref(o),et((()=>n.removeChild(o)))}return r}function nr(e){const[t,r]=Et(e,["component"]),n=Qe((()=>t.component));return Qe((()=>{const e=n();switch(typeof e){case"function":return Xe((()=>e(r)));case"string":const t=zt.has(e),n=Me.context?function(e){let t,r;return Me.context&&(t=Me.registry.get(r=function(){const e=Me.context;return`${e.id}${e.count++}`}()))?(Me.completed&&Me.completed.add(t),Me.registry.delete(r),t):e.cloneNode(!0)}():tr(e,t);return Vt(n,r,t),n}}))}var ir=(e=>(e.DARK="DARK",e.LIGHT="LIGHT",e))(ir||{});let or={data:""},sr=e=>"object"==typeof window?((e?e.querySelector("#_goober"):window._goober)||Object.assign((e||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:e||or,ar=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,lr=/\/\*[^]*?\*\/| +/g,cr=/\n+/g,dr=(e,t)=>{let r="",n="",i="";for(let o in e){let s=e[o];"@"==o[0]?"i"==o[1]?r=o+" "+s+";":n+="f"==o[1]?dr(s,o):o+"{"+dr(s,"k"==o[1]?"":t)+"}":"object"==typeof s?n+=dr(s,t?t.replace(/([^,])+/g,(e=>o.replace(/(^:.*)|([^,])+/g,(t=>/&/.test(t)?t.replace(/&/g,e):e?e+" "+t:t)))):o):null!=s&&(o=/^--/.test(o)?o:o.replace(/[A-Z]/g,"-$&").toLowerCase(),i+=dr.p?dr.p(o,s):o+":"+s+";")}return r+(t&&i?t+"{"+i+"}":i)+n},ur={},hr=e=>{if("object"==typeof e){let t="";for(let r in e)t+=r+hr(e[r]);return t}return e},fr=(e,t,r,n,i)=>{let o=hr(e),s=ur[o]||(ur[o]=(e=>{let t=0,r=11;for(;t>>0;return"go"+r})(o));if(!ur[s]){let t=o!==e?e:(e=>{let t,r,n=[{}];for(;t=ar.exec(e.replace(lr,""));)t[4]?n.shift():t[3]?(r=t[3].replace(cr," ").trim(),n.unshift(n[0][r]=n[0][r]||{})):n[0][t[1]]=t[2].replace(cr," ").trim();return n[0]})(e);ur[s]=dr(i?{["@keyframes "+s]:t}:t,r?"":"."+s)}let a=r&&ur.g?ur.g:null;return r&&(ur.g=ur[s]),l=ur[s],c=t,d=n,(u=a)?c.data=c.data.replace(u,l):-1===c.data.indexOf(l)&&(c.data=d?l+c.data:c.data+l),s;var l,c,d,u},pr=(e,t,r)=>e.reduce(((e,n,i)=>{let o=t[i];if(o&&o.call){let e=o(r),t=e&&e.props&&e.props.className||/^go/.test(e)&&e;o=t?"."+t:e&&"object"==typeof e?e.props?"":dr(e,""):!1===e?"":e}return e+n+(null==o?"":o)}),"");function gr(e){let t=this||{},r=e.call?e(t.p):e;return fr(r.unshift?r.raw?pr(r,[].slice.call(arguments,1),t.p):r.reduce(((e,r)=>Object.assign(e,r&&r.call?r(t.p):r)),{}):r,sr(t.target),t.g,t.o,t.k)}gr.bind({g:1});let mr=gr.bind({k:1});const yr=rt();function br(e){return kt(yr.Provider,{value:e.theme,get children(){return e.children}})}function wr(){return nt(yr)}function vr(e){let t=this||{};return(...r)=>{const n=n=>{const i=Bt(n,{theme:nt(yr)}),o=Bt(i,{get class(){const e=i.class,n="class"in i&&/^go[0-9]+/.test(e);return[e,gr.apply({target:t.target,o:n,p:i,g:t.g},r)].filter(Boolean).join(" ")}}),[s,a]=Et(o,["as","theme"]),l=a,c=s.as||e;let d;return"function"==typeof c?d=c(l):1==t.g?(d=document.createElement(c),Vt(d,l)):d=nr(Bt({component:c},l)),d};return n.class=e=>Xe((()=>gr.apply({target:t.target,p:e,g:t.g},r))),n}}const Cr=new Proxy(vr,{get:(e,t)=>e(t)});function _r(){const e=vr.call({g:1},"div").apply(null,arguments);return function(t){return e(t),null}}const kr="tc-root",xr="tc-disable-scroll",Ar="tc-using-mouse",Sr=()=>(document.body.addEventListener("mousedown",(()=>document.body.classList.add(Ar))),document.body.addEventListener("keydown",(e=>{"Tab"===e.key&&document.body.classList.remove(Ar)})),kt(_r` +(()=>{var e={4061:function(e,t,r){"use strict";var n,i=r(8287).hp,o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ADNLAddress=void 0;const s=o(r(9107)),a=r(3721),l=r(2960);class c{static parseFriendly(e){if(55!==e.length)throw Error("Invalid address");e="f"+e;let t=(0,a.base32Decode)(e);if(45!==t[0])throw Error("Invalid address");let r=t.slice(33);if(!(0,l.crc16)(t.slice(0,33)).equals(r))throw Error("Invalid address");return new c(t.slice(1,33))}static parseRaw(e){const t=i.from(e,"base64");return new c(t)}constructor(e){if(this.toRaw=()=>this.address.toString("hex").toUpperCase(),this.toString=()=>{let e=i.concat([i.from([45]),this.address]),t=(0,l.crc16)(e);return e=i.concat([e,t]),(0,a.base32Encode)(e).slice(1)},this[n]=()=>this.toString(),32!==e.length)throw Error("Invalid address");this.address=e}equals(e){return this.address.equals(e.address)}}t.ADNLAddress=c,n=s.default},3512:function(e,t,r){"use strict";var n,i=r(8287).hp,o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.address=t.Address=void 0;const s=o(r(9107)),a=r(2960);function l(e){if("string"==typeof e&&!c.isFriendly(e))throw new Error("Unknown address type");const t=i.isBuffer(e)?e:i.from(e,"base64");if(36!==t.length)throw new Error("Unknown address type: byte length is not equal to 36");const r=t.subarray(0,34),n=t.subarray(34,36),o=(0,a.crc16)(r);if(o[0]!==n[0]||o[1]!==n[1])throw new Error("Invalid checksum: "+e);let s=r[0],l=!1,d=!1;if(128&s&&(l=!0,s^=128),17!==s&&81!==s)throw"Unknown address tag";d=17===s;let u=null;return u=255===r[1]?-1:r[1],{isTestOnly:l,isBounceable:d,workchain:u,hashPart:r.subarray(2,34)}}class c{static isAddress(e){return e instanceof c}static isFriendly(e){return 48===e.length&&!!/[A-Za-z0-9+/_-]+/.test(e)}static isRaw(e){if(-1===e.indexOf(":"))return!1;let[t,r]=e.split(":");return!!Number.isInteger(parseFloat(t))&&!!/[a-f0-9]+/.test(r.toLowerCase())&&64===r.length}static normalize(e){return"string"==typeof e?c.parse(e).toString():e.toString()}static parse(e){if(c.isFriendly(e))return this.parseFriendly(e).address;if(c.isRaw(e))return this.parseRaw(e);throw new Error("Unknown address type: "+e)}static parseRaw(e){let t=parseInt(e.split(":")[0]),r=i.from(e.split(":")[1],"hex");return new c(t,r)}static parseFriendly(e){if(i.isBuffer(e)){let t=l(e);return{isBounceable:t.isBounceable,isTestOnly:t.isTestOnly,address:new c(t.workchain,t.hashPart)}}{let t=l(e.replace(/\-/g,"+").replace(/_/g,"/"));return{isBounceable:t.isBounceable,isTestOnly:t.isTestOnly,address:new c(t.workchain,t.hashPart)}}}constructor(e,t){if(this.toRawString=()=>this.workChain+":"+this.hash.toString("hex"),this.toRaw=()=>{const e=i.alloc(36);return e.set(this.hash),e.set([this.workChain,this.workChain,this.workChain,this.workChain],32),e},this.toStringBuffer=e=>{let t=!(!e||void 0===e.testOnly)&&e.testOnly,r=!e||void 0===e.bounceable||e.bounceable?17:81;t&&(r|=128);const n=i.alloc(34);n[0]=r,n[1]=this.workChain,n.set(this.hash,2);const o=i.alloc(36);return o.set(n),o.set((0,a.crc16)(n),34),o},this.toString=e=>{let t=!e||void 0===e.urlSafe||e.urlSafe,r=this.toStringBuffer(e);return t?r.toString("base64").replace(/\+/g,"-").replace(/\//g,"_"):r.toString("base64")},this[n]=()=>this.toString(),32!==t.length)throw new Error("Invalid address hash length: "+t.length);this.workChain=e,this.hash=t,Object.freeze(this)}equals(e){return e.workChain===this.workChain&&e.hash.equals(this.hash)}}t.Address=c,n=s.default,t.address=function(e){return c.parse(e)}},1629:function(e,t,r){"use strict";var n,i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ExternalAddress=void 0;const o=i(r(9107));class s{static isAddress(e){return e instanceof s}constructor(e,t){this[n]=()=>this.toString(),this.value=e,this.bits=t}toString(){return`External<${this.bits}:${this.value}>`}}t.ExternalAddress=s,n=o.default},8986:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.contractAddress=void 0;const n=r(5871),i=r(2738),o=r(3512);t.contractAddress=function(e,t){let r=(0,n.beginCell)().store((0,i.storeStateInit)(t)).endCell().hash();return new o.Address(e,r)}},9924:(e,t,r)=>{"use strict";var n=r(8287).hp;Object.defineProperty(t,"__esModule",{value:!0}),t.BitBuilder=void 0;const i=r(3512),o=r(1629),s=r(2386);t.BitBuilder=class{constructor(e=1023){this._buffer=n.alloc(Math.ceil(e/8)),this._length=0}get length(){return this._length}writeBit(e){let t=this._length;if(t>8*this._buffer.length)throw new Error("BitBuilder overflow");("boolean"==typeof e&&!0===e||"number"==typeof e&&e>0)&&(this._buffer[t/8|0]|=1<<7-t%8),this._length++}writeBits(e){for(let t=0;t8*this._buffer.length)throw new Error("BitBuilder overflow");e.copy(this._buffer,this._length/8),this._length+=8*e.length}else for(let t=0;t=n)throw Error(`bitLength is too small for a value ${e}. Got ${t}`);if(this._length+t>8*this._buffer.length)throw new Error("BitBuilder overflow");const i=8-this._length%8;if(i>0){const e=Math.floor(this._length/8);if(t>BigInt(t-i));this._buffer[e]|=n,this._length+=i}}for(t-=i;t>0;)t>=8?(this._buffer[this._length/8]=Number(r>>BigInt(t-8)&0xffn),this._length+=8,t-=8):(this._buffer[this._length/8]=Number(r<=n)throw Error(`value is out of range for ${t} bits. Got ${e}`);r<0?(this.writeBit(!0),r=n+r):this.writeBit(!1),this.writeUint(r,t-1)}writeVarUint(e,t){let r=BigInt(e);if(t<0||!Number.isSafeInteger(t))throw Error(`invalid bit length. Got ${t}`);if(r<0)throw Error(`value is negative. Got ${e}`);if(0n===r)return void this.writeUint(0,t);const n=Math.ceil(r.toString(2).length/8),i=8*n;this.writeUint(n,t),this.writeUint(r,i)}writeVarInt(e,t){let r=BigInt(e);if(t<0||!Number.isSafeInteger(t))throw Error(`invalid bit length. Got ${t}`);if(0n===r)return void this.writeUint(0,t);let n=r>0?r:-r;const i=1+Math.ceil(n.toString(2).length/8),o=8*i;this.writeUint(i,t),this.writeInt(r,o)}writeCoins(e){this.writeVarUint(e,4)}writeAddress(e){if(null!=e){if(i.Address.isAddress(e))return this.writeUint(2,2),this.writeUint(0,1),this.writeInt(e.workChain,8),void this.writeBuffer(e.hash);if(o.ExternalAddress.isAddress(e))return this.writeUint(1,2),this.writeUint(e.bits,9),void this.writeUint(e.value,e.bits);throw Error(`Invalid address. Got ${e}`)}this.writeUint(0,2)}build(){return new s.BitString(this._buffer,0,this._length)}buffer(){if(this._length%8!=0)throw new Error("BitBuilder buffer is not byte aligned");return this._buffer.subarray(0,this._length/8)}}},3528:(e,t,r)=>{"use strict";var n=r(8287).hp;Object.defineProperty(t,"__esModule",{value:!0}),t.BitReader=void 0;const i=r(3512),o=r(1629);class s{constructor(e,t=0){this._checkpoints=[],this._bits=e,this._offset=t}get offset(){return this._offset}get remaining(){return this._bits.length-this._offset}skip(e){if(e<0||this._offset+e>this._bits.length)throw new Error(`Index ${this._offset+e} is out of bounds`);this._offset+=e}reset(){this._checkpoints.length>0?this._offset=this._checkpoints.pop():this._offset=0}save(){this._checkpoints.push(this._offset)}loadBit(){let e=this._bits.at(this._offset);return this._offset++,e}preloadBit(){return this._bits.at(this._offset)}loadBits(e){let t=this._bits.substring(this._offset,e);return this._offset+=e,t}preloadBits(e){return this._bits.substring(this._offset,e)}loadBuffer(e){let t=this._preloadBuffer(e,this._offset);return this._offset+=8*e,t}preloadBuffer(e){return this._preloadBuffer(e,this._offset)}loadUint(e){return Number(this.loadUintBig(e))}loadUintBig(e){let t=this.preloadUintBig(e);return this._offset+=e,t}preloadUint(e){return Number(this._preloadUint(e,this._offset))}preloadUintBig(e){return this._preloadUint(e,this._offset)}loadInt(e){let t=this._preloadInt(e,this._offset);return this._offset+=e,Number(t)}loadIntBig(e){let t=this._preloadInt(e,this._offset);return this._offset+=e,t}preloadInt(e){return Number(this._preloadInt(e,this._offset))}preloadIntBig(e){return this._preloadInt(e,this._offset)}loadVarUint(e){let t=Number(this.loadUint(e));return Number(this.loadUintBig(8*t))}loadVarUintBig(e){let t=Number(this.loadUint(e));return this.loadUintBig(8*t)}preloadVarUint(e){let t=Number(this._preloadUint(e,this._offset));return Number(this._preloadUint(8*t,this._offset+e))}preloadVarUintBig(e){let t=Number(this._preloadUint(e,this._offset));return this._preloadUint(8*t,this._offset+e)}loadVarInt(e){let t=Number(this.loadUint(e));return Number(this.loadIntBig(8*t))}loadVarIntBig(e){let t=Number(this.loadUint(e));return this.loadIntBig(8*t)}preloadVarInt(e){let t=Number(this._preloadUint(e,this._offset));return Number(this._preloadInt(8*t,this._offset+e))}preloadVarIntBig(e){let t=Number(this._preloadUint(e,this._offset));return this._preloadInt(8*t,this._offset+e)}loadCoins(){return this.loadVarUintBig(4)}preloadCoins(){return this.preloadVarUintBig(4)}loadAddress(){let e=Number(this._preloadUint(2,this._offset));if(2===e)return this._loadInternalAddress();throw new Error("Invalid address: "+e)}loadMaybeAddress(){let e=Number(this._preloadUint(2,this._offset));if(0===e)return this._offset+=2,null;if(2===e)return this._loadInternalAddress();throw new Error("Invalid address")}loadExternalAddress(){if(1===Number(this._preloadUint(2,this._offset)))return this._loadExternalAddress();throw new Error("Invalid address")}loadMaybeExternalAddress(){let e=Number(this._preloadUint(2,this._offset));if(0===e)return this._offset+=2,null;if(1===e)return this._loadExternalAddress();throw new Error("Invalid address")}loadAddressAny(){let e=Number(this._preloadUint(2,this._offset));if(0===e)return this._offset+=2,null;if(2===e)return this._loadInternalAddress();if(1===e)return this._loadExternalAddress();throw 3===e?Error("Unsupported"):Error("Unreachable")}loadPaddedBits(e){if(e%8!=0)throw new Error("Invalid number of bits");let t=e;for(;;){if(this._bits.at(this._offset+t-1)){t--;break}t--}let r=this._bits.substring(this._offset,t);return this._offset+=e,r}clone(){return new s(this._bits,this._offset)}_preloadInt(e,t){if(0==e)return 0n;let r=this._bits.at(t),n=0n;for(let r=0;rthis.toString(),r<0)throw new Error(`Length ${r} is out of bounds`);this._length=r,this._data=e,this._offset=t}get length(){return this._length}at(e){if(e>=this._length)throw new Error(`Index ${e} > ${this._length} is out of bounds`);if(e<0)throw new Error(`Index ${e} < 0 is out of bounds`);let t=this._offset+e>>3,r=7-(this._offset+e)%8;return!!(this._data[t]&1<this._length)throw new Error(`Offset(${e}) > ${this._length} is out of bounds`);if(e<0)throw new Error(`Offset(${e}) < 0 is out of bounds`);if(0===t)return l.EMPTY;if(e+t>this._length)throw new Error(`Offset ${e} + Length ${t} > ${this._length} is out of bounds`);return new l(this._data,this._offset+e,t)}subbuffer(e,t){if(e>this._length)throw new Error(`Offset ${e} is out of bounds`);if(e<0)throw new Error(`Offset ${e} is out of bounds`);if(e+t>this._length)throw new Error(`Offset + Lenght = ${e+t} is out of bounds`);if(t%8!=0)return null;if((this._offset+e)%8!=0)return null;let r=this._offset+e>>3,n=r+(t>>3);return this._data.subarray(r,n)}equals(e){if(this._length!==e._length)return!1;for(let t=0;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Builder=t.beginCell=void 0;const n=r(9924),i=r(6902),o=r(9556);function s(){return new a}t.beginCell=s;class a{constructor(){this._bits=new n.BitBuilder,this._refs=[]}get bits(){return this._bits.length}get refs(){return this._refs.length}get availableBits(){return 1023-this.bits}get availableRefs(){return 4-this.refs}storeBit(e){return this._bits.writeBit(e),this}storeBits(e){return this._bits.writeBits(e),this}storeBuffer(e,t){if(null!=t&&e.length!==t)throw Error(`Buffer length ${e.length} is not equal to ${t}`);return this._bits.writeBuffer(e),this}storeMaybeBuffer(e,t){return null!==e?(this.storeBit(1),this.storeBuffer(e,t)):this.storeBit(0),this}storeUint(e,t){return this._bits.writeUint(e,t),this}storeMaybeUint(e,t){return null!=e?(this.storeBit(1),this.storeUint(e,t)):this.storeBit(0),this}storeInt(e,t){return this._bits.writeInt(e,t),this}storeMaybeInt(e,t){return null!=e?(this.storeBit(1),this.storeInt(e,t)):this.storeBit(0),this}storeVarUint(e,t){return this._bits.writeVarUint(e,t),this}storeMaybeVarUint(e,t){return null!=e?(this.storeBit(1),this.storeVarUint(e,t)):this.storeBit(0),this}storeVarInt(e,t){return this._bits.writeVarInt(e,t),this}storeMaybeVarInt(e,t){return null!=e?(this.storeBit(1),this.storeVarInt(e,t)):this.storeBit(0),this}storeCoins(e){return this._bits.writeCoins(e),this}storeMaybeCoins(e){return null!=e?(this.storeBit(1),this.storeCoins(e)):this.storeBit(0),this}storeAddress(e){return this._bits.writeAddress(e),this}storeRef(e){if(this._refs.length>=4)throw new Error("Too many references");if(e instanceof i.Cell)this._refs.push(e);else{if(!(e instanceof a))throw new Error("Invalid argument");this._refs.push(e.endCell())}return this}storeMaybeRef(e){return e?(this.storeBit(1),this.storeRef(e)):this.storeBit(0),this}storeSlice(e){let t=e.clone();for(t.remainingBits>0&&this.storeBits(t.loadBits(t.remainingBits));t.remainingRefs>0;)this.storeRef(t.loadRef());return this}storeMaybeSlice(e){return e?(this.storeBit(1),this.storeSlice(e)):this.storeBit(0),this}storeBuilder(e){return this.storeSlice(e.endCell().beginParse())}storeMaybeBuilder(e){return e?(this.storeBit(1),this.storeBuilder(e)):this.storeBit(0),this}storeWritable(e){return"object"==typeof e?e.writeTo(this):e(this),this}storeMaybeWritable(e){return e?(this.storeBit(1),this.storeWritable(e)):this.storeBit(0),this}store(e){return this.storeWritable(e),this}storeStringTail(e){return(0,o.writeString)(e,this),this}storeMaybeStringTail(e){return null!=e?(this.storeBit(1),(0,o.writeString)(e,this)):this.storeBit(0),this}storeStringRefTail(e){return this.storeRef(s().storeStringTail(e)),this}storeMaybeStringRefTail(e){return null!=e?(this.storeBit(1),this.storeStringRefTail(e)):this.storeBit(0),this}storeDict(e,t,r){return e?e.store(this,t,r):this.storeBit(0),this}storeDictDirect(e,t,r){return e.storeDirect(this,t,r),this}endCell(e){return new i.Cell({bits:this._bits.build(),refs:this._refs,exotic:e?.exotic})}asCell(){return this.endCell()}asSlice(){return this.endCell().beginParse()}}t.Builder=a},6902:function(e,t,r){"use strict";var n,i=r(8287).hp,o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Cell=void 0;const s=o(r(9107)),a=r(2386),l=r(4654),c=r(6906),d=r(2231),u=r(2938),h=r(5229),f=r(3528),p=r(5871);class g{static fromBoc(e){return(0,h.deserializeBoc)(e)}static fromBase64(e){let t=g.fromBoc(i.from(e,"base64"));if(1!==t.length)throw new Error("Deserialized more than one cell");return t[0]}constructor(e){this._hashes=[],this._depths=[],this.beginParse=(e=!1)=>{if(this.isExotic&&!e)throw new Error("Exotic cells cannot be parsed");return new c.Slice(new f.BitReader(this.bits),this.refs)},this.hash=(e=3)=>this._hashes[Math.min(this._hashes.length-1,e)],this.depth=(e=3)=>this._depths[Math.min(this._depths.length-1,e)],this.level=()=>this.mask.level,this.equals=e=>this.hash().equals(e.hash()),this[n]=()=>this.toString();let t=a.BitString.EMPTY;e&&e.bits&&(t=e.bits);let r,i,o,s=[];e&&e.refs&&(s=[...e.refs]);let h=l.CellType.Ordinary;if(e&&e.exotic){let e=(0,d.resolveExotic)(t,s),n=(0,u.wonderCalculator)(e.type,t,s);o=n.mask,i=n.depths,r=n.hashes,h=e.type}else{if(s.length>4)throw new Error("Invalid number of references");if(t.length>1023)throw new Error(`Bits overflow: ${t.length} > 1023`);let e=(0,u.wonderCalculator)(l.CellType.Ordinary,t,s);o=e.mask,i=e.depths,r=e.hashes,h=l.CellType.Ordinary}this.type=h,this.bits=t,this.refs=s,this.mask=o,this._depths=i,this._hashes=r,Object.freeze(this),Object.freeze(this.refs),Object.freeze(this.bits),Object.freeze(this.mask),Object.freeze(this._depths),Object.freeze(this._hashes)}get isExotic(){return this.type!==l.CellType.Ordinary}toBoc(e){let t=!(!e||null===e.idx||void 0===e.idx)&&e.idx,r=!e||null===e.crc32||void 0===e.crc32||e.crc32;return(0,h.serializeBoc)(this,{idx:t,crc32:r})}toString(e){let t=e||"",r="x";this.isExotic&&(this.type===l.CellType.MerkleProof?r="p":this.type===l.CellType.MerkleUpdate?r="u":this.type===l.CellType.PrunedBranch&&(r="p"));let n=t+(this.isExotic?r:"x")+"{"+this.bits.toString()+"}";for(let e in this.refs)n+="\n"+this.refs[e].toString(t+" ");return n}asSlice(){return this.beginParse()}asBuilder(){return(0,p.beginCell)().storeSlice(this.asSlice())}}t.Cell=g,n=s.default,g.EMPTY=new g},4654:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.CellType=void 0,function(e){e[e.Ordinary=-1]="Ordinary",e[e.PrunedBranch=1]="PrunedBranch",e[e.Library=2]="Library",e[e.MerkleProof=3]="MerkleProof",e[e.MerkleUpdate=4]="MerkleUpdate"}(r||(t.CellType=r={}))},6906:function(e,t,r){"use strict";var n,i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Slice=void 0;const o=i(r(9107)),s=r(7590),a=r(5871),l=r(9556);class c{constructor(e,t){this[n]=()=>this.toString(),this._reader=e.clone(),this._refs=[...t],this._refsOffset=0}get remainingBits(){return this._reader.remaining}get offsetBits(){return this._reader.offset}get remainingRefs(){return this._refs.length-this._refsOffset}get offsetRefs(){return this._refsOffset}skip(e){return this._reader.skip(e),this}loadBit(){return this._reader.loadBit()}preloadBit(){return this._reader.preloadBit()}loadBoolean(){return this.loadBit()}loadMaybeBoolean(){return this.loadBit()?this.loadBoolean():null}loadBits(e){return this._reader.loadBits(e)}preloadBits(e){return this._reader.preloadBits(e)}loadUint(e){return this._reader.loadUint(e)}loadUintBig(e){return this._reader.loadUintBig(e)}preloadUint(e){return this._reader.preloadUint(e)}preloadUintBig(e){return this._reader.preloadUintBig(e)}loadMaybeUint(e){return this.loadBit()?this.loadUint(e):null}loadMaybeUintBig(e){return this.loadBit()?this.loadUintBig(e):null}loadInt(e){return this._reader.loadInt(e)}loadIntBig(e){return this._reader.loadIntBig(e)}preloadInt(e){return this._reader.preloadInt(e)}preloadIntBig(e){return this._reader.preloadIntBig(e)}loadMaybeInt(e){return this.loadBit()?this.loadInt(e):null}loadMaybeIntBig(e){return this.loadBit()?this.loadIntBig(e):null}loadVarUint(e){return this._reader.loadVarUint(e)}loadVarUintBig(e){return this._reader.loadVarUintBig(e)}preloadVarUint(e){return this._reader.preloadVarUint(e)}preloadVarUintBig(e){return this._reader.preloadVarUintBig(e)}loadVarInt(e){return this._reader.loadVarInt(e)}loadVarIntBig(e){return this._reader.loadVarIntBig(e)}preloadVarInt(e){return this._reader.preloadVarInt(e)}preloadVarIntBig(e){return this._reader.preloadVarIntBig(e)}loadCoins(){return this._reader.loadCoins()}preloadCoins(){return this._reader.preloadCoins()}loadMaybeCoins(){return this._reader.loadBit()?this._reader.loadCoins():null}loadAddress(){return this._reader.loadAddress()}loadMaybeAddress(){return this._reader.loadMaybeAddress()}loadExternalAddress(){return this._reader.loadExternalAddress()}loadMaybeExternalAddress(){return this._reader.loadMaybeExternalAddress()}loadAddressAny(){return this._reader.loadAddressAny()}loadRef(){if(this._refsOffset>=this._refs.length)throw new Error("No more references");return this._refs[this._refsOffset++]}preloadRef(){if(this._refsOffset>=this._refs.length)throw new Error("No more references");return this._refs[this._refsOffset]}loadMaybeRef(){return this.loadBit()?this.loadRef():null}preloadMaybeRef(){return this.preloadBit()?this.preloadRef():null}loadBuffer(e){return this._reader.loadBuffer(e)}preloadBuffer(e){return this._reader.preloadBuffer(e)}loadStringTail(){return(0,l.readString)(this)}loadMaybeStringTail(){return this.loadBit()?(0,l.readString)(this):null}loadStringRefTail(){return(0,l.readString)(this.loadRef().beginParse())}loadMaybeStringRefTail(){const e=this.loadMaybeRef();return e?(0,l.readString)(e.beginParse()):null}loadDict(e,t){return s.Dictionary.load(e,t,this)}loadDictDirect(e,t){return s.Dictionary.loadDirect(e,t,this)}endParse(){if(this.remainingBits>0||this.remainingRefs>0)throw new Error("Slice is not empty")}asCell(){return(0,a.beginCell)().storeSlice(this).endCell()}asBuilder(){return(0,a.beginCell)().storeSlice(this)}clone(e=!1){if(e){let e=this._reader.clone();return e.reset(),new c(e,this._refs)}{let e=new c(this._reader,this._refs);return e._refsOffset=this._refsOffset,e}}toString(){return this.asCell().toString()}}t.Slice=c,n=o.default},555:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LevelMask=void 0;class r{constructor(e=0){var t;this._mask=0,this._mask=e,this._hashIndex=(t=this._mask,16843009*((t=(858993459&(t-=t>>1&1431655765))+(t>>2&858993459))+(t>>4)&252645135)>>24),this._hashCount=this._hashIndex+1}get value(){return this._mask}get level(){return 32-Math.clz32(this._mask)}get hashIndex(){return this._hashIndex}get hashCount(){return this._hashCount}apply(e){return new r(this._mask&(1<>e-1)%2!=0}}t.LevelMask=r},9896:(e,t,r)=>{"use strict";var n=r(8287).hp;Object.defineProperty(t,"__esModule",{value:!0}),t.getRepr=t.getBitsDescriptor=t.getRefsDescriptor=void 0;const i=r(4654),o=r(4382);function s(e,t,r){return e.length+8*(r!==i.CellType.Ordinary?1:0)+32*t}function a(e){let t=e.length;return Math.ceil(t/8)+Math.floor(t/8)}t.getRefsDescriptor=s,t.getBitsDescriptor=a,t.getRepr=function(e,t,r,l,c,d){const u=Math.ceil(t.length/8),h=n.alloc(2+u+34*r.length);let f=0;h[f++]=s(r,c,d),h[f++]=a(e),(0,o.bitsToPaddedBuffer)(t).copy(h,f),f+=u;for(const e of r){let t;t=d==i.CellType.MerkleProof||d==i.CellType.MerkleUpdate?e.depth(l+1):e.depth(l),h[f++]=Math.floor(t/256),h[f++]=t%256}for(const e of r){let t;t=d==i.CellType.MerkleProof||d==i.CellType.MerkleUpdate?e.hash(l+1):e.hash(l),t.copy(h,f),f+=32}return h}},9368:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.exoticLibrary=void 0;const n=r(3528);t.exoticLibrary=function(e,t){const r=new n.BitReader(e);if(264!==e.length)throw new Error(`Library cell must have exactly (8 + 256) bits, got "${e.length}"`);let i=r.loadUint(8);if(2!==i)throw new Error(`Library cell must have type 2, got "${i}"`);return{}}},1459:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.exoticMerkleProof=void 0;const n=r(3528);t.exoticMerkleProof=function(e,t){const r=new n.BitReader(e);if(280!==e.length)throw new Error(`Merkle Proof cell must have exactly (8 + 256 + 16) bits, got "${e.length}"`);if(1!==t.length)throw new Error(`Merkle Proof cell must have exactly 1 ref, got "${t.length}"`);let i=r.loadUint(8);if(3!==i)throw new Error(`Merkle Proof cell must have type 3, got "${i}"`);const o=r.loadBuffer(32),s=r.loadUint(16),a=t[0].hash(0),l=t[0].depth(0);if(s!==l)throw new Error(`Merkle Proof cell ref depth must be exactly "${s}", got "${l}"`);if(!o.equals(a))throw new Error(`Merkle Proof cell ref hash must be exactly "${o.toString("hex")}", got "${a.toString("hex")}"`);return{proofDepth:s,proofHash:o}}},1408:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.exoticMerkleUpdate=void 0;const n=r(3528);t.exoticMerkleUpdate=function(e,t){const r=new n.BitReader(e);if(552!==e.length)throw new Error(`Merkle Update cell must have exactly (8 + (2 * (256 + 16))) bits, got "${e.length}"`);if(2!==t.length)throw new Error(`Merkle Update cell must have exactly 2 refs, got "${t.length}"`);let i=r.loadUint(8);if(4!==i)throw new Error(`Merkle Update cell type must be exactly 4, got "${i}"`);const o=r.loadBuffer(32),s=r.loadBuffer(32),a=r.loadUint(16),l=r.loadUint(16);if(a!==t[0].depth(0))throw new Error(`Merkle Update cell ref depth must be exactly "${a}", got "${t[0].depth(0)}"`);if(!o.equals(t[0].hash(0)))throw new Error(`Merkle Update cell ref hash must be exactly "${o.toString("hex")}", got "${t[0].hash(0).toString("hex")}"`);if(l!==t[1].depth(0))throw new Error(`Merkle Update cell ref depth must be exactly "${l}", got "${t[1].depth(0)}"`);if(!s.equals(t[1].hash(0)))throw new Error(`Merkle Update cell ref hash must be exactly "${s.toString("hex")}", got "${t[1].hash(0).toString("hex")}"`);return{proofDepth1:a,proofDepth2:l,proofHash1:o,proofHash2:s}}},9499:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.exoticPruned=void 0;const n=r(3528),i=r(555);t.exoticPruned=function(e,t){let r,o=new n.BitReader(e),s=o.loadUint(8);if(1!==s)throw new Error(`Pruned branch cell must have type 1, got "${s}"`);if(0!==t.length)throw new Error(`Pruned Branch cell can't has refs, got "${t.length}"`);if(280===e.length)r=new i.LevelMask(1);else{if(r=new i.LevelMask(o.loadUint(8)),r.level<1||r.level>3)throw new Error(`Pruned Branch cell level must be >= 1 and <= 3, got "${r.level}/${r.value}"`);const t=16+272*r.apply(r.level-1).hashCount;if(e.length!==t)throw new Error(`Pruned branch cell must have exactly ${t} bits, got "${e.length}"`)}let a=[],l=[],c=[];for(let e=0;e{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resolveExotic=void 0;const n=r(3528),i=r(4654),o=r(9368),s=r(1459),a=r(1408),l=r(9499),c=r(555);t.resolveExotic=function(e,t){let r=new n.BitReader(e).preloadUint(8);if(1===r)return function(e,t){let r=(0,l.exoticPruned)(e,t),n=[],o=[],s=new c.LevelMask(r.mask);for(let e=0;e>1);return{type:i.CellType.MerkleProof,depths:[],hashes:[],mask:r}}(e,t);if(4===r)return function(e,t){(0,a.exoticMerkleUpdate)(e,t);let r=new c.LevelMask((t[0].level()|t[1].level())>>1);return{type:i.CellType.MerkleUpdate,depths:[],hashes:[],mask:r}}(e,t);throw Error("Invalid exotic cell type: "+r)}},5229:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.serializeBoc=t.deserializeBoc=t.parseBoc=void 0;const n=r(3528),i=r(2386),o=r(6902),s=r(1080),a=r(6767),l=r(9924),c=r(9896),d=r(4382),u=r(9429);function h(e){return function(e){let t=0;for(let r=0;r<3;r++)t+=1&e,e>>=1;return t+1}(7&e)}function f(e,t){const r=e.loadUint(8),n=r%8,o=!!(8&r),s=e.loadUint(8),a=Math.ceil(s/2),l=!!(s%2),c=r>>5,d=!!(16&r),u=d?32*h(c):0,f=d?2*h(c):0;e.skip(8*u),e.skip(8*f);let p=i.BitString.EMPTY;a>0&&(p=l?e.loadPaddedBits(8*a):e.loadBits(8*a));let g=[];for(let r=0;r=0;e--){if(s[e].result)throw Error("Impossible");let t=[];for(let r of s[e].refs){if(!s[r].result)throw Error("Invalid BOC file");t.push(s[r].result)}s[e].result=new o.Cell({bits:s[e].bits,refs:t,exotic:s[e].exotic})}let a=[];for(let e=0;e{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.topologicalSort=void 0,t.topologicalSort=function(e){let t=[e],r=new Map,n=new Set,i=[];for(;t.length>0;){const e=[...t];t=[];for(let i of e){const e=i.hash().toString("hex");if(!r.has(e)){n.add(e),r.set(e,{cell:i,refs:i.refs.map((e=>e.hash().toString("hex")))});for(let e of i.refs)t.push(e)}}}let o=new Set;function s(e){if(!n.has(e))return;if(o.has(e))throw Error("Not a DAG");o.add(e);let t=r.get(e).refs;for(let e=t.length-1;e>=0;e--)s(t[e]);i.push(e),o.delete(e),n.delete(e)}for(;n.size>0;)s(Array.from(n)[0]);let a=new Map;for(let e=0;e=0;e--){let t=i[e];const n=r.get(t);l.push({cell:n.cell,refs:n.refs.map((e=>a.get(e)))})}return l}},2938:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.wonderCalculator=void 0;const n=r(2386),i=r(4654),o=r(555),s=r(9499),a=r(1459),l=r(9896),c=r(5269),d=r(1408),u=r(9368);t.wonderCalculator=function(e,t,r){let h,f=null;if(e===i.CellType.Ordinary){let e=0;for(let t of r)e|=t.mask.value;h=new o.LevelMask(e)}else if(e===i.CellType.PrunedBranch)f=(0,s.exoticPruned)(t,r),h=new o.LevelMask(f.mask);else if(e===i.CellType.MerkleProof)(0,a.exoticMerkleProof)(t,r),h=new o.LevelMask(r[0].mask.value>>1);else if(e===i.CellType.MerkleUpdate)(0,d.exoticMerkleUpdate)(t,r),h=new o.LevelMask((r[0].mask.value|r[1].mask.value)>>1);else{if(e!==i.CellType.Library)throw new Error("Unsupported exotic type");(0,u.exoticLibrary)(t,r),h=new o.LevelMask}let p=[],g=[],m=e===i.CellType.PrunedBranch?1:h.hashCount,y=h.hashCount-m;for(let o=0,s=0;o<=h.level;o++){if(!h.isSignificant(o))continue;if(s0&&d++;let u=(0,l.getRepr)(t,a,r,o,h.apply(o).value,e),f=(0,c.sha256_sync)(u),m=s-y;p[m]=d,g[m]=f,s++}let b=[],w=[];if(f)for(let e=0;e<4;e++){const{hashIndex:t}=h.apply(e),{hashIndex:r}=h;t!==r?(b.push(f.pruned[t].hash),w.push(f.pruned[t].depth)):(b.push(g[0]),w.push(p[0]))}else for(let e=0;e<4;e++)b.push(g[h.apply(e).hashIndex]),w.push(p[h.apply(e).hashIndex]);return{mask:h,hashes:b,depths:w}}},4382:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.paddedBufferToBits=t.bitsToPaddedBuffer=void 0;const n=r(9924),i=r(2386);t.bitsToPaddedBuffer=function(e){let t=new n.BitBuilder(8*Math.ceil(e.length/8));t.writeBits(e);let r=8*Math.ceil(e.length/8)-e.length;for(let e=0;e=0;r--)if(0!==e[r]){const n=e[r];let i=n&-n;1&i||(i=Math.log2(i)+1),r>0&&(t=r<<3),t+=8-i;break}return new i.BitString(e,0,t)}},9556:(e,t,r)=>{"use strict";var n=r(8287).hp;Object.defineProperty(t,"__esModule",{value:!0}),t.writeString=t.stringToCell=t.readString=void 0;const i=r(5871);function o(e){if(e.remainingBits%8!=0)throw new Error(`Invalid string length: ${e.remainingBits}`);if(0!==e.remainingRefs&&1!==e.remainingRefs)throw new Error(`invalid number of refs: ${e.remainingRefs}`);let t;return t=0===e.remainingBits?n.alloc(0):e.loadBuffer(e.remainingBits/8),1===e.remainingRefs&&(t=n.concat([t,o(e.loadRef().beginParse())])),t}function s(e,t){if(e.length>0){let r=Math.floor(t.availableBits/8);if(e.length>r){let n=e.subarray(0,r),o=e.subarray(r);t=t.storeBuffer(n);let a=(0,i.beginCell)();s(o,a),t=t.storeRef(a.endCell())}else t=t.storeBuffer(e)}}t.readString=function(e){return o(e).toString()},t.stringToCell=function(e){let t=(0,i.beginCell)();return s(n.from(e),t),t.endCell()},t.writeString=function(e,t){s(n.from(e),t)}},5121:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ComputeError=void 0;class r extends Error{constructor(e,t,n){super(e),this.exitCode=t,this.debugLogs=n&&n.debugLogs?n.debugLogs:null,this.logs=n&&n.logs?n.logs:null,Object.setPrototypeOf(this,r.prototype)}}t.ComputeError=r},4742:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.openContract=void 0;const n=r(3512),i=r(6902);t.openContract=function(e,t){let r,o=null;if(!n.Address.isAddress(e.address))throw Error("Invalid address");if(r=e.address,e.init){if(!(e.init.code instanceof i.Cell))throw Error("Invalid init.code");if(!(e.init.data instanceof i.Cell))throw Error("Invalid init.data");o=e.init}let s=t({address:r,init:o});return new Proxy(e,{get(e,t){const r=e[t];return"string"==typeof t&&(t.startsWith("get")||t.startsWith("send"))&&"function"==typeof r?(...t)=>r.apply(e,[s,...t]):r}})}},109:(e,t,r)=>{"use strict";var n=r(8287).hp;Object.defineProperty(t,"__esModule",{value:!0}),t.safeSignVerify=t.safeSign=void 0;const i=r(5269);function o(e,t){let r=n.from(t);if(r.length>64)throw Error("Seed can\t be longer than 64 bytes");if(r.length<8)throw Error("Seed must be at least 8 bytes");return(0,i.sha256_sync)(n.concat([n.from([255,255]),r,e.hash()]))}t.safeSign=function(e,t,r="ton-safe-sign-magic"){return(0,i.sign)(o(e,r),t)},t.safeSignVerify=function(e,t,r,n="ton-safe-sign-magic"){return(0,i.signVerify)(o(e,n),t,r)}},7590:(e,t,r)=>{"use strict";var n=r(8287).hp;Object.defineProperty(t,"__esModule",{value:!0}),t.Dictionary=void 0;const i=r(3512),o=r(5871),s=r(6902),a=r(2386),l=r(8981),c=r(2230),d=r(2979),u=r(3910),h=r(6278);class f{static empty(e,t){return e&&t?new f(new Map,e,t):new f(new Map,null,null)}static load(e,t,r){let n;if(r instanceof s.Cell){if(r.isExotic)return f.empty(e,t);n=r.beginParse()}else n=r;let i=n.loadMaybeRef();return i&&!i.isExotic?f.loadDirect(e,t,i.beginParse()):f.empty(e,t)}static loadDirect(e,t,r){if(!r)return f.empty(e,t);let n;n=r instanceof s.Cell?r.beginParse():r;let i=(0,d.parseDict)(n,e.bits,t.parse),o=new Map;for(let[t,r]of i)o.set((0,h.serializeInternalKey)(e.parse(t)),r);return new f(o,e,t)}constructor(e,t,r){this._key=t,this._value=r,this._map=e}get size(){return this._map.size}get(e){return this._map.get((0,h.serializeInternalKey)(e))}has(e){return this._map.has((0,h.serializeInternalKey)(e))}set(e,t){return this._map.set((0,h.serializeInternalKey)(e),t),this}delete(e){const t=(0,h.serializeInternalKey)(e);return this._map.delete(t)}clear(){this._map.clear()}*[Symbol.iterator](){for(const[e,t]of this._map){const r=(0,h.deserializeInternalKey)(e);yield[r,t]}}keys(){return Array.from(this._map.keys()).map((e=>(0,h.deserializeInternalKey)(e)))}values(){return Array.from(this._map.values())}store(e,t,r){if(0===this._map.size)e.storeBit(0);else{let n=this._key;null!=t&&(n=t);let i=this._value;if(null!=r&&(i=r),!n)throw Error("Key serializer is not defined");if(!i)throw Error("Value serializer is not defined");let s=new Map;for(const[e,t]of this._map)s.set(n.serialize((0,h.deserializeInternalKey)(e)),t);e.storeBit(1);let a=(0,o.beginCell)();(0,u.serializeDict)(s,n.bits,i.serialize,a),e.storeRef(a.endCell())}}storeDirect(e,t,r){if(0===this._map.size)throw Error("Cannot store empty dictionary directly");let n=this._key;null!=t&&(n=t);let i=this._value;if(null!=r&&(i=r),!n)throw Error("Key serializer is not defined");if(!i)throw Error("Value serializer is not defined");let o=new Map;for(const[e,t]of this._map)o.set(n.serialize((0,h.deserializeInternalKey)(e)),t);(0,u.serializeDict)(o,n.bits,i.serialize,e)}generateMerkleProof(e){return(0,l.generateMerkleProof)(this,e,this._key)}generateMerkleUpdate(e,t){return(0,c.generateMerkleUpdate)(this,e,this._key,t)}}t.Dictionary=f,f.Keys={Address:()=>({bits:267,serialize:e=>{if(!i.Address.isAddress(e))throw Error("Key is not an address");return(0,o.beginCell)().storeAddress(e).endCell().beginParse().preloadUintBig(267)},parse:e=>(0,o.beginCell)().storeUint(e,267).endCell().beginParse().loadAddress()}),BigInt:e=>function(e){return{bits:e,serialize:t=>{if("bigint"!=typeof t)throw Error("Key is not a bigint");return(0,o.beginCell)().storeInt(t,e).endCell().beginParse().loadUintBig(e)},parse:t=>(0,o.beginCell)().storeUint(t,e).endCell().beginParse().loadIntBig(e)}}(e),Int:e=>function(e){return{bits:e,serialize:t=>{if("number"!=typeof t)throw Error("Key is not a number");if(!Number.isSafeInteger(t))throw Error("Key is not a safe integer: "+t);return(0,o.beginCell)().storeInt(t,e).endCell().beginParse().loadUintBig(e)},parse:t=>(0,o.beginCell)().storeUint(t,e).endCell().beginParse().loadInt(e)}}(e),BigUint:e=>function(e){return{bits:e,serialize:t=>{if("bigint"!=typeof t)throw Error("Key is not a bigint");if(t<0)throw Error("Key is negative: "+t);return(0,o.beginCell)().storeUint(t,e).endCell().beginParse().loadUintBig(e)},parse:t=>(0,o.beginCell)().storeUint(t,e).endCell().beginParse().loadUintBig(e)}}(e),Uint:e=>function(e){return{bits:e,serialize:t=>{if("number"!=typeof t)throw Error("Key is not a number");if(!Number.isSafeInteger(t))throw Error("Key is not a safe integer: "+t);if(t<0)throw Error("Key is negative: "+t);return(0,o.beginCell)().storeUint(t,e).endCell().beginParse().loadUintBig(e)},parse:t=>Number((0,o.beginCell)().storeUint(t,e).endCell().beginParse().loadUint(e))}}(e),Buffer:e=>function(e){return{bits:8*e,serialize:t=>{if(!n.isBuffer(t))throw Error("Key is not a buffer");return(0,o.beginCell)().storeBuffer(t).endCell().beginParse().loadUintBig(8*e)},parse:t=>(0,o.beginCell)().storeUint(t,8*e).endCell().beginParse().loadBuffer(e)}}(e),BitString:e=>function(e){return{bits:e,serialize:t=>{if(!a.BitString.isBitString(t))throw Error("Key is not a BitString");return(0,o.beginCell)().storeBits(t).endCell().beginParse().loadUintBig(e)},parse:t=>(0,o.beginCell)().storeUint(t,e).endCell().beginParse().loadBits(e)}}(e)},f.Values={BigInt:e=>function(e){return{serialize:(t,r)=>{r.storeInt(t,e)},parse:t=>t.loadIntBig(e)}}(e),Int:e=>function(e){return{serialize:(t,r)=>{r.storeInt(t,e)},parse:t=>t.loadInt(e)}}(e),BigVarInt:e=>function(e){return{serialize:(t,r)=>{r.storeVarInt(t,e)},parse:t=>t.loadVarIntBig(e)}}(e),BigUint:e=>function(e){return{serialize:(t,r)=>{r.storeUint(t,e)},parse:t=>t.loadUintBig(e)}}(e),Uint:e=>function(e){return{serialize:(t,r)=>{r.storeUint(t,e)},parse:t=>t.loadUint(e)}}(e),BigVarUint:e=>function(e){return{serialize:(t,r)=>{r.storeVarUint(t,e)},parse:t=>t.loadVarUintBig(e)}}(e),Bool:()=>({serialize:(e,t)=>{t.storeBit(e)},parse:e=>e.loadBit()}),Address:()=>({serialize:(e,t)=>{t.storeAddress(e)},parse:e=>e.loadAddress()}),Cell:()=>({serialize:(e,t)=>{t.storeRef(e)},parse:e=>e.loadRef()}),Buffer:e=>{return t=e,{serialize:(e,r)=>{if(e.length!==t)throw Error("Invalid buffer size");r.storeBuffer(e)},parse:e=>e.loadBuffer(t)};var t},BitString:e=>function(e){return{serialize:(t,r)=>{if(t.length!==e)throw Error("Invalid BitString size");r.storeBits(t)},parse:t=>t.loadBits(e)}}(e),Dictionary:(e,t)=>function(e,t){return{serialize:(e,t)=>{e.store(t)},parse:r=>f.load(e,t,r)}}(e,t)}},8981:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.generateMerkleProof=void 0;const n=r(5871),i=r(421);function o(e){return(0,n.beginCell)().storeUint(1,8).storeUint(1,8).storeBuffer(e.hash(0)).storeUint(e.depth(0),16).endCell({exotic:!0})}function s(e,t,r,a){const l=t.asCell();let c=0,d=e;if(0==(t.loadBit()?1:0)){c=(0,i.readUnaryLength)(t);for(let e=0;e{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.generateMerkleUpdate=void 0;const n=r(5871),i=r(8981);t.generateMerkleUpdate=function(e,t,r,o){const s=(0,i.generateMerkleProof)(e,t,r).refs[0];e.set(t,o);return a=s,l=(0,i.generateMerkleProof)(e,t,r).refs[0],(0,n.beginCell)().storeUint(4,8).storeBuffer(a.hash(0)).storeBuffer(l.hash(0)).storeUint(a.depth(0),16).storeUint(l.depth(0),16).storeRef(a).storeRef(l).endCell({exotic:!0});var a,l}},2979:(e,t)=>{"use strict";function r(e,t,n,i,o){let s=0,a=e;if(0==(t.loadBit()?1:0)){s=function(e){let t=0;for(;e.loadBit();)t++;return t}(t);for(let e=0;e{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.serializeDict=t.detectLabelType=t.writeLabelSame=t.writeLabelLong=t.writeLabelShort=t.buildTree=void 0;const n=r(5871),i=r(7182);function o(e,t){for(;e.length0&&t.storeUint(BigInt("0b"+e),e.length),t}function d(e,t,r){r.storeBit(1),r.storeBit(0);let n=Math.ceil(Math.log2(t+1));return r.storeUint(e.length,n),e.length>0&&r.storeUint(BigInt("0b"+e),e.length),r}function u(e,t,r,n){n.storeBit(1),n.storeBit(1),n.storeBit(e);let i=Math.ceil(Math.log2(r+1));n.storeUint(t,i)}function h(e,t){let r="short",n=function(e){return 1+e.length+1+e.length}(e),i=function(e,t){return 2+Math.ceil(Math.log2(t+1))+e.length}(e,t);if(i{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.findCommonPrefix=void 0,t.findCommonPrefix=function(e,t=0){if(0===e.length)return"";let r=e[0].slice(t);for(let n=1;n{"use strict";var n=r(8287).hp;Object.defineProperty(t,"__esModule",{value:!0}),t.deserializeInternalKey=t.serializeInternalKey=void 0;const i=r(3512),o=r(2386),s=r(4382);t.serializeInternalKey=function(e){if("number"==typeof e){if(!Number.isSafeInteger(e))throw Error("Invalid key type: not a safe integer: "+e);return"n:"+e.toString(10)}if("bigint"==typeof e)return"b:"+e.toString(10);if(i.Address.isAddress(e))return"a:"+e.toString();if(n.isBuffer(e))return"f:"+e.toString("hex");if(o.BitString.isBitString(e))return"B:"+e.toString();throw Error("Invalid key type")},t.deserializeInternalKey=function(e){let t=e.slice(0,2),r=e.slice(2);if("n:"===t)return parseInt(r,10);if("b:"===t)return BigInt(r);if("a:"===t)return i.Address.parse(r);if("f:"===t)return n.from(r,"hex");if("B:"===t){const e="_"==r.slice(-1);if(e||r.length%2!=0){let t=e?r.length-1:r.length;const i=r.substr(0,t)+"0";return!e&&1&t?new o.BitString(n.from(i,"hex"),0,t<<2):(0,s.paddedBufferToBits)(n.from(i,"hex"))}return new o.BitString(n.from(r,"hex"),0,r.length<<2)}throw Error("Invalid key type: "+t)}},421:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.readUnaryLength=void 0,t.readUnaryLength=function(e){let t=0;for(;e.loadBit();)t++;return t}},1307:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.safeSignVerify=t.safeSign=t.getMethodId=t.base32Encode=t.base32Decode=t.crc32c=t.crc16=t.fromNano=t.toNano=t.ComputeError=t.openContract=t.TupleBuilder=t.TupleReader=t.serializeTuple=t.parseTuple=t.generateMerkleUpdate=t.generateMerkleProof=t.exoticPruned=t.exoticMerkleUpdate=t.exoticMerkleProof=t.Dictionary=t.Cell=t.CellType=t.Slice=t.beginCell=t.Builder=t.BitBuilder=t.BitReader=t.BitString=t.contractAddress=t.ADNLAddress=t.ExternalAddress=t.address=t.Address=void 0;var o=r(3512);Object.defineProperty(t,"Address",{enumerable:!0,get:function(){return o.Address}}),Object.defineProperty(t,"address",{enumerable:!0,get:function(){return o.address}});var s=r(1629);Object.defineProperty(t,"ExternalAddress",{enumerable:!0,get:function(){return s.ExternalAddress}});var a=r(4061);Object.defineProperty(t,"ADNLAddress",{enumerable:!0,get:function(){return a.ADNLAddress}});var l=r(8986);Object.defineProperty(t,"contractAddress",{enumerable:!0,get:function(){return l.contractAddress}});var c=r(2386);Object.defineProperty(t,"BitString",{enumerable:!0,get:function(){return c.BitString}});var d=r(3528);Object.defineProperty(t,"BitReader",{enumerable:!0,get:function(){return d.BitReader}});var u=r(9924);Object.defineProperty(t,"BitBuilder",{enumerable:!0,get:function(){return u.BitBuilder}});var h=r(5871);Object.defineProperty(t,"Builder",{enumerable:!0,get:function(){return h.Builder}}),Object.defineProperty(t,"beginCell",{enumerable:!0,get:function(){return h.beginCell}});var f=r(6906);Object.defineProperty(t,"Slice",{enumerable:!0,get:function(){return f.Slice}});var p=r(4654);Object.defineProperty(t,"CellType",{enumerable:!0,get:function(){return p.CellType}});var g=r(6902);Object.defineProperty(t,"Cell",{enumerable:!0,get:function(){return g.Cell}});var m=r(7590);Object.defineProperty(t,"Dictionary",{enumerable:!0,get:function(){return m.Dictionary}});var y=r(1459);Object.defineProperty(t,"exoticMerkleProof",{enumerable:!0,get:function(){return y.exoticMerkleProof}});var b=r(1408);Object.defineProperty(t,"exoticMerkleUpdate",{enumerable:!0,get:function(){return b.exoticMerkleUpdate}});var w=r(9499);Object.defineProperty(t,"exoticPruned",{enumerable:!0,get:function(){return w.exoticPruned}});var v=r(8981);Object.defineProperty(t,"generateMerkleProof",{enumerable:!0,get:function(){return v.generateMerkleProof}});var C=r(2230);Object.defineProperty(t,"generateMerkleUpdate",{enumerable:!0,get:function(){return C.generateMerkleUpdate}});var _=r(1640);Object.defineProperty(t,"parseTuple",{enumerable:!0,get:function(){return _.parseTuple}}),Object.defineProperty(t,"serializeTuple",{enumerable:!0,get:function(){return _.serializeTuple}});var k=r(1155);Object.defineProperty(t,"TupleReader",{enumerable:!0,get:function(){return k.TupleReader}});var x=r(4117);Object.defineProperty(t,"TupleBuilder",{enumerable:!0,get:function(){return x.TupleBuilder}}),i(r(3814),t);var A=r(4742);Object.defineProperty(t,"openContract",{enumerable:!0,get:function(){return A.openContract}});var S=r(5121);Object.defineProperty(t,"ComputeError",{enumerable:!0,get:function(){return S.ComputeError}});var B=r(7070);Object.defineProperty(t,"toNano",{enumerable:!0,get:function(){return B.toNano}}),Object.defineProperty(t,"fromNano",{enumerable:!0,get:function(){return B.fromNano}});var E=r(2960);Object.defineProperty(t,"crc16",{enumerable:!0,get:function(){return E.crc16}});var I=r(9429);Object.defineProperty(t,"crc32c",{enumerable:!0,get:function(){return I.crc32c}});var P=r(3721);Object.defineProperty(t,"base32Decode",{enumerable:!0,get:function(){return P.base32Decode}}),Object.defineProperty(t,"base32Encode",{enumerable:!0,get:function(){return P.base32Encode}});var M=r(5149);Object.defineProperty(t,"getMethodId",{enumerable:!0,get:function(){return M.getMethodId}});var U=r(109);Object.defineProperty(t,"safeSign",{enumerable:!0,get:function(){return U.safeSign}}),Object.defineProperty(t,"safeSignVerify",{enumerable:!0,get:function(){return U.safeSignVerify}})},4117:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TupleBuilder=void 0;const n=r(5871),i=r(6902),o=r(6906);t.TupleBuilder=class{constructor(){this._tuple=[]}writeNumber(e){null==e?this._tuple.push({type:"null"}):this._tuple.push({type:"int",value:BigInt(e)})}writeBoolean(e){null==e?this._tuple.push({type:"null"}):this._tuple.push({type:"int",value:e?-1n:0n})}writeBuffer(e){null==e?this._tuple.push({type:"null"}):this._tuple.push({type:"slice",cell:(0,n.beginCell)().storeBuffer(e).endCell()})}writeString(e){null==e?this._tuple.push({type:"null"}):this._tuple.push({type:"slice",cell:(0,n.beginCell)().storeStringTail(e).endCell()})}writeCell(e){null==e?this._tuple.push({type:"null"}):e instanceof i.Cell?this._tuple.push({type:"cell",cell:e}):e instanceof o.Slice&&this._tuple.push({type:"cell",cell:e.asCell()})}writeSlice(e){null==e?this._tuple.push({type:"null"}):e instanceof i.Cell?this._tuple.push({type:"slice",cell:e}):e instanceof o.Slice&&this._tuple.push({type:"slice",cell:e.asCell()})}writeBuilder(e){null==e?this._tuple.push({type:"null"}):e instanceof i.Cell?this._tuple.push({type:"builder",cell:e}):e instanceof o.Slice&&this._tuple.push({type:"builder",cell:e.asCell()})}writeTuple(e){null==e?this._tuple.push({type:"null"}):this._tuple.push({type:"tuple",items:e})}writeAddress(e){null==e?this._tuple.push({type:"null"}):this._tuple.push({type:"slice",cell:(0,n.beginCell)().storeAddress(e).endCell()})}build(){return[...this._tuple]}}},1155:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TupleReader=void 0;class r{constructor(e){this.items=[...e]}get remaining(){return this.items.length}peek(){if(0===this.items.length)throw Error("EOF");return this.items[0]}pop(){if(0===this.items.length)throw Error("EOF");let e=this.items[0];return this.items.splice(0,1),e}skip(e=1){for(let t=0;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseTuple=t.serializeTuple=void 0;const n=r(5871),i=BigInt("-9223372036854775808"),o=BigInt("9223372036854775807");function s(e,t){if("null"===e.type)t.storeUint(0,8);else if("int"===e.type)e.value<=o&&e.value>=i?(t.storeUint(1,8),t.storeInt(e.value,64)):(t.storeUint(256,15),t.storeInt(e.value,257));else if("nan"===e.type)t.storeInt(767,16);else if("cell"===e.type)t.storeUint(3,8),t.storeRef(e.cell);else if("slice"===e.type)t.storeUint(4,8),t.storeUint(0,10),t.storeUint(e.cell.bits.length,10),t.storeUint(0,3),t.storeUint(e.cell.refs.length,3),t.storeRef(e.cell);else if("builder"===e.type)t.storeUint(5,8),t.storeRef(e.cell);else{if("tuple"!==e.type)throw Error("Invalid value");{let r=null,i=null;for(let t=0;t1&&(r=(0,n.beginCell)().storeRef(i).storeRef(r).endCell());let a=(0,n.beginCell)();s(e.items[t],a),i=a.endCell()}t.storeUint(7,8),t.storeUint(e.items.length,16),r&&t.storeRef(r),i&&t.storeRef(i)}}}function a(e){let t=e.loadUint(8);if(0===t)return{type:"null"};if(1===t)return{type:"int",value:e.loadIntBig(64)};if(2===t)return 0===e.loadUint(7)?{type:"int",value:e.loadIntBig(257)}:(e.loadBit(),{type:"nan"});if(3===t)return{type:"cell",cell:e.loadRef()};if(4===t){let t=e.loadUint(10),r=e.loadUint(10),i=e.loadUint(3),o=e.loadUint(3),s=e.loadRef().beginParse();s.skip(t);let a=s.loadBits(r-t),l=(0,n.beginCell)().storeBits(a);if(i1){let n=e.loadRef().beginParse(),i=e.loadRef().beginParse();r.unshift(a(i));for(let e=0;e0){let r=(0,n.beginCell)();l(e.slice(0,e.length-1),r),t.storeRef(r.endCell()),s(e[e.length-1],t)}}t.serializeTuple=function(e){let t=(0,n.beginCell)();return t.storeUint(e.length,24),l([...e],t),t.endCell()},t.parseTuple=function(e){let t=[],r=e.beginParse(),n=r.loadUint(24);for(let e=0;e{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.storeAccount=t.loadAccount=void 0;const n=r(6161),i=r(5006);t.loadAccount=function(e){return{addr:e.loadAddress(),storageStats:(0,i.loadStorageInfo)(e),storage:(0,n.loadAccountStorage)(e)}},t.storeAccount=function(e){return t=>{t.storeAddress(e.addr),t.store((0,i.storeStorageInfo)(e.storageStats)),t.store((0,n.storeAccountStorage)(e.storage))}}},3049:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.storeAccountState=t.loadAccountState=void 0;const n=r(2738);t.loadAccountState=function(e){return e.loadBit()?{type:"active",state:(0,n.loadStateInit)(e)}:e.loadBit()?{type:"frozen",stateHash:e.loadUintBig(256)}:{type:"uninit"}},t.storeAccountState=function(e){return t=>{"active"===e.type?(t.storeBit(!0),t.store((0,n.storeStateInit)(e.state))):"frozen"===e.type?(t.storeBit(!1),t.storeBit(!0),t.storeUint(e.stateHash,256)):"uninit"===e.type&&(t.storeBit(!1),t.storeBit(!1))}}},7676:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.storeAccountStatus=t.loadAccountStatus=void 0,t.loadAccountStatus=function(e){const t=e.loadUint(2);if(0===t)return"uninitialized";if(1===t)return"frozen";if(2===t)return"active";if(3===t)return"non-existing";throw Error("Invalid data")},t.storeAccountStatus=function(e){return t=>{if("uninitialized"===e)t.storeUint(0,2);else if("frozen"===e)t.storeUint(1,2);else if("active"===e)t.storeUint(2,2);else{if("non-existing"!==e)throw Error("Invalid data");t.storeUint(3,2)}return t}}},2312:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.storeAccountStatusChange=t.loadAccountStatusChange=void 0,t.loadAccountStatusChange=function(e){return e.loadBit()?e.loadBit()?"deleted":"frozen":"unchanged"},t.storeAccountStatusChange=function(e){return t=>{if("unchanged"==e)t.storeBit(0);else if("frozen"===e)t.storeBit(1),t.storeBit(0);else{if("deleted"!==e)throw Error("Invalid account status change");t.storeBit(1),t.storeBit(1)}}}},6161:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.storeAccountStorage=t.loadAccountStorage=void 0;const n=r(3049),i=r(574);t.loadAccountStorage=function(e){return{lastTransLt:e.loadUintBig(64),balance:(0,i.loadCurrencyCollection)(e),state:(0,n.loadAccountState)(e)}},t.storeAccountStorage=function(e){return t=>{t.storeUint(e.lastTransLt,64),t.store((0,i.storeCurrencyCollection)(e.balance)),t.store((0,n.storeAccountState)(e.state))}}},445:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.storeCommonMessageInfo=t.loadCommonMessageInfo=void 0;const n=r(574);t.loadCommonMessageInfo=function(e){return e.loadBit()?e.loadBit()?{type:"external-out",src:e.loadAddress(),dest:e.loadMaybeExternalAddress(),createdLt:e.loadUintBig(64),createdAt:e.loadUint(32)}:{type:"external-in",src:e.loadMaybeExternalAddress(),dest:e.loadAddress(),importFee:e.loadCoins()}:{type:"internal",ihrDisabled:e.loadBit(),bounce:e.loadBit(),bounced:e.loadBit(),src:e.loadAddress(),dest:e.loadAddress(),value:(0,n.loadCurrencyCollection)(e),ihrFee:e.loadCoins(),forwardFee:e.loadCoins(),createdLt:e.loadUintBig(64),createdAt:e.loadUint(32)}},t.storeCommonMessageInfo=function(e){return t=>{if("internal"===e.type)t.storeBit(0),t.storeBit(e.ihrDisabled),t.storeBit(e.bounce),t.storeBit(e.bounced),t.storeAddress(e.src),t.storeAddress(e.dest),t.store((0,n.storeCurrencyCollection)(e.value)),t.storeCoins(e.ihrFee),t.storeCoins(e.forwardFee),t.storeUint(e.createdLt,64),t.storeUint(e.createdAt,32);else if("external-in"===e.type)t.storeBit(1),t.storeBit(0),t.storeAddress(e.src),t.storeAddress(e.dest),t.storeCoins(e.importFee);else{if("external-out"!==e.type)throw new Error("Unknown CommonMessageInfo type");t.storeBit(1),t.storeBit(1),t.storeAddress(e.src),t.storeAddress(e.dest),t.storeUint(e.createdLt,64),t.storeUint(e.createdAt,32)}}}},2234:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.storeCommonMessageInfoRelaxed=t.loadCommonMessageInfoRelaxed=void 0;const n=r(574);t.loadCommonMessageInfoRelaxed=function(e){if(!e.loadBit())return{type:"internal",ihrDisabled:e.loadBit(),bounce:e.loadBit(),bounced:e.loadBit(),src:e.loadMaybeAddress(),dest:e.loadAddress(),value:(0,n.loadCurrencyCollection)(e),ihrFee:e.loadCoins(),forwardFee:e.loadCoins(),createdLt:e.loadUintBig(64),createdAt:e.loadUint(32)};if(!e.loadBit())throw Error("External In message is not possible for CommonMessageInfoRelaxed");return{type:"external-out",src:e.loadMaybeAddress(),dest:e.loadMaybeExternalAddress(),createdLt:e.loadUintBig(64),createdAt:e.loadUint(32)}},t.storeCommonMessageInfoRelaxed=function(e){return t=>{if("internal"===e.type)t.storeBit(0),t.storeBit(e.ihrDisabled),t.storeBit(e.bounce),t.storeBit(e.bounced),t.storeAddress(e.src),t.storeAddress(e.dest),t.store((0,n.storeCurrencyCollection)(e.value)),t.storeCoins(e.ihrFee),t.storeCoins(e.forwardFee),t.storeUint(e.createdLt,64),t.storeUint(e.createdAt,32);else{if("external-out"!==e.type)throw new Error("Unknown CommonMessageInfo type");t.storeBit(1),t.storeBit(1),t.storeAddress(e.src),t.storeAddress(e.dest),t.storeUint(e.createdLt,64),t.storeUint(e.createdAt,32)}}}},3471:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.storeComputeSkipReason=t.loadComputeSkipReason=void 0,t.loadComputeSkipReason=function(e){let t=e.loadUint(2);if(0===t)return"no-state";if(1===t)return"bad-state";if(2===t)return"no-gas";throw new Error(`Unknown ComputeSkipReason: ${t}`)},t.storeComputeSkipReason=function(e){return t=>{if("no-state"===e)t.storeUint(0,2);else if("bad-state"===e)t.storeUint(1,2);else{if("no-gas"!==e)throw new Error(`Unknown ComputeSkipReason: ${e}`);t.storeUint(2,2)}}}},574:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.storeCurrencyCollection=t.loadCurrencyCollection=void 0;const n=r(7590);t.loadCurrencyCollection=function(e){const t=e.loadCoins(),r=e.loadDict(n.Dictionary.Keys.Uint(32),n.Dictionary.Values.BigVarUint(5));return 0===r.size?{coins:t}:{other:r,coins:t}},t.storeCurrencyCollection=function(e){return t=>{t.storeCoins(e.coins),e.other?t.storeDict(e.other):t.storeBit(0)}}},4458:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.storeDepthBalanceInfo=t.loadDepthBalanceInfo=void 0;const n=r(574);t.loadDepthBalanceInfo=function(e){return{splitDepth:e.loadUint(5),balance:(0,n.loadCurrencyCollection)(e)}},t.storeDepthBalanceInfo=function(e){return t=>{t.storeUint(e.splitDepth,5),t.store((0,n.storeCurrencyCollection)(e.balance))}}},4660:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.storeHashUpdate=t.loadHashUpdate=void 0,t.loadHashUpdate=function(e){if(114!==e.loadUint(8))throw Error("Invalid data");return{oldHash:e.loadBuffer(32),newHash:e.loadBuffer(32)}},t.storeHashUpdate=function(e){return t=>{t.storeUint(114,8),t.storeBuffer(e.oldHash),t.storeBuffer(e.newHash)}}},9039:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.loadMasterchainStateExtra=void 0;const n=r(7590),i=r(574);t.loadMasterchainStateExtra=function(e){if(52262!==e.loadUint(16))throw Error("Invalid data");e.loadBit()&&e.loadRef();let t=e.loadUintBig(256);return{config:n.Dictionary.load(n.Dictionary.Keys.Int(32),n.Dictionary.Values.Cell(),e),configAddress:t,globalBalance:(0,i.loadCurrencyCollection)(e)}}},8178:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MessageValue=t.storeMessage=t.loadMessage=void 0;const n=r(5871),i=r(445),o=r(2738);function s(e){const t=(0,i.loadCommonMessageInfo)(e);let r=null;return e.loadBit()&&(r=e.loadBit()?(0,o.loadStateInit)(e.loadRef().beginParse()):(0,o.loadStateInit)(e)),{info:t,init:r,body:e.loadBit()?e.loadRef():e.asCell()}}function a(e,t){return r=>{if(r.store((0,i.storeCommonMessageInfo)(e.info)),e.init){r.storeBit(!0);let i=(0,n.beginCell)().store((0,o.storeStateInit)(e.init)),s=!1;s=!(!t||!t.forceRef)||r.availableBits-24,s?(r.storeBit(!0),r.storeRef(e.body)):(r.storeBit(!1),r.storeBuilder(e.body.asBuilder()))}}t.loadMessage=s,t.storeMessage=a,t.MessageValue={serialize(e,t){t.storeRef((0,n.beginCell)().store(a(e)))},parse:e=>s(e.loadRef().beginParse())}},4143:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.storeMessageRelaxed=t.loadMessageRelaxed=void 0;const n=r(5871),i=r(2234),o=r(2738);t.loadMessageRelaxed=function(e){const t=(0,i.loadCommonMessageInfoRelaxed)(e);let r=null;return e.loadBit()&&(r=e.loadBit()?(0,o.loadStateInit)(e.loadRef().beginParse()):(0,o.loadStateInit)(e)),{info:t,init:r,body:e.loadBit()?e.loadRef():e.asCell()}},t.storeMessageRelaxed=function(e,t){return r=>{if(r.store((0,i.storeCommonMessageInfoRelaxed)(e.info)),e.init){r.storeBit(!0);let i=(0,n.beginCell)().store((0,o.storeStateInit)(e.init)),s=!1;s=!((!t||!t.forceRef)&&r.availableBits-2>=i.bits),s?(r.storeBit(!0),r.storeRef(i)):(r.storeBit(!1),r.storeBuilder(i))}else r.storeBit(!1);let s=!1;s=!(!t||!t.forceRef)||!(r.availableBits-1>=e.body.bits.length&&r.refs+e.body.refs.length<=4&&!e.body.isExotic),s?(r.storeBit(!0),r.storeRef(e.body)):(r.storeBit(!1),r.storeBuilder(e.body.asBuilder()))}}},3101:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.loadOutList=t.storeOutList=t.loadOutAction=t.storeOutAction=void 0;const n=r(4143),i=r(5871);function o(e){switch(e.type){case"sendMsg":return function(e){return t=>{t.storeUint(s,32).storeUint(e.mode,8).storeRef((0,i.beginCell)().store((0,n.storeMessageRelaxed)(e.outMsg)).endCell())}}(e);case"setCode":return function(e){return t=>{t.storeUint(a,32).storeRef(e.newCode)}}(e);default:throw new Error(`Unknown action type ${e.type}`)}}t.storeOutAction=o;const s=247711853,a=2907562126;function l(e){const t=e.loadUint(32);if(t===s)return{type:"sendMsg",mode:e.loadUint(8),outMsg:(0,n.loadMessageRelaxed)(e.loadRef().beginParse())};if(t===a)return{type:"setCode",newCode:e.loadRef()};throw new Error(`Unknown out action tag 0x${t.toString(16)}`)}t.loadOutAction=l,t.storeOutList=function(e){const t=e.reduce(((e,t)=>(0,i.beginCell)().storeRef(e).store(o(t)).endCell()),(0,i.beginCell)().endCell());return e=>{e.storeSlice(t.beginParse())}},t.loadOutList=function(e){const t=[];for(;e.remainingRefs;){const r=e.loadRef();t.push(l(e)),e=r.beginParse()}return t.reverse()}},4568:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.SendMode=void 0,function(e){e[e.CARRY_ALL_REMAINING_BALANCE=128]="CARRY_ALL_REMAINING_BALANCE",e[e.CARRY_ALL_REMAINING_INCOMING_VALUE=64]="CARRY_ALL_REMAINING_INCOMING_VALUE",e[e.DESTROY_ACCOUNT_IF_ZERO=32]="DESTROY_ACCOUNT_IF_ZERO",e[e.PAY_GAS_SEPARATELY=1]="PAY_GAS_SEPARATELY",e[e.IGNORE_ERRORS=2]="IGNORE_ERRORS",e[e.NONE=0]="NONE"}(r||(t.SendMode=r={}))},594:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.storeShardAccount=t.loadShardAccount=void 0;const n=r(5871),i=r(2142);t.loadShardAccount=function(e){let t,r=e.loadRef();if(!r.isExotic){let e=r.beginParse();e.loadBit()&&(t=(0,i.loadAccount)(e))}return{account:t,lastTransactionHash:e.loadUintBig(256),lastTransactionLt:e.loadUintBig(64)}},t.storeShardAccount=function(e){return t=>{e.account?t.storeRef((0,n.beginCell)().storeBit(!0).store((0,i.storeAccount)(e.account))):t.storeRef((0,n.beginCell)().storeBit(!1)),t.storeUint(e.lastTransactionHash,256),t.storeUint(e.lastTransactionLt,64)}}},8993:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.storeShardAccounts=t.loadShardAccounts=t.ShardAccountRefValue=void 0;const n=r(7590),i=r(4458),o=r(594);t.ShardAccountRefValue={parse:e=>({depthBalanceInfo:(0,i.loadDepthBalanceInfo)(e),shardAccount:(0,o.loadShardAccount)(e)}),serialize(e,t){t.store((0,i.storeDepthBalanceInfo)(e.depthBalanceInfo)),t.store((0,o.storeShardAccount)(e.shardAccount))}},t.loadShardAccounts=function(e){return n.Dictionary.load(n.Dictionary.Keys.BigUint(256),t.ShardAccountRefValue,e)},t.storeShardAccounts=function(e){return t=>{t.storeDict(e)}}},2423:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.storeShardIdent=t.loadShardIdent=void 0,t.loadShardIdent=function(e){if(0!==e.loadUint(2))throw Error("Invalid data");return{shardPrefixBits:e.loadUint(6),workchainId:e.loadInt(32),shardPrefix:e.loadUintBig(64)}},t.storeShardIdent=function(e){return t=>{t.storeUint(0,2),t.storeUint(e.shardPrefixBits,6),t.storeInt(e.workchainId,32),t.storeUint(e.shardPrefix,64)}}},5787:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.loadShardStateUnsplit=void 0;const n=r(9039),i=r(8993),o=r(2423);t.loadShardStateUnsplit=function(e){if(2418257890!==e.loadUint(32))throw Error("Invalid data");let t=e.loadInt(32),r=(0,o.loadShardIdent)(e),s=e.loadUint(32),a=e.loadUint(32),l=e.loadUint(32),c=e.loadUintBig(64),d=e.loadUint(32);e.loadRef();let u,h=e.loadBit(),f=e.loadRef();f.isExotic||(u=(0,i.loadShardAccounts)(f.beginParse())),e.loadRef();let p=null;if(e.loadBit()){let t=e.loadRef();t.isExotic||(p=(0,n.loadMasterchainStateExtra)(t.beginParse()))}return{globalId:t,shardId:r,seqno:s,vertSeqNo:a,genUtime:l,genLt:c,minRefMcSeqno:d,beforeSplit:h,accounts:u,extras:p}}},2672:(e,t)=>{"use strict";function r(e){return{public:e.loadBit(),root:e.loadRef()}}function n(e){return t=>{t.storeBit(e.public),t.storeRef(e.root)}}Object.defineProperty(t,"__esModule",{value:!0}),t.SimpleLibraryValue=t.storeSimpleLibrary=t.loadSimpleLibrary=void 0,t.loadSimpleLibrary=r,t.storeSimpleLibrary=n,t.SimpleLibraryValue={serialize(e,t){n(e)(t)},parse:e=>r(e)}},9589:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.storeSplitMergeInfo=t.loadSplitMergeInfo=void 0,t.loadSplitMergeInfo=function(e){return{currentShardPrefixLength:e.loadUint(6),accountSplitDepth:e.loadUint(6),thisAddress:e.loadUintBig(256),siblingAddress:e.loadUintBig(256)}},t.storeSplitMergeInfo=function(e){return t=>{t.storeUint(e.currentShardPrefixLength,6),t.storeUint(e.accountSplitDepth,6),t.storeUint(e.thisAddress,256),t.storeUint(e.siblingAddress,256)}}},2738:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.storeStateInit=t.loadStateInit=void 0;const n=r(7590),i=r(2672),o=r(4599);t.loadStateInit=function(e){let t,r;e.loadBit()&&(t=e.loadUint(5)),e.loadBit()&&(r=(0,o.loadTickTock)(e));let s=e.loadMaybeRef(),a=e.loadMaybeRef(),l=e.loadDict(n.Dictionary.Keys.BigUint(256),i.SimpleLibraryValue);return 0===l.size&&(l=void 0),{splitDepth:t,special:r,code:s,data:a,libraries:l}},t.storeStateInit=function(e){return t=>{null!==e.splitDepth&&void 0!==e.splitDepth?(t.storeBit(!0),t.storeUint(e.splitDepth,5)):t.storeBit(!1),null!==e.special&&void 0!==e.special?(t.storeBit(!0),t.store((0,o.storeTickTock)(e.special))):t.storeBit(!1),t.storeMaybeRef(e.code),t.storeMaybeRef(e.data),t.storeDict(e.libraries)}}},5006:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.storeStorageInfo=t.loadStorageInfo=void 0;const n=r(2577);t.loadStorageInfo=function(e){return{used:(0,n.loadStorageUsed)(e),lastPaid:e.loadUint(32),duePayment:e.loadMaybeCoins()}},t.storeStorageInfo=function(e){return t=>{t.store((0,n.storeStorageUsed)(e.used)),t.storeUint(e.lastPaid,32),t.storeMaybeCoins(e.duePayment)}}},2577:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.storeStorageUsed=t.loadStorageUsed=void 0,t.loadStorageUsed=function(e){return{cells:e.loadVarUintBig(3),bits:e.loadVarUintBig(3),publicCells:e.loadVarUintBig(3)}},t.storeStorageUsed=function(e){return t=>{t.storeVarUint(e.cells,3),t.storeVarUint(e.bits,3),t.storeVarUint(e.publicCells,3)}}},1143:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.storeStorageUsedShort=t.loadStorageUsedShort=void 0,t.loadStorageUsedShort=function(e){return{cells:e.loadVarUintBig(3),bits:e.loadVarUintBig(3)}},t.storeStorageUsedShort=function(e){return t=>{t.storeVarUint(e.cells,3),t.storeVarUint(e.bits,3)}}},4599:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.storeTickTock=t.loadTickTock=void 0,t.loadTickTock=function(e){return{tick:e.loadBit(),tock:e.loadBit()}},t.storeTickTock=function(e){return t=>{t.storeBit(e.tick),t.storeBit(e.tock)}}},6305:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.storeTransaction=t.loadTransaction=void 0;const n=r(5871),i=r(7590),o=r(7676),s=r(574),a=r(4660),l=r(8178),c=r(3543);t.loadTransaction=function(e){let t=e.asCell();if(7!==e.loadUint(4))throw Error("Invalid data");let r=e.loadUintBig(256),n=e.loadUintBig(64),d=e.loadUintBig(256),u=e.loadUintBig(64),h=e.loadUint(32),f=e.loadUint(15),p=(0,o.loadAccountStatus)(e),g=(0,o.loadAccountStatus)(e),m=e.loadRef().beginParse(),y=m.loadBit()?(0,l.loadMessage)(m.loadRef().beginParse()):void 0,b=m.loadDict(i.Dictionary.Keys.Uint(15),l.MessageValue);return m.endParse(),{address:r,lt:n,prevTransactionHash:d,prevTransactionLt:u,now:h,outMessagesCount:f,oldStatus:p,endStatus:g,inMessage:y,outMessages:b,totalFees:(0,s.loadCurrencyCollection)(e),stateUpdate:(0,a.loadHashUpdate)(e.loadRef().beginParse()),description:(0,c.loadTransactionDescription)(e.loadRef().beginParse()),raw:t,hash:()=>t.hash()}},t.storeTransaction=function(e){return t=>{t.storeUint(7,4),t.storeUint(e.address,256),t.storeUint(e.lt,64),t.storeUint(e.prevTransactionHash,256),t.storeUint(e.prevTransactionLt,64),t.storeUint(e.now,32),t.storeUint(e.outMessagesCount,15),t.store((0,o.storeAccountStatus)(e.oldStatus)),t.store((0,o.storeAccountStatus)(e.endStatus));let r=(0,n.beginCell)();e.inMessage?(r.storeBit(!0),r.storeRef((0,n.beginCell)().store((0,l.storeMessage)(e.inMessage)))):r.storeBit(!1),r.storeDict(e.outMessages),t.storeRef(r),t.store((0,s.storeCurrencyCollection)(e.totalFees)),t.storeRef((0,n.beginCell)().store((0,a.storeHashUpdate)(e.stateUpdate))),t.storeRef((0,n.beginCell)().store((0,c.storeTransactionDescription)(e.description)))}}},464:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.storeTransactionActionPhase=t.loadTransactionActionPhase=void 0;const n=r(2312),i=r(1143);t.loadTransactionActionPhase=function(e){return{success:e.loadBit(),valid:e.loadBit(),noFunds:e.loadBit(),statusChange:(0,n.loadAccountStatusChange)(e),totalFwdFees:e.loadBit()?e.loadCoins():void 0,totalActionFees:e.loadBit()?e.loadCoins():void 0,resultCode:e.loadInt(32),resultArg:e.loadBit()?e.loadInt(32):void 0,totalActions:e.loadUint(16),specActions:e.loadUint(16),skippedActions:e.loadUint(16),messagesCreated:e.loadUint(16),actionListHash:e.loadUintBig(256),totalMessageSize:(0,i.loadStorageUsedShort)(e)}},t.storeTransactionActionPhase=function(e){return t=>{t.storeBit(e.success),t.storeBit(e.valid),t.storeBit(e.noFunds),t.store((0,n.storeAccountStatusChange)(e.statusChange)),t.storeMaybeCoins(e.totalFwdFees),t.storeMaybeCoins(e.totalActionFees),t.storeInt(e.resultCode,32),t.storeMaybeInt(e.resultArg,32),t.storeUint(e.totalActions,16),t.storeUint(e.specActions,16),t.storeUint(e.skippedActions,16),t.storeUint(e.messagesCreated,16),t.storeUint(e.actionListHash,256),t.store((0,i.storeStorageUsedShort)(e.totalMessageSize))}}},5726:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.storeTransactionBouncePhase=t.loadTransactionBouncePhase=void 0;const n=r(1143);t.loadTransactionBouncePhase=function(e){return e.loadBit()?{type:"ok",messageSize:(0,n.loadStorageUsedShort)(e),messageFees:e.loadCoins(),forwardFees:e.loadCoins()}:e.loadBit()?{type:"no-funds",messageSize:(0,n.loadStorageUsedShort)(e),requiredForwardFees:e.loadCoins()}:{type:"negative-funds"}},t.storeTransactionBouncePhase=function(e){return t=>{if("ok"===e.type)t.storeBit(!0),t.store((0,n.storeStorageUsedShort)(e.messageSize)),t.storeCoins(e.messageFees),t.storeCoins(e.forwardFees);else if("negative-funds"===e.type)t.storeBit(!1),t.storeBit(!1);else{if("no-funds"!==e.type)throw new Error("Invalid TransactionBouncePhase type");t.storeBit(!1),t.storeBit(!0),t.store((0,n.storeStorageUsedShort)(e.messageSize)),t.storeCoins(e.requiredForwardFees)}}}},3857:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.storeTransactionComputePhase=t.loadTransactionComputePhase=void 0;const n=r(5871),i=r(3471);t.loadTransactionComputePhase=function(e){if(!e.loadBit())return{type:"skipped",reason:(0,i.loadComputeSkipReason)(e)};let t=e.loadBit(),r=e.loadBit(),n=e.loadBit(),o=e.loadCoins();const s=e.loadRef().beginParse();return{type:"vm",success:t,messageStateUsed:r,accountActivated:n,gasFees:o,gasUsed:s.loadVarUintBig(3),gasLimit:s.loadVarUintBig(3),gasCredit:s.loadBit()?s.loadVarUintBig(2):void 0,mode:s.loadUint(8),exitCode:s.loadInt(32),exitArg:s.loadBit()?s.loadInt(32):void 0,vmSteps:s.loadUint(32),vmInitStateHash:s.loadUintBig(256),vmFinalStateHash:s.loadUintBig(256)}},t.storeTransactionComputePhase=function(e){return t=>{if("skipped"===e.type)return t.storeBit(0),void t.store((0,i.storeComputeSkipReason)(e.reason));t.storeBit(1),t.storeBit(e.success),t.storeBit(e.messageStateUsed),t.storeBit(e.accountActivated),t.storeCoins(e.gasFees),t.storeRef((0,n.beginCell)().storeVarUint(e.gasUsed,3).storeVarUint(e.gasLimit,3).store((t=>void 0!==e.gasCredit&&null!==e.gasCredit?t.storeBit(1).storeVarUint(e.gasCredit,2):t.storeBit(0))).storeUint(e.mode,8).storeInt(e.exitCode,32).store((t=>void 0!==e.exitArg&&null!==e.exitArg?t.storeBit(1).storeInt(e.exitArg,32):t.storeBit(0))).storeUint(e.vmSteps,32).storeUint(e.vmInitStateHash,256).storeUint(e.vmFinalStateHash,256).endCell())}}},1065:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.storeTransactionCreditPhase=t.loadTransactionCreditPhase=void 0;const n=r(574);t.loadTransactionCreditPhase=function(e){return{dueFeesColelcted:e.loadBit()?e.loadCoins():void 0,credit:(0,n.loadCurrencyCollection)(e)}},t.storeTransactionCreditPhase=function(e){return t=>{null===e.dueFeesColelcted||void 0===e.dueFeesColelcted?t.storeBit(!1):(t.storeBit(!0),t.storeCoins(e.dueFeesColelcted)),t.store((0,n.storeCurrencyCollection)(e.credit))}}},3543:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.storeTransactionDescription=t.loadTransactionDescription=void 0;const n=r(5871),i=r(9589),o=r(6305),s=r(464),a=r(5726),l=r(3857),c=r(1065),d=r(8353);t.loadTransactionDescription=function(e){let t=e.loadUint(4);if(0===t){const t=e.loadBit();let r,n;e.loadBit()&&(r=(0,d.loadTransactionStoragePhase)(e)),e.loadBit()&&(n=(0,c.loadTransactionCreditPhase)(e));let i,o=(0,l.loadTransactionComputePhase)(e);e.loadBit()&&(i=(0,s.loadTransactionActionPhase)(e.loadRef().beginParse()));let u,h=e.loadBit();return e.loadBit()&&(u=(0,a.loadTransactionBouncePhase)(e)),{type:"generic",creditFirst:t,storagePhase:r,creditPhase:n,computePhase:o,actionPhase:i,bouncePhase:u,aborted:h,destroyed:e.loadBit()}}if(1===t)return{type:"storage",storagePhase:(0,d.loadTransactionStoragePhase)(e)};if(2===t||3===t){const r=3===t;let n,i=(0,d.loadTransactionStoragePhase)(e),o=(0,l.loadTransactionComputePhase)(e);return e.loadBit()&&(n=(0,s.loadTransactionActionPhase)(e.loadRef().beginParse())),{type:"tick-tock",isTock:r,storagePhase:i,computePhase:o,actionPhase:n,aborted:e.loadBit(),destroyed:e.loadBit()}}if(4===t){let t,r=(0,i.loadSplitMergeInfo)(e);e.loadBit()&&(t=(0,d.loadTransactionStoragePhase)(e));let n,o=(0,l.loadTransactionComputePhase)(e);return e.loadBit()&&(n=(0,s.loadTransactionActionPhase)(e.loadRef().beginParse())),{type:"split-prepare",splitInfo:r,storagePhase:t,computePhase:o,actionPhase:n,aborted:e.loadBit(),destroyed:e.loadBit()}}if(5===t)return{type:"split-install",splitInfo:(0,i.loadSplitMergeInfo)(e),prepareTransaction:(0,o.loadTransaction)(e.loadRef().beginParse()),installed:e.loadBit()};throw Error(`Unsupported transaction description type ${t}`)},t.storeTransactionDescription=function(e){return t=>{if("generic"===e.type)t.storeUint(0,4),t.storeBit(e.creditFirst),e.storagePhase?(t.storeBit(!0),t.store((0,d.storeTransactionsStoragePhase)(e.storagePhase))):t.storeBit(!1),e.creditPhase?(t.storeBit(!0),t.store((0,c.storeTransactionCreditPhase)(e.creditPhase))):t.storeBit(!1),t.store((0,l.storeTransactionComputePhase)(e.computePhase)),e.actionPhase?(t.storeBit(!0),t.storeRef((0,n.beginCell)().store((0,s.storeTransactionActionPhase)(e.actionPhase)))):t.storeBit(!1),t.storeBit(e.aborted),e.bouncePhase?(t.storeBit(!0),t.store((0,a.storeTransactionBouncePhase)(e.bouncePhase))):t.storeBit(!1),t.storeBit(e.destroyed);else if("storage"===e.type)t.storeUint(1,4),t.store((0,d.storeTransactionsStoragePhase)(e.storagePhase));else if("tick-tock"===e.type)t.storeUint(e.isTock?3:2,4),t.store((0,d.storeTransactionsStoragePhase)(e.storagePhase)),t.store((0,l.storeTransactionComputePhase)(e.computePhase)),e.actionPhase?(t.storeBit(!0),t.storeRef((0,n.beginCell)().store((0,s.storeTransactionActionPhase)(e.actionPhase)))):t.storeBit(!1),t.storeBit(e.aborted),t.storeBit(e.destroyed);else if("split-prepare"===e.type)t.storeUint(4,4),t.store((0,i.storeSplitMergeInfo)(e.splitInfo)),e.storagePhase?(t.storeBit(!0),t.store((0,d.storeTransactionsStoragePhase)(e.storagePhase))):t.storeBit(!1),t.store((0,l.storeTransactionComputePhase)(e.computePhase)),e.actionPhase?(t.storeBit(!0),t.store((0,s.storeTransactionActionPhase)(e.actionPhase))):t.storeBit(!1),t.storeBit(e.aborted),t.storeBit(e.destroyed);else{if("split-install"!==e.type)throw Error(`Unsupported transaction description type ${e.type}`);t.storeUint(5,4),t.store((0,i.storeSplitMergeInfo)(e.splitInfo)),t.storeRef((0,n.beginCell)().store((0,o.storeTransaction)(e.prepareTransaction))),t.storeBit(e.installed)}}}},8353:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.storeTransactionsStoragePhase=t.loadTransactionStoragePhase=void 0;const n=r(2312);t.loadTransactionStoragePhase=function(e){const t=e.loadCoins();let r;return e.loadBit()&&(r=e.loadCoins()),{storageFeesCollected:t,storageFeesDue:r,statusChange:(0,n.loadAccountStatusChange)(e)}},t.storeTransactionsStoragePhase=function(e){return t=>{t.storeCoins(e.storageFeesCollected),null===e.storageFeesDue||void 0===e.storageFeesDue?t.storeBit(!1):(t.storeBit(!0),t.storeCoins(e.storageFeesDue)),t.store((0,n.storeAccountStatusChange)(e.statusChange))}}},3814:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.loadStorageInfo=t.storeStateInit=t.loadStateInit=t.storeSplitMergeInfo=t.loadSplitMergeInfo=t.storeSimpleLibrary=t.loadSimpleLibrary=t.loadShardStateUnsplit=t.storeShardIdent=t.loadShardIdent=t.storeShardAccounts=t.loadShardAccounts=t.ShardAccountRefValue=t.storeShardAccount=t.loadShardAccount=t.SendMode=t.storeMessageRelaxed=t.loadMessageRelaxed=t.storeMessage=t.loadMessage=t.loadMasterchainStateExtra=t.storeHashUpdate=t.loadHashUpdate=t.storeDepthBalanceInfo=t.loadDepthBalanceInfo=t.storeCurrencyCollection=t.loadCurrencyCollection=t.storeComputeSkipReason=t.loadComputeSkipReason=t.storeCommonMessageInfoRelaxed=t.loadCommonMessageInfoRelaxed=t.storeCommonMessageInfo=t.loadCommonMessageInfo=t.storeOutList=t.loadOutList=t.storeOutAction=t.loadOutAction=t.storeAccountStorage=t.loadAccountStorage=t.storeAccountStatusChange=t.loadAccountStatusChange=t.storeAccountStatus=t.loadAccountStatus=t.storeAccountState=t.loadAccountState=t.storeAccount=t.loadAccount=t.comment=t.external=t.internal=void 0,t.storeTransactionsStoragePhase=t.loadTransactionStoragePhase=t.storeTransactionDescription=t.loadTransactionDescription=t.storeTransactionCreditPhase=t.loadTransactionCreditPhase=t.storeTransactionComputePhase=t.loadTransactionComputePhase=t.storeTransactionBouncePhase=t.loadTransactionBouncePhase=t.storeTransactionActionPhase=t.loadTransactionActionPhase=t.storeTransaction=t.loadTransaction=t.storeTickTock=t.loadTickTock=t.storeStorageUsedShort=t.loadStorageUsedShort=t.storeStorageUsed=t.loadStorageUsed=t.storeStorageInfo=void 0;var n=r(9447);Object.defineProperty(t,"internal",{enumerable:!0,get:function(){return n.internal}}),Object.defineProperty(t,"external",{enumerable:!0,get:function(){return n.external}}),Object.defineProperty(t,"comment",{enumerable:!0,get:function(){return n.comment}});var i=r(2142);Object.defineProperty(t,"loadAccount",{enumerable:!0,get:function(){return i.loadAccount}}),Object.defineProperty(t,"storeAccount",{enumerable:!0,get:function(){return i.storeAccount}});var o=r(3049);Object.defineProperty(t,"loadAccountState",{enumerable:!0,get:function(){return o.loadAccountState}}),Object.defineProperty(t,"storeAccountState",{enumerable:!0,get:function(){return o.storeAccountState}});var s=r(7676);Object.defineProperty(t,"loadAccountStatus",{enumerable:!0,get:function(){return s.loadAccountStatus}}),Object.defineProperty(t,"storeAccountStatus",{enumerable:!0,get:function(){return s.storeAccountStatus}});var a=r(2312);Object.defineProperty(t,"loadAccountStatusChange",{enumerable:!0,get:function(){return a.loadAccountStatusChange}}),Object.defineProperty(t,"storeAccountStatusChange",{enumerable:!0,get:function(){return a.storeAccountStatusChange}});var l=r(6161);Object.defineProperty(t,"loadAccountStorage",{enumerable:!0,get:function(){return l.loadAccountStorage}}),Object.defineProperty(t,"storeAccountStorage",{enumerable:!0,get:function(){return l.storeAccountStorage}});var c=r(3101);Object.defineProperty(t,"loadOutAction",{enumerable:!0,get:function(){return c.loadOutAction}}),Object.defineProperty(t,"storeOutAction",{enumerable:!0,get:function(){return c.storeOutAction}}),Object.defineProperty(t,"loadOutList",{enumerable:!0,get:function(){return c.loadOutList}}),Object.defineProperty(t,"storeOutList",{enumerable:!0,get:function(){return c.storeOutList}});var d=r(445);Object.defineProperty(t,"loadCommonMessageInfo",{enumerable:!0,get:function(){return d.loadCommonMessageInfo}}),Object.defineProperty(t,"storeCommonMessageInfo",{enumerable:!0,get:function(){return d.storeCommonMessageInfo}});var u=r(2234);Object.defineProperty(t,"loadCommonMessageInfoRelaxed",{enumerable:!0,get:function(){return u.loadCommonMessageInfoRelaxed}}),Object.defineProperty(t,"storeCommonMessageInfoRelaxed",{enumerable:!0,get:function(){return u.storeCommonMessageInfoRelaxed}});var h=r(3471);Object.defineProperty(t,"loadComputeSkipReason",{enumerable:!0,get:function(){return h.loadComputeSkipReason}}),Object.defineProperty(t,"storeComputeSkipReason",{enumerable:!0,get:function(){return h.storeComputeSkipReason}});var f=r(574);Object.defineProperty(t,"loadCurrencyCollection",{enumerable:!0,get:function(){return f.loadCurrencyCollection}}),Object.defineProperty(t,"storeCurrencyCollection",{enumerable:!0,get:function(){return f.storeCurrencyCollection}});var p=r(4458);Object.defineProperty(t,"loadDepthBalanceInfo",{enumerable:!0,get:function(){return p.loadDepthBalanceInfo}}),Object.defineProperty(t,"storeDepthBalanceInfo",{enumerable:!0,get:function(){return p.storeDepthBalanceInfo}});var g=r(4660);Object.defineProperty(t,"loadHashUpdate",{enumerable:!0,get:function(){return g.loadHashUpdate}}),Object.defineProperty(t,"storeHashUpdate",{enumerable:!0,get:function(){return g.storeHashUpdate}});var m=r(9039);Object.defineProperty(t,"loadMasterchainStateExtra",{enumerable:!0,get:function(){return m.loadMasterchainStateExtra}});var y=r(8178);Object.defineProperty(t,"loadMessage",{enumerable:!0,get:function(){return y.loadMessage}}),Object.defineProperty(t,"storeMessage",{enumerable:!0,get:function(){return y.storeMessage}});var b=r(4143);Object.defineProperty(t,"loadMessageRelaxed",{enumerable:!0,get:function(){return b.loadMessageRelaxed}}),Object.defineProperty(t,"storeMessageRelaxed",{enumerable:!0,get:function(){return b.storeMessageRelaxed}});var w=r(4568);Object.defineProperty(t,"SendMode",{enumerable:!0,get:function(){return w.SendMode}});var v=r(594);Object.defineProperty(t,"loadShardAccount",{enumerable:!0,get:function(){return v.loadShardAccount}}),Object.defineProperty(t,"storeShardAccount",{enumerable:!0,get:function(){return v.storeShardAccount}});var C=r(8993);Object.defineProperty(t,"ShardAccountRefValue",{enumerable:!0,get:function(){return C.ShardAccountRefValue}}),Object.defineProperty(t,"loadShardAccounts",{enumerable:!0,get:function(){return C.loadShardAccounts}}),Object.defineProperty(t,"storeShardAccounts",{enumerable:!0,get:function(){return C.storeShardAccounts}});var _=r(2423);Object.defineProperty(t,"loadShardIdent",{enumerable:!0,get:function(){return _.loadShardIdent}}),Object.defineProperty(t,"storeShardIdent",{enumerable:!0,get:function(){return _.storeShardIdent}});var k=r(5787);Object.defineProperty(t,"loadShardStateUnsplit",{enumerable:!0,get:function(){return k.loadShardStateUnsplit}});var x=r(2672);Object.defineProperty(t,"loadSimpleLibrary",{enumerable:!0,get:function(){return x.loadSimpleLibrary}}),Object.defineProperty(t,"storeSimpleLibrary",{enumerable:!0,get:function(){return x.storeSimpleLibrary}});var A=r(9589);Object.defineProperty(t,"loadSplitMergeInfo",{enumerable:!0,get:function(){return A.loadSplitMergeInfo}}),Object.defineProperty(t,"storeSplitMergeInfo",{enumerable:!0,get:function(){return A.storeSplitMergeInfo}});var S=r(2738);Object.defineProperty(t,"loadStateInit",{enumerable:!0,get:function(){return S.loadStateInit}}),Object.defineProperty(t,"storeStateInit",{enumerable:!0,get:function(){return S.storeStateInit}});var B=r(5006);Object.defineProperty(t,"loadStorageInfo",{enumerable:!0,get:function(){return B.loadStorageInfo}}),Object.defineProperty(t,"storeStorageInfo",{enumerable:!0,get:function(){return B.storeStorageInfo}});var E=r(2577);Object.defineProperty(t,"loadStorageUsed",{enumerable:!0,get:function(){return E.loadStorageUsed}}),Object.defineProperty(t,"storeStorageUsed",{enumerable:!0,get:function(){return E.storeStorageUsed}});var I=r(1143);Object.defineProperty(t,"loadStorageUsedShort",{enumerable:!0,get:function(){return I.loadStorageUsedShort}}),Object.defineProperty(t,"storeStorageUsedShort",{enumerable:!0,get:function(){return I.storeStorageUsedShort}});var P=r(4599);Object.defineProperty(t,"loadTickTock",{enumerable:!0,get:function(){return P.loadTickTock}}),Object.defineProperty(t,"storeTickTock",{enumerable:!0,get:function(){return P.storeTickTock}});var M=r(6305);Object.defineProperty(t,"loadTransaction",{enumerable:!0,get:function(){return M.loadTransaction}}),Object.defineProperty(t,"storeTransaction",{enumerable:!0,get:function(){return M.storeTransaction}});var U=r(464);Object.defineProperty(t,"loadTransactionActionPhase",{enumerable:!0,get:function(){return U.loadTransactionActionPhase}}),Object.defineProperty(t,"storeTransactionActionPhase",{enumerable:!0,get:function(){return U.storeTransactionActionPhase}});var T=r(5726);Object.defineProperty(t,"loadTransactionBouncePhase",{enumerable:!0,get:function(){return T.loadTransactionBouncePhase}}),Object.defineProperty(t,"storeTransactionBouncePhase",{enumerable:!0,get:function(){return T.storeTransactionBouncePhase}});var O=r(3857);Object.defineProperty(t,"loadTransactionComputePhase",{enumerable:!0,get:function(){return O.loadTransactionComputePhase}}),Object.defineProperty(t,"storeTransactionComputePhase",{enumerable:!0,get:function(){return O.storeTransactionComputePhase}});var R=r(1065);Object.defineProperty(t,"loadTransactionCreditPhase",{enumerable:!0,get:function(){return R.loadTransactionCreditPhase}}),Object.defineProperty(t,"storeTransactionCreditPhase",{enumerable:!0,get:function(){return R.storeTransactionCreditPhase}});var j=r(3543);Object.defineProperty(t,"loadTransactionDescription",{enumerable:!0,get:function(){return j.loadTransactionDescription}}),Object.defineProperty(t,"storeTransactionDescription",{enumerable:!0,get:function(){return j.storeTransactionDescription}});var L=r(8353);Object.defineProperty(t,"loadTransactionStoragePhase",{enumerable:!0,get:function(){return L.loadTransactionStoragePhase}}),Object.defineProperty(t,"storeTransactionsStoragePhase",{enumerable:!0,get:function(){return L.storeTransactionsStoragePhase}})},9447:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.comment=t.external=t.internal=void 0;const n=r(3512),i=r(6902),o=r(5871),s=r(7070);t.internal=function(e){let t,r,a=!0;if(null!==e.bounce&&void 0!==e.bounce&&(a=e.bounce),"string"==typeof e.to)t=n.Address.parse(e.to);else{if(!n.Address.isAddress(e.to))throw new Error(`Invalid address ${e.to}`);t=e.to}r="string"==typeof e.value?(0,s.toNano)(e.value):e.value;let l=i.Cell.EMPTY;return"string"==typeof e.body?l=(0,o.beginCell)().storeUint(0,32).storeStringTail(e.body).endCell():e.body&&(l=e.body),{info:{type:"internal",dest:t,value:{coins:r},bounce:a,ihrDisabled:!0,bounced:!1,ihrFee:0n,forwardFee:0n,createdAt:0,createdLt:0n},init:e.init??void 0,body:l}},t.external=function(e){let t;if("string"==typeof e.to)t=n.Address.parse(e.to);else{if(!n.Address.isAddress(e.to))throw new Error(`Invalid address ${e.to}`);t=e.to}return{info:{type:"external-in",dest:t,importFee:0n},init:e.init??void 0,body:e.body||i.Cell.EMPTY}},t.comment=function(e){return(0,o.beginCell)().storeUint(0,32).storeStringTail(e).endCell()}},3721:(e,t,r)=>{"use strict";var n=r(8287).hp;Object.defineProperty(t,"__esModule",{value:!0}),t.base32Decode=t.base32Encode=void 0;const i="abcdefghijklmnopqrstuvwxyz234567";function o(e,t){const r=e.indexOf(t);if(-1===r)throw new Error("Invalid character found: "+t);return r}t.base32Encode=function(e){const t=e.byteLength;let r=0,n=0,o="";for(let s=0;s=5;)o+=i[n>>>r-5&31],r-=5;return r>0&&(o+=i[n<<5-r&31]),o},t.base32Decode=function(e){let t;t=e.toLowerCase();const{length:r}=t;let s=0,a=0,l=0;const c=n.alloc(5*r/8|0);for(let e=0;e=8&&(c[l++]=a>>>s-8&255,s-=8);return c}},6767:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bitsForNumber=void 0,t.bitsForNumber=function(e,t){let r=BigInt(e);if("int"===t)return 0n===r||-1n===r?1:(r>0?r:-r).toString(2).length+1;if("uint"===t){if(r<0)throw Error(`value is negative. Got ${e}`);return r.toString(2).length}throw Error(`invalid mode. Got ${t}`)}},7070:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fromNano=t.toNano=void 0,t.toNano=function(e){if("bigint"==typeof e)return 1000000000n*e;{if("number"==typeof e){if(!Number.isFinite(e))throw Error("Invalid number");if(Math.log10(e)<=6)e=e.toLocaleString("en",{minimumFractionDigits:9,useGrouping:!1});else{if(e-Math.trunc(e)!=0)throw Error("Not enough precision for a number value. Use string value instead");e=e.toLocaleString("en",{maximumFractionDigits:0,useGrouping:!1})}}let t=!1;for(;e.startsWith("-");)t=!t,e=e.slice(1);if("."===e)throw Error("Invalid number");let r=e.split(".");if(r.length>2)throw Error("Invalid number");let n=r[0],i=r[1];if(n||(n="0"),i||(i="0"),i.length>9)throw Error("Invalid number");for(;i.length<9;)i+="0";let o=1000000000n*BigInt(n)+BigInt(i);return t&&(o=-o),o}},t.fromNano=function(e){let t=BigInt(e),r=!1;t<0&&(r=!0,t=-t);let n=(t%1000000000n).toString();for(;n.length<9;)n="0"+n;n=n.match(/^([0-9]*[1-9]|0)(0*)/)[1];let i=`${(t/1000000000n).toString()}${"0"===n?"":`.${n}`}`;return r&&(i="-"+i),i}},2960:(e,t,r)=>{"use strict";var n=r(8287).hp;Object.defineProperty(t,"__esModule",{value:!0}),t.crc16=void 0,t.crc16=function(e){let t=0;const r=n.alloc(e.length+2);r.set(e);for(let e of r){let r=128;for(;r>0;)t<<=1,e&r&&(t+=1),r>>=1,t>65535&&(t&=65535,t^=4129)}return n.from([Math.floor(t/256),t%256])}},9429:(e,t,r)=>{"use strict";var n=r(8287).hp;Object.defineProperty(t,"__esModule",{value:!0}),t.crc32c=void 0;const i=2197175160;t.crc32c=function(e){let t=-1;for(let r=0;r>>1^i:t>>>1,t=1&t?t>>>1^i:t>>>1,t=1&t?t>>>1^i:t>>>1,t=1&t?t>>>1^i:t>>>1,t=1&t?t>>>1^i:t>>>1,t=1&t?t>>>1^i:t>>>1,t=1&t?t>>>1^i:t>>>1,t=1&t?t>>>1^i:t>>>1;t^=4294967295;let r=n.alloc(4);return r.writeInt32LE(t),r}},5149:(e,t,r)=>{"use strict";var n=r(8287).hp;Object.defineProperty(t,"__esModule",{value:!0}),t.getMethodId=void 0;const i=new Int16Array([0,4129,8258,12387,16516,20645,24774,28903,33032,37161,41290,45419,49548,53677,57806,61935,4657,528,12915,8786,21173,17044,29431,25302,37689,33560,45947,41818,54205,50076,62463,58334,9314,13379,1056,5121,25830,29895,17572,21637,42346,46411,34088,38153,58862,62927,50604,54669,13907,9842,5649,1584,30423,26358,22165,18100,46939,42874,38681,34616,63455,59390,55197,51132,18628,22757,26758,30887,2112,6241,10242,14371,51660,55789,59790,63919,35144,39273,43274,47403,23285,19156,31415,27286,6769,2640,14899,10770,56317,52188,64447,60318,39801,35672,47931,43802,27814,31879,19684,23749,11298,15363,3168,7233,60846,64911,52716,56781,44330,48395,36200,40265,32407,28342,24277,20212,15891,11826,7761,3696,65439,61374,57309,53244,48923,44858,40793,36728,37256,33193,45514,41451,53516,49453,61774,57711,4224,161,12482,8419,20484,16421,28742,24679,33721,37784,41979,46042,49981,54044,58239,62302,689,4752,8947,13010,16949,21012,25207,29270,46570,42443,38312,34185,62830,58703,54572,50445,13538,9411,5280,1153,29798,25671,21540,17413,42971,47098,34713,38840,59231,63358,50973,55100,9939,14066,1681,5808,26199,30326,17941,22068,55628,51565,63758,59695,39368,35305,47498,43435,22596,18533,30726,26663,6336,2273,14466,10403,52093,56156,60223,64286,35833,39896,43963,48026,19061,23124,27191,31254,2801,6864,10931,14994,64814,60687,56684,52557,48554,44427,40424,36297,31782,27655,23652,19525,15522,11395,7392,3265,61215,65342,53085,57212,44955,49082,36825,40952,28183,32310,20053,24180,11923,16050,3793,7920]);t.getMethodId=function(e){return 65535&function(e){e instanceof n||(e=n.from(e));let t=0;for(let r=0;r>8^n)]^t<<8)}return t}(e)|65536}},2370:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sha512=t.sha256=t.pbkdf2_sha512=t.hmac_sha512=t.getSecureRandomWords=t.getSecureRandomBytes=void 0;var n=r(6307);Object.defineProperty(t,"getSecureRandomBytes",{enumerable:!0,get:function(){return n.getSecureRandomBytes}}),Object.defineProperty(t,"getSecureRandomWords",{enumerable:!0,get:function(){return n.getSecureRandomWords}});var i=r(9967);Object.defineProperty(t,"hmac_sha512",{enumerable:!0,get:function(){return i.hmac_sha512}});var o=r(2441);Object.defineProperty(t,"pbkdf2_sha512",{enumerable:!0,get:function(){return o.pbkdf2_sha512}});var s=r(3150);Object.defineProperty(t,"sha256",{enumerable:!0,get:function(){return s.sha256}});var a=r(3999);Object.defineProperty(t,"sha512",{enumerable:!0,get:function(){return a.sha512}})},6307:(e,t,r)=>{"use strict";var n=r(8287).hp;Object.defineProperty(t,"__esModule",{value:!0}),t.getSecureRandomWords=t.getSecureRandomBytes=void 0,t.getSecureRandomBytes=function(e){return n.from(window.crypto.getRandomValues(new Uint8Array(e)))},t.getSecureRandomWords=function(e){return window.crypto.getRandomValues(new Uint16Array(e))}},9967:(e,t,r)=>{"use strict";var n=r(8287).hp;Object.defineProperty(t,"__esModule",{value:!0}),t.hmac_sha512=void 0,t.hmac_sha512=async function(e,t){let r="string"==typeof e?n.from(e,"utf-8"):e,i="string"==typeof t?n.from(t,"utf-8"):t;const o={name:"HMAC",hash:"SHA-512"},s=await window.crypto.subtle.importKey("raw",r,o,!1,["sign"]);return n.from(await crypto.subtle.sign(o,s,i))}},2441:(e,t,r)=>{"use strict";var n=r(8287).hp;Object.defineProperty(t,"__esModule",{value:!0}),t.pbkdf2_sha512=void 0,t.pbkdf2_sha512=async function(e,t,r,i){const o="string"==typeof e?n.from(e,"utf-8"):e,s="string"==typeof t?n.from(t,"utf-8"):t,a=await window.crypto.subtle.importKey("raw",o,{name:"PBKDF2"},!1,["deriveBits"]),l=await window.crypto.subtle.deriveBits({name:"PBKDF2",hash:"SHA-512",salt:s,iterations:r},a,8*i);return n.from(l)}},3150:(e,t,r)=>{"use strict";var n=r(8287).hp;Object.defineProperty(t,"__esModule",{value:!0}),t.sha256=void 0,t.sha256=async function(e){return"string"==typeof e?n.from(await crypto.subtle.digest("SHA-256",n.from(e,"utf-8"))):n.from(await crypto.subtle.digest("SHA-256",e))}},3999:(e,t,r)=>{"use strict";var n=r(8287).hp;Object.defineProperty(t,"__esModule",{value:!0}),t.sha512=void 0,t.sha512=async function(e){return"string"==typeof e?n.from(await crypto.subtle.digest("SHA-512",n.from(e,"utf-8"))):n.from(await crypto.subtle.digest("SHA-512",e))}},5735:(e,t,r)=>{"use strict";var n=r(8287).hp;Object.defineProperty(t,"__esModule",{value:!0}),t.deriveEd25519Path=t.deriveED25519HardenedKey=t.getED25519MasterKeyFromSeed=void 0;const i=r(4870),o=2147483648;async function s(e){const t=await(0,i.hmac_sha512)("ed25519 seed",e);return{key:t.slice(0,32),chainCode:t.slice(32)}}async function a(e,t){if(t>=o)throw Error("Key index must be less than offset");const r=n.alloc(4);r.writeUInt32BE(t+o,0);const s=n.concat([n.alloc(1,0),e.key,r]),a=await(0,i.hmac_sha512)(e.chainCode,s);return{key:a.slice(0,32),chainCode:a.slice(32)}}t.getED25519MasterKeyFromSeed=s,t.deriveED25519HardenedKey=a,t.deriveEd25519Path=async function(e,t){let r=await s(e),n=[...t];for(;n.length>0;){let e=n[0];n=n.slice(1),r=await a(r,e)}return r.key}},6815:(e,t,r)=>{"use strict";var n=r(8287).hp;Object.defineProperty(t,"__esModule",{value:!0}),t.deriveMnemonicsPath=t.deriveMnemonicHardenedKey=t.getMnemonicsMasterKeyFromSeed=void 0;const i=r(132),o=r(4870),s=2147483648;async function a(e){const t=await(0,o.hmac_sha512)("TON Mnemonics HD seed",e);return{key:t.slice(0,32),chainCode:t.slice(32)}}async function l(e,t){if(t>=s)throw Error("Key index must be less than offset");const r=n.alloc(4);r.writeUInt32BE(t+s,0);const i=n.concat([n.alloc(1,0),e.key,r]),a=await(0,o.hmac_sha512)(e.chainCode,i);return{key:a.slice(0,32),chainCode:a.slice(32)}}t.getMnemonicsMasterKeyFromSeed=a,t.deriveMnemonicHardenedKey=l,t.deriveMnemonicsPath=async function(e,t,r=24,n){let o=await a(e),s=[...t];for(;s.length>0;){let e=s[0];s=s.slice(1),o=await l(o,e)}return await(0,i.mnemonicFromRandomSeed)(o.key,r,n)}},8117:(e,t,r)=>{"use strict";var n=r(8287).hp;Object.defineProperty(t,"__esModule",{value:!0}),t.deriveSymmetricPath=t.deriveSymmetricHardenedKey=t.getSymmetricMasterKeyFromSeed=void 0;const i=r(4870);async function o(e){const t=await(0,i.hmac_sha512)("Symmetric key seed",e);return{key:t.slice(32),chainCode:t.slice(0,32)}}async function s(e,t){const r=n.concat([n.alloc(1,0),n.from(t)]),o=await(0,i.hmac_sha512)(e.chainCode,r);return{key:o.slice(32),chainCode:o.slice(0,32)}}t.getSymmetricMasterKeyFromSeed=o,t.deriveSymmetricHardenedKey=s,t.deriveSymmetricPath=async function(e,t){let r=await o(e),n=[...t];for(;n.length>0;){let e=n[0];n=n.slice(1),r=await s(r,e)}return r.key}},5269:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getMnemonicsMasterKeyFromSeed=t.deriveMnemonicHardenedKey=t.deriveMnemonicsPath=t.deriveSymmetricPath=t.deriveSymmetricHardenedKey=t.getSymmetricMasterKeyFromSeed=t.deriveEd25519Path=t.deriveED25519HardenedKey=t.getED25519MasterKeyFromSeed=t.signVerify=t.sign=t.keyPairFromSecretKey=t.keyPairFromSeed=t.openBox=t.sealBox=t.mnemonicWordList=t.mnemonicToHDSeed=t.mnemonicToSeed=t.mnemonicToWalletKey=t.mnemonicToPrivateKey=t.mnemonicValidate=t.mnemonicNew=t.newSecurePassphrase=t.newSecureWords=t.getSecureRandomNumber=t.getSecureRandomWords=t.getSecureRandomBytes=t.hmac_sha512=t.pbkdf2_sha512=t.sha512_sync=t.sha512=t.sha256_sync=t.sha256=void 0;var n=r(3269);Object.defineProperty(t,"sha256",{enumerable:!0,get:function(){return n.sha256}}),Object.defineProperty(t,"sha256_sync",{enumerable:!0,get:function(){return n.sha256_sync}});var i=r(6224);Object.defineProperty(t,"sha512",{enumerable:!0,get:function(){return i.sha512}}),Object.defineProperty(t,"sha512_sync",{enumerable:!0,get:function(){return i.sha512_sync}});var o=r(9256);Object.defineProperty(t,"pbkdf2_sha512",{enumerable:!0,get:function(){return o.pbkdf2_sha512}});var s=r(4870);Object.defineProperty(t,"hmac_sha512",{enumerable:!0,get:function(){return s.hmac_sha512}});var a=r(1682);Object.defineProperty(t,"getSecureRandomBytes",{enumerable:!0,get:function(){return a.getSecureRandomBytes}}),Object.defineProperty(t,"getSecureRandomWords",{enumerable:!0,get:function(){return a.getSecureRandomWords}}),Object.defineProperty(t,"getSecureRandomNumber",{enumerable:!0,get:function(){return a.getSecureRandomNumber}});var l=r(6622);Object.defineProperty(t,"newSecureWords",{enumerable:!0,get:function(){return l.newSecureWords}});var c=r(2279);Object.defineProperty(t,"newSecurePassphrase",{enumerable:!0,get:function(){return c.newSecurePassphrase}});var d=r(132);Object.defineProperty(t,"mnemonicNew",{enumerable:!0,get:function(){return d.mnemonicNew}}),Object.defineProperty(t,"mnemonicValidate",{enumerable:!0,get:function(){return d.mnemonicValidate}}),Object.defineProperty(t,"mnemonicToPrivateKey",{enumerable:!0,get:function(){return d.mnemonicToPrivateKey}}),Object.defineProperty(t,"mnemonicToWalletKey",{enumerable:!0,get:function(){return d.mnemonicToWalletKey}}),Object.defineProperty(t,"mnemonicToSeed",{enumerable:!0,get:function(){return d.mnemonicToSeed}}),Object.defineProperty(t,"mnemonicToHDSeed",{enumerable:!0,get:function(){return d.mnemonicToHDSeed}});var u=r(4436);Object.defineProperty(t,"mnemonicWordList",{enumerable:!0,get:function(){return u.wordlist}});var h=r(7796);Object.defineProperty(t,"sealBox",{enumerable:!0,get:function(){return h.sealBox}}),Object.defineProperty(t,"openBox",{enumerable:!0,get:function(){return h.openBox}});var f=r(7796);Object.defineProperty(t,"keyPairFromSeed",{enumerable:!0,get:function(){return f.keyPairFromSeed}}),Object.defineProperty(t,"keyPairFromSecretKey",{enumerable:!0,get:function(){return f.keyPairFromSecretKey}}),Object.defineProperty(t,"sign",{enumerable:!0,get:function(){return f.sign}}),Object.defineProperty(t,"signVerify",{enumerable:!0,get:function(){return f.signVerify}});var p=r(5735);Object.defineProperty(t,"getED25519MasterKeyFromSeed",{enumerable:!0,get:function(){return p.getED25519MasterKeyFromSeed}}),Object.defineProperty(t,"deriveED25519HardenedKey",{enumerable:!0,get:function(){return p.deriveED25519HardenedKey}}),Object.defineProperty(t,"deriveEd25519Path",{enumerable:!0,get:function(){return p.deriveEd25519Path}});var g=r(8117);Object.defineProperty(t,"getSymmetricMasterKeyFromSeed",{enumerable:!0,get:function(){return g.getSymmetricMasterKeyFromSeed}}),Object.defineProperty(t,"deriveSymmetricHardenedKey",{enumerable:!0,get:function(){return g.deriveSymmetricHardenedKey}}),Object.defineProperty(t,"deriveSymmetricPath",{enumerable:!0,get:function(){return g.deriveSymmetricPath}});var m=r(6815);Object.defineProperty(t,"deriveMnemonicsPath",{enumerable:!0,get:function(){return m.deriveMnemonicsPath}}),Object.defineProperty(t,"deriveMnemonicHardenedKey",{enumerable:!0,get:function(){return m.deriveMnemonicHardenedKey}}),Object.defineProperty(t,"getMnemonicsMasterKeyFromSeed",{enumerable:!0,get:function(){return m.getMnemonicsMasterKeyFromSeed}})},132:function(e,t,r){"use strict";var n=r(8287).hp,i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.mnemonicFromRandomSeed=t.mnemonicIndexesToBytes=t.bytesToMnemonics=t.bytesToMnemonicIndexes=t.mnemonicNew=t.mnemonicValidate=t.mnemonicToHDSeed=t.mnemonicToWalletKey=t.mnemonicToPrivateKey=t.mnemonicToSeed=t.mnemonicToEntropy=void 0;const o=i(r(8947)),s=r(1682),a=r(4870),l=r(9256),c=r(2202),d=r(4436),u=1e5;async function h(e){const t=await g(e);return await async function(e){return 1==(await(0,l.pbkdf2_sha512)(e,"TON fast seed version",1,64))[0]}(t)&&!await p(t)}function f(e){return e.map((e=>e.toLowerCase().trim()))}async function p(e){return 0==(await(0,l.pbkdf2_sha512)(e,"TON seed version",Math.max(1,Math.floor(u/256)),64))[0]}async function g(e,t){return await(0,a.hmac_sha512)(e.join(" "),t&&t.length>0?t:"")}async function m(e,t,r){const n=await g(e,r);return await(0,l.pbkdf2_sha512)(n,t,u,64)}async function y(e,t){e=f(e);const r=await m(e,"TON default seed",t);let i=o.default.sign.keyPair.fromSeed(r.slice(0,32));return{publicKey:n.from(i.publicKey),secretKey:n.from(i.secretKey)}}async function b(e,t){e=f(e);for(let t of e)if(d.wordlist.indexOf(t)<0)return!1;return!(t&&t.length>0&&!await h(e))&&await p(await g(e,t))}function w(e,t){let r=(0,c.bytesToBits)(e),n=[];for(let e=0;e0)||await h(r))&&await p(await g(r,t)))break}return r},t.bytesToMnemonicIndexes=w,t.bytesToMnemonics=v,t.mnemonicIndexesToBytes=function(e){let t="";for(let r of e){if(!Number.isSafeInteger(r))throw Error("Invalid input");if(r<0||r>=2028)throw Error("Invalid input");t+=(0,c.lpad)(r.toString(2),"0",11)}for(;t.length%8!=0;)t+="0";return(0,c.bitsToBytes)(t)},t.mnemonicFromRandomSeed=async function(e,t=24,r){const n=Math.ceil(11*t/8);let i=e;for(;;){let e=await(0,l.pbkdf2_sha512)(i,"TON mnemonic seed",Math.max(1,Math.floor(u/256)),n),o=v(e,t);if(await b(o,r))return o;i=e}}},4436:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.wordlist=void 0,t.wordlist=["abandon","ability","able","about","above","absent","absorb","abstract","absurd","abuse","access","accident","account","accuse","achieve","acid","acoustic","acquire","across","act","action","actor","actress","actual","adapt","add","addict","address","adjust","admit","adult","advance","advice","aerobic","affair","afford","afraid","again","age","agent","agree","ahead","aim","air","airport","aisle","alarm","album","alcohol","alert","alien","all","alley","allow","almost","alone","alpha","already","also","alter","always","amateur","amazing","among","amount","amused","analyst","anchor","ancient","anger","angle","angry","animal","ankle","announce","annual","another","answer","antenna","antique","anxiety","any","apart","apology","appear","apple","approve","april","arch","arctic","area","arena","argue","arm","armed","armor","army","around","arrange","arrest","arrive","arrow","art","artefact","artist","artwork","ask","aspect","assault","asset","assist","assume","asthma","athlete","atom","attack","attend","attitude","attract","auction","audit","august","aunt","author","auto","autumn","average","avocado","avoid","awake","aware","away","awesome","awful","awkward","axis","baby","bachelor","bacon","badge","bag","balance","balcony","ball","bamboo","banana","banner","bar","barely","bargain","barrel","base","basic","basket","battle","beach","bean","beauty","because","become","beef","before","begin","behave","behind","believe","below","belt","bench","benefit","best","betray","better","between","beyond","bicycle","bid","bike","bind","biology","bird","birth","bitter","black","blade","blame","blanket","blast","bleak","bless","blind","blood","blossom","blouse","blue","blur","blush","board","boat","body","boil","bomb","bone","bonus","book","boost","border","boring","borrow","boss","bottom","bounce","box","boy","bracket","brain","brand","brass","brave","bread","breeze","brick","bridge","brief","bright","bring","brisk","broccoli","broken","bronze","broom","brother","brown","brush","bubble","buddy","budget","buffalo","build","bulb","bulk","bullet","bundle","bunker","burden","burger","burst","bus","business","busy","butter","buyer","buzz","cabbage","cabin","cable","cactus","cage","cake","call","calm","camera","camp","can","canal","cancel","candy","cannon","canoe","canvas","canyon","capable","capital","captain","car","carbon","card","cargo","carpet","carry","cart","case","cash","casino","castle","casual","cat","catalog","catch","category","cattle","caught","cause","caution","cave","ceiling","celery","cement","census","century","cereal","certain","chair","chalk","champion","change","chaos","chapter","charge","chase","chat","cheap","check","cheese","chef","cherry","chest","chicken","chief","child","chimney","choice","choose","chronic","chuckle","chunk","churn","cigar","cinnamon","circle","citizen","city","civil","claim","clap","clarify","claw","clay","clean","clerk","clever","click","client","cliff","climb","clinic","clip","clock","clog","close","cloth","cloud","clown","club","clump","cluster","clutch","coach","coast","coconut","code","coffee","coil","coin","collect","color","column","combine","come","comfort","comic","common","company","concert","conduct","confirm","congress","connect","consider","control","convince","cook","cool","copper","copy","coral","core","corn","correct","cost","cotton","couch","country","couple","course","cousin","cover","coyote","crack","cradle","craft","cram","crane","crash","crater","crawl","crazy","cream","credit","creek","crew","cricket","crime","crisp","critic","crop","cross","crouch","crowd","crucial","cruel","cruise","crumble","crunch","crush","cry","crystal","cube","culture","cup","cupboard","curious","current","curtain","curve","cushion","custom","cute","cycle","dad","damage","damp","dance","danger","daring","dash","daughter","dawn","day","deal","debate","debris","decade","december","decide","decline","decorate","decrease","deer","defense","define","defy","degree","delay","deliver","demand","demise","denial","dentist","deny","depart","depend","deposit","depth","deputy","derive","describe","desert","design","desk","despair","destroy","detail","detect","develop","device","devote","diagram","dial","diamond","diary","dice","diesel","diet","differ","digital","dignity","dilemma","dinner","dinosaur","direct","dirt","disagree","discover","disease","dish","dismiss","disorder","display","distance","divert","divide","divorce","dizzy","doctor","document","dog","doll","dolphin","domain","donate","donkey","donor","door","dose","double","dove","draft","dragon","drama","drastic","draw","dream","dress","drift","drill","drink","drip","drive","drop","drum","dry","duck","dumb","dune","during","dust","dutch","duty","dwarf","dynamic","eager","eagle","early","earn","earth","easily","east","easy","echo","ecology","economy","edge","edit","educate","effort","egg","eight","either","elbow","elder","electric","elegant","element","elephant","elevator","elite","else","embark","embody","embrace","emerge","emotion","employ","empower","empty","enable","enact","end","endless","endorse","enemy","energy","enforce","engage","engine","enhance","enjoy","enlist","enough","enrich","enroll","ensure","enter","entire","entry","envelope","episode","equal","equip","era","erase","erode","erosion","error","erupt","escape","essay","essence","estate","eternal","ethics","evidence","evil","evoke","evolve","exact","example","excess","exchange","excite","exclude","excuse","execute","exercise","exhaust","exhibit","exile","exist","exit","exotic","expand","expect","expire","explain","expose","express","extend","extra","eye","eyebrow","fabric","face","faculty","fade","faint","faith","fall","false","fame","family","famous","fan","fancy","fantasy","farm","fashion","fat","fatal","father","fatigue","fault","favorite","feature","february","federal","fee","feed","feel","female","fence","festival","fetch","fever","few","fiber","fiction","field","figure","file","film","filter","final","find","fine","finger","finish","fire","firm","first","fiscal","fish","fit","fitness","fix","flag","flame","flash","flat","flavor","flee","flight","flip","float","flock","floor","flower","fluid","flush","fly","foam","focus","fog","foil","fold","follow","food","foot","force","forest","forget","fork","fortune","forum","forward","fossil","foster","found","fox","fragile","frame","frequent","fresh","friend","fringe","frog","front","frost","frown","frozen","fruit","fuel","fun","funny","furnace","fury","future","gadget","gain","galaxy","gallery","game","gap","garage","garbage","garden","garlic","garment","gas","gasp","gate","gather","gauge","gaze","general","genius","genre","gentle","genuine","gesture","ghost","giant","gift","giggle","ginger","giraffe","girl","give","glad","glance","glare","glass","glide","glimpse","globe","gloom","glory","glove","glow","glue","goat","goddess","gold","good","goose","gorilla","gospel","gossip","govern","gown","grab","grace","grain","grant","grape","grass","gravity","great","green","grid","grief","grit","grocery","group","grow","grunt","guard","guess","guide","guilt","guitar","gun","gym","habit","hair","half","hammer","hamster","hand","happy","harbor","hard","harsh","harvest","hat","have","hawk","hazard","head","health","heart","heavy","hedgehog","height","hello","helmet","help","hen","hero","hidden","high","hill","hint","hip","hire","history","hobby","hockey","hold","hole","holiday","hollow","home","honey","hood","hope","horn","horror","horse","hospital","host","hotel","hour","hover","hub","huge","human","humble","humor","hundred","hungry","hunt","hurdle","hurry","hurt","husband","hybrid","ice","icon","idea","identify","idle","ignore","ill","illegal","illness","image","imitate","immense","immune","impact","impose","improve","impulse","inch","include","income","increase","index","indicate","indoor","industry","infant","inflict","inform","inhale","inherit","initial","inject","injury","inmate","inner","innocent","input","inquiry","insane","insect","inside","inspire","install","intact","interest","into","invest","invite","involve","iron","island","isolate","issue","item","ivory","jacket","jaguar","jar","jazz","jealous","jeans","jelly","jewel","job","join","joke","journey","joy","judge","juice","jump","jungle","junior","junk","just","kangaroo","keen","keep","ketchup","key","kick","kid","kidney","kind","kingdom","kiss","kit","kitchen","kite","kitten","kiwi","knee","knife","knock","know","lab","label","labor","ladder","lady","lake","lamp","language","laptop","large","later","latin","laugh","laundry","lava","law","lawn","lawsuit","layer","lazy","leader","leaf","learn","leave","lecture","left","leg","legal","legend","leisure","lemon","lend","length","lens","leopard","lesson","letter","level","liar","liberty","library","license","life","lift","light","like","limb","limit","link","lion","liquid","list","little","live","lizard","load","loan","lobster","local","lock","logic","lonely","long","loop","lottery","loud","lounge","love","loyal","lucky","luggage","lumber","lunar","lunch","luxury","lyrics","machine","mad","magic","magnet","maid","mail","main","major","make","mammal","man","manage","mandate","mango","mansion","manual","maple","marble","march","margin","marine","market","marriage","mask","mass","master","match","material","math","matrix","matter","maximum","maze","meadow","mean","measure","meat","mechanic","medal","media","melody","melt","member","memory","mention","menu","mercy","merge","merit","merry","mesh","message","metal","method","middle","midnight","milk","million","mimic","mind","minimum","minor","minute","miracle","mirror","misery","miss","mistake","mix","mixed","mixture","mobile","model","modify","mom","moment","monitor","monkey","monster","month","moon","moral","more","morning","mosquito","mother","motion","motor","mountain","mouse","move","movie","much","muffin","mule","multiply","muscle","museum","mushroom","music","must","mutual","myself","mystery","myth","naive","name","napkin","narrow","nasty","nation","nature","near","neck","need","negative","neglect","neither","nephew","nerve","nest","net","network","neutral","never","news","next","nice","night","noble","noise","nominee","noodle","normal","north","nose","notable","note","nothing","notice","novel","now","nuclear","number","nurse","nut","oak","obey","object","oblige","obscure","observe","obtain","obvious","occur","ocean","october","odor","off","offer","office","often","oil","okay","old","olive","olympic","omit","once","one","onion","online","only","open","opera","opinion","oppose","option","orange","orbit","orchard","order","ordinary","organ","orient","original","orphan","ostrich","other","outdoor","outer","output","outside","oval","oven","over","own","owner","oxygen","oyster","ozone","pact","paddle","page","pair","palace","palm","panda","panel","panic","panther","paper","parade","parent","park","parrot","party","pass","patch","path","patient","patrol","pattern","pause","pave","payment","peace","peanut","pear","peasant","pelican","pen","penalty","pencil","people","pepper","perfect","permit","person","pet","phone","photo","phrase","physical","piano","picnic","picture","piece","pig","pigeon","pill","pilot","pink","pioneer","pipe","pistol","pitch","pizza","place","planet","plastic","plate","play","please","pledge","pluck","plug","plunge","poem","poet","point","polar","pole","police","pond","pony","pool","popular","portion","position","possible","post","potato","pottery","poverty","powder","power","practice","praise","predict","prefer","prepare","present","pretty","prevent","price","pride","primary","print","priority","prison","private","prize","problem","process","produce","profit","program","project","promote","proof","property","prosper","protect","proud","provide","public","pudding","pull","pulp","pulse","pumpkin","punch","pupil","puppy","purchase","purity","purpose","purse","push","put","puzzle","pyramid","quality","quantum","quarter","question","quick","quit","quiz","quote","rabbit","raccoon","race","rack","radar","radio","rail","rain","raise","rally","ramp","ranch","random","range","rapid","rare","rate","rather","raven","raw","razor","ready","real","reason","rebel","rebuild","recall","receive","recipe","record","recycle","reduce","reflect","reform","refuse","region","regret","regular","reject","relax","release","relief","rely","remain","remember","remind","remove","render","renew","rent","reopen","repair","repeat","replace","report","require","rescue","resemble","resist","resource","response","result","retire","retreat","return","reunion","reveal","review","reward","rhythm","rib","ribbon","rice","rich","ride","ridge","rifle","right","rigid","ring","riot","ripple","risk","ritual","rival","river","road","roast","robot","robust","rocket","romance","roof","rookie","room","rose","rotate","rough","round","route","royal","rubber","rude","rug","rule","run","runway","rural","sad","saddle","sadness","safe","sail","salad","salmon","salon","salt","salute","same","sample","sand","satisfy","satoshi","sauce","sausage","save","say","scale","scan","scare","scatter","scene","scheme","school","science","scissors","scorpion","scout","scrap","screen","script","scrub","sea","search","season","seat","second","secret","section","security","seed","seek","segment","select","sell","seminar","senior","sense","sentence","series","service","session","settle","setup","seven","shadow","shaft","shallow","share","shed","shell","sheriff","shield","shift","shine","ship","shiver","shock","shoe","shoot","shop","short","shoulder","shove","shrimp","shrug","shuffle","shy","sibling","sick","side","siege","sight","sign","silent","silk","silly","silver","similar","simple","since","sing","siren","sister","situate","six","size","skate","sketch","ski","skill","skin","skirt","skull","slab","slam","sleep","slender","slice","slide","slight","slim","slogan","slot","slow","slush","small","smart","smile","smoke","smooth","snack","snake","snap","sniff","snow","soap","soccer","social","sock","soda","soft","solar","soldier","solid","solution","solve","someone","song","soon","sorry","sort","soul","sound","soup","source","south","space","spare","spatial","spawn","speak","special","speed","spell","spend","sphere","spice","spider","spike","spin","spirit","split","spoil","sponsor","spoon","sport","spot","spray","spread","spring","spy","square","squeeze","squirrel","stable","stadium","staff","stage","stairs","stamp","stand","start","state","stay","steak","steel","stem","step","stereo","stick","still","sting","stock","stomach","stone","stool","story","stove","strategy","street","strike","strong","struggle","student","stuff","stumble","style","subject","submit","subway","success","such","sudden","suffer","sugar","suggest","suit","summer","sun","sunny","sunset","super","supply","supreme","sure","surface","surge","surprise","surround","survey","suspect","sustain","swallow","swamp","swap","swarm","swear","sweet","swift","swim","swing","switch","sword","symbol","symptom","syrup","system","table","tackle","tag","tail","talent","talk","tank","tape","target","task","taste","tattoo","taxi","teach","team","tell","ten","tenant","tennis","tent","term","test","text","thank","that","theme","then","theory","there","they","thing","this","thought","three","thrive","throw","thumb","thunder","ticket","tide","tiger","tilt","timber","time","tiny","tip","tired","tissue","title","toast","tobacco","today","toddler","toe","together","toilet","token","tomato","tomorrow","tone","tongue","tonight","tool","tooth","top","topic","topple","torch","tornado","tortoise","toss","total","tourist","toward","tower","town","toy","track","trade","traffic","tragic","train","transfer","trap","trash","travel","tray","treat","tree","trend","trial","tribe","trick","trigger","trim","trip","trophy","trouble","truck","true","truly","trumpet","trust","truth","try","tube","tuition","tumble","tuna","tunnel","turkey","turn","turtle","twelve","twenty","twice","twin","twist","two","type","typical","ugly","umbrella","unable","unaware","uncle","uncover","under","undo","unfair","unfold","unhappy","uniform","unique","unit","universe","unknown","unlock","until","unusual","unveil","update","upgrade","uphold","upon","upper","upset","urban","urge","usage","use","used","useful","useless","usual","utility","vacant","vacuum","vague","valid","valley","valve","van","vanish","vapor","various","vast","vault","vehicle","velvet","vendor","venture","venue","verb","verify","version","very","vessel","veteran","viable","vibrant","vicious","victory","video","view","village","vintage","violin","virtual","virus","visa","visit","visual","vital","vivid","vocal","voice","void","volcano","volume","vote","voyage","wage","wagon","wait","walk","wall","walnut","want","warfare","warm","warrior","wash","wasp","waste","water","wave","way","wealth","weapon","wear","weasel","weather","web","wedding","weekend","weird","welcome","west","wet","whale","what","wheat","wheel","when","where","whip","whisper","wide","width","wife","wild","will","win","window","wine","wing","wink","winner","winter","wire","wisdom","wise","wish","witness","wolf","woman","wonder","wood","wool","word","work","world","worry","worth","wrap","wreck","wrestle","wrist","write","wrong","yard","year","yellow","you","young","youth","zebra","zero","zone","zoo"]},2279:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.newSecurePassphrase=void 0;const n=r(5269);t.newSecurePassphrase=async function(e=6){return(await(0,n.newSecureWords)(e)).join("-")}},6622:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.newSecureWords=void 0;const n=r(1682),i=r(706);t.newSecureWords=async function(e=6){let t=[];for(let r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.wordlist=void 0,t.wordlist=["abacus","abdomen","abdominal","abide","abiding","ability","ablaze","able","abnormal","abrasion","abrasive","abreast","abridge","abroad","abruptly","absence","absentee","absently","absinthe","absolute","absolve","abstain","abstract","absurd","accent","acclaim","acclimate","accompany","account","accuracy","accurate","accustom","acetone","achiness","aching","acid","acorn","acquaint","acquire","acre","acrobat","acronym","acting","action","activate","activator","active","activism","activist","activity","actress","acts","acutely","acuteness","aeration","aerobics","aerosol","aerospace","afar","affair","affected","affecting","affection","affidavit","affiliate","affirm","affix","afflicted","affluent","afford","affront","aflame","afloat","aflutter","afoot","afraid","afterglow","afterlife","aftermath","aftermost","afternoon","aged","ageless","agency","agenda","agent","aggregate","aghast","agile","agility","aging","agnostic","agonize","agonizing","agony","agreeable","agreeably","agreed","agreeing","agreement","aground","ahead","ahoy","aide","aids","aim","ajar","alabaster","alarm","albatross","album","alfalfa","algebra","algorithm","alias","alibi","alienable","alienate","aliens","alike","alive","alkaline","alkalize","almanac","almighty","almost","aloe","aloft","aloha","alone","alongside","aloof","alphabet","alright","although","altitude","alto","aluminum","alumni","always","amaretto","amaze","amazingly","amber","ambiance","ambiguity","ambiguous","ambition","ambitious","ambulance","ambush","amendable","amendment","amends","amenity","amiable","amicably","amid","amigo","amino","amiss","ammonia","ammonium","amnesty","amniotic","among","amount","amperage","ample","amplifier","amplify","amply","amuck","amulet","amusable","amused","amusement","amuser","amusing","anaconda","anaerobic","anagram","anatomist","anatomy","anchor","anchovy","ancient","android","anemia","anemic","aneurism","anew","angelfish","angelic","anger","angled","angler","angles","angling","angrily","angriness","anguished","angular","animal","animate","animating","animation","animator","anime","animosity","ankle","annex","annotate","announcer","annoying","annually","annuity","anointer","another","answering","antacid","antarctic","anteater","antelope","antennae","anthem","anthill","anthology","antibody","antics","antidote","antihero","antiquely","antiques","antiquity","antirust","antitoxic","antitrust","antiviral","antivirus","antler","antonym","antsy","anvil","anybody","anyhow","anymore","anyone","anyplace","anything","anytime","anyway","anywhere","aorta","apache","apostle","appealing","appear","appease","appeasing","appendage","appendix","appetite","appetizer","applaud","applause","apple","appliance","applicant","applied","apply","appointee","appraisal","appraiser","apprehend","approach","approval","approve","apricot","april","apron","aptitude","aptly","aqua","aqueduct","arbitrary","arbitrate","ardently","area","arena","arguable","arguably","argue","arise","armadillo","armband","armchair","armed","armful","armhole","arming","armless","armoire","armored","armory","armrest","army","aroma","arose","around","arousal","arrange","array","arrest","arrival","arrive","arrogance","arrogant","arson","art","ascend","ascension","ascent","ascertain","ashamed","ashen","ashes","ashy","aside","askew","asleep","asparagus","aspect","aspirate","aspire","aspirin","astonish","astound","astride","astrology","astronaut","astronomy","astute","atlantic","atlas","atom","atonable","atop","atrium","atrocious","atrophy","attach","attain","attempt","attendant","attendee","attention","attentive","attest","attic","attire","attitude","attractor","attribute","atypical","auction","audacious","audacity","audible","audibly","audience","audio","audition","augmented","august","authentic","author","autism","autistic","autograph","automaker","automated","automatic","autopilot","available","avalanche","avatar","avenge","avenging","avenue","average","aversion","avert","aviation","aviator","avid","avoid","await","awaken","award","aware","awhile","awkward","awning","awoke","awry","axis","babble","babbling","babied","baboon","backache","backboard","backboned","backdrop","backed","backer","backfield","backfire","backhand","backing","backlands","backlash","backless","backlight","backlit","backlog","backpack","backpedal","backrest","backroom","backshift","backside","backslid","backspace","backspin","backstab","backstage","backtalk","backtrack","backup","backward","backwash","backwater","backyard","bacon","bacteria","bacterium","badass","badge","badland","badly","badness","baffle","baffling","bagel","bagful","baggage","bagged","baggie","bagginess","bagging","baggy","bagpipe","baguette","baked","bakery","bakeshop","baking","balance","balancing","balcony","balmy","balsamic","bamboo","banana","banish","banister","banjo","bankable","bankbook","banked","banker","banking","banknote","bankroll","banner","bannister","banshee","banter","barbecue","barbed","barbell","barber","barcode","barge","bargraph","barista","baritone","barley","barmaid","barman","barn","barometer","barrack","barracuda","barrel","barrette","barricade","barrier","barstool","bartender","barterer","bash","basically","basics","basil","basin","basis","basket","batboy","batch","bath","baton","bats","battalion","battered","battering","battery","batting","battle","bauble","bazooka","blabber","bladder","blade","blah","blame","blaming","blanching","blandness","blank","blaspheme","blasphemy","blast","blatancy","blatantly","blazer","blazing","bleach","bleak","bleep","blemish","blend","bless","blighted","blimp","bling","blinked","blinker","blinking","blinks","blip","blissful","blitz","blizzard","bloated","bloating","blob","blog","bloomers","blooming","blooper","blot","blouse","blubber","bluff","bluish","blunderer","blunt","blurb","blurred","blurry","blurt","blush","blustery","boaster","boastful","boasting","boat","bobbed","bobbing","bobble","bobcat","bobsled","bobtail","bodacious","body","bogged","boggle","bogus","boil","bok","bolster","bolt","bonanza","bonded","bonding","bondless","boned","bonehead","boneless","bonelike","boney","bonfire","bonnet","bonsai","bonus","bony","boogeyman","boogieman","book","boondocks","booted","booth","bootie","booting","bootlace","bootleg","boots","boozy","borax","boring","borough","borrower","borrowing","boss","botanical","botanist","botany","botch","both","bottle","bottling","bottom","bounce","bouncing","bouncy","bounding","boundless","bountiful","bovine","boxcar","boxer","boxing","boxlike","boxy","breach","breath","breeches","breeching","breeder","breeding","breeze","breezy","brethren","brewery","brewing","briar","bribe","brick","bride","bridged","brigade","bright","brilliant","brim","bring","brink","brisket","briskly","briskness","bristle","brittle","broadband","broadcast","broaden","broadly","broadness","broadside","broadways","broiler","broiling","broken","broker","bronchial","bronco","bronze","bronzing","brook","broom","brought","browbeat","brownnose","browse","browsing","bruising","brunch","brunette","brunt","brush","brussels","brute","brutishly","bubble","bubbling","bubbly","buccaneer","bucked","bucket","buckle","buckshot","buckskin","bucktooth","buckwheat","buddhism","buddhist","budding","buddy","budget","buffalo","buffed","buffer","buffing","buffoon","buggy","bulb","bulge","bulginess","bulgur","bulk","bulldog","bulldozer","bullfight","bullfrog","bullhorn","bullion","bullish","bullpen","bullring","bullseye","bullwhip","bully","bunch","bundle","bungee","bunion","bunkbed","bunkhouse","bunkmate","bunny","bunt","busboy","bush","busily","busload","bust","busybody","buzz","cabana","cabbage","cabbie","cabdriver","cable","caboose","cache","cackle","cacti","cactus","caddie","caddy","cadet","cadillac","cadmium","cage","cahoots","cake","calamari","calamity","calcium","calculate","calculus","caliber","calibrate","calm","caloric","calorie","calzone","camcorder","cameo","camera","camisole","camper","campfire","camping","campsite","campus","canal","canary","cancel","candied","candle","candy","cane","canine","canister","cannabis","canned","canning","cannon","cannot","canola","canon","canopener","canopy","canteen","canyon","capable","capably","capacity","cape","capillary","capital","capitol","capped","capricorn","capsize","capsule","caption","captivate","captive","captivity","capture","caramel","carat","caravan","carbon","cardboard","carded","cardiac","cardigan","cardinal","cardstock","carefully","caregiver","careless","caress","caretaker","cargo","caring","carless","carload","carmaker","carnage","carnation","carnival","carnivore","carol","carpenter","carpentry","carpool","carport","carried","carrot","carrousel","carry","cartel","cartload","carton","cartoon","cartridge","cartwheel","carve","carving","carwash","cascade","case","cash","casing","casino","casket","cassette","casually","casualty","catacomb","catalog","catalyst","catalyze","catapult","cataract","catatonic","catcall","catchable","catcher","catching","catchy","caterer","catering","catfight","catfish","cathedral","cathouse","catlike","catnap","catnip","catsup","cattail","cattishly","cattle","catty","catwalk","caucasian","caucus","causal","causation","cause","causing","cauterize","caution","cautious","cavalier","cavalry","caviar","cavity","cedar","celery","celestial","celibacy","celibate","celtic","cement","census","ceramics","ceremony","certainly","certainty","certified","certify","cesarean","cesspool","chafe","chaffing","chain","chair","chalice","challenge","chamber","chamomile","champion","chance","change","channel","chant","chaos","chaperone","chaplain","chapped","chaps","chapter","character","charbroil","charcoal","charger","charging","chariot","charity","charm","charred","charter","charting","chase","chasing","chaste","chastise","chastity","chatroom","chatter","chatting","chatty","cheating","cheddar","cheek","cheer","cheese","cheesy","chef","chemicals","chemist","chemo","cherisher","cherub","chess","chest","chevron","chevy","chewable","chewer","chewing","chewy","chief","chihuahua","childcare","childhood","childish","childless","childlike","chili","chill","chimp","chip","chirping","chirpy","chitchat","chivalry","chive","chloride","chlorine","choice","chokehold","choking","chomp","chooser","choosing","choosy","chop","chosen","chowder","chowtime","chrome","chubby","chuck","chug","chummy","chump","chunk","churn","chute","cider","cilantro","cinch","cinema","cinnamon","circle","circling","circular","circulate","circus","citable","citadel","citation","citizen","citric","citrus","city","civic","civil","clad","claim","clambake","clammy","clamor","clamp","clamshell","clang","clanking","clapped","clapper","clapping","clarify","clarinet","clarity","clash","clasp","class","clatter","clause","clavicle","claw","clay","clean","clear","cleat","cleaver","cleft","clench","clergyman","clerical","clerk","clever","clicker","client","climate","climatic","cling","clinic","clinking","clip","clique","cloak","clobber","clock","clone","cloning","closable","closure","clothes","clothing","cloud","clover","clubbed","clubbing","clubhouse","clump","clumsily","clumsy","clunky","clustered","clutch","clutter","coach","coagulant","coastal","coaster","coasting","coastland","coastline","coat","coauthor","cobalt","cobbler","cobweb","cocoa","coconut","cod","coeditor","coerce","coexist","coffee","cofounder","cognition","cognitive","cogwheel","coherence","coherent","cohesive","coil","coke","cola","cold","coleslaw","coliseum","collage","collapse","collar","collected","collector","collide","collie","collision","colonial","colonist","colonize","colony","colossal","colt","coma","come","comfort","comfy","comic","coming","comma","commence","commend","comment","commerce","commode","commodity","commodore","common","commotion","commute","commuting","compacted","compacter","compactly","compactor","companion","company","compare","compel","compile","comply","component","composed","composer","composite","compost","composure","compound","compress","comprised","computer","computing","comrade","concave","conceal","conceded","concept","concerned","concert","conch","concierge","concise","conclude","concrete","concur","condense","condiment","condition","condone","conducive","conductor","conduit","cone","confess","confetti","confidant","confident","confider","confiding","configure","confined","confining","confirm","conflict","conform","confound","confront","confused","confusing","confusion","congenial","congested","congrats","congress","conical","conjoined","conjure","conjuror","connected","connector","consensus","consent","console","consoling","consonant","constable","constant","constrain","constrict","construct","consult","consumer","consuming","contact","container","contempt","contend","contented","contently","contents","contest","context","contort","contour","contrite","control","contusion","convene","convent","copartner","cope","copied","copier","copilot","coping","copious","copper","copy","coral","cork","cornball","cornbread","corncob","cornea","corned","corner","cornfield","cornflake","cornhusk","cornmeal","cornstalk","corny","coronary","coroner","corporal","corporate","corral","correct","corridor","corrode","corroding","corrosive","corsage","corset","cortex","cosigner","cosmetics","cosmic","cosmos","cosponsor","cost","cottage","cotton","couch","cough","could","countable","countdown","counting","countless","country","county","courier","covenant","cover","coveted","coveting","coyness","cozily","coziness","cozy","crabbing","crabgrass","crablike","crabmeat","cradle","cradling","crafter","craftily","craftsman","craftwork","crafty","cramp","cranberry","crane","cranial","cranium","crank","crate","crave","craving","crawfish","crawlers","crawling","crayfish","crayon","crazed","crazily","craziness","crazy","creamed","creamer","creamlike","crease","creasing","creatable","create","creation","creative","creature","credible","credibly","credit","creed","creme","creole","crepe","crept","crescent","crested","cresting","crestless","crevice","crewless","crewman","crewmate","crib","cricket","cried","crier","crimp","crimson","cringe","cringing","crinkle","crinkly","crisped","crisping","crisply","crispness","crispy","criteria","critter","croak","crock","crook","croon","crop","cross","crouch","crouton","crowbar","crowd","crown","crucial","crudely","crudeness","cruelly","cruelness","cruelty","crumb","crummiest","crummy","crumpet","crumpled","cruncher","crunching","crunchy","crusader","crushable","crushed","crusher","crushing","crust","crux","crying","cryptic","crystal","cubbyhole","cube","cubical","cubicle","cucumber","cuddle","cuddly","cufflink","culinary","culminate","culpable","culprit","cultivate","cultural","culture","cupbearer","cupcake","cupid","cupped","cupping","curable","curator","curdle","cure","curfew","curing","curled","curler","curliness","curling","curly","curry","curse","cursive","cursor","curtain","curtly","curtsy","curvature","curve","curvy","cushy","cusp","cussed","custard","custodian","custody","customary","customer","customize","customs","cut","cycle","cyclic","cycling","cyclist","cylinder","cymbal","cytoplasm","cytoplast","dab","dad","daffodil","dagger","daily","daintily","dainty","dairy","daisy","dallying","dance","dancing","dandelion","dander","dandruff","dandy","danger","dangle","dangling","daredevil","dares","daringly","darkened","darkening","darkish","darkness","darkroom","darling","darn","dart","darwinism","dash","dastardly","data","datebook","dating","daughter","daunting","dawdler","dawn","daybed","daybreak","daycare","daydream","daylight","daylong","dayroom","daytime","dazzler","dazzling","deacon","deafening","deafness","dealer","dealing","dealmaker","dealt","dean","debatable","debate","debating","debit","debrief","debtless","debtor","debug","debunk","decade","decaf","decal","decathlon","decay","deceased","deceit","deceiver","deceiving","december","decency","decent","deception","deceptive","decibel","decidable","decimal","decimeter","decipher","deck","declared","decline","decode","decompose","decorated","decorator","decoy","decrease","decree","dedicate","dedicator","deduce","deduct","deed","deem","deepen","deeply","deepness","deface","defacing","defame","default","defeat","defection","defective","defendant","defender","defense","defensive","deferral","deferred","defiance","defiant","defile","defiling","define","definite","deflate","deflation","deflator","deflected","deflector","defog","deforest","defraud","defrost","deftly","defuse","defy","degraded","degrading","degrease","degree","dehydrate","deity","dejected","delay","delegate","delegator","delete","deletion","delicacy","delicate","delicious","delighted","delirious","delirium","deliverer","delivery","delouse","delta","deluge","delusion","deluxe","demanding","demeaning","demeanor","demise","democracy","democrat","demote","demotion","demystify","denatured","deniable","denial","denim","denote","dense","density","dental","dentist","denture","deny","deodorant","deodorize","departed","departure","depict","deplete","depletion","deplored","deploy","deport","depose","depraved","depravity","deprecate","depress","deprive","depth","deputize","deputy","derail","deranged","derby","derived","desecrate","deserve","deserving","designate","designed","designer","designing","deskbound","desktop","deskwork","desolate","despair","despise","despite","destiny","destitute","destruct","detached","detail","detection","detective","detector","detention","detergent","detest","detonate","detonator","detoxify","detract","deuce","devalue","deviancy","deviant","deviate","deviation","deviator","device","devious","devotedly","devotee","devotion","devourer","devouring","devoutly","dexterity","dexterous","diabetes","diabetic","diabolic","diagnoses","diagnosis","diagram","dial","diameter","diaper","diaphragm","diary","dice","dicing","dictate","dictation","dictator","difficult","diffused","diffuser","diffusion","diffusive","dig","dilation","diligence","diligent","dill","dilute","dime","diminish","dimly","dimmed","dimmer","dimness","dimple","diner","dingbat","dinghy","dinginess","dingo","dingy","dining","dinner","diocese","dioxide","diploma","dipped","dipper","dipping","directed","direction","directive","directly","directory","direness","dirtiness","disabled","disagree","disallow","disarm","disarray","disaster","disband","disbelief","disburse","discard","discern","discharge","disclose","discolor","discount","discourse","discover","discuss","disdain","disengage","disfigure","disgrace","dish","disinfect","disjoin","disk","dislike","disliking","dislocate","dislodge","disloyal","dismantle","dismay","dismiss","dismount","disobey","disorder","disown","disparate","disparity","dispatch","dispense","dispersal","dispersed","disperser","displace","display","displease","disposal","dispose","disprove","dispute","disregard","disrupt","dissuade","distance","distant","distaste","distill","distinct","distort","distract","distress","district","distrust","ditch","ditto","ditzy","dividable","divided","dividend","dividers","dividing","divinely","diving","divinity","divisible","divisibly","division","divisive","divorcee","dizziness","dizzy","doable","docile","dock","doctrine","document","dodge","dodgy","doily","doing","dole","dollar","dollhouse","dollop","dolly","dolphin","domain","domelike","domestic","dominion","dominoes","donated","donation","donator","donor","donut","doodle","doorbell","doorframe","doorknob","doorman","doormat","doornail","doorpost","doorstep","doorstop","doorway","doozy","dork","dormitory","dorsal","dosage","dose","dotted","doubling","douche","dove","down","dowry","doze","drab","dragging","dragonfly","dragonish","dragster","drainable","drainage","drained","drainer","drainpipe","dramatic","dramatize","drank","drapery","drastic","draw","dreaded","dreadful","dreadlock","dreamboat","dreamily","dreamland","dreamless","dreamlike","dreamt","dreamy","drearily","dreary","drench","dress","drew","dribble","dried","drier","drift","driller","drilling","drinkable","drinking","dripping","drippy","drivable","driven","driver","driveway","driving","drizzle","drizzly","drone","drool","droop","drop-down","dropbox","dropkick","droplet","dropout","dropper","drove","drown","drowsily","drudge","drum","dry","dubbed","dubiously","duchess","duckbill","ducking","duckling","ducktail","ducky","duct","dude","duffel","dugout","duh","duke","duller","dullness","duly","dumping","dumpling","dumpster","duo","dupe","duplex","duplicate","duplicity","durable","durably","duration","duress","during","dusk","dust","dutiful","duty","duvet","dwarf","dweeb","dwelled","dweller","dwelling","dwindle","dwindling","dynamic","dynamite","dynasty","dyslexia","dyslexic","each","eagle","earache","eardrum","earflap","earful","earlobe","early","earmark","earmuff","earphone","earpiece","earplugs","earring","earshot","earthen","earthlike","earthling","earthly","earthworm","earthy","earwig","easeful","easel","easiest","easily","easiness","easing","eastbound","eastcoast","easter","eastward","eatable","eaten","eatery","eating","eats","ebay","ebony","ebook","ecard","eccentric","echo","eclair","eclipse","ecologist","ecology","economic","economist","economy","ecosphere","ecosystem","edge","edginess","edging","edgy","edition","editor","educated","education","educator","eel","effective","effects","efficient","effort","eggbeater","egging","eggnog","eggplant","eggshell","egomaniac","egotism","egotistic","either","eject","elaborate","elastic","elated","elbow","eldercare","elderly","eldest","electable","election","elective","elephant","elevate","elevating","elevation","elevator","eleven","elf","eligible","eligibly","eliminate","elite","elitism","elixir","elk","ellipse","elliptic","elm","elongated","elope","eloquence","eloquent","elsewhere","elude","elusive","elves","email","embargo","embark","embassy","embattled","embellish","ember","embezzle","emblaze","emblem","embody","embolism","emboss","embroider","emcee","emerald","emergency","emission","emit","emote","emoticon","emotion","empathic","empathy","emperor","emphases","emphasis","emphasize","emphatic","empirical","employed","employee","employer","emporium","empower","emptier","emptiness","empty","emu","enable","enactment","enamel","enchanted","enchilada","encircle","enclose","enclosure","encode","encore","encounter","encourage","encroach","encrust","encrypt","endanger","endeared","endearing","ended","ending","endless","endnote","endocrine","endorphin","endorse","endowment","endpoint","endurable","endurance","enduring","energetic","energize","energy","enforced","enforcer","engaged","engaging","engine","engorge","engraved","engraver","engraving","engross","engulf","enhance","enigmatic","enjoyable","enjoyably","enjoyer","enjoying","enjoyment","enlarged","enlarging","enlighten","enlisted","enquirer","enrage","enrich","enroll","enslave","ensnare","ensure","entail","entangled","entering","entertain","enticing","entire","entitle","entity","entomb","entourage","entrap","entree","entrench","entrust","entryway","entwine","enunciate","envelope","enviable","enviably","envious","envision","envoy","envy","enzyme","epic","epidemic","epidermal","epidermis","epidural","epilepsy","epileptic","epilogue","epiphany","episode","equal","equate","equation","equator","equinox","equipment","equity","equivocal","eradicate","erasable","erased","eraser","erasure","ergonomic","errand","errant","erratic","error","erupt","escalate","escalator","escapable","escapade","escapist","escargot","eskimo","esophagus","espionage","espresso","esquire","essay","essence","essential","establish","estate","esteemed","estimate","estimator","estranged","estrogen","etching","eternal","eternity","ethanol","ether","ethically","ethics","euphemism","evacuate","evacuee","evade","evaluate","evaluator","evaporate","evasion","evasive","even","everglade","evergreen","everybody","everyday","everyone","evict","evidence","evident","evil","evoke","evolution","evolve","exact","exalted","example","excavate","excavator","exceeding","exception","excess","exchange","excitable","exciting","exclaim","exclude","excluding","exclusion","exclusive","excretion","excretory","excursion","excusable","excusably","excuse","exemplary","exemplify","exemption","exerciser","exert","exes","exfoliate","exhale","exhaust","exhume","exile","existing","exit","exodus","exonerate","exorcism","exorcist","expand","expanse","expansion","expansive","expectant","expedited","expediter","expel","expend","expenses","expensive","expert","expire","expiring","explain","expletive","explicit","explode","exploit","explore","exploring","exponent","exporter","exposable","expose","exposure","express","expulsion","exquisite","extended","extending","extent","extenuate","exterior","external","extinct","extortion","extradite","extras","extrovert","extrude","extruding","exuberant","fable","fabric","fabulous","facebook","facecloth","facedown","faceless","facelift","faceplate","faceted","facial","facility","facing","facsimile","faction","factoid","factor","factsheet","factual","faculty","fade","fading","failing","falcon","fall","false","falsify","fame","familiar","family","famine","famished","fanatic","fancied","fanciness","fancy","fanfare","fang","fanning","fantasize","fantastic","fantasy","fascism","fastball","faster","fasting","fastness","faucet","favorable","favorably","favored","favoring","favorite","fax","feast","federal","fedora","feeble","feed","feel","feisty","feline","felt-tip","feminine","feminism","feminist","feminize","femur","fence","fencing","fender","ferment","fernlike","ferocious","ferocity","ferret","ferris","ferry","fervor","fester","festival","festive","festivity","fetal","fetch","fever","fiber","fiction","fiddle","fiddling","fidelity","fidgeting","fidgety","fifteen","fifth","fiftieth","fifty","figment","figure","figurine","filing","filled","filler","filling","film","filter","filth","filtrate","finale","finalist","finalize","finally","finance","financial","finch","fineness","finer","finicky","finished","finisher","finishing","finite","finless","finlike","fiscally","fit","five","flaccid","flagman","flagpole","flagship","flagstick","flagstone","flail","flakily","flaky","flame","flammable","flanked","flanking","flannels","flap","flaring","flashback","flashbulb","flashcard","flashily","flashing","flashy","flask","flatbed","flatfoot","flatly","flatness","flatten","flattered","flatterer","flattery","flattop","flatware","flatworm","flavored","flavorful","flavoring","flaxseed","fled","fleshed","fleshy","flick","flier","flight","flinch","fling","flint","flip","flirt","float","flock","flogging","flop","floral","florist","floss","flounder","flyable","flyaway","flyer","flying","flyover","flypaper","foam","foe","fog","foil","folic","folk","follicle","follow","fondling","fondly","fondness","fondue","font","food","fool","footage","football","footbath","footboard","footer","footgear","foothill","foothold","footing","footless","footman","footnote","footpad","footpath","footprint","footrest","footsie","footsore","footwear","footwork","fossil","foster","founder","founding","fountain","fox","foyer","fraction","fracture","fragile","fragility","fragment","fragrance","fragrant","frail","frame","framing","frantic","fraternal","frayed","fraying","frays","freckled","freckles","freebase","freebee","freebie","freedom","freefall","freehand","freeing","freeload","freely","freemason","freeness","freestyle","freeware","freeway","freewill","freezable","freezing","freight","french","frenzied","frenzy","frequency","frequent","fresh","fretful","fretted","friction","friday","fridge","fried","friend","frighten","frightful","frigidity","frigidly","frill","fringe","frisbee","frisk","fritter","frivolous","frolic","from","front","frostbite","frosted","frostily","frosting","frostlike","frosty","froth","frown","frozen","fructose","frugality","frugally","fruit","frustrate","frying","gab","gaffe","gag","gainfully","gaining","gains","gala","gallantly","galleria","gallery","galley","gallon","gallows","gallstone","galore","galvanize","gambling","game","gaming","gamma","gander","gangly","gangrene","gangway","gap","garage","garbage","garden","gargle","garland","garlic","garment","garnet","garnish","garter","gas","gatherer","gathering","gating","gauging","gauntlet","gauze","gave","gawk","gazing","gear","gecko","geek","geiger","gem","gender","generic","generous","genetics","genre","gentile","gentleman","gently","gents","geography","geologic","geologist","geology","geometric","geometry","geranium","gerbil","geriatric","germicide","germinate","germless","germproof","gestate","gestation","gesture","getaway","getting","getup","giant","gibberish","giblet","giddily","giddiness","giddy","gift","gigabyte","gigahertz","gigantic","giggle","giggling","giggly","gigolo","gilled","gills","gimmick","girdle","giveaway","given","giver","giving","gizmo","gizzard","glacial","glacier","glade","gladiator","gladly","glamorous","glamour","glance","glancing","glandular","glare","glaring","glass","glaucoma","glazing","gleaming","gleeful","glider","gliding","glimmer","glimpse","glisten","glitch","glitter","glitzy","gloater","gloating","gloomily","gloomy","glorified","glorifier","glorify","glorious","glory","gloss","glove","glowing","glowworm","glucose","glue","gluten","glutinous","glutton","gnarly","gnat","goal","goatskin","goes","goggles","going","goldfish","goldmine","goldsmith","golf","goliath","gonad","gondola","gone","gong","good","gooey","goofball","goofiness","goofy","google","goon","gopher","gore","gorged","gorgeous","gory","gosling","gossip","gothic","gotten","gout","gown","grab","graceful","graceless","gracious","gradation","graded","grader","gradient","grading","gradually","graduate","graffiti","grafted","grafting","grain","granddad","grandkid","grandly","grandma","grandpa","grandson","granite","granny","granola","grant","granular","grape","graph","grapple","grappling","grasp","grass","gratified","gratify","grating","gratitude","gratuity","gravel","graveness","graves","graveyard","gravitate","gravity","gravy","gray","grazing","greasily","greedily","greedless","greedy","green","greeter","greeting","grew","greyhound","grid","grief","grievance","grieving","grievous","grill","grimace","grimacing","grime","griminess","grimy","grinch","grinning","grip","gristle","grit","groggily","groggy","groin","groom","groove","grooving","groovy","grope","ground","grouped","grout","grove","grower","growing","growl","grub","grudge","grudging","grueling","gruffly","grumble","grumbling","grumbly","grumpily","grunge","grunt","guacamole","guidable","guidance","guide","guiding","guileless","guise","gulf","gullible","gully","gulp","gumball","gumdrop","gumminess","gumming","gummy","gurgle","gurgling","guru","gush","gusto","gusty","gutless","guts","gutter","guy","guzzler","gyration","habitable","habitant","habitat","habitual","hacked","hacker","hacking","hacksaw","had","haggler","haiku","half","halogen","halt","halved","halves","hamburger","hamlet","hammock","hamper","hamster","hamstring","handbag","handball","handbook","handbrake","handcart","handclap","handclasp","handcraft","handcuff","handed","handful","handgrip","handgun","handheld","handiness","handiwork","handlebar","handled","handler","handling","handmade","handoff","handpick","handprint","handrail","handsaw","handset","handsfree","handshake","handstand","handwash","handwork","handwoven","handwrite","handyman","hangnail","hangout","hangover","hangup","hankering","hankie","hanky","haphazard","happening","happier","happiest","happily","happiness","happy","harbor","hardcopy","hardcore","hardcover","harddisk","hardened","hardener","hardening","hardhat","hardhead","hardiness","hardly","hardness","hardship","hardware","hardwired","hardwood","hardy","harmful","harmless","harmonica","harmonics","harmonize","harmony","harness","harpist","harsh","harvest","hash","hassle","haste","hastily","hastiness","hasty","hatbox","hatchback","hatchery","hatchet","hatching","hatchling","hate","hatless","hatred","haunt","haven","hazard","hazelnut","hazily","haziness","hazing","hazy","headache","headband","headboard","headcount","headdress","headed","header","headfirst","headgear","heading","headlamp","headless","headlock","headphone","headpiece","headrest","headroom","headscarf","headset","headsman","headstand","headstone","headway","headwear","heap","heat","heave","heavily","heaviness","heaving","hedge","hedging","heftiness","hefty","helium","helmet","helper","helpful","helping","helpless","helpline","hemlock","hemstitch","hence","henchman","henna","herald","herbal","herbicide","herbs","heritage","hermit","heroics","heroism","herring","herself","hertz","hesitancy","hesitant","hesitate","hexagon","hexagram","hubcap","huddle","huddling","huff","hug","hula","hulk","hull","human","humble","humbling","humbly","humid","humiliate","humility","humming","hummus","humongous","humorist","humorless","humorous","humpback","humped","humvee","hunchback","hundredth","hunger","hungrily","hungry","hunk","hunter","hunting","huntress","huntsman","hurdle","hurled","hurler","hurling","hurray","hurricane","hurried","hurry","hurt","husband","hush","husked","huskiness","hut","hybrid","hydrant","hydrated","hydration","hydrogen","hydroxide","hyperlink","hypertext","hyphen","hypnoses","hypnosis","hypnotic","hypnotism","hypnotist","hypnotize","hypocrisy","hypocrite","ibuprofen","ice","iciness","icing","icky","icon","icy","idealism","idealist","idealize","ideally","idealness","identical","identify","identity","ideology","idiocy","idiom","idly","igloo","ignition","ignore","iguana","illicitly","illusion","illusive","image","imaginary","imagines","imaging","imbecile","imitate","imitation","immature","immerse","immersion","imminent","immobile","immodest","immorally","immortal","immovable","immovably","immunity","immunize","impaired","impale","impart","impatient","impeach","impeding","impending","imperfect","imperial","impish","implant","implement","implicate","implicit","implode","implosion","implosive","imply","impolite","important","importer","impose","imposing","impotence","impotency","impotent","impound","imprecise","imprint","imprison","impromptu","improper","improve","improving","improvise","imprudent","impulse","impulsive","impure","impurity","iodine","iodize","ion","ipad","iphone","ipod","irate","irk","iron","irregular","irrigate","irritable","irritably","irritant","irritate","islamic","islamist","isolated","isolating","isolation","isotope","issue","issuing","italicize","italics","item","itinerary","itunes","ivory","ivy","jab","jackal","jacket","jackknife","jackpot","jailbird","jailbreak","jailer","jailhouse","jalapeno","jam","janitor","january","jargon","jarring","jasmine","jaundice","jaunt","java","jawed","jawless","jawline","jaws","jaybird","jaywalker","jazz","jeep","jeeringly","jellied","jelly","jersey","jester","jet","jiffy","jigsaw","jimmy","jingle","jingling","jinx","jitters","jittery","job","jockey","jockstrap","jogger","jogging","john","joining","jokester","jokingly","jolliness","jolly","jolt","jot","jovial","joyfully","joylessly","joyous","joyride","joystick","jubilance","jubilant","judge","judgingly","judicial","judiciary","judo","juggle","juggling","jugular","juice","juiciness","juicy","jujitsu","jukebox","july","jumble","jumbo","jump","junction","juncture","june","junior","juniper","junkie","junkman","junkyard","jurist","juror","jury","justice","justifier","justify","justly","justness","juvenile","kabob","kangaroo","karaoke","karate","karma","kebab","keenly","keenness","keep","keg","kelp","kennel","kept","kerchief","kerosene","kettle","kick","kiln","kilobyte","kilogram","kilometer","kilowatt","kilt","kimono","kindle","kindling","kindly","kindness","kindred","kinetic","kinfolk","king","kinship","kinsman","kinswoman","kissable","kisser","kissing","kitchen","kite","kitten","kitty","kiwi","kleenex","knapsack","knee","knelt","knickers","knoll","koala","kooky","kosher","krypton","kudos","kung","labored","laborer","laboring","laborious","labrador","ladder","ladies","ladle","ladybug","ladylike","lagged","lagging","lagoon","lair","lake","lance","landed","landfall","landfill","landing","landlady","landless","landline","landlord","landmark","landmass","landmine","landowner","landscape","landside","landslide","language","lankiness","lanky","lantern","lapdog","lapel","lapped","lapping","laptop","lard","large","lark","lash","lasso","last","latch","late","lather","latitude","latrine","latter","latticed","launch","launder","laundry","laurel","lavender","lavish","laxative","lazily","laziness","lazy","lecturer","left","legacy","legal","legend","legged","leggings","legible","legibly","legislate","lego","legroom","legume","legwarmer","legwork","lemon","lend","length","lens","lent","leotard","lesser","letdown","lethargic","lethargy","letter","lettuce","level","leverage","levers","levitate","levitator","liability","liable","liberty","librarian","library","licking","licorice","lid","life","lifter","lifting","liftoff","ligament","likely","likeness","likewise","liking","lilac","lilly","lily","limb","limeade","limelight","limes","limit","limping","limpness","line","lingo","linguini","linguist","lining","linked","linoleum","linseed","lint","lion","lip","liquefy","liqueur","liquid","lisp","list","litigate","litigator","litmus","litter","little","livable","lived","lively","liver","livestock","lividly","living","lizard","lubricant","lubricate","lucid","luckily","luckiness","luckless","lucrative","ludicrous","lugged","lukewarm","lullaby","lumber","luminance","luminous","lumpiness","lumping","lumpish","lunacy","lunar","lunchbox","luncheon","lunchroom","lunchtime","lung","lurch","lure","luridness","lurk","lushly","lushness","luster","lustfully","lustily","lustiness","lustrous","lusty","luxurious","luxury","lying","lyrically","lyricism","lyricist","lyrics","macarena","macaroni","macaw","mace","machine","machinist","magazine","magenta","maggot","magical","magician","magma","magnesium","magnetic","magnetism","magnetize","magnifier","magnify","magnitude","magnolia","mahogany","maimed","majestic","majesty","majorette","majority","makeover","maker","makeshift","making","malformed","malt","mama","mammal","mammary","mammogram","manager","managing","manatee","mandarin","mandate","mandatory","mandolin","manger","mangle","mango","mangy","manhandle","manhole","manhood","manhunt","manicotti","manicure","manifesto","manila","mankind","manlike","manliness","manly","manmade","manned","mannish","manor","manpower","mantis","mantra","manual","many","map","marathon","marauding","marbled","marbles","marbling","march","mardi","margarine","margarita","margin","marigold","marina","marine","marital","maritime","marlin","marmalade","maroon","married","marrow","marry","marshland","marshy","marsupial","marvelous","marxism","mascot","masculine","mashed","mashing","massager","masses","massive","mastiff","matador","matchbook","matchbox","matcher","matching","matchless","material","maternal","maternity","math","mating","matriarch","matrimony","matrix","matron","matted","matter","maturely","maturing","maturity","mauve","maverick","maximize","maximum","maybe","mayday","mayflower","moaner","moaning","mobile","mobility","mobilize","mobster","mocha","mocker","mockup","modified","modify","modular","modulator","module","moisten","moistness","moisture","molar","molasses","mold","molecular","molecule","molehill","mollusk","mom","monastery","monday","monetary","monetize","moneybags","moneyless","moneywise","mongoose","mongrel","monitor","monkhood","monogamy","monogram","monologue","monopoly","monorail","monotone","monotype","monoxide","monsieur","monsoon","monstrous","monthly","monument","moocher","moodiness","moody","mooing","moonbeam","mooned","moonlight","moonlike","moonlit","moonrise","moonscape","moonshine","moonstone","moonwalk","mop","morale","morality","morally","morbidity","morbidly","morphine","morphing","morse","mortality","mortally","mortician","mortified","mortify","mortuary","mosaic","mossy","most","mothball","mothproof","motion","motivate","motivator","motive","motocross","motor","motto","mountable","mountain","mounted","mounting","mourner","mournful","mouse","mousiness","moustache","mousy","mouth","movable","move","movie","moving","mower","mowing","much","muck","mud","mug","mulberry","mulch","mule","mulled","mullets","multiple","multiply","multitask","multitude","mumble","mumbling","mumbo","mummified","mummify","mummy","mumps","munchkin","mundane","municipal","muppet","mural","murkiness","murky","murmuring","muscular","museum","mushily","mushiness","mushroom","mushy","music","musket","muskiness","musky","mustang","mustard","muster","mustiness","musty","mutable","mutate","mutation","mute","mutilated","mutilator","mutiny","mutt","mutual","muzzle","myself","myspace","mystified","mystify","myth","nacho","nag","nail","name","naming","nanny","nanometer","nape","napkin","napped","napping","nappy","narrow","nastily","nastiness","national","native","nativity","natural","nature","naturist","nautical","navigate","navigator","navy","nearby","nearest","nearly","nearness","neatly","neatness","nebula","nebulizer","nectar","negate","negation","negative","neglector","negligee","negligent","negotiate","nemeses","nemesis","neon","nephew","nerd","nervous","nervy","nest","net","neurology","neuron","neurosis","neurotic","neuter","neutron","never","next","nibble","nickname","nicotine","niece","nifty","nimble","nimbly","nineteen","ninetieth","ninja","nintendo","ninth","nuclear","nuclei","nucleus","nugget","nullify","number","numbing","numbly","numbness","numeral","numerate","numerator","numeric","numerous","nuptials","nursery","nursing","nurture","nutcase","nutlike","nutmeg","nutrient","nutshell","nuttiness","nutty","nuzzle","nylon","oaf","oak","oasis","oat","obedience","obedient","obituary","object","obligate","obliged","oblivion","oblivious","oblong","obnoxious","oboe","obscure","obscurity","observant","observer","observing","obsessed","obsession","obsessive","obsolete","obstacle","obstinate","obstruct","obtain","obtrusive","obtuse","obvious","occultist","occupancy","occupant","occupier","occupy","ocean","ocelot","octagon","octane","october","octopus","ogle","oil","oink","ointment","okay","old","olive","olympics","omega","omen","ominous","omission","omit","omnivore","onboard","oncoming","ongoing","onion","online","onlooker","only","onscreen","onset","onshore","onslaught","onstage","onto","onward","onyx","oops","ooze","oozy","opacity","opal","open","operable","operate","operating","operation","operative","operator","opium","opossum","opponent","oppose","opposing","opposite","oppressed","oppressor","opt","opulently","osmosis","other","otter","ouch","ought","ounce","outage","outback","outbid","outboard","outbound","outbreak","outburst","outcast","outclass","outcome","outdated","outdoors","outer","outfield","outfit","outflank","outgoing","outgrow","outhouse","outing","outlast","outlet","outline","outlook","outlying","outmatch","outmost","outnumber","outplayed","outpost","outpour","output","outrage","outrank","outreach","outright","outscore","outsell","outshine","outshoot","outsider","outskirts","outsmart","outsource","outspoken","outtakes","outthink","outward","outweigh","outwit","oval","ovary","oven","overact","overall","overarch","overbid","overbill","overbite","overblown","overboard","overbook","overbuilt","overcast","overcoat","overcome","overcook","overcrowd","overdraft","overdrawn","overdress","overdrive","overdue","overeager","overeater","overexert","overfed","overfeed","overfill","overflow","overfull","overgrown","overhand","overhang","overhaul","overhead","overhear","overheat","overhung","overjoyed","overkill","overlabor","overlaid","overlap","overlay","overload","overlook","overlord","overlying","overnight","overpass","overpay","overplant","overplay","overpower","overprice","overrate","overreach","overreact","override","overripe","overrule","overrun","overshoot","overshot","oversight","oversized","oversleep","oversold","overspend","overstate","overstay","overstep","overstock","overstuff","oversweet","overtake","overthrow","overtime","overtly","overtone","overture","overturn","overuse","overvalue","overview","overwrite","owl","oxford","oxidant","oxidation","oxidize","oxidizing","oxygen","oxymoron","oyster","ozone","paced","pacemaker","pacific","pacifier","pacifism","pacifist","pacify","padded","padding","paddle","paddling","padlock","pagan","pager","paging","pajamas","palace","palatable","palm","palpable","palpitate","paltry","pampered","pamperer","pampers","pamphlet","panama","pancake","pancreas","panda","pandemic","pang","panhandle","panic","panning","panorama","panoramic","panther","pantomime","pantry","pants","pantyhose","paparazzi","papaya","paper","paprika","papyrus","parabola","parachute","parade","paradox","paragraph","parakeet","paralegal","paralyses","paralysis","paralyze","paramedic","parameter","paramount","parasail","parasite","parasitic","parcel","parched","parchment","pardon","parish","parka","parking","parkway","parlor","parmesan","parole","parrot","parsley","parsnip","partake","parted","parting","partition","partly","partner","partridge","party","passable","passably","passage","passcode","passenger","passerby","passing","passion","passive","passivism","passover","passport","password","pasta","pasted","pastel","pastime","pastor","pastrami","pasture","pasty","patchwork","patchy","paternal","paternity","path","patience","patient","patio","patriarch","patriot","patrol","patronage","patronize","pauper","pavement","paver","pavestone","pavilion","paving","pawing","payable","payback","paycheck","payday","payee","payer","paying","payment","payphone","payroll","pebble","pebbly","pecan","pectin","peculiar","peddling","pediatric","pedicure","pedigree","pedometer","pegboard","pelican","pellet","pelt","pelvis","penalize","penalty","pencil","pendant","pending","penholder","penknife","pennant","penniless","penny","penpal","pension","pentagon","pentagram","pep","perceive","percent","perch","percolate","perennial","perfected","perfectly","perfume","periscope","perish","perjurer","perjury","perkiness","perky","perm","peroxide","perpetual","perplexed","persecute","persevere","persuaded","persuader","pesky","peso","pessimism","pessimist","pester","pesticide","petal","petite","petition","petri","petroleum","petted","petticoat","pettiness","petty","petunia","phantom","phobia","phoenix","phonebook","phoney","phonics","phoniness","phony","phosphate","photo","phrase","phrasing","placard","placate","placidly","plank","planner","plant","plasma","plaster","plastic","plated","platform","plating","platinum","platonic","platter","platypus","plausible","plausibly","playable","playback","player","playful","playgroup","playhouse","playing","playlist","playmaker","playmate","playoff","playpen","playroom","playset","plaything","playtime","plaza","pleading","pleat","pledge","plentiful","plenty","plethora","plexiglas","pliable","plod","plop","plot","plow","ploy","pluck","plug","plunder","plunging","plural","plus","plutonium","plywood","poach","pod","poem","poet","pogo","pointed","pointer","pointing","pointless","pointy","poise","poison","poker","poking","polar","police","policy","polio","polish","politely","polka","polo","polyester","polygon","polygraph","polymer","poncho","pond","pony","popcorn","pope","poplar","popper","poppy","popsicle","populace","popular","populate","porcupine","pork","porous","porridge","portable","portal","portfolio","porthole","portion","portly","portside","poser","posh","posing","possible","possibly","possum","postage","postal","postbox","postcard","posted","poster","posting","postnasal","posture","postwar","pouch","pounce","pouncing","pound","pouring","pout","powdered","powdering","powdery","power","powwow","pox","praising","prance","prancing","pranker","prankish","prankster","prayer","praying","preacher","preaching","preachy","preamble","precinct","precise","precision","precook","precut","predator","predefine","predict","preface","prefix","preflight","preformed","pregame","pregnancy","pregnant","preheated","prelaunch","prelaw","prelude","premiere","premises","premium","prenatal","preoccupy","preorder","prepaid","prepay","preplan","preppy","preschool","prescribe","preseason","preset","preshow","president","presoak","press","presume","presuming","preteen","pretended","pretender","pretense","pretext","pretty","pretzel","prevail","prevalent","prevent","preview","previous","prewar","prewashed","prideful","pried","primal","primarily","primary","primate","primer","primp","princess","print","prior","prism","prison","prissy","pristine","privacy","private","privatize","prize","proactive","probable","probably","probation","probe","probing","probiotic","problem","procedure","process","proclaim","procreate","procurer","prodigal","prodigy","produce","product","profane","profanity","professed","professor","profile","profound","profusely","progeny","prognosis","program","progress","projector","prologue","prolonged","promenade","prominent","promoter","promotion","prompter","promptly","prone","prong","pronounce","pronto","proofing","proofread","proofs","propeller","properly","property","proponent","proposal","propose","props","prorate","protector","protegee","proton","prototype","protozoan","protract","protrude","proud","provable","proved","proven","provided","provider","providing","province","proving","provoke","provoking","provolone","prowess","prowler","prowling","proximity","proxy","prozac","prude","prudishly","prune","pruning","pry","psychic","public","publisher","pucker","pueblo","pug","pull","pulmonary","pulp","pulsate","pulse","pulverize","puma","pumice","pummel","punch","punctual","punctuate","punctured","pungent","punisher","punk","pupil","puppet","puppy","purchase","pureblood","purebred","purely","pureness","purgatory","purge","purging","purifier","purify","purist","puritan","purity","purple","purplish","purposely","purr","purse","pursuable","pursuant","pursuit","purveyor","pushcart","pushchair","pusher","pushiness","pushing","pushover","pushpin","pushup","pushy","putdown","putt","puzzle","puzzling","pyramid","pyromania","python","quack","quadrant","quail","quaintly","quake","quaking","qualified","qualifier","qualify","quality","qualm","quantum","quarrel","quarry","quartered","quarterly","quarters","quartet","quench","query","quicken","quickly","quickness","quicksand","quickstep","quiet","quill","quilt","quintet","quintuple","quirk","quit","quiver","quizzical","quotable","quotation","quote","rabid","race","racing","racism","rack","racoon","radar","radial","radiance","radiantly","radiated","radiation","radiator","radio","radish","raffle","raft","rage","ragged","raging","ragweed","raider","railcar","railing","railroad","railway","raisin","rake","raking","rally","ramble","rambling","ramp","ramrod","ranch","rancidity","random","ranged","ranger","ranging","ranked","ranking","ransack","ranting","rants","rare","rarity","rascal","rash","rasping","ravage","raven","ravine","raving","ravioli","ravishing","reabsorb","reach","reacquire","reaction","reactive","reactor","reaffirm","ream","reanalyze","reappear","reapply","reappoint","reapprove","rearrange","rearview","reason","reassign","reassure","reattach","reawake","rebalance","rebate","rebel","rebirth","reboot","reborn","rebound","rebuff","rebuild","rebuilt","reburial","rebuttal","recall","recant","recapture","recast","recede","recent","recess","recharger","recipient","recital","recite","reckless","reclaim","recliner","reclining","recluse","reclusive","recognize","recoil","recollect","recolor","reconcile","reconfirm","reconvene","recopy","record","recount","recoup","recovery","recreate","rectal","rectangle","rectified","rectify","recycled","recycler","recycling","reemerge","reenact","reenter","reentry","reexamine","referable","referee","reference","refill","refinance","refined","refinery","refining","refinish","reflected","reflector","reflex","reflux","refocus","refold","reforest","reformat","reformed","reformer","reformist","refract","refrain","refreeze","refresh","refried","refueling","refund","refurbish","refurnish","refusal","refuse","refusing","refutable","refute","regain","regalia","regally","reggae","regime","region","register","registrar","registry","regress","regretful","regroup","regular","regulate","regulator","rehab","reheat","rehire","rehydrate","reimburse","reissue","reiterate","rejoice","rejoicing","rejoin","rekindle","relapse","relapsing","relatable","related","relation","relative","relax","relay","relearn","release","relenting","reliable","reliably","reliance","reliant","relic","relieve","relieving","relight","relish","relive","reload","relocate","relock","reluctant","rely","remake","remark","remarry","rematch","remedial","remedy","remember","reminder","remindful","remission","remix","remnant","remodeler","remold","remorse","remote","removable","removal","removed","remover","removing","rename","renderer","rendering","rendition","renegade","renewable","renewably","renewal","renewed","renounce","renovate","renovator","rentable","rental","rented","renter","reoccupy","reoccur","reopen","reorder","repackage","repacking","repaint","repair","repave","repaying","repayment","repeal","repeated","repeater","repent","rephrase","replace","replay","replica","reply","reporter","repose","repossess","repost","repressed","reprimand","reprint","reprise","reproach","reprocess","reproduce","reprogram","reps","reptile","reptilian","repugnant","repulsion","repulsive","repurpose","reputable","reputably","request","require","requisite","reroute","rerun","resale","resample","rescuer","reseal","research","reselect","reseller","resemble","resend","resent","reset","reshape","reshoot","reshuffle","residence","residency","resident","residual","residue","resigned","resilient","resistant","resisting","resize","resolute","resolved","resonant","resonate","resort","resource","respect","resubmit","result","resume","resupply","resurface","resurrect","retail","retainer","retaining","retake","retaliate","retention","rethink","retinal","retired","retiree","retiring","retold","retool","retorted","retouch","retrace","retract","retrain","retread","retreat","retrial","retrieval","retriever","retry","return","retying","retype","reunion","reunite","reusable","reuse","reveal","reveler","revenge","revenue","reverb","revered","reverence","reverend","reversal","reverse","reversing","reversion","revert","revisable","revise","revision","revisit","revivable","revival","reviver","reviving","revocable","revoke","revolt","revolver","revolving","reward","rewash","rewind","rewire","reword","rework","rewrap","rewrite","rhyme","ribbon","ribcage","rice","riches","richly","richness","rickety","ricotta","riddance","ridden","ride","riding","rifling","rift","rigging","rigid","rigor","rimless","rimmed","rind","rink","rinse","rinsing","riot","ripcord","ripeness","ripening","ripping","ripple","rippling","riptide","rise","rising","risk","risotto","ritalin","ritzy","rival","riverbank","riverbed","riverboat","riverside","riveter","riveting","roamer","roaming","roast","robbing","robe","robin","robotics","robust","rockband","rocker","rocket","rockfish","rockiness","rocking","rocklike","rockslide","rockstar","rocky","rogue","roman","romp","rope","roping","roster","rosy","rotten","rotting","rotunda","roulette","rounding","roundish","roundness","roundup","roundworm","routine","routing","rover","roving","royal","rubbed","rubber","rubbing","rubble","rubdown","ruby","ruckus","rudder","rug","ruined","rule","rumble","rumbling","rummage","rumor","runaround","rundown","runner","running","runny","runt","runway","rupture","rural","ruse","rush","rust","rut","sabbath","sabotage","sacrament","sacred","sacrifice","sadden","saddlebag","saddled","saddling","sadly","sadness","safari","safeguard","safehouse","safely","safeness","saffron","saga","sage","sagging","saggy","said","saint","sake","salad","salami","salaried","salary","saline","salon","saloon","salsa","salt","salutary","salute","salvage","salvaging","salvation","same","sample","sampling","sanction","sanctity","sanctuary","sandal","sandbag","sandbank","sandbar","sandblast","sandbox","sanded","sandfish","sanding","sandlot","sandpaper","sandpit","sandstone","sandstorm","sandworm","sandy","sanitary","sanitizer","sank","santa","sapling","sappiness","sappy","sarcasm","sarcastic","sardine","sash","sasquatch","sassy","satchel","satiable","satin","satirical","satisfied","satisfy","saturate","saturday","sauciness","saucy","sauna","savage","savanna","saved","savings","savior","savor","saxophone","say","scabbed","scabby","scalded","scalding","scale","scaling","scallion","scallop","scalping","scam","scandal","scanner","scanning","scant","scapegoat","scarce","scarcity","scarecrow","scared","scarf","scarily","scariness","scarring","scary","scavenger","scenic","schedule","schematic","scheme","scheming","schilling","schnapps","scholar","science","scientist","scion","scoff","scolding","scone","scoop","scooter","scope","scorch","scorebook","scorecard","scored","scoreless","scorer","scoring","scorn","scorpion","scotch","scoundrel","scoured","scouring","scouting","scouts","scowling","scrabble","scraggly","scrambled","scrambler","scrap","scratch","scrawny","screen","scribble","scribe","scribing","scrimmage","script","scroll","scrooge","scrounger","scrubbed","scrubber","scruffy","scrunch","scrutiny","scuba","scuff","sculptor","sculpture","scurvy","scuttle","secluded","secluding","seclusion","second","secrecy","secret","sectional","sector","secular","securely","security","sedan","sedate","sedation","sedative","sediment","seduce","seducing","segment","seismic","seizing","seldom","selected","selection","selective","selector","self","seltzer","semantic","semester","semicolon","semifinal","seminar","semisoft","semisweet","senate","senator","send","senior","senorita","sensation","sensitive","sensitize","sensually","sensuous","sepia","september","septic","septum","sequel","sequence","sequester","series","sermon","serotonin","serpent","serrated","serve","service","serving","sesame","sessions","setback","setting","settle","settling","setup","sevenfold","seventeen","seventh","seventy","severity","shabby","shack","shaded","shadily","shadiness","shading","shadow","shady","shaft","shakable","shakily","shakiness","shaking","shaky","shale","shallot","shallow","shame","shampoo","shamrock","shank","shanty","shape","shaping","share","sharpener","sharper","sharpie","sharply","sharpness","shawl","sheath","shed","sheep","sheet","shelf","shell","shelter","shelve","shelving","sherry","shield","shifter","shifting","shiftless","shifty","shimmer","shimmy","shindig","shine","shingle","shininess","shining","shiny","ship","shirt","shivering","shock","shone","shoplift","shopper","shopping","shoptalk","shore","shortage","shortcake","shortcut","shorten","shorter","shorthand","shortlist","shortly","shortness","shorts","shortwave","shorty","shout","shove","showbiz","showcase","showdown","shower","showgirl","showing","showman","shown","showoff","showpiece","showplace","showroom","showy","shrank","shrapnel","shredder","shredding","shrewdly","shriek","shrill","shrimp","shrine","shrink","shrivel","shrouded","shrubbery","shrubs","shrug","shrunk","shucking","shudder","shuffle","shuffling","shun","shush","shut","shy","siamese","siberian","sibling","siding","sierra","siesta","sift","sighing","silenced","silencer","silent","silica","silicon","silk","silliness","silly","silo","silt","silver","similarly","simile","simmering","simple","simplify","simply","sincere","sincerity","singer","singing","single","singular","sinister","sinless","sinner","sinuous","sip","siren","sister","sitcom","sitter","sitting","situated","situation","sixfold","sixteen","sixth","sixties","sixtieth","sixtyfold","sizable","sizably","size","sizing","sizzle","sizzling","skater","skating","skedaddle","skeletal","skeleton","skeptic","sketch","skewed","skewer","skid","skied","skier","skies","skiing","skilled","skillet","skillful","skimmed","skimmer","skimming","skimpily","skincare","skinhead","skinless","skinning","skinny","skintight","skipper","skipping","skirmish","skirt","skittle","skydiver","skylight","skyline","skype","skyrocket","skyward","slab","slacked","slacker","slacking","slackness","slacks","slain","slam","slander","slang","slapping","slapstick","slashed","slashing","slate","slather","slaw","sled","sleek","sleep","sleet","sleeve","slept","sliceable","sliced","slicer","slicing","slick","slider","slideshow","sliding","slighted","slighting","slightly","slimness","slimy","slinging","slingshot","slinky","slip","slit","sliver","slobbery","slogan","sloped","sloping","sloppily","sloppy","slot","slouching","slouchy","sludge","slug","slum","slurp","slush","sly","small","smartly","smartness","smasher","smashing","smashup","smell","smelting","smile","smilingly","smirk","smite","smith","smitten","smock","smog","smoked","smokeless","smokiness","smoking","smoky","smolder","smooth","smother","smudge","smudgy","smuggler","smuggling","smugly","smugness","snack","snagged","snaking","snap","snare","snarl","snazzy","sneak","sneer","sneeze","sneezing","snide","sniff","snippet","snipping","snitch","snooper","snooze","snore","snoring","snorkel","snort","snout","snowbird","snowboard","snowbound","snowcap","snowdrift","snowdrop","snowfall","snowfield","snowflake","snowiness","snowless","snowman","snowplow","snowshoe","snowstorm","snowsuit","snowy","snub","snuff","snuggle","snugly","snugness","speak","spearfish","spearhead","spearman","spearmint","species","specimen","specked","speckled","specks","spectacle","spectator","spectrum","speculate","speech","speed","spellbind","speller","spelling","spendable","spender","spending","spent","spew","sphere","spherical","sphinx","spider","spied","spiffy","spill","spilt","spinach","spinal","spindle","spinner","spinning","spinout","spinster","spiny","spiral","spirited","spiritism","spirits","spiritual","splashed","splashing","splashy","splatter","spleen","splendid","splendor","splice","splicing","splinter","splotchy","splurge","spoilage","spoiled","spoiler","spoiling","spoils","spoken","spokesman","sponge","spongy","sponsor","spoof","spookily","spooky","spool","spoon","spore","sporting","sports","sporty","spotless","spotlight","spotted","spotter","spotting","spotty","spousal","spouse","spout","sprain","sprang","sprawl","spray","spree","sprig","spring","sprinkled","sprinkler","sprint","sprite","sprout","spruce","sprung","spry","spud","spur","sputter","spyglass","squabble","squad","squall","squander","squash","squatted","squatter","squatting","squeak","squealer","squealing","squeamish","squeegee","squeeze","squeezing","squid","squiggle","squiggly","squint","squire","squirt","squishier","squishy","stability","stabilize","stable","stack","stadium","staff","stage","staging","stagnant","stagnate","stainable","stained","staining","stainless","stalemate","staleness","stalling","stallion","stamina","stammer","stamp","stand","stank","staple","stapling","starboard","starch","stardom","stardust","starfish","stargazer","staring","stark","starless","starlet","starlight","starlit","starring","starry","starship","starter","starting","startle","startling","startup","starved","starving","stash","state","static","statistic","statue","stature","status","statute","statutory","staunch","stays","steadfast","steadier","steadily","steadying","steam","steed","steep","steerable","steering","steersman","stegosaur","stellar","stem","stench","stencil","step","stereo","sterile","sterility","sterilize","sterling","sternness","sternum","stew","stick","stiffen","stiffly","stiffness","stifle","stifling","stillness","stilt","stimulant","stimulate","stimuli","stimulus","stinger","stingily","stinging","stingray","stingy","stinking","stinky","stipend","stipulate","stir","stitch","stock","stoic","stoke","stole","stomp","stonewall","stoneware","stonework","stoning","stony","stood","stooge","stool","stoop","stoplight","stoppable","stoppage","stopped","stopper","stopping","stopwatch","storable","storage","storeroom","storewide","storm","stout","stove","stowaway","stowing","straddle","straggler","strained","strainer","straining","strangely","stranger","strangle","strategic","strategy","stratus","straw","stray","streak","stream","street","strength","strenuous","strep","stress","stretch","strewn","stricken","strict","stride","strife","strike","striking","strive","striving","strobe","strode","stroller","strongbox","strongly","strongman","struck","structure","strudel","struggle","strum","strung","strut","stubbed","stubble","stubbly","stubborn","stucco","stuck","student","studied","studio","study","stuffed","stuffing","stuffy","stumble","stumbling","stump","stung","stunned","stunner","stunning","stunt","stupor","sturdily","sturdy","styling","stylishly","stylist","stylized","stylus","suave","subarctic","subatomic","subdivide","subdued","subduing","subfloor","subgroup","subheader","subject","sublease","sublet","sublevel","sublime","submarine","submerge","submersed","submitter","subpanel","subpar","subplot","subprime","subscribe","subscript","subsector","subside","subsiding","subsidize","subsidy","subsoil","subsonic","substance","subsystem","subtext","subtitle","subtly","subtotal","subtract","subtype","suburb","subway","subwoofer","subzero","succulent","such","suction","sudden","sudoku","suds","sufferer","suffering","suffice","suffix","suffocate","suffrage","sugar","suggest","suing","suitable","suitably","suitcase","suitor","sulfate","sulfide","sulfite","sulfur","sulk","sullen","sulphate","sulphuric","sultry","superbowl","superglue","superhero","superior","superjet","superman","supermom","supernova","supervise","supper","supplier","supply","support","supremacy","supreme","surcharge","surely","sureness","surface","surfacing","surfboard","surfer","surgery","surgical","surging","surname","surpass","surplus","surprise","surreal","surrender","surrogate","surround","survey","survival","survive","surviving","survivor","sushi","suspect","suspend","suspense","sustained","sustainer","swab","swaddling","swagger","swampland","swan","swapping","swarm","sway","swear","sweat","sweep","swell","swept","swerve","swifter","swiftly","swiftness","swimmable","swimmer","swimming","swimsuit","swimwear","swinger","swinging","swipe","swirl","switch","swivel","swizzle","swooned","swoop","swoosh","swore","sworn","swung","sycamore","sympathy","symphonic","symphony","symptom","synapse","syndrome","synergy","synopses","synopsis","synthesis","synthetic","syrup","system","t-shirt","tabasco","tabby","tableful","tables","tablet","tableware","tabloid","tackiness","tacking","tackle","tackling","tacky","taco","tactful","tactical","tactics","tactile","tactless","tadpole","taekwondo","tag","tainted","take","taking","talcum","talisman","tall","talon","tamale","tameness","tamer","tamper","tank","tanned","tannery","tanning","tantrum","tapeless","tapered","tapering","tapestry","tapioca","tapping","taps","tarantula","target","tarmac","tarnish","tarot","tartar","tartly","tartness","task","tassel","taste","tastiness","tasting","tasty","tattered","tattle","tattling","tattoo","taunt","tavern","thank","that","thaw","theater","theatrics","thee","theft","theme","theology","theorize","thermal","thermos","thesaurus","these","thesis","thespian","thicken","thicket","thickness","thieving","thievish","thigh","thimble","thing","think","thinly","thinner","thinness","thinning","thirstily","thirsting","thirsty","thirteen","thirty","thong","thorn","those","thousand","thrash","thread","threaten","threefold","thrift","thrill","thrive","thriving","throat","throbbing","throng","throttle","throwaway","throwback","thrower","throwing","thud","thumb","thumping","thursday","thus","thwarting","thyself","tiara","tibia","tidal","tidbit","tidiness","tidings","tidy","tiger","tighten","tightly","tightness","tightrope","tightwad","tigress","tile","tiling","till","tilt","timid","timing","timothy","tinderbox","tinfoil","tingle","tingling","tingly","tinker","tinkling","tinsel","tinsmith","tint","tinwork","tiny","tipoff","tipped","tipper","tipping","tiptoeing","tiptop","tiring","tissue","trace","tracing","track","traction","tractor","trade","trading","tradition","traffic","tragedy","trailing","trailside","train","traitor","trance","tranquil","transfer","transform","translate","transpire","transport","transpose","trapdoor","trapeze","trapezoid","trapped","trapper","trapping","traps","trash","travel","traverse","travesty","tray","treachery","treading","treadmill","treason","treat","treble","tree","trekker","tremble","trembling","tremor","trench","trend","trespass","triage","trial","triangle","tribesman","tribunal","tribune","tributary","tribute","triceps","trickery","trickily","tricking","trickle","trickster","tricky","tricolor","tricycle","trident","tried","trifle","trifocals","trillion","trilogy","trimester","trimmer","trimming","trimness","trinity","trio","tripod","tripping","triumph","trivial","trodden","trolling","trombone","trophy","tropical","tropics","trouble","troubling","trough","trousers","trout","trowel","truce","truck","truffle","trump","trunks","trustable","trustee","trustful","trusting","trustless","truth","try","tubby","tubeless","tubular","tucking","tuesday","tug","tuition","tulip","tumble","tumbling","tummy","turban","turbine","turbofan","turbojet","turbulent","turf","turkey","turmoil","turret","turtle","tusk","tutor","tutu","tux","tweak","tweed","tweet","tweezers","twelve","twentieth","twenty","twerp","twice","twiddle","twiddling","twig","twilight","twine","twins","twirl","twistable","twisted","twister","twisting","twisty","twitch","twitter","tycoon","tying","tyke","udder","ultimate","ultimatum","ultra","umbilical","umbrella","umpire","unabashed","unable","unadorned","unadvised","unafraid","unaired","unaligned","unaltered","unarmored","unashamed","unaudited","unawake","unaware","unbaked","unbalance","unbeaten","unbend","unbent","unbiased","unbitten","unblended","unblessed","unblock","unbolted","unbounded","unboxed","unbraided","unbridle","unbroken","unbuckled","unbundle","unburned","unbutton","uncanny","uncapped","uncaring","uncertain","unchain","unchanged","uncharted","uncheck","uncivil","unclad","unclaimed","unclamped","unclasp","uncle","unclip","uncloak","unclog","unclothed","uncoated","uncoiled","uncolored","uncombed","uncommon","uncooked","uncork","uncorrupt","uncounted","uncouple","uncouth","uncover","uncross","uncrown","uncrushed","uncured","uncurious","uncurled","uncut","undamaged","undated","undaunted","undead","undecided","undefined","underage","underarm","undercoat","undercook","undercut","underdog","underdone","underfed","underfeed","underfoot","undergo","undergrad","underhand","underline","underling","undermine","undermost","underpaid","underpass","underpay","underrate","undertake","undertone","undertook","undertow","underuse","underwear","underwent","underwire","undesired","undiluted","undivided","undocked","undoing","undone","undrafted","undress","undrilled","undusted","undying","unearned","unearth","unease","uneasily","uneasy","uneatable","uneaten","unedited","unelected","unending","unengaged","unenvied","unequal","unethical","uneven","unexpired","unexposed","unfailing","unfair","unfasten","unfazed","unfeeling","unfiled","unfilled","unfitted","unfitting","unfixable","unfixed","unflawed","unfocused","unfold","unfounded","unframed","unfreeze","unfrosted","unfrozen","unfunded","unglazed","ungloved","unglue","ungodly","ungraded","ungreased","unguarded","unguided","unhappily","unhappy","unharmed","unhealthy","unheard","unhearing","unheated","unhelpful","unhidden","unhinge","unhitched","unholy","unhook","unicorn","unicycle","unified","unifier","uniformed","uniformly","unify","unimpeded","uninjured","uninstall","uninsured","uninvited","union","uniquely","unisexual","unison","unissued","unit","universal","universe","unjustly","unkempt","unkind","unknotted","unknowing","unknown","unlaced","unlatch","unlawful","unleaded","unlearned","unleash","unless","unleveled","unlighted","unlikable","unlimited","unlined","unlinked","unlisted","unlit","unlivable","unloaded","unloader","unlocked","unlocking","unlovable","unloved","unlovely","unloving","unluckily","unlucky","unmade","unmanaged","unmanned","unmapped","unmarked","unmasked","unmasking","unmatched","unmindful","unmixable","unmixed","unmolded","unmoral","unmovable","unmoved","unmoving","unnamable","unnamed","unnatural","unneeded","unnerve","unnerving","unnoticed","unopened","unopposed","unpack","unpadded","unpaid","unpainted","unpaired","unpaved","unpeeled","unpicked","unpiloted","unpinned","unplanned","unplanted","unpleased","unpledged","unplowed","unplug","unpopular","unproven","unquote","unranked","unrated","unraveled","unreached","unread","unreal","unreeling","unrefined","unrelated","unrented","unrest","unretired","unrevised","unrigged","unripe","unrivaled","unroasted","unrobed","unroll","unruffled","unruly","unrushed","unsaddle","unsafe","unsaid","unsalted","unsaved","unsavory","unscathed","unscented","unscrew","unsealed","unseated","unsecured","unseeing","unseemly","unseen","unselect","unselfish","unsent","unsettled","unshackle","unshaken","unshaved","unshaven","unsheathe","unshipped","unsightly","unsigned","unskilled","unsliced","unsmooth","unsnap","unsocial","unsoiled","unsold","unsolved","unsorted","unspoiled","unspoken","unstable","unstaffed","unstamped","unsteady","unsterile","unstirred","unstitch","unstopped","unstuck","unstuffed","unstylish","unsubtle","unsubtly","unsuited","unsure","unsworn","untagged","untainted","untaken","untamed","untangled","untapped","untaxed","unthawed","unthread","untidy","untie","until","untimed","untimely","untitled","untoasted","untold","untouched","untracked","untrained","untreated","untried","untrimmed","untrue","untruth","unturned","untwist","untying","unusable","unused","unusual","unvalued","unvaried","unvarying","unveiled","unveiling","unvented","unviable","unvisited","unvocal","unwanted","unwarlike","unwary","unwashed","unwatched","unweave","unwed","unwelcome","unwell","unwieldy","unwilling","unwind","unwired","unwitting","unwomanly","unworldly","unworn","unworried","unworthy","unwound","unwoven","unwrapped","unwritten","unzip","upbeat","upchuck","upcoming","upcountry","update","upfront","upgrade","upheaval","upheld","uphill","uphold","uplifted","uplifting","upload","upon","upper","upright","uprising","upriver","uproar","uproot","upscale","upside","upstage","upstairs","upstart","upstate","upstream","upstroke","upswing","uptake","uptight","uptown","upturned","upward","upwind","uranium","urban","urchin","urethane","urgency","urgent","urging","urologist","urology","usable","usage","useable","used","uselessly","user","usher","usual","utensil","utility","utilize","utmost","utopia","utter","vacancy","vacant","vacate","vacation","vagabond","vagrancy","vagrantly","vaguely","vagueness","valiant","valid","valium","valley","valuables","value","vanilla","vanish","vanity","vanquish","vantage","vaporizer","variable","variably","varied","variety","various","varmint","varnish","varsity","varying","vascular","vaseline","vastly","vastness","veal","vegan","veggie","vehicular","velcro","velocity","velvet","vendetta","vending","vendor","veneering","vengeful","venomous","ventricle","venture","venue","venus","verbalize","verbally","verbose","verdict","verify","verse","version","versus","vertebrae","vertical","vertigo","very","vessel","vest","veteran","veto","vexingly","viability","viable","vibes","vice","vicinity","victory","video","viewable","viewer","viewing","viewless","viewpoint","vigorous","village","villain","vindicate","vineyard","vintage","violate","violation","violator","violet","violin","viper","viral","virtual","virtuous","virus","visa","viscosity","viscous","viselike","visible","visibly","vision","visiting","visitor","visor","vista","vitality","vitalize","vitally","vitamins","vivacious","vividly","vividness","vixen","vocalist","vocalize","vocally","vocation","voice","voicing","void","volatile","volley","voltage","volumes","voter","voting","voucher","vowed","vowel","voyage","wackiness","wad","wafer","waffle","waged","wager","wages","waggle","wagon","wake","waking","walk","walmart","walnut","walrus","waltz","wand","wannabe","wanted","wanting","wasabi","washable","washbasin","washboard","washbowl","washcloth","washday","washed","washer","washhouse","washing","washout","washroom","washstand","washtub","wasp","wasting","watch","water","waviness","waving","wavy","whacking","whacky","wham","wharf","wheat","whenever","whiff","whimsical","whinny","whiny","whisking","whoever","whole","whomever","whoopee","whooping","whoops","why","wick","widely","widen","widget","widow","width","wieldable","wielder","wife","wifi","wikipedia","wildcard","wildcat","wilder","wildfire","wildfowl","wildland","wildlife","wildly","wildness","willed","willfully","willing","willow","willpower","wilt","wimp","wince","wincing","wind","wing","winking","winner","winnings","winter","wipe","wired","wireless","wiring","wiry","wisdom","wise","wish","wisplike","wispy","wistful","wizard","wobble","wobbling","wobbly","wok","wolf","wolverine","womanhood","womankind","womanless","womanlike","womanly","womb","woof","wooing","wool","woozy","word","work","worried","worrier","worrisome","worry","worsening","worshiper","worst","wound","woven","wow","wrangle","wrath","wreath","wreckage","wrecker","wrecking","wrench","wriggle","wriggly","wrinkle","wrinkly","wrist","writing","written","wrongdoer","wronged","wrongful","wrongly","wrongness","wrought","xbox","xerox","yahoo","yam","yanking","yapping","yard","yarn","yeah","yearbook","yearling","yearly","yearning","yeast","yelling","yelp","yen","yesterday","yiddish","yield","yin","yippee","yo-yo","yodel","yoga","yogurt","yonder","yoyo","yummy","zap","zealous","zebra","zen","zeppelin","zero","zestfully","zesty","zigzagged","zipfile","zipping","zippy","zips","zit","zodiac","zombie","zone","zoning","zookeeper","zoologist","zoology","zoom"]},1682:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSecureRandomNumber=t.getSecureRandomWords=t.getSecureRandomBytes=void 0;const n=r(2370);async function i(e){return(0,n.getSecureRandomBytes)(e)}t.getSecureRandomBytes=i,t.getSecureRandomWords=async function e(t){return e(t)},t.getSecureRandomNumber=async function(e,t){let r=t-e;var n=Math.ceil(Math.log2(r));if(n>53)throw new Error("Range is too large");for(var o=Math.ceil(n/8),s=Math.pow(2,n)-1;;){let t=await i(n),l=8*(o-1),c=0;for(var a=0;a=r))return e+c}}},4870:function(e,t,r){"use strict";var n=r(8287).hp,i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.hmac_sha512=t.hmac_sha512_fallback=void 0;const o=i(r(8343)),s=r(2370);t.hmac_sha512_fallback=async function(e,t){let r="string"==typeof e?n.from(e,"utf-8"):e,i="string"==typeof t?n.from(t,"utf-8"):t;const s=new o.default("SHA-512","HEX",{hmacKey:{value:r.toString("hex"),format:"HEX"}});s.update(i.toString("hex"));const a=s.getHash("HEX");return n.from(a,"hex")},t.hmac_sha512=function(e,t){return(0,s.hmac_sha512)(e,t)}},7796:function(e,t,r){"use strict";var n=r(8287).hp,i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.openBox=t.sealBox=t.signVerify=t.sign=t.keyPairFromSeed=t.keyPairFromSecretKey=void 0;const o=i(r(8947));t.keyPairFromSecretKey=function(e){let t=o.default.sign.keyPair.fromSecretKey(new Uint8Array(e));return{publicKey:n.from(t.publicKey),secretKey:n.from(t.secretKey)}},t.keyPairFromSeed=function(e){let t=o.default.sign.keyPair.fromSeed(new Uint8Array(e));return{publicKey:n.from(t.publicKey),secretKey:n.from(t.secretKey)}},t.sign=function(e,t){return n.from(o.default.sign.detached(new Uint8Array(e),new Uint8Array(t)))},t.signVerify=function(e,t,r){return o.default.sign.detached.verify(new Uint8Array(e),new Uint8Array(t),new Uint8Array(r))},t.sealBox=function(e,t,r){return n.from(o.default.secretbox(e,t,r))},t.openBox=function(e,t,r){let i=o.default.secretbox.open(e,t,r);return i?n.from(i):null}},9256:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pbkdf2_sha512=void 0;const n=r(2370);t.pbkdf2_sha512=function(e,t,r,i){return(0,n.pbkdf2_sha512)(e,t,r,i)}},3269:function(e,t,r){"use strict";var n=r(8287).hp,i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.sha256=t.sha256_fallback=t.sha256_sync=void 0;const o=i(r(8343)),s=r(2370);function a(e){let t;t="string"==typeof e?n.from(e,"utf-8").toString("hex"):e.toString("hex");let r=new o.default("SHA-256","HEX");r.update(t);let i=r.getHash("HEX");return n.from(i,"hex")}t.sha256_sync=a,t.sha256_fallback=async function(e){return a(e)},t.sha256=function(e){return(0,s.sha256)(e)}},6224:function(e,t,r){"use strict";var n=r(8287).hp,i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.sha512=t.sha512_fallback=t.sha512_sync=void 0;const o=i(r(8343)),s=r(2370);function a(e){let t;t="string"==typeof e?n.from(e,"utf-8").toString("hex"):e.toString("hex");let r=new o.default("SHA-512","HEX");r.update(t);let i=r.getHash("HEX");return n.from(i,"hex")}t.sha512_sync=a,t.sha512_fallback=async function(e){return a(e)},t.sha512=async function(e){return(0,s.sha512)(e)}},2202:(e,t,r)=>{"use strict";var n=r(8287).hp;function i(e,t,r){for(;e.length0;)t.push(parseInt(e.slice(0,8),2)),e=e.slice(8);return n.from(t)}},8737:(e,t,r)=>{"use strict";var n=r(8287).hp;Object.defineProperty(t,"__esModule",{value:!0}),t.TonClient=void 0;const i=r(1972),o=r(1307);function s(e){switch(e["@type"]){case"tvm.stackEntryNumber":return{type:"int",value:BigInt(e.number.number)};case"tvm.stackEntryCell":return{type:"cell",cell:o.Cell.fromBase64(e.cell)};case"tvm.stackEntryTuple":return{type:"tuple",items:e.tuple.elements.map(s)};default:throw Error("Unsupported item type: "+e["@type"])}}function a(e){if("num"===e[0]){let t=e[1];return t.startsWith("-")?{type:"int",value:-BigInt(t.slice(1))}:{type:"int",value:BigInt(t)}}if("null"===e[0])return{type:"null"};if("cell"===e[0])return{type:"cell",cell:o.Cell.fromBoc(n.from(e[1].bytes,"base64"))[0]};if("slice"===e[0])return{type:"slice",cell:o.Cell.fromBoc(n.from(e[1].bytes,"base64"))[0]};if("builder"===e[0])return{type:"builder",cell:o.Cell.fromBoc(n.from(e[1].bytes,"base64"))[0]};if("tuple"===e[0]||"list"===e[0])return 0===e[1].elements.length?{type:"null"}:{type:e[0],items:e[1].elements.map(s)};throw Error("Unsupported stack item type: "+e[0])}function l(e){let t=[];for(let r of e)t.push(a(r));return new o.TupleReader(t)}function c(e,t,r){return{async getState(){let r,i=await e.getContractState(t),o=i.balance,s=i.lastTransaction?{lt:BigInt(i.lastTransaction.lt),hash:n.from(i.lastTransaction.hash,"base64")}:null;if("active"===i.state)r={type:"active",code:i.code?i.code:null,data:i.data?i.data:null};else if("uninitialized"===i.state)r={type:"uninit"};else{if("frozen"!==i.state)throw Error("Unsupported state");r={type:"frozen",stateHash:n.alloc(0)}}return{balance:o,last:s,state:r}},get:async(r,n)=>({stack:(await e.callGetMethod(t,r,n)).stack}),async external(n){let i=null;r&&!await e.isContractDeployed(t)&&(i=r);const s=(0,o.external)({to:t,init:i,body:n});let a=(0,o.beginCell)().store((0,o.storeMessage)(s)).endCell().toBoc();await e.sendFile(a)},async internal(n,i){let s=null;r&&!await e.isContractDeployed(t)&&(s=r);let a,l=!0;null!==i.bounce&&void 0!==i.bounce&&(l=i.bounce),a="string"==typeof i.value?(0,o.toNano)(i.value):i.value;let c=null;"string"==typeof i.body?c=(0,o.comment)(i.body):i.body&&(c=i.body),await n.send({to:t,value:a,bounce:l,sendMode:i.sendMode,init:s,body:c})},open:t=>(0,o.openContract)(t,(t=>c(e,t.address,t.init??null))),getTransactions:(t,r,n,i)=>e.getTransactions(t,{limit:i??100,lt:r.toString(),hash:n.toString("base64"),inclusive:!0})}}t.TonClient=class{constructor(e){this.parameters={endpoint:e.endpoint},this.api=new i.HttpApi(this.parameters.endpoint,{timeout:e.timeout,apiKey:e.apiKey,adapter:e.httpAdapter})}async getBalance(e){return(await this.getContractState(e)).balance}async runMethod(e,t,r=[]){let n=await this.api.callGetMethod(e,t,r);if(0!==n.exit_code)throw Error("Unable to execute get method. Got exit_code: "+n.exit_code);return{gas_used:n.gas_used,stack:l(n.stack)}}async callGetMethod(e,t,r=[]){return this.runMethod(e,t,r)}async runMethodWithError(e,t,r=[]){let n=await this.api.callGetMethod(e,t,r);return{gas_used:n.gas_used,stack:l(n.stack),exit_code:n.exit_code}}async callGetMethodWithError(e,t,r=[]){return this.runMethodWithError(e,t,r)}async getTransactions(e,t){let r=await this.api.getTransactions(e,t),i=[];for(let e of r)i.push((0,o.loadTransaction)(o.Cell.fromBoc(n.from(e.data,"base64"))[0].beginParse()));return i}async getTransaction(e,t,r){let i=await this.api.getTransaction(e,t,r);return i?(0,o.loadTransaction)(o.Cell.fromBoc(n.from(i.data,"base64"))[0].beginParse()):null}async tryLocateResultTx(e,t,r){let n=await this.api.tryLocateResultTx(e,t,r);return(0,o.loadTransaction)(o.Cell.fromBase64(n.data).beginParse())}async tryLocateSourceTx(e,t,r){let n=await this.api.tryLocateSourceTx(e,t,r);return(0,o.loadTransaction)(o.Cell.fromBase64(n.data).beginParse())}async getMasterchainInfo(){let e=await this.api.getMasterchainInfo();return{workchain:e.init.workchain,shard:e.last.shard,initSeqno:e.init.seqno,latestSeqno:e.last.seqno}}async getWorkchainShards(e){return(await this.api.getShards(e)).map((e=>({workchain:e.workchain,shard:e.shard,seqno:e.seqno})))}async getShardTransactions(e,t,r){let n=await this.api.getBlockTransactions(e,t,r);if(n.incomplete)throw Error("Unsupported");return n.transactions.map((e=>({account:o.Address.parseRaw(e.account),lt:e.lt,hash:e.hash})))}async sendMessage(e){const t=(0,o.beginCell)().store((0,o.storeMessage)(e)).endCell().toBoc();await this.api.sendBoc(t)}async sendFile(e){await this.api.sendBoc(e)}async estimateExternalMessageFee(e,t){return await this.api.estimateFee(e,{body:t.body,initCode:t.initCode,initData:t.initData,ignoreSignature:t.ignoreSignature})}async sendExternalMessage(e,t){if(await this.isContractDeployed(e.address)||!e.init){const r=(0,o.external)({to:e.address,body:t});await this.sendMessage(r)}else{const r=(0,o.external)({to:e.address,init:e.init,body:t});await this.sendMessage(r)}}async isContractDeployed(e){return"active"===(await this.getContractState(e)).state}async getContractState(e){let t=await this.api.getAddressInformation(e);return{balance:BigInt(t.balance),state:t.state,code:""!==t.code?n.from(t.code,"base64"):null,data:""!==t.data?n.from(t.data,"base64"):null,lastTransaction:"0"!==t.last_transaction_id.lt?{lt:t.last_transaction_id.lt,hash:t.last_transaction_id.hash}:null,blockId:{workchain:t.block_id.workchain,shard:t.block_id.shard,seqno:t.block_id.seqno},timestampt:t.sync_utime}}open(e){return(0,o.openContract)(e,(e=>c(this,e.address,e.init)))}provider(e,t){return c(this,e,t??null)}}},993:function(e,t,r){"use strict";var n,i,o,s=r(8287).hp,a=this&&this.__classPrivateFieldSet||function(e,t,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(e,r):i?i.value=r:t.set(e,r),r},l=this&&this.__classPrivateFieldGet||function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)},c=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.TonClient4=void 0;const d=c(r(6425)),u=r(1307),h=r(8546),f=r(1614);function p(e,t,r,n){return{async getState(){let n=t;null===n&&(n=(await e.getLastBlock()).last.seqno);let i,o=await e.getAccount(n,r),a=o.account.last?{lt:BigInt(o.account.last.lt),hash:s.from(o.account.last.hash,"base64")}:null;if("active"===o.account.state.type)i={type:"active",code:o.account.state.code?s.from(o.account.state.code,"base64"):null,data:o.account.state.data?s.from(o.account.state.data,"base64"):null};else if("uninit"===o.account.state.type)i={type:"uninit"};else{if("frozen"!==o.account.state.type)throw Error("Unsupported state");i={type:"frozen",stateHash:s.from(o.account.state.stateHash,"base64")}}return{balance:BigInt(o.account.balance.coins),last:a,state:i}},async get(n,i){let o=t;null===o&&(o=(await e.getLastBlock()).last.seqno);let s=await e.runMethod(o,r,n,i);if(0!==s.exitCode&&1!==s.exitCode)throw Error("Exit code: "+s.exitCode);return{stack:new u.TupleReader(s.result)}},async external(t){let i=await e.getLastBlock(),o=null;n&&"active"!==(await e.getAccountLite(i.last.seqno,r)).account.state.type&&(o=n);const s=(0,u.external)({to:r,init:o,body:t});let a=(0,u.beginCell)().store((0,u.storeMessage)(s)).endCell().toBoc();await e.sendMessage(a)},async internal(t,i){let o=await e.getLastBlock(),s=null;n&&"active"!==(await e.getAccountLite(o.last.seqno,r)).account.state.type&&(s=n);let a,l=!0;null!==i.bounce&&void 0!==i.bounce&&(l=i.bounce),a="string"==typeof i.value?(0,u.toNano)(i.value):i.value;let c=null;"string"==typeof i.body?c=(0,u.comment)(i.body):i.body&&(c=i.body),await t.send({to:r,value:a,bounce:l,sendMode:i.sendMode,init:s,body:c})},open:r=>(0,u.openContract)(r,(r=>p(e,t,r.address,r.init??null))),async getTransactions(t,r,n,i){const o="number"==typeof i;if(o&&i<=0)return[];let s=[];do{const i=await e.getAccountTransactions(t,r,n),o=i[0].tx,[a,l]=[o.lt,o.hash()];if(s.length>0&&a===r&&l.equals(n)&&i.shift(),0===i.length)break;const c=i[i.length-1].tx,[d,u]=[c.lt,c.hash()];if(d===r&&u.equals(n))break;s.push(...i.map((e=>e.tx))),r=d,n=u}while(o&&s.length0&&(r="/"+[...t].sort().join(","));let s=await d.default.get(l(this,n,"f")+"/block/"+e+"/config"+r,{adapter:l(this,o,"f"),timeout:l(this,i,"f")}),a=_.safeParse(s.data);if(!a.success)throw Error("Mailformed response");return a.data}async runMethod(e,t,r,a){let c=a&&a.length>0?"/"+(0,h.toUrlSafe)((0,u.serializeTuple)(a).toBoc({idx:!1,crc32:!1}).toString("base64")):"",f=l(this,n,"f")+"/block/"+e+"/"+t.toString({urlSafe:!0})+"/run/"+encodeURIComponent(r)+c,p=await d.default.get(f,{adapter:l(this,o,"f"),timeout:l(this,i,"f")}),g=C.safeParse(p.data);if(!g.success)throw Error("Mailformed response");let m=g.data.resultRaw?(0,u.parseTuple)(u.Cell.fromBoc(s.from(g.data.resultRaw,"base64"))[0]):[];return{exitCode:g.data.exitCode,result:m,resultRaw:g.data.resultRaw,block:g.data.block,shardBlock:g.data.shardBlock,reader:new u.TupleReader(m)}}async sendMessage(e){let t=await d.default.post(l(this,n,"f")+"/send",{boc:e.toString("base64")},{adapter:l(this,o,"f"),timeout:l(this,i,"f")});if(!k.safeParse(t.data).success)throw Error("Mailformed response");return{status:t.data.status}}open(e){return(0,u.openContract)(e,(e=>p(this,null,e.address,e.init)))}openAt(e,t){return(0,u.openContract)(t,(t=>p(this,e,t.address,t.init)))}provider(e,t){return p(this,null,e,t??null)}providerAt(e,t,r){return p(this,e,t,r??null)}},n=new WeakMap,i=new WeakMap,o=new WeakMap;const g=f.z.object({last:f.z.object({seqno:f.z.number(),shard:f.z.string(),workchain:f.z.number(),fileHash:f.z.string(),rootHash:f.z.string()}),init:f.z.object({fileHash:f.z.string(),rootHash:f.z.string()}),stateRootHash:f.z.string(),now:f.z.number()}),m=f.z.union([f.z.object({exist:f.z.literal(!1)}),f.z.object({exist:f.z.literal(!0),block:f.z.object({shards:f.z.array(f.z.object({workchain:f.z.number(),seqno:f.z.number(),shard:f.z.string(),rootHash:f.z.string(),fileHash:f.z.string(),transactions:f.z.array(f.z.object({account:f.z.string(),hash:f.z.string(),lt:f.z.string()}))}))})})]),y=f.z.object({lastPaid:f.z.number(),duePayment:f.z.union([f.z.null(),f.z.string()]),used:f.z.object({bits:f.z.number(),cells:f.z.number(),publicCells:f.z.number()})}),b=f.z.object({account:f.z.object({state:f.z.union([f.z.object({type:f.z.literal("uninit")}),f.z.object({type:f.z.literal("active"),code:f.z.union([f.z.string(),f.z.null()]),data:f.z.union([f.z.string(),f.z.null()])}),f.z.object({type:f.z.literal("frozen"),stateHash:f.z.string()})]),balance:f.z.object({coins:f.z.string()}),last:f.z.union([f.z.null(),f.z.object({lt:f.z.string(),hash:f.z.string()})]),storageStat:f.z.union([f.z.null(),y])}),block:f.z.object({workchain:f.z.number(),seqno:f.z.number(),shard:f.z.string(),rootHash:f.z.string(),fileHash:f.z.string()})}),w=f.z.object({account:f.z.object({state:f.z.union([f.z.object({type:f.z.literal("uninit")}),f.z.object({type:f.z.literal("active"),codeHash:f.z.string(),dataHash:f.z.string()}),f.z.object({type:f.z.literal("frozen"),stateHash:f.z.string()})]),balance:f.z.object({coins:f.z.string()}),last:f.z.union([f.z.null(),f.z.object({lt:f.z.string(),hash:f.z.string()})]),storageStat:f.z.union([f.z.null(),y])})}),v=f.z.object({changed:f.z.boolean(),block:f.z.object({workchain:f.z.number(),seqno:f.z.number(),shard:f.z.string(),rootHash:f.z.string(),fileHash:f.z.string()})}),C=f.z.object({exitCode:f.z.number(),resultRaw:f.z.union([f.z.string(),f.z.null()]),block:f.z.object({workchain:f.z.number(),seqno:f.z.number(),shard:f.z.string(),rootHash:f.z.string(),fileHash:f.z.string()}),shardBlock:f.z.object({workchain:f.z.number(),seqno:f.z.number(),shard:f.z.string(),rootHash:f.z.string(),fileHash:f.z.string()})}),_=f.z.object({config:f.z.object({cell:f.z.string(),address:f.z.string(),globalBalance:f.z.object({coins:f.z.string()})})}),k=f.z.object({status:f.z.number()}),x=f.z.array(f.z.object({workchain:f.z.number(),seqno:f.z.number(),shard:f.z.string(),rootHash:f.z.string(),fileHash:f.z.string()})),A=f.z.object({blocks:x,boc:f.z.string()}),S=f.z.object({bits:f.z.number(),data:f.z.string()}),B=f.z.union([f.z.object({type:f.z.literal("internal"),value:f.z.string(),dest:f.z.string(),src:f.z.string(),bounced:f.z.boolean(),bounce:f.z.boolean(),ihrDisabled:f.z.boolean(),createdAt:f.z.number(),createdLt:f.z.string(),fwdFee:f.z.string(),ihrFee:f.z.string()}),f.z.object({type:f.z.literal("external-in"),dest:f.z.string(),src:f.z.union([S,f.z.null()]),importFee:f.z.string()}),f.z.object({type:f.z.literal("external-out"),dest:f.z.union([S,f.z.null()])})]),E=f.z.object({splitDepth:f.z.union([f.z.number(),f.z.null()]),code:f.z.union([f.z.string(),f.z.null()]),data:f.z.union([f.z.string(),f.z.null()]),special:f.z.union([f.z.object({tick:f.z.boolean(),tock:f.z.boolean()}),f.z.null()])}),I=f.z.object({body:f.z.string(),info:B,init:f.z.union([E,f.z.null()])}),P=f.z.union([f.z.literal("uninitialized"),f.z.literal("frozen"),f.z.literal("active"),f.z.literal("non-existing")]),M=f.z.union([f.z.object({type:f.z.literal("comment"),comment:f.z.string()}),f.z.object({type:f.z.literal("payload"),cell:f.z.string()})]),U=f.z.union([f.z.object({kind:f.z.literal("ton"),amount:f.z.string()}),f.z.object({kind:f.z.literal("token"),amount:f.z.string()})]),T=f.z.union([f.z.literal("jetton::excesses"),f.z.literal("jetton::transfer"),f.z.literal("jetton::transfer_notification"),f.z.literal("deposit"),f.z.literal("deposit::ok"),f.z.literal("withdraw"),f.z.literal("withdraw::all"),f.z.literal("withdraw::delayed"),f.z.literal("withdraw::ok"),f.z.literal("airdrop")]),O=f.z.object({type:T,options:f.z.optional(f.z.record(f.z.string()))}),R=f.z.object({address:f.z.string(),comment:f.z.optional(f.z.string()),items:f.z.array(U),op:f.z.optional(O)}),j=f.z.object({address:f.z.string(),lt:f.z.string(),hash:f.z.string(),prevTransaction:f.z.object({lt:f.z.string(),hash:f.z.string()}),time:f.z.number(),outMessagesCount:f.z.number(),oldStatus:P,newStatus:P,fees:f.z.string(),update:f.z.object({oldHash:f.z.string(),newHash:f.z.string()}),inMessage:f.z.union([I,f.z.null()]),outMessages:f.z.array(I),parsed:f.z.object({seqno:f.z.union([f.z.number(),f.z.null()]),body:f.z.union([M,f.z.null()]),status:f.z.union([f.z.literal("success"),f.z.literal("failed"),f.z.literal("pending")]),dest:f.z.union([f.z.string(),f.z.null()]),kind:f.z.union([f.z.literal("out"),f.z.literal("in")]),amount:f.z.string(),resolvedAddress:f.z.string(),bounced:f.z.boolean(),mentioned:f.z.array(f.z.string())}),operation:R}),L=f.z.object({blocks:x,transactions:f.z.array(j)})},1972:function(e,t,r){"use strict";var n=r(8287).hp,i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.HttpApi=void 0;const o=r(2411),s=i(r(9302)),a=i(r(6425)),l=r(1614),c=r(8585).rE,d=l.z.object({"@type":l.z.literal("ton.blockIdExt"),workchain:l.z.number(),shard:l.z.string(),seqno:l.z.number(),root_hash:l.z.string(),file_hash:l.z.string()}),u=l.z.object({balance:l.z.union([l.z.number(),l.z.string()]),state:l.z.union([l.z.literal("active"),l.z.literal("uninitialized"),l.z.literal("frozen")]),data:l.z.string(),code:l.z.string(),last_transaction_id:l.z.object({"@type":l.z.literal("internal.transactionId"),lt:l.z.string(),hash:l.z.string()}),block_id:d,sync_utime:l.z.number()}),h=l.z.object({"@type":l.z.literal("ok")}),f=l.z.object({"@type":l.z.literal("query.fees"),source_fees:l.z.object({"@type":l.z.literal("fees"),in_fwd_fee:l.z.number(),storage_fee:l.z.number(),gas_fee:l.z.number(),fwd_fee:l.z.number()})}),p=l.z.object({gas_used:l.z.number(),exit_code:l.z.number(),stack:l.z.array(l.z.unknown())}),g=l.z.union([l.z.object({"@type":l.z.literal("msg.dataRaw"),body:l.z.string()}),l.z.object({"@type":l.z.literal("msg.dataText"),text:l.z.string()}),l.z.object({"@type":l.z.literal("msg.dataDecryptedText"),text:l.z.string()}),l.z.object({"@type":l.z.literal("msg.dataEncryptedText"),text:l.z.string()})]),m=l.z.object({source:l.z.string(),destination:l.z.string(),value:l.z.string(),fwd_fee:l.z.string(),ihr_fee:l.z.string(),created_lt:l.z.string(),body_hash:l.z.string(),msg_data:g,message:l.z.string()}),y=l.z.object({data:l.z.string(),utime:l.z.number(),transaction_id:l.z.object({lt:l.z.string(),hash:l.z.string()}),fee:l.z.string(),storage_fee:l.z.string(),other_fee:l.z.string(),in_msg:l.z.union([l.z.undefined(),m]),out_msgs:l.z.array(m)}),b=l.z.array(y),w=l.z.object({state_root_hash:l.z.string(),last:d,init:d}),v=l.z.object({shards:l.z.array(d)}),C=l.z.object({"@type":l.z.literal("blocks.shortTxId"),mode:l.z.number(),account:l.z.string(),lt:l.z.string(),hash:l.z.string()}),_=l.z.object({id:d,req_count:l.z.number(),incomplete:l.z.boolean(),transactions:l.z.array(C)});class k{constructor(e,t,r,n){this.namespace=e,this.cache=t,this.codec=r,this.keyEncoder=n}async get(e){let t=await this.cache.get(this.namespace,this.keyEncoder(e));if(t){let e=this.codec.safeParse(JSON.parse(t));if(e.success)return e.data}return null}async set(e,t){null!==t?await this.cache.set(this.namespace,this.keyEncoder(e),JSON.stringify(t)):await this.cache.set(this.namespace,this.keyEncoder(e),null)}}function x(e){let t=[];for(let r of e)if("int"===r.type)t.push(["num",r.value.toString()]);else if("cell"===r.type)t.push(["tvm.Cell",r.cell.toBoc().toString("base64")]);else if("slice"===r.type)t.push(["tvm.Slice",r.cell.toBoc().toString("base64")]);else{if("builder"!==r.type)throw Error("Unsupported stack item type: "+r.type);t.push(["tvm.Builder",r.cell.toBoc().toString("base64")])}return t}t.HttpApi=class{constructor(e,t){this.endpoint=e,this.cache=new o.InMemoryCache,this.parameters={timeout:t?.timeout||3e4,apiKey:t?.apiKey,adapter:t?.adapter},this.shardCache=new k("ton-shard",this.cache,l.z.array(d),(e=>e+"")),this.shardLoader=new s.default((async e=>await Promise.all(e.map((async e=>{const t=await this.shardCache.get(e);if(t)return t;let r=(await this.doCall("shards",{seqno:e},v)).shards;return await this.shardCache.set(e,r),r}))))),this.shardTransactionsCache=new k("ton-shard-tx",this.cache,_,(e=>e.workchain+":"+e.shard+":"+e.seqno)),this.shardTransactionsLoader=new s.default((async e=>await Promise.all(e.map((async e=>{const t=await this.shardTransactionsCache.get(e);if(t)return t;let r=await this.doCall("getBlockTransactions",{workchain:e.workchain,seqno:e.seqno,shard:e.shard},_);return await this.shardTransactionsCache.set(e,r),r})))),{cacheKeyFn:e=>e.workchain+":"+e.shard+":"+e.seqno})}getAddressInformation(e){return this.doCall("getAddressInformation",{address:e.toString()},u)}async getTransactions(e,t){const r=t.inclusive;let i;delete t.inclusive,t.hash&&(i=n.from(t.hash,"base64").toString("hex"));let o=t.limit;t.hash&&t.lt&&!0!==r&&o++;let s=await this.doCall("getTransactions",{address:e.toString(),...t,limit:o,hash:i},b);return s.length>o&&(s=s.slice(0,o)),t.hash&&t.lt&&!0!==r?(s.shift(),s):s}async getMasterchainInfo(){return await this.doCall("getMasterchainInfo",{},w)}async getShards(e){return await this.shardLoader.load(e)}async getBlockTransactions(e,t,r){return await this.shardTransactionsLoader.load({workchain:e,seqno:t,shard:r})}async getTransaction(e,t,r){let i=n.from(r,"base64").toString("hex");return(await this.doCall("getTransactions",{address:e.toString(),lt:t,hash:i,limit:1},b)).find((e=>e.transaction_id.lt===t&&e.transaction_id.hash===r))||null}async callGetMethod(e,t,r){return await this.doCall("runGetMethod",{address:e.toString(),method:t,stack:x(r)},p)}async sendBoc(e){await this.doCall("sendBoc",{boc:e.toString("base64")},h)}async estimateFee(e,t){return await this.doCall("estimateFee",{address:e.toString(),body:t.body.toBoc().toString("base64"),init_data:t.initData?t.initData.toBoc().toString("base64"):"",init_code:t.initCode?t.initCode.toBoc().toString("base64"):"",ignore_chksig:t.ignoreSignature},f)}async tryLocateResultTx(e,t,r){return await this.doCall("tryLocateResultTx",{source:e.toString(),destination:t.toString(),created_lt:r},y)}async tryLocateSourceTx(e,t,r){return await this.doCall("tryLocateSourceTx",{source:e.toString(),destination:t.toString(),created_lt:r},y)}async doCall(e,t,r){let n={"Content-Type":"application/json","X-Ton-Client-Version":c};this.parameters.apiKey&&(n["X-API-Key"]=this.parameters.apiKey);let i=await a.default.post(this.endpoint,JSON.stringify({id:"1",jsonrpc:"2.0",method:e,params:t}),{headers:n,timeout:this.parameters.timeout,adapter:this.parameters.adapter});if(200!==i.status||!i.data.ok)throw Error("Received error: "+JSON.stringify(i.data));let o=r.safeParse(i.data.result);if(o.success)return o.data;throw Error("Malformed response: "+o.error.format()._errors.join(", "))}}},2411:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InMemoryCache=void 0,t.InMemoryCache=class{constructor(){this.cache=new Map,this.set=async(e,t,r)=>{null!==r?this.cache.set(e+"$$"+t,r):this.cache.delete(e+"$$"+t)},this.get=async(e,t)=>{let r=this.cache.get(e+"$$"+t);return void 0!==r?r:null}}}},7017:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseFullConfig=t.loadConfigParamsAsSlice=t.loadConfigParamById=t.parseVotingSetup=t.parseProposalSetup=t.configParse29=t.configParse28=t.configParseMsgPrices=t.configParseGasLimitsPrices=t.configParseBridge=t.configParseValidatorSet=t.configParse12=t.configParseWorkchainDescriptor=t.configParse40=t.configParse8=t.configParse18=t.configParse17=t.configParse16=t.configParse15=t.configParse13=t.configParse5=t.configParseMasterAddressRequired=t.parseBridge=t.parseValidatorSet=t.configParseMasterAddress=void 0;const n=r(1307);function i(e){return e?new n.Address(-1,e.loadBuffer(32)):null}function o(e){if(2390828938!==e.loadUint(32))throw Error("Invalid config");return e.loadBuffer(32)}t.configParseMasterAddress=i;const s={serialize(e,t){throw Error("not implemented")},parse(e){const t=e.loadUint(8);if(83===t)return{publicKey:o(e),weight:e.loadUintBig(64),adnlAddress:null};if(115===t)return{publicKey:o(e),weight:e.loadUintBig(64),adnlAddress:e.loadBuffer(32)};throw Error("Invalid config")}};function a(e){const t=e.loadUint(8);return 17===t?{timeSince:e.loadUint(32),timeUntil:e.loadUint(32),total:e.loadUint(16),main:e.loadUint(16),totalWeight:null,list:e.loadDictDirect(n.Dictionary.Keys.Uint(16),s)}:18===t?{timeSince:e.loadUint(32),timeUntil:e.loadUint(32),total:e.loadUint(16),main:e.loadUint(16),totalWeight:e.loadUintBig(64),list:e.loadDict(n.Dictionary.Keys.Uint(16),s)}:void 0}function l(e){const t=new n.Address(-1,e.loadBuffer(32)),r=new n.Address(-1,e.loadBuffer(32)),i=e.loadDict(n.Dictionary.Keys.Buffer(32),n.Dictionary.Values.Buffer(32)),o=new Map;for(const[e,t]of i)o.set(new n.Address(-1,e).toString(),t);return{bridgeAddress:t,oracleMultisigAddress:r,oracles:o,externalChainAddress:e.loadBuffer(32)}}function c(e){if(!e)throw Error("Invalid config");return i(e)}function d(e){if(!e)throw Error("Invalid config");if(1===e.loadUint(8))return{blackholeAddr:e.loadBit()?new n.Address(-1,e.loadBuffer(32)):null,feeBurnNominator:e.loadUint(32),feeBurnDenominator:e.loadUint(32)};throw new Error("Invalid config")}function u(e){if(!e)throw Error("Invalid config");return{validatorsElectedFor:e.loadUint(32),electorsStartBefore:e.loadUint(32),electorsEndBefore:e.loadUint(32),stakeHeldFor:e.loadUint(32)}}function h(e){if(!e)throw Error("Invalid config");return{maxValidators:e.loadUint(16),maxMainValidators:e.loadUint(16),minValidators:e.loadUint(16)}}function f(e){if(!e)throw Error("Invalid config");return{minStake:e.loadCoins(),maxStake:e.loadCoins(),minTotalStake:e.loadCoins(),maxStakeFactor:e.loadUint(32)}}t.parseValidatorSet=a,t.parseBridge=l,t.configParseMasterAddressRequired=c,t.configParse5=d,t.configParse13=function(e){if(!e)throw Error("Invalid config");if(26===e.loadUint(8))return{deposit:e.loadCoins(),bitPrice:e.loadCoins(),cellPrice:e.loadCoins()};throw new Error("Invalid config")},t.configParse15=u,t.configParse16=h,t.configParse17=f;const p={serialize(e,t){throw Error("not implemented")},parse(e){if(204!==e.loadUint(8))throw Error("Invalid config");return{utime_since:e.loadUint(32),bit_price_ps:e.loadUintBig(64),cell_price_ps:e.loadUintBig(64),mc_bit_price_ps:e.loadUintBig(64),mc_cell_price_ps:e.loadUintBig(64)}}};function g(e){if(!e)throw Error("Invalid config");return e.loadDictDirect(n.Dictionary.Keys.Buffer(4),p).values()}function m(e){return e?{version:e.loadUint(32),capabilities:e.loadUintBig(64)}:{version:0,capabilities:0n}}function y(e){if(!e)return null;if(1!==e.loadUint(8))throw Error("Invalid config");return{defaultFlatFine:e.loadCoins(),defaultProportionaFine:e.loadCoins(),severityFlatMult:e.loadUint(16),severityProportionalMult:e.loadUint(16),unfunishableInterval:e.loadUint(16),longInterval:e.loadUint(16),longFlatMult:e.loadUint(16),longProportionalMult:e.loadUint(16),mediumInterval:e.loadUint(16),mediumFlatMult:e.loadUint(16),mediumProportionalMult:e.loadUint(16)}}t.configParse18=g,t.configParse8=m,t.configParse40=y,t.configParseWorkchainDescriptor=function(e){if(166!==e.loadUint(8))throw Error("Invalid config");const t=e.loadUint(32),r=e.loadUint(8),n=e.loadUint(8),i=e.loadUint(8),o=e.loadBit(),s=e.loadBit(),a=e.loadBit(),l=e.loadUint(13),c=e.loadBuffer(32),d=e.loadBuffer(32),u=e.loadUint(32);if(e.loadBit())throw Error("Invalid config");return{enabledSince:t,actialMinSplit:r,min_split:n,max_split:i,basic:o,active:s,accept_msgs:a,flags:l,zerostateRootHash:c,zerostateFileHash:d,version:u,format:{vmVersion:e.loadUint(32),vmMode:e.loadUintBig(64)}}};const b={serialize(e,t){throw Error("not implemented")},parse(e){if(166!==e.loadUint(8))throw Error("Invalid config");const t=e.loadUint(32),r=e.loadUint(8),n=e.loadUint(8),i=e.loadUint(8),o=e.loadBit(),s=e.loadBit(),a=e.loadBit(),l=e.loadUint(13),c=e.loadBuffer(32),d=e.loadBuffer(32),u=e.loadUint(32);if(e.loadBit())throw Error("Invalid config");return{enabledSince:t,actialMinSplit:r,min_split:n,max_split:i,basic:o,active:s,accept_msgs:a,flags:l,zerostateRootHash:c,zerostateFileHash:d,version:u,format:{vmVersion:e.loadUint(32),vmMode:e.loadUintBig(64)}}}};function w(e){if(!e)throw Error("Invalid config");const t=e.loadDict(n.Dictionary.Keys.Uint(32),b);if(t)return t;throw Error("No workchains exist")}function v(e){return e?a(e):null}function C(e){return e?l(e):null}function _(e){if(!e)throw Error("Invalid config");if(209===e.loadUint(8)){const t=e.loadUintBig(64),r=e.loadUintBig(64),n=function(e){const t=e.loadUint(8);if(222===t)return{gasPrice:e.loadUintBig(64),gasLimit:e.loadUintBig(64),specialGasLimit:e.loadUintBig(64),gasCredit:e.loadUintBig(64),blockGasLimit:e.loadUintBig(64),freezeDueLimit:e.loadUintBig(64),deleteDueLimit:e.loadUintBig(64)};if(221===t)return{gasPrice:e.loadUintBig(64),gasLimit:e.loadUintBig(64),gasCredit:e.loadUintBig(64),blockGasLimit:e.loadUintBig(64),freezeDueLimit:e.loadUintBig(64),deleteDueLimit:e.loadUintBig(64)};throw Error("Invalid config")}(e);return{flatLimit:t,flatGasPrice:r,other:n}}throw Error("Invalid config")}function k(e){if(!e)throw new Error("Invalid config");if(234!==e.loadUint(8))throw new Error("Invalid msg prices param");return{lumpPrice:e.loadUintBig(64),bitPrice:e.loadUintBig(64),cellPrice:e.loadUintBig(64),ihrPriceFactor:e.loadUint(32),firstFrac:e.loadUint(16),nextFrac:e.loadUint(16)}}function x(e){if(!e)throw new Error("Invalid config");const t=e.loadUint(8);if(193===t)return{masterCatchainLifetime:e.loadUint(32),shardCatchainLifetime:e.loadUint(32),shardValidatorsLifetime:e.loadUint(32),shardValidatorsCount:e.loadUint(32)};if(194===t)return{flags:e.loadUint(7),suffleMasterValidators:e.loadBit(),masterCatchainLifetime:e.loadUint(32),shardCatchainLifetime:e.loadUint(32),shardValidatorsLifetime:e.loadUint(32),shardValidatorsCount:e.loadUint(32)};throw new Error("Invalid config")}function A(e){if(!e)throw new Error("Invalid config");const t=e.loadUint(8);if(214===t)return{roundCandidates:e.loadUint(32),nextCandidateDelay:e.loadUint(32),consensusTimeout:e.loadUint(32),fastAttempts:e.loadUint(32),attemptDuration:e.loadUint(32),catchainMaxDeps:e.loadUint(32),maxBlockBytes:e.loadUint(32),maxColaltedBytes:e.loadUint(32)};if(215===t)return{flags:e.loadUint(7),newCatchainIds:e.loadBit(),roundCandidates:e.loadUint(8),nextCandidateDelay:e.loadUint(32),consensusTimeout:e.loadUint(32),fastAttempts:e.loadUint(32),attemptDuration:e.loadUint(32),catchainMaxDeps:e.loadUint(32),maxBlockBytes:e.loadUint(32),maxColaltedBytes:e.loadUint(32)};if(216===t)return{flags:e.loadUint(7),newCatchainIds:e.loadBit(),roundCandidates:e.loadUint(8),nextCandidateDelay:e.loadUint(32),consensusTimeout:e.loadUint(32),fastAttempts:e.loadUint(32),attemptDuration:e.loadUint(32),catchainMaxDeps:e.loadUint(32),maxBlockBytes:e.loadUint(32),maxColaltedBytes:e.loadUint(32),protoVersion:e.loadUint(16)};if(217===t)return{flags:e.loadUint(7),newCatchainIds:e.loadBit(),roundCandidates:e.loadUint(8),nextCandidateDelay:e.loadUint(32),consensusTimeout:e.loadUint(32),fastAttempts:e.loadUint(32),attemptDuration:e.loadUint(32),catchainMaxDeps:e.loadUint(32),maxBlockBytes:e.loadUint(32),maxColaltedBytes:e.loadUint(32),protoVersion:e.loadUint(16),catchainMaxBlocksCoeff:e.loadUint(32)};throw new Error("Invalid config")}function S(e){if(54!==e.loadUint(8))throw new Error("Invalid config");return{minTotalRounds:e.loadUint(8),maxTotalRounds:e.loadUint(8),minWins:e.loadUint(8),maxLoses:e.loadUint(8),minStoreSec:e.loadUint(32),maxStoreSec:e.loadUint(32),bitPrice:e.loadUint(32),cellPrice:e.loadUint(32)}}function B(e){if(!e)throw new Error("Invalid config");if(145!==e.loadUint(8))throw new Error("Invalid config");return{normalParams:S(e.loadRef().beginParse()),criticalParams:S(e.loadRef().beginParse())}}function E(e){return n.Cell.fromBase64(e).beginParse().loadDictDirect(n.Dictionary.Keys.Int(32),n.Dictionary.Values.Cell())}t.configParse12=w,t.configParseValidatorSet=v,t.configParseBridge=C,t.configParseGasLimitsPrices=_,t.configParseMsgPrices=k,t.configParse28=x,t.configParse29=A,t.parseProposalSetup=S,t.parseVotingSetup=B,t.loadConfigParamById=function(e,t){return E(e).get(t)},t.loadConfigParamsAsSlice=function(e){const t=E(e),r=new Map;for(const[e,n]of t)r.set(e,n.beginParse());return r},t.parseFullConfig=function(e){return{configAddress:c(e.get(0)),electorAddress:c(e.get(1)),minterAddress:i(e.get(2)),feeCollectorAddress:i(e.get(3)),dnsRootAddress:i(e.get(4)),burningConfig:d(e.get(5)),globalVersion:m(e.get(8)),workchains:w(e.get(12)),voting:B(e.get(11)),validators:{...u(e.get(15)),...h(e.get(16)),...f(e.get(17))},storagePrices:g(e.get(18)),gasPrices:{masterchain:_(e.get(20)),workchain:_(e.get(21))},msgPrices:{masterchain:k(e.get(24)),workchain:k(e.get(25))},validatorSets:{prevValidators:v(e.get(32)),prevTempValidators:v(e.get(33)),currentValidators:v(e.get(34)),currentTempValidators:v(e.get(35)),nextValidators:v(e.get(36)),nextTempValidators:v(e.get(37))},validatorsPunish:y(e.get(40)),bridges:{ethereum:C(e.get(71)),binance:C(e.get(72)),polygon:C(e.get(73))},catchain:x(e.get(28)),consensus:A(e.get(29))}}},8078:(e,t,r)=>{"use strict";var n=r(8287).hp;Object.defineProperty(t,"__esModule",{value:!0}),t.ElectorContract=void 0;const i=r(1307),o={serialize(e,t){throw Error("not implemented")},parse:e=>({address:new i.Address(-1,e.loadBuffer(32)),weight:e.loadUintBig(64),stake:e.loadCoins()})},s={serialize(e,t){throw Error("not implemented")},parse(e){const t=e.loadCoins();return e.skip(64),{stake:t,address:new i.Address(-1,e.loadBuffer(32)),adnl:e.loadBuffer(32)}}};class a{static create(){return new a}constructor(){this.address=i.Address.parseRaw("-1:3333333333333333333333333333333333333333333333333333333333333333")}async getReturnedStake(e,t){if(-1!==t.workChain)throw Error("Only masterchain addresses could have stake");return(await e.get("compute_returned_stake",[{type:"int",value:BigInt("0x"+t.hash.toString("hex"))}])).stack.readBigNumber()}async getPastElectionsList(e){const t=await e.get("past_elections_list",[]),r=new i.TupleReader(t.stack.readLispList()),n=[];for(;r.remaining>0;){const e=r.readTuple(),t=e.readNumber(),i=e.readNumber();e.pop();const o=e.readNumber();n.push({id:t,unfreezeAt:i,stakeHeld:o})}return n}async getPastElections(e){const t=await e.get("past_elections",[]),r=new i.TupleReader(t.stack.readLispList()),n=[];for(;r.remaining>0;){const e=r.readTuple(),t=e.readNumber(),s=e.readNumber(),a=e.readNumber();e.pop();const l=e.readCell(),c=e.readBigNumber(),d=e.readBigNumber();let u=new Map;const h=l.beginParse().loadDictDirect(i.Dictionary.Keys.Buffer(32),o);for(const[e,t]of h)u.set(BigInt("0x"+e.toString("hex")).toString(10),{address:t.address,weight:t.weight,stake:t.stake});n.push({id:t,unfreezeAt:s,stakeHeld:a,totalStake:c,bonuses:d,frozen:u})}return n}async getElectionEntities(e){const t=await e.getState();if("active"!==t.state.type)throw Error("Unexpected error");const r=i.Cell.fromBoc(t.state.data)[0].beginParse();if(!r.loadBit())return null;const n=r.loadRef().beginParse(),o=n.loadUint(32),a=n.loadUint(32),l=n.loadCoins(),c=n.loadCoins(),d=n.loadDict(i.Dictionary.Keys.Buffer(32),s);let u=[];if(d)for(const[e,t]of d)u.push({pubkey:e,stake:t.stake,address:t.address,adnl:t.adnl});return{minStake:l,allStakes:c,endElectionsTime:a,startWorkTime:o,entities:u}}async getActiveElectionId(e){const t=(await e.get("active_election_id",[])).stack.readNumber();return t>0?t:null}async getComplaints(e,t){const r=new i.TupleBuilder;r.writeNumber(t);const o=await e.get("list_complaints",r.build());if("null"===o.stack.peek().type)return[];const s=new i.TupleReader(o.stack.readLispList()),a=[];for(;s.remaining>0;){const e=s.readTuple(),t=e.readBigNumber(),r=e.readTuple(),o=r.readTuple(),l=n.from(o.readBigNumber().toString(16),"hex"),c=(o.readCell(),o.readNumber()),d=o.readNumber(),u=new i.Address(-1,n.from(o.readBigNumber().toString(16),"hex")),h=o.readBigNumber(),f=o.readBigNumber(),p=o.readBigNumber(),g=[],m=new i.TupleReader(r.readLispList());for(;m.remaining>0;)g.push(m.readNumber());const y=r.readBigNumber(),b=r.readBigNumber();a.push({id:t,publicKey:l,createdAt:c,severity:d,paid:h,suggestedFine:f,suggestedFinePart:p,rewardAddress:u,votes:g,remainingWeight:b,vsetId:y})}return a}}t.ElectorContract=a},3515:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.computeStorageFees=t.computeMessageForwardFees=t.computeGasPrices=t.computeFwdFees=t.computeExternalMessageFees=t.loadConfigParamsAsSlice=t.loadConfigParamById=t.parseFullConfig=t.parseVotingSetup=t.parseValidatorSet=t.parseProposalSetup=t.parseBridge=t.configParseWorkchainDescriptor=t.configParseValidatorSet=t.configParseMsgPrices=t.configParseMasterAddressRequired=t.configParseMasterAddress=t.configParseGasLimitsPrices=t.configParseBridge=t.configParse40=t.configParse29=t.configParse28=t.configParse18=t.configParse17=t.configParse16=t.configParse15=t.configParse13=t.configParse12=t.configParse8=t.configParse5=t.ElectorContract=t.MultisigWallet=t.MultisigOrderBuilder=t.MultisigOrder=t.JettonWallet=t.JettonMaster=t.WalletContractV4=t.WalletContractV3R2=t.WalletContractV3R1=t.WalletContractV2R2=t.WalletContractV2R1=t.WalletContractV1R3=t.WalletContractV1R2=t.WalletContractV1R1=t.TonClient4=t.TonClient=t.HttpApi=void 0,i(r(1307),t);var o=r(1972);Object.defineProperty(t,"HttpApi",{enumerable:!0,get:function(){return o.HttpApi}});var s=r(8737);Object.defineProperty(t,"TonClient",{enumerable:!0,get:function(){return s.TonClient}});var a=r(993);Object.defineProperty(t,"TonClient4",{enumerable:!0,get:function(){return a.TonClient4}});var l=r(4471);Object.defineProperty(t,"WalletContractV1R1",{enumerable:!0,get:function(){return l.WalletContractV1R1}});var c=r(746);Object.defineProperty(t,"WalletContractV1R2",{enumerable:!0,get:function(){return c.WalletContractV1R2}});var d=r(3273);Object.defineProperty(t,"WalletContractV1R3",{enumerable:!0,get:function(){return d.WalletContractV1R3}});var u=r(1902);Object.defineProperty(t,"WalletContractV2R1",{enumerable:!0,get:function(){return u.WalletContractV2R1}});var h=r(9579);Object.defineProperty(t,"WalletContractV2R2",{enumerable:!0,get:function(){return h.WalletContractV2R2}});var f=r(9145);Object.defineProperty(t,"WalletContractV3R1",{enumerable:!0,get:function(){return f.WalletContractV3R1}});var p=r(8784);Object.defineProperty(t,"WalletContractV3R2",{enumerable:!0,get:function(){return p.WalletContractV3R2}});var g=r(7941);Object.defineProperty(t,"WalletContractV4",{enumerable:!0,get:function(){return g.WalletContractV4}});var m=r(4440);Object.defineProperty(t,"JettonMaster",{enumerable:!0,get:function(){return m.JettonMaster}});var y=r(5411);Object.defineProperty(t,"JettonWallet",{enumerable:!0,get:function(){return y.JettonWallet}});var b=r(4204);Object.defineProperty(t,"MultisigOrder",{enumerable:!0,get:function(){return b.MultisigOrder}});var w=r(9673);Object.defineProperty(t,"MultisigOrderBuilder",{enumerable:!0,get:function(){return w.MultisigOrderBuilder}});var v=r(2227);Object.defineProperty(t,"MultisigWallet",{enumerable:!0,get:function(){return v.MultisigWallet}});var C=r(8078);Object.defineProperty(t,"ElectorContract",{enumerable:!0,get:function(){return C.ElectorContract}});var _=r(7017);Object.defineProperty(t,"configParse5",{enumerable:!0,get:function(){return _.configParse5}}),Object.defineProperty(t,"configParse8",{enumerable:!0,get:function(){return _.configParse8}}),Object.defineProperty(t,"configParse12",{enumerable:!0,get:function(){return _.configParse12}}),Object.defineProperty(t,"configParse13",{enumerable:!0,get:function(){return _.configParse13}}),Object.defineProperty(t,"configParse15",{enumerable:!0,get:function(){return _.configParse15}}),Object.defineProperty(t,"configParse16",{enumerable:!0,get:function(){return _.configParse16}}),Object.defineProperty(t,"configParse17",{enumerable:!0,get:function(){return _.configParse17}}),Object.defineProperty(t,"configParse18",{enumerable:!0,get:function(){return _.configParse18}}),Object.defineProperty(t,"configParse28",{enumerable:!0,get:function(){return _.configParse28}}),Object.defineProperty(t,"configParse29",{enumerable:!0,get:function(){return _.configParse29}}),Object.defineProperty(t,"configParse40",{enumerable:!0,get:function(){return _.configParse40}}),Object.defineProperty(t,"configParseBridge",{enumerable:!0,get:function(){return _.configParseBridge}}),Object.defineProperty(t,"configParseGasLimitsPrices",{enumerable:!0,get:function(){return _.configParseGasLimitsPrices}}),Object.defineProperty(t,"configParseMasterAddress",{enumerable:!0,get:function(){return _.configParseMasterAddress}}),Object.defineProperty(t,"configParseMasterAddressRequired",{enumerable:!0,get:function(){return _.configParseMasterAddressRequired}}),Object.defineProperty(t,"configParseMsgPrices",{enumerable:!0,get:function(){return _.configParseMsgPrices}}),Object.defineProperty(t,"configParseValidatorSet",{enumerable:!0,get:function(){return _.configParseValidatorSet}}),Object.defineProperty(t,"configParseWorkchainDescriptor",{enumerable:!0,get:function(){return _.configParseWorkchainDescriptor}}),Object.defineProperty(t,"parseBridge",{enumerable:!0,get:function(){return _.parseBridge}}),Object.defineProperty(t,"parseProposalSetup",{enumerable:!0,get:function(){return _.parseProposalSetup}}),Object.defineProperty(t,"parseValidatorSet",{enumerable:!0,get:function(){return _.parseValidatorSet}}),Object.defineProperty(t,"parseVotingSetup",{enumerable:!0,get:function(){return _.parseVotingSetup}}),Object.defineProperty(t,"parseFullConfig",{enumerable:!0,get:function(){return _.parseFullConfig}}),Object.defineProperty(t,"loadConfigParamById",{enumerable:!0,get:function(){return _.loadConfigParamById}}),Object.defineProperty(t,"loadConfigParamsAsSlice",{enumerable:!0,get:function(){return _.loadConfigParamsAsSlice}});var k=r(868);Object.defineProperty(t,"computeExternalMessageFees",{enumerable:!0,get:function(){return k.computeExternalMessageFees}}),Object.defineProperty(t,"computeFwdFees",{enumerable:!0,get:function(){return k.computeFwdFees}}),Object.defineProperty(t,"computeGasPrices",{enumerable:!0,get:function(){return k.computeGasPrices}}),Object.defineProperty(t,"computeMessageForwardFees",{enumerable:!0,get:function(){return k.computeMessageForwardFees}}),Object.defineProperty(t,"computeStorageFees",{enumerable:!0,get:function(){return k.computeStorageFees}})},4440:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.JettonMaster=void 0;const n=r(1307);class i{static create(e){return new i(e)}constructor(e){this.address=e}async getWalletAddress(e,t){return(await e.get("get_wallet_address",[{type:"slice",cell:(0,n.beginCell)().storeAddress(t).endCell()}])).stack.readAddress()}async getJettonData(e){let t=await e.get("get_jetton_data",[]);return{totalSupply:t.stack.readBigNumber(),mintable:t.stack.readBoolean(),adminAddress:t.stack.readAddress(),content:t.stack.readCell(),walletCode:t.stack.readCell()}}}t.JettonMaster=i},5411:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.JettonWallet=void 0;class r{static create(e){return new r(e)}constructor(e){this.address=e}async getBalance(e){return"active"!==(await e.getState()).state.type?0n:(await e.get("get_wallet_data",[])).stack.readBigNumber()}}t.JettonWallet=r},4204:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MultisigOrder=void 0;const n=r(5269),i=r(1307);class o{constructor(e){this.signatures={},this.payload=e}static fromCell(e){let t=e.beginParse(),r=t.loadMaybeRef()?.beginParse();const n=t.asCell();let i=new o(n);if(r){for(;r.remainingBits>0;){const e=r.loadBuffer(64),t=r.loadUint(8);i.signatures[t]=e,r.remainingRefs>0?r=r.loadRef().asSlice():r.skip(1)}r.endParse()}return i}static fromPayload(e){return new o(e)}addSignature(e,t,r){const i=this.payload.hash();if(!(0,n.signVerify)(i,t,r.owners.get(e).slice(0,-1)))throw Error("invalid signature");this.signatures[e]=t}sign(e,t){const r=this.payload.hash();return this.signatures[e]=(0,n.sign)(r,t),r}unionSignatures(e){this.signatures=Object.assign({},this.signatures,e.signatures)}clearSignatures(){this.signatures={}}toCell(e){let t=(0,i.beginCell)().storeBit(0);for(const e in this.signatures){const r=this.signatures[e];t=(0,i.beginCell)().storeBit(1).storeRef((0,i.beginCell)().storeBuffer(r).storeUint(parseInt(e),8).storeBuilder(t).endCell())}return(0,i.beginCell)().storeUint(e,8).storeBuilder(t).storeBuilder(this.payload.asBuilder()).endCell()}}t.MultisigOrder=o},9673:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MultisigOrderBuilder=void 0;const n=r(1307),i=r(4204);t.MultisigOrderBuilder=class{constructor(e,t){this.messages=(0,n.beginCell)(),this.queryId=0n,this.walletId=e,this.queryOffset=t||7200}addMessage(e,t){if(this.messages.refs>=4)throw Error("only 4 refs are allowed");this.updateQueryId(),this.messages.storeUint(t,8),this.messages.storeRef((0,n.beginCell)().store((0,n.storeMessageRelaxed)(e)).endCell())}clearMessages(){this.messages=(0,n.beginCell)()}build(){return i.MultisigOrder.fromPayload((0,n.beginCell)().storeUint(this.walletId,32).storeUint(this.queryId,64).storeBuilder(this.messages).endCell())}updateQueryId(){const e=BigInt(Math.floor(Date.now()/1e3+this.queryOffset));this.queryId=e<<32n}}},2227:(e,t,r)=>{"use strict";var n=r(8287).hp;Object.defineProperty(t,"__esModule",{value:!0}),t.MultisigWallet=void 0;const i=r(5269),o=r(1307),s=o.Cell.fromBase64("te6ccgECKwEABBgAART/APSkE/S88sgLAQIBIAIDAgFIBAUE2vIgxwCOgzDbPOCDCNcYIPkBAdMH2zwiwAAToVNxePQOb6Hyn9s8VBq6+RDyoAb0BCD5AQHTH1EYuvKq0z9wUwHwCgHCCAGDCryx8mhTFYBA9A5voSCYDqQgwgryZw7f+COqH1NAufJhVCOjU04gIyEiAgLMBgcCASAMDQIBIAgJAgFmCgsAA9GEAiPymAvHoHN9CYbZ5S7Z4BPHohwhJQAtAKkItdJEqCTItdKlwLUAdAT8ArobBKAATwhbpEx4CBukTDgAdAg10rDAJrUAvALyFjPFszJ4HHXI8gBzxb0AMmACASAODwIBIBQVARW77ZbVA0cFUg2zyCoCAUgQEQIBIBITAXOxHXQgwjXGCD5AQHTB4IB1MTtQ9hTIHj0Dm+h8p/XC/9eMfkQ8qCuAfQEIW6TW3Ey4PkBWNs8AaQBgJwA9rtqA6ADoAPoCAXoCEfyAgPyA3XlP+AXkegAA54tkwAAXrhlXP8EA1WZ2oexAAgEgFhcCASAYGQFRtyVbZ4YmRmpGEAgegc30McJNhFpAADMaYeYuAFrgJhwLb+4cC3d0bhAjAYm1WZtnhqvgb+2xxsoicAgej430pBHEoFpAADHDhBACGuQkuuBk9kUWE5kAOeLKhACQCB6IYFImHFImHFImXEA2YlzNijAjAgEgGhsAF7UGtc4QQDVZnah7EAIBIBwdAgOZOB4fARGsGm2eL4G2CUAjABWt+UEAzJV2oewYQAENqTbPBVfBYCMAFa3f3CCAarM7UPYgAiDbPALyZfgAUENxQxPbPO1UIyoACtP/0wcwBKDbPC+uUyCw8mISsQKkJbNTHLmwJYEA4aojoCi8sPJpggGGoPgBBZcCERACPj4wjo0REB/bPEDXePRDEL0F4lQWW1Rz51YQU9zbPFRxClR6vCQlKCYAIO1E0NMf0wfTB9M/9AT0BNEAXgGOGjDSAAHyo9MH0wdQA9cBIPkBBfkBFbrypFAD4GwhIddKqgIi10m68qtwVCATAAwByMv/ywcE1ts87VT4D3AlblOJvrGYEG4QLVDHXwePGzBUJANQTds8UFWgRlAQSRA6SwlTuds8UFQWf+L4AAeDJaGOLCaAQPSWb6UglDBTA7neII4WODk5CNIAAZfTBzAW8AcFkTDifwgHBZJsMeKz5jAGKicoKQBgcI4pA9CDCNcY0wf0BDBTFnj0Dm+h8qXXC/9URUT5EPKmrlIgsVIDvRShI27mbCIyAH5SML6OIF8D+ACTItdKmALTB9QC+wAC6DJwyMoAQBSAQPRDAvAHjhdxyMsAFMsHEssHWM8BWM8WQBOAQPRDAeIBII6KEEUQNEMA2zztVJJfBuIqABzIyx/LB8sHyz/0APQAyQ==");class a{constructor(e,t,r,i,a){this.provider=null,this.owners=o.Dictionary.empty(),this.workchain=t,this.walletId=r,this.k=i;for(let t=0;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.computeMessageForwardFees=t.computeExternalMessageFees=t.computeGasPrices=t.computeFwdFees=t.computeStorageFees=void 0;const n=r(1307);function i(e,t,r){return e.lumpPrice+s(e.bitPrice*r+e.cellPrice*t)}function o(e){let t=e.bits.length,r=1;for(let n of e.refs){let e=o(n);r+=e.cells,t+=e.bits}return{bits:t,cells:r}}function s(e){let t=e>>16n;return 0n!==e%65536n&&(t+=1n),t}t.computeStorageFees=function(e){const{lastPaid:t,now:r,storagePrices:n,storageStat:i,special:o,masterchain:a}=e;if(r<=t||0===n.length||r>16n)},t.computeExternalMessageFees=function(e,t){let r=o(t);return r.bits-=t.bits.length,r.cells-=1,i(e,BigInt(r.cells),BigInt(r.bits))},t.computeMessageForwardFees=function(e,t){let r=(0,n.loadMessageRelaxed)(t.beginParse()),s={bits:0,cells:0};if(r.init){const e=(new n.Cell).asBuilder();(0,n.storeStateInit)(r.init)(e);const t=e.endCell();let i=o(t);i.bits-=t.bits.length,i.cells-=1,s.bits+=i.bits,s.cells+=i.cells}let a=o(r.body);a.bits-=r.body.bits.length,a.cells-=1,s.bits+=a.bits,s.cells+=a.cells;let l=i(e,BigInt(s.cells),BigInt(s.bits)),c=l*BigInt(e.firstFrac)>>16n;return{fees:c,remaining:l-c}}},8546:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toUrlSafe=void 0,t.toUrlSafe=function(e){for(;e.indexOf("/")>=0;)e=e.replace("/","_");for(;e.indexOf("+")>=0;)e=e.replace("+","-");for(;e.indexOf("=")>=0;)e=e.replace("=","");return e}},4471:(e,t,r)=>{"use strict";var n=r(8287).hp;Object.defineProperty(t,"__esModule",{value:!0}),t.WalletContractV1R1=void 0;const i=r(1307),o=r(8193);class s{static create(e){return new s(e.workchain,e.publicKey)}constructor(e,t){this.workchain=e,this.publicKey=t;let r=i.Cell.fromBoc(n.from("te6cckEBAQEARAAAhP8AIN2k8mCBAgDXGCDXCx/tRNDTH9P/0VESuvKhIvkBVBBE+RDyovgAAdMfMSDXSpbTB9QC+wDe0aTIyx/L/8ntVEH98Ik=","base64"))[0],o=(0,i.beginCell)().storeUint(0,32).storeBuffer(t).endCell();this.init={code:r,data:o},this.address=(0,i.contractAddress)(e,{code:r,data:o})}async getBalance(e){return(await e.getState()).balance}async getSeqno(e){let t=await e.getState();return"active"===t.state.type?i.Cell.fromBoc(t.state.data)[0].beginParse().loadUint(32):0}async send(e,t){await e.external(t)}async sendTransfer(e,t){let r=this.createTransfer(t);await this.send(e,r)}createTransfer(e){let t=i.SendMode.PAY_GAS_SEPARATELY;return null!==e.sendMode&&void 0!==e.sendMode&&(t=e.sendMode),(0,o.createWalletTransferV1)({seqno:e.seqno,sendMode:t,secretKey:e.secretKey,message:e.message})}sender(e,t){return{send:async r=>{let n=await this.getSeqno(e),o=this.createTransfer({seqno:n,secretKey:t,sendMode:r.sendMode,message:(0,i.internal)({to:r.to,value:r.value,init:r.init,body:r.body,bounce:r.bounce})});await this.send(e,o)}}}}t.WalletContractV1R1=s},746:(e,t,r)=>{"use strict";var n=r(8287).hp;Object.defineProperty(t,"__esModule",{value:!0}),t.WalletContractV1R2=void 0;const i=r(1307),o=r(8193);class s{static create(e){return new s(e.workchain,e.publicKey)}constructor(e,t){this.workchain=e,this.publicKey=t;let r=i.Cell.fromBoc(n.from("te6cckEBAQEAUwAAov8AIN0gggFMl7qXMO1E0NcLH+Ck8mCBAgDXGCDXCx/tRNDTH9P/0VESuvKhIvkBVBBE+RDyovgAAdMfMSDXSpbTB9QC+wDe0aTIyx/L/8ntVNDieG8=","base64"))[0],o=(0,i.beginCell)().storeUint(0,32).storeBuffer(t).endCell();this.init={code:r,data:o},this.address=(0,i.contractAddress)(e,{code:r,data:o})}async getBalance(e){return(await e.getState()).balance}async getSeqno(e){return"active"===(await e.getState()).state.type?(await e.get("seqno",[])).stack.readNumber():0}async send(e,t){await e.external(t)}async sendTransfer(e,t){let r=this.createTransfer(t);await this.send(e,r)}createTransfer(e){let t=i.SendMode.PAY_GAS_SEPARATELY;return null!==e.sendMode&&void 0!==e.sendMode&&(t=e.sendMode),(0,o.createWalletTransferV1)({seqno:e.seqno,sendMode:t,secretKey:e.secretKey,message:e.message})}sender(e,t){return{send:async r=>{let n=await this.getSeqno(e),o=this.createTransfer({seqno:n,secretKey:t,sendMode:r.sendMode,message:(0,i.internal)({to:r.to,value:r.value,init:r.init,body:r.body,bounce:r.bounce})});await this.send(e,o)}}}}t.WalletContractV1R2=s},3273:(e,t,r)=>{"use strict";var n=r(8287).hp;Object.defineProperty(t,"__esModule",{value:!0}),t.WalletContractV1R3=void 0;const i=r(1307),o=r(8193);class s{static create(e){return new s(e.workchain,e.publicKey)}constructor(e,t){this.workchain=e,this.publicKey=t;let r=i.Cell.fromBoc(n.from("te6cckEBAQEAXwAAuv8AIN0gggFMl7ohggEznLqxnHGw7UTQ0x/XC//jBOCk8mCBAgDXGCDXCx/tRNDTH9P/0VESuvKhIvkBVBBE+RDyovgAAdMfMSDXSpbTB9QC+wDe0aTIyx/L/8ntVLW4bkI=","base64"))[0],o=(0,i.beginCell)().storeUint(0,32).storeBuffer(t).endCell();this.init={code:r,data:o},this.address=(0,i.contractAddress)(e,{code:r,data:o})}async getBalance(e){return(await e.getState()).balance}async getSeqno(e){return"active"===(await e.getState()).state.type?(await e.get("seqno",[])).stack.readNumber():0}async send(e,t){await e.external(t)}async sendTransfer(e,t){let r=this.createTransfer(t);await this.send(e,r)}createTransfer(e){let t=i.SendMode.PAY_GAS_SEPARATELY;return null!==e.sendMode&&void 0!==e.sendMode&&(t=e.sendMode),(0,o.createWalletTransferV1)({seqno:e.seqno,sendMode:t,secretKey:e.secretKey,message:e.message})}sender(e,t){return{send:async r=>{let n=await this.getSeqno(e),o=this.createTransfer({seqno:n,secretKey:t,sendMode:r.sendMode,message:(0,i.internal)({to:r.to,value:r.value,init:r.init,body:r.body,bounce:r.bounce})});await this.send(e,o)}}}}t.WalletContractV1R3=s},1902:(e,t,r)=>{"use strict";var n=r(8287).hp;Object.defineProperty(t,"__esModule",{value:!0}),t.WalletContractV2R1=void 0;const i=r(1307),o=r(8193);class s{static create(e){return new s(e.workchain,e.publicKey)}constructor(e,t){this.workchain=e,this.publicKey=t;let r=i.Cell.fromBoc(n.from("te6cckEBAQEAVwAAqv8AIN0gggFMl7qXMO1E0NcLH+Ck8mCDCNcYINMf0x8B+CO78mPtRNDTH9P/0VExuvKhA/kBVBBC+RDyovgAApMg10qW0wfUAvsA6NGkyMsfy//J7VShNwu2","base64"))[0],o=(0,i.beginCell)().storeUint(0,32).storeBuffer(t).endCell();this.init={code:r,data:o},this.address=(0,i.contractAddress)(e,{code:r,data:o})}async getBalance(e){return(await e.getState()).balance}async getSeqno(e){return"active"===(await e.getState()).state.type?(await e.get("seqno",[])).stack.readNumber():0}async send(e,t){await e.external(t)}async sendTransfer(e,t){let r=this.createTransfer(t);await this.send(e,r)}createTransfer(e){let t=i.SendMode.PAY_GAS_SEPARATELY;return null!==e.sendMode&&void 0!==e.sendMode&&(t=e.sendMode),(0,o.createWalletTransferV2)({seqno:e.seqno,sendMode:t,secretKey:e.secretKey,messages:e.messages,timeout:e.timeout})}sender(e,t){return{send:async r=>{let n=await this.getSeqno(e),o=this.createTransfer({seqno:n,secretKey:t,sendMode:r.sendMode,messages:[(0,i.internal)({to:r.to,value:r.value,init:r.init,body:r.body,bounce:r.bounce})]});await this.send(e,o)}}}}t.WalletContractV2R1=s},9579:(e,t,r)=>{"use strict";var n=r(8287).hp;Object.defineProperty(t,"__esModule",{value:!0}),t.WalletContractV2R2=void 0;const i=r(1307),o=r(8193);class s{static create(e){return new s(e.workchain,e.publicKey)}constructor(e,t){this.workchain=e,this.publicKey=t;let r=i.Cell.fromBoc(n.from("te6cckEBAQEAYwAAwv8AIN0gggFMl7ohggEznLqxnHGw7UTQ0x/XC//jBOCk8mCDCNcYINMf0x8B+CO78mPtRNDTH9P/0VExuvKhA/kBVBBC+RDyovgAApMg10qW0wfUAvsA6NGkyMsfy//J7VQETNeh","base64"))[0],o=(0,i.beginCell)().storeUint(0,32).storeBuffer(t).endCell();this.init={code:r,data:o},this.address=(0,i.contractAddress)(e,{code:r,data:o})}async getBalance(e){return(await e.getState()).balance}async getSeqno(e){return"active"===(await e.getState()).state.type?(await e.get("seqno",[])).stack.readNumber():0}async send(e,t){await e.external(t)}async sendTransfer(e,t){let r=this.createTransfer(t);await this.send(e,r)}createTransfer(e){let t=i.SendMode.PAY_GAS_SEPARATELY;return null!==e.sendMode&&void 0!==e.sendMode&&(t=e.sendMode),(0,o.createWalletTransferV2)({seqno:e.seqno,sendMode:t,secretKey:e.secretKey,messages:e.messages,timeout:e.timeout})}sender(e,t){return{send:async r=>{let n=await this.getSeqno(e),o=this.createTransfer({seqno:n,secretKey:t,sendMode:r.sendMode,messages:[(0,i.internal)({to:r.to,value:r.value,init:r.init,body:r.body,bounce:r.bounce})]});await this.send(e,o)}}}}t.WalletContractV2R2=s},9145:(e,t,r)=>{"use strict";var n=r(8287).hp;Object.defineProperty(t,"__esModule",{value:!0}),t.WalletContractV3R1=void 0;const i=r(1307),o=r(8193);class s{static create(e){return new s(e.workchain,e.publicKey,e.walletId)}constructor(e,t,r){this.workchain=e,this.publicKey=t,this.walletId=null!=r?r:698983191+e;let o=i.Cell.fromBoc(n.from("te6cckEBAQEAYgAAwP8AIN0gggFMl7qXMO1E0NcLH+Ck8mCDCNcYINMf0x/TH/gjE7vyY+1E0NMf0x/T/9FRMrryoVFEuvKiBPkBVBBV+RDyo/gAkyDXSpbTB9QC+wDo0QGkyMsfyx/L/8ntVD++buA=","base64"))[0],s=(0,i.beginCell)().storeUint(0,32).storeUint(this.walletId,32).storeBuffer(t).endCell();this.init={code:o,data:s},this.address=(0,i.contractAddress)(e,{code:o,data:s})}async getBalance(e){return(await e.getState()).balance}async getSeqno(e){return"active"===(await e.getState()).state.type?(await e.get("seqno",[])).stack.readNumber():0}async send(e,t){await e.external(t)}async sendTransfer(e,t){let r=this.createTransfer(t);await this.send(e,r)}createTransfer(e){let t=i.SendMode.PAY_GAS_SEPARATELY;return null!==e.sendMode&&void 0!==e.sendMode&&(t=e.sendMode),(0,o.createWalletTransferV3)({seqno:e.seqno,sendMode:t,secretKey:e.secretKey,messages:e.messages,timeout:e.timeout,walletId:this.walletId})}sender(e,t){return{send:async r=>{let n=await this.getSeqno(e),o=this.createTransfer({seqno:n,secretKey:t,sendMode:r.sendMode,messages:[(0,i.internal)({to:r.to,value:r.value,init:r.init,body:r.body,bounce:r.bounce})]});await this.send(e,o)}}}}t.WalletContractV3R1=s},8784:(e,t,r)=>{"use strict";var n=r(8287).hp;Object.defineProperty(t,"__esModule",{value:!0}),t.WalletContractV3R2=void 0;const i=r(1307),o=r(8193);class s{static create(e){return new s(e.workchain,e.publicKey,e.walletId)}constructor(e,t,r){this.workchain=e,this.publicKey=t,this.walletId=null!=r?r:698983191+e;let o=i.Cell.fromBoc(n.from("te6cckEBAQEAcQAA3v8AIN0gggFMl7ohggEznLqxn3Gw7UTQ0x/THzHXC//jBOCk8mCDCNcYINMf0x/TH/gjE7vyY+1E0NMf0x/T/9FRMrryoVFEuvKiBPkBVBBV+RDyo/gAkyDXSpbTB9QC+wDo0QGkyMsfyx/L/8ntVBC9ba0=","base64"))[0],s=(0,i.beginCell)().storeUint(0,32).storeUint(this.walletId,32).storeBuffer(t).endCell();this.init={code:o,data:s},this.address=(0,i.contractAddress)(e,{code:o,data:s})}async getBalance(e){return(await e.getState()).balance}async getSeqno(e){return"active"===(await e.getState()).state.type?(await e.get("seqno",[])).stack.readNumber():0}async send(e,t){await e.external(t)}async sendTransfer(e,t){let r=this.createTransfer(t);await this.send(e,r)}createTransfer(e){let t=i.SendMode.PAY_GAS_SEPARATELY;return null!==e.sendMode&&void 0!==e.sendMode&&(t=e.sendMode),(0,o.createWalletTransferV3)({seqno:e.seqno,sendMode:t,secretKey:e.secretKey,messages:e.messages,timeout:e.timeout,walletId:this.walletId})}sender(e,t){return{send:async r=>{let n=await this.getSeqno(e),o=this.createTransfer({seqno:n,secretKey:t,sendMode:r.sendMode,messages:[(0,i.internal)({to:r.to,value:r.value,init:r.init,body:r.body,bounce:r.bounce})]});await this.send(e,o)}}}}t.WalletContractV3R2=s},7941:(e,t,r)=>{"use strict";var n=r(8287).hp;Object.defineProperty(t,"__esModule",{value:!0}),t.WalletContractV4=void 0;const i=r(1307),o=r(8193);class s{static create(e){return new s(e.workchain,e.publicKey,e.walletId)}constructor(e,t,r){this.workchain=e,this.publicKey=t,this.walletId=null!=r?r:698983191+e;let o=i.Cell.fromBoc(n.from("te6ccgECFAEAAtQAART/APSkE/S88sgLAQIBIAIDAgFIBAUE+PKDCNcYINMf0x/THwL4I7vyZO1E0NMf0x/T//QE0VFDuvKhUVG68qIF+QFUEGT5EPKj+AAkpMjLH1JAyx9SMMv/UhD0AMntVPgPAdMHIcAAn2xRkyDXSpbTB9QC+wDoMOAhwAHjACHAAuMAAcADkTDjDQOkyMsfEssfy/8QERITAubQAdDTAyFxsJJfBOAi10nBIJJfBOAC0x8hghBwbHVnvSKCEGRzdHK9sJJfBeAD+kAwIPpEAcjKB8v/ydDtRNCBAUDXIfQEMFyBAQj0Cm+hMbOSXwfgBdM/yCWCEHBsdWe6kjgw4w0DghBkc3RyupJfBuMNBgcCASAICQB4AfoA9AQw+CdvIjBQCqEhvvLgUIIQcGx1Z4MesXCAGFAEywUmzxZY+gIZ9ADLaRfLH1Jgyz8gyYBA+wAGAIpQBIEBCPRZMO1E0IEBQNcgyAHPFvQAye1UAXKwjiOCEGRzdHKDHrFwgBhQBcsFUAPPFiP6AhPLassfyz/JgED7AJJfA+ICASAKCwBZvSQrb2omhAgKBrkPoCGEcNQICEekk30pkQzmkD6f+YN4EoAbeBAUiYcVnzGEAgFYDA0AEbjJftRNDXCx+AA9sp37UTQgQFA1yH0BDACyMoHy//J0AGBAQj0Cm+hMYAIBIA4PABmtznaiaEAga5Drhf/AABmvHfaiaEAQa5DrhY/AAG7SB/oA1NQi+QAFyMoHFcv/ydB3dIAYyMsFywIizxZQBfoCFMtrEszMyXP7AMhAFIEBCPRR8qcCAHCBAQjXGPoA0z/IVCBHgQEI9FHyp4IQbm90ZXB0gBjIywXLAlAGzxZQBPoCFMtqEssfyz/Jc/sAAgBsgQEI1xj6ANM/MFIkgQEI9Fnyp4IQZHN0cnB0gBjIywXLAlAFzxZQA/oCE8tqyx8Syz/Jc/sAAAr0AMntVA==","base64"))[0],s=(0,i.beginCell)().storeUint(0,32).storeUint(this.walletId,32).storeBuffer(this.publicKey).storeBit(0).endCell();this.init={code:o,data:s},this.address=(0,i.contractAddress)(e,{code:o,data:s})}async getBalance(e){return(await e.getState()).balance}async getSeqno(e){return"active"===(await e.getState()).state.type?(await e.get("seqno",[])).stack.readNumber():0}async send(e,t){await e.external(t)}async sendTransfer(e,t){let r=this.createTransfer(t);await this.send(e,r)}createTransfer(e){let t=i.SendMode.PAY_GAS_SEPARATELY;return null!==e.sendMode&&void 0!==e.sendMode&&(t=e.sendMode),(0,o.createWalletTransferV4)({seqno:e.seqno,sendMode:t,secretKey:e.secretKey,messages:e.messages,timeout:e.timeout,walletId:this.walletId})}sender(e,t){return{send:async r=>{let n=await this.getSeqno(e),o=this.createTransfer({seqno:n,secretKey:t,sendMode:r.sendMode,messages:[(0,i.internal)({to:r.to,value:r.value,init:r.init,body:r.body,bounce:r.bounce})]});await this.send(e,o)}}}}t.WalletContractV4=s},8193:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createWalletTransferV4=t.createWalletTransferV3=t.createWalletTransferV2=t.createWalletTransferV1=void 0;const n=r(1307),i=r(5269);t.createWalletTransferV1=function(e){let t=(0,n.beginCell)().storeUint(e.seqno,32);e.message&&(t.storeUint(e.sendMode,8),t.storeRef((0,n.beginCell)().store((0,n.storeMessageRelaxed)(e.message))));let r=(0,i.sign)(t.endCell().hash(),e.secretKey);return(0,n.beginCell)().storeBuffer(r).storeBuilder(t).endCell()},t.createWalletTransferV2=function(e){if(e.messages.length>4)throw Error("Maximum number of messages in a single transfer is 4");let t=(0,n.beginCell)().storeUint(e.seqno,32);if(0===e.seqno)for(let e=0;e<32;e++)t.storeBit(1);else t.storeUint(e.timeout||Math.floor(Date.now()/1e3)+60,32);for(let r of e.messages)t.storeUint(e.sendMode,8),t.storeRef((0,n.beginCell)().store((0,n.storeMessageRelaxed)(r)));let r=(0,i.sign)(t.endCell().hash(),e.secretKey);return(0,n.beginCell)().storeBuffer(r).storeBuilder(t).endCell()},t.createWalletTransferV3=function(e){if(e.messages.length>4)throw Error("Maximum number of messages in a single transfer is 4");let t=(0,n.beginCell)().storeUint(e.walletId,32);if(0===e.seqno)for(let e=0;e<32;e++)t.storeBit(1);else t.storeUint(e.timeout||Math.floor(Date.now()/1e3)+60,32);t.storeUint(e.seqno,32);for(let r of e.messages)t.storeUint(e.sendMode,8),t.storeRef((0,n.beginCell)().store((0,n.storeMessageRelaxed)(r)));let r=(0,i.sign)(t.endCell().hash(),e.secretKey);return(0,n.beginCell)().storeBuffer(r).storeBuilder(t).endCell()},t.createWalletTransferV4=function(e){if(e.messages.length>4)throw Error("Maximum number of messages in a single transfer is 4");let t=(0,n.beginCell)().storeUint(e.walletId,32);if(0===e.seqno)for(let e=0;e<32;e++)t.storeBit(1);else t.storeUint(e.timeout||Math.floor(Date.now()/1e3)+60,32);t.storeUint(e.seqno,32),t.storeUint(0,8);for(let r of e.messages)t.storeUint(e.sendMode,8),t.storeRef((0,n.beginCell)().store((0,n.storeMessageRelaxed)(r)));let r=(0,i.sign)(t.endCell().hash(),e.secretKey);return(0,n.beginCell)().storeBuffer(r).storeBuilder(t).endCell()}},7526:(e,t)=>{"use strict";t.byteLength=function(e){var t=a(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,o=a(e),s=o[0],l=o[1],c=new i(function(e,t,r){return 3*(t+r)/4-r}(0,s,l)),d=0,u=l>0?s-4:s;for(r=0;r>16&255,c[d++]=t>>8&255,c[d++]=255&t;return 2===l&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,c[d++]=255&t),1===l&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,c[d++]=t>>8&255,c[d++]=255&t),c},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,o=[],s=16383,a=0,c=n-i;ac?c:a+s));return 1===i?(t=e[n-1],o.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],o.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),o.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0;s<64;++s)r[s]=o[s],n[o.charCodeAt(s)]=s;function a(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function l(e,t,n){for(var i,o,s=[],a=t;a>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},8287:(e,t,r)=>{"use strict";var n=r(7526),i=r(251),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.hp=l,t.IS=50;var s=2147483647;function a(e){if(e>s)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,l.prototype),t}function l(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return u(e)}return c(e,t,r)}function c(e,t,r){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!l.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var r=0|g(e,t),n=a(r),i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if($(e,Uint8Array)){var t=new Uint8Array(e);return f(t.buffer,t.byteOffset,t.byteLength)}return h(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if($(e,ArrayBuffer)||e&&$(e.buffer,ArrayBuffer))return f(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&($(e,SharedArrayBuffer)||e&&$(e.buffer,SharedArrayBuffer)))return f(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return l.from(n,t,r);var i=function(e){if(l.isBuffer(e)){var t=0|p(e.length),r=a(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||F(e.length)?a(0):h(e):"Buffer"===e.type&&Array.isArray(e.data)?h(e.data):void 0}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return l.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function d(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function u(e){return d(e),a(e<0?0:0|p(e))}function h(e){for(var t=e.length<0?0:0|p(e.length),r=a(t),n=0;n=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|e}function g(e,t){if(l.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||$(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return z(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return N(e).length;default:if(i)return n?-1:z(e).length;t=(""+t).toLowerCase(),i=!0}}function m(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return P(this,t,r);case"utf8":case"utf-8":return S(this,t,r);case"ascii":return E(this,t,r);case"latin1":case"binary":return I(this,t,r);case"base64":return A(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function y(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function b(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),F(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=l.from(t,n)),l.isBuffer(t))return 0===t.length?-1:w(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):w(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function w(e,t,r,n,i){var o,s=1,a=e.length,l=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s=2,a/=2,l/=2,r/=2}function c(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){var d=-1;for(o=r;oa&&(r=a-l),o=r;o>=0;o--){for(var u=!0,h=0;hi&&(n=i):n=i;var o=t.length;n>o/2&&(n=o/2);for(var s=0;s>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function A(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function S(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i239?4:c>223?3:c>191?2:1;if(i+u<=r)switch(u){case 1:c<128&&(d=c);break;case 2:128==(192&(o=e[i+1]))&&(l=(31&c)<<6|63&o)>127&&(d=l);break;case 3:o=e[i+1],s=e[i+2],128==(192&o)&&128==(192&s)&&(l=(15&c)<<12|(63&o)<<6|63&s)>2047&&(l<55296||l>57343)&&(d=l);break;case 4:o=e[i+1],s=e[i+2],a=e[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(l=(15&c)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&l<1114112&&(d=l)}null===d?(d=65533,u=1):d>65535&&(d-=65536,n.push(d>>>10&1023|55296),d=56320|1023&d),n.push(d),i+=u}return function(e){var t=e.length;if(t<=B)return String.fromCharCode.apply(String,e);for(var r="",n=0;nn.length?l.from(o).copy(n,i):Uint8Array.prototype.set.call(n,o,i);else{if(!l.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,i)}i+=o.length}return n},l.byteLength=g,l.prototype._isBuffer=!0,l.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;tr&&(e+=" ... "),""},o&&(l.prototype[o]=l.prototype.inspect),l.prototype.compare=function(e,t,r,n,i){if($(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),!l.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(t>>>=0),a=Math.min(o,s),c=this.slice(n,i),d=e.slice(t,r),u=0;u>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return v(this,e,t,r);case"utf8":case"utf-8":return C(this,e,t,r);case"ascii":case"latin1":case"binary":return _(this,e,t,r);case"base64":return k(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var B=4096;function E(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;in)&&(r=n);for(var i="",o=t;or)throw new RangeError("Trying to access beyond buffer length")}function T(e,t,r,n,i,o){if(!l.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function O(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function R(e,t,r,n,o){return t=+t,r>>>=0,o||O(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function j(e,t,r,n,o){return t=+t,r>>>=0,o||O(e,0,r,8),i.write(e,t,r,n,52,8),r+8}l.prototype.slice=function(e,t){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t>>=0,t>>>=0,r||U(e,t,this.length);for(var n=this[e],i=1,o=0;++o>>=0,t>>>=0,r||U(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},l.prototype.readUint8=l.prototype.readUInt8=function(e,t){return e>>>=0,t||U(e,1,this.length),this[e]},l.prototype.readUint16LE=l.prototype.readUInt16LE=function(e,t){return e>>>=0,t||U(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUint16BE=l.prototype.readUInt16BE=function(e,t){return e>>>=0,t||U(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUint32LE=l.prototype.readUInt32LE=function(e,t){return e>>>=0,t||U(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},l.prototype.readUint32BE=l.prototype.readUInt32BE=function(e,t){return e>>>=0,t||U(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},l.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||U(e,t,this.length);for(var n=this[e],i=1,o=0;++o=(i*=128)&&(n-=Math.pow(2,8*t)),n},l.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||U(e,t,this.length);for(var n=t,i=1,o=this[e+--n];n>0&&(i*=256);)o+=this[e+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},l.prototype.readInt8=function(e,t){return e>>>=0,t||U(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},l.prototype.readInt16LE=function(e,t){e>>>=0,t||U(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt16BE=function(e,t){e>>>=0,t||U(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt32LE=function(e,t){return e>>>=0,t||U(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},l.prototype.readInt32BE=function(e,t){return e>>>=0,t||U(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},l.prototype.readFloatLE=function(e,t){return e>>>=0,t||U(e,4,this.length),i.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return e>>>=0,t||U(e,4,this.length),i.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return e>>>=0,t||U(e,8,this.length),i.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return e>>>=0,t||U(e,8,this.length),i.read(this,e,!1,52,8)},l.prototype.writeUintLE=l.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||T(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[t]=255&e;++o>>=0,r>>>=0,n||T(this,e,t,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},l.prototype.writeUint8=l.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,1,255,0),this[t]=255&e,t+1},l.prototype.writeUint16LE=l.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},l.prototype.writeUint16BE=l.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},l.prototype.writeUint32LE=l.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},l.prototype.writeUint32BE=l.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},l.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);T(this,e,t,r,i-1,-i)}var o=0,s=1,a=0;for(this[t]=255&e;++o>>=0,!n){var i=Math.pow(2,8*r-1);T(this,e,t,r,i-1,-i)}var o=r-1,s=1,a=0;for(this[t+o]=255&e;--o>=0&&(s*=256);)e<0&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/s|0)-a&255;return t+r},l.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},l.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},l.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},l.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},l.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},l.prototype.writeFloatLE=function(e,t,r){return R(this,e,t,!0,r)},l.prototype.writeFloatBE=function(e,t,r){return R(this,e,t,!1,r)},l.prototype.writeDoubleLE=function(e,t,r){return j(this,e,t,!0,r)},l.prototype.writeDoubleBE=function(e,t,r){return j(this,e,t,!1,r)},l.prototype.copy=function(e,t,r,n){if(!l.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(o=t;o55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function N(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(L,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function D(e,t,r,n){for(var i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function $(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function F(e){return e!=e}var K=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var n=16*r,i=0;i<16;++i)t[n+i]=e[r]+e[i];return t}()},9302:e=>{"use strict";var t,r=function(){function e(e,t){if("function"!=typeof e)throw new TypeError("DataLoader must be constructed with a function which accepts Array and returns Promise>, but got: "+e+".");this._batchLoadFn=e,this._maxBatchSize=function(e){if(!(!e||!1!==e.batch))return 1;var t=e&&e.maxBatchSize;if(void 0===t)return 1/0;if("number"!=typeof t||t<1)throw new TypeError("maxBatchSize must be a positive number: "+t);return t}(t),this._batchScheduleFn=function(e){var t=e&&e.batchScheduleFn;if(void 0===t)return n;if("function"!=typeof t)throw new TypeError("batchScheduleFn must be a function: "+t);return t}(t),this._cacheKeyFn=function(e){var t=e&&e.cacheKeyFn;if(void 0===t)return function(e){return e};if("function"!=typeof t)throw new TypeError("cacheKeyFn must be a function: "+t);return t}(t),this._cacheMap=function(e){if(!(!e||!1!==e.cache))return null;var t=e&&e.cacheMap;if(void 0===t)return new Map;if(null!==t){var r=["get","set","delete","clear"].filter((function(e){return t&&"function"!=typeof t[e]}));if(0!==r.length)throw new TypeError("Custom cacheMap missing methods: "+r.join(", "))}return t}(t),this._batch=null,this.name=function(e){return e&&e.name?e.name:null}(t)}var t=e.prototype;return t.load=function(e){if(null==e)throw new TypeError("The loader.load() function must be called with a value, but got: "+String(e)+".");var t=function(e){var t=e._batch;if(null!==t&&!t.hasDispatched&&t.keys.length and returns Promise>, but the function errored synchronously: "+String(r)+"."))}if(!r||"function"!=typeof r.then)return i(e,t,new TypeError("DataLoader must be constructed with a function which accepts Array and returns Promise>, but the function did not return a Promise: "+String(r)+"."));r.then((function(e){if(!s(e))throw new TypeError("DataLoader must be constructed with a function which accepts Array and returns Promise>, but the function did not return a Promise of an Array: "+String(e)+".");if(e.length!==t.keys.length)throw new TypeError("DataLoader must be constructed with a function which accepts Array and returns Promise>, but the function did not return a Promise of an Array of the same length as the Array of keys.\n\nKeys:\n"+String(t.keys)+"\n\nValues:\n"+String(e));o(t);for(var r=0;r but got: "+e+".");for(var t=[],r=0;r0&&Object.prototype.hasOwnProperty.call(e,e.length-1))}e.exports=r},4744:e=>{"use strict";var t=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===r}(e)}(e)},r="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function n(e,t){return!1!==t.clone&&t.isMergeableObject(e)?a((r=e,Array.isArray(r)?[]:{}),e,t):e;var r}function i(e,t,r){return e.concat(t).map((function(e){return n(e,r)}))}function o(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter((function(t){return Object.propertyIsEnumerable.call(e,t)})):[]}(e))}function s(e,t){try{return t in e}catch(e){return!1}}function a(e,r,l){(l=l||{}).arrayMerge=l.arrayMerge||i,l.isMergeableObject=l.isMergeableObject||t,l.cloneUnlessOtherwiseSpecified=n;var c=Array.isArray(r);return c===Array.isArray(e)?c?l.arrayMerge(e,r,l):function(e,t,r){var i={};return r.isMergeableObject(e)&&o(e).forEach((function(t){i[t]=n(e[t],r)})),o(t).forEach((function(o){(function(e,t){return s(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,o)||(s(e,o)&&r.isMergeableObject(t[o])?i[o]=function(e,t){if(!t.customMerge)return a;var r=t.customMerge(e);return"function"==typeof r?r:a}(o,r)(e[o],t[o],r):i[o]=n(t[o],r))})),i}(e,r,l):n(r,l)}a.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,r){return a(e,r,t)}),{})};var l=a;e.exports=l},251:(e,t)=>{t.read=function(e,t,r,n,i){var o,s,a=8*i-n-1,l=(1<>1,d=-7,u=r?i-1:0,h=r?-1:1,f=e[t+u];for(u+=h,o=f&(1<<-d)-1,f>>=-d,d+=a;d>0;o=256*o+e[t+u],u+=h,d-=8);for(s=o&(1<<-d)-1,o>>=-d,d+=n;d>0;s=256*s+e[t+u],u+=h,d-=8);if(0===o)o=1-c;else{if(o===l)return s?NaN:1/0*(f?-1:1);s+=Math.pow(2,n),o-=c}return(f?-1:1)*s*Math.pow(2,o-n)},t.write=function(e,t,r,n,i,o){var s,a,l,c=8*o-i-1,d=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:o-1,p=n?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=d):(s=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-s))<1&&(s--,l*=2),(t+=s+u>=1?h/l:h*Math.pow(2,1-u))*l>=2&&(s++,l/=2),s+u>=d?(a=0,s=d):s+u>=1?(a=(t*l-1)*Math.pow(2,i),s+=u):(a=t*Math.pow(2,u-1)*Math.pow(2,i),s=0));i>=8;e[r+f]=255&a,f+=p,a/=256,i-=8);for(s=s<0;e[r+f]=255&s,f+=p,s/=256,c-=8);e[r+f-p]|=128*g}},8343:function(e){e.exports=function(){"use strict";var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function t(e,t,r,n){var i,o,s,a=t||[0],l=(r=r||0)>>>3,c=-1===n?3:0;for(i=0;i>>2,a.length<=o&&a.push(0),a[o]|=e[i]<<8*(c+n*(s%4));return{value:a,binLen:8*e.length+r}}function r(r,n,i){switch(n){case"UTF8":case"UTF16BE":case"UTF16LE":break;default:throw new Error("encoding must be UTF8, UTF16BE, or UTF16LE")}switch(r){case"HEX":return function(e,t,r){return function(e,t,r,n){var i,o,s,a;if(0!=e.length%2)throw new Error("String of HEX type must be in byte increments");var l=t||[0],c=(r=r||0)>>>3,d=-1===n?3:0;for(i=0;i>>1)+c)>>>2;l.length<=s;)l.push(0);l[s]|=o<<8*(d+n*(a%4))}return{value:l,binLen:4*e.length+r}}(e,t,r,i)};case"TEXT":return function(e,t,r){return function(e,t,r,n,i){var o,s,a,l,c,d,u,h,f=0,p=r||[0],g=(n=n||0)>>>3;if("UTF8"===t)for(u=-1===i?3:0,a=0;a(o=e.charCodeAt(a))?s.push(o):2048>o?(s.push(192|o>>>6),s.push(128|63&o)):55296>o||57344<=o?s.push(224|o>>>12,128|o>>>6&63,128|63&o):(a+=1,o=65536+((1023&o)<<10|1023&e.charCodeAt(a)),s.push(240|o>>>18,128|o>>>12&63,128|o>>>6&63,128|63&o)),l=0;l>>2;p.length<=c;)p.push(0);p[c]|=s[l]<<8*(u+i*(d%4)),f+=1}else for(u=-1===i?2:0,h="UTF16LE"===t&&1!==i||"UTF16LE"!==t&&1===i,a=0;a>>8),c=(d=f+g)>>>2;p.length<=c;)p.push(0);p[c]|=o<<8*(u+i*(d%4)),f+=2}return{value:p,binLen:8*f+n}}(e,n,t,r,i)};case"B64":return function(t,r,n){return function(t,r,n,i){var o,s,a,l,c,d,u=0,h=r||[0],f=(n=n||0)>>>3,p=-1===i?3:0,g=t.indexOf("=");if(-1===t.search(/^[a-zA-Z0-9=+/]+$/))throw new Error("Invalid character in base-64 string");if(t=t.replace(/=/g,""),-1!==g&&g"bigint"==typeof t?t.toString():t}(r=t.util||(t.util={})),(t.objectUtil||(t.objectUtil={})).mergeShapes=(e,t)=>({...e,...t}),t.ZodParsedType=r.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),t.getParsedType=e=>{switch(typeof e){case"undefined":return t.ZodParsedType.undefined;case"string":return t.ZodParsedType.string;case"number":return isNaN(e)?t.ZodParsedType.nan:t.ZodParsedType.number;case"boolean":return t.ZodParsedType.boolean;case"function":return t.ZodParsedType.function;case"bigint":return t.ZodParsedType.bigint;case"symbol":return t.ZodParsedType.symbol;case"object":return Array.isArray(e)?t.ZodParsedType.array:null===e?t.ZodParsedType.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?t.ZodParsedType.promise:"undefined"!=typeof Map&&e instanceof Map?t.ZodParsedType.map:"undefined"!=typeof Set&&e instanceof Set?t.ZodParsedType.set:"undefined"!=typeof Date&&e instanceof Date?t.ZodParsedType.date:t.ZodParsedType.object;default:return t.ZodParsedType.unknown}}},1614:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},s=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.z=void 0;const a=o(r(6555));t.z=a,s(r(6555),t),t.default=a},8227:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(2146),i=r(6837);t.default=(e,t)=>{let r;switch(e.code){case i.ZodIssueCode.invalid_type:r=e.received===n.ZodParsedType.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case i.ZodIssueCode.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,n.util.jsonStringifyReplacer)}`;break;case i.ZodIssueCode.unrecognized_keys:r=`Unrecognized key(s) in object: ${n.util.joinValues(e.keys,", ")}`;break;case i.ZodIssueCode.invalid_union:r="Invalid input";break;case i.ZodIssueCode.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${n.util.joinValues(e.options)}`;break;case i.ZodIssueCode.invalid_enum_value:r=`Invalid enum value. Expected ${n.util.joinValues(e.options)}, received '${e.received}'`;break;case i.ZodIssueCode.invalid_arguments:r="Invalid function arguments";break;case i.ZodIssueCode.invalid_return_type:r="Invalid function return type";break;case i.ZodIssueCode.invalid_date:r="Invalid date";break;case i.ZodIssueCode.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:n.util.assertNever(e.validation):r="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case i.ZodIssueCode.too_small:r="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case i.ZodIssueCode.too_big:r="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case i.ZodIssueCode.custom:r="Invalid input";break;case i.ZodIssueCode.invalid_intersection_types:r="Intersection results could not be merged";break;case i.ZodIssueCode.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case i.ZodIssueCode.not_finite:r="Number must be finite";break;default:r=t.defaultError,n.util.assertNever(e)}return{message:r}}},2739:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.date=t.boolean=t.bigint=t.array=t.any=t.coerce=t.ZodFirstPartyTypeKind=t.late=t.ZodSchema=t.Schema=t.custom=t.ZodReadonly=t.ZodPipeline=t.ZodBranded=t.BRAND=t.ZodNaN=t.ZodCatch=t.ZodDefault=t.ZodNullable=t.ZodOptional=t.ZodTransformer=t.ZodEffects=t.ZodPromise=t.ZodNativeEnum=t.ZodEnum=t.ZodLiteral=t.ZodLazy=t.ZodFunction=t.ZodSet=t.ZodMap=t.ZodRecord=t.ZodTuple=t.ZodIntersection=t.ZodDiscriminatedUnion=t.ZodUnion=t.ZodObject=t.ZodArray=t.ZodVoid=t.ZodNever=t.ZodUnknown=t.ZodAny=t.ZodNull=t.ZodUndefined=t.ZodSymbol=t.ZodDate=t.ZodBoolean=t.ZodBigInt=t.ZodNumber=t.ZodString=t.ZodType=void 0,t.NEVER=t.void=t.unknown=t.union=t.undefined=t.tuple=t.transformer=t.symbol=t.string=t.strictObject=t.set=t.record=t.promise=t.preprocess=t.pipeline=t.ostring=t.optional=t.onumber=t.oboolean=t.object=t.number=t.nullable=t.null=t.never=t.nativeEnum=t.nan=t.map=t.literal=t.lazy=t.intersection=t.instanceof=t.function=t.enum=t.effect=t.discriminatedUnion=void 0;const n=r(627),i=r(9750),o=r(7231),s=r(2146),a=r(6837);class l{constructor(e,t,r,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=n}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const c=(e,t)=>{if((0,o.isValid)(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new a.ZodError(e.common.issues);return this._error=t,this._error}}};function d(e){if(!e)return{};const{errorMap:t,invalid_type_error:r,required_error:n,description:i}=e;if(t&&(r||n))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{errorMap:t,description:i}:{errorMap:(e,t)=>"invalid_type"!==e.code?{message:t.defaultError}:void 0===t.data?{message:null!=n?n:t.defaultError}:{message:null!=r?r:t.defaultError},description:i}}class u{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return(0,s.getParsedType)(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:(0,s.getParsedType)(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new o.ParseStatus,ctx:{common:e.parent.common,data:e.data,parsedType:(0,s.getParsedType)(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if((0,o.isAsync)(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){var r;const n={common:{issues:[],async:null!==(r=null==t?void 0:t.async)&&void 0!==r&&r,contextualErrorMap:null==t?void 0:t.errorMap},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:(0,s.getParsedType)(e)},i=this._parseSync({data:e,path:n.path,parent:n});return c(n,i)}async parseAsync(e,t){const r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){const r={common:{issues:[],contextualErrorMap:null==t?void 0:t.errorMap,async:!0},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:(0,s.getParsedType)(e)},n=this._parse({data:e,path:r.path,parent:r}),i=await((0,o.isAsync)(n)?n:Promise.resolve(n));return c(r,i)}refine(e,t){const r=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement(((t,n)=>{const i=e(t),o=()=>n.addIssue({code:a.ZodIssueCode.custom,...r(t)});return"undefined"!=typeof Promise&&i instanceof Promise?i.then((e=>!!e||(o(),!1))):!!i||(o(),!1)}))}refinement(e,t){return this._refinement(((r,n)=>!!e(r)||(n.addIssue("function"==typeof t?t(r,n):t),!1)))}_refinement(e){return new J({schema:this,typeName:ae.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return X.create(this,this._def)}nullable(){return ee.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return T.create(this,this._def)}promise(){return Q.create(this,this._def)}or(e){return j.create([this,e],this._def)}and(e){return D.create(this,e,this._def)}transform(e){return new J({...d(this._def),schema:this,typeName:ae.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new te({...d(this._def),innerType:this,defaultValue:t,typeName:ae.ZodDefault})}brand(){return new ie({typeName:ae.ZodBranded,type:this,...d(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new re({...d(this._def),innerType:this,catchValue:t,typeName:ae.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return oe.create(this,e)}readonly(){return se.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}t.ZodType=u,t.Schema=u,t.ZodSchema=u;const h=/^c[^\s-]{8,}$/i,f=/^[a-z][a-z0-9]*$/,p=/^[0-9A-HJKMNP-TV-Z]{26}$/,g=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,m=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let y;const b=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,w=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/;class v extends u{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==s.ZodParsedType.string){const t=this._getOrReturnCtx(e);return(0,o.addIssueToContext)(t,{code:a.ZodIssueCode.invalid_type,expected:s.ZodParsedType.string,received:t.parsedType}),o.INVALID}const t=new o.ParseStatus;let r;for(const c of this._def.checks)if("min"===c.kind)e.data.lengthc.value&&(r=this._getOrReturnCtx(e,r),(0,o.addIssueToContext)(r,{code:a.ZodIssueCode.too_big,maximum:c.value,type:"string",inclusive:!0,exact:!1,message:c.message}),t.dirty());else if("length"===c.kind){const n=e.data.length>c.value,i=e.data.lengthe.test(t)),{validation:t,code:a.ZodIssueCode.invalid_string,...i.errorUtil.errToObj(r)})}_addCheck(e){return new v({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...i.errorUtil.errToObj(e)})}url(e){return this._addCheck({kind:"url",...i.errorUtil.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...i.errorUtil.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...i.errorUtil.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...i.errorUtil.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...i.errorUtil.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...i.errorUtil.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...i.errorUtil.errToObj(e)})}datetime(e){var t;return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,offset:null!==(t=null==e?void 0:e.offset)&&void 0!==t&&t,...i.errorUtil.errToObj(null==e?void 0:e.message)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...i.errorUtil.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:null==t?void 0:t.position,...i.errorUtil.errToObj(null==t?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...i.errorUtil.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...i.errorUtil.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...i.errorUtil.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...i.errorUtil.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...i.errorUtil.errToObj(t)})}nonempty(e){return this.min(1,i.errorUtil.errToObj(e))}trim(){return new v({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new v({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new v({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((e=>"datetime"===e.kind))}get isEmail(){return!!this._def.checks.find((e=>"email"===e.kind))}get isURL(){return!!this._def.checks.find((e=>"url"===e.kind))}get isEmoji(){return!!this._def.checks.find((e=>"emoji"===e.kind))}get isUUID(){return!!this._def.checks.find((e=>"uuid"===e.kind))}get isCUID(){return!!this._def.checks.find((e=>"cuid"===e.kind))}get isCUID2(){return!!this._def.checks.find((e=>"cuid2"===e.kind))}get isULID(){return!!this._def.checks.find((e=>"ulid"===e.kind))}get isIP(){return!!this._def.checks.find((e=>"ip"===e.kind))}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.valuen?r:n;return parseInt(e.toFixed(i).replace(".",""))%parseInt(t.toFixed(i).replace(".",""))/Math.pow(10,i)}t.ZodString=v,v.create=e=>{var t;return new v({checks:[],typeName:ae.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...d(e)})};class _ extends u{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==s.ZodParsedType.number){const t=this._getOrReturnCtx(e);return(0,o.addIssueToContext)(t,{code:a.ZodIssueCode.invalid_type,expected:s.ZodParsedType.number,received:t.parsedType}),o.INVALID}let t;const r=new o.ParseStatus;for(const n of this._def.checks)"int"===n.kind?s.util.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),(0,o.addIssueToContext)(t,{code:a.ZodIssueCode.invalid_type,expected:"integer",received:"float",message:n.message}),r.dirty()):"min"===n.kind?(n.inclusive?e.datan.value:e.data>=n.value)&&(t=this._getOrReturnCtx(e,t),(0,o.addIssueToContext)(t,{code:a.ZodIssueCode.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),r.dirty()):"multipleOf"===n.kind?0!==C(e.data,n.value)&&(t=this._getOrReturnCtx(e,t),(0,o.addIssueToContext)(t,{code:a.ZodIssueCode.not_multiple_of,multipleOf:n.value,message:n.message}),r.dirty()):"finite"===n.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),(0,o.addIssueToContext)(t,{code:a.ZodIssueCode.not_finite,message:n.message}),r.dirty()):s.util.assertNever(n);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,i.errorUtil.toString(t))}gt(e,t){return this.setLimit("min",e,!1,i.errorUtil.toString(t))}lte(e,t){return this.setLimit("max",e,!0,i.errorUtil.toString(t))}lt(e,t){return this.setLimit("max",e,!1,i.errorUtil.toString(t))}setLimit(e,t,r,n){return new _({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:i.errorUtil.toString(n)}]})}_addCheck(e){return new _({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:i.errorUtil.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:i.errorUtil.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:i.errorUtil.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:i.errorUtil.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:i.errorUtil.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:i.errorUtil.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:i.errorUtil.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:i.errorUtil.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:i.errorUtil.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value"int"===e.kind||"multipleOf"===e.kind&&s.util.isInteger(e.value)))}get isFinite(){let e=null,t=null;for(const r of this._def.checks){if("finite"===r.kind||"int"===r.kind||"multipleOf"===r.kind)return!0;"min"===r.kind?(null===t||r.value>t)&&(t=r.value):"max"===r.kind&&(null===e||r.valuenew _({checks:[],typeName:ae.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...d(e)});class k extends u{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==s.ZodParsedType.bigint){const t=this._getOrReturnCtx(e);return(0,o.addIssueToContext)(t,{code:a.ZodIssueCode.invalid_type,expected:s.ZodParsedType.bigint,received:t.parsedType}),o.INVALID}let t;const r=new o.ParseStatus;for(const n of this._def.checks)"min"===n.kind?(n.inclusive?e.datan.value:e.data>=n.value)&&(t=this._getOrReturnCtx(e,t),(0,o.addIssueToContext)(t,{code:a.ZodIssueCode.too_big,type:"bigint",maximum:n.value,inclusive:n.inclusive,message:n.message}),r.dirty()):"multipleOf"===n.kind?e.data%n.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),(0,o.addIssueToContext)(t,{code:a.ZodIssueCode.not_multiple_of,multipleOf:n.value,message:n.message}),r.dirty()):s.util.assertNever(n);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,i.errorUtil.toString(t))}gt(e,t){return this.setLimit("min",e,!1,i.errorUtil.toString(t))}lte(e,t){return this.setLimit("max",e,!0,i.errorUtil.toString(t))}lt(e,t){return this.setLimit("max",e,!1,i.errorUtil.toString(t))}setLimit(e,t,r,n){return new k({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:i.errorUtil.toString(n)}]})}_addCheck(e){return new k({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:i.errorUtil.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:i.errorUtil.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:i.errorUtil.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:i.errorUtil.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:i.errorUtil.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value{var t;return new k({checks:[],typeName:ae.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...d(e)})};class x extends u{_parse(e){if(this._def.coerce&&(e.data=Boolean(e.data)),this._getType(e)!==s.ZodParsedType.boolean){const t=this._getOrReturnCtx(e);return(0,o.addIssueToContext)(t,{code:a.ZodIssueCode.invalid_type,expected:s.ZodParsedType.boolean,received:t.parsedType}),o.INVALID}return(0,o.OK)(e.data)}}t.ZodBoolean=x,x.create=e=>new x({typeName:ae.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...d(e)});class A extends u{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==s.ZodParsedType.date){const t=this._getOrReturnCtx(e);return(0,o.addIssueToContext)(t,{code:a.ZodIssueCode.invalid_type,expected:s.ZodParsedType.date,received:t.parsedType}),o.INVALID}if(isNaN(e.data.getTime())){const t=this._getOrReturnCtx(e);return(0,o.addIssueToContext)(t,{code:a.ZodIssueCode.invalid_date}),o.INVALID}const t=new o.ParseStatus;let r;for(const n of this._def.checks)"min"===n.kind?e.data.getTime()n.value&&(r=this._getOrReturnCtx(e,r),(0,o.addIssueToContext)(r,{code:a.ZodIssueCode.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:"date"}),t.dirty()):s.util.assertNever(n);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new A({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:i.errorUtil.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:i.errorUtil.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.valuenew A({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:ae.ZodDate,...d(e)});class S extends u{_parse(e){if(this._getType(e)!==s.ZodParsedType.symbol){const t=this._getOrReturnCtx(e);return(0,o.addIssueToContext)(t,{code:a.ZodIssueCode.invalid_type,expected:s.ZodParsedType.symbol,received:t.parsedType}),o.INVALID}return(0,o.OK)(e.data)}}t.ZodSymbol=S,S.create=e=>new S({typeName:ae.ZodSymbol,...d(e)});class B extends u{_parse(e){if(this._getType(e)!==s.ZodParsedType.undefined){const t=this._getOrReturnCtx(e);return(0,o.addIssueToContext)(t,{code:a.ZodIssueCode.invalid_type,expected:s.ZodParsedType.undefined,received:t.parsedType}),o.INVALID}return(0,o.OK)(e.data)}}t.ZodUndefined=B,B.create=e=>new B({typeName:ae.ZodUndefined,...d(e)});class E extends u{_parse(e){if(this._getType(e)!==s.ZodParsedType.null){const t=this._getOrReturnCtx(e);return(0,o.addIssueToContext)(t,{code:a.ZodIssueCode.invalid_type,expected:s.ZodParsedType.null,received:t.parsedType}),o.INVALID}return(0,o.OK)(e.data)}}t.ZodNull=E,E.create=e=>new E({typeName:ae.ZodNull,...d(e)});class I extends u{constructor(){super(...arguments),this._any=!0}_parse(e){return(0,o.OK)(e.data)}}t.ZodAny=I,I.create=e=>new I({typeName:ae.ZodAny,...d(e)});class P extends u{constructor(){super(...arguments),this._unknown=!0}_parse(e){return(0,o.OK)(e.data)}}t.ZodUnknown=P,P.create=e=>new P({typeName:ae.ZodUnknown,...d(e)});class M extends u{_parse(e){const t=this._getOrReturnCtx(e);return(0,o.addIssueToContext)(t,{code:a.ZodIssueCode.invalid_type,expected:s.ZodParsedType.never,received:t.parsedType}),o.INVALID}}t.ZodNever=M,M.create=e=>new M({typeName:ae.ZodNever,...d(e)});class U extends u{_parse(e){if(this._getType(e)!==s.ZodParsedType.undefined){const t=this._getOrReturnCtx(e);return(0,o.addIssueToContext)(t,{code:a.ZodIssueCode.invalid_type,expected:s.ZodParsedType.void,received:t.parsedType}),o.INVALID}return(0,o.OK)(e.data)}}t.ZodVoid=U,U.create=e=>new U({typeName:ae.ZodVoid,...d(e)});class T extends u{_parse(e){const{ctx:t,status:r}=this._processInputParams(e),n=this._def;if(t.parsedType!==s.ZodParsedType.array)return(0,o.addIssueToContext)(t,{code:a.ZodIssueCode.invalid_type,expected:s.ZodParsedType.array,received:t.parsedType}),o.INVALID;if(null!==n.exactLength){const e=t.data.length>n.exactLength.value,i=t.data.lengthn.maxLength.value&&((0,o.addIssueToContext)(t,{code:a.ZodIssueCode.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),r.dirty()),t.common.async)return Promise.all([...t.data].map(((e,r)=>n.type._parseAsync(new l(t,e,t.path,r))))).then((e=>o.ParseStatus.mergeArray(r,e)));const i=[...t.data].map(((e,r)=>n.type._parseSync(new l(t,e,t.path,r))));return o.ParseStatus.mergeArray(r,i)}get element(){return this._def.type}min(e,t){return new T({...this._def,minLength:{value:e,message:i.errorUtil.toString(t)}})}max(e,t){return new T({...this._def,maxLength:{value:e,message:i.errorUtil.toString(t)}})}length(e,t){return new T({...this._def,exactLength:{value:e,message:i.errorUtil.toString(t)}})}nonempty(e){return this.min(1,e)}}function O(e){if(e instanceof R){const t={};for(const r in e.shape){const n=e.shape[r];t[r]=X.create(O(n))}return new R({...e._def,shape:()=>t})}return e instanceof T?new T({...e._def,type:O(e.element)}):e instanceof X?X.create(O(e.unwrap())):e instanceof ee?ee.create(O(e.unwrap())):e instanceof $?$.create(e.items.map((e=>O(e)))):e}t.ZodArray=T,T.create=(e,t)=>new T({type:e,minLength:null,maxLength:null,exactLength:null,typeName:ae.ZodArray,...d(t)});class R extends u{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const e=this._def.shape(),t=s.util.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==s.ZodParsedType.object){const t=this._getOrReturnCtx(e);return(0,o.addIssueToContext)(t,{code:a.ZodIssueCode.invalid_type,expected:s.ZodParsedType.object,received:t.parsedType}),o.INVALID}const{status:t,ctx:r}=this._processInputParams(e),{shape:n,keys:i}=this._getCached(),c=[];if(!(this._def.catchall instanceof M&&"strip"===this._def.unknownKeys))for(const e in r.data)i.includes(e)||c.push(e);const d=[];for(const e of i){const t=n[e],i=r.data[e];d.push({key:{status:"valid",value:e},value:t._parse(new l(r,i,r.path,e)),alwaysSet:e in r.data})}if(this._def.catchall instanceof M){const e=this._def.unknownKeys;if("passthrough"===e)for(const e of c)d.push({key:{status:"valid",value:e},value:{status:"valid",value:r.data[e]}});else if("strict"===e)c.length>0&&((0,o.addIssueToContext)(r,{code:a.ZodIssueCode.unrecognized_keys,keys:c}),t.dirty());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of c){const n=r.data[t];d.push({key:{status:"valid",value:t},value:e._parse(new l(r,n,r.path,t)),alwaysSet:t in r.data})}}return r.common.async?Promise.resolve().then((async()=>{const e=[];for(const t of d){const r=await t.key;e.push({key:r,value:await t.value,alwaysSet:t.alwaysSet})}return e})).then((e=>o.ParseStatus.mergeObjectSync(t,e))):o.ParseStatus.mergeObjectSync(t,d)}get shape(){return this._def.shape()}strict(e){return i.errorUtil.errToObj,new R({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,r)=>{var n,o,s,a;const l=null!==(s=null===(o=(n=this._def).errorMap)||void 0===o?void 0:o.call(n,t,r).message)&&void 0!==s?s:r.defaultError;return"unrecognized_keys"===t.code?{message:null!==(a=i.errorUtil.errToObj(e).message)&&void 0!==a?a:l}:{message:l}}}:{}})}strip(){return new R({...this._def,unknownKeys:"strip"})}passthrough(){return new R({...this._def,unknownKeys:"passthrough"})}extend(e){return new R({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new R({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:ae.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new R({...this._def,catchall:e})}pick(e){const t={};return s.util.objectKeys(e).forEach((r=>{e[r]&&this.shape[r]&&(t[r]=this.shape[r])})),new R({...this._def,shape:()=>t})}omit(e){const t={};return s.util.objectKeys(this.shape).forEach((r=>{e[r]||(t[r]=this.shape[r])})),new R({...this._def,shape:()=>t})}deepPartial(){return O(this)}partial(e){const t={};return s.util.objectKeys(this.shape).forEach((r=>{const n=this.shape[r];e&&!e[r]?t[r]=n:t[r]=n.optional()})),new R({...this._def,shape:()=>t})}required(e){const t={};return s.util.objectKeys(this.shape).forEach((r=>{if(e&&!e[r])t[r]=this.shape[r];else{let e=this.shape[r];for(;e instanceof X;)e=e._def.innerType;t[r]=e}})),new R({...this._def,shape:()=>t})}keyof(){return W(s.util.objectKeys(this.shape))}}t.ZodObject=R,R.create=(e,t)=>new R({shape:()=>e,unknownKeys:"strip",catchall:M.create(),typeName:ae.ZodObject,...d(t)}),R.strictCreate=(e,t)=>new R({shape:()=>e,unknownKeys:"strict",catchall:M.create(),typeName:ae.ZodObject,...d(t)}),R.lazycreate=(e,t)=>new R({shape:e,unknownKeys:"strip",catchall:M.create(),typeName:ae.ZodObject,...d(t)});class j extends u{_parse(e){const{ctx:t}=this._processInputParams(e),r=this._def.options;if(t.common.async)return Promise.all(r.map((async e=>{const r={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:r}),ctx:r}}))).then((function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const r of e)if("dirty"===r.result.status)return t.common.issues.push(...r.ctx.common.issues),r.result;const r=e.map((e=>new a.ZodError(e.ctx.common.issues)));return(0,o.addIssueToContext)(t,{code:a.ZodIssueCode.invalid_union,unionErrors:r}),o.INVALID}));{let e;const n=[];for(const i of r){const r={...t,common:{...t.common,issues:[]},parent:null},o=i._parseSync({data:t.data,path:t.path,parent:r});if("valid"===o.status)return o;"dirty"!==o.status||e||(e={result:o,ctx:r}),r.common.issues.length&&n.push(r.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const i=n.map((e=>new a.ZodError(e)));return(0,o.addIssueToContext)(t,{code:a.ZodIssueCode.invalid_union,unionErrors:i}),o.INVALID}}get options(){return this._def.options}}t.ZodUnion=j,j.create=(e,t)=>new j({options:e,typeName:ae.ZodUnion,...d(t)});const L=e=>e instanceof H?L(e.schema):e instanceof J?L(e.innerType()):e instanceof Z?[e.value]:e instanceof G?e.options:e instanceof Y?Object.keys(e.enum):e instanceof te?L(e._def.innerType):e instanceof B?[void 0]:e instanceof E?[null]:null;class z extends u{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==s.ZodParsedType.object)return(0,o.addIssueToContext)(t,{code:a.ZodIssueCode.invalid_type,expected:s.ZodParsedType.object,received:t.parsedType}),o.INVALID;const r=this.discriminator,n=t.data[r],i=this.optionsMap.get(n);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):((0,o.addIssueToContext)(t,{code:a.ZodIssueCode.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),o.INVALID)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,r){const n=new Map;for(const r of t){const t=L(r.shape[e]);if(!t)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const i of t){if(n.has(i))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(i)}`);n.set(i,r)}}return new z({typeName:ae.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:n,...d(r)})}}function N(e,t){const r=(0,s.getParsedType)(e),n=(0,s.getParsedType)(t);if(e===t)return{valid:!0,data:e};if(r===s.ZodParsedType.object&&n===s.ZodParsedType.object){const r=s.util.objectKeys(t),n=s.util.objectKeys(e).filter((e=>-1!==r.indexOf(e))),i={...e,...t};for(const r of n){const n=N(e[r],t[r]);if(!n.valid)return{valid:!1};i[r]=n.data}return{valid:!0,data:i}}if(r===s.ZodParsedType.array&&n===s.ZodParsedType.array){if(e.length!==t.length)return{valid:!1};const r=[];for(let n=0;n{if((0,o.isAborted)(e)||(0,o.isAborted)(n))return o.INVALID;const i=N(e.value,n.value);return i.valid?(((0,o.isDirty)(e)||(0,o.isDirty)(n))&&t.dirty(),{status:t.value,value:i.data}):((0,o.addIssueToContext)(r,{code:a.ZodIssueCode.invalid_intersection_types}),o.INVALID)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then((([e,t])=>n(e,t))):n(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}t.ZodIntersection=D,D.create=(e,t,r)=>new D({left:e,right:t,typeName:ae.ZodIntersection,...d(r)});class $ extends u{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==s.ZodParsedType.array)return(0,o.addIssueToContext)(r,{code:a.ZodIssueCode.invalid_type,expected:s.ZodParsedType.array,received:r.parsedType}),o.INVALID;if(r.data.lengththis._def.items.length&&((0,o.addIssueToContext)(r,{code:a.ZodIssueCode.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const n=[...r.data].map(((e,t)=>{const n=this._def.items[t]||this._def.rest;return n?n._parse(new l(r,e,r.path,t)):null})).filter((e=>!!e));return r.common.async?Promise.all(n).then((e=>o.ParseStatus.mergeArray(t,e))):o.ParseStatus.mergeArray(t,n)}get items(){return this._def.items}rest(e){return new $({...this._def,rest:e})}}t.ZodTuple=$,$.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new $({items:e,typeName:ae.ZodTuple,rest:null,...d(t)})};class F extends u{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==s.ZodParsedType.object)return(0,o.addIssueToContext)(r,{code:a.ZodIssueCode.invalid_type,expected:s.ZodParsedType.object,received:r.parsedType}),o.INVALID;const n=[],i=this._def.keyType,c=this._def.valueType;for(const e in r.data)n.push({key:i._parse(new l(r,e,r.path,e)),value:c._parse(new l(r,r.data[e],r.path,e))});return r.common.async?o.ParseStatus.mergeObjectAsync(t,n):o.ParseStatus.mergeObjectSync(t,n)}get element(){return this._def.valueType}static create(e,t,r){return new F(t instanceof u?{keyType:e,valueType:t,typeName:ae.ZodRecord,...d(r)}:{keyType:v.create(),valueType:e,typeName:ae.ZodRecord,...d(t)})}}t.ZodRecord=F;class K extends u{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==s.ZodParsedType.map)return(0,o.addIssueToContext)(r,{code:a.ZodIssueCode.invalid_type,expected:s.ZodParsedType.map,received:r.parsedType}),o.INVALID;const n=this._def.keyType,i=this._def.valueType,c=[...r.data.entries()].map((([e,t],o)=>({key:n._parse(new l(r,e,r.path,[o,"key"])),value:i._parse(new l(r,t,r.path,[o,"value"]))})));if(r.common.async){const e=new Map;return Promise.resolve().then((async()=>{for(const r of c){const n=await r.key,i=await r.value;if("aborted"===n.status||"aborted"===i.status)return o.INVALID;"dirty"!==n.status&&"dirty"!==i.status||t.dirty(),e.set(n.value,i.value)}return{status:t.value,value:e}}))}{const e=new Map;for(const r of c){const n=r.key,i=r.value;if("aborted"===n.status||"aborted"===i.status)return o.INVALID;"dirty"!==n.status&&"dirty"!==i.status||t.dirty(),e.set(n.value,i.value)}return{status:t.value,value:e}}}}t.ZodMap=K,K.create=(e,t,r)=>new K({valueType:t,keyType:e,typeName:ae.ZodMap,...d(r)});class V extends u{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==s.ZodParsedType.set)return(0,o.addIssueToContext)(r,{code:a.ZodIssueCode.invalid_type,expected:s.ZodParsedType.set,received:r.parsedType}),o.INVALID;const n=this._def;null!==n.minSize&&r.data.sizen.maxSize.value&&((0,o.addIssueToContext)(r,{code:a.ZodIssueCode.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty());const i=this._def.valueType;function c(e){const r=new Set;for(const n of e){if("aborted"===n.status)return o.INVALID;"dirty"===n.status&&t.dirty(),r.add(n.value)}return{status:t.value,value:r}}const d=[...r.data.values()].map(((e,t)=>i._parse(new l(r,e,r.path,t))));return r.common.async?Promise.all(d).then((e=>c(e))):c(d)}min(e,t){return new V({...this._def,minSize:{value:e,message:i.errorUtil.toString(t)}})}max(e,t){return new V({...this._def,maxSize:{value:e,message:i.errorUtil.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}t.ZodSet=V,V.create=(e,t)=>new V({valueType:e,minSize:null,maxSize:null,typeName:ae.ZodSet,...d(t)});class q extends u{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==s.ZodParsedType.function)return(0,o.addIssueToContext)(t,{code:a.ZodIssueCode.invalid_type,expected:s.ZodParsedType.function,received:t.parsedType}),o.INVALID;function r(e,r){return(0,o.makeIssue)({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,(0,n.getErrorMap)(),n.defaultErrorMap].filter((e=>!!e)),issueData:{code:a.ZodIssueCode.invalid_arguments,argumentsError:r}})}function i(e,r){return(0,o.makeIssue)({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,(0,n.getErrorMap)(),n.defaultErrorMap].filter((e=>!!e)),issueData:{code:a.ZodIssueCode.invalid_return_type,returnTypeError:r}})}const l={errorMap:t.common.contextualErrorMap},c=t.data;if(this._def.returns instanceof Q){const e=this;return(0,o.OK)((async function(...t){const n=new a.ZodError([]),o=await e._def.args.parseAsync(t,l).catch((e=>{throw n.addIssue(r(t,e)),n})),s=await Reflect.apply(c,this,o);return await e._def.returns._def.type.parseAsync(s,l).catch((e=>{throw n.addIssue(i(s,e)),n}))}))}{const e=this;return(0,o.OK)((function(...t){const n=e._def.args.safeParse(t,l);if(!n.success)throw new a.ZodError([r(t,n.error)]);const o=Reflect.apply(c,this,n.data),s=e._def.returns.safeParse(o,l);if(!s.success)throw new a.ZodError([i(o,s.error)]);return s.data}))}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new q({...this._def,args:$.create(e).rest(P.create())})}returns(e){return new q({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,r){return new q({args:e||$.create([]).rest(P.create()),returns:t||P.create(),typeName:ae.ZodFunction,...d(r)})}}t.ZodFunction=q;class H extends u{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}t.ZodLazy=H,H.create=(e,t)=>new H({getter:e,typeName:ae.ZodLazy,...d(t)});class Z extends u{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return(0,o.addIssueToContext)(t,{received:t.data,code:a.ZodIssueCode.invalid_literal,expected:this._def.value}),o.INVALID}return{status:"valid",value:e.data}}get value(){return this._def.value}}function W(e,t){return new G({values:e,typeName:ae.ZodEnum,...d(t)})}t.ZodLiteral=Z,Z.create=(e,t)=>new Z({value:e,typeName:ae.ZodLiteral,...d(t)});class G extends u{_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),r=this._def.values;return(0,o.addIssueToContext)(t,{expected:s.util.joinValues(r),received:t.parsedType,code:a.ZodIssueCode.invalid_type}),o.INVALID}if(-1===this._def.values.indexOf(e.data)){const t=this._getOrReturnCtx(e),r=this._def.values;return(0,o.addIssueToContext)(t,{received:t.data,code:a.ZodIssueCode.invalid_enum_value,options:r}),o.INVALID}return(0,o.OK)(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e){return G.create(e)}exclude(e){return G.create(this.options.filter((t=>!e.includes(t))))}}t.ZodEnum=G,G.create=W;class Y extends u{_parse(e){const t=s.util.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==s.ZodParsedType.string&&r.parsedType!==s.ZodParsedType.number){const e=s.util.objectValues(t);return(0,o.addIssueToContext)(r,{expected:s.util.joinValues(e),received:r.parsedType,code:a.ZodIssueCode.invalid_type}),o.INVALID}if(-1===t.indexOf(e.data)){const e=s.util.objectValues(t);return(0,o.addIssueToContext)(r,{received:r.data,code:a.ZodIssueCode.invalid_enum_value,options:e}),o.INVALID}return(0,o.OK)(e.data)}get enum(){return this._def.values}}t.ZodNativeEnum=Y,Y.create=(e,t)=>new Y({values:e,typeName:ae.ZodNativeEnum,...d(t)});class Q extends u{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==s.ZodParsedType.promise&&!1===t.common.async)return(0,o.addIssueToContext)(t,{code:a.ZodIssueCode.invalid_type,expected:s.ZodParsedType.promise,received:t.parsedType}),o.INVALID;const r=t.parsedType===s.ZodParsedType.promise?t.data:Promise.resolve(t.data);return(0,o.OK)(r.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}t.ZodPromise=Q,Q.create=(e,t)=>new Q({type:e,typeName:ae.ZodPromise,...d(t)});class J extends u{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ae.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:r}=this._processInputParams(e),n=this._def.effect||null,i={addIssue:e=>{(0,o.addIssueToContext)(r,e),e.fatal?t.abort():t.dirty()},get path(){return r.path}};if(i.addIssue=i.addIssue.bind(i),"preprocess"===n.type){const e=n.transform(r.data,i);return r.common.issues.length?{status:"dirty",value:r.data}:r.common.async?Promise.resolve(e).then((e=>this._def.schema._parseAsync({data:e,path:r.path,parent:r}))):this._def.schema._parseSync({data:e,path:r.path,parent:r})}if("refinement"===n.type){const e=e=>{const t=n.refinement(e,i);if(r.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===r.common.async){const n=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===n.status?o.INVALID:("dirty"===n.status&&t.dirty(),e(n.value),{status:t.value,value:n.value})}return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then((r=>"aborted"===r.status?o.INVALID:("dirty"===r.status&&t.dirty(),e(r.value).then((()=>({status:t.value,value:r.value}))))))}if("transform"===n.type){if(!1===r.common.async){const e=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!(0,o.isValid)(e))return e;const s=n.transform(e.value,i);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:s}}return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then((e=>(0,o.isValid)(e)?Promise.resolve(n.transform(e.value,i)).then((e=>({status:t.value,value:e}))):e))}s.util.assertNever(n)}}t.ZodEffects=J,t.ZodTransformer=J,J.create=(e,t,r)=>new J({schema:e,typeName:ae.ZodEffects,effect:t,...d(r)}),J.createWithPreprocess=(e,t,r)=>new J({schema:t,effect:{type:"preprocess",transform:e},typeName:ae.ZodEffects,...d(r)});class X extends u{_parse(e){return this._getType(e)===s.ZodParsedType.undefined?(0,o.OK)(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}t.ZodOptional=X,X.create=(e,t)=>new X({innerType:e,typeName:ae.ZodOptional,...d(t)});class ee extends u{_parse(e){return this._getType(e)===s.ZodParsedType.null?(0,o.OK)(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}t.ZodNullable=ee,ee.create=(e,t)=>new ee({innerType:e,typeName:ae.ZodNullable,...d(t)});class te extends u{_parse(e){const{ctx:t}=this._processInputParams(e);let r=t.data;return t.parsedType===s.ZodParsedType.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}t.ZodDefault=te,te.create=(e,t)=>new te({innerType:e,typeName:ae.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...d(t)});class re extends u{_parse(e){const{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return(0,o.isAsync)(n)?n.then((e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new a.ZodError(r.common.issues)},input:r.data})}))):{status:"valid",value:"valid"===n.status?n.value:this._def.catchValue({get error(){return new a.ZodError(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}t.ZodCatch=re,re.create=(e,t)=>new re({innerType:e,typeName:ae.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...d(t)});class ne extends u{_parse(e){if(this._getType(e)!==s.ZodParsedType.nan){const t=this._getOrReturnCtx(e);return(0,o.addIssueToContext)(t,{code:a.ZodIssueCode.invalid_type,expected:s.ZodParsedType.nan,received:t.parsedType}),o.INVALID}return{status:"valid",value:e.data}}}t.ZodNaN=ne,ne.create=e=>new ne({typeName:ae.ZodNaN,...d(e)}),t.BRAND=Symbol("zod_brand");class ie extends u{_parse(e){const{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}}t.ZodBranded=ie;class oe extends u{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const e=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?o.INVALID:"dirty"===e.status?(t.dirty(),(0,o.DIRTY)(e.value)):this._def.out._parseAsync({data:e.value,path:r.path,parent:r})})();{const e=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?o.INVALID:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:r.path,parent:r})}}static create(e,t){return new oe({in:e,out:t,typeName:ae.ZodPipeline})}}t.ZodPipeline=oe;class se extends u{_parse(e){const t=this._def.innerType._parse(e);return(0,o.isValid)(t)&&(t.value=Object.freeze(t.value)),t}}var ae;t.ZodReadonly=se,se.create=(e,t)=>new se({innerType:e,typeName:ae.ZodReadonly,...d(t)}),t.custom=(e,t={},r)=>e?I.create().superRefine(((n,i)=>{var o,s;if(!e(n)){const e="function"==typeof t?t(n):"string"==typeof t?{message:t}:t,a=null===(s=null!==(o=e.fatal)&&void 0!==o?o:r)||void 0===s||s,l="string"==typeof e?{message:e}:e;i.addIssue({code:"custom",...l,fatal:a})}})):I.create(),t.late={object:R.lazycreate},function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"}(ae=t.ZodFirstPartyTypeKind||(t.ZodFirstPartyTypeKind={})),t.instanceof=(e,r={message:`Input not instance of ${e.name}`})=>(0,t.custom)((t=>t instanceof e),r);const le=v.create;t.string=le;const ce=_.create;t.number=ce;const de=ne.create;t.nan=de;const ue=k.create;t.bigint=ue;const he=x.create;t.boolean=he;const fe=A.create;t.date=fe;const pe=S.create;t.symbol=pe;const ge=B.create;t.undefined=ge;const me=E.create;t.null=me;const ye=I.create;t.any=ye;const be=P.create;t.unknown=be;const we=M.create;t.never=we;const ve=U.create;t.void=ve;const Ce=T.create;t.array=Ce;const _e=R.create;t.object=_e;const ke=R.strictCreate;t.strictObject=ke;const xe=j.create;t.union=xe;const Ae=z.create;t.discriminatedUnion=Ae;const Se=D.create;t.intersection=Se;const Be=$.create;t.tuple=Be;const Ee=F.create;t.record=Ee;const Ie=K.create;t.map=Ie;const Pe=V.create;t.set=Pe;const Me=q.create;t.function=Me;const Ue=H.create;t.lazy=Ue;const Te=Z.create;t.literal=Te;const Oe=G.create;t.enum=Oe;const Re=Y.create;t.nativeEnum=Re;const je=Q.create;t.promise=je;const Le=J.create;t.effect=Le,t.transformer=Le;const ze=X.create;t.optional=ze;const Ne=ee.create;t.nullable=Ne;const De=J.createWithPreprocess;t.preprocess=De;const $e=oe.create;t.pipeline=$e,t.ostring=()=>le().optional(),t.onumber=()=>ce().optional(),t.oboolean=()=>he().optional(),t.coerce={string:e=>v.create({...e,coerce:!0}),number:e=>_.create({...e,coerce:!0}),boolean:e=>x.create({...e,coerce:!0}),bigint:e=>k.create({...e,coerce:!0}),date:e=>A.create({...e,coerce:!0})},t.NEVER=o.INVALID},6443:()=>{},1281:()=>{},6425:(e,t,r)=>{"use strict";var n=r(8287).hp;function i(e,t){return function(){return e.apply(t,arguments)}}const{toString:o}=Object.prototype,{getPrototypeOf:s}=Object,a=(l=Object.create(null),e=>{const t=o.call(e);return l[t]||(l[t]=t.slice(8,-1).toLowerCase())});var l;const c=e=>(e=e.toLowerCase(),t=>a(t)===e),d=e=>t=>typeof t===e,{isArray:u}=Array,h=d("undefined"),f=c("ArrayBuffer"),p=d("string"),g=d("function"),m=d("number"),y=e=>null!==e&&"object"==typeof e,b=e=>{if("object"!==a(e))return!1;const t=s(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},w=c("Date"),v=c("File"),C=c("Blob"),_=c("FileList"),k=c("URLSearchParams");function x(e,t,{allOwnKeys:r=!1}={}){if(null==e)return;let n,i;if("object"!=typeof e&&(e=[e]),u(e))for(n=0,i=e.length;n0;)if(n=r[i],t===n.toLowerCase())return n;return null}const S="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:r.g,B=e=>!h(e)&&e!==S,E=(I="undefined"!=typeof Uint8Array&&s(Uint8Array),e=>I&&e instanceof I);var I;const P=c("HTMLFormElement"),M=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),U=c("RegExp"),T=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};x(r,((r,i)=>{let o;!1!==(o=t(r,i,e))&&(n[i]=o||r)})),Object.defineProperties(e,n)},O="abcdefghijklmnopqrstuvwxyz",R="0123456789",j={DIGIT:R,ALPHA:O,ALPHA_DIGIT:O+O.toUpperCase()+R},L=c("AsyncFunction");var z={isArray:u,isArrayBuffer:f,isBuffer:function(e){return null!==e&&!h(e)&&null!==e.constructor&&!h(e.constructor)&&g(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||g(e.append)&&("formdata"===(t=a(e))||"object"===t&&g(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&f(e.buffer),t},isString:p,isNumber:m,isBoolean:e=>!0===e||!1===e,isObject:y,isPlainObject:b,isUndefined:h,isDate:w,isFile:v,isBlob:C,isRegExp:U,isFunction:g,isStream:e=>y(e)&&g(e.pipe),isURLSearchParams:k,isTypedArray:E,isFileList:_,forEach:x,merge:function e(){const{caseless:t}=B(this)&&this||{},r={},n=(n,i)=>{const o=t&&A(r,i)||i;b(r[o])&&b(n)?r[o]=e(r[o],n):b(n)?r[o]=e({},n):u(n)?r[o]=n.slice():r[o]=n};for(let e=0,t=arguments.length;e(x(t,((t,n)=>{r&&g(t)?e[n]=i(t,r):e[n]=t}),{allOwnKeys:n}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},toFlatObject:(e,t,r,n)=>{let i,o,a;const l={};if(t=t||{},null==e)return t;do{for(i=Object.getOwnPropertyNames(e),o=i.length;o-- >0;)a=i[o],n&&!n(a,e,t)||l[a]||(t[a]=e[a],l[a]=!0);e=!1!==r&&s(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:a,kindOfTest:c,endsWith:(e,t,r)=>{e=String(e),(void 0===r||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return-1!==n&&n===r},toArray:e=>{if(!e)return null;if(u(e))return e;let t=e.length;if(!m(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},forEachEntry:(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let n;for(;(n=r.next())&&!n.done;){const r=n.value;t.call(e,r[0],r[1])}},matchAll:(e,t)=>{let r;const n=[];for(;null!==(r=e.exec(t));)n.push(r);return n},isHTMLForm:P,hasOwnProperty:M,hasOwnProp:M,reduceDescriptors:T,freezeMethods:e=>{T(e,((t,r)=>{if(g(e)&&-1!==["arguments","caller","callee"].indexOf(r))return!1;const n=e[r];g(n)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")}))}))},toObjectSet:(e,t)=>{const r={},n=e=>{e.forEach((e=>{r[e]=!0}))};return u(e)?n(e):n(String(e).split(t)),r},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,r){return t.toUpperCase()+r})),noop:()=>{},toFiniteNumber:(e,t)=>(e=+e,Number.isFinite(e)?e:t),findKey:A,global:S,isContextDefined:B,ALPHABET:j,generateString:(e=16,t=j.ALPHA_DIGIT)=>{let r="";const{length:n}=t;for(;e--;)r+=t[Math.random()*n|0];return r},isSpecCompliantForm:function(e){return!!(e&&g(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),r=(e,n)=>{if(y(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[n]=e;const i=u(e)?[]:{};return x(e,((e,t)=>{const o=r(e,n+1);!h(o)&&(i[t]=o)})),t[n]=void 0,i}}return e};return r(e,0)},isAsyncFn:L,isThenable:e=>e&&(y(e)||g(e))&&g(e.then)&&g(e.catch)};function N(e,t,r,n,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),i&&(this.response=i)}z.inherits(N,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:z.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const D=N.prototype,$={};function F(e){return z.isPlainObject(e)||z.isArray(e)}function K(e){return z.endsWith(e,"[]")?e.slice(0,-2):e}function V(e,t,r){return e?e.concat(t).map((function(e,t){return e=K(e),!r&&t?"["+e+"]":e})).join(r?".":""):t}["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{$[e]={value:e}})),Object.defineProperties(N,$),Object.defineProperty(D,"isAxiosError",{value:!0}),N.from=(e,t,r,n,i,o)=>{const s=Object.create(D);return z.toFlatObject(e,s,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),N.call(s,e.message,t,r,n,i),s.cause=e,s.name=e.name,o&&Object.assign(s,o),s};const q=z.toFlatObject(z,{},null,(function(e){return/^is[A-Z]/.test(e)}));function H(e,t,r){if(!z.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const i=(r=z.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!z.isUndefined(t[e])}))).metaTokens,o=r.visitor||d,s=r.dots,a=r.indexes,l=(r.Blob||"undefined"!=typeof Blob&&Blob)&&z.isSpecCompliantForm(t);if(!z.isFunction(o))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(z.isDate(e))return e.toISOString();if(!l&&z.isBlob(e))throw new N("Blob is not supported. Use a Buffer instead.");return z.isArrayBuffer(e)||z.isTypedArray(e)?l&&"function"==typeof Blob?new Blob([e]):n.from(e):e}function d(e,r,n){let o=e;if(e&&!n&&"object"==typeof e)if(z.endsWith(r,"{}"))r=i?r:r.slice(0,-2),e=JSON.stringify(e);else if(z.isArray(e)&&function(e){return z.isArray(e)&&!e.some(F)}(e)||(z.isFileList(e)||z.endsWith(r,"[]"))&&(o=z.toArray(e)))return r=K(r),o.forEach((function(e,n){!z.isUndefined(e)&&null!==e&&t.append(!0===a?V([r],n,s):null===a?r:r+"[]",c(e))})),!1;return!!F(e)||(t.append(V(n,r,s),c(e)),!1)}const u=[],h=Object.assign(q,{defaultVisitor:d,convertValue:c,isVisitable:F});if(!z.isObject(e))throw new TypeError("data must be an object");return function e(r,n){if(!z.isUndefined(r)){if(-1!==u.indexOf(r))throw Error("Circular reference detected in "+n.join("."));u.push(r),z.forEach(r,(function(r,i){!0===(!(z.isUndefined(r)||null===r)&&o.call(t,r,z.isString(i)?i.trim():i,n,h))&&e(r,n?n.concat(i):[i])})),u.pop()}}(e),t}function Z(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function W(e,t){this._pairs=[],e&&H(e,this,t)}const G=W.prototype;function Y(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Q(e,t,r){if(!t)return e;const n=r&&r.encode||Y,i=r&&r.serialize;let o;if(o=i?i(t,r):z.isURLSearchParams(t)?t.toString():new W(t,r).toString(n),o){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+o}return e}G.append=function(e,t){this._pairs.push([e,t])},G.toString=function(e){const t=e?function(t){return e.call(this,t,Z)}:Z;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};var J=class{constructor(){this.handlers=[]}use(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){z.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},X={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},ee={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:W,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const te="undefined"!=typeof window&&"undefined"!=typeof document,re=(ne="undefined"!=typeof navigator&&navigator.product,te&&["ReactNative","NativeScript","NS"].indexOf(ne)<0);var ne;const ie="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts;var oe={...Object.freeze({__proto__:null,hasBrowserEnv:te,hasStandardBrowserWebWorkerEnv:ie,hasStandardBrowserEnv:re}),...ee};function se(e){function t(e,r,n,i){let o=e[i++];if("__proto__"===o)return!0;const s=Number.isFinite(+o),a=i>=e.length;return o=!o&&z.isArray(n)?n.length:o,a?(z.hasOwnProp(n,o)?n[o]=[n[o],r]:n[o]=r,!s):(n[o]&&z.isObject(n[o])||(n[o]=[]),t(e,r,n[o],i)&&z.isArray(n[o])&&(n[o]=function(e){const t={},r=Object.keys(e);let n;const i=r.length;let o;for(n=0;n{t(function(e){return z.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),n,r,0)})),r}return null}const ae={transitional:X,adapter:["xhr","http"],transformRequest:[function(e,t){const r=t.getContentType()||"",n=r.indexOf("application/json")>-1,i=z.isObject(e);if(i&&z.isHTMLForm(e)&&(e=new FormData(e)),z.isFormData(e))return n?JSON.stringify(se(e)):e;if(z.isArrayBuffer(e)||z.isBuffer(e)||z.isStream(e)||z.isFile(e)||z.isBlob(e))return e;if(z.isArrayBufferView(e))return e.buffer;if(z.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let o;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return H(e,new oe.classes.URLSearchParams,Object.assign({visitor:function(e,t,r,n){return oe.isNode&&z.isBuffer(e)?(this.append(t,e.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((o=z.isFileList(e))||r.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return H(o?{"files[]":e}:e,t&&new t,this.formSerializer)}}return i||n?(t.setContentType("application/json",!1),function(e,t,r){if(z.isString(e))try{return(0,JSON.parse)(e),z.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||ae.transitional,r=t&&t.forcedJSONParsing,n="json"===this.responseType;if(e&&z.isString(e)&&(r&&!this.responseType||n)){const r=!(t&&t.silentJSONParsing)&&n;try{return JSON.parse(e)}catch(e){if(r){if("SyntaxError"===e.name)throw N.from(e,N.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:oe.classes.FormData,Blob:oe.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};z.forEach(["delete","get","head","post","put","patch"],(e=>{ae.headers[e]={}}));var le=ae;const ce=z.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),de=Symbol("internals");function ue(e){return e&&String(e).trim().toLowerCase()}function he(e){return!1===e||null==e?e:z.isArray(e)?e.map(he):String(e)}function fe(e,t,r,n,i){return z.isFunction(n)?n.call(this,t,r):(i&&(t=r),z.isString(t)?z.isString(n)?-1!==t.indexOf(n):z.isRegExp(n)?n.test(t):void 0:void 0)}class pe{constructor(e){e&&this.set(e)}set(e,t,r){const n=this;function i(e,t,r){const i=ue(t);if(!i)throw new Error("header name must be a non-empty string");const o=z.findKey(n,i);(!o||void 0===n[o]||!0===r||void 0===r&&!1!==n[o])&&(n[o||t]=he(e))}const o=(e,t)=>z.forEach(e,((e,r)=>i(e,r,t)));return z.isPlainObject(e)||e instanceof this.constructor?o(e,t):z.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim())?o((e=>{const t={};let r,n,i;return e&&e.split("\n").forEach((function(e){i=e.indexOf(":"),r=e.substring(0,i).trim().toLowerCase(),n=e.substring(i+1).trim(),!r||t[r]&&ce[r]||("set-cookie"===r?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)})),t})(e),t):null!=e&&i(t,e,r),this}get(e,t){if(e=ue(e)){const r=z.findKey(this,e);if(r){const e=this[r];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}(e);if(z.isFunction(t))return t.call(this,e,r);if(z.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=ue(e)){const r=z.findKey(this,e);return!(!r||void 0===this[r]||t&&!fe(0,this[r],r,t))}return!1}delete(e,t){const r=this;let n=!1;function i(e){if(e=ue(e)){const i=z.findKey(r,e);!i||t&&!fe(0,r[i],i,t)||(delete r[i],n=!0)}}return z.isArray(e)?e.forEach(i):i(e),n}clear(e){const t=Object.keys(this);let r=t.length,n=!1;for(;r--;){const i=t[r];e&&!fe(0,this[i],i,e,!0)||(delete this[i],n=!0)}return n}normalize(e){const t=this,r={};return z.forEach(this,((n,i)=>{const o=z.findKey(r,i);if(o)return t[o]=he(n),void delete t[i];const s=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,r)=>t.toUpperCase()+r))}(i):String(i).trim();s!==i&&delete t[i],t[s]=he(n),r[s]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return z.forEach(this,((r,n)=>{null!=r&&!1!==r&&(t[n]=e&&z.isArray(r)?r.join(", "):r)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const r=new this(e);return t.forEach((e=>r.set(e))),r}static accessor(e){const t=(this[de]=this[de]={accessors:{}}).accessors,r=this.prototype;function n(e){const n=ue(e);t[n]||(function(e,t){const r=z.toCamelCase(" "+t);["get","set","has"].forEach((n=>{Object.defineProperty(e,n+r,{value:function(e,r,i){return this[n].call(this,t,e,r,i)},configurable:!0})}))}(r,e),t[n]=!0)}return z.isArray(e)?e.forEach(n):n(e),this}}pe.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),z.reduceDescriptors(pe.prototype,(({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[r]=e}}})),z.freezeMethods(pe);var ge=pe;function me(e,t){const r=this||le,n=t||r,i=ge.from(n.headers);let o=n.data;return z.forEach(e,(function(e){o=e.call(r,o,i.normalize(),t?t.status:void 0)})),i.normalize(),o}function ye(e){return!(!e||!e.__CANCEL__)}function be(e,t,r){N.call(this,null==e?"canceled":e,N.ERR_CANCELED,t,r),this.name="CanceledError"}z.inherits(be,N,{__CANCEL__:!0});var we=oe.hasStandardBrowserEnv?{write(e,t,r,n,i,o){const s=[e+"="+encodeURIComponent(t)];z.isNumber(r)&&s.push("expires="+new Date(r).toGMTString()),z.isString(n)&&s.push("path="+n),z.isString(i)&&s.push("domain="+i),!0===o&&s.push("secure"),document.cookie=s.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function ve(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}var Ce=oe.hasStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let r;function n(r){let n=r;return e&&(t.setAttribute("href",n),n=t.href),t.setAttribute("href",n),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:"/"===t.pathname.charAt(0)?t.pathname:"/"+t.pathname}}return r=n(window.location.href),function(e){const t=z.isString(e)?n(e):e;return t.protocol===r.protocol&&t.host===r.host}}():function(){return!0};function _e(e,t){let r=0;const n=function(e,t){e=e||10;const r=new Array(e),n=new Array(e);let i,o=0,s=0;return t=void 0!==t?t:1e3,function(a){const l=Date.now(),c=n[s];i||(i=l),r[o]=a,n[o]=l;let d=s,u=0;for(;d!==o;)u+=r[d++],d%=e;if(o=(o+1)%e,o===s&&(s=(s+1)%e),l-i{const o=i.loaded,s=i.lengthComputable?i.total:void 0,a=o-r,l=n(a);r=o;const c={loaded:o,total:s,progress:s?o/s:void 0,bytes:a,rate:l||void 0,estimated:l&&s&&o<=s?(s-o)/l:void 0,event:i};c[t?"download":"upload"]=!0,e(c)}}const ke={http:null,xhr:"undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,r){let n=e.data;const i=ge.from(e.headers).normalize();let o,s,{responseType:a,withXSRFToken:l}=e;function c(){e.cancelToken&&e.cancelToken.unsubscribe(o),e.signal&&e.signal.removeEventListener("abort",o)}if(z.isFormData(n))if(oe.hasStandardBrowserEnv||oe.hasStandardBrowserWebWorkerEnv)i.setContentType(!1);else if(!1!==(s=i.getContentType())){const[e,...t]=s?s.split(";").map((e=>e.trim())).filter(Boolean):[];i.setContentType([e||"multipart/form-data",...t].join("; "))}let d=new XMLHttpRequest;if(e.auth){const t=e.auth.username||"",r=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";i.set("Authorization","Basic "+btoa(t+":"+r))}const u=ve(e.baseURL,e.url);function h(){if(!d)return;const n=ge.from("getAllResponseHeaders"in d&&d.getAllResponseHeaders());!function(e,t,r){const n=r.config.validateStatus;r.status&&n&&!n(r.status)?t(new N("Request failed with status code "+r.status,[N.ERR_BAD_REQUEST,N.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):e(r)}((function(e){t(e),c()}),(function(e){r(e),c()}),{data:a&&"text"!==a&&"json"!==a?d.response:d.responseText,status:d.status,statusText:d.statusText,headers:n,config:e,request:d}),d=null}if(d.open(e.method.toUpperCase(),Q(u,e.params,e.paramsSerializer),!0),d.timeout=e.timeout,"onloadend"in d?d.onloadend=h:d.onreadystatechange=function(){d&&4===d.readyState&&(0!==d.status||d.responseURL&&0===d.responseURL.indexOf("file:"))&&setTimeout(h)},d.onabort=function(){d&&(r(new N("Request aborted",N.ECONNABORTED,e,d)),d=null)},d.onerror=function(){r(new N("Network Error",N.ERR_NETWORK,e,d)),d=null},d.ontimeout=function(){let t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const n=e.transitional||X;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),r(new N(t,n.clarifyTimeoutError?N.ETIMEDOUT:N.ECONNABORTED,e,d)),d=null},oe.hasStandardBrowserEnv&&(l&&z.isFunction(l)&&(l=l(e)),l||!1!==l&&Ce(u))){const t=e.xsrfHeaderName&&e.xsrfCookieName&&we.read(e.xsrfCookieName);t&&i.set(e.xsrfHeaderName,t)}void 0===n&&i.setContentType(null),"setRequestHeader"in d&&z.forEach(i.toJSON(),(function(e,t){d.setRequestHeader(t,e)})),z.isUndefined(e.withCredentials)||(d.withCredentials=!!e.withCredentials),a&&"json"!==a&&(d.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&d.addEventListener("progress",_e(e.onDownloadProgress,!0)),"function"==typeof e.onUploadProgress&&d.upload&&d.upload.addEventListener("progress",_e(e.onUploadProgress)),(e.cancelToken||e.signal)&&(o=t=>{d&&(r(!t||t.type?new be(null,e,d):t),d.abort(),d=null)},e.cancelToken&&e.cancelToken.subscribe(o),e.signal&&(e.signal.aborted?o():e.signal.addEventListener("abort",o)));const f=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(u);f&&-1===oe.protocols.indexOf(f)?r(new N("Unsupported protocol "+f+":",N.ERR_BAD_REQUEST,e)):d.send(n||null)}))}};z.forEach(ke,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));const xe=e=>`- ${e}`,Ae=e=>z.isFunction(e)||null===e||!1===e;var Se=e=>{e=z.isArray(e)?e:[e];const{length:t}=e;let r,n;const i={};for(let o=0;o`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build")));throw new N("There is no suitable adapter to dispatch the request "+(t?e.length>1?"since :\n"+e.map(xe).join("\n"):" "+xe(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return n};function Be(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new be(null,e)}function Ee(e){return Be(e),e.headers=ge.from(e.headers),e.data=me.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Se(e.adapter||le.adapter)(e).then((function(t){return Be(e),t.data=me.call(e,e.transformResponse,t),t.headers=ge.from(t.headers),t}),(function(t){return ye(t)||(Be(e),t&&t.response&&(t.response.data=me.call(e,e.transformResponse,t.response),t.response.headers=ge.from(t.response.headers))),Promise.reject(t)}))}const Ie=e=>e instanceof ge?{...e}:e;function Pe(e,t){t=t||{};const r={};function n(e,t,r){return z.isPlainObject(e)&&z.isPlainObject(t)?z.merge.call({caseless:r},e,t):z.isPlainObject(t)?z.merge({},t):z.isArray(t)?t.slice():t}function i(e,t,r){return z.isUndefined(t)?z.isUndefined(e)?void 0:n(void 0,e,r):n(e,t,r)}function o(e,t){if(!z.isUndefined(t))return n(void 0,t)}function s(e,t){return z.isUndefined(t)?z.isUndefined(e)?void 0:n(void 0,e):n(void 0,t)}function a(r,i,o){return o in t?n(r,i):o in e?n(void 0,r):void 0}const l={url:o,method:o,data:o,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(e,t)=>i(Ie(e),Ie(t),!0)};return z.forEach(Object.keys(Object.assign({},e,t)),(function(n){const o=l[n]||i,s=o(e[n],t[n],n);z.isUndefined(s)&&o!==a||(r[n]=s)})),r}const Me={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{Me[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}}));const Ue={};Me.transitional=function(e,t,r){function n(e,t){return"[Axios v1.6.8] Transitional option '"+e+"'"+t+(r?". "+r:"")}return(r,i,o)=>{if(!1===e)throw new N(n(i," has been removed"+(t?" in "+t:"")),N.ERR_DEPRECATED);return t&&!Ue[i]&&(Ue[i]=!0,console.warn(n(i," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,i,o)}};var Te={assertOptions:function(e,t,r){if("object"!=typeof e)throw new N("options must be an object",N.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let i=n.length;for(;i-- >0;){const o=n[i],s=t[o];if(s){const t=e[o],r=void 0===t||s(t,o,e);if(!0!==r)throw new N("option "+o+" must be "+r,N.ERR_BAD_OPTION_VALUE)}else if(!0!==r)throw new N("Unknown option "+o,N.ERR_BAD_OPTION)}},validators:Me};const Oe=Te.validators;class Re{constructor(e){this.defaults=e,this.interceptors={request:new J,response:new J}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t;Error.captureStackTrace?Error.captureStackTrace(t={}):t=new Error;const r=t.stack?t.stack.replace(/^.+\n/,""):"";e.stack?r&&!String(e.stack).endsWith(r.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+r):e.stack=r}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Pe(this.defaults,t);const{transitional:r,paramsSerializer:n,headers:i}=t;void 0!==r&&Te.assertOptions(r,{silentJSONParsing:Oe.transitional(Oe.boolean),forcedJSONParsing:Oe.transitional(Oe.boolean),clarifyTimeoutError:Oe.transitional(Oe.boolean)},!1),null!=n&&(z.isFunction(n)?t.paramsSerializer={serialize:n}:Te.assertOptions(n,{encode:Oe.function,serialize:Oe.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase();let o=i&&z.merge(i.common,i[t.method]);i&&z.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete i[e]})),t.headers=ge.concat(o,i);const s=[];let a=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(a=a&&e.synchronous,s.unshift(e.fulfilled,e.rejected))}));const l=[];let c;this.interceptors.response.forEach((function(e){l.push(e.fulfilled,e.rejected)}));let d,u=0;if(!a){const e=[Ee.bind(this),void 0];for(e.unshift.apply(e,s),e.push.apply(e,l),d=e.length,c=Promise.resolve(t);u{if(!r._listeners)return;let t=r._listeners.length;for(;t-- >0;)r._listeners[t](e);r._listeners=null})),this.promise.then=e=>{let t;const n=new Promise((e=>{r.subscribe(e),t=e})).then(e);return n.cancel=function(){r.unsubscribe(t)},n},e((function(e,n,i){r.reason||(r.reason=new be(e,n,i),t(r.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}static source(){let e;return{token:new Le((function(t){e=t})),cancel:e}}}var ze=Le;const Ne={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(Ne).forEach((([e,t])=>{Ne[t]=e}));var De=Ne;const $e=function e(t){const r=new je(t),n=i(je.prototype.request,r);return z.extend(n,je.prototype,r,{allOwnKeys:!0}),z.extend(n,r,null,{allOwnKeys:!0}),n.create=function(r){return e(Pe(t,r))},n}(le);$e.Axios=je,$e.CanceledError=be,$e.CancelToken=ze,$e.isCancel=ye,$e.VERSION="1.6.8",$e.toFormData=H,$e.AxiosError=N,$e.Cancel=$e.CanceledError,$e.all=function(e){return Promise.all(e)},$e.spread=function(e){return function(t){return e.apply(null,t)}},$e.isAxiosError=function(e){return z.isObject(e)&&!0===e.isAxiosError},$e.mergeConfig=Pe,$e.AxiosHeaders=ge,$e.formToJSON=e=>se(z.isHTMLForm(e)?new FormData(e):e),$e.getAdapter=Se,$e.HttpStatusCode=De,$e.default=$e,e.exports=$e},6942:(e,t)=>{var r;!function(){"use strict";var n={}.hasOwnProperty;function i(){for(var e="",t=0;t{"use strict";e.exports={rE:"13.11.1"}}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var o=t[n]={exports:{}};return e[n].call(o.exports,o,o.exports,r),o.exports}r.amdO={},r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";var e,t,n,i,o,s,a=r(1307),l=r(6386),c=r(8947);!function(e){e[e.UNKNOWN_ERROR=0]="UNKNOWN_ERROR",e[e.BAD_REQUEST_ERROR=1]="BAD_REQUEST_ERROR",e[e.MANIFEST_NOT_FOUND_ERROR=2]="MANIFEST_NOT_FOUND_ERROR",e[e.MANIFEST_CONTENT_ERROR=3]="MANIFEST_CONTENT_ERROR",e[e.UNKNOWN_APP_ERROR=100]="UNKNOWN_APP_ERROR",e[e.USER_REJECTS_ERROR=300]="USER_REJECTS_ERROR",e[e.METHOD_NOT_SUPPORTED=400]="METHOD_NOT_SUPPORTED"}(e||(e={})),function(e){e[e.UNKNOWN_ERROR=0]="UNKNOWN_ERROR",e[e.METHOD_NOT_SUPPORTED=400]="METHOD_NOT_SUPPORTED"}(t||(t={})),function(e){e[e.UNKNOWN_ERROR=0]="UNKNOWN_ERROR",e[e.BAD_REQUEST_ERROR=1]="BAD_REQUEST_ERROR",e[e.UNKNOWN_APP_ERROR=100]="UNKNOWN_APP_ERROR",e[e.USER_REJECTS_ERROR=300]="USER_REJECTS_ERROR",e[e.METHOD_NOT_SUPPORTED=400]="METHOD_NOT_SUPPORTED"}(n||(n={})),function(e){e[e.UNKNOWN_ERROR=0]="UNKNOWN_ERROR",e[e.BAD_REQUEST_ERROR=1]="BAD_REQUEST_ERROR",e[e.UNKNOWN_APP_ERROR=100]="UNKNOWN_APP_ERROR",e[e.USER_REJECTS_ERROR=300]="USER_REJECTS_ERROR",e[e.METHOD_NOT_SUPPORTED=400]="METHOD_NOT_SUPPORTED"}(i||(i={})),function(e){e[e.UNKNOWN_ERROR=0]="UNKNOWN_ERROR",e[e.BAD_REQUEST_ERROR=1]="BAD_REQUEST_ERROR",e[e.UNKNOWN_APP_ERROR=100]="UNKNOWN_APP_ERROR",e[e.METHOD_NOT_SUPPORTED=400]="METHOD_NOT_SUPPORTED"}(o||(o={})),function(e){e.MAINNET="-239",e.TESTNET="-3"}(s||(s={}));const d=function(e,t=!1){let r;return e instanceof Uint8Array?r=e:("string"!=typeof e&&(e=JSON.stringify(e)),r=l.decodeUTF8(e)),function(e,t){const r=l.encodeBase64(e);return t?encodeURIComponent(r):r}(r,t)},u=function(e,t=!1){const r=function(e,t){return t&&(e=decodeURIComponent(e)),l.decodeBase64(e)}(e,t);return{toString:()=>l.encodeUTF8(r),toObject(){try{return JSON.parse(l.encodeUTF8(r))}catch(e){return null}},toUint8Array:()=>r}};function h(e){let t="";return e.forEach((e=>{t+=("0"+(255&e).toString(16)).slice(-2)})),t}function f(e){if(e.length%2!=0)throw new Error(`Cannot convert ${e} to bytesArray`);const t=new Uint8Array(e.length/2);for(let r=0;r=e.length)throw new Error("Index is out of buffer");return[e.slice(0,t),e.slice(t)]}(e,this.nonceLength),i=c.box.open(n,r,t,this.keyPair.secretKey);if(!i)throw new Error(`Decryption error: \n message: ${e.toString()} \n sender pubkey: ${t.toString()} \n keypair pubkey: ${this.keyPair.publicKey.toString()} \n keypair secretkey: ${this.keyPair.secretKey.toString()}`);return(new TextDecoder).decode(i)}stringifyKeypair(){return{publicKey:h(this.keyPair.publicKey),secretKey:h(this.keyPair.secretKey)}}}function g(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}l((n=n.apply(e,t||[])).next())}))}class m extends Error{constructor(e,t){super(e,t),this.message=`${m.prefix} ${this.constructor.name}${this.info?": "+this.info:""}${e?"\n"+e:""}`,Object.setPrototypeOf(this,m.prototype)}get info(){return""}}m.prefix="[TON_CONNECT_SDK_ERROR]";class y extends m{get info(){return"Passed DappMetadata is in incorrect format."}constructor(...e){super(...e),Object.setPrototypeOf(this,y.prototype)}}class b extends m{get info(){return"Passed `tonconnect-manifest.json` contains errors. Check format of your manifest. See more https://github.com/ton-connect/docs/blob/main/requests-responses.md#app-manifest"}constructor(...e){super(...e),Object.setPrototypeOf(this,b.prototype)}}class w extends m{get info(){return"Manifest not found. Make sure you added `tonconnect-manifest.json` to the root of your app or passed correct manifestUrl. See more https://github.com/ton-connect/docs/blob/main/requests-responses.md#app-manifest"}constructor(...e){super(...e),Object.setPrototypeOf(this,w.prototype)}}class v extends m{get info(){return"Wallet connection called but wallet already connected. To avoid the error, disconnect the wallet before doing a new connection."}constructor(...e){super(...e),Object.setPrototypeOf(this,v.prototype)}}class C extends m{get info(){return"Send transaction or other protocol methods called while wallet is not connected."}constructor(...e){super(...e),Object.setPrototypeOf(this,C.prototype)}}class _ extends m{get info(){return"User rejects the action in the wallet."}constructor(...e){super(...e),Object.setPrototypeOf(this,_.prototype)}}class k extends m{get info(){return"Request to the wallet contains errors."}constructor(...e){super(...e),Object.setPrototypeOf(this,k.prototype)}}class x extends m{get info(){return"App tries to send rpc request to the injected wallet while not connected."}constructor(...e){super(...e),Object.setPrototypeOf(this,x.prototype)}}class A extends m{get info(){return"There is an attempt to connect to the injected wallet while it is not exists in the webpage."}constructor(...e){super(...e),Object.setPrototypeOf(this,A.prototype)}}class S extends m{get info(){return"An error occurred while fetching the wallets list."}constructor(...e){super(...e),Object.setPrototypeOf(this,S.prototype)}}class B extends m{get info(){return"Passed address is in incorrect format."}constructor(...e){super(...e),Object.setPrototypeOf(this,B.prototype)}}class E extends m{get info(){return"Passed hex is in incorrect format."}constructor(...e){super(...e),Object.setPrototypeOf(this,E.prototype)}}class I extends m{constructor(...e){super(...e),Object.setPrototypeOf(this,I.prototype)}}const P={[e.UNKNOWN_ERROR]:I,[e.USER_REJECTS_ERROR]:_,[e.BAD_REQUEST_ERROR]:k,[e.UNKNOWN_APP_ERROR]:x,[e.MANIFEST_NOT_FOUND_ERROR]:w,[e.MANIFEST_CONTENT_ERROR]:b},M=new class{parseError(e){let t=I;return e.code in P&&(t=P[e.code]||I),new t(e.message)}};class U{isError(e){return"error"in e}}const T={[n.UNKNOWN_ERROR]:I,[n.USER_REJECTS_ERROR]:_,[n.BAD_REQUEST_ERROR]:k,[n.UNKNOWN_APP_ERROR]:x},O=new class extends U{convertToRpcRequest(e){return{method:"sendTransaction",params:[JSON.stringify(e)]}}parseAndThrowError(e){let t=I;throw e.error.code in T&&(t=T[e.error.code]||I),new t(e.error.message)}convertFromRpcResponse(e){return{boc:e.result}}};class R{constructor(e,t){this.storage=e,this.storeKey="ton-connect-storage_http-bridge-gateway::"+t}storeLastEventId(e){return g(this,void 0,void 0,(function*(){return this.storage.setItem(this.storeKey,e)}))}removeLastEventId(){return g(this,void 0,void 0,(function*(){return this.storage.removeItem(this.storeKey)}))}getLastEventId(){return g(this,void 0,void 0,(function*(){return(yield this.storage.getItem(this.storeKey))||null}))}}function j(e,t){return function(e){return"/"===e.slice(-1)?e.slice(0,-1):e}(e)+"/"+t}function L(e){if(!e)return!1;const t=new URL(e);return"tg:"===t.protocol||"t.me"===t.hostname}function z(e){return e.replaceAll(".","%2E").replaceAll("-","%2D").replaceAll("_","%5F").replaceAll("&","-").replaceAll("=","__").replaceAll("%","--")}class N{constructor(e,t,r,n,i){this.bridgeUrl=t,this.sessionId=r,this.listener=n,this.errorsListener=i,this.ssePath="events",this.postPath="message",this.heartbeatMessage="heartbeat",this.defaultTtl=300,this.isClosed=!1,this.bridgeGatewayStorage=new R(e,t)}registerSession(e){return g(this,void 0,void 0,(function*(){const t=new URL(j(this.bridgeUrl,this.ssePath));t.searchParams.append("client_id",this.sessionId);const r=yield this.bridgeGatewayStorage.getLastEventId();if(!this.isClosed)return r&&t.searchParams.append("last_event_id",r),this.eventSource=new EventSource(t.toString()),new Promise(((t,r)=>{const n=(null==e?void 0:e.openingDeadlineMS)?setTimeout((()=>{var e;(null===(e=this.eventSource)||void 0===e?void 0:e.readyState)!==EventSource.OPEN&&(r(new m("Bridge connection timeout")),this.close())}),e.openingDeadlineMS):void 0;this.eventSource.onerror=()=>r,this.eventSource.onopen=()=>{clearTimeout(n),this.isClosed=!1,this.eventSource.onerror=this.errorsHandler.bind(this),this.eventSource.onmessage=this.messagesHandler.bind(this),t()}}))}))}send(e,t,r,n){return g(this,void 0,void 0,(function*(){const i=new URL(j(this.bridgeUrl,this.postPath));i.searchParams.append("client_id",this.sessionId),i.searchParams.append("to",t),i.searchParams.append("ttl",(n||this.defaultTtl).toString()),i.searchParams.append("topic",r);const o=yield fetch(i,{method:"post",body:d(e)});if(!o.ok)throw new m(`Bridge send failed, status ${o.status}`)}))}pause(){var e;null===(e=this.eventSource)||void 0===e||e.close()}unPause(){return this.registerSession()}close(){var e;this.isClosed=!0,null===(e=this.eventSource)||void 0===e||e.close()}setListener(e){this.listener=e}setErrorsListener(e){this.errorsListener=e}errorsHandler(e){var t,r;if(!this.isClosed){if((null===(t=this.eventSource)||void 0===t?void 0:t.readyState)===EventSource.CLOSED)return this.eventSource.close(),void this.registerSession();if((null===(r=this.eventSource)||void 0===r?void 0:r.readyState)===EventSource.CONNECTING)return void console.debug("[TON_CONNET_SDK_ERROR]: Bridge error",JSON.stringify(e));this.errorsListener(e)}}messagesHandler(e){return g(this,void 0,void 0,(function*(){if(e.data!==this.heartbeatMessage&&(yield this.bridgeGatewayStorage.storeLastEventId(e.lastEventId),!this.isClosed)){let t;try{t=JSON.parse(e.data)}catch(e){throw new m(`Bridge message parse failed, message ${e.data}`)}this.listener(t)}}))}}function D(e){return!("connectEvent"in e)}class ${constructor(e){this.storage=e,this.storeKey="ton-connect-storage_bridge-connection"}storeConnection(e){return g(this,void 0,void 0,(function*(){if("injected"===e.type)return this.storage.setItem(this.storeKey,JSON.stringify(e));if(!D(e)){const t={sessionKeyPair:e.session.sessionCrypto.stringifyKeypair(),walletPublicKey:e.session.walletPublicKey,bridgeUrl:e.session.bridgeUrl},r={type:"http",connectEvent:e.connectEvent,session:t,lastWalletEventId:e.lastWalletEventId,nextRpcRequestId:e.nextRpcRequestId};return this.storage.setItem(this.storeKey,JSON.stringify(r))}const t={type:"http",connectionSource:e.connectionSource,sessionCrypto:e.sessionCrypto.stringifyKeypair()};return this.storage.setItem(this.storeKey,JSON.stringify(t))}))}removeConnection(){return g(this,void 0,void 0,(function*(){return this.storage.removeItem(this.storeKey)}))}getConnection(){return g(this,void 0,void 0,(function*(){const e=yield this.storage.getItem(this.storeKey);if(!e)return null;const t=JSON.parse(e);if("injected"===t.type)return t;if("connectEvent"in t){const e=new p(t.session.sessionKeyPair);return{type:"http",connectEvent:t.connectEvent,lastWalletEventId:t.lastWalletEventId,nextRpcRequestId:t.nextRpcRequestId,session:{sessionCrypto:e,bridgeUrl:t.session.bridgeUrl,walletPublicKey:t.session.walletPublicKey}}}return{type:"http",sessionCrypto:new p(t.sessionCrypto),connectionSource:t.connectionSource}}))}getHttpConnection(){return g(this,void 0,void 0,(function*(){const e=yield this.getConnection();if(!e)throw new m("Trying to read HTTP connection source while nothing is stored");if("injected"===e.type)throw new m("Trying to read HTTP connection source while injected connection is stored");return e}))}getHttpPendingConnection(){return g(this,void 0,void 0,(function*(){const e=yield this.getConnection();if(!e)throw new m("Trying to read HTTP connection source while nothing is stored");if("injected"===e.type)throw new m("Trying to read HTTP connection source while injected connection is stored");if(!D(e))throw new m("Trying to read HTTP-pending connection while http connection is stored");return e}))}getInjectedConnection(){return g(this,void 0,void 0,(function*(){const e=yield this.getConnection();if(!e)throw new m("Trying to read Injected bridge connection source while nothing is stored");if("http"===(null==e?void 0:e.type))throw new m("Trying to read Injected bridge connection source while HTTP connection is stored");return e}))}storedConnectionType(){return g(this,void 0,void 0,(function*(){const e=yield this.storage.getItem(this.storeKey);return e?JSON.parse(e).type:null}))}storeLastWalletEventId(e){return g(this,void 0,void 0,(function*(){const t=yield this.getConnection();if(t&&"http"===t.type&&!D(t))return t.lastWalletEventId=e,this.storeConnection(t)}))}getLastWalletEventId(){return g(this,void 0,void 0,(function*(){const e=yield this.getConnection();if(e&&"lastWalletEventId"in e)return e.lastWalletEventId}))}increaseNextRpcRequestId(){return g(this,void 0,void 0,(function*(){const e=yield this.getConnection();if(e&&"nextRpcRequestId"in e){const t=e.nextRpcRequestId||0;return e.nextRpcRequestId=t+1,this.storeConnection(e)}}))}getNextRpcRequestId(){return g(this,void 0,void 0,(function*(){const e=yield this.getConnection();return e&&"nextRpcRequestId"in e&&e.nextRpcRequestId||0}))}}function F(...e){try{console.debug("[TON_CONNECT_SDK]",...e)}catch(e){}}function K(...e){try{console.error("[TON_CONNECT_SDK]",...e)}catch(e){}}class V{constructor(e,t){this.storage=e,this.walletConnectionSource=t,this.type="http",this.standardUniversalLink="tc://",this.pendingRequests=new Map,this.session=null,this.gateway=null,this.pendingGateways=[],this.listeners=[],this.connectionStorage=new $(e)}static fromStorage(e){return g(this,void 0,void 0,(function*(){const t=new $(e),r=yield t.getHttpConnection();return D(r)?new V(e,r.connectionSource):new V(e,{bridgeUrl:r.session.bridgeUrl})}))}connect(e){this.closeGateways();const t=new p;this.session={sessionCrypto:t,bridgeUrl:"bridgeUrl"in this.walletConnectionSource?this.walletConnectionSource.bridgeUrl:""},this.connectionStorage.storeConnection({type:"http",connectionSource:this.walletConnectionSource,sessionCrypto:t}).then((()=>this.openGateways(t)));const r="universalLink"in this.walletConnectionSource&&this.walletConnectionSource.universalLink?this.walletConnectionSource.universalLink:this.standardUniversalLink;return this.generateUniversalLink(r,e)}restoreConnection(){return g(this,void 0,void 0,(function*(){this.closeGateways();const e=yield this.connectionStorage.getHttpConnection();if(e){if(D(e))return this.session={sessionCrypto:e.sessionCrypto,bridgeUrl:"bridgeUrl"in this.walletConnectionSource?this.walletConnectionSource.bridgeUrl:""},this.openGateways(e.sessionCrypto,{openingDeadlineMS:5e3});if(Array.isArray(this.walletConnectionSource))throw new m("Internal error. Connection source is array while WalletConnectionSourceHTTP was expected.");this.session=e.session,this.gateway=new N(this.storage,this.walletConnectionSource.bridgeUrl,e.session.sessionCrypto.sessionId,this.gatewayListener.bind(this),this.gatewayErrorsListener.bind(this));try{yield this.gateway.registerSession({openingDeadlineMS:5e3})}catch(e){return void(yield this.disconnect())}this.listeners.forEach((t=>t(e.connectEvent)))}}))}sendRequest(e,t){return new Promise(((r,n)=>g(this,void 0,void 0,(function*(){if(!this.gateway||!this.session||!("walletPublicKey"in this.session))throw new m("Trying to send bridge request without session");const i=(yield this.connectionStorage.getNextRpcRequestId()).toString();yield this.connectionStorage.increaseNextRpcRequestId(),F("Send http-bridge request:",Object.assign(Object.assign({},e),{id:i}));const o=this.session.sessionCrypto.encrypt(JSON.stringify(Object.assign(Object.assign({},e),{id:i})),f(this.session.walletPublicKey));try{yield this.gateway.send(o,this.session.walletPublicKey,e.method),null==t||t(),this.pendingRequests.set(i.toString(),r)}catch(e){n(e)}}))))}closeConnection(){this.closeGateways(),this.listeners=[],this.session=null,this.gateway=null}disconnect(){return g(this,void 0,void 0,(function*(){return new Promise((e=>g(this,void 0,void 0,(function*(){let t=!1;const r=()=>{t=!0,this.removeBridgeAndSession().then(e)};try{yield this.sendRequest({method:"disconnect",params:[]},r)}catch(r){console.debug(r),t||this.removeBridgeAndSession().then(e)}}))))}))}listen(e){return this.listeners.push(e),()=>this.listeners=this.listeners.filter((t=>t!==e))}pause(){var e;null===(e=this.gateway)||void 0===e||e.pause(),this.pendingGateways.forEach((e=>e.pause()))}unPause(){return g(this,void 0,void 0,(function*(){const e=this.pendingGateways.map((e=>e.unPause()));this.gateway&&e.push(this.gateway.unPause()),yield Promise.all(e)}))}pendingGatewaysListener(e,t,r){return g(this,void 0,void 0,(function*(){if(this.pendingGateways.includes(e))return this.closeGateways({except:e}),this.session.bridgeUrl=t,this.gateway=e,this.gateway.setErrorsListener(this.gatewayErrorsListener.bind(this)),this.gateway.setListener(this.gatewayListener.bind(this)),this.gatewayListener(r);e.close()}))}gatewayListener(e){return g(this,void 0,void 0,(function*(){const t=JSON.parse(this.session.sessionCrypto.decrypt(u(e.message).toUint8Array(),f(e.from)));if(F("Wallet message received:",t),!("event"in t)){const e=t.id.toString(),r=this.pendingRequests.get(e);return r?(r(t),void this.pendingRequests.delete(e)):void F(`Response id ${e} doesn't match any request's id`)}if(void 0!==t.id){const e=yield this.connectionStorage.getLastWalletEventId();if(void 0!==e&&t.id<=e)return void K(`Received event id (=${t.id}) must be greater than stored last wallet event id (=${e}) `);"connect"!==t.event&&(yield this.connectionStorage.storeLastWalletEventId(t.id))}const r=this.listeners;"connect"===t.event&&(yield this.updateSession(t,e.from)),"disconnect"===t.event&&(yield this.removeBridgeAndSession()),r.forEach((e=>e(t)))}))}gatewayErrorsListener(e){return g(this,void 0,void 0,(function*(){throw new m(`Bridge error ${JSON.stringify(e)}`)}))}updateSession(e,t){return g(this,void 0,void 0,(function*(){this.session=Object.assign(Object.assign({},this.session),{walletPublicKey:t});const r=e.payload.items.find((e=>"ton_addr"===e.name)),n=Object.assign(Object.assign({},e),{payload:Object.assign(Object.assign({},e.payload),{items:[r]})});yield this.connectionStorage.storeConnection({type:"http",session:this.session,lastWalletEventId:e.id,connectEvent:n,nextRpcRequestId:0})}))}removeBridgeAndSession(){return g(this,void 0,void 0,(function*(){this.closeConnection(),yield this.connectionStorage.removeConnection()}))}generateUniversalLink(e,t){return L(e)?this.generateTGUniversalLink(e,t):this.generateRegularUniversalLink(e,t)}generateRegularUniversalLink(e,t){const r=new URL(e);return r.searchParams.append("v",2..toString()),r.searchParams.append("id",this.session.sessionCrypto.sessionId),r.searchParams.append("r",JSON.stringify(t)),r.toString()}generateTGUniversalLink(e,t){const r="tonconnect-"+z(this.generateRegularUniversalLink("about:blank",t).split("?")[1]),n=this.convertToDirectLink(e),i=new URL(n);return i.searchParams.append("startapp",r),i.toString()}convertToDirectLink(e){const t=new URL(e);return t.searchParams.has("attach")&&(t.searchParams.delete("attach"),t.pathname+="/start"),t.toString()}openGateways(e,t){return g(this,void 0,void 0,(function*(){return Array.isArray(this.walletConnectionSource)?(this.pendingGateways=this.walletConnectionSource.map((t=>{const r=new N(this.storage,t.bridgeUrl,e.sessionId,(()=>{}),(e=>{console.error(e)}));return r.setListener((e=>this.pendingGatewaysListener(r,t.bridgeUrl,e))),r})),void(yield Promise.allSettled(this.pendingGateways.map((e=>e.registerSession(t)))))):(this.gateway=new N(this.storage,this.walletConnectionSource.bridgeUrl,e.sessionId,this.gatewayListener.bind(this),this.gatewayErrorsListener.bind(this)),this.gateway.registerSession(t))}))}closeGateways(e){var t;null===(t=this.gateway)||void 0===t||t.close(),this.pendingGateways.filter((t=>t!==(null==e?void 0:e.except))).forEach((e=>e.close())),this.pendingGateways=[]}}function q(e,t){return H(e,[t])}function H(e,t){return!(!e||"object"!=typeof e)&&t.every((t=>t in e))}class Z{constructor(){this.storage={}}static getInstance(){return Z.instance||(Z.instance=new Z),Z.instance}get length(){return Object.keys(this.storage).length}clear(){this.storage={}}getItem(e){var t;return null!==(t=this.storage[e])&&void 0!==t?t:null}key(e){var t;const r=Object.keys(this.storage);return e<0||e>=r.length?null:null!==(t=r[e])&&void 0!==t?t:null}removeItem(e){delete this.storage[e]}setItem(e,t){this.storage[e]=t}}function W(){if("undefined"!=typeof window)return window}function G(){if("undefined"!=typeof document)return document}function Y(){var e;const t=null===(e=W())||void 0===e?void 0:e.location.origin;return t?t+"/tonconnect-manifest.json":""}class Q{constructor(e,t){this.injectedWalletKey=t,this.type="injected",this.unsubscribeCallback=null,this.listenSubscriptions=!1,this.listeners=[];const r=Q.window;if(!Q.isWindowContainsWallet(r,t))throw new A;this.connectionStorage=new $(e),this.injectedWallet=r[t].tonconnect}static fromStorage(e){return g(this,void 0,void 0,(function*(){const t=new $(e),r=yield t.getInjectedConnection();return new Q(e,r.jsBridgeKey)}))}static isWalletInjected(e){return Q.isWindowContainsWallet(this.window,e)}static isInsideWalletBrowser(e){return!!Q.isWindowContainsWallet(this.window,e)&&this.window[e].tonconnect.isWalletBrowser}static getCurrentlyInjectedWallets(){return this.window?function(){const e=W();if(!e)return[];try{return Object.keys(e)}catch(e){return[]}}().filter((([e,t])=>function(e){try{return!(!q(e,"tonconnect")||!q(e.tonconnect,"walletInfo"))&&H(e.tonconnect.walletInfo,["name","app_name","image","about_url","platforms"])}catch(e){return!1}}(t))).map((([e,t])=>({name:t.tonconnect.walletInfo.name,appName:t.tonconnect.walletInfo.app_name,aboutUrl:t.tonconnect.walletInfo.about_url,imageUrl:t.tonconnect.walletInfo.image,tondns:t.tonconnect.walletInfo.tondns,jsBridgeKey:e,injected:!0,embedded:t.tonconnect.isWalletBrowser,platforms:t.tonconnect.walletInfo.platforms}))):[]}static isWindowContainsWallet(e,t){return!!e&&t in e&&"object"==typeof e[t]&&"tonconnect"in e[t]}connect(e){this._connect(2,e)}restoreConnection(){return g(this,void 0,void 0,(function*(){try{F("Injected Provider restoring connection...");const e=yield this.injectedWallet.restoreConnection();F("Injected Provider restoring connection response",e),"connect"===e.event?(this.makeSubscriptions(),this.listeners.forEach((t=>t(e)))):yield this.connectionStorage.removeConnection()}catch(e){yield this.connectionStorage.removeConnection(),console.error(e)}}))}closeConnection(){this.listenSubscriptions&&this.injectedWallet.disconnect(),this.closeAllListeners()}disconnect(){return g(this,void 0,void 0,(function*(){return new Promise((e=>{const t=()=>{this.closeAllListeners(),this.connectionStorage.removeConnection().then(e)};try{this.injectedWallet.disconnect(),t()}catch(e){F(e),this.sendRequest({method:"disconnect",params:[]},t)}}))}))}closeAllListeners(){var e;this.listenSubscriptions=!1,this.listeners=[],null===(e=this.unsubscribeCallback)||void 0===e||e.call(this)}listen(e){return this.listeners.push(e),()=>this.listeners=this.listeners.filter((t=>t!==e))}sendRequest(e,t){return g(this,void 0,void 0,(function*(){const r=(yield this.connectionStorage.getNextRpcRequestId()).toString();yield this.connectionStorage.increaseNextRpcRequestId(),F("Send injected-bridge request:",Object.assign(Object.assign({},e),{id:r}));const n=this.injectedWallet.send(Object.assign(Object.assign({},e),{id:r}));return n.then((e=>F("Wallet message received:",e))),null==t||t(),n}))}_connect(e,t){return g(this,void 0,void 0,(function*(){try{F(`Injected Provider connect request: protocolVersion: ${e}, message:`,t);const r=yield this.injectedWallet.connect(e,t);F("Injected Provider connect response:",r),"connect"===r.event&&(yield this.updateSession(),this.makeSubscriptions()),this.listeners.forEach((e=>e(r)))}catch(e){F(e);const t={event:"connect_error",payload:{code:0,message:null==e?void 0:e.toString()}};this.listeners.forEach((e=>e(t)))}}))}makeSubscriptions(){this.listenSubscriptions=!0,this.unsubscribeCallback=this.injectedWallet.listen((e=>{F("Wallet message received:",e),this.listenSubscriptions&&this.listeners.forEach((t=>t(e))),"disconnect"===e.event&&this.disconnect()}))}updateSession(){return this.connectionStorage.storeConnection({type:"injected",jsBridgeKey:this.injectedWalletKey,nextRpcRequestId:0})}}Q.window=W();class J{constructor(){this.localStorage=function(){if(function(){try{return"undefined"!=typeof localStorage}catch(e){return!1}}())return localStorage;if("undefined"!=typeof process&&null!=process.versions&&null!=process.versions.node)throw new m("`localStorage` is unavailable, but it is required for TonConnect. For more details, see https://github.com/ton-connect/sdk/tree/main/packages/sdk#init-connector");return Z.getInstance()}()}getItem(e){return g(this,void 0,void 0,(function*(){return this.localStorage.getItem(e)}))}removeItem(e){return g(this,void 0,void 0,(function*(){this.localStorage.removeItem(e)}))}setItem(e,t){return g(this,void 0,void 0,(function*(){this.localStorage.setItem(e,t)}))}}function X(e){return function(e){return"jsBridgeKey"in e}(e)&&e.injected}function ee(e){return X(e)&&e.embedded}function te(e){return"bridgeUrl"in e}const re=[{app_name:"telegram-wallet",name:"Wallet",image:"https://wallet.tg/images/logo-288.png",about_url:"https://wallet.tg/",universal_url:"https://t.me/wallet?attach=wallet",bridge:[{type:"sse",url:"https://bridge.tonapi.io/bridge"}],platforms:["ios","android","macos","windows","linux"]},{app_name:"tonkeeper",name:"Tonkeeper",image:"https://tonkeeper.com/assets/tonconnect-icon.png",tondns:"tonkeeper.ton",about_url:"https://tonkeeper.com",universal_url:"https://app.tonkeeper.com/ton-connect",deepLink:"tonkeeper-tc://",bridge:[{type:"sse",url:"https://bridge.tonapi.io/bridge"},{type:"js",key:"tonkeeper"}],platforms:["ios","android","chrome","firefox","macos"]},{app_name:"openmask",name:"OpenMask",image:"https://raw.githubusercontent.com/OpenProduct/openmask-extension/main/public/openmask-logo-288.png",about_url:"https://www.openmask.app/",bridge:[{type:"js",key:"openmask"}],platforms:["chrome"]},{app_name:"mytonwallet",name:"MyTonWallet",image:"https://mytonwallet.io/icon-256.png",about_url:"https://mytonwallet.io",universal_url:"https://connect.mytonwallet.org",bridge:[{type:"js",key:"mytonwallet"},{type:"sse",url:"https://tonconnectbridge.mytonwallet.org/bridge/"}],platforms:["chrome","windows","macos","linux"]},{app_name:"tonhub",name:"Tonhub",image:"https://tonhub.com/tonconnect_logo.png",about_url:"https://tonhub.com",universal_url:"https://tonhub.com/ton-connect",bridge:[{type:"js",key:"tonhub"},{type:"sse",url:"https://connect.tonhubapi.com/tonconnect"}],platforms:["ios","android"]},{app_name:"tonflow",name:"TonFlow",image:"https://tonflow.net/assets/images/tonflow_ico_192.png",about_url:"https://tonflow.net",bridge:[{type:"js",key:"tonflow"}],platforms:["chrome"]},{app_name:"dewallet",name:"DeWallet",image:"https://app.delabwallet.com/logo_black.png",about_url:"https://delabwallet.com",bridge:[{type:"js",key:"dewallet"}],platforms:["chrome"]},{app_name:"xtonwallet",name:"XTONWallet",image:"https://xtonwallet.com/assets/img/icon-256-back.png",about_url:"https://xtonwallet.com",bridge:[{type:"js",key:"xtonwallet"}],platforms:["chrome","firefox"]},{app_name:"tonwallet",name:"TON Wallet",image:"https://wallet.ton.org/assets/ui/qr-logo.png",about_url:"https://chrome.google.com/webstore/detail/ton-wallet/nphplpgoakhhjchkkhmiggakijnkhfnd",bridge:[{type:"js",key:"tonwallet"}],platforms:["chrome"]}];class ne{constructor(e){this.walletsListCache=null,this.walletsListCacheCreationTimestamp=null,this.walletsListSource="https://raw.githubusercontent.com/ton-blockchain/wallets-list/main/wallets-v2.json",(null==e?void 0:e.walletsListSource)&&(this.walletsListSource=e.walletsListSource),(null==e?void 0:e.cacheTTLMs)&&(this.cacheTTLMs=e.cacheTTLMs)}getWallets(){return g(this,void 0,void 0,(function*(){return this.cacheTTLMs&&this.walletsListCacheCreationTimestamp&&Date.now()>this.walletsListCacheCreationTimestamp+this.cacheTTLMs&&(this.walletsListCache=null),this.walletsListCache||(this.walletsListCache=this.fetchWalletsList(),this.walletsListCache.then((()=>{this.walletsListCacheCreationTimestamp=Date.now()})).catch((()=>{this.walletsListCache=null,this.walletsListCacheCreationTimestamp=null}))),this.walletsListCache}))}getEmbeddedWallet(){return g(this,void 0,void 0,(function*(){const e=(yield this.getWallets()).filter(ee);return 1!==e.length?null:e[0]}))}fetchWalletsList(){return g(this,void 0,void 0,(function*(){let e=[];try{const t=yield fetch(this.walletsListSource);if(e=yield t.json(),!Array.isArray(e))throw new S("Wrong wallets list format, wallets list must be an array.");const r=e.filter((e=>!this.isCorrectWalletConfigDTO(e)));r.length&&(K(`Wallet(s) ${r.map((e=>e.name)).join(", ")} config format is wrong. They were removed from the wallets list.`),e=e.filter((e=>this.isCorrectWalletConfigDTO(e))))}catch(t){K(t),e=re}let t=[];try{t=Q.getCurrentlyInjectedWallets()}catch(e){K(e)}return this.mergeWalletsLists(this.walletConfigDTOListToWalletConfigList(e),t)}))}walletConfigDTOListToWalletConfigList(e){return e.map((e=>{const t={name:e.name,appName:e.app_name,imageUrl:e.image,aboutUrl:e.about_url,tondns:e.tondns,platforms:e.platforms};return e.bridge.forEach((r=>{if("sse"===r.type&&(t.bridgeUrl=r.url,t.universalLink=e.universal_url,t.deepLink=e.deepLink),"js"===r.type){const e=r.key;t.jsBridgeKey=e,t.injected=Q.isWalletInjected(e),t.embedded=Q.isInsideWalletBrowser(e)}})),t}))}mergeWalletsLists(e,t){return[...new Set(e.concat(t).map((e=>e.name))).values()].map((r=>{const n=e.find((e=>e.name===r)),i=t.find((e=>e.name===r));return Object.assign(Object.assign({},n&&Object.assign({},n)),i&&Object.assign({},i))}))}isCorrectWalletConfigDTO(e){if(!e||"object"!=typeof e)return!1;if(!("name"in e&&"image"in e&&"about_url"in e&&"platforms"in e&&"app_name"in e))return!1;if(!e.platforms||!Array.isArray(e.platforms)||!e.platforms.length)return!1;if(!("bridge"in e)||!Array.isArray(e.bridge)||!e.bridge.length)return!1;const t=e.bridge;if(t.some((e=>!e||"object"!=typeof e||!("type"in e))))return!1;const r=t.find((e=>"sse"===e.type));if(r&&(!("url"in r)||!r.url||!e.universal_url))return!1;const n=t.find((e=>"js"===e.type));return!!(!n||"key"in n&&n.key)}}class ie extends m{get info(){return"Wallet doesn't support requested feature method."}constructor(...e){super(...e),Object.setPrototypeOf(this,ie.prototype)}}class oe{constructor(e){if(this.walletsList=new ne,this._wallet=null,this.provider=null,this.statusChangeSubscriptions=[],this.statusChangeErrorSubscriptions=[],this.dappSettings={manifestUrl:(null==e?void 0:e.manifestUrl)||Y(),storage:(null==e?void 0:e.storage)||new J},this.walletsList=new ne({walletsListSource:null==e?void 0:e.walletsListSource,cacheTTLMs:null==e?void 0:e.walletsListCacheTTLMs}),!this.dappSettings.manifestUrl)throw new y("Dapp tonconnect-manifest.json must be specified if window.location.origin is undefined. See more https://github.com/ton-connect/docs/blob/main/requests-responses.md#app-manifest");this.bridgeConnectionStorage=new $(this.dappSettings.storage),(null==e?void 0:e.disableAutoPauseConnection)||this.addWindowFocusAndBlurSubscriptions()}static getWallets(){return this.walletsList.getWallets()}get connected(){return null!==this._wallet}get account(){var e;return(null===(e=this._wallet)||void 0===e?void 0:e.account)||null}get wallet(){return this._wallet}set wallet(e){this._wallet=e,this.statusChangeSubscriptions.forEach((e=>e(this._wallet)))}getWallets(){return this.walletsList.getWallets()}onStatusChange(e,t){return this.statusChangeSubscriptions.push(e),t&&this.statusChangeErrorSubscriptions.push(t),()=>{this.statusChangeSubscriptions=this.statusChangeSubscriptions.filter((t=>t!==e)),t&&(this.statusChangeErrorSubscriptions=this.statusChangeErrorSubscriptions.filter((e=>e!==t)))}}connect(e,t){var r;if(this.connected)throw new v;return null===(r=this.provider)||void 0===r||r.closeConnection(),this.provider=this.createProvider(e),this.provider.connect(this.createConnectRequest(t))}restoreConnection(){return g(this,void 0,void 0,(function*(){const[e,t]=yield Promise.all([this.bridgeConnectionStorage.storedConnectionType(),this.walletsList.getEmbeddedWallet()]);try{switch(e){case"http":this.provider=yield V.fromStorage(this.dappSettings.storage);break;case"injected":this.provider=yield Q.fromStorage(this.dappSettings.storage);break;default:if(!t)return;this.provider=yield this.createProvider(t)}}catch(e){return yield this.bridgeConnectionStorage.removeConnection(),void(this.provider=null)}return this.provider.listen(this.walletEventsListener.bind(this)),this.provider.restoreConnection()}))}sendTransaction(e,t){return g(this,void 0,void 0,(function*(){this.checkConnection(),function(e,t){const r=e.includes("SendTransaction"),n=e.find((e=>e&&"object"==typeof e&&"SendTransaction"===e.name));if(!r&&!n)throw new ie("Wallet doesn't support SendTransaction feature.");if(n&&void 0!==n.maxMessages){if(n.maxMessages{e.hidden?this.pauseConnection():this.unPauseConnection()}))}catch(e){console.error("Cannot subscribe to the document.visibilitychange: ",e)}}createProvider(e){let t;return t=!Array.isArray(e)&&"jsBridgeKey"in e?new Q(this.dappSettings.storage,e.jsBridgeKey):new V(this.dappSettings.storage,e),t.listen(this.walletEventsListener.bind(this)),t}walletEventsListener(e){switch(e.event){case"connect":this.onWalletConnected(e.payload);break;case"connect_error":this.onWalletConnectError(e.payload);break;case"disconnect":this.onWalletDisconnected()}}onWalletConnected(e){const t=e.items.find((e=>"ton_addr"===e.name)),r=e.items.find((e=>"ton_proof"===e.name));if(!t)throw new m("ton_addr connection item was not found");const n={device:e.device,provider:this.provider.type,account:{address:t.address,chain:t.network,walletStateInit:t.walletStateInit,publicKey:t.publicKey}};r&&(n.connectItems={tonProof:r}),this.wallet=n}onWalletConnectError(e){const t=M.parseError(e);if(this.statusChangeErrorSubscriptions.forEach((e=>e(t))),console.debug(t),t instanceof w||t instanceof b)throw console.error(t),t}onWalletDisconnected(){this.wallet=null}checkConnection(){if(!this.connected)throw new C}createConnectRequest(e){const t=[{name:"ton_addr"}];return(null==e?void 0:e.tonProof)&&t.push({name:"ton_proof",payload:e.tonProof}),{manifestUrl:this.dappSettings.manifestUrl,items:t}}}function se(e,t=!1){const{wc:r,hex:n}=function(e){if(!e.includes(":"))throw new B(`Wrong address ${e}. Address must include ":".`);const t=e.split(":");if(2!==t.length)throw new B(`Wrong address ${e}. Address must include ":" only once.`);const r=parseInt(t[0]);if(0!==r&&-1!==r)throw new B(`Wrong address ${e}. WC must be eq 0 or -1, but ${r} received.`);const n=t[1];if(64!==(null==n?void 0:n.length))throw new B(`Wrong address ${e}. Hex part must be 64bytes length, but ${null==n?void 0:n.length} received.`);return{wc:r,hex:le(n)}}(e);let i=81;t&&(i|=128);const o=new Int8Array(34);o[0]=i,o[1]=r,o.set(n,2);const s=new Uint8Array(36);return s.set(o),s.set(function(e){let t=0;const r=new Uint8Array(e.length+2);r.set(e);for(let e of r){let r=128;for(;r>0;)t<<=1,e&r&&(t+=1),r>>=1,t>65535&&(t&=65535,t^=4129)}return new Uint8Array([Math.floor(t/256),t%256])}(o),34),d(s).replace(/\+/g,"-").replace(/\//g,"_")}oe.walletsList=new ne,oe.isWalletInjected=e=>Q.isWalletInjected(e),oe.isInsideWalletBrowser=e=>Q.isInsideWalletBrowser(e);const ae={};for(let e=0;e<=255;e++){let t=e.toString(16);t.length<2&&(t="0"+t),ae[t]=e}function le(e){const t=(e=e.toLowerCase()).length;if(t%2!=0)throw new E("Hex string must have length a multiple of 2: "+e);const r=t/2,n=new Uint8Array(r);for(let t=0;tt in e?ve(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Be=(e,t)=>{for(var r in t||(t={}))xe.call(t,r)&&Se(e,r,t[r]);if(ke)for(var r of ke(t))Ae.call(t,r)&&Se(e,r,t[r]);return e},Ee=(e,t)=>Ce(e,_e(t)),Ie=(e,t,r)=>(Se(e,"symbol"!=typeof t?t+"":t,r),r),Pe=(e,t,r)=>new Promise(((n,i)=>{var o=e=>{try{a(r.next(e))}catch(e){i(e)}},s=e=>{try{a(r.throw(e))}catch(e){i(e)}},a=e=>e.done?n(e.value):Promise.resolve(e.value).then(o,s);a((r=r.apply(e,t)).next())}));const Me={},Ue=Symbol("solid-proxy"),Te=Symbol("solid-track"),Oe={equals:(e,t)=>e===t};let Re=ut;const je=1,Le=2,ze={owned:null,cleanups:null,context:null,owner:null},Ne={};var De=null;let $e=null,Fe=null,Ke=null,Ve=null,qe=0;function He(e,t){const r=Fe,n=De,i=0===e.length,o=i?ze:{owned:null,cleanups:null,context:null,owner:void 0===t?n:t},s=i?e:()=>e((()=>Xe((()=>gt(o)))));De=o,Fe=null;try{return dt(s,!0)}finally{Fe=r,De=n}}function Ze(e,t){const r={value:e,observers:null,observerSlots:null,comparator:(t=t?Object.assign({},Oe,t):Oe).equals||void 0};return[ot.bind(r),e=>("function"==typeof e&&(e=e(r.value)),st(r,e))]}function We(e,t,r){at(lt(e,t,!0,je))}function Ge(e,t,r){at(lt(e,t,!1,je))}function Ye(e,t,r){Re=ht;const n=lt(e,t,!1,je);n.user=!0,Ve?Ve.push(n):at(n)}function Qe(e,t,r){r=r?Object.assign({},Oe,r):Oe;const n=lt(e,t,!0,0);return n.observers=null,n.observerSlots=null,n.comparator=r.equals||void 0,at(n),ot.bind(n)}function Je(e){return dt(e,!1)}function Xe(e){if(null===Fe)return e();const t=Fe;Fe=null;try{return e()}finally{Fe=t}}function et(e){return null===De||(null===De.cleanups?De.cleanups=[e]:De.cleanups.push(e)),e}function tt(){return Fe}function rt(e,t){const r=Symbol("context");return{id:r,Provider:vt(r),defaultValue:e}}function nt(e){let t;return void 0!==(t=bt(De,e.id))?t:e.defaultValue}function it(e){const t=Qe(e),r=Qe((()=>wt(t())));return r.toArray=()=>{const e=r();return Array.isArray(e)?e:null!=e?[e]:[]},r}function ot(){const e=$e;if(this.sources&&(this.state||e))if(this.state===je||e)at(this);else{const e=Ke;Ke=null,dt((()=>ft(this)),!1),Ke=e}if(Fe){const e=this.observers?this.observers.length:0;Fe.sources?(Fe.sources.push(this),Fe.sourceSlots.push(e)):(Fe.sources=[this],Fe.sourceSlots=[e]),this.observers?(this.observers.push(Fe),this.observerSlots.push(Fe.sources.length-1)):(this.observers=[Fe],this.observerSlots=[Fe.sources.length-1])}return this.value}function st(e,t,r){let n=e.value;return e.comparator&&e.comparator(n,t)||(e.value=t,e.observers&&e.observers.length&&dt((()=>{for(let t=0;t1e6)throw Ke=[],new Error}),!1)),t}function at(e){if(!e.fn)return;gt(e);const t=De,r=Fe,n=qe;Fe=De=e,function(e,t,r){let n;try{n=e.fn(t)}catch(t){e.pure&&(e.state=je,e.owned&&e.owned.forEach(gt),e.owned=null),yt(t)}(!e.updatedAt||e.updatedAt<=r)&&(null!=e.updatedAt&&"observers"in e?st(e,n):e.value=n,e.updatedAt=r)}(e,e.value,n),Fe=r,De=t}function lt(e,t,r,n=je,i){const o={fn:e,state:n,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:De,context:null,pure:r};return null===De||De!==ze&&(De.owned?De.owned.push(o):De.owned=[o]),o}function ct(e){const t=$e;if(0===e.state||t)return;if(e.state===Le||t)return ft(e);if(e.suspense&&Xe(e.suspense.inFallback))return e.suspense.effects.push(e);const r=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt=0;n--)if((e=r[n]).state===je||t)at(e);else if(e.state===Le||t){const t=Ke;Ke=null,dt((()=>ft(e,r[0])),!1),Ke=t}}function dt(e,t){if(Ke)return e();let r=!1;t||(Ke=[]),Ve?r=!0:Ve=[],qe++;try{const t=e();return function(e){if(Ke&&(ut(Ke),Ke=null),e)return;const t=Ve;Ve=null,t.length&&dt((()=>Re(t)),!1)}(r),t}catch(e){r||(Ve=null),Ke=null,yt(e)}}function ut(e){for(let t=0;tr=Xe((()=>(De.context={[e]:t.value},it((()=>t.children)))))),void 0),r}}const Ct=Symbol("fallback");function _t(e){for(let t=0;te(t||{})))}function xt(){return!0}const At={get:(e,t,r)=>t===Ue?r:e.get(t),has:(e,t)=>t===Ue||e.has(t),set:xt,deleteProperty:xt,getOwnPropertyDescriptor:(e,t)=>({configurable:!0,enumerable:!0,get:()=>e.get(t),set:xt,deleteProperty:xt}),ownKeys:e=>e.keys()};function St(e){return(e="function"==typeof e?e():e)?e:{}}function Bt(...e){let t=!1;for(let r=0;r=0;r--){const n=St(e[r])[t];if(void 0!==n)return n}},has(t){for(let r=e.length-1;r>=0;r--)if(t in St(e[r]))return!0;return!1},keys(){const t=[];for(let r=0;r=0;t--)if(e[t]){const n=Object.getOwnPropertyDescriptors(e[t]);for(const t in n)t in r||Object.defineProperty(r,t,{enumerable:!0,get(){for(let r=e.length-1;r>=0;r--){const n=(e[r]||{})[t];if(void 0!==n)return n}}})}return r}function Et(e,...t){const r=new Set(t.flat());if(Ue in e){const n=t.map((t=>new Proxy({get:r=>t.includes(r)?e[r]:void 0,has:r=>t.includes(r)&&r in e,keys:()=>t.filter((t=>t in e))},At)));return n.push(new Proxy({get:t=>r.has(t)?void 0:e[t],has:t=>!r.has(t)&&t in e,keys:()=>Object.keys(e).filter((e=>!r.has(e)))},At)),n}const n=Object.getOwnPropertyDescriptors(e);return t.push(Object.keys(n).filter((e=>!r.has(e)))),t.map((t=>{const r={};for(let i=0;ie[o],set:()=>!0,enumerable:!0})}return r}))}function It(e){const t="fallback"in e&&{fallback:()=>e.fallback};return Qe(function(e,t,r={}){let n=[],i=[],o=[],s=0,a=t.length>1?[]:null;return et((()=>_t(o))),()=>{let l,c,d=e()||[];return d[Te],Xe((()=>{let e,t,h,f,p,g,m,y,b,w=d.length;if(0===w)0!==s&&(_t(o),o=[],n=[],i=[],s=0,a&&(a=[])),r.fallback&&(n=[Ct],i[0]=He((e=>(o[0]=e,r.fallback()))),s=1);else if(0===s){for(i=new Array(w),c=0;c=g&&y>=g&&n[m]===d[y];m--,y--)h[y]=i[m],f[y]=o[m],a&&(p[y]=a[m]);for(e=new Map,t=new Array(y+1),c=y;c>=g;c--)b=d[c],l=e.get(b),t[c]=void 0===l?-1:l,e.set(b,c);for(l=g;l<=m;l++)b=n[l],c=e.get(b),void 0!==c&&-1!==c?(h[c]=i[l],f[c]=o[l],a&&(p[c]=a[l]),c=t[c],e.set(b,c)):o[l]();for(c=g;ce.each),e.children,t||void 0))}function Pt(e){let t=!1;const r=e.keyed,n=Qe((()=>e.when),void 0,{equals:(e,r)=>t?e===r:!e==!r});return Qe((()=>{const i=n();if(i){const n=e.children,o="function"==typeof n&&n.length>0;return t=r||o,o?Xe((()=>n(i))):n}return e.fallback}),void 0,void 0)}function Mt(e){let t=!1,r=!1;const n=it((()=>e.children)),i=Qe((()=>{let e=n();Array.isArray(e)||(e=[e]);for(let t=0;te[0]===r[0]&&(t?e[1]===r[1]:!e[1]==!r[1])&&e[2]===r[2]});return Qe((()=>{const[n,o,s]=i();if(n<0)return e.fallback;const a=s.children,l="function"==typeof a&&a.length>0;return t=r||l,l?Xe((()=>a(o))):a}),void 0,void 0)}function Ut(e){return e}const Tt=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline","allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected"]),Ot=new Set(["innerHTML","textContent","innerText","children"]),Rt=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),jt=Object.assign(Object.create(null),{class:"className",formnovalidate:"formNoValidate",ismap:"isMap",nomodule:"noModule",playsinline:"playsInline",readonly:"readOnly"}),Lt=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),zt=new Set(["altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","svg","switch","symbol","text","textPath","tref","tspan","use","view","vkern"]),Nt={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"},Dt="_$DX_DELEGATE";function $t(e,t,r){if("undefined"==typeof window)return null;const n=document.createElement("template");n.innerHTML=e;let i=n.content.firstChild;return r&&(i=i.firstChild),i}function Ft(e,t,r){null==r?e.removeAttribute(t):e.setAttribute(t,r)}function Kt(e,t){null==t?e.removeAttribute("class"):e.className=t}function Vt(e,t={},r,n){const i={};return n||Ge((()=>i.children=Yt(e,t.children,i.children))),Ge((()=>t.ref&&t.ref(e))),Ge((()=>function(e,t,r,n,i={},o=!1){t||(t={});for(const n in i)if(!(n in t)){if("children"===n)continue;i[n]=Wt(e,n,null,i[n],r,o)}for(const s in t){if("children"===s){n||Yt(e,t.children);continue}const a=t[s];i[s]=Wt(e,s,a,i[s],r,o)}}(e,t,r,!0,i,!0))),i}function qt(e,t,r){return Xe((()=>e(t,r)))}function Ht(e,t,r,n){if(void 0===r||n||(n=[]),"function"!=typeof t)return Yt(e,t,n,r);Ge((n=>Yt(e,t(),n,r)),n)}function Zt(e,t,r){const n=t.trim().split(/\s+/);for(let t=0,i=n.length;tn.call(e,r[1],t))}else e.addEventListener(t,r)}(e,i,r,o),o&&function(e,t=window.document){const r=t[Dt]||(t[Dt]=new Set);for(let n=0,i=e.length;nt.toUpperCase())))]=r;else{const n=i&&t.indexOf(":")>-1&&Nt[t.split(":")[0]];n?function(e,t,r,n){null==n?e.removeAttributeNS(t,r):e.setAttributeNS(t,r,n)}(e,n,t,r):Ft(e,Rt[t]||t,r)}var c;return r}function Gt(e){const t=`$$${e.type}`;let r=e.composedPath&&e.composedPath()[0]||e.target;for(e.target!==r&&Object.defineProperty(e,"target",{configurable:!0,value:r}),Object.defineProperty(e,"currentTarget",{configurable:!0,get:()=>r||document}),Me.registry&&!Me.done&&(Me.done=!0,document.querySelectorAll("[id^=pl-]").forEach((t=>{for(;t&&8!==t.nodeType&&t.nodeValue!=="pl-"+e;){let e=t.nextSibling;t.remove(),t=e}t&&t.remove()})));r;){const n=r[t];if(n&&!r.disabled){const i=r[`${t}Data`];if(void 0!==i?n.call(r,i,e):n.call(r,e),e.cancelBubble)return}r=r._$host||r.parentNode||r.host}}function Yt(e,t,r,n,i){for(Me.context&&!r&&(r=[...e.childNodes]);"function"==typeof r;)r=r();if(t===r)return r;const o=typeof t,s=void 0!==n;if(e=s&&r[0]&&r[0].parentNode||e,"string"===o||"number"===o){if(Me.context)return r;if("number"===o&&(t=t.toString()),s){let i=r[0];i&&3===i.nodeType?i.data=t:i=document.createTextNode(t),r=Xt(e,r,n,i)}else r=""!==r&&"string"==typeof r?e.firstChild.data=t:e.textContent=t}else if(null==t||"boolean"===o){if(Me.context)return r;r=Xt(e,r,n)}else{if("function"===o)return Ge((()=>{let i=t();for(;"function"==typeof i;)i=i();r=Yt(e,i,r,n)})),()=>r;if(Array.isArray(t)){const o=[],a=r&&Array.isArray(r);if(Qt(o,t,r,i))return Ge((()=>r=Yt(e,o,r,n,!0))),()=>r;if(Me.context){if(!o.length)return r;for(let e=0;en-a){const i=t[s];for(;a=0;o--){const s=t[o];if(i!==s){const t=s.parentNode===e;n||o?t&&s.remove():t?e.replaceChild(i,s):e.insertBefore(i,r)}else n=!0}}else e.insertBefore(i,r);return[i]}const er="http://www.w3.org/2000/svg";function tr(e,t=!1){return t?document.createElementNS(er,e):document.createElement(e)}function rr(e){const{useShadow:t}=e,r=document.createTextNode(""),n=e.mount||document.body;function i(){if(Me.context){const[t,r]=Ze(!1);return queueMicrotask((()=>r(!0))),()=>t()&&e.children}return()=>e.children}if(n instanceof HTMLHeadElement){const[e,t]=Ze(!1),r=()=>t(!0);He((t=>Ht(n,(()=>e()?t():i()()),null))),et((()=>{Me.context?queueMicrotask(r):r()}))}else{const o=tr(e.isSVG?"g":"div",e.isSVG),s=t&&o.attachShadow?o.attachShadow({mode:"open"}):o;Object.defineProperty(o,"_$host",{get:()=>r.parentNode,configurable:!0}),Ht(s,i()),n.appendChild(o),e.ref&&e.ref(o),et((()=>n.removeChild(o)))}return r}function nr(e){const[t,r]=Et(e,["component"]),n=Qe((()=>t.component));return Qe((()=>{const e=n();switch(typeof e){case"function":return Xe((()=>e(r)));case"string":const t=zt.has(e),n=Me.context?function(e){let t,r;return Me.context&&(t=Me.registry.get(r=function(){const e=Me.context;return`${e.id}${e.count++}`}()))?(Me.completed&&Me.completed.add(t),Me.registry.delete(r),t):e.cloneNode(!0)}():tr(e,t);return Vt(n,r,t),n}}))}var ir=(e=>(e.DARK="DARK",e.LIGHT="LIGHT",e))(ir||{});let or={data:""},sr=e=>"object"==typeof window?((e?e.querySelector("#_goober"):window._goober)||Object.assign((e||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:e||or,ar=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,lr=/\/\*[^]*?\*\/| +/g,cr=/\n+/g,dr=(e,t)=>{let r="",n="",i="";for(let o in e){let s=e[o];"@"==o[0]?"i"==o[1]?r=o+" "+s+";":n+="f"==o[1]?dr(s,o):o+"{"+dr(s,"k"==o[1]?"":t)+"}":"object"==typeof s?n+=dr(s,t?t.replace(/([^,])+/g,(e=>o.replace(/(^:.*)|([^,])+/g,(t=>/&/.test(t)?t.replace(/&/g,e):e?e+" "+t:t)))):o):null!=s&&(o=/^--/.test(o)?o:o.replace(/[A-Z]/g,"-$&").toLowerCase(),i+=dr.p?dr.p(o,s):o+":"+s+";")}return r+(t&&i?t+"{"+i+"}":i)+n},ur={},hr=e=>{if("object"==typeof e){let t="";for(let r in e)t+=r+hr(e[r]);return t}return e},fr=(e,t,r,n,i)=>{let o=hr(e),s=ur[o]||(ur[o]=(e=>{let t=0,r=11;for(;t>>0;return"go"+r})(o));if(!ur[s]){let t=o!==e?e:(e=>{let t,r,n=[{}];for(;t=ar.exec(e.replace(lr,""));)t[4]?n.shift():t[3]?(r=t[3].replace(cr," ").trim(),n.unshift(n[0][r]=n[0][r]||{})):n[0][t[1]]=t[2].replace(cr," ").trim();return n[0]})(e);ur[s]=dr(i?{["@keyframes "+s]:t}:t,r?"":"."+s)}let a=r&&ur.g?ur.g:null;return r&&(ur.g=ur[s]),l=ur[s],c=t,d=n,(u=a)?c.data=c.data.replace(u,l):-1===c.data.indexOf(l)&&(c.data=d?l+c.data:c.data+l),s;var l,c,d,u},pr=(e,t,r)=>e.reduce(((e,n,i)=>{let o=t[i];if(o&&o.call){let e=o(r),t=e&&e.props&&e.props.className||/^go/.test(e)&&e;o=t?"."+t:e&&"object"==typeof e?e.props?"":dr(e,""):!1===e?"":e}return e+n+(null==o?"":o)}),"");function gr(e){let t=this||{},r=e.call?e(t.p):e;return fr(r.unshift?r.raw?pr(r,[].slice.call(arguments,1),t.p):r.reduce(((e,r)=>Object.assign(e,r&&r.call?r(t.p):r)),{}):r,sr(t.target),t.g,t.o,t.k)}gr.bind({g:1});let mr=gr.bind({k:1});const yr=rt();function br(e){return kt(yr.Provider,{value:e.theme,get children(){return e.children}})}function wr(){return nt(yr)}function vr(e){let t=this||{};return(...r)=>{const n=n=>{const i=Bt(n,{theme:nt(yr)}),o=Bt(i,{get class(){const e=i.class,n="class"in i&&/^go[0-9]+/.test(e);return[e,gr.apply({target:t.target,o:n,p:i,g:t.g},r)].filter(Boolean).join(" ")}}),[s,a]=Et(o,["as","theme"]),l=a,c=s.as||e;let d;return"function"==typeof c?d=c(l):1==t.g?(d=document.createElement(c),Vt(d,l)):d=nr(Bt({component:c},l)),d};return n.class=e=>Xe((()=>gr.apply({target:t.target,p:e,g:t.g},r))),n}}const Cr=new Proxy(vr,{get:(e,t)=>e(t)});function _r(){const e=vr.call({g:1},"div").apply(null,arguments);return function(t){return e(t),null}}const kr="tc-root",xr="tc-disable-scroll",Ar="tc-using-mouse",Sr=()=>(document.body.addEventListener("mousedown",(()=>document.body.classList.add(Ar))),document.body.addEventListener("keydown",(e=>{"Tab"===e.key&&document.body.classList.remove(Ar)})),kt(_r` ${kr} * { margin: 0; padding: 0; @@ -38,9 +38,9 @@ body.${Ar} ${kr} *:focus { outline: none; } -`,{}));function Br(e,t){return"#"===e[0]&&(e=function(e){"#"===e[0]&&(e=e.slice(1));const t=parseInt(e,16);return[t>>16&255,t>>8&255,255&t].join(",")}(e)),`rgba(${e}, ${t})`}function Er(e){return e.toString()+"px"}const Pr=class{constructor(){Pe(this,"storage",{})}static getInstance(){return Pr.instance||(Pr.instance=new Pr),Pr.instance}get length(){return Object.keys(this.storage).length}clear(){this.storage={}}getItem(e){var t;return null!=(t=this.storage[e])?t:null}key(e){var t;const r=Object.keys(this.storage);return e<0||e>=r.length?null:null!=(t=r[e])?t:null}removeItem(e){delete this.storage[e]}setItem(e,t){this.storage[e]=t}};let Ir=Pr;Pe(Ir,"instance");class Mr extends m{constructor(...e){super(...e),Object.setPrototypeOf(this,Mr.prototype)}}function Ur(e,t="_self"){window.open(e,t,"noopener noreferrer")}function Tr(e){Ur(e,"_blank")}function Or(e,t){const r=setTimeout((()=>{$r("safari")||t()}),200);window.addEventListener("blur",(()=>clearTimeout(r)),{once:!0}),Ur(e,"_self")}function Rr(e){return Ie(this,null,(function*(){yield new Promise((e=>requestAnimationFrame(e))),e()}))}function jr(e){"complete"!==document.readyState?window.addEventListener("load",(()=>Rr((()=>jr(e)))),{once:!0}):e.forEach((e=>{(new window.Image).src=e}))}function Lr(){if("undefined"!=typeof window)return window}function zr(){if(function(){try{return"undefined"!=typeof localStorage}catch(e){return!1}}())return localStorage;if("undefined"!=typeof process&&null!=process.versions&&null!=process.versions.node)throw new Mr("`localStorage` is unavailable, but it is required for TonConnect. For more details, see https://github.com/ton-connect/sdk/tree/main/packages/sdk#init-connector");return Ir.getInstance()}function Nr(){var e,t;const r=(new ye).getResult(),n=null==(e=r.os.name)?void 0:e.toLowerCase();let i;switch(!0){case"ios"===n:i="ios";break;case"android"===n:i="android";break;case"mac os"===n:i="macos";break;case"linux"===n:i="linux";break;case null==n?void 0:n.includes("windows"):i="windows"}const o=null==(t=r.browser.name)?void 0:t.toLowerCase();let s;switch(!0){case"chrome"===o:s="chrome";break;case"firefox"===o:s="firefox";break;case null==o?void 0:o.includes("safari"):s="safari"}return{os:i,browser:s}}function Dr(...e){return e.includes(Nr().os)}function $r(...e){return e.includes(Nr().browser)}class Fr{constructor(){Pe(this,"localStorage"),Pe(this,"storageKey","ton-connect-ui_wallet-info"),this.localStorage=zr()}setWalletInfo(e){this.localStorage.setItem(this.storageKey,JSON.stringify(e))}getWalletInfo(){const e=this.localStorage.getItem(this.storageKey);return e?JSON.parse(e):null}removeWalletInfo(){this.localStorage.removeItem(this.storageKey)}}class Kr{constructor(){Pe(this,"localStorage"),Pe(this,"storageKey","ton-connect-ui_preferred-wallet"),this.localStorage=zr()}setPreferredWalletAppName(e){this.localStorage.setItem(this.storageKey,e)}getPreferredWalletAppName(){return this.localStorage.getItem(this.storageKey)||void 0}}class Vr{constructor(){Pe(this,"localStorage"),Pe(this,"storageKey","ton-connect-ui_last-selected-wallet-info"),this.localStorage=zr()}setLastSelectedWalletInfo(e){this.localStorage.setItem(this.storageKey,JSON.stringify(e))}getLastSelectedWalletInfo(){const e=this.localStorage.getItem(this.storageKey);return e?JSON.parse(e):null}removeLastSelectedWalletInfo(){this.localStorage.removeItem(this.storageKey)}}const[qr,Hr]=Ze({status:"closed",closeReason:null}),Zr=Qe((()=>"opened"===qr().status));let Wr="undefined"!=typeof window?new Vr:void 0;const[Gr,Yr]=Ze((null==Wr?void 0:Wr.getLastSelectedWalletInfo())||null),Qr=e=>{Wr||(Wr=new Vr),e?Wr.setLastSelectedWalletInfo(e):Wr.removeLastSelectedWalletInfo(),Yr(e)},[Jr,Xr]=Ze(null),en={en:tn({common:{close:"Close",openWallet:"Open wallet",copyLink:"Copy Link",linkCopied:"Link Copied",copied:"Copied",yourWallet:"Your Wallet",retry:"Retry",get:"GET",mobile:"Mobile",browserExtension:"Browser Extension",desktop:"Desktop"},button:{connectWallet:"Connect Wallet",dropdown:{copy:"Copy address",copied:"Address copied!",disconnect:"Disconnect"}},notifications:{confirm:{header:"Open {{ name }} to confirm the transaction."},transactionSent:{header:"Transaction sent",text:"Your transaction will be processed in a few seconds."},transactionCanceled:{header:"Transaction canceled",text:"There will be no changes to your account."}},walletItem:{walletOn:"Wallet On",recent:"Recent",installed:"Installed",popular:"Popular"},walletModal:{loading:"Loading wallets",wallets:"Wallets",mobileUniversalModal:{connectYourWallet:"Connect your wallet",openWalletOnTelegramOrSelect:"Open Wallet in Telegram or select your wallet to connect",openWalletOnTelegram:"Open Wallet in Telegram",openLink:"Open Link",scan:"Scan with your mobile wallet"},desktopUniversalModal:{connectYourWallet:"Connect your wallet",scan:"Scan with your mobile wallet",availableWallets:"Available wallets"},mobileConnectionModal:{showQR:"Show QR Code",scanQR:"Scan the QR code below with your phone’s or {{ name }}’s camera",continueIn:"Continue in {{ name }}…",connectionDeclined:"Connection declined"},desktopConnectionModal:{scanQR:"Scan the QR code below with your phone’s or {{ name }}’s camera",continueInExtension:"Continue in {{ name }} browser extension…",dontHaveExtension:"Seems you don't have installed {{ name }} browser extension",getWallet:"Get {{ name }}",continueOnDesktop:"Continue in {{ name }} on desktop…",openWalletOnTelegram:"Open Wallet in Telegram on desktop",connectionDeclined:"Connection declined"},infoModal:{whatIsAWallet:"What is a wallet",secureDigitalAssets:"Secure digital assets storage",walletProtects:"A wallet protects and manages your digital assets including TON, tokens and collectables.",controlIdentity:"Control your Web3 identity",manageIdentity:"Manage your digital identity and access decentralized applications with ease. Maintain control over your data and engage securely in the blockchain ecosystem.",effortlessCryptoTransactions:"Effortless crypto transactions",easilySend:"Easily send, receive, monitor your cryptocurrencies. Streamline your operations with decentralized applications.",getAWallet:"Get a Wallet"}},actionModal:{confirmTransaction:{header:"Confirm the transaction in {{ name }}",text:"It will only take a moment."},transactionSent:"$notifications.transactionSent",transactionCanceled:"$notifications.transactionCanceled"}}),ru:tn({common:{close:"Закрыть",openWallet:"Открыть кошелёк",copyLink:"Копировать ссылку",linkCopied:"Ссылка скопирована",copied:"Ссылка скопирована",yourWallet:"Ваш кошелёк",retry:"Повторить",get:"Скачать",mobile:"Мобильный",browserExtension:"Расширение",desktop:"Десктоп"},button:{connectWallet:"Подключить кошелёк",dropdown:{copy:"Скопировать адрес",copied:"Адрес скопирован!",disconnect:"Отключить кошелёк"}},notifications:{confirm:{header:"Откройте {{ name }}, чтобы подтвердить транзакцию."},transactionSent:{header:"Транзакция отправлена",text:"Ваша транзакция будет обработана через несколько секунд."},transactionCanceled:{header:"Транзакция отменена",text:"Состояние вашего счёта не изменится."}},walletItem:{walletOn:"Wallet в",recent:"Недавний",installed:"Установлен",popular:"Популярен"},walletModal:{loading:"Кошельки загружаются",wallets:"Кошельки",mobileUniversalModal:{connectYourWallet:"Подключите кошелёк",openWalletOnTelegramOrSelect:"Подключите Wallet в Telegram или выберете кошелёк для подключения",openWalletOnTelegram:"Открыть Wallet в Telegram",openLink:"Открыть ссылку",scan:"Отсканируйте камерой вашего телефона"},desktopUniversalModal:{connectYourWallet:"Подключите кошелёк",scan:"Отсканируйте QR-код камерой вашего телефона",availableWallets:"Доступные кошельки"},mobileConnectionModal:{showQR:"Показать QR-код",scanQR:"Отсканируйте QR-код ниже камерой в приложении {{ name }}, или камерой телефона",continueIn:"Продолжите в {{ name }}…",connectionDeclined:"Подключение отклонено"},desktopConnectionModal:{scanQR:"Отсканируйте QR-код ниже камерой в приложении {{ name }}, или камерой телефона",continueInExtension:"Откройте браузерное расширение {{ name }}",dontHaveExtension:"Похоже, у вас не установлено браузерное расширение {{ name }}",getWallet:"Скачать {{ name }}",continueOnDesktop:"Откройте {{ name }} на компьютере…",openWalletOnTelegram:"Открыть Wallet в Telegram",connectionDeclined:"Подключение отклонено"},infoModal:{whatIsAWallet:"Что такое кошелёк?",secureDigitalAssets:"Надежное хранилище цифровых активов",walletProtects:"Кошелёк защищает ваши цифровые активы, включая TON, токены и предметы коллекционирования, и управляет ими.",controlIdentity:"Контроль своей личности Web3",manageIdentity:"Управляйте своей цифровой идентификацией и с легкостью получайте доступ к децентрализованным приложениям. Сохраняйте контроль над своими данными и безопасно участвуйте в экосистеме блокчейна.",effortlessCryptoTransactions:"Простые криптотранзакции",easilySend:"Легко отправляйте, получайте и отслеживайте свои криптовалюты. Оптимизируйте свои операции с помощью децентрализованных приложений.",getAWallet:"Скачать кошелёк"}},actionModal:{confirmTransaction:{header:"Подтвердите действие в {{ name }}",text:"Это займет пару секунд."},transactionSent:"$notifications.transactionSent",transactionCanceled:"$notifications.transactionCanceled"}})};function tn(e){const t=r=>{Object.entries(r).forEach((([n,i])=>{if("object"==typeof i&&i)return t(i);if("string"==typeof i){if("$"===i[0]){const t=i.slice(1).split(".");let o=e;t.forEach((e=>{if(!(e in o))throw new Error(`Cannot parse translations: there is no property ${e} in translation`);o=o[e]})),r[n]=o}"\\$"===i.slice(0,2)&&(r[n]=i.slice(1))}}))};return t(e),e}const rn=rt(),nn=Symbol("store-raw"),on=Symbol("store-node"),sn=Symbol("store-name");function an(e,t){let r=e[Ue];if(!r&&(Object.defineProperty(e,Ue,{value:r=new Proxy(e,pn)}),!Array.isArray(e))){const t=Object.keys(e),n=Object.getOwnPropertyDescriptors(e);for(let i=0,o=t.length;i!0,deleteProperty:()=>!0,ownKeys:function(e){return hn(e),Reflect.ownKeys(e)},getOwnPropertyDescriptor:function(e,t){const r=Reflect.getOwnPropertyDescriptor(e,t);return r&&!r.get&&r.configurable&&t!==Ue&&t!==on&&t!==sn?(delete r.value,delete r.writable,r.get=()=>e[Ue][t],r):r}};function gn(e,t,r,n=!1){if(!n&&e[t]===r)return;const i=e[t],o=e.length;void 0===r?delete e[t]:e[t]=r;let s,a=dn(e);(s=un(a,t,i))&&s.$((()=>r)),Array.isArray(e)&&e.length!==o&&(s=un(a,"length",o))&&s.$(e.length),(s=a._)&&s.$()}function mn(e,t){const r=Object.keys(t);for(let n=0;n1){n=t.shift();const o=typeof n,s=Array.isArray(e);if(Array.isArray(n)){for(let i=0;i1)return void yn(e[n],t,[n].concat(r));i=e[n],r=[n].concat(r)}let o=t[0];"function"==typeof o&&(o=o(i,r),o===i)||void 0===n&&null==o||(o=cn(o),void 0===n||ln(i)&&ln(o)&&!Array.isArray(o)?mn(i,o):gn(e,n,o))}function bn(...[e,t]){const r=cn(e||{}),n=Array.isArray(r);return[an(r),function(...e){Je((()=>{n&&1===e.length?function(e,t){if("function"==typeof t&&(t=t(e)),t=cn(t),Array.isArray(t)){if(e===t)return;let r=0,n=t.length;for(;rt,isMergeableObject:Cn}):t}const[kn,xn]=bn({theme:ir.LIGHT,colors:wn,borderRadius:"m"}),An={[ir.LIGHT]:wn,[ir.DARK]:{constant:{black:"#000000",white:"#FFFFFF"},connectButton:{background:"#0098EA",foreground:"#FFFFFF"},accent:"#E5E5EA",telegramButton:"#31A6F5",icon:{primary:"#E5E5EA",secondary:"#909099",tertiary:"#434347",success:"#29CC6A",error:"#F5A73B"},background:{primary:"#121214",secondary:"#18181A",segment:"#262629",tint:"#222224",qr:"#FFFFFF"},text:{primary:"#E5E5EA",secondary:"#7D7D85"}}},Sn={[ir.LIGHT]:void 0,[ir.DARK]:void 0};function Bn(e,t){t&&(Sn[ir.DARK]=_n(t[ir.DARK],Sn[ir.DARK]),Sn[ir.LIGHT]=_n(t[ir.LIGHT],Sn[ir.LIGHT])),xn({theme:e,colors:_n(Sn[e],An[e])})}const En=Cr.div` +`,{}));function Br(e,t){return"#"===e[0]&&(e=function(e){"#"===e[0]&&(e=e.slice(1));const t=parseInt(e,16);return[t>>16&255,t>>8&255,255&t].join(",")}(e)),`rgba(${e}, ${t})`}function Er(e){return e.toString()+"px"}const Ir=class{constructor(){Ie(this,"storage",{})}static getInstance(){return Ir.instance||(Ir.instance=new Ir),Ir.instance}get length(){return Object.keys(this.storage).length}clear(){this.storage={}}getItem(e){var t;return null!=(t=this.storage[e])?t:null}key(e){var t;const r=Object.keys(this.storage);return e<0||e>=r.length?null:null!=(t=r[e])?t:null}removeItem(e){delete this.storage[e]}setItem(e,t){this.storage[e]=t}};let Pr=Ir;Ie(Pr,"instance");class Mr extends m{constructor(...e){super(...e),Object.setPrototypeOf(this,Mr.prototype)}}function Ur(e,t="_self"){window.open(e,t,"noopener noreferrer")}function Tr(e){Ur(e,"_blank")}function Or(e,t){const r=setTimeout((()=>{$r("safari")||t()}),200);window.addEventListener("blur",(()=>clearTimeout(r)),{once:!0}),Ur(e,"_self")}function Rr(e){return Pe(this,null,(function*(){yield new Promise((e=>requestAnimationFrame(e))),e()}))}function jr(e){"complete"!==document.readyState?window.addEventListener("load",(()=>Rr((()=>jr(e)))),{once:!0}):e.forEach((e=>{(new window.Image).src=e}))}function Lr(){if("undefined"!=typeof window)return window}function zr(){if(function(){try{return"undefined"!=typeof localStorage}catch(e){return!1}}())return localStorage;if("undefined"!=typeof process&&null!=process.versions&&null!=process.versions.node)throw new Mr("`localStorage` is unavailable, but it is required for TonConnect. For more details, see https://github.com/ton-connect/sdk/tree/main/packages/sdk#init-connector");return Pr.getInstance()}function Nr(){var e,t;const r=(new ye).getResult(),n=null==(e=r.os.name)?void 0:e.toLowerCase();let i;switch(!0){case"ios"===n:i="ios";break;case"android"===n:i="android";break;case"mac os"===n:i="macos";break;case"linux"===n:i="linux";break;case null==n?void 0:n.includes("windows"):i="windows"}const o=null==(t=r.browser.name)?void 0:t.toLowerCase();let s;switch(!0){case"chrome"===o:s="chrome";break;case"firefox"===o:s="firefox";break;case null==o?void 0:o.includes("safari"):s="safari"}return{os:i,browser:s}}function Dr(...e){return e.includes(Nr().os)}function $r(...e){return e.includes(Nr().browser)}class Fr{constructor(){Ie(this,"localStorage"),Ie(this,"storageKey","ton-connect-ui_wallet-info"),this.localStorage=zr()}setWalletInfo(e){this.localStorage.setItem(this.storageKey,JSON.stringify(e))}getWalletInfo(){const e=this.localStorage.getItem(this.storageKey);return e?JSON.parse(e):null}removeWalletInfo(){this.localStorage.removeItem(this.storageKey)}}class Kr{constructor(){Ie(this,"localStorage"),Ie(this,"storageKey","ton-connect-ui_preferred-wallet"),this.localStorage=zr()}setPreferredWalletAppName(e){this.localStorage.setItem(this.storageKey,e)}getPreferredWalletAppName(){return this.localStorage.getItem(this.storageKey)||void 0}}class Vr{constructor(){Ie(this,"localStorage"),Ie(this,"storageKey","ton-connect-ui_last-selected-wallet-info"),this.localStorage=zr()}setLastSelectedWalletInfo(e){this.localStorage.setItem(this.storageKey,JSON.stringify(e))}getLastSelectedWalletInfo(){const e=this.localStorage.getItem(this.storageKey);return e?JSON.parse(e):null}removeLastSelectedWalletInfo(){this.localStorage.removeItem(this.storageKey)}}const[qr,Hr]=Ze({status:"closed",closeReason:null}),Zr=Qe((()=>"opened"===qr().status));let Wr="undefined"!=typeof window?new Vr:void 0;const[Gr,Yr]=Ze((null==Wr?void 0:Wr.getLastSelectedWalletInfo())||null),Qr=e=>{Wr||(Wr=new Vr),e?Wr.setLastSelectedWalletInfo(e):Wr.removeLastSelectedWalletInfo(),Yr(e)},[Jr,Xr]=Ze(null),en={en:tn({common:{close:"Close",openWallet:"Open wallet",copyLink:"Copy Link",linkCopied:"Link Copied",copied:"Copied",yourWallet:"Your Wallet",retry:"Retry",get:"GET",mobile:"Mobile",browserExtension:"Browser Extension",desktop:"Desktop"},button:{connectWallet:"Connect Wallet",dropdown:{copy:"Copy address",copied:"Address copied!",disconnect:"Disconnect"}},notifications:{confirm:{header:"Open {{ name }} to confirm the transaction."},transactionSent:{header:"Transaction sent",text:"Your transaction will be processed in a few seconds."},transactionCanceled:{header:"Transaction canceled",text:"There will be no changes to your account."}},walletItem:{walletOn:"Wallet On",recent:"Recent",installed:"Installed",popular:"Popular"},walletModal:{loading:"Loading wallets",wallets:"Wallets",mobileUniversalModal:{connectYourWallet:"Connect your wallet",openWalletOnTelegramOrSelect:"Open Wallet in Telegram or select your wallet to connect",openWalletOnTelegram:"Open Wallet in Telegram",openLink:"Open Link",scan:"Scan with your mobile wallet"},desktopUniversalModal:{connectYourWallet:"Connect your wallet",scan:"Scan with your mobile wallet",availableWallets:"Available wallets"},mobileConnectionModal:{showQR:"Show QR Code",scanQR:"Scan the QR code below with your phone’s or {{ name }}’s camera",continueIn:"Continue in {{ name }}…",connectionDeclined:"Connection declined"},desktopConnectionModal:{scanQR:"Scan the QR code below with your phone’s or {{ name }}’s camera",continueInExtension:"Continue in {{ name }} browser extension…",dontHaveExtension:"Seems you don't have installed {{ name }} browser extension",getWallet:"Get {{ name }}",continueOnDesktop:"Continue in {{ name }} on desktop…",openWalletOnTelegram:"Open Wallet in Telegram on desktop",connectionDeclined:"Connection declined"},infoModal:{whatIsAWallet:"What is a wallet",secureDigitalAssets:"Secure digital assets storage",walletProtects:"A wallet protects and manages your digital assets including TON, tokens and collectables.",controlIdentity:"Control your Web3 identity",manageIdentity:"Manage your digital identity and access decentralized applications with ease. Maintain control over your data and engage securely in the blockchain ecosystem.",effortlessCryptoTransactions:"Effortless crypto transactions",easilySend:"Easily send, receive, monitor your cryptocurrencies. Streamline your operations with decentralized applications.",getAWallet:"Get a Wallet"}},actionModal:{confirmTransaction:{header:"Confirm the transaction in {{ name }}",text:"It will only take a moment."},transactionSent:"$notifications.transactionSent",transactionCanceled:"$notifications.transactionCanceled"}}),ru:tn({common:{close:"Закрыть",openWallet:"Открыть кошелёк",copyLink:"Копировать ссылку",linkCopied:"Ссылка скопирована",copied:"Ссылка скопирована",yourWallet:"Ваш кошелёк",retry:"Повторить",get:"Скачать",mobile:"Мобильный",browserExtension:"Расширение",desktop:"Десктоп"},button:{connectWallet:"Подключить кошелёк",dropdown:{copy:"Скопировать адрес",copied:"Адрес скопирован!",disconnect:"Отключить кошелёк"}},notifications:{confirm:{header:"Откройте {{ name }}, чтобы подтвердить транзакцию."},transactionSent:{header:"Транзакция отправлена",text:"Ваша транзакция будет обработана через несколько секунд."},transactionCanceled:{header:"Транзакция отменена",text:"Состояние вашего счёта не изменится."}},walletItem:{walletOn:"Wallet в",recent:"Недавний",installed:"Установлен",popular:"Популярен"},walletModal:{loading:"Кошельки загружаются",wallets:"Кошельки",mobileUniversalModal:{connectYourWallet:"Подключите кошелёк",openWalletOnTelegramOrSelect:"Подключите Wallet в Telegram или выберете кошелёк для подключения",openWalletOnTelegram:"Открыть Wallet в Telegram",openLink:"Открыть ссылку",scan:"Отсканируйте камерой вашего телефона"},desktopUniversalModal:{connectYourWallet:"Подключите кошелёк",scan:"Отсканируйте QR-код камерой вашего телефона",availableWallets:"Доступные кошельки"},mobileConnectionModal:{showQR:"Показать QR-код",scanQR:"Отсканируйте QR-код ниже камерой в приложении {{ name }}, или камерой телефона",continueIn:"Продолжите в {{ name }}…",connectionDeclined:"Подключение отклонено"},desktopConnectionModal:{scanQR:"Отсканируйте QR-код ниже камерой в приложении {{ name }}, или камерой телефона",continueInExtension:"Откройте браузерное расширение {{ name }}",dontHaveExtension:"Похоже, у вас не установлено браузерное расширение {{ name }}",getWallet:"Скачать {{ name }}",continueOnDesktop:"Откройте {{ name }} на компьютере…",openWalletOnTelegram:"Открыть Wallet в Telegram",connectionDeclined:"Подключение отклонено"},infoModal:{whatIsAWallet:"Что такое кошелёк?",secureDigitalAssets:"Надежное хранилище цифровых активов",walletProtects:"Кошелёк защищает ваши цифровые активы, включая TON, токены и предметы коллекционирования, и управляет ими.",controlIdentity:"Контроль своей личности Web3",manageIdentity:"Управляйте своей цифровой идентификацией и с легкостью получайте доступ к децентрализованным приложениям. Сохраняйте контроль над своими данными и безопасно участвуйте в экосистеме блокчейна.",effortlessCryptoTransactions:"Простые криптотранзакции",easilySend:"Легко отправляйте, получайте и отслеживайте свои криптовалюты. Оптимизируйте свои операции с помощью децентрализованных приложений.",getAWallet:"Скачать кошелёк"}},actionModal:{confirmTransaction:{header:"Подтвердите действие в {{ name }}",text:"Это займет пару секунд."},transactionSent:"$notifications.transactionSent",transactionCanceled:"$notifications.transactionCanceled"}})};function tn(e){const t=r=>{Object.entries(r).forEach((([n,i])=>{if("object"==typeof i&&i)return t(i);if("string"==typeof i){if("$"===i[0]){const t=i.slice(1).split(".");let o=e;t.forEach((e=>{if(!(e in o))throw new Error(`Cannot parse translations: there is no property ${e} in translation`);o=o[e]})),r[n]=o}"\\$"===i.slice(0,2)&&(r[n]=i.slice(1))}}))};return t(e),e}const rn=rt(),nn=Symbol("store-raw"),on=Symbol("store-node"),sn=Symbol("store-name");function an(e,t){let r=e[Ue];if(!r&&(Object.defineProperty(e,Ue,{value:r=new Proxy(e,pn)}),!Array.isArray(e))){const t=Object.keys(e),n=Object.getOwnPropertyDescriptors(e);for(let i=0,o=t.length;i!0,deleteProperty:()=>!0,ownKeys:function(e){return hn(e),Reflect.ownKeys(e)},getOwnPropertyDescriptor:function(e,t){const r=Reflect.getOwnPropertyDescriptor(e,t);return r&&!r.get&&r.configurable&&t!==Ue&&t!==on&&t!==sn?(delete r.value,delete r.writable,r.get=()=>e[Ue][t],r):r}};function gn(e,t,r,n=!1){if(!n&&e[t]===r)return;const i=e[t],o=e.length;void 0===r?delete e[t]:e[t]=r;let s,a=dn(e);(s=un(a,t,i))&&s.$((()=>r)),Array.isArray(e)&&e.length!==o&&(s=un(a,"length",o))&&s.$(e.length),(s=a._)&&s.$()}function mn(e,t){const r=Object.keys(t);for(let n=0;n1){n=t.shift();const o=typeof n,s=Array.isArray(e);if(Array.isArray(n)){for(let i=0;i1)return void yn(e[n],t,[n].concat(r));i=e[n],r=[n].concat(r)}let o=t[0];"function"==typeof o&&(o=o(i,r),o===i)||void 0===n&&null==o||(o=cn(o),void 0===n||ln(i)&&ln(o)&&!Array.isArray(o)?mn(i,o):gn(e,n,o))}function bn(...[e,t]){const r=cn(e||{}),n=Array.isArray(r);return[an(r),function(...e){Je((()=>{n&&1===e.length?function(e,t){if("function"==typeof t&&(t=t(e)),t=cn(t),Array.isArray(t)){if(e===t)return;let r=0,n=t.length;for(;rt,isMergeableObject:Cn}):t}const[kn,xn]=bn({theme:ir.LIGHT,colors:wn,borderRadius:"m"}),An={[ir.LIGHT]:wn,[ir.DARK]:{constant:{black:"#000000",white:"#FFFFFF"},connectButton:{background:"#0098EA",foreground:"#FFFFFF"},accent:"#E5E5EA",telegramButton:"#31A6F5",icon:{primary:"#E5E5EA",secondary:"#909099",tertiary:"#434347",success:"#29CC6A",error:"#F5A73B"},background:{primary:"#121214",secondary:"#18181A",segment:"#262629",tint:"#222224",qr:"#FFFFFF"},text:{primary:"#E5E5EA",secondary:"#7D7D85"}}},Sn={[ir.LIGHT]:void 0,[ir.DARK]:void 0};function Bn(e,t){t&&(Sn[ir.DARK]=_n(t[ir.DARK],Sn[ir.DARK]),Sn[ir.LIGHT]=_n(t[ir.LIGHT],Sn[ir.LIGHT])),xn({theme:e,colors:_n(Sn[e],An[e])})}const En=Cr.div` background-color: ${e=>e.theme.colors.background.secondary}; -`,Pn=e=>{let t;const[r,n]=Ze(null);return Ye((()=>{const t=new window.Image;return t.src=e.src,t.alt=e.alt||"",t.setAttribute("draggable","false"),e.class&&t.classList.add(e.class),t.complete?n(t):(t.addEventListener("load",(()=>n(t))),()=>t.removeEventListener("load",(()=>n(t))))})),[kt(It,{get when(){return r()},get children(){return r()}}),kt(It,{get when(){return!r()},get children(){return kt(En,{get class(){return e.class},ref(e){"function"==typeof t?t(e):t=e}})}})]};let In={};try{In=function(e){let t={};if(!(e=e.replace(/^#/,"")).length)return t;if(e.indexOf("=")<0&&e.indexOf("?")<0)return t._path=Nn(e),t;let r=e.indexOf("?");if(r>=0){let n=e.substr(0,r);t._path=Nn(n),e=e.substr(r+1)}let n=function(e){let t={};if(!e.length)return t;let r,n,i,o,s=e.split("&");for(r=0;ro?1:-1;return 0}(Un,"6.1")>=0?zn("web_app_open_tg_link",{path_full:r}):Tr("https://t.me"+r)}function Ln(){try{const e=Lr();return!!e&&null!=e.parent&&e!==e.parent}catch(e){return!1}}function zn(e,t){try{const r=Lr();if(!r)throw new Mr("Can't post event to parent window: window is not defined");if(void 0!==r.TelegramWebviewProxy)r.TelegramWebviewProxy.postEvent(e,JSON.stringify(t));else if(r.external&&"notify"in r.external)r.external.notify(JSON.stringify({eventType:e,eventData:t}));else{if(!Ln())throw new Mr("Can't post event to TMA");{const n="*",i=JSON.stringify({eventType:e,eventData:t});r.parent.postMessage(i,n)}}}catch(e){!function(...e){try{console.error("[TON_CONNECT_UI]",...e)}catch(e){}}(`Can't post event to parent window: ${e}`)}}function Nn(e){try{return e=e.replace(/\+/g,"%20"),decodeURIComponent(e)}catch(t){return e}}const Dn=440,$n=1020;function Fn(e){const t=Lr();if(!t)return"desktop"===e;if(Tn("weba"))return!0;const r=t.innerWidth;switch(e){case"desktop":return r>$n;case"tablet":return r>Dn;default:return r<=Dn}}function Kn(e){switch(e){case"mobile":return"@media (max-width: 440px)";case"tablet":return"@media (max-width: 1020px) (min-width: 440px)";default:return"@media (min-width: 1020px)"}}const Vn="@media (hover: none)",qn="@media not all and (hover: none)",Hn={m:"100vh",s:"8px",none:"0"},Zn={s:.02,m:.04},Wn=Cr.button` +`,In=e=>{let t;const[r,n]=Ze(null);return Ye((()=>{const t=new window.Image;return t.src=e.src,t.alt=e.alt||"",t.setAttribute("draggable","false"),e.class&&t.classList.add(e.class),t.complete?n(t):(t.addEventListener("load",(()=>n(t))),()=>t.removeEventListener("load",(()=>n(t))))})),[kt(Pt,{get when(){return r()},get children(){return r()}}),kt(Pt,{get when(){return!r()},get children(){return kt(En,{get class(){return e.class},ref(e){"function"==typeof t?t(e):t=e}})}})]};let Pn={};try{Pn=function(e){let t={};if(!(e=e.replace(/^#/,"")).length)return t;if(e.indexOf("=")<0&&e.indexOf("?")<0)return t._path=Nn(e),t;let r=e.indexOf("?");if(r>=0){let n=e.substr(0,r);t._path=Nn(n),e=e.substr(r+1)}let n=function(e){let t={};if(!e.length)return t;let r,n,i,o,s=e.split("&");for(r=0;ro?1:-1;return 0}(Un,"6.1")>=0?zn("web_app_open_tg_link",{path_full:r}):Tr("https://t.me"+r)}function Ln(){try{const e=Lr();return!!e&&null!=e.parent&&e!==e.parent}catch(e){return!1}}function zn(e,t){try{const r=Lr();if(!r)throw new Mr("Can't post event to parent window: window is not defined");if(void 0!==r.TelegramWebviewProxy)r.TelegramWebviewProxy.postEvent(e,JSON.stringify(t));else if(r.external&&"notify"in r.external)r.external.notify(JSON.stringify({eventType:e,eventData:t}));else{if(!Ln())throw new Mr("Can't post event to TMA");{const n="*",i=JSON.stringify({eventType:e,eventData:t});r.parent.postMessage(i,n)}}}catch(e){!function(...e){try{console.error("[TON_CONNECT_UI]",...e)}catch(e){}}(`Can't post event to parent window: ${e}`)}}function Nn(e){try{return e=e.replace(/\+/g,"%20"),decodeURIComponent(e)}catch(t){return e}}const Dn=440,$n=1020;function Fn(e){const t=Lr();if(!t)return"desktop"===e;if(Tn("weba"))return!0;const r=t.innerWidth;switch(e){case"desktop":return r>$n;case"tablet":return r>Dn;default:return r<=Dn}}function Kn(e){switch(e){case"mobile":return"@media (max-width: 440px)";case"tablet":return"@media (max-width: 1020px) (min-width: 440px)";default:return"@media (min-width: 1020px)"}}const Vn="@media (hover: none)",qn="@media not all and (hover: none)",Hn={m:"100vh",s:"8px",none:"0"},Zn={s:.02,m:.04},Wn=Cr.button` display: ${e=>e.leftIcon||e.rightIcon?"flex":"inline-block"}; gap: ${e=>e.leftIcon||e.rightIcon?"6px":"unset"}; align-items: ${e=>e.leftIcon||e.rightIcon?"center":"unset"}; @@ -108,7 +108,7 @@ transform: scale(0.92); } } -`,ci=e=>{const t=Gn(e),r=()=>e.icon||"close";return kt(li,Bt({get class(){return e.class},onClick:()=>e.onClick(),"data-tc-icon-button":"true"},t,{get children(){return[kt(It,{get when(){return!!e.children},get children(){return e.children}}),kt(It,{get when(){return!e.children},get children(){return kt(Mt,{get children(){return[kt(Ut,{get when(){return"close"===r()},get children(){return kt(ai,{get fill(){return e.fill}})}}),kt(Ut,{get when(){return"arrow"===r()},get children(){return kt(oi,{get fill(){return e.fill}})}}),kt(Ut,{get when(){return"question"===r()},get children(){return kt(Ro,{get fill(){return e.fill}})}}),kt(Ut,{get when(){return"string"!=typeof r()},get children(){return r()}})]}})}})]}}))},di={m:"24px",s:"16px",none:"0"},ui=Cr.div` +`,ci=e=>{const t=Gn(e),r=()=>e.icon||"close";return kt(li,Bt({get class(){return e.class},onClick:()=>e.onClick(),"data-tc-icon-button":"true"},t,{get children(){return[kt(Pt,{get when(){return!!e.children},get children(){return e.children}}),kt(Pt,{get when(){return!e.children},get children(){return kt(Mt,{get children(){return[kt(Ut,{get when(){return"close"===r()},get children(){return kt(ai,{get fill(){return e.fill}})}}),kt(Ut,{get when(){return"arrow"===r()},get children(){return kt(oi,{get fill(){return e.fill}})}}),kt(Ut,{get when(){return"question"===r()},get children(){return kt(Ro,{get fill(){return e.fill}})}}),kt(Ut,{get when(){return"string"!=typeof r()},get children(){return r()}})]}})}})]}}))},di={m:"24px",s:"16px",none:"0"},ui=Cr.div` display: flex; position: fixed; z-index: 1000; @@ -160,7 +160,7 @@ ${e=>di[e.theme.borderRadius]}; `,mi=Cr(ci)` background-color: ${e=>Br(e.theme.colors.icon.secondary,.12)}; -`;class yi{constructor(){Pe(this,"currentTime",0)}}const bi=class{constructor(){Pe(this,"currentTime",0),Pe(this,"playbackRate",1),Pe(this,"startTime",null),Pe(this,"timeline",new yi),Pe(this,"finished",Promise.resolve(this)),Pe(this,"effect",null),Pe(this,"id",""),Pe(this,"pending",!1),Pe(this,"playState","finished"),Pe(this,"replaceState","active"),Pe(this,"ready",Promise.resolve(this)),Pe(this,"oncancel",null),Pe(this,"onfinish",null),Pe(this,"onremove",null)}static create(){return bi._instance||(function(...e){try{console.warn("[TON_CONNECT_UI]",...e)}catch(e){}}("Animation is not supported in this environment: please consider using the `web-animations-js` polyfill to provide a fallback implementation of the Web Animations API."),bi._instance=new bi),bi._instance}cancel(){}finish(){}pause(){}play(){}reverse(){}addEventListener(e,t,r){}dispatchEvent(e){return!1}removeEventListener(e,t,r){}updatePlaybackRate(e){}commitStyles(){}persist(){}};let wi=bi;function vi(e,t,r){return"animate"in e?e.animate(t,r):wi.create()}Pe(wi,"_instance",null);const Ci=$t("
"),_i=function(e,t){const r=r=>{var n;return!e.contains(r.target)&&(null==(n=t())?void 0:n())};document.body.addEventListener("click",r),et((()=>document.body.removeEventListener("click",r)))},ki=function(e,t){const r=e=>{var r,n;"Escape"===e.key&&(null==(r=document.activeElement)||r.blur(),null==(n=t())||n())};document.body.addEventListener("keydown",r),et((()=>document.body.removeEventListener("keydown",r)))},xi=function(e,t){const{isEnabled:r,onClose:n}=t();if(!r)return;if("android"!==Nr().os)return;window.history.pushState(ri,"");const i=e=>{e.preventDefault(),n()};window.addEventListener("popstate",i,{once:!0}),et((()=>{window.removeEventListener("popstate",i),Rr((()=>{var e;!0===(null==(e=window.history.state)?void 0:e[ti])&&window.history.back()}))}))},Ai=e=>{const t=wr(),r=Gn(e);return Ye((()=>{e.opened?document.documentElement.scrollHeight!==document.documentElement.clientHeight&&(document.body.style.top=Er(-document.documentElement.scrollTop),document.body.classList.add(xr)):(document.body.classList.remove(xr),document.documentElement.scrollTo({top:-parseFloat(getComputedStyle(document.body).top)}),document.body.style.top="auto")})),kt(Jn,{onBeforeEnter:e=>{const t=Fn("mobile")?200:100;vi(e,[{opacity:0},{opacity:1}],{duration:t}),Fn("mobile")&&vi(e.firstElementChild,[{transform:"translateY(390px)"},{transform:"translateY(0)"}],{duration:t})},onExit:(e,t)=>{const r=Fn("mobile")?200:100,n=vi(e,[{opacity:1},{opacity:0}],{duration:r});if(Fn("mobile")){const i=vi(e.firstElementChild,[{transform:"translateY(0)"},{transform:"translateY(390px)"}],{duration:r});Promise.all([n.finished,i.finished]).then(t)}else n.finished.then(t)},get children(){return kt(It,{get when(){return e.opened},get children(){return kt(ui,Bt({"data-tc-modal":"true"},r,{get children(){const r=Ci.cloneNode(!0);return qt(xi,r,(()=>({isEnabled:e.enableAndroidBackHandler,onClose:()=>e.onClose()}))),qt(ki,r,(()=>()=>e.onClose())),qt(_i,r,(()=>()=>e.onClose())),Ht(r,kt(fi,{get class(){return e.class},get children(){return[kt(pi,{icon:"close",onClick:()=>e.onClose()}),Qe((()=>e.children))]}}),null),Ht(r,kt(It,{get when(){return e.onClickQuestion},get children(){return kt(gi,{get children(){return[kt(To,{}),kt(mi,{get onClick(){return e.onClickQuestion},icon:"question"})]}})}}),null),Ge((()=>Kt(r,we(hi,gr` +`;class yi{constructor(){Ie(this,"currentTime",0)}}const bi=class{constructor(){Ie(this,"currentTime",0),Ie(this,"playbackRate",1),Ie(this,"startTime",null),Ie(this,"timeline",new yi),Ie(this,"finished",Promise.resolve(this)),Ie(this,"effect",null),Ie(this,"id",""),Ie(this,"pending",!1),Ie(this,"playState","finished"),Ie(this,"replaceState","active"),Ie(this,"ready",Promise.resolve(this)),Ie(this,"oncancel",null),Ie(this,"onfinish",null),Ie(this,"onremove",null)}static create(){return bi._instance||(function(...e){try{console.warn("[TON_CONNECT_UI]",...e)}catch(e){}}("Animation is not supported in this environment: please consider using the `web-animations-js` polyfill to provide a fallback implementation of the Web Animations API."),bi._instance=new bi),bi._instance}cancel(){}finish(){}pause(){}play(){}reverse(){}addEventListener(e,t,r){}dispatchEvent(e){return!1}removeEventListener(e,t,r){}updatePlaybackRate(e){}commitStyles(){}persist(){}};let wi=bi;function vi(e,t,r){return"animate"in e?e.animate(t,r):wi.create()}Ie(wi,"_instance",null);const Ci=$t("
"),_i=function(e,t){const r=r=>{var n;return!e.contains(r.target)&&(null==(n=t())?void 0:n())};document.body.addEventListener("click",r),et((()=>document.body.removeEventListener("click",r)))},ki=function(e,t){const r=e=>{var r,n;"Escape"===e.key&&(null==(r=document.activeElement)||r.blur(),null==(n=t())||n())};document.body.addEventListener("keydown",r),et((()=>document.body.removeEventListener("keydown",r)))},xi=function(e,t){const{isEnabled:r,onClose:n}=t();if(!r)return;if("android"!==Nr().os)return;window.history.pushState(ri,"");const i=e=>{e.preventDefault(),n()};window.addEventListener("popstate",i,{once:!0}),et((()=>{window.removeEventListener("popstate",i),Rr((()=>{var e;!0===(null==(e=window.history.state)?void 0:e[ti])&&window.history.back()}))}))},Ai=e=>{const t=wr(),r=Gn(e);return Ye((()=>{e.opened?document.documentElement.scrollHeight!==document.documentElement.clientHeight&&(document.body.style.top=Er(-document.documentElement.scrollTop),document.body.classList.add(xr)):(document.body.classList.remove(xr),document.documentElement.scrollTo({top:-parseFloat(getComputedStyle(document.body).top)}),document.body.style.top="auto")})),kt(Jn,{onBeforeEnter:e=>{const t=Fn("mobile")?200:100;vi(e,[{opacity:0},{opacity:1}],{duration:t}),Fn("mobile")&&vi(e.firstElementChild,[{transform:"translateY(390px)"},{transform:"translateY(0)"}],{duration:t})},onExit:(e,t)=>{const r=Fn("mobile")?200:100,n=vi(e,[{opacity:1},{opacity:0}],{duration:r});if(Fn("mobile")){const i=vi(e.firstElementChild,[{transform:"translateY(0)"},{transform:"translateY(390px)"}],{duration:r});Promise.all([n.finished,i.finished]).then(t)}else n.finished.then(t)},get children(){return kt(Pt,{get when(){return e.opened},get children(){return kt(ui,Bt({"data-tc-modal":"true"},r,{get children(){const r=Ci.cloneNode(!0);return qt(xi,r,(()=>({isEnabled:e.enableAndroidBackHandler,onClose:()=>e.onClose()}))),qt(ki,r,(()=>()=>e.onClose())),qt(_i,r,(()=>()=>e.onClose())),Ht(r,kt(fi,{get class(){return e.class},get children(){return[kt(pi,{icon:"close",onClick:()=>e.onClose()}),Qe((()=>e.children))]}}),null),Ht(r,kt(Pt,{get when(){return e.onClickQuestion},get children(){return kt(gi,{get children(){return[kt(To,{}),kt(mi,{get onClick(){return e.onClickQuestion},icon:"question"})]}})}}),null),Ge((()=>Kt(r,we(hi,gr` border-radius: ${di[t.borderRadius]}; background-color: ${t.colors.background.tint}; @@ -180,7 +180,7 @@ border-radius: ${e=>Si[e.theme.borderRadius]}; background-color: ${e=>e.theme.colors.background.secondary}; -`,Pi=Cr.div` +`,Ii=Cr.div` position: absolute; top: 4px; left: 4px; @@ -194,7 +194,7 @@ transform: ${e=>e.right?"translateX(100%)":"translateX(0)"}; transition: transform 0.13s ease-in-out; -`,Ii=Cr.input` +`,Pi=Cr.input` display: none; `,Mi=Cr.label` padding: 9px 12px; @@ -286,7 +286,7 @@ display: flex; align-items: center; justify-content: center; -`,zi=Cr(Pn)` +`,zi=Cr(In)` width: ${e=>Er(e.size)}; height: ${e=>Er(e.size)}; border-radius: ${e=>Ti[e.theme.borderRadius]}; @@ -306,7 +306,7 @@ filter: drop-shadow(0px 2px 8px rgba(0, 0, 0, 0.08)); background-color: ${e=>e.theme.colors.background.segment}; -`;var Di,$i,Fi={exports:{}};Di=Fi,($i=function(){var e=function(e,t){var r=e,n=s[t],i=null,o=0,l=null,d=[],u={},b=function(e,t){i=function(e){for(var t=new Array(e),r=0;r=7&&k(e),null==l&&(l=S(r,n,d)),A(l,t)},w=function(e,t){for(var r=-1;r<=7;r+=1)if(!(e+r<=-1||o<=e+r))for(var n=-1;n<=7;n+=1)t+n<=-1||o<=t+n||(i[e+r][t+n]=0<=r&&r<=6&&(0==n||6==n)||0<=n&&n<=6&&(0==r||6==r)||2<=r&&r<=4&&2<=n&&n<=4)},C=function(){for(var e=8;e>n&1);i[Math.floor(n/3)][n%3+o-8-3]=s}for(n=0;n<18;n+=1)s=!e&&1==(t>>n&1),i[n%3+o-8-3][Math.floor(n/3)]=s},x=function(e,t){for(var r=n<<3|t,s=a.getBCHTypeInfo(r),l=0;l<15;l+=1){var c=!e&&1==(s>>l&1);l<6?i[l][8]=c:l<8?i[l+1][8]=c:i[o-15+l][8]=c}for(l=0;l<15;l+=1)c=!e&&1==(s>>l&1),l<8?i[8][o-l-1]=c:l<9?i[8][15-l-1+1]=c:i[8][15-l-1]=c;i[o-8][8]=!e},A=function(e,t){for(var r=-1,n=o-1,s=7,l=0,c=a.getMaskFunction(t),d=o-1;d>0;d-=2)for(6==d&&(d-=1);;){for(var u=0;u<2;u+=1)if(null==i[n][d-u]){var h=!1;l>>s&1)),c(n,d-u)&&(h=!h),i[n][d-u]=h,-1==(s-=1)&&(l+=1,s=7)}if((n+=r)<0||o<=n){n-=r,r=-r;break}}},S=function(e,t,r){for(var n=h.getRSBlocks(e,t),i=f(),o=0;o8*l)throw"code length overflow. ("+i.getLengthInBits()+">"+8*l+")";for(i.getLengthInBits()+4<=8*l&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(!1);for(;!(i.getLengthInBits()>=8*l||(i.put(236,8),i.getLengthInBits()>=8*l));)i.put(17,8);return function(e,t){for(var r=0,n=0,i=0,o=new Array(t.length),s=new Array(t.length),l=0;l=0?p.getAt(g):0}}var m=0;for(h=0;hn)&&(e=n,t=r)}return t}())},u.createTableTag=function(e,t){e=e||2;var r="";r+='',r+="";for(var n=0;n";for(var i=0;i';r+=""}return(r+="")+"
"},u.createSvgTag=function(e,t,r,n){var i={};"object"==typeof arguments[0]&&(e=(i=arguments[0]).cellSize,t=i.margin,r=i.alt,n=i.title),e=e||2,t=void 0===t?4*e:t,(r="string"==typeof r?{text:r}:r||{}).text=r.text||null,r.id=r.text?r.id||"qrcode-description":null,(n="string"==typeof n?{text:n}:n||{}).text=n.text||null,n.id=n.text?n.id||"qrcode-title":null;var o,s,a,l,c=u.getModuleCount()*e+2*t,d="";for(l="l"+e+",0 0,"+e+" -"+e+",0 0,-"+e+"z ",d+=''+B(n.text)+"":"",d+=r.text?''+B(r.text)+"":"",d+='',d+='"},u.createDataURL=function(e,t){e=e||2,t=void 0===t?4*e:t;var r=u.getModuleCount()*e+2*t,n=t,i=r-t;return v(r,r,(function(t,r){if(n<=t&&t"};var B=function(e){for(var t="",r=0;r":t+=">";break;case"&":t+="&";break;case'"':t+=""";break;default:t+=n}}return t};return u.createASCII=function(e,t){if((e=e||1)<2)return function(e){e=void 0===e?2:e;var t,r,n,i,o,s=1*u.getModuleCount()+2*e,a=e,l=s-e,c={"██":"█","█ ":"▀"," █":"▄"," ":" "},d={"██":"▀","█ ":"▀"," █":" "," ":" "},h="";for(t=0;t=l?d[o]:c[o];h+="\n"}return s%2&&e>0?h.substring(0,h.length-s-1)+Array(s+1).join("▀"):h.substring(0,h.length-1)}(t);e-=1,t=void 0===t?2*e:t;var r,n,i,o,s=u.getModuleCount()*e+2*t,a=t,l=s-t,c=Array(e+1).join("██"),d=Array(e+1).join(" "),h="",f="";for(r=0;r>>8),t.push(255&s)):t.push(n)}}return t}};var t,r,n,i,o,s={L:1,M:0,Q:3,H:2},a=(t=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],r=1335,n=7973,o=function(e){for(var t=0;0!=e;)t+=1,e>>>=1;return t},(i={}).getBCHTypeInfo=function(e){for(var t=e<<10;o(t)-o(r)>=0;)t^=r<=0;)t^=n<5&&(r+=3+o-5)}for(n=0;n=256;)t-=255;return e[t]}}}();function c(e,t){if(void 0===e.length)throw e.length+"/"+t;var r=function(){for(var r=0;r>>7-t%8&1)},put:function(e,t){for(var n=0;n>>t-n-1&1))},getLengthInBits:function(){return t},putBit:function(r){var n=Math.floor(t/8);e.length<=n&&e.push(0),r&&(e[n]|=128>>>t%8),t+=1}};return r},p=function(e){var t=e,r={getMode:function(){return 1},getLength:function(e){return t.length},write:function(e){for(var r=t,i=0;i+2>>8&255)+(255&i),e.put(i,13),r+=2}if(r>>8)},writeBytes:function(e,r,n){r=r||0,n=n||e.length;for(var i=0;i0&&(t+=","),t+=e[r];return t+"]"}};return t},w=function(e){var t=e,r=0,n=0,i=0,o={read:function(){for(;i<8;){if(r>=t.length){if(0==i)return-1;throw"unexpected end of file./"+i}var e=t.charAt(r);if(r+=1,"="==e)return i=0,-1;e.match(/^\s$/)||(n=n<<6|s(e.charCodeAt(0)),i+=6)}var o=n>>>i-8&255;return i-=8,o}},s=function(e){if(65<=e&&e<=90)return e-65;if(97<=e&&e<=122)return e-97+26;if(48<=e&&e<=57)return e-48+52;if(43==e)return 62;if(47==e)return 63;throw"c:"+e};return o},v=function(e,t,r){for(var n=function(e,t){var r=e,n=t,i=new Array(e*t),o={setPixel:function(e,t,n){i[t*r+e]=n},write:function(e){e.writeString("GIF87a"),e.writeShort(r),e.writeShort(n),e.writeByte(128),e.writeByte(0),e.writeByte(0),e.writeByte(0),e.writeByte(0),e.writeByte(0),e.writeByte(255),e.writeByte(255),e.writeByte(255),e.writeString(","),e.writeShort(0),e.writeShort(0),e.writeShort(r),e.writeShort(n),e.writeByte(0);var t=s(2);e.writeByte(2);for(var i=0;t.length-i>255;)e.writeByte(255),e.writeBytes(t,i,255),i+=255;e.writeByte(t.length-i),e.writeBytes(t,i,t.length-i),e.writeByte(0),e.writeString(";")}},s=function(e){for(var t=1<>>t!=0)throw"length over";for(;c+t>=8;)l.writeByte(255&(e<>>=8-c,d=0,c=0;d|=e<0&&l.writeByte(d)}});h.write(t,n);var f=0,p=String.fromCharCode(i[f]);for(f+=1;f=6;)o(e>>>t-6),t-=6},i.flush=function(){if(t>0&&(o(e<<6-t),e=0,t=0),r%3!=0)for(var i=3-r%3,s=0;s>6,128|63&n):n<55296||n>=57344?t.push(224|n>>12,128|n>>6&63,128|63&n):(r++,n=65536+((1023&n)<<10|1023&e.charCodeAt(r)),t.push(240|n>>18,128|n>>12&63,128|n>>6&63,128|63&n))}return t}(e)},Di.exports=$i;const Ki=Fi.exports;function Vi(e){return Ie(this,null,(function*(){try{if(!(null==navigator?void 0:navigator.clipboard))throw new Mr("Clipboard API not available");return yield navigator.clipboard.writeText(e)}catch(e){}!function(e){const t=document.createElement("textarea");t.value=e,t.style.top="0",t.style.left="0",t.style.position="fixed",document.body.appendChild(t),t.focus(),t.select();try{document.execCommand("copy")}finally{document.body.removeChild(t)}}(e)}))}const qi=$t("
"),Hi=e=>{let t,r,n;const[i,o]=Ze(!1),[s,a]=Ze(48);Ye((()=>{const i=Ki(0,"L");i.addData(e.sourceUrl),i.make(),t.innerHTML=i.createSvgTag(4,0);const o=t.firstElementChild.clientWidth,s=Math.round(256/o*1e5)/1e5;if(n){const e=4*Math.ceil(60/(4*s)),t=Er(4*Math.ceil((o-e)/8));n.style.top=t,n.style.left=t,n.style.height=Er(e),n.style.width=Er(e),a(Math.round(48/s))}r.style.transform=`scale(${s})`}));let l=null;return kt(Ri,{get class(){return e.class},onClick:()=>{o(!0),Vi(e.sourceUrl),null!=l&&clearTimeout(l),l=setTimeout((()=>o(!1)),1500)},get children(){return[kt(ji,{ref(e){"function"==typeof r?r(e):r=e},get children(){return[(()=>{const e=qi.cloneNode(!0);return"function"==typeof t?qt(t,e):t=e,e})(),kt(It,{get when(){return e.imageUrl},get children(){return kt(Li,{ref(e){"function"==typeof n?n(e):n=e},get children(){return kt(zi,{get src(){return e.imageUrl},alt:"",get size(){return s()}})}})}})]}}),kt(Jn,{onBeforeEnter:e=>{vi(e,[{opacity:0,transform:"translate(-50%, 44px)"},{opacity:1,transform:"translate(-50%, 0)"}],{duration:150,easing:"ease-out"})},onExit:(e,t)=>{vi(e,[{opacity:1,transform:"translate(-50%, 0)"},{opacity:0,transform:"translate(-50%, 44px)"}],{duration:150,easing:"ease-out"}).finished.then((()=>{t()}))},get children(){return kt(It,{get when(){return i()&&!e.disableCopy},get children(){return kt(Ni,{get children(){return[kt(ko,{size:"xs"}),kt(Qi,{translationKey:"common.linkCopied",children:"Link Copied"})]}})}})}}),kt(It,{get when(){return!e.disableCopy},get children(){return kt(Oi,{get children(){return kt(os,{})}})}})]}})};var Zi=(e,t,r)=>{const n=t.trim().split(".").reduce(((e,t)=>e?e[t]:void 0),e);return void 0!==n?n:r},Wi=rt({}),Gi=()=>nt(Wi);const Yi=Cr.div` +`;var Di,$i,Fi={exports:{}};Di=Fi,($i=function(){var e=function(e,t){var r=e,n=s[t],i=null,o=0,l=null,d=[],u={},b=function(e,t){i=function(e){for(var t=new Array(e),r=0;r=7&&k(e),null==l&&(l=S(r,n,d)),A(l,t)},w=function(e,t){for(var r=-1;r<=7;r+=1)if(!(e+r<=-1||o<=e+r))for(var n=-1;n<=7;n+=1)t+n<=-1||o<=t+n||(i[e+r][t+n]=0<=r&&r<=6&&(0==n||6==n)||0<=n&&n<=6&&(0==r||6==r)||2<=r&&r<=4&&2<=n&&n<=4)},C=function(){for(var e=8;e>n&1);i[Math.floor(n/3)][n%3+o-8-3]=s}for(n=0;n<18;n+=1)s=!e&&1==(t>>n&1),i[n%3+o-8-3][Math.floor(n/3)]=s},x=function(e,t){for(var r=n<<3|t,s=a.getBCHTypeInfo(r),l=0;l<15;l+=1){var c=!e&&1==(s>>l&1);l<6?i[l][8]=c:l<8?i[l+1][8]=c:i[o-15+l][8]=c}for(l=0;l<15;l+=1)c=!e&&1==(s>>l&1),l<8?i[8][o-l-1]=c:l<9?i[8][15-l-1+1]=c:i[8][15-l-1]=c;i[o-8][8]=!e},A=function(e,t){for(var r=-1,n=o-1,s=7,l=0,c=a.getMaskFunction(t),d=o-1;d>0;d-=2)for(6==d&&(d-=1);;){for(var u=0;u<2;u+=1)if(null==i[n][d-u]){var h=!1;l>>s&1)),c(n,d-u)&&(h=!h),i[n][d-u]=h,-1==(s-=1)&&(l+=1,s=7)}if((n+=r)<0||o<=n){n-=r,r=-r;break}}},S=function(e,t,r){for(var n=h.getRSBlocks(e,t),i=f(),o=0;o8*l)throw"code length overflow. ("+i.getLengthInBits()+">"+8*l+")";for(i.getLengthInBits()+4<=8*l&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(!1);for(;!(i.getLengthInBits()>=8*l||(i.put(236,8),i.getLengthInBits()>=8*l));)i.put(17,8);return function(e,t){for(var r=0,n=0,i=0,o=new Array(t.length),s=new Array(t.length),l=0;l=0?p.getAt(g):0}}var m=0;for(h=0;hn)&&(e=n,t=r)}return t}())},u.createTableTag=function(e,t){e=e||2;var r="";r+='',r+="";for(var n=0;n";for(var i=0;i';r+=""}return(r+="")+"
"},u.createSvgTag=function(e,t,r,n){var i={};"object"==typeof arguments[0]&&(e=(i=arguments[0]).cellSize,t=i.margin,r=i.alt,n=i.title),e=e||2,t=void 0===t?4*e:t,(r="string"==typeof r?{text:r}:r||{}).text=r.text||null,r.id=r.text?r.id||"qrcode-description":null,(n="string"==typeof n?{text:n}:n||{}).text=n.text||null,n.id=n.text?n.id||"qrcode-title":null;var o,s,a,l,c=u.getModuleCount()*e+2*t,d="";for(l="l"+e+",0 0,"+e+" -"+e+",0 0,-"+e+"z ",d+=''+B(n.text)+"":"",d+=r.text?''+B(r.text)+"":"",d+='',d+='"},u.createDataURL=function(e,t){e=e||2,t=void 0===t?4*e:t;var r=u.getModuleCount()*e+2*t,n=t,i=r-t;return v(r,r,(function(t,r){if(n<=t&&t"};var B=function(e){for(var t="",r=0;r":t+=">";break;case"&":t+="&";break;case'"':t+=""";break;default:t+=n}}return t};return u.createASCII=function(e,t){if((e=e||1)<2)return function(e){e=void 0===e?2:e;var t,r,n,i,o,s=1*u.getModuleCount()+2*e,a=e,l=s-e,c={"██":"█","█ ":"▀"," █":"▄"," ":" "},d={"██":"▀","█ ":"▀"," █":" "," ":" "},h="";for(t=0;t=l?d[o]:c[o];h+="\n"}return s%2&&e>0?h.substring(0,h.length-s-1)+Array(s+1).join("▀"):h.substring(0,h.length-1)}(t);e-=1,t=void 0===t?2*e:t;var r,n,i,o,s=u.getModuleCount()*e+2*t,a=t,l=s-t,c=Array(e+1).join("██"),d=Array(e+1).join(" "),h="",f="";for(r=0;r>>8),t.push(255&s)):t.push(n)}}return t}};var t,r,n,i,o,s={L:1,M:0,Q:3,H:2},a=(t=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],r=1335,n=7973,o=function(e){for(var t=0;0!=e;)t+=1,e>>>=1;return t},(i={}).getBCHTypeInfo=function(e){for(var t=e<<10;o(t)-o(r)>=0;)t^=r<=0;)t^=n<5&&(r+=3+o-5)}for(n=0;n=256;)t-=255;return e[t]}}}();function c(e,t){if(void 0===e.length)throw e.length+"/"+t;var r=function(){for(var r=0;r>>7-t%8&1)},put:function(e,t){for(var n=0;n>>t-n-1&1))},getLengthInBits:function(){return t},putBit:function(r){var n=Math.floor(t/8);e.length<=n&&e.push(0),r&&(e[n]|=128>>>t%8),t+=1}};return r},p=function(e){var t=e,r={getMode:function(){return 1},getLength:function(e){return t.length},write:function(e){for(var r=t,i=0;i+2>>8&255)+(255&i),e.put(i,13),r+=2}if(r>>8)},writeBytes:function(e,r,n){r=r||0,n=n||e.length;for(var i=0;i0&&(t+=","),t+=e[r];return t+"]"}};return t},w=function(e){var t=e,r=0,n=0,i=0,o={read:function(){for(;i<8;){if(r>=t.length){if(0==i)return-1;throw"unexpected end of file./"+i}var e=t.charAt(r);if(r+=1,"="==e)return i=0,-1;e.match(/^\s$/)||(n=n<<6|s(e.charCodeAt(0)),i+=6)}var o=n>>>i-8&255;return i-=8,o}},s=function(e){if(65<=e&&e<=90)return e-65;if(97<=e&&e<=122)return e-97+26;if(48<=e&&e<=57)return e-48+52;if(43==e)return 62;if(47==e)return 63;throw"c:"+e};return o},v=function(e,t,r){for(var n=function(e,t){var r=e,n=t,i=new Array(e*t),o={setPixel:function(e,t,n){i[t*r+e]=n},write:function(e){e.writeString("GIF87a"),e.writeShort(r),e.writeShort(n),e.writeByte(128),e.writeByte(0),e.writeByte(0),e.writeByte(0),e.writeByte(0),e.writeByte(0),e.writeByte(255),e.writeByte(255),e.writeByte(255),e.writeString(","),e.writeShort(0),e.writeShort(0),e.writeShort(r),e.writeShort(n),e.writeByte(0);var t=s(2);e.writeByte(2);for(var i=0;t.length-i>255;)e.writeByte(255),e.writeBytes(t,i,255),i+=255;e.writeByte(t.length-i),e.writeBytes(t,i,t.length-i),e.writeByte(0),e.writeString(";")}},s=function(e){for(var t=1<>>t!=0)throw"length over";for(;c+t>=8;)l.writeByte(255&(e<>>=8-c,d=0,c=0;d|=e<0&&l.writeByte(d)}});h.write(t,n);var f=0,p=String.fromCharCode(i[f]);for(f+=1;f=6;)o(e>>>t-6),t-=6},i.flush=function(){if(t>0&&(o(e<<6-t),e=0,t=0),r%3!=0)for(var i=3-r%3,s=0;s>6,128|63&n):n<55296||n>=57344?t.push(224|n>>12,128|n>>6&63,128|63&n):(r++,n=65536+((1023&n)<<10|1023&e.charCodeAt(r)),t.push(240|n>>18,128|n>>12&63,128|n>>6&63,128|63&n))}return t}(e)},Di.exports=$i;const Ki=Fi.exports;function Vi(e){return Pe(this,null,(function*(){try{if(!(null==navigator?void 0:navigator.clipboard))throw new Mr("Clipboard API not available");return yield navigator.clipboard.writeText(e)}catch(e){}!function(e){const t=document.createElement("textarea");t.value=e,t.style.top="0",t.style.left="0",t.style.position="fixed",document.body.appendChild(t),t.focus(),t.select();try{document.execCommand("copy")}finally{document.body.removeChild(t)}}(e)}))}const qi=$t("
"),Hi=e=>{let t,r,n;const[i,o]=Ze(!1),[s,a]=Ze(48);Ye((()=>{const i=Ki(0,"L");i.addData(e.sourceUrl),i.make(),t.innerHTML=i.createSvgTag(4,0);const o=t.firstElementChild.clientWidth,s=Math.round(256/o*1e5)/1e5;if(n){const e=4*Math.ceil(60/(4*s)),t=Er(4*Math.ceil((o-e)/8));n.style.top=t,n.style.left=t,n.style.height=Er(e),n.style.width=Er(e),a(Math.round(48/s))}r.style.transform=`scale(${s})`}));let l=null;return kt(Ri,{get class(){return e.class},onClick:()=>{o(!0),Vi(e.sourceUrl),null!=l&&clearTimeout(l),l=setTimeout((()=>o(!1)),1500)},get children(){return[kt(ji,{ref(e){"function"==typeof r?r(e):r=e},get children(){return[(()=>{const e=qi.cloneNode(!0);return"function"==typeof t?qt(t,e):t=e,e})(),kt(Pt,{get when(){return e.imageUrl},get children(){return kt(Li,{ref(e){"function"==typeof n?n(e):n=e},get children(){return kt(zi,{get src(){return e.imageUrl},alt:"",get size(){return s()}})}})}})]}}),kt(Jn,{onBeforeEnter:e=>{vi(e,[{opacity:0,transform:"translate(-50%, 44px)"},{opacity:1,transform:"translate(-50%, 0)"}],{duration:150,easing:"ease-out"})},onExit:(e,t)=>{vi(e,[{opacity:1,transform:"translate(-50%, 0)"},{opacity:0,transform:"translate(-50%, 44px)"}],{duration:150,easing:"ease-out"}).finished.then((()=>{t()}))},get children(){return kt(Pt,{get when(){return i()&&!e.disableCopy},get children(){return kt(Ni,{get children(){return[kt(ko,{size:"xs"}),kt(Qi,{translationKey:"common.linkCopied",children:"Link Copied"})]}})}})}}),kt(Pt,{get when(){return!e.disableCopy},get children(){return kt(Oi,{get children(){return kt(os,{})}})}})]}})};var Zi=(e,t,r)=>{const n=t.trim().split(".").reduce(((e,t)=>e?e[t]:void 0),e);return void 0!==n?n:r},Wi=rt({}),Gi=()=>nt(Wi);const Yi=Cr.div` font-style: normal; font-weight: ${e=>e.fontWeight}; font-size: ${e=>e.fontSize}; @@ -328,7 +328,7 @@ border-radius: inherit; } -`,Xi=Cr(Pn)` +`,Xi=Cr(In)` width: 100%; height: 100%; border-radius: inherit; @@ -371,7 +371,7 @@ border-radius: ${e=>to[e.theme.borderRadius]}; margin-bottom: 8px; -`,oo=Cr(Pn)` +`,oo=Cr(In)` position: absolute; right: 10px; top: 50px; @@ -440,7 +440,7 @@ margin-bottom: 0; cursor: default; -`,go=e=>{const[t]=Gi();return kt(po,{"data-tc-h3":"true",get class(){return e.class},get children(){var r;return Qe((()=>!!e.translationKey))()?t(e.translationKey,e.translationValues,null==(r=e.children)?void 0:r.toString()):e.children}})},mo=$t(''),yo=e=>{const t=wr(),r=()=>e.fill||t.colors.icon.secondary;return(()=>{const e=mo.cloneNode(!0),t=e.firstChild;return Ge((n=>{const i=r(),o=r();return i!==n._v$&&Ft(e,"fill",n._v$=i),o!==n._v$2&&Ft(t,"fill",n._v$2=o),n}),{_v$:void 0,_v$2:void 0}),e})()},bo=$t(''),wo=e=>{const t=wr();return(()=>{const r=bo.cloneNode(!0),n=r.firstChild;return Ge((()=>Ft(n,"fill",e.fill||t.colors.icon.primary))),r})()},vo=$t(''),Co=$t(''),_o=$t(''),ko=e=>{const t=wr(),r=()=>e.size||"s",n=()=>e.fill||t.colors.icon.success;return Qe((()=>{const i=Qe((()=>"xs"===r()));return()=>i()?(()=>{const r=vo.cloneNode(!0),i=r.firstChild.firstChild,o=i.nextSibling;return Ge((s=>{const a=e.class,l=n(),c=t.colors.constant.white;return a!==s._v$&&Ft(r,"class",s._v$=a),l!==s._v$2&&Ft(i,"fill",s._v$2=l),c!==s._v$3&&Ft(o,"stroke",s._v$3=c),s}),{_v$:void 0,_v$2:void 0,_v$3:void 0}),r})():(()=>{const i=Qe((()=>"s"===r()));return()=>i()?(()=>{const r=Co.cloneNode(!0),i=r.firstChild,o=i.nextSibling;return Ge((s=>{const a=e.class,l=n(),c=t.colors.constant.white;return a!==s._v$4&&Ft(r,"class",s._v$4=a),l!==s._v$5&&Ft(i,"fill",s._v$5=l),c!==s._v$6&&Ft(o,"fill",s._v$6=c),s}),{_v$4:void 0,_v$5:void 0,_v$6:void 0}),r})():(()=>{const r=_o.cloneNode(!0),i=r.firstChild,o=i.nextSibling;return Ge((s=>{const a=e.class,l=n(),c=t.colors.constant.white;return a!==s._v$7&&Ft(r,"class",s._v$7=a),l!==s._v$8&&Ft(i,"fill",s._v$8=l),c!==s._v$9&&Ft(o,"fill",s._v$9=c),s}),{_v$7:void 0,_v$8:void 0,_v$9:void 0}),r})()})()})())},xo=$t(''),Ao=$t(''),So=$t(''),Bo=e=>{const t=wr(),r=()=>e.size||"m",n=()=>e.fill||t.colors.icon.error;return Qe((()=>{const i=Qe((()=>"m"===r()));return()=>i()?(()=>{const r=xo.cloneNode(!0),i=r.firstChild,o=i.nextSibling;return Ge((s=>{const a=e.class,l=n(),c=t.colors.constant.white;return a!==s._v$&&Ft(r,"class",s._v$=a),l!==s._v$2&&Ft(i,"fill",s._v$2=l),c!==s._v$3&&Ft(o,"fill",s._v$3=c),s}),{_v$:void 0,_v$2:void 0,_v$3:void 0}),r})():(()=>{const i=Qe((()=>"s"===r()));return()=>i()?(()=>{const r=Ao.cloneNode(!0),i=r.firstChild,o=i.nextSibling;return Ge((s=>{const a=e.class,l=n(),c=t.colors.constant.white;return a!==s._v$4&&Ft(r,"class",s._v$4=a),l!==s._v$5&&Ft(i,"fill",s._v$5=l),c!==s._v$6&&Ft(o,"stroke",s._v$6=c),s}),{_v$4:void 0,_v$5:void 0,_v$6:void 0}),r})():(()=>{const r=So.cloneNode(!0),i=r.firstChild,o=i.nextSibling;return Ge((s=>{const a=e.class,l=n(),c=t.colors.constant.white;return a!==s._v$7&&Ft(r,"class",s._v$7=a),l!==s._v$8&&Ft(i,"fill",s._v$8=l),c!==s._v$9&&Ft(o,"fill",s._v$9=c),s}),{_v$7:void 0,_v$8:void 0,_v$9:void 0}),r})()})()})())},Eo=$t(''),Po=$t(''),Io=$t(''),Mo=e=>{const t=wr(),r=()=>e.size||"xs",n=()=>e.fill||t.colors.icon.tertiary,i=gr` +`,go=e=>{const[t]=Gi();return kt(po,{"data-tc-h3":"true",get class(){return e.class},get children(){var r;return Qe((()=>!!e.translationKey))()?t(e.translationKey,e.translationValues,null==(r=e.children)?void 0:r.toString()):e.children}})},mo=$t(''),yo=e=>{const t=wr(),r=()=>e.fill||t.colors.icon.secondary;return(()=>{const e=mo.cloneNode(!0),t=e.firstChild;return Ge((n=>{const i=r(),o=r();return i!==n._v$&&Ft(e,"fill",n._v$=i),o!==n._v$2&&Ft(t,"fill",n._v$2=o),n}),{_v$:void 0,_v$2:void 0}),e})()},bo=$t(''),wo=e=>{const t=wr();return(()=>{const r=bo.cloneNode(!0),n=r.firstChild;return Ge((()=>Ft(n,"fill",e.fill||t.colors.icon.primary))),r})()},vo=$t(''),Co=$t(''),_o=$t(''),ko=e=>{const t=wr(),r=()=>e.size||"s",n=()=>e.fill||t.colors.icon.success;return Qe((()=>{const i=Qe((()=>"xs"===r()));return()=>i()?(()=>{const r=vo.cloneNode(!0),i=r.firstChild.firstChild,o=i.nextSibling;return Ge((s=>{const a=e.class,l=n(),c=t.colors.constant.white;return a!==s._v$&&Ft(r,"class",s._v$=a),l!==s._v$2&&Ft(i,"fill",s._v$2=l),c!==s._v$3&&Ft(o,"stroke",s._v$3=c),s}),{_v$:void 0,_v$2:void 0,_v$3:void 0}),r})():(()=>{const i=Qe((()=>"s"===r()));return()=>i()?(()=>{const r=Co.cloneNode(!0),i=r.firstChild,o=i.nextSibling;return Ge((s=>{const a=e.class,l=n(),c=t.colors.constant.white;return a!==s._v$4&&Ft(r,"class",s._v$4=a),l!==s._v$5&&Ft(i,"fill",s._v$5=l),c!==s._v$6&&Ft(o,"fill",s._v$6=c),s}),{_v$4:void 0,_v$5:void 0,_v$6:void 0}),r})():(()=>{const r=_o.cloneNode(!0),i=r.firstChild,o=i.nextSibling;return Ge((s=>{const a=e.class,l=n(),c=t.colors.constant.white;return a!==s._v$7&&Ft(r,"class",s._v$7=a),l!==s._v$8&&Ft(i,"fill",s._v$8=l),c!==s._v$9&&Ft(o,"fill",s._v$9=c),s}),{_v$7:void 0,_v$8:void 0,_v$9:void 0}),r})()})()})())},xo=$t(''),Ao=$t(''),So=$t(''),Bo=e=>{const t=wr(),r=()=>e.size||"m",n=()=>e.fill||t.colors.icon.error;return Qe((()=>{const i=Qe((()=>"m"===r()));return()=>i()?(()=>{const r=xo.cloneNode(!0),i=r.firstChild,o=i.nextSibling;return Ge((s=>{const a=e.class,l=n(),c=t.colors.constant.white;return a!==s._v$&&Ft(r,"class",s._v$=a),l!==s._v$2&&Ft(i,"fill",s._v$2=l),c!==s._v$3&&Ft(o,"fill",s._v$3=c),s}),{_v$:void 0,_v$2:void 0,_v$3:void 0}),r})():(()=>{const i=Qe((()=>"s"===r()));return()=>i()?(()=>{const r=Ao.cloneNode(!0),i=r.firstChild,o=i.nextSibling;return Ge((s=>{const a=e.class,l=n(),c=t.colors.constant.white;return a!==s._v$4&&Ft(r,"class",s._v$4=a),l!==s._v$5&&Ft(i,"fill",s._v$5=l),c!==s._v$6&&Ft(o,"stroke",s._v$6=c),s}),{_v$4:void 0,_v$5:void 0,_v$6:void 0}),r})():(()=>{const r=So.cloneNode(!0),i=r.firstChild,o=i.nextSibling;return Ge((s=>{const a=e.class,l=n(),c=t.colors.constant.white;return a!==s._v$7&&Ft(r,"class",s._v$7=a),l!==s._v$8&&Ft(i,"fill",s._v$8=l),c!==s._v$9&&Ft(o,"fill",s._v$9=c),s}),{_v$7:void 0,_v$8:void 0,_v$9:void 0}),r})()})()})())},Eo=$t(''),Io=$t(''),Po=$t(''),Mo=e=>{const t=wr(),r=()=>e.size||"xs",n=()=>e.fill||t.colors.icon.tertiary,i=gr` animation: ${mr` 0% { transform: rotate(0deg); @@ -449,7 +449,7 @@ transform: rotate(360deg); } `} 1s linear infinite; - `;return Qe((()=>{const t=Qe((()=>"xs"===r()));return()=>t()?(()=>{const t=Eo.cloneNode(!0),r=t.firstChild;return Ge((o=>{const s=we(i,e.class),a=n();return s!==o._v$&&Ft(t,"class",o._v$=s),a!==o._v$2&&Ft(r,"fill",o._v$2=a),o}),{_v$:void 0,_v$2:void 0}),t})():(()=>{const t=Qe((()=>"s"===r()));return()=>t()?(()=>{const t=Po.cloneNode(!0),r=t.firstChild;return Ge((o=>{const s=we(i,e.class),a=n();return s!==o._v$3&&Ft(t,"class",o._v$3=s),a!==o._v$4&&Ft(r,"fill",o._v$4=a),o}),{_v$3:void 0,_v$4:void 0}),t})():(()=>{const t=Io.cloneNode(!0),r=t.firstChild;return Ge((o=>{const s=we(i,e.class),a=n();return s!==o._v$5&&Ft(t,"class",o._v$5=s),a!==o._v$6&&Ft(r,"stroke",o._v$6=a),o}),{_v$5:void 0,_v$6:void 0}),t})()})()})())},Uo=$t(''),To=()=>{const e=wr();return(()=>{const t=Uo.cloneNode(!0),r=t.firstChild.nextSibling.nextSibling;return Ge((()=>Ft(r,"fill",e.theme===ir.DARK?e.colors.constant.white:e.colors.constant.black))),t})()},Oo=$t(''),Ro=e=>{const t=wr();return(()=>{const r=Oo.cloneNode(!0),n=r.firstChild;return Ge((()=>Ft(n,"fill",e.fill||t.colors.icon.secondary))),r})()},jo=$t(''),Lo=e=>{const t=wr();return(()=>{const r=jo.cloneNode(!0),n=r.firstChild;return Ge((()=>Ft(n,"fill",e.fill||t.colors.icon.primary))),r})()},zo=$t(''),No=e=>{const t=wr();return(()=>{const r=zo.cloneNode(!0),n=r.firstChild;return Ge((()=>Ft(n,"fill",e.fill||t.colors.icon.primary))),r})()},Do=$t(''),$o=e=>{const t=wr();return(()=>{const r=Do.cloneNode(!0),n=r.firstChild;return Ge((()=>Ft(n,"fill",e.fill||t.colors.icon.primary))),r})()},Fo=$t(''),Ko=e=>{const t=wr();return(()=>{const r=Fo.cloneNode(!0),n=r.firstChild.firstChild;return Ge((()=>Ft(n,"fill",e.fill||t.colors.accent))),r})()},Vo=$t(''),qo=e=>{const t=wr();return(()=>{const r=Vo.cloneNode(!0),n=r.firstChild;return Ge((()=>Ft(n,"fill",e.fill||t.colors.accent))),r})()},Ho=$t(''),Zo=e=>{const t=wr();return(()=>{const r=Ho.cloneNode(!0),n=r.firstChild.firstChild;return Ge((()=>Ft(n,"fill",e.fill||t.colors.accent))),r})()},Wo=$t(''),Go=e=>{const t=wr();return(()=>{const r=Wo.cloneNode(!0),n=r.firstChild;return Ge((i=>{const o=e.class,s=e.fill||t.colors.icon.secondary;return o!==i._v$&&Ft(r,"class",i._v$=o),s!==i._v$2&&Ft(n,"fill",i._v$2=s),i}),{_v$:void 0,_v$2:void 0}),r})()},Yo=$t(''),Qo=e=>{const t=wr();return(()=>{const r=Yo.cloneNode(!0),n=r.firstChild;return Ge((i=>{const o=e.class,s=e.fill||t.colors.icon.secondary;return o!==i._v$&&Ft(r,"class",i._v$=o),s!==i._v$2&&Ft(n,"fill",i._v$2=s),i}),{_v$:void 0,_v$2:void 0}),r})()},Jo=$t(''),Xo=e=>{const t=wr();return(()=>{const r=Jo.cloneNode(!0),n=r.firstChild;return Ge((i=>{const o=e.class,s=e.fill||t.colors.icon.secondary;return o!==i._v$&&Ft(r,"class",i._v$=o),s!==i._v$2&&Ft(n,"fill",i._v$2=s),i}),{_v$:void 0,_v$2:void 0}),r})()},es=$t(''),ts=e=>{const t=wr();return(()=>{const r=es.cloneNode(!0),n=r.firstChild;return Ge((i=>{const o=e.class,s=e.fill||t.colors.constant.white;return o!==i._v$&&Ft(r,"class",i._v$=o),s!==i._v$2&&Ft(n,"fill",i._v$2=s),i}),{_v$:void 0,_v$2:void 0}),r})()},rs=$t(''),ns=e=>{const t=wr();return(()=>{const r=rs.cloneNode(!0),n=r.firstChild;return Ge((i=>{const o=e.class,s=e.fill||t.colors.icon.secondary;return o!==i._v$&&Ft(r,"class",i._v$=o),s!==i._v$2&&Ft(n,"fill",i._v$2=s),i}),{_v$:void 0,_v$2:void 0}),r})()},is=$t(''),os=e=>{const t=wr(),r=()=>e.fill||t.colors.icon.secondary;return(()=>{const e=is.cloneNode(!0),t=e.firstChild;return Ge((n=>{const i=r(),o=r();return i!==n._v$&&Ft(e,"fill",n._v$=i),o!==n._v$2&&Ft(t,"fill",n._v$2=o),n}),{_v$:void 0,_v$2:void 0}),e})()},ss=$t(''),as=e=>{const t=wr();return(()=>{const r=ss.cloneNode(!0),n=r.firstChild;return Ge((()=>Ft(n,"fill",e.fill||t.colors.icon.secondary))),r})()},ls={m:"16px",s:"12px",none:"0"},cs={m:"6px",s:"6px",none:"0"},ds=Cr.div` + `;return Qe((()=>{const t=Qe((()=>"xs"===r()));return()=>t()?(()=>{const t=Eo.cloneNode(!0),r=t.firstChild;return Ge((o=>{const s=we(i,e.class),a=n();return s!==o._v$&&Ft(t,"class",o._v$=s),a!==o._v$2&&Ft(r,"fill",o._v$2=a),o}),{_v$:void 0,_v$2:void 0}),t})():(()=>{const t=Qe((()=>"s"===r()));return()=>t()?(()=>{const t=Io.cloneNode(!0),r=t.firstChild;return Ge((o=>{const s=we(i,e.class),a=n();return s!==o._v$3&&Ft(t,"class",o._v$3=s),a!==o._v$4&&Ft(r,"fill",o._v$4=a),o}),{_v$3:void 0,_v$4:void 0}),t})():(()=>{const t=Po.cloneNode(!0),r=t.firstChild;return Ge((o=>{const s=we(i,e.class),a=n();return s!==o._v$5&&Ft(t,"class",o._v$5=s),a!==o._v$6&&Ft(r,"stroke",o._v$6=a),o}),{_v$5:void 0,_v$6:void 0}),t})()})()})())},Uo=$t(''),To=()=>{const e=wr();return(()=>{const t=Uo.cloneNode(!0),r=t.firstChild.nextSibling.nextSibling;return Ge((()=>Ft(r,"fill",e.theme===ir.DARK?e.colors.constant.white:e.colors.constant.black))),t})()},Oo=$t(''),Ro=e=>{const t=wr();return(()=>{const r=Oo.cloneNode(!0),n=r.firstChild;return Ge((()=>Ft(n,"fill",e.fill||t.colors.icon.secondary))),r})()},jo=$t(''),Lo=e=>{const t=wr();return(()=>{const r=jo.cloneNode(!0),n=r.firstChild;return Ge((()=>Ft(n,"fill",e.fill||t.colors.icon.primary))),r})()},zo=$t(''),No=e=>{const t=wr();return(()=>{const r=zo.cloneNode(!0),n=r.firstChild;return Ge((()=>Ft(n,"fill",e.fill||t.colors.icon.primary))),r})()},Do=$t(''),$o=e=>{const t=wr();return(()=>{const r=Do.cloneNode(!0),n=r.firstChild;return Ge((()=>Ft(n,"fill",e.fill||t.colors.icon.primary))),r})()},Fo=$t(''),Ko=e=>{const t=wr();return(()=>{const r=Fo.cloneNode(!0),n=r.firstChild.firstChild;return Ge((()=>Ft(n,"fill",e.fill||t.colors.accent))),r})()},Vo=$t(''),qo=e=>{const t=wr();return(()=>{const r=Vo.cloneNode(!0),n=r.firstChild;return Ge((()=>Ft(n,"fill",e.fill||t.colors.accent))),r})()},Ho=$t(''),Zo=e=>{const t=wr();return(()=>{const r=Ho.cloneNode(!0),n=r.firstChild.firstChild;return Ge((()=>Ft(n,"fill",e.fill||t.colors.accent))),r})()},Wo=$t(''),Go=e=>{const t=wr();return(()=>{const r=Wo.cloneNode(!0),n=r.firstChild;return Ge((i=>{const o=e.class,s=e.fill||t.colors.icon.secondary;return o!==i._v$&&Ft(r,"class",i._v$=o),s!==i._v$2&&Ft(n,"fill",i._v$2=s),i}),{_v$:void 0,_v$2:void 0}),r})()},Yo=$t(''),Qo=e=>{const t=wr();return(()=>{const r=Yo.cloneNode(!0),n=r.firstChild;return Ge((i=>{const o=e.class,s=e.fill||t.colors.icon.secondary;return o!==i._v$&&Ft(r,"class",i._v$=o),s!==i._v$2&&Ft(n,"fill",i._v$2=s),i}),{_v$:void 0,_v$2:void 0}),r})()},Jo=$t(''),Xo=e=>{const t=wr();return(()=>{const r=Jo.cloneNode(!0),n=r.firstChild;return Ge((i=>{const o=e.class,s=e.fill||t.colors.icon.secondary;return o!==i._v$&&Ft(r,"class",i._v$=o),s!==i._v$2&&Ft(n,"fill",i._v$2=s),i}),{_v$:void 0,_v$2:void 0}),r})()},es=$t(''),ts=e=>{const t=wr();return(()=>{const r=es.cloneNode(!0),n=r.firstChild;return Ge((i=>{const o=e.class,s=e.fill||t.colors.constant.white;return o!==i._v$&&Ft(r,"class",i._v$=o),s!==i._v$2&&Ft(n,"fill",i._v$2=s),i}),{_v$:void 0,_v$2:void 0}),r})()},rs=$t(''),ns=e=>{const t=wr();return(()=>{const r=rs.cloneNode(!0),n=r.firstChild;return Ge((i=>{const o=e.class,s=e.fill||t.colors.icon.secondary;return o!==i._v$&&Ft(r,"class",i._v$=o),s!==i._v$2&&Ft(n,"fill",i._v$2=s),i}),{_v$:void 0,_v$2:void 0}),r})()},is=$t(''),os=e=>{const t=wr(),r=()=>e.fill||t.colors.icon.secondary;return(()=>{const e=is.cloneNode(!0),t=e.firstChild;return Ge((n=>{const i=r(),o=r();return i!==n._v$&&Ft(e,"fill",n._v$=i),o!==n._v$2&&Ft(t,"fill",n._v$2=o),n}),{_v$:void 0,_v$2:void 0}),e})()},ss=$t(''),as=e=>{const t=wr();return(()=>{const r=ss.cloneNode(!0),n=r.firstChild;return Ge((()=>Ft(n,"fill",e.fill||t.colors.icon.secondary))),r})()},ls={m:"16px",s:"12px",none:"0"},cs={m:"6px",s:"6px",none:"0"},ds=Cr.div` width: 60px; height: 60px; padding: 8px; @@ -463,7 +463,7 @@ width: 20px; height: 20px; border-radius: ${e=>cs[e.theme.borderRadius]}; -`,hs=e=>kt(lo,{get name(){return e.labelLine1},get secondLine(){return e.labelLine2},get icon(){return kt(ds,{get children(){return kt(Pt,{each:[0,1,2,3],children:t=>kt(us,{get src(){return e.images[t]}})})}})},onClick:()=>e.onClick()}),fs="telegram-wallet",ps="https://raw.githubusercontent.com/ton-connect/sdk/main/assets/ton-icon-48.png",gs="https://raw.githubusercontent.com/ton-connect/sdk/main/assets/tg.png",ms=e=>{const[t]=Gi();return Qe((()=>{const r=Qe((()=>e.wallet.appName===fs));return()=>r()?kt(lo,{get icon(){return e.wallet.imageUrl},get name(){return t("walletItem.walletOn",{},"Wallet On")},secondLine:"Telegram",get badgeUrl(){return gs},onClick:()=>e.onClick()}):kt(lo,{get icon(){return e.wallet.imageUrl},get name(){return e.wallet.name},get secondLine(){return(()=>{if(e.wallet.appName!==fs)return"isPreferred"in e.wallet&&e.wallet.isPreferred?t("walletItem.recent",{},"Recent"):X(e.wallet)?t("walletItem.installed",{},"Installed"):"Tonkeeper"===e.wallet.name?t("walletItem.popular",{},"Popular"):void 0})()},secondLineColorPrimary:!1,onClick:()=>e.onClick()})})())},ys=Cr.div` +`,hs=e=>kt(lo,{get name(){return e.labelLine1},get secondLine(){return e.labelLine2},get icon(){return kt(ds,{get children(){return kt(It,{each:[0,1,2,3],children:t=>kt(us,{get src(){return e.images[t]}})})}})},onClick:()=>e.onClick()}),fs="telegram-wallet",ps="https://raw.githubusercontent.com/ton-connect/sdk/main/assets/ton-icon-48.png",gs="https://raw.githubusercontent.com/ton-connect/sdk/main/assets/tg.png",ms=e=>{const[t]=Gi();return Qe((()=>{const r=Qe((()=>e.wallet.appName===fs));return()=>r()?kt(lo,{get icon(){return e.wallet.imageUrl},get name(){return t("walletItem.walletOn",{},"Wallet On")},secondLine:"Telegram",get badgeUrl(){return gs},onClick:()=>e.onClick()}):kt(lo,{get icon(){return e.wallet.imageUrl},get name(){return e.wallet.name},get secondLine(){return(()=>{if(e.wallet.appName!==fs)return"isPreferred"in e.wallet&&e.wallet.isPreferred?t("walletItem.recent",{},"Recent"):X(e.wallet)?t("walletItem.installed",{},"Installed"):"Tonkeeper"===e.wallet.name?t("walletItem.popular",{},"Popular"):void 0})()},secondLineColorPrimary:!1,onClick:()=>e.onClick()})})())},ys=Cr.div` width: 100%; overflow-y: auto; max-height: ${e=>e.maxHeight}; @@ -495,7 +495,7 @@ `,[ws,vs]=Ze((null==(me=Lr())?void 0:me.innerHeight)||0);Lr()&&window.addEventListener("resize",(()=>vs(window.innerHeight)));const[Cs,_s]=Ze(Fn("mobile")),ks=()=>_s(Fn("mobile"));Lr()&&(window.addEventListener("resize",(()=>ks())),window.addEventListener("load",(()=>ks()),{once:!0}));const xs=e=>{const[t,r]=Ze(!1);return[kt(bs,{get isShown(){return t()}}),kt(ys,{get maxHeight(){return void 0!==e.maxHeight?`${e.maxHeight}px`:ws()-(Cs()?150:200)+"px"},onScroll:e=>{r(e.target.scrollTop>0)},get class(){return e.class},get children(){return e.children}})]},As=Cr.a` display: block; text-decoration: unset; -`,Ss=e=>kt(As,Bt({get href(){return e.href},get target(){return e.blank?"_blank":"_self"},get class(){return e.class}},(()=>e.blank?{rel:"noreferrer noopener"}:{}),{get children(){return e.children}})),Bs=rt(),Es=$t(''),Ps=e=>{const t=wr();return(()=>{const r=Es.cloneNode(!0),n=r.firstChild;return Ge((i=>{const o=e.class,s=e.fill||t.colors.icon.primary;return o!==i._v$&&Ft(r,"class",i._v$=o),s!==i._v$2&&Ft(n,"fill",i._v$2=s),i}),{_v$:void 0,_v$2:void 0}),r})()},Is=$t(''),Ms=e=>{const t=wr(),r=()=>e.fill||t.colors.icon.primary;return(()=>{const e=Is.cloneNode(!0),t=e.firstChild,n=t.nextSibling;return Ge((e=>{const i=r(),o=r();return i!==e._v$&&Ft(t,"fill",e._v$=i),o!==e._v$2&&Ft(n,"fill",e._v$2=o),e}),{_v$:void 0,_v$2:void 0}),e})()},Us={m:"8px",s:"4px",none:"0"},Ts={m:"16px",s:"8px",none:"0"},Os=Cr.div` +`,Ss=e=>kt(As,Bt({get href(){return e.href},get target(){return e.blank?"_blank":"_self"},get class(){return e.class}},(()=>e.blank?{rel:"noreferrer noopener"}:{}),{get children(){return e.children}})),Bs=rt(),Es=$t(''),Is=e=>{const t=wr();return(()=>{const r=Es.cloneNode(!0),n=r.firstChild;return Ge((i=>{const o=e.class,s=e.fill||t.colors.icon.primary;return o!==i._v$&&Ft(r,"class",i._v$=o),s!==i._v$2&&Ft(n,"fill",i._v$2=s),i}),{_v$:void 0,_v$2:void 0}),r})()},Ps=$t(''),Ms=e=>{const t=wr(),r=()=>e.fill||t.colors.icon.primary;return(()=>{const e=Ps.cloneNode(!0),t=e.firstChild,n=t.nextSibling;return Ge((e=>{const i=r(),o=r();return i!==e._v$&&Ft(t,"fill",e._v$=i),o!==e._v$2&&Ft(n,"fill",e._v$2=o),e}),{_v$:void 0,_v$2:void 0}),e})()},Us={m:"8px",s:"4px",none:"0"},Ts={m:"16px",s:"8px",none:"0"},Os=Cr.div` width: 256px; box-shadow: 0 4px 24px rgba(0, 0, 0, 0.16); border-radius: ${e=>Ts[e.theme.borderRadius]}; @@ -546,7 +546,7 @@ `,Fs=Cr(Qi)` margin-top: 4px; color: ${e=>e.theme.colors.text.secondary}; -`,Ks=e=>{const t=Gn(e);return kt(Ds,Bt({get class(){return e.class},"data-tc-notification":"true"},t,{get children(){return[kt($s,{get children(){return[kt(go,{get translationKey(){return e.header.translationKey},get translationValues(){return e.header.translationValues},get children(){return e.children}}),kt(It,{get when(){return e.text},get children(){return kt(Fs,{get translationKey(){return e.text.translationKey},get translationValues(){return e.text.translationValues}})}})]}}),Qe((()=>e.icon))]}}))},Vs=Cr(Mo)` +`,Ks=e=>{const t=Gn(e);return kt(Ds,Bt({get class(){return e.class},"data-tc-notification":"true"},t,{get children(){return[kt($s,{get children(){return[kt(go,{get translationKey(){return e.header.translationKey},get translationValues(){return e.header.translationValues},get children(){return e.children}}),kt(Pt,{get when(){return e.text},get children(){return kt(Fs,{get translationKey(){return e.text.translationKey},get translationValues(){return e.text.translationValues}})}})]}}),Qe((()=>e.icon))]}}))},Vs=Cr(Mo)` align-self: center; `,qs=e=>{const t=nt(Bs),[r]=Gi();return kt(Ks,{get header(){return{translationKey:"notifications.confirm.header",translationValues:{name:t.wallet&&"name"in t.wallet?t.wallet.name:r("common.yourWallet",{},"Your wallet")}}},get class(){return e.class},get icon(){return kt(Vs,{})},"data-tc-notification-confirm":"true",children:"Confirm operation in your wallet"})},Hs=Cr(Bo)` margin-top: 2px; @@ -589,15 +589,15 @@ display: flex; flex-direction: column; align-items: flex-end; -`,aa=Cr((e=>{const t=nt(Bs),[r,n]=Ze(!1);return kt(Os,{ref(t){const r=e.ref;"function"==typeof r?r(t):e.ref=t},get class(){return e.class},"data-tc-dropdown":"true",get children(){return kt(Rs,{get children(){return[(()=>{const e=Ls.cloneNode(!0);return Ht(e,kt(js,{onClick:()=>Ie(void 0,null,(function*(){const e=se(t.account.address,t.account.chain===s.TESTNET);yield Vi(e),n(!0),setTimeout((()=>n(!1)),1e3)})),get children(){return[kt(Ps,{}),kt(It,{get when(){return!r()},get children(){return kt(zs,{translationKey:"button.dropdown.copy",children:"Copy address"})}}),kt(It,{get when(){return r()},get children(){return kt(zs,{translationKey:"button.dropdown.copied",children:"Address copied!"})}})]}})),e})(),(()=>{const r=Ls.cloneNode(!0);return Ht(r,kt(js,{onClick:()=>(t.disconnect(),void e.onClose()),get children(){return[kt(Ms,{}),kt(zs,{translationKey:"button.dropdown.disconnect",children:"Disconnect"})]}})),r})()]}})}})}))` +`,aa=Cr((e=>{const t=nt(Bs),[r,n]=Ze(!1);return kt(Os,{ref(t){const r=e.ref;"function"==typeof r?r(t):e.ref=t},get class(){return e.class},"data-tc-dropdown":"true",get children(){return kt(Rs,{get children(){return[(()=>{const e=Ls.cloneNode(!0);return Ht(e,kt(js,{onClick:()=>Pe(void 0,null,(function*(){const e=se(t.account.address,t.account.chain===s.TESTNET);yield Vi(e),n(!0),setTimeout((()=>n(!1)),1e3)})),get children(){return[kt(Is,{}),kt(Pt,{get when(){return!r()},get children(){return kt(zs,{translationKey:"button.dropdown.copy",children:"Copy address"})}}),kt(Pt,{get when(){return r()},get children(){return kt(zs,{translationKey:"button.dropdown.copied",children:"Address copied!"})}})]}})),e})(),(()=>{const r=Ls.cloneNode(!0);return Ht(r,kt(js,{onClick:()=>(t.disconnect(),void e.onClose()),get children(){return[kt(Ms,{}),kt(zs,{translationKey:"button.dropdown.disconnect",children:"Disconnect"})]}})),r})()]}})}})}))` box-sizing: border-box; overflow: hidden; margin-top: 12px; -`,la=Cr((e=>{const t=ea();return(()=>{const r=ta.cloneNode(!0);return Ht(r,kt(ei,{onBeforeEnter:e=>{vi(e,[{opacity:0,transform:"translateY(0)"},{opacity:1,transform:"translateY(-8px)"}],{duration:200})},onExit:(e,t)=>{vi(e,[{opacity:1,transform:"translateY(-8px)"},{opacity:0,transform:"translateY(-30px)"}],{duration:200}).finished.then(t)},get children(){return kt(Pt,{get each(){return t()},children:e=>kt(Mt,{get children(){return[kt(Ut,{get when(){return"transaction-sent"===e.action},get children(){return kt(Gs,{class:Ys})}}),kt(Ut,{get when(){return"transaction-canceled"===e.action},get children(){return kt(Zs,{class:Ys})}}),kt(Ut,{get when(){return"confirm-transaction"===e.action},get children(){return kt(qs,{class:Ys})}})]}})})}})),Ge((()=>Kt(r,e.class))),r})()}))` +`,la=Cr((e=>{const t=ea();return(()=>{const r=ta.cloneNode(!0);return Ht(r,kt(ei,{onBeforeEnter:e=>{vi(e,[{opacity:0,transform:"translateY(0)"},{opacity:1,transform:"translateY(-8px)"}],{duration:200})},onExit:(e,t)=>{vi(e,[{opacity:1,transform:"translateY(-8px)"},{opacity:0,transform:"translateY(-30px)"}],{duration:200}).finished.then(t)},get children(){return kt(It,{get each(){return t()},children:e=>kt(Mt,{get children(){return[kt(Ut,{get when(){return"transaction-sent"===e.action},get children(){return kt(Gs,{class:Ys})}}),kt(Ut,{get when(){return"transaction-canceled"===e.action},get children(){return kt(Zs,{class:Ys})}}),kt(Ut,{get when(){return"confirm-transaction"===e.action},get children(){return kt(qs,{class:Ys})}})]}})})}})),Ge((()=>Kt(r,e.class))),r})()}))` > div:first-child { margin-top: 20px; } -`;function ca(e){return e.split("-")[0]}function da(e,t,r){let{reference:n,floating:i}=e;const o=n.x+n.width/2-i.width/2,s=n.y+n.height/2-i.height/2,a=function(e){return["top","bottom"].includes(ca(e))?"x":"y"}(t),l="y"===a?"height":"width",c=n[l]/2-i[l]/2,d="x"===a;let u;switch(ca(t)){case"top":u={x:o,y:n.y-i.height};break;case"bottom":u={x:o,y:n.y+n.height};break;case"right":u={x:n.x+n.width,y:s};break;case"left":u={x:n.x-i.width,y:s};break;default:u={x:n.x,y:n.y}}switch(function(e){return e.split("-")[1]}(t)){case"start":u[a]-=c*(r&&d?-1:1);break;case"end":u[a]+=c*(r&&d?-1:1)}return u}function ua(e){return Ee(Be({},e),{top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height})}function ha(e){var t;return(null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function fa(e){return ha(e).getComputedStyle(e)}function pa(e){return wa(e)?(e.nodeName||"").toLowerCase():""}let ga;function ma(){if(ga)return ga;const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?(ga=e.brands.map((e=>e.brand+"/"+e.version)).join(" "),ga):navigator.userAgent}function ya(e){return e instanceof ha(e).HTMLElement}function ba(e){return e instanceof ha(e).Element}function wa(e){return e instanceof ha(e).Node}function va(e){return"undefined"!=typeof ShadowRoot&&(e instanceof ha(e).ShadowRoot||e instanceof ShadowRoot)}function Ca(e){const{overflow:t,overflowX:r,overflowY:n,display:i}=fa(e);return/auto|scroll|overlay|hidden/.test(t+n+r)&&!["inline","contents"].includes(i)}function _a(e){return["table","td","th"].includes(pa(e))}function ka(e){const t=/firefox/i.test(ma()),r=fa(e),n=r.backdropFilter||r.WebkitBackdropFilter;return"none"!==r.transform||"none"!==r.perspective||!!n&&"none"!==n||t&&"filter"===r.willChange||t&&!!r.filter&&"none"!==r.filter||["transform","perspective"].some((e=>r.willChange.includes(e)))||["paint","layout","strict","content"].some((e=>{const t=r.contain;return null!=t&&t.includes(e)}))}function xa(){return!/^((?!chrome|android).)*safari/i.test(ma())}function Aa(e){return["html","body","#document"].includes(pa(e))}const Sa=Math.min,Ba=Math.max,Ea=Math.round,Pa={x:1,y:1};function Ia(e){const t=!ba(e)&&e.contextElement?e.contextElement:ba(e)?e:null;if(!t)return Pa;const r=t.getBoundingClientRect(),n=fa(t);if("border-box"!==n.boxSizing)return ya(t)?{x:t.offsetWidth>0&&Ea(r.width)/t.offsetWidth||1,y:t.offsetHeight>0&&Ea(r.height)/t.offsetHeight||1}:Pa;let i=r.width/parseFloat(n.width),o=r.height/parseFloat(n.height);return i&&Number.isFinite(i)||(i=1),o&&Number.isFinite(o)||(o=1),{x:i,y:o}}function Ma(e,t,r,n){var i,o,s,a;void 0===t&&(t=!1),void 0===r&&(r=!1);const l=e.getBoundingClientRect();let c=Pa;t&&(n?ba(n)&&(c=Ia(n)):c=Ia(e));const d=ba(e)?ha(e):window,u=!xa()&&r,h=(l.left+(u&&null!=(i=null==(o=d.visualViewport)?void 0:o.offsetLeft)?i:0))/c.x,f=(l.top+(u&&null!=(s=null==(a=d.visualViewport)?void 0:a.offsetTop)?s:0))/c.y,p=l.width/c.x,g=l.height/c.y;return{width:p,height:g,top:f,right:h+p,bottom:f+g,left:h,x:h,y:f}}function Ua(e){return((wa(e)?e.ownerDocument:e.document)||window.document).documentElement}function Ta(e){return ba(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Oa(e){return Ma(Ua(e)).left+Ta(e).scrollLeft}function Ra(e,t,r){const n=ya(t),i=Ua(t),o=Ma(e,!0,"fixed"===r,t);let s={scrollLeft:0,scrollTop:0};const a={x:0,y:0};if(n||!n&&"fixed"!==r)if(("body"!==pa(t)||Ca(i))&&(s=Ta(t)),ya(t)){const e=Ma(t,!0);a.x=e.x+t.clientLeft,a.y=e.y+t.clientTop}else i&&(a.x=Oa(i));return{x:o.left+s.scrollLeft-a.x,y:o.top+s.scrollTop-a.y,width:o.width,height:o.height}}function ja(e){if("html"===pa(e))return e;const t=e.assignedSlot||e.parentNode||(va(e)?e.host:null)||Ua(e);return va(t)?t.host:t}function La(e){return ya(e)&&"fixed"!==fa(e).position?e.offsetParent:null}function za(e){const t=ha(e);let r=La(e);for(;r&&_a(r)&&"static"===fa(r).position;)r=La(r);return r&&("html"===pa(r)||"body"===pa(r)&&"static"===fa(r).position&&!ka(r))?t:r||function(e){let t=ja(e);for(;ya(t)&&!Aa(t);){if(ka(t))return t;t=ja(t)}return null}(e)||t}function Na(e){const t=ja(e);return Aa(t)?e.ownerDocument.body:ya(t)&&Ca(t)?t:Na(t)}function Da(e,t){var r;void 0===t&&(t=[]);const n=Na(e),i=n===(null==(r=e.ownerDocument)?void 0:r.body),o=ha(n);return i?t.concat(o,o.visualViewport||[],Ca(n)?n:[]):t.concat(n,Da(n))}function $a(e,t,r){return"viewport"===t?ua(function(e,t){const r=ha(e),n=Ua(e),i=r.visualViewport;let o=n.clientWidth,s=n.clientHeight,a=0,l=0;if(i){o=i.width,s=i.height;const e=xa();(e||!e&&"fixed"===t)&&(a=i.offsetLeft,l=i.offsetTop)}return{width:o,height:s,x:a,y:l}}(e,r)):ba(t)?function(e,t){const r=Ma(e,!0,"fixed"===t),n=r.top+e.clientTop,i=r.left+e.clientLeft,o=ya(e)?Ia(e):{x:1,y:1},s=e.clientWidth*o.x,a=e.clientHeight*o.y,l=i*o.x,c=n*o.y;return{top:c,left:l,right:l+s,bottom:c+a,x:l,y:c,width:s,height:a}}(t,r):ua(function(e){var t;const r=Ua(e),n=Ta(e),i=null==(t=e.ownerDocument)?void 0:t.body,o=Ba(r.scrollWidth,r.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),s=Ba(r.scrollHeight,r.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0);let a=-n.scrollLeft+Oa(e);const l=-n.scrollTop;return"rtl"===fa(i||r).direction&&(a+=Ba(r.clientWidth,i?i.clientWidth:0)-o),{width:o,height:s,x:a,y:l}}(Ua(e)))}const Fa={getClippingRect:function(e){let{element:t,boundary:r,rootBoundary:n,strategy:i}=e;const o=[..."clippingAncestors"===r?function(e,t){const r=t.get(e);if(r)return r;let n=Da(e).filter((e=>ba(e)&&"body"!==pa(e))),i=null;const o="fixed"===fa(e).position;let s=o?ja(e):e;for(;ba(s)&&!Aa(s);){const e=fa(s),t=ka(s);(o?t||i:t||"static"!==e.position||!i||!["absolute","fixed"].includes(i.position))?i=e:n=n.filter((e=>e!==s)),s=ja(s)}return t.set(e,n),n}(t,this._c):[].concat(r),n],s=o[0],a=o.reduce(((e,r)=>{const n=$a(t,r,i);return e.top=Ba(n.top,e.top),e.right=Sa(n.right,e.right),e.bottom=Sa(n.bottom,e.bottom),e.left=Ba(n.left,e.left),e}),$a(t,s,i));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:r,strategy:n}=e;const i=ya(r),o=Ua(r);if(r===o)return t;let s={scrollLeft:0,scrollTop:0},a={x:1,y:1};const l={x:0,y:0};if((i||!i&&"fixed"!==n)&&(("body"!==pa(r)||Ca(o))&&(s=Ta(r)),ya(r))){const e=Ma(r);a=Ia(r),l.x=e.x+r.clientLeft,l.y=e.y+r.clientTop}return{width:t.width*a.x,height:t.height*a.y,x:t.x*a.x-s.scrollLeft*a.x+l.x,y:t.y*a.y-s.scrollTop*a.y+l.y}},isElement:ba,getDimensions:function(e){if(ya(e))return{width:e.offsetWidth,height:e.offsetHeight};const t=Ma(e);return{width:t.width,height:t.height}},getOffsetParent:za,getDocumentElement:Ua,getScale:Ia,getElementRects(e){return Ie(this,null,(function*(){let{reference:t,floating:r,strategy:n}=e;const i=this.getOffsetParent||za,o=this.getDimensions;return{reference:Ra(t,yield i(r),n),floating:Be({x:0,y:0},yield o(r))}}))},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>"rtl"===fa(e).direction};function Ka(e,t,r,n){void 0===n&&(n={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:s=!0,animationFrame:a=!1}=n,l=i&&!a,c=l||o?[...ba(e)?Da(e):e.contextElement?Da(e.contextElement):[],...Da(t)]:[];c.forEach((e=>{l&&e.addEventListener("scroll",r,{passive:!0}),o&&e.addEventListener("resize",r)}));let d,u=null;if(s){let n=!0;u=new ResizeObserver((()=>{n||r(),n=!1})),ba(e)&&!a&&u.observe(e),ba(e)||!e.contextElement||a||u.observe(e.contextElement),u.observe(t)}let h=a?Ma(e):null;return a&&function t(){const n=Ma(e);!h||n.x===h.x&&n.y===h.y&&n.width===h.width&&n.height===h.height||r(),h=n,d=requestAnimationFrame(t)}(),r(),()=>{var e;c.forEach((e=>{l&&e.removeEventListener("scroll",r),o&&e.removeEventListener("resize",r)})),null==(e=u)||e.disconnect(),u=null,a&&cancelAnimationFrame(d)}}const Va=$t(''),qa=()=>{const e=wr(),t=nt(rn),r=nt(Bs),[n,i]=Ze(!1),[o,a]=Ze(t.account),[l,c]=Ze(!0);let d;const[u,h]=Ze(),[f,p]=Ze(),g=function(e,t,r){let n=()=>{var e;return null!=(e=null==r?void 0:r.placement)?e:"bottom"},i=()=>{var e;return null!=(e=null==r?void 0:r.strategy)?e:"absolute"},[o,s]=Ze({x:null,y:null,placement:n(),strategy:i(),middlewareData:{}}),[a,l]=Ze();Ye((()=>{let e=a();if(e)throw e.value}));let c=Qe((()=>(e(),t(),{})));function d(){let o=e(),a=t();if(o&&a){let e=c();((e,t,r)=>{const n=new Map,i=Be({platform:Fa},r),o=Ee(Be({},i.platform),{_c:n});return((e,t,r)=>Ie(void 0,null,(function*(){const{placement:n="bottom",strategy:i="absolute",middleware:o=[],platform:s}=r,a=o.filter(Boolean),l=yield null==s.isRTL?void 0:s.isRTL(t);if("production"!=={}.NODE_ENV){if(null==s&&console.error(["Floating UI: `platform` property was not passed to config. If you","want to use Floating UI on the web, install @floating-ui/dom","instead of the /core package. Otherwise, you can create your own","`platform`: https://floating-ui.com/docs/platform"].join(" ")),a.filter((e=>{let{name:t}=e;return"autoPlacement"===t||"flip"===t})).length>1)throw new Error(["Floating UI: duplicate `flip` and/or `autoPlacement` middleware","detected. This will lead to an infinite loop. Ensure only one of","either has been passed to the `middleware` array."].join(" "));e&&t||console.error(["Floating UI: The reference and/or floating element was not defined","when `computePosition()` was called. Ensure that both elements have","been created and can be measured."].join(" "))}let c=yield s.getElementRects({reference:e,floating:t,strategy:i}),{x:d,y:u}=da(c,n,l),h=n,f={},p=0;for(let r=0;r50&&console.warn(["Floating UI: The middleware lifecycle appears to be running in an","infinite loop. This is usually caused by a `reset` continually","being returned without a break condition."].join(" ")),w&&p<=50&&(p++,"object"==typeof w&&(w.placement&&(h=w.placement),w.rects&&(c=!0===w.rects?yield s.getElementRects({reference:e,floating:t,strategy:i}):w.rects),({x:d,y:u}=da(c,h,l))),r=-1)}return{x:d,y:u,placement:h,strategy:i,middlewareData:f}})))(e,t,Ee(Be({},i),{platform:o}))})(o,a,{middleware:null==r?void 0:r.middleware,placement:n(),strategy:i()}).then((t=>{e===c()&&s(t)}),(e=>{l(e)}))}}return Ye((()=>{let o=e(),s=t();if(null==r||r.middleware,n(),i(),o&&s)if(null!=r&&r.whileElementsMounted){let e=r.whileElementsMounted(o,s,d);e&&et(e)}else d()})),{get x(){return o().x},get y(){return o().y},get placement(){return o().placement},get strategy(){return o().strategy},get middlewareData(){return o().middlewareData},update:d}}(f,u,{whileElementsMounted:Ka,placement:"bottom-end"});r.connectionRestored.then((()=>c(!1)));const m=t.onStatusChange((e=>{if(!e)return i(!1),void a(null);a(e.account)})),y=e=>{if(!o()||!n())return;const t=f().contains(e.target),r=d.contains(e.target);t||r||i(!1)};var b;return b=()=>{document.body.addEventListener("click",y)},Ye((()=>Xe(b))),et((()=>{document.body.removeEventListener("click",y),m()})),kt(nr,{component:kr,get children(){return[kt(It,{get when(){return l()},get children(){return kt(ia,{disabled:!0,"data-tc-connect-button-loading":"true",get children(){return kt(oa,{})}})}}),kt(It,{get when(){return!l()},get children(){return[kt(It,{get when(){return!o()},get children(){return kt(ra,{onClick:()=>r.openModal(),"data-tc-connect-button":"true",scale:"s",get children(){return[kt(wo,{get fill(){return e.colors.connectButton.foreground}}),kt(Qi,{translationKey:"button.connectWallet",fontSize:"15px",lineHeight:"18px",fontWeight:"590",get color(){return e.colors.connectButton.foreground},children:"Connect wallet"})]}})}}),kt(It,{get when(){return o()},get children(){return kt(sa,{get children(){return[kt(na,{onClick:()=>i((e=>!e)),ref:p,"data-tc-dropdown-button":"true",scale:"s",get children(){return[kt(Qi,{fontSize:"15px",fontWeight:"590",lineHeight:"18px",get children(){return(()=>{const e=o();if(e){const t=se(e.address,e.chain===s.TESTNET);return t.slice(0,4)+"…"+t.slice(-4)}return""})()}}),kt(oi,{direction:"bottom"})]}}),kt(rr,{get children(){const e=Xe((()=>document.importNode(Va,!0)));return qt(h,e),e.style.setProperty("z-index","999"),e._$owner=De,Ht(e,kt(Jn,{onBeforeEnter:e=>{vi(e,[{opacity:0,transform:"translateY(-8px)"},{opacity:1,transform:"translateY(0)"}],{duration:150})},onExit:(e,t)=>{vi(e,[{opacity:1,transform:"translateY(0)"},{opacity:0,transform:"translateY(-8px)"}],{duration:150}).finished.then(t)},get children(){return kt(It,{get when(){return n()},get children(){return kt(aa,{get hidden(){return!n()},onClose:()=>i(!1),ref(e){"function"==typeof d?d(e):d=e}})}})}}),null),Ht(e,kt(la,{}),null),Ge((t=>{var r,n;const i=g.strategy,o=`${null!=(r=g.y)?r:0}px`,s=`${null!=(n=g.x)?n:0}px`;return i!==t._v$&&e.style.setProperty("position",t._v$=i),o!==t._v$2&&e.style.setProperty("top",t._v$2=o),s!==t._v$3&&e.style.setProperty("left",t._v$3=s),t}),{_v$:void 0,_v$2:void 0,_v$3:void 0}),e}})]}})}})]}})]}})},Ha=Cr(Ai)` +`;function ca(e){return e.split("-")[0]}function da(e,t,r){let{reference:n,floating:i}=e;const o=n.x+n.width/2-i.width/2,s=n.y+n.height/2-i.height/2,a=function(e){return["top","bottom"].includes(ca(e))?"x":"y"}(t),l="y"===a?"height":"width",c=n[l]/2-i[l]/2,d="x"===a;let u;switch(ca(t)){case"top":u={x:o,y:n.y-i.height};break;case"bottom":u={x:o,y:n.y+n.height};break;case"right":u={x:n.x+n.width,y:s};break;case"left":u={x:n.x-i.width,y:s};break;default:u={x:n.x,y:n.y}}switch(function(e){return e.split("-")[1]}(t)){case"start":u[a]-=c*(r&&d?-1:1);break;case"end":u[a]+=c*(r&&d?-1:1)}return u}function ua(e){return Ee(Be({},e),{top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height})}function ha(e){var t;return(null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function fa(e){return ha(e).getComputedStyle(e)}function pa(e){return wa(e)?(e.nodeName||"").toLowerCase():""}let ga;function ma(){if(ga)return ga;const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?(ga=e.brands.map((e=>e.brand+"/"+e.version)).join(" "),ga):navigator.userAgent}function ya(e){return e instanceof ha(e).HTMLElement}function ba(e){return e instanceof ha(e).Element}function wa(e){return e instanceof ha(e).Node}function va(e){return"undefined"!=typeof ShadowRoot&&(e instanceof ha(e).ShadowRoot||e instanceof ShadowRoot)}function Ca(e){const{overflow:t,overflowX:r,overflowY:n,display:i}=fa(e);return/auto|scroll|overlay|hidden/.test(t+n+r)&&!["inline","contents"].includes(i)}function _a(e){return["table","td","th"].includes(pa(e))}function ka(e){const t=/firefox/i.test(ma()),r=fa(e),n=r.backdropFilter||r.WebkitBackdropFilter;return"none"!==r.transform||"none"!==r.perspective||!!n&&"none"!==n||t&&"filter"===r.willChange||t&&!!r.filter&&"none"!==r.filter||["transform","perspective"].some((e=>r.willChange.includes(e)))||["paint","layout","strict","content"].some((e=>{const t=r.contain;return null!=t&&t.includes(e)}))}function xa(){return!/^((?!chrome|android).)*safari/i.test(ma())}function Aa(e){return["html","body","#document"].includes(pa(e))}const Sa=Math.min,Ba=Math.max,Ea=Math.round,Ia={x:1,y:1};function Pa(e){const t=!ba(e)&&e.contextElement?e.contextElement:ba(e)?e:null;if(!t)return Ia;const r=t.getBoundingClientRect(),n=fa(t);if("border-box"!==n.boxSizing)return ya(t)?{x:t.offsetWidth>0&&Ea(r.width)/t.offsetWidth||1,y:t.offsetHeight>0&&Ea(r.height)/t.offsetHeight||1}:Ia;let i=r.width/parseFloat(n.width),o=r.height/parseFloat(n.height);return i&&Number.isFinite(i)||(i=1),o&&Number.isFinite(o)||(o=1),{x:i,y:o}}function Ma(e,t,r,n){var i,o,s,a;void 0===t&&(t=!1),void 0===r&&(r=!1);const l=e.getBoundingClientRect();let c=Ia;t&&(n?ba(n)&&(c=Pa(n)):c=Pa(e));const d=ba(e)?ha(e):window,u=!xa()&&r,h=(l.left+(u&&null!=(i=null==(o=d.visualViewport)?void 0:o.offsetLeft)?i:0))/c.x,f=(l.top+(u&&null!=(s=null==(a=d.visualViewport)?void 0:a.offsetTop)?s:0))/c.y,p=l.width/c.x,g=l.height/c.y;return{width:p,height:g,top:f,right:h+p,bottom:f+g,left:h,x:h,y:f}}function Ua(e){return((wa(e)?e.ownerDocument:e.document)||window.document).documentElement}function Ta(e){return ba(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Oa(e){return Ma(Ua(e)).left+Ta(e).scrollLeft}function Ra(e,t,r){const n=ya(t),i=Ua(t),o=Ma(e,!0,"fixed"===r,t);let s={scrollLeft:0,scrollTop:0};const a={x:0,y:0};if(n||!n&&"fixed"!==r)if(("body"!==pa(t)||Ca(i))&&(s=Ta(t)),ya(t)){const e=Ma(t,!0);a.x=e.x+t.clientLeft,a.y=e.y+t.clientTop}else i&&(a.x=Oa(i));return{x:o.left+s.scrollLeft-a.x,y:o.top+s.scrollTop-a.y,width:o.width,height:o.height}}function ja(e){if("html"===pa(e))return e;const t=e.assignedSlot||e.parentNode||(va(e)?e.host:null)||Ua(e);return va(t)?t.host:t}function La(e){return ya(e)&&"fixed"!==fa(e).position?e.offsetParent:null}function za(e){const t=ha(e);let r=La(e);for(;r&&_a(r)&&"static"===fa(r).position;)r=La(r);return r&&("html"===pa(r)||"body"===pa(r)&&"static"===fa(r).position&&!ka(r))?t:r||function(e){let t=ja(e);for(;ya(t)&&!Aa(t);){if(ka(t))return t;t=ja(t)}return null}(e)||t}function Na(e){const t=ja(e);return Aa(t)?e.ownerDocument.body:ya(t)&&Ca(t)?t:Na(t)}function Da(e,t){var r;void 0===t&&(t=[]);const n=Na(e),i=n===(null==(r=e.ownerDocument)?void 0:r.body),o=ha(n);return i?t.concat(o,o.visualViewport||[],Ca(n)?n:[]):t.concat(n,Da(n))}function $a(e,t,r){return"viewport"===t?ua(function(e,t){const r=ha(e),n=Ua(e),i=r.visualViewport;let o=n.clientWidth,s=n.clientHeight,a=0,l=0;if(i){o=i.width,s=i.height;const e=xa();(e||!e&&"fixed"===t)&&(a=i.offsetLeft,l=i.offsetTop)}return{width:o,height:s,x:a,y:l}}(e,r)):ba(t)?function(e,t){const r=Ma(e,!0,"fixed"===t),n=r.top+e.clientTop,i=r.left+e.clientLeft,o=ya(e)?Pa(e):{x:1,y:1},s=e.clientWidth*o.x,a=e.clientHeight*o.y,l=i*o.x,c=n*o.y;return{top:c,left:l,right:l+s,bottom:c+a,x:l,y:c,width:s,height:a}}(t,r):ua(function(e){var t;const r=Ua(e),n=Ta(e),i=null==(t=e.ownerDocument)?void 0:t.body,o=Ba(r.scrollWidth,r.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),s=Ba(r.scrollHeight,r.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0);let a=-n.scrollLeft+Oa(e);const l=-n.scrollTop;return"rtl"===fa(i||r).direction&&(a+=Ba(r.clientWidth,i?i.clientWidth:0)-o),{width:o,height:s,x:a,y:l}}(Ua(e)))}const Fa={getClippingRect:function(e){let{element:t,boundary:r,rootBoundary:n,strategy:i}=e;const o=[..."clippingAncestors"===r?function(e,t){const r=t.get(e);if(r)return r;let n=Da(e).filter((e=>ba(e)&&"body"!==pa(e))),i=null;const o="fixed"===fa(e).position;let s=o?ja(e):e;for(;ba(s)&&!Aa(s);){const e=fa(s),t=ka(s);(o?t||i:t||"static"!==e.position||!i||!["absolute","fixed"].includes(i.position))?i=e:n=n.filter((e=>e!==s)),s=ja(s)}return t.set(e,n),n}(t,this._c):[].concat(r),n],s=o[0],a=o.reduce(((e,r)=>{const n=$a(t,r,i);return e.top=Ba(n.top,e.top),e.right=Sa(n.right,e.right),e.bottom=Sa(n.bottom,e.bottom),e.left=Ba(n.left,e.left),e}),$a(t,s,i));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:r,strategy:n}=e;const i=ya(r),o=Ua(r);if(r===o)return t;let s={scrollLeft:0,scrollTop:0},a={x:1,y:1};const l={x:0,y:0};if((i||!i&&"fixed"!==n)&&(("body"!==pa(r)||Ca(o))&&(s=Ta(r)),ya(r))){const e=Ma(r);a=Pa(r),l.x=e.x+r.clientLeft,l.y=e.y+r.clientTop}return{width:t.width*a.x,height:t.height*a.y,x:t.x*a.x-s.scrollLeft*a.x+l.x,y:t.y*a.y-s.scrollTop*a.y+l.y}},isElement:ba,getDimensions:function(e){if(ya(e))return{width:e.offsetWidth,height:e.offsetHeight};const t=Ma(e);return{width:t.width,height:t.height}},getOffsetParent:za,getDocumentElement:Ua,getScale:Pa,getElementRects(e){return Pe(this,null,(function*(){let{reference:t,floating:r,strategy:n}=e;const i=this.getOffsetParent||za,o=this.getDimensions;return{reference:Ra(t,yield i(r),n),floating:Be({x:0,y:0},yield o(r))}}))},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>"rtl"===fa(e).direction};function Ka(e,t,r,n){void 0===n&&(n={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:s=!0,animationFrame:a=!1}=n,l=i&&!a,c=l||o?[...ba(e)?Da(e):e.contextElement?Da(e.contextElement):[],...Da(t)]:[];c.forEach((e=>{l&&e.addEventListener("scroll",r,{passive:!0}),o&&e.addEventListener("resize",r)}));let d,u=null;if(s){let n=!0;u=new ResizeObserver((()=>{n||r(),n=!1})),ba(e)&&!a&&u.observe(e),ba(e)||!e.contextElement||a||u.observe(e.contextElement),u.observe(t)}let h=a?Ma(e):null;return a&&function t(){const n=Ma(e);!h||n.x===h.x&&n.y===h.y&&n.width===h.width&&n.height===h.height||r(),h=n,d=requestAnimationFrame(t)}(),r(),()=>{var e;c.forEach((e=>{l&&e.removeEventListener("scroll",r),o&&e.removeEventListener("resize",r)})),null==(e=u)||e.disconnect(),u=null,a&&cancelAnimationFrame(d)}}const Va=$t(''),qa=()=>{const e=wr(),t=nt(rn),r=nt(Bs),[n,i]=Ze(!1),[o,a]=Ze(t.account),[l,c]=Ze(!0);let d;const[u,h]=Ze(),[f,p]=Ze(),g=function(e,t,r){let n=()=>{var e;return null!=(e=null==r?void 0:r.placement)?e:"bottom"},i=()=>{var e;return null!=(e=null==r?void 0:r.strategy)?e:"absolute"},[o,s]=Ze({x:null,y:null,placement:n(),strategy:i(),middlewareData:{}}),[a,l]=Ze();Ye((()=>{let e=a();if(e)throw e.value}));let c=Qe((()=>(e(),t(),{})));function d(){let o=e(),a=t();if(o&&a){let e=c();((e,t,r)=>{const n=new Map,i=Be({platform:Fa},r),o=Ee(Be({},i.platform),{_c:n});return((e,t,r)=>Pe(void 0,null,(function*(){const{placement:n="bottom",strategy:i="absolute",middleware:o=[],platform:s}=r,a=o.filter(Boolean),l=yield null==s.isRTL?void 0:s.isRTL(t);if("production"!=={}.NODE_ENV){if(null==s&&console.error(["Floating UI: `platform` property was not passed to config. If you","want to use Floating UI on the web, install @floating-ui/dom","instead of the /core package. Otherwise, you can create your own","`platform`: https://floating-ui.com/docs/platform"].join(" ")),a.filter((e=>{let{name:t}=e;return"autoPlacement"===t||"flip"===t})).length>1)throw new Error(["Floating UI: duplicate `flip` and/or `autoPlacement` middleware","detected. This will lead to an infinite loop. Ensure only one of","either has been passed to the `middleware` array."].join(" "));e&&t||console.error(["Floating UI: The reference and/or floating element was not defined","when `computePosition()` was called. Ensure that both elements have","been created and can be measured."].join(" "))}let c=yield s.getElementRects({reference:e,floating:t,strategy:i}),{x:d,y:u}=da(c,n,l),h=n,f={},p=0;for(let r=0;r50&&console.warn(["Floating UI: The middleware lifecycle appears to be running in an","infinite loop. This is usually caused by a `reset` continually","being returned without a break condition."].join(" ")),w&&p<=50&&(p++,"object"==typeof w&&(w.placement&&(h=w.placement),w.rects&&(c=!0===w.rects?yield s.getElementRects({reference:e,floating:t,strategy:i}):w.rects),({x:d,y:u}=da(c,h,l))),r=-1)}return{x:d,y:u,placement:h,strategy:i,middlewareData:f}})))(e,t,Ee(Be({},i),{platform:o}))})(o,a,{middleware:null==r?void 0:r.middleware,placement:n(),strategy:i()}).then((t=>{e===c()&&s(t)}),(e=>{l(e)}))}}return Ye((()=>{let o=e(),s=t();if(null==r||r.middleware,n(),i(),o&&s)if(null!=r&&r.whileElementsMounted){let e=r.whileElementsMounted(o,s,d);e&&et(e)}else d()})),{get x(){return o().x},get y(){return o().y},get placement(){return o().placement},get strategy(){return o().strategy},get middlewareData(){return o().middlewareData},update:d}}(f,u,{whileElementsMounted:Ka,placement:"bottom-end"});r.connectionRestored.then((()=>c(!1)));const m=t.onStatusChange((e=>{if(!e)return i(!1),void a(null);a(e.account)})),y=e=>{if(!o()||!n())return;const t=f().contains(e.target),r=d.contains(e.target);t||r||i(!1)};var b;return b=()=>{document.body.addEventListener("click",y)},Ye((()=>Xe(b))),et((()=>{document.body.removeEventListener("click",y),m()})),kt(nr,{component:kr,get children(){return[kt(Pt,{get when(){return l()},get children(){return kt(ia,{disabled:!0,"data-tc-connect-button-loading":"true",get children(){return kt(oa,{})}})}}),kt(Pt,{get when(){return!l()},get children(){return[kt(Pt,{get when(){return!o()},get children(){return kt(ra,{onClick:()=>r.openModal(),"data-tc-connect-button":"true",scale:"s",get children(){return[kt(wo,{get fill(){return e.colors.connectButton.foreground}}),kt(Qi,{translationKey:"button.connectWallet",fontSize:"15px",lineHeight:"18px",fontWeight:"590",get color(){return e.colors.connectButton.foreground},children:"Connect wallet"})]}})}}),kt(Pt,{get when(){return o()},get children(){return kt(sa,{get children(){return[kt(na,{onClick:()=>i((e=>!e)),ref:p,"data-tc-dropdown-button":"true",scale:"s",get children(){return[kt(Qi,{fontSize:"15px",fontWeight:"590",lineHeight:"18px",get children(){return(()=>{const e=o();if(e){const t=se(e.address,e.chain===s.TESTNET);return t.slice(0,4)+"…"+t.slice(-4)}return""})()}}),kt(oi,{direction:"bottom"})]}}),kt(rr,{get children(){const e=Xe((()=>document.importNode(Va,!0)));return qt(h,e),e.style.setProperty("z-index","999"),e._$owner=De,Ht(e,kt(Jn,{onBeforeEnter:e=>{vi(e,[{opacity:0,transform:"translateY(-8px)"},{opacity:1,transform:"translateY(0)"}],{duration:150})},onExit:(e,t)=>{vi(e,[{opacity:1,transform:"translateY(0)"},{opacity:0,transform:"translateY(-8px)"}],{duration:150}).finished.then(t)},get children(){return kt(Pt,{get when(){return n()},get children(){return kt(aa,{get hidden(){return!n()},onClose:()=>i(!1),ref(e){"function"==typeof d?d(e):d=e}})}})}}),null),Ht(e,kt(la,{}),null),Ge((t=>{var r,n;const i=g.strategy,o=`${null!=(r=g.y)?r:0}px`,s=`${null!=(n=g.x)?n:0}px`;return i!==t._v$&&e.style.setProperty("position",t._v$=i),o!==t._v$2&&e.style.setProperty("top",t._v$2=o),s!==t._v$3&&e.style.setProperty("left",t._v$3=s),t}),{_v$:void 0,_v$2:void 0,_v$3:void 0}),e}})]}})}})]}})]}})},Ha=Cr(Ai)` padding-left: 24px; padding-right: 24px; padding-top: 18px; @@ -629,7 +629,7 @@ min-width: 84px; text-align: center; font-weight: 590; -`,Cr((e=>{const t="tabBar"+Math.floor(1e4*Math.random());return kt(Ei,{get class(){return e.class},"data-tc-tab-bar":"true",get children(){return[kt(Pi,{get right(){return 1===e.selectedTabIndex}}),kt(Mi,{get isActive(){return 0===e.selectedTabIndex},get children(){return[kt(Ii,{type:"radio",name:t,get checked(){return 0===e.selectedTabIndex},onInput:()=>{var t;return null==(t=e.onSelectedTabIndexChange)?void 0:t.call(e,0)}}),Qe((()=>e.tab1))]}}),kt(Mi,{get isActive(){return 1===e.selectedTabIndex},get children(){return[kt(Ii,{type:"radio",get checked(){return 1===e.selectedTabIndex},name:t,onInput:()=>{var t;return null==(t=e.onSelectedTabIndexChange)?void 0:t.call(e,1)}}),Qe((()=>e.tab2))]}})]}})}))` +`,Cr((e=>{const t="tabBar"+Math.floor(1e4*Math.random());return kt(Ei,{get class(){return e.class},"data-tc-tab-bar":"true",get children(){return[kt(Ii,{get right(){return 1===e.selectedTabIndex}}),kt(Mi,{get isActive(){return 0===e.selectedTabIndex},get children(){return[kt(Pi,{type:"radio",name:t,get checked(){return 0===e.selectedTabIndex},onInput:()=>{var t;return null==(t=e.onSelectedTabIndexChange)?void 0:t.call(e,0)}}),Qe((()=>e.tab1))]}}),kt(Mi,{get isActive(){return 1===e.selectedTabIndex},get children(){return[kt(Pi,{type:"radio",get checked(){return 1===e.selectedTabIndex},name:t,onInput:()=>{var t;return null==(t=e.onSelectedTabIndexChange)?void 0:t.call(e,1)}}),Qe((()=>e.tab2))]}})]}})}))` margin: 0 auto 22px; `;const[Ga,Ya]=bn({buttonRootId:null,language:"en",returnStrategy:"back",twaReturnUrl:void 0,walletsListConfiguration:{},enableAndroidBackHandler:!0});function Qa(e){return"jsBridgeKey"in e?Ee(Be({},e),{injected:oe.isWalletInjected(e.jsBridgeKey),embedded:oe.isInsideWalletBrowser(e.jsBridgeKey)}):e}function Ja(e,t){var r,n,i,o;return t?((null==(r=t.includeWallets)?void 0:r.length)&&(n="name",i=e,o=t.includeWallets.map(Qa),e=i.map((e=>{const t=o.find((t=>t[n]===e[n]));return o=o.filter((t=>t[n]!==e[n])),void 0===t?e:t})).concat(o)),e):e}function Xa(e){return e.platforms.some((e=>["macos","linux","windows"].includes(e)))}function el(e){return e.platforms.some((e=>["ios","android"].includes(e)))}function tl(e){return e.platforms.some((e=>["chrome","firefox","safari"].includes(e)))}function rl(e,t){return!!t&&(e.name.toLowerCase()===t.toLowerCase()||e.appName.toLowerCase()===t.toLowerCase())}const nl=Cr.div` display: flex; @@ -679,7 +679,7 @@ left: 16px; `,al=Cr(ms)` height: 100%; -`,ll=$t("
  • "),cl=e=>kt(nl,{"data-tc-wallets-modal-list":"true",get children(){return[kt(sl,{icon:"arrow",onClick:()=>e.onBack()}),kt(il,{translationKey:"walletModal.wallets",children:"Wallets"}),kt(xs,{get maxHeight(){return Cs()?void 0:510},get children(){return kt(ol,{get children(){return kt(Pt,{get each(){return Cs()?e.walletsList.filter(el):e.walletsList},children:t=>(()=>{const r=ll.cloneNode(!0);return Ht(r,kt(al,{wallet:t,onClick:()=>e.onSelect(t)})),r})()})}})}})]}}),dl={m:"16px",s:"12px",none:"0"},ul={m:"6px",s:"6px",none:"0"},hl=Cr.div` +`,ll=$t("
  • "),cl=e=>kt(nl,{"data-tc-wallets-modal-list":"true",get children(){return[kt(sl,{icon:"arrow",onClick:()=>e.onBack()}),kt(il,{translationKey:"walletModal.wallets",children:"Wallets"}),kt(xs,{get maxHeight(){return Cs()?void 0:510},get children(){return kt(ol,{get children(){return kt(It,{get each(){return Cs()?e.walletsList.filter(el):e.walletsList},children:t=>(()=>{const r=ll.cloneNode(!0);return Ht(r,kt(al,{wallet:t,onClick:()=>e.onSelect(t)})),r})()})}})}})]}}),dl={m:"16px",s:"12px",none:"0"},ul={m:"6px",s:"6px",none:"0"},hl=Cr.div` display: flex; flex-direction: column; `,fl=Cr.div` @@ -729,11 +729,11 @@ border-radius: ${e=>dl[e.theme.borderRadius]}; font-size: 16px; line-height: 20px; -`,Al=Cr(Pn)` +`,Al=Cr(In)` width: 32px; height: 32px; border-radius: ${e=>ul[e.theme.borderRadius]}; -`,Sl=e=>{const[t]=Gi();return Qe((()=>{var r;return t(e.translationKey,e.translationValues,null==(r=e.children)?void 0:r.toString())}))};function Bl(e,t){let r;r="string"==typeof t?t:On()?t.twaReturnUrl||t.returnStrategy:"none";const n=function(e,t,r){const n=new URL(e);return n.searchParams.append("ret",r),n.toString()}(e,0,r);if(!L(e))return n;const i=n.slice(n.lastIndexOf("&")+1);return n.slice(0,n.lastIndexOf("&"))+"-"+z(i)}function El(e,t){t=Be({},t);const r=function(e){const t=new URL(e);return t.searchParams.has("attach")&&(t.searchParams.delete("attach"),t.pathname+="/start"),t.toString()}(e),n=new URL(r);if(n.searchParams.has("startapp")||n.searchParams.append("startapp","tonconnect"),On())Tn("ios","android")?(t.returnStrategy="back",t.twaReturnUrl=void 0,jn(Bl(n.toString(),t))):Tn("macos","tdesktop")||Tn("weba")?jn(Bl(n.toString(),t)):Tn("web")?(t.returnStrategy="back",t.twaReturnUrl=void 0,jn(Bl(n.toString(),t))):Tr(Bl(n.toString(),t));else if(Dr("ios","android"))t.returnStrategy="none",Tr(Bl(n.toString(),t.returnStrategy));else if(Dr("macos","windows","linux"))if(t.returnStrategy="none",t.twaReturnUrl=void 0,t.forceRedirect)Tr(Bl(n.toString(),t));else{const e=Bl(n.toString(),t),r=function(e){const t=new URL(e),[,r,n]=t.pathname.split("/");return`tg://resolve?domain=${r}&appname=${n}&startapp=${t.searchParams.get("startapp")}`}(e);Or(r,(()=>Tr(e)))}else Tr(Bl(n.toString(),t))}let Pl=0;const Il=e=>{const[t,r]=Ze("mobile"),[n,i]=Ze(!1),[o,s]=Ze(),[a,l]=Ze(!0),c=nt(rn);et(c.onStatusChange((()=>{}),(()=>{e.wallet.appName!==fs&&i(!0)})));const d=()=>{s(c.connect({universalLink:e.wallet.universalLink,bridgeUrl:e.wallet.bridgeUrl},e.additionalRequest))};Ye((()=>{"extension"!==Xe(t)&&(el(e.wallet)||Xa(e.wallet))&&d()}));const u=()=>{i(!1),"extension"===t()&&d(),r("mobile"),Qr(Ee(Be({},e.wallet),{openMethod:"qrcode"}))},h=()=>{i(!1),"extension"===t()&&d(),r("desktop");const n=Bl(o(),Ga.returnStrategy),s=$r("safari")&&Pl>=1;e.wallet.deepLink&&!s?(Pl++,Qr(Ee(Be({},e.wallet),{openMethod:"custom-deeplink"})),Or(function(e,t){return t+new URL(e).search}(n,e.wallet.deepLink),(()=>{Qr(Ee(Be({},e.wallet),{openMethod:"universal-link"})),Tr(n)}))):(Qr(Ee(Be({},e.wallet),{openMethod:"universal-link"})),Tr(n))},f=()=>{const t=!a();l(!1),Qr(Ee(Be({},e.wallet),{openMethod:"universal-link"})),El(o(),{returnStrategy:Ga.returnStrategy,twaReturnUrl:Ga.twaReturnUrl,forceRedirect:t})},p=()=>{i(!1),r("extension"),X(e.wallet)&&(Qr(e.wallet),c.connect({jsBridgeKey:e.wallet.jsBridgeKey},e.additionalRequest))};return el(e.wallet)?u():tl(e.wallet)?p():h(),kt(hl,{"data-tc-wallets-modal-connection-desktop":"true",get children(){return[kt(yl,{icon:"arrow",onClick:()=>e.onBackClick()}),kt(gl,{get children(){return e.wallet.name}}),kt(It,{get when(){return"mobile"===t()},get children(){return kt(ml,{translationKey:"walletModal.desktopConnectionModal.scanQR",get translationValues(){return{name:e.wallet.name}},get children(){return["Scan the QR code below with your phone’s or ",Qe((()=>e.wallet.name)),"’s camera"]}})}}),kt(fl,{get qr(){return"mobile"===t()},get children(){return kt(Mt,{get children(){return[kt(Ut,{get when(){return"mobile"===t()},get children(){return kt(pl,{disableCopy:!1,get sourceUrl(){return Bl(o(),"none")},get imageUrl(){return e.wallet.imageUrl}})}}),kt(Ut,{get when(){return n()},get children(){return[kt(_l,{size:"s"}),kt(kl,{translationKey:"walletModal.desktopConnectionModal.connectionDeclined",children:"Connection declined"}),kt(bl,{get children(){return kt(Yn,{get leftIcon(){return kt(Ko,{})},get onClick(){return"extension"===t()?p:h},get children(){return kt(Sl,{translationKey:"common.retry",children:"Retry"})}})}})]}}),kt(Ut,{get when(){return"extension"===t()},get children(){return[kt(It,{get when(){return X(e.wallet)},get children(){return[kt(Cl,{size:"s"}),kt(kl,{translationKey:"walletModal.desktopConnectionModal.continueInExtension",get translationValues(){return{name:e.wallet.name}},get children(){return["Continue in ",Qe((()=>e.wallet.name))," browser extension…"]}}),kt(bl,{get children(){return kt(Yn,{get leftIcon(){return kt(Ko,{})},onClick:p,get children(){return kt(Sl,{translationKey:"common.retry",children:"Retry"})}})}})]}}),kt(It,{get when(){return!X(e.wallet)},get children(){return[kt(kl,{translationKey:"walletModal.desktopConnectionModal.dontHaveExtension",get translationValues(){return{name:e.wallet.name}},get children(){return["Seems you don't have installed ",Qe((()=>e.wallet.name))," browser extension"]}}),kt(bl,{get children(){return kt(Ss,{get href(){return e.wallet.aboutUrl},blank:!0,get children(){return kt(Yn,{get rightIcon(){return kt(qo,{})},onClick:p,get children(){return kt(Sl,{translationKey:"walletModal.desktopConnectionModal.getWallet",get translationValues(){return{name:e.wallet.name}},get children(){return["Get ",Qe((()=>e.wallet.name))]}})}})}})}})]}})]}}),kt(Ut,{get when(){return"desktop"===t()},get children(){return[kt(Mo,{size:"m"}),kt(kl,{translationKey:"walletModal.desktopConnectionModal.continueOnDesktop",get translationValues(){return{name:e.wallet.name}},get children(){return["Continue in ",Qe((()=>e.wallet.name))," on desktop…"]}}),kt(bl,{get children(){return[kt(Yn,{get leftIcon(){return kt(Ko,{})},onClick:h,get children(){return kt(Sl,{translationKey:"common.retry",children:"Retry"})}}),kt(Ss,{get href(){return e.wallet.aboutUrl},blank:!0,get children(){return kt(Yn,{get rightIcon(){return kt(qo,{})},get children(){return kt(Sl,{translationKey:"walletModal.desktopConnectionModal.getWallet",get translationValues(){return{name:e.wallet.name}},get children(){return["Get ",Qe((()=>e.wallet.name))]}})}})}})]}})]}})]}})}}),kt(It,{get when(){return e.wallet.appName===fs},get children(){return kt(xl,{get rightIcon(){return kt(Al,{get src(){return gs}})},scale:"s",onClick:f,get children(){return kt(Sl,{translationKey:"walletModal.desktopConnectionModal.openWalletOnTelegram",children:"Open Wallet in Telegram on desktop"})}})}}),kt(It,{get when(){return e.wallet.appName!==fs},get children(){return kt(wl,{get children(){return[kt(It,{get when(){return Qe((()=>"mobile"!==t()))()&&el(e.wallet)},get children(){return kt(vl,{appearance:"secondary",get leftIcon(){return kt(No,{})},onClick:u,get children(){return kt(Sl,{translationKey:"common.mobile",children:"Mobile"})}})}}),kt(It,{get when(){return Qe((()=>"extension"!==t()))()&&tl(e.wallet)},get children(){return kt(vl,{appearance:"secondary",get leftIcon(){return kt(Lo,{})},onClick:p,get children(){return kt(Sl,{translationKey:"common.browserExtension",children:"Browser Extension"})}})}}),kt(It,{get when(){return Qe((()=>"desktop"!==t()))()&&Xa(e.wallet)},get children(){return kt(vl,{appearance:"secondary",get leftIcon(){return kt($o,{})},onClick:h,get children(){return kt(Sl,{translationKey:"common.desktop",children:"Desktop"})}})}})]}})}})]}})},Ml=Cr.div``,Ul=Cr(ci)` +`,Sl=e=>{const[t]=Gi();return Qe((()=>{var r;return t(e.translationKey,e.translationValues,null==(r=e.children)?void 0:r.toString())}))};function Bl(e,t){let r;r="string"==typeof t?t:On()?t.twaReturnUrl||t.returnStrategy:"none";const n=function(e,t,r){const n=new URL(e);return n.searchParams.append("ret",r),n.toString()}(e,0,r);if(!L(e))return n;const i=n.slice(n.lastIndexOf("&")+1);return n.slice(0,n.lastIndexOf("&"))+"-"+z(i)}function El(e,t){t=Be({},t);const r=function(e){const t=new URL(e);return t.searchParams.has("attach")&&(t.searchParams.delete("attach"),t.pathname+="/start"),t.toString()}(e),n=new URL(r);if(n.searchParams.has("startapp")||n.searchParams.append("startapp","tonconnect"),On())Tn("ios","android")?(t.returnStrategy="back",t.twaReturnUrl=void 0,jn(Bl(n.toString(),t))):Tn("macos","tdesktop")||Tn("weba")?jn(Bl(n.toString(),t)):Tn("web")?(t.returnStrategy="back",t.twaReturnUrl=void 0,jn(Bl(n.toString(),t))):Tr(Bl(n.toString(),t));else if(Dr("ios","android"))t.returnStrategy="none",Tr(Bl(n.toString(),t.returnStrategy));else if(Dr("macos","windows","linux"))if(t.returnStrategy="none",t.twaReturnUrl=void 0,t.forceRedirect)Tr(Bl(n.toString(),t));else{const e=Bl(n.toString(),t),r=function(e){const t=new URL(e),[,r,n]=t.pathname.split("/");return`tg://resolve?domain=${r}&appname=${n}&startapp=${t.searchParams.get("startapp")}`}(e);Or(r,(()=>Tr(e)))}else Tr(Bl(n.toString(),t))}let Il=0;const Pl=e=>{const[t,r]=Ze("mobile"),[n,i]=Ze(!1),[o,s]=Ze(),[a,l]=Ze(!0),c=nt(rn);et(c.onStatusChange((()=>{}),(()=>{e.wallet.appName!==fs&&i(!0)})));const d=()=>{s(c.connect({universalLink:e.wallet.universalLink,bridgeUrl:e.wallet.bridgeUrl},e.additionalRequest))};Ye((()=>{"extension"!==Xe(t)&&(el(e.wallet)||Xa(e.wallet))&&d()}));const u=()=>{i(!1),"extension"===t()&&d(),r("mobile"),Qr(Ee(Be({},e.wallet),{openMethod:"qrcode"}))},h=()=>{i(!1),"extension"===t()&&d(),r("desktop");const n=Bl(o(),Ga.returnStrategy),s=$r("safari")&&Il>=1;e.wallet.deepLink&&!s?(Il++,Qr(Ee(Be({},e.wallet),{openMethod:"custom-deeplink"})),Or(function(e,t){return t+new URL(e).search}(n,e.wallet.deepLink),(()=>{Qr(Ee(Be({},e.wallet),{openMethod:"universal-link"})),Tr(n)}))):(Qr(Ee(Be({},e.wallet),{openMethod:"universal-link"})),Tr(n))},f=()=>{const t=!a();l(!1),Qr(Ee(Be({},e.wallet),{openMethod:"universal-link"})),El(o(),{returnStrategy:Ga.returnStrategy,twaReturnUrl:Ga.twaReturnUrl,forceRedirect:t})},p=()=>{i(!1),r("extension"),X(e.wallet)&&(Qr(e.wallet),c.connect({jsBridgeKey:e.wallet.jsBridgeKey},e.additionalRequest))};return el(e.wallet)?u():tl(e.wallet)?p():h(),kt(hl,{"data-tc-wallets-modal-connection-desktop":"true",get children(){return[kt(yl,{icon:"arrow",onClick:()=>e.onBackClick()}),kt(gl,{get children(){return e.wallet.name}}),kt(Pt,{get when(){return"mobile"===t()},get children(){return kt(ml,{translationKey:"walletModal.desktopConnectionModal.scanQR",get translationValues(){return{name:e.wallet.name}},get children(){return["Scan the QR code below with your phone’s or ",Qe((()=>e.wallet.name)),"’s camera"]}})}}),kt(fl,{get qr(){return"mobile"===t()},get children(){return kt(Mt,{get children(){return[kt(Ut,{get when(){return"mobile"===t()},get children(){return kt(pl,{disableCopy:!1,get sourceUrl(){return Bl(o(),"none")},get imageUrl(){return e.wallet.imageUrl}})}}),kt(Ut,{get when(){return n()},get children(){return[kt(_l,{size:"s"}),kt(kl,{translationKey:"walletModal.desktopConnectionModal.connectionDeclined",children:"Connection declined"}),kt(bl,{get children(){return kt(Yn,{get leftIcon(){return kt(Ko,{})},get onClick(){return"extension"===t()?p:h},get children(){return kt(Sl,{translationKey:"common.retry",children:"Retry"})}})}})]}}),kt(Ut,{get when(){return"extension"===t()},get children(){return[kt(Pt,{get when(){return X(e.wallet)},get children(){return[kt(Cl,{size:"s"}),kt(kl,{translationKey:"walletModal.desktopConnectionModal.continueInExtension",get translationValues(){return{name:e.wallet.name}},get children(){return["Continue in ",Qe((()=>e.wallet.name))," browser extension…"]}}),kt(bl,{get children(){return kt(Yn,{get leftIcon(){return kt(Ko,{})},onClick:p,get children(){return kt(Sl,{translationKey:"common.retry",children:"Retry"})}})}})]}}),kt(Pt,{get when(){return!X(e.wallet)},get children(){return[kt(kl,{translationKey:"walletModal.desktopConnectionModal.dontHaveExtension",get translationValues(){return{name:e.wallet.name}},get children(){return["Seems you don't have installed ",Qe((()=>e.wallet.name))," browser extension"]}}),kt(bl,{get children(){return kt(Ss,{get href(){return e.wallet.aboutUrl},blank:!0,get children(){return kt(Yn,{get rightIcon(){return kt(qo,{})},onClick:p,get children(){return kt(Sl,{translationKey:"walletModal.desktopConnectionModal.getWallet",get translationValues(){return{name:e.wallet.name}},get children(){return["Get ",Qe((()=>e.wallet.name))]}})}})}})}})]}})]}}),kt(Ut,{get when(){return"desktop"===t()},get children(){return[kt(Mo,{size:"m"}),kt(kl,{translationKey:"walletModal.desktopConnectionModal.continueOnDesktop",get translationValues(){return{name:e.wallet.name}},get children(){return["Continue in ",Qe((()=>e.wallet.name))," on desktop…"]}}),kt(bl,{get children(){return[kt(Yn,{get leftIcon(){return kt(Ko,{})},onClick:h,get children(){return kt(Sl,{translationKey:"common.retry",children:"Retry"})}}),kt(Ss,{get href(){return e.wallet.aboutUrl},blank:!0,get children(){return kt(Yn,{get rightIcon(){return kt(qo,{})},get children(){return kt(Sl,{translationKey:"walletModal.desktopConnectionModal.getWallet",get translationValues(){return{name:e.wallet.name}},get children(){return["Get ",Qe((()=>e.wallet.name))]}})}})}})]}})]}})]}})}}),kt(Pt,{get when(){return e.wallet.appName===fs},get children(){return kt(xl,{get rightIcon(){return kt(Al,{get src(){return gs}})},scale:"s",onClick:f,get children(){return kt(Sl,{translationKey:"walletModal.desktopConnectionModal.openWalletOnTelegram",children:"Open Wallet in Telegram on desktop"})}})}}),kt(Pt,{get when(){return e.wallet.appName!==fs},get children(){return kt(wl,{get children(){return[kt(Pt,{get when(){return Qe((()=>"mobile"!==t()))()&&el(e.wallet)},get children(){return kt(vl,{appearance:"secondary",get leftIcon(){return kt(No,{})},onClick:u,get children(){return kt(Sl,{translationKey:"common.mobile",children:"Mobile"})}})}}),kt(Pt,{get when(){return Qe((()=>"extension"!==t()))()&&tl(e.wallet)},get children(){return kt(vl,{appearance:"secondary",get leftIcon(){return kt(Lo,{})},onClick:p,get children(){return kt(Sl,{translationKey:"common.browserExtension",children:"Browser Extension"})}})}}),kt(Pt,{get when(){return Qe((()=>"desktop"!==t()))()&&Xa(e.wallet)},get children(){return kt(vl,{appearance:"secondary",get leftIcon(){return kt($o,{})},onClick:h,get children(){return kt(Sl,{translationKey:"common.desktop",children:"Desktop"})}})}})]}})}})]}})},Ml=Cr.div``,Ul=Cr(ci)` position: absolute; top: 16px; left: 16px; @@ -780,7 +780,7 @@ align-items: center; gap: 12px; border-top: 0.5px solid ${e=>Br(e.theme.colors.icon.secondary,.2)}; -`,ql=Cr(Pn)` +`,ql=Cr(In)` width: 36px; height: 36px; border-radius: 10px; @@ -809,7 +809,7 @@ min-height: 44px; `,Xl=Cr.div` padding: 0 24px 24px; -`,ec=e=>[kt(Ql,{get children(){return e.walletInfo.name}}),kt(Jl,{translationKey:"walletModal.mobileConnectionModal.scanQR",get translationValues(){return{name:e.walletInfo.name}},get children(){return["Scan the QR code below with your phone’s or ",Qe((()=>e.walletInfo.name)),"’s camera"]}}),kt(Xl,{get children(){return kt(Hi,{get imageUrl(){return e.walletInfo.imageUrl},get sourceUrl(){return Bl(e.universalLink,"none")},disableCopy:!0})}})],tc=e=>{const t=wr(),[r,n]=Ze(!1),[i,o]=Ze(!1),s=nt(rn),a=s.onStatusChange((()=>{}),(()=>{o(!0)})),l=Qe((()=>s.connect({universalLink:e.wallet.universalLink,bridgeUrl:e.wallet.bridgeUrl},e.additionalRequest))),c=()=>{o(!1),Qr(Ee(Be({},e.wallet),{openMethod:"universal-link"})),Tr(Bl(l(),Ga.returnStrategy))},d=()=>{o(!1),n(!0),Qr(Ee(Be({},e.wallet),{openMethod:"qrcode"}))},u=()=>{r()?(n(!1),Qr(Ee(Be({},e.wallet),{openMethod:"universal-link"}))):e.onBackClick()};return et(a),c(),kt(Dl,{"data-tc-wallets-modal-connection-mobile":"true",get children(){return[kt(Kl,{icon:"arrow",onClick:u}),kt(It,{get when(){return r()},get children(){return kt(ec,{get universalLink(){return l()},get walletInfo(){return e.wallet}})}}),kt(It,{get when(){return!r()},get children(){return[kt(Fl,{get children(){return e.wallet.name}}),kt($l,{get children(){return[kt(It,{get when(){return i()},get children(){return[kt(Wl,{size:"s"}),kt(Gl,{translationKey:"walletModal.mobileConnectionModal.connectionDeclined",children:"Connection declined"}),kt(Yl,{get children(){return[kt(Yn,{get leftIcon(){return kt(Ko,{})},onClick:c,get children(){return kt(Sl,{translationKey:"common.retry",children:"Retry"})}}),kt(Yn,{get leftIcon(){return kt(as,{get fill(){return t.colors.accent}})},onClick:d,get children(){return kt(Sl,{translationKey:"walletModal.mobileConnectionModal.showQR",children:"Show QR Code"})}})]}})]}}),kt(It,{get when(){return!i()},get children(){return[kt(Zl,{size:"s"}),kt(Gl,{translationKey:"walletModal.mobileConnectionModal.continueIn",get translationValues(){return{name:e.wallet.name}},get children(){return["Continue in ",Qe((()=>e.wallet.name)),"…"]}}),kt(Yl,{get children(){return[kt(Yn,{get leftIcon(){return kt(Ko,{})},onClick:c,get children(){return kt(Sl,{translationKey:"common.retry",children:"Retry"})}}),kt(Yn,{get leftIcon(){return kt(as,{get fill(){return t.colors.accent}})},onClick:d,get children(){return kt(Sl,{translationKey:"walletModal.mobileConnectionModal.showQR",children:"Show QR Code"})}})]}})]}})]}}),kt(Vl,{get children(){return[kt(ql,{get src(){return e.wallet.imageUrl}}),kt(go,{get children(){return e.wallet.name}}),kt(Hl,{get href(){return e.wallet.aboutUrl},blank:!0,get children(){return kt(Yn,{get children(){return kt(Sl,{translationKey:"common.get",children:"GET"})}})}})]}})]}})]}})},rc={m:"16px",s:"12px",none:"0"},nc={m:"6px",s:"6px",none:"0"},ic=Cr.ul` +`,ec=e=>[kt(Ql,{get children(){return e.walletInfo.name}}),kt(Jl,{translationKey:"walletModal.mobileConnectionModal.scanQR",get translationValues(){return{name:e.walletInfo.name}},get children(){return["Scan the QR code below with your phone’s or ",Qe((()=>e.walletInfo.name)),"’s camera"]}}),kt(Xl,{get children(){return kt(Hi,{get imageUrl(){return e.walletInfo.imageUrl},get sourceUrl(){return Bl(e.universalLink,"none")},disableCopy:!0})}})],tc=e=>{const t=wr(),[r,n]=Ze(!1),[i,o]=Ze(!1),s=nt(rn),a=s.onStatusChange((()=>{}),(()=>{o(!0)})),l=Qe((()=>s.connect({universalLink:e.wallet.universalLink,bridgeUrl:e.wallet.bridgeUrl},e.additionalRequest))),c=()=>{o(!1),Qr(Ee(Be({},e.wallet),{openMethod:"universal-link"})),Tr(Bl(l(),Ga.returnStrategy))},d=()=>{o(!1),n(!0),Qr(Ee(Be({},e.wallet),{openMethod:"qrcode"}))},u=()=>{r()?(n(!1),Qr(Ee(Be({},e.wallet),{openMethod:"universal-link"}))):e.onBackClick()};return et(a),c(),kt(Dl,{"data-tc-wallets-modal-connection-mobile":"true",get children(){return[kt(Kl,{icon:"arrow",onClick:u}),kt(Pt,{get when(){return r()},get children(){return kt(ec,{get universalLink(){return l()},get walletInfo(){return e.wallet}})}}),kt(Pt,{get when(){return!r()},get children(){return[kt(Fl,{get children(){return e.wallet.name}}),kt($l,{get children(){return[kt(Pt,{get when(){return i()},get children(){return[kt(Wl,{size:"s"}),kt(Gl,{translationKey:"walletModal.mobileConnectionModal.connectionDeclined",children:"Connection declined"}),kt(Yl,{get children(){return[kt(Yn,{get leftIcon(){return kt(Ko,{})},onClick:c,get children(){return kt(Sl,{translationKey:"common.retry",children:"Retry"})}}),kt(Yn,{get leftIcon(){return kt(as,{get fill(){return t.colors.accent}})},onClick:d,get children(){return kt(Sl,{translationKey:"walletModal.mobileConnectionModal.showQR",children:"Show QR Code"})}})]}})]}}),kt(Pt,{get when(){return!i()},get children(){return[kt(Zl,{size:"s"}),kt(Gl,{translationKey:"walletModal.mobileConnectionModal.continueIn",get translationValues(){return{name:e.wallet.name}},get children(){return["Continue in ",Qe((()=>e.wallet.name)),"…"]}}),kt(Yl,{get children(){return[kt(Yn,{get leftIcon(){return kt(Ko,{})},onClick:c,get children(){return kt(Sl,{translationKey:"common.retry",children:"Retry"})}}),kt(Yn,{get leftIcon(){return kt(as,{get fill(){return t.colors.accent}})},onClick:d,get children(){return kt(Sl,{translationKey:"walletModal.mobileConnectionModal.showQR",children:"Show QR Code"})}})]}})]}})]}}),kt(Vl,{get children(){return[kt(ql,{get src(){return e.wallet.imageUrl}}),kt(go,{get children(){return e.wallet.name}}),kt(Hl,{get href(){return e.wallet.aboutUrl},blank:!0,get children(){return kt(Yn,{get children(){return kt(Sl,{translationKey:"common.get",children:"GET"})}})}})]}})]}})]}})},rc={m:"16px",s:"12px",none:"0"},nc={m:"6px",s:"6px",none:"0"},ic=Cr.ul` display: flex; justify-content: space-between; margin: 0 auto; @@ -901,7 +901,7 @@ font-weight: 590; font-size: 16px; line-height: 20px; -`,uc=Cr(Pn)` +`,uc=Cr(In)` border-radius: ${e=>nc[e.theme.borderRadius]}; width: 24px; height: 24px; @@ -917,7 +917,7 @@ padding: 0 64px; `,gc=Cr.div` padding: 0 24px 24px; -`,mc=e=>[kt(fc,{translationKey:"walletModal.mobileUniversalModal.connectYourWallet",children:"Connect your wallet"}),kt(pc,{translationKey:"walletModal.mobileUniversalModal.scan",children:"Scan with your mobile wallet"}),kt(gc,{get children(){return kt(Hi,{get imageUrl(){return ps},get sourceUrl(){return Bl(e.universalLink,"none")},disableCopy:!0})}})],yc=$t("
  • "),bc=$t('
    '),wc=e=>{const[t,r]=Ze(!1),[n,i]=Ze(!0),o=Ga.connector,s=()=>e.walletsList.filter((e=>el(e)&&e.appName!==fs)),a=()=>s().length>7,l=()=>o.connect([...new Set(e.walletsList.filter(te).map((e=>e.bridgeUrl))).values()].map((e=>({bridgeUrl:e}))),e.additionalRequest);Qr({openMethod:"universal-link"});const[c,d]=Ze(void 0),u=()=>Ie(void 0,null,(function*(){void 0!==c()&&clearTimeout(c()),yield Vi(l());const e=setTimeout((()=>d(void 0)),1500);d(e)})),h=()=>{Tr(Bl(l(),Ga.returnStrategy))},f=()=>{const t=e.walletsList.find((e=>e.appName===fs));if(!t||!te(t))throw new Mr("@wallet bot not found in the wallets list");const r=o.connect({bridgeUrl:t.bridgeUrl,universalLink:t.universalLink},e.additionalRequest),s=!n();i(!1),El(r,{returnStrategy:Ga.returnStrategy,twaReturnUrl:Ga.twaReturnUrl,forceRedirect:s})},p=()=>{r(!0),Qr({openMethod:"qrcode"})},g=()=>{r(!1),Qr({openMethod:"universal-link"})};return(()=>{const r=bc.cloneNode(!0);return Ht(r,kt(It,{get when(){return t()},get children(){return[kt(hc,{icon:"arrow",onClick:g}),kt(mc,{get universalLink(){return l()}})]}}),null),Ht(r,kt(It,{get when(){return!t()},get children(){return[kt(hc,{get icon(){return kt(as,{})},onClick:p}),kt(lc,{translationKey:"walletModal.mobileUniversalModal.connectYourWallet",children:"Connect your wallet"}),kt(cc,{translationKey:"walletModal.mobileUniversalModal.openWalletOnTelegramOrSelect",children:"Open Wallet in Telegram or select your wallet to connect"}),kt(dc,{get leftIcon(){return kt(ts,{})},get rightIcon(){return kt(uc,{get src(){return gs}})},onClick:f,scale:"s",get children(){return kt(Sl,{translationKey:"walletModal.mobileUniversalModal.openWalletOnTelegram",children:"Open Wallet in Telegram"})}}),kt(ic,{get children(){return[kt(Pt,{get each(){return Qe((()=>!!a()))()?s().slice(0,4):s()},children:t=>(()=>{const r=yc.cloneNode(!0);return Ht(r,kt(lo,{get icon(){return t.imageUrl},get name(){return t.name},onClick:()=>e.onSelect(t)})),r})()}),kt(It,{get when(){return a()},get children(){const t=yc.cloneNode(!0);return Ht(t,kt(hs,{labelLine1:"View all",labelLine2:"wallets",get images(){return s().slice(3,7).map((e=>e.imageUrl))},onClick:()=>e.onSelectAllWallets()})),t}}),kt(sc,{children:" "}),kt(oc,{onClick:h,get children(){return[kt(ac,{get children(){return kt(yo,{})}}),kt(Qi,{fontWeight:590,translationKey:"walletModal.mobileUniversalModal.openLink",children:"Open Link"})]}}),kt(oc,{onClick:u,get children(){return[kt(ac,{get children(){return Qe((()=>void 0!==c()))()?kt(ns,{}):kt(os,{})}}),kt(Qi,{fontWeight:590,get translationKey(){return void 0!==c()?"common.copied":"common.copyLink"},get children(){return void 0!==c()?"Copied":"Copy Link"}})]}})]}})]}}),null),r})()},vc={m:"16px",s:"8px",none:"0"},Cc={m:"8px",s:"4px",none:"0"},_c=Cr.div` +`,mc=e=>[kt(fc,{translationKey:"walletModal.mobileUniversalModal.connectYourWallet",children:"Connect your wallet"}),kt(pc,{translationKey:"walletModal.mobileUniversalModal.scan",children:"Scan with your mobile wallet"}),kt(gc,{get children(){return kt(Hi,{get imageUrl(){return ps},get sourceUrl(){return Bl(e.universalLink,"none")},disableCopy:!0})}})],yc=$t("
  • "),bc=$t('
    '),wc=e=>{const[t,r]=Ze(!1),[n,i]=Ze(!0),o=Ga.connector,s=()=>e.walletsList.filter((e=>el(e)&&e.appName!==fs)),a=()=>s().length>7,l=()=>o.connect([...new Set(e.walletsList.filter(te).map((e=>e.bridgeUrl))).values()].map((e=>({bridgeUrl:e}))),e.additionalRequest);Qr({openMethod:"universal-link"});const[c,d]=Ze(void 0),u=()=>Pe(void 0,null,(function*(){void 0!==c()&&clearTimeout(c()),yield Vi(l());const e=setTimeout((()=>d(void 0)),1500);d(e)})),h=()=>{Tr(Bl(l(),Ga.returnStrategy))},f=()=>{const t=e.walletsList.find((e=>e.appName===fs));if(!t||!te(t))throw new Mr("@wallet bot not found in the wallets list");const r=o.connect({bridgeUrl:t.bridgeUrl,universalLink:t.universalLink},e.additionalRequest),s=!n();i(!1),El(r,{returnStrategy:Ga.returnStrategy,twaReturnUrl:Ga.twaReturnUrl,forceRedirect:s})},p=()=>{r(!0),Qr({openMethod:"qrcode"})},g=()=>{r(!1),Qr({openMethod:"universal-link"})};return(()=>{const r=bc.cloneNode(!0);return Ht(r,kt(Pt,{get when(){return t()},get children(){return[kt(hc,{icon:"arrow",onClick:g}),kt(mc,{get universalLink(){return l()}})]}}),null),Ht(r,kt(Pt,{get when(){return!t()},get children(){return[kt(hc,{get icon(){return kt(as,{})},onClick:p}),kt(lc,{translationKey:"walletModal.mobileUniversalModal.connectYourWallet",children:"Connect your wallet"}),kt(cc,{translationKey:"walletModal.mobileUniversalModal.openWalletOnTelegramOrSelect",children:"Open Wallet in Telegram or select your wallet to connect"}),kt(dc,{get leftIcon(){return kt(ts,{})},get rightIcon(){return kt(uc,{get src(){return gs}})},onClick:f,scale:"s",get children(){return kt(Sl,{translationKey:"walletModal.mobileUniversalModal.openWalletOnTelegram",children:"Open Wallet in Telegram"})}}),kt(ic,{get children(){return[kt(It,{get each(){return Qe((()=>!!a()))()?s().slice(0,4):s()},children:t=>(()=>{const r=yc.cloneNode(!0);return Ht(r,kt(lo,{get icon(){return t.imageUrl},get name(){return t.name},onClick:()=>e.onSelect(t)})),r})()}),kt(Pt,{get when(){return a()},get children(){const t=yc.cloneNode(!0);return Ht(t,kt(hs,{labelLine1:"View all",labelLine2:"wallets",get images(){return s().slice(3,7).map((e=>e.imageUrl))},onClick:()=>e.onSelectAllWallets()})),t}}),kt(sc,{children:" "}),kt(oc,{onClick:h,get children(){return[kt(ac,{get children(){return kt(yo,{})}}),kt(Qi,{fontWeight:590,translationKey:"walletModal.mobileUniversalModal.openLink",children:"Open Link"})]}}),kt(oc,{onClick:u,get children(){return[kt(ac,{get children(){return Qe((()=>void 0!==c()))()?kt(ns,{}):kt(os,{})}}),kt(Qi,{fontWeight:590,get translationKey(){return void 0!==c()?"common.copied":"common.copyLink"},get children(){return void 0!==c()?"Copied":"Copy Link"}})]}})]}})]}}),null),r})()},vc={m:"16px",s:"8px",none:"0"},Cc={m:"8px",s:"4px",none:"0"},_c=Cr.div` display: flex; flex-direction: column; align-items: center; @@ -983,7 +983,7 @@ &:active { transform: scale(0.96); } -`,Cr(Pn)` +`,Cr(In)` width: 24px; height: 24px; @@ -998,7 +998,7 @@ `,Cr(Qi)` color: ${e=>e.theme.colors.text.secondary}; font-size: 16px; -`;const Bc=$t("
  • "),Ec=e=>{const[t,r]=Ze(!1),n=Ga.connector;Qr({openMethod:"qrcode"});const i=Qe((()=>n.connect([...new Set(e.walletsList.filter(te).map((e=>e.bridgeUrl))).values()].map((e=>({bridgeUrl:e}))),e.additionalRequest)));return kt(_c,{onClick:()=>r(!1),"data-tc-wallets-modal-universal-desktop":"true",get children(){return[kt(uo,{translationKey:"walletModal.desktopUniversalModal.connectYourWallet",children:"Connect your wallet"}),kt(kc,{translationKey:"walletModal.desktopUniversalModal.scan",children:"Scan with your mobile wallet"}),kt(Ac,{get sourceUrl(){return Bl(i(),"none")},get disableCopy(){return t()},get imageUrl(){return ps}}),kt(xc,{translationKey:"walletModal.desktopUniversalModal.availableWallets",children:"Available wallets"}),kt(Sc,{get children(){return[kt(Pt,{get each(){return e.walletsList.slice(0,3)},children:t=>(()=>{const r=Bc.cloneNode(!0);return Ht(r,kt(ms,{wallet:t,onClick:()=>e.onSelect(t)})),r})()}),kt(hs,{labelLine1:"View all",labelLine2:"wallets",get images(){return e.walletsList.slice(3,7).map((e=>e.imageUrl))},onClick:()=>e.onSelectAllWallets()})]}})]}})},Pc=()=>{const{locale:e}=Gi()[1];Ye((()=>e(Ga.language))),Ye((()=>{Zr()&&ks()}));const t=nt(rn),r=nt(Bs),[n]=function(e,t,r){let n,i,o;2===arguments.length&&"object"==typeof t||1===arguments.length?(n=!0,i=e,o=t||{}):(n=e,i=t,o=r||{});let s=null,a=Ne,l=null,c=!1,d="initialValue"in o,u="function"==typeof n&&Qe(n);const h=new Set,[f,p]=(o.storage||Ze)(o.initialValue),[g,m]=Ze(void 0),[y,b]=Ze(void 0,{equals:!1}),[w,v]=Ze(d?"ready":"unresolved");if(Me.context){let e;l=`${Me.context.id}${Me.context.count++}`,"initial"===o.ssrLoadFrom?a=o.initialValue:Me.load&&(e=Me.load(l))&&(a=e[0])}function C(e,t,r,n){return s===e&&(s=null,d=!0,e!==a&&t!==a||!o.onHydrated||queueMicrotask((()=>o.onHydrated(n,{value:t}))),a=Ne,function(e,t){dt((()=>{void 0===t&&p((()=>e)),v(void 0!==t?"errored":"ready"),m(t);for(const e of h.keys())e.decrement();h.clear()}),!1)}(t,r)),t}function _(){const e=f(),t=g();if(void 0!==t&&!s)throw t;return Fe&&Fe.user,e}function k(e=!0){if(!1!==e&&c)return;c=!1;const t=u?u():n;if(null==t||!1===t)return void C(s,Xe(f));const r=a!==Ne?a:Xe((()=>i(t,{value:f(),refetching:e})));return"object"==typeof r&&r&&"then"in r?(s=r,c=!0,queueMicrotask((()=>c=!1)),dt((()=>{v(d?"refreshing":"pending"),b()}),!1),r.then((e=>C(r,e,void 0,t)),(e=>C(r,void 0,mt(e),t)))):(C(s,r,void 0,t),r)}return Object.defineProperties(_,{state:{get:()=>w()},error:{get:()=>g()},loading:{get(){const e=w();return"pending"===e||"refreshing"===e}},latest:{get(){if(!d)return _();const e=g();if(e&&!s)throw e;return f()}}}),u?We((()=>k(!1))):k(!1),[_,{refetch:k,mutate:p}]}((()=>r.getWallets())),[i,o]=Ze(null),[s,a]=Ze("universal"),[l,c]=Ze(!1),d=Qe((()=>{if("ready"!==n.state)return null;let e=Ja(n(),Ga.walletsListConfiguration);const t=e.filter(X),r=e.filter((e=>!X(e)));e=(t||[]).concat(r);const i=Ga.preferredWalletAppName,o=e.find((e=>rl(e,i))),s=e.filter((e=>rl(e,i))).length>=2;i&&o&&!s&&(e=[Ee(Be({},o),{isPreferred:!0})].concat(e.filter((e=>!rl(e,i)))));const a=e.find((e=>rl(e,fs)));return a&&(e=[a].concat(e.filter((e=>!rl(e,fs))))),e})),u=()=>{var e;return"loading"===(null==(e=Ga.connectRequestParameters)?void 0:e.state)},h=Qe((()=>{var e;if(!u())return null==(e=Ga.connectRequestParameters)?void 0:e.value})),f=e=>{Hr({status:"closed",closeReason:e}),o(null),c(!1)};return et(t.onStatusChange((e=>{e&&f("wallet-selected")}))),kt(Ha,{get opened(){return Zr()},get enableAndroidBackHandler(){return Ga.enableAndroidBackHandler},onClose:()=>f("action-cancelled"),onClickQuestion:()=>c((e=>!e)),"data-tc-wallets-modal-container":"true",get children(){return[kt(It,{get when(){return l()},get children(){return kt(Nl,{onBackClick:()=>c(!1)})}}),kt(It,{get when(){return!l()},get children(){return[kt(It,{get when(){return u()||!d()},get children(){return[kt(Za,{translationKey:"walletModal.loading",children:"Wallets list is loading"}),kt(Wa,{get children(){return kt(Mo,{size:"m"})}})]}}),kt(It,{get when(){return Qe((()=>!u()))()&&d()},get children(){return kt(Mt,{get children(){return[kt(Ut,{get when(){return i()},get children(){return kt(nr,{get component(){return Cs()?tc:Il},get wallet(){return i()},get additionalRequest(){return h()},onBackClick:()=>o(null)})}}),kt(Ut,{get when(){return"universal"===s()},get children(){return kt(nr,{get component(){return Cs()?wc:Ec},onSelect:o,get walletsList(){return d()},get additionalRequest(){return h()},onSelectAllWallets:()=>a("all-wallets")})}}),kt(Ut,{get when(){return"all-wallets"===s()},get children(){return kt(cl,{get walletsList(){return d()},onBack:()=>a("universal"),onSelect:o})}})]}})}})]}})]}})},Ic=Cr.div` +`;const Bc=$t("
  • "),Ec=e=>{const[t,r]=Ze(!1),n=Ga.connector;Qr({openMethod:"qrcode"});const i=Qe((()=>n.connect([...new Set(e.walletsList.filter(te).map((e=>e.bridgeUrl))).values()].map((e=>({bridgeUrl:e}))),e.additionalRequest)));return kt(_c,{onClick:()=>r(!1),"data-tc-wallets-modal-universal-desktop":"true",get children(){return[kt(uo,{translationKey:"walletModal.desktopUniversalModal.connectYourWallet",children:"Connect your wallet"}),kt(kc,{translationKey:"walletModal.desktopUniversalModal.scan",children:"Scan with your mobile wallet"}),kt(Ac,{get sourceUrl(){return Bl(i(),"none")},get disableCopy(){return t()},get imageUrl(){return ps}}),kt(xc,{translationKey:"walletModal.desktopUniversalModal.availableWallets",children:"Available wallets"}),kt(Sc,{get children(){return[kt(It,{get each(){return e.walletsList.slice(0,3)},children:t=>(()=>{const r=Bc.cloneNode(!0);return Ht(r,kt(ms,{wallet:t,onClick:()=>e.onSelect(t)})),r})()}),kt(hs,{labelLine1:"View all",labelLine2:"wallets",get images(){return e.walletsList.slice(3,7).map((e=>e.imageUrl))},onClick:()=>e.onSelectAllWallets()})]}})]}})},Ic=()=>{const{locale:e}=Gi()[1];Ye((()=>e(Ga.language))),Ye((()=>{Zr()&&ks()}));const t=nt(rn),r=nt(Bs),[n]=function(e,t,r){let n,i,o;2===arguments.length&&"object"==typeof t||1===arguments.length?(n=!0,i=e,o=t||{}):(n=e,i=t,o=r||{});let s=null,a=Ne,l=null,c=!1,d="initialValue"in o,u="function"==typeof n&&Qe(n);const h=new Set,[f,p]=(o.storage||Ze)(o.initialValue),[g,m]=Ze(void 0),[y,b]=Ze(void 0,{equals:!1}),[w,v]=Ze(d?"ready":"unresolved");if(Me.context){let e;l=`${Me.context.id}${Me.context.count++}`,"initial"===o.ssrLoadFrom?a=o.initialValue:Me.load&&(e=Me.load(l))&&(a=e[0])}function C(e,t,r,n){return s===e&&(s=null,d=!0,e!==a&&t!==a||!o.onHydrated||queueMicrotask((()=>o.onHydrated(n,{value:t}))),a=Ne,function(e,t){dt((()=>{void 0===t&&p((()=>e)),v(void 0!==t?"errored":"ready"),m(t);for(const e of h.keys())e.decrement();h.clear()}),!1)}(t,r)),t}function _(){const e=f(),t=g();if(void 0!==t&&!s)throw t;return Fe&&Fe.user,e}function k(e=!0){if(!1!==e&&c)return;c=!1;const t=u?u():n;if(null==t||!1===t)return void C(s,Xe(f));const r=a!==Ne?a:Xe((()=>i(t,{value:f(),refetching:e})));return"object"==typeof r&&r&&"then"in r?(s=r,c=!0,queueMicrotask((()=>c=!1)),dt((()=>{v(d?"refreshing":"pending"),b()}),!1),r.then((e=>C(r,e,void 0,t)),(e=>C(r,void 0,mt(e),t)))):(C(s,r,void 0,t),r)}return Object.defineProperties(_,{state:{get:()=>w()},error:{get:()=>g()},loading:{get(){const e=w();return"pending"===e||"refreshing"===e}},latest:{get(){if(!d)return _();const e=g();if(e&&!s)throw e;return f()}}}),u?We((()=>k(!1))):k(!1),[_,{refetch:k,mutate:p}]}((()=>r.getWallets())),[i,o]=Ze(null),[s,a]=Ze("universal"),[l,c]=Ze(!1),d=Qe((()=>{if("ready"!==n.state)return null;let e=Ja(n(),Ga.walletsListConfiguration);const t=e.filter(X),r=e.filter((e=>!X(e)));e=(t||[]).concat(r);const i=Ga.preferredWalletAppName,o=e.find((e=>rl(e,i))),s=e.filter((e=>rl(e,i))).length>=2;i&&o&&!s&&(e=[Ee(Be({},o),{isPreferred:!0})].concat(e.filter((e=>!rl(e,i)))));const a=e.find((e=>rl(e,fs)));return a&&(e=[a].concat(e.filter((e=>!rl(e,fs))))),e})),u=()=>{var e;return"loading"===(null==(e=Ga.connectRequestParameters)?void 0:e.state)},h=Qe((()=>{var e;if(!u())return null==(e=Ga.connectRequestParameters)?void 0:e.value})),f=e=>{Hr({status:"closed",closeReason:e}),o(null),c(!1)};return et(t.onStatusChange((e=>{e&&f("wallet-selected")}))),kt(Ha,{get opened(){return Zr()},get enableAndroidBackHandler(){return Ga.enableAndroidBackHandler},onClose:()=>f("action-cancelled"),onClickQuestion:()=>c((e=>!e)),"data-tc-wallets-modal-container":"true",get children(){return[kt(Pt,{get when(){return l()},get children(){return kt(Nl,{onBackClick:()=>c(!1)})}}),kt(Pt,{get when(){return!l()},get children(){return[kt(Pt,{get when(){return u()||!d()},get children(){return[kt(Za,{translationKey:"walletModal.loading",children:"Wallets list is loading"}),kt(Wa,{get children(){return kt(Mo,{size:"m"})}})]}}),kt(Pt,{get when(){return Qe((()=>!u()))()&&d()},get children(){return kt(Mt,{get children(){return[kt(Ut,{get when(){return i()},get children(){return kt(nr,{get component(){return Cs()?tc:Pl},get wallet(){return i()},get additionalRequest(){return h()},onBackClick:()=>o(null)})}}),kt(Ut,{get when(){return"universal"===s()},get children(){return kt(nr,{get component(){return Cs()?wc:Ec},onSelect:o,get walletsList(){return d()},get additionalRequest(){return h()},onSelectAllWallets:()=>a("all-wallets")})}}),kt(Ut,{get when(){return"all-wallets"===s()},get children(){return kt(cl,{get walletsList(){return d()},onBack:()=>a("universal"),onSelect:o})}})]}})}})]}})]}})},Pc=Cr.div` display: flex; flex-direction: column; align-items: center; @@ -1015,4 +1015,4 @@ color: ${e=>e.theme.colors.text.secondary}; `,Tc=Cr(Yn)` margin-top: 32px; -`,Oc=e=>{const t=Gn(e),r=nt(Bs),[n,i]=Ze(!0);let o;(null==r?void 0:r.wallet)&&"universalLink"in r.wallet&&("universal-link"===r.wallet.openMethod||L(r.wallet.universalLink)&&On())&&(o=r.wallet.universalLink);const s=()=>{const e=Jr(),t="returnStrategy"in e?e.returnStrategy:Ga.returnStrategy;if(L(o)){const r=!n();i(!1),El(o,{returnStrategy:t,twaReturnUrl:"twaReturnUrl"in e?e.twaReturnUrl:Ga.twaReturnUrl,forceRedirect:r})}else Tr(Bl(o,t))};return kt(Ic,Bt(t,{get children(){return[Qe((()=>e.icon)),kt(Mc,{get translationKey(){return e.headerTranslationKey},get translationValues(){return e.headerTranslationValues}}),kt(Uc,{get translationKey(){return e.textTranslationKey},get translationValues(){return e.textTranslationValues}}),kt(It,{get when(){return"open-wallet"!==e.showButton},get children(){return kt(Tc,{onClick:()=>e.onClose(),get children(){return kt(Sl,{translationKey:"common.close",children:"Close"})}})}}),kt(It,{get when(){return"open-wallet"===e.showButton&&o},get children(){return kt(Tc,{onClick:s,get children(){return kt(Sl,{translationKey:"common.openWallet",children:"Open wallet"})}})}})]}}))},Rc=e=>{const t=nt(Bs),[r]=Gi();return kt(Oc,{headerTranslationKey:"actionModal.confirmTransaction.header",get headerTranslationValues(){return{name:t.wallet&&"name"in t.wallet?t.wallet.name:r("common.yourWallet",{},"Your wallet")}},textTranslationKey:"actionModal.confirmTransaction.text",get icon(){return kt(Mo,{size:"m"})},onClose:()=>e.onClose(),showButton:"open-wallet","data-tc-confirm-modal":"true"})},jc=e=>kt(Oc,{headerTranslationKey:"actionModal.transactionCanceled.header",textTranslationKey:"actionModal.transactionCanceled.text",get icon(){return kt(Bo,{size:"m"})},onClose:()=>e.onClose(),"data-tc-transaction-canceled-modal":"true"}),Lc=e=>kt(Oc,{headerTranslationKey:"actionModal.transactionSent.header",textTranslationKey:"actionModal.transactionSent.text",get icon(){return kt(ko,{size:"m"})},onClose:()=>e.onClose(),"data-tc-transaction-sent-modal":"true"}),zc=()=>kt(Ai,{get opened(){var e;return Qe((()=>null!==Jr()))()&&!0===(null==(e=Jr())?void 0:e.openModal)},get enableAndroidBackHandler(){return Ga.enableAndroidBackHandler},onClose:()=>Xr(null),"data-tc-actions-modal-container":"true",get children(){return kt(Mt,{get children(){return[kt(Ut,{get when(){return"transaction-sent"===Jr().name},get children(){return kt(Lc,{onClose:()=>Xr(null)})}}),kt(Ut,{get when(){return"transaction-canceled"===Jr().name},get children(){return kt(jc,{onClose:()=>Xr(null)})}}),kt(Ut,{get when(){return"confirm-transaction"===Jr().name},get children(){return kt(Rc,{onClose:()=>Xr(null)})}})]}})}}),Nc=e=>{const t=((e={},t=(navigator.language in e?navigator.language:Object.keys(e)[0]))=>{const[r,n]=Ze(t),[i,o]=bn(e);return[(e,t,n)=>{const o=Zi(i[r()],e,n||"");return"function"==typeof o?o(t):"string"==typeof o?((e,t,r=/{{(.*?)}}/g)=>e.replace(r,((e,r)=>Zi(t,r,""))))(o,t||{}):o},{add(e,t){o(e,(e=>Object.assign(e||{},t)))},locale:e=>e?n(e):r(),dict:e=>Zi(i,e)}]})(en,Ga.language);return customElements.define(kr,class extends HTMLElement{}),document.body.hasAttribute("ontouchstart")||document.body.setAttribute("ontouchstart",""),kt(Wi.Provider,{value:t,get children(){return kt(Bs.Provider,{get value(){return e.tonConnectUI},get children(){return kt(rn.Provider,{get value(){return Ga.connector},get children(){return[kt(Sr,{}),kt(br,{theme:kn,get children(){return[kt(It,{get when(){return Ga.buttonRootId},get children(){return kt(rr,{get mount(){return document.getElementById(Ga.buttonRootId)},get children(){return kt(qa,{})}})}}),kt(nr,{component:kr,get children(){return[kt(Pc,{}),kt(zc,{})]}})]}})]}})}})}})},Dc=()=>{setTimeout((()=>Hr({status:"opened",closeReason:null})))},$c=e=>{setTimeout((()=>Xr(e)))};class Fc{constructor(e){Pe(this,"connector"),Pe(this,"setConnectRequestParametersCallback"),Pe(this,"consumers",[]),Pe(this,"state",qr()),this.connector=e.connector,this.setConnectRequestParametersCallback=e.setConnectRequestParametersCallback,Ye((()=>{const e=qr();this.state=e,this.consumers.forEach((t=>t(e)))}))}open(){return Ie(this,null,(function*(){const e=(yield this.connector.getWallets()).find(ee);return e?this.connectEmbeddedWallet(e):this.connectExternalWallet()}))}close(){var e;e="action-cancelled",setTimeout((()=>Hr({status:"closed",closeReason:e})))}onStateChange(e){return this.consumers.push(e),()=>{this.consumers=this.consumers.filter((t=>t!==e))}}connectEmbeddedWallet(e){const t=t=>{Qr(e),this.connector.connect({jsBridgeKey:e.jsBridgeKey},t)},r=Ga.connectRequestParameters;"loading"===(null==r?void 0:r.state)?this.setConnectRequestParametersCallback(t):t(null==r?void 0:r.value)}connectExternalWallet(){return Ie(this,null,(function*(){return On()&&Rn(),Dc(),new Promise((e=>{const t=this.onStateChange((r=>{const{status:n}=r;"opened"===n&&(t(),e())}))}))}))}}class Kc{constructor(e){Pe(this,"connector"),Pe(this,"consumers",[]),this.connector=e.connector,Ye((()=>{const e=Jr();this.consumers.forEach((t=>t(e)))}))}onStateChange(e){return this.consumers.push(e),()=>{this.consumers=this.consumers.filter((t=>t!==e))}}}var Vc=r(3515);const qc="d843619b379084d133f061606beecbf72ae2bf60e0622e808f2a3f631673599b",Hc=async(e,t,r)=>{const n=r?"https://testnet.toncenter.com/api/v3/":"https://toncenter.com/api/v3/",i={"Content-Type":"application/json","X-API-Key":qc},o=await fetch(n+e+"?"+new URLSearchParams(t),{method:"GET",headers:i}),s=await o.json();if(s.error)throw new Error(s.error);return s};class Zc{constructor(e,t){this.contractAddress=e,this.isTestnet=t,this.tonClient=new Vc.TonClient({endpoint:t?"https://testnet.toncenter.com/api/v2/jsonRPC":"https://toncenter.com/api/v2/jsonRPC",apiKey:qc})}getState(){throw new Error("Method not implemented.")}get(e,t){return this.tonClient.runMethod(this.contractAddress,e,t)}external(e){throw new Error("Method not implemented.")}internal(e,t){throw new Error("Method not implemented.")}open(e){throw new Error("Method not implemented.")}getTransactions(e,t,r,n){throw new Error("Method not implemented.")}}const Wc=(e,t)=>a.Address.isFriendly(e)?a.Address.parseFriendly(e).isTestOnly&&!t?"Please enter mainnet address":null:"Invalid address",Gc={},Yc=async(e,t)=>{const r=e.toRawString();let n=Gc[r];return n||(n=(await Hc("addressBook",{address:r},t))[r].user_friendly,Gc[r]=n),a.Address.parseFriendly(n)},Qc=async(e,t)=>{const r=await Yc(e,t);return Jc(r)},Jc=e=>{const t=Xc(e),r=((e,t)=>(a.Address.parseFriendly(e),(t?"https://testnet.tonviewer.com/":"https://tonviewer.com/")+e))(t,e.isTestOnly);return`${t}`},Xc=e=>e.address.toString({bounceable:e.isBounceable,testOnly:e.isTestOnly}),ed=(e,t)=>e?t?e.equals(t):!e:!t,td=(e,t)=>{if(e.length!==t.length)return!1;for(let r=0;r{if(!e)throw console.error(t),new Error(t)},nd=e=>{const t=document.createElement("div");return t.innerText=e,t.innerHTML};class id{}id.multisig={new_order:4145565967,execute:1963556701,execute_internal:2737592767},id.order={approve:2808226575,expired:6,approve_rejected:2947491902,approved:2187369462,init:2624846754},id.actions={send_message:4046986843,update_multisig_params:487390163};class od{}od.multisig={unauthorized_new_order:1007,invalid_new_order:1008,not_enough_ton:100,unauthorized_execute:101,singers_outdated:102,invalid_dictionary_sequence:103,expired:111},od.order={unauthorized_init:104,already_approved:107,already_inited:105,unauthorized_sign:106,expired:111,unknown_op:65535,already_executed:112};class sd{}function ad(e){let t=a.Dictionary.empty(a.Dictionary.Keys.Uint(8),a.Dictionary.Values.Address());for(let r=0;r0||e.remainingRefs>0)throw new Error("remaining bits in data")}sd.bitsize={op:32,queryId:64,orderSeqno:256,signerIndex:8,actionIndex:8,time:48};class dd{constructor(e,t,r){this.address=e,this.init=t,this.configuration=r,this.orderSeqno=0n}static createFromAddress(e){let t=new dd(e);return t.orderSeqno=0n,t}static createFromConfig(e,t,r=0){const n=function(e){return(0,a.beginCell)().storeUint(0,sd.bitsize.orderSeqno).storeUint(e.threshold,sd.bitsize.signerIndex).storeRef((0,a.beginCell)().storeDictDirect(ad(e.signers))).storeUint(e.signers.length,sd.bitsize.signerIndex).storeDict(ad(e.proposers)).storeBit(e.allowArbitrarySeqno).endCell()}(e),i={code:t,data:n};return new dd((0,a.contractAddress)(r,i),i,e)}async sendDeploy(e,t,r){await e.internal(t,{value:r,sendMode:a.SendMode.PAY_GAS_SEPARATELY,body:(0,a.beginCell)().storeUint(0,sd.bitsize.op).storeUint(0,sd.bitsize.queryId).endCell()})}static packTransferRequest(e){let t=(0,a.beginCell)().store((0,a.storeMessageRelaxed)(e.message)).endCell();return(0,a.beginCell)().storeUint(id.actions.send_message,sd.bitsize.op).storeUint(e.sendMode,8).storeRef(t).endCell()}static packUpdateRequest(e){return(0,a.beginCell)().storeUint(id.actions.update_multisig_params,sd.bitsize.op).storeUint(e.threshold,sd.bitsize.signerIndex).storeRef((0,a.beginCell)().storeDictDirect(ad(e.signers))).storeDict(ad(e.proposers)).endCell()}static packOrder(e){let t=a.Dictionary.empty(a.Dictionary.Keys.Uint(8),a.Dictionary.Values.Cell());if(e.length>255)throw new Error("For action chains above 255, use packLarge method");for(let r=0;r{switch(e){case"unlock":return 0;case"out":return 1;case"in":return 2;case"full":return 3;default:throw new Error("Invalid argument!")}},bd=e=>{switch(e){case"unlock":return"Unlock";case"out":return"Outgoing transfers locked";case"in":return"Inbound transfers locked";case"full":return"Outgoing and Inbound transfers locked"}};function wd(e){if(e.remainingBits>0||e.remainingRefs>0)throw new Error("remaining bits in data")}class vd{constructor(e,t){this.address=e,this.init=t}static createFromAddress(e){return new vd(e)}static createFromConfig(e,t,r=0){const n=function(e){const t=e.jetton_content instanceof a.Cell?e.jetton_content:function(e){return(0,a.beginCell)().storeStringTail(e.uri).endCell()}(e.jetton_content);return(0,a.beginCell)().storeCoins(0).storeAddress(e.admin).storeAddress(null).storeRef(e.wallet_code).storeRef(t).endCell()}(e),i={code:t,data:n};return new vd((0,a.contractAddress)(r,i),i)}async sendDeploy(e,t,r){await e.internal(t,{value:r,sendMode:a.SendMode.PAY_GAS_SEPARATELY,body:(0,a.beginCell)().storeUint(fd.top_up,32).storeUint(0,64).endCell()})}static mintMessage(e,t,r,n,i,o,s){const l=(0,a.beginCell)().storeUint(fd.internal_transfer,32).storeUint(0,64).storeCoins(t).storeAddress(r).storeAddress(n).storeCoins(o).storeMaybeRef(i).endCell();return(0,a.beginCell)().storeUint(fd.mint,32).storeUint(0,64).storeAddress(e).storeCoins(s).storeRef(l).endCell()}static parseMintInternalMessage(e){if(e.loadUint(32)!==fd.internal_transfer)throw new Error("Invalid op");const t=e.loadUint(64),r=e.loadCoins(),n=e.loadAddress(),i=e.loadAddress(),o=e.loadCoins(),s=e.loadBit()?e.loadRef().beginParse():e;return wd(e),{queryId:t,jettonAmount:r,fromAddress:n,responseAddress:i,forwardTonAmount:o,forwardPayload:s}}static parseMintMessage(e){if(e.loadUint(32)!==fd.mint)throw new Error("Invalid op");const t=e.loadUint(64),r=e.loadAddress(),n=e.loadCoins(),i=e.loadRef();return wd(e),{queryId:t,toAddress:r,tonAmount:n,internalMessage:this.parseMintInternalMessage(i.beginParse())}}static topUpMessage(){return(0,a.beginCell)().storeUint(fd.top_up,32).storeUint(0,64).endCell()}static parseTopUp(e){if(e.loadUint(32)!==fd.top_up)throw new Error("Invalid op");const t=e.loadUint(64);return wd(e),{queryId:t}}static changeAdminMessage(e){return(0,a.beginCell)().storeUint(fd.change_admin,32).storeUint(0,64).storeAddress(e).endCell()}static parseChangeAdmin(e){if(e.loadUint(32)!==fd.change_admin)throw new Error("Invalid op");const t=e.loadUint(64),r=e.loadAddress();return wd(e),{queryId:t,newAdminAddress:r}}static claimAdminMessage(e=0n){return(0,a.beginCell)().storeUint(fd.claim_admin,32).storeUint(e,64).endCell()}static parseClaimAdmin(e){if(e.loadUint(32)!==fd.claim_admin)throw new Error("Invalid op");const t=e.loadUint(64);return wd(e),{queryId:t}}static changeContentMessage(e){const t=e.uri;return(0,a.beginCell)().storeUint(fd.change_metadata_url,32).storeUint(0,64).storeStringTail(t).endCell()}static parseChangeContent(e){if(e.loadUint(32)!==fd.change_metadata_url)throw new Error("Invalid op");const t=e.loadUint(64),r=e.loadStringTail();return wd(e),{queryId:t,newMetadataUrl:r}}static lockWalletMessage(e,t,r,n=0){return(0,a.beginCell)().storeUint(fd.call_to,32).storeUint(n,64).storeAddress(e).storeCoins(r).storeRef((0,a.beginCell)().storeUint(fd.set_status,32).storeUint(n,64).storeUint(t,4).endCell()).endCell()}static parseSetStatus(e){if(e.loadUint(32)!==fd.set_status)throw new Error("Invalid op");const t=e.loadUint(64),r=e.loadUint(4);return wd(e),{queryId:t,newStatus:r}}static parseCallTo(e,t){if(e.loadUint(32)!==fd.call_to)throw new Error("Invalid op");const r=e.loadUint(64),n=e.loadAddress(),i=e.loadCoins(),o=e.loadRef();return wd(e),{queryId:r,toAddress:n,tonAmount:i,action:t(o.beginParse())}}static forceTransferMessage(e,t,r,n,i,o,s,l,c=0n){const d=gd.transferMessage(e,t,n,i,o,s);return(0,a.beginCell)().storeUint(fd.call_to,32).storeUint(c,64).storeAddress(r).storeCoins(l).storeRef(d).endCell()}static parseTransfer(e){if(e.loadUint(32)!==fd.transfer)throw new Error("Invalid op");return{queryId:e.loadUint(64),jettonAmount:e.loadCoins(),toAddress:e.loadAddress(),responseAddress:e.loadAddress(),customPayload:e.loadMaybeRef(),forwardTonAmount:e.loadCoins(),forwardPayload:e.loadBit()?e.loadRef().beginParse():e}}static forceBurnMessage(e,t,r,n,i=0){return(0,a.beginCell)().storeUint(fd.call_to,32).storeUint(i,64).storeAddress(t).storeCoins(n).storeRef(gd.burnMessage(e,r,null)).endCell()}static parseBurn(e){if(e.loadUint(32)!==fd.burn)throw new Error("Invalid op");const t=e.loadUint(64),r=e.loadCoins(),n=e.loadAddress(),i=e.loadMaybeRef();return wd(e),{queryId:t,jettonAmount:r,responseAddress:n,customPayload:i}}static upgradeMessage(e,t,r=0){return(0,a.beginCell)().storeUint(fd.upgrade,32).storeUint(r,64).storeRef(t).storeRef(e).endCell()}static parseUpgrade(e){if(e.loadUint(32)!==fd.upgrade)throw new Error("Invalid op");const t=e.loadUint(64),r=e.loadRef(),n=e.loadRef();return wd(e),{queryId:t,newData:r,newCode:n}}async getWalletAddress(e,t){const r=await e.get("get_wallet_address",[{type:"slice",cell:(0,a.beginCell)().storeAddress(t).endCell()}]);return rd(1===r.stack.remaining,"invalid get_wallet_address result"),r.stack.readAddress()}async getJettonData(e){let t=await e.get("get_jetton_data",[]);return rd(5===t.stack.remaining,"invalid get_jetton_data result"),{totalSupply:t.stack.readBigNumber(),mintable:t.stack.readBoolean(),adminAddress:t.stack.readAddress(),content:t.stack.readCell(),walletCode:t.stack.readCell()}}async getNextAdminAddress(e){const t=await e.get("get_next_admin_address",[]);return rd(1===t.stack.remaining,"invalid get_next_admin_address result"),t.stack.readAddressOpt()}}const Cd=e=>{if(null===e)throw new Error("invalid number");if(void 0===e)throw new Error("invalid number");if(isNaN(e))throw new Error("invalid number");if(e<0)throw new Error("invalid number")},_d=async(e,t,r,n,i)=>{const o=await Hc("account",{address:Xc(e)},n);rd("active"===o.status,"Contract not active. If you have just created an order it should appear within ~30 seconds."),rd(a.Cell.fromBase64(o.code).equals(t),"The contract code DOES NOT match the multisig-order code from this repository");const s=o.balance,l=function(e){const t=e.beginParse(),r=t.loadAddress(),n=t.loadUintBig(256);if(0===t.remainingBits)throw new Error("Order not initialized");const i=t.loadUint(8),o=t.loadBoolean(),s=ud(t.loadRef()),a=t.loadUint(256),l=t.loadUint(8),c=t.loadUint(48),d=t.loadRef();return cd(t),{multisigAddress:r,orderSeqno:n,threshold:i,isExecuted:o,signers:s,approvalsMask:a,approvalsNum:l,expirationDate:c,order:d}}(a.Cell.fromBase64(o.data));Cd(l.threshold),rd(l.threshold>0,"threshold <= 0"),rd(l.threshold<=l.signers.length,"threshold invalid"),Cd(l.approvalsMask),Cd(l.approvalsNum),rd(l.approvalsNum<=l.signers.length,"approvalsNum invalid"),Cd(l.expirationDate);const c=[];for(const e of l.signers)c.push(await Yc(e,n));rd(l.multisigAddress.equals(r.address.address),"multisig address does not match");const d=hd.createFromConfig({multisig:r.address.address,orderSeqno:l.orderSeqno},t);if(rd(d.address.equals(e.address),"fake multisig-order"),l.isExecuted||(rd(r.threshold===l.threshold,"multisig threshold != order threshold"),rd(td(r.signers.map((e=>e.address)),l.signers),"multisig signers != order signers")),i){const t=new Zc(e.address,n),r=hd.createFromAddress(e.address),i=await r.getOrderDataStrict(t);rd(i.multisig.equals(l.multisigAddress),"invalid multisigAddress"),rd(i.order_seqno===l.orderSeqno,"invalid orderSeqno"),rd(i.threshold===l.threshold,"invalid threshold"),rd(i.executed===l.isExecuted,"invalid isExecuted"),rd(td(i.signers,l.signers),"invalid signers"),rd(i._approvals===BigInt(l.approvalsMask),"invalid approvalsMask"),rd(i.approvals_num===l.approvalsNum,"invalid approvalsNum"),rd(i.expiration_date===BigInt(l.expirationDate),"invalid expirationDate"),rd(i.order.hash().equals(l.order.hash()),"invalid order")}const u=hd.createFromConfig({multisig:l.multisigAddress,orderSeqno:l.orderSeqno},t).address.equals(e.address),h=a.Dictionary.loadDirect(a.Dictionary.Keys.Uint(8),a.Dictionary.Values.Cell(),l.order),f=async e=>{try{const t=e.beginParse();if(0===t.remainingBits&&0==t.remainingRefs)return"Send Toncoins from multisig without comment"}catch(e){}try{const t=e.beginParse();if(0==t.loadUint(32)){const e=t.loadStringTail();return`Send Toncoins from multisig with comment "${nd(e)}"`}}catch(e){}try{const t=e.beginParse(),r=vd.parseMintMessage(t);rd(0===r.internalMessage.forwardPayload.remainingBits&&0===r.internalMessage.forwardPayload.remainingRefs,"forward payload not supported");const i=await Qc(r.toAddress,n);return`Mint ${r.internalMessage.jettonAmount} jettons (in units) to ${i}; ${(0,a.fromNano)(r.tonAmount)} TON for gas`}catch(e){}try{const t=e.beginParse();return vd.parseTopUp(t),"Top Up"}catch(e){}try{const t=e.beginParse(),r=vd.parseChangeAdmin(t);return`Change Admin to ${await Qc(r.newAdminAddress,n)}`}catch(e){}try{const t=e.beginParse();return vd.parseClaimAdmin(t),"Claim Admin"}catch(e){}try{const t=e.beginParse(),r=vd.parseChangeContent(t);return`Change metadata URL to "${nd(r.newMetadataUrl)}"`}catch(e){}try{const t=e.beginParse(),r=vd.parseTransfer(t);if(r.customPayload)throw new Error("custom payload not supported");rd(0===r.forwardPayload.remainingBits&&0===r.forwardPayload.remainingRefs,"forward payload not supported");const i=await Qc(r.toAddress,n);return`Transfer ${r.jettonAmount} jettons (in units) from multisig to user ${i};`}catch(e){}try{const t=e.beginParse(),r=vd.parseCallTo(t,vd.parseSetStatus),i=await Qc(r.toAddress,n),o=(e=>{switch(e){case 0:return"unlock";case 1:return"out";case 2:return"in";case 3:return"full";default:throw new Error("Invalid argument!")}})(r.action.newStatus);return`Lock jetton wallet of user ${i}. Set status "${o}" - "${bd(o)}"; ${(0,a.fromNano)(r.tonAmount)} TON for gas`}catch(e){}try{const t=e.beginParse(),r=vd.parseCallTo(t,vd.parseTransfer);if(r.action.customPayload)throw new Error("custom payload not supported");rd(0===r.action.forwardPayload.remainingBits&&0===r.action.forwardPayload.remainingRefs,"forward payload not supported");const i=await Qc(r.toAddress,n),o=await Qc(r.action.toAddress,n);return`Force transfer ${r.action.jettonAmount} jettons (in units) from user ${i} to ${o}; ${(0,a.fromNano)(r.tonAmount)} TON for gas`}catch(e){}try{const t=e.beginParse(),r=vd.parseCallTo(t,vd.parseBurn);if(r.action.customPayload)throw new Error("custom payload not supported");const i=await Qc(r.toAddress,n);return`Force burn ${r.action.jettonAmount} jettons (in units) from user ${i}; ${(0,a.fromNano)(r.tonAmount)} TON for gas`}catch(e){}throw new Error("Unknown action")};let p=[];const g=h.keys();for(let e of g){let t=`
    Action #${e}:
    `;const r=h.get(e).beginParse(),i=r.loadUint(32);if(4046986843===i){const e=r.loadUint(8);let i=[],o=!1;1&e&&i.push("Pays fees separately"),2&e&&i.push("Ignore sending errors"),128&e&&(o=!0,i.push("CARRY ALL BALANCE")),64&e&&i.push("Carry all the remaining value of the inbound message"),32&e&&i.push("DESTROY ACCOUNT");const s=r.loadRef();cd(r);const l=(0,a.loadMessageRelaxed)(s.beginParse());console.log(l);const c=l.info,d=await Qc(c.dest,n);t+=`
    Send ${o?"ALL BALANCE":(0,a.fromNano)(c.value.coins)} TON to ${d}
    `,t+=`
    ${await f(l.body)}
    `,e&&(t+=`
    Send mode: ${i.join(", ")}.
    `)}else{if(487390163!==i)throw new Error("unknown action op");{const e=r.loadUint(8),i=ld(r.loadRef()),o=r.loadUint(1)?ld(r.loadRef()):[];cd(r),rd(i.length>0,"invalid new signers"),rd(e>0,"invalid new threshold"),rd(e<=i.length,"invalid new threshold"),t+="
    Update Multisig Params
    ",t+=`
    New threshold : ${e.toString()}
    `,t+="
    New signers:
    ";for(let e=0;e#${e} - ${await Qc(r,n)}`}if(t+="
    New proposers:
    ",o.length>0)for(let e=0;e#${e} - ${await Qc(r,n)}`}else t+="
    No proposers
    "}}p.push(t)}return{address:e,tonBalance:s,orderId:l.orderSeqno,isExecuted:l.isExecuted,approvalsNum:l.approvalsNum,approvalsMask:l.approvalsMask,threshold:l.threshold,signers:c,expiresAt:new Date(1e3*l.expirationDate),actions:p,stateInitMatches:u}},kd=e=>{const t=e.beginParse(),r=t.loadAddress(),n=t.loadUintBig(256);return cd(t),{multisigAddress:r,orderId:n}},xd=e=>{const t=a.Address.parse(e.destination),r=(e=>{const t=e.beginParse();if(0!==t.loadUint(2))throw new Error("invalid init state prefix");const r=t.loadMaybeRef(),n=t.loadMaybeRef();if(t.loadBoolean())throw new Error("invalid init state empty libraries");return cd(t),{code:r,body:kd(n)}})(a.Cell.fromBase64(e.init_state.body)),n=a.Cell.fromBase64(e.message_content.body).beginParse();rd(n.loadUint(32)===id.order.init,"invalid op");const i=n.loadUint(64),o=n.loadUint(8),s=n.loadRef().beginParse().loadDictDirect(a.Dictionary.Keys.Uint(8),a.Dictionary.Values.Address()),l=n.loadUint(48),c=n.loadRef().beginParse().loadDictDirect(a.Dictionary.Keys.Uint(8),a.Dictionary.Values.Cell()),d=n.loadUint(1);let u;return d&&(u=n.loadUint(8)),console.log("OUT",{queryId:i,threshold:o,signers:s,expiredAt:l,order:c,isSigner:d,signerIndex:u}),cd(n),{orderAddress:t,orderId:r.body.orderId}};var Ad=r(5269);const Sd=["uri","name","description","image","image_data","symbol","decimals","amount_style"],Bd={serialize:(e,t)=>{t.storeRef((0,a.beginCell)().storeUint(0,8).storeStringTail(e).endCell())},parse:e=>{const t=e.loadRef().beginParse(),r=t.loadUint(8);if(0==r)return t.loadStringTail();if(1==r)return a.Dictionary.loadDirect(a.Dictionary.Keys.Uint(32),a.Dictionary.Values.Cell(),t).values().map((e=>e.beginParse().loadStringTail())).join("");throw Error(`Prefix ${r} is not supported yet`)}},Ed=async(e,t,r)=>{const n=await Hc("account",{address:Xc(e)},t);rd("active"===n.status,"Contract not active");const i=n.balance,o=new Zc(e.address,t),s=vd.createFromAddress(e.address),l=await s.getJettonData(o);let c,d;const u=await(async e=>{const t=e.beginParse(),r=t.loadUint(8);if(1==r){const e=0==t.remainingBits;if(e&&0==t.remainingRefs)throw new Error("No data in content cell!");return e?t.loadStringRefTail():t.loadStringTail()}if(0==r){const e=a.Dictionary.load(a.Dictionary.Keys.BigUint(256),Bd,t),r={};for(const t of Sd){const n=BigInt("0x"+(await(0,Ad.sha256)(t)).toString("hex")),i=e.get(n);void 0!==i&&(r[t]=i)}return r}throw new Error(`Unknown content format indicator:${r}`)})(l.content);if(u instanceof String)d=u;else{const e=u;d=e.uri;const t=e.decimals;if(void 0!==t&&(c=parseInt(t),isNaN(c)))throw new Error("invalid decimals")}let h;return r&&(h=await s.getNextAdminAddress(o)),{tonBalance:i,jettonMinterContract:s,adminAddress:l.adminAddress,nextAdminAddress:h,decimals:c,metadataUrl:d}};var Pd=r(9107),Id=r.n(Pd),Md=r(8287).hp;function Ud(e){let t=0;const r=Md.alloc(e.length+2);r.set(e);for(let e of r){let r=128;for(;r>0;)t<<=1,e&r&&(t+=1),r>>=1,t>65535&&(t&=65535,t^=4129)}return Md.from([Math.floor(t/256),t%256])}var Td,Od,Rd=r(8287).hp;function jd(e){if("string"==typeof e&&!Ld.isFriendly(e))throw new Error("Unknown address type");const t=Rd.isBuffer(e)?e:Rd.from(e,"base64");if(36!==t.length)throw new Error("Unknown address type: byte length is not equal to 36");const r=t.subarray(0,34),n=t.subarray(34,36),i=Ud(r);if(i[0]!==n[0]||i[1]!==n[1])throw new Error("Invalid checksum: "+e);let o=r[0],s=!1,a=!1;if(128&o&&(s=!0,o^=128),17!==o&&81!==o)throw"Unknown address tag";a=17===o;let l=null;return l=255===r[1]?-1:r[1],{isTestOnly:s,isBounceable:a,workchain:l,hashPart:r.subarray(2,34)}}class Ld{static isAddress(e){return e instanceof Ld}static isFriendly(e){return 48===e.length&&!!/[A-Za-z0-9+/_-]+/.test(e)}static isRaw(e){if(-1===e.indexOf(":"))return!1;let[t,r]=e.split(":");return!!Number.isInteger(parseFloat(t))&&!!/[a-f0-9]+/.test(r.toLowerCase())&&64===r.length}static normalize(e){return"string"==typeof e?Ld.parse(e).toString():e.toString()}static parse(e){if(Ld.isFriendly(e))return this.parseFriendly(e).address;if(Ld.isRaw(e))return this.parseRaw(e);throw new Error("Unknown address type: "+e)}static parseRaw(e){let t=parseInt(e.split(":")[0]),r=Rd.from(e.split(":")[1],"hex");return new Ld(t,r)}static parseFriendly(e){if(Rd.isBuffer(e)){let t=jd(e);return{isBounceable:t.isBounceable,isTestOnly:t.isTestOnly,address:new Ld(t.workchain,t.hashPart)}}{let t=jd(e.replace(/\-/g,"+").replace(/_/g,"/"));return{isBounceable:t.isBounceable,isTestOnly:t.isTestOnly,address:new Ld(t.workchain,t.hashPart)}}}constructor(e,t){if(this.toRawString=()=>this.workChain+":"+this.hash.toString("hex"),this.toRaw=()=>{const e=Rd.alloc(36);return e.set(this.hash),e.set([this.workChain,this.workChain,this.workChain,this.workChain],32),e},this.toStringBuffer=e=>{let t=!(!e||void 0===e.testOnly)&&e.testOnly,r=!e||void 0===e.bounceable||e.bounceable?17:81;t&&(r|=128);const n=Rd.alloc(34);n[0]=r,n[1]=this.workChain,n.set(this.hash,2);const i=Rd.alloc(36);return i.set(n),i.set(Ud(n),34),i},this.toString=e=>{let t=!e||void 0===e.urlSafe||e.urlSafe,r=this.toStringBuffer(e);return t?r.toString("base64").replace(/\+/g,"-").replace(/\//g,"_"):r.toString("base64")},this[Td]=()=>this.toString(),32!==t.length)throw new Error("Invalid address hash length: "+t.length);this.workChain=e,this.hash=t,Object.freeze(this)}equals(e){return e.workChain===this.workChain&&e.hash.equals(this.hash)}}Td=Id();class zd{static isAddress(e){return e instanceof zd}constructor(e,t){this[Od]=()=>this.toString(),this.value=e,this.bits=t}toString(){return`External<${this.bits}:${this.value}>`}}function Nd(e){let t=new qd(8*Math.ceil(e.length/8));t.writeBits(e);let r=8*Math.ceil(e.length/8)-e.length;for(let e=0;ethis.toString(),r<0)throw new Error(`Length ${r} is out of bounds`);this._length=r,this._data=e,this._offset=t}get length(){return this._length}at(e){if(e>=this._length)throw new Error(`Index ${e} > ${this._length} is out of bounds`);if(e<0)throw new Error(`Index ${e} < 0 is out of bounds`);let t=this._offset+e>>3,r=7-(this._offset+e)%8;return!!(this._data[t]&1<this._length)throw new Error(`Offset(${e}) > ${this._length} is out of bounds`);if(e<0)throw new Error(`Offset(${e}) < 0 is out of bounds`);if(0===t)return Fd.EMPTY;if(e+t>this._length)throw new Error(`Offset ${e} + Length ${t} > ${this._length} is out of bounds`);return new Fd(this._data,this._offset+e,t)}subbuffer(e,t){if(e>this._length)throw new Error(`Offset ${e} is out of bounds`);if(e<0)throw new Error(`Offset ${e} is out of bounds`);if(e+t>this._length)throw new Error(`Offset + Lenght = ${e+t} is out of bounds`);if(t%8!=0)return null;if((this._offset+e)%8!=0)return null;let r=this._offset+e>>3,n=r+(t>>3);return this._data.subarray(r,n)}equals(e){if(this._length!==e._length)return!1;for(let t=0;t8*this._buffer.length)throw new Error("BitBuilder overflow");("boolean"==typeof e&&!0===e||"number"==typeof e&&e>0)&&(this._buffer[t/8|0]|=1<<7-t%8),this._length++}writeBits(e){for(let t=0;t8*this._buffer.length)throw new Error("BitBuilder overflow");e.copy(this._buffer,this._length/8),this._length+=8*e.length}else for(let t=0;t=n)throw Error(`bitLength is too small for a value ${e}. Got ${t}`);if(this._length+t>8*this._buffer.length)throw new Error("BitBuilder overflow");const i=8-this._length%8;if(i>0){const e=Math.floor(this._length/8);if(t>BigInt(t-i));this._buffer[e]|=n,this._length+=i}}for(t-=i;t>0;)t>=8?(this._buffer[this._length/8]=Number(r>>BigInt(t-8)&0xffn),this._length+=8,t-=8):(this._buffer[this._length/8]=Number(r<=n)throw Error(`value is out of range for ${t} bits. Got ${e}`);r<0?(this.writeBit(!0),r=n+r):this.writeBit(!1),this.writeUint(r,t-1)}writeVarUint(e,t){let r=BigInt(e);if(t<0||!Number.isSafeInteger(t))throw Error(`invalid bit length. Got ${t}`);if(r<0)throw Error(`value is negative. Got ${e}`);if(0n===r)return void this.writeUint(0,t);const n=Math.ceil(r.toString(2).length/8),i=8*n;this.writeUint(n,t),this.writeUint(r,i)}writeVarInt(e,t){let r=BigInt(e);if(t<0||!Number.isSafeInteger(t))throw Error(`invalid bit length. Got ${t}`);if(0n===r)return void this.writeUint(0,t);let n=r>0?r:-r;const i=1+Math.ceil(n.toString(2).length/8),o=8*i;this.writeUint(i,t),this.writeInt(r,o)}writeCoins(e){this.writeVarUint(e,4)}writeAddress(e){if(null!=e){if(Ld.isAddress(e))return this.writeUint(2,2),this.writeUint(0,1),this.writeInt(e.workChain,8),void this.writeBuffer(e.hash);if(zd.isAddress(e))return this.writeUint(1,2),this.writeUint(e.bits,9),void this.writeUint(e.value,e.bits);throw Error(`Invalid address. Got ${e}`)}this.writeUint(0,2)}build(){return new Fd(this._buffer,0,this._length)}buffer(){if(this._length%8!=0)throw new Error("BitBuilder buffer is not byte aligned");return this._buffer.subarray(0,this._length/8)}}!function(e){e[e.Ordinary=-1]="Ordinary",e[e.PrunedBranch=1]="PrunedBranch",e[e.Library=2]="Library",e[e.MerkleProof=3]="MerkleProof",e[e.MerkleUpdate=4]="MerkleUpdate"}(Kd||(Kd={}));var Hd,Zd=r(8287).hp;function Wd(e){if(e.remainingBits%8!=0)throw new Error(`Invalid string length: ${e.remainingBits}`);if(0!==e.remainingRefs&&1!==e.remainingRefs)throw new Error(`invalid number of refs: ${e.remainingRefs}`);let t;return t=0===e.remainingBits?Zd.alloc(0):e.loadBuffer(e.remainingBits/8),1===e.remainingRefs&&(t=Zd.concat([t,Wd(e.loadRef().beginParse())])),t}function Gd(e){return Wd(e).toString()}function Yd(e,t){if(e.length>0){let r=Math.floor(t.availableBits/8);if(e.length>r){let n=e.subarray(0,r),i=e.subarray(r);t=t.storeBuffer(n);let o=_u();Yd(i,o),t=t.storeRef(o.endCell())}else t=t.storeBuffer(e)}}function Qd(e,t){Yd(Zd.from(e),t)}class Jd{constructor(e,t){this[Hd]=()=>this.toString(),this._reader=e.clone(),this._refs=[...t],this._refsOffset=0}get remainingBits(){return this._reader.remaining}get offsetBits(){return this._reader.offset}get remainingRefs(){return this._refs.length-this._refsOffset}get offsetRefs(){return this._refsOffset}skip(e){return this._reader.skip(e),this}loadBit(){return this._reader.loadBit()}preloadBit(){return this._reader.preloadBit()}loadBoolean(){return this.loadBit()}loadMaybeBoolean(){return this.loadBit()?this.loadBoolean():null}loadBits(e){return this._reader.loadBits(e)}preloadBits(e){return this._reader.preloadBits(e)}loadUint(e){return this._reader.loadUint(e)}loadUintBig(e){return this._reader.loadUintBig(e)}preloadUint(e){return this._reader.preloadUint(e)}preloadUintBig(e){return this._reader.preloadUintBig(e)}loadMaybeUint(e){return this.loadBit()?this.loadUint(e):null}loadMaybeUintBig(e){return this.loadBit()?this.loadUintBig(e):null}loadInt(e){return this._reader.loadInt(e)}loadIntBig(e){return this._reader.loadIntBig(e)}preloadInt(e){return this._reader.preloadInt(e)}preloadIntBig(e){return this._reader.preloadIntBig(e)}loadMaybeInt(e){return this.loadBit()?this.loadInt(e):null}loadMaybeIntBig(e){return this.loadBit()?this.loadIntBig(e):null}loadVarUint(e){return this._reader.loadVarUint(e)}loadVarUintBig(e){return this._reader.loadVarUintBig(e)}preloadVarUint(e){return this._reader.preloadVarUint(e)}preloadVarUintBig(e){return this._reader.preloadVarUintBig(e)}loadVarInt(e){return this._reader.loadVarInt(e)}loadVarIntBig(e){return this._reader.loadVarIntBig(e)}preloadVarInt(e){return this._reader.preloadVarInt(e)}preloadVarIntBig(e){return this._reader.preloadVarIntBig(e)}loadCoins(){return this._reader.loadCoins()}preloadCoins(){return this._reader.preloadCoins()}loadMaybeCoins(){return this._reader.loadBit()?this._reader.loadCoins():null}loadAddress(){return this._reader.loadAddress()}loadMaybeAddress(){return this._reader.loadMaybeAddress()}loadExternalAddress(){return this._reader.loadExternalAddress()}loadMaybeExternalAddress(){return this._reader.loadMaybeExternalAddress()}loadAddressAny(){return this._reader.loadAddressAny()}loadRef(){if(this._refsOffset>=this._refs.length)throw new Error("No more references");return this._refs[this._refsOffset++]}preloadRef(){if(this._refsOffset>=this._refs.length)throw new Error("No more references");return this._refs[this._refsOffset]}loadMaybeRef(){return this.loadBit()?this.loadRef():null}preloadMaybeRef(){return this.preloadBit()?this.preloadRef():null}loadBuffer(e){return this._reader.loadBuffer(e)}preloadBuffer(e){return this._reader.preloadBuffer(e)}loadStringTail(){return Gd(this)}loadMaybeStringTail(){return this.loadBit()?Gd(this):null}loadStringRefTail(){return Gd(this.loadRef().beginParse())}loadMaybeStringRefTail(){const e=this.loadMaybeRef();return e?Gd(e.beginParse()):null}loadDict(e,t){return Nu.load(e,t,this)}loadDictDirect(e,t){return Nu.loadDirect(e,t,this)}endParse(){if(this.remainingBits>0||this.remainingRefs>0)throw new Error("Slice is not empty")}asCell(){return _u().storeSlice(this).endCell()}asBuilder(){return _u().storeSlice(this)}clone(e=!1){if(e){let e=this._reader.clone();return e.reset(),new Jd(e,this._refs)}{let e=new Jd(this._reader,this._refs);return e._refsOffset=this._refsOffset,e}}toString(){return this.asCell().toString()}}Hd=Id();var Xd=r(8287).hp;class eu{constructor(e,t=0){this._checkpoints=[],this._bits=e,this._offset=t}get offset(){return this._offset}get remaining(){return this._bits.length-this._offset}skip(e){if(e<0||this._offset+e>this._bits.length)throw new Error(`Index ${this._offset+e} is out of bounds`);this._offset+=e}reset(){this._checkpoints.length>0?this._offset=this._checkpoints.pop():this._offset=0}save(){this._checkpoints.push(this._offset)}loadBit(){let e=this._bits.at(this._offset);return this._offset++,e}preloadBit(){return this._bits.at(this._offset)}loadBits(e){let t=this._bits.substring(this._offset,e);return this._offset+=e,t}preloadBits(e){return this._bits.substring(this._offset,e)}loadBuffer(e){let t=this._preloadBuffer(e,this._offset);return this._offset+=8*e,t}preloadBuffer(e){return this._preloadBuffer(e,this._offset)}loadUint(e){return Number(this.loadUintBig(e))}loadUintBig(e){let t=this.preloadUintBig(e);return this._offset+=e,t}preloadUint(e){return Number(this._preloadUint(e,this._offset))}preloadUintBig(e){return this._preloadUint(e,this._offset)}loadInt(e){let t=this._preloadInt(e,this._offset);return this._offset+=e,Number(t)}loadIntBig(e){let t=this._preloadInt(e,this._offset);return this._offset+=e,t}preloadInt(e){return Number(this._preloadInt(e,this._offset))}preloadIntBig(e){return this._preloadInt(e,this._offset)}loadVarUint(e){let t=Number(this.loadUint(e));return Number(this.loadUintBig(8*t))}loadVarUintBig(e){let t=Number(this.loadUint(e));return this.loadUintBig(8*t)}preloadVarUint(e){let t=Number(this._preloadUint(e,this._offset));return Number(this._preloadUint(8*t,this._offset+e))}preloadVarUintBig(e){let t=Number(this._preloadUint(e,this._offset));return this._preloadUint(8*t,this._offset+e)}loadVarInt(e){let t=Number(this.loadUint(e));return Number(this.loadIntBig(8*t))}loadVarIntBig(e){let t=Number(this.loadUint(e));return this.loadIntBig(8*t)}preloadVarInt(e){let t=Number(this._preloadUint(e,this._offset));return Number(this._preloadInt(8*t,this._offset+e))}preloadVarIntBig(e){let t=Number(this._preloadUint(e,this._offset));return this._preloadInt(8*t,this._offset+e)}loadCoins(){return this.loadVarUintBig(4)}preloadCoins(){return this.preloadVarUintBig(4)}loadAddress(){let e=Number(this._preloadUint(2,this._offset));if(2===e)return this._loadInternalAddress();throw new Error("Invalid address: "+e)}loadMaybeAddress(){let e=Number(this._preloadUint(2,this._offset));if(0===e)return this._offset+=2,null;if(2===e)return this._loadInternalAddress();throw new Error("Invalid address")}loadExternalAddress(){if(1===Number(this._preloadUint(2,this._offset)))return this._loadExternalAddress();throw new Error("Invalid address")}loadMaybeExternalAddress(){let e=Number(this._preloadUint(2,this._offset));if(0===e)return this._offset+=2,null;if(1===e)return this._loadExternalAddress();throw new Error("Invalid address")}loadAddressAny(){let e=Number(this._preloadUint(2,this._offset));if(0===e)return this._offset+=2,null;if(2===e)return this._loadInternalAddress();if(1===e)return this._loadExternalAddress();throw 3===e?Error("Unsupported"):Error("Unreachable")}loadPaddedBits(e){if(e%8!=0)throw new Error("Invalid number of bits");let t=e;for(;;){if(this._bits.at(this._offset+t-1)){t--;break}t--}let r=this._bits.substring(this._offset,t);return this._offset+=e,r}clone(){return new eu(this._bits,this._offset)}_preloadInt(e,t){if(0==e)return 0n;let r=this._bits.at(t),n=0n;for(let r=0;r>1&1431655765))+(e>>2&858993459))+(e>>4)&252645135)>>24}(this._mask),this._hashCount=this._hashIndex+1}get value(){return this._mask}get level(){return 32-Math.clz32(this._mask)}get hashIndex(){return this._hashIndex}get hashCount(){return this._hashCount}apply(e){return new iu(this._mask&(1<>e-1)%2!=0}}function ou(e,t){let r,n=new eu(e),i=n.loadUint(8);if(1!==i)throw new Error(`Pruned branch cell must have type 1, got "${i}"`);if(0!==t.length)throw new Error(`Pruned Branch cell can't has refs, got "${t.length}"`);if(280===e.length)r=new iu(1);else{if(r=new iu(n.loadUint(8)),r.level<1||r.level>3)throw new Error(`Pruned Branch cell level must be >= 1 and <= 3, got "${r.level}/${r.value}"`);const t=16+272*r.apply(r.level-1).hashCount;if(e.length!==t)throw new Error(`Pruned branch cell must have exactly ${t} bits, got "${e.length}"`)}let o=[],s=[],a=[];for(let e=0;e>1);else if(e===Kd.MerkleUpdate)nu(t,r),n=new iu((r[0].mask.value|r[1].mask.value)>>1);else{if(e!==Kd.Library)throw new Error("Unsupported exotic type");tu(t),n=new iu}let o=[],s=[],a=e===Kd.PrunedBranch?1:n.hashCount,l=n.hashCount-a;for(let i=0,a=0;i<=n.level;i++){if(!n.isSignificant(i))continue;if(a0&&d++;let u=cu(t,c,r,i,n.apply(i).value,e),h=(0,Ad.sha256_sync)(u),f=a-l;o[f]=d,s[f]=h,a++}let c=[],d=[];if(i)for(let e=0;e<4;e++){const{hashIndex:t}=n.apply(e),{hashIndex:r}=n;t!==r?(c.push(i.pruned[t].hash),d.push(i.pruned[t].depth)):(c.push(s[0]),d.push(o[0]))}else for(let e=0;e<4;e++)c.push(s[n.apply(e).hashIndex]),d.push(o[n.apply(e).hashIndex]);return{mask:n,hashes:c,depths:d}}function uu(e,t){let r=BigInt(e);if("int"===t)return 0n===r||-1n===r?1:(r>0?r:-r).toString(2).length+1;if("uint"===t){if(r<0)throw Error(`value is negative. Got ${e}`);return r.toString(2).length}throw Error(`invalid mode. Got ${t}`)}var hu=r(8287).hp;const fu=2197175160;function pu(e){let t=-1;for(let r=0;r>>1^fu:t>>>1,t=1&t?t>>>1^fu:t>>>1,t=1&t?t>>>1^fu:t>>>1,t=1&t?t>>>1^fu:t>>>1,t=1&t?t>>>1^fu:t>>>1,t=1&t?t>>>1^fu:t>>>1,t=1&t?t>>>1^fu:t>>>1,t=1&t?t>>>1^fu:t>>>1;t^=4294967295;let r=hu.alloc(4);return r.writeInt32LE(t),r}function gu(e){return function(e){let t=0;for(let r=0;r<3;r++)t+=1&e,e>>=1;return t+1}(7&e)}function mu(e,t){const r=e.loadUint(8),n=r%8,i=!!(8&r),o=e.loadUint(8),s=Math.ceil(o/2),a=!!(o%2),l=r>>5,c=!!(16&r),d=c?32*gu(l):0,u=c?2*gu(l):0;e.skip(8*d),e.skip(8*u);let h=Fd.EMPTY;s>0&&(h=a?e.loadPaddedBits(8*s):e.loadBits(8*s));let f=[];for(let r=0;r=0;e--){if(n[e].result)throw Error("Impossible");let t=[];for(let r of n[e].refs){if(!n[r].result)throw Error("Invalid BOC file");t.push(n[r].result)}n[e].result=new Cu({bits:n[e].bits,refs:t,exotic:n[e].exotic})}let i=[];for(let e=0;e{if(this.isExotic&&!e)throw new Error("Exotic cells cannot be parsed");return new Jd(new eu(this.bits),this.refs)},this.hash=(e=3)=>this._hashes[Math.min(this._hashes.length-1,e)],this.depth=(e=3)=>this._depths[Math.min(this._depths.length-1,e)],this.level=()=>this.mask.level,this.equals=e=>this.hash().equals(e.hash()),this[wu]=()=>this.toString();let t=Fd.EMPTY;e&&e.bits&&(t=e.bits);let r,n,i,o=[];e&&e.refs&&(o=[...e.refs]);let s=Kd.Ordinary;if(e&&e.exotic){let e=function(e,t){let r=new eu(e).preloadUint(8);if(1===r)return function(e,t){let r=ou(e,t),n=[],i=[],o=new iu(r.mask);for(let e=0;e>1);return{type:Kd.MerkleProof,depths:[],hashes:[],mask:r}}(e,t);if(4===r)return function(e,t){nu(e,t);let r=new iu((t[0].level()|t[1].level())>>1);return{type:Kd.MerkleUpdate,depths:[],hashes:[],mask:r}}(e,t);throw Error("Invalid exotic cell type: "+r)}(t,o),a=du(e.type,t,o);i=a.mask,n=a.depths,r=a.hashes,s=e.type}else{if(o.length>4)throw new Error("Invalid number of references");if(t.length>1023)throw new Error(`Bits overflow: ${t.length} > 1023`);let e=du(Kd.Ordinary,t,o);i=e.mask,n=e.depths,r=e.hashes,s=Kd.Ordinary}this.type=s,this.bits=t,this.refs=o,this.mask=i,this._depths=n,this._hashes=r,Object.freeze(this),Object.freeze(this.refs),Object.freeze(this.bits),Object.freeze(this.mask),Object.freeze(this._depths),Object.freeze(this._hashes)}get isExotic(){return this.type!==Kd.Ordinary}toBoc(e){return function(e,t){let r=function(e){let t=[e],r=new Map,n=new Set,i=[];for(;t.length>0;){const e=[...t];t=[];for(let i of e){const e=i.hash().toString("hex");if(!r.has(e)){n.add(e),r.set(e,{cell:i,refs:i.refs.map((e=>e.hash().toString("hex")))});for(let e of i.refs)t.push(e)}}}let o=new Set;function s(e){if(!n.has(e))return;if(o.has(e))throw Error("Not a DAG");o.add(e);let t=r.get(e).refs;for(let e=t.length-1;e>=0;e--)s(t[e]);i.push(e),o.delete(e),n.delete(e)}for(;n.size>0;)s(Array.from(n)[0]);let a=new Map;for(let e=0;e=0;e--){let t=i[e];const n=r.get(t);l.push({cell:n.cell,refs:n.refs.map((e=>a.get(e)))})}return l}(e),n=r.length,i=t.idx,o=t.crc32,s=Math.max(Math.ceil(uu(n,"uint")/8),1),a=0,l=[];for(let e of r)a+=yu(e.cell,s),l.push(a);let c=Math.max(Math.ceil(uu(a,"uint")/8),1),d=8*(6+3*s+c+1*s+(i?n*c:0)+a+(o?4:0)),u=new qd(d);if(u.writeUint(3052313714,32),u.writeBit(i),u.writeBit(o),u.writeBit(!1),u.writeUint(0,2),u.writeUint(s,3),u.writeUint(c,8),u.writeUint(n,8*s),u.writeUint(1,8*s),u.writeUint(0,8*s),u.writeUint(a,8*c),u.writeUint(0,8*s),i)for(let e=0;e=4)throw new Error("Too many references");if(e instanceof Cu)this._refs.push(e);else{if(!(e instanceof ku))throw new Error("Invalid argument");this._refs.push(e.endCell())}return this}storeMaybeRef(e){return e?(this.storeBit(1),this.storeRef(e)):this.storeBit(0),this}storeSlice(e){let t=e.clone();for(t.remainingBits>0&&this.storeBits(t.loadBits(t.remainingBits));t.remainingRefs>0;)this.storeRef(t.loadRef());return this}storeMaybeSlice(e){return e?(this.storeBit(1),this.storeSlice(e)):this.storeBit(0),this}storeBuilder(e){return this.storeSlice(e.endCell().beginParse())}storeMaybeBuilder(e){return e?(this.storeBit(1),this.storeBuilder(e)):this.storeBit(0),this}storeWritable(e){return"object"==typeof e?e.writeTo(this):e(this),this}storeMaybeWritable(e){return e?(this.storeBit(1),this.storeWritable(e)):this.storeBit(0),this}store(e){return this.storeWritable(e),this}storeStringTail(e){return Qd(e,this),this}storeMaybeStringTail(e){return null!=e?(this.storeBit(1),Qd(e,this)):this.storeBit(0),this}storeStringRefTail(e){return this.storeRef(_u().storeStringTail(e)),this}storeMaybeStringRefTail(e){return null!=e?(this.storeBit(1),this.storeStringRefTail(e)):this.storeBit(0),this}storeDict(e,t,r){return e?e.store(this,t,r):this.storeBit(0),this}storeDictDirect(e,t,r){return e.storeDirect(this,t,r),this}endCell(e){return new Cu({bits:this._bits.build(),refs:this._refs,exotic:e?.exotic})}asCell(){return this.endCell()}asSlice(){return this.endCell().beginParse()}}function xu(e){return _u().storeUint(1,8).storeUint(1,8).storeBuffer(e.hash(0)).storeUint(e.depth(0),16).endCell({exotic:!0})}function Au(e,t,r,n){const i=t.asCell();let o=0,s=e;if(0==(t.loadBit()?1:0)){o=function(e){let t=0;for(;e.loadBit();)t++;return t}(t);for(let e=0;e0&&t.storeUint(BigInt("0b"+e),e.length)}(e,r):"long"===n?function(e,t,r){r.storeBit(1),r.storeBit(0);let n=Math.ceil(Math.log2(t+1));r.storeUint(e.length,n),e.length>0&&r.storeUint(BigInt("0b"+e),e.length)}(e,t,r):"same"===n&&function(e,t,r,n){n.storeBit(1),n.storeBit(1),n.storeBit(e);let i=Math.ceil(Math.log2(r+1));n.storeUint(t,i)}("1"===e[0],e.length,t,r)}function Tu(e,t,r,n){Uu(e.label,t,n),function(e,t,r,n){if("leaf"===e.type&&r(e.value,n),"fork"===e.type){const i=_u(),o=_u();Tu(e.left,t-1,r,i),Tu(e.right,t-1,r,o),n.storeRef(i),n.storeRef(o)}}(e.node,t-e.label.length,r,n)}function Ou(e,t,r,n){const i=function(e,t){let r=new Map;for(let n of Array.from(e.keys())){const i=Pu(n.toString(2),t);r.set(i,e.get(n))}return Mu(r)}(e,t);Tu(i,t,r,n)}var Ru=r(8287).hp;function ju(e){if("number"==typeof e){if(!Number.isSafeInteger(e))throw Error("Invalid key type: not a safe integer: "+e);return"n:"+e.toString(10)}if("bigint"==typeof e)return"b:"+e.toString(10);if(Ld.isAddress(e))return"a:"+e.toString();if(Ru.isBuffer(e))return"f:"+e.toString("hex");if(Fd.isBitString(e))return"B:"+e.toString();throw Error("Invalid key type")}function Lu(e){let t=e.slice(0,2),r=e.slice(2);if("n:"===t)return parseInt(r,10);if("b:"===t)return BigInt(r);if("a:"===t)return Ld.parse(r);if("f:"===t)return Ru.from(r,"hex");if("B:"===t){const e="_"==r.slice(-1);if(e||r.length%2!=0){let t=e?r.length-1:r.length;const n=r.substr(0,t)+"0";return!e&&1&t?new Fd(Ru.from(n,"hex"),0,t<<2):function(e){let t=0;for(let r=e.length-1;r>=0;r--)if(0!==e[r]){const n=e[r];let i=n&-n;1&i||(i=Math.log2(i)+1),r>0&&(t=r<<3),t+=8-i;break}return new Fd(e,0,t)}(Ru.from(n,"hex"))}return new Fd(Ru.from(r,"hex"),0,r.length<<2)}throw Error("Invalid key type: "+t)}var zu=r(8287).hp;class Nu{static empty(e,t){return e&&t?new Nu(new Map,e,t):new Nu(new Map,null,null)}static load(e,t,r){let n;if(r instanceof Cu){if(r.isExotic)return Nu.empty(e,t);n=r.beginParse()}else n=r;let i=n.loadMaybeRef();return i&&!i.isExotic?Nu.loadDirect(e,t,i.beginParse()):Nu.empty(e,t)}static loadDirect(e,t,r){if(!r)return Nu.empty(e,t);let n;n=r instanceof Cu?r.beginParse():r;let i=Eu(n,e.bits,t.parse),o=new Map;for(let[t,r]of i)o.set(ju(e.parse(t)),r);return new Nu(o,e,t)}constructor(e,t,r){this._key=t,this._value=r,this._map=e}get size(){return this._map.size}get(e){return this._map.get(ju(e))}has(e){return this._map.has(ju(e))}set(e,t){return this._map.set(ju(e),t),this}delete(e){const t=ju(e);return this._map.delete(t)}clear(){this._map.clear()}*[Symbol.iterator](){for(const[e,t]of this._map){const r=Lu(e);yield[r,t]}}keys(){return Array.from(this._map.keys()).map((e=>Lu(e)))}values(){return Array.from(this._map.values())}store(e,t,r){if(0===this._map.size)e.storeBit(0);else{let n=this._key;null!=t&&(n=t);let i=this._value;if(null!=r&&(i=r),!n)throw Error("Key serializer is not defined");if(!i)throw Error("Value serializer is not defined");let o=new Map;for(const[e,t]of this._map)o.set(n.serialize(Lu(e)),t);e.storeBit(1);let s=_u();Ou(o,n.bits,i.serialize,s),e.storeRef(s.endCell())}}storeDirect(e,t,r){if(0===this._map.size)throw Error("Cannot store empty dictionary directly");let n=this._key;null!=t&&(n=t);let i=this._value;if(null!=r&&(i=r),!n)throw Error("Key serializer is not defined");if(!i)throw Error("Value serializer is not defined");let o=new Map;for(const[e,t]of this._map)o.set(n.serialize(Lu(e)),t);Ou(o,n.bits,i.serialize,e)}generateMerkleProof(e){return Su(this,e,this._key)}generateMerkleUpdate(e,t){return function(e,t,r,n){const i=Su(e,t,r).refs[0];return e.set(t,n),o=i,s=Su(e,t,r).refs[0],_u().storeUint(4,8).storeBuffer(o.hash(0)).storeBuffer(s.hash(0)).storeUint(o.depth(0),16).storeUint(s.depth(0),16).storeRef(o).storeRef(s).endCell({exotic:!0});var o,s}(this,e,this._key,t)}}Nu.Keys={Address:()=>({bits:267,serialize:e=>{if(!Ld.isAddress(e))throw Error("Key is not an address");return _u().storeAddress(e).endCell().beginParse().preloadUintBig(267)},parse:e=>_u().storeUint(e,267).endCell().beginParse().loadAddress()}),BigInt:e=>function(e){return{bits:e,serialize:t=>{if("bigint"!=typeof t)throw Error("Key is not a bigint");return _u().storeInt(t,e).endCell().beginParse().loadUintBig(e)},parse:t=>_u().storeUint(t,e).endCell().beginParse().loadIntBig(e)}}(e),Int:e=>function(e){return{bits:e,serialize:t=>{if("number"!=typeof t)throw Error("Key is not a number");if(!Number.isSafeInteger(t))throw Error("Key is not a safe integer: "+t);return _u().storeInt(t,e).endCell().beginParse().loadUintBig(e)},parse:t=>_u().storeUint(t,e).endCell().beginParse().loadInt(e)}}(e),BigUint:e=>function(e){return{bits:e,serialize:t=>{if("bigint"!=typeof t)throw Error("Key is not a bigint");if(t<0)throw Error("Key is negative: "+t);return _u().storeUint(t,e).endCell().beginParse().loadUintBig(e)},parse:t=>_u().storeUint(t,e).endCell().beginParse().loadUintBig(e)}}(e),Uint:e=>function(e){return{bits:e,serialize:t=>{if("number"!=typeof t)throw Error("Key is not a number");if(!Number.isSafeInteger(t))throw Error("Key is not a safe integer: "+t);if(t<0)throw Error("Key is negative: "+t);return _u().storeUint(t,e).endCell().beginParse().loadUintBig(e)},parse:t=>Number(_u().storeUint(t,e).endCell().beginParse().loadUint(e))}}(e),Buffer:e=>function(e){return{bits:8*e,serialize:t=>{if(!zu.isBuffer(t))throw Error("Key is not a buffer");return _u().storeBuffer(t).endCell().beginParse().loadUintBig(8*e)},parse:t=>_u().storeUint(t,8*e).endCell().beginParse().loadBuffer(e)}}(e),BitString:e=>function(e){return{bits:e,serialize:t=>{if(!Fd.isBitString(t))throw Error("Key is not a BitString");return _u().storeBits(t).endCell().beginParse().loadUintBig(e)},parse:t=>_u().storeUint(t,e).endCell().beginParse().loadBits(e)}}(e)},Nu.Values={BigInt:e=>function(e){return{serialize:(t,r)=>{r.storeInt(t,e)},parse:t=>t.loadIntBig(e)}}(e),Int:e=>function(e){return{serialize:(t,r)=>{r.storeInt(t,e)},parse:t=>t.loadInt(e)}}(e),BigVarInt:e=>function(e){return{serialize:(t,r)=>{r.storeVarInt(t,e)},parse:t=>t.loadVarIntBig(e)}}(e),BigUint:e=>function(e){return{serialize:(t,r)=>{r.storeUint(t,e)},parse:t=>t.loadUintBig(e)}}(e),Uint:e=>function(e){return{serialize:(t,r)=>{r.storeUint(t,e)},parse:t=>t.loadUint(e)}}(e),BigVarUint:e=>function(e){return{serialize:(t,r)=>{r.storeVarUint(t,e)},parse:t=>t.loadVarUintBig(e)}}(e),Bool:()=>({serialize:(e,t)=>{t.storeBit(e)},parse:e=>e.loadBit()}),Address:()=>({serialize:(e,t)=>{t.storeAddress(e)},parse:e=>e.loadAddress()}),Cell:()=>({serialize:(e,t)=>{t.storeRef(e)},parse:e=>e.loadRef()}),Buffer:e=>{return t=e,{serialize:(e,r)=>{if(e.length!==t)throw Error("Invalid buffer size");r.storeBuffer(e)},parse:e=>e.loadBuffer(t)};var t},BitString:e=>function(e){return{serialize:(t,r)=>{if(t.length!==e)throw Error("Invalid BitString size");r.storeBits(t)},parse:t=>t.loadBits(e)}}(e),Dictionary:(e,t)=>function(e,t){return{serialize:(e,t)=>{e.store(t)},parse:r=>Nu.load(e,t,r)}}(e,t)};const Du=e=>document.querySelector(e),$u=(e,t)=>{e.style.display=t?"flex":"none"},Fu='
    It\'s you
    ',Ku=(e,t)=>{let r=e;void 0!==t&&(r+="/"+t),window.history.state!==r&&window.history.pushState(r,"TON Multisig - "+r,"#"+r)},Vu=(navigator.language,window.location.href.indexOf("testnet=true")>-1);Vu&&(Du(".testnet-badge").style.display="block",document.body.classList.add("testnet-padding"));const qu=e=>e.toString({bounceable:!0,testOnly:Vu});let Hu="startScreen";const Zu=e=>{const t=["startScreen","importScreen","multisigScreen","newOrderScreen","orderScreen","newMultisigScreen","loadingScreen"];Hu=e;for(const r of t)$u(Du("#"+r),r===e);switch(Hu){case"startScreen":th(),lh(),""!==window.history.state&&window.history.pushState("","TON Multisig","#");break;case"importScreen":Du("#import_input").value="";break;case"newOrderScreen":Ah();break;case"newMultisigScreen":Lh()}};let Wu;const Gu=new class{constructor(e){if(Pe(this,"walletInfoStorage",new Fr),Pe(this,"preferredWalletStorage",new Kr),Pe(this,"walletInfo",null),Pe(this,"systemThemeChangeUnsubscribe",null),Pe(this,"actionsConfiguration"),Pe(this,"walletsList"),Pe(this,"connectRequestParametersCallback"),Pe(this,"connector"),Pe(this,"modal"),Pe(this,"transactionModal"),Pe(this,"connectionRestored",Promise.resolve(!1)),e&&"connector"in e&&e.connector)this.connector=e.connector;else{if(!(e&&"manifestUrl"in e&&e.manifestUrl))throw new Mr("You have to specify a `manifestUrl` or a `connector` in the options.");this.connector=new oe({manifestUrl:e.manifestUrl})}this.modal=new Fc({connector:this.connector,setConnectRequestParametersCallback:e=>{this.connectRequestParametersCallback=e}}),this.transactionModal=new Kc({connector:this.connector}),this.walletsList=this.getWallets(),this.walletsList.then((e=>{return jr((t=e.map((e=>e.imageUrl)),[...new Set(t)]));var t}));const t=this.normalizeWidgetRoot(null==e?void 0:e.widgetRootId);this.subscribeToWalletChange(),!1!==(null==e?void 0:e.restoreConnection)&&(this.connectionRestored=new Promise((e=>Ie(this,null,(function*(){yield this.connector.restoreConnection(),this.connector.connected||this.walletInfoStorage.removeWalletInfo(),e(this.connector.connected)}))))),this.uiOptions=_n(e,{uiPreferences:{theme:"SYSTEM"}});const r=this.preferredWalletStorage.getPreferredWalletAppName();Ya({connector:this.connector,preferredWalletAppName:r}),((e,t)=>{(function(e,t,r,n={}){let i;He((n=>{i=n,t===document?e():Ht(t,e(),t.firstChild?null:void 0,r)}),n.owner)})((()=>kt(Nc,{tonConnectUI:t})),document.getElementById(e))})(t,this)}static getWallets(){return oe.getWallets()}get connected(){return this.connector.connected}get account(){return this.connector.account}get wallet(){return this.connector.wallet?Be(Be({},this.connector.wallet),this.walletInfo):null}set uiOptions(e){var t,r,n,i,o,s,a;this.checkButtonRootExist(e.buttonRootId),this.actionsConfiguration=e.actionsConfiguration,(null==(t=e.uiPreferences)?void 0:t.theme)?"SYSTEM"!==(null==(r=e.uiPreferences)?void 0:r.theme)?(null==(n=this.systemThemeChangeUnsubscribe)||n.call(this),Bn(e.uiPreferences.theme,e.uiPreferences.colorsSet)):(Bn(window.matchMedia&&window.matchMedia("(prefers-color-scheme: light)").matches?ir.LIGHT:ir.DARK,e.uiPreferences.colorsSet),this.systemThemeChangeUnsubscribe||(this.systemThemeChangeUnsubscribe=function(e){const t=t=>e(t.matches?ir.DARK:ir.LIGHT);return window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",t),()=>window.matchMedia("(prefers-color-scheme: dark)").removeEventListener("change",t)}(Bn))):(null==(i=e.uiPreferences)?void 0:i.colorsSet)&&(s=e.uiPreferences.colorsSet,Sn[ir.DARK]=_n(s[ir.DARK],Sn[ir.DARK]),Sn[ir.LIGHT]=_n(s[ir.LIGHT],Sn[ir.LIGHT]),xn((e=>({colors:_n(Sn[e.theme],An[e.theme])})))),(null==(o=e.uiPreferences)?void 0:o.borderRadius)&&(a=e.uiPreferences.borderRadius,xn({borderRadius:a})),Ya((t=>{var r,n;const i=_n(Be(Be(Be(Be({},e.language&&{language:e.language}),!!(null==(r=e.actionsConfiguration)?void 0:r.returnStrategy)&&{returnStrategy:e.actionsConfiguration.returnStrategy}),!!(null==(n=e.actionsConfiguration)?void 0:n.twaReturnUrl)&&{twaReturnUrl:e.actionsConfiguration.twaReturnUrl}),!!e.walletsListConfiguration&&{walletsListConfiguration:e.walletsListConfiguration}),cn(t));return void 0!==e.buttonRootId&&(i.buttonRootId=e.buttonRootId),void 0!==e.enableAndroidBackHandler&&(i.enableAndroidBackHandler=e.enableAndroidBackHandler),i}))}setConnectRequestParameters(e){var t;Ya({connectRequestParameters:e}),"ready"!==(null==e?void 0:e.state)&&e||null==(t=this.connectRequestParametersCallback)||t.call(this,null==e?void 0:e.value)}getWallets(){return Ie(this,null,(function*(){return this.connector.getWallets()}))}onStatusChange(e,t){return this.connector.onStatusChange((t=>Ie(this,null,(function*(){if(t){const r=yield this.getSelectedWalletInfo(t);e(Be(Be({},t),r||this.walletInfoStorage.getWalletInfo()))}else e(t)}))),t)}openModal(){return Ie(this,null,(function*(){return this.modal.open()}))}closeModal(){this.modal.close()}onModalStateChange(e){return this.modal.onStateChange(e)}get modalState(){return this.modal.state}connectWallet(){return Ie(this,null,(function*(){const e=(yield this.getWallets()).find(ee);return e?yield this.connectEmbeddedWallet(e):yield this.connectExternalWallet()}))}disconnect(){return setTimeout((()=>Xr(null))),Qr(null),this.walletInfoStorage.removeWalletInfo(),this.connector.disconnect()}sendTransaction(e,t){return Ie(this,null,(function*(){if(!this.connected)throw new Mr("Connect wallet to send a transaction.");On()&&Rn();const{notifications:r,modals:n,returnStrategy:i,twaReturnUrl:o,skipRedirectToWallet:s}=this.getModalsAndNotificationsConfiguration(t);$c({name:"confirm-transaction",showNotification:r.includes("before"),openModal:n.includes("before")});const a=()=>{const e="ios"===Nr().os,t="ios"===s&&e||"always"===s;this.walletInfo&&"universalLink"in this.walletInfo&&"universal-link"===this.walletInfo.openMethod&&!t&&(L(this.walletInfo.universalLink)?El(this.walletInfo.universalLink,{returnStrategy:i,twaReturnUrl:o||Ga.twaReturnUrl,forceRedirect:!1}):Tr(Bl(this.walletInfo.universalLink,i)))},l=new AbortController,c=this.onTransactionModalStateChange((e=>{(null==e?void 0:e.openModal)||(c(),e||l.abort())}));try{const t=yield this.waitForSendTransaction({transaction:e,abortSignal:l.signal},a);return $c({name:"transaction-sent",showNotification:r.includes("success"),openModal:n.includes("success")}),t}catch(e){throw $c({name:"transaction-canceled",showNotification:r.includes("error"),openModal:n.includes("error")}),e instanceof m?e:(console.error(e),new Mr("Unhandled error:"+e))}finally{c()}}))}connectEmbeddedWallet(e){return Ie(this,null,(function*(){const t=t=>{Qr(e),this.connector.connect({jsBridgeKey:e.jsBridgeKey},t)},r=Ga.connectRequestParameters;return"loading"===(null==r?void 0:r.state)?this.connectRequestParametersCallback=t:t(null==r?void 0:r.value),yield this.waitForWalletConnection({ignoreErrors:!1})}))}connectExternalWallet(){return Ie(this,null,(function*(){const e=new AbortController;Dc();const t=this.onModalStateChange((r=>{const{status:n,closeReason:i}=r;"opened"!==n&&(t(),"action-cancelled"===i&&e.abort())}));return yield this.waitForWalletConnection({ignoreErrors:!0,abortSignal:e.signal})}))}waitForWalletConnection(e){return Ie(this,null,(function*(){return new Promise(((t,r)=>{const{ignoreErrors:n=!1,abortSignal:i=null}=e;if(i&&i.aborted)return r(new Mr("Wallet was not connected"));const o=e=>Ie(this,null,(function*(){if(e)s(),t(e);else{if(n)return;s(),r(new Mr("Wallet was not connected"))}})),s=this.onStatusChange((e=>o(e)),(e=>(e=>{n||(s(),r(e))})(e)));i&&i.addEventListener("abort",(()=>{s(),r(new Mr("Wallet was not connected"))}))}))}))}waitForSendTransaction(e,t){return Ie(this,null,(function*(){return new Promise(((r,n)=>{const{transaction:i,abortSignal:o}=e;if(o.aborted)return n(new Mr("Transaction was not sent"));const s=e=>Ie(this,null,(function*(){r(e)}));this.connector.sendTransaction(i,t).then((e=>s(e))).catch((e=>(e=>{n(e)})(e))),o.addEventListener("abort",(()=>{n(new Mr("Transaction was not sent"))}))}))}))}onTransactionModalStateChange(e){return this.transactionModal.onStateChange(e)}subscribeToWalletChange(){this.connector.onStatusChange((e=>Ie(this,null,(function*(){var t;e?(yield this.updateWalletInfo(e),this.setPreferredWalletAppName((null==(t=this.walletInfo)?void 0:t.appName)||e.device.appName)):this.walletInfoStorage.removeWalletInfo()}))))}setPreferredWalletAppName(e){this.preferredWalletStorage.setPreferredWalletAppName(e),Ya({preferredWalletAppName:e})}getSelectedWalletInfo(e){return Ie(this,null,(function*(){let t,r=Gr();if(!r)return null;if("name"in r)t=r;else{const n=Ja(yield this.walletsList,Ga.walletsListConfiguration).find((t=>rl(t,e.device.appName)));if(!n)throw new Mr(`Cannot find WalletInfo for the '${e.device.appName}' wallet`);t=Be(Be({},n),r)}return t}))}updateWalletInfo(e){return Ie(this,null,(function*(){const t=yield this.getSelectedWalletInfo(e);if(t)return this.walletInfo=t,void this.walletInfoStorage.setWalletInfo(t);const r=this.walletInfoStorage.getWalletInfo();this.walletInfo=r||(yield this.walletsList).find((t=>rl(t,e.device.appName)))||null}))}normalizeWidgetRoot(e){if(!e||!document.getElementById(e)){e="tc-widget-root";const t=document.createElement("div");t.id=e,document.body.appendChild(t)}return e}checkButtonRootExist(e){if(null!=e&&!document.getElementById(e))throw new Mr(`${e} element not found in the document.`)}getModalsAndNotificationsConfiguration(e){var t,r,n,i,o,s;const a=["before","success","error"];let l=a;(null==(t=this.actionsConfiguration)?void 0:t.notifications)&&"all"!==(null==(r=this.actionsConfiguration)?void 0:r.notifications)&&(l=this.actionsConfiguration.notifications),(null==e?void 0:e.notifications)&&(l="all"===e.notifications?a:e.notifications);let c=["before"];(null==(n=this.actionsConfiguration)?void 0:n.modals)&&(c="all"===this.actionsConfiguration.modals?a:this.actionsConfiguration.modals),(null==e?void 0:e.modals)&&(c="all"===e.modals?a:e.modals);const d=(null==e?void 0:e.returnStrategy)||(null==(i=this.actionsConfiguration)?void 0:i.returnStrategy)||"back",u=(null==e?void 0:e.twaReturnUrl)||(null==(o=this.actionsConfiguration)?void 0:o.twaReturnUrl);let h=(null==e?void 0:e.skipRedirectToWallet)||(null==(s=this.actionsConfiguration)?void 0:s.skipRedirectToWallet)||"ios";return On()&&(h="never"),{notifications:l,modals:c,returnStrategy:d,twaReturnUrl:u,skipRedirectToWallet:h}}}({manifestUrl:"https://multisig.ton.org/tonconnect-manifest.json",buttonRootId:"tonConnectButton"});Gu.uiOptions={uiPreferences:{theme:ir.LIGHT}},Gu.onStatusChange((e=>{null===e?Wu=null:e.account&&(Wu=a.Address.parseRaw(e.account.address)),Ju&&Xu&&rh(),oh&&sh&&dh()})),Du("#createMultisigButton").addEventListener("click",(()=>{jh("create")})),Du("#importMultisigButton").addEventListener("click",(()=>{Zu("importScreen")})),Du("#import_okButton").addEventListener("click",(()=>{const e=Du("#import_input").value,t=Wc(e,Vu);t?alert(t):ih(e)})),Du("#import_backButton").addEventListener("click",(()=>{Zu("startScreen")}));const Yu=a.Cell.fromBase64("te6cckECEgEABJUAART/APSkE/S88sgLAQIBYgIDAsrQM9DTAwFxsJJfA+D6QDAi10nAAJJfA+AC0x8BIMAAkl8E4AHTPwHtRNDT/wEB0wcBAdTTBwEB9ATSAAEB0SiCEPcYUQ+64w8FREPIUAYBy/9QBAHLBxLMAQHLB/QAAQHKAMntVAQFAgEgDA0BnjgG0/8BKLOOEiCE/7qSMCSWUwW68uPw4gWkBd4B0gABAdMHAQHTLwEB1NEjkSaRKuJSMHj0Dm+h8uPvHscF8uPvIPgjvvLgbyD4I6FUbXAGApo2OCaCEHUJf126jroGghCjLFm/uo6p+CgYxwXy4GUD1NEQNBA2RlD4AH+OjSF49HxvpSCRMuMNAbPmWxA1UDSSNDbiUFQT4w1AFVAzBAoJAdT4BwODDPlBMAODCPlBMPgHUAahgSf4AaBw+DaBEgZw+DaggSvscPg2oIEdmHD4NqAipgYioIEFOSagJ6Bw+DgjpIECmCegcPg4oAOmBliggQbgUAWgUAWgQwNw+DdZoAGgHL7y4GT4KFADBwK4AXACyFjPFgEBy//JiCLIywH0APQAywDJcCH5AHTIywISygfL/8nQyIIQnHP7olgKAssfyz8mAcsHUlDMUAsByy8bzCoBygAKlRkBywcIkTDiECRwQImAGIBQ2zwRCACSjkXIWAHLBVAFzxZQA/oCVHEjI+1E7UXtR59byFADzxfJE3dQA8trzMztZ+1l7WR0f+0RmHYBy2vMAc8X7UHt8QHy/8kB+wDbBgLiNgTT/wEB0y8BAdMHAQHT/wEB1NH4KFAFAXACyFjPFgEBy//JiCLIywH0APQAywDJcAH5AHTIywISygfL/8nQG8cF8uBlJvkAGrpRk74ZsPLgZgf4I77y4G9EFFBW+AB/jo0hePR8b6UgkTLjDQGz5lsRCgH6AtdM0NMfASCCEPE4Hlu6jmqCEB0M+9O6jl5sRNMHAQHUIX9wjhdREnj0fG+lMiGZUwK68uBnAqQC3gGzEuZsISDCAPLgbiPCAPLgbVMwu/LgbQH0BCF/cI4XURJ49HxvpTIhmVMCuvLgZwKkAt4BsxLmbCEw0VUjkTDi4w0LABAw0wfUAvsA0QFDv3T/aiaGn/gIDpg4CA6mmDgID6AmkAAIDoiBqvgoD8EdDA4CAWYPEADC+AcDgwz5QTADgwj5QTD4B1AGoYEn+AGgcPg2gRIGcPg2oIEr7HD4NqCBHZhw+DagIqYGIqCBBTkmoCegcPg4I6SBApgnoHD4OKADpgZYoIEG4FAFoFAFoEMDcPg3WaABoADxsMr7UTQ0/8BAdMHAQHU0wcBAfQE0gABAdEjf3COF1ESePR8b6UyIZlTArry4GcCpALeAbMS5mwhUjC68uBsIX9wjhdREnj0fG+lMiGZUwK68uBnAqQC3gGzEuZsITAiwgDy4G4kwgDy4G1SQ7vy4G0BkjN/kQPiA4AFZsMn+CgBAXACyFjPFgEBy//JiCLIywH0APQAywDJcAH5AHTIywISygfL/8nQgEQhCAmMFqAYchWwszwXcsN9YFccUdYcFZ8q18EnjQLz1klHzYNH/nQ=="),Qu=a.Cell.fromBase64("te6cckEBAQEAIwAIQgJjBagGHIVsLM8F3LDfWBXHFHWHBWfKtfBJ40C89ZJR80AoJo0=");let Ju,Xu,eh=-1;const th=()=>{Ju=void 0,Xu=void 0,clearTimeout(eh)},rh=()=>{const{tonBalance:e,threshold:t,signers:r,proposers:n,allowArbitraryOrderSeqno:i,nextOderSeqno:o,lastOrders:s}=Xu;Du("#multisig_tonBalance").innerText=(0,a.fromNano)(e)+" TON",Du("#multisig_threshold").innerText=t+"/"+r.length,Du("#multisig_orderId").innerText=i?"Arbitrary":o.toString();let l="";for(let e=0;e#${e} — ${Jc(t)}${ed(t.address,Wu)?Fu:""}`}if(Du("#multisig_signersList").innerHTML=l,n.length>0){let e="";for(let t=0;t#${t} — ${Jc(r)}${ed(r.address,Wu)?Fu:""}`}Du("#multisig_proposersList").innerHTML=e}else Du("#multisig_proposersList").innerHTML="No proposers";const c=e=>{if(e.errorMessage)return"";{const t=!!e.orderInfo&&(new Date).getTime()>e.orderInfo.expiresAt.getTime(),r=t?"Expired order ":(e=>{switch(e.type){case"new":return"New order";case"execute":return"Execute order";case"pending":return"Pending order";case"executed":return"Executed order"}throw new Error("unknown order type "+e.type)})(e);let n=`${r} #${e.order.id}`;if("pending"!==e.type||t||(n+=` — ${e.orderInfo.approvalsNum}/${e.orderInfo.threshold}`),"pending"===e.type&&Wu){const t=e.orderInfo.signers.findIndex((e=>e.address.equals(Wu)));if(t>-1){const r=1<${n}`}};let d="",u=!1,h=!1;for(const e of s)"executed"==e.type?h||(d+='
    Old orders:
    ',h=!0):"pending"===e.type&&(u||(d+='
    Pending orders:
    ',u=!0)),d+=c(e);Du("#mainScreen_ordersList").innerHTML=d,(".multisig_lastOrder",document.querySelectorAll(".multisig_lastOrder")).forEach((e=>{e.addEventListener("click",(e=>{const t=e.currentTarget.attributes,r=t.getNamedItem("order-address").value,n=BigInt(t.getNamedItem("order-id").value);hh(n,r)}))}))},nh=async(e,t)=>{try{const r=await(async(e,t,r,n,i,o)=>{const s=await Hc("account",{address:Xc(e)},n);rd("active"===s.status,"Contract not active. If you have just created a multisig it should appear within ~30 seconds."),rd(a.Cell.fromBase64(s.code).equals(t),"The contract code DOES NOT match the multisig code from this repository");const l=s.balance,c=function(e){const t=e.beginParse(),r=t.loadUintBig(256),n=t.loadUint(8),i=ld(t.loadRef()),o=t.loadUint(8),s=ld(t.loadMaybeRef()),a=t.loadBit();return cd(t),{nextOderSeqno:r,threshold:n,signers:i,signersCount:o,proposers:s,allowArbitraryOrderSeqno:a}}(a.Cell.fromBase64(s.data));c.allowArbitraryOrderSeqno&&rd(c.nextOderSeqno===BigInt(0),"invalid nextOrderSeqno for allowArbitraryOrderSeqno");const d=c.signers,u=c.proposers;rd(d.length===c.signersCount,"invalid signersCount"),rd(c.threshold>0,"threshold <= 0"),rd(c.threshold<=c.signersCount,"invalid threshold");const h=[];for(const e of d)h.push(await Yc(e,n));const f=[];for(const e of u)f.push(await Yc(e,n));const p=dd.createFromAddress(e.address),g=new Zc(e.address,n);if(o){const e=await p.getMultisigData(g);c.allowArbitraryOrderSeqno?rd(e.nextOrderSeqno===BigInt(-1),"nextOderSeqno doesn't match"):rd(e.nextOrderSeqno===c.nextOderSeqno,"nextOderSeqno doesn't match"),rd(e.threshold===BigInt(c.threshold),"threshold doesn't match"),rd(td(e.signers,c.signers),"invalid signers"),rd(td(e.proposers,c.proposers),"invalid proposers")}const m=dd.createFromConfig({threshold:c.threshold,signers:c.signers,proposers:c.proposers,allowArbitrarySeqno:c.allowArbitraryOrderSeqno},t).address.equals(e.address),y={address:e,multisigContract:p,provider:g,signers:h,proposers:f,threshold:c.threshold,allowArbitraryOrderSeqno:c.allowArbitraryOrderSeqno,nextOderSeqno:c.nextOderSeqno,tonBalance:l,lastOrders:[],stateInitMatches:m};let b=[];if("none"!==i){const t=await Hc("transactions",{account:Xc(e),limit:256},n);for(const i of t.transactions){if(!i.in_msg.message_content)continue;if(!i.in_msg.message_content.body)continue;const t=a.Cell.fromBase64(i.in_msg.message_content.body).beginParse();if(t.remainingBits<32)continue;const o=t.loadUint(32);if(1963556701===o)try{t.loadUintBig(64);const o=t.loadUintBig(256),s=a.Address.parse(i.in_msg.source),l=hd.createFromConfig({multisig:e.address,orderSeqno:o},r);if(!s.equals(l.address))throw new Error("fake order");b.push({utime:i.now,type:"execute",order:{address:{address:s,isBounceable:!0,isTestOnly:n},id:o}})}catch(e){b.push({utime:i.now,type:"execute",errorMessage:e.message})}else if(4145565967===o)try{if(1!==i.out_msgs.length)throw new Error("invalid out messages");const o=i.out_msgs[0],{orderAddress:s,orderId:l}=xd(o),c=hd.createFromConfig({multisig:e.address,orderSeqno:l},r);if(!s.equals(c.address))throw new Error("fake order");const d=t.loadUint(64),u=(t.loadUint(256),t.loadUint(1)),h=t.loadUint(8),f=t.loadUint(48),p=t.loadRef().beginParse().loadDictDirect(a.Dictionary.Keys.Uint(8),a.Dictionary.Values.Cell());cd(t),console.log("IN",{queryId:d,orderId:l,orderAddress:s.toString(),isSigner:u,index:h,expiredAt:f,order:p}),b.push({utime:i.now,type:"new",order:{address:{address:s,isBounceable:!0,isTestOnly:n},id:l}})}catch(e){console.log(e),b.push({utime:i.now,type:"new",errorMessage:"Invalid new order: "+e.message})}}if("aggregate"===i){const e={};for(let t of b){if(t.errorMessage)continue;const r=t.order.id.toString();e[r]?"executed"!==e[r].type&&"execute"===t.type&&(e[r].utime=t.utime,e[r].type="executed"):e[r]={utime:t.utime,type:"new"===t.type?"pending":"executed",order:t.order}}b=Object.values(e);for(const e of b)if("pending"===e.type){const t=await _d(e.order.address,r,y,n,!1);e.orderInfo=t,(new Date).getTime()>t.expiresAt.getTime()&&(e.type="executed")}b=b.sort(((e,t)=>e.type===t.type?t.utime-e.utime:"pending"===e.type?-1:1))}}return y.lastOrders=b,y})(a.Address.parseFriendly(e),Yu,Qu,Vu,"aggregate",t);if(Ju!==e)return;Xu=r,rh(),$u(Du("#multisig_content"),!0),$u(Du("#multisig_error"),!1)}catch(t){if(console.error(t),Ju!==e)return;$u(Du("#multisig_content"),!1),$u(Du("#multisig_error"),!0),Du("#multisig_error").innerText=t.message}clearTimeout(eh),eh=setTimeout((()=>nh(e,!1)),5e3),t&&Zu("multisigScreen")},ih=async(e,t)=>{Zu("loadingScreen"),th(),Ju=e,localStorage.setItem("multisigAddress",e),Ku(e,t);const r=a.Address.parseFriendly(Ju);r.isBounceable=!0,r.isTestOnly=Vu,Du("#mulisig_address").innerHTML=Jc(r),await nh(e,!0)};let oh,sh;Du("#multisig_logoutButton").addEventListener("click",(()=>{localStorage.removeItem("multisigAddress"),th(),Zu("startScreen")})),Du("#multisig_createNewOrderButton").addEventListener("click",(()=>{Zu("newOrderScreen")})),Du("#multisig_updateButton").addEventListener("click",(()=>{jh("update")}));let ah=-1;const lh=()=>{oh=void 0,sh=void 0,clearTimeout(ah)},ch=(e,t)=>{Du("#order_approveButton").innerText=t?e?"Executing..":"Execute":e?"Approving..":"Approve",Du("#order_approveButton").disabled=e},dh=()=>{const{tonBalance:e,actions:t,isExecuted:r,approvalsNum:n,approvalsMask:i,threshold:o,signers:s,expiresAt:l}=sh,c=(new Date).getTime()>l.getTime();Du("#order_tonBalance").innerText=(0,a.fromNano)(e)+" TON",Du("#order_executed").innerText=r?"Yes":"Not yet",Du("#order_approvals").innerText=n+"/"+o,Du("#order_expiresAt").innerText=(c?"❌ EXPIRED - ":"")+l.toString();let d=!1,u="";for(let e=0;e#${e} — ${r} — ${n?"✅":"❌"}${ed(t.address,Wu)?Fu:""}`}Du("#order_signersList").innerHTML=u;let h="";for(const e of t)h+=e;0===t.length?Du("#order_actionsTitle").innerText="No actions":1===t.length?Du("#order_actionsTitle").innerText="One action:":Du("#order_actionsTitle").innerText=t.length+" actions:",Du("#order_actions").innerHTML=h;let f=Number(localStorage.getItem(Ju+"_"+oh+"_approve"));Date.now()-f>12e4&&!d&&(f=0,localStorage.removeItem(Ju+"_"+oh+"_approve")),ch(!!f,n===o-1),$u(Du("#order_approveButton"),!r&&!c&&!d),$u(Du("#order_approveNote"),!r&&!c&&!d)},uh=async(e,t,r)=>{try{const n=await _d(e,Qu,Xu,Vu,r);if(oh!==t)return;sh=n,dh(),$u(Du("#order_content"),!0),$u(Du("#order_error"),!1)}catch(e){if(console.error(e),oh!==t)return;$u(Du("#order_content"),!1),$u(Du("#order_error"),!0),Du("#order_error").innerText=e.message}clearTimeout(ah),ah=setTimeout((()=>uh(e,t,!1)),5e3),r&&Zu("orderScreen")},hh=async(e,t)=>{if(!Xu)throw new Error("setOrderId: no multisig info");if(Zu("loadingScreen"),lh(),oh=e,Ku(Ju,e),void 0===t){const r=hd.createFromConfig({multisig:a.Address.parseFriendly(Ju).address,orderSeqno:e},Qu);t=qu(r.address)}Du("#order_id").innerText="#"+oh;const r=a.Address.parseFriendly(t);r.isBounceable=!0,r.isTestOnly=Vu,Du("#order_address").innerHTML=Jc(r),await uh(r,e,!0)};Du("#order_backButton").addEventListener("click",(()=>{Ku(Ju),lh(),Zu("multisigScreen")})),Du("#order_approveButton").addEventListener("click",(async()=>{if(!Ju)throw new Error("approve !currentMultisigAddress");if(!sh)throw new Error("approve !currentOrderInfo");const e=Ju,t=sh;if(!Wu)return void alert("Please connect wallet");if(-1==t.signers.findIndex((e=>e.address.equals(Wu))))return void alert("You are not signer");const r=Xc(t.address),n=gh.toString(),i=(0,a.beginCell)().storeUint(0,32).storeStringTail("approve").endCell().toBoc().toString("base64");console.log({orderAddressString:r,amount:n});const o={validUntil:Math.floor(Date.now()/1e3)+60,messages:[{address:r,amount:n,payload:i}]};ch(!0,t.approvalsNum===t.threshold-1),localStorage.setItem(e+"_"+t.orderId+"_approve",Date.now().toString());try{await Gu.sendTransaction(o)}catch(r){console.error(r),localStorage.removeItem(e+"_"+t.orderId+"_approve"),Ju===e&&oh===t.orderId&&ch(!1,t.approvalsNum===t.threshold-1)}}));const fh=(e,t,r)=>{const n=t=>({error:e+": "+t}),i=e=>({value:e});if(null==t||""===t)return n("Empty");switch(r){case"TON":return((e,t)=>{try{const r=function(e,t){const r=function(e){let t=1n;for(let r=0;r2)throw Error("Invalid number");let o=i[0],s=i[1];if(o||(o="0"),s||(s="0"),s.length>t)throw Error("Invalid number");for(;s.length{try{const t=BigInt(e);return t<=0?n("Enter positive amount"):i(t)}catch(e){return n("Invalid amount")}})(t);case"Address":if(!a.Address.isFriendly(t))return n("Invalid Address");const e=a.Address.parseFriendly(t);return e.isTestOnly&&!Vu?n("Please enter mainnet address"):i(e);case"URL":return t.startsWith("https://")?i(t):n("Invalid URL");case"Status":return md.indexOf(t)>-1?i(t):n("Invalid status. Please use: "+md.join(", "))}},ph=(0,a.toNano)("0.2"),gh=(0,a.toNano)("0.1"),mh=(0,a.toNano)("0.05"),yh=async e=>{try{const t=Xu,r=await Ed(e.jettonMinterAddress,Vu,!1);return t.address.address.equals(r.adminAddress)?{value:r}:{error:"Multisig is not admin of this jetton"}}catch(e){return console.error(e),{error:"Jetton-minter check error"}}},bh=async e=>{try{const t=await Xu.multisigContract.getOrderAddress(Xu.provider,e);return"uninit"===(await Hc("account",{address:t.toRawString()},Vu)).status?{value:!0}:{error:`Order ${e} already exists`}}catch(e){return console.error(e),{error:"Possibly connectivity error"}}},wh=[{name:"Transfer TON",fields:{amount:{name:"TON Amount",type:"TON"},toAddress:{name:"Destination Address",type:"Address"}},makeMessage:async e=>({toAddress:e.toAddress,tonAmount:e.amount,body:(0,a.beginCell)().endCell()})},{name:"Transfer Jetton",fields:{jettonMinterAddress:{name:"Jetton Minter Address",type:"Address"},amount:{name:"Jetton Amount (in units)",type:"Jetton"},toAddress:{name:"To Address",type:"Address"}},makeMessage:async e=>{const t=e.jettonMinterAddress.address,r=Xu.address.address,n=vd.createFromAddress(t),i=new Zc(t,Vu);return{toAddress:{address:await n.getWalletAddress(i,r),isBounceable:!0,isTestOnly:Vu},tonAmount:gh,body:gd.transferMessage(e.amount,e.toAddress.address,r,null,0n,null)}}},{name:"Mint Jetton",fields:{jettonMinterAddress:{name:"Jetton Minter Address",type:"Address"},amount:{name:"Jetton Amount (in units)",type:"Jetton"},toAddress:{name:"To Address",type:"Address"}},check:yh,makeMessage:async e=>({toAddress:e.jettonMinterAddress,tonAmount:gh,body:vd.mintMessage(e.toAddress.address,e.amount,e.jettonMinterAddress.address,Xu.address.address,null,0n,mh)})},{name:"Change Jetton Admin",fields:{jettonMinterAddress:{name:"Jetton Minter Address",type:"Address"},newAdminAddress:{name:"New Admin Address",type:"Address"}},check:yh,makeMessage:async e=>({toAddress:e.jettonMinterAddress,tonAmount:gh,body:vd.changeAdminMessage(e.newAdminAddress.address)})},{name:"Claim Jetton Admin",fields:{jettonMinterAddress:{name:"Jetton Minter Address",type:"Address"}},check:async e=>{try{const t=Xu,r=await Ed(e.jettonMinterAddress,Vu,!0);return r.nextAdminAddress&&t.address.address.equals(r.nextAdminAddress)?{value:r}:{error:"Multisig is not next-admin of this jetton"}}catch(e){return console.error(e),{error:"Jetton-minter check error"}}},makeMessage:async e=>({toAddress:e.jettonMinterAddress,tonAmount:gh,body:vd.claimAdminMessage()})},{name:"Top-up Jetton Minter",fields:{jettonMinterAddress:{name:"Jetton Minter Address",type:"Address"},amount:{name:"TON Amount",type:"TON"}},makeMessage:async e=>({toAddress:e.jettonMinterAddress,tonAmount:e.amount,body:vd.topUpMessage()})},{name:"Change Jetton Metadata URL",fields:{jettonMinterAddress:{name:"Jetton Minter Address",type:"Address"},newMetadataUrl:{name:"New Metadata URL",type:"URL"}},check:yh,makeMessage:async e=>({toAddress:e.jettonMinterAddress,tonAmount:gh,body:vd.changeContentMessage({uri:e.newMetadataUrl})})},{name:"Force Burn Jetton",fields:{jettonMinterAddress:{name:"Jetton Minter Address",type:"Address"},amount:{name:"Jetton Amount (in units)",type:"Jetton"},fromAddress:{name:"User Address",type:"Address"}},check:yh,makeMessage:async e=>({toAddress:e.jettonMinterAddress,tonAmount:gh,body:vd.forceBurnMessage(e.amount,e.fromAddress.address,Xu.address.address,mh)})},{name:"Force Transfer Jetton",fields:{jettonMinterAddress:{name:"Jetton Minter Address",type:"Address"},amount:{name:"Jetton Amount (in units)",type:"Jetton"},fromAddress:{name:"From Address",type:"Address"},toAddress:{name:"To Address",type:"Address"}},check:yh,makeMessage:async e=>({toAddress:e.jettonMinterAddress,tonAmount:gh,body:vd.forceTransferMessage(e.amount,e.toAddress.address,e.fromAddress.address,e.jettonMinterAddress.address,null,0n,null,mh)})},{name:"Set status for Jetton Wallet",fields:{jettonMinterAddress:{name:"Jetton Minter Address",type:"Address"},userAddress:{name:"User Address",type:"Address"},newStatus:{name:`New Status (${md.join(", ")})`,type:"Status"}},check:yh,makeMessage:async e=>({toAddress:e.jettonMinterAddress,tonAmount:gh,body:vd.lockWalletMessage(e.userAddress.address,yd(e.newStatus),mh)})}],vh=Du("#newOrder_typeInput");vh.innerHTML=(()=>{let e="";for(let t=0;t${wh[t].name}`;return e})();const Ch=e=>{const t=wh[e];let r="";for(let n in t.fields)if(t.fields.hasOwnProperty(n)){const i=t.fields[n];if(r+=`
    ${i.name}:
    `,"Status"===i.type){r+=`"}else r+=``}Du("#newOrder_fieldsContainer").innerHTML=r};vh.addEventListener("change",(e=>{Ch(vh.selectedIndex)})),Ch(0);let _h,kh="fill";const xh=()=>{if(!Xu)return"";let e=-1n;return Xu.lastOrders.forEach((t=>{t.order.id>e&&(e=t.order.id)})),-1n===e?"":(e+1n).toString()},Ah=()=>{Eh("fill"),_h=void 0,vh.selectedIndex=0,Ch(0),Du("#newOrder_orderId").value=xh()},Sh=e=>{Du("#newOrder_createButton").disabled=e,Du("#newOrder_backButton").disabled=e},Bh=e=>{const t=vh.selectedIndex,r=wh[t];vh.disabled=e,Du("#newOrder_orderId").disabled=e;for(let n in r.fields)r.fields.hasOwnProperty(n)&&(Du(`#newOrder_${t}_${n}`).disabled=e);Sh(e)},Eh=e=>{"fill"==e?(Bh(!1),Du("#newOrder_createButton").innerHTML="Create",Du("#newOrder_backButton").innerHTML="Back"):(Bh(!0),Du("#newOrder_createButton").innerHTML="Send Transaction",Du("#newOrder_backButton").innerHTML="Cancel"),kh=e};Du("#newOrder_createButton").addEventListener("click",(async()=>{if(!Wu)return void alert("Please connect wallet");if("confirm"===kh){if(!_h)throw new Error("");try{await Gu.sendTransaction({validUntil:Math.floor(Date.now()/1e3)+60,messages:[_h.message]}),Ju===qu(_h.multisigAddress)&&hh(_h.orderId)}catch(e){console.error(e)}return}const e=Ph(Du("#newOrder_orderId"));if(null==e||e<0)return void alert("Invalid Order ID");const t=vh.selectedIndex,r=wh[t],n={};for(let e in r.fields)if(r.fields.hasOwnProperty(e)){const i=r.fields[e],o=Du(`#newOrder_${t}_${e}`).value,s=fh(i.name,o,i.type);if(s.error)return void alert(s.error);n[e]=s.value}Bh(!0);const i=await bh(e);if(i.error)return alert(i.error),void Eh("fill");if(r.check){const e=await r.check(n);if(e.error)return alert(e.error),void Eh("fill")}const o=await r.makeMessage(n),s=Xu.proposers.findIndex((e=>e.address.equals(Wu))),l=Xu.signers.findIndex((e=>e.address.equals(Wu)));if(-1===s&&-1===l)return alert("Error: you are not proposer and not signer"),void Eh("fill");const c=l>-1,d=o.toAddress,u=o.tonAmount,h=o.body,f=Math.floor(Date.now()/1e3)+2592e3,p=dd.packOrder([{type:"transfer",sendMode:a.SendMode.PAY_GAS_SEPARATELY,message:{info:{type:"internal",ihrDisabled:!1,bounce:!0,bounced:!1,dest:d.address,value:{coins:u},ihrFee:0n,forwardFee:0n,createdLt:0n,createdAt:0},body:h}}]),g=dd.newOrderMessage(p,f,c,c?l:s,e,0n),m=g.toBoc().toString("base64");console.log({toAddress:d,tonAmount:u,payloadCell:h,message:g,orderId:e});const y=Ju,b=ph.toString();_h={multisigAddress:a.Address.parseFriendly(y).address,orderId:e,message:{address:y,amount:b,payload:m}},Eh("confirm"),Sh(!1)})),Du("#newOrder_backButton").addEventListener("click",(()=>{"fill"==kh?Zu("multisigScreen"):Eh("fill")}));const Ph=e=>{if(""===e.value)return null;try{return BigInt(e.value)}catch(e){return null}},Ih=Du("#newMultisig_threshold"),Mh=Du("#newMultisig_orderId");let Uh,Th,Oh="create",Rh="fill";const jh=e=>{Oh=e,Zu("newMultisigScreen")},Lh=()=>{if(Rh="fill",Uh={signersCount:0,proposersCount:0},Th=void 0,Du("#newMultisig_signersContainer").innerHTML="",Du("#newMultisig_proposersContainer").innerHTML="",Mh.value=xh(),Ih.value="",$u(Du("#newMultisig_orderIdLabel"),"update"===Oh),$u(Du("#newMultisig_orderId"),"update"===Oh),"create"===Oh)Nh(0),Uh.signersCount=1;else{Uh.signersCount=Xu.signers.length;for(let e=0;e{const e=Du("#newMultisig_deleteSigner0");$u(e,Uh.signersCount>1)},Nh=(e,t)=>{const r=document.createElement("div");r.classList.add("address-input"),r.innerHTML=`
    #${e}.
    `,Du("#newMultisig_signersContainer").appendChild(r),Du(`#newMultisig_signer${e}`).value=void 0===t?"":t,r.querySelector(`#newMultisig_deleteSigner${e}`).addEventListener("click",$h)},Dh=(e,t)=>{const r=document.createElement("div");r.classList.add("address-input"),r.innerHTML=`
    #${e}.
    `,Du("#newMultisig_proposersContainer").appendChild(r),Du(`#newMultisig_proposer${e}`).value=void 0===t?"":t,r.querySelector(`#newMultisig_deleteProposer${e}`).addEventListener("click",Fh)},$h=e=>{const t=e.target,r=Number(t.id.slice(24));if(isNaN(r))throw new Error;const n=[];for(let e=0;e{const t=e.target,r=Number(t.id.slice(26));if(isNaN(r))throw new Error;const n=[];for(let e=0;e{Nh(Uh.signersCount),Uh.signersCount++,zh()})),Du("#newMultisig_addProposerButton").addEventListener("click",(async()=>{Dh(Uh.proposersCount),Uh.proposersCount++}));const Kh=()=>{const e="confirm"===Rh;Mh.disabled=e,Ih.disabled=e,$u(Du("#newMultisig_addSignerButton"),!e),$u(Du("#newMultisig_addProposerButton"),!e);for(let t=0;t1)}for(let t=0;t{"fill"===Rh?Zu("create"===Oh?"startScreen":"multisigScreen"):(Rh="fill",Kh())}));const Vh=e=>{Du("#newMultisig_createButton").disabled=e,Du("#newMultisig_createButton").innerText=e?"Checking..":"confirm"===Rh?"Confirm":"update"===Oh?"Update":"Create",Du("#newMultisigScreen").style.pointerEvents=e?"none":"auto"};Du("#newMultisig_createButton").addEventListener("click",(async()=>{if(!Wu)return void alert("Please connect wallet");if("confirm"===Rh){try{const e=Th.orderId,t=Th.multisigAddress;await Gu.sendTransaction({validUntil:Math.floor(Date.now()/1e3)+60,messages:[Th.message]}),"update"===Oh?Ju===qu(t)&&hh(e):ih(qu(t))}catch(e){console.error(e)}return}const e=(e=>{if(""===e.value)return null;try{const t=parseInt(e.value);return isNaN(t)?null:t}catch(e){return null}})(Ih);if(null==e||e<=0||e>Uh.signersCount)return void alert("Threshold count: not valid number");let t;if("update"===Oh){if(t=Ph(Mh),null==t||t<0)return void alert("Invalid order Id");Vh(!0);const e=await bh(t);if(Vh(!1),e.error)return void alert(e.error)}const r={},n=[];for(let e=0;e{null!=o.splitDepth?(e.storeBit(!0),e.storeUint(o.splitDepth,5)):e.storeBit(!1),null!=o.special?(e.storeBit(!0),e.store(function(e){return t=>{t.storeBit(e.tick),t.storeBit(e.tock)}}(o.special))):e.storeBit(!1),e.storeMaybeRef(o.code),e.storeMaybeRef(o.data),e.storeDict(o.libraries)})(l),Th={multisigAddress:r,message:{address:r.toString({urlSafe:!0,bounceable:!0,testOnly:Vu}),amount:s,stateInit:l.endCell().toBoc().toString("base64")}},Rh="confirm",Kh()}else{const r=Xu.proposers.findIndex((e=>e.address.equals(Wu))),o=Xu.signers.findIndex((e=>e.address.equals(Wu)));if(-1===r&&-1===o)return void alert("Error: you are not proposer and not signer");const s=o>-1,l=Math.floor(Date.now()/1e3)+2592e3,c=dd.packOrder([{type:"update",threshold:e,signers:n,proposers:i}]),d=dd.newOrderMessage(c,l,s,s?o:r,t,0n).toBoc().toString("base64"),u=Ju,h=gh.toString();Th={multisigAddress:a.Address.parseFriendly(u).address,orderId:t,message:{address:u,amount:h,payload:d}},Rh="confirm",Kh()}var o}));const qh=e=>{if(a.Address.isFriendly(e))return a.Address.parseFriendly(e)},Hh=async()=>{th(),lh();const e=window.location.hash.substring(1);if(e){const{multisigAddress:t,orderId:r}=(e=>{if(e.indexOf("/")>-1){const t=e.split("/");if(2!==t.length)return{};const r=qh(t[0]);if(void 0===r)return{};const n=(e=>{try{const t=BigInt(e);if(t<0)return;return t}catch(e){return}})(t[1]);return void 0===n?{}:{multisigAddress:r,orderId:n}}return{multisigAddress:qh(e)}})(e);if(console.log(t,r),void 0===t)alert("Invalid URL"),Zu("startScreen");else{const e=qu(t.address);await ih(e,r),void 0!==r&&Ju===e&&await hh(r,void 0)}}else(()=>{const e=localStorage.getItem("multisigAddress");e?ih(e):Zu("startScreen")})()};Hh(),window.onpopstate=()=>Hh()})()})(); \ No newline at end of file +`,Oc=e=>{const t=Gn(e),r=nt(Bs),[n,i]=Ze(!0);let o;(null==r?void 0:r.wallet)&&"universalLink"in r.wallet&&("universal-link"===r.wallet.openMethod||L(r.wallet.universalLink)&&On())&&(o=r.wallet.universalLink);const s=()=>{const e=Jr(),t="returnStrategy"in e?e.returnStrategy:Ga.returnStrategy;if(L(o)){const r=!n();i(!1),El(o,{returnStrategy:t,twaReturnUrl:"twaReturnUrl"in e?e.twaReturnUrl:Ga.twaReturnUrl,forceRedirect:r})}else Tr(Bl(o,t))};return kt(Pc,Bt(t,{get children(){return[Qe((()=>e.icon)),kt(Mc,{get translationKey(){return e.headerTranslationKey},get translationValues(){return e.headerTranslationValues}}),kt(Uc,{get translationKey(){return e.textTranslationKey},get translationValues(){return e.textTranslationValues}}),kt(Pt,{get when(){return"open-wallet"!==e.showButton},get children(){return kt(Tc,{onClick:()=>e.onClose(),get children(){return kt(Sl,{translationKey:"common.close",children:"Close"})}})}}),kt(Pt,{get when(){return"open-wallet"===e.showButton&&o},get children(){return kt(Tc,{onClick:s,get children(){return kt(Sl,{translationKey:"common.openWallet",children:"Open wallet"})}})}})]}}))},Rc=e=>{const t=nt(Bs),[r]=Gi();return kt(Oc,{headerTranslationKey:"actionModal.confirmTransaction.header",get headerTranslationValues(){return{name:t.wallet&&"name"in t.wallet?t.wallet.name:r("common.yourWallet",{},"Your wallet")}},textTranslationKey:"actionModal.confirmTransaction.text",get icon(){return kt(Mo,{size:"m"})},onClose:()=>e.onClose(),showButton:"open-wallet","data-tc-confirm-modal":"true"})},jc=e=>kt(Oc,{headerTranslationKey:"actionModal.transactionCanceled.header",textTranslationKey:"actionModal.transactionCanceled.text",get icon(){return kt(Bo,{size:"m"})},onClose:()=>e.onClose(),"data-tc-transaction-canceled-modal":"true"}),Lc=e=>kt(Oc,{headerTranslationKey:"actionModal.transactionSent.header",textTranslationKey:"actionModal.transactionSent.text",get icon(){return kt(ko,{size:"m"})},onClose:()=>e.onClose(),"data-tc-transaction-sent-modal":"true"}),zc=()=>kt(Ai,{get opened(){var e;return Qe((()=>null!==Jr()))()&&!0===(null==(e=Jr())?void 0:e.openModal)},get enableAndroidBackHandler(){return Ga.enableAndroidBackHandler},onClose:()=>Xr(null),"data-tc-actions-modal-container":"true",get children(){return kt(Mt,{get children(){return[kt(Ut,{get when(){return"transaction-sent"===Jr().name},get children(){return kt(Lc,{onClose:()=>Xr(null)})}}),kt(Ut,{get when(){return"transaction-canceled"===Jr().name},get children(){return kt(jc,{onClose:()=>Xr(null)})}}),kt(Ut,{get when(){return"confirm-transaction"===Jr().name},get children(){return kt(Rc,{onClose:()=>Xr(null)})}})]}})}}),Nc=e=>{const t=((e={},t=(navigator.language in e?navigator.language:Object.keys(e)[0]))=>{const[r,n]=Ze(t),[i,o]=bn(e);return[(e,t,n)=>{const o=Zi(i[r()],e,n||"");return"function"==typeof o?o(t):"string"==typeof o?((e,t,r=/{{(.*?)}}/g)=>e.replace(r,((e,r)=>Zi(t,r,""))))(o,t||{}):o},{add(e,t){o(e,(e=>Object.assign(e||{},t)))},locale:e=>e?n(e):r(),dict:e=>Zi(i,e)}]})(en,Ga.language);return customElements.define(kr,class extends HTMLElement{}),document.body.hasAttribute("ontouchstart")||document.body.setAttribute("ontouchstart",""),kt(Wi.Provider,{value:t,get children(){return kt(Bs.Provider,{get value(){return e.tonConnectUI},get children(){return kt(rn.Provider,{get value(){return Ga.connector},get children(){return[kt(Sr,{}),kt(br,{theme:kn,get children(){return[kt(Pt,{get when(){return Ga.buttonRootId},get children(){return kt(rr,{get mount(){return document.getElementById(Ga.buttonRootId)},get children(){return kt(qa,{})}})}}),kt(nr,{component:kr,get children(){return[kt(Ic,{}),kt(zc,{})]}})]}})]}})}})}})},Dc=()=>{setTimeout((()=>Hr({status:"opened",closeReason:null})))},$c=e=>{setTimeout((()=>Xr(e)))};class Fc{constructor(e){Ie(this,"connector"),Ie(this,"setConnectRequestParametersCallback"),Ie(this,"consumers",[]),Ie(this,"state",qr()),this.connector=e.connector,this.setConnectRequestParametersCallback=e.setConnectRequestParametersCallback,Ye((()=>{const e=qr();this.state=e,this.consumers.forEach((t=>t(e)))}))}open(){return Pe(this,null,(function*(){const e=(yield this.connector.getWallets()).find(ee);return e?this.connectEmbeddedWallet(e):this.connectExternalWallet()}))}close(){var e;e="action-cancelled",setTimeout((()=>Hr({status:"closed",closeReason:e})))}onStateChange(e){return this.consumers.push(e),()=>{this.consumers=this.consumers.filter((t=>t!==e))}}connectEmbeddedWallet(e){const t=t=>{Qr(e),this.connector.connect({jsBridgeKey:e.jsBridgeKey},t)},r=Ga.connectRequestParameters;"loading"===(null==r?void 0:r.state)?this.setConnectRequestParametersCallback(t):t(null==r?void 0:r.value)}connectExternalWallet(){return Pe(this,null,(function*(){return On()&&Rn(),Dc(),new Promise((e=>{const t=this.onStateChange((r=>{const{status:n}=r;"opened"===n&&(t(),e())}))}))}))}}class Kc{constructor(e){Ie(this,"connector"),Ie(this,"consumers",[]),this.connector=e.connector,Ye((()=>{const e=Jr();this.consumers.forEach((t=>t(e)))}))}onStateChange(e){return this.consumers.push(e),()=>{this.consumers=this.consumers.filter((t=>t!==e))}}}var Vc=r(3515);const qc="d843619b379084d133f061606beecbf72ae2bf60e0622e808f2a3f631673599b",Hc=async(e,t,r)=>{const n=r?"https://testnet.toncenter.com/api/v3/":"https://toncenter.com/api/v3/",i={"Content-Type":"application/json","X-API-Key":qc},o=await fetch(n+e+"?"+new URLSearchParams(t),{method:"GET",headers:i}),s=await o.json();if(s.error)throw new Error(s.error);return s};class Zc{constructor(e,t){this.contractAddress=e,this.isTestnet=t,this.tonClient=new Vc.TonClient({endpoint:t?"https://testnet.toncenter.com/api/v2/jsonRPC":"https://toncenter.com/api/v2/jsonRPC",apiKey:qc})}getState(){throw new Error("Method not implemented.")}get(e,t){return this.tonClient.runMethod(this.contractAddress,e,t)}external(e){throw new Error("Method not implemented.")}internal(e,t){throw new Error("Method not implemented.")}open(e){throw new Error("Method not implemented.")}getTransactions(e,t,r,n){throw new Error("Method not implemented.")}}const Wc=(e,t)=>a.Address.isFriendly(e)?a.Address.parseFriendly(e).isTestOnly&&!t?"Please enter mainnet address":null:"Invalid address",Gc={},Yc=async(e,t)=>{const r=e.toRawString();let n=Gc[r];return n||(n=(await Hc("addressBook",{address:r},t))[r].user_friendly,Gc[r]=n),a.Address.parseFriendly(n)},Qc=async(e,t)=>{const r=await Yc(e,t);return Jc(r)},Jc=e=>{const t=Xc(e),r=((e,t)=>(a.Address.parseFriendly(e),(t?"https://testnet.tonviewer.com/":"https://tonviewer.com/")+e))(t,e.isTestOnly);return`${t}`},Xc=e=>e.address.toString({bounceable:e.isBounceable,testOnly:e.isTestOnly}),ed=(e,t)=>e?t?e.equals(t):!e:!t,td=(e,t)=>{if(e.length!==t.length)return!1;for(let r=0;r{if(!e)throw console.error(t),new Error(t)},nd=e=>{const t=document.createElement("div");return t.innerText=e,t.innerHTML};class id{}id.multisig={new_order:4145565967,execute:1963556701,execute_internal:2737592767},id.order={approve:2808226575,expired:6,approve_rejected:2947491902,approved:2187369462,init:2624846754},id.actions={send_message:4046986843,update_multisig_params:487390163};class od{}od.multisig={unauthorized_new_order:1007,invalid_new_order:1008,not_enough_ton:100,unauthorized_execute:101,singers_outdated:102,invalid_dictionary_sequence:103,expired:111},od.order={unauthorized_init:104,already_approved:107,already_inited:105,unauthorized_sign:106,expired:111,unknown_op:65535,already_executed:112};class sd{}function ad(e){let t=a.Dictionary.empty(a.Dictionary.Keys.Uint(8),a.Dictionary.Values.Address());for(let r=0;r0||e.remainingRefs>0)throw new Error("remaining bits in data")}sd.bitsize={op:32,queryId:64,orderSeqno:256,signerIndex:8,actionIndex:8,time:48};class dd{constructor(e,t,r){this.address=e,this.init=t,this.configuration=r,this.orderSeqno=0n}static createFromAddress(e){let t=new dd(e);return t.orderSeqno=0n,t}static createFromConfig(e,t,r=0){const n=function(e){return(0,a.beginCell)().storeUint(0,sd.bitsize.orderSeqno).storeUint(e.threshold,sd.bitsize.signerIndex).storeRef((0,a.beginCell)().storeDictDirect(ad(e.signers))).storeUint(e.signers.length,sd.bitsize.signerIndex).storeDict(ad(e.proposers)).storeBit(e.allowArbitrarySeqno).endCell()}(e),i={code:t,data:n};return new dd((0,a.contractAddress)(r,i),i,e)}async sendDeploy(e,t,r){await e.internal(t,{value:r,sendMode:a.SendMode.PAY_GAS_SEPARATELY,body:(0,a.beginCell)().storeUint(0,sd.bitsize.op).storeUint(0,sd.bitsize.queryId).endCell()})}static packTransferRequest(e){let t=(0,a.beginCell)().store((0,a.storeMessageRelaxed)(e.message)).endCell();return(0,a.beginCell)().storeUint(id.actions.send_message,sd.bitsize.op).storeUint(e.sendMode,8).storeRef(t).endCell()}static packUpdateRequest(e){return(0,a.beginCell)().storeUint(id.actions.update_multisig_params,sd.bitsize.op).storeUint(e.threshold,sd.bitsize.signerIndex).storeRef((0,a.beginCell)().storeDictDirect(ad(e.signers))).storeDict(ad(e.proposers)).endCell()}static packOrder(e){let t=a.Dictionary.empty(a.Dictionary.Keys.Uint(8),a.Dictionary.Values.Cell());if(e.length>255)throw new Error("For action chains above 255, use packLarge method");for(let r=0;r{switch(e){case"unlock":return 0;case"out":return 1;case"in":return 2;case"full":return 3;default:throw new Error("Invalid argument!")}},bd=e=>{switch(e){case"unlock":return"Unlock";case"out":return"Outgoing transfers locked";case"in":return"Inbound transfers locked";case"full":return"Outgoing and Inbound transfers locked"}};function wd(e){if(e.remainingBits>0||e.remainingRefs>0)throw new Error("remaining bits in data")}class vd{constructor(e,t){this.address=e,this.init=t}static createFromAddress(e){return new vd(e)}static createFromConfig(e,t,r=0){const n=function(e){const t=e.jetton_content instanceof a.Cell?e.jetton_content:function(e){return(0,a.beginCell)().storeStringTail(e.uri).endCell()}(e.jetton_content);return(0,a.beginCell)().storeCoins(0).storeAddress(e.admin).storeAddress(null).storeRef(e.wallet_code).storeRef(t).endCell()}(e),i={code:t,data:n};return new vd((0,a.contractAddress)(r,i),i)}async sendDeploy(e,t,r){await e.internal(t,{value:r,sendMode:a.SendMode.PAY_GAS_SEPARATELY,body:(0,a.beginCell)().storeUint(fd.top_up,32).storeUint(0,64).endCell()})}static mintMessage(e,t,r,n,i,o,s){const l=(0,a.beginCell)().storeUint(fd.internal_transfer,32).storeUint(0,64).storeCoins(t).storeAddress(r).storeAddress(n).storeCoins(o).storeMaybeRef(i).endCell();return(0,a.beginCell)().storeUint(fd.mint,32).storeUint(0,64).storeAddress(e).storeCoins(s).storeRef(l).endCell()}static parseMintInternalMessage(e){if(e.loadUint(32)!==fd.internal_transfer)throw new Error("Invalid op");const t=e.loadUint(64),r=e.loadCoins(),n=e.loadAddress(),i=e.loadAddress(),o=e.loadCoins(),s=e.loadBit()?e.loadRef().beginParse():e;return wd(e),{queryId:t,jettonAmount:r,fromAddress:n,responseAddress:i,forwardTonAmount:o,forwardPayload:s}}static parseMintMessage(e){if(e.loadUint(32)!==fd.mint)throw new Error("Invalid op");const t=e.loadUint(64),r=e.loadAddress(),n=e.loadCoins(),i=e.loadRef();return wd(e),{queryId:t,toAddress:r,tonAmount:n,internalMessage:this.parseMintInternalMessage(i.beginParse())}}static topUpMessage(){return(0,a.beginCell)().storeUint(fd.top_up,32).storeUint(0,64).endCell()}static parseTopUp(e){if(e.loadUint(32)!==fd.top_up)throw new Error("Invalid op");const t=e.loadUint(64);return wd(e),{queryId:t}}static changeAdminMessage(e){return(0,a.beginCell)().storeUint(fd.change_admin,32).storeUint(0,64).storeAddress(e).endCell()}static parseChangeAdmin(e){if(e.loadUint(32)!==fd.change_admin)throw new Error("Invalid op");const t=e.loadUint(64),r=e.loadAddress();return wd(e),{queryId:t,newAdminAddress:r}}static claimAdminMessage(e=0n){return(0,a.beginCell)().storeUint(fd.claim_admin,32).storeUint(e,64).endCell()}static parseClaimAdmin(e){if(e.loadUint(32)!==fd.claim_admin)throw new Error("Invalid op");const t=e.loadUint(64);return wd(e),{queryId:t}}static changeContentMessage(e){const t=e.uri;return(0,a.beginCell)().storeUint(fd.change_metadata_url,32).storeUint(0,64).storeStringTail(t).endCell()}static parseChangeContent(e){if(e.loadUint(32)!==fd.change_metadata_url)throw new Error("Invalid op");const t=e.loadUint(64),r=e.loadStringTail();return wd(e),{queryId:t,newMetadataUrl:r}}static lockWalletMessage(e,t,r,n=0){return(0,a.beginCell)().storeUint(fd.call_to,32).storeUint(n,64).storeAddress(e).storeCoins(r).storeRef((0,a.beginCell)().storeUint(fd.set_status,32).storeUint(n,64).storeUint(t,4).endCell()).endCell()}static parseSetStatus(e){if(e.loadUint(32)!==fd.set_status)throw new Error("Invalid op");const t=e.loadUint(64),r=e.loadUint(4);return wd(e),{queryId:t,newStatus:r}}static parseCallTo(e,t){if(e.loadUint(32)!==fd.call_to)throw new Error("Invalid op");const r=e.loadUint(64),n=e.loadAddress(),i=e.loadCoins(),o=e.loadRef();return wd(e),{queryId:r,toAddress:n,tonAmount:i,action:t(o.beginParse())}}static forceTransferMessage(e,t,r,n,i,o,s,l,c=0n){const d=gd.transferMessage(e,t,n,i,o,s);return(0,a.beginCell)().storeUint(fd.call_to,32).storeUint(c,64).storeAddress(r).storeCoins(l).storeRef(d).endCell()}static parseTransfer(e){if(e.loadUint(32)!==fd.transfer)throw new Error("Invalid op");return{queryId:e.loadUint(64),jettonAmount:e.loadCoins(),toAddress:e.loadAddress(),responseAddress:e.loadAddress(),customPayload:e.loadMaybeRef(),forwardTonAmount:e.loadCoins(),forwardPayload:e.loadBit()?e.loadRef().beginParse():e}}static forceBurnMessage(e,t,r,n,i=0){return(0,a.beginCell)().storeUint(fd.call_to,32).storeUint(i,64).storeAddress(t).storeCoins(n).storeRef(gd.burnMessage(e,r,null)).endCell()}static parseBurn(e){if(e.loadUint(32)!==fd.burn)throw new Error("Invalid op");const t=e.loadUint(64),r=e.loadCoins(),n=e.loadAddress(),i=e.loadMaybeRef();return wd(e),{queryId:t,jettonAmount:r,responseAddress:n,customPayload:i}}static upgradeMessage(e,t,r=0){return(0,a.beginCell)().storeUint(fd.upgrade,32).storeUint(r,64).storeRef(t).storeRef(e).endCell()}static parseUpgrade(e){if(e.loadUint(32)!==fd.upgrade)throw new Error("Invalid op");const t=e.loadUint(64),r=e.loadRef(),n=e.loadRef();return wd(e),{queryId:t,newData:r,newCode:n}}async getWalletAddress(e,t){const r=await e.get("get_wallet_address",[{type:"slice",cell:(0,a.beginCell)().storeAddress(t).endCell()}]);return rd(1===r.stack.remaining,"invalid get_wallet_address result"),r.stack.readAddress()}async getJettonData(e){let t=await e.get("get_jetton_data",[]);return rd(5===t.stack.remaining,"invalid get_jetton_data result"),{totalSupply:t.stack.readBigNumber(),mintable:t.stack.readBoolean(),adminAddress:t.stack.readAddress(),content:t.stack.readCell(),walletCode:t.stack.readCell()}}async getNextAdminAddress(e){const t=await e.get("get_next_admin_address",[]);return rd(1===t.stack.remaining,"invalid get_next_admin_address result"),t.stack.readAddressOpt()}}const Cd=e=>{if(null===e)throw new Error("invalid number");if(void 0===e)throw new Error("invalid number");if(isNaN(e))throw new Error("invalid number");if(e<0)throw new Error("invalid number")},_d=async(e,t,r,n,i)=>{const o=await Hc("account",{address:Xc(e)},n);rd("active"===o.status,"Contract not active. If you have just created an order it should appear within ~30 seconds."),rd(a.Cell.fromBase64(o.code).equals(t),"The contract code DOES NOT match the multisig-order code from this repository");const s=o.balance,l=function(e){const t=e.beginParse(),r=t.loadAddress(),n=t.loadUintBig(256);if(0===t.remainingBits)throw new Error("Order not initialized");const i=t.loadUint(8),o=t.loadBoolean(),s=ud(t.loadRef()),a=t.loadUint(256),l=t.loadUint(8),c=t.loadUint(48),d=t.loadRef();return cd(t),{multisigAddress:r,orderSeqno:n,threshold:i,isExecuted:o,signers:s,approvalsMask:a,approvalsNum:l,expirationDate:c,order:d}}(a.Cell.fromBase64(o.data));Cd(l.threshold),rd(l.threshold>0,"Threshold <= 0"),rd(l.threshold<=l.signers.length,"Threshold invalid"),Cd(l.approvalsMask),Cd(l.approvalsNum),rd(l.approvalsNum<=l.signers.length,"ApprovalsNum invalid"),Cd(l.expirationDate);const c=[];for(const e of l.signers)c.push(await Yc(e,n));rd(l.multisigAddress.equals(r.address.address),"Multisig address does not match");const d=hd.createFromConfig({multisig:r.address.address,orderSeqno:l.orderSeqno},t);if(rd(d.address.equals(e.address),"Fake multisig-order"),l.isExecuted||(rd(r.threshold<=l.threshold,"Multisig threshold does not match order threshold"),rd(td(r.signers.map((e=>e.address)),l.signers),"Multisig signers does not match order signers")),i){const t=new Zc(e.address,n),r=hd.createFromAddress(e.address),i=await r.getOrderDataStrict(t);rd(i.multisig.equals(l.multisigAddress),"Invalid multisigAddress"),rd(i.order_seqno===l.orderSeqno,"Invalid orderSeqno"),rd(i.threshold===l.threshold,"Invalid threshold"),rd(i.executed===l.isExecuted,"Invalid isExecuted"),rd(td(i.signers,l.signers),"Invalid signers"),rd(i._approvals===BigInt(l.approvalsMask),"Invalid approvalsMask"),rd(i.approvals_num===l.approvalsNum,"Invalid approvalsNum"),rd(i.expiration_date===BigInt(l.expirationDate),"Invalid expirationDate"),rd(i.order.hash().equals(l.order.hash()),"Invalid order")}const u=hd.createFromConfig({multisig:l.multisigAddress,orderSeqno:l.orderSeqno},t).address.equals(e.address),h=a.Dictionary.loadDirect(a.Dictionary.Keys.Uint(8),a.Dictionary.Values.Cell(),l.order),f=async e=>{try{const t=e.beginParse();if(0===t.remainingBits&&0==t.remainingRefs)return"Send Toncoins from multisig without comment"}catch(e){}try{const t=e.beginParse();if(0==t.loadUint(32)){const e=t.loadStringTail();return`Send Toncoins from multisig with comment "${nd(e)}"`}}catch(e){}try{const t=e.beginParse(),r=vd.parseMintMessage(t);rd(0===r.internalMessage.forwardPayload.remainingBits&&0===r.internalMessage.forwardPayload.remainingRefs,"Mint forward payload not supported");const i=await Qc(r.toAddress,n);return`Mint ${r.internalMessage.jettonAmount} jettons (in units) to ${i}; ${(0,a.fromNano)(r.tonAmount)} TON for gas`}catch(e){}try{const t=e.beginParse();return vd.parseTopUp(t),"Top Up"}catch(e){}try{const t=e.beginParse(),r=vd.parseChangeAdmin(t);return`Change Admin to ${await Qc(r.newAdminAddress,n)}`}catch(e){}try{const t=e.beginParse();return vd.parseClaimAdmin(t),"Claim Admin"}catch(e){}try{const t=e.beginParse(),r=vd.parseChangeContent(t);return`Change metadata URL to "${nd(r.newMetadataUrl)}"`}catch(e){}try{const t=e.beginParse(),r=vd.parseTransfer(t);if(r.customPayload)throw new Error("Transfer custom payload not supported");rd(0===r.forwardPayload.remainingBits&&0===r.forwardPayload.remainingRefs,"Transfer forward payload not supported");const i=await Qc(r.toAddress,n);return`Transfer ${r.jettonAmount} jettons (in units) from multisig to user ${i};`}catch(e){}try{const t=e.beginParse(),r=vd.parseCallTo(t,vd.parseSetStatus),i=await Qc(r.toAddress,n),o=(e=>{switch(e){case 0:return"unlock";case 1:return"out";case 2:return"in";case 3:return"full";default:throw new Error("Invalid argument!")}})(r.action.newStatus);return`Lock jetton wallet of user ${i}. Set status "${o}" - "${bd(o)}"; ${(0,a.fromNano)(r.tonAmount)} TON for gas`}catch(e){}try{const t=e.beginParse(),r=vd.parseCallTo(t,vd.parseTransfer);if(r.action.customPayload)throw new Error("Force transfer custom payload not supported");rd(0===r.action.forwardPayload.remainingBits&&0===r.action.forwardPayload.remainingRefs,"Force transfer forward payload not supported");const i=await Qc(r.toAddress,n),o=await Qc(r.action.toAddress,n);return`Force transfer ${r.action.jettonAmount} jettons (in units) from user ${i} to ${o}; ${(0,a.fromNano)(r.tonAmount)} TON for gas`}catch(e){}try{const t=e.beginParse(),r=vd.parseCallTo(t,vd.parseBurn);if(r.action.customPayload)throw new Error("Burn custom payload not supported");const i=await Qc(r.toAddress,n);return`Force burn ${r.action.jettonAmount} jettons (in units) from user ${i}; ${(0,a.fromNano)(r.tonAmount)} TON for gas`}catch(e){}throw new Error("Unsupported action")};let p=[];const g=h.keys();for(let e of g){let t=`
    Action #${e}:
    `;const r=h.get(e).beginParse(),i=r.loadUint(32);if(4046986843===i){const e=r.loadUint(8);let i=[],o=!1;1&e&&i.push("Pays fees separately"),2&e&&i.push("Ignore sending errors"),128&e&&(o=!0,i.push("CARRY ALL BALANCE")),64&e&&i.push("Carry all the remaining value of the inbound message"),32&e&&i.push("DESTROY ACCOUNT");const s=r.loadRef();cd(r);const l=(0,a.loadMessageRelaxed)(s.beginParse());console.log(l);const c=l.info,d=await Qc(c.dest,n);t+=`
    Send ${o?"ALL BALANCE":(0,a.fromNano)(c.value.coins)} TON to ${d}
    `,t+=`
    ${await f(l.body)}
    `,e&&(t+=`
    Send mode: ${i.join(", ")}.
    `)}else{if(487390163!==i)throw new Error("Unknown action");{const e=r.loadUint(8),i=ld(r.loadRef()),o=r.loadUint(1)?ld(r.loadRef()):[];cd(r),rd(i.length>0,"Invalid new signers"),rd(e>0,"Invalid new threshold"),rd(e<=i.length,"Invalid new threshold"),t+="
    Update Multisig Params
    ",t+=`
    New threshold : ${e.toString()}
    `,t+="
    New signers:
    ";for(let e=0;e#${e} - ${await Qc(r,n)}`}if(t+="
    New proposers:
    ",o.length>0)for(let e=0;e#${e} - ${await Qc(r,n)}`}else t+="
    No proposers
    "}}p.push(t)}return{address:e,tonBalance:s,orderId:l.orderSeqno,isExecuted:l.isExecuted,approvalsNum:l.approvalsNum,approvalsMask:l.approvalsMask,threshold:l.threshold,signers:c,expiresAt:new Date(1e3*l.expirationDate),actions:p,stateInitMatches:u}},kd=e=>{const t=e.beginParse(),r=t.loadAddress(),n=t.loadUintBig(256);return cd(t),{multisigAddress:r,orderId:n}},xd=e=>{const t=a.Address.parse(e.destination),r=(e=>{const t=e.beginParse();if(0!==t.loadUint(2))throw new Error("invalid init state prefix");const r=t.loadMaybeRef(),n=t.loadMaybeRef();if(t.loadBoolean())throw new Error("invalid init state empty libraries");return cd(t),{code:r,body:kd(n)}})(a.Cell.fromBase64(e.init_state.body)),n=a.Cell.fromBase64(e.message_content.body).beginParse();rd(n.loadUint(32)===id.order.init,"invalid op");const i=n.loadUint(64),o=n.loadUint(8),s=n.loadRef().beginParse().loadDictDirect(a.Dictionary.Keys.Uint(8),a.Dictionary.Values.Address()),l=n.loadUint(48),c=n.loadRef().beginParse().loadDictDirect(a.Dictionary.Keys.Uint(8),a.Dictionary.Values.Cell()),d=n.loadUint(1);let u;return d&&(u=n.loadUint(8)),console.log("OUT",{queryId:i,threshold:o,signers:s,expiredAt:l,order:c,isSigner:d,signerIndex:u}),cd(n),{orderAddress:t,orderId:r.body.orderId}};var Ad=r(5269);const Sd=["uri","name","description","image","image_data","symbol","decimals","amount_style"],Bd={serialize:(e,t)=>{t.storeRef((0,a.beginCell)().storeUint(0,8).storeStringTail(e).endCell())},parse:e=>{const t=e.loadRef().beginParse(),r=t.loadUint(8);if(0==r)return t.loadStringTail();if(1==r)return a.Dictionary.loadDirect(a.Dictionary.Keys.Uint(32),a.Dictionary.Values.Cell(),t).values().map((e=>e.beginParse().loadStringTail())).join("");throw Error(`Prefix ${r} is not supported yet`)}},Ed=async(e,t,r)=>{const n=await Hc("account",{address:Xc(e)},t);rd("active"===n.status,"Contract not active");const i=n.balance,o=new Zc(e.address,t),s=vd.createFromAddress(e.address),l=await s.getJettonData(o);let c,d;const u=await(async e=>{const t=e.beginParse(),r=t.loadUint(8);if(1==r){const e=0==t.remainingBits;if(e&&0==t.remainingRefs)throw new Error("No data in content cell!");return e?t.loadStringRefTail():t.loadStringTail()}if(0==r){const e=a.Dictionary.load(a.Dictionary.Keys.BigUint(256),Bd,t),r={};for(const t of Sd){const n=BigInt("0x"+(await(0,Ad.sha256)(t)).toString("hex")),i=e.get(n);void 0!==i&&(r[t]=i)}return r}throw new Error(`Unknown content format indicator:${r}`)})(l.content);if(u instanceof String)d=u;else{const e=u;d=e.uri;const t=e.decimals;if(void 0!==t&&(c=parseInt(t),isNaN(c)))throw new Error("invalid decimals")}let h;return r&&(h=await s.getNextAdminAddress(o)),{tonBalance:i,jettonMinterContract:s,adminAddress:l.adminAddress,nextAdminAddress:h,decimals:c,metadataUrl:d}};var Id=r(9107),Pd=r.n(Id),Md=r(8287).hp;function Ud(e){let t=0;const r=Md.alloc(e.length+2);r.set(e);for(let e of r){let r=128;for(;r>0;)t<<=1,e&r&&(t+=1),r>>=1,t>65535&&(t&=65535,t^=4129)}return Md.from([Math.floor(t/256),t%256])}var Td,Od,Rd=r(8287).hp;function jd(e){if("string"==typeof e&&!Ld.isFriendly(e))throw new Error("Unknown address type");const t=Rd.isBuffer(e)?e:Rd.from(e,"base64");if(36!==t.length)throw new Error("Unknown address type: byte length is not equal to 36");const r=t.subarray(0,34),n=t.subarray(34,36),i=Ud(r);if(i[0]!==n[0]||i[1]!==n[1])throw new Error("Invalid checksum: "+e);let o=r[0],s=!1,a=!1;if(128&o&&(s=!0,o^=128),17!==o&&81!==o)throw"Unknown address tag";a=17===o;let l=null;return l=255===r[1]?-1:r[1],{isTestOnly:s,isBounceable:a,workchain:l,hashPart:r.subarray(2,34)}}class Ld{static isAddress(e){return e instanceof Ld}static isFriendly(e){return 48===e.length&&!!/[A-Za-z0-9+/_-]+/.test(e)}static isRaw(e){if(-1===e.indexOf(":"))return!1;let[t,r]=e.split(":");return!!Number.isInteger(parseFloat(t))&&!!/[a-f0-9]+/.test(r.toLowerCase())&&64===r.length}static normalize(e){return"string"==typeof e?Ld.parse(e).toString():e.toString()}static parse(e){if(Ld.isFriendly(e))return this.parseFriendly(e).address;if(Ld.isRaw(e))return this.parseRaw(e);throw new Error("Unknown address type: "+e)}static parseRaw(e){let t=parseInt(e.split(":")[0]),r=Rd.from(e.split(":")[1],"hex");return new Ld(t,r)}static parseFriendly(e){if(Rd.isBuffer(e)){let t=jd(e);return{isBounceable:t.isBounceable,isTestOnly:t.isTestOnly,address:new Ld(t.workchain,t.hashPart)}}{let t=jd(e.replace(/\-/g,"+").replace(/_/g,"/"));return{isBounceable:t.isBounceable,isTestOnly:t.isTestOnly,address:new Ld(t.workchain,t.hashPart)}}}constructor(e,t){if(this.toRawString=()=>this.workChain+":"+this.hash.toString("hex"),this.toRaw=()=>{const e=Rd.alloc(36);return e.set(this.hash),e.set([this.workChain,this.workChain,this.workChain,this.workChain],32),e},this.toStringBuffer=e=>{let t=!(!e||void 0===e.testOnly)&&e.testOnly,r=!e||void 0===e.bounceable||e.bounceable?17:81;t&&(r|=128);const n=Rd.alloc(34);n[0]=r,n[1]=this.workChain,n.set(this.hash,2);const i=Rd.alloc(36);return i.set(n),i.set(Ud(n),34),i},this.toString=e=>{let t=!e||void 0===e.urlSafe||e.urlSafe,r=this.toStringBuffer(e);return t?r.toString("base64").replace(/\+/g,"-").replace(/\//g,"_"):r.toString("base64")},this[Td]=()=>this.toString(),32!==t.length)throw new Error("Invalid address hash length: "+t.length);this.workChain=e,this.hash=t,Object.freeze(this)}equals(e){return e.workChain===this.workChain&&e.hash.equals(this.hash)}}Td=Pd();class zd{static isAddress(e){return e instanceof zd}constructor(e,t){this[Od]=()=>this.toString(),this.value=e,this.bits=t}toString(){return`External<${this.bits}:${this.value}>`}}function Nd(e){let t=new qd(8*Math.ceil(e.length/8));t.writeBits(e);let r=8*Math.ceil(e.length/8)-e.length;for(let e=0;ethis.toString(),r<0)throw new Error(`Length ${r} is out of bounds`);this._length=r,this._data=e,this._offset=t}get length(){return this._length}at(e){if(e>=this._length)throw new Error(`Index ${e} > ${this._length} is out of bounds`);if(e<0)throw new Error(`Index ${e} < 0 is out of bounds`);let t=this._offset+e>>3,r=7-(this._offset+e)%8;return!!(this._data[t]&1<this._length)throw new Error(`Offset(${e}) > ${this._length} is out of bounds`);if(e<0)throw new Error(`Offset(${e}) < 0 is out of bounds`);if(0===t)return Fd.EMPTY;if(e+t>this._length)throw new Error(`Offset ${e} + Length ${t} > ${this._length} is out of bounds`);return new Fd(this._data,this._offset+e,t)}subbuffer(e,t){if(e>this._length)throw new Error(`Offset ${e} is out of bounds`);if(e<0)throw new Error(`Offset ${e} is out of bounds`);if(e+t>this._length)throw new Error(`Offset + Lenght = ${e+t} is out of bounds`);if(t%8!=0)return null;if((this._offset+e)%8!=0)return null;let r=this._offset+e>>3,n=r+(t>>3);return this._data.subarray(r,n)}equals(e){if(this._length!==e._length)return!1;for(let t=0;t8*this._buffer.length)throw new Error("BitBuilder overflow");("boolean"==typeof e&&!0===e||"number"==typeof e&&e>0)&&(this._buffer[t/8|0]|=1<<7-t%8),this._length++}writeBits(e){for(let t=0;t8*this._buffer.length)throw new Error("BitBuilder overflow");e.copy(this._buffer,this._length/8),this._length+=8*e.length}else for(let t=0;t=n)throw Error(`bitLength is too small for a value ${e}. Got ${t}`);if(this._length+t>8*this._buffer.length)throw new Error("BitBuilder overflow");const i=8-this._length%8;if(i>0){const e=Math.floor(this._length/8);if(t>BigInt(t-i));this._buffer[e]|=n,this._length+=i}}for(t-=i;t>0;)t>=8?(this._buffer[this._length/8]=Number(r>>BigInt(t-8)&0xffn),this._length+=8,t-=8):(this._buffer[this._length/8]=Number(r<=n)throw Error(`value is out of range for ${t} bits. Got ${e}`);r<0?(this.writeBit(!0),r=n+r):this.writeBit(!1),this.writeUint(r,t-1)}writeVarUint(e,t){let r=BigInt(e);if(t<0||!Number.isSafeInteger(t))throw Error(`invalid bit length. Got ${t}`);if(r<0)throw Error(`value is negative. Got ${e}`);if(0n===r)return void this.writeUint(0,t);const n=Math.ceil(r.toString(2).length/8),i=8*n;this.writeUint(n,t),this.writeUint(r,i)}writeVarInt(e,t){let r=BigInt(e);if(t<0||!Number.isSafeInteger(t))throw Error(`invalid bit length. Got ${t}`);if(0n===r)return void this.writeUint(0,t);let n=r>0?r:-r;const i=1+Math.ceil(n.toString(2).length/8),o=8*i;this.writeUint(i,t),this.writeInt(r,o)}writeCoins(e){this.writeVarUint(e,4)}writeAddress(e){if(null!=e){if(Ld.isAddress(e))return this.writeUint(2,2),this.writeUint(0,1),this.writeInt(e.workChain,8),void this.writeBuffer(e.hash);if(zd.isAddress(e))return this.writeUint(1,2),this.writeUint(e.bits,9),void this.writeUint(e.value,e.bits);throw Error(`Invalid address. Got ${e}`)}this.writeUint(0,2)}build(){return new Fd(this._buffer,0,this._length)}buffer(){if(this._length%8!=0)throw new Error("BitBuilder buffer is not byte aligned");return this._buffer.subarray(0,this._length/8)}}!function(e){e[e.Ordinary=-1]="Ordinary",e[e.PrunedBranch=1]="PrunedBranch",e[e.Library=2]="Library",e[e.MerkleProof=3]="MerkleProof",e[e.MerkleUpdate=4]="MerkleUpdate"}(Kd||(Kd={}));var Hd,Zd=r(8287).hp;function Wd(e){if(e.remainingBits%8!=0)throw new Error(`Invalid string length: ${e.remainingBits}`);if(0!==e.remainingRefs&&1!==e.remainingRefs)throw new Error(`invalid number of refs: ${e.remainingRefs}`);let t;return t=0===e.remainingBits?Zd.alloc(0):e.loadBuffer(e.remainingBits/8),1===e.remainingRefs&&(t=Zd.concat([t,Wd(e.loadRef().beginParse())])),t}function Gd(e){return Wd(e).toString()}function Yd(e,t){if(e.length>0){let r=Math.floor(t.availableBits/8);if(e.length>r){let n=e.subarray(0,r),i=e.subarray(r);t=t.storeBuffer(n);let o=_u();Yd(i,o),t=t.storeRef(o.endCell())}else t=t.storeBuffer(e)}}function Qd(e,t){Yd(Zd.from(e),t)}class Jd{constructor(e,t){this[Hd]=()=>this.toString(),this._reader=e.clone(),this._refs=[...t],this._refsOffset=0}get remainingBits(){return this._reader.remaining}get offsetBits(){return this._reader.offset}get remainingRefs(){return this._refs.length-this._refsOffset}get offsetRefs(){return this._refsOffset}skip(e){return this._reader.skip(e),this}loadBit(){return this._reader.loadBit()}preloadBit(){return this._reader.preloadBit()}loadBoolean(){return this.loadBit()}loadMaybeBoolean(){return this.loadBit()?this.loadBoolean():null}loadBits(e){return this._reader.loadBits(e)}preloadBits(e){return this._reader.preloadBits(e)}loadUint(e){return this._reader.loadUint(e)}loadUintBig(e){return this._reader.loadUintBig(e)}preloadUint(e){return this._reader.preloadUint(e)}preloadUintBig(e){return this._reader.preloadUintBig(e)}loadMaybeUint(e){return this.loadBit()?this.loadUint(e):null}loadMaybeUintBig(e){return this.loadBit()?this.loadUintBig(e):null}loadInt(e){return this._reader.loadInt(e)}loadIntBig(e){return this._reader.loadIntBig(e)}preloadInt(e){return this._reader.preloadInt(e)}preloadIntBig(e){return this._reader.preloadIntBig(e)}loadMaybeInt(e){return this.loadBit()?this.loadInt(e):null}loadMaybeIntBig(e){return this.loadBit()?this.loadIntBig(e):null}loadVarUint(e){return this._reader.loadVarUint(e)}loadVarUintBig(e){return this._reader.loadVarUintBig(e)}preloadVarUint(e){return this._reader.preloadVarUint(e)}preloadVarUintBig(e){return this._reader.preloadVarUintBig(e)}loadVarInt(e){return this._reader.loadVarInt(e)}loadVarIntBig(e){return this._reader.loadVarIntBig(e)}preloadVarInt(e){return this._reader.preloadVarInt(e)}preloadVarIntBig(e){return this._reader.preloadVarIntBig(e)}loadCoins(){return this._reader.loadCoins()}preloadCoins(){return this._reader.preloadCoins()}loadMaybeCoins(){return this._reader.loadBit()?this._reader.loadCoins():null}loadAddress(){return this._reader.loadAddress()}loadMaybeAddress(){return this._reader.loadMaybeAddress()}loadExternalAddress(){return this._reader.loadExternalAddress()}loadMaybeExternalAddress(){return this._reader.loadMaybeExternalAddress()}loadAddressAny(){return this._reader.loadAddressAny()}loadRef(){if(this._refsOffset>=this._refs.length)throw new Error("No more references");return this._refs[this._refsOffset++]}preloadRef(){if(this._refsOffset>=this._refs.length)throw new Error("No more references");return this._refs[this._refsOffset]}loadMaybeRef(){return this.loadBit()?this.loadRef():null}preloadMaybeRef(){return this.preloadBit()?this.preloadRef():null}loadBuffer(e){return this._reader.loadBuffer(e)}preloadBuffer(e){return this._reader.preloadBuffer(e)}loadStringTail(){return Gd(this)}loadMaybeStringTail(){return this.loadBit()?Gd(this):null}loadStringRefTail(){return Gd(this.loadRef().beginParse())}loadMaybeStringRefTail(){const e=this.loadMaybeRef();return e?Gd(e.beginParse()):null}loadDict(e,t){return Nu.load(e,t,this)}loadDictDirect(e,t){return Nu.loadDirect(e,t,this)}endParse(){if(this.remainingBits>0||this.remainingRefs>0)throw new Error("Slice is not empty")}asCell(){return _u().storeSlice(this).endCell()}asBuilder(){return _u().storeSlice(this)}clone(e=!1){if(e){let e=this._reader.clone();return e.reset(),new Jd(e,this._refs)}{let e=new Jd(this._reader,this._refs);return e._refsOffset=this._refsOffset,e}}toString(){return this.asCell().toString()}}Hd=Pd();var Xd=r(8287).hp;class eu{constructor(e,t=0){this._checkpoints=[],this._bits=e,this._offset=t}get offset(){return this._offset}get remaining(){return this._bits.length-this._offset}skip(e){if(e<0||this._offset+e>this._bits.length)throw new Error(`Index ${this._offset+e} is out of bounds`);this._offset+=e}reset(){this._checkpoints.length>0?this._offset=this._checkpoints.pop():this._offset=0}save(){this._checkpoints.push(this._offset)}loadBit(){let e=this._bits.at(this._offset);return this._offset++,e}preloadBit(){return this._bits.at(this._offset)}loadBits(e){let t=this._bits.substring(this._offset,e);return this._offset+=e,t}preloadBits(e){return this._bits.substring(this._offset,e)}loadBuffer(e){let t=this._preloadBuffer(e,this._offset);return this._offset+=8*e,t}preloadBuffer(e){return this._preloadBuffer(e,this._offset)}loadUint(e){return Number(this.loadUintBig(e))}loadUintBig(e){let t=this.preloadUintBig(e);return this._offset+=e,t}preloadUint(e){return Number(this._preloadUint(e,this._offset))}preloadUintBig(e){return this._preloadUint(e,this._offset)}loadInt(e){let t=this._preloadInt(e,this._offset);return this._offset+=e,Number(t)}loadIntBig(e){let t=this._preloadInt(e,this._offset);return this._offset+=e,t}preloadInt(e){return Number(this._preloadInt(e,this._offset))}preloadIntBig(e){return this._preloadInt(e,this._offset)}loadVarUint(e){let t=Number(this.loadUint(e));return Number(this.loadUintBig(8*t))}loadVarUintBig(e){let t=Number(this.loadUint(e));return this.loadUintBig(8*t)}preloadVarUint(e){let t=Number(this._preloadUint(e,this._offset));return Number(this._preloadUint(8*t,this._offset+e))}preloadVarUintBig(e){let t=Number(this._preloadUint(e,this._offset));return this._preloadUint(8*t,this._offset+e)}loadVarInt(e){let t=Number(this.loadUint(e));return Number(this.loadIntBig(8*t))}loadVarIntBig(e){let t=Number(this.loadUint(e));return this.loadIntBig(8*t)}preloadVarInt(e){let t=Number(this._preloadUint(e,this._offset));return Number(this._preloadInt(8*t,this._offset+e))}preloadVarIntBig(e){let t=Number(this._preloadUint(e,this._offset));return this._preloadInt(8*t,this._offset+e)}loadCoins(){return this.loadVarUintBig(4)}preloadCoins(){return this.preloadVarUintBig(4)}loadAddress(){let e=Number(this._preloadUint(2,this._offset));if(2===e)return this._loadInternalAddress();throw new Error("Invalid address: "+e)}loadMaybeAddress(){let e=Number(this._preloadUint(2,this._offset));if(0===e)return this._offset+=2,null;if(2===e)return this._loadInternalAddress();throw new Error("Invalid address")}loadExternalAddress(){if(1===Number(this._preloadUint(2,this._offset)))return this._loadExternalAddress();throw new Error("Invalid address")}loadMaybeExternalAddress(){let e=Number(this._preloadUint(2,this._offset));if(0===e)return this._offset+=2,null;if(1===e)return this._loadExternalAddress();throw new Error("Invalid address")}loadAddressAny(){let e=Number(this._preloadUint(2,this._offset));if(0===e)return this._offset+=2,null;if(2===e)return this._loadInternalAddress();if(1===e)return this._loadExternalAddress();throw 3===e?Error("Unsupported"):Error("Unreachable")}loadPaddedBits(e){if(e%8!=0)throw new Error("Invalid number of bits");let t=e;for(;;){if(this._bits.at(this._offset+t-1)){t--;break}t--}let r=this._bits.substring(this._offset,t);return this._offset+=e,r}clone(){return new eu(this._bits,this._offset)}_preloadInt(e,t){if(0==e)return 0n;let r=this._bits.at(t),n=0n;for(let r=0;r>1&1431655765))+(e>>2&858993459))+(e>>4)&252645135)>>24}(this._mask),this._hashCount=this._hashIndex+1}get value(){return this._mask}get level(){return 32-Math.clz32(this._mask)}get hashIndex(){return this._hashIndex}get hashCount(){return this._hashCount}apply(e){return new iu(this._mask&(1<>e-1)%2!=0}}function ou(e,t){let r,n=new eu(e),i=n.loadUint(8);if(1!==i)throw new Error(`Pruned branch cell must have type 1, got "${i}"`);if(0!==t.length)throw new Error(`Pruned Branch cell can't has refs, got "${t.length}"`);if(280===e.length)r=new iu(1);else{if(r=new iu(n.loadUint(8)),r.level<1||r.level>3)throw new Error(`Pruned Branch cell level must be >= 1 and <= 3, got "${r.level}/${r.value}"`);const t=16+272*r.apply(r.level-1).hashCount;if(e.length!==t)throw new Error(`Pruned branch cell must have exactly ${t} bits, got "${e.length}"`)}let o=[],s=[],a=[];for(let e=0;e>1);else if(e===Kd.MerkleUpdate)nu(t,r),n=new iu((r[0].mask.value|r[1].mask.value)>>1);else{if(e!==Kd.Library)throw new Error("Unsupported exotic type");tu(t),n=new iu}let o=[],s=[],a=e===Kd.PrunedBranch?1:n.hashCount,l=n.hashCount-a;for(let i=0,a=0;i<=n.level;i++){if(!n.isSignificant(i))continue;if(a0&&d++;let u=cu(t,c,r,i,n.apply(i).value,e),h=(0,Ad.sha256_sync)(u),f=a-l;o[f]=d,s[f]=h,a++}let c=[],d=[];if(i)for(let e=0;e<4;e++){const{hashIndex:t}=n.apply(e),{hashIndex:r}=n;t!==r?(c.push(i.pruned[t].hash),d.push(i.pruned[t].depth)):(c.push(s[0]),d.push(o[0]))}else for(let e=0;e<4;e++)c.push(s[n.apply(e).hashIndex]),d.push(o[n.apply(e).hashIndex]);return{mask:n,hashes:c,depths:d}}function uu(e,t){let r=BigInt(e);if("int"===t)return 0n===r||-1n===r?1:(r>0?r:-r).toString(2).length+1;if("uint"===t){if(r<0)throw Error(`value is negative. Got ${e}`);return r.toString(2).length}throw Error(`invalid mode. Got ${t}`)}var hu=r(8287).hp;const fu=2197175160;function pu(e){let t=-1;for(let r=0;r>>1^fu:t>>>1,t=1&t?t>>>1^fu:t>>>1,t=1&t?t>>>1^fu:t>>>1,t=1&t?t>>>1^fu:t>>>1,t=1&t?t>>>1^fu:t>>>1,t=1&t?t>>>1^fu:t>>>1,t=1&t?t>>>1^fu:t>>>1,t=1&t?t>>>1^fu:t>>>1;t^=4294967295;let r=hu.alloc(4);return r.writeInt32LE(t),r}function gu(e){return function(e){let t=0;for(let r=0;r<3;r++)t+=1&e,e>>=1;return t+1}(7&e)}function mu(e,t){const r=e.loadUint(8),n=r%8,i=!!(8&r),o=e.loadUint(8),s=Math.ceil(o/2),a=!!(o%2),l=r>>5,c=!!(16&r),d=c?32*gu(l):0,u=c?2*gu(l):0;e.skip(8*d),e.skip(8*u);let h=Fd.EMPTY;s>0&&(h=a?e.loadPaddedBits(8*s):e.loadBits(8*s));let f=[];for(let r=0;r=0;e--){if(n[e].result)throw Error("Impossible");let t=[];for(let r of n[e].refs){if(!n[r].result)throw Error("Invalid BOC file");t.push(n[r].result)}n[e].result=new Cu({bits:n[e].bits,refs:t,exotic:n[e].exotic})}let i=[];for(let e=0;e{if(this.isExotic&&!e)throw new Error("Exotic cells cannot be parsed");return new Jd(new eu(this.bits),this.refs)},this.hash=(e=3)=>this._hashes[Math.min(this._hashes.length-1,e)],this.depth=(e=3)=>this._depths[Math.min(this._depths.length-1,e)],this.level=()=>this.mask.level,this.equals=e=>this.hash().equals(e.hash()),this[wu]=()=>this.toString();let t=Fd.EMPTY;e&&e.bits&&(t=e.bits);let r,n,i,o=[];e&&e.refs&&(o=[...e.refs]);let s=Kd.Ordinary;if(e&&e.exotic){let e=function(e,t){let r=new eu(e).preloadUint(8);if(1===r)return function(e,t){let r=ou(e,t),n=[],i=[],o=new iu(r.mask);for(let e=0;e>1);return{type:Kd.MerkleProof,depths:[],hashes:[],mask:r}}(e,t);if(4===r)return function(e,t){nu(e,t);let r=new iu((t[0].level()|t[1].level())>>1);return{type:Kd.MerkleUpdate,depths:[],hashes:[],mask:r}}(e,t);throw Error("Invalid exotic cell type: "+r)}(t,o),a=du(e.type,t,o);i=a.mask,n=a.depths,r=a.hashes,s=e.type}else{if(o.length>4)throw new Error("Invalid number of references");if(t.length>1023)throw new Error(`Bits overflow: ${t.length} > 1023`);let e=du(Kd.Ordinary,t,o);i=e.mask,n=e.depths,r=e.hashes,s=Kd.Ordinary}this.type=s,this.bits=t,this.refs=o,this.mask=i,this._depths=n,this._hashes=r,Object.freeze(this),Object.freeze(this.refs),Object.freeze(this.bits),Object.freeze(this.mask),Object.freeze(this._depths),Object.freeze(this._hashes)}get isExotic(){return this.type!==Kd.Ordinary}toBoc(e){return function(e,t){let r=function(e){let t=[e],r=new Map,n=new Set,i=[];for(;t.length>0;){const e=[...t];t=[];for(let i of e){const e=i.hash().toString("hex");if(!r.has(e)){n.add(e),r.set(e,{cell:i,refs:i.refs.map((e=>e.hash().toString("hex")))});for(let e of i.refs)t.push(e)}}}let o=new Set;function s(e){if(!n.has(e))return;if(o.has(e))throw Error("Not a DAG");o.add(e);let t=r.get(e).refs;for(let e=t.length-1;e>=0;e--)s(t[e]);i.push(e),o.delete(e),n.delete(e)}for(;n.size>0;)s(Array.from(n)[0]);let a=new Map;for(let e=0;e=0;e--){let t=i[e];const n=r.get(t);l.push({cell:n.cell,refs:n.refs.map((e=>a.get(e)))})}return l}(e),n=r.length,i=t.idx,o=t.crc32,s=Math.max(Math.ceil(uu(n,"uint")/8),1),a=0,l=[];for(let e of r)a+=yu(e.cell,s),l.push(a);let c=Math.max(Math.ceil(uu(a,"uint")/8),1),d=8*(6+3*s+c+1*s+(i?n*c:0)+a+(o?4:0)),u=new qd(d);if(u.writeUint(3052313714,32),u.writeBit(i),u.writeBit(o),u.writeBit(!1),u.writeUint(0,2),u.writeUint(s,3),u.writeUint(c,8),u.writeUint(n,8*s),u.writeUint(1,8*s),u.writeUint(0,8*s),u.writeUint(a,8*c),u.writeUint(0,8*s),i)for(let e=0;e=4)throw new Error("Too many references");if(e instanceof Cu)this._refs.push(e);else{if(!(e instanceof ku))throw new Error("Invalid argument");this._refs.push(e.endCell())}return this}storeMaybeRef(e){return e?(this.storeBit(1),this.storeRef(e)):this.storeBit(0),this}storeSlice(e){let t=e.clone();for(t.remainingBits>0&&this.storeBits(t.loadBits(t.remainingBits));t.remainingRefs>0;)this.storeRef(t.loadRef());return this}storeMaybeSlice(e){return e?(this.storeBit(1),this.storeSlice(e)):this.storeBit(0),this}storeBuilder(e){return this.storeSlice(e.endCell().beginParse())}storeMaybeBuilder(e){return e?(this.storeBit(1),this.storeBuilder(e)):this.storeBit(0),this}storeWritable(e){return"object"==typeof e?e.writeTo(this):e(this),this}storeMaybeWritable(e){return e?(this.storeBit(1),this.storeWritable(e)):this.storeBit(0),this}store(e){return this.storeWritable(e),this}storeStringTail(e){return Qd(e,this),this}storeMaybeStringTail(e){return null!=e?(this.storeBit(1),Qd(e,this)):this.storeBit(0),this}storeStringRefTail(e){return this.storeRef(_u().storeStringTail(e)),this}storeMaybeStringRefTail(e){return null!=e?(this.storeBit(1),this.storeStringRefTail(e)):this.storeBit(0),this}storeDict(e,t,r){return e?e.store(this,t,r):this.storeBit(0),this}storeDictDirect(e,t,r){return e.storeDirect(this,t,r),this}endCell(e){return new Cu({bits:this._bits.build(),refs:this._refs,exotic:e?.exotic})}asCell(){return this.endCell()}asSlice(){return this.endCell().beginParse()}}function xu(e){return _u().storeUint(1,8).storeUint(1,8).storeBuffer(e.hash(0)).storeUint(e.depth(0),16).endCell({exotic:!0})}function Au(e,t,r,n){const i=t.asCell();let o=0,s=e;if(0==(t.loadBit()?1:0)){o=function(e){let t=0;for(;e.loadBit();)t++;return t}(t);for(let e=0;e0&&t.storeUint(BigInt("0b"+e),e.length)}(e,r):"long"===n?function(e,t,r){r.storeBit(1),r.storeBit(0);let n=Math.ceil(Math.log2(t+1));r.storeUint(e.length,n),e.length>0&&r.storeUint(BigInt("0b"+e),e.length)}(e,t,r):"same"===n&&function(e,t,r,n){n.storeBit(1),n.storeBit(1),n.storeBit(e);let i=Math.ceil(Math.log2(r+1));n.storeUint(t,i)}("1"===e[0],e.length,t,r)}function Tu(e,t,r,n){Uu(e.label,t,n),function(e,t,r,n){if("leaf"===e.type&&r(e.value,n),"fork"===e.type){const i=_u(),o=_u();Tu(e.left,t-1,r,i),Tu(e.right,t-1,r,o),n.storeRef(i),n.storeRef(o)}}(e.node,t-e.label.length,r,n)}function Ou(e,t,r,n){const i=function(e,t){let r=new Map;for(let n of Array.from(e.keys())){const i=Iu(n.toString(2),t);r.set(i,e.get(n))}return Mu(r)}(e,t);Tu(i,t,r,n)}var Ru=r(8287).hp;function ju(e){if("number"==typeof e){if(!Number.isSafeInteger(e))throw Error("Invalid key type: not a safe integer: "+e);return"n:"+e.toString(10)}if("bigint"==typeof e)return"b:"+e.toString(10);if(Ld.isAddress(e))return"a:"+e.toString();if(Ru.isBuffer(e))return"f:"+e.toString("hex");if(Fd.isBitString(e))return"B:"+e.toString();throw Error("Invalid key type")}function Lu(e){let t=e.slice(0,2),r=e.slice(2);if("n:"===t)return parseInt(r,10);if("b:"===t)return BigInt(r);if("a:"===t)return Ld.parse(r);if("f:"===t)return Ru.from(r,"hex");if("B:"===t){const e="_"==r.slice(-1);if(e||r.length%2!=0){let t=e?r.length-1:r.length;const n=r.substr(0,t)+"0";return!e&&1&t?new Fd(Ru.from(n,"hex"),0,t<<2):function(e){let t=0;for(let r=e.length-1;r>=0;r--)if(0!==e[r]){const n=e[r];let i=n&-n;1&i||(i=Math.log2(i)+1),r>0&&(t=r<<3),t+=8-i;break}return new Fd(e,0,t)}(Ru.from(n,"hex"))}return new Fd(Ru.from(r,"hex"),0,r.length<<2)}throw Error("Invalid key type: "+t)}var zu=r(8287).hp;class Nu{static empty(e,t){return e&&t?new Nu(new Map,e,t):new Nu(new Map,null,null)}static load(e,t,r){let n;if(r instanceof Cu){if(r.isExotic)return Nu.empty(e,t);n=r.beginParse()}else n=r;let i=n.loadMaybeRef();return i&&!i.isExotic?Nu.loadDirect(e,t,i.beginParse()):Nu.empty(e,t)}static loadDirect(e,t,r){if(!r)return Nu.empty(e,t);let n;n=r instanceof Cu?r.beginParse():r;let i=Eu(n,e.bits,t.parse),o=new Map;for(let[t,r]of i)o.set(ju(e.parse(t)),r);return new Nu(o,e,t)}constructor(e,t,r){this._key=t,this._value=r,this._map=e}get size(){return this._map.size}get(e){return this._map.get(ju(e))}has(e){return this._map.has(ju(e))}set(e,t){return this._map.set(ju(e),t),this}delete(e){const t=ju(e);return this._map.delete(t)}clear(){this._map.clear()}*[Symbol.iterator](){for(const[e,t]of this._map){const r=Lu(e);yield[r,t]}}keys(){return Array.from(this._map.keys()).map((e=>Lu(e)))}values(){return Array.from(this._map.values())}store(e,t,r){if(0===this._map.size)e.storeBit(0);else{let n=this._key;null!=t&&(n=t);let i=this._value;if(null!=r&&(i=r),!n)throw Error("Key serializer is not defined");if(!i)throw Error("Value serializer is not defined");let o=new Map;for(const[e,t]of this._map)o.set(n.serialize(Lu(e)),t);e.storeBit(1);let s=_u();Ou(o,n.bits,i.serialize,s),e.storeRef(s.endCell())}}storeDirect(e,t,r){if(0===this._map.size)throw Error("Cannot store empty dictionary directly");let n=this._key;null!=t&&(n=t);let i=this._value;if(null!=r&&(i=r),!n)throw Error("Key serializer is not defined");if(!i)throw Error("Value serializer is not defined");let o=new Map;for(const[e,t]of this._map)o.set(n.serialize(Lu(e)),t);Ou(o,n.bits,i.serialize,e)}generateMerkleProof(e){return Su(this,e,this._key)}generateMerkleUpdate(e,t){return function(e,t,r,n){const i=Su(e,t,r).refs[0];return e.set(t,n),o=i,s=Su(e,t,r).refs[0],_u().storeUint(4,8).storeBuffer(o.hash(0)).storeBuffer(s.hash(0)).storeUint(o.depth(0),16).storeUint(s.depth(0),16).storeRef(o).storeRef(s).endCell({exotic:!0});var o,s}(this,e,this._key,t)}}Nu.Keys={Address:()=>({bits:267,serialize:e=>{if(!Ld.isAddress(e))throw Error("Key is not an address");return _u().storeAddress(e).endCell().beginParse().preloadUintBig(267)},parse:e=>_u().storeUint(e,267).endCell().beginParse().loadAddress()}),BigInt:e=>function(e){return{bits:e,serialize:t=>{if("bigint"!=typeof t)throw Error("Key is not a bigint");return _u().storeInt(t,e).endCell().beginParse().loadUintBig(e)},parse:t=>_u().storeUint(t,e).endCell().beginParse().loadIntBig(e)}}(e),Int:e=>function(e){return{bits:e,serialize:t=>{if("number"!=typeof t)throw Error("Key is not a number");if(!Number.isSafeInteger(t))throw Error("Key is not a safe integer: "+t);return _u().storeInt(t,e).endCell().beginParse().loadUintBig(e)},parse:t=>_u().storeUint(t,e).endCell().beginParse().loadInt(e)}}(e),BigUint:e=>function(e){return{bits:e,serialize:t=>{if("bigint"!=typeof t)throw Error("Key is not a bigint");if(t<0)throw Error("Key is negative: "+t);return _u().storeUint(t,e).endCell().beginParse().loadUintBig(e)},parse:t=>_u().storeUint(t,e).endCell().beginParse().loadUintBig(e)}}(e),Uint:e=>function(e){return{bits:e,serialize:t=>{if("number"!=typeof t)throw Error("Key is not a number");if(!Number.isSafeInteger(t))throw Error("Key is not a safe integer: "+t);if(t<0)throw Error("Key is negative: "+t);return _u().storeUint(t,e).endCell().beginParse().loadUintBig(e)},parse:t=>Number(_u().storeUint(t,e).endCell().beginParse().loadUint(e))}}(e),Buffer:e=>function(e){return{bits:8*e,serialize:t=>{if(!zu.isBuffer(t))throw Error("Key is not a buffer");return _u().storeBuffer(t).endCell().beginParse().loadUintBig(8*e)},parse:t=>_u().storeUint(t,8*e).endCell().beginParse().loadBuffer(e)}}(e),BitString:e=>function(e){return{bits:e,serialize:t=>{if(!Fd.isBitString(t))throw Error("Key is not a BitString");return _u().storeBits(t).endCell().beginParse().loadUintBig(e)},parse:t=>_u().storeUint(t,e).endCell().beginParse().loadBits(e)}}(e)},Nu.Values={BigInt:e=>function(e){return{serialize:(t,r)=>{r.storeInt(t,e)},parse:t=>t.loadIntBig(e)}}(e),Int:e=>function(e){return{serialize:(t,r)=>{r.storeInt(t,e)},parse:t=>t.loadInt(e)}}(e),BigVarInt:e=>function(e){return{serialize:(t,r)=>{r.storeVarInt(t,e)},parse:t=>t.loadVarIntBig(e)}}(e),BigUint:e=>function(e){return{serialize:(t,r)=>{r.storeUint(t,e)},parse:t=>t.loadUintBig(e)}}(e),Uint:e=>function(e){return{serialize:(t,r)=>{r.storeUint(t,e)},parse:t=>t.loadUint(e)}}(e),BigVarUint:e=>function(e){return{serialize:(t,r)=>{r.storeVarUint(t,e)},parse:t=>t.loadVarUintBig(e)}}(e),Bool:()=>({serialize:(e,t)=>{t.storeBit(e)},parse:e=>e.loadBit()}),Address:()=>({serialize:(e,t)=>{t.storeAddress(e)},parse:e=>e.loadAddress()}),Cell:()=>({serialize:(e,t)=>{t.storeRef(e)},parse:e=>e.loadRef()}),Buffer:e=>{return t=e,{serialize:(e,r)=>{if(e.length!==t)throw Error("Invalid buffer size");r.storeBuffer(e)},parse:e=>e.loadBuffer(t)};var t},BitString:e=>function(e){return{serialize:(t,r)=>{if(t.length!==e)throw Error("Invalid BitString size");r.storeBits(t)},parse:t=>t.loadBits(e)}}(e),Dictionary:(e,t)=>function(e,t){return{serialize:(e,t)=>{e.store(t)},parse:r=>Nu.load(e,t,r)}}(e,t)};const Du=e=>document.querySelector(e),$u=(e,t)=>{e.style.display=t?"flex":"none"},Fu='
    It\'s you
    ',Ku=(e,t)=>{let r=e;void 0!==t&&(r+="/"+t),window.history.state!==r&&window.history.pushState(r,"TON Multisig - "+r,"#"+r)},Vu=(navigator.language,window.location.href.indexOf("testnet=true")>-1);Vu&&(Du(".testnet-badge").style.display="block",document.body.classList.add("testnet-padding"));const qu=e=>e.toString({bounceable:!0,testOnly:Vu});let Hu="startScreen";const Zu=e=>{const t=["startScreen","importScreen","multisigScreen","newOrderScreen","orderScreen","newMultisigScreen","loadingScreen"];Hu=e;for(const r of t)$u(Du("#"+r),r===e);switch(Hu){case"startScreen":th(),lh(),""!==window.history.state&&window.history.pushState("","TON Multisig","#");break;case"importScreen":Du("#import_input").value="";break;case"newOrderScreen":Ah();break;case"newMultisigScreen":Lh()}};let Wu;const Gu=new class{constructor(e){if(Ie(this,"walletInfoStorage",new Fr),Ie(this,"preferredWalletStorage",new Kr),Ie(this,"walletInfo",null),Ie(this,"systemThemeChangeUnsubscribe",null),Ie(this,"actionsConfiguration"),Ie(this,"walletsList"),Ie(this,"connectRequestParametersCallback"),Ie(this,"connector"),Ie(this,"modal"),Ie(this,"transactionModal"),Ie(this,"connectionRestored",Promise.resolve(!1)),e&&"connector"in e&&e.connector)this.connector=e.connector;else{if(!(e&&"manifestUrl"in e&&e.manifestUrl))throw new Mr("You have to specify a `manifestUrl` or a `connector` in the options.");this.connector=new oe({manifestUrl:e.manifestUrl})}this.modal=new Fc({connector:this.connector,setConnectRequestParametersCallback:e=>{this.connectRequestParametersCallback=e}}),this.transactionModal=new Kc({connector:this.connector}),this.walletsList=this.getWallets(),this.walletsList.then((e=>{return jr((t=e.map((e=>e.imageUrl)),[...new Set(t)]));var t}));const t=this.normalizeWidgetRoot(null==e?void 0:e.widgetRootId);this.subscribeToWalletChange(),!1!==(null==e?void 0:e.restoreConnection)&&(this.connectionRestored=new Promise((e=>Pe(this,null,(function*(){yield this.connector.restoreConnection(),this.connector.connected||this.walletInfoStorage.removeWalletInfo(),e(this.connector.connected)}))))),this.uiOptions=_n(e,{uiPreferences:{theme:"SYSTEM"}});const r=this.preferredWalletStorage.getPreferredWalletAppName();Ya({connector:this.connector,preferredWalletAppName:r}),((e,t)=>{(function(e,t,r,n={}){let i;He((n=>{i=n,t===document?e():Ht(t,e(),t.firstChild?null:void 0,r)}),n.owner)})((()=>kt(Nc,{tonConnectUI:t})),document.getElementById(e))})(t,this)}static getWallets(){return oe.getWallets()}get connected(){return this.connector.connected}get account(){return this.connector.account}get wallet(){return this.connector.wallet?Be(Be({},this.connector.wallet),this.walletInfo):null}set uiOptions(e){var t,r,n,i,o,s,a;this.checkButtonRootExist(e.buttonRootId),this.actionsConfiguration=e.actionsConfiguration,(null==(t=e.uiPreferences)?void 0:t.theme)?"SYSTEM"!==(null==(r=e.uiPreferences)?void 0:r.theme)?(null==(n=this.systemThemeChangeUnsubscribe)||n.call(this),Bn(e.uiPreferences.theme,e.uiPreferences.colorsSet)):(Bn(window.matchMedia&&window.matchMedia("(prefers-color-scheme: light)").matches?ir.LIGHT:ir.DARK,e.uiPreferences.colorsSet),this.systemThemeChangeUnsubscribe||(this.systemThemeChangeUnsubscribe=function(e){const t=t=>e(t.matches?ir.DARK:ir.LIGHT);return window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",t),()=>window.matchMedia("(prefers-color-scheme: dark)").removeEventListener("change",t)}(Bn))):(null==(i=e.uiPreferences)?void 0:i.colorsSet)&&(s=e.uiPreferences.colorsSet,Sn[ir.DARK]=_n(s[ir.DARK],Sn[ir.DARK]),Sn[ir.LIGHT]=_n(s[ir.LIGHT],Sn[ir.LIGHT]),xn((e=>({colors:_n(Sn[e.theme],An[e.theme])})))),(null==(o=e.uiPreferences)?void 0:o.borderRadius)&&(a=e.uiPreferences.borderRadius,xn({borderRadius:a})),Ya((t=>{var r,n;const i=_n(Be(Be(Be(Be({},e.language&&{language:e.language}),!!(null==(r=e.actionsConfiguration)?void 0:r.returnStrategy)&&{returnStrategy:e.actionsConfiguration.returnStrategy}),!!(null==(n=e.actionsConfiguration)?void 0:n.twaReturnUrl)&&{twaReturnUrl:e.actionsConfiguration.twaReturnUrl}),!!e.walletsListConfiguration&&{walletsListConfiguration:e.walletsListConfiguration}),cn(t));return void 0!==e.buttonRootId&&(i.buttonRootId=e.buttonRootId),void 0!==e.enableAndroidBackHandler&&(i.enableAndroidBackHandler=e.enableAndroidBackHandler),i}))}setConnectRequestParameters(e){var t;Ya({connectRequestParameters:e}),"ready"!==(null==e?void 0:e.state)&&e||null==(t=this.connectRequestParametersCallback)||t.call(this,null==e?void 0:e.value)}getWallets(){return Pe(this,null,(function*(){return this.connector.getWallets()}))}onStatusChange(e,t){return this.connector.onStatusChange((t=>Pe(this,null,(function*(){if(t){const r=yield this.getSelectedWalletInfo(t);e(Be(Be({},t),r||this.walletInfoStorage.getWalletInfo()))}else e(t)}))),t)}openModal(){return Pe(this,null,(function*(){return this.modal.open()}))}closeModal(){this.modal.close()}onModalStateChange(e){return this.modal.onStateChange(e)}get modalState(){return this.modal.state}connectWallet(){return Pe(this,null,(function*(){const e=(yield this.getWallets()).find(ee);return e?yield this.connectEmbeddedWallet(e):yield this.connectExternalWallet()}))}disconnect(){return setTimeout((()=>Xr(null))),Qr(null),this.walletInfoStorage.removeWalletInfo(),this.connector.disconnect()}sendTransaction(e,t){return Pe(this,null,(function*(){if(!this.connected)throw new Mr("Connect wallet to send a transaction.");On()&&Rn();const{notifications:r,modals:n,returnStrategy:i,twaReturnUrl:o,skipRedirectToWallet:s}=this.getModalsAndNotificationsConfiguration(t);$c({name:"confirm-transaction",showNotification:r.includes("before"),openModal:n.includes("before")});const a=()=>{const e="ios"===Nr().os,t="ios"===s&&e||"always"===s;this.walletInfo&&"universalLink"in this.walletInfo&&"universal-link"===this.walletInfo.openMethod&&!t&&(L(this.walletInfo.universalLink)?El(this.walletInfo.universalLink,{returnStrategy:i,twaReturnUrl:o||Ga.twaReturnUrl,forceRedirect:!1}):Tr(Bl(this.walletInfo.universalLink,i)))},l=new AbortController,c=this.onTransactionModalStateChange((e=>{(null==e?void 0:e.openModal)||(c(),e||l.abort())}));try{const t=yield this.waitForSendTransaction({transaction:e,abortSignal:l.signal},a);return $c({name:"transaction-sent",showNotification:r.includes("success"),openModal:n.includes("success")}),t}catch(e){throw $c({name:"transaction-canceled",showNotification:r.includes("error"),openModal:n.includes("error")}),e instanceof m?e:(console.error(e),new Mr("Unhandled error:"+e))}finally{c()}}))}connectEmbeddedWallet(e){return Pe(this,null,(function*(){const t=t=>{Qr(e),this.connector.connect({jsBridgeKey:e.jsBridgeKey},t)},r=Ga.connectRequestParameters;return"loading"===(null==r?void 0:r.state)?this.connectRequestParametersCallback=t:t(null==r?void 0:r.value),yield this.waitForWalletConnection({ignoreErrors:!1})}))}connectExternalWallet(){return Pe(this,null,(function*(){const e=new AbortController;Dc();const t=this.onModalStateChange((r=>{const{status:n,closeReason:i}=r;"opened"!==n&&(t(),"action-cancelled"===i&&e.abort())}));return yield this.waitForWalletConnection({ignoreErrors:!0,abortSignal:e.signal})}))}waitForWalletConnection(e){return Pe(this,null,(function*(){return new Promise(((t,r)=>{const{ignoreErrors:n=!1,abortSignal:i=null}=e;if(i&&i.aborted)return r(new Mr("Wallet was not connected"));const o=e=>Pe(this,null,(function*(){if(e)s(),t(e);else{if(n)return;s(),r(new Mr("Wallet was not connected"))}})),s=this.onStatusChange((e=>o(e)),(e=>(e=>{n||(s(),r(e))})(e)));i&&i.addEventListener("abort",(()=>{s(),r(new Mr("Wallet was not connected"))}))}))}))}waitForSendTransaction(e,t){return Pe(this,null,(function*(){return new Promise(((r,n)=>{const{transaction:i,abortSignal:o}=e;if(o.aborted)return n(new Mr("Transaction was not sent"));const s=e=>Pe(this,null,(function*(){r(e)}));this.connector.sendTransaction(i,t).then((e=>s(e))).catch((e=>(e=>{n(e)})(e))),o.addEventListener("abort",(()=>{n(new Mr("Transaction was not sent"))}))}))}))}onTransactionModalStateChange(e){return this.transactionModal.onStateChange(e)}subscribeToWalletChange(){this.connector.onStatusChange((e=>Pe(this,null,(function*(){var t;e?(yield this.updateWalletInfo(e),this.setPreferredWalletAppName((null==(t=this.walletInfo)?void 0:t.appName)||e.device.appName)):this.walletInfoStorage.removeWalletInfo()}))))}setPreferredWalletAppName(e){this.preferredWalletStorage.setPreferredWalletAppName(e),Ya({preferredWalletAppName:e})}getSelectedWalletInfo(e){return Pe(this,null,(function*(){let t,r=Gr();if(!r)return null;if("name"in r)t=r;else{const n=Ja(yield this.walletsList,Ga.walletsListConfiguration).find((t=>rl(t,e.device.appName)));if(!n)throw new Mr(`Cannot find WalletInfo for the '${e.device.appName}' wallet`);t=Be(Be({},n),r)}return t}))}updateWalletInfo(e){return Pe(this,null,(function*(){const t=yield this.getSelectedWalletInfo(e);if(t)return this.walletInfo=t,void this.walletInfoStorage.setWalletInfo(t);const r=this.walletInfoStorage.getWalletInfo();this.walletInfo=r||(yield this.walletsList).find((t=>rl(t,e.device.appName)))||null}))}normalizeWidgetRoot(e){if(!e||!document.getElementById(e)){e="tc-widget-root";const t=document.createElement("div");t.id=e,document.body.appendChild(t)}return e}checkButtonRootExist(e){if(null!=e&&!document.getElementById(e))throw new Mr(`${e} element not found in the document.`)}getModalsAndNotificationsConfiguration(e){var t,r,n,i,o,s;const a=["before","success","error"];let l=a;(null==(t=this.actionsConfiguration)?void 0:t.notifications)&&"all"!==(null==(r=this.actionsConfiguration)?void 0:r.notifications)&&(l=this.actionsConfiguration.notifications),(null==e?void 0:e.notifications)&&(l="all"===e.notifications?a:e.notifications);let c=["before"];(null==(n=this.actionsConfiguration)?void 0:n.modals)&&(c="all"===this.actionsConfiguration.modals?a:this.actionsConfiguration.modals),(null==e?void 0:e.modals)&&(c="all"===e.modals?a:e.modals);const d=(null==e?void 0:e.returnStrategy)||(null==(i=this.actionsConfiguration)?void 0:i.returnStrategy)||"back",u=(null==e?void 0:e.twaReturnUrl)||(null==(o=this.actionsConfiguration)?void 0:o.twaReturnUrl);let h=(null==e?void 0:e.skipRedirectToWallet)||(null==(s=this.actionsConfiguration)?void 0:s.skipRedirectToWallet)||"ios";return On()&&(h="never"),{notifications:l,modals:c,returnStrategy:d,twaReturnUrl:u,skipRedirectToWallet:h}}}({manifestUrl:"https://multisig.ton.org/tonconnect-manifest.json",buttonRootId:"tonConnectButton"});Gu.uiOptions={uiPreferences:{theme:ir.LIGHT}},Gu.onStatusChange((e=>{null===e?Wu=null:e.account&&(Wu=a.Address.parseRaw(e.account.address)),Ju&&Xu&&rh(),oh&&sh&&dh()})),Du("#createMultisigButton").addEventListener("click",(()=>{jh("create")})),Du("#importMultisigButton").addEventListener("click",(()=>{Zu("importScreen")})),Du("#import_okButton").addEventListener("click",(()=>{const e=Du("#import_input").value,t=Wc(e,Vu);t?alert(t):ih(e)})),Du("#import_backButton").addEventListener("click",(()=>{Zu("startScreen")}));const Yu=a.Cell.fromBase64("te6cckECEgEABJUAART/APSkE/S88sgLAQIBYgIDAsrQM9DTAwFxsJJfA+D6QDAi10nAAJJfA+AC0x8BIMAAkl8E4AHTPwHtRNDT/wEB0wcBAdTTBwEB9ATSAAEB0SiCEPcYUQ+64w8FREPIUAYBy/9QBAHLBxLMAQHLB/QAAQHKAMntVAQFAgEgDA0BnjgG0/8BKLOOEiCE/7qSMCSWUwW68uPw4gWkBd4B0gABAdMHAQHTLwEB1NEjkSaRKuJSMHj0Dm+h8uPvHscF8uPvIPgjvvLgbyD4I6FUbXAGApo2OCaCEHUJf126jroGghCjLFm/uo6p+CgYxwXy4GUD1NEQNBA2RlD4AH+OjSF49HxvpSCRMuMNAbPmWxA1UDSSNDbiUFQT4w1AFVAzBAoJAdT4BwODDPlBMAODCPlBMPgHUAahgSf4AaBw+DaBEgZw+DaggSvscPg2oIEdmHD4NqAipgYioIEFOSagJ6Bw+DgjpIECmCegcPg4oAOmBliggQbgUAWgUAWgQwNw+DdZoAGgHL7y4GT4KFADBwK4AXACyFjPFgEBy//JiCLIywH0APQAywDJcCH5AHTIywISygfL/8nQyIIQnHP7olgKAssfyz8mAcsHUlDMUAsByy8bzCoBygAKlRkBywcIkTDiECRwQImAGIBQ2zwRCACSjkXIWAHLBVAFzxZQA/oCVHEjI+1E7UXtR59byFADzxfJE3dQA8trzMztZ+1l7WR0f+0RmHYBy2vMAc8X7UHt8QHy/8kB+wDbBgLiNgTT/wEB0y8BAdMHAQHT/wEB1NH4KFAFAXACyFjPFgEBy//JiCLIywH0APQAywDJcAH5AHTIywISygfL/8nQG8cF8uBlJvkAGrpRk74ZsPLgZgf4I77y4G9EFFBW+AB/jo0hePR8b6UgkTLjDQGz5lsRCgH6AtdM0NMfASCCEPE4Hlu6jmqCEB0M+9O6jl5sRNMHAQHUIX9wjhdREnj0fG+lMiGZUwK68uBnAqQC3gGzEuZsISDCAPLgbiPCAPLgbVMwu/LgbQH0BCF/cI4XURJ49HxvpTIhmVMCuvLgZwKkAt4BsxLmbCEw0VUjkTDi4w0LABAw0wfUAvsA0QFDv3T/aiaGn/gIDpg4CA6mmDgID6AmkAAIDoiBqvgoD8EdDA4CAWYPEADC+AcDgwz5QTADgwj5QTD4B1AGoYEn+AGgcPg2gRIGcPg2oIEr7HD4NqCBHZhw+DagIqYGIqCBBTkmoCegcPg4I6SBApgnoHD4OKADpgZYoIEG4FAFoFAFoEMDcPg3WaABoADxsMr7UTQ0/8BAdMHAQHU0wcBAfQE0gABAdEjf3COF1ESePR8b6UyIZlTArry4GcCpALeAbMS5mwhUjC68uBsIX9wjhdREnj0fG+lMiGZUwK68uBnAqQC3gGzEuZsITAiwgDy4G4kwgDy4G1SQ7vy4G0BkjN/kQPiA4AFZsMn+CgBAXACyFjPFgEBy//JiCLIywH0APQAywDJcAH5AHTIywISygfL/8nQgEQhCAmMFqAYchWwszwXcsN9YFccUdYcFZ8q18EnjQLz1klHzYNH/nQ=="),Qu=a.Cell.fromBase64("te6cckEBAQEAIwAIQgJjBagGHIVsLM8F3LDfWBXHFHWHBWfKtfBJ40C89ZJR80AoJo0=");let Ju,Xu,eh=-1;const th=()=>{Ju=void 0,Xu=void 0,clearTimeout(eh)},rh=()=>{const{tonBalance:e,threshold:t,signers:r,proposers:n,allowArbitraryOrderSeqno:i,nextOderSeqno:o,lastOrders:s}=Xu;Du("#multisig_tonBalance").innerText=(0,a.fromNano)(e)+" TON",Du("#multisig_threshold").innerText=t+"/"+r.length,Du("#multisig_orderId").innerText=i?"Arbitrary":o.toString();let l="";for(let e=0;e#${e} — ${Jc(t)}${ed(t.address,Wu)?Fu:""}`}if(Du("#multisig_signersList").innerHTML=l,n.length>0){let e="";for(let t=0;t#${t} — ${Jc(r)}${ed(r.address,Wu)?Fu:""}`}Du("#multisig_proposersList").innerHTML=e}else Du("#multisig_proposersList").innerHTML="No proposers";const c=e=>{if(e.errorMessage)return e.errorMessage.startsWith("Contract not active")?"":`
    Invalid Order #${e.order.id} — ${e.errorMessage}
    `;{const t=!!e.orderInfo&&(new Date).getTime()>e.orderInfo.expiresAt.getTime(),r=t?"Expired order ":(e=>{switch(e.type){case"new":return"New order";case"execute":return"Execute order";case"pending":return"Pending order";case"executed":return"Executed order"}throw new Error("unknown order type "+e.type)})(e);let n=`${r} #${e.order.id}`;if("pending"!==e.type||t||(n+=` — ${e.orderInfo.approvalsNum}/${e.orderInfo.threshold}`),"pending"===e.type&&Wu){const t=e.orderInfo.signers.findIndex((e=>e.address.equals(Wu)));if(t>-1){const r=1<${n}`}};let d="",u=!1,h=!1;for(const e of s)"executed"==e.type?h||(d+='
    Old orders:
    ',h=!0):"pending"===e.type&&(u||(d+='
    Pending orders:
    ',u=!0)),d+=c(e);Du("#mainScreen_ordersList").innerHTML=d,(".multisig_lastOrder",document.querySelectorAll(".multisig_lastOrder")).forEach((e=>{e.addEventListener("click",(e=>{const t=e.currentTarget.attributes,r=t.getNamedItem("order-address").value,n=BigInt(t.getNamedItem("order-id").value);hh(n,r)}))}))},nh=async(e,t)=>{try{const r=await(async(e,t,r,n,i,o)=>{const s=await Hc("account",{address:Xc(e)},n);rd("active"===s.status,"Contract not active. If you have just created a multisig it should appear within ~30 seconds."),rd(a.Cell.fromBase64(s.code).equals(t),"The contract code DOES NOT match the multisig code from this repository");const l=s.balance,c=function(e){const t=e.beginParse(),r=t.loadUintBig(256),n=t.loadUint(8),i=ld(t.loadRef()),o=t.loadUint(8),s=ld(t.loadMaybeRef()),a=t.loadBit();return cd(t),{nextOderSeqno:r,threshold:n,signers:i,signersCount:o,proposers:s,allowArbitraryOrderSeqno:a}}(a.Cell.fromBase64(s.data));c.allowArbitraryOrderSeqno&&rd(c.nextOderSeqno===BigInt(0),"invalid nextOrderSeqno for allowArbitraryOrderSeqno");const d=c.signers,u=c.proposers;rd(d.length===c.signersCount,"invalid signersCount"),rd(c.threshold>0,"threshold <= 0"),rd(c.threshold<=c.signersCount,"invalid threshold");const h=[];for(const e of d)h.push(await Yc(e,n));const f=[];for(const e of u)f.push(await Yc(e,n));const p=dd.createFromAddress(e.address),g=new Zc(e.address,n);if(o){const e=await p.getMultisigData(g);c.allowArbitraryOrderSeqno?rd(e.nextOrderSeqno===BigInt(-1),"nextOderSeqno doesn't match"):rd(e.nextOrderSeqno===c.nextOderSeqno,"nextOderSeqno doesn't match"),rd(e.threshold===BigInt(c.threshold),"threshold doesn't match"),rd(td(e.signers,c.signers),"invalid signers"),rd(td(e.proposers,c.proposers),"invalid proposers")}const m=dd.createFromConfig({threshold:c.threshold,signers:c.signers,proposers:c.proposers,allowArbitrarySeqno:c.allowArbitraryOrderSeqno},t).address.equals(e.address),y={address:e,multisigContract:p,provider:g,signers:h,proposers:f,threshold:c.threshold,allowArbitraryOrderSeqno:c.allowArbitraryOrderSeqno,nextOderSeqno:c.nextOderSeqno,tonBalance:l,lastOrders:[],stateInitMatches:m};let b=[];if("none"!==i){const t=await Hc("transactions",{account:Xc(e),limit:256},n);for(const i of t.transactions){if(!i.in_msg.message_content)continue;if(!i.in_msg.message_content.body)continue;const t=a.Cell.fromBase64(i.in_msg.message_content.body).beginParse();if(t.remainingBits<32)continue;const o=t.loadUint(32);if(1963556701===o)try{t.loadUintBig(64);const o=t.loadUintBig(256),s=a.Address.parse(i.in_msg.source),l=hd.createFromConfig({multisig:e.address,orderSeqno:o},r);if(!s.equals(l.address))throw new Error("fake order");b.push({utime:i.now,type:"execute",order:{address:{address:s,isBounceable:!0,isTestOnly:n},id:o}})}catch(e){b.push({utime:i.now,type:"execute",errorMessage:e.message})}else if(4145565967===o)try{if(1!==i.out_msgs.length)throw new Error("invalid out messages");const o=i.out_msgs[0],{orderAddress:s,orderId:l}=xd(o),c=hd.createFromConfig({multisig:e.address,orderSeqno:l},r);if(!s.equals(c.address))throw new Error("fake order");const d=t.loadUint(64),u=(t.loadUint(256),t.loadUint(1)),h=t.loadUint(8),f=t.loadUint(48),p=t.loadRef().beginParse().loadDictDirect(a.Dictionary.Keys.Uint(8),a.Dictionary.Values.Cell());cd(t),console.log("IN",{queryId:d,orderId:l,orderAddress:s.toString(),isSigner:u,index:h,expiredAt:f,order:p}),b.push({utime:i.now,type:"new",order:{address:{address:s,isBounceable:!0,isTestOnly:n},id:l}})}catch(e){console.log(e),b.push({utime:i.now,type:"new",errorMessage:"Invalid new order: "+e.message})}}if("aggregate"===i){const e={};for(let t of b){if(t.errorMessage)continue;const r=t.order.id.toString();e[r]?"executed"!==e[r].type&&"execute"===t.type&&(e[r].utime=t.utime,e[r].type="executed"):e[r]={utime:t.utime,type:"new"===t.type?"pending":"executed",order:t.order}}b=Object.values(e);for(const e of b)if("pending"===e.type)try{const t=await _d(e.order.address,r,y,n,!1);e.orderInfo=t,(new Date).getTime()>t.expiresAt.getTime()&&(e.type="executed")}catch(t){e.type="executed",e.errorMessage=t.message}b=b.sort(((e,t)=>e.type===t.type?t.utime-e.utime:"pending"===e.type?-1:1))}}return y.lastOrders=b,y})(a.Address.parseFriendly(e),Yu,Qu,Vu,"aggregate",t);if(Ju!==e)return;Xu=r,rh(),$u(Du("#multisig_content"),!0),$u(Du("#multisig_error"),!1)}catch(t){if(console.error(t),Ju!==e)return;$u(Du("#multisig_content"),!1),$u(Du("#multisig_error"),!0),Du("#multisig_error").innerText=t.message}clearTimeout(eh),eh=setTimeout((()=>nh(e,!1)),5e3),t&&Zu("multisigScreen")},ih=async(e,t)=>{Zu("loadingScreen"),th(),Ju=e,localStorage.setItem("multisigAddress",e),Ku(e,t);const r=a.Address.parseFriendly(Ju);r.isBounceable=!0,r.isTestOnly=Vu,Du("#mulisig_address").innerHTML=Jc(r),await nh(e,!0)};let oh,sh;Du("#multisig_logoutButton").addEventListener("click",(()=>{localStorage.removeItem("multisigAddress"),th(),Zu("startScreen")})),Du("#multisig_createNewOrderButton").addEventListener("click",(()=>{Zu("newOrderScreen")})),Du("#multisig_updateButton").addEventListener("click",(()=>{jh("update")}));let ah=-1;const lh=()=>{oh=void 0,sh=void 0,clearTimeout(ah)},ch=(e,t)=>{Du("#order_approveButton").innerText=t?e?"Executing..":"Execute":e?"Approving..":"Approve",Du("#order_approveButton").disabled=e},dh=()=>{const{tonBalance:e,actions:t,isExecuted:r,approvalsNum:n,approvalsMask:i,threshold:o,signers:s,expiresAt:l}=sh,c=(new Date).getTime()>l.getTime();Du("#order_tonBalance").innerText=(0,a.fromNano)(e)+" TON",Du("#order_executed").innerText=r?"Yes":"Not yet",Du("#order_approvals").innerText=n+"/"+o,Du("#order_expiresAt").innerText=(c?"❌ EXPIRED - ":"")+l.toString();let d=!1,u="";for(let e=0;e#${e} — ${r} — ${n?"✅":"❌"}${ed(t.address,Wu)?Fu:""}`}Du("#order_signersList").innerHTML=u;let h="";for(const e of t)h+=e;0===t.length?Du("#order_actionsTitle").innerText="No actions":1===t.length?Du("#order_actionsTitle").innerText="One action:":Du("#order_actionsTitle").innerText=t.length+" actions:",Du("#order_actions").innerHTML=h;let f=Number(localStorage.getItem(Ju+"_"+oh+"_approve"));Date.now()-f>12e4&&!d&&(f=0,localStorage.removeItem(Ju+"_"+oh+"_approve")),ch(!!f,n===o-1),$u(Du("#order_approveButton"),!r&&!c&&!d),$u(Du("#order_approveNote"),!r&&!c&&!d)},uh=async(e,t,r)=>{try{const n=await _d(e,Qu,Xu,Vu,r);if(oh!==t)return;sh=n,dh(),$u(Du("#order_content"),!0),$u(Du("#order_error"),!1)}catch(e){if(console.error(e),oh!==t)return;$u(Du("#order_content"),!1),$u(Du("#order_error"),!0),Du("#order_error").innerText=e.message}clearTimeout(ah),ah=setTimeout((()=>uh(e,t,!1)),5e3),r&&Zu("orderScreen")},hh=async(e,t)=>{if(!Xu)throw new Error("setOrderId: no multisig info");if(Zu("loadingScreen"),lh(),oh=e,Ku(Ju,e),void 0===t){const r=hd.createFromConfig({multisig:a.Address.parseFriendly(Ju).address,orderSeqno:e},Qu);t=qu(r.address)}Du("#order_id").innerText="#"+oh;const r=a.Address.parseFriendly(t);r.isBounceable=!0,r.isTestOnly=Vu,Du("#order_address").innerHTML=Jc(r),await uh(r,e,!0)};Du("#order_backButton").addEventListener("click",(()=>{Ku(Ju),lh(),Zu("multisigScreen")})),Du("#order_approveButton").addEventListener("click",(async()=>{if(!Ju)throw new Error("approve !currentMultisigAddress");if(!sh)throw new Error("approve !currentOrderInfo");const e=Ju,t=sh;if(!Wu)return void alert("Please connect wallet");if(-1==t.signers.findIndex((e=>e.address.equals(Wu))))return void alert("You are not signer");const r=Xc(t.address),n=gh.toString(),i=(0,a.beginCell)().storeUint(0,32).storeStringTail("approve").endCell().toBoc().toString("base64");console.log({orderAddressString:r,amount:n});const o={validUntil:Math.floor(Date.now()/1e3)+60,messages:[{address:r,amount:n,payload:i}]};ch(!0,t.approvalsNum===t.threshold-1),localStorage.setItem(e+"_"+t.orderId+"_approve",Date.now().toString());try{await Gu.sendTransaction(o)}catch(r){console.error(r),localStorage.removeItem(e+"_"+t.orderId+"_approve"),Ju===e&&oh===t.orderId&&ch(!1,t.approvalsNum===t.threshold-1)}}));const fh=(e,t,r)=>{const n=t=>({error:e+": "+t}),i=e=>({value:e});if(null==t||""===t)return n("Empty");switch(r){case"TON":return((e,t)=>{try{const r=function(e,t){const r=function(e){let t=1n;for(let r=0;r2)throw Error("Invalid number");let o=i[0],s=i[1];if(o||(o="0"),s||(s="0"),s.length>t)throw Error("Invalid number");for(;s.length{try{const t=BigInt(e);return t<=0?n("Enter positive amount"):i(t)}catch(e){return n("Invalid amount")}})(t);case"Address":if(!a.Address.isFriendly(t))return n("Invalid Address");const e=a.Address.parseFriendly(t);return e.isTestOnly&&!Vu?n("Please enter mainnet address"):i(e);case"URL":return t.startsWith("https://")?i(t):n("Invalid URL");case"Status":return md.indexOf(t)>-1?i(t):n("Invalid status. Please use: "+md.join(", "))}},ph=(0,a.toNano)("0.2"),gh=(0,a.toNano)("0.1"),mh=(0,a.toNano)("0.05"),yh=async e=>{try{const t=Xu,r=await Ed(e.jettonMinterAddress,Vu,!1);return t.address.address.equals(r.adminAddress)?{value:r}:{error:"Multisig is not admin of this jetton"}}catch(e){return console.error(e),{error:"Jetton-minter check error"}}},bh=async e=>{try{const t=await Xu.multisigContract.getOrderAddress(Xu.provider,e);return"uninit"===(await Hc("account",{address:t.toRawString()},Vu)).status?{value:!0}:{error:`Order ${e} already exists`}}catch(e){return console.error(e),{error:"Possibly connectivity error"}}},wh=[{name:"Transfer TON",fields:{amount:{name:"TON Amount",type:"TON"},toAddress:{name:"Destination Address",type:"Address"}},makeMessage:async e=>({toAddress:e.toAddress,tonAmount:e.amount,body:(0,a.beginCell)().endCell()})},{name:"Transfer Jetton",fields:{jettonMinterAddress:{name:"Jetton Minter Address",type:"Address"},amount:{name:"Jetton Amount (in units)",type:"Jetton"},toAddress:{name:"To Address",type:"Address"}},makeMessage:async e=>{const t=e.jettonMinterAddress.address,r=Xu.address.address,n=vd.createFromAddress(t),i=new Zc(t,Vu);return{toAddress:{address:await n.getWalletAddress(i,r),isBounceable:!0,isTestOnly:Vu},tonAmount:gh,body:gd.transferMessage(e.amount,e.toAddress.address,r,null,0n,null)}}},{name:"Mint Jetton",fields:{jettonMinterAddress:{name:"Jetton Minter Address",type:"Address"},amount:{name:"Jetton Amount (in units)",type:"Jetton"},toAddress:{name:"To Address",type:"Address"}},check:yh,makeMessage:async e=>({toAddress:e.jettonMinterAddress,tonAmount:gh,body:vd.mintMessage(e.toAddress.address,e.amount,e.jettonMinterAddress.address,Xu.address.address,null,0n,mh)})},{name:"Change Jetton Admin",fields:{jettonMinterAddress:{name:"Jetton Minter Address",type:"Address"},newAdminAddress:{name:"New Admin Address",type:"Address"}},check:yh,makeMessage:async e=>({toAddress:e.jettonMinterAddress,tonAmount:gh,body:vd.changeAdminMessage(e.newAdminAddress.address)})},{name:"Claim Jetton Admin",fields:{jettonMinterAddress:{name:"Jetton Minter Address",type:"Address"}},check:async e=>{try{const t=Xu,r=await Ed(e.jettonMinterAddress,Vu,!0);return r.nextAdminAddress&&t.address.address.equals(r.nextAdminAddress)?{value:r}:{error:"Multisig is not next-admin of this jetton"}}catch(e){return console.error(e),{error:"Jetton-minter check error"}}},makeMessage:async e=>({toAddress:e.jettonMinterAddress,tonAmount:gh,body:vd.claimAdminMessage()})},{name:"Top-up Jetton Minter",fields:{jettonMinterAddress:{name:"Jetton Minter Address",type:"Address"},amount:{name:"TON Amount",type:"TON"}},makeMessage:async e=>({toAddress:e.jettonMinterAddress,tonAmount:e.amount,body:vd.topUpMessage()})},{name:"Change Jetton Metadata URL",fields:{jettonMinterAddress:{name:"Jetton Minter Address",type:"Address"},newMetadataUrl:{name:"New Metadata URL",type:"URL"}},check:yh,makeMessage:async e=>({toAddress:e.jettonMinterAddress,tonAmount:gh,body:vd.changeContentMessage({uri:e.newMetadataUrl})})},{name:"Force Burn Jetton",fields:{jettonMinterAddress:{name:"Jetton Minter Address",type:"Address"},amount:{name:"Jetton Amount (in units)",type:"Jetton"},fromAddress:{name:"User Address",type:"Address"}},check:yh,makeMessage:async e=>({toAddress:e.jettonMinterAddress,tonAmount:gh,body:vd.forceBurnMessage(e.amount,e.fromAddress.address,Xu.address.address,mh)})},{name:"Force Transfer Jetton",fields:{jettonMinterAddress:{name:"Jetton Minter Address",type:"Address"},amount:{name:"Jetton Amount (in units)",type:"Jetton"},fromAddress:{name:"From Address",type:"Address"},toAddress:{name:"To Address",type:"Address"}},check:yh,makeMessage:async e=>({toAddress:e.jettonMinterAddress,tonAmount:gh,body:vd.forceTransferMessage(e.amount,e.toAddress.address,e.fromAddress.address,e.jettonMinterAddress.address,null,0n,null,mh)})},{name:"Set status for Jetton Wallet",fields:{jettonMinterAddress:{name:"Jetton Minter Address",type:"Address"},userAddress:{name:"User Address",type:"Address"},newStatus:{name:`New Status (${md.join(", ")})`,type:"Status"}},check:yh,makeMessage:async e=>({toAddress:e.jettonMinterAddress,tonAmount:gh,body:vd.lockWalletMessage(e.userAddress.address,yd(e.newStatus),mh)})}],vh=Du("#newOrder_typeInput");vh.innerHTML=(()=>{let e="";for(let t=0;t${wh[t].name}`;return e})();const Ch=e=>{const t=wh[e];let r="";for(let n in t.fields)if(t.fields.hasOwnProperty(n)){const i=t.fields[n];if(r+=`
    ${i.name}:
    `,"Status"===i.type){r+=`"}else r+=``}Du("#newOrder_fieldsContainer").innerHTML=r};vh.addEventListener("change",(e=>{Ch(vh.selectedIndex)})),Ch(0);let _h,kh="fill";const xh=()=>{if(!Xu)return"";let e=-1n;return Xu.lastOrders.forEach((t=>{t.order.id>e&&(e=t.order.id)})),-1n===e?"":(e+1n).toString()},Ah=()=>{Eh("fill"),_h=void 0,vh.selectedIndex=0,Ch(0),Du("#newOrder_orderId").value=xh()},Sh=e=>{Du("#newOrder_createButton").disabled=e,Du("#newOrder_backButton").disabled=e},Bh=e=>{const t=vh.selectedIndex,r=wh[t];vh.disabled=e,Du("#newOrder_orderId").disabled=e;for(let n in r.fields)r.fields.hasOwnProperty(n)&&(Du(`#newOrder_${t}_${n}`).disabled=e);Sh(e)},Eh=e=>{"fill"==e?(Bh(!1),Du("#newOrder_createButton").innerHTML="Create",Du("#newOrder_backButton").innerHTML="Back"):(Bh(!0),Du("#newOrder_createButton").innerHTML="Send Transaction",Du("#newOrder_backButton").innerHTML="Cancel"),kh=e};Du("#newOrder_createButton").addEventListener("click",(async()=>{if(!Wu)return void alert("Please connect wallet");if("confirm"===kh){if(!_h)throw new Error("");try{await Gu.sendTransaction({validUntil:Math.floor(Date.now()/1e3)+60,messages:[_h.message]}),Ju===qu(_h.multisigAddress)&&hh(_h.orderId)}catch(e){console.error(e)}return}const e=Ih(Du("#newOrder_orderId"));if(null==e||e<0)return void alert("Invalid Order ID");const t=vh.selectedIndex,r=wh[t],n={};for(let e in r.fields)if(r.fields.hasOwnProperty(e)){const i=r.fields[e],o=Du(`#newOrder_${t}_${e}`).value,s=fh(i.name,o,i.type);if(s.error)return void alert(s.error);n[e]=s.value}Bh(!0);const i=await bh(e);if(i.error)return alert(i.error),void Eh("fill");if(r.check){const e=await r.check(n);if(e.error)return alert(e.error),void Eh("fill")}const o=await r.makeMessage(n),s=Xu.proposers.findIndex((e=>e.address.equals(Wu))),l=Xu.signers.findIndex((e=>e.address.equals(Wu)));if(-1===s&&-1===l)return alert("Error: you are not proposer and not signer"),void Eh("fill");const c=l>-1,d=o.toAddress,u=o.tonAmount,h=o.body,f=Math.floor(Date.now()/1e3)+2592e3,p=dd.packOrder([{type:"transfer",sendMode:a.SendMode.PAY_GAS_SEPARATELY,message:{info:{type:"internal",ihrDisabled:!1,bounce:!0,bounced:!1,dest:d.address,value:{coins:u},ihrFee:0n,forwardFee:0n,createdLt:0n,createdAt:0},body:h}}]),g=dd.newOrderMessage(p,f,c,c?l:s,e,0n),m=g.toBoc().toString("base64");console.log({toAddress:d,tonAmount:u,payloadCell:h,message:g,orderId:e});const y=Ju,b=ph.toString();_h={multisigAddress:a.Address.parseFriendly(y).address,orderId:e,message:{address:y,amount:b,payload:m}},Eh("confirm"),Sh(!1)})),Du("#newOrder_backButton").addEventListener("click",(()=>{"fill"==kh?Zu("multisigScreen"):Eh("fill")}));const Ih=e=>{if(""===e.value)return null;try{return BigInt(e.value)}catch(e){return null}},Ph=Du("#newMultisig_threshold"),Mh=Du("#newMultisig_orderId");let Uh,Th,Oh="create",Rh="fill";const jh=e=>{Oh=e,Zu("newMultisigScreen")},Lh=()=>{if(Rh="fill",Uh={signersCount:0,proposersCount:0},Th=void 0,Du("#newMultisig_signersContainer").innerHTML="",Du("#newMultisig_proposersContainer").innerHTML="",Mh.value=xh(),Ph.value="",$u(Du("#newMultisig_orderIdLabel"),"update"===Oh),$u(Du("#newMultisig_orderId"),"update"===Oh),"create"===Oh)Nh(0),Uh.signersCount=1;else{Uh.signersCount=Xu.signers.length;for(let e=0;e{const e=Du("#newMultisig_deleteSigner0");$u(e,Uh.signersCount>1)},Nh=(e,t)=>{const r=document.createElement("div");r.classList.add("address-input"),r.innerHTML=`
    #${e}.
    `,Du("#newMultisig_signersContainer").appendChild(r),Du(`#newMultisig_signer${e}`).value=void 0===t?"":t,r.querySelector(`#newMultisig_deleteSigner${e}`).addEventListener("click",$h)},Dh=(e,t)=>{const r=document.createElement("div");r.classList.add("address-input"),r.innerHTML=`
    #${e}.
    `,Du("#newMultisig_proposersContainer").appendChild(r),Du(`#newMultisig_proposer${e}`).value=void 0===t?"":t,r.querySelector(`#newMultisig_deleteProposer${e}`).addEventListener("click",Fh)},$h=e=>{const t=e.target,r=Number(t.id.slice(24));if(isNaN(r))throw new Error;const n=[];for(let e=0;e{const t=e.target,r=Number(t.id.slice(26));if(isNaN(r))throw new Error;const n=[];for(let e=0;e{Nh(Uh.signersCount),Uh.signersCount++,zh()})),Du("#newMultisig_addProposerButton").addEventListener("click",(async()=>{Dh(Uh.proposersCount),Uh.proposersCount++}));const Kh=()=>{const e="confirm"===Rh;Mh.disabled=e,Ph.disabled=e,$u(Du("#newMultisig_addSignerButton"),!e),$u(Du("#newMultisig_addProposerButton"),!e);for(let t=0;t1)}for(let t=0;t{"fill"===Rh?Zu("create"===Oh?"startScreen":"multisigScreen"):(Rh="fill",Kh())}));const Vh=e=>{Du("#newMultisig_createButton").disabled=e,Du("#newMultisig_createButton").innerText=e?"Checking..":"confirm"===Rh?"Confirm":"update"===Oh?"Update":"Create",Du("#newMultisigScreen").style.pointerEvents=e?"none":"auto"};Du("#newMultisig_createButton").addEventListener("click",(async()=>{if(!Wu)return void alert("Please connect wallet");if("confirm"===Rh){try{const e=Th.orderId,t=Th.multisigAddress;await Gu.sendTransaction({validUntil:Math.floor(Date.now()/1e3)+60,messages:[Th.message]}),"update"===Oh?Ju===qu(t)&&hh(e):ih(qu(t))}catch(e){console.error(e)}return}const e=(e=>{if(""===e.value)return null;try{const t=parseInt(e.value);return isNaN(t)?null:t}catch(e){return null}})(Ph);if(null==e||e<=0||e>Uh.signersCount)return void alert("Threshold count: not valid number");let t;if("update"===Oh){if(t=Ih(Mh),null==t||t<0)return void alert("Invalid order Id");Vh(!0);const e=await bh(t);if(Vh(!1),e.error)return void alert(e.error)}const r={},n=[];for(let e=0;e{null!=o.splitDepth?(e.storeBit(!0),e.storeUint(o.splitDepth,5)):e.storeBit(!1),null!=o.special?(e.storeBit(!0),e.store(function(e){return t=>{t.storeBit(e.tick),t.storeBit(e.tock)}}(o.special))):e.storeBit(!1),e.storeMaybeRef(o.code),e.storeMaybeRef(o.data),e.storeDict(o.libraries)})(l),Th={multisigAddress:r,message:{address:r.toString({urlSafe:!0,bounceable:!0,testOnly:Vu}),amount:s,stateInit:l.endCell().toBoc().toString("base64")}},Rh="confirm",Kh()}else{const r=Xu.proposers.findIndex((e=>e.address.equals(Wu))),o=Xu.signers.findIndex((e=>e.address.equals(Wu)));if(-1===r&&-1===o)return void alert("Error: you are not proposer and not signer");const s=o>-1,l=Math.floor(Date.now()/1e3)+2592e3,c=dd.packOrder([{type:"update",threshold:e,signers:n,proposers:i}]),d=dd.newOrderMessage(c,l,s,s?o:r,t,0n).toBoc().toString("base64"),u=Ju,h=gh.toString();Th={multisigAddress:a.Address.parseFriendly(u).address,orderId:t,message:{address:u,amount:h,payload:d}},Rh="confirm",Kh()}var o}));const qh=e=>{if(a.Address.isFriendly(e))return a.Address.parseFriendly(e)},Hh=async()=>{th(),lh();const e=window.location.hash.substring(1);if(e){const{multisigAddress:t,orderId:r}=(e=>{if(e.indexOf("/")>-1){const t=e.split("/");if(2!==t.length)return{};const r=qh(t[0]);if(void 0===r)return{};const n=(e=>{try{const t=BigInt(e);if(t<0)return;return t}catch(e){return}})(t[1]);return void 0===n?{}:{multisigAddress:r,orderId:n}}return{multisigAddress:qh(e)}})(e);if(console.log(t,r),void 0===t)alert("Invalid URL"),Zu("startScreen");else{const e=qu(t.address);await ih(e,r),void 0!==r&&Ju===e&&await hh(r,void 0)}}else(()=>{const e=localStorage.getItem("multisigAddress");e?ih(e):Zu("startScreen")})()};Hh(),window.onpopstate=()=>Hh()})()})(); \ No newline at end of file