import { _ as __nuxt_component_0 } from "./nuxt-link-1NBbHb-h.js"; import { defineComponent, ref, unref, withCtx, createTextVNode, toDisplayString, openBlock, createBlock, createVNode, useSSRContext } from "vue"; import { ssrRenderAttrs, ssrInterpolate, ssrIncludeBooleanAttr, ssrLooseContain, ssrLooseEqual, ssrRenderList, ssrRenderAttr, ssrRenderComponent, ssrRenderClass } from "vue/server-renderer"; import "/app/node_modules/hookable/dist/index.mjs"; import { u as useFormatter } from "./useFormatter-hycy3urM.js"; import "/app/node_modules/klona/dist/index.mjs"; import { a as useI18n } from "../server.mjs"; import "/app/node_modules/ufo/dist/index.mjs"; import "/app/node_modules/defu/dist/defu.mjs"; import "./region-0mvXqaMM.js"; import "pinia"; 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 "vue-router"; 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) { const { t } = useI18n(); const { formatNumber, formatDate } = useFormatter(); const loading = ref(false); const error = ref(false); const users = ref([]); const totalCount = ref(0); const offset = ref(0); const limit = ref(50); const filters = ref({ level: "", min_xp: null, max_xp: null, has_penalty: "" }); function restrictionLabel(level) { switch (level) { case 1: return t("gamification.users.restriction_mild"); case 2: return t("gamification.users.restriction_moderate"); case 3: return t("gamification.users.restriction_severe"); default: return `${level}. ${t("gamification.users.restriction_level")}`; } } return (_ctx, _push, _parent, _attrs) => { const _component_NuxtLink = __nuxt_component_0; _push(`
${ssrInterpolate(unref(t)("gamification.users.subtitle"))}
${ssrInterpolate(unref(t)("gamification.users.load_error"))}
${ssrInterpolate(unref(t)("gamification.users.empty"))}
| ${ssrInterpolate(unref(t)("gamification.users.col_user_id"))} | ${ssrInterpolate(unref(t)("gamification.users.col_xp"))} | ${ssrInterpolate(unref(t)("gamification.users.col_level"))} | ${ssrInterpolate(unref(t)("gamification.users.col_points"))} | ${ssrInterpolate(unref(t)("gamification.users.col_penalty"))} | ${ssrInterpolate(unref(t)("gamification.users.col_restriction"))} | ${ssrInterpolate(unref(t)("gamification.users.col_services"))} | ${ssrInterpolate(unref(t)("gamification.users.col_discoveries"))} | ${ssrInterpolate(unref(t)("gamification.users.col_updated"))} | ${ssrInterpolate(unref(t)("gamification.users.col_actions"))} |
|---|---|---|---|---|---|---|---|---|---|
| #${ssrInterpolate(user.user_id)} | ${ssrInterpolate(unref(formatNumber)(user.total_xp))} | ${ssrInterpolate(user.current_level)} | ${ssrInterpolate(unref(formatNumber)(user.total_points))} | `); if (user.penalty_points > 0) { _push(` -${ssrInterpolate(user.penalty_points)}`); } else { _push(`—`); } _push(` | `); if (user.restriction_level > 0) { _push(`${ssrInterpolate(restrictionLabel(user.restriction_level))}`); } else { _push(`${ssrInterpolate(unref(t)("gamification.users.none"))}`); } _push(` | ${ssrInterpolate(user.services_submitted)} | ${ssrInterpolate(user.places_discovered)} | ${ssrInterpolate(user.updated_at ? unref(formatDate)(user.updated_at) : "—")} | `); _push(ssrRenderComponent(_component_NuxtLink, { to: `/gamification/users/${user.user_id}`, class: "inline-flex items-center gap-1.5 px-3 py-1.5 bg-indigo-600/10 hover:bg-indigo-600/20 text-indigo-400 text-xs font-medium rounded-lg transition" }, { default: withCtx((_, _push2, _parent2, _scopeId) => { if (_push2) { _push2(`${ssrInterpolate(unref(t)("gamification.users.details"))} `); } else { return [ createTextVNode(toDisplayString(unref(t)("gamification.users.details")) + " ", 1), (openBlock(), createBlock("svg", { class: "w-3.5 h-3.5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24" }, [ createVNode("path", { "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", d: "M9 5l7 7-7 7" }) ])) ]; } }), _: 2 }, _parent)); _push(` |