import { _ as _sfc_main$1 } from './Badge-BnQthhyg.mjs';
import { v as vueExports, s as serverRenderer_cjs_prodExports } from './server.mjs';

const _sfc_main = /* @__PURE__ */ vueExports.defineComponent({
  __name: "StateBadge",
  __ssrInlineRender: true,
  props: {
    state: {}
  },
  setup(__props) {
    const props = __props;
    const color = vueExports.computed(() => {
      const s = props.state.toLowerCase();
      if (s.includes("done") || s.includes("complete") || s.includes("merged"))
        return "success";
      if (s.includes("fail") || s.includes("error"))
        return "error";
      if (s.includes("retry") || s.includes("wait"))
        return "warning";
      return "neutral";
    });
    return (_ctx, _push, _parent, _attrs) => {
      const _component_UBadge = _sfc_main$1;
      _push(serverRenderer_cjs_prodExports.ssrRenderComponent(_component_UBadge, vueExports.mergeProps({
        color: vueExports.unref(color),
        variant: "subtle",
        size: "sm"
      }, _attrs), {
        default: vueExports.withCtx((_, _push2, _parent2, _scopeId) => {
          if (_push2) {
            _push2(`${serverRenderer_cjs_prodExports.ssrInterpolate(__props.state)}`);
          } else {
            return [
              vueExports.createTextVNode(vueExports.toDisplayString(__props.state), 1)
            ];
          }
        }),
        _: 1
      }, _parent));
    };
  }
});
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
  const ssrContext = vueExports.useSSRContext();
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("components/StateBadge.vue");
  return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
const __nuxt_component_2 = Object.assign(_sfc_main, { __name: "StateBadge" });
function formatDateTime(iso) {
  return new Intl.DateTimeFormat(void 0, {
    dateStyle: "medium",
    timeStyle: "medium"
  }).format(new Date(iso));
}
function formatTokens(n) {
  return new Intl.NumberFormat().format(n);
}
function formatTime(iso) {
  return new Intl.DateTimeFormat(void 0, {
    hour: "2-digit",
    minute: "2-digit",
    second: "2-digit"
  }).format(new Date(iso));
}
function formatSecondsRunning(seconds) {
  const s = Math.round(seconds);
  if (s < 60)
    return `${s}s`;
  const m = Math.floor(s / 60);
  return `${m}m ${s % 60}s`;
}

export { __nuxt_component_2 as _, formatTokens as a, formatSecondsRunning as b, formatTime as c, formatDateTime as f };
//# sourceMappingURL=format-Cs0yxEHy.mjs.map
