@chrryai/chrry 1.1.84 → 1.1.85
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.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +100 -70
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +100 -70
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1278,7 +1278,7 @@ declare const isFirefox: boolean;
|
|
|
1278
1278
|
declare function getFlag({ code }: {
|
|
1279
1279
|
code?: string;
|
|
1280
1280
|
}): string;
|
|
1281
|
-
declare const VERSION = "1.1.
|
|
1281
|
+
declare const VERSION = "1.1.85";
|
|
1282
1282
|
type instructionBase = {
|
|
1283
1283
|
id: string;
|
|
1284
1284
|
title: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -1278,7 +1278,7 @@ declare const isFirefox: boolean;
|
|
|
1278
1278
|
declare function getFlag({ code }: {
|
|
1279
1279
|
code?: string;
|
|
1280
1280
|
}): string;
|
|
1281
|
-
declare const VERSION = "1.1.
|
|
1281
|
+
declare const VERSION = "1.1.85";
|
|
1282
1282
|
type instructionBase = {
|
|
1283
1283
|
id: string;
|
|
1284
1284
|
title: string;
|
package/dist/index.js
CHANGED
|
@@ -729,7 +729,7 @@ var init_utils = __esm({
|
|
|
729
729
|
}
|
|
730
730
|
};
|
|
731
731
|
isFirefox = typeof navigator !== "undefined" && navigator?.userAgent.includes("Firefox");
|
|
732
|
-
VERSION = "1.1.
|
|
732
|
+
VERSION = "1.1.85";
|
|
733
733
|
getInstructionConfig = ({
|
|
734
734
|
city,
|
|
735
735
|
country,
|
|
@@ -15056,7 +15056,7 @@ function AuthProvider({
|
|
|
15056
15056
|
if (!slugFromPath) return void 0;
|
|
15057
15057
|
return apps2.find((app2) => app2.slug === slugFromPath);
|
|
15058
15058
|
};
|
|
15059
|
-
const [
|
|
15059
|
+
const [store, setStore] = (0, import_react13.useState)(
|
|
15060
15060
|
session2?.app?.store
|
|
15061
15061
|
);
|
|
15062
15062
|
const {
|
|
@@ -15133,18 +15133,16 @@ function AuthProvider({
|
|
|
15133
15133
|
sessionData?.apps || []
|
|
15134
15134
|
);
|
|
15135
15135
|
const chrry = allApps?.find((app2) => !app2.store?.parentStoreId);
|
|
15136
|
-
const [appInternal, setAppInternal] = (0, import_react13.useState)(session2?.app);
|
|
15137
15136
|
const baseApp = allApps?.find(
|
|
15138
15137
|
(item) => item?.store?.domain === chrryUrl2 && item?.id === item?.store?.appId
|
|
15139
15138
|
);
|
|
15140
|
-
const app =
|
|
15141
|
-
const store = storeInternal;
|
|
15139
|
+
const [app, setAppInternal] = (0, import_react13.useState)(baseApp || session2?.app);
|
|
15142
15140
|
const [apps, setApps] = (0, import_react13.useState)(store?.apps || []);
|
|
15143
15141
|
(0, import_react13.useEffect)(() => {
|
|
15144
|
-
if (store?.apps) {
|
|
15145
|
-
setApps(store
|
|
15142
|
+
if (app?.store?.apps && app?.store?.apps.length) {
|
|
15143
|
+
setApps(app?.store?.apps);
|
|
15146
15144
|
}
|
|
15147
|
-
}, [
|
|
15145
|
+
}, [app]);
|
|
15148
15146
|
const storeApp = app?.store?.apps.find(
|
|
15149
15147
|
(item) => item.id === app?.store?.appId
|
|
15150
15148
|
);
|
|
@@ -15164,7 +15162,6 @@ function AuthProvider({
|
|
|
15164
15162
|
if (!baseApp || !allApps) return;
|
|
15165
15163
|
const matchedApp = findAppByPathname(pathname, allApps) || baseApp;
|
|
15166
15164
|
if (matchedApp) {
|
|
15167
|
-
console.log(`\u{1F680} ~ file: AuthProvider.tsx:880 ~ matchedApp:`, matchedApp);
|
|
15168
15165
|
setApp(matchedApp);
|
|
15169
15166
|
setStore(matchedApp.store);
|
|
15170
15167
|
let currentStoreApps = [];
|
|
@@ -15183,8 +15180,8 @@ function AuthProvider({
|
|
|
15183
15180
|
currentStoreAppsCount: currentStoreApps.length,
|
|
15184
15181
|
currentStoreAppsSlugs: currentStoreApps.map((a) => a.slug)
|
|
15185
15182
|
});
|
|
15186
|
-
const chrryApp = allApps?.find((a) => a.
|
|
15187
|
-
const hasChrry = currentStoreApps.some((a) => a.
|
|
15183
|
+
const chrryApp = allApps?.find((a) => a.id === chrry?.id);
|
|
15184
|
+
const hasChrry = currentStoreApps.some((a) => a.id === chrry?.id);
|
|
15188
15185
|
let finalApps = currentStoreApps;
|
|
15189
15186
|
if (!hasChrry && chrryApp && currentStoreApps.length > 0) {
|
|
15190
15187
|
finalApps = [
|
|
@@ -15513,6 +15510,7 @@ function getSiteConfig(m) {
|
|
|
15513
15510
|
mode: "chrryDev",
|
|
15514
15511
|
name: "Chrry",
|
|
15515
15512
|
domain: "chrry.dev",
|
|
15513
|
+
email: "iliyan@chrry.ai",
|
|
15516
15514
|
description: "A modern, cross-platform UI library for React, React Native, and Next.js",
|
|
15517
15515
|
logo: "/assets/cherry-logo.svg",
|
|
15518
15516
|
// Cross-platform SVG
|
|
@@ -15589,6 +15587,7 @@ function getSiteConfig(m) {
|
|
|
15589
15587
|
mode: "chrryAI",
|
|
15590
15588
|
name: "Chrry",
|
|
15591
15589
|
domain: "chrry.ai",
|
|
15590
|
+
email: "iliyan@chrry.ai",
|
|
15592
15591
|
description: "AI App Marketplace - Discover, create, and monetize AI apps",
|
|
15593
15592
|
logo: "\u{1F352}",
|
|
15594
15593
|
primaryColor: "#E91E63",
|
|
@@ -15662,6 +15661,7 @@ function getSiteConfig(m) {
|
|
|
15662
15661
|
mode: "vex",
|
|
15663
15662
|
name: "Vex",
|
|
15664
15663
|
domain: "askvex.com",
|
|
15664
|
+
email: "contact@askvex.com",
|
|
15665
15665
|
description: "AI assistant that helps you get things done",
|
|
15666
15666
|
logo: "\u{1F916}",
|
|
15667
15667
|
primaryColor: "#6366F1",
|
|
@@ -15753,7 +15753,7 @@ function DataProvider({
|
|
|
15753
15753
|
const [instructions, setInstructions] = (0, import_react15.useState)([]);
|
|
15754
15754
|
const [affiliateStats, setAffiliateStats] = (0, import_react15.useState)(null);
|
|
15755
15755
|
const [loadingAffiliateStats, setLoadingAffiliateStats] = (0, import_react15.useState)(false);
|
|
15756
|
-
const VERSION3 = "1.1.
|
|
15756
|
+
const VERSION3 = "1.1.85";
|
|
15757
15757
|
const [weather, setWeather] = useLocalStorage2("weather", user?.weather || guest?.weather || void 0);
|
|
15758
15758
|
const {
|
|
15759
15759
|
API_URL: API_URL2,
|
|
@@ -16677,7 +16677,8 @@ function AppProvider({
|
|
|
16677
16677
|
isRemovingApp,
|
|
16678
16678
|
owningApps,
|
|
16679
16679
|
stores,
|
|
16680
|
-
store
|
|
16680
|
+
store,
|
|
16681
|
+
baseApp
|
|
16681
16682
|
}
|
|
16682
16683
|
},
|
|
16683
16684
|
children
|
|
@@ -16756,7 +16757,7 @@ function ChatProvider({
|
|
|
16756
16757
|
const [isEmpty, setIsEmpty] = (0, import_react19.useState)(true);
|
|
16757
16758
|
const [thread2, setThread] = (0, import_react19.useState)(void 0);
|
|
16758
16759
|
const [messages, setMessages] = (0, import_react19.useState)([]);
|
|
16759
|
-
const { pathname } = useNavigation();
|
|
16760
|
+
const { pathname, addParams } = useNavigation();
|
|
16760
16761
|
const [threadId, setThreadId] = (0, import_react19.useState)(getThreadId(pathname));
|
|
16761
16762
|
(0, import_react19.useEffect)(() => {
|
|
16762
16763
|
setThreadId(getThreadId(pathname));
|
|
@@ -16871,6 +16872,42 @@ function ChatProvider({
|
|
|
16871
16872
|
setSelectedAgent(void 0);
|
|
16872
16873
|
}
|
|
16873
16874
|
}, [aiAgents, selectedAgent, user, guest]);
|
|
16875
|
+
const [isAgentModalOpen, setIsAgentModalOpenInternal] = (0, import_react19.useState)(false);
|
|
16876
|
+
const [isDebateAgentModalOpen, setIsDebateAgentModalOpenInternal] = (0, import_react19.useState)(false);
|
|
16877
|
+
const setIsAgentModalOpen = (open) => {
|
|
16878
|
+
setIsAgentModalOpenInternal(open);
|
|
16879
|
+
if (!open) {
|
|
16880
|
+
setIsDebateAgentModalOpenInternal(false);
|
|
16881
|
+
}
|
|
16882
|
+
open && track({
|
|
16883
|
+
name: "agent-modal",
|
|
16884
|
+
props: {}
|
|
16885
|
+
});
|
|
16886
|
+
};
|
|
16887
|
+
const setIsDebateAgentModalOpen = (open) => {
|
|
16888
|
+
setIsDebateAgentModalOpenInternal(open);
|
|
16889
|
+
setIsAgentModalOpenInternal(open);
|
|
16890
|
+
open && track({
|
|
16891
|
+
name: "debate-agent-modal",
|
|
16892
|
+
props: {}
|
|
16893
|
+
});
|
|
16894
|
+
};
|
|
16895
|
+
(0, import_react19.useEffect)(() => {
|
|
16896
|
+
if (app?.onlyAgent) {
|
|
16897
|
+
const a = aiAgents.find(
|
|
16898
|
+
(agent) => app?.defaultModel && agent.name.toLowerCase() === app?.defaultModel?.toLowerCase()
|
|
16899
|
+
);
|
|
16900
|
+
if (!a) return;
|
|
16901
|
+
if (!isAgentAuthorized(a)) {
|
|
16902
|
+
addParams({
|
|
16903
|
+
subscribe: "true",
|
|
16904
|
+
plan: "member"
|
|
16905
|
+
});
|
|
16906
|
+
return;
|
|
16907
|
+
}
|
|
16908
|
+
setSelectedAgent(a);
|
|
16909
|
+
}
|
|
16910
|
+
}, [guest, user, app, aiAgents]);
|
|
16874
16911
|
const { isDevelopment: isDevelopment3, isE2E: isE2E2 } = useData();
|
|
16875
16912
|
const hourlyLimit = isDevelopment3 && !isE2E2 ? 5e4 : getHourlyLimit({
|
|
16876
16913
|
member: user,
|
|
@@ -16939,6 +16976,8 @@ function ChatProvider({
|
|
|
16939
16976
|
value: {
|
|
16940
16977
|
setIsWebSearchEnabled,
|
|
16941
16978
|
input,
|
|
16979
|
+
setIsAgentModalOpen,
|
|
16980
|
+
isAgentModalOpen,
|
|
16942
16981
|
creditsLeft,
|
|
16943
16982
|
aiAgents,
|
|
16944
16983
|
setInput,
|
|
@@ -16971,7 +17010,10 @@ function ChatProvider({
|
|
|
16971
17010
|
favouriteAgent,
|
|
16972
17011
|
messages,
|
|
16973
17012
|
setMessages,
|
|
16974
|
-
isAgentAuthorized
|
|
17013
|
+
isAgentAuthorized,
|
|
17014
|
+
setIsDebateAgentModalOpen,
|
|
17015
|
+
isDebateAgentModalOpen,
|
|
17016
|
+
setIsAgentModalOpenInternal
|
|
16975
17017
|
}
|
|
16976
17018
|
},
|
|
16977
17019
|
children
|
|
@@ -19413,7 +19455,8 @@ function ImageComponent(props) {
|
|
|
19413
19455
|
let finalSize = parseInt(size?.toString() || finalWidth.toString());
|
|
19414
19456
|
finalSize = finalSize;
|
|
19415
19457
|
if (app?.onlyAgent && !app.image) {
|
|
19416
|
-
|
|
19458
|
+
const color = COLORS[app?.themeColor] || "var(--accent-6)";
|
|
19459
|
+
return app.defaultModel === "deepSeek" ? /* @__PURE__ */ import_react32.default.createElement(import_icons3.DeepSeek, { color, size: finalSize }) : app.defaultModel === "chatGPT" ? /* @__PURE__ */ import_react32.default.createElement(import_icons3.OpenAI, { color, size: finalSize }) : app.defaultModel === "claude" ? /* @__PURE__ */ import_react32.default.createElement(import_icons3.Claude, { color, size: finalSize }) : app.defaultModel === "gemini" ? /* @__PURE__ */ import_react32.default.createElement(import_icons3.Gemini, { color, size: finalSize }) : app.defaultModel === "flux" ? /* @__PURE__ */ import_react32.default.createElement(import_icons3.Flux, { color, size: finalSize }) : app.defaultModel === "perplexity" ? /* @__PURE__ */ import_react32.default.createElement(import_icons3.Perplexity, { color, size: finalSize }) : null;
|
|
19417
19460
|
}
|
|
19418
19461
|
return /* @__PURE__ */ import_react32.default.createElement(
|
|
19419
19462
|
Img,
|
|
@@ -19439,6 +19482,7 @@ var init_Image = __esm({
|
|
|
19439
19482
|
"use client";
|
|
19440
19483
|
import_react32 = __toESM(require("react"));
|
|
19441
19484
|
init_Img();
|
|
19485
|
+
init_AppContext();
|
|
19442
19486
|
init_platform();
|
|
19443
19487
|
init_providers();
|
|
19444
19488
|
import_icons3 = require("@lobehub/icons");
|
|
@@ -23736,7 +23780,22 @@ function Store({
|
|
|
23736
23780
|
color: "var(--accent-1)",
|
|
23737
23781
|
fill: "var(--accent-1)"
|
|
23738
23782
|
}
|
|
23739
|
-
), t5(feature))), /* @__PURE__ */ import_react66.default.createElement("li", { className: import_Store_module.default.feature }, /* @__PURE__ */ import_react66.default.createElement(
|
|
23783
|
+
), t5(feature))), /* @__PURE__ */ import_react66.default.createElement("li", { className: import_Store_module.default.feature }, /* @__PURE__ */ import_react66.default.createElement(
|
|
23784
|
+
A,
|
|
23785
|
+
{
|
|
23786
|
+
href: getAppSlug(selectedApp),
|
|
23787
|
+
onClick: (e) => {
|
|
23788
|
+
if (e.metaKey || e.ctrlKey) {
|
|
23789
|
+
return;
|
|
23790
|
+
}
|
|
23791
|
+
e.preventDefault();
|
|
23792
|
+
setIsNewChat(true, getAppSlug(selectedApp));
|
|
23793
|
+
},
|
|
23794
|
+
className: "link"
|
|
23795
|
+
},
|
|
23796
|
+
/* @__PURE__ */ import_react66.default.createElement(icons_exports.ArrowRight, { size: 16, color: "var(--accent-6)" }),
|
|
23797
|
+
t5("Try it now!")
|
|
23798
|
+
))))))),
|
|
23740
23799
|
!compact && /* @__PURE__ */ import_react66.default.createElement("div", { style: { display: "none" }, className: "seo-content" }, storeApps?.map((appItem) => /* @__PURE__ */ import_react66.default.createElement("section", { key: appItem.id }, /* @__PURE__ */ import_react66.default.createElement("h2", null, appItem.name), /* @__PURE__ */ import_react66.default.createElement("h3", null, t5(appItem.title || "")), /* @__PURE__ */ import_react66.default.createElement("p", null, t5(appItem.description || "")), Array.isArray(appItem.featureList) && appItem.featureList.length > 0 && /* @__PURE__ */ import_react66.default.createElement(import_react66.default.Fragment, null, /* @__PURE__ */ import_react66.default.createElement("h4", null, t5("Key Features")), /* @__PURE__ */ import_react66.default.createElement("ul", null, appItem.featureList.map((feature, index) => /* @__PURE__ */ import_react66.default.createElement("li", { key: index }, t5(feature)))))))),
|
|
23741
23800
|
!compact && /* @__PURE__ */ import_react66.default.createElement("div", { className: import_Store_module.default.tetris }, /* @__PURE__ */ import_react66.default.createElement("div", { style: { display: "flex", gap: "1rem" } }, /* @__PURE__ */ import_react66.default.createElement(
|
|
23742
23801
|
"a",
|
|
@@ -31365,10 +31424,8 @@ function App({
|
|
|
31365
31424
|
app,
|
|
31366
31425
|
appForm,
|
|
31367
31426
|
appFormWatcher,
|
|
31368
|
-
clearFormDraft,
|
|
31369
31427
|
suggestSaveApp,
|
|
31370
31428
|
saveApp,
|
|
31371
|
-
isAppOwner,
|
|
31372
31429
|
canEditApp,
|
|
31373
31430
|
isManagingApp,
|
|
31374
31431
|
isSavingApp,
|
|
@@ -31378,19 +31435,10 @@ function App({
|
|
|
31378
31435
|
setApp,
|
|
31379
31436
|
appStatus,
|
|
31380
31437
|
setAppStatus,
|
|
31438
|
+
baseApp,
|
|
31381
31439
|
storeApp
|
|
31382
31440
|
} = useApp();
|
|
31383
|
-
const {
|
|
31384
|
-
user,
|
|
31385
|
-
guest,
|
|
31386
|
-
fetchSession,
|
|
31387
|
-
token,
|
|
31388
|
-
getAppSlug,
|
|
31389
|
-
baseApp,
|
|
31390
|
-
store,
|
|
31391
|
-
apps,
|
|
31392
|
-
chrry
|
|
31393
|
-
} = useAuth();
|
|
31441
|
+
const { user, guest, getAppSlug, store, apps, chrry } = useAuth();
|
|
31394
31442
|
const { FRONTEND_URL: FRONTEND_URL3 } = useData();
|
|
31395
31443
|
const { router, setIsNewChat } = useNavigationContext();
|
|
31396
31444
|
const { setInput, setIsWebSearchEnabled } = useChat();
|
|
@@ -31412,7 +31460,8 @@ function App({
|
|
|
31412
31460
|
const [appsState, setApps] = import_react49.default.useState(getApps());
|
|
31413
31461
|
(0, import_react49.useEffect)(() => {
|
|
31414
31462
|
setApps(getApps());
|
|
31415
|
-
}, [apps, store?.id, store?.appId, currentStoreId]);
|
|
31463
|
+
}, [apps, store?.id, store?.appId, currentStoreId, baseApp]);
|
|
31464
|
+
console.log(`\u{1F680} ~ file: App.tsx:129 ~ apps:`, apps);
|
|
31416
31465
|
const [file, setFile] = import_react49.default.useState();
|
|
31417
31466
|
const [image, setImageInternal] = import_react49.default.useState(
|
|
31418
31467
|
app?.image || void 0
|
|
@@ -32203,7 +32252,12 @@ function Chat({
|
|
|
32203
32252
|
hourlyLimit,
|
|
32204
32253
|
isEmpty: empty,
|
|
32205
32254
|
threadId,
|
|
32206
|
-
isAgentAuthorized
|
|
32255
|
+
isAgentAuthorized,
|
|
32256
|
+
isAgentModalOpen,
|
|
32257
|
+
setIsAgentModalOpen,
|
|
32258
|
+
isDebateAgentModalOpen,
|
|
32259
|
+
setIsDebateAgentModalOpen,
|
|
32260
|
+
setIsAgentModalOpenInternal
|
|
32207
32261
|
} = useChat();
|
|
32208
32262
|
const {
|
|
32209
32263
|
router,
|
|
@@ -32317,19 +32371,6 @@ function Chat({
|
|
|
32317
32371
|
}
|
|
32318
32372
|
return text2;
|
|
32319
32373
|
};
|
|
32320
|
-
(0, import_react50.useEffect)(() => {
|
|
32321
|
-
if (app?.defaultModel) {
|
|
32322
|
-
const a = aiAgents.find(
|
|
32323
|
-
(agent) => app?.defaultModel && agent.name.toLowerCase() === app?.defaultModel?.toLowerCase()
|
|
32324
|
-
);
|
|
32325
|
-
if (!a) return;
|
|
32326
|
-
if (!isAgentAuthorized(a)) {
|
|
32327
|
-
setIsAgentModalOpen(true);
|
|
32328
|
-
return;
|
|
32329
|
-
}
|
|
32330
|
-
setSelectedAgent(a);
|
|
32331
|
-
}
|
|
32332
|
-
}, [guest, user, app, aiAgents]);
|
|
32333
32374
|
const animateSuggestions = () => {
|
|
32334
32375
|
const prefersReducedMotion = reduceMotion || typeof window !== "undefined" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
32335
32376
|
if (prefersReducedMotion) {
|
|
@@ -32372,27 +32413,7 @@ function Chat({
|
|
|
32372
32413
|
}
|
|
32373
32414
|
return cleanStreamedContent;
|
|
32374
32415
|
}
|
|
32375
|
-
const [isAgentModalOpen, setIsAgentModalOpenInternal] = (0, import_react50.useState)(false);
|
|
32376
32416
|
const [attempt, setAttempt] = (0, import_react50.useState)(void 0);
|
|
32377
|
-
const setIsAgentModalOpen = (open) => {
|
|
32378
|
-
setIsAgentModalOpenInternal(open);
|
|
32379
|
-
if (!open) {
|
|
32380
|
-
setIsDebateAgentModalOpenInternal(false);
|
|
32381
|
-
}
|
|
32382
|
-
open && track({
|
|
32383
|
-
name: "agent-modal",
|
|
32384
|
-
props: {}
|
|
32385
|
-
});
|
|
32386
|
-
};
|
|
32387
|
-
const [isDebateAgentModalOpen, setIsDebateAgentModalOpenInternal] = (0, import_react50.useState)(false);
|
|
32388
|
-
const setIsDebateAgentModalOpen = (open) => {
|
|
32389
|
-
setIsDebateAgentModalOpenInternal(open);
|
|
32390
|
-
setIsAgentModalOpenInternal(open);
|
|
32391
|
-
open && track({
|
|
32392
|
-
name: "debate-agent-modal",
|
|
32393
|
-
props: {}
|
|
32394
|
-
});
|
|
32395
|
-
};
|
|
32396
32417
|
const [isLoading, setIsLoading] = (0, import_react50.useState)(false);
|
|
32397
32418
|
const [isStreaming, setIsStreaming] = (0, import_react50.useState)(false);
|
|
32398
32419
|
const controller = new AbortController();
|
|
@@ -33495,7 +33516,10 @@ Return ONLY ONE WORD: ${apps.map((a) => a.name).join(", ")}, or "none"`;
|
|
|
33495
33516
|
}
|
|
33496
33517
|
if (result?.contextMenuAction?.text) {
|
|
33497
33518
|
setInput(`${message2}: ${result.contextMenuAction.text}`);
|
|
33498
|
-
|
|
33519
|
+
const storageLocal = BrowserInstance?.storage?.local;
|
|
33520
|
+
if (storageLocal && "remove" in storageLocal) {
|
|
33521
|
+
await storageLocal.remove(["contextMenuAction"]);
|
|
33522
|
+
}
|
|
33499
33523
|
if (type !== "aiDebate") {
|
|
33500
33524
|
debateAgent && setDebateAgent(null);
|
|
33501
33525
|
setAttempt("submit");
|
|
@@ -33527,10 +33551,16 @@ Return ONLY ONE WORD: ${apps.map((a) => a.name).join(", ")}, or "none"`;
|
|
|
33527
33551
|
};
|
|
33528
33552
|
processAction();
|
|
33529
33553
|
const interval = setInterval(processAction, 2e3);
|
|
33530
|
-
BrowserInstance?.storage
|
|
33554
|
+
const storageAPI = BrowserInstance?.storage;
|
|
33555
|
+
const hasOnChanged = storageAPI && "onChanged" in storageAPI && storageAPI.onChanged;
|
|
33556
|
+
if (hasOnChanged) {
|
|
33557
|
+
storageAPI.onChanged.addListener(handleStorageChange);
|
|
33558
|
+
}
|
|
33531
33559
|
return () => {
|
|
33532
33560
|
clearInterval(interval);
|
|
33533
|
-
|
|
33561
|
+
if (hasOnChanged) {
|
|
33562
|
+
storageAPI.onChanged.removeListener(handleStorageChange);
|
|
33563
|
+
}
|
|
33534
33564
|
};
|
|
33535
33565
|
}, [setInput]);
|
|
33536
33566
|
const [streamId, setStreamId] = (0, import_react50.useState)(null);
|
|
@@ -34061,7 +34091,7 @@ Return ONLY ONE WORD: ${apps.map((a) => a.name).join(", ")}, or "none"`;
|
|
|
34061
34091
|
if (agent.authorization === "user" && !user && !guest?.subscription) {
|
|
34062
34092
|
const url = threadId ? `/threads/${threadId}?subscribe=true&plan=member` : "/?subscribe=true&plan=member";
|
|
34063
34093
|
if (checkIsExtension()) {
|
|
34064
|
-
BrowserInstance?.runtime?.sendMessage({
|
|
34094
|
+
BrowserInstance?.runtime?.sendMessage?.({
|
|
34065
34095
|
action: "openInSameTab",
|
|
34066
34096
|
url: `${FRONTEND_URL3}${url}`
|
|
34067
34097
|
});
|
|
@@ -34147,7 +34177,7 @@ Return ONLY ONE WORD: ${apps.map((a) => a.name).join(", ")}, or "none"`;
|
|
|
34147
34177
|
addHapticFeedback();
|
|
34148
34178
|
const url = threadId ? `/threads/${threadId}?subscribe=true&plan=member` : "/?subscribe=true&plan=member";
|
|
34149
34179
|
if (checkIsExtension()) {
|
|
34150
|
-
BrowserInstance?.runtime?.sendMessage({
|
|
34180
|
+
BrowserInstance?.runtime?.sendMessage?.({
|
|
34151
34181
|
action: "openInSameTab",
|
|
34152
34182
|
url: `${FRONTEND_URL3}${url}`
|
|
34153
34183
|
});
|