@apps-in-toss/native-modules 0.0.0-dev.1752049503789

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.js ADDED
@@ -0,0 +1,712 @@
1
+ // src/AppsInTossModule/native-event-emitter/appsInTossEvent.ts
2
+ import { GraniteEvent } from "@granite-js/react-native";
3
+
4
+ // src/AppsInTossModule/native-event-emitter/event-plugins/EntryMessageExitedEvent.ts
5
+ import { GraniteEventDefinition } from "@granite-js/react-native";
6
+ var EntryMessageExitedEvent = class extends GraniteEventDefinition {
7
+ name = "entryMessageExited";
8
+ remove() {
9
+ }
10
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
11
+ listener(_) {
12
+ }
13
+ };
14
+
15
+ // src/AppsInTossModule/native-event-emitter/event-plugins/UpdateLocationEvent.ts
16
+ import { GraniteEventDefinition as GraniteEventDefinition2 } from "@granite-js/react-native";
17
+
18
+ // src/AppsInTossModule/native-modules/AppsInTossModule.ts
19
+ import { TurboModuleRegistry } from "react-native";
20
+ var Module = TurboModuleRegistry.getEnforcing("AppsInTossModule");
21
+ var AppsInTossModuleInstance = Module;
22
+ var AppsInTossModule = Module;
23
+
24
+ // src/AppsInTossModule/native-modules/getPermission.ts
25
+ function getPermission(permission) {
26
+ return AppsInTossModule.getPermission(permission);
27
+ }
28
+
29
+ // src/AppsInTossModule/native-modules/openPermissionDialog.ts
30
+ function openPermissionDialog(permission) {
31
+ return AppsInTossModule.openPermissionDialog(permission);
32
+ }
33
+
34
+ // src/AppsInTossModule/native-modules/requestPermission.ts
35
+ async function requestPermission(permission) {
36
+ const permissionStatus = await getPermission(permission);
37
+ switch (permissionStatus) {
38
+ case "allowed":
39
+ case "denied":
40
+ return permissionStatus;
41
+ default:
42
+ return openPermissionDialog(permission);
43
+ }
44
+ }
45
+
46
+ // src/AppsInTossModule/native-event-emitter/nativeEventEmitter.ts
47
+ import { NativeEventEmitter } from "react-native";
48
+ var nativeEventEmitter = new NativeEventEmitter(AppsInTossModuleInstance);
49
+
50
+ // src/AppsInTossModule/native-event-emitter/event-plugins/UpdateLocationEvent.ts
51
+ var UpdateLocationEvent = class extends GraniteEventDefinition2 {
52
+ name = "updateLocationEvent";
53
+ subscriptionCount = 0;
54
+ ref = {
55
+ remove: () => {
56
+ }
57
+ };
58
+ remove() {
59
+ if (--this.subscriptionCount === 0) {
60
+ AppsInTossModuleInstance.stopUpdateLocation({});
61
+ }
62
+ this.ref.remove();
63
+ }
64
+ listener(options, onEvent, onError) {
65
+ requestPermission({ name: "geolocation", access: "access" }).then((permissionStatus) => {
66
+ if (permissionStatus === "denied") {
67
+ onError(new Error("\uC704\uCE58 \uAD8C\uD55C\uC774 \uAC70\uBD80\uB418\uC5C8\uC5B4\uC694."));
68
+ return;
69
+ }
70
+ void AppsInTossModuleInstance.startUpdateLocation(options).catch(onError);
71
+ const subscription = nativeEventEmitter.addListener("updateLocation", onEvent);
72
+ this.ref = {
73
+ remove: () => subscription?.remove()
74
+ };
75
+ this.subscriptionCount++;
76
+ }).catch(onError);
77
+ }
78
+ };
79
+
80
+ // src/AppsInTossModule/native-event-emitter/internal/AppBridgeCallbackEvent.ts
81
+ import { GraniteEventDefinition as GraniteEventDefinition3 } from "@granite-js/react-native";
82
+
83
+ // src/utils/generateUUID.ts
84
+ function generateUUID(placeholder) {
85
+ return placeholder ? (placeholder ^ Math.random() * 16 >> placeholder / 4).toString(16) : (String(1e7) + 1e3 + 4e3 + 8e3 + 1e11).replace(/[018]/g, generateUUID);
86
+ }
87
+
88
+ // src/AppsInTossModule/native-event-emitter/internal/appBridge.ts
89
+ var INTERNAL__callbacks = /* @__PURE__ */ new Map();
90
+ function invokeAppBridgeCallback(id, ...args) {
91
+ const callback = INTERNAL__callbacks.get(id);
92
+ callback?.call(null, ...args);
93
+ return Boolean(callback);
94
+ }
95
+ function invokeAppBridgeMethod(methodName, params, callbacks) {
96
+ const { onSuccess, onError, ...appBridgeCallbacks } = callbacks;
97
+ const { callbackMap, unregisterAll } = registerCallbacks(appBridgeCallbacks);
98
+ const promise = AppsInTossModuleInstance[methodName]({
99
+ params,
100
+ callbacks: callbackMap
101
+ });
102
+ void promise.then(onSuccess).catch(onError);
103
+ return unregisterAll;
104
+ }
105
+ function registerCallbacks(callbacks) {
106
+ const callbackMap = {};
107
+ for (const [callbackName, callback] of Object.entries(callbacks)) {
108
+ const id = registerCallback(callback, callbackName);
109
+ callbackMap[callbackName] = id;
110
+ }
111
+ const unregisterAll = () => {
112
+ Object.values(callbackMap).forEach(unregisterCallback);
113
+ };
114
+ return { callbackMap, unregisterAll };
115
+ }
116
+ function registerCallback(callback, name = "unnamed") {
117
+ const uniqueId = generateUUID();
118
+ const callbackId = `${uniqueId}__${name}`;
119
+ INTERNAL__callbacks.set(callbackId, callback);
120
+ return callbackId;
121
+ }
122
+ function unregisterCallback(id) {
123
+ INTERNAL__callbacks.delete(id);
124
+ }
125
+ function getCallbackIds() {
126
+ return Array.from(INTERNAL__callbacks.keys());
127
+ }
128
+ var INTERNAL__appBridgeHandler = {
129
+ invokeAppBridgeCallback,
130
+ invokeAppBridgeMethod,
131
+ registerCallback,
132
+ unregisterCallback,
133
+ getCallbackIds
134
+ };
135
+
136
+ // src/AppsInTossModule/native-event-emitter/internal/AppBridgeCallbackEvent.ts
137
+ var UNSAFE__nativeEventEmitter = nativeEventEmitter;
138
+ var AppBridgeCallbackEvent = class _AppBridgeCallbackEvent extends GraniteEventDefinition3 {
139
+ static INTERNAL__appBridgeSubscription;
140
+ name = "appBridgeCallbackEvent";
141
+ constructor() {
142
+ super();
143
+ this.registerAppBridgeCallbackEventListener();
144
+ }
145
+ remove() {
146
+ }
147
+ listener() {
148
+ }
149
+ registerAppBridgeCallbackEventListener() {
150
+ if (_AppBridgeCallbackEvent.INTERNAL__appBridgeSubscription != null) {
151
+ return;
152
+ }
153
+ _AppBridgeCallbackEvent.INTERNAL__appBridgeSubscription = UNSAFE__nativeEventEmitter.addListener(
154
+ "appBridgeCallback",
155
+ this.ensureInvokeAppBridgeCallback
156
+ );
157
+ }
158
+ ensureInvokeAppBridgeCallback(result) {
159
+ if (typeof result === "object" && typeof result.name === "string") {
160
+ INTERNAL__appBridgeHandler.invokeAppBridgeCallback(result.name, result.params);
161
+ } else {
162
+ console.warn("Invalid app bridge callback result:", result);
163
+ }
164
+ }
165
+ };
166
+
167
+ // src/AppsInTossModule/native-event-emitter/appsInTossEvent.ts
168
+ var appsInTossEvent = new GraniteEvent([
169
+ new AppBridgeCallbackEvent(),
170
+ new UpdateLocationEvent(),
171
+ new EntryMessageExitedEvent()
172
+ ]);
173
+
174
+ // src/AppsInTossModule/native-event-emitter/startUpdateLocation.ts
175
+ function startUpdateLocation(eventParams) {
176
+ return appsInTossEvent.addEventListener("updateLocationEvent", eventParams);
177
+ }
178
+
179
+ // src/AppsInTossModule/native-modules/ads/googleAdMob.ts
180
+ import { noop } from "es-toolkit";
181
+
182
+ // src/AppsInTossModule/native-modules/getOperationalEnvironment.ts
183
+ function getOperationalEnvironment() {
184
+ return AppsInTossModule.operationalEnvironment;
185
+ }
186
+
187
+ // src/AppsInTossModule/native-modules/isMinVersionSupported.ts
188
+ import { Platform } from "react-native";
189
+
190
+ // src/utils/compareVersion.ts
191
+ var SEMVER_REGEX = /^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\\-]+(?:\.[\da-z\\-]+)*))?(?:\+[\da-z\\-]+(?:\.[\da-z\\-]+)*)?)?)?$/i;
192
+ var isWildcard = (val) => ["*", "x", "X"].includes(val);
193
+ var tryParse = (val) => {
194
+ const num = parseInt(val, 10);
195
+ return isNaN(num) ? val : num;
196
+ };
197
+ var coerceTypes = (a, b) => {
198
+ return typeof a === typeof b ? [a, b] : [String(a), String(b)];
199
+ };
200
+ var compareValues = (a, b) => {
201
+ if (isWildcard(a) || isWildcard(b)) {
202
+ return 0;
203
+ }
204
+ const [aVal, bVal] = coerceTypes(tryParse(a), tryParse(b));
205
+ if (aVal > bVal) {
206
+ return 1;
207
+ }
208
+ if (aVal < bVal) {
209
+ return -1;
210
+ }
211
+ return 0;
212
+ };
213
+ var parseVersion = (version) => {
214
+ if (typeof version !== "string") {
215
+ throw new TypeError("Invalid argument: expected a string");
216
+ }
217
+ const match = version.match(SEMVER_REGEX);
218
+ if (!match) {
219
+ throw new Error(`Invalid semver: '${version}'`);
220
+ }
221
+ const [, major, minor, patch, build, preRelease] = match;
222
+ return [major, minor, patch, build, preRelease];
223
+ };
224
+ var compareSegments = (a, b) => {
225
+ const maxLength = Math.max(a.length, b.length);
226
+ for (let i = 0; i < maxLength; i++) {
227
+ const segA = a[i] ?? "0";
228
+ const segB = b[i] ?? "0";
229
+ const result = compareValues(segA, segB);
230
+ if (result !== 0) {
231
+ return result;
232
+ }
233
+ }
234
+ return 0;
235
+ };
236
+ var compareVersions = (v1, v2) => {
237
+ const seg1 = parseVersion(v1);
238
+ const seg2 = parseVersion(v2);
239
+ const preRelease1 = seg1.pop();
240
+ const preRelease2 = seg2.pop();
241
+ const mainCompare = compareSegments(seg1, seg2);
242
+ if (mainCompare !== 0) {
243
+ return mainCompare;
244
+ }
245
+ if (preRelease1 && preRelease2) {
246
+ return compareSegments(preRelease1.split("."), preRelease2.split("."));
247
+ }
248
+ if (preRelease1) {
249
+ return -1;
250
+ }
251
+ if (preRelease2) {
252
+ return 1;
253
+ }
254
+ return 0;
255
+ };
256
+
257
+ // src/AppsInTossModule/native-modules/isMinVersionSupported.ts
258
+ function isMinVersionSupported(minVersions) {
259
+ const operationalEnvironment = AppsInTossModule.operationalEnvironment;
260
+ if (operationalEnvironment === "sandbox") {
261
+ return true;
262
+ }
263
+ const currentVersion = AppsInTossModule.tossAppVersion;
264
+ const isIOS = Platform.OS === "ios";
265
+ const minVersion = isIOS ? minVersions.ios : minVersions.android;
266
+ if (minVersion === void 0) {
267
+ return false;
268
+ }
269
+ if (minVersion === "always") {
270
+ return true;
271
+ }
272
+ if (minVersion === "never") {
273
+ return false;
274
+ }
275
+ return compareVersions(currentVersion, minVersion) >= 0;
276
+ }
277
+
278
+ // src/AppsInTossModule/native-modules/ads/googleAdMob.ts
279
+ function loadAdMobInterstitialAd(params) {
280
+ if (!loadAdMobInterstitialAd.isSupported()) {
281
+ params.onError(new Error(UNSUPPORTED_ERROR_MESSAGE));
282
+ return noop;
283
+ }
284
+ const { onEvent, onError, options } = params;
285
+ const unregisterCallbacks = INTERNAL__appBridgeHandler.invokeAppBridgeMethod("loadAdMobInterstitialAd", options, {
286
+ onAdClicked: () => {
287
+ onEvent({ type: "clicked" });
288
+ },
289
+ onAdDismissed: () => {
290
+ onEvent({ type: "dismissed" });
291
+ },
292
+ onAdFailedToShow: () => {
293
+ onEvent({ type: "failedToShow" });
294
+ },
295
+ onAdImpression: () => {
296
+ onEvent({ type: "impression" });
297
+ },
298
+ onAdShow: () => {
299
+ onEvent({ type: "show" });
300
+ },
301
+ onSuccess: (result) => onEvent({ type: "loaded", data: result }),
302
+ onError
303
+ });
304
+ return unregisterCallbacks;
305
+ }
306
+ function showAdMobInterstitialAd(params) {
307
+ if (!showAdMobInterstitialAd.isSupported()) {
308
+ params.onError(new Error(UNSUPPORTED_ERROR_MESSAGE));
309
+ return noop;
310
+ }
311
+ const { onEvent, onError, options } = params;
312
+ const unregisterCallbacks = INTERNAL__appBridgeHandler.invokeAppBridgeMethod("showAdMobInterstitialAd", options, {
313
+ onSuccess: () => onEvent({ type: "requested" }),
314
+ onError
315
+ });
316
+ return unregisterCallbacks;
317
+ }
318
+ function loadAdMobRewardedAd(params) {
319
+ if (!loadAdMobRewardedAd.isSupported()) {
320
+ params.onError(new Error(UNSUPPORTED_ERROR_MESSAGE));
321
+ return noop;
322
+ }
323
+ const { onEvent, onError, options } = params;
324
+ const unregisterCallbacks = INTERNAL__appBridgeHandler.invokeAppBridgeMethod("loadAdMobRewardedAd", options, {
325
+ onAdClicked: () => {
326
+ onEvent({ type: "clicked" });
327
+ },
328
+ onAdDismissed: () => {
329
+ onEvent({ type: "dismissed" });
330
+ },
331
+ onAdFailedToShow: () => {
332
+ onEvent({ type: "failedToShow" });
333
+ },
334
+ onAdImpression: () => {
335
+ onEvent({ type: "impression" });
336
+ },
337
+ onAdShow: () => {
338
+ onEvent({ type: "show" });
339
+ },
340
+ onUserEarnedReward: () => {
341
+ onEvent({ type: "userEarnedReward" });
342
+ },
343
+ onSuccess: (result) => onEvent({ type: "loaded", data: result }),
344
+ onError
345
+ });
346
+ return unregisterCallbacks;
347
+ }
348
+ function showAdMobRewardedAd(params) {
349
+ if (!showAdMobRewardedAd.isSupported()) {
350
+ params.onError(new Error(UNSUPPORTED_ERROR_MESSAGE));
351
+ return noop;
352
+ }
353
+ const { onEvent, onError, options } = params;
354
+ const unregisterCallbacks = INTERNAL__appBridgeHandler.invokeAppBridgeMethod("showAdMobRewardedAd", options, {
355
+ onSuccess: () => onEvent({ type: "requested" }),
356
+ onError
357
+ });
358
+ return unregisterCallbacks;
359
+ }
360
+ var ANDROID_GOOGLE_AD_MOB_SUPPORTED_VERSION = "5.209.0";
361
+ var IOS_GOOGLE_AD_MOB_SUPPORTED_VERSION = "5.209.0";
362
+ var UNSUPPORTED_ERROR_MESSAGE = "This feature is not supported in the current environment";
363
+ var ENVIRONMENT = getOperationalEnvironment();
364
+ function createIsSupported() {
365
+ return () => {
366
+ if (ENVIRONMENT !== "toss") {
367
+ return false;
368
+ }
369
+ return isMinVersionSupported({
370
+ android: ANDROID_GOOGLE_AD_MOB_SUPPORTED_VERSION,
371
+ ios: IOS_GOOGLE_AD_MOB_SUPPORTED_VERSION
372
+ });
373
+ };
374
+ }
375
+ loadAdMobInterstitialAd.isSupported = createIsSupported();
376
+ loadAdMobRewardedAd.isSupported = createIsSupported();
377
+ showAdMobInterstitialAd.isSupported = createIsSupported();
378
+ showAdMobRewardedAd.isSupported = createIsSupported();
379
+
380
+ // src/AppsInTossModule/native-modules/checkoutPayment.ts
381
+ async function checkoutPayment(options) {
382
+ return AppsInTossModule.checkoutPayment({ params: options });
383
+ }
384
+
385
+ // src/AppsInTossModule/native-modules/setClipboardText.ts
386
+ async function setClipboardText(text) {
387
+ const permissionStatus = await requestPermission({ name: "clipboard", access: "write" });
388
+ if (permissionStatus === "denied") {
389
+ throw new Error("\uD074\uB9BD\uBCF4\uB4DC \uC4F0\uAE30 \uAD8C\uD55C\uC774 \uAC70\uBD80\uB418\uC5C8\uC5B4\uC694.");
390
+ }
391
+ return AppsInTossModule.setClipboardText({ text });
392
+ }
393
+
394
+ // src/AppsInTossModule/native-modules/getClipboardText.ts
395
+ async function getClipboardText() {
396
+ const permissionStatus = await requestPermission({ name: "clipboard", access: "read" });
397
+ if (permissionStatus === "denied") {
398
+ throw new Error("\uD074\uB9BD\uBCF4\uB4DC \uC77D\uAE30 \uAD8C\uD55C\uC774 \uAC70\uBD80\uB418\uC5C8\uC5B4\uC694.");
399
+ }
400
+ return AppsInTossModule.getClipboardText({});
401
+ }
402
+
403
+ // src/AppsInTossModule/native-modules/fetchContacts.ts
404
+ async function fetchContacts(options) {
405
+ const permissionStatus = await requestPermission({ name: "contacts", access: "read" });
406
+ if (permissionStatus === "denied") {
407
+ throw new Error("\uC5F0\uB77D\uCC98 \uAD8C\uD55C\uC774 \uAC70\uBD80\uB418\uC5C8\uC5B4\uC694.");
408
+ }
409
+ const contacts = await AppsInTossModule.fetchContacts(options);
410
+ return {
411
+ result: contacts.result,
412
+ nextOffset: contacts.nextOffset ?? null,
413
+ done: contacts.done
414
+ };
415
+ }
416
+
417
+ // src/AppsInTossModule/native-modules/fetchAlbumPhotos.ts
418
+ var DEFAULT_MAX_COUNT = 10;
419
+ var DEFAULT_MAX_WIDTH = 1024;
420
+ async function fetchAlbumPhotos(options) {
421
+ const permissionStatus = await requestPermission({ name: "photos", access: "read" });
422
+ if (permissionStatus === "denied") {
423
+ throw new Error("\uC0AC\uC9C4\uCCA9 \uAD8C\uD55C\uC774 \uAC70\uBD80\uB418\uC5C8\uC5B4\uC694.");
424
+ }
425
+ const albumPhotos = await AppsInTossModule.fetchAlbumPhotos({
426
+ ...options,
427
+ maxCount: options.maxCount ?? DEFAULT_MAX_COUNT,
428
+ maxWidth: options.maxWidth ?? DEFAULT_MAX_WIDTH
429
+ });
430
+ return albumPhotos;
431
+ }
432
+
433
+ // src/AppsInTossModule/native-modules/getCurrentLocation.ts
434
+ async function getCurrentLocation(options) {
435
+ const permissionStatus = await requestPermission({ name: "geolocation", access: "access" });
436
+ if (permissionStatus === "denied") {
437
+ throw new Error("\uC704\uCE58 \uAD8C\uD55C\uC774 \uAC70\uBD80\uB418\uC5C8\uC5B4\uC694.");
438
+ }
439
+ const position = await AppsInTossModule.getCurrentLocation(options);
440
+ return position;
441
+ }
442
+
443
+ // src/AppsInTossModule/native-modules/openCamera.ts
444
+ async function openCamera(options) {
445
+ const permissionStatus = await requestPermission({ name: "camera", access: "access" });
446
+ if (permissionStatus === "denied") {
447
+ throw new Error("\uCE74\uBA54\uB77C \uAD8C\uD55C\uC774 \uAC70\uBD80\uB418\uC5C8\uC5B4\uC694.");
448
+ }
449
+ const photo = await AppsInTossModule.openCamera({ base64: false, maxWidth: 1024, ...options });
450
+ return photo;
451
+ }
452
+
453
+ // src/AppsInTossModule/native-modules/appLogin.ts
454
+ async function appLogin() {
455
+ return AppsInTossModule.appLogin({});
456
+ }
457
+
458
+ // src/AppsInTossModule/native-modules/getTossAppVersion.ts
459
+ function getTossAppVersion() {
460
+ return AppsInTossModule.tossAppVersion;
461
+ }
462
+
463
+ // src/AppsInTossModule/native-modules/getDeviceId.ts
464
+ function getDeviceId() {
465
+ return AppsInTossModule.deviceId;
466
+ }
467
+
468
+ // src/AppsInTossModule/native-modules/storage.ts
469
+ function getItem(key) {
470
+ return AppsInTossModule.getStorageItem({ key });
471
+ }
472
+ function setItem(key, value) {
473
+ return AppsInTossModule.setStorageItem({
474
+ key,
475
+ value
476
+ });
477
+ }
478
+ function removeItem(key) {
479
+ return AppsInTossModule.removeStorageItem({ key });
480
+ }
481
+ function clearItems() {
482
+ return AppsInTossModule.clearStorage({});
483
+ }
484
+ var Storage = {
485
+ getItem,
486
+ setItem,
487
+ removeItem,
488
+ clearItems
489
+ };
490
+
491
+ // src/AppsInTossModule/native-modules/eventLog.ts
492
+ function normalizeParams(params) {
493
+ return Object.fromEntries(
494
+ Object.entries(params).filter(([, value]) => value !== void 0).map(([key, value]) => [key, String(value)])
495
+ );
496
+ }
497
+ async function eventLog(params) {
498
+ if (AppsInTossModule.operationalEnvironment === "sandbox") {
499
+ console.log("[eventLogDebug]", {
500
+ log_name: params.log_name,
501
+ log_type: params.log_type,
502
+ params: normalizeParams(params.params)
503
+ });
504
+ return;
505
+ }
506
+ const isSupported = isMinVersionSupported({
507
+ android: "5.208.0",
508
+ ios: "5.208.0"
509
+ });
510
+ if (!isSupported) {
511
+ return;
512
+ }
513
+ return AppsInTossModule.eventLog({
514
+ log_name: params.log_name,
515
+ log_type: params.log_type,
516
+ params: normalizeParams(params.params)
517
+ });
518
+ }
519
+
520
+ // src/AppsInTossModule/native-modules/getTossShareLink.ts
521
+ async function getTossShareLink(path) {
522
+ const { shareLink } = await AppsInTossModule.getTossShareLink({});
523
+ const shareUrl = new URL(shareLink);
524
+ shareUrl.searchParams.set("deep_link_value", path);
525
+ shareUrl.searchParams.set("af_dp", path);
526
+ return shareUrl.toString();
527
+ }
528
+
529
+ // src/AppsInTossModule/native-modules/setDeviceOrientation.ts
530
+ async function setDeviceOrientation(options) {
531
+ const isSupported = isMinVersionSupported({
532
+ android: "5.215.0",
533
+ ios: "5.215.0"
534
+ });
535
+ if (!isSupported) {
536
+ return;
537
+ }
538
+ return AppsInTossModule.setDeviceOrientation(options);
539
+ }
540
+
541
+ // src/AppsInTossModule/native-modules/saveBase64Data.ts
542
+ async function saveBase64Data(params) {
543
+ const isSupported = isMinVersionSupported({
544
+ android: "5.218.0",
545
+ ios: "5.216.0"
546
+ });
547
+ if (!isSupported) {
548
+ console.warn("saveBase64Data is not supported in this app version");
549
+ return;
550
+ }
551
+ await AppsInTossModule.saveBase64Data(params);
552
+ }
553
+
554
+ // src/AppsInTossModule/native-modules/index.ts
555
+ var TossPay = {
556
+ checkoutPayment
557
+ };
558
+ var GoogleAdMob = {
559
+ loadAdMobInterstitialAd,
560
+ showAdMobInterstitialAd,
561
+ loadAdMobRewardedAd,
562
+ showAdMobRewardedAd
563
+ };
564
+
565
+ // src/BedrockModule/native-modules/natives/BedrockModule.ts
566
+ import { NativeModules } from "react-native";
567
+ var BedrockModule = NativeModules.BedrockModule;
568
+
569
+ // src/BedrockModule/native-modules/natives/closeView.ts
570
+ async function closeView() {
571
+ return BedrockModule.closeView();
572
+ }
573
+
574
+ // src/BedrockModule/native-modules/natives/getLocale.ts
575
+ import { Platform as Platform2 } from "react-native";
576
+ function getLocale() {
577
+ const locale = BedrockModule?.DeviceInfo?.locale ?? "ko-KR";
578
+ if (Platform2.OS === "android") {
579
+ return replaceUnderbarToHypen(locale);
580
+ }
581
+ return locale;
582
+ }
583
+ function replaceUnderbarToHypen(locale) {
584
+ return locale.replace(/_/g, "-");
585
+ }
586
+
587
+ // src/BedrockModule/native-modules/natives/getSchemeUri.ts
588
+ function getSchemeUri() {
589
+ return BedrockModule.schemeUri;
590
+ }
591
+
592
+ // src/BedrockModule/native-modules/natives/generateHapticFeedback/index.ts
593
+ function generateHapticFeedback(options) {
594
+ return BedrockModule.generateHapticFeedback(options);
595
+ }
596
+
597
+ // src/BedrockModule/native-modules/natives/share.ts
598
+ async function share(message) {
599
+ BedrockModule.share(message);
600
+ }
601
+
602
+ // src/BedrockModule/native-modules/natives/setSecureScreen.ts
603
+ function setSecureScreen(options) {
604
+ return BedrockModule.setSecureScreen(options);
605
+ }
606
+
607
+ // src/BedrockModule/native-modules/natives/setScreenAwakeMode.ts
608
+ async function setScreenAwakeMode(options) {
609
+ return BedrockModule.setScreenAwakeMode(options);
610
+ }
611
+
612
+ // src/BedrockModule/native-modules/natives/getNetworkStatus/index.ts
613
+ function getNetworkStatus() {
614
+ return BedrockModule.getNetworkStatus();
615
+ }
616
+
617
+ // src/BedrockModule/native-modules/natives/setIosSwipeGestureEnabled.ts
618
+ async function setIosSwipeGestureEnabled(options) {
619
+ if (BedrockModule.setIosSwipeGestureEnabled == null) {
620
+ return;
621
+ }
622
+ return BedrockModule.setIosSwipeGestureEnabled(options);
623
+ }
624
+
625
+ // src/BedrockModule/native-modules/natives/openURL.ts
626
+ import { Linking } from "react-native";
627
+ function openURL(url) {
628
+ return Linking.openURL(url);
629
+ }
630
+
631
+ // src/BedrockModule/native-modules/natives/getPlatformOS.ts
632
+ import { Platform as Platform3 } from "react-native";
633
+ function getPlatformOS() {
634
+ return Platform3.OS;
635
+ }
636
+
637
+ // src/BedrockModule/native-modules/core/BedrockCoreModule.ts
638
+ import { NativeModules as NativeModules2 } from "react-native";
639
+ var BedrockCoreModule = NativeModules2.BedrockCoreModule;
640
+
641
+ // src/types.ts
642
+ var Accuracy2 = /* @__PURE__ */ ((Accuracy3) => {
643
+ Accuracy3[Accuracy3["Lowest"] = 1] = "Lowest";
644
+ Accuracy3[Accuracy3["Low"] = 2] = "Low";
645
+ Accuracy3[Accuracy3["Balanced"] = 3] = "Balanced";
646
+ Accuracy3[Accuracy3["High"] = 4] = "High";
647
+ Accuracy3[Accuracy3["Highest"] = 5] = "Highest";
648
+ Accuracy3[Accuracy3["BestForNavigation"] = 6] = "BestForNavigation";
649
+ return Accuracy3;
650
+ })(Accuracy2 || {});
651
+
652
+ // src/AppsInTossModule/native-modules/tossCore.ts
653
+ import { NativeModules as NativeModules3 } from "react-native";
654
+ var TossCoreModule = NativeModules3.TossCoreModule;
655
+ function tossCoreEventLog(params) {
656
+ const supported = isMinVersionSupported({ ios: "5.210.0", android: "5.210.0" });
657
+ const isSandbox = getOperationalEnvironment() === "sandbox";
658
+ if (!supported || isSandbox) {
659
+ return;
660
+ }
661
+ TossCoreModule.eventLog({
662
+ params: {
663
+ log_name: params.log_name,
664
+ log_type: params.log_type,
665
+ params: params.params
666
+ }
667
+ });
668
+ }
669
+
670
+ // src/index.ts
671
+ var INTERNAL__module = {
672
+ tossCoreEventLog
673
+ };
674
+ export {
675
+ Accuracy2 as Accuracy,
676
+ AppsInTossModule,
677
+ BedrockCoreModule,
678
+ BedrockModule,
679
+ GoogleAdMob,
680
+ AppsInTossModuleInstance as INTERNAL__AppsInTossModule,
681
+ INTERNAL__module,
682
+ Storage,
683
+ TossPay,
684
+ appLogin,
685
+ appsInTossEvent,
686
+ closeView,
687
+ eventLog,
688
+ fetchAlbumPhotos,
689
+ fetchContacts,
690
+ generateHapticFeedback,
691
+ getClipboardText,
692
+ getCurrentLocation,
693
+ getDeviceId,
694
+ getLocale,
695
+ getNetworkStatus,
696
+ getOperationalEnvironment,
697
+ getPlatformOS,
698
+ getSchemeUri,
699
+ getTossAppVersion,
700
+ getTossShareLink,
701
+ isMinVersionSupported,
702
+ openCamera,
703
+ openURL,
704
+ saveBase64Data,
705
+ setClipboardText,
706
+ setDeviceOrientation,
707
+ setIosSwipeGestureEnabled,
708
+ setScreenAwakeMode,
709
+ setSecureScreen,
710
+ share,
711
+ startUpdateLocation
712
+ };