import{Zfa as z,kga as W}from"./cli-0.5.3-7wdgps7z.mjs";import{Gga as G,Lga as X}from"./cli-0.5.3-c8bcrqa4.mjs";W();X();import{readFileSync as Y}from"node:fs";import{mkdir as Z,writeFile as Q}from"node:fs/promises";import{join as $}from"node:path";var k="latest-version.json";function R(){return $(z(),k)}function B(x){if(!x||typeof x!=="object")return!1;let q=x;return typeof q.latest==="string"&&q.latest.length>0&&typeof q.current==="string"&&q.current.length>0&&typeof q.checkedAt==="number"&&Number.isFinite(q.checkedAt)}function V(){try{let x=Y(R(),"utf8"),q=JSON.parse(x);return B(q)?q:null}catch(x){if(G(x))return null;return null}}async function _(x){let q=R(),J=JSON.stringify(x);try{await Q(q,J,"utf8")}catch(K){if(G(K)){await Z(z(),{recursive:!0}),await Q(q,J,"utf8");return}throw K}}
export{V as yb,_ as zb};
