@apps-in-toss/framework 0.0.39 → 1.0.0

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.
package/dist/index.cjs CHANGED
@@ -31,35 +31,52 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
31
31
  // src/index.ts
32
32
  var src_exports = {};
33
33
  __export(src_exports, {
34
- Accuracy: () => Accuracy2,
34
+ Accuracy: () => Accuracy,
35
35
  Analytics: () => Analytics2,
36
36
  AppsInToss: () => AppsInToss,
37
+ AppsInTossModule: () => AppsInTossModule,
38
+ BedrockCoreModule: () => BedrockCoreModule,
39
+ BedrockModule: () => BedrockModule,
37
40
  GoogleAdMob: () => GoogleAdMob,
38
41
  IAP: () => IAP,
42
+ INTERNAL__AppsInTossModule: () => AppsInTossModuleInstance,
43
+ INTERNAL__module: () => INTERNAL__module,
39
44
  INTERNAL__onVisibilityChangedByTransparentServiceWeb: () => INTERNAL__onVisibilityChangedByTransparentServiceWeb,
40
45
  Storage: () => Storage,
41
46
  TossPay: () => TossPay,
42
47
  WebView: () => WebView,
43
48
  appLogin: () => appLogin,
44
49
  appsInTossEvent: () => appsInTossEvent,
50
+ closeView: () => closeView,
45
51
  contactsViral: () => contactsViral,
46
52
  env: () => env,
47
53
  eventLog: () => eventLog,
48
54
  fetchAlbumPhotos: () => fetchAlbumPhotos,
49
55
  fetchContacts: () => fetchContacts,
56
+ generateHapticFeedback: () => generateHapticFeedback,
50
57
  getClipboardText: () => getClipboardText,
51
58
  getCurrentLocation: () => getCurrentLocation,
52
59
  getDeviceId: () => getDeviceId,
53
60
  getGameCenterGameProfile: () => getGameCenterGameProfile,
61
+ getLocale: () => getLocale,
62
+ getNetworkStatus: () => getNetworkStatus,
54
63
  getOperationalEnvironment: () => getOperationalEnvironment,
64
+ getPlatformOS: () => getPlatformOS,
65
+ getSchemeUri: () => getSchemeUri,
55
66
  getTossAppVersion: () => getTossAppVersion,
56
67
  getTossShareLink: () => getTossShareLink,
57
68
  isMinVersionSupported: () => isMinVersionSupported,
69
+ onVisibilityChangedByTransparentServiceWeb: () => onVisibilityChangedByTransparentServiceWeb,
58
70
  openCamera: () => openCamera,
59
71
  openGameCenterLeaderboard: () => openGameCenterLeaderboard,
72
+ openURL: () => openURL2,
60
73
  saveBase64Data: () => saveBase64Data,
61
74
  setClipboardText: () => setClipboardText,
62
75
  setDeviceOrientation: () => setDeviceOrientation,
76
+ setIosSwipeGestureEnabled: () => setIosSwipeGestureEnabled,
77
+ setScreenAwakeMode: () => setScreenAwakeMode,
78
+ setSecureScreen: () => setSecureScreen,
79
+ share: () => share,
63
80
  startUpdateLocation: () => startUpdateLocation,
64
81
  submitGameCenterLeaderBoardScore: () => submitGameCenterLeaderBoardScore,
65
82
  useCreateUserAgent: () => useCreateUserAgent,
@@ -70,267 +87,30 @@ var import_analytics2 = require("@apps-in-toss/analytics");
70
87
 
71
88
  // src/core/registerApp.tsx
72
89
  var import_analytics = require("@apps-in-toss/analytics");
73
- var import_react_native6 = require("@toss-design-system/react-native");
74
- var import_react_native_bedrock11 = require("react-native-bedrock");
75
90
 
76
- // src/core/components/AppEvent.tsx
77
- var import_react3 = require("react");
78
- var import_react_native_bedrock4 = require("react-native-bedrock");
79
-
80
- // src/env.ts
81
- var env = {
82
- getDeploymentId: () => __DEV__ ? "local" : global.__appsInToss?.deploymentId
83
- };
84
-
85
- // src/hooks/useCaptureExitLog.ts
86
- var import_react2 = require("react");
87
- var import_react_native_bedrock3 = require("react-native-bedrock");
88
-
89
- // src/core/hooks/useReferrer.ts
90
- var import_react = require("react");
91
- var import_react_native_bedrock = require("react-native-bedrock");
92
- function useReferrer() {
93
- return (0, import_react.useMemo)(() => {
94
- try {
95
- return new URL((0, import_react_native_bedrock.getSchemeUri)()).searchParams.get("referrer");
96
- } catch {
97
- return null;
98
- }
99
- }, []);
100
- }
101
-
102
- // src/native-modules/tossCore.ts
103
- var import_react_native3 = require("react-native");
104
-
105
- // src/native-modules/AppsInTossModule.ts
106
- var import_react_native = require("react-native");
107
- var AppsInTossModuleInstance = import_react_native.NativeModules.AppsInTossModule;
108
- var AppsInTossModule = AppsInTossModuleInstance;
109
-
110
- // src/native-modules/getOperationalEnvironment.ts
111
- function getOperationalEnvironment() {
112
- return AppsInTossModule.operationalEnvironment;
113
- }
114
-
115
- // src/native-modules/isMinVersionSupported.ts
116
- var import_react_native2 = require("react-native");
117
-
118
- // src/utils/compareVersion.ts
119
- var SEMVER_REGEX = /^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\\-]+(?:\.[\da-z\\-]+)*))?(?:\+[\da-z\\-]+(?:\.[\da-z\\-]+)*)?)?)?$/i;
120
- var isWildcard = (val) => ["*", "x", "X"].includes(val);
121
- var tryParse = (val) => {
122
- const num = parseInt(val, 10);
123
- return isNaN(num) ? val : num;
124
- };
125
- var coerceTypes = (a, b) => {
126
- return typeof a === typeof b ? [a, b] : [String(a), String(b)];
127
- };
128
- var compareValues = (a, b) => {
129
- if (isWildcard(a) || isWildcard(b)) {
130
- return 0;
131
- }
132
- const [aVal, bVal] = coerceTypes(tryParse(a), tryParse(b));
133
- if (aVal > bVal) {
134
- return 1;
135
- }
136
- if (aVal < bVal) {
137
- return -1;
138
- }
139
- return 0;
140
- };
141
- var parseVersion = (version) => {
142
- if (typeof version !== "string") {
143
- throw new TypeError("Invalid argument: expected a string");
144
- }
145
- const match = version.match(SEMVER_REGEX);
146
- if (!match) {
147
- throw new Error(`Invalid semver: '${version}'`);
148
- }
149
- const [, major, minor, patch, build, preRelease] = match;
150
- return [major, minor, patch, build, preRelease];
151
- };
152
- var compareSegments = (a, b) => {
153
- const maxLength = Math.max(a.length, b.length);
154
- for (let i = 0; i < maxLength; i++) {
155
- const segA = a[i] ?? "0";
156
- const segB = b[i] ?? "0";
157
- const result = compareValues(segA, segB);
158
- if (result !== 0) {
159
- return result;
160
- }
161
- }
162
- return 0;
163
- };
164
- var compareVersions = (v1, v2) => {
165
- const seg1 = parseVersion(v1);
166
- const seg2 = parseVersion(v2);
167
- const preRelease1 = seg1.pop();
168
- const preRelease2 = seg2.pop();
169
- const mainCompare = compareSegments(seg1, seg2);
170
- if (mainCompare !== 0) {
171
- return mainCompare;
172
- }
173
- if (preRelease1 && preRelease2) {
174
- return compareSegments(preRelease1.split("."), preRelease2.split("."));
175
- }
176
- if (preRelease1) {
177
- return -1;
178
- }
179
- if (preRelease2) {
180
- return 1;
181
- }
182
- return 0;
183
- };
184
-
185
- // src/native-modules/isMinVersionSupported.ts
186
- function isMinVersionSupported(minVersions) {
187
- const operationalEnvironment2 = AppsInTossModule.operationalEnvironment;
188
- if (operationalEnvironment2 === "sandbox") {
189
- return true;
190
- }
191
- const currentVersion = AppsInTossModule.tossAppVersion;
192
- const isIOS = import_react_native2.Platform.OS === "ios";
193
- const minVersion = isIOS ? minVersions.ios : minVersions.android;
194
- if (minVersion === void 0) {
195
- return false;
196
- }
197
- if (minVersion === "always") {
198
- return true;
199
- }
200
- if (minVersion === "never") {
201
- return false;
202
- }
203
- return compareVersions(currentVersion, minVersion) >= 0;
204
- }
205
-
206
- // src/native-modules/tossCore.ts
207
- var TossCoreModule = import_react_native3.NativeModules.TossCoreModule;
208
- function tossCoreEventLog(params) {
209
- const supported = isMinVersionSupported({ ios: "5.210.0", android: "5.210.0" });
210
- const isSandbox = getOperationalEnvironment() === "sandbox";
211
- if (!supported || isSandbox) {
212
- return;
213
- }
214
- TossCoreModule.eventLog({
215
- params: {
216
- log_name: params.log_name,
217
- log_type: params.log_type,
218
- params: params.params
219
- }
220
- });
221
- }
222
-
223
- // src/utils/isPrivateScheme.ts
224
- var import_react_native_bedrock2 = require("react-native-bedrock");
225
- function isPrivateScheme() {
226
- try {
227
- return new URL((0, import_react_native_bedrock2.getSchemeUri)()).protocol === "intoss-private:";
228
- } catch {
229
- return false;
230
- }
231
- }
232
-
233
- // src/hooks/useCaptureExitLog.ts
234
- var EXIT_IMPRESSION_LOG_NAME = "appsintoss_app_visit__common_module::impression__stay_time";
235
- var EXIT_IMPRESSION_SCHEMA_ID = 1631628;
236
- function useCaptureExitLog() {
237
- const referrer = useReferrer();
238
- const visible = (0, import_react_native_bedrock3.useVisibility)();
239
- const enterTime = (0, import_react2.useRef)(void 0);
240
- (0, import_react2.useEffect)(() => {
241
- if (visible === true) {
242
- enterTime.current = Date.now();
243
- }
244
- }, [visible]);
245
- const captureExitLog = (0, import_react2.useCallback)(
246
- (exitTime) => {
247
- if (enterTime.current == null) {
248
- return;
249
- }
250
- const stayTime = Math.floor(exitTime - enterTime.current);
251
- tossCoreEventLog({
252
- log_name: EXIT_IMPRESSION_LOG_NAME,
253
- log_type: "event",
254
- params: {
255
- schema_id: EXIT_IMPRESSION_SCHEMA_ID,
256
- event_type: "impression",
257
- referrer,
258
- deployment_id: env.getDeploymentId(),
259
- app_name: import_react_native_bedrock3.Bedrock.appName,
260
- is_private: isPrivateScheme(),
261
- stay_time: stayTime.toString(),
262
- exit_time: exitTime.toString()
263
- }
264
- });
265
- enterTime.current = void 0;
266
- },
267
- [referrer]
268
- );
269
- return { captureExitLog };
270
- }
91
+ // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/dist/index.js
92
+ var import_react_native = require("@granite-js/react-native");
93
+ var import_react_native2 = require("@granite-js/react-native");
94
+ var import_react_native3 = require("@granite-js/react-native");
95
+ var import_react_native4 = require("react-native");
96
+ var import_react_native5 = require("react-native");
97
+ var import_react_native6 = require("@granite-js/react-native");
98
+ var import_react_native7 = require("@granite-js/react-native");
99
+ var import_react_native8 = require("react-native");
271
100
 
272
- // src/core/components/AppEvent.tsx
273
- var ENTRY_APP_EVENT_SCHEMA_ID = 1562181;
274
- function EntryAppEvent() {
275
- const referrer = useReferrer() ?? "";
276
- (0, import_react3.useEffect)(() => {
277
- tossCoreEventLog({
278
- log_name: "appsintoss_app_visit::impression__enter_appsintoss",
279
- log_type: "info",
280
- params: {
281
- is_transform: true,
282
- schema_id: ENTRY_APP_EVENT_SCHEMA_ID,
283
- referrer,
284
- deployment_id: env.getDeploymentId(),
285
- app_name: import_react_native_bedrock4.Bedrock.appName,
286
- is_private: isPrivateScheme()
287
- }
288
- });
289
- }, [referrer]);
290
- return null;
291
- }
292
- function SystemAppEvent({ ...initialProps }) {
293
- (0, import_react3.useEffect)(() => {
294
- tossCoreEventLog({
295
- log_name: "AppsInTossInitialProps",
296
- log_type: "debug",
297
- params: {
298
- ...initialProps,
299
- schemeUri: (0, import_react_native_bedrock4.getSchemeUri)(),
300
- deployment_id: env.getDeploymentId(),
301
- app_name: import_react_native_bedrock4.Bedrock.appName,
302
- is_private: isPrivateScheme()
303
- }
304
- });
305
- }, [initialProps]);
306
- return null;
307
- }
308
- function StayTimeAppEvent() {
309
- const visible = (0, import_react_native_bedrock4.useVisibility)();
310
- const { captureExitLog } = useCaptureExitLog();
311
- (0, import_react3.useEffect)(() => {
312
- if (visible === false) {
313
- captureExitLog(Date.now());
314
- }
315
- }, [visible, captureExitLog]);
316
- return null;
101
+ // ../../.yarn/cache/es-toolkit-npm-1.39.3-b94f623c91-1c85e518b1.zip/node_modules/es-toolkit/dist/function/noop.mjs
102
+ function noop() {
317
103
  }
318
- var AppEvent = {
319
- Entry: EntryAppEvent,
320
- System: SystemAppEvent,
321
- StayTime: StayTimeAppEvent
322
- };
323
-
324
- // src/core/hooks/useAppsInTossBridge.ts
325
- var import_react_native5 = require("@toss-design-system/react-native");
326
- var import_react4 = require("react");
327
104
 
328
- // src/native-event-emitter/appsInTossEvent.ts
329
- var import_react_native_bedrock9 = require("react-native-bedrock");
330
-
331
- // src/native-event-emitter/event-plugins/EntryMessageExitedEvent.ts
332
- var import_react_native_bedrock5 = require("react-native-bedrock");
333
- var EntryMessageExitedEvent = class extends import_react_native_bedrock5.BedrockEventDefinition {
105
+ // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/dist/index.js
106
+ var import_react_native9 = require("@granite-js/react-native");
107
+ var import_react_native10 = require("react-native");
108
+ var import_react_native11 = require("react-native");
109
+ var import_react_native12 = require("react-native");
110
+ var import_react_native13 = require("react-native");
111
+ var import_react_native14 = require("react-native");
112
+ var import_react_native15 = require("react-native");
113
+ var EntryMessageExitedEvent = class extends import_react_native2.GraniteEventDefinition {
334
114
  name = "entryMessageExited";
335
115
  remove() {
336
116
  }
@@ -338,21 +118,15 @@ var EntryMessageExitedEvent = class extends import_react_native_bedrock5.Bedrock
338
118
  listener(_) {
339
119
  }
340
120
  };
341
-
342
- // src/native-event-emitter/event-plugins/UpdateLocationEvent.ts
343
- var import_react_native_bedrock6 = require("react-native-bedrock");
344
-
345
- // src/native-modules/getPermission.ts
121
+ var Module = import_react_native4.TurboModuleRegistry.getEnforcing("AppsInTossModule");
122
+ var AppsInTossModuleInstance = Module;
123
+ var AppsInTossModule = Module;
346
124
  function getPermission(permission) {
347
125
  return AppsInTossModule.getPermission(permission);
348
126
  }
349
-
350
- // src/native-modules/openPermissionDialog.ts
351
127
  function openPermissionDialog(permission) {
352
128
  return AppsInTossModule.openPermissionDialog(permission);
353
129
  }
354
-
355
- // src/native-modules/requestPermission.ts
356
130
  async function requestPermission(permission) {
357
131
  const permissionStatus = await getPermission(permission);
358
132
  switch (permissionStatus) {
@@ -363,13 +137,8 @@ async function requestPermission(permission) {
363
137
  return openPermissionDialog(permission);
364
138
  }
365
139
  }
366
-
367
- // src/native-event-emitter/nativeEventEmitter.ts
368
- var import_react_native4 = require("react-native");
369
- var nativeEventEmitter = new import_react_native4.NativeEventEmitter(AppsInTossModuleInstance);
370
-
371
- // src/native-event-emitter/event-plugins/UpdateLocationEvent.ts
372
- var UpdateLocationEvent = class extends import_react_native_bedrock6.BedrockEventDefinition {
140
+ var nativeEventEmitter = new import_react_native5.NativeEventEmitter(AppsInTossModuleInstance);
141
+ var UpdateLocationEvent = class extends import_react_native3.GraniteEventDefinition {
373
142
  name = "updateLocationEvent";
374
143
  subscriptionCount = 0;
375
144
  ref = {
@@ -397,16 +166,9 @@ var UpdateLocationEvent = class extends import_react_native_bedrock6.BedrockEven
397
166
  }).catch(onError);
398
167
  }
399
168
  };
400
-
401
- // src/native-event-emitter/internal/AppBridgeCallbackEvent.ts
402
- var import_react_native_bedrock7 = require("react-native-bedrock");
403
-
404
- // src/utils/generateUUID.ts
405
169
  function generateUUID(placeholder) {
406
170
  return placeholder ? (placeholder ^ Math.random() * 16 >> placeholder / 4).toString(16) : (String(1e7) + 1e3 + 4e3 + 8e3 + 1e11).replace(/[018]/g, generateUUID);
407
171
  }
408
-
409
- // src/native-event-emitter/internal/appBridge.ts
410
172
  var INTERNAL__callbacks = /* @__PURE__ */ new Map();
411
173
  function invokeAppBridgeCallback(id, ...args) {
412
174
  const callback = INTERNAL__callbacks.get(id);
@@ -453,10 +215,8 @@ var INTERNAL__appBridgeHandler = {
453
215
  unregisterCallback,
454
216
  getCallbackIds
455
217
  };
456
-
457
- // src/native-event-emitter/internal/AppBridgeCallbackEvent.ts
458
218
  var UNSAFE__nativeEventEmitter = nativeEventEmitter;
459
- var AppBridgeCallbackEvent = class _AppBridgeCallbackEvent extends import_react_native_bedrock7.BedrockEventDefinition {
219
+ var AppBridgeCallbackEvent = class _AppBridgeCallbackEvent extends import_react_native6.GraniteEventDefinition {
460
220
  static INTERNAL__appBridgeSubscription;
461
221
  name = "appBridgeCallbackEvent";
462
222
  constructor() {
@@ -484,10 +244,7 @@ var AppBridgeCallbackEvent = class _AppBridgeCallbackEvent extends import_react_
484
244
  }
485
245
  }
486
246
  };
487
-
488
- // src/native-event-emitter/internal/VisibilityChangedByTransparentServiceWebEvent.ts
489
- var import_react_native_bedrock8 = require("react-native-bedrock");
490
- var VisibilityChangedByTransparentServiceWebEvent = class extends import_react_native_bedrock8.BedrockEventDefinition {
247
+ var VisibilityChangedByTransparentServiceWebEvent = class extends import_react_native7.GraniteEventDefinition {
491
248
  name = "onVisibilityChangedByTransparentServiceWeb";
492
249
  subscription = null;
493
250
  remove() {
@@ -510,34 +267,673 @@ var VisibilityChangedByTransparentServiceWebEvent = class extends import_react_n
510
267
  return typeof params === "object" && typeof params.callbackId === "string" && typeof params.isVisible === "boolean";
511
268
  }
512
269
  };
513
-
514
- // src/native-event-emitter/appsInTossEvent.ts
515
- var appsInTossEvent = new import_react_native_bedrock9.BedrockEvent([
270
+ var appsInTossEvent = new import_react_native.GraniteEvent([
516
271
  new UpdateLocationEvent(),
517
272
  new EntryMessageExitedEvent(),
518
273
  // Internal events
519
274
  new AppBridgeCallbackEvent(),
520
275
  new VisibilityChangedByTransparentServiceWebEvent()
521
276
  ]);
522
-
523
- // src/core/utils/getAppsInTossGlobals.ts
524
- function getAppsInTossGlobals() {
525
- if (global.__appsInToss == null) {
526
- throw new Error("invalid apps-in-toss globals");
527
- }
528
- return global.__appsInToss;
529
- }
530
-
531
- // src/core/utils/toIcon.ts
532
- function toIcon(source) {
533
- return source.startsWith("http") ? { source: { uri: source } } : { name: source };
277
+ function startUpdateLocation(eventParams) {
278
+ return appsInTossEvent.addEventListener("updateLocationEvent", eventParams);
534
279
  }
535
-
536
- // src/core/hooks/useAppsInTossBridge.ts
280
+ var SEMVER_REGEX = /^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\\-]+(?:\.[\da-z\\-]+)*))?(?:\+[\da-z\\-]+(?:\.[\da-z\\-]+)*)?)?)?$/i;
281
+ var isWildcard = (val) => ["*", "x", "X"].includes(val);
282
+ var tryParse = (val) => {
283
+ const num = parseInt(val, 10);
284
+ return isNaN(num) ? val : num;
285
+ };
286
+ var coerceTypes = (a, b) => {
287
+ return typeof a === typeof b ? [a, b] : [String(a), String(b)];
288
+ };
289
+ var compareValues = (a, b) => {
290
+ if (isWildcard(a) || isWildcard(b)) {
291
+ return 0;
292
+ }
293
+ const [aVal, bVal] = coerceTypes(tryParse(a), tryParse(b));
294
+ if (aVal > bVal) {
295
+ return 1;
296
+ }
297
+ if (aVal < bVal) {
298
+ return -1;
299
+ }
300
+ return 0;
301
+ };
302
+ var parseVersion = (version) => {
303
+ if (typeof version !== "string") {
304
+ throw new TypeError("Invalid argument: expected a string");
305
+ }
306
+ const match = version.match(SEMVER_REGEX);
307
+ if (!match) {
308
+ throw new Error(`Invalid semver: '${version}'`);
309
+ }
310
+ const [, major, minor, patch, build, preRelease] = match;
311
+ return [major, minor, patch, build, preRelease];
312
+ };
313
+ var compareSegments = (a, b) => {
314
+ const maxLength = Math.max(a.length, b.length);
315
+ for (let i = 0; i < maxLength; i++) {
316
+ const segA = a[i] ?? "0";
317
+ const segB = b[i] ?? "0";
318
+ const result = compareValues(segA, segB);
319
+ if (result !== 0) {
320
+ return result;
321
+ }
322
+ }
323
+ return 0;
324
+ };
325
+ var compareVersions = (v1, v2) => {
326
+ const seg1 = parseVersion(v1);
327
+ const seg2 = parseVersion(v2);
328
+ const preRelease1 = seg1.pop();
329
+ const preRelease2 = seg2.pop();
330
+ const mainCompare = compareSegments(seg1, seg2);
331
+ if (mainCompare !== 0) {
332
+ return mainCompare;
333
+ }
334
+ if (preRelease1 && preRelease2) {
335
+ return compareSegments(preRelease1.split("."), preRelease2.split("."));
336
+ }
337
+ if (preRelease1) {
338
+ return -1;
339
+ }
340
+ if (preRelease2) {
341
+ return 1;
342
+ }
343
+ return 0;
344
+ };
345
+ function isMinVersionSupported(minVersions) {
346
+ const operationalEnvironment2 = AppsInTossModule.operationalEnvironment;
347
+ if (operationalEnvironment2 === "sandbox") {
348
+ return true;
349
+ }
350
+ const currentVersion = AppsInTossModule.tossAppVersion;
351
+ const isIOS = import_react_native8.Platform.OS === "ios";
352
+ const minVersion = isIOS ? minVersions.ios : minVersions.android;
353
+ if (minVersion === void 0) {
354
+ return false;
355
+ }
356
+ if (minVersion === "always") {
357
+ return true;
358
+ }
359
+ if (minVersion === "never") {
360
+ return false;
361
+ }
362
+ return compareVersions(currentVersion, minVersion) >= 0;
363
+ }
364
+ function contactsViral(params) {
365
+ const isSupported = isMinVersionSupported({
366
+ android: "5.223.0",
367
+ ios: "5.223.0"
368
+ });
369
+ if (!isSupported) {
370
+ return () => {
371
+ };
372
+ }
373
+ const { onEvent, onError, options } = params;
374
+ const unregisterCallbacks = INTERNAL__appBridgeHandler.invokeAppBridgeMethod("contactsViral", options, {
375
+ onRewardFromContactsViral: (result) => {
376
+ onEvent({ type: "sendViral", data: result });
377
+ },
378
+ onSuccess: (result) => {
379
+ onEvent({ type: "close", data: result });
380
+ },
381
+ onError
382
+ });
383
+ return unregisterCallbacks;
384
+ }
385
+ function onVisibilityChangedByTransparentServiceWeb(eventParams) {
386
+ return appsInTossEvent.addEventListener("onVisibilityChangedByTransparentServiceWeb", eventParams);
387
+ }
388
+ function getOperationalEnvironment() {
389
+ return AppsInTossModule.operationalEnvironment;
390
+ }
391
+ function loadAdMobInterstitialAd(params) {
392
+ if (!loadAdMobInterstitialAd.isSupported()) {
393
+ params.onError(new Error(UNSUPPORTED_ERROR_MESSAGE));
394
+ return noop;
395
+ }
396
+ const { onEvent, onError, options } = params;
397
+ const unregisterCallbacks = INTERNAL__appBridgeHandler.invokeAppBridgeMethod("loadAdMobInterstitialAd", options, {
398
+ onAdClicked: () => {
399
+ onEvent({ type: "clicked" });
400
+ },
401
+ onAdDismissed: () => {
402
+ onEvent({ type: "dismissed" });
403
+ },
404
+ onAdFailedToShow: () => {
405
+ onEvent({ type: "failedToShow" });
406
+ },
407
+ onAdImpression: () => {
408
+ onEvent({ type: "impression" });
409
+ },
410
+ onAdShow: () => {
411
+ onEvent({ type: "show" });
412
+ },
413
+ onSuccess: (result) => onEvent({ type: "loaded", data: result }),
414
+ onError
415
+ });
416
+ return unregisterCallbacks;
417
+ }
418
+ function showAdMobInterstitialAd(params) {
419
+ if (!showAdMobInterstitialAd.isSupported()) {
420
+ params.onError(new Error(UNSUPPORTED_ERROR_MESSAGE));
421
+ return noop;
422
+ }
423
+ const { onEvent, onError, options } = params;
424
+ const unregisterCallbacks = INTERNAL__appBridgeHandler.invokeAppBridgeMethod("showAdMobInterstitialAd", options, {
425
+ onSuccess: () => onEvent({ type: "requested" }),
426
+ onError
427
+ });
428
+ return unregisterCallbacks;
429
+ }
430
+ function loadAdMobRewardedAd(params) {
431
+ if (!loadAdMobRewardedAd.isSupported()) {
432
+ params.onError(new Error(UNSUPPORTED_ERROR_MESSAGE));
433
+ return noop;
434
+ }
435
+ const { onEvent, onError, options } = params;
436
+ const unregisterCallbacks = INTERNAL__appBridgeHandler.invokeAppBridgeMethod("loadAdMobRewardedAd", options, {
437
+ onAdClicked: () => {
438
+ onEvent({ type: "clicked" });
439
+ },
440
+ onAdDismissed: () => {
441
+ onEvent({ type: "dismissed" });
442
+ },
443
+ onAdFailedToShow: () => {
444
+ onEvent({ type: "failedToShow" });
445
+ },
446
+ onAdImpression: () => {
447
+ onEvent({ type: "impression" });
448
+ },
449
+ onAdShow: () => {
450
+ onEvent({ type: "show" });
451
+ },
452
+ onUserEarnedReward: () => {
453
+ onEvent({ type: "userEarnedReward" });
454
+ },
455
+ onSuccess: (result) => onEvent({ type: "loaded", data: result }),
456
+ onError
457
+ });
458
+ return unregisterCallbacks;
459
+ }
460
+ function showAdMobRewardedAd(params) {
461
+ if (!showAdMobRewardedAd.isSupported()) {
462
+ params.onError(new Error(UNSUPPORTED_ERROR_MESSAGE));
463
+ return noop;
464
+ }
465
+ const { onEvent, onError, options } = params;
466
+ const unregisterCallbacks = INTERNAL__appBridgeHandler.invokeAppBridgeMethod("showAdMobRewardedAd", options, {
467
+ onSuccess: () => onEvent({ type: "requested" }),
468
+ onError
469
+ });
470
+ return unregisterCallbacks;
471
+ }
472
+ var ANDROID_GOOGLE_AD_MOB_SUPPORTED_VERSION = "5.209.0";
473
+ var IOS_GOOGLE_AD_MOB_SUPPORTED_VERSION = "5.209.0";
474
+ var UNSUPPORTED_ERROR_MESSAGE = "This feature is not supported in the current environment";
475
+ var ENVIRONMENT = getOperationalEnvironment();
476
+ function createIsSupported() {
477
+ return () => {
478
+ if (ENVIRONMENT !== "toss") {
479
+ return false;
480
+ }
481
+ return isMinVersionSupported({
482
+ android: ANDROID_GOOGLE_AD_MOB_SUPPORTED_VERSION,
483
+ ios: IOS_GOOGLE_AD_MOB_SUPPORTED_VERSION
484
+ });
485
+ };
486
+ }
487
+ loadAdMobInterstitialAd.isSupported = createIsSupported();
488
+ loadAdMobRewardedAd.isSupported = createIsSupported();
489
+ showAdMobInterstitialAd.isSupported = createIsSupported();
490
+ showAdMobRewardedAd.isSupported = createIsSupported();
491
+ async function checkoutPayment(options) {
492
+ return AppsInTossModule.checkoutPayment({ params: options });
493
+ }
494
+ async function appLogin() {
495
+ return AppsInTossModule.appLogin({});
496
+ }
497
+ function normalizeParams(params) {
498
+ return Object.fromEntries(
499
+ Object.entries(params).filter(([, value]) => value !== void 0).map(([key, value]) => [key, String(value)])
500
+ );
501
+ }
502
+ async function eventLog(params) {
503
+ if (AppsInTossModule.operationalEnvironment === "sandbox") {
504
+ console.log("[eventLogDebug]", {
505
+ log_name: params.log_name,
506
+ log_type: params.log_type,
507
+ params: normalizeParams(params.params)
508
+ });
509
+ return;
510
+ }
511
+ const isSupported = isMinVersionSupported({
512
+ android: "5.208.0",
513
+ ios: "5.208.0"
514
+ });
515
+ if (!isSupported) {
516
+ return;
517
+ }
518
+ return AppsInTossModule.eventLog({
519
+ log_name: params.log_name,
520
+ log_type: params.log_type,
521
+ params: normalizeParams(params.params)
522
+ });
523
+ }
524
+ var DEFAULT_MAX_COUNT = 10;
525
+ var DEFAULT_MAX_WIDTH = 1024;
526
+ async function fetchAlbumPhotos(options) {
527
+ const permissionStatus = await requestPermission({ name: "photos", access: "read" });
528
+ if (permissionStatus === "denied") {
529
+ throw new Error("\uC0AC\uC9C4\uCCA9 \uAD8C\uD55C\uC774 \uAC70\uBD80\uB418\uC5C8\uC5B4\uC694.");
530
+ }
531
+ const albumPhotos = await AppsInTossModule.fetchAlbumPhotos({
532
+ ...options,
533
+ maxCount: options.maxCount ?? DEFAULT_MAX_COUNT,
534
+ maxWidth: options.maxWidth ?? DEFAULT_MAX_WIDTH
535
+ });
536
+ return albumPhotos;
537
+ }
538
+ async function fetchContacts(options) {
539
+ const permissionStatus = await requestPermission({ name: "contacts", access: "read" });
540
+ if (permissionStatus === "denied") {
541
+ throw new Error("\uC5F0\uB77D\uCC98 \uAD8C\uD55C\uC774 \uAC70\uBD80\uB418\uC5C8\uC5B4\uC694.");
542
+ }
543
+ const contacts = await AppsInTossModule.fetchContacts(options);
544
+ return {
545
+ result: contacts.result,
546
+ nextOffset: contacts.nextOffset ?? null,
547
+ done: contacts.done
548
+ };
549
+ }
550
+ async function getClipboardText() {
551
+ const permissionStatus = await requestPermission({ name: "clipboard", access: "read" });
552
+ if (permissionStatus === "denied") {
553
+ throw new Error("\uD074\uB9BD\uBCF4\uB4DC \uC77D\uAE30 \uAD8C\uD55C\uC774 \uAC70\uBD80\uB418\uC5C8\uC5B4\uC694.");
554
+ }
555
+ return AppsInTossModule.getClipboardText({});
556
+ }
557
+ async function getCurrentLocation(options) {
558
+ const permissionStatus = await requestPermission({ name: "geolocation", access: "access" });
559
+ if (permissionStatus === "denied") {
560
+ throw new Error("\uC704\uCE58 \uAD8C\uD55C\uC774 \uAC70\uBD80\uB418\uC5C8\uC5B4\uC694.");
561
+ }
562
+ const position = await AppsInTossModule.getCurrentLocation(options);
563
+ return position;
564
+ }
565
+ function getDeviceId() {
566
+ return AppsInTossModule.deviceId;
567
+ }
568
+ function getTossAppVersion() {
569
+ return AppsInTossModule.tossAppVersion;
570
+ }
571
+ async function getTossShareLink(path) {
572
+ const { shareLink } = await AppsInTossModule.getTossShareLink({});
573
+ const shareUrl = new URL(shareLink);
574
+ shareUrl.searchParams.set("deep_link_value", path);
575
+ shareUrl.searchParams.set("af_dp", path);
576
+ return shareUrl.toString();
577
+ }
578
+ async function createOneTimePurchaseOrder(params) {
579
+ const isSupported = isMinVersionSupported({
580
+ android: "5.219.0",
581
+ ios: "5.219.0"
582
+ });
583
+ if (!isSupported) {
584
+ return;
585
+ }
586
+ return AppsInTossModule.iapCreateOneTimePurchaseOrder(params);
587
+ }
588
+ async function getProductItemList() {
589
+ const isSupported = isMinVersionSupported({
590
+ android: "5.219.0",
591
+ ios: "5.219.0"
592
+ });
593
+ if (!isSupported) {
594
+ return;
595
+ }
596
+ return AppsInTossModule.iapGetProductItemList({});
597
+ }
598
+ var IAP = {
599
+ createOneTimePurchaseOrder,
600
+ getProductItemList
601
+ };
602
+ async function openCamera(options) {
603
+ const permissionStatus = await requestPermission({ name: "camera", access: "access" });
604
+ if (permissionStatus === "denied") {
605
+ throw new Error("\uCE74\uBA54\uB77C \uAD8C\uD55C\uC774 \uAC70\uBD80\uB418\uC5C8\uC5B4\uC694.");
606
+ }
607
+ const photo = await AppsInTossModule.openCamera({ base64: false, maxWidth: 1024, ...options });
608
+ return photo;
609
+ }
610
+ async function saveBase64Data(params) {
611
+ const isSupported = isMinVersionSupported({
612
+ android: "5.218.0",
613
+ ios: "5.216.0"
614
+ });
615
+ if (!isSupported) {
616
+ console.warn("saveBase64Data is not supported in this app version");
617
+ return;
618
+ }
619
+ await AppsInTossModule.saveBase64Data(params);
620
+ }
621
+ async function setClipboardText(text) {
622
+ const permissionStatus = await requestPermission({ name: "clipboard", access: "write" });
623
+ if (permissionStatus === "denied") {
624
+ throw new Error("\uD074\uB9BD\uBCF4\uB4DC \uC4F0\uAE30 \uAD8C\uD55C\uC774 \uAC70\uBD80\uB418\uC5C8\uC5B4\uC694.");
625
+ }
626
+ return AppsInTossModule.setClipboardText({ text });
627
+ }
628
+ async function setDeviceOrientation(options) {
629
+ const isSupported = isMinVersionSupported({
630
+ android: "5.215.0",
631
+ ios: "5.215.0"
632
+ });
633
+ if (!isSupported) {
634
+ return;
635
+ }
636
+ return AppsInTossModule.setDeviceOrientation(options);
637
+ }
638
+ function getItem(key) {
639
+ return AppsInTossModule.getStorageItem({ key });
640
+ }
641
+ function setItem(key, value) {
642
+ return AppsInTossModule.setStorageItem({
643
+ key,
644
+ value
645
+ });
646
+ }
647
+ function removeItem(key) {
648
+ return AppsInTossModule.removeStorageItem({ key });
649
+ }
650
+ function clearItems() {
651
+ return AppsInTossModule.clearStorage({});
652
+ }
653
+ var Storage = {
654
+ getItem,
655
+ setItem,
656
+ removeItem,
657
+ clearItems
658
+ };
659
+ var GAME_CENTER_MIN_VERSION = {
660
+ android: "5.221.0",
661
+ ios: "5.221.0"
662
+ };
663
+ async function openGameCenterLeaderboard() {
664
+ if (!isMinVersionSupported(GAME_CENTER_MIN_VERSION)) {
665
+ return;
666
+ }
667
+ const appName = global.__granite?.app?.name;
668
+ if (appName == null) {
669
+ throw new Error("Cannot get app name");
670
+ }
671
+ const url = new URL("servicetoss://game-center/leaderboard?_navbar=hide");
672
+ url.searchParams.set("appName", appName);
673
+ url.searchParams.set("referrer", `appsintoss.${appName}`);
674
+ return (0, import_react_native9.openURL)(url.toString());
675
+ }
676
+ async function getGameCenterGameProfile() {
677
+ const isSupported = isMinVersionSupported(GAME_CENTER_MIN_VERSION);
678
+ if (!isSupported) {
679
+ return;
680
+ }
681
+ return AppsInTossModule.getGameCenterGameProfile({});
682
+ }
683
+ async function submitGameCenterLeaderBoardScore(params) {
684
+ const isSupported = isMinVersionSupported(GAME_CENTER_MIN_VERSION);
685
+ if (!isSupported) {
686
+ return;
687
+ }
688
+ return AppsInTossModule.submitGameCenterLeaderBoardScore(params);
689
+ }
690
+ var TossPay = {
691
+ checkoutPayment
692
+ };
693
+ var GoogleAdMob = {
694
+ loadAdMobInterstitialAd,
695
+ showAdMobInterstitialAd,
696
+ loadAdMobRewardedAd,
697
+ showAdMobRewardedAd
698
+ };
699
+ var BedrockModule = import_react_native10.NativeModules.BedrockModule;
700
+ async function closeView() {
701
+ return BedrockModule.closeView();
702
+ }
703
+ function getLocale() {
704
+ const locale = BedrockModule?.DeviceInfo?.locale ?? "ko-KR";
705
+ if (import_react_native11.Platform.OS === "android") {
706
+ return replaceUnderbarToHypen(locale);
707
+ }
708
+ return locale;
709
+ }
710
+ function replaceUnderbarToHypen(locale) {
711
+ return locale.replace(/_/g, "-");
712
+ }
713
+ function getSchemeUri() {
714
+ return BedrockModule.schemeUri;
715
+ }
716
+ function generateHapticFeedback(options) {
717
+ return BedrockModule.generateHapticFeedback(options);
718
+ }
719
+ async function share(message) {
720
+ BedrockModule.share(message);
721
+ }
722
+ function setSecureScreen(options) {
723
+ return BedrockModule.setSecureScreen(options);
724
+ }
725
+ async function setScreenAwakeMode(options) {
726
+ return BedrockModule.setScreenAwakeMode(options);
727
+ }
728
+ function getNetworkStatus() {
729
+ return BedrockModule.getNetworkStatus();
730
+ }
731
+ async function setIosSwipeGestureEnabled(options) {
732
+ if (BedrockModule.setIosSwipeGestureEnabled == null) {
733
+ return;
734
+ }
735
+ return BedrockModule.setIosSwipeGestureEnabled(options);
736
+ }
737
+ function openURL2(url) {
738
+ return import_react_native12.Linking.openURL(url);
739
+ }
740
+ function getPlatformOS() {
741
+ return import_react_native13.Platform.OS;
742
+ }
743
+ var BedrockCoreModule = import_react_native14.NativeModules.BedrockCoreModule;
744
+ var Accuracy = /* @__PURE__ */ ((Accuracy2) => {
745
+ Accuracy2[Accuracy2["Lowest"] = 1] = "Lowest";
746
+ Accuracy2[Accuracy2["Low"] = 2] = "Low";
747
+ Accuracy2[Accuracy2["Balanced"] = 3] = "Balanced";
748
+ Accuracy2[Accuracy2["High"] = 4] = "High";
749
+ Accuracy2[Accuracy2["Highest"] = 5] = "Highest";
750
+ Accuracy2[Accuracy2["BestForNavigation"] = 6] = "BestForNavigation";
751
+ return Accuracy2;
752
+ })(Accuracy || {});
753
+ var TossCoreModule = import_react_native15.NativeModules.TossCoreModule;
754
+ function tossCoreEventLog(params) {
755
+ const supported = isMinVersionSupported({ ios: "5.210.0", android: "5.210.0" });
756
+ const isSandbox = getOperationalEnvironment() === "sandbox";
757
+ if (!supported || isSandbox) {
758
+ return;
759
+ }
760
+ TossCoreModule.eventLog({
761
+ params: {
762
+ log_name: params.log_name,
763
+ log_type: params.log_type,
764
+ params: params.params
765
+ }
766
+ });
767
+ }
768
+ var INTERNAL__module = {
769
+ tossCoreEventLog
770
+ };
771
+
772
+ // src/core/registerApp.tsx
773
+ var import_react_native35 = require("@granite-js/react-native");
774
+ var import_react_native36 = require("@toss-design-system/react-native");
775
+
776
+ // src/core/components/AppEvent.tsx
777
+ var import_react_native19 = require("@granite-js/react-native");
778
+ var import_react3 = require("react");
779
+
780
+ // src/env.ts
781
+ var env = {
782
+ getDeploymentId: () => __DEV__ ? "local" : global.__appsInToss?.deploymentId
783
+ };
784
+
785
+ // src/hooks/useCaptureExitLog.ts
786
+ var import_react_native18 = require("@granite-js/react-native");
787
+ var import_react2 = require("react");
788
+
789
+ // src/core/hooks/useReferrer.ts
790
+ var import_react_native16 = require("@granite-js/react-native");
791
+ var import_react = require("react");
792
+ function useReferrer() {
793
+ return (0, import_react.useMemo)(() => {
794
+ try {
795
+ return new URL((0, import_react_native16.getSchemeUri)()).searchParams.get("referrer");
796
+ } catch {
797
+ return null;
798
+ }
799
+ }, []);
800
+ }
801
+
802
+ // src/utils/isPrivateScheme.ts
803
+ var import_react_native17 = require("@granite-js/react-native");
804
+ function isPrivateScheme() {
805
+ try {
806
+ return new URL((0, import_react_native17.getSchemeUri)()).protocol === "intoss-private:";
807
+ } catch {
808
+ return false;
809
+ }
810
+ }
811
+
812
+ // src/hooks/useCaptureExitLog.ts
813
+ var EXIT_IMPRESSION_LOG_NAME = "appsintoss_app_visit__common_module::impression__stay_time";
814
+ var EXIT_IMPRESSION_SCHEMA_ID = 1631628;
815
+ function useCaptureExitLog() {
816
+ const referrer = useReferrer();
817
+ const visible = (0, import_react_native18.useVisibility)();
818
+ const enterTime = (0, import_react2.useRef)(void 0);
819
+ (0, import_react2.useEffect)(() => {
820
+ if (visible === true) {
821
+ enterTime.current = Date.now();
822
+ }
823
+ }, [visible]);
824
+ const captureExitLog = (0, import_react2.useCallback)(
825
+ (exitTime) => {
826
+ if (enterTime.current == null) {
827
+ return;
828
+ }
829
+ const stayTime = Math.floor(exitTime - enterTime.current);
830
+ INTERNAL__module.tossCoreEventLog({
831
+ log_name: EXIT_IMPRESSION_LOG_NAME,
832
+ log_type: "event",
833
+ params: {
834
+ schema_id: EXIT_IMPRESSION_SCHEMA_ID,
835
+ event_type: "impression",
836
+ referrer,
837
+ deployment_id: env.getDeploymentId(),
838
+ app_name: import_react_native18.Granite.appName,
839
+ is_private: isPrivateScheme(),
840
+ stay_time: stayTime.toString(),
841
+ exit_time: exitTime.toString()
842
+ }
843
+ });
844
+ enterTime.current = void 0;
845
+ },
846
+ [referrer]
847
+ );
848
+ return { captureExitLog };
849
+ }
850
+
851
+ // src/core/components/AppEvent.tsx
852
+ var ENTRY_APP_EVENT_SCHEMA_ID = 1562181;
853
+ function EntryAppEvent() {
854
+ const referrer = useReferrer() ?? "";
855
+ (0, import_react3.useEffect)(() => {
856
+ INTERNAL__module.tossCoreEventLog({
857
+ log_name: "appsintoss_app_visit::impression__enter_appsintoss",
858
+ log_type: "info",
859
+ params: {
860
+ is_transform: true,
861
+ schema_id: ENTRY_APP_EVENT_SCHEMA_ID,
862
+ referrer,
863
+ deployment_id: env.getDeploymentId(),
864
+ app_name: import_react_native19.Granite.appName,
865
+ is_private: isPrivateScheme()
866
+ }
867
+ });
868
+ }, [referrer]);
869
+ return null;
870
+ }
871
+ function SystemAppEvent({ ...initialProps }) {
872
+ (0, import_react3.useEffect)(() => {
873
+ INTERNAL__module.tossCoreEventLog({
874
+ log_name: "AppsInTossInitialProps",
875
+ log_type: "debug",
876
+ params: {
877
+ ...initialProps,
878
+ schemeUri: (0, import_react_native19.getSchemeUri)(),
879
+ deployment_id: env.getDeploymentId(),
880
+ app_name: import_react_native19.Granite.appName,
881
+ is_private: isPrivateScheme()
882
+ }
883
+ });
884
+ }, [initialProps]);
885
+ return null;
886
+ }
887
+ function StayTimeAppEvent() {
888
+ const visible = (0, import_react_native19.useVisibility)();
889
+ const { captureExitLog } = useCaptureExitLog();
890
+ (0, import_react3.useEffect)(() => {
891
+ if (visible === false) {
892
+ captureExitLog(Date.now());
893
+ }
894
+ }, [visible, captureExitLog]);
895
+ return null;
896
+ }
897
+ var AppEvent = {
898
+ Entry: EntryAppEvent,
899
+ System: SystemAppEvent,
900
+ StayTime: StayTimeAppEvent
901
+ };
902
+
903
+ // src/core/components/AppUpdate.tsx
904
+ var import_react_native20 = require("@granite-js/react-native");
905
+ var import_react4 = require("react");
906
+ var import_jsx_runtime = require("react/jsx-runtime");
907
+ var UPDATE_SCHEME = "servicetoss://update/forced/j?updateType=required";
908
+ function AppUpdate() {
909
+ (0, import_react4.useEffect)(() => {
910
+ (0, import_react_native20.openURL)(`supertoss://closePage?url=${UPDATE_SCHEME}`);
911
+ }, []);
912
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, {});
913
+ }
914
+
915
+ // src/core/hooks/useAppsInTossBridge.ts
916
+ var import_react_native21 = require("@toss-design-system/react-native");
917
+ var import_react5 = require("react");
918
+
919
+ // src/core/utils/getAppsInTossGlobals.ts
920
+ function getAppsInTossGlobals() {
921
+ if (global.__appsInToss == null) {
922
+ throw new Error("invalid apps-in-toss globals");
923
+ }
924
+ return global.__appsInToss;
925
+ }
926
+
927
+ // src/core/utils/toIcon.ts
928
+ function toIcon(source) {
929
+ return source.startsWith("http") ? { source: { uri: source } } : { name: source };
930
+ }
931
+
932
+ // src/core/hooks/useAppsInTossBridge.ts
537
933
  function useAppsInTossBridge() {
538
- const controller = (0, import_react_native5.useBridge)();
934
+ const controller = (0, import_react_native21.useBridge)();
539
935
  const appsInTossGlobals2 = getAppsInTossGlobals();
540
- (0, import_react4.useEffect)(() => {
936
+ (0, import_react5.useEffect)(() => {
541
937
  const commonProps = {
542
938
  serviceName: appsInTossGlobals2.brandDisplayName,
543
939
  icon: toIcon(appsInTossGlobals2.brandIcon),
@@ -553,59 +949,135 @@ function useAppsInTossBridge() {
553
949
  }, []);
554
950
  }
555
951
 
556
- // src/async-bridges.ts
952
+ // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/async-bridges.ts
557
953
  var async_bridges_exports = {};
558
954
  __export(async_bridges_exports, {
559
- appLogin: () => appLogin,
560
- checkoutPayment: () => checkoutPayment,
561
- eventLog: () => eventLog,
562
- fetchAlbumPhotos: () => fetchAlbumPhotos,
563
- fetchContacts: () => fetchContacts,
564
- getClipboardText: () => getClipboardText,
565
- getCurrentLocation: () => getCurrentLocation,
566
- getGameCenterGameProfile: () => getGameCenterGameProfile,
567
- getTossShareLink: () => getTossShareLink,
568
- openCamera: () => openCamera,
569
- openGameCenterLeaderboard: () => openGameCenterLeaderboard,
570
- saveBase64Data: () => saveBase64Data,
571
- setClipboardText: () => setClipboardText,
572
- setDeviceOrientation: () => setDeviceOrientation,
573
- submitGameCenterLeaderBoardScore: () => submitGameCenterLeaderBoardScore
955
+ appLogin: () => appLogin2,
956
+ checkoutPayment: () => checkoutPayment2,
957
+ closeView: () => closeView2,
958
+ eventLog: () => eventLog2,
959
+ fetchAlbumPhotos: () => fetchAlbumPhotos2,
960
+ fetchContacts: () => fetchContacts2,
961
+ generateHapticFeedback: () => generateHapticFeedback2,
962
+ getClipboardText: () => getClipboardText2,
963
+ getCurrentLocation: () => getCurrentLocation2,
964
+ getGameCenterGameProfile: () => getGameCenterGameProfile2,
965
+ getNetworkStatus: () => getNetworkStatus2,
966
+ getTossShareLink: () => getTossShareLink2,
967
+ openCamera: () => openCamera2,
968
+ openGameCenterLeaderboard: () => openGameCenterLeaderboard2,
969
+ openURL: () => openURL4,
970
+ saveBase64Data: () => saveBase64Data2,
971
+ setClipboardText: () => setClipboardText2,
972
+ setDeviceOrientation: () => setDeviceOrientation2,
973
+ setIosSwipeGestureEnabled: () => setIosSwipeGestureEnabled2,
974
+ setScreenAwakeMode: () => setScreenAwakeMode2,
975
+ setSecureScreen: () => setSecureScreen2,
976
+ share: () => share2,
977
+ submitGameCenterLeaderBoardScore: () => submitGameCenterLeaderBoardScore2
574
978
  });
575
979
 
576
- // src/native-modules/setClipboardText.ts
577
- async function setClipboardText(text) {
578
- const permissionStatus = await requestPermission({ name: "clipboard", access: "write" });
980
+ // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/BedrockModule/native-modules/natives/BedrockModule.ts
981
+ var import_react_native22 = require("react-native");
982
+ var BedrockModule2 = import_react_native22.NativeModules.BedrockModule;
983
+
984
+ // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/BedrockModule/native-modules/natives/closeView.ts
985
+ async function closeView2() {
986
+ return BedrockModule2.closeView();
987
+ }
988
+
989
+ // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/BedrockModule/native-modules/natives/generateHapticFeedback/index.ts
990
+ function generateHapticFeedback2(options) {
991
+ return BedrockModule2.generateHapticFeedback(options);
992
+ }
993
+
994
+ // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/BedrockModule/native-modules/natives/share.ts
995
+ async function share2(message) {
996
+ BedrockModule2.share(message);
997
+ }
998
+
999
+ // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/BedrockModule/native-modules/natives/setSecureScreen.ts
1000
+ function setSecureScreen2(options) {
1001
+ return BedrockModule2.setSecureScreen(options);
1002
+ }
1003
+
1004
+ // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/BedrockModule/native-modules/natives/setScreenAwakeMode.ts
1005
+ async function setScreenAwakeMode2(options) {
1006
+ return BedrockModule2.setScreenAwakeMode(options);
1007
+ }
1008
+
1009
+ // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/BedrockModule/native-modules/natives/getNetworkStatus/index.ts
1010
+ function getNetworkStatus2() {
1011
+ return BedrockModule2.getNetworkStatus();
1012
+ }
1013
+
1014
+ // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/BedrockModule/native-modules/natives/setIosSwipeGestureEnabled.ts
1015
+ async function setIosSwipeGestureEnabled2(options) {
1016
+ if (BedrockModule2.setIosSwipeGestureEnabled == null) {
1017
+ return;
1018
+ }
1019
+ return BedrockModule2.setIosSwipeGestureEnabled(options);
1020
+ }
1021
+
1022
+ // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/BedrockModule/native-modules/natives/openURL.ts
1023
+ var import_react_native23 = require("react-native");
1024
+ function openURL4(url) {
1025
+ return import_react_native23.Linking.openURL(url);
1026
+ }
1027
+
1028
+ // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-modules/AppsInTossModule.ts
1029
+ var import_react_native24 = require("react-native");
1030
+ var Module2 = import_react_native24.TurboModuleRegistry.getEnforcing("AppsInTossModule");
1031
+ var AppsInTossModuleInstance2 = Module2;
1032
+ var AppsInTossModule2 = Module2;
1033
+
1034
+ // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-modules/getPermission.ts
1035
+ function getPermission2(permission) {
1036
+ return AppsInTossModule2.getPermission(permission);
1037
+ }
1038
+
1039
+ // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-modules/openPermissionDialog.ts
1040
+ function openPermissionDialog2(permission) {
1041
+ return AppsInTossModule2.openPermissionDialog(permission);
1042
+ }
1043
+
1044
+ // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-modules/requestPermission.ts
1045
+ async function requestPermission2(permission) {
1046
+ const permissionStatus = await getPermission2(permission);
1047
+ switch (permissionStatus) {
1048
+ case "allowed":
1049
+ case "denied":
1050
+ return permissionStatus;
1051
+ default:
1052
+ return openPermissionDialog2(permission);
1053
+ }
1054
+ }
1055
+
1056
+ // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-modules/setClipboardText.ts
1057
+ async function setClipboardText2(text) {
1058
+ const permissionStatus = await requestPermission2({ name: "clipboard", access: "write" });
579
1059
  if (permissionStatus === "denied") {
580
1060
  throw new Error("\uD074\uB9BD\uBCF4\uB4DC \uC4F0\uAE30 \uAD8C\uD55C\uC774 \uAC70\uBD80\uB418\uC5C8\uC5B4\uC694.");
581
1061
  }
582
- return AppsInTossModule.setClipboardText({ text });
1062
+ return AppsInTossModule2.setClipboardText({ text });
583
1063
  }
584
1064
 
585
- // src/native-modules/getClipboardText.ts
586
- async function getClipboardText() {
587
- const permissionStatus = await requestPermission({ name: "clipboard", access: "read" });
1065
+ // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-modules/getClipboardText.ts
1066
+ async function getClipboardText2() {
1067
+ const permissionStatus = await requestPermission2({ name: "clipboard", access: "read" });
588
1068
  if (permissionStatus === "denied") {
589
1069
  throw new Error("\uD074\uB9BD\uBCF4\uB4DC \uC77D\uAE30 \uAD8C\uD55C\uC774 \uAC70\uBD80\uB418\uC5C8\uC5B4\uC694.");
590
1070
  }
591
- return AppsInTossModule.getClipboardText({});
1071
+ return AppsInTossModule2.getClipboardText({});
592
1072
  }
593
1073
 
594
- // src/native-modules/fetchContacts.ts
595
- async function fetchContacts({
596
- size,
597
- offset,
598
- query
599
- }) {
600
- const permissionStatus = await requestPermission({ name: "contacts", access: "read" });
1074
+ // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-modules/fetchContacts.ts
1075
+ async function fetchContacts2(options) {
1076
+ const permissionStatus = await requestPermission2({ name: "contacts", access: "read" });
601
1077
  if (permissionStatus === "denied") {
602
1078
  throw new Error("\uC5F0\uB77D\uCC98 \uAD8C\uD55C\uC774 \uAC70\uBD80\uB418\uC5C8\uC5B4\uC694.");
603
1079
  }
604
- const contacts = await AppsInTossModule.fetchContacts({
605
- size,
606
- offset,
607
- query
608
- });
1080
+ const contacts = await AppsInTossModule2.fetchContacts(options);
609
1081
  return {
610
1082
  result: contacts.result,
611
1083
  nextOffset: contacts.nextOffset ?? null,
@@ -613,105 +1085,196 @@ async function fetchContacts({
613
1085
  };
614
1086
  }
615
1087
 
616
- // src/native-modules/fetchAlbumPhotos.ts
617
- var DEFAULT_MAX_COUNT = 10;
618
- var DEFAULT_MAX_WIDTH = 1024;
619
- async function fetchAlbumPhotos(options) {
620
- const permissionStatus = await requestPermission({ name: "photos", access: "read" });
1088
+ // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-modules/fetchAlbumPhotos.ts
1089
+ var DEFAULT_MAX_COUNT2 = 10;
1090
+ var DEFAULT_MAX_WIDTH2 = 1024;
1091
+ async function fetchAlbumPhotos2(options) {
1092
+ const permissionStatus = await requestPermission2({ name: "photos", access: "read" });
621
1093
  if (permissionStatus === "denied") {
622
1094
  throw new Error("\uC0AC\uC9C4\uCCA9 \uAD8C\uD55C\uC774 \uAC70\uBD80\uB418\uC5C8\uC5B4\uC694.");
623
1095
  }
624
- const albumPhotos = await AppsInTossModule.fetchAlbumPhotos({
1096
+ const albumPhotos = await AppsInTossModule2.fetchAlbumPhotos({
625
1097
  ...options,
626
- maxCount: options.maxCount ?? DEFAULT_MAX_COUNT,
627
- maxWidth: options.maxWidth ?? DEFAULT_MAX_WIDTH
1098
+ maxCount: options.maxCount ?? DEFAULT_MAX_COUNT2,
1099
+ maxWidth: options.maxWidth ?? DEFAULT_MAX_WIDTH2
628
1100
  });
629
1101
  return albumPhotos;
630
1102
  }
631
1103
 
632
- // src/native-modules/getCurrentLocation.ts
633
- async function getCurrentLocation(options) {
634
- const permissionStatus = await requestPermission({ name: "geolocation", access: "access" });
1104
+ // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-modules/getCurrentLocation.ts
1105
+ async function getCurrentLocation2(options) {
1106
+ const permissionStatus = await requestPermission2({ name: "geolocation", access: "access" });
635
1107
  if (permissionStatus === "denied") {
636
1108
  throw new Error("\uC704\uCE58 \uAD8C\uD55C\uC774 \uAC70\uBD80\uB418\uC5C8\uC5B4\uC694.");
637
1109
  }
638
- const position = await AppsInTossModule.getCurrentLocation(options);
1110
+ const position = await AppsInTossModule2.getCurrentLocation(options);
639
1111
  return position;
640
1112
  }
641
1113
 
642
- // src/native-modules/openCamera.ts
643
- async function openCamera(options) {
644
- const permissionStatus = await requestPermission({ name: "camera", access: "access" });
1114
+ // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-modules/openCamera.ts
1115
+ async function openCamera2(options) {
1116
+ const permissionStatus = await requestPermission2({ name: "camera", access: "access" });
645
1117
  if (permissionStatus === "denied") {
646
1118
  throw new Error("\uCE74\uBA54\uB77C \uAD8C\uD55C\uC774 \uAC70\uBD80\uB418\uC5C8\uC5B4\uC694.");
647
1119
  }
648
- const photo = await AppsInTossModule.openCamera({ base64: false, maxWidth: 1024, ...options });
1120
+ const photo = await AppsInTossModule2.openCamera({ base64: false, maxWidth: 1024, ...options });
649
1121
  return photo;
650
1122
  }
651
1123
 
652
- // src/native-modules/appLogin.ts
653
- async function appLogin() {
654
- return AppsInTossModule.appLogin({});
1124
+ // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-modules/appLogin.ts
1125
+ async function appLogin2() {
1126
+ return AppsInTossModule2.appLogin({});
655
1127
  }
656
1128
 
657
- // src/native-modules/checkoutPayment.ts
658
- async function checkoutPayment(options) {
659
- return AppsInTossModule.checkoutPayment({ params: options });
1129
+ // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-modules/isMinVersionSupported.ts
1130
+ var import_react_native25 = require("react-native");
1131
+
1132
+ // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/utils/compareVersion.ts
1133
+ var SEMVER_REGEX2 = /^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\\-]+(?:\.[\da-z\\-]+)*))?(?:\+[\da-z\\-]+(?:\.[\da-z\\-]+)*)?)?)?$/i;
1134
+ var isWildcard2 = (val) => ["*", "x", "X"].includes(val);
1135
+ var tryParse2 = (val) => {
1136
+ const num = parseInt(val, 10);
1137
+ return isNaN(num) ? val : num;
1138
+ };
1139
+ var coerceTypes2 = (a, b) => {
1140
+ return typeof a === typeof b ? [a, b] : [String(a), String(b)];
1141
+ };
1142
+ var compareValues2 = (a, b) => {
1143
+ if (isWildcard2(a) || isWildcard2(b)) {
1144
+ return 0;
1145
+ }
1146
+ const [aVal, bVal] = coerceTypes2(tryParse2(a), tryParse2(b));
1147
+ if (aVal > bVal) {
1148
+ return 1;
1149
+ }
1150
+ if (aVal < bVal) {
1151
+ return -1;
1152
+ }
1153
+ return 0;
1154
+ };
1155
+ var parseVersion2 = (version) => {
1156
+ if (typeof version !== "string") {
1157
+ throw new TypeError("Invalid argument: expected a string");
1158
+ }
1159
+ const match = version.match(SEMVER_REGEX2);
1160
+ if (!match) {
1161
+ throw new Error(`Invalid semver: '${version}'`);
1162
+ }
1163
+ const [, major, minor, patch, build, preRelease] = match;
1164
+ return [major, minor, patch, build, preRelease];
1165
+ };
1166
+ var compareSegments2 = (a, b) => {
1167
+ const maxLength = Math.max(a.length, b.length);
1168
+ for (let i = 0; i < maxLength; i++) {
1169
+ const segA = a[i] ?? "0";
1170
+ const segB = b[i] ?? "0";
1171
+ const result = compareValues2(segA, segB);
1172
+ if (result !== 0) {
1173
+ return result;
1174
+ }
1175
+ }
1176
+ return 0;
1177
+ };
1178
+ var compareVersions2 = (v1, v2) => {
1179
+ const seg1 = parseVersion2(v1);
1180
+ const seg2 = parseVersion2(v2);
1181
+ const preRelease1 = seg1.pop();
1182
+ const preRelease2 = seg2.pop();
1183
+ const mainCompare = compareSegments2(seg1, seg2);
1184
+ if (mainCompare !== 0) {
1185
+ return mainCompare;
1186
+ }
1187
+ if (preRelease1 && preRelease2) {
1188
+ return compareSegments2(preRelease1.split("."), preRelease2.split("."));
1189
+ }
1190
+ if (preRelease1) {
1191
+ return -1;
1192
+ }
1193
+ if (preRelease2) {
1194
+ return 1;
1195
+ }
1196
+ return 0;
1197
+ };
1198
+
1199
+ // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-modules/isMinVersionSupported.ts
1200
+ function isMinVersionSupported2(minVersions) {
1201
+ const operationalEnvironment2 = AppsInTossModule2.operationalEnvironment;
1202
+ if (operationalEnvironment2 === "sandbox") {
1203
+ return true;
1204
+ }
1205
+ const currentVersion = AppsInTossModule2.tossAppVersion;
1206
+ const isIOS = import_react_native25.Platform.OS === "ios";
1207
+ const minVersion = isIOS ? minVersions.ios : minVersions.android;
1208
+ if (minVersion === void 0) {
1209
+ return false;
1210
+ }
1211
+ if (minVersion === "always") {
1212
+ return true;
1213
+ }
1214
+ if (minVersion === "never") {
1215
+ return false;
1216
+ }
1217
+ return compareVersions2(currentVersion, minVersion) >= 0;
660
1218
  }
661
1219
 
662
- // src/native-modules/eventLog.ts
663
- function normalizeParams(params) {
1220
+ // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-modules/eventLog.ts
1221
+ function normalizeParams2(params) {
664
1222
  return Object.fromEntries(
665
1223
  Object.entries(params).filter(([, value]) => value !== void 0).map(([key, value]) => [key, String(value)])
666
1224
  );
667
1225
  }
668
- async function eventLog(params) {
669
- if (AppsInTossModule.operationalEnvironment === "sandbox") {
1226
+ async function eventLog2(params) {
1227
+ if (AppsInTossModule2.operationalEnvironment === "sandbox") {
670
1228
  console.log("[eventLogDebug]", {
671
1229
  log_name: params.log_name,
672
1230
  log_type: params.log_type,
673
- params: normalizeParams(params.params)
1231
+ params: normalizeParams2(params.params)
674
1232
  });
675
1233
  return;
676
1234
  }
677
- const isSupported = isMinVersionSupported({
1235
+ const isSupported = isMinVersionSupported2({
678
1236
  android: "5.208.0",
679
1237
  ios: "5.208.0"
680
1238
  });
681
1239
  if (!isSupported) {
682
1240
  return;
683
1241
  }
684
- return AppsInTossModule.eventLog({
1242
+ return AppsInTossModule2.eventLog({
685
1243
  log_name: params.log_name,
686
1244
  log_type: params.log_type,
687
- params: normalizeParams(params.params)
1245
+ params: normalizeParams2(params.params)
688
1246
  });
689
1247
  }
690
1248
 
691
- // src/native-modules/getTossShareLink.ts
692
- async function getTossShareLink(path) {
693
- const { shareLink } = await AppsInTossModule.getTossShareLink({});
1249
+ // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-modules/getTossShareLink.ts
1250
+ async function getTossShareLink2(path) {
1251
+ const { shareLink } = await AppsInTossModule2.getTossShareLink({});
694
1252
  const shareUrl = new URL(shareLink);
695
1253
  shareUrl.searchParams.set("deep_link_value", path);
696
1254
  shareUrl.searchParams.set("af_dp", path);
697
1255
  return shareUrl.toString();
698
1256
  }
699
1257
 
700
- // src/native-modules/setDeviceOrientation.ts
701
- async function setDeviceOrientation(options) {
702
- const isSupported = isMinVersionSupported({
1258
+ // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-modules/setDeviceOrientation.ts
1259
+ async function setDeviceOrientation2(options) {
1260
+ const isSupported = isMinVersionSupported2({
703
1261
  android: "5.215.0",
704
1262
  ios: "5.215.0"
705
1263
  });
706
1264
  if (!isSupported) {
707
1265
  return;
708
1266
  }
709
- return AppsInTossModule.setDeviceOrientation(options);
1267
+ return AppsInTossModule2.setDeviceOrientation(options);
710
1268
  }
711
1269
 
712
- // src/native-modules/saveBase64Data.ts
713
- async function saveBase64Data(params) {
714
- const isSupported = isMinVersionSupported({
1270
+ // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-modules/checkoutPayment.ts
1271
+ async function checkoutPayment2(options) {
1272
+ return AppsInTossModule2.checkoutPayment({ params: options });
1273
+ }
1274
+
1275
+ // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-modules/saveBase64Data.ts
1276
+ async function saveBase64Data2(params) {
1277
+ const isSupported = isMinVersionSupported2({
715
1278
  android: "5.218.0",
716
1279
  ios: "5.216.0"
717
1280
  });
@@ -719,263 +1282,293 @@ async function saveBase64Data(params) {
719
1282
  console.warn("saveBase64Data is not supported in this app version");
720
1283
  return;
721
1284
  }
722
- await AppsInTossModule.saveBase64Data(params);
1285
+ await AppsInTossModule2.saveBase64Data(params);
723
1286
  }
724
1287
 
725
- // src/constant/game-center.ts
726
- var GAME_PROFILE_WEBVIEW_URL = "https://service.toss.im/game-center/profile";
727
- var GAME_CENTER_MIN_VERSION = {
1288
+ // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/constants.ts
1289
+ var GAME_CENTER_MIN_VERSION2 = {
728
1290
  android: "5.221.0",
729
1291
  ios: "5.221.0"
730
1292
  };
731
1293
 
732
- // src/native-modules/getGameCenterGameProfile.ts
733
- async function getGameCenterGameProfile() {
734
- const isSupported = isMinVersionSupported(GAME_CENTER_MIN_VERSION);
1294
+ // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-modules/getGameCenterGameProfile.ts
1295
+ async function getGameCenterGameProfile2() {
1296
+ const isSupported = isMinVersionSupported2(GAME_CENTER_MIN_VERSION2);
735
1297
  if (!isSupported) {
736
1298
  return;
737
1299
  }
738
- return AppsInTossModule.getGameCenterGameProfile({});
1300
+ return AppsInTossModule2.getGameCenterGameProfile({});
739
1301
  }
740
1302
 
741
- // src/native-modules/openGameCenterLeaderboard.ts
742
- var import_react_native_bedrock10 = require("react-native-bedrock");
743
- async function openGameCenterLeaderboard() {
744
- if (!isMinVersionSupported(GAME_CENTER_MIN_VERSION)) {
1303
+ // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-modules/openGameCenterLeaderboard.ts
1304
+ var import_react_native26 = require("@granite-js/react-native");
1305
+ async function openGameCenterLeaderboard2() {
1306
+ if (!isMinVersionSupported2(GAME_CENTER_MIN_VERSION2)) {
745
1307
  return;
746
1308
  }
1309
+ const appName = global.__granite?.app?.name;
1310
+ if (appName == null) {
1311
+ throw new Error("Cannot get app name");
1312
+ }
747
1313
  const url = new URL("servicetoss://game-center/leaderboard?_navbar=hide");
748
- url.searchParams.set("appName", getAppName());
749
- url.searchParams.set("referrer", `appsintoss.${getAppName()}`);
750
- return (0, import_react_native_bedrock10.openURL)(url.toString());
1314
+ url.searchParams.set("appName", appName);
1315
+ url.searchParams.set("referrer", `appsintoss.${appName}`);
1316
+ return (0, import_react_native26.openURL)(url.toString());
751
1317
  }
752
1318
 
753
- // src/native-modules/submitGameCenterLeaderBoardScore.ts
754
- async function submitGameCenterLeaderBoardScore(params) {
755
- const isSupported = isMinVersionSupported(GAME_CENTER_MIN_VERSION);
1319
+ // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-modules/submitGameCenterLeaderBoardScore.ts
1320
+ async function submitGameCenterLeaderBoardScore2(params) {
1321
+ const isSupported = isMinVersionSupported2(GAME_CENTER_MIN_VERSION2);
756
1322
  if (!isSupported) {
757
1323
  return;
758
1324
  }
759
- return AppsInTossModule.submitGameCenterLeaderBoardScore(params);
1325
+ return AppsInTossModule2.submitGameCenterLeaderBoardScore(params);
760
1326
  }
761
1327
 
762
- // src/core/registerApp.tsx
763
- var import_jsx_runtime = require("react/jsx-runtime");
764
- function AppsInTossContainer(Container, { children, ...initialProps }) {
765
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
766
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AppEvent.StayTime, {}),
767
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AppEvent.Entry, {}),
768
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AppEvent.System, { ...initialProps }),
769
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Container, { ...initialProps, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native6.TDSProvider, { colorPreference: "light", token: { color: { primary: getAppsInTossGlobals().brandPrimaryColor } }, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TDSContainer, { ...initialProps, children }) }) })
770
- ] });
771
- }
772
- function TDSContainer({ children }) {
773
- useAppsInTossBridge();
774
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children });
775
- }
776
- function registerApp(container, { context, analytics }) {
777
- import_analytics.Analytics.init({
778
- logger: (params) => void eventLog(params),
779
- debug: analytics?.debug ?? __DEV__
780
- });
781
- return import_react_native_bedrock11.Bedrock.registerApp(AppsInTossContainer.bind(null, container), {
782
- appName: getAppName(),
783
- context,
784
- router: {
785
- screenContainer: import_analytics.Analytics.Screen,
786
- defaultScreenOption: {
787
- statusBarStyle: "dark"
788
- }
789
- }
790
- });
791
- }
792
- function getAppName() {
793
- try {
794
- return global.__bedrock.app.name;
795
- } catch (error) {
796
- console.error("unexpected error occurred while getting app name");
797
- throw error;
1328
+ // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/constant-bridges.ts
1329
+ var constant_bridges_exports = {};
1330
+ __export(constant_bridges_exports, {
1331
+ getDeviceId: () => getDeviceId2,
1332
+ getLocale: () => getLocale2,
1333
+ getOperationalEnvironment: () => getOperationalEnvironment2,
1334
+ getPlatformOS: () => getPlatformOS2,
1335
+ getSchemeUri: () => getSchemeUri5,
1336
+ getTossAppVersion: () => getTossAppVersion2
1337
+ });
1338
+
1339
+ // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/BedrockModule/native-modules/natives/getLocale.ts
1340
+ var import_react_native27 = require("react-native");
1341
+ function getLocale2() {
1342
+ const locale = BedrockModule2?.DeviceInfo?.locale ?? "ko-KR";
1343
+ if (import_react_native27.Platform.OS === "android") {
1344
+ return replaceUnderbarToHypen2(locale);
798
1345
  }
1346
+ return locale;
799
1347
  }
800
-
801
- // src/core/index.ts
802
- var AppsInToss = {
803
- registerApp
804
- };
805
-
806
- // src/native-event-emitter/startUpdateLocation.ts
807
- function startUpdateLocation(eventParams) {
808
- return appsInTossEvent.addEventListener("updateLocationEvent", eventParams);
1348
+ function replaceUnderbarToHypen2(locale) {
1349
+ return locale.replace(/_/g, "-");
809
1350
  }
810
1351
 
811
- // ../../.yarn/cache/es-toolkit-npm-1.34.1-4cd6371dcb-aab6d07be3.zip/node_modules/es-toolkit/dist/function/noop.mjs
812
- function noop() {
1352
+ // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/BedrockModule/native-modules/natives/getSchemeUri.ts
1353
+ function getSchemeUri5() {
1354
+ return BedrockModule2.schemeUri;
813
1355
  }
814
1356
 
815
- // src/native-modules/ads/googleAdMob.ts
816
- function loadAdMobInterstitialAd(params) {
817
- if (!loadAdMobInterstitialAd.isSupported()) {
818
- params.onError(new Error(UNSUPPORTED_ERROR_MESSAGE));
819
- return noop;
820
- }
821
- const { onEvent, onError, options } = params;
822
- const unregisterCallbacks = INTERNAL__appBridgeHandler.invokeAppBridgeMethod("loadAdMobInterstitialAd", options, {
823
- onAdClicked: () => {
824
- onEvent({ type: "clicked" });
825
- },
826
- onAdDismissed: () => {
827
- onEvent({ type: "dismissed" });
828
- },
829
- onAdFailedToShow: () => {
830
- onEvent({ type: "failedToShow" });
831
- },
832
- onAdImpression: () => {
833
- onEvent({ type: "impression" });
834
- },
835
- onAdShow: () => {
836
- onEvent({ type: "show" });
837
- },
838
- onSuccess: (result) => onEvent({ type: "loaded", data: result }),
839
- onError
840
- });
841
- return unregisterCallbacks;
842
- }
843
- function showAdMobInterstitialAd(params) {
844
- if (!showAdMobInterstitialAd.isSupported()) {
845
- params.onError(new Error(UNSUPPORTED_ERROR_MESSAGE));
846
- return noop;
847
- }
848
- const { onEvent, onError, options } = params;
849
- const unregisterCallbacks = INTERNAL__appBridgeHandler.invokeAppBridgeMethod("showAdMobInterstitialAd", options, {
850
- onSuccess: () => onEvent({ type: "requested" }),
851
- onError
852
- });
853
- return unregisterCallbacks;
1357
+ // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/BedrockModule/native-modules/natives/getPlatformOS.ts
1358
+ var import_react_native28 = require("react-native");
1359
+ function getPlatformOS2() {
1360
+ return import_react_native28.Platform.OS;
854
1361
  }
855
- function loadAdMobRewardedAd(params) {
856
- if (!loadAdMobRewardedAd.isSupported()) {
857
- params.onError(new Error(UNSUPPORTED_ERROR_MESSAGE));
858
- return noop;
859
- }
860
- const { onEvent, onError, options } = params;
861
- const unregisterCallbacks = INTERNAL__appBridgeHandler.invokeAppBridgeMethod("loadAdMobRewardedAd", options, {
862
- onAdClicked: () => {
863
- onEvent({ type: "clicked" });
864
- },
865
- onAdDismissed: () => {
866
- onEvent({ type: "dismissed" });
867
- },
868
- onAdFailedToShow: () => {
869
- onEvent({ type: "failedToShow" });
870
- },
871
- onAdImpression: () => {
872
- onEvent({ type: "impression" });
873
- },
874
- onAdShow: () => {
875
- onEvent({ type: "show" });
876
- },
877
- onUserEarnedReward: () => {
878
- onEvent({ type: "userEarnedReward" });
879
- },
880
- onSuccess: (result) => onEvent({ type: "loaded", data: result }),
881
- onError
882
- });
883
- return unregisterCallbacks;
884
- }
885
- function showAdMobRewardedAd(params) {
886
- if (!showAdMobRewardedAd.isSupported()) {
887
- params.onError(new Error(UNSUPPORTED_ERROR_MESSAGE));
888
- return noop;
889
- }
890
- const { onEvent, onError, options } = params;
891
- const unregisterCallbacks = INTERNAL__appBridgeHandler.invokeAppBridgeMethod("showAdMobRewardedAd", options, {
892
- onSuccess: () => onEvent({ type: "requested" }),
893
- onError
894
- });
895
- return unregisterCallbacks;
896
- }
897
- var ANDROID_GOOGLE_AD_MOB_SUPPORTED_VERSION = "5.209.0";
898
- var IOS_GOOGLE_AD_MOB_SUPPORTED_VERSION = "5.209.0";
899
- var UNSUPPORTED_ERROR_MESSAGE = "This feature is not supported in the current environment";
900
- var ENVIRONMENT = getOperationalEnvironment();
901
- function createIsSupported() {
902
- return () => {
903
- if (ENVIRONMENT !== "toss") {
904
- return false;
905
- }
906
- return isMinVersionSupported({
907
- android: ANDROID_GOOGLE_AD_MOB_SUPPORTED_VERSION,
908
- ios: IOS_GOOGLE_AD_MOB_SUPPORTED_VERSION
909
- });
910
- };
911
- }
912
- loadAdMobInterstitialAd.isSupported = createIsSupported();
913
- loadAdMobRewardedAd.isSupported = createIsSupported();
914
- showAdMobInterstitialAd.isSupported = createIsSupported();
915
- showAdMobRewardedAd.isSupported = createIsSupported();
916
1362
 
917
- // src/native-modules/getDeviceId.ts
918
- function getDeviceId() {
919
- return AppsInTossModule.deviceId;
1363
+ // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-modules/getOperationalEnvironment.ts
1364
+ function getOperationalEnvironment2() {
1365
+ return AppsInTossModule2.operationalEnvironment;
1366
+ }
1367
+
1368
+ // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-modules/getTossAppVersion.ts
1369
+ function getTossAppVersion2() {
1370
+ return AppsInTossModule2.tossAppVersion;
920
1371
  }
921
1372
 
922
- // src/native-modules/getTossAppVersion.ts
923
- function getTossAppVersion() {
924
- return AppsInTossModule.tossAppVersion;
1373
+ // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-modules/getDeviceId.ts
1374
+ function getDeviceId2() {
1375
+ return AppsInTossModule2.deviceId;
925
1376
  }
926
1377
 
927
- // src/native-modules/iap.ts
928
- async function createOneTimePurchaseOrder(params) {
929
- const isSupported = isMinVersionSupported({
930
- android: "5.219.0",
931
- ios: "5.219.0"
932
- });
933
- if (!isSupported) {
934
- return;
1378
+ // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/event-bridges.ts
1379
+ var event_bridges_exports = {};
1380
+ __export(event_bridges_exports, {
1381
+ contactsViral: () => contactsViral2,
1382
+ onVisibilityChangedByTransparentServiceWeb: () => onVisibilityChangedByTransparentServiceWeb2,
1383
+ startUpdateLocation: () => startUpdateLocation2
1384
+ });
1385
+
1386
+ // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-event-emitter/appsInTossEvent.ts
1387
+ var import_react_native34 = require("@granite-js/react-native");
1388
+
1389
+ // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-event-emitter/event-plugins/EntryMessageExitedEvent.ts
1390
+ var import_react_native29 = require("@granite-js/react-native");
1391
+ var EntryMessageExitedEvent2 = class extends import_react_native29.GraniteEventDefinition {
1392
+ name = "entryMessageExited";
1393
+ remove() {
935
1394
  }
936
- return AppsInTossModule.iapCreateOneTimePurchaseOrder(params);
937
- }
938
- async function getProductItemList() {
939
- const isSupported = isMinVersionSupported({
940
- android: "5.219.0",
941
- ios: "5.219.0"
942
- });
943
- if (!isSupported) {
944
- return;
1395
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
1396
+ listener(_) {
945
1397
  }
946
- return AppsInTossModule.iapGetProductItemList({});
947
- }
948
- var IAP = {
949
- createOneTimePurchaseOrder,
950
- getProductItemList
951
1398
  };
952
1399
 
953
- // src/native-modules/storage.ts
954
- function getItem(key) {
955
- return AppsInTossModule.getStorageItem({ key });
1400
+ // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-event-emitter/event-plugins/UpdateLocationEvent.ts
1401
+ var import_react_native31 = require("@granite-js/react-native");
1402
+
1403
+ // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-event-emitter/nativeEventEmitter.ts
1404
+ var import_react_native30 = require("react-native");
1405
+ var nativeEventEmitter2 = new import_react_native30.NativeEventEmitter(AppsInTossModuleInstance2);
1406
+
1407
+ // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-event-emitter/event-plugins/UpdateLocationEvent.ts
1408
+ var UpdateLocationEvent2 = class extends import_react_native31.GraniteEventDefinition {
1409
+ name = "updateLocationEvent";
1410
+ subscriptionCount = 0;
1411
+ ref = {
1412
+ remove: () => {
1413
+ }
1414
+ };
1415
+ remove() {
1416
+ if (--this.subscriptionCount === 0) {
1417
+ AppsInTossModuleInstance2.stopUpdateLocation({});
1418
+ }
1419
+ this.ref.remove();
1420
+ }
1421
+ listener(options, onEvent, onError) {
1422
+ requestPermission2({ name: "geolocation", access: "access" }).then((permissionStatus) => {
1423
+ if (permissionStatus === "denied") {
1424
+ onError(new Error("\uC704\uCE58 \uAD8C\uD55C\uC774 \uAC70\uBD80\uB418\uC5C8\uC5B4\uC694."));
1425
+ return;
1426
+ }
1427
+ void AppsInTossModuleInstance2.startUpdateLocation(options).catch(onError);
1428
+ const subscription = nativeEventEmitter2.addListener("updateLocation", onEvent);
1429
+ this.ref = {
1430
+ remove: () => subscription?.remove()
1431
+ };
1432
+ this.subscriptionCount++;
1433
+ }).catch(onError);
1434
+ }
1435
+ };
1436
+
1437
+ // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-event-emitter/internal/AppBridgeCallbackEvent.ts
1438
+ var import_react_native32 = require("@granite-js/react-native");
1439
+
1440
+ // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/utils/generateUUID.ts
1441
+ function generateUUID2(placeholder) {
1442
+ return placeholder ? (placeholder ^ Math.random() * 16 >> placeholder / 4).toString(16) : (String(1e7) + 1e3 + 4e3 + 8e3 + 1e11).replace(/[018]/g, generateUUID2);
956
1443
  }
957
- function setItem(key, value) {
958
- return AppsInTossModule.setStorageItem({
959
- key,
960
- value
1444
+
1445
+ // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-event-emitter/internal/appBridge.ts
1446
+ var INTERNAL__callbacks2 = /* @__PURE__ */ new Map();
1447
+ function invokeAppBridgeCallback2(id, ...args) {
1448
+ const callback = INTERNAL__callbacks2.get(id);
1449
+ callback?.call(null, ...args);
1450
+ return Boolean(callback);
1451
+ }
1452
+ function invokeAppBridgeMethod2(methodName, params, callbacks) {
1453
+ const { onSuccess, onError, ...appBridgeCallbacks } = callbacks;
1454
+ const { callbackMap, unregisterAll } = registerCallbacks2(appBridgeCallbacks);
1455
+ const promise = AppsInTossModuleInstance2[methodName]({
1456
+ params,
1457
+ callbacks: callbackMap
961
1458
  });
1459
+ void promise.then(onSuccess).catch(onError);
1460
+ return unregisterAll;
962
1461
  }
963
- function removeItem(key) {
964
- return AppsInTossModule.removeStorageItem({ key });
1462
+ function registerCallbacks2(callbacks) {
1463
+ const callbackMap = {};
1464
+ for (const [callbackName, callback] of Object.entries(callbacks)) {
1465
+ const id = registerCallback2(callback, callbackName);
1466
+ callbackMap[callbackName] = id;
1467
+ }
1468
+ const unregisterAll = () => {
1469
+ Object.values(callbackMap).forEach(unregisterCallback2);
1470
+ };
1471
+ return { callbackMap, unregisterAll };
965
1472
  }
966
- function clearItems() {
967
- return AppsInTossModule.clearStorage({});
1473
+ function registerCallback2(callback, name = "unnamed") {
1474
+ const uniqueId = generateUUID2();
1475
+ const callbackId = `${uniqueId}__${name}`;
1476
+ INTERNAL__callbacks2.set(callbackId, callback);
1477
+ return callbackId;
968
1478
  }
969
- var Storage = {
970
- getItem,
971
- setItem,
972
- removeItem,
973
- clearItems
1479
+ function unregisterCallback2(id) {
1480
+ INTERNAL__callbacks2.delete(id);
1481
+ }
1482
+ function getCallbackIds2() {
1483
+ return Array.from(INTERNAL__callbacks2.keys());
1484
+ }
1485
+ var INTERNAL__appBridgeHandler2 = {
1486
+ invokeAppBridgeCallback: invokeAppBridgeCallback2,
1487
+ invokeAppBridgeMethod: invokeAppBridgeMethod2,
1488
+ registerCallback: registerCallback2,
1489
+ unregisterCallback: unregisterCallback2,
1490
+ getCallbackIds: getCallbackIds2
974
1491
  };
975
1492
 
976
- // src/native-modules/contactsViral.ts
977
- function contactsViral(params) {
978
- const isSupported = isMinVersionSupported({
1493
+ // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-event-emitter/internal/AppBridgeCallbackEvent.ts
1494
+ var UNSAFE__nativeEventEmitter2 = nativeEventEmitter2;
1495
+ var AppBridgeCallbackEvent2 = class _AppBridgeCallbackEvent2 extends import_react_native32.GraniteEventDefinition {
1496
+ static INTERNAL__appBridgeSubscription;
1497
+ name = "appBridgeCallbackEvent";
1498
+ constructor() {
1499
+ super();
1500
+ this.registerAppBridgeCallbackEventListener();
1501
+ }
1502
+ remove() {
1503
+ }
1504
+ listener() {
1505
+ }
1506
+ registerAppBridgeCallbackEventListener() {
1507
+ if (_AppBridgeCallbackEvent2.INTERNAL__appBridgeSubscription != null) {
1508
+ return;
1509
+ }
1510
+ _AppBridgeCallbackEvent2.INTERNAL__appBridgeSubscription = UNSAFE__nativeEventEmitter2.addListener(
1511
+ "appBridgeCallback",
1512
+ this.ensureInvokeAppBridgeCallback
1513
+ );
1514
+ }
1515
+ ensureInvokeAppBridgeCallback(result) {
1516
+ if (typeof result === "object" && typeof result.name === "string") {
1517
+ INTERNAL__appBridgeHandler2.invokeAppBridgeCallback(result.name, result.params);
1518
+ } else {
1519
+ console.warn("Invalid app bridge callback result:", result);
1520
+ }
1521
+ }
1522
+ };
1523
+
1524
+ // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-event-emitter/internal/VisibilityChangedByTransparentServiceWebEvent.ts
1525
+ var import_react_native33 = require("@granite-js/react-native");
1526
+ var VisibilityChangedByTransparentServiceWebEvent2 = class extends import_react_native33.GraniteEventDefinition {
1527
+ name = "onVisibilityChangedByTransparentServiceWeb";
1528
+ subscription = null;
1529
+ remove() {
1530
+ this.subscription?.remove();
1531
+ this.subscription = null;
1532
+ }
1533
+ listener(options, onEvent, onError) {
1534
+ const subscription = nativeEventEmitter2.addListener("visibilityChangedByTransparentServiceWeb", (params) => {
1535
+ if (this.isVisibilityChangedByTransparentServiceWebResult(params)) {
1536
+ if (params.callbackId === options.callbackId) {
1537
+ onEvent(params.isVisible);
1538
+ }
1539
+ } else {
1540
+ onError(new Error("Invalid visibility changed by transparent service web result"));
1541
+ }
1542
+ });
1543
+ this.subscription = subscription;
1544
+ }
1545
+ isVisibilityChangedByTransparentServiceWebResult(params) {
1546
+ return typeof params === "object" && typeof params.callbackId === "string" && typeof params.isVisible === "boolean";
1547
+ }
1548
+ };
1549
+
1550
+ // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-event-emitter/appsInTossEvent.ts
1551
+ var appsInTossEvent2 = new import_react_native34.GraniteEvent([
1552
+ new UpdateLocationEvent2(),
1553
+ new EntryMessageExitedEvent2(),
1554
+ // Internal events
1555
+ new AppBridgeCallbackEvent2(),
1556
+ new VisibilityChangedByTransparentServiceWebEvent2()
1557
+ ]);
1558
+
1559
+ // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-event-emitter/startUpdateLocation.ts
1560
+ function startUpdateLocation2(eventParams) {
1561
+ return appsInTossEvent2.addEventListener("updateLocationEvent", eventParams);
1562
+ }
1563
+
1564
+ // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-event-emitter/internal/onVisibilityChangedByTransparentServiceWeb.ts
1565
+ function onVisibilityChangedByTransparentServiceWeb2(eventParams) {
1566
+ return appsInTossEvent2.addEventListener("onVisibilityChangedByTransparentServiceWeb", eventParams);
1567
+ }
1568
+
1569
+ // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-event-emitter/contactsViral.ts
1570
+ function contactsViral2(params) {
1571
+ const isSupported = isMinVersionSupported2({
979
1572
  android: "5.223.0",
980
1573
  ios: "5.223.0"
981
1574
  });
@@ -984,7 +1577,7 @@ function contactsViral(params) {
984
1577
  };
985
1578
  }
986
1579
  const { onEvent, onError, options } = params;
987
- const unregisterCallbacks = INTERNAL__appBridgeHandler.invokeAppBridgeMethod("contactsViral", options, {
1580
+ const unregisterCallbacks = INTERNAL__appBridgeHandler2.invokeAppBridgeMethod("contactsViral", options, {
988
1581
  onRewardFromContactsViral: (result) => {
989
1582
  onEvent({ type: "sendViral", data: result });
990
1583
  },
@@ -996,56 +1589,108 @@ function contactsViral(params) {
996
1589
  return unregisterCallbacks;
997
1590
  }
998
1591
 
999
- // src/native-modules/index.ts
1000
- var TossPay = {
1001
- checkoutPayment
1002
- };
1003
- var GoogleAdMob = {
1004
- loadAdMobInterstitialAd,
1005
- showAdMobInterstitialAd,
1006
- loadAdMobRewardedAd,
1007
- showAdMobRewardedAd
1592
+ // src/core/registerApp.tsx
1593
+ var import_jsx_runtime2 = require("react/jsx-runtime");
1594
+ function AppsInTossContainer(Container, { children, ...initialProps }) {
1595
+ if (!isMinVersionSupported({
1596
+ android: "5.220.0",
1597
+ ios: "5.221.0"
1598
+ })) {
1599
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [
1600
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(AppEvent.Entry, {}),
1601
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(AppEvent.System, { ...initialProps }),
1602
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(AppUpdate, {})
1603
+ ] });
1604
+ }
1605
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [
1606
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(AppEvent.StayTime, {}),
1607
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(AppEvent.Entry, {}),
1608
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(AppEvent.System, { ...initialProps }),
1609
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Container, { ...initialProps, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react_native36.TDSProvider, { colorPreference: "light", token: { color: { primary: getAppsInTossGlobals().brandPrimaryColor } }, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(TDSContainer, { ...initialProps, children }) }) })
1610
+ ] });
1611
+ }
1612
+ function TDSContainer({ children }) {
1613
+ useAppsInTossBridge();
1614
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_jsx_runtime2.Fragment, { children });
1615
+ }
1616
+ function registerApp(container, { context, analytics }) {
1617
+ import_analytics.Analytics.init({
1618
+ logger: (params) => void eventLog2(params),
1619
+ debug: analytics?.debug ?? __DEV__
1620
+ });
1621
+ const App = import_react_native35.Granite.registerApp(AppsInTossContainer.bind(null, container), {
1622
+ appName: getAppName(),
1623
+ context,
1624
+ router: {
1625
+ screenContainer: import_analytics.Analytics.Screen,
1626
+ defaultScreenOption: {
1627
+ statusBarStyle: "dark"
1628
+ }
1629
+ }
1630
+ });
1631
+ global.Page = App;
1632
+ return App;
1633
+ }
1634
+ function getAppName() {
1635
+ try {
1636
+ return global.__granite.app.name;
1637
+ } catch (error) {
1638
+ console.error("unexpected error occurred while getting app name");
1639
+ throw error;
1640
+ }
1641
+ }
1642
+
1643
+ // src/core/index.ts
1644
+ var AppsInToss = {
1645
+ registerApp
1008
1646
  };
1009
1647
 
1010
1648
  // src/components/WebView.tsx
1011
- var import_react_native20 = require("@toss-design-system/react-native");
1649
+ var import_react_native55 = require("@granite-js/react-native");
1650
+ var graniteAsyncBridges = __toESM(require("@granite-js/react-native/async-bridges"), 1);
1651
+ var graniteConstantBridges = __toESM(require("@granite-js/react-native/constant-bridges"), 1);
1652
+ var import_react_native56 = require("@toss-design-system/react-native");
1012
1653
  var import_private3 = require("@toss-design-system/react-native/private");
1013
- var import_react10 = require("react");
1014
- var import_react_native21 = require("react-native");
1015
- var import_react_native_bedrock18 = require("react-native-bedrock");
1016
- var bedrockAsyncBridges = __toESM(require("react-native-bedrock/async-bridges"), 1);
1017
- var bedrockConstantBridges = __toESM(require("react-native-bedrock/constant-bridges"), 1);
1654
+ var import_react11 = require("react");
1655
+ var import_react_native57 = require("react-native");
1018
1656
 
1019
1657
  // src/components/GameWebView.tsx
1020
- var import_react_native_webview = require("@react-native-bedrock/native/react-native-webview");
1021
- var import_react_native17 = require("@toss-design-system/react-native");
1658
+ var import_react_native_webview = require("@granite-js/native/react-native-webview");
1659
+ var import_react_native49 = require("@granite-js/react-native");
1660
+ var import_react_native50 = require("@toss-design-system/react-native");
1022
1661
  var import_es_hangul2 = require("es-hangul");
1023
- var import_react7 = require("react");
1024
- var import_react_native18 = require("react-native");
1025
- var import_react_native_bedrock14 = require("react-native-bedrock");
1662
+ var import_react8 = require("react");
1663
+ var import_react_native51 = require("react-native");
1026
1664
 
1027
1665
  // src/components/GameProfile.tsx
1028
- var import_react_native10 = require("@toss-design-system/react-native");
1029
- var import_react6 = require("react");
1030
- var import_react_native11 = require("react-native");
1666
+ var import_react_native42 = require("@toss-design-system/react-native");
1667
+ var import_react7 = require("react");
1668
+ var import_react_native43 = require("react-native");
1669
+
1670
+ // src/constant/game-center.ts
1671
+ var GAME_PROFILE_WEBVIEW_URL = "https://service.toss.im/game-center/profile";
1672
+ var GAME_CENTER_MIN_VERSION3 = {
1673
+ android: "5.221.0",
1674
+ ios: "5.221.0"
1675
+ };
1031
1676
 
1032
1677
  // src/hooks/useGameCenterProfile.ts
1033
- var import_react_native9 = require("@toss-design-system/react-native");
1678
+ var import_react_native40 = require("@granite-js/react-native");
1679
+ var import_react_native41 = require("@toss-design-system/react-native");
1034
1680
  var import_es_hangul = require("es-hangul");
1035
- var import_react5 = require("react");
1036
- var import_react_native_bedrock13 = require("react-native-bedrock");
1681
+ var import_react6 = require("react");
1037
1682
 
1038
1683
  // src/components/GameProfileToast.tsx
1039
- var import_react_native7 = require("@toss-design-system/react-native");
1684
+ var import_react_native37 = require("@toss-design-system/react-native");
1040
1685
  var import_private = require("@toss-design-system/react-native/private");
1041
- var import_jsx_runtime2 = require("react/jsx-runtime");
1686
+ var import_jsx_runtime3 = require("react/jsx-runtime");
1042
1687
  var useGameProfileToast = () => {
1043
1688
  const overlay = (0, import_private.useOverlay)();
1044
1689
  const openGameProfileToast = (nickname, profileImageUri) => {
1045
1690
  return new Promise((resolve) => {
1046
1691
  overlay.open(({ isOpen, close, exit }) => {
1047
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_private.ColorPreferenceProvider, { colorPreference: "dark", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_private.AdaptiveColorProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1048
- import_react_native7.Toast,
1692
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_private.ColorPreferenceProvider, { colorPreference: "dark", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_private.AdaptiveColorProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1693
+ import_react_native37.Toast,
1049
1694
  {
1050
1695
  open: isOpen,
1051
1696
  onClose: () => {
@@ -1055,11 +1700,11 @@ var useGameProfileToast = () => {
1055
1700
  onExited: exit,
1056
1701
  position: "top",
1057
1702
  text: `${nickname}\uB2D8 \uBC18\uAC00\uC6CC\uC694!`,
1058
- icon: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1059
- import_react_native7.Asset.Image,
1703
+ icon: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1704
+ import_react_native37.Asset.Image,
1060
1705
  {
1061
1706
  style: { borderRadius: 64, overflow: "hidden" },
1062
- frameShape: import_react_native7.Asset.frameShape.CleanW32,
1707
+ frameShape: import_react_native37.Asset.frameShape.CleanW32,
1063
1708
  source: { uri: profileImageUri }
1064
1709
  }
1065
1710
  )
@@ -1078,20 +1723,15 @@ var DEFAULT_ERROR = {
1078
1723
  };
1079
1724
 
1080
1725
  // src/utils/market.ts
1081
- var import_react_native8 = require("react-native");
1726
+ var import_react_native38 = require("react-native");
1082
1727
  var PLAYSTORE_LINK = "https://play.google.com/store/apps/details?id=viva.republica.toss";
1083
1728
  var APPSTORE_LINK = "https://itunes.apple.com/app/id839333328";
1084
1729
  var getMarketLink = () => {
1085
- return import_react_native8.Platform.OS === "android" ? PLAYSTORE_LINK : APPSTORE_LINK;
1730
+ return import_react_native38.Platform.OS === "android" ? PLAYSTORE_LINK : APPSTORE_LINK;
1086
1731
  };
1087
1732
 
1088
1733
  // src/utils/openTransparentWebView.ts
1089
- var import_react_native_bedrock12 = require("react-native-bedrock");
1090
-
1091
- // src/native-event-emitter/internal/onVisibilityChangedByTransparentServiceWeb.ts
1092
- function onVisibilityChangedByTransparentServiceWeb(eventParams) {
1093
- return appsInTossEvent.addEventListener("onVisibilityChangedByTransparentServiceWeb", eventParams);
1094
- }
1734
+ var import_react_native39 = require("@granite-js/react-native");
1095
1735
 
1096
1736
  // src/private.ts
1097
1737
  var INTERNAL__onVisibilityChangedByTransparentServiceWeb = onVisibilityChangedByTransparentServiceWeb;
@@ -1124,29 +1764,29 @@ var openTransparentWebView = ({
1124
1764
  }
1125
1765
  }
1126
1766
  });
1127
- (0, import_react_native_bedrock12.openURL)(url.toString());
1767
+ (0, import_react_native39.openURL)(url.toString());
1128
1768
  };
1129
1769
 
1130
1770
  // src/hooks/useGameCenterProfile.ts
1131
1771
  var useGameCenterProfile = (isReadyForProfileUI) => {
1132
- const [profileData, setProfileData] = (0, import_react5.useState)(void 0);
1133
- const [isProfileDataLoading, setIsProfileDataLoading] = (0, import_react5.useState)(true);
1134
- const [isProfileDataRefetching, setIsProfileDataRefetching] = (0, import_react5.useState)(false);
1772
+ const [profileData, setProfileData] = (0, import_react6.useState)(void 0);
1773
+ const [isProfileDataLoading, setIsProfileDataLoading] = (0, import_react6.useState)(true);
1774
+ const [isProfileDataRefetching, setIsProfileDataRefetching] = (0, import_react6.useState)(false);
1135
1775
  const shouldShowLoadingOverlay = isProfileDataLoading && isReadyForProfileUI;
1136
1776
  const shouldShowProfileNotFoundOverlay = profileData?.statusCode === "PROFILE_NOT_FOUND" && isReadyForProfileUI && !isProfileDataRefetching;
1137
1777
  const canShowBottomSheetOrToast = !isProfileDataLoading && isReadyForProfileUI;
1138
- const [isWebviewLoading, setIsWebviewLoading] = (0, import_react5.useState)(false);
1139
- const isCompletedProfileFlow = (0, import_react5.useRef)(false);
1140
- const { openAlert, openConfirm } = (0, import_react_native9.useDialog)();
1778
+ const [isWebviewLoading, setIsWebviewLoading] = (0, import_react6.useState)(false);
1779
+ const isCompletedProfileFlow = (0, import_react6.useRef)(false);
1780
+ const { openAlert, openConfirm } = (0, import_react_native41.useDialog)();
1141
1781
  const { openGameProfileToast } = useGameProfileToast();
1142
- const openErrorAlert = (0, import_react5.useCallback)(async () => {
1782
+ const openErrorAlert = (0, import_react6.useCallback)(async () => {
1143
1783
  await openAlert({
1144
1784
  title: DEFAULT_ERROR.title,
1145
1785
  description: DEFAULT_ERROR.description
1146
1786
  });
1147
- (0, import_react_native_bedrock13.closeView)();
1787
+ (0, import_react_native40.closeView)();
1148
1788
  }, [openAlert]);
1149
- const openProfileWebview = (0, import_react5.useCallback)(() => {
1789
+ const openProfileWebview = (0, import_react6.useCallback)(() => {
1150
1790
  if (isWebviewLoading) {
1151
1791
  return;
1152
1792
  }
@@ -1175,7 +1815,7 @@ var useGameCenterProfile = (isReadyForProfileUI) => {
1175
1815
  }
1176
1816
  });
1177
1817
  }, [isWebviewLoading, openGameProfileToast, openErrorAlert]);
1178
- const updateAppToSupportedMinVersion = (0, import_react5.useCallback)(async () => {
1818
+ const updateAppToSupportedMinVersion = (0, import_react6.useCallback)(async () => {
1179
1819
  const upddateConfirmDialogLabel = {
1180
1820
  title: `${(0, import_es_hangul.josa)(getAppsInTossGlobals().brandDisplayName, "\uC744/\uB97C")} \uD558\uB824\uBA74
1181
1821
  \uC571\uC744 \uC5C5\uB370\uC774\uD2B8\uD574\uC8FC\uC138\uC694`,
@@ -1189,11 +1829,11 @@ var useGameCenterProfile = (isReadyForProfileUI) => {
1189
1829
  closeOnDimmerClick: true
1190
1830
  });
1191
1831
  if (!isConfirmed) {
1192
- (0, import_react_native_bedrock13.closeView)();
1832
+ (0, import_react_native40.closeView)();
1193
1833
  return;
1194
1834
  }
1195
1835
  const STORE_SCHEME = getMarketLink();
1196
- (0, import_react_native_bedrock13.openURL)(`supertoss://web?url=${STORE_SCHEME}&external=browser`);
1836
+ (0, import_react_native40.openURL)(`supertoss://web?url=${STORE_SCHEME}&external=browser`);
1197
1837
  }, [openConfirm]);
1198
1838
  return {
1199
1839
  profileData,
@@ -1222,7 +1862,7 @@ var Z_INDEX = {
1222
1862
  };
1223
1863
 
1224
1864
  // src/components/GameProfile.tsx
1225
- var import_jsx_runtime3 = require("react/jsx-runtime");
1865
+ var import_jsx_runtime4 = require("react/jsx-runtime");
1226
1866
  var GameProfile = ({ children, isReadyForProfileUI }) => {
1227
1867
  const {
1228
1868
  profileData,
@@ -1238,7 +1878,7 @@ var GameProfile = ({ children, isReadyForProfileUI }) => {
1238
1878
  openErrorAlert,
1239
1879
  openGameProfileToast
1240
1880
  } = useGameCenterProfile(isReadyForProfileUI);
1241
- (0, import_react6.useEffect)(() => {
1881
+ (0, import_react7.useEffect)(() => {
1242
1882
  try {
1243
1883
  const getProfileData = async () => {
1244
1884
  const data = await getGameCenterGameProfile();
@@ -1251,7 +1891,7 @@ var GameProfile = ({ children, isReadyForProfileUI }) => {
1251
1891
  setIsProfileDataLoading(false);
1252
1892
  }
1253
1893
  }, []);
1254
- (0, import_react6.useEffect)(() => {
1894
+ (0, import_react7.useEffect)(() => {
1255
1895
  const handleGameProfileFlow = async () => {
1256
1896
  if (!canShowBottomSheetOrToast) {
1257
1897
  return;
@@ -1260,7 +1900,7 @@ var GameProfile = ({ children, isReadyForProfileUI }) => {
1260
1900
  return;
1261
1901
  }
1262
1902
  isCompletedProfileFlow.current = true;
1263
- if (!isMinVersionSupported(GAME_CENTER_MIN_VERSION)) {
1903
+ if (!isMinVersionSupported(GAME_CENTER_MIN_VERSION3)) {
1264
1904
  updateAppToSupportedMinVersion();
1265
1905
  return;
1266
1906
  }
@@ -1281,11 +1921,11 @@ var GameProfile = ({ children, isReadyForProfileUI }) => {
1281
1921
  profileData,
1282
1922
  updateAppToSupportedMinVersion
1283
1923
  ]);
1284
- if (!isMinVersionSupported(GAME_CENTER_MIN_VERSION)) {
1285
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
1286
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native11.View, { style: { flex: 1, position: "relative" }, children }),
1287
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1288
- import_react_native11.Pressable,
1924
+ if (!isMinVersionSupported(GAME_CENTER_MIN_VERSION3)) {
1925
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
1926
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native43.View, { style: { flex: 1, position: "relative" }, children }),
1927
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
1928
+ import_react_native43.Pressable,
1289
1929
  {
1290
1930
  style: {
1291
1931
  ...overlayStyle
@@ -1298,10 +1938,10 @@ var GameProfile = ({ children, isReadyForProfileUI }) => {
1298
1938
  ] });
1299
1939
  }
1300
1940
  if (shouldShowLoadingOverlay || isProfileDataRefetching) {
1301
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
1302
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native11.View, { style: { flex: 1, position: "relative" }, children }),
1303
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1304
- import_react_native11.View,
1941
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
1942
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native43.View, { style: { flex: 1, position: "relative" }, children }),
1943
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
1944
+ import_react_native43.View,
1305
1945
  {
1306
1946
  style: {
1307
1947
  ...overlayStyle,
@@ -1309,16 +1949,16 @@ var GameProfile = ({ children, isReadyForProfileUI }) => {
1309
1949
  alignItems: "center",
1310
1950
  backgroundColor: "rgba(0, 0, 0, 0.2)"
1311
1951
  },
1312
- children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native10.Loader, { size: "large", type: "light" })
1952
+ children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native42.Loader, { size: "large", type: "light" })
1313
1953
  }
1314
1954
  )
1315
1955
  ] });
1316
1956
  }
1317
1957
  if (shouldShowProfileNotFoundOverlay) {
1318
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
1319
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native11.View, { style: { flex: 1, position: "relative" }, children }),
1320
- shouldShowProfileNotFoundOverlay && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1321
- import_react_native11.Pressable,
1958
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
1959
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native43.View, { style: { flex: 1, position: "relative" }, children }),
1960
+ shouldShowProfileNotFoundOverlay && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
1961
+ import_react_native43.Pressable,
1322
1962
  {
1323
1963
  style: {
1324
1964
  ...overlayStyle
@@ -1330,7 +1970,7 @@ var GameProfile = ({ children, isReadyForProfileUI }) => {
1330
1970
  )
1331
1971
  ] });
1332
1972
  }
1333
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_jsx_runtime3.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native11.View, { style: { flex: 1, position: "relative" }, children }) });
1973
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_jsx_runtime4.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native43.View, { style: { flex: 1, position: "relative" }, children }) });
1334
1974
  };
1335
1975
  var overlayStyle = {
1336
1976
  position: "absolute",
@@ -1342,19 +1982,19 @@ var overlayStyle = {
1342
1982
  };
1343
1983
 
1344
1984
  // src/components/GameWebViewNavigationBar/GameNavigationBar.tsx
1345
- var import_react_native_svg = require("@react-native-bedrock/native/react-native-svg");
1346
- var import_react_native15 = require("@toss-design-system/react-native");
1347
- var import_react_native16 = require("react-native");
1985
+ var import_react_native_svg = require("@granite-js/native/react-native-svg");
1986
+ var import_react_native47 = require("@toss-design-system/react-native");
1987
+ var import_react_native48 = require("react-native");
1348
1988
 
1349
1989
  // src/components/GameWebViewNavigationBar/HeaderRight.tsx
1350
- var import_react_native13 = require("react-native");
1990
+ var import_react_native45 = require("react-native");
1351
1991
 
1352
1992
  // src/components/GameWebViewNavigationBar/byPlatform.ts
1353
- var import_react_native12 = require("react-native");
1993
+ var import_react_native44 = require("react-native");
1354
1994
  function byPlatform({
1355
1995
  ...props
1356
1996
  }) {
1357
- return (props[import_react_native12.Platform.OS] ?? props.fallback)();
1997
+ return (props[import_react_native44.Platform.OS] ?? props.fallback)();
1358
1998
  }
1359
1999
 
1360
2000
  // src/components/GameWebViewNavigationBar/constants.ts
@@ -1362,21 +2002,21 @@ var RIGHT_MARGIN = 24;
1362
2002
  var IOS_DEFAULT_MARGIN = 20;
1363
2003
 
1364
2004
  // src/components/GameWebViewNavigationBar/HeaderRight.tsx
1365
- var import_jsx_runtime4 = require("react/jsx-runtime");
2005
+ var import_jsx_runtime5 = require("react/jsx-runtime");
1366
2006
  function IOSHeaderRight(props) {
1367
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native13.View, { style: styles.ios, ...props });
2007
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react_native45.View, { style: styles.ios, ...props });
1368
2008
  }
1369
2009
  function AndroidHeaderRight(props) {
1370
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native13.View, { style: styles.android, ...props });
2010
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react_native45.View, { style: styles.android, ...props });
1371
2011
  }
1372
2012
  function HeaderRight(props) {
1373
2013
  return byPlatform({
1374
- ios: () => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(IOSHeaderRight, { ...props }),
1375
- android: () => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(AndroidHeaderRight, { ...props }),
1376
- fallback: () => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(IOSHeaderRight, { ...props })
2014
+ ios: () => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(IOSHeaderRight, { ...props }),
2015
+ android: () => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(AndroidHeaderRight, { ...props }),
2016
+ fallback: () => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(IOSHeaderRight, { ...props })
1377
2017
  });
1378
2018
  }
1379
- var styles = import_react_native13.StyleSheet.create({
2019
+ var styles = import_react_native45.StyleSheet.create({
1380
2020
  ios: {
1381
2021
  marginRight: -IOS_DEFAULT_MARGIN + RIGHT_MARGIN,
1382
2022
  flexDirection: "row"
@@ -1387,49 +2027,49 @@ var styles = import_react_native13.StyleSheet.create({
1387
2027
  });
1388
2028
 
1389
2029
  // src/components/GameWebViewNavigationBar/useSafeAreaTop.ts
1390
- var import_react_native_safe_area_context = require("@react-native-bedrock/native/react-native-safe-area-context");
1391
- var import_react_native14 = require("react-native");
2030
+ var import_react_native_safe_area_context = require("@granite-js/native/react-native-safe-area-context");
2031
+ var import_react_native46 = require("react-native");
1392
2032
  function useSafeAreaTop() {
1393
2033
  const safeAreaInsets = (0, import_react_native_safe_area_context.useSafeAreaInsets)();
1394
- const hasDynamicIsland = import_react_native14.Platform.OS === "ios" && safeAreaInsets.top > 50;
2034
+ const hasDynamicIsland = import_react_native46.Platform.OS === "ios" && safeAreaInsets.top > 50;
1395
2035
  const safeAreaTop = hasDynamicIsland ? safeAreaInsets.top - 5 : safeAreaInsets.top;
1396
2036
  return safeAreaTop;
1397
2037
  }
1398
2038
 
1399
2039
  // src/components/GameWebViewNavigationBar/GameNavigationBar.tsx
1400
- var import_jsx_runtime5 = require("react/jsx-runtime");
2040
+ var import_jsx_runtime6 = require("react/jsx-runtime");
1401
2041
  var originXML = '<svg fill="none" height="30" viewBox="0 0 30 30" width="30" xmlns="https://www.w3.org/2000/svg"><rect fill="#031832" fill-opacity=".46" height="30" rx="15" width="30"/><rect height="29.5" rx="14.75" stroke="#d9d9ff" stroke-opacity=".11" stroke-width=".5" width="29.5" x=".25" y=".25"/><path clip-rule="evenodd" d="m16.5119 15.0014 4.7092-4.7092c.0929-.0928.1666-.2031.2169-.32441.0503-.12134.0762-.25141.0762-.38276.0001-.13136-.0258-.26144-.076-.38281s-.1239-.23166-.2167-.32457c-.0929-.09291-.2031-.16662-.3245-.21692-.1213-.05031-.2514-.07622-.3827-.07626-.1314-.00004-.2615.0258-.3828.07603-.1214.05023-.2317.12388-.3246.21673l-4.7092 4.70997-4.71-4.70997c-.1897-.17718-.4408-.27373-.70034-.26927s-.5072.10959-.69069.2932c-.1835.1836-.28848.43132-.29279.69087-.00432.25954.09238.51057.26968.70017l4.71004 4.7092-4.71004 4.7092c-.1392.1401-.23385.3183-.27204.5121-.0382.1939-.01823.3946.05739.5771s.20351.3386.36759.4486.35702.169.55456.1697c.25583 0 .51164-.0975.70664-.2925l4.71-4.71 4.7092 4.71c.0927.093.2029.1668.3243.2172.1213.0504.2514.0763.3828.0763s.2614-.0259.3828-.0763c.1213-.0504.2315-.1242.3243-.2172.0929-.0929.1667-.2032.217-.3246s.0762-.2515.0762-.3829-.0259-.2616-.0762-.383-.1241-.2317-.217-.3245z" fill="#fdfdfe" fill-opacity=".89" fill-rule="evenodd"/></svg>';
1402
2042
  function GameNavigationBar({ onClose }) {
1403
2043
  const safeAreaTop = useSafeAreaTop();
1404
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
1405
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react_native15.PageNavbar, { preference: { type: "none" } }),
1406
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1407
- import_react_native16.View,
2044
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
2045
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react_native47.PageNavbar, { preference: { type: "none" } }),
2046
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
2047
+ import_react_native48.View,
1408
2048
  {
1409
2049
  style: {
1410
2050
  width: "100%",
1411
- height: import_react_native16.Platform.OS === "ios" ? 44 : 54,
2051
+ height: import_react_native48.Platform.OS === "ios" ? 44 : 54,
1412
2052
  flexDirection: "row",
1413
2053
  alignItems: "center",
1414
2054
  justifyContent: "flex-end",
1415
2055
  position: "absolute",
1416
2056
  zIndex: Z_INDEX.CLOSE_BUTTON,
1417
2057
  marginTop: safeAreaTop,
1418
- paddingRight: import_react_native16.Platform.OS === "ios" ? 10 : 8
2058
+ paddingRight: import_react_native48.Platform.OS === "ios" ? 10 : 8
1419
2059
  },
1420
2060
  pointerEvents: "box-none",
1421
- children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(HeaderRight, { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1422
- import_react_native16.TouchableOpacity,
2061
+ children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(HeaderRight, { children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
2062
+ import_react_native48.TouchableOpacity,
1423
2063
  {
1424
2064
  hitSlop: { left: 8, right: 8 },
1425
2065
  accessibilityRole: "button",
1426
2066
  accessible: true,
1427
2067
  accessibilityLabel: "\uAC8C\uC784\uC885\uB8CC",
1428
2068
  style: {
1429
- padding: import_react_native16.Platform.OS === "ios" ? 7 : 9
2069
+ padding: import_react_native48.Platform.OS === "ios" ? 7 : 9
1430
2070
  },
1431
2071
  onPress: onClose,
1432
- children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react_native_svg.SvgXml, { xml: originXML, width: 30, height: 30 })
2072
+ children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react_native_svg.SvgXml, { xml: originXML, width: 30, height: 30 })
1433
2073
  }
1434
2074
  ) })
1435
2075
  }
@@ -1438,13 +2078,13 @@ function GameNavigationBar({ onClose }) {
1438
2078
  }
1439
2079
 
1440
2080
  // src/components/GameWebView.tsx
1441
- var import_jsx_runtime6 = require("react/jsx-runtime");
1442
- var GameWebView = (0, import_react7.forwardRef)(function GameWebView2(props, ref) {
1443
- const { openConfirm } = (0, import_react_native17.useDialog)();
2081
+ var import_jsx_runtime7 = require("react/jsx-runtime");
2082
+ var GameWebView = (0, import_react8.forwardRef)(function GameWebView2(props, ref) {
2083
+ const { openConfirm } = (0, import_react_native50.useDialog)();
1444
2084
  const { brandDisplayName } = getAppsInTossGlobals();
1445
2085
  const { captureExitLog } = useCaptureExitLog();
1446
- const [isEntryMessageExited, setIsEntryMessageExited] = (0, import_react7.useState)(false);
1447
- const handleClose = (0, import_react7.useCallback)(async () => {
2086
+ const [isEntryMessageExited, setIsEntryMessageExited] = (0, import_react8.useState)(false);
2087
+ const handleClose = (0, import_react8.useCallback)(async () => {
1448
2088
  const isConfirmed = await openConfirm({
1449
2089
  title: `${(0, import_es_hangul2.josa)(brandDisplayName, "\uC744/\uB97C")} \uC885\uB8CC\uD560\uAE4C\uC694?`,
1450
2090
  leftButton: "\uCDE8\uC18C",
@@ -1453,43 +2093,43 @@ var GameWebView = (0, import_react7.forwardRef)(function GameWebView2(props, ref
1453
2093
  });
1454
2094
  if (isConfirmed) {
1455
2095
  captureExitLog(Date.now());
1456
- (0, import_react_native_bedrock14.closeView)();
2096
+ (0, import_react_native49.closeView)();
1457
2097
  }
1458
2098
  }, [brandDisplayName, captureExitLog, openConfirm]);
1459
- (0, import_react7.useEffect)(() => {
1460
- if (import_react_native18.Platform.OS === "ios") {
1461
- (0, import_react_native_bedrock14.setIosSwipeGestureEnabled)({ isEnabled: false });
2099
+ (0, import_react8.useEffect)(() => {
2100
+ if (import_react_native51.Platform.OS === "ios") {
2101
+ setIosSwipeGestureEnabled({ isEnabled: false });
1462
2102
  return () => {
1463
- (0, import_react_native_bedrock14.setIosSwipeGestureEnabled)({ isEnabled: true });
2103
+ setIosSwipeGestureEnabled({ isEnabled: true });
1464
2104
  };
1465
2105
  }
1466
2106
  return;
1467
2107
  }, []);
1468
- (0, import_react7.useEffect)(() => {
2108
+ (0, import_react8.useEffect)(() => {
1469
2109
  const backHandler = () => {
1470
2110
  handleClose();
1471
2111
  return true;
1472
2112
  };
1473
- import_react_native18.BackHandler.addEventListener("hardwareBackPress", backHandler);
2113
+ import_react_native51.BackHandler.addEventListener("hardwareBackPress", backHandler);
1474
2114
  return () => {
1475
- import_react_native18.BackHandler.removeEventListener("hardwareBackPress", backHandler);
2115
+ import_react_native51.BackHandler.removeEventListener("hardwareBackPress", backHandler);
1476
2116
  };
1477
2117
  }, [handleClose]);
1478
- (0, import_react7.useEffect)(() => {
2118
+ (0, import_react8.useEffect)(() => {
1479
2119
  appsInTossEvent.addEventListener("entryMessageExited", {
1480
2120
  onEvent: () => {
1481
2121
  setIsEntryMessageExited(true);
1482
2122
  }
1483
2123
  });
1484
2124
  }, []);
1485
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
1486
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(GameNavigationBar, { onClose: handleClose }),
1487
- getOperationalEnvironment() === "toss" ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(GameProfile, { isReadyForProfileUI: isEntryMessageExited, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react_native_webview.WebView, { ref, ...props }) }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react_native_webview.WebView, { ref, ...props })
2125
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
2126
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(GameNavigationBar, { onClose: handleClose }),
2127
+ getOperationalEnvironment() === "toss" ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(GameProfile, { isReadyForProfileUI: isEntryMessageExited, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react_native_webview.WebView, { ref, ...props }) }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react_native_webview.WebView, { ref, ...props })
1488
2128
  ] });
1489
2129
  });
1490
2130
 
1491
2131
  // src/bridge-handler/useBridgeHandler.tsx
1492
- var import_react8 = require("react");
2132
+ var import_react9 = require("react");
1493
2133
  function serializeError(error) {
1494
2134
  return JSON.stringify(error, (_, value) => {
1495
2135
  if (value instanceof Error) {
@@ -1521,12 +2161,12 @@ function methodHandler({
1521
2161
  };
1522
2162
  wrappedFunc(...args).then((result) => {
1523
2163
  injectJavaScript?.(`
1524
- window.__BEDROCK_NATIVE_EMITTER.emit('${functionName}/resolve/${eventId}', ${JSON.stringify(result, null, 0)});
2164
+ window.__GRANITE_NATIVE_EMITTER.emit('${functionName}/resolve/${eventId}', ${JSON.stringify(result, null, 0)});
1525
2165
  `);
1526
2166
  }).catch((error) => {
1527
2167
  const serializedError = serializeError(error);
1528
2168
  injectJavaScript?.(`
1529
- window.__BEDROCK_NATIVE_EMITTER.emit('${functionName}/reject/${eventId}', ${serializedError});
2169
+ window.__GRANITE_NATIVE_EMITTER.emit('${functionName}/reject/${eventId}', ${serializedError});
1530
2170
  `);
1531
2171
  });
1532
2172
  }
@@ -1538,8 +2178,8 @@ function useBridgeHandler({
1538
2178
  eventListenerMap,
1539
2179
  injectedJavaScript: originalInjectedJavaScript
1540
2180
  }) {
1541
- const ref = (0, import_react8.useRef)(null);
1542
- const injectedJavaScript = (0, import_react8.useMemo)(
2181
+ const ref = (0, import_react9.useRef)(null);
2182
+ const injectedJavaScript = (0, import_react9.useMemo)(
1543
2183
  () => [
1544
2184
  `window.__CONSTANT_HANDLER_MAP = ${JSON.stringify(
1545
2185
  Object.entries(constantHandlerMap).reduce(
@@ -1557,15 +2197,15 @@ function useBridgeHandler({
1557
2197
  );
1558
2198
  const createHandleOnEvent = (functionName, eventId) => (response) => {
1559
2199
  ref.current?.injectJavaScript(`
1560
- window.__BEDROCK_NATIVE_EMITTER.emit('${functionName}/onEvent/${eventId}', ${JSON.stringify(response, null, 0)});
2200
+ window.__GRANITE_NATIVE_EMITTER.emit('${functionName}/onEvent/${eventId}', ${JSON.stringify(response, null, 0)});
1561
2201
  `);
1562
2202
  };
1563
2203
  const createHandleOnError = (functionName, eventId) => (error) => {
1564
2204
  ref.current?.injectJavaScript(`
1565
- window.__BEDROCK_NATIVE_EMITTER.emit('${functionName}/onError/${eventId}', ${JSON.stringify(error, null, 0)});
2205
+ window.__GRANITE_NATIVE_EMITTER.emit('${functionName}/onError/${eventId}', ${JSON.stringify(error, null, 0)});
1566
2206
  `);
1567
2207
  };
1568
- const $onMessage = (0, import_react8.useCallback)(
2208
+ const $onMessage = (0, import_react9.useCallback)(
1569
2209
  async (e) => {
1570
2210
  onMessage?.(e);
1571
2211
  const data = JSON.parse(e.nativeEvent.data);
@@ -1615,24 +2255,8 @@ function useBridgeHandler({
1615
2255
  };
1616
2256
  }
1617
2257
 
1618
- // src/constant-bridges.ts
1619
- var constant_bridges_exports = {};
1620
- __export(constant_bridges_exports, {
1621
- getDeviceId: () => getDeviceId,
1622
- getOperationalEnvironment: () => getOperationalEnvironment,
1623
- getTossAppVersion: () => getTossAppVersion
1624
- });
1625
-
1626
- // src/event-bridges.ts
1627
- var event_bridges_exports = {};
1628
- __export(event_bridges_exports, {
1629
- contactsViral: () => contactsViral,
1630
- startUpdateLocation: () => startUpdateLocation
1631
- });
1632
-
1633
2258
  // src/hooks/useCreateUserAgent.ts
1634
- var import_react_native19 = require("react-native");
1635
- var import_react_native_bedrock15 = require("react-native-bedrock");
2259
+ var import_react_native52 = require("react-native");
1636
2260
  var FontA11yCategory = {
1637
2261
  Large: "Large",
1638
2262
  xLarge: "xLarge",
@@ -1765,9 +2389,9 @@ function useCreateUserAgent({
1765
2389
  safeArea,
1766
2390
  safeAreaBottomTransparency
1767
2391
  }) {
1768
- const platform = (0, import_react_native_bedrock15.getPlatformOS)();
2392
+ const platform = getPlatformOS();
1769
2393
  const appVersion = getTossAppVersion();
1770
- const { fontScale } = (0, import_react_native19.useWindowDimensions)();
2394
+ const { fontScale } = (0, import_react_native52.useWindowDimensions)();
1771
2395
  const platformString = platform === "ios" ? "iPhone" : "Android";
1772
2396
  const fontA11y = mapFontScaleToCategory(fontScale, platform);
1773
2397
  const normalizedFontScale = convertToAndroidStyleScale(fontScale, platform);
@@ -1787,12 +2411,12 @@ function useCreateUserAgent({
1787
2411
  }
1788
2412
 
1789
2413
  // src/hooks/useGeolocation.ts
1790
- var import_react9 = require("react");
1791
- var import_react_native_bedrock16 = require("react-native-bedrock");
2414
+ var import_react_native53 = require("@granite-js/react-native");
2415
+ var import_react10 = require("react");
1792
2416
  function useGeolocation({ accuracy, distanceInterval, timeInterval }) {
1793
- const isVisible = (0, import_react_native_bedrock16.useVisibility)();
1794
- const [location, setLocation] = (0, import_react9.useState)(null);
1795
- (0, import_react9.useEffect)(() => {
2417
+ const isVisible = (0, import_react_native53.useVisibility)();
2418
+ const [location, setLocation] = (0, import_react10.useState)(null);
2419
+ (0, import_react10.useEffect)(() => {
1796
2420
  if (!isVisible) {
1797
2421
  return;
1798
2422
  }
@@ -1810,7 +2434,7 @@ function useGeolocation({ accuracy, distanceInterval, timeInterval }) {
1810
2434
  }
1811
2435
 
1812
2436
  // src/utils/log.ts
1813
- var import_react_native_bedrock17 = require("react-native-bedrock");
2437
+ var import_react_native54 = require("@granite-js/react-native");
1814
2438
 
1815
2439
  // src/utils/extractDateFromUUIDv7.ts
1816
2440
  var extractDateFromUUIDv7 = (uuid) => {
@@ -1836,7 +2460,7 @@ var getGroupId = (url) => {
1836
2460
  };
1837
2461
  var getReferrer = () => {
1838
2462
  try {
1839
- const referrer = new URL((0, import_react_native_bedrock17.getSchemeUri)());
2463
+ const referrer = new URL((0, import_react_native54.getSchemeUri)());
1840
2464
  return referrer.searchParams.get("referrer");
1841
2465
  } catch {
1842
2466
  return "";
@@ -1858,18 +2482,18 @@ var trackScreen = (url) => {
1858
2482
  };
1859
2483
 
1860
2484
  // src/components/WebView.tsx
1861
- var import_jsx_runtime7 = require("react/jsx-runtime");
2485
+ var import_jsx_runtime8 = require("react/jsx-runtime");
1862
2486
  var appsInTossGlobals = getAppsInTossGlobals();
1863
- var operationalEnvironment = getOperationalEnvironment();
2487
+ var operationalEnvironment = getOperationalEnvironment2();
1864
2488
  var TYPES = ["partner", "external", "game"];
1865
2489
  var WEBVIEW_TYPES = {
1866
- partner: import_react_native20.PartnerWebViewScreen,
1867
- external: import_react_native20.ExternalWebViewScreen,
2490
+ partner: import_react_native56.PartnerWebViewScreen,
2491
+ external: import_react_native56.ExternalWebViewScreen,
1868
2492
  game: GameWebView
1869
2493
  };
1870
2494
  function mergeSchemeQueryParamsInto(url) {
1871
2495
  const baseUrl = new URL(url);
1872
- const schemeUrl = new URL((0, import_react_native_bedrock18.getSchemeUri)());
2496
+ const schemeUrl = new URL((0, import_react_native55.getSchemeUri)());
1873
2497
  baseUrl.pathname = schemeUrl.pathname;
1874
2498
  for (const [key, value] of schemeUrl.searchParams.entries()) {
1875
2499
  baseUrl.searchParams.set(key, value);
@@ -1893,12 +2517,12 @@ function WebView({ type, local, onMessage, ...props }) {
1893
2517
  if (!TYPES.includes(type)) {
1894
2518
  throw new Error(`Invalid WebView type: '${type}'`);
1895
2519
  }
1896
- const bedrockEvent = (0, import_react_native_bedrock18.useBedrockEvent)();
1897
- const uri = (0, import_react10.useMemo)(() => getWebViewUri(local), [local]);
2520
+ const graniteEvent = (0, import_react_native55.useGraniteEvent)();
2521
+ const uri = (0, import_react11.useMemo)(() => getWebViewUri(local), [local]);
1898
2522
  const top = (0, import_private3.useSafeAreaTop)();
1899
2523
  const bottom = (0, import_private3.useSafeAreaBottom)();
1900
2524
  const global2 = getAppsInTossGlobals();
1901
- const partner = (0, import_react_native20.usePartnerNavigation)();
2525
+ const partner = (0, import_react_native56.usePartnerNavigation)();
1902
2526
  const disableTextSelectionCSS = `
1903
2527
  (function() {
1904
2528
  const style = document.createElement('style');
@@ -1906,17 +2530,20 @@ function WebView({ type, local, onMessage, ...props }) {
1906
2530
  document.head.appendChild(style);
1907
2531
  })();
1908
2532
  `;
2533
+ const [allowsBackForwardNavigationGestures, setAllowsBackForwardNavigationGestures] = (0, import_react11.useState)(
2534
+ props.allowsBackForwardNavigationGestures
2535
+ );
1909
2536
  const handler = useBridgeHandler({
1910
2537
  onMessage,
1911
2538
  injectedJavaScript: [disableTextSelectionCSS].join("\n"),
1912
2539
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
1913
2540
  eventListenerMap: {
1914
2541
  ...event_bridges_exports,
1915
- navigationAccessoryEvent: ({ onEvent, onError }) => import_react_native20.tdsEvent.addEventListener("navigationAccessoryEvent", {
2542
+ navigationAccessoryEvent: ({ onEvent, onError }) => import_react_native56.tdsEvent.addEventListener("navigationAccessoryEvent", {
1916
2543
  onEvent,
1917
2544
  onError
1918
2545
  }),
1919
- backEvent: ({ onEvent, onError, options }) => bedrockEvent.addEventListener("backEvent", { onEvent, onError, options }),
2546
+ backEvent: ({ onEvent, onError, options }) => graniteEvent.addEventListener("backEvent", { onEvent, onError, options }),
1920
2547
  entryMessageExited: ({ onEvent, onError }) => appsInTossEvent.addEventListener("entryMessageExited", { onEvent, onError }),
1921
2548
  updateLocationEvent: ({ onEvent, onError, options }) => appsInTossEvent.addEventListener("updateLocationEvent", { onEvent, onError, options }),
1922
2549
  /** @internal */
@@ -1928,7 +2555,7 @@ function WebView({ type, local, onMessage, ...props }) {
1928
2555
  showAdMobRewardedAd: GoogleAdMob.showAdMobRewardedAd
1929
2556
  },
1930
2557
  constantHandlerMap: {
1931
- ...bedrockConstantBridges,
2558
+ ...graniteConstantBridges,
1932
2559
  ...constant_bridges_exports,
1933
2560
  getSafeAreaTop: () => top,
1934
2561
  getSafeAreaBottom: () => bottom,
@@ -1942,8 +2569,12 @@ function WebView({ type, local, onMessage, ...props }) {
1942
2569
  getDeploymentId: env.getDeploymentId
1943
2570
  },
1944
2571
  asyncHandlerMap: {
1945
- ...bedrockAsyncBridges,
2572
+ ...graniteAsyncBridges,
1946
2573
  ...async_bridges_exports,
2574
+ setIosSwipeGestureEnabled: (options) => {
2575
+ setAllowsBackForwardNavigationGestures(options.isEnabled);
2576
+ return setIosSwipeGestureEnabled2(options);
2577
+ },
1947
2578
  addAccessoryButton: async (params) => partner.addAccessoryButton(params),
1948
2579
  removeAccessoryButton: async () => partner.removeAccessoryButton(),
1949
2580
  /** internal */
@@ -1958,7 +2589,7 @@ function WebView({ type, local, onMessage, ...props }) {
1958
2589
  iapGetProductItemList: IAP.getProductItemList
1959
2590
  }
1960
2591
  });
1961
- const baseProps = (0, import_react10.useMemo)(() => {
2592
+ const baseProps = (0, import_react11.useMemo)(() => {
1962
2593
  switch (type) {
1963
2594
  case "partner": {
1964
2595
  const headerOnlyProp = {
@@ -1987,8 +2618,8 @@ function WebView({ type, local, onMessage, ...props }) {
1987
2618
  }, [type, props]);
1988
2619
  const BaseWebView = WEBVIEW_TYPES[type];
1989
2620
  const webViewDebuggingEnabled = operationalEnvironment === "sandbox";
1990
- const [canHistoryGoBack, setCanHistoryGoBack] = (0, import_react10.useState)(false);
1991
- const handleNavigationStateChange = (0, import_react10.useCallback)(
2621
+ const [canHistoryGoBack, setCanHistoryGoBack] = (0, import_react11.useState)(false);
2622
+ const handleNavigationStateChange = (0, import_react11.useCallback)(
1992
2623
  (event) => {
1993
2624
  if (event.url) {
1994
2625
  trackScreen(event.url);
@@ -2000,7 +2631,7 @@ function WebView({ type, local, onMessage, ...props }) {
2000
2631
  const userAgent = useCreateUserAgent({
2001
2632
  colorPreference: "light"
2002
2633
  });
2003
- const handleBackEvent = (0, import_react10.useCallback)(() => {
2634
+ const handleBackEvent = (0, import_react11.useCallback)(() => {
2004
2635
  if (canHistoryGoBack) {
2005
2636
  handler.ref.current?.goBack();
2006
2637
  return true;
@@ -2008,11 +2639,11 @@ function WebView({ type, local, onMessage, ...props }) {
2008
2639
  return false;
2009
2640
  }
2010
2641
  }, [canHistoryGoBack, handler]);
2011
- (0, import_react10.useEffect)(() => {
2012
- import_react_native21.BackHandler.addEventListener("hardwareBackPress", handleBackEvent);
2013
- return () => import_react_native21.BackHandler.removeEventListener("hardwareBackPress", handleBackEvent);
2642
+ (0, import_react11.useEffect)(() => {
2643
+ import_react_native57.BackHandler.addEventListener("hardwareBackPress", handleBackEvent);
2644
+ return () => import_react_native57.BackHandler.removeEventListener("hardwareBackPress", handleBackEvent);
2014
2645
  }, [handleBackEvent]);
2015
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
2646
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2016
2647
  BaseWebView,
2017
2648
  {
2018
2649
  ref: handler.ref,
@@ -2025,7 +2656,7 @@ function WebView({ type, local, onMessage, ...props }) {
2025
2656
  "User-Agent": userAgent
2026
2657
  }
2027
2658
  },
2028
- userAgent: import_react_native21.Platform.OS === "ios" ? userAgent : void 0,
2659
+ userAgent: import_react_native57.Platform.OS === "ios" ? userAgent : void 0,
2029
2660
  sharedCookiesEnabled: true,
2030
2661
  webviewDebuggingEnabled: webViewDebuggingEnabled,
2031
2662
  thirdPartyCookiesEnabled: true,
@@ -2033,7 +2664,8 @@ function WebView({ type, local, onMessage, ...props }) {
2033
2664
  onNavigationStateChange: handleNavigationStateChange,
2034
2665
  injectedJavaScript: handler.injectedJavaScript,
2035
2666
  injectedJavaScriptBeforeContentLoaded: handler.injectedJavaScript,
2036
- decelerationRate: import_react_native21.Platform.OS === "ios" ? 1 : void 0
2667
+ decelerationRate: import_react_native57.Platform.OS === "ios" ? 1 : void 0,
2668
+ allowsBackForwardNavigationGestures
2037
2669
  }
2038
2670
  );
2039
2671
  }
@@ -2044,17 +2676,6 @@ function ensureValue(value, name) {
2044
2676
  return value;
2045
2677
  }
2046
2678
 
2047
- // src/types.ts
2048
- var Accuracy2 = /* @__PURE__ */ ((Accuracy3) => {
2049
- Accuracy3[Accuracy3["Lowest"] = 1] = "Lowest";
2050
- Accuracy3[Accuracy3["Low"] = 2] = "Low";
2051
- Accuracy3[Accuracy3["Balanced"] = 3] = "Balanced";
2052
- Accuracy3[Accuracy3["High"] = 4] = "High";
2053
- Accuracy3[Accuracy3["Highest"] = 5] = "Highest";
2054
- Accuracy3[Accuracy3["BestForNavigation"] = 6] = "BestForNavigation";
2055
- return Accuracy3;
2056
- })(Accuracy2 || {});
2057
-
2058
2679
  // src/index.ts
2059
2680
  __reExport(src_exports, require("@apps-in-toss/analytics"), module.exports);
2060
2681
  var Analytics2 = {
@@ -2068,32 +2689,49 @@ var Analytics2 = {
2068
2689
  Accuracy,
2069
2690
  Analytics,
2070
2691
  AppsInToss,
2692
+ AppsInTossModule,
2693
+ BedrockCoreModule,
2694
+ BedrockModule,
2071
2695
  GoogleAdMob,
2072
2696
  IAP,
2697
+ INTERNAL__AppsInTossModule,
2698
+ INTERNAL__module,
2073
2699
  INTERNAL__onVisibilityChangedByTransparentServiceWeb,
2074
2700
  Storage,
2075
2701
  TossPay,
2076
2702
  WebView,
2077
2703
  appLogin,
2078
2704
  appsInTossEvent,
2705
+ closeView,
2079
2706
  contactsViral,
2080
2707
  env,
2081
2708
  eventLog,
2082
2709
  fetchAlbumPhotos,
2083
2710
  fetchContacts,
2711
+ generateHapticFeedback,
2084
2712
  getClipboardText,
2085
2713
  getCurrentLocation,
2086
2714
  getDeviceId,
2087
2715
  getGameCenterGameProfile,
2716
+ getLocale,
2717
+ getNetworkStatus,
2088
2718
  getOperationalEnvironment,
2719
+ getPlatformOS,
2720
+ getSchemeUri,
2089
2721
  getTossAppVersion,
2090
2722
  getTossShareLink,
2091
2723
  isMinVersionSupported,
2724
+ onVisibilityChangedByTransparentServiceWeb,
2092
2725
  openCamera,
2093
2726
  openGameCenterLeaderboard,
2727
+ openURL,
2094
2728
  saveBase64Data,
2095
2729
  setClipboardText,
2096
2730
  setDeviceOrientation,
2731
+ setIosSwipeGestureEnabled,
2732
+ setScreenAwakeMode,
2733
+ setSecureScreen,
2734
+ share,
2097
2735
  startUpdateLocation,
2098
2736
  submitGameCenterLeaderBoardScore,
2099
2737
  useCreateUserAgent,