{"version":3,"sources":["jsdelivr-header.js","/npm/expo-tracking-transparency@55.0.8/src/TrackingTransparency.ts"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,OCJE,iBAGA,oBACA,yBACK,2BACE,aAAgB,sBAElB,6BAA8B,oCAyC/B,SAAU,mBACd,MAAM,EAAgB,yBAAyB,mBAC/C,MAAsB,yCAAlB,EACK,KAEF,CACT,CAEA,MAAM,iCAAuD,CAC3D,SAAS,EACT,QAAS,QACT,aAAa,EACb,OAAQ,iBAAiB,gBAsBpB,eAAe,kCACpB,GAAoB,QAAhB,SAAS,GACX,OAAO,QAAQ,QAAQ,kCAGzB,IAAK,yBAAyB,wBAC5B,MAAM,IAAI,oBAAoB,uBAAwB,2BAExD,aAAa,yBAAyB,yBACxC,QAiBO,eAAe,8BACpB,GAAoB,QAAhB,SAAS,GACX,OAAO,QAAQ,QAAQ,kCAGzB,IAAK,yBAAyB,oBAC5B,MAAM,IAAI,oBAAoB,uBAAwB,uBAExD,aAAa,yBAAyB,qBACxC,QAiBO,MAAM,uBAAyB,qBAAqB,CACzD,UAAW,4BACX,cAAe,yCASX,SAAU,cACd,OAAO,QAAQ,yBACjB,QAE6B","file":"/npm/expo-tracking-transparency@55.0.8/build/TrackingTransparency.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/expo-tracking-transparency@55.0.8/build/TrackingTransparency.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","import {\n  PermissionResponse,\n  PermissionStatus,\n  PermissionExpiration,\n  PermissionHookOptions,\n  UnavailabilityError,\n  createPermissionHook,\n} from 'expo-modules-core';\nimport { Platform } from 'react-native';\n\nimport ExpoTrackingTransparency from './ExpoTrackingTransparency';\n\n/**\n * Gets the advertising ID, a UUID string intended only for advertising. Use this string for\n * frequency capping, attribution, conversion events, estimating the number of unique users,\n * advertising fraud detection, and debugging.\n *\n * As a best practice, don't store the advertising ID. Instead, call this function each time your\n * app needs to use the advertising ID. Users can change whether they allow app tracking and can\n * reset their advertising ID at any time in their system settings. Check your app's authorization\n * using [`getTrackingPermissionsAsync()`](#gettrackingpermissionsasync) to determine the user's\n * intent.\n *\n * On Android, this function returns the \"Android Advertising ID\"\n * ([AAID](https://developers.google.com/android/reference/com/google/android/gms/ads/identifier/AdvertisingIdClient.Info#public-string-getid)).\n * On Android devices that support multiple users, including guest users, it's possible for your app\n * to obtain different advertising IDs on the same device. These different IDs correspond to\n * different users who could be signed in on that device. See Google's documentation for more\n * information: [Get a user-resettable advertising\n * ID](https://developer.android.com/training/articles/ad-id).\n *\n * On iOS, this function returns the \"Identifier for Advertisers\"\n * ([IDFA](https://developer.apple.com/documentation/adsupport/asidentifiermanager/advertisingidentifier)),\n * a string that's unique to each device. Your app must request tracking authorization using\n * [`requestTrackingPermissionsAsync()`](#requesttrackingpermissionsasync) before it can get the\n * advertising identifier.\n *\n * @return Returns either a UUID `string` or `null`. It returns null in the following cases:\n * - On Android, when `isLimitAdTrackingEnabled()` is `true`\n * - In the iOS simulator, regardless of any settings\n * - On iOS if you haven't received permission using [`requestTrackingPermissionsAsync()`](#requesttrackingpermissionsasync)\n * - On iOS, if you've requested permission and the user declines\n * - On iOS, when a profile or configuration restricts access to the advertising identifier, such as\n *   when the user has turned off the system-wide \"Allow Apps to Request to Track\" setting\n *\n * @example\n * ```ts\n * TrackingTransparency.getAdvertisingId();\n * // \"E9228286-4C4E-4789-9D95-15827DCB291B\"\n * ```\n */\nexport function getAdvertisingId(): string | null {\n  const advertisingId = ExpoTrackingTransparency.getAdvertisingId();\n  if (advertisingId === '00000000-0000-0000-0000-000000000000') {\n    return null;\n  }\n  return advertisingId;\n}\n\nconst androidAndWebPermissionsResponse: PermissionResponse = {\n  granted: true,\n  expires: 'never',\n  canAskAgain: true,\n  status: PermissionStatus.GRANTED,\n};\n\n/**\n * Requests the user to authorize or deny access to app-related data that can be used for tracking\n * the user or the device. Examples of data used for tracking include email address, device ID,\n * advertising ID, and so on. On iOS, if the user denies this permission, any attempt to collect the\n * IDFA will return a string of 0s.\n *\n * The system remembers the user’s choice and doesn’t prompt again unless a user uninstalls and then\n * reinstalls the app on the device.\n *\n * On Android and web, this method always returns that the permission was granted.\n * @example\n * ```typescript\n * const { granted } = await requestTrackingPermissionsAsync();\n *\n * if (granted) {\n *   // Your app is authorized to track the user or their device\n * }\n * ```\n */\nexport async function requestTrackingPermissionsAsync(): Promise<PermissionResponse> {\n  if (Platform.OS !== 'ios') {\n    return Promise.resolve(androidAndWebPermissionsResponse);\n  }\n\n  if (!ExpoTrackingTransparency.requestPermissionsAsync) {\n    throw new UnavailabilityError('TrackingTransparency', 'requestPermissionsAsync');\n  }\n  return await ExpoTrackingTransparency.requestPermissionsAsync();\n}\n\n/**\n * Checks whether or not the user has authorized the app to access app-related data that can be used\n * for tracking the user or the device. See `requestTrackingPermissionsAsync` for more details.\n *\n * On Android and web, this method always returns that the permission was granted.\n *\n * @example\n * ```typescript\n * const { granted } = await getTrackingPermissionsAsync();\n *\n * if (granted) {\n *   // Your app is authorized to track the user or their device\n * }\n * ```\n */\nexport async function getTrackingPermissionsAsync(): Promise<PermissionResponse> {\n  if (Platform.OS !== 'ios') {\n    return Promise.resolve(androidAndWebPermissionsResponse);\n  }\n\n  if (!ExpoTrackingTransparency.getPermissionsAsync) {\n    throw new UnavailabilityError('TrackingTransparency', 'getPermissionsAsync');\n  }\n  return await ExpoTrackingTransparency.getPermissionsAsync();\n}\n\n/**\n * Check or request the user to authorize or deny access to app-related data that can be used for tracking\n * the user or the device. Examples of data used for tracking include email address, device ID,\n * advertising ID, and so on. On iOS, if the user denies this permission, any attempt to collect the\n * IDFA will return a string of 0s.\n *\n * The system remembers the user’s choice and doesn’t prompt again unless a user uninstalls and then\n * reinstalls the app on the device.\n *\n * On Android and web, this method always returns that the permission was granted.\n * @example\n * ```ts\n * const [status, requestPermission] = useTrackingPermissions();\n * ```\n */\nexport const useTrackingPermissions = createPermissionHook({\n  getMethod: getTrackingPermissionsAsync,\n  requestMethod: requestTrackingPermissionsAsync,\n});\n\n/**\n * Returns whether the TrackingTransparency API is available on the current device.\n *\n * @returns On devices where the Tracking Transparency API is unavailable,\n * the get and request permissions methods will always resolve to `granted`.\n */\nexport function isAvailable(): boolean {\n  return Boolean(ExpoTrackingTransparency);\n}\n\nexport { PermissionResponse, PermissionStatus, PermissionExpiration, PermissionHookOptions };\n"]}