@57block/stellar-resource-usage
Version:
A library that provides convenient ways to monitor and analyze the resources consumed by smart contracts during execution
8 lines • 270 kB
JavaScript
import{createRequire as E0}from"node:module";var eu=Object.create;var{getPrototypeOf:D0,defineProperty:zD,getOwnPropertyNames:u0}=Object;var F0=Object.prototype.hasOwnProperty;var ZD=(D,u,F)=>{F=D!=null?eu(D0(D)):{};let E=u||!D||!D.__esModule?zD(F,"default",{value:D,enumerable:!0}):F;for(let C of u0(D))if(!F0.call(E,C))zD(E,C,{get:()=>D[C],enumerable:!0});return E};var R=(D,u)=>()=>(u||D((u={exports:{}}).exports,u),u.exports);var c=E0(import.meta.url);var i=R((YF,GD)=>{var o=[],$D=0,b=(D,u)=>{if($D>=u)o.push(D)};b.WARN=1;b.INFO=2;b.DEBUG=3;b.reset=()=>{o=[]};b.setDebugLevel=(D)=>{$D=D};b.warn=(D)=>b(D,b.WARN);b.info=(D)=>b(D,b.INFO);b.debug=(D)=>b(D,b.DEBUG);b.debugMessages=()=>o;GD.exports=b});var UD=R((XF,QD)=>{QD.exports=({onlyFirst:D=!1}={})=>{let u=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(u,D?void 0:"g")}});var RD=R((OF,JD)=>{var C0=UD();JD.exports=(D)=>typeof D==="string"?D.replace(C0(),""):D});var VD=R((qF,l)=>{var fD=(D)=>{if(Number.isNaN(D))return!1;if(D>=4352&&(D<=4447||D===9001||D===9002||11904<=D&&D<=12871&&D!==12351||12880<=D&&D<=19903||19968<=D&&D<=42182||43360<=D&&D<=43388||44032<=D&&D<=55203||63744<=D&&D<=64255||65040<=D&&D<=65049||65072<=D&&D<=65131||65281<=D&&D<=65376||65504<=D&&D<=65510||110592<=D&&D<=110593||127488<=D&&D<=127569||131072<=D&&D<=262141))return!0;return!1};l.exports=fD;l.exports.default=fD});var ND=R((zF,KD)=>{KD.exports=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g}});var bD=R((ZF,t)=>{var B0=RD(),A0=VD(),H0=ND(),MD=(D)=>{if(typeof D!=="string"||D.length===0)return 0;if(D=B0(D),D.length===0)return 0;D=D.replace(H0()," ");let u=0;for(let F=0;F<D.length;F++){let E=D.codePointAt(F);if(E<=31||E>=127&&E<=159)continue;if(E>=768&&E<=879)continue;if(E>65535)F++;u+=A0(E)?2:1}return u};t.exports=MD;t.exports.default=MD});var e=R(($F,TD)=>{var ID=bD();function r(D){return D?/\u001b\[((?:\d*;){0,5}\d*)m/g:/\u001b\[(?:\d*;){0,5}\d*m/g}function k(D){let u=r();return(""+D).replace(u,"").split(`
`).reduce(function(C,B){return ID(B)>C?ID(B):C},0)}function m(D,u){return Array(u+1).join(D)}function Y0(D,u,F,E){let C=k(D);if(u+1>=C){let B=u-C;switch(E){case"right":{D=m(F,B)+D;break}case"center":{let H=Math.ceil(B/2),q=B-H;D=m(F,q)+D+m(F,H);break}default:{D=D+m(F,B);break}}}return D}var L={};function p(D,u,F){u="\x1B["+u+"m",F="\x1B["+F+"m",L[u]={set:D,to:!0},L[F]={set:D,to:!1},L[D]={on:u,off:F}}p("bold",1,22);p("italics",3,23);p("underline",4,24);p("inverse",7,27);p("strikethrough",9,29);function WD(D,u){let F=u[1]?parseInt(u[1].split(";")[0]):0;if(F>=30&&F<=39||F>=90&&F<=97){D.lastForegroundAdded=u[0];return}if(F>=40&&F<=49||F>=100&&F<=107){D.lastBackgroundAdded=u[0];return}if(F===0){for(let C in D)if(Object.prototype.hasOwnProperty.call(D,C))delete D[C];return}let E=L[u[0]];if(E)D[E.set]=E.to}function X0(D){let u=r(!0),F=u.exec(D),E={};while(F!==null)WD(E,F),F=u.exec(D);return E}function jD(D,u){let{lastBackgroundAdded:F,lastForegroundAdded:E}=D;if(delete D.lastBackgroundAdded,delete D.lastForegroundAdded,Object.keys(D).forEach(function(C){if(D[C])u+=L[C].off}),F&&F!="\x1B[49m")u+="\x1B[49m";if(E&&E!="\x1B[39m")u+="\x1B[39m";return u}function O0(D,u){let{lastBackgroundAdded:F,lastForegroundAdded:E}=D;if(delete D.lastBackgroundAdded,delete D.lastForegroundAdded,Object.keys(D).forEach(function(C){if(D[C])u=L[C].on+u}),F&&F!="\x1B[49m")u=F+u;if(E&&E!="\x1B[39m")u=E+u;return u}function q0(D,u){if(D.length===k(D))return D.substr(0,u);while(k(D)>u)D=D.slice(0,-1);return D}function z0(D,u){let F=r(!0),E=D.split(r()),C=0,B=0,H="",q,X={};while(B<u){q=F.exec(D);let A=E[C];if(C++,B+k(A)>u)A=q0(A,u-B);if(H+=A,B+=k(A),B<u){if(!q)break;H+=q[0],WD(X,q)}}return jD(X,H)}function Z0(D,u,F){if(F=F||"…",k(D)<=u)return D;u-=k(F);let C=z0(D,u);C+=F;let B="\x1B]8;;\x07";if(D.includes(B)&&!C.includes(B))C+=B;return C}function $0(){return{chars:{top:"─","top-mid":"┬","top-left":"┌","top-right":"┐",bottom:"─","bottom-mid":"┴","bottom-left":"└","bottom-right":"┘",left:"│","left-mid":"├",mid:"─","mid-mid":"┼",right:"│","right-mid":"┤",middle:"│"},truncate:"…",colWidths:[],rowHeights:[],colAligns:[],rowAligns:[],style:{"padding-left":1,"padding-right":1,head:["red"],border:["grey"],compact:!1},head:[]}}function G0(D,u){D=D||{},u=u||$0();let F=Object.assign({},u,D);return F.chars=Object.assign({},u.chars,D.chars),F.style=Object.assign({},u.style,D.style),F}function Q0(D,u){let F=[],E=u.split(/(\s+)/g),C=[],B=0,H;for(let q=0;q<E.length;q+=2){let X=E[q],A=B+k(X);if(B>0&&H)A+=H.length;if(A>D){if(B!==0)F.push(C.join(""));C=[X],B=k(X)}else C.push(H||"",X),B=A;H=E[q+1]}if(B)F.push(C.join(""));return F}function U0(D,u){let F=[],E="";function C(H,q){if(E.length&&q)E+=q;E+=H;while(E.length>D)F.push(E.slice(0,D)),E=E.slice(D)}let B=u.split(/(\s+)/g);for(let H=0;H<B.length;H+=2)C(B[H],H&&B[H-1]);if(E.length)F.push(E);return F}function J0(D,u,F=!0){let E=[];u=u.split(`
`);let C=F?Q0:U0;for(let B=0;B<u.length;B++)E.push.apply(E,C(D,u[B]));return E}function R0(D){let u={},F=[];for(let E=0;E<D.length;E++){let C=O0(u,D[E]);u=X0(C);let B=Object.assign({},u);F.push(jD(B,C))}return F}function f0(D,u){return["\x1B]","8",";",";",D||u,"\x07",u,"\x1B]","8",";",";","\x07"].join("")}TD.exports={strlen:k,repeat:m,pad:Y0,truncate:Z0,mergeOptions:G0,wordWrap:J0,colorizeLines:R0,hyperlink:f0}});var kD=R((GF,SD)=>{var vD={};SD.exports=vD;var _D={reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],grey:[90,39],brightRed:[91,39],brightGreen:[92,39],brightYellow:[93,39],brightBlue:[94,39],brightMagenta:[95,39],brightCyan:[96,39],brightWhite:[97,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgGray:[100,49],bgGrey:[100,49],bgBrightRed:[101,49],bgBrightGreen:[102,49],bgBrightYellow:[103,49],bgBrightBlue:[104,49],bgBrightMagenta:[105,49],bgBrightCyan:[106,49],bgBrightWhite:[107,49],blackBG:[40,49],redBG:[41,49],greenBG:[42,49],yellowBG:[43,49],blueBG:[44,49],magentaBG:[45,49],cyanBG:[46,49],whiteBG:[47,49]};Object.keys(_D).forEach(function(D){var u=_D[D],F=vD[D]=[];F.open="\x1B["+u[0]+"m",F.close="\x1B["+u[1]+"m"})});var PD=R((QF,wD)=>{wD.exports=function(D,u){u=u||process.argv;var F=u.indexOf("--"),E=/^-{1,2}/.test(D)?"":"--",C=u.indexOf(E+D);return C!==-1&&(F===-1?!0:C<F)}});var LD=R((UF,hD)=>{var V0=c("os"),v=PD(),W=process.env,g=void 0;if(v("no-color")||v("no-colors")||v("color=false"))g=!1;else if(v("color")||v("colors")||v("color=true")||v("color=always"))g=!0;if("FORCE_COLOR"in W)g=W.FORCE_COLOR.length===0||parseInt(W.FORCE_COLOR,10)!==0;function K0(D){if(D===0)return!1;return{level:D,hasBasic:!0,has256:D>=2,has16m:D>=3}}function N0(D){if(g===!1)return 0;if(v("color=16m")||v("color=full")||v("color=truecolor"))return 3;if(v("color=256"))return 2;if(D&&!D.isTTY&&g!==!0)return 0;var u=g?1:0;if(process.platform==="win32"){var F=V0.release().split(".");if(Number(process.versions.node.split(".")[0])>=8&&Number(F[0])>=10&&Number(F[2])>=10586)return Number(F[2])>=14931?3:2;return 1}if("CI"in W){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(function(C){return C in W})||W.CI_NAME==="codeship")return 1;return u}if("TEAMCITY_VERSION"in W)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(W.TEAMCITY_VERSION)?1:0;if("TERM_PROGRAM"in W){var E=parseInt((W.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(W.TERM_PROGRAM){case"iTerm.app":return E>=3?3:2;case"Hyper":return 3;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(W.TERM))return 2;if(/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(W.TERM))return 1;if("COLORTERM"in W)return 1;if(W.TERM==="dumb")return u;return u}function DD(D){var u=N0(D);return K0(u)}hD.exports={supportsColor:DD,stdout:DD(process.stdout),stderr:DD(process.stderr)}});var xD=R((JF,gD)=>{gD.exports=function D(u,F){var E="";u=u||"Run the trap, drop the bass",u=u.split("");var C={a:["@","Ą","Ⱥ","Ʌ","Δ","Λ","Д"],b:["ß","Ɓ","Ƀ","ɮ","β","฿"],c:["©","Ȼ","Ͼ"],d:["Ð","Ɗ","Ԁ","ԁ","Ԃ","ԃ"],e:["Ë","ĕ","Ǝ","ɘ","Σ","ξ","Ҽ","੬"],f:["Ӻ"],g:["ɢ"],h:["Ħ","ƕ","Ң","Һ","Ӈ","Ԋ"],i:["༏"],j:["Ĵ"],k:["ĸ","Ҡ","Ӄ","Ԟ"],l:["Ĺ"],m:["ʍ","Ӎ","ӎ","Ԡ","ԡ","൩"],n:["Ñ","ŋ","Ɲ","Ͷ","Π","Ҋ"],o:["Ø","õ","ø","Ǿ","ʘ","Ѻ","ם","","๏"],p:["Ƿ","Ҏ"],q:["্"],r:["®","Ʀ","Ȑ","Ɍ","ʀ","Я"],s:["§","Ϟ","ϟ","Ϩ"],t:["Ł","Ŧ","ͳ"],u:["Ʊ","Ս"],v:["ט"],w:["Ш","Ѡ","Ѽ","൰"],x:["Ҳ","Ӿ","Ӽ","ӽ"],y:["¥","Ұ","Ӌ"],z:["Ƶ","ɀ"]};return u.forEach(function(B){B=B.toLowerCase();var H=C[B]||[" "],q=Math.floor(Math.random()*H.length);if(typeof C[B]!=="undefined")E+=C[B][q];else E+=B}),E}});var mD=R((RF,yD)=>{yD.exports=function D(u,F){u=u||" he is here ";var E={up:["̍","̎","̄","̅","̿","̑","̆","̐","͒","͗","͑","̇","̈","̊","͂","̓","̈","͊","͋","͌","̃","̂","̌","͐","̀","́","̋","̏","̒","̓","̔","̽","̉","ͣ","ͤ","ͥ","ͦ","ͧ","ͨ","ͩ","ͪ","ͫ","ͬ","ͭ","ͮ","ͯ","̾","͛","͆","̚"],down:["̖","̗","̘","̙","̜","̝","̞","̟","̠","̤","̥","̦","̩","̪","̫","̬","̭","̮","̯","̰","̱","̲","̳","̹","̺","̻","̼","ͅ","͇","͈","͉","͍","͎","͓","͔","͕","͖","͙","͚","̣"],mid:["̕","̛","̀","́","͘","̡","̢","̧","̨","̴","̵","̶","͜","͝","͞","͟","͠","͢","̸","̷","͡"," ҉"]},C=[].concat(E.up,E.down,E.mid);function B(X){var A=Math.floor(Math.random()*X);return A}function H(X){var A=!1;return C.filter(function(z){A=z===X}),A}function q(X,A){var z="",$,V;A=A||{},A.up=typeof A.up!=="undefined"?A.up:!0,A.mid=typeof A.mid!=="undefined"?A.mid:!0,A.down=typeof A.down!=="undefined"?A.down:!0,A.size=typeof A.size!=="undefined"?A.size:"maxi",X=X.split("");for(V in X){if(H(V))continue;switch(z=z+X[V],$={up:0,down:0,mid:0},A.size){case"mini":$.up=B(8),$.mid=B(2),$.down=B(8);break;case"maxi":$.up=B(16)+3,$.mid=B(4)+1,$.down=B(64)+3;break;default:$.up=B(8)+1,$.mid=B(6)/2,$.down=B(8)+1;break}var O=["up","mid","down"];for(var Y in O){var Z=O[Y];for(var G=0;G<=$[Z];G++)if(A[Z])z=z+E[Z][B(E[Z].length)]}}return z}return q(u,F)}});var dD=R((fF,pD)=>{pD.exports=function(D){return function(u,F,E){if(u===" ")return u;switch(F%3){case 0:return D.red(u);case 1:return D.white(u);case 2:return D.blue(u)}}}});var iD=R((VF,cD)=>{cD.exports=function(D){return function(u,F,E){return F%2===0?u:D.inverse(u)}}});var nD=R((KF,rD)=>{rD.exports=function(D){var u=["red","yellow","green","blue","magenta"];return function(F,E,C){if(F===" ")return F;else return D[u[E++%u.length]](F)}}});var sD=R((NF,aD)=>{aD.exports=function(D){var u=["underline","inverse","grey","yellow","red","green","blue","white","cyan","magenta","brightYellow","brightRed","brightGreen","brightBlue","brightWhite","brightCyan","brightMagenta"];return function(F,E,C){return F===" "?F:D[u[Math.round(Math.random()*(u.length-2))]](F)}}});var uu=R((bF,Du)=>{var Q={};Du.exports=Q;Q.themes={};var M0=c("util"),P=Q.styles=kD(),lD=Object.defineProperties,b0=new RegExp(/[\r\n]+/g);Q.supportsColor=LD().supportsColor;if(typeof Q.enabled==="undefined")Q.enabled=Q.supportsColor()!==!1;Q.enable=function(){Q.enabled=!0};Q.disable=function(){Q.enabled=!1};Q.stripColors=Q.strip=function(D){return(""+D).replace(/\x1B\[\d+m/g,"")};var MF=Q.stylize=function D(u,F){if(!Q.enabled)return u+"";var E=P[F];if(!E&&F in Q)return Q[F](u);return E.open+u+E.close},I0=/[|\\{}()[\]^$+*?.]/g,W0=function(D){if(typeof D!=="string")throw new TypeError("Expected a string");return D.replace(I0,"\\$&")};function tD(D){var u=function F(){return T0.apply(F,arguments)};return u._styles=D,u.__proto__=j0,u}var eD=function(){var D={};return P.grey=P.gray,Object.keys(P).forEach(function(u){P[u].closeRe=new RegExp(W0(P[u].close),"g"),D[u]={get:function(){return tD(this._styles.concat(u))}}}),D}(),j0=lD(function D(){},eD);function T0(){var D=Array.prototype.slice.call(arguments),u=D.map(function(H){if(H!=null&&H.constructor===String)return H;else return M0.inspect(H)}).join(" ");if(!Q.enabled||!u)return u;var F=u.indexOf(`
`)!=-1,E=this._styles,C=E.length;while(C--){var B=P[E[C]];if(u=B.open+u.replace(B.closeRe,B.open)+B.close,F)u=u.replace(b0,function(H){return B.close+H+B.open})}return u}Q.setTheme=function(D){if(typeof D==="string"){console.log("colors.setTheme now only accepts an object, not a string. If you are trying to set a theme from a file, it is now your (the caller's) responsibility to require the file. The old syntax looked like colors.setTheme(__dirname + '/../themes/generic-logging.js'); The new syntax looks like colors.setTheme(require(__dirname + '/../themes/generic-logging.js'));");return}for(var u in D)(function(F){Q[F]=function(E){if(typeof D[F]==="object"){var C=E;for(var B in D[F])C=Q[D[F][B]](C);return C}return Q[D[F]](E)}})(u)};function _0(){var D={};return Object.keys(eD).forEach(function(u){D[u]={get:function(){return tD([u])}}}),D}var v0=function D(u,F){var E=F.split("");return E=E.map(u),E.join("")};Q.trap=xD();Q.zalgo=mD();Q.maps={};Q.maps.america=dD()(Q);Q.maps.zebra=iD()(Q);Q.maps.rainbow=nD()(Q);Q.maps.random=sD()(Q);for(oD in Q.maps)(function(D){Q[D]=function(u){return v0(Q.maps[D],u)}})(oD);var oD;lD(Q,_0())});var Eu=R((IF,Fu)=>{var S0=uu();Fu.exports=S0});var Hu=R((WF,s)=>{var{info:k0,debug:Au}=i(),T=e();class d{constructor(D){this.setOptions(D),this.x=null,this.y=null}setOptions(D){if(["boolean","number","bigint","string"].indexOf(typeof D)!==-1)D={content:""+D};D=D||{},this.options=D;let u=D.content;if(["boolean","number","bigint","string"].indexOf(typeof u)!==-1)this.content=String(u);else if(!u)this.content=this.options.href||"";else throw new Error("Content needs to be a primitive, got: "+typeof u);if(this.colSpan=D.colSpan||1,this.rowSpan=D.rowSpan||1,this.options.href)Object.defineProperty(this,"href",{get(){return this.options.href}})}mergeTableOptions(D,u){this.cells=u;let F=this.options.chars||{},E=D.chars,C=this.chars={};P0.forEach(function(q){uD(F,E,q,C)}),this.truncate=this.options.truncate||D.truncate;let B=this.options.style=this.options.style||{},H=D.style;uD(B,H,"padding-left",this),uD(B,H,"padding-right",this),this.head=B.head||H.head,this.border=B.border||H.border,this.fixedWidth=D.colWidths[this.x],this.lines=this.computeLines(D),this.desiredWidth=T.strlen(this.content)+this.paddingLeft+this.paddingRight,this.desiredHeight=this.lines.length}computeLines(D){let u=D.wordWrap||D.textWrap,{wordWrap:F=u}=this.options;if(this.fixedWidth&&F){if(this.fixedWidth-=this.paddingLeft+this.paddingRight,this.colSpan){let B=1;while(B<this.colSpan)this.fixedWidth+=D.colWidths[this.x+B],B++}let{wrapOnWordBoundary:E=!0}=D,{wrapOnWordBoundary:C=E}=this.options;return this.wrapLines(T.wordWrap(this.fixedWidth,this.content,C))}return this.wrapLines(this.content.split(`
`))}wrapLines(D){let u=T.colorizeLines(D);if(this.href)return u.map((F)=>T.hyperlink(this.href,F));return u}init(D){let u=this.x,F=this.y;this.widths=D.colWidths.slice(u,u+this.colSpan),this.heights=D.rowHeights.slice(F,F+this.rowSpan),this.width=this.widths.reduce(Bu,-1),this.height=this.heights.reduce(Bu,-1),this.hAlign=this.options.hAlign||D.colAligns[u],this.vAlign=this.options.vAlign||D.rowAligns[F],this.drawRight=u+this.colSpan==D.colWidths.length}draw(D,u){if(D=="top")return this.drawTop(this.drawRight);if(D=="bottom")return this.drawBottom(this.drawRight);let F=T.truncate(this.content,10,this.truncate);if(!D)k0(`${this.y}-${this.x}: ${this.rowSpan-D}x${this.colSpan} Cell ${F}`);let E=Math.max(this.height-this.lines.length,0),C;switch(this.vAlign){case"center":C=Math.ceil(E/2);break;case"bottom":C=E;break;default:C=0}if(D<C||D>=C+this.lines.length)return this.drawEmpty(this.drawRight,u);let B=this.lines.length>this.height&&D+1>=this.height;return this.drawLine(D-C,this.drawRight,B,u)}drawTop(D){let u=[];if(this.cells)this.widths.forEach(function(F,E){u.push(this._topLeftChar(E)),u.push(T.repeat(this.chars[this.y==0?"top":"mid"],F))},this);else u.push(this._topLeftChar(0)),u.push(T.repeat(this.chars[this.y==0?"top":"mid"],this.width));if(D)u.push(this.chars[this.y==0?"topRight":"rightMid"]);return this.wrapWithStyleColors("border",u.join(""))}_topLeftChar(D){let u=this.x+D,F;if(this.y==0)F=u==0?"topLeft":D==0?"topMid":"top";else if(u==0)F="leftMid";else if(F=D==0?"midMid":"bottomMid",this.cells){if(this.cells[this.y-1][u]instanceof d.ColSpanCell)F=D==0?"topMid":"mid";if(D==0){let C=1;while(this.cells[this.y][u-C]instanceof d.ColSpanCell)C++;if(this.cells[this.y][u-C]instanceof d.RowSpanCell)F="leftMid"}}return this.chars[F]}wrapWithStyleColors(D,u){if(this[D]&&this[D].length)try{let F=Eu();for(let E=this[D].length-1;E>=0;E--)F=F[this[D][E]];return F(u)}catch(F){return u}else return u}drawLine(D,u,F,E){let C=this.chars[this.x==0?"left":"middle"];if(this.x&&E&&this.cells){let $=this.cells[this.y+E][this.x-1];while($ instanceof n)$=this.cells[$.y][$.x-1];if(!($ instanceof a))C=this.chars.rightMid}let B=T.repeat(" ",this.paddingLeft),H=u?this.chars.right:"",q=T.repeat(" ",this.paddingRight),X=this.lines[D],A=this.width-(this.paddingLeft+this.paddingRight);if(F)X+=this.truncate||"…";let z=T.truncate(X,A,this.truncate);return z=T.pad(z,A," ",this.hAlign),z=B+z+q,this.stylizeLine(C,z,H)}stylizeLine(D,u,F){if(D=this.wrapWithStyleColors("border",D),F=this.wrapWithStyleColors("border",F),this.y===0)u=this.wrapWithStyleColors("head",u);return D+u+F}drawBottom(D){let u=this.chars[this.x==0?"bottomLeft":"bottomMid"],F=T.repeat(this.chars.bottom,this.width),E=D?this.chars.bottomRight:"";return this.wrapWithStyleColors("border",u+F+E)}drawEmpty(D,u){let F=this.chars[this.x==0?"left":"middle"];if(this.x&&u&&this.cells){let B=this.cells[this.y+u][this.x-1];while(B instanceof n)B=this.cells[B.y][B.x-1];if(!(B instanceof a))F=this.chars.rightMid}let E=D?this.chars.right:"",C=T.repeat(" ",this.width);return this.stylizeLine(F,C,E)}}class n{constructor(){}draw(D){if(typeof D==="number")Au(`${this.y}-${this.x}: 1x1 ColSpanCell`);return""}init(){}mergeTableOptions(){}}class a{constructor(D){this.originalCell=D}init(D){let u=this.y,F=this.originalCell.y;this.cellOffset=u-F,this.offset=w0(D.rowHeights,F,this.cellOffset)}draw(D){if(D=="top")return this.originalCell.draw(this.offset,this.cellOffset);if(D=="bottom")return this.originalCell.draw("bottom");return Au(`${this.y}-${this.x}: 1x${this.colSpan} RowSpanCell for ${this.originalCell.content}`),this.originalCell.draw(this.offset+1+D)}mergeTableOptions(){}}function Cu(...D){return D.filter((u)=>u!==void 0&&u!==null).shift()}function uD(D,u,F,E){let C=F.split("-");if(C.length>1)C[1]=C[1].charAt(0).toUpperCase()+C[1].substr(1),C=C.join(""),E[C]=Cu(D[C],D[F],u[C],u[F]);else E[F]=Cu(D[F],u[F])}function w0(D,u,F){let E=D[u];for(let C=1;C<F;C++)E+=1+D[u+C];return E}function Bu(D,u){return D+u+1}var P0=["top","top-mid","top-left","top-right","bottom","bottom-mid","bottom-left","bottom-right","left","left-mid","mid","mid-mid","right","right-mid","middle"];s.exports=d;s.exports.ColSpanCell=n;s.exports.RowSpanCell=a});var Ou=R((jF,Xu)=>{var{warn:h0,debug:L0}=i(),FD=Hu(),{ColSpanCell:g0,RowSpanCell:x0}=FD;(function(){function D(O,Y){if(O[Y]>0)return D(O,Y+1);return Y}function u(O){let Y={};O.forEach(function(Z,G){let f=0;Z.forEach(function(J){J.y=G,J.x=G?D(Y,f):f;let N=J.rowSpan||1,M=J.colSpan||1;if(N>1)for(let y=0;y<M;y++)Y[J.x+y]=N;f=J.x+M}),Object.keys(Y).forEach((J)=>{if(Y[J]--,Y[J]<1)delete Y[J]})})}function F(O){let Y=0;return O.forEach(function(Z){Z.forEach(function(G){Y=Math.max(Y,G.x+(G.colSpan||1))})}),Y}function E(O){return O.length}function C(O,Y){let Z=O.y,G=O.y-1+(O.rowSpan||1),f=Y.y,J=Y.y-1+(Y.rowSpan||1),N=!(Z>J||f>G),M=O.x,y=O.x-1+(O.colSpan||1),ou=Y.x,lu=Y.x-1+(Y.colSpan||1),tu=!(M>lu||ou>y);return N&&tu}function B(O,Y,Z){let G=Math.min(O.length-1,Z),f={x:Y,y:Z};for(let J=0;J<=G;J++){let N=O[J];for(let M=0;M<N.length;M++)if(C(f,N[M]))return!0}return!1}function H(O,Y,Z,G){for(let f=Z;f<G;f++)if(B(O,f,Y))return!1;return!0}function q(O){O.forEach(function(Y,Z){Y.forEach(function(G){for(let f=1;f<G.rowSpan;f++){let J=new x0(G);J.x=G.x,J.y=G.y+f,J.colSpan=G.colSpan,A(J,O[Z+f])}})})}function X(O){for(let Y=O.length-1;Y>=0;Y--){let Z=O[Y];for(let G=0;G<Z.length;G++){let f=Z[G];for(let J=1;J<f.colSpan;J++){let N=new g0;N.x=f.x+J,N.y=f.y,Z.splice(G+1,0,N)}}}}function A(O,Y){let Z=0;while(Z<Y.length&&Y[Z].x<O.x)Z++;Y.splice(Z,0,O)}function z(O){let Y=E(O),Z=F(O);L0(`Max rows: ${Y}; Max cols: ${Z}`);for(let G=0;G<Y;G++)for(let f=0;f<Z;f++)if(!B(O,f,G)){let J={x:f,y:G,colSpan:1,rowSpan:1};f++;while(f<Z&&!B(O,f,G))J.colSpan++,f++;let N=G+1;while(N<Y&&H(O,N,J.x,J.x+J.colSpan))J.rowSpan++,N++;let M=new FD(J);M.x=J.x,M.y=J.y,h0(`Missing cell at ${M.y}-${M.x}.`),A(M,O[G])}}function $(O){return O.map(function(Y){if(!Array.isArray(Y)){let Z=Object.keys(Y)[0];if(Y=Y[Z],Array.isArray(Y))Y=Y.slice(),Y.unshift(Z);else Y=[Z,Y]}return Y.map(function(Z){return new FD(Z)})})}function V(O){let Y=$(O);return u(Y),z(Y),q(Y),X(Y),Y}Xu.exports={makeTableLayout:V,layoutTable:u,addRowSpanCells:q,maxWidth:F,fillInTable:z,computeWidths:Yu("colSpan","desiredWidth","x",1),computeHeights:Yu("rowSpan","desiredHeight","y",1)}})();function Yu(D,u,F,E){return function(C,B){let H=[],q=[],X={};B.forEach(function(A){A.forEach(function(z){if((z[D]||1)>1)q.push(z);else H[z[F]]=Math.max(H[z[F]]||0,z[u]||0,E)})}),C.forEach(function(A,z){if(typeof A==="number")H[z]=A});for(let A=q.length-1;A>=0;A--){let z=q[A],$=z[D],V=z[F],O=H[V],Y=typeof C[V]==="number"?0:1;if(typeof O==="number"){for(let Z=1;Z<$;Z++)if(O+=1+H[V+Z],typeof C[V+Z]!=="number")Y++}else if(O=u==="desiredWidth"?z.desiredWidth-1:1,!X[V]||X[V]<O)X[V]=O;if(z[u]>O){let Z=0;while(Y>0&&z[u]>O){if(typeof C[V+Z]!=="number"){let G=Math.round((z[u]-O)/Y);O+=G,H[V+Z]+=G,Y--}Z++}}}Object.assign(C,H,X);for(let A=0;A<C.length;A++)C[A]=Math.max(E,C[A]||0)}}});var zu=R((TF,qu)=>{var w=i(),y0=e(),ED=Ou();class BD extends Array{constructor(D){super();let u=y0.mergeOptions(D);if(Object.defineProperty(this,"options",{value:u,enumerable:u.debug}),u.debug){switch(typeof u.debug){case"boolean":w.setDebugLevel(w.WARN);break;case"number":w.setDebugLevel(u.debug);break;case"string":w.setDebugLevel(parseInt(u.debug,10));break;default:w.setDebugLevel(w.WARN),w.warn(`Debug option is expected to be boolean, number, or string. Received a ${typeof u.debug}`)}Object.defineProperty(this,"messages",{get(){return w.debugMessages()}})}}toString(){let D=this,u=this.options.head&&this.options.head.length;if(u){if(D=[this.options.head],this.length)D.push.apply(D,this)}else this.options.style.head=[];let F=ED.makeTableLayout(D);F.forEach(function(C){C.forEach(function(B){B.mergeTableOptions(this.options,F)},this)},this),ED.computeWidths(this.options.colWidths,F),ED.computeHeights(this.options.rowHeights,F),F.forEach(function(C){C.forEach(function(B){B.init(this.options)},this)},this);let E=[];for(let C=0;C<F.length;C++){let B=F[C],H=this.options.rowHeights[C];if(C===0||!this.options.style.compact||C==1&&u)CD(B,"top",E);for(let q=0;q<H;q++)CD(B,q,E);if(C+1==F.length)CD(B,"bottom",E)}return E.join(`
`)}get width(){return this.toString().split(`
`)[0].length}}BD.reset=()=>w.reset();function CD(D,u,F){let E=[];D.forEach(function(B){E.push(B.draw(u))});let C=E.join("");if(C.length)F.push(C)}qu.exports=BD});var Qu=R((_F,Gu)=>{var $u={};Gu.exports=$u;var Zu={reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],grey:[90,39],brightRed:[91,39],brightGreen:[92,39],brightYellow:[93,39],brightBlue:[94,39],brightMagenta:[95,39],brightCyan:[96,39],brightWhite:[97,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgGray:[100,49],bgGrey:[100,49],bgBrightRed:[101,49],bgBrightGreen:[102,49],bgBrightYellow:[103,49],bgBrightBlue:[104,49],bgBrightMagenta:[105,49],bgBrightCyan:[106,49],bgBrightWhite:[107,49],blackBG:[40,49],redBG:[41,49],greenBG:[42,49],yellowBG:[43,49],blueBG:[44,49],magentaBG:[45,49],cyanBG:[46,49],whiteBG:[47,49]};Object.keys(Zu).forEach(function(D){var u=Zu[D],F=$u[D]=[];F.open="\x1B["+u[0]+"m",F.close="\x1B["+u[1]+"m"})});var Ju=R((vF,Uu)=>{Uu.exports=function(D,u){u=u||process.argv||[];var F=u.indexOf("--"),E=/^-{1,2}/.test(D)?"":"--",C=u.indexOf(E+D);return C!==-1&&(F===-1?!0:C<F)}});var fu=R((SF,Ru)=>{var m0=c("os"),S=Ju(),j=process.env,x=void 0;if(S("no-color")||S("no-colors")||S("color=false"))x=!1;else if(S("color")||S("colors")||S("color=true")||S("color=always"))x=!0;if("FORCE_COLOR"in j)x=j.FORCE_COLOR.length===0||parseInt(j.FORCE_COLOR,10)!==0;function p0(D){if(D===0)return!1;return{level:D,hasBasic:!0,has256:D>=2,has16m:D>=3}}function d0(D){if(x===!1)return 0;if(S("color=16m")||S("color=full")||S("color=truecolor"))return 3;if(S("color=256"))return 2;if(D&&!D.isTTY&&x!==!0)return 0;var u=x?1:0;if(process.platform==="win32"){var F=m0.release().split(".");if(Number(process.versions.node.split(".")[0])>=8&&Number(F[0])>=10&&Number(F[2])>=10586)return Number(F[2])>=14931?3:2;return 1}if("CI"in j){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(function(C){return C in j})||j.CI_NAME==="codeship")return 1;return u}if("TEAMCITY_VERSION"in j)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(j.TEAMCITY_VERSION)?1:0;if("TERM_PROGRAM"in j){var E=parseInt((j.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(j.TERM_PROGRAM){case"iTerm.app":return E>=3?3:2;case"Hyper":return 3;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(j.TERM))return 2;if(/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(j.TERM))return 1;if("COLORTERM"in j)return 1;if(j.TERM==="dumb")return u;return u}function AD(D){var u=d0(D);return p0(u)}Ru.exports={supportsColor:AD,stdout:AD(process.stdout),stderr:AD(process.stderr)}});var Ku=R((kF,Vu)=>{Vu.exports=function D(u,F){var E="";u=u||"Run the trap, drop the bass",u=u.split("");var C={a:["@","Ą","Ⱥ","Ʌ","Δ","Λ","Д"],b:["ß","Ɓ","Ƀ","ɮ","β","฿"],c:["©","Ȼ","Ͼ"],d:["Ð","Ɗ","Ԁ","ԁ","Ԃ","ԃ"],e:["Ë","ĕ","Ǝ","ɘ","Σ","ξ","Ҽ","੬"],f:["Ӻ"],g:["ɢ"],h:["Ħ","ƕ","Ң","Һ","Ӈ","Ԋ"],i:["༏"],j:["Ĵ"],k:["ĸ","Ҡ","Ӄ","Ԟ"],l:["Ĺ"],m:["ʍ","Ӎ","ӎ","Ԡ","ԡ","൩"],n:["Ñ","ŋ","Ɲ","Ͷ","Π","Ҋ"],o:["Ø","õ","ø","Ǿ","ʘ","Ѻ","ם","","๏"],p:["Ƿ","Ҏ"],q:["্"],r:["®","Ʀ","Ȑ","Ɍ","ʀ","Я"],s:["§","Ϟ","ϟ","Ϩ"],t:["Ł","Ŧ","ͳ"],u:["Ʊ","Ս"],v:["ט"],w:["Ш","Ѡ","Ѽ","൰"],x:["Ҳ","Ӿ","Ӽ","ӽ"],y:["¥","Ұ","Ӌ"],z:["Ƶ","ɀ"]};return u.forEach(function(B){B=B.toLowerCase();var H=C[B]||[" "],q=Math.floor(Math.random()*H.length);if(typeof C[B]!=="undefined")E+=C[B][q];else E+=B}),E}});var Mu=R((wF,Nu)=>{Nu.exports=function D(u,F){u=u||" he is here ";var E={up:["̍","̎","̄","̅","̿","̑","̆","̐","͒","͗","͑","̇","̈","̊","͂","̓","̈","͊","͋","͌","̃","̂","̌","͐","̀","́","̋","̏","̒","̓","̔","̽","̉","ͣ","ͤ","ͥ","ͦ","ͧ","ͨ","ͩ","ͪ","ͫ","ͬ","ͭ","ͮ","ͯ","̾","͛","͆","̚"],down:["̖","̗","̘","̙","̜","̝","̞","̟","̠","̤","̥","̦","̩","̪","̫","̬","̭","̮","̯","̰","̱","̲","̳","̹","̺","̻","̼","ͅ","͇","͈","͉","͍","͎","͓","͔","͕","͖","͙","͚","̣"],mid:["̕","̛","̀","́","͘","̡","̢","̧","̨","̴","̵","̶","͜","͝","͞","͟","͠","͢","̸","̷","͡"," ҉"]},C=[].concat(E.up,E.down,E.mid);function B(X){var A=Math.floor(Math.random()*X);return A}function H(X){var A=!1;return C.filter(function(z){A=z===X}),A}function q(X,A){var z="",$,V;A=A||{},A.up=typeof A.up!=="undefined"?A.up:!0,A.mid=typeof A.mid!=="undefined"?A.mid:!0,A.down=typeof A.down!=="undefined"?A.down:!0,A.size=typeof A.size!=="undefined"?A.size:"maxi",X=X.split("");for(V in X){if(H(V))continue;switch(z=z+X[V],$={up:0,down:0,mid:0},A.size){case"mini":$.up=B(8),$.mid=B(2),$.down=B(8);break;case"maxi":$.up=B(16)+3,$.mid=B(4)+1,$.down=B(64)+3;break;default:$.up=B(8)+1,$.mid=B(6)/2,$.down=B(8)+1;break}var O=["up","mid","down"];for(var Y in O){var Z=O[Y];for(var G=0;G<=$[Z];G++)if(A[Z])z=z+E[Z][B(E[Z].length)]}}return z}return q(u,F)}});var Iu=R((PF,bu)=>{bu.exports=function(D){return function(u,F,E){if(u===" ")return u;switch(F%3){case 0:return D.red(u);case 1:return D.white(u);case 2:return D.blue(u)}}}});var ju=R((hF,Wu)=>{Wu.exports=function(D){return function(u,F,E){return F%2===0?u:D.inverse(u)}}});var _u=R((LF,Tu)=>{Tu.exports=function(D){var u=["red","yellow","green","blue","magenta"];return function(F,E,C){if(F===" ")return F;else return D[u[E++%u.length]](F)}}});var Su=R((gF,vu)=>{vu.exports=function(D){var u=["underline","inverse","grey","yellow","red","green","blue","white","cyan","magenta","brightYellow","brightRed","brightGreen","brightBlue","brightWhite","brightCyan","brightMagenta"];return function(F,E,C){return F===" "?F:D[u[Math.round(Math.random()*(u.length-2))]](F)}}});var HD=R((yF,Lu)=>{var U={};Lu.exports=U;U.themes={};var c0=c("util"),h=U.styles=Qu(),wu=Object.defineProperties,i0=new RegExp(/[\r\n]+/g);U.supportsColor=fu().supportsColor;if(typeof U.enabled==="undefined")U.enabled=U.supportsColor()!==!1;U.enable=function(){U.enabled=!0};U.disable=function(){U.enabled=!1};U.stripColors=U.strip=function(D){return(""+D).replace(/\x1B\[\d+m/g,"")};var xF=U.stylize=function D(u,F){if(!U.enabled)return u+"";var E=h[F];if(!E&&F in U)return U[F](u);return E.open+u+E.close},r0=/[|\\{}()[\]^$+*?.]/g,n0=function(D){if(typeof D!=="string")throw new TypeError("Expected a string");return D.replace(r0,"\\$&")};function Pu(D){var u=function F(){return s0.apply(F,arguments)};return u._styles=D,u.__proto__=a0,u}var hu=function(){var D={};return h.grey=h.gray,Object.keys(h).forEach(function(u){h[u].closeRe=new RegExp(n0(h[u].close),"g"),D[u]={get:function(){return Pu(this._styles.concat(u))}}}),D}(),a0=wu(function D(){},hu);function s0(){var D=Array.prototype.slice.call(arguments),u=D.map(function(H){if(H!=null&&H.constructor===String)return H;else return c0.inspect(H)}).join(" ");if(!U.enabled||!u)return u;var F=u.indexOf(`
`)!=-1,E=this._styles,C=E.length;while(C--){var B=h[E[C]];if(u=B.open+u.replace(B.closeRe,B.open)+B.close,F)u=u.replace(i0,function(H){return B.close+H+B.open})}return u}U.setTheme=function(D){if(typeof D==="string"){console.log("colors.setTheme now only accepts an object, not a string. If you are trying to set a theme from a file, it is now your (the caller's) responsibility to require the file. The old syntax looked like colors.setTheme(__dirname + '/../themes/generic-logging.js'); The new syntax looks like colors.setTheme(require(__dirname + '/../themes/generic-logging.js'));");return}for(var u in D)(function(F){U[F]=function(E){if(typeof D[F]==="object"){var C=E;for(var B in D[F])C=U[D[F][B]](C);return C}return U[D[F]](E)}})(u)};function o0(){var D={};return Object.keys(hu).forEach(function(u){D[u]={get:function(){return Pu([u])}}}),D}var l0=function D(u,F){var E=F.split("");return E=E.map(u),E.join("")};U.trap=Ku();U.zalgo=Mu();U.maps={};U.maps.america=Iu()(U);U.maps.zebra=ju()(U);U.maps.rainbow=_u()(U);U.maps.random=Su()(U);for(ku in U.maps)(function(D){U[D]=function(u){return l0(U.maps[D],u)}})(ku);var ku;wu(U,o0())});var xu=R((mF,gu)=>{var I=HD();gu.exports=function(){var D=function(E,C){String.prototype.__defineGetter__(E,C)};D("strip",function(){return I.strip(this)}),D("stripColors",function(){return I.strip(this)}),D("trap",function(){return I.trap(this)}),D("zalgo",function(){return I.zalgo(this)}),D("zebra",function(){return I.zebra(this)}),D("rainbow",function(){return I.rainbow(this)}),D("random",function(){return I.random(this)}),D("america",function(){return I.america(this)});var u=Object.keys(I.styles);u.forEach(function(E){D(E,function(){return I.stylize(this,E)})});function F(E){var C=["__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__","charAt","constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf","charCodeAt","indexOf","lastIndexOf","length","localeCompare","match","repeat","replace","search","slice","split","substring","toLocaleLowerCase","toLocaleUpperCase","toLowerCase","toUpperCase","trim","trimLeft","trimRight"];Object.keys(E).forEach(function(B){if(C.indexOf(B)!==-1)console.log("warn: ".red+("String.prototype"+B).magenta+" is probably something you don't want to override. Ignoring style name");else if(typeof E[B]==="string")I[B]=I[E[B]],D(B,function(){return I[B](this)});else{var H=function(q){var X=q||this;for(var A=0;A<E[B].length;A++)X=I[E[B][A]](X);return X};D(B,H),I[B]=function(q){return H(q)}}})}I.setTheme=function(E){if(typeof E==="string"){console.log("colors.setTheme now only accepts an object, not a string. If you are trying to set a theme from a file, it is now your (the caller's) responsibility to require the file. The old syntax looked like colors.setTheme(__dirname + '/../themes/generic-logging.js'); The new syntax looks like colors.setTheme(require(__dirname + '/../themes/generic-logging.js'));");return}else F(E)}}});var mu=R((pF,yu)=>{var t0=HD();yu.exports=t0;xu()()});import{rpc as qD,StrKey as EF}from"@stellar/stellar-sdk";var cu=ZD(zu(),1),_=ZD(mu(),1);var K={mem_bytes:{value:41943040,unit:"bytes",label:"40 MB"},cpu_insns:{value:1e8,unit:"bytes",label:"100 Million"},entry_reads:{value:40,unit:"count",label:"40"},entry_writes:{value:25,unit:"count",label:"25"},read_bytes:{value:204800,unit:"bytes",label:"200 KB"},write_bytes:{value:132096,unit:"bytes",label:"129 KB"},entry_bytes:{value:131072,unit:"bytes",label:"128 KB"},min_txn_bytes:{value:132096,unit:"bytes",label:"129 KB"}},pu=(D)=>{return{...K,...D}},du=["cpu_insns","mem_bytes","entry_bytes","entry_reads","entry_writes","read_bytes","write_bytes","min_txn_bytes"];var e0=(D)=>{let u={},F=["cpu_insns","mem_bytes","entry_bytes","entry_reads","entry_writes","read_bytes","write_bytes","min_txn_bytes"];return Object.entries(D).forEach(([E,C])=>{u[E]={},Object.entries(C).forEach(([B,H])=>{let q=H.length;F.forEach((X)=>{if(!H[0][X])return;let A=0,z=H[0][X],$=H[0][X];H.forEach((O)=>{let Y=O[X]||0;if(A+=Y,Y>z)z=Y;if(Y<$)$=Y});let V=A/q;if(!u[E])u[E]={};if(!u[E][B])u[E][B]={};u[E][B][X]={avg:V,max:z,min:$,sum:A}}),u[E][B].times=q})}),u},DF=(D)=>{let u=[];return Object.entries(D).forEach(([F,E])=>{Object.entries(E).forEach(([C,B])=>{let H=B.times,q=[];du.forEach((X)=>{if(!B[X])return;let{avg:A,max:z,min:$,sum:V}=B[X],O=K[X].value;q.push([X,O,A,z,$,V])}),u.push({func:C,times:H,data:q})})}),u},XD=(D,u)=>{let F=new cu.default({style:{head:[],border:[]}});F.push([{colSpan:6,content:_.default.brightCyan.bold("Resource Usage Table"),hAlign:"center"}]);let E=[{content:_.default.brightCyan.bold("Highligh Color"),colSpan:2},{content:_.default.brightYellow.bold(`Warning: ${0.8*100}% - ${1*100}%`),colSpan:2},{content:_.default.brightRed.bold(`Error: Over ${1*100}%`),colSpan:2}],C=[{content:_.default.brightCyan.bold("Contract"),colSpan:2},{content:D,colSpan:4}];F.push(E),F.push(C);let B=e0(u);DF(B).forEach(({func:q,times:X,data:A})=>{let z=[_.default.brightCyan.bold("Function"),{content:q,colSpan:2},_.default.brightCyan.bold("Times"),{content:X,colSpan:2}];F.push(z);let $=["Resource","Limitation","Avg","Max","Min","Sum"].map((V)=>_.default.brightCyan.bold(V));F.push($),A.forEach(([V,O,Y,Z,G,f])=>{let J=YD(Y,O),N=YD(Z,O),M=YD(G,O);F.push([_.default.brightCyan.bold(V),O,J,N,M,f])})}),console.log(F.toString())},YD=(D,u)=>{let F=parseFloat((Number(D)/Number(u)*100).toFixed(2)),E=F>0.8*100;if(F>1*100)return _.default.brightRed.bold(D.toString());if(E)return _.default.brightYellow.bold(D.toString());return D};import{scValToNative as iu}from"@stellar/stellar-sdk";var uF=(D)=>{return"transactionData"in D},OD=(D,u)=>{let F;if(uF(D))F=D.transactionData.build().resources();else F=D.simulationData.transactionData.resources();let E=F.footprint(),C={cpu_insn:void 0,mem_byte:void 0,ledger_read_byte:void 0,ledger_write_byte:void 0};u.resultMetaXdr.v3().sorobanMeta()?.diagnosticEvents().forEach((q)=>{let X=q.event().body().v0(),A=X.topics().map(iu);if(!A.includes("core_metrics"))return;let z=Object.keys(C).find(($)=>A.includes($));if(z)C[z]=Number(iu(X.data()))});let B=u.resultMetaXdr.v3().operations().flatMap((q)=>q.changes().flatMap((X)=>{switch(X.switch().name){case"ledgerEntryCreated":return X.created().data().value().toXDR().length;case"ledgerEntryUpdated":return X.updated().data().value().toXDR().length;default:return 0}})),H=Math.max(...B)??0;return{cpu_insns:C.cpu_insn,mem_bytes:C.mem_byte,entry_bytes:H,entry_reads:E.readOnly().length,entry_writes:E.readWrite().length,read_bytes:F.readBytes(),write_bytes:F.writeBytes(),min_txn_bytes:u.envelopeXdr.toXDR().length}};var ru=async(D="public")=>{try{let u=await fetch(`https://api.stellar.expert/explorer/${D}/ledger/protocol-history`);if(!u.ok)throw new Error(`HTTP error! status: ${u.status}`);return await u.json()}catch(u){console.log(u)}};var nu=1735537317419,au=async()=>{if(Date.now()-nu<3600000)return;nu=Date.now();try{let F=(await ru()).map((C)=>{return FF(C.config_changes,["contractCompute","contractLedgerCost","contractBandwidth"])}).reverse().reduce((C,B)=>{return{...C,...B}},{}),E={...K,cpu_insns:{...K.cpu_insns,value:F.contractCompute.txMaxInstructions??K.cpu_insns.value},mem_bytes:{...K.mem_bytes,value:F.contractLedgerCost.txMemoryLimit??K.mem_bytes.value},entry_reads:{...K.entry_reads,value:F.contractLedgerCost.txMaxReadLedgerEntries??K.entry_reads.value},entry_writes:{...K.entry_writes,value:F.contractLedgerCost.txMaxWriteLedgerEntries??K.entry_writes.value},read_bytes:{...K.read_bytes,value:F.contractLedgerCost.txMaxReadBytes??K.read_bytes.value},write_bytes:{...K.write_bytes,value:F.contractLedgerCost.txMaxWriteBytes??K.write_bytes.value},min_txn_bytes:{...K.min_txn_bytes,value:F.contractBandwidth.txMaxSizeBytes??K.min_txn_bytes.value}};pu(E)}catch(D){console.log(D)}};function FF(D,u){if(Object.prototype.toString.call(D)==="[object Object]"){let F={};return Object.entries(D).forEach(([E,C])=>{if(u.includes(E))F[E]=C}),F}}async function su(D,u,F,E=1.5,C=!1){let B=[],H=0;if(B.push(await D()),!u(B[B.length-1]))return B;let q=new Date(Date.now()+F*1000).valueOf(),X=1000,A=X;while(Date.now()<q&&u(B[B.length-1])){if(H+=1,C)console.info(`Waiting ${X}ms before trying again (bringing the total wait time to ${A}ms so far, of total ${F*1000}ms)`);if(await new Promise((z)=>setTimeout(z,X)),X*=E,new Date(Date.now()+X).valueOf()>q){if(X=q-Date.now(),C)console.info(`was gonna wait too long; new waitTime: ${X}ms`)}if(A=X+A,B.push(await D(B[B.length-1])),C&&u(B[B.length-1]))console.info(`${H}. Called ${D}; ${B.length} prev attempts. Most recent: ${JSON.stringify(B[B.length-1],null,2)}`)}return B}class CF extends qD.Server{#D=new Map;transaction;simTxRes;storedStats={};constructor(D,u){super(D,u)}async printTable(){let D=Array.from(this.#D).map(([u])=>{return su(()=>super.getTransaction(u),(F)=>F.status===qD.Api.GetTransactionStatus.NOT_FOUND,10)});try{(await Promise.all(D)).forEach((F)=>{let E=F.find((C)=>C.status===qD.Api.GetTransactionStatus.SUCCESS);if(E){let{simTxRes:C,transaction:B}=this.#D.get(E.txHash),H=OD(C,E);this.storeTransactionStats(B,H)}else console.log("Failed to get transaction")})}catch(u){console.log("Failed to get transactions",u)}Object.keys(this.storedStats).forEach((u)=>{XD(u,this.storedStats)}),this.#D.clear(),this.storedStats={}}async simulateTransaction(D,u){let F=await super.simulateTransaction(D,u);return this.transaction=D,this.simTxRes=F,F}async sendTransaction(D){let u=await super.sendTransaction(D);return this.#D.set(u.hash,{sendTxRes:u,transaction:this.transaction,simTxRes:this.simTxRes}),this.transaction=void 0,this.simTxRes=void 0,u}storeTransactionStats(D,u){D.operations.forEach((F)=>{if(F.type==="invokeHostFunction"){let E=EF.encodeContract(F.func.invokeContract().contractAddress().value()),C=F.func.invokeContract().functionName();if(!this.storedStats[E])this.storedStats[E]={};if(!this.storedStats[E][C])this.storedStats[E][C]=[u];else this.storedStats[E][C].