import { defineComponent, ref, computed, useSSRContext } from "vue"; import { ssrRenderAttrs, ssrInterpolate, ssrRenderClass, ssrRenderList } from "vue/server-renderer"; import { useRoute, useRouter } from "vue-router"; import "/app/node_modules/hookable/dist/index.mjs"; import "/app/node_modules/klona/dist/index.mjs"; import "../server.mjs"; import "/app/node_modules/ofetch/dist/node.mjs"; import "#internal/nuxt/paths"; import "/app/node_modules/unctx/dist/index.mjs"; import "/app/node_modules/h3/dist/index.mjs"; import "pinia"; import "/app/node_modules/defu/dist/defu.mjs"; import "/app/node_modules/ufo/dist/index.mjs"; import "/app/node_modules/cookie-es/dist/index.mjs"; import "/app/node_modules/destr/dist/index.mjs"; import "/app/node_modules/ohash/dist/index.mjs"; import "/app/node_modules/@unhead/vue/dist/index.mjs"; import "@vue/devtools-api"; const _sfc_main = /* @__PURE__ */ defineComponent({ __name: "index", __ssrInlineRender: true, setup(__props) { useRoute(); useRouter(); const loading = ref(true); const error = ref(null); const garage = ref(null); const activeTab = ref("general"); const tabs = [ { key: "general", label: "Általános" }, { key: "employees", label: "Dolgozók" }, { key: "fleet", label: "Flotta" }, { key: "analytics", label: "Analitika" } ]; const formattedAddress = computed(() => { if (!garage.value) return "—"; const parts = []; if (garage.value.address_zip) parts.push(garage.value.address_zip); if (garage.value.address_city) parts.push(garage.value.address_city); const streetParts = []; if (garage.value.address_street_name) streetParts.push(garage.value.address_street_name); if (garage.value.address_street_type) streetParts.push(garage.value.address_street_type); if (garage.value.address_house_number) streetParts.push(garage.value.address_house_number); if (streetParts.length > 0) parts.push(streetParts.join(" ")); return parts.length > 0 ? parts.join(", ") : "—"; }); function garageDisplayName(g) { return g.display_name || g.name || g.full_name; } function getInitials(name) { return name.split(" ").map((w) => w.charAt(0)).join("").toUpperCase().slice(0, 2); } function getInitialsColor(name) { const colors = [ "bg-amber-600", "bg-purple-600", "bg-slate-600", "bg-indigo-600", "bg-emerald-600", "bg-rose-600", "bg-cyan-600", "bg-orange-600", "bg-teal-600" ]; let hash = 0; for (let i = 0; i < name.length; i++) { hash = name.charCodeAt(i) + ((hash << 5) - hash); } return colors[Math.abs(hash) % colors.length]; } function statusBadgeClass(status) { if (status === "active") return "bg-emerald-500/10 text-emerald-400"; if (status === "suspended") return "bg-red-500/10 text-red-400"; if (status === "pending_verification") return "bg-amber-500/10 text-amber-400"; return "bg-slate-500/10 text-slate-400"; } function statusDotClass(status) { if (status === "active") return "bg-emerald-400"; if (status === "suspended") return "bg-red-400"; if (status === "pending_verification") return "bg-amber-400"; return "bg-slate-400"; } function statusLabel(status) { if (status === "active") return "Aktív"; if (status === "suspended") return "Felfüggesztve"; if (status === "pending_verification") return "Függőben"; return "Inaktív"; } function tierBadgeClass(tierName) { const name = tierName.toLowerCase(); if (name.includes("enterprise") || name.includes("vip") || name.includes("corp")) return "bg-purple-500/20 text-purple-300"; if (name.includes("premium") || name.includes("pro")) return "bg-amber-500/20 text-amber-300"; return "bg-slate-500/20 text-slate-300"; } function orgTypeLabel(type) { const labels = { individual: "Magánszemély", service: "Szerviz", service_provider: "Szolgáltató", fleet_owner: "Flottatulajdonos", club: "Klub", business: "Vállalkozás" }; return labels[type] || type; } function formatDate(dateStr) { if (!dateStr) return "—"; try { const d = new Date(dateStr); return d.toLocaleDateString("hu-HU", { year: "numeric", month: "short", day: "numeric" }); } catch { return dateStr; } } return (_ctx, _push, _parent, _attrs) => { _push(`
${ssrInterpolate(_ctx.$t("garages.details.loading"))}
${ssrInterpolate(error.value)}
${ssrInterpolate(garage.value.full_name)} `); if (garage.value.tax_number) { _push(`· ${ssrInterpolate(_ctx.$t("garages.details.tax_number"))}: ${ssrInterpolate(garage.value.tax_number)}`); } else { _push(``); } _push(`
${ssrInterpolate(_ctx.$t("garages.details.company_name"))}
${ssrInterpolate(garage.value.full_name)}
${ssrInterpolate(_ctx.$t("garages.details.display_name"))}
${ssrInterpolate(garage.value.display_name || "—")}
${ssrInterpolate(_ctx.$t("garages.details.org_type"))}
${ssrInterpolate(orgTypeLabel(garage.value.org_type))}
${ssrInterpolate(_ctx.$t("garages.details.tax_number"))}
${ssrInterpolate(garage.value.tax_number || "—")}
${ssrInterpolate(_ctx.$t("garages.details.reg_number"))}
${ssrInterpolate(garage.value.reg_number || "—")}
${ssrInterpolate(_ctx.$t("garages.details.created_at"))}
${ssrInterpolate(formatDate(garage.value.created_at))}
${ssrInterpolate(_ctx.$t("garages.details.address"))}
${ssrInterpolate(formattedAddress.value)}
${ssrInterpolate(_ctx.$t("garages.details.tier_name"))}
${ssrInterpolate(garage.value.subscription.tier_name)}${ssrInterpolate(_ctx.$t("garages.details.tier_level"))}
${ssrInterpolate(_ctx.$t("garages.details.level_n", { n: garage.value.subscription.tier_level }))}
${ssrInterpolate(_ctx.$t("garages.details.expires_at"))}
`); if (garage.value.subscription.expires_at) { _push(`${ssrInterpolate(formatDate(garage.value.subscription.expires_at))}
`); } else { _push(`${ssrInterpolate(_ctx.$t("garages.indefinite"))}
`); } _push(`${ssrInterpolate(_ctx.$t("garages.details.asset_limit"))}
${ssrInterpolate(garage.value.subscription.asset_limit)} ${ssrInterpolate(_ctx.$t("garages.details.vehicles"))}
${ssrInterpolate(_ctx.$t("garages.details.no_subscription"))}
${ssrInterpolate(_ctx.$t("garages.details.contact_name"))}
${ssrInterpolate(garage.value.primary_contact.full_name)}
${ssrInterpolate(_ctx.$t("garages.details.contact_role"))}
${ssrInterpolate(garage.value.primary_contact.role)}
${ssrInterpolate(_ctx.$t("garages.details.contact_department"))}
${ssrInterpolate(garage.value.primary_contact.department || "—")}
${ssrInterpolate(_ctx.$t("garages.details.contact_phone"))}
${ssrInterpolate(garage.value.primary_contact.phone || "—")}
${ssrInterpolate(_ctx.$t("garages.details.no_contact"))}
${ssrInterpolate(_ctx.$t("garages.details.coming_soon"))}