appsonair-react-native-apppush 0.0.1-alpha

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +540 -0
  3. package/android/build.gradle +177 -0
  4. package/android/gradle.properties +15 -0
  5. package/android/src/main/AndroidManifest.xml +2 -0
  6. package/android/src/main/AndroidManifestNew.xml +2 -0
  7. package/android/src/main/java/com/appsonairreactnativeapppush/AppsonairReactNativeApppushModuleImpl.kt +767 -0
  8. package/android/src/main/java/com/appsonairreactnativeapppush/AppsonairReactNativeApppushPackage.kt +43 -0
  9. package/android/src/newarch/java/com/appsonairreactnativeapppush/AppsonairReactNativeApppushModule.kt +199 -0
  10. package/android/src/oldarch/java/com/appsonairreactnativeapppush/AppsonairReactNativeApppushModule.kt +249 -0
  11. package/appsonair-react-native-apppush.podspec +77 -0
  12. package/ios/AppsonairReactNativeApppush-Bridging-Header.h +12 -0
  13. package/ios/AppsonairReactNativeApppush.h +28 -0
  14. package/ios/AppsonairReactNativeApppush.mm +494 -0
  15. package/ios/AppsonairReactNativeApppushImpl.swift +594 -0
  16. package/lib/commonjs/NativeAppsonairApppush.js +48 -0
  17. package/lib/commonjs/NativeAppsonairApppush.js.map +1 -0
  18. package/lib/commonjs/index.js +686 -0
  19. package/lib/commonjs/index.js.map +1 -0
  20. package/lib/commonjs/types.js +2 -0
  21. package/lib/commonjs/types.js.map +1 -0
  22. package/lib/module/NativeAppsonairApppush.js +47 -0
  23. package/lib/module/NativeAppsonairApppush.js.map +1 -0
  24. package/lib/module/index.js +612 -0
  25. package/lib/module/index.js.map +1 -0
  26. package/lib/module/types.js +2 -0
  27. package/lib/module/types.js.map +1 -0
  28. package/lib/typescript/commonjs/package.json +1 -0
  29. package/lib/typescript/commonjs/src/NativeAppsonairApppush.d.ts +134 -0
  30. package/lib/typescript/commonjs/src/NativeAppsonairApppush.d.ts.map +1 -0
  31. package/lib/typescript/commonjs/src/index.d.ts +392 -0
  32. package/lib/typescript/commonjs/src/index.d.ts.map +1 -0
  33. package/lib/typescript/commonjs/src/types.d.ts +221 -0
  34. package/lib/typescript/commonjs/src/types.d.ts.map +1 -0
  35. package/lib/typescript/module/package.json +1 -0
  36. package/lib/typescript/module/src/NativeAppsonairApppush.d.ts +134 -0
  37. package/lib/typescript/module/src/NativeAppsonairApppush.d.ts.map +1 -0
  38. package/lib/typescript/module/src/index.d.ts +392 -0
  39. package/lib/typescript/module/src/index.d.ts.map +1 -0
  40. package/lib/typescript/module/src/types.d.ts +221 -0
  41. package/lib/typescript/module/src/types.d.ts.map +1 -0
  42. package/package.json +119 -0
  43. package/react-native.config.js +14 -0
  44. package/src/NativeAppsonairApppush.ts +188 -0
  45. package/src/index.tsx +745 -0
  46. package/src/types.ts +284 -0
@@ -0,0 +1,221 @@
1
+ /**
2
+ * Cross-platform types for the AppsOnAir Push SDK.
3
+ *
4
+ * Where the two native SDKs disagree, this file defines the single shape the
5
+ * wrapper exposes and the native bridges normalise to. Every such decision
6
+ * traces to a row in `appsonair-push-notification-android/CROSS_PLATFORM_PARITY.md`;
7
+ * the row id is cited so the reason survives.
8
+ */
9
+ export interface PushConfig {
10
+ /** Print SDK logs to the console. Keep `false` in production. */
11
+ debug?: boolean;
12
+ }
13
+ /**
14
+ * There is deliberately no `appGroupId` option.
15
+ *
16
+ * The parity audit's A1 row proposes one, but the native iOS initializer is
17
+ * `initialize(debug:swizzle:)` — it takes no App Group argument. iOS resolves the
18
+ * group itself, from an `AppsOnAirAppGroup` string in the app's Info.plist, else
19
+ * the convention `group.<bundle-id>.appsonair`. Accepting the value here would be
20
+ * a knob that silently does nothing, so it is configured where it is actually
21
+ * read. See the README's iOS setup section.
22
+ */
23
+ /** An action button attached to the notification payload. */
24
+ export interface NotificationActionButton {
25
+ id: string;
26
+ title: string;
27
+ }
28
+ /** A media attachment, or one entry synthesised from `imageUrl`. */
29
+ export interface NotificationAttachment {
30
+ id: string | null;
31
+ url: string;
32
+ }
33
+ /**
34
+ * A received or tapped notification.
35
+ *
36
+ * Parity C1: iOS emits 14 fields, Android 6. This is the union — fields the
37
+ * running platform cannot source resolve to `null` (or `[]`), never `undefined`.
38
+ * The per-field platform notes below are the authoritative support matrix.
39
+ */
40
+ export interface PushNotification {
41
+ /** Payload `notification_id`. */
42
+ id: string | null;
43
+ /** Payload `campaign_id`. **iOS only** — `null` on Android. */
44
+ campaignId: string | null;
45
+ /** Payload `template_id`. **iOS only** — `null` on Android. */
46
+ templateId: string | null;
47
+ /** Payload `sent_at`, ISO-8601 exactly as received. **iOS only.** */
48
+ sentAt: string | null;
49
+ title: string | null;
50
+ /** Second line above the body. **iOS only** — Android has no subtitle concept. */
51
+ subtitle: string | null;
52
+ body: string | null;
53
+ /** Payload `url` — deep link opened on tap. */
54
+ launchUrl: string | null;
55
+ /** Payload `image_url`. On iOS this loses to `attachments` when both are present. */
56
+ imageUrl: string | null;
57
+ /** Payload `attachments`. **iOS only** — always `[]` on Android. */
58
+ attachments: NotificationAttachment[];
59
+ /** Payload `actions`. Supported on both platforms. */
60
+ actionButtons: NotificationActionButton[];
61
+ /** Payload `badge_increment`. **iOS only** — `null` on Android. */
62
+ badgeIncrement: number | null;
63
+ /** Payload `collapse_id` (iOS) / `collapse_key` (Android). */
64
+ collapseId: string | null;
65
+ /** Sound file name in `res/raw`, no extension. **Android only** — `null` on iOS. */
66
+ sound: string | null;
67
+ /** Notification channel id. **Android only** — `null` on iOS. */
68
+ channelId: string | null;
69
+ /**
70
+ * Flattened string map of the payload's custom keys.
71
+ *
72
+ * Parity C1: Android's native `data` map is already `Map<String, String>`;
73
+ * the iOS bridge flattens `userInfo` to match, so this field has the same
74
+ * meaning on both platforms.
75
+ */
76
+ data: Record<string, string>;
77
+ /**
78
+ * The complete unmodified payload. Shapes differ per platform (APNs `userInfo`
79
+ * vs the FCM data bundle) — reach for `data` first, and use this only for keys
80
+ * that survive neither flattening nor the typed fields above.
81
+ */
82
+ rawPayload: Record<string, unknown>;
83
+ }
84
+ export interface TokenUpdatedEvent {
85
+ /** APNs hex token on iOS, FCM registration token on Android. */
86
+ token: string;
87
+ /**
88
+ * Parity B1/C8: which APNs endpoint the backend must use.
89
+ * **iOS only** — always `null` on Android, where FCM routes for you.
90
+ */
91
+ environment: 'sandbox' | 'production' | null;
92
+ }
93
+ export interface NotificationOpenedEvent {
94
+ notification: PushNotification;
95
+ /** `null` when the notification body was tapped; set for an action-button tap. */
96
+ actionId: string | null;
97
+ /** The payload's launch URL, if any. */
98
+ url: string | null;
99
+ }
100
+ export interface NotificationReceivedEvent {
101
+ notification: PushNotification;
102
+ }
103
+ /**
104
+ * Fired while the app is in the foreground, before the notification is displayed.
105
+ *
106
+ * Parity B4/F7: `preventDefault()` is exposed, presentation options are not —
107
+ * iOS lets the OS present, Android builds the notification itself, so any
108
+ * option set would mean different things on each platform.
109
+ */
110
+ export interface NotificationWillDisplayEvent {
111
+ notification: PushNotification;
112
+ /**
113
+ * Suppress the system notification. Must be called synchronously in the handler.
114
+ *
115
+ * **Honoured on Android only.** The Android SDK calls its foreground listeners
116
+ * on FCM's background thread, so the bridge can park there while JS decides.
117
+ * iOS's `handleWillPresent(notification:)` returns its presentation options
118
+ * synchronously with no completion handler to hold open, so by the time a JS
119
+ * handler runs the notification has already been presented. On iOS this event
120
+ * is informational and calling `preventDefault()` does nothing.
121
+ */
122
+ preventDefault: () => void;
123
+ }
124
+ export interface PermissionChangedEvent {
125
+ granted: boolean;
126
+ }
127
+ export interface PushSubscriptionState {
128
+ id: string | null;
129
+ token: string | null;
130
+ optedIn: boolean;
131
+ }
132
+ export interface PushSubscriptionChangedEvent {
133
+ previous: PushSubscriptionState;
134
+ current: PushSubscriptionState;
135
+ }
136
+ export interface UserState {
137
+ /** The external id linked via `login()`. `null` while anonymous. */
138
+ externalId: string | null;
139
+ /** The AppsOnAir-assigned device id. */
140
+ appsOnAirId: string;
141
+ }
142
+ export interface UserStateChangedEvent {
143
+ current: UserState;
144
+ }
145
+ /**
146
+ * A data-only push that is delivered without being displayed.
147
+ *
148
+ * Parity F5 — supported on both platforms, but the two are triggered
149
+ * differently and your backend has to send for both:
150
+ *
151
+ * - **iOS** uses the APNs transport flag, `content-available: 1`.
152
+ * - **Android** has no transport-level equivalent in FCM, so the SDK keys off a
153
+ * `silent: "true"` entry in the data payload. A data push *without* that key
154
+ * renders as a visible notification and fires no listener here.
155
+ *
156
+ * On iOS the OS completion handler is invoked as soon as the event is emitted,
157
+ * so a handler cannot extend the background execution window.
158
+ */
159
+ export interface SilentNotificationEvent {
160
+ data: Record<string, string>;
161
+ }
162
+ /** Firebase Installation ID. Parity B2: **Android only.** */
163
+ export interface InstallationIdEvent {
164
+ id: string;
165
+ }
166
+ /**
167
+ * Parity C5: the union of both platforms' error codes in one casing.
168
+ * `tokenRegistrationFailed` is the shared name for iOS `apnsRegistrationFailed`
169
+ * and Android `TOKEN_FETCH_FAILED`.
170
+ *
171
+ * Native `PushError.cause` is dropped — a `Throwable` does not cross the bridge.
172
+ */
173
+ export type PushErrorCode = 'notInitialized' | 'permissionDenied'
174
+ /** **Android only.** No `google-services.json`, or the plugin was not applied. */
175
+ | 'firebaseNotConfigured' | 'tokenRegistrationFailed' | 'installationIdFetchFailed' | 'unknown';
176
+ export interface PushErrorEvent {
177
+ code: PushErrorCode;
178
+ message: string;
179
+ }
180
+ /** Parity C6: one casing for both platforms; the bridge maps to the native enum. */
181
+ export type LogLevel = 'none' | 'fatal' | 'error' | 'warn' | 'info' | 'debug' | 'verbose';
182
+ /**
183
+ * Parity C7: iOS reports all five states. Android has no granular type and
184
+ * reports only `authorized` or `denied` — it can never return `notDetermined`,
185
+ * so do not branch on that value for a cross-platform pre-prompt.
186
+ */
187
+ export type PermissionStatus = 'notDetermined' | 'denied' | 'authorized' | 'provisional' | 'ephemeral';
188
+ export interface RequestPermissionOptions {
189
+ /**
190
+ * When permission was already permanently denied, send the user to the OS
191
+ * settings screen instead of failing silently. Defaults to `false`.
192
+ */
193
+ fallbackToSettings?: boolean;
194
+ }
195
+ /** Mirrors `NotificationManager.IMPORTANCE_*`. */
196
+ export type NotificationChannelImportance = 'none' | 'min' | 'low' | 'default' | 'high' | 'max';
197
+ /** Parity F4: **Android only.** A no-op on iOS, which has no channel concept. */
198
+ export interface NotificationChannelConfig {
199
+ id: string;
200
+ name: string;
201
+ importance?: NotificationChannelImportance;
202
+ description?: string;
203
+ /** Sound file name in `res/raw`, without extension. */
204
+ sound?: string;
205
+ }
206
+ /**
207
+ * Parity H1: the two native APIs share no method name, parameter, or unit —
208
+ * iOS takes seconds via BGTaskScheduler, Android minutes via WorkManager. This
209
+ * is the single shape; each bridge converts.
210
+ */
211
+ export interface BackgroundSyncOptions {
212
+ /** Defaults to 60. iOS converts to seconds and treats it as a *minimum* delay. */
213
+ intervalMinutes?: number;
214
+ /** Android WorkManager constraint. Ignored on iOS. Defaults to `true`. */
215
+ requireNetwork?: boolean;
216
+ }
217
+ /** Returned by every `on*` subscribe helper. Call `remove()` to unsubscribe. */
218
+ export interface Subscription {
219
+ remove: () => void;
220
+ }
221
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,MAAM,WAAW,UAAU;IACzB,iEAAiE;IACjE,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED;;;;;;;;;GASG;AAIH,6DAA6D;AAC7D,MAAM,WAAW,wBAAwB;IACvC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;CACf;AAED,oEAAoE;AACpE,MAAM,WAAW,sBAAsB;IACrC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC;CACb;AAED;;;;;;GAMG;AACH,MAAM,WAAW,gBAAgB;IAC/B,iCAAiC;IACjC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IAClB,+DAA+D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AM,GACN,OAAO,GACP,SAAS,CAAC;AAEd;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,GACxB,eAAe,GACf,QAAQ,GACR,YAAY,GACZ,aAAa,GACb,WAAW,CAAC;AAEhB,MAAM,WAAW,wBAAwB;IACvC;;;OAGG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAID,kDAAkD;AAClD,MAAM,MAAM,6BAA6B,GACrC,MAAM,GACN,KAAK,GACL,KAAK,GACL,SAAS,GACT,MAAM,GACN,KAAK,CAAC;AAEV,iFAAiF;AACjF,MAAM,WAAW,yBAAyB;IACxC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,6BAA6B,CAAC;IAC3C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,uDAAuD;IACvD,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAID;;;;GAIG;AACH,MAAM,WAAW,qBAAqB;IACpC,kFAAkF;IAClF,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,0EAA0E;IAC1E,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,gFAAgF;AAChF,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB"}
@@ -0,0 +1 @@
1
+ {"type":"module"}
@@ -0,0 +1,134 @@
1
+ import { type TurboModule } from 'react-native';
2
+ import type { UnsafeObject } from 'react-native/Libraries/Types/CodegenTypes';
3
+ /**
4
+ * Codegen spec for the AppsOnAir Push TurboModule.
5
+ *
6
+ * This file is consumed by React Native Codegen and compiles to
7
+ * `NativeAppsonairApppushSpec` — a Java abstract class and an ObjC protocol that
8
+ * the native modules implement under the New Architecture. On the Old
9
+ * Architecture the same JS object is served by the legacy bridge module, which
10
+ * exposes an identical method set (see android/src/oldarch and the
11
+ * `RCT_NEW_ARCH_ENABLED` guard in ios/AppsonairReactNativeApppush.mm).
12
+ *
13
+ * Constraints this file must respect — codegen rejects or silently mistypes
14
+ * anything else, so do not "improve" the signatures below:
15
+ *
16
+ * - Parameters and returns are primitives, nullable primitives, `Array<T>`,
17
+ * or `UnsafeObject`. Named object types are avoided deliberately -- see the
18
+ * note above `Spec`.
19
+ * - No string-literal unions. `logLevel`, `importance` and `environment` are
20
+ * plain `string` here and are narrowed to their union types in `index.tsx`,
21
+ * which is the type-safe surface consumers actually import.
22
+ * - No `Record<K, V>` — use `UnsafeObject`.
23
+ * - Methods are `Promise`-returning or `void`; there are no sync methods, so
24
+ * the module never blocks the JS thread.
25
+ */
26
+ /**
27
+ * Object parameters are `UnsafeObject`, not named object types, and that is
28
+ * load-bearing rather than lazy.
29
+ *
30
+ * Codegen compiles a named object type into a generated C++ struct, so the
31
+ * ObjC signature becomes `JS::NativeAppsonairApppush::NativePushConfig &` under the
32
+ * New Architecture while the Old Architecture bridge still passes
33
+ * `NSDictionary *`. The two would no longer share a selector, and
34
+ * ios/AppsonairReactNativeApppush.mm could not implement both from one method body.
35
+ * `UnsafeObject` maps to `NSDictionary *` on both, and to `ReadableMap` on both
36
+ * on Android.
37
+ *
38
+ * The shapes these accept are typed for consumers in src/types.ts -- `PushConfig`,
39
+ * `NotificationChannelConfig` and `BackgroundSyncOptions` -- which is the surface
40
+ * anyone actually imports. Nothing here is untyped at the call site.
41
+ */
42
+ export interface Spec extends TurboModule {
43
+ /**
44
+ * Parity A1/A2: the native signatures share zero parameters — iOS takes
45
+ * `(debug:swizzle:)`, Android takes `(context, debug)`. Each
46
+ * bridge supplies what its platform needs; `Context` is never exposed to JS.
47
+ */
48
+ initialize(config: UnsafeObject): Promise<void>;
49
+ getDeviceId(): Promise<string>;
50
+ getSubscriptionId(): Promise<string | null>;
51
+ setSubscriptionId(id: string): Promise<void>;
52
+ getExternalId(): Promise<string | null>;
53
+ login(externalId: string): Promise<void>;
54
+ logout(): Promise<void>;
55
+ /** APNs hex token on iOS, FCM token on Android. `null` before registration. */
56
+ getToken(): Promise<string | null>;
57
+ /** Parity D4: Android/FCM only. Resolves immediately as a no-op on iOS. */
58
+ refreshToken(): Promise<void>;
59
+ /** Parity B2: Android only. Resolves `null` on iOS. */
60
+ getInstallationId(): Promise<string | null>;
61
+ /** Parity C8: iOS only. Resolves `null` on Android. */
62
+ getApnsEnvironment(): Promise<string | null>;
63
+ requestPermission(fallbackToSettings: boolean): Promise<boolean>;
64
+ getPermission(): Promise<boolean>;
65
+ getPermissionStatus(): Promise<string>;
66
+ canRequestPermission(): Promise<boolean>;
67
+ /** Parity E5: iOS only. Resolves as a no-op on Android. */
68
+ registerForProvisionalAuthorization(): Promise<void>;
69
+ clearAllNotifications(): Promise<void>;
70
+ removeNotification(notificationId: string): Promise<void>;
71
+ removeNotifications(notificationIds: Array<string>): Promise<void>;
72
+ /** Parity F3: Android only. Resolves as a no-op on iOS. */
73
+ removeNotificationGroup(groupKey: string): Promise<void>;
74
+ /** Parity F4: Android only. Resolves as a no-op on iOS. */
75
+ createNotificationChannel(config: UnsafeObject): Promise<void>;
76
+ /** Parity F4: Android only. Resolves as a no-op on iOS. */
77
+ deleteNotificationChannel(channelId: string): Promise<void>;
78
+ getBadgeCount(): Promise<number>;
79
+ setBadgeCount(count: number): Promise<void>;
80
+ incrementBadgeCount(delta: number): Promise<number>;
81
+ clearBadgeCount(): Promise<void>;
82
+ /** Parity G4: iOS only. Resolves as a no-op on Android. */
83
+ setAutoClearBadgeOnForeground(enabled: boolean): Promise<void>;
84
+ /** iOS only. Resolves as a no-op on Android, where FCM always registers. */
85
+ setAutoRegisterForRemoteNotifications(enabled: boolean): Promise<void>;
86
+ addTag(key: string, value: string): Promise<void>;
87
+ addTags(tags: UnsafeObject): Promise<void>;
88
+ removeTag(key: string): Promise<void>;
89
+ removeTags(keys: Array<string>): Promise<void>;
90
+ getTags(): Promise<UnsafeObject>;
91
+ addAlias(label: string, id: string): Promise<void>;
92
+ addAliases(aliases: UnsafeObject): Promise<void>;
93
+ removeAlias(label: string): Promise<void>;
94
+ removeAliases(labels: Array<string>): Promise<void>;
95
+ addEmail(address: string): Promise<void>;
96
+ removeEmail(address: string): Promise<void>;
97
+ setLanguage(languageCode: string): Promise<void>;
98
+ getLanguage(): Promise<string>;
99
+ /** Resolves `{ id, token, optedIn }` from local state on both platforms. */
100
+ getPushSubscription(): Promise<UnsafeObject>;
101
+ optIn(): Promise<void>;
102
+ optOut(): Promise<void>;
103
+ /**
104
+ * The subscription's enabled state as the backend sees it. Android reads it
105
+ * back from /subscriptions; iOS computes the same flag it would send.
106
+ */
107
+ getOptedIn(): Promise<boolean>;
108
+ setConsentRequired(required: boolean): Promise<void>;
109
+ getConsentRequired(): Promise<boolean>;
110
+ setConsentGiven(given: boolean): Promise<void>;
111
+ getConsentGiven(): Promise<boolean>;
112
+ setTestDevice(enabled: boolean): Promise<void>;
113
+ isTestDevice(): Promise<boolean>;
114
+ scheduleBackgroundSync(options: UnsafeObject): Promise<void>;
115
+ cancelBackgroundSync(): Promise<void>;
116
+ setLogLevel(level: string): Promise<void>;
117
+ /**
118
+ * Answers a pending `onNotificationWillDisplay` event. The native side holds
119
+ * the notification until this lands or the timeout elapses, which is what
120
+ * makes `preventDefault()` work across an async bridge.
121
+ *
122
+ * Not called directly — `onNotificationWillDisplay` wires it up.
123
+ */
124
+ completeNotificationWillDisplay(notificationId: string, display: boolean): Promise<void>;
125
+ /**
126
+ * Required by `NativeEventEmitter` on both architectures. Under the New
127
+ * Architecture these also satisfy the TurboModule event-emitter contract.
128
+ */
129
+ addListener(eventName: string): void;
130
+ removeListeners(count: number): void;
131
+ }
132
+ declare const _default: Spec;
133
+ export default _default;
134
+ //# sourceMappingURL=NativeAppsonairApppush.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NativeAppsonairApppush.d.ts","sourceRoot":"","sources":["../../../../src/NativeAppsonairApppush.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AACrE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2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