Showing preview only (677K chars total). Download the full file or copy to clipboard to get everything.
Repository: chathub-dev/chathub
Branch: main
Commit: a7a2bd6e1205
Files: 225
Total size: 622.7 KB
Directory structure:
gitextract_jhqjs0wc/
├── .eslintrc.json
├── .github/
│ ├── ISSUE_TEMPLATE/
│ │ ├── bug_report.md
│ │ └── feature_request.md
│ ├── dependabot.yml
│ └── workflows/
│ ├── close-inactive-issues.yml
│ └── release.yml
├── .gitignore
├── .prettierignore
├── .prettierrc
├── .yarnrc.yml
├── LICENSE
├── README.md
├── README_IN.md
├── README_JA.md
├── README_ZH-CN.md
├── README_ZH-TW.md
├── _locales/
│ ├── de/
│ │ └── messages.json
│ ├── en/
│ │ └── messages.json
│ ├── es/
│ │ └── messages.json
│ ├── fr/
│ │ └── messages.json
│ ├── in/
│ │ └── messages.json
│ ├── ja/
│ │ └── messages.json
│ ├── pt_BR/
│ │ └── messages.json
│ ├── pt_PT/
│ │ └── messages.json
│ ├── ru/
│ │ └── messages.json
│ ├── th/
│ │ └── messages.json
│ ├── zh_CN/
│ │ └── messages.json
│ └── zh_TW/
│ └── messages.json
├── app.html
├── global.d.ts
├── manifest.config.ts
├── package.json
├── postcss.config.cjs
├── public/
│ └── js/
│ └── v2/
│ └── 35536E1E-65B4-4D96-9D97-6ADB7EFF8147/
│ └── api.js
├── sidepanel.html
├── src/
│ ├── app/
│ │ ├── base.scss
│ │ ├── bots/
│ │ │ ├── abstract-bot.ts
│ │ │ ├── baichuan/
│ │ │ │ ├── api.ts
│ │ │ │ └── index.ts
│ │ │ ├── bard/
│ │ │ │ ├── api.ts
│ │ │ │ └── index.ts
│ │ │ ├── bing/
│ │ │ │ ├── api.ts
│ │ │ │ ├── index.ts
│ │ │ │ ├── types.ts
│ │ │ │ └── utils.ts
│ │ │ ├── chatgpt/
│ │ │ │ └── index.ts
│ │ │ ├── chatgpt-api/
│ │ │ │ ├── index.ts
│ │ │ │ └── types.ts
│ │ │ ├── chatgpt-azure/
│ │ │ │ └── index.ts
│ │ │ ├── chatgpt-webapp/
│ │ │ │ ├── arkose/
│ │ │ │ │ ├── generator.js
│ │ │ │ │ ├── index.ts
│ │ │ │ │ └── server.ts
│ │ │ │ ├── client.ts
│ │ │ │ ├── index.ts
│ │ │ │ ├── requesters.ts
│ │ │ │ └── types.ts
│ │ │ ├── claude/
│ │ │ │ └── index.ts
│ │ │ ├── claude-api/
│ │ │ │ └── index.ts
│ │ │ ├── claude-web/
│ │ │ │ ├── api.ts
│ │ │ │ └── index.ts
│ │ │ ├── gemini-api/
│ │ │ │ └── index.ts
│ │ │ ├── gradio/
│ │ │ │ └── index.ts
│ │ │ ├── grok/
│ │ │ │ └── index.ts
│ │ │ ├── index.ts
│ │ │ ├── lmsys/
│ │ │ │ └── index.ts
│ │ │ ├── openrouter/
│ │ │ │ └── index.ts
│ │ │ ├── perplexity/
│ │ │ │ └── index.ts
│ │ │ ├── perplexity-api/
│ │ │ │ ├── api.ts
│ │ │ │ └── index.ts
│ │ │ ├── perplexity-web/
│ │ │ │ ├── api.ts
│ │ │ │ └── index.ts
│ │ │ ├── pi/
│ │ │ │ └── index.ts
│ │ │ ├── poe/
│ │ │ │ ├── api.ts
│ │ │ │ ├── graphql/
│ │ │ │ │ ├── AddMessageBreakMutation.graphql
│ │ │ │ │ ├── AutoSubscriptionMutation.graphql
│ │ │ │ │ ├── ChatViewQuery.graphql
│ │ │ │ │ ├── MessageAddedSubscription.graphql
│ │ │ │ │ ├── SendMessageMutation.graphql
│ │ │ │ │ ├── SubscriptionsMutation.graphql
│ │ │ │ │ └── ViewerStateUpdatedSubscription.graphql
│ │ │ │ └── index.ts
│ │ │ ├── qianwen/
│ │ │ │ ├── api.ts
│ │ │ │ └── index.ts
│ │ │ └── xunfei/
│ │ │ ├── api.ts
│ │ │ ├── geeguard.js
│ │ │ └── index.ts
│ │ ├── components/
│ │ │ ├── Button.tsx
│ │ │ ├── Chat/
│ │ │ │ ├── ChatMessageCard.tsx
│ │ │ │ ├── ChatMessageInput.tsx
│ │ │ │ ├── ChatMessageList.tsx
│ │ │ │ ├── ChatbotName.tsx
│ │ │ │ ├── ConversationPanel.tsx
│ │ │ │ ├── ErrorAction.tsx
│ │ │ │ ├── LayoutSwitch.tsx
│ │ │ │ ├── MessageBubble.tsx
│ │ │ │ ├── TextInput.tsx
│ │ │ │ └── WebAccessCheckbox.tsx
│ │ │ ├── Dialog.tsx
│ │ │ ├── GuideModal.tsx
│ │ │ ├── History/
│ │ │ │ ├── ChatMessage.tsx
│ │ │ │ ├── Content.tsx
│ │ │ │ └── Dialog.tsx
│ │ │ ├── Input.tsx
│ │ │ ├── Layout.tsx
│ │ │ ├── Markdown/
│ │ │ │ ├── index.tsx
│ │ │ │ └── markdown.css
│ │ │ ├── Modals/
│ │ │ │ └── ReleaseNotesModal.tsx
│ │ │ ├── Page.tsx
│ │ │ ├── Premium/
│ │ │ │ ├── DiscountBadge.tsx
│ │ │ │ ├── DiscountModal.tsx
│ │ │ │ ├── FeatureList.tsx
│ │ │ │ ├── Modal.tsx
│ │ │ │ ├── PriceSection.tsx
│ │ │ │ └── Testimonials.tsx
│ │ │ ├── PromptCombobox.tsx
│ │ │ ├── PromptLibrary/
│ │ │ │ ├── Dialog.tsx
│ │ │ │ └── Library.tsx
│ │ │ ├── RadioGroup.tsx
│ │ │ ├── Select.tsx
│ │ │ ├── Settings/
│ │ │ │ ├── Blockquote.tsx
│ │ │ │ ├── ChatGPTAPISettings.tsx
│ │ │ │ ├── ChatGPTAzureSettings.tsx
│ │ │ │ ├── ChatGPTOpenRouterSettings.tsx
│ │ │ │ ├── ChatGPTPoeSettings.tsx
│ │ │ │ ├── ChatGPTWebSettings.tsx
│ │ │ │ ├── ClaudeAPISettings.tsx
│ │ │ │ ├── ClaudeOpenRouterSettings.tsx
│ │ │ │ ├── ClaudePoeSettings.tsx
│ │ │ │ ├── ClaudeWebappSettings.tsx
│ │ │ │ ├── EnabledBotsSettings.tsx
│ │ │ │ ├── ExportDataPanel.tsx
│ │ │ │ ├── KDB.tsx
│ │ │ │ ├── PerplexityAPISettings.tsx
│ │ │ │ └── ShortcutPanel.tsx
│ │ │ ├── Share/
│ │ │ │ ├── Dialog.tsx
│ │ │ │ ├── MarkdownView.tsx
│ │ │ │ ├── ShareGPTView.tsx
│ │ │ │ └── sharegpt.ts
│ │ │ ├── Sidebar/
│ │ │ │ ├── NavLink.tsx
│ │ │ │ ├── PremiumEntry.tsx
│ │ │ │ └── index.tsx
│ │ │ ├── SwitchBotDropdown.tsx
│ │ │ ├── Tabs.tsx
│ │ │ ├── ThemeSettingModal/
│ │ │ │ └── index.tsx
│ │ │ ├── Toggle.tsx
│ │ │ └── Tooltip.tsx
│ │ ├── consts.ts
│ │ ├── context.ts
│ │ ├── hooks/
│ │ │ ├── use-chat.ts
│ │ │ ├── use-enabled-bots.ts
│ │ │ ├── use-premium.ts
│ │ │ ├── use-purchase-info.ts
│ │ │ └── use-user-config.ts
│ │ ├── i18n/
│ │ │ ├── index.ts
│ │ │ └── locales/
│ │ │ ├── french.json
│ │ │ ├── german.json
│ │ │ ├── indonesia.json
│ │ │ ├── japanese.json
│ │ │ ├── portuguese.json
│ │ │ ├── simplified-chinese.json
│ │ │ ├── spanish.json
│ │ │ ├── thai.json
│ │ │ └── traditional-chinese.json
│ │ ├── main.tsx
│ │ ├── pages/
│ │ │ ├── MultiBotChatPanel.tsx
│ │ │ ├── PremiumPage.tsx
│ │ │ ├── SettingPage.tsx
│ │ │ ├── SidePanelPage.tsx
│ │ │ └── SingleBotChatPanel.tsx
│ │ ├── plausible.ts
│ │ ├── router.tsx
│ │ ├── sidepanel.css
│ │ ├── sidepanel.tsx
│ │ ├── state/
│ │ │ └── index.ts
│ │ ├── theme.ts
│ │ └── utils/
│ │ ├── color-scheme.ts
│ │ ├── env.ts
│ │ ├── export.ts
│ │ ├── image-compression/
│ │ │ ├── index.ts
│ │ │ └── worker.ts
│ │ ├── image-size.ts
│ │ ├── markdown.ts
│ │ ├── navigator.ts
│ │ └── permissions.ts
│ ├── background/
│ │ ├── index.ts
│ │ ├── source.ts
│ │ └── twitter-cookie.ts
│ ├── content-script/
│ │ └── chatgpt-inpage-proxy.ts
│ ├── rules/
│ │ ├── baichuan.json
│ │ ├── bing.json
│ │ ├── ddg.json
│ │ ├── pplx.json
│ │ └── qianwen.json
│ ├── services/
│ │ ├── agent/
│ │ │ ├── index.ts
│ │ │ ├── prompts.ts
│ │ │ └── web-search/
│ │ │ ├── base.ts
│ │ │ ├── bing-news.ts
│ │ │ ├── duckduckgo.ts
│ │ │ └── index.ts
│ │ ├── chat-history.ts
│ │ ├── lemonsqueezy.ts
│ │ ├── premium.ts
│ │ ├── prompts.ts
│ │ ├── proxy-fetch.ts
│ │ ├── release-notes.ts
│ │ ├── sentry.ts
│ │ ├── server-api.ts
│ │ ├── storage/
│ │ │ ├── language.ts
│ │ │ ├── open-times.ts
│ │ │ └── token-usage.ts
│ │ ├── theme.ts
│ │ └── user-config.ts
│ ├── types/
│ │ ├── chat.ts
│ │ ├── index.ts
│ │ └── messaging.ts
│ ├── utils/
│ │ ├── encoding.ts
│ │ ├── errors.ts
│ │ ├── format.ts
│ │ ├── index.ts
│ │ ├── sse.ts
│ │ └── stream-async-iterable.ts
│ └── vite-env.d.ts
├── tailwind.config.cjs
├── tsconfig.json
└── vite.config.ts
================================================
FILE CONTENTS
================================================
================================================
FILE: .eslintrc.json
================================================
{
"parser": "@typescript-eslint/parser",
"env": {
"browser": true
},
"plugins": ["@typescript-eslint"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react/recommended",
"plugin:react-hooks/recommended",
"prettier"
],
"overrides": [],
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"rules": {
"react/react-in-jsx-scope": "off"
},
"ignorePatterns": ["build/**"]
}
================================================
FILE: .github/ISSUE_TEMPLATE/bug_report.md
================================================
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''
---
**Describe the bug**
A clear and concise description of what the bug is.
**Desktop (please complete the following information):**
- OS: [e.g. Windows]
- Browser [e.g. chrome, brave]
- ChatHub Version [you can find it in ChatHub Settings]
================================================
FILE: .github/ISSUE_TEMPLATE/feature_request.md
================================================
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''
---
================================================
FILE: .github/dependabot.yml
================================================
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
version: 2
updates:
- package-ecosystem: "npm" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
================================================
FILE: .github/workflows/close-inactive-issues.yml
================================================
name: Close inactive issues
on:
schedule:
- cron: "30 1 * * *"
jobs:
close-issues:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- uses: actions/stale@v5
with:
days-before-issue-stale: 30
days-before-issue-close: 14
stale-issue-label: "stale"
stale-issue-message: "This issue is stale because it has been open for 30 days with no activity."
close-issue-message: "This issue was closed because it has been inactive for 14 days since being marked as stale."
days-before-pr-stale: -1
days-before-pr-close: -1
repo-token: ${{ secrets.GITHUB_TOKEN }}
================================================
FILE: .github/workflows/release.yml
================================================
name: Release Workflow
permissions:
contents: write
on:
push:
tags:
- 'v*.*.*'
env:
VITE_PLAUSIBLE_API_HOST: ${{ vars.VITE_PLAUSIBLE_API_HOST }}
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '20'
- name: Setup yarn
run: corepack enable
- name: Install dependencies
run: yarn install
- name: Build
run: yarn build
- name: Package
uses: vimtor/action-zip@v1.1
with:
files: dist/
dest: chathub.zip
- name: Release
uses: softprops/action-gh-release@v1
with:
files: chathub.zip
================================================
FILE: .gitignore
================================================
# Logs
logs
*.log
npm-debug.log*
pnpm-debug.log*
lerna-debug.log*
node_modules
dist
dist-ssr
*.local
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
.env
.yarn/*
!.yarn/cache
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
================================================
FILE: .prettierignore
================================================
geeguard.js
================================================
FILE: .prettierrc
================================================
{
"printWidth": 120,
"semi": false,
"tabWidth": 2,
"singleQuote": true,
"trailingComma": "all",
"bracketSpacing": true,
"overrides": [
{
"files": ".prettierrc",
"options": {
"parser": "json"
}
}
]
}
================================================
FILE: .yarnrc.yml
================================================
nodeLinker: node-modules
================================================
FILE: LICENSE
================================================
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.
================================================
FILE: README.md
================================================
<p align="center">
<img src="./src/assets/icon.png" width="150">
</p>
<h1 align="center">ChatHub</h1>
<div align="center">
### Install
<a href="https://chrome.google.com/webstore/detail/chathub-all-in-one-chatbo/iaakpnchhognanibcahlpcplchdfmgma?utm_source=github"><img src="https://user-images.githubusercontent.com/64502893/231991498-8df6dd63-727c-41d0-916f-c90c15127de3.png" width="200" alt="Get ChatHub for Chromium"></a>
</div>
## 📷 Screenshot

## 🤝 Sponsors
<a href="https://getstream.io/chat/sdk/react/?utm_source=github&utm_medium=referral&utm_content=&utm_campaign=wong2">
<img src="screenshots/stream-logo.jpg" width="200" />
</a>
## ✨ Features
- 🤖 Use different chatbots in one app, currently supporting ChatGPT, new Bing Chat, Google Bard, Claude, and open-source models including LLama2, Vicuna, ChatGLM etc
- 💬 Chat with multiple chatbots at the same time, making it easy to compare their answers
- 🚀 Support ChatGPT API and GPT-4 Browsing
- 🔍 Shortcut to quickly activate the app anywhere in the browser
- 🎨 Markdown and code highlight support
- 📚 Prompt Library for custom prompts and community prompts
- 💾 Conversation history saved locally
- 📥 Export and Import all your data
- 🔗 Share conversation to markdown
- 🌙 Dark mode
- 🌐 Web access
## 🤖 Supported Bots
- ChatGPT (via Webapp/API)
- Gemini
- Claude (via Webapp/API)
- Grok
- DeepSeek
- Qianwen
- Llama
- ...
## 🔨 Build from Source
- Clone the source code
- `corepack enable`
- `yarn install`
- `yarn build`
- In Chrome/Edge go to the Extensions page (chrome://extensions or edge://extensions)
- Enable Developer Mode
- Drag the `dist` folder anywhere on the page to import it (do not delete the folder afterward)
================================================
FILE: README_IN.md
================================================
<p align="center">
<img src="./src/assets/icon.png" width="150">
</p>
<h1 align="center">ChatHub</h1>
<div align="center">
### ChatHub adalah klien chatbot all-in-one
[![author][author-image]][author-url]
[![license][license-image]][license-url]
[![release][release-image]][release-url]
[![last commit][last-commit-image]][last-commit-url]
[Inggris](README.md) | Indonesia | [简体中文](README_ZH-CN.md) | [繁體中文](README_ZH-TW.md) | [日本語](README_JA.md)
##
### Instal
<a href="https://chrome.google.com/webstore/detail/chathub-all-in-one-chatbo/iaakpnchhognanibcahlpcplchdfmgma?utm_source=github"><img src="https://user-images.githubusercontent.com/64502893/231991498-8df6dd63-727c-41d0-916f-c90c15127de3.png" width="200" alt="Dapatkan ChatHub untuk Chromium"></a>
<a href="https://microsoftedge.microsoft.com/addons/detail/chathub-allinone-chat/kdlmggoacmfoombiokflpeompajfljga?utm_source=github"><img src="https://user-images.githubusercontent.com/64502893/231991158-1b54f831-2fdc-43b6-bf9a-f894000e5aa8.png" width="160" alt="Dapatkan ChatHub untuk Microsoft Edge"></a>
##
[Tangkapan Layar](#-tangkapan-layar) | [Fitur](#-fitur) | [Bot yang Didukung](#-supported-bots) | [Instalasi Manual](#-instalasi-manual) | [Membangun dari Source](#-membangun-dari-source) | [Changelog](#-changelog)
[author-image]: https://img.shields.io/badge/author-wong2-blue.svg
[author-url]: https://github.com/wong2
[license-image]: https://img.shields.io/github/license/chathub-dev/chathub?color=blue
[license-url]: https://github.com/chathub-dev/chathub/blob/main/LICENSE
[release-image]: https://img.shields.io/github/v/release/chathub-dev/chathub?color=blue
[release-url]: https://github.com/chathub-dev/chathub/releases/latest
[last-commit-image]: https://img.shields.io/github/last-commit/chathub-dev/chathub?label=last%20commit
[last-commit-url]: https://github.com/chathub-dev/chathub/commits
</div>
##
## 📷 Tangkapan Layar


## ✨ Fitur
- 🤖 Gunakan chatbot yang berbeda dalam satu aplikasi, saat ini mendukung ChatGPT, Bing Chat baru, Google Bard, Claude, dan 10+ model open-source termasuk Alpaca, Vicuna, ChatGLM, dll
- 💬 Chat dengan beberapa chatbot secara bersamaan, sehingga mudah untuk membandingkan jawaban mereka
- 🚀 Mendukung API ChatGPT dan Browsing GPT-4
- 🔍 Pintasan untuk dengan cepat mengaktifkan aplikasi di mana saja di browser
- 🎨 Mendukung penyorotan markdown dan kode
- 📚 Perpustakaan Prompt untuk prompt kustom dan prompt komunitas
- 💾 Riwayat percakapan tersimpan secara lokal
- 📥 Ekspor dan Impor semua data Anda
- 🔗 Bagikan percakapan ke markdown
- 🌙 Mode gelap
## 🤖 Bot yang Didukung
* ChatGPT (melalui Webapp/API/Azure/Poe)
* Bing Chat
* Google Bard
* Claude (melalui Poe)
* iFlytek Spark
* ChatGLM
* Alpaca
* Vicuna
* Koala
* Dolly
* LLaMA
* StableLM
* OpenAssistant
* ChatRWKV
* ...
## 🔧 Instalasi Manual
- Unduh chathub.zip dari [Release](https://github.com/chathub-dev/chathub/releases)
- Ekstrak file
- Di Chrome/Edge, buka halaman ekstensi (chrome://extensions atau edge://extensions)
- Aktifkan Mode Pengembang
- Seret folder yang telah diekstrak ke mana saja di halaman untuk mengimpor (jangan hapus folder setelah itu)
## 🔨 Membangun dari Source
- Clone source code
- `yarn install`
- `yarn build`
- Muat folder `dist` ke browser dengan mengikuti langkah-langkah dalam _Instalasi Manual_
## 📜 Changelog
### v1.22.0
- Mendukung Claude API
### v1.21.0
- Menambahkan lebih banyak model open-source
### v1.20.0
- Akses dari panel samping Chrome
### v1.19.0
- Akses cepat ke prompt
### v1.18.0
- Mendukung Alpaca, Vicuna, dan ChatGLM
### v1.17.0
- Mendukung model Browsing GPT-4
### v1.16.5
- Menambahkan dukungan layanan Azure OpenAI
### v1.16.0
- Menambahkan pengaturan tema kustom
### v1.15.0
- Menambahkan bot Xunfei Spark
### v1.14.0
- Mendukung lebih banyak bot dalam mode all-in-one untuk pengguna premium
### v1.12.0
- Menambahkan lisensi premium
### v1.11.0
- Dukungan Claude (melalui Poe)
### v1.10.0
- Command + K
### v1.9.4
- Mode gelap
### v1.9.3
- Dukungan rumus matematika dengan katex
- Simpan prompt komunitas ke lokal
### v1.9.2
- Hapus riwayat pesan
### v1.9.0
- Bagikan percakapan sebagai markdown atau melalui sharegpt.com
### v1.8.0
- Impor/Ekspor semua data
- Edit prompt lokal
- Mengalihkan chatbot untuk dibandingkan
### v1.7.0
- Menambahkan riwayat percakapan
### v1.6.0
- Menambahkan dukungan untuk Google Bard
### v1.5.4
- Dukungan model GPT-4 dalam mode api ChatGPT
### v1.5.1
- Menambahkan pengaturan i18n
### v1.5.0
- Dukungan model GPT-4 dalam mode Webapp ChatGPT
### v1.4.0
- Menambahkan Prompt Library
### v1.3.0
- Menambahkan tombol salin kode
- Sinkronisasi status chat antara all-in-one dan mode mandiri
- Memungkinkan input sambil menghasilkan jawaban
### v1.2.0
- Dukungan untuk menyalin teks pesan
- Perbaiki gaya elemen formulir halaman pengaturan
================================================
FILE: README_JA.md
================================================
<p align="center">
<img src="./src/assets/icon.png" width="150">
</p>
<h1 align="center">ChatHub</h1>
<div align="center">
### ChatHub はオールインワンのチャットボットクライアントです
[![author][author-image]][author-url]
[![license][license-image]][license-url]
[![release][release-image]][release-url]
[![last commit][last-commit-image]][last-commit-url]
[English](README.md) | [Indonesia](README_IN.md) | [简体中文](README_ZH-CN.md) | [繁體中文](README_ZH-TW.md) | 日本語
##
### インストール
<a href="https://chrome.google.com/webstore/detail/chathub-all-in-one-chatbo/iaakpnchhognanibcahlpcplchdfmgma?utm_source=github"><img src="https://user-images.githubusercontent.com/64502893/231991498-8df6dd63-727c-41d0-916f-c90c15127de3.png" width="200" alt="Chromium 用の ChatHub を入手してください"></a>
<a href="https://microsoftedge.microsoft.com/addons/detail/chathub-allinone-chat/kdlmggoacmfoombiokflpeompajfljga?utm_source=github"><img src="https://user-images.githubusercontent.com/64502893/231991158-1b54f831-2fdc-43b6-bf9a-f894000e5aa8.png" width="160" alt="Microsoft Edge 用の ChatHub を入手してください"></a>
##
[スクリーンショット](#-スクリーンショット) | [特徴](#-特徴) | [サポートされているボット](#-サポートされているボット) | [手動インストール](#-手動インストール) | [ソースからビルドする](#-ソースからビルドする) | [変更ログ](#-変更ログ)
[author-image]: https://img.shields.io/badge/author-wong2-blue.svg
[author-url]: https://github.com/wong2
[license-image]: https://img.shields.io/github/license/chathub-dev/chathub?color=blue
[license-url]: https://github.com/chathub-dev/chathub/blob/main/LICENSE
[release-image]: https://img.shields.io/github/v/release/chathub-dev/chathub?color=blue
[release-url]: https://github.com/chathub-dev/chathub/releases/latest
[last-commit-image]: https://img.shields.io/github/last-commit/chathub-dev/chathub?label=last%20commit
[last-commit-url]: https://github.com/chathub-dev/chathub/commits
</div>
##
## 📷 スクリーンショット


## ✨ 特徴
- 🤖 アプリ内で異なるチャットボットを使用できます。現在は ChatGPT、新しい Bing Chat、Google Bard、Claude、および Alpaca、Vicuna、ChatGLM などを含む10以上のオープンソースモデルをサポートしています
- 💬 複数のチャットボットと同時にチャットすることで、回答を比較しやすくします
- 🚀 ChatGPT API および GPT-4 Browsing をサポートします
- 🔍 ブラウザのどこからでもアプリを素早くアクティブにするためのショートカット
- 🎨 Markdown とコードのハイライトのサポート
- 📚 カスタムプロンプトとコミュニティプロンプトのためのプロンプトライブラリ
- 💾 ローカルに保存された会話履歴
- 📥 データのエクスポートとインポート
- 🔗 マークダウン形式で会話を共有
- 🌙 ダークモード
## 🤖 サポートされているボット
* ChatGPT(Web アプリ/API/Azure/Poe経由)
* Bing Chat
* Google Bard
* Claude(Poe 経由)
* iFlytek Spark
* ChatGLM
* Alpaca
* Vicuna
* Koala
* Dolly
* LLaMA
* StableLM
* OpenAssistant
* ChatRWKV
* ...
## 🔧 手動インストール
- [リリース](https://github.com/chathub-dev/chathub/releases)から chathub.zip をダウンロード
- ファイルを解凍
- Chrome/Edge で拡張機能ページに移動します (chrome://extensions または edge://extensions)
- 開発者モードを有効にする
- 解凍したフォルダーをページ上の任意の場所にドラッグしてインポートします (後でフォルダーを削除しないでください)
## 🔨 ソースからビルドする
- ソースコードをクローン
- `yarn install`
- `yarn build`
- _マニュアルインストール_ の手順に従って、`dist` _フォルダをブラウザに読み込みます_
## 📜 変更ログ
### v1.22.0
- Claude API のサポートを追加
### v1.21.0
- より多くのオープンソースモデルを追加
### v1.20.0
- Chrome のサイドパネルからアクセスできるようにしました
### v1.19.0
- プロンプトへの簡単アクセス
### v1.18.0
- Alpaca、Vicuna、ChatGLM のサポート
### v1.17.0
- GPT-4 Browsing モデルのサポート
### v1.16.5
- Azure OpenAI サービスのサポートを追加
### v1.16.0
- カスタムテーマ設定を追加
### v1.15.0
- Xunfei Spark ボットを追加
### v1.14.0
- プレミアムユーザー向けのオールインワンモードで、より多くのボットをサポート
### v1.12.0
- プレミアムライセンスを追加
### v1.11.0
- クロードのサポートを追加 (Poe経由で)
### v1.10.0
- Command + K
### v1.9.4
- ダークモード
### v1.9.3
- katex で数式をサポート
- コミュニティプロンプトをローカルに保存
### v1.9.2
- 履歴メッセージを削除する
### v1.9.0
- markdown として、または sharegpt.com 経由でチャットを共有する
### v1.8.0
- すべてのデータのインポート/エクスポート
- ローカルプロンプトを編集する
- 比較のためにチャットボットを切り替える
### v1.7.0
- 会話履歴を追加する
### v1.6.0
- Google Bard のサポートを追加
### v1.5.4
- ChatGPT api モードで GPT-4 モデルをサポート
### v1.5.1
- i18n 設定を追加
### v1.5.0
- ChatGPT Webapp モードで GPT-4 モデルをサポート
### v1.4.0
- プロンプトライブラリを追加
### v1.3.0
- コピーコードボタンを追加
- オールインワンモードとスタンドアロンモードの間でチャット状態を同期
- 回答の生成中に入力を許可
### v1.2.0
- コピーメッセージテキストのサポート
- ページフォーム要素スタイルの設定を改善
================================================
FILE: README_ZH-CN.md
================================================
<p align="center">
<img src="./src/assets/icon.png" width="150">
</p>
<h1 align="center">ChatHub</h1>
<div align="center">
### ChatHub 是款全能聊天机器人客户端
[![作者][作者-image]][作者-url]
[![许可证][许可证-image]][许可证-url]
[![发布][发布-image]][发布-url]
[![最后提交][最后提交-image]][最后提交-url]
[English](README.md) | [Indonesia](README_IN.md) | 简体中文 | [繁體中文](README_ZH-TW.md) | [日本語](README_JA.md)
##
### 安装
<a href="https://chrome.google.com/webstore/detail/chathub-all-in-one-chatbo/iaakpnchhognanibcahlpcplchdfmgma?utm_source=website"><img src="https://user-images.githubusercontent.com/64502893/231991498-8df6dd63-727c-41d0-916f-c90c15127de3.png" width="200" alt="获取 Chromium 版 ChatHub"></a>
<a href="https://microsoftedge.microsoft.com/addons/detail/chathub-allinone-chat/kdlmggoacmfoombiokflpeompajfljga"><img src="https://user-images.githubusercontent.com/64502893/231991158-1b54f831-2fdc-43b6-bf9a-f894000e5aa8.png" width="160" alt="获取 Microsoft Edge 版 ChatHub"></a>
##
[截图](#-截图) | [特点](#-特点) | [支持的聊天机器人](#-支持的聊天机器人) | [手动安装](#-手动安装) | [从源代码构建](#-从源代码构建) | [更新日志](#-更新日志)
[作者-image]: https://img.shields.io/badge/author-wong2-blue.svg
[作者-url]: https://github.com/wong2
[许可证-image]: https://img.shields.io/github/license/chathub-dev/chathub?color=blue
[许可证-url]: https://github.com/chathub-dev/chathub/blob/main/LICENSE
[发布-image]: https://img.shields.io/github/v/release/chathub-dev/chathub?color=blue
[发布-url]: https://github.com/chathub-dev/chathub/releases/latest
[最后提交-image]: https://img.shields.io/github/last-commit/chathub-dev/chathub?label=last%20commit
[最后提交-url]: https://github.com/chathub-dev/chathub/commits
</div>
##
## 📷 截图


## ✨ 特点
- 🤖 在一个应用中使用不同的聊天机器人,目前支持 ChatGPT、新的 Bing Chat、Google Bard、Claude 以及包括 Alpaca、Vicuna、ChatGLM 等在内的 10 多个开源模型
- 💬 同时与多个聊天机器人进行对话,方便比较它们的回答
- 🚀 支持 ChatGPT API 和 GPT-4 浏览
- 🔍 快捷方式,可在浏览器的任何位置快速激活应用
- 🎨 支持 Markdown 和代码高亮显示
- 📚 自定义提示和社区提示的提示库
- 💾 本地保存对话历史
- 📥 导出和导入所有数据
- 🔗 将对话转为 Markdown 并分享
- 🌙 暗黑模式
## 🤖 支持的聊天机器人
* ChatGPT(通过 Web 应用/API/Azure/Poe)
* Bing Chat
* Google Bard
* Claude(通过 Poe)
* iFlytek Spark
* ChatGLM
* Alpaca
* Vicuna
* Koala
* Dolly
* LLaMA
* StableLM
* OpenAssistant
* ChatRWKV
* ...
## 🔧 手动安装
- 从 [Releases](https://github.com/chathub-dev/chathub/releases) 下载 chathub.zip
- 解压文件
- 在 Chrome/Edge 中进入扩展页面 (chrome://extensions 或 edge://extensions)
- 启用开发者模式
- 将解压后的文件夹拖到页面上的任何位置进行导入(导入后不要删除文件夹)
## 🔨 从源代码构建
- 克隆源代码
- 运行 `yarn install`
- 运行 `yarn build`
- 按照 _手动安装_ 中的步骤将 `dist` _文件夹加载到浏览器中_
## 📜 更新日志
### v1.22.0
- 支持 Claude API
### v1.21.0
- 添加更多开源模型
### v1.20.0
- 从 Chrome 侧边栏访问
### v1.19.0
- 快速访问提示
### v1.18.0
- 支持 Alpaca、Vicuna 和 ChatGLM
### v1.17.0
- 支持 GPT-4 浏览模型
### v1.16.5
- 增加 Azure OpenAI 服务支持
### v1.16.0
- 增加自定义主题设置
### v1.15.0
- 增加讯飞 Spark 机器人
### v1.14.0
- 为高级用户在全能模式中支持更多机器人
### v1.12.0
- 增加高级许可证
### v1.11.0
- 支持 Claude (via Poe)
### v1.10.0
- 新增了快捷键 Command + K
### v1.9.4
- 新增了暗黑模式
### v1.9.3
- 支持使用 katex 插件输入数学公式
- 可以将社区提示保存到本地
### v1.9.2
- 可以删除历史消息
### v1.9.0
- 可以将聊天记录分享为 Markdown 或通过 sharegpt.com 分享
### v1.8.0
- 可以导入/导出所有数据
- 可以编辑本地提示
- 可以切换聊天机器人进行比较
### v1.7.0
- 新增了对话历史记录
### v1.6.0
- 增加了对 Google Bard 的支持
### v1.5.4
- 在 ChatGPT API 模式下支持 GPT-4 模型
### v1.5.1
- 增加了国际化设置
### v1.5.0
- 在 ChatGPT Webapp 模式下支持 GPT-4 模型
### v1.4.0
- 新增了 Prompt 库
### v1.3.0
- 增加了复制代码按钮
- 在全合一模式和独立模式之间同步聊天状态
- 允许在生成答案时输入
### v1.2.0
- 支持复制消息文本
- 改进了设置页面表单元素的样式
================================================
FILE: README_ZH-TW.md
================================================
<p align="center">
<img src="./src/assets/icon.png" width="150">
</p>
<h1 align="center">ChatHub</h1>
<div align="center">
### ChatHub 是個全能的聊天機器人客戶端
[![作者][作者-image]][作者-url]
[![許可證][許可證-image]][許可證-url]
[![發布][發布-image]][發布-url]
[![版本發佈][版本發佈-image]][版本發佈-url]
[English](README.md) | [Indonesia](README_IN.md) | [简体中文](README_ZH-CN.md) | 繁體中文 | [日本語](README_JA.md)
##
### 安装
<a href="https://chrome.google.com/webstore/detail/chathub-all-in-one-chatbo/iaakpnchhognanibcahlpcplchdfmgma?utm_source=website"><img src="https://user-images.githubusercontent.com/64502893/231991498-8df6dd63-727c-41d0-916f-c90c15127de3.png" width="200" alt="获取 Chromium 版本的 ChatHub"></a>
<a href="https://microsoftedge.microsoft.com/addons/detail/chathub-allinone-chat/kdlmggoacmfoombiokflpeompajfljga"><img src="https://user-images.githubusercontent.com/64502893/231991158-1b54f831-2fdc-43b6-bf9a-f894000e5aa8.png" width="160" alt="获取 Microsoft Edge 版本的 ChatHub"></a>
##
[螢幕截圖](#-螢幕截圖) | [功能特色](#-功能特色) | [支援的聊天機器人](#-支援的聊天機器人) | [手動安裝](#-手動安裝) | [從原始碼建立](#-從原始碼建立) | [更新日誌](#-更新日誌)
[作者-image]: https://img.shields.io/badge/author-wong2-blue.svg
[作者-url]: https://github.com/wong2
[許可證-image]: https://img.shields.io/github/license/chathub-dev/chathub?color=blue
[許可證-url]: https://github.com/chathub-dev/chathub/blob/main/LICENSE
[發布-image]: https://img.shields.io/github/v/release/chathub-dev/chathub?color=blue
[發布-url]: https://github.com/chathub-dev/chathub/releases/latest
[版本發佈-image]: https://img.shields.io/github/last-commit/chathub-dev/chathub?label=last%20commit
[版本發佈-url]: https://github.com/chathub-dev/chathub/commits
</div>
##
## 📷 螢幕截圖


## ✨ 功能特色
- 🤖 在一個應用程式中使用不同的聊天機器人,目前支援 ChatGPT、新的 Bing Chat、Google Bard、Claude,還有 10 多個開源模型,包括 Alpaca、Vicuna、ChatGLM 等
- 💬 同時與多個聊天機器人進行對話,輕鬆比較它們的回答
- 🚀 支援 ChatGPT API 和 GPT-4 瀏覽
- 🔍 快速啟動應用程式的捷徑,可在瀏覽器中的任何地方使用
- 🎨 支援 Markdown 和程式碼高亮顯示
- 📚 自訂提示和社群提示的提示庫
- 💾 本地保存對話歷史
- 📥 匯出和匯入所有資料
- 🔗 將對話分享為 Markdown 格式
- 🌙 黑暗模式
## 🤖 支援的聊天機器人
* ChatGPT(透過網頁應用程式/API/Azure/Poe)
* Bing Chat
* Google Bard
* Claude(透過 Poe)
* iFlytek Spark
* ChatGLM
* Alpaca
* Vicuna
* Koala
* Dolly
* LLaMA
* StableLM
* OpenAssistant
* ChatRWKV
* ...
## 🔧 手動安裝
- 從 [Releases](https://github.com/chathub-dev/chathub/releases) 下載 chathub.zip
- 解壓縮該文件
- 在 Chrome/Edge 瀏覽器中,前往擴展功能頁面 (chrome://extensions 或 edge://extensions)
- 啟用開發人員模式
- 拖動解壓縮後的文件夾到頁面上的任何位置以導入它 (導入後不要刪除文件夾)
## 🔨 從原始碼建立
- 複製原始碼
- `yarn install`
- `yarn build`
- 按照「手動安裝」中的步驟將 `dist` _資料夾載入瀏覽器_
## 📜 更新日誌
### v1.22.0
- 支援 Claude API
### v1.21.0
- 新增更多開源模型
### v1.20.0
- 從 Chrome 側邊面板進入
### v1.19.0
- 快速存取提示
### v1.18.0
- 支援 Alpaca、Vicuna 和 ChatGLM
### v1.17.0
- 支援 GPT-4 瀏覽模型
### v1.16.5
- 新增支援 Azure OpenAI 服務
### v1.16.0
- 新增自訂主題設定
### v1.15.0
- 新增訊飛 Spark 機器人
### v1.14.0
- 支援高級用戶的全能模式中的更多機器人
### v1.12.0
- 新增高級授權
### v1.11.0
- 支援 Claude (透過 Poe)
### v1.10.0
- 新增 Command + K 功能
### v1.9.4
- 新增暗模式
### v1.9.3
- 支援使用 katex 的數學公式
- 將社區提示保存到本地
### v1.9.2
- 刪除對話歷史消息
### v1.9.0
- 可將聊天記錄以 Markdown 格式或通過 sharegpt.com 分享
### v1.8.0
- 匯出/匯入所有數據
- 編輯本地提示
- 切換聊天機器人以進行比較
### v1.7.0
- 新增對話歷史
### v1.6.0
- 新增支援 Google Bard
### v1.5.4
- 支援 ChatGPT API 模式下的 GPT-4 模型
### v1.5.1
- 新增 i18n 設置
### v1.5.0
- 支援 ChatGPT Webapp 模式下的 GPT-4 模型
### v1.4.0
- 新增提示庫
### v1.3.0
- 新增複製代碼按鈕
- 在全能模式和獨立模式之間同步聊天狀態
- 允許在生成答案時輸入
### v1.2.0
- 支援複製消息文本
- 改善設置頁面表單元素樣式
================================================
FILE: _locales/de/messages.json
================================================
{
"appName": {
"message": "ChatHub - All-in-One Chatbot Klient"
},
"appDesc": {
"message": "Bessere Benutzeroberfläche für Ihre Lieblings-Chatbots"
}
}
================================================
FILE: _locales/en/messages.json
================================================
{
"appName": {
"message": "ChatHub - All-in-one chatbot client"
},
"appDesc": {
"message": "Use ChatGPT, Bing, Bard, Claude and more chatbots simultaneously"
}
}
================================================
FILE: _locales/es/messages.json
================================================
{
"appName": {
"message": "ChatHub - Cliente de chatbot todo en uno"
},
"appDesc": {
"message": "Utiliza ChatGPT, Bing, Bard, Claude y más chatbots simultáneamente"
}
}
================================================
FILE: _locales/fr/messages.json
================================================
{
"appName": {
"message": "ChatHub - Client de chatbot tout-en-un"
},
"appDesc": {
"message": "Une meilleure interface utilisateur pour vos chatbots préférés"
}
}
================================================
FILE: _locales/in/messages.json
================================================
{
"appName": {
"message": "ChatHub - Semua klien chatbot dalam satu tempat"
},
"appDesc": {
"message": "Semua chatbot favorit Anda dalam satu tempat"
}
}
================================================
FILE: _locales/ja/messages.json
================================================
{
"appName": {
"message": "ChatHub - オールインワンチャットボットクライアント"
},
"appDesc": {
"message": "ChatGPT、Bing、Bard、およびClaudeを一つのプラットフォームで使用します"
}
}
================================================
FILE: _locales/pt_BR/messages.json
================================================
{
"appName": {
"message": "ChatHub - All-in-one chatbot client"
},
"appDesc": {
"message": "Use o ChatGPT, Bing, Bard, Claude e mais chatbots simultaneamente"
}
}
================================================
FILE: _locales/pt_PT/messages.json
================================================
{
"appName": {
"message": "ChatHub - All-in-one chatbot client"
},
"appDesc": {
"message": "Use o ChatGPT, Bing, Bard, Claude e mais chatbots simultaneamente"
}
}
================================================
FILE: _locales/ru/messages.json
================================================
{
"appName": {
"message": "ChatHub — универсальный клиент для чат-ботов"
},
"appDesc": {
"message": "Улучшенный UI для ваших любимых чат-ботов"
}
}
================================================
FILE: _locales/th/messages.json
================================================
{
"appName": {
"message": "ChatHub - ไคลเอนต์แชทบอทแบบครบวงจร"
},
"appDesc": {
"message": "UI ที่ดีกว่ากับแชทบอทที่คุณชื่นชอบ"
}
}
================================================
FILE: _locales/zh_CN/messages.json
================================================
{
"appName": {
"message": "ChatHub - All-in-one chatbot client"
},
"appDesc": {
"message": "同时使用ChatGPT, Bing, Bard和更多机器人"
}
}
================================================
FILE: _locales/zh_TW/messages.json
================================================
{
"appName": {
"message": "ChatHub - 全方位聊天機器人客戶端"
},
"appDesc": {
"message": "為您最喜愛的聊天機器人提供更好的用戶界面"
}
}
================================================
FILE: app.html
================================================
<!DOCTYPE html>
<html translate="no">
<head>
<meta charset="utf-8" />
<meta content="width=device-width,initial-scale=1.0" name="viewport" />
<title>ChatHub</title>
<script type="module" src="./src/app/theme.ts"></script>
</head>
<body>
<div id="app"></div>
<script type="module" src="./src/app/main.tsx"></script>
</body>
</html>
================================================
FILE: global.d.ts
================================================
declare module '*.gql'
================================================
FILE: manifest.config.ts
================================================
import { defineManifest } from '@crxjs/vite-plugin'
export default defineManifest(async () => {
return {
manifest_version: 3,
name: '__MSG_appName__',
description: '__MSG_appDesc__',
default_locale: 'en',
version: '1.45.7',
icons: {
'16': 'src/assets/icon.png',
'32': 'src/assets/icon.png',
'48': 'src/assets/icon.png',
'128': 'src/assets/icon.png',
},
background: {
service_worker: 'src/background/index.ts',
type: 'module',
},
action: {},
host_permissions: [
'https://*.bing.com/',
'https://*.openai.com/',
'https://bard.google.com/',
'https://*.chathub.gg/',
'https://*.duckduckgo.com/',
'https://*.poe.com/',
'https://*.anthropic.com/',
'https://*.claude.ai/',
],
optional_host_permissions: ['https://*/*', 'wss://*/*'],
permissions: ['storage', 'unlimitedStorage', 'sidePanel', 'declarativeNetRequestWithHostAccess', 'scripting'],
content_scripts: [
{
matches: ['https://chat.openai.com/*'],
js: ['src/content-script/chatgpt-inpage-proxy.ts'],
},
],
commands: {
'open-app': {
suggested_key: {
default: 'Alt+J',
windows: 'Alt+J',
linux: 'Alt+J',
mac: 'Command+J',
},
description: 'Open ChatHub app',
},
},
side_panel: {
default_path: 'sidepanel.html',
},
declarative_net_request: {
rule_resources: [
{
id: 'ruleset_bing',
enabled: true,
path: 'src/rules/bing.json',
},
{
id: 'ruleset_ddg',
enabled: true,
path: 'src/rules/ddg.json',
},
{
id: 'ruleset_qianwen',
enabled: true,
path: 'src/rules/qianwen.json',
},
{
id: 'ruleset_baichuan',
enabled: true,
path: 'src/rules/baichuan.json',
},
{
id: 'ruleset_pplx',
enabled: true,
path: 'src/rules/pplx.json',
},
],
},
}
})
================================================
FILE: package.json
================================================
{
"name": "chathub-extension",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc && vite build"
},
"devDependencies": {
"@crxjs/vite-plugin": "2.0.0-beta.21",
"@headlessui/tailwindcss": "^0.2.0",
"@types/cookie": "^0.6.0",
"@types/humanize-duration": "^3.27.3",
"@types/lodash-es": "^4.17.12",
"@types/md5": "^2.3.5",
"@types/react": "18.2.18",
"@types/react-color": "^3.0.10",
"@types/react-copy-to-clipboard": "^5.0.7",
"@types/react-dom": "^18.2.18",
"@types/react-scroll-to-bottom": "^4.2.4",
"@types/turndown": "^5.0.4",
"@types/uuid": "^9.0.7",
"@types/webextension-polyfill": "^0.10.7",
"@typescript-eslint/eslint-plugin": "^6.15.0",
"@typescript-eslint/parser": "^6.15.0",
"@vitejs/plugin-react": "^4.2.1",
"autoprefixer": "^10.4.16",
"chrome-types": "^0.1.246",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
"postcss": "^8.4.32",
"postcss-import": "^15.1.0",
"postcss-nesting": "^12.0.2",
"prettier": "^3.1.1",
"process": "^0.11.10",
"sass": "^1.69.5",
"tailwind-scrollbar": "^3.0.5",
"tailwindcss": "^3.4.0",
"typescript": "^5.3.3",
"vite": "4.5.1",
"vite-tsconfig-paths": "^4.2.2"
},
"dependencies": {
"@epic-web/cachified": "^4.0.0",
"@floating-ui/react": "^0.26.4",
"@google/generative-ai": "^0.1.3",
"@headlessui/react": "^1.7.17",
"@heroicons/react": "^2.1.1",
"@radix-ui/react-tooltip": "^1.0.7",
"@sentry/integrations": "^7.90.0",
"@sentry/react": "^7.90.0",
"@tanstack/react-router": "^1.43.6",
"async-cache-dedupe": "^2.0.0",
"browser-fs-access": "^0.35.0",
"browser-image-compression": "^2.0.2",
"clsx": "^2.0.0",
"compare-versions": "^6.1.0",
"cookie": "^0.6.0",
"dayjs": "^1.11.10",
"eventsource-parser": "^1.1.1",
"framer-motion": "^10.16.16",
"fuse.js": "^7.0.0",
"github-markdown-css": "^5.5.0",
"gpt3-tokenizer": "^1.1.5",
"highlight.js": "^11.9.0",
"humanize-duration": "^3.31.0",
"i18next": "^23.7.11",
"i18next-browser-languagedetector": "^7.2.0",
"immer": "^10.0.3",
"inter-ui": "^3.19.3",
"jotai": "^2.6.0",
"jotai-immer": "^0.2.0",
"js-base64": "^3.7.5",
"lodash-es": "^4.17.21",
"md5": "^2.3.0",
"nanoid": "^5.0.4",
"ofetch": "^1.3.3",
"plausible-tracker": "^0.3.8",
"react": "^18.2.0",
"react-color": "^2.19.3",
"react-confetti-explosion": "^2.1.2",
"react-copy-to-clipboard": "^5.1.0",
"react-dom": "^18.2.0",
"react-hot-toast": "^2.4.1",
"react-i18next": "^13.5.0",
"react-icons": "^4.12.0",
"react-markdown": "^8.0.7",
"react-node-to-string": "^0.1.2",
"react-scroll-to-bottom": "^4.2.0",
"react-spinners": "^0.13.8",
"react-textarea-autosize": "^8.5.3",
"react-viewport-list": "^7.1.2",
"rehype-highlight": "^6.0.0",
"rehype-stringify": "^9.0.4",
"remark-breaks": "^3.0.3",
"remark-gfm": "^3.0.1",
"remark-math": "^5.1.1",
"remark-parse": "^10.0.2",
"remark-rehype": "^10.1.0",
"remark-supersub": "^1.0.0",
"slashes": "^3.0.12",
"swr": "^2.2.4",
"tailwind-merge": "^2.1.0",
"turndown": "^7.1.2",
"unified": "^10.1.2",
"uuid": "^9.0.1",
"webextension-polyfill": "^0.10.0",
"websocket-as-promised": "^2.0.1"
},
"packageManager": "yarn@4.0.1"
}
================================================
FILE: postcss.config.cjs
================================================
module.exports = {
plugins: {
'postcss-import': {},
'tailwindcss/nesting': 'postcss-nesting',
tailwindcss: {},
autoprefixer: {},
},
}
================================================
FILE: public/js/v2/35536E1E-65B4-4D96-9D97-6ADB7EFF8147/api.js
================================================
var arkoseLabsClientApi2c145230;!function(){var e={7983:function(e,t){"use strict";t.N=void 0;var n=/^([^\w]*)(javascript|data|vbscript)/im,r=/&#(\w+)(^\w|;)?/g,i=/&tab;/gi,o=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,a=/^.+(:|:)/gim,c=[".","/"];t.N=function(e){var t,s=(t=e||"",(t=t.replace(i,"	")).replace(r,(function(e,t){return String.fromCharCode(t)}))).replace(o,"").trim();if(!s)return"about:blank";if(function(e){return c.indexOf(e[0])>-1}(s))return s;var u=s.match(a);if(!u)return s;var l=u[0];return n.test(l)?"about:blank":s}},3940:function(e,t){var n;!function(){"use strict";var r={}.hasOwnProperty;function i(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var o=typeof n;if("string"===o||"number"===o)e.push(n);else if(Array.isArray(n)){if(n.length){var a=i.apply(null,n);a&&e.push(a)}}else if("object"===o)if(n.toString===Object.prototype.toString)for(var c in n)r.call(n,c)&&n[c]&&e.push(c);else e.push(n.toString())}}return e.join(" ")}e.exports?(i.default=i,e.exports=i):void 0===(n=function(){return i}.apply(t,[]))||(e.exports=n)}()},8645:function(e){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",r=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),r&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),r&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,r,i,o){"string"==typeof e&&(e=[[null,e,void 0]]);var a={};if(r)for(var c=0;c<this.length;c++){var s=this[c][0];null!=s&&(a[s]=!0)}for(var u=0;u<e.length;u++){var l=[].concat(e[u]);r&&a[l[0]]||(void 0!==o&&(void 0===l[5]||(l[1]="@layer".concat(l[5].length>0?" ".concat(l[5]):""," {").concat(l[1],"}")),l[5]=o),n&&(l[2]?(l[1]="@media ".concat(l[2]," {").concat(l[1],"}"),l[2]=n):l[2]=n),i&&(l[4]?(l[1]="@supports (".concat(l[4],") {").concat(l[1],"}"),l[4]=i):l[4]="".concat(i)),t.push(l))}},t}},3835:function(e){"use strict";e.exports=function(e){return e[1]}},913:function(e,t,n){var r,i,o;!function(a,c){"use strict";i=[n(4486)],void 0===(o="function"==typeof(r=function(e){var t=/(^|@)\S+:\d+/,n=/^\s*at .*(\S+:\d+|\(native\))/m,r=/^(eval@)?(\[native code])?$/;return{parse:function(e){if(void 0!==e.stacktrace||void 0!==e["opera#sourceloc"])return this.parseOpera(e);if(e.stack&&e.stack.match(n))return this.parseV8OrIE(e);if(e.stack)return this.parseFFOrSafari(e);throw new Error("Cannot parse given Error object")},extractLocation:function(e){if(-1===e.indexOf(":"))return[e];var t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));return[t[1],t[2]||void 0,t[3]||void 0]},parseV8OrIE:function(t){return t.stack.split("\n").filter((function(e){return!!e.match(n)}),this).map((function(t){t.indexOf("(eval ")>-1&&(t=t.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(,.*$)/g,""));var n=t.replace(/^\s+/,"").replace(/\(eval code/g,"(").replace(/^.*?\s+/,""),r=n.match(/ (\(.+\)$)/);n=r?n.replace(r[0],""):n;var i=this.extractLocation(r?r[1]:n),o=r&&n||void 0,a=["eval","<anonymous>"].indexOf(i[0])>-1?void 0:i[0];return new e({functionName:o,fileName:a,lineNumber:i[1],columnNumber:i[2],source:t})}),this)},parseFFOrSafari:function(t){return t.stack.split("\n").filter((function(e){return!e.match(r)}),this).map((function(t){if(t.indexOf(" > eval")>-1&&(t=t.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===t.indexOf("@")&&-1===t.indexOf(":"))return new e({functionName:t});var n=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=t.match(n),i=r&&r[1]?r[1]:void 0,o=this.extractLocation(t.replace(n,""));return new e({functionName:i,fileName:o[0],lineNumber:o[1],columnNumber:o[2],source:t})}),this)},parseOpera:function(e){return!e.stacktrace||e.message.indexOf("\n")>-1&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9:function(t){for(var n=/Line (\d+).*script (?:in )?(\S+)/i,r=t.message.split("\n"),i=[],o=2,a=r.length;o<a;o+=2){var c=n.exec(r[o]);c&&i.push(new e({fileName:c[2],lineNumber:c[1],source:r[o]}))}return i},parseOpera10:function(t){for(var n=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=t.stacktrace.split("\n"),i=[],o=0,a=r.length;o<a;o+=2){var c=n.exec(r[o]);c&&i.push(new e({functionName:c[3]||void 0,fileName:c[2],lineNumber:c[1],source:r[o]}))}return i},parseOpera11:function(n){return n.stack.split("\n").filter((function(e){return!!e.match(t)&&!e.match(/^Error created at/)}),this).map((function(t){var n,r=t.split("@"),i=this.extractLocation(r.pop()),o=r.shift()||"",a=o.replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;o.match(/\(([^)]*)\)/)&&(n=o.replace(/^[^(]+\(([^)]*)\)$/,"$1"));var c=void 0===n||"[arguments not available]"===n?void 0:n.split(",");return new e({functionName:a,args:c,fileName:i[0],lineNumber:i[1],columnNumber:i[2],source:t})}),this)}}})?r.apply(t,i):r)||(e.exports=o)}()},2265:function(e){"use strict";var t=Object.prototype.hasOwnProperty,n="~";function r(){}function i(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,r,o,a){if("function"!=typeof r)throw new TypeError("The listener must be a function");var c=new i(r,o||e,a),s=n?n+t:t;return e._events[s]?e._events[s].fn?e._events[s]=[e._events[s],c]:e._events[s].push(c):(e._events[s]=c,e._eventsCount++),e}function a(e,t){0==--e._eventsCount?e._events=new r:delete e._events[t]}function c(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),c.prototype.eventNames=function(){var e,r,i=[];if(0===this._eventsCount)return i;for(r in e=this._events)t.call(e,r)&&i.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(e)):i},c.prototype.listeners=function(e){var t=n?n+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,o=r.length,a=new Array(o);i<o;i++)a[i]=r[i].fn;return a},c.prototype.listenerCount=function(e){var t=n?n+e:e,r=this._events[t];return r?r.fn?1:r.length:0},c.prototype.emit=function(e,t,r,i,o,a){var c=n?n+e:e;if(!this._events[c])return!1;var s,u,l=this._events[c],f=arguments.length;if(l.fn){switch(l.once&&this.removeListener(e,l.fn,void 0,!0),f){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,t),!0;case 3:return l.fn.call(l.context,t,r),!0;case 4:return l.fn.call(l.context,t,r,i),!0;case 5:return l.fn.call(l.context,t,r,i,o),!0;case 6:return l.fn.call(l.context,t,r,i,o,a),!0}for(u=1,s=new Array(f-1);u<f;u++)s[u-1]=arguments[u];l.fn.apply(l.context,s)}else{var d,p=l.length;for(u=0;u<p;u++)switch(l[u].once&&this.removeListener(e,l[u].fn,void 0,!0),f){case 1:l[u].fn.call(l[u].context);break;case 2:l[u].fn.call(l[u].context,t);break;case 3:l[u].fn.call(l[u].context,t,r);break;case 4:l[u].fn.call(l[u].context,t,r,i);break;default:if(!s)for(d=1,s=new Array(f-1);d<f;d++)s[d-1]=arguments[d];l[u].fn.apply(l[u].context,s)}}return!0},c.prototype.on=function(e,t,n){return o(this,e,t,n,!1)},c.prototype.once=function(e,t,n){return o(this,e,t,n,!0)},c.prototype.removeListener=function(e,t,r,i){var o=n?n+e:e;if(!this._events[o])return this;if(!t)return a(this,o),this;var c=this._events[o];if(c.fn)c.fn!==t||i&&!c.once||r&&c.context!==r||a(this,o);else{for(var s=0,u=[],l=c.length;s<l;s++)(c[s].fn!==t||i&&!c[s].once||r&&c[s].context!==r)&&u.push(c[s]);u.length?this._events[o]=1===u.length?u[0]:u:a(this,o)}return this},c.prototype.removeAllListeners=function(e){var t;return e?(t=n?n+e:e,this._events[t]&&a(this,t)):(this._events=new r,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=n,c.EventEmitter=c,e.exports=c},1640:function(e,t,n){e=n.nmd(e);var r="__lodash_hash_undefined__",i=9007199254740991,o="[object Arguments]",a="[object Boolean]",c="[object Date]",s="[object Function]",u="[object GeneratorFunction]",l="[object Map]",f="[object Number]",d="[object Object]",p="[object Promise]",v="[object RegExp]",h="[object Set]",g="[object String]",m="[object Symbol]",y="[object WeakMap]",b="[object ArrayBuffer]",w="[object DataView]",O="[object Float32Array]",j="[object Float64Array]",S="[object Int8Array]",x="[object Int16Array]",E="[object Int32Array]",k="[object Uint8Array]",_="[object Uint8ClampedArray]",A="[object Uint16Array]",T="[object Uint32Array]",P=/\w*$/,C=/^\[object .+?Constructor\]$/,I=/^(?:0|[1-9]\d*)$/,R={};R[o]=R["[object Array]"]=R[b]=R[w]=R[a]=R[c]=R[O]=R[j]=R[S]=R[x]=R[E]=R[l]=R[f]=R[d]=R[v]=R[h]=R[g]=R[m]=R[k]=R[_]=R[A]=R[T]=!0,R["[object Error]"]=R[s]=R[y]=!1;var L="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,N="object"==typeof self&&self&&self.Object===Object&&self,D=L||N||Function("return this")(),F=t&&!t.nodeType&&t,K=F&&e&&!e.nodeType&&e,M=K&&K.exports===F;function q(e,t){return e.set(t[0],t[1]),e}function z(e,t){return e.add(t),e}function H(e,t,n,r){var i=-1,o=e?e.length:0;for(r&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}function $(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}function U(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function V(e,t){return function(n){return e(t(n))}}function W(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}var B,X=Array.prototype,G=Function.prototype,J=Object.prototype,Z=D["__core-js_shared__"],Y=(B=/[^.]+$/.exec(Z&&Z.keys&&Z.keys.IE_PROTO||""))?"Symbol(src)_1."+B:"",Q=G.toString,ee=J.hasOwnProperty,te=J.toString,ne=RegExp("^"+Q.call(ee).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),re=M?D.Buffer:void 0,ie=D.Symbol,oe=D.Uint8Array,ae=V(Object.getPrototypeOf,Object),ce=Object.create,se=J.propertyIsEnumerable,ue=X.splice,le=Object.getOwnPropertySymbols,fe=re?re.isBuffer:void 0,de=V(Object.keys,Object),pe=Ke(D,"DataView"),ve=Ke(D,"Map"),he=Ke(D,"Promise"),ge=Ke(D,"Set"),me=Ke(D,"WeakMap"),ye=Ke(Object,"create"),be=$e(pe),we=$e(ve),Oe=$e(he),je=$e(ge),Se=$e(me),xe=ie?ie.prototype:void 0,Ee=xe?xe.valueOf:void 0;function ke(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function _e(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Ae(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Te(e){this.__data__=new _e(e)}function Pe(e,t){var n=Ve(e)||function(e){return function(e){return function(e){return!!e&&"object"==typeof e}(e)&&We(e)}(e)&&ee.call(e,"callee")&&(!se.call(e,"callee")||te.call(e)==o)}(e)?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],r=n.length,i=!!r;for(var a in e)!t&&!ee.call(e,a)||i&&("length"==a||ze(a,r))||n.push(a);return n}function Ce(e,t,n){var r=e[t];ee.call(e,t)&&Ue(r,n)&&(void 0!==n||t in e)||(e[t]=n)}function Ie(e,t){for(var n=e.length;n--;)if(Ue(e[n][0],t))return n;return-1}function Re(e,t,n,r,i,p,y){var C;if(r&&(C=p?r(e,i,p,y):r(e)),void 0!==C)return C;if(!Ge(e))return e;var I=Ve(e);if(I){if(C=function(e){var t=e.length,n=e.constructor(t);t&&"string"==typeof e[0]&&ee.call(e,"index")&&(n.index=e.index,n.input=e.input);return n}(e),!t)return function(e,t){var n=-1,r=e.length;t||(t=Array(r));for(;++n<r;)t[n]=e[n];return t}(e,C)}else{var L=qe(e),N=L==s||L==u;if(Be(e))return function(e,t){if(t)return e.slice();var n=new e.constructor(e.length);return e.copy(n),n}(e,t);if(L==d||L==o||N&&!p){if($(e))return p?e:{};if(C=function(e){return"function"!=typeof e.constructor||He(e)?{}:(t=ae(e),Ge(t)?ce(t):{});var t}(N?{}:e),!t)return function(e,t){return De(e,Me(e),t)}(e,function(e,t){return e&&De(t,Je(t),e)}(C,e))}else{if(!R[L])return p?e:{};C=function(e,t,n,r){var i=e.constructor;switch(t){case b:return Ne(e);case a:case c:return new i(+e);case w:return function(e,t){var n=t?Ne(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,r);case O:case j:case S:case x:case E:case k:case _:case A:case T:return function(e,t){var n=t?Ne(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}(e,r);case l:return function(e,t,n){var r=t?n(U(e),!0):U(e);return H(r,q,new e.constructor)}(e,r,n);case f:case g:return new i(e);case v:return function(e){var t=new e.constructor(e.source,P.exec(e));return t.lastIndex=e.lastIndex,t}(e);case h:return function(e,t,n){var r=t?n(W(e),!0):W(e);return H(r,z,new e.constructor)}(e,r,n);case m:return o=e,Ee?Object(Ee.call(o)):{}}var o}(e,L,Re,t)}}y||(y=new Te);var D=y.get(e);if(D)return D;if(y.set(e,C),!I)var F=n?function(e){return function(e,t,n){var r=t(e);return Ve(e)?r:function(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}(r,n(e))}(e,Je,Me)}(e):Je(e);return function(e,t){for(var n=-1,r=e?e.length:0;++n<r&&!1!==t(e[n],n,e););}(F||e,(function(i,o){F&&(i=e[o=i]),Ce(C,o,Re(i,t,n,r,o,e,y))})),C}function Le(e){return!(!Ge(e)||(t=e,Y&&Y in t))&&(Xe(e)||$(e)?ne:C).test($e(e));var t}function Ne(e){var t=new e.constructor(e.byteLength);return new oe(t).set(new oe(e)),t}function De(e,t,n,r){n||(n={});for(var i=-1,o=t.length;++i<o;){var a=t[i],c=r?r(n[a],e[a],a,n,e):void 0;Ce(n,a,void 0===c?e[a]:c)}return n}function Fe(e,t){var n,r,i=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof t?"string":"hash"]:i.map}function Ke(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return Le(n)?n:void 0}ke.prototype.clear=function(){this.__data__=ye?ye(null):{}},ke.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},ke.prototype.get=function(e){var t=this.__data__;if(ye){var n=t[e];return n===r?void 0:n}return ee.call(t,e)?t[e]:void 0},ke.prototype.has=function(e){var t=this.__data__;return ye?void 0!==t[e]:ee.call(t,e)},ke.prototype.set=function(e,t){return this.__data__[e]=ye&&void 0===t?r:t,this},_e.prototype.clear=function(){this.__data__=[]},_e.prototype.delete=function(e){var t=this.__data__,n=Ie(t,e);return!(n<0)&&(n==t.length-1?t.pop():ue.call(t,n,1),!0)},_e.prototype.get=function(e){var t=this.__data__,n=Ie(t,e);return n<0?void 0:t[n][1]},_e.prototype.has=function(e){return Ie(this.__data__,e)>-1},_e.prototype.set=function(e,t){var n=this.__data__,r=Ie(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},Ae.prototype.clear=function(){this.__data__={hash:new ke,map:new(ve||_e),string:new ke}},Ae.prototype.delete=function(e){return Fe(this,e).delete(e)},Ae.prototype.get=function(e){return Fe(this,e).get(e)},Ae.prototype.has=function(e){return Fe(this,e).has(e)},Ae.prototype.set=function(e,t){return Fe(this,e).set(e,t),this},Te.prototype.clear=function(){this.__data__=new _e},Te.prototype.delete=function(e){return this.__data__.delete(e)},Te.prototype.get=function(e){return this.__data__.get(e)},Te.prototype.has=function(e){return this.__data__.has(e)},Te.prototype.set=function(e,t){var n=this.__data__;if(n instanceof _e){var r=n.__data__;if(!ve||r.length<199)return r.push([e,t]),this;n=this.__data__=new Ae(r)}return n.set(e,t),this};var Me=le?V(le,Object):function(){return[]},qe=function(e){return te.call(e)};function ze(e,t){return!!(t=null==t?i:t)&&("number"==typeof e||I.test(e))&&e>-1&&e%1==0&&e<t}function He(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||J)}function $e(e){if(null!=e){try{return Q.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Ue(e,t){return e===t||e!=e&&t!=t}(pe&&qe(new pe(new ArrayBuffer(1)))!=w||ve&&qe(new ve)!=l||he&&qe(he.resolve())!=p||ge&&qe(new ge)!=h||me&&qe(new me)!=y)&&(qe=function(e){var t=te.call(e),n=t==d?e.constructor:void 0,r=n?$e(n):void 0;if(r)switch(r){case be:return w;case we:return l;case Oe:return p;case je:return h;case Se:return y}return t});var Ve=Array.isArray;function We(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=i}(e.length)&&!Xe(e)}var Be=fe||function(){return!1};function Xe(e){var t=Ge(e)?te.call(e):"";return t==s||t==u}function Ge(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Je(e){return We(e)?Pe(e):function(e){if(!He(e))return de(e);var t=[];for(var n in Object(e))ee.call(e,n)&&"constructor"!=n&&t.push(n);return t}(e)}e.exports=function(e){return Re(e,!0,!0)}},4486:function(e,t){var n,r,i;!function(o,a){"use strict";r=[],void 0===(i="function"==typeof(n=function(){function e(e){return!isNaN(parseFloat(e))&&isFinite(e)}function t(e){return e.charAt(0).toUpperCase()+e.substring(1)}function n(e){return function(){return this[e]}}var r=["isConstructor","isEval","isNative","isToplevel"],i=["columnNumber","lineNumber"],o=["fileName","functionName","source"],a=["args"],c=["evalOrigin"],s=r.concat(i,o,a,c);function u(e){if(e)for(var n=0;n<s.length;n++)void 0!==e[s[n]]&&this["set"+t(s[n])](e[s[n]])}u.prototype={getArgs:function(){return this.args},setArgs:function(e){if("[object Array]"!==Object.prototype.toString.call(e))throw new TypeError("Args must be an Array");this.args=e},getEvalOrigin:function(){return this.evalOrigin},setEvalOrigin:function(e){if(e instanceof u)this.evalOrigin=e;else{if(!(e instanceof Object))throw new TypeError("Eval Origin must be an Object or StackFrame");this.evalOrigin=new u(e)}},toString:function(){var e=this.getFileName()||"",t=this.getLineNumber()||"",n=this.getColumnNumber()||"",r=this.getFunctionName()||"";return this.getIsEval()?e?"[eval] ("+e+":"+t+":"+n+")":"[eval]:"+t+":"+n:r?r+" ("+e+":"+t+":"+n+")":e+":"+t+":"+n}},u.fromString=function(e){var t=e.indexOf("("),n=e.lastIndexOf(")"),r=e.substring(0,t),i=e.substring(t+1,n).split(","),o=e.substring(n+1);if(0===o.indexOf("@"))var a=/@(.+?)(?::(\d+))?(?::(\d+))?$/.exec(o,""),c=a[1],s=a[2],l=a[3];return new u({functionName:r,args:i||void 0,fileName:c,lineNumber:s||void 0,columnNumber:l||void 0})};for(var l=0;l<r.length;l++)u.prototype["get"+t(r[l])]=n(r[l]),u.prototype["set"+t(r[l])]=function(e){return function(t){this[e]=Boolean(t)}}(r[l]);for(var f=0;f<i.length;f++)u.prototype["get"+t(i[f])]=n(i[f]),u.prototype["set"+t(i[f])]=function(t){return function(n){if(!e(n))throw new TypeError(t+" must be a Number");this[t]=Number(n)}}(i[f]);for(var d=0;d<o.length;d++)u.prototype["get"+t(o[d])]=n(o[d]),u.prototype["set"+t(o[d])]=function(e){return function(t){this[e]=String(t)}}(o[d]);return u})?n.apply(t,r):n)||(e.exports=i)}()},2476:function(){Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector),Element.prototype.closest||(Element.prototype.closest=function(e){var t=this;do{if(Element.prototype.matches.call(t,e))return t;t=t.parentElement||t.parentNode}while(null!==t&&1===t.nodeType);return null})},903:function(e,t,n){"use strict";var r=n(3835),i=n.n(r),o=n(8645),a=n.n(o)()(i());a.push([e.id,".r34K7X1zGgAi6DllVF3T{box-sizing:border-box;border:0;margin:0;padding:0;overflow:hidden;z-index:2147483647;pointer-events:none;visibility:hidden;opacity:0;transition:opacity 300ms linear;height:0;width:0;position:absolute;top:-9999px;left:-9999px}.r34K7X1zGgAi6DllVF3T.active{display:block;visibility:visible}.r34K7X1zGgAi6DllVF3T.active.show{opacity:1;pointer-events:inherit;position:inherit}.r34K7X1zGgAi6DllVF3T.active.show.in-situ{width:inherit;height:inherit}.r34K7X1zGgAi6DllVF3T.active.show.lightbox{position:fixed;width:100% !important;height:100% !important;top:0;right:0;bottom:0;left:0}.r34K7X1zGgAi6DllVF3T.active.show.inline{position:static;left:0;top:0}@-moz-document url-prefix(''){.r34K7X1zGgAi6DllVF3T{visibility:visible;display:block}}\n",""]),a.locals={container:"r34K7X1zGgAi6DllVF3T"},t.Z=a},3379:function(e){"use strict";var t=[];function n(e){for(var n=-1,r=0;r<t.length;r++)if(t[r].identifier===e){n=r;break}return n}function r(e,r){for(var o={},a=[],c=0;c<e.length;c++){var s=e[c],u=r.base?s[0]+r.base:s[0],l=o[u]||0,f="".concat(u," ").concat(l);o[u]=l+1;var d=n(f),p={css:s[1],media:s[2],sourceMap:s[3],supports:s[4],layer:s[5]};if(-1!==d)t[d].references++,t[d].updater(p);else{var v=i(p,r);r.byIndex=c,t.splice(c,0,{identifier:f,updater:v,references:1})}a.push(f)}return a}function i(e,t){var n=t.domAPI(t);n.update(e);return function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap&&t.supports===e.supports&&t.layer===e.layer)return;n.update(e=t)}else n.remove()}}e.exports=function(e,i){var o=r(e=e||[],i=i||{});return function(e){e=e||[];for(var a=0;a<o.length;a++){var c=n(o[a]);t[c].references--}for(var s=r(e,i),u=0;u<o.length;u++){var l=n(o[u]);0===t[l].references&&(t[l].updater(),t.splice(l,1))}o=s}}},569:function(e){"use strict";var t={};e.exports=function(e,n){var r=function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}(e);if(!r)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");r.appendChild(n)}},9216:function(e){"use strict";e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},3565:function(e,t,n){"use strict";e.exports=function(e){var t=n.nc;t&&e.setAttribute("nonce",t)}},7795:function(e){"use strict";e.exports=function(e){var t=e.insertStyleElement(e);return{update:function(n){!function(e,t,n){var r="";n.supports&&(r+="@supports (".concat(n.supports,") {")),n.media&&(r+="@media ".concat(n.media," {"));var i=void 0!==n.layer;i&&(r+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),r+=n.css,i&&(r+="}"),n.media&&(r+="}"),n.supports&&(r+="}");var o=n.sourceMap;o&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(o))))," */")),t.styleTagTransform(r,e,t.options)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},4589:function(e){"use strict";e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={id:r,loaded:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e},n.nc=void 0;var r={};!function(){"use strict";function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(t){var n=function(t,n){if("object"!==e(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,n||"default");if("object"!==e(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(t)}(t,"string");return"symbol"===e(n)?n:String(n)}function i(e,n){for(var r=0;r<n.length;r++){var i=n[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,t(i.key),i)}}function o(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,n,r){return(n=t(n))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}n.r(r);var s,u=n(1640),l=n.n(u),f=(n(2476),"arkose"),d="2.2.2",p="inline",v="Verification challenge",h=("data-".concat(f,"-challenge-api-url"),"data-".concat(f,"-event-blocked")),g="data-".concat(f,"-event-completed"),m="data-".concat(f,"-event-hide"),y="data-".concat(f,"-event-ready"),b="data-".concat(f,"-event-ready-inline"),w="data-".concat(f,"-event-reset"),O="data-".concat(f,"-event-show"),j="data-".concat(f,"-event-suppress"),S="data-".concat(f,"-event-shown"),x="data-".concat(f,"-event-error"),E="data-".concat(f,"-event-warning"),k="data-".concat(f,"-event-resize"),_="data-".concat(f,"-event-data-request"),A="enforcement resize",T="enforcement loaded",P="challenge shown",C="config",I="data_response",R="settings loaded",L="api",N="enforcement",D="CAPI_RELOAD_EC",F="observability timer",K="data collected",M="update_frame_attributes",q="js_ready",z="default",H="ark",$="onAPILoad",U="onReady",V="onShown",W="onComplete",B="apiExecute",X="enforcementLoad",G="intersectionCheck",J="eventEnforcementLoad",Z="eventFPCollected",Y="eventSettingsLoad",Q=(c(s={},T,J),c(s,R,Y),c(s,K,Z),s),ee=n(913),te=n.n(ee),ne=function(e){return 4===(e.match(/-/g)||[]).length},re=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"api",t=function(e){if(document.currentScript)return document.currentScript;var t="enforcement"===e?'script[id="enforcementScript"]':'script[src*="v2"][src*="api.js"][data-callback]',n=document.querySelectorAll(t);if(n&&1===n.length)return n[0];try{throw new Error}catch(e){try{var r=te().parse(e)[0].fileName;return document.querySelector('script[src="'.concat(r,'"]'))}catch(e){return null}}}(e);if(!t)return null;var n=t.src,r={};try{r=function(e){if(!e)throw new Error("Empty URL");var t=e.toLowerCase().split("/v2/").filter((function(e){return""!==e}));if(t.length<2)throw new Error("Invalid Client-API URL");var n=t[0],r=t[1].split("/").filter((function(e){return""!==e}));return{host:n,key:ne(r[0])?r[0].toUpperCase():null,extHost:n}}(n)}catch(e){}if(e===N){var i=window.location.hash;if(i.length>0){var o=("#"===i.charAt(0)?i.substring(1):i).split("&"),a=o[0];r.key=ne(a)?a:r.key,r.id=o[1]}}return r}(),ie=function(e,t){for(var n,r=0;r<e.length;r+=1){var i=e[r],o=String(i.getAttribute("src"));if((o.match(t)||o.match("v2/api.js"))&&i.hasAttribute("data-callback")){n=i;break}}return n}(document.querySelectorAll("script"),re.key||null);if(ie){var oe=ie.nonce,ae=ie.getAttribute?ie.getAttribute("data-nonce"):null,ce=oe||ae;ce&&(n.nc=ce)}var se=function(e){return"function"==typeof e},ue=function(e,t,n){try{var r=t.split("."),i=e;return r.forEach((function(e){i=i[e]})),i||n}catch(e){return n}},le=function(t){var n=t,r=e(t);return("string"!==r||"string"===r&&-1===t.indexOf("px")&&-1===t.indexOf("vw")&&-1===t.indexOf("vh"))&&(n="".concat(t,"px")),n},fe=function(e,t){if(e[H])e[H][t]||(e[H][t]={});else{var n=t?c({},t,{}):{};Object.defineProperty(e,H,{value:n,writable:!0})}},de=function(e,t,n,r){e[H]&&e[H][t]||fe(e,t),e[H][t][n]=r};function pe(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var ve=function(){return window&&window.crypto&&"function"==typeof window.crypto.getRandomValues?([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,(function(e){return(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)})):"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)}))},he=n(2265),ge=n.n(he),me=n(7983);function ye(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function be(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ye(Object(n),!0).forEach((function(t){c(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ye(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var we=["settings","styling","token"],Oe=function t(n){return"object"===e(n)&&null!==n?Object.keys(n).reduce((function(r,i){var o,a=n[i],s=e(a),u=a;return-1===we.indexOf(i)&&("string"===s&&(u=""===(o=a)?o:(0,me.N)(o)),"object"===s&&(u=Array.isArray(a)?a:t(a))),be(be({},r),{},c({},i,u))}),{}):n};function je(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Se(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?je(Object(n),!0).forEach((function(t){c(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):je(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var xe=function(){function e(){var t=this;a(this,e),this.config={context:null,target:"*",identifier:null,iframePosition:null},this.emitter=new(ge()),this.messageListener=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{var n=function(e){return JSON.parse(e)}(e.data),r=n||{},i=r.data,o=r.key,a=r.message,c=r.type,s=Oe(i);if(a&&o===t.config.identifier)return t.emitter.emit(a,s),"broadcast"===c&&t.postMessageToParent({data:s,key:o,message:a}),void("emit"===c&&t.postMessageToChildren({data:s,key:o,message:a}));n&&"FunCaptcha-action"===n.msg&&t.postMessageToChildren({data:Se(Se({},n),n.payload||{})})}catch(n){if(e.data===q)return void t.emitter.emit(q,{});if(e.data===D)return void t.emitter.emit(D,{});if(e.data.msg===M)return void t.emitter.emit(M,{});"string"==typeof e.data&&-1!==e.data.indexOf("key_pressed_")&&t.config.iframePosition===N&&window.parent&&"function"==typeof window.parent.postMessage&&window.parent.postMessage(e.data,"*")}}}return o(e,[{key:"context",set:function(e){this.config.context=e}},{key:"identifier",set:function(e){this.config.identifier=e}},{key:"setup",value:function(e,t){var n,r,i;this.config.identifier!==this.identifier&&(n=window,r=this.config.identifier,(i=n[H])&&i[r]&&(i[r].listener&&window.removeEventListener("message",i[r].listener),i[r].error&&window.removeEventListener("error",i[r].error),delete i[r])),this.config.identifier=e,this.config.iframePosition=t,fe(window,this.config.identifier);var o=window[H][this.config.identifier].listener;o&&window.removeEventListener("message",o),de(window,this.config.identifier,"listener",this.messageListener),window.addEventListener("message",window[H][this.config.identifier].listener)}},{key:"postMessage",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=t.data,r=t.key,i=t.message,o=t.type;if(se(e.postMessage)){var a=Se(Se({},n),{},{data:n,key:r,message:i,type:o});e.postMessage(function(e){return JSON.stringify(e)}(a),this.config.target)}}},{key:"postMessageToChildren",value:function(e){for(var t=e.data,n=e.key,r=e.message,i=document.querySelectorAll("iframe"),o=[],a=0;a<i.length;a+=1){var c=i[a].contentWindow;c&&o.push(c)}for(var s=0;s<o.length;s+=1){var u=o[s];this.postMessage(u,{data:t,key:n,message:r,type:"emit"},this.config.target)}}},{key:"postMessageToParent",value:function(e){var t=e.data,n=e.key,r=e.message;window.parent!==window&&this.postMessage(window.parent,{data:t,key:n,message:r,type:"broadcast"})}},{key:"emit",value:function(e,t){this.emitter.emit(e,t),this.postMessageToParent({message:e,data:t,key:this.config.identifier}),this.postMessageToChildren({message:e,data:t,key:this.config.identifier})}},{key:"off",value:function(){var e;(e=this.emitter).removeListener.apply(e,arguments)}},{key:"on",value:function(){var e;(e=this.emitter).on.apply(e,arguments)}},{key:"once",value:function(){var e;(e=this.emitter).once.apply(e,arguments)}}]),e}(),Ee=new xe,ke=["logged"];function _e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ae(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_e(Object(n),!0).forEach((function(t){c(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_e(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Te,Pe,Ce,Ie,Re="sampled",Le="error",Ne={onReady:3e4,onShown:6e4},De={enabled:{type:"boolean",default:!1},onReadyThreshold:{type:"integer",default:Ne.onReady},onShownThreshold:{type:"integer",default:Ne.onShown},windowErrorEnabled:{type:"boolean",default:!0},samplePercentage:{type:"float",default:1}},Fe=function(e,t,n,r){Ee.emit(F,{action:e,timerId:t,subTimerId:n||null,time:Date.now(),info:r})},Ke=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=Date.now();Te||(Te=n,Pe=n);var r=n-Te,i=n-Pe;Ie&&(t?console.debug("%c".concat(Ce).concat(e,": ").concat(r," since last event - ").concat(i," total time - ").concat(Date.now()),"color: ".concat(t,";")):console.debug("".concat(Ce).concat(e,": ").concat(r," since last event - ").concat(i," total time - ").concat(Date.now()))),Te=n},Me=n(3940),qe=n.n(Me),ze=We;!function(e,t){for(var n=119,r=134,i=122,o=118,a=133,c=131,s=137,u=107,l=113,f=We,d=e();;)try{if(379847===-parseInt(f(n))/1*(-parseInt(f(r))/2)+parseInt(f(i))/3+parseInt(f(o))/4+parseInt(f(a))/5+-parseInt(f(c))/6+parseInt(f(s))/7*(-parseInt(f(u))/8)+-parseInt(f(l))/9)break;d.push(d.shift())}catch(e){d.push(d.shift())}}(Je);var He,$e,Ue=(He=115,$e=!0,function(e,t){var n=$e?function(){if(t){var n=t[We(He)](e,arguments);return t=null,n}}:function(){};return $e=!1,n}),Ve=Ue(void 0,(function(){var e=117,t=121,n=132,r=109,i=We;return Ve[i(e)]()[i(t)](i(n)+i(r))[i(e)]().constructor(Ve)[i(t)]("(((.+)+)+)+$")}));function We(e,t){var n=Je();return We=function(e,t){return n[e-=102]},We(e,t)}Ve();var Be=[ze(135),ze(116)+ze(102)],Xe={};Xe[ze(130)]=!0;var Ge={};function Je(){var e=["operty","98752jXTTXx","hasOwnPr","+)+$","forEach","enabled","eOffset","3115449jUsVhz","call","apply","ECRespon","toString","1311240fFqRvl","63617knDNJe","prototyp","search","1622595aRpzHJ","theme","closeOnE","eButton","keys","observab","optional","hideClos","default","4164720ByzkrJ","(((.+)+)","1499220eaMZBt","18zEdzoa","lightbox","ility","182OLSPTB","sive","length","settings","landscap"];return(Je=function(){return e})()}Ge.default=!1;var Ze={};Ze[ze(124)+"sc"]=Xe,Ze[ze(129)+ze(125)]=Ge;var Ye={};Ye[ze(130)]=!0;var Qe={};Qe[ze(130)]=70;var et={};et[ze(111)]=Ye,et[ze(105)+ze(112)]=Qe;var tt={};tt[ze(130)]={};var nt={optional:!0},rt={};rt[ze(135)]=Ze,rt[ze(116)+ze(102)]=et,rt[ze(127)+ze(136)]=tt,rt.f=nt;var it=rt,ot=function(){var e=123,t=104,n=135,r=116,i=102,o=110,a=126,c=120,s=108,u=106,l=114,f=128,d=110,p=ze,v=arguments[p(103)]>0&&void 0!==arguments[0]?arguments[0]:{},h=v[p(e)],g=void 0===h?null:h,m=v[p(t)]||v,y={};y[p(n)]={},y[p(r)+p(i)]={};var b=y;["lightbox",p(r)+p(i)][p(o)]((function(e){var t=120,n=106,r=114,i=p,o=m[e]||{},a=it[e];Object.keys(a)[i(d)]((function(c){var s=i;Object[s(t)+"e"]["hasOwnPr"+s(n)][s(r)](o,c)?b[e][c]=o[c]:b[e][c]=a[c].default}))})),g&&(b.theme=g);it[p(n)],it[p(r)+p(i)];var w=pe(it,Be);return Object[p(a)](w).forEach((function(e){var t=p;Object[t(c)+"e"][t(s)+t(u)][t(l)](m,e)?b[e]=m[e]:!0!==it[e][t(f)]&&(b[e]=it[e].default)})),b},at=n(3379),ct=n.n(at),st=n(7795),ut=n.n(st),lt=n(569),ft=n.n(lt),dt=n(3565),pt=n.n(dt),vt=n(9216),ht=n.n(vt),gt=n(4589),mt=n.n(gt),yt=n(903),bt={};bt.styleTagTransform=mt(),bt.setAttributes=pt(),bt.insert=ft().bind(null,"head"),bt.domAPI=ut(),bt.insertStyleElement=ht();ct()(yt.Z,bt);var wt=yt.Z&&yt.Z.locals?yt.Z.locals:void 0;function Ot(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var jt={show:!1,isActive:void 0,element:void 0,frame:void 0,mode:void 0,ECResponsive:!0,enforcementUrl:null},St=function(e,t){e.setAttribute("class",t)},xt=function(){return qe()(wt.container,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ot(Object(n),!0).forEach((function(t){c(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ot(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({show:!!jt.show,active:!!jt.isActive},jt.mode?c({},jt.mode,!0):{}))};Ee.on("challenge iframe",(function(e){var t=e.width,n=e.height,r=e.minWidth,i=e.minHeight,o=e.maxWidth,a=e.maxHeight;if(jt.frame){jt.show=!0;var c=xt();St(jt.frame,c);var s=n,u=t;if(jt.ECResponsive){var l=function(e){var t=e.width,n=e.height,r=e.minWidth,i=e.maxWidth,o=e.minHeight,a=e.maxHeight,c=e.landscapeOffset,s=t,u=n;if(!r||!i)return{height:u,width:s};if(window.screen&&window.screen.width&&window.screen.height){var l=window.screen.availHeight||window.screen.height,f=window.screen.availWidth||window.screen.width,d=l-(!window.orientation||90!==window.orientation&&-90!==window.orientation?0:c);s=f,u=o&&a?d:n,f>=parseInt(i,10)&&(s=i),f<=parseInt(r,10)&&(s=r),a&&d>=parseInt(a,10)&&(u=a),o&&d<=parseInt(o,10)&&(u=o)}return s=le(s),{height:u=le(u),width:s}}({width:t,height:n,minWidth:r,maxWidth:o,minHeight:i,maxHeight:a,landscapeOffset:jt.ECResponsive.landscapeOffset||0});u=l.width,s=l.height}var f=!1;t&&t!==jt.frame.style.width&&(jt.frame.style.width=t,f=!0),n&&n!==jt.frame.style.height&&(jt.frame.style.height=n,f=!0),jt.mode===p&&(r&&r!==jt.frame.style["min-width"]&&(jt.frame.style["min-width"]=r,f=!0),i&&i!==jt.frame.style["min-height"]&&(jt.frame.style["min-height"]=i,f=!0),o&&o!==jt.frame.style["max-width"]&&(jt.frame.style["max-width"]=o,f=!0),a&&a!==jt.frame.style["max-height"]&&(jt.frame.style["max-height"]=a,f=!0)),f&&Ee.emit(A,{width:u,height:s}),document.activeElement!==jt.element&&!1===jt.mode&&jt.frame.focus()}}));var Et=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={},n=["publicKey","data","isSDK","language","mode","onDataRequest","onCompleted","onHide","onReady","onReset","onResize","onShow","onShown","onSuppress","onError","onWarning","onFailed","onResize","settings","selector","accessibilitySettings","styleTheme","uaTheme","apiLoadTime","enableDirectionalInput","inlineRunOnTrigger"];return Object.keys(e).filter((function(e){return-1!==n.indexOf(e)})).forEach((function(n){t[n]=e[n]})),t};!function(e,t){for(var n=190,r=191,i=203,o=201,a=197,c=208,s=198,u=202,l=193,f=207,d=192,p=204,v=Tt,h=e();;)try{if(134883===parseInt(v(n))/1*(parseInt(v(r))/2)+-parseInt(v(i))/3*(parseInt(v(o))/4)+-parseInt(v(a))/5+-parseInt(v(c))/6+-parseInt(v(s))/7*(-parseInt(v(u))/8)+-parseInt(v(l))/9*(-parseInt(v(f))/10)+-parseInt(v(d))/11*(parseInt(v(p))/12))break;h.push(h.shift())}catch(e){h.push(h.shift())}}(At);var kt=function(){var e=195,t=!0;return function(n,r){var i=t?function(){if(r){var t=r[Tt(e)](n,arguments);return r=null,t}}:function(){};return t=!1,i}}(),_t=kt(void 0,(function(){var e=205,t=194,n=196,r=200,i=189,o=199,a=Tt;return _t[a(200)]()[a(e)](a(t)+a(n))[a(r)]()[a(i)+a(o)](_t).search(a(t)+a(n))}));function At(){var e=["331140bObYZE","3269dePuBo","tor","toString","124700NFjzSD","3256galLZq","3gvmdVa","594444sQfUHh","search","split","38730GmOFGi","1057680axFmxk","construc","3vjqrlw","142958HOfWqr","55qzyzgN","585eyUPFl","(((.+)+)","apply","+)+$"];return(At=function(){return e})()}function Tt(e,t){var n=At();return Tt=function(e,t){return n[e-=189]},Tt(e,t)}_t();!function(e,t){for(var n=459,r=464,i=458,o=461,a=475,c=471,s=454,u=477,l=455,f=476,d=463,p=Rt,v=e();;)try{if(217126===parseInt(p(n))/1+-parseInt(p(r))/2+parseInt(p(i))/3*(parseInt(p(o))/4)+parseInt(p(a))/5*(parseInt(p(c))/6)+-parseInt(p(s))/7*(parseInt(p(u))/8)+-parseInt(p(l))/9+parseInt(p(f))/10*(parseInt(p(d))/11))break;v.push(v.shift())}catch(e){v.push(v.shift())}}(It);var Pt=function(){var e=479,t=!0;return function(n,r){var i=t?function(){if(r){var t=r[Rt(e)](n,arguments);return r=null,t}}:function(){};return t=!1,i}}(),Ct=Pt(void 0,(function(){var e=469,t=466,n=457,r=462,i=460,o=473,a=466,c=457,s=Rt;return Ct[s(462)]()[s(e)](s(t)+s(n))[s(r)]()[s(i)+s(o)](Ct)[s(e)](s(a)+s(c))}));function It(){var e=["724465bXqSUS","322020jhTTBg","118424nMYndJ","nOnTrigg","apply","77wyYzHF","1267956rJKgkn","location","+)+$","9iclmJq","198561xLEuCT","construc","339236wQBSpJ","toString","66YyrQIj","540500wywSxE","language","(((.+)+)","href","__nightm","search","isSDK","6TpKyDX","inlineRu","tor","are"];return(It=function(){return e})()}function Rt(e,t){var n=It();return Rt=function(e,t){return n[e-=454]},Rt(e,t)}Ct();var Lt,Nt,Dt=function(){var e=456,t=467,n=467,r=Rt;return window[r(e)][r(t)]?function(e){return e||"string"==typeof e?e[Tt(206)]("?")[0]:null}(window[r(e)][r(n)]):null},Ft=function(e){return"boolean"==typeof e?e:null},Kt=function(){var e=474,t=Rt;return!!window[t(468)+t(e)]};function Mt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function qt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Mt(Object(n),!0).forEach((function(t){c(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Mt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}Ce="API: ",Ie=Nt,Ke("Starting app");var zt=re.key,Ht=re.host,$t=re.extHost;Ke("Starting observer");var Ut=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:5e3,i=t,o=n,a=ve(),s=function(){var e={},t=window.navigator;if(e.platform=t.platform,e.language=t.language,t.connection)try{e.connection={effectiveType:t.connection.effectiveType,rtt:t.connection.rtt,downlink:t.connection.downlink}}catch(e){}return e}(),u={},l={},f=e,d=null,p={},v=null,h=null,g={timerCheckInterval:r},m=!1,y=!1,b=!1,w=!1,O=!1,j=function(){var e;if(w){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];"string"==typeof n[0]&&(n[0]="Observability - ".concat(n[0])),(e=console).log.apply(e,n)}},S=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.timerId,n=e.type;if(!0===g.enabled){var r=t?c({},t,u[t]):u,d=Object.keys(r).reduce((function(e,t){r[t].logged=!0;var n=r[t],i=(n.logged,pe(n,ke));return Ae(Ae({},e),{},c({},t,i))}),{}),m={id:a,publicKey:f,capiVersion:o,mode:h,suppressed:O,device:s,error:p,windowError:l,sessionId:v,timers:d,sampled:n===Re};j("Logging Metrics:",m);try{var y=new XMLHttpRequest;y.open("POST",i),y.send(JSON.stringify(m))}catch(e){}}},x=function(e){return g&&Object.prototype.hasOwnProperty.call(g,"".concat(e,"Threshold"))?g["".concat(e,"Threshold")]:Ne[e]},E=function e(){if(b)return!1;var t=!1;return m&&(Object.keys(u).forEach((function(e){var n=x(e),r=u[e],i=r.diff,o=r.logged,a=r.end;if(0!==n&&!0!==o&&(i&&i>n&&(t=!0,u[e].logged=!0),!i&&!a)){var c=u[e].start,s=Date.now(),l=s-c;l>n&&(u[e].diff=l,u[e].end=s,u[e].logged=!0,t=!0)}})),t&&S()),d=setTimeout(e,g.timerCheckInterval),!0},k=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Ae(Ae({},{start:null,end:null,diff:null,threshold:null,logged:!1,metrics:{}}),e)},_=function(){return{id:a,publicKey:f,sessionId:v,mode:h,settings:g,device:s,error:p,windowError:l,timers:u,debugEnabled:w}},A=function(){clearTimeout(d)};d=setTimeout(E,g.timerCheckInterval);try{"true"===window.localStorage.getItem("capiDebug")&&(w=!0,window.capiObserver={getValues:_})}catch(e){}return{getValues:_,timerStart:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now(),n=u[e]||{};if(!n.start){var r=x(e);j("".concat(e," started:"),t),u[e]=k(Ae(Ae({},n),{},{start:t,threshold:r}))}},timerEnd:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now(),n=u[e];n&&!n.end&&(n.end=t,n.diff=n.end-n.start,j("".concat(e," ended:"),t,n.diff),b&&S({timerId:e,type:Re}))},timerCheck:E,subTimerStart:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Date.now(),r=arguments.length>3?arguments[3]:void 0,i=u[e];i||(i=k()),i.end||(i.metrics[t]=Ae({start:n,end:null,diff:null},r&&{info:r}),u[e]=i,j("".concat(e,".").concat(t," started:"),n))},subTimerEnd:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Date.now(),r=u[e];if(r&&!r.end){var i=r.metrics[t];i&&(i.end=n,i.diff=i.end-i.start,j("".concat(e,".").concat(t," ended:"),n,i.diff))}},cancelIntervalTimer:A,setup:function(e,t){m=!0,g=Ae(Ae({},g),function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.keys(De).reduce((function(t,n){var r=e[n],i=De[n];if("boolean"===i.type)return Ae(Ae({},t),{},c({},n,"boolean"==typeof r?r:i.default));var o="float"===i.type?parseFloat(r,0):parseInt(r,10);return Ae(Ae({},t),{},c({},n,isNaN(o)?i.default:o))}),{})}(e)),h=t,Object.keys(u).forEach((function(e){var t=x(e);u[e].threshold=t}));var n,r=g.samplePercentage;n=r,(b=Math.random()<=n/100)&&A(),j("Session sampled:",b)},setSession:function(e){v=e},logError:function(e){y||(p=e,y=!0,S({type:Le}))},logWindowError:function(e,t,n,r){g&&!0!==g.windowErrorEnabled||(l[e]={message:t,filename:n,stack:r})},debugLog:j,setSuppressed:function(){O=!0},setPublicKey:function(e){f=e,y=!1,p={},["onShown","onComplete"].forEach((function(e){if(u[e]){var t=u[e].threshold||null;u[e]=k({threshold:t})}}))},observabilityTimer:Fe,apiLoadTimerSetup:function(e,t){u[e]=Ae(Ae({},t),{},{logged:!1}),b&&S({timerId:e,type:Re})}}}(zt,"".concat($t).concat("/metrics/ui"),d,5e3);Ut.subTimerStart(U,B);var Vt=function(e){return"arkose-".concat(e,"-wrapper")},Wt={},Bt="onCompleted",Xt="onHide",Gt="onReady",Jt="onReset",Zt="onShow",Yt="onShown",Qt="onSuppress",en="onFailed",tn="onError",nn="onWarning",rn="onResize",on="onDataRequest",an=(c(Lt={},g,Bt),c(Lt,m,Xt),c(Lt,y,Gt),c(Lt,b,Gt),c(Lt,w,Jt),c(Lt,O,Zt),c(Lt,S,Yt),c(Lt,j,Qt),c(Lt,h,en),c(Lt,x,tn),c(Lt,E,nn),c(Lt,k,rn),c(Lt,_,on),Lt);Ke("Set all hooks");var cn=o((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.completed,r=t.token,i=t.suppressed,o=t.error,c=t.warning,s=t.width,u=t.height,l=t.requested;a(this,e),this.completed=!!n,this.token=r||null,this.suppressed=!!i,this.error=o||null,this.warning=c||null,this.width=s||0,this.height=u||0,this.requested=l||null}));Ke("Instantiated Ark Hook Class");var sn=function(e){var t=document.createElement("div");return t.setAttribute("aria-hidden",!0),t.setAttribute("class",Vt(e||zt)),t},un=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return qt(qt({element:sn(),inactiveElement:null,bodyElement:document.querySelector("body"),savedActiveElement:null,modifiedSiblings:[],challengeLoadedEvents:[],container:null,elements:function(){return document.querySelectorAll(Wt.config.selector)},initialSetupCompleted:!1,enforcementLoaded:!1,enforcementReady:!1,getPublicKeyTimeout:null,isActive:!1,isHidden:!1,isReady:!1,isConfigured:!1,suppressed:!1,isResettingChallenge:!1,lastResetTimestamp:0,isCompleteReset:!1,fpData:null,onReadyEventCheck:[],width:0,height:0,token:null,externalRequested:!1},t),{},{config:qt(qt({},zt?{publicKey:zt}:{}),{},{selector:(e=zt,"[data-".concat(f,'-public-key="').concat(e,'"]')),styleTheme:t.config&&t.config.styleTheme||z,siteData:{location:{...window.location,origin:"https://chat.openai.com"}},apiLoadTime:null,settings:{},accessibilitySettings:{lockFocusToModal:!0}},t.config),events:qt({},t.events)})},ln=function(e){var t=Wt.events[an[e]];if(se(t)){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];t.apply(void 0,r)}},fn=function(){Ke("Rendering enforcement frame","blue"),function(e){var t=e.host,n=e.id,r=e.publicKey,i=e.element,o=e.config,a=e.isActive,c=e.isReady,s=e.capiObserver;Ke("Creating iframe");var u=ue(o,"mode");jt.mode=u,jt.element=i,jt.isActive=a,jt.show=c,jt.ECResponsive=ue(ot(o.settings),"ECResponsive",{}),jt.accessibilitySettings=ue(o,"accessibilitySettings");var l=xt(),f=function(e){var t=e.host,n=e.publicKey,r=e.id,i=e.file;return"development"===e.environment?"".concat(i,"#").concat(n||"","&").concat(r):"".concat(t,"/v2/").concat(i,"#").concat(n||"","&").concat(r)}({host:t,publicKey:r,id:n,file:"2.2.2/enforcement.7fe4ebdd37c791e59a12da2c9c38eec6.html",environment:"production"});if(ue(jt.element,"children",[]).length<1){jt.enforcementUrl=f;var d=document.createElement("iframe");d.setAttribute("src",f),d.setAttribute("class",l),d.setAttribute("title",v),d.setAttribute("aria-label",v),d.setAttribute("data-e2e","enforcement-frame"),d.style.width="0px",d.style.height="0px",d.addEventListener("load",(function(){s.subTimerEnd(U,X)})),s.subTimerStart(U,X),jt.element.appendChild(d),jt.frame=d}else f!==jt.enforcementUrl&&(jt.frame.setAttribute("src",f),jt.enforcementUrl=f),St(jt.frame,l),jt.isActive||(jt.frame.style.width=0,jt.frame.style.height=0)}({host:'https://tcr9i.chat.openai.com',id:Wt.id,publicKey:Wt.config.publicKey,element:Wt.element,config:Wt.config,isActive:Wt.isActive,isReady:Wt.isReady,capiObserver:Ut})},dn=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=Wt,n=t.element,r=t.bodyElement,i=t.container,o=t.events,a=t.lastResetTimestamp,c=t.config;if(c.publicKey){var s=Date.now();if(!(s-a<100)){Wt.lastResetTimestamp=s,Wt.isActive=!1,Wt.completed=!1,Wt.token=null,Wt.isReady=!1,Wt.onReadyEventCheck=[],fn(),r&&o&&(r.removeEventListener("click",o.bodyClicked),window.removeEventListener("keyup",o.escapePressed),Wt.events.bodyClicked=null,Wt.events.escapePressed=null);var u=n;Wt.inactiveElement=u,Wt.element=void 0,Wt.element=sn(c.publicKey),i&&u&&i.contains(u)&&(Ee.emit("enforcement detach"),setTimeout((function(){try{i.removeChild(u)}catch(e){}}),5e3)),Wt=un(l()(Wt)),e||ln(w,new cn(Wt)),yn()}}},pn=function(e){Wt.element.setAttribute("aria-hidden",e)},vn=function(){Ke("Showing enforcement"),Wt.enforcementReady&&!Wt.isActive&&(Ee.emit("trigger show"),Wt.isHidden&&(Wt.isHidden=!1,Wt.isReady&&Ee.emit(P,{token:Wt.token})))},hn=function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).manual;Wt.isActive=!1,e&&(Wt.isHidden=!0),ln(m,new cn(Wt)),Wt.savedActiveElement&&(Wt.savedActiveElement.focus(),Wt.savedActiveElement=null),ue(Wt,"config.mode")!==p&&function(){for(var e=Wt.modifiedSiblings,t=0;t<e.length;t+=1){var n=e[t],r=n.elem,i=n.ariaHiddenState;r!==Wt.appEl&&(null===i?r.removeAttribute("aria-hidden"):r.setAttribute("aria-hidden",i))}}(),fn(),pn(!0)},gn=function(e){e.target.closest(Wt.config.selector)&&vn()},mn=function(e){return 27!==ue(e,"keyCode")?null:hn({manual:!0})},yn=function(){return ue(Wt,"config.mode")===p?(Ke("Setting up inline"),Wt.container=document.querySelector(ue(Wt,"config.selector","")),void(Wt.container&&(Wt.container.contains(Wt.element)||(Wt.container.appendChild(Wt.element),fn())))):(Ke("Setting up Modal"),Wt.container=Wt.bodyElement,Wt.events.bodyClicked||(Wt.events.bodyClicked=gn,Wt.bodyElement.addEventListener("click",Wt.events.bodyClicked)),Wt.events.escapePressed||(Wt.events.escapePressed=mn,window.addEventListener("keyup",Wt.events.escapePressed)),void(Wt.container&&(Wt.container.contains(Wt.element)||(Wt.container.appendChild(Wt.element),fn()))))},bn=function(){var e=ve();Ut.subTimerEnd(U,B),Ke("API Execute done"),fe(window,e),Ke("Set up Window"),Ee.setup(e,L),Ke("Set up emitter"),function(e){if(e){var t=window[H][e].error;t&&window.removeEventListener("error",t)}de(window,e,"error",(function(e){var t=e.message,n=e.filename,r=e.error;if(n&&"string"==typeof n&&n.indexOf("api.js")>=0&&n.indexOf(Wt.config.publicKey)>=0){var i=r.stack;Ut.logWindowError("integration",t,n,i)}})),window.addEventListener("error",window[H][e].error)}(e),Ke("Set up window error"),Wt=un({id:e})},wn=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Wt.initialSetupCompleted=!0;var n=function(e){return e===p?p:"lightbox"}(t.mode||ue(Wt,"config.mode")),r=t.styleTheme||z,i=Wt.isConfigured&&r!==Wt.config.styleTheme;Wt.isConfigured=!0;var o=zt||Wt.config.publicKey||null,a=!1;t.publicKey&&o!==t.publicKey&&(!function(e){Ke("Seting up key"),de(window,Wt.id,"publicKey",e),Ut.setPublicKey(e),Wt.element&&Wt.element.getAttribute&&(Wt.element.getAttribute("class").match(e)||Wt.element.setAttribute("class",Vt(e))),Ke("Set up key")}(t.publicKey),o=t.publicKey,Wt.config.publicKey&&Wt.config.publicKey!==t.publicKey&&(a=!0)),Wt.config=qt(qt(qt(qt({},Wt.config),t),{mode:n}),{},{styleTheme:r,publicKey:o,language:""!==t.language?t.language||Wt.config.language:void 0}),Wt.events=qt(qt({},Wt.events),{},(c(e={},Bt,t[Bt]||Wt.events[Bt]),c(e,en,t[en]||Wt.events[en]),c(e,Xt,t[Xt]||Wt.events[Xt]),c(e,Gt,t[Gt]||Wt.events[Gt]),c(e,Jt,t[Jt]||Wt.events[Jt]),c(e,Zt,t[Zt]||Wt.events[Zt]),c(e,Yt,t[Yt]||Wt.events[Yt]),c(e,Qt,t[Qt]||Wt.events[Qt]),c(e,tn,t[tn]||Wt.events[tn]),c(e,nn,t[nn]||Wt.events[nn]),c(e,rn,t[rn]||Wt.events[rn]),c(e,on,t[on]||Wt.events[on]),e)),Wt.config.pageLevel=function(e){var t,n=465,r=470,i=472,o=478,a=Rt;return{chref:Dt(),clang:null!==(t=e[a(n)])&&void 0!==t?t:null,surl:null,sdk:Ft(e[a(r)])||!1,nm:Kt(),triggeredInline:e[a(i)+a(o)+"er"]||!1}}(Wt.config),Ke("Configured initial state"),Ee.emit(C,Wt.config),Ke("Emitt Config event"),i||a?(Ke("Resetting enforcement"),dn(!0)):(Ke("Call setup mode"),yn()),"lightbox"===n&&(Wt.element.setAttribute("aria-modal",!0),Wt.element.setAttribute("role","dialog"))},On=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.event,n=e.observability;if(Wt.onReadyEventCheck.push(t),n){var r=n.timerId,i=n.subTimerId,o=n.time;Ut.subTimerEnd(r,i,o)}Q[t]&&Ut.subTimerEnd(U,Q[t]);var a=[T,K,R];Ut.subTimerStart(U,G);var c=function(e,t){var n,r,i=[],o=e.length,a=t.length;for(n=0;n<o;n+=1)for(r=0;r<a;r+=1)e[n]===t[r]&&i.push(e[n]);return i}(a,Wt.onReadyEventCheck);c.length===a.length&&(Wt.enforcementReady=!0,Wt.onReadyEventCheck=[],Ut.subTimerEnd(U,G),Wt.isCompleteReset||(Ut.timerEnd(U),Ke("onReady triggered","orange"),ln(y,new cn(Wt))),Wt.isCompleteReset=!1),Ke("onReady event: ".concat(t),"green")},jn=function(e){var t=e.token;if(t){Wt.token=t;var n=t.split("|"),r=n.length?n[0]:null;Ut.setSession(r)}},Sn={setConfig:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Ut.timerStart(U),[J,Y,Z].forEach((function(e){Ut.subTimerStart(U,e)})),wn(Et(e))},getConfig:function(){return l()(Wt.config)},dataResponse:function(e){if(Wt.requested){var t={message:I,data:e,key:Wt.config.publicKey,type:"emit"};Ee.emit(I,t),Wt.requested=null}},reset:function(){dn()},run:vn,version:d},xn=ie.getAttribute("data-callback");Ke("Set up Every function"),Ee.on("show enforcement",(function(){Wt.isReady||(Ut.timerStart(V),Ut.timerStart(W)),Wt.isActive=!0,Wt.savedActiveElement=document.activeElement,ln(O,new cn(Wt)),ue(Wt,"config.mode")!==p&&function(){var e=Wt.bodyElement.children;Wt.modifiedSiblings=[];for(var t=0;t<e.length;t+=1){var n=e.item(t),r=n.getAttribute("aria-hidden");n!==Wt.appEl&&"true"!==r&&(Wt.modifiedSiblings.push({elem:n,ariaHiddenState:r}),n.setAttribute("aria-hidden",!0))}}(),fn(),pn(!1)})),Ee.on(P,(function(e){var t=e.token;Wt.isReady=!0,Wt.token=t,Wt.isHidden||(Wt.isActive=!0,fn(),Ut.timerEnd(V),ln(S,new cn(Wt)))})),Ee.on("challenge completed",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Wt.completed=!0,Wt.token=e.token,Ut.timerEnd(W),ln(g,new cn(Wt)),ue(Wt,"config.mode")!==p&&(Wt.isCompleteReset=!0,dn())})),Ee.on("hide enforcement",hn),Ee.on(A,(function(e){var t=e.width,n=e.height;Wt.width=t,Wt.height=n,ln(k,new cn(Wt))})),Ee.on(T,(function(){Ke("Got enforcement loaded","darkblue"),Wt.enforcementLoaded=!0,On({event:T}),Wt.initialSetupCompleted&&Ee.emit(C,Wt.config)})),Ee.on("challenge suppressed",(function(e){var t=e.token;Wt.isActive=!1,Wt.suppressed=!0,jn({token:t}),Ut.setSuppressed(),Ut.timerEnd(V),ln(j,new cn(Wt))})),Ee.on("data initial",On),Ee.on("settings fp collected",On),Ee.on("challenge token",jn),Ee.on("challenge window error",(function(e){var t=e.message,n=e.source,r=e.stack;Ut.logWindowError("challenge",t,n,r)})),Ee.on(R,(function(e){var t=e.event,n=void 0===t?{}:t,r=e.settings,i=void 0===r?{}:r,o=e.observability;Wt.config.settings=i;var a=function(e){return ue(e,"observability",{})}(Wt.config.settings);Ut.setup(a,Wt.config.mode);var c=ue(Wt,"config.apiLoadTime");c&&Ut.apiLoadTimerSetup($,c),On({event:n,observability:o}),fn()})),Ee.on("challenge fail number limit reached",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Wt.isActive=!1,Wt.isHidden=!0,Wt.token=e.token,ln(h,new cn(Wt),e)})),Ee.on("error",(function(e){var t=qt({source:null},e.error);Wt.error=t,Ut.logError(t),ln(x,new cn(Wt)),hn()})),Ee.on("warning",(function(e){var t=qt({source:null},e.warning);Wt.warning=t,Ut.logError(t),ln(E,new cn(Wt))})),Ee.on("data_request",(function(e){e.sdk&&(Wt.requested=e,ln(_,new cn(Wt)))})),Ee.on(K,On),Ee.on(F,(function(e){var t=e.action,n=e.timerId,r=e.subTimerId,i=e.time,o=e.info,a="".concat(r?"subTimer":"timer").concat("end"===t?"End":"Start"),c=r?[n,r,i,o]:[n,i];Ut[a].apply(Ut,c)})),Ee.on("force reset",(function(){dn()})),Ee.on("redraw challenge",(function(){Wt.element&&(Wt.element.querySelector("iframe").style.display="inline")})),Ke("Set up Every emitter"),xn?(Ke("Attempting callback"),function e(){if(!se(window[xn]))return setTimeout(e,1e3);var t=document.querySelectorAll(".".concat(Vt(zt)));return t&&t.length&&Array.prototype.slice.call(t).forEach((function(e){try{e.parentNode.removeChild(e)}catch(e){}})),Ke("Cleaned up iframes"),bn(),window[xn](Sn)}()):(Ke("Start setup function"),bn())}(),arkoseLabsClientApi2c145230=r}();
================================================
FILE: sidepanel.html
================================================
<!DOCTYPE html>
<html translate="no">
<head>
<meta charset="utf-8" />
<meta content="width=device-width,initial-scale=1.0" name="viewport" />
<title>ChatHub</title>
<script type="module" src="./src/app/theme.ts"></script>
</head>
<body>
<div id="app"></div>
<script type="module" src="./src/app/sidepanel.tsx"></script>
</body>
</html>
================================================
FILE: src/app/base.scss
================================================
@use 'inter-ui/default' as inter-ui with (
$inter-font-display: swap,
$inter-font-path: 'inter-ui/Inter (web)'
);
@use 'inter-ui/variable' as inter-ui-variable with (
$inter-font-display: swap,
$inter-font-path: 'inter-ui/Inter (web)'
);
@include inter-ui.weight-400-normal;
@include inter-ui.weight-500-normal;
@include inter-ui.weight-600-normal;
@include inter-ui.weight-700-normal;
@include inter-ui-variable.normal;
@tailwind base;
@tailwind components;
@tailwind utilities;
html,
body {
font-family: 'Inter', 'system-ui';
}
@supports (font-variation-settings: normal) {
html,
body {
font-family: 'Inter var', 'system-ui';
}
}
body {
font-size: 100%;
}
:focus-visible {
outline: none;
}
@mixin light-theme {
color-scheme: light;
--color-primary-blue: 73 135 252; // #4987FC
--color-secondary: 242 242 242; // #F2F2F2
--color-primary-purple: 103 86 189; // #6756BD
--primary-background: 255 255 255; // #FFFFFF
--primary-text: 48 48 48; // #303030
--secondary-text: 128 128 128; // #808080
--light-text: 190 190 190; // #BEBEBE
--primary-border: 237 237 237; // #EDEDED
}
@mixin dark-theme {
color-scheme: dark;
--color-primary-blue: 50 104 206; // #3268CE
--color-secondary: 46 46 46; // #2E2E2E
--color-primary-purple: 57 41 141; // #39298D
--primary-background: 25 25 25; // #191919
--primary-text: 223 223 223; // #DFDFDF
--secondary-text: 127 127 127; // #7F7F7F
--light-text: 79 79 79; // #4F4F4F
--primary-border: 53 53 53; // #353535
}
@layer base {
:root {
opacity: 0.88;
}
}
:root.light {
@include light-theme;
@import 'highlight.js/scss/github.scss';
}
:root.dark {
@include dark-theme;
@import 'highlight.js/scss/github-dark.scss';
}
================================================
FILE: src/app/bots/abstract-bot.ts
================================================
import { Sentry } from '~services/sentry'
import { ChatError, ErrorCode } from '~utils/errors'
import { streamAsyncIterable } from '~utils/stream-async-iterable'
export type AnwserPayload = {
text: string
}
export type Event =
| {
type: 'UPDATE_ANSWER'
data: AnwserPayload
}
| {
type: 'DONE'
}
| {
type: 'ERROR'
error: ChatError
}
export interface MessageParams {
prompt: string
rawUserInput?: string
image?: File
signal?: AbortSignal
}
export interface SendMessageParams extends MessageParams {
onEvent: (event: Event) => void
}
export abstract class AbstractBot {
public async sendMessage(params: MessageParams) {
return this.doSendMessageGenerator(params)
}
protected async *doSendMessageGenerator(params: MessageParams) {
const wrapError = (err: unknown) => {
Sentry.captureException(err)
if (err instanceof ChatError) {
return err
}
if (!params.signal?.aborted) {
// ignore user abort exception
return new ChatError((err as Error).message, ErrorCode.UNKOWN_ERROR)
}
}
const stream = new ReadableStream<AnwserPayload>({
start: (controller) => {
this.doSendMessage({
prompt: params.prompt,
rawUserInput: params.rawUserInput,
image: params.image,
signal: params.signal,
onEvent(event) {
if (event.type === 'UPDATE_ANSWER') {
controller.enqueue(event.data)
} else if (event.type === 'DONE') {
controller.close()
} else if (event.type === 'ERROR') {
const error = wrapError(event.error)
if (error) {
controller.error(error)
}
}
},
}).catch((err) => {
const error = wrapError(err)
if (error) {
controller.error(error)
}
})
},
})
yield* streamAsyncIterable(stream)
}
get name(): string | undefined {
return undefined
}
get supportsImageInput() {
return false
}
abstract doSendMessage(params: SendMessageParams): Promise<void>
abstract resetConversation(): void
}
class DummyBot extends AbstractBot {
async doSendMessage(_params: SendMessageParams) {
// dummy
}
resetConversation() {
// dummy
}
get name() {
return ''
}
}
export abstract class AsyncAbstractBot extends AbstractBot {
#bot: AbstractBot
#initializeError?: Error
constructor() {
super()
this.#bot = new DummyBot()
this.initializeBot()
.then((bot) => {
this.#bot = bot
})
.catch((err) => {
this.#initializeError = err
})
}
abstract initializeBot(): Promise<AbstractBot>
doSendMessage(params: SendMessageParams) {
if (this.#bot instanceof DummyBot && this.#initializeError) {
throw this.#initializeError
}
return this.#bot.doSendMessage(params)
}
resetConversation() {
return this.#bot.resetConversation()
}
get name() {
return this.#bot.name
}
get supportsImageInput() {
return this.#bot.supportsImageInput
}
}
================================================
FILE: src/app/bots/baichuan/api.ts
================================================
import { ofetch } from 'ofetch'
import { customAlphabet } from 'nanoid'
import { ChatError, ErrorCode } from '~utils/errors'
interface UserInfo {
id: number
}
export async function getUserInfo(): Promise<UserInfo> {
const resp = await ofetch<{ data?: UserInfo; code: number; msg: string }>(
'https://www.baichuan-ai.com/api/user/user-info',
{ method: 'POST' },
)
if (resp.code === 401) {
throw new ChatError('请先登录百川账号', ErrorCode.BAICHUAN_WEB_UNAUTHORIZED)
}
if (resp.code !== 200) {
throw new Error(`Error: ${resp.code} ${resp.msg}`)
}
return resp.data!
}
const nanoid = customAlphabet('abcdefghijklmnopqrstuvwxyz0123456789')
function randomString(length: number) {
return nanoid(length)
}
export function generateSessionId() {
return 'p' + randomString(10)
}
export function generateMessageId() {
return 'U' + randomString(14)
}
================================================
FILE: src/app/bots/baichuan/index.ts
================================================
import { AbstractBot, SendMessageParams } from '../abstract-bot'
import { requestHostPermission } from '~app/utils/permissions'
import { ChatError, ErrorCode } from '~utils/errors'
import { uuid } from '~utils'
import { generateMessageId, generateSessionId, getUserInfo } from './api'
import { streamAsyncIterable } from '~utils/stream-async-iterable'
interface Message {
id: string
createdAt: number
data: string
from: 0 | 1 // human | bot
}
interface ConversationContext {
conversationId: string
historyMessages: Message[]
userId: number
lastMessageId?: string
}
export class BaichuanWebBot extends AbstractBot {
private conversationContext?: ConversationContext
async doSendMessage(params: SendMessageParams) {
if (!(await requestHostPermission('https://*.baichuan-ai.com/'))) {
throw new ChatError('Missing baichuan-ai.com permission', ErrorCode.MISSING_HOST_PERMISSION)
}
if (!this.conversationContext) {
const conversationId = generateSessionId()
const userInfo = await getUserInfo()
this.conversationContext = { conversationId, historyMessages: [], userId: userInfo.id }
}
const { conversationId, lastMessageId, historyMessages, userId } = this.conversationContext
const message: Message = {
id: generateMessageId(),
createdAt: Date.now(),
data: params.prompt,
from: 0,
}
const resp = await fetch('https://www.baichuan-ai.com/api/chat/v1/chat', {
method: 'POST',
signal: params.signal,
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
assistant: {},
assistant_info: {},
retry: 3,
type: "input",
stream: true,
request_id: uuid(),
app_info: { id: 10001, name: 'baichuan_web' },
user_info: { id: userId, status: 1 },
prompt: {
id: message.id,
data: message.data,
from: message.from,
parent_id: lastMessageId || 0,
created_at: message.createdAt,
attachments: []
},
session_info: { id: conversationId, name: '新的对话', created_at: Date.now() },
parameters: {
repetition_penalty: -1,
temperature: -1,
top_k: -1,
top_p: -1,
max_new_tokens: -1,
do_sample: -1,
regenerate: 0,
wse:true
},
history: historyMessages,
}),
})
const decoder = new TextDecoder()
let result = ''
let answerMessageId: string | undefined
for await (const uint8Array of streamAsyncIterable(resp.body!)) {
const str = decoder.decode(uint8Array)
console.debug('baichuan stream', str)
const lines = str.split('\n')
for (const line of lines) {
if (!line) {
continue
}
const data = JSON.parse(line)
if (!data.answer) {
continue
}
answerMessageId = data.answer.id
const text = data.answer.data
if (text) {
result += text
params.onEvent({ type: 'UPDATE_ANSWER', data: { text: result } })
}
}
}
this.conversationContext.historyMessages.push(message)
if (answerMessageId) {
this.conversationContext.lastMessageId = answerMessageId
if (result) {
this.conversationContext.historyMessages.push({
id: answerMessageId,
data: result,
createdAt: Date.now(),
from: 1,
})
}
}
params.onEvent({ type: 'DONE' })
}
resetConversation() {
this.conversationContext = undefined
}
get name() {
return '百川大模型'
}
}
================================================
FILE: src/app/bots/bard/api.ts
================================================
import { ofetch } from 'ofetch'
import { ChatError, ErrorCode } from '~utils/errors'
function extractFromHTML(variableName: string, html: string) {
const regex = new RegExp(`"${variableName}":"([^"]+)"`)
const match = regex.exec(html)
return match?.[1]
}
export async function fetchRequestParams() {
const html = await ofetch('https://bard.google.com/', { responseType: 'text' })
const atValue = extractFromHTML('SNlM0e', html)
const blValue = extractFromHTML('cfb2h', html)
if (!atValue) {
throw new ChatError('There is no logged-in Google account in this browser', ErrorCode.BARD_UNAUTHORIZED)
}
return { atValue, blValue }
}
export function parseBardResponse(resp: string) {
const data = JSON.parse(resp.split('\n')[3])
const payload = JSON.parse(data[0][2])
if (!payload) {
throw new ChatError('Failed to load bard response', ErrorCode.BARD_EMPTY_RESPONSE)
}
console.debug('bard response payload', payload)
let text = payload[4][0][1][0] as string
const images = payload[4][0][4] || []
for (const image of images) {
const [media, source, placeholder] = image
text = text.replace(placeholder, `[![${media[4]}](${media[0][0]})](${source[0][0]})`)
}
return {
text,
ids: [...payload[1], payload[4][0][0]] as [string, string, string],
}
}
================================================
FILE: src/app/bots/bard/index.ts
================================================
import { ofetch } from 'ofetch'
import { AbstractBot, SendMessageParams } from '../abstract-bot'
import { fetchRequestParams, parseBardResponse } from './api'
function generateReqId() {
return Math.floor(Math.random() * 900000) + 100000
}
interface ConversationContext {
requestParams: Awaited<ReturnType<typeof fetchRequestParams>>
contextIds: [string, string, string]
}
export class BardBot extends AbstractBot {
private conversationContext?: ConversationContext
async doSendMessage(params: SendMessageParams) {
if (!this.conversationContext) {
this.conversationContext = {
requestParams: await fetchRequestParams(),
contextIds: ['', '', ''],
}
}
const { requestParams, contextIds } = this.conversationContext
let imageUrl: string | undefined
if (params.image) {
imageUrl = await this.uploadImage(params.image)
}
const payload = [
null,
JSON.stringify([
[params.prompt, 0, null, imageUrl ? [[[imageUrl, 1], params.image!.name]] : []],
null,
contextIds,
]),
]
const resp = await ofetch(
'https://bard.google.com/_/BardChatUi/data/assistant.lamda.BardFrontendService/StreamGenerate',
{
method: 'POST',
signal: params.signal,
query: {
bl: requestParams.blValue,
_reqid: generateReqId(),
rt: 'c',
},
body: new URLSearchParams({
at: requestParams.atValue!,
'f.req': JSON.stringify(payload),
}),
parseResponse: (txt) => txt,
},
)
const { text, ids } = parseBardResponse(resp)
this.conversationContext.contextIds = ids
params.onEvent({
type: 'UPDATE_ANSWER',
data: { text },
})
params.onEvent({ type: 'DONE' })
}
resetConversation() {
this.conversationContext = undefined
}
get supportsImageInput() {
return true
}
private async uploadImage(image: File) {
const headers = {
'content-type': 'application/x-www-form-urlencoded;charset=UTF-8',
'push-id': 'feeds/mcudyrk2a4khkz',
'x-goog-upload-header-content-length': image.size.toString(),
'x-goog-upload-protocol': 'resumable',
'x-tenant-id': 'bard-storage',
}
const resp = await ofetch.raw('https://content-push.googleapis.com/upload/', {
method: 'POST',
headers: {
...headers,
'x-goog-upload-command': 'start',
},
body: new URLSearchParams({ [`File name: ${image.name}`]: '' }),
})
const uploadUrl = resp.headers.get('x-goog-upload-url')
console.debug('Bard upload url', uploadUrl)
if (!uploadUrl) {
throw new Error('Failed to upload image')
}
const uploadResult = await ofetch(uploadUrl, {
method: 'POST',
headers: {
...headers,
'x-goog-upload-command': 'upload, finalize',
'x-goog-upload-offset': '0',
},
body: image,
})
return uploadResult as string
}
}
================================================
FILE: src/app/bots/bing/api.ts
================================================
import { random } from 'lodash-es'
import { FetchError, FetchResponse, ofetch } from 'ofetch'
import { uuid } from '~utils'
import { ChatError, ErrorCode } from '~utils/errors'
import { ConversationResponse } from './types'
// https://github.com/acheong08/EdgeGPT/blob/master/src/EdgeGPT.py#L32
function randomIP() {
return `13.${random(104, 107)}.${random(0, 255)}.${random(0, 255)}`
}
const API_ENDPOINT = 'https://www.bing.com/turing/conversation/create'
export async function createConversation(): Promise<ConversationResponse> {
const headers = {
'x-ms-client-request-id': uuid(),
'x-ms-useragent': 'azsdk-js-api-client-factory/1.0.0-beta.1 core-rest-pipeline/1.10.3 OS/macOS',
}
let rawResponse: FetchResponse<ConversationResponse>
try {
rawResponse = await ofetch.raw<ConversationResponse>(API_ENDPOINT, { headers, redirect: 'error' })
if (!rawResponse._data?.result) {
throw new Error('Invalid response')
}
} catch (err) {
console.error('retry bing create', err)
rawResponse = await ofetch.raw<ConversationResponse>(API_ENDPOINT, {
headers: { ...headers, 'x-forwarded-for': randomIP() },
redirect: 'error',
})
if (!rawResponse._data) {
throw new FetchError(`Failed to fetch (${API_ENDPOINT})`)
}
}
const data = rawResponse._data
if (data.result.value !== 'Success') {
const message = `${data.result.value}: ${data.result.message}`
if (data.result.value === 'UnauthorizedRequest') {
throw new ChatError(message, ErrorCode.BING_UNAUTHORIZED)
}
throw new Error(message)
}
const conversationSignature = rawResponse.headers.get('x-sydney-conversationsignature')!
const encryptedConversationSignature = rawResponse.headers.get('x-sydney-encryptedconversationsignature') || undefined
data.conversationSignature = data.conversationSignature || conversationSignature
data.encryptedConversationSignature = encryptedConversationSignature
return data
}
================================================
FILE: src/app/bots/bing/index.ts
================================================
import { ofetch } from 'ofetch'
import WebSocketAsPromised from 'websocket-as-promised'
import { requestHostPermission } from '~app/utils/permissions'
import { BingConversationStyle, getUserConfig } from '~services/user-config'
import { uuid } from '~utils'
import { ChatError, ErrorCode } from '~utils/errors'
import { AbstractBot, SendMessageParams } from '../abstract-bot'
import { createConversation } from './api'
import { ChatResponseMessage, ConversationInfo, InvocationEventType } from './types'
import { convertMessageToMarkdown, file2base64, websocketUtils } from './utils'
const OPTIONS_SETS = [
'nlu_direct_response_filter',
'deepleo',
'disable_emoji_spoken_text',
'responsible_ai_policy_235',
'enablemm',
'dv3sugg',
'autosave',
'glfluxv15',
'clgalileo',
'clgalileonsr',
'mtreasoncls3',
'sahararespv2',
'gptvprvc',
'fluxprod',
'revimglnk',
'revimgsrc1',
]
const SLICE_IDS = [
'0712newass0',
'0212boptpsc',
'plgbd2c',
'1113gldcl1s1',
'1201reason',
'124multi2ts0',
'cacdupereccf',
'cacmuidarb',
'cacfrwebt2cf',
'sswebtop2cf',
]
export class BingWebBot extends AbstractBot {
private conversationContext?: ConversationInfo
private buildChatRequest(conversation: ConversationInfo, message: string, imageUrl?: string) {
const requestId = uuid()
const optionsSets = [...OPTIONS_SETS]
let tone = 'Balanced'
if (conversation.conversationStyle === BingConversationStyle.Precise) {
optionsSets.push('h3precise')
tone = 'Precise'
} else if (conversation.conversationStyle === BingConversationStyle.Creative) {
optionsSets.push('h3imaginative')
tone = 'Creative'
}
return {
arguments: [
{
source: 'cib',
optionsSets,
allowedMessageTypes: [
'Chat',
'InternalSearchQuery',
'Disengaged',
'InternalLoaderMessage',
'SemanticSerp',
'GenerateContentQuery',
'SearchQuery',
],
sliceIds: SLICE_IDS,
verbosity: 'verbose',
scenario: 'SERP',
plugins: [],
conversationHistoryOptionsSets: ['autosave', 'savemem', 'uprofupd', 'uprofgen'],
isStartOfSession: conversation.invocationId === 0,
message: {
timestamp: new Date().toISOString(),
author: 'user',
inputMethod: 'Keyboard',
text: message,
imageUrl,
messageType: 'Chat',
requestId,
messageId: requestId,
},
requestId,
conversationId: conversation.conversationId,
conversationSignature: conversation.conversationSignature,
participant: { id: conversation.clientId },
tone,
},
],
invocationId: conversation.invocationId.toString(),
target: 'chat',
type: InvocationEventType.StreamInvocation,
}
}
async doSendMessage(params: SendMessageParams) {
if (!(await requestHostPermission('wss://*.bing.com/'))) {
throw new ChatError('Missing bing.com permission', ErrorCode.MISSING_HOST_PERMISSION)
}
if (!this.conversationContext) {
const [conversation, { bingConversationStyle }] = await Promise.all([createConversation(), getUserConfig()])
this.conversationContext = {
conversationId: conversation.conversationId,
conversationSignature: conversation.conversationSignature,
encryptedConversationSignature: conversation.encryptedConversationSignature,
clientId: conversation.clientId,
invocationId: 0,
conversationStyle: bingConversationStyle,
}
}
const conversation = this.conversationContext!
let imageUrl: string | undefined
if (params.image) {
imageUrl = await this.uploadImage(params.image)
}
const wsp = new WebSocketAsPromised(this.buildWssUrl(conversation.encryptedConversationSignature), {
packMessage: websocketUtils.packMessage,
unpackMessage: websocketUtils.unpackMessage,
})
let receivedAnswer = false
wsp.onUnpackedMessage.addListener((events) => {
for (const event of events) {
console.debug('bing ws event', event)
if (JSON.stringify(event) === '{}') {
wsp.sendPacked({ type: 6 })
wsp.sendPacked(this.buildChatRequest(conversation, params.prompt, imageUrl))
conversation.invocationId += 1
} else if (event.type === 6) {
wsp.sendPacked({ type: 6 })
} else if (event.type === 3) {
params.onEvent({ type: 'DONE' })
wsp.removeAllListeners()
wsp.close()
} else if (event.type === 1) {
const messages = event.arguments[0].messages
if (messages) {
receivedAnswer = true
const text = convertMessageToMarkdown(messages[0])
params.onEvent({ type: 'UPDATE_ANSWER', data: { text } })
}
} else if (event.type === 2) {
const messages = event.item.messages as ChatResponseMessage[] | undefined
if (!messages) {
if (event.item.result.value === 'UnauthorizedRequest') {
this.conversationContext = undefined
params.onEvent({
type: 'ERROR',
error: new ChatError('UnauthorizedRequest', ErrorCode.BING_UNAUTHORIZED),
})
return
}
const captcha = event.item.result.value === 'CaptchaChallenge'
if (captcha) {
this.conversationContext = undefined
}
params.onEvent({
type: 'ERROR',
error: new ChatError(
event.item.result.error || 'Unknown error',
captcha ? ErrorCode.BING_CAPTCHA : ErrorCode.UNKOWN_ERROR,
),
})
return
}
const limited = messages.some((message) => message.contentOrigin === 'TurnLimiter')
if (limited) {
params.onEvent({
type: 'ERROR',
error: new ChatError(
'Sorry, you have reached chat turns limit in this conversation.',
ErrorCode.CONVERSATION_LIMIT,
),
})
return
}
if (!receivedAnswer) {
const message = event.item.messages[event.item.firstNewMessageIndex] as ChatResponseMessage
if (message) {
receivedAnswer = true
const text = convertMessageToMarkdown(message)
params.onEvent({
type: 'UPDATE_ANSWER',
data: { text },
})
}
}
}
}
})
wsp.onClose.addListener(() => {
params.onEvent({ type: 'DONE' })
})
params.signal?.addEventListener('abort', () => {
wsp.removeAllListeners()
wsp.close()
})
try {
await wsp.open()
} catch (err) {
wsp.removeAllListeners()
throw new ChatError((err as Error).message, ErrorCode.NETWORK_ERROR)
}
wsp.sendPacked({ protocol: 'json', version: 1 })
}
resetConversation() {
this.conversationContext = undefined
}
get supportsImageInput() {
return true
}
private async uploadImage(image: File) {
const formData = new FormData()
formData.append(
'knowledgeRequest',
JSON.stringify({
imageInfo: {},
knowledgeRequest: {
invokedSkills: ['ImageById'],
subscriptionId: 'Bing.Chat.Multimodal',
invokedSkillsRequestData: { enableFaceBlur: false },
convoData: { convoid: '', convotone: 'Balanced' },
},
}),
)
formData.append('imageBase64', await file2base64(image))
const resp = await ofetch<{ blobId: string }>('https://www.bing.com/images/kblob', {
method: 'POST',
body: formData,
})
if (!resp.blobId) {
console.debug('kblob response: ', resp)
throw new Error('Failed to upload image')
}
return `https://www.bing.com/images/blob?bcid=${resp.blobId}`
}
private buildWssUrl(encryptedConversationSignature: string | undefined) {
if (!encryptedConversationSignature) {
return 'wss://sydney.bing.com/sydney/ChatHub'
}
return `wss://sydney.bing.com/sydney/ChatHub?sec_access_token=${encodeURIComponent(encryptedConversationSignature)}`
}
}
================================================
FILE: src/app/bots/bing/types.ts
================================================
import { BingConversationStyle } from '~services/user-config'
export interface ConversationResponse {
conversationId: string
clientId: string
conversationSignature: string
encryptedConversationSignature?: string
result: {
value: string
message: null
}
}
export enum InvocationEventType {
Invocation = 1,
StreamItem = 2,
Completion = 3,
StreamInvocation = 4,
CancelInvocation = 5,
Ping = 6,
Close = 7,
}
// https://github.com/bytemate/bingchat-api/blob/main/src/lib.ts
export interface ConversationInfo {
conversationId: string
clientId: string
conversationSignature: string
invocationId: number
conversationStyle: BingConversationStyle
encryptedConversationSignature?: string
}
export interface BingChatResponse {
conversationSignature: string
conversationId: string
clientId: string
invocationId: number
conversationExpiryTime: Date
response: string
details: ChatResponseMessage
}
export interface ChatResponseMessage {
text: string
author: string
createdAt: Date
timestamp: Date
messageId: string
messageType?: string
requestId: string
offense: string
adaptiveCards: AdaptiveCard[]
sourceAttributions: SourceAttribution[]
feedback: Feedback
contentOrigin: string
privacy: null
suggestedResponses: SuggestedResponse[]
}
export interface AdaptiveCard {
type: string
version: string
body: Body[]
}
export interface Body {
type: string
text: string
wrap: boolean
size?: string
}
export interface Feedback {
tag: null
updatedOn: null
type: string
}
export interface SourceAttribution {
providerDisplayName: string
seeMoreUrl: string
searchQuery: string
}
export interface SuggestedResponse {
text: string
author: string
createdAt: Date
timestamp: Date
messageId: string
messageType: string
offense: string
feedback: Feedback
contentOrigin: string
privacy: null
}
export async function generateMarkdown(response: BingChatResponse) {
// change `[^Number^]` to markdown link
const regex = /\[\^(\d+)\^\]/g
const markdown = response.details.text.replace(regex, (match, p1) => {
const sourceAttribution = response.details.sourceAttributions[Number(p1) - 1]
return `[${sourceAttribution.providerDisplayName}](${sourceAttribution.seeMoreUrl})`
})
return markdown
}
================================================
FILE: src/app/bots/bing/utils.ts
================================================
import { ChatResponseMessage } from './types'
export function convertMessageToMarkdown(message: ChatResponseMessage): string {
if (message.messageType === 'InternalSearchQuery') {
return message.text
}
if (message.messageType === 'InternalLoaderMessage') {
return `_${message.text}_`
}
for (const card of message.adaptiveCards) {
for (const block of card.body) {
if (block.type === 'TextBlock') {
return block.text
}
}
}
return ''
}
const RecordSeparator = String.fromCharCode(30)
export const websocketUtils = {
packMessage(data: unknown) {
return `${JSON.stringify(data)}${RecordSeparator}`
},
unpackMessage(data: string | ArrayBuffer | Blob) {
return data
.toString()
.split(RecordSeparator)
.filter(Boolean)
.map((s) => JSON.parse(s))
},
}
export async function file2base64(file: File, keepHeader = false): Promise<string> {
return new Promise((resolve, reject) => {
const reader = new FileReader()
reader.onload = () => {
if (keepHeader) {
resolve(reader.result as string)
} else {
const base64String = (reader.result as string).replace('data:', '').replace(/^.+,/, '')
resolve(base64String)
}
}
reader.onerror = reject
reader.readAsDataURL(file)
})
}
================================================
FILE: src/app/bots/chatgpt/index.ts
================================================
import { ChatGPTMode, getUserConfig } from '~/services/user-config'
import * as agent from '~services/agent'
import { ChatError, ErrorCode } from '~utils/errors'
import { AsyncAbstractBot, MessageParams } from '../abstract-bot'
import { ChatGPTApiBot } from '../chatgpt-api'
import { ChatGPTAzureApiBot } from '../chatgpt-azure'
import { ChatGPTWebBot } from '../chatgpt-webapp'
import { PoeWebBot } from '../poe'
import { OpenRouterBot } from '../openrouter'
export class ChatGPTBot extends AsyncAbstractBot {
async initializeBot() {
const { chatgptMode, ...config } = await getUserConfig()
if (chatgptMode === ChatGPTMode.API) {
if (!config.openaiApiKey) {
throw new ChatError('OpenAI API key not set', ErrorCode.API_KEY_NOT_SET)
}
return new ChatGPTApiBot({
openaiApiKey: config.openaiApiKey,
openaiApiHost: config.openaiApiHost,
chatgptApiModel: config.chatgptApiModel,
chatgptApiTemperature: config.chatgptApiTemperature,
chatgptApiSystemMessage: config.chatgptApiSystemMessage,
})
}
if (chatgptMode === ChatGPTMode.Azure) {
if (!config.azureOpenAIApiInstanceName || !config.azureOpenAIApiDeploymentName || !config.azureOpenAIApiKey) {
throw new Error('Please check your Azure OpenAI API configuration')
}
return new ChatGPTAzureApiBot({
azureOpenAIApiKey: config.azureOpenAIApiKey,
azureOpenAIApiDeploymentName: config.azureOpenAIApiDeploymentName,
azureOpenAIApiInstanceName: config.azureOpenAIApiInstanceName,
})
}
if (chatgptMode === ChatGPTMode.Poe) {
return new PoeWebBot(config.chatgptPoeModelName)
}
if (chatgptMode === ChatGPTMode.OpenRouter) {
if (!config.openrouterApiKey) {
throw new ChatError('OpenRouter API key not set', ErrorCode.API_KEY_NOT_SET)
}
const model = `openai/${config.openrouterOpenAIModel}`
return new OpenRouterBot({ apiKey: config.openrouterApiKey, model })
}
return new ChatGPTWebBot(config.chatgptWebappModelName)
}
async sendMessage(params: MessageParams) {
const { chatgptWebAccess } = await getUserConfig()
if (chatgptWebAccess) {
return agent.execute(params.prompt, (prompt) => this.doSendMessageGenerator({ ...params, prompt }), params.signal)
}
return this.doSendMessageGenerator(params)
}
}
================================================
FILE: src/app/bots/chatgpt-api/index.ts
================================================
import { isArray } from 'lodash-es'
import { DEFAULT_CHATGPT_SYSTEM_MESSAGE } from '~app/consts'
import { UserConfig } from '~services/user-config'
import { ChatError, ErrorCode } from '~utils/errors'
import { parseSSEResponse } from '~utils/sse'
import { AbstractBot, SendMessageParams } from '../abstract-bot'
import { file2base64 } from '../bing/utils'
import { ChatMessage } from './types'
interface ConversationContext {
messages: ChatMessage[]
}
const CONTEXT_SIZE = 9
export abstract class AbstractChatGPTApiBot extends AbstractBot {
private conversationContext?: ConversationContext
private buildUserMessage(prompt: string, imageUrl?: string): ChatMessage {
if (!imageUrl) {
return { role: 'user', content: prompt }
}
return {
role: 'user',
content: [
{ type: 'text', text: prompt },
{ type: 'image_url', image_url: { url: imageUrl, detail: 'low' } },
],
}
}
private buildMessages(prompt: string, imageUrl?: string): ChatMessage[] {
const currentDate = new Date().toISOString().split('T')[0]
const systemMessage = this.getSystemMessage().replace('{current_date}', currentDate)
return [
{ role: 'system', content: systemMessage },
...this.conversationContext!.messages.slice(-(CONTEXT_SIZE + 1)),
this.buildUserMessage(prompt, imageUrl),
]
}
getSystemMessage() {
return DEFAULT_CHATGPT_SYSTEM_MESSAGE
}
async doSendMessage(params: SendMessageParams) {
if (!this.conversationContext) {
this.conversationContext = { messages: [] }
}
let imageUrl: string | undefined
if (params.image) {
imageUrl = await file2base64(params.image, true)
}
const resp = await this.fetchCompletionApi(this.buildMessages(params.prompt, imageUrl), params.signal)
// add user message to context only after fetch success
this.conversationContext.messages.push(this.buildUserMessage(params.rawUserInput || params.prompt, imageUrl))
let done = false
const result: ChatMessage = { role: 'assistant', content: '' }
const finish = () => {
done = true
params.onEvent({ type: 'DONE' })
const messages = this.conversationContext!.messages
messages.push(result)
}
await parseSSEResponse(resp, (message) => {
console.debug('chatgpt sse message', message)
if (message === '[DONE]') {
finish()
return
}
let data
try {
data = JSON.parse(message)
} catch (err) {
console.error(err)
return
}
if (data?.choices?.length) {
const delta = data.choices[0].delta
if (delta?.content) {
result.content += delta.content
params.onEvent({
type: 'UPDATE_ANSWER',
data: { text: result.content },
})
}
}
})
if (!done) {
finish()
}
}
resetConversation() {
this.conversationContext = undefined
}
abstract fetchCompletionApi(messages: ChatMessage[], signal?: AbortSignal): Promise<Response>
}
export class ChatGPTApiBot extends AbstractChatGPTApiBot {
constructor(
private config: Pick<
UserConfig,
'openaiApiKey' | 'openaiApiHost' | 'chatgptApiModel' | 'chatgptApiTemperature' | 'chatgptApiSystemMessage'
>,
) {
super()
}
getSystemMessage() {
return this.config.chatgptApiSystemMessage || DEFAULT_CHATGPT_SYSTEM_MESSAGE
}
async fetchCompletionApi(messages: ChatMessage[], signal?: AbortSignal) {
const { openaiApiKey, openaiApiHost } = this.config
const hasImageInput = messages.some(
(message) => isArray(message.content) && message.content.some((part) => part.type === 'image_url'),
)
const model = hasImageInput ? 'gpt-4-vision-preview' : this.getModelName()
const resp = await fetch(`${openaiApiHost}/v1/chat/completions`, {
method: 'POST',
signal,
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer ${openaiApiKey}`,
},
body: JSON.stringify({
model,
messages,
max_tokens: hasImageInput ? 500 : undefined,
stream: true,
}),
})
if (!resp.ok) {
const error = await resp.text()
if (error.includes('insufficient_quota')) {
throw new ChatError('Insufficient ChatGPT API usage quota', ErrorCode.CHATGPT_INSUFFICIENT_QUOTA)
}
}
return resp
}
private getModelName() {
const { chatgptApiModel } = this.config
if (chatgptApiModel === 'gpt-4-turbo') {
return 'gpt-4-1106-preview'
}
if (chatgptApiModel === 'gpt-3.5-turbo') {
return 'gpt-3.5-turbo-1106'
}
return chatgptApiModel
}
get name() {
return `ChatGPT (API/${this.config.chatgptApiModel})`
}
get supportsImageInput() {
return true
}
}
================================================
FILE: src/app/bots/chatgpt-api/types.ts
================================================
export type ContentPart =
| { type: 'text'; text: string }
| { type: 'image_url'; image_url: { url: string; detail?: 'low' | 'high' } }
export type ChatMessage =
| {
role: 'system' | 'assistant'
content: string
}
| {
role: 'user'
content: string | ContentPart[]
}
================================================
FILE: src/app/bots/chatgpt-azure/index.ts
================================================
import { UserConfig } from '~services/user-config'
import { AbstractChatGPTApiBot } from '../chatgpt-api'
import { ChatMessage } from '../chatgpt-api/types'
export class ChatGPTAzureApiBot extends AbstractChatGPTApiBot {
constructor(
private config: Pick<
UserConfig,
'azureOpenAIApiKey' | 'azureOpenAIApiDeploymentName' | 'azureOpenAIApiInstanceName'
>,
) {
super()
}
async fetchCompletionApi(messages: ChatMessage[], signal?: AbortSignal) {
const endpoint = `https://${this.config.azureOpenAIApiInstanceName}.openai.azure.com/openai/deployments/${this.config.azureOpenAIApiDeploymentName}/chat/completions?api-version=2025-01-01-preview`
return fetch(endpoint, {
method: 'POST',
signal,
headers: {
'Content-Type': 'application/json',
'api-key': this.config.azureOpenAIApiKey,
},
body: JSON.stringify({
messages,
stream: true,
}),
})
}
get name() {
return `ChatGPT (azure/gpt-3.5)`
}
}
================================================
FILE: src/app/bots/chatgpt-webapp/arkose/generator.js
================================================
import Browser from 'webextension-polyfill'
class ArkoseTokenGenerator {
constructor() {
this.enforcement = undefined
this.pendingPromises = []
window.useArkoseSetupEnforcement = this.useArkoseSetupEnforcement.bind(this)
this.injectScript()
}
useArkoseSetupEnforcement(enforcement) {
this.enforcement = enforcement
enforcement.setConfig({
onCompleted: (r) => {
console.debug('enforcement.onCompleted', r)
this.pendingPromises.forEach((promise) => {
promise.resolve(r.token)
})
this.pendingPromises = []
},
onReady: () => {
console.debug('enforcement.onReady')
},
onError: (r) => {
console.debug('enforcement.onError', r)
this.pendingPromises.forEach((promise) => {
promise.reject(new Error('Error generating arkose token'))
})
},
onFailed: (r) => {
console.debug('enforcement.onFailed', r)
this.pendingPromises.forEach((promise) => {
promise.reject(new Error('Failed to generate arkose token'))
})
},
})
}
injectScript() {
const script = document.createElement('script')
script.src = Browser.runtime.getURL('/js/v2/35536E1E-65B4-4D96-9D97-6ADB7EFF8147/api.js')
script.async = true
script.defer = true
script.setAttribute('data-callback', 'useArkoseSetupEnforcement')
document.body.appendChild(script)
}
async generate() {
if (!this.enforcement) {
return
}
return new Promise((resolve, reject) => {
this.pendingPromises = [{ resolve, reject }] // store only one promise for now.
this.enforcement.run()
})
}
}
export const arkoseTokenGenerator = new ArkoseTokenGenerator()
================================================
FILE: src/app/bots/chatgpt-webapp/arkose/index.ts
================================================
import { arkoseTokenGenerator } from './generator'
import { fetchArkoseToken } from './server'
export async function getArkoseToken() {
const token = await arkoseTokenGenerator.generate()
if (token) {
return token
}
return fetchArkoseToken()
}
================================================
FILE: src/app/bots/chatgpt-webapp/arkose/server.ts
================================================
import { ofetch } from 'ofetch'
export async function fetchArkoseToken(): Promise<string | undefined> {
try {
const resp = await ofetch('https://chathub.gg/api/arkose')
return resp.token
} catch (err) {
console.error(err)
return undefined
}
}
================================================
FILE: src/app/bots/chatgpt-webapp/client.ts
================================================
import { ofetch } from 'ofetch'
import { RequestInitSubset } from '~types/messaging'
import { ChatError, ErrorCode } from '~utils/errors'
import { Requester, globalFetchRequester, proxyFetchRequester } from './requesters'
class ChatGPTClient {
requester: Requester
constructor() {
this.requester = globalFetchRequester
proxyFetchRequester.findExistingProxyTab().then((tab) => {
if (tab) {
this.switchRequester(proxyFetchRequester)
}
})
}
switchRequester(newRequester: Requester) {
console.debug('client switchRequester', newRequester)
this.requester = newRequester
}
async fetch(url: string, options?: RequestInitSubset): Promise<Response> {
return this.requester.fetch(url, options)
}
async getAccessToken(): Promise<string> {
const resp = await this.fetch('https://chat.openai.com/api/auth/session')
if (resp.status === 403) {
throw new ChatError('Please pass Cloudflare check', ErrorCode.CHATGPT_CLOUDFLARE)
}
const data = await resp.json().catch(() => ({}))
if (!data.accessToken) {
throw new ChatError('There is no logged-in ChatGPT account in this browser.', ErrorCode.CHATGPT_UNAUTHORIZED)
}
return data.accessToken
}
private async requestBackendAPIWithToken(token: string, method: 'GET' | 'POST', path: string, data?: unknown) {
return this.fetch(`https://chat.openai.com/backend-api${path}`, {
method,
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer ${token}`,
},
body: data === undefined ? undefined : JSON.stringify(data),
})
}
async getModels(token: string): Promise<{ slug: string; title: string; description: string; max_tokens: number }[]> {
const resp = await this.requestBackendAPIWithToken(token, 'GET', '/models').then((r) => r.json())
return resp.models
}
async generateChatTitle(token: string, conversationId: string, messageId: string) {
await this.requestBackendAPIWithToken(token, 'POST', `/conversation/gen_title/${conversationId}`, {
message_id: messageId,
})
}
async createFileUpload(token: string, file: File): Promise<{ fileId: string; uploadUrl: string }> {
const resp = await this.requestBackendAPIWithToken(token, 'POST', '/files', {
file_name: file.name,
file_size: file.size,
use_case: 'multimodal',
})
const data = await resp.json()
if (data.status !== 'success') {
throw new Error('Failed to init ChatGPT file upload')
}
return {
fileId: data.file_id,
uploadUrl: data.upload_url,
}
}
async completeFileUpload(token: string, fileId: string) {
await this.requestBackendAPIWithToken(token, 'POST', `/files/${fileId}/uploaded`, {})
}
async uploadFile(token: string, file: File) {
const { fileId, uploadUrl } = await this.createFileUpload(token, file)
await ofetch(uploadUrl, {
method: 'PUT',
body: file,
headers: {
'x-ms-blob-type': 'BlockBlob',
'x-ms-version': '2020-04-08',
'Content-Type': file.type,
},
})
await this.completeFileUpload(token, fileId)
return fileId
}
// Switch to proxy mode, or refresh the proxy tab
async fixAuthState() {
if (this.requester === proxyFetchRequester) {
await proxyFetchRequester.refreshProxyTab()
} else {
await proxyFetchRequester.getProxyTab()
this.switchRequester(proxyFetchRequester)
}
}
}
export const chatGPTClient = new ChatGPTClient()
================================================
FILE: src/app/bots/chatgpt-webapp/index.ts
================================================
import { get as getPath } from 'lodash-es'
import { v4 as uuidv4 } from 'uuid'
import { getImageSize } from '~app/utils/image-size'
import { ChatGPTWebModel } from '~services/user-config'
import { ChatError, ErrorCode } from '~utils/errors'
import { parseSSEResponse } from '~utils/sse'
import { AbstractBot, SendMessageParams } from '../abstract-bot'
import { getArkoseToken } from './arkose'
import { chatGPTClient } from './client'
import { ImageContent, ResponseContent, ResponsePayload } from './types'
function removeCitations(text: string) {
return text.replaceAll(/\u3010\d+\u2020source\u3011/g, '')
}
function parseResponseContent(content: ResponseContent): { text?: string; image?: ImageContent } {
if (content.content_type === 'text') {
return { text: removeCitations(content.parts[0]) }
}
if (content.content_type === 'code') {
return { text: '_' + content.text + '_' }
}
if (content.content_type === 'multimodal_text') {
for (const part of content.parts) {
if (part.content_type === 'image_asset_pointer') {
return { image: part }
}
}
}
return {}
}
interface ConversationContext {
conversationId: string
lastMessageId: string
}
export class ChatGPTWebBot extends AbstractBot {
private accessToken?: string
private conversationContext?: ConversationContext
constructor(public model: ChatGPTWebModel) {
super()
}
private async getModelName(): Promise<string> {
if (this.model === ChatGPTWebModel['GPT-4']) {
return 'gpt-4'
}
return 'text-davinci-002-render-sha'
}
private async uploadImage(image: File): Promise<ImageContent> {
const fileId = await chatGPTClient.uploadFile(this.accessToken!, image)
const size = await getImageSize(image)
return {
asset_pointer: `file-service://${fileId}`,
width: size.width,
height: size.height,
size_bytes: image.size,
}
}
private buildMessage(prompt: string, image?: ImageContent) {
return {
id: uuidv4(),
author: { role: 'user' },
content: image
? { content_type: 'multimodal_text', parts: [image, prompt] }
: { content_type: 'text', parts: [prompt] },
}
}
async doSendMessage(params: SendMessageParams) {
if (!this.accessToken) {
this.accessToken = await chatGPTClient.getAccessToken()
}
const modelName = await this.getModelName()
console.debug('Using model:', modelName)
const arkoseToken = await getArkoseToken()
let image: ImageContent | undefined = undefined
if (params.image) {
image = await this.uploadImage(params.image)
}
const resp = await chatGPTClient.fetch('https://chat.openai.com/backend-api/conversation', {
method: 'POST',
signal: params.signal,
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer ${this.accessToken}`,
},
body: JSON.stringify({
action: 'next',
messages: [this.buildMessage(params.prompt, image)],
model: modelName,
conversation_id: this.conversationContext?.conversationId || undefined,
parent_message_id: this.conversationContext?.lastMessageId || uuidv4(),
arkose_token: arkoseToken,
conversation_mode: { kind: 'primary_assistant' },
}),
})
const isFirstMessage = !this.conversationContext
await parseSSEResponse(resp, (message) => {
console.debug('chatgpt sse message', message)
if (message === '[DONE]') {
params.onEvent({ type: 'DONE' })
return
}
let parsed: ResponsePayload | { message: null; error: string }
try {
parsed = JSON.parse(message)
} catch (err) {
console.error(err)
return
}
if (!parsed.message && parsed.error) {
params.onEvent({
type: 'ERROR',
error: new ChatError(parsed.error, ErrorCode.UNKOWN_ERROR),
})
return
}
const payload = parsed as ResponsePayload
const role = getPath(payload, 'message.author.role')
if (role !== 'assistant' && role !== 'tool') {
return
}
const content = payload.message?.content as ResponseContent | undefined
if (!content) {
return
}
const { text } = parseResponseContent(content)
if (text) {
this.conversationContext = { conversationId: payload.conversation_id, lastMessageId: payload.message.id }
params.onEvent({ type: 'UPDATE_ANSWER', data: { text } })
}
}).catch((err: Error) => {
if (err.message.includes('token_expired')) {
throw new ChatError(err.message, ErrorCode.CHATGPT_AUTH)
}
throw err
})
// auto generate title on first response
if (isFirstMessage && this.conversationContext) {
const c = this.conversationContext
chatGPTClient.generateChatTitle(this.accessToken, c.conversationId, c.lastMessageId)
}
}
resetConversation() {
this.conversationContext = undefined
}
get name() {
return `ChatGPT (webapp/${this.model})`
}
get supportsImageInput() {
return true
}
}
================================================
FILE: src/app/bots/chatgpt-webapp/requesters.ts
================================================
import Browser, { Runtime } from 'webextension-polyfill'
import { CHATGPT_HOME_URL } from '~app/consts'
import { proxyFetch } from '~services/proxy-fetch'
import { RequestInitSubset } from '~types/messaging'
export interface Requester {
fetch(url: string, options?: RequestInitSubset): Promise<Response>
}
class GlobalFetchRequester implements Requester {
fetch(url: string, options?: RequestInitSubset) {
return fetch(url, options)
}
}
class ProxyFetchRequester implements Requester {
async findExistingProxyTab() {
const tabs = await Browser.tabs.query({ pinned: true })
const results: (string | undefined)[] = await Promise.all(
tabs.map(async (tab) => {
if (tab.url) {
return tab.url
}
return Browser.tabs.sendMessage(tab.id!, 'url').catch(() => undefined)
}),
)
for (let i = 0; i < results.length; i++) {
if (results[i]?.startsWith('https://chat.openai.com')) {
return tabs[i]
}
}
}
waitForProxyTabReady(): Promise<Browser.Tabs.Tab> {
return new Promise((resolve, reject) => {
const listener = async function (message: any, sender: Runtime.MessageSender) {
if (message.event === 'PROXY_TAB_READY') {
console.debug('new proxy tab ready')
Browser.runtime.onMessage.removeListener(listener)
clearTimeout(timer)
resolve(sender.tab!)
return true
}
}
const timer = setTimeout(() => {
Browser.runtime.onMessage.removeListener(listener)
reject(new Error('Timeout waiting for ChatGPT tab'))
}, 10 * 1000)
Browser.runtime.onMessage.addListener(listener)
})
}
async createProxyTab() {
const readyPromise = this.waitForProxyTabReady()
Browser.tabs.create({ url: CHATGPT_HOME_URL, pinned: true })
return readyPromise
}
async getProxyTab() {
let tab = await this.findExistingProxyTab()
if (!tab) {
tab = await this.createProxyTab()
}
return tab
}
async refreshProxyTab() {
const tab = await this.findExistingProxyTab()
if (!tab) {
await this.createProxyTab()
return
}
const readyPromise = this.waitForProxyTabReady()
Browser.tabs.reload(tab.id!)
return readyPromise
}
async fetch(url: string, options?: RequestInitSubset) {
const tab = await this.getProxyTab()
const resp = await proxyFetch(tab.id!, url, options)
if (resp.status === 403) {
await this.refreshProxyTab()
return proxyFetch(tab.id!, url, options)
}
return resp
}
}
export const globalFetchRequester = new GlobalFetchRequester()
export const proxyFetchRequester = new ProxyFetchRequester()
================================================
FILE: src/app/bots/chatgpt-webapp/types.ts
================================================
export type ResponsePayload = {
conversation_id: string
message: {
id: string
author: { role: 'assistant' | 'tool' | 'user' }
content: ResponseContent
recipient: 'all' | string
}
error: null
}
export type ResponseContent =
| {
content_type: 'text'
parts: string[]
}
| {
content_type: 'code'
text: string
}
| {
content_type: 'tether_browsing_display'
result: string
}
| {
content_type: 'multimodal_text'
parts: ({ content_type: 'image_asset_pointer' } & ImageContent)[]
}
export type ResponseCitation = {
start_ix: number
end_ix: number
metadata: {
title: string
url: string
text: string
}
}
export interface ImageContent {
asset_pointer: string // file-service://file-5JUtfsLd8O0GEZzjtFmWvZr8
size_bytes: number
width: number
height: number
}
================================================
FILE: src/app/bots/claude/index.ts
================================================
import { ClaudeMode, getUserConfig } from '~/services/user-config'
import * as agent from '~services/agent'
import { AsyncAbstractBot, MessageParams } from '../abstract-bot'
import { ClaudeApiBot } from '../claude-api'
import { ClaudeWebBot } from '../claude-web'
import { PoeWebBot } from '../poe'
import { ChatError, ErrorCode } from '~utils/errors'
import { OpenRouterBot } from '../openrouter'
export class ClaudeBot extends AsyncAbstractBot {
async initializeBot() {
const { claudeMode, ...config } = await getUserConfig()
if (claudeMode === ClaudeMode.API) {
if (!config.claudeApiKey) {
throw new Error('Claude API key missing')
}
return new ClaudeApiBot({
claudeApiKey: config.claudeApiKey,
claudeApiModel: config.claudeApiModel,
})
}
if (claudeMode === ClaudeMode.Webapp) {
return new ClaudeWebBot()
}
if (claudeMode === ClaudeMode.OpenRouter) {
if (!config.openrouterApiKey) {
throw new ChatError('OpenRouter API key not set', ErrorCode.API_KEY_NOT_SET)
}
const model = `anthropic/${config.openrouterClaudeModel}`
return new OpenRouterBot({ apiKey: config.openrouterApiKey, model })
}
return new PoeWebBot(config.poeModel)
}
async sendMessage(params: MessageParams) {
const { claudeWebAccess } = await getUserConfig()
if (claudeWebAccess) {
return agent.execute(params.prompt, (prompt) => this.doSendMessageGenerator({ ...params, prompt }), params.signal)
}
return this.doSendMessageGenerator(params)
}
}
================================================
FILE: src/app/bots/claude-api/index.ts
================================================
import { requestHostPermission } from '~app/utils/permissions'
import { ClaudeAPIModel, UserConfig } from '~services/user-config'
import { ChatError, ErrorCode } from '~utils/errors'
import { parseSSEResponse } from '~utils/sse'
import { AbstractBot, SendMessageParams } from '../abstract-bot'
interface ConversationContext {
prompt: string
}
export class ClaudeApiBot extends AbstractBot {
private conversationContext?: ConversationContext
constructor(private config: Pick<UserConfig, 'claudeApiKey' | 'claudeApiModel'>) {
super()
}
async fetchCompletionApi(prompt: string, signal?: AbortSignal) {
return fetch('https://api.anthropic.com/v1/complete', {
method: 'POST',
signal,
headers: {
'content-type': 'application/json',
'x-api-key': this.config.claudeApiKey,
'anthropic-version': '2023-06-01',
},
body: JSON.stringify({
prompt,
model: this.getModelName(),
max_tokens_to_sample: 100_000,
stream: true,
}),
})
}
async doSendMessage(params: SendMessageParams) {
if (!(await requestHostPermission('https://*.anthropic.com/'))) {
throw new ChatError('Missing anthropic.com permission', ErrorCode.UNKOWN_ERROR)
}
if (!this.conversationContext) {
this.conversationContext = { prompt: '' }
}
this.conversationContext.prompt += `\n\nHuman: ${params.prompt}\n\nAssistant:`
const resp = await this.fetchCompletionApi(this.conversationContext.prompt, params.signal)
let result = ''
await parseSSEResponse(resp, (message) => {
console.debug('claude sse message', message)
const data = JSON.parse(message) as { completion: string }
if (data.completion) {
result += data.completion
params.onEvent({ type: 'UPDATE_ANSWER', data: { text: result.trimStart() } })
}
})
params.onEvent({ type: 'DONE' })
this.conversationContext!.prompt += result
}
private getModelName() {
switch (this.config.claudeApiModel) {
case ClaudeAPIModel['claude-instant-1']:
return 'claude-instant-1.2'
default:
return 'claude-2.1'
}
}
resetConversation() {
this.conversationContext = undefined
}
get name() {
return `Claude (API/${this.config.claudeApiModel})`
}
}
================================================
FILE: src/app/bots/claude-web/api.ts
================================================
import { FetchError, ofetch } from 'ofetch'
import { uuid } from '~utils'
import { ChatError, ErrorCode } from '~utils/errors'
export async function fetchOrganizationId(): Promise<string> {
let resp: Response
try {
resp = await fetch('https://claude.ai/api/organizations', { redirect: 'error', cache: 'no-cache' })
} catch (err) {
console.error(err)
throw new ChatError('Claude webapp not avaiable in your country', ErrorCode.CLAUDE_WEB_UNAVAILABLE)
}
if (resp.status === 403) {
throw new ChatError('There is no logged-in Claude account in this browser.', ErrorCode.CLAUDE_WEB_UNAUTHORIZED)
}
const orgs = await resp.json()
return orgs[0].uuid
}
export async function createConversation(organizationId: string): Promise<string> {
const id = uuid()
try {
await ofetch(`https://claude.ai/api/organizations/${organizationId}/chat_conversations`, {
method: 'POST',
body: { name: '', uuid: id },
})
} catch (err) {
if (err instanceof FetchError && err.status === 403) {
throw new ChatError('There is no logged-in Claude account in this browser.', ErrorCode.CLAUDE_WEB_UNAUTHORIZED)
}
throw err
}
return id
}
export async function generateChatTitle(organizationId: string, conversationId: string, content: string) {
await ofetch('https://claude.ai/api/generate_chat_title', {
method: 'POST',
body: {
organization_uuid: organizationId,
conversation_uuid: conversationId,
recent_titles: [],
message_content: content,
},
})
}
================================================
FILE: src/app/bots/claude-web/index.ts
================================================
import { parseSSEResponse } from '~utils/sse'
import { AbstractBot, SendMessageParams } from '../abstract-bot'
import { createConversation, fetchOrganizationId, generateChatTitle } from './api'
import { requestHostPermission } from '~app/utils/permissions'
import { ChatError, ErrorCode } from '~utils/errors'
interface ConversationContext {
conversationId: string
}
export class ClaudeWebBot extends AbstractBot {
private organizationId?: string
private conversationContext?: ConversationContext
private model: string
constructor() {
super()
this.model = 'claude-2.1'
}
async doSendMessage(params: SendMessageParams): Promise<void> {
if (!(await requestHostPermission('https://*.claude.ai/'))) {
throw new ChatError('Missing claude.ai permission', ErrorCode.MISSING_HOST_PERMISSION)
}
if (!this.organizationId) {
this.organizationId = await fetchOrganizationId()
}
if (!this.conversationContext) {
const conversationId = await createConversation(this.organizationId)
this.conversationContext = { conversationId }
generateChatTitle(this.organizationId, conversationId, params.prompt).catch(console.error)
}
const resp = await fetch('https://claude.ai/api/append_message', {
method: 'POST',
signal: params.signal,
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
organization_uuid: this.organizationId,
conversation_uuid: this.conversationContext.conversationId,
text: params.prompt,
completion: {
prompt: params.prompt,
model: this.model,
},
attachments: [],
}),
})
// different models are available for different accounts
if (!resp.ok && resp.status === 403 && this.model === 'claude-2.1') {
if ((await resp.text()).includes('model_not_allowed')) {
this.model = 'claude-2.0'
return this.doSendMessage(params)
}
}
let result = ''
await parseSSEResponse(resp, (message) => {
console.debug('claude sse message', message)
const payload = JSON.parse(message)
if (payload.completion) {
result += payload.completion
params.onEvent({
type: 'UPDATE_ANSWER',
data: { text: result.trimStart() },
})
} else if (payload.error) {
throw new Error(JSON.stringify(payload.error))
}
})
params.onEvent({ type: 'DONE' })
}
resetConversation() {
this.conversationContext = undefined
}
get name() {
return 'Claude (webapp/claude-2)'
}
}
================================================
FILE: src/app/bots/gemini-api/index.ts
================================================
import { GoogleGenerativeAI, ChatSession } from '@google/generative-ai'
import { AbstractBot, AsyncAbstractBot, SendMessageParams } from '../abstract-bot'
import { getUserConfig } from '~services/user-config'
interface ConversationContext {
chatSession: ChatSession
}
export class GeminiApiBot extends AbstractBot {
private conversationContext?: ConversationContext
sdk: GoogleGenerativeAI
constructor(public apiKey: string) {
super()
this.sdk = new GoogleGenerativeAI(apiKey)
}
async doSendMessage(params: SendMessageParams) {
if (!this.conversationContext) {
const model = this.sdk.getGenerativeModel({ model: 'gemini-pro' })
const chatSession = model.startChat()
this.conversationContext = { chatSession }
}
const result = await this.conversationContext.chatSession.sendMessageStream(params.prompt)
let text = ''
for await (const chunk of result.stream) {
const chunkText = chunk.text()
console.debug('gemini stream', chunkText)
text += chunkText
params.onEvent({ type: 'UPDATE_ANSWER', data: { text } })
}
if (!text) {
params.onEvent({ type: 'UPDATE_ANSWER', data: { text: 'Empty response' } })
}
params.onEvent({ type: 'DONE' })
}
resetConversation() {
this.conversationContext = undefined
}
get name() {
return 'Gemini Pro'
}
}
export class GeminiBot extends AsyncAbstractBot {
async initializeBot() {
const { geminiApiKey } = await getUserConfig()
if (!geminiApiKey) {
throw new Error('Gemini API key missing')
}
return new GeminiApiBot(geminiApiKey)
}
}
================================================
FILE: src/app/bots/gradio/index.ts
================================================
import WebSocketAsPromised from 'websocket-as-promised'
import { ChatError, ErrorCode } from '~utils/errors'
import { AbstractBot, SendMessageParams } from '../abstract-bot'
import { html2md } from '~app/utils/markdown'
function generateSessionHash() {
// https://stackoverflow.com/a/12502559/325241
return Math.random().toString(36).substring(2)
}
enum FnIndex {
Send = 39,
Receive = 40,
}
interface ConversationContext {
sessionHash: string
}
export class GradioBot extends AbstractBot {
private conversationContext?: ConversationContext
constructor(
public wsUrl: string,
public model: string,
public params: number[],
public mode?: 'text' | 'html',
) {
super()
}
async doSendMessage(params: SendMessageParams) {
if (!this.conversationContext) {
const sessionHash = await this.createSession(params.signal)
this.conversationContext = { sessionHash }
}
const sendWsp = await this.connectWebsocket(
FnIndex.Send,
this.conversationContext.sessionHash,
[null, this.model, params.prompt],
params.onEvent,
)
const receiveWsp = await this.connectWebsocket(
FnIndex.Receive,
this.conversationContext.sessionHash,
[null, ...this.params],
params.onEvent,
)
params.signal?.addEventListener('abort', () => {
;[sendWsp, receiveWsp].forEach((wsp) => {
wsp.removeAllListeners()
wsp.close()
})
})
}
async connectWebsocket(fnIndex: number, sessionHash: string, data: unknown[], onEvent: SendMessageParams['onEvent']) {
const wsp = new WebSocketAsPromised(this.wsUrl, {
packMessage: (data) => JSON.stringify(data),
unpackMessage: (data) => JSON.parse(data as string),
})
wsp.onUnpackedMessage.addListener(async (event) => {
if (event.msg === 'send_hash') {
wsp.sendPacked({ fn_index: fnIndex, session_hash: sessionHash })
} else if (event.msg === 'send_data') {
wsp.sendPacked({
fn_index: fnIndex,
data,
event_data: null,
session_hash: sessionHash,
})
} else if (event.msg === 'process_generating') {
if (event.success && event.output.data) {
if (fnIndex === FnIndex.Receive) {
const outputData = event.output.data
if (outputData[1].length > 0) {
const text = outputData[1][outputData[1].length - 1][1]
onEvent({
type: 'UPDATE_ANSWER',
data: {
text: this.mode === 'html' ? html2md(text) : text,
},
})
}
}
} else {
onEvent({ type: 'ERROR', error: new ChatError(event.output.error, ErrorCode.UNKOWN_ERROR) })
}
} else if (event.msg === 'queue_full') {
onEvent({ type: 'ERROR', error: new ChatError('queue_full', ErrorCode.UNKOWN_ERROR) })
} else if (event.msg === 'process_completed' && fnIndex === FnIndex.Receive && !event.output.data[1].length) {
onEvent({
type: 'ERROR',
error: new ChatError('Session has been inactive for too long', ErrorCode.LMSYS_SESSION_EXPIRED),
})
}
})
if (fnIndex === FnIndex.Receive) {
wsp.onClose.addListener(() => {
wsp.removeAllListeners()
onEvent({ type: 'DONE' })
})
}
try {
await wsp.open()
} catch (err) {
console.error('WS open error', err)
throw new ChatError('Failed to establish websocket connection.', ErrorCode.NETWORK_ERROR)
}
return wsp
}
resetConversation() {
this.conversationContext = undefined
}
public async createSession(_signal?: AbortSignal) {
return generateSessionHash()
}
}
================================================
FILE: src/app/bots/grok/index.ts
================================================
import { FetchError, ofetch } from 'ofetch'
import Browser from 'webextension-polyfill'
import { requestHostPermission } from '~app/utils/permissions'
import { ChatError, ErrorCode } from '~utils/errors'
import { streamAsyncIterable } from '~utils/stream-async-iterable'
import { AbstractBot, SendMessageParams } from '../abstract-bot'
const AUTHORIZATION_VALUE =
'Bearer AAAAAAAAAAAAAAAAAAAAANRILgAAAAAAnNwIzUejRCOuH5E6I8xnZz4puTs=1Zv7ttfk8LF81IUq16cHjhLTvJu4FA33AGWWjCpTnA'
interface StreamMessage {
result: {
sender: string
message: string
query: string
}
}
interface ChatMessage {
sender: 1 | 2
message: string
}
interface ConversationContext {
conversationId: string
messages: ChatMessage[]
}
export class GrokWebBot extends AbstractBot {
private csrfToken?: string
private conversationContext?: ConversationContext
constructor() {
super()
}
async doSendMessage(params: SendMessageParams) {
if (!(await requestHostPermission('https://*.twitter.com/'))) {
throw new ChatError('Missing twitter.com permission', ErrorCode.MISSING_HOST_PERMISSION)
}
if (!this.csrfToken) {
this.csrfToken = await this.readCsrfToken()
}
if (!this.conversationContext) {
const conversationId = await this.getConversationId()
this.conversationContext = { conversationId, messages: [] }
}
this.conversationContext.messages.push({ sender: 1, message: params.prompt })
const resp = await fetch('https://api.twitter.com/2/grok/add_response.json', {
method: 'POST',
headers: {
Authorization: AUTHORIZATION_VALUE,
'x-csrf-token': this.csrfToken!,
},
body: JSON.stringify({
conversationId: this.conversationContext.conversationId,
responses: this.conversationContext.messages,
systemPromptName: 'fun',
}),
signal: params.signal,
})
if (!resp.ok) {
throw new Error(resp.status.toString() + ' ' + (await resp.text()))
}
const decoder = new TextDecoder()
let result = ''
for await (const uint8Array of streamAsyncIterable(resp.body!)) {
const str = decoder.decode(uint8Array)
console.debug('grok stream', str)
const lines = str.split('\n')
for (const line of lines) {
if (!line) {
continue
}
const payload: StreamMessage = JSON.parse(line)
if (!payload.result) {
continue
}
if (!result && !payload.result.message && payload.result.query) {
params.onEvent({ type: 'UPDATE_ANSWER', data: { text: '_' + payload.result.query + '_' } })
} else {
const text = payload.result.message
if (text.startsWith('[link]')) {
// [link](#tweet=1711679181984346515)\n\n==\n\n[link](#tweet=1663711402643845122)
// skip special Twitter card message for now
} else {
result += text
params.onEvent({ type: 'UPDATE_ANSWER', data: { text: result } })
}
}
}
}
this.conversationContext.messages.push({ sender: 2, message: result })
params.onEvent({ type: 'DONE' })
}
private async getConversationId(): Promise<string> {
try {
const resp = await ofetch('https://twitter.com/i/api/2/grok/conversation_id.json', {
headers: {
Authorization: AUTHORIZATION_VALUE,
'x-csrf-tok
gitextract_jhqjs0wc/ ├── .eslintrc.json ├── .github/ │ ├── ISSUE_TEMPLATE/ │ │ ├── bug_report.md │ │ └── feature_request.md │ ├── dependabot.yml │ └── workflows/ │ ├── close-inactive-issues.yml │ └── release.yml ├── .gitignore ├── .prettierignore ├── .prettierrc ├── .yarnrc.yml ├── LICENSE ├── README.md ├── README_IN.md ├── README_JA.md ├── README_ZH-CN.md ├── README_ZH-TW.md ├── _locales/ │ ├── de/ │ │ └── messages.json │ ├── en/ │ │ └── messages.json │ ├── es/ │ │ └── messages.json │ ├── fr/ │ │ └── messages.json │ ├── in/ │ │ └── messages.json │ ├── ja/ │ │ └── messages.json │ ├── pt_BR/ │ │ └── messages.json │ ├── pt_PT/ │ │ └── messages.json │ ├── ru/ │ │ └── messages.json │ ├── th/ │ │ └── messages.json │ ├── zh_CN/ │ │ └── messages.json │ └── zh_TW/ │ └── messages.json ├── app.html ├── global.d.ts ├── manifest.config.ts ├── package.json ├── postcss.config.cjs ├── public/ │ └── js/ │ └── v2/ │ └── 35536E1E-65B4-4D96-9D97-6ADB7EFF8147/ │ └── api.js ├── sidepanel.html ├── src/ │ ├── app/ │ │ ├── base.scss │ │ ├── bots/ │ │ │ ├── abstract-bot.ts │ │ │ ├── baichuan/ │ │ │ │ ├── api.ts │ │ │ │ └── index.ts │ │ │ ├── bard/ │ │ │ │ ├── api.ts │ │ │ │ └── index.ts │ │ │ ├── bing/ │ │ │ │ ├── api.ts │ │ │ │ ├── index.ts │ │ │ │ ├── types.ts │ │ │ │ └── utils.ts │ │ │ ├── chatgpt/ │ │ │ │ └── index.ts │ │ │ ├── chatgpt-api/ │ │ │ │ ├── index.ts │ │ │ │ └── types.ts │ │ │ ├── chatgpt-azure/ │ │ │ │ └── index.ts │ │ │ ├── chatgpt-webapp/ │ │ │ │ ├── arkose/ │ │ │ │ │ ├── generator.js │ │ │ │ │ ├── index.ts │ │ │ │ │ └── server.ts │ │ │ │ ├── client.ts │ │ │ │ ├── index.ts │ │ │ │ ├── requesters.ts │ │ │ │ └── types.ts │ │ │ ├── claude/ │ │ │ │ └── index.ts │ │ │ ├── claude-api/ │ │ │ │ └── index.ts │ │ │ ├── claude-web/ │ │ │ │ ├── api.ts │ │ │ │ └── index.ts │ │ │ ├── gemini-api/ │ │ │ │ └── index.ts │ │ │ ├── gradio/ │ │ │ │ └── index.ts │ │ │ ├── grok/ │ │ │ │ └── index.ts │ │ │ ├── index.ts │ │ │ ├── lmsys/ │ │ │ │ └── index.ts │ │ │ ├── openrouter/ │ │ │ │ └── index.ts │ │ │ ├── perplexity/ │ │ │ │ └── index.ts │ │ │ ├── perplexity-api/ │ │ │ │ ├── api.ts │ │ │ │ └── index.ts │ │ │ ├── perplexity-web/ │ │ │ │ ├── api.ts │ │ │ │ └── index.ts │ │ │ ├── pi/ │ │ │ │ └── index.ts │ │ │ ├── poe/ │ │ │ │ ├── api.ts │ │ │ │ ├── graphql/ │ │ │ │ │ ├── AddMessageBreakMutation.graphql │ │ │ │ │ ├── AutoSubscriptionMutation.graphql │ │ │ │ │ ├── ChatViewQuery.graphql │ │ │ │ │ ├── MessageAddedSubscription.graphql │ │ │ │ │ ├── SendMessageMutation.graphql │ │ │ │ │ ├── SubscriptionsMutation.graphql │ │ │ │ │ └── ViewerStateUpdatedSubscription.graphql │ │ │ │ └── index.ts │ │ │ ├── qianwen/ │ │ │ │ ├── api.ts │ │ │ │ └── index.ts │ │ │ └── xunfei/ │ │ │ ├── api.ts │ │ │ ├── geeguard.js │ │ │ └── index.ts │ │ ├── components/ │ │ │ ├── Button.tsx │ │ │ ├── Chat/ │ │ │ │ ├── ChatMessageCard.tsx │ │ │ │ ├── ChatMessageInput.tsx │ │ │ │ ├── ChatMessageList.tsx │ │ │ │ ├── ChatbotName.tsx │ │ │ │ ├── ConversationPanel.tsx │ │ │ │ ├── ErrorAction.tsx │ │ │ │ ├── LayoutSwitch.tsx │ │ │ │ ├── MessageBubble.tsx │ │ │ │ ├── TextInput.tsx │ │ │ │ └── WebAccessCheckbox.tsx │ │ │ ├── Dialog.tsx │ │ │ ├── GuideModal.tsx │ │ │ ├── History/ │ │ │ │ ├── ChatMessage.tsx │ │ │ │ ├── Content.tsx │ │ │ │ └── Dialog.tsx │ │ │ ├── Input.tsx │ │ │ ├── Layout.tsx │ │ │ ├── Markdown/ │ │ │ │ ├── index.tsx │ │ │ │ └── markdown.css │ │ │ ├── Modals/ │ │ │ │ └── ReleaseNotesModal.tsx │ │ │ ├── Page.tsx │ │ │ ├── Premium/ │ │ │ │ ├── DiscountBadge.tsx │ │ │ │ ├── DiscountModal.tsx │ │ │ │ ├── FeatureList.tsx │ │ │ │ ├── Modal.tsx │ │ │ │ ├── PriceSection.tsx │ │ │ │ └── Testimonials.tsx │ │ │ ├── PromptCombobox.tsx │ │ │ ├── PromptLibrary/ │ │ │ │ ├── Dialog.tsx │ │ │ │ └── Library.tsx │ │ │ ├── RadioGroup.tsx │ │ │ ├── Select.tsx │ │ │ ├── Settings/ │ │ │ │ ├── Blockquote.tsx │ │ │ │ ├── ChatGPTAPISettings.tsx │ │ │ │ ├── ChatGPTAzureSettings.tsx │ │ │ │ ├── ChatGPTOpenRouterSettings.tsx │ │ │ │ ├── ChatGPTPoeSettings.tsx │ │ │ │ ├── ChatGPTWebSettings.tsx │ │ │ │ ├── ClaudeAPISettings.tsx │ │ │ │ ├── ClaudeOpenRouterSettings.tsx │ │ │ │ ├── ClaudePoeSettings.tsx │ │ │ │ ├── ClaudeWebappSettings.tsx │ │ │ │ ├── EnabledBotsSettings.tsx │ │ │ │ ├── ExportDataPanel.tsx │ │ │ │ ├── KDB.tsx │ │ │ │ ├── PerplexityAPISettings.tsx │ │ │ │ └── ShortcutPanel.tsx │ │ │ ├── Share/ │ │ │ │ ├── Dialog.tsx │ │ │ │ ├── MarkdownView.tsx │ │ │ │ ├── ShareGPTView.tsx │ │ │ │ └── sharegpt.ts │ │ │ ├── Sidebar/ │ │ │ │ ├── NavLink.tsx │ │ │ │ ├── PremiumEntry.tsx │ │ │ │ └── index.tsx │ │ │ ├── SwitchBotDropdown.tsx │ │ │ ├── Tabs.tsx │ │ │ ├── ThemeSettingModal/ │ │ │ │ └── index.tsx │ │ │ ├── Toggle.tsx │ │ │ └── Tooltip.tsx │ │ ├── consts.ts │ │ ├── context.ts │ │ ├── hooks/ │ │ │ ├── use-chat.ts │ │ │ ├── use-enabled-bots.ts │ │ │ ├── use-premium.ts │ │ │ ├── use-purchase-info.ts │ │ │ └── use-user-config.ts │ │ ├── i18n/ │ │ │ ├── index.ts │ │ │ └── locales/ │ │ │ ├── french.json │ │ │ ├── german.json │ │ │ ├── indonesia.json │ │ │ ├── japanese.json │ │ │ ├── portuguese.json │ │ │ ├── simplified-chinese.json │ │ │ ├── spanish.json │ │ │ ├── thai.json │ │ │ └── traditional-chinese.json │ │ ├── main.tsx │ │ ├── pages/ │ │ │ ├── MultiBotChatPanel.tsx │ │ │ ├── PremiumPage.tsx │ │ │ ├── SettingPage.tsx │ │ │ ├── SidePanelPage.tsx │ │ │ └── SingleBotChatPanel.tsx │ │ ├── plausible.ts │ │ ├── router.tsx │ │ ├── sidepanel.css │ │ ├── sidepanel.tsx │ │ ├── state/ │ │ │ └── index.ts │ │ ├── theme.ts │ │ └── utils/ │ │ ├── color-scheme.ts │ │ ├── env.ts │ │ ├── export.ts │ │ ├── image-compression/ │ │ │ ├── index.ts │ │ │ └── worker.ts │ │ ├── image-size.ts │ │ ├── markdown.ts │ │ ├── navigator.ts │ │ └── permissions.ts │ ├── background/ │ │ ├── index.ts │ │ ├── source.ts │ │ └── twitter-cookie.ts │ ├── content-script/ │ │ └── chatgpt-inpage-proxy.ts │ ├── rules/ │ │ ├── baichuan.json │ │ ├── bing.json │ │ ├── ddg.json │ │ ├── pplx.json │ │ └── qianwen.json │ ├── services/ │ │ ├── agent/ │ │ │ ├── index.ts │ │ │ ├── prompts.ts │ │ │ └── web-search/ │ │ │ ├── base.ts │ │ │ ├── bing-news.ts │ │ │ ├── duckduckgo.ts │ │ │ └── index.ts │ │ ├── chat-history.ts │ │ ├── lemonsqueezy.ts │ │ ├── premium.ts │ │ ├── prompts.ts │ │ ├── proxy-fetch.ts │ │ ├── release-notes.ts │ │ ├── sentry.ts │ │ ├── server-api.ts │ │ ├── storage/ │ │ │ ├── language.ts │ │ │ ├── open-times.ts │ │ │ └── token-usage.ts │ │ ├── theme.ts │ │ └── user-config.ts │ ├── types/ │ │ ├── chat.ts │ │ ├── index.ts │ │ └── messaging.ts │ ├── utils/ │ │ ├── encoding.ts │ │ ├── errors.ts │ │ ├── format.ts │ │ ├── index.ts │ │ ├── sse.ts │ │ └── stream-async-iterable.ts │ └── vite-env.d.ts ├── tailwind.config.cjs ├── tsconfig.json └── vite.config.ts
SYMBOL INDEX (630 symbols across 145 files)
FILE: public/js/v2/35536E1E-65B4-4D96-9D97-6ADB7EFF8147/api.js
function i (line 1) | function i(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t]...
function r (line 1) | function r(){}
function i (line 1) | function i(e,t,n){this.fn=e,this.context=t,this.once=n||!1}
function o (line 1) | function o(e,t,r,o,a){if("function"!=typeof r)throw new TypeError("The l...
function a (line 1) | function a(e,t){0==--e._eventsCount?e._events=new r:delete e._events[t]}
function c (line 1) | function c(){this._events=new r,this._eventsCount=0}
function q (line 1) | function q(e,t){return e.set(t[0],t[1]),e}
function z (line 1) | function z(e,t){return e.add(t),e}
function H (line 1) | function H(e,t,n,r){var i=-1,o=e?e.length:0;for(r&&o&&(n=e[++i]);++i<o;)...
function $ (line 1) | function $(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!...
function U (line 1) | function U(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n...
function V (line 1) | function V(e,t){return function(n){return e(t(n))}}
function W (line 1) | function W(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[+...
function ke (line 1) | function ke(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[...
function _e (line 1) | function _e(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[...
function Ae (line 1) | function Ae(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[...
function Te (line 1) | function Te(e){this.__data__=new _e(e)}
function Pe (line 1) | function Pe(e,t){var n=Ve(e)||function(e){return function(e){return func...
function Ce (line 1) | function Ce(e,t,n){var r=e[t];ee.call(e,t)&&Ue(r,n)&&(void 0!==n||t in e...
function Ie (line 1) | function Ie(e,t){for(var n=e.length;n--;)if(Ue(e[n][0],t))return n;retur...
function Re (line 1) | function Re(e,t,n,r,i,p,y){var C;if(r&&(C=p?r(e,i,p,y):r(e)),void 0!==C)...
function Le (line 1) | function Le(e){return!(!Ge(e)||(t=e,Y&&Y in t))&&(Xe(e)||$(e)?ne:C).test...
function Ne (line 1) | function Ne(e){var t=new e.constructor(e.byteLength);return new oe(t).se...
function De (line 1) | function De(e,t,n,r){n||(n={});for(var i=-1,o=t.length;++i<o;){var a=t[i...
function Fe (line 1) | function Fe(e,t){var n,r,i=e.__data__;return("string"==(r=typeof(n=t))||...
function Ke (line 1) | function Ke(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);re...
function ze (line 1) | function ze(e,t){return!!(t=null==t?i:t)&&("number"==typeof e||I.test(e)...
function He (line 1) | function He(e){var t=e&&e.constructor;return e===("function"==typeof t&&...
function $e (line 1) | function $e(e){if(null!=e){try{return Q.call(e)}catch(e){}try{return e+"...
function Ue (line 1) | function Ue(e,t){return e===t||e!=e&&t!=t}
function We (line 1) | function We(e){return null!=e&&function(e){return"number"==typeof e&&e>-...
function Xe (line 1) | function Xe(e){var t=Ge(e)?te.call(e):"";return t==s||t==u}
function Ge (line 1) | function Ge(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}
function Je (line 1) | function Je(e){return We(e)?Pe(e):function(e){if(!He(e))return de(e);var...
function e (line 1) | function e(e){return!isNaN(parseFloat(e))&&isFinite(e)}
function t (line 1) | function t(e){return e.charAt(0).toUpperCase()+e.substring(1)}
function n (line 1) | function n(e){return function(){return this[e]}}
function u (line 1) | function u(e){if(e)for(var n=0;n<s.length;n++)void 0!==e[s[n]]&&this["se...
function n (line 1) | function n(e){for(var n=-1,r=0;r<t.length;r++)if(t[r].identifier===e){n=...
function r (line 1) | function r(e,r){for(var o={},a=[],c=0;c<e.length;c++){var s=e[c],u=r.bas...
function i (line 1) | function i(e,t){var n=t.domAPI(t);n.update(e);return function(t){if(t){i...
function n (line 1) | function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={id:r...
function e (line 1) | function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbo...
function t (line 1) | function t(t){var n=function(t,n){if("object"!==e(t)||null===t)return t;...
function i (line 1) | function i(e,n){for(var r=0;r<n.length;r++){var i=n[r];i.enumerable=i.en...
function o (line 1) | function o(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),Object.defineProp...
function a (line 1) | function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a ...
function c (line 1) | function c(e,n,r){return(n=t(n))in e?Object.defineProperty(e,n,{value:r,...
function pe (line 1) | function pe(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)...
function ye (line 1) | function ye(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){v...
function be (line 1) | function be(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments...
function je (line 1) | function je(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){v...
function Se (line 1) | function Se(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments...
function e (line 1) | function e(){var t=this;a(this,e),this.config={context:null,target:"*",i...
function _e (line 1) | function _e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){v...
function Ae (line 1) | function Ae(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments...
function We (line 1) | function We(e,t){var n=Je();return We=function(e,t){return n[e-=102]},We...
function Je (line 1) | function Je(){var e=["operty","98752jXTTXx","hasOwnPr","+)+$","forEach",...
function Ot (line 1) | function Ot(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){v...
function At (line 1) | function At(){var e=["331140bObYZE","3269dePuBo","tor","toString","12470...
function Tt (line 1) | function Tt(e,t){var n=At();return Tt=function(e,t){return n[e-=189]},Tt...
function It (line 1) | function It(){var e=["724465bXqSUS","322020jhTTBg","118424nMYndJ","nOnTr...
function Rt (line 1) | function Rt(e,t){var n=It();return Rt=function(e,t){return n[e-=454]},Rt...
function Mt (line 1) | function Mt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){v...
function qt (line 1) | function qt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments...
FILE: src/app/bots/abstract-bot.ts
type AnwserPayload (line 5) | type AnwserPayload = {
type Event (line 9) | type Event =
type MessageParams (line 22) | interface MessageParams {
type SendMessageParams (line 29) | interface SendMessageParams extends MessageParams {
method sendMessage (line 34) | public async sendMessage(params: MessageParams) {
method doSendMessageGenerator (line 38) | protected async *doSendMessageGenerator(params: MessageParams) {
method name (line 79) | get name(): string | undefined {
method supportsImageInput (line 83) | get supportsImageInput() {
class DummyBot (line 91) | class DummyBot extends AbstractBot {
method doSendMessage (line 92) | async doSendMessage(_params: SendMessageParams) {
method resetConversation (line 95) | resetConversation() {
method name (line 98) | get name() {
method constructor (line 107) | constructor() {
method doSendMessage (line 121) | doSendMessage(params: SendMessageParams) {
method resetConversation (line 128) | resetConversation() {
method name (line 132) | get name() {
method supportsImageInput (line 136) | get supportsImageInput() {
FILE: src/app/bots/baichuan/api.ts
type UserInfo (line 5) | interface UserInfo {
function getUserInfo (line 9) | async function getUserInfo(): Promise<UserInfo> {
function randomString (line 25) | function randomString(length: number) {
function generateSessionId (line 29) | function generateSessionId() {
function generateMessageId (line 33) | function generateMessageId() {
FILE: src/app/bots/baichuan/index.ts
type Message (line 8) | interface Message {
type ConversationContext (line 15) | interface ConversationContext {
class BaichuanWebBot (line 22) | class BaichuanWebBot extends AbstractBot {
method doSendMessage (line 25) | async doSendMessage(params: SendMessageParams) {
method resetConversation (line 124) | resetConversation() {
method name (line 128) | get name() {
FILE: src/app/bots/bard/api.ts
function extractFromHTML (line 4) | function extractFromHTML(variableName: string, html: string) {
function fetchRequestParams (line 10) | async function fetchRequestParams() {
function parseBardResponse (line 23) | function parseBardResponse(resp: string) {
FILE: src/app/bots/bard/index.ts
function generateReqId (line 5) | function generateReqId() {
type ConversationContext (line 9) | interface ConversationContext {
class BardBot (line 14) | class BardBot extends AbstractBot {
method doSendMessage (line 17) | async doSendMessage(params: SendMessageParams) {
method resetConversation (line 66) | resetConversation() {
method supportsImageInput (line 70) | get supportsImageInput() {
method uploadImage (line 74) | private async uploadImage(image: File) {
FILE: src/app/bots/bing/api.ts
function randomIP (line 8) | function randomIP() {
constant API_ENDPOINT (line 12) | const API_ENDPOINT = 'https://www.bing.com/turing/conversation/create'
function createConversation (line 14) | async function createConversation(): Promise<ConversationResponse> {
FILE: src/app/bots/bing/index.ts
constant OPTIONS_SETS (line 12) | const OPTIONS_SETS = [
constant SLICE_IDS (line 31) | const SLICE_IDS = [
class BingWebBot (line 44) | class BingWebBot extends AbstractBot {
method buildChatRequest (line 47) | private buildChatRequest(conversation: ConversationInfo, message: stri...
method doSendMessage (line 103) | async doSendMessage(params: SendMessageParams) {
method resetConversation (line 222) | resetConversation() {
method supportsImageInput (line 226) | get supportsImageInput() {
method uploadImage (line 230) | private async uploadImage(image: File) {
method buildWssUrl (line 256) | private buildWssUrl(encryptedConversationSignature: string | undefined) {
FILE: src/app/bots/bing/types.ts
type ConversationResponse (line 3) | interface ConversationResponse {
type InvocationEventType (line 14) | enum InvocationEventType {
type ConversationInfo (line 26) | interface ConversationInfo {
type BingChatResponse (line 35) | interface BingChatResponse {
type ChatResponseMessage (line 45) | interface ChatResponseMessage {
type AdaptiveCard (line 62) | interface AdaptiveCard {
type Body (line 68) | interface Body {
type Feedback (line 75) | interface Feedback {
type SourceAttribution (line 81) | interface SourceAttribution {
type SuggestedResponse (line 87) | interface SuggestedResponse {
function generateMarkdown (line 100) | async function generateMarkdown(response: BingChatResponse) {
FILE: src/app/bots/bing/utils.ts
function convertMessageToMarkdown (line 3) | function convertMessageToMarkdown(message: ChatResponseMessage): string {
method packMessage (line 23) | packMessage(data: unknown) {
method unpackMessage (line 26) | unpackMessage(data: string | ArrayBuffer | Blob) {
function file2base64 (line 35) | async function file2base64(file: File, keepHeader = false): Promise<stri...
FILE: src/app/bots/chatgpt-api/index.ts
type ConversationContext (line 10) | interface ConversationContext {
constant CONTEXT_SIZE (line 14) | const CONTEXT_SIZE = 9
method buildUserMessage (line 19) | private buildUserMessage(prompt: string, imageUrl?: string): ChatMessage {
method buildMessages (line 32) | private buildMessages(prompt: string, imageUrl?: string): ChatMessage[] {
method getSystemMessage (line 42) | getSystemMessage() {
method doSendMessage (line 46) | async doSendMessage(params: SendMessageParams) {
method resetConversation (line 101) | resetConversation() {
class ChatGPTApiBot (line 108) | class ChatGPTApiBot extends AbstractChatGPTApiBot {
method constructor (line 109) | constructor(
method getSystemMessage (line 118) | getSystemMessage() {
method fetchCompletionApi (line 122) | async fetchCompletionApi(messages: ChatMessage[], signal?: AbortSignal) {
method getModelName (line 151) | private getModelName() {
method name (line 162) | get name() {
method supportsImageInput (line 166) | get supportsImageInput() {
FILE: src/app/bots/chatgpt-api/types.ts
type ContentPart (line 1) | type ContentPart =
type ChatMessage (line 5) | type ChatMessage =
FILE: src/app/bots/chatgpt-azure/index.ts
class ChatGPTAzureApiBot (line 5) | class ChatGPTAzureApiBot extends AbstractChatGPTApiBot {
method constructor (line 6) | constructor(
method fetchCompletionApi (line 15) | async fetchCompletionApi(messages: ChatMessage[], signal?: AbortSignal) {
method name (line 31) | get name() {
FILE: src/app/bots/chatgpt-webapp/arkose/generator.js
class ArkoseTokenGenerator (line 3) | class ArkoseTokenGenerator {
method constructor (line 4) | constructor() {
method useArkoseSetupEnforcement (line 11) | useArkoseSetupEnforcement(enforcement) {
method injectScript (line 39) | injectScript() {
method generate (line 48) | async generate() {
FILE: src/app/bots/chatgpt-webapp/arkose/index.ts
function getArkoseToken (line 4) | async function getArkoseToken() {
FILE: src/app/bots/chatgpt-webapp/arkose/server.ts
function fetchArkoseToken (line 3) | async function fetchArkoseToken(): Promise<string | undefined> {
FILE: src/app/bots/chatgpt-webapp/client.ts
class ChatGPTClient (line 6) | class ChatGPTClient {
method constructor (line 9) | constructor() {
method switchRequester (line 18) | switchRequester(newRequester: Requester) {
method fetch (line 23) | async fetch(url: string, options?: RequestInitSubset): Promise<Respons...
method getAccessToken (line 27) | async getAccessToken(): Promise<string> {
method requestBackendAPIWithToken (line 39) | private async requestBackendAPIWithToken(token: string, method: 'GET' ...
method getModels (line 50) | async getModels(token: string): Promise<{ slug: string; title: string;...
method generateChatTitle (line 55) | async generateChatTitle(token: string, conversationId: string, message...
method createFileUpload (line 61) | async createFileUpload(token: string, file: File): Promise<{ fileId: s...
method completeFileUpload (line 77) | async completeFileUpload(token: string, fileId: string) {
method uploadFile (line 81) | async uploadFile(token: string, file: File) {
method fixAuthState (line 97) | async fixAuthState() {
FILE: src/app/bots/chatgpt-webapp/index.ts
function removeCitations (line 12) | function removeCitations(text: string) {
function parseResponseContent (line 16) | function parseResponseContent(content: ResponseContent): { text?: string...
type ConversationContext (line 33) | interface ConversationContext {
class ChatGPTWebBot (line 38) | class ChatGPTWebBot extends AbstractBot {
method constructor (line 42) | constructor(public model: ChatGPTWebModel) {
method getModelName (line 46) | private async getModelName(): Promise<string> {
method uploadImage (line 53) | private async uploadImage(image: File): Promise<ImageContent> {
method buildMessage (line 64) | private buildMessage(prompt: string, image?: ImageContent) {
method doSendMessage (line 74) | async doSendMessage(params: SendMessageParams) {
method resetConversation (line 161) | resetConversation() {
method name (line 165) | get name() {
method supportsImageInput (line 169) | get supportsImageInput() {
FILE: src/app/bots/chatgpt-webapp/requesters.ts
type Requester (line 6) | interface Requester {
class GlobalFetchRequester (line 10) | class GlobalFetchRequester implements Requester {
method fetch (line 11) | fetch(url: string, options?: RequestInitSubset) {
class ProxyFetchRequester (line 16) | class ProxyFetchRequester implements Requester {
method findExistingProxyTab (line 17) | async findExistingProxyTab() {
method waitForProxyTabReady (line 34) | waitForProxyTabReady(): Promise<Browser.Tabs.Tab> {
method createProxyTab (line 54) | async createProxyTab() {
method getProxyTab (line 60) | async getProxyTab() {
method refreshProxyTab (line 68) | async refreshProxyTab() {
method fetch (line 79) | async fetch(url: string, options?: RequestInitSubset) {
FILE: src/app/bots/chatgpt-webapp/types.ts
type ResponsePayload (line 1) | type ResponsePayload = {
type ResponseContent (line 12) | type ResponseContent =
type ResponseCitation (line 30) | type ResponseCitation = {
type ImageContent (line 40) | interface ImageContent {
FILE: src/app/bots/chatgpt/index.ts
class ChatGPTBot (line 11) | class ChatGPTBot extends AsyncAbstractBot {
method initializeBot (line 12) | async initializeBot() {
method sendMessage (line 49) | async sendMessage(params: MessageParams) {
FILE: src/app/bots/claude-api/index.ts
type ConversationContext (line 7) | interface ConversationContext {
class ClaudeApiBot (line 11) | class ClaudeApiBot extends AbstractBot {
method constructor (line 14) | constructor(private config: Pick<UserConfig, 'claudeApiKey' | 'claudeA...
method fetchCompletionApi (line 18) | async fetchCompletionApi(prompt: string, signal?: AbortSignal) {
method doSendMessage (line 36) | async doSendMessage(params: SendMessageParams) {
method getModelName (line 63) | private getModelName() {
method resetConversation (line 72) | resetConversation() {
method name (line 76) | get name() {
FILE: src/app/bots/claude-web/api.ts
function fetchOrganizationId (line 5) | async function fetchOrganizationId(): Promise<string> {
function createConversation (line 20) | async function createConversation(organizationId: string): Promise<strin...
function generateChatTitle (line 36) | async function generateChatTitle(organizationId: string, conversationId:...
FILE: src/app/bots/claude-web/index.ts
type ConversationContext (line 7) | interface ConversationContext {
class ClaudeWebBot (line 11) | class ClaudeWebBot extends AbstractBot {
method constructor (line 16) | constructor() {
method doSendMessage (line 21) | async doSendMessage(params: SendMessageParams): Promise<void> {
method resetConversation (line 81) | resetConversation() {
method name (line 85) | get name() {
FILE: src/app/bots/claude/index.ts
class ClaudeBot (line 10) | class ClaudeBot extends AsyncAbstractBot {
method initializeBot (line 11) | async initializeBot() {
method sendMessage (line 35) | async sendMessage(params: MessageParams) {
FILE: src/app/bots/gemini-api/index.ts
type ConversationContext (line 5) | interface ConversationContext {
class GeminiApiBot (line 9) | class GeminiApiBot extends AbstractBot {
method constructor (line 13) | constructor(public apiKey: string) {
method doSendMessage (line 18) | async doSendMessage(params: SendMessageParams) {
method resetConversation (line 41) | resetConversation() {
method name (line 45) | get name() {
class GeminiBot (line 50) | class GeminiBot extends AsyncAbstractBot {
method initializeBot (line 51) | async initializeBot() {
FILE: src/app/bots/gradio/index.ts
function generateSessionHash (line 6) | function generateSessionHash() {
type FnIndex (line 11) | enum FnIndex {
type ConversationContext (line 16) | interface ConversationContext {
class GradioBot (line 20) | class GradioBot extends AbstractBot {
method constructor (line 23) | constructor(
method doSendMessage (line 32) | async doSendMessage(params: SendMessageParams) {
method connectWebsocket (line 59) | async connectWebsocket(fnIndex: number, sessionHash: string, data: unk...
method resetConversation (line 119) | resetConversation() {
method createSession (line 123) | public async createSession(_signal?: AbortSignal) {
FILE: src/app/bots/grok/index.ts
constant AUTHORIZATION_VALUE (line 8) | const AUTHORIZATION_VALUE =
type StreamMessage (line 11) | interface StreamMessage {
type ChatMessage (line 19) | interface ChatMessage {
type ConversationContext (line 24) | interface ConversationContext {
class GrokWebBot (line 29) | class GrokWebBot extends AbstractBot {
method constructor (line 33) | constructor() {
method doSendMessage (line 37) | async doSendMessage(params: SendMessageParams) {
method getConversationId (line 105) | private async getConversationId(): Promise<string> {
method readCsrfToken (line 132) | private async readCsrfToken({ refresh }: { refresh?: boolean } = {}): ...
method resetConversation (line 145) | resetConversation() {
method name (line 149) | get name() {
FILE: src/app/bots/index.ts
type BotId (line 14) | type BotId =
function createBotInstance (line 34) | function createBotInstance(botId: BotId) {
type BotInstance (line 75) | type BotInstance = ReturnType<typeof createBotInstance>
FILE: src/app/bots/lmsys/index.ts
class LMSYSBot (line 5) | class LMSYSBot extends GradioBot {
method constructor (line 6) | constructor(model: string) {
method initializeSession (line 10) | private async initializeSession(
method createSession (line 38) | async createSession(signal?: AbortSignal) {
FILE: src/app/bots/openrouter/index.ts
type ChatMessage (line 6) | interface ChatMessage {
type ConversationContext (line 11) | interface ConversationContext {
constant CONTEXT_SIZE (line 15) | const CONTEXT_SIZE = 9
class OpenRouterBot (line 17) | class OpenRouterBot extends AbstractBot {
method constructor (line 20) | constructor(private config: { apiKey: string; model: string }) {
method buildMessages (line 24) | buildMessages(prompt: string): ChatMessage[] {
method doSendMessage (line 28) | async doSendMessage(params: SendMessageParams) {
method fetchCompletionApi (line 84) | async fetchCompletionApi(messages: ChatMessage[], signal?: AbortSignal...
method resetConversation (line 102) | resetConversation() {
method name (line 106) | get name() {
FILE: src/app/bots/perplexity-api/api.ts
function getSessionId (line 3) | async function getSessionId() {
function initSession (line 10) | async function initSession(sessionId: string) {
function createSession (line 20) | async function createSession(): Promise<string> {
FILE: src/app/bots/perplexity-api/index.ts
type ChatMessage (line 4) | interface ChatMessage {
type ConversationContext (line 9) | interface ConversationContext {
class PerplexityApiBot (line 13) | class PerplexityApiBot extends AbstractBot {
method constructor (line 16) | constructor(
method doSendMessage (line 23) | async doSendMessage(params: SendMessageParams) {
method fetchCompletionApi (line 58) | private async fetchCompletionApi(messages: ChatMessage[], signal?: Abo...
method resetConversation (line 74) | resetConversation() {
method name (line 78) | get name() {
FILE: src/app/bots/perplexity-web/api.ts
function getSessionId (line 4) | async function getSessionId() {
function initSession (line 19) | async function initSession(sessionId: string) {
function createSession (line 29) | async function createSession(): Promise<string> {
FILE: src/app/bots/perplexity-web/index.ts
type ConversationContext (line 7) | interface ConversationContext {
class PerplexityLabsBot (line 11) | class PerplexityLabsBot extends AbstractBot {
method constructor (line 14) | constructor(public model: string) {
method buildMessage (line 18) | private buildMessage(prompt: string) {
method setupWebsocket (line 31) | private async setupWebsocket(sessionId: string): Promise<WebSocketAsPr...
method doSendMessage (line 51) | async doSendMessage(params: SendMessageParams) {
method resetConversation (line 91) | resetConversation() {
method name (line 95) | get name() {
FILE: src/app/bots/perplexity/index.ts
class PerplexityBot (line 6) | class PerplexityBot extends AsyncAbstractBot {
method initializeBot (line 7) | async initializeBot() {
FILE: src/app/bots/pi/index.ts
type ConversationContext (line 6) | interface ConversationContext {
class PiBot (line 10) | class PiBot extends AbstractBot {
method doSendMessage (line 13) | async doSendMessage(params: SendMessageParams) {
method resetConversation (line 43) | resetConversation() {
FILE: src/app/bots/poe/api.ts
constant GRAPHQL_QUERIES (line 13) | const GRAPHQL_QUERIES = {
type PoeSettings (line 22) | interface PoeSettings {
type ChannelData (line 27) | interface ChannelData {
function getFormkey (line 37) | async function getFormkey() {
function getPoeSettings (line 43) | async function getPoeSettings(): Promise<PoeSettings> {
type GqlHeaders (line 50) | interface GqlHeaders {
function gqlRequest (line 55) | async function gqlRequest(queryName: keyof typeof GRAPHQL_QUERIES, varia...
function getChatId (line 70) | async function getChatId(bot: string, poeSettings: PoeSettings): Promise...
FILE: src/app/bots/poe/index.ts
type ChatMessage (line 9) | interface ChatMessage {
type WebsocketMessage (line 17) | interface WebsocketMessage {
type ConversationContext (line 28) | interface ConversationContext {
class PoeWebBot (line 35) | class PoeWebBot extends AbstractBot {
method constructor (line 38) | constructor(public botId: string) {
method doSendMessage (line 42) | async doSendMessage(params: SendMessageParams) {
method resetConversation (line 105) | resetConversation() {
method getChatInfo (line 116) | private async getChatInfo() {
method sendMessageRequest (line 122) | private async sendMessageRequest(message: string) {
method sendChatBreak (line 143) | private async sendChatBreak() {
method subscribe (line 148) | private async subscribe(poeSettings: PoeSettings) {
method getWebsocketUrl (line 163) | private async getWebsocketUrl(poeSettings: PoeSettings) {
method connectWebsocket (line 169) | private async connectWebsocket(poeSettings: PoeSettings) {
method name (line 181) | get name() {
FILE: src/app/bots/qianwen/api.ts
type CreationResponse (line 4) | interface CreationResponse {
function createConversation (line 13) | async function createConversation(firstQuery: string, csrfToken: string) {
function extractVariable (line 34) | function extractVariable(variableName: string, html: string) {
function getCsrfToken (line 43) | async function getCsrfToken() {
FILE: src/app/bots/qianwen/index.ts
function generateMessageId (line 8) | function generateMessageId() {
type ConversationContext (line 12) | interface ConversationContext {
class QianwenWebBot (line 18) | class QianwenWebBot extends AbstractBot {
method doSendMessage (line 21) | async doSendMessage(params: SendMessageParams) {
method resetConversation (line 75) | resetConversation() {
method name (line 79) | get name() {
FILE: src/app/bots/xunfei/api.ts
function getGeeToken (line 5) | async function getGeeToken(): Promise<string> {
function createConversation (line 19) | async function createConversation() {
FILE: src/app/bots/xunfei/geeguard.js
function _MNVo (line 1) | function _MNVo(){}
function p (line 1) | function p(e,t,c,s){var $_EEN=_MNVo.$_Dt()[4][18];for(;$_EEN!==_MNVo.$_D...
function m (line 1) | function m(n,i){var $_EIr=_MNVo.$_Dt()[8][18];for(;$_EIr!==_MNVo.$_Dt()[...
function c (line 1) | function c(e,t,n){var $_FBl=_MNVo.$_Dt()[0][18];for(;$_FBl!==_MNVo.$_Dt(...
function u (line 1) | function u(t,n){var $_FCO=_MNVo.$_Dt()[12][18];for(;$_FCO!==_MNVo.$_Dt()...
function l (line 1) | function l(e,t){var $_FDN=_MNVo.$_Dt()[12][18];for(;$_FDN!==_MNVo.$_Dt()...
function d (line 1) | function d(r,o,a){var $_FEP=_MNVo.$_Dt()[8][18];for(;$_FEP!==_MNVo.$_Dt(...
function f (line 1) | function f(e,t){var $_FFn=_MNVo.$_Dt()[8][18];for(;$_FFn!==_MNVo.$_Dt()[...
function h (line 1) | function h(e,t){var $_FGn=_MNVo.$_Dt()[8][18];for(;$_FGn!==_MNVo.$_Dt()[...
function v (line 1) | function v(e,t){var $_FHE=_MNVo.$_Dt()[8][18];for(;$_FHE!==_MNVo.$_Dt()[...
function w (line 1) | function w(e,t){var $_FIr=_MNVo.$_Dt()[0][18];for(;$_FIr!==_MNVo.$_Dt()[...
function g (line 1) | function g(e,t){var $_FJn=_MNVo.$_Dt()[12][18];for(;$_FJn!==_MNVo.$_Dt()...
function b (line 1) | function b(e){var $_GAe=_MNVo.$_Dt()[0][18];for(;$_GAe!==_MNVo.$_Dt()[4]...
function r (line 1) | function r(e,t){var $_GBn=_MNVo.$_Dt()[12][18];for(;$_GBn!==_MNVo.$_Dt()...
function n (line 1) | function n(e,t){var $_GCs=_MNVo.$_Dt()[4][18];for(;$_GCs!==_MNVo.$_Dt()[...
function o (line 1) | function o(e){var $_GDB=_MNVo.$_Dt()[12][18];for(;$_GDB!==_MNVo.$_Dt()[8...
function i (line 1) | function i(e){var $_GEK=_MNVo.$_Dt()[4][18];for(;$_GEK!==_MNVo.$_Dt()[8]...
function a (line 1) | function a(e,t){var $_GFq=_MNVo.$_Dt()[12][18];for(;$_GFq!==_MNVo.$_Dt()...
function s (line 1) | function s(e){var $_GGO=_MNVo.$_Dt()[12][18];for(;$_GGO!==_MNVo.$_Dt()[1...
function y (line 1) | function y(e){var $_GHb=_MNVo.$_Dt()[4][18];for(;$_GHb!==_MNVo.$_Dt()[4]...
function _ (line 1) | function _(o,a,t){var $_GIQ=_MNVo.$_Dt()[0][18];for(;$_GIQ!==_MNVo.$_Dt(...
function S (line 1) | function S(){var $_GJw=_MNVo.$_Dt()[8][18];for(;$_GJw!==_MNVo.$_Dt()[8][...
function A (line 1) | function A(){var $_HAT=_MNVo.$_Dt()[0][18];for(;$_HAT!==_MNVo.$_Dt()[8][...
function C (line 1) | function C(){var $_HBa=_MNVo.$_Dt()[8][18];for(;$_HBa!==_MNVo.$_Dt()[4][...
function T (line 1) | function T(){var $_HCm=_MNVo.$_Dt()[8][18];for(;$_HCm!==_MNVo.$_Dt()[8][...
function E (line 1) | function E(s){var $_HDd=_MNVo.$_Dt()[12][18];for(;$_HDd!==_MNVo.$_Dt()[4...
function x (line 1) | function x(e){var $_HEI=_MNVo.$_Dt()[8][18];for(;$_HEI!==_MNVo.$_Dt()[8]...
function t (line 1) | function t(t,s,n){var $_HFd=_MNVo.$_Dt()[8][18];for(;$_HFd!==_MNVo.$_Dt(...
function O (line 1) | function O(e){var $_HGm=_MNVo.$_Dt()[4][18];for(;$_HGm!==_MNVo.$_Dt()[4]...
function B (line 1) | function B(){var $_HHg=_MNVo.$_Dt()[12][18];for(;$_HHg!==_MNVo.$_Dt()[0]...
function R (line 1) | function R(){var $_HIN=_MNVo.$_Dt()[4][18];for(;$_HIN!==_MNVo.$_Dt()[8][...
function j (line 1) | function j(e){var $_HJx=_MNVo.$_Dt()[4][18];for(;$_HJx!==_MNVo.$_Dt()[0]...
function I (line 1) | function I(e){var $_IAO=_MNVo.$_Dt()[0][18];for(;$_IAO!==_MNVo.$_Dt()[8]...
function F (line 1) | function F(e){var $_IBm=_MNVo.$_Dt()[12][18];for(;$_IBm!==_MNVo.$_Dt()[4...
function U (line 1) | function U(e){var $_ICi=_MNVo.$_Dt()[12][18];for(;$_ICi!==_MNVo.$_Dt()[0...
function L (line 1) | function L(e){var $_IDl=_MNVo.$_Dt()[0][18];for(;$_IDl!==_MNVo.$_Dt()[8]...
function z (line 1) | function z(e){var $_IEX=_MNVo.$_Dt()[4][18];for(;$_IEX!==_MNVo.$_Dt()[8]...
function W (line 1) | function W(t){var $_IFK=_MNVo.$_Dt()[12][18];for(;$_IFK!==_MNVo.$_Dt()[4...
function Z (line 1) | function Z(t){var $_IGX=_MNVo.$_Dt()[0][18];for(;$_IGX!==_MNVo.$_Dt()[12...
function J (line 1) | function J(t){var $_IHz=_MNVo.$_Dt()[8][18];for(;$_IHz!==_MNVo.$_Dt()[8]...
function X (line 1) | function X(t){var $_IIS=_MNVo.$_Dt()[12][18];for(;$_IIS!==_MNVo.$_Dt()[0...
function K (line 1) | function K(t){var $_IJy=_MNVo.$_Dt()[8][18];for(;$_IJy!==_MNVo.$_Dt()[8]...
function $ (line 1) | function $(t){var $_JAU=_MNVo.$_Dt()[0][18];for(;$_JAU!==_MNVo.$_Dt()[12...
function Y (line 1) | function Y(t){var $_JBn=_MNVo.$_Dt()[12][18];for(;$_JBn!==_MNVo.$_Dt()[4...
function Q (line 1) | function Q(t){var $_JCY=_MNVo.$_Dt()[8][18];for(;$_JCY!==_MNVo.$_Dt()[12...
function ee (line 1) | function ee(e,t){var $_JDE=_MNVo.$_Dt()[8][18];for(;$_JDE!==_MNVo.$_Dt()...
function n (line 1) | function n(){var $_JEE=_MNVo.$_Dt()[12][18];for(;$_JEE!==_MNVo.$_Dt()[12...
function ne (line 1) | function ne(e){var $_JFQ=_MNVo.$_Dt()[12][18];for(;$_JFQ!==_MNVo.$_Dt()[...
function ie (line 1) | function ie(e){var $_JGQ=_MNVo.$_Dt()[4][18];for(;$_JGQ!==_MNVo.$_Dt()[4...
function oe (line 1) | function oe(e,t){var $_JJr=_MNVo.$_Dt()[0][18];for(;$_JJr!==_MNVo.$_Dt()...
function ae (line 1) | function ae(e){var $_BAAO=_MNVo.$_Dt()[0][18];for(;$_BAAO!==_MNVo.$_Dt()...
function ce (line 1) | function ce(e){var $_BABc=_MNVo.$_Dt()[4][18];for(;$_BABc!==_MNVo.$_Dt()...
function ue (line 1) | function ue(){var $_BACy=_MNVo.$_Dt()[8][18];for(;$_BACy!==_MNVo.$_Dt()[...
function me (line 1) | function me(e,t){var $_BADu=_MNVo.$_Dt()[8][18];for(;$_BADu!==_MNVo.$_Dt...
function t (line 1) | function t(){var $_BAEr=_MNVo.$_Dt()[0][18];for(;$_BAEr!==_MNVo.$_Dt()[1...
function t (line 1) | function t(){var $_BAFx=_MNVo.$_Dt()[0][18];for(;$_BAFx!==_MNVo.$_Dt()[1...
function a (line 1) | function a(){var $_BAGf=_MNVo.$_Dt()[8][18];for(;$_BAGf!==_MNVo.$_Dt()[8...
function c (line 1) | function c(){var $_BAHq=_MNVo.$_Dt()[8][18];for(;$_BAHq!==_MNVo.$_Dt()[4...
function w (line 1) | function w(e,t,n){var $_BAId=_MNVo.$_Dt()[4][18];for(;$_BAId!==_MNVo.$_D...
function g (line 1) | function g(){var $_BAJL=_MNVo.$_Dt()[8][18];for(;$_BAJL!==_MNVo.$_Dt()[0...
function d (line 1) | function d(e){var $_BBAk=_MNVo.$_Dt()[0][18];for(;$_BBAk!==_MNVo.$_Dt()[...
function f (line 1) | function f(e){var $_BBBc=_MNVo.$_Dt()[0][18];for(;$_BBBc!==_MNVo.$_Dt()[...
function b (line 1) | function b(e){var $_BBCK=_MNVo.$_Dt()[4][18];for(;$_BBCK!==_MNVo.$_Dt()[...
function h (line 1) | function h(e){var $_BBDw=_MNVo.$_Dt()[8][18];for(;$_BBDw!==_MNVo.$_Dt()[...
function p (line 1) | function p(e){var $_BBEM=_MNVo.$_Dt()[4][18];for(;$_BBEM!==_MNVo.$_Dt()[...
function m (line 1) | function m(){var $_BBFX=_MNVo.$_Dt()[4][18];for(;$_BBFX!==_MNVo.$_Dt()[8...
function Tt (line 1) | function Tt(e){var $_BBGY=_MNVo.$_Dt()[12][18];for(;$_BBGY!==_MNVo.$_Dt(...
function Mt (line 1) | function Mt(e){var $_BBHs=_MNVo.$_Dt()[8][18];for(;$_BBHs!==_MNVo.$_Dt()...
function Nt (line 1) | function Nt(){var $_BBIt=_MNVo.$_Dt()[4][18];for(;$_BBIt!==_MNVo.$_Dt()[...
function Bt (line 1) | function Bt(e){var $_BBJs=_MNVo.$_Dt()[12][18];for(;$_BBJs!==_MNVo.$_Dt(...
function Ht (line 1) | function Ht(e){var $_BCAI=_MNVo.$_Dt()[4][18];for(;$_BCAI!==_MNVo.$_Dt()...
function Vt (line 1) | function Vt(e){var $_BCBh=_MNVo.$_Dt()[12][18];for(;$_BCBh!==_MNVo.$_Dt(...
function Wt (line 1) | function Wt(e){var $_BCCA=_MNVo.$_Dt()[0][18];for(;$_BCCA!==_MNVo.$_Dt()...
function Zt (line 1) | function Zt(t){var $_BCDD=_MNVo.$_Dt()[4][18];for(;$_BCDD!==_MNVo.$_Dt()...
function Jt (line 1) | function Jt(n){var $_BCEE=_MNVo.$_Dt()[0][18];for(;$_BCEE!==_MNVo.$_Dt()...
function $t (line 1) | function $t(e){var $_BCFn=_MNVo.$_Dt()[8][18];for(;$_BCFn!==_MNVo.$_Dt()...
function Yt (line 1) | function Yt(){var $_BCGP=_MNVo.$_Dt()[12][18];for(;$_BCGP!==_MNVo.$_Dt()...
function Qt (line 1) | function Qt(e){var $_BCHo=_MNVo.$_Dt()[12][18];for(;$_BCHo!==_MNVo.$_Dt(...
function en (line 1) | function en(i,r){var $_BCId=_MNVo.$_Dt()[8][18];for(;$_BCId!==_MNVo.$_Dt...
function tn (line 1) | function tn(e,t){var $_BCJS=_MNVo.$_Dt()[8][18];for(;$_BCJS!==_MNVo.$_Dt...
function nn (line 1) | function nn(e,t){var $_BDAT=_MNVo.$_Dt()[4][18];for(;$_BDAT!==_MNVo.$_Dt...
function rn (line 1) | function rn(e){var $_BDBx=_MNVo.$_Dt()[0][18];for(;$_BDBx!==_MNVo.$_Dt()...
function on (line 1) | function on(e,t,n){var $_BDCc=_MNVo.$_Dt()[8][18];for(;$_BDCc!==_MNVo.$_...
function an (line 1) | function an(e,t){var $_BDDr=_MNVo.$_Dt()[4][18];for(;$_BDDr!==_MNVo.$_Dt...
function s (line 1) | function s(t,e){var $_BDEt=_MNVo.$_Dt()[0][18];for(;$_BDEt!==_MNVo.$_Dt(...
function cn (line 1) | function cn(e){var $_BDFq=_MNVo.$_Dt()[4][18];for(;$_BDFq!==_MNVo.$_Dt()...
FILE: src/app/bots/xunfei/index.ts
type ConversationContext (line 8) | interface ConversationContext {
function generateFD (line 13) | function generateFD() {
class XunfeiBot (line 18) | class XunfeiBot extends AbstractBot {
method doSendMessage (line 21) | async doSendMessage(params: SendMessageParams) {
method resetConversation (line 73) | resetConversation() {
method name (line 77) | get name() {
FILE: src/app/components/Button.tsx
type Props (line 7) | interface Props {
FILE: src/app/components/Chat/ChatMessageCard.tsx
constant COPY_ICON_CLASS (line 11) | const COPY_ICON_CLASS = 'self-top cursor-pointer invisible group-hover:v...
type Props (line 13) | interface Props {
FILE: src/app/components/Chat/ChatMessageInput.tsx
type Props (line 27) | interface Props {
FILE: src/app/components/Chat/ChatMessageList.tsx
type Props (line 8) | interface Props {
FILE: src/app/components/Chat/ChatbotName.tsx
type Props (line 7) | interface Props {
FILE: src/app/components/Chat/ConversationPanel.tsx
type Props (line 22) | interface Props {
FILE: src/app/components/Chat/LayoutSwitch.tsx
type Props (line 18) | interface Props {
FILE: src/app/components/Chat/MessageBubble.tsx
type Props (line 4) | interface Props {
FILE: src/app/components/Chat/TextInput.tsx
type Props (line 5) | type Props = TextareaAutosizeProps & {
FILE: src/app/components/Chat/WebAccessCheckbox.tsx
type Props (line 13) | interface Props {
FILE: src/app/components/Dialog.tsx
type Props (line 6) | interface Props {
FILE: src/app/components/History/ChatMessage.tsx
type Props (line 11) | interface Props {
FILE: src/app/components/History/Content.tsx
type ViewportListItem (line 12) | type ViewportListItem =
FILE: src/app/components/History/Dialog.tsx
type Props (line 30) | interface Props {
FILE: src/app/components/Input.tsx
type InputProps (line 5) | type InputProps = HTMLProps<HTMLInputElement>
FILE: src/app/components/Layout.tsx
function Layout (line 9) | function Layout() {
FILE: src/app/components/Markdown/index.tsx
function CustomCode (line 18) | function CustomCode(props: { children: ReactNode; className?: string }) {
FILE: src/app/components/Premium/DiscountModal.tsx
type DiscountDialogProps (line 11) | interface DiscountDialogProps {
FILE: src/app/components/Premium/FeatureList.tsx
type FeatureId (line 7) | type FeatureId = 'web-access' | 'all-in-one-layout'
type Feature (line 9) | interface Feature {
FILE: src/app/components/PromptCombobox.tsx
constant LIBRARY_PROMPT (line 8) | const LIBRARY_PROMPT: Prompt = {
type ComboboxContextValue (line 14) | interface ComboboxContextValue {
FILE: src/app/components/PromptLibrary/Dialog.tsx
type Props (line 4) | interface Props {
FILE: src/app/components/PromptLibrary/Library.tsx
function PromptForm (line 63) | function PromptForm(props: { initialData: Prompt; onSubmit: (data: Promp...
function LocalPrompts (line 101) | function LocalPrompts(props: { insertPrompt: (text: string) => void }) {
function CommunityPrompts (line 160) | function CommunityPrompts(props: { insertPrompt: (text: string) => void ...
FILE: src/app/components/RadioGroup.tsx
type Option (line 3) | interface Option {
type Props (line 27) | interface Props {
FILE: src/app/components/Select.tsx
type Props (line 6) | interface Props<T> {
function Select (line 15) | function Select<T extends string>(props: Props<T>) {
FILE: src/app/components/Settings/ChatGPTAPISettings.tsx
type Props (line 9) | interface Props {
FILE: src/app/components/Settings/ChatGPTAzureSettings.tsx
type Props (line 5) | interface Props {
FILE: src/app/components/Settings/ChatGPTOpenRouterSettings.tsx
type Props (line 7) | interface Props {
FILE: src/app/components/Settings/ChatGPTPoeSettings.tsx
type Props (line 6) | interface Props {
FILE: src/app/components/Settings/ChatGPTWebSettings.tsx
type Props (line 7) | interface Props {
FILE: src/app/components/Settings/ClaudeAPISettings.tsx
type Props (line 8) | interface Props {
FILE: src/app/components/Settings/ClaudeOpenRouterSettings.tsx
type Props (line 7) | interface Props {
FILE: src/app/components/Settings/ClaudePoeSettings.tsx
type Props (line 6) | interface Props {
FILE: src/app/components/Settings/ClaudeWebappSettings.tsx
type Props (line 7) | interface Props {
FILE: src/app/components/Settings/EnabledBotsSettings.tsx
type Props (line 6) | interface Props {
FILE: src/app/components/Settings/ExportDataPanel.tsx
function ExportDataPanel (line 6) | function ExportDataPanel() {
FILE: src/app/components/Settings/KDB.tsx
function KDB (line 1) | function KDB(props: { text: string }) {
FILE: src/app/components/Settings/PerplexityAPISettings.tsx
type Props (line 7) | interface Props {
FILE: src/app/components/Settings/ShortcutPanel.tsx
function ShortcutPanel (line 7) | function ShortcutPanel() {
FILE: src/app/components/Share/Dialog.tsx
type Props (line 10) | interface Props {
FILE: src/app/components/Share/MarkdownView.tsx
type Props (line 6) | interface Props {
FILE: src/app/components/Share/ShareGPTView.tsx
type Props (line 8) | interface Props {
FILE: src/app/components/Share/sharegpt.ts
constant USER_AVATAR_URI (line 10) | const USER_AVATAR_URI =
type ShareGPTItem (line 13) | interface ShareGPTItem {
function markdown2html (line 18) | async function markdown2html(markdown: string) {
function buildItems (line 29) | async function buildItems(messages: ChatMessageModel[]): Promise<ShareGP...
function uploadToShareGPT (line 48) | async function uploadToShareGPT(messages: ChatMessageModel[]) {
FILE: src/app/components/Sidebar/NavLink.tsx
function NavLink (line 4) | function NavLink(props: LinkOptions & { text: string; icon: any; iconOnl...
FILE: src/app/components/Sidebar/index.tsx
function IconButton (line 27) | function IconButton(props: { icon: string; onClick?: () => void }) {
function Sidebar (line 38) | function Sidebar() {
FILE: src/app/components/SwitchBotDropdown.tsx
type Props (line 6) | interface Props {
FILE: src/app/components/Tabs.tsx
type Tab (line 4) | interface Tab {
type Props (line 9) | interface Props {
FILE: src/app/components/ThemeSettingModal/index.tsx
constant THEME_COLORS (line 33) | const THEME_COLORS = [
type Props (line 46) | interface Props {
FILE: src/app/components/Toggle.tsx
type Props (line 5) | interface Props {
FILE: src/app/components/Tooltip.tsx
type Props (line 4) | interface Props {
FILE: src/app/consts.ts
constant CHATBOTS (line 21) | const CHATBOTS: Record<BotId, { name: string; avatar: string }> = {
constant CHATGPT_HOME_URL (line 96) | const CHATGPT_HOME_URL = 'https://chat.openai.com'
constant CHATGPT_API_MODELS (line 97) | const CHATGPT_API_MODELS = ['gpt-3.5-turbo', 'gpt-4', 'gpt-4-turbo'] as ...
constant ALL_IN_ONE_PAGE_ID (line 98) | const ALL_IN_ONE_PAGE_ID = 'all'
constant DEFAULT_CHATGPT_SYSTEM_MESSAGE (line 100) | const DEFAULT_CHATGPT_SYSTEM_MESSAGE =
type Layout (line 103) | type Layout = 2 | 3 | 4 | 'imageInput' | 'twoVertical' | 'sixGrid' // tw...
FILE: src/app/context.ts
type ConversationContextValue (line 3) | interface ConversationContextValue {
FILE: src/app/hooks/use-chat.ts
function useChat (line 12) | function useChat(botId: BotId) {
FILE: src/app/hooks/use-enabled-bots.ts
function useEnabledBots (line 6) | function useEnabledBots() {
FILE: src/app/hooks/use-premium.ts
function usePremium (line 5) | function usePremium() {
FILE: src/app/hooks/use-purchase-info.ts
function usePurchaseInfo (line 5) | function usePurchaseInfo() {
function useDiscountCode (line 9) | function useDiscountCode() {
FILE: src/app/hooks/use-user-config.ts
function useUserConfig (line 4) | function useUserConfig() {
FILE: src/app/pages/MultiBotChatPanel.tsx
constant DEFAULT_BOTS (line 18) | const DEFAULT_BOTS: BotId[] = Object.keys(CHATBOTS).slice(0, 6) as BotId[]
function replaceDeprecatedBots (line 26) | function replaceDeprecatedBots(bots: BotId[]): BotId[] {
FILE: src/app/pages/PremiumPage.tsx
function PremiumPage (line 17) | function PremiumPage() {
FILE: src/app/pages/SettingPage.tsx
constant BING_STYLE_OPTIONS (line 37) | const BING_STYLE_OPTIONS = [
function SettingPage (line 52) | function SettingPage() {
FILE: src/app/pages/SidePanelPage.tsx
function SidePanelPage (line 15) | function SidePanelPage() {
FILE: src/app/pages/SingleBotChatPanel.tsx
type Props (line 6) | interface Props {
FILE: src/app/plausible.ts
function trackEvent (line 11) | function trackEvent(name: string, props?: { [propName: string]: string |...
FILE: src/app/router.tsx
function ChatRoute (line 23) | function ChatRoute() {
FILE: src/app/sidepanel.tsx
function PremiumOnly (line 14) | function PremiumOnly() {
function SidePanelApp (line 31) | function SidePanelApp() {
FILE: src/app/state/index.ts
type Param (line 11) | type Param = { botId: BotId; page: string }
FILE: src/app/utils/color-scheme.ts
constant COLOR_SCHEME_QUERY (line 3) | const COLOR_SCHEME_QUERY = '(prefers-color-scheme: dark)'
function light (line 5) | function light() {
function dark (line 10) | function dark() {
function isSystemDarkMode (line 15) | function isSystemDarkMode() {
function colorSchemeListener (line 19) | function colorSchemeListener(e: MediaQueryListEvent) {
function applyThemeMode (line 28) | function applyThemeMode(mode: ThemeMode) {
function getDefaultThemeColor (line 50) | function getDefaultThemeColor() {
FILE: src/app/utils/env.ts
function isArcBrowser (line 1) | function isArcBrowser() {
FILE: src/app/utils/export.ts
function exportData (line 5) | async function exportData() {
function importData (line 17) | async function importData() {
FILE: src/app/utils/image-compression/index.ts
function compressImageFileViaWorker (line 4) | async function compressImageFileViaWorker(image: File): Promise<File> {
function _compressImageFile (line 21) | async function _compressImageFile(image: File): Promise<File> {
FILE: src/app/utils/image-size.ts
function getImageSize (line 1) | async function getImageSize(file: File): Promise<{ width: number; height...
FILE: src/app/utils/markdown.ts
function html2md (line 5) | function html2md(html: string) {
FILE: src/app/utils/permissions.ts
function requestHostPermissions (line 3) | async function requestHostPermissions(hosts: string[]) {
function requestHostPermission (line 11) | async function requestHostPermission(host: string) {
FILE: src/background/index.ts
function openAppPage (line 11) | async function openAppPage() {
FILE: src/background/source.ts
function trackEvent (line 5) | async function trackEvent(name: string, props: object) {
function trackInstallSource (line 18) | async function trackInstallSource() {
FILE: src/background/twitter-cookie.ts
function readTwitterCsrfToken (line 10) | async function readTwitterCsrfToken({ refresh }: { refresh?: boolean } =...
FILE: src/content-script/chatgpt-inpage-proxy.ts
function injectTip (line 4) | function injectTip() {
function main (line 19) | async function main() {
FILE: src/services/agent/index.ts
constant TOOLS (line 6) | const TOOLS = {
function buildToolUsingPrompt (line 11) | function buildToolUsingPrompt(input: string) {
function buildPromptWithContext (line 18) | function buildPromptWithContext(input: string, context: string) {
constant FINAL_ANSWER_KEYWORD_REGEX (line 26) | const FINAL_ANSWER_KEYWORD_REGEX = /"action":\s*"Final Answer"/
constant WEB_SEARCH_KEYWORD_REGEX (line 27) | const WEB_SEARCH_KEYWORD_REGEX = /"action":\s*"web_search"/
constant ACTION_INPUT_REGEX (line 28) | const ACTION_INPUT_REGEX = /"action_input":\s*"((?:\\.|[^"])+)(?:"\s*(``...
FILE: src/services/agent/prompts.ts
constant PROMPT_TEMPLATE (line 1) | const PROMPT_TEMPLATE = `USER'S INPUT
FILE: src/services/agent/web-search/base.ts
type SearchResultItem (line 1) | interface SearchResultItem {
type SearchResult (line 7) | interface SearchResult {
FILE: src/services/agent/web-search/bing-news.ts
class BingNewsSearch (line 4) | class BingNewsSearch extends WebSearch {
method search (line 5) | async search(query: string, signal?: AbortSignal): Promise<SearchResul...
method fetchSerp (line 11) | private async fetchSerp(query: string, signal?: AbortSignal) {
method extractItems (line 20) | private extractItems(html: string) {
FILE: src/services/agent/web-search/duckduckgo.ts
class DuckDuckGoSearch (line 4) | class DuckDuckGoSearch extends WebSearch {
method search (line 5) | async search(query: string, signal?: AbortSignal): Promise<SearchResul...
method fetchSerp (line 11) | private async fetchSerp(query: string, signal?: AbortSignal) {
method extractItems (line 20) | private extractItems(html: string) {
FILE: src/services/agent/web-search/index.ts
constant MAX_CONTEXT_ITEMS (line 7) | const MAX_CONTEXT_ITEMS = 15
function _searchRelatedContext (line 11) | async function _searchRelatedContext(query: string, signal?: AbortSignal) {
function searchRelatedContext (line 59) | async function searchRelatedContext(query: string, signal?: AbortSignal) {
FILE: src/services/chat-history.ts
type Conversation (line 11) | interface Conversation {
type ConversationWithMessages (line 16) | type ConversationWithMessages = Conversation & { messages: ChatMessageMo...
function loadHistoryConversations (line 18) | async function loadHistoryConversations(botId: BotId): Promise<Conversat...
function deleteHistoryConversation (line 24) | async function deleteHistoryConversation(botId: BotId, cid: string) {
function loadConversationMessages (line 30) | async function loadConversationMessages(botId: BotId, cid: string): Prom...
function setConversationMessages (line 36) | async function setConversationMessages(botId: BotId, cid: string, messag...
function loadHistoryMessages (line 46) | async function loadHistoryMessages(botId: BotId): Promise<ConversationWi...
function deleteHistoryMessage (line 56) | async function deleteHistoryMessage(botId: BotId, conversationId: string...
function clearHistoryMessages (line 65) | async function clearHistoryMessages(botId: BotId) {
FILE: src/services/lemonsqueezy.ts
function activateLicense (line 4) | async function activateLicense(key: string, instanceName: string) {
function deactivateLicense (line 12) | async function deactivateLicense(key: string, instanceId: string) {
type LicenseKey (line 22) | type LicenseKey = {
function validateLicense (line 26) | async function validateLicense(key: string, instanceId: string): Promise...
FILE: src/services/premium.ts
type PremiumActivation (line 4) | interface PremiumActivation {
function getInstanceName (line 9) | function getInstanceName() {
function activatePremium (line 13) | async function activatePremium(licenseKey: string): Promise<PremiumActiv...
function validatePremium (line 20) | async function validatePremium() {
function deactivatePremium (line 28) | async function deactivatePremium() {
function getPremiumActivation (line 37) | function getPremiumActivation(): PremiumActivation | null {
FILE: src/services/prompts.ts
type Prompt (line 5) | interface Prompt {
function loadLocalPrompts (line 11) | async function loadLocalPrompts() {
function saveLocalPrompt (line 16) | async function saveLocalPrompt(prompt: Prompt) {
function removeLocalPrompt (line 34) | async function removeLocalPrompt(id: string) {
function loadRemotePrompts (line 39) | async function loadRemotePrompts() {
FILE: src/services/proxy-fetch.ts
function setupProxyExecutor (line 12) | function setupProxyExecutor() {
function proxyFetch (line 45) | async function proxyFetch(tabId: number, url: string, options?: RequestI...
FILE: src/services/release-notes.ts
constant RELEASE_NOTES (line 5) | const RELEASE_NOTES = [
function checkReleaseNotes (line 12) | async function checkReleaseNotes(): Promise<string[]> {
FILE: src/services/server-api.ts
function decodePoeFormkey (line 3) | async function decodePoeFormkey(html: string): Promise<string> {
type ActivateResponse (line 11) | type ActivateResponse =
function activateLicense (line 19) | async function activateLicense(key: string, instanceName: string) {
type Product (line 29) | interface Product {
function fetchPremiumProduct (line 33) | async function fetchPremiumProduct() {
function createDiscount (line 37) | async function createDiscount() {
type Discount (line 43) | interface Discount {
type Campaign (line 50) | interface Campaign {
type PurchaseInfo (line 56) | interface PurchaseInfo {
function fetchPurchaseInfo (line 62) | async function fetchPurchaseInfo() {
function checkDiscount (line 66) | async function checkDiscount(params: { appOpenTimes: number; premiumModa...
FILE: src/services/storage/language.ts
function setLanguage (line 3) | function setLanguage(lang: string | undefined) {
function getLanguage (line 11) | function getLanguage() {
FILE: src/services/storage/open-times.ts
function getAppOpenTimes (line 3) | async function getAppOpenTimes() {
function incrAppOpenTimes (line 8) | async function incrAppOpenTimes() {
function getPremiumModalOpenTimes (line 14) | async function getPremiumModalOpenTimes() {
function incrPremiumModalOpenTimes (line 19) | async function incrPremiumModalOpenTimes() {
FILE: src/services/storage/token-usage.ts
function getTokenUsage (line 3) | async function getTokenUsage() {
function incrTokenUsage (line 8) | async function incrTokenUsage(v = 1) {
function resetTokenUsage (line 13) | async function resetTokenUsage() {
FILE: src/services/theme.ts
type ThemeMode (line 1) | enum ThemeMode {
function getUserThemeMode (line 7) | function getUserThemeMode(): ThemeMode {
function setUserThemeMode (line 11) | function setUserThemeMode(themeMode: ThemeMode) {
FILE: src/services/user-config.ts
type BingConversationStyle (line 6) | enum BingConversationStyle {
type ChatGPTMode (line 12) | enum ChatGPTMode {
type ChatGPTWebModel (line 20) | enum ChatGPTWebModel {
type PoeGPTModel (line 25) | enum PoeGPTModel {
type PoeClaudeModel (line 30) | enum PoeClaudeModel {
type ClaudeMode (line 36) | enum ClaudeMode {
type ClaudeAPIModel (line 43) | enum ClaudeAPIModel {
type OpenRouterClaudeModel (line 48) | enum OpenRouterClaudeModel {
type PerplexityMode (line 53) | enum PerplexityMode {
type UserConfig (line 87) | type UserConfig = typeof userConfigWithDefaultValue
function getUserConfig (line 89) | async function getUserConfig(): Promise<UserConfig> {
function updateUserConfig (line 117) | async function updateUserConfig(updates: Partial<UserConfig>) {
FILE: src/types/chat.ts
type ChatMessageModel (line 4) | interface ChatMessageModel {
type ConversationModel (line 12) | interface ConversationModel {
FILE: src/types/messaging.ts
type RequestInitSubset (line 1) | type RequestInitSubset = {
type ProxyFetchRequestMessage (line 8) | interface ProxyFetchRequestMessage {
type ProxyFetchResponseMetadata (line 13) | interface ProxyFetchResponseMetadata {
type ProxyFetchResponseMetadataMessage (line 19) | interface ProxyFetchResponseMetadataMessage {
type ProxyFetchResponseBodyChunkMessage (line 24) | type ProxyFetchResponseBodyChunkMessage = {
FILE: src/utils/encoding.ts
function string2Uint8Array (line 1) | function string2Uint8Array(str: string): Uint8Array {
function uint8Array2String (line 6) | function uint8Array2String(uint8Array: Uint8Array): string {
FILE: src/utils/errors.ts
type ErrorCode (line 1) | enum ErrorCode {
class ChatError (line 31) | class ChatError extends Error {
method constructor (line 33) | constructor(message: string, code: ErrorCode) {
FILE: src/utils/format.ts
function formatDecimal (line 1) | function formatDecimal(value: number) {
function formatAmount (line 5) | function formatAmount(value: number) {
function formatTime (line 12) | function formatTime(time: number) {
FILE: src/utils/index.ts
function uuid (line 6) | function uuid() {
function getVersion (line 10) | function getVersion() {
function isProduction (line 14) | function isProduction() {
function cx (line 18) | function cx(...inputs: ClassValue[]) {
FILE: src/utils/sse.ts
function parseSSEResponse (line 13) | async function parseSSEResponse(resp: Response, onMessage: (message: str...
Condensed preview — 225 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (675K chars).
[
{
"path": ".eslintrc.json",
"chars": 484,
"preview": "{\n \"parser\": \"@typescript-eslint/parser\",\n \"env\": {\n \"browser\": true\n },\n \"plugins\": [\"@typescript-eslint\"],\n \"e"
},
{
"path": ".github/ISSUE_TEMPLATE/bug_report.md",
"chars": 346,
"preview": "---\nname: Bug report\nabout: Create a report to help us improve\ntitle: ''\nlabels: ''\nassignees: ''\n\n---\n\n**Describe the b"
},
{
"path": ".github/ISSUE_TEMPLATE/feature_request.md",
"chars": 108,
"preview": "---\nname: Feature request\nabout: Suggest an idea for this project\ntitle: ''\nlabels: ''\nassignees: ''\n\n---\n\n\n"
},
{
"path": ".github/dependabot.yml",
"chars": 502,
"preview": "# To get started with Dependabot version updates, you'll need to specify which\n# package ecosystems to update and where "
},
{
"path": ".github/workflows/close-inactive-issues.yml",
"chars": 705,
"preview": "name: Close inactive issues\non:\n schedule:\n - cron: \"30 1 * * *\"\n\njobs:\n close-issues:\n runs-on: ubuntu-latest\n "
},
{
"path": ".github/workflows/release.yml",
"chars": 787,
"preview": "name: Release Workflow\n\npermissions:\n contents: write\n\non:\n push:\n tags:\n - 'v*.*.*'\n\nenv:\n VITE_PLAUSIBLE_AP"
},
{
"path": ".gitignore",
"chars": 323,
"preview": "# Logs\nlogs\n*.log\nnpm-debug.log*\npnpm-debug.log*\nlerna-debug.log*\n\nnode_modules\ndist\ndist-ssr\n*.local\n\n# Editor director"
},
{
"path": ".prettierignore",
"chars": 12,
"preview": "geeguard.js\n"
},
{
"path": ".prettierrc",
"chars": 249,
"preview": "{\n \"printWidth\": 120,\n \"semi\": false,\n \"tabWidth\": 2,\n \"singleQuote\": true,\n \"trailingComma\": \"all\",\n \"bracketSpac"
},
{
"path": ".yarnrc.yml",
"chars": 25,
"preview": "nodeLinker: node-modules\n"
},
{
"path": "LICENSE",
"chars": 35149,
"preview": " GNU GENERAL PUBLIC LICENSE\n Version 3, 29 June 2007\n\n Copyright (C) 2007 Free "
},
{
"path": "README.md",
"chars": 1756,
"preview": "<p align=\"center\">\n <img src=\"./src/assets/icon.png\" width=\"150\">\n</p>\n\n<h1 align=\"center\">ChatHub</h1>\n\n<div align=\""
},
{
"path": "README_IN.md",
"chars": 5234,
"preview": "<p align=\"center\">\n <img src=\"./src/assets/icon.png\" width=\"150\">\n</p>\n\n<h1 align=\"center\">ChatHub</h1>\n\n<div align=\""
},
{
"path": "README_JA.md",
"chars": 4253,
"preview": "<p align=\"center\">\n <img src=\"./src/assets/icon.png\" width=\"150\">\n</p>\n\n<h1 align=\"center\">ChatHub</h1>\n\n<div align=\""
},
{
"path": "README_ZH-CN.md",
"chars": 3700,
"preview": "<p align=\"center\">\n <img src=\"./src/assets/icon.png\" width=\"150\">\n</p>\n\n<h1 align=\"center\">ChatHub</h1>\n\n<div align=\""
},
{
"path": "README_ZH-TW.md",
"chars": 3720,
"preview": "<p align=\"center\">\n <img src=\"./src/assets/icon.png\" width=\"150\">\n</p>\n\n<h1 align=\"center\">ChatHub</h1>\n\n<div align=\""
},
{
"path": "_locales/de/messages.json",
"chars": 167,
"preview": "{\n \"appName\": {\n \"message\": \"ChatHub - All-in-One Chatbot Klient\"\n },\n \"appDesc\": {\n \"message\": \"Bessere Benutz"
},
{
"path": "_locales/en/messages.json",
"chars": 178,
"preview": "{\n \"appName\": {\n \"message\": \"ChatHub - All-in-one chatbot client\"\n },\n \"appDesc\": {\n \"message\": \"Use ChatGPT, B"
},
{
"path": "_locales/es/messages.json",
"chars": 185,
"preview": "{\n \"appName\": {\n \"message\": \"ChatHub - Cliente de chatbot todo en uno\"\n },\n \"appDesc\": {\n \"message\": \"Utiliza C"
},
{
"path": "_locales/fr/messages.json",
"chars": 178,
"preview": "{\n \"appName\": {\n \"message\": \"ChatHub - Client de chatbot tout-en-un\"\n },\n \"appDesc\": {\n \"message\": \"Une meilleu"
},
{
"path": "_locales/in/messages.json",
"chars": 170,
"preview": "{\n \"appName\": {\n \"message\": \"ChatHub - Semua klien chatbot dalam satu tempat\"\n },\n \"appDesc\": {\n \"message\": \"Se"
},
{
"path": "_locales/ja/messages.json",
"chars": 154,
"preview": "{\n \"appName\": {\n \"message\": \"ChatHub - オールインワンチャットボットクライアント\"\n },\n \"appDesc\": {\n \"message\": \"ChatGPT、Bing、Bard、お"
},
{
"path": "_locales/pt_BR/messages.json",
"chars": 179,
"preview": "{\n \"appName\": {\n \"message\": \"ChatHub - All-in-one chatbot client\"\n },\n \"appDesc\": {\n \"message\": \"Use o ChatGPT,"
},
{
"path": "_locales/pt_PT/messages.json",
"chars": 179,
"preview": "{\n \"appName\": {\n \"message\": \"ChatHub - All-in-one chatbot client\"\n },\n \"appDesc\": {\n \"message\": \"Use o ChatGPT,"
},
{
"path": "_locales/ru/messages.json",
"chars": 164,
"preview": "{\n \"appName\": {\n \"message\": \"ChatHub — универсальный клиент для чат-ботов\"\n },\n \"appDesc\": {\n \"message\": \"Улучш"
},
{
"path": "_locales/th/messages.json",
"chars": 155,
"preview": "{\r\n \"appName\": {\r\n \"message\": \"ChatHub - ไคลเอนต์แชทบอทแบบครบวงจร\"\r\n },\r\n \"appDesc\": {\r\n \"message\": \"UI ที่ดีกว"
},
{
"path": "_locales/zh_CN/messages.json",
"chars": 143,
"preview": "{\n \"appName\": {\n \"message\": \"ChatHub - All-in-one chatbot client\"\n },\n \"appDesc\": {\n \"message\": \"同时使用ChatGPT, B"
},
{
"path": "_locales/zh_TW/messages.json",
"chars": 119,
"preview": "{\n \"appName\": {\n \"message\": \"ChatHub - 全方位聊天機器人客戶端\"\n },\n \"appDesc\": {\n \"message\": \"為您最喜愛的聊天機器人提供更好的用戶界面\"\n }\n}"
},
{
"path": "app.html",
"chars": 363,
"preview": "<!DOCTYPE html>\n<html translate=\"no\">\n <head>\n <meta charset=\"utf-8\" />\n <meta content=\"width=device-width,initia"
},
{
"path": "global.d.ts",
"chars": 23,
"preview": "declare module '*.gql'\n"
},
{
"path": "manifest.config.ts",
"chars": 2101,
"preview": "import { defineManifest } from '@crxjs/vite-plugin'\n\nexport default defineManifest(async () => {\n return {\n manifest"
},
{
"path": "package.json",
"chars": 3537,
"preview": "{\n \"name\": \"chathub-extension\",\n \"private\": true,\n \"version\": \"0.0.0\",\n \"type\": \"module\",\n \"scripts\": {\n \"dev\": "
},
{
"path": "postcss.config.cjs",
"chars": 154,
"preview": "module.exports = {\n plugins: {\n 'postcss-import': {},\n 'tailwindcss/nesting': 'postcss-nesting',\n tailwindcss:"
},
{
"path": "public/js/v2/35536E1E-65B4-4D96-9D97-6ADB7EFF8147/api.js",
"chars": 58248,
"preview": "var arkoseLabsClientApi2c145230;!function(){var e={7983:function(e,t){\"use strict\";t.N=void 0;var n=/^([^\\w]*)(javascrip"
},
{
"path": "sidepanel.html",
"chars": 368,
"preview": "<!DOCTYPE html>\n<html translate=\"no\">\n <head>\n <meta charset=\"utf-8\" />\n <meta content=\"width=device-width,initia"
},
{
"path": "src/app/base.scss",
"chars": 1736,
"preview": "@use 'inter-ui/default' as inter-ui with (\n $inter-font-display: swap,\n $inter-font-path: 'inter-ui/Inter (web)'\n);\n@u"
},
{
"path": "src/app/bots/abstract-bot.ts",
"chars": 3157,
"preview": "import { Sentry } from '~services/sentry'\nimport { ChatError, ErrorCode } from '~utils/errors'\nimport { streamAsyncItera"
},
{
"path": "src/app/bots/baichuan/api.ts",
"chars": 875,
"preview": "import { ofetch } from 'ofetch'\nimport { customAlphabet } from 'nanoid'\nimport { ChatError, ErrorCode } from '~utils/err"
},
{
"path": "src/app/bots/baichuan/index.ts",
"chars": 3661,
"preview": "import { AbstractBot, SendMessageParams } from '../abstract-bot'\nimport { requestHostPermission } from '~app/utils/permi"
},
{
"path": "src/app/bots/bard/api.ts",
"chars": 1311,
"preview": "import { ofetch } from 'ofetch'\nimport { ChatError, ErrorCode } from '~utils/errors'\n\nfunction extractFromHTML(variableN"
},
{
"path": "src/app/bots/bard/index.ts",
"chars": 2985,
"preview": "import { ofetch } from 'ofetch'\nimport { AbstractBot, SendMessageParams } from '../abstract-bot'\nimport { fetchRequestPa"
},
{
"path": "src/app/bots/bing/api.ts",
"chars": 1974,
"preview": "import { random } from 'lodash-es'\nimport { FetchError, FetchResponse, ofetch } from 'ofetch'\nimport { uuid } from '~uti"
},
{
"path": "src/app/bots/bing/index.ts",
"chars": 8408,
"preview": "import { ofetch } from 'ofetch'\nimport WebSocketAsPromised from 'websocket-as-promised'\nimport { requestHostPermission }"
},
{
"path": "src/app/bots/bing/types.ts",
"chars": 2319,
"preview": "import { BingConversationStyle } from '~services/user-config'\n\nexport interface ConversationResponse {\n conversationId:"
},
{
"path": "src/app/bots/bing/utils.ts",
"chars": 1317,
"preview": "import { ChatResponseMessage } from './types'\n\nexport function convertMessageToMarkdown(message: ChatResponseMessage): s"
},
{
"path": "src/app/bots/chatgpt/index.ts",
"chars": 2374,
"preview": "import { ChatGPTMode, getUserConfig } from '~/services/user-config'\nimport * as agent from '~services/agent'\nimport { Ch"
},
{
"path": "src/app/bots/chatgpt-api/index.ts",
"chars": 4827,
"preview": "import { isArray } from 'lodash-es'\nimport { DEFAULT_CHATGPT_SYSTEM_MESSAGE } from '~app/consts'\nimport { UserConfig } f"
},
{
"path": "src/app/bots/chatgpt-api/types.ts",
"chars": 305,
"preview": "export type ContentPart =\n | { type: 'text'; text: string }\n | { type: 'image_url'; image_url: { url: string; detail?:"
},
{
"path": "src/app/bots/chatgpt-azure/index.ts",
"chars": 1012,
"preview": "import { UserConfig } from '~services/user-config'\nimport { AbstractChatGPTApiBot } from '../chatgpt-api'\nimport { ChatM"
},
{
"path": "src/app/bots/chatgpt-webapp/arkose/generator.js",
"chars": 1744,
"preview": "import Browser from 'webextension-polyfill'\n\nclass ArkoseTokenGenerator {\n constructor() {\n this.enforcement = undef"
},
{
"path": "src/app/bots/chatgpt-webapp/arkose/index.ts",
"chars": 257,
"preview": "import { arkoseTokenGenerator } from './generator'\nimport { fetchArkoseToken } from './server'\n\nexport async function ge"
},
{
"path": "src/app/bots/chatgpt-webapp/arkose/server.ts",
"chars": 266,
"preview": "import { ofetch } from 'ofetch'\n\nexport async function fetchArkoseToken(): Promise<string | undefined> {\n try {\n con"
},
{
"path": "src/app/bots/chatgpt-webapp/client.ts",
"chars": 3514,
"preview": "import { ofetch } from 'ofetch'\nimport { RequestInitSubset } from '~types/messaging'\nimport { ChatError, ErrorCode } fro"
},
{
"path": "src/app/bots/chatgpt-webapp/index.ts",
"chars": 5118,
"preview": "import { get as getPath } from 'lodash-es'\nimport { v4 as uuidv4 } from 'uuid'\nimport { getImageSize } from '~app/utils/"
},
{
"path": "src/app/bots/chatgpt-webapp/requesters.ts",
"chars": 2696,
"preview": "import Browser, { Runtime } from 'webextension-polyfill'\nimport { CHATGPT_HOME_URL } from '~app/consts'\nimport { proxyFe"
},
{
"path": "src/app/bots/chatgpt-webapp/types.ts",
"chars": 870,
"preview": "export type ResponsePayload = {\n conversation_id: string\n message: {\n id: string\n author: { role: 'assistant' | "
},
{
"path": "src/app/bots/claude/index.ts",
"chars": 1564,
"preview": "import { ClaudeMode, getUserConfig } from '~/services/user-config'\nimport * as agent from '~services/agent'\nimport { Asy"
},
{
"path": "src/app/bots/claude-api/index.ts",
"chars": 2314,
"preview": "import { requestHostPermission } from '~app/utils/permissions'\nimport { ClaudeAPIModel, UserConfig } from '~services/use"
},
{
"path": "src/app/bots/claude-web/api.ts",
"chars": 1540,
"preview": "import { FetchError, ofetch } from 'ofetch'\nimport { uuid } from '~utils'\nimport { ChatError, ErrorCode } from '~utils/e"
},
{
"path": "src/app/bots/claude-web/index.ts",
"chars": 2605,
"preview": "import { parseSSEResponse } from '~utils/sse'\nimport { AbstractBot, SendMessageParams } from '../abstract-bot'\nimport { "
},
{
"path": "src/app/bots/gemini-api/index.ts",
"chars": 1620,
"preview": "import { GoogleGenerativeAI, ChatSession } from '@google/generative-ai'\nimport { AbstractBot, AsyncAbstractBot, SendMess"
},
{
"path": "src/app/bots/gradio/index.ts",
"chars": 3748,
"preview": "import WebSocketAsPromised from 'websocket-as-promised'\nimport { ChatError, ErrorCode } from '~utils/errors'\nimport { Ab"
},
{
"path": "src/app/bots/grok/index.ts",
"chars": 4622,
"preview": "import { FetchError, ofetch } from 'ofetch'\nimport Browser from 'webextension-polyfill'\nimport { requestHostPermission }"
},
{
"path": "src/app/bots/index.ts",
"chars": 1826,
"preview": "import { BaichuanWebBot } from './baichuan'\nimport { BardBot } from './bard'\nimport { BingWebBot } from './bing'\nimport "
},
{
"path": "src/app/bots/lmsys/index.ts",
"chars": 1625,
"preview": "import WebSocketAsPromised from 'websocket-as-promised'\nimport { GradioBot } from '../gradio'\nimport { ChatError, ErrorC"
},
{
"path": "src/app/bots/openrouter/index.ts",
"chars": 2871,
"preview": "import { requestHostPermission } from '~app/utils/permissions'\nimport { ChatError, ErrorCode } from '~utils/errors'\nimpo"
},
{
"path": "src/app/bots/perplexity/index.ts",
"chars": 665,
"preview": "import { PerplexityMode, getUserConfig } from '~/services/user-config'\nimport { AsyncAbstractBot } from '../abstract-bot"
},
{
"path": "src/app/bots/perplexity-api/api.ts",
"chars": 740,
"preview": "import { ofetch } from 'ofetch'\n\nasync function getSessionId() {\n const resp: string = await ofetch('https://labs-api.p"
},
{
"path": "src/app/bots/perplexity-api/index.ts",
"chars": 2097,
"preview": "import { parseSSEResponse } from '~utils/sse'\nimport { AbstractBot, SendMessageParams } from '../abstract-bot'\n\ninterfac"
},
{
"path": "src/app/bots/perplexity-web/api.ts",
"chars": 1020,
"preview": "import { FetchError, ofetch } from 'ofetch'\nimport { ChatError, ErrorCode } from '~utils/errors'\n\nasync function getSess"
},
{
"path": "src/app/bots/perplexity-web/index.ts",
"chars": 2852,
"preview": "import WebSocketAsPromised from 'websocket-as-promised'\nimport { requestHostPermissions } from '~app/utils/permissions'\n"
},
{
"path": "src/app/bots/pi/index.ts",
"chars": 1365,
"preview": "import { requestHostPermission } from '~app/utils/permissions'\nimport { ChatError, ErrorCode } from '~utils/errors'\nimpo"
},
{
"path": "src/app/bots/poe/api.ts",
"chars": 2494,
"preview": "import md5 from 'md5'\nimport { ofetch } from 'ofetch'\nimport i18n from '~app/i18n'\nimport { decodePoeFormkey } from '~se"
},
{
"path": "src/app/bots/poe/graphql/AddMessageBreakMutation.graphql",
"chars": 295,
"preview": "mutation AddMessageBreakMutation($chatId: BigInt!) {\n messageBreakCreate(chatId: $chatId) {\n message {\n id\n "
},
{
"path": "src/app/bots/poe/graphql/AutoSubscriptionMutation.graphql",
"chars": 162,
"preview": "mutation AutoSubscriptionMutation($subscriptions: [AutoSubscriptionQuery!]!) {\n autoSubscribe(subscriptions: $subscript"
},
{
"path": "src/app/bots/poe/graphql/ChatViewQuery.graphql",
"chars": 134,
"preview": "query ChatViewQuery($bot: String!) {\n chatOfBot(bot: $bot) {\n id\n chatId\n defaultBotNickname\n shouldShowDis"
},
{
"path": "src/app/bots/poe/graphql/MessageAddedSubscription.graphql",
"chars": 1880,
"preview": "subscription messageAdded($chatId: BigInt!) {\n messageAdded(chatId: $chatId) {\n id\n messageId\n creationTime\n "
},
{
"path": "src/app/bots/poe/graphql/SendMessageMutation.graphql",
"chars": 710,
"preview": "mutation chatHelpers_sendMessageMutation_Mutation(\n $chatId: BigInt!\n $bot: String!\n $query: String!\n $source: Messa"
},
{
"path": "src/app/bots/poe/graphql/SubscriptionsMutation.graphql",
"chars": 159,
"preview": "mutation subscriptionsMutation($subscriptions: [AutoSubscriptionQuery!]!) {\n autoSubscribe(subscriptions: $subscription"
},
{
"path": "src/app/bots/poe/graphql/ViewerStateUpdatedSubscription.graphql",
"chars": 657,
"preview": "subscription viewerStateUpdated {\n viewerStateUpdated {\n id\n ...ChatPageBotSwitcher_viewer\n }\n}\n\nfragment BotHea"
},
{
"path": "src/app/bots/poe/index.ts",
"chars": 5943,
"preview": "import { t } from 'i18next'\nimport WebSocketAsPromised from 'websocket-as-promised'\nimport { requestHostPermission } fro"
},
{
"path": "src/app/bots/qianwen/api.ts",
"chars": 1250,
"preview": "import { ofetch } from 'ofetch'\nimport { ChatError, ErrorCode } from '~utils/errors'\n\ninterface CreationResponse {\n dat"
},
{
"path": "src/app/bots/qianwen/index.ts",
"chars": 2441,
"preview": "import { requestHostPermissions } from '~app/utils/permissions'\nimport { uuid } from '~utils'\nimport { ChatError, ErrorC"
},
{
"path": "src/app/bots/xunfei/api.ts",
"chars": 1032,
"preview": "import { ofetch } from 'ofetch'\nimport './geeguard'\nimport { ChatError, ErrorCode } from '~utils/errors'\n\nexport async f"
},
{
"path": "src/app/bots/xunfei/geeguard.js",
"chars": 163518,
"preview": "_MNVo.$_Aq=function(){var $_BDGR=2;for(;$_BDGR!==1;){switch($_BDGR){case 2:return{$_BDHO:function($_BDIz){var $_BDJb=2;f"
},
{
"path": "src/app/bots/xunfei/index.ts",
"chars": 2444,
"preview": "import { requestHostPermission } from '~app/utils/permissions'\nimport { Base64 } from 'js-base64'\nimport { AbstractBot, "
},
{
"path": "src/app/components/Button.tsx",
"chars": 1478,
"preview": "import { cx } from '~/utils'\nimport { ButtonHTMLAttributes, FC, ReactNode } from 'react'\nimport { BeatLoader } from 'rea"
},
{
"path": "src/app/components/Chat/ChatMessageCard.tsx",
"chars": 2253,
"preview": "import { cx } from '~/utils'\nimport { FC, memo, useEffect, useMemo, useState } from 'react'\nimport { CopyToClipboard } f"
},
{
"path": "src/app/components/Chat/ChatMessageInput.tsx",
"chars": 7039,
"preview": "import {\n FloatingFocusManager,\n FloatingList,\n autoUpdate,\n flip,\n offset,\n shift,\n useDismiss,\n useFloating,\n "
},
{
"path": "src/app/components/Chat/ChatMessageList.tsx",
"chars": 760,
"preview": "import { FC } from 'react'\nimport { cx } from '~/utils'\nimport ScrollToBottom from 'react-scroll-to-bottom'\nimport { Bot"
},
{
"path": "src/app/components/Chat/ChatbotName.tsx",
"chars": 913,
"preview": "import { FC, memo } from 'react'\nimport dropdownIcon from '~/assets/icons/dropdown.svg'\nimport { BotId } from '~app/bots"
},
{
"path": "src/app/components/Chat/ConversationPanel.tsx",
"chars": 5916,
"preview": "import { motion } from 'framer-motion'\nimport { FC, ReactNode, useCallback, useMemo, useState } from 'react'\nimport { us"
},
{
"path": "src/app/components/Chat/ErrorAction.tsx",
"chars": 6304,
"preview": "import { FC, useCallback, useContext, useMemo, useState } from 'react'\nimport { useTranslation } from 'react-i18next'\nim"
},
{
"path": "src/app/components/Chat/LayoutSwitch.tsx",
"chars": 1589,
"preview": "import { cx } from '~/utils'\nimport { FC } from 'react'\nimport { Layout } from '~app/consts'\nimport layoutFourIcon from "
},
{
"path": "src/app/components/Chat/MessageBubble.tsx",
"chars": 506,
"preview": "import { cx } from '~/utils'\nimport { FC, PropsWithChildren } from 'react'\n\ninterface Props {\n color: 'primary' | 'flat"
},
{
"path": "src/app/components/Chat/TextInput.tsx",
"chars": 1807,
"preview": "import { cx } from '~/utils'\nimport React, { KeyboardEventHandler, useCallback, useImperativeHandle, useRef } from 'reac"
},
{
"path": "src/app/components/Chat/WebAccessCheckbox.tsx",
"chars": 2446,
"preview": "import { Switch } from '@headlessui/react'\nimport { useSetAtom } from 'jotai'\nimport { FC, memo, useCallback, useEffect,"
},
{
"path": "src/app/components/Dialog.tsx",
"chars": 2564,
"preview": "import { Dialog as HeadlessDialog, Transition } from '@headlessui/react'\nimport { FC, Fragment, PropsWithChildren } from"
},
{
"path": "src/app/components/GuideModal.tsx",
"chars": 1190,
"preview": "import { FC, useEffect, useState } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport { incrAppOpenTimes"
},
{
"path": "src/app/components/History/ChatMessage.tsx",
"chars": 1469,
"preview": "import { cx } from '~/utils'\nimport { FC, memo, useCallback } from 'react'\nimport { FiTrash2 } from 'react-icons/fi'\nimp"
},
{
"path": "src/app/components/History/Content.tsx",
"chars": 2860,
"preview": "import Fuse from 'fuse.js'\nimport { flatMap } from 'lodash-es'\nimport { FC, memo, useMemo, useRef } from 'react'\nimport "
},
{
"path": "src/app/components/History/Dialog.tsx",
"chars": 2476,
"preview": "import { cx } from '~/utils'\nimport { FC, useCallback, useMemo, useState } from 'react'\nimport { useTranslation } from '"
},
{
"path": "src/app/components/Input.tsx",
"chars": 1139,
"preview": "import { cx } from '~/utils'\nimport { FC, HTMLProps } from 'react'\nimport TextareaAutosize, { TextareaAutosizeProps } fr"
},
{
"path": "src/app/components/Layout.tsx",
"chars": 876,
"preview": "import { Outlet } from '@tanstack/react-router'\nimport { useAtomValue } from 'jotai'\nimport { followArcThemeAtom, themeC"
},
{
"path": "src/app/components/Markdown/index.tsx",
"chars": 2498,
"preview": "/* eslint-disable react/prop-types */\n\nimport { cx } from '~/utils'\nimport 'github-markdown-css'\nimport { FC, ReactNode,"
},
{
"path": "src/app/components/Markdown/markdown.css",
"chars": 551,
"preview": ".markdown-custom-styles {\n color: inherit;\n background-color: transparent;\n > p {\n margin-bottom: 5px;\n }\n > ul,"
},
{
"path": "src/app/components/Modals/ReleaseNotesModal.tsx",
"chars": 982,
"preview": "import { useAtom } from 'jotai'\nimport { FC } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport { relea"
},
{
"path": "src/app/components/Page.tsx",
"chars": 559,
"preview": "import { FC, PropsWithChildren } from 'react'\n\nconst PagePanel: FC<PropsWithChildren<{ title: string }>> = (props) => {\n"
},
{
"path": "src/app/components/Premium/DiscountBadge.tsx",
"chars": 337,
"preview": "import { FC } from 'react'\nimport { useTranslation } from 'react-i18next'\n\nconst DiscountBadge: FC = () => {\n const { t"
},
{
"path": "src/app/components/Premium/DiscountModal.tsx",
"chars": 2806,
"preview": "import { useAtom, useSetAtom } from 'jotai'\nimport { FC, useCallback, useEffect, useState } from 'react'\nimport { useTra"
},
{
"path": "src/app/components/Premium/FeatureList.tsx",
"chars": 2723,
"preview": "import { FC, useMemo } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport { BsQuestionCircle } from 'rea"
},
{
"path": "src/app/components/Premium/Modal.tsx",
"chars": 2281,
"preview": "import { useNavigate } from '@tanstack/react-router'\nimport { useAtom } from 'jotai'\nimport { FC, useCallback, useEffect"
},
{
"path": "src/app/components/Premium/PriceSection.tsx",
"chars": 2941,
"preview": "import dayjs, { Dayjs } from 'dayjs'\nimport humanizeDuration from 'humanize-duration'\nimport { FC, useEffect, useMemo, u"
},
{
"path": "src/app/components/Premium/Testimonials.tsx",
"chars": 1104,
"preview": "import { sample } from 'lodash-es'\nimport { FC } from 'react'\nimport { AiFillStar } from 'react-icons/ai'\n\nconst Testimo"
},
{
"path": "src/app/components/PromptCombobox.tsx",
"chars": 2172,
"preview": "import { useInteractions, useListItem } from '@floating-ui/react'\nimport { cx } from '~/utils'\nimport { t } from 'i18nex"
},
{
"path": "src/app/components/PromptLibrary/Dialog.tsx",
"chars": 516,
"preview": "import PromptLibrary from './Library'\nimport Dialog from '../Dialog'\n\ninterface Props {\n isOpen: boolean\n onClose: () "
},
{
"path": "src/app/components/PromptLibrary/Library.tsx",
"chars": 7823,
"preview": "import { Suspense, useCallback, useMemo, useState } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport {"
},
{
"path": "src/app/components/RadioGroup.tsx",
"chars": 1168,
"preview": "import { FC, useId } from 'react'\n\ninterface Option {\n label: string\n value: string\n}\n\nconst RadioItem = (props: { opt"
},
{
"path": "src/app/components/Select.tsx",
"chars": 3520,
"preview": "import { Listbox, Transition } from '@headlessui/react'\nimport { CheckIcon, ChevronUpDownIcon } from '@heroicons/react/2"
},
{
"path": "src/app/components/Settings/Blockquote.tsx",
"chars": 338,
"preview": "import { FC, PropsWithChildren } from 'react'\nimport { cx } from '~utils'\n\nconst Blockquote: FC<PropsWithChildren<{ clas"
},
{
"path": "src/app/components/Settings/ChatGPTAPISettings.tsx",
"chars": 2101,
"preview": "import { FC } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport { CHATGPT_API_MODELS, DEFAULT_CHATGPT_S"
},
{
"path": "src/app/components/Settings/ChatGPTAzureSettings.tsx",
"chars": 1451,
"preview": "import { FC } from 'react'\nimport { UserConfig } from '~services/user-config'\nimport { Input } from '../Input'\n\ninterfac"
},
{
"path": "src/app/components/Settings/ChatGPTOpenRouterSettings.tsx",
"chars": 1397,
"preview": "import { FC } from 'react'\nimport { CHATGPT_API_MODELS } from '~app/consts'\nimport { UserConfig } from '~services/user-c"
},
{
"path": "src/app/components/Settings/ChatGPTPoeSettings.tsx",
"chars": 1001,
"preview": "import { FC } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport { PoeGPTModel, UserConfig } from '~serv"
},
{
"path": "src/app/components/Settings/ChatGPTWebSettings.tsx",
"chars": 1172,
"preview": "import { FC } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport { ChatGPTWebModel, UserConfig } from '~"
},
{
"path": "src/app/components/Settings/ClaudeAPISettings.tsx",
"chars": 1374,
"preview": "import { FC } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport { ClaudeAPIModel, UserConfig } from '~s"
},
{
"path": "src/app/components/Settings/ClaudeOpenRouterSettings.tsx",
"chars": 1476,
"preview": "import { FC } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport { OpenRouterClaudeModel, UserConfig } f"
},
{
"path": "src/app/components/Settings/ClaudePoeSettings.tsx",
"chars": 1153,
"preview": "import { FC } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport { PoeClaudeModel, UserConfig } from '~s"
},
{
"path": "src/app/components/Settings/ClaudeWebappSettings.tsx",
"chars": 819,
"preview": "import { FC } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport { UserConfig } from '~services/user-con"
},
{
"path": "src/app/components/Settings/EnabledBotsSettings.tsx",
"chars": 1551,
"preview": "import { FC, useCallback } from 'react'\nimport { BotId } from '~app/bots'\nimport { CHATBOTS } from '~app/consts'\nimport "
},
{
"path": "src/app/components/Settings/ExportDataPanel.tsx",
"chars": 756,
"preview": "import { useTranslation } from 'react-i18next'\nimport { BiExport, BiImport } from 'react-icons/bi'\nimport { exportData, "
},
{
"path": "src/app/components/Settings/KDB.tsx",
"chars": 275,
"preview": "export default function KDB(props: { text: string }) {\n return (\n <kbd className=\"px-2 py-1.5 text-sm font-semibold "
},
{
"path": "src/app/components/Settings/PerplexityAPISettings.tsx",
"chars": 1276,
"preview": "import { FC } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport { UserConfig } from '~services/user-con"
},
{
"path": "src/app/components/Settings/ShortcutPanel.tsx",
"chars": 1253,
"preview": "import { useEffect, useState } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport Browser from 'webexten"
},
{
"path": "src/app/components/Share/Dialog.tsx",
"chars": 1539,
"preview": "import { useState } from 'react'\nimport { cx } from '~/utils'\nimport { AiFillCloud, AiFillFileMarkdown } from 'react-ico"
},
{
"path": "src/app/components/Share/MarkdownView.tsx",
"chars": 1106,
"preview": "import { FC, useCallback, useMemo, useState } from 'react'\nimport { trackEvent } from '~app/plausible'\nimport { ChatMess"
},
{
"path": "src/app/components/Share/ShareGPTView.tsx",
"chars": 1680,
"preview": "import { FC, useCallback, useState } from 'react'\nimport { trackEvent } from '~app/plausible'\nimport { ChatMessageModel "
},
{
"path": "src/app/components/Share/sharegpt.ts",
"chars": 2167,
"preview": "import { ofetch } from 'ofetch'\nimport rehypeStringify from 'rehype-stringify'\nimport remarkGfm from 'remark-gfm'\nimport"
},
{
"path": "src/app/components/Sidebar/NavLink.tsx",
"chars": 872,
"preview": "import { Link, LinkOptions } from '@tanstack/react-router'\nimport { cx } from '~/utils'\n\nfunction NavLink(props: LinkOpt"
},
{
"path": "src/app/components/Sidebar/PremiumEntry.tsx",
"chars": 956,
"preview": "import { motion } from 'framer-motion'\nimport { Link } from '@tanstack/react-router'\nimport { FC } from 'react'\nimport p"
},
{
"path": "src/app/components/Sidebar/index.tsx",
"chars": 5145,
"preview": "import { Link } from '@tanstack/react-router'\nimport { motion } from 'framer-motion'\nimport { useAtom, useSetAtom } from"
},
{
"path": "src/app/components/SwitchBotDropdown.tsx",
"chars": 1874,
"preview": "import { Menu, Transition } from '@headlessui/react'\nimport { FC, Fragment, ReactNode } from 'react'\nimport { BotId } fr"
},
{
"path": "src/app/components/Tabs.tsx",
"chars": 901,
"preview": "import { FC, useState } from 'react'\nimport { cx } from '~/utils'\n\nexport interface Tab {\n name: string\n value: string"
},
{
"path": "src/app/components/ThemeSettingModal/index.tsx",
"chars": 6562,
"preview": "import { Link } from '@tanstack/react-router'\nimport { cx } from '~/utils'\nimport { useAtom } from 'jotai'\nimport { Comp"
},
{
"path": "src/app/components/Toggle.tsx",
"chars": 848,
"preview": "import { Switch } from '@headlessui/react'\nimport { cx } from '~/utils'\nimport { FC } from 'react'\n\ninterface Props {\n "
},
{
"path": "src/app/components/Tooltip.tsx",
"chars": 1247,
"preview": "import * as ReactTooltip from '@radix-ui/react-tooltip'\nimport { FC, PropsWithChildren } from 'react'\n\ninterface Props {"
},
{
"path": "src/app/consts.ts",
"chars": 2605,
"preview": "import claudeLogo from '~/assets/logos/anthropic.png'\nimport baichuanLogo from '~/assets/logos/baichuan.png'\nimport bard"
},
{
"path": "src/app/context.ts",
"chars": 194,
"preview": "import { createContext } from 'react'\n\nexport interface ConversationContextValue {\n reset: () => void\n}\n\nexport const C"
},
{
"path": "src/app/hooks/use-chat.ts",
"chars": 4065,
"preview": "import { useAtom } from 'jotai'\nimport { useCallback, useEffect, useMemo } from 'react'\nimport { trackEvent } from '~app"
},
{
"path": "src/app/hooks/use-enabled-bots.ts",
"chars": 548,
"preview": "import useSWR from 'swr/immutable'\nimport { BotId } from '~app/bots'\nimport { CHATBOTS } from '~app/consts'\nimport { get"
},
{
"path": "src/app/hooks/use-premium.ts",
"chars": 1003,
"preview": "import { FetchError } from 'ofetch'\nimport useSWR from 'swr'\nimport { getPremiumActivation, validatePremium } from '~ser"
},
{
"path": "src/app/hooks/use-purchase-info.ts",
"chars": 499,
"preview": "import dayjs from 'dayjs'\nimport useSWR from 'swr'\nimport { fetchPurchaseInfo } from '~services/server-api'\n\nexport func"
},
{
"path": "src/app/hooks/use-user-config.ts",
"chars": 234,
"preview": "import useSWRImmutable from 'swr/immutable'\nimport { getUserConfig } from '~services/user-config'\n\nexport function useUs"
},
{
"path": "src/app/i18n/index.ts",
"chars": 1378,
"preview": "import i18n, { Resource } from 'i18next'\nimport LanguageDetector from 'i18next-browser-languagedetector'\nimport { initRe"
},
{
"path": "src/app/i18n/locales/french.json",
"chars": 5074,
"preview": "{\n \"Shortcut to open this app\": \"Raccourci pour ouvrir cette application\",\n \"Settings\": \"Paramètres\",\n \"Startup page\""
},
{
"path": "src/app/i18n/locales/german.json",
"chars": 4902,
"preview": "{\n \"Shortcut to open this app\": \"Verknüpfung zum Öffnen dieser App\",\n \"Settings\": \"Einstellungen\",\n \"Startup page\": \""
},
{
"path": "src/app/i18n/locales/indonesia.json",
"chars": 4699,
"preview": "{\n \"Shortcut to open this app\": \"Jalan pintas untuk membuka aplikasi ini\",\n \"Settings\": \"Pengaturan\",\n \"Startup page\""
},
{
"path": "src/app/i18n/locales/japanese.json",
"chars": 4395,
"preview": "{\n \"Shortcut to open this app\": \"このアプリを開くショートカット\",\n \"Settings\": \"設定\",\n \"Startup page\": \"スタートアップページ\",\n \"Chat style\": "
},
{
"path": "src/app/i18n/locales/portuguese.json",
"chars": 4836,
"preview": "{\n \"Shortcut to open this app\": \"Atalho para abrir este aplicativo\",\n \"Settings\": \"Configurações\",\n \"Startup page\": \""
},
{
"path": "src/app/i18n/locales/simplified-chinese.json",
"chars": 3925,
"preview": "{\n \"Shortcut to open this app\": \"打开ChatHub的快捷键\",\n \"Settings\": \"设置\",\n \"Startup page\": \"启动页面\",\n \"Chat style\": \"会话风格\",\n"
},
{
"path": "src/app/i18n/locales/spanish.json",
"chars": 4890,
"preview": "{\n \"Shortcut to open this app\": \"Atajo para abrir esta aplicación\",\n \"Settings\": \"Configuración\",\n \"Startup page\": \"P"
},
{
"path": "src/app/i18n/locales/thai.json",
"chars": 4452,
"preview": "{\n \"Shortcut to open this app\": \"ทางลัดเพื่อเปิดแอปนี้\",\n \"Settings\": \"การตั้งค่า\",\n \"Startup page\": \"หน้าเริ่มต้น\",\n"
},
{
"path": "src/app/i18n/locales/traditional-chinese.json",
"chars": 3564,
"preview": "{\n \"Shortcut to open this app\": \"打開ChatHub的快捷鍵\",\n \"Settings\": \"設置\",\n \"Startup page\": \"啟動頁面\",\n \"Chat style\": \"會話風格\",\n"
},
{
"path": "src/app/main.tsx",
"chars": 408,
"preview": "import { RouterProvider } from '@tanstack/react-router'\nimport { createRoot } from 'react-dom/client'\nimport '../service"
},
{
"path": "src/app/pages/MultiBotChatPanel.tsx",
"chars": 7549,
"preview": "import { useAtom, useAtomValue, useSetAtom } from 'jotai'\nimport { atomWithStorage } from 'jotai/utils'\nimport { sample,"
},
{
"path": "src/app/pages/PremiumPage.tsx",
"chars": 4373,
"preview": "import { useSearch } from '@tanstack/react-router'\nimport { get as getPath } from 'lodash-es'\nimport { useCallback, useS"
},
{
"path": "src/app/pages/SettingPage.tsx",
"chars": 9294,
"preview": "import { motion } from 'framer-motion'\nimport { FC, PropsWithChildren, useCallback, useEffect, useState } from 'react'\ni"
},
{
"path": "src/app/pages/SidePanelPage.tsx",
"chars": 2840,
"preview": "import { useAtom } from 'jotai'\nimport { useCallback, useMemo } from 'react'\nimport { useTranslation } from 'react-i18ne"
},
{
"path": "src/app/pages/SingleBotChatPanel.tsx",
"chars": 694,
"preview": "import { FC } from 'react'\nimport { useChat } from '~app/hooks/use-chat'\nimport { BotId } from '../bots'\nimport Conversa"
},
{
"path": "src/app/plausible.ts",
"chars": 627,
"preview": "import { isUndefined, omitBy } from 'lodash-es'\nimport Plausible from 'plausible-tracker'\nimport { getVersion } from '~u"
},
{
"path": "src/app/router.tsx",
"chars": 1544,
"preview": "import { createHashHistory, createRootRoute, createRoute, createRouter, useParams } from '@tanstack/react-router'\nimport"
},
{
"path": "src/app/sidepanel.css",
"chars": 52,
"preview": "html,\nbody,\n#app {\n width: 100%;\n height: 100%;\n}\n"
},
{
"path": "src/app/sidepanel.tsx",
"chars": 1367,
"preview": "import { useCallback } from 'react'\nimport { createRoot } from 'react-dom/client'\nimport { useTranslation } from 'react-"
},
{
"path": "src/app/state/index.ts",
"chars": 1517,
"preview": "import { atom } from 'jotai'\nimport { atomWithImmer } from 'jotai-immer'\nimport { atomFamily, atomWithStorage } from 'jo"
},
{
"path": "src/app/theme.ts",
"chars": 152,
"preview": "import { getUserThemeMode } from '~services/theme'\nimport { applyThemeMode } from './utils/color-scheme'\n\napplyThemeMode"
},
{
"path": "src/app/utils/color-scheme.ts",
"chars": 1235,
"preview": "import { ThemeMode } from '~services/theme'\n\nconst COLOR_SCHEME_QUERY = '(prefers-color-scheme: dark)'\n\nfunction light()"
},
{
"path": "src/app/utils/env.ts",
"chars": 150,
"preview": "function isArcBrowser() {\n return getComputedStyle(document.documentElement).getPropertyValue('--arc-palette-background"
},
{
"path": "src/app/utils/export.ts",
"chars": 1308,
"preview": "import { fileOpen, fileSave } from 'browser-fs-access'\nimport Browser from 'webextension-polyfill'\nimport { trackEvent }"
},
{
"path": "src/app/utils/image-compression/index.ts",
"chars": 1145,
"preview": "import { createCache } from 'async-cache-dedupe'\nimport CompressionWorker from './worker?worker'\n\nasync function compres"
},
{
"path": "src/app/utils/image-compression/worker.ts",
"chars": 327,
"preview": "import imageCompression from 'browser-image-compression'\n\nself.addEventListener('message', async (event) => {\n console."
},
{
"path": "src/app/utils/image-size.ts",
"chars": 383,
"preview": "export async function getImageSize(file: File): Promise<{ width: number; height: number }> {\n return new Promise((resol"
},
{
"path": "src/app/utils/markdown.ts",
"chars": 169,
"preview": "import TurndownService from 'turndown'\n\nconst turndownService = new TurndownService()\n\nexport function html2md(html: str"
},
{
"path": "src/app/utils/navigator.ts",
"chars": 1106,
"preview": "const ua = navigator.userAgent\n\nconst getBrowser = (): 'Opera' | 'Chrome' | 'Firefox' | 'Safari' | 'IE' | 'Edge' | 'Unkn"
},
{
"path": "src/app/utils/permissions.ts",
"chars": 415,
"preview": "import Browser from 'webextension-polyfill'\n\nexport async function requestHostPermissions(hosts: string[]) {\n const per"
},
{
"path": "src/background/index.ts",
"chars": 1601,
"preview": "import Browser from 'webextension-polyfill'\nimport { ALL_IN_ONE_PAGE_ID } from '~app/consts'\nimport { getUserConfig } fr"
},
{
"path": "src/background/source.ts",
"chars": 599,
"preview": "import { ofetch } from 'ofetch'\n\nconst plausibleApiHost = import.meta.env.VITE_PLAUSIBLE_API_HOST || 'https://plausible."
},
{
"path": "src/background/twitter-cookie.ts",
"chars": 953,
"preview": "/**\n * How it works: pass message via storage.session\n */\n\nimport Browser from 'webextension-polyfill'\nimport Cookie fro"
},
{
"path": "src/content-script/chatgpt-inpage-proxy.ts",
"chars": 888,
"preview": "import Browser from 'webextension-polyfill'\nimport { setupProxyExecutor } from '~services/proxy-fetch'\n\nfunction injectT"
},
{
"path": "src/rules/baichuan.json",
"chars": 508,
"preview": "[\n {\n \"id\": 1,\n \"priority\": 1,\n \"action\": {\n \"type\": \"modifyHeaders\",\n \"requestHeaders\": [\n {"
},
{
"path": "src/rules/bing.json",
"chars": 526,
"preview": "[\n {\n \"id\": 1,\n \"priority\": 1,\n \"action\": {\n \"type\": \"modifyHeaders\",\n \"requestHeaders\": [\n {"
},
{
"path": "src/rules/ddg.json",
"chars": 451,
"preview": "[\n {\n \"id\": 3,\n \"priority\": 1,\n \"action\": {\n \"type\": \"modifyHeaders\",\n \"requestHeaders\": [\n {"
},
{
"path": "src/rules/pplx.json",
"chars": 538,
"preview": "[\n {\n \"id\": 1,\n \"priority\": 1,\n \"action\": {\n \"type\": \"modifyHeaders\",\n \"requestHeaders\": [\n {"
},
{
"path": "src/rules/qianwen.json",
"chars": 504,
"preview": "[\n {\n \"id\": 1,\n \"priority\": 1,\n \"action\": {\n \"type\": \"modifyHeaders\",\n \"requestHeaders\": [\n {"
},
{
"path": "src/services/agent/index.ts",
"chars": 2921,
"preview": "import { removeSlashes } from 'slashes'\nimport { PROMPT_TEMPLATE } from './prompts'\nimport { searchRelatedContext } from"
},
{
"path": "src/services/agent/prompts.ts",
"chars": 1282,
"preview": "export const PROMPT_TEMPLATE = `USER'S INPUT\n--------------------\nHere is the user's input (remember to respond with a m"
},
{
"path": "src/services/agent/web-search/base.ts",
"chars": 285,
"preview": "export interface SearchResultItem {\n title: string\n abstract: string\n link: string\n}\n\nexport interface SearchResult {"
},
{
"path": "src/services/agent/web-search/bing-news.ts",
"chars": 1134,
"preview": "import { ofetch } from 'ofetch'\nimport WebSearch, { SearchResult } from './base'\n\nexport class BingNewsSearch extends We"
},
{
"path": "src/services/agent/web-search/duckduckgo.ts",
"chars": 1177,
"preview": "import { ofetch } from 'ofetch'\nimport WebSearch, { SearchResult } from './base'\n\nexport class DuckDuckGoSearch extends "
},
{
"path": "src/services/agent/web-search/index.ts",
"chars": 1660,
"preview": "import { cachified } from '@epic-web/cachified'\nimport { truncate } from 'lodash-es'\nimport type { SearchResultItem } fr"
},
{
"path": "src/services/chat-history.ts",
"chars": 2765,
"preview": "import { zip } from 'lodash-es'\nimport Browser from 'webextension-polyfill'\nimport { BotId } from '~app/bots'\nimport { C"
}
]
// ... and 25 more files (download for full content)
About this extraction
This page contains the full source code of the chathub-dev/chathub GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 225 files (622.7 KB), approximately 223.1k tokens, and a symbol index with 630 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.