{"version":3,"file":"condition-store.cjs","names":["useGTContext","getReadonlyConditionStore"],"sources":["../../src/hooks/condition-store.ts"],"sourcesContent":["import { getReadonlyConditionStore } from '../condition-store/singleton-operations';\nimport { useGTContext } from '../context/context';\n\n/**\n * Returns the current locale.\n */\nexport function useLocale(): string {\n  const context = useGTContext();\n  return context ? context.locale : getReadonlyConditionStore().getLocale();\n}\n\n/**\n * Returns the current region, or undefined if no region is set.\n */\nexport function useRegion(): string | undefined {\n  const context = useGTContext();\n  return context ? context.region : getReadonlyConditionStore().getRegion();\n}\n\n/**\n * Returns the current enableI18n flag.\n */\nexport function useEnableI18n(): boolean {\n  const context = useGTContext();\n  return context\n    ? context.enableI18n\n    : getReadonlyConditionStore().getEnableI18n();\n}\n\nexport function useSetLocale(): (locale: string) => void {\n  const context = useGTContext();\n  return context ? context.setLocale : getReadonlyConditionStore().setLocale;\n}\n\nexport function useSetRegion(): (region: string | undefined) => void {\n  const context = useGTContext();\n  return context ? context.setRegion : getReadonlyConditionStore().setRegion;\n}\n\nexport function useSetEnableI18n(): (enabled: boolean) => void {\n  const context = useGTContext();\n  return context\n    ? context.setEnableI18n\n    : getReadonlyConditionStore().setEnableI18n;\n}\n"],"mappings":"mGAMA,SAAgB,GAAoB,CAClC,IAAM,EAAUA,EAAAA,cAAc,CAC9B,OAAO,EAAU,EAAQ,OAASC,EAAAA,mBAA2B,CAAC,WAAW,CAM3E,SAAgB,GAAgC,CAC9C,IAAM,EAAUD,EAAAA,cAAc,CAC9B,OAAO,EAAU,EAAQ,OAASC,EAAAA,mBAA2B,CAAC,WAAW,CAM3E,SAAgB,GAAyB,CACvC,IAAM,EAAUD,EAAAA,cAAc,CAC9B,OAAO,EACH,EAAQ,WACRC,EAAAA,mBAA2B,CAAC,eAAe,CAGjD,SAAgB,GAAyC,CACvD,IAAM,EAAUD,EAAAA,cAAc,CAC9B,OAAO,EAAU,EAAQ,UAAYC,EAAAA,mBAA2B,CAAC,UAGnE,SAAgB,GAAqD,CACnE,IAAM,EAAUD,EAAAA,cAAc,CAC9B,OAAO,EAAU,EAAQ,UAAYC,EAAAA,mBAA2B,CAAC,UAGnE,SAAgB,GAA+C,CAC7D,IAAM,EAAUD,EAAAA,cAAc,CAC9B,OAAO,EACH,EAAQ,cACRC,EAAAA,mBAA2B,CAAC"}