/** * Inventory Rendering Module * Handles UI rendering for inventory v2 system */ import { extensionSettings, $inventoryContainer } from '../../core/state.js'; import { getInventoryRenderOptions, restoreFormStates } from '../interaction/inventoryActions.js'; import { updateInventoryItem } from '../interaction/inventoryEdit.js'; import { parseItems } from '../../utils/itemParser.js'; import { i18n } from '../../core/i18n.js'; // Type imports /** @typedef {import('../../types/inventory.js').InventoryV2} InventoryV2 */ /** * Converts a location name to a safe ID for use in HTML element IDs. * Must match the logic used in inventoryActions.js. * @param {string} locationName - The location name * @returns {string} Safe ID string */ export function getLocationId(locationName) { // Remove all non-alphanumeric characters except spaces, then replace spaces with hyphens return locationName.replace(/[^a-zA-Z0-9\s]/g, '').replace(/\s+/g, '-'); } /** * Renders the inventory sub-tab navigation (On Person, Stored, Assets) * @param {string} activeTab - Currently active sub-tab ('onPerson', 'stored', 'assets') * @returns {string} HTML for sub-tab navigation */ export function renderInventorySubTabs(activeTab = 'onPerson') { return `