@apps-in-toss/framework 0.0.0-dev.1757939087965 → 0.0.0-dev.1758103372343

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/index.cjs +548 -379
  2. package/dist/index.js +444 -279
  3. package/package.json +9 -9
package/dist/index.js CHANGED
@@ -149,16 +149,56 @@ function AppUpdate() {
149
149
  return /* @__PURE__ */ jsx(Fragment, {});
150
150
  }
151
151
 
152
- // src/core/components/BuiltinNavigationBar/index.tsx
152
+ // src/core/hooks/useAppsInTossBridge.ts
153
153
  import { appsInTossEvent } from "@apps-in-toss/native-modules";
154
+ import { useBridge } from "@toss-design-system/react-native";
155
+ import { useEffect as useEffect4 } from "react";
156
+
157
+ // src/core/utils/getAppsInTossGlobals.ts
158
+ function getAppsInTossGlobals() {
159
+ if (global.__appsInToss == null) {
160
+ throw new Error("invalid apps-in-toss globals");
161
+ }
162
+ return global.__appsInToss;
163
+ }
164
+
165
+ // src/core/utils/toIcon.ts
166
+ function toIcon(source) {
167
+ return source.startsWith("http") ? { source: { uri: source } } : { name: source };
168
+ }
169
+
170
+ // src/core/hooks/useAppsInTossBridge.ts
171
+ function useAppsInTossBridge() {
172
+ const controller = useBridge();
173
+ const appsInTossGlobals = getAppsInTossGlobals();
174
+ useEffect4(() => {
175
+ const commonProps = {
176
+ serviceName: appsInTossGlobals.brandDisplayName,
177
+ icon: toIcon(appsInTossGlobals.brandIcon),
178
+ color: appsInTossGlobals.brandPrimaryColor,
179
+ colorMode: appsInTossGlobals.brandBridgeColorMode
180
+ };
181
+ controller.open({
182
+ ...commonProps,
183
+ onExited: () => {
184
+ appsInTossEvent.emit("entryMessageExited", void 0);
185
+ }
186
+ });
187
+ }, []);
188
+ }
189
+
190
+ // src/components/NavigationBar/RNNavigationBar.tsx
154
191
  import { closeView, useBackEventContext, useNavigation } from "@granite-js/react-native";
155
192
  import { useDialog as useDialog2 } from "@toss-design-system/react-native";
156
193
  import { NavigationBackButton, NavigationLeft, TopNavigation } from "@toss-design-system/react-native/private";
157
194
  import { josa } from "es-hangul";
158
- import { useCallback as useCallback3, useEffect as useEffect5, useRef as useRef2 } from "react";
195
+ import { useCallback as useCallback3, useEffect as useEffect7 } from "react";
159
196
  import { BackHandler } from "react-native";
160
197
 
161
- // src/core/components/BuiltinNavigationBar/useBuiltinNavigationBarLogging.tsx
198
+ // src/components/NavigationBar/common/NavigationBarImpressionArea.tsx
199
+ import { useEffect as useEffect5, useRef as useRef2 } from "react";
200
+
201
+ // src/components/NavigationBar/common/useNavigationBarLogging.tsx
162
202
  import { INTERNAL__module as INTERNAL__module3 } from "@apps-in-toss/native-modules";
163
203
  import { Granite as Granite3 } from "@granite-js/react-native";
164
204
  var NAVI_BAR_IMPRESSION_SCHEMA_ID = 1596837;
@@ -171,7 +211,7 @@ var CLOSE_POPUP_CTA_CLICK_SCHEMA_ID = 1644492;
171
211
  var CLOSE_POPUP_CTA_CLICK_LOG_NAME = "appsintoss_app_visit__common_module::popup__close_app::click__cta";
172
212
  var HOME_BUTTON_CLICK_SCHEMA_ID = 1596839;
173
213
  var HOME_BUTTON_CLICK_LOG_NAME = "appsintoss_app_visit__common_module::click__icon_home";
174
- function useBuiltinNavigationBarLogging() {
214
+ function useNavigationBarLogging() {
175
215
  const referrer = useReferrer();
176
216
  const baseParams = {
177
217
  referrer,
@@ -242,12 +282,29 @@ function useBuiltinNavigationBarLogging() {
242
282
  };
243
283
  }
244
284
 
285
+ // src/components/NavigationBar/common/NavigationBarImpressionArea.tsx
286
+ import { Fragment as Fragment2, jsx as jsx2 } from "react/jsx-runtime";
287
+ function NavigationBarImpressionArea({
288
+ children,
289
+ withHomeButton
290
+ }) {
291
+ const hasLogged = useRef2(false);
292
+ const logging = useNavigationBarLogging();
293
+ useEffect5(() => {
294
+ if (hasLogged.current === false) {
295
+ logging.navBarImpression({ home_icon_yn: withHomeButton ? "Y" : "N" });
296
+ hasLogged.current = true;
297
+ }
298
+ }, []);
299
+ return /* @__PURE__ */ jsx2(Fragment2, { children });
300
+ }
301
+
245
302
  // src/core/hooks/useMoreButtonBottomSheet/index.tsx
246
303
  import { INTERNAL__appBridgeHandler, isMinVersionSupported } from "@apps-in-toss/native-modules";
247
304
  import { openURL as openURL3 } from "@granite-js/react-native";
248
305
  import { BottomSheet, List, ListHeader, ListRow } from "@toss-design-system/react-native";
249
306
  import { useAdaptive, useOverlay } from "@toss-design-system/react-native/private";
250
- import { useEffect as useEffect4, useState } from "react";
307
+ import { useEffect as useEffect6, useState } from "react";
251
308
 
252
309
  // src/core/hooks/useMoreButtonBottomSheet/useMoreButtonBottomSheetLogging.tsx
253
310
  import { INTERNAL__module as INTERNAL__module4 } from "@apps-in-toss/native-modules";
@@ -420,16 +477,8 @@ function ensureValue(value, name) {
420
477
  return value;
421
478
  }
422
479
 
423
- // src/core/utils/getAppsInTossGlobals.ts
424
- function getAppsInTossGlobals() {
425
- if (global.__appsInToss == null) {
426
- throw new Error("invalid apps-in-toss globals");
427
- }
428
- return global.__appsInToss;
429
- }
430
-
431
480
  // src/core/hooks/useMoreButtonBottomSheet/index.tsx
432
- import { Fragment as Fragment2, jsx as jsx2 } from "react/jsx-runtime";
481
+ import { Fragment as Fragment3, jsx as jsx3 } from "react/jsx-runtime";
433
482
  var APP_BRIDGE_METHOD_NAME = "getMiniAppsSupportContact";
434
483
  function useMoreButtonBottomSheet() {
435
484
  const globals = getAppsInTossGlobals();
@@ -443,7 +492,7 @@ function useMoreButtonBottomSheet() {
443
492
  android: "5.226.0",
444
493
  ios: "5.226.0"
445
494
  });
446
- useEffect4(() => {
495
+ useEffect6(() => {
447
496
  if (!isSupported) {
448
497
  return;
449
498
  }
@@ -470,17 +519,17 @@ function useMoreButtonBottomSheet() {
470
519
  logging.close();
471
520
  close();
472
521
  };
473
- return /* @__PURE__ */ jsx2(BottomSheetImpressionArea, { children: /* @__PURE__ */ jsx2(
522
+ return /* @__PURE__ */ jsx3(BottomSheetImpressionArea, { children: /* @__PURE__ */ jsx3(
474
523
  BottomSheet.Root,
475
524
  {
476
- header: /* @__PURE__ */ jsx2(
525
+ header: /* @__PURE__ */ jsx3(
477
526
  ListHeader,
478
527
  {
479
- title: /* @__PURE__ */ jsx2(ListHeader.TitleParagraph, { color: adaptive.grey800, fontWeight: "bold", typography: "t5", children: title })
528
+ title: /* @__PURE__ */ jsx3(ListHeader.TitleParagraph, { color: adaptive.grey800, fontWeight: "bold", typography: "t5", children: title })
480
529
  }
481
530
  ),
482
531
  open: isOpen,
483
- cta: /* @__PURE__ */ jsx2(
532
+ cta: /* @__PURE__ */ jsx3(
484
533
  BottomSheet.CTA,
485
534
  {
486
535
  size: "large",
@@ -494,11 +543,11 @@ function useMoreButtonBottomSheet() {
494
543
  ),
495
544
  onClose: handleClose,
496
545
  onExited: exit,
497
- children: /* @__PURE__ */ jsx2(List, { rowSeparator: "none", children: itemList.map((item) => {
498
- return /* @__PURE__ */ jsx2(
546
+ children: /* @__PURE__ */ jsx3(List, { rowSeparator: "none", children: itemList.map((item) => {
547
+ return /* @__PURE__ */ jsx3(
499
548
  ListRow,
500
549
  {
501
- left: /* @__PURE__ */ jsx2(
550
+ left: /* @__PURE__ */ jsx3(
502
551
  ListRow.Icon,
503
552
  {
504
553
  color: globals.brandPrimaryColor,
@@ -506,7 +555,7 @@ function useMoreButtonBottomSheet() {
506
555
  type: "background"
507
556
  }
508
557
  ),
509
- contents: /* @__PURE__ */ jsx2(
558
+ contents: /* @__PURE__ */ jsx3(
510
559
  ListRow.Texts,
511
560
  {
512
561
  type: "1RowTypeA",
@@ -531,10 +580,10 @@ function useMoreButtonBottomSheet() {
531
580
  }
532
581
  function BottomSheetImpressionArea({ children }) {
533
582
  const logging = useMoreButtonBottomSheetLogging();
534
- useEffect4(() => {
583
+ useEffect6(() => {
535
584
  logging.show();
536
585
  }, [logging]);
537
- return /* @__PURE__ */ jsx2(Fragment2, { children });
586
+ return /* @__PURE__ */ jsx3(Fragment3, { children });
538
587
  }
539
588
 
540
589
  // src/core/utils/safeParseNavigationBar.ts
@@ -549,47 +598,25 @@ function safeParseNavigationBar(navigationBar) {
549
598
  }
550
599
  }
551
600
 
552
- // src/core/utils/toIcon.ts
553
- function toIcon(source) {
554
- return source.startsWith("http") ? { source: { uri: source } } : { name: source };
555
- }
556
-
557
- // src/core/components/BuiltinNavigationBar/index.tsx
558
- import { Fragment as Fragment3, jsx as jsx3 } from "react/jsx-runtime";
559
- function BuiltinNavigationBar() {
601
+ // src/components/NavigationBar/RNNavigationBar.tsx
602
+ import { jsx as jsx4 } from "react/jsx-runtime";
603
+ function RNNavigationBar() {
560
604
  const globals = getAppsInTossGlobals();
561
605
  const { captureExitLog } = useCaptureExitLog();
562
- const logging = useBuiltinNavigationBarLogging();
606
+ const logging = useNavigationBarLogging();
563
607
  const { openConfirm } = useDialog2();
564
608
  const { open: openMoreButtonBottomSheet } = useMoreButtonBottomSheet();
565
609
  const parsedNavigationBar = globals.navigationBar != null ? safeParseNavigationBar(globals.navigationBar) : null;
566
610
  const withHomeButton = parsedNavigationBar?.withHomeButton ?? false;
567
611
  const withBackButton = parsedNavigationBar?.withBackButton ?? true;
568
612
  const initialAccessoryButton = parsedNavigationBar?.initialAccessoryButton;
569
- const isExternalWebView = globals.webViewType === "external";
570
- const isGameWebView = globals.webViewType === "game";
571
613
  const backEventContext = useBackEventContext();
572
614
  const handleBackOrClose = useBackOrCloseNavigation();
573
615
  const navigation = useNavigation();
574
616
  const handlePressTitle = useCallback3(() => {
575
617
  logging.homeButtonClick();
576
- if (globals.webViewType != null) {
577
- appsInTossEvent.emit("homeIconButtonClickEvent", void 0);
578
- return;
579
- }
580
618
  navigation.navigate("/");
581
- }, [logging, globals.webViewType, navigation]);
582
- const handleBack = useCallback3(() => {
583
- if (globals.webViewType != null) {
584
- appsInTossEvent.emit("backButtonClickEvent", void 0);
585
- return;
586
- }
587
- if (backEventContext.hasBackEvent) {
588
- backEventContext.onBack();
589
- return;
590
- }
591
- handleBackOrClose();
592
- }, [globals.webViewType, backEventContext, handleBackOrClose]);
619
+ }, [logging, navigation]);
593
620
  const handleClose = useCallback3(async () => {
594
621
  logging.closeButtonClick();
595
622
  const isConfirmed = await openConfirm({
@@ -605,26 +632,30 @@ function BuiltinNavigationBar() {
605
632
  closeView();
606
633
  }
607
634
  }, [captureExitLog, globals.brandDisplayName, logging, openConfirm]);
608
- const handleBackEvent = useCallback3(() => {
635
+ const handleBack = useCallback3(() => {
636
+ if (backEventContext.hasBackEvent) {
637
+ backEventContext.onBack();
638
+ return;
639
+ }
640
+ handleBackOrClose();
641
+ }, [backEventContext, handleBackOrClose]);
642
+ const handleAndroidBackEvent = useCallback3(() => {
609
643
  handleBack();
610
644
  return true;
611
645
  }, [handleBack]);
612
- useEffect5(() => {
613
- BackHandler.addEventListener("hardwareBackPress", handleBackEvent);
646
+ useEffect7(() => {
647
+ BackHandler.addEventListener("hardwareBackPress", handleAndroidBackEvent);
614
648
  return () => {
615
- BackHandler.removeEventListener("hardwareBackPress", handleBackEvent);
649
+ BackHandler.removeEventListener("hardwareBackPress", handleAndroidBackEvent);
616
650
  };
617
- }, [handleBackEvent]);
618
- if (isExternalWebView) {
619
- return /* @__PURE__ */ jsx3(Fragment3, {});
620
- }
621
- return /* @__PURE__ */ jsx3(BuiltinNavigationBarImpressionArea, { withHomeButton, children: /* @__PURE__ */ jsx3(
651
+ }, [handleAndroidBackEvent]);
652
+ return /* @__PURE__ */ jsx4(NavigationBarImpressionArea, { withHomeButton, children: /* @__PURE__ */ jsx4(
622
653
  TopNavigation,
623
654
  {
624
655
  title: globals.brandDisplayName,
625
656
  icon: toIcon(globals.brandIcon),
626
657
  onPressDots: openMoreButtonBottomSheet,
627
- contentVisible: isGameWebView ? false : true,
658
+ contentVisible: true,
628
659
  onPressTitle: withHomeButton ? handlePressTitle : void 0,
629
660
  onPressClose: handleClose,
630
661
  withHome: withHomeButton,
@@ -633,7 +664,7 @@ function BuiltinNavigationBar() {
633
664
  icon: initialAccessoryButton.icon,
634
665
  id: initialAccessoryButton.id
635
666
  } : void 0,
636
- children: isGameWebView === false ? /* @__PURE__ */ jsx3(NavigationLeft, { visible: withBackButton, children: /* @__PURE__ */ jsx3(NavigationBackButton, { onPress: handleBack, canGoBack: false }) }) : null
667
+ children: /* @__PURE__ */ jsx4(NavigationLeft, { visible: withBackButton, children: /* @__PURE__ */ jsx4(NavigationBackButton, { onPress: handleBack, canGoBack: false }) })
637
668
  }
638
669
  ) });
639
670
  }
@@ -647,69 +678,32 @@ function useBackOrCloseNavigation() {
647
678
  captureExitLog(Date.now());
648
679
  closeView();
649
680
  }
650
- }, [navigation]);
651
- }
652
- function BuiltinNavigationBarImpressionArea({
653
- children,
654
- withHomeButton
655
- }) {
656
- const hasLogged = useRef2(false);
657
- const logging = useBuiltinNavigationBarLogging();
658
- useEffect5(() => {
659
- if (hasLogged.current === false) {
660
- logging.navBarImpression({ home_icon_yn: withHomeButton ? "Y" : "N" });
661
- hasLogged.current = true;
662
- }
663
- }, []);
664
- return /* @__PURE__ */ jsx3(Fragment3, { children });
665
- }
666
-
667
- // src/core/hooks/useAppsInTossBridge.ts
668
- import { appsInTossEvent as appsInTossEvent2 } from "@apps-in-toss/native-modules";
669
- import { useBridge } from "@toss-design-system/react-native";
670
- import { useEffect as useEffect6 } from "react";
671
- function useAppsInTossBridge() {
672
- const controller = useBridge();
673
- const appsInTossGlobals = getAppsInTossGlobals();
674
- useEffect6(() => {
675
- const commonProps = {
676
- serviceName: appsInTossGlobals.brandDisplayName,
677
- icon: toIcon(appsInTossGlobals.brandIcon),
678
- color: appsInTossGlobals.brandPrimaryColor,
679
- colorMode: appsInTossGlobals.brandBridgeColorMode
680
- };
681
- controller.open({
682
- ...commonProps,
683
- onExited: () => {
684
- appsInTossEvent2.emit("entryMessageExited", void 0);
685
- }
686
- });
687
- }, []);
681
+ }, [captureExitLog, navigation]);
688
682
  }
689
683
 
690
684
  // src/core/registerApp.tsx
691
- import { Fragment as Fragment4, jsx as jsx4, jsxs } from "react/jsx-runtime";
685
+ import { Fragment as Fragment4, jsx as jsx5, jsxs } from "react/jsx-runtime";
692
686
  function AppsInTossContainer(Container, { children, ...initialProps }) {
693
687
  if (!isMinVersionSupported2({
694
688
  android: "5.220.0",
695
689
  ios: "5.221.0"
696
690
  })) {
697
691
  return /* @__PURE__ */ jsxs(Fragment4, { children: [
698
- /* @__PURE__ */ jsx4(AppEvent.Entry, {}),
699
- /* @__PURE__ */ jsx4(AppEvent.System, { ...initialProps }),
700
- /* @__PURE__ */ jsx4(AppUpdate, {})
692
+ /* @__PURE__ */ jsx5(AppEvent.Entry, {}),
693
+ /* @__PURE__ */ jsx5(AppEvent.System, { ...initialProps }),
694
+ /* @__PURE__ */ jsx5(AppUpdate, {})
701
695
  ] });
702
696
  }
703
697
  return /* @__PURE__ */ jsxs(Fragment4, { children: [
704
- /* @__PURE__ */ jsx4(AppEvent.StayTime, {}),
705
- /* @__PURE__ */ jsx4(AppEvent.Entry, {}),
706
- /* @__PURE__ */ jsx4(AppEvent.System, { ...initialProps }),
707
- /* @__PURE__ */ jsx4(Container, { ...initialProps, children: /* @__PURE__ */ jsx4(TDSProvider, { colorPreference: "light", token: { color: { primary: getAppsInTossGlobals().brandPrimaryColor } }, children: /* @__PURE__ */ jsx4(TDSContainer, { ...initialProps, children }) }) })
698
+ /* @__PURE__ */ jsx5(AppEvent.StayTime, {}),
699
+ /* @__PURE__ */ jsx5(AppEvent.Entry, {}),
700
+ /* @__PURE__ */ jsx5(AppEvent.System, { ...initialProps }),
701
+ /* @__PURE__ */ jsx5(Container, { ...initialProps, children: /* @__PURE__ */ jsx5(TDSProvider, { colorPreference: "light", token: { color: { primary: getAppsInTossGlobals().brandPrimaryColor } }, children: /* @__PURE__ */ jsx5(TDSContainer, { ...initialProps, children }) }) })
708
702
  ] });
709
703
  }
710
704
  function TDSContainer({ children }) {
711
705
  useAppsInTossBridge();
712
- return /* @__PURE__ */ jsx4(Fragment4, { children });
706
+ return /* @__PURE__ */ jsx5(Fragment4, { children });
713
707
  }
714
708
  function registerApp(container, { context, analytics }) {
715
709
  const appName = getAppName();
@@ -735,8 +729,9 @@ function registerApp(container, { context, analytics }) {
735
729
  return global.Page;
736
730
  }
737
731
  function AppsInTossScreenContainer({ children }) {
732
+ const isRN = getAppsInTossGlobals().webViewType == null;
738
733
  return /* @__PURE__ */ jsxs(Analytics.Screen, { children: [
739
- /* @__PURE__ */ jsx4(BuiltinNavigationBar, {}),
734
+ isRN && /* @__PURE__ */ jsx5(RNNavigationBar, {}),
740
735
  children
741
736
  ] });
742
737
  }
@@ -755,35 +750,30 @@ var AppsInToss = {
755
750
  };
756
751
 
757
752
  // src/components/WebView.tsx
758
- import { GoogleAdMob, IAP, Storage, AppsInTossModule, appsInTossEvent as appsInTossEvent4 } from "@apps-in-toss/native-modules";
753
+ import { GoogleAdMob, IAP, Storage, AppsInTossModule, appsInTossEvent as appsInTossEvent3 } from "@apps-in-toss/native-modules";
759
754
  import * as appsInTossAsyncBridges from "@apps-in-toss/native-modules/async-bridges";
760
755
  import * as appsInTossConstantBridges from "@apps-in-toss/native-modules/constant-bridges";
761
756
  import * as appsInTossEventBridges from "@apps-in-toss/native-modules/event-bridges";
762
- import { closeView as closeView3, getSchemeUri as getSchemeUri5, useGraniteEvent } from "@granite-js/react-native";
757
+ import { getSchemeUri as getSchemeUri5, useGraniteEvent } from "@granite-js/react-native";
763
758
  import * as graniteAsyncBridges from "@granite-js/react-native/async-bridges";
764
759
  import * as graniteConstantBridges from "@granite-js/react-native/constant-bridges";
765
- import {
766
- ExternalWebViewScreen,
767
- tdsEvent,
768
- useDialog as useDialog4
769
- } from "@toss-design-system/react-native";
770
- import { useSafeAreaBottom, useSafeAreaTop, useTopNavigation } from "@toss-design-system/react-native/private";
771
- import { josa as josa3 } from "es-hangul";
772
- import { useCallback as useCallback6, useEffect as useEffect10, useMemo as useMemo3, useState as useState5 } from "react";
773
- import { BackHandler as BackHandler2, Platform as Platform3 } from "react-native";
760
+ import { ExternalWebViewScreen, tdsEvent } from "@toss-design-system/react-native";
761
+ import { useSafeAreaBottom, useSafeAreaTop as useSafeAreaTop2, useTopNavigation } from "@toss-design-system/react-native/private";
762
+ import { useMemo as useMemo3, useState as useState6 } from "react";
763
+ import { Platform as Platform4 } from "react-native";
774
764
 
775
765
  // src/components/GameWebView.tsx
776
- import { setIosSwipeGestureEnabled as setIosSwipeGestureEnabled2, appsInTossEvent as appsInTossEvent3, getOperationalEnvironment } from "@apps-in-toss/native-modules";
766
+ import { setIosSwipeGestureEnabled as setIosSwipeGestureEnabled2, appsInTossEvent as appsInTossEvent2, getOperationalEnvironment } from "@apps-in-toss/native-modules";
777
767
  import {
778
768
  WebView as PlainWebView
779
769
  } from "@granite-js/native/react-native-webview";
780
- import { forwardRef, useEffect as useEffect8, useState as useState3 } from "react";
781
- import { Platform as Platform2 } from "react-native";
770
+ import { forwardRef, useEffect as useEffect10, useState as useState3 } from "react";
771
+ import { Platform as Platform3 } from "react-native";
782
772
 
783
773
  // src/components/GameProfile.tsx
784
774
  import { getGameCenterGameProfile as getGameCenterGameProfile2, isMinVersionSupported as isMinVersionSupported3 } from "@apps-in-toss/native-modules";
785
775
  import { Loader } from "@toss-design-system/react-native";
786
- import { useEffect as useEffect7 } from "react";
776
+ import { useEffect as useEffect8 } from "react";
787
777
  import { Pressable, View } from "react-native";
788
778
 
789
779
  // src/constant/game-center.ts
@@ -803,13 +793,13 @@ import { useCallback as useCallback4, useRef as useRef3, useState as useState2 }
803
793
  // src/components/GameProfileToast.tsx
804
794
  import { Asset, Toast } from "@toss-design-system/react-native";
805
795
  import { AdaptiveColorProvider, ColorPreferenceProvider, useOverlay as useOverlay2 } from "@toss-design-system/react-native/private";
806
- import { jsx as jsx5 } from "react/jsx-runtime";
796
+ import { jsx as jsx6 } from "react/jsx-runtime";
807
797
  var useGameProfileToast = () => {
808
798
  const overlay = useOverlay2();
809
799
  const openGameProfileToast = (nickname, profileImageUri) => {
810
800
  return new Promise((resolve) => {
811
801
  overlay.open(({ isOpen, close, exit }) => {
812
- return /* @__PURE__ */ jsx5(ColorPreferenceProvider, { colorPreference: "dark", children: /* @__PURE__ */ jsx5(AdaptiveColorProvider, { children: /* @__PURE__ */ jsx5(
802
+ return /* @__PURE__ */ jsx6(ColorPreferenceProvider, { colorPreference: "dark", children: /* @__PURE__ */ jsx6(AdaptiveColorProvider, { children: /* @__PURE__ */ jsx6(
813
803
  Toast,
814
804
  {
815
805
  open: isOpen,
@@ -820,7 +810,7 @@ var useGameProfileToast = () => {
820
810
  onExited: exit,
821
811
  position: "top",
822
812
  text: `${nickname}\uB2D8 \uBC18\uAC00\uC6CC\uC694!`,
823
- icon: /* @__PURE__ */ jsx5(
813
+ icon: /* @__PURE__ */ jsx6(
824
814
  Asset.Image,
825
815
  {
826
816
  style: { borderRadius: 64, overflow: "hidden" },
@@ -975,7 +965,7 @@ var Z_INDEX = {
975
965
  };
976
966
 
977
967
  // src/components/GameProfile.tsx
978
- import { Fragment as Fragment5, jsx as jsx6, jsxs as jsxs2 } from "react/jsx-runtime";
968
+ import { Fragment as Fragment5, jsx as jsx7, jsxs as jsxs2 } from "react/jsx-runtime";
979
969
  var GameProfile = ({ children, isReadyForProfileUI }) => {
980
970
  const {
981
971
  profileData,
@@ -991,7 +981,7 @@ var GameProfile = ({ children, isReadyForProfileUI }) => {
991
981
  openErrorAlert,
992
982
  openGameProfileToast
993
983
  } = useGameCenterProfile(isReadyForProfileUI);
994
- useEffect7(() => {
984
+ useEffect8(() => {
995
985
  try {
996
986
  const getProfileData = async () => {
997
987
  const data = await getGameCenterGameProfile2();
@@ -1004,7 +994,7 @@ var GameProfile = ({ children, isReadyForProfileUI }) => {
1004
994
  setIsProfileDataLoading(false);
1005
995
  }
1006
996
  }, []);
1007
- useEffect7(() => {
997
+ useEffect8(() => {
1008
998
  const handleGameProfileFlow = async () => {
1009
999
  if (!canShowBottomSheetOrToast) {
1010
1000
  return;
@@ -1036,8 +1026,8 @@ var GameProfile = ({ children, isReadyForProfileUI }) => {
1036
1026
  ]);
1037
1027
  if (!isMinVersionSupported3(GAME_CENTER_MIN_VERSION)) {
1038
1028
  return /* @__PURE__ */ jsxs2(Fragment5, { children: [
1039
- /* @__PURE__ */ jsx6(View, { style: { flex: 1, position: "relative" }, children }),
1040
- /* @__PURE__ */ jsx6(
1029
+ /* @__PURE__ */ jsx7(View, { style: { flex: 1, position: "relative" }, children }),
1030
+ /* @__PURE__ */ jsx7(
1041
1031
  Pressable,
1042
1032
  {
1043
1033
  style: {
@@ -1052,8 +1042,8 @@ var GameProfile = ({ children, isReadyForProfileUI }) => {
1052
1042
  }
1053
1043
  if (shouldShowLoadingOverlay || isProfileDataRefetching) {
1054
1044
  return /* @__PURE__ */ jsxs2(Fragment5, { children: [
1055
- /* @__PURE__ */ jsx6(View, { style: { flex: 1, position: "relative" }, children }),
1056
- /* @__PURE__ */ jsx6(
1045
+ /* @__PURE__ */ jsx7(View, { style: { flex: 1, position: "relative" }, children }),
1046
+ /* @__PURE__ */ jsx7(
1057
1047
  View,
1058
1048
  {
1059
1049
  style: {
@@ -1062,15 +1052,15 @@ var GameProfile = ({ children, isReadyForProfileUI }) => {
1062
1052
  alignItems: "center",
1063
1053
  backgroundColor: "rgba(0, 0, 0, 0.2)"
1064
1054
  },
1065
- children: /* @__PURE__ */ jsx6(Loader, { size: "large", type: "light" })
1055
+ children: /* @__PURE__ */ jsx7(Loader, { size: "large", type: "light" })
1066
1056
  }
1067
1057
  )
1068
1058
  ] });
1069
1059
  }
1070
1060
  if (shouldShowProfileNotFoundOverlay) {
1071
1061
  return /* @__PURE__ */ jsxs2(Fragment5, { children: [
1072
- /* @__PURE__ */ jsx6(View, { style: { flex: 1, position: "relative" }, children }),
1073
- shouldShowProfileNotFoundOverlay && /* @__PURE__ */ jsx6(
1062
+ /* @__PURE__ */ jsx7(View, { style: { flex: 1, position: "relative" }, children }),
1063
+ shouldShowProfileNotFoundOverlay && /* @__PURE__ */ jsx7(
1074
1064
  Pressable,
1075
1065
  {
1076
1066
  style: {
@@ -1083,7 +1073,7 @@ var GameProfile = ({ children, isReadyForProfileUI }) => {
1083
1073
  )
1084
1074
  ] });
1085
1075
  }
1086
- return /* @__PURE__ */ jsx6(Fragment5, { children: /* @__PURE__ */ jsx6(View, { style: { flex: 1, position: "relative" }, children }) });
1076
+ return /* @__PURE__ */ jsx7(Fragment5, { children: /* @__PURE__ */ jsx7(View, { style: { flex: 1, position: "relative" }, children }) });
1087
1077
  };
1088
1078
  var overlayStyle = {
1089
1079
  position: "absolute",
@@ -1094,12 +1084,82 @@ var overlayStyle = {
1094
1084
  zIndex: Z_INDEX.PROFILE_OVERLAY
1095
1085
  };
1096
1086
 
1087
+ // src/components/NavigationBar/GameWebviewNavigationBar.tsx
1088
+ import { closeView as closeView3 } from "@granite-js/react-native";
1089
+ import { PageNavbar, useDialog as useDialog4 } from "@toss-design-system/react-native";
1090
+ import { NavigationRightContent, useSafeAreaTop } from "@toss-design-system/react-native/private";
1091
+ import { josa as josa3 } from "es-hangul";
1092
+ import { useCallback as useCallback5, useEffect as useEffect9 } from "react";
1093
+ import { BackHandler as BackHandler2, Platform as Platform2, View as View2 } from "react-native";
1094
+ import { Fragment as Fragment6, jsx as jsx8, jsxs as jsxs3 } from "react/jsx-runtime";
1095
+ function GameWebviewNavigationBar() {
1096
+ const safeAreaTop = useSafeAreaTop();
1097
+ const { openConfirm } = useDialog4();
1098
+ const { captureExitLog } = useCaptureExitLog();
1099
+ const global2 = getAppsInTossGlobals();
1100
+ const logging = useNavigationBarLogging();
1101
+ const { open: openMoreButtonBottomSheet } = useMoreButtonBottomSheet();
1102
+ const parsedNavigationBar = global2.navigationBar != null ? safeParseNavigationBar(global2.navigationBar) : null;
1103
+ const initialAccessoryButton = parsedNavigationBar?.initialAccessoryButton;
1104
+ const handleGameWebviewClose = useCallback5(async () => {
1105
+ const isConfirmed = await openConfirm({
1106
+ title: `${josa3(global2.brandDisplayName, "\uC744/\uB97C")} \uC885\uB8CC\uD560\uAE4C\uC694?`,
1107
+ leftButton: "\uCDE8\uC18C",
1108
+ rightButton: "\uC885\uB8CC\uD558\uAE30",
1109
+ closeOnDimmerClick: true,
1110
+ onEntered: logging.closePopupShow
1111
+ });
1112
+ logging.closePopupCtaClick(isConfirmed);
1113
+ if (isConfirmed) {
1114
+ captureExitLog(Date.now());
1115
+ closeView3();
1116
+ }
1117
+ }, [captureExitLog, global2.brandDisplayName, logging, openConfirm]);
1118
+ const handleAndroidBackEvent = useCallback5(() => {
1119
+ handleGameWebviewClose();
1120
+ return true;
1121
+ }, [handleGameWebviewClose]);
1122
+ useEffect9(() => {
1123
+ BackHandler2.addEventListener("hardwareBackPress", handleAndroidBackEvent);
1124
+ return () => BackHandler2.removeEventListener("hardwareBackPress", handleAndroidBackEvent);
1125
+ }, [handleAndroidBackEvent]);
1126
+ return /* @__PURE__ */ jsxs3(Fragment6, { children: [
1127
+ /* @__PURE__ */ jsx8(PageNavbar, { preference: { type: "none" } }),
1128
+ /* @__PURE__ */ jsx8(
1129
+ View2,
1130
+ {
1131
+ style: {
1132
+ width: "100%",
1133
+ height: Platform2.OS === "ios" ? 44 : 54,
1134
+ flexDirection: "row",
1135
+ alignItems: "center",
1136
+ justifyContent: "flex-end",
1137
+ position: "absolute",
1138
+ zIndex: Z_INDEX.CLOSE_BUTTON,
1139
+ marginTop: safeAreaTop,
1140
+ paddingRight: 10
1141
+ },
1142
+ pointerEvents: "box-none",
1143
+ children: /* @__PURE__ */ jsx8(
1144
+ NavigationRightContent,
1145
+ {
1146
+ fixedRightButton: initialAccessoryButton,
1147
+ onPressDots: openMoreButtonBottomSheet,
1148
+ onPressClose: handleGameWebviewClose,
1149
+ theme: "dark"
1150
+ }
1151
+ )
1152
+ }
1153
+ )
1154
+ ] });
1155
+ }
1156
+
1097
1157
  // src/components/GameWebView.tsx
1098
- import { Fragment as Fragment6, jsx as jsx7 } from "react/jsx-runtime";
1158
+ import { Fragment as Fragment7, jsx as jsx9, jsxs as jsxs4 } from "react/jsx-runtime";
1099
1159
  var GameWebView = forwardRef(function GameWebView2(props, ref) {
1100
1160
  const [isEntryMessageExited, setIsEntryMessageExited] = useState3(false);
1101
- useEffect8(() => {
1102
- if (Platform2.OS === "ios") {
1161
+ useEffect10(() => {
1162
+ if (Platform3.OS === "ios") {
1103
1163
  setIosSwipeGestureEnabled2({ isEnabled: false });
1104
1164
  return () => {
1105
1165
  setIosSwipeGestureEnabled2({ isEnabled: true });
@@ -1107,21 +1167,78 @@ var GameWebView = forwardRef(function GameWebView2(props, ref) {
1107
1167
  }
1108
1168
  return;
1109
1169
  }, []);
1110
- useEffect8(() => {
1111
- appsInTossEvent3.addEventListener("entryMessageExited", {
1170
+ useEffect10(() => {
1171
+ appsInTossEvent2.addEventListener("entryMessageExited", {
1112
1172
  onEvent: () => {
1113
1173
  setIsEntryMessageExited(true);
1114
1174
  }
1115
1175
  });
1116
1176
  }, []);
1117
- return /* @__PURE__ */ jsx7(Fragment6, { children: getOperationalEnvironment() === "toss" ? /* @__PURE__ */ jsx7(GameProfile, { isReadyForProfileUI: isEntryMessageExited, children: /* @__PURE__ */ jsx7(PlainWebView, { ref, ...props }) }) : /* @__PURE__ */ jsx7(PlainWebView, { ref, ...props }) });
1177
+ return /* @__PURE__ */ jsxs4(Fragment7, { children: [
1178
+ /* @__PURE__ */ jsx9(GameWebviewNavigationBar, {}),
1179
+ getOperationalEnvironment() === "toss" ? /* @__PURE__ */ jsx9(GameProfile, { isReadyForProfileUI: isEntryMessageExited, children: /* @__PURE__ */ jsx9(PlainWebView, { ref, ...props }) }) : /* @__PURE__ */ jsx9(PlainWebView, { ref, ...props })
1180
+ ] });
1118
1181
  });
1119
1182
 
1120
1183
  // src/components/PartnerWebView.tsx
1184
+ import { closeView as closeView5 } from "@apps-in-toss/native-modules";
1121
1185
  import {
1122
1186
  WebView as PlainWebView2
1123
1187
  } from "@granite-js/native/react-native-webview";
1124
- import { forwardRef as forwardRef2, useRef as useRef4 } from "react";
1188
+ import { forwardRef as forwardRef2, useCallback as useCallback8, useEffect as useEffect11, useRef as useRef4 } from "react";
1189
+ import { BackHandler as BackHandler3 } from "react-native";
1190
+
1191
+ // src/components/NavigationBar/PartnerWebviewNavigationBar.tsx
1192
+ import { closeView as closeView4 } from "@granite-js/react-native";
1193
+ import { useDialog as useDialog5 } from "@toss-design-system/react-native";
1194
+ import { NavigationBackButton as NavigationBackButton2, NavigationLeft as NavigationLeft2, TopNavigation as TopNavigation2 } from "@toss-design-system/react-native/private";
1195
+ import { josa as josa4 } from "es-hangul";
1196
+ import { useCallback as useCallback6 } from "react";
1197
+ import { jsx as jsx10 } from "react/jsx-runtime";
1198
+ function PartnerWebviewNavigationBar({ handleBackEvent, handleHomeIconButtonClick }) {
1199
+ const globals = getAppsInTossGlobals();
1200
+ const { captureExitLog } = useCaptureExitLog();
1201
+ const logging = useNavigationBarLogging();
1202
+ const { openConfirm } = useDialog5();
1203
+ const { open: openMoreButtonBottomSheet } = useMoreButtonBottomSheet();
1204
+ const parsedNavigationBar = globals.navigationBar != null ? safeParseNavigationBar(globals.navigationBar) : null;
1205
+ const withHomeButton = parsedNavigationBar?.withHomeButton ?? false;
1206
+ const withBackButton = parsedNavigationBar?.withBackButton ?? true;
1207
+ const initialAccessoryButton = parsedNavigationBar?.initialAccessoryButton;
1208
+ const handlePressTitle = useCallback6(() => {
1209
+ logging.homeButtonClick();
1210
+ handleHomeIconButtonClick();
1211
+ }, [handleHomeIconButtonClick, logging]);
1212
+ const handleClose = useCallback6(async () => {
1213
+ logging.closeButtonClick();
1214
+ const isConfirmed = await openConfirm({
1215
+ title: `${josa4(globals.brandDisplayName, "\uC744/\uB97C")} \uC885\uB8CC\uD560\uAE4C\uC694?`,
1216
+ leftButton: "\uCDE8\uC18C",
1217
+ rightButton: "\uC885\uB8CC\uD558\uAE30",
1218
+ closeOnDimmerClick: true,
1219
+ onEntered: logging.closePopupShow
1220
+ });
1221
+ logging.closePopupCtaClick(isConfirmed);
1222
+ if (isConfirmed) {
1223
+ captureExitLog(Date.now());
1224
+ closeView4();
1225
+ }
1226
+ }, [captureExitLog, globals.brandDisplayName, logging, openConfirm]);
1227
+ return /* @__PURE__ */ jsx10(NavigationBarImpressionArea, { withHomeButton, children: /* @__PURE__ */ jsx10(
1228
+ TopNavigation2,
1229
+ {
1230
+ title: globals.brandDisplayName,
1231
+ icon: toIcon(globals.brandIcon),
1232
+ onPressDots: openMoreButtonBottomSheet,
1233
+ contentVisible: true,
1234
+ onPressTitle: withHomeButton ? handlePressTitle : void 0,
1235
+ onPressClose: handleClose,
1236
+ withHome: withHomeButton,
1237
+ fixedRightButton: initialAccessoryButton,
1238
+ children: /* @__PURE__ */ jsx10(NavigationLeft2, { visible: withBackButton, children: /* @__PURE__ */ jsx10(NavigationBackButton2, { onPress: handleBackEvent, canGoBack: false }) })
1239
+ }
1240
+ ) });
1241
+ }
1125
1242
 
1126
1243
  // src/core/utils/mergeRefs.ts
1127
1244
  function mergeRefs(...refs) {
@@ -1136,18 +1253,182 @@ function mergeRefs(...refs) {
1136
1253
  };
1137
1254
  }
1138
1255
 
1256
+ // src/hooks/useWebviewHistoryStack.tsx
1257
+ import { useCallback as useCallback7, useState as useState4 } from "react";
1258
+ function useWebViewHistory() {
1259
+ const [stack, setStack] = useState4([]);
1260
+ const [index, setIndex] = useState4(-1);
1261
+ const canGoBack = index > 0;
1262
+ const canGoForward = index >= 0 && index < stack.length - 1;
1263
+ const push = useCallback7(
1264
+ (url) => {
1265
+ setStack((prev) => {
1266
+ const base = prev.slice(0, index + 1);
1267
+ return [...base, url];
1268
+ });
1269
+ setIndex((i) => i + 1);
1270
+ },
1271
+ [index]
1272
+ );
1273
+ const onNavigationStateChange = useCallback7(
1274
+ ({ url }) => {
1275
+ if (stack.length === 0) {
1276
+ setStack([url]);
1277
+ setIndex(0);
1278
+ return;
1279
+ }
1280
+ const cur = stack[index];
1281
+ if (url === cur) {
1282
+ return;
1283
+ }
1284
+ const prev = index > 0 ? stack[index - 1] : void 0;
1285
+ const next = index < stack.length - 1 ? stack[index + 1] : void 0;
1286
+ if (prev && url === prev) {
1287
+ setIndex((i) => i - 1);
1288
+ return;
1289
+ }
1290
+ if (next && url === next) {
1291
+ setIndex((i) => i + 1);
1292
+ return;
1293
+ }
1294
+ push(url);
1295
+ },
1296
+ [stack, index, push]
1297
+ );
1298
+ return {
1299
+ onNavigationStateChange,
1300
+ canGoBack,
1301
+ canGoForward
1302
+ };
1303
+ }
1304
+
1305
+ // src/utils/log.ts
1306
+ import { eventLog as eventLogNative } from "@apps-in-toss/native-modules";
1307
+ import { getSchemeUri as getSchemeUri4 } from "@granite-js/react-native";
1308
+
1309
+ // src/utils/extractDateFromUUIDv7.ts
1310
+ var extractDateFromUUIDv7 = (uuid) => {
1311
+ const timestampHex = uuid.split("-").join("").slice(0, 12);
1312
+ const timestamp = Number.parseInt(timestampHex, 16);
1313
+ return new Date(timestamp);
1314
+ };
1315
+
1316
+ // src/utils/log.ts
1317
+ var getGroupId = (url) => {
1318
+ try {
1319
+ const urlObject = new URL(url);
1320
+ return {
1321
+ groupId: urlObject.pathname,
1322
+ search: urlObject.search.startsWith("?") ? urlObject.search.substring(1) : urlObject.search
1323
+ };
1324
+ } catch {
1325
+ return {
1326
+ groupId: "unknown",
1327
+ search: "unknown"
1328
+ };
1329
+ }
1330
+ };
1331
+ var getReferrer = () => {
1332
+ try {
1333
+ const referrer = new URL(getSchemeUri4());
1334
+ return referrer.searchParams.get("referrer");
1335
+ } catch {
1336
+ return "";
1337
+ }
1338
+ };
1339
+ var trackScreen = (url) => {
1340
+ const { groupId, search } = getGroupId(url);
1341
+ const log = {
1342
+ log_type: "screen",
1343
+ log_name: `${groupId}::screen`,
1344
+ params: {
1345
+ search,
1346
+ referrer: getReferrer(),
1347
+ deployment_id: env.getDeploymentId(),
1348
+ deployment_timestamp: extractDateFromUUIDv7(env.getDeploymentId()).getTime()
1349
+ }
1350
+ };
1351
+ return eventLogNative(log);
1352
+ };
1353
+
1139
1354
  // src/components/PartnerWebView.tsx
1140
- import { jsx as jsx8 } from "react/jsx-runtime";
1355
+ import { Fragment as Fragment8, jsx as jsx11, jsxs as jsxs5 } from "react/jsx-runtime";
1141
1356
  var PartnerWebView = forwardRef2(
1142
1357
  function PartnerWebViewScreen(webViewProps, ref) {
1143
1358
  const webViewRef = useRef4(null);
1144
1359
  const refs = mergeRefs(ref, webViewRef);
1145
- return /* @__PURE__ */ jsx8(PlainWebView2, { ref: refs, ...webViewProps, style: { flex: 1 } });
1360
+ const { captureExitLog } = useCaptureExitLog();
1361
+ const { canGoBack, onNavigationStateChange } = useWebViewHistory();
1362
+ const historyBackScript = `
1363
+ (function() {
1364
+ history.back();
1365
+ true;
1366
+ })();
1367
+ `;
1368
+ const historyHomeScript = `
1369
+ (function() {
1370
+ history.replaceState(null, '', '/');
1371
+ true;
1372
+ })();
1373
+ `;
1374
+ const handleBackEvent = useCallback8(() => {
1375
+ if (canGoBack) {
1376
+ webViewRef.current?.injectJavaScript(historyBackScript);
1377
+ } else {
1378
+ captureExitLog(Date.now());
1379
+ closeView5();
1380
+ }
1381
+ }, [canGoBack, captureExitLog, historyBackScript]);
1382
+ const handleAndroidBackEvent = useCallback8(() => {
1383
+ if (canGoBack) {
1384
+ webViewRef.current?.injectJavaScript(historyBackScript);
1385
+ return true;
1386
+ } else {
1387
+ return false;
1388
+ }
1389
+ }, [canGoBack, historyBackScript]);
1390
+ useEffect11(() => {
1391
+ BackHandler3.addEventListener("hardwareBackPress", handleAndroidBackEvent);
1392
+ return () => BackHandler3.removeEventListener("hardwareBackPress", handleAndroidBackEvent);
1393
+ }, [handleAndroidBackEvent]);
1394
+ const handleHomeIconButtonClick = useCallback8(() => {
1395
+ webViewRef.current?.injectJavaScript(historyHomeScript);
1396
+ }, [historyHomeScript]);
1397
+ const handleNavigationStateChange = useCallback8(
1398
+ (event) => {
1399
+ if (event.url) {
1400
+ trackScreen(event.url);
1401
+ }
1402
+ onNavigationStateChange(event);
1403
+ },
1404
+ [onNavigationStateChange]
1405
+ );
1406
+ return /* @__PURE__ */ jsxs5(Fragment8, { children: [
1407
+ /* @__PURE__ */ jsx11(
1408
+ PartnerWebviewNavigationBar,
1409
+ {
1410
+ handleBackEvent,
1411
+ handleHomeIconButtonClick
1412
+ }
1413
+ ),
1414
+ /* @__PURE__ */ jsx11(
1415
+ PlainWebView2,
1416
+ {
1417
+ ref: refs,
1418
+ ...webViewProps,
1419
+ style: { flex: 1 },
1420
+ onNavigationStateChange: (event) => {
1421
+ webViewProps?.onNavigationStateChange?.(event);
1422
+ handleNavigationStateChange(event);
1423
+ }
1424
+ }
1425
+ )
1426
+ ] });
1146
1427
  }
1147
1428
  );
1148
1429
 
1149
1430
  // src/bridge-handler/useBridgeHandler.tsx
1150
- import { useCallback as useCallback5, useMemo as useMemo2, useRef as useRef5 } from "react";
1431
+ import { useCallback as useCallback9, useMemo as useMemo2, useRef as useRef5 } from "react";
1151
1432
  function serializeError(error) {
1152
1433
  return JSON.stringify(error, (_, value) => {
1153
1434
  if (value instanceof Error) {
@@ -1224,7 +1505,7 @@ function useBridgeHandler({
1224
1505
  window.__GRANITE_NATIVE_EMITTER.emit('${functionName}/onError/${eventId}', ${serializedError});
1225
1506
  `);
1226
1507
  };
1227
- const $onMessage = useCallback5(
1508
+ const $onMessage = useCallback9(
1228
1509
  async (e) => {
1229
1510
  onMessage?.(e);
1230
1511
  const data = JSON.parse(e.nativeEvent.data);
@@ -1433,11 +1714,11 @@ function useCreateUserAgent({
1433
1714
  // src/hooks/useGeolocation.ts
1434
1715
  import { startUpdateLocation } from "@apps-in-toss/native-modules";
1435
1716
  import { useVisibility as useVisibility3 } from "@granite-js/react-native";
1436
- import { useEffect as useEffect9, useState as useState4 } from "react";
1717
+ import { useEffect as useEffect12, useState as useState5 } from "react";
1437
1718
  function useGeolocation({ accuracy, distanceInterval, timeInterval }) {
1438
1719
  const isVisible = useVisibility3();
1439
- const [location, setLocation] = useState4(null);
1440
- useEffect9(() => {
1720
+ const [location, setLocation] = useState5(null);
1721
+ useEffect12(() => {
1441
1722
  if (!isVisible) {
1442
1723
  return;
1443
1724
  }
@@ -1454,57 +1735,8 @@ function useGeolocation({ accuracy, distanceInterval, timeInterval }) {
1454
1735
  return location;
1455
1736
  }
1456
1737
 
1457
- // src/utils/log.ts
1458
- import { eventLog as eventLogNative } from "@apps-in-toss/native-modules";
1459
- import { getSchemeUri as getSchemeUri4 } from "@granite-js/react-native";
1460
-
1461
- // src/utils/extractDateFromUUIDv7.ts
1462
- var extractDateFromUUIDv7 = (uuid) => {
1463
- const timestampHex = uuid.split("-").join("").slice(0, 12);
1464
- const timestamp = Number.parseInt(timestampHex, 16);
1465
- return new Date(timestamp);
1466
- };
1467
-
1468
- // src/utils/log.ts
1469
- var getGroupId = (url) => {
1470
- try {
1471
- const urlObject = new URL(url);
1472
- return {
1473
- groupId: urlObject.pathname,
1474
- search: urlObject.search.startsWith("?") ? urlObject.search.substring(1) : urlObject.search
1475
- };
1476
- } catch {
1477
- return {
1478
- groupId: "unknown",
1479
- search: "unknown"
1480
- };
1481
- }
1482
- };
1483
- var getReferrer = () => {
1484
- try {
1485
- const referrer = new URL(getSchemeUri4());
1486
- return referrer.searchParams.get("referrer");
1487
- } catch {
1488
- return "";
1489
- }
1490
- };
1491
- var trackScreen = (url) => {
1492
- const { groupId, search } = getGroupId(url);
1493
- const log = {
1494
- log_type: "screen",
1495
- log_name: `${groupId}::screen`,
1496
- params: {
1497
- search,
1498
- referrer: getReferrer(),
1499
- deployment_id: env.getDeploymentId(),
1500
- deployment_timestamp: extractDateFromUUIDv7(env.getDeploymentId()).getTime()
1501
- }
1502
- };
1503
- return eventLogNative(log);
1504
- };
1505
-
1506
1738
  // src/components/WebView.tsx
1507
- import { jsx as jsx9 } from "react/jsx-runtime";
1739
+ import { jsx as jsx12 } from "react/jsx-runtime";
1508
1740
  var operationalEnvironment = appsInTossConstantBridges.getOperationalEnvironment();
1509
1741
  var TYPES = ["partner", "external", "game"];
1510
1742
  var WEBVIEW_TYPES = {
@@ -1538,11 +1770,9 @@ function WebView({ type, local, onMessage, ...props }) {
1538
1770
  if (!TYPES.includes(type)) {
1539
1771
  throw new Error(`Invalid WebView type: '${type}'`);
1540
1772
  }
1541
- const { openConfirm } = useDialog4();
1542
- const { captureExitLog } = useCaptureExitLog();
1543
1773
  const graniteEvent = useGraniteEvent();
1544
1774
  const uri = useMemo3(() => getWebViewUri(local), [local]);
1545
- const top = useSafeAreaTop();
1775
+ const top = useSafeAreaTop2();
1546
1776
  const bottom = useSafeAreaBottom();
1547
1777
  const global2 = getAppsInTossGlobals();
1548
1778
  const topNavigation = useTopNavigation();
@@ -1553,7 +1783,7 @@ function WebView({ type, local, onMessage, ...props }) {
1553
1783
  document.head.appendChild(style);
1554
1784
  })();
1555
1785
  `;
1556
- const [allowsBackForwardNavigationGestures, setAllowsBackForwardNavigationGestures] = useState5(
1786
+ const [allowsBackForwardNavigationGestures, setAllowsBackForwardNavigationGestures] = useState6(
1557
1787
  props.allowsBackForwardNavigationGestures
1558
1788
  );
1559
1789
  const handler = useBridgeHandler({
@@ -1564,10 +1794,10 @@ function WebView({ type, local, onMessage, ...props }) {
1564
1794
  ...appsInTossEventBridges,
1565
1795
  navigationAccessoryEvent: ({ onEvent, onError }) => tdsEvent.addEventListener("navigationAccessoryEvent", { onEvent, onError }),
1566
1796
  backEvent: ({ onEvent, onError, options }) => graniteEvent.addEventListener("backEvent", { onEvent, onError, options }),
1567
- entryMessageExited: ({ onEvent, onError }) => appsInTossEvent4.addEventListener("entryMessageExited", { onEvent, onError }),
1568
- updateLocationEvent: ({ onEvent, onError, options }) => appsInTossEvent4.addEventListener("updateLocationEvent", { onEvent, onError, options }),
1797
+ entryMessageExited: ({ onEvent, onError }) => appsInTossEvent3.addEventListener("entryMessageExited", { onEvent, onError }),
1798
+ updateLocationEvent: ({ onEvent, onError, options }) => appsInTossEvent3.addEventListener("updateLocationEvent", { onEvent, onError, options }),
1569
1799
  /** @internal */
1570
- appBridgeCallbackEvent: ({ onEvent, onError, options }) => appsInTossEvent4.addEventListener("appBridgeCallbackEvent", { onEvent, onError, options }),
1800
+ appBridgeCallbackEvent: ({ onEvent, onError, options }) => appsInTossEvent3.addEventListener("appBridgeCallbackEvent", { onEvent, onError, options }),
1571
1801
  /** AdMob */
1572
1802
  loadAdMobInterstitialAd: GoogleAdMob.loadAdMobInterstitialAd,
1573
1803
  showAdMobInterstitialAd: GoogleAdMob.showAdMobInterstitialAd,
@@ -1640,74 +1870,10 @@ function WebView({ type, local, onMessage, ...props }) {
1640
1870
  }, [global2.navigationBar, type]);
1641
1871
  const BaseWebView = WEBVIEW_TYPES[type];
1642
1872
  const webViewDebuggingEnabled = operationalEnvironment === "sandbox";
1643
- const [canHistoryGoBack, setCanHistoryGoBack] = useState5(false);
1644
- const handleNavigationStateChange = useCallback6(
1645
- (event) => {
1646
- if (event.url) {
1647
- trackScreen(event.url);
1648
- }
1649
- setCanHistoryGoBack(event.canGoBack);
1650
- },
1651
- [setCanHistoryGoBack]
1652
- );
1653
1873
  const userAgent = useCreateUserAgent({
1654
1874
  colorPreference: "light"
1655
1875
  });
1656
- const handleGameWebviewClose = useCallback6(async () => {
1657
- const isConfirmed = await openConfirm({
1658
- title: `${josa3(global2.brandDisplayName, "\uC744/\uB97C")} \uC885\uB8CC\uD560\uAE4C\uC694?`,
1659
- leftButton: "\uCDE8\uC18C",
1660
- rightButton: "\uC885\uB8CC\uD558\uAE30",
1661
- closeOnDimmerClick: true
1662
- });
1663
- if (isConfirmed) {
1664
- captureExitLog(Date.now());
1665
- closeView3();
1666
- }
1667
- }, [captureExitLog, openConfirm, global2.brandDisplayName]);
1668
- const handleBackEvent = useCallback6(() => {
1669
- if (type === "game") {
1670
- handleGameWebviewClose();
1671
- return true;
1672
- }
1673
- if (canHistoryGoBack) {
1674
- handler.ref.current?.goBack();
1675
- return true;
1676
- } else {
1677
- return false;
1678
- }
1679
- }, [canHistoryGoBack, handleGameWebviewClose, handler.ref, type]);
1680
- useEffect10(() => {
1681
- BackHandler2.addEventListener("hardwareBackPress", handleBackEvent);
1682
- return () => BackHandler2.removeEventListener("hardwareBackPress", handleBackEvent);
1683
- }, [handleBackEvent]);
1684
- useEffect10(() => {
1685
- return appsInTossEvent4.addEventListener("homeIconButtonClickEvent", {
1686
- onEvent: () => {
1687
- handler.ref?.current?.injectJavaScript(`
1688
- (function() {
1689
- window.history.replaceState(null, '', '/');
1690
- true;
1691
- })();
1692
- `);
1693
- }
1694
- });
1695
- }, [handler.ref]);
1696
- useEffect10(() => {
1697
- return appsInTossEvent4.addEventListener("backButtonClickEvent", {
1698
- onEvent: () => {
1699
- if (type === "game") {
1700
- handleGameWebviewClose();
1701
- } else if (canHistoryGoBack) {
1702
- handler.ref.current?.goBack();
1703
- } else {
1704
- captureExitLog(Date.now());
1705
- closeView3();
1706
- }
1707
- }
1708
- });
1709
- }, [handler.ref, canHistoryGoBack, handleGameWebviewClose, captureExitLog, type]);
1710
- return /* @__PURE__ */ jsx9(
1876
+ return /* @__PURE__ */ jsx12(
1711
1877
  BaseWebView,
1712
1878
  {
1713
1879
  ref: handler.ref,
@@ -1720,15 +1886,14 @@ function WebView({ type, local, onMessage, ...props }) {
1720
1886
  "User-Agent": userAgent
1721
1887
  }
1722
1888
  },
1723
- userAgent: Platform3.OS === "ios" ? userAgent : void 0,
1889
+ userAgent: Platform4.OS === "ios" ? userAgent : void 0,
1724
1890
  sharedCookiesEnabled: true,
1725
1891
  webviewDebuggingEnabled: webViewDebuggingEnabled,
1726
1892
  thirdPartyCookiesEnabled: true,
1727
1893
  onMessage: handler.onMessage,
1728
- onNavigationStateChange: handleNavigationStateChange,
1729
1894
  injectedJavaScript: handler.injectedJavaScript,
1730
1895
  injectedJavaScriptBeforeContentLoaded: handler.injectedJavaScript,
1731
- decelerationRate: Platform3.OS === "ios" ? 1 : void 0,
1896
+ decelerationRate: Platform4.OS === "ios" ? 1 : void 0,
1732
1897
  allowsBackForwardNavigationGestures
1733
1898
  }
1734
1899
  );