import { defineComponent, ref, reactive, unref, useSSRContext } from "vue"; import { ssrRenderAttrs, ssrInterpolate, ssrRenderList, ssrRenderAttr, ssrRenderClass, ssrIncludeBooleanAttr, ssrLooseContain } from "vue/server-renderer"; import "/app/node_modules/hookable/dist/index.mjs"; import "/app/node_modules/klona/dist/index.mjs"; import { a as useI18n } from "../server.mjs"; import { _ as _export_sfc } from "./_plugin-vue_export-helper-1tPrXgE0.js"; 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 "vue-router"; 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: "point-rules", __ssrInlineRender: true, setup(__props) { const { t } = useI18n(); const loading = ref(true); const error = ref(false); const rules = ref([]); const showModal = ref(false); const showDeleteModal = ref(false); const editingRule = ref(null); const deletingRule = ref(null); const saving = ref(false); const formError = ref(""); const toast = ref(""); const editingCell = ref(null); const editValue = ref(""); ref(null); ref(false); const form = reactive({ action_key: "", points: 0, description: "", is_active: true }); function isEditing(ruleId, field) { return editingCell.value?.id === ruleId && editingCell.value?.field === field; } return (_ctx, _push, _parent, _attrs) => { _push(`
${ssrInterpolate(unref(t)("gamification.point_rules.subtitle"))}
${ssrInterpolate(unref(t)("gamification.point_rules.error"))}
| ${ssrInterpolate(unref(t)("gamification.point_rules.id"))} | ${ssrInterpolate(unref(t)("gamification.point_rules.action_key"))} | ${ssrInterpolate(unref(t)("gamification.point_rules.points"))} | ${ssrInterpolate(unref(t)("gamification.point_rules.description"))} | ${ssrInterpolate(unref(t)("gamification.point_rules.status"))} | ${ssrInterpolate(unref(t)("gamification.point_rules.actions"))} |
|---|---|---|---|---|---|
| ${ssrInterpolate(rule.id)} | `);
if (isEditing(rule.id, "action_key")) {
_push(``);
} else {
_push(`${ssrInterpolate(rule.action_key)}`);
}
_push(` | `); if (isEditing(rule.id, "points")) { _push(``); } else { _push(`${ssrInterpolate(rule.points >= 0 ? "+" : "")}${ssrInterpolate(rule.points)}`); } _push(` | `); if (isEditing(rule.id, "description")) { _push(``); } else { _push(`${ssrInterpolate(rule.description || "—")}`); } _push(` | `); if (isEditing(rule.id, "is_active")) { _push(``); } else { _push(`${ssrInterpolate(rule.is_active ? unref(t)("gamification.point_rules.active") : unref(t)("gamification.point_rules.inactive"))}`); } _push(` | |
| ${ssrInterpolate(unref(t)("gamification.point_rules.no_items"))} | |||||
${ssrInterpolate(unref(t)("gamification.point_rules.delete_confirm", { name: deletingRule.value?.action_key }))}