var l=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var h=Object.getOwnPropertyNames;var u=Object.prototype.hasOwnProperty;var y=(e,t)=>{for(var o in t)l(e,o,{get:t[o],enumerable:!0})},m=(e,t,o,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of h(t))!u.call(e,r)&&r!==o&&l(e,r,{get:()=>t[r],enumerable:!(n=p(t,r))||n.enumerable});return e};var g=e=>m(l({},"__esModule",{value:!0}),e);var B={};y(B,{capitalizeFirstLetter:()=>A,changeQueryParams:()=>T,copyText:()=>b,debounce:()=>z,eToNumber:()=>$,extractSrc:()=>x,folderValidation:()=>M,getImageUrl:()=>d,getJsonByteSize:()=>I,makeFriendlyNumber:()=>v,numberToWords:()=>f,readFile:()=>C,sleep:()=>E,toCamelize:()=>S,truncateAddress:()=>w});module.exports=g(B);var d=(e,{height:t,quality:o})=>{if(e)return e.includes("imagedelivery.net")?e.includes("quality")?`${e},height=${t}`:`${e}/height=${t},quality=${o}`:e},w=(e,t)=>e?e.length>t?e.substr(0,t-1)+"..."+e.substr(e.length-(t-1),e.length-1):e:"",v=e=>new Intl.NumberFormat("en-GB",{notation:"compact",compactDisplay:"short"}).format(e),b=(e,t)=>{if(navigator.clipboard&&navigator.permissions)navigator.clipboard.writeText(e).then(t);else if(document.queryCommandSupported("copy")){let o=document.createElement("textarea");o.value=e,document.body.appendChild(o),o.select(),document.execCommand("copy"),document.body.removeChild(o),t?.()}},x=e=>{let t=/<iframe.*src="([^"]+)".*>/,o=e.match(t);return o?o[1]:null};function S(e){return e.replace(/(?:^\w|[A-Z]|\b\w)/g,function(t,o){return o===0?t.toLowerCase():t.toUpperCase()}).replace(/\s+/g,"")}function f(e){let t=["","one","two","three","four","five","six","seven","eight","nine"],o=["","ten","twenty","thirty","forty","fifty","sixty","seventy","eighty","ninety"],n=["ten","eleven","twelve","thirteen","fourteen","fifteen","sixteen","seventeen","eighteen","nineteen"];if(e===0)return"zero";let r="";return e<0&&(r+="negative ",e=Math.abs(e)),e>=1e6&&(r+=f(Math.floor(e/1e6))+" million ",e%=1e6),e>=1e3&&(r+=f(Math.floor(e/1e3))+" thousand ",e%=1e3),e>=100&&(r+=t[Math.floor(e/100)]+" hundred ",e%=100),e>=20?(r+=o[Math.floor(e/10)]+" ",e%=10):e>=10&&(r+=n[e-10]+" ",e=0),e>0&&(r+=t[e]),r.trim()}function $(e){if(Math.abs(e)<1){var t=parseInt(e.toString().split("e-")[1]);t&&(e*=Math.pow(10,t-1),e="0."+new Array(t).join("0")+e.toString().substring(2))}else{var t=parseInt(e.toString().split("+")[1]);t>20&&(t-=20,e/=Math.pow(10,t),e+=new Array(t+1).join("0"))}return e}function A(e){return e.charAt(0).toUpperCase()+e.slice(1)}var z=(e,t)=>{let o;return function(...n){o&&clearTimeout(o),o=setTimeout(()=>{e.apply(this,n)},t)}},C=async e=>{let t=new FileReader;return new Promise((o,n)=>{t.onload=()=>{let r=t.result,s=Buffer.from(r);o(s)},t.onerror=function(r){n(r)},t.readAsArrayBuffer(e)})},I=e=>{let t=JSON.stringify(e);return new TextEncoder().encode(t).length},M=e=>{let t=0;if(e.length%2!==0)throw new Error("Invalid folder");let o=[];if(Array.from(e).forEach((r,s,c)=>{r.name==="collection.json"&&r.type==="application/json"&&(t+=r.size,o.push(r),c.find(i=>{i.name==="collection.png"&&i.type==="image/png"&&(t+=i.size,o.push(i))}))}),o.length!==2)throw new Error("Invalid collection files");let n=e.filter(r=>r.name!=="collection.json"&&r.name!=="collection.png");for(let r=0;r<n.length/2;r++){let s=`${r}.json`,c=`${r}.png`,i=[];if(Array.from(n).forEach((a,P)=>{a.name===s&&a.type==="application/json"&&(t+=a.size,i.push(a))}),Array.from(n).find(a=>{a.name===c&&a.type==="image/png"&&(t+=a.size,i.push(a))}),i.length!==2)throw new Error(`Invalid assets of file starting with ${r}`);return t}},T=(e,t,o,n,r,s,c)=>{if(c)n(t);else{let i=new URLSearchParams(e);i.set("collectionId",o);let a=`${t}?${i.toString()}${s?"#mint":""}`;n(a)}},E=e=>new Promise(t=>setTimeout(t,e*1e3));0&&(module.exports={capitalizeFirstLetter,changeQueryParams,copyText,debounce,eToNumber,extractSrc,folderValidation,getImageUrl,getJsonByteSize,makeFriendlyNumber,numberToWords,readFile,sleep,toCamelize,truncateAddress});
