%
const hasOwn = (name) => Object.prototype.hasOwnProperty.call(policy || {}, name);
const policyMode = (name) => !hasOwn(name) ? (allowInherit ? "inherit" : "off") : policy[name] === false ? "off" : "custom";
const windowValue = policy?.window && policy.window !== false ? policy.window : {};
const streamValue = policy?.perStream && policy.perStream !== false ? policy.perStream : {};
const requirementValue = policy?.requirement && policy.requirement !== false ? policy.requirement : {};
const costValue = policy?.cost && policy.cost !== false ? policy.cost : {};
const fieldPrefix = typeof namePrefix === "string" ? namePrefix : "";
const fieldName = (name) => `${fieldPrefix}${name}`;
const effectiveValues = typeof effective === "object" && effective ? effective : {};
const inheritOptionLabel = typeof inheritLabel === "string" && inheritLabel ? inheritLabel : "Use group/default";
const inheritedText = (name, fallback) => effectiveValues[name] || fallback;
%>