import { defineComponent, ref, computed, unref, useSSRContext } from 'vue'; import { ssrRenderAttrs, ssrInterpolate, ssrRenderList, ssrRenderAttr, ssrRenderClass, ssrIncludeBooleanAttr } from 'vue/server-renderer'; import { a as useI18n } from './server.mjs'; import { _ as _export_sfc } from './_plugin-vue_export-helper-1tPrXgE0.mjs'; 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 'pinia'; 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: "parameters", __ssrInlineRender: true, setup(__props) { const { t } = useI18n(); const loading = ref(true); const error = ref(false); const saving = ref(false); const params = ref([]); const showModal = ref(false); const editingParam = ref(null); const editValue = ref(""); const formError = ref(""); const toast = ref(""); const isJsonValue = computed(() => { if (!editValue.value) return false; const trimmed = editValue.value.trim(); return trimmed.startsWith("{") && trimmed.endsWith("}") || trimmed.startsWith("[") && trimmed.endsWith("]"); }); function formatValue(value) { if (value === null || value === void 0) return "\u2014"; if (typeof value === "object") { try { return JSON.stringify(value); } catch { return String(value); } } return String(value); } function truncateValue(val, maxLen) { if (val.length <= maxLen) return val; return val.substring(0, maxLen) + "..."; } function scopeBadgeClass(scope) { switch (scope == null ? void 0 : scope.toLowerCase()) { case "global": return "bg-emerald-500/10 text-emerald-400"; case "country": return "bg-blue-500/10 text-blue-400"; case "region": return "bg-violet-500/10 text-violet-400"; case "user": return "bg-amber-500/10 text-amber-400"; default: return "bg-slate-500/10 text-slate-400"; } } return (_ctx, _push, _parent, _attrs) => { var _a; _push(`
${ssrInterpolate(unref(t)("gamification.params.subtitle"))}
${ssrInterpolate(unref(t)("gamification.params.load_error"))}
| ${ssrInterpolate(unref(t)("gamification.params.col_key"))} | ${ssrInterpolate(unref(t)("gamification.params.col_value"))} | ${ssrInterpolate(unref(t)("gamification.params.col_category"))} | ${ssrInterpolate(unref(t)("gamification.params.col_scope"))} | ${ssrInterpolate(unref(t)("gamification.params.col_scope_id"))} | ${ssrInterpolate(unref(t)("gamification.params.col_actions"))} |
|---|---|---|---|---|---|
${ssrInterpolate(param.key)} | ${ssrInterpolate(truncateValue(formatValue(param.value), 60))} | ${ssrInterpolate(param.category || "\u2014")} | ${ssrInterpolate(param.scope_level)} | ${ssrInterpolate(param.scope_id || "\u2014")} | |
| ${ssrInterpolate(unref(t)("gamification.params.empty"))} | |||||
${ssrInterpolate((_a = unref(editingParam)) == null ? void 0 : _a.key)}