workbench-ChoTmZMf.mjs 5.68 KB
import { _ as _sfc_main$1 } from './Card-DYSPsF5s.mjs';
import { _ as _sfc_main$2 } from './Badge-DxP8LLFm.mjs';
import { u as useAppI18n, a as useToast, b as useAuth, _ as _sfc_main$9, n as navigateTo } from './server.mjs';
import { defineComponent, mergeProps, withCtx, unref, createVNode, createTextVNode, toDisplayString, useSSRContext } from 'vue';
import { ssrRenderAttrs, ssrRenderComponent, ssrInterpolate } from 'vue/server-renderer';
import '../nitro/nitro.mjs';
import 'node:http';
import 'node:https';
import 'node:events';
import 'node:buffer';
import 'node:fs';
import 'node:path';
import 'node:crypto';
import 'node:url';
import '@iconify/utils';
import 'consola';
import 'perfect-debounce';
import 'tailwindcss/colors';
import '../routes/renderer.mjs';
import 'vue-bundle-renderer/runtime';
import 'unhead/server';
import 'devalue';
import 'unhead/plugins';
import 'unhead/utils';

const _sfc_main = /* @__PURE__ */ defineComponent({
  __name: "workbench",
  __ssrInlineRender: true,
  setup(__props) {
    const { t } = useAppI18n();
    const toast = useToast();
    const { logout } = useAuth();
    const handleLogout = async () => {
      logout();
      await navigateTo("/login");
      toast.add({
        title: t("userMenu.logoutSuccessTitle"),
        description: t("userMenu.logoutSuccessDescription"),
        color: "success"
      });
    };
    return (_ctx, _push, _parent, _attrs) => {
      const _component_UCard = _sfc_main$1;
      const _component_UBadge = _sfc_main$2;
      const _component_UButton = _sfc_main$9;
      _push(`<main${ssrRenderAttrs(mergeProps({ class: "min-h-screen bg-gradient-to-br from-default via-elevated/20 to-primary/10 px-4 py-8" }, _attrs))}><div class="mx-auto max-w-md space-y-6">`);
      _push(ssrRenderComponent(_component_UCard, { class: "shadow-sm ring-1 ring-default" }, {
        header: withCtx((_, _push2, _parent2, _scopeId) => {
          if (_push2) {
            _push2(`<div class="space-y-3"${_scopeId}><div class="flex items-start justify-between gap-3"${_scopeId}>`);
            _push2(ssrRenderComponent(_component_UBadge, {
              color: "primary",
              variant: "soft",
              class: "rounded-full"
            }, {
              default: withCtx((_2, _push3, _parent3, _scopeId2) => {
                if (_push3) {
                  _push3(`${ssrInterpolate(unref(t)("mobileWorkbench.badge"))}`);
                } else {
                  return [
                    createTextVNode(toDisplayString(unref(t)("mobileWorkbench.badge")), 1)
                  ];
                }
              }),
              _: 1
            }, _parent2, _scopeId));
            _push2(ssrRenderComponent(_component_UButton, {
              size: "sm",
              color: "neutral",
              variant: "soft",
              icon: "i-lucide-log-out",
              label: unref(t)("userMenu.logout"),
              onClick: handleLogout
            }, null, _parent2, _scopeId));
            _push2(`</div><h1 class="text-2xl font-semibold text-highlighted"${_scopeId}>${ssrInterpolate(unref(t)("mobileWorkbench.title"))}</h1><p class="text-sm leading-6 text-toned"${_scopeId}>${ssrInterpolate(unref(t)("mobileWorkbench.description"))}</p></div>`);
          } else {
            return [
              createVNode("div", { class: "space-y-3" }, [
                createVNode("div", { class: "flex items-start justify-between gap-3" }, [
                  createVNode(_component_UBadge, {
                    color: "primary",
                    variant: "soft",
                    class: "rounded-full"
                  }, {
                    default: withCtx(() => [
                      createTextVNode(toDisplayString(unref(t)("mobileWorkbench.badge")), 1)
                    ]),
                    _: 1
                  }),
                  createVNode(_component_UButton, {
                    size: "sm",
                    color: "neutral",
                    variant: "soft",
                    icon: "i-lucide-log-out",
                    label: unref(t)("userMenu.logout"),
                    onClick: handleLogout
                  }, null, 8, ["label"])
                ]),
                createVNode("h1", { class: "text-2xl font-semibold text-highlighted" }, toDisplayString(unref(t)("mobileWorkbench.title")), 1),
                createVNode("p", { class: "text-sm leading-6 text-toned" }, toDisplayString(unref(t)("mobileWorkbench.description")), 1)
              ])
            ];
          }
        }),
        default: withCtx((_, _push2, _parent2, _scopeId) => {
          if (_push2) {
            _push2(ssrRenderComponent(_component_UButton, {
              block: "",
              size: "xl",
              color: "primary",
              icon: "i-lucide-factory",
              label: unref(t)("mobileWorkbench.actions.production"),
              to: "/m/production/sn-query"
            }, null, _parent2, _scopeId));
          } else {
            return [
              createVNode(_component_UButton, {
                block: "",
                size: "xl",
                color: "primary",
                icon: "i-lucide-factory",
                label: unref(t)("mobileWorkbench.actions.production"),
                to: "/m/production/sn-query"
              }, null, 8, ["label"])
            ];
          }
        }),
        _: 1
      }, _parent));
      _push(`</div></main>`);
    };
  }
});
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
  const ssrContext = useSSRContext();
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("pages/m/workbench.vue");
  return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};

export { _sfc_main as default };
//# sourceMappingURL=workbench-ChoTmZMf.mjs.map