@chrryai/chrry 1.2.21 → 1.2.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -474,6 +474,10 @@ var init_locales = __esm({
474
474
  // utils/siteConfig.ts
475
475
  function detectSiteMode(hostname) {
476
476
  const host = hostname || (typeof window !== "undefined" ? window.location.hostname : "");
477
+ console.log(
478
+ `\u{1F680} ~ file: siteConfig.ts:268 ~ process.env.NEXT_PUBLIC_SITE_MODE:`,
479
+ process.env.NEXT_PUBLIC_SITE_MODE
480
+ );
477
481
  if (process.env.NEXT_PUBLIC_SITE_MODE === "chrryDev") {
478
482
  return "chrryDev";
479
483
  }
@@ -483,18 +487,6 @@ function detectSiteMode(hostname) {
483
487
  if (process.env.NEXT_PUBLIC_SITE_MODE === "chrryStore") {
484
488
  return "chrryStore";
485
489
  }
486
- if (process.env.NEXT_PUBLIC_SITE_MODE === "chrryVex") {
487
- return "chrryVex";
488
- }
489
- if (host.includes("vex.chrry.ai")) {
490
- return "chrryVex";
491
- }
492
- if (host.includes("chrry.dev")) {
493
- return "chrryDev";
494
- }
495
- if (host.includes("chrryAI.dev")) {
496
- return "chrryAI";
497
- }
498
490
  return "vex";
499
491
  }
500
492
  function getSiteConfig(m) {
@@ -16498,7 +16490,9 @@ var init_i18n = __esm({
16498
16490
  safeLang = LANGUAGES.some((x) => x.code === lang) ? lang : "en";
16499
16491
  try {
16500
16492
  storage.setItem("language", safeLang);
16501
- BrowserInstance?.storage?.local?.set({ language: safeLang });
16493
+ if (BrowserInstance?.storage?.local?.set) {
16494
+ BrowserInstance.storage.local.set({ language: safeLang });
16495
+ }
16502
16496
  } catch (error) {
16503
16497
  console.log("Error saving language to storage:", error);
16504
16498
  }
@@ -16863,7 +16857,6 @@ function AuthProvider({
16863
16857
  } = useSWR(
16864
16858
  fingerprint && deviceId && shouldFetchSession ? ["session", env] : null,
16865
16859
  async () => {
16866
- const appSlug = void 0;
16867
16860
  const result = await getSession({
16868
16861
  deviceId,
16869
16862
  fingerprint,
@@ -16873,7 +16866,7 @@ function AuthProvider({
16873
16866
  API_URL: API_URL2,
16874
16867
  VERSION: VERSION2,
16875
16868
  token: token || fingerprint,
16876
- appSlug,
16869
+ appSlug: app?.slug || baseApp?.slug,
16877
16870
  agentName,
16878
16871
  chrryUrl
16879
16872
  });
@@ -16939,6 +16932,7 @@ function AuthProvider({
16939
16932
  return getAlterNativeDomains(item.store).includes(chrryUrl) || item.store.domain === chrryUrl;
16940
16933
  });
16941
16934
  const [app, setAppInternal] = useState7(baseApp || session2?.app);
16935
+ console.log(`\u{1F680} ~ file: AuthProvider.tsx:790 ~ baseApp:`, baseApp);
16942
16936
  const [apps, setApps] = useState7(store?.apps || []);
16943
16937
  useEffect7(() => {
16944
16938
  if (app?.store?.apps && app?.store?.apps.length) {
@@ -17338,7 +17332,7 @@ function DataProvider({
17338
17332
  const [instructions, setInstructions] = useState8([]);
17339
17333
  const [affiliateStats, setAffiliateStats] = useState8(null);
17340
17334
  const [loadingAffiliateStats, setLoadingAffiliateStats] = useState8(false);
17341
- const VERSION3 = "1.2.21";
17335
+ const VERSION3 = "1.2.22";
17342
17336
  const [weather, setWeather] = useLocalStorage("weather", user?.weather || guest?.weather || void 0);
17343
17337
  const {
17344
17338
  API_URL: API_URL2,
@@ -18314,9 +18308,18 @@ var init_utils = __esm({
18314
18308
  window.history.replaceState({}, "", newUrl);
18315
18309
  };
18316
18310
  isFirefox = typeof navigator !== "undefined" && navigator?.userAgent.includes("Firefox");
18317
- VERSION = "1.2.21";
18311
+ VERSION = "1.2.22";
18318
18312
  getSlugFromPathname = (path) => {
18319
18313
  const siteConfig = getSiteConfig();
18314
+ console.log(
18315
+ `\u{1F680} ~ file: index.ts:348 ~ siteConfig.slug:`,
18316
+ getAppAndStoreSlugs(path, {
18317
+ defaultAppSlug: siteConfig.slug,
18318
+ defaultStoreSlug: siteConfig.storeSlug,
18319
+ excludedRoutes: excludedSlugRoutes,
18320
+ locales
18321
+ })
18322
+ );
18320
18323
  return getAppAndStoreSlugs(path, {
18321
18324
  defaultAppSlug: siteConfig.slug,
18322
18325
  defaultStoreSlug: siteConfig.storeSlug,