import { defineComponent, computed, ref, unref, useSSRContext } from 'vue'; import { ssrRenderAttrs, ssrInterpolate, ssrRenderClass, ssrRenderAttr, ssrIncludeBooleanAttr, ssrRenderList } from 'vue/server-renderer'; import { u as useFormatter } from './useFormatter-hycy3urM.mjs'; import { a as useI18n, b as useRouter, i as useRoute } from './server.mjs'; import './region-0mvXqaMM.mjs'; import 'pinia'; 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 'vue-router'; import 'node:url'; import '../routes/renderer.mjs'; import 'vue-bundle-renderer/runtime'; import 'unhead/server'; import 'devalue'; import 'unhead/utils'; import 'unhead/plugins'; const _sfc_main = /* @__PURE__ */ defineComponent({ __name: "[id]", __ssrInlineRender: true, setup(__props) { const { t } = useI18n(); const { formatNumber, formatDate, formatDateTime } = useFormatter(); useRouter(); const route = useRoute(); computed(() => Number(route.params.id)); const loading = ref(true); const error = ref(false); const stats = ref(null); const ledger = ref([]); const ledgerLoading = ref(false); const penaltyForm = ref({ amount: 0, reason: "" }); const penaltySubmitting = ref(false); const penaltyError = ref(""); const penaltySuccess = ref(""); const rewardForm = ref({ xp_amount: 0, social_amount: 0, reason: "" }); const rewardSubmitting = ref(false); const rewardError = ref(""); const rewardSuccess = ref(""); function restrictionLabel(level) { switch (level) { case 1: return t("gamification.user_detail.restriction_mild"); case 2: return t("gamification.user_detail.restriction_moderate"); case 3: return t("gamification.user_detail.restriction_severe"); default: return `${level}. ${t("gamification.user_detail.restriction_level")}`; } } return (_ctx, _push, _parent, _attrs) => { _push(`
${ssrInterpolate(unref(t)("gamification.user_detail.user_id"))} #${ssrInterpolate(_ctx.$route.params.id)}
${ssrInterpolate(unref(t)("gamification.user_detail.load_error"))}
${ssrInterpolate(unref(t)("gamification.user_detail.not_found"))}
${ssrInterpolate(unref(formatNumber)(unref(stats).total_xp))}
${ssrInterpolate(unref(stats).current_level)}
${ssrInterpolate(unref(formatNumber)(unref(stats).total_points))}
${ssrInterpolate(unref(formatNumber)(unref(stats).social_points))}
${ssrInterpolate(unref(stats).penalty_points > 0 ? `-${unref(stats).penalty_points}` : "0")}
${ssrInterpolate(unref(stats).restriction_level > 0 ? restrictionLabel(unref(stats).restriction_level) : unref(t)("gamification.user_detail.none"))}
${ssrInterpolate(unref(stats).penalty_quota_remaining)}
${ssrInterpolate(unref(stats).banned_until ? unref(formatDate)(unref(stats).banned_until) : unref(t)("gamification.user_detail.no"))}
${ssrInterpolate(unref(stats).services_submitted)}
${ssrInterpolate(unref(stats).places_discovered)}
${ssrInterpolate(unref(stats).places_validated)}
${ssrInterpolate(unref(stats).providers_added_count)}
${ssrInterpolate(unref(penaltyError))}
`); } else { _push(``); } if (unref(penaltySuccess)) { _push(`${ssrInterpolate(unref(penaltySuccess))}
`); } else { _push(``); } _push(`${ssrInterpolate(unref(rewardError))}
`); } else { _push(``); } if (unref(rewardSuccess)) { _push(`${ssrInterpolate(unref(rewardSuccess))}
`); } else { _push(``); } _push(`| ${ssrInterpolate(unref(t)("gamification.user_detail.ledger_col_date"))} | ${ssrInterpolate(unref(t)("gamification.user_detail.ledger_col_points"))} | ${ssrInterpolate(unref(t)("gamification.user_detail.ledger_col_penalty"))} | ${ssrInterpolate(unref(t)("gamification.user_detail.ledger_col_xp"))} | ${ssrInterpolate(unref(t)("gamification.user_detail.ledger_col_reason"))} | ${ssrInterpolate(unref(t)("gamification.user_detail.ledger_col_source"))} |
|---|---|---|---|---|---|
| ${ssrInterpolate(unref(formatDateTime)(entry.created_at))} | ${ssrInterpolate(entry.points >= 0 ? "+" : "")}${ssrInterpolate(entry.points)} | ${ssrInterpolate(entry.penalty_change ? `-${entry.penalty_change}` : "\u2014")} | ${ssrInterpolate((_a = entry.xp) != null ? _a : "\u2014")} | ${ssrInterpolate(entry.reason)} | `); if (entry.source_type) { _push(`${ssrInterpolate(entry.source_type)}${ssrInterpolate(entry.source_id ? ` #${entry.source_id}` : "")}`); } else { _push(`\u2014`); } _push(` |