{"version":3,"file":"inflightDeviceRegistration.mjs","sources":["../../../../../../src/pushNotifications/providers/pinpoint/utils/inflightDeviceRegistration.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { PushNotificationError } from '../../../errors';\nconst inflightDeviceRegistrationResolver = {};\nlet inflightDeviceRegistration = new Promise((resolve, reject) => {\n    inflightDeviceRegistrationResolver.resolve = resolve;\n    inflightDeviceRegistrationResolver.reject = reject;\n});\nexport const getInflightDeviceRegistration = () => inflightDeviceRegistration;\nexport const resolveInflightDeviceRegistration = () => {\n    inflightDeviceRegistrationResolver.resolve?.();\n    // release promise from memory\n    inflightDeviceRegistration = undefined;\n};\nexport const rejectInflightDeviceRegistration = (underlyingError) => {\n    inflightDeviceRegistrationResolver.reject?.(new PushNotificationError({\n        name: 'DeviceRegistrationFailed',\n        message: 'Failed to register device for push notifications.',\n        underlyingError,\n    }));\n    // release promise from memory\n    inflightDeviceRegistration = undefined;\n};\n"],"names":[],"mappings":";;;AAAA;AACA;AAEA,MAAM,kCAAkC,GAAG,EAAE;AAC7C,IAAI,0BAA0B,GAAG,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,KAAK;AAClE,IAAI,kCAAkC,CAAC,OAAO,GAAG,OAAO;AACxD,IAAI,kCAAkC,CAAC,MAAM,GAAG,MAAM;AACtD,CAAC,CAAC;AACU,MAAC,6BAA6B,GAAG,MAAM;AACvC,MAAC,iCAAiC,GAAG,MAAM;AACvD,IAAI,kCAAkC,CAAC,OAAO,IAAI;AAClD;AACA,IAAI,0BAA0B,GAAG,SAAS;AAC1C;AACY,MAAC,gCAAgC,GAAG,CAAC,eAAe,KAAK;AACrE,IAAI,kCAAkC,CAAC,MAAM,GAAG,IAAI,qBAAqB,CAAC;AAC1E,QAAQ,IAAI,EAAE,0BAA0B;AACxC,QAAQ,OAAO,EAAE,mDAAmD;AACpE,QAAQ,eAAe;AACvB,KAAK,CAAC,CAAC;AACP;AACA,IAAI,0BAA0B,GAAG,SAAS;AAC1C;;;;"}