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AA,MAAAgQ,EAAAC,EAAA,SAAAK,CAAA,EACArc,GAAAqc,EAAA,IACA,GACArc,CACA,EAIA4c,CAEA","sources":["webpack://_N_E/./node_modules/@thirdweb-dev/sdk/dist/assertEnabled-4605112f.browser.esm.js","webpack://_N_E/./node_modules/@thirdweb-dev/sdk/dist/setErc20Allowance-e3ef471a.browser.esm.js","webpack://_N_E/./node_modules/@thirdweb-dev/merkletree/dist/thirdweb-dev-merkletree.esm.js","webpack://_N_E/./node_modules/@thirdweb-dev/sdk/dist/signature-52783ae4.browser.esm.js","webpack://_N_E/./node_modules/buffer-reverse/index.js","webpack://_N_E/./node_modules/treeify/treeify.js","webpack://_N_E/"],"sourcesContent":["import { BigNumber } from 'ethers';\nimport { z } from 'zod';\nimport { x as ExtensionNotImplementedError } from './index-02e94cec.browser.esm.js';\n\nconst RawDateSchema = /* @__PURE__ */(() => z.union([z.date().transform(i => {\n return BigNumber.from(Math.floor(i.getTime() / 1000));\n}), z.number().transform(i => {\n return BigNumber.from(i);\n})]))();\n\n/**\n * Default to now\n */\nconst StartDateSchema = /* @__PURE__ */(() => RawDateSchema.default(new Date(0)))();\n\n/**\n * Default to 10 years from now\n */\nconst EndDateSchema = /* @__PURE__ */(() => RawDateSchema.default(new Date(Date.now() + 1000 * 60 * 60 * 24 * 365 * 10)))();\n\n/**\n * Checks whether the given DetectableFeature is defined\n * @internal\n * @param namespace - The namespace to check\n * @param feature - The corresponding feature\n */\nfunction assertEnabled(namespace, feature) {\n if (!namespace) {\n throw new ExtensionNotImplementedError(feature);\n }\n return namespace;\n}\n\nexport { EndDateSchema as E, RawDateSchema as R, StartDateSchema as S, assertEnabled as a };\n","import { cx as BigNumberTransformSchema, cy as FileOrBufferOrStringSchema, cz as HexColor, cs as ContractWrapper } from './index-02e94cec.browser.esm.js';\nimport { z } from 'zod';\nimport { i as isNativeToken } from './fetchCurrencyValue-a150f8dd.browser.esm.js';\n\nconst PropertiesInput = /* @__PURE__ */(() => z.object({}).catchall(z.union([BigNumberTransformSchema, z.unknown()])))();\n\n/**\n * @internal\n */\nconst OptionalPropertiesInput = /* @__PURE__ */(() => z.union([z.array(z.array(PropertiesInput)).transform(i => i.flat()), z.array(PropertiesInput), PropertiesInput]).optional().nullable())();\n\n/**\n * @internal\n */\nconst BasicNFTInput = /* @__PURE__ */(() => z.object({\n name: z.union([z.string(), z.number()]).optional().nullable(),\n description: z.string().nullable().optional().nullable(),\n image: FileOrBufferOrStringSchema.nullable().optional(),\n animation_url: FileOrBufferOrStringSchema.optional().nullable()\n}))();\n\n/**\n * @internal\n */\nconst CommonNFTInput = /* @__PURE__ */(() => BasicNFTInput.extend({\n external_url: FileOrBufferOrStringSchema.nullable().optional(),\n background_color: HexColor.optional().nullable(),\n properties: OptionalPropertiesInput,\n attributes: OptionalPropertiesInput\n}).catchall(z.union([BigNumberTransformSchema, z.unknown()])))();\n\n/**\n * @internal\n */\nconst NFTInputOrUriSchema = /* @__PURE__ */(() => z.union([CommonNFTInput, z.string()]))();\n\n/**\n * @internal\n */\nconst CommonNFTOutput = /* @__PURE__ */(() => CommonNFTInput.extend({\n id: z.string(),\n uri: z.string(),\n image: z.string().nullable().optional(),\n external_url: z.string().nullable().optional(),\n animation_url: z.string().nullable().optional()\n}))();\n\n/**\n * @public\n */\n\n/**\n * @public\n */\n\n/**\n * @public\n */\n\n/**\n * @public\n */\n\n/**\n * @public\n */\n\n/**\n * @internal\n */\nasync function setErc20Allowance(contractToApprove, value, currencyAddress, overrides) {\n if (isNativeToken(currencyAddress)) {\n overrides[\"value\"] = value;\n } else {\n const ERC20Abi = (await import('@thirdweb-dev/contracts-js/dist/abis/IERC20.json')).default;\n const signer = contractToApprove.getSigner();\n const provider = contractToApprove.getProvider();\n const erc20 = new ContractWrapper(signer || provider, currencyAddress, ERC20Abi, contractToApprove.options, contractToApprove.storage);\n const owner = await contractToApprove.getSignerAddress();\n const spender = contractToApprove.address;\n const allowance = await erc20.read(\"allowance\", [owner, spender]);\n if (allowance.lt(value)) {\n // approve overrides the previous allowance, set it to the minimum required for this tx\n await erc20.sendTransaction(\"approve\", [spender, value]);\n }\n return overrides;\n }\n}\n\nexport { BasicNFTInput as B, CommonNFTInput as C, NFTInputOrUriSchema as N, CommonNFTOutput as a, setErc20Allowance as s };\n","import { Buffer } from 'buffer';\nimport reverse from 'buffer-reverse';\nimport { asTree } from 'treeify';\n\n// ADAPTED FROM https://github.com/merkletreejs/merkletreejs\nclass Base {\n /**\n * print\n * @desc Prints out a visual representation of the merkle tree.\n * @example\n *```js\n *tree.print()\n *```\n */\n print() {\n Base.print(this);\n }\n\n /**\n * bufferIndexOf\n * @desc Returns the first index of which given buffer is found in array.\n * @param {Buffer[]} haystack - Array of buffers.\n * @param {Buffer} needle - Buffer to find.\n * @return {Number} - Index number\n *\n * @example\n * ```js\n *const index = tree.bufferIndexOf(haystack, needle)\n *```\n */\n bufferIndexOf(array, element) {\n let isSorted = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n if (isSorted) {\n return this.binarySearch(array, element, Buffer.compare);\n }\n const eqChecker = (buffer1, buffer2) => buffer1.equals(buffer2);\n return this.linearSearch(array, element, eqChecker);\n }\n\n /**\n * binarySearch\n * @desc Returns the first index of which given item is found in array using binary search.\n * @param {Buffer[]} array - Array of items.\n * @param {Buffer} element - Item to find.\n * @param {Function} compareFunction\n * @return {Number} - Index number\n *\n * @example\n * ```js\n *const index = MerkleTree.binarySearch(array, element, Buffer.compare)\n *```\n */\n static binarySearch(array, element, compareFunction) {\n let start = 0;\n let end = array.length - 1;\n\n // Iterate while start not meets end\n while (start <= end) {\n // Find the mid index\n const mid = Math.floor((start + end) / 2);\n\n // Check if the mid value is greater than, equal to, or less than search element.\n const ordering = compareFunction(array[mid], element);\n\n // If element is present at mid, start iterating for searching first appearance.\n if (ordering === 0) {\n // Linear reverse iteration until the first matching item index is found.\n for (let i = mid - 1; i >= 0; i--) {\n if (compareFunction(array[i], element) === 0) {\n continue;\n }\n return i + 1;\n }\n return 0;\n } /* Else look in left or right half accordingly */else if (ordering < 0) {\n start = mid + 1;\n } else {\n end = mid - 1;\n }\n }\n return -1;\n }\n\n /**\n * binarySearch\n * @desc Returns the first index of which given item is found in array using binary search.\n * @param {Buffer[]} array - Array of items.\n * @param {Buffer} element - Item to find.\n * @param {Function} compareFunction\n * @return {Number} - Index number\n *\n * @example\n * ```js\n *const index = tree.binarySearch(array, element, Buffer.compare)\n *```\n */\n binarySearch(array, element, compareFunction) {\n return Base.binarySearch(array, element, compareFunction);\n }\n\n /**\n * linearSearch\n * @desc Returns the first index of which given item is found in array using linear search.\n * @param {Buffer[]} array - Array of items.\n * @param {Buffer} element - Item to find.\n * @param {Function} eqChecker\n * @return {Number} - Index number\n *\n * @example\n * ```js\n *const index = MerkleTree.linearSearch(array, element, (a, b) => a === b)\n *```\n */\n static linearSearch(array, element, eqChecker) {\n for (let i = 0; i < array.length; i++) {\n if (eqChecker(array[i], element)) {\n return i;\n }\n }\n return -1;\n }\n\n /**\n * linearSearch\n * @desc Returns the first index of which given item is found in array using linear search.\n * @param {Buffer[]} array - Array of items.\n * @param {Buffer} element - Item to find.\n * @param {Function} eqChecker\n * @return {Number} - Index number\n *\n * @example\n * ```js\n *const index = tree.linearSearch(array, element, (a, b) => a === b)\n *```\n */\n linearSearch(array, element, eqChecker) {\n return Base.linearSearch(array, element, eqChecker);\n }\n\n /**\n * bufferify\n * @desc Returns a buffer type for the given value.\n * @param {String|Number|Object|Buffer|ArrayBuffer} value\n * @return {Buffer}\n *\n * @example\n * ```js\n *const buf = MerkleTree.bufferify('0x1234')\n *```\n */\n static bufferify(value) {\n if (!Buffer.isBuffer(value)) {\n // crypto-js support\n if (typeof value === \"object\" && value.words) {\n return Buffer.from(value.toString(convertWordsToBuffer), \"hex\");\n } else if (Base.isHexString(value)) {\n return Buffer.from(value.replace(/^0x/, \"\"), \"hex\");\n } else if (typeof value === \"string\") {\n return Buffer.from(value);\n } else if (typeof value === \"bigint\") {\n return Buffer.from(value.toString(16), \"hex\");\n } else if (value instanceof Uint8Array) {\n return Buffer.from(value.buffer);\n } else if (typeof value === \"number\") {\n let s = value.toString();\n if (s.length % 2) {\n s = `0${s}`;\n }\n return Buffer.from(s, \"hex\");\n } else if (ArrayBuffer.isView(value)) {\n return Buffer.from(value.buffer, value.byteOffset, value.byteLength);\n }\n }\n return value;\n }\n bigNumberify(value) {\n return Base.bigNumberify(value);\n }\n static bigNumberify(value) {\n if (typeof value === \"bigint\") {\n return value;\n }\n if (typeof value === \"string\") {\n if (value.startsWith(\"0x\") && Base.isHexString(value)) {\n return BigInt(\"0x\" + value.replace(\"0x\", \"\").toString());\n }\n return BigInt(value);\n }\n if (Buffer.isBuffer(value)) {\n return BigInt(\"0x\" + value.toString(\"hex\"));\n }\n if (value instanceof Uint8Array) {\n return uint8ArrayToBigInt(value);\n }\n if (typeof value === \"number\") {\n return BigInt(value);\n }\n throw new Error(\"cannot bigNumberify\");\n }\n\n /**\n * isHexString\n * @desc Returns true if value is a hex string.\n * @param {String} value\n * @return {Boolean}\n *\n * @example\n * ```js\n *console.log(MerkleTree.isHexString('0x1234'))\n *```\n */\n static isHexString(v) {\n return typeof v === \"string\" && /^(0x)?[0-9A-Fa-f]*$/.test(v);\n }\n\n /**\n * print\n * @desc Prints out a visual representation of the given merkle tree.\n * @param {Object} tree - Merkle tree instance.\n * @return {String}\n * @example\n *```js\n *MerkleTree.print(tree)\n *```\n */\n static print(tree) {\n console.log(tree.toString());\n }\n\n /**\n * bufferToHex\n * @desc Returns a hex string with 0x prefix for given buffer.\n * @param {Buffer} value\n * @return {String}\n * @example\n *```js\n *const hexStr = tree.bufferToHex(Buffer.from('A'))\n *```\n */\n bufferToHex(value) {\n let withPrefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n return Base.bufferToHex(value, withPrefix);\n }\n\n /**\n * bufferToHex\n * @desc Returns a hex string with 0x prefix for given buffer.\n * @param {Buffer} value\n * @return {String}\n * @example\n *```js\n *const hexStr = MerkleTree.bufferToHex(Buffer.from('A'))\n *```\n */\n static bufferToHex(value) {\n let withPrefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n return `${withPrefix ? \"0x\" : \"\"}${(value || Buffer.alloc(0)).toString(\"hex\")}`;\n }\n\n /**\n * bufferify\n * @desc Returns a buffer type for the given value.\n * @param {String|Number|Object|Buffer} value\n * @return {Buffer}\n *\n * @example\n * ```js\n *const buf = tree.bufferify('0x1234')\n *```\n */\n bufferify(value) {\n return Base.bufferify(value);\n }\n\n /**\n * bufferifyFn\n * @desc Returns a function that will bufferify the return value.\n * @param {Function}\n * @return {Function}\n *\n * @example\n * ```js\n *const fn = tree.bufferifyFn((value) => sha256(value))\n *```\n */\n bufferifyFn(f) {\n return value => {\n const v = f(value);\n if (Buffer.isBuffer(v)) {\n return v;\n }\n if (this.isHexString(v)) {\n return Buffer.from(v.replace(\"0x\", \"\"), \"hex\");\n }\n if (typeof v === \"string\") {\n return Buffer.from(v);\n }\n if (typeof v === \"bigint\") {\n return Buffer.from(value.toString(16), \"hex\");\n }\n if (ArrayBuffer.isView(v)) {\n return Buffer.from(v.buffer, v.byteOffset, v.byteLength);\n }\n\n // crypto-js support\n const arrayBuffer = hexStringToArrayBuffer(value.toString(\"hex\"));\n // Assuming f now works with ArrayBuffers\n const processedBuffer = f(arrayBuffer);\n const hexResult = arrayBufferToHexString(processedBuffer);\n return Buffer.from(hexResult, \"hex\");\n };\n }\n\n /**\n * isHexString\n * @desc Returns true if value is a hex string.\n * @param {String} value\n * @return {Boolean}\n *\n * @example\n * ```js\n *console.log(MerkleTree.isHexString('0x1234'))\n *```\n */\n isHexString(value) {\n return Base.isHexString(value);\n }\n\n /**\n * log2\n * @desc Returns the log2 of number.\n * @param {Number} value\n * @return {Number}\n */\n log2(n) {\n return n === 1 ? 0 : 1 + this.log2(n / 2 | 0);\n }\n\n /**\n * zip\n * @desc Returns true if value is a hex string.\n * @param {String[]|Number[]|Buffer[]} a - first array\n * @param {String[]|Number[]|Buffer[]} b - second array\n * @return {String[][]|Number[][]|Buffer[][]}\n *\n * @example\n * ```js\n *const zipped = tree.zip(['a', 'b'],['A', 'B'])\n *console.log(zipped) // [ [ 'a', 'A' ], [ 'b', 'B' ] ]\n *```\n */\n zip(a, b) {\n return a.map((e, i) => [e, b[i]]);\n }\n static hexZeroPad(hexStr, length) {\n return \"0x\" + hexStr.replace(\"0x\", \"\").padStart(length, \"0\");\n }\n}\nvar Base$1 = Base;\n\n// UTILS\n\n// replaces CryptoJS.enc.Hex\nfunction convertWordsToBuffer(value) {\n const wordArray = value.words;\n const arrayBuffer = new ArrayBuffer(wordArray.length * 4); // 4 bytes per word\n const uint8View = new Uint8Array(arrayBuffer);\n for (let i = 0; i < wordArray.length; i++) {\n uint8View[i * 4] = wordArray[i] >> 24 & 0xff;\n uint8View[i * 4 + 1] = wordArray[i] >> 16 & 0xff;\n uint8View[i * 4 + 2] = wordArray[i] >> 8 & 0xff;\n uint8View[i * 4 + 3] = wordArray[i] & 0xff;\n }\n return arrayBuffer;\n}\nfunction hexStringToArrayBuffer(hexString) {\n const buffer = new Uint8Array(hexString.length / 2);\n for (let i = 0; i < hexString.length; i += 2) {\n buffer[i / 2] = parseInt(hexString.substring(i, i + 2), 16);\n }\n return buffer.buffer;\n}\nfunction arrayBufferToHexString(arrayBuffer) {\n const uint8View = new Uint8Array(arrayBuffer);\n return Array.from(uint8View).map(byte => byte.toString(16).padStart(2, \"0\")).join(\"\");\n}\nfunction uint8ArrayToBigInt(u8a) {\n const hex = Array.from(u8a).map(byte => byte.toString(16).padStart(2, \"0\")).join(\"\");\n return BigInt(`0x${hex}`);\n}\n\n// ADAPTED FROM https://github.com/merkletreejs/merkletreejs\n\n// TODO: Clean up and DRY up code\n// Disclaimer: The multiproof code is unaudited and may possibly contain serious issues. It's in a hacky state as is and needs to be rewritten.\n\n/**\n * Class reprensenting a Merkle Tree\n * @namespace MerkleTree\n */\nclass MerkleTree extends Base$1 {\n duplicateOdd = false;\n concatenator = Buffer.concat;\n hashLeaves = false;\n isBitcoinTree = false;\n leaves = [];\n layers = [];\n sortLeaves = false;\n sortPairs = false;\n sort = false;\n fillDefaultHash = null;\n complete = false;\n\n /**\n * @desc Constructs a Merkle Tree.\n * All nodes and leaves are stored as Buffers.\n * Lonely leaf nodes are promoted to the next level up without being hashed again.\n * @param {Buffer[]} leaves - Array of hashed leaves. Each leaf must be a Buffer.\n * @param {Function} hashFunction - Hash function to use for hashing leaves and nodes\n * @param {Object} options - Additional options\n * @example\n *```js\n *const MerkleTree = require('merkletreejs')\n *const crypto = require('crypto')\n *\n *function sha256(data) {\n * // returns Buffer\n * return crypto.createHash('sha256').update(data).digest()\n *}\n *\n *const leaves = ['a', 'b', 'c'].map(value => keccak(value))\n *\n *const tree = new MerkleTree(leaves, sha256)\n *```\n */\n constructor(leaves, hashFn) {\n let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n super();\n if (options.complete) {\n if (options.isBitcoinTree) {\n throw new Error('option \"complete\" is incompatible with \"isBitcoinTree\"');\n }\n if (options.duplicateOdd) {\n throw new Error('option \"complete\" is incompatible with \"duplicateOdd\"');\n }\n }\n this.isBitcoinTree = !!options.isBitcoinTree;\n this.hashLeaves = !!options.hashLeaves;\n this.sortLeaves = !!options.sortLeaves;\n this.sortPairs = !!options.sortPairs;\n this.complete = !!options.complete;\n if (options.fillDefaultHash) {\n if (typeof options.fillDefaultHash === \"function\") {\n this.fillDefaultHash = options.fillDefaultHash;\n } else if (Buffer.isBuffer(options.fillDefaultHash) || typeof options.fillDefaultHash === \"string\") {\n this.fillDefaultHash = (idx, hashFn) => options.fillDefaultHash;\n } else {\n throw new Error('method \"fillDefaultHash\" must be a function, Buffer, or string');\n }\n }\n this.sort = !!options.sort;\n if (this.sort) {\n this.sortLeaves = true;\n this.sortPairs = true;\n }\n this.duplicateOdd = !!options.duplicateOdd;\n if (options.concatenator) {\n this.concatenator = options.concatenator;\n }\n this.hashFn = this.bufferifyFn(hashFn);\n this.processLeaves(leaves);\n }\n getOptions() {\n return {\n complete: this.complete,\n isBitcoinTree: this.isBitcoinTree,\n hashLeaves: this.hashLeaves,\n sortLeaves: this.sortLeaves,\n sortPairs: this.sortPairs,\n sort: this.sort,\n fillDefaultHash: this.fillDefaultHash?.toString() ?? null,\n duplicateOdd: this.duplicateOdd\n };\n }\n processLeaves(leaves) {\n if (this.hashLeaves) {\n leaves = leaves.map(this.hashFn);\n }\n this.leaves = leaves.map(this.bufferify);\n if (this.sortLeaves) {\n this.leaves = this.leaves.sort(Buffer.compare);\n }\n if (this.fillDefaultHash) {\n for (let i = this.leaves.length; i < Math.pow(2, Math.ceil(Math.log2(this.leaves.length))); i++) {\n this.leaves.push(this.bufferify(this.fillDefaultHash(i, this.hashFn)));\n }\n }\n this.createHashes(this.leaves);\n }\n createHashes(nodes) {\n this.layers = [nodes];\n while (nodes.length > 1) {\n const layerIndex = this.layers.length;\n this.layers.push([]);\n const layerLimit = this.complete && layerIndex === 1 && !Number.isInteger(Math.log2(nodes.length)) ? 2 * nodes.length - 2 ** Math.ceil(Math.log2(nodes.length)) : nodes.length;\n for (let i = 0; i < nodes.length; i += 2) {\n if (i >= layerLimit) {\n this.layers[layerIndex].push(...nodes.slice(layerLimit));\n break;\n } else if (i + 1 === nodes.length) {\n if (nodes.length % 2 === 1) {\n const data = nodes[nodes.length - 1];\n let hash = data;\n\n // is bitcoin tree\n if (this.isBitcoinTree) {\n // Bitcoin method of duplicating the odd ending nodes\n hash = this.hashFn(this.concatenator([reverse(data), reverse(data)]));\n hash = reverse(this.hashFn(hash));\n this.layers[layerIndex].push(hash);\n continue;\n } else {\n if (this.duplicateOdd) ; else {\n // push copy of hash and continue iteration\n this.layers[layerIndex].push(nodes[i]);\n continue;\n }\n }\n }\n }\n const left = nodes[i];\n const right = i + 1 === nodes.length ? left : nodes[i + 1];\n let combined = null;\n if (this.isBitcoinTree) {\n combined = [reverse(left), reverse(right)];\n } else {\n combined = [left, right];\n }\n if (this.sortPairs) {\n combined.sort(Buffer.compare);\n }\n let hash = this.hashFn(this.concatenator(combined));\n\n // double hash if bitcoin tree\n if (this.isBitcoinTree) {\n hash = reverse(this.hashFn(hash));\n }\n this.layers[layerIndex].push(hash);\n }\n nodes = this.layers[layerIndex];\n }\n }\n\n /**\n * addLeaf\n * @desc Adds a leaf to the tree and re-calculates layers.\n * @param {String|Buffer} - Leaf\n * @param {Boolean} - Set to true if the leaf should be hashed before being added to tree.\n * @example\n *```js\n *tree.addLeaf(newLeaf)\n *```\n */\n addLeaf(leaf) {\n let shouldHash = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n if (shouldHash) {\n leaf = this.hashFn(leaf);\n }\n this.processLeaves(this.leaves.concat(leaf));\n }\n\n /**\n * addLeaves\n * @desc Adds multiple leaves to the tree and re-calculates layers.\n * @param {String[]|Buffer[]} - Array of leaves\n * @param {Boolean} - Set to true if the leaves should be hashed before being added to tree.\n * @example\n *```js\n *tree.addLeaves(newLeaves)\n *```\n */\n addLeaves(leaves) {\n let shouldHash = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n if (shouldHash) {\n leaves = leaves.map(this.hashFn);\n }\n this.processLeaves(this.leaves.concat(leaves));\n }\n\n /**\n * getLeaves\n * @desc Returns array of leaves of Merkle Tree.\n * @return {Buffer[]}\n * @example\n *```js\n *const leaves = tree.getLeaves()\n *```\n */\n getLeaves(values) {\n if (Array.isArray(values)) {\n if (this.hashLeaves) {\n values = values.map(this.hashFn);\n if (this.sortLeaves) {\n values = values.sort(Buffer.compare);\n }\n }\n return this.leaves.filter(\n // @ts-expect-error - issue from original code\n leaf => this.bufferIndexOf(values, leaf, this.sortLeaves) !== -1);\n }\n return this.leaves;\n }\n\n /**\n * getLeaf\n * @desc Returns the leaf at the given index.\n * @param {Number} - Index number\n * @return {Buffer}\n * @example\n *```js\n *const leaf = tree.getLeaf(1)\n *```\n */\n getLeaf(index) {\n if (index < 0 || index > this.leaves.length - 1) {\n return Buffer.from([]);\n }\n return this.leaves[index];\n }\n\n /**\n * getLeafIndex\n * @desc Returns the index of the given leaf, or -1 if the leaf is not found.\n * @param {String|Buffer} - Target leaf\n * @return {number}\n * @example\n *```js\n *const leaf = Buffer.from('abc')\n *const index = tree.getLeafIndex(leaf)\n *```\n */\n getLeafIndex(target) {\n target = this.bufferify(target);\n const leaves = this.getLeaves();\n for (let i = 0; i < leaves.length; i++) {\n const leaf = leaves[i];\n if (leaf.equals(target)) {\n return i;\n }\n }\n return -1;\n }\n\n /**\n * getLeafCount\n * @desc Returns the total number of leaves.\n * @return {number}\n * @example\n *```js\n *const count = tree.getLeafCount()\n *```\n */\n getLeafCount() {\n return this.leaves.length;\n }\n\n /**\n * getHexLeaves\n * @desc Returns array of leaves of Merkle Tree as hex strings.\n * @return {String[]}\n * @example\n *```js\n *const leaves = tree.getHexLeaves()\n *```\n */\n getHexLeaves() {\n return this.leaves.map(leaf => this.bufferToHex(leaf));\n }\n\n /**\n * marshalLeaves\n * @desc Returns array of leaves of Merkle Tree as a JSON string.\n * @param {String[]|Buffer[]} - Merkle tree leaves\n * @return {String} - List of leaves as JSON string\n * @example\n *```js\n *const jsonStr = MerkleTree.marshalLeaves(leaves)\n *```\n */\n static marshalLeaves(leaves) {\n return JSON.stringify(leaves.map(leaf => MerkleTree.bufferToHex(leaf)), null, 2);\n }\n\n /**\n * unmarshalLeaves\n * @desc Returns array of leaves of Merkle Tree as a Buffers.\n * @param {String|Object} - JSON stringified leaves\n * @return {Buffer[]} - Unmarshalled list of leaves\n * @example\n *```js\n *const leaves = MerkleTree.unmarshalLeaves(jsonStr)\n *```\n */\n static unmarshalLeaves(jsonStr) {\n let parsed = null;\n if (typeof jsonStr === \"string\") {\n parsed = JSON.parse(jsonStr);\n } else if (jsonStr instanceof Object) {\n parsed = jsonStr;\n } else {\n throw new Error(\"Expected type of string or object\");\n }\n if (!parsed) {\n return [];\n }\n if (!Array.isArray(parsed)) {\n throw new Error(\"Expected JSON string to be array\");\n }\n return parsed.map(MerkleTree.bufferify);\n }\n\n /**\n * getLayers\n * @desc Returns multi-dimensional array of all layers of Merkle Tree, including leaves and root.\n * @return {Buffer[][]}\n * @example\n *```js\n *const layers = tree.getLayers()\n *```\n */\n getLayers() {\n return this.layers;\n }\n\n /**\n * getHexLayers\n * @desc Returns multi-dimensional array of all layers of Merkle Tree, including leaves and root as hex strings.\n * @return {String[][]}\n * @example\n *```js\n *const layers = tree.getHexLayers()\n *```\n */\n getHexLayers() {\n return this.layers.reduce((acc, item) => {\n if (Array.isArray(item)) {\n acc.push(item.map(layer => this.bufferToHex(layer)));\n } else {\n acc.push(item);\n }\n return acc;\n }, []);\n }\n\n /**\n * getLayersFlat\n * @desc Returns single flat array of all layers of Merkle Tree, including leaves and root.\n * @return {Buffer[]}\n * @example\n *```js\n *const layers = tree.getLayersFlat()\n *```\n */\n getLayersFlat() {\n const layers = this.layers.reduce((acc, item) => {\n if (Array.isArray(item)) {\n acc.unshift(...item);\n } else {\n acc.unshift(item);\n }\n return acc;\n }, []);\n layers.unshift(Buffer.from([0]));\n return layers;\n }\n\n /**\n * getHexLayersFlat\n * @desc Returns single flat array of all layers of Merkle Tree, including leaves and root as hex string.\n * @return {String[]}\n * @example\n *```js\n *const layers = tree.getHexLayersFlat()\n *```\n */\n getHexLayersFlat() {\n return this.getLayersFlat().map(layer => this.bufferToHex(layer));\n }\n\n /**\n * getLayerCount\n * @desc Returns the total number of layers.\n * @return {number}\n * @example\n *```js\n *const count = tree.getLayerCount()\n *```\n */\n getLayerCount() {\n return this.getLayers().length;\n }\n\n /**\n * getRoot\n * @desc Returns the Merkle root hash as a Buffer.\n * @return {Buffer}\n * @example\n *```js\n *const root = tree.getRoot()\n *```\n */\n getRoot() {\n if (this.layers.length === 0) {\n return Buffer.from([]);\n }\n return this.layers[this.layers.length - 1][0] || Buffer.from([]);\n }\n\n /**\n * getHexRoot\n * @desc Returns the Merkle root hash as a hex string.\n * @return {String}\n * @example\n *```js\n *const root = tree.getHexRoot()\n *```\n */\n getHexRoot() {\n return this.bufferToHex(this.getRoot());\n }\n\n /**\n * getProof\n * @desc Returns the proof for a target leaf.\n * @param {Buffer} leaf - Target leaf\n * @param {Number} [index] - Target leaf index in leaves array.\n * Use if there are leaves containing duplicate data in order to distinguish it.\n * @return {Object[]} - Array of objects containing a position property of type string\n * with values of 'left' or 'right' and a data property of type Buffer.\n * @example\n * ```js\n *const proof = tree.getProof(leaves[2])\n *```\n *\n * @example\n *```js\n *const leaves = ['a', 'b', 'a'].map(value => keccak(value))\n *const tree = new MerkleTree(leaves, keccak)\n *const proof = tree.getProof(leaves[2], 2)\n *```\n */\n getProof(leaf, index) {\n if (typeof leaf === \"undefined\") {\n throw new Error(\"leaf is required\");\n }\n leaf = this.bufferify(leaf);\n const proof = [];\n if (!Number.isInteger(index)) {\n index = -1;\n for (let i = 0; i < this.leaves.length; i++) {\n if (Buffer.compare(leaf, this.leaves[i]) === 0) {\n index = i;\n }\n }\n }\n\n // @ts-expect-error - issue from original code\n if (index <= -1) {\n return [];\n }\n for (let i = 0; i < this.layers.length; i++) {\n const layer = this.layers[i];\n // @ts-expect-error - issue from original code\n const isRightNode = index % 2;\n const pairIndex = isRightNode ?\n // @ts-expect-error - issue from original code\n index - 1 : this.isBitcoinTree && index === layer.length - 1 && i < this.layers.length - 1 ?\n // Proof Generation for Bitcoin Trees\n index :\n // Proof Generation for Non-Bitcoin Trees\n // @ts-expect-error - issue from original code\n index + 1;\n if (pairIndex < layer.length) {\n proof.push({\n position: isRightNode ? \"left\" : \"right\",\n data: layer[pairIndex]\n });\n }\n\n // set index to parent index\n // @ts-expect-error - issue from original code\n index = index / 2 | 0;\n }\n\n // @ts-expect-error - issue from original code\n return proof;\n }\n\n /**\n * getHexProof\n * @desc Returns the proof for a target leaf as hex strings.\n * @param {Buffer} leaf - Target leaf\n * @param {Number} [index] - Target leaf index in leaves array.\n * Use if there are leaves containing duplicate data in order to distinguish it.\n * @return {String[]} - Proof array as hex strings.\n * @example\n * ```js\n *const proof = tree.getHexProof(leaves[2])\n *```\n */\n getHexProof(leaf, index) {\n return this.getProof(leaf, index).map(item => this.bufferToHex(item.data));\n }\n\n /**\n * getProofs\n * @desc Returns the proofs for all leaves.\n * @return {Object[]} - Array of objects containing a position property of type string\n * with values of 'left' or 'right' and a data property of type Buffer for all leaves.\n * @example\n * ```js\n *const proofs = tree.getProofs()\n *```\n *\n * @example\n *```js\n *const leaves = ['a', 'b', 'a'].map(value => keccak(value))\n *const tree = new MerkleTree(leaves, keccak)\n *const proofs = tree.getProofs()\n *```\n */\n getProofs() {\n // @ts-expect-error - issue from original code\n const proof = [];\n // @ts-expect-error - issue from original code\n const proofs = [];\n\n // @ts-expect-error - issue from original code\n this.getProofsDFS(this.layers.length - 1, 0, proof, proofs);\n\n // @ts-expect-error - issue from original code\n return proofs;\n }\n\n /**\n * getProofsDFS\n * @desc Get all proofs through single traverse\n * @param {Number} currentLayer - Current layer index in traverse.\n * @param {Number} index - Current tarvese node index in traverse.\n * @param {Object[]} proof - Proof chain for single leaf.\n * @param {Object[]} proofs - Proofs for all leaves\n * @example\n * ```js\n *const layers = tree.getLayers()\n *const index = 0;\n *let proof = [];\n *let proofs = [];\n *const proof = tree.getProofsDFS(layers, index, proof, proofs)\n *```\n */\n // @ts-expect-error - issue from original code\n getProofsDFS(currentLayer, index, proof, proofs) {\n const isRightNode = index % 2;\n if (currentLayer === -1) {\n if (!isRightNode) {\n proofs.push([...proof].reverse());\n }\n // @ts-expect-error - issue from original code\n return;\n }\n if (index >= this.layers[currentLayer].length) {\n // @ts-expect-error - issue from original code\n return;\n }\n const layer = this.layers[currentLayer];\n const pairIndex = isRightNode ? index - 1 : index + 1;\n let pushed = false;\n if (pairIndex < layer.length) {\n pushed = true;\n proof.push({\n position: isRightNode ? \"left\" : \"right\",\n data: layer[pairIndex]\n });\n }\n const leftchildIndex = index * 2;\n const rightchildIndex = index * 2 + 1;\n this.getProofsDFS(currentLayer - 1, leftchildIndex, proof, proofs);\n this.getProofsDFS(currentLayer - 1, rightchildIndex, proof, proofs);\n if (pushed) {\n proof.splice(proof.length - 1, 1);\n }\n }\n\n /**\n * getHexProofs\n * @desc Returns the proofs for all leaves as hex strings.\n * @return {String[]} - Proofs array as hex strings.\n * @example\n * ```js\n *const proofs = tree.getHexProofs()\n *```\n */\n getHexProofs() {\n return this.getProofs().map(item => this.bufferToHex(item.data));\n }\n\n /**\n * getPositionalHexProof\n * @desc Returns the proof for a target leaf as hex strings and the position in binary (left == 0).\n * @param {Buffer} leaf - Target leaf\n * @param {Number} [index] - Target leaf index in leaves array.\n * Use if there are leaves containing duplicate data in order to distinguish it.\n * @return {(string | number)[][]} - Proof array as hex strings. position at index 0\n * @example\n * ```js\n *const proof = tree.getPositionalHexProof(leaves[2])\n *```\n */\n getPositionalHexProof(leaf, index) {\n return this.getProof(leaf, index).map(item => {\n return [item.position === \"left\" ? 0 : 1, this.bufferToHex(item.data)];\n });\n }\n\n /**\n * getProofIndices\n * @desc Returns the proof indices for given tree indices.\n * @param {Number[]} treeIndices - Tree indices\n * @param {Number} depth - Tree depth; number of layers.\n * @return {Number[]} - Proof indices\n * @example\n * ```js\n *const proofIndices = tree.getProofIndices([2,5,6], 4)\n *console.log(proofIndices) // [ 23, 20, 19, 8, 3 ]\n *```\n */\n getProofIndices(treeIndices, depth) {\n const leafCount = 2 ** depth;\n let maximalIndices = new Set();\n for (const index of treeIndices) {\n let x = leafCount + index;\n while (x > 1) {\n maximalIndices.add(x ^ 1);\n x = x / 2 | 0;\n }\n }\n const a = treeIndices.map(index => leafCount + index);\n const b = Array.from(maximalIndices).sort((x, y) => x - y).reverse();\n maximalIndices = a.concat(b);\n const redundantIndices = new Set();\n const proof = [];\n for (let index of maximalIndices) {\n if (!redundantIndices.has(index)) {\n proof.push(index);\n while (index > 1) {\n redundantIndices.add(index);\n if (!redundantIndices.has(index ^ 1)) {\n break;\n }\n index = index / 2 | 0;\n }\n }\n }\n return proof.filter(index => {\n return !treeIndices.includes(index - leafCount);\n });\n }\n getProofIndicesForUnevenTree(sortedLeafIndices, leavesCount) {\n const depth = Math.ceil(Math.log2(leavesCount));\n const unevenLayers = [];\n for (let index = 0; index < depth; index++) {\n const unevenLayer = leavesCount % 2 !== 0;\n if (unevenLayer) {\n unevenLayers.push({\n index,\n leavesCount\n });\n }\n leavesCount = Math.ceil(leavesCount / 2);\n }\n const proofIndices = [];\n let layerNodes = sortedLeafIndices;\n for (let layerIndex = 0; layerIndex < depth; layerIndex++) {\n const siblingIndices = layerNodes.map(index => {\n if (index % 2 === 0) {\n return index + 1;\n }\n return index - 1;\n });\n let proofNodeIndices = siblingIndices.filter(index => !layerNodes.includes(index));\n const unevenLayer = unevenLayers.find(_ref => {\n let {\n index\n } = _ref;\n return index === layerIndex;\n });\n if (unevenLayer && layerNodes.includes(unevenLayer.leavesCount - 1)) {\n proofNodeIndices = proofNodeIndices.slice(0, -1);\n }\n proofIndices.push(proofNodeIndices);\n layerNodes = [...new Set(layerNodes.map(index => {\n if (index % 2 === 0) {\n return index / 2;\n }\n if (index % 2 === 0) {\n return (index + 1) / 2;\n }\n return (index - 1) / 2;\n }))];\n }\n return proofIndices;\n }\n\n /**\n * getMultiProof\n * @desc Returns the multiproof for given tree indices.\n * @param {Number[]} indices - Tree indices.\n * @return {Buffer[]} - Multiproofs\n * @example\n * ```js\n *const indices = [2, 5, 6]\n *const proof = tree.getMultiProof(indices)\n *```\n */\n getMultiProof(tree, indices) {\n if (!this.complete) {\n console.warn(\"Warning: For correct multiProofs it's strongly recommended to set complete: true\");\n }\n if (!indices) {\n indices = tree;\n tree = this.getLayersFlat();\n }\n const isUneven = this.isUnevenTree();\n if (isUneven) {\n // @ts-expect-error - issue from original code\n if (indices.every(Number.isInteger)) {\n return this.getMultiProofForUnevenTree(indices);\n }\n }\n // @ts-expect-error - issue from original code\n if (!indices.every(Number.isInteger)) {\n let els = indices;\n if (this.sortPairs) {\n // @ts-expect-error - issue from original code\n els = els.sort(Buffer.compare);\n }\n\n // @ts-expect-error - issue from original code\n let ids = els.map(el => this.bufferIndexOf(this.leaves, el, this.sortLeaves)).sort((a, b) => a === b ? 0 : a > b ? 1 : -1);\n if (!ids.every(idx => idx !== -1)) {\n throw new Error(\"Element does not exist in Merkle tree\");\n }\n\n // @ts-expect-error - issue from original code\n const hashes = [];\n const proof = [];\n let nextIds = [];\n for (let i = 0; i < this.layers.length; i++) {\n const layer = this.layers[i];\n for (let j = 0; j < ids.length; j++) {\n const idx = ids[j];\n const pairElement = this.getPairNode(layer, idx);\n hashes.push(layer[idx]);\n if (pairElement) {\n proof.push(pairElement);\n }\n nextIds.push(idx / 2 | 0);\n }\n ids = nextIds.filter((value, j, self) => self.indexOf(value) === j);\n nextIds = [];\n }\n\n // @ts-expect-error - issue from original code\n return proof.filter(value => !hashes.includes(value));\n }\n\n // @ts-expect-error - issue from original code\n return this.getProofIndices(indices, Math.log2(tree.length / 2 | 0)).map(\n // @ts-expect-error - issue from original code\n index => tree[index]);\n }\n getMultiProofForUnevenTree(tree, indices) {\n if (!indices) {\n indices = tree;\n tree = this.getLayers();\n }\n let proofHashes = [];\n // @ts-expect-error - issue from original code\n let currentLayerIndices = indices;\n // @ts-expect-error - issue from original code\n for (const treeLayer of tree) {\n const siblings = [];\n for (const index of currentLayerIndices) {\n if (index % 2 === 0) {\n const idx = index + 1;\n if (!currentLayerIndices.includes(idx)) {\n if (treeLayer[idx]) {\n siblings.push(treeLayer[idx]);\n continue;\n }\n }\n }\n const idx = index - 1;\n if (!currentLayerIndices.includes(idx)) {\n if (treeLayer[idx]) {\n siblings.push(treeLayer[idx]);\n continue;\n }\n }\n }\n proofHashes = proofHashes.concat(siblings);\n const uniqueIndices = new Set();\n for (const index of currentLayerIndices) {\n if (index % 2 === 0) {\n uniqueIndices.add(index / 2);\n continue;\n }\n if (index % 2 === 0) {\n uniqueIndices.add((index + 1) / 2);\n continue;\n }\n uniqueIndices.add((index - 1) / 2);\n }\n currentLayerIndices = Array.from(uniqueIndices);\n }\n return proofHashes;\n }\n\n /**\n * getHexMultiProof\n * @desc Returns the multiproof for given tree indices as hex strings.\n * @param {Number[]} indices - Tree indices.\n * @return {String[]} - Multiproofs as hex strings.\n * @example\n * ```js\n *const indices = [2, 5, 6]\n *const proof = tree.getHexMultiProof(indices)\n *```\n */\n getHexMultiProof(tree, indices) {\n return this.getMultiProof(tree, indices).map(x => this.bufferToHex(x));\n }\n\n /**\n * getProofFlags\n * @desc Returns list of booleans where proofs should be used instead of hashing.\n * Proof flags are used in the Solidity multiproof verifiers.\n * @param {Number[]|Buffer[]} leaves\n * @param {Buffer[]} proofs\n * @return {Boolean[]} - Boolean flags\n * @example\n * ```js\n *const indices = [2, 5, 6]\n *const proof = tree.getMultiProof(indices)\n *const proofFlags = tree.getProofFlags(leaves, proof)\n *```\n */\n getProofFlags(leaves, proofs) {\n if (!Array.isArray(leaves) || leaves.length <= 0) {\n throw new Error(\"Invalid Inputs!\");\n }\n let ids;\n if (leaves.every(Number.isInteger)) {\n ids = [...leaves].sort((a, b) => a === b ? 0 : a > b ? 1 : -1); // Indices where passed\n } else {\n ids = leaves.map(el => this.bufferIndexOf(this.leaves, el, this.sortLeaves)).sort((a, b) => a === b ? 0 : a > b ? 1 : -1);\n }\n if (!ids.every(idx => idx !== -1)) {\n throw new Error(\"Element does not exist in Merkle tree\");\n }\n const _proofs = proofs.map(item => this.bufferify(item));\n\n // @ts-expect-error - issue from original code\n const tested = [];\n // @ts-expect-error - issue from original code\n const flags = [];\n for (let index = 0; index < this.layers.length; index++) {\n const layer = this.layers[index];\n ids = ids.reduce((ids_, idx) => {\n // @ts-expect-error - issue from original code\n const skipped = tested.includes(layer[idx]);\n if (!skipped) {\n const pairElement = this.getPairNode(layer, idx);\n const proofUsed = _proofs.includes(layer[idx]) || _proofs.includes(pairElement);\n // eslint-disable-next-line no-unused-expressions\n pairElement && flags.push(!proofUsed);\n tested.push(layer[idx]);\n tested.push(pairElement);\n }\n // @ts-expect-error - issue from original code\n ids_.push(idx / 2 | 0);\n return ids_;\n }, []);\n }\n\n // @ts-expect-error - issue from original code\n return flags;\n }\n\n /**\n * verify\n * @desc Returns true if the proof path (array of hashes) can connect the target node\n * to the Merkle root.\n * @param {Object[]} proof - Array of proof objects that should connect\n * target node to Merkle root.\n * @param {Buffer} targetNode - Target node Buffer\n * @param {Buffer} root - Merkle root Buffer\n * @return {Boolean}\n * @example\n *```js\n *const root = tree.getRoot()\n *const proof = tree.getProof(leaves[2])\n *const verified = tree.verify(proof, leaves[2], root)\n *```\n */\n verify(proof, targetNode, root) {\n let hash = this.bufferify(targetNode);\n root = this.bufferify(root);\n if (!Array.isArray(proof) || !targetNode || !root) {\n return false;\n }\n for (let i = 0; i < proof.length; i++) {\n const node = proof[i];\n let data = null;\n let isLeftNode = null;\n\n // case for when proof is hex values only\n if (typeof node === \"string\") {\n data = this.bufferify(node);\n isLeftNode = true;\n } else if (Array.isArray(node)) {\n isLeftNode = node[0] === 0;\n data = this.bufferify(node[1]);\n } else if (Buffer.isBuffer(node)) {\n data = node;\n isLeftNode = true;\n } else if (node instanceof Object) {\n data = this.bufferify(node.data);\n isLeftNode = node.position === \"left\";\n } else {\n throw new Error(\"Expected node to be of type string or object\");\n }\n const buffers = [];\n if (this.isBitcoinTree) {\n buffers.push(reverse(hash));\n buffers[isLeftNode ? \"unshift\" : \"push\"](reverse(data));\n hash = this.hashFn(this.concatenator(buffers));\n hash = reverse(this.hashFn(hash));\n } else {\n if (this.sortPairs) {\n if (Buffer.compare(hash, data) === -1) {\n buffers.push(hash, data);\n hash = this.hashFn(this.concatenator(buffers));\n } else {\n buffers.push(data, hash);\n hash = this.hashFn(this.concatenator(buffers));\n }\n } else {\n buffers.push(hash);\n buffers[isLeftNode ? \"unshift\" : \"push\"](data);\n hash = this.hashFn(this.concatenator(buffers));\n }\n }\n }\n return Buffer.compare(hash, root) === 0;\n }\n\n /**\n * verifyMultiProof\n * @desc Returns true if the multiproofs can connect the leaves to the Merkle root.\n * @param {Buffer} root - Merkle tree root\n * @param {Number[]} proofIndices - Leave indices for proof\n * @param {Buffer[]} proofLeaves - Leaf values at indices for proof\n * @param {Number} leavesCount - Count of original leaves\n * @param {Buffer[]} proof - Multiproofs given indices\n * @return {Boolean}\n * @example\n *```js\n *const leaves = tree.getLeaves()\n *const root = tree.getRoot()\n *const treeFlat = tree.getLayersFlat()\n *const leavesCount = leaves.length\n *const proofIndices = [2, 5, 6]\n *const proofLeaves = proofIndices.map(i => leaves[i])\n *const proof = tree.getMultiProof(treeFlat, indices)\n *const verified = tree.verifyMultiProof(root, proofIndices, proofLeaves, leavesCount, proof)\n *```\n */\n verifyMultiProof(root, proofIndices, proofLeaves, leavesCount, proof) {\n const isUneven = this.isUnevenTree();\n if (isUneven) {\n // TODO: combine these functions and simplify\n return this.verifyMultiProofForUnevenTree(root, proofIndices, proofLeaves, leavesCount, proof);\n }\n const depth = Math.ceil(Math.log2(leavesCount));\n root = this.bufferify(root);\n proofLeaves = proofLeaves.map(leaf => this.bufferify(leaf));\n proof = proof.map(leaf => this.bufferify(leaf));\n const tree = {};\n for (const [index, leaf] of this.zip(proofIndices, proofLeaves)) {\n // @ts-expect-error - issue from original code\n tree[2 ** depth + index] = leaf;\n }\n for (const [index, proofitem] of this.zip(this.getProofIndices(proofIndices, depth), proof)) {\n // @ts-expect-error - issue from original code\n tree[index] = proofitem;\n }\n let indexqueue = Object.keys(tree).map(value => Number(value)).sort((a, b) => a - b);\n indexqueue = indexqueue.slice(0, indexqueue.length - 1);\n let i = 0;\n while (i < indexqueue.length) {\n const index = indexqueue[i];\n if (index >= 2 && {}.hasOwnProperty.call(tree, index ^ 1)) {\n // @ts-expect-error - issue from original code\n let pair = [tree[index - index % 2], tree[index - index % 2 + 1]];\n if (this.sortPairs) {\n pair = pair.sort(Buffer.compare);\n }\n const hash = pair[1] ? this.hashFn(this.concatenator(pair)) : pair[0];\n // @ts-expect-error - issue from original code\n tree[index / 2 | 0] = hash;\n indexqueue.push(index / 2 | 0);\n }\n i += 1;\n }\n return !proofIndices.length ||\n // @ts-expect-error - issue from original code\n {}.hasOwnProperty.call(tree, 1) && tree[1].equals(root);\n }\n verifyMultiProofWithFlags(root, leaves, proofs, proofFlag) {\n root = this.bufferify(root);\n leaves = leaves.map(this.bufferify);\n proofs = proofs.map(this.bufferify);\n const leavesLen = leaves.length;\n const totalHashes = proofFlag.length;\n const hashes = [];\n let leafPos = 0;\n let hashPos = 0;\n let proofPos = 0;\n for (let i = 0; i < totalHashes; i++) {\n const bufA = proofFlag[i] ? leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++] : proofs[proofPos++];\n const bufB = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++];\n const buffers = [bufA, bufB].sort(Buffer.compare);\n hashes[i] = this.hashFn(this.concatenator(buffers));\n }\n return Buffer.compare(hashes[totalHashes - 1], root) === 0;\n }\n verifyMultiProofForUnevenTree(root, indices, leaves, leavesCount, proof) {\n root = this.bufferify(root);\n leaves = leaves.map(leaf => this.bufferify(leaf));\n proof = proof.map(leaf => this.bufferify(leaf));\n const computedRoot = this.calculateRootForUnevenTree(indices, leaves, leavesCount, proof);\n return root.equals(computedRoot);\n }\n\n /**\n * getDepth\n * @desc Returns the tree depth (number of layers)\n * @return {Number}\n * @example\n *```js\n *const depth = tree.getDepth()\n *```\n */\n getDepth() {\n return this.getLayers().length - 1;\n }\n\n /**\n * getLayersAsObject\n * @desc Returns the layers as nested objects instead of an array.\n * @example\n *```js\n *const layersObj = tree.getLayersAsObject()\n *```\n */\n getLayersAsObject() {\n const layers = this.getLayers().map(layer => layer.map(value => this.bufferToHex(value, false)));\n const objs = [];\n for (let i = 0; i < layers.length; i++) {\n const arr = [];\n for (let j = 0; j < layers[i].length; j++) {\n const obj = {\n [layers[i][j]]: null\n };\n if (objs.length) {\n // @ts-expect-error - issue from original code\n obj[layers[i][j]] = {};\n const a = objs.shift();\n // @ts-expect-error - issue from original code\n const akey = Object.keys(a)[0];\n // @ts-expect-error - issue from original code\n obj[layers[i][j]][akey] = a[akey];\n if (objs.length) {\n const b = objs.shift();\n // @ts-expect-error - issue from original code\n const bkey = Object.keys(b)[0];\n // @ts-expect-error - issue from original code\n obj[layers[i][j]][bkey] = b[bkey];\n }\n }\n arr.push(obj);\n }\n objs.push(...arr);\n }\n return objs[0];\n }\n\n /**\n * resetTree\n * @desc Resets the tree by clearing the leaves and layers.\n * @example\n *```js\n *tree.resetTree()\n *```\n */\n resetTree() {\n this.leaves = [];\n this.layers = [];\n }\n\n /**\n * getPairNode\n * @desc Returns the node at the index for given layer.\n * @param {Buffer[]} layer - Tree layer\n * @param {Number} index - Index at layer.\n * @return {Buffer} - Node\n *\n *@example\n * ```js\n *const node = tree.getPairNode(layer, index)\n *```\n */\n getPairNode(layer, idx) {\n const pairIdx = idx % 2 === 0 ? idx + 1 : idx - 1;\n if (pairIdx < layer.length) {\n return layer[pairIdx];\n } else {\n // @ts-expect-error - issue from original code\n return null;\n }\n }\n\n /**\n * toTreeString\n * @desc Returns a visual representation of the merkle tree as a string.\n * @return {String}\n * @example\n *```js\n *console.log(tree.toTreeString())\n *```\n */\n toTreeString() {\n const obj = this.getLayersAsObject();\n return asTree(obj, true, false);\n }\n\n /**\n * toString\n * @desc Returns a visual representation of the merkle tree as a string.\n * @example\n *```js\n *console.log(tree.toString())\n *```\n */\n toString() {\n return this.toTreeString();\n }\n isUnevenTree(treeLayers) {\n const depth = treeLayers?.length || this.getDepth();\n return !this.isPowOf2(depth);\n }\n isPowOf2(v) {\n return v && !(v & v - 1);\n }\n calculateRootForUnevenTree(leafIndices, leafHashes, totalLeavesCount, proofHashes) {\n const leafTuples = this.zip(leafIndices, leafHashes).sort((_ref2, _ref3) => {\n let [indexA] = _ref2;\n let [indexB] = _ref3;\n return indexA - indexB;\n });\n const leafTupleIndices = leafTuples.map(_ref4 => {\n let [index] = _ref4;\n return index;\n });\n const proofIndices = this.getProofIndicesForUnevenTree(leafTupleIndices, totalLeavesCount);\n let nextSliceStart = 0;\n const proofTuplesByLayers = [];\n for (let i = 0; i < proofIndices.length; i++) {\n const indices = proofIndices[i];\n const sliceStart = nextSliceStart;\n nextSliceStart += indices.length;\n proofTuplesByLayers[i] = this.zip(indices, proofHashes.slice(sliceStart, nextSliceStart));\n }\n const tree = [leafTuples];\n for (let layerIndex = 0; layerIndex < proofTuplesByLayers.length; layerIndex++) {\n const currentLayer = proofTuplesByLayers[layerIndex].concat(tree[layerIndex])\n // @ts-expect-error - issue from original code\n .sort((_ref5, _ref6) => {\n let [indexA] = _ref5;\n let [indexB] = _ref6;\n return indexA - indexB;\n })\n // @ts-expect-error - issue from original code\n .map(_ref7 => {\n let [, hash] = _ref7;\n return hash;\n });\n const s = tree[layerIndex].map(_ref8 => {\n let [layerIndex_] = _ref8;\n return layerIndex_;\n });\n const parentIndices = [...new Set(s.map(index => {\n if (index % 2 === 0) {\n return index / 2;\n }\n if (index % 2 === 0) {\n return (index + 1) / 2;\n }\n return (index - 1) / 2;\n }))];\n const parentLayer = [];\n for (let i = 0; i < parentIndices.length; i++) {\n const parentNodeTreeIndex = parentIndices[i];\n const bufA = currentLayer[i * 2];\n const bufB = currentLayer[i * 2 + 1];\n const hash = bufB ? this.hashFn(this.concatenator([bufA, bufB])) : bufA;\n parentLayer.push([parentNodeTreeIndex, hash]);\n }\n tree.push(parentLayer);\n }\n return tree[tree.length - 1][0][1];\n }\n}\n\nexport { MerkleTree };\n","import { constants, utils, BigNumber } from 'ethers';\nimport { bM as SnapshotInputSchema, bN as SnapshotEntryWithProofSchema, bO as SnapshotSchema, cs as ContractWrapper, b6 as BigNumberSchema, aW as NATIVE_TOKEN_ADDRESS, cw as AmountSchema, cA as QuantitySchema, b7 as BigNumberishSchema, cB as BytesLikeSchema, s as DuplicateLeafsError, ba as AddressOrEnsSchema, b9 as AddressSchema, cC as BasisPointsSchema } from './index-02e94cec.browser.esm.js';\nimport { f as fetchCurrencyMetadata, i as isNativeToken, a as fetchCurrencyValue } from './fetchCurrencyValue-a150f8dd.browser.esm.js';\nimport { n as normalizePriceValue } from './normalizePriceValue-74eeb144.browser.esm.js';\nimport { MerkleTree } from '@thirdweb-dev/merkletree';\nimport { S as StartDateSchema, E as EndDateSchema } from './assertEnabled-4605112f.browser.esm.js';\nimport { z } from 'zod';\nimport { N as NFTInputOrUriSchema } from './setErc20Allowance-e3ef471a.browser.esm.js';\nimport { v4 } from 'uuid';\n\nfunction abstractContractModelToLegacy(model) {\n return {\n startTimestamp: model.startTimestamp,\n maxClaimableSupply: model.maxClaimableSupply,\n supplyClaimed: model.supplyClaimed,\n merkleRoot: model.merkleRoot,\n pricePerToken: model.pricePerToken,\n currency: model.currency,\n quantityLimitPerTransaction: model.maxClaimablePerWallet,\n waitTimeInSecondsBetweenClaims: model.waitTimeInSecondsBetweenClaims || 0\n };\n}\n\nfunction abstractContractModelToNew(model) {\n return {\n startTimestamp: model.startTimestamp,\n maxClaimableSupply: model.maxClaimableSupply,\n supplyClaimed: model.supplyClaimed,\n merkleRoot: model.merkleRoot,\n pricePerToken: model.pricePerToken,\n currency: model.currency,\n quantityLimitPerWallet: model.maxClaimablePerWallet,\n metadata: model.metadata || \"\"\n };\n}\n\n/**\n * @internal\n * @param quantity - The quantity to convert\n * @param tokenDecimals - The token decimals to use\n */\nfunction convertQuantityToBigNumber(quantity, tokenDecimals) {\n if (quantity === \"unlimited\") {\n return constants.MaxUint256;\n } else {\n return utils.parseUnits(quantity, tokenDecimals);\n }\n}\n\nasync function parseSnapshotInputs(inputs) {\n const chunkSize = 25000;\n const chunks = Array.from({\n length: Math.ceil(inputs.length / chunkSize)\n }, (_, i) => inputs.slice(i * chunkSize, i * chunkSize + chunkSize));\n const results = [];\n const parsedChunks = await Promise.all(chunks.map(chunk => SnapshotInputSchema.parseAsync(chunk)));\n for (const chunk of parsedChunks) {\n results.push(...chunk);\n }\n return results;\n}\n\n// shard using the first 2 hex character of the address\n// this splits the merkle tree into 256 shards\n// shard files will be 00.json, 01.json, 02.json, ..., ff.json\nconst SHARD_NYBBLES = 2;\nlet SnapshotFormatVersion = /*#__PURE__*/function (SnapshotFormatVersion) {\n SnapshotFormatVersion[SnapshotFormatVersion[\"V1\"] = 1] = \"V1\";\n SnapshotFormatVersion[SnapshotFormatVersion[\"V2\"] = 2] = \"V2\";\n return SnapshotFormatVersion;\n}({}); // address, maxClaimable, price, currencyAddress\nclass ShardedMerkleTree {\n constructor(storage, baseUri, originalEntriesUri, shardNybbles, tokenDecimals) {\n this.storage = storage;\n this.shardNybbles = shardNybbles;\n this.baseUri = baseUri;\n this.originalEntriesUri = originalEntriesUri;\n this.tokenDecimals = tokenDecimals;\n this.shards = {};\n this.trees = {};\n }\n static async fromUri(uri, storage) {\n try {\n const shardedMerkleTreeInfo = await storage.downloadJSON(uri);\n if (shardedMerkleTreeInfo.isShardedMerkleTree) {\n return ShardedMerkleTree.fromShardedMerkleTreeInfo(shardedMerkleTreeInfo, storage);\n }\n } catch (e) {\n return undefined;\n }\n }\n static async fromShardedMerkleTreeInfo(info, storage) {\n return new ShardedMerkleTree(storage, info.baseUri, info.originalEntriesUri, info.shardNybbles, info.tokenDecimals);\n }\n static hashEntry(entry, tokenDecimals, currencyDecimals, snapshotFormatVersion) {\n switch (snapshotFormatVersion) {\n case SnapshotFormatVersion.V1:\n return utils.solidityKeccak256([\"address\", \"uint256\"], [entry.address, convertQuantityToBigNumber(entry.maxClaimable, tokenDecimals)]);\n case SnapshotFormatVersion.V2:\n return utils.solidityKeccak256([\"address\", \"uint256\", \"uint256\", \"address\"], [entry.address, convertQuantityToBigNumber(entry.maxClaimable, tokenDecimals), convertQuantityToBigNumber(entry.price || \"unlimited\", currencyDecimals), entry.currencyAddress || constants.AddressZero]);\n }\n }\n static async fetchAndCacheDecimals(cache, provider, currencyAddress) {\n if (!currencyAddress) {\n return 18;\n }\n // cache decimals for each currency to avoid refetching for every address\n let currencyDecimals = cache[currencyAddress];\n if (currencyDecimals === undefined) {\n const currencyMetadata = await fetchCurrencyMetadata(provider, currencyAddress);\n currencyDecimals = currencyMetadata.decimals;\n cache[currencyAddress] = currencyDecimals;\n }\n return currencyDecimals;\n }\n static async buildAndUpload(snapshotInput, tokenDecimals, provider, storage, snapshotFormatVersion) {\n let shardNybbles = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : SHARD_NYBBLES;\n const inputs = await parseSnapshotInputs(snapshotInput);\n\n // TODO Could also derive shardNybbles from input size\n const shards = {};\n for (const snapshotEntry of inputs) {\n const shard = snapshotEntry.address.slice(2, 2 + shardNybbles).toLowerCase();\n if (shards[shard] === undefined) {\n shards[shard] = [];\n }\n shards[shard].push(snapshotEntry);\n }\n const currencyDecimalMap = {};\n // create shard => subtree root map\n const subTrees = await Promise.all(Object.entries(shards).map(async _ref => {\n let [shard, entries] = _ref;\n return [shard, new MerkleTree(await Promise.all(entries.map(async entry => {\n // cache decimals for each currency to avoid refetching for every address\n const currencyDecimals = await ShardedMerkleTree.fetchAndCacheDecimals(currencyDecimalMap, provider, entry.currencyAddress);\n return ShardedMerkleTree.hashEntry(entry, tokenDecimals, currencyDecimals, snapshotFormatVersion);\n })), utils.keccak256, {\n sort: true\n }).getHexRoot()];\n }));\n const roots = Object.fromEntries(subTrees);\n // create master tree from shard => subtree root map\n const tree = new MerkleTree(Object.values(roots), utils.keccak256, {\n sort: true\n });\n const shardsToUpload = [];\n for (const [shardId, entries] of Object.entries(shards)) {\n const data = {\n proofs: tree.getProof(roots[shardId]).map(value => \"0x\" + value.data.toString(\"hex\")),\n entries\n };\n shardsToUpload.push({\n data: JSON.stringify(data),\n name: `${shardId}.json`\n });\n }\n const uris = await storage.uploadBatch(shardsToUpload);\n const baseUri = uris[0].slice(0, uris[0].lastIndexOf(\"/\"));\n const originalEntriesUri = await storage.upload(inputs);\n const shardedMerkleInfo = {\n merkleRoot: tree.getHexRoot(),\n baseUri,\n originalEntriesUri,\n shardNybbles,\n tokenDecimals,\n isShardedMerkleTree: true\n };\n const masterUri = await storage.upload(shardedMerkleInfo);\n return {\n shardedMerkleInfo,\n uri: masterUri\n };\n }\n async getProof(address, provider, snapshotFormatVersion) {\n const shardId = address.slice(2, 2 + this.shardNybbles).toLowerCase();\n let shard = this.shards[shardId];\n const currencyDecimalMap = {};\n if (shard === undefined) {\n try {\n const uri = this.baseUri.endsWith(\"/\") ? this.baseUri : `${this.baseUri}/`;\n shard = this.shards[shardId] = await this.storage.downloadJSON(`${uri}${shardId}.json`);\n const hashedEntries = await Promise.all(shard.entries.map(async entry => {\n // cache decimals for each currency to avoid refetching for every address\n const currencyDecimals = await ShardedMerkleTree.fetchAndCacheDecimals(currencyDecimalMap, provider, entry.currencyAddress);\n return ShardedMerkleTree.hashEntry(entry, this.tokenDecimals, currencyDecimals, snapshotFormatVersion);\n }));\n this.trees[shardId] = new MerkleTree(hashedEntries, utils.keccak256, {\n sort: true\n });\n } catch (e) {\n return null;\n }\n }\n const entry = shard.entries.find(i => i.address.toLowerCase() === address.toLowerCase());\n if (!entry) {\n return null;\n }\n const currencyDecimals = await ShardedMerkleTree.fetchAndCacheDecimals(currencyDecimalMap, provider, entry.currencyAddress);\n const leaf = ShardedMerkleTree.hashEntry(entry, this.tokenDecimals, currencyDecimals, snapshotFormatVersion);\n const proof = this.trees[shardId].getProof(leaf).map(i => \"0x\" + i.data.toString(\"hex\"));\n return SnapshotEntryWithProofSchema.parseAsync({\n ...entry,\n proof: proof.concat(shard.proofs)\n });\n }\n async getAllEntries() {\n try {\n return await this.storage.downloadJSON(this.originalEntriesUri);\n } catch (e) {\n console.warn(\"Could not fetch original snapshot entries\", e);\n return [];\n }\n }\n}\n\n/**\n * @internal\n */\nasync function fetchSnapshotEntryForAddress(address, merkleRoot, merkleMetadata, provider, storage, snapshotFormatVersion) {\n if (!merkleMetadata) {\n return null;\n }\n const snapshotUri = merkleMetadata[merkleRoot];\n if (snapshotUri) {\n const raw = await storage.downloadJSON(snapshotUri);\n if (raw.isShardedMerkleTree && raw.merkleRoot === merkleRoot) {\n const merkleTree = await ShardedMerkleTree.fromShardedMerkleTreeInfo(raw, storage);\n return await merkleTree.getProof(address, provider, snapshotFormatVersion);\n }\n // legacy non-sharded, just fetch it all and filter out\n const snapshotData = await SnapshotSchema.parseAsync(raw);\n if (merkleRoot === snapshotData.merkleRoot) {\n return snapshotData.claims.find(c => c.address.toLowerCase() === address.toLowerCase()) || null;\n }\n }\n return null;\n}\n\nfunction legacyContractModelToAbstract(model) {\n return {\n startTimestamp: model.startTimestamp,\n maxClaimableSupply: model.maxClaimableSupply,\n supplyClaimed: model.supplyClaimed,\n merkleRoot: model.merkleRoot.toString(),\n pricePerToken: model.pricePerToken,\n currency: model.currency,\n maxClaimablePerWallet: model.quantityLimitPerTransaction,\n waitTimeInSecondsBetweenClaims: model.waitTimeInSecondsBetweenClaims\n };\n}\n\nfunction newContractModelToAbstract(model) {\n return {\n startTimestamp: model.startTimestamp,\n maxClaimableSupply: model.maxClaimableSupply,\n supplyClaimed: model.supplyClaimed,\n merkleRoot: model.merkleRoot.toString(),\n pricePerToken: model.pricePerToken,\n currency: model.currency,\n maxClaimablePerWallet: model.quantityLimitPerWallet,\n waitTimeInSecondsBetweenClaims: 0,\n metadata: model.metadata\n };\n}\n\n/**\n * @internal\n */\nasync function approveErc20Allowance(contractToApprove, currencyAddress, price, quantity, tokenDecimals) {\n const signer = contractToApprove.getSigner();\n const provider = contractToApprove.getProvider();\n const ERC20Abi = (await import('@thirdweb-dev/contracts-js/dist/abis/IERC20.json')).default;\n const erc20 = new ContractWrapper(signer || provider, currencyAddress, ERC20Abi, contractToApprove.options, contractToApprove.storage);\n const owner = await contractToApprove.getSignerAddress();\n const spender = contractToApprove.address;\n const allowance = await erc20.read(\"allowance\", [owner, spender]);\n const totalPrice = BigNumber.from(price).mul(BigNumber.from(quantity)).div(utils.parseUnits(\"1\", tokenDecimals));\n if (allowance.lt(totalPrice)) {\n await erc20.sendTransaction(\"approve\", [spender, allowance.add(totalPrice)]);\n }\n}\n\n/**\n * Returns proofs and the overrides required for the transaction.\n * @internal\n * @returns `overrides` and `proofs` as an object.\n */\nasync function prepareClaim(addressToClaim, quantity, activeClaimCondition, merkleMetadataFetcher, tokenDecimals, contractWrapper, storage, checkERC20Allowance, snapshotFormatVersion) {\n let maxClaimable = convertQuantityToBigNumber(activeClaimCondition.maxClaimablePerWallet, tokenDecimals);\n let proofs = [utils.hexZeroPad([0], 32)];\n let priceInProof = activeClaimCondition.price; // the price to send to the contract in claim proofs\n let currencyAddressInProof = activeClaimCondition.currencyAddress;\n try {\n if (!activeClaimCondition.merkleRootHash.toString().startsWith(constants.AddressZero)) {\n const snapshotEntry = await fetchSnapshotEntryForAddress(addressToClaim, activeClaimCondition.merkleRootHash.toString(), await merkleMetadataFetcher(), contractWrapper.getProvider(), storage, snapshotFormatVersion);\n if (snapshotEntry) {\n proofs = snapshotEntry.proof;\n // override only if not default values (unlimited for quantity, zero addr for currency)\n maxClaimable = snapshotEntry.maxClaimable === \"unlimited\" ? constants.MaxUint256 : utils.parseUnits(snapshotEntry.maxClaimable, tokenDecimals);\n priceInProof = snapshotEntry.price === undefined || snapshotEntry.price === \"unlimited\" ? constants.MaxUint256 : await normalizePriceValue(contractWrapper.getProvider(), snapshotEntry.price, snapshotEntry.currencyAddress || constants.AddressZero);\n currencyAddressInProof = snapshotEntry.currencyAddress || constants.AddressZero;\n } else {\n // if no snapshot entry, and it's a v1 format (exclusive allowlist) then address can't claim\n if (snapshotFormatVersion === SnapshotFormatVersion.V1) {\n throw new Error(\"No claim found for this address\");\n }\n // but if its snapshot v2 (override list behavior) then address can still claim with default settings\n }\n }\n } catch (e) {\n // have to handle the valid error case that we *do* want to throw on\n if (e?.message === \"No claim found for this address\") {\n throw e;\n }\n // other errors we wanna ignore and try to continue\n console.warn(\"failed to check claim condition merkle root hash, continuing anyways\", e);\n }\n const overrides = (await contractWrapper.getCallOverrides()) || {};\n // the actual price to check allowance against\n // if proof price is unlimited, then we use the price from the claim condition\n // this mimics the contract behavior\n const pricePerToken = priceInProof.toString() !== constants.MaxUint256.toString() ? priceInProof : activeClaimCondition.price;\n // same for currency address\n const currencyAddress = currencyAddressInProof !== constants.AddressZero ? currencyAddressInProof : activeClaimCondition.currencyAddress;\n if (pricePerToken.gt(0)) {\n if (isNativeToken(currencyAddress)) {\n overrides[\"value\"] = BigNumber.from(pricePerToken).mul(quantity).div(utils.parseUnits(\"1\", tokenDecimals));\n } else if (checkERC20Allowance) {\n await approveErc20Allowance(contractWrapper, currencyAddress, pricePerToken, quantity, tokenDecimals);\n }\n }\n return {\n overrides,\n proofs,\n maxClaimable,\n price: pricePerToken,\n currencyAddress: currencyAddress,\n priceInProof,\n currencyAddressInProof\n };\n}\n\n/**\n * @internal\n */\nconst CurrencySchema = /* @__PURE__ */(() => z.object({\n name: z.string(),\n symbol: z.string(),\n decimals: z.number()\n}))();\n\n/**\n * @internal\n */\nconst CurrencyValueSchema = /* @__PURE__ */(() => CurrencySchema.extend({\n value: BigNumberSchema,\n displayValue: z.string()\n}))();\n\n/**\n * @internal\n */\nconst ClaimConditionMetadataSchema = /* @__PURE__ */(() => z.object({\n name: z.string().optional()\n}).catchall(z.unknown()))();\n\n/**\n * @internal\n */\nconst ClaimConditionInputSchema = /* @__PURE__ */(() => z.object({\n startTime: StartDateSchema,\n currencyAddress: z.string().default(NATIVE_TOKEN_ADDRESS),\n price: AmountSchema.default(0),\n maxClaimableSupply: QuantitySchema,\n maxClaimablePerWallet: QuantitySchema,\n waitInSeconds: BigNumberishSchema.default(0),\n merkleRootHash: BytesLikeSchema.default(utils.hexZeroPad([0], 32)),\n snapshot: z.optional(SnapshotInputSchema).nullable(),\n metadata: ClaimConditionMetadataSchema.optional()\n}))();\n\n/**\n * @internal\n */\nconst ClaimConditionInputArray = /* @__PURE__ */(() => z.array(ClaimConditionInputSchema))();\n\n/**\n * @internal\n */\nconst PartialClaimConditionInputSchema = /* @__PURE__ */(() => ClaimConditionInputSchema.partial())();\n\n/**\n * @internal\n */\nconst ClaimConditionOutputSchema = /* @__PURE__ */(() => ClaimConditionInputSchema.extend({\n availableSupply: QuantitySchema,\n currentMintSupply: QuantitySchema,\n currencyMetadata: CurrencyValueSchema.default({\n value: BigNumber.from(\"0\"),\n displayValue: \"0\",\n symbol: \"\",\n decimals: 18,\n name: \"\"\n }),\n price: BigNumberSchema,\n waitInSeconds: BigNumberSchema,\n startTime: BigNumberSchema.transform(n => new Date(n.toNumber() * 1000)),\n snapshot: SnapshotInputSchema.optional().nullable()\n}))();\n\n/**\n * Create a snapshot (merkle tree) from a list of addresses and uploads it to IPFS\n * @param snapshotInput - the list of addresses to hash\n * @param tokenDecimals - the token decimals\n * @param provider - the provider to use\n * @param storage - the storage to upload to\n * @param snapshotFormatVersion - the snapshot format version\n * @returns The generated snapshot and URI\n * @internal\n */\nasync function createSnapshot(snapshotInput, tokenDecimals, provider, storage, snapshotFormatVersion) {\n const input = await parseSnapshotInputs(snapshotInput);\n const addresses = input.map(i => i.address);\n const hasDuplicates = new Set(addresses).size < addresses.length;\n if (hasDuplicates) {\n throw new DuplicateLeafsError();\n }\n const tree = await ShardedMerkleTree.buildAndUpload(input, tokenDecimals, provider, storage, snapshotFormatVersion);\n return {\n merkleRoot: tree.shardedMerkleInfo.merkleRoot,\n snapshotUri: tree.uri\n };\n}\n\n/**\n * Create a MerkleTree based on an allow list of addresses and maxClaimable\n * @param snapshotInput - the list of addresses and maxClaimable\n * @param tokenDecimals - optional decimals for the token to claim (default 18)\n * @param version - optional version of the snapshot format (default V1)\n * @returns The generated MerkleTree\n */\nasync function createMerkleTreeFromAllowList(snapshotInput) {\n let tokenDecimals = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 18;\n let version = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : SnapshotFormatVersion.V1;\n const input = await parseSnapshotInputs(snapshotInput);\n const addresses = input.map(i => i.address);\n const hasDuplicates = new Set(addresses).size < addresses.length;\n if (hasDuplicates) {\n throw new DuplicateLeafsError();\n }\n const leaves = input.map(i => {\n return hashAllowListEntry(i, tokenDecimals, version);\n });\n const tree = new MerkleTree(leaves, utils.keccak256, {\n sort: true\n });\n return tree;\n}\n\n/**\n * Get the proofs for a given entry of addresses\n * @param merkleTree - the merkle tree to get the proof from\n * @param snapshotEntry - the entry to get the proof for\n * @param tokenDecimals - optional decimals for the token to claim (default 18)\n * @param version - optional version of the snapshot format (default V1)\n * @returns\n */\nasync function getProofsForAllowListEntry(merkleTree, snapshotEntry) {\n let tokenDecimals = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 18;\n let version = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : SnapshotFormatVersion.V1;\n return merkleTree.getProof(hashAllowListEntry(snapshotEntry, tokenDecimals, version)).map(value => \"0x\" + value.data.toString(\"hex\"));\n}\n\n/**\n * Hash an allow list entry for use in a MerkleTree\n * @param snapshotEntry - the entry to hash\n * @param tokenDecimals - optional decimals for the token to claim (default 18)\n * @param version - optional version of the snapshot format (default V1)\n * @returns\n */\nfunction hashAllowListEntry(snapshotEntry) {\n let tokenDecimals = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 18;\n let version = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : SnapshotFormatVersion.V1;\n return ShardedMerkleTree.hashEntry(snapshotEntry, tokenDecimals, tokenDecimals, version);\n}\n\nfunction compare(a, b) {\n const left = BigNumber.from(a);\n const right = BigNumber.from(b);\n if (left.eq(right)) {\n return 0;\n } else if (left.gt(right)) {\n return 1;\n } else {\n return -1;\n }\n}\n\n/**\n * @internal\n * Decorates claim conditions with merkle roots from snapshots if present\n * @param claimConditionInputs - The claim conditions to process\n * @param tokenDecimals - The token decimals to use\n * @param provider - The provider to use\n * @param storage - The storage to use\n * @param snapshotFormatVersion - The snapshot format version to use\n */\nasync function processSnapshotData(claimConditionInputs, tokenDecimals, provider, storage, snapshotFormatVersion) {\n const snapshotInfos = [];\n const inputsWithSnapshots = await Promise.all(claimConditionInputs.map(async conditionInput => {\n // check snapshots and upload if provided\n if (conditionInput.snapshot && conditionInput.snapshot.length > 0) {\n const snapshotInfo = await createSnapshot(conditionInput.snapshot, tokenDecimals, provider, storage, snapshotFormatVersion);\n snapshotInfos.push(snapshotInfo);\n conditionInput.merkleRootHash = snapshotInfo.merkleRoot;\n } else {\n // if no snapshot is passed or empty, reset the merkle root\n conditionInput.merkleRootHash = utils.hexZeroPad([0], 32);\n }\n // fill condition with defaults values if not provided\n return conditionInput;\n }));\n return {\n inputsWithSnapshots,\n snapshotInfos\n };\n}\n\n/**\n * Converts a local SDK model to contract model\n * @param c - The condition input\n * @param tokenDecimals - The token decimals to use\n * @param provider - The provider to use\n * @param storage - The storage to use\n * @internal\n */\nasync function convertToContractModel(c, tokenDecimals, provider, storage) {\n const currency = c.currencyAddress === constants.AddressZero ? NATIVE_TOKEN_ADDRESS : c.currencyAddress;\n const maxClaimableSupply = convertQuantityToBigNumber(c.maxClaimableSupply, tokenDecimals);\n const maxClaimablePerWallet = convertQuantityToBigNumber(c.maxClaimablePerWallet, tokenDecimals);\n let metadataOrUri;\n if (c.metadata) {\n if (typeof c.metadata === \"string\") {\n metadataOrUri = c.metadata;\n } else {\n metadataOrUri = await storage.upload(c.metadata);\n }\n }\n return {\n startTimestamp: c.startTime,\n maxClaimableSupply,\n supplyClaimed: 0,\n maxClaimablePerWallet,\n pricePerToken: await normalizePriceValue(provider, c.price, currency),\n currency,\n merkleRoot: c.merkleRootHash.toString(),\n waitTimeInSecondsBetweenClaims: c.waitInSeconds || 0,\n metadata: metadataOrUri\n };\n}\n\n/**\n * Create and uploads snapshots + converts claim conditions to contract format\n * @param claimConditionInputs - The claim conditions to process\n * @param tokenDecimals - The token decimals to use\n * @param provider - The provider to use\n * @param storage - The storage to use\n * @param snapshotFormatVersion - The snapshot format version to use\n * @internal\n */\nasync function processClaimConditionInputs(claimConditionInputs, tokenDecimals, provider, storage, snapshotFormatVersion) {\n const {\n inputsWithSnapshots,\n snapshotInfos\n } = await processSnapshotData(claimConditionInputs, tokenDecimals, provider, storage, snapshotFormatVersion);\n const parsedInputs = await ClaimConditionInputArray.parseAsync(inputsWithSnapshots);\n // Convert processed inputs to the format the contract expects, and sort by timestamp\n const sortedConditions = (await Promise.all(parsedInputs.map(c => convertToContractModel(c, tokenDecimals, provider, storage)))).sort((a, b) => {\n return compare(a.startTimestamp, b.startTimestamp);\n });\n return {\n snapshotInfos,\n sortedConditions\n };\n}\n\n/**\n * @internal\n * @param merkleRoot - The merkle root to fetch the snapshot for\n * @param merkleMetadata - The merkle metadata to use\n * @param storage - The storage to use\n */\nasync function fetchSnapshot(merkleRoot, merkleMetadata, storage) {\n if (!merkleMetadata) {\n return null;\n }\n const snapshotUri = merkleMetadata[merkleRoot];\n if (snapshotUri) {\n const raw = await storage.downloadJSON(snapshotUri);\n if (raw.isShardedMerkleTree && raw.merkleRoot === merkleRoot) {\n const smt = await ShardedMerkleTree.fromUri(snapshotUri, storage);\n return smt?.getAllEntries() || null;\n } else {\n const snapshotData = await SnapshotSchema.parseAsync(raw);\n if (merkleRoot === snapshotData.merkleRoot) {\n return snapshotData.claims.map(claim => ({\n address: claim.address,\n maxClaimable: claim.maxClaimable,\n price: claim.price,\n currencyAddress: claim.currencyAddress\n }));\n }\n }\n }\n return null;\n}\n\n/**\n * @internal\n * @param bn - The big number to convert\n * @param tokenDecimals - The token decimals to use\n */\nfunction convertToReadableQuantity(bn, tokenDecimals) {\n if (bn.toString() === constants.MaxUint256.toString()) {\n return \"unlimited\";\n } else {\n return utils.formatUnits(bn, tokenDecimals);\n }\n}\n\n/**\n * Transforms a contract model to local model\n * @param pm - The contract model to transform\n * @param tokenDecimals - The token decimals to use\n * @param provider - The provider to use\n * @param merkleMetadata - The merkle metadata to use\n * @param storage - The storage to use\n * @param shouldDownloadSnapshot - Whether to download the snapshot\n * @internal\n */\nasync function transformResultToClaimCondition(pm, tokenDecimals, provider, merkleMetadata, storage, shouldDownloadSnapshot) {\n const cv = await fetchCurrencyValue(provider, pm.currency, pm.pricePerToken);\n const maxClaimableSupply = convertToReadableQuantity(pm.maxClaimableSupply, tokenDecimals);\n const maxClaimablePerWallet = convertToReadableQuantity(pm.maxClaimablePerWallet, tokenDecimals);\n const availableSupply = convertToReadableQuantity(BigNumber.from(pm.maxClaimableSupply).sub(pm.supplyClaimed), tokenDecimals);\n const currentMintSupply = convertToReadableQuantity(pm.supplyClaimed, tokenDecimals);\n let resolvedMetadata;\n if (pm.metadata) {\n resolvedMetadata = await storage.downloadJSON(pm.metadata);\n }\n return ClaimConditionOutputSchema.parseAsync({\n startTime: pm.startTimestamp,\n maxClaimableSupply,\n maxClaimablePerWallet,\n currentMintSupply,\n availableSupply,\n waitInSeconds: pm.waitTimeInSecondsBetweenClaims?.toString(),\n price: BigNumber.from(pm.pricePerToken),\n currency: pm.currency,\n currencyAddress: pm.currency,\n currencyMetadata: cv,\n merkleRootHash: pm.merkleRoot,\n snapshot: shouldDownloadSnapshot ? await fetchSnapshot(pm.merkleRoot, merkleMetadata, storage) : undefined,\n metadata: resolvedMetadata\n });\n}\n\n/**\n * @internal\n * @param index - The index of the condition to update\n * @param claimConditionInput - The input claim condition to update\n * @param existingConditions - The existing claim conditions\n */\nasync function updateExistingClaimConditions(index, claimConditionInput, existingConditions) {\n if (index >= existingConditions.length) {\n throw Error(`Index out of bounds - got index: ${index} with ${existingConditions.length} conditions`);\n }\n // merge input with existing claim condition\n const priceDecimals = existingConditions[index].currencyMetadata.decimals;\n const priceInWei = existingConditions[index].price;\n const priceInTokens = utils.formatUnits(priceInWei, priceDecimals);\n\n // merge existing (output format) with incoming (input format)\n const newConditionParsed = await ClaimConditionInputSchema.parseAsync({\n ...existingConditions[index],\n price: priceInTokens,\n ...claimConditionInput\n });\n\n // convert to output claim condition\n const mergedConditionOutput = await ClaimConditionOutputSchema.parseAsync({\n ...newConditionParsed,\n price: priceInWei\n });\n return existingConditions.map((existingOutput, i) => {\n let newConditionAtIndex;\n if (i === index) {\n newConditionAtIndex = mergedConditionOutput;\n } else {\n newConditionAtIndex = existingOutput;\n }\n const formattedPrice = utils.formatUnits(newConditionAtIndex.price, priceDecimals);\n return {\n ...newConditionAtIndex,\n price: formattedPrice // manually transform back to input price type\n };\n });\n}\n\nlet ClaimEligibility = /*#__PURE__*/function (ClaimEligibility) {\n ClaimEligibility[\"NotEnoughSupply\"] = \"There is not enough supply to claim.\";\n ClaimEligibility[\"AddressNotAllowed\"] = \"This address is not on the allowlist.\";\n ClaimEligibility[\"WaitBeforeNextClaimTransaction\"] = \"Not enough time since last claim transaction. Please wait.\";\n ClaimEligibility[\"ClaimPhaseNotStarted\"] = \"Claim phase has not started yet.\";\n ClaimEligibility[\"AlreadyClaimed\"] = \"You have already claimed the token.\";\n ClaimEligibility[\"WrongPriceOrCurrency\"] = \"Incorrect price or currency.\";\n ClaimEligibility[\"OverMaxClaimablePerWallet\"] = \"Cannot claim more than maximum allowed quantity.\";\n ClaimEligibility[\"NotEnoughTokens\"] = \"There are not enough tokens in the wallet to pay for the claim.\";\n ClaimEligibility[\"NoActiveClaimPhase\"] = \"There is no active claim phase at the moment. Please check back in later.\";\n ClaimEligibility[\"NoClaimConditionSet\"] = \"There is no claim condition set.\";\n ClaimEligibility[\"NoWallet\"] = \"No wallet connected.\";\n ClaimEligibility[\"Unknown\"] = \"No claim conditions found.\";\n return ClaimEligibility;\n}({});\n\nfunction resolveOrGenerateId(requestUId) {\n if (requestUId === undefined) {\n const buffer = Buffer.alloc(16);\n v4({}, buffer);\n return utils.hexlify(utils.toUtf8Bytes(buffer.toString(\"hex\")));\n } else {\n return utils.hexlify(requestUId);\n }\n}\n\n/**\n * @internal\n */\nconst BaseSignaturePayloadInput = /* @__PURE__ */(() => z.object({\n to: AddressOrEnsSchema.refine(address => address.toLowerCase() !== constants.AddressZero, {\n message: \"Cannot create payload to mint to zero address\"\n }),\n price: AmountSchema.default(0),\n currencyAddress: AddressSchema.default(NATIVE_TOKEN_ADDRESS),\n mintStartTime: StartDateSchema,\n mintEndTime: EndDateSchema,\n uid: z.string().optional().transform(arg => resolveOrGenerateId(arg)),\n primarySaleRecipient: AddressOrEnsSchema.default(constants.AddressZero)\n}))();\n\n/**\n * @internal\n */\nconst Signature20PayloadInput = /* @__PURE__ */(() => BaseSignaturePayloadInput.extend({\n quantity: AmountSchema\n}))();\n\n/**\n * @internal\n */\nconst Signature20PayloadOutput = /* @__PURE__ */(() => Signature20PayloadInput.extend({\n mintStartTime: BigNumberSchema,\n mintEndTime: BigNumberSchema\n}))();\n\n/**\n * @internal\n */\nconst Signature721PayloadInput = /* @__PURE__ */(() => BaseSignaturePayloadInput.extend({\n metadata: NFTInputOrUriSchema,\n royaltyRecipient: z.string().default(constants.AddressZero),\n royaltyBps: BasisPointsSchema.default(0)\n}))();\n\n/**\n * @internal\n */\nconst Signature721PayloadOutput = /* @__PURE__ */(() => Signature721PayloadInput.extend({\n metadata: NFTInputOrUriSchema.default(\"\"),\n uri: z.string(),\n royaltyBps: BigNumberSchema,\n mintStartTime: BigNumberSchema,\n mintEndTime: BigNumberSchema\n}))();\n\n/**\n * @internal\n */\nconst Signature1155PayloadInput = /* @__PURE__ */(() => Signature721PayloadInput.extend({\n metadata: NFTInputOrUriSchema.default(\"\"),\n quantity: BigNumberishSchema\n}))();\n\n/**\n * @internal\n */\nconst Signature1155PayloadInputWithTokenId = /* @__PURE__ */(() => Signature1155PayloadInput.extend({\n tokenId: BigNumberishSchema\n}))();\n\n/**\n * @internal\n */\nconst Signature1155PayloadOutput = /* @__PURE__ */(() => Signature721PayloadOutput.extend({\n tokenId: BigNumberSchema,\n quantity: BigNumberSchema\n}))();\n\n/**\n * @internal\n */\nconst Signature721WithQuantityInput = /* @__PURE__ */(() => Signature721PayloadInput.extend({\n metadata: NFTInputOrUriSchema.default(\"\"),\n quantity: BigNumberSchema.default(1)\n}))();\n\n/**\n * @internal\n */\nconst Signature721WithQuantityOutput = /* @__PURE__ */(() => Signature721PayloadOutput.extend({\n quantity: BigNumberSchema.default(1)\n}))();\n\n/**\n * @public\n */\n\n/**\n * @public\n */\n\n/**\n * @public\n */\n\n/**\n * @public\n */\n\n/**\n * @public\n */\n\n/**\n * @public\n */\n\n/**\n * @public\n */\n\n/**\n * @public\n */\n\n/**\n * @public\n */\n\n/**\n * @public\n */\n\n/**\n * @public\n */\n\n/**\n * @public\n */\n\n/**\n * @public\n */\n\n/**\n * @public\n */\n\n/**\n * @public\n */\n\n/**\n * @public\n */\n\n/**\n * @public\n */\n\n/**\n * @public\n */\n\nconst MintRequest20 = [{\n name: \"to\",\n type: \"address\"\n}, {\n name: \"primarySaleRecipient\",\n type: \"address\"\n}, {\n name: \"quantity\",\n type: \"uint256\"\n}, {\n name: \"price\",\n type: \"uint256\"\n}, {\n name: \"currency\",\n type: \"address\"\n}, {\n name: \"validityStartTimestamp\",\n type: \"uint128\"\n}, {\n name: \"validityEndTimestamp\",\n type: \"uint128\"\n}, {\n name: \"uid\",\n type: \"bytes32\"\n}];\nconst MintRequest721 = [{\n name: \"to\",\n type: \"address\"\n}, {\n name: \"royaltyRecipient\",\n type: \"address\"\n}, {\n name: \"royaltyBps\",\n type: \"uint256\"\n}, {\n name: \"primarySaleRecipient\",\n type: \"address\"\n}, {\n name: \"uri\",\n type: \"string\"\n}, {\n name: \"price\",\n type: \"uint256\"\n}, {\n name: \"currency\",\n type: \"address\"\n}, {\n name: \"validityStartTimestamp\",\n type: \"uint128\"\n}, {\n name: \"validityEndTimestamp\",\n type: \"uint128\"\n}, {\n name: \"uid\",\n type: \"bytes32\"\n}];\nconst MintRequest1155 = [{\n name: \"to\",\n type: \"address\"\n}, {\n name: \"royaltyRecipient\",\n type: \"address\"\n}, {\n name: \"royaltyBps\",\n type: \"uint256\"\n}, {\n name: \"primarySaleRecipient\",\n type: \"address\"\n}, {\n name: \"tokenId\",\n type: \"uint256\"\n}, {\n name: \"uri\",\n type: \"string\"\n}, {\n name: \"quantity\",\n type: \"uint256\"\n}, {\n name: \"pricePerToken\",\n type: \"uint256\"\n}, {\n name: \"currency\",\n type: \"address\"\n}, {\n name: \"validityStartTimestamp\",\n type: \"uint128\"\n}, {\n name: \"validityEndTimestamp\",\n type: \"uint128\"\n}, {\n name: \"uid\",\n type: \"bytes32\"\n}];\nconst MintRequest721withQuantity = [{\n name: \"to\",\n type: \"address\"\n}, {\n name: \"royaltyRecipient\",\n type: \"address\"\n}, {\n name: \"royaltyBps\",\n type: \"uint256\"\n}, {\n name: \"primarySaleRecipient\",\n type: \"address\"\n}, {\n name: \"uri\",\n type: \"string\"\n}, {\n name: \"quantity\",\n type: \"uint256\"\n}, {\n name: \"pricePerToken\",\n type: \"uint256\"\n}, {\n name: \"currency\",\n type: \"address\"\n}, {\n name: \"validityStartTimestamp\",\n type: \"uint128\"\n}, {\n name: \"validityEndTimestamp\",\n type: \"uint128\"\n}, {\n name: \"uid\",\n type: \"bytes32\"\n}];\nconst GenericRequest = [{\n name: \"validityStartTimestamp\",\n type: \"uint128\"\n}, {\n name: \"validityEndTimestamp\",\n type: \"uint128\"\n}, {\n name: \"uid\",\n type: \"bytes32\"\n}, {\n name: \"data\",\n type: \"bytes\"\n}];\n\nexport { newContractModelToAbstract as A, BaseSignaturePayloadInput as B, ClaimEligibility as C, convertQuantityToBigNumber as D, prepareClaim as E, SnapshotFormatVersion as F, GenericRequest as G, processClaimConditionInputs as H, abstractContractModelToLegacy as I, abstractContractModelToNew as J, updateExistingClaimConditions as K, resolveOrGenerateId as L, MintRequest20 as M, PartialClaimConditionInputSchema as P, Signature20PayloadInput as S, approveErc20Allowance as a, createSnapshot as b, convertToReadableQuantity as c, createMerkleTreeFromAllowList as d, ClaimConditionMetadataSchema as e, fetchSnapshotEntryForAddress as f, getProofsForAllowListEntry as g, hashAllowListEntry as h, ClaimConditionInputSchema as i, ClaimConditionInputArray as j, ClaimConditionOutputSchema as k, CurrencySchema as l, CurrencyValueSchema as m, Signature20PayloadOutput as n, Signature721PayloadInput as o, Signature721PayloadOutput as p, Signature1155PayloadInput as q, Signature1155PayloadInputWithTokenId as r, Signature1155PayloadOutput as s, Signature721WithQuantityInput as t, Signature721WithQuantityOutput as u, MintRequest721 as v, MintRequest1155 as w, MintRequest721withQuantity as x, transformResultToClaimCondition as y, legacyContractModelToAbstract as z };\n","module.exports = function reverse (src) {\n var buffer = new Buffer(src.length)\n\n for (var i = 0, j = src.length - 1; i <= j; ++i, --j) {\n buffer[i] = src[j]\n buffer[j] = src[i]\n }\n\n return buffer\n}\n","// treeify.js\n// Luke Plaster \n// https://github.com/notatestuser/treeify.js\n\n// do the universal module definition dance\n(function (root, factory) {\n\n if (typeof exports === 'object') {\n module.exports = factory();\n } else if (typeof define === 'function' && define.amd) {\n define(factory);\n } else {\n root.treeify = factory();\n }\n\n}(this, function() {\n\n function makePrefix(key, last) {\n var str = (last ? '└' : '├');\n if (key) {\n str += '─ ';\n } else {\n str += '──┐';\n }\n return str;\n }\n\n function filterKeys(obj, hideFunctions) {\n var keys = [];\n for (var branch in obj) {\n // always exclude anything in the object's prototype\n if (!obj.hasOwnProperty(branch)) {\n continue;\n }\n // ... and hide any keys mapped to functions if we've been told to\n if (hideFunctions && ((typeof obj[branch])===\"function\")) {\n continue;\n }\n keys.push(branch);\n }\n return keys;\n }\n\n function growBranch(key, root, last, lastStates, showValues, hideFunctions, callback) {\n var line = '', index = 0, lastKey, circular, lastStatesCopy = lastStates.slice(0);\n\n if (lastStatesCopy.push([ root, last ]) && lastStates.length > 0) {\n // based on the \"was last element\" states of whatever we're nested within,\n // we need to append either blankness or a branch to our line\n lastStates.forEach(function(lastState, idx) {\n if (idx > 0) {\n line += (lastState[1] ? ' ' : '│') + ' ';\n }\n if ( ! circular && lastState[0] === root) {\n circular = true;\n }\n });\n\n // the prefix varies based on whether the key contains something to show and\n // whether we're dealing with the last element in this collection\n line += makePrefix(key, last) + key;\n\n // append values and the circular reference indicator\n showValues && (typeof root !== 'object' || root instanceof Date) && (line += ': ' + root);\n circular && (line += ' (circular ref.)');\n\n callback(line);\n }\n\n // can we descend into the next item?\n if ( ! circular && typeof root === 'object') {\n var keys = filterKeys(root, hideFunctions);\n keys.forEach(function(branch){\n // the last key is always printed with a different prefix, so we'll need to know if we have it\n lastKey = ++index === keys.length;\n\n // hold your breath for recursive action\n growBranch(branch, root[branch], lastKey, lastStatesCopy, showValues, hideFunctions, callback);\n });\n }\n };\n\n // --------------------\n\n var Treeify = {};\n\n // Treeify.asLines\n // --------------------\n // Outputs the tree line-by-line, calling the lineCallback when each one is available.\n\n Treeify.asLines = function(obj, showValues, hideFunctions, lineCallback) {\n /* hideFunctions and lineCallback are curried, which means we don't break apps using the older form */\n var hideFunctionsArg = typeof hideFunctions !== 'function' ? hideFunctions : false;\n growBranch('.', obj, false, [], showValues, hideFunctionsArg, lineCallback || hideFunctions);\n };\n\n // Treeify.asTree\n // --------------------\n // Outputs the entire tree, returning it as a string with line breaks.\n\n Treeify.asTree = function(obj, showValues, hideFunctions) {\n var tree = '';\n growBranch('.', obj, false, [], showValues, hideFunctions, function(line) {\n tree += line + '\\n';\n });\n return tree;\n };\n\n // --------------------\n\n return Treeify;\n\n}));\n"],"names":["RawDateSchema","zod__WEBPACK_IMPORTED_MODULE_0__","z","union","date","transform","i","ethers__WEBPACK_IMPORTED_MODULE_1__","O$","from","Math","floor","getTime","number","StartDateSchema","default","Date","EndDateSchema","now","assertEnabled","namespace","feature","_index_02e94cec_browser_esm_js__WEBPACK_IMPORTED_MODULE_2__","x","PropertiesInput","object","catchall","_index_02e94cec_browser_esm_js__WEBPACK_IMPORTED_MODULE_1__","cx","unknown","OptionalPropertiesInput","array","flat","optional","nullable","BasicNFTInput","name","string","description","image","cy","animation_url","CommonNFTInput","extend","external_url","background_color","cz","properties","attributes","NFTInputOrUriSchema","CommonNFTOutput","id","uri","setErc20Allowance","contractToApprove","value","currencyAddress","overrides","_fetchCurrencyValue_a150f8dd_browser_esm_js__WEBPACK_IMPORTED_MODULE_2__","ERC20Abi","Promise","resolve","then","__webpack_require__","t","bind","signer","getSigner","provider","getProvider","erc20","cs","options","storage","owner","getSignerAddress","spender","address","allowance","read","lt","sendTransaction","SnapshotFormatVersion","ClaimEligibility","Base","print","bufferIndexOf","element","isSorted","arguments","length","undefined","binarySearch","buffer","Buffer","compare","linearSearch","buffer1","buffer2","equals","compareFunction","start","end","mid","ordering","eqChecker","bufferify","isBuffer","words","toString","convertWordsToBuffer","isHexString","replace","Uint8Array","s","ArrayBuffer","isView","byteOffset","byteLength","bigNumberify","startsWith","BigInt","uint8ArrayToBigInt","u8a","hex","Array","map","byte","padStart","join","v","test","tree","console","log","bufferToHex","withPrefix","alloc","bufferifyFn","f","arrayBuffer","hexStringToArrayBuffer","hexString","parseInt","substring","processedBuffer","hexResult","arrayBufferToHexString","uint8View","log2","n","zip","a","b","e","hexZeroPad","hexStr","Base$1","wordArray","thirdweb_dev_merkletree_esm_MerkleTree","duplicateOdd","concatenator","concat","hashLeaves","isBitcoinTree","leaves","layers","sortLeaves","sortPairs","sort","fillDefaultHash","complete","hashFn","idx","processLeaves","getOptions","pow","ceil","push","createHashes","nodes","layerIndex","layerLimit","Number","isInteger","slice","data","hash","buffer_reverse_default","left","right","combined","addLeaf","leaf","shouldHash","addLeaves","getLeaves","values","isArray","filter","getLeaf","index","getLeafIndex","target","getLeafCount","getHexLeaves","marshalLeaves","JSON","stringify","unmarshalLeaves","jsonStr","parsed","parse","Object","getLayers","getHexLayers","reduce","acc","item","layer","getLayersFlat","unshift","getHexLayersFlat","getLayerCount","getRoot","getHexRoot","getProof","proof","isRightNode","pairIndex","position","getHexProof","getProofs","proofs","getProofsDFS","currentLayer","reverse","pushed","splice","getHexProofs","getPositionalHexProof","getProofIndices","treeIndices","depth","leafCount","maximalIndices","Set","add","y","redundantIndices","has","includes","getProofIndicesForUnevenTree","sortedLeafIndices","leavesCount","unevenLayers","unevenLayer","proofIndices","layerNodes","siblingIndices","proofNodeIndices","find","_ref","getMultiProof","indices","warn","isUneven","isUnevenTree","every","getMultiProofForUnevenTree","els","ids","el","hashes","nextIds","j","pairElement","getPairNode","self","indexOf","proofHashes","currentLayerIndices","treeLayer","siblings","uniqueIndices","getHexMultiProof","getProofFlags","_proofs","tested","flags","ids_","skipped","proofUsed","verify","targetNode","root","node","isLeftNode","buffers","verifyMultiProof","proofLeaves","verifyMultiProofForUnevenTree","proofitem","indexqueue","keys","hasOwnProperty","call","pair","verifyMultiProofWithFlags","proofFlag","leavesLen","totalHashes","leafPos","hashPos","proofPos","bufA","bufB","computedRoot","calculateRootForUnevenTree","getDepth","getLayersAsObject","objs","arr","obj","shift","akey","bkey","resetTree","pairIdx","toTreeString","treeify","asTree","treeLayers","isPowOf2","leafIndices","leafHashes","totalLeavesCount","leafTuples","_ref2","_ref3","indexA","indexB","leafTupleIndices","_ref4","nextSliceStart","proofTuplesByLayers","sliceStart","_ref5","_ref6","_ref7","_ref8","layerIndex_","parentIndices","parentLayer","parentNodeTreeIndex","abstractContractModelToLegacy","model","startTimestamp","maxClaimableSupply","supplyClaimed","merkleRoot","pricePerToken","currency","quantityLimitPerTransaction","maxClaimablePerWallet","waitTimeInSecondsBetweenClaims","abstractContractModelToNew","quantityLimitPerWallet","metadata","convertQuantityToBigNumber","quantity","tokenDecimals","bignumbers","Bz","lib_esm","parseUnits","parseSnapshotInputs","inputs","chunks","_","results","parsedChunks","all","chunk","index_02e94cec_browser_esm","bM","parseAsync","ShardedMerkleTree","constructor","baseUri","originalEntriesUri","shardNybbles","shards","trees","fromUri","shardedMerkleTreeInfo","downloadJSON","isShardedMerkleTree","fromShardedMerkleTreeInfo","info","hashEntry","entry","currencyDecimals","snapshotFormatVersion","V1","solidity_lib_esm","keccak256","maxClaimable","V2","price","addresses","d","fetchAndCacheDecimals","cache","currencyMetadata","fetchCurrencyValue_a150f8dd_browser_esm","decimals","buildAndUpload","snapshotInput","snapshotEntry","shard","toLowerCase","currencyDecimalMap","subTrees","entries","keccak256_lib_esm","roots","fromEntries","shardsToUpload","shardId","uris","uploadBatch","lastIndexOf","upload","shardedMerkleInfo","masterUri","endsWith","hashedEntries","bN","getAllEntries","fetchSnapshotEntryForAddress","merkleMetadata","snapshotUri","raw","merkleTree","snapshotData","bO","claims","c","legacyContractModelToAbstract","newContractModelToAbstract","approveErc20Allowance","totalPrice","bignumber","mul","div","prepareClaim","addressToClaim","activeClaimCondition","merkleMetadataFetcher","contractWrapper","checkERC20Allowance","bytes_lib_esm","priceInProof","currencyAddressInProof","merkleRootHash","normalizePriceValue_74eeb144_browser_esm","message","getCallOverrides","gt","CurrencySchema","lib","symbol","CurrencyValueSchema","b6","displayValue","ClaimConditionMetadataSchema","ClaimConditionInputSchema","startTime","assertEnabled_4605112f_browser_esm","S","aW","cw","cA","waitInSeconds","b7","cB","snapshot","ClaimConditionInputArray","ClaimConditionOutputSchema","availableSupply","currentMintSupply","toNumber","createSnapshot","input","hasDuplicates","size","processSnapshotData","claimConditionInputs","snapshotInfos","inputsWithSnapshots","conditionInput","snapshotInfo","convertToContractModel","metadataOrUri","processClaimConditionInputs","parsedInputs","sortedConditions","eq","fetchSnapshot","smt","claim","convertToReadableQuantity","bn","formatUnits","transformResultToClaimCondition","pm","shouldDownloadSnapshot","resolvedMetadata","cv","sub","updateExistingClaimConditions","claimConditionInput","existingConditions","Error","priceDecimals","priceInWei","priceInTokens","newConditionParsed","mergedConditionOutput","existingOutput","newConditionAtIndex","formattedPrice","resolveOrGenerateId","requestUId","hexlify","v4","Z","utf8","Y0","BaseSignaturePayloadInput","to","ba","refine","b9","mintStartTime","mintEndTime","E","uid","arg","primarySaleRecipient","Signature20PayloadInput","Signature20PayloadOutput","Signature721PayloadInput","setErc20Allowance_e3ef471a_browser_esm","N","royaltyRecipient","royaltyBps","cC","Signature721PayloadOutput","Signature1155PayloadInput","Signature1155PayloadInputWithTokenId","tokenId","Signature1155PayloadOutput","Signature721WithQuantityInput","Signature721WithQuantityOutput","MintRequest20","type","MintRequest721","MintRequest1155","MintRequest721withQuantity","module","exports","src","factory","growBranch","key","last","lastStates","showValues","hideFunctions","callback","str","lastKey","circular","line","lastStatesCopy","forEach","lastState","makePrefix","filterKeys","branch","Treeify","asLines","lineCallback"],"sourceRoot":""}