ccpet
Version:
A Claude Code status line script that displays a virtual pet
9 lines • 115 kB
JavaScript
#!/usr/bin/env node
"use strict";var Cs=Object.create;var ge=Object.defineProperty;var Fs=Object.getOwnPropertyDescriptor;var Es=Object.getOwnPropertyNames;var bs=Object.getPrototypeOf,Ss=Object.prototype.hasOwnProperty;var S=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),vs=(r,e)=>{for(var t in e)ge(r,t,{get:e[t],enumerable:!0})},ze=(r,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Es(e))!Ss.call(r,o)&&o!==t&&ge(r,o,{get:()=>e[o],enumerable:!(s=Fs(e,o))||s.enumerable});return r};var w=(r,e,t)=>(t=r!=null?Cs(bs(r)):{},ze(e||!r||!r.__esModule?ge(t,"default",{value:r,enumerable:!0}):t,r)),Ts=r=>ze(ge({},"__esModule",{value:!0}),r);var we=S((Nn,gt)=>{var Ue=[],pt=0,A=(r,e)=>{pt>=e&&Ue.push(r)};A.WARN=1;A.INFO=2;A.DEBUG=3;A.reset=()=>{Ue=[]};A.setDebugLevel=r=>{pt=r};A.warn=r=>A(r,A.WARN);A.info=r=>A(r,A.INFO);A.debug=r=>A(r,A.DEBUG);A.debugMessages=()=>Ue;gt.exports=A});var ft=S((Bn,ht)=>{"use strict";ht.exports=({onlyFirst:r=!1}={})=>{let e=["[\\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(e,r?void 0:"g")}});var yt=S((Ln,mt)=>{"use strict";var Ms=ft();mt.exports=r=>typeof r=="string"?r.replace(Ms(),""):r});var Ft=S((On,je)=>{"use strict";var Ct=r=>Number.isNaN(r)?!1:r>=4352&&(r<=4447||r===9001||r===9002||11904<=r&&r<=12871&&r!==12351||12880<=r&&r<=19903||19968<=r&&r<=42182||43360<=r&&r<=43388||44032<=r&&r<=55203||63744<=r&&r<=64255||65040<=r&&r<=65049||65072<=r&&r<=65131||65281<=r&&r<=65376||65504<=r&&r<=65510||110592<=r&&r<=110593||127488<=r&&r<=127569||131072<=r&&r<=262141);je.exports=Ct;je.exports.default=Ct});var bt=S(($n,Et)=>{"use strict";Et.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 vt=S((Mn,Ge)=>{"use strict";var Us=yt(),js=Ft(),Gs=bt(),St=r=>{if(typeof r!="string"||r.length===0||(r=Us(r),r.length===0))return 0;r=r.replace(Gs()," ");let e=0;for(let t=0;t<r.length;t++){let s=r.codePointAt(t);s<=31||s>=127&&s<=159||s>=768&&s<=879||(s>65535&&t++,e+=js(s)?2:1)}return e};Ge.exports=St;Ge.exports.default=St});var qe=S((Un,At)=>{var Tt=vt();function _e(r){return r?/\u001b\[((?:\d*;){0,5}\d*)m/g:/\u001b\[(?:\d*;){0,5}\d*m/g}function j(r){let e=_e();return(""+r).replace(e,"").split(`
`).reduce(function(o,n){return Tt(n)>o?Tt(n):o},0)}function le(r,e){return Array(e+1).join(r)}function qs(r,e,t,s){let o=j(r);if(e+1>=o){let n=e-o;switch(s){case"right":{r=le(t,n)+r;break}case"center":{let i=Math.ceil(n/2),a=n-i;r=le(t,a)+r+le(t,i);break}default:{r=r+le(t,n);break}}}return r}var se={};function De(r,e,t){e="\x1B["+e+"m",t="\x1B["+t+"m",se[e]={set:r,to:!0},se[t]={set:r,to:!1},se[r]={on:e,off:t}}De("bold",1,22);De("italics",3,23);De("underline",4,24);De("inverse",7,27);De("strikethrough",9,29);function wt(r,e){let t=e[1]?parseInt(e[1].split(";")[0]):0;if(t>=30&&t<=39||t>=90&&t<=97){r.lastForegroundAdded=e[0];return}if(t>=40&&t<=49||t>=100&&t<=107){r.lastBackgroundAdded=e[0];return}if(t===0){for(let o in r)Object.prototype.hasOwnProperty.call(r,o)&&delete r[o];return}let s=se[e[0]];s&&(r[s.set]=s.to)}function Ys(r){let e=_e(!0),t=e.exec(r),s={};for(;t!==null;)wt(s,t),t=e.exec(r);return s}function _t(r,e){let t=r.lastBackgroundAdded,s=r.lastForegroundAdded;return delete r.lastBackgroundAdded,delete r.lastForegroundAdded,Object.keys(r).forEach(function(o){r[o]&&(e+=se[o].off)}),t&&t!="\x1B[49m"&&(e+="\x1B[49m"),s&&s!="\x1B[39m"&&(e+="\x1B[39m"),e}function Hs(r,e){let t=r.lastBackgroundAdded,s=r.lastForegroundAdded;return delete r.lastBackgroundAdded,delete r.lastForegroundAdded,Object.keys(r).forEach(function(o){r[o]&&(e=se[o].on+e)}),t&&t!="\x1B[49m"&&(e=t+e),s&&s!="\x1B[39m"&&(e=s+e),e}function Ws(r,e){if(r.length===j(r))return r.substr(0,e);for(;j(r)>e;)r=r.slice(0,-1);return r}function Ks(r,e){let t=_e(!0),s=r.split(_e()),o=0,n=0,i="",a,u={};for(;n<e;){a=t.exec(r);let c=s[o];if(o++,n+j(c)>e&&(c=Ws(c,e-n)),i+=c,n+=j(c),n<e){if(!a)break;i+=a[0],wt(u,a)}}return _t(u,i)}function Js(r,e,t){if(t=t||"\u2026",j(r)<=e)return r;e-=j(t);let o=Ks(r,e);o+=t;let n="\x1B]8;;\x07";return r.includes(n)&&!o.includes(n)&&(o+=n),o}function Vs(){return{chars:{top:"\u2500","top-mid":"\u252C","top-left":"\u250C","top-right":"\u2510",bottom:"\u2500","bottom-mid":"\u2534","bottom-left":"\u2514","bottom-right":"\u2518",left:"\u2502","left-mid":"\u251C",mid:"\u2500","mid-mid":"\u253C",right:"\u2502","right-mid":"\u2524",middle:"\u2502"},truncate:"\u2026",colWidths:[],rowHeights:[],colAligns:[],rowAligns:[],style:{"padding-left":1,"padding-right":1,head:["red"],border:["grey"],compact:!1},head:[]}}function Xs(r,e){r=r||{},e=e||Vs();let t=Object.assign({},e,r);return t.chars=Object.assign({},e.chars,r.chars),t.style=Object.assign({},e.style,r.style),t}function zs(r,e){let t=[],s=e.split(/(\s+)/g),o=[],n=0,i;for(let a=0;a<s.length;a+=2){let u=s[a],c=n+j(u);n>0&&i&&(c+=i.length),c>r?(n!==0&&t.push(o.join("")),o=[u],n=j(u)):(o.push(i||"",u),n=c),i=s[a+1]}return n&&t.push(o.join("")),t}function Zs(r,e){let t=[],s="";function o(i,a){for(s.length&&a&&(s+=a),s+=i;s.length>r;)t.push(s.slice(0,r)),s=s.slice(r)}let n=e.split(/(\s+)/g);for(let i=0;i<n.length;i+=2)o(n[i],i&&n[i-1]);return s.length&&t.push(s),t}function Qs(r,e,t=!0){let s=[];e=e.split(`
`);let o=t?zs:Zs;for(let n=0;n<e.length;n++)s.push.apply(s,o(r,e[n]));return s}function eo(r){let e={},t=[];for(let s=0;s<r.length;s++){let o=Hs(e,r[s]);e=Ys(o);let n=Object.assign({},e);t.push(_t(n,o))}return t}function to(r,e){let t="\x1B]",s="\x07",o=";";return[t,"8",o,o,r||e,s,e,t,"8",o,o,s].join("")}At.exports={strlen:j,repeat:le,pad:qs,truncate:Js,mergeOptions:Xs,wordWrap:Qs,colorizeLines:eo,hyperlink:to}});var Pt=S((jn,Rt)=>{var kt={};Rt.exports=kt;var xt={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(xt).forEach(function(r){var e=xt[r],t=kt[r]=[];t.open="\x1B["+e[0]+"m",t.close="\x1B["+e[1]+"m"})});var Nt=S((Gn,It)=>{"use strict";It.exports=function(r,e){e=e||process.argv;var t=e.indexOf("--"),s=/^-{1,2}/.test(r)?"":"--",o=e.indexOf(s+r);return o!==-1&&(t===-1?!0:o<t)}});var Lt=S((qn,Bt)=>{"use strict";var so=require("os"),O=Nt(),x=process.env,oe=void 0;O("no-color")||O("no-colors")||O("color=false")?oe=!1:(O("color")||O("colors")||O("color=true")||O("color=always"))&&(oe=!0);"FORCE_COLOR"in x&&(oe=x.FORCE_COLOR.length===0||parseInt(x.FORCE_COLOR,10)!==0);function oo(r){return r===0?!1:{level:r,hasBasic:!0,has256:r>=2,has16m:r>=3}}function no(r){if(oe===!1)return 0;if(O("color=16m")||O("color=full")||O("color=truecolor"))return 3;if(O("color=256"))return 2;if(r&&!r.isTTY&&oe!==!0)return 0;var e=oe?1:0;if(process.platform==="win32"){var t=so.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(t[0])>=10&&Number(t[2])>=10586?Number(t[2])>=14931?3:2:1}if("CI"in x)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(function(o){return o in x})||x.CI_NAME==="codeship"?1:e;if("TEAMCITY_VERSION"in x)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(x.TEAMCITY_VERSION)?1:0;if("TERM_PROGRAM"in x){var s=parseInt((x.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(x.TERM_PROGRAM){case"iTerm.app":return s>=3?3:2;case"Hyper":return 3;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(x.TERM)?2:/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(x.TERM)||"COLORTERM"in x?1:(x.TERM==="dumb",e)}function Ye(r){var e=no(r);return oo(e)}Bt.exports={supportsColor:Ye,stdout:Ye(process.stdout),stderr:Ye(process.stderr)}});var $t=S((Yn,Ot)=>{Ot.exports=function(e,t){var s="";e=e||"Run the trap, drop the bass",e=e.split("");var o={a:["@","\u0104","\u023A","\u0245","\u0394","\u039B","\u0414"],b:["\xDF","\u0181","\u0243","\u026E","\u03B2","\u0E3F"],c:["\xA9","\u023B","\u03FE"],d:["\xD0","\u018A","\u0500","\u0501","\u0502","\u0503"],e:["\xCB","\u0115","\u018E","\u0258","\u03A3","\u03BE","\u04BC","\u0A6C"],f:["\u04FA"],g:["\u0262"],h:["\u0126","\u0195","\u04A2","\u04BA","\u04C7","\u050A"],i:["\u0F0F"],j:["\u0134"],k:["\u0138","\u04A0","\u04C3","\u051E"],l:["\u0139"],m:["\u028D","\u04CD","\u04CE","\u0520","\u0521","\u0D69"],n:["\xD1","\u014B","\u019D","\u0376","\u03A0","\u048A"],o:["\xD8","\xF5","\xF8","\u01FE","\u0298","\u047A","\u05DD","\u06DD","\u0E4F"],p:["\u01F7","\u048E"],q:["\u09CD"],r:["\xAE","\u01A6","\u0210","\u024C","\u0280","\u042F"],s:["\xA7","\u03DE","\u03DF","\u03E8"],t:["\u0141","\u0166","\u0373"],u:["\u01B1","\u054D"],v:["\u05D8"],w:["\u0428","\u0460","\u047C","\u0D70"],x:["\u04B2","\u04FE","\u04FC","\u04FD"],y:["\xA5","\u04B0","\u04CB"],z:["\u01B5","\u0240"]};return e.forEach(function(n){n=n.toLowerCase();var i=o[n]||[" "],a=Math.floor(Math.random()*i.length);typeof o[n]<"u"?s+=o[n][a]:s+=n}),s}});var Ut=S((Hn,Mt)=>{Mt.exports=function(e,t){e=e||" he is here ";var s={up:["\u030D","\u030E","\u0304","\u0305","\u033F","\u0311","\u0306","\u0310","\u0352","\u0357","\u0351","\u0307","\u0308","\u030A","\u0342","\u0313","\u0308","\u034A","\u034B","\u034C","\u0303","\u0302","\u030C","\u0350","\u0300","\u0301","\u030B","\u030F","\u0312","\u0313","\u0314","\u033D","\u0309","\u0363","\u0364","\u0365","\u0366","\u0367","\u0368","\u0369","\u036A","\u036B","\u036C","\u036D","\u036E","\u036F","\u033E","\u035B","\u0346","\u031A"],down:["\u0316","\u0317","\u0318","\u0319","\u031C","\u031D","\u031E","\u031F","\u0320","\u0324","\u0325","\u0326","\u0329","\u032A","\u032B","\u032C","\u032D","\u032E","\u032F","\u0330","\u0331","\u0332","\u0333","\u0339","\u033A","\u033B","\u033C","\u0345","\u0347","\u0348","\u0349","\u034D","\u034E","\u0353","\u0354","\u0355","\u0356","\u0359","\u035A","\u0323"],mid:["\u0315","\u031B","\u0300","\u0301","\u0358","\u0321","\u0322","\u0327","\u0328","\u0334","\u0335","\u0336","\u035C","\u035D","\u035E","\u035F","\u0360","\u0362","\u0338","\u0337","\u0361"," \u0489"]},o=[].concat(s.up,s.down,s.mid);function n(u){var c=Math.floor(Math.random()*u);return c}function i(u){var c=!1;return o.filter(function(d){c=d===u}),c}function a(u,c){var d="",y,b;c=c||{},c.up=typeof c.up<"u"?c.up:!0,c.mid=typeof c.mid<"u"?c.mid:!0,c.down=typeof c.down<"u"?c.down:!0,c.size=typeof c.size<"u"?c.size:"maxi",u=u.split("");for(b in u)if(!i(b)){switch(d=d+u[b],y={up:0,down:0,mid:0},c.size){case"mini":y.up=n(8),y.mid=n(2),y.down=n(8);break;case"maxi":y.up=n(16)+3,y.mid=n(4)+1,y.down=n(64)+3;break;default:y.up=n(8)+1,y.mid=n(6)/2,y.down=n(8)+1;break}var p=["up","mid","down"];for(var l in p)for(var g=p[l],f=0;f<=y[g];f++)c[g]&&(d=d+s[g][n(s[g].length)])}return d}return a(e,t)}});var Gt=S((Wn,jt)=>{jt.exports=function(r){return function(e,t,s){if(e===" ")return e;switch(t%3){case 0:return r.red(e);case 1:return r.white(e);case 2:return r.blue(e)}}}});var Yt=S((Kn,qt)=>{qt.exports=function(r){return function(e,t,s){return t%2===0?e:r.inverse(e)}}});var Wt=S((Jn,Ht)=>{Ht.exports=function(r){var e=["red","yellow","green","blue","magenta"];return function(t,s,o){return t===" "?t:r[e[s++%e.length]](t)}}});var Jt=S((Vn,Kt)=>{Kt.exports=function(r){var e=["underline","inverse","grey","yellow","red","green","blue","white","cyan","magenta","brightYellow","brightRed","brightGreen","brightBlue","brightWhite","brightCyan","brightMagenta"];return function(t,s,o){return t===" "?t:r[e[Math.round(Math.random()*(e.length-2))]](t)}}});var es=S((zn,Qt)=>{var C={};Qt.exports=C;C.themes={};var ro=require("util"),Q=C.styles=Pt(),Xt=Object.defineProperties,io=new RegExp(/[\r\n]+/g);C.supportsColor=Lt().supportsColor;typeof C.enabled>"u"&&(C.enabled=C.supportsColor()!==!1);C.enable=function(){C.enabled=!0};C.disable=function(){C.enabled=!1};C.stripColors=C.strip=function(r){return(""+r).replace(/\x1B\[\d+m/g,"")};var Xn=C.stylize=function(e,t){if(!C.enabled)return e+"";var s=Q[t];return!s&&t in C?C[t](e):s.open+e+s.close},ao=/[|\\{}()[\]^$+*?.]/g,uo=function(r){if(typeof r!="string")throw new TypeError("Expected a string");return r.replace(ao,"\\$&")};function zt(r){var e=function t(){return lo.apply(t,arguments)};return e._styles=r,e.__proto__=co,e}var Zt=function(){var r={};return Q.grey=Q.gray,Object.keys(Q).forEach(function(e){Q[e].closeRe=new RegExp(uo(Q[e].close),"g"),r[e]={get:function(){return zt(this._styles.concat(e))}}}),r}(),co=Xt(function(){},Zt);function lo(){var r=Array.prototype.slice.call(arguments),e=r.map(function(i){return i!=null&&i.constructor===String?i:ro.inspect(i)}).join(" ");if(!C.enabled||!e)return e;for(var t=e.indexOf(`
`)!=-1,s=this._styles,o=s.length;o--;){var n=Q[s[o]];e=n.open+e.replace(n.closeRe,n.open)+n.close,t&&(e=e.replace(io,function(i){return n.close+i+n.open}))}return e}C.setTheme=function(r){if(typeof r=="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 e in r)(function(t){C[t]=function(s){if(typeof r[t]=="object"){var o=s;for(var n in r[t])o=C[r[t][n]](o);return o}return C[r[t]](s)}})(e)};function Do(){var r={};return Object.keys(Zt).forEach(function(e){r[e]={get:function(){return zt([e])}}}),r}var po=function(e,t){var s=t.split("");return s=s.map(e),s.join("")};C.trap=$t();C.zalgo=Ut();C.maps={};C.maps.america=Gt()(C);C.maps.zebra=Yt()(C);C.maps.rainbow=Wt()(C);C.maps.random=Jt()(C);for(Vt in C.maps)(function(r){C[r]=function(e){return po(C.maps[r],e)}})(Vt);var Vt;Xt(C,Do())});var ss=S((Zn,ts)=>{var go=es();ts.exports=go});var is=S((Qn,Ae)=>{var{info:ho,debug:rs}=we(),N=qe(),We=class r{constructor(e){this.setOptions(e),this.x=null,this.y=null}setOptions(e){["boolean","number","bigint","string"].indexOf(typeof e)!==-1&&(e={content:""+e}),e=e||{},this.options=e;let t=e.content;if(["boolean","number","bigint","string"].indexOf(typeof t)!==-1)this.content=String(t);else if(!t)this.content=this.options.href||"";else throw new Error("Content needs to be a primitive, got: "+typeof t);this.colSpan=e.colSpan||1,this.rowSpan=e.rowSpan||1,this.options.href&&Object.defineProperty(this,"href",{get(){return this.options.href}})}mergeTableOptions(e,t){this.cells=t;let s=this.options.chars||{},o=e.chars,n=this.chars={};mo.forEach(function(u){He(s,o,u,n)}),this.truncate=this.options.truncate||e.truncate;let i=this.options.style=this.options.style||{},a=e.style;He(i,a,"padding-left",this),He(i,a,"padding-right",this),this.head=i.head||a.head,this.border=i.border||a.border,this.fixedWidth=e.colWidths[this.x],this.lines=this.computeLines(e),this.desiredWidth=N.strlen(this.content)+this.paddingLeft+this.paddingRight,this.desiredHeight=this.lines.length}computeLines(e){let t=e.wordWrap||e.textWrap,{wordWrap:s=t}=this.options;if(this.fixedWidth&&s){if(this.fixedWidth-=this.paddingLeft+this.paddingRight,this.colSpan){let i=1;for(;i<this.colSpan;)this.fixedWidth+=e.colWidths[this.x+i],i++}let{wrapOnWordBoundary:o=!0}=e,{wrapOnWordBoundary:n=o}=this.options;return this.wrapLines(N.wordWrap(this.fixedWidth,this.content,n))}return this.wrapLines(this.content.split(`
`))}wrapLines(e){let t=N.colorizeLines(e);return this.href?t.map(s=>N.hyperlink(this.href,s)):t}init(e){let t=this.x,s=this.y;this.widths=e.colWidths.slice(t,t+this.colSpan),this.heights=e.rowHeights.slice(s,s+this.rowSpan),this.width=this.widths.reduce(ns,-1),this.height=this.heights.reduce(ns,-1),this.hAlign=this.options.hAlign||e.colAligns[t],this.vAlign=this.options.vAlign||e.rowAligns[s],this.drawRight=t+this.colSpan==e.colWidths.length}draw(e,t){if(e=="top")return this.drawTop(this.drawRight);if(e=="bottom")return this.drawBottom(this.drawRight);let s=N.truncate(this.content,10,this.truncate);e||ho(`${this.y}-${this.x}: ${this.rowSpan-e}x${this.colSpan} Cell ${s}`);let o=Math.max(this.height-this.lines.length,0),n;switch(this.vAlign){case"center":n=Math.ceil(o/2);break;case"bottom":n=o;break;default:n=0}if(e<n||e>=n+this.lines.length)return this.drawEmpty(this.drawRight,t);let i=this.lines.length>this.height&&e+1>=this.height;return this.drawLine(e-n,this.drawRight,i,t)}drawTop(e){let t=[];return this.cells?this.widths.forEach(function(s,o){t.push(this._topLeftChar(o)),t.push(N.repeat(this.chars[this.y==0?"top":"mid"],s))},this):(t.push(this._topLeftChar(0)),t.push(N.repeat(this.chars[this.y==0?"top":"mid"],this.width))),e&&t.push(this.chars[this.y==0?"topRight":"rightMid"]),this.wrapWithStyleColors("border",t.join(""))}_topLeftChar(e){let t=this.x+e,s;if(this.y==0)s=t==0?"topLeft":e==0?"topMid":"top";else if(t==0)s="leftMid";else if(s=e==0?"midMid":"bottomMid",this.cells&&(this.cells[this.y-1][t]instanceof r.ColSpanCell&&(s=e==0?"topMid":"mid"),e==0)){let n=1;for(;this.cells[this.y][t-n]instanceof r.ColSpanCell;)n++;this.cells[this.y][t-n]instanceof r.RowSpanCell&&(s="leftMid")}return this.chars[s]}wrapWithStyleColors(e,t){if(this[e]&&this[e].length)try{let s=ss();for(let o=this[e].length-1;o>=0;o--)s=s[this[e][o]];return s(t)}catch{return t}else return t}drawLine(e,t,s,o){let n=this.chars[this.x==0?"left":"middle"];if(this.x&&o&&this.cells){let b=this.cells[this.y+o][this.x-1];for(;b instanceof de;)b=this.cells[b.y][b.x-1];b instanceof pe||(n=this.chars.rightMid)}let i=N.repeat(" ",this.paddingLeft),a=t?this.chars.right:"",u=N.repeat(" ",this.paddingRight),c=this.lines[e],d=this.width-(this.paddingLeft+this.paddingRight);s&&(c+=this.truncate||"\u2026");let y=N.truncate(c,d,this.truncate);return y=N.pad(y,d," ",this.hAlign),y=i+y+u,this.stylizeLine(n,y,a)}stylizeLine(e,t,s){return e=this.wrapWithStyleColors("border",e),s=this.wrapWithStyleColors("border",s),this.y===0&&(t=this.wrapWithStyleColors("head",t)),e+t+s}drawBottom(e){let t=this.chars[this.x==0?"bottomLeft":"bottomMid"],s=N.repeat(this.chars.bottom,this.width),o=e?this.chars.bottomRight:"";return this.wrapWithStyleColors("border",t+s+o)}drawEmpty(e,t){let s=this.chars[this.x==0?"left":"middle"];if(this.x&&t&&this.cells){let i=this.cells[this.y+t][this.x-1];for(;i instanceof de;)i=this.cells[i.y][i.x-1];i instanceof pe||(s=this.chars.rightMid)}let o=e?this.chars.right:"",n=N.repeat(" ",this.width);return this.stylizeLine(s,n,o)}},de=class{constructor(){}draw(e){return typeof e=="number"&&rs(`${this.y}-${this.x}: 1x1 ColSpanCell`),""}init(){}mergeTableOptions(){}},pe=class{constructor(e){this.originalCell=e}init(e){let t=this.y,s=this.originalCell.y;this.cellOffset=t-s,this.offset=fo(e.rowHeights,s,this.cellOffset)}draw(e){return e=="top"?this.originalCell.draw(this.offset,this.cellOffset):e=="bottom"?this.originalCell.draw("bottom"):(rs(`${this.y}-${this.x}: 1x${this.colSpan} RowSpanCell for ${this.originalCell.content}`),this.originalCell.draw(this.offset+1+e))}mergeTableOptions(){}};function os(...r){return r.filter(e=>e!=null).shift()}function He(r,e,t,s){let o=t.split("-");o.length>1?(o[1]=o[1].charAt(0).toUpperCase()+o[1].substr(1),o=o.join(""),s[o]=os(r[o],r[t],e[o],e[t])):s[t]=os(r[t],e[t])}function fo(r,e,t){let s=r[e];for(let o=1;o<t;o++)s+=1+r[e+o];return s}function ns(r,e){return r+e+1}var mo=["top","top-mid","top-left","top-right","bottom","bottom-mid","bottom-left","bottom-right","left","left-mid","mid","mid-mid","right","right-mid","middle"];Ae.exports=We;Ae.exports.ColSpanCell=de;Ae.exports.RowSpanCell=pe});var cs=S((er,us)=>{var{warn:yo,debug:Co}=we(),Ke=is(),{ColSpanCell:Fo,RowSpanCell:Eo}=Ke;(function(){function r(p,l){return p[l]>0?r(p,l+1):l}function e(p){let l={};p.forEach(function(g,f){let F=0;g.forEach(function(m){m.y=f,m.x=f?r(l,F):F;let h=m.rowSpan||1,D=m.colSpan||1;if(h>1)for(let v=0;v<D;v++)l[m.x+v]=h;F=m.x+D}),Object.keys(l).forEach(m=>{l[m]--,l[m]<1&&delete l[m]})})}function t(p){let l=0;return p.forEach(function(g){g.forEach(function(f){l=Math.max(l,f.x+(f.colSpan||1))})}),l}function s(p){return p.length}function o(p,l){let g=p.y,f=p.y-1+(p.rowSpan||1),F=l.y,m=l.y-1+(l.rowSpan||1),h=!(g>m||F>f),D=p.x,v=p.x-1+(p.colSpan||1),K=l.x,Ie=l.x-1+(l.colSpan||1),ys=!(D>Ie||K>v);return h&&ys}function n(p,l,g){let f=Math.min(p.length-1,g),F={x:l,y:g};for(let m=0;m<=f;m++){let h=p[m];for(let D=0;D<h.length;D++)if(o(F,h[D]))return!0}return!1}function i(p,l,g,f){for(let F=g;F<f;F++)if(n(p,F,l))return!1;return!0}function a(p){p.forEach(function(l,g){l.forEach(function(f){for(let F=1;F<f.rowSpan;F++){let m=new Eo(f);m.x=f.x,m.y=f.y+F,m.colSpan=f.colSpan,c(m,p[g+F])}})})}function u(p){for(let l=p.length-1;l>=0;l--){let g=p[l];for(let f=0;f<g.length;f++){let F=g[f];for(let m=1;m<F.colSpan;m++){let h=new Fo;h.x=F.x+m,h.y=F.y,g.splice(f+1,0,h)}}}}function c(p,l){let g=0;for(;g<l.length&&l[g].x<p.x;)g++;l.splice(g,0,p)}function d(p){let l=s(p),g=t(p);Co(`Max rows: ${l}; Max cols: ${g}`);for(let f=0;f<l;f++)for(let F=0;F<g;F++)if(!n(p,F,f)){let m={x:F,y:f,colSpan:1,rowSpan:1};for(F++;F<g&&!n(p,F,f);)m.colSpan++,F++;let h=f+1;for(;h<l&&i(p,h,m.x,m.x+m.colSpan);)m.rowSpan++,h++;let D=new Ke(m);D.x=m.x,D.y=m.y,yo(`Missing cell at ${D.y}-${D.x}.`),c(D,p[f])}}function y(p){return p.map(function(l){if(!Array.isArray(l)){let g=Object.keys(l)[0];l=l[g],Array.isArray(l)?(l=l.slice(),l.unshift(g)):l=[g,l]}return l.map(function(g){return new Ke(g)})})}function b(p){let l=y(p);return e(l),d(l),a(l),u(l),l}us.exports={makeTableLayout:b,layoutTable:e,addRowSpanCells:a,maxWidth:t,fillInTable:d,computeWidths:as("colSpan","desiredWidth","x",1),computeHeights:as("rowSpan","desiredHeight","y",1)}})();function as(r,e,t,s){return function(o,n){let i=[],a=[],u={};n.forEach(function(c){c.forEach(function(d){(d[r]||1)>1?a.push(d):i[d[t]]=Math.max(i[d[t]]||0,d[e]||0,s)})}),o.forEach(function(c,d){typeof c=="number"&&(i[d]=c)});for(let c=a.length-1;c>=0;c--){let d=a[c],y=d[r],b=d[t],p=i[b],l=typeof o[b]=="number"?0:1;if(typeof p=="number")for(let g=1;g<y;g++)p+=1+i[b+g],typeof o[b+g]!="number"&&l++;else p=e==="desiredWidth"?d.desiredWidth-1:1,(!u[b]||u[b]<p)&&(u[b]=p);if(d[e]>p){let g=0;for(;l>0&&d[e]>p;){if(typeof o[b+g]!="number"){let f=Math.round((d[e]-p)/l);p+=f,i[b+g]+=f,l--}g++}}}Object.assign(o,i,u);for(let c=0;c<o.length;c++)o[c]=Math.max(s,o[c]||0)}}});var Ds=S((tr,ls)=>{var W=we(),bo=qe(),Je=cs(),xe=class extends Array{constructor(e){super();let t=bo.mergeOptions(e);if(Object.defineProperty(this,"options",{value:t,enumerable:t.debug}),t.debug){switch(typeof t.debug){case"boolean":W.setDebugLevel(W.WARN);break;case"number":W.setDebugLevel(t.debug);break;case"string":W.setDebugLevel(parseInt(t.debug,10));break;default:W.setDebugLevel(W.WARN),W.warn(`Debug option is expected to be boolean, number, or string. Received a ${typeof t.debug}`)}Object.defineProperty(this,"messages",{get(){return W.debugMessages()}})}}toString(){let e=this,t=this.options.head&&this.options.head.length;t?(e=[this.options.head],this.length&&e.push.apply(e,this)):this.options.style.head=[];let s=Je.makeTableLayout(e);s.forEach(function(n){n.forEach(function(i){i.mergeTableOptions(this.options,s)},this)},this),Je.computeWidths(this.options.colWidths,s),Je.computeHeights(this.options.rowHeights,s),s.forEach(function(n){n.forEach(function(i){i.init(this.options)},this)},this);let o=[];for(let n=0;n<s.length;n++){let i=s[n],a=this.options.rowHeights[n];(n===0||!this.options.style.compact||n==1&&t)&&Ve(i,"top",o);for(let u=0;u<a;u++)Ve(i,u,o);n+1==s.length&&Ve(i,"bottom",o)}return o.join(`
`)}get width(){return this.toString().split(`
`)[0].length}};xe.reset=()=>W.reset();function Ve(r,e,t){let s=[];r.forEach(function(n){s.push(n.draw(e))});let o=s.join("");o.length&&t.push(o)}ls.exports=xe});var ps=S((sr,ds)=>{ds.exports=Ds()});var hs=S((yr,So)=>{So.exports={name:"ccpet",version:"1.2.8",description:"A Claude Code status line script that displays a virtual pet",main:"dist/ccpet.js",bin:{ccpet:"dist/cli.js"},files:["/dist","/bin"],scripts:{build:"node esbuild.config.js",watch:"node esbuild.config.js --watch",test:"vitest run","test:watch":"vitest","test:unit":"vitest run src/core src/ui src/services","test:coverage":"vitest run --coverage",prepublishOnly:"npm run build && tsc --noEmit && npm test",version:"npm run build",postversion:"git push && git push --tags","release:patch":"npm version patch","release:minor":"npm version minor","release:major":"npm version major"},devDependencies:{"@types/node":"20.10.5","@types/uuid":"^10.0.0","@vitest/coverage-v8":"^3.2.4",esbuild:"0.20.2",prettier:"3.1.1",typescript:"5.3.3",vitest:"^3.2.4"},engines:{node:">=20.0.0",npm:">=9.0.0"},keywords:["claude-code","status-line","ccpet","pet","cli","virtual-pet","productivity"],author:"Claude Code Team",license:"MIT",homepage:"https://github.com/terryso/ccpet#readme",repository:{type:"git",url:"git+https://github.com/terryso/ccpet.git"},bugs:{url:"https://github.com/terryso/ccpet/issues"},dependencies:{"cli-table3":"^0.6.5",uuid:"^11.1.0"}}});var _o={};vs(_o,{main:()=>ms});module.exports=Ts(_o);function ws(){let r=process.env.COLORTERM,e=process.env.TERM;return!!(r==="truecolor"||r==="24bit"||e&&(["iterm","iterm2","alacritty","kitty","wezterm"].some(s=>e.toLowerCase().includes(s))||e.includes("256color"))||process.env.WT_SESSION)}function _s(r){let e=r.replace("#",""),t=parseInt(e.substring(0,2),16),s=parseInt(e.substring(2,4),16),o=parseInt(e.substring(4,6),16);return{r:t,g:s,b:o}}function As(r,e,t){let s=[{r:0,g:0,b:0},{r:128,g:0,b:0},{r:0,g:128,b:0},{r:128,g:128,b:0},{r:0,g:0,b:128},{r:128,g:0,b:128},{r:0,g:128,b:128},{r:192,g:192,b:192},{r:128,g:128,b:128},{r:255,g:0,b:0},{r:0,g:255,b:0},{r:255,g:255,b:0},{r:0,g:0,b:255},{r:255,g:0,b:255},{r:0,g:255,b:255},{r:255,g:255,b:255}],o=0,n=1/0;for(let i=0;i<s.length;i++){let a=s[i],u=Math.sqrt(Math.pow(r-a.r,2)+Math.pow(e-a.g,2)+Math.pow(t-a.b,2));u<n&&(n=u,o=i)}for(let i=0;i<216;i++){let a=16+i,u=Math.floor(i/36)*51,c=Math.floor(i%36/6)*51,d=i%6*51,y=Math.sqrt(Math.pow(r-u,2)+Math.pow(e-c,2)+Math.pow(t-d,2));y<n&&(n=y,o=a)}for(let i=0;i<24;i++){let a=232+i,u=8+i*10,c=Math.sqrt(Math.pow(r-u,2)+Math.pow(e-u,2)+Math.pow(t-u,2));c<n&&(n=c,o=a)}return o}function xs(r,e,t){return`\x1B[38;2;${r};${e};${t}m`}function ks(r,e=!1,t=!1){if(r==="RESET")return"\x1B[0m";let{r:s,g:o,b:n}=_s(r);if(ws()){let u=xs(s,o,n);return t?`\x1B[1m${u}`:u}let i=As(s,o,n);if(e&&i<8)return`\x1B[1;3${i}m`;let a=`\x1B[38;5;${i}m`;return t?`\x1B[1m${a}`:a}function Ne(r){let e={};for(let[t,s]of Object.entries(r))if(t==="RESET")e[t]="\x1B[0m";else{let o=s.split(":"),n=o[0],i=o.includes("bright"),a=o.includes("bold");e[t]=ks(n,i,a)}return e}var G=w(require("fs")),he=w(require("path")),Ze=w(require("os"));var $={colors:{petExpression:"#FFFF00:bright:bold",petName:"#00FFFF:bright",energyBar:"#00FF00",energyValue:"#00FFFF",accumulatedTokens:"#778899",lifetimeTokens:"#FF00FF",sessionInput:"#00FF00",sessionOutput:"#FFFF00",sessionCached:"#F4A460",sessionTotal:"#FFFFFF",contextLength:"#00DDFF",contextPercentage:"#0099DD",contextPercentageUsable:"#90EE90",cost:"#FFD700"},pet:{animationEnabled:!0,decayRate:.0231,emojiEnabled:!0},display:{maxLines:3,line1:{enabled:!0,items:["expression","energy-bar","energy-value","accumulated-tokens","lifetime-tokens"]},line2:{enabled:!0,items:["input","output","cached","total"]},line3:{enabled:!0,items:["context-length","context-percentage","context-percentage-usable","cost"]}},supabase:{url:"https://rzsupavqzxhyrgcexrpx.supabase.co",apiKey:"sbp_88f3151cc0a24a37dd71617c562e62a79727ef6f",autoSync:!1,syncInterval:1440}},T=class{configDir;configFile;cachedConfig=null;constructor(e){if(e)this.configDir=e,this.configFile=he.join(e,"config.json");else{let s=process.env.NODE_ENV==="test"||process.env.VITEST==="true"?".claude-pet-test":".claude-pet";this.configDir=he.join(Ze.homedir(),s),this.configFile=he.join(this.configDir,"config.json")}}ensureConfigDir(){G.existsSync(this.configDir)||G.mkdirSync(this.configDir,{recursive:!0})}loadConfig(){if(this.cachedConfig)return this.cachedConfig;if(this.ensureConfigDir(),!G.existsSync(this.configFile)){let e=JSON.parse(JSON.stringify($));return this.saveConfig(e),this.cachedConfig=e,e}try{let e=G.readFileSync(this.configFile,"utf8"),t=JSON.parse(e);return this.cachedConfig=this.mergeWithDefaults(t),this.cachedConfig}catch(e){let t=e instanceof Error?e.message:"Unknown error";console.warn("Failed to load config, using defaults:",t);let s=JSON.parse(JSON.stringify($));return this.cachedConfig=s,s}}mergeWithDefaults(e){return{colors:{...$.colors,...e.colors},pet:{...$.pet,...e.pet},display:{...$.display,...e.display,line1:{...$.display.line1,...e.display?.line1},line2:{...$.display.line2,...e.display?.line2},line3:{...$.display.line3,...e.display?.line3}},supabase:{...$.supabase,...e.supabase}}}saveConfig(e){this.ensureConfigDir(),G.writeFileSync(this.configFile,JSON.stringify(e,null,2),"utf8"),this.cachedConfig=JSON.parse(JSON.stringify(e))}getConfig(){return this.loadConfig()}setColorConfig(e,t){let s=this.loadConfig();s.colors[e]=t,this.saveConfig(s)}setPetConfig(e,t){let s=this.loadConfig();s.pet[e]=t,this.saveConfig(s)}setDisplayConfig(e,t){let s=this.loadConfig();if(e==="maxLines")s.display.maxLines=Math.min(3,Math.max(1,Number(t)));else if(e==="line1.enabled")s.display.line1.enabled=!!t;else if(e==="line1.items"){let o=Array.isArray(t)?t:t.split(",").map(a=>a.trim()),n=fe(o),i=o.filter(a=>!n.includes(a));i.length>0&&console.warn(`Invalid line1 items ignored: ${i.join(", ")}`),s.display.line1.items=n.length>0?n:["expression","energy-bar","energy-value","accumulated-tokens","lifetime-tokens"]}else e==="line2.enabled"?s.display.line2.enabled=!!t:e==="line2.items"?s.display.line2.items=Array.isArray(t)?t:t.split(",").map(o=>o.trim()):e==="line3.enabled"?s.display.line3.enabled=!!t:e==="line3.items"&&(s.display.line3.items=Array.isArray(t)?t:t.split(",").map(o=>o.trim()));this.saveConfig(s)}setSupabaseConfig(e,t){let s=this.getConfig();if(s.supabase||(s.supabase={}),e==="url")s.supabase.url=t;else if(e==="apiKey")s.supabase.apiKey=t;else if(e==="autoSync")s.supabase.autoSync=t;else if(e==="syncInterval"){let o=Number(t);if(!isNaN(o)&&o>0)s.supabase.syncInterval=o;else throw new Error(`Invalid syncInterval value: ${t}. Must be a positive number.`)}else throw new Error(`Unknown Supabase configuration key: ${e}`);this.saveConfig(s)}resetConfig(){this.saveConfig($)}listConfig(){let e=this.getConfig();return JSON.stringify(e,null,2)}getConfigPath(){return this.configFile}};var re=(n=>(n.CAT="cat",n.DOG="dog",n.RABBIT="rabbit",n.PANDA="panda",n.FOX="fox",n))(re||{}),Rs=["expression","energy-bar","energy-value","accumulated-tokens","lifetime-tokens","pet-name"];function Ps(r){try{let t=(r||new T).getConfig();return{PET_EXPRESSION:t.colors.petExpression||"#FFFF00:bright:bold",PET_NAME:t.colors.petName||"#00FFFF:bright",ENERGY_BAR:t.colors.energyBar||"#00FF00",ENERGY_VALUE:t.colors.energyValue||"#00FFFF",ACCUMULATED_TOKENS:t.colors.accumulatedTokens||"#778899",LIFETIME_TOKENS:t.colors.lifetimeTokens||"#FF00FF",SESSION_INPUT:t.colors.sessionInput||"#00FF00",SESSION_OUTPUT:t.colors.sessionOutput||"#FFFF00",SESSION_CACHED:t.colors.sessionCached||"#F4A460",SESSION_TOTAL:t.colors.sessionTotal||"#FFFFFF",CONTEXT_LENGTH:t.colors.contextLength||"#00DDFF",CONTEXT_PERCENTAGE:t.colors.contextPercentage||"#0099DD",CONTEXT_PERCENTAGE_USABLE:t.colors.contextPercentageUsable||"#90EE90",COST:t.colors.cost||"#FFD700",RESET:"RESET"}}catch{return{PET_EXPRESSION:"#FFFF00:bright:bold",PET_NAME:"#00FFFF:bright",ENERGY_BAR:"#00FF00",ENERGY_VALUE:"#00FFFF",ACCUMULATED_TOKENS:"#778899",LIFETIME_TOKENS:"#FF00FF",SESSION_INPUT:"#00FF00",SESSION_OUTPUT:"#FFFF00",SESSION_CACHED:"#F4A460",SESSION_TOTAL:"#FFFFFF",CONTEXT_LENGTH:"#00DDFF",CONTEXT_PERCENTAGE:"#0099DD",CONTEXT_PERCENTAGE_USABLE:"#90EE90",COST:"#FFD700",RESET:"RESET"}}}function Is(){return{PET_EXPRESSION:"#FFFF00:bright:bold",PET_NAME:"#00FFFF:bright",ENERGY_BAR:"#00FF00",ENERGY_VALUE:"#00FFFF",ACCUMULATED_TOKENS:"#778899",LIFETIME_TOKENS:"#FF00FF",SESSION_INPUT:"#00FF00",SESSION_OUTPUT:"#FFFF00",SESSION_CACHED:"#F4A460",SESSION_TOTAL:"#FFFFFF",CONTEXT_LENGTH:"#00DDFF",CONTEXT_PERCENTAGE:"#0099DD",CONTEXT_PERCENTAGE_USABLE:"#90EE90",COST:"#FFD700",RESET:"RESET"}}var Be=["Fluffy","Whiskers","Shadow","Luna","Max","Bella","Charlie","Lucy","Cooper","Ruby","Milo","Lily","Buddy","Chloe","Rocky","\u5C0F\u767D","\u6BDB\u6BDB","\u7403\u7403","\u8C46\u8C46","\u82B1\u82B1","\u54AA\u54AA","\u65FA\u8D22","\u5C0F\u9ED1","\u96EA\u513F","\u7CD6\u7CD6"];function J(){if(Be.length===0)return"Pet";let r=Math.floor(Math.random()*Be.length);return Be[r]}var P={cat:{id:"cat",name:"\u732B",emoji:"\u{1F431}"},dog:{id:"dog",name:"\u72D7",emoji:"\u{1F436}"},rabbit:{id:"rabbit",name:"\u5154\u5B50",emoji:"\u{1F430}"},panda:{id:"panda",name:"\u718A\u732B",emoji:"\u{1F43C}"},fox:{id:"fox",name:"\u72D0\u72F8",emoji:"\u{1F98A}"}},I={INITIAL_ENERGY:100,HAPPY_EXPRESSION_THRESHOLD:80,HAPPY_EXPRESSION:"(^_^)",ENERGY_BAR_LENGTH:10,STATUS_BAR_PRIORITY:100,FILLED_BAR_CHAR:"\u25CF",EMPTY_BAR_CHAR:"\u25CB",STATE_THRESHOLDS:{HAPPY:80,HUNGRY:40,SICK:10,DEAD:0},STATE_EXPRESSIONS:{HAPPY:"(^_^)",HUNGRY:"(o_o)",SICK:"(u_u)",DEAD:"(x_x)"},ANIMATED_EXPRESSIONS:{HAPPY:["(^_^)","(^o^)","(^_^)","(^v^)"],HUNGRY:["(o_o)","(O_O)","(o_o)","(-_-)"],SICK:["(u_u)","(T_T)","(u_u)","(>_<)"],DEAD:["(x_x)","(X_X)","(x_x)","(+_+)"]},TIME_DECAY:{DECAY_CHECK_INTERVAL:6e4,DECAY_RATE:.0231,MINIMUM_DECAY_INTERVAL:6e4},FEEDING:{TOKENS_PER_ENERGY:1e6},ANIMAL:{DEFAULT_TYPE:"cat"},COLORS:Ne(Is())};function Qe(r){return Ne(Ps(r))}function fe(r){return r.filter(e=>Rs.includes(e))}var ee={DEFAULT_URL:process.env.SUPABASE_URL||"",DEFAULT_API_KEY:process.env.SUPABASE_ANON_KEY||"",BATCH_SIZE:100,DEFAULT_SYNC_INTERVAL:24*60*60*1e3,MAX_RETRY_ATTEMPTS:3,RETRY_DELAY_MS:1e3};var _=[];for(let r=0;r<256;++r)_.push((r+256).toString(16).slice(1));function et(r,e=0){return(_[r[e+0]]+_[r[e+1]]+_[r[e+2]]+_[r[e+3]]+"-"+_[r[e+4]]+_[r[e+5]]+"-"+_[r[e+6]]+_[r[e+7]]+"-"+_[r[e+8]]+_[r[e+9]]+"-"+_[r[e+10]]+_[r[e+11]]+_[r[e+12]]+_[r[e+13]]+_[r[e+14]]+_[r[e+15]]).toLowerCase()}var tt=require("crypto"),ye=new Uint8Array(256),me=ye.length;function Le(){return me>ye.length-16&&((0,tt.randomFillSync)(ye),me=0),ye.slice(me,me+=16)}var st=require("crypto"),Oe={randomUUID:st.randomUUID};function Ns(r,e,t){if(Oe.randomUUID&&!e&&!r)return Oe.randomUUID();r=r||{};let s=r.random??r.rng?.()??Le();if(s.length<16)throw new Error("Random bytes length must be >= 16");if(s[6]=s[6]&15|64,s[8]=s[8]&63|128,e){if(t=t||0,t<0||t+16>e.length)throw new RangeError(`UUID byte range ${t}:${t+15} is out of buffer bounds`);for(let o=0;o<16;++o)e[t+o]=s[o];return e}return et(s)}var q=Ns;var ie=class r{state;deps;observers=[];constructor(e,t){this.state={...e,uuid:e.uuid||q(),petName:e.petName||J(),emoji:e.emoji||P[e.animalType]?.emoji||P.cat.emoji},this.deps=t,this._updateExpression()}getState(){return{...this.state}}subscribe(e){return this.observers.push(e),()=>{let t=this.observers.indexOf(e);t>-1&&this.observers.splice(t,1)}}feed(e){try{let t=this.state.accumulatedTokens+e,{TOKENS_PER_ENERGY:s}=this.deps.config.FEEDING,o=Math.floor(t/s),n=t%s;this.state={...this.state,accumulatedTokens:n,lastFeedTime:new Date,totalTokensConsumed:this.state.totalTokensConsumed+e,totalLifetimeTokens:this.state.totalLifetimeTokens+e},o>0&&this.addEnergy(o)}catch(t){console.error("Pet feeding failed:",t)}}applyTimeDecay(){try{let e=new Date,{TIME_DECAY:t}=this.deps.config,s=this.state.lastDecayTime||this.state.lastFeedTime,o=(e.getTime()-s.getTime())/(1e3*60);if(o>0){let n=t?t.DECAY_RATE/(t.DECAY_CHECK_INTERVAL/6e4):.023148148148148147,i=o*n,a=t?t.MINIMUM_DECAY_INTERVAL/(1e3*60):0;i>0&&o>=a&&(this.decreaseEnergy(i),this.state={...this.state,lastDecayTime:e})}}catch(e){console.error("Pet time decay failed:",e)}}addEnergy(e){try{if(typeof e!="number"||e<0||isNaN(e))throw new Error(`Invalid energy amount: ${e}. Must be a non-negative number.`);let t=new Date;this.state={...this.state,energy:Math.min(100,this.state.energy+e),lastFeedTime:t,lastDecayTime:t},this._updateExpression(),this._notify()}catch(t){throw console.error("Pet addEnergy failed:",t),t}}decreaseEnergy(e){try{if(typeof e!="number"||e<0||isNaN(e))throw new Error(`Invalid energy amount: ${e}. Must be a non-negative number.`);this.state={...this.state,energy:Math.max(0,this.state.energy-e)},this._updateExpression(),this._notify()}catch(t){throw console.error("Pet decreaseEnergy failed:",t),t}}getCurrentEnergy(){return this.state.energy}getCurrentAnimalType(){return this.state.animalType}static getRandomAnimalType(){let e=Object.values(re),t=Math.floor(Math.random()*e.length);return e[t]}getAnimalEmoji(){return this.state.emoji||P[this.state.animalType]?.emoji||P.cat.emoji}isDead(){return this.state.energy===0}resetToInitialState(e){try{if(e&&this.isDead())try{e({...this.state})}catch(o){console.error("Graveyard callback failed, but continuing with reset:",o)}let t=new Date,s=r.getRandomAnimalType();this.state={uuid:q(),energy:this.deps.config.INITIAL_ENERGY,expression:this.deps.config.STATE_EXPRESSIONS.HAPPY,animalType:s,emoji:P[s]?.emoji||P.cat.emoji,birthTime:t,lastFeedTime:t,totalTokensConsumed:0,accumulatedTokens:0,totalLifetimeTokens:0,lastDecayTime:t,sessionTotalInputTokens:0,sessionTotalOutputTokens:0,sessionTotalCachedTokens:0,petName:J()},console.log(`Pet reborn as ${s} type with name: ${this.state.petName}`),this._updateExpression(),this._notify()}catch(t){throw console.error("Pet resetToInitialState failed:",t),t}}_updateExpression(){if(!this.deps?.config)return;let{STATE_THRESHOLDS:e,STATE_EXPRESSIONS:t}=this.deps.config;this.state.energy>=e.HAPPY?this.state.expression=t.HAPPY:this.state.energy>=e.HUNGRY?this.state.expression=t.HUNGRY:this.state.energy>=e.SICK?this.state.expression=t.SICK:this.state.expression=t.DEAD}getAnimatedExpression(e=!1,t=0,s=!0){let{STATE_THRESHOLDS:o,ANIMATED_EXPRESSIONS:n}=this.deps.config,i;if(!e||!n)i=this.state.expression;else{let a;this.state.energy>=o.HAPPY?a=n.HAPPY:this.state.energy>=o.HUNGRY?a=n.HUNGRY:this.state.energy>=o.SICK?a=n.SICK:a=n.DEAD;let u=t%a.length;i=a[u]}return s?`${this.getAnimalEmoji()}${i}`:i}updateSessionMetrics(e){try{this.state={...this.state,...e}}catch(t){console.error("Pet updateSessionMetrics failed:",t)}}_notify(){this.observers.forEach(e=>{try{e(this.getState())}catch(t){console.error("Observer notification failed:",t)}})}};var ae=class{testMode;configService;constructor(e=!1,t){this.testMode=e,this.configService=t||new T}getColors(){return this.testMode?I.COLORS:Qe(this.configService)}formatPetDisplay(e,t){try{let s=this.configService.getConfig(),o=[];if(s.display.line1?.enabled!==!1&&(s.display.maxLines||3)>=1){let i=s.display.line1?.items?this.formatConfigurablePetLine(s.display.line1.items,e,t):this.formatPetLine(e,t);o.push(i)}let n=this.getSessionData(e);if(s.display.line2?.enabled&&(s.display.maxLines||3)>=2){let i=this.formatConfigurableLine(s.display.line2.items||[],n);i&&o.push(i)}if(s.display.line3?.enabled&&(s.display.maxLines||3)>=3){let i=this.formatConfigurableLine(s.display.line3.items||[],n);i&&o.push(i)}return o.join((this.testMode,`
`))}catch(s){return console.error("Failed to format pet display:",s),console.error("Error stack:",s inst