{"version":3,"file":"registryAccess-BkJDdh-3.mjs","names":[],"sources":["../src/utils/registryAccess.ts"],"sourcesContent":["import type {Ref} from 'vue'\nimport type {RegisterShowHideInstances, RegisterShowHideMapValue} from './keys'\n\n/**\n * Gets the active show/hide instance for a given ID.\n * Uses getActive() which returns the most recent instance to handle UID disambiguation.\n *\n * @param registry - The show/hide registry ref (or null)\n * @param id - The component ID to look up (or falsy value)\n * @returns The active show/hide instance, undefined if not found, or null if id is falsy\n */\nexport const getActiveShowHide = (\n  registry: Ref<Map<string, RegisterShowHideInstances>> | null,\n  id: string | undefined\n): RegisterShowHideMapValue | undefined | null => {\n  if (!id) return null\n  if (!registry) return undefined\n  const holder = registry.value.get(id)\n  return holder?.getActive()\n}\n\n/**\n * Gets the boolean visibility state of a show/hide component.\n *\n * @param registry - The show/hide registry ref (or null)\n * @param id - The component ID to look up\n * @returns The visibility state (true if shown), or false if not found\n */\nexport const getShowHideValue = (\n  registry: Ref<Map<string, RegisterShowHideInstances>> | null,\n  id: string\n): boolean => {\n  const instance = getActiveShowHide(registry, id)\n  return instance?.value.value ?? false\n}\n"],"mappings":";;;;;;;;;AAWA,IAAa,qBACX,UACA,OACgD;AAChD,KAAI,CAAC,GAAI,QAAO;AAChB,KAAI,CAAC,SAAU,QAAO,KAAA;AAEtB,QADe,SAAS,MAAM,IAAI,GAAG,EACtB,WAAW;;;;;;;;;AAU5B,IAAa,oBACX,UACA,OACY;AAEZ,QADiB,kBAAkB,UAAU,GAAG,EAC/B,MAAM,SAAS"}