import{mT as p,nT as f,oT as a,pT as S}from"./cli-0.5.3-4dbxtwh3.mjs";import{Caa as m,Yaa as b}from"./cli-0.5.3-t65dek0m.mjs";import"./cli-0.5.3-kavpx97n.mjs";import"./cli-0.5.3-9bdwhdys.mjs";import"./cli-0.5.3-ttc72eq3.mjs";import"./cli-0.5.3-g75gdzrp.mjs";import"./cli-0.5.3-1rg2r7n7.mjs";import{Aea as C,yea as d,zea as y}from"./cli-0.5.3-6j2jk6dt.mjs";import"./cli-0.5.3-66650sba.mjs";import"./cli-0.5.3-9vh3vpap.mjs";import"./cli-0.5.3-n3cxyxpg.mjs";import"./cli-0.5.3-kbvzmaax.mjs";import"./cli-0.5.3-7wdgps7z.mjs";import"./cli-0.5.3-c8bcrqa4.mjs";import"./cli-0.5.3-qrvd6cmy.mjs";import"./cli-0.5.3-2dk1sk8w.mjs";import{Xma as g}from"./cli-0.5.3-0df3r78b.mjs";function R(t){let o=2166136261;for(let s=0;s<t.length;s++)o^=t.charCodeAt(s),o=Math.imul(o,16777619);return o>>>0}function r(t,o){return t[R(o)%t.length]}function M(t){return t.charAt(0).toUpperCase()+t.slice(1)}function O(){let t=f(),{bones:o}=p(`${t}:buddy`),s=r($,`${t}:prefix`),n=r(A,`${t}:suffix`),i=r(w,`${t}:personality`);return{name:`${s}${n}`,personality:`${i}.`,hatchedAt:Date.now()}}function l(t,o,s=!1){t.setAppState((n)=>({...n,companionReaction:o,companionPetAt:s?Date.now():n.companionPetAt}))}function c(t){t(`Usage: /buddy [status|mute|unmute]

Run /buddy with no args to hatch your companion the first time, then pet it on later runs.`,{display:"system"})}async function X(t,o,s){let n=s?.trim().toLowerCase()??"";if(d.includes(n)||n===""){let e=a();if(n!==""||e){if(n!=="")return c(t),null}}if(d.includes(n))return c(t),null;if(y.includes(n)||n==="status"){let e=a();if(!e)return t("No buddy hatched yet. Run /buddy to hatch one.",{display:"system"}),null;return t(`${e.name} is your ${M(e.rarity)} ${e.species}. ${e.personality}`,{display:"system"}),null}if(n==="mute"||n==="unmute"){let e=n==="mute";if(m((u)=>({...u,companionMuted:e})),e)l(o,void 0);return t(`Buddy ${e?"muted":"unmuted"}.`,{display:"system"}),null}if(n!=="")return c(t),null;let i=a();if(!i){let e=O();return m((u)=>({...u,companion:e,companionMuted:!1})),i={...p(`${f()}:buddy`).bones,...e},l(o,`${i.name} the ${i.species} has hatched.`,!0),t(`${i.name} the ${i.species} is now your buddy. Run /buddy again to pet them.`,{display:"system"}),null}let h=`${i.name} ${r(E,`${Date.now()}:${i.name}`)}`;return l(o,h,!0),t(void 0,{display:"skip"}),null}var $,A,w,E;var L=g(()=>{b();S();C();$=["Byte","Echo","Glint","Miso","Nova","Pixel","Rune","Static","Vector","Whisk"],A=["bean","bit","bud","dot","ling","loop","moss","patch","puff","spark"],w=["Curious and quietly encouraging","A patient little watcher with strong debugging instincts","Playful, observant, and suspicious of flaky tests","Calm under pressure and fond of clean diffs","A tiny terminal gremlin who likes successful builds"],E=["leans into the headpat","does a proud little bounce","emits a content beep","looks delighted","wiggles happily"]});L();export{X as call};
