@apps-in-toss/framework 0.0.0-dev.1763432540119 → 0.0.0-dev.1765732023607

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 +422 -317
  2. package/dist/index.js +303 -196
  3. package/package.json +15 -15
package/dist/index.js CHANGED
@@ -18,7 +18,7 @@ import { Analytics as InternalAnalytics } from "@apps-in-toss/analytics";
18
18
  // src/core/registerApp.tsx
19
19
  import { Analytics } from "@apps-in-toss/analytics";
20
20
  import { isMinVersionSupported as isMinVersionSupported3, setIosSwipeGestureEnabled as setIosSwipeGestureEnabled2, eventLog } from "@apps-in-toss/native-modules";
21
- import { Granite as Granite6 } from "@granite-js/react-native";
21
+ import { Granite as Granite7 } from "@granite-js/react-native";
22
22
  import { TDSProvider } from "@toss/tds-react-native";
23
23
  import { AppRegistry } from "react-native";
24
24
 
@@ -217,37 +217,9 @@ function useNavigationBarContext() {
217
217
  return context;
218
218
  }
219
219
 
220
- // src/core/hooks/useAppsInTossBridge.ts
221
- import { appsInTossEvent } from "@apps-in-toss/native-modules";
222
- import { useBridge } from "@toss/tds-react-native";
223
- import { useEffect as useEffect4 } from "react";
224
-
225
- // src/core/utils/toIcon.ts
226
- function toIcon(source) {
227
- return source.startsWith("http") ? { source: { uri: source } } : { name: source };
228
- }
229
-
230
- // src/core/hooks/useAppsInTossBridge.ts
231
- function useAppsInTossBridge() {
232
- const controller = useBridge();
233
- const appsInTossGlobals = getAppsInTossGlobals();
234
- useEffect4(() => {
235
- const isGameApp = appsInTossGlobals.webViewType === "game" || appsInTossGlobals.appType === "game";
236
- controller.open({
237
- serviceName: appsInTossGlobals.brandDisplayName,
238
- icon: toIcon(appsInTossGlobals.brandIcon),
239
- color: appsInTossGlobals.brandPrimaryColor,
240
- colorMode: isGameApp ? "inverted" : appsInTossGlobals.brandBridgeColorMode,
241
- onExited: () => {
242
- appsInTossEvent.emit("entryMessageExited", void 0);
243
- }
244
- });
245
- }, []);
246
- }
247
-
248
220
  // src/components/RNAppContainer.tsx
249
- import { appsInTossEvent as appsInTossEvent2, setIosSwipeGestureEnabled } from "@apps-in-toss/native-modules";
250
- import { useEffect as useEffect9, useState as useState5 } from "react";
221
+ import { setIosSwipeGestureEnabled } from "@apps-in-toss/native-modules";
222
+ import { useEffect as useEffect8 } from "react";
251
223
  import { Platform as Platform3 } from "react-native";
252
224
 
253
225
  // src/components/GameInitializer.tsx
@@ -255,7 +227,7 @@ import { isMinVersionSupported } from "@apps-in-toss/native-modules";
255
227
  import { closeView as closeView2 } from "@granite-js/react-native";
256
228
  import { Loader } from "@toss/tds-react-native";
257
229
  import { josa } from "es-hangul";
258
- import { useEffect as useEffect5, useRef as useRef2 } from "react";
230
+ import { useEffect as useEffect4, useRef as useRef2 } from "react";
259
231
  import { Pressable, View } from "react-native";
260
232
 
261
233
  // src/constant/game-center.ts
@@ -506,13 +478,13 @@ var useGameProfileToast = () => {
506
478
  };
507
479
 
508
480
  // src/hooks/useGameCenterProfile.ts
509
- var useGameCenterProfile = (isReadyForProfileUI) => {
481
+ var useGameCenterProfile = () => {
510
482
  const [profileData, setProfileData] = useState3(void 0);
511
483
  const [isProfileDataLoading, setIsProfileDataLoading] = useState3(true);
512
484
  const [isProfileDataRefetching, setIsProfileDataRefetching] = useState3(false);
513
- const shouldShowProfileLoadingOverlay = isProfileDataLoading && isReadyForProfileUI || isProfileDataRefetching;
514
- const shouldShowProfileNotFoundOverlay = profileData?.statusCode === "PROFILE_NOT_FOUND" && isReadyForProfileUI && !isProfileDataRefetching;
515
- const canShowBottomSheetOrToast = !isProfileDataLoading && isReadyForProfileUI;
485
+ const shouldShowProfileLoadingOverlay = isProfileDataLoading || isProfileDataRefetching;
486
+ const shouldShowProfileNotFoundOverlay = profileData?.statusCode === "PROFILE_NOT_FOUND" && !isProfileDataRefetching;
487
+ const canShowBottomSheetOrToast = !isProfileDataLoading;
516
488
  const { openGameProfileToast } = useGameProfileToast();
517
489
  const { open: openErrorAlert } = useErrorAlert();
518
490
  const { open: openTransparentWebView2 } = useTransparentWebview();
@@ -574,7 +546,7 @@ var Z_INDEX = {
574
546
 
575
547
  // src/components/GameInitializer.tsx
576
548
  import { Fragment as Fragment2, jsx as jsx4, jsxs } from "react/jsx-runtime";
577
- var GameInitializer = ({ children, isReadyForProfileUI }) => {
549
+ var GameInitializer = ({ children }) => {
578
550
  const {
579
551
  profileData,
580
552
  shouldShowProfileLoadingOverlay,
@@ -583,13 +555,13 @@ var GameInitializer = ({ children, isReadyForProfileUI }) => {
583
555
  openProfileWebview,
584
556
  openGameProfileToast,
585
557
  fetchProfileData
586
- } = useGameCenterProfile(isReadyForProfileUI);
558
+ } = useGameCenterProfile();
587
559
  const isCompletedFlow = useRef2(false);
588
560
  const { open: openAppUpdateDialog } = useAppUpdateDialog();
589
- useEffect5(() => {
561
+ useEffect4(() => {
590
562
  fetchProfileData();
591
563
  }, []);
592
- useEffect5(() => {
564
+ useEffect4(() => {
593
565
  const handleGameProfileFlow = async () => {
594
566
  if (!canShowBottomSheetOrToast) {
595
567
  return;
@@ -695,10 +667,10 @@ var overlayStyle = {
695
667
  import { NavigationBackButton, NavigationLeft, TopNavigation } from "@toss/tds-react-native/private";
696
668
 
697
669
  // src/components/NavigationBar/RNNavigationBar/hooks/useHardwareBackPress.ts
698
- import { useEffect as useEffect6 } from "react";
670
+ import { useEffect as useEffect5 } from "react";
699
671
  import { BackHandler } from "react-native";
700
672
  function useHardwareBackPress(handler) {
701
- useEffect6(() => {
673
+ useEffect5(() => {
702
674
  const handleBackPress = () => {
703
675
  handler();
704
676
  return true;
@@ -856,18 +828,22 @@ function useNavigationEvent() {
856
828
 
857
829
  // src/core/hooks/useMoreButtonBottomSheet/index.tsx
858
830
  import { INTERNAL__appBridgeHandler, isMinVersionSupported as isMinVersionSupported2 } from "@apps-in-toss/native-modules";
859
- import { openURL as openURL4 } from "@granite-js/react-native";
860
- import { BottomSheet, List, ListHeader, ListRow as ListRow2 } from "@toss/tds-react-native";
831
+ import { openURL as openURL5 } from "@granite-js/react-native";
832
+ import { BottomSheet, List, ListHeader } from "@toss/tds-react-native";
861
833
  import { useAdaptive as useAdaptive2, useOverlay as useOverlay2 } from "@toss/tds-react-native/private";
862
- import { useEffect as useEffect7, useState as useState4 } from "react";
834
+ import { useEffect as useEffect6, useState as useState4 } from "react";
863
835
 
864
836
  // src/core/hooks/useMoreButtonBottomSheet/AppShareListMenu.tsx
865
837
  import { getOperationalEnvironment } from "@apps-in-toss/native-modules";
866
838
  import { getSchemeUri as getSchemeUri4 } from "@granite-js/react-native";
867
- import { ListRow, useDialog as useDialog4 } from "@toss/tds-react-native";
868
- import { useAdaptive } from "@toss/tds-react-native/private";
839
+ import { useDialog as useDialog4 } from "@toss/tds-react-native";
869
840
  import { NativeModules } from "react-native";
870
841
 
842
+ // src/core/hooks/useMoreButtonBottomSheet/Menu.tsx
843
+ import { ListRow, Asset as Asset2 } from "@toss/tds-react-native";
844
+ import { useAdaptive } from "@toss/tds-react-native/private";
845
+ import { View as View2 } from "react-native";
846
+
871
847
  // src/core/hooks/useMoreButtonBottomSheet/useMoreButtonBottomSheetLogging.tsx
872
848
  import { INTERNAL__module as INTERNAL__module5 } from "@apps-in-toss/native-modules";
873
849
  import { Granite as Granite5 } from "@granite-js/react-native";
@@ -937,6 +913,82 @@ function useMoreButtonBottomSheetLogging() {
937
913
  };
938
914
  }
939
915
 
916
+ // src/core/hooks/useMoreButtonBottomSheet/Menu.tsx
917
+ import { jsx as jsx5 } from "react/jsx-runtime";
918
+ function Menu({ title, iconURL, onPress }) {
919
+ const globals = getAppsInTossGlobals();
920
+ const adaptive = useAdaptive();
921
+ const iconName = getIconName(iconURL);
922
+ const logging = useMoreButtonBottomSheetLogging();
923
+ const brandPrimaryColorRGB = hexToRGB(globals.brandPrimaryColor);
924
+ const iconBackgroundColor = brandPrimaryColorRGB ? `rgba(${brandPrimaryColorRGB.join(",")},0.1)` : adaptive.grey100;
925
+ return /* @__PURE__ */ jsx5(
926
+ ListRow,
927
+ {
928
+ left: /* @__PURE__ */ jsx5(
929
+ View2,
930
+ {
931
+ style: {
932
+ width: 30,
933
+ height: 30,
934
+ borderRadius: 10,
935
+ flexDirection: "row",
936
+ alignItems: "center",
937
+ justifyContent: "center",
938
+ marginRight: 16,
939
+ backgroundColor: iconBackgroundColor
940
+ },
941
+ children: iconName ? /* @__PURE__ */ jsx5(
942
+ Asset2.Icon,
943
+ {
944
+ frameShape: { width: 20, height: 20 },
945
+ color: globals.brandPrimaryColor,
946
+ name: iconName
947
+ }
948
+ ) : /* @__PURE__ */ jsx5(
949
+ Asset2.Image,
950
+ {
951
+ frameShape: { width: 20, height: 20 },
952
+ source: { uri: iconURL }
953
+ }
954
+ )
955
+ }
956
+ ),
957
+ contents: /* @__PURE__ */ jsx5(
958
+ ListRow.Texts,
959
+ {
960
+ type: "1RowTypeA",
961
+ top: title,
962
+ topProps: { color: adaptive.grey700 }
963
+ }
964
+ ),
965
+ verticalPadding: "extraSmall",
966
+ onPress: () => {
967
+ logging.menuClick({ title });
968
+ onPress?.();
969
+ }
970
+ }
971
+ );
972
+ }
973
+ var iconNameRegExp = /^(icon-|icn-(?!(car|sec|bank-(fill|square|horizontal))-))(.+)/i;
974
+ var iconURLRegExp = /^https:\/\/static\.toss\.im\/icons\/(png\/\dx|svg|pdf)\/((icon-|icn-(?!(car|sec|bank-(fill|square|horizontal))-))(.+))\.(png|svg|pdf)$/i;
975
+ function isIconUrl(url) {
976
+ return iconNameRegExp.test(url) || iconURLRegExp.test(url);
977
+ }
978
+ function getIconName(url) {
979
+ if (!isIconUrl(url)) {
980
+ return null;
981
+ }
982
+ if (iconNameRegExp.test(url)) {
983
+ return url;
984
+ }
985
+ return url.match(iconURLRegExp)?.[2];
986
+ }
987
+ function hexToRGB(hex) {
988
+ const rgb = hex.toLowerCase().match(/[0-9,a-f]{2}/g)?.map((str) => parseInt(str, 16));
989
+ return rgb?.length === 3 ? rgb : void 0;
990
+ }
991
+
940
992
  // src/core/utils/url.ts
941
993
  function addParamsToUrl(url, params) {
942
994
  const urlObj = new URL(url);
@@ -947,42 +999,24 @@ function addParamsToUrl(url, params) {
947
999
  }
948
1000
 
949
1001
  // src/core/hooks/useMoreButtonBottomSheet/AppShareListMenu.tsx
950
- import { jsx as jsx5 } from "react/jsx-runtime";
1002
+ import { jsx as jsx6 } from "react/jsx-runtime";
951
1003
  var SHARE_SCHEME_REFERRER = "appsintoss.common_module_share";
952
1004
  var APP_SHARE_MENU_INFO = {
953
1005
  contactItemName: "\uACF5\uC720\uD558\uAE30",
954
1006
  contactIconUrl: "https://static.toss.im/icons/png/4x/icon-share-dots-mono.png"
955
1007
  };
956
1008
  function AppShareListMenu() {
957
- const globals = getAppsInTossGlobals();
958
- const adaptive = useAdaptive();
959
- const logging = useMoreButtonBottomSheetLogging();
960
1009
  const initialScheme = getSchemeUri4();
961
1010
  const isSandbox = getOperationalEnvironment() === "sandbox";
962
1011
  const { openConfirm } = useDialog4();
963
1012
  const schemeForShare = addParamsToUrl(initialScheme, {
964
1013
  referrer: SHARE_SCHEME_REFERRER
965
1014
  });
966
- return /* @__PURE__ */ jsx5(
967
- ListRow,
1015
+ return /* @__PURE__ */ jsx6(
1016
+ Menu,
968
1017
  {
969
- left: /* @__PURE__ */ jsx5(
970
- ListRow.Icon,
971
- {
972
- color: globals.brandPrimaryColor,
973
- source: { uri: APP_SHARE_MENU_INFO.contactIconUrl },
974
- type: "background"
975
- }
976
- ),
977
- contents: /* @__PURE__ */ jsx5(
978
- ListRow.Texts,
979
- {
980
- type: "1RowTypeA",
981
- top: APP_SHARE_MENU_INFO.contactItemName,
982
- topProps: { color: adaptive.grey700 }
983
- }
984
- ),
985
- verticalPadding: "extraSmall",
1018
+ title: APP_SHARE_MENU_INFO.contactItemName,
1019
+ iconURL: APP_SHARE_MENU_INFO.contactIconUrl,
986
1020
  onPress: () => {
987
1021
  if (isSandbox) {
988
1022
  openConfirm({
@@ -993,7 +1027,6 @@ function AppShareListMenu() {
993
1027
  });
994
1028
  return;
995
1029
  }
996
- logging.menuClick({ title: APP_SHARE_MENU_INFO.contactItemName });
997
1030
  NativeModules.AppsInTossModule.shareWithScheme({
998
1031
  params: {
999
1032
  schemeURL: schemeForShare
@@ -1004,6 +1037,25 @@ function AppShareListMenu() {
1004
1037
  );
1005
1038
  }
1006
1039
 
1040
+ // src/core/hooks/useMoreButtonBottomSheet/PermissionsMenu.tsx
1041
+ import { getOperationalEnvironment as getOperationalEnvironment2 } from "@apps-in-toss/native-modules";
1042
+ import { Granite as Granite6, openURL as openURL4 } from "@granite-js/react-native";
1043
+ import { jsx as jsx7 } from "react/jsx-runtime";
1044
+ function PermissionsMenu() {
1045
+ const globals = getAppsInTossGlobals();
1046
+ if (getOperationalEnvironment2() === "sandbox") {
1047
+ return null;
1048
+ }
1049
+ return /* @__PURE__ */ jsx7(
1050
+ Menu,
1051
+ {
1052
+ title: "\uAD8C\uD55C \uC124\uC815",
1053
+ iconURL: "https://static.toss.im/icons/png/4x/icon-setting-mono.png",
1054
+ onPress: () => openURL4(`servicetoss://apps-in-toss-menu/permissions?appName=${Granite6.appName}&displayAppName=${globals.brandDisplayName}`)
1055
+ }
1056
+ );
1057
+ }
1058
+
1007
1059
  // src/core/utils/ensureValue.ts
1008
1060
  function ensureValue(value, name) {
1009
1061
  if (value === void 0) {
@@ -1013,7 +1065,7 @@ function ensureValue(value, name) {
1013
1065
  }
1014
1066
 
1015
1067
  // src/core/hooks/useMoreButtonBottomSheet/index.tsx
1016
- import { Fragment as Fragment3, jsx as jsx6, jsxs as jsxs2 } from "react/jsx-runtime";
1068
+ import { Fragment as Fragment3, jsx as jsx8, jsxs as jsxs2 } from "react/jsx-runtime";
1017
1069
  var APP_BRIDGE_METHOD_NAME = "getMiniAppsSupportContact";
1018
1070
  var MIN_VERSION = {
1019
1071
  BOTTOM_SHEET: {
@@ -1023,6 +1075,10 @@ var MIN_VERSION = {
1023
1075
  SHARE_LIST_MENU: {
1024
1076
  android: "5.230.0",
1025
1077
  ios: "5.230.0"
1078
+ },
1079
+ PERMISSIONS_MENU: {
1080
+ android: "5.238.0",
1081
+ ios: "5.237.0"
1026
1082
  }
1027
1083
  };
1028
1084
  function useMoreButtonBottomSheet() {
@@ -1035,7 +1091,8 @@ function useMoreButtonBottomSheet() {
1035
1091
  const title = ensureValue(globals.brandDisplayName, "displayName");
1036
1092
  const isBottomSheetSupported = isMinVersionSupported2(MIN_VERSION.BOTTOM_SHEET);
1037
1093
  const isShareListMenuSupported = isMinVersionSupported2(MIN_VERSION.SHARE_LIST_MENU);
1038
- useEffect7(() => {
1094
+ const [isPermissionsMenuSupported, setIsPermissionsMenuSupported] = useState4(false);
1095
+ useEffect6(() => {
1039
1096
  if (!isBottomSheetSupported) {
1040
1097
  return;
1041
1098
  }
@@ -1047,6 +1104,16 @@ function useMoreButtonBottomSheet() {
1047
1104
  onError: (error) => console.error("\uBA54\uB274 \uBAA9\uB85D\uC744 \uAC00\uC838\uC624\uB294 \uB370 \uC2E4\uD328\uD588\uC5B4\uC694:", error)
1048
1105
  }
1049
1106
  );
1107
+ if (isMinVersionSupported2(MIN_VERSION.PERMISSIONS_MENU)) {
1108
+ INTERNAL__appBridgeHandler.invokeAppBridgeMethod(
1109
+ "getAllPermission",
1110
+ {},
1111
+ {
1112
+ onSuccess: (permissions) => setIsPermissionsMenuSupported(permissions.length > 0),
1113
+ onError: (error) => console.error("\uAD8C\uD55C \uBAA9\uB85D\uC744 \uAC00\uC838\uC624\uB294 \uB370 \uC2E4\uD328\uD588\uC5B4\uC694:", error)
1114
+ }
1115
+ );
1116
+ }
1050
1117
  }, [isBottomSheetSupported]);
1051
1118
  const onClickHandler = async () => {
1052
1119
  logging.open();
@@ -1062,17 +1129,17 @@ function useMoreButtonBottomSheet() {
1062
1129
  logging.close();
1063
1130
  close();
1064
1131
  };
1065
- return /* @__PURE__ */ jsx6(BottomSheetImpressionArea, { children: /* @__PURE__ */ jsx6(
1132
+ return /* @__PURE__ */ jsx8(BottomSheetImpressionArea, { children: /* @__PURE__ */ jsx8(
1066
1133
  BottomSheet.Root,
1067
1134
  {
1068
- header: /* @__PURE__ */ jsx6(
1135
+ header: /* @__PURE__ */ jsx8(
1069
1136
  ListHeader,
1070
1137
  {
1071
- title: /* @__PURE__ */ jsx6(ListHeader.TitleParagraph, { color: adaptive.grey800, fontWeight: "bold", typography: "t5", children: title })
1138
+ title: /* @__PURE__ */ jsx8(ListHeader.TitleParagraph, { color: adaptive.grey800, fontWeight: "bold", typography: "t5", children: title })
1072
1139
  }
1073
1140
  ),
1074
1141
  open: isOpen,
1075
- cta: /* @__PURE__ */ jsx6(
1142
+ cta: /* @__PURE__ */ jsx8(
1076
1143
  BottomSheet.CTA,
1077
1144
  {
1078
1145
  size: "large",
@@ -1087,36 +1154,19 @@ function useMoreButtonBottomSheet() {
1087
1154
  onClose: handleClose,
1088
1155
  onExited: exit,
1089
1156
  children: /* @__PURE__ */ jsxs2(List, { rowSeparator: "none", children: [
1090
- itemList.map((item) => {
1091
- return /* @__PURE__ */ jsx6(
1092
- ListRow2,
1157
+ itemList.map(
1158
+ (item) => /* @__PURE__ */ jsx8(
1159
+ Menu,
1093
1160
  {
1094
- left: /* @__PURE__ */ jsx6(
1095
- ListRow2.Icon,
1096
- {
1097
- color: globals.brandPrimaryColor,
1098
- source: { uri: item.contactIconUrl },
1099
- type: "background"
1100
- }
1101
- ),
1102
- contents: /* @__PURE__ */ jsx6(
1103
- ListRow2.Texts,
1104
- {
1105
- type: "1RowTypeA",
1106
- top: item.contactItemName,
1107
- topProps: { color: adaptive.grey700 }
1108
- }
1109
- ),
1110
- verticalPadding: "extraSmall",
1111
- onPress: () => {
1112
- logging.menuClick({ title: item.contactItemName });
1113
- openURL4(item.contactUri);
1114
- }
1161
+ title: item.contactItemName,
1162
+ iconURL: item.contactIconUrl,
1163
+ onPress: () => openURL5(item.contactUri)
1115
1164
  },
1116
1165
  item.contactItemName
1117
- );
1118
- }),
1119
- isShareListMenuSupported && /* @__PURE__ */ jsx6(AppShareListMenu, {})
1166
+ )
1167
+ ),
1168
+ isShareListMenuSupported && /* @__PURE__ */ jsx8(AppShareListMenu, {}),
1169
+ isPermissionsMenuSupported && /* @__PURE__ */ jsx8(PermissionsMenu, {})
1120
1170
  ] })
1121
1171
  }
1122
1172
  ) });
@@ -1126,32 +1176,37 @@ function useMoreButtonBottomSheet() {
1126
1176
  }
1127
1177
  function BottomSheetImpressionArea({ children }) {
1128
1178
  const logging = useMoreButtonBottomSheetLogging();
1129
- useEffect7(() => {
1179
+ useEffect6(() => {
1130
1180
  logging.show();
1131
1181
  }, [logging]);
1132
- return /* @__PURE__ */ jsx6(Fragment3, { children });
1182
+ return /* @__PURE__ */ jsx8(Fragment3, { children });
1183
+ }
1184
+
1185
+ // src/core/utils/toIcon.ts
1186
+ function toIcon(source) {
1187
+ return source.startsWith("http") ? { source: { uri: source } } : { name: source };
1133
1188
  }
1134
1189
 
1135
1190
  // src/components/NavigationBar/common/NavigationBarImpressionArea.tsx
1136
- import { useEffect as useEffect8, useRef as useRef3 } from "react";
1137
- import { Fragment as Fragment4, jsx as jsx7 } from "react/jsx-runtime";
1191
+ import { useEffect as useEffect7, useRef as useRef3 } from "react";
1192
+ import { Fragment as Fragment4, jsx as jsx9 } from "react/jsx-runtime";
1138
1193
  function NavigationBarImpressionArea({
1139
1194
  children,
1140
1195
  withHomeButton
1141
1196
  }) {
1142
1197
  const hasLogged = useRef3(false);
1143
1198
  const logging = useNavigationBarLogging();
1144
- useEffect8(() => {
1199
+ useEffect7(() => {
1145
1200
  if (hasLogged.current === false) {
1146
1201
  logging.navBarImpression({ home_icon_yn: withHomeButton ? "Y" : "N" });
1147
1202
  hasLogged.current = true;
1148
1203
  }
1149
1204
  }, [logging, withHomeButton]);
1150
- return /* @__PURE__ */ jsx7(Fragment4, { children });
1205
+ return /* @__PURE__ */ jsx9(Fragment4, { children });
1151
1206
  }
1152
1207
 
1153
1208
  // src/components/NavigationBar/RNNavigationBar/Default.tsx
1154
- import { jsx as jsx8 } from "react/jsx-runtime";
1209
+ import { jsx as jsx10 } from "react/jsx-runtime";
1155
1210
  function DefaultNavigationBar() {
1156
1211
  const globals = getAppsInTossGlobals();
1157
1212
  const { open: openMoreButtonBottomSheet } = useMoreButtonBottomSheet();
@@ -1161,7 +1216,7 @@ function DefaultNavigationBar() {
1161
1216
  const { navigationRightButton } = useNavigationBarContext();
1162
1217
  const navigationEvent = useNavigationEvent();
1163
1218
  useHardwareBackPress(navigationEvent.handleBack);
1164
- return /* @__PURE__ */ jsx8(NavigationBarImpressionArea, { withHomeButton, children: /* @__PURE__ */ jsx8(
1219
+ return /* @__PURE__ */ jsx10(NavigationBarImpressionArea, { withHomeButton, children: /* @__PURE__ */ jsx10(
1165
1220
  TopNavigation,
1166
1221
  {
1167
1222
  title: globals.brandDisplayName,
@@ -1172,7 +1227,8 @@ function DefaultNavigationBar() {
1172
1227
  onPressClose: navigationEvent.handleCloseButtonClick,
1173
1228
  withHome: withHomeButton,
1174
1229
  fixedRightButton: navigationRightButton,
1175
- children: /* @__PURE__ */ jsx8(NavigationLeft, { visible: withBackButton, children: /* @__PURE__ */ jsx8(NavigationBackButton, { onPress: navigationEvent.handleBack, canGoBack: false }) })
1230
+ leftVisible: withBackButton,
1231
+ children: /* @__PURE__ */ jsx10(NavigationLeft, { visible: withBackButton, children: /* @__PURE__ */ jsx10(NavigationBackButton, { onPress: navigationEvent.handleBack, canGoBack: false }) })
1176
1232
  }
1177
1233
  ) });
1178
1234
  }
@@ -1181,8 +1237,8 @@ function DefaultNavigationBar() {
1181
1237
  import { useSafeAreaInsets } from "@granite-js/native/react-native-safe-area-context";
1182
1238
  import { PageNavbar } from "@toss/tds-react-native";
1183
1239
  import { NavigationRightContent, useSafeAreaTop } from "@toss/tds-react-native/private";
1184
- import { Platform as Platform2, View as View2 } from "react-native";
1185
- import { Fragment as Fragment5, jsx as jsx9, jsxs as jsxs3 } from "react/jsx-runtime";
1240
+ import { Platform as Platform2, View as View3 } from "react-native";
1241
+ import { Fragment as Fragment5, jsx as jsx11, jsxs as jsxs3 } from "react/jsx-runtime";
1186
1242
  function GameNavigationBar() {
1187
1243
  const safeAreaTop = useSafeAreaTop();
1188
1244
  const { open: openMoreButtonBottomSheet } = useMoreButtonBottomSheet();
@@ -1191,9 +1247,9 @@ function GameNavigationBar() {
1191
1247
  const { right: safeAreaRight } = useSafeAreaInsets();
1192
1248
  useHardwareBackPress(navigationEvent.handleBack);
1193
1249
  return /* @__PURE__ */ jsxs3(Fragment5, { children: [
1194
- /* @__PURE__ */ jsx9(PageNavbar, { preference: { type: "none" } }),
1195
- /* @__PURE__ */ jsx9(
1196
- View2,
1250
+ /* @__PURE__ */ jsx11(PageNavbar, { preference: { type: "none" } }),
1251
+ /* @__PURE__ */ jsx11(
1252
+ View3,
1197
1253
  {
1198
1254
  style: {
1199
1255
  width: "100%",
@@ -1208,7 +1264,7 @@ function GameNavigationBar() {
1208
1264
  paddingRight: safeAreaRight + 10
1209
1265
  },
1210
1266
  pointerEvents: "box-none",
1211
- children: /* @__PURE__ */ jsx9(
1267
+ children: /* @__PURE__ */ jsx11(
1212
1268
  NavigationRightContent,
1213
1269
  {
1214
1270
  fixedRightButton: navigationRightButton,
@@ -1238,20 +1294,19 @@ import * as constant_bridges_star from "@apps-in-toss/native-modules/constant-br
1238
1294
  import * as event_bridges_star from "@apps-in-toss/native-modules/event-bridges";
1239
1295
 
1240
1296
  // src/components/RNAppContainer.tsx
1241
- import { Fragment as Fragment6, jsx as jsx10, jsxs as jsxs4 } from "react/jsx-runtime";
1297
+ import { Fragment as Fragment6, jsx as jsx12, jsxs as jsxs4 } from "react/jsx-runtime";
1242
1298
  function RNAppContainer({ children }) {
1243
1299
  const global2 = getAppsInTossGlobals();
1244
1300
  switch (global2.appType) {
1245
1301
  case "game":
1246
- return /* @__PURE__ */ jsx10(GameAppContainer, { children });
1302
+ return /* @__PURE__ */ jsx12(GameAppContainer, { children });
1247
1303
  case "general":
1248
1304
  default:
1249
- return /* @__PURE__ */ jsx10(GeneralAppContainer, { children });
1305
+ return /* @__PURE__ */ jsx12(GeneralAppContainer, { children });
1250
1306
  }
1251
1307
  }
1252
1308
  function GameAppContainer({ children }) {
1253
- const [isEntryMessageExited, setIsEntryMessageExited] = useState5(false);
1254
- useEffect9(() => {
1309
+ useEffect8(() => {
1255
1310
  if (Platform3.OS === "ios") {
1256
1311
  setIosSwipeGestureEnabled({ isEnabled: false });
1257
1312
  return () => {
@@ -1260,49 +1315,38 @@ function GameAppContainer({ children }) {
1260
1315
  }
1261
1316
  return;
1262
1317
  }, []);
1263
- useEffect9(() => {
1264
- appsInTossEvent2.addEventListener("entryMessageExited", {
1265
- onEvent: () => {
1266
- setIsEntryMessageExited(true);
1267
- }
1268
- });
1269
- }, []);
1270
1318
  return /* @__PURE__ */ jsxs4(Fragment6, { children: [
1271
- /* @__PURE__ */ jsx10(RNNavigationBar.Game, {}),
1272
- (0, bridge_entry_exports.getOperationalEnvironment)() === "toss" ? /* @__PURE__ */ jsx10(GameInitializer, { isReadyForProfileUI: isEntryMessageExited, children }) : children
1319
+ /* @__PURE__ */ jsx12(RNNavigationBar.Game, {}),
1320
+ (0, bridge_entry_exports.getOperationalEnvironment)() === "toss" ? /* @__PURE__ */ jsx12(GameInitializer, { children }) : children
1273
1321
  ] });
1274
1322
  }
1275
1323
  function GeneralAppContainer({ children }) {
1276
1324
  return /* @__PURE__ */ jsxs4(Fragment6, { children: [
1277
- /* @__PURE__ */ jsx10(RNNavigationBar.Default, {}),
1325
+ /* @__PURE__ */ jsx12(RNNavigationBar.Default, {}),
1278
1326
  children
1279
1327
  ] });
1280
1328
  }
1281
1329
 
1282
1330
  // src/core/registerApp.tsx
1283
- import { Fragment as Fragment7, jsx as jsx11, jsxs as jsxs5 } from "react/jsx-runtime";
1331
+ import { Fragment as Fragment7, jsx as jsx13, jsxs as jsxs5 } from "react/jsx-runtime";
1284
1332
  function AppsInTossContainer(Container, { children, ...initialProps }) {
1285
1333
  if (!isMinVersionSupported3({
1286
1334
  android: "5.220.0",
1287
1335
  ios: "5.221.0"
1288
1336
  })) {
1289
1337
  return /* @__PURE__ */ jsxs5(Fragment7, { children: [
1290
- /* @__PURE__ */ jsx11(AppEvent.Entry, {}),
1291
- /* @__PURE__ */ jsx11(AppEvent.System, { ...initialProps }),
1292
- /* @__PURE__ */ jsx11(AppUpdate, {})
1338
+ /* @__PURE__ */ jsx13(AppEvent.Entry, {}),
1339
+ /* @__PURE__ */ jsx13(AppEvent.System, { ...initialProps }),
1340
+ /* @__PURE__ */ jsx13(AppUpdate, {})
1293
1341
  ] });
1294
1342
  }
1295
1343
  return /* @__PURE__ */ jsxs5(Fragment7, { children: [
1296
- /* @__PURE__ */ jsx11(AppEvent.StayTime, {}),
1297
- /* @__PURE__ */ jsx11(AppEvent.Entry, {}),
1298
- /* @__PURE__ */ jsx11(AppEvent.System, { ...initialProps }),
1299
- /* @__PURE__ */ jsx11(Container, { ...initialProps, children: /* @__PURE__ */ jsx11(TDSProvider, { colorPreference: "light", token: { color: { primary: getAppsInTossGlobals().brandPrimaryColor } }, children: /* @__PURE__ */ jsx11(TDSContainer, { ...initialProps, children }) }) })
1344
+ /* @__PURE__ */ jsx13(AppEvent.StayTime, {}),
1345
+ /* @__PURE__ */ jsx13(AppEvent.Entry, {}),
1346
+ /* @__PURE__ */ jsx13(AppEvent.System, { ...initialProps }),
1347
+ /* @__PURE__ */ jsx13(Container, { ...initialProps, children: /* @__PURE__ */ jsx13(TDSProvider, { colorPreference: "light", token: { color: { primary: getAppsInTossGlobals().brandPrimaryColor } }, children }) })
1300
1348
  ] });
1301
1349
  }
1302
- function TDSContainer({ children }) {
1303
- useAppsInTossBridge();
1304
- return /* @__PURE__ */ jsx11(Fragment7, { children });
1305
- }
1306
1350
  function registerApp(container, { context, analytics }) {
1307
1351
  const appName = getAppName();
1308
1352
  const isRegistered = AppRegistry.getAppKeys().includes(appName);
@@ -1311,7 +1355,7 @@ function registerApp(container, { context, analytics }) {
1311
1355
  logger: (params) => void eventLog(params),
1312
1356
  debug: analytics?.debug ?? __DEV__
1313
1357
  });
1314
- const App = Granite6.registerApp(AppsInTossContainer.bind(null, container), {
1358
+ const App = Granite7.registerApp(AppsInTossContainer.bind(null, container), {
1315
1359
  appName,
1316
1360
  context,
1317
1361
  setIosSwipeGestureEnabled: setIosSwipeGestureEnabled2,
@@ -1328,7 +1372,7 @@ function registerApp(container, { context, analytics }) {
1328
1372
  }
1329
1373
  function AppsInTossScreenContainer({ children }) {
1330
1374
  const isRNApp = getAppsInTossGlobals().webViewType == null;
1331
- return /* @__PURE__ */ jsx11(NavigationBarContextProvider, { children: /* @__PURE__ */ jsx11(Analytics.Screen, { children: isRNApp ? /* @__PURE__ */ jsx11(RNAppContainer, { children }) : children }) });
1375
+ return /* @__PURE__ */ jsx13(NavigationBarContextProvider, { children: /* @__PURE__ */ jsx13(Analytics.Screen, { children: isRNApp ? /* @__PURE__ */ jsx13(RNAppContainer, { children }) : children }) });
1332
1376
  }
1333
1377
  function getAppName() {
1334
1378
  try {
@@ -1350,27 +1394,29 @@ import {
1350
1394
  GoogleAdMob,
1351
1395
  IAP,
1352
1396
  Storage,
1353
- appsInTossEvent as appsInTossEvent4,
1397
+ appsInTossEvent,
1354
1398
  iapCreateOneTimePurchaseOrder,
1355
1399
  processProductGrant,
1356
- requestOneTimePurchase
1400
+ requestOneTimePurchase,
1401
+ INTERNAL__module as INTERNAL__module6,
1402
+ getOperationalEnvironment as getOperationalEnvironment5
1357
1403
  } from "@apps-in-toss/native-modules";
1358
1404
  import * as appsInTossAsyncBridges from "@apps-in-toss/native-modules/async-bridges";
1359
1405
  import * as appsInTossConstantBridges from "@apps-in-toss/native-modules/constant-bridges";
1360
1406
  import * as appsInTossEventBridges from "@apps-in-toss/native-modules/event-bridges";
1361
1407
  import { useSafeAreaInsets as useSafeAreaInsets4 } from "@granite-js/native/react-native-safe-area-context";
1362
- import { getSchemeUri as getSchemeUri6 } from "@granite-js/react-native";
1408
+ import { getSchemeUri as getSchemeUri6, Granite as Granite8 } from "@granite-js/react-native";
1363
1409
  import { ExternalWebViewScreen, tdsEvent } from "@toss/tds-react-native";
1364
1410
  import { useSafeAreaBottom, useSafeAreaTop as useSafeAreaTop3 } from "@toss/tds-react-native/private";
1365
- import { useEffect as useEffect14, useMemo as useMemo7, useRef as useRef6, useState as useState8 } from "react";
1366
- import { BackHandler as BackHandler2, Platform as Platform6 } from "react-native";
1411
+ import { useEffect as useEffect13, useMemo as useMemo7, useRef as useRef6, useState as useState6 } from "react";
1412
+ import { BackHandler as BackHandler2, Linking, Platform as Platform6 } from "react-native";
1367
1413
 
1368
1414
  // src/components/GameWebView.tsx
1369
- import { setIosSwipeGestureEnabled as setIosSwipeGestureEnabled3, appsInTossEvent as appsInTossEvent3, getOperationalEnvironment as getOperationalEnvironment3 } from "@apps-in-toss/native-modules";
1415
+ import { setIosSwipeGestureEnabled as setIosSwipeGestureEnabled3, getOperationalEnvironment as getOperationalEnvironment4 } from "@apps-in-toss/native-modules";
1370
1416
  import {
1371
1417
  WebView as PlainWebView
1372
1418
  } from "@granite-js/native/react-native-webview";
1373
- import { forwardRef, useEffect as useEffect10, useState as useState6 } from "react";
1419
+ import { forwardRef, useEffect as useEffect9 } from "react";
1374
1420
  import { Platform as Platform5 } from "react-native";
1375
1421
 
1376
1422
  // src/components/NavigationBar/GameWebviewNavigationBar.tsx
@@ -1380,8 +1426,8 @@ import { PageNavbar as PageNavbar2, useDialog as useDialog5 } from "@toss/tds-re
1380
1426
  import { NavigationRightContent as NavigationRightContent2, useSafeAreaTop as useSafeAreaTop2 } from "@toss/tds-react-native/private";
1381
1427
  import { josa as josa3 } from "es-hangul";
1382
1428
  import { useCallback as useCallback8 } from "react";
1383
- import { Platform as Platform4, View as View3 } from "react-native";
1384
- import { Fragment as Fragment8, jsx as jsx12, jsxs as jsxs6 } from "react/jsx-runtime";
1429
+ import { Platform as Platform4, View as View4 } from "react-native";
1430
+ import { Fragment as Fragment8, jsx as jsx14, jsxs as jsxs6 } from "react/jsx-runtime";
1385
1431
  function GameWebviewNavigationBar() {
1386
1432
  const safeAreaTop = useSafeAreaTop2();
1387
1433
  const { openConfirm } = useDialog5();
@@ -1407,9 +1453,9 @@ function GameWebviewNavigationBar() {
1407
1453
  }
1408
1454
  }, [captureExitLog, global2.brandDisplayName, logging, openConfirm]);
1409
1455
  return /* @__PURE__ */ jsxs6(Fragment8, { children: [
1410
- /* @__PURE__ */ jsx12(PageNavbar2, { preference: { type: "none" } }),
1411
- /* @__PURE__ */ jsx12(
1412
- View3,
1456
+ /* @__PURE__ */ jsx14(PageNavbar2, { preference: { type: "none" } }),
1457
+ /* @__PURE__ */ jsx14(
1458
+ View4,
1413
1459
  {
1414
1460
  style: {
1415
1461
  width: "100%",
@@ -1424,7 +1470,7 @@ function GameWebviewNavigationBar() {
1424
1470
  paddingRight: safeAreaRight + 10
1425
1471
  },
1426
1472
  pointerEvents: "box-none",
1427
- children: /* @__PURE__ */ jsx12(
1473
+ children: /* @__PURE__ */ jsx14(
1428
1474
  NavigationRightContent2,
1429
1475
  {
1430
1476
  fixedRightButton: navigationRightButton,
@@ -1441,10 +1487,9 @@ function GameWebviewNavigationBar() {
1441
1487
  }
1442
1488
 
1443
1489
  // src/components/GameWebView.tsx
1444
- import { Fragment as Fragment9, jsx as jsx13, jsxs as jsxs7 } from "react/jsx-runtime";
1490
+ import { Fragment as Fragment9, jsx as jsx15, jsxs as jsxs7 } from "react/jsx-runtime";
1445
1491
  var GameWebView = forwardRef(function GameWebView2(props, ref) {
1446
- const [isEntryMessageExited, setIsEntryMessageExited] = useState6(false);
1447
- useEffect10(() => {
1492
+ useEffect9(() => {
1448
1493
  if (Platform5.OS === "ios") {
1449
1494
  setIosSwipeGestureEnabled3({ isEnabled: false });
1450
1495
  return () => {
@@ -1453,16 +1498,9 @@ var GameWebView = forwardRef(function GameWebView2(props, ref) {
1453
1498
  }
1454
1499
  return;
1455
1500
  }, []);
1456
- useEffect10(() => {
1457
- appsInTossEvent3.addEventListener("entryMessageExited", {
1458
- onEvent: () => {
1459
- setIsEntryMessageExited(true);
1460
- }
1461
- });
1462
- }, []);
1463
1501
  return /* @__PURE__ */ jsxs7(Fragment9, { children: [
1464
- /* @__PURE__ */ jsx13(GameWebviewNavigationBar, {}),
1465
- getOperationalEnvironment3() === "toss" ? /* @__PURE__ */ jsx13(GameInitializer, { isReadyForProfileUI: isEntryMessageExited, children: /* @__PURE__ */ jsx13(PlainWebView, { ref, ...props }) }) : /* @__PURE__ */ jsx13(PlainWebView, { ref, ...props })
1502
+ /* @__PURE__ */ jsx15(GameWebviewNavigationBar, {}),
1503
+ getOperationalEnvironment4() === "toss" ? /* @__PURE__ */ jsx15(GameInitializer, { children: /* @__PURE__ */ jsx15(PlainWebView, { ref, ...props }) }) : /* @__PURE__ */ jsx15(PlainWebView, { ref, ...props })
1466
1504
  ] });
1467
1505
  });
1468
1506
 
@@ -1478,7 +1516,7 @@ import { useDialog as useDialog6 } from "@toss/tds-react-native";
1478
1516
  import { NavigationBackButton as NavigationBackButton2, NavigationLeft as NavigationLeft2, TopNavigation as TopNavigation2 } from "@toss/tds-react-native/private";
1479
1517
  import { josa as josa4 } from "es-hangul";
1480
1518
  import { useCallback as useCallback9 } from "react";
1481
- import { jsx as jsx14 } from "react/jsx-runtime";
1519
+ import { jsx as jsx16 } from "react/jsx-runtime";
1482
1520
  function PartnerWebviewNavigationBar({ onBackButtonClick, onHomeButtonClick }) {
1483
1521
  const globals = getAppsInTossGlobals();
1484
1522
  const { captureExitLog } = useCaptureExitLog();
@@ -1504,7 +1542,7 @@ function PartnerWebviewNavigationBar({ onBackButtonClick, onHomeButtonClick }) {
1504
1542
  closeView5();
1505
1543
  }
1506
1544
  }, [captureExitLog, globals.brandDisplayName, logging, openConfirm]);
1507
- return /* @__PURE__ */ jsx14(NavigationBarImpressionArea, { withHomeButton, children: /* @__PURE__ */ jsx14(
1545
+ return /* @__PURE__ */ jsx16(NavigationBarImpressionArea, { withHomeButton, children: /* @__PURE__ */ jsx16(
1508
1546
  TopNavigation2,
1509
1547
  {
1510
1548
  title: globals.brandDisplayName,
@@ -1515,22 +1553,36 @@ function PartnerWebviewNavigationBar({ onBackButtonClick, onHomeButtonClick }) {
1515
1553
  onPressClose: handleClose,
1516
1554
  withHome: withHomeButton,
1517
1555
  fixedRightButton: navigationRightButton,
1518
- children: /* @__PURE__ */ jsx14(NavigationLeft2, { visible: withBackButton, children: /* @__PURE__ */ jsx14(NavigationBackButton2, { onPress: onBackButtonClick, canGoBack: false }) })
1556
+ leftVisible: withBackButton,
1557
+ children: /* @__PURE__ */ jsx16(NavigationLeft2, { visible: withBackButton, children: /* @__PURE__ */ jsx16(NavigationBackButton2, { onPress: onBackButtonClick, canGoBack: false }) })
1519
1558
  }
1520
1559
  ) });
1521
1560
  }
1522
1561
 
1523
1562
  // src/components/PartnerWebView.tsx
1524
- import { Fragment as Fragment10, jsx as jsx15, jsxs as jsxs8 } from "react/jsx-runtime";
1563
+ import { Fragment as Fragment10, jsx as jsx17, jsxs as jsxs8 } from "react/jsx-runtime";
1525
1564
  var PartnerWebView = forwardRef2(function PartnerWebViewScreen({ onBackButtonClick, onHomeButtonClick, ...webViewProps }, ref) {
1526
1565
  return /* @__PURE__ */ jsxs8(Fragment10, { children: [
1527
- /* @__PURE__ */ jsx15(PartnerWebviewNavigationBar, { onBackButtonClick, onHomeButtonClick }),
1528
- /* @__PURE__ */ jsx15(PlainWebView2, { ref, ...webViewProps, style: { flex: 1 } })
1566
+ /* @__PURE__ */ jsx17(PartnerWebviewNavigationBar, { onBackButtonClick, onHomeButtonClick }),
1567
+ /* @__PURE__ */ jsx17(PlainWebView2, { ref, ...webViewProps, style: { flex: 1 } })
1529
1568
  ] });
1530
1569
  });
1531
1570
 
1571
+ // src/components/utils/url.ts
1572
+ function convertIntentURL(url) {
1573
+ if (url.protocol !== "intent:") {
1574
+ return null;
1575
+ }
1576
+ const components = url.hash.replace("#Intent;", "").split(";").map((component) => component.split("="));
1577
+ const scheme = components.find(([key]) => key === "scheme")?.[1];
1578
+ if (!scheme) {
1579
+ return null;
1580
+ }
1581
+ return `${scheme}://${url.hostname}${url.pathname}${url.search}`;
1582
+ }
1583
+
1532
1584
  // src/bridge-handler/useBridgeHandler.tsx
1533
- import { useCallback as useCallback10, useEffect as useEffect11, useMemo as useMemo3, useRef as useRef4 } from "react";
1585
+ import { useCallback as useCallback10, useEffect as useEffect10, useMemo as useMemo3, useRef as useRef4 } from "react";
1534
1586
  function serializeError(error) {
1535
1587
  return JSON.stringify(error, (_, value) => {
1536
1588
  if (value instanceof Error) {
@@ -1595,7 +1647,7 @@ function useBridgeHandler({
1595
1647
  )};`,
1596
1648
  [constantHandlerMap]
1597
1649
  );
1598
- useEffect11(() => {
1650
+ useEffect10(() => {
1599
1651
  ref.current?.injectJavaScript(injectedJavaScript);
1600
1652
  }, [injectedJavaScript]);
1601
1653
  const createHandleOnEvent = (functionName, eventId) => (response) => {
@@ -1669,7 +1721,7 @@ function parseNativeEventData(data) {
1669
1721
 
1670
1722
  // src/core/hooks/useSafeAreaInsetsEmitter.tsx
1671
1723
  import { useSafeAreaInsets as useSafeAreaInsets3 } from "@granite-js/native/react-native-safe-area-context";
1672
- import { useEffect as useEffect12, useMemo as useMemo4 } from "react";
1724
+ import { useEffect as useEffect11, useMemo as useMemo4 } from "react";
1673
1725
  var EventEmitter = class {
1674
1726
  listeners = {};
1675
1727
  on(event, listener) {
@@ -1694,7 +1746,7 @@ var EventEmitter = class {
1694
1746
  function useSafeAreaInsetsEmitter() {
1695
1747
  const insets = useSafeAreaInsets3();
1696
1748
  const emitter = useMemo4(() => new EventEmitter(), []);
1697
- useEffect12(() => {
1749
+ useEffect11(() => {
1698
1750
  emitter.emit("safeAreaInsetsChange", insets);
1699
1751
  return () => {
1700
1752
  emitter.off("safeAreaInsetsChange", (listener) => listener(insets));
@@ -1994,6 +2046,7 @@ function useCreateUserAgent({
1994
2046
  const fontA11y = mapFontScaleToCategory(fontScale, platform);
1995
2047
  const normalizedFontScale = convertToAndroidStyleScale(fontScale, platform);
1996
2048
  return [
2049
+ "AppsInToss",
1997
2050
  `TossApp/${appVersion}`,
1998
2051
  batteryModePreference && `TossBatteryModePreference/${batteryModePreference}`,
1999
2052
  colorPreference && `TossColorPreference/${colorPreference}`,
@@ -2011,11 +2064,11 @@ function useCreateUserAgent({
2011
2064
  // src/hooks/useGeolocation.ts
2012
2065
  import { startUpdateLocation } from "@apps-in-toss/native-modules";
2013
2066
  import { useVisibility as useVisibility3 } from "@granite-js/react-native";
2014
- import { useEffect as useEffect13, useState as useState7 } from "react";
2067
+ import { useEffect as useEffect12, useState as useState5 } from "react";
2015
2068
  function useGeolocation({ accuracy, distanceInterval, timeInterval }) {
2016
2069
  const isVisible = useVisibility3();
2017
- const [location, setLocation] = useState7(null);
2018
- useEffect13(() => {
2070
+ const [location, setLocation] = useState5(null);
2071
+ useEffect12(() => {
2019
2072
  if (!isVisible) {
2020
2073
  return;
2021
2074
  }
@@ -2121,7 +2174,7 @@ var trackScreen = (url) => {
2121
2174
  };
2122
2175
 
2123
2176
  // src/components/WebView.tsx
2124
- import { jsx as jsx16 } from "react/jsx-runtime";
2177
+ import { jsx as jsx18 } from "react/jsx-runtime";
2125
2178
  var operationalEnvironment = appsInTossConstantBridges.getOperationalEnvironment();
2126
2179
  var TYPES = ["partner", "external", "game"];
2127
2180
  var WEBVIEW_TYPES = {
@@ -2164,12 +2217,11 @@ function WebView({ type, local, onMessage, ...props }) {
2164
2217
  const global2 = getAppsInTossGlobals();
2165
2218
  const navigationBarContext = useNavigationBarContext();
2166
2219
  const safeAreaInsetsEmitter = useSafeAreaInsetsEmitter();
2167
- const [allowsBackForwardNavigationGestures, setAllowsBackForwardNavigationGestures] = useState8(
2220
+ const [allowsBackForwardNavigationGestures, setAllowsBackForwardNavigationGestures] = useState6(
2168
2221
  props.allowsBackForwardNavigationGestures
2169
2222
  );
2170
2223
  const handler = useBridgeHandler({
2171
2224
  onMessage,
2172
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
2173
2225
  eventListenerMap: {
2174
2226
  ...appsInTossEventBridges,
2175
2227
  navigationAccessoryEvent: ({ onEvent, onError }) => tdsEvent.addEventListener("navigationAccessoryEvent", { onEvent, onError }),
@@ -2179,8 +2231,7 @@ function WebView({ type, local, onMessage, ...props }) {
2179
2231
  webBackHandler.removeEventListener(onEvent);
2180
2232
  };
2181
2233
  },
2182
- entryMessageExited: ({ onEvent, onError }) => appsInTossEvent4.addEventListener("entryMessageExited", { onEvent, onError }),
2183
- updateLocationEvent: ({ onEvent, onError, options }) => appsInTossEvent4.addEventListener("updateLocationEvent", { onEvent, onError, options }),
2234
+ updateLocationEvent: ({ onEvent, onError, options }) => appsInTossEvent.addEventListener("updateLocationEvent", { onEvent, onError, options }),
2184
2235
  safeAreaInsetsChange: ({ onEvent }) => {
2185
2236
  safeAreaInsetsEmitter.on("safeAreaInsetsChange", onEvent);
2186
2237
  return () => {
@@ -2188,7 +2239,7 @@ function WebView({ type, local, onMessage, ...props }) {
2188
2239
  };
2189
2240
  },
2190
2241
  /** @internal */
2191
- appBridgeCallbackEvent: ({ onEvent, onError, options }) => appsInTossEvent4.addEventListener("appBridgeCallbackEvent", { onEvent, onError, options }),
2242
+ appBridgeCallbackEvent: ({ onEvent, onError, options }) => appsInTossEvent.addEventListener("appBridgeCallbackEvent", { onEvent, onError, options }),
2192
2243
  /** AdMob */
2193
2244
  loadAdMobInterstitialAd: GoogleAdMob.loadAdMobInterstitialAd,
2194
2245
  showAdMobInterstitialAd: GoogleAdMob.showAdMobInterstitialAd,
@@ -2248,7 +2299,9 @@ function WebView({ type, local, onMessage, ...props }) {
2248
2299
  processProductGrant,
2249
2300
  getPendingOrders: IAP.getPendingOrders,
2250
2301
  getCompletedOrRefundedOrders: IAP.getCompletedOrRefundedOrders,
2251
- completeProductGrant: IAP.completeProductGrant
2302
+ completeProductGrant: IAP.completeProductGrant,
2303
+ /* Private */
2304
+ memoryDebugEventLog: webViewMemoryDebugLog
2252
2305
  }
2253
2306
  });
2254
2307
  const headerPropForExternalWebView = useMemo7(() => {
@@ -2272,7 +2325,7 @@ function WebView({ type, local, onMessage, ...props }) {
2272
2325
  colorPreference: "light"
2273
2326
  });
2274
2327
  const refs = mergeRefs(handler.ref, webViewRef);
2275
- useEffect14(() => {
2328
+ useEffect13(() => {
2276
2329
  const callback = () => {
2277
2330
  webBackHandler.handleWebBack();
2278
2331
  return true;
@@ -2281,7 +2334,7 @@ function WebView({ type, local, onMessage, ...props }) {
2281
2334
  return () => BackHandler2.removeEventListener("hardwareBackPress", callback);
2282
2335
  }, [webBackHandler]);
2283
2336
  const globalScripts = useGlobalScripts();
2284
- return /* @__PURE__ */ jsx16(
2337
+ return /* @__PURE__ */ jsx18(
2285
2338
  BaseWebView,
2286
2339
  {
2287
2340
  ref: refs,
@@ -2311,10 +2364,64 @@ function WebView({ type, local, onMessage, ...props }) {
2311
2364
  injectedJavaScript: globalScripts.afterLoad,
2312
2365
  injectedJavaScriptBeforeContentLoaded: mergeScripts(handler.injectedJavaScript, globalScripts.beforeLoad),
2313
2366
  decelerationRate: Platform6.OS === "ios" ? 1 : void 0,
2314
- allowsBackForwardNavigationGestures
2367
+ allowsBackForwardNavigationGestures,
2368
+ onShouldStartLoadWithRequest: (event) => {
2369
+ try {
2370
+ const url = new URL(event.url);
2371
+ if (["https:", "http:"].includes(url.protocol)) {
2372
+ return true;
2373
+ } else {
2374
+ Linking.openURL(convertIntentURL(url) ?? url.href);
2375
+ return false;
2376
+ }
2377
+ } catch (error) {
2378
+ console.error(error);
2379
+ return false;
2380
+ }
2381
+ },
2382
+ originWhitelist: [
2383
+ "https://*",
2384
+ "http://*",
2385
+ "intoss://*",
2386
+ "intoss-private://*",
2387
+ "servicetoss://*",
2388
+ "supertoss://*",
2389
+ "intent://*"
2390
+ ],
2391
+ onContentProcessDidTerminate: (event) => {
2392
+ webViewProcessDidTerminateEventLog(event.nativeEvent.url);
2393
+ webViewRef.current?.reload();
2394
+ },
2395
+ onRenderProcessGone: () => {
2396
+ webViewProcessDidTerminateEventLog();
2397
+ webViewRef.current?.reload();
2398
+ }
2315
2399
  }
2316
2400
  );
2317
2401
  }
2402
+ async function webViewMemoryDebugLog(params) {
2403
+ webViewDebugLog("AppsInTossWebViewMemoryDebug", params);
2404
+ }
2405
+ function webViewProcessDidTerminateEventLog(url) {
2406
+ webViewDebugLog("AppsInTossWebViewProcessDidTerminate", { url });
2407
+ }
2408
+ function webViewDebugLog(logName, params) {
2409
+ const global2 = getAppsInTossGlobals();
2410
+ const event = {
2411
+ log_name: logName,
2412
+ log_type: "debug",
2413
+ params: {
2414
+ ...params,
2415
+ app_name: Granite8.appName,
2416
+ deployment_id: global2.deploymentId
2417
+ }
2418
+ };
2419
+ if (getOperationalEnvironment5() === "toss") {
2420
+ INTERNAL__module6.tossCoreEventLog(event);
2421
+ } else {
2422
+ console.log("[webViewDebugLog]", event);
2423
+ }
2424
+ }
2318
2425
  function useGlobalScripts() {
2319
2426
  const global2 = getAppsInTossGlobals();
2320
2427
  const disableTextSelectionCSS = `