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