{"version":3,"file":"qualcomm-ui-angular-core-common.mjs","sources":["../../src/common/use-csr-check.ts","../../src/common/use-id.ts","../../src/common/use-is-destroyed.ts","../../src/common/use-is-mounted.ts","../../src/common/use-on-destroy.ts","../../src/common/use-ssr-check.ts","../../src/common/qualcomm-ui-angular-core-common.ts"],"sourcesContent":["// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nimport {isPlatformBrowser} from \"@angular/common\"\nimport {inject, PLATFORM_ID} from \"@angular/core\"\n\n/**\n * A utility function to determine whether the current rendering context is\n * client-side.\n *\n * This hook internally relies on Angular's `PLATFORM_ID` to check the execution\n * context and evaluates if the current platform is running on the client. It\n * returns a boolean function that can be invoked to check the CSR status\n * dynamically.\n *\n * @returns A function that returns true if the rendering platform is client-side, false otherwise.\n */\nexport function useCsrCheck(): () => boolean {\n  const platformId = inject(PLATFORM_ID)\n\n  return (): boolean => {\n    return isPlatformBrowser(platformId)\n  }\n}\n","// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nlet counter = 0\n\nexport function useId(_component: object, id: string | undefined | null) {\n  if (id) {\n    return id\n  }\n  return `«auto::${(++counter).toString(32)}»`\n}\n","// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nimport {DestroyRef, inject} from \"@angular/core\"\n\n/**\n * Creates a utility that provides a check for whether a component has been\n * destroyed.\n *\n * @returns A single method for checking the destroy status of the component.\n */\nexport function useIsDestroyed(): () => boolean {\n  const destroyRef = inject(DestroyRef)\n  let destroyed = false\n  destroyRef.onDestroy(() => {\n    destroyed = true\n  })\n  return () => {\n    return destroyed\n  }\n}\n","// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nimport {useIsDestroyed} from \"./use-is-destroyed\"\n\n/**\n * Creates a utility that provides a check for whether a component is still mounted.\n *\n * @returns A single method for checking the status of the component.\n */\nexport function useIsMounted(): () => boolean {\n  const isDestroyed = useIsDestroyed()\n  return () => {\n    return !isDestroyed()\n  }\n}\n","// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nimport {DestroyRef, inject} from \"@angular/core\"\n\n/**\n * Creates a utility that provides component cleanup functionality\n * using Angular's DestroyRef.\n *\n * @returns A single method for registering a cleanup callback.\n */\nexport function useOnDestroy() {\n  const destroyRef = inject(DestroyRef)\n\n  return (callback: () => void): void => {\n    destroyRef.onDestroy(callback)\n  }\n}\n","// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nimport {isPlatformServer} from \"@angular/common\"\nimport {inject, PLATFORM_ID} from \"@angular/core\"\n\n/**\n * A utility function to determine whether the current rendering context is\n * server-side.\n *\n * This hook internally relies on Angular's `PLATFORM_ID` to check the execution\n * context and evaluates if the current platform is running on the server. It\n * returns a boolean function that can be invoked to check the SSR status\n * dynamically.\n *\n * @returns A function that returns true if the rendering platform is server-side, false otherwise.\n */\nexport function useSsrCheck(): () => boolean {\n  const platformId = inject(PLATFORM_ID)\n\n  return (): boolean => {\n    return isPlatformServer(platformId)\n  }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAAA;AACA;AAKA;;;;;;;;;;AAUG;SACa,WAAW,GAAA;AACzB,IAAA,MAAM,UAAU,GAAG,MAAM,CAAC,WAAW,CAAC;AAEtC,IAAA,OAAO,MAAc;AACnB,QAAA,OAAO,iBAAiB,CAAC,UAAU,CAAC;AACtC,IAAA,CAAC;AACH;;ACvBA;AACA;AAEA,IAAI,OAAO,GAAG,CAAC;AAET,SAAU,KAAK,CAAC,UAAkB,EAAE,EAA6B,EAAA;IACrE,IAAI,EAAE,EAAE;AACN,QAAA,OAAO,E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